From 2bb48b037cd94c612f27784313f71a0d9a5828aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Gonz=C3=A1lez=20Viegas?= Date: Fri, 19 Jul 2024 13:18:35 +0200 Subject: [PATCH] chore: build examples --- .gitignore | 1 + examples/AngleMeasurement/index.html | 4 ++-- examples/AreaMeasurement/index.html | 4 ++-- examples/BoundingBoxer/index.html | 2 +- examples/Civil3DNavigator/index.html | 4 ++-- examples/CivilCrossSectionNavigator/index.html | 6 +++--- examples/CivilElevationNavigator/index.html | 6 +++--- examples/CivilPlanNavigator/index.html | 6 +++--- examples/Classifier/index.html | 2 +- examples/ClipEdges/index.html | 4 ++-- examples/Clipper/index.html | 2 +- examples/Cullers/index.html | 2 +- examples/EdgeMeasurement/index.html | 4 ++-- examples/Exploder/index.html | 2 +- examples/FaceMeasurement/index.html | 4 ++-- examples/FragmentsManager/index.html | 2 +- examples/Grids/index.html | 2 +- examples/Hider/index.html | 2 +- examples/Highlighter/index.html | 4 ++-- examples/IfcGeometryTiler/index.html | 2 +- examples/IfcJsonExporter/index.html | 2 +- examples/IfcLoader/index.html | 2 +- examples/IfcPropertiesTiler/index.html | 2 +- examples/IfcRelationsIndexer/index.html | 2 +- examples/IfcStreamer/index.html | 4 ++-- examples/LengthMeasurement/index.html | 4 ++-- examples/Marker/index.html | 4 ++-- examples/MeasurementUtils/index.html | 2 +- examples/MiniMap/index.html | 2 +- examples/OrthoPerspectiveCamera/index.html | 2 +- examples/Plans/index.html | 4 ++-- examples/PostproductionRenderer/index.html | 4 ++-- examples/Raycasters/index.html | 2 +- examples/ShadowDropper/index.html | 4 ++-- examples/VolumeMeasurement/index.html | 4 ++-- examples/Worlds/index.html | 2 +- examples/assets/angleMeasurement.js | 2 +- examples/assets/areaMeasurement.js | 2 +- examples/assets/boundingBoxer.js | 2 +- examples/assets/civil3DNavigator.js | 2 +- examples/assets/civilCrossSectionNavigator.js | 2 +- examples/assets/civilElevationNavigator.js | 2 +- examples/assets/civilPlanNavigator.js | 2 +- examples/assets/classifier.js | 2 +- examples/assets/clipEdges.js | 2 +- examples/assets/clipper.js | 2 +- examples/assets/cullers.js | 2 +- examples/assets/edgeMeasurement.js | 2 +- examples/assets/exploder.js | 2 +- examples/assets/faceMeasurement.js | 2 +- examples/assets/fragmentsManager.js | 2 +- examples/assets/grids.js | 2 +- examples/assets/hider.js | 16 ++++++++-------- examples/assets/highlighter.js | 2 +- examples/assets/ifcGeometryTiler.js | 2 +- examples/assets/ifcJsonExporter.js | 2 +- examples/assets/ifcLoader.js | 2 +- examples/assets/ifcPropertiesManager.js | 2 +- examples/assets/ifcPropertiesTiler.js | 2 +- examples/assets/ifcRelationsIndexer.js | 2 +- examples/assets/ifcStreamer.js | 2 +- .../{index-Bpjba_Wq.js => index-BREiuDZQ.js} | 6 +++--- .../{index-BiTRO_4n.js => index-CrYKit3B.js} | 2 +- .../{index-D2xchnNe.js => index-CrrO1BJs.js} | 10 +++++----- examples/assets/lengthMeasurement.js | 2 +- examples/assets/marker.js | 2 +- examples/assets/measurementUtils.js | 2 +- examples/assets/miniMap.js | 2 +- examples/assets/orthoPerspectiveCamera.js | 2 +- examples/assets/plans.js | 10 +++++----- examples/assets/postproductionRenderer.js | 2 +- examples/assets/raycasters.js | 2 +- examples/assets/shadowDropper.js | 2 +- examples/assets/volumeMeasurement.js | 2 +- examples/assets/worlds.js | 2 +- 75 files changed, 112 insertions(+), 111 deletions(-) rename examples/assets/{index-Bpjba_Wq.js => index-BREiuDZQ.js} (84%) rename examples/assets/{index-BiTRO_4n.js => index-CrYKit3B.js} (99%) rename examples/assets/{index-D2xchnNe.js => index-CrrO1BJs.js} (62%) diff --git a/.gitignore b/.gitignore index 2cf9dd20d..ee7af0fea 100644 --- a/.gitignore +++ b/.gitignore @@ -138,3 +138,4 @@ resources/bbbb.* resources/asdf2.frag resources/asdf2.json +resources/umdasch/ diff --git a/examples/AngleMeasurement/index.html b/examples/AngleMeasurement/index.html index 8fd3d8a4c..99b2fac74 100644 --- a/examples/AngleMeasurement/index.html +++ b/examples/AngleMeasurement/index.html @@ -59,8 +59,8 @@ - - + + diff --git a/examples/AreaMeasurement/index.html b/examples/AreaMeasurement/index.html index d5bc9c5e2..57b888512 100644 --- a/examples/AreaMeasurement/index.html +++ b/examples/AreaMeasurement/index.html @@ -60,8 +60,8 @@ - - + + diff --git a/examples/BoundingBoxer/index.html b/examples/BoundingBoxer/index.html index e6b6b0587..23fe39e7b 100644 --- a/examples/BoundingBoxer/index.html +++ b/examples/BoundingBoxer/index.html @@ -61,7 +61,7 @@ - + diff --git a/examples/Civil3DNavigator/index.html b/examples/Civil3DNavigator/index.html index f7ee9b08d..35f1f0d64 100644 --- a/examples/Civil3DNavigator/index.html +++ b/examples/Civil3DNavigator/index.html @@ -59,9 +59,9 @@ - + - + diff --git a/examples/CivilCrossSectionNavigator/index.html b/examples/CivilCrossSectionNavigator/index.html index a9e9025d8..dd2877395 100644 --- a/examples/CivilCrossSectionNavigator/index.html +++ b/examples/CivilCrossSectionNavigator/index.html @@ -77,10 +77,10 @@ - + - - + + diff --git a/examples/CivilElevationNavigator/index.html b/examples/CivilElevationNavigator/index.html index b4416668e..dd15045d4 100644 --- a/examples/CivilElevationNavigator/index.html +++ b/examples/CivilElevationNavigator/index.html @@ -78,10 +78,10 @@ - - + + - + diff --git a/examples/CivilPlanNavigator/index.html b/examples/CivilPlanNavigator/index.html index 67c9fd9c8..539944570 100644 --- a/examples/CivilPlanNavigator/index.html +++ b/examples/CivilPlanNavigator/index.html @@ -67,10 +67,10 @@ - - + + - + diff --git a/examples/Classifier/index.html b/examples/Classifier/index.html index 0ab13e794..7b558a542 100644 --- a/examples/Classifier/index.html +++ b/examples/Classifier/index.html @@ -61,7 +61,7 @@ - + diff --git a/examples/ClipEdges/index.html b/examples/ClipEdges/index.html index 88053e9b5..4427e55a2 100644 --- a/examples/ClipEdges/index.html +++ b/examples/ClipEdges/index.html @@ -61,8 +61,8 @@ - - + + diff --git a/examples/Clipper/index.html b/examples/Clipper/index.html index 68355d4f2..34b916539 100644 --- a/examples/Clipper/index.html +++ b/examples/Clipper/index.html @@ -61,7 +61,7 @@ - + diff --git a/examples/Cullers/index.html b/examples/Cullers/index.html index d69dbdedd..3c409dfdc 100644 --- a/examples/Cullers/index.html +++ b/examples/Cullers/index.html @@ -60,7 +60,7 @@ - + diff --git a/examples/EdgeMeasurement/index.html b/examples/EdgeMeasurement/index.html index 7a1bf471c..51572a9c4 100644 --- a/examples/EdgeMeasurement/index.html +++ b/examples/EdgeMeasurement/index.html @@ -60,8 +60,8 @@ - - + + diff --git a/examples/Exploder/index.html b/examples/Exploder/index.html index 4fa9810b6..b7e386f7a 100644 --- a/examples/Exploder/index.html +++ b/examples/Exploder/index.html @@ -61,7 +61,7 @@ - + diff --git a/examples/FaceMeasurement/index.html b/examples/FaceMeasurement/index.html index 997dda85e..faf3ebf95 100644 --- a/examples/FaceMeasurement/index.html +++ b/examples/FaceMeasurement/index.html @@ -60,8 +60,8 @@ - - + + diff --git a/examples/FragmentsManager/index.html b/examples/FragmentsManager/index.html index d0ee41f27..c13792b10 100644 --- a/examples/FragmentsManager/index.html +++ b/examples/FragmentsManager/index.html @@ -60,7 +60,7 @@ - + diff --git a/examples/Grids/index.html b/examples/Grids/index.html index bca48600a..2e327ad62 100644 --- a/examples/Grids/index.html +++ b/examples/Grids/index.html @@ -65,7 +65,7 @@ - + diff --git a/examples/Hider/index.html b/examples/Hider/index.html index 3524dd732..56dce43cc 100644 --- a/examples/Hider/index.html +++ b/examples/Hider/index.html @@ -61,7 +61,7 @@ - + diff --git a/examples/Highlighter/index.html b/examples/Highlighter/index.html index e0757c663..854fe992f 100644 --- a/examples/Highlighter/index.html +++ b/examples/Highlighter/index.html @@ -59,8 +59,8 @@ - - + + diff --git a/examples/IfcGeometryTiler/index.html b/examples/IfcGeometryTiler/index.html index ed768ee84..dba8b905d 100644 --- a/examples/IfcGeometryTiler/index.html +++ b/examples/IfcGeometryTiler/index.html @@ -61,7 +61,7 @@ - + diff --git a/examples/IfcJsonExporter/index.html b/examples/IfcJsonExporter/index.html index c870c6359..ff1ed11f4 100644 --- a/examples/IfcJsonExporter/index.html +++ b/examples/IfcJsonExporter/index.html @@ -61,7 +61,7 @@ - + diff --git a/examples/IfcLoader/index.html b/examples/IfcLoader/index.html index 93d44cdcb..6f9136c71 100644 --- a/examples/IfcLoader/index.html +++ b/examples/IfcLoader/index.html @@ -61,7 +61,7 @@ - + diff --git a/examples/IfcPropertiesTiler/index.html b/examples/IfcPropertiesTiler/index.html index 3999a326b..5a83dc156 100644 --- a/examples/IfcPropertiesTiler/index.html +++ b/examples/IfcPropertiesTiler/index.html @@ -61,7 +61,7 @@ - + diff --git a/examples/IfcRelationsIndexer/index.html b/examples/IfcRelationsIndexer/index.html index d5dc87f18..dca1f77fc 100644 --- a/examples/IfcRelationsIndexer/index.html +++ b/examples/IfcRelationsIndexer/index.html @@ -61,7 +61,7 @@ - + diff --git a/examples/IfcStreamer/index.html b/examples/IfcStreamer/index.html index bebf3ee19..8050046b5 100644 --- a/examples/IfcStreamer/index.html +++ b/examples/IfcStreamer/index.html @@ -60,8 +60,8 @@ - - + + diff --git a/examples/LengthMeasurement/index.html b/examples/LengthMeasurement/index.html index 61155894d..f9846c74c 100644 --- a/examples/LengthMeasurement/index.html +++ b/examples/LengthMeasurement/index.html @@ -60,9 +60,9 @@ - + - + diff --git a/examples/Marker/index.html b/examples/Marker/index.html index be90b8fd3..2a43fc950 100644 --- a/examples/Marker/index.html +++ b/examples/Marker/index.html @@ -59,8 +59,8 @@ - - + + diff --git a/examples/MeasurementUtils/index.html b/examples/MeasurementUtils/index.html index 067b8cae5..568ed1000 100644 --- a/examples/MeasurementUtils/index.html +++ b/examples/MeasurementUtils/index.html @@ -60,7 +60,7 @@ - + diff --git a/examples/MiniMap/index.html b/examples/MiniMap/index.html index 1785cec70..7bfe93b8a 100644 --- a/examples/MiniMap/index.html +++ b/examples/MiniMap/index.html @@ -67,7 +67,7 @@ - + diff --git a/examples/OrthoPerspectiveCamera/index.html b/examples/OrthoPerspectiveCamera/index.html index 2def0a91d..01502390a 100644 --- a/examples/OrthoPerspectiveCamera/index.html +++ b/examples/OrthoPerspectiveCamera/index.html @@ -61,7 +61,7 @@ - + diff --git a/examples/Plans/index.html b/examples/Plans/index.html index 83bc45ee5..b70311083 100644 --- a/examples/Plans/index.html +++ b/examples/Plans/index.html @@ -59,8 +59,8 @@ - - + + diff --git a/examples/PostproductionRenderer/index.html b/examples/PostproductionRenderer/index.html index f3918ff10..759adb8dc 100644 --- a/examples/PostproductionRenderer/index.html +++ b/examples/PostproductionRenderer/index.html @@ -61,8 +61,8 @@ - - + + diff --git a/examples/Raycasters/index.html b/examples/Raycasters/index.html index 9b8a0be8b..0f42302d0 100644 --- a/examples/Raycasters/index.html +++ b/examples/Raycasters/index.html @@ -60,7 +60,7 @@ - + diff --git a/examples/ShadowDropper/index.html b/examples/ShadowDropper/index.html index dedd1c685..88df9425e 100644 --- a/examples/ShadowDropper/index.html +++ b/examples/ShadowDropper/index.html @@ -59,10 +59,10 @@ - + - + diff --git a/examples/VolumeMeasurement/index.html b/examples/VolumeMeasurement/index.html index 5d3333813..52261b331 100644 --- a/examples/VolumeMeasurement/index.html +++ b/examples/VolumeMeasurement/index.html @@ -60,8 +60,8 @@ - - + + diff --git a/examples/Worlds/index.html b/examples/Worlds/index.html index 73a46dc0f..448ebbf46 100644 --- a/examples/Worlds/index.html +++ b/examples/Worlds/index.html @@ -60,7 +60,7 @@ - + diff --git a/examples/assets/angleMeasurement.js b/examples/assets/angleMeasurement.js index 8390cf440..f5319097d 100644 --- a/examples/assets/angleMeasurement.js +++ b/examples/assets/angleMeasurement.js @@ -1 +1 @@ -import{B as d,M as c,a as l}from"./web-ifc-api-CfQNUy7g.js";import{p as i,C as m,i as p,W as w,d as u}from"./index-D2xchnNe.js";import{S as y,y as b}from"./index-Bpjba_Wq.js";import{S as f}from"./stats.min-BpIepu9J.js";const r=document.getElementById("container"),n=new i,g=n.get(m),e=g.create();e.scene=new p(n);e.renderer=new y(n,r);e.camera=new w(n);n.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const h=n.get(u);h.create(e);e.scene.three.background=null;const k=new d(3,3,3),B=new c({color:"#6528D7"}),s=new l(k,B);s.position.set(0,1.5,0);e.scene.three.add(s);e.meshes.add(s);const o=n.get(b);o.world=e;o.enabled=!0;r.ondblclick=()=>o.create();window.onkeydown=a=>{(a.code==="Delete"||a.code==="Backspace")&&o.deleteAll()};const t=new f;t.showPanel(2);document.body.append(t.dom);t.dom.style.left="0px";t.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>t.begin());e.renderer.onAfterUpdate.add(()=>t.end()); +import{B as d,M as c,a as l}from"./web-ifc-api-CfQNUy7g.js";import{p as i,C as m,i as p,W as w,d as u}from"./index-CrrO1BJs.js";import{S as y,y as b}from"./index-BREiuDZQ.js";import{S as f}from"./stats.min-BpIepu9J.js";const r=document.getElementById("container"),n=new i,g=n.get(m),e=g.create();e.scene=new p(n);e.renderer=new y(n,r);e.camera=new w(n);n.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const h=n.get(u);h.create(e);e.scene.three.background=null;const k=new d(3,3,3),B=new c({color:"#6528D7"}),s=new l(k,B);s.position.set(0,1.5,0);e.scene.three.add(s);e.meshes.add(s);const o=n.get(b);o.world=e;o.enabled=!0;r.ondblclick=()=>o.create();window.onkeydown=a=>{(a.code==="Delete"||a.code==="Backspace")&&o.deleteAll()};const t=new f;t.showPanel(2);document.body.append(t.dom);t.dom.style.left="0px";t.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>t.begin());e.renderer.onAfterUpdate.add(()=>t.end()); diff --git a/examples/assets/areaMeasurement.js b/examples/assets/areaMeasurement.js index 611cccbd0..96303413f 100644 --- a/examples/assets/areaMeasurement.js +++ b/examples/assets/areaMeasurement.js @@ -1 +1 @@ -import{B as d,M as c,a as i}from"./web-ifc-api-CfQNUy7g.js";import{S as m}from"./stats.min-BpIepu9J.js";import{p as l,C as p,i as w,W as u,d as b}from"./index-D2xchnNe.js";import{S as f,I as g}from"./index-Bpjba_Wq.js";const a=document.getElementById("container"),n=new l,y=n.get(p),e=y.create();e.scene=new w(n);e.renderer=new f(n,a);e.camera=new u(n);n.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const h=n.get(b);h.create(e);e.scene.three.background=null;const k=new d(3,3,3),B=new c({color:"#6528D7"}),s=new i(k,B);s.position.set(0,1.5,0);e.scene.three.add(s);e.meshes.add(s);const o=n.get(g);o.world=e;o.enabled=!0;a.ondblclick=()=>o.create();a.oncontextmenu=()=>o.endCreation();window.onkeydown=r=>{(r.code==="Delete"||r.code==="Backspace")&&o.deleteAll()};const t=new m;t.showPanel(2);document.body.append(t.dom);t.dom.style.left="0px";t.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>t.begin());e.renderer.onAfterUpdate.add(()=>t.end()); +import{B as d,M as c,a as i}from"./web-ifc-api-CfQNUy7g.js";import{S as m}from"./stats.min-BpIepu9J.js";import{p as l,C as p,i as w,W as u,d as b}from"./index-CrrO1BJs.js";import{S as f,I as g}from"./index-BREiuDZQ.js";const a=document.getElementById("container"),n=new l,y=n.get(p),e=y.create();e.scene=new w(n);e.renderer=new f(n,a);e.camera=new u(n);n.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const h=n.get(b);h.create(e);e.scene.three.background=null;const k=new d(3,3,3),B=new c({color:"#6528D7"}),s=new i(k,B);s.position.set(0,1.5,0);e.scene.three.add(s);e.meshes.add(s);const o=n.get(g);o.world=e;o.enabled=!0;a.ondblclick=()=>o.create();a.oncontextmenu=()=>o.endCreation();window.onkeydown=r=>{(r.code==="Delete"||r.code==="Backspace")&&o.deleteAll()};const t=new m;t.showPanel(2);document.body.append(t.dom);t.dom.style.left="0px";t.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>t.begin());e.renderer.onAfterUpdate.add(()=>t.end()); diff --git a/examples/assets/boundingBoxer.js b/examples/assets/boundingBoxer.js index bd0d68a33..927317d2b 100644 --- a/examples/assets/boundingBoxer.js +++ b/examples/assets/boundingBoxer.js @@ -1,4 +1,4 @@ -import"./web-ifc-api-CfQNUy7g.js";import{S as c}from"./stats.min-BpIepu9J.js";import{m as l,t as a,a as i}from"./index-tywNknxv.js";import{p as d,C as m,i as p,n as b,W as u,d as g,h as f,F as h}from"./index-D2xchnNe.js";const w=document.getElementById("container"),t=new d,y=t.get(m),e=y.create();e.scene=new p(t);e.renderer=new b(t,w);e.camera=new u(t);t.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const B=t.get(g);B.create(e);e.scene.three.background=null;const v=t.get(f),x=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),k=await x.arrayBuffer(),L=new Uint8Array(k),r=v.load(L);e.scene.three.add(r);const s=t.get(h);s.add(r);const A=s.getMesh();s.reset();const n=new c;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());l.init();const o=a.create(()=>i` +import"./web-ifc-api-CfQNUy7g.js";import{S as c}from"./stats.min-BpIepu9J.js";import{m as l,t as a,a as i}from"./index-tywNknxv.js";import{p as d,C as m,i as p,n as b,W as u,d as g,h as f,F as h}from"./index-CrrO1BJs.js";const w=document.getElementById("container"),t=new d,y=t.get(m),e=y.create();e.scene=new p(t);e.renderer=new b(t,w);e.camera=new u(t);t.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const B=t.get(g);B.create(e);e.scene.three.background=null;const v=t.get(f),x=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),k=await x.arrayBuffer(),L=new Uint8Array(k),r=v.load(L);e.scene.three.add(r);const s=t.get(h);s.add(r);const A=s.getMesh();s.reset();const n=new c;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());l.init();const o=a.create(()=>i` diff --git a/examples/assets/civil3DNavigator.js b/examples/assets/civil3DNavigator.js index 4764328f8..148ca5f92 100644 --- a/examples/assets/civil3DNavigator.js +++ b/examples/assets/civil3DNavigator.js @@ -1 +1 @@ -import{q as i,S as p}from"./web-ifc-api-CfQNUy7g.js";import{p as l,C as h,i as m,W as f,d as g,h as u,T as w}from"./index-D2xchnNe.js";import{S as y}from"./stats.min-BpIepu9J.js";import{B as b,E as B}from"./index-Bpjba_Wq.js";const d=document.getElementById("container"),t=new l,E=t.get(h),e=E.create();e.scene=new m(t);e.renderer=new b(t,d);e.camera=new f(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(g);S.create(e);e.scene.three.background=null;const U=t.get(u),v=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),A=await v.arrayBuffer(),C=new Uint8Array(A),r=await U.load(C);e.scene.three.add(r);const I=await fetch("https://thatopen.github.io/engine_components/resources/road.json");r.setLocalProperties(await I.json());const a=t.get(B);a.world=e;a.draw(r);const L=t.get(w),s=L.create(e);s.threshold=10;for(const o of r.children)o instanceof i&&s.add(o);s.needsUpdate=!0;e.camera.controls.addEventListener("sleep",()=>{s.needsUpdate=!0});const c=new p(void 0,20);a.onHighlight.add(({point:o})=>{c.center.copy(o),e.camera.controls.fitToSphere(c,!0)});const n=new y;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()); +import{q as i,S as p}from"./web-ifc-api-CfQNUy7g.js";import{p as l,C as h,i as m,W as f,d as g,h as u,T as w}from"./index-CrrO1BJs.js";import{S as y}from"./stats.min-BpIepu9J.js";import{B as b,E as B}from"./index-BREiuDZQ.js";const d=document.getElementById("container"),t=new l,E=t.get(h),e=E.create();e.scene=new m(t);e.renderer=new b(t,d);e.camera=new f(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(g);S.create(e);e.scene.three.background=null;const U=t.get(u),v=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),A=await v.arrayBuffer(),C=new Uint8Array(A),r=await U.load(C);e.scene.three.add(r);const I=await fetch("https://thatopen.github.io/engine_components/resources/road.json");r.setLocalProperties(await I.json());const a=t.get(B);a.world=e;a.draw(r);const L=t.get(w),s=L.create(e);s.threshold=10;for(const o of r.children)o instanceof i&&s.add(o);s.needsUpdate=!0;e.camera.controls.addEventListener("sleep",()=>{s.needsUpdate=!0});const c=new p(void 0,20);a.onHighlight.add(({point:o})=>{c.center.copy(o),e.camera.controls.fitToSphere(c,!0)});const n=new y;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()); diff --git a/examples/assets/civilCrossSectionNavigator.js b/examples/assets/civilCrossSectionNavigator.js index defc99475..da63965b4 100644 --- a/examples/assets/civilCrossSectionNavigator.js +++ b/examples/assets/civilCrossSectionNavigator.js @@ -1 +1 @@ -import{C as B,L as E}from"./web-ifc-api-CfQNUy7g.js";import{p as M,C as v,i as S,o as k,d as A,h as C,A as D}from"./index-D2xchnNe.js";import{m as x}from"./index-tywNknxv.js";import{r as I}from"./index-BiTRO_4n.js";import{S as L}from"./stats.min-BpIepu9J.js";import{B as P,b as U,E as j,v as H,m as N}from"./index-Bpjba_Wq.js";x.init();I.init();const y=document.getElementById("container"),e=new M,W=e.get(v),t=W.create();t.scene=new S(e);t.renderer=new P(e,y);t.camera=new k(e);e.init();t.scene.setup();t.camera.controls.setLookAt(5,5,5,0,0,0);y.appendChild(t.renderer.three2D.domElement);const _=e.get(A);_.create(t);t.scene.three.background=null;const b=e.get(C),z=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),F=await z.arrayBuffer(),R=new Uint8Array(F),d=b.load(R);t.scene.three.add(d);const T=await fetch("https://thatopen.github.io/engine_components/resources/road.json");d.setLocalProperties(await T.json());const f=document.getElementById("scene-2d-left");f.components=e;if(!f.world)throw new Error("World not found!");const c=e.get(U);c.world=f.world;await c.draw(d);const l=e.get(j);l.world=t;l.draw(d);const g=document.getElementById("scene-2d-right");g.components=e;if(!g.world)throw new Error("World not found!");const h=e.get(H);h.world=g.world;h.world3D=t;c.onMarkerChange.add(({alignment:o,percentage:n,type:r,curve:s})=>{if(l.setMarker(o,n,r),r==="select"){const i=s.alignment.absolute[s.index].mesh,m=o.getPointAt(n,"absolute");h.set(i,m)}});c.onHighlight.add(({mesh:o})=>{l.highlighter.select(o);const n=o.curve.index,r=o.curve.alignment.absolute[n];r.mesh.geometry.computeBoundingSphere();const s=r.mesh.geometry.boundingSphere;s&&t.camera.controls.fitToSphere(s,!0)});c.onMarkerHidden.add(({type:o})=>{l.hideMarker(o)});const p=e.get(D);p.byEntity(d);const q=p.list,w=e.get(N),u=w.styles.list;for(const o in q.entities){const n=p.find({entities:[o]}),r=new B(Math.random(),Math.random(),Math.random()),s=new E({color:r});w.styles.create(o,new Set,g.world,s);for(const i in n){const m=b.list.get(i);m&&(u[o].fragments[i]=new Set(n[i]),u[o].meshes.add(m.mesh))}}w.update(!0);const a=new L;a.showPanel(2);document.body.append(a.dom);a.dom.style.left="0px";a.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>a.begin());t.renderer.onAfterUpdate.add(()=>a.end()); +import{C as B,L as E}from"./web-ifc-api-CfQNUy7g.js";import{p as M,C as v,i as S,o as k,d as A,h as C,A as D}from"./index-CrrO1BJs.js";import{m as x}from"./index-tywNknxv.js";import{r as I}from"./index-CrYKit3B.js";import{S as L}from"./stats.min-BpIepu9J.js";import{B as P,b as U,E as j,v as H,m as N}from"./index-BREiuDZQ.js";x.init();I.init();const y=document.getElementById("container"),e=new M,W=e.get(v),t=W.create();t.scene=new S(e);t.renderer=new P(e,y);t.camera=new k(e);e.init();t.scene.setup();t.camera.controls.setLookAt(5,5,5,0,0,0);y.appendChild(t.renderer.three2D.domElement);const _=e.get(A);_.create(t);t.scene.three.background=null;const b=e.get(C),z=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),F=await z.arrayBuffer(),R=new Uint8Array(F),d=b.load(R);t.scene.three.add(d);const T=await fetch("https://thatopen.github.io/engine_components/resources/road.json");d.setLocalProperties(await T.json());const f=document.getElementById("scene-2d-left");f.components=e;if(!f.world)throw new Error("World not found!");const c=e.get(U);c.world=f.world;await c.draw(d);const l=e.get(j);l.world=t;l.draw(d);const g=document.getElementById("scene-2d-right");g.components=e;if(!g.world)throw new Error("World not found!");const h=e.get(H);h.world=g.world;h.world3D=t;c.onMarkerChange.add(({alignment:o,percentage:n,type:r,curve:s})=>{if(l.setMarker(o,n,r),r==="select"){const i=s.alignment.absolute[s.index].mesh,m=o.getPointAt(n,"absolute");h.set(i,m)}});c.onHighlight.add(({mesh:o})=>{l.highlighter.select(o);const n=o.curve.index,r=o.curve.alignment.absolute[n];r.mesh.geometry.computeBoundingSphere();const s=r.mesh.geometry.boundingSphere;s&&t.camera.controls.fitToSphere(s,!0)});c.onMarkerHidden.add(({type:o})=>{l.hideMarker(o)});const p=e.get(D);p.byEntity(d);const q=p.list,w=e.get(N),u=w.styles.list;for(const o in q.entities){const n=p.find({entities:[o]}),r=new B(Math.random(),Math.random(),Math.random()),s=new E({color:r});w.styles.create(o,new Set,g.world,s);for(const i in n){const m=b.list.get(i);m&&(u[o].fragments[i]=new Set(n[i]),u[o].meshes.add(m.mesh))}}w.update(!0);const a=new L;a.showPanel(2);document.body.append(a.dom);a.dom.style.left="0px";a.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>a.begin());t.renderer.onAfterUpdate.add(()=>a.end()); diff --git a/examples/assets/civilElevationNavigator.js b/examples/assets/civilElevationNavigator.js index df4d3f491..4a6706c28 100644 --- a/examples/assets/civilElevationNavigator.js +++ b/examples/assets/civilElevationNavigator.js @@ -1 +1 @@ -import"./web-ifc-api-CfQNUy7g.js";import{p as y,C as b,i as S,o as B,d as E,h as k}from"./index-D2xchnNe.js";import{B as A,E as C,b as I,g as M}from"./index-Bpjba_Wq.js";import{m as x}from"./index-tywNknxv.js";import{r as D}from"./index-BiTRO_4n.js";import{S as U}from"./stats.min-BpIepu9J.js";x.init();D.init();const f=document.getElementById("container"),t=new y,z=t.get(b),e=z.create();e.scene=new S(t);e.renderer=new A(t,f);e.camera=new B(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);f.appendChild(e.renderer.three2D.domElement);const L=t.get(E);L.create(e);e.scene.three.background=null;const N=t.get(k),P=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),T=await P.arrayBuffer(),W=new Uint8Array(T),c=N.load(W);e.scene.three.add(c);const i=t.get(C);i.world=e;i.draw(c);const g=document.getElementById("scene-2d-left");g.components=t;if(!g.world)throw new Error("World not found!");const l=new I(t);l.world=g.world;l.draw(c);const a=document.getElementById("scene-2d-right");a.components=t;if(!a.world)throw new Error("World not found!");const s=t.get(M);s.world=a.world;s.draw(c);l.onMarkerChange.add(({alignment:r,percentage:d})=>{s.setMarker(r,d,"hover"),i.setMarker(r,d,"hover")});l.onHighlight.add(({mesh:r,point:d})=>{const{index:v,alignment:h}=r.curve,m=h.getPercentageAt(d,"horizontal");if(m===null)return;const{curve:n}=h.getCurveAt(m,"vertical");if(s.highlighter.select(n.mesh),s.setMarker(n.alignment,m,"select"),a.world){n.mesh.geometry.boundingSphere||n.mesh.geometry.computeBoundingSphere();const w=n.mesh.geometry.boundingSphere.clone();w.radius*=1.5,a.world.camera.controls.fitToSphere(w,!0)}i.highlighter.select(r);const p=r.curve.alignment.absolute[v];p.mesh.geometry.computeBoundingSphere();const u=p.mesh.geometry.boundingSphere;u&&e.camera.controls.fitToSphere(u,!0)});const o=new U;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end()); +import"./web-ifc-api-CfQNUy7g.js";import{p as y,C as b,i as S,o as B,d as E,h as k}from"./index-CrrO1BJs.js";import{B as A,E as C,b as I,g as M}from"./index-BREiuDZQ.js";import{m as x}from"./index-tywNknxv.js";import{r as D}from"./index-CrYKit3B.js";import{S as U}from"./stats.min-BpIepu9J.js";x.init();D.init();const f=document.getElementById("container"),t=new y,z=t.get(b),e=z.create();e.scene=new S(t);e.renderer=new A(t,f);e.camera=new B(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);f.appendChild(e.renderer.three2D.domElement);const L=t.get(E);L.create(e);e.scene.three.background=null;const N=t.get(k),P=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),T=await P.arrayBuffer(),W=new Uint8Array(T),c=N.load(W);e.scene.three.add(c);const i=t.get(C);i.world=e;i.draw(c);const g=document.getElementById("scene-2d-left");g.components=t;if(!g.world)throw new Error("World not found!");const l=new I(t);l.world=g.world;l.draw(c);const a=document.getElementById("scene-2d-right");a.components=t;if(!a.world)throw new Error("World not found!");const s=t.get(M);s.world=a.world;s.draw(c);l.onMarkerChange.add(({alignment:r,percentage:d})=>{s.setMarker(r,d,"hover"),i.setMarker(r,d,"hover")});l.onHighlight.add(({mesh:r,point:d})=>{const{index:v,alignment:h}=r.curve,m=h.getPercentageAt(d,"horizontal");if(m===null)return;const{curve:n}=h.getCurveAt(m,"vertical");if(s.highlighter.select(n.mesh),s.setMarker(n.alignment,m,"select"),a.world){n.mesh.geometry.boundingSphere||n.mesh.geometry.computeBoundingSphere();const w=n.mesh.geometry.boundingSphere.clone();w.radius*=1.5,a.world.camera.controls.fitToSphere(w,!0)}i.highlighter.select(r);const p=r.curve.alignment.absolute[v];p.mesh.geometry.computeBoundingSphere();const u=p.mesh.geometry.boundingSphere;u&&e.camera.controls.fitToSphere(u,!0)});const o=new U;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end()); diff --git a/examples/assets/civilPlanNavigator.js b/examples/assets/civilPlanNavigator.js index f8ba76c21..9b1356d51 100644 --- a/examples/assets/civilPlanNavigator.js +++ b/examples/assets/civilPlanNavigator.js @@ -1 +1 @@ -import"./web-ifc-api-CfQNUy7g.js";import{p,C as g,i as h,o as f,d as u,h as w}from"./index-D2xchnNe.js";import{B as y,E as b,b as B}from"./index-Bpjba_Wq.js";import{m as v}from"./index-tywNknxv.js";import{r as E}from"./index-BiTRO_4n.js";import{S}from"./stats.min-BpIepu9J.js";v.init();E.init();const i=document.getElementById("container"),t=new p,x=t.get(g),e=x.create();e.scene=new h(t);e.renderer=new y(t,i);e.camera=new f(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);i.appendChild(e.renderer.three2D.domElement);const A=t.get(u);A.create(e);e.scene.three.background=null;const C=t.get(w),I=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),U=await I.arrayBuffer(),k=new Uint8Array(U),r=C.load(k);e.scene.three.add(r);const a=t.get(b);a.world=e;a.draw(r);const m=document.getElementById("scene-2d"),s=t.get(B);m.components=t;s.world=m.world;await s.draw(r);s.onHighlight.add(({mesh:o})=>{a.highlighter.select(o);const l=o.curve.index,d=o.curve.alignment.absolute[l];d.mesh.geometry.computeBoundingSphere();const c=d.mesh.geometry.boundingSphere;c&&e.camera.controls.fitToSphere(c,!0)});const n=new S;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()); +import"./web-ifc-api-CfQNUy7g.js";import{p,C as g,i as h,o as f,d as u,h as w}from"./index-CrrO1BJs.js";import{B as y,E as b,b as B}from"./index-BREiuDZQ.js";import{m as v}from"./index-tywNknxv.js";import{r as E}from"./index-CrYKit3B.js";import{S}from"./stats.min-BpIepu9J.js";v.init();E.init();const i=document.getElementById("container"),t=new p,x=t.get(g),e=x.create();e.scene=new h(t);e.renderer=new y(t,i);e.camera=new f(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);i.appendChild(e.renderer.three2D.domElement);const A=t.get(u);A.create(e);e.scene.three.background=null;const C=t.get(w),I=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),U=await I.arrayBuffer(),k=new Uint8Array(U),r=C.load(k);e.scene.three.add(r);const a=t.get(b);a.world=e;a.draw(r);const m=document.getElementById("scene-2d"),s=t.get(B);m.components=t;s.world=m.world;await s.draw(r);s.onHighlight.add(({mesh:o})=>{a.highlighter.select(o);const l=o.curve.index,d=o.curve.alignment.absolute[l];d.mesh.geometry.computeBoundingSphere();const c=d.mesh.geometry.boundingSphere;c&&e.camera.controls.fitToSphere(c,!0)});const n=new S;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()); diff --git a/examples/assets/classifier.js b/examples/assets/classifier.js index 0e34ec615..3e3b13427 100644 --- a/examples/assets/classifier.js +++ b/examples/assets/classifier.js @@ -1,4 +1,4 @@ -import{a2 as d,C as m}from"./web-ifc-api-CfQNUy7g.js";import{S as u}from"./stats.min-BpIepu9J.js";import{m as b,t as a,a as c}from"./index-tywNknxv.js";import{p,C,i as f,n as w,W as I,d as g,h as A,A as y}from"./index-D2xchnNe.js";const E=document.getElementById("container"),s=new p,L=s.get(C),t=L.create();t.scene=new f(s);t.renderer=new w(s,E);t.camera=new I(s);s.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const h=s.get(g);h.create(t);t.scene.three.background=null;const F=new A(s),R=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),S=await R.arrayBuffer(),T=new Uint8Array(S),i=F.load(T);t.scene.three.add(i);const o=s.get(y);o.byEntity(i);o.byIfcRel(i,d,"storeys");o.byModel(i.uuid,i);const N=o.find({entities:["IFCWALLSTANDARDCASE"]}),$=o.find({entities:["IFCSLAB"]}),U=o.find({entities:["IFCMEMBER","IFCPLATE"]}),v=o.find({entities:["IFCFURNISHINGELEMENT"]}),B=o.find({entities:["IFCDOOR"]}),D=o.find({models:[i.uuid]}),l=new u;l.showPanel(2);document.body.append(l.dom);l.dom.style.left="0px";l.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>l.begin());t.renderer.onAfterUpdate.add(()=>l.end());b.init();const e=new m,r=a.create(()=>c` +import{a2 as d,C as m}from"./web-ifc-api-CfQNUy7g.js";import{S as u}from"./stats.min-BpIepu9J.js";import{m as b,t as a,a as c}from"./index-tywNknxv.js";import{p,C,i as f,n as w,W as I,d as g,h as A,A as y}from"./index-CrrO1BJs.js";const E=document.getElementById("container"),s=new p,L=s.get(C),t=L.create();t.scene=new f(s);t.renderer=new w(s,E);t.camera=new I(s);s.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const h=s.get(g);h.create(t);t.scene.three.background=null;const F=new A(s),R=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),S=await R.arrayBuffer(),T=new Uint8Array(S),i=F.load(T);t.scene.three.add(i);const o=s.get(y);o.byEntity(i);o.byIfcRel(i,d,"storeys");o.byModel(i.uuid,i);const N=o.find({entities:["IFCWALLSTANDARDCASE"]}),$=o.find({entities:["IFCSLAB"]}),U=o.find({entities:["IFCMEMBER","IFCPLATE"]}),v=o.find({entities:["IFCFURNISHINGELEMENT"]}),B=o.find({entities:["IFCDOOR"]}),D=o.find({models:[i.uuid]}),l=new u;l.showPanel(2);document.body.append(l.dom);l.dom.style.left="0px";l.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>l.begin());t.renderer.onAfterUpdate.add(()=>l.end());b.init();const e=new m,r=a.create(()=>c` diff --git a/examples/assets/clipEdges.js b/examples/assets/clipEdges.js index 0111a2553..b643fce39 100644 --- a/examples/assets/clipEdges.js +++ b/examples/assets/clipEdges.js @@ -1,4 +1,4 @@ -import{B as M,M as y,a as d,b as c,L as b}from"./web-ifc-api-CfQNUy7g.js";import{S as f}from"./stats.min-BpIepu9J.js";import{m as k,t as m,a as p}from"./index-tywNknxv.js";import{p as x,C as v,i as P,W as B,d as C,H as I,R as L}from"./index-D2xchnNe.js";import{S as $,m as S,d as D}from"./index-Bpjba_Wq.js";const u=document.getElementById("container"),o=new x,z=o.get(v),e=z.create();e.scene=new P(o);e.renderer=new $(o,u);e.camera=new B(o);e.renderer.postproduction.enabled=!0;e.renderer.postproduction.customEffects.outlineEnabled=!0;o.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const h=o.get(C);h.config.color.setHex(6710886);const E=h.create(e);e.renderer.postproduction.customEffects.excludedMeshes.push(E.three);e.scene.three.background=null;const g=new M(3,3,3),w=new y({color:"#6528D7"}),a=new d(g,w);a.position.set(-2,1.5,0);e.scene.three.add(a);e.meshes.add(a);const l=new d(g,w);l.position.set(2,1.5,0);e.scene.three.add(l);e.meshes.add(l);const R=o.get(I);R.get(e);const n=o.get(L);n.enabled=!0;const r=o.get(S);n.Type=D;const W=new c({color:"lightblue",side:2}),A=new b({color:"blue"}),H=new c({color:"blue",opacity:.5,side:2,transparent:!0});r.styles.create("Red lines",new Set([a]),e,A,W,H);const O=new c({color:"salmon",side:2}),F=new b({color:"red"}),G=new c({color:"red",opacity:.5,side:2,transparent:!0});r.styles.create("Blue lines",new Set([l]),e,F,O,G);u.ondblclick=()=>{n.enabled&&n.create(e)};window.onkeydown=t=>{(t.code==="Delete"||t.code==="Backspace")&&n.enabled&&n.delete(e)};const s=new f;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end());k.init();const i=m.create(()=>p` +import{B as M,M as y,a as d,b as c,L as b}from"./web-ifc-api-CfQNUy7g.js";import{S as f}from"./stats.min-BpIepu9J.js";import{m as k,t as m,a as p}from"./index-tywNknxv.js";import{p as x,C as v,i as P,W as B,d as C,H as I,R as L}from"./index-CrrO1BJs.js";import{S as $,m as S,d as D}from"./index-BREiuDZQ.js";const u=document.getElementById("container"),o=new x,z=o.get(v),e=z.create();e.scene=new P(o);e.renderer=new $(o,u);e.camera=new B(o);e.renderer.postproduction.enabled=!0;e.renderer.postproduction.customEffects.outlineEnabled=!0;o.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const h=o.get(C);h.config.color.setHex(6710886);const E=h.create(e);e.renderer.postproduction.customEffects.excludedMeshes.push(E.three);e.scene.three.background=null;const g=new M(3,3,3),w=new y({color:"#6528D7"}),a=new d(g,w);a.position.set(-2,1.5,0);e.scene.three.add(a);e.meshes.add(a);const l=new d(g,w);l.position.set(2,1.5,0);e.scene.three.add(l);e.meshes.add(l);const R=o.get(I);R.get(e);const n=o.get(L);n.enabled=!0;const r=o.get(S);n.Type=D;const W=new c({color:"lightblue",side:2}),A=new b({color:"blue"}),H=new c({color:"blue",opacity:.5,side:2,transparent:!0});r.styles.create("Red lines",new Set([a]),e,A,W,H);const O=new c({color:"salmon",side:2}),F=new b({color:"red"}),G=new c({color:"red",opacity:.5,side:2,transparent:!0});r.styles.create("Blue lines",new Set([l]),e,F,O,G);u.ondblclick=()=>{n.enabled&&n.create(e)};window.onkeydown=t=>{(t.code==="Delete"||t.code==="Backspace")&&n.enabled&&n.delete(e)};const s=new f;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end());k.init();const i=m.create(()=>p` diff --git a/examples/assets/clipper.js b/examples/assets/clipper.js index 54ee3af2e..8f4c8f831 100644 --- a/examples/assets/clipper.js +++ b/examples/assets/clipper.js @@ -1,4 +1,4 @@ -import{B as r,M as m,a as d}from"./web-ifc-api-CfQNUy7g.js";import{S as p}from"./stats.min-BpIepu9J.js";import{m as u,t as s,a as c}from"./index-tywNknxv.js";import{p as h,C as g,i as k,n as w,W as y,H as f,R as v}from"./index-D2xchnNe.js";const b=document.getElementById("container"),a=new h,M=a.get(g),e=M.create();e.scene=new k(a);e.renderer=new w(a,b);e.camera=new y(a);a.init();e.camera.controls.setLookAt(10,10,10,0,0,0);e.scene.setup();e.scene.three.background=null;const x=new r(3,3,3),C=new m({color:"#6528D7"}),l=new d(x,C);l.position.set(0,1.5,0);e.scene.three.add(l);e.meshes.add(l);const $=a.get(f);$.get(e);const t=a.get(v);t.enabled=!0;b.ondblclick=()=>{t.enabled&&t.create(e)};window.onkeydown=n=>{(n.code==="Delete"||n.code==="Backspace")&&t.enabled&&t.delete(e)};const o=new p;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end());u.init();const i=s.create(()=>c` +import{B as r,M as m,a as d}from"./web-ifc-api-CfQNUy7g.js";import{S as p}from"./stats.min-BpIepu9J.js";import{m as u,t as s,a as c}from"./index-tywNknxv.js";import{p as h,C as g,i as k,n as w,W as y,H as f,R as v}from"./index-CrrO1BJs.js";const b=document.getElementById("container"),a=new h,M=a.get(g),e=M.create();e.scene=new k(a);e.renderer=new w(a,b);e.camera=new y(a);a.init();e.camera.controls.setLookAt(10,10,10,0,0,0);e.scene.setup();e.scene.three.background=null;const x=new r(3,3,3),C=new m({color:"#6528D7"}),l=new d(x,C);l.position.set(0,1.5,0);e.scene.three.add(l);e.meshes.add(l);const $=a.get(f);$.get(e);const t=a.get(v);t.enabled=!0;b.ondblclick=()=>{t.enabled&&t.create(e)};window.onkeydown=n=>{(n.code==="Delete"||n.code==="Backspace")&&t.enabled&&t.delete(e)};const o=new p;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end());u.init();const i=s.create(()=>c` diff --git a/examples/assets/cullers.js b/examples/assets/cullers.js index 2ee98b4fa..1f8e33897 100644 --- a/examples/assets/cullers.js +++ b/examples/assets/cullers.js @@ -1 +1 @@ -import{B as c,a6 as i,a as l}from"./web-ifc-api-CfQNUy7g.js";import{S as m}from"./stats.min-BpIepu9J.js";import{p,C as u,i as y,n as b,W as g,d as f,T as w}from"./index-D2xchnNe.js";const h=document.getElementById("container"),t=new p,x=t.get(u),e=x.create();e.scene=new y(t);e.renderer=new b(t,h);e.camera=new g(t);t.init();e.camera.controls.setLookAt(13,13,13,0,0,0);e.scene.setup();const M=t.get(f);M.create(e);e.scene.three.background=null;const B=t.get(w),o=B.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 C=new c(2,2,2),U=new i({color:"#6528D7"});function d(a){return Math.random()*a}function E(){for(let a=0;a<300;a++){const n=new l(C,U);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)}}E();o.needsUpdate=!0;e.camera.controls.addEventListener("controlend",()=>{o.needsUpdate=!0});const r=new m;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,a6 as i,a as l}from"./web-ifc-api-CfQNUy7g.js";import{S as m}from"./stats.min-BpIepu9J.js";import{p,C as u,i as y,n as b,W as g,d as f,T as w}from"./index-CrrO1BJs.js";const h=document.getElementById("container"),t=new p,x=t.get(u),e=x.create();e.scene=new y(t);e.renderer=new b(t,h);e.camera=new g(t);t.init();e.camera.controls.setLookAt(13,13,13,0,0,0);e.scene.setup();const M=t.get(f);M.create(e);e.scene.three.background=null;const B=t.get(w),o=B.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 C=new c(2,2,2),U=new i({color:"#6528D7"});function d(a){return Math.random()*a}function E(){for(let a=0;a<300;a++){const n=new l(C,U);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)}}E();o.needsUpdate=!0;e.camera.controls.addEventListener("controlend",()=>{o.needsUpdate=!0});const r=new m;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/edgeMeasurement.js b/examples/assets/edgeMeasurement.js index 0642a205c..bef906d6a 100644 --- a/examples/assets/edgeMeasurement.js +++ b/examples/assets/edgeMeasurement.js @@ -1 +1 @@ -import{a as c}from"./web-ifc-api-CfQNUy7g.js";import{S as i}from"./stats.min-BpIepu9J.js";import{p as l,C as f,i as m,W as p,d as w,h}from"./index-D2xchnNe.js";import{S as g,T as u}from"./index-Bpjba_Wq.js";const d=document.getElementById("container"),t=new l,y=t.get(f),e=y.create();e.scene=new m(t);e.renderer=new g(t,d);e.camera=new p(t);t.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const b=t.get(w);b.create(e);e.scene.three.background=null;const S=new h(t),k=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),A=await k.arrayBuffer(),B=new Uint8Array(A),r=S.load(B);e.scene.three.add(r);for(const o of r.children)o instanceof c&&e.meshes.add(o);const n=t.get(u);n.world=e;n.enabled=!0;d.ondblclick=()=>n.create();let a;window.addEventListener("keydown",o=>{o.code==="KeyO"?n.delete():o.code==="KeyS"?(a=n.get(),n.deleteAll()):o.code==="KeyL"&&a&&n.set(a)});const s=new i;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end()); +import{a as c}from"./web-ifc-api-CfQNUy7g.js";import{S as i}from"./stats.min-BpIepu9J.js";import{p as l,C as f,i as m,W as p,d as w,h}from"./index-CrrO1BJs.js";import{S as g,T as u}from"./index-BREiuDZQ.js";const d=document.getElementById("container"),t=new l,y=t.get(f),e=y.create();e.scene=new m(t);e.renderer=new g(t,d);e.camera=new p(t);t.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const b=t.get(w);b.create(e);e.scene.three.background=null;const S=new h(t),k=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),A=await k.arrayBuffer(),B=new Uint8Array(A),r=S.load(B);e.scene.three.add(r);for(const o of r.children)o instanceof c&&e.meshes.add(o);const n=t.get(u);n.world=e;n.enabled=!0;d.ondblclick=()=>n.create();let a;window.addEventListener("keydown",o=>{o.code==="KeyO"?n.delete():o.code==="KeyS"?(a=n.get(),n.deleteAll()):o.code==="KeyL"&&a&&n.set(a)});const s=new i;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end()); diff --git a/examples/assets/exploder.js b/examples/assets/exploder.js index c817ffc18..70415893b 100644 --- a/examples/assets/exploder.js +++ b/examples/assets/exploder.js @@ -1,4 +1,4 @@ -import{ao as l}from"./web-ifc-api-CfQNUy7g.js";import{S as p}from"./stats.min-BpIepu9J.js";import{m,t as a,a as i}from"./index-tywNknxv.js";import{p as d,C as b,i as u,n as g,W as h,d as f,h as w,a as x,O as y,A as S}from"./index-D2xchnNe.js";const v=document.getElementById("container"),e=new d,L=e.get(b),t=L.create();t.scene=new u(e);t.renderer=new g(e,v);t.camera=new h(e);e.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const k=e.get(f);k.create(t);t.scene.three.background=null;const A=new w(e),I=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),B=await I.arrayBuffer(),C=new Uint8Array(B),s=A.load(C);t.scene.three.add(s);const E=await fetch("https://thatopen.github.io/engine_components/resources/small.json");s.setLocalProperties(await E.json());const r=e.get(x),O=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),U=r.getRelationsMapFromJSON(await O.text());r.setRelationMap(s,U);const j=e.get(y),F=e.get(S);await F.bySpatialStructure(s,{isolate:new Set([l])});const n=new p;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>n.begin());t.renderer.onAfterUpdate.add(()=>n.end());m.init();const o=a.create(()=>i` +import{ao as l}from"./web-ifc-api-CfQNUy7g.js";import{S as p}from"./stats.min-BpIepu9J.js";import{m,t as a,a as i}from"./index-tywNknxv.js";import{p as d,C as b,i as u,n as g,W as h,d as f,h as w,a as x,O as y,A as S}from"./index-CrrO1BJs.js";const v=document.getElementById("container"),e=new d,L=e.get(b),t=L.create();t.scene=new u(e);t.renderer=new g(e,v);t.camera=new h(e);e.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const k=e.get(f);k.create(t);t.scene.three.background=null;const A=new w(e),I=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),B=await I.arrayBuffer(),C=new Uint8Array(B),s=A.load(C);t.scene.three.add(s);const E=await fetch("https://thatopen.github.io/engine_components/resources/small.json");s.setLocalProperties(await E.json());const r=e.get(x),O=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),U=r.getRelationsMapFromJSON(await O.text());r.setRelationMap(s,U);const j=e.get(y),F=e.get(S);await F.bySpatialStructure(s,{isolate:new Set([l])});const n=new p;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>n.begin());t.renderer.onAfterUpdate.add(()=>n.end());m.init();const o=a.create(()=>i` n.create();let a;window.addEventListener("keydown",o=>{o.code==="KeyO"?n.delete():o.code==="KeyS"?(a=n.get(),n.deleteAll()):o.code==="KeyL"&&a&&n.set(a)});const s=new i;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end()); +import{a as c}from"./web-ifc-api-CfQNUy7g.js";import{S as i}from"./stats.min-BpIepu9J.js";import{p as l,C as f,i as m,W as p,d as w,h}from"./index-CrrO1BJs.js";import{S as g,C as u}from"./index-BREiuDZQ.js";const d=document.getElementById("container"),t=new l,y=t.get(f),e=y.create();e.scene=new m(t);e.renderer=new g(t,d);e.camera=new p(t);t.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const b=t.get(w);b.create(e);e.scene.three.background=null;const S=new h(t),k=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),A=await k.arrayBuffer(),C=new Uint8Array(A),r=S.load(C);e.scene.three.add(r);for(const o of r.children)o instanceof c&&e.meshes.add(o);const n=t.get(u);n.world=e;n.enabled=!0;d.ondblclick=()=>n.create();let a;window.addEventListener("keydown",o=>{o.code==="KeyO"?n.delete():o.code==="KeyS"?(a=n.get(),n.deleteAll()):o.code==="KeyL"&&a&&n.set(a)});const s=new i;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end()); diff --git a/examples/assets/fragmentsManager.js b/examples/assets/fragmentsManager.js index 5c5f8ac49..e681a9801 100644 --- a/examples/assets/fragmentsManager.js +++ b/examples/assets/fragmentsManager.js @@ -1,4 +1,4 @@ -import"./web-ifc-api-CfQNUy7g.js";import{S as u}from"./stats.min-BpIepu9J.js";import{p,C as b,i as g,n as f,W as w,d as h,h as y}from"./index-D2xchnNe.js";import{m as k,t as l,a as d}from"./index-tywNknxv.js";const L=document.getElementById("container"),n=new p,v=n.get(b),e=v.create();e.scene=new g(n);e.renderer=new f(n,L);e.camera=new w(n);n.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const x=n.get(h);x.create(e);e.scene.three.background=null;const s=n.get(y);let m="";async function F(){if(s.groups.size)return;const t=await(await fetch("https://thatopen.github.io/engine_components/resources/small.frag")).arrayBuffer(),c=new Uint8Array(t),i=s.load(c);e.scene.three.add(i),m=i.uuid}function U(o){const t=document.createElement("a");t.href=URL.createObjectURL(o),t.download=o.name,document.body.appendChild(t),t.click(),t.remove()}function B(){if(!s.groups.size)return;const o=s.groups.get(m);if(!o)return;const t=s.export(o),c=new Blob([t]),i=new File([c],"small.frag");U(i)}function C(){s.dispose()}const a=new u;a.showPanel(2);document.body.append(a.dom);a.dom.style.left="0px";a.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>a.begin());e.renderer.onAfterUpdate.add(()=>a.end());k.init();const r=l.create(()=>d` +import"./web-ifc-api-CfQNUy7g.js";import{S as u}from"./stats.min-BpIepu9J.js";import{p,C as b,i as g,n as f,W as w,d as h,h as y}from"./index-CrrO1BJs.js";import{m as k,t as l,a as d}from"./index-tywNknxv.js";const L=document.getElementById("container"),n=new p,v=n.get(b),e=v.create();e.scene=new g(n);e.renderer=new f(n,L);e.camera=new w(n);n.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const x=n.get(h);x.create(e);e.scene.three.background=null;const s=n.get(y);let m="";async function F(){if(s.groups.size)return;const t=await(await fetch("https://thatopen.github.io/engine_components/resources/small.frag")).arrayBuffer(),c=new Uint8Array(t),i=s.load(c);e.scene.three.add(i),m=i.uuid}function U(o){const t=document.createElement("a");t.href=URL.createObjectURL(o),t.download=o.name,document.body.appendChild(t),t.click(),t.remove()}function B(){if(!s.groups.size)return;const o=s.groups.get(m);if(!o)return;const t=s.export(o),c=new Blob([t]),i=new File([c],"small.frag");U(i)}function C(){s.dispose()}const a=new u;a.showPanel(2);document.body.append(a.dom);a.dom.style.left="0px";a.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>a.begin());e.renderer.onAfterUpdate.add(()=>a.end());k.init();const r=l.create(()=>d` diff --git a/examples/assets/grids.js b/examples/assets/grids.js index 44603e6ce..e5b2c79ca 100644 --- a/examples/assets/grids.js +++ b/examples/assets/grids.js @@ -1 +1 @@ -import{a as o,B as s}from"./web-ifc-api-CfQNUy7g.js";import{p as d,C as r,i as a,n as c,W as i,d as m}from"./index-D2xchnNe.js";const l=document.getElementById("container"),n=new d,p=n.get(r),e=p.create();e.scene=new a(n);e.renderer=new c(n,l);e.camera=new i(n);n.init();const w=new o(new s);e.scene.three.add(w);e.scene.three.background=null;const g=n.get(m),u=g.create(e);console.log(u);const t=new Stats;t.showPanel(2);document.body.append(t.dom);t.dom.style.left="0px";t.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>t.begin());e.renderer.onAfterUpdate.add(()=>t.end()); +import{a as o,B as s}from"./web-ifc-api-CfQNUy7g.js";import{p as d,C as r,i as a,n as c,W as i,d as m}from"./index-CrrO1BJs.js";const l=document.getElementById("container"),n=new d,p=n.get(r),e=p.create();e.scene=new a(n);e.renderer=new c(n,l);e.camera=new i(n);n.init();const w=new o(new s);e.scene.three.add(w);e.scene.three.background=null;const g=n.get(m),u=g.create(e);console.log(u);const t=new Stats;t.showPanel(2);document.body.append(t.dom);t.dom.style.left="0px";t.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>t.begin());e.renderer.onAfterUpdate.add(()=>t.end()); diff --git a/examples/assets/hider.js b/examples/assets/hider.js index fc1258d78..85bcb39a2 100644 --- a/examples/assets/hider.js +++ b/examples/assets/hider.js @@ -1,4 +1,4 @@ -import"./web-ifc-api-CfQNUy7g.js";import{S}from"./stats.min-BpIepu9J.js";import{m as k,t as r,a as l}from"./index-tywNknxv.js";import{p as x,C as v,i as C,n as F,W as j,d as A,h as L,a as $,S as M,A as _}from"./index-D2xchnNe.js";const B=document.getElementById("container"),e=new x,E=e.get(v),t=E.create();t.scene=new C(e);t.renderer=new F(e,B);t.camera=new j(e);e.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const I=e.get(A);I.create(t);t.scene.three.background=null;const b=e.get(L),N=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),O=await N.arrayBuffer(),U=new Uint8Array(O),i=b.load(U);t.scene.three.add(i);const q=await fetch("https://thatopen.github.io/engine_components/resources/small.json");i.setLocalProperties(await q.json());const d=e.get($),P=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),R=d.getRelationsMapFromJSON(await P.text());d.setRelationMap(i,R);const f=e.get(M),o=e.get(_);o.byEntity(i);await o.bySpatialStructure(i);const a=new S;a.showPanel(2);document.body.append(a.dom);a.dom.style.left="0px";a.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>a.begin());t.renderer.onAfterUpdate.add(()=>a.end());k.init();const g={},W=Object.keys(o.list.spatialStructures);for(const n of W)g[n]=!0;const h={},z=Object.keys(o.list.entities);for(const n of z)h[n]=!0;const s=r.create(()=>l` +import{ao as S}from"./web-ifc-api-CfQNUy7g.js";import{S as k}from"./stats.min-BpIepu9J.js";import{m as x,t as r,a as l}from"./index-tywNknxv.js";import{p as C,C as v,i as F,n as I,W as L,d as j,h as A,a as $,S as B,A as E}from"./index-CrrO1BJs.js";const M=document.getElementById("container"),e=new C,N=e.get(v),t=N.create();t.scene=new F(e);t.renderer=new I(e,M);t.camera=new L(e);e.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const O=e.get(j);O.create(t);t.scene.three.background=null;const b=e.get(A),U=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),_=await U.arrayBuffer(),R=new Uint8Array(_),i=b.load(R);t.scene.three.add(i);const q=await fetch("https://thatopen.github.io/engine_components/resources/small.json");i.setLocalProperties(await q.json());const d=e.get($),D=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),P=d.getRelationsMapFromJSON(await D.text());d.setRelationMap(i,P);const f=e.get(B),s=e.get(E);s.byEntity(i);await s.bySpatialStructure(i,{isolate:new Set([S])});const a=new k;a.showPanel(2);document.body.append(a.dom);a.dom.style.left="0px";a.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>a.begin());t.renderer.onAfterUpdate.add(()=>a.end());x.init();const g={},T=Object.keys(s.list.spatialStructures);for(const n of T)g[n]=!0;const h={},W=Object.keys(s.list.entities);for(const n of W)h[n]=!0;const o=r.create(()=>l` @@ -9,16 +9,16 @@ import"./web-ifc-api-CfQNUy7g.js";import{S}from"./stats.min-BpIepu9J.js";import{ - `);document.body.append(s);const D=s.querySelector("bim-panel-section[name='Floors']"),H=s.querySelector("bim-panel-section[name='Categories']");for(const n in g){const m=r.create(()=>l` + `);document.body.append(o);const z=o.querySelector("bim-panel-section[name='Floors']"),G=o.querySelector("bim-panel-section[name='Categories']");for(const n in g){const m=r.create(()=>l` + @change="${({target:p})=>{const c=s.list.spatialStructures[n];if(c&&c.id!==null)for(const[J,u]of b.groups){const w=d.getEntityChildren(u,c.id),y=u.getFragmentMap(w);f.set(p.value,y)}}}"> - `);D.append(m)}for(const n in h){const m=r.create(()=>l` + `);z.append(m)}for(const n in h){const m=r.create(()=>l` + @change="${({target:p})=>{const c=s.find({entities:[n]});f.set(p.value,c)}}"> - `);H.append(m)}const J=r.create(()=>l` + `);G.append(m)}const H=r.create(()=>l` + @click="${()=>{o.classList.contains("options-menu-visible")?o.classList.remove("options-menu-visible"):o.classList.add("options-menu-visible")}}"> - `);document.body.append(J); + `);document.body.append(H); diff --git a/examples/assets/highlighter.js b/examples/assets/highlighter.js index 79e34477c..a173edb06 100644 --- a/examples/assets/highlighter.js +++ b/examples/assets/highlighter.js @@ -1 +1 @@ -import"./web-ifc-api-CfQNUy7g.js";import{p as s,C as a,i as r,n as c,W as d,d as i,h as m}from"./index-D2xchnNe.js";import{a as l}from"./index-Bpjba_Wq.js";import{S as p}from"./stats.min-BpIepu9J.js";const f=document.getElementById("container"),t=new s,g=t.get(a),e=g.create();e.scene=new r(t);e.renderer=new c(t,f);e.camera=new d(t);t.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const h=t.get(i);h.create(e);e.scene.three.background=null;const u=new m(t),w=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),y=await w.arrayBuffer(),b=new Uint8Array(y),S=u.load(b);e.scene.three.add(S);const o=t.get(l);o.setup({world:e});o.zoomToSelection=!0;const n=new p;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()); +import"./web-ifc-api-CfQNUy7g.js";import{p as s,C as a,i as r,n as c,W as d,d as i,h as m}from"./index-CrrO1BJs.js";import{a as l}from"./index-BREiuDZQ.js";import{S as p}from"./stats.min-BpIepu9J.js";const f=document.getElementById("container"),t=new s,g=t.get(a),e=g.create();e.scene=new r(t);e.renderer=new c(t,f);e.camera=new d(t);t.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const h=t.get(i);h.create(e);e.scene.three.background=null;const u=new m(t),w=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),y=await w.arrayBuffer(),b=new Uint8Array(y),S=u.load(b);e.scene.three.add(S);const o=t.get(l);o.setup({world:e});o.zoomToSelection=!0;const n=new p;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()); diff --git a/examples/assets/ifcGeometryTiler.js b/examples/assets/ifcGeometryTiler.js index 8aed6d4fa..023855109 100644 --- a/examples/assets/ifcGeometryTiler.js +++ b/examples/assets/ifcGeometryTiler.js @@ -1,4 +1,4 @@ -import"./web-ifc-api-CfQNUy7g.js";import{S as w}from"./stats.min-BpIepu9J.js";import{m as h,t as b,a as g}from"./index-tywNknxv.js";import{p as y,C as F,i as L,n as B,W as I,d as S,h as U,_ as k}from"./index-D2xchnNe.js";const v=document.getElementById("container"),a=new y,A=a.get(F),t=A.create();t.scene=new L(a);t.renderer=new B(a,v);t.camera=new I(a);a.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const D=a.get(S);D.create(t);t.scene.three.background=null;const C=new U(a),R=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),_=await R.arrayBuffer(),j=new Uint8Array(_),x=C.load(j);t.scene.three.add(x);const i=a.get(k),z={path:"https://unpkg.com/web-ifc@0.0.55/",absolute:!0};i.settings.wasm=z;i.settings.minGeometrySize=20;i.settings.minAssetsSize=1e3;let l=[],f={},u=1;i.onGeometryStreamed.add(e=>{const{buffer:s,data:n}=e,o=`small.ifc-processed-geometries-${u}`;for(const c in n){const p=n[c];p.geometryFile=o,f[c]=p}l.push({name:o,bits:[s]}),u++});let d=[];i.onAssetStreamed.add(e=>{d=[...d,...e]});i.onIfcLoaded.add(e=>{l.push({name:"small.ifc-processed-global",bits:[e]})});function G(e,...s){const n=new File(s,e),o=document.createElement("a"),c=URL.createObjectURL(n);o.href=c,o.download=n.name,o.click(),URL.revokeObjectURL(c)}async function O(e){for(const{name:s,bits:n}of e)G(s,...n),await new Promise(o=>{setTimeout(o,100)})}i.onProgress.add(e=>{e===1&&setTimeout(async()=>{const s={geometries:f,assets:d,globalDataFileId:"small.ifc-processed-global"};l.push({name:"small.ifc-processed.json",bits:[JSON.stringify(s)]}),await O(l),d=[],f={},l=[],u=1})});async function P(){const s=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),n=new Uint8Array(s);await i.streamFromBuffer(n)}const r=new w;r.showPanel(2);document.body.append(r.dom);r.dom.style.left="0px";r.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>r.begin());t.renderer.onAfterUpdate.add(()=>r.end());h.init();const m=b.create(()=>g` +import"./web-ifc-api-CfQNUy7g.js";import{S as w}from"./stats.min-BpIepu9J.js";import{m as h,t as b,a as g}from"./index-tywNknxv.js";import{p as y,C as F,i as L,n as B,W as I,d as S,h as U,_ as k}from"./index-CrrO1BJs.js";const v=document.getElementById("container"),a=new y,A=a.get(F),t=A.create();t.scene=new L(a);t.renderer=new B(a,v);t.camera=new I(a);a.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const D=a.get(S);D.create(t);t.scene.three.background=null;const C=new U(a),R=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),_=await R.arrayBuffer(),j=new Uint8Array(_),x=C.load(j);t.scene.three.add(x);const i=a.get(k),z={path:"https://unpkg.com/web-ifc@0.0.55/",absolute:!0};i.settings.wasm=z;i.settings.minGeometrySize=20;i.settings.minAssetsSize=1e3;let l=[],f={},u=1;i.onGeometryStreamed.add(e=>{const{buffer:s,data:n}=e,o=`small.ifc-processed-geometries-${u}`;for(const c in n){const p=n[c];p.geometryFile=o,f[c]=p}l.push({name:o,bits:[s]}),u++});let d=[];i.onAssetStreamed.add(e=>{d=[...d,...e]});i.onIfcLoaded.add(e=>{l.push({name:"small.ifc-processed-global",bits:[e]})});function G(e,...s){const n=new File(s,e),o=document.createElement("a"),c=URL.createObjectURL(n);o.href=c,o.download=n.name,o.click(),URL.revokeObjectURL(c)}async function O(e){for(const{name:s,bits:n}of e)G(s,...n),await new Promise(o=>{setTimeout(o,100)})}i.onProgress.add(e=>{e===1&&setTimeout(async()=>{const s={geometries:f,assets:d,globalDataFileId:"small.ifc-processed-global"};l.push({name:"small.ifc-processed.json",bits:[JSON.stringify(s)]}),await O(l),d=[],f={},l=[],u=1})});async function P(){const s=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),n=new Uint8Array(s);await i.streamFromBuffer(n)}const r=new w;r.showPanel(2);document.body.append(r.dom);r.dom.style.left="0px";r.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>r.begin());t.renderer.onAfterUpdate.add(()=>r.end());h.init();const m=b.create(()=>g` diff --git a/examples/assets/ifcJsonExporter.js b/examples/assets/ifcJsonExporter.js index 60fbbe49f..0a246a2f2 100644 --- a/examples/assets/ifcJsonExporter.js +++ b/examples/assets/ifcJsonExporter.js @@ -1,4 +1,4 @@ -import{a5 as d}from"./web-ifc-api-CfQNUy7g.js";import{S as b}from"./stats.min-BpIepu9J.js";import{m as f,t as i,a as c}from"./index-tywNknxv.js";import{p as u,C as w,i as g,n as h,W as y,d as k,h as x,m as I}from"./index-D2xchnNe.js";const L=document.getElementById("container"),t=new u,U=t.get(w),e=U.create();e.scene=new g(t);e.renderer=new h(t,L);e.camera=new y(t);t.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const v=t.get(k);v.create(e);e.scene.three.background=null;const B=new x(t),O=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),S=await O.arrayBuffer(),A=new Uint8Array(S),j=B.load(A);e.scene.three.add(j);const C=t.get(I),a=new d;a.SetWasmPath("https://unpkg.com/web-ifc@0.0.55/",!0);await a.Init();const E=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),F=await E.arrayBuffer(),R=new Uint8Array(F),D=a.OpenModel(R),n=new b;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());f.init();const s=i.create(()=>c` +import{a5 as d}from"./web-ifc-api-CfQNUy7g.js";import{S as b}from"./stats.min-BpIepu9J.js";import{m as f,t as i,a as c}from"./index-tywNknxv.js";import{p as u,C as w,i as g,n as h,W as y,d as k,h as x,m as I}from"./index-CrrO1BJs.js";const L=document.getElementById("container"),t=new u,U=t.get(w),e=U.create();e.scene=new g(t);e.renderer=new h(t,L);e.camera=new y(t);t.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const v=t.get(k);v.create(e);e.scene.three.background=null;const B=new x(t),O=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),S=await O.arrayBuffer(),A=new Uint8Array(S),j=B.load(A);e.scene.three.add(j);const C=t.get(I),a=new d;a.SetWasmPath("https://unpkg.com/web-ifc@0.0.55/",!0);await a.Init();const E=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),F=await E.arrayBuffer(),R=new Uint8Array(F),D=a.OpenModel(R),n=new b;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());f.init();const s=i.create(()=>c` diff --git a/examples/assets/ifcLoader.js b/examples/assets/ifcLoader.js index 8c9988e7a..4b5b81f57 100644 --- a/examples/assets/ifcLoader.js +++ b/examples/assets/ifcLoader.js @@ -1,4 +1,4 @@ -import{b4 as b,b5 as u,b6 as f}from"./web-ifc-api-CfQNUy7g.js";import{m as g,t as m,a as p}from"./index-tywNknxv.js";import{S as w}from"./stats.min-BpIepu9J.js";import{p as I,C,i as y,n as h,W as F,d as L,h as N,b as R}from"./index-D2xchnNe.js";const E=document.getElementById("container"),o=new I,O=o.get(C),t=O.create();t.scene=new y(o);t.renderer=new h(o,E);t.camera=new F(o);o.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const x=o.get(L);x.create(t);t.scene.three.background=null;const a=o.get(N),r=o.get(R);await r.setup();const k=[b,u,f];for(const e of k)r.settings.excludedCategories.add(e);r.settings.webIfc.COORDINATE_TO_ORIGIN=!0;async function v(){const n=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),i=new Uint8Array(n),l=await r.load(i);l.name="example",t.scene.three.add(l)}a.onFragmentsLoaded.add(e=>{console.log(e)});function d(e){const n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=e.name,document.body.appendChild(n),n.click(),n.remove()}async function A(){if(!a.groups.size)return;const e=Array.from(a.groups.values())[0],n=a.export(e);d(new File([new Blob([n])],"small.frag"));const i=e.getLocalProperties();i&&d(new File([JSON.stringify(i)],"small.json"))}function B(){a.dispose()}const s=new w;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>s.begin());t.renderer.onAfterUpdate.add(()=>s.end());g.init();const c=m.create(()=>p` +import{b4 as b,b5 as u,b6 as f}from"./web-ifc-api-CfQNUy7g.js";import{m as g,t as m,a as p}from"./index-tywNknxv.js";import{S as w}from"./stats.min-BpIepu9J.js";import{p as I,C,i as y,n as h,W as F,d as L,h as N,b as R}from"./index-CrrO1BJs.js";const E=document.getElementById("container"),o=new I,O=o.get(C),t=O.create();t.scene=new y(o);t.renderer=new h(o,E);t.camera=new F(o);o.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const x=o.get(L);x.create(t);t.scene.three.background=null;const a=o.get(N),r=o.get(R);await r.setup();const k=[b,u,f];for(const e of k)r.settings.excludedCategories.add(e);r.settings.webIfc.COORDINATE_TO_ORIGIN=!0;async function v(){const n=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),i=new Uint8Array(n),l=await r.load(i);l.name="example",t.scene.three.add(l)}a.onFragmentsLoaded.add(e=>{console.log(e)});function d(e){const n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=e.name,document.body.appendChild(n),n.click(),n.remove()}async function A(){if(!a.groups.size)return;const e=Array.from(a.groups.values())[0],n=a.export(e);d(new File([new Blob([n])],"small.frag"));const i=e.getLocalProperties();i&&d(new File([JSON.stringify(i)],"small.json"))}function B(){a.dispose()}const s=new w;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>s.begin());t.renderer.onAfterUpdate.add(()=>s.end());g.init();const c=m.create(()=>p` diff --git a/examples/assets/ifcPropertiesManager.js b/examples/assets/ifcPropertiesManager.js index f65106d3c..88c490149 100644 --- a/examples/assets/ifcPropertiesManager.js +++ b/examples/assets/ifcPropertiesManager.js @@ -2,4 +2,4 @@ var hs=Object.defineProperty;var ys=(I,n,t)=>n in I?hs(I,n,{enumerable:!0,config - 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.`)}};d(G,"_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}$/),d(G,"_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 se=G;const Ie=class Ie{constructor(){d(this,"onDisposed",new V);d(this,"list",new Map);d(this,"enabled",!1);d(this,"_clock");d(this,"update",()=>{if(!this.enabled)return;const n=this._clock.getDelta();for(const[t,e]of this.list)e.enabled&&e.isUpdateable()&&e.update(n);requestAnimationFrame(this.update)});this._clock=new Ys,Ie.setupBVH()}add(n,t){if(this.list.has(n))throw new Error("You're trying to add a component that already exists in the components instance. Use Components.get() instead.");se.validate(n),this.list.set(n,t)}get(n){const t=n.uuid;if(!this.list.has(t)){const e=new n(this);return this.list.has(t)||this.add(t,e),e}return this.list.get(t)}init(){this.enabled=!0,this._clock.start(),this.update()}dispose(){this.enabled=!1;for(const[n,t]of this.list)t.enabled=!1,t.isDisposeable()&&t.dispose();this._clock.stop(),this.onDisposed.trigger(),this.onDisposed.reset()}static setupBVH(){pe.prototype.computeBoundsTree=Ei,pe.prototype.disposeBoundsTree=oi,Cs.prototype.raycast=ii}};d(Ie,"release","2.1.9");let ne=Ie;const ri=new Map([[Ye,{forRelating:"IsDecomposedBy",forRelated:"Decomposes"}],[cs,{forRelating:"AssociatedTo",forRelated:"HasAssociations"}],[Ts,{forRelating:"ClassificationForObjects",forRelated:"HasAssociations"}],[Rs,{forRelating:"IsGroupedBy",forRelated:"HasAssignments"}],[xe,{forRelated:"IsDefinedBy",forRelating:"DefinesOcurrence"}],[ls,{forRelated:"IsTypedBy",forRelating:"Types"}],[Fs,{forRelated:"IsDefinedBy",forRelating:"Defines"}],[Ge,{forRelated:"ContainedInStructure",forRelating:"ContainsElements"}]]),mt=class mt extends Gt{constructor(t){super(t);d(this,"onDisposed",new V);d(this,"onRelationsIndexed",new V);d(this,"relationMaps",{});d(this,"enabled",!0);d(this,"_relToAttributesMap",ri);d(this,"_inverseAttributes",["IsDecomposedBy","Decomposes","AssociatedTo","HasAssociations","ClassificationForObjects","IsGroupedBy","HasAssignments","IsDefinedBy","DefinesOcurrence","IsTypedBy","Types","Defines","ContainedInStructure","ContainsElements"]);d(this,"_ifcRels",[Ye,cs,Ts,Rs,xe,ls,Fs,Ge]);d(this,"onFragmentsDisposed",t=>{delete this.relationMaps[t.groupID]});this.components.add(mt.uuid,this),t.get(Yt).onFragmentsDisposed.add(this.onFragmentsDisposed)}indexRelations(t,e,s,E){const i=Object.keys(e).find(a=>a.startsWith("Relating")),o=Object.keys(e).find(a=>a.startsWith("Related"));if(!(i&&o))return;const r=e[i].value,c=e[o].map(a=>a.value),C=t.get(r)??new Map,T=this.getAttributeIndex(E);T&&(C.set(T,c),t.set(r,C));for(const a of c){const R=t.get(a)??new Map,l=this.getAttributeIndex(s);if(!l)continue;const S=R.get(l)??[];S.push(r),R.set(l,S),t.set(a,R)}}getAttributeIndex(t){const e=this._inverseAttributes.indexOf(t);return e===-1?null:e}setRelationMap(t,e){this.relationMaps[t.uuid]=e,this.onRelationsIndexed.trigger({modelID:t.uuid,relationsMap:e})}async process(t){if(!t.hasProperties)throw new Error("FragmentsGroup properties not found");let e=this.relationMaps[t.uuid];if(e)return e;e=new Map;for(const s of this._ifcRels){const E=await t.getAllPropertiesOfType(s);if(!E)continue;const i=this._relToAttributesMap.get(s);if(!i)continue;const{forRelated:o,forRelating:r}=i;for(const c in E){const C=E[c];this.indexRelations(e,C,o,r)}}return this.setRelationMap(t,e),e}async processFromWebIfc(t,e){const s=new Map;for(const E of this._ifcRels){const i=this._relToAttributesMap.get(E);if(!i)continue;const{forRelated:o,forRelating:r}=i,c=t.GetLineIDsWithType(e,E);for(let C=0;C{}),i={},o=n.getAllPropertiesIDs();for(const c of o){const C=await n.getProperties(c);if(!C)continue;const T=C.type===t,a=Object.keys(C).find(F=>F.startsWith("Relating")),R=Object.keys(C).find(F=>F.startsWith("Related"));if(!(T&&a&&R))continue;const l=await n.getProperties((r=C[a])==null?void 0:r.value),S=C[R];if(!l||!S||!(S&&Array.isArray(S)))continue;const N=S.map(F=>F.value);await E(l.expressID,N),i[l.expressID]=N}return i}static async getQsetQuantities(n,t,e){const E=e??(()=>{}),i=await n.getProperties(t);return!i||i.type!==Gs?null:(i.Quantities??[{}]).map(c=>(c.value&&E(c.value),c.value)).filter(c=>c!==null)}static async getPsetProps(n,t,e){const E=e??(()=>{}),i=await n.getProperties(t);return!i||i.type!==Me?null:(i.HasProperties??[{}]).map(c=>(c.value&&E(c.value),c.value)).filter(c=>c!==null)}static async getPsetRel(n,t){var o;if(!await n.getProperties(t))return null;const s=await n.getAllPropertiesOfType(xe);if(!s)return null;const E=Object.values(s);let i=null;for(const r of E)((o=r.RelatingPropertyDefinition)==null?void 0:o.value)===t&&(i=r.expressID);return i}static async getQsetRel(n,t){return Ee.getPsetRel(n,t)}static async getEntityName(n,t){var i;const e=await n.getProperties(t);if(!e)return{key:null,name:null};const s=Object.keys(e).find(o=>o.endsWith("Name"))??null,E=s?(i=e[s])==null?void 0:i.value:null;return{key:s,name:E}}static async getQuantityValue(n,t){const e=await n.getProperties(t);if(!e)return{key:null,value:null};const s=Object.keys(e).find(i=>i.endsWith("Value"))??null;let E;return s===null||e[s]===void 0||e[s]===null?E=null:E=e[s].value,{key:s,value:E}}static isRel(n){return Ci[n].startsWith("IFCREL")}static async attributeExists(n,t,e){const s=await n.getProperties(t);return s?Object.keys(s).includes(e):!1}static async groupEntitiesByType(n,t){var s;const e=new Map;for(const E of t){const i=await n.getProperties(E);if(!i)continue;const o=i.type;e.get(o)||e.set(o,new Set),(s=e.get(o))==null||s.add(E)}return e}}class ci{constructor(){d(this,"factor",1);d(this,"complement",1)}apply(n){const e=this.getScaleMatrix().multiply(n);n.copy(e)}setUp(n){var E,i,o;this.factor=1;const t=this.getLengthUnits(n);if(!t)return;const e=t==null,s=t.Name===void 0||t.Name===null;e||s||(t.Name.value==="FOOT"&&(this.factor=.3048),((E=t.Prefix)==null?void 0:E.value)==="MILLI"?this.complement=.001:((i=t.Prefix)==null?void 0:i.value)==="CENTI"?this.complement=.01:((o=t.Prefix)==null?void 0:o.value)==="DECI"&&(this.complement=.01))}getLengthUnits(n){try{const e=n.GetLineIDsWithType(0,bs).get(0),s=n.GetLine(0,e);for(const E of s.Units){if(!E||E.value===null||E.value===void 0)continue;const i=n.GetLine(0,E.value);if(i.UnitType&&i.UnitType.value==="LENGTHUNIT")return i}return null}catch{return console.log("Could not get units"),null}}getScaleMatrix(){const n=this.factor;return new $().fromArray([n,0,0,0,0,n,0,0,0,0,n,0,0,0,0,1])}}class Ti{constructor(){d(this,"itemsByFloor",{});d(this,"_units",new ci)}setUp(n){this._units.setUp(n),this.cleanUp();try{const t=n.GetLineIDsWithType(0,Ge),e=new Set,s=n.GetLineIDsWithType(0,xt);for(let c=0;c{this.getMesh(i,e)});for(const i of this._visitedFragments){const{index:o,fragment:r}=i[1];e.keyFragments.set(o,r.id)}for(const i of e.items){const o=this._fragmentInstances.get(i.id);if(!o)throw new Error("Fragment not found!");const r=[];for(const[c,C]of o)r.push(C);i.add(r)}const E=this.webIfc.GetCoordinationMatrix(0);return e.coordinationMatrix.fromArray(E),e.civilData=this._civil.read(this.webIfc),e}getMesh(t,e){const s=t.geometries.size(),E=t.expressID;for(let i=0;io.value!==s),await t.setProperties(s,null),this.registerChange(t,e,s))}async addElementToPset(t,e,...s){const E=await Ee.getPsetRel(t,e);if(!E)return;const i=await t.getProperties(E);if(!i)return;for(const r of s){const c=new bt(r);i.RelatedObjects.push(c),this.onElementToPset.trigger({model:t,psetID:e,elementID:r})}this.registerChange(t,e);const o=this.components.get(ie);for(const r of s)o.addEntityRelations(t,r,"IsDefinedBy",e)}async addPropToPset(t,e,...s){const E=await t.getProperties(e);if(E){for(const i of s){if(E.HasProperties.includes(i))continue;const o=new bt(i);E.HasProperties.push(o),this.onPropToPset.trigger({model:t,psetID:e,propID:i})}this.registerChange(t,e)}}async saveToIfc(t,e){const s=this.components.get(oe),E=s.webIfc,i=await s.readIfcFile(e),o=this.changeMap[t.uuid]??[];for(const c of o){const C=await t.getProperties(c);if(C)try{E.WriteLine(i,C)}catch{}else try{E.DeleteLine(i,c)}catch{}}const r=E.SaveModel(i);return s.webIfc.CloseModel(i),s.cleanUp(),r}async setAttributeListener(t,e,s){this.attributeListeners[t.uuid]||(this.attributeListeners[t.uuid]={});const E=this.attributeListeners[t.uuid][e]?this.attributeListeners[t.uuid][e][s]:null;if(E)return E;const i=await t.getProperties(e);if(!i)throw new Error(`Entity with expressID ${e} doesn't exists.`);const o=i[s];if(Array.isArray(o)||!o)throw new Error(`Attribute ${s} is array or null, and it can't have a listener.`);const r=o.value;if(r===void 0||r==null)throw new Error(`Attribute ${s} has a badly defined handle.`);const c=new V;return Object.defineProperty(i[s],"value",{get(){return this._value},async set(C){this._value=C,c.trigger(C)}}),i[s].value=r,this.attributeListeners[t.uuid][e]||(this.attributeListeners[t.uuid][e]={}),this.attributeListeners[t.uuid][e][s]=c,c}increaseMaxID(t){return t.ifcMetadata.maxExpressID++,t.ifcMetadata.maxExpressID}newGUID(t){const e=nt.getIFCSchema(t);return new Q[e].IfcGloballyUniqueId(se.create())}async getOwnerHistory(t){const e=await t.getAllPropertiesOfType(tn);if(!e)throw new Error("No OwnerHistory was found.");const s=Object.keys(e).map(o=>parseInt(o,10)),E=e[s[0]],i=new bt(E.expressID);return{ownerHistory:E,ownerHistoryHandle:i}}registerChange(t,...e){this.changeMap[t.uuid]||(this.changeMap[t.uuid]=new Set);for(const s of e)this.changeMap[t.uuid].add(s),this.onDataChanged.trigger({model:t,expressID:s})}async newSingleProperty(t,e,s,E){const i=nt.getIFCSchema(t),o=new Q[i].IfcIdentifier(s),r=new Q[i][e](E),c=new Q[i].IfcPropertySingleValue(o,null,r,null);return c.expressID=this.increaseMaxID(t),await this.setData(t,c),c}};d(nt,"uuid","58c2d9f0-183c-48d6-a402-dfcf5b9a34df");let Be=nt;const ps=new ne,Ms=ps.get(oe);await Ms.setup();const ui=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),Us=await ui.arrayBuffer(),ot=await Ms.load(new Uint8Array(Us)),Ot=ps.get(Be),{pset:ds}=await Ot.newPset(ot,"CalculatedQuantities"),fi=await Ot.newSingleNumericProperty(ot,"IfcReal","Volume",12.25);await Ot.addPropToPset(ot,ds.expressID,fi.expressID);await Ot.addElementToPset(ot,ds.expressID,186);const Pe=await ot.getProperties(186);Pe&&(Pe.Name.value="New Wall Name",await Ot.setData(ot,Pe));const Ni=await Ot.saveToIfc(ot,new Uint8Array(Us)),Ds=new File([Ni],"small-modified.ifc"),ve=document.createElement("a");ve.href=URL.createObjectURL(Ds);ve.download=Ds.name;URL.revokeObjectURL(ve.href); +- If you're using a platform tool, verify the uuid isn't misspelled or contact the tool creator.`)}};d(G,"_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}$/),d(G,"_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 se=G;const Ie=class Ie{constructor(){d(this,"onDisposed",new V);d(this,"list",new Map);d(this,"enabled",!1);d(this,"_clock");d(this,"update",()=>{if(!this.enabled)return;const n=this._clock.getDelta();for(const[t,e]of this.list)e.enabled&&e.isUpdateable()&&e.update(n);requestAnimationFrame(this.update)});this._clock=new Ys,Ie.setupBVH()}add(n,t){if(this.list.has(n))throw new Error("You're trying to add a component that already exists in the components instance. Use Components.get() instead.");se.validate(n),this.list.set(n,t)}get(n){const t=n.uuid;if(!this.list.has(t)){const e=new n(this);return this.list.has(t)||this.add(t,e),e}return this.list.get(t)}init(){this.enabled=!0,this._clock.start(),this.update()}dispose(){this.enabled=!1;for(const[n,t]of this.list)t.enabled=!1,t.isDisposeable()&&t.dispose();this._clock.stop(),this.onDisposed.trigger(),this.onDisposed.reset()}static setupBVH(){pe.prototype.computeBoundsTree=Ei,pe.prototype.disposeBoundsTree=oi,Cs.prototype.raycast=ii}};d(Ie,"release","2.1.11");let ne=Ie;const ri=new Map([[Ye,{forRelating:"IsDecomposedBy",forRelated:"Decomposes"}],[cs,{forRelating:"AssociatedTo",forRelated:"HasAssociations"}],[Ts,{forRelating:"ClassificationForObjects",forRelated:"HasAssociations"}],[Rs,{forRelating:"IsGroupedBy",forRelated:"HasAssignments"}],[xe,{forRelated:"IsDefinedBy",forRelating:"DefinesOcurrence"}],[ls,{forRelated:"IsTypedBy",forRelating:"Types"}],[Fs,{forRelated:"IsDefinedBy",forRelating:"Defines"}],[Ge,{forRelated:"ContainedInStructure",forRelating:"ContainsElements"}]]),mt=class mt extends Gt{constructor(t){super(t);d(this,"onDisposed",new V);d(this,"onRelationsIndexed",new V);d(this,"relationMaps",{});d(this,"enabled",!0);d(this,"_relToAttributesMap",ri);d(this,"_inverseAttributes",["IsDecomposedBy","Decomposes","AssociatedTo","HasAssociations","ClassificationForObjects","IsGroupedBy","HasAssignments","IsDefinedBy","DefinesOcurrence","IsTypedBy","Types","Defines","ContainedInStructure","ContainsElements"]);d(this,"_ifcRels",[Ye,cs,Ts,Rs,xe,ls,Fs,Ge]);d(this,"onFragmentsDisposed",t=>{delete this.relationMaps[t.groupID]});this.components.add(mt.uuid,this),t.get(Yt).onFragmentsDisposed.add(this.onFragmentsDisposed)}indexRelations(t,e,s,E){const i=Object.keys(e).find(a=>a.startsWith("Relating")),o=Object.keys(e).find(a=>a.startsWith("Related"));if(!(i&&o))return;const r=e[i].value,c=e[o].map(a=>a.value),C=t.get(r)??new Map,T=this.getAttributeIndex(E);T&&(C.set(T,c),t.set(r,C));for(const a of c){const R=t.get(a)??new Map,l=this.getAttributeIndex(s);if(!l)continue;const S=R.get(l)??[];S.push(r),R.set(l,S),t.set(a,R)}}getAttributeIndex(t){const e=this._inverseAttributes.indexOf(t);return e===-1?null:e}setRelationMap(t,e){this.relationMaps[t.uuid]=e,this.onRelationsIndexed.trigger({modelID:t.uuid,relationsMap:e})}async process(t){if(!t.hasProperties)throw new Error("FragmentsGroup properties not found");let e=this.relationMaps[t.uuid];if(e)return e;e=new Map;for(const s of this._ifcRels){const E=await t.getAllPropertiesOfType(s);if(!E)continue;const i=this._relToAttributesMap.get(s);if(!i)continue;const{forRelated:o,forRelating:r}=i;for(const c in E){const C=E[c];this.indexRelations(e,C,o,r)}}return this.setRelationMap(t,e),e}async processFromWebIfc(t,e){const s=new Map;for(const E of this._ifcRels){const i=this._relToAttributesMap.get(E);if(!i)continue;const{forRelated:o,forRelating:r}=i,c=t.GetLineIDsWithType(e,E);for(let C=0;C{}),i={},o=n.getAllPropertiesIDs();for(const c of o){const C=await n.getProperties(c);if(!C)continue;const T=C.type===t,a=Object.keys(C).find(F=>F.startsWith("Relating")),R=Object.keys(C).find(F=>F.startsWith("Related"));if(!(T&&a&&R))continue;const l=await n.getProperties((r=C[a])==null?void 0:r.value),S=C[R];if(!l||!S||!(S&&Array.isArray(S)))continue;const N=S.map(F=>F.value);await E(l.expressID,N),i[l.expressID]=N}return i}static async getQsetQuantities(n,t,e){const E=e??(()=>{}),i=await n.getProperties(t);return!i||i.type!==Gs?null:(i.Quantities??[{}]).map(c=>(c.value&&E(c.value),c.value)).filter(c=>c!==null)}static async getPsetProps(n,t,e){const E=e??(()=>{}),i=await n.getProperties(t);return!i||i.type!==Me?null:(i.HasProperties??[{}]).map(c=>(c.value&&E(c.value),c.value)).filter(c=>c!==null)}static async getPsetRel(n,t){var o;if(!await n.getProperties(t))return null;const s=await n.getAllPropertiesOfType(xe);if(!s)return null;const E=Object.values(s);let i=null;for(const r of E)((o=r.RelatingPropertyDefinition)==null?void 0:o.value)===t&&(i=r.expressID);return i}static async getQsetRel(n,t){return Ee.getPsetRel(n,t)}static async getEntityName(n,t){var i;const e=await n.getProperties(t);if(!e)return{key:null,name:null};const s=Object.keys(e).find(o=>o.endsWith("Name"))??null,E=s?(i=e[s])==null?void 0:i.value:null;return{key:s,name:E}}static async getQuantityValue(n,t){const e=await n.getProperties(t);if(!e)return{key:null,value:null};const s=Object.keys(e).find(i=>i.endsWith("Value"))??null;let E;return s===null||e[s]===void 0||e[s]===null?E=null:E=e[s].value,{key:s,value:E}}static isRel(n){return Ci[n].startsWith("IFCREL")}static async attributeExists(n,t,e){const s=await n.getProperties(t);return s?Object.keys(s).includes(e):!1}static async groupEntitiesByType(n,t){var s;const e=new Map;for(const E of t){const i=await n.getProperties(E);if(!i)continue;const o=i.type;e.get(o)||e.set(o,new Set),(s=e.get(o))==null||s.add(E)}return e}}class ci{constructor(){d(this,"factor",1);d(this,"complement",1)}apply(n){const e=this.getScaleMatrix().multiply(n);n.copy(e)}setUp(n){var E,i,o;this.factor=1;const t=this.getLengthUnits(n);if(!t)return;const e=t==null,s=t.Name===void 0||t.Name===null;e||s||(t.Name.value==="FOOT"&&(this.factor=.3048),((E=t.Prefix)==null?void 0:E.value)==="MILLI"?this.complement=.001:((i=t.Prefix)==null?void 0:i.value)==="CENTI"?this.complement=.01:((o=t.Prefix)==null?void 0:o.value)==="DECI"&&(this.complement=.01))}getLengthUnits(n){try{const e=n.GetLineIDsWithType(0,bs).get(0),s=n.GetLine(0,e);for(const E of s.Units){if(!E||E.value===null||E.value===void 0)continue;const i=n.GetLine(0,E.value);if(i.UnitType&&i.UnitType.value==="LENGTHUNIT")return i}return null}catch{return console.log("Could not get units"),null}}getScaleMatrix(){const n=this.factor;return new $().fromArray([n,0,0,0,0,n,0,0,0,0,n,0,0,0,0,1])}}class Ti{constructor(){d(this,"itemsByFloor",{});d(this,"_units",new ci)}setUp(n){this._units.setUp(n),this.cleanUp();try{const t=n.GetLineIDsWithType(0,Ge),e=new Set,s=n.GetLineIDsWithType(0,xt);for(let c=0;c{this.getMesh(i,e)});for(const i of this._visitedFragments){const{index:o,fragment:r}=i[1];e.keyFragments.set(o,r.id)}for(const i of e.items){const o=this._fragmentInstances.get(i.id);if(!o)throw new Error("Fragment not found!");const r=[];for(const[c,C]of o)r.push(C);i.add(r)}const E=this.webIfc.GetCoordinationMatrix(0);return e.coordinationMatrix.fromArray(E),e.civilData=this._civil.read(this.webIfc),e}getMesh(t,e){const s=t.geometries.size(),E=t.expressID;for(let i=0;io.value!==s),await t.setProperties(s,null),this.registerChange(t,e,s))}async addElementToPset(t,e,...s){const E=await Ee.getPsetRel(t,e);if(!E)return;const i=await t.getProperties(E);if(!i)return;for(const r of s){const c=new bt(r);i.RelatedObjects.push(c),this.onElementToPset.trigger({model:t,psetID:e,elementID:r})}this.registerChange(t,e);const o=this.components.get(ie);for(const r of s)o.addEntityRelations(t,r,"IsDefinedBy",e)}async addPropToPset(t,e,...s){const E=await t.getProperties(e);if(E){for(const i of s){if(E.HasProperties.includes(i))continue;const o=new bt(i);E.HasProperties.push(o),this.onPropToPset.trigger({model:t,psetID:e,propID:i})}this.registerChange(t,e)}}async saveToIfc(t,e){const s=this.components.get(oe),E=s.webIfc,i=await s.readIfcFile(e),o=this.changeMap[t.uuid]??[];for(const c of o){const C=await t.getProperties(c);if(C)try{E.WriteLine(i,C)}catch{}else try{E.DeleteLine(i,c)}catch{}}const r=E.SaveModel(i);return s.webIfc.CloseModel(i),s.cleanUp(),r}async setAttributeListener(t,e,s){this.attributeListeners[t.uuid]||(this.attributeListeners[t.uuid]={});const E=this.attributeListeners[t.uuid][e]?this.attributeListeners[t.uuid][e][s]:null;if(E)return E;const i=await t.getProperties(e);if(!i)throw new Error(`Entity with expressID ${e} doesn't exists.`);const o=i[s];if(Array.isArray(o)||!o)throw new Error(`Attribute ${s} is array or null, and it can't have a listener.`);const r=o.value;if(r===void 0||r==null)throw new Error(`Attribute ${s} has a badly defined handle.`);const c=new V;return Object.defineProperty(i[s],"value",{get(){return this._value},async set(C){this._value=C,c.trigger(C)}}),i[s].value=r,this.attributeListeners[t.uuid][e]||(this.attributeListeners[t.uuid][e]={}),this.attributeListeners[t.uuid][e][s]=c,c}increaseMaxID(t){return t.ifcMetadata.maxExpressID++,t.ifcMetadata.maxExpressID}newGUID(t){const e=nt.getIFCSchema(t);return new Q[e].IfcGloballyUniqueId(se.create())}async getOwnerHistory(t){const e=await t.getAllPropertiesOfType(tn);if(!e)throw new Error("No OwnerHistory was found.");const s=Object.keys(e).map(o=>parseInt(o,10)),E=e[s[0]],i=new bt(E.expressID);return{ownerHistory:E,ownerHistoryHandle:i}}registerChange(t,...e){this.changeMap[t.uuid]||(this.changeMap[t.uuid]=new Set);for(const s of e)this.changeMap[t.uuid].add(s),this.onDataChanged.trigger({model:t,expressID:s})}async newSingleProperty(t,e,s,E){const i=nt.getIFCSchema(t),o=new Q[i].IfcIdentifier(s),r=new Q[i][e](E),c=new Q[i].IfcPropertySingleValue(o,null,r,null);return c.expressID=this.increaseMaxID(t),await this.setData(t,c),c}};d(nt,"uuid","58c2d9f0-183c-48d6-a402-dfcf5b9a34df");let Be=nt;const ps=new ne,Ms=ps.get(oe);await Ms.setup();const ui=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),Us=await ui.arrayBuffer(),ot=await Ms.load(new Uint8Array(Us)),Ot=ps.get(Be),{pset:ds}=await Ot.newPset(ot,"CalculatedQuantities"),fi=await Ot.newSingleNumericProperty(ot,"IfcReal","Volume",12.25);await Ot.addPropToPset(ot,ds.expressID,fi.expressID);await Ot.addElementToPset(ot,ds.expressID,186);const Pe=await ot.getProperties(186);Pe&&(Pe.Name.value="New Wall Name",await Ot.setData(ot,Pe));const Ni=await Ot.saveToIfc(ot,new Uint8Array(Us)),Ds=new File([Ni],"small-modified.ifc"),ve=document.createElement("a");ve.href=URL.createObjectURL(Ds);ve.download=Ds.name;URL.revokeObjectURL(ve.href); diff --git a/examples/assets/ifcPropertiesTiler.js b/examples/assets/ifcPropertiesTiler.js index d439e8056..8ead7c06c 100644 --- a/examples/assets/ifcPropertiesTiler.js +++ b/examples/assets/ifcPropertiesTiler.js @@ -1,4 +1,4 @@ -import"./web-ifc-api-CfQNUy7g.js";import{S as b}from"./stats.min-BpIepu9J.js";import{m as w,t as f,a as u}from"./index-tywNknxv.js";import{p as y,C as g,i as h,n as B,W as F,d as L,h as S,$ as U,a as k}from"./index-D2xchnNe.js";const v=document.getElementById("container"),s=new y,x=s.get(g),n=x.create();n.scene=new h(s);n.renderer=new B(s,v);n.camera=new F(s);s.init();n.camera.controls.setLookAt(12,6,8,0,0,-10);n.scene.setup();const I=s.get(L);I.create(n);n.scene.three.background=null;const R=new S(s),A=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),P=await A.arrayBuffer(),$=new Uint8Array(P),j=R.load($);n.scene.three.add(j);function C(e,o){const t=new File([o],e),a=document.createElement("a"),p=URL.createObjectURL(t);a.href=p,a.download=t.name,a.click(),URL.revokeObjectURL(p)}async function O(e){for(const{name:o,bits:t}of e)C(o,t),await new Promise(a=>{setTimeout(a,100)})}const c=s.get(U);c.settings.wasm={path:"https://unpkg.com/web-ifc@0.0.55/",absolute:!0};const r={types:{},ids:{},indexesFile:"small.ifc-processed-properties-indexes"};let l=0;const d=[];c.onPropertiesStreamed.add(async e=>{r.types[e.type]||(r.types[e.type]=[]),r.types[e.type].push(l);for(const a in e.data)r.ids[a]=l;const o=`small.ifc-processed-properties-${l}`,t=new Blob([JSON.stringify(e.data)]);d.push({bits:t,name:o}),l++});c.onProgress.add(async e=>{console.log(e)});c.onIndicesStreamed.add(async e=>{d.push({name:"small.ifc-processed-properties.json",bits:new Blob([JSON.stringify(r)])});const t=s.get(k).serializeRelations(e);d.push({name:"small.ifc-processed-properties-indexes",bits:new Blob([t])}),await O(d)});async function z(){const o=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),t=new Uint8Array(o);await c.streamFromBuffer(t)}const i=new b;i.showPanel(2);document.body.append(i.dom);i.dom.style.left="0px";i.dom.style.zIndex="unset";n.renderer.onBeforeUpdate.add(()=>i.begin());n.renderer.onAfterUpdate.add(()=>i.end());w.init();const m=f.create(()=>u` +import"./web-ifc-api-CfQNUy7g.js";import{S as b}from"./stats.min-BpIepu9J.js";import{m as w,t as f,a as u}from"./index-tywNknxv.js";import{p as y,C as g,i as h,n as B,W as F,d as L,h as S,$ as U,a as k}from"./index-CrrO1BJs.js";const v=document.getElementById("container"),s=new y,x=s.get(g),n=x.create();n.scene=new h(s);n.renderer=new B(s,v);n.camera=new F(s);s.init();n.camera.controls.setLookAt(12,6,8,0,0,-10);n.scene.setup();const I=s.get(L);I.create(n);n.scene.three.background=null;const R=new S(s),A=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),P=await A.arrayBuffer(),$=new Uint8Array(P),j=R.load($);n.scene.three.add(j);function C(e,o){const t=new File([o],e),a=document.createElement("a"),p=URL.createObjectURL(t);a.href=p,a.download=t.name,a.click(),URL.revokeObjectURL(p)}async function O(e){for(const{name:o,bits:t}of e)C(o,t),await new Promise(a=>{setTimeout(a,100)})}const c=s.get(U);c.settings.wasm={path:"https://unpkg.com/web-ifc@0.0.55/",absolute:!0};const r={types:{},ids:{},indexesFile:"small.ifc-processed-properties-indexes"};let l=0;const d=[];c.onPropertiesStreamed.add(async e=>{r.types[e.type]||(r.types[e.type]=[]),r.types[e.type].push(l);for(const a in e.data)r.ids[a]=l;const o=`small.ifc-processed-properties-${l}`,t=new Blob([JSON.stringify(e.data)]);d.push({bits:t,name:o}),l++});c.onProgress.add(async e=>{console.log(e)});c.onIndicesStreamed.add(async e=>{d.push({name:"small.ifc-processed-properties.json",bits:new Blob([JSON.stringify(r)])});const t=s.get(k).serializeRelations(e);d.push({name:"small.ifc-processed-properties-indexes",bits:new Blob([t])}),await O(d)});async function z(){const o=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),t=new Uint8Array(o);await c.streamFromBuffer(t)}const i=new b;i.showPanel(2);document.body.append(i.dom);i.dom.style.left="0px";i.dom.style.zIndex="unset";n.renderer.onBeforeUpdate.add(()=>i.begin());n.renderer.onAfterUpdate.add(()=>i.end());w.init();const m=f.create(()=>u` diff --git a/examples/assets/ifcRelationsIndexer.js b/examples/assets/ifcRelationsIndexer.js index 9d1bac235..e4e9274b6 100644 --- a/examples/assets/ifcRelationsIndexer.js +++ b/examples/assets/ifcRelationsIndexer.js @@ -1,4 +1,4 @@ -import"./web-ifc-api-CfQNUy7g.js";import{S as g}from"./stats.min-BpIepu9J.js";import{m as f,t as m,a as u}from"./index-tywNknxv.js";import{p as w,C as y,i as h,n as R,W as x,d as I,b as L,a as S,K as U}from"./index-D2xchnNe.js";const k=document.getElementById("container"),n=new w,v=n.get(y),t=v.create();t.scene=new h(n);t.renderer=new R(n,k);t.camera=new x(n);n.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const P=n.get(I);P.create(t);t.scene.three.background=null;const b=n.get(L);await b.setup();const j=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),A=await j.arrayBuffer(),C=new Uint8Array(A),e=await b.load(C);t.scene.three.add(e);const o=n.get(S);await o.process(e);const p=o.getEntityRelations(e,6518,"IsDefinedBy");if(p)for(const s of p){const c=await e.getProperties(s);console.log(c),await U.getPsetProps(e,s,async l=>{const a=await e.getProperties(l);console.log(a)})}const O=(s,c)=>{const l=new File([s],c),a=document.createElement("a");a.href=URL.createObjectURL(l),a.download=l.name,a.click(),URL.revokeObjectURL(a.href)},B=o.serializeModelRelations(e);console.log(B);const E=o.serializeAllRelations();delete o.relationMaps[e.uuid];const F=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),M=o.getRelationsMapFromJSON(await F.text());o.setRelationMap(e,M);const d=o.getEntityRelations(e,6518,"ContainedInStructure");if(d&&d[0]){const s=await e.getProperties(d[0]);console.log(s)}const i=new g;i.showPanel(2);document.body.append(i.dom);i.dom.style.left="0px";i.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>i.begin());t.renderer.onAfterUpdate.add(()=>i.end());f.init();const r=m.create(()=>u` +import"./web-ifc-api-CfQNUy7g.js";import{S as g}from"./stats.min-BpIepu9J.js";import{m as f,t as m,a as u}from"./index-tywNknxv.js";import{p as w,C as y,i as h,n as R,W as x,d as I,b as L,a as S,K as U}from"./index-CrrO1BJs.js";const k=document.getElementById("container"),n=new w,v=n.get(y),t=v.create();t.scene=new h(n);t.renderer=new R(n,k);t.camera=new x(n);n.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const P=n.get(I);P.create(t);t.scene.three.background=null;const b=n.get(L);await b.setup();const j=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),A=await j.arrayBuffer(),C=new Uint8Array(A),e=await b.load(C);t.scene.three.add(e);const o=n.get(S);await o.process(e);const p=o.getEntityRelations(e,6518,"IsDefinedBy");if(p)for(const s of p){const c=await e.getProperties(s);console.log(c),await U.getPsetProps(e,s,async l=>{const a=await e.getProperties(l);console.log(a)})}const O=(s,c)=>{const l=new File([s],c),a=document.createElement("a");a.href=URL.createObjectURL(l),a.download=l.name,a.click(),URL.revokeObjectURL(a.href)},B=o.serializeModelRelations(e);console.log(B);const E=o.serializeAllRelations();delete o.relationMaps[e.uuid];const F=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),M=o.getRelationsMapFromJSON(await F.text());o.setRelationMap(e,M);const d=o.getEntityRelations(e,6518,"ContainedInStructure");if(d&&d[0]){const s=await e.getProperties(d[0]);console.log(s)}const i=new g;i.showPanel(2);document.body.append(i.dom);i.dom.style.left="0px";i.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>i.begin());t.renderer.onAfterUpdate.add(()=>i.end());f.init();const r=m.create(()=>u` diff --git a/examples/assets/ifcStreamer.js b/examples/assets/ifcStreamer.js index 8e79c375e..690424a21 100644 --- a/examples/assets/ifcStreamer.js +++ b/examples/assets/ifcStreamer.js @@ -1 +1 @@ -import"./web-ifc-api-CfQNUy7g.js";import{S as d}from"./stats.min-BpIepu9J.js";import{p as l,C as m,i as p,n as u,W as w,d as g}from"./index-D2xchnNe.js";import{x as h}from"./index-Bpjba_Wq.js";const f=document.getElementById("container"),o=new l,b=o.get(m),e=b.create();e.scene=new p(o);e.renderer=new u(o,f);e.camera=new w(o);o.init();e.scene.setup();e.camera.controls.setLookAt(12,6,8,0,0,-10);const y=o.get(g);y.create(e);e.scene.three.background=null;const t=o.get(h);t.world=e;t.dbCleaner.enabled=!0;t.url="https://thatopen.github.io/engine_components/resources/streaming/";async function x(s,r){const c=await(await fetch(s)).json();let a;a=await(await fetch(r)).json();const i=await t.load(c,!0,a);console.log(i)}await x("https://thatopen.github.io/engine_components/resources/streaming/small.ifc-processed.json","https://thatopen.github.io/engine_components/resources/streaming/small.ifc-processed-properties.json");e.camera.controls.addEventListener("sleep",()=>{t.culler.needsUpdate=!0});t.useCache=!0;t.culler.threshold=10;t.culler.maxHiddenTime=1e3;t.culler.maxLostTime=3e3;const n=new d;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()); +import"./web-ifc-api-CfQNUy7g.js";import{S as l}from"./stats.min-BpIepu9J.js";import{p as i,C as m,i as p,n as u,W as w,d as f}from"./index-CrrO1BJs.js";import{x as h}from"./index-BREiuDZQ.js";const g=document.getElementById("container"),a=new i,y=a.get(m),e=y.create();e.scene=new p(a);e.renderer=new u(a,g);e.camera=new w(a);a.init();e.scene.setup();e.camera.controls.setLookAt(12,6,8,0,0,-10);const x=a.get(f);x.create(e);e.scene.three.background=null;const t=a.get(h);t.world=e;t.dbCleaner.enabled=!0;t.url="../../../../../resources/umdasch/";async function D(s,n){const c=await(await fetch(s)).json();let r;r=await(await fetch(n)).json();const d=await t.load(c,!0,r);console.log(d)}await D("../../../../../resources/umdasch/small.ifc-processed.json","../../../../../resources/umdasch/small.ifc-processed-properties.json");e.camera.controls.addEventListener("sleep",()=>{t.culler.needsUpdate=!0});t.useCache=!0;t.culler.threshold=10;t.culler.maxHiddenTime=1e3;t.culler.maxLostTime=3e3;const o=new l;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end()); diff --git a/examples/assets/index-Bpjba_Wq.js b/examples/assets/index-BREiuDZQ.js similarity index 84% rename from examples/assets/index-Bpjba_Wq.js rename to examples/assets/index-BREiuDZQ.js index 67f4b86dd..388535373 100644 --- a/examples/assets/index-Bpjba_Wq.js +++ b/examples/assets/index-BREiuDZQ.js @@ -2,7 +2,7 @@ import{r as yt,s as Ke,T as zs,t as Vr,E as Sh,c as me,U as Na,u as Pr,v as An,S - 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.`)}};x(ga,"_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}$/),x(ga,"_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 ja=ga;class jf extends Re{constructor(e,t){super(e),x(this,"onDisposed",new $),x(this,"onVertexFound",new $),x(this,"onVertexLost",new $),x(this,"onEnabled",new $),x(this,"components"),x(this,"workingPlane",null),x(this,"_pickedPoint",null),x(this,"_config"),x(this,"_enabled",!1),this.components=e,this.config={snapDistance:.25,showOnlyVertex:!1,...t},this.enabled=!1}set enabled(e){this._enabled=e,e||(this._pickedPoint=null),this.onEnabled.trigger(e)}get enabled(){return this._enabled}set config(e){this._config={...this._config,...e}}get config(){return this._config}dispose(){this.onVertexFound.reset(),this.onVertexLost.reset(),this.components=null,this.onDisposed.trigger(),this.onDisposed.reset()}get(e){if(!this.enabled)return this._pickedPoint;const t=this.components.get(Bt).get(e).castRay();if(!t)return this._pickedPoint!==null&&(this.onVertexLost.trigger(),this._pickedPoint=null),this._pickedPoint;const s=this.getClosestVertex(t);return s?!this.workingPlane||Math.abs(this.workingPlane.distanceToPoint(s))<.001?((this._pickedPoint===null||!this._pickedPoint.equals(s))&&(this._pickedPoint=s.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,s=!1,n=Number.MAX_SAFE_INTEGER;const i=this.getVertices(e);if(i===null)return null;for(const r of i){if(!r)continue;const o=e.point.distanceTo(r);o>n||o>this._config.snapDistance||(s=!0,t=r,n=e.point.distanceTo(r))}return s?t:this.config.showOnlyVertex?null:e.point}getVertices(e){const t=e.object;if(!e.face||!t)return null;const s=t.geometry,n=new me,{instanceId:i}=e,r=i!==void 0,o=t instanceof It;return o&&r&&t.getMatrixAt(i,n),[this.getVertex(e.face.a,s),this.getVertex(e.face.b,s),this.getVertex(e.face.c,s)].map(l=>(l&&(o&&r&&l.applyMatrix4(n),l.applyMatrix4(t.matrixWorld)),l))}getVertex(e,t){if(e===void 0)return null;const s=t.attributes.position;return new O(s.getX(e),s.getY(e),s.getZ(e))}}const Zh=class Xh{constructor(){x(this,"onDisposed",new $),x(this,"list",new Map),x(this,"enabled",!1),x(this,"_clock"),x(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 Fh,Xh.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 instance. Use Components.get() instead.");ja.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(){De.prototype.computeBoundsTree=Df,De.prototype.disposeBoundsTree=Lf,ie.prototype.raycast=Mf}};x(Zh,"release","2.1.9");let Zf=Zh;class Xf{constructor(e){x(this,"_event"),x(this,"_position",new ke),x(this,"onDisposed",new $),x(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("pointermove",this.updateMouseInfo):this.dom.removeEventListener("pointermove",this.updateMouseInfo)}}class Qf{constructor(e,t){x(this,"enabled",!0),x(this,"components"),x(this,"onDisposed",new $),x(this,"mouse"),x(this,"three",new Vr),x(this,"world");const s=t.renderer;if(!s)throw new Error("A renderer is needed for the raycaster to work!");this.world=t,this.mouse=new Xf(s.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,s=Array.from(this.world.meshes)){return this.three.set(e,t),this.intersect(s)}intersect(e=Array.from(this.world.meshes)){const t=this.three.intersectObjects(e),s=this.filterClippingPlanes(t);return s.length>0?s[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 s=t.clippingPlanes;return e.length<=0||!s||(s==null?void 0:s.length)<=0?e:e.filter(n=>s.every(i=>i.distanceToPoint(n.point)>0))}}const Qh=class qh extends Re{constructor(e){super(e),x(this,"enabled",!0),x(this,"list",new Map),x(this,"onDisposed",new $),e.add(qh.uuid,this)}get(e){if(this.list.has(e.uuid))return this.list.get(e.uuid);const t=new Qf(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()}};x(Qh,"uuid","d5d8bdf0-db25-4952-b951-b643af207ace");let Bt=Qh;class qf extends Wa{constructor(){super(...arguments),x(this,"meshes",new Set),x(this,"onAfterUpdate",new $),x(this,"onBeforeUpdate",new $),x(this,"onDisposed",new $),x(this,"isDisposing",!1),x(this,"enabled",!0),x(this,"uuid",ja.create()),x(this,"name"),x(this,"_scene"),x(this,"_camera"),x(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.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"}),e){const t=this.components.get(hs);this.scene.dispose(),this.camera.isDisposeable()&&this.camera.dispose(),this.renderer&&this.renderer.dispose();for(const s of this.meshes)t.destroy(s);this.meshes.clear()}this._scene=null,this._camera=null,this._renderer=null,this.onDisposed.trigger()}}class Jf extends _f{constructor(e,t,s){super(e),x(this,"enabled",!0),x(this,"container"),x(this,"three"),x(this,"_canvas"),x(this,"_parameters"),x(this,"_resizeObserver",null),x(this,"onContainerUpdated",new $),x(this,"_resizing",!1),x(this,"resize",r=>{if(this._resizing)return;this._resizing=!0,this.onContainerUpdated.trigger();const o=r?r.x:this.container.clientWidth,l=r?r.y:this.container.clientHeight;this.three.setSize(o,l),this.onResize.trigger(new ke(o,l)),this._resizing=!1}),x(this,"resizeEvent",()=>{this.resize()}),x(this,"onContextLost",r=>{r.preventDefault(),this.enabled=!1}),x(this,"onContextBack",()=>{this.three.setRenderTarget(null),this.three.dispose(),this.three=new Nr({canvas:this._canvas,antialias:!0,alpha:!0,...this._parameters}),this.enabled=!0}),this.container=t,this._parameters=s,this.three=new Nr({antialias:!0,alpha:!0,...s}),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:i}=n;i.addEventListener("webglcontextlost",this.onContextLost,!1),i.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 ke(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.`)}};x(ga,"_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}$/),x(ga,"_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 ja=ga;class jf extends Re{constructor(e,t){super(e),x(this,"onDisposed",new $),x(this,"onVertexFound",new $),x(this,"onVertexLost",new $),x(this,"onEnabled",new $),x(this,"components"),x(this,"workingPlane",null),x(this,"_pickedPoint",null),x(this,"_config"),x(this,"_enabled",!1),this.components=e,this.config={snapDistance:.25,showOnlyVertex:!1,...t},this.enabled=!1}set enabled(e){this._enabled=e,e||(this._pickedPoint=null),this.onEnabled.trigger(e)}get enabled(){return this._enabled}set config(e){this._config={...this._config,...e}}get config(){return this._config}dispose(){this.onVertexFound.reset(),this.onVertexLost.reset(),this.components=null,this.onDisposed.trigger(),this.onDisposed.reset()}get(e){if(!this.enabled)return this._pickedPoint;const t=this.components.get(Bt).get(e).castRay();if(!t)return this._pickedPoint!==null&&(this.onVertexLost.trigger(),this._pickedPoint=null),this._pickedPoint;const s=this.getClosestVertex(t);return s?!this.workingPlane||Math.abs(this.workingPlane.distanceToPoint(s))<.001?((this._pickedPoint===null||!this._pickedPoint.equals(s))&&(this._pickedPoint=s.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,s=!1,n=Number.MAX_SAFE_INTEGER;const i=this.getVertices(e);if(i===null)return null;for(const r of i){if(!r)continue;const o=e.point.distanceTo(r);o>n||o>this._config.snapDistance||(s=!0,t=r,n=e.point.distanceTo(r))}return s?t:this.config.showOnlyVertex?null:e.point}getVertices(e){const t=e.object;if(!e.face||!t)return null;const s=t.geometry,n=new me,{instanceId:i}=e,r=i!==void 0,o=t instanceof It;return o&&r&&t.getMatrixAt(i,n),[this.getVertex(e.face.a,s),this.getVertex(e.face.b,s),this.getVertex(e.face.c,s)].map(l=>(l&&(o&&r&&l.applyMatrix4(n),l.applyMatrix4(t.matrixWorld)),l))}getVertex(e,t){if(e===void 0)return null;const s=t.attributes.position;return new O(s.getX(e),s.getY(e),s.getZ(e))}}const Zh=class Xh{constructor(){x(this,"onDisposed",new $),x(this,"list",new Map),x(this,"enabled",!1),x(this,"_clock"),x(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 Fh,Xh.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 instance. Use Components.get() instead.");ja.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(){De.prototype.computeBoundsTree=Df,De.prototype.disposeBoundsTree=Lf,ie.prototype.raycast=Mf}};x(Zh,"release","2.1.11");let Zf=Zh;class Xf{constructor(e){x(this,"_event"),x(this,"_position",new ke),x(this,"onDisposed",new $),x(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("pointermove",this.updateMouseInfo):this.dom.removeEventListener("pointermove",this.updateMouseInfo)}}class Qf{constructor(e,t){x(this,"enabled",!0),x(this,"components"),x(this,"onDisposed",new $),x(this,"mouse"),x(this,"three",new Vr),x(this,"world");const s=t.renderer;if(!s)throw new Error("A renderer is needed for the raycaster to work!");this.world=t,this.mouse=new Xf(s.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,s=Array.from(this.world.meshes)){return this.three.set(e,t),this.intersect(s)}intersect(e=Array.from(this.world.meshes)){const t=this.three.intersectObjects(e),s=this.filterClippingPlanes(t);return s.length>0?s[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 s=t.clippingPlanes;return e.length<=0||!s||(s==null?void 0:s.length)<=0?e:e.filter(n=>s.every(i=>i.distanceToPoint(n.point)>0))}}const Qh=class qh extends Re{constructor(e){super(e),x(this,"enabled",!0),x(this,"list",new Map),x(this,"onDisposed",new $),e.add(qh.uuid,this)}get(e){if(this.list.has(e.uuid))return this.list.get(e.uuid);const t=new Qf(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()}};x(Qh,"uuid","d5d8bdf0-db25-4952-b951-b643af207ace");let Bt=Qh;class qf extends Wa{constructor(){super(...arguments),x(this,"meshes",new Set),x(this,"onAfterUpdate",new $),x(this,"onBeforeUpdate",new $),x(this,"onDisposed",new $),x(this,"isDisposing",!1),x(this,"enabled",!0),x(this,"uuid",ja.create()),x(this,"name"),x(this,"_scene"),x(this,"_camera"),x(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.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"}),e){const t=this.components.get(hs);this.scene.dispose(),this.camera.isDisposeable()&&this.camera.dispose(),this.renderer&&this.renderer.dispose();for(const s of this.meshes)t.destroy(s);this.meshes.clear()}this._scene=null,this._camera=null,this._renderer=null,this.onDisposed.trigger()}}class Jf extends _f{constructor(e,t,s){super(e),x(this,"enabled",!0),x(this,"container"),x(this,"three"),x(this,"_canvas"),x(this,"_parameters"),x(this,"_resizeObserver",null),x(this,"onContainerUpdated",new $),x(this,"_resizing",!1),x(this,"resize",r=>{if(this._resizing)return;this._resizing=!0,this.onContainerUpdated.trigger();const o=r?r.x:this.container.clientWidth,l=r?r.y:this.container.clientHeight;this.three.setSize(o,l),this.onResize.trigger(new ke(o,l)),this._resizing=!1}),x(this,"resizeEvent",()=>{this.resize()}),x(this,"onContextLost",r=>{r.preventDefault(),this.enabled=!1}),x(this,"onContextBack",()=>{this.three.setRenderTarget(null),this.three.dispose(),this.three=new Nr({canvas:this._canvas,antialias:!0,alpha:!0,...this._parameters}),this.enabled=!0}),this.container=t,this._parameters=s,this.three=new Nr({antialias:!0,alpha:!0,...s}),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:i}=n;i.addEventListener("webglcontextlost",this.onContextLost,!1),i.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 ke(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 @@ -85,7 +85,7 @@ import{r as yt,s as Ke,T as zs,t as Vr,E as Sh,c as me,U as Na,u as Pr,v as An,S } postMessage({ colors }); }); - `,i=new Blob([n],{type:"application/javascript"});this.worker=new Worker(URL.createObjectURL(i))}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[s,n,i]=t,r=`${s}-${n}-${i}`;return{r:s,g:n,b:i,code:r}}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 Ep extends ic{constructor(e,t,s){super(e,t,s),x(this,"onViewUpdated",new $),x(this,"threshold",100),x(this,"colorMeshes",new Map),x(this,"isProcessing",!1),x(this,"_colorCodeMeshMap",new Map),x(this,"_meshIDColorCodeMap",new Map),x(this,"_currentVisibleMeshes",new Set),x(this,"_recentlyHiddenMeshes",new Set),x(this,"_intervalID",null),x(this,"_transparentMat",new Ct({transparent:!0,opacity:0})),x(this,"handleWorkerMessage",async n=>{if(this.isProcessing)return;const i=n.data.colors;this._recentlyHiddenMeshes=new Set(this._currentVisibleMeshes),this._currentVisibleMeshes.clear();for(const[r,o]of i){if(o{this.isProcessing||await this.updateVisibility()},this.updateInterval),this.onViewUpdated.add(({seen:n,unseen:i})=>{for(const r of n)r.visible=!0;for(const r of i)r.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(hs);for(const t in this.colorMeshes){const s=this.colorMeshes.get(t);s&&e.destroy(s,!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 It,{geometry:s,material:n}=e,{colorMaterial:i,code:r}=this.getAvailableMaterial();let o;if(Array.isArray(n)){let u=!0;const p=[];for(const m of n)$l.isTransparent(m)?p.push(this._transparentMat):(u=!1,p.push(i));if(u){i.dispose(),this.isProcessing=!1;return}o=p}else if($l.isTransparent(n)){i.dispose(),this.isProcessing=!1;return}else o=i;this._colorCodeMeshMap.set(r,e),this._meshIDColorCodeMap.set(e.uuid,r);const l=t?e.count:1,c=new It(s,o,l);t?c.instanceMatrix=e.instanceMatrix:c.setMatrixAt(0,new me),e.visible=!1,e.updateWorldMatrix(!0,!1),c.applyMatrix4(e.matrixWorld),c.updateMatrix(),this.scene.add(c),this.colorMeshes.set(e.uuid,c),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(hs);this._currentVisibleMeshes.delete(e),this._recentlyHiddenMeshes.delete(e);const s=this.colorMeshes.get(e.uuid),n=this._meshIDColorCodeMap.get(e.uuid);if(!s||!n){this.isProcessing=!1;return}this._colorCodeMeshMap.delete(n),this._meshIDColorCodeMap.delete(e.uuid),this.colorMeshes.delete(e.uuid),s.geometry=void 0,s.material=[],t.destroy(s,!0),this._recentlyHiddenMeshes.delete(e),this._currentVisibleMeshes.delete(e),this.isProcessing=!1}getAvailableMaterial(){const{r:e,g:t,b:s,code:n}=this.getAvailableColor(),i=os.enabled;os.enabled=!1;const r=new gt(`rgb(${e}, ${t}, ${s})`);if(!this.world.renderer)throw new Error("Renderer not found in the world!");const o=this.world.renderer.clippingPlanes,l=new Ct({color:r,clippingPlanes:o,side:Ii});return os.enabled=i,{colorMaterial:l,code:n}}}const rc=class va extends Re{constructor(e){super(e),x(this,"onDisposed",new $),x(this,"_enabled",!0),x(this,"list",new Map),e.add(va.uuid,this)}get enabled(){return this._enabled}set enabled(e){this._enabled=e;for(const[t,s]of this.list)s.enabled=e}create(e,t){if(this.list.has(e.uuid))return this.list.get(e.uuid);const s=new Ep(this.components,e,t);return this.list.set(e.uuid,s),s}delete(e){const t=this.list.get(e.uuid);t&&t.dispose(),this.list.delete(e.uuid)}dispose(){this.enabled=!1,this.onDisposed.trigger(va.uuid),this.onDisposed.reset();for(const[e,t]of this.list)t.dispose();this.list.clear()}};x(rc,"uuid","69f2a50d-c266-44fc-b1bd-fa4d34be89e6");let vp=rc;class wp{constructor(e){if(x(this,"onDisposed",new $),x(this,"onAfterUpdate",new $),x(this,"onBeforeUpdate",new $),x(this,"onResize",new $),x(this,"frontOffset",0),x(this,"overrideMaterial",new zh),x(this,"backgroundColor",new gt(395274)),x(this,"renderer"),x(this,"enabled",!0),x(this,"world"),x(this,"_lockRotation",!0),x(this,"_camera"),x(this,"_plane"),x(this,"_size",new ke(320,160)),x(this,"_tempVector1",new O),x(this,"_tempVector2",new O),x(this,"_tempTarget",new O),x(this,"down",new O(0,-1,0)),x(this,"updatePlanes",()=>{if(!this.world.renderer)throw new Error("The given world must have a renderer!");const n=[],i=this.world.renderer.three;for(const r of i.clippingPlanes)n.push(r);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 Nr,this.renderer.setSize(this._size.x,this._size.y);const t=1,s=this._size.x/this._size.y;this._camera=new Sn(t*s/-2,t*s/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 bs(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 Ws))throw new Error("The given world must have a THREE.Scene as a root!");const s=t.controls;if(s.getPosition(this._tempVector1),this._camera.position.x=this._tempVector1.x,this._camera.position.z=this._tempVector1.z,this.frontOffset!==0&&(s.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){s.getTarget(this._tempTarget);const i=Math.atan2(this._tempTarget.x-this._tempVector1.x,this._tempTarget.z-this._tempVector1.z);this._camera.rotation.z=i+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,s=1;this._camera.left=s*t/-2,this._camera.right=s*t/2,this._camera.top=s/2,this._camera.bottom=-s/2,this._camera.updateProjectionMatrix(),this.onResize.trigger(e)}}const yp=class oc extends Re{constructor(e){super(e),x(this,"onAfterUpdate",new $),x(this,"onBeforeUpdate",new $),x(this,"onDisposed",new $),x(this,"enabled",!0),x(this,"list",new Map),this.components.add(oc.uuid,this)}create(e){if(this.list.has(e.uuid))throw new Error("This world already has a minimap!");const t=new wp(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()}};x(yp,"uuid","39ad6aad-84c8-4adf-a1e0-7f25313a9e7f");const Ip=new Map([[_a,{forRelating:"IsDecomposedBy",forRelated:"Decomposes"}],[Ph,{forRelating:"AssociatedTo",forRelated:"HasAssociations"}],[Oh,{forRelating:"ClassificationForObjects",forRelated:"HasAssociations"}],[Mh,{forRelating:"IsGroupedBy",forRelated:"HasAssignments"}],[Ua,{forRelated:"IsDefinedBy",forRelating:"DefinesOcurrence"}],[Dh,{forRelated:"IsTypedBy",forRelating:"Types"}],[Lh,{forRelated:"IsDefinedBy",forRelating:"Defines"}],[Ba,{forRelated:"ContainedInStructure",forRelating:"ContainsElements"}]]),ac=class wa extends Re{constructor(e){super(e),x(this,"onDisposed",new $),x(this,"onRelationsIndexed",new $),x(this,"relationMaps",{}),x(this,"enabled",!0),x(this,"_relToAttributesMap",Ip),x(this,"_inverseAttributes",["IsDecomposedBy","Decomposes","AssociatedTo","HasAssociations","ClassificationForObjects","IsGroupedBy","HasAssignments","IsDefinedBy","DefinesOcurrence","IsTypedBy","Types","Defines","ContainedInStructure","ContainsElements"]),x(this,"_ifcRels",[_a,Ph,Oh,Mh,Ua,Dh,Lh,Ba]),x(this,"onFragmentsDisposed",t=>{delete this.relationMaps[t.groupID]}),this.components.add(wa.uuid,this),e.get(Ue).onFragmentsDisposed.add(this.onFragmentsDisposed)}indexRelations(e,t,s,n){const i=Object.keys(t).find(p=>p.startsWith("Relating")),r=Object.keys(t).find(p=>p.startsWith("Related"));if(!(i&&r))return;const o=t[i].value,l=t[r].map(p=>p.value),c=e.get(o)??new Map,u=this.getAttributeIndex(n);u&&(c.set(u,l),e.set(o,c));for(const p of l){const m=e.get(p)??new Map,E=this.getAttributeIndex(s);if(!E)continue;const v=m.get(E)??[];v.push(o),m.set(E,v),e.set(p,m)}}getAttributeIndex(e){const t=this._inverseAttributes.indexOf(e);return t===-1?null:t}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 s of this._ifcRels){const n=await e.getAllPropertiesOfType(s);if(!n)continue;const i=this._relToAttributesMap.get(s);if(!i)continue;const{forRelated:r,forRelating:o}=i;for(const l in n){const c=n[l];this.indexRelations(t,c,r,o)}}return this.setRelationMap(e,t),t}async processFromWebIfc(e,t){const s=new Map;for(const n of this._ifcRels){const i=this._relToAttributesMap.get(n);if(!i)continue;const{forRelated:r,forRelating:o}=i,l=e.GetLineIDsWithType(t,n);for(let c=0;cn.x&&(n.x=r.x),r.y>n.y&&(n.y=r.y),r.z>n.z&&(n.z=r.z);return new Ke(t,s)}dispose(){const e=this.components.get(hs);for(const t of this._meshes)e.destroy(t);this._meshes=[],this.onDisposed.trigger(is.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(),s=Math.abs((t.x-e.x)/2),n=Math.abs((t.y-e.y)/2),i=Math.abs((t.z-e.z)/2),r=new O(e.x+s,e.y+n,e.z+i),o=r.distanceTo(e);return new Rn(r,o)}getMesh(){const e=new Ke(this._absoluteMin,this._absoluteMax),t=is.getDimensions(e),{width:s,height:n,depth:i,center:r}=t,o=new tt(s,n,i),l=new ie(o);return this._meshes.push(l),l.position.copy(r),l}reset(){this._absoluteMin=is.newBound(!0),this._absoluteMax=is.newBound(!1)}add(e){for(const t of e.items)this.addMesh(t.mesh)}addMesh(e,t){if(!e.geometry.index)return;const s=is.getFragmentBounds(e);e.updateMatrixWorld();const n=e.matrixWorld,i=new me,r=e instanceof It,o=new Set;if(t&&e instanceof _h)for(const l of t){const c=e.fragment.getInstancesIDs(l);if(c)for(const u of c)o.add(u)}else o.add(0);for(const l of o){const c=s.min.clone(),u=s.max.clone();r&&(e.getMatrixAt(l,i),c.applyMatrix4(i),u.applyMatrix4(i)),c.applyMatrix4(n),u.applyMatrix4(n),c.xthis._absoluteMax.x&&(this._absoluteMax.x=c.x),c.y>this._absoluteMax.y&&(this._absoluteMax.y=c.y),c.z>this._absoluteMax.z&&(this._absoluteMax.z=c.z),u.x>this._absoluteMax.x&&(this._absoluteMax.x=u.x),u.y>this._absoluteMax.y&&(this._absoluteMax.y=u.y),u.z>this._absoluteMax.z&&(this._absoluteMax.z=u.z),u.xr.x&&(r.x=u),p>r.y&&(r.y=p),m>r.z&&(r.z=m)}return new Ke(i,r)}};x(cc,"uuid","d1444724-dba6-4cdd-a0c7-68ee1450d166");let ya=cc;const dc=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,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]),uc=class fc extends Re{constructor(e){super(e),x(this,"enabled",!0),e.add(fc.uuid,this)}async export(e,t,s=!1,n=!0){const i={},r=new Set(e.GetIfcEntityList(t)),o=new Set([ka,za,Ya,Hr,js]);for(const l of o)r.add(l);for(const l of r){if(dc.has(l))continue;const c=o.has(l)&&n,u=e.GetLineIDsWithType(t,l);for(const p of u){const m=e.GetLine(0,p,c,s);i[m.expressID]=m}}return i}};x(uc,"uuid","b32c4332-cd67-436e-ba7f-196646c7a635");let Cp=uc;const pc={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 Cs{static async getUnits(e){var t,s,n;const{IFCUNITASSIGNMENT:i}=ss,r=await e.getAllPropertiesOfType(i);if(!r)return 1;const o=Object.keys(r),l=r[parseInt(o[0],10)];for(const c of l.Units){if(c.value===void 0||c.value===null)continue;const u=await e.getProperties(c.value);if(!u||!u.UnitType||!u.UnitType.value||u.UnitType.value!=="LENGTHUNIT")continue;let p=1,m=1;return u.Name.value==="METRE"&&(m=1),u.Name.value==="FOOT"&&(m=.3048),((t=u.Prefix)==null?void 0:t.value)==="MILLI"?p=.001:((s=u.Prefix)==null?void 0:s.value)==="CENTI"?p=.01:((n=u.Prefix)==null?void 0:n.value)==="DECI"&&(p=.1),m*p}return 1}static async findItemByGuid(e,t){var s;const n=e.getAllPropertiesIDs();for(const i of n){const r=await e.getProperties(i);if(r&&((s=r.GlobalId)==null?void 0:s.value)===t)return r}return null}static async getRelationMap(e,t,s){var n;const i=s??(async()=>{}),r={},o=e.getAllPropertiesIDs();for(const l of o){const c=await e.getProperties(l);if(!c)continue;const u=c.type===t,p=Object.keys(c).find(b=>b.startsWith("Relating")),m=Object.keys(c).find(b=>b.startsWith("Related"));if(!(u&&p&&m))continue;const E=await e.getProperties((n=c[p])==null?void 0:n.value),v=c[m];if(!E||!v||!(v&&Array.isArray(v)))continue;const I=v.map(b=>b.value);await i(E.expressID,I),r[E.expressID]=I}return r}static async getQsetQuantities(e,t,s){const n=s??(()=>{}),i=await e.getProperties(t);return!i||i.type!==Qd?null:(i.Quantities??[{}]).map(r=>(r.value&&n(r.value),r.value)).filter(r=>r!==null)}static async getPsetProps(e,t,s){const n=s??(()=>{}),i=await e.getProperties(t);return!i||i.type!==ia?null:(i.HasProperties??[{}]).map(r=>(r.value&&n(r.value),r.value)).filter(r=>r!==null)}static async getPsetRel(e,t){var s;if(!await e.getProperties(t))return null;const n=await e.getAllPropertiesOfType(Ua);if(!n)return null;const i=Object.values(n);let r=null;for(const o of i)((s=o.RelatingPropertyDefinition)==null?void 0:s.value)===t&&(r=o.expressID);return r}static async getQsetRel(e,t){return Cs.getPsetRel(e,t)}static async getEntityName(e,t){var s;const n=await e.getProperties(t);if(!n)return{key:null,name:null};const i=Object.keys(n).find(o=>o.endsWith("Name"))??null,r=i?(s=n[i])==null?void 0:s.value:null;return{key:i,name:r}}static async getQuantityValue(e,t){const s=await e.getProperties(t);if(!s)return{key:null,value:null};const n=Object.keys(s).find(r=>r.endsWith("Value"))??null;let i;return n===null||s[n]===void 0||s[n]===null?i=null:i=s[n].value,{key:n,value:i}}static isRel(e){return pc[e].startsWith("IFCREL")}static async attributeExists(e,t,s){const n=await e.getProperties(t);return n?Object.keys(n).includes(s):!1}static async groupEntitiesByType(e,t){var s;const n=new Map;for(const i of t){const r=await e.getProperties(i);if(!r)continue;const o=r.type;n.get(o)||n.set(o,new Set),(s=n.get(o))==null||s.add(i)}return n}}class Tp{constructor(){x(this,"factor",1),x(this,"complement",1)}apply(e){const t=this.getScaleMatrix().multiply(e);e.copy(t)}setUp(e){var t,s,n;this.factor=1;const i=this.getLengthUnits(e);if(!i)return;const r=i==null,o=i.Name===void 0||i.Name===null;r||o||(i.Name.value==="FOOT"&&(this.factor=.3048),((t=i.Prefix)==null?void 0:t.value)==="MILLI"?this.complement=.001:((s=i.Prefix)==null?void 0:s.value)==="CENTI"?this.complement=.01:((n=i.Prefix)==null?void 0:n.value)==="DECI"&&(this.complement=.01))}getLengthUnits(e){try{const t=e.GetLineIDsWithType(0,Eu).get(0),s=e.GetLine(0,t);for(const n of s.Units){if(!n||n.value===null||n.value===void 0)continue;const i=e.GetLine(0,n.value);if(i.UnitType&&i.UnitType.value==="LENGTHUNIT")return i}return null}catch{return console.log("Could not get units"),null}}getScaleMatrix(){const e=this.factor;return new me().fromArray([e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1])}}class mc{constructor(){x(this,"itemsByFloor",{}),x(this,"_units",new Tp)}setUp(e){this._units.setUp(e),this.cleanUp();try{const t=e.GetLineIDsWithType(0,Ba),s=new Set,n=e.GetLineIDsWithType(0,js);for(let c=0;c{this.getMesh(i,t)});for(const i of this._visitedFragments){const{index:r,fragment:o}=i[1];t.keyFragments.set(r,o.id)}for(const i of t.items){const r=this._fragmentInstances.get(i.id);if(!r)throw new Error("Fragment not found!");const o=[];for(const[l,c]of r)o.push(c);i.add(o)}const n=this.webIfc.GetCoordinationMatrix(0);return t.coordinationMatrix.fromArray(n),t.civilData=this._civil.read(this.webIfc),t}getMesh(e,t){const s=e.geometries.size(),n=e.expressID;for(let i=0;ir.value!==s),await e.setProperties(s,null),this.registerChange(e,t,s))}async addElementToPset(e,t,...s){const n=await Cs.getPsetRel(e,t);if(!n)return;const i=await e.getProperties(n);if(!i)return;for(const o of s){const l=new Ji(o);i.RelatedObjects.push(l),this.onElementToPset.trigger({model:e,psetID:t,elementID:o})}this.registerChange(e,t);const r=this.components.get(Ti);for(const o of s)r.addEntityRelations(e,o,"IsDefinedBy",t)}async addPropToPset(e,t,...s){const n=await e.getProperties(t);if(n){for(const i of s){if(n.HasProperties.includes(i))continue;const r=new Ji(i);n.HasProperties.push(r),this.onPropToPset.trigger({model:e,psetID:t,propID:i})}this.registerChange(e,t)}}async saveToIfc(e,t){const s=this.components.get(bp),n=s.webIfc,i=await s.readIfcFile(t),r=this.changeMap[e.uuid]??[];for(const l of r){const c=await e.getProperties(l);if(c)try{n.WriteLine(i,c)}catch{}else try{n.DeleteLine(i,l)}catch{}}const o=n.SaveModel(i);return s.webIfc.CloseModel(i),s.cleanUp(),o}async setAttributeListener(e,t,s){this.attributeListeners[e.uuid]||(this.attributeListeners[e.uuid]={});const n=this.attributeListeners[e.uuid][t]?this.attributeListeners[e.uuid][t][s]:null;if(n)return n;const i=await e.getProperties(t);if(!i)throw new Error(`Entity with expressID ${t} doesn't exists.`);const r=i[s];if(Array.isArray(r)||!r)throw new Error(`Attribute ${s} is array or null, and it can't have a listener.`);const o=r.value;if(o===void 0||o==null)throw new Error(`Attribute ${s} has a badly defined handle.`);const l=new $;return Object.defineProperty(i[s],"value",{get(){return this._value},async set(c){this._value=c,l.trigger(c)}}),i[s].value=o,this.attributeListeners[e.uuid][t]||(this.attributeListeners[e.uuid][t]={}),this.attributeListeners[e.uuid][t][s]=l,l}increaseMaxID(e){return e.ifcMetadata.maxExpressID++,e.ifcMetadata.maxExpressID}newGUID(e){const t=vn.getIFCSchema(e);return new ss[t].IfcGloballyUniqueId(ja.create())}async getOwnerHistory(e){const t=await e.getAllPropertiesOfType(Gd);if(!t)throw new Error("No OwnerHistory was found.");const s=Object.keys(t).map(r=>parseInt(r,10)),n=t[s[0]],i=new Ji(n.expressID);return{ownerHistory:n,ownerHistoryHandle:i}}registerChange(e,...t){this.changeMap[e.uuid]||(this.changeMap[e.uuid]=new Set);for(const s of t)this.changeMap[e.uuid].add(s),this.onDataChanged.trigger({model:e,expressID:s})}async newSingleProperty(e,t,s,n){const i=vn.getIFCSchema(e),r=new ss[i].IfcIdentifier(s),o=new ss[i][t](n),l=new ss[i].IfcPropertySingleValue(r,null,o,null);return l.expressID=this.increaseMaxID(e),await this.setData(e,l),l}};x(xp,"uuid","58c2d9f0-183c-48d6-a402-dfcf5b9a34df");const yc=class Ic extends Re{constructor(e){super(e),x(this,"enabled",!0),x(this,"list",{}),x(this,"onDisposed",new $),x(this,"onFragmentsDisposed",t=>{const{groupID:s,fragmentIDs:n}=t;for(const i in this.list){const r=this.list[i],o=Object.keys(r);if(o.includes(s))delete r[s],Object.values(r).length===0&&delete this.list[i];else for(const l of o){const c=r[l];for(const u of n)delete c.map[u];Object.values(c).length===0&&delete r[l]}}}),e.add(Ic.uuid,this),e.get(Ue).onFragmentsDisposed.add(this.onFragmentsDisposed)}dispose(){this.list={},this.components.get(Ue).onFragmentsDisposed.remove(this.onFragmentsDisposed),this.onDisposed.trigger(),this.onDisposed.reset()}remove(e){for(const t in this.list){const s=this.list[t];for(const n in s){const i=s[n];delete i.map[e]}}}find(e){const t=this.components.get(Ue);if(!e){const r={};for(const[o,l]of t.list)r[o]=new Set(l.ids);return r}const s=Object.keys(e).length,n={};for(const r in e){const o=e[r];if(!this.list[r]){console.warn(`Classification ${r} does not exist.`);continue}for(const l of o){const c=this.list[r][l];if(c)for(const u in c.map){n[u]||(n[u]=new Map);for(const p of c.map[u]){const m=n[u].get(p);m===void 0?n[u].set(p,1):n[u].set(p,m+1)}}}}const i={};for(const r in n){const o=n[r];for(const[l,c]of o){if(c===void 0)throw new Error("Malformed fragments map!");c===s&&(i[r]||(i[r]=new Set),i[r].add(l))}}return i}byModel(e,t){this.list.models||(this.list.models={});const s=this.list.models;s[e]||(s[e]={map:{},id:null,name:e});const n=s[e];for(const[i,r]of t.data){const o=r[0];for(const l of o){const c=t.keyFragments.get(l);c&&(n.map[c]||(n.map[c]=new Set),n.map[c].add(i))}}}async byPredefinedType(e){var t;this.list.predefinedTypes||(this.list.predefinedTypes={});const s=this.list.predefinedTypes,n=e.getAllPropertiesIDs();for(const i of n){const r=await e.getProperties(i);if(!r)continue;const o=String((t=r.PredefinedType)==null?void 0:t.value).toUpperCase();s[o]||(s[o]={map:{},id:null,name:o});const l=s[o];for(const[c,u]of e.data){const p=u[0];for(const m of p){const E=e.keyFragments.get(m);if(!E)throw new Error("Fragment ID not found!");l.map[E]||(l.map[E]=new Set),l.map[E].add(r.expressID)}}}}byEntity(e){this.list.entities||(this.list.entities={});for(const[t,s]of e.data){const n=s[1][1],i=pc[n];this.saveItem(e,"entities",i,t)}}async byIfcRel(e,t,s){Cs.isRel(t)&&await Cs.getRelationMap(e,t,async(n,i)=>{const{name:r}=await Cs.getEntityName(e,n);for(const o of i)this.saveItem(e,s,r??"NO REL NAME",o)})}async bySpatialStructure(e,t){var s,n;const i=this.components.get(Ti),r=i.relationMaps[e.uuid];if(!r)throw new Error(`Classifier: model relations of ${e.name||e.uuid} have to exists to group by spatial structure.`);const o="spatialStructures",l=t.useProperties===void 0||t.useProperties;for(const[c]of r){if(t.isolate){const E=e.data.get(c);if(!E)continue;const v=E[1][1];if(v===void 0||!t.isolate.has(v))continue}const u=i.getEntityRelations(e,c,"Decomposes");if(u)for(const E of u){let v=E.toString();if(l){const I=await e.getProperties(E);if(!I)continue;v=(s=I.Name)==null?void 0:s.value}this.saveItem(e,o,v,c,E)}const p=i.getEntityRelations(e,c,"ContainsElements");if(!p)continue;let m=c.toString();if(l){const E=await e.getProperties(c);if(!E)continue;m=(n=E.Name)==null?void 0:n.value}for(const E of p){this.saveItem(e,o,m,E,c);const v=i.getEntityRelations(e,Number(E),"IsDecomposedBy");if(v)for(const I of v)this.saveItem(e,o,m,I,c)}}}setColor(e,t,s=!1){const n=this.components.get(Ue);for(const i in e){const r=n.list.get(i);if(!r)continue;const o=e[i];r.setColor(t,o,s)}}resetColor(e){const t=this.components.get(Ue);for(const s in e){const n=t.list.get(s);if(!n)continue;const i=e[s];n.resetColor(i)}}saveItem(e,t,s,n,i=null){this.list[t]||(this.list[t]={});const r=e.data.get(n);if(r)for(const o of r[0]){const l=e.keyFragments.get(o);if(l){const c=this.list[t];c[s]||(c[s]={map:{},id:i,name:s}),c[s].map[l]||(c[s].map[l]=new Set),c[s].map[l].add(n)}}}};x(yc,"uuid","e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");let Ap=yc;const Rp=class Cc extends Re{constructor(e){super(e),x(this,"onDisposed",new $),x(this,"enabled",!0),x(this,"height",10),x(this,"groupName","spatialStructures"),x(this,"list",new Set),e.add(Cc.uuid,this)}dispose(){this.list.clear(),this.onDisposed.trigger(),this.onDisposed.reset()}set(e){if(!this.enabled)return;const t=this.components.get(Ap),s=this.components.get(Ue),n=e?1:-1;let i=0;const r=t.list[this.groupName],o=new me;for(const l in r){o.elements[13]=i*n*this.height;for(const c in r[l].map){const u=s.list.get(c),p=l+c,m=this.list.has(p);if(!u||e&&m||!e&&!m)continue;e?this.list.add(p):this.list.delete(p);const E=r[l].map[c];u.applyTransform(E,o),u.mesh.computeBoundingSphere(),u.mesh.computeBoundingBox()}i++}}};x(Rp,"uuid","d260618b-ce88-4c7d-826c-6debb91de3e2");const Sp=class Tc extends Re{constructor(e){super(e),x(this,"enabled",!0),this.components.add(Tc.uuid,this)}set(e,t){const s=this.components.get(Ue);if(!t){for(const[n,i]of s.list)i&&(i.setVisibility(e),this.updateCulledVisibility(i));return}for(const n in t){const i=t[n],r=s.list.get(n);r&&(r.setVisibility(e,i),this.updateCulledVisibility(r))}}isolate(e){this.set(!1),this.set(!0,e)}updateCulledVisibility(e){const t=this.components.get(vp);for(const[s,n]of t.list){const i=n.colorMeshes.get(e.id);i&&(i.count=e.mesh.count)}}};x(Sp,"uuid","dd9ccf2d-8a21-4821-b7f6-2949add16a29");class Fp extends Za{constructor(){super(...arguments),x(this,"minGeometrySize",10),x(this,"minAssetsSize",1e3)}}const Pp=class bc extends Re{constructor(e){super(e),x(this,"onGeometryStreamed",new $),x(this,"onAssetStreamed",new $),x(this,"onProgress",new $),x(this,"onIfcLoaded",new $),x(this,"onDisposed",new $),x(this,"settings",new Fp),x(this,"enabled",!0),x(this,"webIfc",new xn),x(this,"_spatialTree",new mc),x(this,"_metaData",new Ec),x(this,"_visitedGeometries",new Map),x(this,"_streamSerializer",new kh),x(this,"_geometries",new Map),x(this,"_geometryCount",0),x(this,"_civil",new gc),x(this,"_groupSerializer",new Nh),x(this,"_assets",[]),x(this,"_meshesWithHoles",new Set),this.components.add(bc.uuid,this),this.settings.excludedCategories.add(Uh)}dispose(){this.onIfcLoaded.reset(),this.onGeometryStreamed.reset(),this.onAssetStreamed.reset(),this.webIfc.Dispose(),this.webIfc=null,this.onDisposed.trigger(),this.onDisposed.reset()}async streamFromBuffer(e){await this.readIfcFile(e),await this.streamAllGeometries(),this.cleanUp()}async streamFromCallBack(e){await this.streamIfcFile(e),await this.streamAllGeometries(),this.cleanUp()}async readIfcFile(e){const{path:t,absolute:s,logLevel:n}=this.settings.wasm;this.webIfc.SetWasmPath(t,s),await this.webIfc.Init(),n&&this.webIfc.SetLogLevel(n),this.webIfc.OpenModel(e,this.settings.webIfc)}async streamIfcFile(e){const{path:t,absolute:s,logLevel:n}=this.settings.wasm;this.webIfc.SetWasmPath(t,s),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 s=this.webIfc.GetIfcEntityList(0),n=[[]],i=new Bh;i.ifcMetadata={name:"",description:"",...this._metaData.getNameInfo(this.webIfc),...this._metaData.getDescriptionInfo(this.webIfc),schema:this.webIfc.GetModelSchema(0)||"IFC2X3",maxExpressID:this.webIfc.GetMaxExpressID(0)};let r=0,o=0;for(const v of s){if(!this.webIfc.IsIfcElement(v)&&v!==js||this.settings.excludedCategories.has(v))continue;const I=this.webIfc.GetLineIDsWithType(0,v),b=I.size();for(let A=0;Ae&&(r=0,o++,n.push([]));const S=I.get(A);n[o].push(S);const P=this.webIfc.GetLine(0,S);if(P.GlobalId){const M=(P==null?void 0:P.GlobalId.value)||(P==null?void 0:P.GlobalId);i.globalToExpressIDs.set(M,S)}const T=this._spatialTree.itemsByFloor[S]||0;i.data.set(S,[[],[T,v]]),r++}}this._spatialTree.cleanUp();let l=.01,c=0;for(const v of n){c++,this.webIfc.StreamMeshes(0,v,b=>{this.getMesh(this.webIfc,b,i)}),this._geometryCount>e&&await this.streamGeometries(),this._assets.length>t&&await this.streamAssets();const I=c/n.length;I>l&&(l+=.01,l=Math.max(l,I),this.onProgress.trigger(Math.round(l*100)/100))}this._geometryCount&&await this.streamGeometries(),this._assets.length&&await this.streamAssets();const{opaque:u,transparent:p}=i.geometryIDs;for(const[v,{index:I,uuid:b}]of this._visitedGeometries)i.keyFragments.set(I,b),(v>1?u:p).set(v,I);vc.get(i,this.webIfc);const m=this.webIfc.GetCoordinationMatrix(0);i.coordinationMatrix.fromArray(m),i.civilData=this._civil.read(this.webIfc);const E=this._groupSerializer.export(i);this.onIfcLoaded.trigger(E),i.dispose(!0)}cleanUp(){this.webIfc.Dispose(),this.webIfc=null,this.webIfc=new xn,this._visitedGeometries.clear(),this._geometries.clear(),this._assets=[],this._meshesWithHoles.clear()}getMesh(e,t,s){const n=t.geometries.size(),i=t.expressID,r={id:i,geometries:[]};for(let o=0;on&&(n=Math.round(n*100)/100,await this.onProgress.trigger(n),n+=.01)}await this.onProgress.trigger(1);const r=await this.components.get(Ti).processFromWebIfc(this.webIfc,0);await this.onIndicesStreamed.trigger(r)}cleanUp(){this.webIfc.Dispose(),this.webIfc=null,this.webIfc=new xn}}x(Mp,"uuid","88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");const xc=class Ac extends Re{constructor(e){super(e),x(this,"enabled",!0),e.add(Ac.uuid,this)}static distanceFromPointToLine(e,t,s,n=!1){const i=new yt,r=new O;return i.set(t,s),i.closestPointToPoint(e,n,r),r.distanceTo(e)}getFace(e,t,s){if(!e.geometry.index)throw new Error("Geometry must be indexed!");const n=new Map,i=e.geometry.index.array,{plane:r}=this.getFaceData(t,s,e),o=[];for(let p=0;pT.id);if(!E.size){const T=l++;for(const{id:M}of m)c.set(M,T);u.set(T,{edges:new Set(v),indices:new Set([p])});continue}let I=null;const b=new Set,A=new Set(v);for(const[T,M]of E){I===null?I=M:M!==I&&b.add(M),c.delete(T);const{edges:V}=u.get(M);V.delete(T),A.delete(T)}if(I===null)throw new Error("Error computing face!");const S=u.get(I),{indices:P}=S;P.add(p);for(const T of A){c.set(T,I);const{edges:M}=S;M.add(T)}for(const T of b){const M=u.get(T),{edges:V,indices:G}=M,H=u.get(I),{edges:j,indices:Q}=H;for(const J of V)j.add(J),c.set(J,I);for(const J of G)Q.add(J);u.delete(T)}}for(const[p,{indices:m,edges:E}]of u)if(m.has(t)){const v=[];for(const I of E){const b=n.get(I);v.push(b)}return{edges:v,indices:m}}return null}getVerticesAndNormal(e,t,s){if(!e.geometry.index)throw new Error("Geometry must be indexed!");const n=e.geometry.index.array,i=e.geometry.attributes.position.array,r=e.geometry.attributes.normal.array,o=n[t*3]*3,l=n[t*3+1]*3,c=n[t*3+2]*3,u=new O(i[o],i[o+1],i[o+2]),p=new O(i[l],i[l+1],i[l+2]),m=new O(i[c],i[c+1],i[c+2]),E=new O(r[o],r[o+1],r[o+2]),v=new O(r[l],r[l+1],r[l+2]),I=new O(r[c],r[c+1],r[c+2]),b=(E.x+v.x+I.x)/3,A=(E.y+v.y+I.y)/3,S=(E.z+v.z+I.z)/3,P=new O(b,A,S);if(s!==void 0&&e instanceof It){const T=new me;e.getMatrixAt(s,T);const M=new me;M.extractRotation(T),P.applyMatrix4(M),u.applyMatrix4(T),p.applyMatrix4(T),m.applyMatrix4(T)}return{p1:u,p2:p,p3:m,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}getVolumeFromFragments(e){const t=this.components.get(Ue),s=new me,n=[];for(const r in e){const o=t.list.get(r);if(!o)continue;const l=e[r];let c=0;for(const m of l){const E=o.getInstancesIDs(m);E&&(c+=E.size)}const u=new It(o.mesh.geometry,void 0,c);let p=0;for(const m of l){const E=o.getInstancesIDs(m);if(E)for(const v of E)o.mesh.getMatrixAt(v,s),u.setMatrixAt(p++,s)}n.push(u)}const i=this.getVolumeFromMeshes(n);for(const r of n)r.geometry=null,r.material=[],r.dispose();return i}getVolumeFromMeshes(e){let t=0;for(const s of e)t+=this.getVolumeOfMesh(s);return t}getFaceData(e,t,s){const n=this.getVerticesAndNormal(s,e,t),{p1:i,p2:r,p3:o,faceNormal:l}=n;this.round(i),this.round(r),this.round(o),this.round(l);const c=[{id:`${i.x}|${i.y}|${i.z}`,value:i},{id:`${r.x}|${r.y}|${r.z}`,value:r},{id:`${o.x}|${o.y}|${o.z}`,value:o}];c.sort((S,P)=>S.idP.id?1:0);const[{id:u,value:p},{id:m,value:E},{id:v,value:I}]=c,b=[{id:`${u}|${m}`,distance:p.distanceTo(E),points:[p,E]},{id:`${m}|${v}`,distance:E.distanceTo(I),points:[E,I]},{id:`${u}|${v}`,distance:p.distanceTo(I),points:[p,I]}],A=new bs;return A.setFromNormalAndCoplanarPoint(l,i),A.constant=Math.round(A.constant*10)/10,{plane:A,edges:b}}getVolumeOfMesh(e){let t=0;const s=new O,n=new O,i=new O,{index:r}=e.geometry,o=e.geometry.attributes.position.array;if(!r)return console.warn("Geometry must be indexed to compute its volume!"),0;const l=[];if(e instanceof It)for(let u=0;u{if(this.isProcessing)return;const i=n.data.colors;this._recentlyHiddenMeshes=new Set(this._currentVisibleMeshes),this._currentVisibleMeshes.clear();for(const[r,o]of i){if(o{this.isProcessing||await this.updateVisibility()},this.updateInterval),this.onViewUpdated.add(({seen:n,unseen:i})=>{for(const r of n)r.visible=!0;for(const r of i)r.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(hs);for(const t in this.colorMeshes){const s=this.colorMeshes.get(t);s&&e.destroy(s,!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 It,{geometry:s,material:n}=e,{colorMaterial:i,code:r}=this.getAvailableMaterial();let o;if(Array.isArray(n)){let u=!0;const p=[];for(const m of n)$l.isTransparent(m)?p.push(this._transparentMat):(u=!1,p.push(i));if(u){i.dispose(),this.isProcessing=!1;return}o=p}else if($l.isTransparent(n)){i.dispose(),this.isProcessing=!1;return}else o=i;this._colorCodeMeshMap.set(r,e),this._meshIDColorCodeMap.set(e.uuid,r);const l=t?e.count:1,c=new It(s,o,l);t?c.instanceMatrix=e.instanceMatrix:c.setMatrixAt(0,new me),e.visible=!1,e.updateWorldMatrix(!0,!1),c.applyMatrix4(e.matrixWorld),c.updateMatrix(),this.scene.add(c),this.colorMeshes.set(e.uuid,c),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(hs);this._currentVisibleMeshes.delete(e),this._recentlyHiddenMeshes.delete(e);const s=this.colorMeshes.get(e.uuid),n=this._meshIDColorCodeMap.get(e.uuid);if(!s||!n){this.isProcessing=!1;return}this._colorCodeMeshMap.delete(n),this._meshIDColorCodeMap.delete(e.uuid),this.colorMeshes.delete(e.uuid),s.geometry=void 0,s.material=[],t.destroy(s,!0),this._recentlyHiddenMeshes.delete(e),this._currentVisibleMeshes.delete(e),this.isProcessing=!1}getAvailableMaterial(){const{r:e,g:t,b:s,code:n}=this.getAvailableColor(),i=os.enabled;os.enabled=!1;const r=new gt(`rgb(${e}, ${t}, ${s})`);if(!this.world.renderer)throw new Error("Renderer not found in the world!");const o=this.world.renderer.clippingPlanes,l=new Ct({color:r,clippingPlanes:o,side:Ii});return os.enabled=i,{colorMaterial:l,code:n}}}const rc=class va extends Re{constructor(e){super(e),x(this,"onDisposed",new $),x(this,"_enabled",!0),x(this,"list",new Map),e.add(va.uuid,this)}get enabled(){return this._enabled}set enabled(e){this._enabled=e;for(const[t,s]of this.list)s.enabled=e}create(e,t){if(this.list.has(e.uuid))return this.list.get(e.uuid);const s=new Ep(this.components,e,t);return this.list.set(e.uuid,s),s}delete(e){const t=this.list.get(e.uuid);t&&t.dispose(),this.list.delete(e.uuid)}dispose(){this.enabled=!1,this.onDisposed.trigger(va.uuid),this.onDisposed.reset();for(const[e,t]of this.list)t.dispose();this.list.clear()}};x(rc,"uuid","69f2a50d-c266-44fc-b1bd-fa4d34be89e6");let vp=rc;class wp{constructor(e){if(x(this,"onDisposed",new $),x(this,"onAfterUpdate",new $),x(this,"onBeforeUpdate",new $),x(this,"onResize",new $),x(this,"frontOffset",0),x(this,"overrideMaterial",new zh),x(this,"backgroundColor",new gt(395274)),x(this,"renderer"),x(this,"enabled",!0),x(this,"world"),x(this,"_lockRotation",!0),x(this,"_camera"),x(this,"_plane"),x(this,"_size",new ke(320,160)),x(this,"_tempVector1",new O),x(this,"_tempVector2",new O),x(this,"_tempTarget",new O),x(this,"down",new O(0,-1,0)),x(this,"updatePlanes",()=>{if(!this.world.renderer)throw new Error("The given world must have a renderer!");const n=[],i=this.world.renderer.three;for(const r of i.clippingPlanes)n.push(r);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 Nr,this.renderer.setSize(this._size.x,this._size.y);const t=1,s=this._size.x/this._size.y;this._camera=new Sn(t*s/-2,t*s/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 bs(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 Ws))throw new Error("The given world must have a THREE.Scene as a root!");const s=t.controls;if(s.getPosition(this._tempVector1),this._camera.position.x=this._tempVector1.x,this._camera.position.z=this._tempVector1.z,this.frontOffset!==0&&(s.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){s.getTarget(this._tempTarget);const i=Math.atan2(this._tempTarget.x-this._tempVector1.x,this._tempTarget.z-this._tempVector1.z);this._camera.rotation.z=i+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,s=1;this._camera.left=s*t/-2,this._camera.right=s*t/2,this._camera.top=s/2,this._camera.bottom=-s/2,this._camera.updateProjectionMatrix(),this.onResize.trigger(e)}}const yp=class oc extends Re{constructor(e){super(e),x(this,"onAfterUpdate",new $),x(this,"onBeforeUpdate",new $),x(this,"onDisposed",new $),x(this,"enabled",!0),x(this,"list",new Map),this.components.add(oc.uuid,this)}create(e){if(this.list.has(e.uuid))throw new Error("This world already has a minimap!");const t=new wp(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()}};x(yp,"uuid","39ad6aad-84c8-4adf-a1e0-7f25313a9e7f");const Ip=new Map([[_a,{forRelating:"IsDecomposedBy",forRelated:"Decomposes"}],[Ph,{forRelating:"AssociatedTo",forRelated:"HasAssociations"}],[Oh,{forRelating:"ClassificationForObjects",forRelated:"HasAssociations"}],[Mh,{forRelating:"IsGroupedBy",forRelated:"HasAssignments"}],[Ua,{forRelated:"IsDefinedBy",forRelating:"DefinesOcurrence"}],[Dh,{forRelated:"IsTypedBy",forRelating:"Types"}],[Lh,{forRelated:"IsDefinedBy",forRelating:"Defines"}],[Ba,{forRelated:"ContainedInStructure",forRelating:"ContainsElements"}]]),ac=class wa extends Re{constructor(e){super(e),x(this,"onDisposed",new $),x(this,"onRelationsIndexed",new $),x(this,"relationMaps",{}),x(this,"enabled",!0),x(this,"_relToAttributesMap",Ip),x(this,"_inverseAttributes",["IsDecomposedBy","Decomposes","AssociatedTo","HasAssociations","ClassificationForObjects","IsGroupedBy","HasAssignments","IsDefinedBy","DefinesOcurrence","IsTypedBy","Types","Defines","ContainedInStructure","ContainsElements"]),x(this,"_ifcRels",[_a,Ph,Oh,Mh,Ua,Dh,Lh,Ba]),x(this,"onFragmentsDisposed",t=>{delete this.relationMaps[t.groupID]}),this.components.add(wa.uuid,this),e.get(Ue).onFragmentsDisposed.add(this.onFragmentsDisposed)}indexRelations(e,t,s,n){const i=Object.keys(t).find(p=>p.startsWith("Relating")),r=Object.keys(t).find(p=>p.startsWith("Related"));if(!(i&&r))return;const o=t[i].value,l=t[r].map(p=>p.value),c=e.get(o)??new Map,u=this.getAttributeIndex(n);u&&(c.set(u,l),e.set(o,c));for(const p of l){const m=e.get(p)??new Map,E=this.getAttributeIndex(s);if(!E)continue;const v=m.get(E)??[];v.push(o),m.set(E,v),e.set(p,m)}}getAttributeIndex(e){const t=this._inverseAttributes.indexOf(e);return t===-1?null:t}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 s of this._ifcRels){const n=await e.getAllPropertiesOfType(s);if(!n)continue;const i=this._relToAttributesMap.get(s);if(!i)continue;const{forRelated:r,forRelating:o}=i;for(const l in n){const c=n[l];this.indexRelations(t,c,r,o)}}return this.setRelationMap(e,t),t}async processFromWebIfc(e,t){const s=new Map;for(const n of this._ifcRels){const i=this._relToAttributesMap.get(n);if(!i)continue;const{forRelated:r,forRelating:o}=i,l=e.GetLineIDsWithType(t,n);for(let c=0;cn.x&&(n.x=r.x),r.y>n.y&&(n.y=r.y),r.z>n.z&&(n.z=r.z);return new Ke(t,s)}dispose(){const e=this.components.get(hs);for(const t of this._meshes)e.destroy(t);this._meshes=[],this.onDisposed.trigger(is.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(),s=Math.abs((t.x-e.x)/2),n=Math.abs((t.y-e.y)/2),i=Math.abs((t.z-e.z)/2),r=new O(e.x+s,e.y+n,e.z+i),o=r.distanceTo(e);return new Rn(r,o)}getMesh(){const e=new Ke(this._absoluteMin,this._absoluteMax),t=is.getDimensions(e),{width:s,height:n,depth:i,center:r}=t,o=new tt(s,n,i),l=new ie(o);return this._meshes.push(l),l.position.copy(r),l}reset(){this._absoluteMin=is.newBound(!0),this._absoluteMax=is.newBound(!1)}add(e){for(const t of e.items)this.addMesh(t.mesh)}addMesh(e,t){if(!e.geometry.index)return;const s=is.getFragmentBounds(e);e.updateMatrixWorld();const n=e.matrixWorld,i=new me,r=e instanceof It,o=new Set;if(t&&e instanceof _h)for(const l of t){const c=e.fragment.getInstancesIDs(l);if(c)for(const u of c)o.add(u)}else o.add(0);for(const l of o){const c=s.min.clone(),u=s.max.clone();r&&(e.getMatrixAt(l,i),c.applyMatrix4(i),u.applyMatrix4(i)),c.applyMatrix4(n),u.applyMatrix4(n),c.xthis._absoluteMax.x&&(this._absoluteMax.x=c.x),c.y>this._absoluteMax.y&&(this._absoluteMax.y=c.y),c.z>this._absoluteMax.z&&(this._absoluteMax.z=c.z),u.x>this._absoluteMax.x&&(this._absoluteMax.x=u.x),u.y>this._absoluteMax.y&&(this._absoluteMax.y=u.y),u.z>this._absoluteMax.z&&(this._absoluteMax.z=u.z),u.xr.x&&(r.x=u),p>r.y&&(r.y=p),m>r.z&&(r.z=m)}return new Ke(i,r)}};x(cc,"uuid","d1444724-dba6-4cdd-a0c7-68ee1450d166");let ya=cc;const dc=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,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]),uc=class fc extends Re{constructor(e){super(e),x(this,"enabled",!0),e.add(fc.uuid,this)}async export(e,t,s=!1,n=!0){const i={},r=new Set(e.GetIfcEntityList(t)),o=new Set([ka,za,Ya,Hr,js]);for(const l of o)r.add(l);for(const l of r){if(dc.has(l))continue;const c=o.has(l)&&n,u=e.GetLineIDsWithType(t,l);for(const p of u){const m=e.GetLine(0,p,c,s);i[m.expressID]=m}}return i}};x(uc,"uuid","b32c4332-cd67-436e-ba7f-196646c7a635");let Cp=uc;const pc={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 Cs{static async getUnits(e){var t,s,n;const{IFCUNITASSIGNMENT:i}=ss,r=await e.getAllPropertiesOfType(i);if(!r)return 1;const o=Object.keys(r),l=r[parseInt(o[0],10)];for(const c of l.Units){if(c.value===void 0||c.value===null)continue;const u=await e.getProperties(c.value);if(!u||!u.UnitType||!u.UnitType.value||u.UnitType.value!=="LENGTHUNIT")continue;let p=1,m=1;return u.Name.value==="METRE"&&(m=1),u.Name.value==="FOOT"&&(m=.3048),((t=u.Prefix)==null?void 0:t.value)==="MILLI"?p=.001:((s=u.Prefix)==null?void 0:s.value)==="CENTI"?p=.01:((n=u.Prefix)==null?void 0:n.value)==="DECI"&&(p=.1),m*p}return 1}static async findItemByGuid(e,t){var s;const n=e.getAllPropertiesIDs();for(const i of n){const r=await e.getProperties(i);if(r&&((s=r.GlobalId)==null?void 0:s.value)===t)return r}return null}static async getRelationMap(e,t,s){var n;const i=s??(async()=>{}),r={},o=e.getAllPropertiesIDs();for(const l of o){const c=await e.getProperties(l);if(!c)continue;const u=c.type===t,p=Object.keys(c).find(b=>b.startsWith("Relating")),m=Object.keys(c).find(b=>b.startsWith("Related"));if(!(u&&p&&m))continue;const E=await e.getProperties((n=c[p])==null?void 0:n.value),v=c[m];if(!E||!v||!(v&&Array.isArray(v)))continue;const I=v.map(b=>b.value);await i(E.expressID,I),r[E.expressID]=I}return r}static async getQsetQuantities(e,t,s){const n=s??(()=>{}),i=await e.getProperties(t);return!i||i.type!==Qd?null:(i.Quantities??[{}]).map(r=>(r.value&&n(r.value),r.value)).filter(r=>r!==null)}static async getPsetProps(e,t,s){const n=s??(()=>{}),i=await e.getProperties(t);return!i||i.type!==ia?null:(i.HasProperties??[{}]).map(r=>(r.value&&n(r.value),r.value)).filter(r=>r!==null)}static async getPsetRel(e,t){var s;if(!await e.getProperties(t))return null;const n=await e.getAllPropertiesOfType(Ua);if(!n)return null;const i=Object.values(n);let r=null;for(const o of i)((s=o.RelatingPropertyDefinition)==null?void 0:s.value)===t&&(r=o.expressID);return r}static async getQsetRel(e,t){return Cs.getPsetRel(e,t)}static async getEntityName(e,t){var s;const n=await e.getProperties(t);if(!n)return{key:null,name:null};const i=Object.keys(n).find(o=>o.endsWith("Name"))??null,r=i?(s=n[i])==null?void 0:s.value:null;return{key:i,name:r}}static async getQuantityValue(e,t){const s=await e.getProperties(t);if(!s)return{key:null,value:null};const n=Object.keys(s).find(r=>r.endsWith("Value"))??null;let i;return n===null||s[n]===void 0||s[n]===null?i=null:i=s[n].value,{key:n,value:i}}static isRel(e){return pc[e].startsWith("IFCREL")}static async attributeExists(e,t,s){const n=await e.getProperties(t);return n?Object.keys(n).includes(s):!1}static async groupEntitiesByType(e,t){var s;const n=new Map;for(const i of t){const r=await e.getProperties(i);if(!r)continue;const o=r.type;n.get(o)||n.set(o,new Set),(s=n.get(o))==null||s.add(i)}return n}}class Tp{constructor(){x(this,"factor",1),x(this,"complement",1)}apply(e){const t=this.getScaleMatrix().multiply(e);e.copy(t)}setUp(e){var t,s,n;this.factor=1;const i=this.getLengthUnits(e);if(!i)return;const r=i==null,o=i.Name===void 0||i.Name===null;r||o||(i.Name.value==="FOOT"&&(this.factor=.3048),((t=i.Prefix)==null?void 0:t.value)==="MILLI"?this.complement=.001:((s=i.Prefix)==null?void 0:s.value)==="CENTI"?this.complement=.01:((n=i.Prefix)==null?void 0:n.value)==="DECI"&&(this.complement=.01))}getLengthUnits(e){try{const t=e.GetLineIDsWithType(0,Eu).get(0),s=e.GetLine(0,t);for(const n of s.Units){if(!n||n.value===null||n.value===void 0)continue;const i=e.GetLine(0,n.value);if(i.UnitType&&i.UnitType.value==="LENGTHUNIT")return i}return null}catch{return console.log("Could not get units"),null}}getScaleMatrix(){const e=this.factor;return new me().fromArray([e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1])}}class mc{constructor(){x(this,"itemsByFloor",{}),x(this,"_units",new Tp)}setUp(e){this._units.setUp(e),this.cleanUp();try{const t=e.GetLineIDsWithType(0,Ba),s=new Set,n=e.GetLineIDsWithType(0,js);for(let c=0;c{this.getMesh(i,t)});for(const i of this._visitedFragments){const{index:r,fragment:o}=i[1];t.keyFragments.set(r,o.id)}for(const i of t.items){const r=this._fragmentInstances.get(i.id);if(!r)throw new Error("Fragment not found!");const o=[];for(const[l,c]of r)o.push(c);i.add(o)}const n=this.webIfc.GetCoordinationMatrix(0);return t.coordinationMatrix.fromArray(n),t.civilData=this._civil.read(this.webIfc),t}getMesh(e,t){const s=e.geometries.size(),n=e.expressID;for(let i=0;ir.value!==s),await e.setProperties(s,null),this.registerChange(e,t,s))}async addElementToPset(e,t,...s){const n=await Cs.getPsetRel(e,t);if(!n)return;const i=await e.getProperties(n);if(!i)return;for(const o of s){const l=new Ji(o);i.RelatedObjects.push(l),this.onElementToPset.trigger({model:e,psetID:t,elementID:o})}this.registerChange(e,t);const r=this.components.get(Ti);for(const o of s)r.addEntityRelations(e,o,"IsDefinedBy",t)}async addPropToPset(e,t,...s){const n=await e.getProperties(t);if(n){for(const i of s){if(n.HasProperties.includes(i))continue;const r=new Ji(i);n.HasProperties.push(r),this.onPropToPset.trigger({model:e,psetID:t,propID:i})}this.registerChange(e,t)}}async saveToIfc(e,t){const s=this.components.get(bp),n=s.webIfc,i=await s.readIfcFile(t),r=this.changeMap[e.uuid]??[];for(const l of r){const c=await e.getProperties(l);if(c)try{n.WriteLine(i,c)}catch{}else try{n.DeleteLine(i,l)}catch{}}const o=n.SaveModel(i);return s.webIfc.CloseModel(i),s.cleanUp(),o}async setAttributeListener(e,t,s){this.attributeListeners[e.uuid]||(this.attributeListeners[e.uuid]={});const n=this.attributeListeners[e.uuid][t]?this.attributeListeners[e.uuid][t][s]:null;if(n)return n;const i=await e.getProperties(t);if(!i)throw new Error(`Entity with expressID ${t} doesn't exists.`);const r=i[s];if(Array.isArray(r)||!r)throw new Error(`Attribute ${s} is array or null, and it can't have a listener.`);const o=r.value;if(o===void 0||o==null)throw new Error(`Attribute ${s} has a badly defined handle.`);const l=new $;return Object.defineProperty(i[s],"value",{get(){return this._value},async set(c){this._value=c,l.trigger(c)}}),i[s].value=o,this.attributeListeners[e.uuid][t]||(this.attributeListeners[e.uuid][t]={}),this.attributeListeners[e.uuid][t][s]=l,l}increaseMaxID(e){return e.ifcMetadata.maxExpressID++,e.ifcMetadata.maxExpressID}newGUID(e){const t=vn.getIFCSchema(e);return new ss[t].IfcGloballyUniqueId(ja.create())}async getOwnerHistory(e){const t=await e.getAllPropertiesOfType(Gd);if(!t)throw new Error("No OwnerHistory was found.");const s=Object.keys(t).map(r=>parseInt(r,10)),n=t[s[0]],i=new Ji(n.expressID);return{ownerHistory:n,ownerHistoryHandle:i}}registerChange(e,...t){this.changeMap[e.uuid]||(this.changeMap[e.uuid]=new Set);for(const s of t)this.changeMap[e.uuid].add(s),this.onDataChanged.trigger({model:e,expressID:s})}async newSingleProperty(e,t,s,n){const i=vn.getIFCSchema(e),r=new ss[i].IfcIdentifier(s),o=new ss[i][t](n),l=new ss[i].IfcPropertySingleValue(r,null,o,null);return l.expressID=this.increaseMaxID(e),await this.setData(e,l),l}};x(xp,"uuid","58c2d9f0-183c-48d6-a402-dfcf5b9a34df");const yc=class Ic extends Re{constructor(e){super(e),x(this,"enabled",!0),x(this,"list",{}),x(this,"onDisposed",new $),x(this,"onFragmentsDisposed",t=>{const{groupID:s,fragmentIDs:n}=t;for(const i in this.list){const r=this.list[i],o=Object.keys(r);if(o.includes(s))delete r[s],Object.values(r).length===0&&delete this.list[i];else for(const l of o){const c=r[l];for(const u of n)delete c.map[u];Object.values(c).length===0&&delete r[l]}}}),e.add(Ic.uuid,this),e.get(Ue).onFragmentsDisposed.add(this.onFragmentsDisposed)}dispose(){this.list={},this.components.get(Ue).onFragmentsDisposed.remove(this.onFragmentsDisposed),this.onDisposed.trigger(),this.onDisposed.reset()}remove(e){for(const t in this.list){const s=this.list[t];for(const n in s){const i=s[n];delete i.map[e]}}}find(e){const t=this.components.get(Ue);if(!e){const r={};for(const[o,l]of t.list)r[o]=new Set(l.ids);return r}const s=Object.keys(e).length,n={};for(const r in e){const o=e[r];if(!this.list[r]){console.warn(`Classification ${r} does not exist.`);continue}for(const l of o){const c=this.list[r][l];if(c)for(const u in c.map){n[u]||(n[u]=new Map);for(const p of c.map[u]){const m=n[u].get(p);m===void 0?n[u].set(p,1):n[u].set(p,m+1)}}}}const i={};for(const r in n){const o=n[r];for(const[l,c]of o){if(c===void 0)throw new Error("Malformed fragments map!");c===s&&(i[r]||(i[r]=new Set),i[r].add(l))}}return i}byModel(e,t){this.list.models||(this.list.models={});const s=this.list.models;s[e]||(s[e]={map:{},id:null,name:e});const n=s[e];for(const[i,r]of t.data){const o=r[0];for(const l of o){const c=t.keyFragments.get(l);c&&(n.map[c]||(n.map[c]=new Set),n.map[c].add(i))}}}async byPredefinedType(e){var t;this.list.predefinedTypes||(this.list.predefinedTypes={});const s=this.list.predefinedTypes,n=e.getAllPropertiesIDs();for(const i of n){const r=await e.getProperties(i);if(!r)continue;const o=String((t=r.PredefinedType)==null?void 0:t.value).toUpperCase();s[o]||(s[o]={map:{},id:null,name:o});const l=s[o];for(const[c,u]of e.data){const p=u[0];for(const m of p){const E=e.keyFragments.get(m);if(!E)throw new Error("Fragment ID not found!");l.map[E]||(l.map[E]=new Set),l.map[E].add(r.expressID)}}}}byEntity(e){this.list.entities||(this.list.entities={});for(const[t,s]of e.data){const n=s[1][1],i=pc[n];this.saveItem(e,"entities",i,t)}}async byIfcRel(e,t,s){Cs.isRel(t)&&await Cs.getRelationMap(e,t,async(n,i)=>{const{name:r}=await Cs.getEntityName(e,n);for(const o of i)this.saveItem(e,s,r??"NO REL NAME",o)})}async bySpatialStructure(e,t={}){var s,n;const i=this.components.get(Ti),r=i.relationMaps[e.uuid];if(!r)throw new Error(`Classifier: model relations of ${e.name||e.uuid} have to exists to group by spatial structure.`);const o="spatialStructures",l=t.useProperties===void 0||t.useProperties;for(const[c]of r){if(t.isolate){const E=e.data.get(c);if(!E)continue;const v=E[1][1];if(v===void 0||!t.isolate.has(v))continue}const u=i.getEntityRelations(e,c,"Decomposes");if(u)for(const E of u){let v=E.toString();if(l){const I=await e.getProperties(E);if(!I)continue;v=(s=I.Name)==null?void 0:s.value}this.saveItem(e,o,v,c,E)}const p=i.getEntityRelations(e,c,"ContainsElements");if(!p)continue;let m=c.toString();if(l){const E=await e.getProperties(c);if(!E)continue;m=(n=E.Name)==null?void 0:n.value}for(const E of p){this.saveItem(e,o,m,E,c);const v=i.getEntityRelations(e,Number(E),"IsDecomposedBy");if(v)for(const I of v)this.saveItem(e,o,m,I,c)}}}setColor(e,t,s=!1){const n=this.components.get(Ue);for(const i in e){const r=n.list.get(i);if(!r)continue;const o=e[i];r.setColor(t,o,s)}}resetColor(e){const t=this.components.get(Ue);for(const s in e){const n=t.list.get(s);if(!n)continue;const i=e[s];n.resetColor(i)}}saveItem(e,t,s,n,i=null){this.list[t]||(this.list[t]={});const r=e.data.get(n);if(r)for(const o of r[0]){const l=e.keyFragments.get(o);if(l){const c=this.list[t];c[s]||(c[s]={map:{},id:i,name:s}),c[s].map[l]||(c[s].map[l]=new Set),c[s].map[l].add(n)}}}};x(yc,"uuid","e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");let Ap=yc;const Rp=class Cc extends Re{constructor(e){super(e),x(this,"onDisposed",new $),x(this,"enabled",!0),x(this,"height",10),x(this,"groupName","spatialStructures"),x(this,"list",new Set),e.add(Cc.uuid,this)}dispose(){this.list.clear(),this.onDisposed.trigger(),this.onDisposed.reset()}set(e){if(!this.enabled)return;const t=this.components.get(Ap),s=this.components.get(Ue),n=e?1:-1;let i=0;const r=t.list[this.groupName],o=new me;for(const l in r){o.elements[13]=i*n*this.height;for(const c in r[l].map){const u=s.list.get(c),p=l+c,m=this.list.has(p);if(!u||e&&m||!e&&!m)continue;e?this.list.add(p):this.list.delete(p);const E=r[l].map[c];u.applyTransform(E,o),u.mesh.computeBoundingSphere(),u.mesh.computeBoundingBox()}i++}}};x(Rp,"uuid","d260618b-ce88-4c7d-826c-6debb91de3e2");const Sp=class Tc extends Re{constructor(e){super(e),x(this,"enabled",!0),this.components.add(Tc.uuid,this)}set(e,t){const s=this.components.get(Ue);if(!t){for(const[n,i]of s.list)i&&(i.setVisibility(e),this.updateCulledVisibility(i));return}for(const n in t){const i=t[n],r=s.list.get(n);r&&(r.setVisibility(e,i),this.updateCulledVisibility(r))}}isolate(e){this.set(!1),this.set(!0,e)}updateCulledVisibility(e){const t=this.components.get(vp);for(const[s,n]of t.list){const i=n.colorMeshes.get(e.id);i&&(i.count=e.mesh.count)}}};x(Sp,"uuid","dd9ccf2d-8a21-4821-b7f6-2949add16a29");class Fp extends Za{constructor(){super(...arguments),x(this,"minGeometrySize",10),x(this,"minAssetsSize",1e3)}}const Pp=class bc extends Re{constructor(e){super(e),x(this,"onGeometryStreamed",new $),x(this,"onAssetStreamed",new $),x(this,"onProgress",new $),x(this,"onIfcLoaded",new $),x(this,"onDisposed",new $),x(this,"settings",new Fp),x(this,"enabled",!0),x(this,"webIfc",new xn),x(this,"_spatialTree",new mc),x(this,"_metaData",new Ec),x(this,"_visitedGeometries",new Map),x(this,"_streamSerializer",new kh),x(this,"_geometries",new Map),x(this,"_geometryCount",0),x(this,"_civil",new gc),x(this,"_groupSerializer",new Nh),x(this,"_assets",[]),x(this,"_meshesWithHoles",new Set),this.components.add(bc.uuid,this),this.settings.excludedCategories.add(Uh)}dispose(){this.onIfcLoaded.reset(),this.onGeometryStreamed.reset(),this.onAssetStreamed.reset(),this.webIfc.Dispose(),this.webIfc=null,this.onDisposed.trigger(),this.onDisposed.reset()}async streamFromBuffer(e){await this.readIfcFile(e),await this.streamAllGeometries(),this.cleanUp()}async streamFromCallBack(e){await this.streamIfcFile(e),await this.streamAllGeometries(),this.cleanUp()}async readIfcFile(e){const{path:t,absolute:s,logLevel:n}=this.settings.wasm;this.webIfc.SetWasmPath(t,s),await this.webIfc.Init(),n&&this.webIfc.SetLogLevel(n),this.webIfc.OpenModel(e,this.settings.webIfc)}async streamIfcFile(e){const{path:t,absolute:s,logLevel:n}=this.settings.wasm;this.webIfc.SetWasmPath(t,s),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 s=this.webIfc.GetIfcEntityList(0),n=[[]],i=new Bh;i.ifcMetadata={name:"",description:"",...this._metaData.getNameInfo(this.webIfc),...this._metaData.getDescriptionInfo(this.webIfc),schema:this.webIfc.GetModelSchema(0)||"IFC2X3",maxExpressID:this.webIfc.GetMaxExpressID(0)};let r=0,o=0;for(const v of s){if(!this.webIfc.IsIfcElement(v)&&v!==js||this.settings.excludedCategories.has(v))continue;const I=this.webIfc.GetLineIDsWithType(0,v),b=I.size();for(let A=0;Ae&&(r=0,o++,n.push([]));const S=I.get(A);n[o].push(S);const P=this.webIfc.GetLine(0,S);if(P.GlobalId){const M=(P==null?void 0:P.GlobalId.value)||(P==null?void 0:P.GlobalId);i.globalToExpressIDs.set(M,S)}const T=this._spatialTree.itemsByFloor[S]||0;i.data.set(S,[[],[T,v]]),r++}}this._spatialTree.cleanUp();let l=.01,c=0;for(const v of n){c++,this.webIfc.StreamMeshes(0,v,b=>{this.getMesh(this.webIfc,b,i)}),this._geometryCount>e&&await this.streamGeometries(),this._assets.length>t&&await this.streamAssets();const I=c/n.length;I>l&&(l+=.01,l=Math.max(l,I),this.onProgress.trigger(Math.round(l*100)/100))}this._geometryCount&&await this.streamGeometries(),this._assets.length&&await this.streamAssets();const{opaque:u,transparent:p}=i.geometryIDs;for(const[v,{index:I,uuid:b}]of this._visitedGeometries)i.keyFragments.set(I,b),(v>1?u:p).set(v,I);vc.get(i,this.webIfc);const m=this.webIfc.GetCoordinationMatrix(0);i.coordinationMatrix.fromArray(m),i.civilData=this._civil.read(this.webIfc);const E=this._groupSerializer.export(i);this.onIfcLoaded.trigger(E),i.dispose(!0)}cleanUp(){this.webIfc.Dispose(),this.webIfc=null,this.webIfc=new xn,this._visitedGeometries.clear(),this._geometries.clear(),this._assets=[],this._meshesWithHoles.clear()}getMesh(e,t,s){const n=t.geometries.size(),i=t.expressID,r={id:i,geometries:[]};for(let o=0;on&&(n=Math.round(n*100)/100,await this.onProgress.trigger(n),n+=.01)}await this.onProgress.trigger(1);const r=await this.components.get(Ti).processFromWebIfc(this.webIfc,0);await this.onIndicesStreamed.trigger(r)}cleanUp(){this.webIfc.Dispose(),this.webIfc=null,this.webIfc=new xn}}x(Mp,"uuid","88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");const xc=class Ac extends Re{constructor(e){super(e),x(this,"enabled",!0),e.add(Ac.uuid,this)}static distanceFromPointToLine(e,t,s,n=!1){const i=new yt,r=new O;return i.set(t,s),i.closestPointToPoint(e,n,r),r.distanceTo(e)}getFace(e,t,s){if(!e.geometry.index)throw new Error("Geometry must be indexed!");const n=new Map,i=e.geometry.index.array,{plane:r}=this.getFaceData(t,s,e),o=[];for(let p=0;pT.id);if(!E.size){const T=l++;for(const{id:M}of m)c.set(M,T);u.set(T,{edges:new Set(v),indices:new Set([p])});continue}let I=null;const b=new Set,A=new Set(v);for(const[T,M]of E){I===null?I=M:M!==I&&b.add(M),c.delete(T);const{edges:V}=u.get(M);V.delete(T),A.delete(T)}if(I===null)throw new Error("Error computing face!");const S=u.get(I),{indices:P}=S;P.add(p);for(const T of A){c.set(T,I);const{edges:M}=S;M.add(T)}for(const T of b){const M=u.get(T),{edges:V,indices:G}=M,H=u.get(I),{edges:j,indices:Q}=H;for(const J of V)j.add(J),c.set(J,I);for(const J of G)Q.add(J);u.delete(T)}}for(const[p,{indices:m,edges:E}]of u)if(m.has(t)){const v=[];for(const I of E){const b=n.get(I);v.push(b)}return{edges:v,indices:m}}return null}getVerticesAndNormal(e,t,s){if(!e.geometry.index)throw new Error("Geometry must be indexed!");const n=e.geometry.index.array,i=e.geometry.attributes.position.array,r=e.geometry.attributes.normal.array,o=n[t*3]*3,l=n[t*3+1]*3,c=n[t*3+2]*3,u=new O(i[o],i[o+1],i[o+2]),p=new O(i[l],i[l+1],i[l+2]),m=new O(i[c],i[c+1],i[c+2]),E=new O(r[o],r[o+1],r[o+2]),v=new O(r[l],r[l+1],r[l+2]),I=new O(r[c],r[c+1],r[c+2]),b=(E.x+v.x+I.x)/3,A=(E.y+v.y+I.y)/3,S=(E.z+v.z+I.z)/3,P=new O(b,A,S);if(s!==void 0&&e instanceof It){const T=new me;e.getMatrixAt(s,T);const M=new me;M.extractRotation(T),P.applyMatrix4(M),u.applyMatrix4(T),p.applyMatrix4(T),m.applyMatrix4(T)}return{p1:u,p2:p,p3:m,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}getVolumeFromFragments(e){const t=this.components.get(Ue),s=new me,n=[];for(const r in e){const o=t.list.get(r);if(!o)continue;const l=e[r];let c=0;for(const m of l){const E=o.getInstancesIDs(m);E&&(c+=E.size)}const u=new It(o.mesh.geometry,void 0,c);let p=0;for(const m of l){const E=o.getInstancesIDs(m);if(E)for(const v of E)o.mesh.getMatrixAt(v,s),u.setMatrixAt(p++,s)}n.push(u)}const i=this.getVolumeFromMeshes(n);for(const r of n)r.geometry=null,r.material=[],r.dispose();return i}getVolumeFromMeshes(e){let t=0;for(const s of e)t+=this.getVolumeOfMesh(s);return t}getFaceData(e,t,s){const n=this.getVerticesAndNormal(s,e,t),{p1:i,p2:r,p3:o,faceNormal:l}=n;this.round(i),this.round(r),this.round(o),this.round(l);const c=[{id:`${i.x}|${i.y}|${i.z}`,value:i},{id:`${r.x}|${r.y}|${r.z}`,value:r},{id:`${o.x}|${o.y}|${o.z}`,value:o}];c.sort((S,P)=>S.idP.id?1:0);const[{id:u,value:p},{id:m,value:E},{id:v,value:I}]=c,b=[{id:`${u}|${m}`,distance:p.distanceTo(E),points:[p,E]},{id:`${m}|${v}`,distance:E.distanceTo(I),points:[E,I]},{id:`${u}|${v}`,distance:p.distanceTo(I),points:[p,I]}],A=new bs;return A.setFromNormalAndCoplanarPoint(l,i),A.constant=Math.round(A.constant*10)/10,{plane:A,edges:b}}getVolumeOfMesh(e){let t=0;const s=new O,n=new O,i=new O,{index:r}=e.geometry,o=e.geometry.attributes.position.array;if(!r)return console.warn("Geometry must be indexed to compute its volume!"),0;const l=[];if(e instanceof It)for(let u=0;u #include #include @@ -1396,7 +1396,7 @@ void main() { gl_FragColor = corrected; } - `}createOutlinePostProcessMaterial(){return new ht({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 gt(this._lineColor)},screenSize:{value:new An(this.resolution.x,this.resolution.y,1/this.resolution.x,1/this.resolution.y)}},vertexShader:this.vertexShader,fragmentShader:this.fragmentShader})}newRenderTarget(){const e=new as(this.resolution.x,this.resolution.y);return e.texture.colorSpace="srgb-linear",e.texture.format=Yh,e.texture.type=Va,e.texture.minFilter=rs,e.texture.magFilter=rs,e.texture.generateMipmaps=!1,e.stencilBuffer=!1,e}}class ym{constructor(e,t,s){if(y(this,"composer"),y(this,"overrideClippingPlanes",!1),y(this,"_components"),y(this,"_world"),y(this,"_renderTarget"),y(this,"_enabled",!1),y(this,"_initialized",!1),y(this,"_n8ao"),y(this,"_customEffects"),y(this,"_basePass"),y(this,"_gammaPass"),y(this,"_depthTexture"),y(this,"_renderer"),y(this,"_settings",{gamma:!0,custom:!0,ao:!1}),!s.renderer)throw new Error("The given world must have a renderer!");this._components=e,this._renderer=t,this._world=s,this._renderTarget=new as(window.innerWidth,window.innerHeight),this._renderTarget.texture.colorSpace="srgb-linear",this.composer=new am(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,s,n;this._renderTarget.dispose(),(e=this._depthTexture)==null||e.dispose(),(t=this._customEffects)==null||t.dispose(),(s=this._gammaPass)==null||s.dispose(),(n=this._n8ao)==null||n.dispose()}setPasses(e){let t=!1;for(const s in e){const n=s;if(this.settings[n]!==e[n]){t=!0;break}}if(t){for(const s in e){const n=s;this._settings[n]!==void 0&&(this._settings[n]=e[n])}this.updatePasses()}}setSize(e,t){if(this._initialized){const s=this._settings.custom;s&&this.setPasses({custom:!1}),this.setPasses({custom:!1}),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),s&&this.setPasses({custom:!0})}}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)}updateProjection(e){this.composer.passes.forEach(t=>{t.camera=e}),this.update()}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 Ws))throw new Error("The given scene must have a THREE.Scene as core!");const s=this._world.camera;s.projection&&s.projection.onChanged.add(()=>{this.updateCamera()});const n=this._world.renderer;this.overrideClippingPlanes||(this._renderer.clippingPlanes=n.clippingPlanes),this._renderer.outputColorSpace="srgb",this._renderer.toneMapping=Wd,this.newBasePass(e,t),this.newSaoPass(e,t),this.newGammaPass(),this.newCustomPass(e,t),this._initialized=!0,this.updatePasses()}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 wm(new ke(window.innerWidth,window.innerHeight),this._components,this._world,e,t)}newGammaPass(){this._gammaPass=new kc(gm)}newSaoPass(e,t){if(!this._world.renderer)throw new Error("The given world must have a renderer!");const{width:s,height:n}=this._world.renderer.getSize();this._n8ao=new mm(e,t,s,n);const{configuration:i}=this._n8ao;i.aoSamples=16,i.denoiseSamples=1,i.denoiseRadius=13,i.aoRadius=1,i.distanceFalloff=4,i.aoRadius=1,i.intensity=4,i.halfRes=!0,i.color=new gt().setHex(13421772,"srgb-linear")}newBasePass(e,t){this._basePass=new lm(e,t)}}class xa extends Bp{constructor(e,t,s){super(e,t,s),y(this,"_postproduction"),this.onResize.add(n=>this.resizePostproduction(n)),this.onWorldChanged.add(()=>{this.currentWorld&&(this._postproduction&&this._postproduction.dispose(),this._postproduction=new ym(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 Ws&&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,s=e?e.y:this.container.clientHeight;this.postproduction.setSize(t,s)}}class Im{constructor(e,t,s,n,i){y(this,"mesh",new ie(new De)),y(this,"components"),y(this,"world"),y(this,"styleName"),y(this,"_precission",1e4),y(this,"_tempVector",new O),y(this,"_plane"),y(this,"_geometry"),y(this,"_plane2DCoordinateSystem",new me),y(this,"_planeAxis"),this.components=e,this.world=t,this.mesh.material=i,this.mesh.frustumCulled=!1,this.mesh.userData.indexFragmentMap=new Map,this._plane=s;const{x:r,y:o,z:l}=s.normal;Math.abs(r)===1?this._planeAxis="x":Math.abs(o)===1?this._planeAxis="y":Math.abs(l)===1&&(this._planeAxis="z"),this._geometry=n,this.mesh.geometry.attributes.position=n.attributes.position;const c=s.normal.clone().multiplyScalar(.01);this.mesh.position.copy(c),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.userData.indexFragmentMap.clear(),this.mesh.userData={},this.mesh.geometry.dispose(),this.mesh.removeFromParent(),this.mesh.geometry=null,this.mesh=null,this._plane=null,this._geometry=null,this.components=null}update(e,t){const s=this._geometry.attributes.position.array;if(!s)return;this.updatePlane2DCoordinateSystem();const{userData:n}=this.mesh,i=n.indexFragmentMap;i.clear();let r=0;const o=[];let l=0;const c=this.components.get(Ue);for(const[u,p]of t)for(const m in p){const E=c.list.get(m);E&&(E.mesh.userData.fills||(E.mesh.userData.fills=new Set),E.mesh.userData.fills.add(this.mesh))}for(let u=0;uthis._localPlane.intersectsBox(n),intersectsTriangle:n=>{let i=0;if(this._tempLine.start.copy(n.a),this._tempLine.end.copy(n.b),this._localPlane.intersectLine(this._tempLine,this._tempVector)){const r=this._tempVector.applyMatrix4(e.matrixWorld);t.setXYZ(s,r.x,r.y,r.z),i++,s++}if(this._tempLine.start.copy(n.b),this._tempLine.end.copy(n.c),this._localPlane.intersectLine(this._tempLine,this._tempVector)){const r=this._tempVector.applyMatrix4(e.matrixWorld);t.setXYZ(s,r.x,r.y,r.z),i++,s++}if(this._tempLine.start.copy(n.c),this._tempLine.end.copy(n.a),this._localPlane.intersectLine(this._tempLine,this._tempVector)){const r=this._tempVector.applyMatrix4(e.matrixWorld);t.setXYZ(s,r.x,r.y,r.z),i++,s++}i!==2&&(s-=i)}}),s}updateDeletedEdges(e){const t=Object.keys(this._edges);for(const s of t)e[s]===void 0&&(this.disposeEdge(s),this.disposeOutline(s))}disposeOutline(e){if(!this.world.renderer)return;const t=this.world.renderer;if(t instanceof xa){const s=t.postproduction.customEffects.outlinedMeshes;delete s[e]}}disposeEdge(e){const t=this.components.get(hs),s=this._edges[e];s.fill&&s.fill.dispose(),t.destroy(s.mesh,!1),delete this._edges[e]}}class yi extends jr{constructor(e,t,s,n,i,r=5,o=!0){super(e,t,s,n,i,r,o),y(this,"edges"),y(this,"edgesMaxUpdateRate",50),y(this,"_visible",!0),y(this,"_edgesVisible",!0),y(this,"updateFill",()=>{this.edges.fillNeedsUpdate=!0,this.edges.update(),this.edges.visible=this._visible}),this.edges=new Cm(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 Tm{constructor(){y(this,"onDisposed",new $),y(this,"enabled",!0),y(this,"list",{}),y(this,"_defaultLineMaterial",new xs({color:0,linewidth:.001})),y(this,"onAfterUpdate",new $),y(this,"onBeforeUpdate",new $)}update(e){this.onBeforeUpdate.trigger(this.list),this.onAfterUpdate.trigger(this.list)}create(e,t,s,n,i,r){if(!s.renderer)throw new Error("The given world doesn't have a renderer!");n||(n=this._defaultLineMaterial);for(const c of t)c.geometry.boundsTree||c.geometry.computeBoundsTree();const o=s.renderer;n.clippingPlanes=o.clippingPlanes;const l={name:e,lineMaterial:n,meshes:t,fillMaterial:i,outlineMaterial:r,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 s,n;const i=this.list[e];i&&(i.meshes.clear(),t&&(i.lineMaterial.dispose(),(s=i.fillMaterial)==null||s.dispose(),(n=i.outlineMaterial)==null||n.dispose())),delete this.list[e]}}const Vc=class Gc extends Re{constructor(e){super(e),y(this,"onDisposed",new $),y(this,"enabled",!0),y(this,"styles"),y(this,"fillsNeedUpdate",!1),y(this,"_visible",!0),this.components.list.set(Gc.uuid,this),this.styles=new Tm}get visible(){return this._visible}set visible(e){this._visible=e;const t=this.components.get(gi);for(const s of t.list)s instanceof yi&&(s.edges.visible=e)}dispose(){this.styles.dispose(),this.onDisposed.trigger()}async update(e=!1){if(!this.enabled)return;const t=this.components.get(gi);for(const s of t.list)s instanceof yi&&(e||this.fillsNeedUpdate?s.updateFill():s.update());this.fillsNeedUpdate=!1}};y(Vc,"uuid","24dfc306-a3c4-410f-8071-babc4afa5e4d");let Fr=Vc;const bm={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:` + `}createOutlinePostProcessMaterial(){return new ht({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 gt(this._lineColor)},screenSize:{value:new An(this.resolution.x,this.resolution.y,1/this.resolution.x,1/this.resolution.y)}},vertexShader:this.vertexShader,fragmentShader:this.fragmentShader})}newRenderTarget(){const e=new as(this.resolution.x,this.resolution.y);return e.texture.colorSpace="srgb-linear",e.texture.format=Yh,e.texture.type=Va,e.texture.minFilter=rs,e.texture.magFilter=rs,e.texture.generateMipmaps=!1,e.stencilBuffer=!1,e}}class ym{constructor(e,t,s){if(y(this,"composer"),y(this,"overrideClippingPlanes",!1),y(this,"_components"),y(this,"_world"),y(this,"_renderTarget"),y(this,"_enabled",!1),y(this,"_initialized",!1),y(this,"_n8ao"),y(this,"_customEffects"),y(this,"_basePass"),y(this,"_gammaPass"),y(this,"_depthTexture"),y(this,"_renderer"),y(this,"_settings",{gamma:!0,custom:!0,ao:!1}),!s.renderer)throw new Error("The given world must have a renderer!");this._components=e,this._renderer=t,this._world=s,this._renderTarget=new as(window.innerWidth,window.innerHeight),this._renderTarget.texture.colorSpace="srgb-linear",this.composer=new am(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,s,n;this._renderTarget.dispose(),(e=this._depthTexture)==null||e.dispose(),(t=this._customEffects)==null||t.dispose(),(s=this._gammaPass)==null||s.dispose(),(n=this._n8ao)==null||n.dispose()}setPasses(e){let t=!1;for(const s in e){const n=s;if(this.settings[n]!==e[n]){t=!0;break}}if(t){for(const s in e){const n=s;this._settings[n]!==void 0&&(this._settings[n]=e[n])}this.updatePasses()}}setSize(e,t){if(this._initialized){const s=this._settings.custom;s&&this.setPasses({custom:!1}),this.setPasses({custom:!1}),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),s&&this.setPasses({custom:!0})}}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)}updateProjection(e){this.composer.passes.forEach(t=>{t.camera=e}),this.update()}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 Ws))throw new Error("The given scene must have a THREE.Scene as core!");const s=this._world.camera;s.projection&&s.projection.onChanged.add(()=>{this.updateCamera()});const n=this._world.renderer;this.overrideClippingPlanes||(this._renderer.clippingPlanes=n.clippingPlanes),this._renderer.outputColorSpace="srgb",this._renderer.toneMapping=Wd,this.newBasePass(e,t),this.newSaoPass(e,t),this.newGammaPass(),this.newCustomPass(e,t),this._initialized=!0,this.updatePasses()}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 wm(new ke(window.innerWidth,window.innerHeight),this._components,this._world,e,t)}newGammaPass(){this._gammaPass=new kc(gm)}newSaoPass(e,t){if(!this._world.renderer)throw new Error("The given world must have a renderer!");const{width:s,height:n}=this._world.renderer.getSize();this._n8ao=new mm(e,t,s,n);const{configuration:i}=this._n8ao;i.aoSamples=16,i.denoiseSamples=1,i.denoiseRadius=13,i.aoRadius=1,i.distanceFalloff=4,i.aoRadius=1,i.intensity=4,i.halfRes=!0,i.color=new gt().setHex(13421772,"srgb-linear")}newBasePass(e,t){this._basePass=new lm(e,t)}}class xa extends Bp{constructor(e,t,s){super(e,t,s),y(this,"_postproduction"),this.onResize.add(n=>this.resizePostproduction(n)),this.onWorldChanged.add(()=>{this.currentWorld&&(this._postproduction&&this._postproduction.dispose(),this._postproduction=new ym(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 Ws&&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,s=e?e.y:this.container.clientHeight;this.postproduction.setSize(t,s)}}class Im{constructor(e,t,s,n,i){y(this,"mesh",new ie(new De)),y(this,"components"),y(this,"world"),y(this,"styleName"),y(this,"_precission",1e4),y(this,"_tempVector",new O),y(this,"_plane"),y(this,"_geometry"),y(this,"_plane2DCoordinateSystem",new me),y(this,"_planeAxis"),this.components=e,this.world=t,this.mesh.material=i,this.mesh.frustumCulled=!1,this.mesh.userData.indexFragmentMap=new Map,this._plane=s;const{x:r,y:o,z:l}=s.normal;Math.abs(r)===1?this._planeAxis="x":Math.abs(o)===1?this._planeAxis="y":Math.abs(l)===1&&(this._planeAxis="z"),this._geometry=n,this.mesh.geometry.attributes.position=n.attributes.position;const c=s.normal.clone().multiplyScalar(.01);this.mesh.position.copy(c),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.userData.indexFragmentMap.clear(),this.mesh.userData={},this.mesh.geometry.dispose(),this.mesh.removeFromParent(),this.mesh.geometry=null,this.mesh=null,this._plane=null,this._geometry=null,this.components=null}update(e,t){const s=this._geometry.attributes.position.array;if(!s)return;this.updatePlane2DCoordinateSystem();const{userData:n}=this.mesh,i=n.indexFragmentMap;i.clear();let r=0;const o=[];let l=0;const c=this.components.get(Ue);for(const[u,p]of t)for(const m in p){const E=c.list.get(m);E&&(E.mesh.userData.fills||(E.mesh.userData.fills=new Set),E.mesh.userData.fills.add(this.mesh))}for(let u=0;uthis._localPlane.intersectsBox(n),intersectsTriangle:n=>{let i=0;if(this._tempLine.start.copy(n.a),this._tempLine.end.copy(n.b),this._localPlane.intersectLine(this._tempLine,this._tempVector)){const r=this._tempVector.applyMatrix4(e.matrixWorld);t.setXYZ(s,r.x,r.y,r.z),i++,s++}if(this._tempLine.start.copy(n.b),this._tempLine.end.copy(n.c),this._localPlane.intersectLine(this._tempLine,this._tempVector)){const r=this._tempVector.applyMatrix4(e.matrixWorld);t.setXYZ(s,r.x,r.y,r.z),i++,s++}if(this._tempLine.start.copy(n.c),this._tempLine.end.copy(n.a),this._localPlane.intersectLine(this._tempLine,this._tempVector)){const r=this._tempVector.applyMatrix4(e.matrixWorld);t.setXYZ(s,r.x,r.y,r.z),i++,s++}i!==2&&(s-=i)}}),s}updateDeletedEdges(e){const t=Object.keys(this._edges);for(const s of t)e[s]===void 0&&(this.disposeEdge(s),this.disposeOutline(s))}disposeOutline(e){if(!this.world.renderer)return;const t=this.world.renderer;if(t instanceof xa){const s=t.postproduction.customEffects.outlinedMeshes;delete s[e]}}disposeEdge(e){const t=this.components.get(hs),s=this._edges[e];s.fill&&s.fill.dispose(),t.destroy(s.mesh,!1),delete this._edges[e]}}class yi extends jr{constructor(e,t,s,n,i,r=5,o=!0){super(e,t,s,n,i,r,o),y(this,"edges"),y(this,"edgesMaxUpdateRate",50),y(this,"_visible",!0),y(this,"_edgesVisible",!0),y(this,"updateFill",()=>{this.edges.fillNeedsUpdate=!0,this.edges.update()}),this.edges=new Cm(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 Tm{constructor(){y(this,"onDisposed",new $),y(this,"enabled",!0),y(this,"list",{}),y(this,"_defaultLineMaterial",new xs({color:0,linewidth:.001})),y(this,"onAfterUpdate",new $),y(this,"onBeforeUpdate",new $)}update(e){this.onBeforeUpdate.trigger(this.list),this.onAfterUpdate.trigger(this.list)}create(e,t,s,n,i,r){if(!s.renderer)throw new Error("The given world doesn't have a renderer!");n||(n=this._defaultLineMaterial);for(const c of t)c.geometry.boundsTree||c.geometry.computeBoundsTree();const o=s.renderer;n.clippingPlanes=o.clippingPlanes;const l={name:e,lineMaterial:n,meshes:t,fillMaterial:i,outlineMaterial:r,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 s,n;const i=this.list[e];i&&(i.meshes.clear(),t&&(i.lineMaterial.dispose(),(s=i.fillMaterial)==null||s.dispose(),(n=i.outlineMaterial)==null||n.dispose())),delete this.list[e]}}const Vc=class Gc extends Re{constructor(e){super(e),y(this,"onDisposed",new $),y(this,"enabled",!0),y(this,"styles"),y(this,"fillsNeedUpdate",!1),y(this,"_visible",!0),this.components.list.set(Gc.uuid,this),this.styles=new Tm}get visible(){return this._visible}set visible(e){this._visible=e;const t=this.components.get(gi);for(const s of t.list)s instanceof yi&&(s.edges.visible=e)}dispose(){this.styles.dispose(),this.onDisposed.trigger()}async update(e=!1){if(!this.enabled)return;const t=this.components.get(gi);for(const s of t.list)s instanceof yi&&(e||this.fillsNeedUpdate?s.updateFill():s.update());this.fillsNeedUpdate=!1}};y(Vc,"uuid","24dfc306-a3c4-410f-8071-babc4afa5e4d");let Fr=Vc;const bm={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:` varying vec2 vUv; diff --git a/examples/assets/index-BiTRO_4n.js b/examples/assets/index-CrYKit3B.js similarity index 99% rename from examples/assets/index-BiTRO_4n.js rename to examples/assets/index-CrYKit3B.js index ebb25eb54..ee7d0e2a4 100644 --- a/examples/assets/index-BiTRO_4n.js +++ b/examples/assets/index-CrYKit3B.js @@ -1,4 +1,4 @@ -import{C as Ki,i as _r,o as xr,h as It,a as Te,b as wr,S as $r,A as Cr,g as Er,d as Ar,B as tn}from"./index-D2xchnNe.js";import{V as en,c as mi,G as xn,F as Sr,L as kr,d as wn,e as Or,f as Tr,P as Ge,g as he,D as Nr,A as Pr,C as Ne,O as Mr,h as Ir,I as Cs,i as Es,j as As,k as Lr,l as zr,m as Ss,n as ks,o as Os,p as Rr,R as jr}from"./web-ifc-api-CfQNUy7g.js";import{B as Hr,a as Dr,S as P}from"./index-Bpjba_Wq.js";var Fr=Object.defineProperty,Br=(e,t,i)=>t in e?Fr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Et=(e,t,i)=>(Br(e,typeof t!="symbol"?t+"":t,i),i);const Ut=Math.min,it=Math.max,ei=Math.round,bt=e=>({x:e,y:e}),Ur={left:"right",right:"left",bottom:"top",top:"bottom"},Vr={start:"end",end:"start"};function $n(e,t,i){return it(e,Ut(t,i))}function Pe(e,t){return typeof e=="function"?e(t):e}function nt(e){return e.split("-")[0]}function fi(e){return e.split("-")[1]}function Ts(e){return e==="x"?"y":"x"}function Ns(e){return e==="y"?"height":"width"}function Nt(e){return["top","bottom"].includes(nt(e))?"y":"x"}function Ps(e){return Ts(Nt(e))}function Wr(e,t,i){i===void 0&&(i=!1);const n=fi(e),s=Ps(e),o=Ns(s);let r=s==="x"?n===(i?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=ii(r)),[r,ii(r)]}function qr(e){const t=ii(e);return[Ri(e),t,Ri(t)]}function Ri(e){return e.replace(/start|end/g,t=>Vr[t])}function Gr(e,t,i){const n=["left","right"],s=["right","left"],o=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return i?t?s:n:t?n:s;case"left":case"right":return t?o:r;default:return[]}}function Yr(e,t,i,n){const s=fi(e);let o=Gr(nt(e),i==="start",n);return s&&(o=o.map(r=>r+"-"+s),t&&(o=o.concat(o.map(Ri)))),o}function ii(e){return e.replace(/left|right|bottom|top/g,t=>Ur[t])}function Xr(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ms(e){return typeof e!="number"?Xr(e):{top:e,right:e,bottom:e,left:e}}function Vt(e){const{x:t,y:i,width:n,height:s}=e;return{width:n,height:s,top:i,left:t,right:t+n,bottom:i+s,x:t,y:i}}function Cn(e,t,i){let{reference:n,floating:s}=e;const o=Nt(t),r=Ps(t),a=Ns(r),l=nt(t),u=o==="y",h=n.x+n.width/2-s.width/2,c=n.y+n.height/2-s.height/2,d=n[a]/2-s[a]/2;let p;switch(l){case"top":p={x:h,y:n.y-s.height};break;case"bottom":p={x:h,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:c};break;case"left":p={x:n.x-s.width,y:c};break;default:p={x:n.x,y:n.y}}switch(fi(t)){case"start":p[r]-=d*(i&&u?-1:1);break;case"end":p[r]+=d*(i&&u?-1:1);break}return p}const Jr=async(e,t,i)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:r}=i,a=o.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let u=await r.getElementRects({reference:e,floating:t,strategy:s}),{x:h,y:c}=Cn(u,n,l),d=n,p={},y=0;for(let x=0;xM<=0)){var lt,tt;const M=(((lt=o.flip)==null?void 0:lt.index)||0)+1,ut=E[M];if(ut)return{data:{index:M,overflows:k},reset:{placement:ut}};let J=(tt=k.filter(Q=>Q.overflows[0]<=0).sort((Q,B)=>Q.overflows[1]-B.overflows[1])[0])==null?void 0:tt.placement;if(!J)switch(p){case"bestFit":{var ct;const Q=(ct=k.filter(B=>{if($){const U=Nt(B.placement);return U===g||U==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(U=>U>0).reduce((U,ce)=>U+ce,0)]).sort((B,U)=>B[1]-U[1])[0])==null?void 0:ct[0];Q&&(J=Q);break}case"initialPlacement":J=a;break}if(s!==J)return{reset:{placement:J}}}return{}}}};function Is(e){const t=Ut(...e.map(o=>o.left)),i=Ut(...e.map(o=>o.top)),n=it(...e.map(o=>o.right)),s=it(...e.map(o=>o.bottom));return{x:t,y:i,width:n-t,height:s-i}}function Zr(e){const t=e.slice().sort((s,o)=>s.y-o.y),i=[];let n=null;for(let s=0;sn.height/2?i.push([o]):i[i.length-1].push(o),n=o}return i.map(s=>Vt(Is(s)))}const Kr=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:i,elements:n,rects:s,platform:o,strategy:r}=t,{padding:a=2,x:l,y:u}=Pe(e,t),h=Array.from(await(o.getClientRects==null?void 0:o.getClientRects(n.reference))||[]),c=Zr(h),d=Vt(Is(h)),p=Ms(a);function y(){if(c.length===2&&c[0].left>c[1].right&&l!=null&&u!=null)return c.find(b=>l>b.left-p.left&&lb.top-p.top&&u=2){if(Nt(i)==="y"){const k=c[0],lt=c[c.length-1],tt=nt(i)==="top",ct=k.top,M=lt.bottom,ut=tt?k.left:lt.left,J=tt?k.right:lt.right,Q=J-ut,B=M-ct;return{top:ct,bottom:M,left:ut,right:J,width:Q,height:B,x:ut,y:ct}}const b=nt(i)==="left",f=it(...c.map(k=>k.right)),g=Ut(...c.map(k=>k.left)),v=c.filter(k=>b?k.left===g:k.right===f),w=v[0].top,C=v[v.length-1].bottom,$=g,E=f,H=E-$,R=C-w;return{top:w,bottom:C,left:$,right:E,width:H,height:R,x:$,y:w}}return d}const x=await o.getElementRects({reference:{getBoundingClientRect:y},floating:n.floating,strategy:r});return s.reference.x!==x.reference.x||s.reference.y!==x.reference.y||s.reference.width!==x.reference.width||s.reference.height!==x.reference.height?{reset:{rects:x}}:{}}}};async function ta(e,t){const{placement:i,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),r=nt(i),a=fi(i),l=Nt(i)==="y",u=["left","top"].includes(r)?-1:1,h=o&&l?-1:1,c=Pe(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:y}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...c};return a&&typeof y=="number"&&(p=a==="end"?y*-1:y),l?{x:p*h,y:d*u}:{x:d*u,y:p*h}}const Ls=function(e){return{name:"offset",options:e,async fn(t){var i,n;const{x:s,y:o,placement:r,middlewareData:a}=t,l=await ta(t,e);return r===((i=a.offset)==null?void 0:i.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:r}}}}},ea=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:n,placement:s}=t,{mainAxis:o=!0,crossAxis:r=!1,limiter:a={fn:b=>{let{x:f,y:g}=b;return{x:f,y:g}}},...l}=Pe(e,t),u={x:i,y:n},h=await nn(t,l),c=Nt(nt(s)),d=Ts(c);let p=u[d],y=u[c];if(o){const b=d==="y"?"top":"left",f=d==="y"?"bottom":"right",g=p+h[b],v=p-h[f];p=$n(g,p,v)}if(r){const b=c==="y"?"top":"left",f=c==="y"?"bottom":"right",g=y+h[b],v=y-h[f];y=$n(g,y,v)}const x=a.fn({...t,[d]:p,[c]:y});return{...x,data:{x:x.x-i,y:x.y-n}}}}};function gt(e){return zs(e)?(e.nodeName||"").toLowerCase():"#document"}function D(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yt(e){var t;return(t=(zs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function zs(e){return e instanceof Node||e instanceof D(e).Node}function st(e){return e instanceof Element||e instanceof D(e).Element}function Z(e){return e instanceof HTMLElement||e instanceof D(e).HTMLElement}function En(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof D(e).ShadowRoot}function Me(e){const{overflow:t,overflowX:i,overflowY:n,display:s}=W(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+i)&&!["inline","contents"].includes(s)}function ia(e){return["table","td","th"].includes(gt(e))}function na(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function sn(e){const t=on(),i=W(e);return i.transform!=="none"||i.perspective!=="none"||(i.containerType?i.containerType!=="normal":!1)||!t&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!t&&(i.filter?i.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(i.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(i.contain||"").includes(n))}function sa(e){let t=Wt(e);for(;Z(t)&&!bi(t);){if(na(t))return null;if(sn(t))return t;t=Wt(t)}return null}function on(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function bi(e){return["html","body","#document"].includes(gt(e))}function W(e){return D(e).getComputedStyle(e)}function gi(e){return st(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Wt(e){if(gt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||En(e)&&e.host||yt(e);return En(t)?t.host:t}function Rs(e){const t=Wt(e);return bi(t)?e.ownerDocument?e.ownerDocument.body:e.body:Z(t)&&Me(t)?t:Rs(t)}function ji(e,t,i){var n;t===void 0&&(t=[]),i===void 0&&(i=!0);const s=Rs(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),r=D(s);return o?t.concat(r,r.visualViewport||[],Me(s)?s:[],r.frameElement&&i?ji(r.frameElement):[]):t.concat(s,ji(s,[],i))}function js(e){const t=W(e);let i=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=Z(e),o=s?e.offsetWidth:i,r=s?e.offsetHeight:n,a=ei(i)!==o||ei(n)!==r;return a&&(i=o,n=r),{width:i,height:n,$:a}}function Hs(e){return st(e)?e:e.contextElement}function Ft(e){const t=Hs(e);if(!Z(t))return bt(1);const i=t.getBoundingClientRect(),{width:n,height:s,$:o}=js(t);let r=(o?ei(i.width):i.width)/n,a=(o?ei(i.height):i.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const oa=bt(0);function Ds(e){const t=D(e);return!on()||!t.visualViewport?oa:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ra(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==D(e)?!1:t}function _e(e,t,i,n){t===void 0&&(t=!1),i===void 0&&(i=!1);const s=e.getBoundingClientRect(),o=Hs(e);let r=bt(1);t&&(n?st(n)&&(r=Ft(n)):r=Ft(e));const a=ra(o,i,n)?Ds(o):bt(0);let l=(s.left+a.x)/r.x,u=(s.top+a.y)/r.y,h=s.width/r.x,c=s.height/r.y;if(o){const d=D(o),p=n&&st(n)?D(n):n;let y=d,x=y.frameElement;for(;x&&n&&p!==y;){const b=Ft(x),f=x.getBoundingClientRect(),g=W(x),v=f.left+(x.clientLeft+parseFloat(g.paddingLeft))*b.x,w=f.top+(x.clientTop+parseFloat(g.paddingTop))*b.y;l*=b.x,u*=b.y,h*=b.x,c*=b.y,l+=v,u+=w,y=D(x),x=y.frameElement}}return Vt({width:h,height:c,x:l,y:u})}const aa=[":popover-open",":modal"];function Fs(e){return aa.some(t=>{try{return e.matches(t)}catch{return!1}})}function la(e){let{elements:t,rect:i,offsetParent:n,strategy:s}=e;const o=s==="fixed",r=yt(n),a=t?Fs(t.floating):!1;if(n===r||a&&o)return i;let l={scrollLeft:0,scrollTop:0},u=bt(1);const h=bt(0),c=Z(n);if((c||!c&&!o)&&((gt(n)!=="body"||Me(r))&&(l=gi(n)),Z(n))){const d=_e(n);u=Ft(n),h.x=d.x+n.clientLeft,h.y=d.y+n.clientTop}return{width:i.width*u.x,height:i.height*u.y,x:i.x*u.x-l.scrollLeft*u.x+h.x,y:i.y*u.y-l.scrollTop*u.y+h.y}}function ca(e){return Array.from(e.getClientRects())}function Bs(e){return _e(yt(e)).left+gi(e).scrollLeft}function ua(e){const t=yt(e),i=gi(e),n=e.ownerDocument.body,s=it(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=it(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-i.scrollLeft+Bs(e);const a=-i.scrollTop;return W(n).direction==="rtl"&&(r+=it(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:r,y:a}}function ha(e,t){const i=D(e),n=yt(e),s=i.visualViewport;let o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;const u=on();(!u||u&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a,y:l}}function da(e,t){const i=_e(e,!0,t==="fixed"),n=i.top+e.clientTop,s=i.left+e.clientLeft,o=Z(e)?Ft(e):bt(1),r=e.clientWidth*o.x,a=e.clientHeight*o.y,l=s*o.x,u=n*o.y;return{width:r,height:a,x:l,y:u}}function An(e,t,i){let n;if(t==="viewport")n=ha(e,i);else if(t==="document")n=ua(yt(e));else if(st(t))n=da(t,i);else{const s=Ds(e);n={...t,x:t.x-s.x,y:t.y-s.y}}return Vt(n)}function Us(e,t){const i=Wt(e);return i===t||!st(i)||bi(i)?!1:W(i).position==="fixed"||Us(i,t)}function pa(e,t){const i=t.get(e);if(i)return i;let n=ji(e,[],!1).filter(a=>st(a)&>(a)!=="body"),s=null;const o=W(e).position==="fixed";let r=o?Wt(e):e;for(;st(r)&&!bi(r);){const a=W(r),l=sn(r);!l&&a.position==="fixed"&&(s=null),(o?!l&&!s:!l&&a.position==="static"&&s&&["absolute","fixed"].includes(s.position)||Me(r)&&!l&&Us(e,r))?n=n.filter(u=>u!==r):s=a,r=Wt(r)}return t.set(e,n),n}function ma(e){let{element:t,boundary:i,rootBoundary:n,strategy:s}=e;const o=[...i==="clippingAncestors"?pa(t,this._c):[].concat(i),n],r=o[0],a=o.reduce((l,u)=>{const h=An(t,u,s);return l.top=it(h.top,l.top),l.right=Ut(h.right,l.right),l.bottom=Ut(h.bottom,l.bottom),l.left=it(h.left,l.left),l},An(t,r,s));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function fa(e){const{width:t,height:i}=js(e);return{width:t,height:i}}function ba(e,t,i){const n=Z(t),s=yt(t),o=i==="fixed",r=_e(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=bt(0);if(n||!n&&!o)if((gt(t)!=="body"||Me(s))&&(a=gi(t)),n){const c=_e(t,!0,o,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else s&&(l.x=Bs(s));const u=r.left+a.scrollLeft-l.x,h=r.top+a.scrollTop-l.y;return{x:u,y:h,width:r.width,height:r.height}}function Sn(e,t){return!Z(e)||W(e).position==="fixed"?null:t?t(e):e.offsetParent}function Vs(e,t){const i=D(e);if(!Z(e)||Fs(e))return i;let n=Sn(e,t);for(;n&&ia(n)&&W(n).position==="static";)n=Sn(n,t);return n&&(gt(n)==="html"||gt(n)==="body"&&W(n).position==="static"&&!sn(n))?i:n||sa(e)||i}const ga=async function(e){const t=this.getOffsetParent||Vs,i=this.getDimensions;return{reference:ba(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await i(e.floating)}}};function va(e){return W(e).direction==="rtl"}const ya={convertOffsetParentRelativeRectToViewportRelativeRect:la,getDocumentElement:yt,getClippingRect:ma,getOffsetParent:Vs,getElementRects:ga,getClientRects:ca,getDimensions:fa,getScale:Ft,isElement:st,isRTL:va},Ws=ea,qs=Qr,Gs=Kr,Ys=(e,t,i)=>{const n=new Map,s={platform:ya,...i},o={...s.platform,_c:n};return Jr(e,t,{...s,platform:o})};/** +import{C as Ki,i as _r,o as xr,h as It,a as Te,b as wr,S as $r,A as Cr,g as Er,d as Ar,B as tn}from"./index-CrrO1BJs.js";import{V as en,c as mi,G as xn,F as Sr,L as kr,d as wn,e as Or,f as Tr,P as Ge,g as he,D as Nr,A as Pr,C as Ne,O as Mr,h as Ir,I as Cs,i as Es,j as As,k as Lr,l as zr,m as Ss,n as ks,o as Os,p as Rr,R as jr}from"./web-ifc-api-CfQNUy7g.js";import{B as Hr,a as Dr,S as P}from"./index-BREiuDZQ.js";var Fr=Object.defineProperty,Br=(e,t,i)=>t in e?Fr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Et=(e,t,i)=>(Br(e,typeof t!="symbol"?t+"":t,i),i);const Ut=Math.min,it=Math.max,ei=Math.round,bt=e=>({x:e,y:e}),Ur={left:"right",right:"left",bottom:"top",top:"bottom"},Vr={start:"end",end:"start"};function $n(e,t,i){return it(e,Ut(t,i))}function Pe(e,t){return typeof e=="function"?e(t):e}function nt(e){return e.split("-")[0]}function fi(e){return e.split("-")[1]}function Ts(e){return e==="x"?"y":"x"}function Ns(e){return e==="y"?"height":"width"}function Nt(e){return["top","bottom"].includes(nt(e))?"y":"x"}function Ps(e){return Ts(Nt(e))}function Wr(e,t,i){i===void 0&&(i=!1);const n=fi(e),s=Ps(e),o=Ns(s);let r=s==="x"?n===(i?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=ii(r)),[r,ii(r)]}function qr(e){const t=ii(e);return[Ri(e),t,Ri(t)]}function Ri(e){return e.replace(/start|end/g,t=>Vr[t])}function Gr(e,t,i){const n=["left","right"],s=["right","left"],o=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return i?t?s:n:t?n:s;case"left":case"right":return t?o:r;default:return[]}}function Yr(e,t,i,n){const s=fi(e);let o=Gr(nt(e),i==="start",n);return s&&(o=o.map(r=>r+"-"+s),t&&(o=o.concat(o.map(Ri)))),o}function ii(e){return e.replace(/left|right|bottom|top/g,t=>Ur[t])}function Xr(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ms(e){return typeof e!="number"?Xr(e):{top:e,right:e,bottom:e,left:e}}function Vt(e){const{x:t,y:i,width:n,height:s}=e;return{width:n,height:s,top:i,left:t,right:t+n,bottom:i+s,x:t,y:i}}function Cn(e,t,i){let{reference:n,floating:s}=e;const o=Nt(t),r=Ps(t),a=Ns(r),l=nt(t),u=o==="y",h=n.x+n.width/2-s.width/2,c=n.y+n.height/2-s.height/2,d=n[a]/2-s[a]/2;let p;switch(l){case"top":p={x:h,y:n.y-s.height};break;case"bottom":p={x:h,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:c};break;case"left":p={x:n.x-s.width,y:c};break;default:p={x:n.x,y:n.y}}switch(fi(t)){case"start":p[r]-=d*(i&&u?-1:1);break;case"end":p[r]+=d*(i&&u?-1:1);break}return p}const Jr=async(e,t,i)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:r}=i,a=o.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let u=await r.getElementRects({reference:e,floating:t,strategy:s}),{x:h,y:c}=Cn(u,n,l),d=n,p={},y=0;for(let x=0;xM<=0)){var lt,tt;const M=(((lt=o.flip)==null?void 0:lt.index)||0)+1,ut=E[M];if(ut)return{data:{index:M,overflows:k},reset:{placement:ut}};let J=(tt=k.filter(Q=>Q.overflows[0]<=0).sort((Q,B)=>Q.overflows[1]-B.overflows[1])[0])==null?void 0:tt.placement;if(!J)switch(p){case"bestFit":{var ct;const Q=(ct=k.filter(B=>{if($){const U=Nt(B.placement);return U===g||U==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(U=>U>0).reduce((U,ce)=>U+ce,0)]).sort((B,U)=>B[1]-U[1])[0])==null?void 0:ct[0];Q&&(J=Q);break}case"initialPlacement":J=a;break}if(s!==J)return{reset:{placement:J}}}return{}}}};function Is(e){const t=Ut(...e.map(o=>o.left)),i=Ut(...e.map(o=>o.top)),n=it(...e.map(o=>o.right)),s=it(...e.map(o=>o.bottom));return{x:t,y:i,width:n-t,height:s-i}}function Zr(e){const t=e.slice().sort((s,o)=>s.y-o.y),i=[];let n=null;for(let s=0;sn.height/2?i.push([o]):i[i.length-1].push(o),n=o}return i.map(s=>Vt(Is(s)))}const Kr=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:i,elements:n,rects:s,platform:o,strategy:r}=t,{padding:a=2,x:l,y:u}=Pe(e,t),h=Array.from(await(o.getClientRects==null?void 0:o.getClientRects(n.reference))||[]),c=Zr(h),d=Vt(Is(h)),p=Ms(a);function y(){if(c.length===2&&c[0].left>c[1].right&&l!=null&&u!=null)return c.find(b=>l>b.left-p.left&&lb.top-p.top&&u=2){if(Nt(i)==="y"){const k=c[0],lt=c[c.length-1],tt=nt(i)==="top",ct=k.top,M=lt.bottom,ut=tt?k.left:lt.left,J=tt?k.right:lt.right,Q=J-ut,B=M-ct;return{top:ct,bottom:M,left:ut,right:J,width:Q,height:B,x:ut,y:ct}}const b=nt(i)==="left",f=it(...c.map(k=>k.right)),g=Ut(...c.map(k=>k.left)),v=c.filter(k=>b?k.left===g:k.right===f),w=v[0].top,C=v[v.length-1].bottom,$=g,E=f,H=E-$,R=C-w;return{top:w,bottom:C,left:$,right:E,width:H,height:R,x:$,y:w}}return d}const x=await o.getElementRects({reference:{getBoundingClientRect:y},floating:n.floating,strategy:r});return s.reference.x!==x.reference.x||s.reference.y!==x.reference.y||s.reference.width!==x.reference.width||s.reference.height!==x.reference.height?{reset:{rects:x}}:{}}}};async function ta(e,t){const{placement:i,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),r=nt(i),a=fi(i),l=Nt(i)==="y",u=["left","top"].includes(r)?-1:1,h=o&&l?-1:1,c=Pe(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:y}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...c};return a&&typeof y=="number"&&(p=a==="end"?y*-1:y),l?{x:p*h,y:d*u}:{x:d*u,y:p*h}}const Ls=function(e){return{name:"offset",options:e,async fn(t){var i,n;const{x:s,y:o,placement:r,middlewareData:a}=t,l=await ta(t,e);return r===((i=a.offset)==null?void 0:i.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:r}}}}},ea=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:n,placement:s}=t,{mainAxis:o=!0,crossAxis:r=!1,limiter:a={fn:b=>{let{x:f,y:g}=b;return{x:f,y:g}}},...l}=Pe(e,t),u={x:i,y:n},h=await nn(t,l),c=Nt(nt(s)),d=Ts(c);let p=u[d],y=u[c];if(o){const b=d==="y"?"top":"left",f=d==="y"?"bottom":"right",g=p+h[b],v=p-h[f];p=$n(g,p,v)}if(r){const b=c==="y"?"top":"left",f=c==="y"?"bottom":"right",g=y+h[b],v=y-h[f];y=$n(g,y,v)}const x=a.fn({...t,[d]:p,[c]:y});return{...x,data:{x:x.x-i,y:x.y-n}}}}};function gt(e){return zs(e)?(e.nodeName||"").toLowerCase():"#document"}function D(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yt(e){var t;return(t=(zs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function zs(e){return e instanceof Node||e instanceof D(e).Node}function st(e){return e instanceof Element||e instanceof D(e).Element}function Z(e){return e instanceof HTMLElement||e instanceof D(e).HTMLElement}function En(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof D(e).ShadowRoot}function Me(e){const{overflow:t,overflowX:i,overflowY:n,display:s}=W(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+i)&&!["inline","contents"].includes(s)}function ia(e){return["table","td","th"].includes(gt(e))}function na(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function sn(e){const t=on(),i=W(e);return i.transform!=="none"||i.perspective!=="none"||(i.containerType?i.containerType!=="normal":!1)||!t&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!t&&(i.filter?i.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(i.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(i.contain||"").includes(n))}function sa(e){let t=Wt(e);for(;Z(t)&&!bi(t);){if(na(t))return null;if(sn(t))return t;t=Wt(t)}return null}function on(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function bi(e){return["html","body","#document"].includes(gt(e))}function W(e){return D(e).getComputedStyle(e)}function gi(e){return st(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Wt(e){if(gt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||En(e)&&e.host||yt(e);return En(t)?t.host:t}function Rs(e){const t=Wt(e);return bi(t)?e.ownerDocument?e.ownerDocument.body:e.body:Z(t)&&Me(t)?t:Rs(t)}function ji(e,t,i){var n;t===void 0&&(t=[]),i===void 0&&(i=!0);const s=Rs(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),r=D(s);return o?t.concat(r,r.visualViewport||[],Me(s)?s:[],r.frameElement&&i?ji(r.frameElement):[]):t.concat(s,ji(s,[],i))}function js(e){const t=W(e);let i=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=Z(e),o=s?e.offsetWidth:i,r=s?e.offsetHeight:n,a=ei(i)!==o||ei(n)!==r;return a&&(i=o,n=r),{width:i,height:n,$:a}}function Hs(e){return st(e)?e:e.contextElement}function Ft(e){const t=Hs(e);if(!Z(t))return bt(1);const i=t.getBoundingClientRect(),{width:n,height:s,$:o}=js(t);let r=(o?ei(i.width):i.width)/n,a=(o?ei(i.height):i.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const oa=bt(0);function Ds(e){const t=D(e);return!on()||!t.visualViewport?oa:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ra(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==D(e)?!1:t}function _e(e,t,i,n){t===void 0&&(t=!1),i===void 0&&(i=!1);const s=e.getBoundingClientRect(),o=Hs(e);let r=bt(1);t&&(n?st(n)&&(r=Ft(n)):r=Ft(e));const a=ra(o,i,n)?Ds(o):bt(0);let l=(s.left+a.x)/r.x,u=(s.top+a.y)/r.y,h=s.width/r.x,c=s.height/r.y;if(o){const d=D(o),p=n&&st(n)?D(n):n;let y=d,x=y.frameElement;for(;x&&n&&p!==y;){const b=Ft(x),f=x.getBoundingClientRect(),g=W(x),v=f.left+(x.clientLeft+parseFloat(g.paddingLeft))*b.x,w=f.top+(x.clientTop+parseFloat(g.paddingTop))*b.y;l*=b.x,u*=b.y,h*=b.x,c*=b.y,l+=v,u+=w,y=D(x),x=y.frameElement}}return Vt({width:h,height:c,x:l,y:u})}const aa=[":popover-open",":modal"];function Fs(e){return aa.some(t=>{try{return e.matches(t)}catch{return!1}})}function la(e){let{elements:t,rect:i,offsetParent:n,strategy:s}=e;const o=s==="fixed",r=yt(n),a=t?Fs(t.floating):!1;if(n===r||a&&o)return i;let l={scrollLeft:0,scrollTop:0},u=bt(1);const h=bt(0),c=Z(n);if((c||!c&&!o)&&((gt(n)!=="body"||Me(r))&&(l=gi(n)),Z(n))){const d=_e(n);u=Ft(n),h.x=d.x+n.clientLeft,h.y=d.y+n.clientTop}return{width:i.width*u.x,height:i.height*u.y,x:i.x*u.x-l.scrollLeft*u.x+h.x,y:i.y*u.y-l.scrollTop*u.y+h.y}}function ca(e){return Array.from(e.getClientRects())}function Bs(e){return _e(yt(e)).left+gi(e).scrollLeft}function ua(e){const t=yt(e),i=gi(e),n=e.ownerDocument.body,s=it(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=it(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-i.scrollLeft+Bs(e);const a=-i.scrollTop;return W(n).direction==="rtl"&&(r+=it(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:r,y:a}}function ha(e,t){const i=D(e),n=yt(e),s=i.visualViewport;let o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;const u=on();(!u||u&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a,y:l}}function da(e,t){const i=_e(e,!0,t==="fixed"),n=i.top+e.clientTop,s=i.left+e.clientLeft,o=Z(e)?Ft(e):bt(1),r=e.clientWidth*o.x,a=e.clientHeight*o.y,l=s*o.x,u=n*o.y;return{width:r,height:a,x:l,y:u}}function An(e,t,i){let n;if(t==="viewport")n=ha(e,i);else if(t==="document")n=ua(yt(e));else if(st(t))n=da(t,i);else{const s=Ds(e);n={...t,x:t.x-s.x,y:t.y-s.y}}return Vt(n)}function Us(e,t){const i=Wt(e);return i===t||!st(i)||bi(i)?!1:W(i).position==="fixed"||Us(i,t)}function pa(e,t){const i=t.get(e);if(i)return i;let n=ji(e,[],!1).filter(a=>st(a)&>(a)!=="body"),s=null;const o=W(e).position==="fixed";let r=o?Wt(e):e;for(;st(r)&&!bi(r);){const a=W(r),l=sn(r);!l&&a.position==="fixed"&&(s=null),(o?!l&&!s:!l&&a.position==="static"&&s&&["absolute","fixed"].includes(s.position)||Me(r)&&!l&&Us(e,r))?n=n.filter(u=>u!==r):s=a,r=Wt(r)}return t.set(e,n),n}function ma(e){let{element:t,boundary:i,rootBoundary:n,strategy:s}=e;const o=[...i==="clippingAncestors"?pa(t,this._c):[].concat(i),n],r=o[0],a=o.reduce((l,u)=>{const h=An(t,u,s);return l.top=it(h.top,l.top),l.right=Ut(h.right,l.right),l.bottom=Ut(h.bottom,l.bottom),l.left=it(h.left,l.left),l},An(t,r,s));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function fa(e){const{width:t,height:i}=js(e);return{width:t,height:i}}function ba(e,t,i){const n=Z(t),s=yt(t),o=i==="fixed",r=_e(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=bt(0);if(n||!n&&!o)if((gt(t)!=="body"||Me(s))&&(a=gi(t)),n){const c=_e(t,!0,o,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else s&&(l.x=Bs(s));const u=r.left+a.scrollLeft-l.x,h=r.top+a.scrollTop-l.y;return{x:u,y:h,width:r.width,height:r.height}}function Sn(e,t){return!Z(e)||W(e).position==="fixed"?null:t?t(e):e.offsetParent}function Vs(e,t){const i=D(e);if(!Z(e)||Fs(e))return i;let n=Sn(e,t);for(;n&&ia(n)&&W(n).position==="static";)n=Sn(n,t);return n&&(gt(n)==="html"||gt(n)==="body"&&W(n).position==="static"&&!sn(n))?i:n||sa(e)||i}const ga=async function(e){const t=this.getOffsetParent||Vs,i=this.getDimensions;return{reference:ba(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await i(e.floating)}}};function va(e){return W(e).direction==="rtl"}const ya={convertOffsetParentRelativeRectToViewportRelativeRect:la,getDocumentElement:yt,getClippingRect:ma,getOffsetParent:Vs,getElementRects:ga,getClientRects:ca,getDimensions:fa,getScale:Ft,isElement:st,isRTL:va},Ws=ea,qs=Qr,Gs=Kr,Ys=(e,t,i)=>{const n=new Map,s={platform:ya,...i},o={...s.platform,_c:n};return Jr(e,t,{...s,platform:o})};/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause diff --git a/examples/assets/index-D2xchnNe.js b/examples/assets/index-CrrO1BJs.js similarity index 62% rename from examples/assets/index-D2xchnNe.js rename to examples/assets/index-CrrO1BJs.js index a253a56d6..0bf9be969 100644 --- a/examples/assets/index-D2xchnNe.js +++ b/examples/assets/index-CrrO1BJs.js @@ -1,13 +1,13 @@ -import{r as Ft,s as st,T as Ie,t as pi,E as So,c as H,V as O,h as At,x as fe,S as Os,a as D,C as Qt,y as Ci,D as No,A as wo,W as Fs,w as Ti,P as yo,aU as Lo,v as Po,ap as Rt,aV as Mo,af as _n,i as Uo,I as Js,$ as mi,a5 as Ce,H as Do,e as ze,b as Te,N as He,q as jt,Q as Zt,X as fi,Y as Sn,Z as Nn,_ as wn,a0 as yn,a1 as Ln,a2 as Ri,a3 as Pn,B as it,a4 as xo,ab as wt,a6 as vi,a7 as Mn,a8 as Un,a9 as Kt,aa as bo,d as Ge,ac as ke,ad as vo,ae as Bo,p as Fi,au as Ai,av as gi,ao as Oi,K as _i,am as Yo,J as rt,O as As,at as Ps,al as zo,aw as Go,L as Dn,ax as Vo,ay as Ho,az as Wo,aA as Xo,aB as ko,aS as Bi,aT as Zo,z as Yi,aq as Ze,an as Ut,ar as Qo,as as ge,ai as jo,aW as qo,aX as Ko,aY as $o,aZ as Jo,a_ as tr,b3 as er}from"./web-ifc-api-CfQNUy7g.js";var sr=Object.defineProperty,ir=(c,t,e)=>t in c?sr(c,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):c[t]=e,I=(c,t,e)=>(ir(c,typeof t!="symbol"?t+"":t,e),e);const xn=0,nr=1,or=2,zi=2,Ms=1.25,Gi=1,Ts=6*4+4+4,_s=65535,rr=Math.pow(2,-24),Us=Symbol("SKIP_GENERATION");function ar(c){return c.index?c.index.count:c.attributes.position.count}function Re(c){return ar(c)/3}function hr(c,t=ArrayBuffer){return c>65535?new Uint32Array(new t(4*c)):new Uint16Array(new t(2*c))}function cr(c,t){if(!c.index){const e=c.attributes.position.count,s=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,i=hr(e,s);c.setIndex(new Ge(i,1));for(let n=0;nr-a);for(let r=0;rn.offset-o.offset),s=e[e.length-1];s.count=Math.min(t-s.offset,s.count);let i=0;return e.forEach(({count:n})=>i+=n),t!==i}function j(c,t,e){return e.min.x=t[c],e.min.y=t[c+1],e.min.z=t[c+2],e.max.x=t[c+3],e.max.y=t[c+4],e.max.z=t[c+5],e}function dr(c){c[0]=c[1]=c[2]=1/0,c[3]=c[4]=c[5]=-1/0}function Vi(c){let t=-1,e=-1/0;for(let s=0;s<3;s++){const i=c[s+3]-c[s];i>e&&(e=i,t=s)}return t}function Hi(c,t){t.set(c)}function Wi(c,t,e){let s,i;for(let n=0;n<3;n++){const o=n+3;s=c[n],i=t[n],e[n]=si?s:i}}function Qe(c,t,e){for(let s=0;s<3;s++){const i=t[c+2*s],n=t[c+2*s+1],o=i-n,r=i+n;oe[s+3]&&(e[s+3]=r)}}function Oe(c){const t=c[3]-c[0],e=c[4]-c[1],s=c[5]-c[2];return 2*(t*e+e*s+s*t)}function Ds(c,t,e,s,i=null){let n=1/0,o=1/0,r=1/0,a=-1/0,h=-1/0,d=-1/0,E=1/0,l=1/0,u=1/0,C=-1/0,T=-1/0,m=-1/0;const f=i!==null;for(let R=t*6,A=(t+e)*6;Ra&&(a=_),f&&pC&&(C=p);const S=c[R+2],w=c[R+3],y=S-w,L=S+w;yh&&(h=L),f&&ST&&(T=S);const P=c[R+4],U=c[R+5],x=P-U,Y=P+U;xd&&(d=Y),f&&Pm&&(m=P)}s[0]=n,s[1]=o,s[2]=r,s[3]=a,s[4]=h,s[5]=d,f&&(i[0]=E,i[1]=l,i[2]=u,i[3]=C,i[4]=T,i[5]=m)}function Er(c,t,e,s){let i=1/0,n=1/0,o=1/0,r=-1/0,a=-1/0,h=-1/0;for(let d=t*6,E=(t+e)*6;dr&&(r=l);const u=c[d+2];ua&&(a=u);const C=c[d+4];Ch&&(h=C)}s[0]=i,s[1]=n,s[2]=o,s[3]=r,s[4]=a,s[5]=h}function ur(c,t){dr(t);const e=c.attributes.position,s=c.index?c.index.array:null,i=Re(c),n=new Float32Array(i*6),o=e.normalized,r=e.array,a=e.offset||0;let h=3;e.isInterleavedBufferAttribute&&(h=e.data.stride);const d=["getX","getY","getZ"];for(let E=0;Eg&&(g=A),p>g&&(g=p);const _=(g-F)/2,S=f*2;n[u+S+0]=F+_,n[u+S+1]=_+(Math.abs(F)+_)*rr,Ft[f+3]&&(t[f+3]=g)}}return n}const yt=32,Ir=(c,t)=>c.candidate-t.candidate,Dt=new Array(yt).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),je=new Float32Array(6);function pr(c,t,e,s,i,n){let o=-1,r=0;if(n===xn)o=Vi(t),o!==-1&&(r=(t[o]+t[o+3])/2);else if(n===nr)o=Vi(c),o!==-1&&(r=Cr(e,s,i,o));else if(n===or){const a=Oe(c);let h=Ms*i;const d=s*6,E=(s+i)*6;for(let l=0;l<3;l++){const u=t[l],C=(t[l+3]-u)/yt;if(i=F.candidate?Qe(R,e,F.rightCacheBounds):(Qe(R,e,F.leftCacheBounds),F.count++)}}for(let R=0;R=yt&&(R=yt-1);const A=Dt[R];A.count++,Qe(f,e,A.bounds)}const T=Dt[yt-1];Hi(T.bounds,T.rightCacheBounds);for(let f=yt-2;f>=0;f--){const R=Dt[f],A=Dt[f+1];Wi(R.bounds,A.rightCacheBounds,R.rightCacheBounds)}let m=0;for(let f=0;f=a;)r--;if(o=a;)r--;if(o2**16,i=s?4:2,n=t?new SharedArrayBuffer(e*i):new ArrayBuffer(e*i),o=s?new Uint32Array(n):new Uint16Array(n);for(let r=0,a=o.length;r=i&&(E=!0,n&&(console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`),console.warn(e))),g<=o||S>=i)return R(F+g),p.offset=F,p.count=g,p;const w=pr(p.boundingData,_,C,F,g,r);if(w.axis===-1)return R(F+g),p.offset=F,p.count=g,p;const y=T(d,s,C,F,g,w);if(y===F||y===F+g)R(F+g),p.offset=F,p.count=g;else{p.splitAxis=w.axis;const L=new qe,P=F,U=y-F;p.left=L,L.boundingData=new Float32Array(6),Ds(C,P,U,L.boundingData,u),A(L,P,U,u,S+1);const x=new qe,Y=y,z=g-U;p.right=x,x.boundingData=new Float32Array(6),Ds(C,Y,z,x.boundingData,u),A(x,Y,z,u,S+1)}return p}}function Fr(c,t){const e=c.geometry;t.indirect&&(c._indirectBuffer=fr(e,t.useSharedArrayBuffer),lr(e)&&!t.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.')),c._indirectBuffer||cr(e,t);const s=Rr(c,t);let i,n,o;const r=[],a=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let E=0;EMath.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return n[u+6]=p/4,p=d(p,R),n[u+7]=A,p}}}class Pt{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(t,e){let s=1/0,i=-1/0;for(let n=0,o=t.length;ni?r:i}this.min=s,this.max=i}setFromPoints(t,e){let s=1/0,i=-1/0;for(let n=0,o=e.length;ni?a:i}this.min=s,this.max=i}isSeparated(t){return this.min>t.max||t.min>this.max}}Pt.prototype.setFromBox=function(){const c=new O;return function(t,e){const s=e.min,i=e.max;let n=1/0,o=-1/0;for(let r=0;r<=1;r++)for(let a=0;a<=1;a++)for(let h=0;h<=1;h++){c.x=s.x*r+i.x*(1-r),c.y=s.y*a+i.y*(1-a),c.z=s.z*h+i.z*(1-h);const d=t.dot(c);n=Math.min(d,n),o=Math.max(d,o)}this.min=n,this.max=o}}();const Ar=function(){const c=new O,t=new O,e=new O;return function(s,i,n){const o=s.start,r=c,a=i.start,h=t;e.subVectors(o,a),c.subVectors(s.end,s.start),t.subVectors(i.end,i.start);const d=e.dot(h),E=h.dot(r),l=h.dot(h),u=e.dot(r),C=r.dot(r)*l-E*E;let T,m;C!==0?T=(d*E-u*l)/C:T=0,m=(d+T*E)/l,n.x=T,n.y=m}}(),Si=function(){const c=new At,t=new O,e=new O;return function(s,i,n,o){Ar(s,i,c);let r=c.x,a=c.y;if(r>=0&&r<=1&&a>=0&&a<=1){s.at(r,n),i.at(a,o);return}else if(r>=0&&r<=1){a<0?i.at(0,o):i.at(1,o),s.closestPointToPoint(o,!0,n);return}else if(a>=0&&a<=1){r<0?s.at(0,n):s.at(1,n),i.closestPointToPoint(n,!0,o);return}else{let h;r<0?h=s.start:h=s.end;let d;a<0?d=i.start:d=i.end;const E=t,l=e;if(s.closestPointToPoint(d,!0,t),i.closestPointToPoint(h,!0,e),E.distanceToSquared(d)<=l.distanceToSquared(h)){n.copy(E),o.copy(d);return}else{n.copy(h),o.copy(l);return}}}}(),gr=function(){const c=new O,t=new O,e=new fe,s=new Ft;return function(i,n){const{radius:o,center:r}=i,{a,b:h,c:d}=n;if(s.start=a,s.end=h,s.closestPointToPoint(r,!0,c).distanceTo(r)<=o||(s.start=a,s.end=d,s.closestPointToPoint(r,!0,c).distanceTo(r)<=o)||(s.start=h,s.end=d,s.closestPointToPoint(r,!0,c).distanceTo(r)<=o))return!0;const E=n.getPlane(e);if(Math.abs(E.distanceToPoint(r))<=o){const l=E.projectPoint(r,t);if(n.containsPoint(l))return!0}return!1}}(),Or=1e-15;function xs(c){return Math.abs(c)new O),this.satBounds=new Array(4).fill().map(()=>new Pt),this.points=[this.a,this.b,this.c],this.sphere=new Os,this.plane=new fe,this.needsUpdate=!0}intersectsSphere(t){return gr(t,this)}update(){const t=this.a,e=this.b,s=this.c,i=this.points,n=this.satAxes,o=this.satBounds,r=n[0],a=o[0];this.getNormal(r),a.setFromPoints(r,i);const h=n[1],d=o[1];h.subVectors(t,e),d.setFromPoints(h,i);const E=n[2],l=o[2];E.subVectors(e,s),l.setFromPoints(E,i);const u=n[3],C=o[3];u.subVectors(s,t),C.setFromPoints(u,i),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(r,t),this.needsUpdate=!1}}gt.prototype.closestPointToSegment=function(){const c=new O,t=new O,e=new Ft;return function(s,i=null,n=null){const{start:o,end:r}=s,a=this.points;let h,d=1/0;for(let E=0;E<3;E++){const l=(E+1)%3;e.start.copy(a[E]),e.end.copy(a[l]),Si(e,s,c,t),h=c.distanceToSquared(t),h=2){(p===1?f.start:f.end).copy(u),A=2;break}if(A++,A===2&&p===-1)break}}return A}return function(T,m=null,f=!1){this.needsUpdate&&this.update(),T.isExtendedTriangle?T.needsUpdate&&T.update():(c.copy(T),c.update(),T=c);const R=this.plane,A=T.plane;if(Math.abs(R.normal.dot(A.normal))>1-1e-10){const p=this.satBounds,F=this.satAxes;e[0]=T.a,e[1]=T.b,e[2]=T.c;for(let S=0;S<4;S++){const w=p[S],y=F[S];if(s.setFromPoints(y,e),w.isSeparated(s))return!1}const g=T.satBounds,_=T.satAxes;t[0]=this.a,t[1]=this.b,t[2]=this.c;for(let S=0;S<4;S++){const w=g[S],y=_[S];if(s.setFromPoints(y,t),w.isSeparated(s))return!1}for(let S=0;S<4;S++){const w=F[S];for(let y=0;y<4;y++){const L=_[y];if(n.crossVectors(w,L),s.setFromPoints(n,t),i.setFromPoints(n,e),s.isSeparated(i))return!1}}return m&&(f||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),m.start.set(0,0,0),m.end.set(0,0,0)),!0}else{const p=C(this,A,E);if(p===1&&T.containsPoint(E.end))return m&&(m.start.copy(E.end),m.end.copy(E.end)),!0;if(p!==2)return!1;const F=C(T,R,l);if(F===1&&this.containsPoint(l.end))return m&&(m.start.copy(l.end),m.end.copy(l.end)),!0;if(F!==2)return!1;if(E.delta(r),l.delta(a),r.dot(a)<0){let P=l.start;l.start=l.end,l.end=P}const g=E.start.dot(r),_=E.end.dot(r),S=l.start.dot(r),w=l.end.dot(r),y=_0?m.start.copy(E.start):m.start.copy(l.start),h.subVectors(E.end,l.end),h.dot(r)<0?m.end.copy(E.end):m.end.copy(l.end)),!0)}}}();gt.prototype.distanceToPoint=function(){const c=new O;return function(t){return this.closestPointToPoint(t,c),t.distanceTo(c)}}();gt.prototype.distanceToTriangle=function(){const c=new O,t=new O,e=["a","b","c"],s=new Ft,i=new Ft;return function(n,o=null,r=null){const a=o||r?s:null;if(this.intersectsTriangle(n,a))return(o||r)&&(o&&a.getCenter(o),r&&a.getCenter(r)),0;let h=1/0;for(let d=0;d<3;d++){let E;const l=e[d],u=n[l];this.closestPointToPoint(u,c),E=u.distanceToSquared(c),Enew O),this.satAxes=new Array(3).fill().map(()=>new O),this.satBounds=new Array(3).fill().map(()=>new Pt),this.alignedSatBounds=new Array(3).fill().map(()=>new Pt),this.needsUpdate=!1,t&&this.min.copy(t),e&&this.max.copy(e),s&&this.matrix.copy(s)}set(t,e,s){this.min.copy(t),this.max.copy(e),this.matrix.copy(s),this.needsUpdate=!0}copy(t){this.min.copy(t.min),this.max.copy(t.max),this.matrix.copy(t.matrix),this.needsUpdate=!0}}at.prototype.update=function(){return function(){const c=this.matrix,t=this.min,e=this.max,s=this.points;for(let a=0;a<=1;a++)for(let h=0;h<=1;h++)for(let d=0;d<=1;d++){const E=1*a|2*h|4*d,l=s[E];l.x=a?e.x:t.x,l.y=h?e.y:t.y,l.z=d?e.z:t.z,l.applyMatrix4(c)}const i=this.satBounds,n=this.satAxes,o=s[0];for(let a=0;a<3;a++){const h=n[a],d=i[a],E=1<new Ft),e=new Array(12).fill().map(()=>new Ft),s=new O,i=new O;return function(n,o=0,r=null,a=null){if(this.needsUpdate&&this.update(),this.intersectsBox(n))return(r||a)&&(n.getCenter(i),this.closestPointToPoint(i,s),n.closestPointToPoint(s,i),r&&r.copy(s),a&&a.copy(i)),0;const h=o*o,d=n.min,E=n.max,l=this.points;let u=1/0;for(let T=0;T<8;T++){const m=l[T];i.copy(m).clamp(d,E);const f=m.distanceToSquared(i);if(fnew gt)}}const ut=new _r;function ct(c,t){return t[c+15]===65535}function lt(c,t){return t[c+6]}function It(c,t){return t[c+14]}function pt(c){return c+8}function Ct(c,t){return t[c+6]}function Bn(c,t){return t[c+7]}class Sr{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const t=[];let e=null;this.setBuffer=s=>{e&&t.push(e),e=s,this.float32Array=new Float32Array(s),this.uint16Array=new Uint16Array(s),this.uint32Array=new Uint32Array(s)},this.clearBuffer=()=>{e=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,t.length!==0&&this.setBuffer(t.pop())}}}const Z=new Sr;let Bt,pe;const Jt=[],Ke=new Ni(()=>new st);function Nr(c,t,e,s,i,n){Bt=Ke.getPrimitive(),pe=Ke.getPrimitive(),Jt.push(Bt,pe),Z.setBuffer(c._roots[t]);const o=ti(0,c.geometry,e,s,i,n);Z.clearBuffer(),Ke.releasePrimitive(Bt),Ke.releasePrimitive(pe),Jt.pop(),Jt.pop();const r=Jt.length;return r>0&&(pe=Jt[r-1],Bt=Jt[r-2]),o}function ti(c,t,e,s,i=null,n=0,o=0){const{float32Array:r,uint16Array:a,uint32Array:h}=Z;let d=c*2;if(ct(d,a)){const E=lt(c,h),l=It(d,a);return j(c,r,Bt),s(E,l,!1,o,n+c,Bt)}else{let E=function(L){const{uint16Array:P,uint32Array:U}=Z;let x=L*2;for(;!ct(x,P);)L=pt(L),x=L*2;return lt(L,U)},l=function(L){const{uint16Array:P,uint32Array:U}=Z;let x=L*2;for(;!ct(x,P);)L=Ct(L,U),x=L*2;return lt(L,U)+It(x,P)};const u=pt(c),C=Ct(c,h);let T=u,m=C,f,R,A,p;if(i&&(A=Bt,p=pe,j(T,r,A),j(m,r,p),f=i(A),R=i(p),R(_e.copy(t).clamp(d.min,d.max),_e.distanceToSquared(t)),intersectsBounds:(d,E,l)=>l{d.closestPointToPoint(t,_e);const l=t.distanceToSquared(_e);return l0&&h.normal.multiplyScalar(-1));const d={a:n,b:o,c:r,normal:new O,materialIndex:0};Ie.getNormal(te,ee,se,d.normal),h.face=d,h.faceIndex=n}return h}function Ss(c,t,e,s,i){const n=s*3;let o=n+0,r=n+1,a=n+2;const h=c.index;c.index&&(o=h.getX(o),r=h.getX(r),a=h.getX(a));const{position:d,normal:E,uv:l,uv1:u}=c.attributes,C=Lr(e,d,E,l,u,o,r,a,t);return C?(C.faceIndex=s,i&&i.push(C),C):null}function K(c,t,e,s){const i=c.a,n=c.b,o=c.c;let r=t,a=t+1,h=t+2;e&&(r=e.getX(r),a=e.getX(a),h=e.getX(h)),i.x=s.getX(r),i.y=s.getY(r),i.z=s.getZ(r),n.x=s.getX(a),n.y=s.getY(a),n.z=s.getZ(a),o.x=s.getX(h),o.y=s.getY(h),o.z=s.getZ(h)}function Pr(c,t,e,s,i,n){const{geometry:o,_indirectBuffer:r}=c;for(let a=s,h=s+i;aF&&(F=L),Pg&&(g=P),U_&&(_=U)}return a[l+0]!==R||a[l+1]!==A||a[l+2]!==p||a[l+3]!==F||a[l+4]!==g||a[l+5]!==_?(a[l+0]=R,a[l+1]=A,a[l+2]=p,a[l+3]=F,a[l+4]=g,a[l+5]=_,!0):!1}else{const m=l+8,f=o[l+6],R=m+u,A=f+u;let p=C,F=!1,g=!1;t?p||(F=t.has(R),g=t.has(A),p=!F&&!g):(F=!0,g=!0);const _=p||F,S=p||g;let w=!1;_&&(w=E(m,u,p));let y=!1;S&&(y=E(f,u,p));const L=w||y;if(L)for(let P=0;P<3;P++){const U=m+P,x=f+P,Y=a[U],z=a[U+3],tt=a[x],W=a[x+3];a[l+P]=YW?z:W}return L}}}const Qi=new st;function Yt(c,t,e,s){return j(c,t,Qi),e.intersectBox(Qi,s)}function xr(c,t,e,s,i,n){const{geometry:o,_indirectBuffer:r}=c;for(let a=s,h=s+i;a=0;let E,l;d?(E=pt(c),l=Ct(c,o)):(E=Ct(c,o),l=pt(c));const u=Yt(E,i,s,qi)?si(E,t,e,s):null;if(u){const T=u.point[h];if(d?T<=i[l+a]:T>=i[l+a+3])return u}const C=Yt(l,i,s,qi)?si(l,t,e,s):null;return u&&C?u.distance<=C.distance?u:C:u||C||null}}const ss=new st,ie=new gt,ne=new gt,Se=new H,Ki=new at,is=new at;function Gr(c,t,e,s){Z.setBuffer(c._roots[t]);const i=ii(0,c,e,s);return Z.clearBuffer(),i}function ii(c,t,e,s,i=null){const{float32Array:n,uint16Array:o,uint32Array:r}=Z;let a=c*2;if(i===null&&(e.boundingBox||e.computeBoundingBox(),Ki.set(e.boundingBox.min,e.boundingBox.max,s),i=Ki),ct(a,o)){const h=t.geometry,d=h.index,E=h.attributes.position,l=e.index,u=e.attributes.position,C=lt(c,r),T=It(a,o);if(Se.copy(s).invert(),e.boundsTree)return j(c,n,is),is.matrix.copy(Se),is.needsUpdate=!0,e.boundsTree.shapecast({intersectsBounds:m=>is.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(s),m.b.applyMatrix4(s),m.c.applyMatrix4(s),m.needsUpdate=!0;for(let f=C*3,R=(T+C)*3;fvs.distanceToBox(F),intersectsBounds:(F,g,_)=>_{if(t.boundsTree)return t.boundsTree.shapecast({boundsTraverseOrder:_=>Ne.distanceToBox(_),intersectsBounds:(_,S,w)=>w{for(let w=_,y=_+S;wF&&(F=U),xg&&(g=x),Y_&&(_=Y)}}return a[l+0]!==R||a[l+1]!==A||a[l+2]!==p||a[l+3]!==F||a[l+4]!==g||a[l+5]!==_?(a[l+0]=R,a[l+1]=A,a[l+2]=p,a[l+3]=F,a[l+4]=g,a[l+5]=_,!0):!1}else{const m=l+8,f=o[l+6],R=m+u,A=f+u;let p=C,F=!1,g=!1;t?p||(F=t.has(R),g=t.has(A),p=!F&&!g):(F=!0,g=!0);const _=p||F,S=p||g;let w=!1;_&&(w=E(m,u,p));let y=!1;S&&(y=E(f,u,p));const L=w||y;if(L)for(let P=0;P<3;P++){const U=m+P,x=f+P,Y=a[U],z=a[U+3],tt=a[x],W=a[x+3];a[l+P]=YW?z:W}return L}}}const $i=new O;function Qr(c,t,e,s,i){Z.setBuffer(c._roots[t]),ni(0,c,e,s,i),Z.clearBuffer()}function ni(c,t,e,s,i){const{float32Array:n,uint16Array:o,uint32Array:r}=Z,a=c*2;if(ct(a,o)){const h=lt(c,r),d=It(a,o);xr(t,e,s,h,d,i)}else{const h=pt(c);Yt(h,n,s,$i)&&ni(h,t,e,s,i);const d=Ct(c,r);Yt(d,n,s,$i)&&ni(d,t,e,s,i)}}const Ji=new O,jr=["x","y","z"];function qr(c,t,e,s){Z.setBuffer(c._roots[t]);const i=oi(0,c,e,s);return Z.clearBuffer(),i}function oi(c,t,e,s){const{float32Array:i,uint16Array:n,uint32Array:o}=Z;let r=c*2;if(ct(r,n)){const a=lt(c,o),h=It(r,n);return br(t,e,s,a,h)}else{const a=Bn(c,o),h=jr[a],d=s.direction[h]>=0;let E,l;d?(E=pt(c),l=Ct(c,o)):(E=Ct(c,o),l=pt(c));const u=Yt(E,i,s,Ji)?oi(E,t,e,s):null;if(u){const T=u.point[h];if(d?T<=i[l+a]:T>=i[l+a+3])return u}const C=Yt(l,i,s,Ji)?oi(l,t,e,s):null;return u&&C?u.distance<=C.distance?u:C:u||C||null}}const os=new st,oe=new gt,re=new gt,we=new H,tn=new at,rs=new at;function Kr(c,t,e,s){Z.setBuffer(c._roots[t]);const i=ri(0,c,e,s);return Z.clearBuffer(),i}function ri(c,t,e,s,i=null){const{float32Array:n,uint16Array:o,uint32Array:r}=Z;let a=c*2;if(i===null&&(e.boundingBox||e.computeBoundingBox(),tn.set(e.boundingBox.min,e.boundingBox.max,s),i=tn),ct(a,o)){const h=t.geometry,d=h.index,E=h.attributes.position,l=e.index,u=e.attributes.position,C=lt(c,r),T=It(a,o);if(we.copy(s).invert(),e.boundsTree)return j(c,n,rs),rs.matrix.copy(we),rs.needsUpdate=!0,e.boundsTree.shapecast({intersectsBounds:m=>rs.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(s),m.b.applyMatrix4(s),m.c.applyMatrix4(s),m.needsUpdate=!0;for(let f=C,R=T+C;fBs.distanceToBox(F),intersectsBounds:(F,g,_)=>_{if(t.boundsTree){const _=t.boundsTree;return _.shapecast({boundsTraverseOrder:S=>ye.distanceToBox(S),intersectsBounds:(S,w,y)=>y{for(let y=S,L=S+w;ynew st),ae=new st,he=new st,Ys=new st,zs=new st;let Gs=!1;function na(c,t,e,s){if(Gs)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");Gs=!0;const i=c._roots,n=t._roots;let o,r=0,a=0;const h=new H().copy(e).invert();for(let d=0,E=i.length;da.slice()),index:o.array.slice(),indirectBuffer:n?n.slice():null}:r={roots:i,index:o.array,indirectBuffer:n},r}static deserialize(t,e,s={}){s={setIndex:!0,indirect:!!t.indirectBuffer,...s};const{index:i,roots:n,indirectBuffer:o}=t,r=new wi(e,{...s,[Us]:!0});if(r._roots=n,r._indirectBuffer=o||null,s.setIndex){const a=e.getIndex();if(a===null){const h=new Ge(t.index,1,!1);e.setIndex(h)}else a.array!==i&&(a.array.set(i),a.needsUpdate=!0)}return r}get indirect(){return!!this._indirectBuffer}constructor(t,e={}){if(t.isBufferGeometry){if(t.index&&t.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");if(e=Object.assign({strategy:xn,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[Us]:!1},e),e.useSharedArrayBuffer&&!ia())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=t,this._roots=null,this._indirectBuffer=null,e[Us]||(Fr(this,e),!t.boundingBox&&e.setBoundingBox&&(t.boundingBox=this.getBoundingBox(new st)));const{_indirectBuffer:s}=this;this.resolveTriangleIndex=e.indirect?i=>s[i]:i=>i}refit(t=null){return(this.indirect?Zr:Dr)(this,t)}traverse(t,e=0){const s=this._roots[e],i=new Uint32Array(s),n=new Uint16Array(s);o(0);function o(r,a=0){const h=r*2,d=n[h+15]===_s;if(d){const E=i[r+6],l=n[h+14];t(a,d,new Float32Array(s,r*4,6),E,l)}else{const E=r+Ts/4,l=i[r+6],u=i[r+7];t(a,d,new Float32Array(s,r*4,6),u)||(o(E,a+1),o(l,a+1))}}}raycast(t,e=Bi){const s=this._roots,i=this.geometry,n=[],o=e.isMaterial,r=Array.isArray(e),a=i.groups,h=o?e.side:e,d=this.indirect?Qr:Br;for(let E=0,l=s.length;EE(l,u,C,T,m)?!0:s(l,u,this,r,C,T,e)}else o||(r?o=(E,l,u,C)=>s(E,l,this,r,u,C,e):o=(E,l,u)=>u);let a=!1,h=0;const d=this._roots;for(let E=0,l=d.length;E{const T=this.resolveTriangleIndex(C);K(o,T*3,r,a)}:C=>{K(o,C*3,r,a)},d=ut.getPrimitive(),E=t.geometry.index,l=t.geometry.attributes.position,u=t.indirect?C=>{const T=t.resolveTriangleIndex(C);K(d,T*3,E,l)}:C=>{K(d,C*3,E,l)};if(n){const C=(T,m,f,R,A,p,F,g)=>{for(let _=f,S=f+R;_hs.intersectsBox(s),intersectsTriangle:s=>hs.intersectsTriangle(s)})}intersectsSphere(t){return this.shapecast({intersectsBounds:e=>t.intersectsBox(e),intersectsTriangle:e=>e.intersectsSphere(t)})}closestPointToGeometry(t,e,s={},i={},n=0,o=1/0){return(this.indirect?sa:kr)(this,t,e,s,i,n,o)}closestPointToPoint(t,e={},s=0,i=1/0){return wr(this,t,e,s,i)}getBoundingBox(t){return t.makeEmpty(),this._roots.forEach(e=>{j(0,new Float32Array(e),en),t.union(en)}),t}}function sn(c,t,e){return c===null||(c.point.applyMatrix4(t.matrixWorld),c.distance=c.point.distanceTo(e.ray.origin),c.object=t,c.distancee.far)?null:c}const Vs=new Zo,nn=new H,oa=D.prototype.raycast;function ra(c,t){if(this.geometry.boundsTree){if(this.material===void 0)return;nn.copy(this.matrixWorld).invert(),Vs.copy(c.ray).applyMatrix4(nn);const e=this.geometry.boundsTree;if(c.firstHitOnly===!0){const s=sn(e.raycastFirst(Vs,this.material),this,c);s&&t.push(s)}else{const s=e.raycast(Vs,this.material);for(let i=0,n=s.length;i{const e=this.handlers.slice(0);for(const s of e)s(t)}),I(this,"handlers",[])}add(t){this.handlers.push(t)}remove(t){this.handlers=this.handlers.filter(e=>e!==t)}reset(){this.handlers.length=0}}class ms{constructor(){I(this,"trigger",async t=>{const e=this.handlers.slice(0);for(const s of e)await s(t)}),I(this,"handlers",[])}add(t){this.handlers.push(t)}remove(t){this.handlers=this.handlers.filter(e=>e!==t)}reset(){this.handlers.length=0}}class yi{constructor(t){I(this,"isDisposeable",()=>"dispose"in this&&"onDisposed"in this),I(this,"isResizeable",()=>"resize"in this&&"getSize"in this),I(this,"isUpdateable",()=>"onAfterUpdate"in this&&"onBeforeUpdate"in this&&"update"in this),I(this,"isHideable",()=>"visible"in this),I(this,"isConfigurable",()=>"setup"in this&&"config"in this&&"onSetup"in this),this.components=t}}class J extends yi{}class Li extends yi{constructor(t){super(t),I(this,"worlds",new Map),I(this,"onWorldChanged",new M),I(this,"currentWorld",null),this.onWorldChanged.add(({world:e,action:s})=>{s==="removed"&&this.worlds.delete(e.uuid)})}}class ca extends Li{constructor(){super(...arguments),I(this,"hasCameraControls",()=>"controls"in this)}}class la extends Li{constructor(){super(...arguments),I(this,"onAfterUpdate",new M),I(this,"onBeforeUpdate",new M),I(this,"onDisposed",new M),I(this,"onResize",new M),I(this,"onClippingPlanesUpdated",new M),I(this,"clippingPlanes",[])}updateClippingPlanes(){this.onClippingPlanesUpdated.trigger()}setPlane(t,e,s){e.isLocal=s;const i=this.clippingPlanes.indexOf(e);t&&i===-1?this.clippingPlanes.push(e):!t&&i>-1&&this.clippingPlanes.splice(i,1),this.three.clippingPlanes=this.clippingPlanes.filter(n=>!n.isLocal)}}const Yn=class ai extends J{constructor(t){super(t),I(this,"_disposedComponents",new Set),I(this,"enabled",!0),t.add(ai.uuid,this)}get(){return this._disposedComponents}destroy(t,e=!0,s=!0){t.removeFromParent();const i=t;i.dispose&&i.dispose(),this.disposeGeometryAndMaterials(t,e),s&&i.children&&i.children.length&&this.disposeChildren(i),t.children.length=0}disposeGeometry(t){t.boundsTree&&t.disposeBoundsTree&&t.disposeBoundsTree(),t.dispose()}disposeGeometryAndMaterials(t,e){const s=t;s.geometry&&this.disposeGeometry(s.geometry),e&&s.material&&ai.disposeMaterial(s),s.material=[],s.geometry=null}disposeChildren(t){for(const e of t.children)this.destroy(e)}static disposeMaterial(t){if(t.material)if(Array.isArray(t.material))for(const e of t.material)e.dispose();else t.material.dispose()}};I(Yn,"uuid","76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");let me=Yn;class da extends Li{constructor(t){super(t),I(this,"onDisposed",new M)}dispose(){const t=this.components.get(me);for(const e of this.three.children){const s=e;s.geometry&&t.destroy(s)}this.three.children=[],this.onDisposed.trigger(),this.onDisposed.reset()}}const fs=0,Ea=1,ua=new O,on=new Ft,Hs=new fe,rn=new O,cs=new Ie;class Ia{constructor(){this.tolerance=-1,this.faces=[],this.newFaces=[],this.assigned=new an,this.unassigned=new an,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 o=0,r=s.length;o0&&d>=0)return null;const E=d!==0?-h/d:0;if(!(E<=0)&&(d>0?n=Math.min(E,n):i=Math.max(E,i),i>n))return null}return i!==-1/0?t.at(i,e):t.at(n,e),e}intersectsRay(t){return this.intersectRay(t,ua)!==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 o=0;oi&&(i=a,n=r),i>1e3*this.tolerance)break}}n!==null&&this.addVertexToFace(e,n),e=s}while(e!==null)}return this}computeExtremes(){const t=new O,e=new O,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,o=this.vertices.length;ne.getComponent(h)&&(e.setComponent(h,a.getComponent(h)),i[h]=r)}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,o=0;for(let l=0;l<3;l++){const u=i[l].point.getComponent(l)-s[l].point.getComponent(l);u>n&&(n=u,o=l)}const r=s[o],a=i[o];let h,d;n=0,on.set(r.point,a.point);for(let l=0,u=this.vertices.length;ln&&(n=T,h=C)}}n=-1,Hs.setFromCoplanarPoints(r.point,a.point,h.point);for(let l=0,u=this.vertices.length;ln&&(n=T,d=C)}}const E=[];if(Hs.distanceToPoint(d.point)<0){E.push(ft.create(r,a,h),ft.create(d,a,r),ft.create(d,h,a),ft.create(d,r,h));for(let l=0;l<3;l++){const u=(l+1)%3;E[l+1].getEdge(2).setTwin(E[0].getEdge(u)),E[l+1].getEdge(1).setTwin(E[u+1].getEdge(0))}}else{E.push(ft.create(r,h,a),ft.create(d,r,a),ft.create(d,a,h),ft.create(d,h,r));for(let l=0;l<3;l++){const u=(l+1)%3;E[l+1].getEdge(2).setTwin(E[0].getEdge((3-l)%3)),E[l+1].getEdge(0).setTwin(E[u+1].getEdge(1))}}for(let l=0;l<4;l++)this.faces.push(E[l]);for(let l=0,u=t.length;ln&&(n=f,T=this.faces[m])}T!==null&&this.addVertexToFace(C,T)}}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=Ea;let n;e===null?n=e=s.getEdge(0):n=e.next;do{const o=n.twin,r=o.face;r.mark===fs&&(r.distanceToPoint(t)>this.tolerance?this.computeHorizon(t,o,r,i):i.push(n)),n=n.next}while(n!==e);return this}addAdjoiningFace(t,e){const s=ft.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 cs.set(t.point,e.point,s.point),cs.getNormal(this.normal),cs.getMidpoint(this.midpoint),this.area=cs.getArea(),this.constant=this.normal.dot(this.midpoint),this}distanceToPoint(t){return this.normal.dot(t)-this.constant}}class Ws{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 pa{constructor(t){this.point=t,this.prev=null,this.next=null,this.face=null}}class an{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 hi=[2,2,1],ci=[1,0,0];function Nt(c,t){return c*3+t}function Ca(c){const t=c.elements;let e=0;for(let s=0;s<9;s++)e+=t[s]*t[s];return Math.sqrt(e)}function Ta(c){const t=c.elements;let e=0;for(let s=0;s<3;s++){const i=t[Nt(hi[s],ci[s])];e+=2*i*i}return Math.sqrt(e)}function ma(c,t){let e=0,s=1;const i=c.elements;for(let h=0;h<3;h++){const d=Math.abs(i[Nt(hi[h],ci[h])]);d>e&&(e=d,s=h)}let n=1,o=0;const r=ci[s],a=hi[s];if(Math.abs(i[Nt(a,r)])>Number.EPSILON){const h=i[Nt(a,a)],d=i[Nt(r,r)],E=i[Nt(a,r)],l=(h-d)/2/E;let u;l<0?u=-1/(-l+Math.sqrt(1+l*l)):u=1/(l+Math.sqrt(1+l*l)),n=1/Math.sqrt(1+u*u),o=u*n}return t.identity(),t.elements[Nt(r,r)]=n,t.elements[Nt(a,a)]=n,t.elements[Nt(a,r)]=o,t.elements[Nt(r,a)]=-o,t}function fa(c,t){let e=0,s=0;const i=10;t.unitary.identity(),t.diagonal.copy(c);const n=t.unitary,o=t.diagonal,r=new Zt,a=new Zt,h=Number.EPSILON*Ca(o);for(;sh;)ma(o,r),a.copy(r).transpose(),o.multiply(r),o.premultiply(a),n.multiply(r),++e>2&&(s++,e=0);return t}function Ra(c){const t=[];for(let $=0;$0}class hn{static isTransparent(t){return t.transparent&&t.opacity<1}}const li=class et{static create(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,s=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return`${et._lut[t&255]+et._lut[t>>8&255]+et._lut[t>>16&255]+et._lut[t>>24&255]}-${et._lut[e&255]}${et._lut[e>>8&255]}-${et._lut[e>>16&15|64]}${et._lut[e>>24&255]}-${et._lut[s&63|128]}${et._lut[s>>8&255]}-${et._lut[s>>16&255]}${et._lut[s>>24&255]}${et._lut[i&255]}${et._lut[i>>8&255]}${et._lut[i>>16&255]}${et._lut[i>>24&255]}`.toLowerCase()}static validate(t){if(!et._pattern.test(t))throw new Error(`${t} is not a valid UUID v4. +import{r as Ft,s as st,T as Ie,t as pi,E as So,c as H,V as O,h as At,x as fe,S as Os,a as D,C as Qt,y as Ci,D as No,A as wo,W as Fs,w as Ti,P as yo,aU as Lo,v as Po,ap as Rt,aV as Mo,af as _n,i as Uo,I as Js,$ as mi,a5 as Ce,H as Do,e as ze,b as Te,N as He,q as jt,Q as Zt,X as fi,Y as Sn,Z as Nn,_ as wn,a0 as yn,a1 as Ln,a2 as Ri,a3 as Pn,B as it,a4 as xo,ab as wt,a6 as bi,a7 as Mn,a8 as Un,a9 as Kt,aa as vo,d as Ge,ac as ke,ad as bo,ae as Bo,p as Fi,au as Ai,av as gi,ao as Oi,K as _i,am as Yo,J as rt,O as As,at as Ps,al as zo,aw as Go,L as Dn,ax as Vo,ay as Ho,az as Wo,aA as Xo,aB as ko,aS as Bi,aT as Zo,z as Yi,aq as Ze,an as Ut,ar as Qo,as as ge,ai as jo,aW as qo,aX as Ko,aY as $o,aZ as Jo,a_ as tr,b3 as er}from"./web-ifc-api-CfQNUy7g.js";var sr=Object.defineProperty,ir=(c,t,e)=>t in c?sr(c,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):c[t]=e,I=(c,t,e)=>(ir(c,typeof t!="symbol"?t+"":t,e),e);const xn=0,nr=1,or=2,zi=2,Ms=1.25,Gi=1,Ts=6*4+4+4,_s=65535,rr=Math.pow(2,-24),Us=Symbol("SKIP_GENERATION");function ar(c){return c.index?c.index.count:c.attributes.position.count}function Re(c){return ar(c)/3}function hr(c,t=ArrayBuffer){return c>65535?new Uint32Array(new t(4*c)):new Uint16Array(new t(2*c))}function cr(c,t){if(!c.index){const e=c.attributes.position.count,s=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,i=hr(e,s);c.setIndex(new Ge(i,1));for(let n=0;nr-a);for(let r=0;rn.offset-o.offset),s=e[e.length-1];s.count=Math.min(t-s.offset,s.count);let i=0;return e.forEach(({count:n})=>i+=n),t!==i}function j(c,t,e){return e.min.x=t[c],e.min.y=t[c+1],e.min.z=t[c+2],e.max.x=t[c+3],e.max.y=t[c+4],e.max.z=t[c+5],e}function dr(c){c[0]=c[1]=c[2]=1/0,c[3]=c[4]=c[5]=-1/0}function Vi(c){let t=-1,e=-1/0;for(let s=0;s<3;s++){const i=c[s+3]-c[s];i>e&&(e=i,t=s)}return t}function Hi(c,t){t.set(c)}function Wi(c,t,e){let s,i;for(let n=0;n<3;n++){const o=n+3;s=c[n],i=t[n],e[n]=si?s:i}}function Qe(c,t,e){for(let s=0;s<3;s++){const i=t[c+2*s],n=t[c+2*s+1],o=i-n,r=i+n;oe[s+3]&&(e[s+3]=r)}}function Oe(c){const t=c[3]-c[0],e=c[4]-c[1],s=c[5]-c[2];return 2*(t*e+e*s+s*t)}function Ds(c,t,e,s,i=null){let n=1/0,o=1/0,r=1/0,a=-1/0,h=-1/0,d=-1/0,E=1/0,l=1/0,u=1/0,C=-1/0,T=-1/0,m=-1/0;const f=i!==null;for(let R=t*6,A=(t+e)*6;Ra&&(a=_),f&&pC&&(C=p);const S=c[R+2],w=c[R+3],y=S-w,L=S+w;yh&&(h=L),f&&ST&&(T=S);const P=c[R+4],U=c[R+5],x=P-U,Y=P+U;xd&&(d=Y),f&&Pm&&(m=P)}s[0]=n,s[1]=o,s[2]=r,s[3]=a,s[4]=h,s[5]=d,f&&(i[0]=E,i[1]=l,i[2]=u,i[3]=C,i[4]=T,i[5]=m)}function Er(c,t,e,s){let i=1/0,n=1/0,o=1/0,r=-1/0,a=-1/0,h=-1/0;for(let d=t*6,E=(t+e)*6;dr&&(r=l);const u=c[d+2];ua&&(a=u);const C=c[d+4];Ch&&(h=C)}s[0]=i,s[1]=n,s[2]=o,s[3]=r,s[4]=a,s[5]=h}function ur(c,t){dr(t);const e=c.attributes.position,s=c.index?c.index.array:null,i=Re(c),n=new Float32Array(i*6),o=e.normalized,r=e.array,a=e.offset||0;let h=3;e.isInterleavedBufferAttribute&&(h=e.data.stride);const d=["getX","getY","getZ"];for(let E=0;Eg&&(g=A),p>g&&(g=p);const _=(g-F)/2,S=f*2;n[u+S+0]=F+_,n[u+S+1]=_+(Math.abs(F)+_)*rr,Ft[f+3]&&(t[f+3]=g)}}return n}const yt=32,Ir=(c,t)=>c.candidate-t.candidate,Dt=new Array(yt).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),je=new Float32Array(6);function pr(c,t,e,s,i,n){let o=-1,r=0;if(n===xn)o=Vi(t),o!==-1&&(r=(t[o]+t[o+3])/2);else if(n===nr)o=Vi(c),o!==-1&&(r=Cr(e,s,i,o));else if(n===or){const a=Oe(c);let h=Ms*i;const d=s*6,E=(s+i)*6;for(let l=0;l<3;l++){const u=t[l],C=(t[l+3]-u)/yt;if(i=F.candidate?Qe(R,e,F.rightCacheBounds):(Qe(R,e,F.leftCacheBounds),F.count++)}}for(let R=0;R=yt&&(R=yt-1);const A=Dt[R];A.count++,Qe(f,e,A.bounds)}const T=Dt[yt-1];Hi(T.bounds,T.rightCacheBounds);for(let f=yt-2;f>=0;f--){const R=Dt[f],A=Dt[f+1];Wi(R.bounds,A.rightCacheBounds,R.rightCacheBounds)}let m=0;for(let f=0;f=a;)r--;if(o=a;)r--;if(o2**16,i=s?4:2,n=t?new SharedArrayBuffer(e*i):new ArrayBuffer(e*i),o=s?new Uint32Array(n):new Uint16Array(n);for(let r=0,a=o.length;r=i&&(E=!0,n&&(console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`),console.warn(e))),g<=o||S>=i)return R(F+g),p.offset=F,p.count=g,p;const w=pr(p.boundingData,_,C,F,g,r);if(w.axis===-1)return R(F+g),p.offset=F,p.count=g,p;const y=T(d,s,C,F,g,w);if(y===F||y===F+g)R(F+g),p.offset=F,p.count=g;else{p.splitAxis=w.axis;const L=new qe,P=F,U=y-F;p.left=L,L.boundingData=new Float32Array(6),Ds(C,P,U,L.boundingData,u),A(L,P,U,u,S+1);const x=new qe,Y=y,z=g-U;p.right=x,x.boundingData=new Float32Array(6),Ds(C,Y,z,x.boundingData,u),A(x,Y,z,u,S+1)}return p}}function Fr(c,t){const e=c.geometry;t.indirect&&(c._indirectBuffer=fr(e,t.useSharedArrayBuffer),lr(e)&&!t.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.')),c._indirectBuffer||cr(e,t);const s=Rr(c,t);let i,n,o;const r=[],a=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let E=0;EMath.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return n[u+6]=p/4,p=d(p,R),n[u+7]=A,p}}}class Pt{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(t,e){let s=1/0,i=-1/0;for(let n=0,o=t.length;ni?r:i}this.min=s,this.max=i}setFromPoints(t,e){let s=1/0,i=-1/0;for(let n=0,o=e.length;ni?a:i}this.min=s,this.max=i}isSeparated(t){return this.min>t.max||t.min>this.max}}Pt.prototype.setFromBox=function(){const c=new O;return function(t,e){const s=e.min,i=e.max;let n=1/0,o=-1/0;for(let r=0;r<=1;r++)for(let a=0;a<=1;a++)for(let h=0;h<=1;h++){c.x=s.x*r+i.x*(1-r),c.y=s.y*a+i.y*(1-a),c.z=s.z*h+i.z*(1-h);const d=t.dot(c);n=Math.min(d,n),o=Math.max(d,o)}this.min=n,this.max=o}}();const Ar=function(){const c=new O,t=new O,e=new O;return function(s,i,n){const o=s.start,r=c,a=i.start,h=t;e.subVectors(o,a),c.subVectors(s.end,s.start),t.subVectors(i.end,i.start);const d=e.dot(h),E=h.dot(r),l=h.dot(h),u=e.dot(r),C=r.dot(r)*l-E*E;let T,m;C!==0?T=(d*E-u*l)/C:T=0,m=(d+T*E)/l,n.x=T,n.y=m}}(),Si=function(){const c=new At,t=new O,e=new O;return function(s,i,n,o){Ar(s,i,c);let r=c.x,a=c.y;if(r>=0&&r<=1&&a>=0&&a<=1){s.at(r,n),i.at(a,o);return}else if(r>=0&&r<=1){a<0?i.at(0,o):i.at(1,o),s.closestPointToPoint(o,!0,n);return}else if(a>=0&&a<=1){r<0?s.at(0,n):s.at(1,n),i.closestPointToPoint(n,!0,o);return}else{let h;r<0?h=s.start:h=s.end;let d;a<0?d=i.start:d=i.end;const E=t,l=e;if(s.closestPointToPoint(d,!0,t),i.closestPointToPoint(h,!0,e),E.distanceToSquared(d)<=l.distanceToSquared(h)){n.copy(E),o.copy(d);return}else{n.copy(h),o.copy(l);return}}}}(),gr=function(){const c=new O,t=new O,e=new fe,s=new Ft;return function(i,n){const{radius:o,center:r}=i,{a,b:h,c:d}=n;if(s.start=a,s.end=h,s.closestPointToPoint(r,!0,c).distanceTo(r)<=o||(s.start=a,s.end=d,s.closestPointToPoint(r,!0,c).distanceTo(r)<=o)||(s.start=h,s.end=d,s.closestPointToPoint(r,!0,c).distanceTo(r)<=o))return!0;const E=n.getPlane(e);if(Math.abs(E.distanceToPoint(r))<=o){const l=E.projectPoint(r,t);if(n.containsPoint(l))return!0}return!1}}(),Or=1e-15;function xs(c){return Math.abs(c)new O),this.satBounds=new Array(4).fill().map(()=>new Pt),this.points=[this.a,this.b,this.c],this.sphere=new Os,this.plane=new fe,this.needsUpdate=!0}intersectsSphere(t){return gr(t,this)}update(){const t=this.a,e=this.b,s=this.c,i=this.points,n=this.satAxes,o=this.satBounds,r=n[0],a=o[0];this.getNormal(r),a.setFromPoints(r,i);const h=n[1],d=o[1];h.subVectors(t,e),d.setFromPoints(h,i);const E=n[2],l=o[2];E.subVectors(e,s),l.setFromPoints(E,i);const u=n[3],C=o[3];u.subVectors(s,t),C.setFromPoints(u,i),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(r,t),this.needsUpdate=!1}}gt.prototype.closestPointToSegment=function(){const c=new O,t=new O,e=new Ft;return function(s,i=null,n=null){const{start:o,end:r}=s,a=this.points;let h,d=1/0;for(let E=0;E<3;E++){const l=(E+1)%3;e.start.copy(a[E]),e.end.copy(a[l]),Si(e,s,c,t),h=c.distanceToSquared(t),h=2){(p===1?f.start:f.end).copy(u),A=2;break}if(A++,A===2&&p===-1)break}}return A}return function(T,m=null,f=!1){this.needsUpdate&&this.update(),T.isExtendedTriangle?T.needsUpdate&&T.update():(c.copy(T),c.update(),T=c);const R=this.plane,A=T.plane;if(Math.abs(R.normal.dot(A.normal))>1-1e-10){const p=this.satBounds,F=this.satAxes;e[0]=T.a,e[1]=T.b,e[2]=T.c;for(let S=0;S<4;S++){const w=p[S],y=F[S];if(s.setFromPoints(y,e),w.isSeparated(s))return!1}const g=T.satBounds,_=T.satAxes;t[0]=this.a,t[1]=this.b,t[2]=this.c;for(let S=0;S<4;S++){const w=g[S],y=_[S];if(s.setFromPoints(y,t),w.isSeparated(s))return!1}for(let S=0;S<4;S++){const w=F[S];for(let y=0;y<4;y++){const L=_[y];if(n.crossVectors(w,L),s.setFromPoints(n,t),i.setFromPoints(n,e),s.isSeparated(i))return!1}}return m&&(f||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),m.start.set(0,0,0),m.end.set(0,0,0)),!0}else{const p=C(this,A,E);if(p===1&&T.containsPoint(E.end))return m&&(m.start.copy(E.end),m.end.copy(E.end)),!0;if(p!==2)return!1;const F=C(T,R,l);if(F===1&&this.containsPoint(l.end))return m&&(m.start.copy(l.end),m.end.copy(l.end)),!0;if(F!==2)return!1;if(E.delta(r),l.delta(a),r.dot(a)<0){let P=l.start;l.start=l.end,l.end=P}const g=E.start.dot(r),_=E.end.dot(r),S=l.start.dot(r),w=l.end.dot(r),y=_0?m.start.copy(E.start):m.start.copy(l.start),h.subVectors(E.end,l.end),h.dot(r)<0?m.end.copy(E.end):m.end.copy(l.end)),!0)}}}();gt.prototype.distanceToPoint=function(){const c=new O;return function(t){return this.closestPointToPoint(t,c),t.distanceTo(c)}}();gt.prototype.distanceToTriangle=function(){const c=new O,t=new O,e=["a","b","c"],s=new Ft,i=new Ft;return function(n,o=null,r=null){const a=o||r?s:null;if(this.intersectsTriangle(n,a))return(o||r)&&(o&&a.getCenter(o),r&&a.getCenter(r)),0;let h=1/0;for(let d=0;d<3;d++){let E;const l=e[d],u=n[l];this.closestPointToPoint(u,c),E=u.distanceToSquared(c),Enew O),this.satAxes=new Array(3).fill().map(()=>new O),this.satBounds=new Array(3).fill().map(()=>new Pt),this.alignedSatBounds=new Array(3).fill().map(()=>new Pt),this.needsUpdate=!1,t&&this.min.copy(t),e&&this.max.copy(e),s&&this.matrix.copy(s)}set(t,e,s){this.min.copy(t),this.max.copy(e),this.matrix.copy(s),this.needsUpdate=!0}copy(t){this.min.copy(t.min),this.max.copy(t.max),this.matrix.copy(t.matrix),this.needsUpdate=!0}}at.prototype.update=function(){return function(){const c=this.matrix,t=this.min,e=this.max,s=this.points;for(let a=0;a<=1;a++)for(let h=0;h<=1;h++)for(let d=0;d<=1;d++){const E=1*a|2*h|4*d,l=s[E];l.x=a?e.x:t.x,l.y=h?e.y:t.y,l.z=d?e.z:t.z,l.applyMatrix4(c)}const i=this.satBounds,n=this.satAxes,o=s[0];for(let a=0;a<3;a++){const h=n[a],d=i[a],E=1<new Ft),e=new Array(12).fill().map(()=>new Ft),s=new O,i=new O;return function(n,o=0,r=null,a=null){if(this.needsUpdate&&this.update(),this.intersectsBox(n))return(r||a)&&(n.getCenter(i),this.closestPointToPoint(i,s),n.closestPointToPoint(s,i),r&&r.copy(s),a&&a.copy(i)),0;const h=o*o,d=n.min,E=n.max,l=this.points;let u=1/0;for(let T=0;T<8;T++){const m=l[T];i.copy(m).clamp(d,E);const f=m.distanceToSquared(i);if(fnew gt)}}const ut=new _r;function ct(c,t){return t[c+15]===65535}function lt(c,t){return t[c+6]}function It(c,t){return t[c+14]}function pt(c){return c+8}function Ct(c,t){return t[c+6]}function Bn(c,t){return t[c+7]}class Sr{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const t=[];let e=null;this.setBuffer=s=>{e&&t.push(e),e=s,this.float32Array=new Float32Array(s),this.uint16Array=new Uint16Array(s),this.uint32Array=new Uint32Array(s)},this.clearBuffer=()=>{e=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,t.length!==0&&this.setBuffer(t.pop())}}}const Z=new Sr;let Bt,pe;const Jt=[],Ke=new Ni(()=>new st);function Nr(c,t,e,s,i,n){Bt=Ke.getPrimitive(),pe=Ke.getPrimitive(),Jt.push(Bt,pe),Z.setBuffer(c._roots[t]);const o=ti(0,c.geometry,e,s,i,n);Z.clearBuffer(),Ke.releasePrimitive(Bt),Ke.releasePrimitive(pe),Jt.pop(),Jt.pop();const r=Jt.length;return r>0&&(pe=Jt[r-1],Bt=Jt[r-2]),o}function ti(c,t,e,s,i=null,n=0,o=0){const{float32Array:r,uint16Array:a,uint32Array:h}=Z;let d=c*2;if(ct(d,a)){const E=lt(c,h),l=It(d,a);return j(c,r,Bt),s(E,l,!1,o,n+c,Bt)}else{let E=function(L){const{uint16Array:P,uint32Array:U}=Z;let x=L*2;for(;!ct(x,P);)L=pt(L),x=L*2;return lt(L,U)},l=function(L){const{uint16Array:P,uint32Array:U}=Z;let x=L*2;for(;!ct(x,P);)L=Ct(L,U),x=L*2;return lt(L,U)+It(x,P)};const u=pt(c),C=Ct(c,h);let T=u,m=C,f,R,A,p;if(i&&(A=Bt,p=pe,j(T,r,A),j(m,r,p),f=i(A),R=i(p),R(_e.copy(t).clamp(d.min,d.max),_e.distanceToSquared(t)),intersectsBounds:(d,E,l)=>l{d.closestPointToPoint(t,_e);const l=t.distanceToSquared(_e);return l0&&h.normal.multiplyScalar(-1));const d={a:n,b:o,c:r,normal:new O,materialIndex:0};Ie.getNormal(te,ee,se,d.normal),h.face=d,h.faceIndex=n}return h}function Ss(c,t,e,s,i){const n=s*3;let o=n+0,r=n+1,a=n+2;const h=c.index;c.index&&(o=h.getX(o),r=h.getX(r),a=h.getX(a));const{position:d,normal:E,uv:l,uv1:u}=c.attributes,C=Lr(e,d,E,l,u,o,r,a,t);return C?(C.faceIndex=s,i&&i.push(C),C):null}function K(c,t,e,s){const i=c.a,n=c.b,o=c.c;let r=t,a=t+1,h=t+2;e&&(r=e.getX(r),a=e.getX(a),h=e.getX(h)),i.x=s.getX(r),i.y=s.getY(r),i.z=s.getZ(r),n.x=s.getX(a),n.y=s.getY(a),n.z=s.getZ(a),o.x=s.getX(h),o.y=s.getY(h),o.z=s.getZ(h)}function Pr(c,t,e,s,i,n){const{geometry:o,_indirectBuffer:r}=c;for(let a=s,h=s+i;aF&&(F=L),Pg&&(g=P),U_&&(_=U)}return a[l+0]!==R||a[l+1]!==A||a[l+2]!==p||a[l+3]!==F||a[l+4]!==g||a[l+5]!==_?(a[l+0]=R,a[l+1]=A,a[l+2]=p,a[l+3]=F,a[l+4]=g,a[l+5]=_,!0):!1}else{const m=l+8,f=o[l+6],R=m+u,A=f+u;let p=C,F=!1,g=!1;t?p||(F=t.has(R),g=t.has(A),p=!F&&!g):(F=!0,g=!0);const _=p||F,S=p||g;let w=!1;_&&(w=E(m,u,p));let y=!1;S&&(y=E(f,u,p));const L=w||y;if(L)for(let P=0;P<3;P++){const U=m+P,x=f+P,Y=a[U],z=a[U+3],tt=a[x],W=a[x+3];a[l+P]=YW?z:W}return L}}}const Qi=new st;function Yt(c,t,e,s){return j(c,t,Qi),e.intersectBox(Qi,s)}function xr(c,t,e,s,i,n){const{geometry:o,_indirectBuffer:r}=c;for(let a=s,h=s+i;a=0;let E,l;d?(E=pt(c),l=Ct(c,o)):(E=Ct(c,o),l=pt(c));const u=Yt(E,i,s,qi)?si(E,t,e,s):null;if(u){const T=u.point[h];if(d?T<=i[l+a]:T>=i[l+a+3])return u}const C=Yt(l,i,s,qi)?si(l,t,e,s):null;return u&&C?u.distance<=C.distance?u:C:u||C||null}}const ss=new st,ie=new gt,ne=new gt,Se=new H,Ki=new at,is=new at;function Gr(c,t,e,s){Z.setBuffer(c._roots[t]);const i=ii(0,c,e,s);return Z.clearBuffer(),i}function ii(c,t,e,s,i=null){const{float32Array:n,uint16Array:o,uint32Array:r}=Z;let a=c*2;if(i===null&&(e.boundingBox||e.computeBoundingBox(),Ki.set(e.boundingBox.min,e.boundingBox.max,s),i=Ki),ct(a,o)){const h=t.geometry,d=h.index,E=h.attributes.position,l=e.index,u=e.attributes.position,C=lt(c,r),T=It(a,o);if(Se.copy(s).invert(),e.boundsTree)return j(c,n,is),is.matrix.copy(Se),is.needsUpdate=!0,e.boundsTree.shapecast({intersectsBounds:m=>is.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(s),m.b.applyMatrix4(s),m.c.applyMatrix4(s),m.needsUpdate=!0;for(let f=C*3,R=(T+C)*3;fbs.distanceToBox(F),intersectsBounds:(F,g,_)=>_{if(t.boundsTree)return t.boundsTree.shapecast({boundsTraverseOrder:_=>Ne.distanceToBox(_),intersectsBounds:(_,S,w)=>w{for(let w=_,y=_+S;wF&&(F=U),xg&&(g=x),Y_&&(_=Y)}}return a[l+0]!==R||a[l+1]!==A||a[l+2]!==p||a[l+3]!==F||a[l+4]!==g||a[l+5]!==_?(a[l+0]=R,a[l+1]=A,a[l+2]=p,a[l+3]=F,a[l+4]=g,a[l+5]=_,!0):!1}else{const m=l+8,f=o[l+6],R=m+u,A=f+u;let p=C,F=!1,g=!1;t?p||(F=t.has(R),g=t.has(A),p=!F&&!g):(F=!0,g=!0);const _=p||F,S=p||g;let w=!1;_&&(w=E(m,u,p));let y=!1;S&&(y=E(f,u,p));const L=w||y;if(L)for(let P=0;P<3;P++){const U=m+P,x=f+P,Y=a[U],z=a[U+3],tt=a[x],W=a[x+3];a[l+P]=YW?z:W}return L}}}const $i=new O;function Qr(c,t,e,s,i){Z.setBuffer(c._roots[t]),ni(0,c,e,s,i),Z.clearBuffer()}function ni(c,t,e,s,i){const{float32Array:n,uint16Array:o,uint32Array:r}=Z,a=c*2;if(ct(a,o)){const h=lt(c,r),d=It(a,o);xr(t,e,s,h,d,i)}else{const h=pt(c);Yt(h,n,s,$i)&&ni(h,t,e,s,i);const d=Ct(c,r);Yt(d,n,s,$i)&&ni(d,t,e,s,i)}}const Ji=new O,jr=["x","y","z"];function qr(c,t,e,s){Z.setBuffer(c._roots[t]);const i=oi(0,c,e,s);return Z.clearBuffer(),i}function oi(c,t,e,s){const{float32Array:i,uint16Array:n,uint32Array:o}=Z;let r=c*2;if(ct(r,n)){const a=lt(c,o),h=It(r,n);return vr(t,e,s,a,h)}else{const a=Bn(c,o),h=jr[a],d=s.direction[h]>=0;let E,l;d?(E=pt(c),l=Ct(c,o)):(E=Ct(c,o),l=pt(c));const u=Yt(E,i,s,Ji)?oi(E,t,e,s):null;if(u){const T=u.point[h];if(d?T<=i[l+a]:T>=i[l+a+3])return u}const C=Yt(l,i,s,Ji)?oi(l,t,e,s):null;return u&&C?u.distance<=C.distance?u:C:u||C||null}}const os=new st,oe=new gt,re=new gt,we=new H,tn=new at,rs=new at;function Kr(c,t,e,s){Z.setBuffer(c._roots[t]);const i=ri(0,c,e,s);return Z.clearBuffer(),i}function ri(c,t,e,s,i=null){const{float32Array:n,uint16Array:o,uint32Array:r}=Z;let a=c*2;if(i===null&&(e.boundingBox||e.computeBoundingBox(),tn.set(e.boundingBox.min,e.boundingBox.max,s),i=tn),ct(a,o)){const h=t.geometry,d=h.index,E=h.attributes.position,l=e.index,u=e.attributes.position,C=lt(c,r),T=It(a,o);if(we.copy(s).invert(),e.boundsTree)return j(c,n,rs),rs.matrix.copy(we),rs.needsUpdate=!0,e.boundsTree.shapecast({intersectsBounds:m=>rs.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(s),m.b.applyMatrix4(s),m.c.applyMatrix4(s),m.needsUpdate=!0;for(let f=C,R=T+C;fBs.distanceToBox(F),intersectsBounds:(F,g,_)=>_{if(t.boundsTree){const _=t.boundsTree;return _.shapecast({boundsTraverseOrder:S=>ye.distanceToBox(S),intersectsBounds:(S,w,y)=>y{for(let y=S,L=S+w;ynew st),ae=new st,he=new st,Ys=new st,zs=new st;let Gs=!1;function na(c,t,e,s){if(Gs)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");Gs=!0;const i=c._roots,n=t._roots;let o,r=0,a=0;const h=new H().copy(e).invert();for(let d=0,E=i.length;da.slice()),index:o.array.slice(),indirectBuffer:n?n.slice():null}:r={roots:i,index:o.array,indirectBuffer:n},r}static deserialize(t,e,s={}){s={setIndex:!0,indirect:!!t.indirectBuffer,...s};const{index:i,roots:n,indirectBuffer:o}=t,r=new wi(e,{...s,[Us]:!0});if(r._roots=n,r._indirectBuffer=o||null,s.setIndex){const a=e.getIndex();if(a===null){const h=new Ge(t.index,1,!1);e.setIndex(h)}else a.array!==i&&(a.array.set(i),a.needsUpdate=!0)}return r}get indirect(){return!!this._indirectBuffer}constructor(t,e={}){if(t.isBufferGeometry){if(t.index&&t.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");if(e=Object.assign({strategy:xn,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[Us]:!1},e),e.useSharedArrayBuffer&&!ia())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=t,this._roots=null,this._indirectBuffer=null,e[Us]||(Fr(this,e),!t.boundingBox&&e.setBoundingBox&&(t.boundingBox=this.getBoundingBox(new st)));const{_indirectBuffer:s}=this;this.resolveTriangleIndex=e.indirect?i=>s[i]:i=>i}refit(t=null){return(this.indirect?Zr:Dr)(this,t)}traverse(t,e=0){const s=this._roots[e],i=new Uint32Array(s),n=new Uint16Array(s);o(0);function o(r,a=0){const h=r*2,d=n[h+15]===_s;if(d){const E=i[r+6],l=n[h+14];t(a,d,new Float32Array(s,r*4,6),E,l)}else{const E=r+Ts/4,l=i[r+6],u=i[r+7];t(a,d,new Float32Array(s,r*4,6),u)||(o(E,a+1),o(l,a+1))}}}raycast(t,e=Bi){const s=this._roots,i=this.geometry,n=[],o=e.isMaterial,r=Array.isArray(e),a=i.groups,h=o?e.side:e,d=this.indirect?Qr:Br;for(let E=0,l=s.length;EE(l,u,C,T,m)?!0:s(l,u,this,r,C,T,e)}else o||(r?o=(E,l,u,C)=>s(E,l,this,r,u,C,e):o=(E,l,u)=>u);let a=!1,h=0;const d=this._roots;for(let E=0,l=d.length;E{const T=this.resolveTriangleIndex(C);K(o,T*3,r,a)}:C=>{K(o,C*3,r,a)},d=ut.getPrimitive(),E=t.geometry.index,l=t.geometry.attributes.position,u=t.indirect?C=>{const T=t.resolveTriangleIndex(C);K(d,T*3,E,l)}:C=>{K(d,C*3,E,l)};if(n){const C=(T,m,f,R,A,p,F,g)=>{for(let _=f,S=f+R;_hs.intersectsBox(s),intersectsTriangle:s=>hs.intersectsTriangle(s)})}intersectsSphere(t){return this.shapecast({intersectsBounds:e=>t.intersectsBox(e),intersectsTriangle:e=>e.intersectsSphere(t)})}closestPointToGeometry(t,e,s={},i={},n=0,o=1/0){return(this.indirect?sa:kr)(this,t,e,s,i,n,o)}closestPointToPoint(t,e={},s=0,i=1/0){return wr(this,t,e,s,i)}getBoundingBox(t){return t.makeEmpty(),this._roots.forEach(e=>{j(0,new Float32Array(e),en),t.union(en)}),t}}function sn(c,t,e){return c===null||(c.point.applyMatrix4(t.matrixWorld),c.distance=c.point.distanceTo(e.ray.origin),c.object=t,c.distancee.far)?null:c}const Vs=new Zo,nn=new H,oa=D.prototype.raycast;function ra(c,t){if(this.geometry.boundsTree){if(this.material===void 0)return;nn.copy(this.matrixWorld).invert(),Vs.copy(c.ray).applyMatrix4(nn);const e=this.geometry.boundsTree;if(c.firstHitOnly===!0){const s=sn(e.raycastFirst(Vs,this.material),this,c);s&&t.push(s)}else{const s=e.raycast(Vs,this.material);for(let i=0,n=s.length;i{const e=this.handlers.slice(0);for(const s of e)s(t)}),I(this,"handlers",[])}add(t){this.handlers.push(t)}remove(t){this.handlers=this.handlers.filter(e=>e!==t)}reset(){this.handlers.length=0}}class ms{constructor(){I(this,"trigger",async t=>{const e=this.handlers.slice(0);for(const s of e)await s(t)}),I(this,"handlers",[])}add(t){this.handlers.push(t)}remove(t){this.handlers=this.handlers.filter(e=>e!==t)}reset(){this.handlers.length=0}}class yi{constructor(t){I(this,"isDisposeable",()=>"dispose"in this&&"onDisposed"in this),I(this,"isResizeable",()=>"resize"in this&&"getSize"in this),I(this,"isUpdateable",()=>"onAfterUpdate"in this&&"onBeforeUpdate"in this&&"update"in this),I(this,"isHideable",()=>"visible"in this),I(this,"isConfigurable",()=>"setup"in this&&"config"in this&&"onSetup"in this),this.components=t}}class J extends yi{}class Li extends yi{constructor(t){super(t),I(this,"worlds",new Map),I(this,"onWorldChanged",new M),I(this,"currentWorld",null),this.onWorldChanged.add(({world:e,action:s})=>{s==="removed"&&this.worlds.delete(e.uuid)})}}class ca extends Li{constructor(){super(...arguments),I(this,"hasCameraControls",()=>"controls"in this)}}class la extends Li{constructor(){super(...arguments),I(this,"onAfterUpdate",new M),I(this,"onBeforeUpdate",new M),I(this,"onDisposed",new M),I(this,"onResize",new M),I(this,"onClippingPlanesUpdated",new M),I(this,"clippingPlanes",[])}updateClippingPlanes(){this.onClippingPlanesUpdated.trigger()}setPlane(t,e,s){e.isLocal=s;const i=this.clippingPlanes.indexOf(e);t&&i===-1?this.clippingPlanes.push(e):!t&&i>-1&&this.clippingPlanes.splice(i,1),this.three.clippingPlanes=this.clippingPlanes.filter(n=>!n.isLocal)}}const Yn=class ai extends J{constructor(t){super(t),I(this,"_disposedComponents",new Set),I(this,"enabled",!0),t.add(ai.uuid,this)}get(){return this._disposedComponents}destroy(t,e=!0,s=!0){t.removeFromParent();const i=t;i.dispose&&i.dispose(),this.disposeGeometryAndMaterials(t,e),s&&i.children&&i.children.length&&this.disposeChildren(i),t.children.length=0}disposeGeometry(t){t.boundsTree&&t.disposeBoundsTree&&t.disposeBoundsTree(),t.dispose()}disposeGeometryAndMaterials(t,e){const s=t;s.geometry&&this.disposeGeometry(s.geometry),e&&s.material&&ai.disposeMaterial(s),s.material=[],s.geometry=null}disposeChildren(t){for(const e of t.children)this.destroy(e)}static disposeMaterial(t){if(t.material)if(Array.isArray(t.material))for(const e of t.material)e.dispose();else t.material.dispose()}};I(Yn,"uuid","76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");let me=Yn;class da extends Li{constructor(t){super(t),I(this,"onDisposed",new M)}dispose(){const t=this.components.get(me);for(const e of this.three.children){const s=e;s.geometry&&t.destroy(s)}this.three.children=[],this.onDisposed.trigger(),this.onDisposed.reset()}}const fs=0,Ea=1,ua=new O,on=new Ft,Hs=new fe,rn=new O,cs=new Ie;class Ia{constructor(){this.tolerance=-1,this.faces=[],this.newFaces=[],this.assigned=new an,this.unassigned=new an,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 o=0,r=s.length;o0&&d>=0)return null;const E=d!==0?-h/d:0;if(!(E<=0)&&(d>0?n=Math.min(E,n):i=Math.max(E,i),i>n))return null}return i!==-1/0?t.at(i,e):t.at(n,e),e}intersectsRay(t){return this.intersectRay(t,ua)!==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 o=0;oi&&(i=a,n=r),i>1e3*this.tolerance)break}}n!==null&&this.addVertexToFace(e,n),e=s}while(e!==null)}return this}computeExtremes(){const t=new O,e=new O,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,o=this.vertices.length;ne.getComponent(h)&&(e.setComponent(h,a.getComponent(h)),i[h]=r)}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,o=0;for(let l=0;l<3;l++){const u=i[l].point.getComponent(l)-s[l].point.getComponent(l);u>n&&(n=u,o=l)}const r=s[o],a=i[o];let h,d;n=0,on.set(r.point,a.point);for(let l=0,u=this.vertices.length;ln&&(n=T,h=C)}}n=-1,Hs.setFromCoplanarPoints(r.point,a.point,h.point);for(let l=0,u=this.vertices.length;ln&&(n=T,d=C)}}const E=[];if(Hs.distanceToPoint(d.point)<0){E.push(ft.create(r,a,h),ft.create(d,a,r),ft.create(d,h,a),ft.create(d,r,h));for(let l=0;l<3;l++){const u=(l+1)%3;E[l+1].getEdge(2).setTwin(E[0].getEdge(u)),E[l+1].getEdge(1).setTwin(E[u+1].getEdge(0))}}else{E.push(ft.create(r,h,a),ft.create(d,r,a),ft.create(d,a,h),ft.create(d,h,r));for(let l=0;l<3;l++){const u=(l+1)%3;E[l+1].getEdge(2).setTwin(E[0].getEdge((3-l)%3)),E[l+1].getEdge(0).setTwin(E[u+1].getEdge(1))}}for(let l=0;l<4;l++)this.faces.push(E[l]);for(let l=0,u=t.length;ln&&(n=f,T=this.faces[m])}T!==null&&this.addVertexToFace(C,T)}}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=Ea;let n;e===null?n=e=s.getEdge(0):n=e.next;do{const o=n.twin,r=o.face;r.mark===fs&&(r.distanceToPoint(t)>this.tolerance?this.computeHorizon(t,o,r,i):i.push(n)),n=n.next}while(n!==e);return this}addAdjoiningFace(t,e){const s=ft.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 cs.set(t.point,e.point,s.point),cs.getNormal(this.normal),cs.getMidpoint(this.midpoint),this.area=cs.getArea(),this.constant=this.normal.dot(this.midpoint),this}distanceToPoint(t){return this.normal.dot(t)-this.constant}}class Ws{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 pa{constructor(t){this.point=t,this.prev=null,this.next=null,this.face=null}}class an{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 hi=[2,2,1],ci=[1,0,0];function Nt(c,t){return c*3+t}function Ca(c){const t=c.elements;let e=0;for(let s=0;s<9;s++)e+=t[s]*t[s];return Math.sqrt(e)}function Ta(c){const t=c.elements;let e=0;for(let s=0;s<3;s++){const i=t[Nt(hi[s],ci[s])];e+=2*i*i}return Math.sqrt(e)}function ma(c,t){let e=0,s=1;const i=c.elements;for(let h=0;h<3;h++){const d=Math.abs(i[Nt(hi[h],ci[h])]);d>e&&(e=d,s=h)}let n=1,o=0;const r=ci[s],a=hi[s];if(Math.abs(i[Nt(a,r)])>Number.EPSILON){const h=i[Nt(a,a)],d=i[Nt(r,r)],E=i[Nt(a,r)],l=(h-d)/2/E;let u;l<0?u=-1/(-l+Math.sqrt(1+l*l)):u=1/(l+Math.sqrt(1+l*l)),n=1/Math.sqrt(1+u*u),o=u*n}return t.identity(),t.elements[Nt(r,r)]=n,t.elements[Nt(a,a)]=n,t.elements[Nt(a,r)]=o,t.elements[Nt(r,a)]=-o,t}function fa(c,t){let e=0,s=0;const i=10;t.unitary.identity(),t.diagonal.copy(c);const n=t.unitary,o=t.diagonal,r=new Zt,a=new Zt,h=Number.EPSILON*Ca(o);for(;sh;)ma(o,r),a.copy(r).transpose(),o.multiply(r),o.premultiply(a),n.multiply(r),++e>2&&(s++,e=0);return t}function Ra(c){const t=[];for(let $=0;$0}class hn{static isTransparent(t){return t.transparent&&t.opacity<1}}const li=class et{static create(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,s=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return`${et._lut[t&255]+et._lut[t>>8&255]+et._lut[t>>16&255]+et._lut[t>>24&255]}-${et._lut[e&255]}${et._lut[e>>8&255]}-${et._lut[e>>16&15|64]}${et._lut[e>>24&255]}-${et._lut[s&63|128]}${et._lut[s>>8&255]}-${et._lut[s>>16&255]}${et._lut[s>>24&255]}${et._lut[i&255]}${et._lut[i>>8&255]}${et._lut[i>>16&255]}${et._lut[i>>24&255]}`.toLowerCase()}static validate(t){if(!et._pattern.test(t))throw new Error(`${t} 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.`)}};I(li,"_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}$/),I(li,"_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 Pi=li;const zn=class Gn{constructor(){I(this,"onDisposed",new M),I(this,"list",new Map),I(this,"enabled",!1),I(this,"_clock"),I(this,"update",()=>{if(!this.enabled)return;const t=this._clock.getDelta();for(const[e,s]of this.list)s.enabled&&s.isUpdateable()&&s.update(t);requestAnimationFrame(this.update)}),this._clock=new Do,Gn.setupBVH()}add(t,e){if(this.list.has(t))throw new Error("You're trying to add a component that already exists in the components instance. Use Components.get() instead.");Pi.validate(t),this.list.set(t,e)}get(t){const e=t.uuid;if(!this.list.has(e)){const s=new t(this);return this.list.has(e)||this.add(e,s),s}return this.list.get(e)}init(){this.enabled=!0,this._clock.start(),this.update()}dispose(){this.enabled=!1;for(const[t,e]of this.list)e.enabled=!1,e.isDisposeable()&&e.dispose();this._clock.stop(),this.onDisposed.trigger(),this.onDisposed.reset()}static setupBVH(){ze.prototype.computeBoundsTree=aa,ze.prototype.disposeBoundsTree=ha,D.prototype.raycast=ra}};I(zn,"release","2.1.9");let Aa=zn;class ga{constructor(t){I(this,"_event"),I(this,"_position",new At),I(this,"onDisposed",new M),I(this,"updateMouseInfo",e=>{this._event=e}),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("pointermove",this.updateMouseInfo):this.dom.removeEventListener("pointermove",this.updateMouseInfo)}}class Oa{constructor(t,e){I(this,"enabled",!0),I(this,"components"),I(this,"onDisposed",new M),I(this,"mouse"),I(this,"three",new pi),I(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 ga(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(i=>s.every(n=>n.distanceToPoint(i.point)>0))}}const Vn=class Hn extends J{constructor(t){super(t),I(this,"enabled",!0),I(this,"list",new Map),I(this,"onDisposed",new M),t.add(Hn.uuid,this)}get(t){if(this.list.has(t.uuid))return this.list.get(t.uuid);const e=new Oa(this.components,t);return this.list.set(t.uuid,e),t.onDisposed.add(()=>{this.delete(t)}),e}delete(t){const e=this.list.get(t.uuid);e&&e.dispose(),this.list.delete(t.uuid)}dispose(){for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger()}};I(Vn,"uuid","d5d8bdf0-db25-4952-b951-b643af207ace");let cn=Vn;class _a extends yi{constructor(){super(...arguments),I(this,"meshes",new Set),I(this,"onAfterUpdate",new M),I(this,"onBeforeUpdate",new M),I(this,"onDisposed",new M),I(this,"isDisposing",!1),I(this,"enabled",!0),I(this,"uuid",Pi.create()),I(this,"name"),I(this,"_scene"),I(this,"_camera"),I(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 e=this.components.get(me);this.scene.dispose(),this.camera.isDisposeable()&&this.camera.dispose(),this.renderer&&this.renderer.dispose();for(const s of this.meshes)e.destroy(s);this.meshes.clear()}this._scene=null,this._camera=null,this._renderer=null,this.onDisposed.trigger()}}class ah extends da{constructor(t){super(t),I(this,"isSetup",!1),I(this,"three"),I(this,"onSetup",new M),I(this,"config",{directionalLight:{color:new Qt("white"),intensity:1.5,position:new O(5,10,3)},ambientLight:{color:new Qt("white"),intensity:1}}),this.three=new Ci,this.three.background=new Qt(2107698)}setup(t){this.config={...this.config,...t};const e=new No(this.config.directionalLight.color,this.config.directionalLight.intensity);e.position.copy(this.config.directionalLight.position);const s=new wo(this.config.ambientLight.color,this.config.ambientLight.intensity);this.three.add(e,s),this.isSetup=!0,this.onSetup.trigger(this)}}class hh extends la{constructor(t,e,s){super(t),I(this,"enabled",!0),I(this,"container"),I(this,"three"),I(this,"_canvas"),I(this,"_parameters"),I(this,"_resizeObserver",null),I(this,"onContainerUpdated",new M),I(this,"_resizing",!1),I(this,"resize",o=>{if(this._resizing)return;this._resizing=!0,this.onContainerUpdated.trigger();const r=o?o.x:this.container.clientWidth,a=o?o.y:this.container.clientHeight;this.three.setSize(r,a),this.onResize.trigger(new At(r,a)),this._resizing=!1}),I(this,"resizeEvent",()=>{this.resize()}),I(this,"onContextLost",o=>{o.preventDefault(),this.enabled=!1}),I(this,"onContextBack",()=>{this.three.setRenderTarget(null),this.three.dispose(),this.three=new Fs({canvas:this._canvas,antialias:!0,alpha:!0,...this._parameters}),this.enabled=!0}),this.container=e,this._parameters=s,this.three=new Fs({antialias:!0,alpha:!0,...s}),this.three.setPixelRatio(Math.min(window.devicePixelRatio,2)),this.setupRenderer(),this.setupEvents(!0),this.resize(),this._canvas=this.three.domElement;const i=this.three.getContext(),{canvas:n}=i;n.addEventListener("webglcontextlost",this.onContextLost,!1),n.addEventListener("webglcontextrestored",this.onContextBack,!1)}update(){if(!this.enabled||!this.currentWorld)return;this.onBeforeUpdate.trigger(this);const t=this.currentWorld.scene.three,e=this.currentWorld.camera.three;this.three.render(t,e),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 At(this.three.domElement.clientWidth,this.three.domElement.clientHeight)}setupEvents(t){const e=this.three.domElement.parentElement;if(!e)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(e),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.`)}};I(li,"_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}$/),I(li,"_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 Pi=li;const zn=class Gn{constructor(){I(this,"onDisposed",new M),I(this,"list",new Map),I(this,"enabled",!1),I(this,"_clock"),I(this,"update",()=>{if(!this.enabled)return;const t=this._clock.getDelta();for(const[e,s]of this.list)s.enabled&&s.isUpdateable()&&s.update(t);requestAnimationFrame(this.update)}),this._clock=new Do,Gn.setupBVH()}add(t,e){if(this.list.has(t))throw new Error("You're trying to add a component that already exists in the components instance. Use Components.get() instead.");Pi.validate(t),this.list.set(t,e)}get(t){const e=t.uuid;if(!this.list.has(e)){const s=new t(this);return this.list.has(e)||this.add(e,s),s}return this.list.get(e)}init(){this.enabled=!0,this._clock.start(),this.update()}dispose(){this.enabled=!1;for(const[t,e]of this.list)e.enabled=!1,e.isDisposeable()&&e.dispose();this._clock.stop(),this.onDisposed.trigger(),this.onDisposed.reset()}static setupBVH(){ze.prototype.computeBoundsTree=aa,ze.prototype.disposeBoundsTree=ha,D.prototype.raycast=ra}};I(zn,"release","2.1.11");let Aa=zn;class ga{constructor(t){I(this,"_event"),I(this,"_position",new At),I(this,"onDisposed",new M),I(this,"updateMouseInfo",e=>{this._event=e}),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("pointermove",this.updateMouseInfo):this.dom.removeEventListener("pointermove",this.updateMouseInfo)}}class Oa{constructor(t,e){I(this,"enabled",!0),I(this,"components"),I(this,"onDisposed",new M),I(this,"mouse"),I(this,"three",new pi),I(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 ga(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(i=>s.every(n=>n.distanceToPoint(i.point)>0))}}const Vn=class Hn extends J{constructor(t){super(t),I(this,"enabled",!0),I(this,"list",new Map),I(this,"onDisposed",new M),t.add(Hn.uuid,this)}get(t){if(this.list.has(t.uuid))return this.list.get(t.uuid);const e=new Oa(this.components,t);return this.list.set(t.uuid,e),t.onDisposed.add(()=>{this.delete(t)}),e}delete(t){const e=this.list.get(t.uuid);e&&e.dispose(),this.list.delete(t.uuid)}dispose(){for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger()}};I(Vn,"uuid","d5d8bdf0-db25-4952-b951-b643af207ace");let cn=Vn;class _a extends yi{constructor(){super(...arguments),I(this,"meshes",new Set),I(this,"onAfterUpdate",new M),I(this,"onBeforeUpdate",new M),I(this,"onDisposed",new M),I(this,"isDisposing",!1),I(this,"enabled",!0),I(this,"uuid",Pi.create()),I(this,"name"),I(this,"_scene"),I(this,"_camera"),I(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 e=this.components.get(me);this.scene.dispose(),this.camera.isDisposeable()&&this.camera.dispose(),this.renderer&&this.renderer.dispose();for(const s of this.meshes)e.destroy(s);this.meshes.clear()}this._scene=null,this._camera=null,this._renderer=null,this.onDisposed.trigger()}}class ah extends da{constructor(t){super(t),I(this,"isSetup",!1),I(this,"three"),I(this,"onSetup",new M),I(this,"config",{directionalLight:{color:new Qt("white"),intensity:1.5,position:new O(5,10,3)},ambientLight:{color:new Qt("white"),intensity:1}}),this.three=new Ci,this.three.background=new Qt(2107698)}setup(t){this.config={...this.config,...t};const e=new No(this.config.directionalLight.color,this.config.directionalLight.intensity);e.position.copy(this.config.directionalLight.position);const s=new wo(this.config.ambientLight.color,this.config.ambientLight.intensity);this.three.add(e,s),this.isSetup=!0,this.onSetup.trigger(this)}}class hh extends la{constructor(t,e,s){super(t),I(this,"enabled",!0),I(this,"container"),I(this,"three"),I(this,"_canvas"),I(this,"_parameters"),I(this,"_resizeObserver",null),I(this,"onContainerUpdated",new M),I(this,"_resizing",!1),I(this,"resize",o=>{if(this._resizing)return;this._resizing=!0,this.onContainerUpdated.trigger();const r=o?o.x:this.container.clientWidth,a=o?o.y:this.container.clientHeight;this.three.setSize(r,a),this.onResize.trigger(new At(r,a)),this._resizing=!1}),I(this,"resizeEvent",()=>{this.resize()}),I(this,"onContextLost",o=>{o.preventDefault(),this.enabled=!1}),I(this,"onContextBack",()=>{this.three.setRenderTarget(null),this.three.dispose(),this.three=new Fs({canvas:this._canvas,antialias:!0,alpha:!0,...this._parameters}),this.enabled=!0}),this.container=e,this._parameters=s,this.three=new Fs({antialias:!0,alpha:!0,...s}),this.three.setPixelRatio(Math.min(window.devicePixelRatio,2)),this.setupRenderer(),this.setupEvents(!0),this.resize(),this._canvas=this.three.domElement;const i=this.three.getContext(),{canvas:n}=i;n.addEventListener("webglcontextlost",this.onContextLost,!1),n.addEventListener("webglcontextrestored",this.onContextBack,!1)}update(){if(!this.enabled||!this.currentWorld)return;this.onBeforeUpdate.trigger(this);const t=this.currentWorld.scene.three,e=this.currentWorld.camera.three;this.three.render(t,e),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 At(this.three.domElement.clientWidth,this.three.domElement.clientHeight)}setupEvents(t){const e=this.three.domElement.parentElement;if(!e)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(e),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 v={LEFT:1,RIGHT:2,MIDDLE:4},N=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}),ce={NONE:0,IN:1,OUT:-1};function Ht(c){return c.isPerspectiveCamera}function bt(c){return c.isOrthographicCamera}const le=Math.PI*2,ln=Math.PI/2,Wn=1e-5,Le=Math.PI/180;function mt(c,t,e){return Math.max(t,Math.min(e,c))}function k(c,t=Wn){return Math.abs(c)0==u>d&&(u=d,e.value=(u-d)/n),u}function En(c,t,e,s,i=1/0,n,o){s=Math.max(1e-4,s);const r=2/s,a=r*n,h=1/(1+a+.48*a*a+.235*a*a*a);let d=t.x,E=t.y,l=t.z,u=c.x-d,C=c.y-E,T=c.z-l;const m=d,f=E,R=l,A=i*s,p=A*A,F=u*u+C*C+T*T;if(F>p){const Y=Math.sqrt(F);u=u/Y*A,C=C/Y*A,T=T/Y*A}d=c.x-u,E=c.y-C,l=c.z-T;const g=(e.x+r*u)*n,_=(e.y+r*C)*n,S=(e.z+r*T)*n;e.x=(e.x-r*g)*h,e.y=(e.y-r*_)*h,e.z=(e.z-r*S)*h,o.x=d+(u+g)*h,o.y=E+(C+_)*h,o.z=l+(T+S)*h;const w=m-c.x,y=f-c.y,L=R-c.z,P=o.x-m,U=o.y-f,x=o.z-R;return w*P+y*U+L*x>0&&(o.x=m,o.y=f,o.z=R,e.x=(o.x-m)/n,e.y=(o.y-f)/n,e.z=(o.z-R)/n),o}function Xs(c,t){t.set(0,0),c.forEach(e=>{t.x+=e.clientX,t.y+=e.clientY}),t.x/=c.length,t.y/=c.length}function ks(c,t){return bt(c)?(console.warn(`${t} is not supported in OrthographicCamera`),!0):!1}class Sa{constructor(){this._listeners={}}addEventListener(t,e){const s=this._listeners;s[t]===void 0&&(s[t]=[]),s[t].indexOf(e)===-1&&s[t].push(e)}hasEventListener(t,e){const s=this._listeners;return s[t]!==void 0&&s[t].indexOf(e)!==-1}removeEventListener(t,e){const s=this._listeners[t];if(s!==void 0){const i=s.indexOf(e);i!==-1&&s.splice(i,1)}}removeAllEventListeners(t){if(!t){this._listeners={};return}Array.isArray(this._listeners[t])&&(this._listeners[t].length=0)}dispatchEvent(t){const e=this._listeners[t.type];if(e!==void 0){t.target=this;const s=e.slice(0);for(let i=0,n=s.length;i{},this._enabled=!0,this._state=N.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=ce.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new b.Vector3,this._focalOffsetVelocity=new b.Vector3,this._zoomVelocity={value:0},this._truckInternal=(p,F,g)=>{let _,S;if(Ht(this._camera)){const w=B.copy(this._camera.position).sub(this._target),y=this._camera.getEffectiveFOV()*Le,L=w.length()*Math.tan(y*.5);_=this.truckSpeed*p*L/this._elementRect.height,S=this.truckSpeed*F*L/this._elementRect.height}else if(bt(this._camera)){const w=this._camera;_=p*(w.right-w.left)/w.zoom/this._elementRect.width,S=F*(w.top-w.bottom)/w.zoom/this._elementRect.height}else return;this.verticalDragToForward?(g?this.setFocalOffset(this._focalOffsetEnd.x+_,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(_,0,!0),this.forward(-S,!0)):g?this.setFocalOffset(this._focalOffsetEnd.x+_,this._focalOffsetEnd.y+S,this._focalOffsetEnd.z,!0):this.truck(_,S,!0)},this._rotateInternal=(p,F)=>{const g=le*this.azimuthRotateSpeed*p/this._elementRect.height,_=le*this.polarRotateSpeed*F/this._elementRect.height;this.rotate(g,_,!0)},this._dollyInternal=(p,F,g)=>{const _=Math.pow(.95,-p*this.dollySpeed),S=this._sphericalEnd.radius,w=this._sphericalEnd.radius*_,y=mt(w,this.minDistance,this.maxDistance),L=y-w;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(w,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(L,!0),this._dollyToNoClamp(y,!0)):this._dollyToNoClamp(y,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?w:y)-S,this._dollyControlCoord.set(F,g)),this._lastDollyDirection=Math.sign(-p)},this._zoomInternal=(p,F,g)=>{const _=Math.pow(.95,p*this.dollySpeed),S=this._zoom,w=this._zoom*_;this.zoomTo(w,!0),this.dollyToCursor&&(this._changedZoom+=w-S,this._dollyControlCoord.set(F,g))},typeof b>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=t,this._yAxisUpSpace=new b.Quaternion().setFromUnitVectors(this._camera.up,Es),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=N.NONE,this._target=new b.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new b.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new b.Spherical().setFromVector3(B.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 b.Vector3,new b.Vector3,new b.Vector3,new b.Vector3],this._updateNearPlaneCorners(),this._boundary=new b.Box3(new b.Vector3(-1/0,-1/0,-1/0),new b.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 b.Vector2,this.mouseButtons={left:N.ROTATE,middle:N.DOLLY,right:N.TRUCK,wheel:Ht(this._camera)?N.DOLLY:bt(this._camera)?N.ZOOM:N.NONE},this.touches={one:N.TOUCH_ROTATE,two:Ht(this._camera)?N.TOUCH_DOLLY_TRUCK:bt(this._camera)?N.TOUCH_ZOOM_TRUCK:N.NONE,three:N.TOUCH_TRUCK};const s=new b.Vector2,i=new b.Vector2,n=new b.Vector2,o=p=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const _=this._domElement.getBoundingClientRect(),S=p.clientX/_.width,w=p.clientY/_.height;if(Sthis._interactiveArea.right||wthis._interactiveArea.bottom)return}const F=p.pointerType!=="mouse"?null:(p.buttons&v.LEFT)===v.LEFT?v.LEFT:(p.buttons&v.MIDDLE)===v.MIDDLE?v.MIDDLE:(p.buttons&v.RIGHT)===v.RIGHT?v.RIGHT:null;if(F!==null){const _=this._findPointerByMouseButton(F);_&&this._disposePointer(_)}if((p.buttons&v.LEFT)===v.LEFT&&this._lockedPointer)return;const g={pointerId:p.pointerId,clientX:p.clientX,clientY:p.clientY,deltaX:0,deltaY:0,mouseButton:F};this._activePointers.push(g),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",d),this._isDragging=!0,T(p)},r=p=>{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 _=this._domElement.getBoundingClientRect(),S=p.clientX/_.width,w=p.clientY/_.height;if(Sthis._interactiveArea.right||wthis._interactiveArea.bottom)return}const F=(p.buttons&v.LEFT)===v.LEFT?v.LEFT:(p.buttons&v.MIDDLE)===v.MIDDLE?v.MIDDLE:(p.buttons&v.RIGHT)===v.RIGHT?v.RIGHT:null;if(F!==null){const _=this._findPointerByMouseButton(F);_&&this._disposePointer(_)}const g={pointerId:1,clientX:p.clientX,clientY:p.clientY,deltaX:0,deltaY:0,mouseButton:(p.buttons&v.LEFT)===v.LEFT?v.LEFT:(p.buttons&v.MIDDLE)===v.LEFT?v.MIDDLE:(p.buttons&v.RIGHT)===v.LEFT?v.RIGHT:null};this._activePointers.push(g),this._domElement.ownerDocument.removeEventListener("mousemove",h),this._domElement.ownerDocument.removeEventListener("mouseup",E),this._domElement.ownerDocument.addEventListener("mousemove",h),this._domElement.ownerDocument.addEventListener("mouseup",E),this._isDragging=!0,T(p)},a=p=>{p.cancelable&&p.preventDefault();const F=p.pointerId,g=this._lockedPointer||this._findPointerById(F);if(g){if(g.clientX=p.clientX,g.clientY=p.clientY,g.deltaX=p.movementX,g.deltaY=p.movementY,this._state=0,p.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&&(p.buttons&v.LEFT)===v.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(p.buttons&v.MIDDLE)===v.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(p.buttons&v.RIGHT)===v.RIGHT&&(this._state=this._state|this.mouseButtons.right);m()}},h=p=>{const F=this._lockedPointer||this._findPointerById(1);F&&(F.clientX=p.clientX,F.clientY=p.clientY,F.deltaX=p.movementX,F.deltaY=p.movementY,this._state=0,(this._lockedPointer||(p.buttons&v.LEFT)===v.LEFT)&&(this._state=this._state|this.mouseButtons.left),(p.buttons&v.MIDDLE)===v.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(p.buttons&v.RIGHT)===v.RIGHT&&(this._state=this._state|this.mouseButtons.right),m())},d=p=>{const F=this._findPointerById(p.pointerId);if(!(F&&F===this._lockedPointer)){if(F&&this._disposePointer(F),p.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=N.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=N.NONE;f()}},E=()=>{const p=this._findPointerById(1);p&&p===this._lockedPointer||(p&&this._disposePointer(p),this._state=N.NONE,f())};let l=-1;const u=p=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===N.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const w=this._domElement.getBoundingClientRect(),y=p.clientX/w.width,L=p.clientY/w.height;if(ythis._interactiveArea.right||Lthis._interactiveArea.bottom)return}if(p.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===N.ROTATE||this.mouseButtons.wheel===N.TRUCK){const w=performance.now();l-w<1e3&&this._getClientRect(this._elementRect),l=w}const F=wa?-1:-3,g=p.deltaMode===1?p.deltaY/F:p.deltaY/(F*10),_=this.dollyToCursor?(p.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,S=this.dollyToCursor?(p.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case N.ROTATE:{this._rotateInternal(p.deltaX,p.deltaY),this._isUserControllingRotate=!0;break}case N.TRUCK:{this._truckInternal(p.deltaX,p.deltaY,!1),this._isUserControllingTruck=!0;break}case N.OFFSET:{this._truckInternal(p.deltaX,p.deltaY,!0),this._isUserControllingOffset=!0;break}case N.DOLLY:{this._dollyInternal(-g,_,S),this._isUserControllingDolly=!0;break}case N.ZOOM:{this._zoomInternal(-g,_,S),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},C=p=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===ot.ACTION.NONE){const F=p instanceof PointerEvent?p.pointerId:0,g=this._findPointerById(F);g&&this._disposePointer(g),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mousemove",h),this._domElement.ownerDocument.removeEventListener("mouseup",E);return}p.preventDefault()}},T=p=>{if(this._enabled){if(Xs(this._activePointers,ht),this._getClientRect(this._elementRect),s.copy(ht),i.copy(ht),this._activePointers.length>=2){const F=ht.x-this._activePointers[1].clientX,g=ht.y-this._activePointers[1].clientY,_=Math.sqrt(F*F+g*g);n.set(0,_);const S=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,w=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;i.set(S,w)}if(this._state=0,!p)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in p&&p.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&&(p.buttons&v.LEFT)===v.LEFT&&(this._state=this._state|this.mouseButtons.left),(p.buttons&v.MIDDLE)===v.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(p.buttons&v.RIGHT)===v.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&N.ROTATE)===N.ROTATE||(this._state&N.TOUCH_ROTATE)===N.TOUCH_ROTATE||(this._state&N.TOUCH_DOLLY_ROTATE)===N.TOUCH_DOLLY_ROTATE||(this._state&N.TOUCH_ZOOM_ROTATE)===N.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&N.TRUCK)===N.TRUCK||(this._state&N.TOUCH_TRUCK)===N.TOUCH_TRUCK||(this._state&N.TOUCH_DOLLY_TRUCK)===N.TOUCH_DOLLY_TRUCK||(this._state&N.TOUCH_ZOOM_TRUCK)===N.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&N.DOLLY)===N.DOLLY||(this._state&N.TOUCH_DOLLY)===N.TOUCH_DOLLY||(this._state&N.TOUCH_DOLLY_TRUCK)===N.TOUCH_DOLLY_TRUCK||(this._state&N.TOUCH_DOLLY_OFFSET)===N.TOUCH_DOLLY_OFFSET||(this._state&N.TOUCH_DOLLY_ROTATE)===N.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&N.ZOOM)===N.ZOOM||(this._state&N.TOUCH_ZOOM)===N.TOUCH_ZOOM||(this._state&N.TOUCH_ZOOM_TRUCK)===N.TOUCH_ZOOM_TRUCK||(this._state&N.TOUCH_ZOOM_OFFSET)===N.TOUCH_ZOOM_OFFSET||(this._state&N.TOUCH_ZOOM_ROTATE)===N.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&N.OFFSET)===N.OFFSET||(this._state&N.TOUCH_OFFSET)===N.TOUCH_OFFSET||(this._state&N.TOUCH_DOLLY_OFFSET)===N.TOUCH_DOLLY_OFFSET||(this._state&N.TOUCH_ZOOM_OFFSET)===N.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})}},m=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,Xs(this._activePointers,ht);const p=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,F=p?-p.deltaX:i.x-ht.x,g=p?-p.deltaY:i.y-ht.y;if(i.copy(ht),((this._state&N.ROTATE)===N.ROTATE||(this._state&N.TOUCH_ROTATE)===N.TOUCH_ROTATE||(this._state&N.TOUCH_DOLLY_ROTATE)===N.TOUCH_DOLLY_ROTATE||(this._state&N.TOUCH_ZOOM_ROTATE)===N.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(F,g),this._isUserControllingRotate=!0),(this._state&N.DOLLY)===N.DOLLY||(this._state&N.ZOOM)===N.ZOOM){const _=this.dollyToCursor?(s.x-this._elementRect.x)/this._elementRect.width*2-1:0,S=this.dollyToCursor?(s.y-this._elementRect.y)/this._elementRect.height*-2+1:0,w=this.dollyDragInverted?-1:1;(this._state&N.DOLLY)===N.DOLLY?(this._dollyInternal(w*g*ds,_,S),this._isUserControllingDolly=!0):(this._zoomInternal(w*g*ds,_,S),this._isUserControllingZoom=!0)}if((this._state&N.TOUCH_DOLLY)===N.TOUCH_DOLLY||(this._state&N.TOUCH_ZOOM)===N.TOUCH_ZOOM||(this._state&N.TOUCH_DOLLY_TRUCK)===N.TOUCH_DOLLY_TRUCK||(this._state&N.TOUCH_ZOOM_TRUCK)===N.TOUCH_ZOOM_TRUCK||(this._state&N.TOUCH_DOLLY_OFFSET)===N.TOUCH_DOLLY_OFFSET||(this._state&N.TOUCH_ZOOM_OFFSET)===N.TOUCH_ZOOM_OFFSET||(this._state&N.TOUCH_DOLLY_ROTATE)===N.TOUCH_DOLLY_ROTATE||(this._state&N.TOUCH_ZOOM_ROTATE)===N.TOUCH_ZOOM_ROTATE){const _=ht.x-this._activePointers[1].clientX,S=ht.y-this._activePointers[1].clientY,w=Math.sqrt(_*_+S*S),y=n.y-w;n.set(0,w);const L=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,P=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&N.TOUCH_DOLLY)===N.TOUCH_DOLLY||(this._state&N.TOUCH_DOLLY_ROTATE)===N.TOUCH_DOLLY_ROTATE||(this._state&N.TOUCH_DOLLY_TRUCK)===N.TOUCH_DOLLY_TRUCK||(this._state&N.TOUCH_DOLLY_OFFSET)===N.TOUCH_DOLLY_OFFSET?(this._dollyInternal(y*ds,L,P),this._isUserControllingDolly=!0):(this._zoomInternal(y*ds,L,P),this._isUserControllingZoom=!0)}((this._state&N.TRUCK)===N.TRUCK||(this._state&N.TOUCH_TRUCK)===N.TOUCH_TRUCK||(this._state&N.TOUCH_DOLLY_TRUCK)===N.TOUCH_DOLLY_TRUCK||(this._state&N.TOUCH_ZOOM_TRUCK)===N.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(F,g,!1),this._isUserControllingTruck=!0),((this._state&N.OFFSET)===N.OFFSET||(this._state&N.TOUCH_OFFSET)===N.TOUCH_OFFSET||(this._state&N.TOUCH_DOLLY_OFFSET)===N.TOUCH_DOLLY_OFFSET||(this._state&N.TOUCH_ZOOM_OFFSET)===N.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(F,g,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},f=()=>{Xs(this._activePointers,ht),i.copy(ht),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",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",h),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mouseup",E),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",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",R),this._domElement.ownerDocument.addEventListener("pointerlockerror",A),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",d),T())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",R),this._domElement.ownerDocument.removeEventListener("pointerlockerror",A))};const R=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},A=()=>{this.unlockPointer()};this._addAllEventListeners=p=>{this._domElement=p,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",o),ya&&this._domElement.addEventListener("mousedown",r),this._domElement.addEventListener("pointercancel",d),this._domElement.addEventListener("wheel",u,{passive:!1}),this._domElement.addEventListener("contextmenu",C)},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",r),this._domElement.removeEventListener("pointercancel",d),this._domElement.removeEventListener("wheel",u,{passive:!1}),this._domElement.removeEventListener("contextmenu",C),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",h),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mouseup",E),this._domElement.ownerDocument.removeEventListener("pointerlockchange",R),this._domElement.ownerDocument.removeEventListener("pointerlockerror",A))},this.cancel=()=>{this._state!==N.NONE&&(this._state=N.NONE,this._activePointers.length=0,f())},e&&this.connect(e),this.update(0)}get camera(){return this._camera}set camera(t){this._camera=t,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._domElement&&(t?(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(t){this._spherical.radius===t&&this._sphericalEnd.radius===t||(this._spherical.radius=t,this._sphericalEnd.radius=t,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(t){this._spherical.theta===t&&this._sphericalEnd.theta===t||(this._spherical.theta=t,this._sphericalEnd.theta=t,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(t){this._spherical.phi===t&&this._sphericalEnd.phi===t||(this._spherical.phi=t,this._sphericalEnd.phi=t,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(t){this._boundaryEnclosesCamera=t,this._needsUpdate=!0}set interactiveArea(t){this._interactiveArea.width=mt(t.width,0,1),this._interactiveArea.height=mt(t.height,0,1),this._interactiveArea.x=mt(t.x,0,1-this._interactiveArea.width),this._interactiveArea.y=mt(t.y,0,1-this._interactiveArea.height)}addEventListener(t,e){super.addEventListener(t,e)}removeEventListener(t,e){super.removeEventListener(t,e)}rotate(t,e,s=!1){return this.rotateTo(this._sphericalEnd.theta+t,this._sphericalEnd.phi+e,s)}rotateAzimuthTo(t,e=!1){return this.rotateTo(t,this._sphericalEnd.phi,e)}rotatePolarTo(t,e=!1){return this.rotateTo(this._sphericalEnd.theta,t,e)}rotateTo(t,e,s=!1){this._isUserControllingRotate=!1;const i=mt(t,this.minAzimuthAngle,this.maxAzimuthAngle),n=mt(e,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=i,this._sphericalEnd.phi=n,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,s||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const o=!s||V(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&V(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(o)}dolly(t,e=!1){return this.dollyTo(this._sphericalEnd.radius-t,e)}dollyTo(t,e=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=ce.NONE,this._changedDolly=0,this._dollyToNoClamp(mt(t,this.minDistance,this.maxDistance),e)}_dollyToNoClamp(t,e=!1){const s=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const n=this._collisionTest(),o=V(n,this._spherical.radius);if(!(s>t)&&o)return Promise.resolve();this._sphericalEnd.radius=Math.min(t,n)}else this._sphericalEnd.radius=t;this._needsUpdate=!0,e||(this._spherical.radius=this._sphericalEnd.radius);const i=!e||V(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(i)}dollyInFixed(t,e=!1){this._targetEnd.add(this._getCameraDirection(Ue).multiplyScalar(t)),e||this._target.copy(this._targetEnd);const s=!e||V(this._target.x,this._targetEnd.x,this.restThreshold)&&V(this._target.y,this._targetEnd.y,this.restThreshold)&&V(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}zoom(t,e=!1){return this.zoomTo(this._zoomEnd+t,e)}zoomTo(t,e=!1){this._isUserControllingZoom=!1,this._zoomEnd=mt(t,this.minZoom,this.maxZoom),this._needsUpdate=!0,e||(this._zoom=this._zoomEnd);const s=!e||V(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(s)}pan(t,e,s=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(t,e,s)}truck(t,e,s=!1){this._camera.updateMatrix(),Ot.setFromMatrixColumn(this._camera.matrix,0),_t.setFromMatrixColumn(this._camera.matrix,1),Ot.multiplyScalar(t),_t.multiplyScalar(-e);const i=B.copy(Ot).add(_t),n=G.copy(this._targetEnd).add(i);return this.moveTo(n.x,n.y,n.z,s)}forward(t,e=!1){B.setFromMatrixColumn(this._camera.matrix,0),B.crossVectors(this._camera.up,B),B.multiplyScalar(t);const s=G.copy(this._targetEnd).add(B);return this.moveTo(s.x,s.y,s.z,e)}elevate(t,e=!1){return B.copy(this._camera.up).multiplyScalar(t),this.moveTo(this._targetEnd.x+B.x,this._targetEnd.y+B.y,this._targetEnd.z+B.z,e)}moveTo(t,e,s,i=!1){this._isUserControllingTruck=!1;const n=B.set(t,e,s).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,n,this.boundaryFriction),this._needsUpdate=!0,i||this._target.copy(this._targetEnd);const o=!i||V(this._target.x,this._targetEnd.x,this.restThreshold)&&V(this._target.y,this._targetEnd.y,this.restThreshold)&&V(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(o)}lookInDirectionOf(t,e,s,i=!1){const n=B.set(t,e,s).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(n.x,n.y,n.z,i)}fitToBox(t,e,{cover:s=!1,paddingLeft:i=0,paddingRight:n=0,paddingBottom:o=0,paddingTop:r=0}={}){const a=[],h=t.isBox3?Ee.copy(t):Ee.setFromObject(t);h.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const d=dn(this._sphericalEnd.theta,ln),E=dn(this._sphericalEnd.phi,ln);a.push(this.rotateTo(d,E,e));const l=B.setFromSpherical(this._sphericalEnd).normalize(),u=Tn.setFromUnitVectors(l,Zs),C=V(Math.abs(l.y),1);C&&u.multiply(js.setFromAxisAngle(Es,d)),u.multiply(this._yAxisUpSpaceInverse);const T=Cn.makeEmpty();G.copy(h.min).applyQuaternion(u),T.expandByPoint(G),G.copy(h.min).setX(h.max.x).applyQuaternion(u),T.expandByPoint(G),G.copy(h.min).setY(h.max.y).applyQuaternion(u),T.expandByPoint(G),G.copy(h.max).setZ(h.min.z).applyQuaternion(u),T.expandByPoint(G),G.copy(h.min).setZ(h.max.z).applyQuaternion(u),T.expandByPoint(G),G.copy(h.max).setY(h.min.y).applyQuaternion(u),T.expandByPoint(G),G.copy(h.max).setX(h.min.x).applyQuaternion(u),T.expandByPoint(G),G.copy(h.max).applyQuaternion(u),T.expandByPoint(G),T.min.x-=i,T.min.y-=o,T.max.x+=n,T.max.y+=r,u.setFromUnitVectors(Zs,l),C&&u.premultiply(js.invert()),u.premultiply(this._yAxisUpSpace);const m=T.getSize(B),f=T.getCenter(G).applyQuaternion(u);if(Ht(this._camera)){const R=this.getDistanceToFitBox(m.x,m.y,m.z,s);a.push(this.moveTo(f.x,f.y,f.z,e)),a.push(this.dollyTo(R,e)),a.push(this.setFocalOffset(0,0,0,e))}else if(bt(this._camera)){const R=this._camera,A=R.right-R.left,p=R.top-R.bottom,F=s?Math.max(A/m.x,p/m.y):Math.min(A/m.x,p/m.y);a.push(this.moveTo(f.x,f.y,f.z,e)),a.push(this.zoomTo(F,e)),a.push(this.setFocalOffset(0,0,0,e))}return Promise.all(a)}fitToSphere(t,e){const s=[],i=t instanceof b.Sphere?Qs.copy(t):ot.createBoundingSphere(t,Qs);if(s.push(this.moveTo(i.center.x,i.center.y,i.center.z,e)),Ht(this._camera)){const n=this.getDistanceToFitSphere(i.radius);s.push(this.dollyTo(n,e))}else if(bt(this._camera)){const n=this._camera.right-this._camera.left,o=this._camera.top-this._camera.bottom,r=2*i.radius,a=Math.min(n/r,o/r);s.push(this.zoomTo(a,e))}return s.push(this.setFocalOffset(0,0,0,e)),Promise.all(s)}setLookAt(t,e,s,i,n,o,r=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=ce.NONE,this._changedDolly=0;const a=G.set(i,n,o),h=B.set(t,e,s);this._targetEnd.copy(a),this._sphericalEnd.setFromVector3(h.sub(a).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,r||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const d=!r||V(this._target.x,this._targetEnd.x,this.restThreshold)&&V(this._target.y,this._targetEnd.y,this.restThreshold)&&V(this._target.z,this._targetEnd.z,this.restThreshold)&&V(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&V(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&V(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(d)}lerpLookAt(t,e,s,i,n,o,r,a,h,d,E,l,u,C=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=ce.NONE,this._changedDolly=0;const T=B.set(i,n,o),m=G.set(t,e,s);dt.setFromVector3(m.sub(T).applyQuaternion(this._yAxisUpSpace));const f=de.set(d,E,l),R=G.set(r,a,h);De.setFromVector3(R.sub(f).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(T.lerp(f,u));const A=De.theta-dt.theta,p=De.phi-dt.phi,F=De.radius-dt.radius;this._sphericalEnd.set(dt.radius+F*u,dt.phi+p*u,dt.theta+A*u),this.normalizeRotations(),this._needsUpdate=!0,C||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const g=!C||V(this._target.x,this._targetEnd.x,this.restThreshold)&&V(this._target.y,this._targetEnd.y,this.restThreshold)&&V(this._target.z,this._targetEnd.z,this.restThreshold)&&V(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&V(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&V(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(g)}setPosition(t,e,s,i=!1){return this.setLookAt(t,e,s,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,i)}setTarget(t,e,s,i=!1){const n=this.getPosition(B),o=this.setLookAt(n.x,n.y,n.z,t,e,s,i);return this._sphericalEnd.phi=mt(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),o}setFocalOffset(t,e,s,i=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(t,e,s),this._needsUpdate=!0,i||this._focalOffset.copy(this._focalOffsetEnd);const n=!i||V(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&V(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&V(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}setOrbitPoint(t,e,s){this._camera.updateMatrixWorld(),Ot.setFromMatrixColumn(this._camera.matrixWorldInverse,0),_t.setFromMatrixColumn(this._camera.matrixWorldInverse,1),Wt.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const i=B.set(t,e,s),n=i.distanceTo(this._camera.position),o=i.sub(this._camera.position);Ot.multiplyScalar(o.x),_t.multiplyScalar(o.y),Wt.multiplyScalar(o.z),B.copy(Ot).add(_t).add(Wt),B.z=B.z+n,this.dollyTo(n,!1),this.setFocalOffset(-B.x,B.y,-B.z,!1),this.moveTo(t,e,s,!1)}setBoundary(t){if(!t){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(t),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(t,e,s,i){if(t===null){this._viewport=null;return}this._viewport=this._viewport||new b.Vector4,typeof t=="number"?this._viewport.set(t,e,s,i):this._viewport.copy(t)}getDistanceToFitBox(t,e,s,i=!1){if(ks(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const n=t/e,o=this._camera.getEffectiveFOV()*Le,r=this._camera.aspect;return((i?n>r:ne.pointerId===t)}_findPointerByMouseButton(t){return this._activePointers.find(e=>e.mouseButton===t)}_disposePointer(t){this._activePointers.splice(this._activePointers.indexOf(t),1)}_encloseToBoundary(t,e,s){const i=e.lengthSq();if(i===0)return t;const n=G.copy(e).add(t),o=this._boundary.clampPoint(n,de).sub(n),r=o.lengthSq();if(r===0)return t.add(e);if(r===i)return t;if(s===0)return t.add(e).add(o);{const a=1+s*r/e.dot(o);return t.add(G.copy(e).multiplyScalar(a)).add(o.multiplyScalar(1-s))}}_updateNearPlaneCorners(){if(Ht(this._camera)){const t=this._camera,e=t.near,s=t.getEffectiveFOV()*Le,i=Math.tan(s*.5)*e,n=i*t.aspect;this._nearPlaneCorners[0].set(-n,-i,0),this._nearPlaneCorners[1].set(n,-i,0),this._nearPlaneCorners[2].set(n,i,0),this._nearPlaneCorners[3].set(-n,i,0)}else if(bt(this._camera)){const t=this._camera,e=1/t.zoom,s=t.left*e,i=t.right*e,n=t.top*e,o=t.bottom*e;this._nearPlaneCorners[0].set(s,n,0),this._nearPlaneCorners[1].set(i,n,0),this._nearPlaneCorners[2].set(i,o,0),this._nearPlaneCorners[3].set(s,o,0)}}_collisionTest(){let t=1/0;if(!(this.colliderMeshes.length>=1)||ks(this._camera,"_collisionTest"))return t;const e=this._getTargetDirection(Ue);qs.lookAt(un,e,this._camera.up);for(let s=0;s<4;s++){const i=G.copy(this._nearPlaneCorners[s]);i.applyMatrix4(qs);const n=de.addVectors(this._target,i);us.set(n,e),us.far=this._spherical.radius+1;const o=us.intersectObjects(this.colliderMeshes);o.length!==0&&o[0].distance{const s=()=>{this.removeEventListener("rest",s),e()};this.addEventListener("rest",s)}))}_addAllEventListeners(t){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(t){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(t){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(t,e=new b.Sphere){const s=e,i=s.center;Ee.makeEmpty(),t.traverseVisible(o=>{o.isMesh&&Ee.expandByObject(o)}),Ee.getCenter(i);let n=0;return t.traverseVisible(o=>{if(!o.isMesh)return;const r=o,a=r.geometry.clone();a.applyMatrix4(r.matrixWorld);const h=a.attributes.position;for(let d=0,E=h.count;d{var e;if(!(!this.currentWorld||!this.currentWorld.renderer)){if(this.three instanceof Ti){this.onAspectUpdated.trigger();return}if((e=this.currentWorld.renderer)!=null&&e.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:e,world:s})=>{if(e==="added"){const i=this.newCameraControls();this._allControls.set(s.uuid,i)}if(e==="removed"){const i=this._allControls.get(s.uuid);i&&(i.dispose(),this._allControls.delete(s.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.currentWorld!==null&&(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,e]of this._allControls)e.dispose()}update(t){this.enabled&&(this.onBeforeUpdate.trigger(this),this.controls.update(t),this.onAfterUpdate.trigger(this))}setupCamera(){const t=window.innerWidth/window.innerHeight,e=new yo(60,t,1,1e3);return e.position.set(50,50,50),e.lookAt(new O(0,0,0)),e}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!");ot.install({THREE:Ve.getSubsetOfThree()});const{domElement:t}=this.currentWorld.renderer.three,e=new ot(this.three,t);return e.smoothTime=.2,e.dollyToCursor=!0,e.infinityDolly=!0,e}setupEvents(t){t?window.addEventListener("resize",this.updateAspect):window.removeEventListener("resize",this.updateAspect)}static getSubsetOfThree(){return{MOUSE:Lo,Vector2:At,Vector3:O,Vector4:Po,Quaternion:Rt,Matrix4:H,Spherical:Mo,Box3:st,Sphere:Os,Raycaster:pi,MathUtils:_n}}}const kn=class Zn extends J{constructor(t){super(t),I(this,"onAfterUpdate",new M),I(this,"onBeforeUpdate",new M),I(this,"onDisposed",new M),I(this,"onWorldCreated",new M),I(this,"onWorldDeleted",new M),I(this,"list",new Map),I(this,"enabled",!0),t.add(Zn.uuid,this)}create(){const t=new _a(this.components),e=t.uuid;if(this.list.has(e))throw new Error("There is already a world with this name!");return this.list.set(e,t),this.onWorldCreated.trigger(t),t}delete(t){if(!this.list.has(t.uuid))throw new Error("The provided world is not found in the list!");const e=t.uuid;this.list.delete(t.uuid),t.dispose(),this.onWorldDeleted.trigger(e)}dispose(){this.enabled=!1;for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger()}update(t){if(this.enabled)for(const[e,s]of this.list)s.update(t)}};I(kn,"uuid","fdb61dc4-2ec1-4966-b83d-54ea795fad4a");let La=kn;class Pa{constructor(t,e,s){I(this,"onDisposed",new M),I(this,"world"),I(this,"components"),I(this,"three"),I(this,"_fade",3),I(this,"updateZoom",()=>{this.world.camera instanceof Ve&&(this.material.uniforms.uZoom.value=this.world.camera.three.zoom)}),this.world=e;const{color:i,size1:n,size2:o,distance:r}=s;this.components=t;const a=new _i(2,2,1,1),h=new Yo({side:He,uniforms:{uSize1:{value:n},uSize2:{value:o},uColor:{value:i},uDistance:{value:r},uFade:{value:this._fade},uZoom:{value:1}},transparent:!0,vertexShader:` + */const b={LEFT:1,RIGHT:2,MIDDLE:4},N=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}),ce={NONE:0,IN:1,OUT:-1};function Ht(c){return c.isPerspectiveCamera}function vt(c){return c.isOrthographicCamera}const le=Math.PI*2,ln=Math.PI/2,Wn=1e-5,Le=Math.PI/180;function mt(c,t,e){return Math.max(t,Math.min(e,c))}function k(c,t=Wn){return Math.abs(c)0==u>d&&(u=d,e.value=(u-d)/n),u}function En(c,t,e,s,i=1/0,n,o){s=Math.max(1e-4,s);const r=2/s,a=r*n,h=1/(1+a+.48*a*a+.235*a*a*a);let d=t.x,E=t.y,l=t.z,u=c.x-d,C=c.y-E,T=c.z-l;const m=d,f=E,R=l,A=i*s,p=A*A,F=u*u+C*C+T*T;if(F>p){const Y=Math.sqrt(F);u=u/Y*A,C=C/Y*A,T=T/Y*A}d=c.x-u,E=c.y-C,l=c.z-T;const g=(e.x+r*u)*n,_=(e.y+r*C)*n,S=(e.z+r*T)*n;e.x=(e.x-r*g)*h,e.y=(e.y-r*_)*h,e.z=(e.z-r*S)*h,o.x=d+(u+g)*h,o.y=E+(C+_)*h,o.z=l+(T+S)*h;const w=m-c.x,y=f-c.y,L=R-c.z,P=o.x-m,U=o.y-f,x=o.z-R;return w*P+y*U+L*x>0&&(o.x=m,o.y=f,o.z=R,e.x=(o.x-m)/n,e.y=(o.y-f)/n,e.z=(o.z-R)/n),o}function Xs(c,t){t.set(0,0),c.forEach(e=>{t.x+=e.clientX,t.y+=e.clientY}),t.x/=c.length,t.y/=c.length}function ks(c,t){return vt(c)?(console.warn(`${t} is not supported in OrthographicCamera`),!0):!1}class Sa{constructor(){this._listeners={}}addEventListener(t,e){const s=this._listeners;s[t]===void 0&&(s[t]=[]),s[t].indexOf(e)===-1&&s[t].push(e)}hasEventListener(t,e){const s=this._listeners;return s[t]!==void 0&&s[t].indexOf(e)!==-1}removeEventListener(t,e){const s=this._listeners[t];if(s!==void 0){const i=s.indexOf(e);i!==-1&&s.splice(i,1)}}removeAllEventListeners(t){if(!t){this._listeners={};return}Array.isArray(this._listeners[t])&&(this._listeners[t].length=0)}dispatchEvent(t){const e=this._listeners[t.type];if(e!==void 0){t.target=this;const s=e.slice(0);for(let i=0,n=s.length;i{},this._enabled=!0,this._state=N.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=ce.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new v.Vector3,this._focalOffsetVelocity=new v.Vector3,this._zoomVelocity={value:0},this._truckInternal=(p,F,g)=>{let _,S;if(Ht(this._camera)){const w=B.copy(this._camera.position).sub(this._target),y=this._camera.getEffectiveFOV()*Le,L=w.length()*Math.tan(y*.5);_=this.truckSpeed*p*L/this._elementRect.height,S=this.truckSpeed*F*L/this._elementRect.height}else if(vt(this._camera)){const w=this._camera;_=p*(w.right-w.left)/w.zoom/this._elementRect.width,S=F*(w.top-w.bottom)/w.zoom/this._elementRect.height}else return;this.verticalDragToForward?(g?this.setFocalOffset(this._focalOffsetEnd.x+_,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(_,0,!0),this.forward(-S,!0)):g?this.setFocalOffset(this._focalOffsetEnd.x+_,this._focalOffsetEnd.y+S,this._focalOffsetEnd.z,!0):this.truck(_,S,!0)},this._rotateInternal=(p,F)=>{const g=le*this.azimuthRotateSpeed*p/this._elementRect.height,_=le*this.polarRotateSpeed*F/this._elementRect.height;this.rotate(g,_,!0)},this._dollyInternal=(p,F,g)=>{const _=Math.pow(.95,-p*this.dollySpeed),S=this._sphericalEnd.radius,w=this._sphericalEnd.radius*_,y=mt(w,this.minDistance,this.maxDistance),L=y-w;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(w,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(L,!0),this._dollyToNoClamp(y,!0)):this._dollyToNoClamp(y,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?w:y)-S,this._dollyControlCoord.set(F,g)),this._lastDollyDirection=Math.sign(-p)},this._zoomInternal=(p,F,g)=>{const _=Math.pow(.95,p*this.dollySpeed),S=this._zoom,w=this._zoom*_;this.zoomTo(w,!0),this.dollyToCursor&&(this._changedZoom+=w-S,this._dollyControlCoord.set(F,g))},typeof v>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=t,this._yAxisUpSpace=new v.Quaternion().setFromUnitVectors(this._camera.up,Es),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=N.NONE,this._target=new v.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new v.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new v.Spherical().setFromVector3(B.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 v.Vector3,new v.Vector3,new v.Vector3,new v.Vector3],this._updateNearPlaneCorners(),this._boundary=new v.Box3(new v.Vector3(-1/0,-1/0,-1/0),new v.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 v.Vector2,this.mouseButtons={left:N.ROTATE,middle:N.DOLLY,right:N.TRUCK,wheel:Ht(this._camera)?N.DOLLY:vt(this._camera)?N.ZOOM:N.NONE},this.touches={one:N.TOUCH_ROTATE,two:Ht(this._camera)?N.TOUCH_DOLLY_TRUCK:vt(this._camera)?N.TOUCH_ZOOM_TRUCK:N.NONE,three:N.TOUCH_TRUCK};const s=new v.Vector2,i=new v.Vector2,n=new v.Vector2,o=p=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const _=this._domElement.getBoundingClientRect(),S=p.clientX/_.width,w=p.clientY/_.height;if(Sthis._interactiveArea.right||wthis._interactiveArea.bottom)return}const F=p.pointerType!=="mouse"?null:(p.buttons&b.LEFT)===b.LEFT?b.LEFT:(p.buttons&b.MIDDLE)===b.MIDDLE?b.MIDDLE:(p.buttons&b.RIGHT)===b.RIGHT?b.RIGHT:null;if(F!==null){const _=this._findPointerByMouseButton(F);_&&this._disposePointer(_)}if((p.buttons&b.LEFT)===b.LEFT&&this._lockedPointer)return;const g={pointerId:p.pointerId,clientX:p.clientX,clientY:p.clientY,deltaX:0,deltaY:0,mouseButton:F};this._activePointers.push(g),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",d),this._isDragging=!0,T(p)},r=p=>{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 _=this._domElement.getBoundingClientRect(),S=p.clientX/_.width,w=p.clientY/_.height;if(Sthis._interactiveArea.right||wthis._interactiveArea.bottom)return}const F=(p.buttons&b.LEFT)===b.LEFT?b.LEFT:(p.buttons&b.MIDDLE)===b.MIDDLE?b.MIDDLE:(p.buttons&b.RIGHT)===b.RIGHT?b.RIGHT:null;if(F!==null){const _=this._findPointerByMouseButton(F);_&&this._disposePointer(_)}const g={pointerId:1,clientX:p.clientX,clientY:p.clientY,deltaX:0,deltaY:0,mouseButton:(p.buttons&b.LEFT)===b.LEFT?b.LEFT:(p.buttons&b.MIDDLE)===b.LEFT?b.MIDDLE:(p.buttons&b.RIGHT)===b.LEFT?b.RIGHT:null};this._activePointers.push(g),this._domElement.ownerDocument.removeEventListener("mousemove",h),this._domElement.ownerDocument.removeEventListener("mouseup",E),this._domElement.ownerDocument.addEventListener("mousemove",h),this._domElement.ownerDocument.addEventListener("mouseup",E),this._isDragging=!0,T(p)},a=p=>{p.cancelable&&p.preventDefault();const F=p.pointerId,g=this._lockedPointer||this._findPointerById(F);if(g){if(g.clientX=p.clientX,g.clientY=p.clientY,g.deltaX=p.movementX,g.deltaY=p.movementY,this._state=0,p.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&&(p.buttons&b.LEFT)===b.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(p.buttons&b.MIDDLE)===b.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(p.buttons&b.RIGHT)===b.RIGHT&&(this._state=this._state|this.mouseButtons.right);m()}},h=p=>{const F=this._lockedPointer||this._findPointerById(1);F&&(F.clientX=p.clientX,F.clientY=p.clientY,F.deltaX=p.movementX,F.deltaY=p.movementY,this._state=0,(this._lockedPointer||(p.buttons&b.LEFT)===b.LEFT)&&(this._state=this._state|this.mouseButtons.left),(p.buttons&b.MIDDLE)===b.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(p.buttons&b.RIGHT)===b.RIGHT&&(this._state=this._state|this.mouseButtons.right),m())},d=p=>{const F=this._findPointerById(p.pointerId);if(!(F&&F===this._lockedPointer)){if(F&&this._disposePointer(F),p.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=N.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=N.NONE;f()}},E=()=>{const p=this._findPointerById(1);p&&p===this._lockedPointer||(p&&this._disposePointer(p),this._state=N.NONE,f())};let l=-1;const u=p=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===N.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const w=this._domElement.getBoundingClientRect(),y=p.clientX/w.width,L=p.clientY/w.height;if(ythis._interactiveArea.right||Lthis._interactiveArea.bottom)return}if(p.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===N.ROTATE||this.mouseButtons.wheel===N.TRUCK){const w=performance.now();l-w<1e3&&this._getClientRect(this._elementRect),l=w}const F=wa?-1:-3,g=p.deltaMode===1?p.deltaY/F:p.deltaY/(F*10),_=this.dollyToCursor?(p.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,S=this.dollyToCursor?(p.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case N.ROTATE:{this._rotateInternal(p.deltaX,p.deltaY),this._isUserControllingRotate=!0;break}case N.TRUCK:{this._truckInternal(p.deltaX,p.deltaY,!1),this._isUserControllingTruck=!0;break}case N.OFFSET:{this._truckInternal(p.deltaX,p.deltaY,!0),this._isUserControllingOffset=!0;break}case N.DOLLY:{this._dollyInternal(-g,_,S),this._isUserControllingDolly=!0;break}case N.ZOOM:{this._zoomInternal(-g,_,S),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},C=p=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===ot.ACTION.NONE){const F=p instanceof PointerEvent?p.pointerId:0,g=this._findPointerById(F);g&&this._disposePointer(g),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mousemove",h),this._domElement.ownerDocument.removeEventListener("mouseup",E);return}p.preventDefault()}},T=p=>{if(this._enabled){if(Xs(this._activePointers,ht),this._getClientRect(this._elementRect),s.copy(ht),i.copy(ht),this._activePointers.length>=2){const F=ht.x-this._activePointers[1].clientX,g=ht.y-this._activePointers[1].clientY,_=Math.sqrt(F*F+g*g);n.set(0,_);const S=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,w=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;i.set(S,w)}if(this._state=0,!p)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in p&&p.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&&(p.buttons&b.LEFT)===b.LEFT&&(this._state=this._state|this.mouseButtons.left),(p.buttons&b.MIDDLE)===b.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(p.buttons&b.RIGHT)===b.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&N.ROTATE)===N.ROTATE||(this._state&N.TOUCH_ROTATE)===N.TOUCH_ROTATE||(this._state&N.TOUCH_DOLLY_ROTATE)===N.TOUCH_DOLLY_ROTATE||(this._state&N.TOUCH_ZOOM_ROTATE)===N.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&N.TRUCK)===N.TRUCK||(this._state&N.TOUCH_TRUCK)===N.TOUCH_TRUCK||(this._state&N.TOUCH_DOLLY_TRUCK)===N.TOUCH_DOLLY_TRUCK||(this._state&N.TOUCH_ZOOM_TRUCK)===N.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&N.DOLLY)===N.DOLLY||(this._state&N.TOUCH_DOLLY)===N.TOUCH_DOLLY||(this._state&N.TOUCH_DOLLY_TRUCK)===N.TOUCH_DOLLY_TRUCK||(this._state&N.TOUCH_DOLLY_OFFSET)===N.TOUCH_DOLLY_OFFSET||(this._state&N.TOUCH_DOLLY_ROTATE)===N.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&N.ZOOM)===N.ZOOM||(this._state&N.TOUCH_ZOOM)===N.TOUCH_ZOOM||(this._state&N.TOUCH_ZOOM_TRUCK)===N.TOUCH_ZOOM_TRUCK||(this._state&N.TOUCH_ZOOM_OFFSET)===N.TOUCH_ZOOM_OFFSET||(this._state&N.TOUCH_ZOOM_ROTATE)===N.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&N.OFFSET)===N.OFFSET||(this._state&N.TOUCH_OFFSET)===N.TOUCH_OFFSET||(this._state&N.TOUCH_DOLLY_OFFSET)===N.TOUCH_DOLLY_OFFSET||(this._state&N.TOUCH_ZOOM_OFFSET)===N.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})}},m=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,Xs(this._activePointers,ht);const p=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,F=p?-p.deltaX:i.x-ht.x,g=p?-p.deltaY:i.y-ht.y;if(i.copy(ht),((this._state&N.ROTATE)===N.ROTATE||(this._state&N.TOUCH_ROTATE)===N.TOUCH_ROTATE||(this._state&N.TOUCH_DOLLY_ROTATE)===N.TOUCH_DOLLY_ROTATE||(this._state&N.TOUCH_ZOOM_ROTATE)===N.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(F,g),this._isUserControllingRotate=!0),(this._state&N.DOLLY)===N.DOLLY||(this._state&N.ZOOM)===N.ZOOM){const _=this.dollyToCursor?(s.x-this._elementRect.x)/this._elementRect.width*2-1:0,S=this.dollyToCursor?(s.y-this._elementRect.y)/this._elementRect.height*-2+1:0,w=this.dollyDragInverted?-1:1;(this._state&N.DOLLY)===N.DOLLY?(this._dollyInternal(w*g*ds,_,S),this._isUserControllingDolly=!0):(this._zoomInternal(w*g*ds,_,S),this._isUserControllingZoom=!0)}if((this._state&N.TOUCH_DOLLY)===N.TOUCH_DOLLY||(this._state&N.TOUCH_ZOOM)===N.TOUCH_ZOOM||(this._state&N.TOUCH_DOLLY_TRUCK)===N.TOUCH_DOLLY_TRUCK||(this._state&N.TOUCH_ZOOM_TRUCK)===N.TOUCH_ZOOM_TRUCK||(this._state&N.TOUCH_DOLLY_OFFSET)===N.TOUCH_DOLLY_OFFSET||(this._state&N.TOUCH_ZOOM_OFFSET)===N.TOUCH_ZOOM_OFFSET||(this._state&N.TOUCH_DOLLY_ROTATE)===N.TOUCH_DOLLY_ROTATE||(this._state&N.TOUCH_ZOOM_ROTATE)===N.TOUCH_ZOOM_ROTATE){const _=ht.x-this._activePointers[1].clientX,S=ht.y-this._activePointers[1].clientY,w=Math.sqrt(_*_+S*S),y=n.y-w;n.set(0,w);const L=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,P=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&N.TOUCH_DOLLY)===N.TOUCH_DOLLY||(this._state&N.TOUCH_DOLLY_ROTATE)===N.TOUCH_DOLLY_ROTATE||(this._state&N.TOUCH_DOLLY_TRUCK)===N.TOUCH_DOLLY_TRUCK||(this._state&N.TOUCH_DOLLY_OFFSET)===N.TOUCH_DOLLY_OFFSET?(this._dollyInternal(y*ds,L,P),this._isUserControllingDolly=!0):(this._zoomInternal(y*ds,L,P),this._isUserControllingZoom=!0)}((this._state&N.TRUCK)===N.TRUCK||(this._state&N.TOUCH_TRUCK)===N.TOUCH_TRUCK||(this._state&N.TOUCH_DOLLY_TRUCK)===N.TOUCH_DOLLY_TRUCK||(this._state&N.TOUCH_ZOOM_TRUCK)===N.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(F,g,!1),this._isUserControllingTruck=!0),((this._state&N.OFFSET)===N.OFFSET||(this._state&N.TOUCH_OFFSET)===N.TOUCH_OFFSET||(this._state&N.TOUCH_DOLLY_OFFSET)===N.TOUCH_DOLLY_OFFSET||(this._state&N.TOUCH_ZOOM_OFFSET)===N.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(F,g,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},f=()=>{Xs(this._activePointers,ht),i.copy(ht),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",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",h),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mouseup",E),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",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",R),this._domElement.ownerDocument.addEventListener("pointerlockerror",A),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",d),T())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",R),this._domElement.ownerDocument.removeEventListener("pointerlockerror",A))};const R=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},A=()=>{this.unlockPointer()};this._addAllEventListeners=p=>{this._domElement=p,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",o),ya&&this._domElement.addEventListener("mousedown",r),this._domElement.addEventListener("pointercancel",d),this._domElement.addEventListener("wheel",u,{passive:!1}),this._domElement.addEventListener("contextmenu",C)},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",r),this._domElement.removeEventListener("pointercancel",d),this._domElement.removeEventListener("wheel",u,{passive:!1}),this._domElement.removeEventListener("contextmenu",C),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",h),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mouseup",E),this._domElement.ownerDocument.removeEventListener("pointerlockchange",R),this._domElement.ownerDocument.removeEventListener("pointerlockerror",A))},this.cancel=()=>{this._state!==N.NONE&&(this._state=N.NONE,this._activePointers.length=0,f())},e&&this.connect(e),this.update(0)}get camera(){return this._camera}set camera(t){this._camera=t,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._domElement&&(t?(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(t){this._spherical.radius===t&&this._sphericalEnd.radius===t||(this._spherical.radius=t,this._sphericalEnd.radius=t,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(t){this._spherical.theta===t&&this._sphericalEnd.theta===t||(this._spherical.theta=t,this._sphericalEnd.theta=t,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(t){this._spherical.phi===t&&this._sphericalEnd.phi===t||(this._spherical.phi=t,this._sphericalEnd.phi=t,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(t){this._boundaryEnclosesCamera=t,this._needsUpdate=!0}set interactiveArea(t){this._interactiveArea.width=mt(t.width,0,1),this._interactiveArea.height=mt(t.height,0,1),this._interactiveArea.x=mt(t.x,0,1-this._interactiveArea.width),this._interactiveArea.y=mt(t.y,0,1-this._interactiveArea.height)}addEventListener(t,e){super.addEventListener(t,e)}removeEventListener(t,e){super.removeEventListener(t,e)}rotate(t,e,s=!1){return this.rotateTo(this._sphericalEnd.theta+t,this._sphericalEnd.phi+e,s)}rotateAzimuthTo(t,e=!1){return this.rotateTo(t,this._sphericalEnd.phi,e)}rotatePolarTo(t,e=!1){return this.rotateTo(this._sphericalEnd.theta,t,e)}rotateTo(t,e,s=!1){this._isUserControllingRotate=!1;const i=mt(t,this.minAzimuthAngle,this.maxAzimuthAngle),n=mt(e,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=i,this._sphericalEnd.phi=n,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,s||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const o=!s||V(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&V(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(o)}dolly(t,e=!1){return this.dollyTo(this._sphericalEnd.radius-t,e)}dollyTo(t,e=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=ce.NONE,this._changedDolly=0,this._dollyToNoClamp(mt(t,this.minDistance,this.maxDistance),e)}_dollyToNoClamp(t,e=!1){const s=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const n=this._collisionTest(),o=V(n,this._spherical.radius);if(!(s>t)&&o)return Promise.resolve();this._sphericalEnd.radius=Math.min(t,n)}else this._sphericalEnd.radius=t;this._needsUpdate=!0,e||(this._spherical.radius=this._sphericalEnd.radius);const i=!e||V(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(i)}dollyInFixed(t,e=!1){this._targetEnd.add(this._getCameraDirection(Ue).multiplyScalar(t)),e||this._target.copy(this._targetEnd);const s=!e||V(this._target.x,this._targetEnd.x,this.restThreshold)&&V(this._target.y,this._targetEnd.y,this.restThreshold)&&V(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}zoom(t,e=!1){return this.zoomTo(this._zoomEnd+t,e)}zoomTo(t,e=!1){this._isUserControllingZoom=!1,this._zoomEnd=mt(t,this.minZoom,this.maxZoom),this._needsUpdate=!0,e||(this._zoom=this._zoomEnd);const s=!e||V(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(s)}pan(t,e,s=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(t,e,s)}truck(t,e,s=!1){this._camera.updateMatrix(),Ot.setFromMatrixColumn(this._camera.matrix,0),_t.setFromMatrixColumn(this._camera.matrix,1),Ot.multiplyScalar(t),_t.multiplyScalar(-e);const i=B.copy(Ot).add(_t),n=G.copy(this._targetEnd).add(i);return this.moveTo(n.x,n.y,n.z,s)}forward(t,e=!1){B.setFromMatrixColumn(this._camera.matrix,0),B.crossVectors(this._camera.up,B),B.multiplyScalar(t);const s=G.copy(this._targetEnd).add(B);return this.moveTo(s.x,s.y,s.z,e)}elevate(t,e=!1){return B.copy(this._camera.up).multiplyScalar(t),this.moveTo(this._targetEnd.x+B.x,this._targetEnd.y+B.y,this._targetEnd.z+B.z,e)}moveTo(t,e,s,i=!1){this._isUserControllingTruck=!1;const n=B.set(t,e,s).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,n,this.boundaryFriction),this._needsUpdate=!0,i||this._target.copy(this._targetEnd);const o=!i||V(this._target.x,this._targetEnd.x,this.restThreshold)&&V(this._target.y,this._targetEnd.y,this.restThreshold)&&V(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(o)}lookInDirectionOf(t,e,s,i=!1){const n=B.set(t,e,s).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(n.x,n.y,n.z,i)}fitToBox(t,e,{cover:s=!1,paddingLeft:i=0,paddingRight:n=0,paddingBottom:o=0,paddingTop:r=0}={}){const a=[],h=t.isBox3?Ee.copy(t):Ee.setFromObject(t);h.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const d=dn(this._sphericalEnd.theta,ln),E=dn(this._sphericalEnd.phi,ln);a.push(this.rotateTo(d,E,e));const l=B.setFromSpherical(this._sphericalEnd).normalize(),u=Tn.setFromUnitVectors(l,Zs),C=V(Math.abs(l.y),1);C&&u.multiply(js.setFromAxisAngle(Es,d)),u.multiply(this._yAxisUpSpaceInverse);const T=Cn.makeEmpty();G.copy(h.min).applyQuaternion(u),T.expandByPoint(G),G.copy(h.min).setX(h.max.x).applyQuaternion(u),T.expandByPoint(G),G.copy(h.min).setY(h.max.y).applyQuaternion(u),T.expandByPoint(G),G.copy(h.max).setZ(h.min.z).applyQuaternion(u),T.expandByPoint(G),G.copy(h.min).setZ(h.max.z).applyQuaternion(u),T.expandByPoint(G),G.copy(h.max).setY(h.min.y).applyQuaternion(u),T.expandByPoint(G),G.copy(h.max).setX(h.min.x).applyQuaternion(u),T.expandByPoint(G),G.copy(h.max).applyQuaternion(u),T.expandByPoint(G),T.min.x-=i,T.min.y-=o,T.max.x+=n,T.max.y+=r,u.setFromUnitVectors(Zs,l),C&&u.premultiply(js.invert()),u.premultiply(this._yAxisUpSpace);const m=T.getSize(B),f=T.getCenter(G).applyQuaternion(u);if(Ht(this._camera)){const R=this.getDistanceToFitBox(m.x,m.y,m.z,s);a.push(this.moveTo(f.x,f.y,f.z,e)),a.push(this.dollyTo(R,e)),a.push(this.setFocalOffset(0,0,0,e))}else if(vt(this._camera)){const R=this._camera,A=R.right-R.left,p=R.top-R.bottom,F=s?Math.max(A/m.x,p/m.y):Math.min(A/m.x,p/m.y);a.push(this.moveTo(f.x,f.y,f.z,e)),a.push(this.zoomTo(F,e)),a.push(this.setFocalOffset(0,0,0,e))}return Promise.all(a)}fitToSphere(t,e){const s=[],i=t instanceof v.Sphere?Qs.copy(t):ot.createBoundingSphere(t,Qs);if(s.push(this.moveTo(i.center.x,i.center.y,i.center.z,e)),Ht(this._camera)){const n=this.getDistanceToFitSphere(i.radius);s.push(this.dollyTo(n,e))}else if(vt(this._camera)){const n=this._camera.right-this._camera.left,o=this._camera.top-this._camera.bottom,r=2*i.radius,a=Math.min(n/r,o/r);s.push(this.zoomTo(a,e))}return s.push(this.setFocalOffset(0,0,0,e)),Promise.all(s)}setLookAt(t,e,s,i,n,o,r=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=ce.NONE,this._changedDolly=0;const a=G.set(i,n,o),h=B.set(t,e,s);this._targetEnd.copy(a),this._sphericalEnd.setFromVector3(h.sub(a).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,r||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const d=!r||V(this._target.x,this._targetEnd.x,this.restThreshold)&&V(this._target.y,this._targetEnd.y,this.restThreshold)&&V(this._target.z,this._targetEnd.z,this.restThreshold)&&V(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&V(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&V(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(d)}lerpLookAt(t,e,s,i,n,o,r,a,h,d,E,l,u,C=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=ce.NONE,this._changedDolly=0;const T=B.set(i,n,o),m=G.set(t,e,s);dt.setFromVector3(m.sub(T).applyQuaternion(this._yAxisUpSpace));const f=de.set(d,E,l),R=G.set(r,a,h);De.setFromVector3(R.sub(f).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(T.lerp(f,u));const A=De.theta-dt.theta,p=De.phi-dt.phi,F=De.radius-dt.radius;this._sphericalEnd.set(dt.radius+F*u,dt.phi+p*u,dt.theta+A*u),this.normalizeRotations(),this._needsUpdate=!0,C||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const g=!C||V(this._target.x,this._targetEnd.x,this.restThreshold)&&V(this._target.y,this._targetEnd.y,this.restThreshold)&&V(this._target.z,this._targetEnd.z,this.restThreshold)&&V(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&V(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&V(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(g)}setPosition(t,e,s,i=!1){return this.setLookAt(t,e,s,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,i)}setTarget(t,e,s,i=!1){const n=this.getPosition(B),o=this.setLookAt(n.x,n.y,n.z,t,e,s,i);return this._sphericalEnd.phi=mt(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),o}setFocalOffset(t,e,s,i=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(t,e,s),this._needsUpdate=!0,i||this._focalOffset.copy(this._focalOffsetEnd);const n=!i||V(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&V(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&V(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}setOrbitPoint(t,e,s){this._camera.updateMatrixWorld(),Ot.setFromMatrixColumn(this._camera.matrixWorldInverse,0),_t.setFromMatrixColumn(this._camera.matrixWorldInverse,1),Wt.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const i=B.set(t,e,s),n=i.distanceTo(this._camera.position),o=i.sub(this._camera.position);Ot.multiplyScalar(o.x),_t.multiplyScalar(o.y),Wt.multiplyScalar(o.z),B.copy(Ot).add(_t).add(Wt),B.z=B.z+n,this.dollyTo(n,!1),this.setFocalOffset(-B.x,B.y,-B.z,!1),this.moveTo(t,e,s,!1)}setBoundary(t){if(!t){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(t),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(t,e,s,i){if(t===null){this._viewport=null;return}this._viewport=this._viewport||new v.Vector4,typeof t=="number"?this._viewport.set(t,e,s,i):this._viewport.copy(t)}getDistanceToFitBox(t,e,s,i=!1){if(ks(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const n=t/e,o=this._camera.getEffectiveFOV()*Le,r=this._camera.aspect;return((i?n>r:ne.pointerId===t)}_findPointerByMouseButton(t){return this._activePointers.find(e=>e.mouseButton===t)}_disposePointer(t){this._activePointers.splice(this._activePointers.indexOf(t),1)}_encloseToBoundary(t,e,s){const i=e.lengthSq();if(i===0)return t;const n=G.copy(e).add(t),o=this._boundary.clampPoint(n,de).sub(n),r=o.lengthSq();if(r===0)return t.add(e);if(r===i)return t;if(s===0)return t.add(e).add(o);{const a=1+s*r/e.dot(o);return t.add(G.copy(e).multiplyScalar(a)).add(o.multiplyScalar(1-s))}}_updateNearPlaneCorners(){if(Ht(this._camera)){const t=this._camera,e=t.near,s=t.getEffectiveFOV()*Le,i=Math.tan(s*.5)*e,n=i*t.aspect;this._nearPlaneCorners[0].set(-n,-i,0),this._nearPlaneCorners[1].set(n,-i,0),this._nearPlaneCorners[2].set(n,i,0),this._nearPlaneCorners[3].set(-n,i,0)}else if(vt(this._camera)){const t=this._camera,e=1/t.zoom,s=t.left*e,i=t.right*e,n=t.top*e,o=t.bottom*e;this._nearPlaneCorners[0].set(s,n,0),this._nearPlaneCorners[1].set(i,n,0),this._nearPlaneCorners[2].set(i,o,0),this._nearPlaneCorners[3].set(s,o,0)}}_collisionTest(){let t=1/0;if(!(this.colliderMeshes.length>=1)||ks(this._camera,"_collisionTest"))return t;const e=this._getTargetDirection(Ue);qs.lookAt(un,e,this._camera.up);for(let s=0;s<4;s++){const i=G.copy(this._nearPlaneCorners[s]);i.applyMatrix4(qs);const n=de.addVectors(this._target,i);us.set(n,e),us.far=this._spherical.radius+1;const o=us.intersectObjects(this.colliderMeshes);o.length!==0&&o[0].distance{const s=()=>{this.removeEventListener("rest",s),e()};this.addEventListener("rest",s)}))}_addAllEventListeners(t){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(t){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(t){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(t,e=new v.Sphere){const s=e,i=s.center;Ee.makeEmpty(),t.traverseVisible(o=>{o.isMesh&&Ee.expandByObject(o)}),Ee.getCenter(i);let n=0;return t.traverseVisible(o=>{if(!o.isMesh)return;const r=o,a=r.geometry.clone();a.applyMatrix4(r.matrixWorld);const h=a.attributes.position;for(let d=0,E=h.count;d{var e;if(!(!this.currentWorld||!this.currentWorld.renderer)){if(this.three instanceof Ti){this.onAspectUpdated.trigger();return}if((e=this.currentWorld.renderer)!=null&&e.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:e,world:s})=>{if(e==="added"){const i=this.newCameraControls();this._allControls.set(s.uuid,i)}if(e==="removed"){const i=this._allControls.get(s.uuid);i&&(i.dispose(),this._allControls.delete(s.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.currentWorld!==null&&(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,e]of this._allControls)e.dispose()}update(t){this.enabled&&(this.onBeforeUpdate.trigger(this),this.controls.update(t),this.onAfterUpdate.trigger(this))}setupCamera(){const t=window.innerWidth/window.innerHeight,e=new yo(60,t,1,1e3);return e.position.set(50,50,50),e.lookAt(new O(0,0,0)),e}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!");ot.install({THREE:Ve.getSubsetOfThree()});const{domElement:t}=this.currentWorld.renderer.three,e=new ot(this.three,t);return e.smoothTime=.2,e.dollyToCursor=!0,e.infinityDolly=!0,e}setupEvents(t){t?window.addEventListener("resize",this.updateAspect):window.removeEventListener("resize",this.updateAspect)}static getSubsetOfThree(){return{MOUSE:Lo,Vector2:At,Vector3:O,Vector4:Po,Quaternion:Rt,Matrix4:H,Spherical:Mo,Box3:st,Sphere:Os,Raycaster:pi,MathUtils:_n}}}const kn=class Zn extends J{constructor(t){super(t),I(this,"onAfterUpdate",new M),I(this,"onBeforeUpdate",new M),I(this,"onDisposed",new M),I(this,"onWorldCreated",new M),I(this,"onWorldDeleted",new M),I(this,"list",new Map),I(this,"enabled",!0),t.add(Zn.uuid,this)}create(){const t=new _a(this.components),e=t.uuid;if(this.list.has(e))throw new Error("There is already a world with this name!");return this.list.set(e,t),this.onWorldCreated.trigger(t),t}delete(t){if(!this.list.has(t.uuid))throw new Error("The provided world is not found in the list!");const e=t.uuid;this.list.delete(t.uuid),t.dispose(),this.onWorldDeleted.trigger(e)}dispose(){this.enabled=!1;for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger()}update(t){if(this.enabled)for(const[e,s]of this.list)s.update(t)}};I(kn,"uuid","fdb61dc4-2ec1-4966-b83d-54ea795fad4a");let La=kn;class Pa{constructor(t,e,s){I(this,"onDisposed",new M),I(this,"world"),I(this,"components"),I(this,"three"),I(this,"_fade",3),I(this,"updateZoom",()=>{this.world.camera instanceof Ve&&(this.material.uniforms.uZoom.value=this.world.camera.three.zoom)}),this.world=e;const{color:i,size1:n,size2:o,distance:r}=s;this.components=t;const a=new _i(2,2,1,1),h=new Yo({side:He,uniforms:{uSize1:{value:n},uSize2:{value:o},uColor:{value:i},uDistance:{value:r},uFade:{value:this._fade},uZoom:{value:1}},transparent:!0,vertexShader:` varying vec3 worldPosition; @@ -68,7 +68,7 @@ import{r as Ft,s as st,T as Ie,t as pi,E as So,c as H,V as O,h as At,x as fe,S a } - `,extensions:{derivatives:!0}});this.three=new D(a,h),this.three.frustumCulled=!1,e.scene.three.add(this.three),this.setupEvents(!0)}get visible(){return this.three.visible}set visible(t){t?this.world.scene.three.add(this.three):this.three.removeFromParent()}get material(){return this.three.material}get fade(){return this._fade===3}set fade(t){this._fade=t?3:0,this.material.uniforms.uFade.value=this._fade}dispose(){this.setupEvents(!1),this.components.get(me).destroy(this.three),this.onDisposed.trigger(),this.onDisposed.reset(),this.world=null,this.components=null}setupEvents(t){if(this.world.isDisposing||!(this.world.camera instanceof Ve))return;const e=this.world.camera.controls;t?e.addEventListener("update",this.updateZoom):e.removeEventListener("update",this.updateZoom)}}const Qn=class jn extends J{constructor(t){super(t),I(this,"list",new Map),I(this,"config",{color:new Qt(12303291),size1:1,size2:10,distance:500}),I(this,"onDisposed",new M),I(this,"enabled",!0),t.add(jn.uuid,this)}create(t){if(this.list.has(t.uuid))throw new Error("This world already has a grid!");const e=new Pa(this.components,t,this.config);return this.list.set(t.uuid,e),t.onDisposed.add(()=>{this.delete(t)}),e}delete(t){const e=this.list.get(t.uuid);e&&e.dispose(),this.list.delete(t.uuid)}dispose(){for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger(),this.onDisposed.reset()}};I(Qn,"uuid","d1e814d5-b81c-4452-87a2-f039375e0489");let ch=Qn;const Xt=new pi,nt=new O,xt=new O,Q=new Rt,mn={X:new O(1,0,0),Y:new O(0,1,0),Z:new O(0,0,1)},Ks={type:"change"},fn={type:"mouseDown"},Rn={type:"mouseUp",mode:null},Fn={type:"objectChange"};class Ma extends As{constructor(t,e){super(),e===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),e=document),this.isTransformControls=!0,this.visible=!1,this.domElement=e,this.domElement.style.touchAction="none";const s=new Ba;this._gizmo=s,this.add(s);const i=new Ya;this._plane=i,this.add(i);const n=this;function o(R,A){let p=A;Object.defineProperty(n,R,{get:function(){return p!==void 0?p:A},set:function(F){p!==F&&(p=F,i[R]=F,s[R]=F,n.dispatchEvent({type:R+"-changed",value:F}),n.dispatchEvent(Ks))}}),n[R]=A,i[R]=A,s[R]=A}o("camera",t),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 r=new O,a=new O,h=new Rt,d=new Rt,E=new O,l=new Rt,u=new O,C=new O,T=new O,m=0,f=new O;o("worldPosition",r),o("worldPositionStart",a),o("worldQuaternion",h),o("worldQuaternionStart",d),o("cameraPosition",E),o("cameraQuaternion",l),o("pointStart",u),o("pointEnd",C),o("rotationAxis",T),o("rotationAngle",m),o("eye",f),this._offset=new O,this._startNorm=new O,this._endNorm=new O,this._cameraScale=new O,this._parentPosition=new O,this._parentQuaternion=new Rt,this._parentQuaternionInv=new Rt,this._parentScale=new O,this._worldScaleStart=new O,this._worldQuaternionInv=new Rt,this._worldScale=new O,this._positionStart=new O,this._quaternionStart=new Rt,this._scaleStart=new O,this._getPointer=Ua.bind(this),this._onPointerDown=xa.bind(this),this._onPointerHover=Da.bind(this),this._onPointerMove=ba.bind(this),this._onPointerUp=va.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(t){if(this.object===void 0||this.dragging===!0)return;Xt.setFromCamera(t,this.camera);const e=$s(this._gizmo.picker[this.mode],Xt);e?this.axis=e.object.name:this.axis=null}pointerDown(t){if(!(this.object===void 0||this.dragging===!0||t.button!==0)&&this.axis!==null){Xt.setFromCamera(t,this.camera);const e=$s(this._plane,Xt,!0);e&&(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(e.point).sub(this.worldPositionStart)),this.dragging=!0,fn.mode=this.mode,this.dispatchEvent(fn)}}pointerMove(t){const e=this.axis,s=this.mode,i=this.object;let n=this.space;if(s==="scale"?n="local":(e==="E"||e==="XYZE"||e==="XYZ")&&(n="world"),i===void 0||e===null||this.dragging===!1||t.button!==-1)return;Xt.setFromCamera(t,this.camera);const o=$s(this._plane,Xt,!0);if(o){if(this.pointEnd.copy(o.point).sub(this.worldPositionStart),s==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),n==="local"&&e!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),e.indexOf("X")===-1&&(this._offset.x=0),e.indexOf("Y")===-1&&(this._offset.y=0),e.indexOf("Z")===-1&&(this._offset.z=0),n==="local"&&e!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),i.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(n==="local"&&(i.position.applyQuaternion(Q.copy(this._quaternionStart).invert()),e.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.position.applyQuaternion(this._quaternionStart)),n==="world"&&(i.parent&&i.position.add(nt.setFromMatrixPosition(i.parent.matrixWorld)),e.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.parent&&i.position.sub(nt.setFromMatrixPosition(i.parent.matrixWorld))));else if(s==="scale"){if(e.search("XYZ")!==-1){let r=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(r*=-1),xt.set(r,r,r)}else nt.copy(this.pointStart),xt.copy(this.pointEnd),nt.applyQuaternion(this._worldQuaternionInv),xt.applyQuaternion(this._worldQuaternionInv),xt.divide(nt),e.search("X")===-1&&(xt.x=1),e.search("Y")===-1&&(xt.y=1),e.search("Z")===-1&&(xt.z=1);i.scale.copy(this._scaleStart).multiply(xt),this.scaleSnap&&(e.search("X")!==-1&&(i.scale.x=Math.round(i.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Y")!==-1&&(i.scale.y=Math.round(i.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Z")!==-1&&(i.scale.z=Math.round(i.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(s==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const r=20/this.worldPosition.distanceTo(nt.setFromMatrixPosition(this.camera.matrixWorld));let a=!1;e==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(nt.copy(this.rotationAxis).cross(this.eye))*r):(e==="X"||e==="Y"||e==="Z")&&(this.rotationAxis.copy(mn[e]),nt.copy(mn[e]),n==="local"&&nt.applyQuaternion(this.worldQuaternion),nt.cross(this.eye),nt.length()===0?a=!0:this.rotationAngle=this._offset.dot(nt.normalize())*r),(e==="E"||a)&&(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),n==="local"&&e!=="E"&&e!=="XYZE"?(i.quaternion.copy(this._quaternionStart),i.quaternion.multiply(Q.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),i.quaternion.copy(Q.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),i.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(Ks),this.dispatchEvent(Fn)}}pointerUp(t){t.button===0&&(this.dragging&&this.axis!==null&&(Rn.mode=this.mode,this.dispatchEvent(Rn)),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(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()})}attach(t){return this.object=t,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(Ks),this.dispatchEvent(Fn),this.pointStart.copy(this.pointEnd))}getRaycaster(){return Xt}getMode(){return this.mode}setMode(t){this.mode=t}setTranslationSnap(t){this.translationSnap=t}setRotationSnap(t){this.rotationSnap=t}setScaleSnap(t){this.scaleSnap=t}setSize(t){this.size=t}setSpace(t){this.space=t}}function Ua(c){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:c.button};{const t=this.domElement.getBoundingClientRect();return{x:(c.clientX-t.left)/t.width*2-1,y:-(c.clientY-t.top)/t.height*2+1,button:c.button}}}function Da(c){if(this.enabled)switch(c.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(c));break}}function xa(c){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(c.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(c)),this.pointerDown(this._getPointer(c)))}function ba(c){this.enabled&&this.pointerMove(this._getPointer(c))}function va(c){this.enabled&&(this.domElement.releasePointerCapture(c.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(c)))}function $s(c,t,e){const s=t.intersectObject(c,!0);for(let i=0;i.9&&(n.visible=!1)),this.axis==="Y"&&(Q.setFromEuler(Is.set(0,0,Math.PI/2)),n.quaternion.copy(e).multiply(Q),Math.abs(X.copy(kt).applyQuaternion(e).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Z"&&(Q.setFromEuler(Is.set(0,Math.PI/2,0)),n.quaternion.copy(e).multiply(Q),Math.abs(X.copy(Be).applyQuaternion(e).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="XYZE"&&(Q.setFromEuler(Is.set(0,Math.PI/2,0)),X.copy(this.rotationAxis),n.quaternion.setFromRotationMatrix(gn.lookAt(An,X,kt)),n.quaternion.multiply(Q),n.visible=this.dragging),this.axis==="E"&&(n.visible=!1)):n.name==="START"?(n.position.copy(this.worldPositionStart),n.visible=this.dragging):n.name==="END"?(n.position.copy(this.worldPosition),n.visible=this.dragging):n.name==="DELTA"?(n.position.copy(this.worldPositionStart),n.quaternion.copy(this.worldQuaternionStart),nt.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),nt.applyQuaternion(this.worldQuaternionStart.clone().invert()),n.scale.copy(nt),n.visible=this.dragging):(n.quaternion.copy(e),this.dragging?n.position.copy(this.worldPositionStart):n.position.copy(this.worldPosition),this.axis&&(n.visible=this.axis.search(n.name)!==-1));continue}n.quaternion.copy(e),this.mode==="translate"||this.mode==="scale"?(n.name==="X"&&Math.abs(X.copy(ve).applyQuaternion(e).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Y"&&Math.abs(X.copy(kt).applyQuaternion(e).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Z"&&Math.abs(X.copy(Be).applyQuaternion(e).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XY"&&Math.abs(X.copy(Be).applyQuaternion(e).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="YZ"&&Math.abs(X.copy(ve).applyQuaternion(e).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XZ"&&Math.abs(X.copy(kt).applyQuaternion(e).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1)):this.mode==="rotate"&&(ps.copy(e),X.copy(this.eye).applyQuaternion(Q.copy(e).invert()),n.name.search("E")!==-1&&n.quaternion.setFromRotationMatrix(gn.lookAt(this.eye,An,kt)),n.name==="X"&&(Q.setFromAxisAngle(ve,Math.atan2(-X.y,X.z)),Q.multiplyQuaternions(ps,Q),n.quaternion.copy(Q)),n.name==="Y"&&(Q.setFromAxisAngle(kt,Math.atan2(X.x,X.z)),Q.multiplyQuaternions(ps,Q),n.quaternion.copy(Q)),n.name==="Z"&&(Q.setFromAxisAngle(Be,Math.atan2(X.y,X.x)),Q.multiplyQuaternions(ps,Q),n.quaternion.copy(Q))),n.visible=n.visible&&(n.name.indexOf("X")===-1||this.showX),n.visible=n.visible&&(n.name.indexOf("Y")===-1||this.showY),n.visible=n.visible&&(n.name.indexOf("Z")===-1||this.showZ),n.visible=n.visible&&(n.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),n.material._color=n.material._color||n.material.color.clone(),n.material._opacity=n.material._opacity||n.material.opacity,n.material.color.copy(n.material._color),n.material.opacity=n.material._opacity,this.enabled&&this.axis&&(n.name===this.axis||this.axis.split("").some(function(r){return n.name===r}))&&(n.material.color.setHex(16776960),n.material.opacity=1)}super.updateMatrixWorld(t)}}class Ya extends D{constructor(){super(new _i(1e5,1e5,2,2),new Te({visible:!1,wireframe:!0,side:He,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(t){let e=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(e="local"),Cs.copy(ve).applyQuaternion(e==="local"?this.worldQuaternion:Rs),xe.copy(kt).applyQuaternion(e==="local"?this.worldQuaternion:Rs),be.copy(Be).applyQuaternion(e==="local"?this.worldQuaternion:Rs),X.copy(xe),this.mode){case"translate":case"scale":switch(this.axis){case"X":X.copy(this.eye).cross(Cs),St.copy(Cs).cross(X);break;case"Y":X.copy(this.eye).cross(xe),St.copy(xe).cross(X);break;case"Z":X.copy(this.eye).cross(be),St.copy(be).cross(X);break;case"XY":St.copy(be);break;case"YZ":St.copy(Cs);break;case"XZ":X.copy(be),St.copy(xe);break;case"XYZ":case"E":St.set(0,0,0);break}break;case"rotate":default:St.set(0,0,0)}St.length()===0?this.quaternion.copy(this.cameraQuaternion):(On.lookAt(nt.set(0,0,0),St,X),this.quaternion.setFromRotationMatrix(On)),super.updateMatrixWorld(t)}}class Mi{constructor(t,e,s,i,n,o=5,r=!0){if(I(this,"onDraggingStarted",new M),I(this,"onDraggingEnded",new M),I(this,"onDisposed",new M),I(this,"normal"),I(this,"origin"),I(this,"three",new fe),I(this,"components"),I(this,"world"),I(this,"type","default"),I(this,"_helper"),I(this,"_visible",!0),I(this,"_enabled",!0),I(this,"_controlsActive",!1),I(this,"_arrowBoundBox",new D),I(this,"_planeMesh"),I(this,"_controls"),I(this,"_hiddenMaterial",new Te({visible:!1})),I(this,"update",()=>{this._enabled&&this.three.setFromNormalAndCoplanarPoint(this.normal,this._helper.position)}),I(this,"changeDrag",a=>{this._visible=!a.value,this.preventCameraMovement(),this.notifyDraggingChanged(a)}),this.components=t,this.world=e,!e.renderer)throw new Error("The given world must have a renderer!");this.normal=i,this.origin=s,e.renderer.setPlane(!0,this.three),this._planeMesh=Mi.newPlaneMesh(o,n),this._helper=this.newHelper(),this._controls=this.newTransformControls(),this.three.setFromNormalAndCoplanarPoint(i,s),r&&this.toggleControls(!0)}get enabled(){return this._enabled}set enabled(t){if(!this.world.renderer)throw new Error("No renderer found for clipping plane!");this._enabled=t,this.world.renderer.setPlane(t,this.three)}get visible(){return this._visible}set visible(t){this._visible=t,this._controls.visible=t,this._helper.visible=t,this.toggleControls(t)}get meshes(){return[this._planeMesh,this._arrowBoundBox]}get planeMaterial(){return this._planeMesh.material}set planeMaterial(t){this._planeMesh.material=t}get size(){return this._planeMesh.scale.x}set size(t){this._planeMesh.scale.set(t,t,t)}get helper(){return this._helper}setFromNormalAndCoplanarPoint(t,e){this.reset(),this.normal.equals(t)||(this.normal.copy(t),this._helper.lookAt(t)),this.origin.copy(e),this._helper.position.copy(e),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 t=new O(1,0,0),e=new O;this.normal.equals(t)||(this.normal.copy(t),this._helper.lookAt(t)),this.origin.copy(e),this._helper.position.copy(e),this._helper.updateMatrix()}toggleControls(t){if(t){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=t}newTransformControls(){if(!this.world.renderer)throw new Error("No renderer found for clipping plane!");const t=this.world.camera.three,e=this.world.renderer.three.domElement,s=new Ma(t,e);return this.initializeControls(s),this.world.scene.three.add(s),s}initializeControls(t){t.attach(this._helper),t.showX=!1,t.showY=!1,t.setSpace("local"),this.createArrowBoundingBox(),t.children[0].children[0].add(this._arrowBoundBox)}createArrowBoundingBox(){this._arrowBoundBox.geometry=new rt(.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(t){t.value?this.onDraggingStarted.trigger():this.onDraggingEnded.trigger()}preventCameraMovement(){this.world.camera.enabled=this._visible}newHelper(){const t=new As;return t.lookAt(this.normal),t.position.copy(this.origin),this._planeMesh.position.z+=.01,t.add(this._planeMesh),this.world.scene.three.add(t),t}static newPlaneMesh(t,e){const s=new _i(1),i=new D(s,e);return i.scale.set(t,t,t),i}}const qn=class di extends J{constructor(t){super(t),I(this,"onBeforeDrag",new M),I(this,"onAfterDrag",new M),I(this,"onBeforeCreate",new M),I(this,"onBeforeCancel",new M),I(this,"onAfterCancel",new M),I(this,"onBeforeDelete",new M),I(this,"onAfterCreate",new M),I(this,"onAfterDelete",new M),I(this,"onDisposed",new M),I(this,"orthogonalY",!1),I(this,"toleranceOrthogonalY",.7),I(this,"Type",Mi),I(this,"list",[]),I(this,"_material",new Te({color:12255487,side:He,transparent:!0,opacity:.2})),I(this,"_size",5),I(this,"_enabled",!1),I(this,"_visible",!0),I(this,"_onStartDragging",()=>{this.onBeforeDrag.trigger()}),I(this,"_onEndDragging",()=>{this.onAfterDrag.trigger()}),this.components.add(di.uuid,this)}get enabled(){return this._enabled}set enabled(t){this._enabled=t;for(const e of this.list)e.enabled=t;this.updateMaterialsAndPlanes()}get visible(){return this._visible}set visible(t){this._visible=t;for(const e of this.list)e.visible=t}get material(){return this._material}set material(t){this._material=t;for(const e of this.list)e.planeMaterial=t}get size(){return this._size}set size(t){this._size=t;for(const e of this.list)e.size=t}dispose(){this._enabled=!1;for(const t of this.list)t.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(di.uuid),this.onDisposed.reset()}create(t){const e=this.components.get(cn).get(t).castRay();return e?this.createPlaneFromIntersection(t,e):null}createFromNormalAndCoplanarPoint(t,e,s){const i=this.newPlane(t,s,e);return this.updateMaterialsAndPlanes(),i}delete(t,e){e||(e=this.pickPlane(t)),e&&this.deletePlane(e)}deleteAll(t){const e=[...this.list];for(const s of e)if(!t||t.has(s.type)){this.delete(s.world,s);const i=this.list.indexOf(s);i!==-1&&this.list.splice(i,1)}}deletePlane(t){const e=this.list.indexOf(t);if(e!==-1){if(this.list.splice(e,1),!t.world.renderer)throw new Error("Renderer not found for this plane's world!");t.world.renderer.setPlane(!1,t.three),t.dispose(),this.updateMaterialsAndPlanes(),this.onAfterDelete.trigger(t)}}pickPlane(t){const e=this.components.get(cn).get(t),s=this.getAllPlaneMeshes(),i=e.castRay(s);if(i){const n=i.object;return this.list.find(o=>o.meshes.includes(n))}}getAllPlaneMeshes(){const t=[];for(const e of this.list)t.push(...e.meshes);return t}createPlaneFromIntersection(t,e){var s;if(!t.renderer)throw new Error("The given world must have a renderer!");const i=e.point.distanceTo(new O(0,0,0)),n=(s=e.face)==null?void 0:s.normal;if(!i||!n)return null;const o=this.getWorldNormal(e,n),r=this.newPlane(t,e.point,o.negate());return r.visible=this._visible,r.size=this._size,t.renderer.setPlane(!0,r.three),this.updateMaterialsAndPlanes(),r}getWorldNormal(t,e){const s=t.object;let i=t.object.matrixWorld.clone();if(s instanceof jt&&t.instanceId!==void 0){const r=new H;s.getMatrixAt(t.instanceId,r),i=r.multiply(i)}const n=new Zt().getNormalMatrix(i),o=e.clone().applyMatrix3(n).normalize();return this.normalizePlaneDirectionY(o),o}normalizePlaneDirectionY(t){this.orthogonalY&&(t.y>this.toleranceOrthogonalY&&(t.x=0,t.y=1,t.z=0),t.y<-this.toleranceOrthogonalY&&(t.x=0,t.y=-1,t.z=0))}newPlane(t,e,s){const i=new this.Type(this.components,t,e,s,this._material);return i.onDraggingStarted.add(this._onStartDragging),i.onDraggingEnded.add(this._onEndDragging),this.list.push(i),this.onAfterCreate.trigger(i),i}updateMaterialsAndPlanes(){const t=this.components.get(La);for(const[e,s]of t.list){if(!s.renderer)continue;s.renderer.updateClippingPlanes();const{clippingPlanes:i}=s.renderer;for(const n of s.meshes)if(n.material)if(Array.isArray(n.material))for(const o of n.material)o.clippingPlanes=i;else n.material.clippingPlanes=i}}};I(qn,"uuid","66290bc5-18c4-4cd1-9379-2e17a0617611");let lh=qn;function za(c,t,e,s){return new Promise((i,n)=>{function o(){const r=c.clientWaitSync(t,e,0);if(r===c.WAIT_FAILED){n();return}if(r===c.TIMEOUT_EXPIRED){setTimeout(o,s);return}i()}o()})}async function Ga(c,t,e,s,i,n,o){const r=c.fenceSync(c.SYNC_GPU_COMMANDS_COMPLETE,0);c.flush(),await za(c,r,0,10),c.deleteSync(r),c.bindBuffer(t,e),c.getBufferSubData(t,s,i,n,o),c.bindBuffer(t,null)}async function Va(c,t,e,s,i,n,o,r){const a=c.createBuffer();return c.bindBuffer(c.PIXEL_PACK_BUFFER,a),c.bufferData(c.PIXEL_PACK_BUFFER,r.byteLength,c.STREAM_READ),c.readPixels(t,e,s,i,n,o,0),c.bindBuffer(c.PIXEL_PACK_BUFFER,null),await Ga(c,c.PIXEL_PACK_BUFFER,a,0,r),c.deleteBuffer(a),r}class Ha{constructor(t,e,s){if(I(this,"onDisposed",new M),I(this,"onViewUpdated",new ms),I(this,"enabled",!0),I(this,"needsUpdate",!1),I(this,"renderDebugFrame",!1),I(this,"components"),I(this,"world"),I(this,"renderer"),I(this,"autoUpdate",!0),I(this,"updateInterval",1e3),I(this,"worker"),I(this,"scene",new Ci),I(this,"_width",512),I(this,"_height",512),I(this,"_availableColor",1),I(this,"renderTarget"),I(this,"bufferSize"),I(this,"_buffer"),I(this,"_isWorkerBusy",!1),I(this,"updateVisibility",async o=>{if(!this.enabled||!this.needsUpdate&&!o||this._isWorkerBusy)return;this._isWorkerBusy=!0;const r=this.world.camera.three;r.updateMatrix(),this.renderer.setSize(this._width,this._height),this.renderer.setRenderTarget(this.renderTarget),this.renderer.render(this.scene,r);const a=this.renderer.getContext();await Va(a,0,0,this._width,this._height,a.RGBA,a.UNSIGNED_BYTE,this._buffer),this.renderer.setRenderTarget(null),this.renderDebugFrame&&this.renderer.render(this.scene,r),this.worker.postMessage({buffer:this._buffer}),this.needsUpdate=!1}),!e.renderer)throw new Error("The given world must have a renderer!");this.components=t,this.applySettings(s),this.world=e,this.renderer=new Fs,this.renderTarget=new jo(this._width,this._height),this.bufferSize=this._width*this._height*4,this._buffer=new Uint8Array(this.bufferSize),this.renderer.clippingPlanes=e.renderer.clippingPlanes;const i=` + `,extensions:{derivatives:!0}});this.three=new D(a,h),this.three.frustumCulled=!1,e.scene.three.add(this.three),this.setupEvents(!0)}get visible(){return this.three.visible}set visible(t){t?this.world.scene.three.add(this.three):this.three.removeFromParent()}get material(){return this.three.material}get fade(){return this._fade===3}set fade(t){this._fade=t?3:0,this.material.uniforms.uFade.value=this._fade}dispose(){this.setupEvents(!1),this.components.get(me).destroy(this.three),this.onDisposed.trigger(),this.onDisposed.reset(),this.world=null,this.components=null}setupEvents(t){if(this.world.isDisposing||!(this.world.camera instanceof Ve))return;const e=this.world.camera.controls;t?e.addEventListener("update",this.updateZoom):e.removeEventListener("update",this.updateZoom)}}const Qn=class jn extends J{constructor(t){super(t),I(this,"list",new Map),I(this,"config",{color:new Qt(12303291),size1:1,size2:10,distance:500}),I(this,"onDisposed",new M),I(this,"enabled",!0),t.add(jn.uuid,this)}create(t){if(this.list.has(t.uuid))throw new Error("This world already has a grid!");const e=new Pa(this.components,t,this.config);return this.list.set(t.uuid,e),t.onDisposed.add(()=>{this.delete(t)}),e}delete(t){const e=this.list.get(t.uuid);e&&e.dispose(),this.list.delete(t.uuid)}dispose(){for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger(),this.onDisposed.reset()}};I(Qn,"uuid","d1e814d5-b81c-4452-87a2-f039375e0489");let ch=Qn;const Xt=new pi,nt=new O,xt=new O,Q=new Rt,mn={X:new O(1,0,0),Y:new O(0,1,0),Z:new O(0,0,1)},Ks={type:"change"},fn={type:"mouseDown"},Rn={type:"mouseUp",mode:null},Fn={type:"objectChange"};class Ma extends As{constructor(t,e){super(),e===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),e=document),this.isTransformControls=!0,this.visible=!1,this.domElement=e,this.domElement.style.touchAction="none";const s=new Ba;this._gizmo=s,this.add(s);const i=new Ya;this._plane=i,this.add(i);const n=this;function o(R,A){let p=A;Object.defineProperty(n,R,{get:function(){return p!==void 0?p:A},set:function(F){p!==F&&(p=F,i[R]=F,s[R]=F,n.dispatchEvent({type:R+"-changed",value:F}),n.dispatchEvent(Ks))}}),n[R]=A,i[R]=A,s[R]=A}o("camera",t),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 r=new O,a=new O,h=new Rt,d=new Rt,E=new O,l=new Rt,u=new O,C=new O,T=new O,m=0,f=new O;o("worldPosition",r),o("worldPositionStart",a),o("worldQuaternion",h),o("worldQuaternionStart",d),o("cameraPosition",E),o("cameraQuaternion",l),o("pointStart",u),o("pointEnd",C),o("rotationAxis",T),o("rotationAngle",m),o("eye",f),this._offset=new O,this._startNorm=new O,this._endNorm=new O,this._cameraScale=new O,this._parentPosition=new O,this._parentQuaternion=new Rt,this._parentQuaternionInv=new Rt,this._parentScale=new O,this._worldScaleStart=new O,this._worldQuaternionInv=new Rt,this._worldScale=new O,this._positionStart=new O,this._quaternionStart=new Rt,this._scaleStart=new O,this._getPointer=Ua.bind(this),this._onPointerDown=xa.bind(this),this._onPointerHover=Da.bind(this),this._onPointerMove=va.bind(this),this._onPointerUp=ba.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(t){if(this.object===void 0||this.dragging===!0)return;Xt.setFromCamera(t,this.camera);const e=$s(this._gizmo.picker[this.mode],Xt);e?this.axis=e.object.name:this.axis=null}pointerDown(t){if(!(this.object===void 0||this.dragging===!0||t.button!==0)&&this.axis!==null){Xt.setFromCamera(t,this.camera);const e=$s(this._plane,Xt,!0);e&&(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(e.point).sub(this.worldPositionStart)),this.dragging=!0,fn.mode=this.mode,this.dispatchEvent(fn)}}pointerMove(t){const e=this.axis,s=this.mode,i=this.object;let n=this.space;if(s==="scale"?n="local":(e==="E"||e==="XYZE"||e==="XYZ")&&(n="world"),i===void 0||e===null||this.dragging===!1||t.button!==-1)return;Xt.setFromCamera(t,this.camera);const o=$s(this._plane,Xt,!0);if(o){if(this.pointEnd.copy(o.point).sub(this.worldPositionStart),s==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),n==="local"&&e!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),e.indexOf("X")===-1&&(this._offset.x=0),e.indexOf("Y")===-1&&(this._offset.y=0),e.indexOf("Z")===-1&&(this._offset.z=0),n==="local"&&e!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),i.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(n==="local"&&(i.position.applyQuaternion(Q.copy(this._quaternionStart).invert()),e.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.position.applyQuaternion(this._quaternionStart)),n==="world"&&(i.parent&&i.position.add(nt.setFromMatrixPosition(i.parent.matrixWorld)),e.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.parent&&i.position.sub(nt.setFromMatrixPosition(i.parent.matrixWorld))));else if(s==="scale"){if(e.search("XYZ")!==-1){let r=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(r*=-1),xt.set(r,r,r)}else nt.copy(this.pointStart),xt.copy(this.pointEnd),nt.applyQuaternion(this._worldQuaternionInv),xt.applyQuaternion(this._worldQuaternionInv),xt.divide(nt),e.search("X")===-1&&(xt.x=1),e.search("Y")===-1&&(xt.y=1),e.search("Z")===-1&&(xt.z=1);i.scale.copy(this._scaleStart).multiply(xt),this.scaleSnap&&(e.search("X")!==-1&&(i.scale.x=Math.round(i.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Y")!==-1&&(i.scale.y=Math.round(i.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Z")!==-1&&(i.scale.z=Math.round(i.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(s==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const r=20/this.worldPosition.distanceTo(nt.setFromMatrixPosition(this.camera.matrixWorld));let a=!1;e==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(nt.copy(this.rotationAxis).cross(this.eye))*r):(e==="X"||e==="Y"||e==="Z")&&(this.rotationAxis.copy(mn[e]),nt.copy(mn[e]),n==="local"&&nt.applyQuaternion(this.worldQuaternion),nt.cross(this.eye),nt.length()===0?a=!0:this.rotationAngle=this._offset.dot(nt.normalize())*r),(e==="E"||a)&&(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),n==="local"&&e!=="E"&&e!=="XYZE"?(i.quaternion.copy(this._quaternionStart),i.quaternion.multiply(Q.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),i.quaternion.copy(Q.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),i.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(Ks),this.dispatchEvent(Fn)}}pointerUp(t){t.button===0&&(this.dragging&&this.axis!==null&&(Rn.mode=this.mode,this.dispatchEvent(Rn)),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(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()})}attach(t){return this.object=t,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(Ks),this.dispatchEvent(Fn),this.pointStart.copy(this.pointEnd))}getRaycaster(){return Xt}getMode(){return this.mode}setMode(t){this.mode=t}setTranslationSnap(t){this.translationSnap=t}setRotationSnap(t){this.rotationSnap=t}setScaleSnap(t){this.scaleSnap=t}setSize(t){this.size=t}setSpace(t){this.space=t}}function Ua(c){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:c.button};{const t=this.domElement.getBoundingClientRect();return{x:(c.clientX-t.left)/t.width*2-1,y:-(c.clientY-t.top)/t.height*2+1,button:c.button}}}function Da(c){if(this.enabled)switch(c.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(c));break}}function xa(c){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(c.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(c)),this.pointerDown(this._getPointer(c)))}function va(c){this.enabled&&this.pointerMove(this._getPointer(c))}function ba(c){this.enabled&&(this.domElement.releasePointerCapture(c.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(c)))}function $s(c,t,e){const s=t.intersectObject(c,!0);for(let i=0;i.9&&(n.visible=!1)),this.axis==="Y"&&(Q.setFromEuler(Is.set(0,0,Math.PI/2)),n.quaternion.copy(e).multiply(Q),Math.abs(X.copy(kt).applyQuaternion(e).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Z"&&(Q.setFromEuler(Is.set(0,Math.PI/2,0)),n.quaternion.copy(e).multiply(Q),Math.abs(X.copy(Be).applyQuaternion(e).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="XYZE"&&(Q.setFromEuler(Is.set(0,Math.PI/2,0)),X.copy(this.rotationAxis),n.quaternion.setFromRotationMatrix(gn.lookAt(An,X,kt)),n.quaternion.multiply(Q),n.visible=this.dragging),this.axis==="E"&&(n.visible=!1)):n.name==="START"?(n.position.copy(this.worldPositionStart),n.visible=this.dragging):n.name==="END"?(n.position.copy(this.worldPosition),n.visible=this.dragging):n.name==="DELTA"?(n.position.copy(this.worldPositionStart),n.quaternion.copy(this.worldQuaternionStart),nt.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),nt.applyQuaternion(this.worldQuaternionStart.clone().invert()),n.scale.copy(nt),n.visible=this.dragging):(n.quaternion.copy(e),this.dragging?n.position.copy(this.worldPositionStart):n.position.copy(this.worldPosition),this.axis&&(n.visible=this.axis.search(n.name)!==-1));continue}n.quaternion.copy(e),this.mode==="translate"||this.mode==="scale"?(n.name==="X"&&Math.abs(X.copy(be).applyQuaternion(e).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Y"&&Math.abs(X.copy(kt).applyQuaternion(e).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Z"&&Math.abs(X.copy(Be).applyQuaternion(e).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XY"&&Math.abs(X.copy(Be).applyQuaternion(e).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="YZ"&&Math.abs(X.copy(be).applyQuaternion(e).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XZ"&&Math.abs(X.copy(kt).applyQuaternion(e).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1)):this.mode==="rotate"&&(ps.copy(e),X.copy(this.eye).applyQuaternion(Q.copy(e).invert()),n.name.search("E")!==-1&&n.quaternion.setFromRotationMatrix(gn.lookAt(this.eye,An,kt)),n.name==="X"&&(Q.setFromAxisAngle(be,Math.atan2(-X.y,X.z)),Q.multiplyQuaternions(ps,Q),n.quaternion.copy(Q)),n.name==="Y"&&(Q.setFromAxisAngle(kt,Math.atan2(X.x,X.z)),Q.multiplyQuaternions(ps,Q),n.quaternion.copy(Q)),n.name==="Z"&&(Q.setFromAxisAngle(Be,Math.atan2(X.y,X.x)),Q.multiplyQuaternions(ps,Q),n.quaternion.copy(Q))),n.visible=n.visible&&(n.name.indexOf("X")===-1||this.showX),n.visible=n.visible&&(n.name.indexOf("Y")===-1||this.showY),n.visible=n.visible&&(n.name.indexOf("Z")===-1||this.showZ),n.visible=n.visible&&(n.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),n.material._color=n.material._color||n.material.color.clone(),n.material._opacity=n.material._opacity||n.material.opacity,n.material.color.copy(n.material._color),n.material.opacity=n.material._opacity,this.enabled&&this.axis&&(n.name===this.axis||this.axis.split("").some(function(r){return n.name===r}))&&(n.material.color.setHex(16776960),n.material.opacity=1)}super.updateMatrixWorld(t)}}class Ya extends D{constructor(){super(new _i(1e5,1e5,2,2),new Te({visible:!1,wireframe:!0,side:He,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(t){let e=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(e="local"),Cs.copy(be).applyQuaternion(e==="local"?this.worldQuaternion:Rs),xe.copy(kt).applyQuaternion(e==="local"?this.worldQuaternion:Rs),ve.copy(Be).applyQuaternion(e==="local"?this.worldQuaternion:Rs),X.copy(xe),this.mode){case"translate":case"scale":switch(this.axis){case"X":X.copy(this.eye).cross(Cs),St.copy(Cs).cross(X);break;case"Y":X.copy(this.eye).cross(xe),St.copy(xe).cross(X);break;case"Z":X.copy(this.eye).cross(ve),St.copy(ve).cross(X);break;case"XY":St.copy(ve);break;case"YZ":St.copy(Cs);break;case"XZ":X.copy(ve),St.copy(xe);break;case"XYZ":case"E":St.set(0,0,0);break}break;case"rotate":default:St.set(0,0,0)}St.length()===0?this.quaternion.copy(this.cameraQuaternion):(On.lookAt(nt.set(0,0,0),St,X),this.quaternion.setFromRotationMatrix(On)),super.updateMatrixWorld(t)}}class Mi{constructor(t,e,s,i,n,o=5,r=!0){if(I(this,"onDraggingStarted",new M),I(this,"onDraggingEnded",new M),I(this,"onDisposed",new M),I(this,"normal"),I(this,"origin"),I(this,"three",new fe),I(this,"components"),I(this,"world"),I(this,"type","default"),I(this,"_helper"),I(this,"_visible",!0),I(this,"_enabled",!0),I(this,"_controlsActive",!1),I(this,"_arrowBoundBox",new D),I(this,"_planeMesh"),I(this,"_controls"),I(this,"_hiddenMaterial",new Te({visible:!1})),I(this,"update",()=>{this._enabled&&this.three.setFromNormalAndCoplanarPoint(this.normal,this._helper.position)}),I(this,"changeDrag",a=>{this._visible=!a.value,this.preventCameraMovement(),this.notifyDraggingChanged(a)}),this.components=t,this.world=e,!e.renderer)throw new Error("The given world must have a renderer!");this.normal=i,this.origin=s,e.renderer.setPlane(!0,this.three),this._planeMesh=Mi.newPlaneMesh(o,n),this._helper=this.newHelper(),this._controls=this.newTransformControls(),this.three.setFromNormalAndCoplanarPoint(i,s),r&&this.toggleControls(!0)}get enabled(){return this._enabled}set enabled(t){if(!this.world.renderer)throw new Error("No renderer found for clipping plane!");this._enabled=t,this.world.renderer.setPlane(t,this.three)}get visible(){return this._visible}set visible(t){this._visible=t,this._controls.visible=t,this._helper.visible=t,this.toggleControls(t)}get meshes(){return[this._planeMesh,this._arrowBoundBox]}get planeMaterial(){return this._planeMesh.material}set planeMaterial(t){this._planeMesh.material=t}get size(){return this._planeMesh.scale.x}set size(t){this._planeMesh.scale.set(t,t,t)}get helper(){return this._helper}setFromNormalAndCoplanarPoint(t,e){this.reset(),this.normal.equals(t)||(this.normal.copy(t),this._helper.lookAt(t)),this.origin.copy(e),this._helper.position.copy(e),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 t=new O(1,0,0),e=new O;this.normal.equals(t)||(this.normal.copy(t),this._helper.lookAt(t)),this.origin.copy(e),this._helper.position.copy(e),this._helper.updateMatrix()}toggleControls(t){if(t){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=t}newTransformControls(){if(!this.world.renderer)throw new Error("No renderer found for clipping plane!");const t=this.world.camera.three,e=this.world.renderer.three.domElement,s=new Ma(t,e);return this.initializeControls(s),this.world.scene.three.add(s),s}initializeControls(t){t.attach(this._helper),t.showX=!1,t.showY=!1,t.setSpace("local"),this.createArrowBoundingBox(),t.children[0].children[0].add(this._arrowBoundBox)}createArrowBoundingBox(){this._arrowBoundBox.geometry=new rt(.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(t){t.value?this.onDraggingStarted.trigger():this.onDraggingEnded.trigger()}preventCameraMovement(){this.world.camera.enabled=this._visible}newHelper(){const t=new As;return t.lookAt(this.normal),t.position.copy(this.origin),this._planeMesh.position.z+=.01,t.add(this._planeMesh),this.world.scene.three.add(t),t}static newPlaneMesh(t,e){const s=new _i(1),i=new D(s,e);return i.scale.set(t,t,t),i}}const qn=class di extends J{constructor(t){super(t),I(this,"onBeforeDrag",new M),I(this,"onAfterDrag",new M),I(this,"onBeforeCreate",new M),I(this,"onBeforeCancel",new M),I(this,"onAfterCancel",new M),I(this,"onBeforeDelete",new M),I(this,"onAfterCreate",new M),I(this,"onAfterDelete",new M),I(this,"onDisposed",new M),I(this,"orthogonalY",!1),I(this,"toleranceOrthogonalY",.7),I(this,"Type",Mi),I(this,"list",[]),I(this,"_material",new Te({color:12255487,side:He,transparent:!0,opacity:.2})),I(this,"_size",5),I(this,"_enabled",!1),I(this,"_visible",!0),I(this,"_onStartDragging",()=>{this.onBeforeDrag.trigger()}),I(this,"_onEndDragging",()=>{this.onAfterDrag.trigger()}),this.components.add(di.uuid,this)}get enabled(){return this._enabled}set enabled(t){this._enabled=t;for(const e of this.list)e.enabled=t;this.updateMaterialsAndPlanes()}get visible(){return this._visible}set visible(t){this._visible=t;for(const e of this.list)e.visible=t}get material(){return this._material}set material(t){this._material=t;for(const e of this.list)e.planeMaterial=t}get size(){return this._size}set size(t){this._size=t;for(const e of this.list)e.size=t}dispose(){this._enabled=!1;for(const t of this.list)t.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(di.uuid),this.onDisposed.reset()}create(t){const e=this.components.get(cn).get(t).castRay();return e?this.createPlaneFromIntersection(t,e):null}createFromNormalAndCoplanarPoint(t,e,s){const i=this.newPlane(t,s,e);return this.updateMaterialsAndPlanes(),i}delete(t,e){e||(e=this.pickPlane(t)),e&&this.deletePlane(e)}deleteAll(t){const e=[...this.list];for(const s of e)if(!t||t.has(s.type)){this.delete(s.world,s);const i=this.list.indexOf(s);i!==-1&&this.list.splice(i,1)}}deletePlane(t){const e=this.list.indexOf(t);if(e!==-1){if(this.list.splice(e,1),!t.world.renderer)throw new Error("Renderer not found for this plane's world!");t.world.renderer.setPlane(!1,t.three),t.dispose(),this.updateMaterialsAndPlanes(),this.onAfterDelete.trigger(t)}}pickPlane(t){const e=this.components.get(cn).get(t),s=this.getAllPlaneMeshes(),i=e.castRay(s);if(i){const n=i.object;return this.list.find(o=>o.meshes.includes(n))}}getAllPlaneMeshes(){const t=[];for(const e of this.list)t.push(...e.meshes);return t}createPlaneFromIntersection(t,e){var s;if(!t.renderer)throw new Error("The given world must have a renderer!");const i=e.point.distanceTo(new O(0,0,0)),n=(s=e.face)==null?void 0:s.normal;if(!i||!n)return null;const o=this.getWorldNormal(e,n),r=this.newPlane(t,e.point,o.negate());return r.visible=this._visible,r.size=this._size,t.renderer.setPlane(!0,r.three),this.updateMaterialsAndPlanes(),r}getWorldNormal(t,e){const s=t.object;let i=t.object.matrixWorld.clone();if(s instanceof jt&&t.instanceId!==void 0){const r=new H;s.getMatrixAt(t.instanceId,r),i=r.multiply(i)}const n=new Zt().getNormalMatrix(i),o=e.clone().applyMatrix3(n).normalize();return this.normalizePlaneDirectionY(o),o}normalizePlaneDirectionY(t){this.orthogonalY&&(t.y>this.toleranceOrthogonalY&&(t.x=0,t.y=1,t.z=0),t.y<-this.toleranceOrthogonalY&&(t.x=0,t.y=-1,t.z=0))}newPlane(t,e,s){const i=new this.Type(this.components,t,e,s,this._material);return i.onDraggingStarted.add(this._onStartDragging),i.onDraggingEnded.add(this._onEndDragging),this.list.push(i),this.onAfterCreate.trigger(i),i}updateMaterialsAndPlanes(){const t=this.components.get(La);for(const[e,s]of t.list){if(!s.renderer)continue;s.renderer.updateClippingPlanes();const{clippingPlanes:i}=s.renderer;for(const n of s.meshes)if(n.material)if(Array.isArray(n.material))for(const o of n.material)o.clippingPlanes=i;else n.material.clippingPlanes=i}}};I(qn,"uuid","66290bc5-18c4-4cd1-9379-2e17a0617611");let lh=qn;function za(c,t,e,s){return new Promise((i,n)=>{function o(){const r=c.clientWaitSync(t,e,0);if(r===c.WAIT_FAILED){n();return}if(r===c.TIMEOUT_EXPIRED){setTimeout(o,s);return}i()}o()})}async function Ga(c,t,e,s,i,n,o){const r=c.fenceSync(c.SYNC_GPU_COMMANDS_COMPLETE,0);c.flush(),await za(c,r,0,10),c.deleteSync(r),c.bindBuffer(t,e),c.getBufferSubData(t,s,i,n,o),c.bindBuffer(t,null)}async function Va(c,t,e,s,i,n,o,r){const a=c.createBuffer();return c.bindBuffer(c.PIXEL_PACK_BUFFER,a),c.bufferData(c.PIXEL_PACK_BUFFER,r.byteLength,c.STREAM_READ),c.readPixels(t,e,s,i,n,o,0),c.bindBuffer(c.PIXEL_PACK_BUFFER,null),await Ga(c,c.PIXEL_PACK_BUFFER,a,0,r),c.deleteBuffer(a),r}class Ha{constructor(t,e,s){if(I(this,"onDisposed",new M),I(this,"onViewUpdated",new ms),I(this,"enabled",!0),I(this,"needsUpdate",!1),I(this,"renderDebugFrame",!1),I(this,"components"),I(this,"world"),I(this,"renderer"),I(this,"autoUpdate",!0),I(this,"updateInterval",1e3),I(this,"worker"),I(this,"scene",new Ci),I(this,"_width",512),I(this,"_height",512),I(this,"_availableColor",1),I(this,"renderTarget"),I(this,"bufferSize"),I(this,"_buffer"),I(this,"_isWorkerBusy",!1),I(this,"updateVisibility",async o=>{if(!this.enabled||!this.needsUpdate&&!o||this._isWorkerBusy)return;this._isWorkerBusy=!0;const r=this.world.camera.three;r.updateMatrix(),this.renderer.setSize(this._width,this._height),this.renderer.setRenderTarget(this.renderTarget),this.renderer.render(this.scene,r);const a=this.renderer.getContext();await Va(a,0,0,this._width,this._height,a.RGBA,a.UNSIGNED_BYTE,this._buffer),this.renderer.setRenderTarget(null),this.renderDebugFrame&&this.renderer.render(this.scene,r),this.worker.postMessage({buffer:this._buffer}),this.needsUpdate=!1}),!e.renderer)throw new Error("The given world must have a renderer!");this.components=t,this.applySettings(s),this.world=e,this.renderer=new Fs,this.renderTarget=new jo(this._width,this._height),this.bufferSize=this._width*this._height*4,this._buffer=new Uint8Array(this.bufferSize),this.renderer.clippingPlanes=e.renderer.clippingPlanes;const i=` addEventListener("message", (event) => { const { buffer } = event.data; const colors = new Map(); @@ -85,4 +85,4 @@ import{r as Ft,s as st,T as Ie,t as pi,E as So,c as H,V as O,h as At,x as fe,S a } postMessage({ colors }); }); - `,n=new Blob([i],{type:"application/javascript"});this.worker=new Worker(URL.createObjectURL(n))}dispose(){this.enabled=!1;for(const t of this.scene.children)t.removeFromParent();this.onViewUpdated.reset(),this.worker.terminate(),this.renderer.dispose(),this.renderTarget.dispose(),this._buffer=null,this.onDisposed.reset()}getAvailableColor(){let t=BigInt(this._availableColor.toString());const e=[];do e.unshift(Number(t%256n)),t/=256n;while(t);for(;e.length!==3;)e.unshift(0);const[s,i,n]=e,o=`${s}-${i}-${n}`;return{r:s,g:i,b:n,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(t){t&&(t.updateInterval!==void 0&&(this.updateInterval=t.updateInterval),t.height!==void 0&&(this._height=t.height),t.width!==void 0&&(this._width=t.width),t.autoUpdate!==void 0&&(this.autoUpdate=t.autoUpdate))}}class Wa extends Ha{constructor(t,e,s){super(t,e,s),I(this,"onViewUpdated",new M),I(this,"threshold",100),I(this,"colorMeshes",new Map),I(this,"isProcessing",!1),I(this,"_colorCodeMeshMap",new Map),I(this,"_meshIDColorCodeMap",new Map),I(this,"_currentVisibleMeshes",new Set),I(this,"_recentlyHiddenMeshes",new Set),I(this,"_intervalID",null),I(this,"_transparentMat",new Te({transparent:!0,opacity:0})),I(this,"handleWorkerMessage",async i=>{if(this.isProcessing)return;const n=i.data.colors;this._recentlyHiddenMeshes=new Set(this._currentVisibleMeshes),this._currentVisibleMeshes.clear();for(const[o,r]of n){if(r{this.isProcessing||await this.updateVisibility()},this.updateInterval),this.onViewUpdated.add(({seen:i,unseen:n})=>{for(const o of i)o.visible=!0;for(const o of n)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 t=this.components.get(me);for(const e in this.colorMeshes){const s=this.colorMeshes.get(e);s&&t.destroy(s,!0)}this.colorMeshes.clear()}add(t){if(!this.enabled)return;if(this.isProcessing){console.log("Culler processing not finished yet.");return}this.isProcessing=!0;const e=t instanceof jt,{geometry:s,material:i}=t,{colorMaterial:n,code:o}=this.getAvailableMaterial();let r;if(Array.isArray(i)){let d=!0;const E=[];for(const l of i)hn.isTransparent(l)?E.push(this._transparentMat):(d=!1,E.push(n));if(d){n.dispose(),this.isProcessing=!1;return}r=E}else if(hn.isTransparent(i)){n.dispose(),this.isProcessing=!1;return}else r=n;this._colorCodeMeshMap.set(o,t),this._meshIDColorCodeMap.set(t.uuid,o);const a=e?t.count:1,h=new jt(s,r,a);e?h.instanceMatrix=t.instanceMatrix:h.setMatrixAt(0,new H),t.visible=!1,t.updateWorldMatrix(!0,!1),h.applyMatrix4(t.matrixWorld),h.updateMatrix(),this.scene.add(h),this.colorMeshes.set(t.uuid,h),this.increaseColor(),this.isProcessing=!1}remove(t){if(this.isProcessing){console.log("Culler processing not finished yet.");return}this.isProcessing=!0;const e=this.components.get(me);this._currentVisibleMeshes.delete(t),this._recentlyHiddenMeshes.delete(t);const s=this.colorMeshes.get(t.uuid),i=this._meshIDColorCodeMap.get(t.uuid);if(!s||!i){this.isProcessing=!1;return}this._colorCodeMeshMap.delete(i),this._meshIDColorCodeMap.delete(t.uuid),this.colorMeshes.delete(t.uuid),s.geometry=void 0,s.material=[],e.destroy(s,!0),this._recentlyHiddenMeshes.delete(t),this._currentVisibleMeshes.delete(t),this.isProcessing=!1}getAvailableMaterial(){const{r:t,g:e,b:s,code:i}=this.getAvailableColor(),n=Ps.enabled;Ps.enabled=!1;const o=new Qt(`rgb(${t}, ${e}, ${s})`);if(!this.world.renderer)throw new Error("Renderer not found in the world!");const r=this.world.renderer.clippingPlanes,a=new Te({color:o,clippingPlanes:r,side:He});return Ps.enabled=n,{colorMaterial:a,code:i}}}const Kn=class Ei extends J{constructor(t){super(t),I(this,"onDisposed",new M),I(this,"_enabled",!0),I(this,"list",new Map),t.add(Ei.uuid,this)}get enabled(){return this._enabled}set enabled(t){this._enabled=t;for(const[e,s]of this.list)s.enabled=t}create(t,e){if(this.list.has(t.uuid))return this.list.get(t.uuid);const s=new Wa(this.components,t,e);return this.list.set(t.uuid,s),s}delete(t){const e=this.list.get(t.uuid);e&&e.dispose(),this.list.delete(t.uuid)}dispose(){this.enabled=!1,this.onDisposed.trigger(Ei.uuid),this.onDisposed.reset();for(const[t,e]of this.list)e.dispose();this.list.clear()}};I(Kn,"uuid","69f2a50d-c266-44fc-b1bd-fa4d34be89e6");let Xa=Kn;class ka{constructor(t){if(I(this,"onDisposed",new M),I(this,"onAfterUpdate",new M),I(this,"onBeforeUpdate",new M),I(this,"onResize",new M),I(this,"frontOffset",0),I(this,"overrideMaterial",new zo),I(this,"backgroundColor",new Qt(395274)),I(this,"renderer"),I(this,"enabled",!0),I(this,"world"),I(this,"_lockRotation",!0),I(this,"_camera"),I(this,"_plane"),I(this,"_size",new At(320,160)),I(this,"_tempVector1",new O),I(this,"_tempVector2",new O),I(this,"_tempTarget",new O),I(this,"down",new O(0,-1,0)),I(this,"updatePlanes",()=>{if(!this.world.renderer)throw new Error("The given world must have a renderer!");const i=[],n=this.world.renderer.three;for(const o of n.clippingPlanes)i.push(o);i.push(this._plane),this.renderer.clippingPlanes=i}),this.world=t,!this.world.renderer)throw new Error("The given world must have a renderer!");this.renderer=new Fs,this.renderer.setSize(this._size.x,this._size.y);const e=1,s=this._size.x/this._size.y;this._camera=new Ti(e*s/-2,e*s/2,e/2,e/-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 fe(this.down,200),this.updatePlanes()}get lockRotation(){return this._lockRotation}set lockRotation(t){this._lockRotation=t,t&&(this._camera.rotation.z=0)}get zoom(){return this._camera.zoom}set zoom(t){this._camera.zoom=t,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 t=this.world.scene.three,e=this.world.camera;if(!e.hasCameraControls())throw new Error("The given world must use camera controls!");if(!(t instanceof Ci))throw new Error("The given world must have a THREE.Scene as a root!");const s=e.controls;if(s.getPosition(this._tempVector1),this._camera.position.x=this._tempVector1.x,this._camera.position.z=this._tempVector1.z,this.frontOffset!==0&&(s.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){s.getTarget(this._tempTarget);const n=Math.atan2(this._tempTarget.x-this._tempVector1.x,this._tempTarget.z-this._tempVector1.z);this._camera.rotation.z=n+Math.PI}this._plane.set(this.down,this._tempVector1.y);const i=t.background;t.background=this.backgroundColor,this.renderer.render(t,this._camera),t.background=i,this.onAfterUpdate.trigger()}getSize(){return this._size}resize(t=this._size){this._size.copy(t),this.renderer.setSize(t.x,t.y);const e=t.x/t.y,s=1;this._camera.left=s*e/-2,this._camera.right=s*e/2,this._camera.top=s/2,this._camera.bottom=-s/2,this._camera.updateProjectionMatrix(),this.onResize.trigger(t)}}const $n=class Jn extends J{constructor(t){super(t),I(this,"onAfterUpdate",new M),I(this,"onBeforeUpdate",new M),I(this,"onDisposed",new M),I(this,"enabled",!0),I(this,"list",new Map),this.components.add(Jn.uuid,this)}create(t){if(this.list.has(t.uuid))throw new Error("This world already has a minimap!");const e=new ka(t);return this.list.set(t.uuid,e),e}delete(t){const e=this.list.get(t);e&&e.dispose(),this.list.delete(t)}dispose(){for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger()}update(){for(const[t,e]of this.list)e.update()}};I($n,"uuid","39ad6aad-84c8-4adf-a1e0-7f25313a9e7f");let dh=$n;class Za{constructor(t){I(this,"enabled",!1),I(this,"id","FirstPerson"),this.camera=t}set(t){if(this.enabled=t,t){if(this.camera.projection.current!=="Perspective"){this.camera.set("Orbit");return}this.setupFirstPersonCamera()}}setupFirstPersonCamera(){const t=this.camera.controls,e=new O;t.distance--,t.getPosition(e),t.minDistance=1,t.maxDistance=1,t.distance=1,t.moveTo(e.x,e.y,e.z),t.truckSpeed=50,t.mouseButtons.wheel=ot.ACTION.DOLLY,t.touches.two=ot.ACTION.TOUCH_ZOOM_TRUCK}}class Qa{constructor(t){I(this,"enabled",!0),I(this,"id","Orbit"),this.camera=t,this.activateOrbitControls()}set(t){this.enabled=t,t&&this.activateOrbitControls()}activateOrbitControls(){const t=this.camera.controls;t.minDistance=1,t.maxDistance=300;const e=new O;t.getPosition(e);const s=e.length();t.distance=s,t.truckSpeed=2;const{rotation:i}=this.camera.three,n=new O(0,0,-1).applyEuler(i),o=e.addScaledVector(n,s);t.moveTo(o.x,o.y,o.z)}}class ja{constructor(t){I(this,"enabled",!1),I(this,"id","Plan"),I(this,"mouseAction1"),I(this,"mouseAction2"),I(this,"mouseInitialized",!1),I(this,"defaultAzimuthSpeed"),I(this,"defaultPolarSpeed"),this.camera=t,this.defaultAzimuthSpeed=t.controls.azimuthRotateSpeed,this.defaultPolarSpeed=t.controls.polarRotateSpeed}set(t){this.enabled=t;const e=this.camera.controls;e.azimuthRotateSpeed=t?0:this.defaultAzimuthSpeed,e.polarRotateSpeed=t?0:this.defaultPolarSpeed,this.mouseInitialized||(this.mouseAction1=e.touches.one,this.mouseAction2=e.touches.two,this.mouseInitialized=!0),t?(e.mouseButtons.left=ot.ACTION.TRUCK,e.touches.one=ot.ACTION.TOUCH_TRUCK,e.touches.two=ot.ACTION.TOUCH_ZOOM):(e.mouseButtons.left=ot.ACTION.ROTATE,e.touches.one=this.mouseAction1,e.touches.two=this.mouseAction2)}}class qa{constructor(t){I(this,"onChanged",new M),I(this,"current","Perspective"),I(this,"camera"),I(this,"matchOrthoDistanceEnabled",!1),I(this,"_component"),I(this,"_previousDistance",-1),this._component=t,this.camera=t.three}async set(t){this.current!==t&&(t==="Orthographic"?this.setOrthoCamera():await this.setPerspectiveCamera(),this.onChanged.trigger(this.camera))}async toggle(){const t=this.current==="Perspective"?"Orthographic":"Perspective";await this.set(t)}setOrthoCamera(){if(this._component.mode===null||this._component.mode.id==="FirstPerson")return;this._previousDistance=this._component.controls.distance,this._component.controls.distance=200;const t=this.getPerspectiveDims();if(!t)return;const{width:e,height:s}=t;this.setupOrthoCamera(s,e),this.camera=this._component.threeOrtho,this.current="Orthographic"}getPerspectiveDims(){const t=this._component.currentWorld;if(!t||!t.renderer)return null;const e=new O;this._component.threePersp.getWorldDirection(e);const s=new O;this._component.controls.getTarget(s);const i=s.clone().sub(this._component.threePersp.position).dot(e),n=t.renderer.getSize(),o=n.x/n.y,r=this._component.threePersp,a=i*2*Math.atan(r.fov*(Math.PI/180)/2);return{width:a*o,height:a}}setupOrthoCamera(t,e){this._component.controls.mouseButtons.wheel=ot.ACTION.ZOOM,this._component.controls.mouseButtons.middle=ot.ACTION.ZOOM;const s=this._component.threePersp,i=this._component.threeOrtho;i.zoom=1,i.left=e/-2,i.right=e/2,i.top=t/2,i.bottom=t/-2,i.updateProjectionMatrix(),i.position.copy(s.position),i.quaternion.copy(s.quaternion),this._component.controls.camera=i}getDistance(){const t=this._component.threePersp,e=this._component.threeOrtho;return(e.top-e.bottom)/e.zoom/(2*Math.atan(t.fov*(Math.PI/180)/2))}async setPerspectiveCamera(){this._component.controls.mouseButtons.wheel=ot.ACTION.DOLLY,this._component.controls.mouseButtons.middle=ot.ACTION.DOLLY;const t=this._component.threePersp,e=this._component.threeOrtho;t.position.copy(e.position),t.quaternion.copy(e.quaternion),this._component.controls.mouseButtons.wheel=ot.ACTION.DOLLY,this.matchOrthoDistanceEnabled?this._component.controls.distance=this.getDistance():this._component.controls.distance=this._previousDistance,await this._component.controls.zoomTo(1),t.updateProjectionMatrix(),this._component.controls.camera=t,this.camera=t,this.current="Perspective"}}class Eh extends Ve{constructor(t){super(t),I(this,"projection"),I(this,"threeOrtho"),I(this,"threePersp"),I(this,"_userInputButtons",{}),I(this,"_frustumSize",50),I(this,"_navigationModes",new Map),I(this,"_mode",null),I(this,"previousSize",null),this.threePersp=this.three,this.threeOrtho=this.newOrthoCamera(),this.projection=new qa(this),this.onAspectUpdated.add(()=>{this.setOrthoPerspCameraAspect()}),this.projection.onChanged.add(e=>{this.three=e,this.updateAspect()}),this.onWorldChanged.add(({action:e})=>{e==="added"&&(this._navigationModes.clear(),this._navigationModes.set("Orbit",new Qa(this)),this._navigationModes.set("FirstPerson",new Za(this)),this._navigationModes.set("Plan",new ja(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(t){if(this.mode!==null&&this.mode.id!==t){if(this.mode.set(!1),!this._navigationModes.has(t))throw new Error("The specified mode does not exist!");this._mode=this._navigationModes.get(t),this.mode.set(!0)}}async fit(t,e=1.5){if(!this.enabled)return;const s=Number.MAX_VALUE,i=Number.MIN_VALUE,n=new O(s,s,s),o=new O(i,i,i);for(const l of t){const u=new st().setFromObject(l);u.min.xo.x&&(o.x=u.max.x),u.max.y>o.y&&(o.y=u.max.y),u.max.z>o.z&&(o.z=u.max.z)}const r=new st(n,o),a=new O;r.getSize(a);const h=new O;r.getCenter(h);const d=Math.max(a.x,a.y,a.z)*e,E=new Os(h,d);await this.controls.fitToSphere(E,!0)}setUserInput(t){t?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 t=window.innerWidth/window.innerHeight;return new Ti(this._frustumSize*t/-2,this._frustumSize*t/2,this._frustumSize/2,this._frustumSize/-2,.1,1e3)}setOrthoPerspCameraAspect(){if(!this.currentWorld||!this.currentWorld.renderer||!this.previousSize)return;const t=this.currentWorld.renderer.getSize(),e=this.threeOrtho.top,s=this.threeOrtho.right,i=t.y/this.previousSize.y,n=t.x/this.previousSize.x,o=e*i,r=s*n;this.threeOrtho.left=-r,this.threeOrtho.right=r,this.threeOrtho.top=o,this.threeOrtho.bottom=-o,this.threeOrtho.updateProjectionMatrix(),this.previousSize.copy(t)}}const Ka=new Map([[fi,{forRelating:"IsDecomposedBy",forRelated:"Decomposes"}],[Sn,{forRelating:"AssociatedTo",forRelated:"HasAssociations"}],[Nn,{forRelating:"ClassificationForObjects",forRelated:"HasAssociations"}],[wn,{forRelating:"IsGroupedBy",forRelated:"HasAssignments"}],[mi,{forRelated:"IsDefinedBy",forRelating:"DefinesOcurrence"}],[yn,{forRelated:"IsTypedBy",forRelating:"Types"}],[Ln,{forRelated:"IsDefinedBy",forRelating:"Defines"}],[Ri,{forRelated:"ContainedInStructure",forRelating:"ContainsElements"}]]),to=class ui extends J{constructor(t){super(t),I(this,"onDisposed",new M),I(this,"onRelationsIndexed",new M),I(this,"relationMaps",{}),I(this,"enabled",!0),I(this,"_relToAttributesMap",Ka),I(this,"_inverseAttributes",["IsDecomposedBy","Decomposes","AssociatedTo","HasAssociations","ClassificationForObjects","IsGroupedBy","HasAssignments","IsDefinedBy","DefinesOcurrence","IsTypedBy","Types","Defines","ContainedInStructure","ContainsElements"]),I(this,"_ifcRels",[fi,Sn,Nn,wn,mi,yn,Ln,Ri]),I(this,"onFragmentsDisposed",e=>{delete this.relationMaps[e.groupID]}),this.components.add(ui.uuid,this),t.get(Et).onFragmentsDisposed.add(this.onFragmentsDisposed)}indexRelations(t,e,s,i){const n=Object.keys(e).find(E=>E.startsWith("Relating")),o=Object.keys(e).find(E=>E.startsWith("Related"));if(!(n&&o))return;const r=e[n].value,a=e[o].map(E=>E.value),h=t.get(r)??new Map,d=this.getAttributeIndex(i);d&&(h.set(d,a),t.set(r,h));for(const E of a){const l=t.get(E)??new Map,u=this.getAttributeIndex(s);if(!u)continue;const C=l.get(u)??[];C.push(r),l.set(u,C),t.set(E,l)}}getAttributeIndex(t){const e=this._inverseAttributes.indexOf(t);return e===-1?null:e}setRelationMap(t,e){this.relationMaps[t.uuid]=e,this.onRelationsIndexed.trigger({modelID:t.uuid,relationsMap:e})}async process(t){if(!t.hasProperties)throw new Error("FragmentsGroup properties not found");let e=this.relationMaps[t.uuid];if(e)return e;e=new Map;for(const s of this._ifcRels){const i=await t.getAllPropertiesOfType(s);if(!i)continue;const n=this._relToAttributesMap.get(s);if(!n)continue;const{forRelated:o,forRelating:r}=n;for(const a in i){const h=i[a];this.indexRelations(e,h,o,r)}}return this.setRelationMap(t,e),e}async processFromWebIfc(t,e){const s=new Map;for(const i of this._ifcRels){const n=this._relToAttributesMap.get(i);if(!n)continue;const{forRelated:o,forRelating:r}=n,a=t.GetLineIDsWithType(e,i);for(let h=0;hi.x&&(i.x=o.x),o.y>i.y&&(i.y=o.y),o.z>i.z&&(i.z=o.z);return new st(e,s)}dispose(){const t=this.components.get(me);for(const e of this._meshes)t.destroy(e);this._meshes=[],this.onDisposed.trigger(Lt.uuid),this.onDisposed.reset()}get(){const t=this._absoluteMin.clone(),e=this._absoluteMax.clone();return new st(t,e)}getSphere(){const t=this._absoluteMin.clone(),e=this._absoluteMax.clone(),s=Math.abs((e.x-t.x)/2),i=Math.abs((e.y-t.y)/2),n=Math.abs((e.z-t.z)/2),o=new O(t.x+s,t.y+i,t.z+n),r=o.distanceTo(t);return new Os(o,r)}getMesh(){const t=new st(this._absoluteMin,this._absoluteMax),e=Lt.getDimensions(t),{width:s,height:i,depth:n,center:o}=e,r=new it(s,i,n),a=new D(r);return this._meshes.push(a),a.position.copy(o),a}reset(){this._absoluteMin=Lt.newBound(!0),this._absoluteMax=Lt.newBound(!1)}add(t){for(const e of t.items)this.addMesh(e.mesh)}addMesh(t,e){if(!t.geometry.index)return;const s=Lt.getFragmentBounds(t);t.updateMatrixWorld();const i=t.matrixWorld,n=new H,o=t instanceof jt,r=new Set;if(e&&t instanceof xo)for(const a of e){const h=t.fragment.getInstancesIDs(a);if(h)for(const d of h)r.add(d)}else r.add(0);for(const a of r){const h=s.min.clone(),d=s.max.clone();o&&(t.getMatrixAt(a,n),h.applyMatrix4(n),d.applyMatrix4(n)),h.applyMatrix4(i),d.applyMatrix4(i),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),E>o.y&&(o.y=E),l>o.z&&(o.z=l)}return new st(n,o)}};I(io,"uuid","d1444724-dba6-4cdd-a0c7-68ee1450d166");let uh=io;const no=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,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]),oo=class ro extends J{constructor(t){super(t),I(this,"enabled",!0),t.add(ro.uuid,this)}async export(t,e,s=!1,i=!0){const n={},o=new Set(t.GetIfcEntityList(e)),r=new Set([Fi,Ai,gi,Oi,Kt]);for(const a of r)o.add(a);for(const a of o){if(no.has(a))continue;const h=r.has(a)&&i,d=t.GetLineIDsWithType(e,a);for(const E of d){const l=t.GetLine(0,E,h,s);n[l.expressID]=l}}return n}};I(oo,"uuid","b32c4332-cd67-436e-ba7f-196646c7a635");let $a=oo;const ao={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 qt{static async getUnits(t){var e,s,i;const{IFCUNITASSIGNMENT:n}=wt,o=await t.getAllPropertiesOfType(n);if(!o)return 1;const r=Object.keys(o),a=o[parseInt(r[0],10)];for(const h of a.Units){if(h.value===void 0||h.value===null)continue;const d=await t.getProperties(h.value);if(!d||!d.UnitType||!d.UnitType.value||d.UnitType.value!=="LENGTHUNIT")continue;let E=1,l=1;return d.Name.value==="METRE"&&(l=1),d.Name.value==="FOOT"&&(l=.3048),((e=d.Prefix)==null?void 0:e.value)==="MILLI"?E=.001:((s=d.Prefix)==null?void 0:s.value)==="CENTI"?E=.01:((i=d.Prefix)==null?void 0:i.value)==="DECI"&&(E=.1),l*E}return 1}static async findItemByGuid(t,e){var s;const i=t.getAllPropertiesIDs();for(const n of i){const o=await t.getProperties(n);if(o&&((s=o.GlobalId)==null?void 0:s.value)===e)return o}return null}static async getRelationMap(t,e,s){var i;const n=s??(async()=>{}),o={},r=t.getAllPropertiesIDs();for(const a of r){const h=await t.getProperties(a);if(!h)continue;const d=h.type===e,E=Object.keys(h).find(m=>m.startsWith("Relating")),l=Object.keys(h).find(m=>m.startsWith("Related"));if(!(d&&E&&l))continue;const u=await t.getProperties((i=h[E])==null?void 0:i.value),C=h[l];if(!u||!C||!(C&&Array.isArray(C)))continue;const T=C.map(m=>m.value);await n(u.expressID,T),o[u.expressID]=T}return o}static async getQsetQuantities(t,e,s){const i=s??(()=>{}),n=await t.getProperties(e);return!n||n.type!==Uo?null:(n.Quantities??[{}]).map(o=>(o.value&&i(o.value),o.value)).filter(o=>o!==null)}static async getPsetProps(t,e,s){const i=s??(()=>{}),n=await t.getProperties(e);return!n||n.type!==Js?null:(n.HasProperties??[{}]).map(o=>(o.value&&i(o.value),o.value)).filter(o=>o!==null)}static async getPsetRel(t,e){var s;if(!await t.getProperties(e))return null;const i=await t.getAllPropertiesOfType(mi);if(!i)return null;const n=Object.values(i);let o=null;for(const r of n)((s=r.RelatingPropertyDefinition)==null?void 0:s.value)===e&&(o=r.expressID);return o}static async getQsetRel(t,e){return qt.getPsetRel(t,e)}static async getEntityName(t,e){var s;const i=await t.getProperties(e);if(!i)return{key:null,name:null};const n=Object.keys(i).find(r=>r.endsWith("Name"))??null,o=n?(s=i[n])==null?void 0:s.value:null;return{key:n,name:o}}static async getQuantityValue(t,e){const s=await t.getProperties(e);if(!s)return{key:null,value:null};const i=Object.keys(s).find(o=>o.endsWith("Value"))??null;let n;return i===null||s[i]===void 0||s[i]===null?n=null:n=s[i].value,{key:i,value:n}}static isRel(t){return ao[t].startsWith("IFCREL")}static async attributeExists(t,e,s){const i=await t.getProperties(e);return i?Object.keys(i).includes(s):!1}static async groupEntitiesByType(t,e){var s;const i=new Map;for(const n of e){const o=await t.getProperties(n);if(!o)continue;const r=o.type;i.get(r)||i.set(r,new Set),(s=i.get(r))==null||s.add(n)}return i}}class Ja{constructor(){I(this,"factor",1),I(this,"complement",1)}apply(t){const e=this.getScaleMatrix().multiply(t);t.copy(e)}setUp(t){var e,s,i;this.factor=1;const n=this.getLengthUnits(t);if(!n)return;const o=n==null,r=n.Name===void 0||n.Name===null;o||r||(n.Name.value==="FOOT"&&(this.factor=.3048),((e=n.Prefix)==null?void 0:e.value)==="MILLI"?this.complement=.001:((s=n.Prefix)==null?void 0:s.value)==="CENTI"?this.complement=.01:((i=n.Prefix)==null?void 0:i.value)==="DECI"&&(this.complement=.01))}getLengthUnits(t){try{const e=t.GetLineIDsWithType(0,qo).get(0),s=t.GetLine(0,e);for(const i of s.Units){if(!i||i.value===null||i.value===void 0)continue;const n=t.GetLine(0,i.value);if(n.UnitType&&n.UnitType.value==="LENGTHUNIT")return n}return null}catch{return console.log("Could not get units"),null}}getScaleMatrix(){const t=this.factor;return new H().fromArray([t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1])}}class ho{constructor(){I(this,"itemsByFloor",{}),I(this,"_units",new Ja)}setUp(t){this._units.setUp(t),this.cleanUp();try{const e=t.GetLineIDsWithType(0,Ri),s=new Set,i=t.GetLineIDsWithType(0,Kt);for(let h=0;h{this.getMesh(n,e)});for(const n of this._visitedFragments){const{index:o,fragment:r}=n[1];e.keyFragments.set(o,r.id)}for(const n of e.items){const o=this._fragmentInstances.get(n.id);if(!o)throw new Error("Fragment not found!");const r=[];for(const[a,h]of o)r.push(h);n.add(r)}const i=this.webIfc.GetCoordinationMatrix(0);return e.coordinationMatrix.fromArray(i),e.civilData=this._civil.read(this.webIfc),e}getMesh(t,e){const s=t.geometries.size(),i=t.expressID;for(let n=0;no.value!==s),await t.setProperties(s,null),this.registerChange(t,e,s))}async addElementToPset(t,e,...s){const i=await qt.getPsetRel(t,e);if(!i)return;const n=await t.getProperties(i);if(!n)return;for(const r of s){const a=new ke(r);n.RelatedObjects.push(a),this.onElementToPset.trigger({model:t,psetID:e,elementID:r})}this.registerChange(t,e);const o=this.components.get(Ns);for(const r of s)o.addEntityRelations(t,r,"IsDefinedBy",e)}async addPropToPset(t,e,...s){const i=await t.getProperties(e);if(i){for(const n of s){if(i.HasProperties.includes(n))continue;const o=new ke(n);i.HasProperties.push(o),this.onPropToPset.trigger({model:t,psetID:e,propID:n})}this.registerChange(t,e)}}async saveToIfc(t,e){const s=this.components.get(th),i=s.webIfc,n=await s.readIfcFile(e),o=this.changeMap[t.uuid]??[];for(const a of o){const h=await t.getProperties(a);if(h)try{i.WriteLine(n,h)}catch{}else try{i.DeleteLine(n,a)}catch{}}const r=i.SaveModel(n);return s.webIfc.CloseModel(n),s.cleanUp(),r}async setAttributeListener(t,e,s){this.attributeListeners[t.uuid]||(this.attributeListeners[t.uuid]={});const i=this.attributeListeners[t.uuid][e]?this.attributeListeners[t.uuid][e][s]:null;if(i)return i;const n=await t.getProperties(e);if(!n)throw new Error(`Entity with expressID ${e} doesn't exists.`);const o=n[s];if(Array.isArray(o)||!o)throw new Error(`Attribute ${s} is array or null, and it can't have a listener.`);const r=o.value;if(r===void 0||r==null)throw new Error(`Attribute ${s} has a badly defined handle.`);const a=new M;return Object.defineProperty(n[s],"value",{get(){return this._value},async set(h){this._value=h,a.trigger(h)}}),n[s].value=r,this.attributeListeners[t.uuid][e]||(this.attributeListeners[t.uuid][e]={}),this.attributeListeners[t.uuid][e][s]=a,a}increaseMaxID(t){return t.ifcMetadata.maxExpressID++,t.ifcMetadata.maxExpressID}newGUID(t){const e=ue.getIFCSchema(t);return new wt[e].IfcGloballyUniqueId(Pi.create())}async getOwnerHistory(t){const e=await t.getAllPropertiesOfType(vo);if(!e)throw new Error("No OwnerHistory was found.");const s=Object.keys(e).map(o=>parseInt(o,10)),i=e[s[0]],n=new ke(i.expressID);return{ownerHistory:i,ownerHistoryHandle:n}}registerChange(t,...e){this.changeMap[t.uuid]||(this.changeMap[t.uuid]=new Set);for(const s of e)this.changeMap[t.uuid].add(s),this.onDataChanged.trigger({model:t,expressID:s})}async newSingleProperty(t,e,s,i){const n=ue.getIFCSchema(t),o=new wt[n].IfcIdentifier(s),r=new wt[n][e](i),a=new wt[n].IfcPropertySingleValue(o,null,r,null);return a.expressID=this.increaseMaxID(t),await this.setData(t,a),a}};I(eh,"uuid","58c2d9f0-183c-48d6-a402-dfcf5b9a34df");const Io=class po extends J{constructor(t){super(t),I(this,"enabled",!0),I(this,"list",{}),I(this,"onDisposed",new M),I(this,"onFragmentsDisposed",e=>{const{groupID:s,fragmentIDs:i}=e;for(const n in this.list){const o=this.list[n],r=Object.keys(o);if(r.includes(s))delete o[s],Object.values(o).length===0&&delete this.list[n];else for(const a of r){const h=o[a];for(const d of i)delete h.map[d];Object.values(h).length===0&&delete o[a]}}}),t.add(po.uuid,this),t.get(Et).onFragmentsDisposed.add(this.onFragmentsDisposed)}dispose(){this.list={},this.components.get(Et).onFragmentsDisposed.remove(this.onFragmentsDisposed),this.onDisposed.trigger(),this.onDisposed.reset()}remove(t){for(const e in this.list){const s=this.list[e];for(const i in s){const n=s[i];delete n.map[t]}}}find(t){const e=this.components.get(Et);if(!t){const o={};for(const[r,a]of e.list)o[r]=new Set(a.ids);return o}const s=Object.keys(t).length,i={};for(const o in t){const r=t[o];if(!this.list[o]){console.warn(`Classification ${o} does not exist.`);continue}for(const a of r){const h=this.list[o][a];if(h)for(const d in h.map){i[d]||(i[d]=new Map);for(const E of h.map[d]){const l=i[d].get(E);l===void 0?i[d].set(E,1):i[d].set(E,l+1)}}}}const n={};for(const o in i){const r=i[o];for(const[a,h]of r){if(h===void 0)throw new Error("Malformed fragments map!");h===s&&(n[o]||(n[o]=new Set),n[o].add(a))}}return n}byModel(t,e){this.list.models||(this.list.models={});const s=this.list.models;s[t]||(s[t]={map:{},id:null,name:t});const i=s[t];for(const[n,o]of e.data){const r=o[0];for(const a of r){const h=e.keyFragments.get(a);h&&(i.map[h]||(i.map[h]=new Set),i.map[h].add(n))}}}async byPredefinedType(t){var e;this.list.predefinedTypes||(this.list.predefinedTypes={});const s=this.list.predefinedTypes,i=t.getAllPropertiesIDs();for(const n of i){const o=await t.getProperties(n);if(!o)continue;const r=String((e=o.PredefinedType)==null?void 0:e.value).toUpperCase();s[r]||(s[r]={map:{},id:null,name:r});const a=s[r];for(const[h,d]of t.data){const E=d[0];for(const l of E){const u=t.keyFragments.get(l);if(!u)throw new Error("Fragment ID not found!");a.map[u]||(a.map[u]=new Set),a.map[u].add(o.expressID)}}}}byEntity(t){this.list.entities||(this.list.entities={});for(const[e,s]of t.data){const i=s[1][1],n=ao[i];this.saveItem(t,"entities",n,e)}}async byIfcRel(t,e,s){qt.isRel(e)&&await qt.getRelationMap(t,e,async(i,n)=>{const{name:o}=await qt.getEntityName(t,i);for(const r of n)this.saveItem(t,s,o??"NO REL NAME",r)})}async bySpatialStructure(t,e){var s,i;const n=this.components.get(Ns),o=n.relationMaps[t.uuid];if(!o)throw new Error(`Classifier: model relations of ${t.name||t.uuid} have to exists to group by spatial structure.`);const r="spatialStructures",a=e.useProperties===void 0||e.useProperties;for(const[h]of o){if(e.isolate){const u=t.data.get(h);if(!u)continue;const C=u[1][1];if(C===void 0||!e.isolate.has(C))continue}const d=n.getEntityRelations(t,h,"Decomposes");if(d)for(const u of d){let C=u.toString();if(a){const T=await t.getProperties(u);if(!T)continue;C=(s=T.Name)==null?void 0:s.value}this.saveItem(t,r,C,h,u)}const E=n.getEntityRelations(t,h,"ContainsElements");if(!E)continue;let l=h.toString();if(a){const u=await t.getProperties(h);if(!u)continue;l=(i=u.Name)==null?void 0:i.value}for(const u of E){this.saveItem(t,r,l,u,h);const C=n.getEntityRelations(t,Number(u),"IsDecomposedBy");if(C)for(const T of C)this.saveItem(t,r,l,T,h)}}}setColor(t,e,s=!1){const i=this.components.get(Et);for(const n in t){const o=i.list.get(n);if(!o)continue;const r=t[n];o.setColor(e,r,s)}}resetColor(t){const e=this.components.get(Et);for(const s in t){const i=e.list.get(s);if(!i)continue;const n=t[s];i.resetColor(n)}}saveItem(t,e,s,i,n=null){this.list[e]||(this.list[e]={});const o=t.data.get(i);if(o)for(const r of o[0]){const a=t.keyFragments.get(r);if(a){const h=this.list[e];h[s]||(h[s]={map:{},id:n,name:s}),h[s].map[a]||(h[s].map[a]=new Set),h[s].map[a].add(i)}}}};I(Io,"uuid","e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");let sh=Io;const Co=class To extends J{constructor(t){super(t),I(this,"onDisposed",new M),I(this,"enabled",!0),I(this,"height",10),I(this,"groupName","spatialStructures"),I(this,"list",new Set),t.add(To.uuid,this)}dispose(){this.list.clear(),this.onDisposed.trigger(),this.onDisposed.reset()}set(t){if(!this.enabled)return;const e=this.components.get(sh),s=this.components.get(Et),i=t?1:-1;let n=0;const o=e.list[this.groupName],r=new H;for(const a in o){r.elements[13]=n*i*this.height;for(const h in o[a].map){const d=s.list.get(h),E=a+h,l=this.list.has(E);if(!d||t&&l||!t&&!l)continue;t?this.list.add(E):this.list.delete(E);const u=o[a].map[h];d.applyTransform(u,r),d.mesh.computeBoundingSphere(),d.mesh.computeBoundingBox()}n++}}};I(Co,"uuid","d260618b-ce88-4c7d-826c-6debb91de3e2");let Ih=Co;const mo=class fo extends J{constructor(t){super(t),I(this,"enabled",!0),this.components.add(fo.uuid,this)}set(t,e){const s=this.components.get(Et);if(!e){for(const[i,n]of s.list)n&&(n.setVisibility(t),this.updateCulledVisibility(n));return}for(const i in e){const n=e[i],o=s.list.get(i);o&&(o.setVisibility(t,n),this.updateCulledVisibility(o))}}isolate(t){this.set(!1),this.set(!0,t)}updateCulledVisibility(t){const e=this.components.get(Xa);for(const[s,i]of e.list){const n=i.colorMeshes.get(t.id);n&&(n.count=t.mesh.count)}}};I(mo,"uuid","dd9ccf2d-8a21-4821-b7f6-2949add16a29");let ph=mo;class ih extends Ui{constructor(){super(...arguments),I(this,"minGeometrySize",10),I(this,"minAssetsSize",1e3)}}const Ro=class Fo extends J{constructor(t){super(t),I(this,"onGeometryStreamed",new M),I(this,"onAssetStreamed",new M),I(this,"onProgress",new M),I(this,"onIfcLoaded",new M),I(this,"onDisposed",new M),I(this,"settings",new ih),I(this,"enabled",!0),I(this,"webIfc",new Ce),I(this,"_spatialTree",new ho),I(this,"_metaData",new lo),I(this,"_visitedGeometries",new Map),I(this,"_streamSerializer",new Bo),I(this,"_geometries",new Map),I(this,"_geometryCount",0),I(this,"_civil",new co),I(this,"_groupSerializer",new Pn),I(this,"_assets",[]),I(this,"_meshesWithHoles",new Set),this.components.add(Fo.uuid,this),this.settings.excludedCategories.add(Mn)}dispose(){this.onIfcLoaded.reset(),this.onGeometryStreamed.reset(),this.onAssetStreamed.reset(),this.webIfc.Dispose(),this.webIfc=null,this.onDisposed.trigger(),this.onDisposed.reset()}async streamFromBuffer(t){await this.readIfcFile(t),await this.streamAllGeometries(),this.cleanUp()}async streamFromCallBack(t){await this.streamIfcFile(t),await this.streamAllGeometries(),this.cleanUp()}async readIfcFile(t){const{path:e,absolute:s,logLevel:i}=this.settings.wasm;this.webIfc.SetWasmPath(e,s),await this.webIfc.Init(),i&&this.webIfc.SetLogLevel(i),this.webIfc.OpenModel(t,this.settings.webIfc)}async streamIfcFile(t){const{path:e,absolute:s,logLevel:i}=this.settings.wasm;this.webIfc.SetWasmPath(e,s),await this.webIfc.Init(),i&&this.webIfc.SetLogLevel(i),this.webIfc.OpenModelFromCallback(t,this.settings.webIfc)}async streamAllGeometries(){const{minGeometrySize:t,minAssetsSize:e}=this.settings;this._spatialTree.setUp(this.webIfc);const s=this.webIfc.GetIfcEntityList(0),i=[[]],n=new Un;n.ifcMetadata={name:"",description:"",...this._metaData.getNameInfo(this.webIfc),...this._metaData.getDescriptionInfo(this.webIfc),schema:this.webIfc.GetModelSchema(0)||"IFC2X3",maxExpressID:this.webIfc.GetMaxExpressID(0)};let o=0,r=0;for(const C of s){if(!this.webIfc.IsIfcElement(C)&&C!==Kt||this.settings.excludedCategories.has(C))continue;const T=this.webIfc.GetLineIDsWithType(0,C),m=T.size();for(let f=0;ft&&(o=0,r++,i.push([]));const R=T.get(f);i[r].push(R);const A=this.webIfc.GetLine(0,R);if(A.GlobalId){const F=(A==null?void 0:A.GlobalId.value)||(A==null?void 0:A.GlobalId);n.globalToExpressIDs.set(F,R)}const p=this._spatialTree.itemsByFloor[R]||0;n.data.set(R,[[],[p,C]]),o++}}this._spatialTree.cleanUp();let a=.01,h=0;for(const C of i){h++,this.webIfc.StreamMeshes(0,C,m=>{this.getMesh(this.webIfc,m,n)}),this._geometryCount>t&&await this.streamGeometries(),this._assets.length>e&&await this.streamAssets();const T=h/i.length;T>a&&(a+=.01,a=Math.max(a,T),this.onProgress.trigger(Math.round(a*100)/100))}this._geometryCount&&await this.streamGeometries(),this._assets.length&&await this.streamAssets();const{opaque:d,transparent:E}=n.geometryIDs;for(const[C,{index:T,uuid:m}]of this._visitedGeometries)n.keyFragments.set(T,m),(C>1?d:E).set(C,T);Eo.get(n,this.webIfc);const l=this.webIfc.GetCoordinationMatrix(0);n.coordinationMatrix.fromArray(l),n.civilData=this._civil.read(this.webIfc);const u=this._groupSerializer.export(n);this.onIfcLoaded.trigger(u),n.dispose(!0)}cleanUp(){this.webIfc.Dispose(),this.webIfc=null,this.webIfc=new Ce,this._visitedGeometries.clear(),this._geometries.clear(),this._assets=[],this._meshesWithHoles.clear()}getMesh(t,e,s){const i=e.geometries.size(),n=e.expressID,o={id:n,geometries:[]};for(let r=0;ri&&(i=Math.round(i*100)/100,await this.onProgress.trigger(i),i+=.01)}await this.onProgress.trigger(1);const o=await this.components.get(Ns).processFromWebIfc(this.webIfc,0);await this.onIndicesStreamed.trigger(o)}cleanUp(){this.webIfc.Dispose(),this.webIfc=null,this.webIfc=new Ce}}I(oh,"uuid","88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");const Ao=class go extends J{constructor(t){super(t),I(this,"enabled",!0),t.add(go.uuid,this)}static distanceFromPointToLine(t,e,s,i=!1){const n=new Ft,o=new O;return n.set(e,s),n.closestPointToPoint(t,i,o),o.distanceTo(t)}getFace(t,e,s){if(!t.geometry.index)throw new Error("Geometry must be indexed!");const i=new Map,n=t.geometry.index.array,{plane:o}=this.getFaceData(e,s,t),r=[];for(let E=0;Ep.id);if(!u.size){const p=a++;for(const{id:F}of l)h.set(F,p);d.set(p,{edges:new Set(C),indices:new Set([E])});continue}let T=null;const m=new Set,f=new Set(C);for(const[p,F]of u){T===null?T=F:F!==T&&m.add(F),h.delete(p);const{edges:g}=d.get(F);g.delete(p),f.delete(p)}if(T===null)throw new Error("Error computing face!");const R=d.get(T),{indices:A}=R;A.add(E);for(const p of f){h.set(p,T);const{edges:F}=R;F.add(p)}for(const p of m){const F=d.get(p),{edges:g,indices:_}=F,S=d.get(T),{edges:w,indices:y}=S;for(const L of g)w.add(L),h.set(L,T);for(const L of _)y.add(L);d.delete(p)}}for(const[E,{indices:l,edges:u}]of d)if(l.has(e)){const C=[];for(const T of u){const m=i.get(T);C.push(m)}return{edges:C,indices:l}}return null}getVerticesAndNormal(t,e,s){if(!t.geometry.index)throw new Error("Geometry must be indexed!");const i=t.geometry.index.array,n=t.geometry.attributes.position.array,o=t.geometry.attributes.normal.array,r=i[e*3]*3,a=i[e*3+1]*3,h=i[e*3+2]*3,d=new O(n[r],n[r+1],n[r+2]),E=new O(n[a],n[a+1],n[a+2]),l=new O(n[h],n[h+1],n[h+2]),u=new O(o[r],o[r+1],o[r+2]),C=new O(o[a],o[a+1],o[a+2]),T=new O(o[h],o[h+1],o[h+2]),m=(u.x+C.x+T.x)/3,f=(u.y+C.y+T.y)/3,R=(u.z+C.z+T.z)/3,A=new O(m,f,R);if(s!==void 0&&t instanceof jt){const p=new H;t.getMatrixAt(s,p);const F=new H;F.extractRotation(p),A.applyMatrix4(F),d.applyMatrix4(p),E.applyMatrix4(p),l.applyMatrix4(p)}return{p1:d,p2:E,p3:l,faceNormal:A}}round(t){t.x=Math.trunc(t.x*1e3)/1e3,t.y=Math.trunc(t.y*1e3)/1e3,t.z=Math.trunc(t.z*1e3)/1e3}getVolumeFromFragments(t){const e=this.components.get(Et),s=new H,i=[];for(const o in t){const r=e.list.get(o);if(!r)continue;const a=t[o];let h=0;for(const l of a){const u=r.getInstancesIDs(l);u&&(h+=u.size)}const d=new jt(r.mesh.geometry,void 0,h);let E=0;for(const l of a){const u=r.getInstancesIDs(l);if(u)for(const C of u)r.mesh.getMatrixAt(C,s),d.setMatrixAt(E++,s)}i.push(d)}const n=this.getVolumeFromMeshes(i);for(const o of i)o.geometry=null,o.material=[],o.dispose();return n}getVolumeFromMeshes(t){let e=0;for(const s of t)e+=this.getVolumeOfMesh(s);return e}getFaceData(t,e,s){const i=this.getVerticesAndNormal(s,t,e),{p1:n,p2:o,p3:r,faceNormal:a}=i;this.round(n),this.round(o),this.round(r),this.round(a);const h=[{id:`${n.x}|${n.y}|${n.z}`,value:n},{id:`${o.x}|${o.y}|${o.z}`,value:o},{id:`${r.x}|${r.y}|${r.z}`,value:r}];h.sort((R,A)=>R.idA.id?1:0);const[{id:d,value:E},{id:l,value:u},{id:C,value:T}]=h,m=[{id:`${d}|${l}`,distance:E.distanceTo(u),points:[E,u]},{id:`${l}|${C}`,distance:u.distanceTo(T),points:[u,T]},{id:`${d}|${C}`,distance:E.distanceTo(T),points:[E,T]}],f=new fe;return f.setFromNormalAndCoplanarPoint(a,n),f.constant=Math.round(f.constant*10)/10,{plane:f,edges:m}}getVolumeOfMesh(t){let e=0;const s=new O,i=new O,n=new O,{index:o}=t.geometry,r=t.geometry.attributes.position.array;if(!o)return console.warn("Geometry must be indexed to compute its volume!"),0;const a=[];if(t instanceof jt)for(let d=0;d{if(this.isProcessing)return;const n=i.data.colors;this._recentlyHiddenMeshes=new Set(this._currentVisibleMeshes),this._currentVisibleMeshes.clear();for(const[o,r]of n){if(r{this.isProcessing||await this.updateVisibility()},this.updateInterval),this.onViewUpdated.add(({seen:i,unseen:n})=>{for(const o of i)o.visible=!0;for(const o of n)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 t=this.components.get(me);for(const e in this.colorMeshes){const s=this.colorMeshes.get(e);s&&t.destroy(s,!0)}this.colorMeshes.clear()}add(t){if(!this.enabled)return;if(this.isProcessing){console.log("Culler processing not finished yet.");return}this.isProcessing=!0;const e=t instanceof jt,{geometry:s,material:i}=t,{colorMaterial:n,code:o}=this.getAvailableMaterial();let r;if(Array.isArray(i)){let d=!0;const E=[];for(const l of i)hn.isTransparent(l)?E.push(this._transparentMat):(d=!1,E.push(n));if(d){n.dispose(),this.isProcessing=!1;return}r=E}else if(hn.isTransparent(i)){n.dispose(),this.isProcessing=!1;return}else r=n;this._colorCodeMeshMap.set(o,t),this._meshIDColorCodeMap.set(t.uuid,o);const a=e?t.count:1,h=new jt(s,r,a);e?h.instanceMatrix=t.instanceMatrix:h.setMatrixAt(0,new H),t.visible=!1,t.updateWorldMatrix(!0,!1),h.applyMatrix4(t.matrixWorld),h.updateMatrix(),this.scene.add(h),this.colorMeshes.set(t.uuid,h),this.increaseColor(),this.isProcessing=!1}remove(t){if(this.isProcessing){console.log("Culler processing not finished yet.");return}this.isProcessing=!0;const e=this.components.get(me);this._currentVisibleMeshes.delete(t),this._recentlyHiddenMeshes.delete(t);const s=this.colorMeshes.get(t.uuid),i=this._meshIDColorCodeMap.get(t.uuid);if(!s||!i){this.isProcessing=!1;return}this._colorCodeMeshMap.delete(i),this._meshIDColorCodeMap.delete(t.uuid),this.colorMeshes.delete(t.uuid),s.geometry=void 0,s.material=[],e.destroy(s,!0),this._recentlyHiddenMeshes.delete(t),this._currentVisibleMeshes.delete(t),this.isProcessing=!1}getAvailableMaterial(){const{r:t,g:e,b:s,code:i}=this.getAvailableColor(),n=Ps.enabled;Ps.enabled=!1;const o=new Qt(`rgb(${t}, ${e}, ${s})`);if(!this.world.renderer)throw new Error("Renderer not found in the world!");const r=this.world.renderer.clippingPlanes,a=new Te({color:o,clippingPlanes:r,side:He});return Ps.enabled=n,{colorMaterial:a,code:i}}}const Kn=class Ei extends J{constructor(t){super(t),I(this,"onDisposed",new M),I(this,"_enabled",!0),I(this,"list",new Map),t.add(Ei.uuid,this)}get enabled(){return this._enabled}set enabled(t){this._enabled=t;for(const[e,s]of this.list)s.enabled=t}create(t,e){if(this.list.has(t.uuid))return this.list.get(t.uuid);const s=new Wa(this.components,t,e);return this.list.set(t.uuid,s),s}delete(t){const e=this.list.get(t.uuid);e&&e.dispose(),this.list.delete(t.uuid)}dispose(){this.enabled=!1,this.onDisposed.trigger(Ei.uuid),this.onDisposed.reset();for(const[t,e]of this.list)e.dispose();this.list.clear()}};I(Kn,"uuid","69f2a50d-c266-44fc-b1bd-fa4d34be89e6");let Xa=Kn;class ka{constructor(t){if(I(this,"onDisposed",new M),I(this,"onAfterUpdate",new M),I(this,"onBeforeUpdate",new M),I(this,"onResize",new M),I(this,"frontOffset",0),I(this,"overrideMaterial",new zo),I(this,"backgroundColor",new Qt(395274)),I(this,"renderer"),I(this,"enabled",!0),I(this,"world"),I(this,"_lockRotation",!0),I(this,"_camera"),I(this,"_plane"),I(this,"_size",new At(320,160)),I(this,"_tempVector1",new O),I(this,"_tempVector2",new O),I(this,"_tempTarget",new O),I(this,"down",new O(0,-1,0)),I(this,"updatePlanes",()=>{if(!this.world.renderer)throw new Error("The given world must have a renderer!");const i=[],n=this.world.renderer.three;for(const o of n.clippingPlanes)i.push(o);i.push(this._plane),this.renderer.clippingPlanes=i}),this.world=t,!this.world.renderer)throw new Error("The given world must have a renderer!");this.renderer=new Fs,this.renderer.setSize(this._size.x,this._size.y);const e=1,s=this._size.x/this._size.y;this._camera=new Ti(e*s/-2,e*s/2,e/2,e/-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 fe(this.down,200),this.updatePlanes()}get lockRotation(){return this._lockRotation}set lockRotation(t){this._lockRotation=t,t&&(this._camera.rotation.z=0)}get zoom(){return this._camera.zoom}set zoom(t){this._camera.zoom=t,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 t=this.world.scene.three,e=this.world.camera;if(!e.hasCameraControls())throw new Error("The given world must use camera controls!");if(!(t instanceof Ci))throw new Error("The given world must have a THREE.Scene as a root!");const s=e.controls;if(s.getPosition(this._tempVector1),this._camera.position.x=this._tempVector1.x,this._camera.position.z=this._tempVector1.z,this.frontOffset!==0&&(s.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){s.getTarget(this._tempTarget);const n=Math.atan2(this._tempTarget.x-this._tempVector1.x,this._tempTarget.z-this._tempVector1.z);this._camera.rotation.z=n+Math.PI}this._plane.set(this.down,this._tempVector1.y);const i=t.background;t.background=this.backgroundColor,this.renderer.render(t,this._camera),t.background=i,this.onAfterUpdate.trigger()}getSize(){return this._size}resize(t=this._size){this._size.copy(t),this.renderer.setSize(t.x,t.y);const e=t.x/t.y,s=1;this._camera.left=s*e/-2,this._camera.right=s*e/2,this._camera.top=s/2,this._camera.bottom=-s/2,this._camera.updateProjectionMatrix(),this.onResize.trigger(t)}}const $n=class Jn extends J{constructor(t){super(t),I(this,"onAfterUpdate",new M),I(this,"onBeforeUpdate",new M),I(this,"onDisposed",new M),I(this,"enabled",!0),I(this,"list",new Map),this.components.add(Jn.uuid,this)}create(t){if(this.list.has(t.uuid))throw new Error("This world already has a minimap!");const e=new ka(t);return this.list.set(t.uuid,e),e}delete(t){const e=this.list.get(t);e&&e.dispose(),this.list.delete(t)}dispose(){for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger()}update(){for(const[t,e]of this.list)e.update()}};I($n,"uuid","39ad6aad-84c8-4adf-a1e0-7f25313a9e7f");let dh=$n;class Za{constructor(t){I(this,"enabled",!1),I(this,"id","FirstPerson"),this.camera=t}set(t){if(this.enabled=t,t){if(this.camera.projection.current!=="Perspective"){this.camera.set("Orbit");return}this.setupFirstPersonCamera()}}setupFirstPersonCamera(){const t=this.camera.controls,e=new O;t.distance--,t.getPosition(e),t.minDistance=1,t.maxDistance=1,t.distance=1,t.moveTo(e.x,e.y,e.z),t.truckSpeed=50,t.mouseButtons.wheel=ot.ACTION.DOLLY,t.touches.two=ot.ACTION.TOUCH_ZOOM_TRUCK}}class Qa{constructor(t){I(this,"enabled",!0),I(this,"id","Orbit"),this.camera=t,this.activateOrbitControls()}set(t){this.enabled=t,t&&this.activateOrbitControls()}activateOrbitControls(){const t=this.camera.controls;t.minDistance=1,t.maxDistance=300;const e=new O;t.getPosition(e);const s=e.length();t.distance=s,t.truckSpeed=2;const{rotation:i}=this.camera.three,n=new O(0,0,-1).applyEuler(i),o=e.addScaledVector(n,s);t.moveTo(o.x,o.y,o.z)}}class ja{constructor(t){I(this,"enabled",!1),I(this,"id","Plan"),I(this,"mouseAction1"),I(this,"mouseAction2"),I(this,"mouseInitialized",!1),I(this,"defaultAzimuthSpeed"),I(this,"defaultPolarSpeed"),this.camera=t,this.defaultAzimuthSpeed=t.controls.azimuthRotateSpeed,this.defaultPolarSpeed=t.controls.polarRotateSpeed}set(t){this.enabled=t;const e=this.camera.controls;e.azimuthRotateSpeed=t?0:this.defaultAzimuthSpeed,e.polarRotateSpeed=t?0:this.defaultPolarSpeed,this.mouseInitialized||(this.mouseAction1=e.touches.one,this.mouseAction2=e.touches.two,this.mouseInitialized=!0),t?(e.mouseButtons.left=ot.ACTION.TRUCK,e.touches.one=ot.ACTION.TOUCH_TRUCK,e.touches.two=ot.ACTION.TOUCH_ZOOM):(e.mouseButtons.left=ot.ACTION.ROTATE,e.touches.one=this.mouseAction1,e.touches.two=this.mouseAction2)}}class qa{constructor(t){I(this,"onChanged",new M),I(this,"current","Perspective"),I(this,"camera"),I(this,"matchOrthoDistanceEnabled",!1),I(this,"_component"),I(this,"_previousDistance",-1),this._component=t,this.camera=t.three}async set(t){this.current!==t&&(t==="Orthographic"?this.setOrthoCamera():await this.setPerspectiveCamera(),this.onChanged.trigger(this.camera))}async toggle(){const t=this.current==="Perspective"?"Orthographic":"Perspective";await this.set(t)}setOrthoCamera(){if(this._component.mode===null||this._component.mode.id==="FirstPerson")return;this._previousDistance=this._component.controls.distance,this._component.controls.distance=200;const t=this.getPerspectiveDims();if(!t)return;const{width:e,height:s}=t;this.setupOrthoCamera(s,e),this.camera=this._component.threeOrtho,this.current="Orthographic"}getPerspectiveDims(){const t=this._component.currentWorld;if(!t||!t.renderer)return null;const e=new O;this._component.threePersp.getWorldDirection(e);const s=new O;this._component.controls.getTarget(s);const i=s.clone().sub(this._component.threePersp.position).dot(e),n=t.renderer.getSize(),o=n.x/n.y,r=this._component.threePersp,a=i*2*Math.atan(r.fov*(Math.PI/180)/2);return{width:a*o,height:a}}setupOrthoCamera(t,e){this._component.controls.mouseButtons.wheel=ot.ACTION.ZOOM,this._component.controls.mouseButtons.middle=ot.ACTION.ZOOM;const s=this._component.threePersp,i=this._component.threeOrtho;i.zoom=1,i.left=e/-2,i.right=e/2,i.top=t/2,i.bottom=t/-2,i.updateProjectionMatrix(),i.position.copy(s.position),i.quaternion.copy(s.quaternion),this._component.controls.camera=i}getDistance(){const t=this._component.threePersp,e=this._component.threeOrtho;return(e.top-e.bottom)/e.zoom/(2*Math.atan(t.fov*(Math.PI/180)/2))}async setPerspectiveCamera(){this._component.controls.mouseButtons.wheel=ot.ACTION.DOLLY,this._component.controls.mouseButtons.middle=ot.ACTION.DOLLY;const t=this._component.threePersp,e=this._component.threeOrtho;t.position.copy(e.position),t.quaternion.copy(e.quaternion),this._component.controls.mouseButtons.wheel=ot.ACTION.DOLLY,this.matchOrthoDistanceEnabled?this._component.controls.distance=this.getDistance():this._component.controls.distance=this._previousDistance,await this._component.controls.zoomTo(1),t.updateProjectionMatrix(),this._component.controls.camera=t,this.camera=t,this.current="Perspective"}}class Eh extends Ve{constructor(t){super(t),I(this,"projection"),I(this,"threeOrtho"),I(this,"threePersp"),I(this,"_userInputButtons",{}),I(this,"_frustumSize",50),I(this,"_navigationModes",new Map),I(this,"_mode",null),I(this,"previousSize",null),this.threePersp=this.three,this.threeOrtho=this.newOrthoCamera(),this.projection=new qa(this),this.onAspectUpdated.add(()=>{this.setOrthoPerspCameraAspect()}),this.projection.onChanged.add(e=>{this.three=e,this.updateAspect()}),this.onWorldChanged.add(({action:e})=>{e==="added"&&(this._navigationModes.clear(),this._navigationModes.set("Orbit",new Qa(this)),this._navigationModes.set("FirstPerson",new Za(this)),this._navigationModes.set("Plan",new ja(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(t){if(this.mode!==null&&this.mode.id!==t){if(this.mode.set(!1),!this._navigationModes.has(t))throw new Error("The specified mode does not exist!");this._mode=this._navigationModes.get(t),this.mode.set(!0)}}async fit(t,e=1.5){if(!this.enabled)return;const s=Number.MAX_VALUE,i=Number.MIN_VALUE,n=new O(s,s,s),o=new O(i,i,i);for(const l of t){const u=new st().setFromObject(l);u.min.xo.x&&(o.x=u.max.x),u.max.y>o.y&&(o.y=u.max.y),u.max.z>o.z&&(o.z=u.max.z)}const r=new st(n,o),a=new O;r.getSize(a);const h=new O;r.getCenter(h);const d=Math.max(a.x,a.y,a.z)*e,E=new Os(h,d);await this.controls.fitToSphere(E,!0)}setUserInput(t){t?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 t=window.innerWidth/window.innerHeight;return new Ti(this._frustumSize*t/-2,this._frustumSize*t/2,this._frustumSize/2,this._frustumSize/-2,.1,1e3)}setOrthoPerspCameraAspect(){if(!this.currentWorld||!this.currentWorld.renderer||!this.previousSize)return;const t=this.currentWorld.renderer.getSize(),e=this.threeOrtho.top,s=this.threeOrtho.right,i=t.y/this.previousSize.y,n=t.x/this.previousSize.x,o=e*i,r=s*n;this.threeOrtho.left=-r,this.threeOrtho.right=r,this.threeOrtho.top=o,this.threeOrtho.bottom=-o,this.threeOrtho.updateProjectionMatrix(),this.previousSize.copy(t)}}const Ka=new Map([[fi,{forRelating:"IsDecomposedBy",forRelated:"Decomposes"}],[Sn,{forRelating:"AssociatedTo",forRelated:"HasAssociations"}],[Nn,{forRelating:"ClassificationForObjects",forRelated:"HasAssociations"}],[wn,{forRelating:"IsGroupedBy",forRelated:"HasAssignments"}],[mi,{forRelated:"IsDefinedBy",forRelating:"DefinesOcurrence"}],[yn,{forRelated:"IsTypedBy",forRelating:"Types"}],[Ln,{forRelated:"IsDefinedBy",forRelating:"Defines"}],[Ri,{forRelated:"ContainedInStructure",forRelating:"ContainsElements"}]]),to=class ui extends J{constructor(t){super(t),I(this,"onDisposed",new M),I(this,"onRelationsIndexed",new M),I(this,"relationMaps",{}),I(this,"enabled",!0),I(this,"_relToAttributesMap",Ka),I(this,"_inverseAttributes",["IsDecomposedBy","Decomposes","AssociatedTo","HasAssociations","ClassificationForObjects","IsGroupedBy","HasAssignments","IsDefinedBy","DefinesOcurrence","IsTypedBy","Types","Defines","ContainedInStructure","ContainsElements"]),I(this,"_ifcRels",[fi,Sn,Nn,wn,mi,yn,Ln,Ri]),I(this,"onFragmentsDisposed",e=>{delete this.relationMaps[e.groupID]}),this.components.add(ui.uuid,this),t.get(Et).onFragmentsDisposed.add(this.onFragmentsDisposed)}indexRelations(t,e,s,i){const n=Object.keys(e).find(E=>E.startsWith("Relating")),o=Object.keys(e).find(E=>E.startsWith("Related"));if(!(n&&o))return;const r=e[n].value,a=e[o].map(E=>E.value),h=t.get(r)??new Map,d=this.getAttributeIndex(i);d&&(h.set(d,a),t.set(r,h));for(const E of a){const l=t.get(E)??new Map,u=this.getAttributeIndex(s);if(!u)continue;const C=l.get(u)??[];C.push(r),l.set(u,C),t.set(E,l)}}getAttributeIndex(t){const e=this._inverseAttributes.indexOf(t);return e===-1?null:e}setRelationMap(t,e){this.relationMaps[t.uuid]=e,this.onRelationsIndexed.trigger({modelID:t.uuid,relationsMap:e})}async process(t){if(!t.hasProperties)throw new Error("FragmentsGroup properties not found");let e=this.relationMaps[t.uuid];if(e)return e;e=new Map;for(const s of this._ifcRels){const i=await t.getAllPropertiesOfType(s);if(!i)continue;const n=this._relToAttributesMap.get(s);if(!n)continue;const{forRelated:o,forRelating:r}=n;for(const a in i){const h=i[a];this.indexRelations(e,h,o,r)}}return this.setRelationMap(t,e),e}async processFromWebIfc(t,e){const s=new Map;for(const i of this._ifcRels){const n=this._relToAttributesMap.get(i);if(!n)continue;const{forRelated:o,forRelating:r}=n,a=t.GetLineIDsWithType(e,i);for(let h=0;hi.x&&(i.x=o.x),o.y>i.y&&(i.y=o.y),o.z>i.z&&(i.z=o.z);return new st(e,s)}dispose(){const t=this.components.get(me);for(const e of this._meshes)t.destroy(e);this._meshes=[],this.onDisposed.trigger(Lt.uuid),this.onDisposed.reset()}get(){const t=this._absoluteMin.clone(),e=this._absoluteMax.clone();return new st(t,e)}getSphere(){const t=this._absoluteMin.clone(),e=this._absoluteMax.clone(),s=Math.abs((e.x-t.x)/2),i=Math.abs((e.y-t.y)/2),n=Math.abs((e.z-t.z)/2),o=new O(t.x+s,t.y+i,t.z+n),r=o.distanceTo(t);return new Os(o,r)}getMesh(){const t=new st(this._absoluteMin,this._absoluteMax),e=Lt.getDimensions(t),{width:s,height:i,depth:n,center:o}=e,r=new it(s,i,n),a=new D(r);return this._meshes.push(a),a.position.copy(o),a}reset(){this._absoluteMin=Lt.newBound(!0),this._absoluteMax=Lt.newBound(!1)}add(t){for(const e of t.items)this.addMesh(e.mesh)}addMesh(t,e){if(!t.geometry.index)return;const s=Lt.getFragmentBounds(t);t.updateMatrixWorld();const i=t.matrixWorld,n=new H,o=t instanceof jt,r=new Set;if(e&&t instanceof xo)for(const a of e){const h=t.fragment.getInstancesIDs(a);if(h)for(const d of h)r.add(d)}else r.add(0);for(const a of r){const h=s.min.clone(),d=s.max.clone();o&&(t.getMatrixAt(a,n),h.applyMatrix4(n),d.applyMatrix4(n)),h.applyMatrix4(i),d.applyMatrix4(i),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),E>o.y&&(o.y=E),l>o.z&&(o.z=l)}return new st(n,o)}};I(io,"uuid","d1444724-dba6-4cdd-a0c7-68ee1450d166");let uh=io;const no=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,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]),oo=class ro extends J{constructor(t){super(t),I(this,"enabled",!0),t.add(ro.uuid,this)}async export(t,e,s=!1,i=!0){const n={},o=new Set(t.GetIfcEntityList(e)),r=new Set([Fi,Ai,gi,Oi,Kt]);for(const a of r)o.add(a);for(const a of o){if(no.has(a))continue;const h=r.has(a)&&i,d=t.GetLineIDsWithType(e,a);for(const E of d){const l=t.GetLine(0,E,h,s);n[l.expressID]=l}}return n}};I(oo,"uuid","b32c4332-cd67-436e-ba7f-196646c7a635");let $a=oo;const ao={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 qt{static async getUnits(t){var e,s,i;const{IFCUNITASSIGNMENT:n}=wt,o=await t.getAllPropertiesOfType(n);if(!o)return 1;const r=Object.keys(o),a=o[parseInt(r[0],10)];for(const h of a.Units){if(h.value===void 0||h.value===null)continue;const d=await t.getProperties(h.value);if(!d||!d.UnitType||!d.UnitType.value||d.UnitType.value!=="LENGTHUNIT")continue;let E=1,l=1;return d.Name.value==="METRE"&&(l=1),d.Name.value==="FOOT"&&(l=.3048),((e=d.Prefix)==null?void 0:e.value)==="MILLI"?E=.001:((s=d.Prefix)==null?void 0:s.value)==="CENTI"?E=.01:((i=d.Prefix)==null?void 0:i.value)==="DECI"&&(E=.1),l*E}return 1}static async findItemByGuid(t,e){var s;const i=t.getAllPropertiesIDs();for(const n of i){const o=await t.getProperties(n);if(o&&((s=o.GlobalId)==null?void 0:s.value)===e)return o}return null}static async getRelationMap(t,e,s){var i;const n=s??(async()=>{}),o={},r=t.getAllPropertiesIDs();for(const a of r){const h=await t.getProperties(a);if(!h)continue;const d=h.type===e,E=Object.keys(h).find(m=>m.startsWith("Relating")),l=Object.keys(h).find(m=>m.startsWith("Related"));if(!(d&&E&&l))continue;const u=await t.getProperties((i=h[E])==null?void 0:i.value),C=h[l];if(!u||!C||!(C&&Array.isArray(C)))continue;const T=C.map(m=>m.value);await n(u.expressID,T),o[u.expressID]=T}return o}static async getQsetQuantities(t,e,s){const i=s??(()=>{}),n=await t.getProperties(e);return!n||n.type!==Uo?null:(n.Quantities??[{}]).map(o=>(o.value&&i(o.value),o.value)).filter(o=>o!==null)}static async getPsetProps(t,e,s){const i=s??(()=>{}),n=await t.getProperties(e);return!n||n.type!==Js?null:(n.HasProperties??[{}]).map(o=>(o.value&&i(o.value),o.value)).filter(o=>o!==null)}static async getPsetRel(t,e){var s;if(!await t.getProperties(e))return null;const i=await t.getAllPropertiesOfType(mi);if(!i)return null;const n=Object.values(i);let o=null;for(const r of n)((s=r.RelatingPropertyDefinition)==null?void 0:s.value)===e&&(o=r.expressID);return o}static async getQsetRel(t,e){return qt.getPsetRel(t,e)}static async getEntityName(t,e){var s;const i=await t.getProperties(e);if(!i)return{key:null,name:null};const n=Object.keys(i).find(r=>r.endsWith("Name"))??null,o=n?(s=i[n])==null?void 0:s.value:null;return{key:n,name:o}}static async getQuantityValue(t,e){const s=await t.getProperties(e);if(!s)return{key:null,value:null};const i=Object.keys(s).find(o=>o.endsWith("Value"))??null;let n;return i===null||s[i]===void 0||s[i]===null?n=null:n=s[i].value,{key:i,value:n}}static isRel(t){return ao[t].startsWith("IFCREL")}static async attributeExists(t,e,s){const i=await t.getProperties(e);return i?Object.keys(i).includes(s):!1}static async groupEntitiesByType(t,e){var s;const i=new Map;for(const n of e){const o=await t.getProperties(n);if(!o)continue;const r=o.type;i.get(r)||i.set(r,new Set),(s=i.get(r))==null||s.add(n)}return i}}class Ja{constructor(){I(this,"factor",1),I(this,"complement",1)}apply(t){const e=this.getScaleMatrix().multiply(t);t.copy(e)}setUp(t){var e,s,i;this.factor=1;const n=this.getLengthUnits(t);if(!n)return;const o=n==null,r=n.Name===void 0||n.Name===null;o||r||(n.Name.value==="FOOT"&&(this.factor=.3048),((e=n.Prefix)==null?void 0:e.value)==="MILLI"?this.complement=.001:((s=n.Prefix)==null?void 0:s.value)==="CENTI"?this.complement=.01:((i=n.Prefix)==null?void 0:i.value)==="DECI"&&(this.complement=.01))}getLengthUnits(t){try{const e=t.GetLineIDsWithType(0,qo).get(0),s=t.GetLine(0,e);for(const i of s.Units){if(!i||i.value===null||i.value===void 0)continue;const n=t.GetLine(0,i.value);if(n.UnitType&&n.UnitType.value==="LENGTHUNIT")return n}return null}catch{return console.log("Could not get units"),null}}getScaleMatrix(){const t=this.factor;return new H().fromArray([t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1])}}class ho{constructor(){I(this,"itemsByFloor",{}),I(this,"_units",new Ja)}setUp(t){this._units.setUp(t),this.cleanUp();try{const e=t.GetLineIDsWithType(0,Ri),s=new Set,i=t.GetLineIDsWithType(0,Kt);for(let h=0;h{this.getMesh(n,e)});for(const n of this._visitedFragments){const{index:o,fragment:r}=n[1];e.keyFragments.set(o,r.id)}for(const n of e.items){const o=this._fragmentInstances.get(n.id);if(!o)throw new Error("Fragment not found!");const r=[];for(const[a,h]of o)r.push(h);n.add(r)}const i=this.webIfc.GetCoordinationMatrix(0);return e.coordinationMatrix.fromArray(i),e.civilData=this._civil.read(this.webIfc),e}getMesh(t,e){const s=t.geometries.size(),i=t.expressID;for(let n=0;no.value!==s),await t.setProperties(s,null),this.registerChange(t,e,s))}async addElementToPset(t,e,...s){const i=await qt.getPsetRel(t,e);if(!i)return;const n=await t.getProperties(i);if(!n)return;for(const r of s){const a=new ke(r);n.RelatedObjects.push(a),this.onElementToPset.trigger({model:t,psetID:e,elementID:r})}this.registerChange(t,e);const o=this.components.get(Ns);for(const r of s)o.addEntityRelations(t,r,"IsDefinedBy",e)}async addPropToPset(t,e,...s){const i=await t.getProperties(e);if(i){for(const n of s){if(i.HasProperties.includes(n))continue;const o=new ke(n);i.HasProperties.push(o),this.onPropToPset.trigger({model:t,psetID:e,propID:n})}this.registerChange(t,e)}}async saveToIfc(t,e){const s=this.components.get(th),i=s.webIfc,n=await s.readIfcFile(e),o=this.changeMap[t.uuid]??[];for(const a of o){const h=await t.getProperties(a);if(h)try{i.WriteLine(n,h)}catch{}else try{i.DeleteLine(n,a)}catch{}}const r=i.SaveModel(n);return s.webIfc.CloseModel(n),s.cleanUp(),r}async setAttributeListener(t,e,s){this.attributeListeners[t.uuid]||(this.attributeListeners[t.uuid]={});const i=this.attributeListeners[t.uuid][e]?this.attributeListeners[t.uuid][e][s]:null;if(i)return i;const n=await t.getProperties(e);if(!n)throw new Error(`Entity with expressID ${e} doesn't exists.`);const o=n[s];if(Array.isArray(o)||!o)throw new Error(`Attribute ${s} is array or null, and it can't have a listener.`);const r=o.value;if(r===void 0||r==null)throw new Error(`Attribute ${s} has a badly defined handle.`);const a=new M;return Object.defineProperty(n[s],"value",{get(){return this._value},async set(h){this._value=h,a.trigger(h)}}),n[s].value=r,this.attributeListeners[t.uuid][e]||(this.attributeListeners[t.uuid][e]={}),this.attributeListeners[t.uuid][e][s]=a,a}increaseMaxID(t){return t.ifcMetadata.maxExpressID++,t.ifcMetadata.maxExpressID}newGUID(t){const e=ue.getIFCSchema(t);return new wt[e].IfcGloballyUniqueId(Pi.create())}async getOwnerHistory(t){const e=await t.getAllPropertiesOfType(bo);if(!e)throw new Error("No OwnerHistory was found.");const s=Object.keys(e).map(o=>parseInt(o,10)),i=e[s[0]],n=new ke(i.expressID);return{ownerHistory:i,ownerHistoryHandle:n}}registerChange(t,...e){this.changeMap[t.uuid]||(this.changeMap[t.uuid]=new Set);for(const s of e)this.changeMap[t.uuid].add(s),this.onDataChanged.trigger({model:t,expressID:s})}async newSingleProperty(t,e,s,i){const n=ue.getIFCSchema(t),o=new wt[n].IfcIdentifier(s),r=new wt[n][e](i),a=new wt[n].IfcPropertySingleValue(o,null,r,null);return a.expressID=this.increaseMaxID(t),await this.setData(t,a),a}};I(eh,"uuid","58c2d9f0-183c-48d6-a402-dfcf5b9a34df");const Io=class po extends J{constructor(t){super(t),I(this,"enabled",!0),I(this,"list",{}),I(this,"onDisposed",new M),I(this,"onFragmentsDisposed",e=>{const{groupID:s,fragmentIDs:i}=e;for(const n in this.list){const o=this.list[n],r=Object.keys(o);if(r.includes(s))delete o[s],Object.values(o).length===0&&delete this.list[n];else for(const a of r){const h=o[a];for(const d of i)delete h.map[d];Object.values(h).length===0&&delete o[a]}}}),t.add(po.uuid,this),t.get(Et).onFragmentsDisposed.add(this.onFragmentsDisposed)}dispose(){this.list={},this.components.get(Et).onFragmentsDisposed.remove(this.onFragmentsDisposed),this.onDisposed.trigger(),this.onDisposed.reset()}remove(t){for(const e in this.list){const s=this.list[e];for(const i in s){const n=s[i];delete n.map[t]}}}find(t){const e=this.components.get(Et);if(!t){const o={};for(const[r,a]of e.list)o[r]=new Set(a.ids);return o}const s=Object.keys(t).length,i={};for(const o in t){const r=t[o];if(!this.list[o]){console.warn(`Classification ${o} does not exist.`);continue}for(const a of r){const h=this.list[o][a];if(h)for(const d in h.map){i[d]||(i[d]=new Map);for(const E of h.map[d]){const l=i[d].get(E);l===void 0?i[d].set(E,1):i[d].set(E,l+1)}}}}const n={};for(const o in i){const r=i[o];for(const[a,h]of r){if(h===void 0)throw new Error("Malformed fragments map!");h===s&&(n[o]||(n[o]=new Set),n[o].add(a))}}return n}byModel(t,e){this.list.models||(this.list.models={});const s=this.list.models;s[t]||(s[t]={map:{},id:null,name:t});const i=s[t];for(const[n,o]of e.data){const r=o[0];for(const a of r){const h=e.keyFragments.get(a);h&&(i.map[h]||(i.map[h]=new Set),i.map[h].add(n))}}}async byPredefinedType(t){var e;this.list.predefinedTypes||(this.list.predefinedTypes={});const s=this.list.predefinedTypes,i=t.getAllPropertiesIDs();for(const n of i){const o=await t.getProperties(n);if(!o)continue;const r=String((e=o.PredefinedType)==null?void 0:e.value).toUpperCase();s[r]||(s[r]={map:{},id:null,name:r});const a=s[r];for(const[h,d]of t.data){const E=d[0];for(const l of E){const u=t.keyFragments.get(l);if(!u)throw new Error("Fragment ID not found!");a.map[u]||(a.map[u]=new Set),a.map[u].add(o.expressID)}}}}byEntity(t){this.list.entities||(this.list.entities={});for(const[e,s]of t.data){const i=s[1][1],n=ao[i];this.saveItem(t,"entities",n,e)}}async byIfcRel(t,e,s){qt.isRel(e)&&await qt.getRelationMap(t,e,async(i,n)=>{const{name:o}=await qt.getEntityName(t,i);for(const r of n)this.saveItem(t,s,o??"NO REL NAME",r)})}async bySpatialStructure(t,e={}){var s,i;const n=this.components.get(Ns),o=n.relationMaps[t.uuid];if(!o)throw new Error(`Classifier: model relations of ${t.name||t.uuid} have to exists to group by spatial structure.`);const r="spatialStructures",a=e.useProperties===void 0||e.useProperties;for(const[h]of o){if(e.isolate){const u=t.data.get(h);if(!u)continue;const C=u[1][1];if(C===void 0||!e.isolate.has(C))continue}const d=n.getEntityRelations(t,h,"Decomposes");if(d)for(const u of d){let C=u.toString();if(a){const T=await t.getProperties(u);if(!T)continue;C=(s=T.Name)==null?void 0:s.value}this.saveItem(t,r,C,h,u)}const E=n.getEntityRelations(t,h,"ContainsElements");if(!E)continue;let l=h.toString();if(a){const u=await t.getProperties(h);if(!u)continue;l=(i=u.Name)==null?void 0:i.value}for(const u of E){this.saveItem(t,r,l,u,h);const C=n.getEntityRelations(t,Number(u),"IsDecomposedBy");if(C)for(const T of C)this.saveItem(t,r,l,T,h)}}}setColor(t,e,s=!1){const i=this.components.get(Et);for(const n in t){const o=i.list.get(n);if(!o)continue;const r=t[n];o.setColor(e,r,s)}}resetColor(t){const e=this.components.get(Et);for(const s in t){const i=e.list.get(s);if(!i)continue;const n=t[s];i.resetColor(n)}}saveItem(t,e,s,i,n=null){this.list[e]||(this.list[e]={});const o=t.data.get(i);if(o)for(const r of o[0]){const a=t.keyFragments.get(r);if(a){const h=this.list[e];h[s]||(h[s]={map:{},id:n,name:s}),h[s].map[a]||(h[s].map[a]=new Set),h[s].map[a].add(i)}}}};I(Io,"uuid","e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");let sh=Io;const Co=class To extends J{constructor(t){super(t),I(this,"onDisposed",new M),I(this,"enabled",!0),I(this,"height",10),I(this,"groupName","spatialStructures"),I(this,"list",new Set),t.add(To.uuid,this)}dispose(){this.list.clear(),this.onDisposed.trigger(),this.onDisposed.reset()}set(t){if(!this.enabled)return;const e=this.components.get(sh),s=this.components.get(Et),i=t?1:-1;let n=0;const o=e.list[this.groupName],r=new H;for(const a in o){r.elements[13]=n*i*this.height;for(const h in o[a].map){const d=s.list.get(h),E=a+h,l=this.list.has(E);if(!d||t&&l||!t&&!l)continue;t?this.list.add(E):this.list.delete(E);const u=o[a].map[h];d.applyTransform(u,r),d.mesh.computeBoundingSphere(),d.mesh.computeBoundingBox()}n++}}};I(Co,"uuid","d260618b-ce88-4c7d-826c-6debb91de3e2");let Ih=Co;const mo=class fo extends J{constructor(t){super(t),I(this,"enabled",!0),this.components.add(fo.uuid,this)}set(t,e){const s=this.components.get(Et);if(!e){for(const[i,n]of s.list)n&&(n.setVisibility(t),this.updateCulledVisibility(n));return}for(const i in e){const n=e[i],o=s.list.get(i);o&&(o.setVisibility(t,n),this.updateCulledVisibility(o))}}isolate(t){this.set(!1),this.set(!0,t)}updateCulledVisibility(t){const e=this.components.get(Xa);for(const[s,i]of e.list){const n=i.colorMeshes.get(t.id);n&&(n.count=t.mesh.count)}}};I(mo,"uuid","dd9ccf2d-8a21-4821-b7f6-2949add16a29");let ph=mo;class ih extends Ui{constructor(){super(...arguments),I(this,"minGeometrySize",10),I(this,"minAssetsSize",1e3)}}const Ro=class Fo extends J{constructor(t){super(t),I(this,"onGeometryStreamed",new M),I(this,"onAssetStreamed",new M),I(this,"onProgress",new M),I(this,"onIfcLoaded",new M),I(this,"onDisposed",new M),I(this,"settings",new ih),I(this,"enabled",!0),I(this,"webIfc",new Ce),I(this,"_spatialTree",new ho),I(this,"_metaData",new lo),I(this,"_visitedGeometries",new Map),I(this,"_streamSerializer",new Bo),I(this,"_geometries",new Map),I(this,"_geometryCount",0),I(this,"_civil",new co),I(this,"_groupSerializer",new Pn),I(this,"_assets",[]),I(this,"_meshesWithHoles",new Set),this.components.add(Fo.uuid,this),this.settings.excludedCategories.add(Mn)}dispose(){this.onIfcLoaded.reset(),this.onGeometryStreamed.reset(),this.onAssetStreamed.reset(),this.webIfc.Dispose(),this.webIfc=null,this.onDisposed.trigger(),this.onDisposed.reset()}async streamFromBuffer(t){await this.readIfcFile(t),await this.streamAllGeometries(),this.cleanUp()}async streamFromCallBack(t){await this.streamIfcFile(t),await this.streamAllGeometries(),this.cleanUp()}async readIfcFile(t){const{path:e,absolute:s,logLevel:i}=this.settings.wasm;this.webIfc.SetWasmPath(e,s),await this.webIfc.Init(),i&&this.webIfc.SetLogLevel(i),this.webIfc.OpenModel(t,this.settings.webIfc)}async streamIfcFile(t){const{path:e,absolute:s,logLevel:i}=this.settings.wasm;this.webIfc.SetWasmPath(e,s),await this.webIfc.Init(),i&&this.webIfc.SetLogLevel(i),this.webIfc.OpenModelFromCallback(t,this.settings.webIfc)}async streamAllGeometries(){const{minGeometrySize:t,minAssetsSize:e}=this.settings;this._spatialTree.setUp(this.webIfc);const s=this.webIfc.GetIfcEntityList(0),i=[[]],n=new Un;n.ifcMetadata={name:"",description:"",...this._metaData.getNameInfo(this.webIfc),...this._metaData.getDescriptionInfo(this.webIfc),schema:this.webIfc.GetModelSchema(0)||"IFC2X3",maxExpressID:this.webIfc.GetMaxExpressID(0)};let o=0,r=0;for(const C of s){if(!this.webIfc.IsIfcElement(C)&&C!==Kt||this.settings.excludedCategories.has(C))continue;const T=this.webIfc.GetLineIDsWithType(0,C),m=T.size();for(let f=0;ft&&(o=0,r++,i.push([]));const R=T.get(f);i[r].push(R);const A=this.webIfc.GetLine(0,R);if(A.GlobalId){const F=(A==null?void 0:A.GlobalId.value)||(A==null?void 0:A.GlobalId);n.globalToExpressIDs.set(F,R)}const p=this._spatialTree.itemsByFloor[R]||0;n.data.set(R,[[],[p,C]]),o++}}this._spatialTree.cleanUp();let a=.01,h=0;for(const C of i){h++,this.webIfc.StreamMeshes(0,C,m=>{this.getMesh(this.webIfc,m,n)}),this._geometryCount>t&&await this.streamGeometries(),this._assets.length>e&&await this.streamAssets();const T=h/i.length;T>a&&(a+=.01,a=Math.max(a,T),this.onProgress.trigger(Math.round(a*100)/100))}this._geometryCount&&await this.streamGeometries(),this._assets.length&&await this.streamAssets();const{opaque:d,transparent:E}=n.geometryIDs;for(const[C,{index:T,uuid:m}]of this._visitedGeometries)n.keyFragments.set(T,m),(C>1?d:E).set(C,T);Eo.get(n,this.webIfc);const l=this.webIfc.GetCoordinationMatrix(0);n.coordinationMatrix.fromArray(l),n.civilData=this._civil.read(this.webIfc);const u=this._groupSerializer.export(n);this.onIfcLoaded.trigger(u),n.dispose(!0)}cleanUp(){this.webIfc.Dispose(),this.webIfc=null,this.webIfc=new Ce,this._visitedGeometries.clear(),this._geometries.clear(),this._assets=[],this._meshesWithHoles.clear()}getMesh(t,e,s){const i=e.geometries.size(),n=e.expressID,o={id:n,geometries:[]};for(let r=0;ri&&(i=Math.round(i*100)/100,await this.onProgress.trigger(i),i+=.01)}await this.onProgress.trigger(1);const o=await this.components.get(Ns).processFromWebIfc(this.webIfc,0);await this.onIndicesStreamed.trigger(o)}cleanUp(){this.webIfc.Dispose(),this.webIfc=null,this.webIfc=new Ce}}I(oh,"uuid","88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");const Ao=class go extends J{constructor(t){super(t),I(this,"enabled",!0),t.add(go.uuid,this)}static distanceFromPointToLine(t,e,s,i=!1){const n=new Ft,o=new O;return n.set(e,s),n.closestPointToPoint(t,i,o),o.distanceTo(t)}getFace(t,e,s){if(!t.geometry.index)throw new Error("Geometry must be indexed!");const i=new Map,n=t.geometry.index.array,{plane:o}=this.getFaceData(e,s,t),r=[];for(let E=0;Ep.id);if(!u.size){const p=a++;for(const{id:F}of l)h.set(F,p);d.set(p,{edges:new Set(C),indices:new Set([E])});continue}let T=null;const m=new Set,f=new Set(C);for(const[p,F]of u){T===null?T=F:F!==T&&m.add(F),h.delete(p);const{edges:g}=d.get(F);g.delete(p),f.delete(p)}if(T===null)throw new Error("Error computing face!");const R=d.get(T),{indices:A}=R;A.add(E);for(const p of f){h.set(p,T);const{edges:F}=R;F.add(p)}for(const p of m){const F=d.get(p),{edges:g,indices:_}=F,S=d.get(T),{edges:w,indices:y}=S;for(const L of g)w.add(L),h.set(L,T);for(const L of _)y.add(L);d.delete(p)}}for(const[E,{indices:l,edges:u}]of d)if(l.has(e)){const C=[];for(const T of u){const m=i.get(T);C.push(m)}return{edges:C,indices:l}}return null}getVerticesAndNormal(t,e,s){if(!t.geometry.index)throw new Error("Geometry must be indexed!");const i=t.geometry.index.array,n=t.geometry.attributes.position.array,o=t.geometry.attributes.normal.array,r=i[e*3]*3,a=i[e*3+1]*3,h=i[e*3+2]*3,d=new O(n[r],n[r+1],n[r+2]),E=new O(n[a],n[a+1],n[a+2]),l=new O(n[h],n[h+1],n[h+2]),u=new O(o[r],o[r+1],o[r+2]),C=new O(o[a],o[a+1],o[a+2]),T=new O(o[h],o[h+1],o[h+2]),m=(u.x+C.x+T.x)/3,f=(u.y+C.y+T.y)/3,R=(u.z+C.z+T.z)/3,A=new O(m,f,R);if(s!==void 0&&t instanceof jt){const p=new H;t.getMatrixAt(s,p);const F=new H;F.extractRotation(p),A.applyMatrix4(F),d.applyMatrix4(p),E.applyMatrix4(p),l.applyMatrix4(p)}return{p1:d,p2:E,p3:l,faceNormal:A}}round(t){t.x=Math.trunc(t.x*1e3)/1e3,t.y=Math.trunc(t.y*1e3)/1e3,t.z=Math.trunc(t.z*1e3)/1e3}getVolumeFromFragments(t){const e=this.components.get(Et),s=new H,i=[];for(const o in t){const r=e.list.get(o);if(!r)continue;const a=t[o];let h=0;for(const l of a){const u=r.getInstancesIDs(l);u&&(h+=u.size)}const d=new jt(r.mesh.geometry,void 0,h);let E=0;for(const l of a){const u=r.getInstancesIDs(l);if(u)for(const C of u)r.mesh.getMatrixAt(C,s),d.setMatrixAt(E++,s)}i.push(d)}const n=this.getVolumeFromMeshes(i);for(const o of i)o.geometry=null,o.material=[],o.dispose();return n}getVolumeFromMeshes(t){let e=0;for(const s of t)e+=this.getVolumeOfMesh(s);return e}getFaceData(t,e,s){const i=this.getVerticesAndNormal(s,t,e),{p1:n,p2:o,p3:r,faceNormal:a}=i;this.round(n),this.round(o),this.round(r),this.round(a);const h=[{id:`${n.x}|${n.y}|${n.z}`,value:n},{id:`${o.x}|${o.y}|${o.z}`,value:o},{id:`${r.x}|${r.y}|${r.z}`,value:r}];h.sort((R,A)=>R.idA.id?1:0);const[{id:d,value:E},{id:l,value:u},{id:C,value:T}]=h,m=[{id:`${d}|${l}`,distance:E.distanceTo(u),points:[E,u]},{id:`${l}|${C}`,distance:u.distanceTo(T),points:[u,T]},{id:`${d}|${C}`,distance:E.distanceTo(T),points:[E,T]}],f=new fe;return f.setFromNormalAndCoplanarPoint(a,n),f.constant=Math.round(f.constant*10)/10,{plane:f,edges:m}}getVolumeOfMesh(t){let e=0;const s=new O,i=new O,n=new O,{index:o}=t.geometry,r=t.geometry.attributes.position.array;if(!o)return console.warn("Geometry must be indexed to compute its volume!"),0;const a=[];if(t instanceof jt)for(let d=0;dn.create();window.onkeydown=o=>{(o.code==="Delete"||o.code==="Backspace")&&n.delete()};const s=new p;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end());f.init();const a=l.create(()=>c` +import{B as m,M as b,a as d}from"./web-ifc-api-CfQNUy7g.js";import{S as p}from"./stats.min-BpIepu9J.js";import{p as u,C as h,i as w,W as k,d as g}from"./index-CrrO1BJs.js";import{m as f,t as l,a as c}from"./index-tywNknxv.js";import{S as D,_ as y}from"./index-BREiuDZQ.js";const r=document.getElementById("container"),t=new u,v=t.get(h),e=v.create();e.scene=new w(t);e.renderer=new D(t,r);e.camera=new k(t);t.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const x=t.get(g);x.create(e);e.scene.three.background=null;const M=new m(3,3,3),B=new b({color:"#6528D7"}),i=new d(M,B);i.position.set(0,1.5,0);e.scene.three.add(i);e.meshes.add(i);const n=t.get(y);n.world=e;n.enabled=!0;n.snapDistance=1;r.ondblclick=()=>n.create();window.onkeydown=o=>{(o.code==="Delete"||o.code==="Backspace")&&n.delete()};const s=new p;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end());f.init();const a=l.create(()=>c` Create dimension: Double click diff --git a/examples/assets/marker.js b/examples/assets/marker.js index cd5c08b6c..21f9942b1 100644 --- a/examples/assets/marker.js +++ b/examples/assets/marker.js @@ -1 +1 @@ -import{V as m}from"./web-ifc-api-CfQNUy7g.js";import{p as i,C as l,i as p,W as f,d as h}from"./index-D2xchnNe.js";import{B as w,n as g}from"./index-Bpjba_Wq.js";import{S as u}from"./stats.min-BpIepu9J.js";const r=document.getElementById("container"),n=new i,y=n.get(l),e=y.create();e.scene=new p(n);e.renderer=new w(n,r);e.camera=new f(n);n.init();e.camera.controls.setLookAt(5,5,5,0,0,0);r.appendChild(e.renderer.three2D.domElement);const B=n.get(h);B.create(e);e.scene.three.background=null;const a=n.get(g);a.threshold=10;for(let o=0;o<20;o++){const s=Math.random()*5,d=Math.random()*5,c=Math.random()*5;a.create(e,"🚀",new m(s,d,c))}const t=new u;t.showPanel(2);document.body.append(t.dom);t.dom.style.left="0px";t.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>t.begin());e.renderer.onAfterUpdate.add(()=>t.end()); +import{V as m}from"./web-ifc-api-CfQNUy7g.js";import{p as i,C as l,i as p,W as f,d as h}from"./index-CrrO1BJs.js";import{B as w,n as g}from"./index-BREiuDZQ.js";import{S as u}from"./stats.min-BpIepu9J.js";const r=document.getElementById("container"),n=new i,y=n.get(l),e=y.create();e.scene=new p(n);e.renderer=new w(n,r);e.camera=new f(n);n.init();e.camera.controls.setLookAt(5,5,5,0,0,0);r.appendChild(e.renderer.three2D.domElement);const B=n.get(h);B.create(e);e.scene.three.background=null;const a=n.get(g);a.threshold=10;for(let o=0;o<20;o++){const s=Math.random()*5,d=Math.random()*5,c=Math.random()*5;a.create(e,"🚀",new m(s,d,c))}const t=new u;t.showPanel(2);document.body.append(t.dom);t.dom.style.left="0px";t.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>t.begin());e.renderer.onAfterUpdate.add(()=>t.end()); diff --git a/examples/assets/measurementUtils.js b/examples/assets/measurementUtils.js index bb30172cf..8d0caa22c 100644 --- a/examples/assets/measurementUtils.js +++ b/examples/assets/measurementUtils.js @@ -1 +1 @@ -import{ay as i,L as m,f,a as l}from"./web-ifc-api-CfQNUy7g.js";import{S as p}from"./stats.min-BpIepu9J.js";import{p as g,C as u,i as w,n as h,W as y,d as b,h as v,N as I,H as L}from"./index-D2xchnNe.js";const x=document.getElementById("container"),t=new g,B=t.get(u),e=B.create();e.scene=new w(t);e.renderer=new h(t,x);e.camera=new y(t);t.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const E=t.get(b);E.create(e);e.scene.three.background=null;const A=new v(t),S=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),U=await S.arrayBuffer(),j=new Uint8Array(U),r=A.load(j);e.scene.three.add(r);const c=new i,k=new m({color:16711680,depthTest:!1}),C=new f(c,k);e.scene.three.add(C);const F=t.get(I),H=t.get(L),M=H.get(e);e.renderer&&e.renderer.three.domElement.addEventListener("pointermove",()=>{const n=M.castRay([r]);if(!n||!(n.object instanceof l)||n.faceIndex===void 0)return;const a=F.getFace(n.object,n.faceIndex,n.instanceId);if(a){const o=[];for(const d of a.edges)o.push(...d.points);c.setFromPoints(o)}});const s=new p;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end()); +import{ay as i,L as m,f,a as l}from"./web-ifc-api-CfQNUy7g.js";import{S as p}from"./stats.min-BpIepu9J.js";import{p as g,C as u,i as w,n as h,W as y,d as b,h as v,N as I,H as L}from"./index-CrrO1BJs.js";const x=document.getElementById("container"),t=new g,B=t.get(u),e=B.create();e.scene=new w(t);e.renderer=new h(t,x);e.camera=new y(t);t.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const E=t.get(b);E.create(e);e.scene.three.background=null;const A=new v(t),S=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),U=await S.arrayBuffer(),j=new Uint8Array(U),r=A.load(j);e.scene.three.add(r);const c=new i,k=new m({color:16711680,depthTest:!1}),C=new f(c,k);e.scene.three.add(C);const F=t.get(I),H=t.get(L),M=H.get(e);e.renderer&&e.renderer.three.domElement.addEventListener("pointermove",()=>{const n=M.castRay([r]);if(!n||!(n.object instanceof l)||n.faceIndex===void 0)return;const a=F.getFace(n.object,n.faceIndex,n.instanceId);if(a){const o=[];for(const d of a.edges)o.push(...d.points);c.setFromPoints(o)}});const s=new p;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end()); diff --git a/examples/assets/miniMap.js b/examples/assets/miniMap.js index 78376fc55..feb4b6583 100644 --- a/examples/assets/miniMap.js +++ b/examples/assets/miniMap.js @@ -1,4 +1,4 @@ -import"./web-ifc-api-CfQNUy7g.js";import{S as d}from"./stats.min-BpIepu9J.js";import{m as p,t as m,a as c}from"./index-tywNknxv.js";import{p as b,C as u,i as f,n as g,W as h,d as v,h as x,c as y}from"./index-D2xchnNe.js";const z=document.getElementById("container"),a=new b,w=a.get(u),t=w.create();t.scene=new f(a);t.renderer=new g(a,z);t.camera=new h(a);t.scene.setup();a.init();const k=a.get(v);k.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),A=$.load(L);t.scene.three.add(A);const C=new y(a),e=C.create(t),E=document.getElementById("minimap"),l=e.renderer.domElement;l.style.borderRadius="12px";E.append(l);e.resize();const o=new d;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());p.init();const r=e.getSize(),i=m.create(()=>c` +import"./web-ifc-api-CfQNUy7g.js";import{S as d}from"./stats.min-BpIepu9J.js";import{m as p,t as m,a as c}from"./index-tywNknxv.js";import{p as b,C as u,i as f,n as g,W as h,d as v,h as x,c as y}from"./index-CrrO1BJs.js";const z=document.getElementById("container"),a=new b,w=a.get(u),t=w.create();t.scene=new f(a);t.renderer=new g(a,z);t.camera=new h(a);t.scene.setup();a.init();const k=a.get(v);k.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),A=$.load(L);t.scene.three.add(A);const C=new y(a),e=C.create(t),E=document.getElementById("minimap"),l=e.renderer.domElement;l.style.borderRadius="12px";E.append(l);e.resize();const o=new d;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());p.init();const r=e.getSize(),i=m.create(()=>c` diff --git a/examples/assets/orthoPerspectiveCamera.js b/examples/assets/orthoPerspectiveCamera.js index 9101cd065..3c301870b 100644 --- a/examples/assets/orthoPerspectiveCamera.js +++ b/examples/assets/orthoPerspectiveCamera.js @@ -1,4 +1,4 @@ -import{B as u,M as h,a as w}from"./web-ifc-api-CfQNUy7g.js";import{S as C}from"./stats.min-BpIepu9J.js";import{m as $,t as g,a as v}from"./index-tywNknxv.js";import{p as f,C as k,i as P,n as j,o as y,d as F}from"./index-D2xchnNe.js";const O=document.getElementById("container");let t=new f,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 C;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());$.init();const i=g.create(()=>v` +import{B as u,M as h,a as w}from"./web-ifc-api-CfQNUy7g.js";import{S as C}from"./stats.min-BpIepu9J.js";import{m as $,t as g,a as v}from"./index-tywNknxv.js";import{p as f,C as k,i as P,n as j,o as y,d as F}from"./index-CrrO1BJs.js";const O=document.getElementById("container");let t=new f,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 C;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());$.init();const i=g.create(()=>v` diff --git a/examples/assets/plans.js b/examples/assets/plans.js index 1664bb4ed..6d77096af 100644 --- a/examples/assets/plans.js +++ b/examples/assets/plans.js @@ -1,14 +1,14 @@ -import{b as w,L as A,C as S}from"./web-ifc-api-CfQNUy7g.js";import{p as L,C as F,i as B,o as P,d as x,h as D,T as M,A as T}from"./index-D2xchnNe.js";import{S as U,A as G,a as O,m as W}from"./index-Bpjba_Wq.js";import{m as R,t as p,a as u}from"./index-tywNknxv.js";import{S as _}from"./stats.min-BpIepu9J.js";const $=document.getElementById("container"),n=new L,j=n.get(F),e=j.create();e.scene=new B(n);e.renderer=new U(n,$);e.camera=new P(n);e.camera._aaaaa="heyyyy";e.renderer.postproduction.enabled=!0;e.renderer.postproduction.customEffects.outlineEnabled=!0;n.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const y=n.get(x);y.config.color.setHex(6710886);const k=y.create(e);k.three.position.y-=1;e.renderer.postproduction.customEffects.excludedMeshes.push(k.three);e.scene.three.background=null;const f=n.get(D),v=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),N=await v.arrayBuffer(),q=new Uint8Array(N),s=f.load(q);e.scene.three.add(s);const z=await fetch("https://thatopen.github.io/engine_components/resources/small.json"),H=await z.json();s.setLocalProperties(H);const c=new _;c.showPanel(2);document.body.append(c.dom);c.dom.style.left="0px";c.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>c.begin());e.renderer.onAfterUpdate.add(()=>c.end());const i=n.get(G);i.world=e;await i.generate(s);const l=n.get(O);l.setup({world:e});const V=n.get(M),h=V.create(e);for(const t of s.items)h.add(t.mesh);h.needsUpdate=!0;e.camera.controls.addEventListener("sleep",()=>{h.needsUpdate=!0});const r=n.get(T),a=n.get(W);r.byModel(s.uuid,s);r.byEntity(s);const C=r.find({models:[s.uuid]}),g=r.find({entities:["IFCWALLSTANDARDCASE","IFCWALL"]}),b=r.find({entities:["IFCDOOR","IFCWINDOW","IFCPLATE","IFCMEMBER"]}),J=new w({color:"gray",side:2}),K=new A({color:"black"}),Q=new w({color:"black",opacity:.5,side:2,transparent:!0});a.styles.create("thick",new Set,e,K,J,Q);for(const t in g){const o=f.list.get(t);if(!o)continue;const{mesh:d}=o;a.styles.list.thick.fragments[t]=new Set(g[t]),a.styles.list.thick.meshes.add(d)}a.styles.create("thin",new Set,e);for(const t in b){const o=f.list.get(t);if(!o)continue;const{mesh:d}=o;a.styles.list.thin.fragments[t]=new Set(b[t]),a.styles.list.thin.meshes.add(d)}await a.update(!0);R.init();const E=p.create(()=>u` +import{b as w,L as A,C as S}from"./web-ifc-api-CfQNUy7g.js";import{p as L,C as F,i as B,o as P,d as x,h as D,T as M,A as U}from"./index-CrrO1BJs.js";import{S as T,A as G,a as O,m as W}from"./index-BREiuDZQ.js";import{m as R,t as u,a as f}from"./index-tywNknxv.js";import{S as _}from"./stats.min-BpIepu9J.js";const $=document.getElementById("container"),n=new L,j=n.get(F),e=j.create();e.scene=new B(n);e.renderer=new T(n,$);e.camera=new P(n);e.camera._aaaaa="heyyyy";e.renderer.postproduction.enabled=!0;e.renderer.postproduction.customEffects.outlineEnabled=!0;n.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const y=n.get(x);y.config.color.setHex(6710886);const k=y.create(e);k.three.position.y-=1;e.renderer.postproduction.customEffects.excludedMeshes.push(k.three);e.scene.three.background=null;const h=n.get(D),v=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),N=await v.arrayBuffer(),q=new Uint8Array(N),s=h.load(q);e.scene.three.add(s);const z=await fetch("https://thatopen.github.io/engine_components/resources/small.json"),H=await z.json();s.setLocalProperties(H);const c=new _;c.showPanel(2);document.body.append(c.dom);c.dom.style.left="0px";c.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>c.begin());e.renderer.onAfterUpdate.add(()=>c.end());const i=n.get(G);i.world=e;await i.generate(s);const d=n.get(O);d.setup({world:e});const V=n.get(M),l=V.create(e);for(const t of s.items)l.add(t.mesh);l.needsUpdate=!0;e.camera.controls.addEventListener("sleep",()=>{l.needsUpdate=!0});const r=n.get(U),a=n.get(W);r.byModel(s.uuid,s);r.byEntity(s);const C=r.find({models:[s.uuid]}),g=r.find({entities:["IFCWALLSTANDARDCASE","IFCWALL"]}),b=r.find({entities:["IFCDOOR","IFCWINDOW","IFCPLATE","IFCMEMBER"]}),J=new w({color:"gray",side:2}),K=new A({color:"black"}),Q=new w({color:"black",opacity:.5,side:2,transparent:!0});a.styles.create("thick",new Set,e,K,J,Q);for(const t in g){const o=h.list.get(t);if(!o)continue;const{mesh:m}=o;a.styles.list.thick.fragments[t]=new Set(g[t]),a.styles.list.thick.meshes.add(m)}a.styles.create("thin",new Set,e);for(const t in b){const o=h.list.get(t);if(!o)continue;const{mesh:m}=o;a.styles.list.thin.fragments[t]=new Set(b[t]),a.styles.list.thin.meshes.add(m)}await a.update(!0);R.init();const E=u.create(()=>f` - `);document.body.append(E);const X=e.renderer.postproduction.customEffects.minGloss,m=new S("white"),I=E.querySelector("bim-panel-section[name='floorPlans']");for(const t of i.list){const o=p.create(()=>u` + `);document.body.append(E);const X=e.renderer.postproduction.customEffects.minGloss,p=new S("white"),I=E.querySelector("bim-panel-section[name='floorPlans']");for(const t of i.list){const o=u.create(()=>f` + @click="${()=>{e.renderer.postproduction.customEffects.minGloss=.1,d.backupColor=p,r.setColor(C,p),e.scene.three.background=p,i.goTo(t.id),l.needsUpdate=!0}}"> - `);I.append(o)}const Y=e.scene.three.background,Z=p.create(()=>u` + `);I.append(o)}const Y=e.scene.three.background,Z=u.create(()=>f` + @click="${()=>{d.backupColor=null,d.clear(),e.renderer.postproduction.customEffects.minGloss=X,r.resetColor(C),e.scene.three.background=Y,i.exitPlanView(),l.needsUpdate=!0}}"> `);I.append(Z); diff --git a/examples/assets/postproductionRenderer.js b/examples/assets/postproductionRenderer.js index 2da3a9c18..07ccdd007 100644 --- a/examples/assets/postproductionRenderer.js +++ b/examples/assets/postproductionRenderer.js @@ -1,4 +1,4 @@ -import{C as c}from"./web-ifc-api-CfQNUy7g.js";import{S as b}from"./stats.min-BpIepu9J.js";import{m as p,t as m,a as u}from"./index-tywNknxv.js";import{p as d,C as f,i as h,W as g,d as v,h as x}from"./index-D2xchnNe.js";import{S as $}from"./index-Bpjba_Wq.js";const k=document.getElementById("container"),t=new d,E=t.get(f),a=E.create();a.scene=new h(t);a.renderer=new $(t,k);a.camera=new g(t);a.scene.three.background=null;t.init();a.camera.controls.setLookAt(12,6,8,0,0,-10);a.scene.setup();const r=t.get(v);r.config.color.set(6710886);const w=r.create(a);a.scene.three.background=null;const y=new x(t),S=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),C=await S.arrayBuffer(),A=new Uint8Array(C),G=y.load(A);a.scene.three.add(G);const{postproduction:n}=a.renderer;n.enabled=!0;n.customEffects.excludedMeshes.push(w.three);const s=n.n8ao.configuration,o=new b;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";a.renderer.onBeforeUpdate.add(()=>o.begin());a.renderer.onAfterUpdate.add(()=>o.end());p.init();const l=m.create(()=>u` +import{C as c}from"./web-ifc-api-CfQNUy7g.js";import{S as b}from"./stats.min-BpIepu9J.js";import{m as p,t as m,a as u}from"./index-tywNknxv.js";import{p as d,C as f,i as h,W as g,d as v,h as x}from"./index-CrrO1BJs.js";import{S as $}from"./index-BREiuDZQ.js";const k=document.getElementById("container"),t=new d,E=t.get(f),a=E.create();a.scene=new h(t);a.renderer=new $(t,k);a.camera=new g(t);a.scene.three.background=null;t.init();a.camera.controls.setLookAt(12,6,8,0,0,-10);a.scene.setup();const r=t.get(v);r.config.color.set(6710886);const w=r.create(a);a.scene.three.background=null;const y=new x(t),S=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),C=await S.arrayBuffer(),A=new Uint8Array(C),G=y.load(A);a.scene.three.add(G);const{postproduction:n}=a.renderer;n.enabled=!0;n.customEffects.excludedMeshes.push(w.three);const s=n.n8ao.configuration,o=new b;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";a.renderer.onBeforeUpdate.add(()=>o.begin());a.renderer.onAfterUpdate.add(()=>o.end());p.init();const l=m.create(()=>u` {const s=I.castRay(S);l&&(l.material=d),!(!s||!(s.object instanceof i))&&(s.object.material=C,l=s.object)};const n=new w;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()); +import{M as u,B as p,a as i}from"./web-ifc-api-CfQNUy7g.js";import{S as w}from"./stats.min-BpIepu9J.js";import{p as b,C as f,i as y,n as g,W as x,H as M}from"./index-CrrO1BJs.js";const h=document.getElementById("container"),o=new b,B=o.get(f),e=B.create();e.scene=new y(o);e.renderer=new g(o,h);e.camera=new x(o);o.init();e.camera.controls.setLookAt(10,10,10,0,0,0);e.scene.setup();e.scene.three.background=null;const d=new u({color:"#6528D7"}),C=new u({color:"#BCF124"}),m=new p(3,3,3),c=new i(m,d),a=new i(m,d),r=new i(m,d);e.scene.three.add(c,a,r);const S=[c,a,r];a.position.x=5;r.position.x=-5;const t=Math.PI/180;function j(){c.rotation.x+=t,c.rotation.y+=t,a.rotation.x+=t,a.rotation.z+=t,r.rotation.y+=t,r.rotation.z+=t}e.renderer.onBeforeUpdate.add(j);const z=o.get(M),I=z.get(e);let l=null;window.onmousemove=()=>{const s=I.castRay(S);l&&(l.material=d),!(!s||!(s.object instanceof i))&&(s.object.material=C,l=s.object)};const n=new w;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()); diff --git a/examples/assets/shadowDropper.js b/examples/assets/shadowDropper.js index e8e42edd9..5e8e999f2 100644 --- a/examples/assets/shadowDropper.js +++ b/examples/assets/shadowDropper.js @@ -1,4 +1,4 @@ -import{B as p,M as u,a as b,C as h}from"./web-ifc-api-CfQNUy7g.js";import{p as w,C as f,i as g,W as x,d as v}from"./index-D2xchnNe.js";import{S}from"./stats.min-BpIepu9J.js";import{m as y,t as c,a as d}from"./index-tywNknxv.js";import{B as $,p as B}from"./index-Bpjba_Wq.js";const l=document.getElementById("container"),o=new w,C=o.get(f),e=C.create();e.scene=new g(o);e.renderer=new $(o,l);e.camera=new x(o);e.scene.setup();o.init();e.camera.controls.setLookAt(5,5,5,0,0,0);l.appendChild(e.renderer.three2D.domElement);const m=o.get(v);m.config.color.setHex(14540253);m.create(e);const E=new p(3,3,3),M=new u({color:"#6528D7"}),n=new b(E,M);n.position.set(0,1.5,0);e.scene.three.add(n);e.meshes.add(n);e.scene.three.background=new h("white");const t=o.get(B);t.shadowExtraScaleFactor=15;t.shadowOffset=.1;const a="example";t.create([n],a,e);const s=new S;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end());y.init();const i=c.create(()=>d` +import{B as p,M as u,a as b,C as h}from"./web-ifc-api-CfQNUy7g.js";import{p as w,C as f,i as g,W as x,d as v}from"./index-CrrO1BJs.js";import{S}from"./stats.min-BpIepu9J.js";import{m as y,t as c,a as d}from"./index-tywNknxv.js";import{B as $,p as B}from"./index-BREiuDZQ.js";const l=document.getElementById("container"),o=new w,C=o.get(f),e=C.create();e.scene=new g(o);e.renderer=new $(o,l);e.camera=new x(o);e.scene.setup();o.init();e.camera.controls.setLookAt(5,5,5,0,0,0);l.appendChild(e.renderer.three2D.domElement);const m=o.get(v);m.config.color.setHex(14540253);m.create(e);const E=new p(3,3,3),M=new u({color:"#6528D7"}),n=new b(E,M);n.position.set(0,1.5,0);e.scene.three.add(n);e.meshes.add(n);e.scene.three.background=new h("white");const t=o.get(B);t.shadowExtraScaleFactor=15;t.shadowOffset=.1;const a="example";t.create([n],a,e);const s=new S;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end());y.init();const i=c.create(()=>d` diff --git a/examples/assets/volumeMeasurement.js b/examples/assets/volumeMeasurement.js index 35e2e94d7..58eae90d3 100644 --- a/examples/assets/volumeMeasurement.js +++ b/examples/assets/volumeMeasurement.js @@ -1 +1 @@ -import"./web-ifc-api-CfQNUy7g.js";import{S as c}from"./stats.min-BpIepu9J.js";import{p as d,C as i,i as l,W as m,d as g,h as p}from"./index-D2xchnNe.js";import{S as w,w as f,a as h}from"./index-Bpjba_Wq.js";const u=document.getElementById("container"),t=new d,b=t.get(i),e=b.create();e.scene=new l(t);e.renderer=new w(t,u);e.camera=new m(t);t.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const y=t.get(g);y.create(e);e.scene.three.background=null;const S=new p(t),v=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),A=await v.arrayBuffer(),B=new Uint8Array(A),C=S.load(B);e.scene.three.add(C);const o=t.get(f);o.world=e;o.enabled=!0;const s=t.get(h);s.setup({world:e});s.events.select.onHighlight.add(a=>{const r=o.getVolumeFromFragments(a);console.log(r)});s.events.select.onClear.add(()=>{o.clear()});const n=new c;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()); +import"./web-ifc-api-CfQNUy7g.js";import{S as c}from"./stats.min-BpIepu9J.js";import{p as d,C as i,i as l,W as m,d as g,h as p}from"./index-CrrO1BJs.js";import{S as w,w as f,a as h}from"./index-BREiuDZQ.js";const u=document.getElementById("container"),t=new d,b=t.get(i),e=b.create();e.scene=new l(t);e.renderer=new w(t,u);e.camera=new m(t);t.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const y=t.get(g);y.create(e);e.scene.three.background=null;const S=new p(t),v=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),A=await v.arrayBuffer(),B=new Uint8Array(A),C=S.load(B);e.scene.three.add(C);const o=t.get(f);o.world=e;o.enabled=!0;const s=t.get(h);s.setup({world:e});s.events.select.onHighlight.add(a=>{const r=o.getVolumeFromFragments(a);console.log(r)});s.events.select.onClear.add(()=>{o.clear()});const n=new c;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()); diff --git a/examples/assets/worlds.js b/examples/assets/worlds.js index 1cb39638e..4e16dd4d5 100644 --- a/examples/assets/worlds.js +++ b/examples/assets/worlds.js @@ -1,4 +1,4 @@ -import{a6 as l,B as c,a as m,C as d,D as b,A as p}from"./web-ifc-api-CfQNUy7g.js";import{m as u,t as a,a as r}from"./index-tywNknxv.js";import{p as h,C as f,i as g,n as w,W as y}from"./index-D2xchnNe.js";import{S as v}from"./stats.min-BpIepu9J.js";const L=document.getElementById("container"),s=new h,C=s.get(f),e=C.create();e.scene=new g(s);e.renderer=new w(s,L);e.camera=new y(s);s.init();e.scene.three.background=null;const k=new l({color:"#6528D7"}),x=new c,A=new m(x,k);e.scene.three.add(A);e.scene.setup();e.camera.controls.setLookAt(3,3,3,0,0,0);const n=new v;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());u.init();const i=a.create(()=>r` +import{a6 as l,B as c,a as m,C as d,D as b,A as p}from"./web-ifc-api-CfQNUy7g.js";import{m as u,t as a,a as r}from"./index-tywNknxv.js";import{p as h,C as f,i as g,n as w,W as y}from"./index-CrrO1BJs.js";import{S as v}from"./stats.min-BpIepu9J.js";const L=document.getElementById("container"),s=new h,C=s.get(f),e=C.create();e.scene=new g(s);e.renderer=new w(s,L);e.camera=new y(s);s.init();e.scene.three.background=null;const k=new l({color:"#6528D7"}),x=new c,A=new m(x,k);e.scene.three.add(A);e.scene.setup();e.camera.controls.setLookAt(3,3,3,0,0,0);const n=new v;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());u.init();const i=a.create(()=>r`