From fead481f02f39c3ea1779c267cf4b30d6c9437b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Gonz=C3=A1lez=20Viegas?= Date: Wed, 29 May 2024 17:04:53 +0200 Subject: [PATCH] fix: correct camera and grid disposal logic --- examples/Civil3DNavigator/index.html | 2 +- .../CivilCrossSectionNavigator/index.html | 4 +- examples/CivilElevationNavigator/index.html | 4 +- examples/CivilPlanNavigator/index.html | 4 +- examples/Cullers/index.html | 4 +- examples/IfcGeometryTiler/index.html | 2 +- examples/IfcJsonExporter/index.html | 6 +- examples/IfcLoader/index.html | 8 +- examples/IfcPropertiesTiler/index.html | 4 +- examples/IfcRelationsIndexer/index.html | 8 +- examples/Utils/index.html | 6 +- examples/assets/civil3DNavigator.js | 2 +- examples/assets/civilCrossSectionNavigator.js | 2 +- examples/assets/civilElevationNavigator.js | 2 +- examples/assets/civilPlanNavigator.js | 2 +- examples/assets/cullers.js | 2 +- examples/assets/ifcGeometryTiler.js | 2 +- examples/assets/ifcJsonExporter.js | 2 +- examples/assets/ifcLoader.js | 2 +- examples/assets/ifcPropertiesTiler.js | 2 +- examples/assets/ifcRelationsIndexer.js | 2 +- .../{index-DJTKMiao.js => index-BraZXcLv.js} | 8 +- .../{index-BLLWNBJ2.js => index-C9jIYBP8.js} | 2 +- .../{index-BaoxwJyW.js => index-Ch1tb-j6.js} | 118 +++++++++--------- .../{index-DHVa0dFp.js => index-D6HCkz61.js} | 2 +- .../{index-BzmpwuIQ.js => index-DDOiyGyA.js} | 2 +- .../{index-D_n-lttT.js => index-DvHc-rVc.js} | 2 +- .../{index-buhHUNtp.js => index-PenRR3X-.js} | 2 +- examples/assets/miniMap.js | 26 ++-- examples/assets/orthoPerspectiveCamera.js | 19 +-- examples/assets/utils.js | 2 +- package.json | 2 +- packages/core/package.json | 2 +- .../core/src/core/Grids/src/simple-grid.ts | 4 + packages/core/src/core/MiniMap/example.ts | 10 +- .../core/OrthoPerspectiveCamera/example.ts | 60 +++++++-- .../src/core/OrthoPerspectiveCamera/index.ts | 20 +-- packages/core/src/core/Types/src/world.ts | 1 + .../core/src/core/Worlds/src/simple-camera.ts | 1 - .../core/src/core/Worlds/src/simple-world.ts | 3 + packages/core/src/fragments/Hider/example.ts | 3 - .../src/ifc/IfcRelationsIndexer/example.ts | 2 +- packages/front/package.json | 4 +- 43 files changed, 204 insertions(+), 163 deletions(-) rename examples/assets/{index-DJTKMiao.js => index-BraZXcLv.js} (87%) rename examples/assets/{index-BLLWNBJ2.js => index-C9jIYBP8.js} (99%) rename examples/assets/{index-BaoxwJyW.js => index-Ch1tb-j6.js} (68%) rename examples/assets/{index-DHVa0dFp.js => index-D6HCkz61.js} (99%) rename examples/assets/{index-BzmpwuIQ.js => index-DDOiyGyA.js} (99%) rename examples/assets/{index-D_n-lttT.js => index-DvHc-rVc.js} (91%) rename examples/assets/{index-buhHUNtp.js => index-PenRR3X-.js} (96%) diff --git a/examples/Civil3DNavigator/index.html b/examples/Civil3DNavigator/index.html index 6a27cee21..6d88290d8 100644 --- a/examples/Civil3DNavigator/index.html +++ b/examples/Civil3DNavigator/index.html @@ -32,7 +32,7 @@ - + diff --git a/examples/CivilCrossSectionNavigator/index.html b/examples/CivilCrossSectionNavigator/index.html index 054e329df..a41b56793 100644 --- a/examples/CivilCrossSectionNavigator/index.html +++ b/examples/CivilCrossSectionNavigator/index.html @@ -50,10 +50,10 @@ - + - + diff --git a/examples/CivilElevationNavigator/index.html b/examples/CivilElevationNavigator/index.html index cce7dd1d4..445021517 100644 --- a/examples/CivilElevationNavigator/index.html +++ b/examples/CivilElevationNavigator/index.html @@ -51,10 +51,10 @@ - + - + diff --git a/examples/CivilPlanNavigator/index.html b/examples/CivilPlanNavigator/index.html index 74ed02ff4..30615483d 100644 --- a/examples/CivilPlanNavigator/index.html +++ b/examples/CivilPlanNavigator/index.html @@ -40,10 +40,10 @@ - + - + diff --git a/examples/Cullers/index.html b/examples/Cullers/index.html index 03100a98f..5abd9b4d9 100644 --- a/examples/Cullers/index.html +++ b/examples/Cullers/index.html @@ -61,9 +61,9 @@ - + - + diff --git a/examples/IfcGeometryTiler/index.html b/examples/IfcGeometryTiler/index.html index da04cfbe4..a35f6fc51 100644 --- a/examples/IfcGeometryTiler/index.html +++ b/examples/IfcGeometryTiler/index.html @@ -29,7 +29,7 @@ - + diff --git a/examples/IfcJsonExporter/index.html b/examples/IfcJsonExporter/index.html index d04bca939..980dcd615 100644 --- a/examples/IfcJsonExporter/index.html +++ b/examples/IfcJsonExporter/index.html @@ -29,10 +29,10 @@ - + - - + + diff --git a/examples/IfcLoader/index.html b/examples/IfcLoader/index.html index 6d7b3be6a..733a74495 100644 --- a/examples/IfcLoader/index.html +++ b/examples/IfcLoader/index.html @@ -29,13 +29,13 @@ - - + + - - + + diff --git a/examples/IfcPropertiesTiler/index.html b/examples/IfcPropertiesTiler/index.html index 28f7c2429..6197c5ce2 100644 --- a/examples/IfcPropertiesTiler/index.html +++ b/examples/IfcPropertiesTiler/index.html @@ -29,8 +29,8 @@ - - + + diff --git a/examples/IfcRelationsIndexer/index.html b/examples/IfcRelationsIndexer/index.html index fa74e98a1..7fa0b4a7e 100644 --- a/examples/IfcRelationsIndexer/index.html +++ b/examples/IfcRelationsIndexer/index.html @@ -27,13 +27,13 @@ - - + + - - + + diff --git a/examples/Utils/index.html b/examples/Utils/index.html index 385beb05d..6dcce724d 100644 --- a/examples/Utils/index.html +++ b/examples/Utils/index.html @@ -28,10 +28,10 @@ - + - - + + diff --git a/examples/assets/civil3DNavigator.js b/examples/assets/civil3DNavigator.js index 4954dadaf..ff1a6c9f1 100644 --- a/examples/assets/civil3DNavigator.js +++ b/examples/assets/civil3DNavigator.js @@ -1 +1 @@ -import{I as p,y as l}from"./web-ifc-api-BC8YMRiS.js";import{f as m,p as h,s as f,k as g,N as u,u as w,C as v}from"./index-b4ozRbQy.js";import{p as y}from"./index-DyM33b1I.js";import{Z as C,C as b}from"./index-BaoxwJyW.js";import{S as A}from"./stats.min-GTpOrGrX.js";import{R as U}from"./renderer-with-2d-BOMjjrxA.js";import"./import-wrapper-prod-LhqN7JJy.js";import"./Line2-7GsqoD5b.js";import"./mark-Cj_PmUva.js";import"./_commonjsHelpers-Cpj98o6Y.js";y.init();C.init();const d=document.getElementById("container"),t=new m,P=t.get(h),e=P.create();e.scene=new f(t);e.renderer=new U(t,d);e.camera=new g(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);d.appendChild(e.renderer.three2D.domElement);const S=t.get(u);S.create(e);const k=t.get(w),B=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),D=await B.arrayBuffer(),E=new Uint8Array(D),s=await k.load(E);e.scene.three.add(s);const I=await fetch("https://thatopen.github.io/engine_components/resources/road.json");s.setLocalProperties(await I.json());const r=t.get(b);r.world=e;r.draw(s);const L=t.get(v),i=L.create(e);i.threshold=10;for(const o of s.children)o instanceof p&&i.add(o);i.needsUpdate=!0;e.camera.controls.addEventListener("sleep",()=>{i.needsUpdate=!0});r.highlighter.hoverCurve.material.color.set(1,1,1);const{material:a}=r.highlighter.hoverPoints;if(Array.isArray(a)){const o=a[0];"color"in o&&o.color.set(1,1,1)}else"color"in a&&a.color.set(1,1,1);const c=new l(void 0,20);r.onHighlight.add(({point:o})=>{c.center.copy(o),e.camera.controls.fitToSphere(c,!0)});const n=new A;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); +import{I as p,y as l}from"./web-ifc-api-BC8YMRiS.js";import{f as m,p as h,s as f,k as g,N as u,u as w,C as v}from"./index-b4ozRbQy.js";import{p as y}from"./index-DyM33b1I.js";import{Z as C,C as b}from"./index-Ch1tb-j6.js";import{S as A}from"./stats.min-GTpOrGrX.js";import{R as U}from"./renderer-with-2d-BOMjjrxA.js";import"./import-wrapper-prod-LhqN7JJy.js";import"./Line2-7GsqoD5b.js";import"./mark-Cj_PmUva.js";import"./_commonjsHelpers-Cpj98o6Y.js";y.init();C.init();const d=document.getElementById("container"),t=new m,P=t.get(h),e=P.create();e.scene=new f(t);e.renderer=new U(t,d);e.camera=new g(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);d.appendChild(e.renderer.three2D.domElement);const S=t.get(u);S.create(e);const k=t.get(w),B=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),D=await B.arrayBuffer(),E=new Uint8Array(D),s=await k.load(E);e.scene.three.add(s);const I=await fetch("https://thatopen.github.io/engine_components/resources/road.json");s.setLocalProperties(await I.json());const r=t.get(b);r.world=e;r.draw(s);const L=t.get(v),i=L.create(e);i.threshold=10;for(const o of s.children)o instanceof p&&i.add(o);i.needsUpdate=!0;e.camera.controls.addEventListener("sleep",()=>{i.needsUpdate=!0});r.highlighter.hoverCurve.material.color.set(1,1,1);const{material:a}=r.highlighter.hoverPoints;if(Array.isArray(a)){const o=a[0];"color"in o&&o.color.set(1,1,1)}else"color"in a&&a.color.set(1,1,1);const c=new l(void 0,20);r.onHighlight.add(({point:o})=>{c.center.copy(o),e.camera.controls.fitToSphere(c,!0)});const n=new A;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); diff --git a/examples/assets/civilCrossSectionNavigator.js b/examples/assets/civilCrossSectionNavigator.js index 772d6b42d..9066017b4 100644 --- a/examples/assets/civilCrossSectionNavigator.js +++ b/examples/assets/civilCrossSectionNavigator.js @@ -1 +1 @@ -var L=Object.defineProperty;var R=(t,o,e)=>o in t?L(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e;var d=(t,o,e)=>(R(t,typeof o!="symbol"?o+"":o,e),e);import{V as y,C as T,L as I}from"./web-ifc-api-BC8YMRiS.js";import{J as F,m as U,f as V,p as W,s as _,n as j,N as H,u as Z,R as z}from"./index-b4ozRbQy.js";import{p as G}from"./index-DyM33b1I.js";import{Z as J,C as Y}from"./index-BaoxwJyW.js";import{S as $}from"./stats.min-GTpOrGrX.js";import{C as q}from"./index-BLLWNBJ2.js";import{R as K}from"./renderer-with-2d-BOMjjrxA.js";import{E as O,C as Q}from"./index-Dbd7DdKu.js";import"./import-wrapper-prod-LhqN7JJy.js";import"./Line2-7GsqoD5b.js";import"./mark-Cj_PmUva.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./index-WVnKWA4H.js";import"./index-CwA6v-S5.js";const g=class g extends F{constructor(e){super(e);d(this,"world",null);d(this,"enabled",!0);d(this,"plane");d(this,"_world3D",null);this.components.add(g.uuid,this)}get world3D(){return this._world3D}set world3D(e){var i;if(this._world3D=e,(i=this.plane)==null||i.dispose(),!e)return;const n=this.components.get(U),a=n.Type;n.Type=O,this.plane=n.createFromNormalAndCoplanarPoint(e,new y(1,0,0),new y),n.Type=a,this.plane.visible=!1,this.plane.enabled=!1}async set(e,n){if(!this.world||!this.plane)throw new Error("You must set a world before using this component");this.plane.enabled=!0;const a=e.curve.getPercentageAt(n);if(a===null)return;const{startPoint:i,endPoint:S}=e.curve.getSegmentAt(a);if(e.geometry.index===null)throw new Error("Geometry must be indexed!");const w=new y;w.subVectors(S,i),w.normalize(),this.plane.setFromNormalAndCoplanarPoint(w,n),this.plane.edges.update();const x=this.plane.helper.matrix.clone();x.invert();const A=this.world.scene.three,M=this.plane.edges.get();for(const k in M){const{mesh:l}=M[k];l.position.set(0,0,0),l.rotation.set(0,0,0),l.updateMatrix(),l.applyMatrix4(x),l.parent!==A&&A.add(l)}this.plane.enabled=!1}};d(g,"uuid","96b2c87e-d90b-4639-8257-8f01136fe324");let b=g;G.init();J.init();const B=document.getElementById("container"),r=new V,X=r.get(W),s=X.create();s.scene=new _(r);s.renderer=new K(r,B);s.camera=new j(r);r.init();s.scene.setup();s.camera.controls.setLookAt(5,5,5,0,0,0);B.appendChild(s.renderer.three2D.domElement);const ee=r.get(H);ee.create(s);const N=r.get(Z),te=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),oe=await te.arrayBuffer(),ne=new Uint8Array(oe),m=N.load(ne);s.scene.three.add(m);const re=await fetch("https://thatopen.github.io/engine_components/resources/road.json");m.setLocalProperties(await re.json());const D=document.getElementById("scene-2d-left");D.components=r;if(!D.world)throw new Error("World not found!");const c=new q(r);c.world=D.world;await c.draw(m);const p=new Y(r);p.world=s;p.draw(m);p.highlighter.hoverCurve.material.color.set(1,1,1);const{material:f}=c.highlighter.hoverPoints;if(Array.isArray(f)){const t=f[0];"color"in t&&t.color.set(1,1,1)}else"color"in f&&f.color.set(1,1,1);c.onHighlight.add(({mesh:t})=>{p.highlighter.select(t);const o=t.curve.index,e=t.curve.alignment.absolute[o];e.mesh.geometry.computeBoundingSphere();const n=e.mesh.geometry.boundingSphere;n&&s.camera.controls.fitToSphere(n,!0)});const u=document.getElementById("scene-2d-right");u.components=r;if(!u.world)throw new Error("World not found!");const v=new b(r);v.world=u.world;v.world3D=s;c.onMarkerChange.add(({alignment:t,percentage:o,type:e,curve:n})=>{if(p.setMarker(t,o,e),e==="select"){const a=n.alignment.absolute[n.index].mesh,i=t.getPointAt(o,"absolute");v.set(a,i)}});c.onMarkerHidden.add(({type:t})=>{p.hideMarker(t)});const E=new z(r);E.byEntity(m);const se=E.list,P=r.get(Q),C=P.styles.list;for(const t in se.entities){const o=E.find({entities:[t]}),e=new T(Math.random(),Math.random(),Math.random()),n=new I({color:e});P.styles.create(t,new Set,u.world,n);for(const a in o){const i=N.list.get(a);i&&(C[t].fragments[a]=new Set(o[a]),C[t].meshes.add(i.mesh))}}P.update(!0);const h=new $;h.showPanel(2);document.body.append(h.dom);h.dom.style.left="0px";s.renderer.onBeforeUpdate.add(()=>h.begin());s.renderer.onAfterUpdate.add(()=>h.end()); +var L=Object.defineProperty;var R=(t,o,e)=>o in t?L(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e;var d=(t,o,e)=>(R(t,typeof o!="symbol"?o+"":o,e),e);import{V as y,C as T,L as I}from"./web-ifc-api-BC8YMRiS.js";import{J as F,m as U,f as V,p as W,s as _,n as j,N as H,u as Z,R as z}from"./index-b4ozRbQy.js";import{p as G}from"./index-DyM33b1I.js";import{Z as J,C as Y}from"./index-Ch1tb-j6.js";import{S as $}from"./stats.min-GTpOrGrX.js";import{C as q}from"./index-C9jIYBP8.js";import{R as K}from"./renderer-with-2d-BOMjjrxA.js";import{E as O,C as Q}from"./index-Dbd7DdKu.js";import"./import-wrapper-prod-LhqN7JJy.js";import"./Line2-7GsqoD5b.js";import"./mark-Cj_PmUva.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./index-WVnKWA4H.js";import"./index-CwA6v-S5.js";const g=class g extends F{constructor(e){super(e);d(this,"world",null);d(this,"enabled",!0);d(this,"plane");d(this,"_world3D",null);this.components.add(g.uuid,this)}get world3D(){return this._world3D}set world3D(e){var i;if(this._world3D=e,(i=this.plane)==null||i.dispose(),!e)return;const n=this.components.get(U),a=n.Type;n.Type=O,this.plane=n.createFromNormalAndCoplanarPoint(e,new y(1,0,0),new y),n.Type=a,this.plane.visible=!1,this.plane.enabled=!1}async set(e,n){if(!this.world||!this.plane)throw new Error("You must set a world before using this component");this.plane.enabled=!0;const a=e.curve.getPercentageAt(n);if(a===null)return;const{startPoint:i,endPoint:S}=e.curve.getSegmentAt(a);if(e.geometry.index===null)throw new Error("Geometry must be indexed!");const w=new y;w.subVectors(S,i),w.normalize(),this.plane.setFromNormalAndCoplanarPoint(w,n),this.plane.edges.update();const x=this.plane.helper.matrix.clone();x.invert();const A=this.world.scene.three,M=this.plane.edges.get();for(const k in M){const{mesh:l}=M[k];l.position.set(0,0,0),l.rotation.set(0,0,0),l.updateMatrix(),l.applyMatrix4(x),l.parent!==A&&A.add(l)}this.plane.enabled=!1}};d(g,"uuid","96b2c87e-d90b-4639-8257-8f01136fe324");let b=g;G.init();J.init();const B=document.getElementById("container"),r=new V,X=r.get(W),s=X.create();s.scene=new _(r);s.renderer=new K(r,B);s.camera=new j(r);r.init();s.scene.setup();s.camera.controls.setLookAt(5,5,5,0,0,0);B.appendChild(s.renderer.three2D.domElement);const ee=r.get(H);ee.create(s);const N=r.get(Z),te=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),oe=await te.arrayBuffer(),ne=new Uint8Array(oe),m=N.load(ne);s.scene.three.add(m);const re=await fetch("https://thatopen.github.io/engine_components/resources/road.json");m.setLocalProperties(await re.json());const D=document.getElementById("scene-2d-left");D.components=r;if(!D.world)throw new Error("World not found!");const c=new q(r);c.world=D.world;await c.draw(m);const p=new Y(r);p.world=s;p.draw(m);p.highlighter.hoverCurve.material.color.set(1,1,1);const{material:f}=c.highlighter.hoverPoints;if(Array.isArray(f)){const t=f[0];"color"in t&&t.color.set(1,1,1)}else"color"in f&&f.color.set(1,1,1);c.onHighlight.add(({mesh:t})=>{p.highlighter.select(t);const o=t.curve.index,e=t.curve.alignment.absolute[o];e.mesh.geometry.computeBoundingSphere();const n=e.mesh.geometry.boundingSphere;n&&s.camera.controls.fitToSphere(n,!0)});const u=document.getElementById("scene-2d-right");u.components=r;if(!u.world)throw new Error("World not found!");const v=new b(r);v.world=u.world;v.world3D=s;c.onMarkerChange.add(({alignment:t,percentage:o,type:e,curve:n})=>{if(p.setMarker(t,o,e),e==="select"){const a=n.alignment.absolute[n.index].mesh,i=t.getPointAt(o,"absolute");v.set(a,i)}});c.onMarkerHidden.add(({type:t})=>{p.hideMarker(t)});const E=new z(r);E.byEntity(m);const se=E.list,P=r.get(Q),C=P.styles.list;for(const t in se.entities){const o=E.find({entities:[t]}),e=new T(Math.random(),Math.random(),Math.random()),n=new I({color:e});P.styles.create(t,new Set,u.world,n);for(const a in o){const i=N.list.get(a);i&&(C[t].fragments[a]=new Set(o[a]),C[t].meshes.add(i.mesh))}}P.update(!0);const h=new $;h.showPanel(2);document.body.append(h.dom);h.dom.style.left="0px";s.renderer.onBeforeUpdate.add(()=>h.begin());s.renderer.onAfterUpdate.add(()=>h.end()); diff --git a/examples/assets/civilElevationNavigator.js b/examples/assets/civilElevationNavigator.js index fbe72cd63..f86fe62bb 100644 --- a/examples/assets/civilElevationNavigator.js +++ b/examples/assets/civilElevationNavigator.js @@ -1 +1 @@ -var A=Object.defineProperty;var B=(e,t,o)=>t in e?A(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var v=(e,t,o)=>(B(e,typeof t!="symbol"?t+"":t,o),o);import"./web-ifc-api-BC8YMRiS.js";import{f as C,p as D,s as K,n as E,N as I,u as N}from"./index-b4ozRbQy.js";import{p as x}from"./index-DyM33b1I.js";import{Z as H,C as $}from"./index-BaoxwJyW.js";import{S as F}from"./stats.min-GTpOrGrX.js";import{a as R,b as T,C as U}from"./index-BLLWNBJ2.js";import{R as W}from"./renderer-with-2d-BOMjjrxA.js";import"./import-wrapper-prod-LhqN7JJy.js";import"./Line2-7GsqoD5b.js";import"./mark-Cj_PmUva.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./index-WVnKWA4H.js";const S=class S extends R{constructor(o){super(o);v(this,"view","vertical");v(this,"enabled",!0);this.components.add(S.uuid,this)}get world(){return super.world}set world(o){this.world!==o&&(super.world=o,this._highlighter&&this._highlighter.onSelect.add(g=>{if(!this.world)throw new Error("A world is needed to work with this component!");const s=this.components.get(T);s.deleteByType(["Slope","Height","InitialKPV","FinalKPV"]);const{alignment:r}=g.curve,d=[];for(const a of r.vertical){const f=a.mesh.geometry.attributes.position.array;d.push(f)}const{defSegments:p,slope:w}=this.setDefSegments(d),u=this.world.scene.three;for(let a=0;a{h.setMarker(e,t,"hover"),l.setMarker(e,t,"hover")});b.onHighlight.add(({mesh:e,point:t})=>{const{index:o,alignment:g}=e.curve,s=g.getPercentageAt(t,"horizontal");if(s===null)return;const{curve:r}=g.getCurveAt(s,"vertical");if(h.highlighter.select(r.mesh),h.setMarker(r.alignment,s,"select"),c.world){r.mesh.geometry.boundingSphere||r.mesh.geometry.computeBoundingSphere();const w=r.mesh.geometry.boundingSphere.clone();w.radius*=1.5,c.world.camera.controls.fitToSphere(w,!0)}l.highlighter.select(e);const d=e.curve.alignment.absolute[o];d.mesh.geometry.computeBoundingSphere();const p=d.mesh.geometry.boundingSphere;p&&i.camera.controls.fitToSphere(p,!0)});const m=new F;m.showPanel(2);document.body.append(m.dom);m.dom.style.left="0px";i.renderer.onBeforeUpdate.add(()=>m.begin());i.renderer.onAfterUpdate.add(()=>m.end()); +var A=Object.defineProperty;var B=(e,t,o)=>t in e?A(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var v=(e,t,o)=>(B(e,typeof t!="symbol"?t+"":t,o),o);import"./web-ifc-api-BC8YMRiS.js";import{f as C,p as D,s as K,n as E,N as I,u as N}from"./index-b4ozRbQy.js";import{p as x}from"./index-DyM33b1I.js";import{Z as H,C as $}from"./index-Ch1tb-j6.js";import{S as F}from"./stats.min-GTpOrGrX.js";import{a as R,b as T,C as U}from"./index-C9jIYBP8.js";import{R as W}from"./renderer-with-2d-BOMjjrxA.js";import"./import-wrapper-prod-LhqN7JJy.js";import"./Line2-7GsqoD5b.js";import"./mark-Cj_PmUva.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./index-WVnKWA4H.js";const S=class S extends R{constructor(o){super(o);v(this,"view","vertical");v(this,"enabled",!0);this.components.add(S.uuid,this)}get world(){return super.world}set world(o){this.world!==o&&(super.world=o,this._highlighter&&this._highlighter.onSelect.add(g=>{if(!this.world)throw new Error("A world is needed to work with this component!");const s=this.components.get(T);s.deleteByType(["Slope","Height","InitialKPV","FinalKPV"]);const{alignment:r}=g.curve,d=[];for(const a of r.vertical){const f=a.mesh.geometry.attributes.position.array;d.push(f)}const{defSegments:p,slope:w}=this.setDefSegments(d),u=this.world.scene.three;for(let a=0;a{h.setMarker(e,t,"hover"),l.setMarker(e,t,"hover")});b.onHighlight.add(({mesh:e,point:t})=>{const{index:o,alignment:g}=e.curve,s=g.getPercentageAt(t,"horizontal");if(s===null)return;const{curve:r}=g.getCurveAt(s,"vertical");if(h.highlighter.select(r.mesh),h.setMarker(r.alignment,s,"select"),c.world){r.mesh.geometry.boundingSphere||r.mesh.geometry.computeBoundingSphere();const w=r.mesh.geometry.boundingSphere.clone();w.radius*=1.5,c.world.camera.controls.fitToSphere(w,!0)}l.highlighter.select(e);const d=e.curve.alignment.absolute[o];d.mesh.geometry.computeBoundingSphere();const p=d.mesh.geometry.boundingSphere;p&&i.camera.controls.fitToSphere(p,!0)});const m=new F;m.showPanel(2);document.body.append(m.dom);m.dom.style.left="0px";i.renderer.onBeforeUpdate.add(()=>m.begin());i.renderer.onAfterUpdate.add(()=>m.end()); diff --git a/examples/assets/civilPlanNavigator.js b/examples/assets/civilPlanNavigator.js index fa19e950d..897a7208d 100644 --- a/examples/assets/civilPlanNavigator.js +++ b/examples/assets/civilPlanNavigator.js @@ -1 +1 @@ -import"./web-ifc-api-BC8YMRiS.js";import{f as h,p as g,s as f,n as w,N as u,u as v}from"./index-b4ozRbQy.js";import{p as y}from"./index-DyM33b1I.js";import{Z as b,C}from"./index-BaoxwJyW.js";import{S as A}from"./stats.min-GTpOrGrX.js";import{C as B}from"./index-BLLWNBJ2.js";import{R as N}from"./renderer-with-2d-BOMjjrxA.js";import"./import-wrapper-prod-LhqN7JJy.js";import"./Line2-7GsqoD5b.js";import"./mark-Cj_PmUva.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./index-WVnKWA4H.js";y.init();b.init();const l=document.getElementById("container"),t=new h,S=t.get(g),e=S.create();e.scene=new f(t);e.renderer=new N(t,l);e.camera=new w(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);l.appendChild(e.renderer.three2D.domElement);const D=t.get(u);D.create(e);const E=t.get(v),P=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),x=await P.arrayBuffer(),U=new Uint8Array(x),i=E.load(U);e.scene.three.add(i);const r=new C(t);r.world=e;r.draw(i);r.highlighter.hoverCurve.material.color.set(1,1,1);const{material:a}=r.highlighter.hoverPoints;if(Array.isArray(a)){const o=a[0];"color"in o&&o.color.set(1,1,1)}else"color"in a&&a.color.set(1,1,1);const s=document.getElementById("scene-2d"),c=new B(t);s.components=t;if(!s.world)throw new Error("World not found!");c.world=s.world;await c.draw(i);c.onHighlight.add(({mesh:o})=>{r.highlighter.select(o);const p=o.curve.index,d=o.curve.alignment.absolute[p];d.mesh.geometry.computeBoundingSphere();const m=d.mesh.geometry.boundingSphere;m&&e.camera.controls.fitToSphere(m,!0)});const n=new A;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); +import"./web-ifc-api-BC8YMRiS.js";import{f as h,p as g,s as f,n as w,N as u,u as v}from"./index-b4ozRbQy.js";import{p as y}from"./index-DyM33b1I.js";import{Z as b,C}from"./index-Ch1tb-j6.js";import{S as A}from"./stats.min-GTpOrGrX.js";import{C as B}from"./index-C9jIYBP8.js";import{R as N}from"./renderer-with-2d-BOMjjrxA.js";import"./import-wrapper-prod-LhqN7JJy.js";import"./Line2-7GsqoD5b.js";import"./mark-Cj_PmUva.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./index-WVnKWA4H.js";y.init();b.init();const l=document.getElementById("container"),t=new h,S=t.get(g),e=S.create();e.scene=new f(t);e.renderer=new N(t,l);e.camera=new w(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);l.appendChild(e.renderer.three2D.domElement);const D=t.get(u);D.create(e);const E=t.get(v),P=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),x=await P.arrayBuffer(),U=new Uint8Array(x),i=E.load(U);e.scene.three.add(i);const r=new C(t);r.world=e;r.draw(i);r.highlighter.hoverCurve.material.color.set(1,1,1);const{material:a}=r.highlighter.hoverPoints;if(Array.isArray(a)){const o=a[0];"color"in o&&o.color.set(1,1,1)}else"color"in a&&a.color.set(1,1,1);const s=document.getElementById("scene-2d"),c=new B(t);s.components=t;if(!s.world)throw new Error("World not found!");c.world=s.world;await c.draw(i);c.onHighlight.add(({mesh:o})=>{r.highlighter.select(o);const p=o.curve.index,d=o.curve.alignment.absolute[p];d.mesh.geometry.computeBoundingSphere();const m=d.mesh.geometry.boundingSphere;m&&e.camera.controls.fitToSphere(m,!0)});const n=new A;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); diff --git a/examples/assets/cullers.js b/examples/assets/cullers.js index 8c1aadd84..4d4538f7f 100644 --- a/examples/assets/cullers.js +++ b/examples/assets/cullers.js @@ -1 +1 @@ -import{B as c,k as m,M as i}from"./web-ifc-api-BC8YMRiS.js";import{S as l}from"./stats.min-GTpOrGrX.js";import{a as p,W as u,S as b,b as y,c as f,G as g}from"./index-DJTKMiao.js";import{C as w}from"./index-DHVa0dFp.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./async-event-D8tC9awa.js";const h=document.getElementById("container"),t=new p,S=t.get(u),e=S.create();e.scene=new b(t);e.renderer=new y(t,h);e.camera=new f(t);t.init();e.camera.controls.setLookAt(13,13,13,0,0,0);e.scene.setup();const x=t.get(g);x.create(e);e.scene.three.background=null;const C=t.get(w),o=C.create(e);o.threshold=200;o.renderDebugFrame=!0;const s=o.renderer.domElement;document.body.appendChild(s);s.style.position="fixed";s.style.left="0";s.style.bottom="0";s.style.visibility="collapse";const M=new c(2,2,2),B=new m({color:"#6528D7"});function d(a){return Math.random()*a}function U(){for(let a=0;a<300;a++){const n=new i(M,B);n.position.x=d(10),n.position.y=d(10),n.position.z=d(10),n.updateMatrix(),e.scene.three.add(n),o.add(n)}}U();o.needsUpdate=!0;e.camera.controls.addEventListener("controlend",()=>{o.needsUpdate=!0});const r=new l;r.showPanel(2);document.body.append(r.dom);r.dom.style.left="0px";r.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>r.begin());e.renderer.onAfterUpdate.add(()=>r.end()); +import{B as c,k as m,M as i}from"./web-ifc-api-BC8YMRiS.js";import{S as l}from"./stats.min-GTpOrGrX.js";import{a as p,W as u,S as b,b as y,c as f,G as g}from"./index-BraZXcLv.js";import{C as w}from"./index-D6HCkz61.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./async-event-D8tC9awa.js";const h=document.getElementById("container"),t=new p,S=t.get(u),e=S.create();e.scene=new b(t);e.renderer=new y(t,h);e.camera=new f(t);t.init();e.camera.controls.setLookAt(13,13,13,0,0,0);e.scene.setup();const x=t.get(g);x.create(e);e.scene.three.background=null;const C=t.get(w),o=C.create(e);o.threshold=200;o.renderDebugFrame=!0;const s=o.renderer.domElement;document.body.appendChild(s);s.style.position="fixed";s.style.left="0";s.style.bottom="0";s.style.visibility="collapse";const M=new c(2,2,2),B=new m({color:"#6528D7"});function d(a){return Math.random()*a}function U(){for(let a=0;a<300;a++){const n=new i(M,B);n.position.x=d(10),n.position.y=d(10),n.position.z=d(10),n.updateMatrix(),e.scene.three.add(n),o.add(n)}}U();o.needsUpdate=!0;e.camera.controls.addEventListener("controlend",()=>{o.needsUpdate=!0});const r=new l;r.showPanel(2);document.body.append(r.dom);r.dom.style.left="0px";r.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>r.begin());e.renderer.onAfterUpdate.add(()=>r.end()); diff --git a/examples/assets/ifcGeometryTiler.js b/examples/assets/ifcGeometryTiler.js index eea57db8a..c176bdea5 100644 --- a/examples/assets/ifcGeometryTiler.js +++ b/examples/assets/ifcGeometryTiler.js @@ -1,4 +1,4 @@ -var _t=Object.defineProperty;var Et=(d,t,e)=>t in d?_t(d,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):d[t]=e;var y=(d,t,e)=>(Et(d,typeof t!="symbol"?t+"":t,e),e);import{V as w,r as Tt,P as Ct,T as Dt,_ as V,a as B,a8 as bt,X as Pt,$ as At,a9 as Gt,aa as Vt,ab as Lt,h as kt,ac as Nt}from"./web-ifc-api-BC8YMRiS.js";import{S as Ut}from"./stats.min-GTpOrGrX.js";import{p as qt,a as Bt,m as Ht}from"./index-DyM33b1I.js";import{C as jt,E as H,a as Ot,W as Rt,S as Wt,b as $t,c as Xt,G as Jt}from"./index-DJTKMiao.js";import{I as Kt}from"./streaming-settings-CK_tvevt.js";import{S as Qt,I as Yt,C as Zt}from"./ifc-metadata-reader-j9dl-lHS.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./ifc-fragment-settings-CiVry-YT.js";const tt=0,te=1,ee=new w,vt=new Tt,rt=new Ct,Ft=new w,Z=new Dt;class se{constructor(){this.tolerance=-1,this.faces=[],this.newFaces=[],this.assigned=new St,this.unassigned=new St,this.vertices=[]}setFromPoints(t){if(t.length>=4){this.makeEmpty();for(let e=0,s=t.length;ethis.tolerance)return!1;return!0}intersectRay(t,e){const s=this.faces;let i=-1/0,n=1/0;for(let a=0,o=s.length;a0&&u>=0)return null;const f=u!==0?-r/u:0;if(!(f<=0)&&(u>0?n=Math.min(f,n):i=Math.max(f,i),i>n))return null}return i!==-1/0?t.at(i,e):t.at(n,e),e}intersectsRay(t){return this.intersectRay(t,ee)!==null}makeEmpty(){return this.faces=[],this.vertices=[],this}addVertexToFace(t,e){return t.face=e,e.outside===null?this.assigned.append(t):this.assigned.insertBefore(e.outside,t),e.outside=t,this}removeVertexFromFace(t,e){return t===e.outside&&(t.next!==null&&t.next.face===e?e.outside=t.next:e.outside=null),this.assigned.remove(t),this}removeAllVerticesFromFace(t){if(t.outside!==null){const e=t.outside;let s=t.outside;for(;s.next!==null&&s.next.face===t;)s=s.next;return this.assigned.removeSubList(e,s),e.prev=s.next=null,t.outside=null,e}}deleteFaceVertices(t,e){const s=this.removeAllVerticesFromFace(t);if(s!==void 0)if(e===void 0)this.unassigned.appendChain(s);else{let i=s;do{const n=i.next;e.distanceToPoint(i.point)>this.tolerance?this.addVertexToFace(i,e):this.unassigned.append(i),i=n}while(i!==null)}return this}resolveUnassignedPoints(t){if(this.unassigned.isEmpty()===!1){let e=this.unassigned.first();do{const s=e.next;let i=this.tolerance,n=null;for(let a=0;ai&&(i=c,n=o),i>1e3*this.tolerance)break}}n!==null&&this.addVertexToFace(e,n),e=s}while(e!==null)}return this}computeExtremes(){const t=new w,e=new w,s=[],i=[];for(let n=0;n<3;n++)s[n]=i[n]=this.vertices[0];t.copy(this.vertices[0].point),e.copy(this.vertices[0].point);for(let n=0,a=this.vertices.length;ne.getComponent(r)&&(e.setComponent(r,c.getComponent(r)),i[r]=o)}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(t.x),Math.abs(e.x))+Math.max(Math.abs(t.y),Math.abs(e.y))+Math.max(Math.abs(t.z),Math.abs(e.z))),{min:s,max:i}}computeInitialHull(){const t=this.vertices,e=this.computeExtremes(),s=e.min,i=e.max;let n=0,a=0;for(let h=0;h<3;h++){const l=i[h].point.getComponent(h)-s[h].point.getComponent(h);l>n&&(n=l,a=h)}const o=s[a],c=i[a];let r,u;n=0,vt.set(o.point,c.point);for(let h=0,l=this.vertices.length;hn&&(n=p,r=m)}}n=-1,rt.setFromCoplanarPoints(o.point,c.point,r.point);for(let h=0,l=this.vertices.length;hn&&(n=p,u=m)}}const f=[];if(rt.distanceToPoint(u.point)<0){f.push(_.create(o,c,r),_.create(u,c,o),_.create(u,r,c),_.create(u,o,r));for(let h=0;h<3;h++){const l=(h+1)%3;f[h+1].getEdge(2).setTwin(f[0].getEdge(l)),f[h+1].getEdge(1).setTwin(f[l+1].getEdge(0))}}else{f.push(_.create(o,r,c),_.create(u,o,c),_.create(u,c,r),_.create(u,r,o));for(let h=0;h<3;h++){const l=(h+1)%3;f[h+1].getEdge(2).setTwin(f[0].getEdge((3-h)%3)),f[h+1].getEdge(0).setTwin(f[l+1].getEdge(1))}}for(let h=0;h<4;h++)this.faces.push(f[h]);for(let h=0,l=t.length;hn&&(n=z,p=this.faces[F])}p!==null&&this.addVertexToFace(m,p)}}return this}reindexFaces(){const t=[];for(let e=0;ee&&(e=n,t=i),i=i.next}while(i!==null&&i.face===s);return t}}computeHorizon(t,e,s,i){this.deleteFaceVertices(s),s.mark=te;let n;e===null?n=e=s.getEdge(0):n=e.next;do{const a=n.twin,o=a.face;o.mark===tt&&(o.distanceToPoint(t)>this.tolerance?this.computeHorizon(t,a,o,i):i.push(n)),n=n.next}while(n!==e);return this}addAdjoiningFace(t,e){const s=_.create(t,e.tail(),e.head());return this.faces.push(s),s.getEdge(-1).setTwin(e.twin),s.getEdge(0)}addNewFaces(t,e){this.newFaces=[];let s=null,i=null;for(let n=0;n0;)e=e.next,t--;for(;t<0;)e=e.prev,t++;return e}compute(){const t=this.edge.tail(),e=this.edge.head(),s=this.edge.next.head();return Z.set(t.point,e.point,s.point),Z.getNormal(this.normal),Z.getMidpoint(this.midpoint),this.area=Z.getArea(),this.constant=this.normal.dot(this.midpoint),this}distanceToPoint(t){return this.normal.dot(t)-this.constant}}class ct{constructor(t,e){this.vertex=t,this.prev=null,this.next=null,this.twin=null,this.face=e}head(){return this.vertex}tail(){return this.prev?this.prev.vertex:null}length(){const t=this.head(),e=this.tail();return e!==null?e.point.distanceTo(t.point):-1}lengthSquared(){const t=this.head(),e=this.tail();return e!==null?e.point.distanceToSquared(t.point):-1}setTwin(t){return this.twin=t,t.twin=this,this}}class ne{constructor(t){this.point=t,this.prev=null,this.next=null,this.face=null}}class St{constructor(){this.head=null,this.tail=null}first(){return this.head}last(){return this.tail}clear(){return this.head=this.tail=null,this}insertBefore(t,e){return e.prev=t.prev,e.next=t,e.prev===null?this.head=e:e.prev.next=e,t.prev=e,this}insertAfter(t,e){return e.prev=t,e.next=t.next,e.next===null?this.tail=e:e.next.prev=e,t.next=e,this}append(t){return this.head===null?this.head=t:this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t,this}appendChain(t){for(this.head===null?this.head=t:this.tail.next=t,t.prev=this.tail;t.next!==null;)t=t.next;return this.tail=t,this}remove(t){return t.prev===null?this.head=t.next:t.prev.next=t.next,t.next===null?this.tail=t.prev:t.next.prev=t.prev,this}removeSubList(t,e){return t.prev===null?this.head=e.next:t.prev.next=e.next,e.next===null?this.tail=t.prev:e.next.prev=t.prev,this}isEmpty(){return this.head===null}}const lt=[2,2,1],ht=[1,0,0];function E(d,t){return d*3+t}function ie(d){const t=d.elements;let e=0;for(let s=0;s<9;s++)e+=t[s]*t[s];return Math.sqrt(e)}function oe(d){const t=d.elements;let e=0;for(let s=0;s<3;s++){const i=t[E(lt[s],ht[s])];e+=2*i*i}return Math.sqrt(e)}function ae(d,t){let e=0,s=1;const i=d.elements;for(let r=0;r<3;r++){const u=Math.abs(i[E(lt[r],ht[r])]);u>e&&(e=u,s=r)}let n=1,a=0;const o=ht[s],c=lt[s];if(Math.abs(i[E(c,o)])>Number.EPSILON){const r=i[E(c,c)],u=i[E(o,o)],f=i[E(c,o)],h=(r-u)/2/f;let l;h<0?l=-1/(-h+Math.sqrt(1+h*h)):l=1/(h+Math.sqrt(1+h*h)),n=1/Math.sqrt(1+l*l),a=l*n}return t.identity(),t.elements[E(o,o)]=n,t.elements[E(c,c)]=n,t.elements[E(c,o)]=a,t.elements[E(o,c)]=-a,t}function re(d,t){let e=0,s=0;const i=10;t.unitary.identity(),t.diagonal.copy(d);const n=t.unitary,a=t.diagonal,o=new V,c=new V,r=Number.EPSILON*ie(a);for(;sr;)ae(a,o),c.copy(o).transpose(),a.multiply(o),a.premultiply(c),n.multiply(o),++e>2&&(s++,e=0);return t}function ce(d){const t=[];for(let b=0;b0}const st=class st extends jt{constructor(e){super(e);y(this,"onGeometryStreamed",new H);y(this,"onAssetStreamed",new H);y(this,"onProgress",new H);y(this,"onIfcLoaded",new H);y(this,"onDisposed",new H);y(this,"settings",new Kt);y(this,"enabled",!0);y(this,"webIfc",new bt);y(this,"_spatialTree",new Qt);y(this,"_metaData",new Yt);y(this,"_visitedGeometries",new Map);y(this,"_streamSerializer",new Pt);y(this,"_geometries",new Map);y(this,"_geometryCount",0);y(this,"_civil",new Zt);y(this,"_groupSerializer",new At);y(this,"_assets",[]);y(this,"_meshesWithHoles",new Set);this.components.add(st.uuid,this),this.settings.excludedCategories.add(Gt)}dispose(){this.onIfcLoaded.reset(),this.onGeometryStreamed.reset(),this.onAssetStreamed.reset(),this.webIfc=null,this.onDisposed.trigger(),this.onDisposed.reset()}async streamFromBuffer(e){const s=performance.now();await this.readIfcFile(e),await this.streamAllGeometries(),this.cleanUp(),console.log(`Streaming the IFC took ${performance.now()-s} ms!`)}async streamFromCallBack(e){const s=performance.now();await this.streamIfcFile(e),await this.streamAllGeometries(),this.cleanUp(),console.log(`Streaming the IFC took ${performance.now()-s} ms!`)}async readIfcFile(e){const{path:s,absolute:i,logLevel:n}=this.settings.wasm;this.webIfc.SetWasmPath(s,i),await this.webIfc.Init(),n&&this.webIfc.SetLogLevel(n),this.webIfc.OpenModel(e,this.settings.webIfc)}async streamIfcFile(e){const{path:s,absolute:i,logLevel:n}=this.settings.wasm;this.webIfc.SetWasmPath(s,i),await this.webIfc.Init(),n&&this.webIfc.SetLogLevel(n),this.webIfc.OpenModelFromCallback(e,this.settings.webIfc)}async streamAllGeometries(){const{minGeometrySize:e,minAssetsSize:s}=this.settings;this._spatialTree.setUp(this.webIfc);const i=this.webIfc.GetIfcEntityList(0),n=[[]],a=new Vt,{FILE_NAME:o,FILE_DESCRIPTION:c}=Nt;a.ifcMetadata={name:this._metaData.get(this.webIfc,o),description:this._metaData.get(this.webIfc,c),schema:this.webIfc.GetModelSchema(0)||"IFC2X3",maxExpressID:this.webIfc.GetMaxExpressID(0)};let r=0,u=0;for(const g of i){if(!this.webIfc.IsIfcElement(g)&&g!==Lt||this.settings.excludedCategories.has(g))continue;const I=this.webIfc.GetLineIDsWithType(0,g),S=I.size();console.log(S);for(let M=0;Me&&(r=0,u++,n.push([]));const v=I.get(M);n[u].push(v);const R=this._spatialTree.itemsByFloor[v]||0;a.data.set(v,[[],[R,g]]),r++}}this._spatialTree.cleanUp();let f=.01,h=0;for(const g of n){h++,this.webIfc.StreamMeshes(0,g,S=>{this.getMesh(this.webIfc,S,a)}),this._geometryCount>e&&await this.streamGeometries(),this._assets.length>s&&await this.streamAssets();const I=h/n.length;I>f&&(f+=.01,f=Math.max(f,I),this.onProgress.trigger(Math.round(f*100)/100))}this._geometryCount&&await this.streamGeometries(),this._assets.length&&await this.streamAssets();const{opaque:l,transparent:m}=a.geometryIDs;for(const[g,{index:I,uuid:S}]of this._visitedGeometries)a.keyFragments.set(I,S),(g>1?l:m).set(g,I);const p=a.data.keys();for(const g of p){const[I]=a.data.get(g);I.length||a.data.delete(g)}const F=this.webIfc.GetCoordinationMatrix(0);a.coordinationMatrix.fromArray(F),a.civilData=this._civil.read(this.webIfc);const z=this._groupSerializer.export(a);this.onIfcLoaded.trigger(z),a.dispose(!0)}cleanUp(){this.webIfc=null,this.webIfc=new bt,this._visitedGeometries.clear(),this._geometries.clear(),this._assets=[],this._meshesWithHoles.clear()}getMesh(e,s,i){const n=s.geometries.size(),a=s.expressID,o={id:a,geometries:[]};for(let c=0;c{const{buffer:t,data:e}=d,s=`small.ifc-processed-geometries-${ut}`;for(const i in e){const n=e[i];n.geometryFile=s,mt[i]=n}j.push({name:s,bits:[t]}),ut++});let et=[];T.onAssetStreamed.add(d=>{et=[...et,...d]});T.onIfcLoaded.add(d=>{j.push({name:"small.ifc-processed-global",bits:[d]})});function fe(d,...t){const e=new File(t,d),s=document.createElement("a"),i=URL.createObjectURL(e);s.href=i,s.download=e.name,s.click(),URL.revokeObjectURL(i)}async function pe(d){for(const{name:t,bits:e}of d)fe(t,...e),await new Promise(s=>{setTimeout(s,100)})}T.onProgress.add(d=>{d===1&&setTimeout(async()=>{const t={geometries:mt,assets:et,globalDataFileId:"small.ifc-processed-global"};j.push({name:"small.ifc-processed.json",bits:[JSON.stringify(t)]}),await pe(j),et=[],mt={},j=[],ut=1})});async function ge(){const t=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),e=new Uint8Array(t);await T.streamFromBuffer(e)}qt.init();const we=Bt.create(()=>Ht` +var _t=Object.defineProperty;var Et=(d,t,e)=>t in d?_t(d,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):d[t]=e;var y=(d,t,e)=>(Et(d,typeof t!="symbol"?t+"":t,e),e);import{V as w,r as Tt,P as Ct,T as Dt,_ as V,a as B,a8 as bt,X as Pt,$ as At,a9 as Gt,aa as Vt,ab as Lt,h as kt,ac as Nt}from"./web-ifc-api-BC8YMRiS.js";import{S as Ut}from"./stats.min-GTpOrGrX.js";import{p as qt,a as Bt,m as Ht}from"./index-DyM33b1I.js";import{C as jt,E as H,a as Ot,W as Rt,S as Wt,b as $t,c as Xt,G as Jt}from"./index-BraZXcLv.js";import{I as Kt}from"./streaming-settings-CK_tvevt.js";import{S as Qt,I as Yt,C as Zt}from"./ifc-metadata-reader-j9dl-lHS.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./ifc-fragment-settings-CiVry-YT.js";const tt=0,te=1,ee=new w,vt=new Tt,rt=new Ct,Ft=new w,Z=new Dt;class se{constructor(){this.tolerance=-1,this.faces=[],this.newFaces=[],this.assigned=new St,this.unassigned=new St,this.vertices=[]}setFromPoints(t){if(t.length>=4){this.makeEmpty();for(let e=0,s=t.length;ethis.tolerance)return!1;return!0}intersectRay(t,e){const s=this.faces;let i=-1/0,n=1/0;for(let a=0,o=s.length;a0&&u>=0)return null;const f=u!==0?-r/u:0;if(!(f<=0)&&(u>0?n=Math.min(f,n):i=Math.max(f,i),i>n))return null}return i!==-1/0?t.at(i,e):t.at(n,e),e}intersectsRay(t){return this.intersectRay(t,ee)!==null}makeEmpty(){return this.faces=[],this.vertices=[],this}addVertexToFace(t,e){return t.face=e,e.outside===null?this.assigned.append(t):this.assigned.insertBefore(e.outside,t),e.outside=t,this}removeVertexFromFace(t,e){return t===e.outside&&(t.next!==null&&t.next.face===e?e.outside=t.next:e.outside=null),this.assigned.remove(t),this}removeAllVerticesFromFace(t){if(t.outside!==null){const e=t.outside;let s=t.outside;for(;s.next!==null&&s.next.face===t;)s=s.next;return this.assigned.removeSubList(e,s),e.prev=s.next=null,t.outside=null,e}}deleteFaceVertices(t,e){const s=this.removeAllVerticesFromFace(t);if(s!==void 0)if(e===void 0)this.unassigned.appendChain(s);else{let i=s;do{const n=i.next;e.distanceToPoint(i.point)>this.tolerance?this.addVertexToFace(i,e):this.unassigned.append(i),i=n}while(i!==null)}return this}resolveUnassignedPoints(t){if(this.unassigned.isEmpty()===!1){let e=this.unassigned.first();do{const s=e.next;let i=this.tolerance,n=null;for(let a=0;ai&&(i=c,n=o),i>1e3*this.tolerance)break}}n!==null&&this.addVertexToFace(e,n),e=s}while(e!==null)}return this}computeExtremes(){const t=new w,e=new w,s=[],i=[];for(let n=0;n<3;n++)s[n]=i[n]=this.vertices[0];t.copy(this.vertices[0].point),e.copy(this.vertices[0].point);for(let n=0,a=this.vertices.length;ne.getComponent(r)&&(e.setComponent(r,c.getComponent(r)),i[r]=o)}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(t.x),Math.abs(e.x))+Math.max(Math.abs(t.y),Math.abs(e.y))+Math.max(Math.abs(t.z),Math.abs(e.z))),{min:s,max:i}}computeInitialHull(){const t=this.vertices,e=this.computeExtremes(),s=e.min,i=e.max;let n=0,a=0;for(let h=0;h<3;h++){const l=i[h].point.getComponent(h)-s[h].point.getComponent(h);l>n&&(n=l,a=h)}const o=s[a],c=i[a];let r,u;n=0,vt.set(o.point,c.point);for(let h=0,l=this.vertices.length;hn&&(n=p,r=m)}}n=-1,rt.setFromCoplanarPoints(o.point,c.point,r.point);for(let h=0,l=this.vertices.length;hn&&(n=p,u=m)}}const f=[];if(rt.distanceToPoint(u.point)<0){f.push(_.create(o,c,r),_.create(u,c,o),_.create(u,r,c),_.create(u,o,r));for(let h=0;h<3;h++){const l=(h+1)%3;f[h+1].getEdge(2).setTwin(f[0].getEdge(l)),f[h+1].getEdge(1).setTwin(f[l+1].getEdge(0))}}else{f.push(_.create(o,r,c),_.create(u,o,c),_.create(u,c,r),_.create(u,r,o));for(let h=0;h<3;h++){const l=(h+1)%3;f[h+1].getEdge(2).setTwin(f[0].getEdge((3-h)%3)),f[h+1].getEdge(0).setTwin(f[l+1].getEdge(1))}}for(let h=0;h<4;h++)this.faces.push(f[h]);for(let h=0,l=t.length;hn&&(n=z,p=this.faces[F])}p!==null&&this.addVertexToFace(m,p)}}return this}reindexFaces(){const t=[];for(let e=0;ee&&(e=n,t=i),i=i.next}while(i!==null&&i.face===s);return t}}computeHorizon(t,e,s,i){this.deleteFaceVertices(s),s.mark=te;let n;e===null?n=e=s.getEdge(0):n=e.next;do{const a=n.twin,o=a.face;o.mark===tt&&(o.distanceToPoint(t)>this.tolerance?this.computeHorizon(t,a,o,i):i.push(n)),n=n.next}while(n!==e);return this}addAdjoiningFace(t,e){const s=_.create(t,e.tail(),e.head());return this.faces.push(s),s.getEdge(-1).setTwin(e.twin),s.getEdge(0)}addNewFaces(t,e){this.newFaces=[];let s=null,i=null;for(let n=0;n0;)e=e.next,t--;for(;t<0;)e=e.prev,t++;return e}compute(){const t=this.edge.tail(),e=this.edge.head(),s=this.edge.next.head();return Z.set(t.point,e.point,s.point),Z.getNormal(this.normal),Z.getMidpoint(this.midpoint),this.area=Z.getArea(),this.constant=this.normal.dot(this.midpoint),this}distanceToPoint(t){return this.normal.dot(t)-this.constant}}class ct{constructor(t,e){this.vertex=t,this.prev=null,this.next=null,this.twin=null,this.face=e}head(){return this.vertex}tail(){return this.prev?this.prev.vertex:null}length(){const t=this.head(),e=this.tail();return e!==null?e.point.distanceTo(t.point):-1}lengthSquared(){const t=this.head(),e=this.tail();return e!==null?e.point.distanceToSquared(t.point):-1}setTwin(t){return this.twin=t,t.twin=this,this}}class ne{constructor(t){this.point=t,this.prev=null,this.next=null,this.face=null}}class St{constructor(){this.head=null,this.tail=null}first(){return this.head}last(){return this.tail}clear(){return this.head=this.tail=null,this}insertBefore(t,e){return e.prev=t.prev,e.next=t,e.prev===null?this.head=e:e.prev.next=e,t.prev=e,this}insertAfter(t,e){return e.prev=t,e.next=t.next,e.next===null?this.tail=e:e.next.prev=e,t.next=e,this}append(t){return this.head===null?this.head=t:this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t,this}appendChain(t){for(this.head===null?this.head=t:this.tail.next=t,t.prev=this.tail;t.next!==null;)t=t.next;return this.tail=t,this}remove(t){return t.prev===null?this.head=t.next:t.prev.next=t.next,t.next===null?this.tail=t.prev:t.next.prev=t.prev,this}removeSubList(t,e){return t.prev===null?this.head=e.next:t.prev.next=e.next,e.next===null?this.tail=t.prev:e.next.prev=t.prev,this}isEmpty(){return this.head===null}}const lt=[2,2,1],ht=[1,0,0];function E(d,t){return d*3+t}function ie(d){const t=d.elements;let e=0;for(let s=0;s<9;s++)e+=t[s]*t[s];return Math.sqrt(e)}function oe(d){const t=d.elements;let e=0;for(let s=0;s<3;s++){const i=t[E(lt[s],ht[s])];e+=2*i*i}return Math.sqrt(e)}function ae(d,t){let e=0,s=1;const i=d.elements;for(let r=0;r<3;r++){const u=Math.abs(i[E(lt[r],ht[r])]);u>e&&(e=u,s=r)}let n=1,a=0;const o=ht[s],c=lt[s];if(Math.abs(i[E(c,o)])>Number.EPSILON){const r=i[E(c,c)],u=i[E(o,o)],f=i[E(c,o)],h=(r-u)/2/f;let l;h<0?l=-1/(-h+Math.sqrt(1+h*h)):l=1/(h+Math.sqrt(1+h*h)),n=1/Math.sqrt(1+l*l),a=l*n}return t.identity(),t.elements[E(o,o)]=n,t.elements[E(c,c)]=n,t.elements[E(c,o)]=a,t.elements[E(o,c)]=-a,t}function re(d,t){let e=0,s=0;const i=10;t.unitary.identity(),t.diagonal.copy(d);const n=t.unitary,a=t.diagonal,o=new V,c=new V,r=Number.EPSILON*ie(a);for(;sr;)ae(a,o),c.copy(o).transpose(),a.multiply(o),a.premultiply(c),n.multiply(o),++e>2&&(s++,e=0);return t}function ce(d){const t=[];for(let b=0;b0}const st=class st extends jt{constructor(e){super(e);y(this,"onGeometryStreamed",new H);y(this,"onAssetStreamed",new H);y(this,"onProgress",new H);y(this,"onIfcLoaded",new H);y(this,"onDisposed",new H);y(this,"settings",new Kt);y(this,"enabled",!0);y(this,"webIfc",new bt);y(this,"_spatialTree",new Qt);y(this,"_metaData",new Yt);y(this,"_visitedGeometries",new Map);y(this,"_streamSerializer",new Pt);y(this,"_geometries",new Map);y(this,"_geometryCount",0);y(this,"_civil",new Zt);y(this,"_groupSerializer",new At);y(this,"_assets",[]);y(this,"_meshesWithHoles",new Set);this.components.add(st.uuid,this),this.settings.excludedCategories.add(Gt)}dispose(){this.onIfcLoaded.reset(),this.onGeometryStreamed.reset(),this.onAssetStreamed.reset(),this.webIfc=null,this.onDisposed.trigger(),this.onDisposed.reset()}async streamFromBuffer(e){const s=performance.now();await this.readIfcFile(e),await this.streamAllGeometries(),this.cleanUp(),console.log(`Streaming the IFC took ${performance.now()-s} ms!`)}async streamFromCallBack(e){const s=performance.now();await this.streamIfcFile(e),await this.streamAllGeometries(),this.cleanUp(),console.log(`Streaming the IFC took ${performance.now()-s} ms!`)}async readIfcFile(e){const{path:s,absolute:i,logLevel:n}=this.settings.wasm;this.webIfc.SetWasmPath(s,i),await this.webIfc.Init(),n&&this.webIfc.SetLogLevel(n),this.webIfc.OpenModel(e,this.settings.webIfc)}async streamIfcFile(e){const{path:s,absolute:i,logLevel:n}=this.settings.wasm;this.webIfc.SetWasmPath(s,i),await this.webIfc.Init(),n&&this.webIfc.SetLogLevel(n),this.webIfc.OpenModelFromCallback(e,this.settings.webIfc)}async streamAllGeometries(){const{minGeometrySize:e,minAssetsSize:s}=this.settings;this._spatialTree.setUp(this.webIfc);const i=this.webIfc.GetIfcEntityList(0),n=[[]],a=new Vt,{FILE_NAME:o,FILE_DESCRIPTION:c}=Nt;a.ifcMetadata={name:this._metaData.get(this.webIfc,o),description:this._metaData.get(this.webIfc,c),schema:this.webIfc.GetModelSchema(0)||"IFC2X3",maxExpressID:this.webIfc.GetMaxExpressID(0)};let r=0,u=0;for(const g of i){if(!this.webIfc.IsIfcElement(g)&&g!==Lt||this.settings.excludedCategories.has(g))continue;const I=this.webIfc.GetLineIDsWithType(0,g),S=I.size();console.log(S);for(let M=0;Me&&(r=0,u++,n.push([]));const v=I.get(M);n[u].push(v);const R=this._spatialTree.itemsByFloor[v]||0;a.data.set(v,[[],[R,g]]),r++}}this._spatialTree.cleanUp();let f=.01,h=0;for(const g of n){h++,this.webIfc.StreamMeshes(0,g,S=>{this.getMesh(this.webIfc,S,a)}),this._geometryCount>e&&await this.streamGeometries(),this._assets.length>s&&await this.streamAssets();const I=h/n.length;I>f&&(f+=.01,f=Math.max(f,I),this.onProgress.trigger(Math.round(f*100)/100))}this._geometryCount&&await this.streamGeometries(),this._assets.length&&await this.streamAssets();const{opaque:l,transparent:m}=a.geometryIDs;for(const[g,{index:I,uuid:S}]of this._visitedGeometries)a.keyFragments.set(I,S),(g>1?l:m).set(g,I);const p=a.data.keys();for(const g of p){const[I]=a.data.get(g);I.length||a.data.delete(g)}const F=this.webIfc.GetCoordinationMatrix(0);a.coordinationMatrix.fromArray(F),a.civilData=this._civil.read(this.webIfc);const z=this._groupSerializer.export(a);this.onIfcLoaded.trigger(z),a.dispose(!0)}cleanUp(){this.webIfc=null,this.webIfc=new bt,this._visitedGeometries.clear(),this._geometries.clear(),this._assets=[],this._meshesWithHoles.clear()}getMesh(e,s,i){const n=s.geometries.size(),a=s.expressID,o={id:a,geometries:[]};for(let c=0;c{const{buffer:t,data:e}=d,s=`small.ifc-processed-geometries-${ut}`;for(const i in e){const n=e[i];n.geometryFile=s,mt[i]=n}j.push({name:s,bits:[t]}),ut++});let et=[];T.onAssetStreamed.add(d=>{et=[...et,...d]});T.onIfcLoaded.add(d=>{j.push({name:"small.ifc-processed-global",bits:[d]})});function fe(d,...t){const e=new File(t,d),s=document.createElement("a"),i=URL.createObjectURL(e);s.href=i,s.download=e.name,s.click(),URL.revokeObjectURL(i)}async function pe(d){for(const{name:t,bits:e}of d)fe(t,...e),await new Promise(s=>{setTimeout(s,100)})}T.onProgress.add(d=>{d===1&&setTimeout(async()=>{const t={geometries:mt,assets:et,globalDataFileId:"small.ifc-processed-global"};j.push({name:"small.ifc-processed.json",bits:[JSON.stringify(t)]}),await pe(j),et=[],mt={},j=[],ut=1})});async function ge(){const t=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),e=new Uint8Array(t);await T.streamFromBuffer(e)}qt.init();const we=Bt.create(()=>Ht` diff --git a/examples/assets/ifcJsonExporter.js b/examples/assets/ifcJsonExporter.js index 2b94f36f6..55470553f 100644 --- a/examples/assets/ifcJsonExporter.js +++ b/examples/assets/ifcJsonExporter.js @@ -1,4 +1,4 @@ -import{a8 as p}from"./web-ifc-api-BC8YMRiS.js";import{S as m}from"./stats.min-GTpOrGrX.js";import{p as l,a as d,m as f}from"./index-DyM33b1I.js";import{a as w,W as g,S as b,b as u,c as h,G as y}from"./index-DJTKMiao.js";import{I as x}from"./index-D_n-lttT.js";import{F as S}from"./index-BzmpwuIQ.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./ifc-geometry-types-C3SKrzrZ.js";const I=document.getElementById("container"),t=new w,U=t.get(g),e=U.create();e.scene=new b(t);e.renderer=new u(t,I);e.camera=new h(t);t.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const B=t.get(y);B.create(e);const k=new S(t),F=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),O=await F.arrayBuffer(),A=new Uint8Array(O),E=k.load(A);e.scene.three.add(E);const r=new p;r.SetWasmPath("https://unpkg.com/web-ifc@0.0.53/",!0);await r.Init();const L=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),R=await L.arrayBuffer(),j=new Uint8Array(R),J=r.OpenModel(j),v=t.get(x);l.init();const C=d.create(()=>f` +import{a8 as p}from"./web-ifc-api-BC8YMRiS.js";import{S as m}from"./stats.min-GTpOrGrX.js";import{p as l,a as d,m as f}from"./index-DyM33b1I.js";import{a as w,W as g,S as b,b as u,c as h,G as y}from"./index-BraZXcLv.js";import{I as x}from"./index-DvHc-rVc.js";import{F as S}from"./index-DDOiyGyA.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./ifc-geometry-types-C3SKrzrZ.js";const I=document.getElementById("container"),t=new w,U=t.get(g),e=U.create();e.scene=new b(t);e.renderer=new u(t,I);e.camera=new h(t);t.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const B=t.get(y);B.create(e);const k=new S(t),F=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),O=await F.arrayBuffer(),A=new Uint8Array(O),E=k.load(A);e.scene.three.add(E);const r=new p;r.SetWasmPath("https://unpkg.com/web-ifc@0.0.53/",!0);await r.Init();const L=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),R=await L.arrayBuffer(),j=new Uint8Array(R),J=r.OpenModel(j),v=t.get(x);l.init();const C=d.create(()=>f` diff --git a/examples/assets/ifcLoader.js b/examples/assets/ifcLoader.js index 27ec18fee..be570a7d2 100644 --- a/examples/assets/ifcLoader.js +++ b/examples/assets/ifcLoader.js @@ -1,4 +1,4 @@ -import{aX as d,aY as l,aZ as p}from"./web-ifc-api-BC8YMRiS.js";import{p as f,a as u,m as b}from"./index-DyM33b1I.js";import{S as g}from"./stats.min-GTpOrGrX.js";import{a as I,W as w,S as F,b as C,c as y,G as E}from"./index-DJTKMiao.js";import{F as O}from"./index-BzmpwuIQ.js";import{I as R}from"./index-buhHUNtp.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./ifc-metadata-reader-j9dl-lHS.js";import"./ifc-fragment-settings-CiVry-YT.js";import"./index-D_n-lttT.js";import"./ifc-geometry-types-C3SKrzrZ.js";const x=document.getElementById("container"),n=new I,L=n.get(w),o=L.create();o.scene=new F(n);o.renderer=new C(n,x);o.camera=new y(n);n.init();o.camera.controls.setLookAt(12,6,8,0,0,-10);o.scene.setup();const N=n.get(E);N.create(o);const a=n.get(O),s=n.get(R);await s.setup();const h=[d,l,p];for(const e of h)s.settings.excludedCategories.add(e);s.settings.webIfc.COORDINATE_TO_ORIGIN=!0;s.settings.webIfc.OPTIMIZE_PROFILES=!0;async function S(){const t=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),i=new Uint8Array(t),c=await s.load(i);c.name="example",o.scene.three.add(c)}function m(e){const t=document.createElement("a");t.href=URL.createObjectURL(e),t.download=e.name,document.body.appendChild(t),t.click(),t.remove()}async function A(){if(!a.groups.size)return;const e=Array.from(a.groups.values())[0],t=a.export(e);m(new File([new Blob([t])],"small.frag"));const i=e.getLocalProperties();i&&m(new File([JSON.stringify(i)],"small.json"))}function k(){a.dispose()}const r=new g;r.showPanel(2);document.body.append(r.dom);r.dom.style.left="0px";o.renderer.onBeforeUpdate.add(()=>r.begin());o.renderer.onAfterUpdate.add(()=>r.end());f.init();const T=u.create(()=>b` +import{aX as d,aY as l,aZ as p}from"./web-ifc-api-BC8YMRiS.js";import{p as f,a as u,m as b}from"./index-DyM33b1I.js";import{S as g}from"./stats.min-GTpOrGrX.js";import{a as I,W as w,S as F,b as C,c as y,G as E}from"./index-BraZXcLv.js";import{F as O}from"./index-DDOiyGyA.js";import{I as R}from"./index-PenRR3X-.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./ifc-metadata-reader-j9dl-lHS.js";import"./ifc-fragment-settings-CiVry-YT.js";import"./index-DvHc-rVc.js";import"./ifc-geometry-types-C3SKrzrZ.js";const x=document.getElementById("container"),n=new I,L=n.get(w),o=L.create();o.scene=new F(n);o.renderer=new C(n,x);o.camera=new y(n);n.init();o.camera.controls.setLookAt(12,6,8,0,0,-10);o.scene.setup();const N=n.get(E);N.create(o);const a=n.get(O),s=n.get(R);await s.setup();const h=[d,l,p];for(const e of h)s.settings.excludedCategories.add(e);s.settings.webIfc.COORDINATE_TO_ORIGIN=!0;s.settings.webIfc.OPTIMIZE_PROFILES=!0;async function S(){const t=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),i=new Uint8Array(t),c=await s.load(i);c.name="example",o.scene.three.add(c)}function m(e){const t=document.createElement("a");t.href=URL.createObjectURL(e),t.download=e.name,document.body.appendChild(t),t.click(),t.remove()}async function A(){if(!a.groups.size)return;const e=Array.from(a.groups.values())[0],t=a.export(e);m(new File([new Blob([t])],"small.frag"));const i=e.getLocalProperties();i&&m(new File([JSON.stringify(i)],"small.json"))}function k(){a.dispose()}const r=new g;r.showPanel(2);document.body.append(r.dom);r.dom.style.left="0px";o.renderer.onBeforeUpdate.add(()=>r.begin());o.renderer.onAfterUpdate.add(()=>r.end());f.init();const T=u.create(()=>b` diff --git a/examples/assets/ifcPropertiesTiler.js b/examples/assets/ifcPropertiesTiler.js index e30c0cfc0..ccb603065 100644 --- a/examples/assets/ifcPropertiesTiler.js +++ b/examples/assets/ifcPropertiesTiler.js @@ -1,4 +1,4 @@ -var k=Object.defineProperty;var G=(t,o,e)=>o in t?k(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e;var a=(t,o,e)=>(G(t,typeof o!="symbol"?o+"":o,e),e);import{a8 as B,aj as R,ak as v,al as O,i as T,ab as D}from"./web-ifc-api-BC8YMRiS.js";import{S as j}from"./stats.min-GTpOrGrX.js";import{p as W,a as $,m as z}from"./index-DyM33b1I.js";import{C as M,E as N,a as J,W as q,S as Y,b as _,c as H,G as K}from"./index-DJTKMiao.js";import{I as U}from"./index-BzmpwuIQ.js";import{A as F}from"./async-event-D8tC9awa.js";import{P as Q}from"./streaming-settings-CK_tvevt.js";import{G as V}from"./ifc-geometry-types-C3SKrzrZ.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./ifc-fragment-settings-CiVry-YT.js";class A extends M{constructor(){super(...arguments);a(this,"onPropertiesStreamed",new F);a(this,"onProgress",new F);a(this,"onIndicesStreamed",new F);a(this,"onDisposed",new N);a(this,"enabled",!0);a(this,"settings",new Q);a(this,"webIfc",new B)}async dispose(){this.onIndicesStreamed.reset(),this.onPropertiesStreamed.reset(),this.webIfc=null,this.onDisposed.reset()}async streamFromBuffer(e){const s=performance.now();await this.readIfcFile(e),await this.streamAllProperties(),this.cleanUp(),console.log(`Streaming the IFC took ${performance.now()-s} ms!`)}async streamFromCallBack(e){const s=performance.now();await this.streamIfcFile(e),await this.streamAllProperties(),this.cleanUp(),console.log(`Streaming the IFC took ${performance.now()-s} ms!`)}async readIfcFile(e){const{path:s,absolute:i,logLevel:n}=this.settings.wasm;this.webIfc.SetWasmPath(s,i),await this.webIfc.Init(),n&&this.webIfc.SetLogLevel(n),this.webIfc.OpenModel(e,this.settings.webIfc)}async streamIfcFile(e){const{path:s,absolute:i,logLevel:n}=this.settings.wasm;this.webIfc.SetWasmPath(s,i),await this.webIfc.Init(),n&&this.webIfc.SetLogLevel(n),this.webIfc.OpenModelFromCallback(e,this.settings.webIfc)}async streamAllProperties(){const{propertiesSize:e}=this.settings,s=new Set(this.webIfc.GetIfcEntityList(0)),i=new Set([R,v,O,T,D]);for(const c of i)s.add(c);let n=.01,C=0;for(const c of s){if(C++,V.has(c))continue;const L=i.has(c),u=this.webIfc.GetLineIDsWithType(0,c),y=u.size();let S=0;for(let p=0;pn&&(n+=.01,n=Math.max(n,x),await this.onProgress.trigger(Math.round(n*100)/100))}const E=await this.components.get(U).processFromWebIfc(this.webIfc,0);await this.onIndicesStreamed.trigger(E)}cleanUp(){this.webIfc=null,this.webIfc=new B}}a(A,"uuid","88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");const X=document.getElementById("container"),r=new J,Z=r.get(q),l=Z.create();l.scene=new Y(r);l.renderer=new _(r,X);l.camera=new H(r);r.init();l.camera.controls.setLookAt(12,6,8,0,0,-10);const ee=r.get(K);ee.create(l);function te(t,o){const e=new File([o],t),s=document.createElement("a"),i=URL.createObjectURL(e);s.href=i,s.download=e.name,s.click(),URL.revokeObjectURL(i)}async function se(t){for(const{name:o,bits:e}of t)te(o,e),await new Promise(s=>{setTimeout(s,100)})}const h=new A(r);h.settings.wasm={path:"https://unpkg.com/web-ifc@0.0.53/",absolute:!0};const w={types:{},ids:{},indexesFile:"small.ifc-processed-properties-indexes"};let b=0;const g=[];h.onPropertiesStreamed.add(async t=>{w.types[t.type]||(w.types[t.type]=[]),w.types[t.type].push(b);for(const s in t.data)w.ids[s]=b;const o=`small.ifc-processed-properties-${b}`,e=new Blob([JSON.stringify(t.data)]);g.push({bits:e,name:o}),b++});h.onProgress.add(async t=>{console.log(t)});h.onIndicesStreamed.add(async t=>{g.push({name:"small.ifc-processed-properties.json",bits:new Blob([JSON.stringify(w)])});const e=r.get(U).serializeRelations(t);g.push({name:"small.ifc-processed-properties-indexes",bits:new Blob([e])}),await se(g)});async function oe(){const o=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),e=new Uint8Array(o);await h.streamFromBuffer(e)}W.init();const ne=$.create(()=>z` +var k=Object.defineProperty;var G=(t,o,e)=>o in t?k(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e;var a=(t,o,e)=>(G(t,typeof o!="symbol"?o+"":o,e),e);import{a8 as B,aj as R,ak as v,al as O,i as T,ab as D}from"./web-ifc-api-BC8YMRiS.js";import{S as j}from"./stats.min-GTpOrGrX.js";import{p as W,a as $,m as z}from"./index-DyM33b1I.js";import{C as M,E as N,a as J,W as q,S as Y,b as _,c as H,G as K}from"./index-BraZXcLv.js";import{I as U}from"./index-DDOiyGyA.js";import{A as F}from"./async-event-D8tC9awa.js";import{P as Q}from"./streaming-settings-CK_tvevt.js";import{G as V}from"./ifc-geometry-types-C3SKrzrZ.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./ifc-fragment-settings-CiVry-YT.js";class A extends M{constructor(){super(...arguments);a(this,"onPropertiesStreamed",new F);a(this,"onProgress",new F);a(this,"onIndicesStreamed",new F);a(this,"onDisposed",new N);a(this,"enabled",!0);a(this,"settings",new Q);a(this,"webIfc",new B)}async dispose(){this.onIndicesStreamed.reset(),this.onPropertiesStreamed.reset(),this.webIfc=null,this.onDisposed.reset()}async streamFromBuffer(e){const s=performance.now();await this.readIfcFile(e),await this.streamAllProperties(),this.cleanUp(),console.log(`Streaming the IFC took ${performance.now()-s} ms!`)}async streamFromCallBack(e){const s=performance.now();await this.streamIfcFile(e),await this.streamAllProperties(),this.cleanUp(),console.log(`Streaming the IFC took ${performance.now()-s} ms!`)}async readIfcFile(e){const{path:s,absolute:i,logLevel:n}=this.settings.wasm;this.webIfc.SetWasmPath(s,i),await this.webIfc.Init(),n&&this.webIfc.SetLogLevel(n),this.webIfc.OpenModel(e,this.settings.webIfc)}async streamIfcFile(e){const{path:s,absolute:i,logLevel:n}=this.settings.wasm;this.webIfc.SetWasmPath(s,i),await this.webIfc.Init(),n&&this.webIfc.SetLogLevel(n),this.webIfc.OpenModelFromCallback(e,this.settings.webIfc)}async streamAllProperties(){const{propertiesSize:e}=this.settings,s=new Set(this.webIfc.GetIfcEntityList(0)),i=new Set([R,v,O,T,D]);for(const c of i)s.add(c);let n=.01,C=0;for(const c of s){if(C++,V.has(c))continue;const L=i.has(c),u=this.webIfc.GetLineIDsWithType(0,c),y=u.size();let S=0;for(let p=0;pn&&(n+=.01,n=Math.max(n,x),await this.onProgress.trigger(Math.round(n*100)/100))}const E=await this.components.get(U).processFromWebIfc(this.webIfc,0);await this.onIndicesStreamed.trigger(E)}cleanUp(){this.webIfc=null,this.webIfc=new B}}a(A,"uuid","88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");const X=document.getElementById("container"),r=new J,Z=r.get(q),l=Z.create();l.scene=new Y(r);l.renderer=new _(r,X);l.camera=new H(r);r.init();l.camera.controls.setLookAt(12,6,8,0,0,-10);const ee=r.get(K);ee.create(l);function te(t,o){const e=new File([o],t),s=document.createElement("a"),i=URL.createObjectURL(e);s.href=i,s.download=e.name,s.click(),URL.revokeObjectURL(i)}async function se(t){for(const{name:o,bits:e}of t)te(o,e),await new Promise(s=>{setTimeout(s,100)})}const h=new A(r);h.settings.wasm={path:"https://unpkg.com/web-ifc@0.0.53/",absolute:!0};const w={types:{},ids:{},indexesFile:"small.ifc-processed-properties-indexes"};let b=0;const g=[];h.onPropertiesStreamed.add(async t=>{w.types[t.type]||(w.types[t.type]=[]),w.types[t.type].push(b);for(const s in t.data)w.ids[s]=b;const o=`small.ifc-processed-properties-${b}`,e=new Blob([JSON.stringify(t.data)]);g.push({bits:e,name:o}),b++});h.onProgress.add(async t=>{console.log(t)});h.onIndicesStreamed.add(async t=>{g.push({name:"small.ifc-processed-properties.json",bits:new Blob([JSON.stringify(w)])});const e=r.get(U).serializeRelations(t);g.push({name:"small.ifc-processed-properties-indexes",bits:new Blob([e])}),await se(g)});async function oe(){const o=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),e=new Uint8Array(o);await h.streamFromBuffer(e)}W.init();const ne=$.create(()=>z` diff --git a/examples/assets/ifcRelationsIndexer.js b/examples/assets/ifcRelationsIndexer.js index 11789c5ac..3040b91c4 100644 --- a/examples/assets/ifcRelationsIndexer.js +++ b/examples/assets/ifcRelationsIndexer.js @@ -1,4 +1,4 @@ -import"./web-ifc-api-BC8YMRiS.js";import{p as d,a as m,m as f}from"./index-DyM33b1I.js";import{a as w,W as g,S as u,b,c as y,G as I}from"./index-DJTKMiao.js";import{I as R,a as x}from"./index-BzmpwuIQ.js";import{I as S}from"./index-buhHUNtp.js";import"./ifc-metadata-reader-j9dl-lHS.js";import"./ifc-fragment-settings-CiVry-YT.js";import"./index-D_n-lttT.js";import"./ifc-geometry-types-C3SKrzrZ.js";const L=document.getElementById("container"),t=new w,h=t.get(g),n=h.create();n.scene=new u(t);n.renderer=new b(t,L);n.camera=new y(t);t.init();n.camera.controls.setLookAt(12,6,8,0,0,-10);n.scene.setup();const O=t.get(I);O.create(n);const p=t.get(S);await p.setup();const P=await fetch("/resources/small.ifc"),U=await P.arrayBuffer(),j=new Uint8Array(U),e=await p.load(j);n.scene.three.add(e);const o=t.get(R);await o.process(e);const c=o.getEntityRelations(e,6518,"IsDefinedBy");if(c)for(const a of c){const r=await e.getProperties(a);console.log(r),await x.getPsetProps(e,a,async i=>{const s=await e.getProperties(i);console.log(s)})}const E=(a,r)=>{const i=new File([a],r),s=document.createElement("a");s.href=URL.createObjectURL(i),s.download=i.name,s.click(),URL.revokeObjectURL(s.href)},k=o.serializeModelRelations(e);console.log(k);const A=o.serializeAllRelations();delete o.relationMaps[e.uuid];const C=await fetch("/resources/small-relations.json"),F=o.getRelationsMapFromJSON(await C.text());o.setRelationMap(e,F);const l=o.getEntityRelations(e,6518,"ContainedInStructure");if(l&&l[0]){const a=await e.getProperties(l[0]);console.log(a)}d.init();const J=m.create(()=>f` +import"./web-ifc-api-BC8YMRiS.js";import{p as d,a as m,m as f}from"./index-DyM33b1I.js";import{a as w,W as g,S as u,b,c as y,G as I}from"./index-BraZXcLv.js";import{I as R,a as x}from"./index-DDOiyGyA.js";import{I as S}from"./index-PenRR3X-.js";import"./ifc-metadata-reader-j9dl-lHS.js";import"./ifc-fragment-settings-CiVry-YT.js";import"./index-DvHc-rVc.js";import"./ifc-geometry-types-C3SKrzrZ.js";const L=document.getElementById("container"),t=new w,h=t.get(g),n=h.create();n.scene=new u(t);n.renderer=new b(t,L);n.camera=new y(t);t.init();n.camera.controls.setLookAt(12,6,8,0,0,-10);n.scene.setup();const O=t.get(I);O.create(n);const p=t.get(S);await p.setup();const P=await fetch("/resources/small.ifc"),U=await P.arrayBuffer(),j=new Uint8Array(U),e=await p.load(j);n.scene.three.add(e);const o=t.get(R);await o.process(e);const c=o.getEntityRelations(e,6518,"IsDefinedBy");if(c)for(const a of c){const r=await e.getProperties(a);console.log(r),await x.getPsetProps(e,a,async i=>{const s=await e.getProperties(i);console.log(s)})}const E=(a,r)=>{const i=new File([a],r),s=document.createElement("a");s.href=URL.createObjectURL(i),s.download=i.name,s.click(),URL.revokeObjectURL(s.href)},k=o.serializeModelRelations(e);console.log(k);const A=o.serializeAllRelations();delete o.relationMaps[e.uuid];const C=await fetch("/resources/small-relations.json"),F=o.getRelationsMapFromJSON(await C.text());o.setRelationMap(e,F);const l=o.getEntityRelations(e,6518,"ContainedInStructure");if(l&&l[0]){const a=await e.getProperties(l[0]);console.log(a)}d.init();const J=m.create(()=>f` diff --git a/examples/assets/index-DJTKMiao.js b/examples/assets/index-BraZXcLv.js similarity index 87% rename from examples/assets/index-DJTKMiao.js rename to examples/assets/index-BraZXcLv.js index 6cca21292..805c414fc 100644 --- a/examples/assets/index-DJTKMiao.js +++ b/examples/assets/index-BraZXcLv.js @@ -1,13 +1,13 @@ -var Ws=Object.defineProperty;var $s=(n,e,t)=>e in n?Ws(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var U=(n,e,t)=>($s(n,typeof e!="symbol"?e+"":e,t),t);import{e as Rs,V as S,f as ht,P as Is,r as lt,T as Gt,y as Hs,a as ut,p as st,aO as Ks,Z as ks,ar as rs,M as Je,as as Gs,u as Qs,c as as,C as Ee,n as js,a_ as Js,a$ as ti,ah as cs,o as ei,at as si,au as ii,v as ni,Q as oi,av as ri,z as ai,h as ci,m as li,q as hi}from"./web-ifc-api-BC8YMRiS.js";const Vs=0,ui=1,di=2,ls=2,Ue=1.25,hs=1,we=6*4+4+4,be=65535,fi=Math.pow(2,-24),De=Symbol("SKIP_GENERATION");function pi(n){return n.index?n.index.count:n.attributes.position.count}function Bt(n){return pi(n)/3}function mi(n,e=ArrayBuffer){return n>65535?new Uint32Array(new e(4*n)):new Uint16Array(new e(2*n))}function _i(n,e){if(!n.index){const t=n.attributes.position.count,s=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,i=mi(t,s);n.setIndex(new Rs(i,1));for(let r=0;ra-c);for(let a=0;ar.offset-o.offset),s=t[t.length-1];s.count=Math.min(e-s.offset,s.count);let i=0;return t.forEach(({count:r})=>i+=r),e!==i}function Y(n,e,t){return t.min.x=e[n],t.min.y=e[n+1],t.min.z=e[n+2],t.max.x=e[n+3],t.max.y=e[n+4],t.max.z=e[n+5],t}function gi(n){n[0]=n[1]=n[2]=1/0,n[3]=n[4]=n[5]=-1/0}function us(n){let e=-1,t=-1/0;for(let s=0;s<3;s++){const i=n[s+3]-n[s];i>t&&(t=i,e=s)}return e}function ds(n,e){e.set(n)}function fs(n,e,t){let s,i;for(let r=0;r<3;r++){const o=r+3;s=n[r],i=e[r],t[r]=si?s:i}}function ee(n,e,t){for(let s=0;s<3;s++){const i=e[n+2*s],r=e[n+2*s+1],o=i-r,a=i+r;ot[s+3]&&(t[s+3]=a)}}function Ht(n){const e=n[3]-n[0],t=n[4]-n[1],s=n[5]-n[2];return 2*(e*t+t*s+s*e)}function Le(n,e,t,s,i=null){let r=1/0,o=1/0,a=1/0,c=-1/0,f=-1/0,d=-1/0,u=1/0,l=1/0,p=1/0,y=-1/0,O=-1/0,T=-1/0;const _=i!==null;for(let g=e*6,E=(e+t)*6;gc&&(c=x),_&&hy&&(y=h);const C=n[g+2],v=n[g+3],b=C-v,D=C+v;bf&&(f=D),_&&CO&&(O=C);const P=n[g+4],L=n[g+5],M=P-L,R=P+L;Md&&(d=R),_&&PT&&(T=P)}s[0]=r,s[1]=o,s[2]=a,s[3]=c,s[4]=f,s[5]=d,_&&(i[0]=u,i[1]=l,i[2]=p,i[3]=y,i[4]=O,i[5]=T)}function Ti(n,e,t,s){let i=1/0,r=1/0,o=1/0,a=-1/0,c=-1/0,f=-1/0;for(let d=e*6,u=(e+t)*6;da&&(a=l);const p=n[d+2];pc&&(c=p);const y=n[d+4];yf&&(f=y)}s[0]=i,s[1]=r,s[2]=o,s[3]=a,s[4]=c,s[5]=f}function Ei(n,e){gi(e);const t=n.attributes.position,s=n.index?n.index.array:null,i=Bt(n),r=new Float32Array(i*6),o=t.normalized,a=t.array,c=t.offset||0;let f=3;t.isInterleavedBufferAttribute&&(f=t.data.stride);const d=["getX","getY","getZ"];for(let u=0;uw&&(w=E),h>w&&(w=h);const x=(w-m)/2,C=_*2;r[p+C+0]=m+x,r[p+C+1]=x+(Math.abs(m)+x)*fi,me[_+3]&&(e[_+3]=w)}}return r}const ct=32,wi=(n,e)=>n.candidate-e.candidate,ft=new Array(ct).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),se=new Float32Array(6);function xi(n,e,t,s,i,r){let o=-1,a=0;if(r===Vs)o=us(e),o!==-1&&(a=(e[o]+e[o+3])/2);else if(r===ui)o=us(n),o!==-1&&(a=Oi(t,s,i,o));else if(r===di){const c=Ht(n);let f=Ue*i;const d=s*6,u=(s+i)*6;for(let l=0;l<3;l++){const p=e[l],T=(e[l+3]-p)/ct;if(i=x.candidate?ee(h,t,x.rightCacheBounds):(ee(h,t,x.leftCacheBounds),x.count++)}}for(let h=0;h=ct&&(w=ct-1);const x=ft[w];x.count++,ee(E,t,x.bounds)}const _=ft[ct-1];ds(_.bounds,_.rightCacheBounds);for(let E=ct-2;E>=0;E--){const h=ft[E],m=ft[E+1];fs(h.bounds,m.rightCacheBounds,h.rightCacheBounds)}let g=0;for(let E=0;E=c;)a--;if(o=c;)a--;if(o2**16,i=s?4:2,r=e?new SharedArrayBuffer(t*i):new ArrayBuffer(t*i),o=s?new Uint32Array(r):new Uint16Array(r);for(let a=0,c=o.length;a=i&&(u=!0,r&&(console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`),console.warn(t))),w<=o||C>=i)return g(m+w),h.offset=m,h.count=w,h;const v=xi(h.boundingData,x,y,m,w,a);if(v.axis===-1)return g(m+w),h.offset=m,h.count=w,h;const b=O(d,s,y,m,w,v);if(b===m||b===m+w)g(m+w),h.offset=m,h.count=w;else{h.splitAxis=v.axis;const D=new ie,P=m,L=b-m;h.left=D,D.boundingData=new Float32Array(6),Le(y,P,L,D.boundingData,p),E(D,P,L,p,C+1);const M=new ie,R=b,Z=w-L;h.right=M,M.boundingData=new Float32Array(6),Le(y,R,Z,M.boundingData,p),E(M,R,Z,p,C+1)}return h}}function Pi(n,e){const t=n.geometry;e.indirect&&(n._indirectBuffer=vi(t,e.useSharedArrayBuffer),yi(t)&&!e.verbose&&console.warn('MeshBVH: Provided geometry contains groups that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.')),n._indirectBuffer||_i(t,e);const s=bi(n,e);let i,r,o;const a=[],c=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let u=0;uMath.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return r[p+6]=h/4,h=d(h,g),r[p+7]=E,h}}}class dt{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let s=1/0,i=-1/0;for(let r=0,o=e.length;ri?c:i}this.min=s,this.max=i}setFromPoints(e,t){let s=1/0,i=-1/0;for(let r=0,o=t.length;ri?c:i}this.min=s,this.max=i}isSeparated(e){return this.min>e.max||e.min>this.max}}dt.prototype.setFromBox=function(){const n=new S;return function(t,s){const i=s.min,r=s.max;let o=1/0,a=-1/0;for(let c=0;c<=1;c++)for(let f=0;f<=1;f++)for(let d=0;d<=1;d++){n.x=i.x*c+r.x*(1-c),n.y=i.y*f+r.y*(1-f),n.z=i.z*d+r.z*(1-d);const u=t.dot(n);o=Math.min(u,o),a=Math.max(u,a)}this.min=o,this.max=a}}();const Ui=function(){const n=new S,e=new S,t=new S;return function(i,r,o){const a=i.start,c=n,f=r.start,d=e;t.subVectors(a,f),n.subVectors(i.end,i.start),e.subVectors(r.end,r.start);const u=t.dot(d),l=d.dot(c),p=d.dot(d),y=t.dot(c),T=c.dot(c)*p-l*l;let _,g;T!==0?_=(u*l-y*p)/T:_=0,g=(u+_*l)/p,o.x=_,o.y=g}}(),ts=function(){const n=new ht,e=new S,t=new S;return function(i,r,o,a){Ui(i,r,n);let c=n.x,f=n.y;if(c>=0&&c<=1&&f>=0&&f<=1){i.at(c,o),r.at(f,a);return}else if(c>=0&&c<=1){f<0?r.at(0,a):r.at(1,a),i.closestPointToPoint(a,!0,o);return}else if(f>=0&&f<=1){c<0?i.at(0,o):i.at(1,o),r.closestPointToPoint(o,!0,a);return}else{let d;c<0?d=i.start:d=i.end;let u;f<0?u=r.start:u=r.end;const l=e,p=t;if(i.closestPointToPoint(u,!0,e),r.closestPointToPoint(d,!0,t),l.distanceToSquared(u)<=p.distanceToSquared(d)){o.copy(l),a.copy(u);return}else{o.copy(d),a.copy(p);return}}}}(),Di=function(){const n=new S,e=new S,t=new Is,s=new lt;return function(r,o){const{radius:a,center:c}=r,{a:f,b:d,c:u}=o;if(s.start=f,s.end=d,s.closestPointToPoint(c,!0,n).distanceTo(c)<=a||(s.start=f,s.end=u,s.closestPointToPoint(c,!0,n).distanceTo(c)<=a)||(s.start=d,s.end=u,s.closestPointToPoint(c,!0,n).distanceTo(c)<=a))return!0;const O=o.getPlane(t);if(Math.abs(O.distanceToPoint(c))<=a){const _=O.projectPoint(c,e);if(o.containsPoint(_))return!0}return!1}}(),Li=1e-15;function Se(n){return Math.abs(n)new S),this.satBounds=new Array(4).fill().map(()=>new dt),this.points=[this.a,this.b,this.c],this.sphere=new Hs,this.plane=new Is,this.needsUpdate=!0}intersectsSphere(e){return Di(e,this)}update(){const e=this.a,t=this.b,s=this.c,i=this.points,r=this.satAxes,o=this.satBounds,a=r[0],c=o[0];this.getNormal(a),c.setFromPoints(a,i);const f=r[1],d=o[1];f.subVectors(e,t),d.setFromPoints(f,i);const u=r[2],l=o[2];u.subVectors(t,s),l.setFromPoints(u,i);const p=r[3],y=o[3];p.subVectors(s,e),y.setFromPoints(p,i),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(a,e),this.needsUpdate=!1}}ot.prototype.closestPointToSegment=function(){const n=new S,e=new S,t=new lt;return function(i,r=null,o=null){const{start:a,end:c}=i,f=this.points;let d,u=1/0;for(let l=0;l<3;l++){const p=(l+1)%3;t.start.copy(f[l]),t.end.copy(f[p]),ts(t,i,n,e),d=n.distanceToSquared(e),d=2){(h===1?_.start:_.end).copy(p),E=2;break}if(E++,E===2&&h===-1)break}}return E}return function(T,_=null,g=!1){this.needsUpdate&&this.update(),T.isExtendedTriangle?T.needsUpdate&&T.update():(n.copy(T),n.update(),T=n);const E=this.plane,h=T.plane;if(Math.abs(E.normal.dot(h.normal))>1-1e-10){const m=this.satBounds,w=this.satAxes;t[0]=T.a,t[1]=T.b,t[2]=T.c;for(let v=0;v<4;v++){const b=m[v],D=w[v];if(s.setFromPoints(D,t),b.isSeparated(s))return!1}const x=T.satBounds,C=T.satAxes;e[0]=this.a,e[1]=this.b,e[2]=this.c;for(let v=0;v<4;v++){const b=x[v],D=C[v];if(s.setFromPoints(D,e),b.isSeparated(s))return!1}for(let v=0;v<4;v++){const b=w[v];for(let D=0;D<4;D++){const P=C[D];if(r.crossVectors(b,P),s.setFromPoints(r,e),i.setFromPoints(r,t),s.isSeparated(i))return!1}}return _&&(g||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),_.start.set(0,0,0),_.end.set(0,0,0)),!0}else{const m=y(this,h,u);if(m===1&&T.containsPoint(u.end))return _&&(_.start.copy(u.end),_.end.copy(u.end)),!0;if(m!==2)return!1;const w=y(T,E,l);if(w===1&&this.containsPoint(l.end))return _&&(_.start.copy(l.end),_.end.copy(l.end)),!0;if(w!==2)return!1;if(u.delta(a),l.delta(c),a.dot(c)<0){let L=l.start;l.start=l.end,l.end=L}const x=u.start.dot(a),C=u.end.dot(a),v=l.start.dot(a),b=l.end.dot(a),D=C0?_.start.copy(u.start):_.start.copy(l.start),f.subVectors(u.end,l.end),f.dot(a)<0?_.end.copy(u.end):_.end.copy(l.end)),!0)}}}();ot.prototype.distanceToPoint=function(){const n=new S;return function(t){return this.closestPointToPoint(t,n),t.distanceTo(n)}}();ot.prototype.distanceToTriangle=function(){const n=new S,e=new S,t=["a","b","c"],s=new lt,i=new lt;return function(o,a=null,c=null){const f=a||c?s:null;if(this.intersectsTriangle(o,f))return(a||c)&&(a&&f.getCenter(a),c&&f.getCenter(c)),0;let d=1/0;for(let u=0;u<3;u++){let l;const p=t[u],y=o[p];this.closestPointToPoint(y,n),l=y.distanceToSquared(n),lnew S),this.satAxes=new Array(3).fill().map(()=>new S),this.satBounds=new Array(3).fill().map(()=>new dt),this.alignedSatBounds=new Array(3).fill().map(()=>new dt),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),s&&this.matrix.copy(s)}set(e,t,s){this.min.copy(e),this.max.copy(t),this.matrix.copy(s),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}}W.prototype.update=function(){return function(){const e=this.matrix,t=this.min,s=this.max,i=this.points;for(let f=0;f<=1;f++)for(let d=0;d<=1;d++)for(let u=0;u<=1;u++){const l=1*f|2*d|4*u,p=i[l];p.x=f?s.x:t.x,p.y=d?s.y:t.y,p.z=u?s.z:t.z,p.applyMatrix4(e)}const r=this.satBounds,o=this.satAxes,a=i[0];for(let f=0;f<3;f++){const d=o[f],u=r[f],l=1<new lt),t=new Array(12).fill().map(()=>new lt),s=new S,i=new S;return function(o,a=0,c=null,f=null){if(this.needsUpdate&&this.update(),this.intersectsBox(o))return(c||f)&&(o.getCenter(i),this.closestPointToPoint(i,s),o.closestPointToPoint(s,i),c&&c.copy(s),f&&f.copy(i)),0;const d=a*a,u=o.min,l=o.max,p=this.points;let y=1/0;for(let T=0;T<8;T++){const _=p[T];i.copy(_).clamp(u,l);const g=_.distanceToSquared(i);if(gnew ot)}}const j=new Si;function K(n,e){return e[n+15]===65535}function G(n,e){return e[n+6]}function J(n,e){return e[n+14]}function tt(n){return n+8}function et(n,e){return e[n+6]}function Zs(n,e){return e[n+7]}class Mi{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const e=[];let t=null;this.setBuffer=s=>{t&&e.push(t),t=s,this.float32Array=new Float32Array(s),this.uint16Array=new Uint16Array(s),this.uint32Array=new Uint32Array(s)},this.clearBuffer=()=>{t=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,e.length!==0&&this.setBuffer(e.pop())}}}const V=new Mi;let _t,zt;const Et=[],ne=new es(()=>new st);function zi(n,e,t,s,i,r){_t=ne.getPrimitive(),zt=ne.getPrimitive(),Et.push(_t,zt),V.setBuffer(n._roots[e]);const o=qe(0,n.geometry,t,s,i,r);V.clearBuffer(),ne.releasePrimitive(_t),ne.releasePrimitive(zt),Et.pop(),Et.pop();const a=Et.length;return a>0&&(zt=Et[a-1],_t=Et[a-2]),o}function qe(n,e,t,s,i=null,r=0,o=0){const{float32Array:a,uint16Array:c,uint32Array:f}=V;let d=n*2;if(K(d,c)){const l=G(n,f),p=J(d,c);return Y(n,a,_t),s(l,p,!1,o,r+n,_t)}else{let b=function(P){const{uint16Array:L,uint32Array:M}=V;let R=P*2;for(;!K(R,L);)P=tt(P),R=P*2;return G(P,M)},D=function(P){const{uint16Array:L,uint32Array:M}=V;let R=P*2;for(;!K(R,L);)P=et(P,M),R=P*2;return G(P,M)+J(R,L)};const l=tt(n),p=et(n,f);let y=l,O=p,T,_,g,E;if(i&&(g=_t,E=zt,Y(y,a,g),Y(O,a,E),T=i(g),_=i(E),_(kt.copy(e).clamp(d.min,d.max),kt.distanceToSquared(e)),intersectsBounds:(d,u,l)=>l{d.closestPointToPoint(e,kt);const l=e.distanceToSquared(kt);return l0&&f.normal.multiplyScalar(-1));const d={a:r,b:o,c:a,normal:new S,materialIndex:0};Gt.getNormal(wt,xt,Ot,d.normal),f.face=d,f.faceIndex=r}return f}function Pe(n,e,t,s,i){const r=s*3;let o=r+0,a=r+1,c=r+2;const f=n.index;n.index&&(o=f.getX(o),a=f.getX(a),c=f.getX(c));const{position:d,normal:u,uv:l,uv1:p}=n.attributes,y=Ri(t,d,u,l,p,o,a,c,e);return y?(y.faceIndex=s,i&&i.push(y),y):null}function q(n,e,t,s){const i=n.a,r=n.b,o=n.c;let a=e,c=e+1,f=e+2;t&&(a=t.getX(a),c=t.getX(c),f=t.getX(f)),i.x=s.getX(a),i.y=s.getY(a),i.z=s.getZ(a),r.x=s.getX(c),r.y=s.getY(c),r.z=s.getZ(c),o.x=s.getX(f),o.y=s.getY(f),o.z=s.getZ(f)}function Ii(n,e,t,s,i,r){const{geometry:o,_indirectBuffer:a}=n;for(let c=s,f=s+i;cw&&(w=P),Lx&&(x=L),MC&&(C=M)}return c[l+0]!==E||c[l+1]!==h||c[l+2]!==m||c[l+3]!==w||c[l+4]!==x||c[l+5]!==C?(c[l+0]=E,c[l+1]=h,c[l+2]=m,c[l+3]=w,c[l+4]=x,c[l+5]=C,!0):!1}else{const _=l+8,g=o[l+6],E=_+p,h=g+p;let m=y,w=!1,x=!1;e?m||(w=e.has(E),x=e.has(h),m=!w&&!x):(w=!0,x=!0);const C=m||w,v=m||x;let b=!1;C&&(b=u(_,p,m));let D=!1;v&&(D=u(g,p,m));const P=b||D;if(P)for(let L=0;L<3;L++){const M=_+L,R=g+L,Z=c[M],Ft=c[M+3],Rt=c[R],It=c[R+3];c[l+L]=ZIt?Ft:It}return P}}}const ys=new st;function yt(n,e,t,s){return Y(n,e,ys),t.intersectBox(ys,s)}function Yi(n,e,t,s,i,r){const{geometry:o,_indirectBuffer:a}=n;for(let c=s,f=s+i;c=0;let p,y;l?(p=tt(n),y=et(n,o)):(p=et(n,o),y=tt(n));const T=yt(p,i,s,Ts)?$e(p,e,t,s):null;if(T){const E=T.point[d];if(l?E<=i[y+f]:E>=i[y+f+3])return T}const g=yt(y,i,s,Ts)?$e(y,e,t,s):null;return T&&g?T.distance<=g.distance?T:g:T||g||null}}const le=new st,At=new ot,Ct=new ot,Vt=new ut,Es=new W,he=new W;function $i(n,e,t,s){V.setBuffer(n._roots[e]);const i=Ke(0,n,t,s);return V.clearBuffer(),i}function Ke(n,e,t,s,i=null){const{float32Array:r,uint16Array:o,uint32Array:a}=V;let c=n*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),Es.set(t.boundingBox.min,t.boundingBox.max,s),i=Es),K(c,o)){const d=e.geometry,u=d.index,l=d.attributes.position,p=t.index,y=t.attributes.position,O=G(n,a),T=J(c,o);if(Vt.copy(s).invert(),t.boundsTree)return Y(n,r,he),he.matrix.copy(Vt),he.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:g=>he.intersectsBox(g),intersectsTriangle:g=>{g.a.applyMatrix4(s),g.b.applyMatrix4(s),g.c.applyMatrix4(s),g.needsUpdate=!0;for(let E=O*3,h=(T+O)*3;Eze.distanceToBox(m),intersectsBounds:(m,w,x)=>x{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:C=>Yt.distanceToBox(C),intersectsBounds:(C,v,b)=>b{for(let b=C,D=C+v;bw&&(w=M),Rx&&(x=R),ZC&&(C=Z)}}return c[l+0]!==E||c[l+1]!==h||c[l+2]!==m||c[l+3]!==w||c[l+4]!==x||c[l+5]!==C?(c[l+0]=E,c[l+1]=h,c[l+2]=m,c[l+3]=w,c[l+4]=x,c[l+5]=C,!0):!1}else{const _=l+8,g=o[l+6],E=_+p,h=g+p;let m=y,w=!1,x=!1;e?m||(w=e.has(E),x=e.has(h),m=!w&&!x):(w=!0,x=!0);const C=m||w,v=m||x;let b=!1;C&&(b=u(_,p,m));let D=!1;v&&(D=u(g,p,m));const P=b||D;if(P)for(let L=0;L<3;L++){const M=_+L,R=g+L,Z=c[M],Ft=c[M+3],Rt=c[R],It=c[R+3];c[l+L]=ZIt?Ft:It}return P}}}const ws=new S;function en(n,e,t,s,i){V.setBuffer(n._roots[e]),Ge(0,n,t,s,i),V.clearBuffer()}function Ge(n,e,t,s,i){const{float32Array:r,uint16Array:o,uint32Array:a}=V,c=n*2;if(K(c,o)){const d=G(n,a),u=J(c,o);Yi(e,t,s,d,u,i)}else{const d=tt(n);yt(d,r,s,ws)&&Ge(d,e,t,s,i);const u=et(n,a);yt(u,r,s,ws)&&Ge(u,e,t,s,i)}}const xs=new S,sn=["x","y","z"];function nn(n,e,t,s){V.setBuffer(n._roots[e]);const i=Qe(0,n,t,s);return V.clearBuffer(),i}function Qe(n,e,t,s){const{float32Array:i,uint16Array:r,uint32Array:o}=V;let a=n*2;if(K(a,r)){const f=G(n,o),d=J(a,r);return Ni(e,t,s,f,d)}else{const f=Zs(n,o),d=sn[f],l=s.direction[d]>=0;let p,y;l?(p=tt(n),y=et(n,o)):(p=et(n,o),y=tt(n));const T=yt(p,i,s,xs)?Qe(p,e,t,s):null;if(T){const E=T.point[d];if(l?E<=i[y+f]:E>=i[y+f+3])return T}const g=yt(y,i,s,xs)?Qe(y,e,t,s):null;return T&&g?T.distance<=g.distance?T:g:T||g||null}}const de=new st,vt=new ot,bt=new ot,Nt=new ut,Os=new W,fe=new W;function on(n,e,t,s){V.setBuffer(n._roots[e]);const i=je(0,n,t,s);return V.clearBuffer(),i}function je(n,e,t,s,i=null){const{float32Array:r,uint16Array:o,uint32Array:a}=V;let c=n*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),Os.set(t.boundingBox.min,t.boundingBox.max,s),i=Os),K(c,o)){const d=e.geometry,u=d.index,l=d.attributes.position,p=t.index,y=t.attributes.position,O=G(n,a),T=J(c,o);if(Nt.copy(s).invert(),t.boundsTree)return Y(n,r,fe),fe.matrix.copy(Nt),fe.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:g=>fe.intersectsBox(g),intersectsTriangle:g=>{g.a.applyMatrix4(s),g.b.applyMatrix4(s),g.c.applyMatrix4(s),g.needsUpdate=!0;for(let E=O,h=T+O;EBe.distanceToBox(m),intersectsBounds:(m,w,x)=>x{if(e.boundsTree){const x=e.boundsTree;return x.shapecast({boundsTraverseOrder:C=>Zt.distanceToBox(C),intersectsBounds:(C,v,b)=>b{for(let b=C,D=C+v;bnew st),Pt=new st,Ut=new st,Fe=new st,Re=new st;let Ie=!1;function dn(n,e,t,s){if(Ie)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");Ie=!0;const i=n._roots,r=e._roots;let o,a=0,c=0;const f=new ut().copy(t).invert();for(let d=0,u=i.length;dc.slice()),index:o.array.slice(),indirectBuffer:r?r.slice():null}:a={roots:i,index:o.array,indirectBuffer:r},a}static deserialize(e,t,s={}){s={setIndex:!0,indirect:!!e.indirectBuffer,...s};const{index:i,roots:r,indirectBuffer:o}=e,a=new ss(t,{...s,[De]:!0});if(a._roots=r,a._indirectBuffer=o||null,s.setIndex){const c=t.getIndex();if(c===null){const f=new Rs(e.index,1,!1);t.setIndex(f)}else c.array!==i&&(c.array.set(i),c.needsUpdate=!0)}return a}get indirect(){return!!this._indirectBuffer}constructor(e,t={}){if(e.isBufferGeometry){if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");if(t=Object.assign({strategy:Vs,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[De]:!1},t),t.useSharedArrayBuffer&&!un())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=e,this._roots=null,this._indirectBuffer=null,t[De]||(Pi(this,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new st)));const{_indirectBuffer:s}=this;this.resolveTriangleIndex=t.indirect?i=>s[i]:i=>i}refit(e=null){return(this.indirect?tn:Vi)(this,e)}traverse(e,t=0){const s=this._roots[t],i=new Uint32Array(s),r=new Uint16Array(s);o(0);function o(a,c=0){const f=a*2,d=r[f+15]===be;if(d){const u=i[a+6],l=r[f+14];e(c,d,new Float32Array(s,a*4,6),u,l)}else{const u=a+we/4,l=i[a+6],p=i[a+7];e(c,d,new Float32Array(s,a*4,6),p)||(o(u,c+1),o(l,c+1))}}}raycast(e,t=rs){const s=this._roots,i=this.geometry,r=[],o=t.isMaterial,a=Array.isArray(t),c=i.groups,f=o?t.side:t,d=this.indirect?en:Xi;for(let u=0,l=s.length;uu(l,p,y,O,T)?!0:s(l,p,this,a,y,O,t)}else o||(a?o=(u,l,p,y)=>s(u,l,this,a,p,y,t):o=(u,l,p)=>p);let c=!1,f=0;const d=this._roots;for(let u=0,l=d.length;u{const O=this.resolveTriangleIndex(y);q(o,O*3,a,c)}:y=>{q(o,y*3,a,c)},d=j.getPrimitive(),u=e.geometry.index,l=e.geometry.attributes.position,p=e.indirect?y=>{const O=e.resolveTriangleIndex(y);q(d,O*3,u,l)}:y=>{q(d,y*3,u,l)};if(r){const y=(O,T,_,g,E,h,m,w)=>{for(let x=_,C=_+g;xme.intersectsBox(s),intersectsTriangle:s=>me.intersectsTriangle(s)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,s={},i={},r=0,o=1/0){return(this.indirect?hn:Ji)(this,e,t,s,i,r,o)}closestPointToPoint(e,t={},s=0,i=1/0){return Bi(this,e,t,s,i)}getBoundingBox(e){return e.makeEmpty(),this._roots.forEach(s=>{Y(0,new Float32Array(s),As),e.union(As)}),e}}function Cs(n,e,t){return n===null||(n.point.applyMatrix4(e.matrixWorld),n.distance=n.point.distanceTo(t.ray.origin),n.object=e,n.distancet.far)?null:n}const He=new Gs,vs=new ut,fn=Je.prototype.raycast;function pn(n,e){if(this.geometry.boundsTree){if(this.material===void 0)return;vs.copy(this.matrixWorld).invert(),He.copy(n.ray).applyMatrix4(vs);const t=this.geometry.boundsTree;if(n.firstHitOnly===!0){const s=Cs(t.raycastFirst(He,this.material),this,n);s&&e.push(s)}else{const s=t.raycast(He,this.material);for(let i=0,r=s.length;i{const t=this.handlers.slice(0);for(const s of t)s(e)});U(this,"handlers",[])}add(e){this.handlers.push(e)}remove(e){this.handlers=this.handlers.filter(t=>t!==e)}reset(){this.handlers.length=0}}class is{constructor(e){U(this,"isDisposeable",()=>"dispose"in this&&"onDisposed"in this);U(this,"isResizeable",()=>"resize"in this&&"getSize"in this);U(this,"isUpdateable",()=>"onAfterUpdate"in this&&"onBeforeUpdate"in this&&"update"in this);U(this,"isHideable",()=>"visible"in this);U(this,"isConfigurable",()=>"setup"in this&&"config"in this&&"onSetup"in this);this.components=e}}class ns extends is{}class os extends is{constructor(t){super(t);U(this,"worlds",new Map);U(this,"onWorldChanged",new N);U(this,"currentWorld",null);this.onWorldChanged.add(({world:s,action:i})=>{i==="removed"&&this.worlds.delete(s.uuid)})}}class yn extends os{constructor(){super(...arguments);U(this,"hasCameraControls",()=>"controls"in this)}}class gn extends os{constructor(){super(...arguments);U(this,"onAfterUpdate",new N);U(this,"onBeforeUpdate",new N);U(this,"onDisposed",new N);U(this,"onResize",new N);U(this,"onClippingPlanesUpdated",new N);U(this,"clippingPlanes",[])}updateClippingPlanes(){this.onClippingPlanesUpdated.trigger()}setPlane(t,s,i){s.isLocal=i;const r=this.clippingPlanes.indexOf(s);t&&r===-1?this.clippingPlanes.push(s):!t&&r>-1&&this.clippingPlanes.splice(r,1),this.three.clippingPlanes=this.clippingPlanes.filter(o=>!o.isLocal)}}const jt=class jt extends ns{constructor(t){super(t);U(this,"_disposedComponents",new Set);U(this,"enabled",!0);t.add(jt.uuid,this)}get(){return this._disposedComponents}destroy(t,s=!0,i=!0){t.removeFromParent();const r=t;r.dispose&&r.dispose(),this.disposeGeometryAndMaterials(t,s),i&&r.children&&r.children.length&&this.disposeChildren(r),t.children.length=0}disposeGeometry(t){const s=t;s.boundsTree&&s.disposeBoundsTree(),t.dispose()}disposeGeometryAndMaterials(t,s){const i=t;i.geometry&&this.disposeGeometry(i.geometry),s&&i.material&&jt.disposeMaterial(i),i.material=[],i.geometry=null}disposeChildren(t){for(const s of t.children)this.destroy(s)}static disposeMaterial(t){if(t.material)if(Array.isArray(t.material))for(const s of t.material)s.dispose();else t.material.dispose()}};U(jt,"uuid","76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");let Jt=jt;class Tn extends os{constructor(t){super(t);U(this,"onDisposed",new N)}dispose(){const t=this.components.get(Jt);for(const s of this.three.children){const i=s;i.geometry&&t.destroy(i)}this.three.children=[],this.onDisposed.trigger(),this.onDisposed.reset()}}const X=class X{static create(){const e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,s=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return`${X._lut[e&255]+X._lut[e>>8&255]+X._lut[e>>16&255]+X._lut[e>>24&255]}-${X._lut[t&255]}${X._lut[t>>8&255]}-${X._lut[t>>16&15|64]}${X._lut[t>>24&255]}-${X._lut[s&63|128]}${X._lut[s>>8&255]}-${X._lut[s>>16&255]}${X._lut[s>>24&255]}${X._lut[i&255]}${X._lut[i>>8&255]}${X._lut[i>>16&255]}${X._lut[i>>24&255]}`.toLowerCase()}static validate(e){if(!X._pattern.test(e))throw new Error(`${e} is not a valid UUID v4. +var qs=Object.defineProperty;var $s=(n,e,t)=>e in n?qs(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var U=(n,e,t)=>($s(n,typeof e!="symbol"?e+"":e,t),t);import{e as Rs,V as S,f as ht,P as Is,r as lt,T as Gt,y as Hs,a as ut,p as st,aO as Ks,Z as ks,ar as rs,M as Je,as as Gs,u as Qs,c as as,C as Ee,n as js,a_ as Js,a$ as ti,ah as cs,o as ei,at as si,au as ii,v as ni,Q as oi,av as ri,z as ai,h as ci,m as li,q as hi}from"./web-ifc-api-BC8YMRiS.js";const Vs=0,ui=1,di=2,ls=2,Ue=1.25,hs=1,we=6*4+4+4,be=65535,fi=Math.pow(2,-24),De=Symbol("SKIP_GENERATION");function pi(n){return n.index?n.index.count:n.attributes.position.count}function Bt(n){return pi(n)/3}function mi(n,e=ArrayBuffer){return n>65535?new Uint32Array(new e(4*n)):new Uint16Array(new e(2*n))}function _i(n,e){if(!n.index){const t=n.attributes.position.count,s=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,i=mi(t,s);n.setIndex(new Rs(i,1));for(let r=0;ra-c);for(let a=0;ar.offset-o.offset),s=t[t.length-1];s.count=Math.min(e-s.offset,s.count);let i=0;return t.forEach(({count:r})=>i+=r),e!==i}function N(n,e,t){return t.min.x=e[n],t.min.y=e[n+1],t.min.z=e[n+2],t.max.x=e[n+3],t.max.y=e[n+4],t.max.z=e[n+5],t}function gi(n){n[0]=n[1]=n[2]=1/0,n[3]=n[4]=n[5]=-1/0}function us(n){let e=-1,t=-1/0;for(let s=0;s<3;s++){const i=n[s+3]-n[s];i>t&&(t=i,e=s)}return e}function ds(n,e){e.set(n)}function fs(n,e,t){let s,i;for(let r=0;r<3;r++){const o=r+3;s=n[r],i=e[r],t[r]=si?s:i}}function ee(n,e,t){for(let s=0;s<3;s++){const i=e[n+2*s],r=e[n+2*s+1],o=i-r,a=i+r;ot[s+3]&&(t[s+3]=a)}}function Ht(n){const e=n[3]-n[0],t=n[4]-n[1],s=n[5]-n[2];return 2*(e*t+t*s+s*e)}function Le(n,e,t,s,i=null){let r=1/0,o=1/0,a=1/0,c=-1/0,f=-1/0,d=-1/0,u=1/0,l=1/0,p=1/0,y=-1/0,O=-1/0,T=-1/0;const _=i!==null;for(let g=e*6,E=(e+t)*6;gc&&(c=x),_&&hy&&(y=h);const C=n[g+2],v=n[g+3],b=C-v,D=C+v;bf&&(f=D),_&&CO&&(O=C);const P=n[g+4],L=n[g+5],M=P-L,R=P+L;Md&&(d=R),_&&PT&&(T=P)}s[0]=r,s[1]=o,s[2]=a,s[3]=c,s[4]=f,s[5]=d,_&&(i[0]=u,i[1]=l,i[2]=p,i[3]=y,i[4]=O,i[5]=T)}function Ti(n,e,t,s){let i=1/0,r=1/0,o=1/0,a=-1/0,c=-1/0,f=-1/0;for(let d=e*6,u=(e+t)*6;da&&(a=l);const p=n[d+2];pc&&(c=p);const y=n[d+4];yf&&(f=y)}s[0]=i,s[1]=r,s[2]=o,s[3]=a,s[4]=c,s[5]=f}function Ei(n,e){gi(e);const t=n.attributes.position,s=n.index?n.index.array:null,i=Bt(n),r=new Float32Array(i*6),o=t.normalized,a=t.array,c=t.offset||0;let f=3;t.isInterleavedBufferAttribute&&(f=t.data.stride);const d=["getX","getY","getZ"];for(let u=0;uw&&(w=E),h>w&&(w=h);const x=(w-m)/2,C=_*2;r[p+C+0]=m+x,r[p+C+1]=x+(Math.abs(m)+x)*fi,me[_+3]&&(e[_+3]=w)}}return r}const ct=32,wi=(n,e)=>n.candidate-e.candidate,ft=new Array(ct).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),se=new Float32Array(6);function xi(n,e,t,s,i,r){let o=-1,a=0;if(r===Vs)o=us(e),o!==-1&&(a=(e[o]+e[o+3])/2);else if(r===ui)o=us(n),o!==-1&&(a=Oi(t,s,i,o));else if(r===di){const c=Ht(n);let f=Ue*i;const d=s*6,u=(s+i)*6;for(let l=0;l<3;l++){const p=e[l],T=(e[l+3]-p)/ct;if(i=x.candidate?ee(h,t,x.rightCacheBounds):(ee(h,t,x.leftCacheBounds),x.count++)}}for(let h=0;h=ct&&(w=ct-1);const x=ft[w];x.count++,ee(E,t,x.bounds)}const _=ft[ct-1];ds(_.bounds,_.rightCacheBounds);for(let E=ct-2;E>=0;E--){const h=ft[E],m=ft[E+1];fs(h.bounds,m.rightCacheBounds,h.rightCacheBounds)}let g=0;for(let E=0;E=c;)a--;if(o=c;)a--;if(o2**16,i=s?4:2,r=e?new SharedArrayBuffer(t*i):new ArrayBuffer(t*i),o=s?new Uint32Array(r):new Uint16Array(r);for(let a=0,c=o.length;a=i&&(u=!0,r&&(console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`),console.warn(t))),w<=o||C>=i)return g(m+w),h.offset=m,h.count=w,h;const v=xi(h.boundingData,x,y,m,w,a);if(v.axis===-1)return g(m+w),h.offset=m,h.count=w,h;const b=O(d,s,y,m,w,v);if(b===m||b===m+w)g(m+w),h.offset=m,h.count=w;else{h.splitAxis=v.axis;const D=new ie,P=m,L=b-m;h.left=D,D.boundingData=new Float32Array(6),Le(y,P,L,D.boundingData,p),E(D,P,L,p,C+1);const M=new ie,R=b,Z=w-L;h.right=M,M.boundingData=new Float32Array(6),Le(y,R,Z,M.boundingData,p),E(M,R,Z,p,C+1)}return h}}function Pi(n,e){const t=n.geometry;e.indirect&&(n._indirectBuffer=vi(t,e.useSharedArrayBuffer),yi(t)&&!e.verbose&&console.warn('MeshBVH: Provided geometry contains groups that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.')),n._indirectBuffer||_i(t,e);const s=bi(n,e);let i,r,o;const a=[],c=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let u=0;uMath.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return r[p+6]=h/4,h=d(h,g),r[p+7]=E,h}}}class dt{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let s=1/0,i=-1/0;for(let r=0,o=e.length;ri?c:i}this.min=s,this.max=i}setFromPoints(e,t){let s=1/0,i=-1/0;for(let r=0,o=t.length;ri?c:i}this.min=s,this.max=i}isSeparated(e){return this.min>e.max||e.min>this.max}}dt.prototype.setFromBox=function(){const n=new S;return function(t,s){const i=s.min,r=s.max;let o=1/0,a=-1/0;for(let c=0;c<=1;c++)for(let f=0;f<=1;f++)for(let d=0;d<=1;d++){n.x=i.x*c+r.x*(1-c),n.y=i.y*f+r.y*(1-f),n.z=i.z*d+r.z*(1-d);const u=t.dot(n);o=Math.min(u,o),a=Math.max(u,a)}this.min=o,this.max=a}}();const Ui=function(){const n=new S,e=new S,t=new S;return function(i,r,o){const a=i.start,c=n,f=r.start,d=e;t.subVectors(a,f),n.subVectors(i.end,i.start),e.subVectors(r.end,r.start);const u=t.dot(d),l=d.dot(c),p=d.dot(d),y=t.dot(c),T=c.dot(c)*p-l*l;let _,g;T!==0?_=(u*l-y*p)/T:_=0,g=(u+_*l)/p,o.x=_,o.y=g}}(),ts=function(){const n=new ht,e=new S,t=new S;return function(i,r,o,a){Ui(i,r,n);let c=n.x,f=n.y;if(c>=0&&c<=1&&f>=0&&f<=1){i.at(c,o),r.at(f,a);return}else if(c>=0&&c<=1){f<0?r.at(0,a):r.at(1,a),i.closestPointToPoint(a,!0,o);return}else if(f>=0&&f<=1){c<0?i.at(0,o):i.at(1,o),r.closestPointToPoint(o,!0,a);return}else{let d;c<0?d=i.start:d=i.end;let u;f<0?u=r.start:u=r.end;const l=e,p=t;if(i.closestPointToPoint(u,!0,e),r.closestPointToPoint(d,!0,t),l.distanceToSquared(u)<=p.distanceToSquared(d)){o.copy(l),a.copy(u);return}else{o.copy(d),a.copy(p);return}}}}(),Di=function(){const n=new S,e=new S,t=new Is,s=new lt;return function(r,o){const{radius:a,center:c}=r,{a:f,b:d,c:u}=o;if(s.start=f,s.end=d,s.closestPointToPoint(c,!0,n).distanceTo(c)<=a||(s.start=f,s.end=u,s.closestPointToPoint(c,!0,n).distanceTo(c)<=a)||(s.start=d,s.end=u,s.closestPointToPoint(c,!0,n).distanceTo(c)<=a))return!0;const O=o.getPlane(t);if(Math.abs(O.distanceToPoint(c))<=a){const _=O.projectPoint(c,e);if(o.containsPoint(_))return!0}return!1}}(),Li=1e-15;function Se(n){return Math.abs(n)new S),this.satBounds=new Array(4).fill().map(()=>new dt),this.points=[this.a,this.b,this.c],this.sphere=new Hs,this.plane=new Is,this.needsUpdate=!0}intersectsSphere(e){return Di(e,this)}update(){const e=this.a,t=this.b,s=this.c,i=this.points,r=this.satAxes,o=this.satBounds,a=r[0],c=o[0];this.getNormal(a),c.setFromPoints(a,i);const f=r[1],d=o[1];f.subVectors(e,t),d.setFromPoints(f,i);const u=r[2],l=o[2];u.subVectors(t,s),l.setFromPoints(u,i);const p=r[3],y=o[3];p.subVectors(s,e),y.setFromPoints(p,i),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(a,e),this.needsUpdate=!1}}ot.prototype.closestPointToSegment=function(){const n=new S,e=new S,t=new lt;return function(i,r=null,o=null){const{start:a,end:c}=i,f=this.points;let d,u=1/0;for(let l=0;l<3;l++){const p=(l+1)%3;t.start.copy(f[l]),t.end.copy(f[p]),ts(t,i,n,e),d=n.distanceToSquared(e),d=2){(h===1?_.start:_.end).copy(p),E=2;break}if(E++,E===2&&h===-1)break}}return E}return function(T,_=null,g=!1){this.needsUpdate&&this.update(),T.isExtendedTriangle?T.needsUpdate&&T.update():(n.copy(T),n.update(),T=n);const E=this.plane,h=T.plane;if(Math.abs(E.normal.dot(h.normal))>1-1e-10){const m=this.satBounds,w=this.satAxes;t[0]=T.a,t[1]=T.b,t[2]=T.c;for(let v=0;v<4;v++){const b=m[v],D=w[v];if(s.setFromPoints(D,t),b.isSeparated(s))return!1}const x=T.satBounds,C=T.satAxes;e[0]=this.a,e[1]=this.b,e[2]=this.c;for(let v=0;v<4;v++){const b=x[v],D=C[v];if(s.setFromPoints(D,e),b.isSeparated(s))return!1}for(let v=0;v<4;v++){const b=w[v];for(let D=0;D<4;D++){const P=C[D];if(r.crossVectors(b,P),s.setFromPoints(r,e),i.setFromPoints(r,t),s.isSeparated(i))return!1}}return _&&(g||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),_.start.set(0,0,0),_.end.set(0,0,0)),!0}else{const m=y(this,h,u);if(m===1&&T.containsPoint(u.end))return _&&(_.start.copy(u.end),_.end.copy(u.end)),!0;if(m!==2)return!1;const w=y(T,E,l);if(w===1&&this.containsPoint(l.end))return _&&(_.start.copy(l.end),_.end.copy(l.end)),!0;if(w!==2)return!1;if(u.delta(a),l.delta(c),a.dot(c)<0){let L=l.start;l.start=l.end,l.end=L}const x=u.start.dot(a),C=u.end.dot(a),v=l.start.dot(a),b=l.end.dot(a),D=C0?_.start.copy(u.start):_.start.copy(l.start),f.subVectors(u.end,l.end),f.dot(a)<0?_.end.copy(u.end):_.end.copy(l.end)),!0)}}}();ot.prototype.distanceToPoint=function(){const n=new S;return function(t){return this.closestPointToPoint(t,n),t.distanceTo(n)}}();ot.prototype.distanceToTriangle=function(){const n=new S,e=new S,t=["a","b","c"],s=new lt,i=new lt;return function(o,a=null,c=null){const f=a||c?s:null;if(this.intersectsTriangle(o,f))return(a||c)&&(a&&f.getCenter(a),c&&f.getCenter(c)),0;let d=1/0;for(let u=0;u<3;u++){let l;const p=t[u],y=o[p];this.closestPointToPoint(y,n),l=y.distanceToSquared(n),lnew S),this.satAxes=new Array(3).fill().map(()=>new S),this.satBounds=new Array(3).fill().map(()=>new dt),this.alignedSatBounds=new Array(3).fill().map(()=>new dt),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),s&&this.matrix.copy(s)}set(e,t,s){this.min.copy(e),this.max.copy(t),this.matrix.copy(s),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}}q.prototype.update=function(){return function(){const e=this.matrix,t=this.min,s=this.max,i=this.points;for(let f=0;f<=1;f++)for(let d=0;d<=1;d++)for(let u=0;u<=1;u++){const l=1*f|2*d|4*u,p=i[l];p.x=f?s.x:t.x,p.y=d?s.y:t.y,p.z=u?s.z:t.z,p.applyMatrix4(e)}const r=this.satBounds,o=this.satAxes,a=i[0];for(let f=0;f<3;f++){const d=o[f],u=r[f],l=1<new lt),t=new Array(12).fill().map(()=>new lt),s=new S,i=new S;return function(o,a=0,c=null,f=null){if(this.needsUpdate&&this.update(),this.intersectsBox(o))return(c||f)&&(o.getCenter(i),this.closestPointToPoint(i,s),o.closestPointToPoint(s,i),c&&c.copy(s),f&&f.copy(i)),0;const d=a*a,u=o.min,l=o.max,p=this.points;let y=1/0;for(let T=0;T<8;T++){const _=p[T];i.copy(_).clamp(u,l);const g=_.distanceToSquared(i);if(gnew ot)}}const j=new Si;function K(n,e){return e[n+15]===65535}function G(n,e){return e[n+6]}function J(n,e){return e[n+14]}function tt(n){return n+8}function et(n,e){return e[n+6]}function Zs(n,e){return e[n+7]}class Mi{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const e=[];let t=null;this.setBuffer=s=>{t&&e.push(t),t=s,this.float32Array=new Float32Array(s),this.uint16Array=new Uint16Array(s),this.uint32Array=new Uint32Array(s)},this.clearBuffer=()=>{t=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,e.length!==0&&this.setBuffer(e.pop())}}}const V=new Mi;let _t,zt;const Et=[],ne=new es(()=>new st);function zi(n,e,t,s,i,r){_t=ne.getPrimitive(),zt=ne.getPrimitive(),Et.push(_t,zt),V.setBuffer(n._roots[e]);const o=We(0,n.geometry,t,s,i,r);V.clearBuffer(),ne.releasePrimitive(_t),ne.releasePrimitive(zt),Et.pop(),Et.pop();const a=Et.length;return a>0&&(zt=Et[a-1],_t=Et[a-2]),o}function We(n,e,t,s,i=null,r=0,o=0){const{float32Array:a,uint16Array:c,uint32Array:f}=V;let d=n*2;if(K(d,c)){const l=G(n,f),p=J(d,c);return N(n,a,_t),s(l,p,!1,o,r+n,_t)}else{let b=function(P){const{uint16Array:L,uint32Array:M}=V;let R=P*2;for(;!K(R,L);)P=tt(P),R=P*2;return G(P,M)},D=function(P){const{uint16Array:L,uint32Array:M}=V;let R=P*2;for(;!K(R,L);)P=et(P,M),R=P*2;return G(P,M)+J(R,L)};const l=tt(n),p=et(n,f);let y=l,O=p,T,_,g,E;if(i&&(g=_t,E=zt,N(y,a,g),N(O,a,E),T=i(g),_=i(E),_(kt.copy(e).clamp(d.min,d.max),kt.distanceToSquared(e)),intersectsBounds:(d,u,l)=>l{d.closestPointToPoint(e,kt);const l=e.distanceToSquared(kt);return l0&&f.normal.multiplyScalar(-1));const d={a:r,b:o,c:a,normal:new S,materialIndex:0};Gt.getNormal(wt,xt,Ot,d.normal),f.face=d,f.faceIndex=r}return f}function Pe(n,e,t,s,i){const r=s*3;let o=r+0,a=r+1,c=r+2;const f=n.index;n.index&&(o=f.getX(o),a=f.getX(a),c=f.getX(c));const{position:d,normal:u,uv:l,uv1:p}=n.attributes,y=Ri(t,d,u,l,p,o,a,c,e);return y?(y.faceIndex=s,i&&i.push(y),y):null}function W(n,e,t,s){const i=n.a,r=n.b,o=n.c;let a=e,c=e+1,f=e+2;t&&(a=t.getX(a),c=t.getX(c),f=t.getX(f)),i.x=s.getX(a),i.y=s.getY(a),i.z=s.getZ(a),r.x=s.getX(c),r.y=s.getY(c),r.z=s.getZ(c),o.x=s.getX(f),o.y=s.getY(f),o.z=s.getZ(f)}function Ii(n,e,t,s,i,r){const{geometry:o,_indirectBuffer:a}=n;for(let c=s,f=s+i;cw&&(w=P),Lx&&(x=L),MC&&(C=M)}return c[l+0]!==E||c[l+1]!==h||c[l+2]!==m||c[l+3]!==w||c[l+4]!==x||c[l+5]!==C?(c[l+0]=E,c[l+1]=h,c[l+2]=m,c[l+3]=w,c[l+4]=x,c[l+5]=C,!0):!1}else{const _=l+8,g=o[l+6],E=_+p,h=g+p;let m=y,w=!1,x=!1;e?m||(w=e.has(E),x=e.has(h),m=!w&&!x):(w=!0,x=!0);const C=m||w,v=m||x;let b=!1;C&&(b=u(_,p,m));let D=!1;v&&(D=u(g,p,m));const P=b||D;if(P)for(let L=0;L<3;L++){const M=_+L,R=g+L,Z=c[M],Ft=c[M+3],Rt=c[R],It=c[R+3];c[l+L]=ZIt?Ft:It}return P}}}const ys=new st;function yt(n,e,t,s){return N(n,e,ys),t.intersectBox(ys,s)}function Yi(n,e,t,s,i,r){const{geometry:o,_indirectBuffer:a}=n;for(let c=s,f=s+i;c=0;let p,y;l?(p=tt(n),y=et(n,o)):(p=et(n,o),y=tt(n));const T=yt(p,i,s,Ts)?$e(p,e,t,s):null;if(T){const E=T.point[d];if(l?E<=i[y+f]:E>=i[y+f+3])return T}const g=yt(y,i,s,Ts)?$e(y,e,t,s):null;return T&&g?T.distance<=g.distance?T:g:T||g||null}}const le=new st,At=new ot,Ct=new ot,Vt=new ut,Es=new q,he=new q;function $i(n,e,t,s){V.setBuffer(n._roots[e]);const i=Ke(0,n,t,s);return V.clearBuffer(),i}function Ke(n,e,t,s,i=null){const{float32Array:r,uint16Array:o,uint32Array:a}=V;let c=n*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),Es.set(t.boundingBox.min,t.boundingBox.max,s),i=Es),K(c,o)){const d=e.geometry,u=d.index,l=d.attributes.position,p=t.index,y=t.attributes.position,O=G(n,a),T=J(c,o);if(Vt.copy(s).invert(),t.boundsTree)return N(n,r,he),he.matrix.copy(Vt),he.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:g=>he.intersectsBox(g),intersectsTriangle:g=>{g.a.applyMatrix4(s),g.b.applyMatrix4(s),g.c.applyMatrix4(s),g.needsUpdate=!0;for(let E=O*3,h=(T+O)*3;Eze.distanceToBox(m),intersectsBounds:(m,w,x)=>x{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:C=>Yt.distanceToBox(C),intersectsBounds:(C,v,b)=>b{for(let b=C,D=C+v;bw&&(w=M),Rx&&(x=R),ZC&&(C=Z)}}return c[l+0]!==E||c[l+1]!==h||c[l+2]!==m||c[l+3]!==w||c[l+4]!==x||c[l+5]!==C?(c[l+0]=E,c[l+1]=h,c[l+2]=m,c[l+3]=w,c[l+4]=x,c[l+5]=C,!0):!1}else{const _=l+8,g=o[l+6],E=_+p,h=g+p;let m=y,w=!1,x=!1;e?m||(w=e.has(E),x=e.has(h),m=!w&&!x):(w=!0,x=!0);const C=m||w,v=m||x;let b=!1;C&&(b=u(_,p,m));let D=!1;v&&(D=u(g,p,m));const P=b||D;if(P)for(let L=0;L<3;L++){const M=_+L,R=g+L,Z=c[M],Ft=c[M+3],Rt=c[R],It=c[R+3];c[l+L]=ZIt?Ft:It}return P}}}const ws=new S;function en(n,e,t,s,i){V.setBuffer(n._roots[e]),Ge(0,n,t,s,i),V.clearBuffer()}function Ge(n,e,t,s,i){const{float32Array:r,uint16Array:o,uint32Array:a}=V,c=n*2;if(K(c,o)){const d=G(n,a),u=J(c,o);Yi(e,t,s,d,u,i)}else{const d=tt(n);yt(d,r,s,ws)&&Ge(d,e,t,s,i);const u=et(n,a);yt(u,r,s,ws)&&Ge(u,e,t,s,i)}}const xs=new S,sn=["x","y","z"];function nn(n,e,t,s){V.setBuffer(n._roots[e]);const i=Qe(0,n,t,s);return V.clearBuffer(),i}function Qe(n,e,t,s){const{float32Array:i,uint16Array:r,uint32Array:o}=V;let a=n*2;if(K(a,r)){const f=G(n,o),d=J(a,r);return Ni(e,t,s,f,d)}else{const f=Zs(n,o),d=sn[f],l=s.direction[d]>=0;let p,y;l?(p=tt(n),y=et(n,o)):(p=et(n,o),y=tt(n));const T=yt(p,i,s,xs)?Qe(p,e,t,s):null;if(T){const E=T.point[d];if(l?E<=i[y+f]:E>=i[y+f+3])return T}const g=yt(y,i,s,xs)?Qe(y,e,t,s):null;return T&&g?T.distance<=g.distance?T:g:T||g||null}}const de=new st,vt=new ot,bt=new ot,Nt=new ut,Os=new q,fe=new q;function on(n,e,t,s){V.setBuffer(n._roots[e]);const i=je(0,n,t,s);return V.clearBuffer(),i}function je(n,e,t,s,i=null){const{float32Array:r,uint16Array:o,uint32Array:a}=V;let c=n*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),Os.set(t.boundingBox.min,t.boundingBox.max,s),i=Os),K(c,o)){const d=e.geometry,u=d.index,l=d.attributes.position,p=t.index,y=t.attributes.position,O=G(n,a),T=J(c,o);if(Nt.copy(s).invert(),t.boundsTree)return N(n,r,fe),fe.matrix.copy(Nt),fe.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:g=>fe.intersectsBox(g),intersectsTriangle:g=>{g.a.applyMatrix4(s),g.b.applyMatrix4(s),g.c.applyMatrix4(s),g.needsUpdate=!0;for(let E=O,h=T+O;EBe.distanceToBox(m),intersectsBounds:(m,w,x)=>x{if(e.boundsTree){const x=e.boundsTree;return x.shapecast({boundsTraverseOrder:C=>Zt.distanceToBox(C),intersectsBounds:(C,v,b)=>b{for(let b=C,D=C+v;bnew st),Pt=new st,Ut=new st,Fe=new st,Re=new st;let Ie=!1;function dn(n,e,t,s){if(Ie)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");Ie=!0;const i=n._roots,r=e._roots;let o,a=0,c=0;const f=new ut().copy(t).invert();for(let d=0,u=i.length;dc.slice()),index:o.array.slice(),indirectBuffer:r?r.slice():null}:a={roots:i,index:o.array,indirectBuffer:r},a}static deserialize(e,t,s={}){s={setIndex:!0,indirect:!!e.indirectBuffer,...s};const{index:i,roots:r,indirectBuffer:o}=e,a=new ss(t,{...s,[De]:!0});if(a._roots=r,a._indirectBuffer=o||null,s.setIndex){const c=t.getIndex();if(c===null){const f=new Rs(e.index,1,!1);t.setIndex(f)}else c.array!==i&&(c.array.set(i),c.needsUpdate=!0)}return a}get indirect(){return!!this._indirectBuffer}constructor(e,t={}){if(e.isBufferGeometry){if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");if(t=Object.assign({strategy:Vs,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[De]:!1},t),t.useSharedArrayBuffer&&!un())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=e,this._roots=null,this._indirectBuffer=null,t[De]||(Pi(this,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new st)));const{_indirectBuffer:s}=this;this.resolveTriangleIndex=t.indirect?i=>s[i]:i=>i}refit(e=null){return(this.indirect?tn:Vi)(this,e)}traverse(e,t=0){const s=this._roots[t],i=new Uint32Array(s),r=new Uint16Array(s);o(0);function o(a,c=0){const f=a*2,d=r[f+15]===be;if(d){const u=i[a+6],l=r[f+14];e(c,d,new Float32Array(s,a*4,6),u,l)}else{const u=a+we/4,l=i[a+6],p=i[a+7];e(c,d,new Float32Array(s,a*4,6),p)||(o(u,c+1),o(l,c+1))}}}raycast(e,t=rs){const s=this._roots,i=this.geometry,r=[],o=t.isMaterial,a=Array.isArray(t),c=i.groups,f=o?t.side:t,d=this.indirect?en:Xi;for(let u=0,l=s.length;uu(l,p,y,O,T)?!0:s(l,p,this,a,y,O,t)}else o||(a?o=(u,l,p,y)=>s(u,l,this,a,p,y,t):o=(u,l,p)=>p);let c=!1,f=0;const d=this._roots;for(let u=0,l=d.length;u{const O=this.resolveTriangleIndex(y);W(o,O*3,a,c)}:y=>{W(o,y*3,a,c)},d=j.getPrimitive(),u=e.geometry.index,l=e.geometry.attributes.position,p=e.indirect?y=>{const O=e.resolveTriangleIndex(y);W(d,O*3,u,l)}:y=>{W(d,y*3,u,l)};if(r){const y=(O,T,_,g,E,h,m,w)=>{for(let x=_,C=_+g;xme.intersectsBox(s),intersectsTriangle:s=>me.intersectsTriangle(s)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,s={},i={},r=0,o=1/0){return(this.indirect?hn:Ji)(this,e,t,s,i,r,o)}closestPointToPoint(e,t={},s=0,i=1/0){return Bi(this,e,t,s,i)}getBoundingBox(e){return e.makeEmpty(),this._roots.forEach(s=>{N(0,new Float32Array(s),As),e.union(As)}),e}}function Cs(n,e,t){return n===null||(n.point.applyMatrix4(e.matrixWorld),n.distance=n.point.distanceTo(t.ray.origin),n.object=e,n.distancet.far)?null:n}const He=new Gs,vs=new ut,fn=Je.prototype.raycast;function pn(n,e){if(this.geometry.boundsTree){if(this.material===void 0)return;vs.copy(this.matrixWorld).invert(),He.copy(n.ray).applyMatrix4(vs);const t=this.geometry.boundsTree;if(n.firstHitOnly===!0){const s=Cs(t.raycastFirst(He,this.material),this,n);s&&e.push(s)}else{const s=t.raycast(He,this.material);for(let i=0,r=s.length;i{const t=this.handlers.slice(0);for(const s of t)s(e)});U(this,"handlers",[])}add(e){this.handlers.push(e)}remove(e){this.handlers=this.handlers.filter(t=>t!==e)}reset(){this.handlers.length=0}}class is{constructor(e){U(this,"isDisposeable",()=>"dispose"in this&&"onDisposed"in this);U(this,"isResizeable",()=>"resize"in this&&"getSize"in this);U(this,"isUpdateable",()=>"onAfterUpdate"in this&&"onBeforeUpdate"in this&&"update"in this);U(this,"isHideable",()=>"visible"in this);U(this,"isConfigurable",()=>"setup"in this&&"config"in this&&"onSetup"in this);this.components=e}}class ns extends is{}class os extends is{constructor(t){super(t);U(this,"worlds",new Map);U(this,"onWorldChanged",new Y);U(this,"currentWorld",null);this.onWorldChanged.add(({world:s,action:i})=>{i==="removed"&&this.worlds.delete(s.uuid)})}}class yn extends os{constructor(){super(...arguments);U(this,"hasCameraControls",()=>"controls"in this)}}class gn extends os{constructor(){super(...arguments);U(this,"onAfterUpdate",new Y);U(this,"onBeforeUpdate",new Y);U(this,"onDisposed",new Y);U(this,"onResize",new Y);U(this,"onClippingPlanesUpdated",new Y);U(this,"clippingPlanes",[])}updateClippingPlanes(){this.onClippingPlanesUpdated.trigger()}setPlane(t,s,i){s.isLocal=i;const r=this.clippingPlanes.indexOf(s);t&&r===-1?this.clippingPlanes.push(s):!t&&r>-1&&this.clippingPlanes.splice(r,1),this.three.clippingPlanes=this.clippingPlanes.filter(o=>!o.isLocal)}}const jt=class jt extends ns{constructor(t){super(t);U(this,"_disposedComponents",new Set);U(this,"enabled",!0);t.add(jt.uuid,this)}get(){return this._disposedComponents}destroy(t,s=!0,i=!0){t.removeFromParent();const r=t;r.dispose&&r.dispose(),this.disposeGeometryAndMaterials(t,s),i&&r.children&&r.children.length&&this.disposeChildren(r),t.children.length=0}disposeGeometry(t){const s=t;s.boundsTree&&s.disposeBoundsTree(),t.dispose()}disposeGeometryAndMaterials(t,s){const i=t;i.geometry&&this.disposeGeometry(i.geometry),s&&i.material&&jt.disposeMaterial(i),i.material=[],i.geometry=null}disposeChildren(t){for(const s of t.children)this.destroy(s)}static disposeMaterial(t){if(t.material)if(Array.isArray(t.material))for(const s of t.material)s.dispose();else t.material.dispose()}};U(jt,"uuid","76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");let Jt=jt;class Tn extends os{constructor(t){super(t);U(this,"onDisposed",new Y)}dispose(){const t=this.components.get(Jt);for(const s of this.three.children){const i=s;i.geometry&&t.destroy(i)}this.three.children=[],this.onDisposed.trigger(),this.onDisposed.reset()}}const X=class X{static create(){const e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,s=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return`${X._lut[e&255]+X._lut[e>>8&255]+X._lut[e>>16&255]+X._lut[e>>24&255]}-${X._lut[t&255]}${X._lut[t>>8&255]}-${X._lut[t>>16&15|64]}${X._lut[t>>24&255]}-${X._lut[s&63|128]}${X._lut[s>>8&255]}-${X._lut[s>>16&255]}${X._lut[s>>24&255]}${X._lut[i&255]}${X._lut[i>>8&255]}${X._lut[i>>16&255]}${X._lut[i>>24&255]}`.toLowerCase()}static validate(e){if(!X._pattern.test(e))throw new Error(`${e} is not a valid UUID v4. - If you're the tool creator, you can take one from https://www.uuidgenerator.net/. -- If you're using a platform tool, verify the uuid isn't misspelled or contact the tool creator.`)}};U(X,"_pattern",/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/),U(X,"_lut",["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"]);let Oe=X;const Ce=class Ce{constructor(){U(this,"onDisposed",new N);U(this,"list",new Map);U(this,"enabled",!1);U(this,"_clock");U(this,"update",()=>{if(!this.enabled)return;const e=this._clock.getDelta();for(const[t,s]of this.list)s.enabled&&s.isUpdateable()&&s.update(e);requestAnimationFrame(this.update)});this._clock=new Qs,Ce.setupBVH()}add(e,t){if(this.list.has(e))throw new Error("You're trying to add a component that already exists in the components intance. Use Components.get() instead.");Oe.validate(e),this.list.set(e,t)}get(e){const t=e.uuid;if(!this.list.has(t)){const s=new e(this);return this.list.has(t)||this.add(t,s),s}return this.list.get(t)}init(){this.enabled=!0,this._clock.start(),this.update()}dispose(){this.enabled=!1;for(const[e,t]of this.list)t.enabled=!1,t.isDisposeable()&&t.dispose();this._clock.stop(),this.onDisposed.trigger(),this.onDisposed.reset()}static setupBVH(){as.prototype.computeBoundsTree=mn,as.prototype.disposeBoundsTree=_n,Je.prototype.raycast=pn}};U(Ce,"release","1.4.21");let bs=Ce;class En extends is{constructor(t){super(t);U(this,"meshes",new Set);U(this,"onAfterUpdate",new N);U(this,"onBeforeUpdate",new N);U(this,"enabled",!0);U(this,"uuid",Oe.create());U(this,"onDisposed",new N);U(this,"_scene");U(this,"_camera");U(this,"_renderer",null)}get scene(){if(!this._scene)throw new Error("No scene initialized!");return this._scene}set scene(t){this._scene=t,t.worlds.set(this.uuid,this),t.currentWorld=this,t.onWorldChanged.trigger({world:this,action:"added"})}get camera(){if(!this._camera)throw new Error("No camera initialized!");return this._camera}set camera(t){this._camera=t,t.worlds.set(this.uuid,this),t.currentWorld=this,t.onWorldChanged.trigger({world:this,action:"added"})}get renderer(){return this._renderer}set renderer(t){this._renderer=t,t&&(t.worlds.set(this.uuid,this),t.currentWorld=this,t.onWorldChanged.trigger({world:this,action:"added"}))}update(t){this.enabled&&(!this._scene||!this._camera||(this.scene.currentWorld=this,this.camera.currentWorld=this,this.renderer&&(this.renderer.currentWorld=this),this.onBeforeUpdate.trigger(),this.scene.isUpdateable()&&this.scene.update(t),this.camera.isUpdateable()&&this.camera.update(t),this.renderer&&this.renderer.update(t),this.onAfterUpdate.trigger()))}dispose(t=!0){if(this.enabled=!1,this.scene.onWorldChanged.trigger({world:this,action:"removed"}),this.camera.onWorldChanged.trigger({world:this,action:"removed"}),this.renderer&&this.renderer.onWorldChanged.trigger({world:this,action:"removed"}),t){const s=this.components.get(Jt);this.scene.dispose(),this.camera.isDisposeable()&&this.camera.dispose(),this.renderer&&this.renderer.dispose();for(const i of this.meshes)s.destroy(i);this.meshes.clear()}this._scene=null,this._camera=null,this._renderer=null,this.onDisposed.trigger()}}class Un extends Tn{constructor(t){super(t);U(this,"isSetup",!1);U(this,"three");U(this,"onSetup",new N);U(this,"config",{directionalLight:{color:new Ee("white"),intensity:1.5,position:new S(5,10,3)},ambientLight:{color:new Ee("white"),intensity:1}});this.three=new js,this.three.background=new Ee(2107698)}setup(t){this.config={...this.config,...t};const s=new Js(this.config.directionalLight.color,this.config.directionalLight.intensity);s.position.copy(this.config.directionalLight.position);const i=new ti(this.config.ambientLight.color,this.config.ambientLight.intensity);this.three.add(s,i),this.isSetup=!0,this.onSetup.trigger(this)}}class Dn extends gn{constructor(t,s,i){super(t);U(this,"enabled",!0);U(this,"container");U(this,"three");U(this,"_canvas");U(this,"_parameters");U(this,"_resizeObserver",null);U(this,"onContainerUpdated",new N);U(this,"_resizing",!1);U(this,"resize",t=>{if(this._resizing)return;this._resizing=!0,this.onContainerUpdated.trigger();const s=t?t.x:this.container.clientWidth,i=t?t.y:this.container.clientHeight;this.three.setSize(s,i),this.onResize.trigger(new ht(s,i)),this._resizing=!1});U(this,"resizeEvent",()=>{this.resize()});U(this,"onContextLost",t=>{t.preventDefault(),this.enabled=!1});U(this,"onContextBack",()=>{this.three.setRenderTarget(null),this.three.dispose(),this.three=new cs({canvas:this._canvas,antialias:!0,alpha:!0,...this._parameters}),this.enabled=!0});this.container=s,this._parameters=i,this.three=new cs({antialias:!0,alpha:!0,...i}),this.three.setPixelRatio(Math.min(window.devicePixelRatio,2)),this.setupRenderer(),this.setupEvents(!0),this.resize(),this._canvas=this.three.domElement;const r=this.three.getContext(),{canvas:o}=r;o.addEventListener("webglcontextlost",this.onContextLost,!1),o.addEventListener("webglcontextrestored",this.onContextBack,!1)}update(){if(!this.enabled||!this.currentWorld)return;this.onBeforeUpdate.trigger(this);const t=this.currentWorld.scene.three,s=this.currentWorld.camera.three;this.three.render(t,s),this.onAfterUpdate.trigger(this)}dispose(){this.enabled=!1,this.setupEvents(!1),this.three.domElement.remove(),this.three.dispose(),this.onResize.reset(),this.onAfterUpdate.reset(),this.onBeforeUpdate.reset(),this.onDisposed.trigger(),this.onDisposed.reset()}getSize(){return new ht(this.three.domElement.clientWidth,this.three.domElement.clientHeight)}setupEvents(t){const s=this.three.domElement.parentElement;if(!s)throw new Error("This renderer needs to have an HTML container!");this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),window.removeEventListener("resize",this.resizeEvent),t&&(this._resizeObserver=new ResizeObserver(this.resizeEvent),this._resizeObserver.observe(s),window.addEventListener("resize",this.resizeEvent))}setupRenderer(){this.three.localClippingEnabled=!0,this.container&&this.container.appendChild(this.three.domElement),this.onContainerUpdated.trigger()}}/*! +- If you're using a platform tool, verify the uuid isn't misspelled or contact the tool creator.`)}};U(X,"_pattern",/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/),U(X,"_lut",["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"]);let Oe=X;const Ce=class Ce{constructor(){U(this,"onDisposed",new Y);U(this,"list",new Map);U(this,"enabled",!1);U(this,"_clock");U(this,"update",()=>{if(!this.enabled)return;const e=this._clock.getDelta();for(const[t,s]of this.list)s.enabled&&s.isUpdateable()&&s.update(e);requestAnimationFrame(this.update)});this._clock=new Qs,Ce.setupBVH()}add(e,t){if(this.list.has(e))throw new Error("You're trying to add a component that already exists in the components intance. Use Components.get() instead.");Oe.validate(e),this.list.set(e,t)}get(e){const t=e.uuid;if(!this.list.has(t)){const s=new e(this);return this.list.has(t)||this.add(t,s),s}return this.list.get(t)}init(){this.enabled=!0,this._clock.start(),this.update()}dispose(){this.enabled=!1;for(const[e,t]of this.list)t.enabled=!1,t.isDisposeable()&&t.dispose();this._clock.stop(),this.onDisposed.trigger(),this.onDisposed.reset()}static setupBVH(){as.prototype.computeBoundsTree=mn,as.prototype.disposeBoundsTree=_n,Je.prototype.raycast=pn}};U(Ce,"release","1.4.21");let bs=Ce;class En extends is{constructor(t){super(t);U(this,"meshes",new Set);U(this,"onAfterUpdate",new Y);U(this,"onBeforeUpdate",new Y);U(this,"isDisposing",!1);U(this,"enabled",!0);U(this,"uuid",Oe.create());U(this,"name");U(this,"onDisposed",new Y);U(this,"_scene");U(this,"_camera");U(this,"_renderer",null)}get scene(){if(!this._scene)throw new Error("No scene initialized!");return this._scene}set scene(t){this._scene=t,t.worlds.set(this.uuid,this),t.currentWorld=this,t.onWorldChanged.trigger({world:this,action:"added"})}get camera(){if(!this._camera)throw new Error("No camera initialized!");return this._camera}set camera(t){this._camera=t,t.worlds.set(this.uuid,this),t.currentWorld=this,t.onWorldChanged.trigger({world:this,action:"added"})}get renderer(){return this._renderer}set renderer(t){this._renderer=t,t&&(t.worlds.set(this.uuid,this),t.currentWorld=this,t.onWorldChanged.trigger({world:this,action:"added"}))}update(t){this.enabled&&(!this._scene||!this._camera||(this.scene.currentWorld=this,this.camera.currentWorld=this,this.renderer&&(this.renderer.currentWorld=this),this.onBeforeUpdate.trigger(),this.scene.isUpdateable()&&this.scene.update(t),this.camera.isUpdateable()&&this.camera.update(t),this.renderer&&this.renderer.update(t),this.onAfterUpdate.trigger()))}dispose(t=!0){if(this.enabled=!1,this.isDisposing=!0,this.scene.onWorldChanged.trigger({world:this,action:"removed"}),this.camera.onWorldChanged.trigger({world:this,action:"removed"}),this.renderer&&this.renderer.onWorldChanged.trigger({world:this,action:"removed"}),t){const s=this.components.get(Jt);this.scene.dispose(),this.camera.isDisposeable()&&this.camera.dispose(),this.renderer&&this.renderer.dispose();for(const i of this.meshes)s.destroy(i);this.meshes.clear()}this._scene=null,this._camera=null,this._renderer=null,this.onDisposed.trigger()}}class Un extends Tn{constructor(t){super(t);U(this,"isSetup",!1);U(this,"three");U(this,"onSetup",new Y);U(this,"config",{directionalLight:{color:new Ee("white"),intensity:1.5,position:new S(5,10,3)},ambientLight:{color:new Ee("white"),intensity:1}});this.three=new js,this.three.background=new Ee(2107698)}setup(t){this.config={...this.config,...t};const s=new Js(this.config.directionalLight.color,this.config.directionalLight.intensity);s.position.copy(this.config.directionalLight.position);const i=new ti(this.config.ambientLight.color,this.config.ambientLight.intensity);this.three.add(s,i),this.isSetup=!0,this.onSetup.trigger(this)}}class Dn extends gn{constructor(t,s,i){super(t);U(this,"enabled",!0);U(this,"container");U(this,"three");U(this,"_canvas");U(this,"_parameters");U(this,"_resizeObserver",null);U(this,"onContainerUpdated",new Y);U(this,"_resizing",!1);U(this,"resize",t=>{if(this._resizing)return;this._resizing=!0,this.onContainerUpdated.trigger();const s=t?t.x:this.container.clientWidth,i=t?t.y:this.container.clientHeight;this.three.setSize(s,i),this.onResize.trigger(new ht(s,i)),this._resizing=!1});U(this,"resizeEvent",()=>{this.resize()});U(this,"onContextLost",t=>{t.preventDefault(),this.enabled=!1});U(this,"onContextBack",()=>{this.three.setRenderTarget(null),this.three.dispose(),this.three=new cs({canvas:this._canvas,antialias:!0,alpha:!0,...this._parameters}),this.enabled=!0});this.container=s,this._parameters=i,this.three=new cs({antialias:!0,alpha:!0,...i}),this.three.setPixelRatio(Math.min(window.devicePixelRatio,2)),this.setupRenderer(),this.setupEvents(!0),this.resize(),this._canvas=this.three.domElement;const r=this.three.getContext(),{canvas:o}=r;o.addEventListener("webglcontextlost",this.onContextLost,!1),o.addEventListener("webglcontextrestored",this.onContextBack,!1)}update(){if(!this.enabled||!this.currentWorld)return;this.onBeforeUpdate.trigger(this);const t=this.currentWorld.scene.three,s=this.currentWorld.camera.three;this.three.render(t,s),this.onAfterUpdate.trigger(this)}dispose(){this.enabled=!1,this.setupEvents(!1),this.three.domElement.remove(),this.three.dispose(),this.onResize.reset(),this.onAfterUpdate.reset(),this.onBeforeUpdate.reset(),this.onDisposed.trigger(),this.onDisposed.reset()}getSize(){return new ht(this.three.domElement.clientWidth,this.three.domElement.clientHeight)}setupEvents(t){const s=this.three.domElement.parentElement;if(!s)throw new Error("This renderer needs to have an HTML container!");this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),window.removeEventListener("resize",this.resizeEvent),t&&(this._resizeObserver=new ResizeObserver(this.resizeEvent),this._resizeObserver.observe(s),window.addEventListener("resize",this.resizeEvent))}setupRenderer(){this.three.localClippingEnabled=!0,this.container&&this.container.appendChild(this.three.domElement),this.onContainerUpdated.trigger()}}/*! * camera-controls * https://github.com/yomotsu/camera-controls * (c) 2017 @yomotsu * Released under the MIT License. - */const B={LEFT:1,RIGHT:2,MIDDLE:4},A=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,OFFSET:4,DOLLY:8,ZOOM:16,TOUCH_ROTATE:32,TOUCH_TRUCK:64,TOUCH_OFFSET:128,TOUCH_DOLLY:256,TOUCH_ZOOM:512,TOUCH_DOLLY_TRUCK:1024,TOUCH_DOLLY_OFFSET:2048,TOUCH_DOLLY_ROTATE:4096,TOUCH_ZOOM_TRUCK:8192,TOUCH_ZOOM_OFFSET:16384,TOUCH_ZOOM_ROTATE:32768}),Dt={NONE:0,IN:1,OUT:-1};function gt(n){return n.isPerspectiveCamera}function pt(n){return n.isOrthographicCamera}const Lt=Math.PI*2,Ps=Math.PI/2,Xs=1e-5,Xt=Math.PI/180;function nt(n,e,t){return Math.max(e,Math.min(t,n))}function k(n,e=Xs){return Math.abs(n)0==p>d&&(p=d,t.value=(p-d)/r),p}function Ds(n,e,t,s,i=1/0,r,o){s=Math.max(1e-4,s);const a=2/s,c=a*r,f=1/(1+c+.48*c*c+.235*c*c*c);let d=e.x,u=e.y,l=e.z,p=n.x-d,y=n.y-u,O=n.z-l;const T=d,_=u,g=l,E=i*s,h=E*E,m=p*p+y*y+O*O;if(m>h){const R=Math.sqrt(m);p=p/R*E,y=y/R*E,O=O/R*E}d=n.x-p,u=n.y-y,l=n.z-O;const w=(t.x+a*p)*r,x=(t.y+a*y)*r,C=(t.z+a*O)*r;t.x=(t.x-a*w)*f,t.y=(t.y-a*x)*f,t.z=(t.z-a*C)*f,o.x=d+(p+w)*f,o.y=u+(y+x)*f,o.z=l+(O+C)*f;const v=T-n.x,b=_-n.y,D=g-n.z,P=o.x-T,L=o.y-_,M=o.z-g;return v*P+b*L+D*M>0&&(o.x=T,o.y=_,o.z=g,t.x=(o.x-T)/r,t.y=(o.y-_)/r,t.z=(o.z-g)/r),o}function ke(n,e){e.set(0,0),n.forEach(t=>{e.x+=t.clientX,e.y+=t.clientY}),e.x/=n.length,e.y/=n.length}function Ve(n,e){return pt(n)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}class wn{constructor(){this._listeners={}}addEventListener(e,t){const s=this._listeners;s[e]===void 0&&(s[e]=[]),s[e].indexOf(t)===-1&&s[e].push(t)}hasEventListener(e,t){const s=this._listeners;return s[e]!==void 0&&s[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners[e];if(i!==void 0){const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){const s=this._listeners[e.type];if(s!==void 0){e.target=this;const i=s.slice(0);for(let r=0,o=i.length;r{},this._enabled=!0,this._state=A.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=Dt.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new z.Vector3,this._focalOffsetVelocity=new z.Vector3,this._zoomVelocity={value:0},this._truckInternal=(h,m,w)=>{let x,C;if(gt(this._camera)){const v=F.copy(this._camera.position).sub(this._target),b=this._camera.getEffectiveFOV()*Xt,D=v.length()*Math.tan(b*.5);x=this.truckSpeed*h*D/this._elementRect.height,C=this.truckSpeed*m*D/this._elementRect.height}else if(pt(this._camera)){const v=this._camera;x=h*(v.right-v.left)/v.zoom/this._elementRect.width,C=m*(v.top-v.bottom)/v.zoom/this._elementRect.height}else return;this.verticalDragToForward?(w?this.setFocalOffset(this._focalOffsetEnd.x+x,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(x,0,!0),this.forward(-C,!0)):w?this.setFocalOffset(this._focalOffsetEnd.x+x,this._focalOffsetEnd.y+C,this._focalOffsetEnd.z,!0):this.truck(x,C,!0)},this._rotateInternal=(h,m)=>{const w=Lt*this.azimuthRotateSpeed*h/this._elementRect.height,x=Lt*this.polarRotateSpeed*m/this._elementRect.height;this.rotate(w,x,!0)},this._dollyInternal=(h,m,w)=>{const x=Math.pow(.95,-h*this.dollySpeed),C=this._sphericalEnd.radius,v=this._sphericalEnd.radius*x,b=nt(v,this.minDistance,this.maxDistance),D=b-v;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(v,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(D,!0),this._dollyToNoClamp(b,!0)):this._dollyToNoClamp(b,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?v:b)-C,this._dollyControlCoord.set(m,w)),this._lastDollyDirection=Math.sign(-h)},this._zoomInternal=(h,m,w)=>{const x=Math.pow(.95,h*this.dollySpeed),C=this._zoom,v=this._zoom*x;this.zoomTo(v,!0),this.dollyToCursor&&(this._changedZoom+=v-C,this._dollyControlCoord.set(m,w))},typeof z>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new z.Quaternion().setFromUnitVectors(this._camera.up,ge),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=A.NONE,this._target=new z.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new z.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new z.Spherical().setFromVector3(F.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new z.Vector3,new z.Vector3,new z.Vector3,new z.Vector3],this._updateNearPlaneCorners(),this._boundary=new z.Box3(new z.Vector3(-1/0,-1/0,-1/0),new z.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new z.Vector2,this.mouseButtons={left:A.ROTATE,middle:A.DOLLY,right:A.TRUCK,wheel:gt(this._camera)?A.DOLLY:pt(this._camera)?A.ZOOM:A.NONE},this.touches={one:A.TOUCH_ROTATE,two:gt(this._camera)?A.TOUCH_DOLLY_TRUCK:pt(this._camera)?A.TOUCH_ZOOM_TRUCK:A.NONE,three:A.TOUCH_TRUCK};const s=new z.Vector2,i=new z.Vector2,r=new z.Vector2,o=h=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const x=this._domElement.getBoundingClientRect(),C=h.clientX/x.width,v=h.clientY/x.height;if(Cthis._interactiveArea.right||vthis._interactiveArea.bottom)return}const m=h.pointerType!=="mouse"?null:(h.buttons&B.LEFT)===B.LEFT?B.LEFT:(h.buttons&B.MIDDLE)===B.MIDDLE?B.MIDDLE:(h.buttons&B.RIGHT)===B.RIGHT?B.RIGHT:null;if(m!==null){const x=this._findPointerByMouseButton(m);x&&this._disposePointer(x)}if((h.buttons&B.LEFT)===B.LEFT&&this._lockedPointer)return;const w={pointerId:h.pointerId,clientX:h.clientX,clientY:h.clientY,deltaX:0,deltaY:0,mouseButton:m};this._activePointers.push(w),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.addEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",d),this._isDragging=!0,O(h)},a=h=>{if(!this._enabled||!this._domElement||this._lockedPointer)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const x=this._domElement.getBoundingClientRect(),C=h.clientX/x.width,v=h.clientY/x.height;if(Cthis._interactiveArea.right||vthis._interactiveArea.bottom)return}const m=(h.buttons&B.LEFT)===B.LEFT?B.LEFT:(h.buttons&B.MIDDLE)===B.MIDDLE?B.MIDDLE:(h.buttons&B.RIGHT)===B.RIGHT?B.RIGHT:null;if(m!==null){const x=this._findPointerByMouseButton(m);x&&this._disposePointer(x)}const w={pointerId:1,clientX:h.clientX,clientY:h.clientY,deltaX:0,deltaY:0,mouseButton:(h.buttons&B.LEFT)===B.LEFT?B.LEFT:(h.buttons&B.MIDDLE)===B.LEFT?B.MIDDLE:(h.buttons&B.RIGHT)===B.LEFT?B.RIGHT:null};this._activePointers.push(w),this._domElement.ownerDocument.removeEventListener("mousemove",f),this._domElement.ownerDocument.removeEventListener("mouseup",u),this._domElement.ownerDocument.addEventListener("mousemove",f),this._domElement.ownerDocument.addEventListener("mouseup",u),this._isDragging=!0,O(h)},c=h=>{h.cancelable&&h.preventDefault();const m=h.pointerId,w=this._lockedPointer||this._findPointerById(m);if(w){if(w.clientX=h.clientX,w.clientY=h.clientY,w.deltaX=h.movementX,w.deltaY=h.movementY,this._state=0,h.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(h.buttons&B.LEFT)===B.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(h.buttons&B.MIDDLE)===B.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(h.buttons&B.RIGHT)===B.RIGHT&&(this._state=this._state|this.mouseButtons.right);T()}},f=h=>{const m=this._lockedPointer||this._findPointerById(1);m&&(m.clientX=h.clientX,m.clientY=h.clientY,m.deltaX=h.movementX,m.deltaY=h.movementY,this._state=0,(this._lockedPointer||(h.buttons&B.LEFT)===B.LEFT)&&(this._state=this._state|this.mouseButtons.left),(h.buttons&B.MIDDLE)===B.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(h.buttons&B.RIGHT)===B.RIGHT&&(this._state=this._state|this.mouseButtons.right),T())},d=h=>{const m=this._findPointerById(h.pointerId);if(!(m&&m===this._lockedPointer)){if(m&&this._disposePointer(m),h.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=A.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=A.NONE;_()}},u=()=>{const h=this._findPointerById(1);h&&h===this._lockedPointer||(h&&this._disposePointer(h),this._state=A.NONE,_())};let l=-1;const p=h=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===A.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const v=this._domElement.getBoundingClientRect(),b=h.clientX/v.width,D=h.clientY/v.height;if(bthis._interactiveArea.right||Dthis._interactiveArea.bottom)return}if(h.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===A.ROTATE||this.mouseButtons.wheel===A.TRUCK){const v=performance.now();l-v<1e3&&this._getClientRect(this._elementRect),l=v}const m=On?-1:-3,w=h.deltaMode===1?h.deltaY/m:h.deltaY/(m*10),x=this.dollyToCursor?(h.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,C=this.dollyToCursor?(h.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case A.ROTATE:{this._rotateInternal(h.deltaX,h.deltaY),this._isUserControllingRotate=!0;break}case A.TRUCK:{this._truckInternal(h.deltaX,h.deltaY,!1),this._isUserControllingTruck=!0;break}case A.OFFSET:{this._truckInternal(h.deltaX,h.deltaY,!0),this._isUserControllingOffset=!0;break}case A.DOLLY:{this._dollyInternal(-w,x,C),this._isUserControllingDolly=!0;break}case A.ZOOM:{this._zoomInternal(-w,x,C),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},y=h=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===te.ACTION.NONE){const m=h instanceof PointerEvent?h.pointerId:(h instanceof MouseEvent,0),w=this._findPointerById(m);w&&this._disposePointer(w),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mousemove",f),this._domElement.ownerDocument.removeEventListener("mouseup",u);return}h.preventDefault()}},O=h=>{if(!this._enabled)return;if(ke(this._activePointers,$),this._getClientRect(this._elementRect),s.copy($),i.copy($),this._activePointers.length>=2){const w=$.x-this._activePointers[1].clientX,x=$.y-this._activePointers[1].clientY,C=Math.sqrt(w*w+x*x);r.set(0,C);const v=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,b=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;i.set(v,b)}if(this._state=0,!h)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in h&&h.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(h.buttons&B.LEFT)===B.LEFT&&(this._state=this._state|this.mouseButtons.left),(h.buttons&B.MIDDLE)===B.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(h.buttons&B.RIGHT)===B.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&A.ROTATE)===A.ROTATE||(this._state&A.TOUCH_ROTATE)===A.TOUCH_ROTATE||(this._state&A.TOUCH_DOLLY_ROTATE)===A.TOUCH_DOLLY_ROTATE||(this._state&A.TOUCH_ZOOM_ROTATE)===A.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&A.TRUCK)===A.TRUCK||(this._state&A.TOUCH_TRUCK)===A.TOUCH_TRUCK||(this._state&A.TOUCH_DOLLY_TRUCK)===A.TOUCH_DOLLY_TRUCK||(this._state&A.TOUCH_ZOOM_TRUCK)===A.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&A.DOLLY)===A.DOLLY||(this._state&A.TOUCH_DOLLY)===A.TOUCH_DOLLY||(this._state&A.TOUCH_DOLLY_TRUCK)===A.TOUCH_DOLLY_TRUCK||(this._state&A.TOUCH_DOLLY_OFFSET)===A.TOUCH_DOLLY_OFFSET||(this._state&A.TOUCH_DOLLY_ROTATE)===A.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&A.ZOOM)===A.ZOOM||(this._state&A.TOUCH_ZOOM)===A.TOUCH_ZOOM||(this._state&A.TOUCH_ZOOM_TRUCK)===A.TOUCH_ZOOM_TRUCK||(this._state&A.TOUCH_ZOOM_OFFSET)===A.TOUCH_ZOOM_OFFSET||(this._state&A.TOUCH_ZOOM_ROTATE)===A.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&A.OFFSET)===A.OFFSET||(this._state&A.TOUCH_OFFSET)===A.TOUCH_OFFSET||(this._state&A.TOUCH_DOLLY_OFFSET)===A.TOUCH_DOLLY_OFFSET||(this._state&A.TOUCH_ZOOM_OFFSET)===A.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},T=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,ke(this._activePointers,$);const m=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,w=m?-m.deltaX:i.x-$.x,x=m?-m.deltaY:i.y-$.y;if(i.copy($),((this._state&A.ROTATE)===A.ROTATE||(this._state&A.TOUCH_ROTATE)===A.TOUCH_ROTATE||(this._state&A.TOUCH_DOLLY_ROTATE)===A.TOUCH_DOLLY_ROTATE||(this._state&A.TOUCH_ZOOM_ROTATE)===A.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(w,x),this._isUserControllingRotate=!0),(this._state&A.DOLLY)===A.DOLLY||(this._state&A.ZOOM)===A.ZOOM){const C=this.dollyToCursor?(s.x-this._elementRect.x)/this._elementRect.width*2-1:0,v=this.dollyToCursor?(s.y-this._elementRect.y)/this._elementRect.height*-2+1:0,b=this.dollyDragInverted?-1:1;(this._state&A.DOLLY)===A.DOLLY?(this._dollyInternal(b*x*ye,C,v),this._isUserControllingDolly=!0):(this._zoomInternal(b*x*ye,C,v),this._isUserControllingZoom=!0)}if((this._state&A.TOUCH_DOLLY)===A.TOUCH_DOLLY||(this._state&A.TOUCH_ZOOM)===A.TOUCH_ZOOM||(this._state&A.TOUCH_DOLLY_TRUCK)===A.TOUCH_DOLLY_TRUCK||(this._state&A.TOUCH_ZOOM_TRUCK)===A.TOUCH_ZOOM_TRUCK||(this._state&A.TOUCH_DOLLY_OFFSET)===A.TOUCH_DOLLY_OFFSET||(this._state&A.TOUCH_ZOOM_OFFSET)===A.TOUCH_ZOOM_OFFSET||(this._state&A.TOUCH_DOLLY_ROTATE)===A.TOUCH_DOLLY_ROTATE||(this._state&A.TOUCH_ZOOM_ROTATE)===A.TOUCH_ZOOM_ROTATE){const C=$.x-this._activePointers[1].clientX,v=$.y-this._activePointers[1].clientY,b=Math.sqrt(C*C+v*v),D=r.y-b;r.set(0,b);const P=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,L=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&A.TOUCH_DOLLY)===A.TOUCH_DOLLY||(this._state&A.TOUCH_DOLLY_ROTATE)===A.TOUCH_DOLLY_ROTATE||(this._state&A.TOUCH_DOLLY_TRUCK)===A.TOUCH_DOLLY_TRUCK||(this._state&A.TOUCH_DOLLY_OFFSET)===A.TOUCH_DOLLY_OFFSET?(this._dollyInternal(D*ye,P,L),this._isUserControllingDolly=!0):(this._zoomInternal(D*ye,P,L),this._isUserControllingZoom=!0)}((this._state&A.TRUCK)===A.TRUCK||(this._state&A.TOUCH_TRUCK)===A.TOUCH_TRUCK||(this._state&A.TOUCH_DOLLY_TRUCK)===A.TOUCH_DOLLY_TRUCK||(this._state&A.TOUCH_ZOOM_TRUCK)===A.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(w,x,!1),this._isUserControllingTruck=!0),((this._state&A.OFFSET)===A.OFFSET||(this._state&A.TOUCH_OFFSET)===A.TOUCH_OFFSET||(this._state&A.TOUCH_DOLLY_OFFSET)===A.TOUCH_DOLLY_OFFSET||(this._state&A.TOUCH_ZOOM_OFFSET)===A.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(w,x,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},_=()=>{ke(this._activePointers,$),i.copy($),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",f),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mouseup",u),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",g),this._domElement.ownerDocument.addEventListener("pointerlockerror",E),this._domElement.ownerDocument.addEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",d),O())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",g),this._domElement.ownerDocument.removeEventListener("pointerlockerror",E))};const g=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},E=()=>{this.unlockPointer()};this._addAllEventListeners=h=>{this._domElement=h,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",o),An&&this._domElement.addEventListener("mousedown",a),this._domElement.addEventListener("pointercancel",d),this._domElement.addEventListener("wheel",p,{passive:!1}),this._domElement.addEventListener("contextmenu",y)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",o),this._domElement.removeEventListener("mousedown",a),this._domElement.removeEventListener("pointercancel",d),this._domElement.removeEventListener("wheel",p,{passive:!1}),this._domElement.removeEventListener("contextmenu",y),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",f),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mouseup",u),this._domElement.ownerDocument.removeEventListener("pointerlockchange",g),this._domElement.ownerDocument.removeEventListener("pointerlockerror",E))},this.cancel=()=>{this._state!==A.NONE&&(this._state=A.NONE,this._activePointers.length=0,_())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=nt(e.width,0,1),this._interactiveArea.height=nt(e.height,0,1),this._interactiveArea.x=nt(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=nt(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,s=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,s)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,s=!1){this._isUserControllingRotate=!1;const i=nt(e,this.minAzimuthAngle,this.maxAzimuthAngle),r=nt(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=i,this._sphericalEnd.phi=r,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,s||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const o=!s||H(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&H(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(o)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=Dt.NONE,this._changedDolly=0,this._dollyToNoClamp(nt(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){const s=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const o=this._collisionTest(),a=H(o,this._spherical.radius);if(!(s>e)&&a)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,o)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const r=!t||H(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(r)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection($t).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const s=!t||H(this._target.x,this._targetEnd.x,this.restThreshold)&&H(this._target.y,this._targetEnd.y,this.restThreshold)&&H(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=nt(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const s=!t||H(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(s)}pan(e,t,s=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,s)}truck(e,t,s=!1){this._camera.updateMatrix(),rt.setFromMatrixColumn(this._camera.matrix,0),at.setFromMatrixColumn(this._camera.matrix,1),rt.multiplyScalar(e),at.multiplyScalar(-t);const i=F.copy(rt).add(at),r=I.copy(this._targetEnd).add(i);return this.moveTo(r.x,r.y,r.z,s)}forward(e,t=!1){F.setFromMatrixColumn(this._camera.matrix,0),F.crossVectors(this._camera.up,F),F.multiplyScalar(e);const s=I.copy(this._targetEnd).add(F);return this.moveTo(s.x,s.y,s.z,t)}elevate(e,t=!1){return F.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+F.x,this._targetEnd.y+F.y,this._targetEnd.z+F.z,t)}moveTo(e,t,s,i=!1){this._isUserControllingTruck=!1;const r=F.set(e,t,s).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,r,this.boundaryFriction),this._needsUpdate=!0,i||this._target.copy(this._targetEnd);const o=!i||H(this._target.x,this._targetEnd.x,this.restThreshold)&&H(this._target.y,this._targetEnd.y,this.restThreshold)&&H(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(o)}lookInDirectionOf(e,t,s,i=!1){const a=F.set(e,t,s).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(a.x,a.y,a.z,i)}fitToBox(e,t,{cover:s=!1,paddingLeft:i=0,paddingRight:r=0,paddingBottom:o=0,paddingTop:a=0}={}){const c=[],f=e.isBox3?Mt.copy(e):Mt.setFromObject(e);f.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const d=Us(this._sphericalEnd.theta,Ps),u=Us(this._sphericalEnd.phi,Ps);c.push(this.rotateTo(d,u,t));const l=F.setFromSpherical(this._sphericalEnd).normalize(),p=Bs.setFromUnitVectors(l,Ye),y=H(Math.abs(l.y),1);y&&p.multiply(Ze.setFromAxisAngle(ge,d)),p.multiply(this._yAxisUpSpaceInverse);const O=zs.makeEmpty();I.copy(f.min).applyQuaternion(p),O.expandByPoint(I),I.copy(f.min).setX(f.max.x).applyQuaternion(p),O.expandByPoint(I),I.copy(f.min).setY(f.max.y).applyQuaternion(p),O.expandByPoint(I),I.copy(f.max).setZ(f.min.z).applyQuaternion(p),O.expandByPoint(I),I.copy(f.min).setZ(f.max.z).applyQuaternion(p),O.expandByPoint(I),I.copy(f.max).setY(f.min.y).applyQuaternion(p),O.expandByPoint(I),I.copy(f.max).setX(f.min.x).applyQuaternion(p),O.expandByPoint(I),I.copy(f.max).applyQuaternion(p),O.expandByPoint(I),O.min.x-=i,O.min.y-=o,O.max.x+=r,O.max.y+=a,p.setFromUnitVectors(Ye,l),y&&p.premultiply(Ze.invert()),p.premultiply(this._yAxisUpSpace);const T=O.getSize(F),_=O.getCenter(I).applyQuaternion(p);if(gt(this._camera)){const g=this.getDistanceToFitBox(T.x,T.y,T.z,s);c.push(this.moveTo(_.x,_.y,_.z,t)),c.push(this.dollyTo(g,t)),c.push(this.setFocalOffset(0,0,0,t))}else if(pt(this._camera)){const g=this._camera,E=g.right-g.left,h=g.top-g.bottom,m=s?Math.max(E/T.x,h/T.y):Math.min(E/T.x,h/T.y);c.push(this.moveTo(_.x,_.y,_.z,t)),c.push(this.zoomTo(m,t)),c.push(this.setFocalOffset(0,0,0,t))}return Promise.all(c)}fitToSphere(e,t){const s=[],r=e instanceof z.Sphere?Ne.copy(e):te.createBoundingSphere(e,Ne);if(s.push(this.moveTo(r.center.x,r.center.y,r.center.z,t)),gt(this._camera)){const o=this.getDistanceToFitSphere(r.radius);s.push(this.dollyTo(o,t))}else if(pt(this._camera)){const o=this._camera.right-this._camera.left,a=this._camera.top-this._camera.bottom,c=2*r.radius,f=Math.min(o/c,a/c);s.push(this.zoomTo(f,t))}return s.push(this.setFocalOffset(0,0,0,t)),Promise.all(s)}setLookAt(e,t,s,i,r,o,a=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Dt.NONE,this._changedDolly=0;const c=I.set(i,r,o),f=F.set(e,t,s);this._targetEnd.copy(c),this._sphericalEnd.setFromVector3(f.sub(c).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,a||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const d=!a||H(this._target.x,this._targetEnd.x,this.restThreshold)&&H(this._target.y,this._targetEnd.y,this.restThreshold)&&H(this._target.z,this._targetEnd.z,this.restThreshold)&&H(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&H(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&H(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(d)}lerpLookAt(e,t,s,i,r,o,a,c,f,d,u,l,p,y=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Dt.NONE,this._changedDolly=0;const O=F.set(i,r,o),T=I.set(e,t,s);Q.setFromVector3(T.sub(O).applyQuaternion(this._yAxisUpSpace));const _=St.set(d,u,l),g=I.set(a,c,f);Kt.setFromVector3(g.sub(_).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(O.lerp(_,p));const E=Kt.theta-Q.theta,h=Kt.phi-Q.phi,m=Kt.radius-Q.radius;this._sphericalEnd.set(Q.radius+m*p,Q.phi+h*p,Q.theta+E*p),this.normalizeRotations(),this._needsUpdate=!0,y||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const w=!y||H(this._target.x,this._targetEnd.x,this.restThreshold)&&H(this._target.y,this._targetEnd.y,this.restThreshold)&&H(this._target.z,this._targetEnd.z,this.restThreshold)&&H(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&H(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&H(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(w)}setPosition(e,t,s,i=!1){return this.setLookAt(e,t,s,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,i)}setTarget(e,t,s,i=!1){const r=this.getPosition(F),o=this.setLookAt(r.x,r.y,r.z,e,t,s,i);return this._sphericalEnd.phi=nt(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),o}setFocalOffset(e,t,s,i=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,s),this._needsUpdate=!0,i||this._focalOffset.copy(this._focalOffsetEnd);const r=!i||H(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&H(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&H(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(r)}setOrbitPoint(e,t,s){this._camera.updateMatrixWorld(),rt.setFromMatrixColumn(this._camera.matrixWorldInverse,0),at.setFromMatrixColumn(this._camera.matrixWorldInverse,1),Tt.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const i=F.set(e,t,s),r=i.distanceTo(this._camera.position),o=i.sub(this._camera.position);rt.multiplyScalar(o.x),at.multiplyScalar(o.y),Tt.multiplyScalar(o.z),F.copy(rt).add(at).add(Tt),F.z=F.z+r,this.dollyTo(r,!1),this.setFocalOffset(-F.x,F.y,-F.z,!1),this.moveTo(e,t,s,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,s,i){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new z.Vector4,typeof e=="number"?this._viewport.set(e,t,s,i):this._viewport.copy(e)}getDistanceToFitBox(e,t,s,i=!1){if(Ve(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const r=e/t,o=this._camera.getEffectiveFOV()*Xt,a=this._camera.aspect;return((i?r>a:rt.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,s){const i=t.lengthSq();if(i===0)return e;const r=I.copy(t).add(e),a=this._boundary.clampPoint(r,St).sub(r),c=a.lengthSq();if(c===0)return e.add(t);if(c===i)return e;if(s===0)return e.add(t).add(a);{const f=1+s*c/t.dot(a);return e.add(I.copy(t).multiplyScalar(f)).add(a.multiplyScalar(1-s))}}_updateNearPlaneCorners(){if(gt(this._camera)){const e=this._camera,t=e.near,s=e.getEffectiveFOV()*Xt,i=Math.tan(s*.5)*t,r=i*e.aspect;this._nearPlaneCorners[0].set(-r,-i,0),this._nearPlaneCorners[1].set(r,-i,0),this._nearPlaneCorners[2].set(r,i,0),this._nearPlaneCorners[3].set(-r,i,0)}else if(pt(this._camera)){const e=this._camera,t=1/e.zoom,s=e.left*t,i=e.right*t,r=e.top*t,o=e.bottom*t;this._nearPlaneCorners[0].set(s,r,0),this._nearPlaneCorners[1].set(i,r,0),this._nearPlaneCorners[2].set(i,o,0),this._nearPlaneCorners[3].set(s,o,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||Ve(this._camera,"_collisionTest"))return e;const s=this._getTargetDirection($t);Xe.lookAt(Ls,s,this._camera.up);for(let i=0;i<4;i++){const r=I.copy(this._nearPlaneCorners[i]);r.applyMatrix4(Xe);const o=St.addVectors(this._target,r);Te.set(o,s),Te.far=this._spherical.radius+1;const a=Te.intersectObjects(this.colliderMeshes);a.length!==0&&a[0].distance{const s=()=>{this.removeEventListener("rest",s),t()};this.addEventListener("rest",s)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,t=new z.Sphere){const s=t,i=s.center;Mt.makeEmpty(),e.traverseVisible(o=>{o.isMesh&&Mt.expandByObject(o)}),Mt.getCenter(i);let r=0;return e.traverseVisible(o=>{if(!o.isMesh)return;const a=o,c=a.geometry.clone();c.applyMatrix4(a.matrixWorld);const d=c.attributes.position;for(let u=0,l=d.count;u{var t;if(!(!this.currentWorld||!this.currentWorld.renderer)){if(this.three instanceof ei){this.onAspectUpdated.trigger();return}if((t=this.currentWorld.renderer)!=null&&t.isResizeable()){const s=this.currentWorld.renderer.getSize();this.three.aspect=s.width/s.height,this.three.updateProjectionMatrix(),this.onAspectUpdated.trigger()}}});this.three=this.setupCamera(),this.setupEvents(!0),this.onWorldChanged.add(({action:s,world:i})=>{if(s==="added"){const r=this.newCameraControls();this._allControls.set(i.uuid,r)}if(s==="removed"){const r=this._allControls.get(i.uuid);r&&(r.dispose(),this._allControls.delete(i.uuid))}})}get controls(){if(!this.currentWorld)throw new Error("This camera needs a world to work!");const t=this._allControls.get(this.currentWorld.uuid);if(!t)throw new Error("Controls not found!");return t}get enabled(){return this.currentWorld===null?!1:this.controls.enabled}set enabled(t){this.controls.enabled=t}dispose(){this.setupEvents(!1),this.enabled=!1,this.onAspectUpdated.reset(),this.onBeforeUpdate.reset(),this.onAfterUpdate.reset(),this.three.removeFromParent(),this.onDisposed.trigger(),this.onDisposed.reset();for(const[t,s]of this._allControls)s.dispose()}update(t){this.enabled&&(this.onBeforeUpdate.trigger(this),this.controls.update(t),this.onAfterUpdate.trigger(this))}setupCamera(){const t=window.innerWidth/window.innerHeight,s=new si(60,t,1,1e3);return s.position.set(50,50,50),s.lookAt(new S(0,0,0)),s}newCameraControls(){if(!this.currentWorld)throw new Error("This camera needs a world to work!");if(!this.currentWorld.renderer)throw new Error("This camera needs a renderer to work!");te.install({THREE:Ae.getSubsetOfThree()});const{domElement:t}=this.currentWorld.renderer.three,s=new te(this.three,t);return s.smoothTime=.2,s.dollyToCursor=!0,s.infinityDolly=!0,s}setupEvents(t){t?window.addEventListener("resize",this.updateAspect):window.removeEventListener("resize",this.updateAspect)}static getSubsetOfThree(){return{MOUSE:ii,Vector2:ht,Vector3:S,Vector4:ni,Quaternion:oi,Matrix4:ut,Spherical:ri,Box3:st,Sphere:Hs,Raycaster:ai,MathUtils:ci}}}const ve=class ve extends ns{constructor(t){super(t);U(this,"onAfterUpdate",new N);U(this,"onBeforeUpdate",new N);U(this,"onDisposed",new N);U(this,"list",new Map);U(this,"enabled",!0);t.add(ve.uuid,this)}create(){const t=new En(this.components),s=t.uuid;if(this.list.has(s))throw new Error("There is already a world with this name!");return this.list.set(s,t),t}delete(t){this.list.delete(t.uuid),t.dispose()}dispose(){this.enabled=!1;for(const[t,s]of this.list)s.dispose();this.list.clear(),this.onDisposed.trigger()}update(t){if(this.enabled)for(const[s,i]of this.list)i.update(t)}};U(ve,"uuid","fdb61dc4-2ec1-4966-b83d-54ea795fad4a");let Fs=ve;class Cn{constructor(e,t,s){U(this,"onDisposed",new N);U(this,"world");U(this,"components");U(this,"three");U(this,"_fade",3);U(this,"updateZoom",()=>{this.world.camera instanceof Ae&&(this.material.uniforms.uZoom.value=this.world.camera.three.zoom)});this.world=t;const{color:i,size1:r,size2:o,distance:a}=s;this.components=e;const c=new li(2,2,1,1),f=new hi({side:ks,uniforms:{uSize1:{value:r},uSize2:{value:o},uColor:{value:i},uDistance:{value:a},uFade:{value:this._fade},uZoom:{value:1}},transparent:!0,vertexShader:` + */const B={LEFT:1,RIGHT:2,MIDDLE:4},A=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,OFFSET:4,DOLLY:8,ZOOM:16,TOUCH_ROTATE:32,TOUCH_TRUCK:64,TOUCH_OFFSET:128,TOUCH_DOLLY:256,TOUCH_ZOOM:512,TOUCH_DOLLY_TRUCK:1024,TOUCH_DOLLY_OFFSET:2048,TOUCH_DOLLY_ROTATE:4096,TOUCH_ZOOM_TRUCK:8192,TOUCH_ZOOM_OFFSET:16384,TOUCH_ZOOM_ROTATE:32768}),Dt={NONE:0,IN:1,OUT:-1};function gt(n){return n.isPerspectiveCamera}function pt(n){return n.isOrthographicCamera}const Lt=Math.PI*2,Ps=Math.PI/2,Xs=1e-5,Xt=Math.PI/180;function nt(n,e,t){return Math.max(e,Math.min(t,n))}function k(n,e=Xs){return Math.abs(n)0==p>d&&(p=d,t.value=(p-d)/r),p}function Ds(n,e,t,s,i=1/0,r,o){s=Math.max(1e-4,s);const a=2/s,c=a*r,f=1/(1+c+.48*c*c+.235*c*c*c);let d=e.x,u=e.y,l=e.z,p=n.x-d,y=n.y-u,O=n.z-l;const T=d,_=u,g=l,E=i*s,h=E*E,m=p*p+y*y+O*O;if(m>h){const R=Math.sqrt(m);p=p/R*E,y=y/R*E,O=O/R*E}d=n.x-p,u=n.y-y,l=n.z-O;const w=(t.x+a*p)*r,x=(t.y+a*y)*r,C=(t.z+a*O)*r;t.x=(t.x-a*w)*f,t.y=(t.y-a*x)*f,t.z=(t.z-a*C)*f,o.x=d+(p+w)*f,o.y=u+(y+x)*f,o.z=l+(O+C)*f;const v=T-n.x,b=_-n.y,D=g-n.z,P=o.x-T,L=o.y-_,M=o.z-g;return v*P+b*L+D*M>0&&(o.x=T,o.y=_,o.z=g,t.x=(o.x-T)/r,t.y=(o.y-_)/r,t.z=(o.z-g)/r),o}function ke(n,e){e.set(0,0),n.forEach(t=>{e.x+=t.clientX,e.y+=t.clientY}),e.x/=n.length,e.y/=n.length}function Ve(n,e){return pt(n)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}class wn{constructor(){this._listeners={}}addEventListener(e,t){const s=this._listeners;s[e]===void 0&&(s[e]=[]),s[e].indexOf(t)===-1&&s[e].push(t)}hasEventListener(e,t){const s=this._listeners;return s[e]!==void 0&&s[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners[e];if(i!==void 0){const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){const s=this._listeners[e.type];if(s!==void 0){e.target=this;const i=s.slice(0);for(let r=0,o=i.length;r{},this._enabled=!0,this._state=A.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=Dt.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new z.Vector3,this._focalOffsetVelocity=new z.Vector3,this._zoomVelocity={value:0},this._truckInternal=(h,m,w)=>{let x,C;if(gt(this._camera)){const v=F.copy(this._camera.position).sub(this._target),b=this._camera.getEffectiveFOV()*Xt,D=v.length()*Math.tan(b*.5);x=this.truckSpeed*h*D/this._elementRect.height,C=this.truckSpeed*m*D/this._elementRect.height}else if(pt(this._camera)){const v=this._camera;x=h*(v.right-v.left)/v.zoom/this._elementRect.width,C=m*(v.top-v.bottom)/v.zoom/this._elementRect.height}else return;this.verticalDragToForward?(w?this.setFocalOffset(this._focalOffsetEnd.x+x,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(x,0,!0),this.forward(-C,!0)):w?this.setFocalOffset(this._focalOffsetEnd.x+x,this._focalOffsetEnd.y+C,this._focalOffsetEnd.z,!0):this.truck(x,C,!0)},this._rotateInternal=(h,m)=>{const w=Lt*this.azimuthRotateSpeed*h/this._elementRect.height,x=Lt*this.polarRotateSpeed*m/this._elementRect.height;this.rotate(w,x,!0)},this._dollyInternal=(h,m,w)=>{const x=Math.pow(.95,-h*this.dollySpeed),C=this._sphericalEnd.radius,v=this._sphericalEnd.radius*x,b=nt(v,this.minDistance,this.maxDistance),D=b-v;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(v,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(D,!0),this._dollyToNoClamp(b,!0)):this._dollyToNoClamp(b,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?v:b)-C,this._dollyControlCoord.set(m,w)),this._lastDollyDirection=Math.sign(-h)},this._zoomInternal=(h,m,w)=>{const x=Math.pow(.95,h*this.dollySpeed),C=this._zoom,v=this._zoom*x;this.zoomTo(v,!0),this.dollyToCursor&&(this._changedZoom+=v-C,this._dollyControlCoord.set(m,w))},typeof z>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new z.Quaternion().setFromUnitVectors(this._camera.up,ge),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=A.NONE,this._target=new z.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new z.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new z.Spherical().setFromVector3(F.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new z.Vector3,new z.Vector3,new z.Vector3,new z.Vector3],this._updateNearPlaneCorners(),this._boundary=new z.Box3(new z.Vector3(-1/0,-1/0,-1/0),new z.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new z.Vector2,this.mouseButtons={left:A.ROTATE,middle:A.DOLLY,right:A.TRUCK,wheel:gt(this._camera)?A.DOLLY:pt(this._camera)?A.ZOOM:A.NONE},this.touches={one:A.TOUCH_ROTATE,two:gt(this._camera)?A.TOUCH_DOLLY_TRUCK:pt(this._camera)?A.TOUCH_ZOOM_TRUCK:A.NONE,three:A.TOUCH_TRUCK};const s=new z.Vector2,i=new z.Vector2,r=new z.Vector2,o=h=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const x=this._domElement.getBoundingClientRect(),C=h.clientX/x.width,v=h.clientY/x.height;if(Cthis._interactiveArea.right||vthis._interactiveArea.bottom)return}const m=h.pointerType!=="mouse"?null:(h.buttons&B.LEFT)===B.LEFT?B.LEFT:(h.buttons&B.MIDDLE)===B.MIDDLE?B.MIDDLE:(h.buttons&B.RIGHT)===B.RIGHT?B.RIGHT:null;if(m!==null){const x=this._findPointerByMouseButton(m);x&&this._disposePointer(x)}if((h.buttons&B.LEFT)===B.LEFT&&this._lockedPointer)return;const w={pointerId:h.pointerId,clientX:h.clientX,clientY:h.clientY,deltaX:0,deltaY:0,mouseButton:m};this._activePointers.push(w),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.addEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",d),this._isDragging=!0,O(h)},a=h=>{if(!this._enabled||!this._domElement||this._lockedPointer)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const x=this._domElement.getBoundingClientRect(),C=h.clientX/x.width,v=h.clientY/x.height;if(Cthis._interactiveArea.right||vthis._interactiveArea.bottom)return}const m=(h.buttons&B.LEFT)===B.LEFT?B.LEFT:(h.buttons&B.MIDDLE)===B.MIDDLE?B.MIDDLE:(h.buttons&B.RIGHT)===B.RIGHT?B.RIGHT:null;if(m!==null){const x=this._findPointerByMouseButton(m);x&&this._disposePointer(x)}const w={pointerId:1,clientX:h.clientX,clientY:h.clientY,deltaX:0,deltaY:0,mouseButton:(h.buttons&B.LEFT)===B.LEFT?B.LEFT:(h.buttons&B.MIDDLE)===B.LEFT?B.MIDDLE:(h.buttons&B.RIGHT)===B.LEFT?B.RIGHT:null};this._activePointers.push(w),this._domElement.ownerDocument.removeEventListener("mousemove",f),this._domElement.ownerDocument.removeEventListener("mouseup",u),this._domElement.ownerDocument.addEventListener("mousemove",f),this._domElement.ownerDocument.addEventListener("mouseup",u),this._isDragging=!0,O(h)},c=h=>{h.cancelable&&h.preventDefault();const m=h.pointerId,w=this._lockedPointer||this._findPointerById(m);if(w){if(w.clientX=h.clientX,w.clientY=h.clientY,w.deltaX=h.movementX,w.deltaY=h.movementY,this._state=0,h.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(h.buttons&B.LEFT)===B.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(h.buttons&B.MIDDLE)===B.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(h.buttons&B.RIGHT)===B.RIGHT&&(this._state=this._state|this.mouseButtons.right);T()}},f=h=>{const m=this._lockedPointer||this._findPointerById(1);m&&(m.clientX=h.clientX,m.clientY=h.clientY,m.deltaX=h.movementX,m.deltaY=h.movementY,this._state=0,(this._lockedPointer||(h.buttons&B.LEFT)===B.LEFT)&&(this._state=this._state|this.mouseButtons.left),(h.buttons&B.MIDDLE)===B.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(h.buttons&B.RIGHT)===B.RIGHT&&(this._state=this._state|this.mouseButtons.right),T())},d=h=>{const m=this._findPointerById(h.pointerId);if(!(m&&m===this._lockedPointer)){if(m&&this._disposePointer(m),h.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=A.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=A.NONE;_()}},u=()=>{const h=this._findPointerById(1);h&&h===this._lockedPointer||(h&&this._disposePointer(h),this._state=A.NONE,_())};let l=-1;const p=h=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===A.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const v=this._domElement.getBoundingClientRect(),b=h.clientX/v.width,D=h.clientY/v.height;if(bthis._interactiveArea.right||Dthis._interactiveArea.bottom)return}if(h.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===A.ROTATE||this.mouseButtons.wheel===A.TRUCK){const v=performance.now();l-v<1e3&&this._getClientRect(this._elementRect),l=v}const m=On?-1:-3,w=h.deltaMode===1?h.deltaY/m:h.deltaY/(m*10),x=this.dollyToCursor?(h.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,C=this.dollyToCursor?(h.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case A.ROTATE:{this._rotateInternal(h.deltaX,h.deltaY),this._isUserControllingRotate=!0;break}case A.TRUCK:{this._truckInternal(h.deltaX,h.deltaY,!1),this._isUserControllingTruck=!0;break}case A.OFFSET:{this._truckInternal(h.deltaX,h.deltaY,!0),this._isUserControllingOffset=!0;break}case A.DOLLY:{this._dollyInternal(-w,x,C),this._isUserControllingDolly=!0;break}case A.ZOOM:{this._zoomInternal(-w,x,C),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},y=h=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===te.ACTION.NONE){const m=h instanceof PointerEvent?h.pointerId:(h instanceof MouseEvent,0),w=this._findPointerById(m);w&&this._disposePointer(w),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mousemove",f),this._domElement.ownerDocument.removeEventListener("mouseup",u);return}h.preventDefault()}},O=h=>{if(!this._enabled)return;if(ke(this._activePointers,$),this._getClientRect(this._elementRect),s.copy($),i.copy($),this._activePointers.length>=2){const w=$.x-this._activePointers[1].clientX,x=$.y-this._activePointers[1].clientY,C=Math.sqrt(w*w+x*x);r.set(0,C);const v=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,b=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;i.set(v,b)}if(this._state=0,!h)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in h&&h.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(h.buttons&B.LEFT)===B.LEFT&&(this._state=this._state|this.mouseButtons.left),(h.buttons&B.MIDDLE)===B.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(h.buttons&B.RIGHT)===B.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&A.ROTATE)===A.ROTATE||(this._state&A.TOUCH_ROTATE)===A.TOUCH_ROTATE||(this._state&A.TOUCH_DOLLY_ROTATE)===A.TOUCH_DOLLY_ROTATE||(this._state&A.TOUCH_ZOOM_ROTATE)===A.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&A.TRUCK)===A.TRUCK||(this._state&A.TOUCH_TRUCK)===A.TOUCH_TRUCK||(this._state&A.TOUCH_DOLLY_TRUCK)===A.TOUCH_DOLLY_TRUCK||(this._state&A.TOUCH_ZOOM_TRUCK)===A.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&A.DOLLY)===A.DOLLY||(this._state&A.TOUCH_DOLLY)===A.TOUCH_DOLLY||(this._state&A.TOUCH_DOLLY_TRUCK)===A.TOUCH_DOLLY_TRUCK||(this._state&A.TOUCH_DOLLY_OFFSET)===A.TOUCH_DOLLY_OFFSET||(this._state&A.TOUCH_DOLLY_ROTATE)===A.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&A.ZOOM)===A.ZOOM||(this._state&A.TOUCH_ZOOM)===A.TOUCH_ZOOM||(this._state&A.TOUCH_ZOOM_TRUCK)===A.TOUCH_ZOOM_TRUCK||(this._state&A.TOUCH_ZOOM_OFFSET)===A.TOUCH_ZOOM_OFFSET||(this._state&A.TOUCH_ZOOM_ROTATE)===A.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&A.OFFSET)===A.OFFSET||(this._state&A.TOUCH_OFFSET)===A.TOUCH_OFFSET||(this._state&A.TOUCH_DOLLY_OFFSET)===A.TOUCH_DOLLY_OFFSET||(this._state&A.TOUCH_ZOOM_OFFSET)===A.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},T=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,ke(this._activePointers,$);const m=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,w=m?-m.deltaX:i.x-$.x,x=m?-m.deltaY:i.y-$.y;if(i.copy($),((this._state&A.ROTATE)===A.ROTATE||(this._state&A.TOUCH_ROTATE)===A.TOUCH_ROTATE||(this._state&A.TOUCH_DOLLY_ROTATE)===A.TOUCH_DOLLY_ROTATE||(this._state&A.TOUCH_ZOOM_ROTATE)===A.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(w,x),this._isUserControllingRotate=!0),(this._state&A.DOLLY)===A.DOLLY||(this._state&A.ZOOM)===A.ZOOM){const C=this.dollyToCursor?(s.x-this._elementRect.x)/this._elementRect.width*2-1:0,v=this.dollyToCursor?(s.y-this._elementRect.y)/this._elementRect.height*-2+1:0,b=this.dollyDragInverted?-1:1;(this._state&A.DOLLY)===A.DOLLY?(this._dollyInternal(b*x*ye,C,v),this._isUserControllingDolly=!0):(this._zoomInternal(b*x*ye,C,v),this._isUserControllingZoom=!0)}if((this._state&A.TOUCH_DOLLY)===A.TOUCH_DOLLY||(this._state&A.TOUCH_ZOOM)===A.TOUCH_ZOOM||(this._state&A.TOUCH_DOLLY_TRUCK)===A.TOUCH_DOLLY_TRUCK||(this._state&A.TOUCH_ZOOM_TRUCK)===A.TOUCH_ZOOM_TRUCK||(this._state&A.TOUCH_DOLLY_OFFSET)===A.TOUCH_DOLLY_OFFSET||(this._state&A.TOUCH_ZOOM_OFFSET)===A.TOUCH_ZOOM_OFFSET||(this._state&A.TOUCH_DOLLY_ROTATE)===A.TOUCH_DOLLY_ROTATE||(this._state&A.TOUCH_ZOOM_ROTATE)===A.TOUCH_ZOOM_ROTATE){const C=$.x-this._activePointers[1].clientX,v=$.y-this._activePointers[1].clientY,b=Math.sqrt(C*C+v*v),D=r.y-b;r.set(0,b);const P=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,L=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&A.TOUCH_DOLLY)===A.TOUCH_DOLLY||(this._state&A.TOUCH_DOLLY_ROTATE)===A.TOUCH_DOLLY_ROTATE||(this._state&A.TOUCH_DOLLY_TRUCK)===A.TOUCH_DOLLY_TRUCK||(this._state&A.TOUCH_DOLLY_OFFSET)===A.TOUCH_DOLLY_OFFSET?(this._dollyInternal(D*ye,P,L),this._isUserControllingDolly=!0):(this._zoomInternal(D*ye,P,L),this._isUserControllingZoom=!0)}((this._state&A.TRUCK)===A.TRUCK||(this._state&A.TOUCH_TRUCK)===A.TOUCH_TRUCK||(this._state&A.TOUCH_DOLLY_TRUCK)===A.TOUCH_DOLLY_TRUCK||(this._state&A.TOUCH_ZOOM_TRUCK)===A.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(w,x,!1),this._isUserControllingTruck=!0),((this._state&A.OFFSET)===A.OFFSET||(this._state&A.TOUCH_OFFSET)===A.TOUCH_OFFSET||(this._state&A.TOUCH_DOLLY_OFFSET)===A.TOUCH_DOLLY_OFFSET||(this._state&A.TOUCH_ZOOM_OFFSET)===A.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(w,x,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},_=()=>{ke(this._activePointers,$),i.copy($),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",f),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mouseup",u),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",g),this._domElement.ownerDocument.addEventListener("pointerlockerror",E),this._domElement.ownerDocument.addEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",d),O())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",g),this._domElement.ownerDocument.removeEventListener("pointerlockerror",E))};const g=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},E=()=>{this.unlockPointer()};this._addAllEventListeners=h=>{this._domElement=h,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",o),An&&this._domElement.addEventListener("mousedown",a),this._domElement.addEventListener("pointercancel",d),this._domElement.addEventListener("wheel",p,{passive:!1}),this._domElement.addEventListener("contextmenu",y)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",o),this._domElement.removeEventListener("mousedown",a),this._domElement.removeEventListener("pointercancel",d),this._domElement.removeEventListener("wheel",p,{passive:!1}),this._domElement.removeEventListener("contextmenu",y),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",f),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mouseup",u),this._domElement.ownerDocument.removeEventListener("pointerlockchange",g),this._domElement.ownerDocument.removeEventListener("pointerlockerror",E))},this.cancel=()=>{this._state!==A.NONE&&(this._state=A.NONE,this._activePointers.length=0,_())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=nt(e.width,0,1),this._interactiveArea.height=nt(e.height,0,1),this._interactiveArea.x=nt(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=nt(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,s=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,s)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,s=!1){this._isUserControllingRotate=!1;const i=nt(e,this.minAzimuthAngle,this.maxAzimuthAngle),r=nt(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=i,this._sphericalEnd.phi=r,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,s||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const o=!s||H(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&H(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(o)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=Dt.NONE,this._changedDolly=0,this._dollyToNoClamp(nt(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){const s=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const o=this._collisionTest(),a=H(o,this._spherical.radius);if(!(s>e)&&a)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,o)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const r=!t||H(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(r)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection($t).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const s=!t||H(this._target.x,this._targetEnd.x,this.restThreshold)&&H(this._target.y,this._targetEnd.y,this.restThreshold)&&H(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=nt(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const s=!t||H(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(s)}pan(e,t,s=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,s)}truck(e,t,s=!1){this._camera.updateMatrix(),rt.setFromMatrixColumn(this._camera.matrix,0),at.setFromMatrixColumn(this._camera.matrix,1),rt.multiplyScalar(e),at.multiplyScalar(-t);const i=F.copy(rt).add(at),r=I.copy(this._targetEnd).add(i);return this.moveTo(r.x,r.y,r.z,s)}forward(e,t=!1){F.setFromMatrixColumn(this._camera.matrix,0),F.crossVectors(this._camera.up,F),F.multiplyScalar(e);const s=I.copy(this._targetEnd).add(F);return this.moveTo(s.x,s.y,s.z,t)}elevate(e,t=!1){return F.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+F.x,this._targetEnd.y+F.y,this._targetEnd.z+F.z,t)}moveTo(e,t,s,i=!1){this._isUserControllingTruck=!1;const r=F.set(e,t,s).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,r,this.boundaryFriction),this._needsUpdate=!0,i||this._target.copy(this._targetEnd);const o=!i||H(this._target.x,this._targetEnd.x,this.restThreshold)&&H(this._target.y,this._targetEnd.y,this.restThreshold)&&H(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(o)}lookInDirectionOf(e,t,s,i=!1){const a=F.set(e,t,s).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(a.x,a.y,a.z,i)}fitToBox(e,t,{cover:s=!1,paddingLeft:i=0,paddingRight:r=0,paddingBottom:o=0,paddingTop:a=0}={}){const c=[],f=e.isBox3?Mt.copy(e):Mt.setFromObject(e);f.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const d=Us(this._sphericalEnd.theta,Ps),u=Us(this._sphericalEnd.phi,Ps);c.push(this.rotateTo(d,u,t));const l=F.setFromSpherical(this._sphericalEnd).normalize(),p=Bs.setFromUnitVectors(l,Ye),y=H(Math.abs(l.y),1);y&&p.multiply(Ze.setFromAxisAngle(ge,d)),p.multiply(this._yAxisUpSpaceInverse);const O=zs.makeEmpty();I.copy(f.min).applyQuaternion(p),O.expandByPoint(I),I.copy(f.min).setX(f.max.x).applyQuaternion(p),O.expandByPoint(I),I.copy(f.min).setY(f.max.y).applyQuaternion(p),O.expandByPoint(I),I.copy(f.max).setZ(f.min.z).applyQuaternion(p),O.expandByPoint(I),I.copy(f.min).setZ(f.max.z).applyQuaternion(p),O.expandByPoint(I),I.copy(f.max).setY(f.min.y).applyQuaternion(p),O.expandByPoint(I),I.copy(f.max).setX(f.min.x).applyQuaternion(p),O.expandByPoint(I),I.copy(f.max).applyQuaternion(p),O.expandByPoint(I),O.min.x-=i,O.min.y-=o,O.max.x+=r,O.max.y+=a,p.setFromUnitVectors(Ye,l),y&&p.premultiply(Ze.invert()),p.premultiply(this._yAxisUpSpace);const T=O.getSize(F),_=O.getCenter(I).applyQuaternion(p);if(gt(this._camera)){const g=this.getDistanceToFitBox(T.x,T.y,T.z,s);c.push(this.moveTo(_.x,_.y,_.z,t)),c.push(this.dollyTo(g,t)),c.push(this.setFocalOffset(0,0,0,t))}else if(pt(this._camera)){const g=this._camera,E=g.right-g.left,h=g.top-g.bottom,m=s?Math.max(E/T.x,h/T.y):Math.min(E/T.x,h/T.y);c.push(this.moveTo(_.x,_.y,_.z,t)),c.push(this.zoomTo(m,t)),c.push(this.setFocalOffset(0,0,0,t))}return Promise.all(c)}fitToSphere(e,t){const s=[],r=e instanceof z.Sphere?Ne.copy(e):te.createBoundingSphere(e,Ne);if(s.push(this.moveTo(r.center.x,r.center.y,r.center.z,t)),gt(this._camera)){const o=this.getDistanceToFitSphere(r.radius);s.push(this.dollyTo(o,t))}else if(pt(this._camera)){const o=this._camera.right-this._camera.left,a=this._camera.top-this._camera.bottom,c=2*r.radius,f=Math.min(o/c,a/c);s.push(this.zoomTo(f,t))}return s.push(this.setFocalOffset(0,0,0,t)),Promise.all(s)}setLookAt(e,t,s,i,r,o,a=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Dt.NONE,this._changedDolly=0;const c=I.set(i,r,o),f=F.set(e,t,s);this._targetEnd.copy(c),this._sphericalEnd.setFromVector3(f.sub(c).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,a||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const d=!a||H(this._target.x,this._targetEnd.x,this.restThreshold)&&H(this._target.y,this._targetEnd.y,this.restThreshold)&&H(this._target.z,this._targetEnd.z,this.restThreshold)&&H(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&H(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&H(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(d)}lerpLookAt(e,t,s,i,r,o,a,c,f,d,u,l,p,y=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Dt.NONE,this._changedDolly=0;const O=F.set(i,r,o),T=I.set(e,t,s);Q.setFromVector3(T.sub(O).applyQuaternion(this._yAxisUpSpace));const _=St.set(d,u,l),g=I.set(a,c,f);Kt.setFromVector3(g.sub(_).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(O.lerp(_,p));const E=Kt.theta-Q.theta,h=Kt.phi-Q.phi,m=Kt.radius-Q.radius;this._sphericalEnd.set(Q.radius+m*p,Q.phi+h*p,Q.theta+E*p),this.normalizeRotations(),this._needsUpdate=!0,y||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const w=!y||H(this._target.x,this._targetEnd.x,this.restThreshold)&&H(this._target.y,this._targetEnd.y,this.restThreshold)&&H(this._target.z,this._targetEnd.z,this.restThreshold)&&H(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&H(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&H(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(w)}setPosition(e,t,s,i=!1){return this.setLookAt(e,t,s,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,i)}setTarget(e,t,s,i=!1){const r=this.getPosition(F),o=this.setLookAt(r.x,r.y,r.z,e,t,s,i);return this._sphericalEnd.phi=nt(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),o}setFocalOffset(e,t,s,i=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,s),this._needsUpdate=!0,i||this._focalOffset.copy(this._focalOffsetEnd);const r=!i||H(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&H(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&H(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(r)}setOrbitPoint(e,t,s){this._camera.updateMatrixWorld(),rt.setFromMatrixColumn(this._camera.matrixWorldInverse,0),at.setFromMatrixColumn(this._camera.matrixWorldInverse,1),Tt.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const i=F.set(e,t,s),r=i.distanceTo(this._camera.position),o=i.sub(this._camera.position);rt.multiplyScalar(o.x),at.multiplyScalar(o.y),Tt.multiplyScalar(o.z),F.copy(rt).add(at).add(Tt),F.z=F.z+r,this.dollyTo(r,!1),this.setFocalOffset(-F.x,F.y,-F.z,!1),this.moveTo(e,t,s,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,s,i){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new z.Vector4,typeof e=="number"?this._viewport.set(e,t,s,i):this._viewport.copy(e)}getDistanceToFitBox(e,t,s,i=!1){if(Ve(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const r=e/t,o=this._camera.getEffectiveFOV()*Xt,a=this._camera.aspect;return((i?r>a:rt.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,s){const i=t.lengthSq();if(i===0)return e;const r=I.copy(t).add(e),a=this._boundary.clampPoint(r,St).sub(r),c=a.lengthSq();if(c===0)return e.add(t);if(c===i)return e;if(s===0)return e.add(t).add(a);{const f=1+s*c/t.dot(a);return e.add(I.copy(t).multiplyScalar(f)).add(a.multiplyScalar(1-s))}}_updateNearPlaneCorners(){if(gt(this._camera)){const e=this._camera,t=e.near,s=e.getEffectiveFOV()*Xt,i=Math.tan(s*.5)*t,r=i*e.aspect;this._nearPlaneCorners[0].set(-r,-i,0),this._nearPlaneCorners[1].set(r,-i,0),this._nearPlaneCorners[2].set(r,i,0),this._nearPlaneCorners[3].set(-r,i,0)}else if(pt(this._camera)){const e=this._camera,t=1/e.zoom,s=e.left*t,i=e.right*t,r=e.top*t,o=e.bottom*t;this._nearPlaneCorners[0].set(s,r,0),this._nearPlaneCorners[1].set(i,r,0),this._nearPlaneCorners[2].set(i,o,0),this._nearPlaneCorners[3].set(s,o,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||Ve(this._camera,"_collisionTest"))return e;const s=this._getTargetDirection($t);Xe.lookAt(Ls,s,this._camera.up);for(let i=0;i<4;i++){const r=I.copy(this._nearPlaneCorners[i]);r.applyMatrix4(Xe);const o=St.addVectors(this._target,r);Te.set(o,s),Te.far=this._spherical.radius+1;const a=Te.intersectObjects(this.colliderMeshes);a.length!==0&&a[0].distance{const s=()=>{this.removeEventListener("rest",s),t()};this.addEventListener("rest",s)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,t=new z.Sphere){const s=t,i=s.center;Mt.makeEmpty(),e.traverseVisible(o=>{o.isMesh&&Mt.expandByObject(o)}),Mt.getCenter(i);let r=0;return e.traverseVisible(o=>{if(!o.isMesh)return;const a=o,c=a.geometry.clone();c.applyMatrix4(a.matrixWorld);const d=c.attributes.position;for(let u=0,l=d.count;u{var t;if(!(!this.currentWorld||!this.currentWorld.renderer)){if(this.three instanceof ei){this.onAspectUpdated.trigger();return}if((t=this.currentWorld.renderer)!=null&&t.isResizeable()){const s=this.currentWorld.renderer.getSize();this.three.aspect=s.width/s.height,this.three.updateProjectionMatrix(),this.onAspectUpdated.trigger()}}});this.three=this.setupCamera(),this.setupEvents(!0),this.onWorldChanged.add(({action:s,world:i})=>{if(s==="added"){const r=this.newCameraControls();this._allControls.set(i.uuid,r)}if(s==="removed"){const r=this._allControls.get(i.uuid);r&&(r.dispose(),this._allControls.delete(i.uuid))}})}get controls(){if(!this.currentWorld)throw new Error("This camera needs a world to work!");const t=this._allControls.get(this.currentWorld.uuid);if(!t)throw new Error("Controls not found!");return t}get enabled(){return this.currentWorld===null?!1:this.controls.enabled}set enabled(t){this.controls.enabled=t}dispose(){this.setupEvents(!1),this.onAspectUpdated.reset(),this.onBeforeUpdate.reset(),this.onAfterUpdate.reset(),this.three.removeFromParent(),this.onDisposed.trigger(),this.onDisposed.reset();for(const[t,s]of this._allControls)s.dispose()}update(t){this.enabled&&(this.onBeforeUpdate.trigger(this),this.controls.update(t),this.onAfterUpdate.trigger(this))}setupCamera(){const t=window.innerWidth/window.innerHeight,s=new si(60,t,1,1e3);return s.position.set(50,50,50),s.lookAt(new S(0,0,0)),s}newCameraControls(){if(!this.currentWorld)throw new Error("This camera needs a world to work!");if(!this.currentWorld.renderer)throw new Error("This camera needs a renderer to work!");te.install({THREE:Ae.getSubsetOfThree()});const{domElement:t}=this.currentWorld.renderer.three,s=new te(this.three,t);return s.smoothTime=.2,s.dollyToCursor=!0,s.infinityDolly=!0,s}setupEvents(t){t?window.addEventListener("resize",this.updateAspect):window.removeEventListener("resize",this.updateAspect)}static getSubsetOfThree(){return{MOUSE:ii,Vector2:ht,Vector3:S,Vector4:ni,Quaternion:oi,Matrix4:ut,Spherical:ri,Box3:st,Sphere:Hs,Raycaster:ai,MathUtils:ci}}}const ve=class ve extends ns{constructor(t){super(t);U(this,"onAfterUpdate",new Y);U(this,"onBeforeUpdate",new Y);U(this,"onDisposed",new Y);U(this,"onWorldCreated",new Y);U(this,"onWorldDeleted",new Y);U(this,"list",new Map);U(this,"enabled",!0);t.add(ve.uuid,this)}create(){const t=new En(this.components),s=t.uuid;if(this.list.has(s))throw new Error("There is already a world with this name!");return this.list.set(s,t),this.onWorldCreated.trigger(t),t}delete(t){const s=t.uuid;this.list.delete(t.uuid),t.dispose(),this.onWorldDeleted.trigger(s)}dispose(){this.enabled=!1;for(const[t,s]of this.list)s.dispose();this.list.clear(),this.onDisposed.trigger()}update(t){if(this.enabled)for(const[s,i]of this.list)i.update(t)}};U(ve,"uuid","fdb61dc4-2ec1-4966-b83d-54ea795fad4a");let Fs=ve;class Cn{constructor(e,t,s){U(this,"onDisposed",new Y);U(this,"world");U(this,"components");U(this,"three");U(this,"_fade",3);U(this,"updateZoom",()=>{this.world.camera instanceof Ae&&(this.material.uniforms.uZoom.value=this.world.camera.three.zoom)});this.world=t;const{color:i,size1:r,size2:o,distance:a}=s;this.components=e;const c=new li(2,2,1,1),f=new hi({side:ks,uniforms:{uSize1:{value:r},uSize2:{value:o},uColor:{value:i},uDistance:{value:a},uFade:{value:this._fade},uZoom:{value:1}},transparent:!0,vertexShader:` varying vec3 worldPosition; @@ -68,4 +68,4 @@ var Ws=Object.defineProperty;var $s=(n,e,t)=>e in n?Ws(n,e,{enumerable:!0,config } - `,extensions:{derivatives:!0}});this.three=new Je(c,f),this.three.frustumCulled=!1,t.scene.three.add(this.three),this.setupEvents(!0)}get visible(){return this.three.visible}set visible(e){e?this.world.scene.three.add(this.three):this.three.removeFromParent()}get material(){return this.three.material}get fade(){return this._fade===3}set fade(e){this._fade=e?3:0,this.material.uniforms.uFade.value=this._fade}[Symbol.dispose](){throw new Error("Method not implemented.")}dispose(){this.setupEvents(!1),this.components.get(Jt).destroy(this.three),this.onDisposed.trigger(),this.onDisposed.reset(),this.world=null,this.components=null}setupEvents(e){if(!(this.world.camera instanceof Ae))return;const t=this.world.camera.controls;e?t.addEventListener("update",this.updateZoom):t.removeEventListener("update",this.updateZoom)}}class vn extends ns{constructor(){super(...arguments);U(this,"list",new Map);U(this,"onDisposed",new N);U(this,"config",{color:new Ee(12303291),size1:1,size2:10,distance:500});U(this,"enabled",!0)}create(t){if(this.list.has(t.uuid))throw new Error("This world already has a grid!");const s=new Cn(this.components,t,this.config);return this.list.set(t.uuid,s),t.onDisposed.add(()=>{this.delete(t)}),s}delete(t){const s=this.list.get(t.uuid);s&&s.dispose(),this.list.delete(t.uuid)}dispose(){for(const[t,s]of this.list)s.dispose();this.list.clear(),this.onDisposed.trigger()}}U(vn,"uuid","d1e814d5-b81c-4452-87a2-f039375e0489");export{ns as C,Jt as D,N as E,vn as G,Un as S,Fs as W,bs as a,Dn as b,Ae as c}; + `,extensions:{derivatives:!0}});this.three=new Je(c,f),this.three.frustumCulled=!1,t.scene.three.add(this.three),this.setupEvents(!0)}get visible(){return this.three.visible}set visible(e){e?this.world.scene.three.add(this.three):this.three.removeFromParent()}get material(){return this.three.material}get fade(){return this._fade===3}set fade(e){this._fade=e?3:0,this.material.uniforms.uFade.value=this._fade}[Symbol.dispose](){throw new Error("Method not implemented.")}dispose(){this.setupEvents(!1),this.components.get(Jt).destroy(this.three),this.onDisposed.trigger(),this.onDisposed.reset(),this.world=null,this.components=null}setupEvents(e){if(this.world.isDisposing||!(this.world.camera instanceof Ae))return;const t=this.world.camera.controls;e?t.addEventListener("update",this.updateZoom):t.removeEventListener("update",this.updateZoom)}}class vn extends ns{constructor(){super(...arguments);U(this,"list",new Map);U(this,"onDisposed",new Y);U(this,"config",{color:new Ee(12303291),size1:1,size2:10,distance:500});U(this,"enabled",!0)}create(t){if(this.list.has(t.uuid))throw new Error("This world already has a grid!");const s=new Cn(this.components,t,this.config);return this.list.set(t.uuid,s),t.onDisposed.add(()=>{this.delete(t)}),s}delete(t){const s=this.list.get(t.uuid);s&&s.dispose(),this.list.delete(t.uuid)}dispose(){for(const[t,s]of this.list)s.dispose();this.list.clear(),this.onDisposed.trigger()}}U(vn,"uuid","d1e814d5-b81c-4452-87a2-f039375e0489");export{ns as C,Jt as D,Y as E,vn as G,Un as S,Fs as W,bs as a,Dn as b,Ae as c}; diff --git a/examples/assets/index-BLLWNBJ2.js b/examples/assets/index-C9jIYBP8.js similarity index 99% rename from examples/assets/index-BLLWNBJ2.js rename to examples/assets/index-C9jIYBP8.js index 0d8e9cb88..8dcb1c4b3 100644 --- a/examples/assets/index-BLLWNBJ2.js +++ b/examples/assets/index-C9jIYBP8.js @@ -1 +1 @@ -var W=Object.defineProperty;var Q=(b,h,t)=>h in b?W(b,h,{enumerable:!0,configurable:!0,writable:!0,value:t}):b[h]=t;var p=(b,h,t)=>(Q(b,typeof h!="symbol"?h+"":h,t),t);import{V as u,E as q,h as J,c as y,g as v,L as Z,Q as tt,p as I,o as et}from"./web-ifc-api-BC8YMRiS.js";import{J as B,U as V}from"./index-b4ozRbQy.js";import{a as nt}from"./index-BaoxwJyW.js";import{M as k}from"./index-WVnKWA4H.js";import"./import-wrapper-prod-LhqN7JJy.js";import{M as x}from"./mark-Cj_PmUva.js";const ot=["Station","Radius","Length","InitialKP","FinalKP","KP","Slope","Height","InitialKPV","FinalKPV"],M=class M extends B{constructor(t){super(t);p(this,"enabled",!0);p(this,"world",null);p(this,"_list",new Map);p(this,"_markerKey",0);p(this,"type","horizontal");p(this,"divisionLength",100);t.add(M.uuid,this)}addKPStation(t,i,e){const n=this.components.get(k),s=document.createElement("div"),o=document.createElement("div");s.appendChild(o),o.innerHTML=i,o.style.color=n.color,o.style.borderBottom="1px dotted white",o.style.width="160px",o.style.textAlign="left";const a=new x(t,s),r=new u;r.x=e.geometry.attributes.position.getX(e.geometry.attributes.position.count-1),r.y=e.geometry.attributes.position.getY(e.geometry.attributes.position.count-1),r.z=e.geometry.attributes.position.getZ(e.geometry.attributes.position.count-1);const c=new u;c.x=e.geometry.attributes.position.getX(e.geometry.attributes.position.count-2),c.y=e.geometry.attributes.position.getY(e.geometry.attributes.position.count-2),c.z=e.geometry.attributes.position.getZ(e.geometry.attributes.position.count-2);const d=new u;d.x=(r.x+c.x)/2,d.y=(r.y+c.y)/2,d.z=(r.z+c.z)/2,a.three.position.copy(d);const l=new u;l.subVectors(r,c).normalize();const g=new tt;g.setFromUnitVectors(new u(0,1,0),l);const m=new q().setFromQuaternion(g).z,w=J.radToDeg(m);o.style.transform=`rotate(${-w-90}deg) translate(-35%, -50%)`;const f=this._markerKey.toString();n.setupEvents(t,!0),n.getWorldMarkerList(t).set(f,{label:a,key:f,merged:!1,static:!1}),this._markerKey++,this.save(f,"KP")}addVerticalMarker(t,i,e,n,s){const o=this.components.get(k),a=document.createElement("span");a.innerHTML=i,a.style.color=o.color;const r=new x(t,a,s);if(n==="Height"){const l=document.createElement("span");l.innerHTML=i,l.style.color=o.color;const{position:g}=e.geometry.attributes,w=(g.array.length/3-1)*3,f=g.array.slice(w,w+3);r.three.position.set(f[0],f[1]+10,f[2])}else if(n==="InitialKPV"){const{position:l}=e.geometry.attributes,g=l.getX(0),m=l.getY(0),w=l.getZ(0);r.three.position.set(g-20,m,w)}else if(n==="FinalKPV"){const{position:l}=e.geometry.attributes,g=l.getX(e.geometry.attributes.position.count-1),m=l.getY(e.geometry.attributes.position.count-1),w=l.getZ(e.geometry.attributes.position.count-1);r.three.position.set(g+20,m,w)}else if(n==="Slope"){a.style.color="grey";const{position:l}=e.geometry.attributes,g=new u;g.x=l.getX(0),g.y=l.getY(0),g.z=l.getZ(0);const m=new u;m.x=l.getX(l.count-1),m.y=l.getY(l.count-1),m.z=l.getZ(l.count-1);const w=new u;w.addVectors(g,m).multiplyScalar(.5),r.three.position.set(w.x,w.y-10,w.z)}const c=this._markerKey.toString();return o.setupEvents(t,!0),o.getWorldMarkerList(t).set(c,{label:r,key:c,type:n,merged:!1,static:!1}),this._markerKey++,this.save(c,n),r}addCivilMarker(t,i,e,n){const s=this.components.get(k),o=document.createElement("span");o.innerHTML=i,o.style.color=s.color;const a=new x(t,o);if(n==="InitialKP"){const d=e.geometry.attributes.position.getX(0),l=e.geometry.attributes.position.getY(0),g=e.geometry.attributes.position.getZ(0);a.three.position.set(d+2,l+2,g)}else if(n==="FinalKP"){const d=e.geometry.attributes.position.getX(e.geometry.attributes.position.count-1),l=e.geometry.attributes.position.getY(e.geometry.attributes.position.count-1),g=e.geometry.attributes.position.getZ(e.geometry.attributes.position.count-1);a.three.position.set(d+2,l-2,g)}else if(n==="Length"){const d=new u;d.x=e.geometry.attributes.position.getX(0),d.y=e.geometry.attributes.position.getY(0),d.z=e.geometry.attributes.position.getZ(0);const l=new u;l.x=e.geometry.attributes.position.getX(e.geometry.attributes.position.count-1),l.y=e.geometry.attributes.position.getY(e.geometry.attributes.position.count-1),l.z=e.geometry.attributes.position.getZ(e.geometry.attributes.position.count-1);const g=d.distanceTo(l);a.three.element.innerText=g.toFixed(2);const m=l.clone().add(d).divideScalar(2);a.three.position.copy(m)}const r=this._markerKey.toString();return s.setupEvents(t,!0),s.getWorldMarkerList(t).set(r,{label:a,key:r,type:n,merged:!1,static:!1}),this._markerKey++,this.save(r,n),a}showKPStations(t){if(!this.world)throw new Error("A world is needed for this component to work!");if(this.type==="horizontal"){const i=this.generateStartAndEndKP(t);for(const[,n]of i)this.addKPStation(this.world,n.value,n.normal);const e=this.generateConstantKP(t);for(const[,n]of e)this.addKPStation(this.world,n.value,n.normal)}}showCurveLength(t,i){if(!this.world)throw new Error("A world is needed for this component to work!");const e=this.components.get(k),n=t.length,s=`${i.toFixed(2)} m`,o=Math.round(n/2),a=t[o],r=e.create(this.world,s,a,!0);r!==void 0&&this.save(r,"Radius")}showLineLength(t,i){if(!this.world)throw new Error("A world is needed for this component to work!");const e=this.components.get(k),n=new u;n.x=t.geometry.getAttribute("position").getX(0),n.y=t.geometry.getAttribute("position").getY(0),n.z=t.geometry.getAttribute("position").getZ(0);const s=new u;s.x=t.geometry.getAttribute("position").getX(1),s.y=t.geometry.getAttribute("position").getY(1),s.z=t.geometry.getAttribute("position").getZ(1);const o=`${i.toFixed(2)} m`,a=new u;a.addVectors(n,s).multiplyScalar(.5);const r=e.create(this.world,o,a,!0);r!==void 0&&this.save(r,"Radius")}showCurveRadius(t,i){if(!this.world)throw new Error("A world is needed for this component to work!");const e=this.components.get(k),n=new u;n.x=t.geometry.getAttribute("position").getX(0),n.y=t.geometry.getAttribute("position").getY(0),n.z=t.geometry.getAttribute("position").getZ(0);const s=new u;s.x=t.geometry.getAttribute("position").getX(1),s.y=t.geometry.getAttribute("position").getY(1),s.z=t.geometry.getAttribute("position").getZ(1);const o=`R = ${i.toFixed(2)} m`,a=new u;a.addVectors(n,s).multiplyScalar(.5);const r=e.create(this.world,o,a,!0);r!==void 0&&this.save(r,"Radius")}deleteByType(t=ot){const i=this.components.get(k);for(const e of t){const n=this._list.get(e);if(n){for(const s of n)i.delete(s);this._list.delete(e)}}}generateStartAndEndKP(t){const{alignment:i}=t.curve,e=new Map;for(const n of i.horizontal){const s=n.getLength();if(e.size>0){const o=n.index-1,r=e.get(o).distance+s,c=n.mesh.geometry.getAttribute("position"),d=c.count-1,l=new u;l.x=c.getX(d),l.y=c.getY(d),l.z=c.getZ(d);const g=this.createNormalLine(n.mesh);e.set(n.index,{value:this.getShortendKPValue(r),distance:r,point:l,normal:g})}else{const o=n.mesh.geometry.getAttribute("position"),a=o.count-1,r=new u;r.x=o.getX(a),r.y=o.getY(a),r.z=o.getZ(a);const c=this.createNormalLine(n.mesh);e.set(n.index,{value:this.getShortendKPValue(s),distance:s,point:r,normal:c})}}return e}createNormalLine(t){const i=t.geometry.attributes.position.count-1,e=i-1,n=new u;n.x=t.geometry.attributes.position.getX(i),n.y=t.geometry.attributes.position.getY(i),n.z=t.geometry.attributes.position.getZ(i);const s=new u;s.x=t.geometry.attributes.position.getX(e),s.y=t.geometry.attributes.position.getY(e),s.z=t.geometry.attributes.position.getZ(e);const a=new u().subVectors(n,s).clone().applyAxisAngle(new u(0,0,1),Math.PI*.5).normalize(),r=new y().setFromPoints([a.clone().setLength(10).add(n),a.clone().setLength(-10).add(n)]);return new v(r)}generateConstantKP(t){const{alignment:i}=t.curve,e=new Map,n=i.getLength("horizontal"),s=Math.floor(n/this.divisionLength);for(let o=0;o1e3&&parseInt(e,10)<1e4){const[o,...a]=e;return`${o}+${a.join("")}.${s}`}if(parseInt(e,10)>1e4){const[o,a,...r]=e;return`${o}${a}+${r.join("")}.${s}`}return`0+${e.padStart(3,"0")}.${s}`}save(t,i){this._list.has(i)||this._list.set(i,new Set),this._list.get(i).add(t)}};p(M,"uuid","0af12c32-81ee-4100-a030-e9ae546f6170");let L=M;class st extends B{constructor(t){super(t);p(this,"enabled",!0);p(this,"_highlighter");p(this,"onHighlight",new V);p(this,"onMarkerChange",new V);p(this,"mouseMarkers");p(this,"onMarkerHidden",new V);p(this,"_curves",[]);p(this,"_previousAlignment",null);p(this,"_world",null);p(this,"updateLinesResolution",t=>{var i;(i=this._highlighter)==null||i.setResolution(t)});p(this,"onMouseMove",t=>{var o,a,r;if(!this._world)throw new Error("No world was given for this navigator!");if(!this._world.renderer)return;const e=this._world.renderer.three.domElement.parentElement,n=this._world.camera.three,s=(o=this._highlighter)==null?void 0:o.castRay(t,n,e,this._curves);if(s){const{object:c}=s;(a=this._highlighter)==null||a.hover(c),this.updateMarker(s,"hover");return}this.mouseMarkers&&(this.mouseMarkers.hover.visible=!1),(r=this._highlighter)==null||r.unHover(),this.onMarkerHidden.trigger({type:"hover"})});p(this,"onClick",t=>{var o,a;if(!this._world)throw new Error("No world was given for this navigator!");if(!this._world.renderer)return;const e=this._world.renderer.three.domElement.parentElement,n=this._world.camera.three,s=(o=this._highlighter)==null?void 0:o.castRay(t,n,e,this._curves);if(s){const r=s,c=r.object;if((a=this._highlighter)==null||a.select(c),this.updateMarker(r,"select"),this._world.camera.hasCameraControls()&&(c.geometry.boundingBox||c.geometry.computeBoundingBox(),c.geometry.boundingBox)){const d=this.getScaledBox(c.geometry.boundingBox,2);this._world.camera.controls.fitToBox(d,!0)}this.onHighlight.trigger({mesh:c,point:r.point}),this._previousAlignment!==c.curve.alignment&&(this.components.get(L).showKPStations(c),this._previousAlignment=c.curve.alignment)}});p(this,"onControlsUpdated",()=>{if(!this._world)throw new Error("No world was given for this navigator!");if(!(this._world.camera.three instanceof et)||!this._highlighter)return;const{zoom:t,left:i,right:e,top:n,bottom:s}=this._world.camera.three,o=i-e,a=n-s,c=Math.max(o,a)/t,d=40,{caster:l}=this._highlighter;l.params.Line.threshold=c/d})}get highlighter(){if(!this._highlighter)throw new Error("Highlighter not initialized. You must set a world first!");return this._highlighter}get world(){return this._world}set world(t){var e,n,s;if(t===this._world||(this._world&&this.setupEvents(!1),this._world=t,(e=this._highlighter)==null||e.dispose(),(n=this.mouseMarkers)==null||n.hover.dispose(),(s=this.mouseMarkers)==null||s.select.dispose(),!t))return;const i=t.scene.three;this._highlighter=new nt(i,this.view),this.mouseMarkers={select:this.newMouseMarker("#ffffff",t),hover:this.newMouseMarker("#575757",t)},this.setupEvents(!0)}async draw(t,i){if(!t.civilData)throw new Error("The provided model doesn't have civil data!");if(!this._world)throw new Error("No world was given for this navigator!");const{alignments:e}=t.civilData,n=i||e.values(),s=this._world.scene.three,o=new I;o.makeEmpty(),o.min.set(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),o.max.set(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(const r of n){if(!r)throw new Error("Alignment not found!");for(const c of r[this.view])if(s.add(c.mesh),this._curves.push(c.mesh),!o.isEmpty())o.expandByObject(c.mesh);else{c.mesh.geometry.computeBoundingBox();const d=c.mesh.geometry.boundingBox;d instanceof I&&o.copy(d).applyMatrix4(c.mesh.matrixWorld)}}const a=this.getScaledBox(o,1.2);this._world.camera.hasCameraControls()&&await this._world.camera.controls.fitToBox(a,!1)}async dispose(){var t;(t=this._highlighter)==null||t.dispose(),this.clear(),this.onHighlight.reset(),this._curves=[]}clear(){var t,i;(t=this._highlighter)==null||t.unSelect(),(i=this._highlighter)==null||i.unHover();for(const e of this._curves)e.removeFromParent();this._curves=[]}setMarker(t,i,e){if(!this._curves.length)return;const n=t.getCurveAt(i,this.view),s=t.getPointAt(i,this.view),{index:o}=n.curve.getSegmentAt(n.percentage);this.setMouseMarker(s,n.curve.mesh,o,e)}setDefSegments(t){const i=[],e=[],n=(s,o)=>{const a=o[1]-s[1],r=o[0]-s[0];return a/r};for(let s=0;s=0;m--)if(o[m*3]!==void 0&&o[m*3+1]!==void 0){c=o[m*3],d=o[m*3+1];break}const g=(n([a,r],[c,d])*100).toFixed(2);e.push({slope:g})}for(const s of t)for(let o=0;os.clone().add(e))}showLineInfo(h,t){const i=this.components.get(L);i.world=this._world,i.deleteByType(["Length","Radius"]);const e=h.geometry.attributes.position.array,n=this.calculateParallelCurve(e,e.length/3,t),s=new y().setFromPoints(n),o=new v(s,this.markupMaterial);i.showLineLength(o,h.curve.getLength()),this._scene.add(o),this.markupLines.push(o);const{startDimensionPoints:a,endDimensionPoints:r}=this.calculateDimensionLines(h,o),c=this.offsetDimensionLine(a,t*.1),d=this.offsetDimensionLine(r,t*.1),l=new y().setFromPoints(c),g=new y().setFromPoints(d),m=new v(l,this.markupMaterial);this._scene.add(m),this.markupLines.push(m);const w=new v(g,this.markupMaterial);this._scene.add(w),this.markupLines.push(w)}showClothoidInfo(h,t){const i=this.components.get(L);i.world=this._world,i.deleteByType(["Length","Radius"]);const e=h.geometry.attributes.position.array,n=this.calculateParallelCurve(e,e.length/3,t),s=new y().setFromPoints(n);i.showCurveLength(n,h.curve.getLength());const o=new v(s,this.markupMaterial);this._scene.add(o),this.markupLines.push(o);const{startDimensionPoints:a,endDimensionPoints:r}=this.calculateDimensionLines(h,o),c=this.offsetDimensionLine(a,t*.1),d=this.offsetDimensionLine(r,t*.1),l=new y().setFromPoints(c),g=new y().setFromPoints(d),m=new v(l,this.markupMaterial);this._scene.add(m),this.markupLines.push(m);const w=new v(g,this.markupMaterial);this._scene.add(w),this.markupLines.push(w)}showCircularArcInfo(h,t){const i=this.components.get(L);i.world=this._world,i.deleteByType(["Length","Radius"]);const e=h.curve.data.RADIUS,n=h.geometry.attributes.position.array,s=h.geometry.attributes.position.count,o=[],a=new u(n[0],n[1],n[2]),r=(s-1)*3,c=new u(n[r],n[r+1],n[r+2]),d=s/2*3,l=new u(n[d],n[d+1],n[d+2]),g=c.clone().sub(a).normalize(),m=new u(-g.y,g.x,0);m.multiplyScalar(e);const w=l.clone().add(m);o.push(l),o.push(w);const f=new y().setFromPoints(o),P=new v(f,this.markupMaterial);i.showCurveRadius(P,Math.abs(e)),this._scene.add(P),this.markupLines.push(P);const A=[];for(let _=0;_{!this._highlighter||!this.planHighlighter||this.planHighlighter.showCurveInfo(i)})}get world(){return super.world}set world(t){var i;super.world=t,t&&((i=this.planHighlighter)==null||i.dispose(),this.planHighlighter=new it(this.components,t.scene.three,t))}};p(S,"uuid","3096dea0-5bc2-41c7-abce-9089b6c9431b");let F=S;export{F as C,st as a,L as b}; +var W=Object.defineProperty;var Q=(b,h,t)=>h in b?W(b,h,{enumerable:!0,configurable:!0,writable:!0,value:t}):b[h]=t;var p=(b,h,t)=>(Q(b,typeof h!="symbol"?h+"":h,t),t);import{V as u,E as q,h as J,c as y,g as v,L as Z,Q as tt,p as I,o as et}from"./web-ifc-api-BC8YMRiS.js";import{J as B,U as V}from"./index-b4ozRbQy.js";import{a as nt}from"./index-Ch1tb-j6.js";import{M as k}from"./index-WVnKWA4H.js";import"./import-wrapper-prod-LhqN7JJy.js";import{M as x}from"./mark-Cj_PmUva.js";const ot=["Station","Radius","Length","InitialKP","FinalKP","KP","Slope","Height","InitialKPV","FinalKPV"],M=class M extends B{constructor(t){super(t);p(this,"enabled",!0);p(this,"world",null);p(this,"_list",new Map);p(this,"_markerKey",0);p(this,"type","horizontal");p(this,"divisionLength",100);t.add(M.uuid,this)}addKPStation(t,i,e){const n=this.components.get(k),s=document.createElement("div"),o=document.createElement("div");s.appendChild(o),o.innerHTML=i,o.style.color=n.color,o.style.borderBottom="1px dotted white",o.style.width="160px",o.style.textAlign="left";const a=new x(t,s),r=new u;r.x=e.geometry.attributes.position.getX(e.geometry.attributes.position.count-1),r.y=e.geometry.attributes.position.getY(e.geometry.attributes.position.count-1),r.z=e.geometry.attributes.position.getZ(e.geometry.attributes.position.count-1);const c=new u;c.x=e.geometry.attributes.position.getX(e.geometry.attributes.position.count-2),c.y=e.geometry.attributes.position.getY(e.geometry.attributes.position.count-2),c.z=e.geometry.attributes.position.getZ(e.geometry.attributes.position.count-2);const d=new u;d.x=(r.x+c.x)/2,d.y=(r.y+c.y)/2,d.z=(r.z+c.z)/2,a.three.position.copy(d);const l=new u;l.subVectors(r,c).normalize();const g=new tt;g.setFromUnitVectors(new u(0,1,0),l);const m=new q().setFromQuaternion(g).z,w=J.radToDeg(m);o.style.transform=`rotate(${-w-90}deg) translate(-35%, -50%)`;const f=this._markerKey.toString();n.setupEvents(t,!0),n.getWorldMarkerList(t).set(f,{label:a,key:f,merged:!1,static:!1}),this._markerKey++,this.save(f,"KP")}addVerticalMarker(t,i,e,n,s){const o=this.components.get(k),a=document.createElement("span");a.innerHTML=i,a.style.color=o.color;const r=new x(t,a,s);if(n==="Height"){const l=document.createElement("span");l.innerHTML=i,l.style.color=o.color;const{position:g}=e.geometry.attributes,w=(g.array.length/3-1)*3,f=g.array.slice(w,w+3);r.three.position.set(f[0],f[1]+10,f[2])}else if(n==="InitialKPV"){const{position:l}=e.geometry.attributes,g=l.getX(0),m=l.getY(0),w=l.getZ(0);r.three.position.set(g-20,m,w)}else if(n==="FinalKPV"){const{position:l}=e.geometry.attributes,g=l.getX(e.geometry.attributes.position.count-1),m=l.getY(e.geometry.attributes.position.count-1),w=l.getZ(e.geometry.attributes.position.count-1);r.three.position.set(g+20,m,w)}else if(n==="Slope"){a.style.color="grey";const{position:l}=e.geometry.attributes,g=new u;g.x=l.getX(0),g.y=l.getY(0),g.z=l.getZ(0);const m=new u;m.x=l.getX(l.count-1),m.y=l.getY(l.count-1),m.z=l.getZ(l.count-1);const w=new u;w.addVectors(g,m).multiplyScalar(.5),r.three.position.set(w.x,w.y-10,w.z)}const c=this._markerKey.toString();return o.setupEvents(t,!0),o.getWorldMarkerList(t).set(c,{label:r,key:c,type:n,merged:!1,static:!1}),this._markerKey++,this.save(c,n),r}addCivilMarker(t,i,e,n){const s=this.components.get(k),o=document.createElement("span");o.innerHTML=i,o.style.color=s.color;const a=new x(t,o);if(n==="InitialKP"){const d=e.geometry.attributes.position.getX(0),l=e.geometry.attributes.position.getY(0),g=e.geometry.attributes.position.getZ(0);a.three.position.set(d+2,l+2,g)}else if(n==="FinalKP"){const d=e.geometry.attributes.position.getX(e.geometry.attributes.position.count-1),l=e.geometry.attributes.position.getY(e.geometry.attributes.position.count-1),g=e.geometry.attributes.position.getZ(e.geometry.attributes.position.count-1);a.three.position.set(d+2,l-2,g)}else if(n==="Length"){const d=new u;d.x=e.geometry.attributes.position.getX(0),d.y=e.geometry.attributes.position.getY(0),d.z=e.geometry.attributes.position.getZ(0);const l=new u;l.x=e.geometry.attributes.position.getX(e.geometry.attributes.position.count-1),l.y=e.geometry.attributes.position.getY(e.geometry.attributes.position.count-1),l.z=e.geometry.attributes.position.getZ(e.geometry.attributes.position.count-1);const g=d.distanceTo(l);a.three.element.innerText=g.toFixed(2);const m=l.clone().add(d).divideScalar(2);a.three.position.copy(m)}const r=this._markerKey.toString();return s.setupEvents(t,!0),s.getWorldMarkerList(t).set(r,{label:a,key:r,type:n,merged:!1,static:!1}),this._markerKey++,this.save(r,n),a}showKPStations(t){if(!this.world)throw new Error("A world is needed for this component to work!");if(this.type==="horizontal"){const i=this.generateStartAndEndKP(t);for(const[,n]of i)this.addKPStation(this.world,n.value,n.normal);const e=this.generateConstantKP(t);for(const[,n]of e)this.addKPStation(this.world,n.value,n.normal)}}showCurveLength(t,i){if(!this.world)throw new Error("A world is needed for this component to work!");const e=this.components.get(k),n=t.length,s=`${i.toFixed(2)} m`,o=Math.round(n/2),a=t[o],r=e.create(this.world,s,a,!0);r!==void 0&&this.save(r,"Radius")}showLineLength(t,i){if(!this.world)throw new Error("A world is needed for this component to work!");const e=this.components.get(k),n=new u;n.x=t.geometry.getAttribute("position").getX(0),n.y=t.geometry.getAttribute("position").getY(0),n.z=t.geometry.getAttribute("position").getZ(0);const s=new u;s.x=t.geometry.getAttribute("position").getX(1),s.y=t.geometry.getAttribute("position").getY(1),s.z=t.geometry.getAttribute("position").getZ(1);const o=`${i.toFixed(2)} m`,a=new u;a.addVectors(n,s).multiplyScalar(.5);const r=e.create(this.world,o,a,!0);r!==void 0&&this.save(r,"Radius")}showCurveRadius(t,i){if(!this.world)throw new Error("A world is needed for this component to work!");const e=this.components.get(k),n=new u;n.x=t.geometry.getAttribute("position").getX(0),n.y=t.geometry.getAttribute("position").getY(0),n.z=t.geometry.getAttribute("position").getZ(0);const s=new u;s.x=t.geometry.getAttribute("position").getX(1),s.y=t.geometry.getAttribute("position").getY(1),s.z=t.geometry.getAttribute("position").getZ(1);const o=`R = ${i.toFixed(2)} m`,a=new u;a.addVectors(n,s).multiplyScalar(.5);const r=e.create(this.world,o,a,!0);r!==void 0&&this.save(r,"Radius")}deleteByType(t=ot){const i=this.components.get(k);for(const e of t){const n=this._list.get(e);if(n){for(const s of n)i.delete(s);this._list.delete(e)}}}generateStartAndEndKP(t){const{alignment:i}=t.curve,e=new Map;for(const n of i.horizontal){const s=n.getLength();if(e.size>0){const o=n.index-1,r=e.get(o).distance+s,c=n.mesh.geometry.getAttribute("position"),d=c.count-1,l=new u;l.x=c.getX(d),l.y=c.getY(d),l.z=c.getZ(d);const g=this.createNormalLine(n.mesh);e.set(n.index,{value:this.getShortendKPValue(r),distance:r,point:l,normal:g})}else{const o=n.mesh.geometry.getAttribute("position"),a=o.count-1,r=new u;r.x=o.getX(a),r.y=o.getY(a),r.z=o.getZ(a);const c=this.createNormalLine(n.mesh);e.set(n.index,{value:this.getShortendKPValue(s),distance:s,point:r,normal:c})}}return e}createNormalLine(t){const i=t.geometry.attributes.position.count-1,e=i-1,n=new u;n.x=t.geometry.attributes.position.getX(i),n.y=t.geometry.attributes.position.getY(i),n.z=t.geometry.attributes.position.getZ(i);const s=new u;s.x=t.geometry.attributes.position.getX(e),s.y=t.geometry.attributes.position.getY(e),s.z=t.geometry.attributes.position.getZ(e);const a=new u().subVectors(n,s).clone().applyAxisAngle(new u(0,0,1),Math.PI*.5).normalize(),r=new y().setFromPoints([a.clone().setLength(10).add(n),a.clone().setLength(-10).add(n)]);return new v(r)}generateConstantKP(t){const{alignment:i}=t.curve,e=new Map,n=i.getLength("horizontal"),s=Math.floor(n/this.divisionLength);for(let o=0;o1e3&&parseInt(e,10)<1e4){const[o,...a]=e;return`${o}+${a.join("")}.${s}`}if(parseInt(e,10)>1e4){const[o,a,...r]=e;return`${o}${a}+${r.join("")}.${s}`}return`0+${e.padStart(3,"0")}.${s}`}save(t,i){this._list.has(i)||this._list.set(i,new Set),this._list.get(i).add(t)}};p(M,"uuid","0af12c32-81ee-4100-a030-e9ae546f6170");let L=M;class st extends B{constructor(t){super(t);p(this,"enabled",!0);p(this,"_highlighter");p(this,"onHighlight",new V);p(this,"onMarkerChange",new V);p(this,"mouseMarkers");p(this,"onMarkerHidden",new V);p(this,"_curves",[]);p(this,"_previousAlignment",null);p(this,"_world",null);p(this,"updateLinesResolution",t=>{var i;(i=this._highlighter)==null||i.setResolution(t)});p(this,"onMouseMove",t=>{var o,a,r;if(!this._world)throw new Error("No world was given for this navigator!");if(!this._world.renderer)return;const e=this._world.renderer.three.domElement.parentElement,n=this._world.camera.three,s=(o=this._highlighter)==null?void 0:o.castRay(t,n,e,this._curves);if(s){const{object:c}=s;(a=this._highlighter)==null||a.hover(c),this.updateMarker(s,"hover");return}this.mouseMarkers&&(this.mouseMarkers.hover.visible=!1),(r=this._highlighter)==null||r.unHover(),this.onMarkerHidden.trigger({type:"hover"})});p(this,"onClick",t=>{var o,a;if(!this._world)throw new Error("No world was given for this navigator!");if(!this._world.renderer)return;const e=this._world.renderer.three.domElement.parentElement,n=this._world.camera.three,s=(o=this._highlighter)==null?void 0:o.castRay(t,n,e,this._curves);if(s){const r=s,c=r.object;if((a=this._highlighter)==null||a.select(c),this.updateMarker(r,"select"),this._world.camera.hasCameraControls()&&(c.geometry.boundingBox||c.geometry.computeBoundingBox(),c.geometry.boundingBox)){const d=this.getScaledBox(c.geometry.boundingBox,2);this._world.camera.controls.fitToBox(d,!0)}this.onHighlight.trigger({mesh:c,point:r.point}),this._previousAlignment!==c.curve.alignment&&(this.components.get(L).showKPStations(c),this._previousAlignment=c.curve.alignment)}});p(this,"onControlsUpdated",()=>{if(!this._world)throw new Error("No world was given for this navigator!");if(!(this._world.camera.three instanceof et)||!this._highlighter)return;const{zoom:t,left:i,right:e,top:n,bottom:s}=this._world.camera.three,o=i-e,a=n-s,c=Math.max(o,a)/t,d=40,{caster:l}=this._highlighter;l.params.Line.threshold=c/d})}get highlighter(){if(!this._highlighter)throw new Error("Highlighter not initialized. You must set a world first!");return this._highlighter}get world(){return this._world}set world(t){var e,n,s;if(t===this._world||(this._world&&this.setupEvents(!1),this._world=t,(e=this._highlighter)==null||e.dispose(),(n=this.mouseMarkers)==null||n.hover.dispose(),(s=this.mouseMarkers)==null||s.select.dispose(),!t))return;const i=t.scene.three;this._highlighter=new nt(i,this.view),this.mouseMarkers={select:this.newMouseMarker("#ffffff",t),hover:this.newMouseMarker("#575757",t)},this.setupEvents(!0)}async draw(t,i){if(!t.civilData)throw new Error("The provided model doesn't have civil data!");if(!this._world)throw new Error("No world was given for this navigator!");const{alignments:e}=t.civilData,n=i||e.values(),s=this._world.scene.three,o=new I;o.makeEmpty(),o.min.set(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),o.max.set(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(const r of n){if(!r)throw new Error("Alignment not found!");for(const c of r[this.view])if(s.add(c.mesh),this._curves.push(c.mesh),!o.isEmpty())o.expandByObject(c.mesh);else{c.mesh.geometry.computeBoundingBox();const d=c.mesh.geometry.boundingBox;d instanceof I&&o.copy(d).applyMatrix4(c.mesh.matrixWorld)}}const a=this.getScaledBox(o,1.2);this._world.camera.hasCameraControls()&&await this._world.camera.controls.fitToBox(a,!1)}async dispose(){var t;(t=this._highlighter)==null||t.dispose(),this.clear(),this.onHighlight.reset(),this._curves=[]}clear(){var t,i;(t=this._highlighter)==null||t.unSelect(),(i=this._highlighter)==null||i.unHover();for(const e of this._curves)e.removeFromParent();this._curves=[]}setMarker(t,i,e){if(!this._curves.length)return;const n=t.getCurveAt(i,this.view),s=t.getPointAt(i,this.view),{index:o}=n.curve.getSegmentAt(n.percentage);this.setMouseMarker(s,n.curve.mesh,o,e)}setDefSegments(t){const i=[],e=[],n=(s,o)=>{const a=o[1]-s[1],r=o[0]-s[0];return a/r};for(let s=0;s=0;m--)if(o[m*3]!==void 0&&o[m*3+1]!==void 0){c=o[m*3],d=o[m*3+1];break}const g=(n([a,r],[c,d])*100).toFixed(2);e.push({slope:g})}for(const s of t)for(let o=0;os.clone().add(e))}showLineInfo(h,t){const i=this.components.get(L);i.world=this._world,i.deleteByType(["Length","Radius"]);const e=h.geometry.attributes.position.array,n=this.calculateParallelCurve(e,e.length/3,t),s=new y().setFromPoints(n),o=new v(s,this.markupMaterial);i.showLineLength(o,h.curve.getLength()),this._scene.add(o),this.markupLines.push(o);const{startDimensionPoints:a,endDimensionPoints:r}=this.calculateDimensionLines(h,o),c=this.offsetDimensionLine(a,t*.1),d=this.offsetDimensionLine(r,t*.1),l=new y().setFromPoints(c),g=new y().setFromPoints(d),m=new v(l,this.markupMaterial);this._scene.add(m),this.markupLines.push(m);const w=new v(g,this.markupMaterial);this._scene.add(w),this.markupLines.push(w)}showClothoidInfo(h,t){const i=this.components.get(L);i.world=this._world,i.deleteByType(["Length","Radius"]);const e=h.geometry.attributes.position.array,n=this.calculateParallelCurve(e,e.length/3,t),s=new y().setFromPoints(n);i.showCurveLength(n,h.curve.getLength());const o=new v(s,this.markupMaterial);this._scene.add(o),this.markupLines.push(o);const{startDimensionPoints:a,endDimensionPoints:r}=this.calculateDimensionLines(h,o),c=this.offsetDimensionLine(a,t*.1),d=this.offsetDimensionLine(r,t*.1),l=new y().setFromPoints(c),g=new y().setFromPoints(d),m=new v(l,this.markupMaterial);this._scene.add(m),this.markupLines.push(m);const w=new v(g,this.markupMaterial);this._scene.add(w),this.markupLines.push(w)}showCircularArcInfo(h,t){const i=this.components.get(L);i.world=this._world,i.deleteByType(["Length","Radius"]);const e=h.curve.data.RADIUS,n=h.geometry.attributes.position.array,s=h.geometry.attributes.position.count,o=[],a=new u(n[0],n[1],n[2]),r=(s-1)*3,c=new u(n[r],n[r+1],n[r+2]),d=s/2*3,l=new u(n[d],n[d+1],n[d+2]),g=c.clone().sub(a).normalize(),m=new u(-g.y,g.x,0);m.multiplyScalar(e);const w=l.clone().add(m);o.push(l),o.push(w);const f=new y().setFromPoints(o),P=new v(f,this.markupMaterial);i.showCurveRadius(P,Math.abs(e)),this._scene.add(P),this.markupLines.push(P);const A=[];for(let _=0;_{!this._highlighter||!this.planHighlighter||this.planHighlighter.showCurveInfo(i)})}get world(){return super.world}set world(t){var i;super.world=t,t&&((i=this.planHighlighter)==null||i.dispose(),this.planHighlighter=new it(this.components,t.scene.three,t))}};p(S,"uuid","3096dea0-5bc2-41c7-abce-9089b6c9431b");let F=S;export{F as C,st as a,L as b}; diff --git a/examples/assets/index-BaoxwJyW.js b/examples/assets/index-Ch1tb-j6.js similarity index 68% rename from examples/assets/index-BaoxwJyW.js rename to examples/assets/index-Ch1tb-j6.js index 60f0d060d..306d42adc 100644 --- a/examples/assets/index-BaoxwJyW.js +++ b/examples/assets/index-Ch1tb-j6.js @@ -1,13 +1,13 @@ -var gv=Object.defineProperty;var vv=(s,e,t)=>e in s?gv(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var et=(s,e,t)=>(vv(s,typeof e!="symbol"?e+"":e,t),t);import{U as Pa,J as yv,p as Ev,s as bv,n as wv,u as zs,W as to,c as Iv,R as Cv,d as Hh}from"./index-b4ozRbQy.js";import{z as io,f as Ve,V as F,c as Ne,e as gt,A as mf,F as gf,P as an,r as Dt,p as Ke,M as le,T as Fn,E as vf,a as Ee,U as Yh,K as Fa,v as Vs,y as Gn,o as jn,Y as Ps,u as yf,C as Rt,d as Xt,Z as no,I as Kt,_ as On,B as ut,J as Ef,$ as bf,a0 as Gh,a1 as jh,a2 as Wh,a3 as Xh,a4 as cl,a5 as Kh,a6 as wf,a7 as hl,a8 as tn,k as za,a9 as If,aa as Cf,ab as Wn,N as Va,ac as ii,ad as Tv,ae as Qo,af as zr,X as Tf,h as so,ag as Oa,n as Xn,l as xf,m as ul,G as Fs,W as Ri,q as wt,g as st,L as Di,i as dl,ah as Ha,ai as Tt,O as kn,j as Si,aj as pl,ak as Qh,al as Zh,am as qh,an as xv,ao as Av,ap as Sv,aq as _v,Q as Vt,S as Rv,ar as ld,as as Pv,at as Fv,au as Ov,av as Mv,aw as Zo,ax as Lv,ay as pr,az as Dv,aA as Nv,aB as Kc,aC as xs,aD as Uv,D as kv,s as Af,x as Bv,H as Jh,t as zv,aE as fr,w as Ai,aF as Vv,aG as Hv,aH as Yv,aI as Gv,aJ as jv,aK as cd,aL as Wv,aM as Xv,aN as Kv,R as Sf,aO as Qv,aP as Zv,aQ as _f,aR as qv,aS as Jv,aT as Rf,aU as Pf,aV as Ff,aW as $v}from"./web-ifc-api-BC8YMRiS.js";import{a as hd,L as ey,b as ty}from"./Line2-7GsqoD5b.js";import{M as iy}from"./mark-Cj_PmUva.js";import"./import-wrapper-prod-LhqN7JJy.js";const al=class al{constructor(e,t){et(this,"scene");et(this,"onSelect",new Pa);et(this,"type");et(this,"selectCurve");et(this,"selectPoints");et(this,"hoverCurve");et(this,"hoverPoints");et(this,"caster",new io);this.scene=e,this.type=t,this.hoverCurve=this.newCurve(.003,4473924,!1),this.hoverPoints=this.newPoints(5,4473924),this.selectCurve=this.newCurve(.005,16777215,!0),this.selectPoints=this.newPoints(7,16777215)}dispose(){this.selectCurve&&this.scene.remove(this.selectCurve),this.selectCurve.material.dispose(),this.selectCurve.geometry.dispose(),this.selectCurve=null,this.hoverCurve.material.dispose(),this.hoverCurve.geometry.dispose(),this.hoverCurve=null,this.hoverPoints.material.dispose(),this.hoverPoints.geometry.dispose(),this.selectPoints.material.dispose(),this.selectPoints.geometry.dispose(),this.scene=null}castRay(e,t,i,n){const r=new Ve,o=i.getBoundingClientRect();r.x=(e.clientX-o.left)/o.width*2-1,r.y=-((e.clientY-o.top)/o.height)*2+1,this.caster.setFromCamera(r,t);const a=this.caster.intersectObjects(n);return a.length?a[0]:null}select(e){this.highlight(e,this.selectCurve,this.selectPoints,!0),this.onSelect.trigger(e)}unSelect(){this.selectCurve.removeFromParent(),this.selectPoints.removeFromParent()}hover(e){this.highlight(e,this.hoverCurve,this.hoverPoints,!1)}unHover(){this.hoverCurve.removeFromParent(),this.hoverPoints.removeFromParent()}setResolution({x:e,y:t}){this.selectCurve.material.resolution.set(e/t,1),this.hoverCurve.material.resolution.set(e/t,1)}highlight(e,t,i,n){const{alignment:r}=e.curve;this.scene.add(t),this.scene.add(i);const o=[],a=[],l=[];for(const f of r[this.type]){const g=f.mesh.geometry.attributes.position;for(const T of g.array)o.push(T);if(n){let T;if(this.type==="absolute"){const{horizontal:_}=f.alignment;T=_[f.index].data.TYPE}else T=f.data.TYPE;const S=al.settings.colors[T]||[1,1,1];for(let _=0;_t.geometry.attributes.position.count&&(t.geometry.dispose(),t.geometry=new hd),t.geometry.setPositions(o),n&&t.geometry.setColors(a),i.geometry.setFromPoints(l)}newCurve(e,t,i){const n=new hd,r=new ey({color:t,linewidth:e,vertexColors:i,worldUnits:!1,depthTest:!1}),o=new ty(n,r);return this.scene.add(o),o}newPoints(e,t){const i=new Ne,n=new gt(new Float32Array,3);i.setAttribute("position",n);const r=new mf({size:e,color:t,sizeAttenuation:!1,depthTest:!1}),o=new gf(i,r);return o.frustumCulled=!1,this.scene.add(o),o}};et(al,"settings",{colors:{LINE:[213/255,0/255,255/255],CIRCULARARC:[0/255,46,255/255],CLOTHOID:[0/255,255/255,0/255],PARABOLICARC:[0/255,255/255,72/255],CONSTANTGRADIENT:[213/255,0/255,255/255]}});let Qc=al;const ll=class ll extends yv{constructor(t){super(t);et(this,"onHighlight",new Pa);et(this,"enabled",!0);et(this,"_highlighter");et(this,"mouseMarkers");et(this,"onMarkerChange",new Pa);et(this,"onMarkerHidden",new Pa);et(this,"_curves",[]);et(this,"_world",null);et(this,"updateLinesResolution",t=>{var i;(i=this.highlighter)==null||i.setResolution(t)});et(this,"onClick",t=>{if(!this.enabled||!this._highlighter)return;if(!this.world)throw new Error("No world found!");if(!this.world.renderer)return;const i=this.world.renderer.three.domElement,n=this.world.camera.three,r=this._highlighter.castRay(t,n,i,this._curves);if(r){const o=r.object;this._highlighter.select(o),this.updateMarker(r,"select");const{point:a,index:l}=r;l!==void 0&&this.onHighlight.trigger({curve:o,point:a,index:l});return}this._highlighter.unSelect(),this.mouseMarkers&&(this.mouseMarkers.hover.visible=!1),this.onMarkerHidden.trigger({type:"hover"})});et(this,"onMouseMove",async t=>{if(!this.enabled||!this._highlighter)return;if(!this.world)throw new Error("No world found!");if(!this.world.renderer)return;const i=this.world.renderer.three.domElement,n=this.world.camera.three,r=this._highlighter.castRay(t,n,i,this._curves);if(r){this._highlighter.hover(r.object),this.updateMarker(r,"hover");return}this._highlighter.unHover()});this.components.add(ll.uuid,this)}get world(){return this._world}set world(t){var n,r,o;if(t===this._world||(this._world&&this.setupEvents(!1),this._world=t,(n=this._highlighter)==null||n.dispose(),(r=this.mouseMarkers)==null||r.hover.dispose(),(o=this.mouseMarkers)==null||o.select.dispose(),!t))return;const i=t.scene.three;this._highlighter=new Qc(i,"absolute"),this.mouseMarkers={select:this.newMouseMarker("#ffffff",t),hover:this.newMouseMarker("#575757",t)},this.setupEvents(!0)}get highlighter(){if(!this._highlighter)throw new Error("Navigator not initialized!");return this._highlighter}draw(t){if(!t.civilData)throw new Error("Model must have civil data!");if(!this.world)throw new Error("A world must be given before drawing an alignment!");const i=this.world.scene.three;for(const[n,r]of t.civilData.alignments)for(const{mesh:o}of r.absolute)i.add(o),this._curves.push(o)}newMouseMarker(t,i){const n=i.scene.three,r=document.createElement("div");r.style.backgroundColor=t,r.style.width="1rem",r.style.height="1rem",r.style.borderRadius="1rem";const o=new iy(i,r,n);return o.visible=!1,o}setMarker(t,i,n){if(!this.mouseMarkers)throw new Error("No mouse markers found! Initialize the world before using this.");const r=t.getPointAt(i,"absolute");this.mouseMarkers[n].visible=!0,this.mouseMarkers[n].three.position.copy(r)}hideMarker(t){if(!this.mouseMarkers)throw new Error("No mouse markers found! Initialize the world before using this.");const i=this.mouseMarkers[t].three;i.visible=!1}setupEvents(t){var n,r;if(!this.world)throw new Error("No world found!");if(!this.world.renderer)return;const i=this.world.renderer.three.domElement;(n=this.world.renderer)==null||n.onResize.remove(this.updateLinesResolution),i.removeEventListener("click",this.onClick),i.removeEventListener("mousemove",this.onMouseMove),t&&(i.addEventListener("click",this.onClick),i.addEventListener("mousemove",this.onMouseMove),(r=this.world.renderer)==null||r.onResize.add(this.updateLinesResolution))}updateMarker(t,i){if(!this.mouseMarkers)return;const{point:n,object:r}=t,o=r,a=o.curve,l=o.curve.alignment,h=l.getPercentageAt(n,"absolute");this.mouseMarkers[i].visible=!0,this.mouseMarkers[i].three.position.copy(n),h!==null&&this.onMarkerChange.trigger({alignment:l,percentage:h,type:i,curve:a})}};et(ll,"uuid","0a59c09e-2b49-474a-9320-99f51f40f182");let ud=ll;var ny=Object.defineProperty,sy=(s,e,t)=>e in s?ny(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,x=(s,e,t)=>(sy(s,typeof e!="symbol"?e+"":e,t),t),ry=Object.defineProperty,oy=(s,e,t)=>e in s?ry(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,A=(s,e,t)=>(oy(s,typeof e!="symbol"?e+"":e,t),t);const Of=0,ay=1,ly=2,dd=2,yc=1.25,pd=1,Ma=6*4+4+4,fl=65535,cy=Math.pow(2,-24),Ec=Symbol("SKIP_GENERATION");function hy(s){return s.index?s.index.count:s.attributes.position.count}function Hs(s){return hy(s)/3}function uy(s,e=ArrayBuffer){return s>65535?new Uint32Array(new e(4*s)):new Uint16Array(new e(2*s))}function dy(s,e){if(!s.index){const t=s.attributes.position.count,i=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,n=uy(t,i);s.setIndex(new gt(n,1));for(let r=0;ra-l);for(let a=0;ar.offset-o.offset),i=t[t.length-1];i.count=Math.min(e-i.offset,i.count);let n=0;return t.forEach(({count:r})=>n+=r),e!==n}function Je(s,e,t){return t.min.x=e[s],t.min.y=e[s+1],t.min.z=e[s+2],t.max.x=e[s+3],t.max.y=e[s+4],t.max.z=e[s+5],t}function fy(s){s[0]=s[1]=s[2]=1/0,s[3]=s[4]=s[5]=-1/0}function fd(s){let e=-1,t=-1/0;for(let i=0;i<3;i++){const n=s[i+3]-s[i];n>t&&(t=n,e=i)}return e}function md(s,e){e.set(s)}function gd(s,e,t){let i,n;for(let r=0;r<3;r++){const o=r+3;i=s[r],n=e[r],t[r]=in?i:n}}function qo(s,e,t){for(let i=0;i<3;i++){const n=e[s+2*i],r=e[s+2*i+1],o=n-r,a=n+r;ot[i+3]&&(t[i+3]=a)}}function mr(s){const e=s[3]-s[0],t=s[4]-s[1],i=s[5]-s[2];return 2*(e*t+t*i+i*e)}function bc(s,e,t,i,n=null){let r=1/0,o=1/0,a=1/0,l=-1/0,h=-1/0,d=-1/0,p=1/0,f=1/0,g=1/0,y=-1/0,b=-1/0,w=-1/0;const T=n!==null;for(let S=e*6,_=(e+t)*6;S<_;S+=6){const I=s[S+0],P=s[S+1],M=I-P,k=I+P;Ml&&(l=k),T&&Iy&&(y=I);const V=s[S+2],W=s[S+3],j=V-W,Q=V+W;jh&&(h=Q),T&&Vb&&(b=V);const $=s[S+4],ne=s[S+5],oe=$-ne,ve=$+ne;oed&&(d=ve),T&&$w&&(w=$)}i[0]=r,i[1]=o,i[2]=a,i[3]=l,i[4]=h,i[5]=d,T&&(n[0]=p,n[1]=f,n[2]=g,n[3]=y,n[4]=b,n[5]=w)}function my(s,e,t,i){let n=1/0,r=1/0,o=1/0,a=-1/0,l=-1/0,h=-1/0;for(let d=e*6,p=(e+t)*6;da&&(a=f);const g=s[d+2];gl&&(l=g);const y=s[d+4];yh&&(h=y)}i[0]=n,i[1]=r,i[2]=o,i[3]=a,i[4]=l,i[5]=h}function gy(s,e){fy(e);const t=s.attributes.position,i=s.index?s.index.array:null,n=Hs(s),r=new Float32Array(n*6),o=t.normalized,a=t.array,l=t.offset||0;let h=3;t.isInterleavedBufferAttribute&&(h=t.data.stride);const d=["getX","getY","getZ"];for(let p=0;pM&&(M=_),I>M&&(M=I);const k=(M-P)/2,V=T*2;r[g+V+0]=P+k,r[g+V+1]=k+(Math.abs(P)+k)*cy,Pe[T+3]&&(e[T+3]=M)}}return r}const Ti=32,vy=(s,e)=>s.candidate-e.candidate,Xi=new Array(Ti).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),Jo=new Float32Array(6);function yy(s,e,t,i,n,r){let o=-1,a=0;if(r===Of)o=fd(e),o!==-1&&(a=(e[o]+e[o+3])/2);else if(r===ay)o=fd(s),o!==-1&&(a=Ey(t,i,n,o));else if(r===ly){const l=mr(s);let h=yc*n;const d=i*6,p=(i+n)*6;for(let f=0;f<3;f++){const g=e[f],y=(e[f+3]-g)/Ti;if(n=P.candidate?qo(S,t,P.rightCacheBounds):(qo(S,t,P.leftCacheBounds),P.count++)}}for(let S=0;S=Ti&&(S=Ti-1);const _=Xi[S];_.count++,qo(T,t,_.bounds)}const b=Xi[Ti-1];md(b.bounds,b.rightCacheBounds);for(let T=Ti-2;T>=0;T--){const S=Xi[T],_=Xi[T+1];gd(S.bounds,_.rightCacheBounds,S.rightCacheBounds)}let w=0;for(let T=0;T=l;)a--;if(o=l;)a--;if(o2**16,n=i?4:2,r=e?new SharedArrayBuffer(t*n):new ArrayBuffer(t*n),o=i?new Uint32Array(r):new Uint16Array(r);for(let a=0,l=o.length;a=n&&(p=!0,r&&(console.warn(`MeshBVH: Max depth of ${n} reached when generating BVH. Consider increasing maxDepth.`),console.warn(t))),M<=o||V>=n)return S(P+M),I.offset=P,I.count=M,I;const W=yy(I.boundingData,k,y,P,M,a);if(W.axis===-1)return S(P+M),I.offset=P,I.count=M,I;const j=b(d,i,y,P,M,W);if(j===P||j===P+M)S(P+M),I.offset=P,I.count=M;else{I.splitAxis=W.axis;const Q=new $o,$=P,ne=j-P;I.left=Q,Q.boundingData=new Float32Array(6),bc(y,$,ne,Q.boundingData,g),_(Q,$,ne,g,V+1);const oe=new $o,ve=j,re=M-ne;I.right=oe,oe.boundingData=new Float32Array(6),bc(y,ve,re,oe.boundingData,g),_(oe,ve,re,g,V+1)}return I}}function Ty(s,e){const t=s.geometry;e.indirect&&(s._indirectBuffer=Iy(t,e.useSharedArrayBuffer),py(t)&&!e.verbose&&console.warn('MeshBVH: Provided geometry contains groups that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.')),s._indirectBuffer||dy(t,e);const i=Cy(s,e);let n,r,o;const a=[],l=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let p=0;pMath.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return r[g+6]=I/4,I=d(I,S),r[g+7]=_,I}}}let Fi=class{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let i=1/0,n=-1/0;for(let r=0,o=e.length;rn?a:n}this.min=i,this.max=n}setFromPoints(e,t){let i=1/0,n=-1/0;for(let r=0,o=t.length;rn?l:n}this.min=i,this.max=n}isSeparated(e){return this.min>e.max||e.min>this.max}};Fi.prototype.setFromBox=function(){const s=new F;return function(e,t){const i=t.min,n=t.max;let r=1/0,o=-1/0;for(let a=0;a<=1;a++)for(let l=0;l<=1;l++)for(let h=0;h<=1;h++){s.x=i.x*a+n.x*(1-a),s.y=i.y*l+n.y*(1-l),s.z=i.z*h+n.z*(1-h);const d=e.dot(s);r=Math.min(d,r),o=Math.max(d,o)}this.min=r,this.max=o}}();const xy=function(){const s=new F,e=new F,t=new F;return function(i,n,r){const o=i.start,a=s,l=n.start,h=e;t.subVectors(o,l),s.subVectors(i.end,i.start),e.subVectors(n.end,n.start);const d=t.dot(h),p=h.dot(a),f=h.dot(h),g=t.dot(a),y=a.dot(a)*f-p*p;let b,w;y!==0?b=(d*p-g*f)/y:b=0,w=(d+b*p)/f,r.x=b,r.y=w}}(),$h=function(){const s=new Ve,e=new F,t=new F;return function(i,n,r,o){xy(i,n,s);let a=s.x,l=s.y;if(a>=0&&a<=1&&l>=0&&l<=1){i.at(a,r),n.at(l,o);return}else if(a>=0&&a<=1){l<0?n.at(0,o):n.at(1,o),i.closestPointToPoint(o,!0,r);return}else if(l>=0&&l<=1){a<0?i.at(0,r):i.at(1,r),n.closestPointToPoint(r,!0,o);return}else{let h;a<0?h=i.start:h=i.end;let d;l<0?d=n.start:d=n.end;const p=e,f=t;if(i.closestPointToPoint(d,!0,e),n.closestPointToPoint(h,!0,t),p.distanceToSquared(d)<=f.distanceToSquared(h)){r.copy(p),o.copy(d);return}else{r.copy(h),o.copy(f);return}}}}(),Ay=function(){const s=new F,e=new F,t=new an,i=new Dt;return function(n,r){const{radius:o,center:a}=n,{a:l,b:h,c:d}=r;if(i.start=l,i.end=h,i.closestPointToPoint(a,!0,s).distanceTo(a)<=o||(i.start=l,i.end=d,i.closestPointToPoint(a,!0,s).distanceTo(a)<=o)||(i.start=h,i.end=d,i.closestPointToPoint(a,!0,s).distanceTo(a)<=o))return!0;const p=r.getPlane(t);if(Math.abs(p.distanceToPoint(a))<=o){const f=p.projectPoint(a,e);if(r.containsPoint(f))return!0}return!1}}(),Sy=1e-15;function wc(s){return Math.abs(s)new F),this.satBounds=new Array(4).fill().map(()=>new Fi),this.points=[this.a,this.b,this.c],this.sphere=new Gn,this.plane=new an,this.needsUpdate=!0}intersectsSphere(e){return Ay(e,this)}update(){const e=this.a,t=this.b,i=this.c,n=this.points,r=this.satAxes,o=this.satBounds,a=r[0],l=o[0];this.getNormal(a),l.setFromPoints(a,n);const h=r[1],d=o[1];h.subVectors(e,t),d.setFromPoints(h,n);const p=r[2],f=o[2];p.subVectors(t,i),f.setFromPoints(p,n);const g=r[3],y=o[3];g.subVectors(i,e),y.setFromPoints(g,n),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(a,e),this.needsUpdate=!1}};si.prototype.closestPointToSegment=function(){const s=new F,e=new F,t=new Dt;return function(i,n=null,r=null){const{start:o,end:a}=i,l=this.points;let h,d=1/0;for(let p=0;p<3;p++){const f=(p+1)%3;t.start.copy(l[p]),t.end.copy(l[f]),$h(t,i,s,e),h=s.distanceToSquared(e),h=2){(I===1?T.start:T.end).copy(g),_=2;break}if(_++,_===2&&I===-1)break}}return _}return function(b,w=null,T=!1){this.needsUpdate&&this.update(),b.isExtendedTriangle?b.needsUpdate&&b.update():(s.copy(b),s.update(),b=s);const S=this.plane,_=b.plane;if(Math.abs(S.normal.dot(_.normal))>1-1e-10){const I=this.satBounds,P=this.satAxes;t[0]=b.a,t[1]=b.b,t[2]=b.c;for(let V=0;V<4;V++){const W=I[V],j=P[V];if(i.setFromPoints(j,t),W.isSeparated(i))return!1}const M=b.satBounds,k=b.satAxes;e[0]=this.a,e[1]=this.b,e[2]=this.c;for(let V=0;V<4;V++){const W=M[V],j=k[V];if(i.setFromPoints(j,e),W.isSeparated(i))return!1}for(let V=0;V<4;V++){const W=P[V];for(let j=0;j<4;j++){const Q=k[j];if(r.crossVectors(W,Q),i.setFromPoints(r,e),n.setFromPoints(r,t),i.isSeparated(n))return!1}}return w&&(T||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),w.start.set(0,0,0),w.end.set(0,0,0)),!0}else{const I=y(this,_,p);if(I===1&&b.containsPoint(p.end))return w&&(w.start.copy(p.end),w.end.copy(p.end)),!0;if(I!==2)return!1;const P=y(b,S,f);if(P===1&&this.containsPoint(f.end))return w&&(w.start.copy(f.end),w.end.copy(f.end)),!0;if(P!==2)return!1;if(p.delta(a),f.delta(l),a.dot(l)<0){let $=f.start;f.start=f.end,f.end=$}const M=p.start.dot(a),k=p.end.dot(a),V=f.start.dot(a),W=f.end.dot(a),j=k0?w.start.copy(p.start):w.start.copy(f.start),h.subVectors(p.end,f.end),h.dot(a)<0?w.end.copy(p.end):w.end.copy(f.end)),!0)}}}();si.prototype.distanceToPoint=function(){const s=new F;return function(e){return this.closestPointToPoint(e,s),e.distanceTo(s)}}();si.prototype.distanceToTriangle=function(){const s=new F,e=new F,t=["a","b","c"],i=new Dt,n=new Dt;return function(r,o=null,a=null){const l=o||a?i:null;if(this.intersectsTriangle(r,l))return(o||a)&&(o&&l.getCenter(o),a&&l.getCenter(a)),0;let h=1/0;for(let d=0;d<3;d++){let p;const f=t[d],g=r[f];this.closestPointToPoint(g,s),p=g.distanceToSquared(s),pnew F),this.satAxes=new Array(3).fill().map(()=>new F),this.satBounds=new Array(3).fill().map(()=>new Fi),this.alignedSatBounds=new Array(3).fill().map(()=>new Fi),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),i&&this.matrix.copy(i)}set(e,t,i){this.min.copy(e),this.max.copy(t),this.matrix.copy(i),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}};xt.prototype.update=function(){return function(){const s=this.matrix,e=this.min,t=this.max,i=this.points;for(let l=0;l<=1;l++)for(let h=0;h<=1;h++)for(let d=0;d<=1;d++){const p=1*l|2*h|4*d,f=i[p];f.x=l?t.x:e.x,f.y=h?t.y:e.y,f.z=d?t.z:e.z,f.applyMatrix4(s)}const n=this.satBounds,r=this.satAxes,o=i[0];for(let l=0;l<3;l++){const h=r[l],d=n[l],p=1<new Dt),t=new Array(12).fill().map(()=>new Dt),i=new F,n=new F;return function(r,o=0,a=null,l=null){if(this.needsUpdate&&this.update(),this.intersectsBox(r))return(a||l)&&(r.getCenter(n),this.closestPointToPoint(n,i),r.closestPointToPoint(i,n),a&&a.copy(i),l&&l.copy(n)),0;const h=o*o,d=r.min,p=r.max,f=this.points;let g=1/0;for(let b=0;b<8;b++){const w=f[b];n.copy(w).clamp(d,p);const T=w.distanceToSquared(n);if(Tnew si)}}const Yt=new _y;function Ot(s,e){return e[s+15]===65535}function Lt(s,e){return e[s+6]}function Gt(s,e){return e[s+14]}function jt(s){return s+8}function Wt(s,e){return e[s+6]}function Df(s,e){return e[s+7]}class Ry{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const e=[];let t=null;this.setBuffer=i=>{t&&e.push(t),t=i,this.float32Array=new Float32Array(i),this.uint16Array=new Uint16Array(i),this.uint32Array=new Uint32Array(i)},this.clearBuffer=()=>{t=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,e.length!==0&&this.setBuffer(e.pop())}}}const Qe=new Ry;let Ji,As;const os=[],ea=new eu(()=>new Ke);function Py(s,e,t,i,n,r){Ji=ea.getPrimitive(),As=ea.getPrimitive(),os.push(Ji,As),Qe.setBuffer(s._roots[e]);const o=Zc(0,s.geometry,t,i,n,r);Qe.clearBuffer(),ea.releasePrimitive(Ji),ea.releasePrimitive(As),os.pop(),os.pop();const a=os.length;return a>0&&(As=os[a-1],Ji=os[a-2]),o}function Zc(s,e,t,i,n=null,r=0,o=0){const{float32Array:a,uint16Array:l,uint32Array:h}=Qe;let d=s*2;if(Ot(d,l)){const p=Lt(s,h),f=Gt(d,l);return Je(s,a,Ji),i(p,f,!1,o,r+s,Ji)}else{let p=function(Q){const{uint16Array:$,uint32Array:ne}=Qe;let oe=Q*2;for(;!Ot(oe,$);)Q=jt(Q),oe=Q*2;return Lt(Q,ne)},f=function(Q){const{uint16Array:$,uint32Array:ne}=Qe;let oe=Q*2;for(;!Ot(oe,$);)Q=Wt(Q,ne),oe=Q*2;return Lt(Q,ne)+Gt(oe,$)};const g=jt(s),y=Wt(s,h);let b=g,w=y,T,S,_,I;if(n&&(_=Ji,I=As,Je(b,a,_),Je(w,a,I),T=n(_),S=n(I),S(gr.copy(e).clamp(d.min,d.max),gr.distanceToSquared(e)),intersectsBounds:(d,p,f)=>f{d.closestPointToPoint(e,gr);const f=e.distanceToSquared(gr);return f0&&h.normal.multiplyScalar(-1));const d={a:r,b:o,c:a,normal:new F,materialIndex:0};Fn.getNormal(as,ls,cs,d.normal),h.face=d,h.faceIndex=r}return h}function ml(s,e,t,i,n){const r=i*3;let o=r+0,a=r+1,l=r+2;const h=s.index;s.index&&(o=h.getX(o),a=h.getX(a),l=h.getX(l));const{position:d,normal:p,uv:f,uv1:g}=s.attributes,y=My(t,d,p,f,g,o,a,l,e);return y?(y.faceIndex=i,n&&n.push(y),y):null}function ot(s,e,t,i){const n=s.a,r=s.b,o=s.c;let a=e,l=e+1,h=e+2;t&&(a=t.getX(a),l=t.getX(l),h=t.getX(h)),n.x=i.getX(a),n.y=i.getY(a),n.z=i.getZ(a),r.x=i.getX(l),r.y=i.getY(l),r.z=i.getZ(l),o.x=i.getX(h),o.y=i.getY(h),o.z=i.getZ(h)}function Ly(s,e,t,i,n,r){const{geometry:o,_indirectBuffer:a}=s;for(let l=i,h=i+n;lP&&(P=Q),$<_&&(_=$),$>M&&(M=$),nek&&(k=ne)}return l[f+0]!==S||l[f+1]!==_||l[f+2]!==I||l[f+3]!==P||l[f+4]!==M||l[f+5]!==k?(l[f+0]=S,l[f+1]=_,l[f+2]=I,l[f+3]=P,l[f+4]=M,l[f+5]=k,!0):!1}else{const w=f+8,T=o[f+6],S=w+g,_=T+g;let I=y,P=!1,M=!1;e?I||(P=e.has(S),M=e.has(_),I=!P&&!M):(P=!0,M=!0);const k=I||P,V=I||M;let W=!1;k&&(W=p(w,g,I));let j=!1;V&&(j=p(T,g,I));const Q=W||j;if(Q)for(let $=0;$<3;$++){const ne=w+$,oe=T+$,ve=l[ne],re=l[ne+3],ge=l[oe],me=l[oe+3];l[f+$]=veme?re:me}return Q}}}const bd=new Ke;function nn(s,e,t,i){return Je(s,e,bd),t.intersectBox(bd,i)}function ky(s,e,t,i,n,r){const{geometry:o,_indirectBuffer:a}=s;for(let l=i,h=i+n;l=0;let p,f;d?(p=jt(s),f=Wt(s,o)):(p=Wt(s,o),f=jt(s));const g=nn(p,n,i,Id)?Jc(p,e,t,i):null;if(g){const b=g.point[h];if(d?b<=n[f+l]:b>=n[f+l+3])return g}const y=nn(f,n,i,Id)?Jc(f,e,t,i):null;return g&&y?g.distance<=y.distance?g:y:g||y||null}}const ra=new Ke,hs=new si,us=new si,vr=new Ee,Cd=new xt,oa=new xt;function Gy(s,e,t,i){Qe.setBuffer(s._roots[e]);const n=$c(0,s,t,i);return Qe.clearBuffer(),n}function $c(s,e,t,i,n=null){const{float32Array:r,uint16Array:o,uint32Array:a}=Qe;let l=s*2;if(n===null&&(t.boundingBox||t.computeBoundingBox(),Cd.set(t.boundingBox.min,t.boundingBox.max,i),n=Cd),Ot(l,o)){const h=e.geometry,d=h.index,p=h.attributes.position,f=t.index,g=t.attributes.position,y=Lt(s,a),b=Gt(l,o);if(vr.copy(i).invert(),t.boundsTree)return Je(s,r,oa),oa.matrix.copy(vr),oa.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:w=>oa.intersectsBox(w),intersectsTriangle:w=>{w.a.applyMatrix4(i),w.b.applyMatrix4(i),w.c.applyMatrix4(i),w.needsUpdate=!0;for(let T=y*3,S=(b+y)*3;TCc.distanceToBox(P),intersectsBounds:(P,M,k)=>k{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:k=>yr.distanceToBox(k),intersectsBounds:(k,V,W)=>W{for(let W=k,j=k+V;WP&&(P=ne),oe<_&&(_=oe),oe>M&&(M=oe),vek&&(k=ve)}}return l[f+0]!==S||l[f+1]!==_||l[f+2]!==I||l[f+3]!==P||l[f+4]!==M||l[f+5]!==k?(l[f+0]=S,l[f+1]=_,l[f+2]=I,l[f+3]=P,l[f+4]=M,l[f+5]=k,!0):!1}else{const w=f+8,T=o[f+6],S=w+g,_=T+g;let I=y,P=!1,M=!1;e?I||(P=e.has(S),M=e.has(_),I=!P&&!M):(P=!0,M=!0);const k=I||P,V=I||M;let W=!1;k&&(W=p(w,g,I));let j=!1;V&&(j=p(T,g,I));const Q=W||j;if(Q)for(let $=0;$<3;$++){const ne=w+$,oe=T+$,ve=l[ne],re=l[ne+3],ge=l[oe],me=l[oe+3];l[f+$]=veme?re:me}return Q}}}const Td=new F;function qy(s,e,t,i,n){Qe.setBuffer(s._roots[e]),eh(0,s,t,i,n),Qe.clearBuffer()}function eh(s,e,t,i,n){const{float32Array:r,uint16Array:o,uint32Array:a}=Qe,l=s*2;if(Ot(l,o)){const h=Lt(s,a),d=Gt(l,o);ky(e,t,i,h,d,n)}else{const h=jt(s);nn(h,r,i,Td)&&eh(h,e,t,i,n);const d=Wt(s,a);nn(d,r,i,Td)&&eh(d,e,t,i,n)}}const xd=new F,Jy=["x","y","z"];function $y(s,e,t,i){Qe.setBuffer(s._roots[e]);const n=th(0,s,t,i);return Qe.clearBuffer(),n}function th(s,e,t,i){const{float32Array:n,uint16Array:r,uint32Array:o}=Qe;let a=s*2;if(Ot(a,r)){const l=Lt(s,o),h=Gt(a,r);return By(e,t,i,l,h)}else{const l=Df(s,o),h=Jy[l],d=i.direction[h]>=0;let p,f;d?(p=jt(s),f=Wt(s,o)):(p=Wt(s,o),f=jt(s));const g=nn(p,n,i,xd)?th(p,e,t,i):null;if(g){const b=g.point[h];if(d?b<=n[f+l]:b>=n[f+l+3])return g}const y=nn(f,n,i,xd)?th(f,e,t,i):null;return g&&y?g.distance<=y.distance?g:y:g||y||null}}const la=new Ke,ds=new si,ps=new si,Er=new Ee,Ad=new xt,ca=new xt;function e1(s,e,t,i){Qe.setBuffer(s._roots[e]);const n=ih(0,s,t,i);return Qe.clearBuffer(),n}function ih(s,e,t,i,n=null){const{float32Array:r,uint16Array:o,uint32Array:a}=Qe;let l=s*2;if(n===null&&(t.boundingBox||t.computeBoundingBox(),Ad.set(t.boundingBox.min,t.boundingBox.max,i),n=Ad),Ot(l,o)){const h=e.geometry,d=h.index,p=h.attributes.position,f=t.index,g=t.attributes.position,y=Lt(s,a),b=Gt(l,o);if(Er.copy(i).invert(),t.boundsTree)return Je(s,r,ca),ca.matrix.copy(Er),ca.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:w=>ca.intersectsBox(w),intersectsTriangle:w=>{w.a.applyMatrix4(i),w.b.applyMatrix4(i),w.c.applyMatrix4(i),w.needsUpdate=!0;for(let T=y,S=b+y;TTc.distanceToBox(P),intersectsBounds:(P,M,k)=>k{if(e.boundsTree){const k=e.boundsTree;return k.shapecast({boundsTraverseOrder:V=>br.distanceToBox(V),intersectsBounds:(V,W,j)=>j{for(let j=V,Q=V+W;jnew Ke),fs=new Ke,ms=new Ke,xc=new Ke,Ac=new Ke;let Sc=!1;function a1(s,e,t,i){if(Sc)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");Sc=!0;const n=s._roots,r=e._roots;let o,a=0,l=0;const h=new Ee().copy(t).invert();for(let d=0,p=n.length;dl.slice()),index:o.array.slice(),indirectBuffer:r?r.slice():null}:a={roots:n,index:o.array,indirectBuffer:r},a}static deserialize(e,t,i={}){i={setIndex:!0,indirect:!!e.indirectBuffer,...i};const{index:n,roots:r,indirectBuffer:o}=e,a=new Nf(t,{...i,[Ec]:!0});if(a._roots=r,a._indirectBuffer=o||null,i.setIndex){const l=t.getIndex();if(l===null){const h=new gt(e.index,1,!1);t.setIndex(h)}else l.array!==n&&(l.array.set(n),l.needsUpdate=!0)}return a}get indirect(){return!!this._indirectBuffer}constructor(e,t={}){if(e.isBufferGeometry){if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");if(t=Object.assign({strategy:Of,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[Ec]:!1},t),t.useSharedArrayBuffer&&!o1())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=e,this._roots=null,this._indirectBuffer=null,t[Ec]||(Ty(this,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new Ke)));const{_indirectBuffer:i}=this;this.resolveTriangleIndex=t.indirect?n=>i[n]:n=>n}refit(e=null){return(this.indirect?Zy:Uy)(this,e)}traverse(e,t=0){const i=this._roots[t],n=new Uint32Array(i),r=new Uint16Array(i);o(0);function o(a,l=0){const h=a*2,d=r[h+15]===fl;if(d){const p=n[a+6],f=r[h+14];e(l,d,new Float32Array(i,a*4,6),p,f)}else{const p=a+Ma/4,f=n[a+6],g=n[a+7];e(l,d,new Float32Array(i,a*4,6),g)||(o(p,l+1),o(f,l+1))}}}raycast(e,t=ld){const i=this._roots,n=this.geometry,r=[],o=t.isMaterial,a=Array.isArray(t),l=n.groups,h=o?t.side:t,d=this.indirect?qy:Vy;for(let p=0,f=i.length;pp(f,g,y,b,w)?!0:i(f,g,this,a,y,b,t)}else o||(a?o=(p,f,g,y)=>i(p,f,this,a,g,y,t):o=(p,f,g)=>g);let l=!1,h=0;const d=this._roots;for(let p=0,f=d.length;p{const b=this.resolveTriangleIndex(y);ot(o,b*3,a,l)}:y=>{ot(o,y*3,a,l)},d=Yt.getPrimitive(),p=e.geometry.index,f=e.geometry.attributes.position,g=e.indirect?y=>{const b=e.resolveTriangleIndex(y);ot(d,b*3,p,f)}:y=>{ot(d,y*3,p,f)};if(r){const y=(b,w,T,S,_,I,P,M)=>{for(let k=T,V=T+S;kua.intersectsBox(i),intersectsTriangle:i=>ua.intersectsTriangle(i)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,i={},n={},r=0,o=1/0){return(this.indirect?r1:Qy)(this,e,t,i,n,r,o)}closestPointToPoint(e,t={},i=0,n=1/0){return Fy(this,e,t,i,n)}getBoundingBox(e){return e.makeEmpty(),this._roots.forEach(t=>{Je(0,new Float32Array(t),Sd),e.union(Sd)}),e}};function _d(s,e,t){return s===null||(s.point.applyMatrix4(e.matrixWorld),s.distance=s.point.distanceTo(t.ray.origin),s.object=e,s.distancet.far)?null:s}const _c=new Pv,Rd=new Ee,c1=le.prototype.raycast;function h1(s,e){if(this.geometry.boundsTree){if(this.material===void 0)return;Rd.copy(this.matrixWorld).invert(),_c.copy(s.ray).applyMatrix4(Rd);const t=this.geometry.boundsTree;if(s.firstHitOnly===!0){const i=_d(t.raycastFirst(_c,this.material),this,s);i&&e.push(i)}else{const i=t.raycast(_c,this.material);for(let n=0,r=i.length;n{const t=this.handlers.slice(0);for(const i of t)i(e)}),A(this,"handlers",[])}add(e){this.handlers.push(e)}remove(e){this.handlers=this.handlers.filter(t=>t!==e)}reset(){this.handlers.length=0}}let $i=class{constructor(){A(this,"trigger",async e=>{const t=this.handlers.slice(0);for(const i of t)await i(e)}),A(this,"handlers",[])}add(e){this.handlers.push(e)}remove(e){this.handlers=this.handlers.filter(t=>t!==e)}reset(){this.handlers.length=0}},tu=class{constructor(e){A(this,"isDisposeable",()=>"dispose"in this&&"onDisposed"in this),A(this,"isResizeable",()=>"resize"in this&&"getSize"in this),A(this,"isUpdateable",()=>"onAfterUpdate"in this&&"onBeforeUpdate"in this&&"update"in this),A(this,"isHideable",()=>"visible"in this),A(this,"isConfigurable",()=>"setup"in this&&"config"in this&&"onSetup"in this),this.components=e}},Re=class extends tu{},Uf=class extends tu{constructor(e){super(e),A(this,"worlds",new Map),A(this,"onWorldChanged",new ee),A(this,"currentWorld",null),this.onWorldChanged.add(({world:t,action:i})=>{i==="removed"&&this.worlds.delete(t.uuid)})}};class p1 extends Uf{constructor(){super(...arguments),A(this,"hasCameraControls",()=>"controls"in this)}}class f1 extends Uf{constructor(){super(...arguments),A(this,"onAfterUpdate",new ee),A(this,"onBeforeUpdate",new ee),A(this,"onDisposed",new ee),A(this,"onResize",new ee),A(this,"onClippingPlanesUpdated",new ee),A(this,"clippingPlanes",[])}updateClippingPlanes(){this.onClippingPlanesUpdated.trigger()}setPlane(e,t,i){t.isLocal=i;const n=this.clippingPlanes.indexOf(t);e&&n===-1?this.clippingPlanes.push(t):!e&&n>-1&&this.clippingPlanes.splice(n,1),this.three.clippingPlanes=this.clippingPlanes.filter(r=>!r.isLocal)}}const kf=class nh extends Re{constructor(e){super(e),A(this,"_disposedComponents",new Set),A(this,"enabled",!0),e.add(nh.uuid,this)}get(){return this._disposedComponents}destroy(e,t=!0,i=!0){e.removeFromParent();const n=e;n.dispose&&n.dispose(),this.disposeGeometryAndMaterials(e,t),i&&n.children&&n.children.length&&this.disposeChildren(n),e.children.length=0}disposeGeometry(e){const t=e;t.boundsTree&&t.disposeBoundsTree(),e.dispose()}disposeGeometryAndMaterials(e,t){const i=e;i.geometry&&this.disposeGeometry(i.geometry),t&&i.material&&nh.disposeMaterial(i),i.material=[],i.geometry=null}disposeChildren(e){for(const t of e.children)this.destroy(t)}static disposeMaterial(e){if(e.material)if(Array.isArray(e.material))for(const t of e.material)t.dispose();else e.material.dispose()}};A(kf,"uuid","76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");let Oi=kf;const La=0,m1=1,g1=new F,Pd=new Dt,Rc=new an,Fd=new F,da=new Fn;class v1{constructor(){this.tolerance=-1,this.faces=[],this.newFaces=[],this.assigned=new Od,this.unassigned=new Od,this.vertices=[]}setFromPoints(e){if(e.length>=4){this.makeEmpty();for(let t=0,i=e.length;tthis.tolerance)return!1;return!0}intersectRay(e,t){const i=this.faces;let n=-1/0,r=1/0;for(let o=0,a=i.length;o0&&d>=0)return null;const p=d!==0?-h/d:0;if(!(p<=0)&&(d>0?r=Math.min(p,r):n=Math.max(p,n),n>r))return null}return n!==-1/0?e.at(n,t):e.at(r,t),t}intersectsRay(e){return this.intersectRay(e,g1)!==null}makeEmpty(){return this.faces=[],this.vertices=[],this}addVertexToFace(e,t){return e.face=t,t.outside===null?this.assigned.append(e):this.assigned.insertBefore(t.outside,e),t.outside=e,this}removeVertexFromFace(e,t){return e===t.outside&&(e.next!==null&&e.next.face===t?t.outside=e.next:t.outside=null),this.assigned.remove(e),this}removeAllVerticesFromFace(e){if(e.outside!==null){const t=e.outside;let i=e.outside;for(;i.next!==null&&i.next.face===e;)i=i.next;return this.assigned.removeSubList(t,i),t.prev=i.next=null,e.outside=null,t}}deleteFaceVertices(e,t){const i=this.removeAllVerticesFromFace(e);if(i!==void 0)if(t===void 0)this.unassigned.appendChain(i);else{let n=i;do{const r=n.next;t.distanceToPoint(n.point)>this.tolerance?this.addVertexToFace(n,t):this.unassigned.append(n),n=r}while(n!==null)}return this}resolveUnassignedPoints(e){if(this.unassigned.isEmpty()===!1){let t=this.unassigned.first();do{const i=t.next;let n=this.tolerance,r=null;for(let o=0;on&&(n=l,r=a),n>1e3*this.tolerance)break}}r!==null&&this.addVertexToFace(t,r),t=i}while(t!==null)}return this}computeExtremes(){const e=new F,t=new F,i=[],n=[];for(let r=0;r<3;r++)i[r]=n[r]=this.vertices[0];e.copy(this.vertices[0].point),t.copy(this.vertices[0].point);for(let r=0,o=this.vertices.length;rt.getComponent(h)&&(t.setComponent(h,l.getComponent(h)),n[h]=a)}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(e.x),Math.abs(t.x))+Math.max(Math.abs(e.y),Math.abs(t.y))+Math.max(Math.abs(e.z),Math.abs(t.z))),{min:i,max:n}}computeInitialHull(){const e=this.vertices,t=this.computeExtremes(),i=t.min,n=t.max;let r=0,o=0;for(let f=0;f<3;f++){const g=n[f].point.getComponent(f)-i[f].point.getComponent(f);g>r&&(r=g,o=f)}const a=i[o],l=n[o];let h,d;r=0,Pd.set(a.point,l.point);for(let f=0,g=this.vertices.length;fr&&(r=b,h=y)}}r=-1,Rc.setFromCoplanarPoints(a.point,l.point,h.point);for(let f=0,g=this.vertices.length;fr&&(r=b,d=y)}}const p=[];if(Rc.distanceToPoint(d.point)<0){p.push(Ci.create(a,l,h),Ci.create(d,l,a),Ci.create(d,h,l),Ci.create(d,a,h));for(let f=0;f<3;f++){const g=(f+1)%3;p[f+1].getEdge(2).setTwin(p[0].getEdge(g)),p[f+1].getEdge(1).setTwin(p[g+1].getEdge(0))}}else{p.push(Ci.create(a,h,l),Ci.create(d,a,l),Ci.create(d,l,h),Ci.create(d,h,a));for(let f=0;f<3;f++){const g=(f+1)%3;p[f+1].getEdge(2).setTwin(p[0].getEdge((3-f)%3)),p[f+1].getEdge(0).setTwin(p[g+1].getEdge(1))}}for(let f=0;f<4;f++)this.faces.push(p[f]);for(let f=0,g=e.length;fr&&(r=T,b=this.faces[w])}b!==null&&this.addVertexToFace(y,b)}}return this}reindexFaces(){const e=[];for(let t=0;tt&&(t=r,e=n),n=n.next}while(n!==null&&n.face===i);return e}}computeHorizon(e,t,i,n){this.deleteFaceVertices(i),i.mark=m1;let r;t===null?r=t=i.getEdge(0):r=t.next;do{const o=r.twin,a=o.face;a.mark===La&&(a.distanceToPoint(e)>this.tolerance?this.computeHorizon(e,o,a,n):n.push(r)),r=r.next}while(r!==t);return this}addAdjoiningFace(e,t){const i=Ci.create(e,t.tail(),t.head());return this.faces.push(i),i.getEdge(-1).setTwin(t.twin),i.getEdge(0)}addNewFaces(e,t){this.newFaces=[];let i=null,n=null;for(let r=0;r0;)t=t.next,e--;for(;e<0;)t=t.prev,e++;return t}compute(){const e=this.edge.tail(),t=this.edge.head(),i=this.edge.next.head();return da.set(e.point,t.point,i.point),da.getNormal(this.normal),da.getMidpoint(this.midpoint),this.area=da.getArea(),this.constant=this.normal.dot(this.midpoint),this}distanceToPoint(e){return this.normal.dot(e)-this.constant}},Pc=class{constructor(e,t){this.vertex=e,this.prev=null,this.next=null,this.twin=null,this.face=t}head(){return this.vertex}tail(){return this.prev?this.prev.vertex:null}length(){const e=this.head(),t=this.tail();return t!==null?t.point.distanceTo(e.point):-1}lengthSquared(){const e=this.head(),t=this.tail();return t!==null?t.point.distanceToSquared(e.point):-1}setTwin(e){return this.twin=e,e.twin=this,this}};class y1{constructor(e){this.point=e,this.prev=null,this.next=null,this.face=null}}let Od=class{constructor(){this.head=null,this.tail=null}first(){return this.head}last(){return this.tail}clear(){return this.head=this.tail=null,this}insertBefore(e,t){return t.prev=e.prev,t.next=e,t.prev===null?this.head=t:t.prev.next=t,e.prev=t,this}insertAfter(e,t){return t.prev=e,t.next=e.next,t.next===null?this.tail=t:t.next.prev=t,e.next=t,this}append(e){return this.head===null?this.head=e:this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e,this}appendChain(e){for(this.head===null?this.head=e:this.tail.next=e,e.prev=this.tail;e.next!==null;)e=e.next;return this.tail=e,this}remove(e){return e.prev===null?this.head=e.next:e.prev.next=e.next,e.next===null?this.tail=e.prev:e.next.prev=e.prev,this}removeSubList(e,t){return e.prev===null?this.head=t.next:e.prev.next=t.next,t.next===null?this.tail=e.prev:t.next.prev=e.prev,this}isEmpty(){return this.head===null}};const sh=[2,2,1],rh=[1,0,0];function gi(s,e){return s*3+e}function E1(s){const e=s.elements;let t=0;for(let i=0;i<9;i++)t+=e[i]*e[i];return Math.sqrt(t)}function b1(s){const e=s.elements;let t=0;for(let i=0;i<3;i++){const n=e[gi(sh[i],rh[i])];t+=2*n*n}return Math.sqrt(t)}function w1(s,e){let t=0,i=1;const n=s.elements;for(let h=0;h<3;h++){const d=Math.abs(n[gi(sh[h],rh[h])]);d>t&&(t=d,i=h)}let r=1,o=0;const a=rh[i],l=sh[i];if(Math.abs(n[gi(l,a)])>Number.EPSILON){const h=n[gi(l,l)],d=n[gi(a,a)],p=n[gi(l,a)],f=(h-d)/2/p;let g;f<0?g=-1/(-f+Math.sqrt(1+f*f)):g=1/(f+Math.sqrt(1+f*f)),r=1/Math.sqrt(1+g*g),o=g*r}return e.identity(),e.elements[gi(a,a)]=r,e.elements[gi(l,l)]=r,e.elements[gi(l,a)]=o,e.elements[gi(a,l)]=-o,e}function I1(s,e){let t=0,i=0;const n=10;e.unitary.identity(),e.diagonal.copy(s);const r=e.unitary,o=e.diagonal,a=new On,l=new On,h=Number.EPSILON*E1(o);for(;ih;)w1(o,a),l.copy(a).transpose(),o.multiply(a),o.premultiply(l),r.multiply(a),++t>2&&(i++,t=0);return e}function C1(s){const e=[];for(let He=0;He0}let Md=class{static isTransparent(e){return e.transparent&&e.opacity<1}};const oh=class ht{static create(){const e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return`${ht._lut[e&255]+ht._lut[e>>8&255]+ht._lut[e>>16&255]+ht._lut[e>>24&255]}-${ht._lut[t&255]}${ht._lut[t>>8&255]}-${ht._lut[t>>16&15|64]}${ht._lut[t>>24&255]}-${ht._lut[i&63|128]}${ht._lut[i>>8&255]}-${ht._lut[i>>16&255]}${ht._lut[i>>24&255]}${ht._lut[n&255]}${ht._lut[n>>8&255]}${ht._lut[n>>16&255]}${ht._lut[n>>24&255]}`.toLowerCase()}static validate(e){if(!ht._pattern.test(e))throw new Error(`${e} is not a valid UUID v4. +var gv=Object.defineProperty;var vv=(s,e,t)=>e in s?gv(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var et=(s,e,t)=>(vv(s,typeof e!="symbol"?e+"":e,t),t);import{U as Pa,J as yv,p as Ev,s as bv,n as wv,u as zs,W as to,c as Iv,R as Cv,d as Yh}from"./index-b4ozRbQy.js";import{z as io,f as Ve,V as O,c as Ne,e as gt,A as ff,F as mf,P as an,r as Dt,p as Ke,M as le,T as On,E as gf,a as Ee,U as Gh,K as Oa,v as Vs,y as Gn,o as jn,Y as Ps,u as vf,C as Rt,d as Xt,Z as no,I as Kt,_ as Fn,B as ut,J as yf,$ as Ef,a0 as jh,a1 as Wh,a2 as Xh,a3 as Kh,a4 as cl,a5 as Qh,a6 as bf,a7 as hl,a8 as tn,k as za,a9 as wf,aa as If,ab as Wn,N as Va,ac as ii,ad as Tv,ae as Qo,af as zr,X as Cf,h as so,ag as Fa,n as Xn,l as Tf,m as ul,G as Os,W as Ri,q as wt,g as st,L as Di,i as dl,ah as Ha,ai as Tt,O as kn,j as Si,aj as pl,ak as Zh,al as qh,am as Jh,an as xv,ao as Av,ap as Sv,aq as _v,Q as Vt,S as Rv,ar as ad,as as Pv,at as Ov,au as Fv,av as Mv,aw as Zo,ax as Lv,ay as pr,az as Dv,aA as Nv,aB as Qc,aC as xs,aD as Uv,D as kv,s as xf,x as Bv,H as $h,t as zv,aE as fr,w as Ai,aF as Vv,aG as Hv,aH as Yv,aI as Gv,aJ as jv,aK as ld,aL as Wv,aM as Xv,aN as Kv,R as Af,aO as Qv,aP as Zv,aQ as Sf,aR as qv,aS as Jv,aT as _f,aU as Rf,aV as Pf,aW as $v}from"./web-ifc-api-BC8YMRiS.js";import{a as cd,L as ey,b as ty}from"./Line2-7GsqoD5b.js";import{M as iy}from"./mark-Cj_PmUva.js";import"./import-wrapper-prod-LhqN7JJy.js";const al=class al{constructor(e,t){et(this,"scene");et(this,"onSelect",new Pa);et(this,"type");et(this,"selectCurve");et(this,"selectPoints");et(this,"hoverCurve");et(this,"hoverPoints");et(this,"caster",new io);this.scene=e,this.type=t,this.hoverCurve=this.newCurve(.003,4473924,!1),this.hoverPoints=this.newPoints(5,4473924),this.selectCurve=this.newCurve(.005,16777215,!0),this.selectPoints=this.newPoints(7,16777215)}dispose(){this.selectCurve&&this.scene.remove(this.selectCurve),this.selectCurve.material.dispose(),this.selectCurve.geometry.dispose(),this.selectCurve=null,this.hoverCurve.material.dispose(),this.hoverCurve.geometry.dispose(),this.hoverCurve=null,this.hoverPoints.material.dispose(),this.hoverPoints.geometry.dispose(),this.selectPoints.material.dispose(),this.selectPoints.geometry.dispose(),this.scene=null}castRay(e,t,i,n){const r=new Ve,o=i.getBoundingClientRect();r.x=(e.clientX-o.left)/o.width*2-1,r.y=-((e.clientY-o.top)/o.height)*2+1,this.caster.setFromCamera(r,t);const a=this.caster.intersectObjects(n);return a.length?a[0]:null}select(e){this.highlight(e,this.selectCurve,this.selectPoints,!0),this.onSelect.trigger(e)}unSelect(){this.selectCurve.removeFromParent(),this.selectPoints.removeFromParent()}hover(e){this.highlight(e,this.hoverCurve,this.hoverPoints,!1)}unHover(){this.hoverCurve.removeFromParent(),this.hoverPoints.removeFromParent()}setResolution({x:e,y:t}){this.selectCurve.material.resolution.set(e/t,1),this.hoverCurve.material.resolution.set(e/t,1)}highlight(e,t,i,n){const{alignment:r}=e.curve;this.scene.add(t),this.scene.add(i);const o=[],a=[],l=[];for(const f of r[this.type]){const g=f.mesh.geometry.attributes.position;for(const T of g.array)o.push(T);if(n){let T;if(this.type==="absolute"){const{horizontal:_}=f.alignment;T=_[f.index].data.TYPE}else T=f.data.TYPE;const S=al.settings.colors[T]||[1,1,1];for(let _=0;_t.geometry.attributes.position.count&&(t.geometry.dispose(),t.geometry=new cd),t.geometry.setPositions(o),n&&t.geometry.setColors(a),i.geometry.setFromPoints(l)}newCurve(e,t,i){const n=new cd,r=new ey({color:t,linewidth:e,vertexColors:i,worldUnits:!1,depthTest:!1}),o=new ty(n,r);return this.scene.add(o),o}newPoints(e,t){const i=new Ne,n=new gt(new Float32Array,3);i.setAttribute("position",n);const r=new ff({size:e,color:t,sizeAttenuation:!1,depthTest:!1}),o=new mf(i,r);return o.frustumCulled=!1,this.scene.add(o),o}};et(al,"settings",{colors:{LINE:[213/255,0/255,255/255],CIRCULARARC:[0/255,46,255/255],CLOTHOID:[0/255,255/255,0/255],PARABOLICARC:[0/255,255/255,72/255],CONSTANTGRADIENT:[213/255,0/255,255/255]}});let Zc=al;const ll=class ll extends yv{constructor(t){super(t);et(this,"onHighlight",new Pa);et(this,"enabled",!0);et(this,"_highlighter");et(this,"mouseMarkers");et(this,"onMarkerChange",new Pa);et(this,"onMarkerHidden",new Pa);et(this,"_curves",[]);et(this,"_world",null);et(this,"updateLinesResolution",t=>{var i;(i=this.highlighter)==null||i.setResolution(t)});et(this,"onClick",t=>{if(!this.enabled||!this._highlighter)return;if(!this.world)throw new Error("No world found!");if(!this.world.renderer)return;const i=this.world.renderer.three.domElement,n=this.world.camera.three,r=this._highlighter.castRay(t,n,i,this._curves);if(r){const o=r.object;this._highlighter.select(o),this.updateMarker(r,"select");const{point:a,index:l}=r;l!==void 0&&this.onHighlight.trigger({curve:o,point:a,index:l});return}this._highlighter.unSelect(),this.mouseMarkers&&(this.mouseMarkers.hover.visible=!1),this.onMarkerHidden.trigger({type:"hover"})});et(this,"onMouseMove",async t=>{if(!this.enabled||!this._highlighter)return;if(!this.world)throw new Error("No world found!");if(!this.world.renderer)return;const i=this.world.renderer.three.domElement,n=this.world.camera.three,r=this._highlighter.castRay(t,n,i,this._curves);if(r){this._highlighter.hover(r.object),this.updateMarker(r,"hover");return}this._highlighter.unHover()});this.components.add(ll.uuid,this)}get world(){return this._world}set world(t){var n,r,o;if(t===this._world||(this._world&&this.setupEvents(!1),this._world=t,(n=this._highlighter)==null||n.dispose(),(r=this.mouseMarkers)==null||r.hover.dispose(),(o=this.mouseMarkers)==null||o.select.dispose(),!t))return;const i=t.scene.three;this._highlighter=new Zc(i,"absolute"),this.mouseMarkers={select:this.newMouseMarker("#ffffff",t),hover:this.newMouseMarker("#575757",t)},this.setupEvents(!0)}get highlighter(){if(!this._highlighter)throw new Error("Navigator not initialized!");return this._highlighter}draw(t){if(!t.civilData)throw new Error("Model must have civil data!");if(!this.world)throw new Error("A world must be given before drawing an alignment!");const i=this.world.scene.three;for(const[n,r]of t.civilData.alignments)for(const{mesh:o}of r.absolute)i.add(o),this._curves.push(o)}newMouseMarker(t,i){const n=i.scene.three,r=document.createElement("div");r.style.backgroundColor=t,r.style.width="1rem",r.style.height="1rem",r.style.borderRadius="1rem";const o=new iy(i,r,n);return o.visible=!1,o}setMarker(t,i,n){if(!this.mouseMarkers)throw new Error("No mouse markers found! Initialize the world before using this.");const r=t.getPointAt(i,"absolute");this.mouseMarkers[n].visible=!0,this.mouseMarkers[n].three.position.copy(r)}hideMarker(t){if(!this.mouseMarkers)throw new Error("No mouse markers found! Initialize the world before using this.");const i=this.mouseMarkers[t].three;i.visible=!1}setupEvents(t){var n,r;if(!this.world)throw new Error("No world found!");if(!this.world.renderer)return;const i=this.world.renderer.three.domElement;(n=this.world.renderer)==null||n.onResize.remove(this.updateLinesResolution),i.removeEventListener("click",this.onClick),i.removeEventListener("mousemove",this.onMouseMove),t&&(i.addEventListener("click",this.onClick),i.addEventListener("mousemove",this.onMouseMove),(r=this.world.renderer)==null||r.onResize.add(this.updateLinesResolution))}updateMarker(t,i){if(!this.mouseMarkers)return;const{point:n,object:r}=t,o=r,a=o.curve,l=o.curve.alignment,h=l.getPercentageAt(n,"absolute");this.mouseMarkers[i].visible=!0,this.mouseMarkers[i].three.position.copy(n),h!==null&&this.onMarkerChange.trigger({alignment:l,percentage:h,type:i,curve:a})}};et(ll,"uuid","0a59c09e-2b49-474a-9320-99f51f40f182");let hd=ll;var ny=Object.defineProperty,sy=(s,e,t)=>e in s?ny(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,x=(s,e,t)=>(sy(s,typeof e!="symbol"?e+"":e,t),t),ry=Object.defineProperty,oy=(s,e,t)=>e in s?ry(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,A=(s,e,t)=>(oy(s,typeof e!="symbol"?e+"":e,t),t);const Of=0,ay=1,ly=2,ud=2,Ec=1.25,dd=1,Ma=6*4+4+4,fl=65535,cy=Math.pow(2,-24),bc=Symbol("SKIP_GENERATION");function hy(s){return s.index?s.index.count:s.attributes.position.count}function Hs(s){return hy(s)/3}function uy(s,e=ArrayBuffer){return s>65535?new Uint32Array(new e(4*s)):new Uint16Array(new e(2*s))}function dy(s,e){if(!s.index){const t=s.attributes.position.count,i=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,n=uy(t,i);s.setIndex(new gt(n,1));for(let r=0;ra-l);for(let a=0;ar.offset-o.offset),i=t[t.length-1];i.count=Math.min(e-i.offset,i.count);let n=0;return t.forEach(({count:r})=>n+=r),e!==n}function Je(s,e,t){return t.min.x=e[s],t.min.y=e[s+1],t.min.z=e[s+2],t.max.x=e[s+3],t.max.y=e[s+4],t.max.z=e[s+5],t}function fy(s){s[0]=s[1]=s[2]=1/0,s[3]=s[4]=s[5]=-1/0}function pd(s){let e=-1,t=-1/0;for(let i=0;i<3;i++){const n=s[i+3]-s[i];n>t&&(t=n,e=i)}return e}function fd(s,e){e.set(s)}function md(s,e,t){let i,n;for(let r=0;r<3;r++){const o=r+3;i=s[r],n=e[r],t[r]=in?i:n}}function qo(s,e,t){for(let i=0;i<3;i++){const n=e[s+2*i],r=e[s+2*i+1],o=n-r,a=n+r;ot[i+3]&&(t[i+3]=a)}}function mr(s){const e=s[3]-s[0],t=s[4]-s[1],i=s[5]-s[2];return 2*(e*t+t*i+i*e)}function wc(s,e,t,i,n=null){let r=1/0,o=1/0,a=1/0,l=-1/0,h=-1/0,d=-1/0,p=1/0,f=1/0,g=1/0,v=-1/0,b=-1/0,w=-1/0;const T=n!==null;for(let S=e*6,_=(e+t)*6;S<_;S+=6){const I=s[S+0],P=s[S+1],M=I-P,k=I+P;Ml&&(l=k),T&&Iv&&(v=I);const V=s[S+2],W=s[S+3],j=V-W,Q=V+W;jh&&(h=Q),T&&Vb&&(b=V);const $=s[S+4],ne=s[S+5],oe=$-ne,ve=$+ne;oed&&(d=ve),T&&$w&&(w=$)}i[0]=r,i[1]=o,i[2]=a,i[3]=l,i[4]=h,i[5]=d,T&&(n[0]=p,n[1]=f,n[2]=g,n[3]=v,n[4]=b,n[5]=w)}function my(s,e,t,i){let n=1/0,r=1/0,o=1/0,a=-1/0,l=-1/0,h=-1/0;for(let d=e*6,p=(e+t)*6;da&&(a=f);const g=s[d+2];gl&&(l=g);const v=s[d+4];vh&&(h=v)}i[0]=n,i[1]=r,i[2]=o,i[3]=a,i[4]=l,i[5]=h}function gy(s,e){fy(e);const t=s.attributes.position,i=s.index?s.index.array:null,n=Hs(s),r=new Float32Array(n*6),o=t.normalized,a=t.array,l=t.offset||0;let h=3;t.isInterleavedBufferAttribute&&(h=t.data.stride);const d=["getX","getY","getZ"];for(let p=0;pM&&(M=_),I>M&&(M=I);const k=(M-P)/2,V=T*2;r[g+V+0]=P+k,r[g+V+1]=k+(Math.abs(P)+k)*cy,Pe[T+3]&&(e[T+3]=M)}}return r}const Ti=32,vy=(s,e)=>s.candidate-e.candidate,Xi=new Array(Ti).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),Jo=new Float32Array(6);function yy(s,e,t,i,n,r){let o=-1,a=0;if(r===Of)o=pd(e),o!==-1&&(a=(e[o]+e[o+3])/2);else if(r===ay)o=pd(s),o!==-1&&(a=Ey(t,i,n,o));else if(r===ly){const l=mr(s);let h=Ec*n;const d=i*6,p=(i+n)*6;for(let f=0;f<3;f++){const g=e[f],v=(e[f+3]-g)/Ti;if(n=P.candidate?qo(S,t,P.rightCacheBounds):(qo(S,t,P.leftCacheBounds),P.count++)}}for(let S=0;S=Ti&&(S=Ti-1);const _=Xi[S];_.count++,qo(T,t,_.bounds)}const b=Xi[Ti-1];fd(b.bounds,b.rightCacheBounds);for(let T=Ti-2;T>=0;T--){const S=Xi[T],_=Xi[T+1];md(S.bounds,_.rightCacheBounds,S.rightCacheBounds)}let w=0;for(let T=0;T=l;)a--;if(o=l;)a--;if(o2**16,n=i?4:2,r=e?new SharedArrayBuffer(t*n):new ArrayBuffer(t*n),o=i?new Uint32Array(r):new Uint16Array(r);for(let a=0,l=o.length;a=n&&(p=!0,r&&(console.warn(`MeshBVH: Max depth of ${n} reached when generating BVH. Consider increasing maxDepth.`),console.warn(t))),M<=o||V>=n)return S(P+M),I.offset=P,I.count=M,I;const W=yy(I.boundingData,k,v,P,M,a);if(W.axis===-1)return S(P+M),I.offset=P,I.count=M,I;const j=b(d,i,v,P,M,W);if(j===P||j===P+M)S(P+M),I.offset=P,I.count=M;else{I.splitAxis=W.axis;const Q=new $o,$=P,ne=j-P;I.left=Q,Q.boundingData=new Float32Array(6),wc(v,$,ne,Q.boundingData,g),_(Q,$,ne,g,V+1);const oe=new $o,ve=j,re=M-ne;I.right=oe,oe.boundingData=new Float32Array(6),wc(v,ve,re,oe.boundingData,g),_(oe,ve,re,g,V+1)}return I}}function Ty(s,e){const t=s.geometry;e.indirect&&(s._indirectBuffer=Iy(t,e.useSharedArrayBuffer),py(t)&&!e.verbose&&console.warn('MeshBVH: Provided geometry contains groups that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.')),s._indirectBuffer||dy(t,e);const i=Cy(s,e);let n,r,o;const a=[],l=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let p=0;pMath.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return r[g+6]=I/4,I=d(I,S),r[g+7]=_,I}}}let Oi=class{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let i=1/0,n=-1/0;for(let r=0,o=e.length;rn?a:n}this.min=i,this.max=n}setFromPoints(e,t){let i=1/0,n=-1/0;for(let r=0,o=t.length;rn?l:n}this.min=i,this.max=n}isSeparated(e){return this.min>e.max||e.min>this.max}};Oi.prototype.setFromBox=function(){const s=new O;return function(e,t){const i=t.min,n=t.max;let r=1/0,o=-1/0;for(let a=0;a<=1;a++)for(let l=0;l<=1;l++)for(let h=0;h<=1;h++){s.x=i.x*a+n.x*(1-a),s.y=i.y*l+n.y*(1-l),s.z=i.z*h+n.z*(1-h);const d=e.dot(s);r=Math.min(d,r),o=Math.max(d,o)}this.min=r,this.max=o}}();const xy=function(){const s=new O,e=new O,t=new O;return function(i,n,r){const o=i.start,a=s,l=n.start,h=e;t.subVectors(o,l),s.subVectors(i.end,i.start),e.subVectors(n.end,n.start);const d=t.dot(h),p=h.dot(a),f=h.dot(h),g=t.dot(a),v=a.dot(a)*f-p*p;let b,w;v!==0?b=(d*p-g*f)/v:b=0,w=(d+b*p)/f,r.x=b,r.y=w}}(),eu=function(){const s=new Ve,e=new O,t=new O;return function(i,n,r,o){xy(i,n,s);let a=s.x,l=s.y;if(a>=0&&a<=1&&l>=0&&l<=1){i.at(a,r),n.at(l,o);return}else if(a>=0&&a<=1){l<0?n.at(0,o):n.at(1,o),i.closestPointToPoint(o,!0,r);return}else if(l>=0&&l<=1){a<0?i.at(0,r):i.at(1,r),n.closestPointToPoint(r,!0,o);return}else{let h;a<0?h=i.start:h=i.end;let d;l<0?d=n.start:d=n.end;const p=e,f=t;if(i.closestPointToPoint(d,!0,e),n.closestPointToPoint(h,!0,t),p.distanceToSquared(d)<=f.distanceToSquared(h)){r.copy(p),o.copy(d);return}else{r.copy(h),o.copy(f);return}}}}(),Ay=function(){const s=new O,e=new O,t=new an,i=new Dt;return function(n,r){const{radius:o,center:a}=n,{a:l,b:h,c:d}=r;if(i.start=l,i.end=h,i.closestPointToPoint(a,!0,s).distanceTo(a)<=o||(i.start=l,i.end=d,i.closestPointToPoint(a,!0,s).distanceTo(a)<=o)||(i.start=h,i.end=d,i.closestPointToPoint(a,!0,s).distanceTo(a)<=o))return!0;const p=r.getPlane(t);if(Math.abs(p.distanceToPoint(a))<=o){const f=p.projectPoint(a,e);if(r.containsPoint(f))return!0}return!1}}(),Sy=1e-15;function Ic(s){return Math.abs(s)new O),this.satBounds=new Array(4).fill().map(()=>new Oi),this.points=[this.a,this.b,this.c],this.sphere=new Gn,this.plane=new an,this.needsUpdate=!0}intersectsSphere(e){return Ay(e,this)}update(){const e=this.a,t=this.b,i=this.c,n=this.points,r=this.satAxes,o=this.satBounds,a=r[0],l=o[0];this.getNormal(a),l.setFromPoints(a,n);const h=r[1],d=o[1];h.subVectors(e,t),d.setFromPoints(h,n);const p=r[2],f=o[2];p.subVectors(t,i),f.setFromPoints(p,n);const g=r[3],v=o[3];g.subVectors(i,e),v.setFromPoints(g,n),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(a,e),this.needsUpdate=!1}};si.prototype.closestPointToSegment=function(){const s=new O,e=new O,t=new Dt;return function(i,n=null,r=null){const{start:o,end:a}=i,l=this.points;let h,d=1/0;for(let p=0;p<3;p++){const f=(p+1)%3;t.start.copy(l[p]),t.end.copy(l[f]),eu(t,i,s,e),h=s.distanceToSquared(e),h=2){(I===1?T.start:T.end).copy(g),_=2;break}if(_++,_===2&&I===-1)break}}return _}return function(b,w=null,T=!1){this.needsUpdate&&this.update(),b.isExtendedTriangle?b.needsUpdate&&b.update():(s.copy(b),s.update(),b=s);const S=this.plane,_=b.plane;if(Math.abs(S.normal.dot(_.normal))>1-1e-10){const I=this.satBounds,P=this.satAxes;t[0]=b.a,t[1]=b.b,t[2]=b.c;for(let V=0;V<4;V++){const W=I[V],j=P[V];if(i.setFromPoints(j,t),W.isSeparated(i))return!1}const M=b.satBounds,k=b.satAxes;e[0]=this.a,e[1]=this.b,e[2]=this.c;for(let V=0;V<4;V++){const W=M[V],j=k[V];if(i.setFromPoints(j,e),W.isSeparated(i))return!1}for(let V=0;V<4;V++){const W=P[V];for(let j=0;j<4;j++){const Q=k[j];if(r.crossVectors(W,Q),i.setFromPoints(r,e),n.setFromPoints(r,t),i.isSeparated(n))return!1}}return w&&(T||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),w.start.set(0,0,0),w.end.set(0,0,0)),!0}else{const I=v(this,_,p);if(I===1&&b.containsPoint(p.end))return w&&(w.start.copy(p.end),w.end.copy(p.end)),!0;if(I!==2)return!1;const P=v(b,S,f);if(P===1&&this.containsPoint(f.end))return w&&(w.start.copy(f.end),w.end.copy(f.end)),!0;if(P!==2)return!1;if(p.delta(a),f.delta(l),a.dot(l)<0){let $=f.start;f.start=f.end,f.end=$}const M=p.start.dot(a),k=p.end.dot(a),V=f.start.dot(a),W=f.end.dot(a),j=k0?w.start.copy(p.start):w.start.copy(f.start),h.subVectors(p.end,f.end),h.dot(a)<0?w.end.copy(p.end):w.end.copy(f.end)),!0)}}}();si.prototype.distanceToPoint=function(){const s=new O;return function(e){return this.closestPointToPoint(e,s),e.distanceTo(s)}}();si.prototype.distanceToTriangle=function(){const s=new O,e=new O,t=["a","b","c"],i=new Dt,n=new Dt;return function(r,o=null,a=null){const l=o||a?i:null;if(this.intersectsTriangle(r,l))return(o||a)&&(o&&l.getCenter(o),a&&l.getCenter(a)),0;let h=1/0;for(let d=0;d<3;d++){let p;const f=t[d],g=r[f];this.closestPointToPoint(g,s),p=g.distanceToSquared(s),pnew O),this.satAxes=new Array(3).fill().map(()=>new O),this.satBounds=new Array(3).fill().map(()=>new Oi),this.alignedSatBounds=new Array(3).fill().map(()=>new Oi),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),i&&this.matrix.copy(i)}set(e,t,i){this.min.copy(e),this.max.copy(t),this.matrix.copy(i),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}};xt.prototype.update=function(){return function(){const s=this.matrix,e=this.min,t=this.max,i=this.points;for(let l=0;l<=1;l++)for(let h=0;h<=1;h++)for(let d=0;d<=1;d++){const p=1*l|2*h|4*d,f=i[p];f.x=l?t.x:e.x,f.y=h?t.y:e.y,f.z=d?t.z:e.z,f.applyMatrix4(s)}const n=this.satBounds,r=this.satAxes,o=i[0];for(let l=0;l<3;l++){const h=r[l],d=n[l],p=1<new Dt),t=new Array(12).fill().map(()=>new Dt),i=new O,n=new O;return function(r,o=0,a=null,l=null){if(this.needsUpdate&&this.update(),this.intersectsBox(r))return(a||l)&&(r.getCenter(n),this.closestPointToPoint(n,i),r.closestPointToPoint(i,n),a&&a.copy(i),l&&l.copy(n)),0;const h=o*o,d=r.min,p=r.max,f=this.points;let g=1/0;for(let b=0;b<8;b++){const w=f[b];n.copy(w).clamp(d,p);const T=w.distanceToSquared(n);if(Tnew si)}}const Yt=new _y;function Ft(s,e){return e[s+15]===65535}function Lt(s,e){return e[s+6]}function Gt(s,e){return e[s+14]}function jt(s){return s+8}function Wt(s,e){return e[s+6]}function Lf(s,e){return e[s+7]}class Ry{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const e=[];let t=null;this.setBuffer=i=>{t&&e.push(t),t=i,this.float32Array=new Float32Array(i),this.uint16Array=new Uint16Array(i),this.uint32Array=new Uint32Array(i)},this.clearBuffer=()=>{t=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,e.length!==0&&this.setBuffer(e.pop())}}}const Qe=new Ry;let Ji,As;const os=[],ea=new tu(()=>new Ke);function Py(s,e,t,i,n,r){Ji=ea.getPrimitive(),As=ea.getPrimitive(),os.push(Ji,As),Qe.setBuffer(s._roots[e]);const o=qc(0,s.geometry,t,i,n,r);Qe.clearBuffer(),ea.releasePrimitive(Ji),ea.releasePrimitive(As),os.pop(),os.pop();const a=os.length;return a>0&&(As=os[a-1],Ji=os[a-2]),o}function qc(s,e,t,i,n=null,r=0,o=0){const{float32Array:a,uint16Array:l,uint32Array:h}=Qe;let d=s*2;if(Ft(d,l)){const p=Lt(s,h),f=Gt(d,l);return Je(s,a,Ji),i(p,f,!1,o,r+s,Ji)}else{let p=function(Q){const{uint16Array:$,uint32Array:ne}=Qe;let oe=Q*2;for(;!Ft(oe,$);)Q=jt(Q),oe=Q*2;return Lt(Q,ne)},f=function(Q){const{uint16Array:$,uint32Array:ne}=Qe;let oe=Q*2;for(;!Ft(oe,$);)Q=Wt(Q,ne),oe=Q*2;return Lt(Q,ne)+Gt(oe,$)};const g=jt(s),v=Wt(s,h);let b=g,w=v,T,S,_,I;if(n&&(_=Ji,I=As,Je(b,a,_),Je(w,a,I),T=n(_),S=n(I),S(gr.copy(e).clamp(d.min,d.max),gr.distanceToSquared(e)),intersectsBounds:(d,p,f)=>f{d.closestPointToPoint(e,gr);const f=e.distanceToSquared(gr);return f0&&h.normal.multiplyScalar(-1));const d={a:r,b:o,c:a,normal:new O,materialIndex:0};On.getNormal(as,ls,cs,d.normal),h.face=d,h.faceIndex=r}return h}function ml(s,e,t,i,n){const r=i*3;let o=r+0,a=r+1,l=r+2;const h=s.index;s.index&&(o=h.getX(o),a=h.getX(a),l=h.getX(l));const{position:d,normal:p,uv:f,uv1:g}=s.attributes,v=My(t,d,p,f,g,o,a,l,e);return v?(v.faceIndex=i,n&&n.push(v),v):null}function ot(s,e,t,i){const n=s.a,r=s.b,o=s.c;let a=e,l=e+1,h=e+2;t&&(a=t.getX(a),l=t.getX(l),h=t.getX(h)),n.x=i.getX(a),n.y=i.getY(a),n.z=i.getZ(a),r.x=i.getX(l),r.y=i.getY(l),r.z=i.getZ(l),o.x=i.getX(h),o.y=i.getY(h),o.z=i.getZ(h)}function Ly(s,e,t,i,n,r){const{geometry:o,_indirectBuffer:a}=s;for(let l=i,h=i+n;lP&&(P=Q),$<_&&(_=$),$>M&&(M=$),nek&&(k=ne)}return l[f+0]!==S||l[f+1]!==_||l[f+2]!==I||l[f+3]!==P||l[f+4]!==M||l[f+5]!==k?(l[f+0]=S,l[f+1]=_,l[f+2]=I,l[f+3]=P,l[f+4]=M,l[f+5]=k,!0):!1}else{const w=f+8,T=o[f+6],S=w+g,_=T+g;let I=v,P=!1,M=!1;e?I||(P=e.has(S),M=e.has(_),I=!P&&!M):(P=!0,M=!0);const k=I||P,V=I||M;let W=!1;k&&(W=p(w,g,I));let j=!1;V&&(j=p(T,g,I));const Q=W||j;if(Q)for(let $=0;$<3;$++){const ne=w+$,oe=T+$,ve=l[ne],re=l[ne+3],ge=l[oe],me=l[oe+3];l[f+$]=veme?re:me}return Q}}}const Ed=new Ke;function nn(s,e,t,i){return Je(s,e,Ed),t.intersectBox(Ed,i)}function ky(s,e,t,i,n,r){const{geometry:o,_indirectBuffer:a}=s;for(let l=i,h=i+n;l=0;let p,f;d?(p=jt(s),f=Wt(s,o)):(p=Wt(s,o),f=jt(s));const g=nn(p,n,i,wd)?$c(p,e,t,i):null;if(g){const b=g.point[h];if(d?b<=n[f+l]:b>=n[f+l+3])return g}const v=nn(f,n,i,wd)?$c(f,e,t,i):null;return g&&v?g.distance<=v.distance?g:v:g||v||null}}const ra=new Ke,hs=new si,us=new si,vr=new Ee,Id=new xt,oa=new xt;function Gy(s,e,t,i){Qe.setBuffer(s._roots[e]);const n=eh(0,s,t,i);return Qe.clearBuffer(),n}function eh(s,e,t,i,n=null){const{float32Array:r,uint16Array:o,uint32Array:a}=Qe;let l=s*2;if(n===null&&(t.boundingBox||t.computeBoundingBox(),Id.set(t.boundingBox.min,t.boundingBox.max,i),n=Id),Ft(l,o)){const h=e.geometry,d=h.index,p=h.attributes.position,f=t.index,g=t.attributes.position,v=Lt(s,a),b=Gt(l,o);if(vr.copy(i).invert(),t.boundsTree)return Je(s,r,oa),oa.matrix.copy(vr),oa.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:w=>oa.intersectsBox(w),intersectsTriangle:w=>{w.a.applyMatrix4(i),w.b.applyMatrix4(i),w.c.applyMatrix4(i),w.needsUpdate=!0;for(let T=v*3,S=(b+v)*3;TTc.distanceToBox(P),intersectsBounds:(P,M,k)=>k{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:k=>yr.distanceToBox(k),intersectsBounds:(k,V,W)=>W{for(let W=k,j=k+V;WP&&(P=ne),oe<_&&(_=oe),oe>M&&(M=oe),vek&&(k=ve)}}return l[f+0]!==S||l[f+1]!==_||l[f+2]!==I||l[f+3]!==P||l[f+4]!==M||l[f+5]!==k?(l[f+0]=S,l[f+1]=_,l[f+2]=I,l[f+3]=P,l[f+4]=M,l[f+5]=k,!0):!1}else{const w=f+8,T=o[f+6],S=w+g,_=T+g;let I=v,P=!1,M=!1;e?I||(P=e.has(S),M=e.has(_),I=!P&&!M):(P=!0,M=!0);const k=I||P,V=I||M;let W=!1;k&&(W=p(w,g,I));let j=!1;V&&(j=p(T,g,I));const Q=W||j;if(Q)for(let $=0;$<3;$++){const ne=w+$,oe=T+$,ve=l[ne],re=l[ne+3],ge=l[oe],me=l[oe+3];l[f+$]=veme?re:me}return Q}}}const Cd=new O;function qy(s,e,t,i,n){Qe.setBuffer(s._roots[e]),th(0,s,t,i,n),Qe.clearBuffer()}function th(s,e,t,i,n){const{float32Array:r,uint16Array:o,uint32Array:a}=Qe,l=s*2;if(Ft(l,o)){const h=Lt(s,a),d=Gt(l,o);ky(e,t,i,h,d,n)}else{const h=jt(s);nn(h,r,i,Cd)&&th(h,e,t,i,n);const d=Wt(s,a);nn(d,r,i,Cd)&&th(d,e,t,i,n)}}const Td=new O,Jy=["x","y","z"];function $y(s,e,t,i){Qe.setBuffer(s._roots[e]);const n=ih(0,s,t,i);return Qe.clearBuffer(),n}function ih(s,e,t,i){const{float32Array:n,uint16Array:r,uint32Array:o}=Qe;let a=s*2;if(Ft(a,r)){const l=Lt(s,o),h=Gt(a,r);return By(e,t,i,l,h)}else{const l=Lf(s,o),h=Jy[l],d=i.direction[h]>=0;let p,f;d?(p=jt(s),f=Wt(s,o)):(p=Wt(s,o),f=jt(s));const g=nn(p,n,i,Td)?ih(p,e,t,i):null;if(g){const b=g.point[h];if(d?b<=n[f+l]:b>=n[f+l+3])return g}const v=nn(f,n,i,Td)?ih(f,e,t,i):null;return g&&v?g.distance<=v.distance?g:v:g||v||null}}const la=new Ke,ds=new si,ps=new si,Er=new Ee,xd=new xt,ca=new xt;function e1(s,e,t,i){Qe.setBuffer(s._roots[e]);const n=nh(0,s,t,i);return Qe.clearBuffer(),n}function nh(s,e,t,i,n=null){const{float32Array:r,uint16Array:o,uint32Array:a}=Qe;let l=s*2;if(n===null&&(t.boundingBox||t.computeBoundingBox(),xd.set(t.boundingBox.min,t.boundingBox.max,i),n=xd),Ft(l,o)){const h=e.geometry,d=h.index,p=h.attributes.position,f=t.index,g=t.attributes.position,v=Lt(s,a),b=Gt(l,o);if(Er.copy(i).invert(),t.boundsTree)return Je(s,r,ca),ca.matrix.copy(Er),ca.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:w=>ca.intersectsBox(w),intersectsTriangle:w=>{w.a.applyMatrix4(i),w.b.applyMatrix4(i),w.c.applyMatrix4(i),w.needsUpdate=!0;for(let T=v,S=b+v;Txc.distanceToBox(P),intersectsBounds:(P,M,k)=>k{if(e.boundsTree){const k=e.boundsTree;return k.shapecast({boundsTraverseOrder:V=>br.distanceToBox(V),intersectsBounds:(V,W,j)=>j{for(let j=V,Q=V+W;jnew Ke),fs=new Ke,ms=new Ke,Ac=new Ke,Sc=new Ke;let _c=!1;function a1(s,e,t,i){if(_c)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");_c=!0;const n=s._roots,r=e._roots;let o,a=0,l=0;const h=new Ee().copy(t).invert();for(let d=0,p=n.length;dl.slice()),index:o.array.slice(),indirectBuffer:r?r.slice():null}:a={roots:n,index:o.array,indirectBuffer:r},a}static deserialize(e,t,i={}){i={setIndex:!0,indirect:!!e.indirectBuffer,...i};const{index:n,roots:r,indirectBuffer:o}=e,a=new Df(t,{...i,[bc]:!0});if(a._roots=r,a._indirectBuffer=o||null,i.setIndex){const l=t.getIndex();if(l===null){const h=new gt(e.index,1,!1);t.setIndex(h)}else l.array!==n&&(l.array.set(n),l.needsUpdate=!0)}return a}get indirect(){return!!this._indirectBuffer}constructor(e,t={}){if(e.isBufferGeometry){if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");if(t=Object.assign({strategy:Of,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[bc]:!1},t),t.useSharedArrayBuffer&&!o1())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=e,this._roots=null,this._indirectBuffer=null,t[bc]||(Ty(this,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new Ke)));const{_indirectBuffer:i}=this;this.resolveTriangleIndex=t.indirect?n=>i[n]:n=>n}refit(e=null){return(this.indirect?Zy:Uy)(this,e)}traverse(e,t=0){const i=this._roots[t],n=new Uint32Array(i),r=new Uint16Array(i);o(0);function o(a,l=0){const h=a*2,d=r[h+15]===fl;if(d){const p=n[a+6],f=r[h+14];e(l,d,new Float32Array(i,a*4,6),p,f)}else{const p=a+Ma/4,f=n[a+6],g=n[a+7];e(l,d,new Float32Array(i,a*4,6),g)||(o(p,l+1),o(f,l+1))}}}raycast(e,t=ad){const i=this._roots,n=this.geometry,r=[],o=t.isMaterial,a=Array.isArray(t),l=n.groups,h=o?t.side:t,d=this.indirect?qy:Vy;for(let p=0,f=i.length;pp(f,g,v,b,w)?!0:i(f,g,this,a,v,b,t)}else o||(a?o=(p,f,g,v)=>i(p,f,this,a,g,v,t):o=(p,f,g)=>g);let l=!1,h=0;const d=this._roots;for(let p=0,f=d.length;p{const b=this.resolveTriangleIndex(v);ot(o,b*3,a,l)}:v=>{ot(o,v*3,a,l)},d=Yt.getPrimitive(),p=e.geometry.index,f=e.geometry.attributes.position,g=e.indirect?v=>{const b=e.resolveTriangleIndex(v);ot(d,b*3,p,f)}:v=>{ot(d,v*3,p,f)};if(r){const v=(b,w,T,S,_,I,P,M)=>{for(let k=T,V=T+S;kua.intersectsBox(i),intersectsTriangle:i=>ua.intersectsTriangle(i)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,i={},n={},r=0,o=1/0){return(this.indirect?r1:Qy)(this,e,t,i,n,r,o)}closestPointToPoint(e,t={},i=0,n=1/0){return Oy(this,e,t,i,n)}getBoundingBox(e){return e.makeEmpty(),this._roots.forEach(t=>{Je(0,new Float32Array(t),Ad),e.union(Ad)}),e}};function Sd(s,e,t){return s===null||(s.point.applyMatrix4(e.matrixWorld),s.distance=s.point.distanceTo(t.ray.origin),s.object=e,s.distancet.far)?null:s}const Rc=new Pv,_d=new Ee,c1=le.prototype.raycast;function h1(s,e){if(this.geometry.boundsTree){if(this.material===void 0)return;_d.copy(this.matrixWorld).invert(),Rc.copy(s.ray).applyMatrix4(_d);const t=this.geometry.boundsTree;if(s.firstHitOnly===!0){const i=Sd(t.raycastFirst(Rc,this.material),this,s);i&&e.push(i)}else{const i=t.raycast(Rc,this.material);for(let n=0,r=i.length;n{const t=this.handlers.slice(0);for(const i of t)i(e)}),A(this,"handlers",[])}add(e){this.handlers.push(e)}remove(e){this.handlers=this.handlers.filter(t=>t!==e)}reset(){this.handlers.length=0}}let $i=class{constructor(){A(this,"trigger",async e=>{const t=this.handlers.slice(0);for(const i of t)await i(e)}),A(this,"handlers",[])}add(e){this.handlers.push(e)}remove(e){this.handlers=this.handlers.filter(t=>t!==e)}reset(){this.handlers.length=0}},iu=class{constructor(e){A(this,"isDisposeable",()=>"dispose"in this&&"onDisposed"in this),A(this,"isResizeable",()=>"resize"in this&&"getSize"in this),A(this,"isUpdateable",()=>"onAfterUpdate"in this&&"onBeforeUpdate"in this&&"update"in this),A(this,"isHideable",()=>"visible"in this),A(this,"isConfigurable",()=>"setup"in this&&"config"in this&&"onSetup"in this),this.components=e}},Re=class extends iu{},Nf=class extends iu{constructor(e){super(e),A(this,"worlds",new Map),A(this,"onWorldChanged",new ee),A(this,"currentWorld",null),this.onWorldChanged.add(({world:t,action:i})=>{i==="removed"&&this.worlds.delete(t.uuid)})}};class p1 extends Nf{constructor(){super(...arguments),A(this,"hasCameraControls",()=>"controls"in this)}}class f1 extends Nf{constructor(){super(...arguments),A(this,"onAfterUpdate",new ee),A(this,"onBeforeUpdate",new ee),A(this,"onDisposed",new ee),A(this,"onResize",new ee),A(this,"onClippingPlanesUpdated",new ee),A(this,"clippingPlanes",[])}updateClippingPlanes(){this.onClippingPlanesUpdated.trigger()}setPlane(e,t,i){t.isLocal=i;const n=this.clippingPlanes.indexOf(t);e&&n===-1?this.clippingPlanes.push(t):!e&&n>-1&&this.clippingPlanes.splice(n,1),this.three.clippingPlanes=this.clippingPlanes.filter(r=>!r.isLocal)}}const Uf=class sh extends Re{constructor(e){super(e),A(this,"_disposedComponents",new Set),A(this,"enabled",!0),e.add(sh.uuid,this)}get(){return this._disposedComponents}destroy(e,t=!0,i=!0){e.removeFromParent();const n=e;n.dispose&&n.dispose(),this.disposeGeometryAndMaterials(e,t),i&&n.children&&n.children.length&&this.disposeChildren(n),e.children.length=0}disposeGeometry(e){const t=e;t.boundsTree&&t.disposeBoundsTree(),e.dispose()}disposeGeometryAndMaterials(e,t){const i=e;i.geometry&&this.disposeGeometry(i.geometry),t&&i.material&&sh.disposeMaterial(i),i.material=[],i.geometry=null}disposeChildren(e){for(const t of e.children)this.destroy(t)}static disposeMaterial(e){if(e.material)if(Array.isArray(e.material))for(const t of e.material)t.dispose();else e.material.dispose()}};A(Uf,"uuid","76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");let Fi=Uf;const La=0,m1=1,g1=new O,Rd=new Dt,Pc=new an,Pd=new O,da=new On;class v1{constructor(){this.tolerance=-1,this.faces=[],this.newFaces=[],this.assigned=new Od,this.unassigned=new Od,this.vertices=[]}setFromPoints(e){if(e.length>=4){this.makeEmpty();for(let t=0,i=e.length;tthis.tolerance)return!1;return!0}intersectRay(e,t){const i=this.faces;let n=-1/0,r=1/0;for(let o=0,a=i.length;o0&&d>=0)return null;const p=d!==0?-h/d:0;if(!(p<=0)&&(d>0?r=Math.min(p,r):n=Math.max(p,n),n>r))return null}return n!==-1/0?e.at(n,t):e.at(r,t),t}intersectsRay(e){return this.intersectRay(e,g1)!==null}makeEmpty(){return this.faces=[],this.vertices=[],this}addVertexToFace(e,t){return e.face=t,t.outside===null?this.assigned.append(e):this.assigned.insertBefore(t.outside,e),t.outside=e,this}removeVertexFromFace(e,t){return e===t.outside&&(e.next!==null&&e.next.face===t?t.outside=e.next:t.outside=null),this.assigned.remove(e),this}removeAllVerticesFromFace(e){if(e.outside!==null){const t=e.outside;let i=e.outside;for(;i.next!==null&&i.next.face===e;)i=i.next;return this.assigned.removeSubList(t,i),t.prev=i.next=null,e.outside=null,t}}deleteFaceVertices(e,t){const i=this.removeAllVerticesFromFace(e);if(i!==void 0)if(t===void 0)this.unassigned.appendChain(i);else{let n=i;do{const r=n.next;t.distanceToPoint(n.point)>this.tolerance?this.addVertexToFace(n,t):this.unassigned.append(n),n=r}while(n!==null)}return this}resolveUnassignedPoints(e){if(this.unassigned.isEmpty()===!1){let t=this.unassigned.first();do{const i=t.next;let n=this.tolerance,r=null;for(let o=0;on&&(n=l,r=a),n>1e3*this.tolerance)break}}r!==null&&this.addVertexToFace(t,r),t=i}while(t!==null)}return this}computeExtremes(){const e=new O,t=new O,i=[],n=[];for(let r=0;r<3;r++)i[r]=n[r]=this.vertices[0];e.copy(this.vertices[0].point),t.copy(this.vertices[0].point);for(let r=0,o=this.vertices.length;rt.getComponent(h)&&(t.setComponent(h,l.getComponent(h)),n[h]=a)}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(e.x),Math.abs(t.x))+Math.max(Math.abs(e.y),Math.abs(t.y))+Math.max(Math.abs(e.z),Math.abs(t.z))),{min:i,max:n}}computeInitialHull(){const e=this.vertices,t=this.computeExtremes(),i=t.min,n=t.max;let r=0,o=0;for(let f=0;f<3;f++){const g=n[f].point.getComponent(f)-i[f].point.getComponent(f);g>r&&(r=g,o=f)}const a=i[o],l=n[o];let h,d;r=0,Rd.set(a.point,l.point);for(let f=0,g=this.vertices.length;fr&&(r=b,h=v)}}r=-1,Pc.setFromCoplanarPoints(a.point,l.point,h.point);for(let f=0,g=this.vertices.length;fr&&(r=b,d=v)}}const p=[];if(Pc.distanceToPoint(d.point)<0){p.push(Ci.create(a,l,h),Ci.create(d,l,a),Ci.create(d,h,l),Ci.create(d,a,h));for(let f=0;f<3;f++){const g=(f+1)%3;p[f+1].getEdge(2).setTwin(p[0].getEdge(g)),p[f+1].getEdge(1).setTwin(p[g+1].getEdge(0))}}else{p.push(Ci.create(a,h,l),Ci.create(d,a,l),Ci.create(d,l,h),Ci.create(d,h,a));for(let f=0;f<3;f++){const g=(f+1)%3;p[f+1].getEdge(2).setTwin(p[0].getEdge((3-f)%3)),p[f+1].getEdge(0).setTwin(p[g+1].getEdge(1))}}for(let f=0;f<4;f++)this.faces.push(p[f]);for(let f=0,g=e.length;fr&&(r=T,b=this.faces[w])}b!==null&&this.addVertexToFace(v,b)}}return this}reindexFaces(){const e=[];for(let t=0;tt&&(t=r,e=n),n=n.next}while(n!==null&&n.face===i);return e}}computeHorizon(e,t,i,n){this.deleteFaceVertices(i),i.mark=m1;let r;t===null?r=t=i.getEdge(0):r=t.next;do{const o=r.twin,a=o.face;a.mark===La&&(a.distanceToPoint(e)>this.tolerance?this.computeHorizon(e,o,a,n):n.push(r)),r=r.next}while(r!==t);return this}addAdjoiningFace(e,t){const i=Ci.create(e,t.tail(),t.head());return this.faces.push(i),i.getEdge(-1).setTwin(t.twin),i.getEdge(0)}addNewFaces(e,t){this.newFaces=[];let i=null,n=null;for(let r=0;r0;)t=t.next,e--;for(;e<0;)t=t.prev,e++;return t}compute(){const e=this.edge.tail(),t=this.edge.head(),i=this.edge.next.head();return da.set(e.point,t.point,i.point),da.getNormal(this.normal),da.getMidpoint(this.midpoint),this.area=da.getArea(),this.constant=this.normal.dot(this.midpoint),this}distanceToPoint(e){return this.normal.dot(e)-this.constant}},Oc=class{constructor(e,t){this.vertex=e,this.prev=null,this.next=null,this.twin=null,this.face=t}head(){return this.vertex}tail(){return this.prev?this.prev.vertex:null}length(){const e=this.head(),t=this.tail();return t!==null?t.point.distanceTo(e.point):-1}lengthSquared(){const e=this.head(),t=this.tail();return t!==null?t.point.distanceToSquared(e.point):-1}setTwin(e){return this.twin=e,e.twin=this,this}};class y1{constructor(e){this.point=e,this.prev=null,this.next=null,this.face=null}}let Od=class{constructor(){this.head=null,this.tail=null}first(){return this.head}last(){return this.tail}clear(){return this.head=this.tail=null,this}insertBefore(e,t){return t.prev=e.prev,t.next=e,t.prev===null?this.head=t:t.prev.next=t,e.prev=t,this}insertAfter(e,t){return t.prev=e,t.next=e.next,t.next===null?this.tail=t:t.next.prev=t,e.next=t,this}append(e){return this.head===null?this.head=e:this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e,this}appendChain(e){for(this.head===null?this.head=e:this.tail.next=e,e.prev=this.tail;e.next!==null;)e=e.next;return this.tail=e,this}remove(e){return e.prev===null?this.head=e.next:e.prev.next=e.next,e.next===null?this.tail=e.prev:e.next.prev=e.prev,this}removeSubList(e,t){return e.prev===null?this.head=t.next:e.prev.next=t.next,t.next===null?this.tail=e.prev:t.next.prev=e.prev,this}isEmpty(){return this.head===null}};const rh=[2,2,1],oh=[1,0,0];function gi(s,e){return s*3+e}function E1(s){const e=s.elements;let t=0;for(let i=0;i<9;i++)t+=e[i]*e[i];return Math.sqrt(t)}function b1(s){const e=s.elements;let t=0;for(let i=0;i<3;i++){const n=e[gi(rh[i],oh[i])];t+=2*n*n}return Math.sqrt(t)}function w1(s,e){let t=0,i=1;const n=s.elements;for(let h=0;h<3;h++){const d=Math.abs(n[gi(rh[h],oh[h])]);d>t&&(t=d,i=h)}let r=1,o=0;const a=oh[i],l=rh[i];if(Math.abs(n[gi(l,a)])>Number.EPSILON){const h=n[gi(l,l)],d=n[gi(a,a)],p=n[gi(l,a)],f=(h-d)/2/p;let g;f<0?g=-1/(-f+Math.sqrt(1+f*f)):g=1/(f+Math.sqrt(1+f*f)),r=1/Math.sqrt(1+g*g),o=g*r}return e.identity(),e.elements[gi(a,a)]=r,e.elements[gi(l,l)]=r,e.elements[gi(l,a)]=o,e.elements[gi(a,l)]=-o,e}function I1(s,e){let t=0,i=0;const n=10;e.unitary.identity(),e.diagonal.copy(s);const r=e.unitary,o=e.diagonal,a=new Fn,l=new Fn,h=Number.EPSILON*E1(o);for(;ih;)w1(o,a),l.copy(a).transpose(),o.multiply(a),o.premultiply(l),r.multiply(a),++t>2&&(i++,t=0);return e}function C1(s){const e=[];for(let He=0;He0}let Fd=class{static isTransparent(e){return e.transparent&&e.opacity<1}};const ah=class ht{static create(){const e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return`${ht._lut[e&255]+ht._lut[e>>8&255]+ht._lut[e>>16&255]+ht._lut[e>>24&255]}-${ht._lut[t&255]}${ht._lut[t>>8&255]}-${ht._lut[t>>16&15|64]}${ht._lut[t>>24&255]}-${ht._lut[i&63|128]}${ht._lut[i>>8&255]}-${ht._lut[i>>16&255]}${ht._lut[i>>24&255]}${ht._lut[n&255]}${ht._lut[n>>8&255]}${ht._lut[n>>16&255]}${ht._lut[n>>24&255]}`.toLowerCase()}static validate(e){if(!ht._pattern.test(e))throw new Error(`${e} is not a valid UUID v4. - If you're the tool creator, you can take one from https://www.uuidgenerator.net/. -- If you're using a platform tool, verify the uuid isn't misspelled or contact the tool creator.`)}};A(oh,"_pattern",/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/),A(oh,"_lut",["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"]);let iu=oh;class x1 extends Re{constructor(e,t){super(e),A(this,"onVertexFound",new ee),A(this,"onVertexLost",new ee),A(this,"components"),A(this,"_pickedPoint",null),A(this,"_config"),A(this,"_enabled",!1),A(this,"_workingPlane",null),this.components=e,this.config={snapDistance:.25,showOnlyVertex:!1,...t},this.enabled=!1}set enabled(e){this._enabled=e,e||(this._pickedPoint=null)}get enabled(){return this._enabled}set workingPlane(e){this._workingPlane=e}get workingPlane(){return this._workingPlane}set config(e){this._config={...this._config,...e}}get config(){return this._config}dispose(){this.onVertexFound.reset(),this.onVertexLost.reset(),this.components=null}get(e){if(!this.enabled)return this._pickedPoint;const t=this.components.get(ni).get(e).castRay();if(!t)return this._pickedPoint!==null&&(this.onVertexLost.trigger(),this._pickedPoint=null),this._pickedPoint;const i=this.getClosestVertex(t);return i?!this.workingPlane||Math.abs(this.workingPlane.distanceToPoint(i))<.001?((this._pickedPoint===null||!this._pickedPoint.equals(i))&&(this._pickedPoint=i.clone(),this.onVertexFound.trigger(this._pickedPoint)),this._pickedPoint):(this._pickedPoint=null,this._pickedPoint):(this._pickedPoint!==null&&(this.onVertexLost.trigger(),this._pickedPoint=null),this._pickedPoint)}getClosestVertex(e){let t=new F,i=!1,n=Number.MAX_SAFE_INTEGER;const r=this.getVertices(e);return r==null||r.forEach(o=>{if(!o)return;const a=e.point.distanceTo(o);a>n||a>this._config.snapDistance||(i=!0,t=o,n=e.point.distanceTo(o))}),i?t:this.config.showOnlyVertex?null:e.point}getVertices(e){const t=e.object;if(!e.face||!t)return null;const i=t.geometry;return[this.getVertex(e.face.a,i),this.getVertex(e.face.b,i),this.getVertex(e.face.c,i)].map(n=>n==null?void 0:n.applyMatrix4(t.matrixWorld))}getVertex(e,t){if(e===void 0)return null;const i=t.attributes.position;return new F(i.getX(e),i.getY(e),i.getZ(e))}}const zf=class Vf{constructor(){A(this,"onDisposed",new ee),A(this,"list",new Map),A(this,"enabled",!1),A(this,"_clock"),A(this,"update",()=>{if(!this.enabled)return;const e=this._clock.getDelta();for(const[t,i]of this.list)i.enabled&&i.isUpdateable()&&i.update(e);requestAnimationFrame(this.update)}),this._clock=new yf,Vf.setupBVH()}add(e,t){if(this.list.has(e))throw new Error("You're trying to add a component that already exists in the components intance. Use Components.get() instead.");iu.validate(e),this.list.set(e,t)}get(e){const t=e.uuid;if(!this.list.has(t)){const i=new e(this);return this.list.has(t)||this.add(t,i),i}return this.list.get(t)}init(){this.enabled=!0,this._clock.start(),this.update()}dispose(){this.enabled=!1;for(const[e,t]of this.list)t.enabled=!1,t.isDisposeable()&&t.dispose();this._clock.stop(),this.onDisposed.trigger(),this.onDisposed.reset()}static setupBVH(){Ne.prototype.computeBoundsTree=u1,Ne.prototype.disposeBoundsTree=d1,le.prototype.raycast=h1}};A(zf,"release","1.4.21");let A1=zf;class S1{constructor(e){A(this,"_event"),A(this,"_position",new Ve),A(this,"onDisposed",new ee),A(this,"updateMouseInfo",t=>{this._event=t}),this.dom=e,this.setupEvents(!0)}get position(){if(this._event){const e=this.dom.getBoundingClientRect();this._position.x=this.getPositionX(e,this._event),this._position.y=this.getPositionY(e,this._event)}return this._position}dispose(){this.setupEvents(!1),this.onDisposed.trigger(),this.onDisposed.reset()}getPositionY(e,t){return-((t.clientY-e.top)/(e.bottom-e.top))*2+1}getPositionX(e,t){return(t.clientX-e.left)/(e.right-e.left)*2-1}setupEvents(e){e?this.dom.addEventListener("mousemove",this.updateMouseInfo):this.dom.removeEventListener("mousemove",this.updateMouseInfo)}}class _1{constructor(e,t){A(this,"enabled",!0),A(this,"components"),A(this,"onDisposed",new ee),A(this,"mouse"),A(this,"three",new io),A(this,"world");const i=t.renderer;if(!i)throw new Error("A renderer is needed for the raycaster to work!");this.world=t,this.mouse=new S1(i.three.domElement),this.components=e}dispose(){this.mouse.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}castRay(e=Array.from(this.world.meshes)){if(!this.world)throw new Error("A world is needed to cast rays!");const t=this.world.camera.three;return this.three.setFromCamera(this.mouse.position,t),this.intersect(e)}castRayFromVector(e,t,i=Array.from(this.world.meshes)){return this.three.set(e,t),this.intersect(i)}intersect(e=Array.from(this.world.meshes)){const t=this.three.intersectObjects(e),i=this.filterClippingPlanes(t);return i.length>0?i[0]:null}filterClippingPlanes(e){if(!this.world.renderer)throw new Error("Renderer not found!");const t=this.world.renderer.three;if(!t.clippingPlanes)return e;const i=t.clippingPlanes;return e.length<=0||!i||(i==null?void 0:i.length)<=0?e:e.filter(n=>i.every(r=>r.distanceToPoint(n.point)>0))}}const Hf=class Yf extends Re{constructor(e){super(e),A(this,"enabled",!0),A(this,"list",new Map),A(this,"onDisposed",new ee),e.add(Yf.uuid,this)}get(e){if(this.list.has(e.uuid))return this.list.get(e.uuid);const t=new _1(this.components,e);return this.list.set(e.uuid,t),e.onDisposed.add(()=>{this.delete(e)}),t}delete(e){const t=this.list.get(e.uuid);t&&t.dispose(),this.list.delete(e.uuid)}dispose(){for(const[e,t]of this.list)t.dispose();this.list.clear(),this.onDisposed.trigger()}};A(Hf,"uuid","d5d8bdf0-db25-4952-b951-b643af207ace");let ni=Hf;class R1 extends tu{constructor(e){super(e),A(this,"meshes",new Set),A(this,"onAfterUpdate",new ee),A(this,"onBeforeUpdate",new ee),A(this,"enabled",!0),A(this,"uuid",iu.create()),A(this,"onDisposed",new ee),A(this,"_scene"),A(this,"_camera"),A(this,"_renderer",null)}get scene(){if(!this._scene)throw new Error("No scene initialized!");return this._scene}set scene(e){this._scene=e,e.worlds.set(this.uuid,this),e.currentWorld=this,e.onWorldChanged.trigger({world:this,action:"added"})}get camera(){if(!this._camera)throw new Error("No camera initialized!");return this._camera}set camera(e){this._camera=e,e.worlds.set(this.uuid,this),e.currentWorld=this,e.onWorldChanged.trigger({world:this,action:"added"})}get renderer(){return this._renderer}set renderer(e){this._renderer=e,e&&(e.worlds.set(this.uuid,this),e.currentWorld=this,e.onWorldChanged.trigger({world:this,action:"added"}))}update(e){this.enabled&&(!this._scene||!this._camera||(this.scene.currentWorld=this,this.camera.currentWorld=this,this.renderer&&(this.renderer.currentWorld=this),this.onBeforeUpdate.trigger(),this.scene.isUpdateable()&&this.scene.update(e),this.camera.isUpdateable()&&this.camera.update(e),this.renderer&&this.renderer.update(e),this.onAfterUpdate.trigger()))}dispose(e=!0){if(this.enabled=!1,this.scene.onWorldChanged.trigger({world:this,action:"removed"}),this.camera.onWorldChanged.trigger({world:this,action:"removed"}),this.renderer&&this.renderer.onWorldChanged.trigger({world:this,action:"removed"}),e){const t=this.components.get(Oi);this.scene.dispose(),this.camera.isDisposeable()&&this.camera.dispose(),this.renderer&&this.renderer.dispose();for(const i of this.meshes)t.destroy(i);this.meshes.clear()}this._scene=null,this._camera=null,this._renderer=null,this.onDisposed.trigger()}}class P1 extends f1{constructor(e,t,i){super(e),A(this,"enabled",!0),A(this,"container"),A(this,"three"),A(this,"_canvas"),A(this,"_parameters"),A(this,"_resizeObserver",null),A(this,"onContainerUpdated",new ee),A(this,"_resizing",!1),A(this,"resize",o=>{if(this._resizing)return;this._resizing=!0,this.onContainerUpdated.trigger();const a=o?o.x:this.container.clientWidth,l=o?o.y:this.container.clientHeight;this.three.setSize(a,l),this.onResize.trigger(new Ve(a,l)),this._resizing=!1}),A(this,"resizeEvent",()=>{this.resize()}),A(this,"onContextLost",o=>{o.preventDefault(),this.enabled=!1}),A(this,"onContextBack",()=>{this.three.setRenderTarget(null),this.three.dispose(),this.three=new Ha({canvas:this._canvas,antialias:!0,alpha:!0,...this._parameters}),this.enabled=!0}),this.container=t,this._parameters=i,this.three=new Ha({antialias:!0,alpha:!0,...i}),this.three.setPixelRatio(Math.min(window.devicePixelRatio,2)),this.setupRenderer(),this.setupEvents(!0),this.resize(),this._canvas=this.three.domElement;const n=this.three.getContext(),{canvas:r}=n;r.addEventListener("webglcontextlost",this.onContextLost,!1),r.addEventListener("webglcontextrestored",this.onContextBack,!1)}update(){if(!this.enabled||!this.currentWorld)return;this.onBeforeUpdate.trigger(this);const e=this.currentWorld.scene.three,t=this.currentWorld.camera.three;this.three.render(e,t),this.onAfterUpdate.trigger(this)}dispose(){this.enabled=!1,this.setupEvents(!1),this.three.domElement.remove(),this.three.dispose(),this.onResize.reset(),this.onAfterUpdate.reset(),this.onBeforeUpdate.reset(),this.onDisposed.trigger(),this.onDisposed.reset()}getSize(){return new Ve(this.three.domElement.clientWidth,this.three.domElement.clientHeight)}setupEvents(e){const t=this.three.domElement.parentElement;if(!t)throw new Error("This renderer needs to have an HTML container!");this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),window.removeEventListener("resize",this.resizeEvent),e&&(this._resizeObserver=new ResizeObserver(this.resizeEvent),this._resizeObserver.observe(t),window.addEventListener("resize",this.resizeEvent))}setupRenderer(){this.three.localClippingEnabled=!0,this.container&&this.container.appendChild(this.three.domElement),this.onContainerUpdated.trigger()}}/*! +- If you're using a platform tool, verify the uuid isn't misspelled or contact the tool creator.`)}};A(ah,"_pattern",/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/),A(ah,"_lut",["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"]);let nu=ah;class x1 extends Re{constructor(e,t){super(e),A(this,"onVertexFound",new ee),A(this,"onVertexLost",new ee),A(this,"components"),A(this,"_pickedPoint",null),A(this,"_config"),A(this,"_enabled",!1),A(this,"_workingPlane",null),this.components=e,this.config={snapDistance:.25,showOnlyVertex:!1,...t},this.enabled=!1}set enabled(e){this._enabled=e,e||(this._pickedPoint=null)}get enabled(){return this._enabled}set workingPlane(e){this._workingPlane=e}get workingPlane(){return this._workingPlane}set config(e){this._config={...this._config,...e}}get config(){return this._config}dispose(){this.onVertexFound.reset(),this.onVertexLost.reset(),this.components=null}get(e){if(!this.enabled)return this._pickedPoint;const t=this.components.get(ni).get(e).castRay();if(!t)return this._pickedPoint!==null&&(this.onVertexLost.trigger(),this._pickedPoint=null),this._pickedPoint;const i=this.getClosestVertex(t);return i?!this.workingPlane||Math.abs(this.workingPlane.distanceToPoint(i))<.001?((this._pickedPoint===null||!this._pickedPoint.equals(i))&&(this._pickedPoint=i.clone(),this.onVertexFound.trigger(this._pickedPoint)),this._pickedPoint):(this._pickedPoint=null,this._pickedPoint):(this._pickedPoint!==null&&(this.onVertexLost.trigger(),this._pickedPoint=null),this._pickedPoint)}getClosestVertex(e){let t=new O,i=!1,n=Number.MAX_SAFE_INTEGER;const r=this.getVertices(e);return r==null||r.forEach(o=>{if(!o)return;const a=e.point.distanceTo(o);a>n||a>this._config.snapDistance||(i=!0,t=o,n=e.point.distanceTo(o))}),i?t:this.config.showOnlyVertex?null:e.point}getVertices(e){const t=e.object;if(!e.face||!t)return null;const i=t.geometry;return[this.getVertex(e.face.a,i),this.getVertex(e.face.b,i),this.getVertex(e.face.c,i)].map(n=>n==null?void 0:n.applyMatrix4(t.matrixWorld))}getVertex(e,t){if(e===void 0)return null;const i=t.attributes.position;return new O(i.getX(e),i.getY(e),i.getZ(e))}}const Bf=class zf{constructor(){A(this,"onDisposed",new ee),A(this,"list",new Map),A(this,"enabled",!1),A(this,"_clock"),A(this,"update",()=>{if(!this.enabled)return;const e=this._clock.getDelta();for(const[t,i]of this.list)i.enabled&&i.isUpdateable()&&i.update(e);requestAnimationFrame(this.update)}),this._clock=new vf,zf.setupBVH()}add(e,t){if(this.list.has(e))throw new Error("You're trying to add a component that already exists in the components intance. Use Components.get() instead.");nu.validate(e),this.list.set(e,t)}get(e){const t=e.uuid;if(!this.list.has(t)){const i=new e(this);return this.list.has(t)||this.add(t,i),i}return this.list.get(t)}init(){this.enabled=!0,this._clock.start(),this.update()}dispose(){this.enabled=!1;for(const[e,t]of this.list)t.enabled=!1,t.isDisposeable()&&t.dispose();this._clock.stop(),this.onDisposed.trigger(),this.onDisposed.reset()}static setupBVH(){Ne.prototype.computeBoundsTree=u1,Ne.prototype.disposeBoundsTree=d1,le.prototype.raycast=h1}};A(Bf,"release","1.4.21");let A1=Bf;class S1{constructor(e){A(this,"_event"),A(this,"_position",new Ve),A(this,"onDisposed",new ee),A(this,"updateMouseInfo",t=>{this._event=t}),this.dom=e,this.setupEvents(!0)}get position(){if(this._event){const e=this.dom.getBoundingClientRect();this._position.x=this.getPositionX(e,this._event),this._position.y=this.getPositionY(e,this._event)}return this._position}dispose(){this.setupEvents(!1),this.onDisposed.trigger(),this.onDisposed.reset()}getPositionY(e,t){return-((t.clientY-e.top)/(e.bottom-e.top))*2+1}getPositionX(e,t){return(t.clientX-e.left)/(e.right-e.left)*2-1}setupEvents(e){e?this.dom.addEventListener("mousemove",this.updateMouseInfo):this.dom.removeEventListener("mousemove",this.updateMouseInfo)}}class _1{constructor(e,t){A(this,"enabled",!0),A(this,"components"),A(this,"onDisposed",new ee),A(this,"mouse"),A(this,"three",new io),A(this,"world");const i=t.renderer;if(!i)throw new Error("A renderer is needed for the raycaster to work!");this.world=t,this.mouse=new S1(i.three.domElement),this.components=e}dispose(){this.mouse.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}castRay(e=Array.from(this.world.meshes)){if(!this.world)throw new Error("A world is needed to cast rays!");const t=this.world.camera.three;return this.three.setFromCamera(this.mouse.position,t),this.intersect(e)}castRayFromVector(e,t,i=Array.from(this.world.meshes)){return this.three.set(e,t),this.intersect(i)}intersect(e=Array.from(this.world.meshes)){const t=this.three.intersectObjects(e),i=this.filterClippingPlanes(t);return i.length>0?i[0]:null}filterClippingPlanes(e){if(!this.world.renderer)throw new Error("Renderer not found!");const t=this.world.renderer.three;if(!t.clippingPlanes)return e;const i=t.clippingPlanes;return e.length<=0||!i||(i==null?void 0:i.length)<=0?e:e.filter(n=>i.every(r=>r.distanceToPoint(n.point)>0))}}const Vf=class Hf extends Re{constructor(e){super(e),A(this,"enabled",!0),A(this,"list",new Map),A(this,"onDisposed",new ee),e.add(Hf.uuid,this)}get(e){if(this.list.has(e.uuid))return this.list.get(e.uuid);const t=new _1(this.components,e);return this.list.set(e.uuid,t),e.onDisposed.add(()=>{this.delete(e)}),t}delete(e){const t=this.list.get(e.uuid);t&&t.dispose(),this.list.delete(e.uuid)}dispose(){for(const[e,t]of this.list)t.dispose();this.list.clear(),this.onDisposed.trigger()}};A(Vf,"uuid","d5d8bdf0-db25-4952-b951-b643af207ace");let ni=Vf;class R1 extends iu{constructor(e){super(e),A(this,"meshes",new Set),A(this,"onAfterUpdate",new ee),A(this,"onBeforeUpdate",new ee),A(this,"enabled",!0),A(this,"uuid",nu.create()),A(this,"onDisposed",new ee),A(this,"_scene"),A(this,"_camera"),A(this,"_renderer",null)}get scene(){if(!this._scene)throw new Error("No scene initialized!");return this._scene}set scene(e){this._scene=e,e.worlds.set(this.uuid,this),e.currentWorld=this,e.onWorldChanged.trigger({world:this,action:"added"})}get camera(){if(!this._camera)throw new Error("No camera initialized!");return this._camera}set camera(e){this._camera=e,e.worlds.set(this.uuid,this),e.currentWorld=this,e.onWorldChanged.trigger({world:this,action:"added"})}get renderer(){return this._renderer}set renderer(e){this._renderer=e,e&&(e.worlds.set(this.uuid,this),e.currentWorld=this,e.onWorldChanged.trigger({world:this,action:"added"}))}update(e){this.enabled&&(!this._scene||!this._camera||(this.scene.currentWorld=this,this.camera.currentWorld=this,this.renderer&&(this.renderer.currentWorld=this),this.onBeforeUpdate.trigger(),this.scene.isUpdateable()&&this.scene.update(e),this.camera.isUpdateable()&&this.camera.update(e),this.renderer&&this.renderer.update(e),this.onAfterUpdate.trigger()))}dispose(e=!0){if(this.enabled=!1,this.scene.onWorldChanged.trigger({world:this,action:"removed"}),this.camera.onWorldChanged.trigger({world:this,action:"removed"}),this.renderer&&this.renderer.onWorldChanged.trigger({world:this,action:"removed"}),e){const t=this.components.get(Fi);this.scene.dispose(),this.camera.isDisposeable()&&this.camera.dispose(),this.renderer&&this.renderer.dispose();for(const i of this.meshes)t.destroy(i);this.meshes.clear()}this._scene=null,this._camera=null,this._renderer=null,this.onDisposed.trigger()}}class P1 extends f1{constructor(e,t,i){super(e),A(this,"enabled",!0),A(this,"container"),A(this,"three"),A(this,"_canvas"),A(this,"_parameters"),A(this,"_resizeObserver",null),A(this,"onContainerUpdated",new ee),A(this,"_resizing",!1),A(this,"resize",o=>{if(this._resizing)return;this._resizing=!0,this.onContainerUpdated.trigger();const a=o?o.x:this.container.clientWidth,l=o?o.y:this.container.clientHeight;this.three.setSize(a,l),this.onResize.trigger(new Ve(a,l)),this._resizing=!1}),A(this,"resizeEvent",()=>{this.resize()}),A(this,"onContextLost",o=>{o.preventDefault(),this.enabled=!1}),A(this,"onContextBack",()=>{this.three.setRenderTarget(null),this.three.dispose(),this.three=new Ha({canvas:this._canvas,antialias:!0,alpha:!0,...this._parameters}),this.enabled=!0}),this.container=t,this._parameters=i,this.three=new Ha({antialias:!0,alpha:!0,...i}),this.three.setPixelRatio(Math.min(window.devicePixelRatio,2)),this.setupRenderer(),this.setupEvents(!0),this.resize(),this._canvas=this.three.domElement;const n=this.three.getContext(),{canvas:r}=n;r.addEventListener("webglcontextlost",this.onContextLost,!1),r.addEventListener("webglcontextrestored",this.onContextBack,!1)}update(){if(!this.enabled||!this.currentWorld)return;this.onBeforeUpdate.trigger(this);const e=this.currentWorld.scene.three,t=this.currentWorld.camera.three;this.three.render(e,t),this.onAfterUpdate.trigger(this)}dispose(){this.enabled=!1,this.setupEvents(!1),this.three.domElement.remove(),this.three.dispose(),this.onResize.reset(),this.onAfterUpdate.reset(),this.onBeforeUpdate.reset(),this.onDisposed.trigger(),this.onDisposed.reset()}getSize(){return new Ve(this.three.domElement.clientWidth,this.three.domElement.clientHeight)}setupEvents(e){const t=this.three.domElement.parentElement;if(!t)throw new Error("This renderer needs to have an HTML container!");this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),window.removeEventListener("resize",this.resizeEvent),e&&(this._resizeObserver=new ResizeObserver(this.resizeEvent),this._resizeObserver.observe(t),window.addEventListener("resize",this.resizeEvent))}setupRenderer(){this.three.localClippingEnabled=!0,this.container&&this.container.appendChild(this.three.domElement),this.onContainerUpdated.trigger()}}/*! * camera-controls * https://github.com/yomotsu/camera-controls * (c) 2017 @yomotsu * Released under the MIT License. - */const Ce={LEFT:1,RIGHT:2,MIDDLE:4},J=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,OFFSET:4,DOLLY:8,ZOOM:16,TOUCH_ROTATE:32,TOUCH_TRUCK:64,TOUCH_OFFSET:128,TOUCH_DOLLY:256,TOUCH_ZOOM:512,TOUCH_DOLLY_TRUCK:1024,TOUCH_DOLLY_OFFSET:2048,TOUCH_DOLLY_ROTATE:4096,TOUCH_ZOOM_TRUCK:8192,TOUCH_ZOOM_OFFSET:16384,TOUCH_ZOOM_ROTATE:32768}),gs={NONE:0,IN:1,OUT:-1};function Cn(s){return s.isPerspectiveCamera}function Qi(s){return s.isOrthographicCamera}const vs=Math.PI*2,Ld=Math.PI/2,Gf=1e-5,wr=Math.PI/180;function ti(s,e,t){return Math.max(e,Math.min(t,s))}function Ye(s,e=Gf){return Math.abs(s)0==g>d&&(g=d,t.value=(g-d)/r),g}function Nd(s,e,t,i,n=1/0,r,o){i=Math.max(1e-4,i);const a=2/i,l=a*r,h=1/(1+l+.48*l*l+.235*l*l*l);let d=e.x,p=e.y,f=e.z,g=s.x-d,y=s.y-p,b=s.z-f;const w=d,T=p,S=f,_=n*i,I=_*_,P=g*g+y*y+b*b;if(P>I){const ve=Math.sqrt(P);g=g/ve*_,y=y/ve*_,b=b/ve*_}d=s.x-g,p=s.y-y,f=s.z-b;const M=(t.x+a*g)*r,k=(t.y+a*y)*r,V=(t.z+a*b)*r;t.x=(t.x-a*M)*h,t.y=(t.y-a*k)*h,t.z=(t.z-a*V)*h,o.x=d+(g+M)*h,o.y=p+(y+k)*h,o.z=f+(b+V)*h;const W=w-s.x,j=T-s.y,Q=S-s.z,$=o.x-w,ne=o.y-T,oe=o.z-S;return W*$+j*ne+Q*oe>0&&(o.x=w,o.y=T,o.z=S,t.x=(o.x-w)/r,t.y=(o.y-T)/r,t.z=(o.z-S)/r),o}function Fc(s,e){e.set(0,0),s.forEach(t=>{e.x+=t.clientX,e.y+=t.clientY}),e.x/=s.length,e.y/=s.length}function Oc(s,e){return Qi(s)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}class F1{constructor(){this._listeners={}}addEventListener(e,t){const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners[e];if(i!==void 0){const n=i.indexOf(t);n!==-1&&i.splice(n,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){const t=this._listeners[e.type];if(t!==void 0){e.target=this;const i=t.slice(0);for(let n=0,r=i.length;n{},this._enabled=!0,this._state=J.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=gs.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new be.Vector3,this._focalOffsetVelocity=new be.Vector3,this._zoomVelocity={value:0},this._truckInternal=(I,P,M)=>{let k,V;if(Cn(this._camera)){const W=Te.copy(this._camera.position).sub(this._target),j=this._camera.getEffectiveFOV()*wr,Q=W.length()*Math.tan(j*.5);k=this.truckSpeed*I*Q/this._elementRect.height,V=this.truckSpeed*P*Q/this._elementRect.height}else if(Qi(this._camera)){const W=this._camera;k=I*(W.right-W.left)/W.zoom/this._elementRect.width,V=P*(W.top-W.bottom)/W.zoom/this._elementRect.height}else return;this.verticalDragToForward?(M?this.setFocalOffset(this._focalOffsetEnd.x+k,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(k,0,!0),this.forward(-V,!0)):M?this.setFocalOffset(this._focalOffsetEnd.x+k,this._focalOffsetEnd.y+V,this._focalOffsetEnd.z,!0):this.truck(k,V,!0)},this._rotateInternal=(I,P)=>{const M=vs*this.azimuthRotateSpeed*I/this._elementRect.height,k=vs*this.polarRotateSpeed*P/this._elementRect.height;this.rotate(M,k,!0)},this._dollyInternal=(I,P,M)=>{const k=Math.pow(.95,-I*this.dollySpeed),V=this._sphericalEnd.radius,W=this._sphericalEnd.radius*k,j=ti(W,this.minDistance,this.maxDistance),Q=j-W;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(W,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(Q,!0),this._dollyToNoClamp(j,!0)):this._dollyToNoClamp(j,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?W:j)-V,this._dollyControlCoord.set(P,M)),this._lastDollyDirection=Math.sign(-I)},this._zoomInternal=(I,P,M)=>{const k=Math.pow(.95,I*this.dollySpeed),V=this._zoom,W=this._zoom*k;this.zoomTo(W,!0),this.dollyToCursor&&(this._changedZoom+=W-V,this._dollyControlCoord.set(P,M))},typeof be>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new be.Quaternion().setFromUnitVectors(this._camera.up,ma),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=J.NONE,this._target=new be.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new be.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new be.Spherical().setFromVector3(Te.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new be.Vector3,new be.Vector3,new be.Vector3,new be.Vector3],this._updateNearPlaneCorners(),this._boundary=new be.Box3(new be.Vector3(-1/0,-1/0,-1/0),new be.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new be.Vector2,this.mouseButtons={left:J.ROTATE,middle:J.DOLLY,right:J.TRUCK,wheel:Cn(this._camera)?J.DOLLY:Qi(this._camera)?J.ZOOM:J.NONE},this.touches={one:J.TOUCH_ROTATE,two:Cn(this._camera)?J.TOUCH_DOLLY_TRUCK:Qi(this._camera)?J.TOUCH_ZOOM_TRUCK:J.NONE,three:J.TOUCH_TRUCK};const i=new be.Vector2,n=new be.Vector2,r=new be.Vector2,o=I=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const k=this._domElement.getBoundingClientRect(),V=I.clientX/k.width,W=I.clientY/k.height;if(Vthis._interactiveArea.right||Wthis._interactiveArea.bottom)return}const P=I.pointerType!=="mouse"?null:(I.buttons&Ce.LEFT)===Ce.LEFT?Ce.LEFT:(I.buttons&Ce.MIDDLE)===Ce.MIDDLE?Ce.MIDDLE:(I.buttons&Ce.RIGHT)===Ce.RIGHT?Ce.RIGHT:null;if(P!==null){const k=this._findPointerByMouseButton(P);k&&this._disposePointer(k)}if((I.buttons&Ce.LEFT)===Ce.LEFT&&this._lockedPointer)return;const M={pointerId:I.pointerId,clientX:I.clientX,clientY:I.clientY,deltaX:0,deltaY:0,mouseButton:P};this._activePointers.push(M),this._domElement.ownerDocument.removeEventListener("pointermove",l,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.addEventListener("pointermove",l,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",d),this._isDragging=!0,b(I)},a=I=>{if(!this._enabled||!this._domElement||this._lockedPointer)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const k=this._domElement.getBoundingClientRect(),V=I.clientX/k.width,W=I.clientY/k.height;if(Vthis._interactiveArea.right||Wthis._interactiveArea.bottom)return}const P=(I.buttons&Ce.LEFT)===Ce.LEFT?Ce.LEFT:(I.buttons&Ce.MIDDLE)===Ce.MIDDLE?Ce.MIDDLE:(I.buttons&Ce.RIGHT)===Ce.RIGHT?Ce.RIGHT:null;if(P!==null){const k=this._findPointerByMouseButton(P);k&&this._disposePointer(k)}const M={pointerId:1,clientX:I.clientX,clientY:I.clientY,deltaX:0,deltaY:0,mouseButton:(I.buttons&Ce.LEFT)===Ce.LEFT?Ce.LEFT:(I.buttons&Ce.MIDDLE)===Ce.LEFT?Ce.MIDDLE:(I.buttons&Ce.RIGHT)===Ce.LEFT?Ce.RIGHT:null};this._activePointers.push(M),this._domElement.ownerDocument.removeEventListener("mousemove",h),this._domElement.ownerDocument.removeEventListener("mouseup",p),this._domElement.ownerDocument.addEventListener("mousemove",h),this._domElement.ownerDocument.addEventListener("mouseup",p),this._isDragging=!0,b(I)},l=I=>{I.cancelable&&I.preventDefault();const P=I.pointerId,M=this._lockedPointer||this._findPointerById(P);if(M){if(M.clientX=I.clientX,M.clientY=I.clientY,M.deltaX=I.movementX,M.deltaY=I.movementY,this._state=0,I.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(I.buttons&Ce.LEFT)===Ce.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(I.buttons&Ce.MIDDLE)===Ce.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(I.buttons&Ce.RIGHT)===Ce.RIGHT&&(this._state=this._state|this.mouseButtons.right);w()}},h=I=>{const P=this._lockedPointer||this._findPointerById(1);P&&(P.clientX=I.clientX,P.clientY=I.clientY,P.deltaX=I.movementX,P.deltaY=I.movementY,this._state=0,(this._lockedPointer||(I.buttons&Ce.LEFT)===Ce.LEFT)&&(this._state=this._state|this.mouseButtons.left),(I.buttons&Ce.MIDDLE)===Ce.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(I.buttons&Ce.RIGHT)===Ce.RIGHT&&(this._state=this._state|this.mouseButtons.right),w())},d=I=>{const P=this._findPointerById(I.pointerId);if(!(P&&P===this._lockedPointer)){if(P&&this._disposePointer(P),I.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=J.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=J.NONE;T()}},p=()=>{const I=this._findPointerById(1);I&&I===this._lockedPointer||(I&&this._disposePointer(I),this._state=J.NONE,T())};let f=-1;const g=I=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===J.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const W=this._domElement.getBoundingClientRect(),j=I.clientX/W.width,Q=I.clientY/W.height;if(jthis._interactiveArea.right||Qthis._interactiveArea.bottom)return}if(I.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===J.ROTATE||this.mouseButtons.wheel===J.TRUCK){const W=performance.now();f-W<1e3&&this._getClientRect(this._elementRect),f=W}const P=M1?-1:-3,M=I.deltaMode===1?I.deltaY/P:I.deltaY/(P*10),k=this.dollyToCursor?(I.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,V=this.dollyToCursor?(I.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case J.ROTATE:{this._rotateInternal(I.deltaX,I.deltaY),this._isUserControllingRotate=!0;break}case J.TRUCK:{this._truckInternal(I.deltaX,I.deltaY,!1),this._isUserControllingTruck=!0;break}case J.OFFSET:{this._truckInternal(I.deltaX,I.deltaY,!0),this._isUserControllingOffset=!0;break}case J.DOLLY:{this._dollyInternal(-M,k,V),this._isUserControllingDolly=!0;break}case J.ZOOM:{this._zoomInternal(-M,k,V),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},y=I=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===ah.ACTION.NONE){const P=I instanceof PointerEvent?I.pointerId:0,M=this._findPointerById(P);M&&this._disposePointer(M),this._domElement.ownerDocument.removeEventListener("pointermove",l,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mousemove",h),this._domElement.ownerDocument.removeEventListener("mouseup",p);return}I.preventDefault()}},b=I=>{if(this._enabled){if(Fc(this._activePointers,St),this._getClientRect(this._elementRect),i.copy(St),n.copy(St),this._activePointers.length>=2){const P=St.x-this._activePointers[1].clientX,M=St.y-this._activePointers[1].clientY,k=Math.sqrt(P*P+M*M);r.set(0,k);const V=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,W=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;n.set(V,W)}if(this._state=0,!I)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in I&&I.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(I.buttons&Ce.LEFT)===Ce.LEFT&&(this._state=this._state|this.mouseButtons.left),(I.buttons&Ce.MIDDLE)===Ce.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(I.buttons&Ce.RIGHT)===Ce.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&J.ROTATE)===J.ROTATE||(this._state&J.TOUCH_ROTATE)===J.TOUCH_ROTATE||(this._state&J.TOUCH_DOLLY_ROTATE)===J.TOUCH_DOLLY_ROTATE||(this._state&J.TOUCH_ZOOM_ROTATE)===J.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&J.TRUCK)===J.TRUCK||(this._state&J.TOUCH_TRUCK)===J.TOUCH_TRUCK||(this._state&J.TOUCH_DOLLY_TRUCK)===J.TOUCH_DOLLY_TRUCK||(this._state&J.TOUCH_ZOOM_TRUCK)===J.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&J.DOLLY)===J.DOLLY||(this._state&J.TOUCH_DOLLY)===J.TOUCH_DOLLY||(this._state&J.TOUCH_DOLLY_TRUCK)===J.TOUCH_DOLLY_TRUCK||(this._state&J.TOUCH_DOLLY_OFFSET)===J.TOUCH_DOLLY_OFFSET||(this._state&J.TOUCH_DOLLY_ROTATE)===J.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&J.ZOOM)===J.ZOOM||(this._state&J.TOUCH_ZOOM)===J.TOUCH_ZOOM||(this._state&J.TOUCH_ZOOM_TRUCK)===J.TOUCH_ZOOM_TRUCK||(this._state&J.TOUCH_ZOOM_OFFSET)===J.TOUCH_ZOOM_OFFSET||(this._state&J.TOUCH_ZOOM_ROTATE)===J.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&J.OFFSET)===J.OFFSET||(this._state&J.TOUCH_OFFSET)===J.TOUCH_OFFSET||(this._state&J.TOUCH_DOLLY_OFFSET)===J.TOUCH_DOLLY_OFFSET||(this._state&J.TOUCH_ZOOM_OFFSET)===J.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})}},w=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,Fc(this._activePointers,St);const I=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,P=I?-I.deltaX:n.x-St.x,M=I?-I.deltaY:n.y-St.y;if(n.copy(St),((this._state&J.ROTATE)===J.ROTATE||(this._state&J.TOUCH_ROTATE)===J.TOUCH_ROTATE||(this._state&J.TOUCH_DOLLY_ROTATE)===J.TOUCH_DOLLY_ROTATE||(this._state&J.TOUCH_ZOOM_ROTATE)===J.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(P,M),this._isUserControllingRotate=!0),(this._state&J.DOLLY)===J.DOLLY||(this._state&J.ZOOM)===J.ZOOM){const k=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,V=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0,W=this.dollyDragInverted?-1:1;(this._state&J.DOLLY)===J.DOLLY?(this._dollyInternal(W*M*fa,k,V),this._isUserControllingDolly=!0):(this._zoomInternal(W*M*fa,k,V),this._isUserControllingZoom=!0)}if((this._state&J.TOUCH_DOLLY)===J.TOUCH_DOLLY||(this._state&J.TOUCH_ZOOM)===J.TOUCH_ZOOM||(this._state&J.TOUCH_DOLLY_TRUCK)===J.TOUCH_DOLLY_TRUCK||(this._state&J.TOUCH_ZOOM_TRUCK)===J.TOUCH_ZOOM_TRUCK||(this._state&J.TOUCH_DOLLY_OFFSET)===J.TOUCH_DOLLY_OFFSET||(this._state&J.TOUCH_ZOOM_OFFSET)===J.TOUCH_ZOOM_OFFSET||(this._state&J.TOUCH_DOLLY_ROTATE)===J.TOUCH_DOLLY_ROTATE||(this._state&J.TOUCH_ZOOM_ROTATE)===J.TOUCH_ZOOM_ROTATE){const k=St.x-this._activePointers[1].clientX,V=St.y-this._activePointers[1].clientY,W=Math.sqrt(k*k+V*V),j=r.y-W;r.set(0,W);const Q=this.dollyToCursor?(n.x-this._elementRect.x)/this._elementRect.width*2-1:0,$=this.dollyToCursor?(n.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&J.TOUCH_DOLLY)===J.TOUCH_DOLLY||(this._state&J.TOUCH_DOLLY_ROTATE)===J.TOUCH_DOLLY_ROTATE||(this._state&J.TOUCH_DOLLY_TRUCK)===J.TOUCH_DOLLY_TRUCK||(this._state&J.TOUCH_DOLLY_OFFSET)===J.TOUCH_DOLLY_OFFSET?(this._dollyInternal(j*fa,Q,$),this._isUserControllingDolly=!0):(this._zoomInternal(j*fa,Q,$),this._isUserControllingZoom=!0)}((this._state&J.TRUCK)===J.TRUCK||(this._state&J.TOUCH_TRUCK)===J.TOUCH_TRUCK||(this._state&J.TOUCH_DOLLY_TRUCK)===J.TOUCH_DOLLY_TRUCK||(this._state&J.TOUCH_ZOOM_TRUCK)===J.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(P,M,!1),this._isUserControllingTruck=!0),((this._state&J.OFFSET)===J.OFFSET||(this._state&J.TOUCH_OFFSET)===J.TOUCH_OFFSET||(this._state&J.TOUCH_DOLLY_OFFSET)===J.TOUCH_DOLLY_OFFSET||(this._state&J.TOUCH_ZOOM_OFFSET)===J.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(P,M,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},T=()=>{Fc(this._activePointers,St),n.copy(St),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",l,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",h),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mouseup",p),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",l,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",S),this._domElement.ownerDocument.addEventListener("pointerlockerror",_),this._domElement.ownerDocument.addEventListener("pointermove",l,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",d),b())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",S),this._domElement.ownerDocument.removeEventListener("pointerlockerror",_))};const S=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},_=()=>{this.unlockPointer()};this._addAllEventListeners=I=>{this._domElement=I,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",o),L1&&this._domElement.addEventListener("mousedown",a),this._domElement.addEventListener("pointercancel",d),this._domElement.addEventListener("wheel",g,{passive:!1}),this._domElement.addEventListener("contextmenu",y)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",o),this._domElement.removeEventListener("mousedown",a),this._domElement.removeEventListener("pointercancel",d),this._domElement.removeEventListener("wheel",g,{passive:!1}),this._domElement.removeEventListener("contextmenu",y),this._domElement.ownerDocument.removeEventListener("pointermove",l,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",h),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mouseup",p),this._domElement.ownerDocument.removeEventListener("pointerlockchange",S),this._domElement.ownerDocument.removeEventListener("pointerlockerror",_))},this.cancel=()=>{this._state!==J.NONE&&(this._state=J.NONE,this._activePointers.length=0,T())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=ti(e.width,0,1),this._interactiveArea.height=ti(e.height,0,1),this._interactiveArea.x=ti(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=ti(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,i=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,i)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,i=!1){this._isUserControllingRotate=!1;const n=ti(e,this.minAzimuthAngle,this.maxAzimuthAngle),r=ti(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=n,this._sphericalEnd.phi=r,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,i||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const o=!i||De(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&De(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(o)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=gs.NONE,this._changedDolly=0,this._dollyToNoClamp(ti(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){const i=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const r=this._collisionTest(),o=De(r,this._spherical.radius);if(!(i>e)&&o)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,r)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const n=!t||De(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(n)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(Tr).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const i=!t||De(this._target.x,this._targetEnd.x,this.restThreshold)&&De(this._target.y,this._targetEnd.y,this.restThreshold)&&De(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(i)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=ti(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const i=!t||De(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(i)}pan(e,t,i=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,i)}truck(e,t,i=!1){this._camera.updateMatrix(),ui.setFromMatrixColumn(this._camera.matrix,0),di.setFromMatrixColumn(this._camera.matrix,1),ui.multiplyScalar(e),di.multiplyScalar(-t);const n=Te.copy(ui).add(di),r=Fe.copy(this._targetEnd).add(n);return this.moveTo(r.x,r.y,r.z,i)}forward(e,t=!1){Te.setFromMatrixColumn(this._camera.matrix,0),Te.crossVectors(this._camera.up,Te),Te.multiplyScalar(e);const i=Fe.copy(this._targetEnd).add(Te);return this.moveTo(i.x,i.y,i.z,t)}elevate(e,t=!1){return Te.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+Te.x,this._targetEnd.y+Te.y,this._targetEnd.z+Te.z,t)}moveTo(e,t,i,n=!1){this._isUserControllingTruck=!1;const r=Te.set(e,t,i).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,r,this.boundaryFriction),this._needsUpdate=!0,n||this._target.copy(this._targetEnd);const o=!n||De(this._target.x,this._targetEnd.x,this.restThreshold)&&De(this._target.y,this._targetEnd.y,this.restThreshold)&&De(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(o)}lookInDirectionOf(e,t,i,n=!1){const r=Te.set(e,t,i).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(r.x,r.y,r.z,n)}fitToBox(e,t,{cover:i=!1,paddingLeft:n=0,paddingRight:r=0,paddingBottom:o=0,paddingTop:a=0}={}){const l=[],h=e.isBox3?Es.copy(e):Es.setFromObject(e);h.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const d=Dd(this._sphericalEnd.theta,Ld),p=Dd(this._sphericalEnd.phi,Ld);l.push(this.rotateTo(d,p,t));const f=Te.setFromSpherical(this._sphericalEnd).normalize(),g=Vd.setFromUnitVectors(f,Mc),y=De(Math.abs(f.y),1);y&&g.multiply(Dc.setFromAxisAngle(ma,d)),g.multiply(this._yAxisUpSpaceInverse);const b=zd.makeEmpty();Fe.copy(h.min).applyQuaternion(g),b.expandByPoint(Fe),Fe.copy(h.min).setX(h.max.x).applyQuaternion(g),b.expandByPoint(Fe),Fe.copy(h.min).setY(h.max.y).applyQuaternion(g),b.expandByPoint(Fe),Fe.copy(h.max).setZ(h.min.z).applyQuaternion(g),b.expandByPoint(Fe),Fe.copy(h.min).setZ(h.max.z).applyQuaternion(g),b.expandByPoint(Fe),Fe.copy(h.max).setY(h.min.y).applyQuaternion(g),b.expandByPoint(Fe),Fe.copy(h.max).setX(h.min.x).applyQuaternion(g),b.expandByPoint(Fe),Fe.copy(h.max).applyQuaternion(g),b.expandByPoint(Fe),b.min.x-=n,b.min.y-=o,b.max.x+=r,b.max.y+=a,g.setFromUnitVectors(Mc,f),y&&g.premultiply(Dc.invert()),g.premultiply(this._yAxisUpSpace);const w=b.getSize(Te),T=b.getCenter(Fe).applyQuaternion(g);if(Cn(this._camera)){const S=this.getDistanceToFitBox(w.x,w.y,w.z,i);l.push(this.moveTo(T.x,T.y,T.z,t)),l.push(this.dollyTo(S,t)),l.push(this.setFocalOffset(0,0,0,t))}else if(Qi(this._camera)){const S=this._camera,_=S.right-S.left,I=S.top-S.bottom,P=i?Math.max(_/w.x,I/w.y):Math.min(_/w.x,I/w.y);l.push(this.moveTo(T.x,T.y,T.z,t)),l.push(this.zoomTo(P,t)),l.push(this.setFocalOffset(0,0,0,t))}return Promise.all(l)}fitToSphere(e,t){const i=[],n=e instanceof be.Sphere?Lc.copy(e):ah.createBoundingSphere(e,Lc);if(i.push(this.moveTo(n.center.x,n.center.y,n.center.z,t)),Cn(this._camera)){const r=this.getDistanceToFitSphere(n.radius);i.push(this.dollyTo(r,t))}else if(Qi(this._camera)){const r=this._camera.right-this._camera.left,o=this._camera.top-this._camera.bottom,a=2*n.radius,l=Math.min(r/a,o/a);i.push(this.zoomTo(l,t))}return i.push(this.setFocalOffset(0,0,0,t)),Promise.all(i)}setLookAt(e,t,i,n,r,o,a=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=gs.NONE,this._changedDolly=0;const l=Fe.set(n,r,o),h=Te.set(e,t,i);this._targetEnd.copy(l),this._sphericalEnd.setFromVector3(h.sub(l).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,a||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const d=!a||De(this._target.x,this._targetEnd.x,this.restThreshold)&&De(this._target.y,this._targetEnd.y,this.restThreshold)&&De(this._target.z,this._targetEnd.z,this.restThreshold)&&De(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&De(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&De(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(d)}lerpLookAt(e,t,i,n,r,o,a,l,h,d,p,f,g,y=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=gs.NONE,this._changedDolly=0;const b=Te.set(n,r,o),w=Fe.set(e,t,i);zt.setFromVector3(w.sub(b).applyQuaternion(this._yAxisUpSpace));const T=ys.set(d,p,f),S=Fe.set(a,l,h);xr.setFromVector3(S.sub(T).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(b.lerp(T,g));const _=xr.theta-zt.theta,I=xr.phi-zt.phi,P=xr.radius-zt.radius;this._sphericalEnd.set(zt.radius+P*g,zt.phi+I*g,zt.theta+_*g),this.normalizeRotations(),this._needsUpdate=!0,y||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const M=!y||De(this._target.x,this._targetEnd.x,this.restThreshold)&&De(this._target.y,this._targetEnd.y,this.restThreshold)&&De(this._target.z,this._targetEnd.z,this.restThreshold)&&De(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&De(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&De(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(M)}setPosition(e,t,i,n=!1){return this.setLookAt(e,t,i,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,n)}setTarget(e,t,i,n=!1){const r=this.getPosition(Te),o=this.setLookAt(r.x,r.y,r.z,e,t,i,n);return this._sphericalEnd.phi=ti(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),o}setFocalOffset(e,t,i,n=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,i),this._needsUpdate=!0,n||this._focalOffset.copy(this._focalOffsetEnd);const r=!n||De(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&De(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&De(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(r)}setOrbitPoint(e,t,i){this._camera.updateMatrixWorld(),ui.setFromMatrixColumn(this._camera.matrixWorldInverse,0),di.setFromMatrixColumn(this._camera.matrixWorldInverse,1),Tn.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const n=Te.set(e,t,i),r=n.distanceTo(this._camera.position),o=n.sub(this._camera.position);ui.multiplyScalar(o.x),di.multiplyScalar(o.y),Tn.multiplyScalar(o.z),Te.copy(ui).add(di).add(Tn),Te.z=Te.z+r,this.dollyTo(r,!1),this.setFocalOffset(-Te.x,Te.y,-Te.z,!1),this.moveTo(e,t,i,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,i,n){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new be.Vector4,typeof e=="number"?this._viewport.set(e,t,i,n):this._viewport.copy(e)}getDistanceToFitBox(e,t,i,n=!1){if(Oc(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const r=e/t,o=this._camera.getEffectiveFOV()*wr,a=this._camera.aspect;return((n?r>a:rt.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,i){const n=t.lengthSq();if(n===0)return e;const r=Fe.copy(t).add(e),o=this._boundary.clampPoint(r,ys).sub(r),a=o.lengthSq();if(a===0)return e.add(t);if(a===n)return e;if(i===0)return e.add(t).add(o);{const l=1+i*a/t.dot(o);return e.add(Fe.copy(t).multiplyScalar(l)).add(o.multiplyScalar(1-i))}}_updateNearPlaneCorners(){if(Cn(this._camera)){const e=this._camera,t=e.near,i=e.getEffectiveFOV()*wr,n=Math.tan(i*.5)*t,r=n*e.aspect;this._nearPlaneCorners[0].set(-r,-n,0),this._nearPlaneCorners[1].set(r,-n,0),this._nearPlaneCorners[2].set(r,n,0),this._nearPlaneCorners[3].set(-r,n,0)}else if(Qi(this._camera)){const e=this._camera,t=1/e.zoom,i=e.left*t,n=e.right*t,r=e.top*t,o=e.bottom*t;this._nearPlaneCorners[0].set(i,r,0),this._nearPlaneCorners[1].set(n,r,0),this._nearPlaneCorners[2].set(n,o,0),this._nearPlaneCorners[3].set(i,o,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||Oc(this._camera,"_collisionTest"))return e;const t=this._getTargetDirection(Tr);Nc.lookAt(Ud,t,this._camera.up);for(let i=0;i<4;i++){const n=Fe.copy(this._nearPlaneCorners[i]);n.applyMatrix4(Nc);const r=ys.addVectors(this._target,n);ga.set(r,t),ga.far=this._spherical.radius+1;const o=ga.intersectObjects(this.colliderMeshes);o.length!==0&&o[0].distance{const i=()=>{this.removeEventListener("rest",i),t()};this.addEventListener("rest",i)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,t=new be.Sphere){const i=t,n=i.center;Es.makeEmpty(),e.traverseVisible(o=>{o.isMesh&&Es.expandByObject(o)}),Es.getCenter(n);let r=0;return e.traverseVisible(o=>{if(!o.isMesh)return;const a=o,l=a.geometry.clone();l.applyMatrix4(a.matrixWorld);const h=l.attributes.position;for(let d=0,p=h.count;d{var t;if(!(!this.currentWorld||!this.currentWorld.renderer)){if(this.three instanceof jn){this.onAspectUpdated.trigger();return}if((t=this.currentWorld.renderer)!=null&&t.isResizeable()){const i=this.currentWorld.renderer.getSize();this.three.aspect=i.width/i.height,this.three.updateProjectionMatrix(),this.onAspectUpdated.trigger()}}}),this.three=this.setupCamera(),this.setupEvents(!0),this.onWorldChanged.add(({action:t,world:i})=>{if(t==="added"){const n=this.newCameraControls();this._allControls.set(i.uuid,n)}if(t==="removed"){const n=this._allControls.get(i.uuid);n&&(n.dispose(),this._allControls.delete(i.uuid))}})}get controls(){if(!this.currentWorld)throw new Error("This camera needs a world to work!");const e=this._allControls.get(this.currentWorld.uuid);if(!e)throw new Error("Controls not found!");return e}get enabled(){return this.currentWorld===null?!1:this.controls.enabled}set enabled(e){this.controls.enabled=e}dispose(){this.setupEvents(!1),this.enabled=!1,this.onAspectUpdated.reset(),this.onBeforeUpdate.reset(),this.onAfterUpdate.reset(),this.three.removeFromParent(),this.onDisposed.trigger(),this.onDisposed.reset();for(const[e,t]of this._allControls)t.dispose()}update(e){this.enabled&&(this.onBeforeUpdate.trigger(this),this.controls.update(e),this.onAfterUpdate.trigger(this))}setupCamera(){const e=window.innerWidth/window.innerHeight,t=new Fv(60,e,1,1e3);return t.position.set(50,50,50),t.lookAt(new F(0,0,0)),t}newCameraControls(){if(!this.currentWorld)throw new Error("This camera needs a world to work!");if(!this.currentWorld.renderer)throw new Error("This camera needs a renderer to work!");Mt.install({THREE:Wf.getSubsetOfThree()});const{domElement:e}=this.currentWorld.renderer.three,t=new Mt(this.three,e);return t.smoothTime=.2,t.dollyToCursor=!0,t.infinityDolly=!0,t}setupEvents(e){e?window.addEventListener("resize",this.updateAspect):window.removeEventListener("resize",this.updateAspect)}static getSubsetOfThree(){return{MOUSE:Ov,Vector2:Ve,Vector3:F,Vector4:Vs,Quaternion:Vt,Matrix4:Ee,Spherical:Mv,Box3:Ke,Sphere:Gn,Raycaster:io,MathUtils:so}}};const Xf=class Kf extends Re{constructor(e){super(e),A(this,"onAfterUpdate",new ee),A(this,"onBeforeUpdate",new ee),A(this,"onDisposed",new ee),A(this,"list",new Map),A(this,"enabled",!0),e.add(Kf.uuid,this)}create(){const e=new R1(this.components),t=e.uuid;if(this.list.has(t))throw new Error("There is already a world with this name!");return this.list.set(t,e),e}delete(e){this.list.delete(e.uuid),e.dispose()}dispose(){this.enabled=!1;for(const[e,t]of this.list)t.dispose();this.list.clear(),this.onDisposed.trigger()}update(e){if(this.enabled)for(const[t,i]of this.list)i.update(e)}};A(Xf,"uuid","fdb61dc4-2ec1-4966-b83d-54ea795fad4a");let D1=Xf;class N1{constructor(e,t,i){A(this,"onDisposed",new ee),A(this,"world"),A(this,"components"),A(this,"three"),A(this,"_fade",3),A(this,"updateZoom",()=>{this.world.camera instanceof lh&&(this.material.uniforms.uZoom.value=this.world.camera.three.zoom)}),this.world=t;const{color:n,size1:r,size2:o,distance:a}=i;this.components=e;const l=new ul(2,2,1,1),h=new wt({side:no,uniforms:{uSize1:{value:r},uSize2:{value:o},uColor:{value:n},uDistance:{value:a},uFade:{value:this._fade},uZoom:{value:1}},transparent:!0,vertexShader:` + */const Ce={LEFT:1,RIGHT:2,MIDDLE:4},J=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,OFFSET:4,DOLLY:8,ZOOM:16,TOUCH_ROTATE:32,TOUCH_TRUCK:64,TOUCH_OFFSET:128,TOUCH_DOLLY:256,TOUCH_ZOOM:512,TOUCH_DOLLY_TRUCK:1024,TOUCH_DOLLY_OFFSET:2048,TOUCH_DOLLY_ROTATE:4096,TOUCH_ZOOM_TRUCK:8192,TOUCH_ZOOM_OFFSET:16384,TOUCH_ZOOM_ROTATE:32768}),gs={NONE:0,IN:1,OUT:-1};function Cn(s){return s.isPerspectiveCamera}function Qi(s){return s.isOrthographicCamera}const vs=Math.PI*2,Md=Math.PI/2,Yf=1e-5,wr=Math.PI/180;function ti(s,e,t){return Math.max(e,Math.min(t,s))}function Ye(s,e=Yf){return Math.abs(s)0==g>d&&(g=d,t.value=(g-d)/r),g}function Dd(s,e,t,i,n=1/0,r,o){i=Math.max(1e-4,i);const a=2/i,l=a*r,h=1/(1+l+.48*l*l+.235*l*l*l);let d=e.x,p=e.y,f=e.z,g=s.x-d,v=s.y-p,b=s.z-f;const w=d,T=p,S=f,_=n*i,I=_*_,P=g*g+v*v+b*b;if(P>I){const ve=Math.sqrt(P);g=g/ve*_,v=v/ve*_,b=b/ve*_}d=s.x-g,p=s.y-v,f=s.z-b;const M=(t.x+a*g)*r,k=(t.y+a*v)*r,V=(t.z+a*b)*r;t.x=(t.x-a*M)*h,t.y=(t.y-a*k)*h,t.z=(t.z-a*V)*h,o.x=d+(g+M)*h,o.y=p+(v+k)*h,o.z=f+(b+V)*h;const W=w-s.x,j=T-s.y,Q=S-s.z,$=o.x-w,ne=o.y-T,oe=o.z-S;return W*$+j*ne+Q*oe>0&&(o.x=w,o.y=T,o.z=S,t.x=(o.x-w)/r,t.y=(o.y-T)/r,t.z=(o.z-S)/r),o}function Fc(s,e){e.set(0,0),s.forEach(t=>{e.x+=t.clientX,e.y+=t.clientY}),e.x/=s.length,e.y/=s.length}function Mc(s,e){return Qi(s)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}class O1{constructor(){this._listeners={}}addEventListener(e,t){const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners[e];if(i!==void 0){const n=i.indexOf(t);n!==-1&&i.splice(n,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){const t=this._listeners[e.type];if(t!==void 0){e.target=this;const i=t.slice(0);for(let n=0,r=i.length;n{},this._enabled=!0,this._state=J.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=gs.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new be.Vector3,this._focalOffsetVelocity=new be.Vector3,this._zoomVelocity={value:0},this._truckInternal=(I,P,M)=>{let k,V;if(Cn(this._camera)){const W=Te.copy(this._camera.position).sub(this._target),j=this._camera.getEffectiveFOV()*wr,Q=W.length()*Math.tan(j*.5);k=this.truckSpeed*I*Q/this._elementRect.height,V=this.truckSpeed*P*Q/this._elementRect.height}else if(Qi(this._camera)){const W=this._camera;k=I*(W.right-W.left)/W.zoom/this._elementRect.width,V=P*(W.top-W.bottom)/W.zoom/this._elementRect.height}else return;this.verticalDragToForward?(M?this.setFocalOffset(this._focalOffsetEnd.x+k,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(k,0,!0),this.forward(-V,!0)):M?this.setFocalOffset(this._focalOffsetEnd.x+k,this._focalOffsetEnd.y+V,this._focalOffsetEnd.z,!0):this.truck(k,V,!0)},this._rotateInternal=(I,P)=>{const M=vs*this.azimuthRotateSpeed*I/this._elementRect.height,k=vs*this.polarRotateSpeed*P/this._elementRect.height;this.rotate(M,k,!0)},this._dollyInternal=(I,P,M)=>{const k=Math.pow(.95,-I*this.dollySpeed),V=this._sphericalEnd.radius,W=this._sphericalEnd.radius*k,j=ti(W,this.minDistance,this.maxDistance),Q=j-W;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(W,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(Q,!0),this._dollyToNoClamp(j,!0)):this._dollyToNoClamp(j,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?W:j)-V,this._dollyControlCoord.set(P,M)),this._lastDollyDirection=Math.sign(-I)},this._zoomInternal=(I,P,M)=>{const k=Math.pow(.95,I*this.dollySpeed),V=this._zoom,W=this._zoom*k;this.zoomTo(W,!0),this.dollyToCursor&&(this._changedZoom+=W-V,this._dollyControlCoord.set(P,M))},typeof be>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new be.Quaternion().setFromUnitVectors(this._camera.up,ma),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=J.NONE,this._target=new be.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new be.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new be.Spherical().setFromVector3(Te.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new be.Vector3,new be.Vector3,new be.Vector3,new be.Vector3],this._updateNearPlaneCorners(),this._boundary=new be.Box3(new be.Vector3(-1/0,-1/0,-1/0),new be.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new be.Vector2,this.mouseButtons={left:J.ROTATE,middle:J.DOLLY,right:J.TRUCK,wheel:Cn(this._camera)?J.DOLLY:Qi(this._camera)?J.ZOOM:J.NONE},this.touches={one:J.TOUCH_ROTATE,two:Cn(this._camera)?J.TOUCH_DOLLY_TRUCK:Qi(this._camera)?J.TOUCH_ZOOM_TRUCK:J.NONE,three:J.TOUCH_TRUCK};const i=new be.Vector2,n=new be.Vector2,r=new be.Vector2,o=I=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const k=this._domElement.getBoundingClientRect(),V=I.clientX/k.width,W=I.clientY/k.height;if(Vthis._interactiveArea.right||Wthis._interactiveArea.bottom)return}const P=I.pointerType!=="mouse"?null:(I.buttons&Ce.LEFT)===Ce.LEFT?Ce.LEFT:(I.buttons&Ce.MIDDLE)===Ce.MIDDLE?Ce.MIDDLE:(I.buttons&Ce.RIGHT)===Ce.RIGHT?Ce.RIGHT:null;if(P!==null){const k=this._findPointerByMouseButton(P);k&&this._disposePointer(k)}if((I.buttons&Ce.LEFT)===Ce.LEFT&&this._lockedPointer)return;const M={pointerId:I.pointerId,clientX:I.clientX,clientY:I.clientY,deltaX:0,deltaY:0,mouseButton:P};this._activePointers.push(M),this._domElement.ownerDocument.removeEventListener("pointermove",l,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.addEventListener("pointermove",l,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",d),this._isDragging=!0,b(I)},a=I=>{if(!this._enabled||!this._domElement||this._lockedPointer)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const k=this._domElement.getBoundingClientRect(),V=I.clientX/k.width,W=I.clientY/k.height;if(Vthis._interactiveArea.right||Wthis._interactiveArea.bottom)return}const P=(I.buttons&Ce.LEFT)===Ce.LEFT?Ce.LEFT:(I.buttons&Ce.MIDDLE)===Ce.MIDDLE?Ce.MIDDLE:(I.buttons&Ce.RIGHT)===Ce.RIGHT?Ce.RIGHT:null;if(P!==null){const k=this._findPointerByMouseButton(P);k&&this._disposePointer(k)}const M={pointerId:1,clientX:I.clientX,clientY:I.clientY,deltaX:0,deltaY:0,mouseButton:(I.buttons&Ce.LEFT)===Ce.LEFT?Ce.LEFT:(I.buttons&Ce.MIDDLE)===Ce.LEFT?Ce.MIDDLE:(I.buttons&Ce.RIGHT)===Ce.LEFT?Ce.RIGHT:null};this._activePointers.push(M),this._domElement.ownerDocument.removeEventListener("mousemove",h),this._domElement.ownerDocument.removeEventListener("mouseup",p),this._domElement.ownerDocument.addEventListener("mousemove",h),this._domElement.ownerDocument.addEventListener("mouseup",p),this._isDragging=!0,b(I)},l=I=>{I.cancelable&&I.preventDefault();const P=I.pointerId,M=this._lockedPointer||this._findPointerById(P);if(M){if(M.clientX=I.clientX,M.clientY=I.clientY,M.deltaX=I.movementX,M.deltaY=I.movementY,this._state=0,I.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(I.buttons&Ce.LEFT)===Ce.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(I.buttons&Ce.MIDDLE)===Ce.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(I.buttons&Ce.RIGHT)===Ce.RIGHT&&(this._state=this._state|this.mouseButtons.right);w()}},h=I=>{const P=this._lockedPointer||this._findPointerById(1);P&&(P.clientX=I.clientX,P.clientY=I.clientY,P.deltaX=I.movementX,P.deltaY=I.movementY,this._state=0,(this._lockedPointer||(I.buttons&Ce.LEFT)===Ce.LEFT)&&(this._state=this._state|this.mouseButtons.left),(I.buttons&Ce.MIDDLE)===Ce.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(I.buttons&Ce.RIGHT)===Ce.RIGHT&&(this._state=this._state|this.mouseButtons.right),w())},d=I=>{const P=this._findPointerById(I.pointerId);if(!(P&&P===this._lockedPointer)){if(P&&this._disposePointer(P),I.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=J.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=J.NONE;T()}},p=()=>{const I=this._findPointerById(1);I&&I===this._lockedPointer||(I&&this._disposePointer(I),this._state=J.NONE,T())};let f=-1;const g=I=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===J.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const W=this._domElement.getBoundingClientRect(),j=I.clientX/W.width,Q=I.clientY/W.height;if(jthis._interactiveArea.right||Qthis._interactiveArea.bottom)return}if(I.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===J.ROTATE||this.mouseButtons.wheel===J.TRUCK){const W=performance.now();f-W<1e3&&this._getClientRect(this._elementRect),f=W}const P=M1?-1:-3,M=I.deltaMode===1?I.deltaY/P:I.deltaY/(P*10),k=this.dollyToCursor?(I.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,V=this.dollyToCursor?(I.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case J.ROTATE:{this._rotateInternal(I.deltaX,I.deltaY),this._isUserControllingRotate=!0;break}case J.TRUCK:{this._truckInternal(I.deltaX,I.deltaY,!1),this._isUserControllingTruck=!0;break}case J.OFFSET:{this._truckInternal(I.deltaX,I.deltaY,!0),this._isUserControllingOffset=!0;break}case J.DOLLY:{this._dollyInternal(-M,k,V),this._isUserControllingDolly=!0;break}case J.ZOOM:{this._zoomInternal(-M,k,V),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},v=I=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===lh.ACTION.NONE){const P=I instanceof PointerEvent?I.pointerId:0,M=this._findPointerById(P);M&&this._disposePointer(M),this._domElement.ownerDocument.removeEventListener("pointermove",l,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mousemove",h),this._domElement.ownerDocument.removeEventListener("mouseup",p);return}I.preventDefault()}},b=I=>{if(this._enabled){if(Fc(this._activePointers,St),this._getClientRect(this._elementRect),i.copy(St),n.copy(St),this._activePointers.length>=2){const P=St.x-this._activePointers[1].clientX,M=St.y-this._activePointers[1].clientY,k=Math.sqrt(P*P+M*M);r.set(0,k);const V=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,W=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;n.set(V,W)}if(this._state=0,!I)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in I&&I.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(I.buttons&Ce.LEFT)===Ce.LEFT&&(this._state=this._state|this.mouseButtons.left),(I.buttons&Ce.MIDDLE)===Ce.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(I.buttons&Ce.RIGHT)===Ce.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&J.ROTATE)===J.ROTATE||(this._state&J.TOUCH_ROTATE)===J.TOUCH_ROTATE||(this._state&J.TOUCH_DOLLY_ROTATE)===J.TOUCH_DOLLY_ROTATE||(this._state&J.TOUCH_ZOOM_ROTATE)===J.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&J.TRUCK)===J.TRUCK||(this._state&J.TOUCH_TRUCK)===J.TOUCH_TRUCK||(this._state&J.TOUCH_DOLLY_TRUCK)===J.TOUCH_DOLLY_TRUCK||(this._state&J.TOUCH_ZOOM_TRUCK)===J.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&J.DOLLY)===J.DOLLY||(this._state&J.TOUCH_DOLLY)===J.TOUCH_DOLLY||(this._state&J.TOUCH_DOLLY_TRUCK)===J.TOUCH_DOLLY_TRUCK||(this._state&J.TOUCH_DOLLY_OFFSET)===J.TOUCH_DOLLY_OFFSET||(this._state&J.TOUCH_DOLLY_ROTATE)===J.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&J.ZOOM)===J.ZOOM||(this._state&J.TOUCH_ZOOM)===J.TOUCH_ZOOM||(this._state&J.TOUCH_ZOOM_TRUCK)===J.TOUCH_ZOOM_TRUCK||(this._state&J.TOUCH_ZOOM_OFFSET)===J.TOUCH_ZOOM_OFFSET||(this._state&J.TOUCH_ZOOM_ROTATE)===J.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&J.OFFSET)===J.OFFSET||(this._state&J.TOUCH_OFFSET)===J.TOUCH_OFFSET||(this._state&J.TOUCH_DOLLY_OFFSET)===J.TOUCH_DOLLY_OFFSET||(this._state&J.TOUCH_ZOOM_OFFSET)===J.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})}},w=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,Fc(this._activePointers,St);const I=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,P=I?-I.deltaX:n.x-St.x,M=I?-I.deltaY:n.y-St.y;if(n.copy(St),((this._state&J.ROTATE)===J.ROTATE||(this._state&J.TOUCH_ROTATE)===J.TOUCH_ROTATE||(this._state&J.TOUCH_DOLLY_ROTATE)===J.TOUCH_DOLLY_ROTATE||(this._state&J.TOUCH_ZOOM_ROTATE)===J.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(P,M),this._isUserControllingRotate=!0),(this._state&J.DOLLY)===J.DOLLY||(this._state&J.ZOOM)===J.ZOOM){const k=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,V=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0,W=this.dollyDragInverted?-1:1;(this._state&J.DOLLY)===J.DOLLY?(this._dollyInternal(W*M*fa,k,V),this._isUserControllingDolly=!0):(this._zoomInternal(W*M*fa,k,V),this._isUserControllingZoom=!0)}if((this._state&J.TOUCH_DOLLY)===J.TOUCH_DOLLY||(this._state&J.TOUCH_ZOOM)===J.TOUCH_ZOOM||(this._state&J.TOUCH_DOLLY_TRUCK)===J.TOUCH_DOLLY_TRUCK||(this._state&J.TOUCH_ZOOM_TRUCK)===J.TOUCH_ZOOM_TRUCK||(this._state&J.TOUCH_DOLLY_OFFSET)===J.TOUCH_DOLLY_OFFSET||(this._state&J.TOUCH_ZOOM_OFFSET)===J.TOUCH_ZOOM_OFFSET||(this._state&J.TOUCH_DOLLY_ROTATE)===J.TOUCH_DOLLY_ROTATE||(this._state&J.TOUCH_ZOOM_ROTATE)===J.TOUCH_ZOOM_ROTATE){const k=St.x-this._activePointers[1].clientX,V=St.y-this._activePointers[1].clientY,W=Math.sqrt(k*k+V*V),j=r.y-W;r.set(0,W);const Q=this.dollyToCursor?(n.x-this._elementRect.x)/this._elementRect.width*2-1:0,$=this.dollyToCursor?(n.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&J.TOUCH_DOLLY)===J.TOUCH_DOLLY||(this._state&J.TOUCH_DOLLY_ROTATE)===J.TOUCH_DOLLY_ROTATE||(this._state&J.TOUCH_DOLLY_TRUCK)===J.TOUCH_DOLLY_TRUCK||(this._state&J.TOUCH_DOLLY_OFFSET)===J.TOUCH_DOLLY_OFFSET?(this._dollyInternal(j*fa,Q,$),this._isUserControllingDolly=!0):(this._zoomInternal(j*fa,Q,$),this._isUserControllingZoom=!0)}((this._state&J.TRUCK)===J.TRUCK||(this._state&J.TOUCH_TRUCK)===J.TOUCH_TRUCK||(this._state&J.TOUCH_DOLLY_TRUCK)===J.TOUCH_DOLLY_TRUCK||(this._state&J.TOUCH_ZOOM_TRUCK)===J.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(P,M,!1),this._isUserControllingTruck=!0),((this._state&J.OFFSET)===J.OFFSET||(this._state&J.TOUCH_OFFSET)===J.TOUCH_OFFSET||(this._state&J.TOUCH_DOLLY_OFFSET)===J.TOUCH_DOLLY_OFFSET||(this._state&J.TOUCH_ZOOM_OFFSET)===J.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(P,M,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},T=()=>{Fc(this._activePointers,St),n.copy(St),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",l,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",h),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mouseup",p),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",l,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",S),this._domElement.ownerDocument.addEventListener("pointerlockerror",_),this._domElement.ownerDocument.addEventListener("pointermove",l,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",d),b())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",S),this._domElement.ownerDocument.removeEventListener("pointerlockerror",_))};const S=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},_=()=>{this.unlockPointer()};this._addAllEventListeners=I=>{this._domElement=I,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",o),L1&&this._domElement.addEventListener("mousedown",a),this._domElement.addEventListener("pointercancel",d),this._domElement.addEventListener("wheel",g,{passive:!1}),this._domElement.addEventListener("contextmenu",v)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",o),this._domElement.removeEventListener("mousedown",a),this._domElement.removeEventListener("pointercancel",d),this._domElement.removeEventListener("wheel",g,{passive:!1}),this._domElement.removeEventListener("contextmenu",v),this._domElement.ownerDocument.removeEventListener("pointermove",l,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",h),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mouseup",p),this._domElement.ownerDocument.removeEventListener("pointerlockchange",S),this._domElement.ownerDocument.removeEventListener("pointerlockerror",_))},this.cancel=()=>{this._state!==J.NONE&&(this._state=J.NONE,this._activePointers.length=0,T())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=ti(e.width,0,1),this._interactiveArea.height=ti(e.height,0,1),this._interactiveArea.x=ti(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=ti(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,i=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,i)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,i=!1){this._isUserControllingRotate=!1;const n=ti(e,this.minAzimuthAngle,this.maxAzimuthAngle),r=ti(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=n,this._sphericalEnd.phi=r,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,i||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const o=!i||De(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&De(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(o)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=gs.NONE,this._changedDolly=0,this._dollyToNoClamp(ti(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){const i=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const r=this._collisionTest(),o=De(r,this._spherical.radius);if(!(i>e)&&o)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,r)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const n=!t||De(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(n)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(Tr).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const i=!t||De(this._target.x,this._targetEnd.x,this.restThreshold)&&De(this._target.y,this._targetEnd.y,this.restThreshold)&&De(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(i)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=ti(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const i=!t||De(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(i)}pan(e,t,i=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,i)}truck(e,t,i=!1){this._camera.updateMatrix(),ui.setFromMatrixColumn(this._camera.matrix,0),di.setFromMatrixColumn(this._camera.matrix,1),ui.multiplyScalar(e),di.multiplyScalar(-t);const n=Te.copy(ui).add(di),r=Oe.copy(this._targetEnd).add(n);return this.moveTo(r.x,r.y,r.z,i)}forward(e,t=!1){Te.setFromMatrixColumn(this._camera.matrix,0),Te.crossVectors(this._camera.up,Te),Te.multiplyScalar(e);const i=Oe.copy(this._targetEnd).add(Te);return this.moveTo(i.x,i.y,i.z,t)}elevate(e,t=!1){return Te.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+Te.x,this._targetEnd.y+Te.y,this._targetEnd.z+Te.z,t)}moveTo(e,t,i,n=!1){this._isUserControllingTruck=!1;const r=Te.set(e,t,i).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,r,this.boundaryFriction),this._needsUpdate=!0,n||this._target.copy(this._targetEnd);const o=!n||De(this._target.x,this._targetEnd.x,this.restThreshold)&&De(this._target.y,this._targetEnd.y,this.restThreshold)&&De(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(o)}lookInDirectionOf(e,t,i,n=!1){const r=Te.set(e,t,i).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(r.x,r.y,r.z,n)}fitToBox(e,t,{cover:i=!1,paddingLeft:n=0,paddingRight:r=0,paddingBottom:o=0,paddingTop:a=0}={}){const l=[],h=e.isBox3?Es.copy(e):Es.setFromObject(e);h.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const d=Ld(this._sphericalEnd.theta,Md),p=Ld(this._sphericalEnd.phi,Md);l.push(this.rotateTo(d,p,t));const f=Te.setFromSpherical(this._sphericalEnd).normalize(),g=zd.setFromUnitVectors(f,Lc),v=De(Math.abs(f.y),1);v&&g.multiply(Nc.setFromAxisAngle(ma,d)),g.multiply(this._yAxisUpSpaceInverse);const b=Bd.makeEmpty();Oe.copy(h.min).applyQuaternion(g),b.expandByPoint(Oe),Oe.copy(h.min).setX(h.max.x).applyQuaternion(g),b.expandByPoint(Oe),Oe.copy(h.min).setY(h.max.y).applyQuaternion(g),b.expandByPoint(Oe),Oe.copy(h.max).setZ(h.min.z).applyQuaternion(g),b.expandByPoint(Oe),Oe.copy(h.min).setZ(h.max.z).applyQuaternion(g),b.expandByPoint(Oe),Oe.copy(h.max).setY(h.min.y).applyQuaternion(g),b.expandByPoint(Oe),Oe.copy(h.max).setX(h.min.x).applyQuaternion(g),b.expandByPoint(Oe),Oe.copy(h.max).applyQuaternion(g),b.expandByPoint(Oe),b.min.x-=n,b.min.y-=o,b.max.x+=r,b.max.y+=a,g.setFromUnitVectors(Lc,f),v&&g.premultiply(Nc.invert()),g.premultiply(this._yAxisUpSpace);const w=b.getSize(Te),T=b.getCenter(Oe).applyQuaternion(g);if(Cn(this._camera)){const S=this.getDistanceToFitBox(w.x,w.y,w.z,i);l.push(this.moveTo(T.x,T.y,T.z,t)),l.push(this.dollyTo(S,t)),l.push(this.setFocalOffset(0,0,0,t))}else if(Qi(this._camera)){const S=this._camera,_=S.right-S.left,I=S.top-S.bottom,P=i?Math.max(_/w.x,I/w.y):Math.min(_/w.x,I/w.y);l.push(this.moveTo(T.x,T.y,T.z,t)),l.push(this.zoomTo(P,t)),l.push(this.setFocalOffset(0,0,0,t))}return Promise.all(l)}fitToSphere(e,t){const i=[],n=e instanceof be.Sphere?Dc.copy(e):lh.createBoundingSphere(e,Dc);if(i.push(this.moveTo(n.center.x,n.center.y,n.center.z,t)),Cn(this._camera)){const r=this.getDistanceToFitSphere(n.radius);i.push(this.dollyTo(r,t))}else if(Qi(this._camera)){const r=this._camera.right-this._camera.left,o=this._camera.top-this._camera.bottom,a=2*n.radius,l=Math.min(r/a,o/a);i.push(this.zoomTo(l,t))}return i.push(this.setFocalOffset(0,0,0,t)),Promise.all(i)}setLookAt(e,t,i,n,r,o,a=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=gs.NONE,this._changedDolly=0;const l=Oe.set(n,r,o),h=Te.set(e,t,i);this._targetEnd.copy(l),this._sphericalEnd.setFromVector3(h.sub(l).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,a||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const d=!a||De(this._target.x,this._targetEnd.x,this.restThreshold)&&De(this._target.y,this._targetEnd.y,this.restThreshold)&&De(this._target.z,this._targetEnd.z,this.restThreshold)&&De(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&De(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&De(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(d)}lerpLookAt(e,t,i,n,r,o,a,l,h,d,p,f,g,v=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=gs.NONE,this._changedDolly=0;const b=Te.set(n,r,o),w=Oe.set(e,t,i);zt.setFromVector3(w.sub(b).applyQuaternion(this._yAxisUpSpace));const T=ys.set(d,p,f),S=Oe.set(a,l,h);xr.setFromVector3(S.sub(T).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(b.lerp(T,g));const _=xr.theta-zt.theta,I=xr.phi-zt.phi,P=xr.radius-zt.radius;this._sphericalEnd.set(zt.radius+P*g,zt.phi+I*g,zt.theta+_*g),this.normalizeRotations(),this._needsUpdate=!0,v||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const M=!v||De(this._target.x,this._targetEnd.x,this.restThreshold)&&De(this._target.y,this._targetEnd.y,this.restThreshold)&&De(this._target.z,this._targetEnd.z,this.restThreshold)&&De(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&De(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&De(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(M)}setPosition(e,t,i,n=!1){return this.setLookAt(e,t,i,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,n)}setTarget(e,t,i,n=!1){const r=this.getPosition(Te),o=this.setLookAt(r.x,r.y,r.z,e,t,i,n);return this._sphericalEnd.phi=ti(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),o}setFocalOffset(e,t,i,n=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,i),this._needsUpdate=!0,n||this._focalOffset.copy(this._focalOffsetEnd);const r=!n||De(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&De(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&De(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(r)}setOrbitPoint(e,t,i){this._camera.updateMatrixWorld(),ui.setFromMatrixColumn(this._camera.matrixWorldInverse,0),di.setFromMatrixColumn(this._camera.matrixWorldInverse,1),Tn.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const n=Te.set(e,t,i),r=n.distanceTo(this._camera.position),o=n.sub(this._camera.position);ui.multiplyScalar(o.x),di.multiplyScalar(o.y),Tn.multiplyScalar(o.z),Te.copy(ui).add(di).add(Tn),Te.z=Te.z+r,this.dollyTo(r,!1),this.setFocalOffset(-Te.x,Te.y,-Te.z,!1),this.moveTo(e,t,i,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,i,n){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new be.Vector4,typeof e=="number"?this._viewport.set(e,t,i,n):this._viewport.copy(e)}getDistanceToFitBox(e,t,i,n=!1){if(Mc(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const r=e/t,o=this._camera.getEffectiveFOV()*wr,a=this._camera.aspect;return((n?r>a:rt.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,i){const n=t.lengthSq();if(n===0)return e;const r=Oe.copy(t).add(e),o=this._boundary.clampPoint(r,ys).sub(r),a=o.lengthSq();if(a===0)return e.add(t);if(a===n)return e;if(i===0)return e.add(t).add(o);{const l=1+i*a/t.dot(o);return e.add(Oe.copy(t).multiplyScalar(l)).add(o.multiplyScalar(1-i))}}_updateNearPlaneCorners(){if(Cn(this._camera)){const e=this._camera,t=e.near,i=e.getEffectiveFOV()*wr,n=Math.tan(i*.5)*t,r=n*e.aspect;this._nearPlaneCorners[0].set(-r,-n,0),this._nearPlaneCorners[1].set(r,-n,0),this._nearPlaneCorners[2].set(r,n,0),this._nearPlaneCorners[3].set(-r,n,0)}else if(Qi(this._camera)){const e=this._camera,t=1/e.zoom,i=e.left*t,n=e.right*t,r=e.top*t,o=e.bottom*t;this._nearPlaneCorners[0].set(i,r,0),this._nearPlaneCorners[1].set(n,r,0),this._nearPlaneCorners[2].set(n,o,0),this._nearPlaneCorners[3].set(i,o,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||Mc(this._camera,"_collisionTest"))return e;const t=this._getTargetDirection(Tr);Uc.lookAt(Nd,t,this._camera.up);for(let i=0;i<4;i++){const n=Oe.copy(this._nearPlaneCorners[i]);n.applyMatrix4(Uc);const r=ys.addVectors(this._target,n);ga.set(r,t),ga.far=this._spherical.radius+1;const o=ga.intersectObjects(this.colliderMeshes);o.length!==0&&o[0].distance{const i=()=>{this.removeEventListener("rest",i),t()};this.addEventListener("rest",i)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,t=new be.Sphere){const i=t,n=i.center;Es.makeEmpty(),e.traverseVisible(o=>{o.isMesh&&Es.expandByObject(o)}),Es.getCenter(n);let r=0;return e.traverseVisible(o=>{if(!o.isMesh)return;const a=o,l=a.geometry.clone();l.applyMatrix4(a.matrixWorld);const h=l.attributes.position;for(let d=0,p=h.count;d{var t;if(!(!this.currentWorld||!this.currentWorld.renderer)){if(this.three instanceof jn){this.onAspectUpdated.trigger();return}if((t=this.currentWorld.renderer)!=null&&t.isResizeable()){const i=this.currentWorld.renderer.getSize();this.three.aspect=i.width/i.height,this.three.updateProjectionMatrix(),this.onAspectUpdated.trigger()}}}),this.three=this.setupCamera(),this.setupEvents(!0),this.onWorldChanged.add(({action:t,world:i})=>{if(t==="added"){const n=this.newCameraControls();this._allControls.set(i.uuid,n)}if(t==="removed"){const n=this._allControls.get(i.uuid);n&&(n.dispose(),this._allControls.delete(i.uuid))}})}get controls(){if(!this.currentWorld)throw new Error("This camera needs a world to work!");const e=this._allControls.get(this.currentWorld.uuid);if(!e)throw new Error("Controls not found!");return e}get enabled(){return this.currentWorld===null?!1:this.controls.enabled}set enabled(e){this.controls.enabled=e}dispose(){this.setupEvents(!1),this.enabled=!1,this.onAspectUpdated.reset(),this.onBeforeUpdate.reset(),this.onAfterUpdate.reset(),this.three.removeFromParent(),this.onDisposed.trigger(),this.onDisposed.reset();for(const[e,t]of this._allControls)t.dispose()}update(e){this.enabled&&(this.onBeforeUpdate.trigger(this),this.controls.update(e),this.onAfterUpdate.trigger(this))}setupCamera(){const e=window.innerWidth/window.innerHeight,t=new Ov(60,e,1,1e3);return t.position.set(50,50,50),t.lookAt(new O(0,0,0)),t}newCameraControls(){if(!this.currentWorld)throw new Error("This camera needs a world to work!");if(!this.currentWorld.renderer)throw new Error("This camera needs a renderer to work!");Mt.install({THREE:jf.getSubsetOfThree()});const{domElement:e}=this.currentWorld.renderer.three,t=new Mt(this.three,e);return t.smoothTime=.2,t.dollyToCursor=!0,t.infinityDolly=!0,t}setupEvents(e){e?window.addEventListener("resize",this.updateAspect):window.removeEventListener("resize",this.updateAspect)}static getSubsetOfThree(){return{MOUSE:Fv,Vector2:Ve,Vector3:O,Vector4:Vs,Quaternion:Vt,Matrix4:Ee,Spherical:Mv,Box3:Ke,Sphere:Gn,Raycaster:io,MathUtils:so}}};const Wf=class Xf extends Re{constructor(e){super(e),A(this,"onAfterUpdate",new ee),A(this,"onBeforeUpdate",new ee),A(this,"onDisposed",new ee),A(this,"list",new Map),A(this,"enabled",!0),e.add(Xf.uuid,this)}create(){const e=new R1(this.components),t=e.uuid;if(this.list.has(t))throw new Error("There is already a world with this name!");return this.list.set(t,e),e}delete(e){this.list.delete(e.uuid),e.dispose()}dispose(){this.enabled=!1;for(const[e,t]of this.list)t.dispose();this.list.clear(),this.onDisposed.trigger()}update(e){if(this.enabled)for(const[t,i]of this.list)i.update(e)}};A(Wf,"uuid","fdb61dc4-2ec1-4966-b83d-54ea795fad4a");let D1=Wf;class N1{constructor(e,t,i){A(this,"onDisposed",new ee),A(this,"world"),A(this,"components"),A(this,"three"),A(this,"_fade",3),A(this,"updateZoom",()=>{this.world.camera instanceof ch&&(this.material.uniforms.uZoom.value=this.world.camera.three.zoom)}),this.world=t;const{color:n,size1:r,size2:o,distance:a}=i;this.components=e;const l=new ul(2,2,1,1),h=new wt({side:no,uniforms:{uSize1:{value:r},uSize2:{value:o},uColor:{value:n},uDistance:{value:a},uFade:{value:this._fade},uZoom:{value:1}},transparent:!0,vertexShader:` varying vec3 worldPosition; @@ -68,7 +68,7 @@ var gv=Object.defineProperty;var vv=(s,e,t)=>e in s?gv(s,e,{enumerable:!0,config } - `,extensions:{derivatives:!0}});this.three=new le(l,h),this.three.frustumCulled=!1,t.scene.three.add(this.three),this.setupEvents(!0)}get visible(){return this.three.visible}set visible(e){e?this.world.scene.three.add(this.three):this.three.removeFromParent()}get material(){return this.three.material}get fade(){return this._fade===3}set fade(e){this._fade=e?3:0,this.material.uniforms.uFade.value=this._fade}[Symbol.dispose](){throw new Error("Method not implemented.")}dispose(){this.setupEvents(!1),this.components.get(Oi).destroy(this.three),this.onDisposed.trigger(),this.onDisposed.reset(),this.world=null,this.components=null}setupEvents(e){if(!(this.world.camera instanceof lh))return;const t=this.world.camera.controls;e?t.addEventListener("update",this.updateZoom):t.removeEventListener("update",this.updateZoom)}}class U1 extends Re{constructor(){super(...arguments),A(this,"list",new Map),A(this,"onDisposed",new ee),A(this,"config",{color:new Rt(12303291),size1:1,size2:10,distance:500}),A(this,"enabled",!0)}create(e){if(this.list.has(e.uuid))throw new Error("This world already has a grid!");const t=new N1(this.components,e,this.config);return this.list.set(e.uuid,t),e.onDisposed.add(()=>{this.delete(e)}),t}delete(e){const t=this.list.get(e.uuid);t&&t.dispose(),this.list.delete(e.uuid)}dispose(){for(const[e,t]of this.list)t.dispose();this.list.clear(),this.onDisposed.trigger()}}A(U1,"uuid","d1e814d5-b81c-4452-87a2-f039375e0489");const xn=new io,bt=new F,Ki=new F,qe=new Vt,Hd={X:new F(1,0,0),Y:new F(0,1,0),Z:new F(0,0,1)},Uc={type:"change"},Yd={type:"mouseDown"},Gd={type:"mouseUp",mode:null},jd={type:"objectChange"};class k1 extends kn{constructor(e,t){super(),t===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),t=document),this.isTransformControls=!0,this.visible=!1,this.domElement=t,this.domElement.style.touchAction="none";const i=new G1;this._gizmo=i,this.add(i);const n=new j1;this._plane=n,this.add(n);const r=this;function o(S,_){let I=_;Object.defineProperty(r,S,{get:function(){return I!==void 0?I:_},set:function(P){I!==P&&(I=P,n[S]=P,i[S]=P,r.dispatchEvent({type:S+"-changed",value:P}),r.dispatchEvent(Uc))}}),r[S]=_,n[S]=_,i[S]=_}o("camera",e),o("object",void 0),o("enabled",!0),o("axis",null),o("mode","translate"),o("translationSnap",null),o("rotationSnap",null),o("scaleSnap",null),o("space","world"),o("size",1),o("dragging",!1),o("showX",!0),o("showY",!0),o("showZ",!0);const a=new F,l=new F,h=new Vt,d=new Vt,p=new F,f=new Vt,g=new F,y=new F,b=new F,w=0,T=new F;o("worldPosition",a),o("worldPositionStart",l),o("worldQuaternion",h),o("worldQuaternionStart",d),o("cameraPosition",p),o("cameraQuaternion",f),o("pointStart",g),o("pointEnd",y),o("rotationAxis",b),o("rotationAngle",w),o("eye",T),this._offset=new F,this._startNorm=new F,this._endNorm=new F,this._cameraScale=new F,this._parentPosition=new F,this._parentQuaternion=new Vt,this._parentQuaternionInv=new Vt,this._parentScale=new F,this._worldScaleStart=new F,this._worldQuaternionInv=new Vt,this._worldScale=new F,this._positionStart=new F,this._quaternionStart=new Vt,this._scaleStart=new F,this._getPointer=B1.bind(this),this._onPointerDown=V1.bind(this),this._onPointerHover=z1.bind(this),this._onPointerMove=H1.bind(this),this._onPointerUp=Y1.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(this)}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;xn.setFromCamera(e,this.camera);const t=kc(this._gizmo.picker[this.mode],xn);t?this.axis=t.object.name:this.axis=null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e.button!==0)&&this.axis!==null){xn.setFromCamera(e,this.camera);const t=kc(this._plane,xn,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,Yd.mode=this.mode,this.dispatchEvent(Yd)}}pointerMove(e){const t=this.axis,i=this.mode,n=this.object;let r=this.space;if(i==="scale"?r="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(r="world"),n===void 0||t===null||this.dragging===!1||e.button!==-1)return;xn.setFromCamera(e,this.camera);const o=kc(this._plane,xn,!0);if(o){if(this.pointEnd.copy(o.point).sub(this.worldPositionStart),i==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),r==="local"&&t!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf("X")===-1&&(this._offset.x=0),t.indexOf("Y")===-1&&(this._offset.y=0),t.indexOf("Z")===-1&&(this._offset.z=0),r==="local"&&t!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),n.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(r==="local"&&(n.position.applyQuaternion(qe.copy(this._quaternionStart).invert()),t.search("X")!==-1&&(n.position.x=Math.round(n.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(n.position.y=Math.round(n.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(n.position.z=Math.round(n.position.z/this.translationSnap)*this.translationSnap),n.position.applyQuaternion(this._quaternionStart)),r==="world"&&(n.parent&&n.position.add(bt.setFromMatrixPosition(n.parent.matrixWorld)),t.search("X")!==-1&&(n.position.x=Math.round(n.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(n.position.y=Math.round(n.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(n.position.z=Math.round(n.position.z/this.translationSnap)*this.translationSnap),n.parent&&n.position.sub(bt.setFromMatrixPosition(n.parent.matrixWorld))));else if(i==="scale"){if(t.search("XYZ")!==-1){let a=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(a*=-1),Ki.set(a,a,a)}else bt.copy(this.pointStart),Ki.copy(this.pointEnd),bt.applyQuaternion(this._worldQuaternionInv),Ki.applyQuaternion(this._worldQuaternionInv),Ki.divide(bt),t.search("X")===-1&&(Ki.x=1),t.search("Y")===-1&&(Ki.y=1),t.search("Z")===-1&&(Ki.z=1);n.scale.copy(this._scaleStart).multiply(Ki),this.scaleSnap&&(t.search("X")!==-1&&(n.scale.x=Math.round(n.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Y")!==-1&&(n.scale.y=Math.round(n.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Z")!==-1&&(n.scale.z=Math.round(n.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(i==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const a=20/this.worldPosition.distanceTo(bt.setFromMatrixPosition(this.camera.matrixWorld));let l=!1;t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(bt.copy(this.rotationAxis).cross(this.eye))*a):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(Hd[t]),bt.copy(Hd[t]),r==="local"&&bt.applyQuaternion(this.worldQuaternion),bt.cross(this.eye),bt.length()===0?l=!0:this.rotationAngle=this._offset.dot(bt.normalize())*a),(t==="E"||l)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),r==="local"&&t!=="E"&&t!=="XYZE"?(n.quaternion.copy(this._quaternionStart),n.quaternion.multiply(qe.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),n.quaternion.copy(qe.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),n.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(Uc),this.dispatchEvent(jd)}}pointerUp(e){e.button===0&&(this.dragging&&this.axis!==null&&(Gd.mode=this.mode,this.dispatchEvent(Gd)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}attach(e){return this.object=e,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(Uc),this.dispatchEvent(jd),this.pointStart.copy(this.pointEnd))}getRaycaster(){return xn}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}}function B1(s){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:s.button};{const e=this.domElement.getBoundingClientRect();return{x:(s.clientX-e.left)/e.width*2-1,y:-(s.clientY-e.top)/e.height*2+1,button:s.button}}}function z1(s){if(this.enabled)switch(s.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(s));break}}function V1(s){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(s.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(s)),this.pointerDown(this._getPointer(s)))}function H1(s){this.enabled&&this.pointerMove(this._getPointer(s))}function Y1(s){this.enabled&&(this.domElement.releasePointerCapture(s.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(s)))}function kc(s,e,t){const i=e.intersectObject(s,!0);for(let n=0;n.9&&(r.visible=!1)),this.axis==="Y"&&(qe.setFromEuler(va.set(0,0,Math.PI/2)),r.quaternion.copy(t).multiply(qe),Math.abs(ze.copy(Pn).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis==="Z"&&(qe.setFromEuler(va.set(0,Math.PI/2,0)),r.quaternion.copy(t).multiply(qe),Math.abs(ze.copy(Or).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis==="XYZE"&&(qe.setFromEuler(va.set(0,Math.PI/2,0)),ze.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(Xd.lookAt(Wd,ze,Pn)),r.quaternion.multiply(qe),r.visible=this.dragging),this.axis==="E"&&(r.visible=!1)):r.name==="START"?(r.position.copy(this.worldPositionStart),r.visible=this.dragging):r.name==="END"?(r.position.copy(this.worldPosition),r.visible=this.dragging):r.name==="DELTA"?(r.position.copy(this.worldPositionStart),r.quaternion.copy(this.worldQuaternionStart),bt.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),bt.applyQuaternion(this.worldQuaternionStart.clone().invert()),r.scale.copy(bt),r.visible=this.dragging):(r.quaternion.copy(t),this.dragging?r.position.copy(this.worldPositionStart):r.position.copy(this.worldPosition),this.axis&&(r.visible=this.axis.search(r.name)!==-1));continue}r.quaternion.copy(t),this.mode==="translate"||this.mode==="scale"?(r.name==="X"&&Math.abs(ze.copy(Fr).applyQuaternion(t).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="Y"&&Math.abs(ze.copy(Pn).applyQuaternion(t).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="Z"&&Math.abs(ze.copy(Or).applyQuaternion(t).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="XY"&&Math.abs(ze.copy(Or).applyQuaternion(t).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="YZ"&&Math.abs(ze.copy(Fr).applyQuaternion(t).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="XZ"&&Math.abs(ze.copy(Pn).applyQuaternion(t).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1)):this.mode==="rotate"&&(ya.copy(t),ze.copy(this.eye).applyQuaternion(qe.copy(t).invert()),r.name.search("E")!==-1&&r.quaternion.setFromRotationMatrix(Xd.lookAt(this.eye,Wd,Pn)),r.name==="X"&&(qe.setFromAxisAngle(Fr,Math.atan2(-ze.y,ze.z)),qe.multiplyQuaternions(ya,qe),r.quaternion.copy(qe)),r.name==="Y"&&(qe.setFromAxisAngle(Pn,Math.atan2(ze.x,ze.z)),qe.multiplyQuaternions(ya,qe),r.quaternion.copy(qe)),r.name==="Z"&&(qe.setFromAxisAngle(Or,Math.atan2(ze.y,ze.x)),qe.multiplyQuaternions(ya,qe),r.quaternion.copy(qe))),r.visible=r.visible&&(r.name.indexOf("X")===-1||this.showX),r.visible=r.visible&&(r.name.indexOf("Y")===-1||this.showY),r.visible=r.visible&&(r.name.indexOf("Z")===-1||this.showZ),r.visible=r.visible&&(r.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),r.material._color=r.material._color||r.material.color.clone(),r.material._opacity=r.material._opacity||r.material.opacity,r.material.color.copy(r.material._color),r.material.opacity=r.material._opacity,this.enabled&&this.axis&&(r.name===this.axis||this.axis.split("").some(function(a){return r.name===a}))&&(r.material.color.setHex(16776960),r.material.opacity=1)}super.updateMatrixWorld(e)}}class j1 extends le{constructor(){super(new ul(1e5,1e5,2,2),new Xt({visible:!1,wireframe:!0,side:no,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(t="local"),Ea.copy(Fr).applyQuaternion(t==="local"?this.worldQuaternion:Da),Ar.copy(Pn).applyQuaternion(t==="local"?this.worldQuaternion:Da),Sr.copy(Or).applyQuaternion(t==="local"?this.worldQuaternion:Da),ze.copy(Ar),this.mode){case"translate":case"scale":switch(this.axis){case"X":ze.copy(this.eye).cross(Ea),pi.copy(Ea).cross(ze);break;case"Y":ze.copy(this.eye).cross(Ar),pi.copy(Ar).cross(ze);break;case"Z":ze.copy(this.eye).cross(Sr),pi.copy(Sr).cross(ze);break;case"XY":pi.copy(Sr);break;case"YZ":pi.copy(Ea);break;case"XZ":ze.copy(Sr),pi.copy(Ar);break;case"XYZ":case"E":pi.set(0,0,0);break}break;case"rotate":default:pi.set(0,0,0)}pi.length()===0?this.quaternion.copy(this.cameraQuaternion):(Kd.lookAt(bt.set(0,0,0),pi,ze),this.quaternion.setFromRotationMatrix(Kd)),super.updateMatrixWorld(e)}}let Qf=class Zf{constructor(e,t,i,n,r,o=5,a=!0){if(A(this,"onDraggingStarted",new ee),A(this,"onDraggingEnded",new ee),A(this,"onDisposed",new ee),A(this,"normal"),A(this,"origin"),A(this,"three",new an),A(this,"_helper"),A(this,"_visible",!0),A(this,"_enabled",!0),A(this,"components"),A(this,"world"),A(this,"_controlsActive",!1),A(this,"_arrowBoundBox",new le),A(this,"_planeMesh"),A(this,"_controls"),A(this,"_hiddenMaterial",new Xt({visible:!1})),A(this,"update",()=>{this._enabled&&this.three.setFromNormalAndCoplanarPoint(this.normal,this._helper.position)}),A(this,"changeDrag",l=>{this._visible=!l.value,this.preventCameraMovement(),this.notifyDraggingChanged(l)}),this.components=e,this.world=t,!t.renderer)throw new Error("The given world must have a renderer!");this.normal=n,this.origin=i,t.renderer.setPlane(!0,this.three),this._planeMesh=Zf.newPlaneMesh(o,r),this._helper=this.newHelper(),this._controls=this.newTransformControls(),this.three.setFromNormalAndCoplanarPoint(n,i),a&&this.toggleControls(!0)}get enabled(){return this._enabled}set enabled(e){if(!this.world.renderer)throw new Error("No renderer found for clipping plane!");this._enabled=e,this.world.renderer.setPlane(e,this.three)}get visible(){return this._visible}set visible(e){this._visible=e,this._controls.visible=e,this._helper.visible=e,this.toggleControls(e)}get meshes(){return[this._planeMesh,this._arrowBoundBox]}get planeMaterial(){return this._planeMesh.material}set planeMaterial(e){this._planeMesh.material=e}get size(){return this._planeMesh.scale.x}set size(e){this._planeMesh.scale.set(e,e,e)}get helper(){return this._helper}setFromNormalAndCoplanarPoint(e,t){this.reset(),this.normal.equals(e)||(this.normal.copy(e),this._helper.lookAt(e)),this.origin.copy(t),this._helper.position.copy(t),this._helper.updateMatrix(),this.update()}dispose(){this._enabled=!1,this.onDraggingStarted.reset(),this.onDraggingEnded.reset(),this._helper.removeFromParent(),this.world.renderer&&this.world.renderer.setPlane(!1,this.three),this._arrowBoundBox.removeFromParent(),this._arrowBoundBox.geometry.dispose(),this._planeMesh.geometry.dispose(),this._controls.removeFromParent(),this._controls.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}reset(){const e=new F(1,0,0),t=new F;this.normal.equals(e)||(this.normal.copy(e),this._helper.lookAt(e)),this.origin.copy(t),this._helper.position.copy(t),this._helper.updateMatrix()}toggleControls(e){if(e){if(this._controlsActive)return;this._controls.addEventListener("change",this.update),this._controls.addEventListener("dragging-changed",this.changeDrag)}else this._controls.removeEventListener("change",this.update),this._controls.removeEventListener("dragging-changed",this.changeDrag);this._controlsActive=e}newTransformControls(){if(!this.world.renderer)throw new Error("No renderer found for clipping plane!");const e=this.world.camera.three,t=this.world.renderer.three.domElement,i=new k1(e,t);return this.initializeControls(i),this.world.scene.three.add(i),i}initializeControls(e){e.attach(this._helper),e.showX=!1,e.showY=!1,e.setSpace("local"),this.createArrowBoundingBox(),e.children[0].children[0].add(this._arrowBoundBox)}createArrowBoundingBox(){this._arrowBoundBox.geometry=new Tt(.18,.18,1.2),this._arrowBoundBox.material=this._hiddenMaterial,this._arrowBoundBox.rotateX(Math.PI/2),this._arrowBoundBox.updateMatrix(),this._arrowBoundBox.geometry.applyMatrix4(this._arrowBoundBox.matrix)}notifyDraggingChanged(e){e.value?this.onDraggingStarted.trigger():this.onDraggingEnded.trigger()}preventCameraMovement(){this.world.camera.enabled=this._visible}newHelper(){const e=new kn;return e.lookAt(this.normal),e.position.copy(this.origin),this._planeMesh.position.z+=.01,e.add(this._planeMesh),this.world.scene.three.add(e),e}static newPlaneMesh(e,t){const i=new ul(1),n=new le(i,t);return n.scale.set(e,e,e),n}};const qf=class ch extends Re{constructor(e){super(e),A(this,"onAfterCreate",new ee),A(this,"onAfterDelete",new ee),A(this,"onBeforeDrag",new ee),A(this,"onAfterDrag",new ee),A(this,"onBeforeCreate",new ee),A(this,"onBeforeCancel",new ee),A(this,"onAfterCancel",new ee),A(this,"onBeforeDelete",new ee),A(this,"onDisposed",new ee),A(this,"orthogonalY",!1),A(this,"toleranceOrthogonalY",.7),A(this,"Type",Qf),A(this,"list",[]),A(this,"_material",new Xt({color:12255487,side:no,transparent:!0,opacity:.2})),A(this,"_size",5),A(this,"_enabled",!1),A(this,"_visible",!0),A(this,"_onStartDragging",()=>{this.onBeforeDrag.trigger()}),A(this,"_onEndDragging",()=>{this.onAfterDrag.trigger()}),this.components.add(ch.uuid,this)}get enabled(){return this._enabled}set enabled(e){this._enabled=e;for(const t of this.list)t.enabled=e;this.updateMaterialsAndPlanes()}get visible(){return this._visible}set visible(e){this._visible=e;for(const t of this.list)t.visible=e}get material(){return this._material}set material(e){this._material=e;for(const t of this.list)t.planeMaterial=e}get size(){return this._size}set size(e){this._size=e;for(const t of this.list)t.size=e}dispose(){this._enabled=!1;for(const e of this.list)e.dispose();this.list.length=0,this._material.dispose(),this.onBeforeCreate.reset(),this.onBeforeCancel.reset(),this.onBeforeDelete.reset(),this.onBeforeDrag.reset(),this.onAfterCreate.reset(),this.onAfterCancel.reset(),this.onAfterDelete.reset(),this.onAfterDrag.reset(),this.onDisposed.trigger(ch.uuid),this.onDisposed.reset()}create(e){if(!this.enabled)return;const t=this.components.get(ni).get(e).castRay();t&&this.createPlaneFromIntersection(e,t)}createFromNormalAndCoplanarPoint(e,t,i){const n=this.newPlane(e,i,t);return this.updateMaterialsAndPlanes(),n}delete(e,t){this.enabled&&(t||(t=this.pickPlane(e)),t&&this.deletePlane(t))}deleteAll(){for(;this.list.length>0;){const e=this.list[0];this.delete(e.world,e)}}deletePlane(e){const t=this.list.indexOf(e);if(t!==-1){if(this.list.splice(t,1),!e.world.renderer)throw new Error("Renderer not found for this plane's world!");e.world.renderer.setPlane(!1,e.three),e.dispose(),this.updateMaterialsAndPlanes(),this.onAfterDelete.trigger(e)}}pickPlane(e){const t=this.components.get(ni).get(e),i=this.getAllPlaneMeshes(),n=t.castRay(i);if(n){const r=n.object;return this.list.find(o=>o.meshes.includes(r))}}getAllPlaneMeshes(){const e=[];for(const t of this.list)e.push(...t.meshes);return e}createPlaneFromIntersection(e,t){var i;if(!e.renderer)throw new Error("The given world must have a renderer!");const n=t.point.distanceTo(new F(0,0,0)),r=(i=t.face)==null?void 0:i.normal;if(!n||!r)return;const o=this.getWorldNormal(t,r),a=this.newPlane(e,t.point,o.negate());a.visible=this._visible,a.size=this._size,e.renderer.setPlane(!0,a.three),this.updateMaterialsAndPlanes()}getWorldNormal(e,t){const i=e.object;let n=e.object.matrixWorld.clone();if(i instanceof Kt&&e.instanceId!==void 0){const a=new Ee;i.getMatrixAt(e.instanceId,a),n=a.multiply(n)}const r=new On().getNormalMatrix(n),o=t.clone().applyMatrix3(r).normalize();return this.normalizePlaneDirectionY(o),o}normalizePlaneDirectionY(e){this.orthogonalY&&(e.y>this.toleranceOrthogonalY&&(e.x=0,e.y=1,e.z=0),e.y<-this.toleranceOrthogonalY&&(e.x=0,e.y=-1,e.z=0))}newPlane(e,t,i){const n=new this.Type(this.components,e,t,i,this._material);return n.onDraggingStarted.add(this._onStartDragging),n.onDraggingEnded.add(this._onEndDragging),this.list.push(n),this.onAfterCreate.trigger(n),n}updateMaterialsAndPlanes(){const e=this.components.get(D1);for(const[t,i]of e.list){if(!i.renderer)continue;i.renderer.updateClippingPlanes();const{clippingPlanes:n}=i.renderer;for(const r of i.meshes)if(Array.isArray(r.material))for(const o of r.material)o.clippingPlanes=n;else r.material.clippingPlanes=n}}};A(qf,"uuid","66290bc5-18c4-4cd1-9379-2e17a0617611");let Ga=qf;function W1(s,e,t,i){return new Promise((n,r)=>{function o(){const a=s.clientWaitSync(e,t,0);if(a===s.WAIT_FAILED){r();return}if(a===s.TIMEOUT_EXPIRED){setTimeout(o,i);return}n()}o()})}async function X1(s,e,t,i,n,r,o){const a=s.fenceSync(s.SYNC_GPU_COMMANDS_COMPLETE,0);s.flush(),await W1(s,a,0,10),s.deleteSync(a),s.bindBuffer(e,t),s.getBufferSubData(e,i,n,r,o),s.bindBuffer(e,null)}async function K1(s,e,t,i,n,r,o,a){const l=s.createBuffer();return s.bindBuffer(s.PIXEL_PACK_BUFFER,l),s.bufferData(s.PIXEL_PACK_BUFFER,a.byteLength,s.STREAM_READ),s.readPixels(e,t,i,n,r,o,0),s.bindBuffer(s.PIXEL_PACK_BUFFER,null),await X1(s,s.PIXEL_PACK_BUFFER,l,0,a),s.deleteBuffer(l),a}let Jf=class{constructor(e,t,i){if(A(this,"onDisposed",new ee),A(this,"onViewUpdated",new $i),A(this,"enabled",!0),A(this,"needsUpdate",!1),A(this,"renderDebugFrame",!1),A(this,"components"),A(this,"world"),A(this,"renderer"),A(this,"autoUpdate",!0),A(this,"updateInterval",1e3),A(this,"worker"),A(this,"scene",new Xn),A(this,"_width",512),A(this,"_height",512),A(this,"_availableColor",1),A(this,"renderTarget"),A(this,"bufferSize"),A(this,"_buffer"),A(this,"_isWorkerBusy",!1),A(this,"updateVisibility",async o=>{if(!this.enabled||!this.needsUpdate&&!o||this._isWorkerBusy)return;this._isWorkerBusy=!0;const a=this.world.camera.three;a.updateMatrix(),this.renderer.setSize(this._width,this._height),this.renderer.setRenderTarget(this.renderTarget),this.renderer.render(this.scene,a);const l=this.renderer.getContext();await K1(l,0,0,this._width,this._height,l.RGBA,l.UNSIGNED_BYTE,this._buffer),this.renderer.setRenderTarget(null),this.renderDebugFrame&&this.renderer.render(this.scene,a),this.worker.postMessage({buffer:this._buffer}),this.needsUpdate=!1}),!t.renderer)throw new Error("The given world must have a renderer!");this.components=e,this.applySettings(i),this.world=t,this.renderer=new Ha,this.renderTarget=new Ri(this._width,this._height),this.bufferSize=this._width*this._height*4,this._buffer=new Uint8Array(this.bufferSize),this.renderer.clippingPlanes=t.renderer.clippingPlanes;const n=` + `,extensions:{derivatives:!0}});this.three=new le(l,h),this.three.frustumCulled=!1,t.scene.three.add(this.three),this.setupEvents(!0)}get visible(){return this.three.visible}set visible(e){e?this.world.scene.three.add(this.three):this.three.removeFromParent()}get material(){return this.three.material}get fade(){return this._fade===3}set fade(e){this._fade=e?3:0,this.material.uniforms.uFade.value=this._fade}[Symbol.dispose](){throw new Error("Method not implemented.")}dispose(){this.setupEvents(!1),this.components.get(Fi).destroy(this.three),this.onDisposed.trigger(),this.onDisposed.reset(),this.world=null,this.components=null}setupEvents(e){if(!(this.world.camera instanceof ch))return;const t=this.world.camera.controls;e?t.addEventListener("update",this.updateZoom):t.removeEventListener("update",this.updateZoom)}}class U1 extends Re{constructor(){super(...arguments),A(this,"list",new Map),A(this,"onDisposed",new ee),A(this,"config",{color:new Rt(12303291),size1:1,size2:10,distance:500}),A(this,"enabled",!0)}create(e){if(this.list.has(e.uuid))throw new Error("This world already has a grid!");const t=new N1(this.components,e,this.config);return this.list.set(e.uuid,t),e.onDisposed.add(()=>{this.delete(e)}),t}delete(e){const t=this.list.get(e.uuid);t&&t.dispose(),this.list.delete(e.uuid)}dispose(){for(const[e,t]of this.list)t.dispose();this.list.clear(),this.onDisposed.trigger()}}A(U1,"uuid","d1e814d5-b81c-4452-87a2-f039375e0489");const xn=new io,bt=new O,Ki=new O,qe=new Vt,Vd={X:new O(1,0,0),Y:new O(0,1,0),Z:new O(0,0,1)},kc={type:"change"},Hd={type:"mouseDown"},Yd={type:"mouseUp",mode:null},Gd={type:"objectChange"};class k1 extends kn{constructor(e,t){super(),t===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),t=document),this.isTransformControls=!0,this.visible=!1,this.domElement=t,this.domElement.style.touchAction="none";const i=new G1;this._gizmo=i,this.add(i);const n=new j1;this._plane=n,this.add(n);const r=this;function o(S,_){let I=_;Object.defineProperty(r,S,{get:function(){return I!==void 0?I:_},set:function(P){I!==P&&(I=P,n[S]=P,i[S]=P,r.dispatchEvent({type:S+"-changed",value:P}),r.dispatchEvent(kc))}}),r[S]=_,n[S]=_,i[S]=_}o("camera",e),o("object",void 0),o("enabled",!0),o("axis",null),o("mode","translate"),o("translationSnap",null),o("rotationSnap",null),o("scaleSnap",null),o("space","world"),o("size",1),o("dragging",!1),o("showX",!0),o("showY",!0),o("showZ",!0);const a=new O,l=new O,h=new Vt,d=new Vt,p=new O,f=new Vt,g=new O,v=new O,b=new O,w=0,T=new O;o("worldPosition",a),o("worldPositionStart",l),o("worldQuaternion",h),o("worldQuaternionStart",d),o("cameraPosition",p),o("cameraQuaternion",f),o("pointStart",g),o("pointEnd",v),o("rotationAxis",b),o("rotationAngle",w),o("eye",T),this._offset=new O,this._startNorm=new O,this._endNorm=new O,this._cameraScale=new O,this._parentPosition=new O,this._parentQuaternion=new Vt,this._parentQuaternionInv=new Vt,this._parentScale=new O,this._worldScaleStart=new O,this._worldQuaternionInv=new Vt,this._worldScale=new O,this._positionStart=new O,this._quaternionStart=new Vt,this._scaleStart=new O,this._getPointer=B1.bind(this),this._onPointerDown=V1.bind(this),this._onPointerHover=z1.bind(this),this._onPointerMove=H1.bind(this),this._onPointerUp=Y1.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(this)}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;xn.setFromCamera(e,this.camera);const t=Bc(this._gizmo.picker[this.mode],xn);t?this.axis=t.object.name:this.axis=null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e.button!==0)&&this.axis!==null){xn.setFromCamera(e,this.camera);const t=Bc(this._plane,xn,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,Hd.mode=this.mode,this.dispatchEvent(Hd)}}pointerMove(e){const t=this.axis,i=this.mode,n=this.object;let r=this.space;if(i==="scale"?r="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(r="world"),n===void 0||t===null||this.dragging===!1||e.button!==-1)return;xn.setFromCamera(e,this.camera);const o=Bc(this._plane,xn,!0);if(o){if(this.pointEnd.copy(o.point).sub(this.worldPositionStart),i==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),r==="local"&&t!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf("X")===-1&&(this._offset.x=0),t.indexOf("Y")===-1&&(this._offset.y=0),t.indexOf("Z")===-1&&(this._offset.z=0),r==="local"&&t!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),n.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(r==="local"&&(n.position.applyQuaternion(qe.copy(this._quaternionStart).invert()),t.search("X")!==-1&&(n.position.x=Math.round(n.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(n.position.y=Math.round(n.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(n.position.z=Math.round(n.position.z/this.translationSnap)*this.translationSnap),n.position.applyQuaternion(this._quaternionStart)),r==="world"&&(n.parent&&n.position.add(bt.setFromMatrixPosition(n.parent.matrixWorld)),t.search("X")!==-1&&(n.position.x=Math.round(n.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(n.position.y=Math.round(n.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(n.position.z=Math.round(n.position.z/this.translationSnap)*this.translationSnap),n.parent&&n.position.sub(bt.setFromMatrixPosition(n.parent.matrixWorld))));else if(i==="scale"){if(t.search("XYZ")!==-1){let a=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(a*=-1),Ki.set(a,a,a)}else bt.copy(this.pointStart),Ki.copy(this.pointEnd),bt.applyQuaternion(this._worldQuaternionInv),Ki.applyQuaternion(this._worldQuaternionInv),Ki.divide(bt),t.search("X")===-1&&(Ki.x=1),t.search("Y")===-1&&(Ki.y=1),t.search("Z")===-1&&(Ki.z=1);n.scale.copy(this._scaleStart).multiply(Ki),this.scaleSnap&&(t.search("X")!==-1&&(n.scale.x=Math.round(n.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Y")!==-1&&(n.scale.y=Math.round(n.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Z")!==-1&&(n.scale.z=Math.round(n.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(i==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const a=20/this.worldPosition.distanceTo(bt.setFromMatrixPosition(this.camera.matrixWorld));let l=!1;t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(bt.copy(this.rotationAxis).cross(this.eye))*a):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(Vd[t]),bt.copy(Vd[t]),r==="local"&&bt.applyQuaternion(this.worldQuaternion),bt.cross(this.eye),bt.length()===0?l=!0:this.rotationAngle=this._offset.dot(bt.normalize())*a),(t==="E"||l)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),r==="local"&&t!=="E"&&t!=="XYZE"?(n.quaternion.copy(this._quaternionStart),n.quaternion.multiply(qe.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),n.quaternion.copy(qe.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),n.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(kc),this.dispatchEvent(Gd)}}pointerUp(e){e.button===0&&(this.dragging&&this.axis!==null&&(Yd.mode=this.mode,this.dispatchEvent(Yd)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}attach(e){return this.object=e,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(kc),this.dispatchEvent(Gd),this.pointStart.copy(this.pointEnd))}getRaycaster(){return xn}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}}function B1(s){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:s.button};{const e=this.domElement.getBoundingClientRect();return{x:(s.clientX-e.left)/e.width*2-1,y:-(s.clientY-e.top)/e.height*2+1,button:s.button}}}function z1(s){if(this.enabled)switch(s.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(s));break}}function V1(s){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(s.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(s)),this.pointerDown(this._getPointer(s)))}function H1(s){this.enabled&&this.pointerMove(this._getPointer(s))}function Y1(s){this.enabled&&(this.domElement.releasePointerCapture(s.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(s)))}function Bc(s,e,t){const i=e.intersectObject(s,!0);for(let n=0;n.9&&(r.visible=!1)),this.axis==="Y"&&(qe.setFromEuler(va.set(0,0,Math.PI/2)),r.quaternion.copy(t).multiply(qe),Math.abs(ze.copy(Pn).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis==="Z"&&(qe.setFromEuler(va.set(0,Math.PI/2,0)),r.quaternion.copy(t).multiply(qe),Math.abs(ze.copy(Fr).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis==="XYZE"&&(qe.setFromEuler(va.set(0,Math.PI/2,0)),ze.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(Wd.lookAt(jd,ze,Pn)),r.quaternion.multiply(qe),r.visible=this.dragging),this.axis==="E"&&(r.visible=!1)):r.name==="START"?(r.position.copy(this.worldPositionStart),r.visible=this.dragging):r.name==="END"?(r.position.copy(this.worldPosition),r.visible=this.dragging):r.name==="DELTA"?(r.position.copy(this.worldPositionStart),r.quaternion.copy(this.worldQuaternionStart),bt.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),bt.applyQuaternion(this.worldQuaternionStart.clone().invert()),r.scale.copy(bt),r.visible=this.dragging):(r.quaternion.copy(t),this.dragging?r.position.copy(this.worldPositionStart):r.position.copy(this.worldPosition),this.axis&&(r.visible=this.axis.search(r.name)!==-1));continue}r.quaternion.copy(t),this.mode==="translate"||this.mode==="scale"?(r.name==="X"&&Math.abs(ze.copy(Or).applyQuaternion(t).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="Y"&&Math.abs(ze.copy(Pn).applyQuaternion(t).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="Z"&&Math.abs(ze.copy(Fr).applyQuaternion(t).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="XY"&&Math.abs(ze.copy(Fr).applyQuaternion(t).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="YZ"&&Math.abs(ze.copy(Or).applyQuaternion(t).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="XZ"&&Math.abs(ze.copy(Pn).applyQuaternion(t).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1)):this.mode==="rotate"&&(ya.copy(t),ze.copy(this.eye).applyQuaternion(qe.copy(t).invert()),r.name.search("E")!==-1&&r.quaternion.setFromRotationMatrix(Wd.lookAt(this.eye,jd,Pn)),r.name==="X"&&(qe.setFromAxisAngle(Or,Math.atan2(-ze.y,ze.z)),qe.multiplyQuaternions(ya,qe),r.quaternion.copy(qe)),r.name==="Y"&&(qe.setFromAxisAngle(Pn,Math.atan2(ze.x,ze.z)),qe.multiplyQuaternions(ya,qe),r.quaternion.copy(qe)),r.name==="Z"&&(qe.setFromAxisAngle(Fr,Math.atan2(ze.y,ze.x)),qe.multiplyQuaternions(ya,qe),r.quaternion.copy(qe))),r.visible=r.visible&&(r.name.indexOf("X")===-1||this.showX),r.visible=r.visible&&(r.name.indexOf("Y")===-1||this.showY),r.visible=r.visible&&(r.name.indexOf("Z")===-1||this.showZ),r.visible=r.visible&&(r.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),r.material._color=r.material._color||r.material.color.clone(),r.material._opacity=r.material._opacity||r.material.opacity,r.material.color.copy(r.material._color),r.material.opacity=r.material._opacity,this.enabled&&this.axis&&(r.name===this.axis||this.axis.split("").some(function(a){return r.name===a}))&&(r.material.color.setHex(16776960),r.material.opacity=1)}super.updateMatrixWorld(e)}}class j1 extends le{constructor(){super(new ul(1e5,1e5,2,2),new Xt({visible:!1,wireframe:!0,side:no,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(t="local"),Ea.copy(Or).applyQuaternion(t==="local"?this.worldQuaternion:Da),Ar.copy(Pn).applyQuaternion(t==="local"?this.worldQuaternion:Da),Sr.copy(Fr).applyQuaternion(t==="local"?this.worldQuaternion:Da),ze.copy(Ar),this.mode){case"translate":case"scale":switch(this.axis){case"X":ze.copy(this.eye).cross(Ea),pi.copy(Ea).cross(ze);break;case"Y":ze.copy(this.eye).cross(Ar),pi.copy(Ar).cross(ze);break;case"Z":ze.copy(this.eye).cross(Sr),pi.copy(Sr).cross(ze);break;case"XY":pi.copy(Sr);break;case"YZ":pi.copy(Ea);break;case"XZ":ze.copy(Sr),pi.copy(Ar);break;case"XYZ":case"E":pi.set(0,0,0);break}break;case"rotate":default:pi.set(0,0,0)}pi.length()===0?this.quaternion.copy(this.cameraQuaternion):(Xd.lookAt(bt.set(0,0,0),pi,ze),this.quaternion.setFromRotationMatrix(Xd)),super.updateMatrixWorld(e)}}let Kf=class Qf{constructor(e,t,i,n,r,o=5,a=!0){if(A(this,"onDraggingStarted",new ee),A(this,"onDraggingEnded",new ee),A(this,"onDisposed",new ee),A(this,"normal"),A(this,"origin"),A(this,"three",new an),A(this,"_helper"),A(this,"_visible",!0),A(this,"_enabled",!0),A(this,"components"),A(this,"world"),A(this,"_controlsActive",!1),A(this,"_arrowBoundBox",new le),A(this,"_planeMesh"),A(this,"_controls"),A(this,"_hiddenMaterial",new Xt({visible:!1})),A(this,"update",()=>{this._enabled&&this.three.setFromNormalAndCoplanarPoint(this.normal,this._helper.position)}),A(this,"changeDrag",l=>{this._visible=!l.value,this.preventCameraMovement(),this.notifyDraggingChanged(l)}),this.components=e,this.world=t,!t.renderer)throw new Error("The given world must have a renderer!");this.normal=n,this.origin=i,t.renderer.setPlane(!0,this.three),this._planeMesh=Qf.newPlaneMesh(o,r),this._helper=this.newHelper(),this._controls=this.newTransformControls(),this.three.setFromNormalAndCoplanarPoint(n,i),a&&this.toggleControls(!0)}get enabled(){return this._enabled}set enabled(e){if(!this.world.renderer)throw new Error("No renderer found for clipping plane!");this._enabled=e,this.world.renderer.setPlane(e,this.three)}get visible(){return this._visible}set visible(e){this._visible=e,this._controls.visible=e,this._helper.visible=e,this.toggleControls(e)}get meshes(){return[this._planeMesh,this._arrowBoundBox]}get planeMaterial(){return this._planeMesh.material}set planeMaterial(e){this._planeMesh.material=e}get size(){return this._planeMesh.scale.x}set size(e){this._planeMesh.scale.set(e,e,e)}get helper(){return this._helper}setFromNormalAndCoplanarPoint(e,t){this.reset(),this.normal.equals(e)||(this.normal.copy(e),this._helper.lookAt(e)),this.origin.copy(t),this._helper.position.copy(t),this._helper.updateMatrix(),this.update()}dispose(){this._enabled=!1,this.onDraggingStarted.reset(),this.onDraggingEnded.reset(),this._helper.removeFromParent(),this.world.renderer&&this.world.renderer.setPlane(!1,this.three),this._arrowBoundBox.removeFromParent(),this._arrowBoundBox.geometry.dispose(),this._planeMesh.geometry.dispose(),this._controls.removeFromParent(),this._controls.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}reset(){const e=new O(1,0,0),t=new O;this.normal.equals(e)||(this.normal.copy(e),this._helper.lookAt(e)),this.origin.copy(t),this._helper.position.copy(t),this._helper.updateMatrix()}toggleControls(e){if(e){if(this._controlsActive)return;this._controls.addEventListener("change",this.update),this._controls.addEventListener("dragging-changed",this.changeDrag)}else this._controls.removeEventListener("change",this.update),this._controls.removeEventListener("dragging-changed",this.changeDrag);this._controlsActive=e}newTransformControls(){if(!this.world.renderer)throw new Error("No renderer found for clipping plane!");const e=this.world.camera.three,t=this.world.renderer.three.domElement,i=new k1(e,t);return this.initializeControls(i),this.world.scene.three.add(i),i}initializeControls(e){e.attach(this._helper),e.showX=!1,e.showY=!1,e.setSpace("local"),this.createArrowBoundingBox(),e.children[0].children[0].add(this._arrowBoundBox)}createArrowBoundingBox(){this._arrowBoundBox.geometry=new Tt(.18,.18,1.2),this._arrowBoundBox.material=this._hiddenMaterial,this._arrowBoundBox.rotateX(Math.PI/2),this._arrowBoundBox.updateMatrix(),this._arrowBoundBox.geometry.applyMatrix4(this._arrowBoundBox.matrix)}notifyDraggingChanged(e){e.value?this.onDraggingStarted.trigger():this.onDraggingEnded.trigger()}preventCameraMovement(){this.world.camera.enabled=this._visible}newHelper(){const e=new kn;return e.lookAt(this.normal),e.position.copy(this.origin),this._planeMesh.position.z+=.01,e.add(this._planeMesh),this.world.scene.three.add(e),e}static newPlaneMesh(e,t){const i=new ul(1),n=new le(i,t);return n.scale.set(e,e,e),n}};const Zf=class hh extends Re{constructor(e){super(e),A(this,"onAfterCreate",new ee),A(this,"onAfterDelete",new ee),A(this,"onBeforeDrag",new ee),A(this,"onAfterDrag",new ee),A(this,"onBeforeCreate",new ee),A(this,"onBeforeCancel",new ee),A(this,"onAfterCancel",new ee),A(this,"onBeforeDelete",new ee),A(this,"onDisposed",new ee),A(this,"orthogonalY",!1),A(this,"toleranceOrthogonalY",.7),A(this,"Type",Kf),A(this,"list",[]),A(this,"_material",new Xt({color:12255487,side:no,transparent:!0,opacity:.2})),A(this,"_size",5),A(this,"_enabled",!1),A(this,"_visible",!0),A(this,"_onStartDragging",()=>{this.onBeforeDrag.trigger()}),A(this,"_onEndDragging",()=>{this.onAfterDrag.trigger()}),this.components.add(hh.uuid,this)}get enabled(){return this._enabled}set enabled(e){this._enabled=e;for(const t of this.list)t.enabled=e;this.updateMaterialsAndPlanes()}get visible(){return this._visible}set visible(e){this._visible=e;for(const t of this.list)t.visible=e}get material(){return this._material}set material(e){this._material=e;for(const t of this.list)t.planeMaterial=e}get size(){return this._size}set size(e){this._size=e;for(const t of this.list)t.size=e}dispose(){this._enabled=!1;for(const e of this.list)e.dispose();this.list.length=0,this._material.dispose(),this.onBeforeCreate.reset(),this.onBeforeCancel.reset(),this.onBeforeDelete.reset(),this.onBeforeDrag.reset(),this.onAfterCreate.reset(),this.onAfterCancel.reset(),this.onAfterDelete.reset(),this.onAfterDrag.reset(),this.onDisposed.trigger(hh.uuid),this.onDisposed.reset()}create(e){if(!this.enabled)return;const t=this.components.get(ni).get(e).castRay();t&&this.createPlaneFromIntersection(e,t)}createFromNormalAndCoplanarPoint(e,t,i){const n=this.newPlane(e,i,t);return this.updateMaterialsAndPlanes(),n}delete(e,t){this.enabled&&(t||(t=this.pickPlane(e)),t&&this.deletePlane(t))}deleteAll(){for(;this.list.length>0;){const e=this.list[0];this.delete(e.world,e)}}deletePlane(e){const t=this.list.indexOf(e);if(t!==-1){if(this.list.splice(t,1),!e.world.renderer)throw new Error("Renderer not found for this plane's world!");e.world.renderer.setPlane(!1,e.three),e.dispose(),this.updateMaterialsAndPlanes(),this.onAfterDelete.trigger(e)}}pickPlane(e){const t=this.components.get(ni).get(e),i=this.getAllPlaneMeshes(),n=t.castRay(i);if(n){const r=n.object;return this.list.find(o=>o.meshes.includes(r))}}getAllPlaneMeshes(){const e=[];for(const t of this.list)e.push(...t.meshes);return e}createPlaneFromIntersection(e,t){var i;if(!e.renderer)throw new Error("The given world must have a renderer!");const n=t.point.distanceTo(new O(0,0,0)),r=(i=t.face)==null?void 0:i.normal;if(!n||!r)return;const o=this.getWorldNormal(t,r),a=this.newPlane(e,t.point,o.negate());a.visible=this._visible,a.size=this._size,e.renderer.setPlane(!0,a.three),this.updateMaterialsAndPlanes()}getWorldNormal(e,t){const i=e.object;let n=e.object.matrixWorld.clone();if(i instanceof Kt&&e.instanceId!==void 0){const a=new Ee;i.getMatrixAt(e.instanceId,a),n=a.multiply(n)}const r=new Fn().getNormalMatrix(n),o=t.clone().applyMatrix3(r).normalize();return this.normalizePlaneDirectionY(o),o}normalizePlaneDirectionY(e){this.orthogonalY&&(e.y>this.toleranceOrthogonalY&&(e.x=0,e.y=1,e.z=0),e.y<-this.toleranceOrthogonalY&&(e.x=0,e.y=-1,e.z=0))}newPlane(e,t,i){const n=new this.Type(this.components,e,t,i,this._material);return n.onDraggingStarted.add(this._onStartDragging),n.onDraggingEnded.add(this._onEndDragging),this.list.push(n),this.onAfterCreate.trigger(n),n}updateMaterialsAndPlanes(){const e=this.components.get(D1);for(const[t,i]of e.list){if(!i.renderer)continue;i.renderer.updateClippingPlanes();const{clippingPlanes:n}=i.renderer;for(const r of i.meshes)if(Array.isArray(r.material))for(const o of r.material)o.clippingPlanes=n;else r.material.clippingPlanes=n}}};A(Zf,"uuid","66290bc5-18c4-4cd1-9379-2e17a0617611");let Ga=Zf;function W1(s,e,t,i){return new Promise((n,r)=>{function o(){const a=s.clientWaitSync(e,t,0);if(a===s.WAIT_FAILED){r();return}if(a===s.TIMEOUT_EXPIRED){setTimeout(o,i);return}n()}o()})}async function X1(s,e,t,i,n,r,o){const a=s.fenceSync(s.SYNC_GPU_COMMANDS_COMPLETE,0);s.flush(),await W1(s,a,0,10),s.deleteSync(a),s.bindBuffer(e,t),s.getBufferSubData(e,i,n,r,o),s.bindBuffer(e,null)}async function K1(s,e,t,i,n,r,o,a){const l=s.createBuffer();return s.bindBuffer(s.PIXEL_PACK_BUFFER,l),s.bufferData(s.PIXEL_PACK_BUFFER,a.byteLength,s.STREAM_READ),s.readPixels(e,t,i,n,r,o,0),s.bindBuffer(s.PIXEL_PACK_BUFFER,null),await X1(s,s.PIXEL_PACK_BUFFER,l,0,a),s.deleteBuffer(l),a}let qf=class{constructor(e,t,i){if(A(this,"onDisposed",new ee),A(this,"onViewUpdated",new $i),A(this,"enabled",!0),A(this,"needsUpdate",!1),A(this,"renderDebugFrame",!1),A(this,"components"),A(this,"world"),A(this,"renderer"),A(this,"autoUpdate",!0),A(this,"updateInterval",1e3),A(this,"worker"),A(this,"scene",new Xn),A(this,"_width",512),A(this,"_height",512),A(this,"_availableColor",1),A(this,"renderTarget"),A(this,"bufferSize"),A(this,"_buffer"),A(this,"_isWorkerBusy",!1),A(this,"updateVisibility",async o=>{if(!this.enabled||!this.needsUpdate&&!o||this._isWorkerBusy)return;this._isWorkerBusy=!0;const a=this.world.camera.three;a.updateMatrix(),this.renderer.setSize(this._width,this._height),this.renderer.setRenderTarget(this.renderTarget),this.renderer.render(this.scene,a);const l=this.renderer.getContext();await K1(l,0,0,this._width,this._height,l.RGBA,l.UNSIGNED_BYTE,this._buffer),this.renderer.setRenderTarget(null),this.renderDebugFrame&&this.renderer.render(this.scene,a),this.worker.postMessage({buffer:this._buffer}),this.needsUpdate=!1}),!t.renderer)throw new Error("The given world must have a renderer!");this.components=e,this.applySettings(i),this.world=t,this.renderer=new Ha,this.renderTarget=new Ri(this._width,this._height),this.bufferSize=this._width*this._height*4,this._buffer=new Uint8Array(this.bufferSize),this.renderer.clippingPlanes=t.renderer.clippingPlanes;const n=` addEventListener("message", (event) => { const { buffer } = event.data; const colors = new Map(); @@ -85,7 +85,7 @@ var gv=Object.defineProperty;var vv=(s,e,t)=>e in s?gv(s,e,{enumerable:!0,config } postMessage({ colors }); }); - `,r=new Blob([n],{type:"application/javascript"});this.worker=new Worker(URL.createObjectURL(r))}dispose(){this.enabled=!1;for(const e of this.scene.children)e.removeFromParent();this.onViewUpdated.reset(),this.worker.terminate(),this.renderer.dispose(),this.renderTarget.dispose(),this._buffer=null,this.onDisposed.reset()}getAvailableColor(){let e=BigInt(this._availableColor.toString());const t=[];do t.unshift(Number(e%256n)),e/=256n;while(e);for(;t.length!==3;)t.unshift(0);const[i,n,r]=t,o=`${i}-${n}-${r}`;return{r:i,g:n,b:r,code:o}}increaseColor(){if(this._availableColor===256*256*256){console.warn("Color can't be increased over 256 x 256 x 256!");return}this._availableColor++}decreaseColor(){if(this._availableColor===1){console.warn("Color can't be decreased under 0!");return}this._availableColor--}applySettings(e){e&&(e.updateInterval!==void 0&&(this.updateInterval=e.updateInterval),e.height!==void 0&&(this._height=e.height),e.width!==void 0&&(this._width=e.width),e.autoUpdate!==void 0&&(this.autoUpdate=e.autoUpdate))}};class Q1 extends Jf{constructor(e,t,i){super(e,t,i),A(this,"threshold",100),A(this,"onViewUpdated",new ee),A(this,"colorMeshes",new Map),A(this,"isProcessing",!1),A(this,"_colorCodeMeshMap",new Map),A(this,"_meshIDColorCodeMap",new Map),A(this,"_currentVisibleMeshes",new Set),A(this,"_recentlyHiddenMeshes",new Set),A(this,"_intervalID",null),A(this,"_transparentMat",new Xt({transparent:!0,opacity:0})),A(this,"handleWorkerMessage",async n=>{if(this.isProcessing)return;const r=n.data.colors;this._recentlyHiddenMeshes=new Set(this._currentVisibleMeshes),this._currentVisibleMeshes.clear();for(const[o,a]of r){if(a{this.isProcessing||await this.updateVisibility()},this.updateInterval),this.onViewUpdated.add(({seen:n,unseen:r})=>{for(const o of n)o.visible=!0;for(const o of r)o.visible=!1})}dispose(){super.dispose(),this._intervalID!==null&&(window.clearInterval(this._intervalID),this._intervalID=null),this._currentVisibleMeshes.clear(),this._recentlyHiddenMeshes.clear(),this._meshIDColorCodeMap.clear(),this._transparentMat.dispose(),this._colorCodeMeshMap.clear();const e=this.components.get(Oi);for(const t in this.colorMeshes){const i=this.colorMeshes.get(t);i&&e.destroy(i,!0)}this.colorMeshes.clear()}add(e){if(!this.enabled)return;if(this.isProcessing){console.log("Culler processing not finished yet.");return}this.isProcessing=!0;const t=e instanceof Kt,{geometry:i,material:n}=e,{colorMaterial:r,code:o}=this.getAvailableMaterial();let a;if(Array.isArray(n)){let d=!0;const p=[];for(const f of n)Md.isTransparent(f)?p.push(this._transparentMat):(d=!1,p.push(r));if(d){r.dispose(),this.isProcessing=!1;return}a=p}else if(Md.isTransparent(n)){r.dispose(),this.isProcessing=!1;return}else a=r;this._colorCodeMeshMap.set(o,e),this._meshIDColorCodeMap.set(e.uuid,o);const l=t?e.count:1,h=new Kt(i,a,l);t?h.instanceMatrix=e.instanceMatrix:h.setMatrixAt(0,new Ee),e.visible=!1,h.applyMatrix4(e.matrix),h.updateMatrix(),this.scene.add(h),this.colorMeshes.set(e.uuid,h),this.increaseColor(),this.isProcessing=!1}remove(e){if(this.isProcessing){console.log("Culler processing not finished yet.");return}this.isProcessing=!0;const t=this.components.get(Oi);this._currentVisibleMeshes.delete(e),this._recentlyHiddenMeshes.delete(e);const i=this.colorMeshes.get(e.uuid),n=this._meshIDColorCodeMap.get(e.uuid);if(!i||!n){this.isProcessing=!1,console.log(e.visible);return}this._colorCodeMeshMap.delete(n),this._meshIDColorCodeMap.delete(e.uuid),this.colorMeshes.delete(e.uuid),i.geometry=void 0,i.material=[],t.destroy(i,!0),this._recentlyHiddenMeshes.delete(e),this._currentVisibleMeshes.delete(e),this.isProcessing=!1}getAvailableMaterial(){const{r:e,g:t,b:i,code:n}=this.getAvailableColor(),r=Si.enabled;Si.enabled=!1;const o=new Rt(`rgb(${e}, ${t}, ${i})`);if(!this.world.renderer)throw new Error("Renderer not found in the world!");const a=this.world.renderer.clippingPlanes,l=new Xt({color:o,clippingPlanes:a,side:no});return Si.enabled=r,{colorMaterial:l,code:n}}}const $f=class hh extends Re{constructor(e){super(e),A(this,"_enabled",!0),A(this,"list",new Map),A(this,"onDisposed",new ee),e.add(hh.uuid,this)}get enabled(){return this._enabled}set enabled(e){this._enabled=e;for(const[t,i]of this.list)i.enabled=e}create(e,t){if(this.list.has(e.uuid))return this.list.get(e.uuid);const i=new Q1(this.components,e,t);return this.list.set(e.uuid,i),i}delete(e){const t=this.list.get(e.uuid);t&&t.dispose(),this.list.delete(e.uuid)}dispose(){this.enabled=!1,this.onDisposed.trigger(hh.uuid),this.onDisposed.reset();for(const[e,t]of this.list)t.dispose();this.list.clear()}};A($f,"uuid","69f2a50d-c266-44fc-b1bd-fa4d34be89e6");let Z1=$f;class q1{constructor(e){if(A(this,"onDisposed",new ee),A(this,"onAfterUpdate",new ee),A(this,"onBeforeUpdate",new ee),A(this,"onResize",new ee),A(this,"frontOffset",0),A(this,"overrideMaterial",new xf),A(this,"backgroundColor",new Rt(395274)),A(this,"renderer"),A(this,"enabled",!0),A(this,"world"),A(this,"_lockRotation",!0),A(this,"_camera"),A(this,"_plane"),A(this,"_size",new Ve(320,160)),A(this,"_tempVector1",new F),A(this,"_tempVector2",new F),A(this,"_tempTarget",new F),A(this,"down",new F(0,-1,0)),A(this,"updatePlanes",()=>{if(!this.world.renderer)throw new Error("The given world must have a renderer!");const n=[],r=this.world.renderer.three;for(const o of r.clippingPlanes)n.push(o);n.push(this._plane),this.renderer.clippingPlanes=n}),this.world=e,!this.world.renderer)throw new Error("The given world must have a renderer!");this.renderer=new Ha,this.renderer.setSize(this._size.x,this._size.y);const t=1,i=this._size.x/this._size.y;this._camera=new jn(t*i/-2,t*i/2,t/2,t/-2),this.world.renderer.onClippingPlanesUpdated.add(this.updatePlanes),this._camera.position.set(0,200,0),this._camera.zoom=.1,this._camera.rotation.x=-Math.PI/2,this._plane=new an(this.down,200),this.updatePlanes()}get lockRotation(){return this._lockRotation}set lockRotation(e){this._lockRotation=e,e&&(this._camera.rotation.z=0)}get zoom(){return this._camera.zoom}set zoom(e){this._camera.zoom=e,this._camera.updateProjectionMatrix()}dispose(){this.enabled=!1,this.onBeforeUpdate.reset(),this.onAfterUpdate.reset(),this.onResize.reset(),this.overrideMaterial.dispose(),this.renderer.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}get(){return this._camera}update(){if(!this.enabled)return;this.onBeforeUpdate.trigger();const e=this.world.scene.three,t=this.world.camera;if(!t.hasCameraControls())throw new Error("The given world must use camera controls!");if(!(e instanceof Xn))throw new Error("The given world must have a THREE.Scene as a root!");const i=t.controls;if(i.getPosition(this._tempVector1),this._camera.position.x=this._tempVector1.x,this._camera.position.z=this._tempVector1.z,this.frontOffset!==0&&(i.getTarget(this._tempVector2),this._tempVector2.sub(this._tempVector1),this._tempVector2.normalize().multiplyScalar(this.frontOffset),this._camera.position.x+=this._tempVector2.x,this._camera.position.z+=this._tempVector2.z),!this._lockRotation){i.getTarget(this._tempTarget);const r=Math.atan2(this._tempTarget.x-this._tempVector1.x,this._tempTarget.z-this._tempVector1.z);this._camera.rotation.z=r+Math.PI}this._plane.set(this.down,this._tempVector1.y);const n=e.background;e.background=this.backgroundColor,this.renderer.render(e,this._camera),e.background=n,this.onAfterUpdate.trigger()}getSize(){return this._size}resize(e){if(e){this._size.copy(e),this.renderer.setSize(e.x,e.y);const t=e.x/e.y,i=1;this._camera.left=i*t/-2,this._camera.right=i*t/2,this._camera.top=i/2,this._camera.bottom=-i/2,this._camera.updateProjectionMatrix(),this.onResize.trigger(e)}}}const J1=class em extends Re{constructor(e){super(e),A(this,"onAfterUpdate",new ee),A(this,"onBeforeUpdate",new ee),A(this,"onDisposed",new ee),A(this,"enabled",!0),A(this,"list",new Map),this.components.add(em.uuid,this)}create(e){if(this.list.has(e.uuid))throw new Error("This world already has a minimap!");const t=new q1(e);return this.list.set(e.uuid,t),t}delete(e){const t=this.list.get(e);t&&t.dispose(),this.list.delete(e)}dispose(){for(const[e,t]of this.list)t.dispose();this.list.clear(),this.onDisposed.trigger()}update(){for(const[e,t]of this.list)t.update()}};A(J1,"uuid","39ad6aad-84c8-4adf-a1e0-7f25313a9e7f");class $1{constructor(e){A(this,"enabled",!1),A(this,"id","FirstPerson"),this.camera=e}set(e){if(this.enabled=e,e){if(this.camera.projection.current!=="Perspective"){this.camera.set("Orbit");return}this.setupFirstPersonCamera()}}setupFirstPersonCamera(){const e=this.camera.controls,t=new F;e.distance--,e.getPosition(t),e.minDistance=1,e.maxDistance=1,e.distance=1,e.moveTo(t.x,t.y,t.z),e.truckSpeed=50,e.mouseButtons.wheel=Mt.ACTION.DOLLY,e.touches.two=Mt.ACTION.TOUCH_ZOOM_TRUCK}}class eE{constructor(e){A(this,"enabled",!0),A(this,"id","Orbit"),this.camera=e,this.activateOrbitControls()}set(e){this.enabled=e,e&&this.activateOrbitControls()}activateOrbitControls(){const e=this.camera.controls;e.minDistance=1,e.maxDistance=300;const t=new F;e.getPosition(t);const i=t.length();e.distance=i,e.truckSpeed=2;const{rotation:n}=this.camera.three,r=new F(0,0,-1).applyEuler(n),o=t.addScaledVector(r,i);e.moveTo(o.x,o.y,o.z)}}class tE{constructor(e){A(this,"enabled",!1),A(this,"id","Plan"),A(this,"mouseAction1"),A(this,"mouseAction2"),A(this,"mouseInitialized",!1),A(this,"defaultAzimuthSpeed"),A(this,"defaultPolarSpeed"),this.camera=e,this.defaultAzimuthSpeed=e.controls.azimuthRotateSpeed,this.defaultPolarSpeed=e.controls.polarRotateSpeed}set(e){this.enabled=e;const t=this.camera.controls;t.azimuthRotateSpeed=e?0:this.defaultAzimuthSpeed,t.polarRotateSpeed=e?0:this.defaultPolarSpeed,this.mouseInitialized||(this.mouseAction1=t.touches.one,this.mouseAction2=t.touches.two,this.mouseInitialized=!0),e?(t.mouseButtons.left=Mt.ACTION.TRUCK,t.touches.one=Mt.ACTION.TOUCH_TRUCK,t.touches.two=Mt.ACTION.TOUCH_ZOOM):(t.mouseButtons.left=Mt.ACTION.ROTATE,t.touches.one=this.mouseAction1,t.touches.two=this.mouseAction2)}}class iE{constructor(e){A(this,"onChanged",new ee),A(this,"current","Perspective"),A(this,"camera"),A(this,"_component"),A(this,"_previousDistance",-1),A(this,"matchOrthoDistanceEnabled",!1),this._component=e,this.camera=e.three}async set(e){this.current!==e&&(e==="Orthographic"?this.setOrthoCamera():await this.setPerspectiveCamera(),this.onChanged.trigger(this.camera))}async toggle(){const e=this.current==="Perspective"?"Orthographic":"Perspective";await this.set(e)}setOrthoCamera(){if(this._component.mode===null||this._component.mode.id==="FirstPerson")return;this._previousDistance=this._component.controls.distance,this._component.controls.distance=200;const e=this.getPerspectiveDims();if(!e)return;const{width:t,height:i}=e;this.setupOrthoCamera(i,t),this.camera=this._component.threeOrtho,this.current="Orthographic"}getPerspectiveDims(){const e=this._component.currentWorld;if(!e||!e.renderer)return null;const t=new F;this._component.threePersp.getWorldDirection(t);const i=new F;this._component.controls.getTarget(i);const n=i.clone().sub(this._component.threePersp.position).dot(t),r=e.renderer.getSize(),o=r.x/r.y,a=this._component.threePersp,l=n*2*Math.atan(a.fov*(Math.PI/180)/2);return{width:l*o,height:l}}setupOrthoCamera(e,t){this._component.controls.mouseButtons.wheel=Mt.ACTION.ZOOM,this._component.controls.mouseButtons.middle=Mt.ACTION.ZOOM;const i=this._component.threePersp,n=this._component.threeOrtho;n.zoom=1,n.left=t/-2,n.right=t/2,n.top=e/2,n.bottom=e/-2,n.updateProjectionMatrix(),n.position.copy(i.position),n.quaternion.copy(i.quaternion),this._component.controls.camera=n}getDistance(){const e=this._component.threePersp,t=this._component.threeOrtho;return(t.top-t.bottom)/t.zoom/(2*Math.atan(e.fov*(Math.PI/180)/2))}async setPerspectiveCamera(){this._component.controls.mouseButtons.wheel=Mt.ACTION.DOLLY,this._component.controls.mouseButtons.middle=Mt.ACTION.DOLLY;const e=this._component.threePersp,t=this._component.threeOrtho;e.position.copy(t.position),e.quaternion.copy(t.quaternion),this._component.controls.mouseButtons.wheel=Mt.ACTION.DOLLY,this.matchOrthoDistanceEnabled?this._component.controls.distance=this.getDistance():this._component.controls.distance=this._previousDistance,await this._component.controls.zoomTo(1),e.updateProjectionMatrix(),this._component.controls.camera=e,this.camera=e,this.current="Perspective"}}class nE extends lh{constructor(e){super(e),A(this,"_mode",null),A(this,"projection"),A(this,"threeOrtho"),A(this,"threePersp"),A(this,"_userInputButtons",{}),A(this,"_frustumSize",50),A(this,"_navigationModes",new Map),A(this,"previousSize",null),this.threePersp=this.three,this.threeOrtho=this.newOrthoCamera(),this.projection=new iE(this),this.onAspectUpdated.add(()=>{this.setOrthoPerspCameraAspect()}),this.projection.onChanged.add(t=>{this.three=t,this.updateAspect()}),this.onWorldChanged.add(()=>{this._navigationModes.clear(),this._navigationModes.set("Orbit",new eE(this)),this._navigationModes.set("FirstPerson",new $1(this)),this._navigationModes.set("Plan",new tE(this)),this._mode=this._navigationModes.get("Orbit"),this.mode.set(!0,{preventTargetAdjustment:!0}),this.currentWorld&&this.currentWorld.renderer&&(this.previousSize=this.currentWorld.renderer.getSize().clone())})}get mode(){if(!this._mode)throw new Error("Mode not found, camera not initialized");return this._mode}dispose(){super.dispose(),this.threeOrtho.removeFromParent()}set(e){if(this.mode!==null&&this.mode.id!==e){if(this.mode.set(!1),!this._navigationModes.has(e))throw new Error("The specified mode does not exist!");this._mode=this._navigationModes.get(e),this.mode.set(!0)}}async fit(e,t=1.5){if(!this.enabled)return;const i=Number.MAX_VALUE,n=Number.MIN_VALUE,r=new F(i,i,i),o=new F(n,n,n);for(const f of e){const g=new Ke().setFromObject(f);g.min.xo.x&&(o.x=g.max.x),g.max.y>o.y&&(o.y=g.max.y),g.max.z>o.z&&(o.z=g.max.z)}const a=new Ke(r,o),l=new F;a.getSize(l);const h=new F;a.getCenter(h);const d=Math.max(l.x,l.y,l.z)*t,p=new Gn(h,d);await this.controls.fitToSphere(p,!0)}setUserInput(e){e?this.enableUserInput():this.disableUserInput()}disableUserInput(){this._userInputButtons.left=this.controls.mouseButtons.left,this._userInputButtons.right=this.controls.mouseButtons.right,this._userInputButtons.middle=this.controls.mouseButtons.middle,this._userInputButtons.wheel=this.controls.mouseButtons.wheel,this.controls.mouseButtons.left=0,this.controls.mouseButtons.right=0,this.controls.mouseButtons.middle=0,this.controls.mouseButtons.wheel=0}enableUserInput(){Object.keys(this._userInputButtons).length!==0&&(this.controls.mouseButtons.left=this._userInputButtons.left,this.controls.mouseButtons.right=this._userInputButtons.right,this.controls.mouseButtons.middle=this._userInputButtons.middle,this.controls.mouseButtons.wheel=this._userInputButtons.wheel)}newOrthoCamera(){const e=window.innerWidth/window.innerHeight;return new jn(this._frustumSize*e/-2,this._frustumSize*e/2,this._frustumSize/2,this._frustumSize/-2,.1,1e3)}setOrthoPerspCameraAspect(){if(!this.currentWorld||!this.currentWorld.renderer||!this.previousSize)return;const e=this.currentWorld.renderer.getSize(),t=this.threeOrtho.top,i=this.threeOrtho.right,n=e.y/this.previousSize.y,r=e.x/this.previousSize.x,o=t*n,a=i*r;this.threeOrtho.left=-a,this.threeOrtho.right=a,this.threeOrtho.top=o,this.threeOrtho.bottom=-o,this.threeOrtho.updateProjectionMatrix(),this.previousSize.copy(e)}}const tm=class xi extends Re{constructor(e){super(e),A(this,"enabled",!0),A(this,"onDisposed",new ee),A(this,"_absoluteMin"),A(this,"_absoluteMax"),A(this,"_meshes",[]),this.components.add(xi.uuid,this),this._absoluteMin=xi.newBound(!0),this._absoluteMax=xi.newBound(!1)}static getDimensions(e){const{min:t,max:i}=e,n=Math.abs(i.x-t.x),r=Math.abs(i.y-t.y),o=Math.abs(i.z-t.z),a=new F;return a.subVectors(i,t).divideScalar(2).add(t),{width:n,height:r,depth:o,center:a}}static newBound(e){const t=e?1:-1;return new F(t*Number.MAX_VALUE,t*Number.MAX_VALUE,t*Number.MAX_VALUE)}static getBounds(e,t,i){const n=i||this.newBound(!1),r=t||this.newBound(!0);for(const o of e)o.xn.x&&(n.x=o.x),o.y>n.y&&(n.y=o.y),o.z>n.z&&(n.z=o.z);return new Ke(t,i)}dispose(){const e=this.components.get(Oi);for(const t of this._meshes)e.destroy(t);this._meshes=[],this.onDisposed.trigger(xi.uuid),this.onDisposed.reset()}get(){const e=this._absoluteMin.clone(),t=this._absoluteMax.clone();return new Ke(e,t)}getSphere(){const e=this._absoluteMin.clone(),t=this._absoluteMax.clone(),i=Math.abs((t.x-e.x)/2),n=Math.abs((t.y-e.y)/2),r=Math.abs((t.z-e.z)/2),o=new F(e.x+i,e.y+n,e.z+r),a=o.distanceTo(e);return new Gn(o,a)}getMesh(){const e=new Ke(this._absoluteMin,this._absoluteMax),t=xi.getDimensions(e),{width:i,height:n,depth:r,center:o}=t,a=new ut(i,n,r),l=new le(a);return this._meshes.push(l),l.position.copy(o),l}reset(){this._absoluteMin=xi.newBound(!0),this._absoluteMax=xi.newBound(!1)}add(e){for(const t of e.items)this.addMesh(t.mesh)}addMesh(e,t){if(!e.geometry.index)return;const i=xi.getFragmentBounds(e);e.updateMatrixWorld();const n=e.matrixWorld,r=new Ee,o=e instanceof Kt,a=new Set;if(t&&e instanceof Ef)for(const l of t){const h=e.fragment.getInstancesIDs(l);if(h)for(const d of h)a.add(d)}else a.add(0);for(const l of a){const h=i.min.clone(),d=i.max.clone();o&&(e.getMatrixAt(l,r),h.applyMatrix4(r),d.applyMatrix4(r)),h.applyMatrix4(n),d.applyMatrix4(n),h.xthis._absoluteMax.x&&(this._absoluteMax.x=h.x),h.y>this._absoluteMax.y&&(this._absoluteMax.y=h.y),h.z>this._absoluteMax.z&&(this._absoluteMax.z=h.z),d.x>this._absoluteMax.x&&(this._absoluteMax.x=d.x),d.y>this._absoluteMax.y&&(this._absoluteMax.y=d.y),d.z>this._absoluteMax.z&&(this._absoluteMax.z=d.z),d.xo.x&&(o.x=d),p>o.y&&(o.y=p),f>o.z&&(o.z=f)}return new Ke(r,o)}};A(tm,"uuid","d1444724-dba6-4cdd-a0c7-68ee1450d166");let nu=tm;const su=new Set([1123145078,574549367,1675464909,2059837836,3798115385,32440307,3125803723,3207858831,2740243338,2624227202,4240577450,3615266464,3724593414,220341763,477187591,1878645084,1300840506,3303107099,1607154358,1878645084,846575682,1351298697,2417041796,3049322572,3331915920,1416205885,776857604,3285139300,3958052878,2827736869,2732653382,673634403,3448662350,4142052618,2924175390,803316827,2556980723,1809719519,2205249479,807026263,3737207727,1660063152,2347385850,3940055652,2705031697,3732776249,2485617015,2611217952,1704287377,2937912522,2770003689,1281925730,1484403080,3448662350,4142052618,3800577675,4006246654,3590301190,1383045692,2775532180,2047409740,370225590,3593883385,2665983363,4124623270,812098782,3649129432,987898635,1105321065,3510044353,1635779807,2603310189,3406155212,1310608509,4261334040,2736907675,3649129432,1136057603,1260505505,4182860854,2713105998,2898889636,59481748,3749851601,3486308946,3150382593,1062206242,3264961684,15328376,1485152156,370225590,1981873012,2859738748,45288368,2614616156,2732653382,775493141,2147822146,2601014836,2629017746,1186437898,2367409068,1213902940,3632507154,3900360178,476780140,1472233963,2804161546,3008276851,738692330,374418227,315944413,3905492369,3570813810,2571569899,178912537,2294589976,1437953363,2133299955,572779678,3092502836,388784114,2624227202,1425443689,3057273783,2347385850,1682466193,2519244187,2839578677,3958567839,2513912981,2830218821,427810014]),im=class nm extends Re{constructor(e){super(e),A(this,"enabled",!0),e.add(nm.uuid,this)}async export(e,t,i=!1,n=!0){const r={},o=new Set(e.GetIfcEntityList(t)),a=new Set([pl,Qh,Zh,dl,Wn]);for(const l of a)o.add(l);for(const l of o){if(su.has(l))continue;const h=a.has(l)&&n,d=e.GetLineIDsWithType(t,l);for(const p of d){const f=e.GetLine(0,p,h,i);r[f.expressID]=f}}return r}};A(im,"uuid","b32c4332-cd67-436e-ba7f-196646c7a635");let sE=im;const sm=class rm extends Re{constructor(e){super(e),A(this,"onDisposed",new ee),A(this,"onFragmentsLoaded",new ee),A(this,"onFragmentsDisposed",new ee),A(this,"list",new Map),A(this,"groups",new Map),A(this,"enabled",!0),A(this,"baseCoordinationModel",""),A(this,"_loader",new bf),this.components.add(rm.uuid,this)}get meshes(){const e=[];for(const[t,i]of this.list)e.push(i.mesh);return e}dispose(){for(const[e,t]of this.groups)t.dispose(!0);this.baseCoordinationModel="",this.groups.clear(),this.list.clear(),this.onFragmentsLoaded.reset(),this.onFragmentsDisposed.reset(),this.onDisposed.trigger(),this.onDisposed.reset()}disposeGroup(e){const{uuid:t}=e,i=[];for(const n of e.items)i.push(n.id),this.list.delete(n.id);e.dispose(!0),this.groups.delete(e.uuid),this.onFragmentsDisposed.trigger({groupID:t,fragmentIDs:i})}load(e,t){const i={coordinate:!0,...t},{coordinate:n,properties:r,relationsMap:o}=i,a=this._loader.import(e);for(const l of a.items)l.group=a,this.list.set(l.id,l);return n&&this.coordinate([a]),this.groups.set(a.uuid,a),r&&a.setLocalProperties(r),o&&this.components.get(ru).setRelationMap(a,o),this.onFragmentsLoaded.trigger(a),a}export(e){return this._loader.export(e)}coordinate(e=Array.from(this.groups.values())){if(this.baseCoordinationModel.length===0){const i=e.pop();if(!i)return;this.baseCoordinationModel=i.uuid}if(!e.length)return;const t=this.groups.get(this.baseCoordinationModel);if(!t){console.log("No base model found for coordination!");return}for(const i of e)i!==t&&(i.position.set(0,0,0),i.rotation.set(0,0,0),i.scale.set(1,1,1),i.updateMatrix(),i.applyMatrix4(i.coordinationMatrix.clone().invert()),i.applyMatrix4(t.coordinationMatrix))}};A(sm,"uuid","fef46874-46a3-461b-8c44-2922ab77c806");let rt=sm;const om={950732822:"IFCURIREFERENCE",4075327185:"IFCTIME",1209108979:"IFCTEMPERATURERATEOFCHANGEMEASURE",3457685358:"IFCSOUNDPRESSURELEVELMEASURE",4157543285:"IFCSOUNDPOWERLEVELMEASURE",2798247006:"IFCPROPERTYSETDEFINITIONSET",1790229001:"IFCPOSITIVEINTEGER",525895558:"IFCNONNEGATIVELENGTHMEASURE",1774176899:"IFCLINEINDEX",1275358634:"IFCLANGUAGEID",2541165894:"IFCDURATION",3701338814:"IFCDAYINWEEKNUMBER",2195413836:"IFCDATETIME",937566702:"IFCDATE",1683019596:"IFCCARDINALPOINTREFERENCE",2314439260:"IFCBINARY",1500781891:"IFCAREADENSITYMEASURE",3683503648:"IFCARCINDEX",4065007721:"IFCYEARNUMBER",1718600412:"IFCWARPINGMOMENTMEASURE",51269191:"IFCWARPINGCONSTANTMEASURE",2593997549:"IFCVOLUMETRICFLOWRATEMEASURE",3458127941:"IFCVOLUMEMEASURE",3345633955:"IFCVAPORPERMEABILITYMEASURE",1278329552:"IFCTORQUEMEASURE",2591213694:"IFCTIMESTAMP",2726807636:"IFCTIMEMEASURE",743184107:"IFCTHERMODYNAMICTEMPERATUREMEASURE",2016195849:"IFCTHERMALTRANSMITTANCEMEASURE",857959152:"IFCTHERMALRESISTANCEMEASURE",2281867870:"IFCTHERMALEXPANSIONCOEFFICIENTMEASURE",2645777649:"IFCTHERMALCONDUCTIVITYMEASURE",232962298:"IFCTHERMALADMITTANCEMEASURE",296282323:"IFCTEXTTRANSFORMATION",603696268:"IFCTEXTFONTNAME",3490877962:"IFCTEXTDECORATION",1460886941:"IFCTEXTALIGNMENT",2801250643:"IFCTEXT",58845555:"IFCTEMPERATUREGRADIENTMEASURE",361837227:"IFCSPECULARROUGHNESS",2757832317:"IFCSPECULAREXPONENT",3477203348:"IFCSPECIFICHEATCAPACITYMEASURE",993287707:"IFCSOUNDPRESSUREMEASURE",846465480:"IFCSOUNDPOWERMEASURE",3471399674:"IFCSOLIDANGLEMEASURE",408310005:"IFCSHEARMODULUSMEASURE",2190458107:"IFCSECTIONALAREAINTEGRALMEASURE",3467162246:"IFCSECTIONMODULUSMEASURE",2766185779:"IFCSECONDINMINUTE",3211557302:"IFCROTATIONALSTIFFNESSMEASURE",1755127002:"IFCROTATIONALMASSMEASURE",2133746277:"IFCROTATIONALFREQUENCYMEASURE",200335297:"IFCREAL",96294661:"IFCRATIOMEASURE",3972513137:"IFCRADIOACTIVITYMEASURE",3665567075:"IFCPRESSUREMEASURE",2169031380:"IFCPRESENTABLETEXT",1364037233:"IFCPOWERMEASURE",1245737093:"IFCPOSITIVERATIOMEASURE",3054510233:"IFCPOSITIVEPLANEANGLEMEASURE",2815919920:"IFCPOSITIVELENGTHMEASURE",4042175685:"IFCPLANEANGLEMEASURE",2642773653:"IFCPLANARFORCEMEASURE",2260317790:"IFCPARAMETERVALUE",929793134:"IFCPHMEASURE",2395907400:"IFCNUMERICMEASURE",2095195183:"IFCNORMALISEDRATIOMEASURE",765770214:"IFCMONTHINYEARNUMBER",2615040989:"IFCMONETARYMEASURE",3114022597:"IFCMOMENTOFINERTIAMEASURE",1648970520:"IFCMOLECULARWEIGHTMEASURE",3177669450:"IFCMOISTUREDIFFUSIVITYMEASURE",1753493141:"IFCMODULUSOFSUBGRADEREACTIONMEASURE",1052454078:"IFCMODULUSOFROTATIONALSUBGRADEREACTIONMEASURE",2173214787:"IFCMODULUSOFLINEARSUBGRADEREACTIONMEASURE",3341486342:"IFCMODULUSOFELASTICITYMEASURE",102610177:"IFCMINUTEINHOUR",3531705166:"IFCMASSPERLENGTHMEASURE",3124614049:"IFCMASSMEASURE",4017473158:"IFCMASSFLOWRATEMEASURE",1477762836:"IFCMASSDENSITYMEASURE",2486716878:"IFCMAGNETICFLUXMEASURE",286949696:"IFCMAGNETICFLUXDENSITYMEASURE",151039812:"IFCLUMINOUSINTENSITYMEASURE",2755797622:"IFCLUMINOUSINTENSITYDISTRIBUTIONMEASURE",2095003142:"IFCLUMINOUSFLUXMEASURE",503418787:"IFCLOGICAL",3086160713:"IFCLINEARVELOCITYMEASURE",1307019551:"IFCLINEARSTIFFNESSMEASURE",2128979029:"IFCLINEARMOMENTMEASURE",191860431:"IFCLINEARFORCEMEASURE",1243674935:"IFCLENGTHMEASURE",3258342251:"IFCLABEL",2054016361:"IFCKINEMATICVISCOSITYMEASURE",3192672207:"IFCISOTHERMALMOISTURECAPACITYMEASURE",3686016028:"IFCIONCONCENTRATIONMEASURE",3809634241:"IFCINTEGERCOUNTRATEMEASURE",1939436016:"IFCINTEGER",2679005408:"IFCINDUCTANCEMEASURE",3358199106:"IFCILLUMINANCEMEASURE",983778844:"IFCIDENTIFIER",2589826445:"IFCHOURINDAY",1158859006:"IFCHEATINGVALUEMEASURE",3113092358:"IFCHEATFLUXDENSITYMEASURE",3064340077:"IFCGLOBALLYUNIQUEID",3044325142:"IFCFREQUENCYMEASURE",1361398929:"IFCFORCEMEASURE",2590844177:"IFCFONTWEIGHT",2715512545:"IFCFONTVARIANT",1102727119:"IFCFONTSTYLE",2078135608:"IFCENERGYMEASURE",2506197118:"IFCELECTRICVOLTAGEMEASURE",2951915441:"IFCELECTRICRESISTANCEMEASURE",3790457270:"IFCELECTRICCURRENTMEASURE",2093906313:"IFCELECTRICCONDUCTANCEMEASURE",3818826038:"IFCELECTRICCHARGEMEASURE",1827137117:"IFCELECTRICCAPACITANCEMEASURE",69416015:"IFCDYNAMICVISCOSITYMEASURE",524656162:"IFCDOSEEQUIVALENTMEASURE",4134073009:"IFCDIMENSIONCOUNT",1514641115:"IFCDESCRIPTIVEMEASURE",300323983:"IFCDAYLIGHTSAVINGHOUR",86635668:"IFCDAYINMONTHNUMBER",94842927:"IFCCURVATUREMEASURE",1778710042:"IFCCOUNTMEASURE",3238673880:"IFCCONTEXTDEPENDENTMEASURE",3812528620:"IFCCOMPOUNDPLANEANGLEMEASURE",2991860651:"IFCCOMPLEXNUMBER",1867003952:"IFCBOXALIGNMENT",2735952531:"IFCBOOLEAN",2650437152:"IFCAREAMEASURE",632304761:"IFCANGULARVELOCITYMEASURE",360377573:"IFCAMOUNTOFSUBSTANCEMEASURE",4182062534:"IFCACCELERATIONMEASURE",3699917729:"IFCABSORBEDDOSEMEASURE",1971632696:"IFCGEOSLICE",2680139844:"IFCGEOMODEL",24726584:"IFCELECTRICFLOWTREATMENTDEVICE",3693000487:"IFCDISTRIBUTIONBOARD",3460952963:"IFCCONVEYORSEGMENT",3999819293:"IFCCAISSONFOUNDATION",3314249567:"IFCBOREHOLE",4196446775:"IFCBEARING",325726236:"IFCALIGNMENT",3425753595:"IFCTRACKELEMENT",991950508:"IFCSIGNAL",3798194928:"IFCREINFORCEDSOIL",3290496277:"IFCRAIL",1383356374:"IFCPAVEMENT",2182337498:"IFCNAVIGATIONELEMENT",234836483:"IFCMOORINGDEVICE",2078563270:"IFCMOBILETELECOMMUNICATIONSAPPLIANCE",1638804497:"IFCLIQUIDTERMINAL",1154579445:"IFCLINEARPOSITIONINGELEMENT",2696325953:"IFCKERB",2713699986:"IFCGEOTECHNICALASSEMBLY",2142170206:"IFCELECTRICFLOWTREATMENTDEVICETYPE",3376911765:"IFCEARTHWORKSFILL",1077100507:"IFCEARTHWORKSELEMENT",3071239417:"IFCEARTHWORKSCUT",479945903:"IFCDISTRIBUTIONBOARDTYPE",3426335179:"IFCDEEPFOUNDATION",1502416096:"IFCCOURSE",2940368186:"IFCCONVEYORSEGMENTTYPE",3203706013:"IFCCAISSONFOUNDATIONTYPE",3862327254:"IFCBUILTSYSTEM",1876633798:"IFCBUILTELEMENT",963979645:"IFCBRIDGEPART",644574406:"IFCBRIDGE",3649138523:"IFCBEARINGTYPE",1662888072:"IFCALIGNMENTVERTICAL",317615605:"IFCALIGNMENTSEGMENT",1545765605:"IFCALIGNMENTHORIZONTAL",4266260250:"IFCALIGNMENTCANT",3956297820:"IFCVIBRATIONDAMPERTYPE",1530820697:"IFCVIBRATIONDAMPER",840318589:"IFCVEHICLE",1953115116:"IFCTRANSPORTATIONDEVICE",618700268:"IFCTRACKELEMENTTYPE",2281632017:"IFCTENDONCONDUITTYPE",3663046924:"IFCTENDONCONDUIT",42703149:"IFCSINESPIRAL",1894708472:"IFCSIGNALTYPE",3599934289:"IFCSIGNTYPE",33720170:"IFCSIGN",1027922057:"IFCSEVENTHORDERPOLYNOMIALSPIRAL",544395925:"IFCSEGMENTEDREFERENCECURVE",3649235739:"IFCSECONDORDERPOLYNOMIALSPIRAL",550521510:"IFCROADPART",146592293:"IFCROAD",3818125796:"IFCRELADHERESTOELEMENT",4021432810:"IFCREFERENT",1891881377:"IFCRAILWAYPART",3992365140:"IFCRAILWAY",1763565496:"IFCRAILTYPE",1946335990:"IFCPOSITIONINGELEMENT",514975943:"IFCPAVEMENTTYPE",506776471:"IFCNAVIGATIONELEMENTTYPE",710110818:"IFCMOORINGDEVICETYPE",1950438474:"IFCMOBILETELECOMMUNICATIONSAPPLIANCETYPE",976884017:"IFCMARINEPART",525669439:"IFCMARINEFACILITY",1770583370:"IFCLIQUIDTERMINALTYPE",2176059722:"IFCLINEARELEMENT",679976338:"IFCKERBTYPE",3948183225:"IFCIMPACTPROTECTIONDEVICETYPE",2568555532:"IFCIMPACTPROTECTIONDEVICE",2898700619:"IFCGRADIENTCURVE",1594536857:"IFCGEOTECHNICALSTRATUM",4230923436:"IFCGEOTECHNICALELEMENT",4228831410:"IFCFACILITYPARTCOMMON",1310830890:"IFCFACILITYPART",24185140:"IFCFACILITY",4234616927:"IFCDIRECTRIXDERIVEDREFERENCESWEPTAREASOLID",1306400036:"IFCDEEPFOUNDATIONTYPE",4189326743:"IFCCOURSETYPE",2000195564:"IFCCOSINESPIRAL",3497074424:"IFCCLOTHOID",1626504194:"IFCBUILTELEMENTTYPE",3651464721:"IFCVEHICLETYPE",1229763772:"IFCTRIANGULATEDIRREGULARNETWORK",3665877780:"IFCTRANSPORTATIONDEVICETYPE",782932809:"IFCTHIRDORDERPOLYNOMIALSPIRAL",2735484536:"IFCSPIRAL",1356537516:"IFCSECTIONEDSURFACE",1290935644:"IFCSECTIONEDSOLIDHORIZONTAL",1862484736:"IFCSECTIONEDSOLID",1441486842:"IFCRELPOSITIONS",1033248425:"IFCRELASSOCIATESPROFILEDEF",3381221214:"IFCPOLYNOMIALCURVE",2485787929:"IFCOFFSETCURVEBYDISTANCES",590820931:"IFCOFFSETCURVE",3465909080:"IFCINDEXEDPOLYGONALTEXTUREMAP",593015953:"IFCDIRECTRIXCURVESWEPTAREASOLID",4212018352:"IFCCURVESEGMENT",3425423356:"IFCAXIS2PLACEMENTLINEAR",823603102:"IFCSEGMENT",2165702409:"IFCPOINTBYDISTANCEEXPRESSION",182550632:"IFCOPENCROSSPROFILEDEF",388784114:"IFCLINEARPLACEMENT",536804194:"IFCALIGNMENTHORIZONTALSEGMENT",3752311538:"IFCALIGNMENTCANTSEGMENT",1010789467:"IFCTEXTURECOORDINATEINDICESWITHVOIDS",222769930:"IFCTEXTURECOORDINATEINDICES",2691318326:"IFCQUANTITYNUMBER",3633395639:"IFCALIGNMENTVERTICALSEGMENT",2879124712:"IFCALIGNMENTPARAMETERSEGMENT",25142252:"IFCCONTROLLER",3087945054:"IFCALARM",4288193352:"IFCACTUATOR",630975310:"IFCUNITARYCONTROLELEMENT",4086658281:"IFCSENSOR",2295281155:"IFCPROTECTIVEDEVICETRIPPINGUNIT",182646315:"IFCFLOWINSTRUMENT",1426591983:"IFCFIRESUPPRESSIONTERMINAL",819412036:"IFCFILTER",3415622556:"IFCFAN",1003880860:"IFCELECTRICTIMECONTROL",402227799:"IFCELECTRICMOTOR",264262732:"IFCELECTRICGENERATOR",3310460725:"IFCELECTRICFLOWSTORAGEDEVICE",862014818:"IFCELECTRICDISTRIBUTIONBOARD",1904799276:"IFCELECTRICAPPLIANCE",1360408905:"IFCDUCTSILENCER",3518393246:"IFCDUCTSEGMENT",342316401:"IFCDUCTFITTING",562808652:"IFCDISTRIBUTIONCIRCUIT",4074379575:"IFCDAMPER",3640358203:"IFCCOOLINGTOWER",4136498852:"IFCCOOLEDBEAM",2272882330:"IFCCONDENSER",3571504051:"IFCCOMPRESSOR",3221913625:"IFCCOMMUNICATIONSAPPLIANCE",639361253:"IFCCOIL",3902619387:"IFCCHILLER",4217484030:"IFCCABLESEGMENT",1051757585:"IFCCABLEFITTING",3758799889:"IFCCABLECARRIERSEGMENT",635142910:"IFCCABLECARRIERFITTING",2938176219:"IFCBURNER",32344328:"IFCBOILER",2906023776:"IFCBEAMSTANDARDCASE",277319702:"IFCAUDIOVISUALAPPLIANCE",2056796094:"IFCAIRTOAIRHEATRECOVERY",177149247:"IFCAIRTERMINALBOX",1634111441:"IFCAIRTERMINAL",486154966:"IFCWINDOWSTANDARDCASE",4237592921:"IFCWASTETERMINAL",4156078855:"IFCWALLELEMENTEDCASE",4207607924:"IFCVALVE",4292641817:"IFCUNITARYEQUIPMENT",3179687236:"IFCUNITARYCONTROLELEMENTTYPE",3026737570:"IFCTUBEBUNDLE",3825984169:"IFCTRANSFORMER",812556717:"IFCTANK",1162798199:"IFCSWITCHINGDEVICE",385403989:"IFCSTRUCTURALLOADCASE",1404847402:"IFCSTACKTERMINAL",1999602285:"IFCSPACEHEATER",3420628829:"IFCSOLARDEVICE",3027962421:"IFCSLABSTANDARDCASE",3127900445:"IFCSLABELEMENTEDCASE",1329646415:"IFCSHADINGDEVICE",3053780830:"IFCSANITARYTERMINAL",2572171363:"IFCREINFORCINGBARTYPE",1232101972:"IFCRATIONALBSPLINECURVEWITHKNOTS",90941305:"IFCPUMP",655969474:"IFCPROTECTIVEDEVICETRIPPINGUNITTYPE",738039164:"IFCPROTECTIVEDEVICE",1156407060:"IFCPLATESTANDARDCASE",3612865200:"IFCPIPESEGMENT",310824031:"IFCPIPEFITTING",3694346114:"IFCOUTLET",144952367:"IFCOUTERBOUNDARYCURVE",2474470126:"IFCMOTORCONNECTION",1911478936:"IFCMEMBERSTANDARDCASE",1437502449:"IFCMEDICALDEVICE",629592764:"IFCLIGHTFIXTURE",76236018:"IFCLAMP",2176052936:"IFCJUNCTIONBOX",4175244083:"IFCINTERCEPTOR",2068733104:"IFCHUMIDIFIER",3319311131:"IFCHEATEXCHANGER",2188021234:"IFCFLOWMETER",1209101575:"IFCEXTERNALSPATIALELEMENT",484807127:"IFCEVAPORATOR",3747195512:"IFCEVAPORATIVECOOLER",2814081492:"IFCENGINE",2417008758:"IFCELECTRICDISTRIBUTIONBOARDTYPE",3242481149:"IFCDOORSTANDARDCASE",3205830791:"IFCDISTRIBUTIONSYSTEM",400855858:"IFCCOMMUNICATIONSAPPLIANCETYPE",905975707:"IFCCOLUMNSTANDARDCASE",1677625105:"IFCCIVILELEMENT",3296154744:"IFCCHIMNEY",2674252688:"IFCCABLEFITTINGTYPE",2188180465:"IFCBURNERTYPE",1177604601:"IFCBUILDINGSYSTEM",39481116:"IFCBUILDINGELEMENTPARTTYPE",1136057603:"IFCBOUNDARYCURVE",2461110595:"IFCBSPLINECURVEWITHKNOTS",1532957894:"IFCAUDIOVISUALAPPLIANCETYPE",4088093105:"IFCWORKCALENDAR",4009809668:"IFCWINDOWTYPE",926996030:"IFCVOIDINGFEATURE",2391383451:"IFCVIBRATIONISOLATOR",2415094496:"IFCTENDONTYPE",3081323446:"IFCTENDONANCHORTYPE",413509423:"IFCSYSTEMFURNITUREELEMENT",3101698114:"IFCSURFACEFEATURE",3657597509:"IFCSTRUCTURALSURFACEACTION",2757150158:"IFCSTRUCTURALCURVEREACTION",1004757350:"IFCSTRUCTURALCURVEACTION",338393293:"IFCSTAIRTYPE",1072016465:"IFCSOLARDEVICETYPE",4074543187:"IFCSHADINGDEVICETYPE",2157484638:"IFCSEAMCURVE",2781568857:"IFCROOFTYPE",2310774935:"IFCREINFORCINGMESHTYPE",964333572:"IFCREINFORCINGELEMENTTYPE",683857671:"IFCRATIONALBSPLINESURFACEWITHKNOTS",1469900589:"IFCRAMPTYPE",2839578677:"IFCPOLYGONALFACESET",1158309216:"IFCPILETYPE",3079942009:"IFCOPENINGSTANDARDCASE",1114901282:"IFCMEDICALDEVICETYPE",3113134337:"IFCINTERSECTIONCURVE",3946677679:"IFCINTERCEPTORTYPE",2571569899:"IFCINDEXEDPOLYCURVE",3493046030:"IFCGEOGRAPHICELEMENT",1509553395:"IFCFURNITURE",1893162501:"IFCFOOTINGTYPE",2853485674:"IFCEXTERNALSPATIALSTRUCTUREELEMENT",4148101412:"IFCEVENT",132023988:"IFCENGINETYPE",2397081782:"IFCELEMENTASSEMBLYTYPE",2323601079:"IFCDOORTYPE",1213902940:"IFCCYLINDRICALSURFACE",1525564444:"IFCCONSTRUCTIONPRODUCTRESOURCETYPE",4105962743:"IFCCONSTRUCTIONMATERIALRESOURCETYPE",2185764099:"IFCCONSTRUCTIONEQUIPMENTRESOURCETYPE",15328376:"IFCCOMPOSITECURVEONSURFACE",3875453745:"IFCCOMPLEXPROPERTYTEMPLATE",3893394355:"IFCCIVILELEMENTTYPE",2197970202:"IFCCHIMNEYTYPE",167062518:"IFCBSPLINESURFACEWITHKNOTS",2887950389:"IFCBSPLINESURFACE",2603310189:"IFCADVANCEDBREPWITHVOIDS",1635779807:"IFCADVANCEDBREP",2916149573:"IFCTRIANGULATEDFACESET",1935646853:"IFCTOROIDALSURFACE",2387106220:"IFCTESSELLATEDFACESET",3206491090:"IFCTASKTYPE",699246055:"IFCSURFACECURVE",4095615324:"IFCSUBCONTRACTRESOURCETYPE",603775116:"IFCSTRUCTURALSURFACEREACTION",4015995234:"IFCSPHERICALSURFACE",2481509218:"IFCSPATIALZONETYPE",463610769:"IFCSPATIALZONE",710998568:"IFCSPATIALELEMENTTYPE",1412071761:"IFCSPATIALELEMENT",3663146110:"IFCSIMPLEPROPERTYTEMPLATE",3243963512:"IFCREVOLVEDAREASOLIDTAPERED",816062949:"IFCREPARAMETRISEDCOMPOSITECURVESEGMENT",1521410863:"IFCRELSPACEBOUNDARY2NDLEVEL",3523091289:"IFCRELSPACEBOUNDARY1STLEVEL",427948657:"IFCRELINTERFERESELEMENTS",307848117:"IFCRELDEFINESBYTEMPLATE",1462361463:"IFCRELDEFINESBYOBJECT",2565941209:"IFCRELDECLARES",1027710054:"IFCRELASSIGNSTOGROUPBYFACTOR",3521284610:"IFCPROPERTYTEMPLATE",492091185:"IFCPROPERTYSETTEMPLATE",653396225:"IFCPROJECTLIBRARY",569719735:"IFCPROCEDURETYPE",3967405729:"IFCPREDEFINEDPROPERTYSET",1682466193:"IFCPCURVE",428585644:"IFCLABORRESOURCETYPE",2294589976:"IFCINDEXEDPOLYGONALFACEWITHVOIDS",178912537:"IFCINDEXEDPOLYGONALFACE",4095422895:"IFCGEOGRAPHICELEMENTTYPE",2652556860:"IFCFIXEDREFERENCESWEPTAREASOLID",2804161546:"IFCEXTRUDEDAREASOLIDTAPERED",4024345920:"IFCEVENTTYPE",2629017746:"IFCCURVEBOUNDEDSURFACE",1815067380:"IFCCREWRESOURCETYPE",3419103109:"IFCCONTEXT",2574617495:"IFCCONSTRUCTIONRESOURCETYPE",2059837836:"IFCCARTESIANPOINTLIST3D",1675464909:"IFCCARTESIANPOINTLIST2D",574549367:"IFCCARTESIANPOINTLIST",3406155212:"IFCADVANCEDFACE",3698973494:"IFCTYPERESOURCE",3736923433:"IFCTYPEPROCESS",901063453:"IFCTESSELLATEDITEM",1096409881:"IFCSWEPTDISKSOLIDPOLYGONAL",1042787934:"IFCRESOURCETIME",1608871552:"IFCRESOURCECONSTRAINTRELATIONSHIP",2943643501:"IFCRESOURCEAPPROVALRELATIONSHIP",2090586900:"IFCQUANTITYSET",1482703590:"IFCPROPERTYTEMPLATEDEFINITION",3778827333:"IFCPREDEFINEDPROPERTIES",2998442950:"IFCMIRROREDPROFILEDEF",853536259:"IFCMATERIALRELATIONSHIP",3404854881:"IFCMATERIALPROFILESETUSAGETAPERING",3079605661:"IFCMATERIALPROFILESETUSAGE",2852063980:"IFCMATERIALCONSTITUENTSET",3708119e3:"IFCMATERIALCONSTITUENT",1585845231:"IFCLAGTIME",2133299955:"IFCINDEXEDTRIANGLETEXTUREMAP",1437953363:"IFCINDEXEDTEXTUREMAP",3570813810:"IFCINDEXEDCOLOURMAP",1437805879:"IFCEXTERNALREFERENCERELATIONSHIP",297599258:"IFCEXTENDEDPROPERTIES",211053100:"IFCEVENTTIME",2713554722:"IFCCONVERSIONBASEDUNITWITHOFFSET",3285139300:"IFCCOLOURRGBLIST",1236880293:"IFCWORKTIME",1199560280:"IFCTIMEPERIOD",3611470254:"IFCTEXTUREVERTEXLIST",2771591690:"IFCTASKTIMERECURRING",1549132990:"IFCTASKTIME",2043862942:"IFCTABLECOLUMN",2934153892:"IFCSURFACEREINFORCEMENTAREA",609421318:"IFCSTRUCTURALLOADORRESULT",3478079324:"IFCSTRUCTURALLOADCONFIGURATION",1054537805:"IFCSCHEDULINGTIME",2439245199:"IFCRESOURCELEVELRELATIONSHIP",2433181523:"IFCREFERENCE",3915482550:"IFCRECURRENCEPATTERN",986844984:"IFCPROPERTYABSTRACTION",3843373140:"IFCPROJECTEDCRS",677532197:"IFCPRESENTATIONITEM",1507914824:"IFCMATERIALUSAGEDEFINITION",552965576:"IFCMATERIALPROFILEWITHOFFSETS",164193824:"IFCMATERIALPROFILESET",2235152071:"IFCMATERIALPROFILE",1847252529:"IFCMATERIALLAYERWITHOFFSETS",760658860:"IFCMATERIALDEFINITION",3057273783:"IFCMAPCONVERSION",4294318154:"IFCEXTERNALINFORMATION",1466758467:"IFCCOORDINATEREFERENCESYSTEM",1785450214:"IFCCOORDINATEOPERATION",775493141:"IFCCONNECTIONVOLUMEGEOMETRY",979691226:"IFCREINFORCINGBAR",3700593921:"IFCELECTRICDISTRIBUTIONPOINT",1062813311:"IFCDISTRIBUTIONCONTROLELEMENT",1052013943:"IFCDISTRIBUTIONCHAMBERELEMENT",578613899:"IFCCONTROLLERTYPE",2454782716:"IFCCHAMFEREDGEFEATURE",753842376:"IFCBEAM",3001207471:"IFCALARMTYPE",2874132201:"IFCACTUATORTYPE",3304561284:"IFCWINDOW",3512223829:"IFCWALLSTANDARDCASE",2391406946:"IFCWALL",3313531582:"IFCVIBRATIONISOLATORTYPE",2347447852:"IFCTENDONANCHOR",3824725483:"IFCTENDON",2515109513:"IFCSTRUCTURALANALYSISMODEL",4252922144:"IFCSTAIRFLIGHT",331165859:"IFCSTAIR",1529196076:"IFCSLAB",1783015770:"IFCSENSORTYPE",1376911519:"IFCROUNDEDEDGEFEATURE",2016517767:"IFCROOF",2320036040:"IFCREINFORCINGMESH",3027567501:"IFCREINFORCINGELEMENT",3055160366:"IFCRATIONALBEZIERCURVE",3283111854:"IFCRAMPFLIGHT",3024970846:"IFCRAMP",2262370178:"IFCRAILING",3171933400:"IFCPLATE",1687234759:"IFCPILE",1073191201:"IFCMEMBER",900683007:"IFCFOOTING",3508470533:"IFCFLOWTREATMENTDEVICE",2223149337:"IFCFLOWTERMINAL",707683696:"IFCFLOWSTORAGEDEVICE",987401354:"IFCFLOWSEGMENT",3132237377:"IFCFLOWMOVINGDEVICE",4037862832:"IFCFLOWINSTRUMENTTYPE",4278956645:"IFCFLOWFITTING",2058353004:"IFCFLOWCONTROLLER",4222183408:"IFCFIRESUPPRESSIONTERMINALTYPE",1810631287:"IFCFILTERTYPE",346874300:"IFCFANTYPE",1658829314:"IFCENERGYCONVERSIONDEVICE",857184966:"IFCELECTRICALELEMENT",1634875225:"IFCELECTRICALCIRCUIT",712377611:"IFCELECTRICTIMECONTROLTYPE",1217240411:"IFCELECTRICMOTORTYPE",1365060375:"IFCELECTRICHEATERTYPE",1534661035:"IFCELECTRICGENERATORTYPE",3277789161:"IFCELECTRICFLOWSTORAGEDEVICETYPE",663422040:"IFCELECTRICAPPLIANCETYPE",855621170:"IFCEDGEFEATURE",2030761528:"IFCDUCTSILENCERTYPE",3760055223:"IFCDUCTSEGMENTTYPE",869906466:"IFCDUCTFITTINGTYPE",395920057:"IFCDOOR",3041715199:"IFCDISTRIBUTIONPORT",3040386961:"IFCDISTRIBUTIONFLOWELEMENT",1945004755:"IFCDISTRIBUTIONELEMENT",2063403501:"IFCDISTRIBUTIONCONTROLELEMENTTYPE",1599208980:"IFCDISTRIBUTIONCHAMBERELEMENTTYPE",2635815018:"IFCDISCRETEACCESSORYTYPE",1335981549:"IFCDISCRETEACCESSORY",4147604152:"IFCDIAMETERDIMENSION",3961806047:"IFCDAMPERTYPE",3495092785:"IFCCURTAINWALL",1973544240:"IFCCOVERING",2954562838:"IFCCOOLINGTOWERTYPE",335055490:"IFCCOOLEDBEAMTYPE",488727124:"IFCCONSTRUCTIONPRODUCTRESOURCE",1060000209:"IFCCONSTRUCTIONMATERIALRESOURCE",3898045240:"IFCCONSTRUCTIONEQUIPMENTRESOURCE",1163958913:"IFCCONDITIONCRITERION",2188551683:"IFCCONDITION",2816379211:"IFCCONDENSERTYPE",3850581409:"IFCCOMPRESSORTYPE",843113511:"IFCCOLUMN",2301859152:"IFCCOILTYPE",2611217952:"IFCCIRCLE",2951183804:"IFCCHILLERTYPE",1285652485:"IFCCABLESEGMENTTYPE",3293546465:"IFCCABLECARRIERSEGMENTTYPE",395041908:"IFCCABLECARRIERFITTINGTYPE",1909888760:"IFCBUILDINGELEMENTPROXYTYPE",1095909175:"IFCBUILDINGELEMENTPROXY",2979338954:"IFCBUILDINGELEMENTPART",52481810:"IFCBUILDINGELEMENTCOMPONENT",3299480353:"IFCBUILDINGELEMENT",231477066:"IFCBOILERTYPE",1916977116:"IFCBEZIERCURVE",819618141:"IFCBEAMTYPE",1967976161:"IFCBSPLINECURVE",3460190687:"IFCASSET",2470393545:"IFCANGULARDIMENSION",1871374353:"IFCAIRTOAIRHEATRECOVERYTYPE",3352864051:"IFCAIRTERMINALTYPE",1411407467:"IFCAIRTERMINALBOXTYPE",3821786052:"IFCACTIONREQUEST",1213861670:"IFC2DCOMPOSITECURVE",1033361043:"IFCZONE",3342526732:"IFCWORKSCHEDULE",4218914973:"IFCWORKPLAN",1028945134:"IFCWORKCONTROL",1133259667:"IFCWASTETERMINALTYPE",1898987631:"IFCWALLTYPE",2769231204:"IFCVIRTUALELEMENT",728799441:"IFCVALVETYPE",1911125066:"IFCUNITARYEQUIPMENTTYPE",1600972822:"IFCTUBEBUNDLETYPE",3593883385:"IFCTRIMMEDCURVE",1620046519:"IFCTRANSPORTELEMENT",1692211062:"IFCTRANSFORMERTYPE",1637806684:"IFCTIMESERIESSCHEDULE",5716631:"IFCTANKTYPE",2254336722:"IFCSYSTEM",2315554128:"IFCSWITCHINGDEVICETYPE",148013059:"IFCSUBCONTRACTRESOURCE",1975003073:"IFCSTRUCTURALSURFACECONNECTION",2986769608:"IFCSTRUCTURALRESULTGROUP",1235345126:"IFCSTRUCTURALPOINTREACTION",734778138:"IFCSTRUCTURALPOINTCONNECTION",2082059205:"IFCSTRUCTURALPOINTACTION",3987759626:"IFCSTRUCTURALPLANARACTIONVARYING",1621171031:"IFCSTRUCTURALPLANARACTION",1252848954:"IFCSTRUCTURALLOADGROUP",1721250024:"IFCSTRUCTURALLINEARACTIONVARYING",1807405624:"IFCSTRUCTURALLINEARACTION",2445595289:"IFCSTRUCTURALCURVEMEMBERVARYING",214636428:"IFCSTRUCTURALCURVEMEMBER",4243806635:"IFCSTRUCTURALCURVECONNECTION",1179482911:"IFCSTRUCTURALCONNECTION",682877961:"IFCSTRUCTURALACTION",1039846685:"IFCSTAIRFLIGHTTYPE",3112655638:"IFCSTACKTERMINALTYPE",3812236995:"IFCSPACETYPE",652456506:"IFCSPACEPROGRAM",1305183839:"IFCSPACEHEATERTYPE",3856911033:"IFCSPACE",2533589738:"IFCSLABTYPE",4097777520:"IFCSITE",4105383287:"IFCSERVICELIFE",3517283431:"IFCSCHEDULETIMECONTROL",1768891740:"IFCSANITARYTERMINALTYPE",2863920197:"IFCRELASSIGNSTASKS",160246688:"IFCRELAGGREGATES",2324767716:"IFCRAMPFLIGHTTYPE",2893384427:"IFCRAILINGTYPE",3248260540:"IFCRADIUSDIMENSION",2250791053:"IFCPUMPTYPE",1842657554:"IFCPROTECTIVEDEVICETYPE",3651124850:"IFCPROJECTIONELEMENT",3642467123:"IFCPROJECTORDERRECORD",2904328755:"IFCPROJECTORDER",2744685151:"IFCPROCEDURE",3740093272:"IFCPORT",3724593414:"IFCPOLYLINE",4017108033:"IFCPLATETYPE",4231323485:"IFCPIPESEGMENTTYPE",804291784:"IFCPIPEFITTINGTYPE",3327091369:"IFCPERMIT",2382730787:"IFCPERFORMANCEHISTORY",2837617999:"IFCOUTLETTYPE",3425660407:"IFCORDERACTION",3588315303:"IFCOPENINGELEMENT",4143007308:"IFCOCCUPANT",1916936684:"IFCMOVE",977012517:"IFCMOTORCONNECTIONTYPE",3181161470:"IFCMEMBERTYPE",2108223431:"IFCMECHANICALFASTENERTYPE",377706215:"IFCMECHANICALFASTENER",2506943328:"IFCLINEARDIMENSION",1161773419:"IFCLIGHTFIXTURETYPE",1051575348:"IFCLAMPTYPE",3827777499:"IFCLABORRESOURCE",4288270099:"IFCJUNCTIONBOXTYPE",2391368822:"IFCINVENTORY",1806887404:"IFCHUMIDIFIERTYPE",1251058090:"IFCHEATEXCHANGERTYPE",2706460486:"IFCGROUP",3009204131:"IFCGRID",200128114:"IFCGASTERMINALTYPE",814719939:"IFCFURNITURESTANDARD",263784265:"IFCFURNISHINGELEMENT",3009222698:"IFCFLOWTREATMENTDEVICETYPE",2297155007:"IFCFLOWTERMINALTYPE",1339347760:"IFCFLOWSTORAGEDEVICETYPE",1834744321:"IFCFLOWSEGMENTTYPE",1482959167:"IFCFLOWMOVINGDEVICETYPE",3815607619:"IFCFLOWMETERTYPE",3198132628:"IFCFLOWFITTINGTYPE",3907093117:"IFCFLOWCONTROLLERTYPE",1287392070:"IFCFEATUREELEMENTSUBTRACTION",2143335405:"IFCFEATUREELEMENTADDITION",2827207264:"IFCFEATUREELEMENT",2489546625:"IFCFASTENERTYPE",647756555:"IFCFASTENER",3737207727:"IFCFACETEDBREPWITHVOIDS",807026263:"IFCFACETEDBREP",3390157468:"IFCEVAPORATORTYPE",3174744832:"IFCEVAPORATIVECOOLERTYPE",3272907226:"IFCEQUIPMENTSTANDARD",1962604670:"IFCEQUIPMENTELEMENT",2107101300:"IFCENERGYCONVERSIONDEVICETYPE",1704287377:"IFCELLIPSE",2590856083:"IFCELEMENTCOMPONENTTYPE",1623761950:"IFCELEMENTCOMPONENT",4123344466:"IFCELEMENTASSEMBLY",1758889154:"IFCELEMENT",360485395:"IFCELECTRICALBASEPROPERTIES",3849074793:"IFCDISTRIBUTIONFLOWELEMENTTYPE",3256556792:"IFCDISTRIBUTIONELEMENTTYPE",681481545:"IFCDIMENSIONCURVEDIRECTEDCALLOUT",1457835157:"IFCCURTAINWALLTYPE",3295246426:"IFCCREWRESOURCE",1916426348:"IFCCOVERINGTYPE",1419761937:"IFCCOSTSCHEDULE",3895139033:"IFCCOSTITEM",3293443760:"IFCCONTROL",2559216714:"IFCCONSTRUCTIONRESOURCE",2510884976:"IFCCONIC",3732776249:"IFCCOMPOSITECURVE",300633059:"IFCCOLUMNTYPE",2937912522:"IFCCIRCLEHOLLOWPROFILEDEF",3124254112:"IFCBUILDINGSTOREY",1950629157:"IFCBUILDINGELEMENTTYPE",4031249490:"IFCBUILDING",1260505505:"IFCBOUNDEDCURVE",3649129432:"IFCBOOLEANCLIPPINGRESULT",1334484129:"IFCBLOCK",3207858831:"IFCASYMMETRICISHAPEPROFILEDEF",1674181508:"IFCANNOTATION",2296667514:"IFCACTOR",2097647324:"IFCTRANSPORTELEMENTTYPE",3473067441:"IFCTASK",1580310250:"IFCSYSTEMFURNITUREELEMENTTYPE",4124788165:"IFCSURFACEOFREVOLUTION",2809605785:"IFCSURFACEOFLINEAREXTRUSION",2028607225:"IFCSURFACECURVESWEPTAREASOLID",4070609034:"IFCSTRUCTUREDDIMENSIONCALLOUT",2218152070:"IFCSTRUCTURALSURFACEMEMBERVARYING",3979015343:"IFCSTRUCTURALSURFACEMEMBER",3689010777:"IFCSTRUCTURALREACTION",530289379:"IFCSTRUCTURALMEMBER",3136571912:"IFCSTRUCTURALITEM",3544373492:"IFCSTRUCTURALACTIVITY",451544542:"IFCSPHERE",3893378262:"IFCSPATIALSTRUCTUREELEMENTTYPE",2706606064:"IFCSPATIALSTRUCTUREELEMENT",3626867408:"IFCRIGHTCIRCULARCYLINDER",4158566097:"IFCRIGHTCIRCULARCONE",1856042241:"IFCREVOLVEDAREASOLID",2914609552:"IFCRESOURCE",1401173127:"IFCRELVOIDSELEMENT",3451746338:"IFCRELSPACEBOUNDARY",366585022:"IFCRELSERVICESBUILDINGS",4122056220:"IFCRELSEQUENCE",1058617721:"IFCRELSCHEDULESCOSTITEMS",1245217292:"IFCRELREFERENCEDINSPATIALSTRUCTURE",750771296:"IFCRELPROJECTSELEMENT",202636808:"IFCRELOVERRIDESPROPERTIES",2051452291:"IFCRELOCCUPIESSPACES",3268803585:"IFCRELNESTS",4189434867:"IFCRELINTERACTIONREQUIREMENTS",279856033:"IFCRELFLOWCONTROLELEMENTS",3940055652:"IFCRELFILLSELEMENT",781010003:"IFCRELDEFINESBYTYPE",4186316022:"IFCRELDEFINESBYPROPERTIES",693640335:"IFCRELDEFINES",2551354335:"IFCRELDECOMPOSES",2802773753:"IFCRELCOVERSSPACES",886880790:"IFCRELCOVERSBLDGELEMENTS",3242617779:"IFCRELCONTAINEDINSPATIALSTRUCTURE",3678494232:"IFCRELCONNECTSWITHREALIZINGELEMENTS",504942748:"IFCRELCONNECTSWITHECCENTRICITY",1638771189:"IFCRELCONNECTSSTRUCTURALMEMBER",3912681535:"IFCRELCONNECTSSTRUCTURALELEMENT",2127690289:"IFCRELCONNECTSSTRUCTURALACTIVITY",3190031847:"IFCRELCONNECTSPORTS",4201705270:"IFCRELCONNECTSPORTTOELEMENT",3945020480:"IFCRELCONNECTSPATHELEMENTS",1204542856:"IFCRELCONNECTSELEMENTS",826625072:"IFCRELCONNECTS",2851387026:"IFCRELASSOCIATESPROFILEPROPERTIES",2655215786:"IFCRELASSOCIATESMATERIAL",3840914261:"IFCRELASSOCIATESLIBRARY",982818633:"IFCRELASSOCIATESDOCUMENT",2728634034:"IFCRELASSOCIATESCONSTRAINT",919958153:"IFCRELASSOCIATESCLASSIFICATION",4095574036:"IFCRELASSOCIATESAPPROVAL",1327628568:"IFCRELASSOCIATESAPPLIEDVALUE",1865459582:"IFCRELASSOCIATES",205026976:"IFCRELASSIGNSTORESOURCE",3372526763:"IFCRELASSIGNSTOPROJECTORDER",2857406711:"IFCRELASSIGNSTOPRODUCT",4278684876:"IFCRELASSIGNSTOPROCESS",1307041759:"IFCRELASSIGNSTOGROUP",2495723537:"IFCRELASSIGNSTOCONTROL",1683148259:"IFCRELASSIGNSTOACTOR",3939117080:"IFCRELASSIGNS",3454111270:"IFCRECTANGULARTRIMMEDSURFACE",2798486643:"IFCRECTANGULARPYRAMID",2770003689:"IFCRECTANGLEHOLLOWPROFILEDEF",3219374653:"IFCPROXY",1451395588:"IFCPROPERTYSET",4194566429:"IFCPROJECTIONCURVE",103090709:"IFCPROJECT",4208778838:"IFCPRODUCT",2945172077:"IFCPROCESS",220341763:"IFCPLANE",603570806:"IFCPLANARBOX",3566463478:"IFCPERMEABLECOVERINGPROPERTIES",3505215534:"IFCOFFSETCURVE3D",3388369263:"IFCOFFSETCURVE2D",3888040117:"IFCOBJECT",1425443689:"IFCMANIFOLDSOLIDBREP",1281925730:"IFCLINE",572779678:"IFCLSHAPEPROFILEDEF",1484403080:"IFCISHAPEPROFILEDEF",987898635:"IFCGEOMETRICCURVESET",1268542332:"IFCFURNITURETYPE",4238390223:"IFCFURNISHINGELEMENTTYPE",3455213021:"IFCFLUIDFLOWPROPERTIES",315944413:"IFCFILLAREASTYLETILES",4203026998:"IFCFILLAREASTYLETILESYMBOLWITHSTYLE",374418227:"IFCFILLAREASTYLEHATCHING",2047409740:"IFCFACEBASEDSURFACEMODEL",477187591:"IFCEXTRUDEDAREASOLID",80994333:"IFCENERGYPROPERTIES",2835456948:"IFCELLIPSEPROFILEDEF",2777663545:"IFCELEMENTARYSURFACE",339256511:"IFCELEMENTTYPE",1883228015:"IFCELEMENTQUANTITY",1472233963:"IFCEDGELOOP",4006246654:"IFCDRAUGHTINGPREDEFINEDCURVEFONT",445594917:"IFCDRAUGHTINGPREDEFINEDCOLOUR",3073041342:"IFCDRAUGHTINGCALLOUT",526551008:"IFCDOORSTYLE",1714330368:"IFCDOORPANELPROPERTIES",2963535650:"IFCDOORLININGPROPERTIES",32440307:"IFCDIRECTION",4054601972:"IFCDIMENSIONCURVETERMINATOR",606661476:"IFCDIMENSIONCURVE",693772133:"IFCDEFINEDSYMBOL",2827736869:"IFCCURVEBOUNDEDPLANE",2601014836:"IFCCURVE",2147822146:"IFCCSGSOLID",2506170314:"IFCCSGPRIMITIVE3D",194851669:"IFCCRANERAILFSHAPEPROFILEDEF",4133800736:"IFCCRANERAILASHAPEPROFILEDEF",2485617015:"IFCCOMPOSITECURVESEGMENT",2205249479:"IFCCLOSEDSHELL",1383045692:"IFCCIRCLEPROFILEDEF",1416205885:"IFCCARTESIANTRANSFORMATIONOPERATOR3DNONUNIFORM",3331915920:"IFCCARTESIANTRANSFORMATIONOPERATOR3D",3486308946:"IFCCARTESIANTRANSFORMATIONOPERATOR2DNONUNIFORM",3749851601:"IFCCARTESIANTRANSFORMATIONOPERATOR2D",59481748:"IFCCARTESIANTRANSFORMATIONOPERATOR",1123145078:"IFCCARTESIANPOINT",2898889636:"IFCCSHAPEPROFILEDEF",2713105998:"IFCBOXEDHALFSPACE",2581212453:"IFCBOUNDINGBOX",4182860854:"IFCBOUNDEDSURFACE",2736907675:"IFCBOOLEANRESULT",2740243338:"IFCAXIS2PLACEMENT3D",3125803723:"IFCAXIS2PLACEMENT2D",4261334040:"IFCAXIS1PLACEMENT",1302238472:"IFCANNOTATIONSURFACE",2265737646:"IFCANNOTATIONFILLAREAOCCURRENCE",669184980:"IFCANNOTATIONFILLAREA",3288037868:"IFCANNOTATIONCURVEOCCURRENCE",2543172580:"IFCZSHAPEPROFILEDEF",1299126871:"IFCWINDOWSTYLE",512836454:"IFCWINDOWPANELPROPERTIES",336235671:"IFCWINDOWLININGPROPERTIES",2759199220:"IFCVERTEXLOOP",1417489154:"IFCVECTOR",427810014:"IFCUSHAPEPROFILEDEF",2347495698:"IFCTYPEPRODUCT",1628702193:"IFCTYPEOBJECT",1345879162:"IFCTWODIRECTIONREPEATFACTOR",2715220739:"IFCTRAPEZIUMPROFILEDEF",3124975700:"IFCTEXTLITERALWITHEXTENT",4282788508:"IFCTEXTLITERAL",3028897424:"IFCTERMINATORSYMBOL",3071757647:"IFCTSHAPEPROFILEDEF",230924584:"IFCSWEPTSURFACE",1260650574:"IFCSWEPTDISKSOLID",2247615214:"IFCSWEPTAREASOLID",1878645084:"IFCSURFACESTYLERENDERING",2513912981:"IFCSURFACE",2233826070:"IFCSUBEDGE",3653947884:"IFCSTRUCTURALSTEELPROFILEPROPERTIES",3843319758:"IFCSTRUCTURALPROFILEPROPERTIES",1190533807:"IFCSTRUCTURALLOADSINGLEFORCEWARPING",1597423693:"IFCSTRUCTURALLOADSINGLEFORCE",1973038258:"IFCSTRUCTURALLOADSINGLEDISPLACEMENTDISTORTION",2473145415:"IFCSTRUCTURALLOADSINGLEDISPLACEMENT",2668620305:"IFCSTRUCTURALLOADPLANARFORCE",1595516126:"IFCSTRUCTURALLOADLINEARFORCE",390701378:"IFCSPACETHERMALLOADPROPERTIES",1202362311:"IFCSOUNDVALUE",2485662743:"IFCSOUNDPROPERTIES",723233188:"IFCSOLIDMODEL",2609359061:"IFCSLIPPAGECONNECTIONCONDITION",4124623270:"IFCSHELLBASEDSURFACEMODEL",2411513650:"IFCSERVICELIFEFACTOR",1509187699:"IFCSECTIONEDSPINE",2778083089:"IFCROUNDEDRECTANGLEPROFILEDEF",478536968:"IFCRELATIONSHIP",3765753017:"IFCREINFORCEMENTDEFINITIONPROPERTIES",3413951693:"IFCREGULARTIMESERIES",3615266464:"IFCRECTANGLEPROFILEDEF",110355661:"IFCPROPERTYTABLEVALUE",3650150729:"IFCPROPERTYSINGLEVALUE",3357820518:"IFCPROPERTYSETDEFINITION",941946838:"IFCPROPERTYREFERENCEVALUE",2752243245:"IFCPROPERTYLISTVALUE",4166981789:"IFCPROPERTYENUMERATEDVALUE",1680319473:"IFCPROPERTYDEFINITION",871118103:"IFCPROPERTYBOUNDEDVALUE",673634403:"IFCPRODUCTDEFINITIONSHAPE",179317114:"IFCPREDEFINEDPOINTMARKERSYMBOL",433424934:"IFCPREDEFINEDDIMENSIONSYMBOL",2559016684:"IFCPREDEFINEDCURVEFONT",759155922:"IFCPREDEFINEDCOLOUR",2775532180:"IFCPOLYGONALBOUNDEDHALFSPACE",2924175390:"IFCPOLYLOOP",1423911732:"IFCPOINTONSURFACE",4022376103:"IFCPOINTONCURVE",2067069095:"IFCPOINT",1663979128:"IFCPLANAREXTENT",2004835150:"IFCPLACEMENT",597895409:"IFCPIXELTEXTURE",3021840470:"IFCPHYSICALCOMPLEXQUANTITY",2519244187:"IFCPATH",2529465313:"IFCPARAMETERIZEDPROFILEDEF",1029017970:"IFCORIENTEDEDGE",2665983363:"IFCOPENSHELL",2833995503:"IFCONEDIRECTIONREPEATFACTOR",219451334:"IFCOBJECTDEFINITION",1430189142:"IFCMECHANICALCONCRETEMATERIALPROPERTIES",2022407955:"IFCMATERIALDEFINITIONREPRESENTATION",2347385850:"IFCMAPPEDITEM",1008929658:"IFCLOOP",2624227202:"IFCLOCALPLACEMENT",3422422726:"IFCLIGHTSOURCESPOT",1520743889:"IFCLIGHTSOURCEPOSITIONAL",4266656042:"IFCLIGHTSOURCEGONIOMETRIC",2604431987:"IFCLIGHTSOURCEDIRECTIONAL",125510826:"IFCLIGHTSOURCEAMBIENT",1402838566:"IFCLIGHTSOURCE",3741457305:"IFCIRREGULARTIMESERIES",3905492369:"IFCIMAGETEXTURE",2445078500:"IFCHYGROSCOPICMATERIALPROPERTIES",812098782:"IFCHALFSPACESOLID",178086475:"IFCGRIDPLACEMENT",3590301190:"IFCGEOMETRICSET",4142052618:"IFCGEOMETRICREPRESENTATIONSUBCONTEXT",2453401579:"IFCGEOMETRICREPRESENTATIONITEM",3448662350:"IFCGEOMETRICREPRESENTATIONCONTEXT",1446786286:"IFCGENERALPROFILEPROPERTIES",803998398:"IFCGENERALMATERIALPROPERTIES",3857492461:"IFCFUELPROPERTIES",738692330:"IFCFILLAREASTYLE",4219587988:"IFCFAILURECONNECTIONCONDITION",3008276851:"IFCFACESURFACE",803316827:"IFCFACEOUTERBOUND",1809719519:"IFCFACEBOUND",2556980723:"IFCFACE",1860660968:"IFCEXTENDEDMATERIALPROPERTIES",476780140:"IFCEDGECURVE",3900360178:"IFCEDGE",4170525392:"IFCDRAUGHTINGPREDEFINEDTEXTFONT",3732053477:"IFCDOCUMENTREFERENCE",1694125774:"IFCDIMENSIONPAIR",2273265877:"IFCDIMENSIONCALLOUTRELATIONSHIP",3632507154:"IFCDERIVEDPROFILEDEF",3800577675:"IFCCURVESTYLE",2889183280:"IFCCONVERSIONBASEDUNIT",3050246964:"IFCCONTEXTDEPENDENTUNIT",45288368:"IFCCONNECTIONPOINTECCENTRICITY",1981873012:"IFCCONNECTIONCURVEGEOMETRY",370225590:"IFCCONNECTEDFACESET",1485152156:"IFCCOMPOSITEPROFILEDEF",2542286263:"IFCCOMPLEXPROPERTY",776857604:"IFCCOLOURRGB",647927063:"IFCCLASSIFICATIONREFERENCE",3150382593:"IFCCENTERLINEPROFILEDEF",616511568:"IFCBLOBTEXTURE",2705031697:"IFCARBITRARYPROFILEDEFWITHVOIDS",1310608509:"IFCARBITRARYOPENPROFILEDEF",3798115385:"IFCARBITRARYCLOSEDPROFILEDEF",2297822566:"IFCANNOTATIONTEXTOCCURRENCE",3612888222:"IFCANNOTATIONSYMBOLOCCURRENCE",962685235:"IFCANNOTATIONSURFACEOCCURRENCE",2442683028:"IFCANNOTATIONOCCURRENCE",1065908215:"IFCWATERPROPERTIES",891718957:"IFCVIRTUALGRIDINTERSECTION",1907098498:"IFCVERTEXPOINT",3304826586:"IFCVERTEXBASEDTEXTUREMAP",2799835756:"IFCVERTEX",180925521:"IFCUNITASSIGNMENT",1735638870:"IFCTOPOLOGYREPRESENTATION",1377556343:"IFCTOPOLOGICALREPRESENTATIONITEM",581633288:"IFCTIMESERIESVALUE",1718945513:"IFCTIMESERIESREFERENCERELATIONSHIP",3101149627:"IFCTIMESERIES",3317419933:"IFCTHERMALMATERIALPROPERTIES",1210645708:"IFCTEXTUREVERTEX",2552916305:"IFCTEXTUREMAP",1742049831:"IFCTEXTURECOORDINATEGENERATOR",280115917:"IFCTEXTURECOORDINATE",1484833681:"IFCTEXTSTYLEWITHBOXCHARACTERISTICS",1640371178:"IFCTEXTSTYLETEXTMODEL",2636378356:"IFCTEXTSTYLEFORDEFINEDFONT",1983826977:"IFCTEXTSTYLEFONTMODEL",1447204868:"IFCTEXTSTYLE",912023232:"IFCTELECOMADDRESS",531007025:"IFCTABLEROW",985171141:"IFCTABLE",1290481447:"IFCSYMBOLSTYLE",626085974:"IFCSURFACETEXTURE",1351298697:"IFCSURFACESTYLEWITHTEXTURES",846575682:"IFCSURFACESTYLESHADING",1607154358:"IFCSURFACESTYLEREFRACTION",3303107099:"IFCSURFACESTYLELIGHTING",1300840506:"IFCSURFACESTYLE",3049322572:"IFCSTYLEDREPRESENTATION",3958052878:"IFCSTYLEDITEM",2830218821:"IFCSTYLEMODEL",3408363356:"IFCSTRUCTURALLOADTEMPERATURE",2525727697:"IFCSTRUCTURALLOADSTATIC",2162789131:"IFCSTRUCTURALLOAD",2273995522:"IFCSTRUCTURALCONNECTIONCONDITION",3692461612:"IFCSIMPLEPROPERTY",4240577450:"IFCSHAPEREPRESENTATION",3982875396:"IFCSHAPEMODEL",867548509:"IFCSHAPEASPECT",4165799628:"IFCSECTIONREINFORCEMENTPROPERTIES",2042790032:"IFCSECTIONPROPERTIES",448429030:"IFCSIUNIT",2341007311:"IFCROOT",3679540991:"IFCRIBPLATEPROFILEPROPERTIES",1660063152:"IFCREPRESENTATIONMAP",3008791417:"IFCREPRESENTATIONITEM",3377609919:"IFCREPRESENTATIONCONTEXT",1076942058:"IFCREPRESENTATION",1222501353:"IFCRELAXATION",1580146022:"IFCREINFORCEMENTBARPROPERTIES",2692823254:"IFCREFERENCESVALUEDOCUMENT",825690147:"IFCQUANTITYWEIGHT",2405470396:"IFCQUANTITYVOLUME",3252649465:"IFCQUANTITYTIME",931644368:"IFCQUANTITYLENGTH",2093928680:"IFCQUANTITYCOUNT",2044713172:"IFCQUANTITYAREA",3710013099:"IFCPROPERTYENUMERATION",148025276:"IFCPROPERTYDEPENDENCYRELATIONSHIP",3896028662:"IFCPROPERTYCONSTRAINTRELATIONSHIP",2598011224:"IFCPROPERTY",2802850158:"IFCPROFILEPROPERTIES",3958567839:"IFCPROFILEDEF",2267347899:"IFCPRODUCTSOFCOMBUSTIONPROPERTIES",2095639259:"IFCPRODUCTREPRESENTATION",2417041796:"IFCPRESENTATIONSTYLEASSIGNMENT",3119450353:"IFCPRESENTATIONSTYLE",1304840413:"IFCPRESENTATIONLAYERWITHSTYLE",2022622350:"IFCPRESENTATIONLAYERASSIGNMENT",1775413392:"IFCPREDEFINEDTEXTFONT",3213052703:"IFCPREDEFINEDTERMINATORSYMBOL",990879717:"IFCPREDEFINEDSYMBOL",3727388367:"IFCPREDEFINEDITEM",3355820592:"IFCPOSTALADDRESS",2226359599:"IFCPHYSICALSIMPLEQUANTITY",2483315170:"IFCPHYSICALQUANTITY",101040310:"IFCPERSONANDORGANIZATION",2077209135:"IFCPERSON",1207048766:"IFCOWNERHISTORY",1411181986:"IFCORGANIZATIONRELATIONSHIP",4251960020:"IFCORGANIZATION",1227763645:"IFCOPTICALMATERIALPROPERTIES",2251480897:"IFCOBJECTIVE",3701648758:"IFCOBJECTPLACEMENT",1918398963:"IFCNAMEDUNIT",2706619895:"IFCMONETARYUNIT",3368373690:"IFCMETRIC",677618848:"IFCMECHANICALSTEELMATERIALPROPERTIES",4256014907:"IFCMECHANICALMATERIALPROPERTIES",2597039031:"IFCMEASUREWITHUNIT",3265635763:"IFCMATERIALPROPERTIES",2199411900:"IFCMATERIALLIST",1303795690:"IFCMATERIALLAYERSETUSAGE",3303938423:"IFCMATERIALLAYERSET",248100487:"IFCMATERIALLAYER",1847130766:"IFCMATERIALCLASSIFICATIONRELATIONSHIP",1838606355:"IFCMATERIAL",30780891:"IFCLOCALTIME",1566485204:"IFCLIGHTINTENSITYDISTRIBUTION",4162380809:"IFCLIGHTDISTRIBUTIONDATA",3452421091:"IFCLIBRARYREFERENCE",2655187982:"IFCLIBRARYINFORMATION",3020489413:"IFCIRREGULARTIMESERIESVALUE",852622518:"IFCGRIDAXIS",3548104201:"IFCEXTERNALLYDEFINEDTEXTFONT",3207319532:"IFCEXTERNALLYDEFINEDSYMBOL",1040185647:"IFCEXTERNALLYDEFINEDSURFACESTYLE",2242383968:"IFCEXTERNALLYDEFINEDHATCHSTYLE",3200245327:"IFCEXTERNALREFERENCE",1648886627:"IFCENVIRONMENTALIMPACTVALUE",3796139169:"IFCDRAUGHTINGCALLOUTRELATIONSHIP",770865208:"IFCDOCUMENTINFORMATIONRELATIONSHIP",1154170062:"IFCDOCUMENTINFORMATION",1376555844:"IFCDOCUMENTELECTRONICFORMAT",2949456006:"IFCDIMENSIONALEXPONENTS",1045800335:"IFCDERIVEDUNITELEMENT",1765591967:"IFCDERIVEDUNIT",1072939445:"IFCDATEANDTIME",3510044353:"IFCCURVESTYLEFONTPATTERN",2367409068:"IFCCURVESTYLEFONTANDSCALING",1105321065:"IFCCURVESTYLEFONT",539742890:"IFCCURRENCYRELATIONSHIP",602808272:"IFCCOSTVALUE",1065062679:"IFCCOORDINATEDUNIVERSALTIMEOFFSET",347226245:"IFCCONSTRAINTRELATIONSHIP",613356794:"IFCCONSTRAINTCLASSIFICATIONRELATIONSHIP",1658513725:"IFCCONSTRAINTAGGREGATIONRELATIONSHIP",1959218052:"IFCCONSTRAINT",2732653382:"IFCCONNECTIONSURFACEGEOMETRY",4257277454:"IFCCONNECTIONPORTGEOMETRY",2614616156:"IFCCONNECTIONPOINTGEOMETRY",2859738748:"IFCCONNECTIONGEOMETRY",3264961684:"IFCCOLOURSPECIFICATION",3639012971:"IFCCLASSIFICATIONNOTATIONFACET",938368621:"IFCCLASSIFICATIONNOTATION",1098599126:"IFCCLASSIFICATIONITEMRELATIONSHIP",1767535486:"IFCCLASSIFICATIONITEM",747523909:"IFCCLASSIFICATION",622194075:"IFCCALENDARDATE",2069777674:"IFCBOUNDARYNODECONDITIONWARPING",1387855156:"IFCBOUNDARYNODECONDITION",3367102660:"IFCBOUNDARYFACECONDITION",1560379544:"IFCBOUNDARYEDGECONDITION",4037036970:"IFCBOUNDARYCONDITION",3869604511:"IFCAPPROVALRELATIONSHIP",390851274:"IFCAPPROVALPROPERTYRELATIONSHIP",2080292479:"IFCAPPROVALACTORRELATIONSHIP",130549933:"IFCAPPROVAL",1110488051:"IFCAPPLIEDVALUERELATIONSHIP",411424972:"IFCAPPLIEDVALUE",639542469:"IFCAPPLICATION",618182010:"IFCADDRESS",3630933823:"IFCACTORROLE",599546466:"FILE_DESCRIPTION",1390159747:"FILE_NAME",1109904537:"FILE_SCHEMA"};let Dn=class am{static async getUnits(e){var t;const{IFCUNITASSIGNMENT:i}=ii,n=await e.getAllPropertiesOfType(i);if(!n)return 1;const r=Object.keys(n),o=n[parseInt(r[0],10)];for(const a of o.Units){if(a.value===void 0||a.value===null)continue;const l=await e.getProperties(a.value);if(!l||!l.UnitType||!l.UnitType.value||l.UnitType.value!=="LENGTHUNIT")continue;let h=1,d=1;return l.Name.value==="METRE"&&(d=1),l.Name.value==="FOOT"&&(d=.3048),((t=l.Prefix)==null?void 0:t.value)==="MILLI"&&(h=.001),d*h}return 1}static async findItemByGuid(e,t){var i;const n=e.getAllPropertiesIDs();for(const r of n){const o=await e.getProperties(r);if(o&&((i=o.GlobalId)==null?void 0:i.value)===t)return o}return null}static async getRelationMap(e,t,i){var n;const r=i??(()=>{}),o={},a=e.getAllPropertiesIDs();for(const l of a){const h=await e.getProperties(l);if(!h)continue;const d=h.type===t,p=Object.keys(h).find(w=>w.startsWith("Relating")),f=Object.keys(h).find(w=>w.startsWith("Related"));if(!(d&&p&&f))continue;const g=await e.getProperties((n=h[p])==null?void 0:n.value),y=h[f];if(!g||!y||!(y&&Array.isArray(y)))continue;const b=y.map(w=>w.value);r(g.expressID,b),o[g.expressID]=b}return o}static async getQsetQuantities(e,t,i){const n=i??(()=>{}),r=await e.getProperties(t);return!r||r.type!==qh?null:(r.Quantities??[{}]).map(o=>(o.value&&n(o.value),o.value)).filter(o=>o!==null)}static async getPsetProps(e,t,i){const n=i??(()=>{}),r=await e.getProperties(t);return!r||r.type!==zr?null:(r.HasProperties??[{}]).map(o=>(o.value&&n(o.value),o.value)).filter(o=>o!==null)}static async getPsetRel(e,t){var i;if(!await e.getProperties(t))return null;const n=await e.getAllPropertiesOfType(cl);if(!n)return null;const r=Object.values(n);let o=null;for(const a of r)((i=a.RelatingPropertyDefinition)==null?void 0:i.value)===t&&(o=a.expressID);return o}static async getQsetRel(e,t){return am.getPsetRel(e,t)}static async getEntityName(e,t){var i;const n=await e.getProperties(t);if(!n)return{key:null,name:null};const r=Object.keys(n).find(a=>a.endsWith("Name"))??null,o=r?(i=n[r])==null?void 0:i.value:null;return{key:r,name:o}}static async getQuantityValue(e,t){const i=await e.getProperties(t);if(!i)return{key:null,value:null};const n=Object.keys(i).find(o=>o.endsWith("Value"))??null;let r;return n===null||i[n]===void 0||i[n]===null?r=null:r=i[n].value,{key:n,value:r}}static isRel(e){return om[e].startsWith("IFCREL")}static async attributeExists(e,t,i){const n=await e.getProperties(t);return n?Object.keys(n).includes(i):!1}static async groupEntitiesByType(e,t){var i;const n=new Map;for(const r of t){const o=await e.getProperties(r);if(!o)continue;const a=o.type;n.get(a)||n.set(a,new Set),(i=n.get(a))==null||i.add(r)}return n}};const rE=new Map([[Gh,{forRelating:"IsDecomposedBy",forRelated:"Decomposes"}],[jh,{forRelating:"AssociatedTo",forRelated:"HasAssociations"}],[Wh,{forRelating:"ClassificationForObjects",forRelated:"HasAssociations"}],[Xh,{forRelating:"IsGroupedBy",forRelated:"HasAssignments"}],[cl,{forRelated:"IsDefinedBy",forRelating:"DefinesOcurrence"}],[Kh,{forRelated:"IsTypedBy",forRelating:"Types"}],[wf,{forRelated:"IsDefinedBy",forRelating:"Defines"}],[hl,{forRelated:"ContainedInStructure",forRelating:"ContainsElements"}]]),lm=class uh extends Re{constructor(e){super(e),A(this,"onDisposed",new ee),A(this,"enabled",!0),A(this,"onRelationsIndexed",new ee),A(this,"_relToAttributesMap",rE),A(this,"_inverseAttributes",["IsDecomposedBy","Decomposes","AssociatedTo","HasAssociations","ClassificationForObjects","IsGroupedBy","HasAssignments","IsDefinedBy","DefinesOcurrence","IsTypedBy","Types","Defines","ContainedInStructure","ContainsElements"]),A(this,"_ifcRels",[Gh,jh,Wh,Xh,cl,Kh,wf,hl]),A(this,"relationMaps",{}),A(this,"onFragmentsDisposed",t=>{delete this.relationMaps[t.groupID]}),this.components.add(uh.uuid,this),e.get(rt).onFragmentsDisposed.add(this.onFragmentsDisposed)}setRelationMap(e,t){this.relationMaps[e.uuid]=t,this.onRelationsIndexed.trigger({modelID:e.uuid,relationsMap:t})}async process(e){if(!e.hasProperties)throw new Error("FragmentsGroup properties not found");let t=this.relationMaps[e.uuid];if(t)return t;t=new Map;for(const i of this._ifcRels)await Dn.getRelationMap(e,i,async(n,r)=>{const o=this._relToAttributesMap.get(i);if(!o)return;const{forRelated:a,forRelating:l}=o,h=t.get(n)??new Map,d=this._inverseAttributes.indexOf(l);h.set(d,r),t.set(n,h);for(const p of r){const f=t.get(p)??new Map,g=this._inverseAttributes.indexOf(a),y=f.get(g)??[];y.push(n),f.set(g,y),t.set(p,f)}});return this.setRelationMap(e,t),t}async processFromWebIfc(e,t){const i=new Map;for(const n of this._ifcRels){const r=this._relToAttributesMap.get(n);if(!r)continue;const{forRelated:o,forRelating:a}=r,l=e.GetLineIDsWithType(t,n);for(let h=0;hT.startsWith("Relating")),f=Object.keys(d).find(T=>T.startsWith("Related"));if(!(p&&f))continue;const g=d[p].value,y=d[f].map(T=>T.value),b=i.get(g)??new Map,w=this._inverseAttributes.indexOf(a);b.set(w,y),i.set(g,b);for(const T of y){const S=i.get(T)??new Map,_=this._inverseAttributes.indexOf(o),I=S.get(_)??[];I.push(g),S.set(_,I),i.set(T,S)}}}return this.onRelationsIndexed.trigger({modelID:t.toString(),relationsMap:i}),i}getEntityRelations(e,t,i){const n=this.relationMaps[e.uuid];if(!n)return null;const r=n.get(t),o=this._inverseAttributes.indexOf(i);return!r||o===-1?null:r.get(o)||null}serializeRelations(e){const t={};for(const[i,n]of e.entries()){t[i]||(t[i]={});for(const[r,o]of n.entries())t[i][r]=o}return JSON.stringify(t)}serializeModelRelations(e){const t=this.relationMaps[e.uuid];return t?this.serializeRelations(t):null}serializeAllRelations(){const e={};for(const t in this.relationMaps){const i=this.relationMaps[t],n={};for(const[r,o]of i.entries()){n[r]||(n[r]={});for(const[a,l]of o.entries())n[r][a]=l}e[t]=n}return JSON.stringify(e)}getRelationsMapFromJSON(e){const t=JSON.parse(e),i=new Map;for(const n in t){const r=t[n],o=new Map;for(const a in r)o.set(Number(a),r[a]);i.set(Number(n),o)}return i}dispose(){this.relationMaps={},this.components.get(rt).onFragmentsDisposed.remove(this.onFragmentsDisposed),this.onDisposed.trigger(uh.uuid),this.onDisposed.reset()}};A(lm,"uuid","23a889ab-83b3-44a4-8bee-ead83438370b");let ru=lm;class oE{constructor(){A(this,"factor",1),A(this,"complement",1)}apply(e){const t=this.getScaleMatrix().multiply(e);e.copy(t)}setUp(e){var t;this.factor=1;const i=this.getLengthUnits(e);if(!i)return;const n=i==null,r=i.Name===void 0||i.Name===null;n||r||(i.Name.value==="FOOT"?this.factor=.3048:((t=i.Prefix)==null?void 0:t.value)==="MILLI"&&(this.complement=.001))}getLengthUnits(e){try{const t=e.GetLineIDsWithType(0,Dv).get(0),i=e.GetLine(0,t);for(const n of i.Units){if(!n||n.value===null||n.value===void 0)continue;const r=e.GetLine(0,n.value);if(r.UnitType&&r.UnitType.value==="LENGTHUNIT")return r}return null}catch{return console.log("Could not get units"),null}}getScaleMatrix(){const e=this.factor;return new Ee().fromArray([e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1])}}let cm=class{constructor(){A(this,"itemsByFloor",{}),A(this,"_units",new oE)}setUp(e){this._units.setUp(e),this.cleanUp();try{const t=e.GetLineIDsWithType(0,hl),i=new Set,n=e.GetLineIDsWithType(0,Wn);for(let h=0;h{this.getMesh(a,t)});for(const a of this._visitedFragments){const{index:l,fragment:h}=a[1];t.keyFragments.set(l,h.id)}for(const a of t.items){const l=this._fragmentInstances.get(a.id);if(!l)throw new Error("Fragment not found!");const h=[];for(const[d,p]of l)h.push(p);a.add(h)}const o=this.webIfc.GetCoordinationMatrix(0);return t.coordinationMatrix.fromArray(o),t.civilData=this._civil.read(this.webIfc),t}cleanUp(){this.webIfc=null,this.webIfc=new tn,this._visitedFragments.clear(),this._fragmentInstances.clear()}getMesh(e,t){const i=e.geometries.size(),n=e.expressID;for(let r=0;rparseInt(o,10)),n=t[i[0]],r=new Qo(n.expressID);return{ownerHistory:n,ownerHistoryHandle:r}}registerChange(e,...t){this.changeMap[e.uuid]||(this.changeMap[e.uuid]=new Set);for(const i of t)this.changeMap[e.uuid].add(i),this.onDataChanged.trigger({model:e,expressID:i})}async setData(e,...t){for(const i of t){const n=i.expressID;n&&(await e.setProperties(n,i),this.registerChange(e,n))}}async newPset(e,t,i){const n=ws.getIFCSchema(e),{ownerHistoryHandle:r}=await this.getOwnerHistory(e),o=this.newGUID(e),a=new ii[n].IfcLabel(t),l=i?new ii[n].IfcText(i):null,h=new ii[n].IfcPropertySet(o,r,a,l,[]);h.expressID=this.increaseMaxID(e);const d=this.newGUID(e),p=new ii[n].IfcRelDefinesByProperties(d,r,null,null,[],new Qo(h.expressID));return p.expressID=this.increaseMaxID(e),await this.setData(e,h,p),{pset:h,rel:p}}async removePset(e,...t){for(const i of t){const n=await e.getProperties(i);if((n==null?void 0:n.type)!==zr)continue;const r=await Dn.getPsetRel(e,i);if(r&&(await e.setProperties(r,null),this.registerChange(e,r)),n){for(const o of n.HasProperties)await e.setProperties(o.value,null);await e.setProperties(i,null),this.onPsetRemoved.trigger({model:e,psetID:i}),this.registerChange(e,i)}}}async newSingleProperty(e,t,i,n){const r=ws.getIFCSchema(e),o=new ii[r].IfcIdentifier(i),a=new ii[r][t](n),l=new ii[r].IfcPropertySingleValue(o,null,a,null);return l.expressID=this.increaseMaxID(e),await this.setData(e,l),l}newSingleStringProperty(e,t,i,n){return this.newSingleProperty(e,t,i,n)}newSingleNumericProperty(e,t,i,n){return this.newSingleProperty(e,t,i,n)}newSingleBooleanProperty(e,t,i,n){return this.newSingleProperty(e,t,i,n)}async removePsetProp(e,t,i){const n=await e.getProperties(t),r=await e.getProperties(i);!n||!r||n.type===zr&&r&&(n.HasProperties=n.HasProperties.filter(o=>o.value!==i),await e.setProperties(i,null),this.registerChange(e,t,i))}async addElementToPset(e,t,...i){const n=await Dn.getPsetRel(e,t);if(!n)return;const r=await e.getProperties(n);if(r){for(const o of i){const a=new Qo(o);r.RelatedObjects.push(a),this.onElementToPset.trigger({model:e,psetID:t,elementID:o})}this.registerChange(e,t)}}async addPropToPset(e,t,...i){const n=await e.getProperties(t);if(n){for(const r of i){if(n.HasProperties.includes(r))continue;const o=new Qo(r);n.HasProperties.push(o),this.onPropToPset.trigger({model:e,psetID:t,propID:r})}this.registerChange(e,t)}}async saveToIfc(e,t){const i=this.components.get(aE),n=i.webIfc,r=await i.readIfcFile(t),o=this.changeMap[e.uuid]??[];for(const l of o){const h=await e.getProperties(l);if(h)try{n.WriteLine(r,h)}catch{}else try{n.DeleteLine(r,l)}catch{}}const a=n.SaveModel(r);return i.webIfc.CloseModel(r),i.cleanUp(),a}async setAttributeListener(e,t,i){this.attributeListeners[e.uuid]||(this.attributeListeners[e.uuid]={});const n=this.attributeListeners[e.uuid][t]?this.attributeListeners[e.uuid][t][i]:null;if(n)return n;const r=await e.getProperties(t);if(!r)throw new Error(`Entity with expressID ${t} doesn't exists.`);const o=r[i];if(Array.isArray(o)||!o)throw new Error(`Attribute ${i} is array or null, and it can't have a listener.`);const a=o.value;if(a===void 0||a==null)throw new Error(`Attribute ${i} has a badly defined handle.`);const l=new ee;return Object.defineProperty(r[i],"value",{get(){return this._value},async set(h){this._value=h,l.trigger(h)}}),r[i].value=a,this.attributeListeners[e.uuid][t]||(this.attributeListeners[e.uuid][t]={}),this.attributeListeners[e.uuid][t][i]=l,l}};A(lE,"uuid","58c2d9f0-183c-48d6-a402-dfcf5b9a34df");const pm=class fm extends Re{constructor(e){super(e),A(this,"enabled",!0),A(this,"list",{}),A(this,"onDisposed",new ee),A(this,"onFragmentsDisposed",t=>{const{groupID:i,fragmentIDs:n}=t;for(const r in this.list){const o=this.list[r],a=Object.keys(o);if(a.includes(i))delete o[i],Object.values(o).length===0&&delete this.list[r];else for(const l of a){const h=o[l];for(const d of n)delete h[d];Object.values(h).length===0&&delete o[l]}}}),e.add(fm.uuid,this),e.get(rt).onFragmentsDisposed.add(this.onFragmentsDisposed)}dispose(){this.list={},this.components.get(rt).onFragmentsDisposed.remove(this.onFragmentsDisposed),this.onDisposed.trigger(),this.onDisposed.reset()}remove(e){for(const t in this.list){const i=this.list[t];for(const n in i){const r=i[n];delete r[e]}}}find(e){const t=this.components.get(rt);if(!e){const o={};for(const[a,l]of t.list)o[a]=new Set(l.ids);return o}const i=Object.keys(e).length,n={};for(const o in e){const a=e[o];if(!this.list[o]){console.warn(`Classification ${o} does not exist.`);continue}for(const l of a){const h=this.list[o][l];if(h)for(const d in h){n[d]||(n[d]=new Map);for(const p of h[d]){const f=n[d].get(p);f===void 0?n[d].set(p,1):n[d].set(p,f+1)}}}}const r={};for(const o in n){const a=n[o];for(const[l,h]of a){if(h===void 0)throw new Error("Malformed fragments map!");h===i&&(r[o]||(r[o]=new Set),r[o].add(l))}}return r}byModel(e,t){this.list.models||(this.list.models={});const i=this.list.models;i[e]||(i[e]={});const n=i[e];for(const[r,o]of t.data){const a=o[0];for(const l of a){const h=t.keyFragments.get(l);h&&(n[h]||(n[h]=new Set),n[h].add(r))}}}async byPredefinedType(e){var t;this.list.predefinedTypes||(this.list.predefinedTypes={});const i=this.list.predefinedTypes,n=e.getAllPropertiesIDs();for(const r of n){const o=await e.getProperties(r);if(!o)continue;const a=String((t=o.PredefinedType)==null?void 0:t.value).toUpperCase();i[a]||(i[a]={});const l=i[a];for(const[h,d]of e.data){const p=d[0];for(const f of p){const g=e.keyFragments.get(f);if(!g)throw new Error("Fragment ID not found!");l[g]||(l[g]=new Set),l[g].add(o.expressID)}}}}byEntity(e){this.list.entities||(this.list.entities={});for(const[t,i]of e.data){const n=i[1][1],r=om[n];this.saveItem(e,"entities",r,t)}}byStorey(e){for(const[t,i]of e.data){const n=i[1][0].toString();this.saveItem(e,"storeys",n,t)}}async byIfcRel(e,t,i){Dn.isRel(t)&&await Dn.getRelationMap(e,t,async(n,r)=>{const{name:o}=await Dn.getEntityName(e,n);for(const a of r)this.saveItem(e,i,o??"NO REL NAME",a)})}setColor(e,t,i=!1){const n=this.components.get(rt);for(const r in e){const o=n.list.get(r);if(!o)continue;const a=e[r];o.setColor(t,a,i)}}resetColor(e){const t=this.components.get(rt);for(const i in e){const n=t.list.get(i);if(!n)continue;const r=e[i];n.resetColor(r)}}saveItem(e,t,i,n){this.list[t]||(this.list[t]={});const r=e.data.get(n);if(r)for(const o of r[0]){const a=e.keyFragments.get(o);if(a){const l=this.list[t];l[i]||(l[i]={}),l[i][a]||(l[i][a]=new Set),l[i][a].add(n)}}}};A(pm,"uuid","e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");let cE=pm;const hE=class mm extends Re{constructor(e){super(e),A(this,"enabled",!0),A(this,"height",10),A(this,"groupName","storeys"),A(this,"onDisposed",new ee),A(this,"list",new Set),e.add(mm.uuid,this)}dispose(){this.list.clear(),this.onDisposed.trigger(),this.onDisposed.reset()}set(e){if(!this.enabled)return;const t=this.components.get(cE),i=this.components.get(rt),n=e?1:-1;let r=0;const o=t.list[this.groupName],a=new Ee;for(const l in o){a.elements[13]=r*n*this.height;for(const h in o[l]){const d=i.list.get(h),p=l+h,f=this.list.has(p);if(!d||e&&f||!e&&!f)continue;e?this.list.add(p):this.list.delete(p);const g=o[l][h];d.applyTransform(g,a)}r++}}};A(hE,"uuid","d260618b-ce88-4c7d-826c-6debb91de3e2");const uE=class gm extends Re{constructor(e){super(e),A(this,"enabled",!0),this.components.add(gm.uuid,this)}set(e,t){const i=this.components.get(rt);if(!t){for(const n in i.list){const r=i.list.get(n);r&&(r.setVisibility(e),this.updateCulledVisibility(r))}return}for(const n in t){const r=t[n],o=i.list.get(n);o&&(o.setVisibility(e,r),this.updateCulledVisibility(o))}}isolate(e){this.set(!1),this.set(!0,e)}updateCulledVisibility(e){const t=this.components.get(Z1);for(const[i,n]of t.list){const r=n.colorMeshes.get(e.id);r&&(r.count=e.mesh.count)}}};A(uE,"uuid","dd9ccf2d-8a21-4821-b7f6-2949add16a29");class dE extends ou{constructor(){super(...arguments),A(this,"minGeometrySize",10),A(this,"minAssetsSize",1e3)}}let vm=class extends ou{constructor(){super(...arguments),A(this,"propertiesSize",100)}};class pE extends Re{constructor(){super(...arguments),A(this,"onPropertiesStreamed",new $i),A(this,"onProgress",new $i),A(this,"onIndicesStreamed",new $i),A(this,"onDisposed",new ee),A(this,"enabled",!0),A(this,"settings",new vm),A(this,"webIfc",new tn)}async dispose(){this.onIndicesStreamed.reset(),this.onPropertiesStreamed.reset(),this.webIfc=null,this.onDisposed.reset()}async streamFromBuffer(e){const t=performance.now();await this.readIfcFile(e),await this.streamAllProperties(),this.cleanUp(),console.log(`Streaming the IFC took ${performance.now()-t} ms!`)}async streamFromCallBack(e){const t=performance.now();await this.streamIfcFile(e),await this.streamAllProperties(),this.cleanUp(),console.log(`Streaming the IFC took ${performance.now()-t} ms!`)}async readIfcFile(e){const{path:t,absolute:i,logLevel:n}=this.settings.wasm;this.webIfc.SetWasmPath(t,i),await this.webIfc.Init(),n&&this.webIfc.SetLogLevel(n),this.webIfc.OpenModel(e,this.settings.webIfc)}async streamIfcFile(e){const{path:t,absolute:i,logLevel:n}=this.settings.wasm;this.webIfc.SetWasmPath(t,i),await this.webIfc.Init(),n&&this.webIfc.SetLogLevel(n),this.webIfc.OpenModelFromCallback(e,this.settings.webIfc)}async streamAllProperties(){const{propertiesSize:e}=this.settings,t=new Set(this.webIfc.GetIfcEntityList(0)),i=[cl,Kh,jh,hl,Wh,Xh],n=new Map,r=new Set([pl,Qh,Zh,dl,Wn]);for(const h of r)t.add(h);let o=.01,a=0;for(const h of t){if(a++,su.has(h))continue;const d=r.has(h),p=this.webIfc.GetLineIDsWithType(0,h),f=p.size();let g=0;for(let b=0;bo&&(o+=.01,o=Math.max(o,y),await this.onProgress.trigger(Math.round(o*100)/100))}const l=[];for(const[h,d]of n)l.push([h,...d]);await this.onIndicesStreamed.trigger(l)}getIndices(e,t,i){const n=e.RelatedObjects||e.RelatedElements;if(!n){console.log(`Related objects not found: ${t}`);return}const r=e.RelatingType||e.RelatingMaterial||e.RelatingStructure||e.RelatingPropertyDefinition||e.RelatingGroup||e.RelatingClassification;if(!r){console.log(`Relating object not found: ${t}`);return}if(!Array.isArray(n)||r.value===void 0)return;const o=r.value;for(const a of n){if(a.value===void 0||a.value===null)continue;const l=a.value;i.has(l)||i.set(l,new Set),i.get(l).add(o)}}cleanUp(){this.webIfc=null,this.webIfc=new tn}}A(pE,"uuid","88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");const fE=class ym extends Re{constructor(e){super(e),A(this,"onGeometryStreamed",new ee),A(this,"onAssetStreamed",new ee),A(this,"onProgress",new ee),A(this,"onIfcLoaded",new ee),A(this,"onDisposed",new ee),A(this,"settings",new dE),A(this,"enabled",!0),A(this,"webIfc",new tn),A(this,"_spatialTree",new cm),A(this,"_metaData",new um),A(this,"_visitedGeometries",new Map),A(this,"_streamSerializer",new Tf),A(this,"_geometries",new Map),A(this,"_geometryCount",0),A(this,"_civil",new hm),A(this,"_groupSerializer",new bf),A(this,"_assets",[]),A(this,"_meshesWithHoles",new Set),this.components.add(ym.uuid,this),this.settings.excludedCategories.add(If)}dispose(){this.onIfcLoaded.reset(),this.onGeometryStreamed.reset(),this.onAssetStreamed.reset(),this.webIfc=null,this.onDisposed.trigger(),this.onDisposed.reset()}async streamFromBuffer(e){const t=performance.now();await this.readIfcFile(e),await this.streamAllGeometries(),this.cleanUp(),console.log(`Streaming the IFC took ${performance.now()-t} ms!`)}async streamFromCallBack(e){const t=performance.now();await this.streamIfcFile(e),await this.streamAllGeometries(),this.cleanUp(),console.log(`Streaming the IFC took ${performance.now()-t} ms!`)}async readIfcFile(e){const{path:t,absolute:i,logLevel:n}=this.settings.wasm;this.webIfc.SetWasmPath(t,i),await this.webIfc.Init(),n&&this.webIfc.SetLogLevel(n),this.webIfc.OpenModel(e,this.settings.webIfc)}async streamIfcFile(e){const{path:t,absolute:i,logLevel:n}=this.settings.wasm;this.webIfc.SetWasmPath(t,i),await this.webIfc.Init(),n&&this.webIfc.SetLogLevel(n),this.webIfc.OpenModelFromCallback(e,this.settings.webIfc)}async streamAllGeometries(){const{minGeometrySize:e,minAssetsSize:t}=this.settings;this._spatialTree.setUp(this.webIfc);const i=this.webIfc.GetIfcEntityList(0),n=[[]],r=new Cf,{FILE_NAME:o,FILE_DESCRIPTION:a}=ii;r.ifcMetadata={name:this._metaData.get(this.webIfc,o),description:this._metaData.get(this.webIfc,a),schema:this.webIfc.GetModelSchema(0)||"IFC2X3",maxExpressID:this.webIfc.GetMaxExpressID(0)};let l=0,h=0;for(const T of i){if(!this.webIfc.IsIfcElement(T)&&T!==Wn||this.settings.excludedCategories.has(T))continue;const S=this.webIfc.GetLineIDsWithType(0,T),_=S.size();console.log(_);for(let I=0;I<_;I++){l>e&&(l=0,h++,n.push([]));const P=S.get(I);n[h].push(P);const M=this._spatialTree.itemsByFloor[P]||0;r.data.set(P,[[],[M,T]]),l++}}this._spatialTree.cleanUp();let d=.01,p=0;for(const T of n){p++,this.webIfc.StreamMeshes(0,T,_=>{this.getMesh(this.webIfc,_,r)}),this._geometryCount>e&&await this.streamGeometries(),this._assets.length>t&&await this.streamAssets();const S=p/n.length;S>d&&(d+=.01,d=Math.max(d,S),this.onProgress.trigger(Math.round(d*100)/100))}this._geometryCount&&await this.streamGeometries(),this._assets.length&&await this.streamAssets();const{opaque:f,transparent:g}=r.geometryIDs;for(const[T,{index:S,uuid:_}]of this._visitedGeometries)r.keyFragments.set(S,_),(T>1?f:g).set(T,S);const y=r.data.keys();for(const T of y){const[S]=r.data.get(T);S.length||r.data.delete(T)}const b=this.webIfc.GetCoordinationMatrix(0);r.coordinationMatrix.fromArray(b),r.civilData=this._civil.read(this.webIfc);const w=this._groupSerializer.export(r);this.onIfcLoaded.trigger(w),r.dispose(!0)}cleanUp(){this.webIfc=null,this.webIfc=new tn,this._visitedGeometries.clear(),this._geometries.clear(),this._assets=[],this._meshesWithHoles.clear()}getMesh(e,t,i){const n=t.geometries.size(),r=t.expressID,o={id:r,geometries:[]};for(let a=0;an&&(n+=.01,n=Math.max(n,f),await this.onProgress.trigger(Math.round(n*100)/100))}const o=await this.components.get(ru).processFromWebIfc(this.webIfc,0);await this.onIndicesStreamed.trigger(o)}cleanUp(){this.webIfc=null,this.webIfc=new tn}}A(mE,"uuid","88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");const Em=class bm extends Re{constructor(e){super(e),A(this,"enabled",!0),e.add(bm.uuid,this)}getFace(e,t,i){if(!e.geometry.index)throw new Error("Geometry must be indexed!");const n=new Map,r=e.geometry.index.array,{plane:o}=this.getFaceData(t,i,e),a=[];for(let p=0;pI.id);if(!g.size){const I=l++;for(const{id:P}of f)h.set(P,I);d.set(I,{edges:new Set(y),indices:new Set([p])});continue}let b=null;const w=new Set,T=new Set(y);for(const[I,P]of g){b===null?b=P:P!==b&&w.add(P),h.delete(I);const{edges:M}=d.get(P);M.delete(I),T.delete(I)}if(b===null)throw new Error("Error computing face!");const S=d.get(b),{indices:_}=S;_.add(p);for(const I of T){h.set(I,b);const{edges:P}=S;P.add(I)}for(const I of w){const P=d.get(I),{edges:M,indices:k}=P,V=d.get(b),{edges:W,indices:j}=V;for(const Q of M)W.add(Q),h.set(Q,b);for(const Q of k)j.add(Q);d.delete(I)}}for(const[p,{indices:f,edges:g}]of d)if(f.has(t)){const y=[];for(const b of g){const w=n.get(b);y.push(w)}return{edges:y,indices:f}}return null}static distanceFromPointToLine(e,t,i,n=!1){const r=new Dt,o=new F;return r.set(t,i),r.closestPointToPoint(e,n,o),o.distanceTo(e)}getFaceData(e,t,i){const n=this.getVerticesAndNormal(i,e,t),{p1:r,p2:o,p3:a,faceNormal:l}=n;this.round(r),this.round(o),this.round(a),this.round(l);const h=[{id:`${r.x}|${r.y}|${r.z}`,value:r},{id:`${o.x}|${o.y}|${o.z}`,value:o},{id:`${a.x}|${a.y}|${a.z}`,value:a}];h.sort((S,_)=>S.id<_.id?-1:S.id>_.id?1:0);const[{id:d,value:p},{id:f,value:g},{id:y,value:b}]=h,w=[{id:`${d}|${f}`,distance:p.distanceTo(g),points:[p,g]},{id:`${f}|${y}`,distance:g.distanceTo(b),points:[g,b]},{id:`${d}|${y}`,distance:p.distanceTo(b),points:[p,b]}],T=new an;return T.setFromNormalAndCoplanarPoint(l,r),T.constant=Math.round(T.constant*10)/10,{plane:T,edges:w}}getVerticesAndNormal(e,t,i){if(!e.geometry.index)throw new Error("Geometry must be indexed!");const n=e.geometry.index.array,r=e.geometry.attributes.position.array,o=e.geometry.attributes.normal.array,a=n[t*3]*3,l=n[t*3+1]*3,h=n[t*3+2]*3,d=new F(r[a],r[a+1],r[a+2]),p=new F(r[l],r[l+1],r[l+2]),f=new F(r[h],r[h+1],r[h+2]),g=new F(o[a],o[a+1],o[a+2]),y=new F(o[l],o[l+1],o[l+2]),b=new F(o[h],o[h+1],o[h+2]),w=(g.x+y.x+b.x)/3,T=(g.y+y.y+b.y)/3,S=(g.z+y.z+b.z)/3,_=new F(w,T,S);if(!_.x&&!_.y&&!_.z&&console.log("hey"),i!==void 0&&e instanceof Kt){const I=new Ee;e.getMatrixAt(i,I);const P=new Ee;P.extractRotation(I),_.applyMatrix4(P),d.applyMatrix4(I),p.applyMatrix4(I),f.applyMatrix4(I)}return{p1:d,p2:p,p3:f,faceNormal:_}}round(e){e.x=Math.trunc(e.x*1e3)/1e3,e.y=Math.trunc(e.y*1e3)/1e3,e.z=Math.trunc(e.z*1e3)/1e3}};A(Em,"uuid","267ca032-672f-4cb0-afa9-d24e904f39d6");let ja=Em;const Qd=new Ke,ba=new F;class wm extends Nv{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(i),this.setAttribute("position",new Ps(e,3)),this.setAttribute("uv",new Ps(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,i=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),i.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const i=new Kc(t,6,1);return this.setAttribute("instanceStart",new xs(i,3,0)),this.setAttribute("instanceEnd",new xs(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const i=new Kc(t,6,1);return this.setAttribute("instanceColorStart",new xs(i,3,0)),this.setAttribute("instanceColorEnd",new xs(i,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new Uv(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ke);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),Qd.setFromBufferAttribute(t),this.boundingBox.union(Qd))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Gn),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const i=this.boundingSphere.center;this.boundingBox.getCenter(i);let n=0;for(let r=0,o=e.count;r{if(this.isProcessing)return;const r=n.data.colors;this._recentlyHiddenMeshes=new Set(this._currentVisibleMeshes),this._currentVisibleMeshes.clear();for(const[o,a]of r){if(a{this.isProcessing||await this.updateVisibility()},this.updateInterval),this.onViewUpdated.add(({seen:n,unseen:r})=>{for(const o of n)o.visible=!0;for(const o of r)o.visible=!1})}dispose(){super.dispose(),this._intervalID!==null&&(window.clearInterval(this._intervalID),this._intervalID=null),this._currentVisibleMeshes.clear(),this._recentlyHiddenMeshes.clear(),this._meshIDColorCodeMap.clear(),this._transparentMat.dispose(),this._colorCodeMeshMap.clear();const e=this.components.get(Fi);for(const t in this.colorMeshes){const i=this.colorMeshes.get(t);i&&e.destroy(i,!0)}this.colorMeshes.clear()}add(e){if(!this.enabled)return;if(this.isProcessing){console.log("Culler processing not finished yet.");return}this.isProcessing=!0;const t=e instanceof Kt,{geometry:i,material:n}=e,{colorMaterial:r,code:o}=this.getAvailableMaterial();let a;if(Array.isArray(n)){let d=!0;const p=[];for(const f of n)Fd.isTransparent(f)?p.push(this._transparentMat):(d=!1,p.push(r));if(d){r.dispose(),this.isProcessing=!1;return}a=p}else if(Fd.isTransparent(n)){r.dispose(),this.isProcessing=!1;return}else a=r;this._colorCodeMeshMap.set(o,e),this._meshIDColorCodeMap.set(e.uuid,o);const l=t?e.count:1,h=new Kt(i,a,l);t?h.instanceMatrix=e.instanceMatrix:h.setMatrixAt(0,new Ee),e.visible=!1,h.applyMatrix4(e.matrix),h.updateMatrix(),this.scene.add(h),this.colorMeshes.set(e.uuid,h),this.increaseColor(),this.isProcessing=!1}remove(e){if(this.isProcessing){console.log("Culler processing not finished yet.");return}this.isProcessing=!0;const t=this.components.get(Fi);this._currentVisibleMeshes.delete(e),this._recentlyHiddenMeshes.delete(e);const i=this.colorMeshes.get(e.uuid),n=this._meshIDColorCodeMap.get(e.uuid);if(!i||!n){this.isProcessing=!1,console.log(e.visible);return}this._colorCodeMeshMap.delete(n),this._meshIDColorCodeMap.delete(e.uuid),this.colorMeshes.delete(e.uuid),i.geometry=void 0,i.material=[],t.destroy(i,!0),this._recentlyHiddenMeshes.delete(e),this._currentVisibleMeshes.delete(e),this.isProcessing=!1}getAvailableMaterial(){const{r:e,g:t,b:i,code:n}=this.getAvailableColor(),r=Si.enabled;Si.enabled=!1;const o=new Rt(`rgb(${e}, ${t}, ${i})`);if(!this.world.renderer)throw new Error("Renderer not found in the world!");const a=this.world.renderer.clippingPlanes,l=new Xt({color:o,clippingPlanes:a,side:no});return Si.enabled=r,{colorMaterial:l,code:n}}}const Jf=class uh extends Re{constructor(e){super(e),A(this,"_enabled",!0),A(this,"list",new Map),A(this,"onDisposed",new ee),e.add(uh.uuid,this)}get enabled(){return this._enabled}set enabled(e){this._enabled=e;for(const[t,i]of this.list)i.enabled=e}create(e,t){if(this.list.has(e.uuid))return this.list.get(e.uuid);const i=new Q1(this.components,e,t);return this.list.set(e.uuid,i),i}delete(e){const t=this.list.get(e.uuid);t&&t.dispose(),this.list.delete(e.uuid)}dispose(){this.enabled=!1,this.onDisposed.trigger(uh.uuid),this.onDisposed.reset();for(const[e,t]of this.list)t.dispose();this.list.clear()}};A(Jf,"uuid","69f2a50d-c266-44fc-b1bd-fa4d34be89e6");let Z1=Jf;class q1{constructor(e){if(A(this,"onDisposed",new ee),A(this,"onAfterUpdate",new ee),A(this,"onBeforeUpdate",new ee),A(this,"onResize",new ee),A(this,"frontOffset",0),A(this,"overrideMaterial",new Tf),A(this,"backgroundColor",new Rt(395274)),A(this,"renderer"),A(this,"enabled",!0),A(this,"world"),A(this,"_lockRotation",!0),A(this,"_camera"),A(this,"_plane"),A(this,"_size",new Ve(320,160)),A(this,"_tempVector1",new O),A(this,"_tempVector2",new O),A(this,"_tempTarget",new O),A(this,"down",new O(0,-1,0)),A(this,"updatePlanes",()=>{if(!this.world.renderer)throw new Error("The given world must have a renderer!");const n=[],r=this.world.renderer.three;for(const o of r.clippingPlanes)n.push(o);n.push(this._plane),this.renderer.clippingPlanes=n}),this.world=e,!this.world.renderer)throw new Error("The given world must have a renderer!");this.renderer=new Ha,this.renderer.setSize(this._size.x,this._size.y);const t=1,i=this._size.x/this._size.y;this._camera=new jn(t*i/-2,t*i/2,t/2,t/-2),this.world.renderer.onClippingPlanesUpdated.add(this.updatePlanes),this._camera.position.set(0,200,0),this._camera.zoom=.1,this._camera.rotation.x=-Math.PI/2,this._plane=new an(this.down,200),this.updatePlanes()}get lockRotation(){return this._lockRotation}set lockRotation(e){this._lockRotation=e,e&&(this._camera.rotation.z=0)}get zoom(){return this._camera.zoom}set zoom(e){this._camera.zoom=e,this._camera.updateProjectionMatrix()}dispose(){this.enabled=!1,this.onBeforeUpdate.reset(),this.onAfterUpdate.reset(),this.onResize.reset(),this.overrideMaterial.dispose(),this.renderer.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}get(){return this._camera}update(){if(!this.enabled)return;this.onBeforeUpdate.trigger();const e=this.world.scene.three,t=this.world.camera;if(!t.hasCameraControls())throw new Error("The given world must use camera controls!");if(!(e instanceof Xn))throw new Error("The given world must have a THREE.Scene as a root!");const i=t.controls;if(i.getPosition(this._tempVector1),this._camera.position.x=this._tempVector1.x,this._camera.position.z=this._tempVector1.z,this.frontOffset!==0&&(i.getTarget(this._tempVector2),this._tempVector2.sub(this._tempVector1),this._tempVector2.normalize().multiplyScalar(this.frontOffset),this._camera.position.x+=this._tempVector2.x,this._camera.position.z+=this._tempVector2.z),!this._lockRotation){i.getTarget(this._tempTarget);const r=Math.atan2(this._tempTarget.x-this._tempVector1.x,this._tempTarget.z-this._tempVector1.z);this._camera.rotation.z=r+Math.PI}this._plane.set(this.down,this._tempVector1.y);const n=e.background;e.background=this.backgroundColor,this.renderer.render(e,this._camera),e.background=n,this.onAfterUpdate.trigger()}getSize(){return this._size}resize(e=this._size){this._size.copy(e),this.renderer.setSize(e.x,e.y);const t=e.x/e.y,i=1;this._camera.left=i*t/-2,this._camera.right=i*t/2,this._camera.top=i/2,this._camera.bottom=-i/2,this._camera.updateProjectionMatrix(),this.onResize.trigger(e)}}const J1=class $f extends Re{constructor(e){super(e),A(this,"onAfterUpdate",new ee),A(this,"onBeforeUpdate",new ee),A(this,"onDisposed",new ee),A(this,"enabled",!0),A(this,"list",new Map),this.components.add($f.uuid,this)}create(e){if(this.list.has(e.uuid))throw new Error("This world already has a minimap!");const t=new q1(e);return this.list.set(e.uuid,t),t}delete(e){const t=this.list.get(e);t&&t.dispose(),this.list.delete(e)}dispose(){for(const[e,t]of this.list)t.dispose();this.list.clear(),this.onDisposed.trigger()}update(){for(const[e,t]of this.list)t.update()}};A(J1,"uuid","39ad6aad-84c8-4adf-a1e0-7f25313a9e7f");class $1{constructor(e){A(this,"enabled",!1),A(this,"id","FirstPerson"),this.camera=e}set(e){if(this.enabled=e,e){if(this.camera.projection.current!=="Perspective"){this.camera.set("Orbit");return}this.setupFirstPersonCamera()}}setupFirstPersonCamera(){const e=this.camera.controls,t=new O;e.distance--,e.getPosition(t),e.minDistance=1,e.maxDistance=1,e.distance=1,e.moveTo(t.x,t.y,t.z),e.truckSpeed=50,e.mouseButtons.wheel=Mt.ACTION.DOLLY,e.touches.two=Mt.ACTION.TOUCH_ZOOM_TRUCK}}class eE{constructor(e){A(this,"enabled",!0),A(this,"id","Orbit"),this.camera=e,this.activateOrbitControls()}set(e){this.enabled=e,e&&this.activateOrbitControls()}activateOrbitControls(){const e=this.camera.controls;e.minDistance=1,e.maxDistance=300;const t=new O;e.getPosition(t);const i=t.length();e.distance=i,e.truckSpeed=2;const{rotation:n}=this.camera.three,r=new O(0,0,-1).applyEuler(n),o=t.addScaledVector(r,i);e.moveTo(o.x,o.y,o.z)}}class tE{constructor(e){A(this,"enabled",!1),A(this,"id","Plan"),A(this,"mouseAction1"),A(this,"mouseAction2"),A(this,"mouseInitialized",!1),A(this,"defaultAzimuthSpeed"),A(this,"defaultPolarSpeed"),this.camera=e,this.defaultAzimuthSpeed=e.controls.azimuthRotateSpeed,this.defaultPolarSpeed=e.controls.polarRotateSpeed}set(e){this.enabled=e;const t=this.camera.controls;t.azimuthRotateSpeed=e?0:this.defaultAzimuthSpeed,t.polarRotateSpeed=e?0:this.defaultPolarSpeed,this.mouseInitialized||(this.mouseAction1=t.touches.one,this.mouseAction2=t.touches.two,this.mouseInitialized=!0),e?(t.mouseButtons.left=Mt.ACTION.TRUCK,t.touches.one=Mt.ACTION.TOUCH_TRUCK,t.touches.two=Mt.ACTION.TOUCH_ZOOM):(t.mouseButtons.left=Mt.ACTION.ROTATE,t.touches.one=this.mouseAction1,t.touches.two=this.mouseAction2)}}class iE{constructor(e){A(this,"onChanged",new ee),A(this,"current","Perspective"),A(this,"camera"),A(this,"_component"),A(this,"_previousDistance",-1),A(this,"matchOrthoDistanceEnabled",!1),this._component=e,this.camera=e.three}async set(e){this.current!==e&&(e==="Orthographic"?this.setOrthoCamera():await this.setPerspectiveCamera(),this.onChanged.trigger(this.camera))}async toggle(){const e=this.current==="Perspective"?"Orthographic":"Perspective";await this.set(e)}setOrthoCamera(){if(this._component.mode===null||this._component.mode.id==="FirstPerson")return;this._previousDistance=this._component.controls.distance,this._component.controls.distance=200;const e=this.getPerspectiveDims();if(!e)return;const{width:t,height:i}=e;this.setupOrthoCamera(i,t),this.camera=this._component.threeOrtho,this.current="Orthographic"}getPerspectiveDims(){const e=this._component.currentWorld;if(!e||!e.renderer)return null;const t=new O;this._component.threePersp.getWorldDirection(t);const i=new O;this._component.controls.getTarget(i);const n=i.clone().sub(this._component.threePersp.position).dot(t),r=e.renderer.getSize(),o=r.x/r.y,a=this._component.threePersp,l=n*2*Math.atan(a.fov*(Math.PI/180)/2);return{width:l*o,height:l}}setupOrthoCamera(e,t){this._component.controls.mouseButtons.wheel=Mt.ACTION.ZOOM,this._component.controls.mouseButtons.middle=Mt.ACTION.ZOOM;const i=this._component.threePersp,n=this._component.threeOrtho;n.zoom=1,n.left=t/-2,n.right=t/2,n.top=e/2,n.bottom=e/-2,n.updateProjectionMatrix(),n.position.copy(i.position),n.quaternion.copy(i.quaternion),this._component.controls.camera=n}getDistance(){const e=this._component.threePersp,t=this._component.threeOrtho;return(t.top-t.bottom)/t.zoom/(2*Math.atan(e.fov*(Math.PI/180)/2))}async setPerspectiveCamera(){this._component.controls.mouseButtons.wheel=Mt.ACTION.DOLLY,this._component.controls.mouseButtons.middle=Mt.ACTION.DOLLY;const e=this._component.threePersp,t=this._component.threeOrtho;e.position.copy(t.position),e.quaternion.copy(t.quaternion),this._component.controls.mouseButtons.wheel=Mt.ACTION.DOLLY,this.matchOrthoDistanceEnabled?this._component.controls.distance=this.getDistance():this._component.controls.distance=this._previousDistance,await this._component.controls.zoomTo(1),e.updateProjectionMatrix(),this._component.controls.camera=e,this.camera=e,this.current="Perspective"}}class nE extends ch{constructor(e){super(e),A(this,"_mode",null),A(this,"projection"),A(this,"threeOrtho"),A(this,"threePersp"),A(this,"_userInputButtons",{}),A(this,"_frustumSize",50),A(this,"_navigationModes",new Map),A(this,"previousSize",null),this.threePersp=this.three,this.threeOrtho=this.newOrthoCamera(),this.projection=new iE(this),this.onAspectUpdated.add(()=>{this.setOrthoPerspCameraAspect()}),this.projection.onChanged.add(t=>{this.three=t,this.updateAspect()}),this.onWorldChanged.add(()=>{this._navigationModes.clear(),this._navigationModes.set("Orbit",new eE(this)),this._navigationModes.set("FirstPerson",new $1(this)),this._navigationModes.set("Plan",new tE(this)),this._mode=this._navigationModes.get("Orbit"),this.mode.set(!0,{preventTargetAdjustment:!0}),this.currentWorld&&this.currentWorld.renderer&&(this.previousSize=this.currentWorld.renderer.getSize().clone())})}get mode(){if(!this._mode)throw new Error("Mode not found, camera not initialized");return this._mode}dispose(){super.dispose(),this.threeOrtho.removeFromParent()}set(e){if(this.mode!==null&&this.mode.id!==e){if(this.mode.set(!1),!this._navigationModes.has(e))throw new Error("The specified mode does not exist!");this._mode=this._navigationModes.get(e),this.mode.set(!0)}}async fit(e,t=1.5){if(!this.enabled)return;const i=Number.MAX_VALUE,n=Number.MIN_VALUE,r=new O(i,i,i),o=new O(n,n,n);for(const f of e){const g=new Ke().setFromObject(f);g.min.xo.x&&(o.x=g.max.x),g.max.y>o.y&&(o.y=g.max.y),g.max.z>o.z&&(o.z=g.max.z)}const a=new Ke(r,o),l=new O;a.getSize(l);const h=new O;a.getCenter(h);const d=Math.max(l.x,l.y,l.z)*t,p=new Gn(h,d);await this.controls.fitToSphere(p,!0)}setUserInput(e){e?this.enableUserInput():this.disableUserInput()}disableUserInput(){this._userInputButtons.left=this.controls.mouseButtons.left,this._userInputButtons.right=this.controls.mouseButtons.right,this._userInputButtons.middle=this.controls.mouseButtons.middle,this._userInputButtons.wheel=this.controls.mouseButtons.wheel,this.controls.mouseButtons.left=0,this.controls.mouseButtons.right=0,this.controls.mouseButtons.middle=0,this.controls.mouseButtons.wheel=0}enableUserInput(){Object.keys(this._userInputButtons).length!==0&&(this.controls.mouseButtons.left=this._userInputButtons.left,this.controls.mouseButtons.right=this._userInputButtons.right,this.controls.mouseButtons.middle=this._userInputButtons.middle,this.controls.mouseButtons.wheel=this._userInputButtons.wheel)}newOrthoCamera(){const e=window.innerWidth/window.innerHeight;return new jn(this._frustumSize*e/-2,this._frustumSize*e/2,this._frustumSize/2,this._frustumSize/-2,.1,1e3)}setOrthoPerspCameraAspect(){if(!this.currentWorld||!this.currentWorld.renderer||!this.previousSize)return;const e=this.currentWorld.renderer.getSize(),t=this.threeOrtho.top,i=this.threeOrtho.right,n=e.y/this.previousSize.y,r=e.x/this.previousSize.x,o=t*n,a=i*r;this.threeOrtho.left=-a,this.threeOrtho.right=a,this.threeOrtho.top=o,this.threeOrtho.bottom=-o,this.threeOrtho.updateProjectionMatrix(),this.previousSize.copy(e)}}const em=class xi extends Re{constructor(e){super(e),A(this,"enabled",!0),A(this,"onDisposed",new ee),A(this,"_absoluteMin"),A(this,"_absoluteMax"),A(this,"_meshes",[]),this.components.add(xi.uuid,this),this._absoluteMin=xi.newBound(!0),this._absoluteMax=xi.newBound(!1)}static getDimensions(e){const{min:t,max:i}=e,n=Math.abs(i.x-t.x),r=Math.abs(i.y-t.y),o=Math.abs(i.z-t.z),a=new O;return a.subVectors(i,t).divideScalar(2).add(t),{width:n,height:r,depth:o,center:a}}static newBound(e){const t=e?1:-1;return new O(t*Number.MAX_VALUE,t*Number.MAX_VALUE,t*Number.MAX_VALUE)}static getBounds(e,t,i){const n=i||this.newBound(!1),r=t||this.newBound(!0);for(const o of e)o.xn.x&&(n.x=o.x),o.y>n.y&&(n.y=o.y),o.z>n.z&&(n.z=o.z);return new Ke(t,i)}dispose(){const e=this.components.get(Fi);for(const t of this._meshes)e.destroy(t);this._meshes=[],this.onDisposed.trigger(xi.uuid),this.onDisposed.reset()}get(){const e=this._absoluteMin.clone(),t=this._absoluteMax.clone();return new Ke(e,t)}getSphere(){const e=this._absoluteMin.clone(),t=this._absoluteMax.clone(),i=Math.abs((t.x-e.x)/2),n=Math.abs((t.y-e.y)/2),r=Math.abs((t.z-e.z)/2),o=new O(e.x+i,e.y+n,e.z+r),a=o.distanceTo(e);return new Gn(o,a)}getMesh(){const e=new Ke(this._absoluteMin,this._absoluteMax),t=xi.getDimensions(e),{width:i,height:n,depth:r,center:o}=t,a=new ut(i,n,r),l=new le(a);return this._meshes.push(l),l.position.copy(o),l}reset(){this._absoluteMin=xi.newBound(!0),this._absoluteMax=xi.newBound(!1)}add(e){for(const t of e.items)this.addMesh(t.mesh)}addMesh(e,t){if(!e.geometry.index)return;const i=xi.getFragmentBounds(e);e.updateMatrixWorld();const n=e.matrixWorld,r=new Ee,o=e instanceof Kt,a=new Set;if(t&&e instanceof yf)for(const l of t){const h=e.fragment.getInstancesIDs(l);if(h)for(const d of h)a.add(d)}else a.add(0);for(const l of a){const h=i.min.clone(),d=i.max.clone();o&&(e.getMatrixAt(l,r),h.applyMatrix4(r),d.applyMatrix4(r)),h.applyMatrix4(n),d.applyMatrix4(n),h.xthis._absoluteMax.x&&(this._absoluteMax.x=h.x),h.y>this._absoluteMax.y&&(this._absoluteMax.y=h.y),h.z>this._absoluteMax.z&&(this._absoluteMax.z=h.z),d.x>this._absoluteMax.x&&(this._absoluteMax.x=d.x),d.y>this._absoluteMax.y&&(this._absoluteMax.y=d.y),d.z>this._absoluteMax.z&&(this._absoluteMax.z=d.z),d.xo.x&&(o.x=d),p>o.y&&(o.y=p),f>o.z&&(o.z=f)}return new Ke(r,o)}};A(em,"uuid","d1444724-dba6-4cdd-a0c7-68ee1450d166");let tm=em;const su=new Set([1123145078,574549367,1675464909,2059837836,3798115385,32440307,3125803723,3207858831,2740243338,2624227202,4240577450,3615266464,3724593414,220341763,477187591,1878645084,1300840506,3303107099,1607154358,1878645084,846575682,1351298697,2417041796,3049322572,3331915920,1416205885,776857604,3285139300,3958052878,2827736869,2732653382,673634403,3448662350,4142052618,2924175390,803316827,2556980723,1809719519,2205249479,807026263,3737207727,1660063152,2347385850,3940055652,2705031697,3732776249,2485617015,2611217952,1704287377,2937912522,2770003689,1281925730,1484403080,3448662350,4142052618,3800577675,4006246654,3590301190,1383045692,2775532180,2047409740,370225590,3593883385,2665983363,4124623270,812098782,3649129432,987898635,1105321065,3510044353,1635779807,2603310189,3406155212,1310608509,4261334040,2736907675,3649129432,1136057603,1260505505,4182860854,2713105998,2898889636,59481748,3749851601,3486308946,3150382593,1062206242,3264961684,15328376,1485152156,370225590,1981873012,2859738748,45288368,2614616156,2732653382,775493141,2147822146,2601014836,2629017746,1186437898,2367409068,1213902940,3632507154,3900360178,476780140,1472233963,2804161546,3008276851,738692330,374418227,315944413,3905492369,3570813810,2571569899,178912537,2294589976,1437953363,2133299955,572779678,3092502836,388784114,2624227202,1425443689,3057273783,2347385850,1682466193,2519244187,2839578677,3958567839,2513912981,2830218821,427810014]),im=class nm extends Re{constructor(e){super(e),A(this,"enabled",!0),e.add(nm.uuid,this)}async export(e,t,i=!1,n=!0){const r={},o=new Set(e.GetIfcEntityList(t)),a=new Set([pl,Zh,qh,dl,Wn]);for(const l of a)o.add(l);for(const l of o){if(su.has(l))continue;const h=a.has(l)&&n,d=e.GetLineIDsWithType(t,l);for(const p of d){const f=e.GetLine(0,p,h,i);r[f.expressID]=f}}return r}};A(im,"uuid","b32c4332-cd67-436e-ba7f-196646c7a635");let sE=im;const sm=class rm extends Re{constructor(e){super(e),A(this,"onDisposed",new ee),A(this,"onFragmentsLoaded",new ee),A(this,"onFragmentsDisposed",new ee),A(this,"list",new Map),A(this,"groups",new Map),A(this,"enabled",!0),A(this,"baseCoordinationModel",""),A(this,"_loader",new Ef),this.components.add(rm.uuid,this)}get meshes(){const e=[];for(const[t,i]of this.list)e.push(i.mesh);return e}dispose(){for(const[e,t]of this.groups)t.dispose(!0);this.baseCoordinationModel="",this.groups.clear(),this.list.clear(),this.onFragmentsLoaded.reset(),this.onFragmentsDisposed.reset(),this.onDisposed.trigger(),this.onDisposed.reset()}disposeGroup(e){const{uuid:t}=e,i=[];for(const n of e.items)i.push(n.id),this.list.delete(n.id);e.dispose(!0),this.groups.delete(e.uuid),this.onFragmentsDisposed.trigger({groupID:t,fragmentIDs:i})}load(e,t){const i={coordinate:!0,...t},{coordinate:n,properties:r,relationsMap:o}=i,a=this._loader.import(e);for(const l of a.items)l.group=a,this.list.set(l.id,l);return n&&this.coordinate([a]),this.groups.set(a.uuid,a),r&&a.setLocalProperties(r),o&&this.components.get(gl).setRelationMap(a,o),this.onFragmentsLoaded.trigger(a),a}export(e){return this._loader.export(e)}coordinate(e=Array.from(this.groups.values())){if(this.baseCoordinationModel.length===0){const i=e.pop();if(!i)return;this.baseCoordinationModel=i.uuid}if(!e.length)return;const t=this.groups.get(this.baseCoordinationModel);if(!t){console.log("No base model found for coordination!");return}for(const i of e)i!==t&&(i.position.set(0,0,0),i.rotation.set(0,0,0),i.scale.set(1,1,1),i.updateMatrix(),i.applyMatrix4(i.coordinationMatrix.clone().invert()),i.applyMatrix4(t.coordinationMatrix))}};A(sm,"uuid","fef46874-46a3-461b-8c44-2922ab77c806");let rt=sm;const om={950732822:"IFCURIREFERENCE",4075327185:"IFCTIME",1209108979:"IFCTEMPERATURERATEOFCHANGEMEASURE",3457685358:"IFCSOUNDPRESSURELEVELMEASURE",4157543285:"IFCSOUNDPOWERLEVELMEASURE",2798247006:"IFCPROPERTYSETDEFINITIONSET",1790229001:"IFCPOSITIVEINTEGER",525895558:"IFCNONNEGATIVELENGTHMEASURE",1774176899:"IFCLINEINDEX",1275358634:"IFCLANGUAGEID",2541165894:"IFCDURATION",3701338814:"IFCDAYINWEEKNUMBER",2195413836:"IFCDATETIME",937566702:"IFCDATE",1683019596:"IFCCARDINALPOINTREFERENCE",2314439260:"IFCBINARY",1500781891:"IFCAREADENSITYMEASURE",3683503648:"IFCARCINDEX",4065007721:"IFCYEARNUMBER",1718600412:"IFCWARPINGMOMENTMEASURE",51269191:"IFCWARPINGCONSTANTMEASURE",2593997549:"IFCVOLUMETRICFLOWRATEMEASURE",3458127941:"IFCVOLUMEMEASURE",3345633955:"IFCVAPORPERMEABILITYMEASURE",1278329552:"IFCTORQUEMEASURE",2591213694:"IFCTIMESTAMP",2726807636:"IFCTIMEMEASURE",743184107:"IFCTHERMODYNAMICTEMPERATUREMEASURE",2016195849:"IFCTHERMALTRANSMITTANCEMEASURE",857959152:"IFCTHERMALRESISTANCEMEASURE",2281867870:"IFCTHERMALEXPANSIONCOEFFICIENTMEASURE",2645777649:"IFCTHERMALCONDUCTIVITYMEASURE",232962298:"IFCTHERMALADMITTANCEMEASURE",296282323:"IFCTEXTTRANSFORMATION",603696268:"IFCTEXTFONTNAME",3490877962:"IFCTEXTDECORATION",1460886941:"IFCTEXTALIGNMENT",2801250643:"IFCTEXT",58845555:"IFCTEMPERATUREGRADIENTMEASURE",361837227:"IFCSPECULARROUGHNESS",2757832317:"IFCSPECULAREXPONENT",3477203348:"IFCSPECIFICHEATCAPACITYMEASURE",993287707:"IFCSOUNDPRESSUREMEASURE",846465480:"IFCSOUNDPOWERMEASURE",3471399674:"IFCSOLIDANGLEMEASURE",408310005:"IFCSHEARMODULUSMEASURE",2190458107:"IFCSECTIONALAREAINTEGRALMEASURE",3467162246:"IFCSECTIONMODULUSMEASURE",2766185779:"IFCSECONDINMINUTE",3211557302:"IFCROTATIONALSTIFFNESSMEASURE",1755127002:"IFCROTATIONALMASSMEASURE",2133746277:"IFCROTATIONALFREQUENCYMEASURE",200335297:"IFCREAL",96294661:"IFCRATIOMEASURE",3972513137:"IFCRADIOACTIVITYMEASURE",3665567075:"IFCPRESSUREMEASURE",2169031380:"IFCPRESENTABLETEXT",1364037233:"IFCPOWERMEASURE",1245737093:"IFCPOSITIVERATIOMEASURE",3054510233:"IFCPOSITIVEPLANEANGLEMEASURE",2815919920:"IFCPOSITIVELENGTHMEASURE",4042175685:"IFCPLANEANGLEMEASURE",2642773653:"IFCPLANARFORCEMEASURE",2260317790:"IFCPARAMETERVALUE",929793134:"IFCPHMEASURE",2395907400:"IFCNUMERICMEASURE",2095195183:"IFCNORMALISEDRATIOMEASURE",765770214:"IFCMONTHINYEARNUMBER",2615040989:"IFCMONETARYMEASURE",3114022597:"IFCMOMENTOFINERTIAMEASURE",1648970520:"IFCMOLECULARWEIGHTMEASURE",3177669450:"IFCMOISTUREDIFFUSIVITYMEASURE",1753493141:"IFCMODULUSOFSUBGRADEREACTIONMEASURE",1052454078:"IFCMODULUSOFROTATIONALSUBGRADEREACTIONMEASURE",2173214787:"IFCMODULUSOFLINEARSUBGRADEREACTIONMEASURE",3341486342:"IFCMODULUSOFELASTICITYMEASURE",102610177:"IFCMINUTEINHOUR",3531705166:"IFCMASSPERLENGTHMEASURE",3124614049:"IFCMASSMEASURE",4017473158:"IFCMASSFLOWRATEMEASURE",1477762836:"IFCMASSDENSITYMEASURE",2486716878:"IFCMAGNETICFLUXMEASURE",286949696:"IFCMAGNETICFLUXDENSITYMEASURE",151039812:"IFCLUMINOUSINTENSITYMEASURE",2755797622:"IFCLUMINOUSINTENSITYDISTRIBUTIONMEASURE",2095003142:"IFCLUMINOUSFLUXMEASURE",503418787:"IFCLOGICAL",3086160713:"IFCLINEARVELOCITYMEASURE",1307019551:"IFCLINEARSTIFFNESSMEASURE",2128979029:"IFCLINEARMOMENTMEASURE",191860431:"IFCLINEARFORCEMEASURE",1243674935:"IFCLENGTHMEASURE",3258342251:"IFCLABEL",2054016361:"IFCKINEMATICVISCOSITYMEASURE",3192672207:"IFCISOTHERMALMOISTURECAPACITYMEASURE",3686016028:"IFCIONCONCENTRATIONMEASURE",3809634241:"IFCINTEGERCOUNTRATEMEASURE",1939436016:"IFCINTEGER",2679005408:"IFCINDUCTANCEMEASURE",3358199106:"IFCILLUMINANCEMEASURE",983778844:"IFCIDENTIFIER",2589826445:"IFCHOURINDAY",1158859006:"IFCHEATINGVALUEMEASURE",3113092358:"IFCHEATFLUXDENSITYMEASURE",3064340077:"IFCGLOBALLYUNIQUEID",3044325142:"IFCFREQUENCYMEASURE",1361398929:"IFCFORCEMEASURE",2590844177:"IFCFONTWEIGHT",2715512545:"IFCFONTVARIANT",1102727119:"IFCFONTSTYLE",2078135608:"IFCENERGYMEASURE",2506197118:"IFCELECTRICVOLTAGEMEASURE",2951915441:"IFCELECTRICRESISTANCEMEASURE",3790457270:"IFCELECTRICCURRENTMEASURE",2093906313:"IFCELECTRICCONDUCTANCEMEASURE",3818826038:"IFCELECTRICCHARGEMEASURE",1827137117:"IFCELECTRICCAPACITANCEMEASURE",69416015:"IFCDYNAMICVISCOSITYMEASURE",524656162:"IFCDOSEEQUIVALENTMEASURE",4134073009:"IFCDIMENSIONCOUNT",1514641115:"IFCDESCRIPTIVEMEASURE",300323983:"IFCDAYLIGHTSAVINGHOUR",86635668:"IFCDAYINMONTHNUMBER",94842927:"IFCCURVATUREMEASURE",1778710042:"IFCCOUNTMEASURE",3238673880:"IFCCONTEXTDEPENDENTMEASURE",3812528620:"IFCCOMPOUNDPLANEANGLEMEASURE",2991860651:"IFCCOMPLEXNUMBER",1867003952:"IFCBOXALIGNMENT",2735952531:"IFCBOOLEAN",2650437152:"IFCAREAMEASURE",632304761:"IFCANGULARVELOCITYMEASURE",360377573:"IFCAMOUNTOFSUBSTANCEMEASURE",4182062534:"IFCACCELERATIONMEASURE",3699917729:"IFCABSORBEDDOSEMEASURE",1971632696:"IFCGEOSLICE",2680139844:"IFCGEOMODEL",24726584:"IFCELECTRICFLOWTREATMENTDEVICE",3693000487:"IFCDISTRIBUTIONBOARD",3460952963:"IFCCONVEYORSEGMENT",3999819293:"IFCCAISSONFOUNDATION",3314249567:"IFCBOREHOLE",4196446775:"IFCBEARING",325726236:"IFCALIGNMENT",3425753595:"IFCTRACKELEMENT",991950508:"IFCSIGNAL",3798194928:"IFCREINFORCEDSOIL",3290496277:"IFCRAIL",1383356374:"IFCPAVEMENT",2182337498:"IFCNAVIGATIONELEMENT",234836483:"IFCMOORINGDEVICE",2078563270:"IFCMOBILETELECOMMUNICATIONSAPPLIANCE",1638804497:"IFCLIQUIDTERMINAL",1154579445:"IFCLINEARPOSITIONINGELEMENT",2696325953:"IFCKERB",2713699986:"IFCGEOTECHNICALASSEMBLY",2142170206:"IFCELECTRICFLOWTREATMENTDEVICETYPE",3376911765:"IFCEARTHWORKSFILL",1077100507:"IFCEARTHWORKSELEMENT",3071239417:"IFCEARTHWORKSCUT",479945903:"IFCDISTRIBUTIONBOARDTYPE",3426335179:"IFCDEEPFOUNDATION",1502416096:"IFCCOURSE",2940368186:"IFCCONVEYORSEGMENTTYPE",3203706013:"IFCCAISSONFOUNDATIONTYPE",3862327254:"IFCBUILTSYSTEM",1876633798:"IFCBUILTELEMENT",963979645:"IFCBRIDGEPART",644574406:"IFCBRIDGE",3649138523:"IFCBEARINGTYPE",1662888072:"IFCALIGNMENTVERTICAL",317615605:"IFCALIGNMENTSEGMENT",1545765605:"IFCALIGNMENTHORIZONTAL",4266260250:"IFCALIGNMENTCANT",3956297820:"IFCVIBRATIONDAMPERTYPE",1530820697:"IFCVIBRATIONDAMPER",840318589:"IFCVEHICLE",1953115116:"IFCTRANSPORTATIONDEVICE",618700268:"IFCTRACKELEMENTTYPE",2281632017:"IFCTENDONCONDUITTYPE",3663046924:"IFCTENDONCONDUIT",42703149:"IFCSINESPIRAL",1894708472:"IFCSIGNALTYPE",3599934289:"IFCSIGNTYPE",33720170:"IFCSIGN",1027922057:"IFCSEVENTHORDERPOLYNOMIALSPIRAL",544395925:"IFCSEGMENTEDREFERENCECURVE",3649235739:"IFCSECONDORDERPOLYNOMIALSPIRAL",550521510:"IFCROADPART",146592293:"IFCROAD",3818125796:"IFCRELADHERESTOELEMENT",4021432810:"IFCREFERENT",1891881377:"IFCRAILWAYPART",3992365140:"IFCRAILWAY",1763565496:"IFCRAILTYPE",1946335990:"IFCPOSITIONINGELEMENT",514975943:"IFCPAVEMENTTYPE",506776471:"IFCNAVIGATIONELEMENTTYPE",710110818:"IFCMOORINGDEVICETYPE",1950438474:"IFCMOBILETELECOMMUNICATIONSAPPLIANCETYPE",976884017:"IFCMARINEPART",525669439:"IFCMARINEFACILITY",1770583370:"IFCLIQUIDTERMINALTYPE",2176059722:"IFCLINEARELEMENT",679976338:"IFCKERBTYPE",3948183225:"IFCIMPACTPROTECTIONDEVICETYPE",2568555532:"IFCIMPACTPROTECTIONDEVICE",2898700619:"IFCGRADIENTCURVE",1594536857:"IFCGEOTECHNICALSTRATUM",4230923436:"IFCGEOTECHNICALELEMENT",4228831410:"IFCFACILITYPARTCOMMON",1310830890:"IFCFACILITYPART",24185140:"IFCFACILITY",4234616927:"IFCDIRECTRIXDERIVEDREFERENCESWEPTAREASOLID",1306400036:"IFCDEEPFOUNDATIONTYPE",4189326743:"IFCCOURSETYPE",2000195564:"IFCCOSINESPIRAL",3497074424:"IFCCLOTHOID",1626504194:"IFCBUILTELEMENTTYPE",3651464721:"IFCVEHICLETYPE",1229763772:"IFCTRIANGULATEDIRREGULARNETWORK",3665877780:"IFCTRANSPORTATIONDEVICETYPE",782932809:"IFCTHIRDORDERPOLYNOMIALSPIRAL",2735484536:"IFCSPIRAL",1356537516:"IFCSECTIONEDSURFACE",1290935644:"IFCSECTIONEDSOLIDHORIZONTAL",1862484736:"IFCSECTIONEDSOLID",1441486842:"IFCRELPOSITIONS",1033248425:"IFCRELASSOCIATESPROFILEDEF",3381221214:"IFCPOLYNOMIALCURVE",2485787929:"IFCOFFSETCURVEBYDISTANCES",590820931:"IFCOFFSETCURVE",3465909080:"IFCINDEXEDPOLYGONALTEXTUREMAP",593015953:"IFCDIRECTRIXCURVESWEPTAREASOLID",4212018352:"IFCCURVESEGMENT",3425423356:"IFCAXIS2PLACEMENTLINEAR",823603102:"IFCSEGMENT",2165702409:"IFCPOINTBYDISTANCEEXPRESSION",182550632:"IFCOPENCROSSPROFILEDEF",388784114:"IFCLINEARPLACEMENT",536804194:"IFCALIGNMENTHORIZONTALSEGMENT",3752311538:"IFCALIGNMENTCANTSEGMENT",1010789467:"IFCTEXTURECOORDINATEINDICESWITHVOIDS",222769930:"IFCTEXTURECOORDINATEINDICES",2691318326:"IFCQUANTITYNUMBER",3633395639:"IFCALIGNMENTVERTICALSEGMENT",2879124712:"IFCALIGNMENTPARAMETERSEGMENT",25142252:"IFCCONTROLLER",3087945054:"IFCALARM",4288193352:"IFCACTUATOR",630975310:"IFCUNITARYCONTROLELEMENT",4086658281:"IFCSENSOR",2295281155:"IFCPROTECTIVEDEVICETRIPPINGUNIT",182646315:"IFCFLOWINSTRUMENT",1426591983:"IFCFIRESUPPRESSIONTERMINAL",819412036:"IFCFILTER",3415622556:"IFCFAN",1003880860:"IFCELECTRICTIMECONTROL",402227799:"IFCELECTRICMOTOR",264262732:"IFCELECTRICGENERATOR",3310460725:"IFCELECTRICFLOWSTORAGEDEVICE",862014818:"IFCELECTRICDISTRIBUTIONBOARD",1904799276:"IFCELECTRICAPPLIANCE",1360408905:"IFCDUCTSILENCER",3518393246:"IFCDUCTSEGMENT",342316401:"IFCDUCTFITTING",562808652:"IFCDISTRIBUTIONCIRCUIT",4074379575:"IFCDAMPER",3640358203:"IFCCOOLINGTOWER",4136498852:"IFCCOOLEDBEAM",2272882330:"IFCCONDENSER",3571504051:"IFCCOMPRESSOR",3221913625:"IFCCOMMUNICATIONSAPPLIANCE",639361253:"IFCCOIL",3902619387:"IFCCHILLER",4217484030:"IFCCABLESEGMENT",1051757585:"IFCCABLEFITTING",3758799889:"IFCCABLECARRIERSEGMENT",635142910:"IFCCABLECARRIERFITTING",2938176219:"IFCBURNER",32344328:"IFCBOILER",2906023776:"IFCBEAMSTANDARDCASE",277319702:"IFCAUDIOVISUALAPPLIANCE",2056796094:"IFCAIRTOAIRHEATRECOVERY",177149247:"IFCAIRTERMINALBOX",1634111441:"IFCAIRTERMINAL",486154966:"IFCWINDOWSTANDARDCASE",4237592921:"IFCWASTETERMINAL",4156078855:"IFCWALLELEMENTEDCASE",4207607924:"IFCVALVE",4292641817:"IFCUNITARYEQUIPMENT",3179687236:"IFCUNITARYCONTROLELEMENTTYPE",3026737570:"IFCTUBEBUNDLE",3825984169:"IFCTRANSFORMER",812556717:"IFCTANK",1162798199:"IFCSWITCHINGDEVICE",385403989:"IFCSTRUCTURALLOADCASE",1404847402:"IFCSTACKTERMINAL",1999602285:"IFCSPACEHEATER",3420628829:"IFCSOLARDEVICE",3027962421:"IFCSLABSTANDARDCASE",3127900445:"IFCSLABELEMENTEDCASE",1329646415:"IFCSHADINGDEVICE",3053780830:"IFCSANITARYTERMINAL",2572171363:"IFCREINFORCINGBARTYPE",1232101972:"IFCRATIONALBSPLINECURVEWITHKNOTS",90941305:"IFCPUMP",655969474:"IFCPROTECTIVEDEVICETRIPPINGUNITTYPE",738039164:"IFCPROTECTIVEDEVICE",1156407060:"IFCPLATESTANDARDCASE",3612865200:"IFCPIPESEGMENT",310824031:"IFCPIPEFITTING",3694346114:"IFCOUTLET",144952367:"IFCOUTERBOUNDARYCURVE",2474470126:"IFCMOTORCONNECTION",1911478936:"IFCMEMBERSTANDARDCASE",1437502449:"IFCMEDICALDEVICE",629592764:"IFCLIGHTFIXTURE",76236018:"IFCLAMP",2176052936:"IFCJUNCTIONBOX",4175244083:"IFCINTERCEPTOR",2068733104:"IFCHUMIDIFIER",3319311131:"IFCHEATEXCHANGER",2188021234:"IFCFLOWMETER",1209101575:"IFCEXTERNALSPATIALELEMENT",484807127:"IFCEVAPORATOR",3747195512:"IFCEVAPORATIVECOOLER",2814081492:"IFCENGINE",2417008758:"IFCELECTRICDISTRIBUTIONBOARDTYPE",3242481149:"IFCDOORSTANDARDCASE",3205830791:"IFCDISTRIBUTIONSYSTEM",400855858:"IFCCOMMUNICATIONSAPPLIANCETYPE",905975707:"IFCCOLUMNSTANDARDCASE",1677625105:"IFCCIVILELEMENT",3296154744:"IFCCHIMNEY",2674252688:"IFCCABLEFITTINGTYPE",2188180465:"IFCBURNERTYPE",1177604601:"IFCBUILDINGSYSTEM",39481116:"IFCBUILDINGELEMENTPARTTYPE",1136057603:"IFCBOUNDARYCURVE",2461110595:"IFCBSPLINECURVEWITHKNOTS",1532957894:"IFCAUDIOVISUALAPPLIANCETYPE",4088093105:"IFCWORKCALENDAR",4009809668:"IFCWINDOWTYPE",926996030:"IFCVOIDINGFEATURE",2391383451:"IFCVIBRATIONISOLATOR",2415094496:"IFCTENDONTYPE",3081323446:"IFCTENDONANCHORTYPE",413509423:"IFCSYSTEMFURNITUREELEMENT",3101698114:"IFCSURFACEFEATURE",3657597509:"IFCSTRUCTURALSURFACEACTION",2757150158:"IFCSTRUCTURALCURVEREACTION",1004757350:"IFCSTRUCTURALCURVEACTION",338393293:"IFCSTAIRTYPE",1072016465:"IFCSOLARDEVICETYPE",4074543187:"IFCSHADINGDEVICETYPE",2157484638:"IFCSEAMCURVE",2781568857:"IFCROOFTYPE",2310774935:"IFCREINFORCINGMESHTYPE",964333572:"IFCREINFORCINGELEMENTTYPE",683857671:"IFCRATIONALBSPLINESURFACEWITHKNOTS",1469900589:"IFCRAMPTYPE",2839578677:"IFCPOLYGONALFACESET",1158309216:"IFCPILETYPE",3079942009:"IFCOPENINGSTANDARDCASE",1114901282:"IFCMEDICALDEVICETYPE",3113134337:"IFCINTERSECTIONCURVE",3946677679:"IFCINTERCEPTORTYPE",2571569899:"IFCINDEXEDPOLYCURVE",3493046030:"IFCGEOGRAPHICELEMENT",1509553395:"IFCFURNITURE",1893162501:"IFCFOOTINGTYPE",2853485674:"IFCEXTERNALSPATIALSTRUCTUREELEMENT",4148101412:"IFCEVENT",132023988:"IFCENGINETYPE",2397081782:"IFCELEMENTASSEMBLYTYPE",2323601079:"IFCDOORTYPE",1213902940:"IFCCYLINDRICALSURFACE",1525564444:"IFCCONSTRUCTIONPRODUCTRESOURCETYPE",4105962743:"IFCCONSTRUCTIONMATERIALRESOURCETYPE",2185764099:"IFCCONSTRUCTIONEQUIPMENTRESOURCETYPE",15328376:"IFCCOMPOSITECURVEONSURFACE",3875453745:"IFCCOMPLEXPROPERTYTEMPLATE",3893394355:"IFCCIVILELEMENTTYPE",2197970202:"IFCCHIMNEYTYPE",167062518:"IFCBSPLINESURFACEWITHKNOTS",2887950389:"IFCBSPLINESURFACE",2603310189:"IFCADVANCEDBREPWITHVOIDS",1635779807:"IFCADVANCEDBREP",2916149573:"IFCTRIANGULATEDFACESET",1935646853:"IFCTOROIDALSURFACE",2387106220:"IFCTESSELLATEDFACESET",3206491090:"IFCTASKTYPE",699246055:"IFCSURFACECURVE",4095615324:"IFCSUBCONTRACTRESOURCETYPE",603775116:"IFCSTRUCTURALSURFACEREACTION",4015995234:"IFCSPHERICALSURFACE",2481509218:"IFCSPATIALZONETYPE",463610769:"IFCSPATIALZONE",710998568:"IFCSPATIALELEMENTTYPE",1412071761:"IFCSPATIALELEMENT",3663146110:"IFCSIMPLEPROPERTYTEMPLATE",3243963512:"IFCREVOLVEDAREASOLIDTAPERED",816062949:"IFCREPARAMETRISEDCOMPOSITECURVESEGMENT",1521410863:"IFCRELSPACEBOUNDARY2NDLEVEL",3523091289:"IFCRELSPACEBOUNDARY1STLEVEL",427948657:"IFCRELINTERFERESELEMENTS",307848117:"IFCRELDEFINESBYTEMPLATE",1462361463:"IFCRELDEFINESBYOBJECT",2565941209:"IFCRELDECLARES",1027710054:"IFCRELASSIGNSTOGROUPBYFACTOR",3521284610:"IFCPROPERTYTEMPLATE",492091185:"IFCPROPERTYSETTEMPLATE",653396225:"IFCPROJECTLIBRARY",569719735:"IFCPROCEDURETYPE",3967405729:"IFCPREDEFINEDPROPERTYSET",1682466193:"IFCPCURVE",428585644:"IFCLABORRESOURCETYPE",2294589976:"IFCINDEXEDPOLYGONALFACEWITHVOIDS",178912537:"IFCINDEXEDPOLYGONALFACE",4095422895:"IFCGEOGRAPHICELEMENTTYPE",2652556860:"IFCFIXEDREFERENCESWEPTAREASOLID",2804161546:"IFCEXTRUDEDAREASOLIDTAPERED",4024345920:"IFCEVENTTYPE",2629017746:"IFCCURVEBOUNDEDSURFACE",1815067380:"IFCCREWRESOURCETYPE",3419103109:"IFCCONTEXT",2574617495:"IFCCONSTRUCTIONRESOURCETYPE",2059837836:"IFCCARTESIANPOINTLIST3D",1675464909:"IFCCARTESIANPOINTLIST2D",574549367:"IFCCARTESIANPOINTLIST",3406155212:"IFCADVANCEDFACE",3698973494:"IFCTYPERESOURCE",3736923433:"IFCTYPEPROCESS",901063453:"IFCTESSELLATEDITEM",1096409881:"IFCSWEPTDISKSOLIDPOLYGONAL",1042787934:"IFCRESOURCETIME",1608871552:"IFCRESOURCECONSTRAINTRELATIONSHIP",2943643501:"IFCRESOURCEAPPROVALRELATIONSHIP",2090586900:"IFCQUANTITYSET",1482703590:"IFCPROPERTYTEMPLATEDEFINITION",3778827333:"IFCPREDEFINEDPROPERTIES",2998442950:"IFCMIRROREDPROFILEDEF",853536259:"IFCMATERIALRELATIONSHIP",3404854881:"IFCMATERIALPROFILESETUSAGETAPERING",3079605661:"IFCMATERIALPROFILESETUSAGE",2852063980:"IFCMATERIALCONSTITUENTSET",3708119e3:"IFCMATERIALCONSTITUENT",1585845231:"IFCLAGTIME",2133299955:"IFCINDEXEDTRIANGLETEXTUREMAP",1437953363:"IFCINDEXEDTEXTUREMAP",3570813810:"IFCINDEXEDCOLOURMAP",1437805879:"IFCEXTERNALREFERENCERELATIONSHIP",297599258:"IFCEXTENDEDPROPERTIES",211053100:"IFCEVENTTIME",2713554722:"IFCCONVERSIONBASEDUNITWITHOFFSET",3285139300:"IFCCOLOURRGBLIST",1236880293:"IFCWORKTIME",1199560280:"IFCTIMEPERIOD",3611470254:"IFCTEXTUREVERTEXLIST",2771591690:"IFCTASKTIMERECURRING",1549132990:"IFCTASKTIME",2043862942:"IFCTABLECOLUMN",2934153892:"IFCSURFACEREINFORCEMENTAREA",609421318:"IFCSTRUCTURALLOADORRESULT",3478079324:"IFCSTRUCTURALLOADCONFIGURATION",1054537805:"IFCSCHEDULINGTIME",2439245199:"IFCRESOURCELEVELRELATIONSHIP",2433181523:"IFCREFERENCE",3915482550:"IFCRECURRENCEPATTERN",986844984:"IFCPROPERTYABSTRACTION",3843373140:"IFCPROJECTEDCRS",677532197:"IFCPRESENTATIONITEM",1507914824:"IFCMATERIALUSAGEDEFINITION",552965576:"IFCMATERIALPROFILEWITHOFFSETS",164193824:"IFCMATERIALPROFILESET",2235152071:"IFCMATERIALPROFILE",1847252529:"IFCMATERIALLAYERWITHOFFSETS",760658860:"IFCMATERIALDEFINITION",3057273783:"IFCMAPCONVERSION",4294318154:"IFCEXTERNALINFORMATION",1466758467:"IFCCOORDINATEREFERENCESYSTEM",1785450214:"IFCCOORDINATEOPERATION",775493141:"IFCCONNECTIONVOLUMEGEOMETRY",979691226:"IFCREINFORCINGBAR",3700593921:"IFCELECTRICDISTRIBUTIONPOINT",1062813311:"IFCDISTRIBUTIONCONTROLELEMENT",1052013943:"IFCDISTRIBUTIONCHAMBERELEMENT",578613899:"IFCCONTROLLERTYPE",2454782716:"IFCCHAMFEREDGEFEATURE",753842376:"IFCBEAM",3001207471:"IFCALARMTYPE",2874132201:"IFCACTUATORTYPE",3304561284:"IFCWINDOW",3512223829:"IFCWALLSTANDARDCASE",2391406946:"IFCWALL",3313531582:"IFCVIBRATIONISOLATORTYPE",2347447852:"IFCTENDONANCHOR",3824725483:"IFCTENDON",2515109513:"IFCSTRUCTURALANALYSISMODEL",4252922144:"IFCSTAIRFLIGHT",331165859:"IFCSTAIR",1529196076:"IFCSLAB",1783015770:"IFCSENSORTYPE",1376911519:"IFCROUNDEDEDGEFEATURE",2016517767:"IFCROOF",2320036040:"IFCREINFORCINGMESH",3027567501:"IFCREINFORCINGELEMENT",3055160366:"IFCRATIONALBEZIERCURVE",3283111854:"IFCRAMPFLIGHT",3024970846:"IFCRAMP",2262370178:"IFCRAILING",3171933400:"IFCPLATE",1687234759:"IFCPILE",1073191201:"IFCMEMBER",900683007:"IFCFOOTING",3508470533:"IFCFLOWTREATMENTDEVICE",2223149337:"IFCFLOWTERMINAL",707683696:"IFCFLOWSTORAGEDEVICE",987401354:"IFCFLOWSEGMENT",3132237377:"IFCFLOWMOVINGDEVICE",4037862832:"IFCFLOWINSTRUMENTTYPE",4278956645:"IFCFLOWFITTING",2058353004:"IFCFLOWCONTROLLER",4222183408:"IFCFIRESUPPRESSIONTERMINALTYPE",1810631287:"IFCFILTERTYPE",346874300:"IFCFANTYPE",1658829314:"IFCENERGYCONVERSIONDEVICE",857184966:"IFCELECTRICALELEMENT",1634875225:"IFCELECTRICALCIRCUIT",712377611:"IFCELECTRICTIMECONTROLTYPE",1217240411:"IFCELECTRICMOTORTYPE",1365060375:"IFCELECTRICHEATERTYPE",1534661035:"IFCELECTRICGENERATORTYPE",3277789161:"IFCELECTRICFLOWSTORAGEDEVICETYPE",663422040:"IFCELECTRICAPPLIANCETYPE",855621170:"IFCEDGEFEATURE",2030761528:"IFCDUCTSILENCERTYPE",3760055223:"IFCDUCTSEGMENTTYPE",869906466:"IFCDUCTFITTINGTYPE",395920057:"IFCDOOR",3041715199:"IFCDISTRIBUTIONPORT",3040386961:"IFCDISTRIBUTIONFLOWELEMENT",1945004755:"IFCDISTRIBUTIONELEMENT",2063403501:"IFCDISTRIBUTIONCONTROLELEMENTTYPE",1599208980:"IFCDISTRIBUTIONCHAMBERELEMENTTYPE",2635815018:"IFCDISCRETEACCESSORYTYPE",1335981549:"IFCDISCRETEACCESSORY",4147604152:"IFCDIAMETERDIMENSION",3961806047:"IFCDAMPERTYPE",3495092785:"IFCCURTAINWALL",1973544240:"IFCCOVERING",2954562838:"IFCCOOLINGTOWERTYPE",335055490:"IFCCOOLEDBEAMTYPE",488727124:"IFCCONSTRUCTIONPRODUCTRESOURCE",1060000209:"IFCCONSTRUCTIONMATERIALRESOURCE",3898045240:"IFCCONSTRUCTIONEQUIPMENTRESOURCE",1163958913:"IFCCONDITIONCRITERION",2188551683:"IFCCONDITION",2816379211:"IFCCONDENSERTYPE",3850581409:"IFCCOMPRESSORTYPE",843113511:"IFCCOLUMN",2301859152:"IFCCOILTYPE",2611217952:"IFCCIRCLE",2951183804:"IFCCHILLERTYPE",1285652485:"IFCCABLESEGMENTTYPE",3293546465:"IFCCABLECARRIERSEGMENTTYPE",395041908:"IFCCABLECARRIERFITTINGTYPE",1909888760:"IFCBUILDINGELEMENTPROXYTYPE",1095909175:"IFCBUILDINGELEMENTPROXY",2979338954:"IFCBUILDINGELEMENTPART",52481810:"IFCBUILDINGELEMENTCOMPONENT",3299480353:"IFCBUILDINGELEMENT",231477066:"IFCBOILERTYPE",1916977116:"IFCBEZIERCURVE",819618141:"IFCBEAMTYPE",1967976161:"IFCBSPLINECURVE",3460190687:"IFCASSET",2470393545:"IFCANGULARDIMENSION",1871374353:"IFCAIRTOAIRHEATRECOVERYTYPE",3352864051:"IFCAIRTERMINALTYPE",1411407467:"IFCAIRTERMINALBOXTYPE",3821786052:"IFCACTIONREQUEST",1213861670:"IFC2DCOMPOSITECURVE",1033361043:"IFCZONE",3342526732:"IFCWORKSCHEDULE",4218914973:"IFCWORKPLAN",1028945134:"IFCWORKCONTROL",1133259667:"IFCWASTETERMINALTYPE",1898987631:"IFCWALLTYPE",2769231204:"IFCVIRTUALELEMENT",728799441:"IFCVALVETYPE",1911125066:"IFCUNITARYEQUIPMENTTYPE",1600972822:"IFCTUBEBUNDLETYPE",3593883385:"IFCTRIMMEDCURVE",1620046519:"IFCTRANSPORTELEMENT",1692211062:"IFCTRANSFORMERTYPE",1637806684:"IFCTIMESERIESSCHEDULE",5716631:"IFCTANKTYPE",2254336722:"IFCSYSTEM",2315554128:"IFCSWITCHINGDEVICETYPE",148013059:"IFCSUBCONTRACTRESOURCE",1975003073:"IFCSTRUCTURALSURFACECONNECTION",2986769608:"IFCSTRUCTURALRESULTGROUP",1235345126:"IFCSTRUCTURALPOINTREACTION",734778138:"IFCSTRUCTURALPOINTCONNECTION",2082059205:"IFCSTRUCTURALPOINTACTION",3987759626:"IFCSTRUCTURALPLANARACTIONVARYING",1621171031:"IFCSTRUCTURALPLANARACTION",1252848954:"IFCSTRUCTURALLOADGROUP",1721250024:"IFCSTRUCTURALLINEARACTIONVARYING",1807405624:"IFCSTRUCTURALLINEARACTION",2445595289:"IFCSTRUCTURALCURVEMEMBERVARYING",214636428:"IFCSTRUCTURALCURVEMEMBER",4243806635:"IFCSTRUCTURALCURVECONNECTION",1179482911:"IFCSTRUCTURALCONNECTION",682877961:"IFCSTRUCTURALACTION",1039846685:"IFCSTAIRFLIGHTTYPE",3112655638:"IFCSTACKTERMINALTYPE",3812236995:"IFCSPACETYPE",652456506:"IFCSPACEPROGRAM",1305183839:"IFCSPACEHEATERTYPE",3856911033:"IFCSPACE",2533589738:"IFCSLABTYPE",4097777520:"IFCSITE",4105383287:"IFCSERVICELIFE",3517283431:"IFCSCHEDULETIMECONTROL",1768891740:"IFCSANITARYTERMINALTYPE",2863920197:"IFCRELASSIGNSTASKS",160246688:"IFCRELAGGREGATES",2324767716:"IFCRAMPFLIGHTTYPE",2893384427:"IFCRAILINGTYPE",3248260540:"IFCRADIUSDIMENSION",2250791053:"IFCPUMPTYPE",1842657554:"IFCPROTECTIVEDEVICETYPE",3651124850:"IFCPROJECTIONELEMENT",3642467123:"IFCPROJECTORDERRECORD",2904328755:"IFCPROJECTORDER",2744685151:"IFCPROCEDURE",3740093272:"IFCPORT",3724593414:"IFCPOLYLINE",4017108033:"IFCPLATETYPE",4231323485:"IFCPIPESEGMENTTYPE",804291784:"IFCPIPEFITTINGTYPE",3327091369:"IFCPERMIT",2382730787:"IFCPERFORMANCEHISTORY",2837617999:"IFCOUTLETTYPE",3425660407:"IFCORDERACTION",3588315303:"IFCOPENINGELEMENT",4143007308:"IFCOCCUPANT",1916936684:"IFCMOVE",977012517:"IFCMOTORCONNECTIONTYPE",3181161470:"IFCMEMBERTYPE",2108223431:"IFCMECHANICALFASTENERTYPE",377706215:"IFCMECHANICALFASTENER",2506943328:"IFCLINEARDIMENSION",1161773419:"IFCLIGHTFIXTURETYPE",1051575348:"IFCLAMPTYPE",3827777499:"IFCLABORRESOURCE",4288270099:"IFCJUNCTIONBOXTYPE",2391368822:"IFCINVENTORY",1806887404:"IFCHUMIDIFIERTYPE",1251058090:"IFCHEATEXCHANGERTYPE",2706460486:"IFCGROUP",3009204131:"IFCGRID",200128114:"IFCGASTERMINALTYPE",814719939:"IFCFURNITURESTANDARD",263784265:"IFCFURNISHINGELEMENT",3009222698:"IFCFLOWTREATMENTDEVICETYPE",2297155007:"IFCFLOWTERMINALTYPE",1339347760:"IFCFLOWSTORAGEDEVICETYPE",1834744321:"IFCFLOWSEGMENTTYPE",1482959167:"IFCFLOWMOVINGDEVICETYPE",3815607619:"IFCFLOWMETERTYPE",3198132628:"IFCFLOWFITTINGTYPE",3907093117:"IFCFLOWCONTROLLERTYPE",1287392070:"IFCFEATUREELEMENTSUBTRACTION",2143335405:"IFCFEATUREELEMENTADDITION",2827207264:"IFCFEATUREELEMENT",2489546625:"IFCFASTENERTYPE",647756555:"IFCFASTENER",3737207727:"IFCFACETEDBREPWITHVOIDS",807026263:"IFCFACETEDBREP",3390157468:"IFCEVAPORATORTYPE",3174744832:"IFCEVAPORATIVECOOLERTYPE",3272907226:"IFCEQUIPMENTSTANDARD",1962604670:"IFCEQUIPMENTELEMENT",2107101300:"IFCENERGYCONVERSIONDEVICETYPE",1704287377:"IFCELLIPSE",2590856083:"IFCELEMENTCOMPONENTTYPE",1623761950:"IFCELEMENTCOMPONENT",4123344466:"IFCELEMENTASSEMBLY",1758889154:"IFCELEMENT",360485395:"IFCELECTRICALBASEPROPERTIES",3849074793:"IFCDISTRIBUTIONFLOWELEMENTTYPE",3256556792:"IFCDISTRIBUTIONELEMENTTYPE",681481545:"IFCDIMENSIONCURVEDIRECTEDCALLOUT",1457835157:"IFCCURTAINWALLTYPE",3295246426:"IFCCREWRESOURCE",1916426348:"IFCCOVERINGTYPE",1419761937:"IFCCOSTSCHEDULE",3895139033:"IFCCOSTITEM",3293443760:"IFCCONTROL",2559216714:"IFCCONSTRUCTIONRESOURCE",2510884976:"IFCCONIC",3732776249:"IFCCOMPOSITECURVE",300633059:"IFCCOLUMNTYPE",2937912522:"IFCCIRCLEHOLLOWPROFILEDEF",3124254112:"IFCBUILDINGSTOREY",1950629157:"IFCBUILDINGELEMENTTYPE",4031249490:"IFCBUILDING",1260505505:"IFCBOUNDEDCURVE",3649129432:"IFCBOOLEANCLIPPINGRESULT",1334484129:"IFCBLOCK",3207858831:"IFCASYMMETRICISHAPEPROFILEDEF",1674181508:"IFCANNOTATION",2296667514:"IFCACTOR",2097647324:"IFCTRANSPORTELEMENTTYPE",3473067441:"IFCTASK",1580310250:"IFCSYSTEMFURNITUREELEMENTTYPE",4124788165:"IFCSURFACEOFREVOLUTION",2809605785:"IFCSURFACEOFLINEAREXTRUSION",2028607225:"IFCSURFACECURVESWEPTAREASOLID",4070609034:"IFCSTRUCTUREDDIMENSIONCALLOUT",2218152070:"IFCSTRUCTURALSURFACEMEMBERVARYING",3979015343:"IFCSTRUCTURALSURFACEMEMBER",3689010777:"IFCSTRUCTURALREACTION",530289379:"IFCSTRUCTURALMEMBER",3136571912:"IFCSTRUCTURALITEM",3544373492:"IFCSTRUCTURALACTIVITY",451544542:"IFCSPHERE",3893378262:"IFCSPATIALSTRUCTUREELEMENTTYPE",2706606064:"IFCSPATIALSTRUCTUREELEMENT",3626867408:"IFCRIGHTCIRCULARCYLINDER",4158566097:"IFCRIGHTCIRCULARCONE",1856042241:"IFCREVOLVEDAREASOLID",2914609552:"IFCRESOURCE",1401173127:"IFCRELVOIDSELEMENT",3451746338:"IFCRELSPACEBOUNDARY",366585022:"IFCRELSERVICESBUILDINGS",4122056220:"IFCRELSEQUENCE",1058617721:"IFCRELSCHEDULESCOSTITEMS",1245217292:"IFCRELREFERENCEDINSPATIALSTRUCTURE",750771296:"IFCRELPROJECTSELEMENT",202636808:"IFCRELOVERRIDESPROPERTIES",2051452291:"IFCRELOCCUPIESSPACES",3268803585:"IFCRELNESTS",4189434867:"IFCRELINTERACTIONREQUIREMENTS",279856033:"IFCRELFLOWCONTROLELEMENTS",3940055652:"IFCRELFILLSELEMENT",781010003:"IFCRELDEFINESBYTYPE",4186316022:"IFCRELDEFINESBYPROPERTIES",693640335:"IFCRELDEFINES",2551354335:"IFCRELDECOMPOSES",2802773753:"IFCRELCOVERSSPACES",886880790:"IFCRELCOVERSBLDGELEMENTS",3242617779:"IFCRELCONTAINEDINSPATIALSTRUCTURE",3678494232:"IFCRELCONNECTSWITHREALIZINGELEMENTS",504942748:"IFCRELCONNECTSWITHECCENTRICITY",1638771189:"IFCRELCONNECTSSTRUCTURALMEMBER",3912681535:"IFCRELCONNECTSSTRUCTURALELEMENT",2127690289:"IFCRELCONNECTSSTRUCTURALACTIVITY",3190031847:"IFCRELCONNECTSPORTS",4201705270:"IFCRELCONNECTSPORTTOELEMENT",3945020480:"IFCRELCONNECTSPATHELEMENTS",1204542856:"IFCRELCONNECTSELEMENTS",826625072:"IFCRELCONNECTS",2851387026:"IFCRELASSOCIATESPROFILEPROPERTIES",2655215786:"IFCRELASSOCIATESMATERIAL",3840914261:"IFCRELASSOCIATESLIBRARY",982818633:"IFCRELASSOCIATESDOCUMENT",2728634034:"IFCRELASSOCIATESCONSTRAINT",919958153:"IFCRELASSOCIATESCLASSIFICATION",4095574036:"IFCRELASSOCIATESAPPROVAL",1327628568:"IFCRELASSOCIATESAPPLIEDVALUE",1865459582:"IFCRELASSOCIATES",205026976:"IFCRELASSIGNSTORESOURCE",3372526763:"IFCRELASSIGNSTOPROJECTORDER",2857406711:"IFCRELASSIGNSTOPRODUCT",4278684876:"IFCRELASSIGNSTOPROCESS",1307041759:"IFCRELASSIGNSTOGROUP",2495723537:"IFCRELASSIGNSTOCONTROL",1683148259:"IFCRELASSIGNSTOACTOR",3939117080:"IFCRELASSIGNS",3454111270:"IFCRECTANGULARTRIMMEDSURFACE",2798486643:"IFCRECTANGULARPYRAMID",2770003689:"IFCRECTANGLEHOLLOWPROFILEDEF",3219374653:"IFCPROXY",1451395588:"IFCPROPERTYSET",4194566429:"IFCPROJECTIONCURVE",103090709:"IFCPROJECT",4208778838:"IFCPRODUCT",2945172077:"IFCPROCESS",220341763:"IFCPLANE",603570806:"IFCPLANARBOX",3566463478:"IFCPERMEABLECOVERINGPROPERTIES",3505215534:"IFCOFFSETCURVE3D",3388369263:"IFCOFFSETCURVE2D",3888040117:"IFCOBJECT",1425443689:"IFCMANIFOLDSOLIDBREP",1281925730:"IFCLINE",572779678:"IFCLSHAPEPROFILEDEF",1484403080:"IFCISHAPEPROFILEDEF",987898635:"IFCGEOMETRICCURVESET",1268542332:"IFCFURNITURETYPE",4238390223:"IFCFURNISHINGELEMENTTYPE",3455213021:"IFCFLUIDFLOWPROPERTIES",315944413:"IFCFILLAREASTYLETILES",4203026998:"IFCFILLAREASTYLETILESYMBOLWITHSTYLE",374418227:"IFCFILLAREASTYLEHATCHING",2047409740:"IFCFACEBASEDSURFACEMODEL",477187591:"IFCEXTRUDEDAREASOLID",80994333:"IFCENERGYPROPERTIES",2835456948:"IFCELLIPSEPROFILEDEF",2777663545:"IFCELEMENTARYSURFACE",339256511:"IFCELEMENTTYPE",1883228015:"IFCELEMENTQUANTITY",1472233963:"IFCEDGELOOP",4006246654:"IFCDRAUGHTINGPREDEFINEDCURVEFONT",445594917:"IFCDRAUGHTINGPREDEFINEDCOLOUR",3073041342:"IFCDRAUGHTINGCALLOUT",526551008:"IFCDOORSTYLE",1714330368:"IFCDOORPANELPROPERTIES",2963535650:"IFCDOORLININGPROPERTIES",32440307:"IFCDIRECTION",4054601972:"IFCDIMENSIONCURVETERMINATOR",606661476:"IFCDIMENSIONCURVE",693772133:"IFCDEFINEDSYMBOL",2827736869:"IFCCURVEBOUNDEDPLANE",2601014836:"IFCCURVE",2147822146:"IFCCSGSOLID",2506170314:"IFCCSGPRIMITIVE3D",194851669:"IFCCRANERAILFSHAPEPROFILEDEF",4133800736:"IFCCRANERAILASHAPEPROFILEDEF",2485617015:"IFCCOMPOSITECURVESEGMENT",2205249479:"IFCCLOSEDSHELL",1383045692:"IFCCIRCLEPROFILEDEF",1416205885:"IFCCARTESIANTRANSFORMATIONOPERATOR3DNONUNIFORM",3331915920:"IFCCARTESIANTRANSFORMATIONOPERATOR3D",3486308946:"IFCCARTESIANTRANSFORMATIONOPERATOR2DNONUNIFORM",3749851601:"IFCCARTESIANTRANSFORMATIONOPERATOR2D",59481748:"IFCCARTESIANTRANSFORMATIONOPERATOR",1123145078:"IFCCARTESIANPOINT",2898889636:"IFCCSHAPEPROFILEDEF",2713105998:"IFCBOXEDHALFSPACE",2581212453:"IFCBOUNDINGBOX",4182860854:"IFCBOUNDEDSURFACE",2736907675:"IFCBOOLEANRESULT",2740243338:"IFCAXIS2PLACEMENT3D",3125803723:"IFCAXIS2PLACEMENT2D",4261334040:"IFCAXIS1PLACEMENT",1302238472:"IFCANNOTATIONSURFACE",2265737646:"IFCANNOTATIONFILLAREAOCCURRENCE",669184980:"IFCANNOTATIONFILLAREA",3288037868:"IFCANNOTATIONCURVEOCCURRENCE",2543172580:"IFCZSHAPEPROFILEDEF",1299126871:"IFCWINDOWSTYLE",512836454:"IFCWINDOWPANELPROPERTIES",336235671:"IFCWINDOWLININGPROPERTIES",2759199220:"IFCVERTEXLOOP",1417489154:"IFCVECTOR",427810014:"IFCUSHAPEPROFILEDEF",2347495698:"IFCTYPEPRODUCT",1628702193:"IFCTYPEOBJECT",1345879162:"IFCTWODIRECTIONREPEATFACTOR",2715220739:"IFCTRAPEZIUMPROFILEDEF",3124975700:"IFCTEXTLITERALWITHEXTENT",4282788508:"IFCTEXTLITERAL",3028897424:"IFCTERMINATORSYMBOL",3071757647:"IFCTSHAPEPROFILEDEF",230924584:"IFCSWEPTSURFACE",1260650574:"IFCSWEPTDISKSOLID",2247615214:"IFCSWEPTAREASOLID",1878645084:"IFCSURFACESTYLERENDERING",2513912981:"IFCSURFACE",2233826070:"IFCSUBEDGE",3653947884:"IFCSTRUCTURALSTEELPROFILEPROPERTIES",3843319758:"IFCSTRUCTURALPROFILEPROPERTIES",1190533807:"IFCSTRUCTURALLOADSINGLEFORCEWARPING",1597423693:"IFCSTRUCTURALLOADSINGLEFORCE",1973038258:"IFCSTRUCTURALLOADSINGLEDISPLACEMENTDISTORTION",2473145415:"IFCSTRUCTURALLOADSINGLEDISPLACEMENT",2668620305:"IFCSTRUCTURALLOADPLANARFORCE",1595516126:"IFCSTRUCTURALLOADLINEARFORCE",390701378:"IFCSPACETHERMALLOADPROPERTIES",1202362311:"IFCSOUNDVALUE",2485662743:"IFCSOUNDPROPERTIES",723233188:"IFCSOLIDMODEL",2609359061:"IFCSLIPPAGECONNECTIONCONDITION",4124623270:"IFCSHELLBASEDSURFACEMODEL",2411513650:"IFCSERVICELIFEFACTOR",1509187699:"IFCSECTIONEDSPINE",2778083089:"IFCROUNDEDRECTANGLEPROFILEDEF",478536968:"IFCRELATIONSHIP",3765753017:"IFCREINFORCEMENTDEFINITIONPROPERTIES",3413951693:"IFCREGULARTIMESERIES",3615266464:"IFCRECTANGLEPROFILEDEF",110355661:"IFCPROPERTYTABLEVALUE",3650150729:"IFCPROPERTYSINGLEVALUE",3357820518:"IFCPROPERTYSETDEFINITION",941946838:"IFCPROPERTYREFERENCEVALUE",2752243245:"IFCPROPERTYLISTVALUE",4166981789:"IFCPROPERTYENUMERATEDVALUE",1680319473:"IFCPROPERTYDEFINITION",871118103:"IFCPROPERTYBOUNDEDVALUE",673634403:"IFCPRODUCTDEFINITIONSHAPE",179317114:"IFCPREDEFINEDPOINTMARKERSYMBOL",433424934:"IFCPREDEFINEDDIMENSIONSYMBOL",2559016684:"IFCPREDEFINEDCURVEFONT",759155922:"IFCPREDEFINEDCOLOUR",2775532180:"IFCPOLYGONALBOUNDEDHALFSPACE",2924175390:"IFCPOLYLOOP",1423911732:"IFCPOINTONSURFACE",4022376103:"IFCPOINTONCURVE",2067069095:"IFCPOINT",1663979128:"IFCPLANAREXTENT",2004835150:"IFCPLACEMENT",597895409:"IFCPIXELTEXTURE",3021840470:"IFCPHYSICALCOMPLEXQUANTITY",2519244187:"IFCPATH",2529465313:"IFCPARAMETERIZEDPROFILEDEF",1029017970:"IFCORIENTEDEDGE",2665983363:"IFCOPENSHELL",2833995503:"IFCONEDIRECTIONREPEATFACTOR",219451334:"IFCOBJECTDEFINITION",1430189142:"IFCMECHANICALCONCRETEMATERIALPROPERTIES",2022407955:"IFCMATERIALDEFINITIONREPRESENTATION",2347385850:"IFCMAPPEDITEM",1008929658:"IFCLOOP",2624227202:"IFCLOCALPLACEMENT",3422422726:"IFCLIGHTSOURCESPOT",1520743889:"IFCLIGHTSOURCEPOSITIONAL",4266656042:"IFCLIGHTSOURCEGONIOMETRIC",2604431987:"IFCLIGHTSOURCEDIRECTIONAL",125510826:"IFCLIGHTSOURCEAMBIENT",1402838566:"IFCLIGHTSOURCE",3741457305:"IFCIRREGULARTIMESERIES",3905492369:"IFCIMAGETEXTURE",2445078500:"IFCHYGROSCOPICMATERIALPROPERTIES",812098782:"IFCHALFSPACESOLID",178086475:"IFCGRIDPLACEMENT",3590301190:"IFCGEOMETRICSET",4142052618:"IFCGEOMETRICREPRESENTATIONSUBCONTEXT",2453401579:"IFCGEOMETRICREPRESENTATIONITEM",3448662350:"IFCGEOMETRICREPRESENTATIONCONTEXT",1446786286:"IFCGENERALPROFILEPROPERTIES",803998398:"IFCGENERALMATERIALPROPERTIES",3857492461:"IFCFUELPROPERTIES",738692330:"IFCFILLAREASTYLE",4219587988:"IFCFAILURECONNECTIONCONDITION",3008276851:"IFCFACESURFACE",803316827:"IFCFACEOUTERBOUND",1809719519:"IFCFACEBOUND",2556980723:"IFCFACE",1860660968:"IFCEXTENDEDMATERIALPROPERTIES",476780140:"IFCEDGECURVE",3900360178:"IFCEDGE",4170525392:"IFCDRAUGHTINGPREDEFINEDTEXTFONT",3732053477:"IFCDOCUMENTREFERENCE",1694125774:"IFCDIMENSIONPAIR",2273265877:"IFCDIMENSIONCALLOUTRELATIONSHIP",3632507154:"IFCDERIVEDPROFILEDEF",3800577675:"IFCCURVESTYLE",2889183280:"IFCCONVERSIONBASEDUNIT",3050246964:"IFCCONTEXTDEPENDENTUNIT",45288368:"IFCCONNECTIONPOINTECCENTRICITY",1981873012:"IFCCONNECTIONCURVEGEOMETRY",370225590:"IFCCONNECTEDFACESET",1485152156:"IFCCOMPOSITEPROFILEDEF",2542286263:"IFCCOMPLEXPROPERTY",776857604:"IFCCOLOURRGB",647927063:"IFCCLASSIFICATIONREFERENCE",3150382593:"IFCCENTERLINEPROFILEDEF",616511568:"IFCBLOBTEXTURE",2705031697:"IFCARBITRARYPROFILEDEFWITHVOIDS",1310608509:"IFCARBITRARYOPENPROFILEDEF",3798115385:"IFCARBITRARYCLOSEDPROFILEDEF",2297822566:"IFCANNOTATIONTEXTOCCURRENCE",3612888222:"IFCANNOTATIONSYMBOLOCCURRENCE",962685235:"IFCANNOTATIONSURFACEOCCURRENCE",2442683028:"IFCANNOTATIONOCCURRENCE",1065908215:"IFCWATERPROPERTIES",891718957:"IFCVIRTUALGRIDINTERSECTION",1907098498:"IFCVERTEXPOINT",3304826586:"IFCVERTEXBASEDTEXTUREMAP",2799835756:"IFCVERTEX",180925521:"IFCUNITASSIGNMENT",1735638870:"IFCTOPOLOGYREPRESENTATION",1377556343:"IFCTOPOLOGICALREPRESENTATIONITEM",581633288:"IFCTIMESERIESVALUE",1718945513:"IFCTIMESERIESREFERENCERELATIONSHIP",3101149627:"IFCTIMESERIES",3317419933:"IFCTHERMALMATERIALPROPERTIES",1210645708:"IFCTEXTUREVERTEX",2552916305:"IFCTEXTUREMAP",1742049831:"IFCTEXTURECOORDINATEGENERATOR",280115917:"IFCTEXTURECOORDINATE",1484833681:"IFCTEXTSTYLEWITHBOXCHARACTERISTICS",1640371178:"IFCTEXTSTYLETEXTMODEL",2636378356:"IFCTEXTSTYLEFORDEFINEDFONT",1983826977:"IFCTEXTSTYLEFONTMODEL",1447204868:"IFCTEXTSTYLE",912023232:"IFCTELECOMADDRESS",531007025:"IFCTABLEROW",985171141:"IFCTABLE",1290481447:"IFCSYMBOLSTYLE",626085974:"IFCSURFACETEXTURE",1351298697:"IFCSURFACESTYLEWITHTEXTURES",846575682:"IFCSURFACESTYLESHADING",1607154358:"IFCSURFACESTYLEREFRACTION",3303107099:"IFCSURFACESTYLELIGHTING",1300840506:"IFCSURFACESTYLE",3049322572:"IFCSTYLEDREPRESENTATION",3958052878:"IFCSTYLEDITEM",2830218821:"IFCSTYLEMODEL",3408363356:"IFCSTRUCTURALLOADTEMPERATURE",2525727697:"IFCSTRUCTURALLOADSTATIC",2162789131:"IFCSTRUCTURALLOAD",2273995522:"IFCSTRUCTURALCONNECTIONCONDITION",3692461612:"IFCSIMPLEPROPERTY",4240577450:"IFCSHAPEREPRESENTATION",3982875396:"IFCSHAPEMODEL",867548509:"IFCSHAPEASPECT",4165799628:"IFCSECTIONREINFORCEMENTPROPERTIES",2042790032:"IFCSECTIONPROPERTIES",448429030:"IFCSIUNIT",2341007311:"IFCROOT",3679540991:"IFCRIBPLATEPROFILEPROPERTIES",1660063152:"IFCREPRESENTATIONMAP",3008791417:"IFCREPRESENTATIONITEM",3377609919:"IFCREPRESENTATIONCONTEXT",1076942058:"IFCREPRESENTATION",1222501353:"IFCRELAXATION",1580146022:"IFCREINFORCEMENTBARPROPERTIES",2692823254:"IFCREFERENCESVALUEDOCUMENT",825690147:"IFCQUANTITYWEIGHT",2405470396:"IFCQUANTITYVOLUME",3252649465:"IFCQUANTITYTIME",931644368:"IFCQUANTITYLENGTH",2093928680:"IFCQUANTITYCOUNT",2044713172:"IFCQUANTITYAREA",3710013099:"IFCPROPERTYENUMERATION",148025276:"IFCPROPERTYDEPENDENCYRELATIONSHIP",3896028662:"IFCPROPERTYCONSTRAINTRELATIONSHIP",2598011224:"IFCPROPERTY",2802850158:"IFCPROFILEPROPERTIES",3958567839:"IFCPROFILEDEF",2267347899:"IFCPRODUCTSOFCOMBUSTIONPROPERTIES",2095639259:"IFCPRODUCTREPRESENTATION",2417041796:"IFCPRESENTATIONSTYLEASSIGNMENT",3119450353:"IFCPRESENTATIONSTYLE",1304840413:"IFCPRESENTATIONLAYERWITHSTYLE",2022622350:"IFCPRESENTATIONLAYERASSIGNMENT",1775413392:"IFCPREDEFINEDTEXTFONT",3213052703:"IFCPREDEFINEDTERMINATORSYMBOL",990879717:"IFCPREDEFINEDSYMBOL",3727388367:"IFCPREDEFINEDITEM",3355820592:"IFCPOSTALADDRESS",2226359599:"IFCPHYSICALSIMPLEQUANTITY",2483315170:"IFCPHYSICALQUANTITY",101040310:"IFCPERSONANDORGANIZATION",2077209135:"IFCPERSON",1207048766:"IFCOWNERHISTORY",1411181986:"IFCORGANIZATIONRELATIONSHIP",4251960020:"IFCORGANIZATION",1227763645:"IFCOPTICALMATERIALPROPERTIES",2251480897:"IFCOBJECTIVE",3701648758:"IFCOBJECTPLACEMENT",1918398963:"IFCNAMEDUNIT",2706619895:"IFCMONETARYUNIT",3368373690:"IFCMETRIC",677618848:"IFCMECHANICALSTEELMATERIALPROPERTIES",4256014907:"IFCMECHANICALMATERIALPROPERTIES",2597039031:"IFCMEASUREWITHUNIT",3265635763:"IFCMATERIALPROPERTIES",2199411900:"IFCMATERIALLIST",1303795690:"IFCMATERIALLAYERSETUSAGE",3303938423:"IFCMATERIALLAYERSET",248100487:"IFCMATERIALLAYER",1847130766:"IFCMATERIALCLASSIFICATIONRELATIONSHIP",1838606355:"IFCMATERIAL",30780891:"IFCLOCALTIME",1566485204:"IFCLIGHTINTENSITYDISTRIBUTION",4162380809:"IFCLIGHTDISTRIBUTIONDATA",3452421091:"IFCLIBRARYREFERENCE",2655187982:"IFCLIBRARYINFORMATION",3020489413:"IFCIRREGULARTIMESERIESVALUE",852622518:"IFCGRIDAXIS",3548104201:"IFCEXTERNALLYDEFINEDTEXTFONT",3207319532:"IFCEXTERNALLYDEFINEDSYMBOL",1040185647:"IFCEXTERNALLYDEFINEDSURFACESTYLE",2242383968:"IFCEXTERNALLYDEFINEDHATCHSTYLE",3200245327:"IFCEXTERNALREFERENCE",1648886627:"IFCENVIRONMENTALIMPACTVALUE",3796139169:"IFCDRAUGHTINGCALLOUTRELATIONSHIP",770865208:"IFCDOCUMENTINFORMATIONRELATIONSHIP",1154170062:"IFCDOCUMENTINFORMATION",1376555844:"IFCDOCUMENTELECTRONICFORMAT",2949456006:"IFCDIMENSIONALEXPONENTS",1045800335:"IFCDERIVEDUNITELEMENT",1765591967:"IFCDERIVEDUNIT",1072939445:"IFCDATEANDTIME",3510044353:"IFCCURVESTYLEFONTPATTERN",2367409068:"IFCCURVESTYLEFONTANDSCALING",1105321065:"IFCCURVESTYLEFONT",539742890:"IFCCURRENCYRELATIONSHIP",602808272:"IFCCOSTVALUE",1065062679:"IFCCOORDINATEDUNIVERSALTIMEOFFSET",347226245:"IFCCONSTRAINTRELATIONSHIP",613356794:"IFCCONSTRAINTCLASSIFICATIONRELATIONSHIP",1658513725:"IFCCONSTRAINTAGGREGATIONRELATIONSHIP",1959218052:"IFCCONSTRAINT",2732653382:"IFCCONNECTIONSURFACEGEOMETRY",4257277454:"IFCCONNECTIONPORTGEOMETRY",2614616156:"IFCCONNECTIONPOINTGEOMETRY",2859738748:"IFCCONNECTIONGEOMETRY",3264961684:"IFCCOLOURSPECIFICATION",3639012971:"IFCCLASSIFICATIONNOTATIONFACET",938368621:"IFCCLASSIFICATIONNOTATION",1098599126:"IFCCLASSIFICATIONITEMRELATIONSHIP",1767535486:"IFCCLASSIFICATIONITEM",747523909:"IFCCLASSIFICATION",622194075:"IFCCALENDARDATE",2069777674:"IFCBOUNDARYNODECONDITIONWARPING",1387855156:"IFCBOUNDARYNODECONDITION",3367102660:"IFCBOUNDARYFACECONDITION",1560379544:"IFCBOUNDARYEDGECONDITION",4037036970:"IFCBOUNDARYCONDITION",3869604511:"IFCAPPROVALRELATIONSHIP",390851274:"IFCAPPROVALPROPERTYRELATIONSHIP",2080292479:"IFCAPPROVALACTORRELATIONSHIP",130549933:"IFCAPPROVAL",1110488051:"IFCAPPLIEDVALUERELATIONSHIP",411424972:"IFCAPPLIEDVALUE",639542469:"IFCAPPLICATION",618182010:"IFCADDRESS",3630933823:"IFCACTORROLE",599546466:"FILE_DESCRIPTION",1390159747:"FILE_NAME",1109904537:"FILE_SCHEMA"};let Dn=class am{static async getUnits(e){var t;const{IFCUNITASSIGNMENT:i}=ii,n=await e.getAllPropertiesOfType(i);if(!n)return 1;const r=Object.keys(n),o=n[parseInt(r[0],10)];for(const a of o.Units){if(a.value===void 0||a.value===null)continue;const l=await e.getProperties(a.value);if(!l||!l.UnitType||!l.UnitType.value||l.UnitType.value!=="LENGTHUNIT")continue;let h=1,d=1;return l.Name.value==="METRE"&&(d=1),l.Name.value==="FOOT"&&(d=.3048),((t=l.Prefix)==null?void 0:t.value)==="MILLI"&&(h=.001),d*h}return 1}static async findItemByGuid(e,t){var i;const n=e.getAllPropertiesIDs();for(const r of n){const o=await e.getProperties(r);if(o&&((i=o.GlobalId)==null?void 0:i.value)===t)return o}return null}static async getRelationMap(e,t,i){var n;const r=i??(async()=>{}),o={},a=e.getAllPropertiesIDs();for(const l of a){const h=await e.getProperties(l);if(!h)continue;const d=h.type===t,p=Object.keys(h).find(w=>w.startsWith("Relating")),f=Object.keys(h).find(w=>w.startsWith("Related"));if(!(d&&p&&f))continue;const g=await e.getProperties((n=h[p])==null?void 0:n.value),v=h[f];if(!g||!v||!(v&&Array.isArray(v)))continue;const b=v.map(w=>w.value);await r(g.expressID,b),o[g.expressID]=b}return o}static async getQsetQuantities(e,t,i){const n=i??(()=>{}),r=await e.getProperties(t);return!r||r.type!==Jh?null:(r.Quantities??[{}]).map(o=>(o.value&&n(o.value),o.value)).filter(o=>o!==null)}static async getPsetProps(e,t,i){const n=i??(()=>{}),r=await e.getProperties(t);return!r||r.type!==zr?null:(r.HasProperties??[{}]).map(o=>(o.value&&n(o.value),o.value)).filter(o=>o!==null)}static async getPsetRel(e,t){var i;if(!await e.getProperties(t))return null;const n=await e.getAllPropertiesOfType(cl);if(!n)return null;const r=Object.values(n);let o=null;for(const a of r)((i=a.RelatingPropertyDefinition)==null?void 0:i.value)===t&&(o=a.expressID);return o}static async getQsetRel(e,t){return am.getPsetRel(e,t)}static async getEntityName(e,t){var i;const n=await e.getProperties(t);if(!n)return{key:null,name:null};const r=Object.keys(n).find(a=>a.endsWith("Name"))??null,o=r?(i=n[r])==null?void 0:i.value:null;return{key:r,name:o}}static async getQuantityValue(e,t){const i=await e.getProperties(t);if(!i)return{key:null,value:null};const n=Object.keys(i).find(o=>o.endsWith("Value"))??null;let r;return n===null||i[n]===void 0||i[n]===null?r=null:r=i[n].value,{key:n,value:r}}static isRel(e){return om[e].startsWith("IFCREL")}static async attributeExists(e,t,i){const n=await e.getProperties(t);return n?Object.keys(n).includes(i):!1}static async groupEntitiesByType(e,t){var i;const n=new Map;for(const r of t){const o=await e.getProperties(r);if(!o)continue;const a=o.type;n.get(a)||n.set(a,new Set),(i=n.get(a))==null||i.add(r)}return n}};const rE=new Map([[jh,{forRelating:"IsDecomposedBy",forRelated:"Decomposes"}],[Wh,{forRelating:"AssociatedTo",forRelated:"HasAssociations"}],[Xh,{forRelating:"ClassificationForObjects",forRelated:"HasAssociations"}],[Kh,{forRelating:"IsGroupedBy",forRelated:"HasAssignments"}],[cl,{forRelated:"IsDefinedBy",forRelating:"DefinesOcurrence"}],[Qh,{forRelated:"IsTypedBy",forRelating:"Types"}],[bf,{forRelated:"IsDefinedBy",forRelating:"Defines"}],[hl,{forRelated:"ContainedInStructure",forRelating:"ContainsElements"}]]),lm=class dh extends Re{constructor(e){super(e),A(this,"onDisposed",new ee),A(this,"enabled",!0),A(this,"onRelationsIndexed",new ee),A(this,"_relToAttributesMap",rE),A(this,"_inverseAttributes",["IsDecomposedBy","Decomposes","AssociatedTo","HasAssociations","ClassificationForObjects","IsGroupedBy","HasAssignments","IsDefinedBy","DefinesOcurrence","IsTypedBy","Types","Defines","ContainedInStructure","ContainsElements"]),A(this,"_ifcRels",[jh,Wh,Xh,Kh,cl,Qh,bf,hl]),A(this,"relationMaps",{}),A(this,"onFragmentsDisposed",t=>{delete this.relationMaps[t.groupID]}),this.components.add(dh.uuid,this),e.get(rt).onFragmentsDisposed.add(this.onFragmentsDisposed)}setRelationMap(e,t){this.relationMaps[e.uuid]=t,this.onRelationsIndexed.trigger({modelID:e.uuid,relationsMap:t})}async process(e){if(!e.hasProperties)throw new Error("FragmentsGroup properties not found");let t=this.relationMaps[e.uuid];if(t)return t;t=new Map;for(const i of this._ifcRels)await Dn.getRelationMap(e,i,async(n,r)=>{const o=this._relToAttributesMap.get(i);if(!o)return;const{forRelated:a,forRelating:l}=o,h=t.get(n)??new Map,d=this._inverseAttributes.indexOf(l);h.set(d,r),t.set(n,h);for(const p of r){const f=t.get(p)??new Map,g=this._inverseAttributes.indexOf(a),v=f.get(g)??[];v.push(n),f.set(g,v),t.set(p,f)}});return this.setRelationMap(e,t),t}async processFromWebIfc(e,t){const i=new Map;for(const n of this._ifcRels){const r=this._relToAttributesMap.get(n);if(!r)continue;const{forRelated:o,forRelating:a}=r,l=e.GetLineIDsWithType(t,n);for(let h=0;hT.startsWith("Relating")),f=Object.keys(d).find(T=>T.startsWith("Related"));if(!(p&&f))continue;const g=d[p].value,v=d[f].map(T=>T.value),b=i.get(g)??new Map,w=this._inverseAttributes.indexOf(a);b.set(w,v),i.set(g,b);for(const T of v){const S=i.get(T)??new Map,_=this._inverseAttributes.indexOf(o),I=S.get(_)??[];I.push(g),S.set(_,I),i.set(T,S)}}}return this.onRelationsIndexed.trigger({modelID:t.toString(),relationsMap:i}),i}getEntityRelations(e,t,i){const n=this.relationMaps[e.uuid];if(!n)return null;const r=n.get(t),o=this._inverseAttributes.indexOf(i);return!r||o===-1?null:r.get(o)||null}serializeRelations(e){const t={};for(const[i,n]of e.entries()){t[i]||(t[i]={});for(const[r,o]of n.entries())t[i][r]=o}return JSON.stringify(t)}serializeModelRelations(e){const t=this.relationMaps[e.uuid];return t?this.serializeRelations(t):null}serializeAllRelations(){const e={};for(const t in this.relationMaps){const i=this.relationMaps[t],n={};for(const[r,o]of i.entries()){n[r]||(n[r]={});for(const[a,l]of o.entries())n[r][a]=l}e[t]=n}return JSON.stringify(e)}getRelationsMapFromJSON(e){const t=JSON.parse(e),i=new Map;for(const n in t){const r=t[n],o=new Map;for(const a in r)o.set(Number(a),r[a]);i.set(Number(n),o)}return i}dispose(){this.relationMaps={},this.components.get(rt).onFragmentsDisposed.remove(this.onFragmentsDisposed),this.onDisposed.trigger(dh.uuid),this.onDisposed.reset()}};A(lm,"uuid","23a889ab-83b3-44a4-8bee-ead83438370b");let gl=lm;class oE{constructor(){A(this,"factor",1),A(this,"complement",1)}apply(e){const t=this.getScaleMatrix().multiply(e);e.copy(t)}setUp(e){var t;this.factor=1;const i=this.getLengthUnits(e);if(!i)return;const n=i==null,r=i.Name===void 0||i.Name===null;n||r||(i.Name.value==="FOOT"?this.factor=.3048:((t=i.Prefix)==null?void 0:t.value)==="MILLI"&&(this.complement=.001))}getLengthUnits(e){try{const t=e.GetLineIDsWithType(0,Dv).get(0),i=e.GetLine(0,t);for(const n of i.Units){if(!n||n.value===null||n.value===void 0)continue;const r=e.GetLine(0,n.value);if(r.UnitType&&r.UnitType.value==="LENGTHUNIT")return r}return null}catch{return console.log("Could not get units"),null}}getScaleMatrix(){const e=this.factor;return new Ee().fromArray([e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1])}}let cm=class{constructor(){A(this,"itemsByFloor",{}),A(this,"_units",new oE)}setUp(e){this._units.setUp(e),this.cleanUp();try{const t=e.GetLineIDsWithType(0,hl),i=new Set,n=e.GetLineIDsWithType(0,Wn);for(let h=0;h{this.getMesh(a,t)});for(const a of this._visitedFragments){const{index:l,fragment:h}=a[1];t.keyFragments.set(l,h.id)}for(const a of t.items){const l=this._fragmentInstances.get(a.id);if(!l)throw new Error("Fragment not found!");const h=[];for(const[d,p]of l)h.push(p);a.add(h)}const o=this.webIfc.GetCoordinationMatrix(0);return t.coordinationMatrix.fromArray(o),t.civilData=this._civil.read(this.webIfc),t}cleanUp(){this.webIfc=null,this.webIfc=new tn,this._visitedFragments.clear(),this._fragmentInstances.clear()}getMesh(e,t){const i=e.geometries.size(),n=e.expressID;for(let r=0;rparseInt(o,10)),n=t[i[0]],r=new Qo(n.expressID);return{ownerHistory:n,ownerHistoryHandle:r}}registerChange(e,...t){this.changeMap[e.uuid]||(this.changeMap[e.uuid]=new Set);for(const i of t)this.changeMap[e.uuid].add(i),this.onDataChanged.trigger({model:e,expressID:i})}async setData(e,...t){for(const i of t){const n=i.expressID;n&&(await e.setProperties(n,i),this.registerChange(e,n))}}async newPset(e,t,i){const n=ws.getIFCSchema(e),{ownerHistoryHandle:r}=await this.getOwnerHistory(e),o=this.newGUID(e),a=new ii[n].IfcLabel(t),l=i?new ii[n].IfcText(i):null,h=new ii[n].IfcPropertySet(o,r,a,l,[]);h.expressID=this.increaseMaxID(e);const d=this.newGUID(e),p=new ii[n].IfcRelDefinesByProperties(d,r,null,null,[],new Qo(h.expressID));return p.expressID=this.increaseMaxID(e),await this.setData(e,h,p),{pset:h,rel:p}}async removePset(e,...t){for(const i of t){const n=await e.getProperties(i);if((n==null?void 0:n.type)!==zr)continue;const r=await Dn.getPsetRel(e,i);if(r&&(await e.setProperties(r,null),this.registerChange(e,r)),n){for(const o of n.HasProperties)await e.setProperties(o.value,null);await e.setProperties(i,null),this.onPsetRemoved.trigger({model:e,psetID:i}),this.registerChange(e,i)}}}async newSingleProperty(e,t,i,n){const r=ws.getIFCSchema(e),o=new ii[r].IfcIdentifier(i),a=new ii[r][t](n),l=new ii[r].IfcPropertySingleValue(o,null,a,null);return l.expressID=this.increaseMaxID(e),await this.setData(e,l),l}newSingleStringProperty(e,t,i,n){return this.newSingleProperty(e,t,i,n)}newSingleNumericProperty(e,t,i,n){return this.newSingleProperty(e,t,i,n)}newSingleBooleanProperty(e,t,i,n){return this.newSingleProperty(e,t,i,n)}async removePsetProp(e,t,i){const n=await e.getProperties(t),r=await e.getProperties(i);!n||!r||n.type===zr&&r&&(n.HasProperties=n.HasProperties.filter(o=>o.value!==i),await e.setProperties(i,null),this.registerChange(e,t,i))}async addElementToPset(e,t,...i){const n=await Dn.getPsetRel(e,t);if(!n)return;const r=await e.getProperties(n);if(r){for(const o of i){const a=new Qo(o);r.RelatedObjects.push(a),this.onElementToPset.trigger({model:e,psetID:t,elementID:o})}this.registerChange(e,t)}}async addPropToPset(e,t,...i){const n=await e.getProperties(t);if(n){for(const r of i){if(n.HasProperties.includes(r))continue;const o=new Qo(r);n.HasProperties.push(o),this.onPropToPset.trigger({model:e,psetID:t,propID:r})}this.registerChange(e,t)}}async saveToIfc(e,t){const i=this.components.get(aE),n=i.webIfc,r=await i.readIfcFile(t),o=this.changeMap[e.uuid]??[];for(const l of o){const h=await e.getProperties(l);if(h)try{n.WriteLine(r,h)}catch{}else try{n.DeleteLine(r,l)}catch{}}const a=n.SaveModel(r);return i.webIfc.CloseModel(r),i.cleanUp(),a}async setAttributeListener(e,t,i){this.attributeListeners[e.uuid]||(this.attributeListeners[e.uuid]={});const n=this.attributeListeners[e.uuid][t]?this.attributeListeners[e.uuid][t][i]:null;if(n)return n;const r=await e.getProperties(t);if(!r)throw new Error(`Entity with expressID ${t} doesn't exists.`);const o=r[i];if(Array.isArray(o)||!o)throw new Error(`Attribute ${i} is array or null, and it can't have a listener.`);const a=o.value;if(a===void 0||a==null)throw new Error(`Attribute ${i} has a badly defined handle.`);const l=new ee;return Object.defineProperty(r[i],"value",{get(){return this._value},async set(h){this._value=h,l.trigger(h)}}),r[i].value=a,this.attributeListeners[e.uuid][t]||(this.attributeListeners[e.uuid][t]={}),this.attributeListeners[e.uuid][t][i]=l,l}};A(lE,"uuid","58c2d9f0-183c-48d6-a402-dfcf5b9a34df");const pm=class fm extends Re{constructor(e){super(e),A(this,"enabled",!0),A(this,"list",{}),A(this,"onDisposed",new ee),A(this,"onFragmentsDisposed",t=>{const{groupID:i,fragmentIDs:n}=t;for(const r in this.list){const o=this.list[r],a=Object.keys(o);if(a.includes(i))delete o[i],Object.values(o).length===0&&delete this.list[r];else for(const l of a){const h=o[l];for(const d of n)delete h[d];Object.values(h).length===0&&delete o[l]}}}),e.add(fm.uuid,this),e.get(rt).onFragmentsDisposed.add(this.onFragmentsDisposed)}dispose(){this.list={},this.components.get(rt).onFragmentsDisposed.remove(this.onFragmentsDisposed),this.onDisposed.trigger(),this.onDisposed.reset()}remove(e){for(const t in this.list){const i=this.list[t];for(const n in i){const r=i[n];delete r[e]}}}find(e){const t=this.components.get(rt);if(!e){const o={};for(const[a,l]of t.list)o[a]=new Set(l.ids);return o}const i=Object.keys(e).length,n={};for(const o in e){const a=e[o];if(!this.list[o]){console.warn(`Classification ${o} does not exist.`);continue}for(const l of a){const h=this.list[o][l];if(h)for(const d in h){n[d]||(n[d]=new Map);for(const p of h[d]){const f=n[d].get(p);f===void 0?n[d].set(p,1):n[d].set(p,f+1)}}}}const r={};for(const o in n){const a=n[o];for(const[l,h]of a){if(h===void 0)throw new Error("Malformed fragments map!");h===i&&(r[o]||(r[o]=new Set),r[o].add(l))}}return r}byModel(e,t){this.list.models||(this.list.models={});const i=this.list.models;i[e]||(i[e]={});const n=i[e];for(const[r,o]of t.data){const a=o[0];for(const l of a){const h=t.keyFragments.get(l);h&&(n[h]||(n[h]=new Set),n[h].add(r))}}}async byPredefinedType(e){var t;this.list.predefinedTypes||(this.list.predefinedTypes={});const i=this.list.predefinedTypes,n=e.getAllPropertiesIDs();for(const r of n){const o=await e.getProperties(r);if(!o)continue;const a=String((t=o.PredefinedType)==null?void 0:t.value).toUpperCase();i[a]||(i[a]={});const l=i[a];for(const[h,d]of e.data){const p=d[0];for(const f of p){const g=e.keyFragments.get(f);if(!g)throw new Error("Fragment ID not found!");l[g]||(l[g]=new Set),l[g].add(o.expressID)}}}}byEntity(e){this.list.entities||(this.list.entities={});for(const[t,i]of e.data){const n=i[1][1],r=om[n];this.saveItem(e,"entities",r,t)}}async byIfcRel(e,t,i){Dn.isRel(t)&&await Dn.getRelationMap(e,t,async(n,r)=>{const{name:o}=await Dn.getEntityName(e,n);for(const a of r)this.saveItem(e,i,o??"NO REL NAME",a)})}async bySpatialStructure(e){var t;const i=this.components.get(gl),n=i.relationMaps[e.uuid];if(!n)throw new Error(`Classifier: model relations of ${e.name||e.uuid} have to exists to group by spatial structure.`);const r="spatialStructures";for(const[o]of n){const a=i.getEntityRelations(e,o,"ContainsElements"),l=await e.getProperties(o);if(!(a&&l))continue;const h=(t=l.Name)==null?void 0:t.value;for(const d of a){this.saveItem(e,r,h,d);const p=i.getEntityRelations(e,Number(d),"IsDecomposedBy");if(p)for(const f of p)this.saveItem(e,r,h,f)}}}setColor(e,t,i=!1){const n=this.components.get(rt);for(const r in e){const o=n.list.get(r);if(!o)continue;const a=e[r];o.setColor(t,a,i)}}resetColor(e){const t=this.components.get(rt);for(const i in e){const n=t.list.get(i);if(!n)continue;const r=e[i];n.resetColor(r)}}saveItem(e,t,i,n){this.list[t]||(this.list[t]={});const r=e.data.get(n);if(r)for(const o of r[0]){const a=e.keyFragments.get(o);if(a){const l=this.list[t];l[i]||(l[i]={}),l[i][a]||(l[i][a]=new Set),l[i][a].add(n)}}}};A(pm,"uuid","e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");let cE=pm;const hE=class mm extends Re{constructor(e){super(e),A(this,"enabled",!0),A(this,"height",10),A(this,"groupName","storeys"),A(this,"onDisposed",new ee),A(this,"list",new Set),e.add(mm.uuid,this)}dispose(){this.list.clear(),this.onDisposed.trigger(),this.onDisposed.reset()}set(e){if(!this.enabled)return;const t=this.components.get(cE),i=this.components.get(rt),n=e?1:-1;let r=0;const o=t.list[this.groupName],a=new Ee;for(const l in o){a.elements[13]=r*n*this.height;for(const h in o[l]){const d=i.list.get(h),p=l+h,f=this.list.has(p);if(!d||e&&f||!e&&!f)continue;e?this.list.add(p):this.list.delete(p);const g=o[l][h];d.applyTransform(g,a)}r++}}};A(hE,"uuid","d260618b-ce88-4c7d-826c-6debb91de3e2");const uE=class gm extends Re{constructor(e){super(e),A(this,"enabled",!0),this.components.add(gm.uuid,this)}set(e,t){const i=this.components.get(rt);if(!t){for(const n in i.list){const r=i.list.get(n);r&&(r.setVisibility(e),this.updateCulledVisibility(r))}return}for(const n in t){const r=t[n],o=i.list.get(n);o&&(o.setVisibility(e,r),this.updateCulledVisibility(o))}}isolate(e){this.set(!1),this.set(!0,e)}updateCulledVisibility(e){const t=this.components.get(Z1);for(const[i,n]of t.list){const r=n.colorMeshes.get(e.id);r&&(r.count=e.mesh.count)}}};A(uE,"uuid","dd9ccf2d-8a21-4821-b7f6-2949add16a29");class dE extends ru{constructor(){super(...arguments),A(this,"minGeometrySize",10),A(this,"minAssetsSize",1e3)}}let vm=class extends ru{constructor(){super(...arguments),A(this,"propertiesSize",100)}};class pE extends Re{constructor(){super(...arguments),A(this,"onPropertiesStreamed",new $i),A(this,"onProgress",new $i),A(this,"onIndicesStreamed",new $i),A(this,"onDisposed",new ee),A(this,"enabled",!0),A(this,"settings",new vm),A(this,"webIfc",new tn)}async dispose(){this.onIndicesStreamed.reset(),this.onPropertiesStreamed.reset(),this.webIfc=null,this.onDisposed.reset()}async streamFromBuffer(e){const t=performance.now();await this.readIfcFile(e),await this.streamAllProperties(),this.cleanUp(),console.log(`Streaming the IFC took ${performance.now()-t} ms!`)}async streamFromCallBack(e){const t=performance.now();await this.streamIfcFile(e),await this.streamAllProperties(),this.cleanUp(),console.log(`Streaming the IFC took ${performance.now()-t} ms!`)}async readIfcFile(e){const{path:t,absolute:i,logLevel:n}=this.settings.wasm;this.webIfc.SetWasmPath(t,i),await this.webIfc.Init(),n&&this.webIfc.SetLogLevel(n),this.webIfc.OpenModel(e,this.settings.webIfc)}async streamIfcFile(e){const{path:t,absolute:i,logLevel:n}=this.settings.wasm;this.webIfc.SetWasmPath(t,i),await this.webIfc.Init(),n&&this.webIfc.SetLogLevel(n),this.webIfc.OpenModelFromCallback(e,this.settings.webIfc)}async streamAllProperties(){const{propertiesSize:e}=this.settings,t=new Set(this.webIfc.GetIfcEntityList(0)),i=[cl,Qh,Wh,hl,Xh,Kh],n=new Map,r=new Set([pl,Zh,qh,dl,Wn]);for(const h of r)t.add(h);let o=.01,a=0;for(const h of t){if(a++,su.has(h))continue;const d=r.has(h),p=this.webIfc.GetLineIDsWithType(0,h),f=p.size();let g=0;for(let b=0;bo&&(o+=.01,o=Math.max(o,v),await this.onProgress.trigger(Math.round(o*100)/100))}const l=[];for(const[h,d]of n)l.push([h,...d]);await this.onIndicesStreamed.trigger(l)}getIndices(e,t,i){const n=e.RelatedObjects||e.RelatedElements;if(!n){console.log(`Related objects not found: ${t}`);return}const r=e.RelatingType||e.RelatingMaterial||e.RelatingStructure||e.RelatingPropertyDefinition||e.RelatingGroup||e.RelatingClassification;if(!r){console.log(`Relating object not found: ${t}`);return}if(!Array.isArray(n)||r.value===void 0)return;const o=r.value;for(const a of n){if(a.value===void 0||a.value===null)continue;const l=a.value;i.has(l)||i.set(l,new Set),i.get(l).add(o)}}cleanUp(){this.webIfc=null,this.webIfc=new tn}}A(pE,"uuid","88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");const fE=class ym extends Re{constructor(e){super(e),A(this,"onGeometryStreamed",new ee),A(this,"onAssetStreamed",new ee),A(this,"onProgress",new ee),A(this,"onIfcLoaded",new ee),A(this,"onDisposed",new ee),A(this,"settings",new dE),A(this,"enabled",!0),A(this,"webIfc",new tn),A(this,"_spatialTree",new cm),A(this,"_metaData",new um),A(this,"_visitedGeometries",new Map),A(this,"_streamSerializer",new Cf),A(this,"_geometries",new Map),A(this,"_geometryCount",0),A(this,"_civil",new hm),A(this,"_groupSerializer",new Ef),A(this,"_assets",[]),A(this,"_meshesWithHoles",new Set),this.components.add(ym.uuid,this),this.settings.excludedCategories.add(wf)}dispose(){this.onIfcLoaded.reset(),this.onGeometryStreamed.reset(),this.onAssetStreamed.reset(),this.webIfc=null,this.onDisposed.trigger(),this.onDisposed.reset()}async streamFromBuffer(e){const t=performance.now();await this.readIfcFile(e),await this.streamAllGeometries(),this.cleanUp(),console.log(`Streaming the IFC took ${performance.now()-t} ms!`)}async streamFromCallBack(e){const t=performance.now();await this.streamIfcFile(e),await this.streamAllGeometries(),this.cleanUp(),console.log(`Streaming the IFC took ${performance.now()-t} ms!`)}async readIfcFile(e){const{path:t,absolute:i,logLevel:n}=this.settings.wasm;this.webIfc.SetWasmPath(t,i),await this.webIfc.Init(),n&&this.webIfc.SetLogLevel(n),this.webIfc.OpenModel(e,this.settings.webIfc)}async streamIfcFile(e){const{path:t,absolute:i,logLevel:n}=this.settings.wasm;this.webIfc.SetWasmPath(t,i),await this.webIfc.Init(),n&&this.webIfc.SetLogLevel(n),this.webIfc.OpenModelFromCallback(e,this.settings.webIfc)}async streamAllGeometries(){const{minGeometrySize:e,minAssetsSize:t}=this.settings;this._spatialTree.setUp(this.webIfc);const i=this.webIfc.GetIfcEntityList(0),n=[[]],r=new If,{FILE_NAME:o,FILE_DESCRIPTION:a}=ii;r.ifcMetadata={name:this._metaData.get(this.webIfc,o),description:this._metaData.get(this.webIfc,a),schema:this.webIfc.GetModelSchema(0)||"IFC2X3",maxExpressID:this.webIfc.GetMaxExpressID(0)};let l=0,h=0;for(const T of i){if(!this.webIfc.IsIfcElement(T)&&T!==Wn||this.settings.excludedCategories.has(T))continue;const S=this.webIfc.GetLineIDsWithType(0,T),_=S.size();console.log(_);for(let I=0;I<_;I++){l>e&&(l=0,h++,n.push([]));const P=S.get(I);n[h].push(P);const M=this._spatialTree.itemsByFloor[P]||0;r.data.set(P,[[],[M,T]]),l++}}this._spatialTree.cleanUp();let d=.01,p=0;for(const T of n){p++,this.webIfc.StreamMeshes(0,T,_=>{this.getMesh(this.webIfc,_,r)}),this._geometryCount>e&&await this.streamGeometries(),this._assets.length>t&&await this.streamAssets();const S=p/n.length;S>d&&(d+=.01,d=Math.max(d,S),this.onProgress.trigger(Math.round(d*100)/100))}this._geometryCount&&await this.streamGeometries(),this._assets.length&&await this.streamAssets();const{opaque:f,transparent:g}=r.geometryIDs;for(const[T,{index:S,uuid:_}]of this._visitedGeometries)r.keyFragments.set(S,_),(T>1?f:g).set(T,S);const v=r.data.keys();for(const T of v){const[S]=r.data.get(T);S.length||r.data.delete(T)}const b=this.webIfc.GetCoordinationMatrix(0);r.coordinationMatrix.fromArray(b),r.civilData=this._civil.read(this.webIfc);const w=this._groupSerializer.export(r);this.onIfcLoaded.trigger(w),r.dispose(!0)}cleanUp(){this.webIfc=null,this.webIfc=new tn,this._visitedGeometries.clear(),this._geometries.clear(),this._assets=[],this._meshesWithHoles.clear()}getMesh(e,t,i){const n=t.geometries.size(),r=t.expressID,o={id:r,geometries:[]};for(let a=0;an&&(n+=.01,n=Math.max(n,f),await this.onProgress.trigger(Math.round(n*100)/100))}const o=await this.components.get(gl).processFromWebIfc(this.webIfc,0);await this.onIndicesStreamed.trigger(o)}cleanUp(){this.webIfc=null,this.webIfc=new tn}}A(mE,"uuid","88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");const Em=class bm extends Re{constructor(e){super(e),A(this,"enabled",!0),e.add(bm.uuid,this)}getFace(e,t,i){if(!e.geometry.index)throw new Error("Geometry must be indexed!");const n=new Map,r=e.geometry.index.array,{plane:o}=this.getFaceData(t,i,e),a=[];for(let p=0;pI.id);if(!g.size){const I=l++;for(const{id:P}of f)h.set(P,I);d.set(I,{edges:new Set(v),indices:new Set([p])});continue}let b=null;const w=new Set,T=new Set(v);for(const[I,P]of g){b===null?b=P:P!==b&&w.add(P),h.delete(I);const{edges:M}=d.get(P);M.delete(I),T.delete(I)}if(b===null)throw new Error("Error computing face!");const S=d.get(b),{indices:_}=S;_.add(p);for(const I of T){h.set(I,b);const{edges:P}=S;P.add(I)}for(const I of w){const P=d.get(I),{edges:M,indices:k}=P,V=d.get(b),{edges:W,indices:j}=V;for(const Q of M)W.add(Q),h.set(Q,b);for(const Q of k)j.add(Q);d.delete(I)}}for(const[p,{indices:f,edges:g}]of d)if(f.has(t)){const v=[];for(const b of g){const w=n.get(b);v.push(w)}return{edges:v,indices:f}}return null}static distanceFromPointToLine(e,t,i,n=!1){const r=new Dt,o=new O;return r.set(t,i),r.closestPointToPoint(e,n,o),o.distanceTo(e)}getFaceData(e,t,i){const n=this.getVerticesAndNormal(i,e,t),{p1:r,p2:o,p3:a,faceNormal:l}=n;this.round(r),this.round(o),this.round(a),this.round(l);const h=[{id:`${r.x}|${r.y}|${r.z}`,value:r},{id:`${o.x}|${o.y}|${o.z}`,value:o},{id:`${a.x}|${a.y}|${a.z}`,value:a}];h.sort((S,_)=>S.id<_.id?-1:S.id>_.id?1:0);const[{id:d,value:p},{id:f,value:g},{id:v,value:b}]=h,w=[{id:`${d}|${f}`,distance:p.distanceTo(g),points:[p,g]},{id:`${f}|${v}`,distance:g.distanceTo(b),points:[g,b]},{id:`${d}|${v}`,distance:p.distanceTo(b),points:[p,b]}],T=new an;return T.setFromNormalAndCoplanarPoint(l,r),T.constant=Math.round(T.constant*10)/10,{plane:T,edges:w}}getVerticesAndNormal(e,t,i){if(!e.geometry.index)throw new Error("Geometry must be indexed!");const n=e.geometry.index.array,r=e.geometry.attributes.position.array,o=e.geometry.attributes.normal.array,a=n[t*3]*3,l=n[t*3+1]*3,h=n[t*3+2]*3,d=new O(r[a],r[a+1],r[a+2]),p=new O(r[l],r[l+1],r[l+2]),f=new O(r[h],r[h+1],r[h+2]),g=new O(o[a],o[a+1],o[a+2]),v=new O(o[l],o[l+1],o[l+2]),b=new O(o[h],o[h+1],o[h+2]),w=(g.x+v.x+b.x)/3,T=(g.y+v.y+b.y)/3,S=(g.z+v.z+b.z)/3,_=new O(w,T,S);if(i!==void 0&&e instanceof Kt){const I=new Ee;e.getMatrixAt(i,I);const P=new Ee;P.extractRotation(I),_.applyMatrix4(P),d.applyMatrix4(I),p.applyMatrix4(I),f.applyMatrix4(I)}return{p1:d,p2:p,p3:f,faceNormal:_}}round(e){e.x=Math.trunc(e.x*1e3)/1e3,e.y=Math.trunc(e.y*1e3)/1e3,e.z=Math.trunc(e.z*1e3)/1e3}};A(Em,"uuid","267ca032-672f-4cb0-afa9-d24e904f39d6");let ja=Em;const Kd=new Ke,ba=new O;class wm extends Nv{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(i),this.setAttribute("position",new Ps(e,3)),this.setAttribute("uv",new Ps(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,i=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),i.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const i=new Qc(t,6,1);return this.setAttribute("instanceStart",new xs(i,3,0)),this.setAttribute("instanceEnd",new xs(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const i=new Qc(t,6,1);return this.setAttribute("instanceColorStart",new xs(i,3,0)),this.setAttribute("instanceColorEnd",new xs(i,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new Uv(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ke);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),Kd.setFromBufferAttribute(t),this.boundingBox.union(Kd))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Gn),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const i=this.boundingSphere.center;this.boundingBox.getCenter(i);let n=0;for(let r=0,o=e.count;r #include #include @@ -455,7 +455,7 @@ var gv=Object.defineProperty;var vv=(s,e,t)=>e in s?gv(s,e,{enumerable:!0,config #include } - `};let ro=class extends wt{constructor(e){super({type:"LineMaterial",uniforms:Yh.clone(Oa.line.uniforms),vertexShader:Oa.line.vertexShader,fragmentShader:Oa.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1))}};const Zd=new F,qd=new F,pt=new Vs,ft=new Vs,fi=new Vs,Bc=new F,zc=new Ee,mt=new Dt,Jd=new F,wa=new Ke,Ia=new Gn,mi=new Vs;let vi,Nn;function $d(s,e,t){return mi.set(0,0,-e,1).applyMatrix4(s.projectionMatrix),mi.multiplyScalar(1/mi.w),mi.x=Nn/t.width,mi.y=Nn/t.height,mi.applyMatrix4(s.projectionMatrixInverse),mi.multiplyScalar(1/mi.w),Math.abs(Math.max(mi.x,mi.y))}function gE(s,e){const t=s.matrixWorld,i=s.geometry,n=i.attributes.instanceStart,r=i.attributes.instanceEnd,o=Math.min(i.instanceCount,n.count);for(let a=0,l=o;ad&&ft.z>d)continue;if(pt.z>d){const T=pt.z-ft.z,S=(pt.z-d)/T;pt.lerp(ft,S)}else if(ft.z>d){const T=ft.z-pt.z,S=(ft.z-d)/T;ft.lerp(pt,S)}pt.applyMatrix4(i),ft.applyMatrix4(i),pt.multiplyScalar(1/pt.w),ft.multiplyScalar(1/ft.w),pt.x*=n.x/2,pt.y*=n.y/2,ft.x*=n.x/2,ft.y*=n.y/2,mt.start.copy(pt),mt.start.z=0,mt.end.copy(ft),mt.end.z=0;const g=mt.closestPointToPointParameter(Bc,!0);mt.at(g,Jd);const y=so.lerp(pt.z,ft.z,g),b=y>=-1&&y<=1,w=Bc.distanceTo(Jd)t.geometry.attributes.position.count&&(t.geometry.dispose(),t.geometry=new Wa),t.geometry.setPositions(o),n&&t.geometry.setColors(a),i.geometry.setFromPoints(l)}newCurve(e,t,i){const n=new Wa,r=new ro({color:t,linewidth:e,vertexColors:i,worldUnits:!1,depthTest:!1}),o=new Im(n,r);return this.scene.add(o),o}newPoints(e,t){const i=new Ne,n=new gt(new Float32Array,3);i.setAttribute("position",n);const r=new mf({size:e,color:t,sizeAttenuation:!1,depthTest:!1}),o=new gf(i,r);return o.frustumCulled=!1,this.scene.add(o),o}};x(Cm,"settings",{colors:{LINE:[213/255,0/255,255/255],CIRCULARARC:[0/255,46,255/255],CLOTHOID:[0/255,255/255,0/255],PARABOLICARC:[0/255,255/255,72/255],CONSTANTGRADIENT:[213/255,0/255,255/255]}});let xm=Cm;class EE extends kn{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new Ve(.5,.5),this.addEventListener("removed",function(){this.traverse(function(t){t.element instanceof Element&&t.element.parentNode!==null&&t.element.parentNode.removeChild(t.element)})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}const bs=new F,ep=new Ee,tp=new Ee,ip=new F,np=new F;class bE{constructor(e={}){const t=this;let i,n,r,o;const a={objects:new WeakMap},l=e.element!==void 0?e.element:document.createElement("div");l.style.overflow="hidden",this.domElement=l,this.getSize=function(){return{width:i,height:n}},this.render=function(g,y){g.matrixWorldAutoUpdate===!0&&g.updateMatrixWorld(),y.parent===null&&y.matrixWorldAutoUpdate===!0&&y.updateMatrixWorld(),ep.copy(y.matrixWorldInverse),tp.multiplyMatrices(y.projectionMatrix,ep),h(g,g,y),f(g)},this.setSize=function(g,y){i=g,n=y,r=i/2,o=n/2,l.style.width=g+"px",l.style.height=y+"px"};function h(g,y,b){if(g.isCSS2DObject){bs.setFromMatrixPosition(g.matrixWorld),bs.applyMatrix4(tp);const w=g.visible===!0&&bs.z>=-1&&bs.z<=1&&g.layers.test(b.layers)===!0;if(g.element.style.display=w===!0?"":"none",w===!0){g.onBeforeRender(t,y,b);const S=g.element;S.style.transform="translate("+-100*g.center.x+"%,"+-100*g.center.y+"%)translate("+(bs.x*r+r)+"px,"+(-bs.y*o+o)+"px)",S.parentNode!==l&&l.appendChild(S),g.onAfterRender(t,y,b)}const T={distanceToCameraSquared:d(b,g)};a.objects.set(g,T)}for(let w=0,T=g.children.length;w{if(this.onBeforeUpdate.trigger(this),!this.enabled||!this.currentWorld)return;const n=this.currentWorld.scene.three,r=this.currentWorld.camera.three;n instanceof Xn&&this.three2D.render(n,r)}),this.onDisposed.add(()=>{this.three2D.domElement.remove()}),this.onResize.add(({x:n,y:r})=>{this.three2D.setSize(n,r)}),this.setupHtmlRenderer(),this.resize()}setupHtmlRenderer(){this.three2D.domElement.style.position="absolute",this.three2D.domElement.style.top="0px",this.three2D.domElement.style.pointerEvents="none",this.container&&this.container.appendChild(this.three2D.domElement)}}const Sm=class _m extends Re{constructor(e){super(e),x(this,"enabled",!0),x(this,"threshold",50),x(this,"autoCluster",!0),x(this,"list",new Map),x(this,"clusterLabels",new Set),x(this,"currentKeys",new Set),x(this,"_color","white"),x(this,"_markerKey",0),x(this,"_clusterKey",0),x(this,"isNavigating",!1),x(this,"_setupWorlds",new Set),e.add(_m.uuid,this)}get color(){return this._color}set color(e){this._color=e;for(const[t,i]of this.list)i.label.three.element.style.color=e}create(e,t,i,n=!1){this.setupEvents(e,!0);const r=document.createElement("span");r.innerHTML=t,r.style.color=this._color;const o=new _t(e,r);o.three.position.copy(i);const a=this._markerKey.toString();return this.list.set(a,{key:a,label:o,merged:!1,static:n}),this._markerKey++,a}delete(e){const t=this.list.get(e);t&&t.label.dispose(),this.list.delete(e)}clear(e){const t=[...this.list.keys()];for(const i of t){const n=this.list.get(i);e&&n.type!==e||(n.label.dispose(),this.list.delete(i))}this.list.clear(),this._markerKey=0}dispose(){for(const[e,t]of this.list)t.label.dispose();this.list.clear(),this._markerKey=0;for(const e of this.clusterLabels)e.label.dispose();this.clusterLabels.clear(),this._clusterKey=0,this.currentKeys.clear()}setupEvents(e,t){t&&this._setupWorlds.has(e.uuid)||e.camera.hasCameraControls()&&(t?(e.camera.controls.addEventListener("sleep",()=>{this.manageCluster()}),e.camera.controls.addEventListener("rest",()=>{this.isNavigating&&(this.manageCluster(),this.isNavigating=!1)})):(e.camera.controls.removeEventListener("sleep",()=>{this.manageCluster()}),e.camera.controls.removeEventListener("rest",()=>{this.isNavigating&&(this.manageCluster(),this.isNavigating=!1)})))}resetMarkers(){for(const[e,t]of this.list)t.merged=!1;for(const e of this.clusterLabels)e.label.dispose();this.clusterLabels.clear(),this._clusterKey=0}removeMergeMarkers(){for(const[e,t]of this.list)t.merged?t.label.dispose():t.label.world.scene.three.add(t.label.three);for(const e of this.clusterLabels)if(e.markerKeys.length===1){const t=this.list.get(e.markerKeys[0]);t&&(t.label.world.scene.three.add(t.label.three),t.merged=!1),e.label.dispose(),this.clusterLabels.delete(e)}}manageCluster(){if(this.autoCluster){this.resetMarkers();for(const[e,t]of this.list)if(!t.merged&&!t.static){this.currentKeys.clear();for(const[i,n]of this.list)n.static||t.key!==n.key&&!n.merged&&this.distance(t.label,n.label)0){this.currentKeys.add(t.key),t.merged=!0;const i=Array.from(this.currentKeys),n=this.getAveragePositionFromLabels(i),r=new _t(t.label.world,this.createClusterElement(this._clusterKey.toString())),{element:o}=r.three;o.textContent=i.length.toString(),r.three.position.copy(n),this.clusterLabels.add({key:this._clusterKey.toString(),markerKeys:i,label:r}),this._clusterKey++}}this.removeMergeMarkers()}}getAveragePositionFromLabels(e){const t=e.map(i=>{const n=this.list.get(i);return n?n.label.three.position:new F});return t.reduce((i,n)=>i.add(n),new F).divideScalar(t.length)}createClusterElement(e){const t=document.createElement("div");return t.textContent=e,t.style.color="#000000",t.style.background="#FFFFFF",t.style.fontSize="1.2rem",t.style.fontWeight="500",t.style.pointerEvents="auto",t.style.borderRadius="50%",t.style.padding="5px 11px",t.style.textAlign="center",t.style.cursor="pointer",t.addEventListener("pointerdown",()=>{this.navigateToCluster(e)}),t.addEventListener("pointerover",()=>{t.style.background="#BCF124"}),t.addEventListener("pointerout",()=>{t.style.background="#FFFFFF"}),t}getScreenPosition(e){const t=new F;if(!e.world.renderer)throw new Error("Renderer not found!");const i=e.three.position.clone();i.project(e.world.camera.three);const n=e.world.renderer.getSize();return t.x=i.x*n.x/2+n.x/2,t.y=-(i.y*n.y/2)+n.y/2,t}distance(e,t){const i=this.getScreenPosition(e),n=this.getScreenPosition(t),r=i.x-n.x,o=i.y-n.y,a=Math.sqrt(r*r+o*o)*.5;return a===0?this.threshold+1:a}navigateToCluster(e){const t=[],i=Array.from(this.clusterLabels).find(h=>h.key===e);if(!i)return;const n=i.label.world.camera;if(!n.hasCameraControls()){console.warn("Zoom to clusters only supported with Camera Controls!");return}for(const h of i.markerKeys){const d=this.list.get(h);if(d){const{x:p,y:f,z:g}=d.label.three.position;t.push(p,f,g)}}i.label.dispose(),this.clusterLabels.delete(i);const r=new Ne,o=new Float32Array(t),a=new gt(o,3);r.setAttribute("position",a);const l=new le(r);l.geometry.computeBoundingSphere(),l.geometry.boundingSphere&&n.controls.fitToSphere(l,!0),this.isNavigating=!0,r.dispose(),l.clear(),t.length=0}};x(Sm,"uuid","4079eb91-79b0-4ede-bcf2-15b837129236");let An=Sm;var sp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rm(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var au={exports:{}};au.exports=gl;au.exports.default=gl;function gl(s,e,t){t=t||2;var i=e&&e.length,n=i?e[0]*t:s.length,r=Pm(s,0,n,t,!0),o=[];if(!r||r.next===r.prev)return o;var a,l,h,d,p,f,g;if(i&&(r=xE(s,e,r,t)),s.length>80*t){a=h=s[0],l=d=s[1];for(var y=t;yh&&(h=p),f>d&&(d=f);g=Math.max(h-a,d-l),g=g!==0?32767/g:0}return Vr(r,o,t,a,l,g,0),o}function Pm(s,e,t,i,n){var r,o;if(n===mh(s,e,t,i)>0)for(r=e;r=e;r-=i)o=rp(r,s[r],s[r+1],o);return o&&vl(o,o.next)&&(Yr(o),o=o.next),o}function Bn(s,e){if(!s)return s;e||(e=s);var t=s,i;do if(i=!1,!t.steiner&&(vl(t,t.next)||$e(t.prev,t,t.next)===0)){if(Yr(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Vr(s,e,t,i,n,r,o){if(s){!o&&r&&PE(s,i,n,r);for(var a=s,l,h;s.prev!==s.next;){if(l=s.prev,h=s.next,r?IE(s,i,n,r):wE(s)){e.push(l.i/t|0),e.push(s.i/t|0),e.push(h.i/t|0),Yr(s),s=h.next,a=h.next;continue}if(s=h,s===a){o?o===1?(s=CE(Bn(s),e,t),Vr(s,e,t,i,n,r,2)):o===2&&TE(s,e,t,i,n,r):Vr(Bn(s),e,t,i,n,r,1);break}}}}function wE(s){var e=s.prev,t=s,i=s.next;if($e(e,t,i)>=0)return!1;for(var n=e.x,r=t.x,o=i.x,a=e.y,l=t.y,h=i.y,d=nr?n>o?n:o:r>o?r:o,g=a>l?a>h?a:h:l>h?l:h,y=i.next;y!==e;){if(y.x>=d&&y.x<=f&&y.y>=p&&y.y<=g&&Ss(n,a,r,l,o,h,y.x,y.y)&&$e(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function IE(s,e,t,i){var n=s.prev,r=s,o=s.next;if($e(n,r,o)>=0)return!1;for(var a=n.x,l=r.x,h=o.x,d=n.y,p=r.y,f=o.y,g=al?a>h?a:h:l>h?l:h,w=d>p?d>f?d:f:p>f?p:f,T=ph(g,y,e,t,i),S=ph(b,w,e,t,i),_=s.prevZ,I=s.nextZ;_&&_.z>=T&&I&&I.z<=S;){if(_.x>=g&&_.x<=b&&_.y>=y&&_.y<=w&&_!==n&&_!==o&&Ss(a,d,l,p,h,f,_.x,_.y)&&$e(_.prev,_,_.next)>=0||(_=_.prevZ,I.x>=g&&I.x<=b&&I.y>=y&&I.y<=w&&I!==n&&I!==o&&Ss(a,d,l,p,h,f,I.x,I.y)&&$e(I.prev,I,I.next)>=0))return!1;I=I.nextZ}for(;_&&_.z>=T;){if(_.x>=g&&_.x<=b&&_.y>=y&&_.y<=w&&_!==n&&_!==o&&Ss(a,d,l,p,h,f,_.x,_.y)&&$e(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;I&&I.z<=S;){if(I.x>=g&&I.x<=b&&I.y>=y&&I.y<=w&&I!==n&&I!==o&&Ss(a,d,l,p,h,f,I.x,I.y)&&$e(I.prev,I,I.next)>=0)return!1;I=I.nextZ}return!0}function CE(s,e,t){var i=s;do{var n=i.prev,r=i.next.next;!vl(n,r)&&Fm(n,i,i.next,r)&&Hr(n,r)&&Hr(r,n)&&(e.push(n.i/t|0),e.push(i.i/t|0),e.push(r.i/t|0),Yr(i),Yr(i.next),i=s=r),i=i.next}while(i!==s);return Bn(i)}function TE(s,e,t,i,n,r){var o=s;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&ME(o,a)){var l=Om(o,a);o=Bn(o,o.next),l=Bn(l,l.next),Vr(o,e,t,i,n,r,0),Vr(l,e,t,i,n,r,0);return}a=a.next}o=o.next}while(o!==s)}function xE(s,e,t,i){var n=[],r,o,a,l,h;for(r=0,o=e.length;r=t.next.y&&t.next.y!==t.y){var a=t.x+(n-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(a<=i&&a>r&&(r=a,o=t.x=t.x&&t.x>=h&&i!==t.x&&Ss(no.x||t.x===o.x&&RE(o,t)))&&(o=t,p=f)),t=t.next;while(t!==l);return o}function RE(s,e){return $e(s.prev,s,e.prev)<0&&$e(e.next,s,s.next)<0}function PE(s,e,t,i){var n=s;do n.z===0&&(n.z=ph(n.x,n.y,e,t,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==s);n.prevZ.nextZ=null,n.prevZ=null,FE(n)}function FE(s){var e,t,i,n,r,o,a,l,h=1;do{for(t=s,s=null,r=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(n=t,t=t.nextZ,a--):(n=i,i=i.nextZ,l--),r?r.nextZ=n:s=n,n.prevZ=r,r=n;t=i}r.nextZ=null,h*=2}while(o>1);return s}function ph(s,e,t,i,n){return s=(s-t)*n|0,e=(e-i)*n|0,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,s|e<<1}function OE(s){var e=s,t=s;do(e.x=(s-o)*(r-a)&&(s-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(r-a)>=(n-o)*(i-a)}function ME(s,e){return s.next.i!==e.i&&s.prev.i!==e.i&&!LE(s,e)&&(Hr(s,e)&&Hr(e,s)&&DE(s,e)&&($e(s.prev,s,e.prev)||$e(s,e.prev,e))||vl(s,e)&&$e(s.prev,s,s.next)>0&&$e(e.prev,e,e.next)>0)}function $e(s,e,t){return(e.y-s.y)*(t.x-e.x)-(e.x-s.x)*(t.y-e.y)}function vl(s,e){return s.x===e.x&&s.y===e.y}function Fm(s,e,t,i){var n=Ta($e(s,e,t)),r=Ta($e(s,e,i)),o=Ta($e(t,i,s)),a=Ta($e(t,i,e));return!!(n!==r&&o!==a||n===0&&Ca(s,t,e)||r===0&&Ca(s,i,e)||o===0&&Ca(t,s,i)||a===0&&Ca(t,e,i))}function Ca(s,e,t){return e.x<=Math.max(s.x,t.x)&&e.x>=Math.min(s.x,t.x)&&e.y<=Math.max(s.y,t.y)&&e.y>=Math.min(s.y,t.y)}function Ta(s){return s>0?1:s<0?-1:0}function LE(s,e){var t=s;do{if(t.i!==s.i&&t.next.i!==s.i&&t.i!==e.i&&t.next.i!==e.i&&Fm(t,t.next,s,e))return!0;t=t.next}while(t!==s);return!1}function Hr(s,e){return $e(s.prev,s,s.next)<0?$e(s,e,s.next)>=0&&$e(s,s.prev,e)>=0:$e(s,e,s.prev)<0||$e(s,s.next,e)<0}function DE(s,e){var t=s,i=!1,n=(s.x+e.x)/2,r=(s.y+e.y)/2;do t.y>r!=t.next.y>r&&t.next.y!==t.y&&n<(t.next.x-t.x)*(r-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==s);return i}function Om(s,e){var t=new fh(s.i,s.x,s.y),i=new fh(e.i,e.x,e.y),n=s.next,r=e.prev;return s.next=e,e.prev=s,t.next=n,n.prev=t,i.next=t,t.prev=i,r.next=i,i.prev=r,i}function rp(s,e,t,i){var n=new fh(s,e,t);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function Yr(s){s.next.prev=s.prev,s.prev.next=s.next,s.prevZ&&(s.prevZ.nextZ=s.nextZ),s.nextZ&&(s.nextZ.prevZ=s.prevZ)}function fh(s,e,t){this.i=s,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}gl.deviation=function(s,e,t,i){var n=e&&e.length,r=n?e[0]*t:s.length,o=Math.abs(mh(s,0,r,t));if(n)for(var a=0,l=e.length;a0&&(i+=s[n-1].length,t.holes.push(i))}return t};var NE=au.exports;const UE=Rm(NE),kE={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:` + `};let ro=class extends wt{constructor(e){super({type:"LineMaterial",uniforms:Gh.clone(Fa.line.uniforms),vertexShader:Fa.line.vertexShader,fragmentShader:Fa.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1))}};const Qd=new O,Zd=new O,pt=new Vs,ft=new Vs,fi=new Vs,zc=new O,Vc=new Ee,mt=new Dt,qd=new O,wa=new Ke,Ia=new Gn,mi=new Vs;let vi,Nn;function Jd(s,e,t){return mi.set(0,0,-e,1).applyMatrix4(s.projectionMatrix),mi.multiplyScalar(1/mi.w),mi.x=Nn/t.width,mi.y=Nn/t.height,mi.applyMatrix4(s.projectionMatrixInverse),mi.multiplyScalar(1/mi.w),Math.abs(Math.max(mi.x,mi.y))}function gE(s,e){const t=s.matrixWorld,i=s.geometry,n=i.attributes.instanceStart,r=i.attributes.instanceEnd,o=Math.min(i.instanceCount,n.count);for(let a=0,l=o;ad&&ft.z>d)continue;if(pt.z>d){const T=pt.z-ft.z,S=(pt.z-d)/T;pt.lerp(ft,S)}else if(ft.z>d){const T=ft.z-pt.z,S=(ft.z-d)/T;ft.lerp(pt,S)}pt.applyMatrix4(i),ft.applyMatrix4(i),pt.multiplyScalar(1/pt.w),ft.multiplyScalar(1/ft.w),pt.x*=n.x/2,pt.y*=n.y/2,ft.x*=n.x/2,ft.y*=n.y/2,mt.start.copy(pt),mt.start.z=0,mt.end.copy(ft),mt.end.z=0;const g=mt.closestPointToPointParameter(zc,!0);mt.at(g,qd);const v=so.lerp(pt.z,ft.z,g),b=v>=-1&&v<=1,w=zc.distanceTo(qd)t.geometry.attributes.position.count&&(t.geometry.dispose(),t.geometry=new Wa),t.geometry.setPositions(o),n&&t.geometry.setColors(a),i.geometry.setFromPoints(l)}newCurve(e,t,i){const n=new Wa,r=new ro({color:t,linewidth:e,vertexColors:i,worldUnits:!1,depthTest:!1}),o=new Im(n,r);return this.scene.add(o),o}newPoints(e,t){const i=new Ne,n=new gt(new Float32Array,3);i.setAttribute("position",n);const r=new ff({size:e,color:t,sizeAttenuation:!1,depthTest:!1}),o=new mf(i,r);return o.frustumCulled=!1,this.scene.add(o),o}};x(Cm,"settings",{colors:{LINE:[213/255,0/255,255/255],CIRCULARARC:[0/255,46,255/255],CLOTHOID:[0/255,255/255,0/255],PARABOLICARC:[0/255,255/255,72/255],CONSTANTGRADIENT:[213/255,0/255,255/255]}});let xm=Cm;class EE extends kn{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new Ve(.5,.5),this.addEventListener("removed",function(){this.traverse(function(t){t.element instanceof Element&&t.element.parentNode!==null&&t.element.parentNode.removeChild(t.element)})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}const bs=new O,$d=new Ee,ep=new Ee,tp=new O,ip=new O;class bE{constructor(e={}){const t=this;let i,n,r,o;const a={objects:new WeakMap},l=e.element!==void 0?e.element:document.createElement("div");l.style.overflow="hidden",this.domElement=l,this.getSize=function(){return{width:i,height:n}},this.render=function(g,v){g.matrixWorldAutoUpdate===!0&&g.updateMatrixWorld(),v.parent===null&&v.matrixWorldAutoUpdate===!0&&v.updateMatrixWorld(),$d.copy(v.matrixWorldInverse),ep.multiplyMatrices(v.projectionMatrix,$d),h(g,g,v),f(g)},this.setSize=function(g,v){i=g,n=v,r=i/2,o=n/2,l.style.width=g+"px",l.style.height=v+"px"};function h(g,v,b){if(g.isCSS2DObject){bs.setFromMatrixPosition(g.matrixWorld),bs.applyMatrix4(ep);const w=g.visible===!0&&bs.z>=-1&&bs.z<=1&&g.layers.test(b.layers)===!0;if(g.element.style.display=w===!0?"":"none",w===!0){g.onBeforeRender(t,v,b);const S=g.element;S.style.transform="translate("+-100*g.center.x+"%,"+-100*g.center.y+"%)translate("+(bs.x*r+r)+"px,"+(-bs.y*o+o)+"px)",S.parentNode!==l&&l.appendChild(S),g.onAfterRender(t,v,b)}const T={distanceToCameraSquared:d(b,g)};a.objects.set(g,T)}for(let w=0,T=g.children.length;w{if(this.onBeforeUpdate.trigger(this),!this.enabled||!this.currentWorld)return;const n=this.currentWorld.scene.three,r=this.currentWorld.camera.three;n instanceof Xn&&this.three2D.render(n,r)}),this.onDisposed.add(()=>{this.three2D.domElement.remove()}),this.onResize.add(({x:n,y:r})=>{this.three2D.setSize(n,r)}),this.setupHtmlRenderer(),this.resize()}setupHtmlRenderer(){this.three2D.domElement.style.position="absolute",this.three2D.domElement.style.top="0px",this.three2D.domElement.style.pointerEvents="none",this.container&&this.container.appendChild(this.three2D.domElement)}}const Sm=class _m extends Re{constructor(e){super(e),x(this,"onDisposed",new ee),x(this,"enabled",!0),x(this,"threshold",50),x(this,"autoCluster",!0),x(this,"list",new Map),x(this,"_worldEvents",new Map),x(this,"clusterLabels",new Set),x(this,"currentKeys",new Set),x(this,"_color","white"),x(this,"_markerKey",0),x(this,"_clusterKey",0),x(this,"_setupWorlds",new Set),e.add(_m.uuid,this)}get color(){return this._color}set color(e){this._color=e;for(const[t,i]of this.list)for(const[n,r]of i)r.label.three.element.style.color=e}create(e,t,i,n=!1){this.setupEvents(e,!0);const r=this._markerKey.toString(),o=this.getWorldMarkerList(e);if(o.has(r))return;const a=document.createElement("span");a.innerHTML=t,a.style.color=this._color;const l=new _t(e,a);return l.three.position.copy(i),o.set(r,{key:r,label:l,merged:!1,static:n}),this._markerKey++,r}delete(e){for(const[t,i]of this.list){const n=i.get(e);n&&n.label.dispose(),i.delete(e)}}getWorldMarkerList(e){return this.list.has(e.uuid)||this.list.set(e.uuid,new Map),this.list.get(e.uuid)}dispose(e){for(const[t,i]of this.list){const n=[...i.keys()];for(const r of n){const o=i.get(r);e&&o.type!==e||(o.label.dispose(),i.delete(r))}}if(!e){this.list.clear(),this._markerKey=0;for(const t of this.clusterLabels)t.label.dispose();this.clusterLabels.clear(),this._clusterKey=0,this.currentKeys.clear()}this.onDisposed.trigger()}setupEvents(e,t){if(t&&this._setupWorlds.has(e.uuid)||!e.camera.hasCameraControls())return;const i=this.getWorldEvent(e);e.camera.controls.removeEventListener("sleep",i),e.camera.controls.removeEventListener("rest",i),t&&(e.camera.controls.addEventListener("sleep",i),e.camera.controls.addEventListener("rest",i))}getWorldEvent(e){if(!this._worldEvents.has(e.uuid)){const t=()=>{this.cluster(e)};this._worldEvents.set(e.uuid,t)}return this._worldEvents.get(e.uuid)}resetMarkers(){for(const[e,t]of this.list)for(const[i,n]of t)n.merged=!1;for(const e of this.clusterLabels)e.label.dispose();this.clusterLabels.clear(),this._clusterKey=0}removeMergeMarkers(e){const t=this.list.get(e.uuid);if(t){for(const[i,n]of t)n.merged?n.label.dispose():n.label.world.scene.three.add(n.label.three);for(const i of this.clusterLabels)if(i.markerKeys.length===1){for(const[n,r]of this.list){const o=r.get(i.markerKeys[0]);o&&(o.label.world.scene.three.add(o.label.three),o.merged=!1)}i.label.dispose(),this.clusterLabels.delete(i)}}}cluster(e){if(!this.autoCluster)return;this.resetMarkers();const t=this.list.get(e.uuid);if(t){for(const[i,n]of t)if(!n.merged&&!n.static){this.currentKeys.clear();for(const[r,o]of t)o.static||n.key!==o.key&&!o.merged&&this.distance(n.label,o.label)0){this.currentKeys.add(n.key),n.merged=!0;const r=Array.from(this.currentKeys),o=this.getAveragePositionFromLabels(r),a=new _t(n.label.world,this.createClusterElement(this._clusterKey.toString())),{element:l}=a.three;l.textContent=r.length.toString(),a.three.position.copy(o),this.clusterLabels.add({key:this._clusterKey.toString(),markerKeys:r,label:a}),this._clusterKey++}}this.removeMergeMarkers(e)}}getAveragePositionFromLabels(e){const t=e.map(i=>{for(const[n,r]of this.list){const o=r.get(i);if(o)return o.label.three.position}return new O});return t.reduce((i,n)=>i.add(n),new O).divideScalar(t.length)}createClusterElement(e){const t=document.createElement("div");return t.textContent=e,t.style.color="#000000",t.style.background="#FFFFFF",t.style.fontSize="1.2rem",t.style.fontWeight="500",t.style.pointerEvents="auto",t.style.borderRadius="50%",t.style.padding="5px 11px",t.style.textAlign="center",t.style.cursor="pointer",t.addEventListener("pointerdown",()=>{this.navigateToCluster(e)}),t.addEventListener("pointerover",()=>{t.style.background="#BCF124"}),t.addEventListener("pointerout",()=>{t.style.background="#FFFFFF"}),t}getScreenPosition(e){const t=new O;if(!e.world.renderer)throw new Error("Renderer not found!");const i=e.three.position.clone();i.project(e.world.camera.three);const n=e.world.renderer.getSize();return t.x=i.x*n.x/2+n.x/2,t.y=-(i.y*n.y/2)+n.y/2,t}distance(e,t){const i=this.getScreenPosition(e),n=this.getScreenPosition(t),r=i.x-n.x,o=i.y-n.y,a=Math.sqrt(r*r+o*o)*.5;return a===0?this.threshold+1:a}navigateToCluster(e){const t=[],i=Array.from(this.clusterLabels).find(h=>h.key===e);if(!i)return;const n=i.label.world.camera;if(!n.hasCameraControls()){console.warn("Zoom to clusters only supported with Camera Controls!");return}for(const h of i.markerKeys)for(const[d,p]of this.list){const f=p.get(h);if(f){const{x:g,y:v,z:b}=f.label.three.position;t.push(g,v,b)}}i.label.dispose(),this.clusterLabels.delete(i);const r=new Ne,o=new Float32Array(t),a=new gt(o,3);r.setAttribute("position",a);const l=new le(r);l.geometry.computeBoundingSphere(),l.geometry.boundingSphere&&n.controls.fitToSphere(l,!0),r.dispose(),l.clear(),t.length=0}};x(Sm,"uuid","4079eb91-79b0-4ede-bcf2-15b837129236");let An=Sm;var np=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rm(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var ou={exports:{}};ou.exports=vl;ou.exports.default=vl;function vl(s,e,t){t=t||2;var i=e&&e.length,n=i?e[0]*t:s.length,r=Pm(s,0,n,t,!0),o=[];if(!r||r.next===r.prev)return o;var a,l,h,d,p,f,g;if(i&&(r=xE(s,e,r,t)),s.length>80*t){a=h=s[0],l=d=s[1];for(var v=t;vh&&(h=p),f>d&&(d=f);g=Math.max(h-a,d-l),g=g!==0?32767/g:0}return Vr(r,o,t,a,l,g,0),o}function Pm(s,e,t,i,n){var r,o;if(n===gh(s,e,t,i)>0)for(r=e;r=e;r-=i)o=sp(r,s[r],s[r+1],o);return o&&yl(o,o.next)&&(Yr(o),o=o.next),o}function Bn(s,e){if(!s)return s;e||(e=s);var t=s,i;do if(i=!1,!t.steiner&&(yl(t,t.next)||$e(t.prev,t,t.next)===0)){if(Yr(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Vr(s,e,t,i,n,r,o){if(s){!o&&r&&PE(s,i,n,r);for(var a=s,l,h;s.prev!==s.next;){if(l=s.prev,h=s.next,r?IE(s,i,n,r):wE(s)){e.push(l.i/t|0),e.push(s.i/t|0),e.push(h.i/t|0),Yr(s),s=h.next,a=h.next;continue}if(s=h,s===a){o?o===1?(s=CE(Bn(s),e,t),Vr(s,e,t,i,n,r,2)):o===2&&TE(s,e,t,i,n,r):Vr(Bn(s),e,t,i,n,r,1);break}}}}function wE(s){var e=s.prev,t=s,i=s.next;if($e(e,t,i)>=0)return!1;for(var n=e.x,r=t.x,o=i.x,a=e.y,l=t.y,h=i.y,d=nr?n>o?n:o:r>o?r:o,g=a>l?a>h?a:h:l>h?l:h,v=i.next;v!==e;){if(v.x>=d&&v.x<=f&&v.y>=p&&v.y<=g&&Ss(n,a,r,l,o,h,v.x,v.y)&&$e(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function IE(s,e,t,i){var n=s.prev,r=s,o=s.next;if($e(n,r,o)>=0)return!1;for(var a=n.x,l=r.x,h=o.x,d=n.y,p=r.y,f=o.y,g=al?a>h?a:h:l>h?l:h,w=d>p?d>f?d:f:p>f?p:f,T=fh(g,v,e,t,i),S=fh(b,w,e,t,i),_=s.prevZ,I=s.nextZ;_&&_.z>=T&&I&&I.z<=S;){if(_.x>=g&&_.x<=b&&_.y>=v&&_.y<=w&&_!==n&&_!==o&&Ss(a,d,l,p,h,f,_.x,_.y)&&$e(_.prev,_,_.next)>=0||(_=_.prevZ,I.x>=g&&I.x<=b&&I.y>=v&&I.y<=w&&I!==n&&I!==o&&Ss(a,d,l,p,h,f,I.x,I.y)&&$e(I.prev,I,I.next)>=0))return!1;I=I.nextZ}for(;_&&_.z>=T;){if(_.x>=g&&_.x<=b&&_.y>=v&&_.y<=w&&_!==n&&_!==o&&Ss(a,d,l,p,h,f,_.x,_.y)&&$e(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;I&&I.z<=S;){if(I.x>=g&&I.x<=b&&I.y>=v&&I.y<=w&&I!==n&&I!==o&&Ss(a,d,l,p,h,f,I.x,I.y)&&$e(I.prev,I,I.next)>=0)return!1;I=I.nextZ}return!0}function CE(s,e,t){var i=s;do{var n=i.prev,r=i.next.next;!yl(n,r)&&Om(n,i,i.next,r)&&Hr(n,r)&&Hr(r,n)&&(e.push(n.i/t|0),e.push(i.i/t|0),e.push(r.i/t|0),Yr(i),Yr(i.next),i=s=r),i=i.next}while(i!==s);return Bn(i)}function TE(s,e,t,i,n,r){var o=s;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&ME(o,a)){var l=Fm(o,a);o=Bn(o,o.next),l=Bn(l,l.next),Vr(o,e,t,i,n,r,0),Vr(l,e,t,i,n,r,0);return}a=a.next}o=o.next}while(o!==s)}function xE(s,e,t,i){var n=[],r,o,a,l,h;for(r=0,o=e.length;r=t.next.y&&t.next.y!==t.y){var a=t.x+(n-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(a<=i&&a>r&&(r=a,o=t.x=t.x&&t.x>=h&&i!==t.x&&Ss(no.x||t.x===o.x&&RE(o,t)))&&(o=t,p=f)),t=t.next;while(t!==l);return o}function RE(s,e){return $e(s.prev,s,e.prev)<0&&$e(e.next,s,s.next)<0}function PE(s,e,t,i){var n=s;do n.z===0&&(n.z=fh(n.x,n.y,e,t,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==s);n.prevZ.nextZ=null,n.prevZ=null,OE(n)}function OE(s){var e,t,i,n,r,o,a,l,h=1;do{for(t=s,s=null,r=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(n=t,t=t.nextZ,a--):(n=i,i=i.nextZ,l--),r?r.nextZ=n:s=n,n.prevZ=r,r=n;t=i}r.nextZ=null,h*=2}while(o>1);return s}function fh(s,e,t,i,n){return s=(s-t)*n|0,e=(e-i)*n|0,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,s|e<<1}function FE(s){var e=s,t=s;do(e.x=(s-o)*(r-a)&&(s-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(r-a)>=(n-o)*(i-a)}function ME(s,e){return s.next.i!==e.i&&s.prev.i!==e.i&&!LE(s,e)&&(Hr(s,e)&&Hr(e,s)&&DE(s,e)&&($e(s.prev,s,e.prev)||$e(s,e.prev,e))||yl(s,e)&&$e(s.prev,s,s.next)>0&&$e(e.prev,e,e.next)>0)}function $e(s,e,t){return(e.y-s.y)*(t.x-e.x)-(e.x-s.x)*(t.y-e.y)}function yl(s,e){return s.x===e.x&&s.y===e.y}function Om(s,e,t,i){var n=Ta($e(s,e,t)),r=Ta($e(s,e,i)),o=Ta($e(t,i,s)),a=Ta($e(t,i,e));return!!(n!==r&&o!==a||n===0&&Ca(s,t,e)||r===0&&Ca(s,i,e)||o===0&&Ca(t,s,i)||a===0&&Ca(t,e,i))}function Ca(s,e,t){return e.x<=Math.max(s.x,t.x)&&e.x>=Math.min(s.x,t.x)&&e.y<=Math.max(s.y,t.y)&&e.y>=Math.min(s.y,t.y)}function Ta(s){return s>0?1:s<0?-1:0}function LE(s,e){var t=s;do{if(t.i!==s.i&&t.next.i!==s.i&&t.i!==e.i&&t.next.i!==e.i&&Om(t,t.next,s,e))return!0;t=t.next}while(t!==s);return!1}function Hr(s,e){return $e(s.prev,s,s.next)<0?$e(s,e,s.next)>=0&&$e(s,s.prev,e)>=0:$e(s,e,s.prev)<0||$e(s,s.next,e)<0}function DE(s,e){var t=s,i=!1,n=(s.x+e.x)/2,r=(s.y+e.y)/2;do t.y>r!=t.next.y>r&&t.next.y!==t.y&&n<(t.next.x-t.x)*(r-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==s);return i}function Fm(s,e){var t=new mh(s.i,s.x,s.y),i=new mh(e.i,e.x,e.y),n=s.next,r=e.prev;return s.next=e,e.prev=s,t.next=n,n.prev=t,i.next=t,t.prev=i,r.next=i,i.prev=r,i}function sp(s,e,t,i){var n=new mh(s,e,t);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function Yr(s){s.next.prev=s.prev,s.prev.next=s.next,s.prevZ&&(s.prevZ.nextZ=s.nextZ),s.nextZ&&(s.nextZ.prevZ=s.prevZ)}function mh(s,e,t){this.i=s,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}vl.deviation=function(s,e,t,i){var n=e&&e.length,r=n?e[0]*t:s.length,o=Math.abs(gh(s,0,r,t));if(n)for(var a=0,l=e.length;a0&&(i+=s[n-1].length,t.holes.push(i))}return t};var NE=ou.exports;const UE=Rm(NE),kE={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:` varying vec2 vUv; @@ -478,7 +478,7 @@ var gv=Object.defineProperty;var vv=(s,e,t)=>e in s?gv(s,e,{enumerable:!0,config gl_FragColor = opacity * texel; - }`};let Ys=class{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}};const BE=new jn(-1,1,1,-1,0,1);class zE extends Ne{constructor(){super(),this.setAttribute("position",new Ps([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Ps([0,2,0,0,2,0],2))}}const VE=new zE;class Mm{constructor(e){this._mesh=new le(VE,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,BE)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}let Lm=class extends Ys{constructor(e,t){super(),this.textureID=t!==void 0?t:"tDiffuse",e instanceof wt?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=Yh.clone(e.uniforms),this.material=new wt({name:e.name!==void 0?e.name:"unspecified",defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new Mm(this.material)}render(e,t,i){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=i.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}dispose(){this.material.dispose(),this.fsQuad.dispose()}},op=class extends Ys{constructor(e,t){super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,i){const n=e.getContext(),r=e.state;r.buffers.color.setMask(!1),r.buffers.depth.setMask(!1),r.buffers.color.setLocked(!0),r.buffers.depth.setLocked(!0);let o,a;this.inverse?(o=0,a=1):(o=1,a=0),r.buffers.stencil.setTest(!0),r.buffers.stencil.setOp(n.REPLACE,n.REPLACE,n.REPLACE),r.buffers.stencil.setFunc(n.ALWAYS,o,4294967295),r.buffers.stencil.setClear(a),r.buffers.stencil.setLocked(!0),e.setRenderTarget(i),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),r.buffers.color.setLocked(!1),r.buffers.depth.setLocked(!1),r.buffers.color.setMask(!0),r.buffers.depth.setMask(!0),r.buffers.stencil.setLocked(!1),r.buffers.stencil.setFunc(n.EQUAL,1,4294967295),r.buffers.stencil.setOp(n.KEEP,n.KEEP,n.KEEP),r.buffers.stencil.setLocked(!0)}};class HE extends Ys{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}class YE{constructor(e,t){if(this.renderer=e,this._pixelRatio=e.getPixelRatio(),t===void 0){const i=e.getSize(new Ve);this._width=i.width,this._height=i.height,t=new Ri(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:Jh}),t.texture.name="EffectComposer.rt1"}else this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new Lm(kE),this.copyPass.material.blending=zv,this.clock=new yf}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){const t=this.passes.indexOf(e);t!==-1&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;ts.charCodeAt(0));const ZE=Uint8Array.from(atob(Dm),s=>s.charCodeAt(0));function Nm(s,e,t){if(e.getQueryParameter(s,e.QUERY_RESULT_AVAILABLE)){const i=e.getQueryParameter(s,e.QUERY_RESULT)/1e6;t.lastTime=i}else setTimeout(()=>{Nm(s,e,t)},1)}class qE extends Ys{constructor(e,t,i=512,n=512){super(),this.width=i,this.height=n,this.clear=!0,this.camera=t,this.scene=e,this.configuration=new Proxy({aoSamples:16,aoRadius:5,denoiseSamples:8,denoiseRadius:12,distanceFalloff:1,intensity:5,denoiseIterations:2,renderMode:0,color:new Rt(0,0,0),gammaCorrection:!0,logarithmicDepthBuffer:!1,screenSpaceRadius:!1,halfRes:!1,depthAwareUpsampling:!0},{set:(r,o,a)=>{const l=r[o];return r[o]=a,o==="aoSamples"&&l!==a&&this.configureAOPass(this.configuration.logarithmicDepthBuffer),o==="denoiseSamples"&&l!==a&&this.configureDenoisePass(this.configuration.logarithmicDepthBuffer),o==="halfRes"&&l!==a&&(this.configureAOPass(this.configuration.logarithmicDepthBuffer),this.configureHalfResTargets(),this.configureEffectCompositer(this.configuration.logarithmicDepthBuffer),this.setSize(this.width,this.height)),o==="depthAwareUpsampling"&&l!==a&&this.configureEffectCompositer(this.configuration.logarithmicDepthBuffer),!0}}),this.samples=[],this.samplesR=[],this.samplesDenoise=[],this.configureEffectCompositer(this.configuration.logarithmicDepthBuffer),this.configureSampleDependentPasses(),this.configureHalfResTargets(),this.beautyRenderTarget=new Ri(this.width,this.height,{minFilter:fr,magFilter:Ai}),this.beautyRenderTarget.depthTexture=new Vv(this.width,this.height,Hv),this.beautyRenderTarget.depthTexture.format=Yv,this.writeTargetInternal=new Ri(this.width,this.height,{minFilter:fr,magFilter:fr,depthBuffer:!1}),this.readTargetInternal=new Ri(this.width,this.height,{minFilter:fr,magFilter:fr,depthBuffer:!1}),this.bluenoise=new Gv(ZE,128,128),this.bluenoise.colorSpace=jv,this.bluenoise.wrapS=cd,this.bluenoise.wrapT=cd,this.bluenoise.minFilter=Ai,this.bluenoise.magFilter=Ai,this.bluenoise.needsUpdate=!0,this.lastTime=0,this._r=new Ve,this._c=new Rt}configureHalfResTargets(){this.configuration.halfRes?(this.depthDownsampleTarget=new Wv(this.width/2,this.height/2,2),this.depthDownsampleTarget.texture[0].format=Xv,this.depthDownsampleTarget.texture[0].type=Kv,this.depthDownsampleTarget.texture[0].minFilter=Ai,this.depthDownsampleTarget.texture[0].magFilter=Ai,this.depthDownsampleTarget.texture[0].depthBuffer=!1,this.depthDownsampleTarget.texture[1].format=Sf,this.depthDownsampleTarget.texture[1].type=Jh,this.depthDownsampleTarget.texture[1].minFilter=Ai,this.depthDownsampleTarget.texture[1].magFilter=Ai,this.depthDownsampleTarget.texture[1].depthBuffer=!1,this.depthDownsampleQuad=new xa(new wt(QE))):(this.depthDownsampleTarget&&(this.depthDownsampleTarget.dispose(),this.depthDownsampleTarget=null),this.depthDownsampleQuad&&(this.depthDownsampleQuad.dispose(),this.depthDownsampleQuad=null))}configureSampleDependentPasses(){this.configureAOPass(this.configuration.logarithmicDepthBuffer),this.configureDenoisePass(this.configuration.logarithmicDepthBuffer)}configureAOPass(e=!1){this.samples=this.generateHemisphereSamples(this.configuration.aoSamples),this.samplesR=this.generateHemisphereSamplesR(this.configuration.aoSamples);const t={...WE};t.fragmentShader=t.fragmentShader.replace("16",this.configuration.aoSamples).replace("16.0",this.configuration.aoSamples+".0"),e&&(t.fragmentShader=`#define LOGDEPTH + }`};var Dm="5L7pP4UXrOIr/VZ1G3f6p89FIWU7lqc7J3DPxKjJUXODJoHQzf/aNVM+ABlvhXeBGN7iC0WkmTjEaAqOItBfBdaK5KSGV1ET5SOKl3x9JOX5w2sAl6+6KjDhVUHgbqq7DZ5EeYzbdSNxtrQLW/KkPJoOTG4u5CBUZkCKHniY9l7DUgjuz708zG1HIC8qfohi1vPjPH9Lq47ksjRrjwXD4MlVCjdAqYFGodQ8tRmHkOfq4wVRIAHvoavPHvN1lpk3X4Y1yzAPGe8S9KBs3crc4GwlU1dEOXiWol/mgQqxkNqB1xd04+0Bmpwj0GcCc4NUi+c731FUxjvaexCkCJ0qhrJJ++htWqetNC4NewClu8aFRSwrqiJEGe+qtTg4CYCHaF1wJI0sy/ZBQAI0qAMyBvVjWZlv2pdkCaro9eWDLK5I4mbb8E4d7hZr9dDJiTJm6Bmb5S+2F7yal/JPdeLUfwq7jmVLaQfhv4tWMJAt7V4sG9LuAv2oPJgSj1nnlBvPibfHM2TrlWHwGCLGxW/5Jm2TotaDL+pHDM5pn1r0UuTZ24N8S5k68bLHW9tfD+2k4zGev23ExJb4YTRKWrj82N5LjJ26lj1BkGZ0CsXLGGELoPaYQomjTqPxYqhfwOwDliNGVqux9ffuybqOKgsbB51B1GbZfG8vHDBE2JQGib1mnCmWOWAMJcHN0cKeDHYTflbDTVXajtr68mwfRje6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kyykQHjbF56zgcPX6DdMG03WKUMlYz+uOZ+5DZy9E9MZOZ9GMoLFdrIPPQQLjv+GlCMpoyHPXkzIODjHAID2PrnaRpqWVHh0rnieDILKq+Emrd5RnjgE9pDUXWTmHaKuqqYlcgEz4zbi46dbWrAAFBjsQq1rLHIiPJEcwFLCOY4JNlXRXQJqCUKXk2d1RSBGzDP6HDSpo863BhVRFFF6uIpjQV7j5ebFe3UkkO/+coIo2BTAcgBqOtQ134s9a4QJvofuqBYMGOBMsWZ+sn/2AOxDx6SfAnDFGw==";Uint8Array.from(atob(Dm),s=>s.charCodeAt(0));const ZE=Uint8Array.from(atob(Dm),s=>s.charCodeAt(0));function Nm(s,e,t){if(e.getQueryParameter(s,e.QUERY_RESULT_AVAILABLE)){const i=e.getQueryParameter(s,e.QUERY_RESULT)/1e6;t.lastTime=i}else setTimeout(()=>{Nm(s,e,t)},1)}class qE extends Ys{constructor(e,t,i=512,n=512){super(),this.width=i,this.height=n,this.clear=!0,this.camera=t,this.scene=e,this.configuration=new Proxy({aoSamples:16,aoRadius:5,denoiseSamples:8,denoiseRadius:12,distanceFalloff:1,intensity:5,denoiseIterations:2,renderMode:0,color:new Rt(0,0,0),gammaCorrection:!0,logarithmicDepthBuffer:!1,screenSpaceRadius:!1,halfRes:!1,depthAwareUpsampling:!0},{set:(r,o,a)=>{const l=r[o];return r[o]=a,o==="aoSamples"&&l!==a&&this.configureAOPass(this.configuration.logarithmicDepthBuffer),o==="denoiseSamples"&&l!==a&&this.configureDenoisePass(this.configuration.logarithmicDepthBuffer),o==="halfRes"&&l!==a&&(this.configureAOPass(this.configuration.logarithmicDepthBuffer),this.configureHalfResTargets(),this.configureEffectCompositer(this.configuration.logarithmicDepthBuffer),this.setSize(this.width,this.height)),o==="depthAwareUpsampling"&&l!==a&&this.configureEffectCompositer(this.configuration.logarithmicDepthBuffer),!0}}),this.samples=[],this.samplesR=[],this.samplesDenoise=[],this.configureEffectCompositer(this.configuration.logarithmicDepthBuffer),this.configureSampleDependentPasses(),this.configureHalfResTargets(),this.beautyRenderTarget=new Ri(this.width,this.height,{minFilter:fr,magFilter:Ai}),this.beautyRenderTarget.depthTexture=new Vv(this.width,this.height,Hv),this.beautyRenderTarget.depthTexture.format=Yv,this.writeTargetInternal=new Ri(this.width,this.height,{minFilter:fr,magFilter:fr,depthBuffer:!1}),this.readTargetInternal=new Ri(this.width,this.height,{minFilter:fr,magFilter:fr,depthBuffer:!1}),this.bluenoise=new Gv(ZE,128,128),this.bluenoise.colorSpace=jv,this.bluenoise.wrapS=ld,this.bluenoise.wrapT=ld,this.bluenoise.minFilter=Ai,this.bluenoise.magFilter=Ai,this.bluenoise.needsUpdate=!0,this.lastTime=0,this._r=new Ve,this._c=new Rt}configureHalfResTargets(){this.configuration.halfRes?(this.depthDownsampleTarget=new Wv(this.width/2,this.height/2,2),this.depthDownsampleTarget.texture[0].format=Xv,this.depthDownsampleTarget.texture[0].type=Kv,this.depthDownsampleTarget.texture[0].minFilter=Ai,this.depthDownsampleTarget.texture[0].magFilter=Ai,this.depthDownsampleTarget.texture[0].depthBuffer=!1,this.depthDownsampleTarget.texture[1].format=Af,this.depthDownsampleTarget.texture[1].type=$h,this.depthDownsampleTarget.texture[1].minFilter=Ai,this.depthDownsampleTarget.texture[1].magFilter=Ai,this.depthDownsampleTarget.texture[1].depthBuffer=!1,this.depthDownsampleQuad=new xa(new wt(QE))):(this.depthDownsampleTarget&&(this.depthDownsampleTarget.dispose(),this.depthDownsampleTarget=null),this.depthDownsampleQuad&&(this.depthDownsampleQuad.dispose(),this.depthDownsampleQuad=null))}configureSampleDependentPasses(){this.configureAOPass(this.configuration.logarithmicDepthBuffer),this.configureDenoisePass(this.configuration.logarithmicDepthBuffer)}configureAOPass(e=!1){this.samples=this.generateHemisphereSamples(this.configuration.aoSamples),this.samplesR=this.generateHemisphereSamplesR(this.configuration.aoSamples);const t={...WE};t.fragmentShader=t.fragmentShader.replace("16",this.configuration.aoSamples).replace("16.0",this.configuration.aoSamples+".0"),e&&(t.fragmentShader=`#define LOGDEPTH `+t.fragmentShader),this.configuration.halfRes&&(t.fragmentShader=`#define HALFRES `+t.fragmentShader),this.effectShaderQuad?(this.effectShaderQuad.material.dispose(),this.effectShaderQuad.material=new wt(t)):this.effectShaderQuad=new xa(new wt(t))}configureDenoisePass(e=!1){this.samplesDenoise=this.generateDenoiseSamples(this.configuration.denoiseSamples,11);const t={...KE};t.fragmentShader=t.fragmentShader.replace("16",this.configuration.denoiseSamples),e&&(t.fragmentShader=`#define LOGDEPTH `+t.fragmentShader),this.poissonBlurQuad?(this.poissonBlurQuad.material.dispose(),this.poissonBlurQuad.material=new wt(t)):this.poissonBlurQuad=new xa(new wt(t))}configureEffectCompositer(e=!1){const t={...XE};e&&(t.fragmentShader=`#define LOGDEPTH `+t.fragmentShader),this.configuration.halfRes&&this.configuration.depthAwareUpsampling&&(t.fragmentShader=`#define HALFRES -`+t.fragmentShader),this.effectCompositerQuad?(this.effectCompositerQuad.material.dispose(),this.effectCompositerQuad.material=new wt(t)):this.effectCompositerQuad=new xa(new wt(t))}generateHemisphereSamples(e){const t=[];for(let i=0;i{this.updateCamera()});const i=this._world.renderer;this.overrideClippingPlanes||(this._renderer.clippingPlanes=i.clippingPlanes),this._renderer.outputColorSpace="srgb",this._renderer.toneMapping=Bv,this.newBasePass(e,t),this.newSaoPass(e,t),this.newGammaPass(),this.newCustomPass(e,t),this._initialized=!0,this.updatePasses()}updateProjection(e){this.composer.passes.forEach(t=>{t.camera=e}),this.update()}updatePasses(){for(const e of this.composer.passes)this.composer.removePass(e);this._basePass&&this.composer.addPass(this.basePass),this._settings.gamma&&this.composer.addPass(this.gammaPass),this._settings.ao&&this.composer.addPass(this.n8ao),this._settings.custom&&this.composer.addPass(this.customEffects)}newCustomPass(e,t){this._customEffects=new tb(new Ve(window.innerWidth,window.innerHeight),this._components,this._world,e,t)}newGammaPass(){this._gammaPass=new Lm(JE)}newSaoPass(e,t){if(!this._world.renderer)throw new Error("The given world must have a renderer!");const{width:i,height:n}=this._world.renderer.getSize();this._n8ao=new qE(e,t,i,n);const{configuration:r}=this._n8ao;r.aoSamples=16,r.denoiseSamples=1,r.denoiseRadius=13,r.aoRadius=1,r.distanceFalloff=4,r.aoRadius=1,r.intensity=4,r.halfRes=!0,r.color=new Rt().setHex(13421772,"srgb-linear")}newBasePass(e,t){this._basePass=new GE(e,t)}}let gh=class extends Am{constructor(e,t,i){super(e,t,i),x(this,"_postproduction"),this.onResize.add(n=>this.resizePostproduction(n)),this.onWorldChanged.add(()=>{this.currentWorld&&(this._postproduction&&this._postproduction.dispose(),this._postproduction=new ib(e,this.three,this.currentWorld),this.setPostproductionSize())})}get postproduction(){if(!this._postproduction)throw new Error("Renderer not initialized yet with a world!");return this._postproduction}update(){if(!this.enabled||!this.currentWorld)return;this.onBeforeUpdate.trigger();const e=this.currentWorld.scene.three,t=this.currentWorld.camera.three;this.postproduction.enabled?this.postproduction.composer.render():this.three.render(e,t),e instanceof Xn&&this.three2D.render(e,t),this.onAfterUpdate.trigger()}dispose(){super.dispose(),this.postproduction.dispose()}resizePostproduction(e){this.postproduction&&this.setPostproductionSize(e)}setPostproductionSize(e){if(!this.container)return;const t=e?e.x:this.container.clientWidth,i=e?e.y:this.container.clientHeight;this.postproduction.setSize(t,i)}};class nb{constructor(e,t,i,n){x(this,"mesh",new le(new Ne)),x(this,"world"),x(this,"styleName"),x(this,"_precission",1e4),x(this,"_tempVector",new F),x(this,"_plane"),x(this,"_geometry"),x(this,"_plane2DCoordinateSystem",new Ee),x(this,"_planeAxis"),this.world=e,this.mesh.material=n,this.mesh.frustumCulled=!1,this._plane=t;const{x:r,y:o,z:a}=t.normal;Math.abs(r)===1?this._planeAxis="x":Math.abs(o)===1?this._planeAxis="y":Math.abs(a)===1&&(this._planeAxis="z"),this._geometry=i,this.mesh.geometry.attributes.position=i.attributes.position;const l=t.normal.clone().multiplyScalar(.01);this.mesh.position.copy(l),this.visible=!0}get visible(){return this.mesh.parent!==null}set visible(e){const t=this.getStyle();e?(this.world.scene.three.add(this.mesh),t&&t.meshes.add(this.mesh)):(this.mesh.removeFromParent(),t&&t.meshes.delete(this.mesh))}set geometry(e){this._geometry=e,this.mesh.geometry.attributes.position=e.attributes.position}dispose(){const e=this.getStyle();e&&e.meshes.delete(this.mesh),this.mesh.geometry.dispose(),this.mesh.removeFromParent(),this.mesh.geometry=null,this.mesh=null,this._plane=null,this._geometry=null}update(e){const t=this._geometry.attributes.position.array;if(!t)return;this.updatePlane2DCoordinateSystem();const i=[];let n=0;for(let r=0;rthis._localPlane.intersectsBox(n),intersectsTriangle:n=>{let r=0;if(this._tempLine.start.copy(n.a),this._tempLine.end.copy(n.b),this._localPlane.intersectLine(this._tempLine,this._tempVector)){const o=this._tempVector.applyMatrix4(e.matrixWorld);t.setXYZ(i,o.x,o.y,o.z),r++,i++}if(this._tempLine.start.copy(n.b),this._tempLine.end.copy(n.c),this._localPlane.intersectLine(this._tempLine,this._tempVector)){const o=this._tempVector.applyMatrix4(e.matrixWorld);t.setXYZ(i,o.x,o.y,o.z),r++,i++}if(this._tempLine.start.copy(n.c),this._tempLine.end.copy(n.a),this._localPlane.intersectLine(this._tempLine,this._tempVector)){const o=this._tempVector.applyMatrix4(e.matrixWorld);t.setXYZ(i,o.x,o.y,o.z),r++,i++}r!==2&&(i-=r)}}),i}updateDeletedEdges(e){const t=Object.keys(this._edges);for(const i of t)e[i]===void 0&&(this.disposeEdge(i),this.disposeOutline(i))}disposeOutline(e){if(!this.world.renderer)return;const t=this.world.renderer;if(t instanceof gh){const i=t.postproduction.customEffects.outlinedMeshes;delete i[e]}}disposeEdge(e){const t=this.components.get(Oi),i=this._edges[e];i.fill&&i.fill.dispose(),t.destroy(i.mesh,!1),delete this._edges[e]}}let Gr=class extends Qf{constructor(e,t,i,n,r,o=5,a=!0){super(e,t,i,n,r,o,a),x(this,"edges"),x(this,"edgesMaxUpdateRate",50),x(this,"_visible",!0),x(this,"_edgesVisible",!0),x(this,"updateFill",()=>{this.edges.fillNeedsUpdate=!0,this.edges.update(),this.edges.visible=this._visible}),this.edges=new sb(e,t,this.three),this.toggleControls(!0),this.edges.visible=!0,this.onDraggingEnded.add(()=>{this.updateFill()}),this.onDraggingStarted.add(()=>this.edges.visible=!1)}get visible(){return this._visible}set visible(e){super.visible=e,this.toggleControls(e)}set enabled(e){this._enabled=e,this.world.renderer&&this.world.renderer.setPlane(e,this.three)}get enabled(){return super.enabled}dispose(){super.dispose(),this.edges.dispose()}};class rb{constructor(){x(this,"onDisposed",new ee),x(this,"enabled",!0),x(this,"list",{}),x(this,"_defaultLineMaterial",new Di({color:0,linewidth:.001})),x(this,"onAfterUpdate",new ee),x(this,"onBeforeUpdate",new ee)}update(e){this.onBeforeUpdate.trigger(this.list),this.onAfterUpdate.trigger(this.list)}create(e,t,i,n,r,o){if(!i.renderer)throw new Error("The given world doesn't have a renderer!");n||(n=this._defaultLineMaterial);for(const h of t)h.geometry.boundsTree||h.geometry.computeBoundsTree();const a=i.renderer;n.clippingPlanes=a.clippingPlanes;const l={name:e,lineMaterial:n,meshes:t,fillMaterial:r,outlineMaterial:o,fragments:{}};return this.list[e]=l,l}dispose(){const e=Object.keys(this.list);for(const t of e)this.deleteStyle(t);this.list={},this.onDisposed.trigger(),this.onDisposed.reset()}deleteStyle(e,t=!0){var i,n;const r=this.list[e];r&&(r.meshes.clear(),t&&(r.lineMaterial.dispose(),(i=r.fillMaterial)==null||i.dispose(),(n=r.outlineMaterial)==null||n.dispose())),delete this.list[e]}}const Um=class km extends Re{constructor(e){super(e),x(this,"onDisposed",new ee),x(this,"enabled",!0),x(this,"styles"),x(this,"fillsNeedUpdate",!1),x(this,"_visible",!0),this.components.list.set(km.uuid,this),this.styles=new rb}get visible(){return this._visible}set visible(e){this._visible=e;const t=this.components.get(Ga);for(const i of t.list)i instanceof Gr&&(i.edges.visible=e)}dispose(){this.styles.dispose(),this.onDisposed.trigger()}async update(e=!1){if(!this.enabled)return;const t=this.components.get(Ga);for(const i of t.list)i instanceof Gr&&(e||this.fillsNeedUpdate?i.updateFill():i.update());this.fillsNeedUpdate=!1}};x(Um,"uuid","24dfc306-a3c4-410f-8071-babc4afa5e4d");let Aa=Um;const ob={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:` + `}createOutlinePostProcessMaterial(){return new wt({uniforms:{opacity:{value:this._opacity},debugVisualize:{value:0},sceneColorBuffer:{value:null},tolerance:{value:this._tolerance},planeBuffer:{value:null},glossBuffer:{value:null},outlineBuffer:{value:null},glossEnabled:{value:1},minGloss:{value:this._minGloss},maxGloss:{value:this._maxGloss},outlineEnabled:{value:0},glossExponent:{value:this._glossExponent},width:{value:1},lineColor:{value:new Rt(this._lineColor)},screenSize:{value:new Vs(this.resolution.x,this.resolution.y,1/this.resolution.x,1/this.resolution.y)}},vertexShader:this.vertexShader,fragmentShader:this.fragmentShader})}newRenderTarget(){const e=new Ri(this.resolution.x,this.resolution.y);return e.texture.colorSpace="srgb-linear",e.texture.format=Af,e.texture.type=$h,e.texture.minFilter=Ai,e.texture.magFilter=Ai,e.texture.generateMipmaps=!1,e.stencilBuffer=!1,e}}class ib{constructor(e,t,i){if(x(this,"overrideClippingPlanes",!1),x(this,"composer"),x(this,"_enabled",!1),x(this,"_initialized",!1),x(this,"_n8ao"),x(this,"_customEffects"),x(this,"_basePass"),x(this,"_gammaPass"),x(this,"_depthTexture"),x(this,"_settings",{gamma:!0,custom:!0,ao:!1}),x(this,"_renderer"),x(this,"_components"),x(this,"_world"),x(this,"_renderTarget"),!i.renderer)throw new Error("The given world must have a renderer!");this._components=e,this._renderer=t,this._world=i,this._renderTarget=new Ri(window.innerWidth,window.innerHeight),this._renderTarget.texture.colorSpace="srgb-linear",this.composer=new YE(t,this._renderTarget),this.composer.setSize(window.innerWidth,window.innerHeight)}get basePass(){if(!this._basePass)throw new Error("Custom effects not initialized!");return this._basePass}get gammaPass(){if(!this._gammaPass)throw new Error("Custom effects not initialized!");return this._gammaPass}get customEffects(){if(!this._customEffects)throw new Error("Custom effects not initialized!");return this._customEffects}get n8ao(){if(!this._n8ao)throw new Error("Custom effects not initialized!");return this._n8ao}get enabled(){return this._enabled}set enabled(e){this._initialized||this.initialize(),this._enabled=e}get settings(){return{...this._settings}}dispose(){var e,t,i,n;this._renderTarget.dispose(),(e=this._depthTexture)==null||e.dispose(),(t=this._customEffects)==null||t.dispose(),(i=this._gammaPass)==null||i.dispose(),(n=this._n8ao)==null||n.dispose()}setPasses(e){let t=!1;for(const i in e){const n=i;if(this.settings[n]!==e[n]){t=!0;break}}if(t){for(const i in e){const n=i;this._settings[n]!==void 0&&(this._settings[n]=e[n])}this.updatePasses()}}setSize(e,t){this._initialized&&(this.composer.setSize(e,t),this.basePass.setSize(e,t),this.n8ao.setSize(e,t),this.customEffects.setSize(e,t),this.gammaPass.setSize(e,t))}update(){this._enabled&&this.composer.render()}updateCamera(){const e=this._world.camera.three;this._n8ao&&(this._n8ao.camera=e),this._customEffects&&(this._customEffects.renderCamera=e),this._basePass&&(this._basePass.camera=e)}initialize(){if(!this._world.renderer)throw new Error("The given world must have a renderer!");const e=this._world.scene.three,t=this._world.camera.three;if(!(e instanceof Xn))throw new Error("The given scene must have a THREE.Scene as core!");this._world.camera instanceof nE&&this._world.camera.projection.onChanged.add(()=>{this.updateCamera()});const i=this._world.renderer;this.overrideClippingPlanes||(this._renderer.clippingPlanes=i.clippingPlanes),this._renderer.outputColorSpace="srgb",this._renderer.toneMapping=Bv,this.newBasePass(e,t),this.newSaoPass(e,t),this.newGammaPass(),this.newCustomPass(e,t),this._initialized=!0,this.updatePasses()}updateProjection(e){this.composer.passes.forEach(t=>{t.camera=e}),this.update()}updatePasses(){for(const e of this.composer.passes)this.composer.removePass(e);this._basePass&&this.composer.addPass(this.basePass),this._settings.gamma&&this.composer.addPass(this.gammaPass),this._settings.ao&&this.composer.addPass(this.n8ao),this._settings.custom&&this.composer.addPass(this.customEffects)}newCustomPass(e,t){this._customEffects=new tb(new Ve(window.innerWidth,window.innerHeight),this._components,this._world,e,t)}newGammaPass(){this._gammaPass=new Lm(JE)}newSaoPass(e,t){if(!this._world.renderer)throw new Error("The given world must have a renderer!");const{width:i,height:n}=this._world.renderer.getSize();this._n8ao=new qE(e,t,i,n);const{configuration:r}=this._n8ao;r.aoSamples=16,r.denoiseSamples=1,r.denoiseRadius=13,r.aoRadius=1,r.distanceFalloff=4,r.aoRadius=1,r.intensity=4,r.halfRes=!0,r.color=new Rt().setHex(13421772,"srgb-linear")}newBasePass(e,t){this._basePass=new GE(e,t)}}let vh=class extends Am{constructor(e,t,i){super(e,t,i),x(this,"_postproduction"),this.onResize.add(n=>this.resizePostproduction(n)),this.onWorldChanged.add(()=>{this.currentWorld&&(this._postproduction&&this._postproduction.dispose(),this._postproduction=new ib(e,this.three,this.currentWorld),this.setPostproductionSize())})}get postproduction(){if(!this._postproduction)throw new Error("Renderer not initialized yet with a world!");return this._postproduction}update(){if(!this.enabled||!this.currentWorld)return;this.onBeforeUpdate.trigger();const e=this.currentWorld.scene.three,t=this.currentWorld.camera.three;this.postproduction.enabled?this.postproduction.composer.render():this.three.render(e,t),e instanceof Xn&&this.three2D.render(e,t),this.onAfterUpdate.trigger()}dispose(){super.dispose(),this.postproduction.dispose()}resizePostproduction(e){this.postproduction&&this.setPostproductionSize(e)}setPostproductionSize(e){if(!this.container)return;const t=e?e.x:this.container.clientWidth,i=e?e.y:this.container.clientHeight;this.postproduction.setSize(t,i)}};class nb{constructor(e,t,i,n){x(this,"mesh",new le(new Ne)),x(this,"world"),x(this,"styleName"),x(this,"_precission",1e4),x(this,"_tempVector",new O),x(this,"_plane"),x(this,"_geometry"),x(this,"_plane2DCoordinateSystem",new Ee),x(this,"_planeAxis"),this.world=e,this.mesh.material=n,this.mesh.frustumCulled=!1,this._plane=t;const{x:r,y:o,z:a}=t.normal;Math.abs(r)===1?this._planeAxis="x":Math.abs(o)===1?this._planeAxis="y":Math.abs(a)===1&&(this._planeAxis="z"),this._geometry=i,this.mesh.geometry.attributes.position=i.attributes.position;const l=t.normal.clone().multiplyScalar(.01);this.mesh.position.copy(l),this.visible=!0}get visible(){return this.mesh.parent!==null}set visible(e){const t=this.getStyle();e?(this.world.scene.three.add(this.mesh),t&&t.meshes.add(this.mesh)):(this.mesh.removeFromParent(),t&&t.meshes.delete(this.mesh))}set geometry(e){this._geometry=e,this.mesh.geometry.attributes.position=e.attributes.position}dispose(){const e=this.getStyle();e&&e.meshes.delete(this.mesh),this.mesh.geometry.dispose(),this.mesh.removeFromParent(),this.mesh.geometry=null,this.mesh=null,this._plane=null,this._geometry=null}update(e){const t=this._geometry.attributes.position.array;if(!t)return;this.updatePlane2DCoordinateSystem();const i=[];let n=0;for(let r=0;rthis._localPlane.intersectsBox(n),intersectsTriangle:n=>{let r=0;if(this._tempLine.start.copy(n.a),this._tempLine.end.copy(n.b),this._localPlane.intersectLine(this._tempLine,this._tempVector)){const o=this._tempVector.applyMatrix4(e.matrixWorld);t.setXYZ(i,o.x,o.y,o.z),r++,i++}if(this._tempLine.start.copy(n.b),this._tempLine.end.copy(n.c),this._localPlane.intersectLine(this._tempLine,this._tempVector)){const o=this._tempVector.applyMatrix4(e.matrixWorld);t.setXYZ(i,o.x,o.y,o.z),r++,i++}if(this._tempLine.start.copy(n.c),this._tempLine.end.copy(n.a),this._localPlane.intersectLine(this._tempLine,this._tempVector)){const o=this._tempVector.applyMatrix4(e.matrixWorld);t.setXYZ(i,o.x,o.y,o.z),r++,i++}r!==2&&(i-=r)}}),i}updateDeletedEdges(e){const t=Object.keys(this._edges);for(const i of t)e[i]===void 0&&(this.disposeEdge(i),this.disposeOutline(i))}disposeOutline(e){if(!this.world.renderer)return;const t=this.world.renderer;if(t instanceof vh){const i=t.postproduction.customEffects.outlinedMeshes;delete i[e]}}disposeEdge(e){const t=this.components.get(Fi),i=this._edges[e];i.fill&&i.fill.dispose(),t.destroy(i.mesh,!1),delete this._edges[e]}}let Gr=class extends Kf{constructor(e,t,i,n,r,o=5,a=!0){super(e,t,i,n,r,o,a),x(this,"edges"),x(this,"edgesMaxUpdateRate",50),x(this,"_visible",!0),x(this,"_edgesVisible",!0),x(this,"updateFill",()=>{this.edges.fillNeedsUpdate=!0,this.edges.update(),this.edges.visible=this._visible}),this.edges=new sb(e,t,this.three),this.toggleControls(!0),this.edges.visible=!0,this.onDraggingEnded.add(()=>{this.updateFill()}),this.onDraggingStarted.add(()=>this.edges.visible=!1)}get visible(){return this._visible}set visible(e){super.visible=e,this.toggleControls(e)}set enabled(e){this._enabled=e,this.world.renderer&&this.world.renderer.setPlane(e,this.three)}get enabled(){return super.enabled}dispose(){super.dispose(),this.edges.dispose()}};class rb{constructor(){x(this,"onDisposed",new ee),x(this,"enabled",!0),x(this,"list",{}),x(this,"_defaultLineMaterial",new Di({color:0,linewidth:.001})),x(this,"onAfterUpdate",new ee),x(this,"onBeforeUpdate",new ee)}update(e){this.onBeforeUpdate.trigger(this.list),this.onAfterUpdate.trigger(this.list)}create(e,t,i,n,r,o){if(!i.renderer)throw new Error("The given world doesn't have a renderer!");n||(n=this._defaultLineMaterial);for(const h of t)h.geometry.boundsTree||h.geometry.computeBoundsTree();const a=i.renderer;n.clippingPlanes=a.clippingPlanes;const l={name:e,lineMaterial:n,meshes:t,fillMaterial:r,outlineMaterial:o,fragments:{}};return this.list[e]=l,l}dispose(){const e=Object.keys(this.list);for(const t of e)this.deleteStyle(t);this.list={},this.onDisposed.trigger(),this.onDisposed.reset()}deleteStyle(e,t=!0){var i,n;const r=this.list[e];r&&(r.meshes.clear(),t&&(r.lineMaterial.dispose(),(i=r.fillMaterial)==null||i.dispose(),(n=r.outlineMaterial)==null||n.dispose())),delete this.list[e]}}const Um=class km extends Re{constructor(e){super(e),x(this,"onDisposed",new ee),x(this,"enabled",!0),x(this,"styles"),x(this,"fillsNeedUpdate",!1),x(this,"_visible",!0),this.components.list.set(km.uuid,this),this.styles=new rb}get visible(){return this._visible}set visible(e){this._visible=e;const t=this.components.get(Ga);for(const i of t.list)i instanceof Gr&&(i.edges.visible=e)}dispose(){this.styles.dispose(),this.onDisposed.trigger()}async update(e=!1){if(!this.enabled)return;const t=this.components.get(Ga);for(const i of t.list)i instanceof Gr&&(e||this.fillsNeedUpdate?i.updateFill():i.update());this.fillsNeedUpdate=!1}};x(Um,"uuid","24dfc306-a3c4-410f-8071-babc4afa5e4d");let Aa=Um;const ob={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:` varying vec2 vUv; @@ -1460,34 +1460,34 @@ void main() { gl_FragColor = sum; - }`},lb=class Is extends Re{constructor(e){super(e),x(this,"onDisposed",new ee),x(this,"enabled",!0),x(this,"cameraHeight",10),x(this,"darkness",1.2),x(this,"opacity",1),x(this,"resolution",512),x(this,"amount",3.5),x(this,"planeColor",16777215),x(this,"shadowOffset",0),x(this,"shadowExtraScaleFactor",1.5),x(this,"list",{}),x(this,"tempMaterial",new Xt({visible:!1})),x(this,"depthMaterial",new xf),this.components.add(Is.uuid,this),this.initializeDepthMaterial()}dispose(){for(const e in this.list)this.deleteShadow(e);this.tempMaterial.dispose(),this.depthMaterial.dispose(),this.components=null,this.onDisposed.trigger(Is.uuid),this.onDisposed.reset()}create(e,t,i){if(this.list[t])throw new Error(`There is already a shadow with ID ${t}`);const{size:n,center:r,min:o}=this.getSizeCenterMin(e),a=this.createShadow(t,n,i);return this.initializeShadow(a,r,o),this.createPlanes(a,n),this.bakeShadow(e,a),a.root}deleteShadow(e){const t=this.components.get(Oi),i=this.list[e];if(delete this.list[e],!i)throw new Error(`No shadow with ID ${e} was found.`);t.destroy(i.root),t.destroy(i.blurPlane),i.rt.dispose(),i.rtBlur.dispose()}createPlanes(e,t){const i=new ul(t.x,t.z).rotateX(Math.PI/2);this.createBasePlane(e,i),Is.createBlurPlane(e,i)}initializeShadow(e,t,i){this.initializeRoot(e,t,i),Is.initializeRenderTargets(e),Is.initializeCamera(e)}bakeShadow(e,t){const i=t.world.scene.three;if(!(i instanceof Xn))throw new Error("The core of the scene of the world must be a scene!");if(!t.world.renderer)throw new Error("The given world must have a renderer!");const n=t.world.renderer.three,r=e.map(h=>!!h.parent);for(let h=0;h!e.includes(h)&&h!==t.root);for(let h=o.length-1;h>=0;h--)i.remove(o[h]);const a=i.background;i.background=null,i.overrideMaterial=this.depthMaterial;const l=[];for(const h of e)l.push(h.visible),h.visible=!0;n.setRenderTarget(t.rt),n.render(i,t.camera),i.overrideMaterial=null,this.blurShadow(t,this.amount),this.blurShadow(t,this.amount*.4),n.setRenderTarget(null),i.background=a;for(let h=0;h=0;h--)i.add(o[h]);for(let h=0;h{i.uniforms.darkness=this.depthMaterial.userData.darkness,i.fragmentShader=` + }`},lb=class Is extends Re{constructor(e){super(e),x(this,"onDisposed",new ee),x(this,"enabled",!0),x(this,"cameraHeight",10),x(this,"darkness",1.2),x(this,"opacity",1),x(this,"resolution",512),x(this,"amount",3.5),x(this,"planeColor",16777215),x(this,"shadowOffset",0),x(this,"shadowExtraScaleFactor",1.5),x(this,"list",{}),x(this,"tempMaterial",new Xt({visible:!1})),x(this,"depthMaterial",new Tf),this.components.add(Is.uuid,this),this.initializeDepthMaterial()}dispose(){for(const e in this.list)this.deleteShadow(e);this.tempMaterial.dispose(),this.depthMaterial.dispose(),this.components=null,this.onDisposed.trigger(Is.uuid),this.onDisposed.reset()}create(e,t,i){if(this.list[t])throw new Error(`There is already a shadow with ID ${t}`);const{size:n,center:r,min:o}=this.getSizeCenterMin(e),a=this.createShadow(t,n,i);return this.initializeShadow(a,r,o),this.createPlanes(a,n),this.bakeShadow(e,a),a.root}deleteShadow(e){const t=this.components.get(Fi),i=this.list[e];if(delete this.list[e],!i)throw new Error(`No shadow with ID ${e} was found.`);t.destroy(i.root),t.destroy(i.blurPlane),i.rt.dispose(),i.rtBlur.dispose()}createPlanes(e,t){const i=new ul(t.x,t.z).rotateX(Math.PI/2);this.createBasePlane(e,i),Is.createBlurPlane(e,i)}initializeShadow(e,t,i){this.initializeRoot(e,t,i),Is.initializeRenderTargets(e),Is.initializeCamera(e)}bakeShadow(e,t){const i=t.world.scene.three;if(!(i instanceof Xn))throw new Error("The core of the scene of the world must be a scene!");if(!t.world.renderer)throw new Error("The given world must have a renderer!");const n=t.world.renderer.three,r=e.map(h=>!!h.parent);for(let h=0;h!e.includes(h)&&h!==t.root);for(let h=o.length-1;h>=0;h--)i.remove(o[h]);const a=i.background;i.background=null,i.overrideMaterial=this.depthMaterial;const l=[];for(const h of e)l.push(h.visible),h.visible=!0;n.setRenderTarget(t.rt),n.render(i,t.camera),i.overrideMaterial=null,this.blurShadow(t,this.amount),this.blurShadow(t,this.amount*.4),n.setRenderTarget(null),i.background=a;for(let h=0;h=0;h--)i.add(o[h]);for(let h=0;h{i.uniforms.darkness=this.depthMaterial.userData.darkness,i.fragmentShader=` uniform float darkness; ${i.fragmentShader.replace(e,t)} - `}}createShadow(e,t,i){return this.list[e]={root:new Fs,world:i,rt:new Ri(this.resolution,this.resolution),rtBlur:new Ri(this.resolution,this.resolution),blurPlane:new le,camera:this.createCamera(t)},this.list[e]}createCamera(e){return new jn(-e.x/2,e.x/2,e.z/2,-e.z/2,0,this.cameraHeight)}getSizeCenterMin(e){const t=e[0].parent,i=new Fs;i.children=e;const n=new Ke().setFromObject(i);t==null||t.add(...e);const r=new F;n.getSize(r),r.x*=this.shadowExtraScaleFactor,r.z*=this.shadowExtraScaleFactor;const o=new F;n.getCenter(o);const a=n.min;return{size:r,center:o,min:a}}blurShadow(e,t){if(!e.world.renderer)throw new Error("The given world must have a renderer!");const i=new wt(ob);i.depthTest=!1;const n=new wt(ab);n.depthTest=!1,e.blurPlane.visible=!0,e.blurPlane.material=i,e.blurPlane.material.uniforms.tDiffuse.value=e.rt.texture,i.uniforms.h.value=t*1/256;const r=e.world.renderer.three;r.setRenderTarget(e.rtBlur),r.render(e.blurPlane,e.camera),e.blurPlane.material=n,e.blurPlane.material.uniforms.tDiffuse.value=e.rtBlur.texture,n.uniforms.v.value=t*1/256,r.setRenderTarget(e.rt),r.render(e.blurPlane,e.camera),e.blurPlane.visible=!1}};x(lb,"uuid","f833a09a-a3ab-4c58-b03e-da5298c7a1b6");const cb=["Station","Radius","Length","InitialKP","FinalKP","KP","Slope","Height","InitialKPV","FinalKPV"],Bm=class zm extends Re{constructor(e){super(e),x(this,"enabled",!0),x(this,"world",null),x(this,"list",new Map),x(this,"_markerKey",0),x(this,"type","horizontal"),x(this,"divisionLength",100),e.add(zm.uuid,this)}addKPStation(e,t,i){const n=this.components.get(An),r=document.createElement("div"),o=document.createElement("div");r.appendChild(o),o.innerHTML=t,o.style.color=n.color,o.style.borderBottom="1px dotted white",o.style.width="160px",o.style.textAlign="left";const a=new _t(e,r),l=new F;l.x=i.geometry.attributes.position.getX(i.geometry.attributes.position.count-1),l.y=i.geometry.attributes.position.getY(i.geometry.attributes.position.count-1),l.z=i.geometry.attributes.position.getZ(i.geometry.attributes.position.count-1);const h=new F;h.x=i.geometry.attributes.position.getX(i.geometry.attributes.position.count-2),h.y=i.geometry.attributes.position.getY(i.geometry.attributes.position.count-2),h.z=i.geometry.attributes.position.getZ(i.geometry.attributes.position.count-2);const d=new F;d.x=(l.x+h.x)/2,d.y=(l.y+h.y)/2,d.z=(l.z+h.z)/2,a.three.position.copy(d);const p=new F;p.subVectors(l,h).normalize();const f=new Vt;f.setFromUnitVectors(new F(0,1,0),p);const g=new vf().setFromQuaternion(f).z,y=so.radToDeg(g);o.style.transform=`rotate(${-y-90}deg) translate(-35%, -50%)`;const b=this._markerKey.toString();n.list.set(b,{label:a,key:b,merged:!1,static:!1}),this._markerKey++,this.save(b,"KP")}addVerticalMarker(e,t,i,n,r){const o=this.components.get(An),a=document.createElement("span");a.innerHTML=t,a.style.color=o.color;const l=new _t(e,a,r);if(n==="Height"){const d=document.createElement("span");d.innerHTML=t,d.style.color=o.color;const{position:p}=i.geometry.attributes,f=(p.array.length/3-1)*3,g=p.array.slice(f,f+3);l.three.position.set(g[0],g[1]+10,g[2])}else if(n==="InitialKPV"){const{position:d}=i.geometry.attributes,p=d.getX(0),f=d.getY(0),g=d.getZ(0);l.three.position.set(p-20,f,g)}else if(n==="FinalKPV"){const{position:d}=i.geometry.attributes,p=d.getX(i.geometry.attributes.position.count-1),f=d.getY(i.geometry.attributes.position.count-1),g=d.getZ(i.geometry.attributes.position.count-1);l.three.position.set(p+20,f,g)}else if(n==="Slope"){a.style.color="grey";const{position:d}=i.geometry.attributes,p=new F;p.x=d.getX(0),p.y=d.getY(0),p.z=d.getZ(0);const f=new F;f.x=d.getX(d.count-1),f.y=d.getY(d.count-1),f.z=d.getZ(d.count-1);const g=new F;g.addVectors(p,f).multiplyScalar(.5),l.three.position.set(g.x,g.y-10,g.z)}const h=this._markerKey.toString();return o.list.set(h,{label:l,key:h,type:n,merged:!1,static:!1}),this._markerKey++,this.save(h,n),l}addCivilMarker(e,t,i,n){const r=this.components.get(An),o=document.createElement("span");o.innerHTML=t,o.style.color=r.color;const a=new _t(e,o);if(n==="InitialKP"){const h=i.geometry.attributes.position.getX(0),d=i.geometry.attributes.position.getY(0),p=i.geometry.attributes.position.getZ(0);a.three.position.set(h+2,d+2,p)}else if(n==="FinalKP"){const h=i.geometry.attributes.position.getX(i.geometry.attributes.position.count-1),d=i.geometry.attributes.position.getY(i.geometry.attributes.position.count-1),p=i.geometry.attributes.position.getZ(i.geometry.attributes.position.count-1);a.three.position.set(h+2,d-2,p)}else if(n==="Length"){const h=new F;h.x=i.geometry.attributes.position.getX(0),h.y=i.geometry.attributes.position.getY(0),h.z=i.geometry.attributes.position.getZ(0);const d=new F;d.x=i.geometry.attributes.position.getX(i.geometry.attributes.position.count-1),d.y=i.geometry.attributes.position.getY(i.geometry.attributes.position.count-1),d.z=i.geometry.attributes.position.getZ(i.geometry.attributes.position.count-1);const p=h.distanceTo(d);a.three.element.innerText=p.toFixed(2);const f=d.clone().add(h).divideScalar(2);a.three.position.copy(f)}const l=this._markerKey.toString();return r.list.set(l,{label:a,key:l,type:n,merged:!1,static:!1}),this._markerKey++,this.save(l,n),a}showKPStations(e){if(!this.world)throw new Error("A world is needed for this component to work!");if(this.type==="horizontal"){const t=this.generateStartAndEndKP(e);for(const[,n]of t)this.addKPStation(this.world,n.value,n.normal);const i=this.generateConstantKP(e);for(const[,n]of i)this.addKPStation(this.world,n.value,n.normal)}}showCurveLength(e,t){if(!this.world)throw new Error("A world is needed for this component to work!");const i=this.components.get(An),n=e.length,r=`${t.toFixed(2)} m`,o=Math.round(n/2),a=e[o],l=i.create(this.world,r,a,!0);this.save(l,"Length")}showLineLength(e,t){if(!this.world)throw new Error("A world is needed for this component to work!");const i=this.components.get(An),n=new F;n.x=e.geometry.getAttribute("position").getX(0),n.y=e.geometry.getAttribute("position").getY(0),n.z=e.geometry.getAttribute("position").getZ(0);const r=new F;r.x=e.geometry.getAttribute("position").getX(1),r.y=e.geometry.getAttribute("position").getY(1),r.z=e.geometry.getAttribute("position").getZ(1);const o=`${t.toFixed(2)} m`,a=new F;a.addVectors(n,r).multiplyScalar(.5);const l=i.create(this.world,o,a,!0);this.save(l,"Length")}showCurveRadius(e,t){if(!this.world)throw new Error("A world is needed for this component to work!");const i=this.components.get(An),n=new F;n.x=e.geometry.getAttribute("position").getX(0),n.y=e.geometry.getAttribute("position").getY(0),n.z=e.geometry.getAttribute("position").getZ(0);const r=new F;r.x=e.geometry.getAttribute("position").getX(1),r.y=e.geometry.getAttribute("position").getY(1),r.z=e.geometry.getAttribute("position").getZ(1);const o=`R = ${t.toFixed(2)} m`,a=new F;a.addVectors(n,r).multiplyScalar(.5);const l=i.create(this.world,o,a,!0);this.save(l,"Radius")}deleteByType(e=cb){const t=this.components.get(An);for(const i of e){const n=this.list.get(i);if(n){for(const r of n)t.delete(r);this.list.delete(i)}}}generateStartAndEndKP(e){const{alignment:t}=e.curve,i=new Map;for(const n of t.horizontal){const r=n.getLength();if(i.size>0){const o=n.index-1,a=i.get(o).distance+r,l=n.mesh.geometry.getAttribute("position"),h=l.count-1,d=new F;d.x=l.getX(h),d.y=l.getY(h),d.z=l.getZ(h);const p=this.createNormalLine(n.mesh);i.set(n.index,{value:this.getShortendKPValue(a),distance:a,point:d,normal:p})}else{const o=n.mesh.geometry.getAttribute("position"),a=o.count-1,l=new F;l.x=o.getX(a),l.y=o.getY(a),l.z=o.getZ(a);const h=this.createNormalLine(n.mesh);i.set(n.index,{value:this.getShortendKPValue(r),distance:r,point:l,normal:h})}}return i}createNormalLine(e){const t=e.geometry.attributes.position.count-1,i=t-1,n=new F;n.x=e.geometry.attributes.position.getX(t),n.y=e.geometry.attributes.position.getY(t),n.z=e.geometry.attributes.position.getZ(t);const r=new F;r.x=e.geometry.attributes.position.getX(i),r.y=e.geometry.attributes.position.getY(i),r.z=e.geometry.attributes.position.getZ(i);const o=new F().subVectors(n,r).clone().applyAxisAngle(new F(0,0,1),Math.PI*.5).normalize(),a=new Ne().setFromPoints([o.clone().setLength(10).add(n),o.clone().setLength(-10).add(n)]);return new st(a)}generateConstantKP(e){const{alignment:t}=e.curve,i=new Map,n=t.getLength("horizontal"),r=Math.floor(n/this.divisionLength);for(let o=0;o1e3&&parseInt(i,10)<1e4){const[o,...a]=i;return`${o}+${a.join("")}.${r}`}if(parseInt(i,10)>1e4){const[o,a,...l]=i;return`${o}${a}+${l.join("")}.${r}`}return`0+${i.padStart(3,"0")}.${r}`}save(e,t){this.list.has(t)||this.list.set(t,new Set),this.list.get(t).add(e)}};x(Bm,"uuid","0af12c32-81ee-4100-a030-e9ae546f6170");let Lr=Bm;class Vm extends Re{constructor(e){super(e),x(this,"enabled",!0),x(this,"highlighter"),x(this,"onHighlight",new ee),x(this,"onMarkerChange",new ee),x(this,"mouseMarkers"),x(this,"onMarkerHidden",new ee),x(this,"_curves",[]),x(this,"_previousAlignment",null),x(this,"_world",null),x(this,"updateLinesResolution",t=>{var i;(i=this.highlighter)==null||i.setResolution(t)}),x(this,"onMouseMove",t=>{var i,n,r;if(!this._world)throw new Error("No world was given for this navigator!");if(!this._world.renderer)return;const o=this._world.renderer.three.domElement.parentElement,a=this._world.camera.three,l=(i=this.highlighter)==null?void 0:i.castRay(t,a,o,this._curves);if(l){const{object:h}=l;(n=this.highlighter)==null||n.hover(h),this.updateMarker(l,"hover");return}this.mouseMarkers&&(this.mouseMarkers.hover.visible=!1),(r=this.highlighter)==null||r.unHover(),this.onMarkerHidden.trigger({type:"hover"})}),x(this,"onClick",t=>{var i,n;if(!this._world)throw new Error("No world was given for this navigator!");if(!this._world.renderer)return;const r=this._world.renderer.three.domElement.parentElement,o=this._world.camera.three,a=(i=this.highlighter)==null?void 0:i.castRay(t,o,r,this._curves);if(a){const l=a,h=l.object;if((n=this.highlighter)==null||n.select(h),this.updateMarker(l,"select"),this._world.camera.hasCameraControls()&&(h.geometry.boundingBox||h.geometry.computeBoundingBox(),h.geometry.boundingBox)){const d=this.getScaledBox(h.geometry.boundingBox,2);this._world.camera.controls.fitToBox(d,!0)}if(this.onHighlight.trigger({mesh:h,point:l.point}),this._previousAlignment!==h.curve.alignment){const d=this.components.get(Lr);d.deleteByType(),d.showKPStations(h),this._previousAlignment=h.curve.alignment}}}),x(this,"onControlsUpdated",()=>{if(!this._world)throw new Error("No world was given for this navigator!");if(!(this._world.camera.three instanceof jn)||!this.highlighter)return;const{zoom:t,left:i,right:n,top:r,bottom:o}=this._world.camera.three,a=i-n,l=r-o,h=Math.max(a,l)/t,d=40,{caster:p}=this.highlighter;p.params.Line.threshold=h/d})}get world(){return this._world}set world(e){var t,i,n;if(e===this._world||(this._world&&this.setupEvents(!1),this._world=e,(t=this.highlighter)==null||t.dispose(),(i=this.mouseMarkers)==null||i.hover.dispose(),(n=this.mouseMarkers)==null||n.select.dispose(),!e))return;const r=e.scene.three;this.highlighter=new xm(r,this.view),this.mouseMarkers={select:this.newMouseMarker("#ffffff",e),hover:this.newMouseMarker("#575757",e)},this.setupEvents(!0)}async draw(e,t){if(!e.civilData)throw new Error("The provided model doesn't have civil data!");if(!this._world)throw new Error("No world was given for this navigator!");const{alignments:i}=e.civilData,n=t||i.values(),r=this._world.scene.three,o=new Ke;o.makeEmpty(),o.min.set(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),o.max.set(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(const l of n){if(!l)throw new Error("Alignment not found!");for(const h of l[this.view])if(r.add(h.mesh),this._curves.push(h.mesh),!o.isEmpty())o.expandByObject(h.mesh);else{h.mesh.geometry.computeBoundingBox();const d=h.mesh.geometry.boundingBox;d instanceof Ke&&o.copy(d).applyMatrix4(h.mesh.matrixWorld)}}const a=this.getScaledBox(o,1.2);this._world.camera.hasCameraControls()&&await this._world.camera.controls.fitToBox(a,!1)}async dispose(){var e;(e=this.highlighter)==null||e.dispose(),this.clear(),this.onHighlight.reset(),this._curves=[]}clear(){var e,t;(e=this.highlighter)==null||e.unSelect(),(t=this.highlighter)==null||t.unHover();for(const i of this._curves)i.removeFromParent();this._curves=[]}setMarker(e,t,i){if(!this._curves.length)return;const n=e.getCurveAt(t,this.view),r=e.getPointAt(t,this.view),{index:o}=n.curve.getSegmentAt(n.percentage);this.setMouseMarker(r,n.curve.mesh,o,i)}setDefSegments(e){const t=[],i=[],n=(r,o)=>{const a=o[1]-r[1],l=o[0]-r[0];return a/l};for(let r=0;r=0;f--)if(o[f*3]!==void 0&&o[f*3+1]!==void 0){h=o[f*3],d=o[f*3+1];break}const p=(n([a,l],[h,d])*100).toFixed(2);i.push({slope:p})}for(const r of e)for(let o=0;on.clone().add(i))}showLineInfo(e,t){const i=this.components.get(Lr);i.world=this._world,i.deleteByType(["Length","Radius"]);const n=e.geometry.attributes.position.array,r=this.calculateParallelCurve(n,n.length/3,t),o=new Ne().setFromPoints(r),a=new st(o,this.markupMaterial);i.showLineLength(a,e.curve.getLength()),this._scene.add(a),this.markupLines.push(a);const{startDimensionPoints:l,endDimensionPoints:h}=this.calculateDimensionLines(e,a),d=this.offsetDimensionLine(l,t*.1),p=this.offsetDimensionLine(h,t*.1),f=new Ne().setFromPoints(d),g=new Ne().setFromPoints(p),y=new st(f,this.markupMaterial);this._scene.add(y),this.markupLines.push(y);const b=new st(g,this.markupMaterial);this._scene.add(b),this.markupLines.push(b)}showClothoidInfo(e,t){const i=this.components.get(Lr);i.world=this._world,i.deleteByType(["Length","Radius"]);const n=e.geometry.attributes.position.array,r=this.calculateParallelCurve(n,n.length/3,t),o=new Ne().setFromPoints(r);i.showCurveLength(r,e.curve.getLength());const a=new st(o,this.markupMaterial);this._scene.add(a),this.markupLines.push(a);const{startDimensionPoints:l,endDimensionPoints:h}=this.calculateDimensionLines(e,a),d=this.offsetDimensionLine(l,t*.1),p=this.offsetDimensionLine(h,t*.1),f=new Ne().setFromPoints(d),g=new Ne().setFromPoints(p),y=new st(f,this.markupMaterial);this._scene.add(y),this.markupLines.push(y);const b=new st(g,this.markupMaterial);this._scene.add(b),this.markupLines.push(b)}showCircularArcInfo(e,t){const i=this.components.get(Lr);i.world=this._world,i.deleteByType(["Length","Radius"]);const n=e.curve.data.RADIUS,r=e.geometry.attributes.position.array,o=e.geometry.attributes.position.count,a=[],l=new F(r[0],r[1],r[2]),h=(o-1)*3,d=new F(r[h],r[h+1],r[h+2]),p=o/2*3,f=new F(r[p],r[p+1],r[p+2]),g=d.clone().sub(l).normalize(),y=new F(-g.y,g.x,0);y.multiplyScalar(n);const b=f.clone().add(y);a.push(f),a.push(b);const w=new Ne().setFromPoints(a),T=new st(w,this.markupMaterial);i.showCurveRadius(T,Math.abs(n)),this._scene.add(T),this.markupLines.push(T);const S=[];for(let ne=0;ne{!this.highlighter||!this.planHighlighter||(this.planHighlighter.showCurveInfo(t),this.fitCameraToAlignment(t))})}get world(){return this._world}set world(e){var t;super.world=e,e&&((t=this.planHighlighter)==null||t.dispose(),this.planHighlighter=new hb(this.components,e.scene.three,e))}async fitCameraToAlignment(e){const t=this.components.get(nu),i=e.curve.alignment;for(const d of i.horizontal)t.addMesh(d.mesh);const n=t.get(),r=new F,{min:o,max:a}=n,l=1.2,h=new F((a.x-o.x)*l,(a.y-o.y)*l,(a.z-o.z)*l);n.getCenter(r),n.setFromCenterAndSize(r,h),t.reset(),this.world&&this.world.camera.hasCameraControls()&&await this.world.camera.controls.fitToBox(n,!0)}};x(ub,"uuid","3096dea0-5bc2-41c7-abce-9089b6c9431b");const db=class Ym extends Vm{constructor(e){super(e),x(this,"view","vertical"),x(this,"enabled",!0),this.components.add(Ym.uuid,this)}set world(e){this.world!==e&&(super.world=e,this.highlighter&&this.highlighter.onSelect.add(t=>{if(!this.world)throw new Error("A world is needed to work with this component!");const i=this.components.get(Lr);i.deleteByType(["Slope","Height","InitialKPV","FinalKPV"]);const{alignment:n}=t.curve,r=[];for(const h of n.vertical){const d=h.mesh.geometry.attributes.position.array;r.push(d)}const{defSegments:o,slope:a}=this.setDefSegments(r),l=this.world.scene.three;for(let h=0;h{var i;(i=this.highlighter)==null||i.setResolution(t)}),x(this,"onClick",t=>{if(!this.enabled||!this._highlighter)return;if(!this.world)throw new Error("No world found!");if(!this.world.renderer)return;const i=this.world.renderer.three.domElement,n=this.world.camera.three,r=this._highlighter.castRay(t,n,i,this._curves);if(r){const o=r.object;this._highlighter.select(o),this.updateMarker(r,"select");const{point:a,index:l}=r;l!==void 0&&this.onHighlight.trigger({curve:o,point:a,index:l});return}this._highlighter.unSelect(),this.mouseMarkers&&(this.mouseMarkers.hover.visible=!1),this.onMarkerHidden.trigger({type:"hover"})}),x(this,"onMouseMove",async t=>{if(!this.enabled||!this._highlighter)return;if(!this.world)throw new Error("No world found!");if(!this.world.renderer)return;const i=this.world.renderer.three.domElement,n=this.world.camera.three,r=this._highlighter.castRay(t,n,i,this._curves);if(r){this._highlighter.hover(r.object),this.updateMarker(r,"hover");return}this._highlighter.unHover()}),this.components.add(Gm.uuid,this)}get world(){return this._world}set world(e){var t,i,n;if(e===this._world||(this._world&&this.setupEvents(!1),this._world=e,(t=this._highlighter)==null||t.dispose(),(i=this.mouseMarkers)==null||i.hover.dispose(),(n=this.mouseMarkers)==null||n.select.dispose(),!e))return;const r=e.scene.three;this._highlighter=new xm(r,"absolute"),this.mouseMarkers={select:this.newMouseMarker("#ffffff",e),hover:this.newMouseMarker("#575757",e)},this.setupEvents(!0)}get highlighter(){if(!this._highlighter)throw new Error("Navigator not initialized!");return this._highlighter}draw(e){if(!e.civilData)throw new Error("Model must have civil data!");if(!this.world)throw new Error("A world must be given before drawing an alignment!");const t=this.world.scene.three;for(const[i,n]of e.civilData.alignments)for(const{mesh:r}of n.absolute)t.add(r),this._curves.push(r)}newMouseMarker(e,t){const i=t.scene.three,n=document.createElement("div");n.style.backgroundColor=e,n.style.width="1rem",n.style.height="1rem",n.style.borderRadius="1rem";const r=new _t(t,n,i);return r.visible=!1,r}setMarker(e,t,i){if(!this.mouseMarkers)throw new Error("No mouse markers found! Initialize the world before using this.");const n=e.getPointAt(t,"absolute");this.mouseMarkers[i].visible=!0,this.mouseMarkers[i].three.position.copy(n)}hideMarker(e){if(!this.mouseMarkers)throw new Error("No mouse markers found! Initialize the world before using this.");const t=this.mouseMarkers[e].three;t.visible=!1}setupEvents(e){var t,i;if(!this.world)throw new Error("No world found!");if(!this.world.renderer)return;const n=this.world.renderer.three.domElement;(t=this.world.renderer)==null||t.onResize.remove(this.updateLinesResolution),n.removeEventListener("click",this.onClick),n.removeEventListener("mousemove",this.onMouseMove),e&&(n.addEventListener("click",this.onClick),n.addEventListener("mousemove",this.onMouseMove),(i=this.world.renderer)==null||i.onResize.add(this.updateLinesResolution))}updateMarker(e,t){if(!this.mouseMarkers)return;const{point:i,object:n}=e,r=n,o=r.curve,a=r.curve.alignment,l=a.getPercentageAt(i,"absolute");this.mouseMarkers[t].visible=!0,this.mouseMarkers[t].three.position.copy(i),l!==null&&this.onMarkerChange.trigger({alignment:a,percentage:l,type:t,curve:o})}};x(pb,"uuid","0a59c09e-2b49-474a-9320-99f51f40f182");const fb=class jm extends Re{constructor(e){super(e),x(this,"_world",null),x(this,"enabled",!0),x(this,"plane"),this.components.add(jm.uuid,this)}get world(){return this._world}set world(e){var t;if(this._world=e,(t=this.plane)==null||t.dispose(),!e)return;const i=this.components.get(Ga),n=i.Type;i.Type=Gr,this.plane=i.createFromNormalAndCoplanarPoint(e,new F(1,0,0),new F),i.Type=n,this.plane.visible=!1,this.plane.enabled=!1}async set(e,t){if(!this.world||!this.plane)throw new Error("You must set a world before using this component");this.plane.enabled=!0;const i=e.curve.getPercentageAt(t);if(i===null)return;const{startPoint:n,endPoint:r}=e.curve.getSegmentAt(i);if(e.geometry.index===null)throw new Error("Geometry must be indexed!");const o=new F;o.subVectors(r,n),o.normalize(),await this.plane.setFromNormalAndCoplanarPoint(o,t);const a=this.plane.helper.matrix.clone();a.invert();const l=this.world.scene.three,h=this.plane.edges.get();for(const d in h){const{mesh:p}=h[d];p.position.set(0,0,0),p.rotation.set(0,0,0),p.updateMatrix(),p.applyMatrix4(a),p.parent!==l&&l.add(p)}this.plane.enabled=!1}};x(fb,"uuid","96b2c87e-d90b-4639-8257-8f01136fe324");function zn(){const s=document.createElement("div");return s.style.backgroundColor="black",s.style.color="white",s.style.padding="8px",s.style.borderRadius="8px",s.style.fontFamily="sans-serif",s}const vh=class yh{constructor(e,t,i){x(this,"label"),x(this,"boundingBox",new le),x(this,"world"),x(this,"components"),x(this,"_length"),x(this,"_visible",!0),x(this,"_start"),x(this,"_end"),x(this,"_root",new Fs),x(this,"_endpoints",[]),x(this,"_line"),this.components=e,this.world=t,this._start=i.start,this._end=i.end,this._length=this.getLength(),this._line=this.createLine(i),this.newEndpointElement(i.endpointElement),this.newEndpointElement(i.endpointElement.cloneNode(!0)),this.label=this.newText(),this._root.renderOrder=2,this.world.scene.three.add(this._root)}get visible(){return this._visible}set visible(e){this._visible=e,this.label.visible=e,this._endpoints[0].visible=e,this._endpoints[1].visible=e;const[t,i]=this._endpoints,n=t.three,r=i.three,o=this.label.three;e?(this.world.scene.three.add(this._root),this._root.add(o,n,r)):(o.removeFromParent(),n.removeFromParent(),r.removeFromParent(),this._root.removeFromParent())}get endPoint(){return this._end}set endPoint(e){this._end=e;const t=this._line.geometry.attributes.position;t.setXYZ(1,e.x,e.y,e.z),t.needsUpdate=!0,this._endpoints[1].three.position.copy(e),this.updateLabel()}get startPoint(){return this._start}set startPoint(e){this._start=e;const t=this._line.geometry.attributes.position;t.setXYZ(0,e.x,e.y,e.z),t.needsUpdate=!0,this._endpoints[0].three.position.copy(e),this.updateLabel()}get _center(){let e=this._end.clone().sub(this._start);const t=e.length()*.5;return e=e.normalize().multiplyScalar(t),this._start.clone().add(e)}dispose(){const e=this.components.get(Oi);this.visible=!1,e.destroy(this._root),e.destroy(this._line);for(const t of this._endpoints)t.dispose();this._endpoints.length=0,this.label.dispose(),this.boundingBox&&e.destroy(this.boundingBox),this.components=null}createBoundingBox(){this.boundingBox.geometry=new ut(1,1,this._length),this.boundingBox.position.copy(this._center),this.boundingBox.lookAt(this._end),this.boundingBox.visible=!1,this._root.add(this.boundingBox)}toggleLabel(){this.label.toggleVisibility()}newEndpointElement(e){const t=this._endpoints.length===0?this._start:this._end,i=new _t(this.world,e);i.three.position.copy(t),this._endpoints.push(i),this._root.add(i.three)}updateLabel(){this._length=this.getLength(),this.label.three.element.textContent=this.getTextContent(),this.label.three.position.copy(this._center),this._line.computeLineDistances()}createLine(e){const t=new Ne;t.setFromPoints([e.start,e.end]);const i=new st(t,e.lineMaterial);return this._root.add(i),i}newText(){const e=zn();e.textContent=this.getTextContent();const t=new _t(this.world,e);return t.three.position.copy(this._center),this._root.add(t.three),t}getTextContent(){return`${this._length/yh.scale} ${yh.units}`}getLength(){return parseFloat(this._start.distanceTo(this._end).toFixed(2))}};x(vh,"scale",1),x(vh,"units","m");let lu=vh;class mb{constructor(e,t,i){x(this,"enabled",!0),x(this,"visible",!0),x(this,"points",[]),x(this,"workingPlane",null),x(this,"labelMarker"),x(this,"world"),x(this,"components"),x(this,"onDisposed",new ee),x(this,"_rotationMatrix",null),x(this,"_dimensionLines",[]),x(this,"_defaultLineMaterial",new Di({color:"red"})),x(this,"onAreaComputed",new ee),x(this,"onWorkingPlaneComputed",new ee),x(this,"onPointAdded",new ee),x(this,"onPointRemoved",new ee),this.world=t,this.components=e;const n=zn();this.labelMarker=new _t(t,n),this.labelMarker.visible=!1,this.onPointAdded.add(r=>{this.points.length===3&&!this._dimensionLines[2]&&(this.addDimensionLine(r,this.points[0]),this.labelMarker.visible=!0)}),i==null||i.forEach(r=>this.setPoint(r))}setPoint(e,t){let i;if(t?i=t:i=this.points.length===0?0:this.points.length,i===0){this.points[0]=e;return}if(i<0||i>this.points.length)return;const n=this.points.length>i;this.points[i]=e,this.onPointAdded.trigger(e),n||this.addDimensionLine(this.points[i-1],e);const{previousLine:r,nextLine:o}=this.getLinesBetweenIndex(i);r&&(r.endPoint=e),o&&(o.startPoint=e)}removePoint(e){if(this.points.length===3)return;this.points.splice(e,1);const{previousLine:t,nextLine:i}=this.getLinesBetweenIndex(e);i&&(t.endPoint=i.endPoint),i==null||i.dispose(),this._dimensionLines.splice(e,1),this.onPointRemoved.trigger()}toggleLabel(){this.labelMarker.toggleVisibility()}addDimensionLine(e,t){const i=document.createElement("div");i.className="w-2 h-2 bg-red-600 rounded-full";const n=new lu(this.components,this.world,{start:e,end:t,lineMaterial:this._defaultLineMaterial,endpointElement:i});return n.toggleLabel(),this._dimensionLines.length>1?this._dimensionLines.splice(this._dimensionLines.length-1,0,n):this._dimensionLines.push(n),n}getLinesBetweenIndex(e){const t=e===0?this._dimensionLines.length-1:e-1,i=this._dimensionLines[t],n=this._dimensionLines[e];return{previousLine:i,nextLine:n}}computeWorkingPlane(){this.workingPlane=new an().setFromCoplanarPoints(this.points[0],this.points[1],this.points[2]);const e=new F(0,1,0),t=this.workingPlane.normal.angleTo(e),i=new F().crossVectors(this.workingPlane.normal,e).normalize();this._rotationMatrix=new Ee().makeRotationAxis(i,t),this.onWorkingPlaneComputed.trigger(this.workingPlane)}computeArea(){if(!(this._rotationMatrix&&this.workingPlane))return this.onAreaComputed.trigger(0),0;let e=0,t=0;const i=this._rotationMatrix,n=this.points.map(o=>{const a=o.clone().applyMatrix4(i),l=new Ve(a.x,a.z);return e+=l.x,t+=l.y,l}),r=Math.abs(Rv.area(n));return this.labelMarker.three.element.textContent=`${r.toFixed(2)} m²`,this.labelMarker.three.position.set(e/n.length,-this.workingPlane.constant,t/n.length).applyMatrix4(i.clone().invert()),this.onAreaComputed.trigger(r),r}dispose(){this.onAreaComputed.reset(),this.onWorkingPlaneComputed.reset(),this.onPointAdded.reset(),this.onPointRemoved.reset();for(const e of this._dimensionLines)e.dispose();this.labelMarker.dispose(),this._dimensionLines=[],this.points=[],this._rotationMatrix=null,this.workingPlane=null,this._defaultLineMaterial.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}get(){return{points:this.points,workingPlane:this.workingPlane,area:this.computeArea()}}}let cu=class extends x1{constructor(){super(...arguments),x(this,"onDisposed",new ee),x(this,"marker",null)}dispose(){this.marker&&this.marker.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}get(e){const t=super.get(e);return t?(this.marker||(this.marker=new _t(e)),this.marker.world!==e&&(this.marker.world=e,this.marker.three.removeFromParent(),e.scene.three.add(this.marker.three)),this.marker.visible=!0,this.marker.three.position.copy(t)):this.marker&&(this.marker.visible=!1),t}};const gb=class Eh extends Re{constructor(e){super(e),x(this,"onDisposed",new ee),x(this,"list",[]),x(this,"world"),x(this,"_enabled",!1),x(this,"_vertexPicker"),x(this,"_currentAreaElement",null),x(this,"_clickCount",0),x(this,"create",()=>{if(!this.enabled)return;if(!this.world)throw new Error("World not defined for the area measurement!");const t=this._vertexPicker.get(this.world);if(t){if(!this._currentAreaElement){const i=new mb(this.components,this.world);i.onPointAdded.add(()=>{this._clickCount===3&&!i.workingPlane&&(i.computeWorkingPlane(),this._vertexPicker.workingPlane=i.workingPlane)}),i.onPointRemoved.add(()=>this._clickCount--),this._currentAreaElement=i}this._currentAreaElement.setPoint(t,this._clickCount),this._currentAreaElement.computeArea(),this._clickCount++}}),x(this,"onMouseMove",()=>{if(!this.world){console.log("No world given for the area measurement!");return}const t=this._vertexPicker.get(this.world);t&&this._currentAreaElement&&(this._currentAreaElement.setPoint(t,this._clickCount),this._currentAreaElement.computeArea())}),x(this,"onKeydown",t=>{this.enabled&&(t.key==="z"&&t.ctrlKey&&this._currentAreaElement&&this._currentAreaElement.removePoint(this._clickCount-1),t.key==="Enter"&&this._currentAreaElement&&this.endCreation(),t.key==="Escape"&&(this._clickCount===0&&!this._currentAreaElement?this.enabled=!1:this.cancelCreation()))}),this.components.add(Eh.uuid,this),this._vertexPicker=new cu(e)}set enabled(e){this._enabled=e,this._vertexPicker.enabled=e,this.setupEvents(e),e||this.cancelCreation()}get enabled(){return this._enabled}set workingPlane(e){this._vertexPicker.workingPlane=e}get workingPlane(){return this._vertexPicker.workingPlane}dispose(){this.setupEvents(!1),this._vertexPicker.dispose(),this._currentAreaElement&&this._currentAreaElement.dispose();for(const e of this.list)e.dispose();this.components=null,this.onDisposed.trigger(Eh.uuid),this.onDisposed.reset()}delete(){}deleteAll(){for(const e of this.list)e.dispose();this.list=[]}endCreation(){this._currentAreaElement&&(this.list.push(this._currentAreaElement),this._currentAreaElement.removePoint(this._clickCount),this._currentAreaElement.computeWorkingPlane(),this._currentAreaElement.computeArea(),this._currentAreaElement=null),this._vertexPicker.workingPlane=null,this._clickCount=0}cancelCreation(){this._currentAreaElement&&(this._currentAreaElement.dispose(),this._currentAreaElement=null),this._vertexPicker.workingPlane=null,this._clickCount=0}setupEvents(e){if(!this.world)throw new Error("The area measurement needs a world to work!");if(!this.world.renderer)throw new Error("The world of the area measurement needs a renderer!");const t=this.world.renderer.three.domElement.parentElement;e?(t.addEventListener("click",this.create),t.addEventListener("mousemove",this.onMouseMove),window.addEventListener("keydown",this.onKeydown)):(t.removeEventListener("click",this.create),t.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("keydown",this.onKeydown))}};x(gb,"uuid","c453a99e-f054-4781-9060-33df617db4a5");class vb{constructor(e,t){x(this,"enabled",!0),x(this,"visible",!0),x(this,"points",[]),x(this,"world"),x(this,"onDisposed",new ee),x(this,"_lineMaterial",new ro({color:6629591,linewidth:2})),x(this,"_lineGeometry",new Wa),x(this,"_line",new Im(this._lineGeometry,this._lineMaterial)),x(this,"_labelMarker"),x(this,"onAngleComputed",new ee),x(this,"onPointAdded",new ee),this.world=e;const i=zn();this._labelMarker=new _t(e,i),this.labelMarker.visible=!0,this.onPointAdded.add(()=>{this.points.length===1&&e.scene.three.add(this._line),this.points.length===3&&(this.labelMarker.visible=!0)}),this.onAngleComputed.add(n=>{this.labelMarker.three.element.textContent=`${n.toFixed(2)}°`,this.labelMarker.three.position.copy(this.points[1]??new F)}),t==null||t.forEach(n=>this.setPoint(n))}set lineMaterial(e){this._lineMaterial.dispose(),this._lineMaterial=e,this._line.material=e,this._lineMaterial.resolution.set(window.innerWidth,window.innerHeight)}get lineMaterial(){return this._lineMaterial}set labelMarker(e){this._labelMarker.dispose(),this._labelMarker=e}get labelMarker(){return this._labelMarker}get angle(){return{points:this.points,angle:this.computeAngle()}}setPoint(e,t){let i;if(t?i=t:i=this.points.length===0?0:this.points.length,![0,1,2].includes(i))return;this.points[i]=e,this.onPointAdded.trigger(e);const n=this.points.map(r=>[r.x,r.y,r.z]);this._lineGeometry.setPositions(n.flat())}toggleLabel(){this.labelMarker.toggleVisibility()}computeAngle(){const e=this.points[0],t=this.points[1],i=this.points[2];if(!(e&&t&&i))return 0;const n=new F().subVectors(t,e),r=new F().subVectors(t,i),o=so.radToDeg(n.angleTo(r));return this.onAngleComputed.trigger(o),o}dispose(){this.points=[],this.labelMarker.dispose(),this.onAngleComputed.reset(),this.onPointAdded.reset(),this.labelMarker.dispose(),this._line.removeFromParent(),this._lineMaterial.dispose(),this._lineGeometry.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}}const yb=class bh extends Re{constructor(e){super(e),x(this,"onDisposed",new ee),x(this,"world"),x(this,"list",[]),x(this,"_lineMaterial"),x(this,"_enabled",!1),x(this,"_vertexPicker"),x(this,"_currentAngleElement",null),x(this,"_clickCount",0),x(this,"create",()=>{if(!this.enabled)return;if(!this.world){console.log("No world selected for angle measurement!");return}const t=this._vertexPicker.get(this.world);if(t){if(!this._currentAngleElement){const i=new vb(this.world);i.lineMaterial=this.lineMaterial,this._currentAngleElement=i}this._currentAngleElement.setPoint(t,this._clickCount),this._currentAngleElement.setPoint(t,this._clickCount+1),this._currentAngleElement.setPoint(t,this._clickCount+2),this._currentAngleElement.computeAngle(),this._clickCount++,this._clickCount===3&&this.endCreation()}}),x(this,"onMouseMove",()=>{if(!this.world){console.log("No world selected for angle measurement!");return}const t=this._vertexPicker.get(this.world);t&&this._currentAngleElement&&(this._currentAngleElement.setPoint(t,this._clickCount),this._currentAngleElement.computeAngle())}),x(this,"onKeyDown",t=>{this.enabled&&(t.key==="z"&&t.ctrlKey&&this._currentAngleElement,t.key==="Escape"&&(this._clickCount===0&&!this._currentAngleElement?this.enabled=!1:this.cancelCreation()))}),this.components.add(bh.uuid,this),this._vertexPicker=new cu(e),this._lineMaterial=new ro({color:6629591,linewidth:2})}set lineMaterial(e){this._lineMaterial.dispose(),this._lineMaterial=e,this._lineMaterial.resolution.set(window.innerWidth,window.innerHeight)}get lineMaterial(){return this._lineMaterial}set enabled(e){this._enabled=e,this.setupEvents(e),this._vertexPicker.enabled=e,e||this.cancelCreation()}get enabled(){return this._enabled}set workingPlane(e){this._vertexPicker.workingPlane=e}get workingPlane(){return this._vertexPicker.workingPlane}dispose(){this.setupEvents(!1),this._lineMaterial.dispose(),this._vertexPicker.dispose();for(const e of this.list)e.dispose();this._currentAngleElement&&this._currentAngleElement.dispose(),this.components=null,this.onDisposed.trigger(bh.uuid),this.onDisposed.reset()}delete(){}deleteAll(){for(const e of this.list)e.dispose();this.list=[]}endCreation(){this._currentAngleElement&&(this.list.push(this._currentAngleElement),this._currentAngleElement.computeAngle(),this._currentAngleElement=null),this._clickCount=0}cancelCreation(){this._currentAngleElement&&(this._currentAngleElement.dispose(),this._currentAngleElement=null),this._clickCount=0}setupEvents(e){if(!this.world)throw new Error("No world selected for angle measurement!");if(!this.world.renderer)throw new Error("The given world doesn't have a renderer!");const t=this.world.renderer.three.domElement.parentElement;e?(t.addEventListener("click",this.create),t.addEventListener("mousemove",this.onMouseMove),window.addEventListener("keydown",this.onKeyDown)):(t.removeEventListener("click",this.create),t.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("keydown",this.onKeyDown))}};x(yb,"uuid","622fb2c9-528c-4b0a-8a0e-6a1375f0a3aa");const Wm=class wh extends Re{constructor(e){super(e),x(this,"onDisposed",new ee),x(this,"onBeforeUpdate",new ee),x(this,"onAfterUpdate",new ee),x(this,"snapDistance",.25),x(this,"_vertexPicker"),x(this,"_lineMaterial",new Di({color:"#DC2626",linewidth:2,depthTest:!1})),x(this,"list",[]),x(this,"world"),x(this,"_visible",!0),x(this,"_enabled",!1),x(this,"_temp",{isDragging:!1,start:new F,end:new F,dimension:void 0}),x(this,"create",t=>{const i=t instanceof kn?t:void 0;if(this._enabled){if(!this._temp.isDragging){this.drawStart(i);return}this.endCreation()}}),x(this,"onMouseMove",()=>{this.world&&this._vertexPicker.get(this.world)}),this.components.add(wh.uuid,this),this._vertexPicker=new cu(e,{previewElement:zn(),snapDistance:this.snapDistance})}get enabled(){return this._enabled}set enabled(e){e||this.cancelCreation(),this._enabled=e,this._vertexPicker.enabled=e,this.setupEvents(e)}get visible(){return this._visible}set visible(e){this._visible=e;for(const t of this.list)t.visible=e}get color(){return this._lineMaterial.color}set color(e){this._lineMaterial.color=e}dispose(){this.setupEvents(!1),this.enabled=!1;for(const e of this.list)e.dispose();this._lineMaterial.dispose(),this.list=[],this._vertexPicker.dispose(),this.onDisposed.trigger(wh.uuid),this.onDisposed.reset()}async update(e){this._enabled&&this._temp.isDragging&&this.drawInProcess()}createOnPoints(e,t){const i=this.drawDimension();i.startPoint=e,i.endPoint=t,i.createBoundingBox(),this.list.push(i)}delete(){if(!this.world)throw new Error("World is needed for Length Measurement!");if(!this._enabled||this.list.length===0)return;const e=this.getBoundingBoxes(),t=this.components.get(ni).get(this.world).castRay(e);if(!t)return;const i=this.list.find(n=>n.boundingBox===t.object);if(i){const n=this.list.indexOf(i);this.list.splice(n,1),i.dispose()}}async deleteMeasurement(e){if(e){const t=this.list.indexOf(e);this.list.splice(t,1),e.dispose()}}deleteAll(){for(const e of this.list)e.dispose();this.list=[]}cancelCreation(){var e;this._temp.dimension&&(this._temp.isDragging=!1,(e=this._temp.dimension)==null||e.dispose(),this._temp.dimension=void 0)}drawStart(e){if(!this.world)throw new Error("The length measurement needs a world to work!");const t=e?[e]:void 0,i=this.components.get(ni).get(this.world).castRay(t),n=this._vertexPicker.get(this.world);i&&n&&(this._temp.isDragging=!0,this._temp.start=e?i.point:n)}drawInProcess(){if(!this.world)throw new Error("The length measurement needs a world to work!");if(!this.components.get(ni).get(this.world).castRay())return;const e=this._vertexPicker.get(this.world);e&&(this._temp.end=e,this._temp.dimension||(this._temp.dimension=this.drawDimension()),this._temp.dimension.endPoint=this._temp.end)}endCreation(){this._temp.dimension&&(this._temp.dimension.createBoundingBox(),this.list.push(this._temp.dimension),this._temp.dimension=void 0,this._temp.isDragging=!1)}drawDimension(){if(!this.world)throw new Error("The length measurement needs a world to work!");return new lu(this.components,this.world,{start:this._temp.start,end:this._temp.end,lineMaterial:this._lineMaterial,endpointElement:zn()})}getBoundingBoxes(){return this.list.map(e=>e.boundingBox).filter(e=>e!==void 0)}setupEvents(e){if(!this.world)throw new Error("The length measurement needs a world to work!");if(!this.world.renderer)throw new Error("The world of the length measurement needs a renderer!");const t=this.world.renderer.three.domElement.parentElement;t&&(t.removeEventListener("click",this.create),e&&t.addEventListener("mousemove",this.onMouseMove))}};x(Wm,"uuid","2f9bcacf-18a9-4be6-a293-e898eae64ea1");let _r=Wm;const Eb=class Xm extends Re{constructor(e){super(e),x(this,"label",null),x(this,"world"),x(this,"onVolumeFound",new ee),x(this,"_enabled",!1),x(this,"onDisposed",new ee),x(this,"create",()=>{if(!this.enabled)return;if(!this.world)throw new Error("World is needed for Volume Measurement!");const t=this.components.get(ni).get(this.world).castRay();if(!t||!t.object)return;const{object:i}=t;if(i instanceof le){const n=this.getVolumeOfMesh(i);this.onVolumeFound.trigger(n)}}),x(this,"onMouseMove",()=>{}),x(this,"onKeydown",t=>{}),this.components.add(Xm.uuid,this)}set enabled(e){this._enabled=e,this.setupEvents(e),e||this.cancelCreation()}get enabled(){return this._enabled}async dispose(){var e;this.setupEvents(!1),(e=this.label)==null||e.dispose(),this.onDisposed.trigger(),this.onDisposed.reset(),this.components=null}delete(){}async deleteAll(){}endCreation(){}cancelCreation(){}get(){}getVolumeFromFragments(e){const t=this.components.get(rt),i=new Ee,n=[];for(const r in e){const o=t.list.get(r);if(!o)continue;const a=e[r];let l=0;for(const p of a){const f=o.getInstancesIDs(p);f&&(l+=f.size)}const h=new Kt(o.mesh.geometry,void 0,l);let d=0;for(const p of a){const f=o.getInstancesIDs(p);if(f)for(const g of f)o.mesh.getMatrixAt(g,i),h.setMatrixAt(d++,i)}n.push(h)}return this.getVolumeFromMeshes(n)}getVolumeFromMeshes(e){if(!this.world)throw new Error("World is needed for Volume Measurement!");this.label||(this.label=this.newLabel(),this.label.three.removeFromParent());let t=0;for(const l of e)t+=this.getVolumeOfMesh(l);const i=this.world.scene.three,n=this.label.three;i.add(n);const r=this.components.get(nu);for(const l of e)l.geometry.computeBoundingSphere(),r.addMesh(l);const o=r.getSphere();r.reset(),n.position.copy(o.center);const a=Math.trunc(t*100)/100;return n.element.textContent=a.toString(),t}newLabel(){if(!this.world)throw new Error("World is needed for Volume Measurement!");const e=zn();return new _t(this.world,e)}setupEvents(e){if(!this.world)throw new Error("The volume measurement needs a world to work!");if(!this.world.renderer)throw new Error("The world of the volume measurement needs a renderer!");const t=this.world.renderer.three.domElement.parentElement;e?(t.addEventListener("click",this.create),t.addEventListener("mousemove",this.onMouseMove),window.addEventListener("keydown",this.onKeydown)):(t.removeEventListener("click",this.create),t.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("keydown",this.onKeydown))}getVolumeOfMesh(e){let t=0;const i=new F,n=new F,r=new F,{index:o}=e.geometry,a=e.geometry.attributes.position.array;if(!o)return console.warn("Geometry must be indexed to compute its volume!"),0;const l=[];if(e instanceof Kt)for(let d=0;d{if(!this.world)throw new Error("No world given to the face measurement!");if(!this.enabled||!this._currentSelelection)return;const t=this.world.scene.three,i=new Ne,n=new le(i,this.selectionMaterial);i.setAttribute("position",this.preview.geometry.attributes.position),t.add(n),i.computeBoundingSphere();const{area:r,perimeter:o}=this._currentSelelection,a=this.newLabel(i,r);n.add(a.three),this.selection.push({area:r,perimeter:o,mesh:n,label:a})}),x(this,"onMouseMove",()=>{if(!this.world)throw new Error("The face measurement needs a world to work!");if(!this.enabled){this.unselect();return}const t=this.components.get(ni).get(this.world).castRay();if(!t||!t.object||t.faceIndex===void 0){this.unselect();return}const{object:i,faceIndex:n}=t;i instanceof le||i instanceof Kt?this.updateSelection(i,n,t.instanceId):this.unselect()}),x(this,"onKeydown",t=>{}),this.components.add(Km.uuid,this),this.preview.frustumCulled=!1}set enabled(e){if(!this.world)throw new Error("No world given for the Face measurement!");this._enabled=e,this.setupEvents(e),e?this.world.scene.three.add(this.preview):(this.preview.removeFromParent(),this.cancelCreation()),this.setVisibility(e)}get enabled(){return this._enabled}dispose(){this.setupEvents(!1),this.deleteAll(),this.preview.removeFromParent(),this.preview.material.dispose(),this.preview.geometry.dispose(),this.selectionMaterial.dispose(),this.onDisposed.trigger(),this.onDisposed.reset(),this.components=null}delete(){if(!this.world)throw new Error("No world given to the face measurement!");const e=this.selection.map(r=>r.mesh),t=this.components.get(ni).get(this.world).castRay(e);if(!t||!t.object)return;const i=this.selection.find(r=>r.mesh===t.object);if(!i)return;i.mesh.removeFromParent(),i.mesh.geometry.dispose(),i.label.dispose();const n=this.selection.indexOf(i);this.selection.splice(n,1)}deleteAll(){for(const e of this.selection)e.mesh.removeFromParent(),e.mesh.geometry.dispose(),e.label.dispose();this.selection=[]}endCreation(){}cancelCreation(){}get(){const e=[];for(const t of this.selection){const i=t.mesh.geometry,{area:n,perimeter:r}=t,o=i.attributes.position.array;e.push({position:o,area:n,perimeter:r})}return e}set(e){if(!this.world)throw new Error("No world given to the face measurement!");const t=this.world.scene.three;for(const i of e){const n=new Ne,r=new le(n,this.selectionMaterial);t.add(r);const o=new gt(i.position,3);n.setAttribute("position",o),n.computeBoundingSphere();const{area:a,perimeter:l}=i,h=this.newLabel(n,a);r.add(h.three),this.selection.push({area:a,perimeter:l,mesh:r,label:h})}}setupEvents(e){if(!this.world)throw new Error("The face measurement needs a world to work!");if(!this.world.renderer)throw new Error("The world of the face measurement needs a renderer!");const t=this.world.renderer.three.domElement.parentElement;t.removeEventListener("click",this.create),t.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("keydown",this.onKeydown),e&&(t.addEventListener("click",this.create),t.addEventListener("mousemove",this.onMouseMove),window.addEventListener("keydown",this.onKeydown))}setVisibility(e){if(!this.world)throw new Error("The face measurement needs a world to work!");const t=this.world.scene.three;for(const i of this.selection){const n=i.label.three;e?(t.add(i.mesh),i.mesh.add(n)):(i.mesh.removeFromParent(),n.removeFromParent())}}unselect(){this.preview.removeFromParent(),this._currentSelelection=null}updateSelection(e,t,i){if(!this.world)throw new Error("The face measurement needs a world to work!");this.world.scene.three.add(this.preview);const n=this.components.get(ja).getFace(e,t,i);if(n===null){console.log("Hey!");return}const r=this.regenerateHighlight(e,n.indices,i);let o=0;for(const{distance:a}of n.edges)o+=a;this._currentSelelection={perimeter:o,area:r}}newLabel(e,t){if(!e.boundingSphere)throw new Error("Error computing area geometry");if(!this.world)throw new Error("The face measurement needs a world to work!");const{center:i}=e.boundingSphere,n=zn(),r=Math.trunc(t*100)/100;n.textContent=r.toString();const o=new _t(this.world,n);return o.three.position.copy(i),o}regenerateHighlight(e,t,i){const n=[],r=[];let o=0,a=0;const l=new Fn,h=this.components.get(ja);for(const f of t){const{p1:g,p2:y,p3:b}=h.getVerticesAndNormal(e,f,i);n.push(g.x,g.y,g.z),n.push(y.x,y.y,y.z),n.push(b.x,b.y,b.z),l.set(g,y,b),a+=l.getArea(),r.push(o,o+1,o+2),o+=3}const d=new Float32Array(n),p=new gt(d,3);return this.preview.geometry.setAttribute("position",p),this.preview.geometry.setIndex(r),a}};x(bb,"uuid","30279548-1309-44f6-aa97-ce26eed73522");const wb=class Qm extends Re{constructor(e){super(e),x(this,"preview"),x(this,"tolerance",.3),x(this,"world"),x(this,"onDisposed",new ee),x(this,"_enabled",!1),x(this,"_lineMaterial",new Di({color:"#DC2626",linewidth:2,depthTest:!1,transparent:!0})),x(this,"create",async()=>{if(!this.preview||!this.enabled||!this.preview.visible)return;const t=this.components.get(_r);t.world=this.world;const i=this.preview.startPoint.clone(),n=this.preview.endPoint.clone();t.createOnPoints(i,n)}),x(this,"onMouseMove",()=>{if(!this.preview)return;if(!this.world)throw new Error("The edge measurement needs a world to work!");if(!this.enabled){this.preview.visible=!1;return}const t=this.components.get(ni).get(this.world).castRay();if(!t||!t.object){this.preview.visible=!1;return}const{object:i,faceIndex:n,point:r}=t;if(n===void 0){this.preview.visible=!1;return}i instanceof le||i instanceof Kt?this.updateSelection(i,r,n,t.instanceId):this.preview.visible=!1}),x(this,"onKeydown",t=>{}),this.components.add(Qm.uuid,this)}set enabled(e){if(this._enabled=e,this.setupEvents(e),e){if(!this.world)throw new Error("The edge measurement needs a world to work!");if(!this.preview){const t=document.createElement("div");t.className="w-2 h-2 bg-red-600 rounded-full",this.preview=new lu(this.components,this.world,{start:new F,end:new F,lineMaterial:this._lineMaterial,endpointElement:t}),this.preview.visible=!1}}else this.cancelCreation()}get enabled(){return this._enabled}dispose(){this.preview&&this.preview.dispose(),this._lineMaterial.dispose(),this.setupEvents(!1),this.onDisposed.trigger(),this.onDisposed.reset(),this.components=null}delete(){if(!this.enabled)return;const e=this.components.get(_r),t=e.enabled;e.enabled=!0,e.delete(),e.enabled=t}deleteAll(){this.components.get(_r).deleteAll()}endCreation(){}cancelCreation(){}get(){const e=this.components.get(_r).list,t=[];for(const i of e){const n=i.startPoint,r=i.endPoint,o=[n.x,n.y,n.z,r.x,r.y,r.z];t.push(o)}return t}set(e){const t=this.components.get(_r);t.world=this.world;for(const i of e){const[n,r,o,a,l,h]=i,d=new F(n,r,o),p=new F(a,l,h);t.createOnPoints(d,p)}}setupEvents(e){if(!this.world)throw new Error("The edge measurement needs a world to work!");if(!this.world.renderer)throw new Error("The world of the edge measurement needs a renderer!");const t=this.world.renderer.three.domElement.parentElement;e?(t.addEventListener("click",this.create),t.addEventListener("mousemove",this.onMouseMove),window.addEventListener("keydown",this.onKeydown)):(t.removeEventListener("click",this.create),t.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("keydown",this.onKeydown))}updateSelection(e,t,i,n){if(!this.preview||!e.geometry.index)return;const r=this.components.get(ja).getFace(e,i,n);if(!r)return;const{edges:o}=r;let a=Number.MAX_VALUE,l=[];for(const p of o){const[f,g]=p.points,y=ja.distanceFromPointToLine(t,f,g,!0);y{const o=r.data.colors,a={},l={},h={},d={},p=performance.now();let f=!1;const g=new Set(this._foundGeometries);for(const[y,b]of o){const w=this._geometries.get(y);if(!w)continue;const T=b>this.threshold,{exists:S}=w;if(!T&&!S)continue;const _=this._indexModelID.get(w.modelIndex);g.delete(y),T&&S?(w.time=p,d[_]||(d[_]=new Set),d[_].add(w.geometryID),this._foundGeometries.add(y),f=!0):T&&!S?(a[_]||(a[_]=new Map),w.time=p,w.exists=!0,a[_].has(b)||a[_].set(b,new Set),a[_].get(b).add(w.geometryID),this._foundGeometries.add(y),f=!0):!T&&S&&(this.handleLostGeometries(p,y,w,l,h),f=!0)}f&&await this.onViewUpdated.trigger({toLoad:a,toRemove:l,toHide:h,toShow:d}),this._isWorkerBusy=!1}),this.updateInterval=500,this._geometry=new ut(1,1,1),this._geometry.groups=[],this._geometry.deleteAttribute("uv");const n=this._geometry.attributes.position.array;for(let r=0;rparseInt(f,10)),p=[];for(const f of i.ids){const g=i.get(f);if(!g.colors)throw new Error("Malformed fragments!");for(const y of g.colors)y.setRGB(l/255,h/255,d/255,"srgb");p.push(g)}a.fragment.add(p),Si.enabled=n,this.needsUpdate=!0}removeFragment(e,t){const i=this._modelIDIndex.get(e),n=this.codes.get(i).get(t),r=this._geometries.get(n);if(r.hidden||this.setGeometryVisibility(r,!0,!1),r.fragment){const{fragment:o}=r;o.dispose(!1),r.fragment=void 0}}setModelTransformation(e,t){const i=this._modelIDIndex.get(e);if(i===void 0)throw new Error("Model not found!");const n=this.boxes.get(i);n&&(n.mesh.position.set(0,0,0),n.mesh.rotation.set(0,0,0),n.mesh.scale.set(1,1,1),n.mesh.applyMatrix4(t));const r=this._geometriesGroups.get(i);r&&(r.position.set(0,0,0),r.rotation.set(0,0,0),r.scale.set(1,1,1),r.applyMatrix4(t))}setVisibility(e,t,i){const n=this._modelIDIndex.get(t);if(n!==void 0)for(const[r,o]of i){const a=this.codes.get(n);if(a===void 0)throw new Error("Map not found!");const l=a.get(r),h=this._geometries.get(l);if(h===void 0)throw new Error("Geometry not found!");h.hidden=!e,this.setGeometryVisibility(h,e,!0,o)}}setGeometryVisibility(e,t,i,n){const{modelIndex:r,geometryID:o,assetIDs:a}=e,l=this.boxes.get(r);if(l===void 0)throw new Error("Model not found!");const h=n||a;if(i&&e.fragment)e.fragment.setVisibility(t,h);else{const d=new Set;for(const p of h){const f=this.getInstanceID(p,o);d.add(f)}l.setVisibility(t,d)}}handleLostGeometries(e,t,i,n,r){const o=this._indexModelID.get(i.modelIndex),a=e-i.time;a>this.maxLostTime?(n[o]||(n[o]=new Set),i.exists=!1,n[o].add(i.geometryID),this._foundGeometries.delete(t)):a>this.maxHiddenTime&&(r[o]||(r[o]=new Set),r[o].add(i.geometryID))}createModelIndex(e){if(this._modelIDIndex.has(e))throw new Error("Can't load the same model twice!");const t=this._nextModelID;return this._nextModelID++,this._modelIDIndex.set(e,t),this._indexModelID.set(t,e),t}getInstanceID(e,t){const i=10**(Math.log(t)*Math.LOG10E+1|0);return e+t/i}}var Zm={exports:{}};(function(s,e){(function(t,i){s.exports=i()})(sp,function(){var t=function(c,u){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,v){m.__proto__=v}||function(m,v){for(var E in v)Object.prototype.hasOwnProperty.call(v,E)&&(m[E]=v[E])})(c,u)},i=function(){return(i=Object.assign||function(c){for(var u,m=1,v=arguments.length;m"u"||r.Promise||(r.Promise=Promise);var h=Object.getPrototypeOf,d={}.hasOwnProperty;function p(c,u){return d.call(c,u)}function f(c,u){typeof u=="function"&&(u=u(h(c))),(typeof Reflect>"u"?o:Reflect.ownKeys)(u).forEach(function(m){y(c,m,u[m])})}var g=Object.defineProperty;function y(c,u,m,v){g(c,u,l(m&&p(m,"get")&&typeof m.get=="function"?{get:m.get,set:m.set,configurable:!0}:{value:m,configurable:!0,writable:!0},v))}function b(c){return{from:function(u){return c.prototype=Object.create(u.prototype),y(c.prototype,"constructor",c),{extend:f.bind(null,c.prototype)}}}}var w=Object.getOwnPropertyDescriptor,T=[].slice;function S(c,u,m){return T.call(c,u,m)}function _(c,u){return u(c)}function I(c){if(!c)throw new Error("Assertion Failed")}function P(c){r.setImmediate?setImmediate(c):setTimeout(c,0)}function M(c,u){if(typeof u=="string"&&p(c,u))return c[u];if(!u)return c;if(typeof u!="string"){for(var m=[],v=0,E=u.length;v"u"?[]:function(){var c=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[c,h(c),c];var u=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[u,h(u),c]}(),tr=wi[0],Bt=wi[1],wi=wi[2],Bt=Bt&&Bt.then,ir=tr&&tr.constructor,Dl=!!wi,nr=function(c,u){sr.push([c,u]),Co&&(queueMicrotask(W0),Co=!1)},Nl=!0,Co=!0,mn=[],To=[],Ul=ai,zi={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Le,pgp:!1,env:{},finalize:Le},ye=zi,sr=[],gn=0,xo=[];function de(c){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var u=this._PSD=ye;if(typeof c!="function"){if(c!==er)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&Bl(this,this._value))}this._state=null,this._value=null,++u.ref,function m(v,E){try{E(function(C){if(v._state===null){if(C===v)throw new TypeError("A promise cannot be resolved with itself.");var R=v._lib&&$n();C&&typeof C.then=="function"?m(v,function(O,U){C instanceof de?C._then(O,U):C.then(O,U)}):(v._state=!0,v._value=C,Mu(v)),R&&es()}},Bl.bind(null,v))}catch(C){Bl(v,C)}}(this,c)}var kl={get:function(){var c=ye,u=Ro;function m(v,E){var C=this,R=!c.global&&(c!==ye||u!==Ro),O=R&&!Hi(),U=new de(function(D,H){zl(C,new Ou(Du(v,c,R,O),Du(E,c,R,O),D,H,c))});return this._consoleTask&&(U._consoleTask=this._consoleTask),U}return m.prototype=er,m},set:function(c){y(this,"then",c&&c.prototype===er?kl:{get:function(){return c},set:kl.set})}};function Ou(c,u,m,v,E){this.onFulfilled=typeof c=="function"?c:null,this.onRejected=typeof u=="function"?u:null,this.resolve=m,this.reject=v,this.psd=E}function Bl(c,u){var m,v;To.push(u),c._state===null&&(m=c._lib&&$n(),u=Ul(u),c._state=!1,c._value=u,v=c,mn.some(function(E){return E._value===v._value})||mn.push(v),Mu(c),m&&es())}function Mu(c){var u=c._listeners;c._listeners=[];for(var m=0,v=u.length;m.",Nu="String expected.",is=[],Fo="__dbnames",Yl="readonly",Gl="readwrite";function En(c,u){return c?u?function(){return c.apply(this,arguments)&&u.apply(this,arguments)}:c:u}var Uu={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Oo(c){return typeof c!="string"||/\./.test(c)?function(u){return u}:function(u){return u[c]===void 0&&c in u&&delete(u=ne(u))[c],u}}function ku(){throw fe.Type()}function Oe(c,u){try{var m=Bu(c),v=Bu(u);if(m!==v)return m==="Array"?1:v==="Array"?-1:m==="binary"?1:v==="binary"?-1:m==="string"?1:v==="string"?-1:m==="Date"?1:v!=="Date"?NaN:-1;switch(m){case"number":case"Date":case"string":return uK+Z&&X(K+Y)})})}return X(0).then(function(){if(0=Y})).length!==0?(H.forEach(function(X){G.push(function(){var K=z,Z=X._cfg.dbschema;zo(L,K,B),zo(L,Z,B),z=L._dbSchema=Z;var q=ec(K,Z);q.add.forEach(function(he){tc(B,he[0],he[1].primKey,he[1].indexes)}),q.change.forEach(function(he){if(he.recreate)throw new fe.Upgrade("Not yet support for changing primary key");var ue=B.objectStore(he.name);he.add.forEach(function(Ie){return ko(ue,Ie)}),he.change.forEach(function(Ie){ue.deleteIndex(Ie.name),ko(ue,Ie)}),he.del.forEach(function(Ie){return ue.deleteIndex(Ie)})});var ie=X._cfg.contentUpgrade;if(ie&&X._cfg.version>Y){No(L,B),N._memoizedTables={};var ce=V(Z);q.del.forEach(function(he){ce[he]=K[he]}),$l(L,[L.Transaction.prototype]),Uo(L,[L.Transaction.prototype],o(ce),ce),N.schema=ce;var se,ae=Pt(ie);return ae&&ts(),q=de.follow(function(){var he;(se=ie(N))&&ae&&(he=Hi.bind(null,null),se.then(he,he))}),se&&typeof se.then=="function"?de.resolve(se):q.then(function(){return se})}}),G.push(function(K){var Z,q,ie=X._cfg.dbschema;Z=ie,q=K,[].slice.call(q.db.objectStoreNames).forEach(function(ce){return Z[ce]==null&&q.db.deleteObjectStore(ce)}),$l(L,[L.Transaction.prototype]),Uo(L,[L.Transaction.prototype],L._storeNames,L._dbSchema),N.schema=L._dbSchema}),G.push(function(K){L.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(L.idbdb.version/10)===X._cfg.version?(L.idbdb.deleteObjectStore("$meta"),delete L._dbSchema.$meta,L._storeNames=L._storeNames.filter(function(Z){return Z!=="$meta"})):K.objectStore("$meta").put(X._cfg.version,"version"))})}),function X(){return G.length?de.resolve(G.shift()(N.idbtrans)).then(X):de.resolve()}().then(function(){Qu(z,B)})):de.resolve();var L,Y,N,B,G,z}).catch(R)):(o(E).forEach(function(H){tc(m,H,E[H].primKey,E[H].indexes)}),No(c,m),void de.follow(function(){return c.on.populate.fire(C)}).catch(R));var U,D})}function rv(c,u){Qu(c._dbSchema,u),u.db.version%10!=0||u.objectStoreNames.contains("$meta")||u.db.createObjectStore("$meta").add(Math.ceil(u.db.version/10-1),"version");var m=Bo(0,c.idbdb,u);zo(c,c._dbSchema,u);for(var v=0,E=ec(m,c._dbSchema).change;vMath.pow(2,62)?0:z.oldVersion,L=z<1,c.idbdb=G.result,C&&rv(c,H),sv(c,z/10,H,N))},N),G.onsuccess=Ze(function(){H=null;var z,X,K,Z,q,ie=c.idbdb=G.result,ce=S(ie.objectStoreNames);if(0"u"?de.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(Y){function N(){return indexedDB.databases().finally(Y)}U=setInterval(N,100),N()}).finally(function(){return clearInterval(U)}):Promise.resolve()).then(O)]).then(function(){return R(),u.onReadyBeingFired=[],de.resolve(sc(function(){return c.on.ready.fire(c.vip)})).then(function Y(){if(0u.limit?Y.length=u.limit:c.length===u.limit&&Y.length=X.limit&&(!X.values||ie.req.values)&&dv(ie.req.query.range,X.query.range)}),!1,K,Z];case"count":return q=Z.find(function(ie){return rd(ie.req.query.range,X.query.range)}),[q,!!q,K,Z]}}(u,m,"query",C),H=D[0],L=D[1],Y=D[2],N=D[3];return H&&L?H.obsSet=C.obsSet:(L=v.query(C).then(function(B){var G=B.result;if(H&&(H.res=G),R){for(var z=0,X=G.length;z{await this.loadFoundGeometries(i),await this.unloadLostGeometries(n),this.setMeshVisibility(r,!0),this.setMeshVisibility(o,!1)})}get culler(){if(!this._culler)throw new Error("You must set a world before using the streamer!");return this._culler}dispose(){var e;this._isDisposing=!0,this.onFragmentsLoaded.reset(),this.onFragmentsDeleted.reset(),this._ramCache.clear(),this.models={},this._geometryInstances={},this._loadedFragments={},this.fragIDData.clear(),this._baseMaterial.dispose(),this._baseMaterialT.dispose(),(e=this._culler)==null||e.dispose(),this.onDisposed.trigger(Th.uuid),this.onDisposed.reset(),this._isDisposing=!1}async load(e,t,i){const{assets:n,geometries:r,globalDataFileId:o}=e,a=this.url+o,l=await(await fetch(a)).arrayBuffer(),h=new Uint8Array(l),d=this.components.get(rt).load(h,{coordinate:t});this.world.scene.three.add(d);const{opaque:p,transparent:f}=d.geometryIDs;for(const[y,b]of p){const w=d.keyFragments.get(b);if(w===void 0)throw new Error("Malformed fragments group!");this.fragIDData.set(w,[d,y,new Set])}for(const[y,b]of f){const w=d.keyFragments.get(b);if(w===void 0)throw new Error("Malformed fragments group!");this.fragIDData.set(w,[d,Math.abs(y),new Set])}this.culler.add(d.uuid,n,r),this.models[d.uuid]={assets:n,geometries:r};const g=new Map;for(const y of n){const b=y.id;for(const{transformation:w,geometryID:T,color:S}of y.geometries){g.has(T)||g.set(T,[]);const _=g.get(T);if(!_)throw new Error("Malformed instances");_.push({id:b,transformation:w,color:S})}}if(this._geometryInstances[d.uuid]=g,i){const y=new Map,b=new Map;for(const I in i.ids){const P=i.ids[I],M=parseInt(I,10);y.set(M,P)}for(const I in i.types){const P=i.types[I],M=parseInt(I,10);b.set(M,P)}const w=o.replace("-global","-properties");d.streamSettings={baseUrl:this.url,baseFileName:w,ids:y,types:b};const{indexesFile:T}=i,S=await(await fetch(this.url+T)).text(),_=this.components.get(ru);_.setRelationMap(d,_.getRelationsMapFromJSON(S))}return this.culler.needsUpdate=!0,d}remove(e){this._isDisposing=!0;const t=this.components.get(rt).groups.get(e);if(t===void 0){console.log("Group to delete not found.");return}delete this.models[e],delete this._geometryInstances[e],delete this._loadedFragments[e];const i=t.keyFragments.values();for(const n of i)this.fragIDData.delete(n);this.culler.remove(e),this._isDisposing=!1}setVisibility(e,t){const i=new Map;for(const n in t){const r=this.fragIDData.get(n);if(r===void 0)throw new Error("Geometry not found!");const[o,a,l]=r,h=o.uuid;i.has(h)||i.set(h,new Map);const d=i.get(h),p=t[n];for(const g of p)e?l.delete(g):l.add(g);d.get(a)||d.set(a,new Set);const f=d.get(a);for(const g of p)f.add(g)}for(const[n,r]of i){this.culler.setVisibility(e,n,r);for(const[o]of r){const a=this._loadedFragments[n];if(!a)continue;const l=a[o];if(l)for(const h of l){const d=t[h.id];d&&h.setVisibility(e,d)}}}this.culler.needsUpdate=!0}async clearCache(){await this._fileCache.delete()}get(){}update(){}async loadFoundGeometries(e){for(const t in e){if(this._isDisposing)return;const i=this.components.get(rt).groups.get(t);if(!i)return;const{geometries:n}=this.models[t],r=new Map,o=new Set;for(const[d,p]of e[t])for(const f of p){o.add(f);const g=n[f];if(!g)throw new Error("Geometry not found");if(g.geometryFile){const y=g.geometryFile,b=r.get(y)||0;r.set(y,b+d)}}const a=Array.from(r).sort((d,p)=>p[1]-d[1]);for(const[d]of a){const p=this.url+d;if(!this._ramCache.has(p)){let y=new Uint8Array;if(this.useCache){const w=await this._fileCache.files.get(p);if(w)y=w.file;else{const T=await(await fetch(p)).arrayBuffer();y=new Uint8Array(T),this._fileCache.files.add({file:y,id:p})}}else{const w=await(await fetch(p)).arrayBuffer();y=new Uint8Array(w)}const b=this.serializer.import(y);this._ramCache.set(p,{data:b,time:performance.now()})}const f=this._ramCache.get(p);if(!f)continue;f.time=performance.now();const g=[];if(f)for(const[y,{position:b,index:w,normal:T}]of f.data){if(this._isDisposing)return;if(!o.has(y)||!this._geometryInstances[t]||!this._geometryInstances[t].has(y))continue;const S=this._geometryInstances[t].get(y);if(!S)throw new Error("Instances not found!");const _=new Ne,I=new gt(b,3),P=new gt(T,3);_.setAttribute("position",I),_.setAttribute("normal",P),_.setIndex(Array.from(w));const M=[],k=[];for(const V of S)V.color[3]===1?k.push(V):M.push(V);this.newFragment(i,y,_,M,!0,g),this.newFragment(i,y,_,k,!1,g)}g.length&&!this._isDisposing&&this.onFragmentsLoaded.trigger(g)}const l=new Set,h=performance.now();for(const[d,{time:p}]of this._ramCache)h-p>this.maxRamTime&&l.add(d);for(const d of l)this._ramCache.delete(d)}}async unloadLostGeometries(e){if(this._isDisposing)return;const t=[],i=this.components.get(rt);for(const n in e){const r=i.groups.get(n);if(!r)throw new Error("Fragment group not found!");if(!this._loadedFragments[n])continue;const o=this._loadedFragments[n],a=e[n];for(const l of a){if(this.culler.removeFragment(r.uuid,l),!o[l])continue;const h=o[l];for(const d of h)r.items.splice(r.items.indexOf(d),1),t.push(d);delete o[l]}}t.length&&this.onFragmentsDeleted.trigger(t);for(const n of t)i.list.delete(n.id),this.world.meshes.delete(n.mesh),n.mesh.material=[],n.dispose(!0)}setMeshVisibility(e,t){for(const i in e)for(const n of e[i]){const r=this._loadedFragments[i];if(!r)continue;const o=r[n];if(o)for(const a of o)a.mesh.visible=t}}newFragment(e,t,i,n,r,o){if(n.length===0||this._isDisposing)return;const a=e.geometryIDs,l=r?a.transparent:a.opaque,h=t*(r?-1:1),d=l.get(h);if(d===void 0)return;const p=e.keyFragments.get(d);if(p===void 0)return;const f=this.components.get(rt);if(f.list.has(p))return;const g=r?this._baseMaterialT:this._baseMaterial,y=new Va(i,g,n.length);y.id=p,y.mesh.uuid=p,y.group=e,e.add(y.mesh),e.items.push(y),f.list.set(y.id,y),this.world.meshes.add(y.mesh),this._loadedFragments[e.uuid]||(this._loadedFragments[e.uuid]={});const b=this._loadedFragments[e.uuid];b[t]||(b[t]=[]),b[t].push(y);const w=new Map;for(let I=0;I{this.selection[this.config.hoverName]={}}),x(this,"onMouseDown",()=>{this.enabled&&(this._mouseState.down=!0)}),x(this,"onMouseUp",async t=>{const i=this.config.world;if(!i)throw new Error("No world found!");if(!i.renderer)throw new Error("This world doesn't have a renderer!");if(this.enabled&&t.target===i.renderer.three.domElement){if(this._mouseState.down=!1,this._mouseState.moved||t.button!==0){this._mouseState.moved=!1;return}if(this._mouseState.moved=!1,this.config.autoHighlightOnClick){const n=this.multiple==="none"?!0:!t[this.multiple];await this.highlight(this.config.selectName,n,this.zoomToSelection)}}}),x(this,"onMouseMove",async()=>{if(!this.enabled)return;if(this._mouseState.moved){this.clear(this.config.hoverName);return}this._mouseState.moved=this._mouseState.down;const t=this.selection[this.config.selectName];await this.highlight(this.config.hoverName,!0,!1,t)}),this.components.add(xh.uuid,this)}async dispose(){this.setupEvents(!1),this.onBeforeUpdate.reset(),this.onAfterUpdate.reset(),this.selection={};for(const e in this.events)this.events[e].onClear.reset(),this.events[e].onHighlight.reset();this.onSetup.reset(),this.events={},this.onDisposed.trigger(xh.uuid),this.onDisposed.reset()}add(e,t){if(this.selection[e]||this.colors.has(e))throw new Error("A selection with that name already exists!");this.colors.set(e,t),this.selection[e]={},this.events[e]={onHighlight:new ee,onClear:new ee}}async highlight(e,t=!0,i=this.zoomToSelection,n={}){if(!this.enabled)return null;if(!this.config.world)throw new Error("No world found in config!");const r=this.config.world;if(!this.selection[e])throw new Error(`Selection ${e} does not exist.`);const o=this.components.get(rt).meshes,a=this.components.get(ni).get(r).castRay(o);if(!a||!a.face)return this.clear(e),null;const l=a.object,h=l.geometry,d=a.instanceId;if(!h||d===void 0)return null;const p=l.fragment.getItemID(d);if(p===null)throw new Error("Item ID not found!");const f=l.fragment.group;if(!f)throw new Error("Fragment must belong to a FragmentsGroup!");const g=f.getFragmentMap([p]),y={};for(const b in g){const w=g[b],T=n[b];for(const S of w)(!T||!T.has(S))&&(y[b]||(y[b]=new Set),y[b].add(S))}return await this.highlightByID(e,y,t,i),{id:p,fragments:g}}async highlightByID(e,t,i=!0,n=this.zoomToSelection){if(!this.enabled)return;i&&this.clear(e);const r=this.components.get(rt),o=this.colors.get(e);if(!o)throw new Error("Color for selection not found!");for(const a in t){const l=r.list.get(a);if(!l)continue;this.selection[e][a]||(this.selection[e][a]=new Set);const h=t[a];for(const d of h)this.selection[e][a].add(d),l.setColor(o,[d])}this.events[e].onHighlight.trigger(this.selection[e]),n&&await this.zoomSelection(e)}clear(e){const t=e?[e]:Object.keys(this.selection);for(const i of t){const n=this.components.get(rt),r=this.selection[i];for(const o in this.selection[i]){const a=n.list.get(o);if(!a)continue;const l=r[o];l&&(this.backupColor?a.setColor(this.backupColor):a.resetColor(l))}this.events[i].onClear.trigger(null),this.selection[i]={}}}setup(e){this.config={...this.config,...e},this.add(this.config.selectName,this.config.selectionColor),this.add(this.config.hoverName,this.config.hoverColor),this.setupEvents(!0),this.enabled=!0,this.isSetup=!0,this.onSetup.trigger(this)}async zoomSelection(e){if(!this.config.world)throw new Error("No world found in config!");const t=this.config.world;if(!t.camera.hasCameraControls())return;const i=this.components.get(nu),n=this.components.get(rt);i.reset();const r=this.selection[e];if(!Object.keys(r).length)return;for(const b in r){const w=n.list.get(b);if(!w)continue;const T=r[b];i.addMesh(w.mesh,T)}const o=i.getSphere(),a=1/0,l=-1/0,{x:h,y:d,z:p}=o.center,f=o.radius===a||h===a||d===a||p===a,g=o.radius===l||h===l||d===l||p===l,y=o.radius===0;f||g||y||(o.radius*=this.zoomFactor,await t.camera.controls.fitToSphere(o,!0))}setupEvents(e){if(!this.config.world)throw new Error("No world found while setting up events!");if(!this.config.world.renderer)throw new Error("The given world doesn't have a renderer!");const t=this.config.world.renderer.three.domElement,i=this.events[this.config.selectName].onHighlight;i.remove(this.clearHover),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("mousemove",this.onMouseMove),e&&(i.add(this.clearHover),t.addEventListener("mousedown",this.onMouseDown),t.addEventListener("mouseup",this.onMouseUp),t.addEventListener("mousemove",this.onMouseMove))}};x(Ab,"uuid","cb8a76f2-654a-4b50-80c6-66fd83cafd77");const Sb=class qm extends Re{constructor(e){super(e),x(this,"onDisposed",new ee),x(this,"onNavigated",new ee),x(this,"onExited",new ee),x(this,"enabled",!1),x(this,"currentPlan",null),x(this,"defaultSectionOffset",1.5),x(this,"defaultCameraOffset",30),x(this,"list",[]),x(this,"world"),x(this,"_floorPlanViewCached",!1),x(this,"_previousCamera",new F),x(this,"_previousTarget",new F),x(this,"_previousProjection","Perspective"),this.components.add(qm.uuid,this)}dispose(){this.onExited.reset(),this.onNavigated.reset(),this.list=[],this.onDisposed.trigger(),this.onDisposed.reset()}async generate(e){if(!e.hasProperties)throw new Error("Properties are needed to compute plan views!");const t=await e.getAllPropertiesOfType(dl);if(!t)throw new Error("Floorplans not found!");const i=e.coordinationMatrix.elements[13],n=await Dn.getUnits(e);for(const r of Object.values(t)){const o={value:0};this.getAbsoluteFloorHeight(r.ObjectPlacement,o);const a=o.value*n+i;this.create({name:r.Name.value,id:r.GlobalId.value,normal:new F(0,-1,0),point:new F(0,a,0),ortho:!0,offset:this.defaultSectionOffset})}}create(e){if(!this.world)throw new Error("You must set a world before creating the clipping planes!");if(this.list.find(n=>n.id===e.id)){console.warn(`There's already a plan with the id: ${e.id}`);return}const t=this.createClippingPlane(e),i={...e,plane:t};this.list.push(i)}async goTo(e,t=!1){var i;((i=this.currentPlan)==null?void 0:i.id)!==e&&(this.onNavigated.trigger({id:e}),this.storeCameraPosition(),await this.hidePreviousClippingPlane(),this.updateCurrentPlan(e),await this.activateCurrentPlan(),this.enabled||(await this.moveCameraTo2DPlanPosition(t),this.enabled=!0))}async exitPlanView(e=!1){if(!this.enabled||!this.world)return;this.enabled=!1,this.onExited.trigger(),this.cacheFloorplanView();const t=this.world.camera;t.set("Orbit"),await t.projection.set(this._previousProjection),this.currentPlan&&this.currentPlan.plane&&(this.currentPlan.plane.enabled=!1,this.currentPlan.plane.edges.enabled=!1,this.currentPlan.plane.edges.visible=!1),this.currentPlan=null,await t.controls.setLookAt(this._previousCamera.x,this._previousCamera.y,this._previousCamera.z,this._previousTarget.x,this._previousTarget.y,this._previousTarget.z,e)}storeCameraPosition(){this.enabled?this.cacheFloorplanView():this.store3dCameraPosition()}createClippingPlane(e){if(!this.world)throw new Error("World is needed to create clipping planes!");const{normal:t,point:i}=e,n=i.clone();e.offset&&(n.y+=e.offset);const r=this.components.get(Ga),o=r.Type;r.Type=Gr;const a=r.createFromNormalAndCoplanarPoint(this.world,t,n);return a.edges.update(),a.visible=!1,a.enabled=!1,a.edges.enabled=!1,a.edges.visible=!1,r.Type=o,a}cacheFloorplanView(){if(!this.world)throw new Error("World is needed to create clipping planes!");this._floorPlanViewCached=!0,this.world.camera.controls.saveState()}async moveCameraTo2DPlanPosition(e){if(!this.world)throw new Error("World is needed to create clipping planes!");const t=this.world.camera;this._floorPlanViewCached?await t.controls.reset(e):await t.controls.setLookAt(0,100,0,0,0,0,e)}async activateCurrentPlan(){if(!this.world)throw new Error("World is needed to create clipping planes!");if(!this.currentPlan)throw new Error("Current plan is not defined.");const e=this.world.camera;this.currentPlan.plane&&(this.currentPlan.plane.enabled=!0,this.currentPlan.plane.edges.fillNeedsUpdate=!0,this.currentPlan.plane.edges.visible=!0),e.set("Plan");const t=this.currentPlan.ortho?"Orthographic":"Perspective";await e.projection.set(t)}store3dCameraPosition(){if(!this.world)throw new Error("World is needed to create clipping planes!");const e=this.world.camera;e.three.getWorldPosition(this._previousCamera),e.controls.getTarget(this._previousTarget),this._previousProjection=e.projection.current}updateCurrentPlan(e){const t=this.list.find(i=>i.id===e);if(!t)throw new Error("The specified plan is undefined!");this.currentPlan=t}async hidePreviousClippingPlane(){if(this.currentPlan){const e=this.currentPlan.plane;e&&(e.enabled=!1),this.currentPlan.plane instanceof Gr&&(this.currentPlan.plane.edges.visible=!1)}}getAbsoluteFloorHeight(e,t){const i=e.RelativePlacement.Location.Coordinates;t.value+=i[2].value,e.PlacementRelTo&&this.getAbsoluteFloorHeight(e.PlacementRelTo,t)}};x(Sb,"uuid","a80874aa-1c93-43a4-80f2-df346da086b1");var _b=Object.defineProperty,Rb=(s,e,t)=>e in s?_b(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Sn=(s,e,t)=>(Rb(s,typeof e!="symbol"?e+"":e,t),t);const Os=Math.min,Pi=Math.max,Xa=Math.round,sn=s=>({x:s,y:s}),Pb={left:"right",right:"left",bottom:"top",top:"bottom"},Fb={start:"end",end:"start"};function lp(s,e,t){return Pi(s,Os(e,t))}function ao(s,e){return typeof s=="function"?s(e):s}function Mi(s){return s.split("-")[0]}function yl(s){return s.split("-")[1]}function Jm(s){return s==="x"?"y":"x"}function $m(s){return s==="y"?"height":"width"}function lo(s){return["top","bottom"].includes(Mi(s))?"y":"x"}function eg(s){return Jm(lo(s))}function Ob(s,e,t){t===void 0&&(t=!1);const i=yl(s),n=eg(s),r=$m(n);let o=n==="x"?i===(t?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(o=Ka(o)),[o,Ka(o)]}function Mb(s){const e=Ka(s);return[Ah(s),e,Ah(e)]}function Ah(s){return s.replace(/start|end/g,e=>Fb[e])}function Lb(s,e,t){const i=["left","right"],n=["right","left"],r=["top","bottom"],o=["bottom","top"];switch(s){case"top":case"bottom":return t?e?n:i:e?i:n;case"left":case"right":return e?r:o;default:return[]}}function Db(s,e,t,i){const n=yl(s);let r=Lb(Mi(s),t==="start",i);return n&&(r=r.map(o=>o+"-"+n),e&&(r=r.concat(r.map(Ah)))),r}function Ka(s){return s.replace(/left|right|bottom|top/g,e=>Pb[e])}function Nb(s){return{top:0,right:0,bottom:0,left:0,...s}}function tg(s){return typeof s!="number"?Nb(s):{top:s,right:s,bottom:s,left:s}}function Ms(s){const{x:e,y:t,width:i,height:n}=s;return{width:i,height:n,top:t,left:e,right:e+i,bottom:t+n,x:e,y:t}}function cp(s,e,t){let{reference:i,floating:n}=s;const r=lo(e),o=eg(e),a=$m(o),l=Mi(e),h=r==="y",d=i.x+i.width/2-n.width/2,p=i.y+i.height/2-n.height/2,f=i[a]/2-n[a]/2;let g;switch(l){case"top":g={x:d,y:i.y-n.height};break;case"bottom":g={x:d,y:i.y+i.height};break;case"right":g={x:i.x+i.width,y:p};break;case"left":g={x:i.x-n.width,y:p};break;default:g={x:i.x,y:i.y}}switch(yl(e)){case"start":g[o]-=f*(t&&h?-1:1);break;case"end":g[o]+=f*(t&&h?-1:1);break}return g}const Ub=async(s,e,t)=>{const{placement:i="bottom",strategy:n="absolute",middleware:r=[],platform:o}=t,a=r.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let h=await o.getElementRects({reference:s,floating:e,strategy:n}),{x:d,y:p}=cp(h,i,l),f=i,g={},y=0;for(let b=0;b$<=0)){var W,j;const $=(((W=r.flip)==null?void 0:W.index)||0)+1,ne=P[$];if(ne)return{data:{index:$,overflows:V},reset:{placement:ne}};let oe=(j=V.filter(ve=>ve.overflows[0]<=0).sort((ve,re)=>ve.overflows[1]-re.overflows[1])[0])==null?void 0:j.placement;if(!oe)switch(g){case"bestFit":{var Q;const ve=(Q=V.map(re=>[re.placement,re.overflows.filter(ge=>ge>0).reduce((ge,me)=>ge+me,0)]).sort((re,ge)=>re[1]-ge[1])[0])==null?void 0:Q[0];ve&&(oe=ve);break}case"initialPlacement":oe=a;break}if(n!==oe)return{reset:{placement:oe}}}return{}}}};function ig(s){const e=Os(...s.map(r=>r.left)),t=Os(...s.map(r=>r.top)),i=Pi(...s.map(r=>r.right)),n=Pi(...s.map(r=>r.bottom));return{x:e,y:t,width:i-e,height:n-t}}function Bb(s){const e=s.slice().sort((n,r)=>n.y-r.y),t=[];let i=null;for(let n=0;ni.height/2?t.push([r]):t[t.length-1].push(r),i=r}return t.map(n=>Ms(ig(n)))}const zb=function(s){return s===void 0&&(s={}),{name:"inline",options:s,async fn(e){const{placement:t,elements:i,rects:n,platform:r,strategy:o}=e,{padding:a=2,x:l,y:h}=ao(s,e),d=Array.from(await(r.getClientRects==null?void 0:r.getClientRects(i.reference))||[]),p=Bb(d),f=Ms(ig(d)),g=tg(a);function y(){if(p.length===2&&p[0].left>p[1].right&&l!=null&&h!=null)return p.find(w=>l>w.left-g.left&&lw.top-g.top&&h=2){if(lo(t)==="y"){const j=p[0],Q=p[p.length-1],$=Mi(t)==="top",ne=j.top,oe=Q.bottom,ve=$?j.left:Q.left,re=$?j.right:Q.right,ge=re-ve,me=oe-ne;return{top:ne,bottom:oe,left:ve,right:re,width:ge,height:me,x:ve,y:ne}}const w=Mi(t)==="left",T=Pi(...p.map(j=>j.right)),S=Os(...p.map(j=>j.left)),_=p.filter(j=>w?j.left===S:j.right===T),I=_[0].top,P=_[_.length-1].bottom,M=S,k=T,V=k-M,W=P-I;return{top:I,bottom:P,left:M,right:k,width:V,height:W,x:M,y:I}}return f}const b=await r.getElementRects({reference:{getBoundingClientRect:y},floating:i.floating,strategy:o});return n.reference.x!==b.reference.x||n.reference.y!==b.reference.y||n.reference.width!==b.reference.width||n.reference.height!==b.reference.height?{reset:{rects:b}}:{}}}};async function Vb(s,e){const{placement:t,platform:i,elements:n}=s,r=await(i.isRTL==null?void 0:i.isRTL(n.floating)),o=Mi(t),a=yl(t),l=lo(t)==="y",h=["left","top"].includes(o)?-1:1,d=r&&l?-1:1,p=ao(e,s);let{mainAxis:f,crossAxis:g,alignmentAxis:y}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return a&&typeof y=="number"&&(g=a==="end"?y*-1:y),l?{x:g*d,y:f*h}:{x:f*h,y:g*d}}const ng=function(s){return{name:"offset",options:s,async fn(e){var t,i;const{x:n,y:r,placement:o,middlewareData:a}=e,l=await Vb(e,s);return o===((t=a.offset)==null?void 0:t.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:n+l.x,y:r+l.y,data:{...l,placement:o}}}}},Hb=function(s){return s===void 0&&(s={}),{name:"shift",options:s,async fn(e){const{x:t,y:i,placement:n}=e,{mainAxis:r=!0,crossAxis:o=!1,limiter:a={fn:w=>{let{x:T,y:S}=w;return{x:T,y:S}}},...l}=ao(s,e),h={x:t,y:i},d=await hu(e,l),p=lo(Mi(n)),f=Jm(p);let g=h[f],y=h[p];if(r){const w=f==="y"?"top":"left",T=f==="y"?"bottom":"right",S=g+d[w],_=g-d[T];g=lp(S,g,_)}if(o){const w=p==="y"?"top":"left",T=p==="y"?"bottom":"right",S=y+d[w],_=y-d[T];y=lp(S,y,_)}const b=a.fn({...e,[f]:g,[p]:y});return{...b,data:{x:b.x-t,y:b.y-i}}}}};function rn(s){return sg(s)?(s.nodeName||"").toLowerCase():"#document"}function Nt(s){var e;return(s==null||(e=s.ownerDocument)==null?void 0:e.defaultView)||window}function ln(s){var e;return(e=(sg(s)?s.ownerDocument:s.document)||window.document)==null?void 0:e.documentElement}function sg(s){return s instanceof Node||s instanceof Nt(s).Node}function Li(s){return s instanceof Element||s instanceof Nt(s).Element}function yi(s){return s instanceof HTMLElement||s instanceof Nt(s).HTMLElement}function hp(s){return typeof ShadowRoot>"u"?!1:s instanceof ShadowRoot||s instanceof Nt(s).ShadowRoot}function co(s){const{overflow:e,overflowX:t,overflowY:i,display:n}=Qt(s);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&!["inline","contents"].includes(n)}function Yb(s){return["table","td","th"].includes(rn(s))}function uu(s){const e=du(),t=Qt(s);return t.transform!=="none"||t.perspective!=="none"||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(t.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(t.contain||"").includes(i))}function Gb(s){let e=Ls(s);for(;yi(e)&&!El(e);){if(uu(e))return e;e=Ls(e)}return null}function du(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function El(s){return["html","body","#document"].includes(rn(s))}function Qt(s){return Nt(s).getComputedStyle(s)}function bl(s){return Li(s)?{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}:{scrollLeft:s.pageXOffset,scrollTop:s.pageYOffset}}function Ls(s){if(rn(s)==="html")return s;const e=s.assignedSlot||s.parentNode||hp(s)&&s.host||ln(s);return hp(e)?e.host:e}function rg(s){const e=Ls(s);return El(e)?s.ownerDocument?s.ownerDocument.body:s.body:yi(e)&&co(e)?e:rg(e)}function Sh(s,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const n=rg(s),r=n===((i=s.ownerDocument)==null?void 0:i.body),o=Nt(n);return r?e.concat(o,o.visualViewport||[],co(n)?n:[],o.frameElement&&t?Sh(o.frameElement):[]):e.concat(n,Sh(n,[],t))}function og(s){const e=Qt(s);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const n=yi(s),r=n?s.offsetWidth:t,o=n?s.offsetHeight:i,a=Xa(t)!==r||Xa(i)!==o;return a&&(t=r,i=o),{width:t,height:i,$:a}}function ag(s){return Li(s)?s:s.contextElement}function _s(s){const e=ag(s);if(!yi(e))return sn(1);const t=e.getBoundingClientRect(),{width:i,height:n,$:r}=og(e);let o=(r?Xa(t.width):t.width)/i,a=(r?Xa(t.height):t.height)/n;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const jb=sn(0);function lg(s){const e=Nt(s);return!du()||!e.visualViewport?jb:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Wb(s,e,t){return e===void 0&&(e=!1),!t||e&&t!==Nt(s)?!1:e}function jr(s,e,t,i){e===void 0&&(e=!1),t===void 0&&(t=!1);const n=s.getBoundingClientRect(),r=ag(s);let o=sn(1);e&&(i?Li(i)&&(o=_s(i)):o=_s(s));const a=Wb(r,t,i)?lg(r):sn(0);let l=(n.left+a.x)/o.x,h=(n.top+a.y)/o.y,d=n.width/o.x,p=n.height/o.y;if(r){const f=Nt(r),g=i&&Li(i)?Nt(i):i;let y=f,b=y.frameElement;for(;b&&i&&g!==y;){const w=_s(b),T=b.getBoundingClientRect(),S=Qt(b),_=T.left+(b.clientLeft+parseFloat(S.paddingLeft))*w.x,I=T.top+(b.clientTop+parseFloat(S.paddingTop))*w.y;l*=w.x,h*=w.y,d*=w.x,p*=w.y,l+=_,h+=I,y=Nt(b),b=y.frameElement}}return Ms({width:d,height:p,x:l,y:h})}const Xb=[":popover-open",":modal"];function cg(s){return Xb.some(e=>{try{return s.matches(e)}catch{return!1}})}function Kb(s){let{elements:e,rect:t,offsetParent:i,strategy:n}=s;const r=n==="fixed",o=ln(i),a=e?cg(e.floating):!1;if(i===o||a&&r)return t;let l={scrollLeft:0,scrollTop:0},h=sn(1);const d=sn(0),p=yi(i);if((p||!p&&!r)&&((rn(i)!=="body"||co(o))&&(l=bl(i)),yi(i))){const f=jr(i);h=_s(i),d.x=f.x+i.clientLeft,d.y=f.y+i.clientTop}return{width:t.width*h.x,height:t.height*h.y,x:t.x*h.x-l.scrollLeft*h.x+d.x,y:t.y*h.y-l.scrollTop*h.y+d.y}}function Qb(s){return Array.from(s.getClientRects())}function hg(s){return jr(ln(s)).left+bl(s).scrollLeft}function Zb(s){const e=ln(s),t=bl(s),i=s.ownerDocument.body,n=Pi(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),r=Pi(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let o=-t.scrollLeft+hg(s);const a=-t.scrollTop;return Qt(i).direction==="rtl"&&(o+=Pi(e.clientWidth,i.clientWidth)-n),{width:n,height:r,x:o,y:a}}function qb(s,e){const t=Nt(s),i=ln(s),n=t.visualViewport;let r=i.clientWidth,o=i.clientHeight,a=0,l=0;if(n){r=n.width,o=n.height;const h=du();(!h||h&&e==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:r,height:o,x:a,y:l}}function Jb(s,e){const t=jr(s,!0,e==="fixed"),i=t.top+s.clientTop,n=t.left+s.clientLeft,r=yi(s)?_s(s):sn(1),o=s.clientWidth*r.x,a=s.clientHeight*r.y,l=n*r.x,h=i*r.y;return{width:o,height:a,x:l,y:h}}function up(s,e,t){let i;if(e==="viewport")i=qb(s,t);else if(e==="document")i=Zb(ln(s));else if(Li(e))i=Jb(e,t);else{const n=lg(s);i={...e,x:e.x-n.x,y:e.y-n.y}}return Ms(i)}function ug(s,e){const t=Ls(s);return t===e||!Li(t)||El(t)?!1:Qt(t).position==="fixed"||ug(t,e)}function $b(s,e){const t=e.get(s);if(t)return t;let i=Sh(s,[],!1).filter(a=>Li(a)&&rn(a)!=="body"),n=null;const r=Qt(s).position==="fixed";let o=r?Ls(s):s;for(;Li(o)&&!El(o);){const a=Qt(o),l=uu(o);!l&&a.position==="fixed"&&(n=null),(r?!l&&!n:!l&&a.position==="static"&&n&&["absolute","fixed"].includes(n.position)||co(o)&&!l&&ug(s,o))?i=i.filter(h=>h!==o):n=a,o=Ls(o)}return e.set(s,i),i}function ew(s){let{element:e,boundary:t,rootBoundary:i,strategy:n}=s;const r=[...t==="clippingAncestors"?$b(e,this._c):[].concat(t),i],o=r[0],a=r.reduce((l,h)=>{const d=up(e,h,n);return l.top=Pi(d.top,l.top),l.right=Os(d.right,l.right),l.bottom=Os(d.bottom,l.bottom),l.left=Pi(d.left,l.left),l},up(e,o,n));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function tw(s){const{width:e,height:t}=og(s);return{width:e,height:t}}function iw(s,e,t){const i=yi(e),n=ln(e),r=t==="fixed",o=jr(s,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=sn(0);if(i||!i&&!r)if((rn(e)!=="body"||co(n))&&(a=bl(e)),i){const p=jr(e,!0,r,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else n&&(l.x=hg(n));const h=o.left+a.scrollLeft-l.x,d=o.top+a.scrollTop-l.y;return{x:h,y:d,width:o.width,height:o.height}}function dp(s,e){return!yi(s)||Qt(s).position==="fixed"?null:e?e(s):s.offsetParent}function dg(s,e){const t=Nt(s);if(!yi(s)||cg(s))return t;let i=dp(s,e);for(;i&&Yb(i)&&Qt(i).position==="static";)i=dp(i,e);return i&&(rn(i)==="html"||rn(i)==="body"&&Qt(i).position==="static"&&!uu(i))?t:i||Gb(s)||t}const nw=async function(s){const e=this.getOffsetParent||dg,t=this.getDimensions;return{reference:iw(s.reference,await e(s.floating),s.strategy),floating:{x:0,y:0,...await t(s.floating)}}};function sw(s){return Qt(s).direction==="rtl"}const rw={convertOffsetParentRelativeRectToViewportRelativeRect:Kb,getDocumentElement:ln,getClippingRect:ew,getOffsetParent:dg,getElementRects:nw,getClientRects:Qb,getDimensions:tw,getScale:_s,isElement:Li,isRTL:sw},pg=Hb,fg=kb,mg=zb,gg=(s,e,t)=>{const i=new Map,n={platform:rw,...t},r={...n.platform,_c:i};return Ub(s,e,{...n,platform:r})};/** + `}}createShadow(e,t,i){return this.list[e]={root:new Os,world:i,rt:new Ri(this.resolution,this.resolution),rtBlur:new Ri(this.resolution,this.resolution),blurPlane:new le,camera:this.createCamera(t)},this.list[e]}createCamera(e){return new jn(-e.x/2,e.x/2,e.z/2,-e.z/2,0,this.cameraHeight)}getSizeCenterMin(e){const t=e[0].parent,i=new Os;i.children=e;const n=new Ke().setFromObject(i);t==null||t.add(...e);const r=new O;n.getSize(r),r.x*=this.shadowExtraScaleFactor,r.z*=this.shadowExtraScaleFactor;const o=new O;n.getCenter(o);const a=n.min;return{size:r,center:o,min:a}}blurShadow(e,t){if(!e.world.renderer)throw new Error("The given world must have a renderer!");const i=new wt(ob);i.depthTest=!1;const n=new wt(ab);n.depthTest=!1,e.blurPlane.visible=!0,e.blurPlane.material=i,e.blurPlane.material.uniforms.tDiffuse.value=e.rt.texture,i.uniforms.h.value=t*1/256;const r=e.world.renderer.three;r.setRenderTarget(e.rtBlur),r.render(e.blurPlane,e.camera),e.blurPlane.material=n,e.blurPlane.material.uniforms.tDiffuse.value=e.rtBlur.texture,n.uniforms.v.value=t*1/256,r.setRenderTarget(e.rt),r.render(e.blurPlane,e.camera),e.blurPlane.visible=!1}};x(lb,"uuid","f833a09a-a3ab-4c58-b03e-da5298c7a1b6");const cb=["Station","Radius","Length","InitialKP","FinalKP","KP","Slope","Height","InitialKPV","FinalKPV"],Bm=class zm extends Re{constructor(e){super(e),x(this,"enabled",!0),x(this,"world",null),x(this,"_list",new Map),x(this,"_markerKey",0),x(this,"type","horizontal"),x(this,"divisionLength",100),e.add(zm.uuid,this)}addKPStation(e,t,i){const n=this.components.get(An),r=document.createElement("div"),o=document.createElement("div");r.appendChild(o),o.innerHTML=t,o.style.color=n.color,o.style.borderBottom="1px dotted white",o.style.width="160px",o.style.textAlign="left";const a=new _t(e,r),l=new O;l.x=i.geometry.attributes.position.getX(i.geometry.attributes.position.count-1),l.y=i.geometry.attributes.position.getY(i.geometry.attributes.position.count-1),l.z=i.geometry.attributes.position.getZ(i.geometry.attributes.position.count-1);const h=new O;h.x=i.geometry.attributes.position.getX(i.geometry.attributes.position.count-2),h.y=i.geometry.attributes.position.getY(i.geometry.attributes.position.count-2),h.z=i.geometry.attributes.position.getZ(i.geometry.attributes.position.count-2);const d=new O;d.x=(l.x+h.x)/2,d.y=(l.y+h.y)/2,d.z=(l.z+h.z)/2,a.three.position.copy(d);const p=new O;p.subVectors(l,h).normalize();const f=new Vt;f.setFromUnitVectors(new O(0,1,0),p);const g=new gf().setFromQuaternion(f).z,v=so.radToDeg(g);o.style.transform=`rotate(${-v-90}deg) translate(-35%, -50%)`;const b=this._markerKey.toString();n.setupEvents(e,!0),n.getWorldMarkerList(e).set(b,{label:a,key:b,merged:!1,static:!1}),this._markerKey++,this.save(b,"KP")}addVerticalMarker(e,t,i,n,r){const o=this.components.get(An),a=document.createElement("span");a.innerHTML=t,a.style.color=o.color;const l=new _t(e,a,r);if(n==="Height"){const d=document.createElement("span");d.innerHTML=t,d.style.color=o.color;const{position:p}=i.geometry.attributes,f=(p.array.length/3-1)*3,g=p.array.slice(f,f+3);l.three.position.set(g[0],g[1]+10,g[2])}else if(n==="InitialKPV"){const{position:d}=i.geometry.attributes,p=d.getX(0),f=d.getY(0),g=d.getZ(0);l.three.position.set(p-20,f,g)}else if(n==="FinalKPV"){const{position:d}=i.geometry.attributes,p=d.getX(i.geometry.attributes.position.count-1),f=d.getY(i.geometry.attributes.position.count-1),g=d.getZ(i.geometry.attributes.position.count-1);l.three.position.set(p+20,f,g)}else if(n==="Slope"){a.style.color="grey";const{position:d}=i.geometry.attributes,p=new O;p.x=d.getX(0),p.y=d.getY(0),p.z=d.getZ(0);const f=new O;f.x=d.getX(d.count-1),f.y=d.getY(d.count-1),f.z=d.getZ(d.count-1);const g=new O;g.addVectors(p,f).multiplyScalar(.5),l.three.position.set(g.x,g.y-10,g.z)}const h=this._markerKey.toString();return o.setupEvents(e,!0),o.getWorldMarkerList(e).set(h,{label:l,key:h,type:n,merged:!1,static:!1}),this._markerKey++,this.save(h,n),l}addCivilMarker(e,t,i,n){const r=this.components.get(An),o=document.createElement("span");o.innerHTML=t,o.style.color=r.color;const a=new _t(e,o);if(n==="InitialKP"){const h=i.geometry.attributes.position.getX(0),d=i.geometry.attributes.position.getY(0),p=i.geometry.attributes.position.getZ(0);a.three.position.set(h+2,d+2,p)}else if(n==="FinalKP"){const h=i.geometry.attributes.position.getX(i.geometry.attributes.position.count-1),d=i.geometry.attributes.position.getY(i.geometry.attributes.position.count-1),p=i.geometry.attributes.position.getZ(i.geometry.attributes.position.count-1);a.three.position.set(h+2,d-2,p)}else if(n==="Length"){const h=new O;h.x=i.geometry.attributes.position.getX(0),h.y=i.geometry.attributes.position.getY(0),h.z=i.geometry.attributes.position.getZ(0);const d=new O;d.x=i.geometry.attributes.position.getX(i.geometry.attributes.position.count-1),d.y=i.geometry.attributes.position.getY(i.geometry.attributes.position.count-1),d.z=i.geometry.attributes.position.getZ(i.geometry.attributes.position.count-1);const p=h.distanceTo(d);a.three.element.innerText=p.toFixed(2);const f=d.clone().add(h).divideScalar(2);a.three.position.copy(f)}const l=this._markerKey.toString();return r.setupEvents(e,!0),r.getWorldMarkerList(e).set(l,{label:a,key:l,type:n,merged:!1,static:!1}),this._markerKey++,this.save(l,n),a}showKPStations(e){if(!this.world)throw new Error("A world is needed for this component to work!");if(this.type==="horizontal"){const t=this.generateStartAndEndKP(e);for(const[,n]of t)this.addKPStation(this.world,n.value,n.normal);const i=this.generateConstantKP(e);for(const[,n]of i)this.addKPStation(this.world,n.value,n.normal)}}showCurveLength(e,t){if(!this.world)throw new Error("A world is needed for this component to work!");const i=this.components.get(An),n=e.length,r=`${t.toFixed(2)} m`,o=Math.round(n/2),a=e[o],l=i.create(this.world,r,a,!0);l!==void 0&&this.save(l,"Radius")}showLineLength(e,t){if(!this.world)throw new Error("A world is needed for this component to work!");const i=this.components.get(An),n=new O;n.x=e.geometry.getAttribute("position").getX(0),n.y=e.geometry.getAttribute("position").getY(0),n.z=e.geometry.getAttribute("position").getZ(0);const r=new O;r.x=e.geometry.getAttribute("position").getX(1),r.y=e.geometry.getAttribute("position").getY(1),r.z=e.geometry.getAttribute("position").getZ(1);const o=`${t.toFixed(2)} m`,a=new O;a.addVectors(n,r).multiplyScalar(.5);const l=i.create(this.world,o,a,!0);l!==void 0&&this.save(l,"Radius")}showCurveRadius(e,t){if(!this.world)throw new Error("A world is needed for this component to work!");const i=this.components.get(An),n=new O;n.x=e.geometry.getAttribute("position").getX(0),n.y=e.geometry.getAttribute("position").getY(0),n.z=e.geometry.getAttribute("position").getZ(0);const r=new O;r.x=e.geometry.getAttribute("position").getX(1),r.y=e.geometry.getAttribute("position").getY(1),r.z=e.geometry.getAttribute("position").getZ(1);const o=`R = ${t.toFixed(2)} m`,a=new O;a.addVectors(n,r).multiplyScalar(.5);const l=i.create(this.world,o,a,!0);l!==void 0&&this.save(l,"Radius")}deleteByType(e=cb){const t=this.components.get(An);for(const i of e){const n=this._list.get(i);if(n){for(const r of n)t.delete(r);this._list.delete(i)}}}generateStartAndEndKP(e){const{alignment:t}=e.curve,i=new Map;for(const n of t.horizontal){const r=n.getLength();if(i.size>0){const o=n.index-1,a=i.get(o).distance+r,l=n.mesh.geometry.getAttribute("position"),h=l.count-1,d=new O;d.x=l.getX(h),d.y=l.getY(h),d.z=l.getZ(h);const p=this.createNormalLine(n.mesh);i.set(n.index,{value:this.getShortendKPValue(a),distance:a,point:d,normal:p})}else{const o=n.mesh.geometry.getAttribute("position"),a=o.count-1,l=new O;l.x=o.getX(a),l.y=o.getY(a),l.z=o.getZ(a);const h=this.createNormalLine(n.mesh);i.set(n.index,{value:this.getShortendKPValue(r),distance:r,point:l,normal:h})}}return i}createNormalLine(e){const t=e.geometry.attributes.position.count-1,i=t-1,n=new O;n.x=e.geometry.attributes.position.getX(t),n.y=e.geometry.attributes.position.getY(t),n.z=e.geometry.attributes.position.getZ(t);const r=new O;r.x=e.geometry.attributes.position.getX(i),r.y=e.geometry.attributes.position.getY(i),r.z=e.geometry.attributes.position.getZ(i);const o=new O().subVectors(n,r).clone().applyAxisAngle(new O(0,0,1),Math.PI*.5).normalize(),a=new Ne().setFromPoints([o.clone().setLength(10).add(n),o.clone().setLength(-10).add(n)]);return new st(a)}generateConstantKP(e){const{alignment:t}=e.curve,i=new Map,n=t.getLength("horizontal"),r=Math.floor(n/this.divisionLength);for(let o=0;o1e3&&parseInt(i,10)<1e4){const[o,...a]=i;return`${o}+${a.join("")}.${r}`}if(parseInt(i,10)>1e4){const[o,a,...l]=i;return`${o}${a}+${l.join("")}.${r}`}return`0+${i.padStart(3,"0")}.${r}`}save(e,t){this._list.has(t)||this._list.set(t,new Set),this._list.get(t).add(e)}};x(Bm,"uuid","0af12c32-81ee-4100-a030-e9ae546f6170");let Lr=Bm;class Vm extends Re{constructor(e){super(e),x(this,"enabled",!0),x(this,"_highlighter"),x(this,"onHighlight",new ee),x(this,"onMarkerChange",new ee),x(this,"mouseMarkers"),x(this,"onMarkerHidden",new ee),x(this,"_curves",[]),x(this,"_previousAlignment",null),x(this,"_world",null),x(this,"updateLinesResolution",t=>{var i;(i=this._highlighter)==null||i.setResolution(t)}),x(this,"onMouseMove",t=>{var i,n,r;if(!this._world)throw new Error("No world was given for this navigator!");if(!this._world.renderer)return;const o=this._world.renderer.three.domElement.parentElement,a=this._world.camera.three,l=(i=this._highlighter)==null?void 0:i.castRay(t,a,o,this._curves);if(l){const{object:h}=l;(n=this._highlighter)==null||n.hover(h),this.updateMarker(l,"hover");return}this.mouseMarkers&&(this.mouseMarkers.hover.visible=!1),(r=this._highlighter)==null||r.unHover(),this.onMarkerHidden.trigger({type:"hover"})}),x(this,"onClick",t=>{var i,n;if(!this._world)throw new Error("No world was given for this navigator!");if(!this._world.renderer)return;const r=this._world.renderer.three.domElement.parentElement,o=this._world.camera.three,a=(i=this._highlighter)==null?void 0:i.castRay(t,o,r,this._curves);if(a){const l=a,h=l.object;if((n=this._highlighter)==null||n.select(h),this.updateMarker(l,"select"),this._world.camera.hasCameraControls()&&(h.geometry.boundingBox||h.geometry.computeBoundingBox(),h.geometry.boundingBox)){const d=this.getScaledBox(h.geometry.boundingBox,2);this._world.camera.controls.fitToBox(d,!0)}this.onHighlight.trigger({mesh:h,point:l.point}),this._previousAlignment!==h.curve.alignment&&(this.components.get(Lr).showKPStations(h),this._previousAlignment=h.curve.alignment)}}),x(this,"onControlsUpdated",()=>{if(!this._world)throw new Error("No world was given for this navigator!");if(!(this._world.camera.three instanceof jn)||!this._highlighter)return;const{zoom:t,left:i,right:n,top:r,bottom:o}=this._world.camera.three,a=i-n,l=r-o,h=Math.max(a,l)/t,d=40,{caster:p}=this._highlighter;p.params.Line.threshold=h/d})}get highlighter(){if(!this._highlighter)throw new Error("Highlighter not initialized. You must set a world first!");return this._highlighter}get world(){return this._world}set world(e){var t,i,n;if(e===this._world||(this._world&&this.setupEvents(!1),this._world=e,(t=this._highlighter)==null||t.dispose(),(i=this.mouseMarkers)==null||i.hover.dispose(),(n=this.mouseMarkers)==null||n.select.dispose(),!e))return;const r=e.scene.three;this._highlighter=new xm(r,this.view),this.mouseMarkers={select:this.newMouseMarker("#ffffff",e),hover:this.newMouseMarker("#575757",e)},this.setupEvents(!0)}async draw(e,t){if(!e.civilData)throw new Error("The provided model doesn't have civil data!");if(!this._world)throw new Error("No world was given for this navigator!");const{alignments:i}=e.civilData,n=t||i.values(),r=this._world.scene.three,o=new Ke;o.makeEmpty(),o.min.set(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),o.max.set(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(const l of n){if(!l)throw new Error("Alignment not found!");for(const h of l[this.view])if(r.add(h.mesh),this._curves.push(h.mesh),!o.isEmpty())o.expandByObject(h.mesh);else{h.mesh.geometry.computeBoundingBox();const d=h.mesh.geometry.boundingBox;d instanceof Ke&&o.copy(d).applyMatrix4(h.mesh.matrixWorld)}}const a=this.getScaledBox(o,1.2);this._world.camera.hasCameraControls()&&await this._world.camera.controls.fitToBox(a,!1)}async dispose(){var e;(e=this._highlighter)==null||e.dispose(),this.clear(),this.onHighlight.reset(),this._curves=[]}clear(){var e,t;(e=this._highlighter)==null||e.unSelect(),(t=this._highlighter)==null||t.unHover();for(const i of this._curves)i.removeFromParent();this._curves=[]}setMarker(e,t,i){if(!this._curves.length)return;const n=e.getCurveAt(t,this.view),r=e.getPointAt(t,this.view),{index:o}=n.curve.getSegmentAt(n.percentage);this.setMouseMarker(r,n.curve.mesh,o,i)}setDefSegments(e){const t=[],i=[],n=(r,o)=>{const a=o[1]-r[1],l=o[0]-r[0];return a/l};for(let r=0;r=0;f--)if(o[f*3]!==void 0&&o[f*3+1]!==void 0){h=o[f*3],d=o[f*3+1];break}const p=(n([a,l],[h,d])*100).toFixed(2);i.push({slope:p})}for(const r of e)for(let o=0;on.clone().add(i))}showLineInfo(e,t){const i=this.components.get(Lr);i.world=this._world,i.deleteByType(["Length","Radius"]);const n=e.geometry.attributes.position.array,r=this.calculateParallelCurve(n,n.length/3,t),o=new Ne().setFromPoints(r),a=new st(o,this.markupMaterial);i.showLineLength(a,e.curve.getLength()),this._scene.add(a),this.markupLines.push(a);const{startDimensionPoints:l,endDimensionPoints:h}=this.calculateDimensionLines(e,a),d=this.offsetDimensionLine(l,t*.1),p=this.offsetDimensionLine(h,t*.1),f=new Ne().setFromPoints(d),g=new Ne().setFromPoints(p),v=new st(f,this.markupMaterial);this._scene.add(v),this.markupLines.push(v);const b=new st(g,this.markupMaterial);this._scene.add(b),this.markupLines.push(b)}showClothoidInfo(e,t){const i=this.components.get(Lr);i.world=this._world,i.deleteByType(["Length","Radius"]);const n=e.geometry.attributes.position.array,r=this.calculateParallelCurve(n,n.length/3,t),o=new Ne().setFromPoints(r);i.showCurveLength(r,e.curve.getLength());const a=new st(o,this.markupMaterial);this._scene.add(a),this.markupLines.push(a);const{startDimensionPoints:l,endDimensionPoints:h}=this.calculateDimensionLines(e,a),d=this.offsetDimensionLine(l,t*.1),p=this.offsetDimensionLine(h,t*.1),f=new Ne().setFromPoints(d),g=new Ne().setFromPoints(p),v=new st(f,this.markupMaterial);this._scene.add(v),this.markupLines.push(v);const b=new st(g,this.markupMaterial);this._scene.add(b),this.markupLines.push(b)}showCircularArcInfo(e,t){const i=this.components.get(Lr);i.world=this._world,i.deleteByType(["Length","Radius"]);const n=e.curve.data.RADIUS,r=e.geometry.attributes.position.array,o=e.geometry.attributes.position.count,a=[],l=new O(r[0],r[1],r[2]),h=(o-1)*3,d=new O(r[h],r[h+1],r[h+2]),p=o/2*3,f=new O(r[p],r[p+1],r[p+2]),g=d.clone().sub(l).normalize(),v=new O(-g.y,g.x,0);v.multiplyScalar(n);const b=f.clone().add(v);a.push(f),a.push(b);const w=new Ne().setFromPoints(a),T=new st(w,this.markupMaterial);i.showCurveRadius(T,Math.abs(n)),this._scene.add(T),this.markupLines.push(T);const S=[];for(let ne=0;ne{!this._highlighter||!this.planHighlighter||this.planHighlighter.showCurveInfo(t)})}get world(){return super.world}set world(e){var t;super.world=e,e&&((t=this.planHighlighter)==null||t.dispose(),this.planHighlighter=new hb(this.components,e.scene.three,e))}};x(ub,"uuid","3096dea0-5bc2-41c7-abce-9089b6c9431b");const db=class Ym extends Vm{constructor(e){super(e),x(this,"view","vertical"),x(this,"enabled",!0),this.components.add(Ym.uuid,this)}get world(){return super.world}set world(e){this.world!==e&&(super.world=e,this._highlighter&&this._highlighter.onSelect.add(t=>{if(!this.world)throw new Error("A world is needed to work with this component!");const i=this.components.get(Lr);i.deleteByType(["Slope","Height","InitialKPV","FinalKPV"]);const{alignment:n}=t.curve,r=[];for(const h of n.vertical){const d=h.mesh.geometry.attributes.position.array;r.push(d)}const{defSegments:o,slope:a}=this.setDefSegments(r),l=this.world.scene.three;for(let h=0;h{var i;(i=this.highlighter)==null||i.setResolution(t)}),x(this,"onClick",t=>{if(!this.enabled||!this._highlighter)return;if(!this.world)throw new Error("No world found!");if(!this.world.renderer)return;const i=this.world.renderer.three.domElement,n=this.world.camera.three,r=this._highlighter.castRay(t,n,i,this._curves);if(r){const o=r.object;this._highlighter.select(o),this.updateMarker(r,"select");const{point:a,index:l}=r;l!==void 0&&this.onHighlight.trigger({curve:o,point:a,index:l});return}this._highlighter.unSelect(),this.mouseMarkers&&(this.mouseMarkers.hover.visible=!1),this.onMarkerHidden.trigger({type:"hover"})}),x(this,"onMouseMove",async t=>{if(!this.enabled||!this._highlighter)return;if(!this.world)throw new Error("No world found!");if(!this.world.renderer)return;const i=this.world.renderer.three.domElement,n=this.world.camera.three,r=this._highlighter.castRay(t,n,i,this._curves);if(r){this._highlighter.hover(r.object),this.updateMarker(r,"hover");return}this._highlighter.unHover()}),this.components.add(Gm.uuid,this)}get world(){return this._world}set world(e){var t,i,n;if(e===this._world||(this._world&&this.setupEvents(!1),this._world=e,(t=this._highlighter)==null||t.dispose(),(i=this.mouseMarkers)==null||i.hover.dispose(),(n=this.mouseMarkers)==null||n.select.dispose(),!e))return;const r=e.scene.three;this._highlighter=new xm(r,"absolute"),this.mouseMarkers={select:this.newMouseMarker("#ffffff",e),hover:this.newMouseMarker("#575757",e)},this.setupEvents(!0)}get highlighter(){if(!this._highlighter)throw new Error("Navigator not initialized!");return this._highlighter}draw(e){if(!e.civilData)throw new Error("Model must have civil data!");if(!this.world)throw new Error("A world must be given before drawing an alignment!");const t=this.world.scene.three;for(const[i,n]of e.civilData.alignments)for(const{mesh:r}of n.absolute)t.add(r),this._curves.push(r)}newMouseMarker(e,t){const i=t.scene.three,n=document.createElement("div");n.style.backgroundColor=e,n.style.width="1rem",n.style.height="1rem",n.style.borderRadius="1rem";const r=new _t(t,n,i);return r.visible=!1,r}setMarker(e,t,i){if(!this.mouseMarkers)throw new Error("No mouse markers found! Initialize the world before using this.");const n=e.getPointAt(t,"absolute");this.mouseMarkers[i].visible=!0,this.mouseMarkers[i].three.position.copy(n)}hideMarker(e){if(!this.mouseMarkers)throw new Error("No mouse markers found! Initialize the world before using this.");const t=this.mouseMarkers[e].three;t.visible=!1}setupEvents(e){var t,i;if(!this.world)throw new Error("No world found!");if(!this.world.renderer)return;const n=this.world.renderer.three.domElement;(t=this.world.renderer)==null||t.onResize.remove(this.updateLinesResolution),n.removeEventListener("click",this.onClick),n.removeEventListener("mousemove",this.onMouseMove),e&&(n.addEventListener("click",this.onClick),n.addEventListener("mousemove",this.onMouseMove),(i=this.world.renderer)==null||i.onResize.add(this.updateLinesResolution))}updateMarker(e,t){if(!this.mouseMarkers)return;const{point:i,object:n}=e,r=n,o=r.curve,a=r.curve.alignment,l=a.getPercentageAt(i,"absolute");this.mouseMarkers[t].visible=!0,this.mouseMarkers[t].three.position.copy(i),l!==null&&this.onMarkerChange.trigger({alignment:a,percentage:l,type:t,curve:o})}};x(pb,"uuid","0a59c09e-2b49-474a-9320-99f51f40f182");const fb=class jm extends Re{constructor(e){super(e),x(this,"world",null),x(this,"enabled",!0),x(this,"plane"),x(this,"_world3D",null),this.components.add(jm.uuid,this)}get world3D(){return this._world3D}set world3D(e){var t;if(this._world3D=e,(t=this.plane)==null||t.dispose(),!e)return;const i=this.components.get(Ga),n=i.Type;i.Type=Gr,this.plane=i.createFromNormalAndCoplanarPoint(e,new O(1,0,0),new O),i.Type=n,this.plane.visible=!1,this.plane.enabled=!1}async set(e,t){if(!this.world||!this.plane)throw new Error("You must set a world before using this component");this.plane.enabled=!0;const i=e.curve.getPercentageAt(t);if(i===null)return;const{startPoint:n,endPoint:r}=e.curve.getSegmentAt(i);if(e.geometry.index===null)throw new Error("Geometry must be indexed!");const o=new O;o.subVectors(r,n),o.normalize(),this.plane.setFromNormalAndCoplanarPoint(o,t),this.plane.edges.update();const a=this.plane.helper.matrix.clone();a.invert();const l=this.world.scene.three,h=this.plane.edges.get();for(const d in h){const{mesh:p}=h[d];p.position.set(0,0,0),p.rotation.set(0,0,0),p.updateMatrix(),p.applyMatrix4(a),p.parent!==l&&l.add(p)}this.plane.enabled=!1}};x(fb,"uuid","96b2c87e-d90b-4639-8257-8f01136fe324");function zn(){const s=document.createElement("div");return s.style.backgroundColor="black",s.style.color="white",s.style.padding="8px",s.style.borderRadius="8px",s.style.fontFamily="sans-serif",s}const yh=class Eh{constructor(e,t,i){x(this,"label"),x(this,"boundingBox",new le),x(this,"world"),x(this,"components"),x(this,"_length"),x(this,"_visible",!0),x(this,"_start"),x(this,"_end"),x(this,"_root",new Os),x(this,"_endpoints",[]),x(this,"_line"),this.components=e,this.world=t,this._start=i.start,this._end=i.end,this._length=this.getLength(),this._line=this.createLine(i),this.newEndpointElement(i.endpointElement),this.newEndpointElement(i.endpointElement.cloneNode(!0)),this.label=this.newText(),this._root.renderOrder=2,this.world.scene.three.add(this._root)}get visible(){return this._visible}set visible(e){this._visible=e,this.label.visible=e,this._endpoints[0].visible=e,this._endpoints[1].visible=e;const[t,i]=this._endpoints,n=t.three,r=i.three,o=this.label.three;e?(this.world.scene.three.add(this._root),this._root.add(o,n,r)):(o.removeFromParent(),n.removeFromParent(),r.removeFromParent(),this._root.removeFromParent())}get endPoint(){return this._end}set endPoint(e){this._end=e;const t=this._line.geometry.attributes.position;t.setXYZ(1,e.x,e.y,e.z),t.needsUpdate=!0,this._endpoints[1].three.position.copy(e),this.updateLabel()}get startPoint(){return this._start}set startPoint(e){this._start=e;const t=this._line.geometry.attributes.position;t.setXYZ(0,e.x,e.y,e.z),t.needsUpdate=!0,this._endpoints[0].three.position.copy(e),this.updateLabel()}get _center(){let e=this._end.clone().sub(this._start);const t=e.length()*.5;return e=e.normalize().multiplyScalar(t),this._start.clone().add(e)}dispose(){const e=this.components.get(Fi);this.visible=!1,e.destroy(this._root),e.destroy(this._line);for(const t of this._endpoints)t.dispose();this._endpoints.length=0,this.label.dispose(),this.boundingBox&&e.destroy(this.boundingBox),this.components=null}createBoundingBox(){this.boundingBox.geometry=new ut(1,1,this._length),this.boundingBox.position.copy(this._center),this.boundingBox.lookAt(this._end),this.boundingBox.visible=!1,this._root.add(this.boundingBox)}toggleLabel(){this.label.toggleVisibility()}newEndpointElement(e){const t=this._endpoints.length===0?this._start:this._end,i=new _t(this.world,e);i.three.position.copy(t),this._endpoints.push(i),this._root.add(i.three)}updateLabel(){this._length=this.getLength(),this.label.three.element.textContent=this.getTextContent(),this.label.three.position.copy(this._center),this._line.computeLineDistances()}createLine(e){const t=new Ne;t.setFromPoints([e.start,e.end]);const i=new st(t,e.lineMaterial);return this._root.add(i),i}newText(){const e=zn();e.textContent=this.getTextContent();const t=new _t(this.world,e);return t.three.position.copy(this._center),this._root.add(t.three),t}getTextContent(){return`${this._length/Eh.scale} ${Eh.units}`}getLength(){return parseFloat(this._start.distanceTo(this._end).toFixed(2))}};x(yh,"scale",1),x(yh,"units","m");let au=yh;class mb{constructor(e,t,i){x(this,"enabled",!0),x(this,"visible",!0),x(this,"points",[]),x(this,"workingPlane",null),x(this,"labelMarker"),x(this,"world"),x(this,"components"),x(this,"onDisposed",new ee),x(this,"_rotationMatrix",null),x(this,"_dimensionLines",[]),x(this,"_defaultLineMaterial",new Di({color:"red"})),x(this,"onAreaComputed",new ee),x(this,"onWorkingPlaneComputed",new ee),x(this,"onPointAdded",new ee),x(this,"onPointRemoved",new ee),this.world=t,this.components=e;const n=zn();this.labelMarker=new _t(t,n),this.labelMarker.visible=!1,this.onPointAdded.add(r=>{this.points.length===3&&!this._dimensionLines[2]&&(this.addDimensionLine(r,this.points[0]),this.labelMarker.visible=!0)}),i==null||i.forEach(r=>this.setPoint(r))}setPoint(e,t){let i;if(t?i=t:i=this.points.length===0?0:this.points.length,i===0){this.points[0]=e;return}if(i<0||i>this.points.length)return;const n=this.points.length>i;this.points[i]=e,this.onPointAdded.trigger(e),n||this.addDimensionLine(this.points[i-1],e);const{previousLine:r,nextLine:o}=this.getLinesBetweenIndex(i);r&&(r.endPoint=e),o&&(o.startPoint=e)}removePoint(e){if(this.points.length===3)return;this.points.splice(e,1);const{previousLine:t,nextLine:i}=this.getLinesBetweenIndex(e);i&&(t.endPoint=i.endPoint),i==null||i.dispose(),this._dimensionLines.splice(e,1),this.onPointRemoved.trigger()}toggleLabel(){this.labelMarker.toggleVisibility()}addDimensionLine(e,t){const i=document.createElement("div");i.className="w-2 h-2 bg-red-600 rounded-full";const n=new au(this.components,this.world,{start:e,end:t,lineMaterial:this._defaultLineMaterial,endpointElement:i});return n.toggleLabel(),this._dimensionLines.length>1?this._dimensionLines.splice(this._dimensionLines.length-1,0,n):this._dimensionLines.push(n),n}getLinesBetweenIndex(e){const t=e===0?this._dimensionLines.length-1:e-1,i=this._dimensionLines[t],n=this._dimensionLines[e];return{previousLine:i,nextLine:n}}computeWorkingPlane(){this.workingPlane=new an().setFromCoplanarPoints(this.points[0],this.points[1],this.points[2]);const e=new O(0,1,0),t=this.workingPlane.normal.angleTo(e),i=new O().crossVectors(this.workingPlane.normal,e).normalize();this._rotationMatrix=new Ee().makeRotationAxis(i,t),this.onWorkingPlaneComputed.trigger(this.workingPlane)}computeArea(){if(!(this._rotationMatrix&&this.workingPlane))return this.onAreaComputed.trigger(0),0;let e=0,t=0;const i=this._rotationMatrix,n=this.points.map(o=>{const a=o.clone().applyMatrix4(i),l=new Ve(a.x,a.z);return e+=l.x,t+=l.y,l}),r=Math.abs(Rv.area(n));return this.labelMarker.three.element.textContent=`${r.toFixed(2)} m²`,this.labelMarker.three.position.set(e/n.length,-this.workingPlane.constant,t/n.length).applyMatrix4(i.clone().invert()),this.onAreaComputed.trigger(r),r}dispose(){this.onAreaComputed.reset(),this.onWorkingPlaneComputed.reset(),this.onPointAdded.reset(),this.onPointRemoved.reset();for(const e of this._dimensionLines)e.dispose();this.labelMarker.dispose(),this._dimensionLines=[],this.points=[],this._rotationMatrix=null,this.workingPlane=null,this._defaultLineMaterial.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}get(){return{points:this.points,workingPlane:this.workingPlane,area:this.computeArea()}}}let lu=class extends x1{constructor(){super(...arguments),x(this,"onDisposed",new ee),x(this,"marker",null)}dispose(){this.marker&&this.marker.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}get(e){const t=super.get(e);return t?(this.marker||(this.marker=new _t(e)),this.marker.world!==e&&(this.marker.world=e,this.marker.three.removeFromParent(),e.scene.three.add(this.marker.three)),this.marker.visible=!0,this.marker.three.position.copy(t)):this.marker&&(this.marker.visible=!1),t}};const gb=class bh extends Re{constructor(e){super(e),x(this,"onDisposed",new ee),x(this,"list",[]),x(this,"world"),x(this,"_enabled",!1),x(this,"_vertexPicker"),x(this,"_currentAreaElement",null),x(this,"_clickCount",0),x(this,"create",()=>{if(!this.enabled)return;if(!this.world)throw new Error("World not defined for the area measurement!");const t=this._vertexPicker.get(this.world);if(t){if(!this._currentAreaElement){const i=new mb(this.components,this.world);i.onPointAdded.add(()=>{this._clickCount===3&&!i.workingPlane&&(i.computeWorkingPlane(),this._vertexPicker.workingPlane=i.workingPlane)}),i.onPointRemoved.add(()=>this._clickCount--),this._currentAreaElement=i}this._currentAreaElement.setPoint(t,this._clickCount),this._currentAreaElement.computeArea(),this._clickCount++}}),x(this,"onMouseMove",()=>{if(!this.world){console.log("No world given for the area measurement!");return}const t=this._vertexPicker.get(this.world);t&&this._currentAreaElement&&(this._currentAreaElement.setPoint(t,this._clickCount),this._currentAreaElement.computeArea())}),x(this,"onKeydown",t=>{this.enabled&&(t.key==="z"&&t.ctrlKey&&this._currentAreaElement&&this._currentAreaElement.removePoint(this._clickCount-1),t.key==="Enter"&&this._currentAreaElement&&this.endCreation(),t.key==="Escape"&&(this._clickCount===0&&!this._currentAreaElement?this.enabled=!1:this.cancelCreation()))}),this.components.add(bh.uuid,this),this._vertexPicker=new lu(e)}set enabled(e){this._enabled=e,this._vertexPicker.enabled=e,this.setupEvents(e),e||this.cancelCreation()}get enabled(){return this._enabled}set workingPlane(e){this._vertexPicker.workingPlane=e}get workingPlane(){return this._vertexPicker.workingPlane}dispose(){this.setupEvents(!1),this._vertexPicker.dispose(),this._currentAreaElement&&this._currentAreaElement.dispose();for(const e of this.list)e.dispose();this.components=null,this.onDisposed.trigger(bh.uuid),this.onDisposed.reset()}delete(){}deleteAll(){for(const e of this.list)e.dispose();this.list=[]}endCreation(){this._currentAreaElement&&(this.list.push(this._currentAreaElement),this._currentAreaElement.removePoint(this._clickCount),this._currentAreaElement.computeWorkingPlane(),this._currentAreaElement.computeArea(),this._currentAreaElement=null),this._vertexPicker.workingPlane=null,this._clickCount=0}cancelCreation(){this._currentAreaElement&&(this._currentAreaElement.dispose(),this._currentAreaElement=null),this._vertexPicker.workingPlane=null,this._clickCount=0}setupEvents(e){if(!this.world)throw new Error("The area measurement needs a world to work!");if(!this.world.renderer)throw new Error("The world of the area measurement needs a renderer!");const t=this.world.renderer.three.domElement.parentElement;e?(t.addEventListener("click",this.create),t.addEventListener("mousemove",this.onMouseMove),window.addEventListener("keydown",this.onKeydown)):(t.removeEventListener("click",this.create),t.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("keydown",this.onKeydown))}};x(gb,"uuid","c453a99e-f054-4781-9060-33df617db4a5");class vb{constructor(e,t){x(this,"enabled",!0),x(this,"visible",!0),x(this,"points",[]),x(this,"world"),x(this,"onDisposed",new ee),x(this,"_lineMaterial",new ro({color:6629591,linewidth:2})),x(this,"_lineGeometry",new Wa),x(this,"_line",new Im(this._lineGeometry,this._lineMaterial)),x(this,"_labelMarker"),x(this,"onAngleComputed",new ee),x(this,"onPointAdded",new ee),this.world=e;const i=zn();this._labelMarker=new _t(e,i),this.labelMarker.visible=!0,this.onPointAdded.add(()=>{this.points.length===1&&e.scene.three.add(this._line),this.points.length===3&&(this.labelMarker.visible=!0)}),this.onAngleComputed.add(n=>{this.labelMarker.three.element.textContent=`${n.toFixed(2)}°`,this.labelMarker.three.position.copy(this.points[1]??new O)}),t==null||t.forEach(n=>this.setPoint(n))}set lineMaterial(e){this._lineMaterial.dispose(),this._lineMaterial=e,this._line.material=e,this._lineMaterial.resolution.set(window.innerWidth,window.innerHeight)}get lineMaterial(){return this._lineMaterial}set labelMarker(e){this._labelMarker.dispose(),this._labelMarker=e}get labelMarker(){return this._labelMarker}get angle(){return{points:this.points,angle:this.computeAngle()}}setPoint(e,t){let i;if(t?i=t:i=this.points.length===0?0:this.points.length,![0,1,2].includes(i))return;this.points[i]=e,this.onPointAdded.trigger(e);const n=this.points.map(r=>[r.x,r.y,r.z]);this._lineGeometry.setPositions(n.flat())}toggleLabel(){this.labelMarker.toggleVisibility()}computeAngle(){const e=this.points[0],t=this.points[1],i=this.points[2];if(!(e&&t&&i))return 0;const n=new O().subVectors(t,e),r=new O().subVectors(t,i),o=so.radToDeg(n.angleTo(r));return this.onAngleComputed.trigger(o),o}dispose(){this.points=[],this.labelMarker.dispose(),this.onAngleComputed.reset(),this.onPointAdded.reset(),this.labelMarker.dispose(),this._line.removeFromParent(),this._lineMaterial.dispose(),this._lineGeometry.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}}const yb=class wh extends Re{constructor(e){super(e),x(this,"onDisposed",new ee),x(this,"world"),x(this,"list",[]),x(this,"_lineMaterial"),x(this,"_enabled",!1),x(this,"_vertexPicker"),x(this,"_currentAngleElement",null),x(this,"_clickCount",0),x(this,"create",()=>{if(!this.enabled)return;if(!this.world){console.log("No world selected for angle measurement!");return}const t=this._vertexPicker.get(this.world);if(t){if(!this._currentAngleElement){const i=new vb(this.world);i.lineMaterial=this.lineMaterial,this._currentAngleElement=i}this._currentAngleElement.setPoint(t,this._clickCount),this._currentAngleElement.setPoint(t,this._clickCount+1),this._currentAngleElement.setPoint(t,this._clickCount+2),this._currentAngleElement.computeAngle(),this._clickCount++,this._clickCount===3&&this.endCreation()}}),x(this,"onMouseMove",()=>{if(!this.world){console.log("No world selected for angle measurement!");return}const t=this._vertexPicker.get(this.world);t&&this._currentAngleElement&&(this._currentAngleElement.setPoint(t,this._clickCount),this._currentAngleElement.computeAngle())}),x(this,"onKeyDown",t=>{this.enabled&&(t.key==="z"&&t.ctrlKey&&this._currentAngleElement,t.key==="Escape"&&(this._clickCount===0&&!this._currentAngleElement?this.enabled=!1:this.cancelCreation()))}),this.components.add(wh.uuid,this),this._vertexPicker=new lu(e),this._lineMaterial=new ro({color:6629591,linewidth:2})}set lineMaterial(e){this._lineMaterial.dispose(),this._lineMaterial=e,this._lineMaterial.resolution.set(window.innerWidth,window.innerHeight)}get lineMaterial(){return this._lineMaterial}set enabled(e){this._enabled=e,this.setupEvents(e),this._vertexPicker.enabled=e,e||this.cancelCreation()}get enabled(){return this._enabled}set workingPlane(e){this._vertexPicker.workingPlane=e}get workingPlane(){return this._vertexPicker.workingPlane}dispose(){this.setupEvents(!1),this._lineMaterial.dispose(),this._vertexPicker.dispose();for(const e of this.list)e.dispose();this._currentAngleElement&&this._currentAngleElement.dispose(),this.components=null,this.onDisposed.trigger(wh.uuid),this.onDisposed.reset()}delete(){}deleteAll(){for(const e of this.list)e.dispose();this.list=[]}endCreation(){this._currentAngleElement&&(this.list.push(this._currentAngleElement),this._currentAngleElement.computeAngle(),this._currentAngleElement=null),this._clickCount=0}cancelCreation(){this._currentAngleElement&&(this._currentAngleElement.dispose(),this._currentAngleElement=null),this._clickCount=0}setupEvents(e){if(!this.world)throw new Error("No world selected for angle measurement!");if(!this.world.renderer)throw new Error("The given world doesn't have a renderer!");const t=this.world.renderer.three.domElement.parentElement;e?(t.addEventListener("click",this.create),t.addEventListener("mousemove",this.onMouseMove),window.addEventListener("keydown",this.onKeyDown)):(t.removeEventListener("click",this.create),t.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("keydown",this.onKeyDown))}};x(yb,"uuid","622fb2c9-528c-4b0a-8a0e-6a1375f0a3aa");const Wm=class Ih extends Re{constructor(e){super(e),x(this,"onDisposed",new ee),x(this,"onBeforeUpdate",new ee),x(this,"onAfterUpdate",new ee),x(this,"snapDistance",.25),x(this,"_vertexPicker"),x(this,"_lineMaterial",new Di({color:"#DC2626",linewidth:2,depthTest:!1})),x(this,"list",[]),x(this,"world"),x(this,"_visible",!0),x(this,"_enabled",!1),x(this,"_temp",{isDragging:!1,start:new O,end:new O,dimension:void 0}),x(this,"create",t=>{const i=t instanceof kn?t:void 0;if(this._enabled){if(!this._temp.isDragging){this.drawStart(i);return}this.endCreation()}}),x(this,"onMouseMove",()=>{this.world&&this._vertexPicker.get(this.world)}),this.components.add(Ih.uuid,this),this._vertexPicker=new lu(e,{previewElement:zn(),snapDistance:this.snapDistance})}get enabled(){return this._enabled}set enabled(e){e||this.cancelCreation(),this._enabled=e,this._vertexPicker.enabled=e,this.setupEvents(e)}get visible(){return this._visible}set visible(e){this._visible=e;for(const t of this.list)t.visible=e}get color(){return this._lineMaterial.color}set color(e){this._lineMaterial.color=e}dispose(){this.setupEvents(!1),this.enabled=!1;for(const e of this.list)e.dispose();this._lineMaterial.dispose(),this.list=[],this._vertexPicker.dispose(),this.onDisposed.trigger(Ih.uuid),this.onDisposed.reset()}async update(e){this._enabled&&this._temp.isDragging&&this.drawInProcess()}createOnPoints(e,t){const i=this.drawDimension();i.startPoint=e,i.endPoint=t,i.createBoundingBox(),this.list.push(i)}delete(){if(!this.world)throw new Error("World is needed for Length Measurement!");if(!this._enabled||this.list.length===0)return;const e=this.getBoundingBoxes(),t=this.components.get(ni).get(this.world).castRay(e);if(!t)return;const i=this.list.find(n=>n.boundingBox===t.object);if(i){const n=this.list.indexOf(i);this.list.splice(n,1),i.dispose()}}async deleteMeasurement(e){if(e){const t=this.list.indexOf(e);this.list.splice(t,1),e.dispose()}}deleteAll(){for(const e of this.list)e.dispose();this.list=[]}cancelCreation(){var e;this._temp.dimension&&(this._temp.isDragging=!1,(e=this._temp.dimension)==null||e.dispose(),this._temp.dimension=void 0)}drawStart(e){if(!this.world)throw new Error("The length measurement needs a world to work!");const t=e?[e]:void 0,i=this.components.get(ni).get(this.world).castRay(t),n=this._vertexPicker.get(this.world);i&&n&&(this._temp.isDragging=!0,this._temp.start=e?i.point:n)}drawInProcess(){if(!this.world)throw new Error("The length measurement needs a world to work!");if(!this.components.get(ni).get(this.world).castRay())return;const e=this._vertexPicker.get(this.world);e&&(this._temp.end=e,this._temp.dimension||(this._temp.dimension=this.drawDimension()),this._temp.dimension.endPoint=this._temp.end)}endCreation(){this._temp.dimension&&(this._temp.dimension.createBoundingBox(),this.list.push(this._temp.dimension),this._temp.dimension=void 0,this._temp.isDragging=!1)}drawDimension(){if(!this.world)throw new Error("The length measurement needs a world to work!");return new au(this.components,this.world,{start:this._temp.start,end:this._temp.end,lineMaterial:this._lineMaterial,endpointElement:zn()})}getBoundingBoxes(){return this.list.map(e=>e.boundingBox).filter(e=>e!==void 0)}setupEvents(e){if(!this.world)throw new Error("The length measurement needs a world to work!");if(!this.world.renderer)throw new Error("The world of the length measurement needs a renderer!");const t=this.world.renderer.three.domElement.parentElement;t&&(t.removeEventListener("click",this.create),e&&t.addEventListener("mousemove",this.onMouseMove))}};x(Wm,"uuid","2f9bcacf-18a9-4be6-a293-e898eae64ea1");let _r=Wm;const Eb=class Xm extends Re{constructor(e){super(e),x(this,"label",null),x(this,"world"),x(this,"onVolumeFound",new ee),x(this,"_enabled",!1),x(this,"onDisposed",new ee),x(this,"create",()=>{if(!this.enabled)return;if(!this.world)throw new Error("World is needed for Volume Measurement!");const t=this.components.get(ni).get(this.world).castRay();if(!t||!t.object)return;const{object:i}=t;if(i instanceof le){const n=this.getVolumeOfMesh(i);this.onVolumeFound.trigger(n)}}),x(this,"onMouseMove",()=>{}),x(this,"onKeydown",t=>{}),this.components.add(Xm.uuid,this)}set enabled(e){this._enabled=e,this.setupEvents(e),e||this.cancelCreation()}get enabled(){return this._enabled}async dispose(){var e;this.setupEvents(!1),(e=this.label)==null||e.dispose(),this.onDisposed.trigger(),this.onDisposed.reset(),this.components=null}delete(){}async deleteAll(){}endCreation(){}cancelCreation(){}get(){}getVolumeFromFragments(e){const t=this.components.get(rt),i=new Ee,n=[];for(const r in e){const o=t.list.get(r);if(!o)continue;const a=e[r];let l=0;for(const p of a){const f=o.getInstancesIDs(p);f&&(l+=f.size)}const h=new Kt(o.mesh.geometry,void 0,l);let d=0;for(const p of a){const f=o.getInstancesIDs(p);if(f)for(const g of f)o.mesh.getMatrixAt(g,i),h.setMatrixAt(d++,i)}n.push(h)}return this.getVolumeFromMeshes(n)}getVolumeFromMeshes(e){if(!this.world)throw new Error("World is needed for Volume Measurement!");this.label||(this.label=this.newLabel(),this.label.three.removeFromParent());let t=0;for(const l of e)t+=this.getVolumeOfMesh(l);const i=this.world.scene.three,n=this.label.three;i.add(n);const r=this.components.get(tm);for(const l of e)l.geometry.computeBoundingSphere(),r.addMesh(l);const o=r.getSphere();r.reset(),n.position.copy(o.center);const a=Math.trunc(t*100)/100;return n.element.textContent=a.toString(),t}newLabel(){if(!this.world)throw new Error("World is needed for Volume Measurement!");const e=zn();return new _t(this.world,e)}setupEvents(e){if(!this.world)throw new Error("The volume measurement needs a world to work!");if(!this.world.renderer)throw new Error("The world of the volume measurement needs a renderer!");const t=this.world.renderer.three.domElement.parentElement;e?(t.addEventListener("click",this.create),t.addEventListener("mousemove",this.onMouseMove),window.addEventListener("keydown",this.onKeydown)):(t.removeEventListener("click",this.create),t.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("keydown",this.onKeydown))}getVolumeOfMesh(e){let t=0;const i=new O,n=new O,r=new O,{index:o}=e.geometry,a=e.geometry.attributes.position.array;if(!o)return console.warn("Geometry must be indexed to compute its volume!"),0;const l=[];if(e instanceof Kt)for(let d=0;d{if(!this.world)throw new Error("No world given to the face measurement!");if(!this.enabled||!this._currentSelelection)return;const t=this.world.scene.three,i=new Ne,n=new le(i,this.selectionMaterial);i.setAttribute("position",this.preview.geometry.attributes.position),t.add(n),i.computeBoundingSphere();const{area:r,perimeter:o}=this._currentSelelection,a=this.newLabel(i,r);n.add(a.three),this.selection.push({area:r,perimeter:o,mesh:n,label:a})}),x(this,"onMouseMove",()=>{if(!this.world)throw new Error("The face measurement needs a world to work!");if(!this.enabled){this.unselect();return}const t=this.components.get(ni).get(this.world).castRay();if(!t||!t.object||t.faceIndex===void 0){this.unselect();return}const{object:i,faceIndex:n}=t;i instanceof le||i instanceof Kt?this.updateSelection(i,n,t.instanceId):this.unselect()}),x(this,"onKeydown",t=>{}),this.components.add(Km.uuid,this),this.preview.frustumCulled=!1}set enabled(e){if(!this.world)throw new Error("No world given for the Face measurement!");this._enabled=e,this.setupEvents(e),e?this.world.scene.three.add(this.preview):(this.preview.removeFromParent(),this.cancelCreation()),this.setVisibility(e)}get enabled(){return this._enabled}dispose(){this.setupEvents(!1),this.deleteAll(),this.preview.removeFromParent(),this.preview.material.dispose(),this.preview.geometry.dispose(),this.selectionMaterial.dispose(),this.onDisposed.trigger(),this.onDisposed.reset(),this.components=null}delete(){if(!this.world)throw new Error("No world given to the face measurement!");const e=this.selection.map(r=>r.mesh),t=this.components.get(ni).get(this.world).castRay(e);if(!t||!t.object)return;const i=this.selection.find(r=>r.mesh===t.object);if(!i)return;i.mesh.removeFromParent(),i.mesh.geometry.dispose(),i.label.dispose();const n=this.selection.indexOf(i);this.selection.splice(n,1)}deleteAll(){for(const e of this.selection)e.mesh.removeFromParent(),e.mesh.geometry.dispose(),e.label.dispose();this.selection=[]}endCreation(){}cancelCreation(){}get(){const e=[];for(const t of this.selection){const i=t.mesh.geometry,{area:n,perimeter:r}=t,o=i.attributes.position.array;e.push({position:o,area:n,perimeter:r})}return e}set(e){if(!this.world)throw new Error("No world given to the face measurement!");const t=this.world.scene.three;for(const i of e){const n=new Ne,r=new le(n,this.selectionMaterial);t.add(r);const o=new gt(i.position,3);n.setAttribute("position",o),n.computeBoundingSphere();const{area:a,perimeter:l}=i,h=this.newLabel(n,a);r.add(h.three),this.selection.push({area:a,perimeter:l,mesh:r,label:h})}}setupEvents(e){if(!this.world)throw new Error("The face measurement needs a world to work!");if(!this.world.renderer)throw new Error("The world of the face measurement needs a renderer!");const t=this.world.renderer.three.domElement.parentElement;t.removeEventListener("click",this.create),t.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("keydown",this.onKeydown),e&&(t.addEventListener("click",this.create),t.addEventListener("mousemove",this.onMouseMove),window.addEventListener("keydown",this.onKeydown))}setVisibility(e){if(!this.world)throw new Error("The face measurement needs a world to work!");const t=this.world.scene.three;for(const i of this.selection){const n=i.label.three;e?(t.add(i.mesh),i.mesh.add(n)):(i.mesh.removeFromParent(),n.removeFromParent())}}unselect(){this.preview.removeFromParent(),this._currentSelelection=null}updateSelection(e,t,i){if(!this.world)throw new Error("The face measurement needs a world to work!");this.world.scene.three.add(this.preview);const n=this.components.get(ja).getFace(e,t,i);if(n===null)return;const r=this.regenerateHighlight(e,n.indices,i);let o=0;for(const{distance:a}of n.edges)o+=a;this._currentSelelection={perimeter:o,area:r}}newLabel(e,t){if(!e.boundingSphere)throw new Error("Error computing area geometry");if(!this.world)throw new Error("The face measurement needs a world to work!");const{center:i}=e.boundingSphere,n=zn(),r=Math.trunc(t*100)/100;n.textContent=r.toString();const o=new _t(this.world,n);return o.three.position.copy(i),o}regenerateHighlight(e,t,i){const n=[],r=[];let o=0,a=0;const l=new On,h=this.components.get(ja);for(const f of t){const{p1:g,p2:v,p3:b}=h.getVerticesAndNormal(e,f,i);n.push(g.x,g.y,g.z),n.push(v.x,v.y,v.z),n.push(b.x,b.y,b.z),l.set(g,v,b),a+=l.getArea(),r.push(o,o+1,o+2),o+=3}const d=new Float32Array(n),p=new gt(d,3);return this.preview.geometry.setAttribute("position",p),this.preview.geometry.setIndex(r),a}};x(bb,"uuid","30279548-1309-44f6-aa97-ce26eed73522");const wb=class Qm extends Re{constructor(e){super(e),x(this,"preview"),x(this,"tolerance",.3),x(this,"world"),x(this,"onDisposed",new ee),x(this,"_enabled",!1),x(this,"_lineMaterial",new Di({color:"#DC2626",linewidth:2,depthTest:!1,transparent:!0})),x(this,"create",async()=>{if(!this.preview||!this.enabled||!this.preview.visible)return;const t=this.components.get(_r);t.world=this.world;const i=this.preview.startPoint.clone(),n=this.preview.endPoint.clone();t.createOnPoints(i,n)}),x(this,"onMouseMove",()=>{if(!this.preview)return;if(!this.world)throw new Error("The edge measurement needs a world to work!");if(!this.enabled){this.preview.visible=!1;return}const t=this.components.get(ni).get(this.world).castRay();if(!t||!t.object){this.preview.visible=!1;return}const{object:i,faceIndex:n,point:r}=t;if(n===void 0){this.preview.visible=!1;return}i instanceof le||i instanceof Kt?this.updateSelection(i,r,n,t.instanceId):this.preview.visible=!1}),x(this,"onKeydown",t=>{}),this.components.add(Qm.uuid,this)}set enabled(e){if(this._enabled=e,this.setupEvents(e),e){if(!this.world)throw new Error("The edge measurement needs a world to work!");if(!this.preview){const t=document.createElement("div");t.className="w-2 h-2 bg-red-600 rounded-full",this.preview=new au(this.components,this.world,{start:new O,end:new O,lineMaterial:this._lineMaterial,endpointElement:t}),this.preview.visible=!1}}else this.cancelCreation()}get enabled(){return this._enabled}dispose(){this.preview&&this.preview.dispose(),this._lineMaterial.dispose(),this.setupEvents(!1),this.onDisposed.trigger(),this.onDisposed.reset(),this.components=null}delete(){if(!this.enabled)return;const e=this.components.get(_r),t=e.enabled;e.enabled=!0,e.delete(),e.enabled=t}deleteAll(){this.components.get(_r).deleteAll()}endCreation(){}cancelCreation(){}get(){const e=this.components.get(_r).list,t=[];for(const i of e){const n=i.startPoint,r=i.endPoint,o=[n.x,n.y,n.z,r.x,r.y,r.z];t.push(o)}return t}set(e){const t=this.components.get(_r);t.world=this.world;for(const i of e){const[n,r,o,a,l,h]=i,d=new O(n,r,o),p=new O(a,l,h);t.createOnPoints(d,p)}}setupEvents(e){if(!this.world)throw new Error("The edge measurement needs a world to work!");if(!this.world.renderer)throw new Error("The world of the edge measurement needs a renderer!");const t=this.world.renderer.three.domElement.parentElement;e?(t.addEventListener("click",this.create),t.addEventListener("mousemove",this.onMouseMove),window.addEventListener("keydown",this.onKeydown)):(t.removeEventListener("click",this.create),t.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("keydown",this.onKeydown))}updateSelection(e,t,i,n){if(!this.preview||!e.geometry.index)return;const r=this.components.get(ja).getFace(e,i,n);if(!r)return;const{edges:o}=r;let a=Number.MAX_VALUE,l=[];for(const p of o){const[f,g]=p.points,v=ja.distanceFromPointToLine(t,f,g,!0);v{const o=r.data.colors,a={},l={},h={},d={},p=performance.now();let f=!1;const g=new Set(this._foundGeometries);for(const[v,b]of o){const w=this._geometries.get(v);if(!w)continue;const T=b>this.threshold,{exists:S}=w;if(!T&&!S)continue;const _=this._indexModelID.get(w.modelIndex);g.delete(v),T&&S?(w.time=p,d[_]||(d[_]=new Set),d[_].add(w.geometryID),this._foundGeometries.add(v),f=!0):T&&!S?(a[_]||(a[_]=new Map),w.time=p,w.exists=!0,a[_].has(b)||a[_].set(b,new Set),a[_].get(b).add(w.geometryID),this._foundGeometries.add(v),f=!0):!T&&S&&(this.handleLostGeometries(p,v,w,l,h),f=!0)}f&&await this.onViewUpdated.trigger({toLoad:a,toRemove:l,toHide:h,toShow:d}),this._isWorkerBusy=!1}),this.updateInterval=500,this._geometry=new ut(1,1,1),this._geometry.groups=[],this._geometry.deleteAttribute("uv");const n=this._geometry.attributes.position.array;for(let r=0;rparseInt(f,10)),p=[];for(const f of i.ids){const g=i.get(f);if(!g.colors)throw new Error("Malformed fragments!");for(const v of g.colors)v.setRGB(l/255,h/255,d/255,"srgb");p.push(g)}a.fragment.add(p),Si.enabled=n,this.needsUpdate=!0}removeFragment(e,t){const i=this._modelIDIndex.get(e),n=this.codes.get(i).get(t),r=this._geometries.get(n);if(r.hidden||this.setGeometryVisibility(r,!0,!1),r.fragment){const{fragment:o}=r;o.dispose(!1),r.fragment=void 0}}setModelTransformation(e,t){const i=this._modelIDIndex.get(e);if(i===void 0)throw new Error("Model not found!");const n=this.boxes.get(i);n&&(n.mesh.position.set(0,0,0),n.mesh.rotation.set(0,0,0),n.mesh.scale.set(1,1,1),n.mesh.applyMatrix4(t));const r=this._geometriesGroups.get(i);r&&(r.position.set(0,0,0),r.rotation.set(0,0,0),r.scale.set(1,1,1),r.applyMatrix4(t))}setVisibility(e,t,i){const n=this._modelIDIndex.get(t);if(n!==void 0)for(const[r,o]of i){const a=this.codes.get(n);if(a===void 0)throw new Error("Map not found!");const l=a.get(r),h=this._geometries.get(l);if(h===void 0)throw new Error("Geometry not found!");h.hidden=!e,this.setGeometryVisibility(h,e,!0,o)}}setGeometryVisibility(e,t,i,n){const{modelIndex:r,geometryID:o,assetIDs:a}=e,l=this.boxes.get(r);if(l===void 0)throw new Error("Model not found!");const h=n||a;if(i&&e.fragment)e.fragment.setVisibility(t,h);else{const d=new Set;for(const p of h){const f=this.getInstanceID(p,o);d.add(f)}l.setVisibility(t,d)}}handleLostGeometries(e,t,i,n,r){const o=this._indexModelID.get(i.modelIndex),a=e-i.time;a>this.maxLostTime?(n[o]||(n[o]=new Set),i.exists=!1,n[o].add(i.geometryID),this._foundGeometries.delete(t)):a>this.maxHiddenTime&&(r[o]||(r[o]=new Set),r[o].add(i.geometryID))}createModelIndex(e){if(this._modelIDIndex.has(e))throw new Error("Can't load the same model twice!");const t=this._nextModelID;return this._nextModelID++,this._modelIDIndex.set(e,t),this._indexModelID.set(t,e),t}getInstanceID(e,t){const i=10**(Math.log(t)*Math.LOG10E+1|0);return e+t/i}}var Zm={exports:{}};(function(s,e){(function(t,i){s.exports=i()})(np,function(){var t=function(c,u){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,y){m.__proto__=y}||function(m,y){for(var E in y)Object.prototype.hasOwnProperty.call(y,E)&&(m[E]=y[E])})(c,u)},i=function(){return(i=Object.assign||function(c){for(var u,m=1,y=arguments.length;m"u"||r.Promise||(r.Promise=Promise);var h=Object.getPrototypeOf,d={}.hasOwnProperty;function p(c,u){return d.call(c,u)}function f(c,u){typeof u=="function"&&(u=u(h(c))),(typeof Reflect>"u"?o:Reflect.ownKeys)(u).forEach(function(m){v(c,m,u[m])})}var g=Object.defineProperty;function v(c,u,m,y){g(c,u,l(m&&p(m,"get")&&typeof m.get=="function"?{get:m.get,set:m.set,configurable:!0}:{value:m,configurable:!0,writable:!0},y))}function b(c){return{from:function(u){return c.prototype=Object.create(u.prototype),v(c.prototype,"constructor",c),{extend:f.bind(null,c.prototype)}}}}var w=Object.getOwnPropertyDescriptor,T=[].slice;function S(c,u,m){return T.call(c,u,m)}function _(c,u){return u(c)}function I(c){if(!c)throw new Error("Assertion Failed")}function P(c){r.setImmediate?setImmediate(c):setTimeout(c,0)}function M(c,u){if(typeof u=="string"&&p(c,u))return c[u];if(!u)return c;if(typeof u!="string"){for(var m=[],y=0,E=u.length;y"u"?[]:function(){var c=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[c,h(c),c];var u=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[u,h(u),c]}(),tr=wi[0],Bt=wi[1],wi=wi[2],Bt=Bt&&Bt.then,ir=tr&&tr.constructor,Nl=!!wi,nr=function(c,u){sr.push([c,u]),Co&&(queueMicrotask(W0),Co=!1)},Ul=!0,Co=!0,mn=[],To=[],kl=ai,zi={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Le,pgp:!1,env:{},finalize:Le},ye=zi,sr=[],gn=0,xo=[];function de(c){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var u=this._PSD=ye;if(typeof c!="function"){if(c!==er)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&zl(this,this._value))}this._state=null,this._value=null,++u.ref,function m(y,E){try{E(function(C){if(y._state===null){if(C===y)throw new TypeError("A promise cannot be resolved with itself.");var R=y._lib&&$n();C&&typeof C.then=="function"?m(y,function(F,U){C instanceof de?C._then(F,U):C.then(F,U)}):(y._state=!0,y._value=C,Fu(y)),R&&es()}},zl.bind(null,y))}catch(C){zl(y,C)}}(this,c)}var Bl={get:function(){var c=ye,u=Ro;function m(y,E){var C=this,R=!c.global&&(c!==ye||u!==Ro),F=R&&!Hi(),U=new de(function(D,H){Vl(C,new Ou(Lu(y,c,R,F),Lu(E,c,R,F),D,H,c))});return this._consoleTask&&(U._consoleTask=this._consoleTask),U}return m.prototype=er,m},set:function(c){v(this,"then",c&&c.prototype===er?Bl:{get:function(){return c},set:Bl.set})}};function Ou(c,u,m,y,E){this.onFulfilled=typeof c=="function"?c:null,this.onRejected=typeof u=="function"?u:null,this.resolve=m,this.reject=y,this.psd=E}function zl(c,u){var m,y;To.push(u),c._state===null&&(m=c._lib&&$n(),u=kl(u),c._state=!1,c._value=u,y=c,mn.some(function(E){return E._value===y._value})||mn.push(y),Fu(c),m&&es())}function Fu(c){var u=c._listeners;c._listeners=[];for(var m=0,y=u.length;m.",Du="String expected.",is=[],Oo="__dbnames",Gl="readonly",jl="readwrite";function En(c,u){return c?u?function(){return c.apply(this,arguments)&&u.apply(this,arguments)}:c:u}var Nu={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Fo(c){return typeof c!="string"||/\./.test(c)?function(u){return u}:function(u){return u[c]===void 0&&c in u&&delete(u=ne(u))[c],u}}function Uu(){throw fe.Type()}function Fe(c,u){try{var m=ku(c),y=ku(u);if(m!==y)return m==="Array"?1:y==="Array"?-1:m==="binary"?1:y==="binary"?-1:m==="string"?1:y==="string"?-1:m==="Date"?1:y!=="Date"?NaN:-1;switch(m){case"number":case"Date":case"string":return uK+Z&&X(K+Y)})})}return X(0).then(function(){if(0=Y})).length!==0?(H.forEach(function(X){G.push(function(){var K=z,Z=X._cfg.dbschema;zo(L,K,B),zo(L,Z,B),z=L._dbSchema=Z;var q=tc(K,Z);q.add.forEach(function(he){ic(B,he[0],he[1].primKey,he[1].indexes)}),q.change.forEach(function(he){if(he.recreate)throw new fe.Upgrade("Not yet support for changing primary key");var ue=B.objectStore(he.name);he.add.forEach(function(Ie){return ko(ue,Ie)}),he.change.forEach(function(Ie){ue.deleteIndex(Ie.name),ko(ue,Ie)}),he.del.forEach(function(Ie){return ue.deleteIndex(Ie)})});var ie=X._cfg.contentUpgrade;if(ie&&X._cfg.version>Y){No(L,B),N._memoizedTables={};var ce=V(Z);q.del.forEach(function(he){ce[he]=K[he]}),ec(L,[L.Transaction.prototype]),Uo(L,[L.Transaction.prototype],o(ce),ce),N.schema=ce;var se,ae=Pt(ie);return ae&&ts(),q=de.follow(function(){var he;(se=ie(N))&&ae&&(he=Hi.bind(null,null),se.then(he,he))}),se&&typeof se.then=="function"?de.resolve(se):q.then(function(){return se})}}),G.push(function(K){var Z,q,ie=X._cfg.dbschema;Z=ie,q=K,[].slice.call(q.db.objectStoreNames).forEach(function(ce){return Z[ce]==null&&q.db.deleteObjectStore(ce)}),ec(L,[L.Transaction.prototype]),Uo(L,[L.Transaction.prototype],L._storeNames,L._dbSchema),N.schema=L._dbSchema}),G.push(function(K){L.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(L.idbdb.version/10)===X._cfg.version?(L.idbdb.deleteObjectStore("$meta"),delete L._dbSchema.$meta,L._storeNames=L._storeNames.filter(function(Z){return Z!=="$meta"})):K.objectStore("$meta").put(X._cfg.version,"version"))})}),function X(){return G.length?de.resolve(G.shift()(N.idbtrans)).then(X):de.resolve()}().then(function(){Ku(z,B)})):de.resolve();var L,Y,N,B,G,z}).catch(R)):(o(E).forEach(function(H){ic(m,H,E[H].primKey,E[H].indexes)}),No(c,m),void de.follow(function(){return c.on.populate.fire(C)}).catch(R));var U,D})}function rv(c,u){Ku(c._dbSchema,u),u.db.version%10!=0||u.objectStoreNames.contains("$meta")||u.db.createObjectStore("$meta").add(Math.ceil(u.db.version/10-1),"version");var m=Bo(0,c.idbdb,u);zo(c,c._dbSchema,u);for(var y=0,E=tc(m,c._dbSchema).change;yMath.pow(2,62)?0:z.oldVersion,L=z<1,c.idbdb=G.result,C&&rv(c,H),sv(c,z/10,H,N))},N),G.onsuccess=Ze(function(){H=null;var z,X,K,Z,q,ie=c.idbdb=G.result,ce=S(ie.objectStoreNames);if(0"u"?de.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(Y){function N(){return indexedDB.databases().finally(Y)}U=setInterval(N,100),N()}).finally(function(){return clearInterval(U)}):Promise.resolve()).then(F)]).then(function(){return R(),u.onReadyBeingFired=[],de.resolve(rc(function(){return c.on.ready.fire(c.vip)})).then(function Y(){if(0u.limit?Y.length=u.limit:c.length===u.limit&&Y.length=X.limit&&(!X.values||ie.req.values)&&dv(ie.req.query.range,X.query.range)}),!1,K,Z];case"count":return q=Z.find(function(ie){return sd(ie.req.query.range,X.query.range)}),[q,!!q,K,Z]}}(u,m,"query",C),H=D[0],L=D[1],Y=D[2],N=D[3];return H&&L?H.obsSet=C.obsSet:(L=y.query(C).then(function(B){var G=B.result;if(H&&(H.res=G),R){for(var z=0,X=G.length;z{await this.loadFoundGeometries(i),await this.unloadLostGeometries(n),this.setMeshVisibility(r,!0),this.setMeshVisibility(o,!1)})}get culler(){if(!this._culler)throw new Error("You must set a world before using the streamer!");return this._culler}dispose(){var e;this._isDisposing=!0,this.onFragmentsLoaded.reset(),this.onFragmentsDeleted.reset(),this._ramCache.clear(),this.models={},this._geometryInstances={},this._loadedFragments={},this.fragIDData.clear(),this._baseMaterial.dispose(),this._baseMaterialT.dispose(),(e=this._culler)==null||e.dispose(),this.onDisposed.trigger(xh.uuid),this.onDisposed.reset(),this._isDisposing=!1}async load(e,t,i){const{assets:n,geometries:r,globalDataFileId:o}=e,a=this.url+o,l=await(await fetch(a)).arrayBuffer(),h=new Uint8Array(l),d=this.components.get(rt).load(h,{coordinate:t});this.world.scene.three.add(d);const{opaque:p,transparent:f}=d.geometryIDs;for(const[v,b]of p){const w=d.keyFragments.get(b);if(w===void 0)throw new Error("Malformed fragments group!");this.fragIDData.set(w,[d,v,new Set])}for(const[v,b]of f){const w=d.keyFragments.get(b);if(w===void 0)throw new Error("Malformed fragments group!");this.fragIDData.set(w,[d,Math.abs(v),new Set])}this.culler.add(d.uuid,n,r),this.models[d.uuid]={assets:n,geometries:r};const g=new Map;for(const v of n){const b=v.id;for(const{transformation:w,geometryID:T,color:S}of v.geometries){g.has(T)||g.set(T,[]);const _=g.get(T);if(!_)throw new Error("Malformed instances");_.push({id:b,transformation:w,color:S})}}if(this._geometryInstances[d.uuid]=g,i){const v=new Map,b=new Map;for(const I in i.ids){const P=i.ids[I],M=parseInt(I,10);v.set(M,P)}for(const I in i.types){const P=i.types[I],M=parseInt(I,10);b.set(M,P)}const w=o.replace("-global","-properties");d.streamSettings={baseUrl:this.url,baseFileName:w,ids:v,types:b};const{indexesFile:T}=i,S=await(await fetch(this.url+T)).text(),_=this.components.get(gl);_.setRelationMap(d,_.getRelationsMapFromJSON(S))}return this.culler.needsUpdate=!0,d}remove(e){this._isDisposing=!0;const t=this.components.get(rt).groups.get(e);if(t===void 0){console.log("Group to delete not found.");return}delete this.models[e],delete this._geometryInstances[e],delete this._loadedFragments[e];const i=t.keyFragments.values();for(const n of i)this.fragIDData.delete(n);this.culler.remove(e),this._isDisposing=!1}setVisibility(e,t){const i=new Map;for(const n in t){const r=this.fragIDData.get(n);if(r===void 0)throw new Error("Geometry not found!");const[o,a,l]=r,h=o.uuid;i.has(h)||i.set(h,new Map);const d=i.get(h),p=t[n];for(const g of p)e?l.delete(g):l.add(g);d.get(a)||d.set(a,new Set);const f=d.get(a);for(const g of p)f.add(g)}for(const[n,r]of i){this.culler.setVisibility(e,n,r);for(const[o]of r){const a=this._loadedFragments[n];if(!a)continue;const l=a[o];if(l)for(const h of l){const d=t[h.id];d&&h.setVisibility(e,d)}}}this.culler.needsUpdate=!0}async clearCache(){await this._fileCache.delete()}get(){}update(){}async loadFoundGeometries(e){for(const t in e){if(this._isDisposing)return;const i=this.components.get(rt).groups.get(t);if(!i)return;const{geometries:n}=this.models[t],r=new Map,o=new Set;for(const[d,p]of e[t])for(const f of p){o.add(f);const g=n[f];if(!g)throw new Error("Geometry not found");if(g.geometryFile){const v=g.geometryFile,b=r.get(v)||0;r.set(v,b+d)}}const a=Array.from(r).sort((d,p)=>p[1]-d[1]);for(const[d]of a){const p=this.url+d;if(!this._ramCache.has(p)){let v=new Uint8Array;if(this.useCache){const w=await this._fileCache.files.get(p);if(w)v=w.file;else{const T=await(await fetch(p)).arrayBuffer();v=new Uint8Array(T),this._fileCache.files.add({file:v,id:p})}}else{const w=await(await fetch(p)).arrayBuffer();v=new Uint8Array(w)}const b=this.serializer.import(v);this._ramCache.set(p,{data:b,time:performance.now()})}const f=this._ramCache.get(p);if(!f)continue;f.time=performance.now();const g=[];if(f)for(const[v,{position:b,index:w,normal:T}]of f.data){if(this._isDisposing)return;if(!o.has(v)||!this._geometryInstances[t]||!this._geometryInstances[t].has(v))continue;const S=this._geometryInstances[t].get(v);if(!S)throw new Error("Instances not found!");const _=new Ne,I=new gt(b,3),P=new gt(T,3);_.setAttribute("position",I),_.setAttribute("normal",P),_.setIndex(Array.from(w));const M=[],k=[];for(const V of S)V.color[3]===1?k.push(V):M.push(V);this.newFragment(i,v,_,M,!0,g),this.newFragment(i,v,_,k,!1,g)}g.length&&!this._isDisposing&&this.onFragmentsLoaded.trigger(g)}const l=new Set,h=performance.now();for(const[d,{time:p}]of this._ramCache)h-p>this.maxRamTime&&l.add(d);for(const d of l)this._ramCache.delete(d)}}async unloadLostGeometries(e){if(this._isDisposing)return;const t=[],i=this.components.get(rt);for(const n in e){const r=i.groups.get(n);if(!r)throw new Error("Fragment group not found!");if(!this._loadedFragments[n])continue;const o=this._loadedFragments[n],a=e[n];for(const l of a){if(this.culler.removeFragment(r.uuid,l),!o[l])continue;const h=o[l];for(const d of h)r.items.splice(r.items.indexOf(d),1),t.push(d);delete o[l]}}t.length&&this.onFragmentsDeleted.trigger(t);for(const n of t)i.list.delete(n.id),this.world.meshes.delete(n.mesh),n.mesh.material=[],n.dispose(!0)}setMeshVisibility(e,t){for(const i in e)for(const n of e[i]){const r=this._loadedFragments[i];if(!r)continue;const o=r[n];if(o)for(const a of o)a.mesh.visible=t}}newFragment(e,t,i,n,r,o){if(n.length===0||this._isDisposing)return;const a=e.geometryIDs,l=r?a.transparent:a.opaque,h=t*(r?-1:1),d=l.get(h);if(d===void 0)return;const p=e.keyFragments.get(d);if(p===void 0)return;const f=this.components.get(rt);if(f.list.has(p))return;const g=r?this._baseMaterialT:this._baseMaterial,v=new Va(i,g,n.length);v.id=p,v.mesh.uuid=p,v.group=e,e.add(v.mesh),e.items.push(v),f.list.set(v.id,v),this.world.meshes.add(v.mesh),this._loadedFragments[e.uuid]||(this._loadedFragments[e.uuid]={});const b=this._loadedFragments[e.uuid];b[t]||(b[t]=[]),b[t].push(v);const w=new Map;for(let I=0;I{this.selection[this.config.hoverName]={}}),x(this,"onMouseDown",()=>{this.enabled&&(this._mouseState.down=!0)}),x(this,"onMouseUp",async t=>{const i=this.config.world;if(!i)throw new Error("No world found!");if(!i.renderer)throw new Error("This world doesn't have a renderer!");if(this.enabled&&t.target===i.renderer.three.domElement){if(this._mouseState.down=!1,this._mouseState.moved||t.button!==0){this._mouseState.moved=!1;return}if(this._mouseState.moved=!1,this.config.autoHighlightOnClick){const n=this.multiple==="none"?!0:!t[this.multiple];await this.highlight(this.config.selectName,n,this.zoomToSelection)}}}),x(this,"onMouseMove",async()=>{if(!this.enabled)return;if(this._mouseState.moved){this.clear(this.config.hoverName);return}this._mouseState.moved=this._mouseState.down;const t=this.selection[this.config.selectName];await this.highlight(this.config.hoverName,!0,!1,t)}),this.components.add(Ah.uuid,this)}async dispose(){this.setupEvents(!1),this.onBeforeUpdate.reset(),this.onAfterUpdate.reset(),this.selection={};for(const e in this.events)this.events[e].onClear.reset(),this.events[e].onHighlight.reset();this.onSetup.reset(),this.events={},this.onDisposed.trigger(Ah.uuid),this.onDisposed.reset()}add(e,t){if(this.selection[e]||this.colors.has(e))throw new Error("A selection with that name already exists!");this.colors.set(e,t),this.selection[e]={},this.events[e]={onHighlight:new ee,onClear:new ee}}async highlight(e,t=!0,i=this.zoomToSelection,n={}){if(!this.enabled)return null;if(!this.config.world)throw new Error("No world found in config!");const r=this.config.world;if(!this.selection[e])throw new Error(`Selection ${e} does not exist.`);const o=this.components.get(rt).meshes,a=this.components.get(ni).get(r).castRay(o);if(!a||!a.face)return this.clear(e),null;const l=a.object,h=l.geometry,d=a.instanceId;if(!h||d===void 0)return null;const p=l.fragment.getItemID(d);if(p===null)throw new Error("Item ID not found!");const f=l.fragment.group;if(!f)throw new Error("Fragment must belong to a FragmentsGroup!");const g=f.getFragmentMap([p]),v={};for(const b in g){const w=g[b],T=n[b];for(const S of w)(!T||!T.has(S))&&(v[b]||(v[b]=new Set),v[b].add(S))}return await this.highlightByID(e,v,t,i),{id:p,fragments:g}}async highlightByID(e,t,i=!0,n=this.zoomToSelection){if(!this.enabled)return;i&&this.clear(e);const r=this.components.get(rt),o=this.colors.get(e);if(!o)throw new Error("Color for selection not found!");for(const a in t){const l=r.list.get(a);if(!l)continue;this.selection[e][a]||(this.selection[e][a]=new Set);const h=t[a];for(const d of h)this.selection[e][a].add(d),l.setColor(o,[d])}this.events[e].onHighlight.trigger(this.selection[e]),n&&await this.zoomSelection(e)}clear(e){const t=e?[e]:Object.keys(this.selection);for(const i of t){const n=this.components.get(rt),r=this.selection[i];for(const o in this.selection[i]){const a=n.list.get(o);if(!a)continue;const l=r[o];l&&(this.backupColor?a.setColor(this.backupColor):a.resetColor(l))}this.events[i].onClear.trigger(null),this.selection[i]={}}}setup(e){this.config={...this.config,...e},this.add(this.config.selectName,this.config.selectionColor),this.add(this.config.hoverName,this.config.hoverColor),this.setupEvents(!0),this.enabled=!0,this.isSetup=!0,this.onSetup.trigger(this)}async zoomSelection(e){if(!this.config.world)throw new Error("No world found in config!");const t=this.config.world;if(!t.camera.hasCameraControls())return;const i=this.components.get(tm),n=this.components.get(rt);i.reset();const r=this.selection[e];if(!Object.keys(r).length)return;for(const b in r){const w=n.list.get(b);if(!w)continue;const T=r[b];i.addMesh(w.mesh,T)}const o=i.getSphere(),a=1/0,l=-1/0,{x:h,y:d,z:p}=o.center,f=o.radius===a||h===a||d===a||p===a,g=o.radius===l||h===l||d===l||p===l,v=o.radius===0;f||g||v||(o.radius*=this.zoomFactor,await t.camera.controls.fitToSphere(o,!0))}setupEvents(e){if(!this.config.world)throw new Error("No world found while setting up events!");if(!this.config.world.renderer)throw new Error("The given world doesn't have a renderer!");const t=this.config.world.renderer.three.domElement,i=this.events[this.config.selectName].onHighlight;i.remove(this.clearHover),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("mousemove",this.onMouseMove),e&&(i.add(this.clearHover),t.addEventListener("mousedown",this.onMouseDown),t.addEventListener("mouseup",this.onMouseUp),t.addEventListener("mousemove",this.onMouseMove))}};x(Ab,"uuid","cb8a76f2-654a-4b50-80c6-66fd83cafd77");const Sb=class qm extends Re{constructor(e){super(e),x(this,"onDisposed",new ee),x(this,"onNavigated",new ee),x(this,"onExited",new ee),x(this,"enabled",!1),x(this,"currentPlan",null),x(this,"defaultSectionOffset",1.5),x(this,"defaultCameraOffset",30),x(this,"list",[]),x(this,"world"),x(this,"_floorPlanViewCached",!1),x(this,"_previousCamera",new O),x(this,"_previousTarget",new O),x(this,"_previousProjection","Perspective"),this.components.add(qm.uuid,this)}dispose(){this.onExited.reset(),this.onNavigated.reset(),this.list=[],this.onDisposed.trigger(),this.onDisposed.reset()}async generate(e){if(!e.hasProperties)throw new Error("Properties are needed to compute plan views!");const t=await e.getAllPropertiesOfType(dl);if(!t)throw new Error("Floorplans not found!");const i=e.coordinationMatrix.elements[13],n=await Dn.getUnits(e);for(const r of Object.values(t)){const o={value:0};this.getAbsoluteFloorHeight(r.ObjectPlacement,o);const a=o.value*n+i;this.create({name:r.Name.value,id:r.GlobalId.value,normal:new O(0,-1,0),point:new O(0,a,0),ortho:!0,offset:this.defaultSectionOffset})}}create(e){if(!this.world)throw new Error("You must set a world before creating the clipping planes!");if(this.list.find(n=>n.id===e.id)){console.warn(`There's already a plan with the id: ${e.id}`);return}const t=this.createClippingPlane(e),i={...e,plane:t};this.list.push(i)}async goTo(e,t=!1){var i;((i=this.currentPlan)==null?void 0:i.id)!==e&&(this.onNavigated.trigger({id:e}),this.storeCameraPosition(),await this.hidePreviousClippingPlane(),this.updateCurrentPlan(e),await this.activateCurrentPlan(),this.enabled||(await this.moveCameraTo2DPlanPosition(t),this.enabled=!0))}async exitPlanView(e=!1){if(!this.enabled||!this.world)return;this.enabled=!1,this.onExited.trigger(),this.cacheFloorplanView();const t=this.world.camera;t.set("Orbit"),await t.projection.set(this._previousProjection),this.currentPlan&&this.currentPlan.plane&&(this.currentPlan.plane.enabled=!1,this.currentPlan.plane.edges.enabled=!1,this.currentPlan.plane.edges.visible=!1),this.currentPlan=null,await t.controls.setLookAt(this._previousCamera.x,this._previousCamera.y,this._previousCamera.z,this._previousTarget.x,this._previousTarget.y,this._previousTarget.z,e)}storeCameraPosition(){this.enabled?this.cacheFloorplanView():this.store3dCameraPosition()}createClippingPlane(e){if(!this.world)throw new Error("World is needed to create clipping planes!");const{normal:t,point:i}=e,n=i.clone();e.offset&&(n.y+=e.offset);const r=this.components.get(Ga),o=r.Type;r.Type=Gr;const a=r.createFromNormalAndCoplanarPoint(this.world,t,n);return a.edges.update(),a.visible=!1,a.enabled=!1,a.edges.enabled=!1,a.edges.visible=!1,r.Type=o,a}cacheFloorplanView(){if(!this.world)throw new Error("World is needed to create clipping planes!");this._floorPlanViewCached=!0,this.world.camera.controls.saveState()}async moveCameraTo2DPlanPosition(e){if(!this.world)throw new Error("World is needed to create clipping planes!");const t=this.world.camera;this._floorPlanViewCached?await t.controls.reset(e):await t.controls.setLookAt(0,100,0,0,0,0,e)}async activateCurrentPlan(){if(!this.world)throw new Error("World is needed to create clipping planes!");if(!this.currentPlan)throw new Error("Current plan is not defined.");const e=this.world.camera;this.currentPlan.plane&&(this.currentPlan.plane.enabled=!0,this.currentPlan.plane.edges.fillNeedsUpdate=!0,this.currentPlan.plane.edges.visible=!0),e.set("Plan");const t=this.currentPlan.ortho?"Orthographic":"Perspective";await e.projection.set(t)}store3dCameraPosition(){if(!this.world)throw new Error("World is needed to create clipping planes!");const e=this.world.camera;e.three.getWorldPosition(this._previousCamera),e.controls.getTarget(this._previousTarget),this._previousProjection=e.projection.current}updateCurrentPlan(e){const t=this.list.find(i=>i.id===e);if(!t)throw new Error("The specified plan is undefined!");this.currentPlan=t}async hidePreviousClippingPlane(){if(this.currentPlan){const e=this.currentPlan.plane;e&&(e.enabled=!1),this.currentPlan.plane instanceof Gr&&(this.currentPlan.plane.edges.visible=!1)}}getAbsoluteFloorHeight(e,t){const i=e.RelativePlacement.Location.Coordinates;t.value+=i[2].value,e.PlacementRelTo&&this.getAbsoluteFloorHeight(e.PlacementRelTo,t)}};x(Sb,"uuid","a80874aa-1c93-43a4-80f2-df346da086b1");var _b=Object.defineProperty,Rb=(s,e,t)=>e in s?_b(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Sn=(s,e,t)=>(Rb(s,typeof e!="symbol"?e+"":e,t),t);const Fs=Math.min,Pi=Math.max,Xa=Math.round,sn=s=>({x:s,y:s}),Pb={left:"right",right:"left",bottom:"top",top:"bottom"},Ob={start:"end",end:"start"};function ap(s,e,t){return Pi(s,Fs(e,t))}function ao(s,e){return typeof s=="function"?s(e):s}function Mi(s){return s.split("-")[0]}function El(s){return s.split("-")[1]}function Jm(s){return s==="x"?"y":"x"}function $m(s){return s==="y"?"height":"width"}function lo(s){return["top","bottom"].includes(Mi(s))?"y":"x"}function eg(s){return Jm(lo(s))}function Fb(s,e,t){t===void 0&&(t=!1);const i=El(s),n=eg(s),r=$m(n);let o=n==="x"?i===(t?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(o=Ka(o)),[o,Ka(o)]}function Mb(s){const e=Ka(s);return[Sh(s),e,Sh(e)]}function Sh(s){return s.replace(/start|end/g,e=>Ob[e])}function Lb(s,e,t){const i=["left","right"],n=["right","left"],r=["top","bottom"],o=["bottom","top"];switch(s){case"top":case"bottom":return t?e?n:i:e?i:n;case"left":case"right":return e?r:o;default:return[]}}function Db(s,e,t,i){const n=El(s);let r=Lb(Mi(s),t==="start",i);return n&&(r=r.map(o=>o+"-"+n),e&&(r=r.concat(r.map(Sh)))),r}function Ka(s){return s.replace(/left|right|bottom|top/g,e=>Pb[e])}function Nb(s){return{top:0,right:0,bottom:0,left:0,...s}}function tg(s){return typeof s!="number"?Nb(s):{top:s,right:s,bottom:s,left:s}}function Ms(s){const{x:e,y:t,width:i,height:n}=s;return{width:i,height:n,top:t,left:e,right:e+i,bottom:t+n,x:e,y:t}}function lp(s,e,t){let{reference:i,floating:n}=s;const r=lo(e),o=eg(e),a=$m(o),l=Mi(e),h=r==="y",d=i.x+i.width/2-n.width/2,p=i.y+i.height/2-n.height/2,f=i[a]/2-n[a]/2;let g;switch(l){case"top":g={x:d,y:i.y-n.height};break;case"bottom":g={x:d,y:i.y+i.height};break;case"right":g={x:i.x+i.width,y:p};break;case"left":g={x:i.x-n.width,y:p};break;default:g={x:i.x,y:i.y}}switch(El(e)){case"start":g[o]-=f*(t&&h?-1:1);break;case"end":g[o]+=f*(t&&h?-1:1);break}return g}const Ub=async(s,e,t)=>{const{placement:i="bottom",strategy:n="absolute",middleware:r=[],platform:o}=t,a=r.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let h=await o.getElementRects({reference:s,floating:e,strategy:n}),{x:d,y:p}=lp(h,i,l),f=i,g={},v=0;for(let b=0;b$<=0)){var W,j;const $=(((W=r.flip)==null?void 0:W.index)||0)+1,ne=P[$];if(ne)return{data:{index:$,overflows:V},reset:{placement:ne}};let oe=(j=V.filter(ve=>ve.overflows[0]<=0).sort((ve,re)=>ve.overflows[1]-re.overflows[1])[0])==null?void 0:j.placement;if(!oe)switch(g){case"bestFit":{var Q;const ve=(Q=V.map(re=>[re.placement,re.overflows.filter(ge=>ge>0).reduce((ge,me)=>ge+me,0)]).sort((re,ge)=>re[1]-ge[1])[0])==null?void 0:Q[0];ve&&(oe=ve);break}case"initialPlacement":oe=a;break}if(n!==oe)return{reset:{placement:oe}}}return{}}}};function ig(s){const e=Fs(...s.map(r=>r.left)),t=Fs(...s.map(r=>r.top)),i=Pi(...s.map(r=>r.right)),n=Pi(...s.map(r=>r.bottom));return{x:e,y:t,width:i-e,height:n-t}}function Bb(s){const e=s.slice().sort((n,r)=>n.y-r.y),t=[];let i=null;for(let n=0;ni.height/2?t.push([r]):t[t.length-1].push(r),i=r}return t.map(n=>Ms(ig(n)))}const zb=function(s){return s===void 0&&(s={}),{name:"inline",options:s,async fn(e){const{placement:t,elements:i,rects:n,platform:r,strategy:o}=e,{padding:a=2,x:l,y:h}=ao(s,e),d=Array.from(await(r.getClientRects==null?void 0:r.getClientRects(i.reference))||[]),p=Bb(d),f=Ms(ig(d)),g=tg(a);function v(){if(p.length===2&&p[0].left>p[1].right&&l!=null&&h!=null)return p.find(w=>l>w.left-g.left&&lw.top-g.top&&h=2){if(lo(t)==="y"){const j=p[0],Q=p[p.length-1],$=Mi(t)==="top",ne=j.top,oe=Q.bottom,ve=$?j.left:Q.left,re=$?j.right:Q.right,ge=re-ve,me=oe-ne;return{top:ne,bottom:oe,left:ve,right:re,width:ge,height:me,x:ve,y:ne}}const w=Mi(t)==="left",T=Pi(...p.map(j=>j.right)),S=Fs(...p.map(j=>j.left)),_=p.filter(j=>w?j.left===S:j.right===T),I=_[0].top,P=_[_.length-1].bottom,M=S,k=T,V=k-M,W=P-I;return{top:I,bottom:P,left:M,right:k,width:V,height:W,x:M,y:I}}return f}const b=await r.getElementRects({reference:{getBoundingClientRect:v},floating:i.floating,strategy:o});return n.reference.x!==b.reference.x||n.reference.y!==b.reference.y||n.reference.width!==b.reference.width||n.reference.height!==b.reference.height?{reset:{rects:b}}:{}}}};async function Vb(s,e){const{placement:t,platform:i,elements:n}=s,r=await(i.isRTL==null?void 0:i.isRTL(n.floating)),o=Mi(t),a=El(t),l=lo(t)==="y",h=["left","top"].includes(o)?-1:1,d=r&&l?-1:1,p=ao(e,s);let{mainAxis:f,crossAxis:g,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return a&&typeof v=="number"&&(g=a==="end"?v*-1:v),l?{x:g*d,y:f*h}:{x:f*h,y:g*d}}const ng=function(s){return{name:"offset",options:s,async fn(e){var t,i;const{x:n,y:r,placement:o,middlewareData:a}=e,l=await Vb(e,s);return o===((t=a.offset)==null?void 0:t.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:n+l.x,y:r+l.y,data:{...l,placement:o}}}}},Hb=function(s){return s===void 0&&(s={}),{name:"shift",options:s,async fn(e){const{x:t,y:i,placement:n}=e,{mainAxis:r=!0,crossAxis:o=!1,limiter:a={fn:w=>{let{x:T,y:S}=w;return{x:T,y:S}}},...l}=ao(s,e),h={x:t,y:i},d=await cu(e,l),p=lo(Mi(n)),f=Jm(p);let g=h[f],v=h[p];if(r){const w=f==="y"?"top":"left",T=f==="y"?"bottom":"right",S=g+d[w],_=g-d[T];g=ap(S,g,_)}if(o){const w=p==="y"?"top":"left",T=p==="y"?"bottom":"right",S=v+d[w],_=v-d[T];v=ap(S,v,_)}const b=a.fn({...e,[f]:g,[p]:v});return{...b,data:{x:b.x-t,y:b.y-i}}}}};function rn(s){return sg(s)?(s.nodeName||"").toLowerCase():"#document"}function Nt(s){var e;return(s==null||(e=s.ownerDocument)==null?void 0:e.defaultView)||window}function ln(s){var e;return(e=(sg(s)?s.ownerDocument:s.document)||window.document)==null?void 0:e.documentElement}function sg(s){return s instanceof Node||s instanceof Nt(s).Node}function Li(s){return s instanceof Element||s instanceof Nt(s).Element}function yi(s){return s instanceof HTMLElement||s instanceof Nt(s).HTMLElement}function cp(s){return typeof ShadowRoot>"u"?!1:s instanceof ShadowRoot||s instanceof Nt(s).ShadowRoot}function co(s){const{overflow:e,overflowX:t,overflowY:i,display:n}=Qt(s);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&!["inline","contents"].includes(n)}function Yb(s){return["table","td","th"].includes(rn(s))}function hu(s){const e=uu(),t=Qt(s);return t.transform!=="none"||t.perspective!=="none"||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(t.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(t.contain||"").includes(i))}function Gb(s){let e=Ls(s);for(;yi(e)&&!bl(e);){if(hu(e))return e;e=Ls(e)}return null}function uu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function bl(s){return["html","body","#document"].includes(rn(s))}function Qt(s){return Nt(s).getComputedStyle(s)}function wl(s){return Li(s)?{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}:{scrollLeft:s.pageXOffset,scrollTop:s.pageYOffset}}function Ls(s){if(rn(s)==="html")return s;const e=s.assignedSlot||s.parentNode||cp(s)&&s.host||ln(s);return cp(e)?e.host:e}function rg(s){const e=Ls(s);return bl(e)?s.ownerDocument?s.ownerDocument.body:s.body:yi(e)&&co(e)?e:rg(e)}function _h(s,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const n=rg(s),r=n===((i=s.ownerDocument)==null?void 0:i.body),o=Nt(n);return r?e.concat(o,o.visualViewport||[],co(n)?n:[],o.frameElement&&t?_h(o.frameElement):[]):e.concat(n,_h(n,[],t))}function og(s){const e=Qt(s);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const n=yi(s),r=n?s.offsetWidth:t,o=n?s.offsetHeight:i,a=Xa(t)!==r||Xa(i)!==o;return a&&(t=r,i=o),{width:t,height:i,$:a}}function ag(s){return Li(s)?s:s.contextElement}function _s(s){const e=ag(s);if(!yi(e))return sn(1);const t=e.getBoundingClientRect(),{width:i,height:n,$:r}=og(e);let o=(r?Xa(t.width):t.width)/i,a=(r?Xa(t.height):t.height)/n;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const jb=sn(0);function lg(s){const e=Nt(s);return!uu()||!e.visualViewport?jb:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Wb(s,e,t){return e===void 0&&(e=!1),!t||e&&t!==Nt(s)?!1:e}function jr(s,e,t,i){e===void 0&&(e=!1),t===void 0&&(t=!1);const n=s.getBoundingClientRect(),r=ag(s);let o=sn(1);e&&(i?Li(i)&&(o=_s(i)):o=_s(s));const a=Wb(r,t,i)?lg(r):sn(0);let l=(n.left+a.x)/o.x,h=(n.top+a.y)/o.y,d=n.width/o.x,p=n.height/o.y;if(r){const f=Nt(r),g=i&&Li(i)?Nt(i):i;let v=f,b=v.frameElement;for(;b&&i&&g!==v;){const w=_s(b),T=b.getBoundingClientRect(),S=Qt(b),_=T.left+(b.clientLeft+parseFloat(S.paddingLeft))*w.x,I=T.top+(b.clientTop+parseFloat(S.paddingTop))*w.y;l*=w.x,h*=w.y,d*=w.x,p*=w.y,l+=_,h+=I,v=Nt(b),b=v.frameElement}}return Ms({width:d,height:p,x:l,y:h})}const Xb=[":popover-open",":modal"];function cg(s){return Xb.some(e=>{try{return s.matches(e)}catch{return!1}})}function Kb(s){let{elements:e,rect:t,offsetParent:i,strategy:n}=s;const r=n==="fixed",o=ln(i),a=e?cg(e.floating):!1;if(i===o||a&&r)return t;let l={scrollLeft:0,scrollTop:0},h=sn(1);const d=sn(0),p=yi(i);if((p||!p&&!r)&&((rn(i)!=="body"||co(o))&&(l=wl(i)),yi(i))){const f=jr(i);h=_s(i),d.x=f.x+i.clientLeft,d.y=f.y+i.clientTop}return{width:t.width*h.x,height:t.height*h.y,x:t.x*h.x-l.scrollLeft*h.x+d.x,y:t.y*h.y-l.scrollTop*h.y+d.y}}function Qb(s){return Array.from(s.getClientRects())}function hg(s){return jr(ln(s)).left+wl(s).scrollLeft}function Zb(s){const e=ln(s),t=wl(s),i=s.ownerDocument.body,n=Pi(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),r=Pi(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let o=-t.scrollLeft+hg(s);const a=-t.scrollTop;return Qt(i).direction==="rtl"&&(o+=Pi(e.clientWidth,i.clientWidth)-n),{width:n,height:r,x:o,y:a}}function qb(s,e){const t=Nt(s),i=ln(s),n=t.visualViewport;let r=i.clientWidth,o=i.clientHeight,a=0,l=0;if(n){r=n.width,o=n.height;const h=uu();(!h||h&&e==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:r,height:o,x:a,y:l}}function Jb(s,e){const t=jr(s,!0,e==="fixed"),i=t.top+s.clientTop,n=t.left+s.clientLeft,r=yi(s)?_s(s):sn(1),o=s.clientWidth*r.x,a=s.clientHeight*r.y,l=n*r.x,h=i*r.y;return{width:o,height:a,x:l,y:h}}function hp(s,e,t){let i;if(e==="viewport")i=qb(s,t);else if(e==="document")i=Zb(ln(s));else if(Li(e))i=Jb(e,t);else{const n=lg(s);i={...e,x:e.x-n.x,y:e.y-n.y}}return Ms(i)}function ug(s,e){const t=Ls(s);return t===e||!Li(t)||bl(t)?!1:Qt(t).position==="fixed"||ug(t,e)}function $b(s,e){const t=e.get(s);if(t)return t;let i=_h(s,[],!1).filter(a=>Li(a)&&rn(a)!=="body"),n=null;const r=Qt(s).position==="fixed";let o=r?Ls(s):s;for(;Li(o)&&!bl(o);){const a=Qt(o),l=hu(o);!l&&a.position==="fixed"&&(n=null),(r?!l&&!n:!l&&a.position==="static"&&n&&["absolute","fixed"].includes(n.position)||co(o)&&!l&&ug(s,o))?i=i.filter(h=>h!==o):n=a,o=Ls(o)}return e.set(s,i),i}function ew(s){let{element:e,boundary:t,rootBoundary:i,strategy:n}=s;const r=[...t==="clippingAncestors"?$b(e,this._c):[].concat(t),i],o=r[0],a=r.reduce((l,h)=>{const d=hp(e,h,n);return l.top=Pi(d.top,l.top),l.right=Fs(d.right,l.right),l.bottom=Fs(d.bottom,l.bottom),l.left=Pi(d.left,l.left),l},hp(e,o,n));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function tw(s){const{width:e,height:t}=og(s);return{width:e,height:t}}function iw(s,e,t){const i=yi(e),n=ln(e),r=t==="fixed",o=jr(s,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=sn(0);if(i||!i&&!r)if((rn(e)!=="body"||co(n))&&(a=wl(e)),i){const p=jr(e,!0,r,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else n&&(l.x=hg(n));const h=o.left+a.scrollLeft-l.x,d=o.top+a.scrollTop-l.y;return{x:h,y:d,width:o.width,height:o.height}}function up(s,e){return!yi(s)||Qt(s).position==="fixed"?null:e?e(s):s.offsetParent}function dg(s,e){const t=Nt(s);if(!yi(s)||cg(s))return t;let i=up(s,e);for(;i&&Yb(i)&&Qt(i).position==="static";)i=up(i,e);return i&&(rn(i)==="html"||rn(i)==="body"&&Qt(i).position==="static"&&!hu(i))?t:i||Gb(s)||t}const nw=async function(s){const e=this.getOffsetParent||dg,t=this.getDimensions;return{reference:iw(s.reference,await e(s.floating),s.strategy),floating:{x:0,y:0,...await t(s.floating)}}};function sw(s){return Qt(s).direction==="rtl"}const rw={convertOffsetParentRelativeRectToViewportRelativeRect:Kb,getDocumentElement:ln,getClippingRect:ew,getOffsetParent:dg,getElementRects:nw,getClientRects:Qb,getDimensions:tw,getScale:_s,isElement:Li,isRTL:sw},pg=Hb,fg=kb,mg=zb,gg=(s,e,t)=>{const i=new Map,n={platform:rw,...t},r={...n.platform,_c:i};return Ub(s,e,{...n,platform:r})};/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const Na=globalThis,pu=Na.ShadowRoot&&(Na.ShadyCSS===void 0||Na.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,fu=Symbol(),pp=new WeakMap;let vg=class{constructor(s,e,t){if(this._$cssResult$=!0,t!==fu)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=s,this.t=e}get styleSheet(){let s=this.o;const e=this.t;if(pu&&s===void 0){const t=e!==void 0&&e.length===1;t&&(s=pp.get(e)),s===void 0&&((this.o=s=new CSSStyleSheet).replaceSync(this.cssText),t&&pp.set(e,s))}return s}toString(){return this.cssText}};const ow=s=>new vg(typeof s=="string"?s:s+"",void 0,fu),Be=(s,...e)=>{const t=s.length===1?s[0]:e.reduce((i,n,r)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+s[r+1],s[0]);return new vg(t,s,fu)},aw=(s,e)=>{if(pu)s.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),n=Na.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=t.cssText,s.appendChild(i)}},fp=pu?s=>s:s=>s instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return ow(t)})(s):s;/** + */const Na=globalThis,du=Na.ShadowRoot&&(Na.ShadyCSS===void 0||Na.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,pu=Symbol(),dp=new WeakMap;let vg=class{constructor(s,e,t){if(this._$cssResult$=!0,t!==pu)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=s,this.t=e}get styleSheet(){let s=this.o;const e=this.t;if(du&&s===void 0){const t=e!==void 0&&e.length===1;t&&(s=dp.get(e)),s===void 0&&((this.o=s=new CSSStyleSheet).replaceSync(this.cssText),t&&dp.set(e,s))}return s}toString(){return this.cssText}};const ow=s=>new vg(typeof s=="string"?s:s+"",void 0,pu),Be=(s,...e)=>{const t=s.length===1?s[0]:e.reduce((i,n,r)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+s[r+1],s[0]);return new vg(t,s,pu)},aw=(s,e)=>{if(du)s.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),n=Na.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=t.cssText,s.appendChild(i)}},pp=du?s=>s:s=>s instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return ow(t)})(s):s;/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const{is:lw,defineProperty:cw,getOwnPropertyDescriptor:hw,getOwnPropertyNames:uw,getOwnPropertySymbols:dw,getPrototypeOf:pw}=Object,Ds=globalThis,mp=Ds.trustedTypes,fw=mp?mp.emptyScript:"",gp=Ds.reactiveElementPolyfillSupport,Dr=(s,e)=>s,Qa={toAttribute(s,e){switch(e){case Boolean:s=s?fw:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,e){let t=s;switch(e){case Boolean:t=s!==null;break;case Number:t=s===null?null:Number(s);break;case Object:case Array:try{t=JSON.parse(s)}catch{t=null}}return t}},mu=(s,e)=>!lw(s,e),vp={attribute:!0,type:String,converter:Qa,reflect:!1,hasChanged:mu};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Ds.litPropertyMetadata??(Ds.litPropertyMetadata=new WeakMap);class Cs extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=vp){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(e,i,t);n!==void 0&&cw(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){const{get:n,set:r}=hw(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return n==null?void 0:n.call(this)},set(o){const a=n==null?void 0:n.call(this);r.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??vp}static _$Ei(){if(this.hasOwnProperty(Dr("elementProperties")))return;const e=pw(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Dr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Dr("properties"))){const t=this.properties,i=[...uw(t),...dw(t)];for(const n of i)this.createProperty(n,t[n])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,n]of t)this.elementProperties.set(i,n)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const n=this._$Eu(t,i);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const n of i)t.unshift(fp(n))}else e!==void 0&&t.push(fp(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return aw(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EC(e,t){var i;const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&n.reflect===!0){const o=(((i=n.converter)==null?void 0:i.toAttribute)!==void 0?n.converter:Qa).toAttribute(t,n.type);this._$Em=e,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(e,t){var i;const n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const o=n.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)==null?void 0:i.fromAttribute)!==void 0?o.converter:Qa;this._$Em=r,this[r]=a.fromAttribute(t,o.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??mu)(this[e],t))return;this.P(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[r,o]of n)o.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],o)}let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),(e=this._$EO)==null||e.forEach(n=>{var r;return(r=n.hostUpdate)==null?void 0:r.call(n)}),this.update(i)):this._$EU()}catch(n){throw t=!1,this._$EU(),n}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(i=>{var n;return(n=i.hostUpdated)==null?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}}Cs.elementStyles=[],Cs.shadowRootOptions={mode:"open"},Cs[Dr("elementProperties")]=new Map,Cs[Dr("finalized")]=new Map,gp==null||gp({ReactiveElement:Cs}),(Ds.reactiveElementVersions??(Ds.reactiveElementVersions=[])).push("2.0.4");/** + */const{is:lw,defineProperty:cw,getOwnPropertyDescriptor:hw,getOwnPropertyNames:uw,getOwnPropertySymbols:dw,getPrototypeOf:pw}=Object,Ds=globalThis,fp=Ds.trustedTypes,fw=fp?fp.emptyScript:"",mp=Ds.reactiveElementPolyfillSupport,Dr=(s,e)=>s,Qa={toAttribute(s,e){switch(e){case Boolean:s=s?fw:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,e){let t=s;switch(e){case Boolean:t=s!==null;break;case Number:t=s===null?null:Number(s);break;case Object:case Array:try{t=JSON.parse(s)}catch{t=null}}return t}},fu=(s,e)=>!lw(s,e),gp={attribute:!0,type:String,converter:Qa,reflect:!1,hasChanged:fu};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Ds.litPropertyMetadata??(Ds.litPropertyMetadata=new WeakMap);class Cs extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=gp){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(e,i,t);n!==void 0&&cw(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){const{get:n,set:r}=hw(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return n==null?void 0:n.call(this)},set(o){const a=n==null?void 0:n.call(this);r.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??gp}static _$Ei(){if(this.hasOwnProperty(Dr("elementProperties")))return;const e=pw(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Dr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Dr("properties"))){const t=this.properties,i=[...uw(t),...dw(t)];for(const n of i)this.createProperty(n,t[n])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,n]of t)this.elementProperties.set(i,n)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const n=this._$Eu(t,i);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const n of i)t.unshift(pp(n))}else e!==void 0&&t.push(pp(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return aw(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EC(e,t){var i;const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&n.reflect===!0){const o=(((i=n.converter)==null?void 0:i.toAttribute)!==void 0?n.converter:Qa).toAttribute(t,n.type);this._$Em=e,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(e,t){var i;const n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const o=n.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)==null?void 0:i.fromAttribute)!==void 0?o.converter:Qa;this._$Em=r,this[r]=a.fromAttribute(t,o.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??fu)(this[e],t))return;this.P(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[r,o]of n)o.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],o)}let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),(e=this._$EO)==null||e.forEach(n=>{var r;return(r=n.hostUpdate)==null?void 0:r.call(n)}),this.update(i)):this._$EU()}catch(n){throw t=!1,this._$EU(),n}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(i=>{var n;return(n=i.hostUpdated)==null?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}}Cs.elementStyles=[],Cs.shadowRootOptions={mode:"open"},Cs[Dr("elementProperties")]=new Map,Cs[Dr("finalized")]=new Map,mp==null||mp({ReactiveElement:Cs}),(Ds.reactiveElementVersions??(Ds.reactiveElementVersions=[])).push("2.0.4");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const Za=globalThis,qa=Za.trustedTypes,yp=qa?qa.createPolicy("lit-html",{createHTML:s=>s}):void 0,gu="$lit$",_i=`lit$${Math.random().toFixed(9).slice(2)}$`,vu="?"+_i,mw=`<${vu}>`,Vn=document,Wr=()=>Vn.createComment(""),Xr=s=>s===null||typeof s!="object"&&typeof s!="function",yg=Array.isArray,Eg=s=>yg(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",Vc=`[ -\f\r]`,Rr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ep=/-->/g,bp=/>/g,_n=RegExp(`>|${Vc}(?:([^\\s"'>=/]+)(${Vc}*=${Vc}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),wp=/'/g,Ip=/"/g,bg=/^(?:script|style|textarea|title)$/i,gw=s=>(e,...t)=>({_$litType$:s,strings:e,values:t}),pe=gw(1),Ns=Symbol.for("lit-noChange"),tt=Symbol.for("lit-nothing"),Cp=new WeakMap,Mn=Vn.createTreeWalker(Vn,129);function wg(s,e){if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return yp!==void 0?yp.createHTML(e):e}const Ig=(s,e)=>{const t=s.length-1,i=[];let n,r=e===2?"":"",o=Rr;for(let a=0;a"?(o=n??Rr,p=-1):d[1]===void 0?p=-2:(p=o.lastIndex-d[2].length,h=d[1],o=d[3]===void 0?_n:d[3]==='"'?Ip:wp):o===Ip||o===wp?o=_n:o===Ep||o===bp?o=Rr:(o=_n,n=void 0);const g=o===_n&&s[a+1].startsWith("/>")?" ":"";r+=o===Rr?l+mw:p>=0?(i.push(h),l.slice(0,p)+gu+l.slice(p)+_i+g):l+_i+(p===-2?a:g)}return[wg(s,r+(s[t]||"")+(e===2?"":"")),i]};class Kr{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let r=0,o=0;const a=e.length-1,l=this.parts,[h,d]=Ig(e,t);if(this.el=Kr.createElement(h,i),Mn.currentNode=this.el.content,t===2){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(n=Mn.nextNode())!==null&&l.length0){n.textContent=qa?qa.emptyScript:"";for(let g=0;g2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=tt}_$AI(e,t=this,i,n){const r=this.strings;let o=!1;if(r===void 0)e=Hn(this,e,t,0),o=!Xr(e)||e!==this._$AH&&e!==Ns,o&&(this._$AH=e);else{const a=e;let l,h;for(e=r[0],l=0;l{const i=(t==null?void 0:t.renderBefore)??e;let n=i._$litPart$;if(n===void 0){const r=(t==null?void 0:t.renderBefore)??null;i._$litPart$=n=new Gs(e.insertBefore(Wr(),r),r,void 0,t??{})}return n._$AI(s),n};/** + */const Za=globalThis,qa=Za.trustedTypes,vp=qa?qa.createPolicy("lit-html",{createHTML:s=>s}):void 0,mu="$lit$",_i=`lit$${Math.random().toFixed(9).slice(2)}$`,gu="?"+_i,mw=`<${gu}>`,Vn=document,Wr=()=>Vn.createComment(""),Xr=s=>s===null||typeof s!="object"&&typeof s!="function",yg=Array.isArray,Eg=s=>yg(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",Hc=`[ +\f\r]`,Rr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,yp=/-->/g,Ep=/>/g,_n=RegExp(`>|${Hc}(?:([^\\s"'>=/]+)(${Hc}*=${Hc}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),bp=/'/g,wp=/"/g,bg=/^(?:script|style|textarea|title)$/i,gw=s=>(e,...t)=>({_$litType$:s,strings:e,values:t}),pe=gw(1),Ns=Symbol.for("lit-noChange"),tt=Symbol.for("lit-nothing"),Ip=new WeakMap,Mn=Vn.createTreeWalker(Vn,129);function wg(s,e){if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return vp!==void 0?vp.createHTML(e):e}const Ig=(s,e)=>{const t=s.length-1,i=[];let n,r=e===2?"":"",o=Rr;for(let a=0;a"?(o=n??Rr,p=-1):d[1]===void 0?p=-2:(p=o.lastIndex-d[2].length,h=d[1],o=d[3]===void 0?_n:d[3]==='"'?wp:bp):o===wp||o===bp?o=_n:o===yp||o===Ep?o=Rr:(o=_n,n=void 0);const g=o===_n&&s[a+1].startsWith("/>")?" ":"";r+=o===Rr?l+mw:p>=0?(i.push(h),l.slice(0,p)+mu+l.slice(p)+_i+g):l+_i+(p===-2?a:g)}return[wg(s,r+(s[t]||"")+(e===2?"":"")),i]};class Kr{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let r=0,o=0;const a=e.length-1,l=this.parts,[h,d]=Ig(e,t);if(this.el=Kr.createElement(h,i),Mn.currentNode=this.el.content,t===2){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(n=Mn.nextNode())!==null&&l.length0){n.textContent=qa?qa.emptyScript:"";for(let g=0;g2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=tt}_$AI(e,t=this,i,n){const r=this.strings;let o=!1;if(r===void 0)e=Hn(this,e,t,0),o=!Xr(e)||e!==this._$AH&&e!==Ns,o&&(this._$AH=e);else{const a=e;let l,h;for(e=r[0],l=0;l{const i=(t==null?void 0:t.renderBefore)??e;let n=i._$litPart$;if(n===void 0){const r=(t==null?void 0:t.renderBefore)??null;i._$litPart$=n=new Gs(e.insertBefore(Wr(),r),r,void 0,t??{})}return n._$AI(s),n};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */let Ue=class extends Cs{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var s;const e=super.createRenderRoot();return(s=this.renderOptions).renderBefore??(s.renderBefore=e.firstChild),e}update(s){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(s),this._$Do=Ja(e,this.renderRoot,this.renderOptions)}connectedCallback(){var s;super.connectedCallback(),(s=this._$Do)==null||s.setConnected(!0)}disconnectedCallback(){var s;super.disconnectedCallback(),(s=this._$Do)==null||s.setConnected(!1)}render(){return Ns}};var xp;Ue._$litElement$=!0,Ue.finalized=!0,(xp=globalThis.litElementHydrateSupport)==null||xp.call(globalThis,{LitElement:Ue});const Ap=globalThis.litElementPolyfillSupport;Ap==null||Ap({LitElement:Ue});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.5");/** + */let Ue=class extends Cs{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var s;const e=super.createRenderRoot();return(s=this.renderOptions).renderBefore??(s.renderBefore=e.firstChild),e}update(s){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(s),this._$Do=Ja(e,this.renderRoot,this.renderOptions)}connectedCallback(){var s;super.connectedCallback(),(s=this._$Do)==null||s.setConnected(!0)}disconnectedCallback(){var s;super.disconnectedCallback(),(s=this._$Do)==null||s.setConnected(!1)}render(){return Ns}};var Tp;Ue._$litElement$=!0,Ue.finalized=!0,(Tp=globalThis.litElementHydrateSupport)==null||Tp.call(globalThis,{LitElement:Ue});const xp=globalThis.litElementPolyfillSupport;xp==null||xp({LitElement:Ue});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.5");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const yw={attribute:!0,type:String,converter:Qa,reflect:!1,hasChanged:mu},Ew=(s=yw,e,t)=>{const{kind:i,metadata:n}=t;let r=globalThis.litPropertyMetadata.get(n);if(r===void 0&&globalThis.litPropertyMetadata.set(n,r=new Map),r.set(t.name,s),i==="accessor"){const{name:o}=t;return{set(a){const l=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,l,s)},init(a){return a!==void 0&&this.P(o,void 0,s),a}}}if(i==="setter"){const{name:o}=t;return function(a){const l=this[o];e.call(this,a),this.requestUpdate(o,l,s)}}throw Error("Unsupported decorator location: "+i)};function te(s){return(e,t)=>typeof t=="object"?Ew(s,e,t):((i,n,r)=>{const o=n.hasOwnProperty(r);return n.constructor.createProperty(r,o?{...i,wrapped:!0}:i),o?Object.getOwnPropertyDescriptor(n,r):void 0})(s,e,t)}/** + */const yw={attribute:!0,type:String,converter:Qa,reflect:!1,hasChanged:fu},Ew=(s=yw,e,t)=>{const{kind:i,metadata:n}=t;let r=globalThis.litPropertyMetadata.get(n);if(r===void 0&&globalThis.litPropertyMetadata.set(n,r=new Map),r.set(t.name,s),i==="accessor"){const{name:o}=t;return{set(a){const l=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,l,s)},init(a){return a!==void 0&&this.P(o,void 0,s),a}}}if(i==="setter"){const{name:o}=t;return function(a){const l=this[o];e.call(this,a),this.requestUpdate(o,l,s)}}throw Error("Unsupported decorator location: "+i)};function te(s){return(e,t)=>typeof t=="object"?Ew(s,e,t):((i,n,r)=>{const o=n.hasOwnProperty(r);return n.constructor.createProperty(r,o?{...i,wrapped:!0}:i),o?Object.getOwnPropertyDescriptor(n,r):void 0})(s,e,t)}/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause @@ -1495,7 +1495,7 @@ void main() { * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const{I:bw}=vw,Sp=(s,e)=>(s==null?void 0:s._$litType$)!==void 0,ww=s=>{var e;return((e=s==null?void 0:s._$litType$)==null?void 0:e.h)!=null},Iw=s=>s.strings===void 0,_p=()=>document.createComment(""),Rp=(s,e,t)=>{var i;const n=s._$AA.parentNode,r=s._$AB;if(t===void 0){const o=n.insertBefore(_p(),r),a=n.insertBefore(_p(),r);t=new bw(o,a,s,s.options)}else{const o=t._$AB.nextSibling,a=t._$AM,l=a!==s;if(l){let h;(i=t._$AQ)==null||i.call(t,s),t._$AM=s,t._$AP!==void 0&&(h=s._$AU)!==a._$AU&&t._$AP(h)}if(o!==r||l){let h=t._$AA;for(;h!==o;){const d=h.nextSibling;n.insertBefore(h,r),h=d}}}return t},Cw={},Pp=(s,e=Cw)=>s._$AH=e,Fp=s=>s._$AH,Tw=s=>{s._$AR()};/** + */const{I:bw}=vw,Ap=(s,e)=>(s==null?void 0:s._$litType$)!==void 0,ww=s=>{var e;return((e=s==null?void 0:s._$litType$)==null?void 0:e.h)!=null},Iw=s=>s.strings===void 0,Sp=()=>document.createComment(""),_p=(s,e,t)=>{var i;const n=s._$AA.parentNode,r=s._$AB;if(t===void 0){const o=n.insertBefore(Sp(),r),a=n.insertBefore(Sp(),r);t=new bw(o,a,s,s.options)}else{const o=t._$AB.nextSibling,a=t._$AM,l=a!==s;if(l){let h;(i=t._$AQ)==null||i.call(t,s),t._$AM=s,t._$AP!==void 0&&(h=s._$AU)!==a._$AU&&t._$AP(h)}if(o!==r||l){let h=t._$AA;for(;h!==o;){const d=h.nextSibling;n.insertBefore(h,r),h=d}}}return t},Cw={},Rp=(s,e=Cw)=>s._$AH=e,Pp=s=>s._$AH,Tw=s=>{s._$AR()};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause @@ -1507,7 +1507,7 @@ void main() { * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const en=()=>new Pw;let Pw=class{};const Hc=new WeakMap,Ut=_g(class extends Rw{render(s){return tt}update(s,[e]){var t;const i=e!==this.Y;return i&&this.Y!==void 0&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.Y=e,this.ht=(t=s.options)==null?void 0:t.host,this.rt(this.ct=s.element)),tt}rt(s){if(typeof this.Y=="function"){const e=this.ht??globalThis;let t=Hc.get(e);t===void 0&&(t=new WeakMap,Hc.set(e,t)),t.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),t.set(this.Y,s),s!==void 0&&this.Y.call(this.ht,s)}else this.Y.value=s}get lt(){var s,e;return typeof this.Y=="function"?(s=Hc.get(this.ht??globalThis))==null?void 0:s.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});/** + */const en=()=>new Pw;let Pw=class{};const Yc=new WeakMap,Ut=_g(class extends Rw{render(s){return tt}update(s,[e]){var t;const i=e!==this.Y;return i&&this.Y!==void 0&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.Y=e,this.ht=(t=s.options)==null?void 0:t.host,this.rt(this.ct=s.element)),tt}rt(s){if(typeof this.Y=="function"){const e=this.ht??globalThis;let t=Yc.get(e);t===void 0&&(t=new WeakMap,Yc.set(e,t)),t.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),t.set(this.Y,s),s!==void 0&&this.Y.call(this.ht,s)}else this.Y.value=s}get lt(){var s,e;return typeof this.Y=="function"?(s=Yc.get(this.ht??globalThis))==null?void 0:s.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});/** * (c) Iconify * * For the full copyright and license information, please view the license.txt @@ -1517,7 +1517,7 @@ void main() { * * @license MIT * @version 2.0.0 -*/const Fg=Object.freeze({left:0,top:0,width:16,height:16}),el=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),po=Object.freeze({...Fg,...el}),_h=Object.freeze({...po,body:"",hidden:!1}),Fw=Object.freeze({width:null,height:null}),Og=Object.freeze({...Fw,...el});function Ow(s,e=0){const t=s.replace(/^-?[0-9.]*/,"");function i(n){for(;n<0;)n+=4;return n%4}if(t===""){const n=parseInt(s);return isNaN(n)?0:i(n)}else if(t!==s){let n=0;switch(t){case"%":n=25;break;case"deg":n=90}if(n){let r=parseFloat(s.slice(0,s.length-t.length));return isNaN(r)?0:(r=r/n,r%1===0?i(r):0)}}return e}const Mw=/[\s,]+/;function Lw(s,e){e.split(Mw).forEach(t=>{switch(t.trim()){case"horizontal":s.hFlip=!0;break;case"vertical":s.vFlip=!0;break}})}const Mg={...Og,preserveAspectRatio:""};function Op(s){const e={...Mg},t=(i,n)=>s.getAttribute(i)||n;return e.width=t("width",null),e.height=t("height",null),e.rotate=Ow(t("rotate","")),Lw(e,t("flip","")),e.preserveAspectRatio=t("preserveAspectRatio",t("preserveaspectratio","")),e}function Dw(s,e){for(const t in Mg)if(s[t]!==e[t])return!0;return!1}const Ur=/^[a-z0-9]+(-[a-z0-9]+)*$/,fo=(s,e,t,i="")=>{const n=s.split(":");if(s.slice(0,1)==="@"){if(n.length<2||n.length>3)return null;i=n.shift().slice(1)}if(n.length>3||!n.length)return null;if(n.length>1){const a=n.pop(),l=n.pop(),h={provider:n.length>0?n[0]:i,prefix:l,name:a};return e&&!Ua(h)?null:h}const r=n[0],o=r.split("-");if(o.length>1){const a={provider:i,prefix:o.shift(),name:o.join("-")};return e&&!Ua(a)?null:a}if(t&&i===""){const a={provider:i,prefix:"",name:r};return e&&!Ua(a,t)?null:a}return null},Ua=(s,e)=>s?!!((s.provider===""||s.provider.match(Ur))&&(e&&s.prefix===""||s.prefix.match(Ur))&&s.name.match(Ur)):!1;function Nw(s,e){const t={};!s.hFlip!=!e.hFlip&&(t.hFlip=!0),!s.vFlip!=!e.vFlip&&(t.vFlip=!0);const i=((s.rotate||0)+(e.rotate||0))%4;return i&&(t.rotate=i),t}function Mp(s,e){const t=Nw(s,e);for(const i in _h)i in el?i in s&&!(i in t)&&(t[i]=el[i]):i in e?t[i]=e[i]:i in s&&(t[i]=s[i]);return t}function Uw(s,e){const t=s.icons,i=s.aliases||Object.create(null),n=Object.create(null);function r(o){if(t[o])return n[o]=[];if(!(o in n)){n[o]=null;const a=i[o]&&i[o].parent,l=a&&r(a);l&&(n[o]=[a].concat(l))}return n[o]}return Object.keys(t).concat(Object.keys(i)).forEach(r),n}function kw(s,e,t){const i=s.icons,n=s.aliases||Object.create(null);let r={};function o(a){r=Mp(i[a]||n[a],r)}return o(e),t.forEach(o),Mp(s,r)}function Lg(s,e){const t=[];if(typeof s!="object"||typeof s.icons!="object")return t;s.not_found instanceof Array&&s.not_found.forEach(n=>{e(n,null),t.push(n)});const i=Uw(s);for(const n in i){const r=i[n];r&&(e(n,kw(s,n,r)),t.push(n))}return t}const Bw={provider:"",aliases:{},not_found:{},...Fg};function Yc(s,e){for(const t in e)if(t in s&&typeof s[t]!=typeof e[t])return!1;return!0}function Dg(s){if(typeof s!="object"||s===null)return null;const e=s;if(typeof e.prefix!="string"||!s.icons||typeof s.icons!="object"||!Yc(s,Bw))return null;const t=e.icons;for(const n in t){const r=t[n];if(!n.match(Ur)||typeof r.body!="string"||!Yc(r,_h))return null}const i=e.aliases||Object.create(null);for(const n in i){const r=i[n],o=r.parent;if(!n.match(Ur)||typeof o!="string"||!t[o]&&!i[o]||!Yc(r,_h))return null}return e}const tl=Object.create(null);function zw(s,e){return{provider:s,prefix:e,icons:Object.create(null),missing:new Set}}function on(s,e){const t=tl[s]||(tl[s]=Object.create(null));return t[e]||(t[e]=zw(s,e))}function yu(s,e){return Dg(e)?Lg(e,(t,i)=>{i?s.icons[t]=i:s.missing.add(t)}):[]}function Vw(s,e,t){try{if(typeof t.body=="string")return s.icons[e]={...t},!0}catch{}return!1}function Hw(s,e){let t=[];return(typeof s=="string"?[s]:Object.keys(tl)).forEach(i=>{(typeof i=="string"&&typeof e=="string"?[e]:Object.keys(tl[i]||{})).forEach(n=>{const r=on(i,n);t=t.concat(Object.keys(r.icons).map(o=>(i!==""?"@"+i+":":"")+n+":"+o))})}),t}let Qr=!1;function Ng(s){return typeof s=="boolean"&&(Qr=s),Qr}function Zr(s){const e=typeof s=="string"?fo(s,!0,Qr):s;if(e){const t=on(e.provider,e.prefix),i=e.name;return t.icons[i]||(t.missing.has(i)?null:void 0)}}function Ug(s,e){const t=fo(s,!0,Qr);if(!t)return!1;const i=on(t.provider,t.prefix);return Vw(i,t.name,e)}function Lp(s,e){if(typeof s!="object")return!1;if(typeof e!="string"&&(e=s.provider||""),Qr&&!e&&!s.prefix){let n=!1;return Dg(s)&&(s.prefix="",Lg(s,(r,o)=>{o&&Ug(r,o)&&(n=!0)})),n}const t=s.prefix;if(!Ua({provider:e,prefix:t,name:"a"}))return!1;const i=on(e,t);return!!yu(i,s)}function Dp(s){return!!Zr(s)}function Yw(s){const e=Zr(s);return e?{...po,...e}:null}function Gw(s){const e={loaded:[],missing:[],pending:[]},t=Object.create(null);s.sort((n,r)=>n.provider!==r.provider?n.provider.localeCompare(r.provider):n.prefix!==r.prefix?n.prefix.localeCompare(r.prefix):n.name.localeCompare(r.name));let i={provider:"",prefix:"",name:""};return s.forEach(n=>{if(i.name===n.name&&i.prefix===n.prefix&&i.provider===n.provider)return;i=n;const r=n.provider,o=n.prefix,a=n.name,l=t[r]||(t[r]=Object.create(null)),h=l[o]||(l[o]=on(r,o));let d;a in h.icons?d=e.loaded:o===""||h.missing.has(a)?d=e.missing:d=e.pending;const p={provider:r,prefix:o,name:a};d.push(p)}),e}function kg(s,e){s.forEach(t=>{const i=t.loaderCallbacks;i&&(t.loaderCallbacks=i.filter(n=>n.id!==e))})}function jw(s){s.pendingCallbacksFlag||(s.pendingCallbacksFlag=!0,setTimeout(()=>{s.pendingCallbacksFlag=!1;const e=s.loaderCallbacks?s.loaderCallbacks.slice(0):[];if(!e.length)return;let t=!1;const i=s.provider,n=s.prefix;e.forEach(r=>{const o=r.icons,a=o.pending.length;o.pending=o.pending.filter(l=>{if(l.prefix!==n)return!0;const h=l.name;if(s.icons[h])o.loaded.push({provider:i,prefix:n,name:h});else if(s.missing.has(h))o.missing.push({provider:i,prefix:n,name:h});else return t=!0,!0;return!1}),o.pending.length!==a&&(t||kg([s],r.id),r.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),r.abort))})}))}let Ww=0;function Xw(s,e,t){const i=Ww++,n=kg.bind(null,t,i);if(!e.pending.length)return n;const r={id:i,icons:e,callback:s,abort:n};return t.forEach(o=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(r)}),n}const Rh=Object.create(null);function Np(s,e){Rh[s]=e}function Ph(s){return Rh[s]||Rh[""]}function Kw(s,e=!0,t=!1){const i=[];return s.forEach(n=>{const r=typeof n=="string"?fo(n,e,t):n;r&&i.push(r)}),i}var Qw={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Zw(s,e,t,i){const n=s.resources.length,r=s.random?Math.floor(Math.random()*n):s.index;let o;if(s.random){let M=s.resources.slice(0);for(o=[];M.length>1;){const k=Math.floor(Math.random()*M.length);o.push(M[k]),M=M.slice(0,k).concat(M.slice(k+1))}o=o.concat(M)}else o=s.resources.slice(r).concat(s.resources.slice(0,r));const a=Date.now();let l="pending",h=0,d,p=null,f=[],g=[];typeof i=="function"&&g.push(i);function y(){p&&(clearTimeout(p),p=null)}function b(){l==="pending"&&(l="aborted"),y(),f.forEach(M=>{M.status==="pending"&&(M.status="aborted")}),f=[]}function w(M,k){k&&(g=[]),typeof M=="function"&&g.push(M)}function T(){return{startTime:a,payload:e,status:l,queriesSent:h,queriesPending:f.length,subscribe:w,abort:b}}function S(){l="failed",g.forEach(M=>{M(void 0,d)})}function _(){f.forEach(M=>{M.status==="pending"&&(M.status="aborted")}),f=[]}function I(M,k,V){const W=k!=="success";switch(f=f.filter(j=>j!==M),l){case"pending":break;case"failed":if(W||!s.dataAfterTimeout)return;break;default:return}if(k==="abort"){d=V,S();return}if(W){d=V,f.length||(o.length?P():S());return}if(y(),_(),!s.random){const j=s.resources.indexOf(M.resource);j!==-1&&j!==s.index&&(s.index=j)}l="completed",g.forEach(j=>{j(V)})}function P(){if(l!=="pending")return;y();const M=o.shift();if(M===void 0){if(f.length){p=setTimeout(()=>{y(),l==="pending"&&(_(),S())},s.timeout);return}S();return}const k={status:"pending",resource:M,callback:(V,W)=>{I(k,V,W)}};f.push(k),h++,p=setTimeout(P,s.rotate),t(M,e,k.callback)}return setTimeout(P),T}function Bg(s){const e={...Qw,...s};let t=[];function i(){t=t.filter(o=>o().status==="pending")}function n(o,a,l){const h=Zw(e,o,a,(d,p)=>{i(),l&&l(d,p)});return t.push(h),h}function r(o){return t.find(a=>o(a))||null}return{query:n,find:r,setIndex:o=>{e.index=o},getIndex:()=>e.index,cleanup:i}}function Eu(s){let e;if(typeof s.resources=="string")e=[s.resources];else if(e=s.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:s.path||"/",maxURL:s.maxURL||500,rotate:s.rotate||750,timeout:s.timeout||5e3,random:s.random===!0,index:s.index||0,dataAfterTimeout:s.dataAfterTimeout!==!1}}const wl=Object.create(null),Sa=["https://api.simplesvg.com","https://api.unisvg.com"],Fh=[];for(;Sa.length>0;)Sa.length===1||Math.random()>.5?Fh.push(Sa.shift()):Fh.push(Sa.pop());wl[""]=Eu({resources:["https://api.iconify.design"].concat(Fh)});function Up(s,e){const t=Eu(e);return t===null?!1:(wl[s]=t,!0)}function Il(s){return wl[s]}function qw(){return Object.keys(wl)}function kp(){}const Gc=Object.create(null);function Jw(s){if(!Gc[s]){const e=Il(s);if(!e)return;const t=Bg(e),i={config:e,redundancy:t};Gc[s]=i}return Gc[s]}function zg(s,e,t){let i,n;if(typeof s=="string"){const r=Ph(s);if(!r)return t(void 0,424),kp;n=r.send;const o=Jw(s);o&&(i=o.redundancy)}else{const r=Eu(s);if(r){i=Bg(r);const o=s.resources?s.resources[0]:"",a=Ph(o);a&&(n=a.send)}}return!i||!n?(t(void 0,424),kp):i.query(e,n,t)().abort}const Bp="iconify2",qr="iconify",Vg=qr+"-count",zp=qr+"-version",Hg=36e5,$w=168,eI=50;function Oh(s,e){try{return s.getItem(e)}catch{}}function bu(s,e,t){try{return s.setItem(e,t),!0}catch{}}function Vp(s,e){try{s.removeItem(e)}catch{}}function Mh(s,e){return bu(s,Vg,e.toString())}function Lh(s){return parseInt(Oh(s,Vg))||0}const Un={local:!0,session:!0},Yg={local:new Set,session:new Set};let wu=!1;function tI(s){wu=s}let _a=typeof window>"u"?{}:window;function Gg(s){const e=s+"Storage";try{if(_a&&_a[e]&&typeof _a[e].length=="number")return _a[e]}catch{}Un[s]=!1}function jg(s,e){const t=Gg(s);if(!t)return;const i=Oh(t,zp);if(i!==Bp){if(i){const a=Lh(t);for(let l=0;l{const l=qr+a.toString(),h=Oh(t,l);if(typeof h=="string"){try{const d=JSON.parse(h);if(typeof d=="object"&&typeof d.cached=="number"&&d.cached>n&&typeof d.provider=="string"&&typeof d.data=="object"&&typeof d.data.prefix=="string"&&e(d,a))return!0}catch{}Vp(t,l)}};let o=Lh(t);for(let a=o-1;a>=0;a--)r(a)||(a===o-1?(o--,Mh(t,o)):Yg[s].add(a))}function Wg(){if(!wu){tI(!0);for(const s in Un)jg(s,e=>{const t=e.data,i=e.provider,n=t.prefix,r=on(i,n);if(!yu(r,t).length)return!1;const o=t.lastModified||-1;return r.lastModifiedCached=r.lastModifiedCached?Math.min(r.lastModifiedCached,o):o,!0})}}function iI(s,e){const t=s.lastModifiedCached;if(t&&t>=e)return t===e;if(s.lastModifiedCached=e,t)for(const i in Un)jg(i,n=>{const r=n.data;return n.provider!==s.provider||r.prefix!==s.prefix||r.lastModified===e});return!0}function nI(s,e){wu||Wg();function t(i){let n;if(!Un[i]||!(n=Gg(i)))return;const r=Yg[i];let o;if(r.size)r.delete(o=Array.from(r).shift());else if(o=Lh(n),o>=eI||!Mh(n,o+1))return;const a={cached:Math.floor(Date.now()/Hg),provider:s.provider,data:e};return bu(n,qr+o.toString(),JSON.stringify(a))}e.lastModified&&!iI(s,e.lastModified)||Object.keys(e.icons).length&&(e.not_found&&(e=Object.assign({},e),delete e.not_found),t("local")||t("session"))}function Hp(){}function sI(s){s.iconsLoaderFlag||(s.iconsLoaderFlag=!0,setTimeout(()=>{s.iconsLoaderFlag=!1,jw(s)}))}function rI(s,e){s.iconsToLoad?s.iconsToLoad=s.iconsToLoad.concat(e).sort():s.iconsToLoad=e,s.iconsQueueFlag||(s.iconsQueueFlag=!0,setTimeout(()=>{s.iconsQueueFlag=!1;const{provider:t,prefix:i}=s,n=s.iconsToLoad;delete s.iconsToLoad;let r;!n||!(r=Ph(t))||r.prepare(t,i,n).forEach(o=>{zg(t,o,a=>{if(typeof a!="object")o.icons.forEach(l=>{s.missing.add(l)});else try{const l=yu(s,a);if(!l.length)return;const h=s.pendingIcons;h&&l.forEach(d=>{h.delete(d)}),nI(s,a)}catch(l){console.error(l)}sI(s)})})}))}const Iu=(s,e)=>{const t=Kw(s,!0,Ng()),i=Gw(t);if(!i.pending.length){let l=!0;return e&&setTimeout(()=>{l&&e(i.loaded,i.missing,i.pending,Hp)}),()=>{l=!1}}const n=Object.create(null),r=[];let o,a;return i.pending.forEach(l=>{const{provider:h,prefix:d}=l;if(d===a&&h===o)return;o=h,a=d,r.push(on(h,d));const p=n[h]||(n[h]=Object.create(null));p[d]||(p[d]=[])}),i.pending.forEach(l=>{const{provider:h,prefix:d,name:p}=l,f=on(h,d),g=f.pendingIcons||(f.pendingIcons=new Set);g.has(p)||(g.add(p),n[h][d].push(p))}),r.forEach(l=>{const{provider:h,prefix:d}=l;n[h][d].length&&rI(l,n[h][d])}),e?Xw(e,i,r):Hp},oI=s=>new Promise((e,t)=>{const i=typeof s=="string"?fo(s,!0):s;if(!i){t(s);return}Iu([i||s],n=>{if(n.length&&i){const r=Zr(i);if(r){e({...po,...r});return}}t(s)})});function aI(s){try{const e=typeof s=="string"?JSON.parse(s):s;if(typeof e.body=="string")return{...e}}catch{}}function lI(s,e){const t=typeof s=="string"?fo(s,!0,!0):null;if(!t){const r=aI(s);return{value:s,data:r}}const i=Zr(t);if(i!==void 0||!t.prefix)return{value:s,name:t,data:i};const n=Iu([t],()=>e(s,t,Zr(t)));return{value:s,name:t,loading:n}}function jc(s){return s.hasAttribute("inline")}let Xg=!1;try{Xg=navigator.vendor.indexOf("Apple")===0}catch{}function cI(s,e){switch(e){case"svg":case"bg":case"mask":return e}return e!=="style"&&(Xg||s.indexOf("=0;){const n=s.indexOf(">",i),r=s.indexOf("",r);if(o===-1)break;t+=s.slice(n+1,r).trim(),s=s.slice(0,i).trim()+s.slice(o+1)}return{defs:t,content:s}}function pI(s,e){return s?""+s+""+e:e}function fI(s,e,t){const i=dI(s);return pI(i.defs,e+i.content+t)}const mI=s=>s==="unset"||s==="undefined"||s==="none";function Kg(s,e){const t={...po,...s},i={...Og,...e},n={left:t.left,top:t.top,width:t.width,height:t.height};let r=t.body;[t,i].forEach(b=>{const w=[],T=b.hFlip,S=b.vFlip;let _=b.rotate;T?S?_+=2:(w.push("translate("+(n.width+n.left).toString()+" "+(0-n.top).toString()+")"),w.push("scale(-1 1)"),n.top=n.left=0):S&&(w.push("translate("+(0-n.left).toString()+" "+(n.height+n.top).toString()+")"),w.push("scale(1 -1)"),n.top=n.left=0);let I;switch(_<0&&(_-=Math.floor(_/4)*4),_=_%4,_){case 1:I=n.height/2+n.top,w.unshift("rotate(90 "+I.toString()+" "+I.toString()+")");break;case 2:w.unshift("rotate(180 "+(n.width/2+n.left).toString()+" "+(n.height/2+n.top).toString()+")");break;case 3:I=n.width/2+n.left,w.unshift("rotate(-90 "+I.toString()+" "+I.toString()+")");break}_%2===1&&(n.left!==n.top&&(I=n.left,n.left=n.top,n.top=I),n.width!==n.height&&(I=n.width,n.width=n.height,n.height=I)),w.length&&(r=fI(r,'',""))});const o=i.width,a=i.height,l=n.width,h=n.height;let d,p;o===null?(p=a===null?"1em":a==="auto"?h:a,d=Dh(p,l/h)):(d=o==="auto"?l:o,p=a===null?Dh(d,h/l):a==="auto"?h:a);const f={},g=(b,w)=>{mI(w)||(f[b]=w.toString())};g("width",d),g("height",p);const y=[n.left,n.top,l,h];return f.viewBox=y.join(" "),{attributes:f,viewBox:y,body:r}}function Cu(s,e){let t=s.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in e)t+=" "+i+'="'+e[i]+'"';return'"+s+""}function gI(s){return s.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function vI(s){return"data:image/svg+xml,"+gI(s)}function Qg(s){return'url("'+vI(s)+'")'}const yI=()=>{let s;try{if(s=fetch,typeof s=="function")return s}catch{}};let il=yI();function EI(s){il=s}function bI(){return il}function wI(s,e){const t=Il(s);if(!t)return 0;let i;if(!t.maxURL)i=0;else{let n=0;t.resources.forEach(o=>{n=Math.max(n,o.length)});const r=e+".json?icons=";i=t.maxURL-n-t.path.length-r.length}return i}function II(s){return s===404}const CI=(s,e,t)=>{const i=[],n=wI(s,e),r="icons";let o={type:r,provider:s,prefix:e,icons:[]},a=0;return t.forEach((l,h)=>{a+=l.length+1,a>=n&&h>0&&(i.push(o),o={type:r,provider:s,prefix:e,icons:[]},a=l.length),o.icons.push(l)}),i.push(o),i};function TI(s){if(typeof s=="string"){const e=Il(s);if(e)return e.path}return"/"}const xI=(s,e,t)=>{if(!il){t("abort",424);return}let i=TI(e.provider);switch(e.type){case"icons":{const r=e.prefix,o=e.icons.join(","),a=new URLSearchParams({icons:o});i+=r+".json?"+a.toString();break}case"custom":{const r=e.uri;i+=r.slice(0,1)==="/"?r.slice(1):r;break}default:t("abort",400);return}let n=503;il(s+i).then(r=>{const o=r.status;if(o!==200){setTimeout(()=>{t(II(o)?"abort":"next",o)});return}return n=501,r.json()}).then(r=>{if(typeof r!="object"||r===null){setTimeout(()=>{r===404?t("abort",r):t("next",n)});return}setTimeout(()=>{t("success",r)})}).catch(()=>{t("next",n)})},AI={prepare:CI,send:xI};function Yp(s,e){switch(s){case"local":case"session":Un[s]=e;break;case"all":for(const t in Un)Un[t]=e;break}}const Wc="data-style";let Zg="";function SI(s){Zg=s}function Gp(s,e){let t=Array.from(s.childNodes).find(i=>i.hasAttribute&&i.hasAttribute(Wc));t||(t=document.createElement("style"),t.setAttribute(Wc,Wc),s.appendChild(t)),t.textContent=":host{display:inline-block;vertical-align:"+(e?"-0.125em":"0")+"}span,svg{display:block}"+Zg}function qg(){Np("",AI),Ng(!0);let s;try{s=window}catch{}if(s){if(Wg(),s.IconifyPreload!==void 0){const e=s.IconifyPreload,t="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!Lp(i))&&console.error(t)}catch{console.error(t)}})}if(s.IconifyProviders!==void 0){const e=s.IconifyProviders;if(typeof e=="object"&&e!==null)for(const t in e){const i="IconifyProviders["+t+"] is invalid.";try{const n=e[t];if(typeof n!="object"||!n||n.resources===void 0)continue;Up(t,n)||console.error(i)}catch{console.error(i)}}}}return{enableCache:e=>Yp(e,!0),disableCache:e=>Yp(e,!1),iconLoaded:Dp,iconExists:Dp,getIcon:Yw,listIcons:Hw,addIcon:Ug,addCollection:Lp,calculateSize:Dh,buildIcon:Kg,iconToHTML:Cu,svgToURL:Qg,loadIcons:Iu,loadIcon:oI,addAPIProvider:Up,appendCustomStyle:SI,_api:{getAPIConfig:Il,setAPIModule:Np,sendAPIQuery:zg,setFetch:EI,getFetch:bI,listAPIProviders:qw}}}const Nh={"background-color":"currentColor"},Jg={"background-color":"transparent"},jp={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Wp={"-webkit-mask":Nh,mask:Nh,background:Jg};for(const s in Wp){const e=Wp[s];for(const t in jp)e[s+"-"+t]=jp[t]}function Xp(s){return s?s+(s.match(/^[-0-9.]+$/)?"px":""):"inherit"}function _I(s,e,t){const i=document.createElement("span");let n=s.body;n.indexOf("");const r=s.attributes,o=Cu(n,{...r,width:e.width+"",height:e.height+""}),a=Qg(o),l=i.style,h={"--svg":a,width:Xp(r.width),height:Xp(r.height),...t?Nh:Jg};for(const d in h)l.setProperty(d,h[d]);return i}let kr;function RI(){try{kr=window.trustedTypes.createPolicy("iconify",{createHTML:s=>s})}catch{kr=null}}function PI(s){return kr===void 0&&RI(),kr?kr.createHTML(s):s}function FI(s){const e=document.createElement("span"),t=s.attributes;let i="";t.width||(i="width: inherit;"),t.height||(i+="height: inherit;"),i&&(t.style=i);const n=Cu(s.body,t);return e.innerHTML=PI(n),e.firstChild}function Uh(s){return Array.from(s.childNodes).find(e=>{const t=e.tagName&&e.tagName.toUpperCase();return t==="SPAN"||t==="SVG"})}function Kp(s,e){const t=e.icon.data,i=e.customisations,n=Kg(t,i);i.preserveAspectRatio&&(n.attributes.preserveAspectRatio=i.preserveAspectRatio);const r=e.renderedMode;let o;switch(r){case"svg":o=FI(n);break;default:o=_I(n,{...po,...t},r==="mask")}const a=Uh(s);a?o.tagName==="SPAN"&&a.tagName===o.tagName?a.setAttribute("style",o.getAttribute("style")):s.replaceChild(o,a):s.appendChild(o)}function Qp(s,e,t){const i=t&&(t.rendered?t:t.lastRender);return{rendered:!1,inline:e,icon:s,lastRender:i}}function OI(s="iconify-icon"){let e,t;try{e=window.customElements,t=window.HTMLElement}catch{return}if(!e||!t)return;const i=e.get(s);if(i)return i;const n=["icon","mode","inline","observe","width","height","rotate","flip"],r=class extends t{constructor(){super(),Sn(this,"_shadowRoot"),Sn(this,"_initialised",!1),Sn(this,"_state"),Sn(this,"_checkQueued",!1),Sn(this,"_connected",!1),Sn(this,"_observer",null),Sn(this,"_visible",!0);const a=this._shadowRoot=this.attachShadow({mode:"open"}),l=jc(this);Gp(a,l),this._state=Qp({value:""},l),this._queueCheck()}connectedCallback(){this._connected=!0,this.startObserver()}disconnectedCallback(){this._connected=!1,this.stopObserver()}static get observedAttributes(){return n.slice(0)}attributeChangedCallback(a){switch(a){case"inline":{const l=jc(this),h=this._state;l!==h.inline&&(h.inline=l,Gp(this._shadowRoot,l));break}case"observer":{this.observer?this.startObserver():this.stopObserver();break}default:this._queueCheck()}}get icon(){const a=this.getAttribute("icon");if(a&&a.slice(0,1)==="{")try{return JSON.parse(a)}catch{}return a}set icon(a){typeof a=="object"&&(a=JSON.stringify(a)),this.setAttribute("icon",a)}get inline(){return jc(this)}set inline(a){a?this.setAttribute("inline","true"):this.removeAttribute("inline")}get observer(){return this.hasAttribute("observer")}set observer(a){a?this.setAttribute("observer","true"):this.removeAttribute("observer")}restartAnimation(){const a=this._state;if(a.rendered){const l=this._shadowRoot;if(a.renderedMode==="svg")try{l.lastChild.setCurrentTime(0);return}catch{}Kp(l,a)}}get status(){const a=this._state;return a.rendered?"rendered":a.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const a=this._state,l=this.getAttribute("icon");if(l!==a.icon.value){this._iconChanged(l);return}if(!a.rendered||!this._visible)return;const h=this.getAttribute("mode"),d=Op(this);(a.attrMode!==h||Dw(a.customisations,d)||!Uh(this._shadowRoot))&&this._renderIcon(a.icon,d,h)}_iconChanged(a){const l=lI(a,(h,d,p)=>{const f=this._state;if(f.rendered||this.getAttribute("icon")!==h)return;const g={value:h,name:d,data:p};g.data?this._gotIconData(g):f.icon=g});l.data?this._gotIconData(l):this._state=Qp(l,this._state.inline,this._state)}_forceRender(){if(!this._visible){const a=Uh(this._shadowRoot);a&&this._shadowRoot.removeChild(a);return}this._queueCheck()}_gotIconData(a){this._checkQueued=!1,this._renderIcon(a,Op(this),this.getAttribute("mode"))}_renderIcon(a,l,h){const d=cI(a.data.body,h),p=this._state.inline;Kp(this._shadowRoot,this._state={rendered:!0,icon:a,inline:p,customisations:l,attrMode:h,renderedMode:d})}startObserver(){if(!this._observer)try{this._observer=new IntersectionObserver(a=>{const l=a.some(h=>h.isIntersecting);l!==this._visible&&(this._visible=l,this._forceRender())}),this._observer.observe(this)}catch{if(this._observer){try{this._observer.disconnect()}catch{}this._observer=null}}}stopObserver(){this._observer&&(this._observer.disconnect(),this._observer=null,this._visible=!0,this._connected&&this._forceRender())}};n.forEach(a=>{a in r.prototype||Object.defineProperty(r.prototype,a,{get:function(){return this.getAttribute(a)},set:function(l){l!==null?this.setAttribute(a,l):this.removeAttribute(a)}})});const o=qg();for(const a in o)r[a]=r.prototype[a]=o[a];return e.define(s,r),r}OI()||qg();var MI=Object.defineProperty,Ei=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=o(e,t,n)||n);return n&&MI(e,t,n),n},Ra;const ri=(Ra=class extends Ue{constructor(){super(),this.labelHidden=!1,this.active=!1,this.disabled=!1,this.vertical=!1,this.tooltipVisible=!1,this._parent=en(),this._tooltip=en(),this._contextMenu=en(),this._mouseLeave=!1,this.onWindowMouseUp=s=>{const{value:e}=this._contextMenu;!this.contains(s.target)&&e&&(e.visible=!1)},this.mouseLeave=!0,this.addEventListener("click",s=>s.stopPropagation())}set mouseLeave(s){this._mouseLeave=s,s&&(this.tooltipVisible=!1,clearTimeout(this.timeoutID))}get mouseLeave(){return this._mouseLeave}computeTooltipPosition(){const{value:s}=this._parent,{value:e}=this._tooltip;s&&e&&gg(s,e,{placement:"bottom",middleware:[ng(10),mg(),fg(),pg({padding:5})]}).then(t=>{const{x:i,y:n}=t;Object.assign(e.style,{left:`${i}px`,top:`${n}px`})})}onMouseEnter(){if(!(this.tooltipTitle||this.tooltipText))return;this.mouseLeave=!1;const s=this.tooltipTime??700;this.timeoutID=setTimeout(()=>{this.mouseLeave||(this.computeTooltipPosition(),this.tooltipVisible=!0)},s)}onChildrenClick(s){s.stopPropagation();const{value:e}=this._contextMenu;e&&(e.visible=!e.visible)}onSlotChange(s){const{value:e}=this._contextMenu,t=s.target.assignedElements();for(const i of t){if(!(i instanceof Ra)){i.remove(),console.warn("Only bim-button is allowed inside bim-button. Child has been removed.");continue}i.addEventListener("click",()=>e==null?void 0:e.updatePosition())}this.requestUpdate()}connectedCallback(){super.connectedCallback(),window.addEventListener("mouseup",this.onWindowMouseUp)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mouseup",this.onWindowMouseUp)}render(){const s=pe` +*/const Og=Object.freeze({left:0,top:0,width:16,height:16}),el=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),po=Object.freeze({...Og,...el}),Rh=Object.freeze({...po,body:"",hidden:!1}),Ow=Object.freeze({width:null,height:null}),Fg=Object.freeze({...Ow,...el});function Fw(s,e=0){const t=s.replace(/^-?[0-9.]*/,"");function i(n){for(;n<0;)n+=4;return n%4}if(t===""){const n=parseInt(s);return isNaN(n)?0:i(n)}else if(t!==s){let n=0;switch(t){case"%":n=25;break;case"deg":n=90}if(n){let r=parseFloat(s.slice(0,s.length-t.length));return isNaN(r)?0:(r=r/n,r%1===0?i(r):0)}}return e}const Mw=/[\s,]+/;function Lw(s,e){e.split(Mw).forEach(t=>{switch(t.trim()){case"horizontal":s.hFlip=!0;break;case"vertical":s.vFlip=!0;break}})}const Mg={...Fg,preserveAspectRatio:""};function Op(s){const e={...Mg},t=(i,n)=>s.getAttribute(i)||n;return e.width=t("width",null),e.height=t("height",null),e.rotate=Fw(t("rotate","")),Lw(e,t("flip","")),e.preserveAspectRatio=t("preserveAspectRatio",t("preserveaspectratio","")),e}function Dw(s,e){for(const t in Mg)if(s[t]!==e[t])return!0;return!1}const Ur=/^[a-z0-9]+(-[a-z0-9]+)*$/,fo=(s,e,t,i="")=>{const n=s.split(":");if(s.slice(0,1)==="@"){if(n.length<2||n.length>3)return null;i=n.shift().slice(1)}if(n.length>3||!n.length)return null;if(n.length>1){const a=n.pop(),l=n.pop(),h={provider:n.length>0?n[0]:i,prefix:l,name:a};return e&&!Ua(h)?null:h}const r=n[0],o=r.split("-");if(o.length>1){const a={provider:i,prefix:o.shift(),name:o.join("-")};return e&&!Ua(a)?null:a}if(t&&i===""){const a={provider:i,prefix:"",name:r};return e&&!Ua(a,t)?null:a}return null},Ua=(s,e)=>s?!!((s.provider===""||s.provider.match(Ur))&&(e&&s.prefix===""||s.prefix.match(Ur))&&s.name.match(Ur)):!1;function Nw(s,e){const t={};!s.hFlip!=!e.hFlip&&(t.hFlip=!0),!s.vFlip!=!e.vFlip&&(t.vFlip=!0);const i=((s.rotate||0)+(e.rotate||0))%4;return i&&(t.rotate=i),t}function Fp(s,e){const t=Nw(s,e);for(const i in Rh)i in el?i in s&&!(i in t)&&(t[i]=el[i]):i in e?t[i]=e[i]:i in s&&(t[i]=s[i]);return t}function Uw(s,e){const t=s.icons,i=s.aliases||Object.create(null),n=Object.create(null);function r(o){if(t[o])return n[o]=[];if(!(o in n)){n[o]=null;const a=i[o]&&i[o].parent,l=a&&r(a);l&&(n[o]=[a].concat(l))}return n[o]}return Object.keys(t).concat(Object.keys(i)).forEach(r),n}function kw(s,e,t){const i=s.icons,n=s.aliases||Object.create(null);let r={};function o(a){r=Fp(i[a]||n[a],r)}return o(e),t.forEach(o),Fp(s,r)}function Lg(s,e){const t=[];if(typeof s!="object"||typeof s.icons!="object")return t;s.not_found instanceof Array&&s.not_found.forEach(n=>{e(n,null),t.push(n)});const i=Uw(s);for(const n in i){const r=i[n];r&&(e(n,kw(s,n,r)),t.push(n))}return t}const Bw={provider:"",aliases:{},not_found:{},...Og};function Gc(s,e){for(const t in e)if(t in s&&typeof s[t]!=typeof e[t])return!1;return!0}function Dg(s){if(typeof s!="object"||s===null)return null;const e=s;if(typeof e.prefix!="string"||!s.icons||typeof s.icons!="object"||!Gc(s,Bw))return null;const t=e.icons;for(const n in t){const r=t[n];if(!n.match(Ur)||typeof r.body!="string"||!Gc(r,Rh))return null}const i=e.aliases||Object.create(null);for(const n in i){const r=i[n],o=r.parent;if(!n.match(Ur)||typeof o!="string"||!t[o]&&!i[o]||!Gc(r,Rh))return null}return e}const tl=Object.create(null);function zw(s,e){return{provider:s,prefix:e,icons:Object.create(null),missing:new Set}}function on(s,e){const t=tl[s]||(tl[s]=Object.create(null));return t[e]||(t[e]=zw(s,e))}function vu(s,e){return Dg(e)?Lg(e,(t,i)=>{i?s.icons[t]=i:s.missing.add(t)}):[]}function Vw(s,e,t){try{if(typeof t.body=="string")return s.icons[e]={...t},!0}catch{}return!1}function Hw(s,e){let t=[];return(typeof s=="string"?[s]:Object.keys(tl)).forEach(i=>{(typeof i=="string"&&typeof e=="string"?[e]:Object.keys(tl[i]||{})).forEach(n=>{const r=on(i,n);t=t.concat(Object.keys(r.icons).map(o=>(i!==""?"@"+i+":":"")+n+":"+o))})}),t}let Qr=!1;function Ng(s){return typeof s=="boolean"&&(Qr=s),Qr}function Zr(s){const e=typeof s=="string"?fo(s,!0,Qr):s;if(e){const t=on(e.provider,e.prefix),i=e.name;return t.icons[i]||(t.missing.has(i)?null:void 0)}}function Ug(s,e){const t=fo(s,!0,Qr);if(!t)return!1;const i=on(t.provider,t.prefix);return Vw(i,t.name,e)}function Mp(s,e){if(typeof s!="object")return!1;if(typeof e!="string"&&(e=s.provider||""),Qr&&!e&&!s.prefix){let n=!1;return Dg(s)&&(s.prefix="",Lg(s,(r,o)=>{o&&Ug(r,o)&&(n=!0)})),n}const t=s.prefix;if(!Ua({provider:e,prefix:t,name:"a"}))return!1;const i=on(e,t);return!!vu(i,s)}function Lp(s){return!!Zr(s)}function Yw(s){const e=Zr(s);return e?{...po,...e}:null}function Gw(s){const e={loaded:[],missing:[],pending:[]},t=Object.create(null);s.sort((n,r)=>n.provider!==r.provider?n.provider.localeCompare(r.provider):n.prefix!==r.prefix?n.prefix.localeCompare(r.prefix):n.name.localeCompare(r.name));let i={provider:"",prefix:"",name:""};return s.forEach(n=>{if(i.name===n.name&&i.prefix===n.prefix&&i.provider===n.provider)return;i=n;const r=n.provider,o=n.prefix,a=n.name,l=t[r]||(t[r]=Object.create(null)),h=l[o]||(l[o]=on(r,o));let d;a in h.icons?d=e.loaded:o===""||h.missing.has(a)?d=e.missing:d=e.pending;const p={provider:r,prefix:o,name:a};d.push(p)}),e}function kg(s,e){s.forEach(t=>{const i=t.loaderCallbacks;i&&(t.loaderCallbacks=i.filter(n=>n.id!==e))})}function jw(s){s.pendingCallbacksFlag||(s.pendingCallbacksFlag=!0,setTimeout(()=>{s.pendingCallbacksFlag=!1;const e=s.loaderCallbacks?s.loaderCallbacks.slice(0):[];if(!e.length)return;let t=!1;const i=s.provider,n=s.prefix;e.forEach(r=>{const o=r.icons,a=o.pending.length;o.pending=o.pending.filter(l=>{if(l.prefix!==n)return!0;const h=l.name;if(s.icons[h])o.loaded.push({provider:i,prefix:n,name:h});else if(s.missing.has(h))o.missing.push({provider:i,prefix:n,name:h});else return t=!0,!0;return!1}),o.pending.length!==a&&(t||kg([s],r.id),r.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),r.abort))})}))}let Ww=0;function Xw(s,e,t){const i=Ww++,n=kg.bind(null,t,i);if(!e.pending.length)return n;const r={id:i,icons:e,callback:s,abort:n};return t.forEach(o=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(r)}),n}const Ph=Object.create(null);function Dp(s,e){Ph[s]=e}function Oh(s){return Ph[s]||Ph[""]}function Kw(s,e=!0,t=!1){const i=[];return s.forEach(n=>{const r=typeof n=="string"?fo(n,e,t):n;r&&i.push(r)}),i}var Qw={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Zw(s,e,t,i){const n=s.resources.length,r=s.random?Math.floor(Math.random()*n):s.index;let o;if(s.random){let M=s.resources.slice(0);for(o=[];M.length>1;){const k=Math.floor(Math.random()*M.length);o.push(M[k]),M=M.slice(0,k).concat(M.slice(k+1))}o=o.concat(M)}else o=s.resources.slice(r).concat(s.resources.slice(0,r));const a=Date.now();let l="pending",h=0,d,p=null,f=[],g=[];typeof i=="function"&&g.push(i);function v(){p&&(clearTimeout(p),p=null)}function b(){l==="pending"&&(l="aborted"),v(),f.forEach(M=>{M.status==="pending"&&(M.status="aborted")}),f=[]}function w(M,k){k&&(g=[]),typeof M=="function"&&g.push(M)}function T(){return{startTime:a,payload:e,status:l,queriesSent:h,queriesPending:f.length,subscribe:w,abort:b}}function S(){l="failed",g.forEach(M=>{M(void 0,d)})}function _(){f.forEach(M=>{M.status==="pending"&&(M.status="aborted")}),f=[]}function I(M,k,V){const W=k!=="success";switch(f=f.filter(j=>j!==M),l){case"pending":break;case"failed":if(W||!s.dataAfterTimeout)return;break;default:return}if(k==="abort"){d=V,S();return}if(W){d=V,f.length||(o.length?P():S());return}if(v(),_(),!s.random){const j=s.resources.indexOf(M.resource);j!==-1&&j!==s.index&&(s.index=j)}l="completed",g.forEach(j=>{j(V)})}function P(){if(l!=="pending")return;v();const M=o.shift();if(M===void 0){if(f.length){p=setTimeout(()=>{v(),l==="pending"&&(_(),S())},s.timeout);return}S();return}const k={status:"pending",resource:M,callback:(V,W)=>{I(k,V,W)}};f.push(k),h++,p=setTimeout(P,s.rotate),t(M,e,k.callback)}return setTimeout(P),T}function Bg(s){const e={...Qw,...s};let t=[];function i(){t=t.filter(o=>o().status==="pending")}function n(o,a,l){const h=Zw(e,o,a,(d,p)=>{i(),l&&l(d,p)});return t.push(h),h}function r(o){return t.find(a=>o(a))||null}return{query:n,find:r,setIndex:o=>{e.index=o},getIndex:()=>e.index,cleanup:i}}function yu(s){let e;if(typeof s.resources=="string")e=[s.resources];else if(e=s.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:s.path||"/",maxURL:s.maxURL||500,rotate:s.rotate||750,timeout:s.timeout||5e3,random:s.random===!0,index:s.index||0,dataAfterTimeout:s.dataAfterTimeout!==!1}}const Il=Object.create(null),Sa=["https://api.simplesvg.com","https://api.unisvg.com"],Fh=[];for(;Sa.length>0;)Sa.length===1||Math.random()>.5?Fh.push(Sa.shift()):Fh.push(Sa.pop());Il[""]=yu({resources:["https://api.iconify.design"].concat(Fh)});function Np(s,e){const t=yu(e);return t===null?!1:(Il[s]=t,!0)}function Cl(s){return Il[s]}function qw(){return Object.keys(Il)}function Up(){}const jc=Object.create(null);function Jw(s){if(!jc[s]){const e=Cl(s);if(!e)return;const t=Bg(e),i={config:e,redundancy:t};jc[s]=i}return jc[s]}function zg(s,e,t){let i,n;if(typeof s=="string"){const r=Oh(s);if(!r)return t(void 0,424),Up;n=r.send;const o=Jw(s);o&&(i=o.redundancy)}else{const r=yu(s);if(r){i=Bg(r);const o=s.resources?s.resources[0]:"",a=Oh(o);a&&(n=a.send)}}return!i||!n?(t(void 0,424),Up):i.query(e,n,t)().abort}const kp="iconify2",qr="iconify",Vg=qr+"-count",Bp=qr+"-version",Hg=36e5,$w=168,eI=50;function Mh(s,e){try{return s.getItem(e)}catch{}}function Eu(s,e,t){try{return s.setItem(e,t),!0}catch{}}function zp(s,e){try{s.removeItem(e)}catch{}}function Lh(s,e){return Eu(s,Vg,e.toString())}function Dh(s){return parseInt(Mh(s,Vg))||0}const Un={local:!0,session:!0},Yg={local:new Set,session:new Set};let bu=!1;function tI(s){bu=s}let _a=typeof window>"u"?{}:window;function Gg(s){const e=s+"Storage";try{if(_a&&_a[e]&&typeof _a[e].length=="number")return _a[e]}catch{}Un[s]=!1}function jg(s,e){const t=Gg(s);if(!t)return;const i=Mh(t,Bp);if(i!==kp){if(i){const a=Dh(t);for(let l=0;l{const l=qr+a.toString(),h=Mh(t,l);if(typeof h=="string"){try{const d=JSON.parse(h);if(typeof d=="object"&&typeof d.cached=="number"&&d.cached>n&&typeof d.provider=="string"&&typeof d.data=="object"&&typeof d.data.prefix=="string"&&e(d,a))return!0}catch{}zp(t,l)}};let o=Dh(t);for(let a=o-1;a>=0;a--)r(a)||(a===o-1?(o--,Lh(t,o)):Yg[s].add(a))}function Wg(){if(!bu){tI(!0);for(const s in Un)jg(s,e=>{const t=e.data,i=e.provider,n=t.prefix,r=on(i,n);if(!vu(r,t).length)return!1;const o=t.lastModified||-1;return r.lastModifiedCached=r.lastModifiedCached?Math.min(r.lastModifiedCached,o):o,!0})}}function iI(s,e){const t=s.lastModifiedCached;if(t&&t>=e)return t===e;if(s.lastModifiedCached=e,t)for(const i in Un)jg(i,n=>{const r=n.data;return n.provider!==s.provider||r.prefix!==s.prefix||r.lastModified===e});return!0}function nI(s,e){bu||Wg();function t(i){let n;if(!Un[i]||!(n=Gg(i)))return;const r=Yg[i];let o;if(r.size)r.delete(o=Array.from(r).shift());else if(o=Dh(n),o>=eI||!Lh(n,o+1))return;const a={cached:Math.floor(Date.now()/Hg),provider:s.provider,data:e};return Eu(n,qr+o.toString(),JSON.stringify(a))}e.lastModified&&!iI(s,e.lastModified)||Object.keys(e.icons).length&&(e.not_found&&(e=Object.assign({},e),delete e.not_found),t("local")||t("session"))}function Vp(){}function sI(s){s.iconsLoaderFlag||(s.iconsLoaderFlag=!0,setTimeout(()=>{s.iconsLoaderFlag=!1,jw(s)}))}function rI(s,e){s.iconsToLoad?s.iconsToLoad=s.iconsToLoad.concat(e).sort():s.iconsToLoad=e,s.iconsQueueFlag||(s.iconsQueueFlag=!0,setTimeout(()=>{s.iconsQueueFlag=!1;const{provider:t,prefix:i}=s,n=s.iconsToLoad;delete s.iconsToLoad;let r;!n||!(r=Oh(t))||r.prepare(t,i,n).forEach(o=>{zg(t,o,a=>{if(typeof a!="object")o.icons.forEach(l=>{s.missing.add(l)});else try{const l=vu(s,a);if(!l.length)return;const h=s.pendingIcons;h&&l.forEach(d=>{h.delete(d)}),nI(s,a)}catch(l){console.error(l)}sI(s)})})}))}const wu=(s,e)=>{const t=Kw(s,!0,Ng()),i=Gw(t);if(!i.pending.length){let l=!0;return e&&setTimeout(()=>{l&&e(i.loaded,i.missing,i.pending,Vp)}),()=>{l=!1}}const n=Object.create(null),r=[];let o,a;return i.pending.forEach(l=>{const{provider:h,prefix:d}=l;if(d===a&&h===o)return;o=h,a=d,r.push(on(h,d));const p=n[h]||(n[h]=Object.create(null));p[d]||(p[d]=[])}),i.pending.forEach(l=>{const{provider:h,prefix:d,name:p}=l,f=on(h,d),g=f.pendingIcons||(f.pendingIcons=new Set);g.has(p)||(g.add(p),n[h][d].push(p))}),r.forEach(l=>{const{provider:h,prefix:d}=l;n[h][d].length&&rI(l,n[h][d])}),e?Xw(e,i,r):Vp},oI=s=>new Promise((e,t)=>{const i=typeof s=="string"?fo(s,!0):s;if(!i){t(s);return}wu([i||s],n=>{if(n.length&&i){const r=Zr(i);if(r){e({...po,...r});return}}t(s)})});function aI(s){try{const e=typeof s=="string"?JSON.parse(s):s;if(typeof e.body=="string")return{...e}}catch{}}function lI(s,e){const t=typeof s=="string"?fo(s,!0,!0):null;if(!t){const r=aI(s);return{value:s,data:r}}const i=Zr(t);if(i!==void 0||!t.prefix)return{value:s,name:t,data:i};const n=wu([t],()=>e(s,t,Zr(t)));return{value:s,name:t,loading:n}}function Wc(s){return s.hasAttribute("inline")}let Xg=!1;try{Xg=navigator.vendor.indexOf("Apple")===0}catch{}function cI(s,e){switch(e){case"svg":case"bg":case"mask":return e}return e!=="style"&&(Xg||s.indexOf("=0;){const n=s.indexOf(">",i),r=s.indexOf("",r);if(o===-1)break;t+=s.slice(n+1,r).trim(),s=s.slice(0,i).trim()+s.slice(o+1)}return{defs:t,content:s}}function pI(s,e){return s?""+s+""+e:e}function fI(s,e,t){const i=dI(s);return pI(i.defs,e+i.content+t)}const mI=s=>s==="unset"||s==="undefined"||s==="none";function Kg(s,e){const t={...po,...s},i={...Fg,...e},n={left:t.left,top:t.top,width:t.width,height:t.height};let r=t.body;[t,i].forEach(b=>{const w=[],T=b.hFlip,S=b.vFlip;let _=b.rotate;T?S?_+=2:(w.push("translate("+(n.width+n.left).toString()+" "+(0-n.top).toString()+")"),w.push("scale(-1 1)"),n.top=n.left=0):S&&(w.push("translate("+(0-n.left).toString()+" "+(n.height+n.top).toString()+")"),w.push("scale(1 -1)"),n.top=n.left=0);let I;switch(_<0&&(_-=Math.floor(_/4)*4),_=_%4,_){case 1:I=n.height/2+n.top,w.unshift("rotate(90 "+I.toString()+" "+I.toString()+")");break;case 2:w.unshift("rotate(180 "+(n.width/2+n.left).toString()+" "+(n.height/2+n.top).toString()+")");break;case 3:I=n.width/2+n.left,w.unshift("rotate(-90 "+I.toString()+" "+I.toString()+")");break}_%2===1&&(n.left!==n.top&&(I=n.left,n.left=n.top,n.top=I),n.width!==n.height&&(I=n.width,n.width=n.height,n.height=I)),w.length&&(r=fI(r,'',""))});const o=i.width,a=i.height,l=n.width,h=n.height;let d,p;o===null?(p=a===null?"1em":a==="auto"?h:a,d=Nh(p,l/h)):(d=o==="auto"?l:o,p=a===null?Nh(d,h/l):a==="auto"?h:a);const f={},g=(b,w)=>{mI(w)||(f[b]=w.toString())};g("width",d),g("height",p);const v=[n.left,n.top,l,h];return f.viewBox=v.join(" "),{attributes:f,viewBox:v,body:r}}function Iu(s,e){let t=s.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in e)t+=" "+i+'="'+e[i]+'"';return'"+s+""}function gI(s){return s.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function vI(s){return"data:image/svg+xml,"+gI(s)}function Qg(s){return'url("'+vI(s)+'")'}const yI=()=>{let s;try{if(s=fetch,typeof s=="function")return s}catch{}};let il=yI();function EI(s){il=s}function bI(){return il}function wI(s,e){const t=Cl(s);if(!t)return 0;let i;if(!t.maxURL)i=0;else{let n=0;t.resources.forEach(o=>{n=Math.max(n,o.length)});const r=e+".json?icons=";i=t.maxURL-n-t.path.length-r.length}return i}function II(s){return s===404}const CI=(s,e,t)=>{const i=[],n=wI(s,e),r="icons";let o={type:r,provider:s,prefix:e,icons:[]},a=0;return t.forEach((l,h)=>{a+=l.length+1,a>=n&&h>0&&(i.push(o),o={type:r,provider:s,prefix:e,icons:[]},a=l.length),o.icons.push(l)}),i.push(o),i};function TI(s){if(typeof s=="string"){const e=Cl(s);if(e)return e.path}return"/"}const xI=(s,e,t)=>{if(!il){t("abort",424);return}let i=TI(e.provider);switch(e.type){case"icons":{const r=e.prefix,o=e.icons.join(","),a=new URLSearchParams({icons:o});i+=r+".json?"+a.toString();break}case"custom":{const r=e.uri;i+=r.slice(0,1)==="/"?r.slice(1):r;break}default:t("abort",400);return}let n=503;il(s+i).then(r=>{const o=r.status;if(o!==200){setTimeout(()=>{t(II(o)?"abort":"next",o)});return}return n=501,r.json()}).then(r=>{if(typeof r!="object"||r===null){setTimeout(()=>{r===404?t("abort",r):t("next",n)});return}setTimeout(()=>{t("success",r)})}).catch(()=>{t("next",n)})},AI={prepare:CI,send:xI};function Hp(s,e){switch(s){case"local":case"session":Un[s]=e;break;case"all":for(const t in Un)Un[t]=e;break}}const Xc="data-style";let Zg="";function SI(s){Zg=s}function Yp(s,e){let t=Array.from(s.childNodes).find(i=>i.hasAttribute&&i.hasAttribute(Xc));t||(t=document.createElement("style"),t.setAttribute(Xc,Xc),s.appendChild(t)),t.textContent=":host{display:inline-block;vertical-align:"+(e?"-0.125em":"0")+"}span,svg{display:block}"+Zg}function qg(){Dp("",AI),Ng(!0);let s;try{s=window}catch{}if(s){if(Wg(),s.IconifyPreload!==void 0){const e=s.IconifyPreload,t="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!Mp(i))&&console.error(t)}catch{console.error(t)}})}if(s.IconifyProviders!==void 0){const e=s.IconifyProviders;if(typeof e=="object"&&e!==null)for(const t in e){const i="IconifyProviders["+t+"] is invalid.";try{const n=e[t];if(typeof n!="object"||!n||n.resources===void 0)continue;Np(t,n)||console.error(i)}catch{console.error(i)}}}}return{enableCache:e=>Hp(e,!0),disableCache:e=>Hp(e,!1),iconLoaded:Lp,iconExists:Lp,getIcon:Yw,listIcons:Hw,addIcon:Ug,addCollection:Mp,calculateSize:Nh,buildIcon:Kg,iconToHTML:Iu,svgToURL:Qg,loadIcons:wu,loadIcon:oI,addAPIProvider:Np,appendCustomStyle:SI,_api:{getAPIConfig:Cl,setAPIModule:Dp,sendAPIQuery:zg,setFetch:EI,getFetch:bI,listAPIProviders:qw}}}const Uh={"background-color":"currentColor"},Jg={"background-color":"transparent"},Gp={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},jp={"-webkit-mask":Uh,mask:Uh,background:Jg};for(const s in jp){const e=jp[s];for(const t in Gp)e[s+"-"+t]=Gp[t]}function Wp(s){return s?s+(s.match(/^[-0-9.]+$/)?"px":""):"inherit"}function _I(s,e,t){const i=document.createElement("span");let n=s.body;n.indexOf("");const r=s.attributes,o=Iu(n,{...r,width:e.width+"",height:e.height+""}),a=Qg(o),l=i.style,h={"--svg":a,width:Wp(r.width),height:Wp(r.height),...t?Uh:Jg};for(const d in h)l.setProperty(d,h[d]);return i}let kr;function RI(){try{kr=window.trustedTypes.createPolicy("iconify",{createHTML:s=>s})}catch{kr=null}}function PI(s){return kr===void 0&&RI(),kr?kr.createHTML(s):s}function OI(s){const e=document.createElement("span"),t=s.attributes;let i="";t.width||(i="width: inherit;"),t.height||(i+="height: inherit;"),i&&(t.style=i);const n=Iu(s.body,t);return e.innerHTML=PI(n),e.firstChild}function kh(s){return Array.from(s.childNodes).find(e=>{const t=e.tagName&&e.tagName.toUpperCase();return t==="SPAN"||t==="SVG"})}function Xp(s,e){const t=e.icon.data,i=e.customisations,n=Kg(t,i);i.preserveAspectRatio&&(n.attributes.preserveAspectRatio=i.preserveAspectRatio);const r=e.renderedMode;let o;switch(r){case"svg":o=OI(n);break;default:o=_I(n,{...po,...t},r==="mask")}const a=kh(s);a?o.tagName==="SPAN"&&a.tagName===o.tagName?a.setAttribute("style",o.getAttribute("style")):s.replaceChild(o,a):s.appendChild(o)}function Kp(s,e,t){const i=t&&(t.rendered?t:t.lastRender);return{rendered:!1,inline:e,icon:s,lastRender:i}}function FI(s="iconify-icon"){let e,t;try{e=window.customElements,t=window.HTMLElement}catch{return}if(!e||!t)return;const i=e.get(s);if(i)return i;const n=["icon","mode","inline","observe","width","height","rotate","flip"],r=class extends t{constructor(){super(),Sn(this,"_shadowRoot"),Sn(this,"_initialised",!1),Sn(this,"_state"),Sn(this,"_checkQueued",!1),Sn(this,"_connected",!1),Sn(this,"_observer",null),Sn(this,"_visible",!0);const a=this._shadowRoot=this.attachShadow({mode:"open"}),l=Wc(this);Yp(a,l),this._state=Kp({value:""},l),this._queueCheck()}connectedCallback(){this._connected=!0,this.startObserver()}disconnectedCallback(){this._connected=!1,this.stopObserver()}static get observedAttributes(){return n.slice(0)}attributeChangedCallback(a){switch(a){case"inline":{const l=Wc(this),h=this._state;l!==h.inline&&(h.inline=l,Yp(this._shadowRoot,l));break}case"observer":{this.observer?this.startObserver():this.stopObserver();break}default:this._queueCheck()}}get icon(){const a=this.getAttribute("icon");if(a&&a.slice(0,1)==="{")try{return JSON.parse(a)}catch{}return a}set icon(a){typeof a=="object"&&(a=JSON.stringify(a)),this.setAttribute("icon",a)}get inline(){return Wc(this)}set inline(a){a?this.setAttribute("inline","true"):this.removeAttribute("inline")}get observer(){return this.hasAttribute("observer")}set observer(a){a?this.setAttribute("observer","true"):this.removeAttribute("observer")}restartAnimation(){const a=this._state;if(a.rendered){const l=this._shadowRoot;if(a.renderedMode==="svg")try{l.lastChild.setCurrentTime(0);return}catch{}Xp(l,a)}}get status(){const a=this._state;return a.rendered?"rendered":a.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const a=this._state,l=this.getAttribute("icon");if(l!==a.icon.value){this._iconChanged(l);return}if(!a.rendered||!this._visible)return;const h=this.getAttribute("mode"),d=Op(this);(a.attrMode!==h||Dw(a.customisations,d)||!kh(this._shadowRoot))&&this._renderIcon(a.icon,d,h)}_iconChanged(a){const l=lI(a,(h,d,p)=>{const f=this._state;if(f.rendered||this.getAttribute("icon")!==h)return;const g={value:h,name:d,data:p};g.data?this._gotIconData(g):f.icon=g});l.data?this._gotIconData(l):this._state=Kp(l,this._state.inline,this._state)}_forceRender(){if(!this._visible){const a=kh(this._shadowRoot);a&&this._shadowRoot.removeChild(a);return}this._queueCheck()}_gotIconData(a){this._checkQueued=!1,this._renderIcon(a,Op(this),this.getAttribute("mode"))}_renderIcon(a,l,h){const d=cI(a.data.body,h),p=this._state.inline;Xp(this._shadowRoot,this._state={rendered:!0,icon:a,inline:p,customisations:l,attrMode:h,renderedMode:d})}startObserver(){if(!this._observer)try{this._observer=new IntersectionObserver(a=>{const l=a.some(h=>h.isIntersecting);l!==this._visible&&(this._visible=l,this._forceRender())}),this._observer.observe(this)}catch{if(this._observer){try{this._observer.disconnect()}catch{}this._observer=null}}}stopObserver(){this._observer&&(this._observer.disconnect(),this._observer=null,this._visible=!0,this._connected&&this._forceRender())}};n.forEach(a=>{a in r.prototype||Object.defineProperty(r.prototype,a,{get:function(){return this.getAttribute(a)},set:function(l){l!==null?this.setAttribute(a,l):this.removeAttribute(a)}})});const o=qg();for(const a in o)r[a]=r.prototype[a]=o[a];return e.define(s,r),r}FI()||qg();var MI=Object.defineProperty,Ei=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=o(e,t,n)||n);return n&&MI(e,t,n),n},Ra;const ri=(Ra=class extends Ue{constructor(){super(),this.labelHidden=!1,this.active=!1,this.disabled=!1,this.vertical=!1,this.tooltipVisible=!1,this._parent=en(),this._tooltip=en(),this._contextMenu=en(),this._mouseLeave=!1,this.onWindowMouseUp=s=>{const{value:e}=this._contextMenu;!this.contains(s.target)&&e&&(e.visible=!1)},this.mouseLeave=!0,this.addEventListener("click",s=>s.stopPropagation())}set mouseLeave(s){this._mouseLeave=s,s&&(this.tooltipVisible=!1,clearTimeout(this.timeoutID))}get mouseLeave(){return this._mouseLeave}computeTooltipPosition(){const{value:s}=this._parent,{value:e}=this._tooltip;s&&e&&gg(s,e,{placement:"bottom",middleware:[ng(10),mg(),fg(),pg({padding:5})]}).then(t=>{const{x:i,y:n}=t;Object.assign(e.style,{left:`${i}px`,top:`${n}px`})})}onMouseEnter(){if(!(this.tooltipTitle||this.tooltipText))return;this.mouseLeave=!1;const s=this.tooltipTime??700;this.timeoutID=setTimeout(()=>{this.mouseLeave||(this.computeTooltipPosition(),this.tooltipVisible=!0)},s)}onChildrenClick(s){s.stopPropagation();const{value:e}=this._contextMenu;e&&(e.visible=!e.visible)}onSlotChange(s){const{value:e}=this._contextMenu,t=s.target.assignedElements();for(const i of t){if(!(i instanceof Ra)){i.remove(),console.warn("Only bim-button is allowed inside bim-button. Child has been removed.");continue}i.addEventListener("click",()=>e==null?void 0:e.updatePosition())}this.requestUpdate()}connectedCallback(){super.connectedCallback(),window.addEventListener("mouseup",this.onWindowMouseUp)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mouseup",this.onWindowMouseUp)}render(){const s=pe`
${this.tooltipTitle?pe`

${this.tooltipTitle} @@ -1948,7 +1948,7 @@ void main() { bim-grid[floating] bim-toolbars-container { background-color: transparent; } -`,Qn={scrollbar:UI,globalStyles:kI};var BI=Object.defineProperty,zI=Object.getOwnPropertyDescriptor,VI=(s,e,t,i)=>{for(var n=zI(e,t),r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=o(e,t,n)||n);return n&&BI(e,t,n),n};const t0=class extends Ue{constructor(){super(...arguments),this._visible=!1,this._middleware={name:"middleware",async fn(s){const{right:e,top:t}=await hu(s);return s.x-=Math.sign(e)===1?e+5:0,s.y-=Math.sign(t)===1?t+5:0,s}}}get visible(){return this._visible}set visible(s){this._visible=s,s&&this.updatePosition()}async updatePosition(s){const e=s||this.parentNode;if(!e){this.visible=!1,console.warn("No target element found for context-menu.");return}const t=await gg(e,this,{placement:"right",middleware:[ng(10),mg(),fg(),pg({padding:5}),this._middleware]}),{x:i,y:n}=t;this.style.left=`${i}px`,this.style.top=`${n}px`}render(){return pe` `}};t0.styles=[Qn.scrollbar,Be` +`,Qn={scrollbar:UI,globalStyles:kI};var BI=Object.defineProperty,zI=Object.getOwnPropertyDescriptor,VI=(s,e,t,i)=>{for(var n=zI(e,t),r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=o(e,t,n)||n);return n&&BI(e,t,n),n};const t0=class extends Ue{constructor(){super(...arguments),this._visible=!1,this._middleware={name:"middleware",async fn(s){const{right:e,top:t}=await cu(s);return s.x-=Math.sign(e)===1?e+5:0,s.y-=Math.sign(t)===1?t+5:0,s}}}get visible(){return this._visible}set visible(s){this._visible=s,s&&this.updatePosition()}async updatePosition(s){const e=s||this.parentNode;if(!e){this.visible=!1,console.warn("No target element found for context-menu.");return}const t=await gg(e,this,{placement:"right",middleware:[ng(10),mg(),fg(),pg({padding:5}),this._middleware]}),{x:i,y:n}=t;this.style.left=`${i}px`,this.style.top=`${n}px`}render(){return pe` `}};t0.styles=[Qn.scrollbar,Be` :host { --bim-label--fz: var(--bim-ui_size-xs); position: absolute; @@ -1975,7 +1975,7 @@ void main() { :host(:not([visible])) { display: none; } - `];let i0=t0;VI([te({type:Boolean,reflect:!0})],i0.prototype,"visible");class Zn extends Ue{constructor(){super(...arguments),this._lazyLoadObserver=null,this._visibleElements=[],this.ELEMENTS_BEFORE_OBSERVER=20,this.useObserver=!1,this.elements=new Set,this.observe=e=>{if(!this.useObserver)return;for(const i of e)this.elements.add(i);const t=e.slice(this.ELEMENTS_BEFORE_OBSERVER);for(const i of t)i.remove();this.observeLastElement()}}set visibleElements(e){this._visibleElements=this.useObserver?e:[],this.requestUpdate()}get visibleElements(){return this._visibleElements}getLazyObserver(){if(!this.useObserver)return null;if(this._lazyLoadObserver)return this._lazyLoadObserver;const e=new IntersectionObserver(t=>{const i=t[0];if(!i.isIntersecting)return;const n=i.target;e.unobserve(n);const r=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length,o=[...this.elements][r];o&&(this.visibleElements=[...this.visibleElements,o],e.observe(o))},{threshold:.5});return e}observeLastElement(){const e=this.getLazyObserver();if(!e)return;const t=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length-1,i=[...this.elements][t];i&&e.observe(i)}resetVisibleElements(){const e=this.getLazyObserver();if(e){for(const t of this.elements)e.unobserve(t);this.visibleElements=[],this.observeLastElement()}}static create(e,t){const i=document.createDocumentFragment();if(e.length===0)return Ja(e(),i),i.firstElementChild;if(!t)throw new Error("UIComponent: Initial state is required for statefull components.");let n=t;const r=e,o=a=>(n={...n,...a},Ja(r(n),i),n);return o(t),[i.firstElementChild,o]}}const nl=(s,e=!0)=>{let t={};for(const i of s.children){const n=i,r=n.getAttribute("name")||n.getAttribute("label");if(r){if("value"in n){const o=n.value;if(typeof o=="object"&&!Array.isArray(o)&&Object.keys(o).length===0)continue;t[r]=n.value}else if(e){const o=nl(n);if(Object.keys(o).length===0)continue;t[r]=o}}else e&&(t={...t,...nl(n)})}return t},Cl=s=>s==="true"||s==="false"?s==="true":s&&!isNaN(Number(s))&&s.trim()!==""?Number(s):s,HI=["=",">",">=","<","<=","?","/","#"];function Zp(s){const e=HI.filter(o=>s.split(o).length===2)[0],t=s.split(e).map(o=>o.trim()),[i,n]=t,r=n.startsWith("'")&&n.endsWith("'")?n.replace(/'/g,""):Cl(n);return{key:i,condition:e,value:r}}const kh=s=>{try{const e=[],t=s.split(/&(?![^()]*\))/).map(i=>i.trim());for(const i of t){const n=!i.startsWith("(")&&!i.endsWith(")"),r=i.startsWith("(")&&i.endsWith(")");if(n){const o=Zp(i);e.push(o)}if(r){const o={operator:"&",queries:i.replace(/^(\()|(\))$/g,"").split("&").map(a=>a.trim()).map((a,l)=>{const h=Zp(a);return l>0&&(h.operator="&"),h})};e.push(o)}}return e}catch{return null}},qp=(s,e,t)=>{let i=!1;switch(e){case"=":i=s===t;break;case"?":i=String(s).includes(String(t));break;case"<":(typeof s=="number"||typeof t=="number")&&(i=s":(typeof s=="number"||typeof t=="number")&&(i=s>t);break;case">=":(typeof s=="number"||typeof t=="number")&&(i=s>=t);break;case"/":i=String(s).startsWith(String(t));break}return i};var YI=Object.defineProperty,GI=Object.getOwnPropertyDescriptor,cn=(s,e,t,i)=>{for(var n=i>1?void 0:i?GI(e,t):e,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&YI(e,t,n),n};const n0=class extends Ue{constructor(){super(...arguments),this.checked=!1,this.checkbox=!1,this.noMark=!1,this.vertical=!1}get value(){return this._value!==void 0?this._value:this.label?Cl(this.label):this.label}set value(s){this._value=s}render(){return pe` + `];let i0=t0;VI([te({type:Boolean,reflect:!0})],i0.prototype,"visible");class Zn extends Ue{constructor(){super(...arguments),this._lazyLoadObserver=null,this._visibleElements=[],this.ELEMENTS_BEFORE_OBSERVER=20,this.useObserver=!1,this.elements=new Set,this.observe=e=>{if(!this.useObserver)return;for(const i of e)this.elements.add(i);const t=e.slice(this.ELEMENTS_BEFORE_OBSERVER);for(const i of t)i.remove();this.observeLastElement()}}set visibleElements(e){this._visibleElements=this.useObserver?e:[],this.requestUpdate()}get visibleElements(){return this._visibleElements}getLazyObserver(){if(!this.useObserver)return null;if(this._lazyLoadObserver)return this._lazyLoadObserver;const e=new IntersectionObserver(t=>{const i=t[0];if(!i.isIntersecting)return;const n=i.target;e.unobserve(n);const r=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length,o=[...this.elements][r];o&&(this.visibleElements=[...this.visibleElements,o],e.observe(o))},{threshold:.5});return e}observeLastElement(){const e=this.getLazyObserver();if(!e)return;const t=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length-1,i=[...this.elements][t];i&&e.observe(i)}resetVisibleElements(){const e=this.getLazyObserver();if(e){for(const t of this.elements)e.unobserve(t);this.visibleElements=[],this.observeLastElement()}}static create(e,t){const i=document.createDocumentFragment();if(e.length===0)return Ja(e(),i),i.firstElementChild;if(!t)throw new Error("UIComponent: Initial state is required for statefull components.");let n=t;const r=e,o=a=>(n={...n,...a},Ja(r(n),i),n);return o(t),[i.firstElementChild,o]}}const nl=(s,e=!0)=>{let t={};for(const i of s.children){const n=i,r=n.getAttribute("name")||n.getAttribute("label");if(r){if("value"in n){const o=n.value;if(typeof o=="object"&&!Array.isArray(o)&&Object.keys(o).length===0)continue;t[r]=n.value}else if(e){const o=nl(n);if(Object.keys(o).length===0)continue;t[r]=o}}else e&&(t={...t,...nl(n)})}return t},Tl=s=>s==="true"||s==="false"?s==="true":s&&!isNaN(Number(s))&&s.trim()!==""?Number(s):s,HI=["=",">",">=","<","<=","?","/","#"];function Qp(s){const e=HI.filter(o=>s.split(o).length===2)[0],t=s.split(e).map(o=>o.trim()),[i,n]=t,r=n.startsWith("'")&&n.endsWith("'")?n.replace(/'/g,""):Tl(n);return{key:i,condition:e,value:r}}const Bh=s=>{try{const e=[],t=s.split(/&(?![^()]*\))/).map(i=>i.trim());for(const i of t){const n=!i.startsWith("(")&&!i.endsWith(")"),r=i.startsWith("(")&&i.endsWith(")");if(n){const o=Qp(i);e.push(o)}if(r){const o={operator:"&",queries:i.replace(/^(\()|(\))$/g,"").split("&").map(a=>a.trim()).map((a,l)=>{const h=Qp(a);return l>0&&(h.operator="&"),h})};e.push(o)}}return e}catch{return null}},Zp=(s,e,t)=>{let i=!1;switch(e){case"=":i=s===t;break;case"?":i=String(s).includes(String(t));break;case"<":(typeof s=="number"||typeof t=="number")&&(i=s":(typeof s=="number"||typeof t=="number")&&(i=s>t);break;case">=":(typeof s=="number"||typeof t=="number")&&(i=s>=t);break;case"/":i=String(s).startsWith(String(t));break}return i};var YI=Object.defineProperty,GI=Object.getOwnPropertyDescriptor,cn=(s,e,t,i)=>{for(var n=i>1?void 0:i?GI(e,t):e,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&YI(e,t,n),n};const n0=class extends Ue{constructor(){super(...arguments),this.checked=!1,this.checkbox=!1,this.noMark=!1,this.vertical=!1}get value(){return this._value!==void 0?this._value:this.label?Tl(this.label):this.label}set value(s){this._value=s}render(){return pe`

${this.img||this.icon||this.label?pe`
${this.checkbox&&!this.noMark?pe`{for(var n=i>1?void 0:i?WI(e,t):e,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&jI(e,t,n),n};const s0=class extends Zn{constructor(){super(),this.multiple=!1,this.required=!1,this.vertical=!1,this._inputContainer=en(),this._listElement=en(),this._visible=!1,this._value=[],this.onValueChange=new Event("change"),this.onWindowMouseUp=s=>{this.visible&&(this.contains(s.target)||(this.visible=!1))},this.onOptionClick=s=>{const e=s.target,t=this._value.includes(e);if(!this.multiple&&!this.required&&!t)this._value=[e];else if(!this.multiple&&!this.required&&t)this._value=[];else if(!this.multiple&&this.required&&!t)this._value=[e];else if(this.multiple&&!this.required&&!t)this._value=[...this._value,e];else if(this.multiple&&!this.required&&t)this._value=this._value.filter(i=>i!==e);else if(this.multiple&&this.required&&!t)this._value=[...this._value,e];else if(this.multiple&&this.required&&t){const i=this._value.filter(n=>n!==e);i.length!==0&&(this._value=i)}this.updateOptionsState(),this.dispatchEvent(this.onValueChange)},this.useObserver=!0}set visible(s){this._visible=s,s||this.resetVisibleElements()}get visible(){return this._visible}set value(s){if(this.required&&Object.keys(s).length===0)return;const e=[];for(const t of s){const i=this.findOption(t);if(i&&(e.push(i),!this.multiple&&Object.keys(s).length>1))break}this._value=e,this.updateOptionsState(),this.dispatchEvent(this.onValueChange)}get value(){return this._value.filter(s=>s instanceof at&&s.checked).map(s=>s.value)}get _options(){const s=[...this.elements];for(const e of this.children)e instanceof at&&s.push(e);return s}onSlotChange(s){const e=s.target.assignedElements();this.observe(e);for(const t of e){if(!(t instanceof at)){t.remove();continue}t.removeEventListener("click",this.onOptionClick),t.addEventListener("click",this.onOptionClick)}}updateOptionsState(){for(const s of this._options)s instanceof at&&(this._value.includes(s)?s.checked=!0:s.checked=!1)}findOption(s){return this._options.find(e=>e instanceof at?e.label===s||e.value===s:!1)}connectedCallback(){super.connectedCallback(),window.addEventListener("mouseup",this.onWindowMouseUp)}firstUpdated(){for(const s of this.children)s instanceof at&&s.checked&&this._value.push(s)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mouseup",this.onWindowMouseUp)}render(){let s,e,t;if(this._value.length===0)s="Select an option...";else if(this._value.length===1){const i=this._value[0];s=(i==null?void 0:i.label)||(i==null?void 0:i.value),e=i==null?void 0:i.img,t=i==null?void 0:i.icon}else s=`Multiple (${this._value.length})`;return pe` + `;let at=n0;cn([te({type:String,reflect:!0})],at.prototype,"img",2);cn([te({type:String,reflect:!0})],at.prototype,"label",2);cn([te({type:String,reflect:!0})],at.prototype,"icon",2);cn([te({type:Boolean,reflect:!0})],at.prototype,"checked",2);cn([te({type:Boolean,reflect:!0})],at.prototype,"checkbox",2);cn([te({type:Boolean,attribute:"no-mark",reflect:!0})],at.prototype,"noMark",2);cn([te({converter:{fromAttribute(s){return s&&Tl(s)}}})],at.prototype,"value",1);cn([te({type:Boolean,reflect:!0})],at.prototype,"vertical",2);var jI=Object.defineProperty,WI=Object.getOwnPropertyDescriptor,hn=(s,e,t,i)=>{for(var n=i>1?void 0:i?WI(e,t):e,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&jI(e,t,n),n};const s0=class extends Zn{constructor(){super(),this.multiple=!1,this.required=!1,this.vertical=!1,this._inputContainer=en(),this._listElement=en(),this._visible=!1,this._value=[],this.onValueChange=new Event("change"),this.onWindowMouseUp=s=>{this.visible&&(this.contains(s.target)||(this.visible=!1))},this.onOptionClick=s=>{const e=s.target,t=this._value.includes(e);if(!this.multiple&&!this.required&&!t)this._value=[e];else if(!this.multiple&&!this.required&&t)this._value=[];else if(!this.multiple&&this.required&&!t)this._value=[e];else if(this.multiple&&!this.required&&!t)this._value=[...this._value,e];else if(this.multiple&&!this.required&&t)this._value=this._value.filter(i=>i!==e);else if(this.multiple&&this.required&&!t)this._value=[...this._value,e];else if(this.multiple&&this.required&&t){const i=this._value.filter(n=>n!==e);i.length!==0&&(this._value=i)}this.updateOptionsState(),this.dispatchEvent(this.onValueChange)},this.useObserver=!0}set visible(s){this._visible=s,s||this.resetVisibleElements()}get visible(){return this._visible}set value(s){if(this.required&&Object.keys(s).length===0)return;const e=[];for(const t of s){const i=this.findOption(t);if(i&&(e.push(i),!this.multiple&&Object.keys(s).length>1))break}this._value=e,this.updateOptionsState(),this.dispatchEvent(this.onValueChange)}get value(){return this._value.filter(s=>s instanceof at&&s.checked).map(s=>s.value)}get _options(){const s=[...this.elements];for(const e of this.children)e instanceof at&&s.push(e);return s}onSlotChange(s){const e=s.target.assignedElements();this.observe(e);for(const t of e){if(!(t instanceof at)){t.remove();continue}t.removeEventListener("click",this.onOptionClick),t.addEventListener("click",this.onOptionClick)}}updateOptionsState(){for(const s of this._options)s instanceof at&&(this._value.includes(s)?s.checked=!0:s.checked=!1)}findOption(s){return this._options.find(e=>e instanceof at?e.label===s||e.value===s:!1)}connectedCallback(){super.connectedCallback(),window.addEventListener("mouseup",this.onWindowMouseUp)}firstUpdated(){for(const s of this.children)s instanceof at&&s.checked&&this._value.push(s)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mouseup",this.onWindowMouseUp)}render(){let s,e,t;if(this._value.length===0)s="Select an option...";else if(this._value.length===1){const i=this._value[0];s=(i==null?void 0:i.label)||(i==null?void 0:i.value),e=i==null?void 0:i.img,t=i==null?void 0:i.icon}else s=`Multiple (${this._value.length})`;return pe` - `}};Bh.styles=Be` + `}};zh.styles=Be` :host { height: var(--bim-icon--fz, var(--bim-ui_size-sm)); width: var(--bim-icon--fz, var(--bim-ui_size-sm)); @@ -2171,7 +2171,7 @@ void main() { width: var(--bim-icon--fz, var(--bim-ui_size-sm)); color: var(--bim-icon--c); } - `,Bh.properties={icon:{type:String}};let KI=Bh;var QI=Object.defineProperty,Tl=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=o(e,t,n)||n);return n&&QI(e,t,n),n};const a0=class extends Ue{constructor(){super(),this.onValueChange=new Event("change"),this.vertical=!1}get value(){const s={};for(const e of this.children){const t=e;"value"in t?s[t.name||t.label]=t.value:"checked"in t&&(s[t.name||t.label]=t.checked)}return s}set value(s){const e=[...this.children];for(const t in s){const i=e.find(o=>{const a=o;return a.name===t||a.label===t});if(!i)continue;const n=i,r=s[t];typeof r=="boolean"?n.checked=r:n.value=r}}render(){return pe` + `,zh.properties={icon:{type:String}};let KI=zh;var QI=Object.defineProperty,xl=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=o(e,t,n)||n);return n&&QI(e,t,n),n};const a0=class extends Ue{constructor(){super(),this.onValueChange=new Event("change"),this.vertical=!1}get value(){const s={};for(const e of this.children){const t=e;"value"in t?s[t.name||t.label]=t.value:"checked"in t&&(s[t.name||t.label]=t.checked)}return s}set value(s){const e=[...this.children];for(const t in s){const i=e.find(o=>{const a=o;return a.name===t||a.label===t});if(!i)continue;const n=i,r=s[t];typeof r=="boolean"?n.checked=r:n.value=r}}render(){return pe`
${this.label||this.icon?pe`{for(var n=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=o(e,t,n)||n);return n&&ZI(e,t,n),n};const l0=class extends Ue{constructor(){super(...arguments),this.labelHidden=!1,this.iconHidden=!1,this.vertical=!1}get value(){return this.label?Cl(this.label):this.label}render(){return pe` + `;let go=a0;xl([te({type:String,reflect:!0})],go.prototype,"name");xl([te({type:String,reflect:!0})],go.prototype,"label");xl([te({type:String,reflect:!0})],go.prototype,"icon");xl([te({type:Boolean,reflect:!0})],go.prototype,"vertical");var ZI=Object.defineProperty,Xs=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=o(e,t,n)||n);return n&&ZI(e,t,n),n};const l0=class extends Ue{constructor(){super(...arguments),this.labelHidden=!1,this.iconHidden=!1,this.vertical=!1}get value(){return this.label?Tl(this.label):this.label}render(){return pe`
${this.img?pe``:null} ${!this.iconHidden&&this.icon?pe``:null} @@ -2281,7 +2281,7 @@ void main() { calc(var(--bim-label--fz, var(--bim-ui_size-xs)) * 4) ); } - `;let qn=l0;Xs([te({type:String,reflect:!0})],qn.prototype,"label");Xs([te({type:String,reflect:!0})],qn.prototype,"img");Xs([te({type:Boolean,attribute:"label-hidden",reflect:!0})],qn.prototype,"labelHidden");Xs([te({type:String,reflect:!0})],qn.prototype,"icon");Xs([te({type:Boolean,attribute:"icon-hidden",reflect:!0})],qn.prototype,"iconHidden");Xs([te({type:Boolean,reflect:!0})],qn.prototype,"vertical");var qI=Object.defineProperty,JI=Object.getOwnPropertyDescriptor,Zt=(s,e,t,i)=>{for(var n=i>1?void 0:i?JI(e,t):e,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&qI(e,t,n),n};const c0=class extends Ue{constructor(){super(...arguments),this._value=0,this.vertical=!1,this.slider=!1,this._input=en(),this.onValueChange=new Event("change")}set value(s){this.setValue(s.toString())}get value(){return this._value}onChange(s){s.stopPropagation();const{value:e}=this._input;e&&this.setValue(e.value)}setValue(s){const{value:e}=this._input;let t=s;if(t=t.replace(/[^0-9.-]/g,""),t=t.replace(/(\..*)\./g,"$1"),t.endsWith(".")||(t.lastIndexOf("-")>0&&(t=t[0]+t.substring(1).replace(/-/g,"")),t==="-"||t==="-0"))return;let i=Number(t);Number.isNaN(i)||(i=this.min!==void 0?Math.max(i,this.min):i,i=this.max!==void 0?Math.min(i,this.max):i,this.value!==i&&(this._value=i,e&&(e.value=this.value.toString()),this.requestUpdate(),this.dispatchEvent(this.onValueChange)))}onBlur(){const{value:s}=this._input;s&&Number.isNaN(Number(s.value))&&(s.value=this.value.toString())}onSliderMouseDown(s){document.body.style.cursor="w-resize";const{clientX:e}=s,t=this.value;let i=!1;const n=a=>{var l;i=!0;const{clientX:h}=a,d=this.step??1,p=((l=d.toString().split(".")[1])==null?void 0:l.length)||0,f=1/(this.sensitivity??1),g=(h-e)/f;if(Math.floor(Math.abs(g))!==Math.abs(g))return;const y=t+g*d;this.setValue(y.toFixed(p))},r=()=>{this.slider=!0,this.removeEventListener("blur",r)},o=()=>{document.removeEventListener("mousemove",n),document.body.style.cursor="default",i?i=!1:(this.addEventListener("blur",r),this.slider=!1,requestAnimationFrame(()=>this.focus())),document.removeEventListener("mouseup",o)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",o)}onFocus(s){s.stopPropagation();const e=t=>{t.key==="Escape"&&(this.blur(),window.removeEventListener("keydown",e))};window.addEventListener("keydown",e)}connectedCallback(){super.connectedCallback(),this.min&&this.min>this.value&&(this._value=this.min),this.max&&this.max{for(var n=i>1?void 0:i?JI(e,t):e,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&qI(e,t,n),n};const c0=class extends Ue{constructor(){super(...arguments),this._value=0,this.vertical=!1,this.slider=!1,this._input=en(),this.onValueChange=new Event("change")}set value(s){this.setValue(s.toString())}get value(){return this._value}onChange(s){s.stopPropagation();const{value:e}=this._input;e&&this.setValue(e.value)}setValue(s){const{value:e}=this._input;let t=s;if(t=t.replace(/[^0-9.-]/g,""),t=t.replace(/(\..*)\./g,"$1"),t.endsWith(".")||(t.lastIndexOf("-")>0&&(t=t[0]+t.substring(1).replace(/-/g,"")),t==="-"||t==="-0"))return;let i=Number(t);Number.isNaN(i)||(i=this.min!==void 0?Math.max(i,this.min):i,i=this.max!==void 0?Math.min(i,this.max):i,this.value!==i&&(this._value=i,e&&(e.value=this.value.toString()),this.requestUpdate(),this.dispatchEvent(this.onValueChange)))}onBlur(){const{value:s}=this._input;s&&Number.isNaN(Number(s.value))&&(s.value=this.value.toString())}onSliderMouseDown(s){document.body.style.cursor="w-resize";const{clientX:e}=s,t=this.value;let i=!1;const n=a=>{var l;i=!0;const{clientX:h}=a,d=this.step??1,p=((l=d.toString().split(".")[1])==null?void 0:l.length)||0,f=1/(this.sensitivity??1),g=(h-e)/f;if(Math.floor(Math.abs(g))!==Math.abs(g))return;const v=t+g*d;this.setValue(v.toFixed(p))},r=()=>{this.slider=!0,this.removeEventListener("blur",r)},o=()=>{document.removeEventListener("mousemove",n),document.body.style.cursor="default",i?i=!1:(this.addEventListener("blur",r),this.slider=!1,requestAnimationFrame(()=>this.focus())),document.removeEventListener("mouseup",o)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",o)}onFocus(s){s.stopPropagation();const e=t=>{t.key==="Escape"&&(this.blur(),window.removeEventListener("keydown",e))};window.addEventListener("keydown",e)}connectedCallback(){super.connectedCallback(),this.min&&this.min>this.value&&(this._value=this.min),this.max&&this.max{for(var n=i>1?void 0:i?eC(e,t):e,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&$I(e,t,n),n};const h0=class extends Ue{constructor(){super(...arguments),this.onValueChange=new Event("change"),this._hidden=!1,this.activationButton=document.createElement("bim-button")}set hidden(s){this._hidden=s,this.activationButton.active=!s,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}get value(){return nl(this)}set value(s){const e=[...this.children];for(const t in s){const i=e.find(r=>{const o=r;return o.name===t||o.label===t});if(!i)continue;const n=i;n.value=s[t]}}connectedCallback(){super.connectedCallback(),this.activationButton.active=!this.hidden,this.activationButton.onclick=()=>this.hidden=!this.hidden}disconnectedCallback(){super.disconnectedCallback(),this.activationButton.remove()}collapseSections(){const s=this.querySelectorAll("bim-panel-section");for(const e of s)e.collapsed=!0}expandSections(){const s=this.querySelectorAll("bim-panel-section");for(const e of s)e.collapsed=!1}render(){return this.activationButton.icon=this.icon,this.activationButton.label=this.label||this.name,this.activationButton.tooltipTitle=this.label||this.name,pe` + `;let kt=c0;Zt([te({type:String,reflect:!0})],kt.prototype,"name",2);Zt([te({type:String,reflect:!0})],kt.prototype,"icon",2);Zt([te({type:String,reflect:!0})],kt.prototype,"label",2);Zt([te({type:String,reflect:!0})],kt.prototype,"pref",2);Zt([te({type:Number,reflect:!0})],kt.prototype,"min",2);Zt([te({type:Number,reflect:!0})],kt.prototype,"value",1);Zt([te({type:Number,reflect:!0})],kt.prototype,"step",2);Zt([te({type:Number,reflect:!0})],kt.prototype,"sensitivity",2);Zt([te({type:Number,reflect:!0})],kt.prototype,"max",2);Zt([te({type:String,reflect:!0})],kt.prototype,"suffix",2);Zt([te({type:Boolean,reflect:!0})],kt.prototype,"vertical",2);Zt([te({type:Boolean,reflect:!0})],kt.prototype,"slider",2);var $I=Object.defineProperty,eC=Object.getOwnPropertyDescriptor,Al=(s,e,t,i)=>{for(var n=i>1?void 0:i?eC(e,t):e,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&$I(e,t,n),n};const h0=class extends Ue{constructor(){super(...arguments),this.onValueChange=new Event("change"),this._hidden=!1,this.activationButton=document.createElement("bim-button")}set hidden(s){this._hidden=s,this.activationButton.active=!s,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}get value(){return nl(this)}set value(s){const e=[...this.children];for(const t in s){const i=e.find(r=>{const o=r;return o.name===t||o.label===t});if(!i)continue;const n=i;n.value=s[t]}}connectedCallback(){super.connectedCallback(),this.activationButton.active=!this.hidden,this.activationButton.onclick=()=>this.hidden=!this.hidden}disconnectedCallback(){super.disconnectedCallback(),this.activationButton.remove()}collapseSections(){const s=this.querySelectorAll("bim-panel-section");for(const e of s)e.collapsed=!0}expandSections(){const s=this.querySelectorAll("bim-panel-section");for(const e of s)e.collapsed=!1}render(){return this.activationButton.icon=this.icon,this.activationButton.label=this.label||this.name,this.activationButton.tooltipTitle=this.label||this.name,pe`
${this.label||this.name||this.icon?pe`{for(var n=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=o(e,t,n)||n);return n&&tC(e,t,n),n};const u0=class extends Ue{constructor(){super(...arguments),this.onValueChange=new Event("change")}get value(){return nl(this)}set value(s){const e=[...this.children];for(const t in s){const i=e.find(r=>{const o=r;return o.name===t||o.label===t});if(!i)continue;const n=i;n.value=s[t]}}onHeaderClick(){this.fixed||(this.collapsed=!this.collapsed)}render(){const s=this.label||this.icon||this.name||this.fixed,e=pe`{for(var n=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=o(e,t,n)||n);return n&&tC(e,t,n),n};const u0=class extends Ue{constructor(){super(...arguments),this.onValueChange=new Event("change")}get value(){return nl(this)}set value(s){const e=[...this.children];for(const t in s){const i=e.find(r=>{const o=r;return o.name===t||o.label===t});if(!i)continue;const n=i;n.value=s[t]}}onHeaderClick(){this.fixed||(this.collapsed=!this.collapsed)}render(){const s=this.label||this.icon||this.name||this.fixed,e=pe`ww(s)?s._$litType$.h:s.strings,cC=_g(class extends Rg{constructor(s){super(s),this.et=new WeakMap}render(s){return[s]}update(s,[e]){const t=Sp(this.it)?Jp(this.it):null,i=Sp(e)?Jp(e):null;if(t!==null&&(i===null||t!==i)){const n=Fp(s).pop();let r=this.et.get(t);if(r===void 0){const o=document.createDocumentFragment();r=Ja(tt,o),r.setConnected(!1),this.et.set(t,r)}Pp(r,[n]),Rp(r,void 0,n)}if(i!==null){if(t===null||t!==i){const n=this.et.get(i);if(n!==void 0){const r=Fp(n).pop();Tw(s),Rp(s,void 0,r),Pp(s,[r])}}this.it=e}else this.it=void 0;return this.render(e)}});var hC=Object.defineProperty,Al=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=o(e,t,n)||n);return n&&hC(e,t,n),n};const E0=class extends Ue{constructor(){super(),this.data={},this._table=this.closest("bim-table"),this.onTableIndentationColorChange=s=>{var e;if(!this.table)return;const t=s.detail,{indentationLevel:i,color:n}=t;((e=this.table)==null?void 0:e.getRowIndentation(this.data))===i&&(this.style.backgroundColor=n)},this.onTableColumnsChange=()=>{this.table&&(this.columns=this.table.columns)},this._observer=new IntersectionObserver(s=>{this._intersecting=s[0].isIntersecting},{rootMargin:"10px"}),this.columns=[],this.isHeader=!1}get _columnNames(){return this.columns.map(s=>s.name)}get _columnWidths(){return this.columns.map(s=>s.width)}set table(s){this._table&&(this.columns=[],this._table.removeEventListener("columnschange",this.onTableColumnsChange)),this._table=s,this._table&&(this.columns=this._table.columns,this._table.addEventListener("columnschange",this.onTableColumnsChange),this._table.addEventListener("indentation",this.onTableIndentationColorChange))}get table(){return this._table}connectedCallback(){super.connectedCallback(),this._observer.observe(this)}compute(){var s,e;const t=((s=this.table)==null?void 0:s.getRowIndentation(this.data))??0,i=this.isHeader?this.data:((e=this.table)==null?void 0:e.computeRowDeclaration(this.data))??this.data,n=[];for(const r in i){const o=i[r];let a;typeof o=="string"||typeof o=="boolean"||typeof o=="number"?a=pe``:a=o;const l=this._columnNames.indexOf(r)===0,h=` + */const qp=s=>ww(s)?s._$litType$.h:s.strings,cC=_g(class extends Rg{constructor(s){super(s),this.et=new WeakMap}render(s){return[s]}update(s,[e]){const t=Ap(this.it)?qp(this.it):null,i=Ap(e)?qp(e):null;if(t!==null&&(i===null||t!==i)){const n=Pp(s).pop();let r=this.et.get(t);if(r===void 0){const o=document.createDocumentFragment();r=Ja(tt,o),r.setConnected(!1),this.et.set(t,r)}Rp(r,[n]),_p(r,void 0,n)}if(i!==null){if(t===null||t!==i){const n=this.et.get(i);if(n!==void 0){const r=Pp(n).pop();Tw(s),_p(s,void 0,r),Rp(s,[r])}}this.it=e}else this.it=void 0;return this.render(e)}});var hC=Object.defineProperty,Sl=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=o(e,t,n)||n);return n&&hC(e,t,n),n};const E0=class extends Ue{constructor(){super(),this.data={},this._table=this.closest("bim-table"),this.onTableIndentationColorChange=s=>{var e;if(!this.table)return;const t=s.detail,{indentationLevel:i,color:n}=t;((e=this.table)==null?void 0:e.getRowIndentation(this.data))===i&&(this.style.backgroundColor=n)},this.onTableColumnsChange=()=>{this.table&&(this.columns=this.table.columns)},this._observer=new IntersectionObserver(s=>{this._intersecting=s[0].isIntersecting},{rootMargin:"10px"}),this.columns=[],this.isHeader=!1}get _columnNames(){return this.columns.map(s=>s.name)}get _columnWidths(){return this.columns.map(s=>s.width)}set table(s){this._table&&(this.columns=[],this._table.removeEventListener("columnschange",this.onTableColumnsChange)),this._table=s,this._table&&(this.columns=this._table.columns,this._table.addEventListener("columnschange",this.onTableColumnsChange),this._table.addEventListener("indentation",this.onTableIndentationColorChange))}get table(){return this._table}connectedCallback(){super.connectedCallback(),this._observer.observe(this)}compute(){var s,e;const t=((s=this.table)==null?void 0:s.getRowIndentation(this.data))??0,i=this.isHeader?this.data:((e=this.table)==null?void 0:e.computeRowDeclaration(this.data))??this.data,n=[];for(const r in i){const o=i[r];let a;typeof o=="string"||typeof o=="boolean"||typeof o=="number"?a=pe``:a=o;const l=this._columnNames.indexOf(r)===0,h=` ${l&&!this.isHeader?"justify-content: normal":""}; ${l&&!this.isHeader?`margin-left: ${t+.125}rem`:""} `,d=pe` @@ -2714,8 +2714,8 @@ void main() { min-height: 2.25rem; /* border-bottom: 1px solid var(--bim-ui_bg-contrast-20); */ } - `;let bo=E0;Al([te({type:Array,attribute:!1})],bo.prototype,"columns");Al([te({type:Object,attribute:!1})],bo.prototype,"data");Al([te({type:Boolean,attribute:"is-header",reflect:!0})],bo.prototype,"isHeader");Al([uo()],bo.prototype,"_intersecting");var uC=Object.defineProperty,dC=Object.getOwnPropertyDescriptor,Jn=(s,e,t,i)=>{for(var n=i>1?void 0:i?dC(e,t):e,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&uC(e,t,n),n};const b0=class extends Ue{constructor(){super(...arguments),this._columnsChange=new Event("columnschange"),this._filteredData=[],this.headersHidden=!1,this.minColWidth="4rem",this._columns=[],this._textDelimiters={comma:",",tab:" "},this._queryString=null,this._data=[],this.expanded=!1,this.preserveStructureOnFilter=!1,this.indentationInText=!1,this.definition={},this._stringFilterFunction=(s,e)=>Object.values(e.data).some(t=>String(t).toLowerCase().includes(s.toLowerCase())),this._queryFilterFunction=(s,e)=>{let t=!1;const i=kh(s)??[];for(const n of i){if("queries"in n){t=!1;break}const{condition:r,value:o}=n;let{key:a}=n;if(a.startsWith("[")&&a.endsWith("]")){const l=a.replace("[","").replace("]","");a=l,t=Object.keys(e.data).filter(h=>h.includes(l)).map(h=>qp(e.data[h],r,o)).some(h=>h)}else t=qp(e.data[a],r,o);if(!t)break}return t}}set columns(s){const e=[];for(const t of s){const i=typeof t=="string"?{name:t,width:`minmax(${this.minColWidth}, 1fr)`}:t;e.push(i)}this._columns=e,this.computeMissingColumns(this.data),this.dispatchEvent(this._columnsChange)}get columns(){return this._columns}get _headerRowData(){const s={};for(const e of this.columns)if(typeof e=="string")s[e]=e;else{const{name:t}=e;s[t]=t}return s}get value(){return this.queryString?this._filteredData:this.data}set queryString(s){const e=s&&s.trim()!==""?s.trim():null;this._queryString=e,e?(kh(e)?(this.filterFunction=this._queryFilterFunction,this._filteredData=this.filter(e)):(this.filterFunction=this._stringFilterFunction,this._filteredData=this.filter(e)),this.preserveStructureOnFilter&&(this._expandedBeforeSearch===void 0&&(this._expandedBeforeSearch=this.expanded),this.expanded=!0)):(this.preserveStructureOnFilter&&this._expandedBeforeSearch!==void 0&&(this.expanded=this._expandedBeforeSearch,this._expandedBeforeSearch=void 0),this._filteredData=this.data)}get queryString(){return this._queryString}set data(s){this._data=s,this.computeMissingColumns(s)&&(this.columns=this._columns)}get data(){return this._data}computeMissingColumns(s){let e=!1;for(const t of s){const{children:i,data:n}=t;for(const r in n)this._columns.map(o=>typeof o=="string"?o:o.name).includes(r)||(this._columns.push({name:r,width:`minmax(${this.minColWidth}, 1fr)`}),e=!0);if(i){const r=this.computeMissingColumns(i);r&&!e&&(e=r)}}return e}generateText(s="comma",e=this.value,t="",i=!0){const n=this._textDelimiters[s];let r="";const o=this.columns.map(a=>a.name);if(i){this.indentationInText&&(r+=`Indentation${n}`);const a=`${o.join(n)} -`;r+=a}for(const[a,l]of e.entries()){const{data:h,children:d}=l,p=this.indentationInText?`${t}${a+1}${n}`:"",f=o.map(y=>h[y]??""),g=`${p}${f.join(n)} + `;let bo=E0;Sl([te({type:Array,attribute:!1})],bo.prototype,"columns");Sl([te({type:Object,attribute:!1})],bo.prototype,"data");Sl([te({type:Boolean,attribute:"is-header",reflect:!0})],bo.prototype,"isHeader");Sl([uo()],bo.prototype,"_intersecting");var uC=Object.defineProperty,dC=Object.getOwnPropertyDescriptor,Jn=(s,e,t,i)=>{for(var n=i>1?void 0:i?dC(e,t):e,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&uC(e,t,n),n};const b0=class extends Ue{constructor(){super(...arguments),this._columnsChange=new Event("columnschange"),this._filteredData=[],this.headersHidden=!1,this.minColWidth="4rem",this._columns=[],this._textDelimiters={comma:",",tab:" "},this._queryString=null,this._data=[],this.expanded=!1,this.preserveStructureOnFilter=!1,this.indentationInText=!1,this.definition={},this._stringFilterFunction=(s,e)=>Object.values(e.data).some(t=>String(t).toLowerCase().includes(s.toLowerCase())),this._queryFilterFunction=(s,e)=>{let t=!1;const i=Bh(s)??[];for(const n of i){if("queries"in n){t=!1;break}const{condition:r,value:o}=n;let{key:a}=n;if(a.startsWith("[")&&a.endsWith("]")){const l=a.replace("[","").replace("]","");a=l,t=Object.keys(e.data).filter(h=>h.includes(l)).map(h=>Zp(e.data[h],r,o)).some(h=>h)}else t=Zp(e.data[a],r,o);if(!t)break}return t}}set columns(s){const e=[];for(const t of s){const i=typeof t=="string"?{name:t,width:`minmax(${this.minColWidth}, 1fr)`}:t;e.push(i)}this._columns=e,this.computeMissingColumns(this.data),this.dispatchEvent(this._columnsChange)}get columns(){return this._columns}get _headerRowData(){const s={};for(const e of this.columns)if(typeof e=="string")s[e]=e;else{const{name:t}=e;s[t]=t}return s}get value(){return this.queryString?this._filteredData:this.data}set queryString(s){const e=s&&s.trim()!==""?s.trim():null;this._queryString=e,e?(Bh(e)?(this.filterFunction=this._queryFilterFunction,this._filteredData=this.filter(e)):(this.filterFunction=this._stringFilterFunction,this._filteredData=this.filter(e)),this.preserveStructureOnFilter&&(this._expandedBeforeSearch===void 0&&(this._expandedBeforeSearch=this.expanded),this.expanded=!0)):(this.preserveStructureOnFilter&&this._expandedBeforeSearch!==void 0&&(this.expanded=this._expandedBeforeSearch,this._expandedBeforeSearch=void 0),this._filteredData=this.data)}get queryString(){return this._queryString}set data(s){this._data=s,this.computeMissingColumns(s)&&(this.columns=this._columns)}get data(){return this._data}computeMissingColumns(s){let e=!1;for(const t of s){const{children:i,data:n}=t;for(const r in n)this._columns.map(o=>typeof o=="string"?o:o.name).includes(r)||(this._columns.push({name:r,width:`minmax(${this.minColWidth}, 1fr)`}),e=!0);if(i){const r=this.computeMissingColumns(i);r&&!e&&(e=r)}}return e}generateText(s="comma",e=this.value,t="",i=!0){const n=this._textDelimiters[s];let r="";const o=this.columns.map(a=>a.name);if(i){this.indentationInText&&(r+=`Indentation${n}`);const a=`${o.join(n)} +`;r+=a}for(const[a,l]of e.entries()){const{data:h,children:d}=l,p=this.indentationInText?`${t}${a+1}${n}`:"",f=o.map(v=>h[v]??""),g=`${p}${f.join(n)} `;r+=g,d&&(r+=this.generateText(s,l.children,`${t}${a+1}.`,!1))}return r}get csv(){return this.generateText("comma")}get tsv(){return this.generateText("tab")}computeRowDeclaration(s){const e={};for(const t in s){const i=this.definition[t];i?e[t]=i(s[t],s):e[t]=s[t]}return e}downloadData(s="BIM Table Data",e="json"){let t=null;if(e==="json"&&(t=new File([JSON.stringify(this.value,void 0,2)],`${s}.json`)),e==="csv"&&(t=new File([this.csv],`${s}.csv`)),e==="tsv"&&(t=new File([this.tsv],`${s}.tsv`)),!t)return;const i=document.createElement("a");i.href=URL.createObjectURL(t),i.download=t.name,i.click(),URL.revokeObjectURL(i.href)}getRowIndentation(s,e=this.value,t=0){for(const i of e){if(i.data===s)return t;if(i.children){const n=this.getRowIndentation(s,i.children,t+1);if(n!==null)return n}}return null}getGroupIndentation(s,e=this.value,t=0){for(const i of e){if(i===s)return t;if(i.children){const n=this.getGroupIndentation(s,i.children,t+1);if(n!==null)return n}}return null}setIndentationColor(s,e){const t=new CustomEvent("indentation",{detail:{indentationLevel:s,color:e}});this.dispatchEvent(t)}filter(s,e=this.filterFunction??this._stringFilterFunction,t=this.data){const i=[];for(const n of t)if(e(s,n)){if(this.preserveStructureOnFilter){const r={data:n.data};if(n.children){const o=this.filter(s,e,n.children);o.length&&(r.children=o)}i.push(r)}else if(i.push({data:n.data}),n.children){const r=this.filter(s,e,n.children);i.push(...r)}}else if(n.children){const r=this.filter(s,e,n.children);this.preserveStructureOnFilter&&r.length?i.push({data:n.data,children:r}):i.push(...r)}return i}render(){const s=document.createElement("bim-table-row");s.table=this,s.isHeader=!0,s.data=this._headerRowData,s.style.gridArea="Header",s.style.position="sticky",s.style.top="0",s.style.zIndex="5";const e=document.createElement("bim-table-children");return e.table=this,e.data=this.value,e.style.gridArea="Body",e.style.backgroundColor="transparent",pe`
${this.headersHidden?null:s} @@ -2754,7 +2754,7 @@ void main() { flex-wrap: wrap; margin-bottom: 0.5rem; } - `];let un=b0;Jn([uo()],un.prototype,"_filteredData",2);Jn([te({type:Boolean,attribute:"headers-hidden",reflect:!0})],un.prototype,"headersHidden",2);Jn([te({type:String,attribute:"min-col-width",reflect:!0})],un.prototype,"minColWidth",2);Jn([te({type:Array,attribute:!1})],un.prototype,"columns",1);Jn([te({type:String,attribute:"search-string",reflect:!0})],un.prototype,"queryString",1);Jn([te({type:Array,attribute:!1})],un.prototype,"data",1);Jn([te({type:Boolean,reflect:!0})],un.prototype,"expanded",2);var pC=Object.defineProperty,fC=Object.getOwnPropertyDescriptor,Sl=(s,e,t,i)=>{for(var n=i>1?void 0:i?fC(e,t):e,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&pC(e,t,n),n};const w0=class extends Ue{constructor(){super(...arguments),this._defaultName="__unnamed__",this.name=this._defaultName,this._hidden=!1}set hidden(s){this._hidden=s,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}connectedCallback(){super.connectedCallback();const{parentElement:s}=this;if(s&&this.name===this._defaultName){const e=[...s.children].indexOf(this);this.name=`${this._defaultName}${e}`}}render(){return pe` `}};w0.styles=Be` + `];let un=b0;Jn([uo()],un.prototype,"_filteredData",2);Jn([te({type:Boolean,attribute:"headers-hidden",reflect:!0})],un.prototype,"headersHidden",2);Jn([te({type:String,attribute:"min-col-width",reflect:!0})],un.prototype,"minColWidth",2);Jn([te({type:Array,attribute:!1})],un.prototype,"columns",1);Jn([te({type:String,attribute:"search-string",reflect:!0})],un.prototype,"queryString",1);Jn([te({type:Array,attribute:!1})],un.prototype,"data",1);Jn([te({type:Boolean,reflect:!0})],un.prototype,"expanded",2);var pC=Object.defineProperty,fC=Object.getOwnPropertyDescriptor,_l=(s,e,t,i)=>{for(var n=i>1?void 0:i?fC(e,t):e,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&pC(e,t,n),n};const w0=class extends Ue{constructor(){super(...arguments),this._defaultName="__unnamed__",this.name=this._defaultName,this._hidden=!1}set hidden(s){this._hidden=s,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}connectedCallback(){super.connectedCallback();const{parentElement:s}=this;if(s&&this.name===this._defaultName){const e=[...s.children].indexOf(this);this.name=`${this._defaultName}${e}`}}render(){return pe` `}};w0.styles=Be` :host { display: block; height: 100%; @@ -2763,7 +2763,7 @@ void main() { :host([hidden]) { display: none; } - `;let Ht=w0;Sl([te({type:String,reflect:!0})],Ht.prototype,"name",2);Sl([te({type:String,reflect:!0})],Ht.prototype,"label",2);Sl([te({type:String,reflect:!0})],Ht.prototype,"icon",2);Sl([te({type:Boolean,reflect:!0})],Ht.prototype,"hidden",1);var mC=Object.defineProperty,gC=Object.getOwnPropertyDescriptor,wo=(s,e,t,i)=>{for(var n=i>1?void 0:i?gC(e,t):e,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&mC(e,t,n),n};const I0=class extends Ue{constructor(){super(...arguments),this._switchers=[],this.bottom=!1,this.switchersHidden=!1,this.floating=!1,this.onTabHiddenChange=s=>{const e=s.target;e instanceof Ht&&!e.hidden&&(e.removeEventListener("hiddenchange",this.onTabHiddenChange),this.tab=e.name,e.addEventListener("hiddenchange",this.onTabHiddenChange))}}set tab(s){this._tab=s;const e=[...this.children],t=e.find(i=>i instanceof Ht&&i.name===s);for(const i of e){if(!(i instanceof Ht))continue;i.hidden=t!==i;const n=this.getTabSwitcher(i.name);n&&n.toggleAttribute("data-active",!i.hidden)}}get tab(){return this._tab}getTabSwitcher(s){return this._switchers.find(e=>e.getAttribute("data-name")===s)}createSwitchers(){this._switchers=[];for(const s of this.children){if(!(s instanceof Ht))continue;const e=document.createElement("div");e.addEventListener("click",()=>{this.tab===s.name?this.toggleAttribute("tab",!1):this.tab=s.name}),e.setAttribute("data-name",s.name),e.className="switcher";const t=document.createElement("bim-label");t.label=s.label,t.icon=s.icon,e.append(t),this._switchers.push(e)}}onSlotChange(s){this.createSwitchers();const e=s.target.assignedElements(),t=e.find(i=>i instanceof Ht?this.tab?i.name===this.tab:!i.hidden:!1);t&&t instanceof Ht&&(this.tab=t.name);for(const i of e){if(!(i instanceof Ht)){i.remove();continue}i.removeEventListener("hiddenchange",this.onTabHiddenChange),t!==i&&(i.hidden=!0),i.addEventListener("hiddenchange",this.onTabHiddenChange)}}render(){return pe` + `;let Ht=w0;_l([te({type:String,reflect:!0})],Ht.prototype,"name",2);_l([te({type:String,reflect:!0})],Ht.prototype,"label",2);_l([te({type:String,reflect:!0})],Ht.prototype,"icon",2);_l([te({type:Boolean,reflect:!0})],Ht.prototype,"hidden",1);var mC=Object.defineProperty,gC=Object.getOwnPropertyDescriptor,wo=(s,e,t,i)=>{for(var n=i>1?void 0:i?gC(e,t):e,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&mC(e,t,n),n};const I0=class extends Ue{constructor(){super(...arguments),this._switchers=[],this.bottom=!1,this.switchersHidden=!1,this.floating=!1,this.onTabHiddenChange=s=>{const e=s.target;e instanceof Ht&&!e.hidden&&(e.removeEventListener("hiddenchange",this.onTabHiddenChange),this.tab=e.name,e.addEventListener("hiddenchange",this.onTabHiddenChange))}}set tab(s){this._tab=s;const e=[...this.children],t=e.find(i=>i instanceof Ht&&i.name===s);for(const i of e){if(!(i instanceof Ht))continue;i.hidden=t!==i;const n=this.getTabSwitcher(i.name);n&&n.toggleAttribute("data-active",!i.hidden)}}get tab(){return this._tab}getTabSwitcher(s){return this._switchers.find(e=>e.getAttribute("data-name")===s)}createSwitchers(){this._switchers=[];for(const s of this.children){if(!(s instanceof Ht))continue;const e=document.createElement("div");e.addEventListener("click",()=>{this.tab===s.name?this.toggleAttribute("tab",!1):this.tab=s.name}),e.setAttribute("data-name",s.name),e.className="switcher";const t=document.createElement("bim-label");t.label=s.label,t.icon=s.icon,e.append(t),this._switchers.push(e)}}onSlotChange(s){this.createSwitchers();const e=s.target.assignedElements(),t=e.find(i=>i instanceof Ht?this.tab?i.name===this.tab:!i.hidden:!1);t&&t instanceof Ht&&(this.tab=t.name);for(const i of e){if(!(i instanceof Ht)){i.remove();continue}i.removeEventListener("hiddenchange",this.onTabHiddenChange),t!==i&&(i.hidden=!0),i.addEventListener("hiddenchange",this.onTabHiddenChange)}}render(){return pe`
${this._switchers}
@@ -2878,7 +2878,7 @@ void main() { * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const vC=s=>s??tt;var yC=Object.defineProperty,EC=Object.getOwnPropertyDescriptor,dn=(s,e,t,i)=>{for(var n=i>1?void 0:i?EC(e,t):e,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&yC(e,t,n),n};const C0=class extends Ue{constructor(){super(...arguments),this._inputTypes=["date","datetime-local","email","month","password","search","tel","text","time","url","week"],this.value="",this.vertical=!1,this._type="text",this.onValueChange=new Event("input")}set type(s){this._inputTypes.includes(s)&&(this._type=s)}get type(){return this._type}get query(){return kh(this.value)}onInputChange(s){s.stopPropagation();const e=s.target;clearTimeout(this._debounceTimeoutID),this._debounceTimeoutID=setTimeout(()=>{this.value=e.value,this.dispatchEvent(this.onValueChange)},this.debounce)}render(){return pe` + */const vC=s=>s??tt;var yC=Object.defineProperty,EC=Object.getOwnPropertyDescriptor,dn=(s,e,t,i)=>{for(var n=i>1?void 0:i?EC(e,t):e,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&yC(e,t,n),n};const C0=class extends Ue{constructor(){super(...arguments),this._inputTypes=["date","datetime-local","email","month","password","search","tel","text","time","url","week"],this.value="",this.vertical=!1,this._type="text",this.onValueChange=new Event("input")}set type(s){this._inputTypes.includes(s)&&(this._type=s)}get type(){return this._type}get query(){return Bh(this.value)}onInputChange(s){s.stopPropagation();const e=s.target;clearTimeout(this._debounceTimeoutID),this._debounceTimeoutID=setTimeout(()=>{this.value=e.value,this.dispatchEvent(this.onValueChange)},this.debounce)}render(){return pe` {for(var n=i>1?void 0:i?CC(e,t):e,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&IC(e,t,n),n};const A0=class extends Ue{constructor(){super(...arguments),this._vertical=!1,this._labelHidden=!1}set vertical(s){this._vertical=s,this.updateChildren()}get vertical(){return this._vertical}set labelHidden(s){this._labelHidden=s,this.updateChildren()}get labelHidden(){return this._labelHidden}updateChildren(){const s=this.children;for(const e of s)e instanceof _l&&(e.vertical=this.vertical),e.toggleAttribute("label-hidden",this.vertical)}render(){return pe` + `;let Rl=x0;T0([te({type:Number,reflect:!0})],Rl.prototype,"rows",2);T0([te({type:Boolean,reflect:!0})],Rl.prototype,"vertical",1);var IC=Object.defineProperty,CC=Object.getOwnPropertyDescriptor,Pl=(s,e,t,i)=>{for(var n=i>1?void 0:i?CC(e,t):e,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&IC(e,t,n),n};const A0=class extends Ue{constructor(){super(...arguments),this._vertical=!1,this._labelHidden=!1}set vertical(s){this._vertical=s,this.updateChildren()}get vertical(){return this._vertical}set labelHidden(s){this._labelHidden=s,this.updateChildren()}get labelHidden(){return this._labelHidden}updateChildren(){const s=this.children;for(const e of s)e instanceof Rl&&(e.vertical=this.vertical),e.toggleAttribute("label-hidden",this.vertical)}render(){return pe`
@@ -2984,7 +2984,7 @@ void main() { :host([vertical]) .children { flex-direction: column; } - `;let qs=A0;Rl([te({type:String,reflect:!0})],qs.prototype,"label",2);Rl([te({type:String,reflect:!0})],qs.prototype,"icon",2);Rl([te({type:Boolean,reflect:!0})],qs.prototype,"vertical",1);Rl([te({type:Boolean,attribute:"label-hidden",reflect:!0})],qs.prototype,"labelHidden",1);const S0=class Me{static set config(e){this._config={...Me._config,...e}}static get config(){return Me._config}static addGlobalStyles(){let e=document.querySelector("style[id='bim-ui']");if(e)return;e=document.createElement("style"),e.id="bim-ui",e.textContent=Qn.globalStyles.cssText;const t=document.head.firstChild;t?document.head.insertBefore(e,t):document.head.append(e)}static defineCustomElement(e,t){customElements.get(e)||customElements.define(e,t)}static registerComponents(){Me.init()}static init(){Me.addGlobalStyles(),Me.defineCustomElement("bim-button",LI),Me.defineCustomElement("bim-checkbox",js),Me.defineCustomElement("bim-color-input",Kn),Me.defineCustomElement("bim-context-menu",i0),Me.defineCustomElement("bim-dropdown",Ni),Me.defineCustomElement("bim-grid",Tu),Me.defineCustomElement("bim-icon",KI),Me.defineCustomElement("bim-input",go),Me.defineCustomElement("bim-label",qn),Me.defineCustomElement("bim-number-input",kt),Me.defineCustomElement("bim-option",at),Me.defineCustomElement("bim-panel",vo),Me.defineCustomElement("bim-panel-section",Ks),Me.defineCustomElement("bim-selector",Qs),Me.defineCustomElement("bim-table",un),Me.defineCustomElement("bim-tabs",Zs),Me.defineCustomElement("bim-tab",Ht),Me.defineCustomElement("bim-table-cell",f0),Me.defineCustomElement("bim-table-children",g0),Me.defineCustomElement("bim-table-group",y0),Me.defineCustomElement("bim-table-row",bo),Me.defineCustomElement("bim-text-input",Ui),Me.defineCustomElement("bim-toolbar",Pl),Me.defineCustomElement("bim-toolbar-group",_l),Me.defineCustomElement("bim-toolbar-section",qs),Me.defineCustomElement("bim-viewport",P0)}static newRandomId(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let t="";for(let i=0;i<10;i++){const n=Math.floor(Math.random()*e.length);t+=e.charAt(n)}return t}};S0._config={sectionLabelOnVerticalToolbar:!1};let zh=S0;var TC=Object.defineProperty,xC=Object.getOwnPropertyDescriptor,xu=(s,e,t,i)=>{for(var n=i>1?void 0:i?xC(e,t):e,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&TC(e,t,n),n};const _0=class extends Ue{constructor(){super(...arguments),this.labelsHidden=!1,this._vertical=!1,this._hidden=!1}set vertical(s){this._vertical=s,this.updateSections()}get vertical(){return this._vertical}set hidden(s){this._hidden=s,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}updateSections(){const s=this.children;for(const e of s)e instanceof qs&&(e.labelHidden=this.vertical&&!zh.config.sectionLabelOnVerticalToolbar,e.vertical=this.vertical)}render(){return pe` + `;let qs=A0;Pl([te({type:String,reflect:!0})],qs.prototype,"label",2);Pl([te({type:String,reflect:!0})],qs.prototype,"icon",2);Pl([te({type:Boolean,reflect:!0})],qs.prototype,"vertical",1);Pl([te({type:Boolean,attribute:"label-hidden",reflect:!0})],qs.prototype,"labelHidden",1);const S0=class Me{static set config(e){this._config={...Me._config,...e}}static get config(){return Me._config}static addGlobalStyles(){let e=document.querySelector("style[id='bim-ui']");if(e)return;e=document.createElement("style"),e.id="bim-ui",e.textContent=Qn.globalStyles.cssText;const t=document.head.firstChild;t?document.head.insertBefore(e,t):document.head.append(e)}static defineCustomElement(e,t){customElements.get(e)||customElements.define(e,t)}static registerComponents(){Me.init()}static init(){Me.addGlobalStyles(),Me.defineCustomElement("bim-button",LI),Me.defineCustomElement("bim-checkbox",js),Me.defineCustomElement("bim-color-input",Kn),Me.defineCustomElement("bim-context-menu",i0),Me.defineCustomElement("bim-dropdown",Ni),Me.defineCustomElement("bim-grid",Cu),Me.defineCustomElement("bim-icon",KI),Me.defineCustomElement("bim-input",go),Me.defineCustomElement("bim-label",qn),Me.defineCustomElement("bim-number-input",kt),Me.defineCustomElement("bim-option",at),Me.defineCustomElement("bim-panel",vo),Me.defineCustomElement("bim-panel-section",Ks),Me.defineCustomElement("bim-selector",Qs),Me.defineCustomElement("bim-table",un),Me.defineCustomElement("bim-tabs",Zs),Me.defineCustomElement("bim-tab",Ht),Me.defineCustomElement("bim-table-cell",f0),Me.defineCustomElement("bim-table-children",g0),Me.defineCustomElement("bim-table-group",y0),Me.defineCustomElement("bim-table-row",bo),Me.defineCustomElement("bim-text-input",Ui),Me.defineCustomElement("bim-toolbar",Ol),Me.defineCustomElement("bim-toolbar-group",Rl),Me.defineCustomElement("bim-toolbar-section",qs),Me.defineCustomElement("bim-viewport",P0)}static newRandomId(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let t="";for(let i=0;i<10;i++){const n=Math.floor(Math.random()*e.length);t+=e.charAt(n)}return t}};S0._config={sectionLabelOnVerticalToolbar:!1};let Vh=S0;var TC=Object.defineProperty,xC=Object.getOwnPropertyDescriptor,Tu=(s,e,t,i)=>{for(var n=i>1?void 0:i?xC(e,t):e,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&TC(e,t,n),n};const _0=class extends Ue{constructor(){super(...arguments),this.labelsHidden=!1,this._vertical=!1,this._hidden=!1}set vertical(s){this._vertical=s,this.updateSections()}get vertical(){return this._vertical}set hidden(s){this._hidden=s,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}updateSections(){const s=this.children;for(const e of s)e instanceof qs&&(e.labelHidden=this.vertical&&!Vh.config.sectionLabelOnVerticalToolbar,e.vertical=this.vertical)}render(){return pe`
@@ -3024,7 +3024,7 @@ void main() { border-bottom: 1px solid var(--bim-ui_bg-contrast-20); border-right: none; } - `;let Pl=_0;xu([te({type:String,reflect:!0})],Pl.prototype,"icon",2);xu([te({type:Boolean,attribute:"labels-hidden",reflect:!0})],Pl.prototype,"labelsHidden",2);xu([te({type:Boolean,reflect:!0})],Pl.prototype,"vertical",1);var AC=Object.defineProperty,SC=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=o(e,t,n)||n);return n&&AC(e,t,n),n};const R0=class extends Ue{constructor(){super(),this._onResize=new Event("resize"),new ResizeObserver(()=>{setTimeout(()=>{this.dispatchEvent(this._onResize)})}).observe(this)}render(){return pe` + `;let Ol=_0;Tu([te({type:String,reflect:!0})],Ol.prototype,"icon",2);Tu([te({type:Boolean,attribute:"labels-hidden",reflect:!0})],Ol.prototype,"labelsHidden",2);Tu([te({type:Boolean,reflect:!0})],Ol.prototype,"vertical",1);var AC=Object.defineProperty,SC=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=o(e,t,n)||n);return n&&AC(e,t,n),n};const R0=class extends Ue{constructor(){super(),this._onResize=new Event("resize"),new ResizeObserver(()=>{setTimeout(()=>{this.dispatchEvent(this._onResize)})}).observe(this)}render(){return pe`
@@ -3047,44 +3047,44 @@ void main() { icon="mage:box-3d-fill" @click=${()=>{const i=document.createElement("input");i.type="file",i.accept=".ifc",i.onchange=async()=>{if(i.files===null||i.files.length===0)return;const n=i.files[0];i.remove();const r=await n.arrayBuffer(),o=new Uint8Array(r),a=await t.load(o);a.name=n.name.replace(".ifc","")},i.click()}} > - `},RC=s=>Zn.create(_C,s),PC=Object.freeze(Object.defineProperty({__proto__:null,loadIfc:RC},Symbol.toStringTag,{value:"Module"}));({...PC});const FC=s=>{const{components:e}=s,t=e.get(zs),i=document.createElement("bim-table");i.columns=["Model"],i.headersHidden=!0;const n=[];for(const[,r]of t.groups){if(!r)continue;const o={data:{Model:r.name||r.uuid,Actions:r.uuid}};n.push(o)}return i.definition={Actions:r=>{if(typeof r!="string")return r;const o=t.groups.get(r);return o?pe` + `},RC=s=>Zn.create(_C,s),PC=Object.freeze(Object.defineProperty({__proto__:null,loadIfc:RC},Symbol.toStringTag,{value:"Module"}));({...PC});const OC=s=>{const{components:e}=s,t=e.get(zs),i=document.createElement("bim-table");i.columns=["Model"],i.headersHidden=!0;const n=[];for(const[,r]of t.groups){if(!r)continue;const o={data:{Model:r.name||r.uuid,Actions:r.uuid}};n.push(o)}return i.definition={Actions:r=>{if(typeof r!="string")return r;const o=t.groups.get(r);return o?pe` {o.visible=!o.visible;const l=a.target;l.icon=o.visible?"mdi:eye":"mdi:eye-off"}} icon="mdi:eye"> t.disposeGroup(o)} icon="mdi:delete"> `:r}},i.columns=["Model",{name:"Actions",width:"auto"}],i.data=n,pe`
${n.length===0?pe``:i}
- `},OC=(s,e=!0)=>{const t=Zn.create(FC,s);if(e){const{components:i}=s,n=i.get(zs),[,r]=t;n.onFragmentsLoaded.add(()=>setTimeout(()=>r())),n.onFragmentsDisposed.add(()=>r())}return t},MC=Object.freeze(Object.defineProperty({__proto__:null,modelsList:OC},Symbol.toStringTag,{value:"Module"})),F0=["Name","ContainedInStructure","ForLayerSet","LayerThickness","HasProperties","HasAssociations","HasAssignments","HasPropertySets","PredefinedType","Quantities","ReferencedSource","Identification",s=>s.includes("Value"),s=>s.startsWith("Material"),s=>s.startsWith("Relating"),s=>{const e=["IsGroupedBy","IsDecomposedBy"];return s.startsWith("Is")&&!e.includes(s)}];async function ka(s,e,t,i=F0,n=!1){const r=s.get(to),o=await e.getProperties(t);if(!o)return{data:{Entity:`${t} properties not found...`}};const a=r.relationMaps[e.uuid],l={data:{}};for(const h in o){const d=i.map(f=>typeof f=="string"?h===f:f(h)).includes(!0);if(!(h==="type"||d))continue;const p=o[h];if(p)if(p.type===5){l.children||(l.children=[]);const f=await ka(s,e,p.value,i,n);l.children.push(f)}else if(typeof p=="object"&&!Array.isArray(p)){const{value:f,type:g}=p;if(n)g===1||g===2||g===3||(l.data[h]=f);else{const y=typeof f=="number"?Number(f.toFixed(3)):f;l.data[h]=y}}else if(Array.isArray(p))for(const f of p){if(f.type!==5)continue;l.children||(l.children=[]);const g=await ka(s,e,f.value,i,n);l.children.push(g)}else if(h==="type"){const f=Hh[p];l.data.Entity=f}else l.data[h]=p}if(a&&a.get(o.expressID)){const h=a.get(o.expressID);for(const d of i){const p=[];if(typeof d=="string"){const f=r._inverseAttributes.indexOf(d);f!==-1&&p.push(f)}else{const f=r._inverseAttributes.filter(g=>d(g));for(const g of f){const y=r._inverseAttributes.indexOf(g);p.push(y)}}for(const f of p){const g=h.get(f);if(g)for(const y of g){const b=await ka(s,e,y,i,n);l.children||(l.children=[]),l.children.push(b)}}}}return l}const LC=s=>{const{components:e,fragmentIdMap:t,attributesToInclude:i,editable:n,tableDefinition:r}=s,o=e.get(zs);let a;return typeof i=="function"?a=i(F0):a=i,pe`{if(!l)return;const h=l,d=[],p=[];for(const f in t){const g=o.list.get(f);if(!(g&&g.group))continue;const y=g.group,b=p.find(w=>w.model===y);if(b)for(const w of t[f])b.expressIDs.add(w);else{const w={model:y,expressIDs:new Set(t[f])};p.push(w)}}for(const f of p){const{model:g,expressIDs:y}=f;for(const b of y){const w=await ka(e,g,b,a,n);d.push(w)}}h.definition=r,h.data=d,h.columns=[{name:"Entity",width:"minmax(15rem, 1fr)"}]})}>`},DC=s=>Zn.create(LC,s),NC=Object.freeze(Object.defineProperty({__proto__:null,entityAttributes:DC},Symbol.toStringTag,{value:"Module"}));function UC(s){const e=Object.keys(s).pop();return e&&s[e].length>0?s[e][0]:""}function O0(s){return s.map(e=>{const t={data:{System:UC(e.filter)}};return e.children&&e.children.length>0&&(t.children=O0(e.children)),t})}const kC=s=>{const{components:e,classifications:t}=s,i=e.get(Cv),n=r=>{if(!r)return;const o=r;o.definition={Actions:h=>h};const a=(h,d={})=>{const p=i.list,f=h[0],g=p[f],y=[];if(!f||!g)return y;for(const b in g){const w={...d,[f]:[b]},T=i.find(w);if(Object.keys(T).length>0){const S={filter:w};S.children=a(h.slice(1),w),y.push(S)}}return y},l=[];for(const h in t){const d=t[h],p=a(d),f=O0(p);l.push({data:{System:h},children:f})}o.data=l};return pe` + `},FC=(s,e=!0)=>{const t=Zn.create(OC,s);if(e){const{components:i}=s,n=i.get(zs),[,r]=t;n.onFragmentsLoaded.add(()=>setTimeout(()=>r())),n.onFragmentsDisposed.add(()=>r())}return t},MC=Object.freeze(Object.defineProperty({__proto__:null,modelsList:FC},Symbol.toStringTag,{value:"Module"})),O0=["Name","ContainedInStructure","ForLayerSet","LayerThickness","HasProperties","HasAssociations","HasAssignments","HasPropertySets","PredefinedType","Quantities","ReferencedSource","Identification",s=>s.includes("Value"),s=>s.startsWith("Material"),s=>s.startsWith("Relating"),s=>{const e=["IsGroupedBy","IsDecomposedBy"];return s.startsWith("Is")&&!e.includes(s)}];async function ka(s,e,t,i=O0,n=!1){const r=s.get(to),o=await e.getProperties(t);if(!o)return{data:{Entity:`${t} properties not found...`}};const a=r.relationMaps[e.uuid],l={data:{}};for(const h in o){const d=i.map(f=>typeof f=="string"?h===f:f(h)).includes(!0);if(!(h==="type"||d))continue;const p=o[h];if(p)if(p.type===5){l.children||(l.children=[]);const f=await ka(s,e,p.value,i,n);l.children.push(f)}else if(typeof p=="object"&&!Array.isArray(p)){const{value:f,type:g}=p;if(n)g===1||g===2||g===3||(l.data[h]=f);else{const v=typeof f=="number"?Number(f.toFixed(3)):f;l.data[h]=v}}else if(Array.isArray(p))for(const f of p){if(f.type!==5)continue;l.children||(l.children=[]);const g=await ka(s,e,f.value,i,n);l.children.push(g)}else if(h==="type"){const f=Yh[p];l.data.Entity=f}else l.data[h]=p}if(a&&a.get(o.expressID)){const h=a.get(o.expressID);for(const d of i){const p=[];if(typeof d=="string"){const f=r._inverseAttributes.indexOf(d);f!==-1&&p.push(f)}else{const f=r._inverseAttributes.filter(g=>d(g));for(const g of f){const v=r._inverseAttributes.indexOf(g);p.push(v)}}for(const f of p){const g=h.get(f);if(g)for(const v of g){const b=await ka(s,e,v,i,n);l.children||(l.children=[]),l.children.push(b)}}}}return l}const LC=s=>{const{components:e,fragmentIdMap:t,attributesToInclude:i,editable:n,tableDefinition:r}=s,o=e.get(zs);let a;return typeof i=="function"?a=i(O0):a=i,pe`{if(!l)return;const h=l,d=[],p=[];for(const f in t){const g=o.list.get(f);if(!(g&&g.group))continue;const v=g.group,b=p.find(w=>w.model===v);if(b)for(const w of t[f])b.expressIDs.add(w);else{const w={model:v,expressIDs:new Set(t[f])};p.push(w)}}for(const f of p){const{model:g,expressIDs:v}=f;for(const b of v){const w=await ka(e,g,b,a,n);d.push(w)}}h.definition=r,h.data=d,h.columns=[{name:"Entity",width:"minmax(15rem, 1fr)"}]})}>`},DC=s=>Zn.create(LC,s),NC=Object.freeze(Object.defineProperty({__proto__:null,entityAttributes:DC},Symbol.toStringTag,{value:"Module"}));function UC(s){const e=Object.keys(s).pop();return e&&s[e].length>0?s[e][0]:""}function F0(s){return s.map(e=>{const t={data:{System:UC(e.filter)}};return e.children&&e.children.length>0&&(t.children=F0(e.children)),t})}const kC=s=>{const{components:e,classifications:t}=s,i=e.get(Cv),n=r=>{if(!r)return;const o=r;o.definition={Actions:h=>h};const a=(h,d={})=>{const p=i.list,f=h[0],g=p[f],v=[];if(!f||!g)return v;for(const b in g){const w={...d,[f]:[b]},T=i.find(w);if(Object.keys(T).length>0){const S={filter:w};S.children=a(h.slice(1),w),v.push(S)}}return v},l=[];for(const h in t){const d=t[h],p=a(d),f=F0(p);l.push({data:{System:h},children:f})}o.data=l};return pe`
${Object.keys(t).length===0?pe``:pe``}
- `},BC=(s,e=!0)=>{const t=Zn.create(kC,s);if(e){const{components:i}=s,n=i.get(zs),[,r]=t;n.onFragmentsDisposed.add(()=>r())}return t},zC=Object.freeze(Object.defineProperty({__proto__:null,classificationTree:BC},Symbol.toStringTag,{value:"Module"})),VC=["OwnerHistory","ObjectPlacement","CompositionType"],$p=async(s,e,t)=>{const i={groupName:"Attributes",includeClass:!1,...t},{groupName:n,includeClass:r}=i,o=await s.getProperties(e)??{},a={data:{Name:n}};r&&(a.children||(a.children=[]),a.children.push({data:{Name:"Class",Value:Hh[o.type]}}));for(const l in o){if(VC.includes(l))continue;const h=o[l];if(h&&typeof h=="object"&&!Array.isArray(h)){if(h.type===$v)continue;const d={data:{Name:l,Value:h.value}};a.children||(a.children=[]),a.children.push(d)}}return a},HC=async(s,e)=>{const t={data:{Name:"Property Sets"}};for(const i of e){const n=await s.getProperties(i);if(!n)continue;const r={data:{Name:n.Name.value}};if(n.type===zr){for(const o of n.HasProperties){const{value:a}=o,l=await s.getProperties(a);if(!l)continue;const h=Object.keys(l).find(p=>p.includes("Value"));if(!(h&&l[h]))continue;const d={data:{Name:l.Name.value,Value:l[h].value}};r.children||(r.children=[]),r.children.push(d)}r.children&&(t.children||(t.children=[]),t.children.push(r))}}return t},YC=async(s,e)=>{const t={data:{Name:"Quantity Sets"}};for(const i of e){const n=await s.getProperties(i);if(!n)continue;const r={data:{Name:n.Name.value}};if(n.type===qh){for(const o of n.Quantities){const{value:a}=o,l=await s.getProperties(a);if(!l)continue;const h=Object.keys(l).find(p=>p.includes("Value"));if(!(h&&l[h]))continue;const d={data:{Name:l.Name.value,Value:l[h].value}};r.children||(r.children=[]),r.children.push(d)}r.children&&(t.children||(t.children=[]),t.children.push(r))}}return t},GC=async(s,e)=>{const t={data:{Name:"Materials"}};for(const i of e){const n=await s.getProperties(i);if(n.type===_f){const r=n.ForLayerSet.value,o=await s.getProperties(r);for(const a of o.MaterialLayers){const{value:l}=a,h=await s.getProperties(l),d=await s.getProperties(h.Material.value),p={data:{Name:"Layer"},children:[{data:{Name:"Thickness",Value:h.LayerThickness.value}},{data:{Name:"Material",Value:d.Name.value}}]};t.children||(t.children=[]),t.children.push(p)}}if(n.type===Pf)for(const r of n.Materials){const{value:o}=r,a={data:{Name:"Name",Value:(await s.getProperties(o)).Name.value}};t.children||(t.children=[]),t.children.push(a)}if(n.type===Rf){const r={data:{Name:"Name",Value:(await s.getProperties(i)).Name.value}};t.children||(t.children=[]),t.children.push(r)}}return t},jC=async(s,e)=>{const t={data:{Name:"Classifications"}};for(const i of e){const n=await s.getProperties(i);if(n.type===Ff){const{value:r}=n.ReferencedSource,o={data:{Name:(await s.getProperties(r)).Name.value},children:[{data:{Name:"Identification",Value:n.Identification.value}},{data:{Name:"Name",Value:n.Name.value}}]};t.children||(t.children=[]),t.children.push(o)}}return t},WC=s=>{const{components:e,fragmentIdMap:t}=s,i=e.get(to),n=e.get(zs);return pe`{var o;if(!r)return;const a=[],l=[];for(const d in t){const p=n.list.get(d);if(!(p&&p.group))continue;const f=p.group,g=l.find(y=>y.model===f);if(g)for(const y of t[d])g.expressIDs.add(y);else{const y={model:f,expressIDs:new Set(t[d])};l.push(y)}}for(const d in l){const{model:p,expressIDs:f}=l[d],g=i.relationMaps[p.uuid];if(!g)return;for(const y of f){const b=await p.getProperties(y);if(!b)continue;const w={data:{Name:(o=b.Name)==null?void 0:o.value,Value:""}};a.push(w);const T=await $p(p,y,{includeClass:!0});if(w.children||(w.children=[]),w.children.push(T),!g.get(y))continue;const S=i.getEntityRelations(p,y,"IsDefinedBy");if(S){const P=S.filter(async W=>{const j=await p.getProperties(W);return j?j.type===zr:!1}),M=await HC(p,P);M.children&&w.children.push(M);const k=S.filter(async W=>{const j=await p.getProperties(W);return j?j.type===qh:!1}),V=await YC(p,k);V.children&&w.children.push(V)}const _=i.getEntityRelations(p,y,"HasAssociations");if(_){const P=_.filter(async W=>{const j=await p.getProperties(W);return j?j.type===_f||j.type===qv||j.type===Jv||j.type===Rf||j.type===Pf:!1}),M=await GC(p,P);M.children&&w.children.push(M);const k=_.filter(async W=>{const j=await p.getProperties(W);return j?j.type===Ff:!1}),V=await jC(p,k);V.children&&w.children.push(V)}const I=i.getEntityRelations(p,y,"ContainedInStructure");if(I){const P=I[0],M=await $p(p,P,{groupName:"SpatialContainer"});w.children.push(M)}}}const h=r;h.columns=[{name:"Name",width:"12rem"}],h.data=a})} headers-hidden>`},XC=s=>Zn.create(WC,s),KC=Object.freeze(Object.defineProperty({__proto__:null,elementProperties:XC},Symbol.toStringTag,{value:"Module"})),Vh=async(s,e,t,i)=>{var n;const r=[],o=s.get(to),a=await e.getProperties(t);if(!a)return r;const{type:l}=a,h={data:{Entity:Hh[l],Name:(n=a.Name)==null?void 0:n.value}};for(const d of i){const p=o.getEntityRelations(e,t,d);if(p)for(const f of p){const g=await Vh(s,e,f,i);h.children||(h.children=[]),h.children.push(...g)}}return r.push(h),r},QC=s=>{const{components:e,models:t,inverseAttributes:i,expressID:n}=s,r=i??["IsDecomposedBy","ContainsElements"];return pe`{if(!o)return;const a=e.get(to),l=[];for(const d of t){let p;if(n)p={data:{Entity:d.name!==""?d.name:d.uuid},children:await Vh(e,d,n,r)};else{const f=a.relationMaps[d.uuid],g=await d.getAllPropertiesOfType(pl);if(!(f&&g))continue;const{expressID:y}=Object.values(g)[0];p={data:{Entity:d.name!==""?d.name:d.uuid},children:await Vh(e,d,y,r)}}l.push(p)}const h=o;h.columns=["Entity","Name"],h.data=l})} headers-hidden>`},ZC=(s,e=!0)=>{const t=Zn.create(QC,s);if(e){const[,i]=t,{components:n}=s,r=n.get(zs),o=n.get(to),a=()=>i({models:r.groups.values()});o.onRelationsIndexed.add(a),r.onFragmentsDisposed.add(a)}return t},qC=Object.freeze(Object.defineProperty({__proto__:null,relationsTree:ZC},Symbol.toStringTag,{value:"Module"}));({...MC,...NC,...zC,...KC,...qC});/** + `},BC=(s,e=!0)=>{const t=Zn.create(kC,s);if(e){const{components:i}=s,n=i.get(zs),[,r]=t;n.onFragmentsDisposed.add(()=>r())}return t},zC=Object.freeze(Object.defineProperty({__proto__:null,classificationTree:BC},Symbol.toStringTag,{value:"Module"})),VC=["OwnerHistory","ObjectPlacement","CompositionType"],Jp=async(s,e,t)=>{const i={groupName:"Attributes",includeClass:!1,...t},{groupName:n,includeClass:r}=i,o=await s.getProperties(e)??{},a={data:{Name:n}};r&&(a.children||(a.children=[]),a.children.push({data:{Name:"Class",Value:Yh[o.type]}}));for(const l in o){if(VC.includes(l))continue;const h=o[l];if(h&&typeof h=="object"&&!Array.isArray(h)){if(h.type===$v)continue;const d={data:{Name:l,Value:h.value}};a.children||(a.children=[]),a.children.push(d)}}return a},HC=async(s,e)=>{const t={data:{Name:"Property Sets"}};for(const i of e){const n=await s.getProperties(i);if(!n)continue;const r={data:{Name:n.Name.value}};if(n.type===zr){for(const o of n.HasProperties){const{value:a}=o,l=await s.getProperties(a);if(!l)continue;const h=Object.keys(l).find(p=>p.includes("Value"));if(!(h&&l[h]))continue;const d={data:{Name:l.Name.value,Value:l[h].value}};r.children||(r.children=[]),r.children.push(d)}r.children&&(t.children||(t.children=[]),t.children.push(r))}}return t},YC=async(s,e)=>{const t={data:{Name:"Quantity Sets"}};for(const i of e){const n=await s.getProperties(i);if(!n)continue;const r={data:{Name:n.Name.value}};if(n.type===Jh){for(const o of n.Quantities){const{value:a}=o,l=await s.getProperties(a);if(!l)continue;const h=Object.keys(l).find(p=>p.includes("Value"));if(!(h&&l[h]))continue;const d={data:{Name:l.Name.value,Value:l[h].value}};r.children||(r.children=[]),r.children.push(d)}r.children&&(t.children||(t.children=[]),t.children.push(r))}}return t},GC=async(s,e)=>{const t={data:{Name:"Materials"}};for(const i of e){const n=await s.getProperties(i);if(n.type===Sf){const r=n.ForLayerSet.value,o=await s.getProperties(r);for(const a of o.MaterialLayers){const{value:l}=a,h=await s.getProperties(l),d=await s.getProperties(h.Material.value),p={data:{Name:"Layer"},children:[{data:{Name:"Thickness",Value:h.LayerThickness.value}},{data:{Name:"Material",Value:d.Name.value}}]};t.children||(t.children=[]),t.children.push(p)}}if(n.type===Rf)for(const r of n.Materials){const{value:o}=r,a={data:{Name:"Name",Value:(await s.getProperties(o)).Name.value}};t.children||(t.children=[]),t.children.push(a)}if(n.type===_f){const r={data:{Name:"Name",Value:(await s.getProperties(i)).Name.value}};t.children||(t.children=[]),t.children.push(r)}}return t},jC=async(s,e)=>{const t={data:{Name:"Classifications"}};for(const i of e){const n=await s.getProperties(i);if(n.type===Pf){const{value:r}=n.ReferencedSource,o={data:{Name:(await s.getProperties(r)).Name.value},children:[{data:{Name:"Identification",Value:n.Identification.value}},{data:{Name:"Name",Value:n.Name.value}}]};t.children||(t.children=[]),t.children.push(o)}}return t},WC=s=>{const{components:e,fragmentIdMap:t}=s,i=e.get(to),n=e.get(zs);return pe`{var o;if(!r)return;const a=[],l=[];for(const d in t){const p=n.list.get(d);if(!(p&&p.group))continue;const f=p.group,g=l.find(v=>v.model===f);if(g)for(const v of t[d])g.expressIDs.add(v);else{const v={model:f,expressIDs:new Set(t[d])};l.push(v)}}for(const d in l){const{model:p,expressIDs:f}=l[d],g=i.relationMaps[p.uuid];if(!g)return;for(const v of f){const b=await p.getProperties(v);if(!b)continue;const w={data:{Name:(o=b.Name)==null?void 0:o.value,Value:""}};a.push(w);const T=await Jp(p,v,{includeClass:!0});if(w.children||(w.children=[]),w.children.push(T),!g.get(v))continue;const S=i.getEntityRelations(p,v,"IsDefinedBy");if(S){const P=S.filter(async W=>{const j=await p.getProperties(W);return j?j.type===zr:!1}),M=await HC(p,P);M.children&&w.children.push(M);const k=S.filter(async W=>{const j=await p.getProperties(W);return j?j.type===Jh:!1}),V=await YC(p,k);V.children&&w.children.push(V)}const _=i.getEntityRelations(p,v,"HasAssociations");if(_){const P=_.filter(async W=>{const j=await p.getProperties(W);return j?j.type===Sf||j.type===qv||j.type===Jv||j.type===_f||j.type===Rf:!1}),M=await GC(p,P);M.children&&w.children.push(M);const k=_.filter(async W=>{const j=await p.getProperties(W);return j?j.type===Pf:!1}),V=await jC(p,k);V.children&&w.children.push(V)}const I=i.getEntityRelations(p,v,"ContainedInStructure");if(I){const P=I[0],M=await Jp(p,P,{groupName:"SpatialContainer"});w.children.push(M)}}}const h=r;h.columns=[{name:"Name",width:"12rem"}],h.data=a})} headers-hidden>`},XC=s=>Zn.create(WC,s),KC=Object.freeze(Object.defineProperty({__proto__:null,elementProperties:XC},Symbol.toStringTag,{value:"Module"})),Hh=async(s,e,t,i)=>{var n;const r=[],o=s.get(to),a=await e.getProperties(t);if(!a)return r;const{type:l}=a,h={data:{Entity:Yh[l],Name:(n=a.Name)==null?void 0:n.value}};for(const d of i){const p=o.getEntityRelations(e,t,d);if(p)for(const f of p){const g=await Hh(s,e,f,i);h.children||(h.children=[]),h.children.push(...g)}}return r.push(h),r},QC=s=>{const{components:e,models:t,inverseAttributes:i,expressID:n}=s,r=i??["IsDecomposedBy","ContainsElements"];return pe`{if(!o)return;const a=e.get(to),l=[];for(const d of t){let p;if(n)p={data:{Entity:d.name!==""?d.name:d.uuid},children:await Hh(e,d,n,r)};else{const f=a.relationMaps[d.uuid],g=await d.getAllPropertiesOfType(pl);if(!(f&&g))continue;const{expressID:v}=Object.values(g)[0];p={data:{Entity:d.name!==""?d.name:d.uuid},children:await Hh(e,d,v,r)}}l.push(p)}const h=o;h.columns=["Entity","Name"],h.data=l})} headers-hidden>`},ZC=(s,e=!0)=>{const t=Zn.create(QC,s);if(e){const[,i]=t,{components:n}=s,r=n.get(zs),o=n.get(to),a=()=>i({models:r.groups.values()});o.onRelationsIndexed.add(a),r.onFragmentsDisposed.add(a)}return t},qC=Object.freeze(Object.defineProperty({__proto__:null,relationsTree:ZC},Symbol.toStringTag,{value:"Module"}));({...MC,...NC,...zC,...KC,...qC});/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const Ba=globalThis,Au=Ba.ShadowRoot&&(Ba.ShadyCSS===void 0||Ba.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Su=Symbol(),ef=new WeakMap;let M0=class{constructor(s,e,t){if(this._$cssResult$=!0,t!==Su)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=s,this.t=e}get styleSheet(){let s=this.o;const e=this.t;if(Au&&s===void 0){const t=e!==void 0&&e.length===1;t&&(s=ef.get(e)),s===void 0&&((this.o=s=new CSSStyleSheet).replaceSync(this.cssText),t&&ef.set(e,s))}return s}toString(){return this.cssText}};const JC=s=>new M0(typeof s=="string"?s:s+"",void 0,Su),L0=(s,...e)=>{const t=s.length===1?s[0]:e.reduce((i,n,r)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+s[r+1],s[0]);return new M0(t,s,Su)},$C=(s,e)=>{if(Au)s.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),n=Ba.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=t.cssText,s.appendChild(i)}},tf=Au?s=>s:s=>s instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return JC(t)})(s):s;/** + */const Ba=globalThis,xu=Ba.ShadowRoot&&(Ba.ShadyCSS===void 0||Ba.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Au=Symbol(),$p=new WeakMap;let M0=class{constructor(s,e,t){if(this._$cssResult$=!0,t!==Au)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=s,this.t=e}get styleSheet(){let s=this.o;const e=this.t;if(xu&&s===void 0){const t=e!==void 0&&e.length===1;t&&(s=$p.get(e)),s===void 0&&((this.o=s=new CSSStyleSheet).replaceSync(this.cssText),t&&$p.set(e,s))}return s}toString(){return this.cssText}};const JC=s=>new M0(typeof s=="string"?s:s+"",void 0,Au),L0=(s,...e)=>{const t=s.length===1?s[0]:e.reduce((i,n,r)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+s[r+1],s[0]);return new M0(t,s,Au)},$C=(s,e)=>{if(xu)s.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),n=Ba.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=t.cssText,s.appendChild(i)}},ef=xu?s=>s:s=>s instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return JC(t)})(s):s;/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const{is:eT,defineProperty:tT,getOwnPropertyDescriptor:iT,getOwnPropertyNames:nT,getOwnPropertySymbols:sT,getPrototypeOf:rT}=Object,Us=globalThis,nf=Us.trustedTypes,oT=nf?nf.emptyScript:"",sf=Us.reactiveElementPolyfillSupport,Br=(s,e)=>s,sl={toAttribute(s,e){switch(e){case Boolean:s=s?oT:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,e){let t=s;switch(e){case Boolean:t=s!==null;break;case Number:t=s===null?null:Number(s);break;case Object:case Array:try{t=JSON.parse(s)}catch{t=null}}return t}},_u=(s,e)=>!eT(s,e),rf={attribute:!0,type:String,converter:sl,reflect:!1,hasChanged:_u};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Us.litPropertyMetadata??(Us.litPropertyMetadata=new WeakMap);class Ts extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=rf){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(e,i,t);n!==void 0&&tT(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){const{get:n,set:r}=iT(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return n==null?void 0:n.call(this)},set(o){const a=n==null?void 0:n.call(this);r.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??rf}static _$Ei(){if(this.hasOwnProperty(Br("elementProperties")))return;const e=rT(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Br("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Br("properties"))){const t=this.properties,i=[...nT(t),...sT(t)];for(const n of i)this.createProperty(n,t[n])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,n]of t)this.elementProperties.set(i,n)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const n=this._$Eu(t,i);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const n of i)t.unshift(tf(n))}else e!==void 0&&t.push(tf(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return $C(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EC(e,t){var i;const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&n.reflect===!0){const o=(((i=n.converter)==null?void 0:i.toAttribute)!==void 0?n.converter:sl).toAttribute(t,n.type);this._$Em=e,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(e,t){var i;const n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const o=n.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)==null?void 0:i.fromAttribute)!==void 0?o.converter:sl;this._$Em=r,this[r]=a.fromAttribute(t,o.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??_u)(this[e],t))return;this.P(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[r,o]of n)o.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],o)}let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),(e=this._$EO)==null||e.forEach(n=>{var r;return(r=n.hostUpdate)==null?void 0:r.call(n)}),this.update(i)):this._$EU()}catch(n){throw t=!1,this._$EU(),n}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(i=>{var n;return(n=i.hostUpdated)==null?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}}Ts.elementStyles=[],Ts.shadowRootOptions={mode:"open"},Ts[Br("elementProperties")]=new Map,Ts[Br("finalized")]=new Map,sf==null||sf({ReactiveElement:Ts}),(Us.reactiveElementVersions??(Us.reactiveElementVersions=[])).push("2.0.4");/** + */const{is:eT,defineProperty:tT,getOwnPropertyDescriptor:iT,getOwnPropertyNames:nT,getOwnPropertySymbols:sT,getPrototypeOf:rT}=Object,Us=globalThis,tf=Us.trustedTypes,oT=tf?tf.emptyScript:"",nf=Us.reactiveElementPolyfillSupport,Br=(s,e)=>s,sl={toAttribute(s,e){switch(e){case Boolean:s=s?oT:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,e){let t=s;switch(e){case Boolean:t=s!==null;break;case Number:t=s===null?null:Number(s);break;case Object:case Array:try{t=JSON.parse(s)}catch{t=null}}return t}},Su=(s,e)=>!eT(s,e),sf={attribute:!0,type:String,converter:sl,reflect:!1,hasChanged:Su};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Us.litPropertyMetadata??(Us.litPropertyMetadata=new WeakMap);class Ts extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=sf){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(e,i,t);n!==void 0&&tT(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){const{get:n,set:r}=iT(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return n==null?void 0:n.call(this)},set(o){const a=n==null?void 0:n.call(this);r.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??sf}static _$Ei(){if(this.hasOwnProperty(Br("elementProperties")))return;const e=rT(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Br("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Br("properties"))){const t=this.properties,i=[...nT(t),...sT(t)];for(const n of i)this.createProperty(n,t[n])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,n]of t)this.elementProperties.set(i,n)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const n=this._$Eu(t,i);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const n of i)t.unshift(ef(n))}else e!==void 0&&t.push(ef(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return $C(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EC(e,t){var i;const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&n.reflect===!0){const o=(((i=n.converter)==null?void 0:i.toAttribute)!==void 0?n.converter:sl).toAttribute(t,n.type);this._$Em=e,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(e,t){var i;const n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const o=n.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)==null?void 0:i.fromAttribute)!==void 0?o.converter:sl;this._$Em=r,this[r]=a.fromAttribute(t,o.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??Su)(this[e],t))return;this.P(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[r,o]of n)o.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],o)}let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),(e=this._$EO)==null||e.forEach(n=>{var r;return(r=n.hostUpdate)==null?void 0:r.call(n)}),this.update(i)):this._$EU()}catch(n){throw t=!1,this._$EU(),n}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(i=>{var n;return(n=i.hostUpdated)==null?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}}Ts.elementStyles=[],Ts.shadowRootOptions={mode:"open"},Ts[Br("elementProperties")]=new Map,Ts[Br("finalized")]=new Map,nf==null||nf({ReactiveElement:Ts}),(Us.reactiveElementVersions??(Us.reactiveElementVersions=[])).push("2.0.4");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const rl=globalThis,ol=rl.trustedTypes,of=ol?ol.createPolicy("lit-html",{createHTML:s=>s}):void 0,D0="$lit$",qi=`lit$${Math.random().toFixed(9).slice(2)}$`,N0="?"+qi,aT=`<${N0}>`,Yn=document,Jr=()=>Yn.createComment(""),$r=s=>s===null||typeof s!="object"&&typeof s!="function",U0=Array.isArray,lT=s=>U0(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",Xc=`[ -\f\r]`,Pr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,af=/-->/g,lf=/>/g,Rn=RegExp(`>|${Xc}(?:([^\\s"'>=/]+)(${Xc}*=${Xc}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),cf=/'/g,hf=/"/g,k0=/^(?:script|style|textarea|title)$/i,cT=s=>(e,...t)=>({_$litType$:s,strings:e,values:t}),B0=cT(1),ks=Symbol.for("lit-noChange"),dt=Symbol.for("lit-nothing"),uf=new WeakMap,Ln=Yn.createTreeWalker(Yn,129);function z0(s,e){if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return of!==void 0?of.createHTML(e):e}const hT=(s,e)=>{const t=s.length-1,i=[];let n,r=e===2?"":"",o=Pr;for(let a=0;a"?(o=n??Pr,p=-1):d[1]===void 0?p=-2:(p=o.lastIndex-d[2].length,h=d[1],o=d[3]===void 0?Rn:d[3]==='"'?hf:cf):o===hf||o===cf?o=Rn:o===af||o===lf?o=Pr:(o=Rn,n=void 0);const g=o===Rn&&s[a+1].startsWith("/>")?" ":"";r+=o===Pr?l+aT:p>=0?(i.push(h),l.slice(0,p)+D0+l.slice(p)+qi+g):l+qi+(p===-2?a:g)}return[z0(s,r+(s[t]||"")+(e===2?"":"")),i]};class eo{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let r=0,o=0;const a=e.length-1,l=this.parts,[h,d]=hT(e,t);if(this.el=eo.createElement(h,i),Ln.currentNode=this.el.content,t===2){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(n=Ln.nextNode())!==null&&l.length0){n.textContent=ol?ol.emptyScript:"";for(let g=0;g2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=dt}_$AI(e,t=this,i,n){const r=this.strings;let o=!1;if(r===void 0)e=Bs(this,e,t,0),o=!$r(e)||e!==this._$AH&&e!==ks,o&&(this._$AH=e);else{const a=e;let l,h;for(e=r[0],l=0;l{const i=(t==null?void 0:t.renderBefore)??e;let n=i._$litPart$;if(n===void 0){const r=(t==null?void 0:t.renderBefore)??null;i._$litPart$=n=new Io(e.insertBefore(Jr(),r),r,void 0,t??{})}return n._$AI(s),n};/** + */const rl=globalThis,ol=rl.trustedTypes,rf=ol?ol.createPolicy("lit-html",{createHTML:s=>s}):void 0,D0="$lit$",qi=`lit$${Math.random().toFixed(9).slice(2)}$`,N0="?"+qi,aT=`<${N0}>`,Yn=document,Jr=()=>Yn.createComment(""),$r=s=>s===null||typeof s!="object"&&typeof s!="function",U0=Array.isArray,lT=s=>U0(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",Kc=`[ +\f\r]`,Pr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,of=/-->/g,af=/>/g,Rn=RegExp(`>|${Kc}(?:([^\\s"'>=/]+)(${Kc}*=${Kc}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),lf=/'/g,cf=/"/g,k0=/^(?:script|style|textarea|title)$/i,cT=s=>(e,...t)=>({_$litType$:s,strings:e,values:t}),B0=cT(1),ks=Symbol.for("lit-noChange"),dt=Symbol.for("lit-nothing"),hf=new WeakMap,Ln=Yn.createTreeWalker(Yn,129);function z0(s,e){if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return rf!==void 0?rf.createHTML(e):e}const hT=(s,e)=>{const t=s.length-1,i=[];let n,r=e===2?"":"",o=Pr;for(let a=0;a"?(o=n??Pr,p=-1):d[1]===void 0?p=-2:(p=o.lastIndex-d[2].length,h=d[1],o=d[3]===void 0?Rn:d[3]==='"'?cf:lf):o===cf||o===lf?o=Rn:o===of||o===af?o=Pr:(o=Rn,n=void 0);const g=o===Rn&&s[a+1].startsWith("/>")?" ":"";r+=o===Pr?l+aT:p>=0?(i.push(h),l.slice(0,p)+D0+l.slice(p)+qi+g):l+qi+(p===-2?a:g)}return[z0(s,r+(s[t]||"")+(e===2?"":"")),i]};class eo{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let r=0,o=0;const a=e.length-1,l=this.parts,[h,d]=hT(e,t);if(this.el=eo.createElement(h,i),Ln.currentNode=this.el.content,t===2){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(n=Ln.nextNode())!==null&&l.length0){n.textContent=ol?ol.emptyScript:"";for(let g=0;g2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=dt}_$AI(e,t=this,i,n){const r=this.strings;let o=!1;if(r===void 0)e=Bs(this,e,t,0),o=!$r(e)||e!==this._$AH&&e!==ks,o&&(this._$AH=e);else{const a=e;let l,h;for(e=r[0],l=0;l{const i=(t==null?void 0:t.renderBefore)??e;let n=i._$litPart$;if(n===void 0){const r=(t==null?void 0:t.renderBefore)??null;i._$litPart$=n=new Io(e.insertBefore(Jr(),r),r,void 0,t??{})}return n._$AI(s),n};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */class Rs extends Ts{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=gT(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return ks}}var pf;Rs._$litElement$=!0,Rs.finalized=!0,(pf=globalThis.litElementHydrateSupport)==null||pf.call(globalThis,{LitElement:Rs});const ff=globalThis.litElementPolyfillSupport;ff==null||ff({LitElement:Rs});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.5");/** + */class Rs extends Ts{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=gT(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return ks}}var df;Rs._$litElement$=!0,Rs.finalized=!0,(df=globalThis.litElementHydrateSupport)==null||df.call(globalThis,{LitElement:Rs});const pf=globalThis.litElementPolyfillSupport;pf==null||pf({LitElement:Rs});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.5");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const vT={attribute:!0,type:String,converter:sl,reflect:!1,hasChanged:_u},yT=(s=vT,e,t)=>{const{kind:i,metadata:n}=t;let r=globalThis.litPropertyMetadata.get(n);if(r===void 0&&globalThis.litPropertyMetadata.set(n,r=new Map),r.set(t.name,s),i==="accessor"){const{name:o}=t;return{set(a){const l=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,l,s)},init(a){return a!==void 0&&this.P(o,void 0,s),a}}}if(i==="setter"){const{name:o}=t;return function(a){const l=this[o];e.call(this,a),this.requestUpdate(o,l,s)}}throw Error("Unsupported decorator location: "+i)};function oi(s){return(e,t)=>typeof t=="object"?yT(s,e,t):((i,n,r)=>{const o=n.hasOwnProperty(r);return n.constructor.createProperty(r,o?{...i,wrapped:!0}:i),o?Object.getOwnPropertyDescriptor(n,r):void 0})(s,e,t)}/** + */const vT={attribute:!0,type:String,converter:sl,reflect:!1,hasChanged:Su},yT=(s=vT,e,t)=>{const{kind:i,metadata:n}=t;let r=globalThis.litPropertyMetadata.get(n);if(r===void 0&&globalThis.litPropertyMetadata.set(n,r=new Map),r.set(t.name,s),i==="accessor"){const{name:o}=t;return{set(a){const l=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,l,s)},init(a){return a!==void 0&&this.P(o,void 0,s),a}}}if(i==="setter"){const{name:o}=t;return function(a){const l=this[o];e.call(this,a),this.requestUpdate(o,l,s)}}throw Error("Unsupported decorator location: "+i)};function oi(s){return(e,t)=>typeof t=="object"?yT(s,e,t):((i,n,r)=>{const o=n.hasOwnProperty(r);return n.constructor.createProperty(r,o?{...i,wrapped:!0}:i),o?Object.getOwnPropertyDescriptor(n,r):void 0})(s,e,t)}/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */function ET(s){return oi({...s,state:!0,attribute:!1})}class bT extends kn{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new Ve(.5,.5),this.addEventListener("removed",function(){this.traverse(function(t){t.element instanceof Element&&t.element.parentNode!==null&&t.element.parentNode.removeChild(t.element)})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}new F;new Ee;new Ee;new F;new F;class wT{constructor(e,t){this._group=new Fs,this._frustum=new Zv,this._frustumMat=new Ee,this._regenerateDelay=200,this._regenerateCounter=0,this.material=new Di({color:"#2e3338"}),this.numbers=new Fs,this.maxRegenerateRetrys=4,this.gridsFactor=5,this._scaleX=1,this._scaleY=1,this._camera=e,this._container=t;const i=this.newGrid(-1),n=this.newGrid(-2);this.grids={main:i,secondary:n},this._group.add(n,i,this.numbers)}set scaleX(e){this._scaleX=e,this.regenerate()}get scaleX(){return this._scaleX}set scaleY(e){this._scaleY=e,this.regenerate()}get scaleY(){return this._scaleY}get(){return this._group}dispose(){const{main:e,secondary:t}=this.grids;e.removeFromParent(),t.removeFromParent(),e.geometry.dispose(),e.material.dispose(),t.geometry.dispose(),t.material.dispose()}regenerate(){if(!this.isGridReady()){if(this._regenerateCounter++,this._regenerateCounter>this.maxRegenerateRetrys)throw new Error("Grid could not be regenerated");setTimeout(()=>this.regenerate,this._regenerateDelay);return}this._regenerateCounter=0,this._camera.updateMatrix(),this._camera.updateMatrixWorld();const e=this._frustumMat.multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse);this._frustum.setFromProjectionMatrix(e);const{planes:t}=this._frustum,i=t[0].constant*-t[0].normal.x,n=t[1].constant*-t[1].normal.x,r=t[2].constant*-t[2].normal.y,o=t[3].constant*-t[3].normal.y,a=Math.abs(i-n),l=Math.abs(o-r),{clientWidth:h,clientHeight:d}=this._container,p=Math.max(h,d),f=Math.max(a,l)/p,g=Math.ceil(Math.log10(a/this.scaleX)),y=Math.ceil(Math.log10(l/this.scaleY)),b=10**(g-2)*this.scaleX,w=10**(y-2)*this.scaleY,T=b*this.gridsFactor,S=w*this.gridsFactor,_=Math.ceil(l/S),I=Math.ceil(a/T),P=Math.ceil(l/w),M=Math.ceil(a/b),k=b*Math.ceil(n/b),V=w*Math.ceil(r/w),W=T*Math.ceil(n/T),j=S*Math.ceil(r/S),Q=[...this.numbers.children];for(const je of Q)je.removeFromParent();this.numbers.children=[];const $=[],ne=9*f,oe=1e4,ve=Math.round(Math.abs(W/this.scaleX)*oe)/oe,re=(I-1)*T,ge=Math.round(Math.abs((W+re)/this.scaleX)*oe)/oe,me=Math.max(ve,ge).toString().length*ne;let we=Math.ceil(me/T)*T;for(let je=0;je.01)continue;const fe=this.newNumber(It),We=12*f;fe.position.set(ke,r+We,0)}for(let je=0;je<_;je++){const ke=j+je*S;$.push(n,ke,0,i,ke,0);const It=this.newNumber(ke/this.scaleY);let He=12;It.element.textContent&&(He+=4*It.element.textContent.length);const fe=He*f;It.position.set(n+fe,ke,0)}const Ge=[];for(let je=0;je{for(var n=CT(e,t),r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=o(e,t,n)||n);return n&&IT(e,t,n),n};const V0=class extends Rs{constructor(){super(...arguments),this._grid=null,this._world=null,this.resize=()=>{this._world&&this._grid&&this._grid.regenerate()}}set gridColor(e){if(this._gridColor=e,!(e&&this._grid))return;const t=Number(e.replace("#","0x"));Number.isNaN(t)||this._grid.material.color.setHex(t)}get gridColor(){return this._gridColor}set gridScaleX(e){this._gridScaleX=e,e&&this._grid&&(this._grid.scaleX=e)}get gridScaleX(){return this._gridScaleX}set gridScaleY(e){this._gridScaleY=e,e&&this._grid&&(this._grid.scaleY=e)}get gridScaleY(){return this._gridScaleY}set components(e){this.dispose();const t=e.get(Ev).create();this._world=t,t.scene=new bv(e),t.scene.setup(),t.renderer=new Am(e,this);const i=new wv(e);t.camera=i;const n=new wT(i.threeOrtho,this);this._grid=n,t.scene.three.add(n.get()),i.controls.addEventListener("update",()=>n.regenerate()),setTimeout(async()=>{t.camera.updateAspect(),i.set("Plan"),await i.controls.setLookAt(0,0,100,0,0,0),await i.projection.set("Orthographic"),i.controls.dollySpeed=3,i.controls.draggingSmoothTime=.085,i.controls.maxZoom=1e3,i.controls.zoom(4)})}get world(){return this._world}dispose(){var e;(e=this.world)==null||e.dispose(),this._world=null,this._grid=null}connectedCallback(){super.connectedCallback(),new ResizeObserver(this.resize).observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.dispose()}render(){return B0``}};V0.styles=L0` + */function ET(s){return oi({...s,state:!0,attribute:!1})}class bT extends kn{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new Ve(.5,.5),this.addEventListener("removed",function(){this.traverse(function(t){t.element instanceof Element&&t.element.parentNode!==null&&t.element.parentNode.removeChild(t.element)})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}new O;new Ee;new Ee;new O;new O;class wT{constructor(e,t){this._group=new Os,this._frustum=new Zv,this._frustumMat=new Ee,this._regenerateDelay=200,this._regenerateCounter=0,this.material=new Di({color:"#2e3338"}),this.numbers=new Os,this.maxRegenerateRetrys=4,this.gridsFactor=5,this._scaleX=1,this._scaleY=1,this._camera=e,this._container=t;const i=this.newGrid(-1),n=this.newGrid(-2);this.grids={main:i,secondary:n},this._group.add(n,i,this.numbers)}set scaleX(e){this._scaleX=e,this.regenerate()}get scaleX(){return this._scaleX}set scaleY(e){this._scaleY=e,this.regenerate()}get scaleY(){return this._scaleY}get(){return this._group}dispose(){const{main:e,secondary:t}=this.grids;e.removeFromParent(),t.removeFromParent(),e.geometry.dispose(),e.material.dispose(),t.geometry.dispose(),t.material.dispose()}regenerate(){if(!this.isGridReady()){if(this._regenerateCounter++,this._regenerateCounter>this.maxRegenerateRetrys)throw new Error("Grid could not be regenerated");setTimeout(()=>this.regenerate,this._regenerateDelay);return}this._regenerateCounter=0,this._camera.updateMatrix(),this._camera.updateMatrixWorld();const e=this._frustumMat.multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse);this._frustum.setFromProjectionMatrix(e);const{planes:t}=this._frustum,i=t[0].constant*-t[0].normal.x,n=t[1].constant*-t[1].normal.x,r=t[2].constant*-t[2].normal.y,o=t[3].constant*-t[3].normal.y,a=Math.abs(i-n),l=Math.abs(o-r),{clientWidth:h,clientHeight:d}=this._container,p=Math.max(h,d),f=Math.max(a,l)/p,g=Math.ceil(Math.log10(a/this.scaleX)),v=Math.ceil(Math.log10(l/this.scaleY)),b=10**(g-2)*this.scaleX,w=10**(v-2)*this.scaleY,T=b*this.gridsFactor,S=w*this.gridsFactor,_=Math.ceil(l/S),I=Math.ceil(a/T),P=Math.ceil(l/w),M=Math.ceil(a/b),k=b*Math.ceil(n/b),V=w*Math.ceil(r/w),W=T*Math.ceil(n/T),j=S*Math.ceil(r/S),Q=[...this.numbers.children];for(const je of Q)je.removeFromParent();this.numbers.children=[];const $=[],ne=9*f,oe=1e4,ve=Math.round(Math.abs(W/this.scaleX)*oe)/oe,re=(I-1)*T,ge=Math.round(Math.abs((W+re)/this.scaleX)*oe)/oe,me=Math.max(ve,ge).toString().length*ne;let we=Math.ceil(me/T)*T;for(let je=0;je.01)continue;const fe=this.newNumber(It),We=12*f;fe.position.set(ke,r+We,0)}for(let je=0;je<_;je++){const ke=j+je*S;$.push(n,ke,0,i,ke,0);const It=this.newNumber(ke/this.scaleY);let He=12;It.element.textContent&&(He+=4*It.element.textContent.length);const fe=He*f;It.position.set(n+fe,ke,0)}const Ge=[];for(let je=0;je{for(var n=CT(e,t),r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=o(e,t,n)||n);return n&&IT(e,t,n),n};const V0=class extends Rs{constructor(){super(...arguments),this._grid=null,this._world=null,this.resize=()=>{this._world&&this._grid&&this._grid.regenerate()}}set gridColor(e){if(this._gridColor=e,!(e&&this._grid))return;const t=Number(e.replace("#","0x"));Number.isNaN(t)||this._grid.material.color.setHex(t)}get gridColor(){return this._gridColor}set gridScaleX(e){this._gridScaleX=e,e&&this._grid&&(this._grid.scaleX=e)}get gridScaleX(){return this._gridScaleX}set gridScaleY(e){this._gridScaleY=e,e&&this._grid&&(this._grid.scaleY=e)}get gridScaleY(){return this._gridScaleY}set components(e){this.dispose();const t=e.get(Ev).create();this._world=t,t.scene=new bv(e),t.scene.setup(),t.renderer=new Am(e,this);const i=new wv(e);t.camera=i;const n=new wT(i.threeOrtho,this);this._grid=n,t.scene.three.add(n.get()),i.controls.addEventListener("update",()=>n.regenerate()),setTimeout(async()=>{t.camera.updateAspect(),i.set("Plan"),await i.controls.setLookAt(0,0,100,0,0,0),await i.projection.set("Orthographic"),i.controls.dollySpeed=3,i.controls.draggingSmoothTime=.085,i.controls.maxZoom=1e3,i.controls.zoom(4)})}get world(){return this._world}dispose(){var e;(e=this.world)==null||e.dispose(),this._world=null,this._grid=null}connectedCallback(){super.connectedCallback(),new ResizeObserver(this.resize).observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.dispose()}render(){return B0``}};V0.styles=L0` :host { position: relative; display: flex; @@ -3092,7 +3092,7 @@ void main() { height: 100%; background-color: var(--bim-ui_bg-base); } - `;let Ol=V0;Ru([oi({type:String,attribute:"grid-color",reflect:!0})],Ol.prototype,"gridColor");Ru([oi({type:Number,attribute:"grid-scale-x",reflect:!0})],Ol.prototype,"gridScaleX");Ru([oi({type:Number,attribute:"grid-scale-y",reflect:!0})],Ol.prototype,"gridScaleY");var TT=Object.defineProperty,pn=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=o(e,t,n)||n);return n&&TT(e,t,n),n};const H0=class extends Rs{constructor(){super(...arguments),this._defaults={size:60},this._cssMatrix3D="",this._matrix=new Ee,this._onRightClick=new Event("rightclick"),this._onLeftClick=new Event("leftclick"),this._onTopClick=new Event("topclick"),this._onBottomClick=new Event("bottomclick"),this._onFrontClick=new Event("frontclick"),this._onBackClick=new Event("backclick"),this._camera=null,this._epsilon=e=>Math.abs(e)<1e-10?0:e}set camera(e){this._camera=e,this.updateOrientation()}get camera(){return this._camera}updateOrientation(){if(!this.camera)return;this._matrix.extractRotation(this.camera.matrixWorldInverse);const{elements:e}=this._matrix;this._cssMatrix3D=`matrix3d( + `;let Ml=V0;_u([oi({type:String,attribute:"grid-color",reflect:!0})],Ml.prototype,"gridColor");_u([oi({type:Number,attribute:"grid-scale-x",reflect:!0})],Ml.prototype,"gridScaleX");_u([oi({type:Number,attribute:"grid-scale-y",reflect:!0})],Ml.prototype,"gridScaleY");var TT=Object.defineProperty,pn=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,o;r>=0;r--)(o=s[r])&&(n=o(e,t,n)||n);return n&&TT(e,t,n),n};const H0=class extends Rs{constructor(){super(...arguments),this._defaults={size:60},this._cssMatrix3D="",this._matrix=new Ee,this._onRightClick=new Event("rightclick"),this._onLeftClick=new Event("leftclick"),this._onTopClick=new Event("topclick"),this._onBottomClick=new Event("bottomclick"),this._onFrontClick=new Event("frontclick"),this._onBackClick=new Event("backclick"),this._camera=null,this._epsilon=e=>Math.abs(e)<1e-10?0:e}set camera(e){this._camera=e,this.updateOrientation()}get camera(){return this._camera}updateOrientation(){if(!this.camera)return;this._matrix.extractRotation(this.camera.matrixWorldInverse);const{elements:e}=this._matrix;this._cssMatrix3D=`matrix3d( ${this._epsilon(e[0])}, ${this._epsilon(-e[1])}, ${this._epsilon(e[2])}, @@ -3262,4 +3262,4 @@ void main() { .face-left { transform: rotateY(-90deg) rotateX(180deg); } - `;let ki=H0;pn([oi({type:Number,reflect:!0})],ki.prototype,"size");pn([oi({type:String,attribute:"right-text",reflect:!0})],ki.prototype,"rightText");pn([oi({type:String,attribute:"left-text",reflect:!0})],ki.prototype,"leftText");pn([oi({type:String,attribute:"top-text",reflect:!0})],ki.prototype,"topText");pn([oi({type:String,attribute:"bottom-text",reflect:!0})],ki.prototype,"bottomText");pn([oi({type:String,attribute:"front-text",reflect:!0})],ki.prototype,"frontText");pn([oi({type:String,attribute:"back-text",reflect:!0})],ki.prototype,"backText");pn([ET()],ki.prototype,"_cssMatrix3D");class lx{static init(){zh.defineCustomElement("bim-view-cube",ki),zh.defineCustomElement("bim-world-2d",Ol)}}export{ud as C,lx as Z,Qc as a}; + `;let ki=H0;pn([oi({type:Number,reflect:!0})],ki.prototype,"size");pn([oi({type:String,attribute:"right-text",reflect:!0})],ki.prototype,"rightText");pn([oi({type:String,attribute:"left-text",reflect:!0})],ki.prototype,"leftText");pn([oi({type:String,attribute:"top-text",reflect:!0})],ki.prototype,"topText");pn([oi({type:String,attribute:"bottom-text",reflect:!0})],ki.prototype,"bottomText");pn([oi({type:String,attribute:"front-text",reflect:!0})],ki.prototype,"frontText");pn([oi({type:String,attribute:"back-text",reflect:!0})],ki.prototype,"backText");pn([ET()],ki.prototype,"_cssMatrix3D");class lx{static init(){Vh.defineCustomElement("bim-view-cube",ki),Vh.defineCustomElement("bim-world-2d",Ml)}}export{hd as C,lx as Z,Zc as a}; diff --git a/examples/assets/index-DHVa0dFp.js b/examples/assets/index-D6HCkz61.js similarity index 99% rename from examples/assets/index-DHVa0dFp.js rename to examples/assets/index-D6HCkz61.js index 84ac02c73..dd2a2fcc0 100644 --- a/examples/assets/index-DHVa0dFp.js +++ b/examples/assets/index-D6HCkz61.js @@ -1,4 +1,4 @@ -var P=Object.defineProperty;var I=(i,s,e)=>s in i?P(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var t=(i,s,e)=>(I(i,typeof s!="symbol"?s+"":s,e),e);import{E as b,D as M,C as D}from"./index-DJTKMiao.js";import{n as E,ah as m,W as A,d as w,I as g,a as U,j as p,C as B,Z as S}from"./web-ifc-api-BC8YMRiS.js";import{A as x}from"./async-event-D8tC9awa.js";class y{static isTransparent(s){return s.transparent&&s.opacity<1}}function T(i,s,e,r){return new Promise((n,o)=>{function a(){const l=i.clientWaitSync(s,e,0);if(l===i.WAIT_FAILED){o();return}if(l===i.TIMEOUT_EXPIRED){setTimeout(a,r);return}n()}a()})}async function R(i,s,e,r,n,o,a){const l=i.fenceSync(i.SYNC_GPU_COMMANDS_COMPLETE,0);i.flush(),await T(i,l,0,10),i.deleteSync(l),i.bindBuffer(s,e),i.getBufferSubData(s,r,n,o,a),i.bindBuffer(s,null)}async function V(i,s,e,r,n,o,a,l){const d=i.createBuffer();return i.bindBuffer(i.PIXEL_PACK_BUFFER,d),i.bufferData(i.PIXEL_PACK_BUFFER,l.byteLength,i.STREAM_READ),i.readPixels(s,e,r,n,o,a,0),i.bindBuffer(i.PIXEL_PACK_BUFFER,null),await R(i,i.PIXEL_PACK_BUFFER,d,0,l),i.deleteBuffer(d),l}class L{constructor(s,e,r){t(this,"onDisposed",new b);t(this,"onViewUpdated",new x);t(this,"enabled",!0);t(this,"needsUpdate",!1);t(this,"renderDebugFrame",!1);t(this,"components");t(this,"world");t(this,"renderer");t(this,"autoUpdate",!0);t(this,"updateInterval",1e3);t(this,"worker");t(this,"scene",new E);t(this,"_width",512);t(this,"_height",512);t(this,"_availableColor",1);t(this,"renderTarget");t(this,"bufferSize");t(this,"_buffer");t(this,"_isWorkerBusy",!1);t(this,"updateVisibility",async s=>{if(!this.enabled||!this.needsUpdate&&!s||this._isWorkerBusy)return;this._isWorkerBusy=!0;const e=this.world.camera.three;e.updateMatrix(),this.renderer.setSize(this._width,this._height),this.renderer.setRenderTarget(this.renderTarget),this.renderer.render(this.scene,e);const r=this.renderer.getContext();await V(r,0,0,this._width,this._height,r.RGBA,r.UNSIGNED_BYTE,this._buffer),this.renderer.setRenderTarget(null),this.renderDebugFrame&&this.renderer.render(this.scene,e),this.worker.postMessage({buffer:this._buffer}),this.needsUpdate=!1});if(!e.renderer)throw new Error("The given world must have a renderer!");this.components=s,this.applySettings(r),this.world=e,this.renderer=new m,this.renderTarget=new A(this._width,this._height),this.bufferSize=this._width*this._height*4,this._buffer=new Uint8Array(this.bufferSize),this.renderer.clippingPlanes=e.renderer.clippingPlanes;const n=` +var P=Object.defineProperty;var I=(i,s,e)=>s in i?P(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var t=(i,s,e)=>(I(i,typeof s!="symbol"?s+"":s,e),e);import{E as b,D as M,C as D}from"./index-BraZXcLv.js";import{n as E,ah as m,W as A,d as w,I as g,a as U,j as p,C as B,Z as S}from"./web-ifc-api-BC8YMRiS.js";import{A as x}from"./async-event-D8tC9awa.js";class y{static isTransparent(s){return s.transparent&&s.opacity<1}}function T(i,s,e,r){return new Promise((n,o)=>{function a(){const l=i.clientWaitSync(s,e,0);if(l===i.WAIT_FAILED){o();return}if(l===i.TIMEOUT_EXPIRED){setTimeout(a,r);return}n()}a()})}async function R(i,s,e,r,n,o,a){const l=i.fenceSync(i.SYNC_GPU_COMMANDS_COMPLETE,0);i.flush(),await T(i,l,0,10),i.deleteSync(l),i.bindBuffer(s,e),i.getBufferSubData(s,r,n,o,a),i.bindBuffer(s,null)}async function V(i,s,e,r,n,o,a,l){const d=i.createBuffer();return i.bindBuffer(i.PIXEL_PACK_BUFFER,d),i.bufferData(i.PIXEL_PACK_BUFFER,l.byteLength,i.STREAM_READ),i.readPixels(s,e,r,n,o,a,0),i.bindBuffer(i.PIXEL_PACK_BUFFER,null),await R(i,i.PIXEL_PACK_BUFFER,d,0,l),i.deleteBuffer(d),l}class L{constructor(s,e,r){t(this,"onDisposed",new b);t(this,"onViewUpdated",new x);t(this,"enabled",!0);t(this,"needsUpdate",!1);t(this,"renderDebugFrame",!1);t(this,"components");t(this,"world");t(this,"renderer");t(this,"autoUpdate",!0);t(this,"updateInterval",1e3);t(this,"worker");t(this,"scene",new E);t(this,"_width",512);t(this,"_height",512);t(this,"_availableColor",1);t(this,"renderTarget");t(this,"bufferSize");t(this,"_buffer");t(this,"_isWorkerBusy",!1);t(this,"updateVisibility",async s=>{if(!this.enabled||!this.needsUpdate&&!s||this._isWorkerBusy)return;this._isWorkerBusy=!0;const e=this.world.camera.three;e.updateMatrix(),this.renderer.setSize(this._width,this._height),this.renderer.setRenderTarget(this.renderTarget),this.renderer.render(this.scene,e);const r=this.renderer.getContext();await V(r,0,0,this._width,this._height,r.RGBA,r.UNSIGNED_BYTE,this._buffer),this.renderer.setRenderTarget(null),this.renderDebugFrame&&this.renderer.render(this.scene,e),this.worker.postMessage({buffer:this._buffer}),this.needsUpdate=!1});if(!e.renderer)throw new Error("The given world must have a renderer!");this.components=s,this.applySettings(r),this.world=e,this.renderer=new m,this.renderTarget=new A(this._width,this._height),this.bufferSize=this._width*this._height*4,this._buffer=new Uint8Array(this.bufferSize),this.renderer.clippingPlanes=e.renderer.clippingPlanes;const n=` addEventListener("message", (event) => { const { buffer } = event.data; const colors = new Map(); diff --git a/examples/assets/index-BzmpwuIQ.js b/examples/assets/index-DDOiyGyA.js similarity index 99% rename from examples/assets/index-BzmpwuIQ.js rename to examples/assets/index-DDOiyGyA.js index ca5fefb80..44c3c0cde 100644 --- a/examples/assets/index-BzmpwuIQ.js +++ b/examples/assets/index-DDOiyGyA.js @@ -1 +1 @@ -var h=Object.defineProperty;var m=(n,F,E)=>F in n?h(n,F,{enumerable:!0,configurable:!0,writable:!0,value:E}):n[F]=E;var L=(n,F,E)=>(m(n,typeof F!="symbol"?F+"":F,E),E);import{$ as b,am as v,af as x,a4 as V,ac as w,a0 as H,a1 as p,a2 as f,a3 as d,a5 as W,a6 as g,a7 as X}from"./web-ifc-api-BC8YMRiS.js";import{C as y,E as o}from"./index-DJTKMiao.js";const Y=class Y extends y{constructor(E){super(E);L(this,"onDisposed",new o);L(this,"onFragmentsLoaded",new o);L(this,"onFragmentsDisposed",new o);L(this,"list",new Map);L(this,"groups",new Map);L(this,"enabled",!0);L(this,"baseCoordinationModel","");L(this,"_loader",new b);this.components.add(Y.uuid,this)}get meshes(){const E=[];for(const[I,C]of this.list)E.push(C.mesh);return E}dispose(){for(const[E,I]of this.groups)I.dispose(!0);this.baseCoordinationModel="",this.groups.clear(),this.list.clear(),this.onFragmentsLoaded.reset(),this.onFragmentsDisposed.reset(),this.onDisposed.trigger(),this.onDisposed.reset()}disposeGroup(E){const{uuid:I}=E,C=[];for(const T of E.items)C.push(T.id),this.list.delete(T.id);E.dispose(!0),this.groups.delete(E.uuid),this.onFragmentsDisposed.trigger({groupID:I,fragmentIDs:C})}load(E,I){const T={...{coordinate:!0},...I},{coordinate:R,properties:A,relationsMap:N}=T,O=this._loader.import(E);for(const S of O.items)S.group=O,this.list.set(S.id,S);return R&&this.coordinate([O]),this.groups.set(O.uuid,O),A&&O.setLocalProperties(A),N&&this.components.get(l).setRelationMap(O,N),this.onFragmentsLoaded.trigger(O),O}export(E){return this._loader.export(E)}coordinate(E=Array.from(this.groups.values())){if(this.baseCoordinationModel.length===0){const T=E.pop();if(!T)return;this.baseCoordinationModel=T.uuid}if(!E.length)return;const C=this.groups.get(this.baseCoordinationModel);if(!C){console.log("No base model found for coordination!");return}for(const T of E)T!==C&&(T.position.set(0,0,0),T.rotation.set(0,0,0),T.scale.set(1,1,1),T.updateMatrix(),T.applyMatrix4(T.coordinationMatrix.clone().invert()),T.applyMatrix4(C.coordinationMatrix))}};L(Y,"uuid","fef46874-46a3-461b-8c44-2922ab77c806");let a=Y;const K={950732822:"IFCURIREFERENCE",4075327185:"IFCTIME",1209108979:"IFCTEMPERATURERATEOFCHANGEMEASURE",3457685358:"IFCSOUNDPRESSURELEVELMEASURE",4157543285:"IFCSOUNDPOWERLEVELMEASURE",2798247006:"IFCPROPERTYSETDEFINITIONSET",1790229001:"IFCPOSITIVEINTEGER",525895558:"IFCNONNEGATIVELENGTHMEASURE",1774176899:"IFCLINEINDEX",1275358634:"IFCLANGUAGEID",2541165894:"IFCDURATION",3701338814:"IFCDAYINWEEKNUMBER",2195413836:"IFCDATETIME",937566702:"IFCDATE",1683019596:"IFCCARDINALPOINTREFERENCE",2314439260:"IFCBINARY",1500781891:"IFCAREADENSITYMEASURE",3683503648:"IFCARCINDEX",4065007721:"IFCYEARNUMBER",1718600412:"IFCWARPINGMOMENTMEASURE",51269191:"IFCWARPINGCONSTANTMEASURE",2593997549:"IFCVOLUMETRICFLOWRATEMEASURE",3458127941:"IFCVOLUMEMEASURE",3345633955:"IFCVAPORPERMEABILITYMEASURE",1278329552:"IFCTORQUEMEASURE",2591213694:"IFCTIMESTAMP",2726807636:"IFCTIMEMEASURE",743184107:"IFCTHERMODYNAMICTEMPERATUREMEASURE",2016195849:"IFCTHERMALTRANSMITTANCEMEASURE",857959152:"IFCTHERMALRESISTANCEMEASURE",2281867870:"IFCTHERMALEXPANSIONCOEFFICIENTMEASURE",2645777649:"IFCTHERMALCONDUCTIVITYMEASURE",232962298:"IFCTHERMALADMITTANCEMEASURE",296282323:"IFCTEXTTRANSFORMATION",603696268:"IFCTEXTFONTNAME",3490877962:"IFCTEXTDECORATION",1460886941:"IFCTEXTALIGNMENT",2801250643:"IFCTEXT",58845555:"IFCTEMPERATUREGRADIENTMEASURE",361837227:"IFCSPECULARROUGHNESS",2757832317:"IFCSPECULAREXPONENT",3477203348:"IFCSPECIFICHEATCAPACITYMEASURE",993287707:"IFCSOUNDPRESSUREMEASURE",846465480:"IFCSOUNDPOWERMEASURE",3471399674:"IFCSOLIDANGLEMEASURE",408310005:"IFCSHEARMODULUSMEASURE",2190458107:"IFCSECTIONALAREAINTEGRALMEASURE",3467162246:"IFCSECTIONMODULUSMEASURE",2766185779:"IFCSECONDINMINUTE",3211557302:"IFCROTATIONALSTIFFNESSMEASURE",1755127002:"IFCROTATIONALMASSMEASURE",2133746277:"IFCROTATIONALFREQUENCYMEASURE",200335297:"IFCREAL",96294661:"IFCRATIOMEASURE",3972513137:"IFCRADIOACTIVITYMEASURE",3665567075:"IFCPRESSUREMEASURE",2169031380:"IFCPRESENTABLETEXT",1364037233:"IFCPOWERMEASURE",1245737093:"IFCPOSITIVERATIOMEASURE",3054510233:"IFCPOSITIVEPLANEANGLEMEASURE",2815919920:"IFCPOSITIVELENGTHMEASURE",4042175685:"IFCPLANEANGLEMEASURE",2642773653:"IFCPLANARFORCEMEASURE",2260317790:"IFCPARAMETERVALUE",929793134:"IFCPHMEASURE",2395907400:"IFCNUMERICMEASURE",2095195183:"IFCNORMALISEDRATIOMEASURE",765770214:"IFCMONTHINYEARNUMBER",2615040989:"IFCMONETARYMEASURE",3114022597:"IFCMOMENTOFINERTIAMEASURE",1648970520:"IFCMOLECULARWEIGHTMEASURE",3177669450:"IFCMOISTUREDIFFUSIVITYMEASURE",1753493141:"IFCMODULUSOFSUBGRADEREACTIONMEASURE",1052454078:"IFCMODULUSOFROTATIONALSUBGRADEREACTIONMEASURE",2173214787:"IFCMODULUSOFLINEARSUBGRADEREACTIONMEASURE",3341486342:"IFCMODULUSOFELASTICITYMEASURE",102610177:"IFCMINUTEINHOUR",3531705166:"IFCMASSPERLENGTHMEASURE",3124614049:"IFCMASSMEASURE",4017473158:"IFCMASSFLOWRATEMEASURE",1477762836:"IFCMASSDENSITYMEASURE",2486716878:"IFCMAGNETICFLUXMEASURE",286949696:"IFCMAGNETICFLUXDENSITYMEASURE",151039812:"IFCLUMINOUSINTENSITYMEASURE",2755797622:"IFCLUMINOUSINTENSITYDISTRIBUTIONMEASURE",2095003142:"IFCLUMINOUSFLUXMEASURE",503418787:"IFCLOGICAL",3086160713:"IFCLINEARVELOCITYMEASURE",1307019551:"IFCLINEARSTIFFNESSMEASURE",2128979029:"IFCLINEARMOMENTMEASURE",191860431:"IFCLINEARFORCEMEASURE",1243674935:"IFCLENGTHMEASURE",3258342251:"IFCLABEL",2054016361:"IFCKINEMATICVISCOSITYMEASURE",3192672207:"IFCISOTHERMALMOISTURECAPACITYMEASURE",3686016028:"IFCIONCONCENTRATIONMEASURE",3809634241:"IFCINTEGERCOUNTRATEMEASURE",1939436016:"IFCINTEGER",2679005408:"IFCINDUCTANCEMEASURE",3358199106:"IFCILLUMINANCEMEASURE",983778844:"IFCIDENTIFIER",2589826445:"IFCHOURINDAY",1158859006:"IFCHEATINGVALUEMEASURE",3113092358:"IFCHEATFLUXDENSITYMEASURE",3064340077:"IFCGLOBALLYUNIQUEID",3044325142:"IFCFREQUENCYMEASURE",1361398929:"IFCFORCEMEASURE",2590844177:"IFCFONTWEIGHT",2715512545:"IFCFONTVARIANT",1102727119:"IFCFONTSTYLE",2078135608:"IFCENERGYMEASURE",2506197118:"IFCELECTRICVOLTAGEMEASURE",2951915441:"IFCELECTRICRESISTANCEMEASURE",3790457270:"IFCELECTRICCURRENTMEASURE",2093906313:"IFCELECTRICCONDUCTANCEMEASURE",3818826038:"IFCELECTRICCHARGEMEASURE",1827137117:"IFCELECTRICCAPACITANCEMEASURE",69416015:"IFCDYNAMICVISCOSITYMEASURE",524656162:"IFCDOSEEQUIVALENTMEASURE",4134073009:"IFCDIMENSIONCOUNT",1514641115:"IFCDESCRIPTIVEMEASURE",300323983:"IFCDAYLIGHTSAVINGHOUR",86635668:"IFCDAYINMONTHNUMBER",94842927:"IFCCURVATUREMEASURE",1778710042:"IFCCOUNTMEASURE",3238673880:"IFCCONTEXTDEPENDENTMEASURE",3812528620:"IFCCOMPOUNDPLANEANGLEMEASURE",2991860651:"IFCCOMPLEXNUMBER",1867003952:"IFCBOXALIGNMENT",2735952531:"IFCBOOLEAN",2650437152:"IFCAREAMEASURE",632304761:"IFCANGULARVELOCITYMEASURE",360377573:"IFCAMOUNTOFSUBSTANCEMEASURE",4182062534:"IFCACCELERATIONMEASURE",3699917729:"IFCABSORBEDDOSEMEASURE",1971632696:"IFCGEOSLICE",2680139844:"IFCGEOMODEL",24726584:"IFCELECTRICFLOWTREATMENTDEVICE",3693000487:"IFCDISTRIBUTIONBOARD",3460952963:"IFCCONVEYORSEGMENT",3999819293:"IFCCAISSONFOUNDATION",3314249567:"IFCBOREHOLE",4196446775:"IFCBEARING",325726236:"IFCALIGNMENT",3425753595:"IFCTRACKELEMENT",991950508:"IFCSIGNAL",3798194928:"IFCREINFORCEDSOIL",3290496277:"IFCRAIL",1383356374:"IFCPAVEMENT",2182337498:"IFCNAVIGATIONELEMENT",234836483:"IFCMOORINGDEVICE",2078563270:"IFCMOBILETELECOMMUNICATIONSAPPLIANCE",1638804497:"IFCLIQUIDTERMINAL",1154579445:"IFCLINEARPOSITIONINGELEMENT",2696325953:"IFCKERB",2713699986:"IFCGEOTECHNICALASSEMBLY",2142170206:"IFCELECTRICFLOWTREATMENTDEVICETYPE",3376911765:"IFCEARTHWORKSFILL",1077100507:"IFCEARTHWORKSELEMENT",3071239417:"IFCEARTHWORKSCUT",479945903:"IFCDISTRIBUTIONBOARDTYPE",3426335179:"IFCDEEPFOUNDATION",1502416096:"IFCCOURSE",2940368186:"IFCCONVEYORSEGMENTTYPE",3203706013:"IFCCAISSONFOUNDATIONTYPE",3862327254:"IFCBUILTSYSTEM",1876633798:"IFCBUILTELEMENT",963979645:"IFCBRIDGEPART",644574406:"IFCBRIDGE",3649138523:"IFCBEARINGTYPE",1662888072:"IFCALIGNMENTVERTICAL",317615605:"IFCALIGNMENTSEGMENT",1545765605:"IFCALIGNMENTHORIZONTAL",4266260250:"IFCALIGNMENTCANT",3956297820:"IFCVIBRATIONDAMPERTYPE",1530820697:"IFCVIBRATIONDAMPER",840318589:"IFCVEHICLE",1953115116:"IFCTRANSPORTATIONDEVICE",618700268:"IFCTRACKELEMENTTYPE",2281632017:"IFCTENDONCONDUITTYPE",3663046924:"IFCTENDONCONDUIT",42703149:"IFCSINESPIRAL",1894708472:"IFCSIGNALTYPE",3599934289:"IFCSIGNTYPE",33720170:"IFCSIGN",1027922057:"IFCSEVENTHORDERPOLYNOMIALSPIRAL",544395925:"IFCSEGMENTEDREFERENCECURVE",3649235739:"IFCSECONDORDERPOLYNOMIALSPIRAL",550521510:"IFCROADPART",146592293:"IFCROAD",3818125796:"IFCRELADHERESTOELEMENT",4021432810:"IFCREFERENT",1891881377:"IFCRAILWAYPART",3992365140:"IFCRAILWAY",1763565496:"IFCRAILTYPE",1946335990:"IFCPOSITIONINGELEMENT",514975943:"IFCPAVEMENTTYPE",506776471:"IFCNAVIGATIONELEMENTTYPE",710110818:"IFCMOORINGDEVICETYPE",1950438474:"IFCMOBILETELECOMMUNICATIONSAPPLIANCETYPE",976884017:"IFCMARINEPART",525669439:"IFCMARINEFACILITY",1770583370:"IFCLIQUIDTERMINALTYPE",2176059722:"IFCLINEARELEMENT",679976338:"IFCKERBTYPE",3948183225:"IFCIMPACTPROTECTIONDEVICETYPE",2568555532:"IFCIMPACTPROTECTIONDEVICE",2898700619:"IFCGRADIENTCURVE",1594536857:"IFCGEOTECHNICALSTRATUM",4230923436:"IFCGEOTECHNICALELEMENT",4228831410:"IFCFACILITYPARTCOMMON",1310830890:"IFCFACILITYPART",24185140:"IFCFACILITY",4234616927:"IFCDIRECTRIXDERIVEDREFERENCESWEPTAREASOLID",1306400036:"IFCDEEPFOUNDATIONTYPE",4189326743:"IFCCOURSETYPE",2000195564:"IFCCOSINESPIRAL",3497074424:"IFCCLOTHOID",1626504194:"IFCBUILTELEMENTTYPE",3651464721:"IFCVEHICLETYPE",1229763772:"IFCTRIANGULATEDIRREGULARNETWORK",3665877780:"IFCTRANSPORTATIONDEVICETYPE",782932809:"IFCTHIRDORDERPOLYNOMIALSPIRAL",2735484536:"IFCSPIRAL",1356537516:"IFCSECTIONEDSURFACE",1290935644:"IFCSECTIONEDSOLIDHORIZONTAL",1862484736:"IFCSECTIONEDSOLID",1441486842:"IFCRELPOSITIONS",1033248425:"IFCRELASSOCIATESPROFILEDEF",3381221214:"IFCPOLYNOMIALCURVE",2485787929:"IFCOFFSETCURVEBYDISTANCES",590820931:"IFCOFFSETCURVE",3465909080:"IFCINDEXEDPOLYGONALTEXTUREMAP",593015953:"IFCDIRECTRIXCURVESWEPTAREASOLID",4212018352:"IFCCURVESEGMENT",3425423356:"IFCAXIS2PLACEMENTLINEAR",823603102:"IFCSEGMENT",2165702409:"IFCPOINTBYDISTANCEEXPRESSION",182550632:"IFCOPENCROSSPROFILEDEF",388784114:"IFCLINEARPLACEMENT",536804194:"IFCALIGNMENTHORIZONTALSEGMENT",3752311538:"IFCALIGNMENTCANTSEGMENT",1010789467:"IFCTEXTURECOORDINATEINDICESWITHVOIDS",222769930:"IFCTEXTURECOORDINATEINDICES",2691318326:"IFCQUANTITYNUMBER",3633395639:"IFCALIGNMENTVERTICALSEGMENT",2879124712:"IFCALIGNMENTPARAMETERSEGMENT",25142252:"IFCCONTROLLER",3087945054:"IFCALARM",4288193352:"IFCACTUATOR",630975310:"IFCUNITARYCONTROLELEMENT",4086658281:"IFCSENSOR",2295281155:"IFCPROTECTIVEDEVICETRIPPINGUNIT",182646315:"IFCFLOWINSTRUMENT",1426591983:"IFCFIRESUPPRESSIONTERMINAL",819412036:"IFCFILTER",3415622556:"IFCFAN",1003880860:"IFCELECTRICTIMECONTROL",402227799:"IFCELECTRICMOTOR",264262732:"IFCELECTRICGENERATOR",3310460725:"IFCELECTRICFLOWSTORAGEDEVICE",862014818:"IFCELECTRICDISTRIBUTIONBOARD",1904799276:"IFCELECTRICAPPLIANCE",1360408905:"IFCDUCTSILENCER",3518393246:"IFCDUCTSEGMENT",342316401:"IFCDUCTFITTING",562808652:"IFCDISTRIBUTIONCIRCUIT",4074379575:"IFCDAMPER",3640358203:"IFCCOOLINGTOWER",4136498852:"IFCCOOLEDBEAM",2272882330:"IFCCONDENSER",3571504051:"IFCCOMPRESSOR",3221913625:"IFCCOMMUNICATIONSAPPLIANCE",639361253:"IFCCOIL",3902619387:"IFCCHILLER",4217484030:"IFCCABLESEGMENT",1051757585:"IFCCABLEFITTING",3758799889:"IFCCABLECARRIERSEGMENT",635142910:"IFCCABLECARRIERFITTING",2938176219:"IFCBURNER",32344328:"IFCBOILER",2906023776:"IFCBEAMSTANDARDCASE",277319702:"IFCAUDIOVISUALAPPLIANCE",2056796094:"IFCAIRTOAIRHEATRECOVERY",177149247:"IFCAIRTERMINALBOX",1634111441:"IFCAIRTERMINAL",486154966:"IFCWINDOWSTANDARDCASE",4237592921:"IFCWASTETERMINAL",4156078855:"IFCWALLELEMENTEDCASE",4207607924:"IFCVALVE",4292641817:"IFCUNITARYEQUIPMENT",3179687236:"IFCUNITARYCONTROLELEMENTTYPE",3026737570:"IFCTUBEBUNDLE",3825984169:"IFCTRANSFORMER",812556717:"IFCTANK",1162798199:"IFCSWITCHINGDEVICE",385403989:"IFCSTRUCTURALLOADCASE",1404847402:"IFCSTACKTERMINAL",1999602285:"IFCSPACEHEATER",3420628829:"IFCSOLARDEVICE",3027962421:"IFCSLABSTANDARDCASE",3127900445:"IFCSLABELEMENTEDCASE",1329646415:"IFCSHADINGDEVICE",3053780830:"IFCSANITARYTERMINAL",2572171363:"IFCREINFORCINGBARTYPE",1232101972:"IFCRATIONALBSPLINECURVEWITHKNOTS",90941305:"IFCPUMP",655969474:"IFCPROTECTIVEDEVICETRIPPINGUNITTYPE",738039164:"IFCPROTECTIVEDEVICE",1156407060:"IFCPLATESTANDARDCASE",3612865200:"IFCPIPESEGMENT",310824031:"IFCPIPEFITTING",3694346114:"IFCOUTLET",144952367:"IFCOUTERBOUNDARYCURVE",2474470126:"IFCMOTORCONNECTION",1911478936:"IFCMEMBERSTANDARDCASE",1437502449:"IFCMEDICALDEVICE",629592764:"IFCLIGHTFIXTURE",76236018:"IFCLAMP",2176052936:"IFCJUNCTIONBOX",4175244083:"IFCINTERCEPTOR",2068733104:"IFCHUMIDIFIER",3319311131:"IFCHEATEXCHANGER",2188021234:"IFCFLOWMETER",1209101575:"IFCEXTERNALSPATIALELEMENT",484807127:"IFCEVAPORATOR",3747195512:"IFCEVAPORATIVECOOLER",2814081492:"IFCENGINE",2417008758:"IFCELECTRICDISTRIBUTIONBOARDTYPE",3242481149:"IFCDOORSTANDARDCASE",3205830791:"IFCDISTRIBUTIONSYSTEM",400855858:"IFCCOMMUNICATIONSAPPLIANCETYPE",905975707:"IFCCOLUMNSTANDARDCASE",1677625105:"IFCCIVILELEMENT",3296154744:"IFCCHIMNEY",2674252688:"IFCCABLEFITTINGTYPE",2188180465:"IFCBURNERTYPE",1177604601:"IFCBUILDINGSYSTEM",39481116:"IFCBUILDINGELEMENTPARTTYPE",1136057603:"IFCBOUNDARYCURVE",2461110595:"IFCBSPLINECURVEWITHKNOTS",1532957894:"IFCAUDIOVISUALAPPLIANCETYPE",4088093105:"IFCWORKCALENDAR",4009809668:"IFCWINDOWTYPE",926996030:"IFCVOIDINGFEATURE",2391383451:"IFCVIBRATIONISOLATOR",2415094496:"IFCTENDONTYPE",3081323446:"IFCTENDONANCHORTYPE",413509423:"IFCSYSTEMFURNITUREELEMENT",3101698114:"IFCSURFACEFEATURE",3657597509:"IFCSTRUCTURALSURFACEACTION",2757150158:"IFCSTRUCTURALCURVEREACTION",1004757350:"IFCSTRUCTURALCURVEACTION",338393293:"IFCSTAIRTYPE",1072016465:"IFCSOLARDEVICETYPE",4074543187:"IFCSHADINGDEVICETYPE",2157484638:"IFCSEAMCURVE",2781568857:"IFCROOFTYPE",2310774935:"IFCREINFORCINGMESHTYPE",964333572:"IFCREINFORCINGELEMENTTYPE",683857671:"IFCRATIONALBSPLINESURFACEWITHKNOTS",1469900589:"IFCRAMPTYPE",2839578677:"IFCPOLYGONALFACESET",1158309216:"IFCPILETYPE",3079942009:"IFCOPENINGSTANDARDCASE",1114901282:"IFCMEDICALDEVICETYPE",3113134337:"IFCINTERSECTIONCURVE",3946677679:"IFCINTERCEPTORTYPE",2571569899:"IFCINDEXEDPOLYCURVE",3493046030:"IFCGEOGRAPHICELEMENT",1509553395:"IFCFURNITURE",1893162501:"IFCFOOTINGTYPE",2853485674:"IFCEXTERNALSPATIALSTRUCTUREELEMENT",4148101412:"IFCEVENT",132023988:"IFCENGINETYPE",2397081782:"IFCELEMENTASSEMBLYTYPE",2323601079:"IFCDOORTYPE",1213902940:"IFCCYLINDRICALSURFACE",1525564444:"IFCCONSTRUCTIONPRODUCTRESOURCETYPE",4105962743:"IFCCONSTRUCTIONMATERIALRESOURCETYPE",2185764099:"IFCCONSTRUCTIONEQUIPMENTRESOURCETYPE",15328376:"IFCCOMPOSITECURVEONSURFACE",3875453745:"IFCCOMPLEXPROPERTYTEMPLATE",3893394355:"IFCCIVILELEMENTTYPE",2197970202:"IFCCHIMNEYTYPE",167062518:"IFCBSPLINESURFACEWITHKNOTS",2887950389:"IFCBSPLINESURFACE",2603310189:"IFCADVANCEDBREPWITHVOIDS",1635779807:"IFCADVANCEDBREP",2916149573:"IFCTRIANGULATEDFACESET",1935646853:"IFCTOROIDALSURFACE",2387106220:"IFCTESSELLATEDFACESET",3206491090:"IFCTASKTYPE",699246055:"IFCSURFACECURVE",4095615324:"IFCSUBCONTRACTRESOURCETYPE",603775116:"IFCSTRUCTURALSURFACEREACTION",4015995234:"IFCSPHERICALSURFACE",2481509218:"IFCSPATIALZONETYPE",463610769:"IFCSPATIALZONE",710998568:"IFCSPATIALELEMENTTYPE",1412071761:"IFCSPATIALELEMENT",3663146110:"IFCSIMPLEPROPERTYTEMPLATE",3243963512:"IFCREVOLVEDAREASOLIDTAPERED",816062949:"IFCREPARAMETRISEDCOMPOSITECURVESEGMENT",1521410863:"IFCRELSPACEBOUNDARY2NDLEVEL",3523091289:"IFCRELSPACEBOUNDARY1STLEVEL",427948657:"IFCRELINTERFERESELEMENTS",307848117:"IFCRELDEFINESBYTEMPLATE",1462361463:"IFCRELDEFINESBYOBJECT",2565941209:"IFCRELDECLARES",1027710054:"IFCRELASSIGNSTOGROUPBYFACTOR",3521284610:"IFCPROPERTYTEMPLATE",492091185:"IFCPROPERTYSETTEMPLATE",653396225:"IFCPROJECTLIBRARY",569719735:"IFCPROCEDURETYPE",3967405729:"IFCPREDEFINEDPROPERTYSET",1682466193:"IFCPCURVE",428585644:"IFCLABORRESOURCETYPE",2294589976:"IFCINDEXEDPOLYGONALFACEWITHVOIDS",178912537:"IFCINDEXEDPOLYGONALFACE",4095422895:"IFCGEOGRAPHICELEMENTTYPE",2652556860:"IFCFIXEDREFERENCESWEPTAREASOLID",2804161546:"IFCEXTRUDEDAREASOLIDTAPERED",4024345920:"IFCEVENTTYPE",2629017746:"IFCCURVEBOUNDEDSURFACE",1815067380:"IFCCREWRESOURCETYPE",3419103109:"IFCCONTEXT",2574617495:"IFCCONSTRUCTIONRESOURCETYPE",2059837836:"IFCCARTESIANPOINTLIST3D",1675464909:"IFCCARTESIANPOINTLIST2D",574549367:"IFCCARTESIANPOINTLIST",3406155212:"IFCADVANCEDFACE",3698973494:"IFCTYPERESOURCE",3736923433:"IFCTYPEPROCESS",901063453:"IFCTESSELLATEDITEM",1096409881:"IFCSWEPTDISKSOLIDPOLYGONAL",1042787934:"IFCRESOURCETIME",1608871552:"IFCRESOURCECONSTRAINTRELATIONSHIP",2943643501:"IFCRESOURCEAPPROVALRELATIONSHIP",2090586900:"IFCQUANTITYSET",1482703590:"IFCPROPERTYTEMPLATEDEFINITION",3778827333:"IFCPREDEFINEDPROPERTIES",2998442950:"IFCMIRROREDPROFILEDEF",853536259:"IFCMATERIALRELATIONSHIP",3404854881:"IFCMATERIALPROFILESETUSAGETAPERING",3079605661:"IFCMATERIALPROFILESETUSAGE",2852063980:"IFCMATERIALCONSTITUENTSET",3708119e3:"IFCMATERIALCONSTITUENT",1585845231:"IFCLAGTIME",2133299955:"IFCINDEXEDTRIANGLETEXTUREMAP",1437953363:"IFCINDEXEDTEXTUREMAP",3570813810:"IFCINDEXEDCOLOURMAP",1437805879:"IFCEXTERNALREFERENCERELATIONSHIP",297599258:"IFCEXTENDEDPROPERTIES",211053100:"IFCEVENTTIME",2713554722:"IFCCONVERSIONBASEDUNITWITHOFFSET",3285139300:"IFCCOLOURRGBLIST",1236880293:"IFCWORKTIME",1199560280:"IFCTIMEPERIOD",3611470254:"IFCTEXTUREVERTEXLIST",2771591690:"IFCTASKTIMERECURRING",1549132990:"IFCTASKTIME",2043862942:"IFCTABLECOLUMN",2934153892:"IFCSURFACEREINFORCEMENTAREA",609421318:"IFCSTRUCTURALLOADORRESULT",3478079324:"IFCSTRUCTURALLOADCONFIGURATION",1054537805:"IFCSCHEDULINGTIME",2439245199:"IFCRESOURCELEVELRELATIONSHIP",2433181523:"IFCREFERENCE",3915482550:"IFCRECURRENCEPATTERN",986844984:"IFCPROPERTYABSTRACTION",3843373140:"IFCPROJECTEDCRS",677532197:"IFCPRESENTATIONITEM",1507914824:"IFCMATERIALUSAGEDEFINITION",552965576:"IFCMATERIALPROFILEWITHOFFSETS",164193824:"IFCMATERIALPROFILESET",2235152071:"IFCMATERIALPROFILE",1847252529:"IFCMATERIALLAYERWITHOFFSETS",760658860:"IFCMATERIALDEFINITION",3057273783:"IFCMAPCONVERSION",4294318154:"IFCEXTERNALINFORMATION",1466758467:"IFCCOORDINATEREFERENCESYSTEM",1785450214:"IFCCOORDINATEOPERATION",775493141:"IFCCONNECTIONVOLUMEGEOMETRY",979691226:"IFCREINFORCINGBAR",3700593921:"IFCELECTRICDISTRIBUTIONPOINT",1062813311:"IFCDISTRIBUTIONCONTROLELEMENT",1052013943:"IFCDISTRIBUTIONCHAMBERELEMENT",578613899:"IFCCONTROLLERTYPE",2454782716:"IFCCHAMFEREDGEFEATURE",753842376:"IFCBEAM",3001207471:"IFCALARMTYPE",2874132201:"IFCACTUATORTYPE",3304561284:"IFCWINDOW",3512223829:"IFCWALLSTANDARDCASE",2391406946:"IFCWALL",3313531582:"IFCVIBRATIONISOLATORTYPE",2347447852:"IFCTENDONANCHOR",3824725483:"IFCTENDON",2515109513:"IFCSTRUCTURALANALYSISMODEL",4252922144:"IFCSTAIRFLIGHT",331165859:"IFCSTAIR",1529196076:"IFCSLAB",1783015770:"IFCSENSORTYPE",1376911519:"IFCROUNDEDEDGEFEATURE",2016517767:"IFCROOF",2320036040:"IFCREINFORCINGMESH",3027567501:"IFCREINFORCINGELEMENT",3055160366:"IFCRATIONALBEZIERCURVE",3283111854:"IFCRAMPFLIGHT",3024970846:"IFCRAMP",2262370178:"IFCRAILING",3171933400:"IFCPLATE",1687234759:"IFCPILE",1073191201:"IFCMEMBER",900683007:"IFCFOOTING",3508470533:"IFCFLOWTREATMENTDEVICE",2223149337:"IFCFLOWTERMINAL",707683696:"IFCFLOWSTORAGEDEVICE",987401354:"IFCFLOWSEGMENT",3132237377:"IFCFLOWMOVINGDEVICE",4037862832:"IFCFLOWINSTRUMENTTYPE",4278956645:"IFCFLOWFITTING",2058353004:"IFCFLOWCONTROLLER",4222183408:"IFCFIRESUPPRESSIONTERMINALTYPE",1810631287:"IFCFILTERTYPE",346874300:"IFCFANTYPE",1658829314:"IFCENERGYCONVERSIONDEVICE",857184966:"IFCELECTRICALELEMENT",1634875225:"IFCELECTRICALCIRCUIT",712377611:"IFCELECTRICTIMECONTROLTYPE",1217240411:"IFCELECTRICMOTORTYPE",1365060375:"IFCELECTRICHEATERTYPE",1534661035:"IFCELECTRICGENERATORTYPE",3277789161:"IFCELECTRICFLOWSTORAGEDEVICETYPE",663422040:"IFCELECTRICAPPLIANCETYPE",855621170:"IFCEDGEFEATURE",2030761528:"IFCDUCTSILENCERTYPE",3760055223:"IFCDUCTSEGMENTTYPE",869906466:"IFCDUCTFITTINGTYPE",395920057:"IFCDOOR",3041715199:"IFCDISTRIBUTIONPORT",3040386961:"IFCDISTRIBUTIONFLOWELEMENT",1945004755:"IFCDISTRIBUTIONELEMENT",2063403501:"IFCDISTRIBUTIONCONTROLELEMENTTYPE",1599208980:"IFCDISTRIBUTIONCHAMBERELEMENTTYPE",2635815018:"IFCDISCRETEACCESSORYTYPE",1335981549:"IFCDISCRETEACCESSORY",4147604152:"IFCDIAMETERDIMENSION",3961806047:"IFCDAMPERTYPE",3495092785:"IFCCURTAINWALL",1973544240:"IFCCOVERING",2954562838:"IFCCOOLINGTOWERTYPE",335055490:"IFCCOOLEDBEAMTYPE",488727124:"IFCCONSTRUCTIONPRODUCTRESOURCE",1060000209:"IFCCONSTRUCTIONMATERIALRESOURCE",3898045240:"IFCCONSTRUCTIONEQUIPMENTRESOURCE",1163958913:"IFCCONDITIONCRITERION",2188551683:"IFCCONDITION",2816379211:"IFCCONDENSERTYPE",3850581409:"IFCCOMPRESSORTYPE",843113511:"IFCCOLUMN",2301859152:"IFCCOILTYPE",2611217952:"IFCCIRCLE",2951183804:"IFCCHILLERTYPE",1285652485:"IFCCABLESEGMENTTYPE",3293546465:"IFCCABLECARRIERSEGMENTTYPE",395041908:"IFCCABLECARRIERFITTINGTYPE",1909888760:"IFCBUILDINGELEMENTPROXYTYPE",1095909175:"IFCBUILDINGELEMENTPROXY",2979338954:"IFCBUILDINGELEMENTPART",52481810:"IFCBUILDINGELEMENTCOMPONENT",3299480353:"IFCBUILDINGELEMENT",231477066:"IFCBOILERTYPE",1916977116:"IFCBEZIERCURVE",819618141:"IFCBEAMTYPE",1967976161:"IFCBSPLINECURVE",3460190687:"IFCASSET",2470393545:"IFCANGULARDIMENSION",1871374353:"IFCAIRTOAIRHEATRECOVERYTYPE",3352864051:"IFCAIRTERMINALTYPE",1411407467:"IFCAIRTERMINALBOXTYPE",3821786052:"IFCACTIONREQUEST",1213861670:"IFC2DCOMPOSITECURVE",1033361043:"IFCZONE",3342526732:"IFCWORKSCHEDULE",4218914973:"IFCWORKPLAN",1028945134:"IFCWORKCONTROL",1133259667:"IFCWASTETERMINALTYPE",1898987631:"IFCWALLTYPE",2769231204:"IFCVIRTUALELEMENT",728799441:"IFCVALVETYPE",1911125066:"IFCUNITARYEQUIPMENTTYPE",1600972822:"IFCTUBEBUNDLETYPE",3593883385:"IFCTRIMMEDCURVE",1620046519:"IFCTRANSPORTELEMENT",1692211062:"IFCTRANSFORMERTYPE",1637806684:"IFCTIMESERIESSCHEDULE",5716631:"IFCTANKTYPE",2254336722:"IFCSYSTEM",2315554128:"IFCSWITCHINGDEVICETYPE",148013059:"IFCSUBCONTRACTRESOURCE",1975003073:"IFCSTRUCTURALSURFACECONNECTION",2986769608:"IFCSTRUCTURALRESULTGROUP",1235345126:"IFCSTRUCTURALPOINTREACTION",734778138:"IFCSTRUCTURALPOINTCONNECTION",2082059205:"IFCSTRUCTURALPOINTACTION",3987759626:"IFCSTRUCTURALPLANARACTIONVARYING",1621171031:"IFCSTRUCTURALPLANARACTION",1252848954:"IFCSTRUCTURALLOADGROUP",1721250024:"IFCSTRUCTURALLINEARACTIONVARYING",1807405624:"IFCSTRUCTURALLINEARACTION",2445595289:"IFCSTRUCTURALCURVEMEMBERVARYING",214636428:"IFCSTRUCTURALCURVEMEMBER",4243806635:"IFCSTRUCTURALCURVECONNECTION",1179482911:"IFCSTRUCTURALCONNECTION",682877961:"IFCSTRUCTURALACTION",1039846685:"IFCSTAIRFLIGHTTYPE",3112655638:"IFCSTACKTERMINALTYPE",3812236995:"IFCSPACETYPE",652456506:"IFCSPACEPROGRAM",1305183839:"IFCSPACEHEATERTYPE",3856911033:"IFCSPACE",2533589738:"IFCSLABTYPE",4097777520:"IFCSITE",4105383287:"IFCSERVICELIFE",3517283431:"IFCSCHEDULETIMECONTROL",1768891740:"IFCSANITARYTERMINALTYPE",2863920197:"IFCRELASSIGNSTASKS",160246688:"IFCRELAGGREGATES",2324767716:"IFCRAMPFLIGHTTYPE",2893384427:"IFCRAILINGTYPE",3248260540:"IFCRADIUSDIMENSION",2250791053:"IFCPUMPTYPE",1842657554:"IFCPROTECTIVEDEVICETYPE",3651124850:"IFCPROJECTIONELEMENT",3642467123:"IFCPROJECTORDERRECORD",2904328755:"IFCPROJECTORDER",2744685151:"IFCPROCEDURE",3740093272:"IFCPORT",3724593414:"IFCPOLYLINE",4017108033:"IFCPLATETYPE",4231323485:"IFCPIPESEGMENTTYPE",804291784:"IFCPIPEFITTINGTYPE",3327091369:"IFCPERMIT",2382730787:"IFCPERFORMANCEHISTORY",2837617999:"IFCOUTLETTYPE",3425660407:"IFCORDERACTION",3588315303:"IFCOPENINGELEMENT",4143007308:"IFCOCCUPANT",1916936684:"IFCMOVE",977012517:"IFCMOTORCONNECTIONTYPE",3181161470:"IFCMEMBERTYPE",2108223431:"IFCMECHANICALFASTENERTYPE",377706215:"IFCMECHANICALFASTENER",2506943328:"IFCLINEARDIMENSION",1161773419:"IFCLIGHTFIXTURETYPE",1051575348:"IFCLAMPTYPE",3827777499:"IFCLABORRESOURCE",4288270099:"IFCJUNCTIONBOXTYPE",2391368822:"IFCINVENTORY",1806887404:"IFCHUMIDIFIERTYPE",1251058090:"IFCHEATEXCHANGERTYPE",2706460486:"IFCGROUP",3009204131:"IFCGRID",200128114:"IFCGASTERMINALTYPE",814719939:"IFCFURNITURESTANDARD",263784265:"IFCFURNISHINGELEMENT",3009222698:"IFCFLOWTREATMENTDEVICETYPE",2297155007:"IFCFLOWTERMINALTYPE",1339347760:"IFCFLOWSTORAGEDEVICETYPE",1834744321:"IFCFLOWSEGMENTTYPE",1482959167:"IFCFLOWMOVINGDEVICETYPE",3815607619:"IFCFLOWMETERTYPE",3198132628:"IFCFLOWFITTINGTYPE",3907093117:"IFCFLOWCONTROLLERTYPE",1287392070:"IFCFEATUREELEMENTSUBTRACTION",2143335405:"IFCFEATUREELEMENTADDITION",2827207264:"IFCFEATUREELEMENT",2489546625:"IFCFASTENERTYPE",647756555:"IFCFASTENER",3737207727:"IFCFACETEDBREPWITHVOIDS",807026263:"IFCFACETEDBREP",3390157468:"IFCEVAPORATORTYPE",3174744832:"IFCEVAPORATIVECOOLERTYPE",3272907226:"IFCEQUIPMENTSTANDARD",1962604670:"IFCEQUIPMENTELEMENT",2107101300:"IFCENERGYCONVERSIONDEVICETYPE",1704287377:"IFCELLIPSE",2590856083:"IFCELEMENTCOMPONENTTYPE",1623761950:"IFCELEMENTCOMPONENT",4123344466:"IFCELEMENTASSEMBLY",1758889154:"IFCELEMENT",360485395:"IFCELECTRICALBASEPROPERTIES",3849074793:"IFCDISTRIBUTIONFLOWELEMENTTYPE",3256556792:"IFCDISTRIBUTIONELEMENTTYPE",681481545:"IFCDIMENSIONCURVEDIRECTEDCALLOUT",1457835157:"IFCCURTAINWALLTYPE",3295246426:"IFCCREWRESOURCE",1916426348:"IFCCOVERINGTYPE",1419761937:"IFCCOSTSCHEDULE",3895139033:"IFCCOSTITEM",3293443760:"IFCCONTROL",2559216714:"IFCCONSTRUCTIONRESOURCE",2510884976:"IFCCONIC",3732776249:"IFCCOMPOSITECURVE",300633059:"IFCCOLUMNTYPE",2937912522:"IFCCIRCLEHOLLOWPROFILEDEF",3124254112:"IFCBUILDINGSTOREY",1950629157:"IFCBUILDINGELEMENTTYPE",4031249490:"IFCBUILDING",1260505505:"IFCBOUNDEDCURVE",3649129432:"IFCBOOLEANCLIPPINGRESULT",1334484129:"IFCBLOCK",3207858831:"IFCASYMMETRICISHAPEPROFILEDEF",1674181508:"IFCANNOTATION",2296667514:"IFCACTOR",2097647324:"IFCTRANSPORTELEMENTTYPE",3473067441:"IFCTASK",1580310250:"IFCSYSTEMFURNITUREELEMENTTYPE",4124788165:"IFCSURFACEOFREVOLUTION",2809605785:"IFCSURFACEOFLINEAREXTRUSION",2028607225:"IFCSURFACECURVESWEPTAREASOLID",4070609034:"IFCSTRUCTUREDDIMENSIONCALLOUT",2218152070:"IFCSTRUCTURALSURFACEMEMBERVARYING",3979015343:"IFCSTRUCTURALSURFACEMEMBER",3689010777:"IFCSTRUCTURALREACTION",530289379:"IFCSTRUCTURALMEMBER",3136571912:"IFCSTRUCTURALITEM",3544373492:"IFCSTRUCTURALACTIVITY",451544542:"IFCSPHERE",3893378262:"IFCSPATIALSTRUCTUREELEMENTTYPE",2706606064:"IFCSPATIALSTRUCTUREELEMENT",3626867408:"IFCRIGHTCIRCULARCYLINDER",4158566097:"IFCRIGHTCIRCULARCONE",1856042241:"IFCREVOLVEDAREASOLID",2914609552:"IFCRESOURCE",1401173127:"IFCRELVOIDSELEMENT",3451746338:"IFCRELSPACEBOUNDARY",366585022:"IFCRELSERVICESBUILDINGS",4122056220:"IFCRELSEQUENCE",1058617721:"IFCRELSCHEDULESCOSTITEMS",1245217292:"IFCRELREFERENCEDINSPATIALSTRUCTURE",750771296:"IFCRELPROJECTSELEMENT",202636808:"IFCRELOVERRIDESPROPERTIES",2051452291:"IFCRELOCCUPIESSPACES",3268803585:"IFCRELNESTS",4189434867:"IFCRELINTERACTIONREQUIREMENTS",279856033:"IFCRELFLOWCONTROLELEMENTS",3940055652:"IFCRELFILLSELEMENT",781010003:"IFCRELDEFINESBYTYPE",4186316022:"IFCRELDEFINESBYPROPERTIES",693640335:"IFCRELDEFINES",2551354335:"IFCRELDECOMPOSES",2802773753:"IFCRELCOVERSSPACES",886880790:"IFCRELCOVERSBLDGELEMENTS",3242617779:"IFCRELCONTAINEDINSPATIALSTRUCTURE",3678494232:"IFCRELCONNECTSWITHREALIZINGELEMENTS",504942748:"IFCRELCONNECTSWITHECCENTRICITY",1638771189:"IFCRELCONNECTSSTRUCTURALMEMBER",3912681535:"IFCRELCONNECTSSTRUCTURALELEMENT",2127690289:"IFCRELCONNECTSSTRUCTURALACTIVITY",3190031847:"IFCRELCONNECTSPORTS",4201705270:"IFCRELCONNECTSPORTTOELEMENT",3945020480:"IFCRELCONNECTSPATHELEMENTS",1204542856:"IFCRELCONNECTSELEMENTS",826625072:"IFCRELCONNECTS",2851387026:"IFCRELASSOCIATESPROFILEPROPERTIES",2655215786:"IFCRELASSOCIATESMATERIAL",3840914261:"IFCRELASSOCIATESLIBRARY",982818633:"IFCRELASSOCIATESDOCUMENT",2728634034:"IFCRELASSOCIATESCONSTRAINT",919958153:"IFCRELASSOCIATESCLASSIFICATION",4095574036:"IFCRELASSOCIATESAPPROVAL",1327628568:"IFCRELASSOCIATESAPPLIEDVALUE",1865459582:"IFCRELASSOCIATES",205026976:"IFCRELASSIGNSTORESOURCE",3372526763:"IFCRELASSIGNSTOPROJECTORDER",2857406711:"IFCRELASSIGNSTOPRODUCT",4278684876:"IFCRELASSIGNSTOPROCESS",1307041759:"IFCRELASSIGNSTOGROUP",2495723537:"IFCRELASSIGNSTOCONTROL",1683148259:"IFCRELASSIGNSTOACTOR",3939117080:"IFCRELASSIGNS",3454111270:"IFCRECTANGULARTRIMMEDSURFACE",2798486643:"IFCRECTANGULARPYRAMID",2770003689:"IFCRECTANGLEHOLLOWPROFILEDEF",3219374653:"IFCPROXY",1451395588:"IFCPROPERTYSET",4194566429:"IFCPROJECTIONCURVE",103090709:"IFCPROJECT",4208778838:"IFCPRODUCT",2945172077:"IFCPROCESS",220341763:"IFCPLANE",603570806:"IFCPLANARBOX",3566463478:"IFCPERMEABLECOVERINGPROPERTIES",3505215534:"IFCOFFSETCURVE3D",3388369263:"IFCOFFSETCURVE2D",3888040117:"IFCOBJECT",1425443689:"IFCMANIFOLDSOLIDBREP",1281925730:"IFCLINE",572779678:"IFCLSHAPEPROFILEDEF",1484403080:"IFCISHAPEPROFILEDEF",987898635:"IFCGEOMETRICCURVESET",1268542332:"IFCFURNITURETYPE",4238390223:"IFCFURNISHINGELEMENTTYPE",3455213021:"IFCFLUIDFLOWPROPERTIES",315944413:"IFCFILLAREASTYLETILES",4203026998:"IFCFILLAREASTYLETILESYMBOLWITHSTYLE",374418227:"IFCFILLAREASTYLEHATCHING",2047409740:"IFCFACEBASEDSURFACEMODEL",477187591:"IFCEXTRUDEDAREASOLID",80994333:"IFCENERGYPROPERTIES",2835456948:"IFCELLIPSEPROFILEDEF",2777663545:"IFCELEMENTARYSURFACE",339256511:"IFCELEMENTTYPE",1883228015:"IFCELEMENTQUANTITY",1472233963:"IFCEDGELOOP",4006246654:"IFCDRAUGHTINGPREDEFINEDCURVEFONT",445594917:"IFCDRAUGHTINGPREDEFINEDCOLOUR",3073041342:"IFCDRAUGHTINGCALLOUT",526551008:"IFCDOORSTYLE",1714330368:"IFCDOORPANELPROPERTIES",2963535650:"IFCDOORLININGPROPERTIES",32440307:"IFCDIRECTION",4054601972:"IFCDIMENSIONCURVETERMINATOR",606661476:"IFCDIMENSIONCURVE",693772133:"IFCDEFINEDSYMBOL",2827736869:"IFCCURVEBOUNDEDPLANE",2601014836:"IFCCURVE",2147822146:"IFCCSGSOLID",2506170314:"IFCCSGPRIMITIVE3D",194851669:"IFCCRANERAILFSHAPEPROFILEDEF",4133800736:"IFCCRANERAILASHAPEPROFILEDEF",2485617015:"IFCCOMPOSITECURVESEGMENT",2205249479:"IFCCLOSEDSHELL",1383045692:"IFCCIRCLEPROFILEDEF",1416205885:"IFCCARTESIANTRANSFORMATIONOPERATOR3DNONUNIFORM",3331915920:"IFCCARTESIANTRANSFORMATIONOPERATOR3D",3486308946:"IFCCARTESIANTRANSFORMATIONOPERATOR2DNONUNIFORM",3749851601:"IFCCARTESIANTRANSFORMATIONOPERATOR2D",59481748:"IFCCARTESIANTRANSFORMATIONOPERATOR",1123145078:"IFCCARTESIANPOINT",2898889636:"IFCCSHAPEPROFILEDEF",2713105998:"IFCBOXEDHALFSPACE",2581212453:"IFCBOUNDINGBOX",4182860854:"IFCBOUNDEDSURFACE",2736907675:"IFCBOOLEANRESULT",2740243338:"IFCAXIS2PLACEMENT3D",3125803723:"IFCAXIS2PLACEMENT2D",4261334040:"IFCAXIS1PLACEMENT",1302238472:"IFCANNOTATIONSURFACE",2265737646:"IFCANNOTATIONFILLAREAOCCURRENCE",669184980:"IFCANNOTATIONFILLAREA",3288037868:"IFCANNOTATIONCURVEOCCURRENCE",2543172580:"IFCZSHAPEPROFILEDEF",1299126871:"IFCWINDOWSTYLE",512836454:"IFCWINDOWPANELPROPERTIES",336235671:"IFCWINDOWLININGPROPERTIES",2759199220:"IFCVERTEXLOOP",1417489154:"IFCVECTOR",427810014:"IFCUSHAPEPROFILEDEF",2347495698:"IFCTYPEPRODUCT",1628702193:"IFCTYPEOBJECT",1345879162:"IFCTWODIRECTIONREPEATFACTOR",2715220739:"IFCTRAPEZIUMPROFILEDEF",3124975700:"IFCTEXTLITERALWITHEXTENT",4282788508:"IFCTEXTLITERAL",3028897424:"IFCTERMINATORSYMBOL",3071757647:"IFCTSHAPEPROFILEDEF",230924584:"IFCSWEPTSURFACE",1260650574:"IFCSWEPTDISKSOLID",2247615214:"IFCSWEPTAREASOLID",1878645084:"IFCSURFACESTYLERENDERING",2513912981:"IFCSURFACE",2233826070:"IFCSUBEDGE",3653947884:"IFCSTRUCTURALSTEELPROFILEPROPERTIES",3843319758:"IFCSTRUCTURALPROFILEPROPERTIES",1190533807:"IFCSTRUCTURALLOADSINGLEFORCEWARPING",1597423693:"IFCSTRUCTURALLOADSINGLEFORCE",1973038258:"IFCSTRUCTURALLOADSINGLEDISPLACEMENTDISTORTION",2473145415:"IFCSTRUCTURALLOADSINGLEDISPLACEMENT",2668620305:"IFCSTRUCTURALLOADPLANARFORCE",1595516126:"IFCSTRUCTURALLOADLINEARFORCE",390701378:"IFCSPACETHERMALLOADPROPERTIES",1202362311:"IFCSOUNDVALUE",2485662743:"IFCSOUNDPROPERTIES",723233188:"IFCSOLIDMODEL",2609359061:"IFCSLIPPAGECONNECTIONCONDITION",4124623270:"IFCSHELLBASEDSURFACEMODEL",2411513650:"IFCSERVICELIFEFACTOR",1509187699:"IFCSECTIONEDSPINE",2778083089:"IFCROUNDEDRECTANGLEPROFILEDEF",478536968:"IFCRELATIONSHIP",3765753017:"IFCREINFORCEMENTDEFINITIONPROPERTIES",3413951693:"IFCREGULARTIMESERIES",3615266464:"IFCRECTANGLEPROFILEDEF",110355661:"IFCPROPERTYTABLEVALUE",3650150729:"IFCPROPERTYSINGLEVALUE",3357820518:"IFCPROPERTYSETDEFINITION",941946838:"IFCPROPERTYREFERENCEVALUE",2752243245:"IFCPROPERTYLISTVALUE",4166981789:"IFCPROPERTYENUMERATEDVALUE",1680319473:"IFCPROPERTYDEFINITION",871118103:"IFCPROPERTYBOUNDEDVALUE",673634403:"IFCPRODUCTDEFINITIONSHAPE",179317114:"IFCPREDEFINEDPOINTMARKERSYMBOL",433424934:"IFCPREDEFINEDDIMENSIONSYMBOL",2559016684:"IFCPREDEFINEDCURVEFONT",759155922:"IFCPREDEFINEDCOLOUR",2775532180:"IFCPOLYGONALBOUNDEDHALFSPACE",2924175390:"IFCPOLYLOOP",1423911732:"IFCPOINTONSURFACE",4022376103:"IFCPOINTONCURVE",2067069095:"IFCPOINT",1663979128:"IFCPLANAREXTENT",2004835150:"IFCPLACEMENT",597895409:"IFCPIXELTEXTURE",3021840470:"IFCPHYSICALCOMPLEXQUANTITY",2519244187:"IFCPATH",2529465313:"IFCPARAMETERIZEDPROFILEDEF",1029017970:"IFCORIENTEDEDGE",2665983363:"IFCOPENSHELL",2833995503:"IFCONEDIRECTIONREPEATFACTOR",219451334:"IFCOBJECTDEFINITION",1430189142:"IFCMECHANICALCONCRETEMATERIALPROPERTIES",2022407955:"IFCMATERIALDEFINITIONREPRESENTATION",2347385850:"IFCMAPPEDITEM",1008929658:"IFCLOOP",2624227202:"IFCLOCALPLACEMENT",3422422726:"IFCLIGHTSOURCESPOT",1520743889:"IFCLIGHTSOURCEPOSITIONAL",4266656042:"IFCLIGHTSOURCEGONIOMETRIC",2604431987:"IFCLIGHTSOURCEDIRECTIONAL",125510826:"IFCLIGHTSOURCEAMBIENT",1402838566:"IFCLIGHTSOURCE",3741457305:"IFCIRREGULARTIMESERIES",3905492369:"IFCIMAGETEXTURE",2445078500:"IFCHYGROSCOPICMATERIALPROPERTIES",812098782:"IFCHALFSPACESOLID",178086475:"IFCGRIDPLACEMENT",3590301190:"IFCGEOMETRICSET",4142052618:"IFCGEOMETRICREPRESENTATIONSUBCONTEXT",2453401579:"IFCGEOMETRICREPRESENTATIONITEM",3448662350:"IFCGEOMETRICREPRESENTATIONCONTEXT",1446786286:"IFCGENERALPROFILEPROPERTIES",803998398:"IFCGENERALMATERIALPROPERTIES",3857492461:"IFCFUELPROPERTIES",738692330:"IFCFILLAREASTYLE",4219587988:"IFCFAILURECONNECTIONCONDITION",3008276851:"IFCFACESURFACE",803316827:"IFCFACEOUTERBOUND",1809719519:"IFCFACEBOUND",2556980723:"IFCFACE",1860660968:"IFCEXTENDEDMATERIALPROPERTIES",476780140:"IFCEDGECURVE",3900360178:"IFCEDGE",4170525392:"IFCDRAUGHTINGPREDEFINEDTEXTFONT",3732053477:"IFCDOCUMENTREFERENCE",1694125774:"IFCDIMENSIONPAIR",2273265877:"IFCDIMENSIONCALLOUTRELATIONSHIP",3632507154:"IFCDERIVEDPROFILEDEF",3800577675:"IFCCURVESTYLE",2889183280:"IFCCONVERSIONBASEDUNIT",3050246964:"IFCCONTEXTDEPENDENTUNIT",45288368:"IFCCONNECTIONPOINTECCENTRICITY",1981873012:"IFCCONNECTIONCURVEGEOMETRY",370225590:"IFCCONNECTEDFACESET",1485152156:"IFCCOMPOSITEPROFILEDEF",2542286263:"IFCCOMPLEXPROPERTY",776857604:"IFCCOLOURRGB",647927063:"IFCCLASSIFICATIONREFERENCE",3150382593:"IFCCENTERLINEPROFILEDEF",616511568:"IFCBLOBTEXTURE",2705031697:"IFCARBITRARYPROFILEDEFWITHVOIDS",1310608509:"IFCARBITRARYOPENPROFILEDEF",3798115385:"IFCARBITRARYCLOSEDPROFILEDEF",2297822566:"IFCANNOTATIONTEXTOCCURRENCE",3612888222:"IFCANNOTATIONSYMBOLOCCURRENCE",962685235:"IFCANNOTATIONSURFACEOCCURRENCE",2442683028:"IFCANNOTATIONOCCURRENCE",1065908215:"IFCWATERPROPERTIES",891718957:"IFCVIRTUALGRIDINTERSECTION",1907098498:"IFCVERTEXPOINT",3304826586:"IFCVERTEXBASEDTEXTUREMAP",2799835756:"IFCVERTEX",180925521:"IFCUNITASSIGNMENT",1735638870:"IFCTOPOLOGYREPRESENTATION",1377556343:"IFCTOPOLOGICALREPRESENTATIONITEM",581633288:"IFCTIMESERIESVALUE",1718945513:"IFCTIMESERIESREFERENCERELATIONSHIP",3101149627:"IFCTIMESERIES",3317419933:"IFCTHERMALMATERIALPROPERTIES",1210645708:"IFCTEXTUREVERTEX",2552916305:"IFCTEXTUREMAP",1742049831:"IFCTEXTURECOORDINATEGENERATOR",280115917:"IFCTEXTURECOORDINATE",1484833681:"IFCTEXTSTYLEWITHBOXCHARACTERISTICS",1640371178:"IFCTEXTSTYLETEXTMODEL",2636378356:"IFCTEXTSTYLEFORDEFINEDFONT",1983826977:"IFCTEXTSTYLEFONTMODEL",1447204868:"IFCTEXTSTYLE",912023232:"IFCTELECOMADDRESS",531007025:"IFCTABLEROW",985171141:"IFCTABLE",1290481447:"IFCSYMBOLSTYLE",626085974:"IFCSURFACETEXTURE",1351298697:"IFCSURFACESTYLEWITHTEXTURES",846575682:"IFCSURFACESTYLESHADING",1607154358:"IFCSURFACESTYLEREFRACTION",3303107099:"IFCSURFACESTYLELIGHTING",1300840506:"IFCSURFACESTYLE",3049322572:"IFCSTYLEDREPRESENTATION",3958052878:"IFCSTYLEDITEM",2830218821:"IFCSTYLEMODEL",3408363356:"IFCSTRUCTURALLOADTEMPERATURE",2525727697:"IFCSTRUCTURALLOADSTATIC",2162789131:"IFCSTRUCTURALLOAD",2273995522:"IFCSTRUCTURALCONNECTIONCONDITION",3692461612:"IFCSIMPLEPROPERTY",4240577450:"IFCSHAPEREPRESENTATION",3982875396:"IFCSHAPEMODEL",867548509:"IFCSHAPEASPECT",4165799628:"IFCSECTIONREINFORCEMENTPROPERTIES",2042790032:"IFCSECTIONPROPERTIES",448429030:"IFCSIUNIT",2341007311:"IFCROOT",3679540991:"IFCRIBPLATEPROFILEPROPERTIES",1660063152:"IFCREPRESENTATIONMAP",3008791417:"IFCREPRESENTATIONITEM",3377609919:"IFCREPRESENTATIONCONTEXT",1076942058:"IFCREPRESENTATION",1222501353:"IFCRELAXATION",1580146022:"IFCREINFORCEMENTBARPROPERTIES",2692823254:"IFCREFERENCESVALUEDOCUMENT",825690147:"IFCQUANTITYWEIGHT",2405470396:"IFCQUANTITYVOLUME",3252649465:"IFCQUANTITYTIME",931644368:"IFCQUANTITYLENGTH",2093928680:"IFCQUANTITYCOUNT",2044713172:"IFCQUANTITYAREA",3710013099:"IFCPROPERTYENUMERATION",148025276:"IFCPROPERTYDEPENDENCYRELATIONSHIP",3896028662:"IFCPROPERTYCONSTRAINTRELATIONSHIP",2598011224:"IFCPROPERTY",2802850158:"IFCPROFILEPROPERTIES",3958567839:"IFCPROFILEDEF",2267347899:"IFCPRODUCTSOFCOMBUSTIONPROPERTIES",2095639259:"IFCPRODUCTREPRESENTATION",2417041796:"IFCPRESENTATIONSTYLEASSIGNMENT",3119450353:"IFCPRESENTATIONSTYLE",1304840413:"IFCPRESENTATIONLAYERWITHSTYLE",2022622350:"IFCPRESENTATIONLAYERASSIGNMENT",1775413392:"IFCPREDEFINEDTEXTFONT",3213052703:"IFCPREDEFINEDTERMINATORSYMBOL",990879717:"IFCPREDEFINEDSYMBOL",3727388367:"IFCPREDEFINEDITEM",3355820592:"IFCPOSTALADDRESS",2226359599:"IFCPHYSICALSIMPLEQUANTITY",2483315170:"IFCPHYSICALQUANTITY",101040310:"IFCPERSONANDORGANIZATION",2077209135:"IFCPERSON",1207048766:"IFCOWNERHISTORY",1411181986:"IFCORGANIZATIONRELATIONSHIP",4251960020:"IFCORGANIZATION",1227763645:"IFCOPTICALMATERIALPROPERTIES",2251480897:"IFCOBJECTIVE",3701648758:"IFCOBJECTPLACEMENT",1918398963:"IFCNAMEDUNIT",2706619895:"IFCMONETARYUNIT",3368373690:"IFCMETRIC",677618848:"IFCMECHANICALSTEELMATERIALPROPERTIES",4256014907:"IFCMECHANICALMATERIALPROPERTIES",2597039031:"IFCMEASUREWITHUNIT",3265635763:"IFCMATERIALPROPERTIES",2199411900:"IFCMATERIALLIST",1303795690:"IFCMATERIALLAYERSETUSAGE",3303938423:"IFCMATERIALLAYERSET",248100487:"IFCMATERIALLAYER",1847130766:"IFCMATERIALCLASSIFICATIONRELATIONSHIP",1838606355:"IFCMATERIAL",30780891:"IFCLOCALTIME",1566485204:"IFCLIGHTINTENSITYDISTRIBUTION",4162380809:"IFCLIGHTDISTRIBUTIONDATA",3452421091:"IFCLIBRARYREFERENCE",2655187982:"IFCLIBRARYINFORMATION",3020489413:"IFCIRREGULARTIMESERIESVALUE",852622518:"IFCGRIDAXIS",3548104201:"IFCEXTERNALLYDEFINEDTEXTFONT",3207319532:"IFCEXTERNALLYDEFINEDSYMBOL",1040185647:"IFCEXTERNALLYDEFINEDSURFACESTYLE",2242383968:"IFCEXTERNALLYDEFINEDHATCHSTYLE",3200245327:"IFCEXTERNALREFERENCE",1648886627:"IFCENVIRONMENTALIMPACTVALUE",3796139169:"IFCDRAUGHTINGCALLOUTRELATIONSHIP",770865208:"IFCDOCUMENTINFORMATIONRELATIONSHIP",1154170062:"IFCDOCUMENTINFORMATION",1376555844:"IFCDOCUMENTELECTRONICFORMAT",2949456006:"IFCDIMENSIONALEXPONENTS",1045800335:"IFCDERIVEDUNITELEMENT",1765591967:"IFCDERIVEDUNIT",1072939445:"IFCDATEANDTIME",3510044353:"IFCCURVESTYLEFONTPATTERN",2367409068:"IFCCURVESTYLEFONTANDSCALING",1105321065:"IFCCURVESTYLEFONT",539742890:"IFCCURRENCYRELATIONSHIP",602808272:"IFCCOSTVALUE",1065062679:"IFCCOORDINATEDUNIVERSALTIMEOFFSET",347226245:"IFCCONSTRAINTRELATIONSHIP",613356794:"IFCCONSTRAINTCLASSIFICATIONRELATIONSHIP",1658513725:"IFCCONSTRAINTAGGREGATIONRELATIONSHIP",1959218052:"IFCCONSTRAINT",2732653382:"IFCCONNECTIONSURFACEGEOMETRY",4257277454:"IFCCONNECTIONPORTGEOMETRY",2614616156:"IFCCONNECTIONPOINTGEOMETRY",2859738748:"IFCCONNECTIONGEOMETRY",3264961684:"IFCCOLOURSPECIFICATION",3639012971:"IFCCLASSIFICATIONNOTATIONFACET",938368621:"IFCCLASSIFICATIONNOTATION",1098599126:"IFCCLASSIFICATIONITEMRELATIONSHIP",1767535486:"IFCCLASSIFICATIONITEM",747523909:"IFCCLASSIFICATION",622194075:"IFCCALENDARDATE",2069777674:"IFCBOUNDARYNODECONDITIONWARPING",1387855156:"IFCBOUNDARYNODECONDITION",3367102660:"IFCBOUNDARYFACECONDITION",1560379544:"IFCBOUNDARYEDGECONDITION",4037036970:"IFCBOUNDARYCONDITION",3869604511:"IFCAPPROVALRELATIONSHIP",390851274:"IFCAPPROVALPROPERTYRELATIONSHIP",2080292479:"IFCAPPROVALACTORRELATIONSHIP",130549933:"IFCAPPROVAL",1110488051:"IFCAPPLIEDVALUERELATIONSHIP",411424972:"IFCAPPLIEDVALUE",639542469:"IFCAPPLICATION",618182010:"IFCADDRESS",3630933823:"IFCACTORROLE",599546466:"FILE_DESCRIPTION",1390159747:"FILE_NAME",1109904537:"FILE_SCHEMA"};class c{static async getUnits(F){var R;const{IFCUNITASSIGNMENT:E}=w,I=await F.getAllPropertiesOfType(E);if(!I)return 1;const C=Object.keys(I),T=I[parseInt(C[0],10)];for(const A of T.Units){if(A.value===void 0||A.value===null)continue;const N=await F.getProperties(A.value);if(!N||!N.UnitType||!N.UnitType.value||N.UnitType.value!=="LENGTHUNIT")continue;let S=1,P=1;return N.Name.value==="METRE"&&(P=1),N.Name.value==="FOOT"&&(P=.3048),((R=N.Prefix)==null?void 0:R.value)==="MILLI"&&(S=.001),P*S}return 1}static async findItemByGuid(F,E){var C;const I=F.getAllPropertiesIDs();for(const T of I){const R=await F.getProperties(T);if(R&&((C=R.GlobalId)==null?void 0:C.value)===E)return R}return null}static async getRelationMap(F,E,I){var N;const T=I??(async()=>{}),R={},A=F.getAllPropertiesIDs();for(const O of A){const S=await F.getProperties(O);if(!S)continue;const P=S.type===E,M=Object.keys(S).find(s=>s.startsWith("Relating")),e=Object.keys(S).find(s=>s.startsWith("Related"));if(!(P&&M&&e))continue;const t=await F.getProperties((N=S[M])==null?void 0:N.value),U=S[e];if(!t||!U||!(U&&Array.isArray(U)))continue;const i=U.map(s=>s.value);await T(t.expressID,i),R[t.expressID]=i}return R}static async getQsetQuantities(F,E,I){const T=I??(()=>{}),R=await F.getProperties(E);return!R||R.type!==v?null:(R.Quantities??[{}]).map(O=>(O.value&&T(O.value),O.value)).filter(O=>O!==null)}static async getPsetProps(F,E,I){const T=I??(()=>{}),R=await F.getProperties(E);return!R||R.type!==x?null:(R.HasProperties??[{}]).map(O=>(O.value&&T(O.value),O.value)).filter(O=>O!==null)}static async getPsetRel(F,E){var A;if(!await F.getProperties(E))return null;const C=await F.getAllPropertiesOfType(V);if(!C)return null;const T=Object.values(C);let R=null;for(const N of T)((A=N.RelatingPropertyDefinition)==null?void 0:A.value)===E&&(R=N.expressID);return R}static async getQsetRel(F,E){return c.getPsetRel(F,E)}static async getEntityName(F,E){var R;const I=await F.getProperties(E);if(!I)return{key:null,name:null};const C=Object.keys(I).find(A=>A.endsWith("Name"))??null,T=C?(R=I[C])==null?void 0:R.value:null;return{key:C,name:T}}static async getQuantityValue(F,E){const I=await F.getProperties(E);if(!I)return{key:null,value:null};const C=Object.keys(I).find(R=>R.endsWith("Value"))??null;let T;return C===null||I[C]===void 0||I[C]===null?T=null:T=I[C].value,{key:C,value:T}}static isRel(F){return K[F].startsWith("IFCREL")}static async attributeExists(F,E,I){const C=await F.getProperties(E);return C?Object.keys(C).includes(I):!1}static async groupEntitiesByType(F,E){var C;const I=new Map;for(const T of E){const R=await F.getProperties(T);if(!R)continue;const A=R.type;I.get(A)||I.set(A,new Set),(C=I.get(A))==null||C.add(T)}return I}}const Q=new Map([[H,{forRelating:"IsDecomposedBy",forRelated:"Decomposes"}],[p,{forRelating:"AssociatedTo",forRelated:"HasAssociations"}],[f,{forRelating:"ClassificationForObjects",forRelated:"HasAssociations"}],[d,{forRelating:"IsGroupedBy",forRelated:"HasAssignments"}],[V,{forRelated:"IsDefinedBy",forRelating:"DefinesOcurrence"}],[W,{forRelated:"IsTypedBy",forRelating:"Types"}],[g,{forRelated:"IsDefinedBy",forRelating:"Defines"}],[X,{forRelated:"ContainedInStructure",forRelating:"ContainsElements"}]]),r=class r extends y{constructor(E){super(E);L(this,"onDisposed",new o);L(this,"enabled",!0);L(this,"onRelationsIndexed",new o);L(this,"_relToAttributesMap",Q);L(this,"_inverseAttributes",["IsDecomposedBy","Decomposes","AssociatedTo","HasAssociations","ClassificationForObjects","IsGroupedBy","HasAssignments","IsDefinedBy","DefinesOcurrence","IsTypedBy","Types","Defines","ContainedInStructure","ContainsElements"]);L(this,"_ifcRels",[H,p,f,d,V,W,g,X]);L(this,"relationMaps",{});L(this,"onFragmentsDisposed",E=>{delete this.relationMaps[E.groupID]});this.components.add(r.uuid,this),E.get(a).onFragmentsDisposed.add(this.onFragmentsDisposed)}setRelationMap(E,I){this.relationMaps[E.uuid]=I,this.onRelationsIndexed.trigger({modelID:E.uuid,relationsMap:I})}async process(E){if(!E.hasProperties)throw new Error("FragmentsGroup properties not found");let I=this.relationMaps[E.uuid];if(I)return I;I=new Map;for(const C of this._ifcRels)await c.getRelationMap(E,C,async(T,R)=>{const A=this._relToAttributesMap.get(C);if(!A)return;const{forRelated:N,forRelating:O}=A,S=I.get(T)??new Map,P=this._inverseAttributes.indexOf(O);S.set(P,R),I.set(T,S);for(const M of R){const e=I.get(M)??new Map,t=this._inverseAttributes.indexOf(N),U=e.get(t)??[];U.push(T),e.set(t,U),I.set(M,e)}});return this.setRelationMap(E,I),I}async processFromWebIfc(E,I){const C=new Map;for(const T of this._ifcRels){const R=this._relToAttributesMap.get(T);if(!R)continue;const{forRelated:A,forRelating:N}=R,O=E.GetLineIDsWithType(I,T);for(let S=0;SD.startsWith("Relating")),e=Object.keys(P).find(D=>D.startsWith("Related"));if(!(M&&e))continue;const t=P[M].value,U=P[e].map(D=>D.value),i=C.get(t)??new Map,s=this._inverseAttributes.indexOf(N);i.set(s,U),C.set(t,i);for(const D of U){const G=C.get(D)??new Map,B=this._inverseAttributes.indexOf(A),u=G.get(B)??[];u.push(t),G.set(B,u),C.set(D,G)}}}return this.onRelationsIndexed.trigger({modelID:I.toString(),relationsMap:C}),C}getEntityRelations(E,I,C){const T=this.relationMaps[E.uuid];if(!T)return null;const R=T.get(I),A=this._inverseAttributes.indexOf(C);if(!R||A===-1)return null;const N=R.get(A);return N||null}serializeRelations(E){const I={};for(const[C,T]of E.entries()){I[C]||(I[C]={});for(const[R,A]of T.entries())I[C][R]=A}return JSON.stringify(I)}serializeModelRelations(E){const I=this.relationMaps[E.uuid];return I?this.serializeRelations(I):null}serializeAllRelations(){const E={};for(const I in this.relationMaps){const C=this.relationMaps[I],T={};for(const[R,A]of C.entries()){T[R]||(T[R]={});for(const[N,O]of A.entries())T[R][N]=O}E[I]=T}return JSON.stringify(E)}getRelationsMapFromJSON(E){const I=JSON.parse(E),C=new Map;for(const T in I){const R=I[T],A=new Map;for(const N in R)A.set(Number(N),R[N]);C.set(Number(T),A)}return C}dispose(){this.relationMaps={},this.components.get(a).onFragmentsDisposed.remove(this.onFragmentsDisposed),this.onDisposed.trigger(r.uuid),this.onDisposed.reset()}};L(r,"uuid","23a889ab-83b3-44a4-8bee-ead83438370b");let l=r;export{a as F,l as I,c as a}; +var h=Object.defineProperty;var m=(n,F,E)=>F in n?h(n,F,{enumerable:!0,configurable:!0,writable:!0,value:E}):n[F]=E;var L=(n,F,E)=>(m(n,typeof F!="symbol"?F+"":F,E),E);import{$ as b,am as v,af as x,a4 as V,ac as w,a0 as H,a1 as p,a2 as f,a3 as d,a5 as W,a6 as g,a7 as X}from"./web-ifc-api-BC8YMRiS.js";import{C as y,E as o}from"./index-BraZXcLv.js";const Y=class Y extends y{constructor(E){super(E);L(this,"onDisposed",new o);L(this,"onFragmentsLoaded",new o);L(this,"onFragmentsDisposed",new o);L(this,"list",new Map);L(this,"groups",new Map);L(this,"enabled",!0);L(this,"baseCoordinationModel","");L(this,"_loader",new b);this.components.add(Y.uuid,this)}get meshes(){const E=[];for(const[I,C]of this.list)E.push(C.mesh);return E}dispose(){for(const[E,I]of this.groups)I.dispose(!0);this.baseCoordinationModel="",this.groups.clear(),this.list.clear(),this.onFragmentsLoaded.reset(),this.onFragmentsDisposed.reset(),this.onDisposed.trigger(),this.onDisposed.reset()}disposeGroup(E){const{uuid:I}=E,C=[];for(const T of E.items)C.push(T.id),this.list.delete(T.id);E.dispose(!0),this.groups.delete(E.uuid),this.onFragmentsDisposed.trigger({groupID:I,fragmentIDs:C})}load(E,I){const T={...{coordinate:!0},...I},{coordinate:R,properties:A,relationsMap:N}=T,O=this._loader.import(E);for(const S of O.items)S.group=O,this.list.set(S.id,S);return R&&this.coordinate([O]),this.groups.set(O.uuid,O),A&&O.setLocalProperties(A),N&&this.components.get(l).setRelationMap(O,N),this.onFragmentsLoaded.trigger(O),O}export(E){return this._loader.export(E)}coordinate(E=Array.from(this.groups.values())){if(this.baseCoordinationModel.length===0){const T=E.pop();if(!T)return;this.baseCoordinationModel=T.uuid}if(!E.length)return;const C=this.groups.get(this.baseCoordinationModel);if(!C){console.log("No base model found for coordination!");return}for(const T of E)T!==C&&(T.position.set(0,0,0),T.rotation.set(0,0,0),T.scale.set(1,1,1),T.updateMatrix(),T.applyMatrix4(T.coordinationMatrix.clone().invert()),T.applyMatrix4(C.coordinationMatrix))}};L(Y,"uuid","fef46874-46a3-461b-8c44-2922ab77c806");let a=Y;const K={950732822:"IFCURIREFERENCE",4075327185:"IFCTIME",1209108979:"IFCTEMPERATURERATEOFCHANGEMEASURE",3457685358:"IFCSOUNDPRESSURELEVELMEASURE",4157543285:"IFCSOUNDPOWERLEVELMEASURE",2798247006:"IFCPROPERTYSETDEFINITIONSET",1790229001:"IFCPOSITIVEINTEGER",525895558:"IFCNONNEGATIVELENGTHMEASURE",1774176899:"IFCLINEINDEX",1275358634:"IFCLANGUAGEID",2541165894:"IFCDURATION",3701338814:"IFCDAYINWEEKNUMBER",2195413836:"IFCDATETIME",937566702:"IFCDATE",1683019596:"IFCCARDINALPOINTREFERENCE",2314439260:"IFCBINARY",1500781891:"IFCAREADENSITYMEASURE",3683503648:"IFCARCINDEX",4065007721:"IFCYEARNUMBER",1718600412:"IFCWARPINGMOMENTMEASURE",51269191:"IFCWARPINGCONSTANTMEASURE",2593997549:"IFCVOLUMETRICFLOWRATEMEASURE",3458127941:"IFCVOLUMEMEASURE",3345633955:"IFCVAPORPERMEABILITYMEASURE",1278329552:"IFCTORQUEMEASURE",2591213694:"IFCTIMESTAMP",2726807636:"IFCTIMEMEASURE",743184107:"IFCTHERMODYNAMICTEMPERATUREMEASURE",2016195849:"IFCTHERMALTRANSMITTANCEMEASURE",857959152:"IFCTHERMALRESISTANCEMEASURE",2281867870:"IFCTHERMALEXPANSIONCOEFFICIENTMEASURE",2645777649:"IFCTHERMALCONDUCTIVITYMEASURE",232962298:"IFCTHERMALADMITTANCEMEASURE",296282323:"IFCTEXTTRANSFORMATION",603696268:"IFCTEXTFONTNAME",3490877962:"IFCTEXTDECORATION",1460886941:"IFCTEXTALIGNMENT",2801250643:"IFCTEXT",58845555:"IFCTEMPERATUREGRADIENTMEASURE",361837227:"IFCSPECULARROUGHNESS",2757832317:"IFCSPECULAREXPONENT",3477203348:"IFCSPECIFICHEATCAPACITYMEASURE",993287707:"IFCSOUNDPRESSUREMEASURE",846465480:"IFCSOUNDPOWERMEASURE",3471399674:"IFCSOLIDANGLEMEASURE",408310005:"IFCSHEARMODULUSMEASURE",2190458107:"IFCSECTIONALAREAINTEGRALMEASURE",3467162246:"IFCSECTIONMODULUSMEASURE",2766185779:"IFCSECONDINMINUTE",3211557302:"IFCROTATIONALSTIFFNESSMEASURE",1755127002:"IFCROTATIONALMASSMEASURE",2133746277:"IFCROTATIONALFREQUENCYMEASURE",200335297:"IFCREAL",96294661:"IFCRATIOMEASURE",3972513137:"IFCRADIOACTIVITYMEASURE",3665567075:"IFCPRESSUREMEASURE",2169031380:"IFCPRESENTABLETEXT",1364037233:"IFCPOWERMEASURE",1245737093:"IFCPOSITIVERATIOMEASURE",3054510233:"IFCPOSITIVEPLANEANGLEMEASURE",2815919920:"IFCPOSITIVELENGTHMEASURE",4042175685:"IFCPLANEANGLEMEASURE",2642773653:"IFCPLANARFORCEMEASURE",2260317790:"IFCPARAMETERVALUE",929793134:"IFCPHMEASURE",2395907400:"IFCNUMERICMEASURE",2095195183:"IFCNORMALISEDRATIOMEASURE",765770214:"IFCMONTHINYEARNUMBER",2615040989:"IFCMONETARYMEASURE",3114022597:"IFCMOMENTOFINERTIAMEASURE",1648970520:"IFCMOLECULARWEIGHTMEASURE",3177669450:"IFCMOISTUREDIFFUSIVITYMEASURE",1753493141:"IFCMODULUSOFSUBGRADEREACTIONMEASURE",1052454078:"IFCMODULUSOFROTATIONALSUBGRADEREACTIONMEASURE",2173214787:"IFCMODULUSOFLINEARSUBGRADEREACTIONMEASURE",3341486342:"IFCMODULUSOFELASTICITYMEASURE",102610177:"IFCMINUTEINHOUR",3531705166:"IFCMASSPERLENGTHMEASURE",3124614049:"IFCMASSMEASURE",4017473158:"IFCMASSFLOWRATEMEASURE",1477762836:"IFCMASSDENSITYMEASURE",2486716878:"IFCMAGNETICFLUXMEASURE",286949696:"IFCMAGNETICFLUXDENSITYMEASURE",151039812:"IFCLUMINOUSINTENSITYMEASURE",2755797622:"IFCLUMINOUSINTENSITYDISTRIBUTIONMEASURE",2095003142:"IFCLUMINOUSFLUXMEASURE",503418787:"IFCLOGICAL",3086160713:"IFCLINEARVELOCITYMEASURE",1307019551:"IFCLINEARSTIFFNESSMEASURE",2128979029:"IFCLINEARMOMENTMEASURE",191860431:"IFCLINEARFORCEMEASURE",1243674935:"IFCLENGTHMEASURE",3258342251:"IFCLABEL",2054016361:"IFCKINEMATICVISCOSITYMEASURE",3192672207:"IFCISOTHERMALMOISTURECAPACITYMEASURE",3686016028:"IFCIONCONCENTRATIONMEASURE",3809634241:"IFCINTEGERCOUNTRATEMEASURE",1939436016:"IFCINTEGER",2679005408:"IFCINDUCTANCEMEASURE",3358199106:"IFCILLUMINANCEMEASURE",983778844:"IFCIDENTIFIER",2589826445:"IFCHOURINDAY",1158859006:"IFCHEATINGVALUEMEASURE",3113092358:"IFCHEATFLUXDENSITYMEASURE",3064340077:"IFCGLOBALLYUNIQUEID",3044325142:"IFCFREQUENCYMEASURE",1361398929:"IFCFORCEMEASURE",2590844177:"IFCFONTWEIGHT",2715512545:"IFCFONTVARIANT",1102727119:"IFCFONTSTYLE",2078135608:"IFCENERGYMEASURE",2506197118:"IFCELECTRICVOLTAGEMEASURE",2951915441:"IFCELECTRICRESISTANCEMEASURE",3790457270:"IFCELECTRICCURRENTMEASURE",2093906313:"IFCELECTRICCONDUCTANCEMEASURE",3818826038:"IFCELECTRICCHARGEMEASURE",1827137117:"IFCELECTRICCAPACITANCEMEASURE",69416015:"IFCDYNAMICVISCOSITYMEASURE",524656162:"IFCDOSEEQUIVALENTMEASURE",4134073009:"IFCDIMENSIONCOUNT",1514641115:"IFCDESCRIPTIVEMEASURE",300323983:"IFCDAYLIGHTSAVINGHOUR",86635668:"IFCDAYINMONTHNUMBER",94842927:"IFCCURVATUREMEASURE",1778710042:"IFCCOUNTMEASURE",3238673880:"IFCCONTEXTDEPENDENTMEASURE",3812528620:"IFCCOMPOUNDPLANEANGLEMEASURE",2991860651:"IFCCOMPLEXNUMBER",1867003952:"IFCBOXALIGNMENT",2735952531:"IFCBOOLEAN",2650437152:"IFCAREAMEASURE",632304761:"IFCANGULARVELOCITYMEASURE",360377573:"IFCAMOUNTOFSUBSTANCEMEASURE",4182062534:"IFCACCELERATIONMEASURE",3699917729:"IFCABSORBEDDOSEMEASURE",1971632696:"IFCGEOSLICE",2680139844:"IFCGEOMODEL",24726584:"IFCELECTRICFLOWTREATMENTDEVICE",3693000487:"IFCDISTRIBUTIONBOARD",3460952963:"IFCCONVEYORSEGMENT",3999819293:"IFCCAISSONFOUNDATION",3314249567:"IFCBOREHOLE",4196446775:"IFCBEARING",325726236:"IFCALIGNMENT",3425753595:"IFCTRACKELEMENT",991950508:"IFCSIGNAL",3798194928:"IFCREINFORCEDSOIL",3290496277:"IFCRAIL",1383356374:"IFCPAVEMENT",2182337498:"IFCNAVIGATIONELEMENT",234836483:"IFCMOORINGDEVICE",2078563270:"IFCMOBILETELECOMMUNICATIONSAPPLIANCE",1638804497:"IFCLIQUIDTERMINAL",1154579445:"IFCLINEARPOSITIONINGELEMENT",2696325953:"IFCKERB",2713699986:"IFCGEOTECHNICALASSEMBLY",2142170206:"IFCELECTRICFLOWTREATMENTDEVICETYPE",3376911765:"IFCEARTHWORKSFILL",1077100507:"IFCEARTHWORKSELEMENT",3071239417:"IFCEARTHWORKSCUT",479945903:"IFCDISTRIBUTIONBOARDTYPE",3426335179:"IFCDEEPFOUNDATION",1502416096:"IFCCOURSE",2940368186:"IFCCONVEYORSEGMENTTYPE",3203706013:"IFCCAISSONFOUNDATIONTYPE",3862327254:"IFCBUILTSYSTEM",1876633798:"IFCBUILTELEMENT",963979645:"IFCBRIDGEPART",644574406:"IFCBRIDGE",3649138523:"IFCBEARINGTYPE",1662888072:"IFCALIGNMENTVERTICAL",317615605:"IFCALIGNMENTSEGMENT",1545765605:"IFCALIGNMENTHORIZONTAL",4266260250:"IFCALIGNMENTCANT",3956297820:"IFCVIBRATIONDAMPERTYPE",1530820697:"IFCVIBRATIONDAMPER",840318589:"IFCVEHICLE",1953115116:"IFCTRANSPORTATIONDEVICE",618700268:"IFCTRACKELEMENTTYPE",2281632017:"IFCTENDONCONDUITTYPE",3663046924:"IFCTENDONCONDUIT",42703149:"IFCSINESPIRAL",1894708472:"IFCSIGNALTYPE",3599934289:"IFCSIGNTYPE",33720170:"IFCSIGN",1027922057:"IFCSEVENTHORDERPOLYNOMIALSPIRAL",544395925:"IFCSEGMENTEDREFERENCECURVE",3649235739:"IFCSECONDORDERPOLYNOMIALSPIRAL",550521510:"IFCROADPART",146592293:"IFCROAD",3818125796:"IFCRELADHERESTOELEMENT",4021432810:"IFCREFERENT",1891881377:"IFCRAILWAYPART",3992365140:"IFCRAILWAY",1763565496:"IFCRAILTYPE",1946335990:"IFCPOSITIONINGELEMENT",514975943:"IFCPAVEMENTTYPE",506776471:"IFCNAVIGATIONELEMENTTYPE",710110818:"IFCMOORINGDEVICETYPE",1950438474:"IFCMOBILETELECOMMUNICATIONSAPPLIANCETYPE",976884017:"IFCMARINEPART",525669439:"IFCMARINEFACILITY",1770583370:"IFCLIQUIDTERMINALTYPE",2176059722:"IFCLINEARELEMENT",679976338:"IFCKERBTYPE",3948183225:"IFCIMPACTPROTECTIONDEVICETYPE",2568555532:"IFCIMPACTPROTECTIONDEVICE",2898700619:"IFCGRADIENTCURVE",1594536857:"IFCGEOTECHNICALSTRATUM",4230923436:"IFCGEOTECHNICALELEMENT",4228831410:"IFCFACILITYPARTCOMMON",1310830890:"IFCFACILITYPART",24185140:"IFCFACILITY",4234616927:"IFCDIRECTRIXDERIVEDREFERENCESWEPTAREASOLID",1306400036:"IFCDEEPFOUNDATIONTYPE",4189326743:"IFCCOURSETYPE",2000195564:"IFCCOSINESPIRAL",3497074424:"IFCCLOTHOID",1626504194:"IFCBUILTELEMENTTYPE",3651464721:"IFCVEHICLETYPE",1229763772:"IFCTRIANGULATEDIRREGULARNETWORK",3665877780:"IFCTRANSPORTATIONDEVICETYPE",782932809:"IFCTHIRDORDERPOLYNOMIALSPIRAL",2735484536:"IFCSPIRAL",1356537516:"IFCSECTIONEDSURFACE",1290935644:"IFCSECTIONEDSOLIDHORIZONTAL",1862484736:"IFCSECTIONEDSOLID",1441486842:"IFCRELPOSITIONS",1033248425:"IFCRELASSOCIATESPROFILEDEF",3381221214:"IFCPOLYNOMIALCURVE",2485787929:"IFCOFFSETCURVEBYDISTANCES",590820931:"IFCOFFSETCURVE",3465909080:"IFCINDEXEDPOLYGONALTEXTUREMAP",593015953:"IFCDIRECTRIXCURVESWEPTAREASOLID",4212018352:"IFCCURVESEGMENT",3425423356:"IFCAXIS2PLACEMENTLINEAR",823603102:"IFCSEGMENT",2165702409:"IFCPOINTBYDISTANCEEXPRESSION",182550632:"IFCOPENCROSSPROFILEDEF",388784114:"IFCLINEARPLACEMENT",536804194:"IFCALIGNMENTHORIZONTALSEGMENT",3752311538:"IFCALIGNMENTCANTSEGMENT",1010789467:"IFCTEXTURECOORDINATEINDICESWITHVOIDS",222769930:"IFCTEXTURECOORDINATEINDICES",2691318326:"IFCQUANTITYNUMBER",3633395639:"IFCALIGNMENTVERTICALSEGMENT",2879124712:"IFCALIGNMENTPARAMETERSEGMENT",25142252:"IFCCONTROLLER",3087945054:"IFCALARM",4288193352:"IFCACTUATOR",630975310:"IFCUNITARYCONTROLELEMENT",4086658281:"IFCSENSOR",2295281155:"IFCPROTECTIVEDEVICETRIPPINGUNIT",182646315:"IFCFLOWINSTRUMENT",1426591983:"IFCFIRESUPPRESSIONTERMINAL",819412036:"IFCFILTER",3415622556:"IFCFAN",1003880860:"IFCELECTRICTIMECONTROL",402227799:"IFCELECTRICMOTOR",264262732:"IFCELECTRICGENERATOR",3310460725:"IFCELECTRICFLOWSTORAGEDEVICE",862014818:"IFCELECTRICDISTRIBUTIONBOARD",1904799276:"IFCELECTRICAPPLIANCE",1360408905:"IFCDUCTSILENCER",3518393246:"IFCDUCTSEGMENT",342316401:"IFCDUCTFITTING",562808652:"IFCDISTRIBUTIONCIRCUIT",4074379575:"IFCDAMPER",3640358203:"IFCCOOLINGTOWER",4136498852:"IFCCOOLEDBEAM",2272882330:"IFCCONDENSER",3571504051:"IFCCOMPRESSOR",3221913625:"IFCCOMMUNICATIONSAPPLIANCE",639361253:"IFCCOIL",3902619387:"IFCCHILLER",4217484030:"IFCCABLESEGMENT",1051757585:"IFCCABLEFITTING",3758799889:"IFCCABLECARRIERSEGMENT",635142910:"IFCCABLECARRIERFITTING",2938176219:"IFCBURNER",32344328:"IFCBOILER",2906023776:"IFCBEAMSTANDARDCASE",277319702:"IFCAUDIOVISUALAPPLIANCE",2056796094:"IFCAIRTOAIRHEATRECOVERY",177149247:"IFCAIRTERMINALBOX",1634111441:"IFCAIRTERMINAL",486154966:"IFCWINDOWSTANDARDCASE",4237592921:"IFCWASTETERMINAL",4156078855:"IFCWALLELEMENTEDCASE",4207607924:"IFCVALVE",4292641817:"IFCUNITARYEQUIPMENT",3179687236:"IFCUNITARYCONTROLELEMENTTYPE",3026737570:"IFCTUBEBUNDLE",3825984169:"IFCTRANSFORMER",812556717:"IFCTANK",1162798199:"IFCSWITCHINGDEVICE",385403989:"IFCSTRUCTURALLOADCASE",1404847402:"IFCSTACKTERMINAL",1999602285:"IFCSPACEHEATER",3420628829:"IFCSOLARDEVICE",3027962421:"IFCSLABSTANDARDCASE",3127900445:"IFCSLABELEMENTEDCASE",1329646415:"IFCSHADINGDEVICE",3053780830:"IFCSANITARYTERMINAL",2572171363:"IFCREINFORCINGBARTYPE",1232101972:"IFCRATIONALBSPLINECURVEWITHKNOTS",90941305:"IFCPUMP",655969474:"IFCPROTECTIVEDEVICETRIPPINGUNITTYPE",738039164:"IFCPROTECTIVEDEVICE",1156407060:"IFCPLATESTANDARDCASE",3612865200:"IFCPIPESEGMENT",310824031:"IFCPIPEFITTING",3694346114:"IFCOUTLET",144952367:"IFCOUTERBOUNDARYCURVE",2474470126:"IFCMOTORCONNECTION",1911478936:"IFCMEMBERSTANDARDCASE",1437502449:"IFCMEDICALDEVICE",629592764:"IFCLIGHTFIXTURE",76236018:"IFCLAMP",2176052936:"IFCJUNCTIONBOX",4175244083:"IFCINTERCEPTOR",2068733104:"IFCHUMIDIFIER",3319311131:"IFCHEATEXCHANGER",2188021234:"IFCFLOWMETER",1209101575:"IFCEXTERNALSPATIALELEMENT",484807127:"IFCEVAPORATOR",3747195512:"IFCEVAPORATIVECOOLER",2814081492:"IFCENGINE",2417008758:"IFCELECTRICDISTRIBUTIONBOARDTYPE",3242481149:"IFCDOORSTANDARDCASE",3205830791:"IFCDISTRIBUTIONSYSTEM",400855858:"IFCCOMMUNICATIONSAPPLIANCETYPE",905975707:"IFCCOLUMNSTANDARDCASE",1677625105:"IFCCIVILELEMENT",3296154744:"IFCCHIMNEY",2674252688:"IFCCABLEFITTINGTYPE",2188180465:"IFCBURNERTYPE",1177604601:"IFCBUILDINGSYSTEM",39481116:"IFCBUILDINGELEMENTPARTTYPE",1136057603:"IFCBOUNDARYCURVE",2461110595:"IFCBSPLINECURVEWITHKNOTS",1532957894:"IFCAUDIOVISUALAPPLIANCETYPE",4088093105:"IFCWORKCALENDAR",4009809668:"IFCWINDOWTYPE",926996030:"IFCVOIDINGFEATURE",2391383451:"IFCVIBRATIONISOLATOR",2415094496:"IFCTENDONTYPE",3081323446:"IFCTENDONANCHORTYPE",413509423:"IFCSYSTEMFURNITUREELEMENT",3101698114:"IFCSURFACEFEATURE",3657597509:"IFCSTRUCTURALSURFACEACTION",2757150158:"IFCSTRUCTURALCURVEREACTION",1004757350:"IFCSTRUCTURALCURVEACTION",338393293:"IFCSTAIRTYPE",1072016465:"IFCSOLARDEVICETYPE",4074543187:"IFCSHADINGDEVICETYPE",2157484638:"IFCSEAMCURVE",2781568857:"IFCROOFTYPE",2310774935:"IFCREINFORCINGMESHTYPE",964333572:"IFCREINFORCINGELEMENTTYPE",683857671:"IFCRATIONALBSPLINESURFACEWITHKNOTS",1469900589:"IFCRAMPTYPE",2839578677:"IFCPOLYGONALFACESET",1158309216:"IFCPILETYPE",3079942009:"IFCOPENINGSTANDARDCASE",1114901282:"IFCMEDICALDEVICETYPE",3113134337:"IFCINTERSECTIONCURVE",3946677679:"IFCINTERCEPTORTYPE",2571569899:"IFCINDEXEDPOLYCURVE",3493046030:"IFCGEOGRAPHICELEMENT",1509553395:"IFCFURNITURE",1893162501:"IFCFOOTINGTYPE",2853485674:"IFCEXTERNALSPATIALSTRUCTUREELEMENT",4148101412:"IFCEVENT",132023988:"IFCENGINETYPE",2397081782:"IFCELEMENTASSEMBLYTYPE",2323601079:"IFCDOORTYPE",1213902940:"IFCCYLINDRICALSURFACE",1525564444:"IFCCONSTRUCTIONPRODUCTRESOURCETYPE",4105962743:"IFCCONSTRUCTIONMATERIALRESOURCETYPE",2185764099:"IFCCONSTRUCTIONEQUIPMENTRESOURCETYPE",15328376:"IFCCOMPOSITECURVEONSURFACE",3875453745:"IFCCOMPLEXPROPERTYTEMPLATE",3893394355:"IFCCIVILELEMENTTYPE",2197970202:"IFCCHIMNEYTYPE",167062518:"IFCBSPLINESURFACEWITHKNOTS",2887950389:"IFCBSPLINESURFACE",2603310189:"IFCADVANCEDBREPWITHVOIDS",1635779807:"IFCADVANCEDBREP",2916149573:"IFCTRIANGULATEDFACESET",1935646853:"IFCTOROIDALSURFACE",2387106220:"IFCTESSELLATEDFACESET",3206491090:"IFCTASKTYPE",699246055:"IFCSURFACECURVE",4095615324:"IFCSUBCONTRACTRESOURCETYPE",603775116:"IFCSTRUCTURALSURFACEREACTION",4015995234:"IFCSPHERICALSURFACE",2481509218:"IFCSPATIALZONETYPE",463610769:"IFCSPATIALZONE",710998568:"IFCSPATIALELEMENTTYPE",1412071761:"IFCSPATIALELEMENT",3663146110:"IFCSIMPLEPROPERTYTEMPLATE",3243963512:"IFCREVOLVEDAREASOLIDTAPERED",816062949:"IFCREPARAMETRISEDCOMPOSITECURVESEGMENT",1521410863:"IFCRELSPACEBOUNDARY2NDLEVEL",3523091289:"IFCRELSPACEBOUNDARY1STLEVEL",427948657:"IFCRELINTERFERESELEMENTS",307848117:"IFCRELDEFINESBYTEMPLATE",1462361463:"IFCRELDEFINESBYOBJECT",2565941209:"IFCRELDECLARES",1027710054:"IFCRELASSIGNSTOGROUPBYFACTOR",3521284610:"IFCPROPERTYTEMPLATE",492091185:"IFCPROPERTYSETTEMPLATE",653396225:"IFCPROJECTLIBRARY",569719735:"IFCPROCEDURETYPE",3967405729:"IFCPREDEFINEDPROPERTYSET",1682466193:"IFCPCURVE",428585644:"IFCLABORRESOURCETYPE",2294589976:"IFCINDEXEDPOLYGONALFACEWITHVOIDS",178912537:"IFCINDEXEDPOLYGONALFACE",4095422895:"IFCGEOGRAPHICELEMENTTYPE",2652556860:"IFCFIXEDREFERENCESWEPTAREASOLID",2804161546:"IFCEXTRUDEDAREASOLIDTAPERED",4024345920:"IFCEVENTTYPE",2629017746:"IFCCURVEBOUNDEDSURFACE",1815067380:"IFCCREWRESOURCETYPE",3419103109:"IFCCONTEXT",2574617495:"IFCCONSTRUCTIONRESOURCETYPE",2059837836:"IFCCARTESIANPOINTLIST3D",1675464909:"IFCCARTESIANPOINTLIST2D",574549367:"IFCCARTESIANPOINTLIST",3406155212:"IFCADVANCEDFACE",3698973494:"IFCTYPERESOURCE",3736923433:"IFCTYPEPROCESS",901063453:"IFCTESSELLATEDITEM",1096409881:"IFCSWEPTDISKSOLIDPOLYGONAL",1042787934:"IFCRESOURCETIME",1608871552:"IFCRESOURCECONSTRAINTRELATIONSHIP",2943643501:"IFCRESOURCEAPPROVALRELATIONSHIP",2090586900:"IFCQUANTITYSET",1482703590:"IFCPROPERTYTEMPLATEDEFINITION",3778827333:"IFCPREDEFINEDPROPERTIES",2998442950:"IFCMIRROREDPROFILEDEF",853536259:"IFCMATERIALRELATIONSHIP",3404854881:"IFCMATERIALPROFILESETUSAGETAPERING",3079605661:"IFCMATERIALPROFILESETUSAGE",2852063980:"IFCMATERIALCONSTITUENTSET",3708119e3:"IFCMATERIALCONSTITUENT",1585845231:"IFCLAGTIME",2133299955:"IFCINDEXEDTRIANGLETEXTUREMAP",1437953363:"IFCINDEXEDTEXTUREMAP",3570813810:"IFCINDEXEDCOLOURMAP",1437805879:"IFCEXTERNALREFERENCERELATIONSHIP",297599258:"IFCEXTENDEDPROPERTIES",211053100:"IFCEVENTTIME",2713554722:"IFCCONVERSIONBASEDUNITWITHOFFSET",3285139300:"IFCCOLOURRGBLIST",1236880293:"IFCWORKTIME",1199560280:"IFCTIMEPERIOD",3611470254:"IFCTEXTUREVERTEXLIST",2771591690:"IFCTASKTIMERECURRING",1549132990:"IFCTASKTIME",2043862942:"IFCTABLECOLUMN",2934153892:"IFCSURFACEREINFORCEMENTAREA",609421318:"IFCSTRUCTURALLOADORRESULT",3478079324:"IFCSTRUCTURALLOADCONFIGURATION",1054537805:"IFCSCHEDULINGTIME",2439245199:"IFCRESOURCELEVELRELATIONSHIP",2433181523:"IFCREFERENCE",3915482550:"IFCRECURRENCEPATTERN",986844984:"IFCPROPERTYABSTRACTION",3843373140:"IFCPROJECTEDCRS",677532197:"IFCPRESENTATIONITEM",1507914824:"IFCMATERIALUSAGEDEFINITION",552965576:"IFCMATERIALPROFILEWITHOFFSETS",164193824:"IFCMATERIALPROFILESET",2235152071:"IFCMATERIALPROFILE",1847252529:"IFCMATERIALLAYERWITHOFFSETS",760658860:"IFCMATERIALDEFINITION",3057273783:"IFCMAPCONVERSION",4294318154:"IFCEXTERNALINFORMATION",1466758467:"IFCCOORDINATEREFERENCESYSTEM",1785450214:"IFCCOORDINATEOPERATION",775493141:"IFCCONNECTIONVOLUMEGEOMETRY",979691226:"IFCREINFORCINGBAR",3700593921:"IFCELECTRICDISTRIBUTIONPOINT",1062813311:"IFCDISTRIBUTIONCONTROLELEMENT",1052013943:"IFCDISTRIBUTIONCHAMBERELEMENT",578613899:"IFCCONTROLLERTYPE",2454782716:"IFCCHAMFEREDGEFEATURE",753842376:"IFCBEAM",3001207471:"IFCALARMTYPE",2874132201:"IFCACTUATORTYPE",3304561284:"IFCWINDOW",3512223829:"IFCWALLSTANDARDCASE",2391406946:"IFCWALL",3313531582:"IFCVIBRATIONISOLATORTYPE",2347447852:"IFCTENDONANCHOR",3824725483:"IFCTENDON",2515109513:"IFCSTRUCTURALANALYSISMODEL",4252922144:"IFCSTAIRFLIGHT",331165859:"IFCSTAIR",1529196076:"IFCSLAB",1783015770:"IFCSENSORTYPE",1376911519:"IFCROUNDEDEDGEFEATURE",2016517767:"IFCROOF",2320036040:"IFCREINFORCINGMESH",3027567501:"IFCREINFORCINGELEMENT",3055160366:"IFCRATIONALBEZIERCURVE",3283111854:"IFCRAMPFLIGHT",3024970846:"IFCRAMP",2262370178:"IFCRAILING",3171933400:"IFCPLATE",1687234759:"IFCPILE",1073191201:"IFCMEMBER",900683007:"IFCFOOTING",3508470533:"IFCFLOWTREATMENTDEVICE",2223149337:"IFCFLOWTERMINAL",707683696:"IFCFLOWSTORAGEDEVICE",987401354:"IFCFLOWSEGMENT",3132237377:"IFCFLOWMOVINGDEVICE",4037862832:"IFCFLOWINSTRUMENTTYPE",4278956645:"IFCFLOWFITTING",2058353004:"IFCFLOWCONTROLLER",4222183408:"IFCFIRESUPPRESSIONTERMINALTYPE",1810631287:"IFCFILTERTYPE",346874300:"IFCFANTYPE",1658829314:"IFCENERGYCONVERSIONDEVICE",857184966:"IFCELECTRICALELEMENT",1634875225:"IFCELECTRICALCIRCUIT",712377611:"IFCELECTRICTIMECONTROLTYPE",1217240411:"IFCELECTRICMOTORTYPE",1365060375:"IFCELECTRICHEATERTYPE",1534661035:"IFCELECTRICGENERATORTYPE",3277789161:"IFCELECTRICFLOWSTORAGEDEVICETYPE",663422040:"IFCELECTRICAPPLIANCETYPE",855621170:"IFCEDGEFEATURE",2030761528:"IFCDUCTSILENCERTYPE",3760055223:"IFCDUCTSEGMENTTYPE",869906466:"IFCDUCTFITTINGTYPE",395920057:"IFCDOOR",3041715199:"IFCDISTRIBUTIONPORT",3040386961:"IFCDISTRIBUTIONFLOWELEMENT",1945004755:"IFCDISTRIBUTIONELEMENT",2063403501:"IFCDISTRIBUTIONCONTROLELEMENTTYPE",1599208980:"IFCDISTRIBUTIONCHAMBERELEMENTTYPE",2635815018:"IFCDISCRETEACCESSORYTYPE",1335981549:"IFCDISCRETEACCESSORY",4147604152:"IFCDIAMETERDIMENSION",3961806047:"IFCDAMPERTYPE",3495092785:"IFCCURTAINWALL",1973544240:"IFCCOVERING",2954562838:"IFCCOOLINGTOWERTYPE",335055490:"IFCCOOLEDBEAMTYPE",488727124:"IFCCONSTRUCTIONPRODUCTRESOURCE",1060000209:"IFCCONSTRUCTIONMATERIALRESOURCE",3898045240:"IFCCONSTRUCTIONEQUIPMENTRESOURCE",1163958913:"IFCCONDITIONCRITERION",2188551683:"IFCCONDITION",2816379211:"IFCCONDENSERTYPE",3850581409:"IFCCOMPRESSORTYPE",843113511:"IFCCOLUMN",2301859152:"IFCCOILTYPE",2611217952:"IFCCIRCLE",2951183804:"IFCCHILLERTYPE",1285652485:"IFCCABLESEGMENTTYPE",3293546465:"IFCCABLECARRIERSEGMENTTYPE",395041908:"IFCCABLECARRIERFITTINGTYPE",1909888760:"IFCBUILDINGELEMENTPROXYTYPE",1095909175:"IFCBUILDINGELEMENTPROXY",2979338954:"IFCBUILDINGELEMENTPART",52481810:"IFCBUILDINGELEMENTCOMPONENT",3299480353:"IFCBUILDINGELEMENT",231477066:"IFCBOILERTYPE",1916977116:"IFCBEZIERCURVE",819618141:"IFCBEAMTYPE",1967976161:"IFCBSPLINECURVE",3460190687:"IFCASSET",2470393545:"IFCANGULARDIMENSION",1871374353:"IFCAIRTOAIRHEATRECOVERYTYPE",3352864051:"IFCAIRTERMINALTYPE",1411407467:"IFCAIRTERMINALBOXTYPE",3821786052:"IFCACTIONREQUEST",1213861670:"IFC2DCOMPOSITECURVE",1033361043:"IFCZONE",3342526732:"IFCWORKSCHEDULE",4218914973:"IFCWORKPLAN",1028945134:"IFCWORKCONTROL",1133259667:"IFCWASTETERMINALTYPE",1898987631:"IFCWALLTYPE",2769231204:"IFCVIRTUALELEMENT",728799441:"IFCVALVETYPE",1911125066:"IFCUNITARYEQUIPMENTTYPE",1600972822:"IFCTUBEBUNDLETYPE",3593883385:"IFCTRIMMEDCURVE",1620046519:"IFCTRANSPORTELEMENT",1692211062:"IFCTRANSFORMERTYPE",1637806684:"IFCTIMESERIESSCHEDULE",5716631:"IFCTANKTYPE",2254336722:"IFCSYSTEM",2315554128:"IFCSWITCHINGDEVICETYPE",148013059:"IFCSUBCONTRACTRESOURCE",1975003073:"IFCSTRUCTURALSURFACECONNECTION",2986769608:"IFCSTRUCTURALRESULTGROUP",1235345126:"IFCSTRUCTURALPOINTREACTION",734778138:"IFCSTRUCTURALPOINTCONNECTION",2082059205:"IFCSTRUCTURALPOINTACTION",3987759626:"IFCSTRUCTURALPLANARACTIONVARYING",1621171031:"IFCSTRUCTURALPLANARACTION",1252848954:"IFCSTRUCTURALLOADGROUP",1721250024:"IFCSTRUCTURALLINEARACTIONVARYING",1807405624:"IFCSTRUCTURALLINEARACTION",2445595289:"IFCSTRUCTURALCURVEMEMBERVARYING",214636428:"IFCSTRUCTURALCURVEMEMBER",4243806635:"IFCSTRUCTURALCURVECONNECTION",1179482911:"IFCSTRUCTURALCONNECTION",682877961:"IFCSTRUCTURALACTION",1039846685:"IFCSTAIRFLIGHTTYPE",3112655638:"IFCSTACKTERMINALTYPE",3812236995:"IFCSPACETYPE",652456506:"IFCSPACEPROGRAM",1305183839:"IFCSPACEHEATERTYPE",3856911033:"IFCSPACE",2533589738:"IFCSLABTYPE",4097777520:"IFCSITE",4105383287:"IFCSERVICELIFE",3517283431:"IFCSCHEDULETIMECONTROL",1768891740:"IFCSANITARYTERMINALTYPE",2863920197:"IFCRELASSIGNSTASKS",160246688:"IFCRELAGGREGATES",2324767716:"IFCRAMPFLIGHTTYPE",2893384427:"IFCRAILINGTYPE",3248260540:"IFCRADIUSDIMENSION",2250791053:"IFCPUMPTYPE",1842657554:"IFCPROTECTIVEDEVICETYPE",3651124850:"IFCPROJECTIONELEMENT",3642467123:"IFCPROJECTORDERRECORD",2904328755:"IFCPROJECTORDER",2744685151:"IFCPROCEDURE",3740093272:"IFCPORT",3724593414:"IFCPOLYLINE",4017108033:"IFCPLATETYPE",4231323485:"IFCPIPESEGMENTTYPE",804291784:"IFCPIPEFITTINGTYPE",3327091369:"IFCPERMIT",2382730787:"IFCPERFORMANCEHISTORY",2837617999:"IFCOUTLETTYPE",3425660407:"IFCORDERACTION",3588315303:"IFCOPENINGELEMENT",4143007308:"IFCOCCUPANT",1916936684:"IFCMOVE",977012517:"IFCMOTORCONNECTIONTYPE",3181161470:"IFCMEMBERTYPE",2108223431:"IFCMECHANICALFASTENERTYPE",377706215:"IFCMECHANICALFASTENER",2506943328:"IFCLINEARDIMENSION",1161773419:"IFCLIGHTFIXTURETYPE",1051575348:"IFCLAMPTYPE",3827777499:"IFCLABORRESOURCE",4288270099:"IFCJUNCTIONBOXTYPE",2391368822:"IFCINVENTORY",1806887404:"IFCHUMIDIFIERTYPE",1251058090:"IFCHEATEXCHANGERTYPE",2706460486:"IFCGROUP",3009204131:"IFCGRID",200128114:"IFCGASTERMINALTYPE",814719939:"IFCFURNITURESTANDARD",263784265:"IFCFURNISHINGELEMENT",3009222698:"IFCFLOWTREATMENTDEVICETYPE",2297155007:"IFCFLOWTERMINALTYPE",1339347760:"IFCFLOWSTORAGEDEVICETYPE",1834744321:"IFCFLOWSEGMENTTYPE",1482959167:"IFCFLOWMOVINGDEVICETYPE",3815607619:"IFCFLOWMETERTYPE",3198132628:"IFCFLOWFITTINGTYPE",3907093117:"IFCFLOWCONTROLLERTYPE",1287392070:"IFCFEATUREELEMENTSUBTRACTION",2143335405:"IFCFEATUREELEMENTADDITION",2827207264:"IFCFEATUREELEMENT",2489546625:"IFCFASTENERTYPE",647756555:"IFCFASTENER",3737207727:"IFCFACETEDBREPWITHVOIDS",807026263:"IFCFACETEDBREP",3390157468:"IFCEVAPORATORTYPE",3174744832:"IFCEVAPORATIVECOOLERTYPE",3272907226:"IFCEQUIPMENTSTANDARD",1962604670:"IFCEQUIPMENTELEMENT",2107101300:"IFCENERGYCONVERSIONDEVICETYPE",1704287377:"IFCELLIPSE",2590856083:"IFCELEMENTCOMPONENTTYPE",1623761950:"IFCELEMENTCOMPONENT",4123344466:"IFCELEMENTASSEMBLY",1758889154:"IFCELEMENT",360485395:"IFCELECTRICALBASEPROPERTIES",3849074793:"IFCDISTRIBUTIONFLOWELEMENTTYPE",3256556792:"IFCDISTRIBUTIONELEMENTTYPE",681481545:"IFCDIMENSIONCURVEDIRECTEDCALLOUT",1457835157:"IFCCURTAINWALLTYPE",3295246426:"IFCCREWRESOURCE",1916426348:"IFCCOVERINGTYPE",1419761937:"IFCCOSTSCHEDULE",3895139033:"IFCCOSTITEM",3293443760:"IFCCONTROL",2559216714:"IFCCONSTRUCTIONRESOURCE",2510884976:"IFCCONIC",3732776249:"IFCCOMPOSITECURVE",300633059:"IFCCOLUMNTYPE",2937912522:"IFCCIRCLEHOLLOWPROFILEDEF",3124254112:"IFCBUILDINGSTOREY",1950629157:"IFCBUILDINGELEMENTTYPE",4031249490:"IFCBUILDING",1260505505:"IFCBOUNDEDCURVE",3649129432:"IFCBOOLEANCLIPPINGRESULT",1334484129:"IFCBLOCK",3207858831:"IFCASYMMETRICISHAPEPROFILEDEF",1674181508:"IFCANNOTATION",2296667514:"IFCACTOR",2097647324:"IFCTRANSPORTELEMENTTYPE",3473067441:"IFCTASK",1580310250:"IFCSYSTEMFURNITUREELEMENTTYPE",4124788165:"IFCSURFACEOFREVOLUTION",2809605785:"IFCSURFACEOFLINEAREXTRUSION",2028607225:"IFCSURFACECURVESWEPTAREASOLID",4070609034:"IFCSTRUCTUREDDIMENSIONCALLOUT",2218152070:"IFCSTRUCTURALSURFACEMEMBERVARYING",3979015343:"IFCSTRUCTURALSURFACEMEMBER",3689010777:"IFCSTRUCTURALREACTION",530289379:"IFCSTRUCTURALMEMBER",3136571912:"IFCSTRUCTURALITEM",3544373492:"IFCSTRUCTURALACTIVITY",451544542:"IFCSPHERE",3893378262:"IFCSPATIALSTRUCTUREELEMENTTYPE",2706606064:"IFCSPATIALSTRUCTUREELEMENT",3626867408:"IFCRIGHTCIRCULARCYLINDER",4158566097:"IFCRIGHTCIRCULARCONE",1856042241:"IFCREVOLVEDAREASOLID",2914609552:"IFCRESOURCE",1401173127:"IFCRELVOIDSELEMENT",3451746338:"IFCRELSPACEBOUNDARY",366585022:"IFCRELSERVICESBUILDINGS",4122056220:"IFCRELSEQUENCE",1058617721:"IFCRELSCHEDULESCOSTITEMS",1245217292:"IFCRELREFERENCEDINSPATIALSTRUCTURE",750771296:"IFCRELPROJECTSELEMENT",202636808:"IFCRELOVERRIDESPROPERTIES",2051452291:"IFCRELOCCUPIESSPACES",3268803585:"IFCRELNESTS",4189434867:"IFCRELINTERACTIONREQUIREMENTS",279856033:"IFCRELFLOWCONTROLELEMENTS",3940055652:"IFCRELFILLSELEMENT",781010003:"IFCRELDEFINESBYTYPE",4186316022:"IFCRELDEFINESBYPROPERTIES",693640335:"IFCRELDEFINES",2551354335:"IFCRELDECOMPOSES",2802773753:"IFCRELCOVERSSPACES",886880790:"IFCRELCOVERSBLDGELEMENTS",3242617779:"IFCRELCONTAINEDINSPATIALSTRUCTURE",3678494232:"IFCRELCONNECTSWITHREALIZINGELEMENTS",504942748:"IFCRELCONNECTSWITHECCENTRICITY",1638771189:"IFCRELCONNECTSSTRUCTURALMEMBER",3912681535:"IFCRELCONNECTSSTRUCTURALELEMENT",2127690289:"IFCRELCONNECTSSTRUCTURALACTIVITY",3190031847:"IFCRELCONNECTSPORTS",4201705270:"IFCRELCONNECTSPORTTOELEMENT",3945020480:"IFCRELCONNECTSPATHELEMENTS",1204542856:"IFCRELCONNECTSELEMENTS",826625072:"IFCRELCONNECTS",2851387026:"IFCRELASSOCIATESPROFILEPROPERTIES",2655215786:"IFCRELASSOCIATESMATERIAL",3840914261:"IFCRELASSOCIATESLIBRARY",982818633:"IFCRELASSOCIATESDOCUMENT",2728634034:"IFCRELASSOCIATESCONSTRAINT",919958153:"IFCRELASSOCIATESCLASSIFICATION",4095574036:"IFCRELASSOCIATESAPPROVAL",1327628568:"IFCRELASSOCIATESAPPLIEDVALUE",1865459582:"IFCRELASSOCIATES",205026976:"IFCRELASSIGNSTORESOURCE",3372526763:"IFCRELASSIGNSTOPROJECTORDER",2857406711:"IFCRELASSIGNSTOPRODUCT",4278684876:"IFCRELASSIGNSTOPROCESS",1307041759:"IFCRELASSIGNSTOGROUP",2495723537:"IFCRELASSIGNSTOCONTROL",1683148259:"IFCRELASSIGNSTOACTOR",3939117080:"IFCRELASSIGNS",3454111270:"IFCRECTANGULARTRIMMEDSURFACE",2798486643:"IFCRECTANGULARPYRAMID",2770003689:"IFCRECTANGLEHOLLOWPROFILEDEF",3219374653:"IFCPROXY",1451395588:"IFCPROPERTYSET",4194566429:"IFCPROJECTIONCURVE",103090709:"IFCPROJECT",4208778838:"IFCPRODUCT",2945172077:"IFCPROCESS",220341763:"IFCPLANE",603570806:"IFCPLANARBOX",3566463478:"IFCPERMEABLECOVERINGPROPERTIES",3505215534:"IFCOFFSETCURVE3D",3388369263:"IFCOFFSETCURVE2D",3888040117:"IFCOBJECT",1425443689:"IFCMANIFOLDSOLIDBREP",1281925730:"IFCLINE",572779678:"IFCLSHAPEPROFILEDEF",1484403080:"IFCISHAPEPROFILEDEF",987898635:"IFCGEOMETRICCURVESET",1268542332:"IFCFURNITURETYPE",4238390223:"IFCFURNISHINGELEMENTTYPE",3455213021:"IFCFLUIDFLOWPROPERTIES",315944413:"IFCFILLAREASTYLETILES",4203026998:"IFCFILLAREASTYLETILESYMBOLWITHSTYLE",374418227:"IFCFILLAREASTYLEHATCHING",2047409740:"IFCFACEBASEDSURFACEMODEL",477187591:"IFCEXTRUDEDAREASOLID",80994333:"IFCENERGYPROPERTIES",2835456948:"IFCELLIPSEPROFILEDEF",2777663545:"IFCELEMENTARYSURFACE",339256511:"IFCELEMENTTYPE",1883228015:"IFCELEMENTQUANTITY",1472233963:"IFCEDGELOOP",4006246654:"IFCDRAUGHTINGPREDEFINEDCURVEFONT",445594917:"IFCDRAUGHTINGPREDEFINEDCOLOUR",3073041342:"IFCDRAUGHTINGCALLOUT",526551008:"IFCDOORSTYLE",1714330368:"IFCDOORPANELPROPERTIES",2963535650:"IFCDOORLININGPROPERTIES",32440307:"IFCDIRECTION",4054601972:"IFCDIMENSIONCURVETERMINATOR",606661476:"IFCDIMENSIONCURVE",693772133:"IFCDEFINEDSYMBOL",2827736869:"IFCCURVEBOUNDEDPLANE",2601014836:"IFCCURVE",2147822146:"IFCCSGSOLID",2506170314:"IFCCSGPRIMITIVE3D",194851669:"IFCCRANERAILFSHAPEPROFILEDEF",4133800736:"IFCCRANERAILASHAPEPROFILEDEF",2485617015:"IFCCOMPOSITECURVESEGMENT",2205249479:"IFCCLOSEDSHELL",1383045692:"IFCCIRCLEPROFILEDEF",1416205885:"IFCCARTESIANTRANSFORMATIONOPERATOR3DNONUNIFORM",3331915920:"IFCCARTESIANTRANSFORMATIONOPERATOR3D",3486308946:"IFCCARTESIANTRANSFORMATIONOPERATOR2DNONUNIFORM",3749851601:"IFCCARTESIANTRANSFORMATIONOPERATOR2D",59481748:"IFCCARTESIANTRANSFORMATIONOPERATOR",1123145078:"IFCCARTESIANPOINT",2898889636:"IFCCSHAPEPROFILEDEF",2713105998:"IFCBOXEDHALFSPACE",2581212453:"IFCBOUNDINGBOX",4182860854:"IFCBOUNDEDSURFACE",2736907675:"IFCBOOLEANRESULT",2740243338:"IFCAXIS2PLACEMENT3D",3125803723:"IFCAXIS2PLACEMENT2D",4261334040:"IFCAXIS1PLACEMENT",1302238472:"IFCANNOTATIONSURFACE",2265737646:"IFCANNOTATIONFILLAREAOCCURRENCE",669184980:"IFCANNOTATIONFILLAREA",3288037868:"IFCANNOTATIONCURVEOCCURRENCE",2543172580:"IFCZSHAPEPROFILEDEF",1299126871:"IFCWINDOWSTYLE",512836454:"IFCWINDOWPANELPROPERTIES",336235671:"IFCWINDOWLININGPROPERTIES",2759199220:"IFCVERTEXLOOP",1417489154:"IFCVECTOR",427810014:"IFCUSHAPEPROFILEDEF",2347495698:"IFCTYPEPRODUCT",1628702193:"IFCTYPEOBJECT",1345879162:"IFCTWODIRECTIONREPEATFACTOR",2715220739:"IFCTRAPEZIUMPROFILEDEF",3124975700:"IFCTEXTLITERALWITHEXTENT",4282788508:"IFCTEXTLITERAL",3028897424:"IFCTERMINATORSYMBOL",3071757647:"IFCTSHAPEPROFILEDEF",230924584:"IFCSWEPTSURFACE",1260650574:"IFCSWEPTDISKSOLID",2247615214:"IFCSWEPTAREASOLID",1878645084:"IFCSURFACESTYLERENDERING",2513912981:"IFCSURFACE",2233826070:"IFCSUBEDGE",3653947884:"IFCSTRUCTURALSTEELPROFILEPROPERTIES",3843319758:"IFCSTRUCTURALPROFILEPROPERTIES",1190533807:"IFCSTRUCTURALLOADSINGLEFORCEWARPING",1597423693:"IFCSTRUCTURALLOADSINGLEFORCE",1973038258:"IFCSTRUCTURALLOADSINGLEDISPLACEMENTDISTORTION",2473145415:"IFCSTRUCTURALLOADSINGLEDISPLACEMENT",2668620305:"IFCSTRUCTURALLOADPLANARFORCE",1595516126:"IFCSTRUCTURALLOADLINEARFORCE",390701378:"IFCSPACETHERMALLOADPROPERTIES",1202362311:"IFCSOUNDVALUE",2485662743:"IFCSOUNDPROPERTIES",723233188:"IFCSOLIDMODEL",2609359061:"IFCSLIPPAGECONNECTIONCONDITION",4124623270:"IFCSHELLBASEDSURFACEMODEL",2411513650:"IFCSERVICELIFEFACTOR",1509187699:"IFCSECTIONEDSPINE",2778083089:"IFCROUNDEDRECTANGLEPROFILEDEF",478536968:"IFCRELATIONSHIP",3765753017:"IFCREINFORCEMENTDEFINITIONPROPERTIES",3413951693:"IFCREGULARTIMESERIES",3615266464:"IFCRECTANGLEPROFILEDEF",110355661:"IFCPROPERTYTABLEVALUE",3650150729:"IFCPROPERTYSINGLEVALUE",3357820518:"IFCPROPERTYSETDEFINITION",941946838:"IFCPROPERTYREFERENCEVALUE",2752243245:"IFCPROPERTYLISTVALUE",4166981789:"IFCPROPERTYENUMERATEDVALUE",1680319473:"IFCPROPERTYDEFINITION",871118103:"IFCPROPERTYBOUNDEDVALUE",673634403:"IFCPRODUCTDEFINITIONSHAPE",179317114:"IFCPREDEFINEDPOINTMARKERSYMBOL",433424934:"IFCPREDEFINEDDIMENSIONSYMBOL",2559016684:"IFCPREDEFINEDCURVEFONT",759155922:"IFCPREDEFINEDCOLOUR",2775532180:"IFCPOLYGONALBOUNDEDHALFSPACE",2924175390:"IFCPOLYLOOP",1423911732:"IFCPOINTONSURFACE",4022376103:"IFCPOINTONCURVE",2067069095:"IFCPOINT",1663979128:"IFCPLANAREXTENT",2004835150:"IFCPLACEMENT",597895409:"IFCPIXELTEXTURE",3021840470:"IFCPHYSICALCOMPLEXQUANTITY",2519244187:"IFCPATH",2529465313:"IFCPARAMETERIZEDPROFILEDEF",1029017970:"IFCORIENTEDEDGE",2665983363:"IFCOPENSHELL",2833995503:"IFCONEDIRECTIONREPEATFACTOR",219451334:"IFCOBJECTDEFINITION",1430189142:"IFCMECHANICALCONCRETEMATERIALPROPERTIES",2022407955:"IFCMATERIALDEFINITIONREPRESENTATION",2347385850:"IFCMAPPEDITEM",1008929658:"IFCLOOP",2624227202:"IFCLOCALPLACEMENT",3422422726:"IFCLIGHTSOURCESPOT",1520743889:"IFCLIGHTSOURCEPOSITIONAL",4266656042:"IFCLIGHTSOURCEGONIOMETRIC",2604431987:"IFCLIGHTSOURCEDIRECTIONAL",125510826:"IFCLIGHTSOURCEAMBIENT",1402838566:"IFCLIGHTSOURCE",3741457305:"IFCIRREGULARTIMESERIES",3905492369:"IFCIMAGETEXTURE",2445078500:"IFCHYGROSCOPICMATERIALPROPERTIES",812098782:"IFCHALFSPACESOLID",178086475:"IFCGRIDPLACEMENT",3590301190:"IFCGEOMETRICSET",4142052618:"IFCGEOMETRICREPRESENTATIONSUBCONTEXT",2453401579:"IFCGEOMETRICREPRESENTATIONITEM",3448662350:"IFCGEOMETRICREPRESENTATIONCONTEXT",1446786286:"IFCGENERALPROFILEPROPERTIES",803998398:"IFCGENERALMATERIALPROPERTIES",3857492461:"IFCFUELPROPERTIES",738692330:"IFCFILLAREASTYLE",4219587988:"IFCFAILURECONNECTIONCONDITION",3008276851:"IFCFACESURFACE",803316827:"IFCFACEOUTERBOUND",1809719519:"IFCFACEBOUND",2556980723:"IFCFACE",1860660968:"IFCEXTENDEDMATERIALPROPERTIES",476780140:"IFCEDGECURVE",3900360178:"IFCEDGE",4170525392:"IFCDRAUGHTINGPREDEFINEDTEXTFONT",3732053477:"IFCDOCUMENTREFERENCE",1694125774:"IFCDIMENSIONPAIR",2273265877:"IFCDIMENSIONCALLOUTRELATIONSHIP",3632507154:"IFCDERIVEDPROFILEDEF",3800577675:"IFCCURVESTYLE",2889183280:"IFCCONVERSIONBASEDUNIT",3050246964:"IFCCONTEXTDEPENDENTUNIT",45288368:"IFCCONNECTIONPOINTECCENTRICITY",1981873012:"IFCCONNECTIONCURVEGEOMETRY",370225590:"IFCCONNECTEDFACESET",1485152156:"IFCCOMPOSITEPROFILEDEF",2542286263:"IFCCOMPLEXPROPERTY",776857604:"IFCCOLOURRGB",647927063:"IFCCLASSIFICATIONREFERENCE",3150382593:"IFCCENTERLINEPROFILEDEF",616511568:"IFCBLOBTEXTURE",2705031697:"IFCARBITRARYPROFILEDEFWITHVOIDS",1310608509:"IFCARBITRARYOPENPROFILEDEF",3798115385:"IFCARBITRARYCLOSEDPROFILEDEF",2297822566:"IFCANNOTATIONTEXTOCCURRENCE",3612888222:"IFCANNOTATIONSYMBOLOCCURRENCE",962685235:"IFCANNOTATIONSURFACEOCCURRENCE",2442683028:"IFCANNOTATIONOCCURRENCE",1065908215:"IFCWATERPROPERTIES",891718957:"IFCVIRTUALGRIDINTERSECTION",1907098498:"IFCVERTEXPOINT",3304826586:"IFCVERTEXBASEDTEXTUREMAP",2799835756:"IFCVERTEX",180925521:"IFCUNITASSIGNMENT",1735638870:"IFCTOPOLOGYREPRESENTATION",1377556343:"IFCTOPOLOGICALREPRESENTATIONITEM",581633288:"IFCTIMESERIESVALUE",1718945513:"IFCTIMESERIESREFERENCERELATIONSHIP",3101149627:"IFCTIMESERIES",3317419933:"IFCTHERMALMATERIALPROPERTIES",1210645708:"IFCTEXTUREVERTEX",2552916305:"IFCTEXTUREMAP",1742049831:"IFCTEXTURECOORDINATEGENERATOR",280115917:"IFCTEXTURECOORDINATE",1484833681:"IFCTEXTSTYLEWITHBOXCHARACTERISTICS",1640371178:"IFCTEXTSTYLETEXTMODEL",2636378356:"IFCTEXTSTYLEFORDEFINEDFONT",1983826977:"IFCTEXTSTYLEFONTMODEL",1447204868:"IFCTEXTSTYLE",912023232:"IFCTELECOMADDRESS",531007025:"IFCTABLEROW",985171141:"IFCTABLE",1290481447:"IFCSYMBOLSTYLE",626085974:"IFCSURFACETEXTURE",1351298697:"IFCSURFACESTYLEWITHTEXTURES",846575682:"IFCSURFACESTYLESHADING",1607154358:"IFCSURFACESTYLEREFRACTION",3303107099:"IFCSURFACESTYLELIGHTING",1300840506:"IFCSURFACESTYLE",3049322572:"IFCSTYLEDREPRESENTATION",3958052878:"IFCSTYLEDITEM",2830218821:"IFCSTYLEMODEL",3408363356:"IFCSTRUCTURALLOADTEMPERATURE",2525727697:"IFCSTRUCTURALLOADSTATIC",2162789131:"IFCSTRUCTURALLOAD",2273995522:"IFCSTRUCTURALCONNECTIONCONDITION",3692461612:"IFCSIMPLEPROPERTY",4240577450:"IFCSHAPEREPRESENTATION",3982875396:"IFCSHAPEMODEL",867548509:"IFCSHAPEASPECT",4165799628:"IFCSECTIONREINFORCEMENTPROPERTIES",2042790032:"IFCSECTIONPROPERTIES",448429030:"IFCSIUNIT",2341007311:"IFCROOT",3679540991:"IFCRIBPLATEPROFILEPROPERTIES",1660063152:"IFCREPRESENTATIONMAP",3008791417:"IFCREPRESENTATIONITEM",3377609919:"IFCREPRESENTATIONCONTEXT",1076942058:"IFCREPRESENTATION",1222501353:"IFCRELAXATION",1580146022:"IFCREINFORCEMENTBARPROPERTIES",2692823254:"IFCREFERENCESVALUEDOCUMENT",825690147:"IFCQUANTITYWEIGHT",2405470396:"IFCQUANTITYVOLUME",3252649465:"IFCQUANTITYTIME",931644368:"IFCQUANTITYLENGTH",2093928680:"IFCQUANTITYCOUNT",2044713172:"IFCQUANTITYAREA",3710013099:"IFCPROPERTYENUMERATION",148025276:"IFCPROPERTYDEPENDENCYRELATIONSHIP",3896028662:"IFCPROPERTYCONSTRAINTRELATIONSHIP",2598011224:"IFCPROPERTY",2802850158:"IFCPROFILEPROPERTIES",3958567839:"IFCPROFILEDEF",2267347899:"IFCPRODUCTSOFCOMBUSTIONPROPERTIES",2095639259:"IFCPRODUCTREPRESENTATION",2417041796:"IFCPRESENTATIONSTYLEASSIGNMENT",3119450353:"IFCPRESENTATIONSTYLE",1304840413:"IFCPRESENTATIONLAYERWITHSTYLE",2022622350:"IFCPRESENTATIONLAYERASSIGNMENT",1775413392:"IFCPREDEFINEDTEXTFONT",3213052703:"IFCPREDEFINEDTERMINATORSYMBOL",990879717:"IFCPREDEFINEDSYMBOL",3727388367:"IFCPREDEFINEDITEM",3355820592:"IFCPOSTALADDRESS",2226359599:"IFCPHYSICALSIMPLEQUANTITY",2483315170:"IFCPHYSICALQUANTITY",101040310:"IFCPERSONANDORGANIZATION",2077209135:"IFCPERSON",1207048766:"IFCOWNERHISTORY",1411181986:"IFCORGANIZATIONRELATIONSHIP",4251960020:"IFCORGANIZATION",1227763645:"IFCOPTICALMATERIALPROPERTIES",2251480897:"IFCOBJECTIVE",3701648758:"IFCOBJECTPLACEMENT",1918398963:"IFCNAMEDUNIT",2706619895:"IFCMONETARYUNIT",3368373690:"IFCMETRIC",677618848:"IFCMECHANICALSTEELMATERIALPROPERTIES",4256014907:"IFCMECHANICALMATERIALPROPERTIES",2597039031:"IFCMEASUREWITHUNIT",3265635763:"IFCMATERIALPROPERTIES",2199411900:"IFCMATERIALLIST",1303795690:"IFCMATERIALLAYERSETUSAGE",3303938423:"IFCMATERIALLAYERSET",248100487:"IFCMATERIALLAYER",1847130766:"IFCMATERIALCLASSIFICATIONRELATIONSHIP",1838606355:"IFCMATERIAL",30780891:"IFCLOCALTIME",1566485204:"IFCLIGHTINTENSITYDISTRIBUTION",4162380809:"IFCLIGHTDISTRIBUTIONDATA",3452421091:"IFCLIBRARYREFERENCE",2655187982:"IFCLIBRARYINFORMATION",3020489413:"IFCIRREGULARTIMESERIESVALUE",852622518:"IFCGRIDAXIS",3548104201:"IFCEXTERNALLYDEFINEDTEXTFONT",3207319532:"IFCEXTERNALLYDEFINEDSYMBOL",1040185647:"IFCEXTERNALLYDEFINEDSURFACESTYLE",2242383968:"IFCEXTERNALLYDEFINEDHATCHSTYLE",3200245327:"IFCEXTERNALREFERENCE",1648886627:"IFCENVIRONMENTALIMPACTVALUE",3796139169:"IFCDRAUGHTINGCALLOUTRELATIONSHIP",770865208:"IFCDOCUMENTINFORMATIONRELATIONSHIP",1154170062:"IFCDOCUMENTINFORMATION",1376555844:"IFCDOCUMENTELECTRONICFORMAT",2949456006:"IFCDIMENSIONALEXPONENTS",1045800335:"IFCDERIVEDUNITELEMENT",1765591967:"IFCDERIVEDUNIT",1072939445:"IFCDATEANDTIME",3510044353:"IFCCURVESTYLEFONTPATTERN",2367409068:"IFCCURVESTYLEFONTANDSCALING",1105321065:"IFCCURVESTYLEFONT",539742890:"IFCCURRENCYRELATIONSHIP",602808272:"IFCCOSTVALUE",1065062679:"IFCCOORDINATEDUNIVERSALTIMEOFFSET",347226245:"IFCCONSTRAINTRELATIONSHIP",613356794:"IFCCONSTRAINTCLASSIFICATIONRELATIONSHIP",1658513725:"IFCCONSTRAINTAGGREGATIONRELATIONSHIP",1959218052:"IFCCONSTRAINT",2732653382:"IFCCONNECTIONSURFACEGEOMETRY",4257277454:"IFCCONNECTIONPORTGEOMETRY",2614616156:"IFCCONNECTIONPOINTGEOMETRY",2859738748:"IFCCONNECTIONGEOMETRY",3264961684:"IFCCOLOURSPECIFICATION",3639012971:"IFCCLASSIFICATIONNOTATIONFACET",938368621:"IFCCLASSIFICATIONNOTATION",1098599126:"IFCCLASSIFICATIONITEMRELATIONSHIP",1767535486:"IFCCLASSIFICATIONITEM",747523909:"IFCCLASSIFICATION",622194075:"IFCCALENDARDATE",2069777674:"IFCBOUNDARYNODECONDITIONWARPING",1387855156:"IFCBOUNDARYNODECONDITION",3367102660:"IFCBOUNDARYFACECONDITION",1560379544:"IFCBOUNDARYEDGECONDITION",4037036970:"IFCBOUNDARYCONDITION",3869604511:"IFCAPPROVALRELATIONSHIP",390851274:"IFCAPPROVALPROPERTYRELATIONSHIP",2080292479:"IFCAPPROVALACTORRELATIONSHIP",130549933:"IFCAPPROVAL",1110488051:"IFCAPPLIEDVALUERELATIONSHIP",411424972:"IFCAPPLIEDVALUE",639542469:"IFCAPPLICATION",618182010:"IFCADDRESS",3630933823:"IFCACTORROLE",599546466:"FILE_DESCRIPTION",1390159747:"FILE_NAME",1109904537:"FILE_SCHEMA"};class c{static async getUnits(F){var R;const{IFCUNITASSIGNMENT:E}=w,I=await F.getAllPropertiesOfType(E);if(!I)return 1;const C=Object.keys(I),T=I[parseInt(C[0],10)];for(const A of T.Units){if(A.value===void 0||A.value===null)continue;const N=await F.getProperties(A.value);if(!N||!N.UnitType||!N.UnitType.value||N.UnitType.value!=="LENGTHUNIT")continue;let S=1,P=1;return N.Name.value==="METRE"&&(P=1),N.Name.value==="FOOT"&&(P=.3048),((R=N.Prefix)==null?void 0:R.value)==="MILLI"&&(S=.001),P*S}return 1}static async findItemByGuid(F,E){var C;const I=F.getAllPropertiesIDs();for(const T of I){const R=await F.getProperties(T);if(R&&((C=R.GlobalId)==null?void 0:C.value)===E)return R}return null}static async getRelationMap(F,E,I){var N;const T=I??(async()=>{}),R={},A=F.getAllPropertiesIDs();for(const O of A){const S=await F.getProperties(O);if(!S)continue;const P=S.type===E,M=Object.keys(S).find(s=>s.startsWith("Relating")),e=Object.keys(S).find(s=>s.startsWith("Related"));if(!(P&&M&&e))continue;const t=await F.getProperties((N=S[M])==null?void 0:N.value),U=S[e];if(!t||!U||!(U&&Array.isArray(U)))continue;const i=U.map(s=>s.value);await T(t.expressID,i),R[t.expressID]=i}return R}static async getQsetQuantities(F,E,I){const T=I??(()=>{}),R=await F.getProperties(E);return!R||R.type!==v?null:(R.Quantities??[{}]).map(O=>(O.value&&T(O.value),O.value)).filter(O=>O!==null)}static async getPsetProps(F,E,I){const T=I??(()=>{}),R=await F.getProperties(E);return!R||R.type!==x?null:(R.HasProperties??[{}]).map(O=>(O.value&&T(O.value),O.value)).filter(O=>O!==null)}static async getPsetRel(F,E){var A;if(!await F.getProperties(E))return null;const C=await F.getAllPropertiesOfType(V);if(!C)return null;const T=Object.values(C);let R=null;for(const N of T)((A=N.RelatingPropertyDefinition)==null?void 0:A.value)===E&&(R=N.expressID);return R}static async getQsetRel(F,E){return c.getPsetRel(F,E)}static async getEntityName(F,E){var R;const I=await F.getProperties(E);if(!I)return{key:null,name:null};const C=Object.keys(I).find(A=>A.endsWith("Name"))??null,T=C?(R=I[C])==null?void 0:R.value:null;return{key:C,name:T}}static async getQuantityValue(F,E){const I=await F.getProperties(E);if(!I)return{key:null,value:null};const C=Object.keys(I).find(R=>R.endsWith("Value"))??null;let T;return C===null||I[C]===void 0||I[C]===null?T=null:T=I[C].value,{key:C,value:T}}static isRel(F){return K[F].startsWith("IFCREL")}static async attributeExists(F,E,I){const C=await F.getProperties(E);return C?Object.keys(C).includes(I):!1}static async groupEntitiesByType(F,E){var C;const I=new Map;for(const T of E){const R=await F.getProperties(T);if(!R)continue;const A=R.type;I.get(A)||I.set(A,new Set),(C=I.get(A))==null||C.add(T)}return I}}const Q=new Map([[H,{forRelating:"IsDecomposedBy",forRelated:"Decomposes"}],[p,{forRelating:"AssociatedTo",forRelated:"HasAssociations"}],[f,{forRelating:"ClassificationForObjects",forRelated:"HasAssociations"}],[d,{forRelating:"IsGroupedBy",forRelated:"HasAssignments"}],[V,{forRelated:"IsDefinedBy",forRelating:"DefinesOcurrence"}],[W,{forRelated:"IsTypedBy",forRelating:"Types"}],[g,{forRelated:"IsDefinedBy",forRelating:"Defines"}],[X,{forRelated:"ContainedInStructure",forRelating:"ContainsElements"}]]),r=class r extends y{constructor(E){super(E);L(this,"onDisposed",new o);L(this,"enabled",!0);L(this,"onRelationsIndexed",new o);L(this,"_relToAttributesMap",Q);L(this,"_inverseAttributes",["IsDecomposedBy","Decomposes","AssociatedTo","HasAssociations","ClassificationForObjects","IsGroupedBy","HasAssignments","IsDefinedBy","DefinesOcurrence","IsTypedBy","Types","Defines","ContainedInStructure","ContainsElements"]);L(this,"_ifcRels",[H,p,f,d,V,W,g,X]);L(this,"relationMaps",{});L(this,"onFragmentsDisposed",E=>{delete this.relationMaps[E.groupID]});this.components.add(r.uuid,this),E.get(a).onFragmentsDisposed.add(this.onFragmentsDisposed)}setRelationMap(E,I){this.relationMaps[E.uuid]=I,this.onRelationsIndexed.trigger({modelID:E.uuid,relationsMap:I})}async process(E){if(!E.hasProperties)throw new Error("FragmentsGroup properties not found");let I=this.relationMaps[E.uuid];if(I)return I;I=new Map;for(const C of this._ifcRels)await c.getRelationMap(E,C,async(T,R)=>{const A=this._relToAttributesMap.get(C);if(!A)return;const{forRelated:N,forRelating:O}=A,S=I.get(T)??new Map,P=this._inverseAttributes.indexOf(O);S.set(P,R),I.set(T,S);for(const M of R){const e=I.get(M)??new Map,t=this._inverseAttributes.indexOf(N),U=e.get(t)??[];U.push(T),e.set(t,U),I.set(M,e)}});return this.setRelationMap(E,I),I}async processFromWebIfc(E,I){const C=new Map;for(const T of this._ifcRels){const R=this._relToAttributesMap.get(T);if(!R)continue;const{forRelated:A,forRelating:N}=R,O=E.GetLineIDsWithType(I,T);for(let S=0;SD.startsWith("Relating")),e=Object.keys(P).find(D=>D.startsWith("Related"));if(!(M&&e))continue;const t=P[M].value,U=P[e].map(D=>D.value),i=C.get(t)??new Map,s=this._inverseAttributes.indexOf(N);i.set(s,U),C.set(t,i);for(const D of U){const G=C.get(D)??new Map,B=this._inverseAttributes.indexOf(A),u=G.get(B)??[];u.push(t),G.set(B,u),C.set(D,G)}}}return this.onRelationsIndexed.trigger({modelID:I.toString(),relationsMap:C}),C}getEntityRelations(E,I,C){const T=this.relationMaps[E.uuid];if(!T)return null;const R=T.get(I),A=this._inverseAttributes.indexOf(C);if(!R||A===-1)return null;const N=R.get(A);return N||null}serializeRelations(E){const I={};for(const[C,T]of E.entries()){I[C]||(I[C]={});for(const[R,A]of T.entries())I[C][R]=A}return JSON.stringify(I)}serializeModelRelations(E){const I=this.relationMaps[E.uuid];return I?this.serializeRelations(I):null}serializeAllRelations(){const E={};for(const I in this.relationMaps){const C=this.relationMaps[I],T={};for(const[R,A]of C.entries()){T[R]||(T[R]={});for(const[N,O]of A.entries())T[R][N]=O}E[I]=T}return JSON.stringify(E)}getRelationsMapFromJSON(E){const I=JSON.parse(E),C=new Map;for(const T in I){const R=I[T],A=new Map;for(const N in R)A.set(Number(N),R[N]);C.set(Number(T),A)}return C}dispose(){this.relationMaps={},this.components.get(a).onFragmentsDisposed.remove(this.onFragmentsDisposed),this.onDisposed.trigger(r.uuid),this.onDisposed.reset()}};L(r,"uuid","23a889ab-83b3-44a4-8bee-ead83438370b");let l=r;export{a as F,l as I,c as a}; diff --git a/examples/assets/index-D_n-lttT.js b/examples/assets/index-DvHc-rVc.js similarity index 91% rename from examples/assets/index-D_n-lttT.js rename to examples/assets/index-DvHc-rVc.js index 1629a5dff..a2fd43ac2 100644 --- a/examples/assets/index-D_n-lttT.js +++ b/examples/assets/index-DvHc-rVc.js @@ -1 +1 @@ -var l=Object.defineProperty;var m=(e,s,t)=>s in e?l(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t;var r=(e,s,t)=>(m(e,typeof s!="symbol"?s+"":s,t),t);import{aj as S,ak as F,al as L,i as T,ab as h}from"./web-ifc-api-BC8YMRiS.js";import{G as E}from"./ifc-geometry-types-C3SKrzrZ.js";import{C as D}from"./index-DJTKMiao.js";const o=class o extends D{constructor(t){super(t);r(this,"enabled",!0);t.add(o.uuid,this)}async export(t,i,f=!1,I=!0){const n={},c=new Set(t.GetIfcEntityList(i)),p=new Set([S,F,L,T,h]);for(const a of p)c.add(a);for(const a of c){if(E.has(a))continue;const C=p.has(a)&&I,y=t.GetLineIDsWithType(i,a);for(const G of y){const u=t.GetLine(0,G,C,f);n[u.expressID]=u}}return n}};r(o,"uuid","b32c4332-cd67-436e-ba7f-196646c7a635");let d=o;export{d as I}; +var l=Object.defineProperty;var m=(e,s,t)=>s in e?l(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t;var r=(e,s,t)=>(m(e,typeof s!="symbol"?s+"":s,t),t);import{aj as S,ak as F,al as L,i as T,ab as h}from"./web-ifc-api-BC8YMRiS.js";import{G as E}from"./ifc-geometry-types-C3SKrzrZ.js";import{C as D}from"./index-BraZXcLv.js";const o=class o extends D{constructor(t){super(t);r(this,"enabled",!0);t.add(o.uuid,this)}async export(t,i,f=!1,I=!0){const n={},c=new Set(t.GetIfcEntityList(i)),p=new Set([S,F,L,T,h]);for(const a of p)c.add(a);for(const a of c){if(E.has(a))continue;const C=p.has(a)&&I,y=t.GetLineIDsWithType(i,a);for(const G of y){const u=t.GetLine(0,G,C,f);n[u.expressID]=u}}return n}};r(o,"uuid","b32c4332-cd67-436e-ba7f-196646c7a635");let d=o;export{d as I}; diff --git a/examples/assets/index-buhHUNtp.js b/examples/assets/index-PenRR3X-.js similarity index 96% rename from examples/assets/index-buhHUNtp.js rename to examples/assets/index-PenRR3X-.js index 2c403b4b9..3f6e7304e 100644 --- a/examples/assets/index-buhHUNtp.js +++ b/examples/assets/index-PenRR3X-.js @@ -1 +1 @@ -var L=Object.defineProperty;var k=(p,g,t)=>g in p?L(p,g,{enumerable:!0,configurable:!0,writable:!0,value:t}):p[g]=t;var c=(p,g,t)=>(k(p,typeof g!="symbol"?g+"":g,t),t);import{a8 as G,k as S,a9 as T,aa as z,ab as N,N as P,C as W,a as j,c as B,e as C,ac as $}from"./web-ifc-api-BC8YMRiS.js";import{S as O,I as R,C as U}from"./ifc-metadata-reader-j9dl-lHS.js";import{I as V}from"./ifc-fragment-settings-CiVry-YT.js";import{F as J}from"./index-BzmpwuIQ.js";import{C as X,E as D,a as q}from"./index-DJTKMiao.js";import{I as H}from"./index-D_n-lttT.js";const l=class l extends X{constructor(t){super(t);c(this,"onIfcStartedLoading",new D);c(this,"onSetup",new D);c(this,"onDisposed",new D);c(this,"settings",new V);c(this,"enabled",!0);c(this,"webIfc",new G);c(this,"_material",new S);c(this,"_spatialTree",new O);c(this,"_metaData",new R);c(this,"_fragmentInstances",new Map);c(this,"_civil",new U);c(this,"_visitedFragments",new Map);c(this,"_materialT",new S({transparent:!0,opacity:.5}));this.components.add(l.uuid,this),this.settings.excludedCategories.add(T)}dispose(){this.webIfc=null,this.onDisposed.trigger(l.uuid),this.onDisposed.reset()}async setup(t){this.settings={...this.settings,...t},this.settings.autoSetWasm&&await this.autoSetWasm(),this.onSetup.trigger()}async load(t,n=!0){const r=performance.now();this.onIfcStartedLoading.trigger(),await this.readIfcFile(t);const a=await this.getAllGeometries(),m=await this.components.get(H).export(this.webIfc,0);a.setLocalProperties(m),this.cleanUp();const e=this.components.get(J);e.groups.set(a.uuid,a);for(const i of a.items)e.list.set(i.id,i),i.mesh.uuid=i.id,i.group=a;return e.onFragmentsLoaded.trigger(a),n&&e.coordinate([a]),console.log(`Streaming the IFC took ${performance.now()-r} ms!`),a}async readIfcFile(t){const{path:n,absolute:r,logLevel:a}=this.settings.wasm;return this.webIfc.SetWasmPath(n,r),await this.webIfc.Init(),a&&this.webIfc.SetLogLevel(a),this.webIfc.OpenModel(t,this.settings.webIfc)}async getAllGeometries(){this._spatialTree.setUp(this.webIfc);const t=this.webIfc.GetIfcEntityList(0),n=new z,{FILE_NAME:r,FILE_DESCRIPTION:a}=$;n.ifcMetadata={name:this._metaData.get(this.webIfc,r),description:this._metaData.get(this.webIfc,a),schema:this.webIfc.GetModelSchema(0)||"IFC2X3",maxExpressID:this.webIfc.GetMaxExpressID(0)};const o=[];for(const e of t){if(!this.webIfc.IsIfcElement(e)&&e!==N||this.settings.excludedCategories.has(e))continue;const i=this.webIfc.GetLineIDsWithType(0,e),f=i.size();for(let h=0;h{this.getMesh(e,n)});for(const e of this._visitedFragments){const{index:i,fragment:f}=e[1];n.keyFragments.set(i,f.id)}for(const e of n.items){const i=this._fragmentInstances.get(e.id);if(!i)throw new Error("Fragment not found!");const f=[];for(const[h,s]of i)f.push(s);e.add(f)}const m=this.webIfc.GetCoordinationMatrix(0);return n.coordinationMatrix.fromArray(m),n.civilData=this._civil.read(this.webIfc),n}cleanUp(){this.webIfc=null,this.webIfc=new G,this._visitedFragments.clear(),this._fragmentInstances.clear()}getMesh(t,n){const r=t.geometries.size(),a=t.expressID;for(let o=0;og in p?L(p,g,{enumerable:!0,configurable:!0,writable:!0,value:t}):p[g]=t;var c=(p,g,t)=>(k(p,typeof g!="symbol"?g+"":g,t),t);import{a8 as G,k as S,a9 as T,aa as z,ab as N,N as P,C as W,a as j,c as B,e as C,ac as $}from"./web-ifc-api-BC8YMRiS.js";import{S as O,I as R,C as U}from"./ifc-metadata-reader-j9dl-lHS.js";import{I as V}from"./ifc-fragment-settings-CiVry-YT.js";import{F as J}from"./index-DDOiyGyA.js";import{C as X,E as D,a as q}from"./index-BraZXcLv.js";import{I as H}from"./index-DvHc-rVc.js";const l=class l extends X{constructor(t){super(t);c(this,"onIfcStartedLoading",new D);c(this,"onSetup",new D);c(this,"onDisposed",new D);c(this,"settings",new V);c(this,"enabled",!0);c(this,"webIfc",new G);c(this,"_material",new S);c(this,"_spatialTree",new O);c(this,"_metaData",new R);c(this,"_fragmentInstances",new Map);c(this,"_civil",new U);c(this,"_visitedFragments",new Map);c(this,"_materialT",new S({transparent:!0,opacity:.5}));this.components.add(l.uuid,this),this.settings.excludedCategories.add(T)}dispose(){this.webIfc=null,this.onDisposed.trigger(l.uuid),this.onDisposed.reset()}async setup(t){this.settings={...this.settings,...t},this.settings.autoSetWasm&&await this.autoSetWasm(),this.onSetup.trigger()}async load(t,n=!0){const r=performance.now();this.onIfcStartedLoading.trigger(),await this.readIfcFile(t);const a=await this.getAllGeometries(),m=await this.components.get(H).export(this.webIfc,0);a.setLocalProperties(m),this.cleanUp();const e=this.components.get(J);e.groups.set(a.uuid,a);for(const i of a.items)e.list.set(i.id,i),i.mesh.uuid=i.id,i.group=a;return e.onFragmentsLoaded.trigger(a),n&&e.coordinate([a]),console.log(`Streaming the IFC took ${performance.now()-r} ms!`),a}async readIfcFile(t){const{path:n,absolute:r,logLevel:a}=this.settings.wasm;return this.webIfc.SetWasmPath(n,r),await this.webIfc.Init(),a&&this.webIfc.SetLogLevel(a),this.webIfc.OpenModel(t,this.settings.webIfc)}async getAllGeometries(){this._spatialTree.setUp(this.webIfc);const t=this.webIfc.GetIfcEntityList(0),n=new z,{FILE_NAME:r,FILE_DESCRIPTION:a}=$;n.ifcMetadata={name:this._metaData.get(this.webIfc,r),description:this._metaData.get(this.webIfc,a),schema:this.webIfc.GetModelSchema(0)||"IFC2X3",maxExpressID:this.webIfc.GetMaxExpressID(0)};const o=[];for(const e of t){if(!this.webIfc.IsIfcElement(e)&&e!==N||this.settings.excludedCategories.has(e))continue;const i=this.webIfc.GetLineIDsWithType(0,e),f=i.size();for(let h=0;h{this.getMesh(e,n)});for(const e of this._visitedFragments){const{index:i,fragment:f}=e[1];n.keyFragments.set(i,f.id)}for(const e of n.items){const i=this._fragmentInstances.get(e.id);if(!i)throw new Error("Fragment not found!");const f=[];for(const[h,s]of i)f.push(s);e.add(f)}const m=this.webIfc.GetCoordinationMatrix(0);return n.coordinationMatrix.fromArray(m),n.civilData=this._civil.read(this.webIfc),n}cleanUp(){this.webIfc=null,this.webIfc=new G,this._visitedFragments.clear(),this._fragmentInstances.clear()}getMesh(t,n){const r=t.geometries.size(),a=t.expressID;for(let o=0;oa.begin());t.renderer.onAfterUpdate.add(()=>a.end());b.init();const r=n.getSize(),i=c.create(()=>l` +import"./web-ifc-api-BC8YMRiS.js";import{S as p}from"./stats.min-GTpOrGrX.js";import{p as d,a as m,m as c}from"./index-DyM33b1I.js";import{f as b,p as u,s as f,i as g,k as h,N as v,u as x,h as y}from"./index-b4ozRbQy.js";import"./_commonjsHelpers-Cpj98o6Y.js";const z=document.getElementById("container"),a=new b,k=a.get(u),t=k.create();t.scene=new f(a);t.renderer=new g(a,z);t.camera=new h(a);t.scene.setup();a.init();const w=a.get(v);w.create(t);t.camera.controls.setLookAt(1,2,-2,-2,0,-5);t.scene.three.background=null;const $=new x(a),S=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),B=await S.arrayBuffer(),L=new Uint8Array(B),E=$.load(L);t.scene.three.add(E);const A=new y(a),e=A.create(t),I=document.getElementById("minimap"),l=e.renderer.domElement;l.style.borderRadius="12px";I.append(l);e.resize();const o=new p;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>o.begin());t.renderer.onAfterUpdate.add(()=>o.end());d.init();const r=e.getSize(),i=m.create(()=>c` + @change="${({target:n})=>{e.enabled=n.value}}"> + @change="${({target:n})=>{e.lockRotation=n.value}}"> - - - - + slider label="Zoom" value="${e.zoom}" min="0.01" max="0.5" step="0.01" + @change="${({target:n})=>{e.zoom=n.value}}"> + slider label="Front offset" value="${e.frontOffset}" min="0" max="5" step="1" + @change="${({target:n})=>{e.frontOffset=n.value}}">
+ @change="${({target:n})=>{const s=e.getSize();s.x=n.value,e.resize(s)}}"> + @change="${({target:n})=>{const s=e.getSize();s.y=n.value,e.resize(s)}}">
- `);document.body.append(i);const R=c.create(()=>l` + `);document.body.append(i);const R=m.create(()=>c` diff --git a/examples/assets/orthoPerspectiveCamera.js b/examples/assets/orthoPerspectiveCamera.js index a480df04d..cc637ee96 100644 --- a/examples/assets/orthoPerspectiveCamera.js +++ b/examples/assets/orthoPerspectiveCamera.js @@ -1,9 +1,9 @@ -import{B as p,b as d,M as b}from"./web-ifc-api-BC8YMRiS.js";import{S as u}from"./stats.min-GTpOrGrX.js";import{p as h,a as l,m}from"./index-DyM33b1I.js";import{f as w,p as g,s as f,i as v,n as k,N as P}from"./index-b4ozRbQy.js";import"./_commonjsHelpers-Cpj98o6Y.js";const F=document.getElementById("container"),t=new w,y=t.get(g),e=y.create();e.scene=new f(t);e.renderer=new v(t,F);e.camera=new k(t);e.scene.setup();await e.camera.controls.setLookAt(3,3,3,0,0,0);t.init();e.scene.three.background=null;const O=new p,j=new d({color:"#6528D7"}),s=new b(O,j);s.position.set(0,.5,0);e.scene.three.add(s);e.meshes.add(s);const $=t.get(P),x=$.create(e);e.camera.projection.onChanged.add(()=>{const o=e.camera.projection.current;x.fade=o==="Perspective"});const n=new u;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end());h.init();const r=l.create(()=>m` +import{B as u,b as h,M as w}from"./web-ifc-api-BC8YMRiS.js";import{S as $}from"./stats.min-GTpOrGrX.js";import{p as x,a as g,m as f}from"./index-DyM33b1I.js";import{f as v,p as k,s as P,i as j,n as y,N as F}from"./index-b4ozRbQy.js";import"./_commonjsHelpers-Cpj98o6Y.js";const O=document.getElementById("container");let t=new v,c=t.get(k),e=c.create();e.scene=new P(t);e.renderer=new j(t,O);e.camera=new y(t);e.scene.setup();await e.camera.controls.setLookAt(3,3,3,0,0,0);t.init();e.scene.three.background=null;let l=new u,m=new h({color:"#6528D7"}),n=new w(l,m);n.position.set(0,.5,0);e.scene.three.add(n);e.meshes.add(n);let d=t.get(F),p=d.create(e);e.camera.projection.onChanged.add(()=>{const o=e.camera.projection.current;p.fade=o==="Perspective"});const r=new $;r.showPanel(2);document.body.append(r.dom);r.dom.style.left="0px";r.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>r.begin());e.renderer.onAfterUpdate.add(()=>r.end());x.init();const a=g.create(()=>f` + @change="${({target:o})=>{const i=o.value[0],{current:s}=e.camera.projection;if(s==="Orthographic"&&i==="FirstPerson"){alert("First person is not compatible with ortho!"),o.value[0]=e.camera.mode.id;return}e.camera.set(i)}}"> @@ -12,7 +12,7 @@ import{B as p,b as d,M as b}from"./web-ifc-api-BC8YMRiS.js";import{S as u}from". + @change="${({target:o})=>{const i=o.value[0],s=i==="Orthographic",b=e.camera.mode.id==="FirstPerson";if(s&&b){alert("First person is not compatible with ortho!"),o.value[0]=e.camera.projection.current;return}e.camera.projection.set(i)}}"> @@ -24,13 +24,18 @@ import{B as p,b as d,M as b}from"./web-ifc-api-BC8YMRiS.js";import{S as u}from". + @click="${()=>{e.camera.fit([n])}}"> + + + {const o=e.camera.projection.current;p.fade=o==="Perspective"})}}"> - `);document.body.append(r);const M=l.create(()=>m` + `);document.body.append(a);const C=g.create(()=>f` + @click="${()=>{a.classList.contains("options-menu-visible")?a.classList.remove("options-menu-visible"):a.classList.add("options-menu-visible")}}"> - `);document.body.append(M); + `);document.body.append(C); diff --git a/examples/assets/utils.js b/examples/assets/utils.js index e111d2346..496aa83ba 100644 --- a/examples/assets/utils.js +++ b/examples/assets/utils.js @@ -1 +1 @@ -var W=Object.defineProperty;var q=(v,t,e)=>t in v?W(v,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):v[t]=e;var c=(v,t,e)=>(q(v,typeof t!="symbol"?t+"":t,e),e);import{f as O,z as j,r as H,V as D,P as J,I as K,a as R,M as V,ap as Q,L as Z,s as ee}from"./web-ifc-api-BC8YMRiS.js";import{S as te}from"./stats.min-GTpOrGrX.js";import{E as T,C as B,a as se,W as ne,S as oe,b as re,c as ie,G as ae}from"./index-DJTKMiao.js";import{C as ce}from"./index-DHVa0dFp.js";import{F as de}from"./index-BzmpwuIQ.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./async-event-D8tC9awa.js";class fe{constructor(t){c(this,"_event");c(this,"_position",new O);c(this,"onDisposed",new T);c(this,"updateMouseInfo",t=>{this._event=t});this.dom=t,this.setupEvents(!0)}get position(){if(this._event){const t=this.dom.getBoundingClientRect();this._position.x=this.getPositionX(t,this._event),this._position.y=this.getPositionY(t,this._event)}return this._position}dispose(){this.setupEvents(!1),this.onDisposed.trigger(),this.onDisposed.reset()}getPositionY(t,e){return-((e.clientY-t.top)/(t.bottom-t.top))*2+1}getPositionX(t,e){return(e.clientX-t.left)/(t.right-t.left)*2-1}setupEvents(t){t?this.dom.addEventListener("mousemove",this.updateMouseInfo):this.dom.removeEventListener("mousemove",this.updateMouseInfo)}}class le{constructor(t,e){c(this,"enabled",!0);c(this,"components");c(this,"onDisposed",new T);c(this,"mouse");c(this,"three",new j);c(this,"world");const s=e.renderer;if(!s)throw new Error("A renderer is needed for the raycaster to work!");this.world=e,this.mouse=new fe(s.three.domElement),this.components=t}dispose(){this.mouse.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}castRay(t=Array.from(this.world.meshes)){if(!this.world)throw new Error("A world is needed to cast rays!");const e=this.world.camera.three;return this.three.setFromCamera(this.mouse.position,e),this.intersect(t)}castRayFromVector(t,e,s=Array.from(this.world.meshes)){return this.three.set(t,e),this.intersect(s)}intersect(t=Array.from(this.world.meshes)){const e=this.three.intersectObjects(t),s=this.filterClippingPlanes(e);return s.length>0?s[0]:null}filterClippingPlanes(t){if(!this.world.renderer)throw new Error("Renderer not found!");const e=this.world.renderer.three;if(!e.clippingPlanes)return t;const s=e.clippingPlanes;return t.length<=0||!s||(s==null?void 0:s.length)<=0?t:t.filter(m=>s.every(y=>y.distanceToPoint(m.point)>0))}}const A=class A extends B{constructor(e){super(e);c(this,"enabled",!0);c(this,"list",new Map);c(this,"onDisposed",new T);e.add(A.uuid,this)}get(e){if(this.list.has(e.uuid))return this.list.get(e.uuid);const s=new le(this.components,e);return this.list.set(e.uuid,s),e.onDisposed.add(()=>{this.delete(e)}),s}delete(e){const s=this.list.get(e.uuid);s&&s.dispose(),this.list.delete(e.uuid)}dispose(){for(const[e,s]of this.list)s.dispose();this.list.clear(),this.onDisposed.trigger()}};c(A,"uuid","d5d8bdf0-db25-4952-b951-b643af207ace");let C=A;const S=class S extends B{constructor(e){super(e);c(this,"enabled",!0);e.add(S.uuid,this)}getFace(e,s,m){if(!e.geometry.index)throw new Error("Geometry must be indexed!");const y=new Map,o=e.geometry.index.array,{plane:i}=this.getFaceData(s,m,e),l=[];for(let f=0;fn.id);if(!a.size){const n=x++;for(const{id:u}of h)d.set(u,n);w.set(n,{edges:new Set(g),indices:new Set([f])});continue}let r=null;const E=new Set,M=new Set(g);for(const[n,u]of a){r===null?r=u:u!==r&&E.add(u),d.delete(n);const{edges:z}=w.get(u);z.delete(n),M.delete(n)}if(r===null)throw new Error("Error computing face!");const I=w.get(r),{indices:P}=I;P.add(f);for(const n of M){d.set(n,r);const{edges:u}=I;u.add(n)}for(const n of E){const u=w.get(n),{edges:z,indices:U}=u,X=w.get(r),{edges:Y,indices:k}=X;for(const b of z)Y.add(b),d.set(b,r);for(const b of U)k.add(b);w.delete(n)}}for(const[f,{indices:h,edges:a}]of w)if(h.has(s)){const g=[];for(const r of a){const E=y.get(r);g.push(E)}return{edges:g,indices:h}}return null}static distanceFromPointToLine(e,s,m,y=!1){const o=new H,i=new D;return o.set(s,m),o.closestPointToPoint(e,y,i),i.distanceTo(e)}getFaceData(e,s,m){const y=this.getVerticesAndNormal(m,e,s),{p1:o,p2:i,p3:l,faceNormal:x}=y;this.round(o),this.round(i),this.round(l),this.round(x);const d=[{id:`${o.x}|${o.y}|${o.z}`,value:o},{id:`${i.x}|${i.y}|${i.z}`,value:i},{id:`${l.x}|${l.y}|${l.z}`,value:l}];d.sort((I,P)=>I.idP.id?1:0);const[{id:w,value:f},{id:h,value:a},{id:g,value:r}]=d,E=[{id:`${w}|${h}`,distance:f.distanceTo(a),points:[f,a]},{id:`${h}|${g}`,distance:a.distanceTo(r),points:[a,r]},{id:`${w}|${g}`,distance:f.distanceTo(r),points:[f,r]}],M=new J;return M.setFromNormalAndCoplanarPoint(x,o),M.constant=Math.round(M.constant*10)/10,{plane:M,edges:E}}getVerticesAndNormal(e,s,m){if(!e.geometry.index)throw new Error("Geometry must be indexed!");const y=e.geometry.index.array,o=e.geometry.attributes.position.array,i=e.geometry.attributes.normal.array,l=y[s*3]*3,x=y[s*3+1]*3,d=y[s*3+2]*3,w=new D(o[l],o[l+1],o[l+2]),f=new D(o[x],o[x+1],o[x+2]),h=new D(o[d],o[d+1],o[d+2]),a=new D(i[l],i[l+1],i[l+2]),g=new D(i[x],i[x+1],i[x+2]),r=new D(i[d],i[d+1],i[d+2]),E=(a.x+g.x+r.x)/3,M=(a.y+g.y+r.y)/3,I=(a.z+g.z+r.z)/3,P=new D(E,M,I);if(m!==void 0&&e instanceof K){const n=new R;e.getMatrixAt(m,n);const u=new R;u.extractRotation(n),P.applyMatrix4(u),w.applyMatrix4(n),f.applyMatrix4(n),h.applyMatrix4(n)}return{p1:w,p2:f,p3:h,faceNormal:P}}round(e){e.x=Math.trunc(e.x*1e3)/1e3,e.y=Math.trunc(e.y*1e3)/1e3,e.z=Math.trunc(e.z*1e3)/1e3}};c(S,"uuid","267ca032-672f-4cb0-afa9-d24e904f39d6");let L=S;const ue=document.getElementById("container"),F=new se,pe=F.get(ne),p=pe.create();p.scene=new oe(F);p.renderer=new re(F,ue);p.camera=new ie(F);F.init();p.camera.controls.setLookAt(12,6,8,0,0,-10);p.scene.setup();const he=F.get(ae);he.create(p);const ge=new de(F),me=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),we=await me.arrayBuffer(),ye=new Uint8Array(we),N=ge.load(ye);p.scene.three.add(N);const ve=F.get(ce),_=ve.create(p);for(const v of N.children)v instanceof V&&_.add(v);_.needsUpdate=!0;p.camera.controls.addEventListener("sleep",()=>{_.needsUpdate=!0});const xe=F.get(L),Ee=F.get(C),Fe=Ee.get(p),G=new Q,Me=new Z({color:16711680,depthTest:!1}),De=new ee(G,Me);p.scene.three.add(De);p.renderer&&p.renderer.three.domElement.addEventListener("mousemove",()=>{const t=Fe.castRay([N]);if(!t||!(t.object instanceof V)||t.faceIndex===void 0)return;const e=xe.getFace(t.object,t.faceIndex,t.instanceId);if(e){const s=[];for(const m of e.edges)s.push(...m.points);G.setFromPoints(s)}});const $=new te;$.showPanel(2);document.body.append($.dom);$.dom.style.left="0px";$.dom.style.right="auto";p.renderer.onBeforeUpdate.add(()=>$.begin());p.renderer.onAfterUpdate.add(()=>$.end()); +var W=Object.defineProperty;var q=(v,t,e)=>t in v?W(v,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):v[t]=e;var c=(v,t,e)=>(q(v,typeof t!="symbol"?t+"":t,e),e);import{f as O,z as j,r as H,V as D,P as J,I as K,a as R,M as V,ap as Q,L as Z,s as ee}from"./web-ifc-api-BC8YMRiS.js";import{S as te}from"./stats.min-GTpOrGrX.js";import{E as T,C as B,a as se,W as ne,S as oe,b as re,c as ie,G as ae}from"./index-BraZXcLv.js";import{C as ce}from"./index-D6HCkz61.js";import{F as de}from"./index-DDOiyGyA.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./async-event-D8tC9awa.js";class fe{constructor(t){c(this,"_event");c(this,"_position",new O);c(this,"onDisposed",new T);c(this,"updateMouseInfo",t=>{this._event=t});this.dom=t,this.setupEvents(!0)}get position(){if(this._event){const t=this.dom.getBoundingClientRect();this._position.x=this.getPositionX(t,this._event),this._position.y=this.getPositionY(t,this._event)}return this._position}dispose(){this.setupEvents(!1),this.onDisposed.trigger(),this.onDisposed.reset()}getPositionY(t,e){return-((e.clientY-t.top)/(t.bottom-t.top))*2+1}getPositionX(t,e){return(e.clientX-t.left)/(t.right-t.left)*2-1}setupEvents(t){t?this.dom.addEventListener("mousemove",this.updateMouseInfo):this.dom.removeEventListener("mousemove",this.updateMouseInfo)}}class le{constructor(t,e){c(this,"enabled",!0);c(this,"components");c(this,"onDisposed",new T);c(this,"mouse");c(this,"three",new j);c(this,"world");const s=e.renderer;if(!s)throw new Error("A renderer is needed for the raycaster to work!");this.world=e,this.mouse=new fe(s.three.domElement),this.components=t}dispose(){this.mouse.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}castRay(t=Array.from(this.world.meshes)){if(!this.world)throw new Error("A world is needed to cast rays!");const e=this.world.camera.three;return this.three.setFromCamera(this.mouse.position,e),this.intersect(t)}castRayFromVector(t,e,s=Array.from(this.world.meshes)){return this.three.set(t,e),this.intersect(s)}intersect(t=Array.from(this.world.meshes)){const e=this.three.intersectObjects(t),s=this.filterClippingPlanes(e);return s.length>0?s[0]:null}filterClippingPlanes(t){if(!this.world.renderer)throw new Error("Renderer not found!");const e=this.world.renderer.three;if(!e.clippingPlanes)return t;const s=e.clippingPlanes;return t.length<=0||!s||(s==null?void 0:s.length)<=0?t:t.filter(m=>s.every(y=>y.distanceToPoint(m.point)>0))}}const A=class A extends B{constructor(e){super(e);c(this,"enabled",!0);c(this,"list",new Map);c(this,"onDisposed",new T);e.add(A.uuid,this)}get(e){if(this.list.has(e.uuid))return this.list.get(e.uuid);const s=new le(this.components,e);return this.list.set(e.uuid,s),e.onDisposed.add(()=>{this.delete(e)}),s}delete(e){const s=this.list.get(e.uuid);s&&s.dispose(),this.list.delete(e.uuid)}dispose(){for(const[e,s]of this.list)s.dispose();this.list.clear(),this.onDisposed.trigger()}};c(A,"uuid","d5d8bdf0-db25-4952-b951-b643af207ace");let C=A;const S=class S extends B{constructor(e){super(e);c(this,"enabled",!0);e.add(S.uuid,this)}getFace(e,s,m){if(!e.geometry.index)throw new Error("Geometry must be indexed!");const y=new Map,o=e.geometry.index.array,{plane:i}=this.getFaceData(s,m,e),l=[];for(let f=0;fn.id);if(!a.size){const n=x++;for(const{id:u}of h)d.set(u,n);w.set(n,{edges:new Set(g),indices:new Set([f])});continue}let r=null;const E=new Set,M=new Set(g);for(const[n,u]of a){r===null?r=u:u!==r&&E.add(u),d.delete(n);const{edges:z}=w.get(u);z.delete(n),M.delete(n)}if(r===null)throw new Error("Error computing face!");const I=w.get(r),{indices:P}=I;P.add(f);for(const n of M){d.set(n,r);const{edges:u}=I;u.add(n)}for(const n of E){const u=w.get(n),{edges:z,indices:U}=u,X=w.get(r),{edges:Y,indices:k}=X;for(const b of z)Y.add(b),d.set(b,r);for(const b of U)k.add(b);w.delete(n)}}for(const[f,{indices:h,edges:a}]of w)if(h.has(s)){const g=[];for(const r of a){const E=y.get(r);g.push(E)}return{edges:g,indices:h}}return null}static distanceFromPointToLine(e,s,m,y=!1){const o=new H,i=new D;return o.set(s,m),o.closestPointToPoint(e,y,i),i.distanceTo(e)}getFaceData(e,s,m){const y=this.getVerticesAndNormal(m,e,s),{p1:o,p2:i,p3:l,faceNormal:x}=y;this.round(o),this.round(i),this.round(l),this.round(x);const d=[{id:`${o.x}|${o.y}|${o.z}`,value:o},{id:`${i.x}|${i.y}|${i.z}`,value:i},{id:`${l.x}|${l.y}|${l.z}`,value:l}];d.sort((I,P)=>I.idP.id?1:0);const[{id:w,value:f},{id:h,value:a},{id:g,value:r}]=d,E=[{id:`${w}|${h}`,distance:f.distanceTo(a),points:[f,a]},{id:`${h}|${g}`,distance:a.distanceTo(r),points:[a,r]},{id:`${w}|${g}`,distance:f.distanceTo(r),points:[f,r]}],M=new J;return M.setFromNormalAndCoplanarPoint(x,o),M.constant=Math.round(M.constant*10)/10,{plane:M,edges:E}}getVerticesAndNormal(e,s,m){if(!e.geometry.index)throw new Error("Geometry must be indexed!");const y=e.geometry.index.array,o=e.geometry.attributes.position.array,i=e.geometry.attributes.normal.array,l=y[s*3]*3,x=y[s*3+1]*3,d=y[s*3+2]*3,w=new D(o[l],o[l+1],o[l+2]),f=new D(o[x],o[x+1],o[x+2]),h=new D(o[d],o[d+1],o[d+2]),a=new D(i[l],i[l+1],i[l+2]),g=new D(i[x],i[x+1],i[x+2]),r=new D(i[d],i[d+1],i[d+2]),E=(a.x+g.x+r.x)/3,M=(a.y+g.y+r.y)/3,I=(a.z+g.z+r.z)/3,P=new D(E,M,I);if(m!==void 0&&e instanceof K){const n=new R;e.getMatrixAt(m,n);const u=new R;u.extractRotation(n),P.applyMatrix4(u),w.applyMatrix4(n),f.applyMatrix4(n),h.applyMatrix4(n)}return{p1:w,p2:f,p3:h,faceNormal:P}}round(e){e.x=Math.trunc(e.x*1e3)/1e3,e.y=Math.trunc(e.y*1e3)/1e3,e.z=Math.trunc(e.z*1e3)/1e3}};c(S,"uuid","267ca032-672f-4cb0-afa9-d24e904f39d6");let L=S;const ue=document.getElementById("container"),F=new se,pe=F.get(ne),p=pe.create();p.scene=new oe(F);p.renderer=new re(F,ue);p.camera=new ie(F);F.init();p.camera.controls.setLookAt(12,6,8,0,0,-10);p.scene.setup();const he=F.get(ae);he.create(p);const ge=new de(F),me=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),we=await me.arrayBuffer(),ye=new Uint8Array(we),N=ge.load(ye);p.scene.three.add(N);const ve=F.get(ce),_=ve.create(p);for(const v of N.children)v instanceof V&&_.add(v);_.needsUpdate=!0;p.camera.controls.addEventListener("sleep",()=>{_.needsUpdate=!0});const xe=F.get(L),Ee=F.get(C),Fe=Ee.get(p),G=new Q,Me=new Z({color:16711680,depthTest:!1}),De=new ee(G,Me);p.scene.three.add(De);p.renderer&&p.renderer.three.domElement.addEventListener("mousemove",()=>{const t=Fe.castRay([N]);if(!t||!(t.object instanceof V)||t.faceIndex===void 0)return;const e=xe.getFace(t.object,t.faceIndex,t.instanceId);if(e){const s=[];for(const m of e.edges)s.push(...m.points);G.setFromPoints(s)}});const $=new te;$.showPanel(2);document.body.append($.dom);$.dom.style.left="0px";$.dom.style.right="auto";p.renderer.onBeforeUpdate.add(()=>$.begin());p.renderer.onAfterUpdate.add(()=>$.end()); diff --git a/package.json b/package.json index 63229a0b1..520468a27 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "description": "Collection of tools to author BIM apps.", - "version": "2.0.1", + "version": "2.0.3", "author": "That Open Company", "contributors": [ "Antonio Gonzalez Viegas (https://github.com/agviegas)", diff --git a/packages/core/package.json b/packages/core/package.json index 660aa6be1..4cca6c354 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@thatopen/components", "description": "Collection of core functionalities to author BIM apps.", - "version": "2.0.1", + "version": "2.0.3", "author": "That Open Company", "contributors": [ "Antonio Gonzalez Viegas (https://github.com/agviegas)", diff --git a/packages/core/src/core/Grids/src/simple-grid.ts b/packages/core/src/core/Grids/src/simple-grid.ts index 2cc6f9ea3..5cda0b055 100644 --- a/packages/core/src/core/Grids/src/simple-grid.ts +++ b/packages/core/src/core/Grids/src/simple-grid.ts @@ -195,6 +195,10 @@ export class SimpleGrid implements Hideable, Disposable { } private setupEvents(active: boolean) { + if (this.world.isDisposing) { + return; + } + if (!(this.world.camera instanceof SimpleCamera)) { return; } diff --git a/packages/core/src/core/MiniMap/example.ts b/packages/core/src/core/MiniMap/example.ts index e3197fa99..11e9831b5 100644 --- a/packages/core/src/core/MiniMap/example.ts +++ b/packages/core/src/core/MiniMap/example.ts @@ -4,7 +4,7 @@ In this tutorial you'll learn how to use the Minimap, which is a small 2D representation of the 3D world. -:::tip Do you mean a floorplans? +:::tip Do you mean a floorplan? Not quite. The minimap is a simple 2D representation of the 3D world. It is useful to help your user understand where they are, and to have a simple top view of their surrounding. @@ -165,14 +165,6 @@ const panel = BUI.Component.create(() => { map.lockRotation = target.value; }}"> - - - - (() => { @click="${() => { world.camera.fit([cube]); }}"> + + + { + const projection = world.camera.projection.current; + grid.fade = projection === "Perspective"; + }); + }}"> diff --git a/packages/core/src/core/OrthoPerspectiveCamera/index.ts b/packages/core/src/core/OrthoPerspectiveCamera/index.ts index 282ea81ad..536bc373b 100644 --- a/packages/core/src/core/OrthoPerspectiveCamera/index.ts +++ b/packages/core/src/core/OrthoPerspectiveCamera/index.ts @@ -63,15 +63,17 @@ export class OrthoPerspectiveCamera extends SimpleCamera { }, ); - this.onWorldChanged.add(() => { - this._navigationModes.clear(); - this._navigationModes.set("Orbit", new OrbitMode(this)); - this._navigationModes.set("FirstPerson", new FirstPersonMode(this)); - this._navigationModes.set("Plan", new PlanMode(this)); - this._mode = this._navigationModes.get("Orbit")!; - this.mode.set(true, { preventTargetAdjustment: true }); - if (this.currentWorld && this.currentWorld.renderer) { - this.previousSize = this.currentWorld.renderer.getSize().clone(); + this.onWorldChanged.add(({ action }) => { + if (action === "added") { + this._navigationModes.clear(); + this._navigationModes.set("Orbit", new OrbitMode(this)); + this._navigationModes.set("FirstPerson", new FirstPersonMode(this)); + this._navigationModes.set("Plan", new PlanMode(this)); + this._mode = this._navigationModes.get("Orbit")!; + this.mode.set(true, { preventTargetAdjustment: true }); + if (this.currentWorld && this.currentWorld.renderer) { + this.previousSize = this.currentWorld.renderer.getSize().clone(); + } } }); } diff --git a/packages/core/src/core/Types/src/world.ts b/packages/core/src/core/Types/src/world.ts index f9bcabc5b..b908b9120 100644 --- a/packages/core/src/core/Types/src/world.ts +++ b/packages/core/src/core/Types/src/world.ts @@ -10,4 +10,5 @@ export interface World extends Disposable, Updateable { camera: BaseCamera; renderer: BaseRenderer | null; uuid: string; + isDisposing: boolean; } diff --git a/packages/core/src/core/Worlds/src/simple-camera.ts b/packages/core/src/core/Worlds/src/simple-camera.ts index 48790cfce..900fa415e 100644 --- a/packages/core/src/core/Worlds/src/simple-camera.ts +++ b/packages/core/src/core/Worlds/src/simple-camera.ts @@ -89,7 +89,6 @@ export class SimpleCamera extends BaseCamera implements Updateable, Disposable { /** {@link Disposable.dispose} */ dispose() { this.setupEvents(false); - this.enabled = false; this.onAspectUpdated.reset(); this.onBeforeUpdate.reset(); this.onAfterUpdate.reset(); diff --git a/packages/core/src/core/Worlds/src/simple-world.ts b/packages/core/src/core/Worlds/src/simple-world.ts index f105c0ef5..c5fdf1e17 100644 --- a/packages/core/src/core/Worlds/src/simple-world.ts +++ b/packages/core/src/core/Worlds/src/simple-world.ts @@ -28,6 +28,8 @@ export class SimpleWorld< readonly onBeforeUpdate = new Event(); + isDisposing = false; + enabled = true; uuid = UUID.create(); @@ -119,6 +121,7 @@ export class SimpleWorld< dispose(disposeResources = true) { this.enabled = false; + this.isDisposing = true; this.scene.onWorldChanged.trigger({ world: this, action: "removed" }); this.camera.onWorldChanged.trigger({ world: this, action: "removed" }); diff --git a/packages/core/src/fragments/Hider/example.ts b/packages/core/src/fragments/Hider/example.ts index 67c5f5f2b..2f29f0fc3 100644 --- a/packages/core/src/fragments/Hider/example.ts +++ b/packages/core/src/fragments/Hider/example.ts @@ -18,11 +18,8 @@ In this tutorial, we will import: - `Stats.js` (optional) to measure the performance of our app. */ -// eslint-disable-next-line import/no-extraneous-dependencies import Stats from "stats.js"; -// eslint-disable-next-line import/no-extraneous-dependencies import * as BUI from "@thatopen/ui"; -// eslint-disable-next-line import/no-extraneous-dependencies import * as OBC from "@thatopen/components"; /* MD diff --git a/packages/core/src/ifc/IfcRelationsIndexer/example.ts b/packages/core/src/ifc/IfcRelationsIndexer/example.ts index f0e7227b9..638968c5f 100644 --- a/packages/core/src/ifc/IfcRelationsIndexer/example.ts +++ b/packages/core/src/ifc/IfcRelationsIndexer/example.ts @@ -140,7 +140,7 @@ indexer.setRelationMap(model, relationsIndex); /* MD Great! Now try to get again the property sets and you will see everything working nice and neat. In fact, lets try to get the building storey of one element in the IFC 👇 - */ +*/ const buildingStorey = indexer.getEntityRelations( model, diff --git a/packages/front/package.json b/packages/front/package.json index f84c45d04..e11c8ef89 100644 --- a/packages/front/package.json +++ b/packages/front/package.json @@ -1,7 +1,7 @@ { "name": "@thatopen/components-front", "description": "Collection of frontend tools to author BIM apps.", - "version": "2.0.2", + "version": "2.0.3", "author": "That Open Company", "contributors": [ "Antonio Gonzalez Viegas (https://github.com/agviegas)", @@ -47,7 +47,7 @@ "web-ifc": "0.0.53" }, "dependencies": { - "@thatopen/components": "2.0.1", + "@thatopen/components": "2.0.3", "camera-controls": "2.7.3", "dexie": "^4.0.4", "earcut": "^2.2.4",