Without Data Transform
${o}
Data Transform applied!
- ${n}
+ ${r}
`);document.body.append(p);
diff --git a/examples/assets/dropdown.js b/examples/assets/dropdown.js
index 06340602..627fbe9b 100644
--- a/examples/assets/dropdown.js
+++ b/examples/assets/dropdown.js
@@ -1 +1 @@
-import"./lit-element-CToom8Wf.js";import{M as d}from"./index-BCngLrVF.js";import"./state-H9kisBvQ.js";import"./ref-CyNRy2Tn.js";d.init();const t=document.getElementById("my-dropdown-1");t.addEventListener("change",()=>{const e=t.value;alert(`You've selected: ${e.join(", ")}.`)});const n=document.getElementById("my-dropdown-2");for(let e=0;e<300;e++){const o=document.createElement("bim-option");o.label=`Option ${e}`,o.value=e,n.append(o)}n.value=[100];
+import"./modulepreload-polyfill-B5Qt9EMX.js";import{M as d}from"./index-CcrzIsUO.js";import"./state-DYefyXr3.js";import"./lit-html-paDGiEfB.js";import"./ref-CInB0H-f.js";d.init();const t=document.getElementById("my-dropdown-1");t.addEventListener("change",()=>{const e=t.value;alert(`You've selected: ${e.join(", ")}.`)});const n=document.getElementById("my-dropdown-2");for(let e=0;e<300;e++){const o=document.createElement("bim-option");o.label=`Option ${e}`,o.value=e,n.append(o)}n.value=[100];
diff --git a/examples/assets/elementProperties.js b/examples/assets/elementProperties.js
index 183d4449..ef6734a4 100644
--- a/examples/assets/elementProperties.js
+++ b/examples/assets/elementProperties.js
@@ -1,4 +1,4 @@
-import{x as w}from"./lit-element-CToom8Wf.js";import{P as x,C as y,W as v,S as h,a as C,b as S,G as T,I,l as P,s as E,T as A}from"./index-DNiVoluI.js";import{t as $}from"./index-kdXv3cq4.js";x.init();const s=document.createElement("bim-viewport"),e=new y,L=e.get(v),n=L.create(),c=new h(e);c.setup();n.scene=c;const d=new C(e,s);n.renderer=d;const i=new S(e);n.camera=i;i.controls.setLookAt(10,5.5,5,-4,-1,-6.5);s.addEventListener("resize",()=>{d.resize(),i.updateAspect()});e.init();const k=e.get(T);k.create(n);const m=e.get(I);await m.setup();const z=await fetch("https://thatopen.github.io/engine_ui-components/resources/small.ifc"),G=await z.arrayBuffer(),M=new Uint8Array(G),u=await m.load(M);n.scene.three.add(u);const R=e.get(P);await R.process(u);const[t,b]=$.elementProperties({components:e,fragmentIdMap:{}});t.preserveStructureOnFilter=!0;t.indentationInText=!1;const p=e.get(E);p.setup({world:n});p.events.select.onHighlight.add(o=>{b({fragmentIdMap:o})});p.events.select.onClear.add(()=>b({fragmentIdMap:{}}));const V=A.create(()=>{const o=r=>{const a=r.target;t.queryString=a.value!==""?a.value:null},g=r=>{const a=r.target;t.expanded=!t.expanded,a.label=t.expanded?"Collapse":"Expand"},f=async()=>{await navigator.clipboard.writeText(t.tsv)};return w`
+import"./modulepreload-polyfill-B5Qt9EMX.js";import{T as w,C as x,W as y,S as v,a as h,b as C,G as S,I as T,p as I,u as E,l as P,m as A}from"./index-N2x2mgv3.js";import{t as L}from"./index-BazQpUSZ.js";import"./lit-html-paDGiEfB.js";w.init();const s=document.createElement("bim-viewport"),e=new x,$=e.get(y),n=$.create(),c=new v(e);c.setup();n.scene=c;const d=new h(e,s);n.renderer=d;const i=new C(e);n.camera=i;i.controls.setLookAt(10,5.5,5,-4,-1,-6.5);s.addEventListener("resize",()=>{d.resize(),i.updateAspect()});e.init();const k=e.get(S);k.create(n);const m=e.get(T);await m.setup();const z=await fetch("https://thatopen.github.io/engine_ui-components/resources/small.ifc"),G=await z.arrayBuffer(),M=new Uint8Array(G),u=await m.load(M);n.scene.three.add(u);const R=e.get(I);await R.process(u);const[t,b]=L.elementProperties({components:e,fragmentIdMap:{}});t.preserveStructureOnFilter=!0;t.indentationInText=!1;const p=e.get(E);p.setup({world:n});p.events.select.onHighlight.add(o=>{b({fragmentIdMap:o})});p.events.select.onClear.add(()=>b({fragmentIdMap:{}}));const V=P.create(()=>{const o=r=>{const a=r.target;t.queryString=a.value!==""?a.value:null},g=r=>{const a=r.target;t.expanded=!t.expanded,a.label=t.expanded?"Collapse":"Expand"},f=async()=>{await navigator.clipboard.writeText(t.tsv)};return A`
diff --git a/examples/assets/entityAttributes.js b/examples/assets/entityAttributes.js
index 5276988b..b280bfd9 100644
--- a/examples/assets/entityAttributes.js
+++ b/examples/assets/entityAttributes.js
@@ -1,13 +1,13 @@
-import{x as p}from"./lit-element-CToom8Wf.js";import{P as v,C as T,W as k,S as P,a as A,b as $,G as E,I as L,l as W,s as N,T as R,_ as b,w as H,z as M}from"./index-DNiVoluI.js";import{t as O}from"./index-kdXv3cq4.js";v.init();const o=new T,V=o.get(k),a=V.create(),S=new P(o);S.setup();a.scene=S;const d=document.createElement("bim-viewport"),w=new A(o,d);a.renderer=w;const m=new $(o);a.camera=m;m.controls.setLookAt(10,5.5,5,-4,-1,-6.5);d.addEventListener("resize",()=>{w.resize(),m.updateAspect()});o.init();const B=o.get(E);B.create(a);const C=o.get(L);await C.setup();const D=await fetch("https://thatopen.github.io/engine_ui-components/resources/small.ifc"),F=await D.arrayBuffer(),G=new Uint8Array(F),x=await C.load(G);a.scene.three.add(x);const J=o.get(W);await J.process(x);const l={padding:"0.25rem",borderRadius:"0.25rem"},z={Entity:t=>{let e={};return t===H[M]&&(e={...l,backgroundColor:"purple",color:"white"}),String(t).includes("IFCWALL")&&(e={...l,backgroundColor:"green",color:"white"}),p`${t}`},PredefinedType:t=>{const e=["#1c8d83","#3c1c8d","#386c19","#837c24"],c=Math.floor(Math.random()*e.length),g=e[c],f={...l,backgroundColor:g,color:"white"};return p`${t}`},NominalValue:t=>{let e={};return typeof t=="boolean"&&t===!1&&(e={...l,backgroundColor:"#b13535",color:"white"}),typeof t=="boolean"&&t===!0&&(e={...l,backgroundColor:"#18882c",color:"white"}),p`${t}`}},[i,u]=O.entityAttributes({components:o,fragmentIdMap:{},tableDefinition:z,attributesToInclude:()=>["Name","ContainedInStructure","HasProperties","HasPropertySets",e=>e.includes("Value"),e=>e.startsWith("Material"),e=>e.startsWith("Relating"),e=>{const c=["IsGroupedBy","IsDecomposedBy"];return e.startsWith("Is")&&!c.includes(e)}]});i.expanded=!0;i.indentationInText=!0;i.preserveStructureOnFilter=!0;const h=o.get(N);h.setup({world:a});h.events.select.onHighlight.add(t=>{u({fragmentIdMap:t})});h.events.select.onClear.add(()=>u({fragmentIdMap:{}}));const Q=R.create(()=>p`
+import"./modulepreload-polyfill-B5Qt9EMX.js";import{T as v,C as T,W as k,S as A,a as P,b as $,G as E,I as L,p as W,u as N,l as R,m as p,$ as b,x as H,E as M}from"./index-N2x2mgv3.js";import{t as O}from"./index-BazQpUSZ.js";import"./lit-html-paDGiEfB.js";v.init();const o=new T,V=o.get(k),a=V.create(),S=new A(o);S.setup();a.scene=S;const d=document.createElement("bim-viewport"),w=new P(o,d);a.renderer=w;const m=new $(o);a.camera=m;m.controls.setLookAt(10,5.5,5,-4,-1,-6.5);d.addEventListener("resize",()=>{w.resize(),m.updateAspect()});o.init();const B=o.get(E);B.create(a);const C=o.get(L);await C.setup();const D=await fetch("https://thatopen.github.io/engine_ui-components/resources/small.ifc"),F=await D.arrayBuffer(),G=new Uint8Array(F),x=await C.load(G);a.scene.three.add(x);const J=o.get(W);await J.process(x);const l={padding:"0.25rem",borderRadius:"0.25rem"},z={Entity:t=>{let e={};return t===H[M]&&(e={...l,backgroundColor:"purple",color:"white"}),String(t).includes("IFCWALL")&&(e={...l,backgroundColor:"green",color:"white"}),p`${t}`},PredefinedType:t=>{const e=["#1c8d83","#3c1c8d","#386c19","#837c24"],c=Math.floor(Math.random()*e.length),g=e[c],f={...l,backgroundColor:g,color:"white"};return p`${t}`},NominalValue:t=>{let e={};return typeof t=="boolean"&&t===!1&&(e={...l,backgroundColor:"#b13535",color:"white"}),typeof t=="boolean"&&t===!0&&(e={...l,backgroundColor:"#18882c",color:"white"}),p`${t}`}},[n,u]=O.entityAttributes({components:o,fragmentIdMap:{},tableDefinition:z,attributesToInclude:()=>["Name","ContainedInStructure","HasProperties","HasPropertySets",e=>e.includes("Value"),e=>e.startsWith("Material"),e=>e.startsWith("Relating"),e=>{const c=["IsGroupedBy","IsDecomposedBy"];return e.startsWith("Is")&&!c.includes(e)}]});n.expanded=!0;n.indentationInText=!0;n.preserveStructureOnFilter=!0;const h=o.get(N);h.setup({world:a});h.events.select.onHighlight.add(t=>{u({fragmentIdMap:t})});h.events.select.onClear.add(()=>u({fragmentIdMap:{}}));const j=R.create(()=>p`
- {const s=r.target;u({attributesToInclude:()=>[...s.value,n=>n.includes("Value"),n=>n.startsWith("Material"),n=>n.startsWith("Relating"),n=>{const I=["IsGroupedBy","IsDecomposedBy"];return n.startsWith("Is")&&!I.includes(n)}]})}} multiple>
+ {const s=r.target;u({attributesToInclude:()=>[...s.value,i=>i.includes("Value"),i=>i.startsWith("Material"),i=>i.startsWith("Relating"),i=>{const I=["IsGroupedBy","IsDecomposedBy"];return i.startsWith("Is")&&!I.includes(i)}]})}} multiple>
@@ -23,14 +23,14 @@ import{x as p}from"./lit-element-CToom8Wf.js";import{P as v,C as T,W as k,S as P
- {await navigator.clipboard.writeText(i.tsv),alert("Table data copied as TSV in clipboard! Try to paste it in a spreadsheet app.")}} icon="solar:copy-bold" tooltip-title="Copy TSV" tooltip-text="Copy the table contents as tab separated text values, so you can copy them into a spreadsheet.">
- {i.downloadData("entities-attributes")}} icon="ph:export-fill" tooltip-title="Export JSON" tooltip-text="Download the table contents as a JSON file.">
+ {await navigator.clipboard.writeText(n.tsv),alert("Table data copied as TSV in clipboard! Try to paste it in a spreadsheet app.")}} icon="solar:copy-bold" tooltip-title="Copy TSV" tooltip-text="Copy the table contents as tab separated text values, so you can copy them into a spreadsheet.">
+ {n.downloadData("entities-attributes")}} icon="ph:export-fill" tooltip-title="Export JSON" tooltip-text="Download the table contents as a JSON file.">
- ${i}
+ ${n}
`),y=document.createElement("bim-grid");y.layouts={main:{template:`
"viewport" 1fr
"entityAttributesPanel" 1fr
- `,elements:{entityAttributesPanel:Q,viewport:d}}};y.layout="main";document.body.append(y);
+ `,elements:{entityAttributesPanel:j,viewport:d}}};y.layout="main";document.body.append(y);
diff --git a/examples/assets/exportingData.js b/examples/assets/exportingData.js
index 8f706371..fca44408 100644
--- a/examples/assets/exportingData.js
+++ b/examples/assets/exportingData.js
@@ -1,18 +1,18 @@
-import{x as n}from"./lit-element-CToom8Wf.js";import{M as c,C as a,T as d,a as s}from"./index-BCngLrVF.js";import"./state-H9kisBvQ.js";import"./ref-CyNRy2Tn.js";c.init();const o=document.createElement("bim-table");o.expanded=!0;o.data=[{data:{Class:"IfcWall",PredefinedType:"EXTERNAL",Name:"Exterior Wall",Description:"Main structural exterior wall",LoadBearing:!0,Area:45.5},children:[{data:{Class:"IfcWindow",PredefinedType:"STANDARD",Name:"Office Window",Description:"Double-pane office window",LoadBearing:!1,Area:3.6}}]},{data:{Class:"IfcDoor",PredefinedType:"SINGLE_SWING_RIGHT",Name:"Entrance Door",Description:"Main entrance door",LoadBearing:!1,Area:2.1}},{data:{Class:"IfcColumn",PredefinedType:"ROUND",Name:"Support Column",Description:"Load-bearing column in lobby",LoadBearing:!0,Area:1.2}},{data:{Class:"IfcSlab",PredefinedType:"FLOOR",Name:"Main Floor Slab",Description:"Primary floor slab for ground level",LoadBearing:!0,Area:150}}];const p=a.create(()=>n`
+import"./modulepreload-polyfill-B5Qt9EMX.js";import{M as c,C as n,T as d,a as s}from"./index-CcrzIsUO.js";import"./state-DYefyXr3.js";import{x as a}from"./lit-html-paDGiEfB.js";import"./ref-CInB0H-f.js";c.init();const o=document.createElement("bim-table");o.expanded=!0;o.data=[{data:{Class:"IfcWall",PredefinedType:"EXTERNAL",Name:"Exterior Wall",Description:"Main structural exterior wall",LoadBearing:!0,Area:45.5},children:[{data:{Class:"IfcWindow",PredefinedType:"STANDARD",Name:"Office Window",Description:"Double-pane office window",LoadBearing:!1,Area:3.6}}]},{data:{Class:"IfcDoor",PredefinedType:"SINGLE_SWING_RIGHT",Name:"Entrance Door",Description:"Main entrance door",LoadBearing:!1,Area:2.1}},{data:{Class:"IfcColumn",PredefinedType:"ROUND",Name:"Support Column",Description:"Load-bearing column in lobby",LoadBearing:!0,Area:1.2}},{data:{Class:"IfcSlab",PredefinedType:"FLOOR",Name:"Main Floor Slab",Description:"Primary floor slab for ground level",LoadBearing:!0,Area:150}}];const p=n.create(()=>a`
{const t=e.target;t instanceof d&&(o.queryString=t.value)}} placeholder="Search...">
- `),l=a.create(()=>n`
+ `),l=n.create(()=>a`
- `),r=a.create(()=>n``),u=a.create(()=>n`
+ `),r=n.create(()=>a``),u=n.create(()=>a`
{const e=l.value[0];if(e===void 0)return;const t=r.value.trim()!==""?r.value:void 0;o.downloadData(t,e)}} label="Download" style="flex: 0">
- `),m=a.create(()=>n`
+ `),m=n.create(()=>a`
{const t=e.target;t instanceof s&&(o.indentationInText=t.checked)}} label="Include Indentation" inverted>
- `),b=a.create(()=>n`
+ `),b=n.create(()=>a`
{const e=l.value[0];e===void 0||e==="json"||(await navigator.clipboard.writeText(o[e]),window.alert("Table data copied as CSV in clipboard!"))}} label="Copy to Clipboard" style="flex: 0">
- `),f=a.create(()=>n`
+ `),f=n.create(()=>a`
${p}
diff --git a/examples/assets/grid.js b/examples/assets/grid.js
index 4f8a8c12..2e133b30 100644
--- a/examples/assets/grid.js
+++ b/examples/assets/grid.js
@@ -1,8 +1,8 @@
-import{T as p,x as b}from"./lit-element-CToom8Wf.js";import{M as g,C as s}from"./index-BCngLrVF.js";import{a as h,i as D,t as T,n as y}from"./ref-CyNRy2Tn.js";import"./state-H9kisBvQ.js";/**
+import"./modulepreload-polyfill-B5Qt9EMX.js";import{M as p,C as s}from"./index-CcrzIsUO.js";import"./state-DYefyXr3.js";import{T as g,x as b}from"./lit-html-paDGiEfB.js";import{a as h,i as D,t as T,n as y}from"./ref-CInB0H-f.js";/**
* @license
* Copyright 2018 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
- */const u="important",f=" !"+u,r=h(class extends D{constructor(e){var n;if(super(e),e.type!==T.ATTRIBUTE||e.name!=="style"||((n=e.strings)==null?void 0:n.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((n,i)=>{const o=e[i];return o==null?n:n+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${o};`},"")}update(e,[n]){const{style:i}=e.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(n)),this.render(n);for(const o of this.ft)n[o]==null&&(this.ft.delete(o),o.includes("-")?i.removeProperty(o):i[o]=null);for(const o in n){const t=n[o];if(t!=null){this.ft.add(o);const a=typeof t=="string"&&t.endsWith(f);o.includes("-")||a?i.setProperty(o,a?t.slice(0,-11):t,a?u:""):i[o]=t}}return p}});g.init();const c=s.create(()=>b`
+ */const u="important",f=" !"+u,r=h(class extends D{constructor(e){var n;if(super(e),e.type!==T.ATTRIBUTE||e.name!=="style"||((n=e.strings)==null?void 0:n.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((n,i)=>{const o=e[i];return o==null?n:n+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${o};`},"")}update(e,[n]){const{style:i}=e.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(n)),this.render(n);for(const o of this.ft)n[o]==null&&(this.ft.delete(o),o.includes("-")?i.removeProperty(o):i[o]=null);for(const o in n){const t=n[o];if(t!=null){this.ft.add(o);const a=typeof t=="string"&&t.endsWith(f);o.includes("-")||a?i.setProperty(o,a?t.slice(0,-11):t,a?u:""):i[o]=t}}return g}});p.init();const c=s.create(()=>b`
This is just a panel section... cool, right?
diff --git a/examples/assets/index-kdXv3cq4.js b/examples/assets/index-BazQpUSZ.js
similarity index 89%
rename from examples/assets/index-kdXv3cq4.js
rename to examples/assets/index-BazQpUSZ.js
index b4a414f7..445a87e7 100644
--- a/examples/assets/index-kdXv3cq4.js
+++ b/examples/assets/index-BazQpUSZ.js
@@ -1,9 +1,9 @@
-import{F as M,$ as _,H as te,q as be,T as v,l as $,w as Y,r as he,K as ne,X as oe,U as ie,Z as ye,z as se,E as re,R as Ce,J as Ie,N as we,Q as xe,Y as Ne,s as Te,x as Ae,W as ae,t as z,u as j,i as R,v as Re,D as Ee,A as $e,k as U,G as Se,_ as q,m as ce,P as le,p as ue}from"./index-DNiVoluI.js";import{x as C}from"./lit-element-CToom8Wf.js";const De=n=>{const{components:i,actions:t,tags:l}=n,a=(t==null?void 0:t.dispose)??!0,c=(t==null?void 0:t.download)??!0,s=(t==null?void 0:t.visibility)??!0,d=(l==null?void 0:l.schema)??!0,r=(l==null?void 0:l.viewDefinition)??!0,o=i.get(M),p=({detail:f})=>{const{cell:e}=f;e.style.padding="0.25rem 0"};return C`
- {if(!f)return;const e=f;e.hiddenColumns=["modelID"];const m=[];for(const[,h]of o.groups){if(!h)continue;const x={data:{Name:h.name||h.uuid,modelID:h.uuid}};m.push(x)}e.dataTransform={Name:(h,x)=>{const{modelID:w}=x;if(typeof w!="string")return h;const N=o.groups.get(w);if(!N)return w;const g={};for(const S of N.items)g[S.id]=S.ids;let b;const{schema:y}=N.ifcMetadata;d&&y&&(b=C`
+import{F as M,m as C,a0 as _,H as te,s as be,l as v,p as $,x as Y,t as he,N as ne,Y as oe,X as ie,_ as ye,E as se,J as re,R as Ce,K as Ie,Q as we,U as Ne,Z as xe,u as Te,y as Ae,W as ae,P as z,v as j,i as R,w as Re,D as Ee,A as $e,k as U,G as Se,$ as q,q as ce,T as le,r as ue}from"./index-N2x2mgv3.js";import"./lit-html-paDGiEfB.js";const De=n=>{const{components:i,actions:t,tags:l}=n,a=(t==null?void 0:t.dispose)??!0,c=(t==null?void 0:t.download)??!0,s=(t==null?void 0:t.visibility)??!0,d=(l==null?void 0:l.schema)??!0,r=(l==null?void 0:l.viewDefinition)??!0,o=i.get(M),p=({detail:f})=>{const{cell:e}=f;e.style.padding="0.25rem 0"};return C`
+ {if(!f)return;const e=f;e.hiddenColumns=["modelID"];const m=[];for(const[,h]of o.groups){if(!h)continue;const N={data:{Name:h.name||h.uuid,modelID:h.uuid}};m.push(N)}e.dataTransform={Name:(h,N)=>{const{modelID:w}=N;if(typeof w!="string")return h;const x=o.groups.get(w);if(!x)return w;const g={};for(const S of x.items)g[S.id]=S.ids;let b;const{schema:y}=x.ifcMetadata;d&&y&&(b=C`
${y}
- `);let I;if(r&&"viewDefinition"in N.ifcMetadata){const S=N.ifcMetadata.viewDefinition;I=C`
+ `);let I;if(r&&"viewDefinition"in x.ifcMetadata){const S=x.ifcMetadata.viewDefinition;I=C`
${S.split(",").map(E=>C`${E}`)}
- `}let A;a&&(A=C`o.disposeGroup(N)} icon="mdi:delete">`);let k;s&&(k=C`{const V=i.get(te),G=E.target;V.set(G.hasAttribute("data-model-hidden"),g),G.toggleAttribute("data-model-hidden"),G.icon=G.hasAttribute("data-model-hidden")?"mdi:eye-off":"mdi:eye"}} icon="mdi:eye">`);let O;return c&&(O=C`{const E=document.createElement("input");E.type="file",E.accept=".ifc",E.multiple=!1,E.addEventListener("change",async()=>{if(!(E.files&&E.files.length===1))return;const V=E.files[0],G=await V.arrayBuffer(),ge=await i.get(be).saveToIfc(N,new Uint8Array(G)),ee=new File([ge],V.name),B=document.createElement("a");B.href=URL.createObjectURL(ee),B.download=ee.name,B.click(),URL.revokeObjectURL(B.href)}),E.click()}} icon="flowbite:download-solid">`),C`
+ `}let A;a&&(A=C`o.disposeGroup(x)} icon="mdi:delete">`);let k;s&&(k=C`{const V=i.get(te),G=E.target;V.set(G.hasAttribute("data-model-hidden"),g),G.toggleAttribute("data-model-hidden"),G.icon=G.hasAttribute("data-model-hidden")?"mdi:eye-off":"mdi:eye"}} icon="mdi:eye">`);let O;return c&&(O=C`{const E=document.createElement("input");E.type="file",E.accept=".ifc",E.multiple=!1,E.addEventListener("change",async()=>{if(!(E.files&&E.files.length===1))return;const V=E.files[0],G=await V.arrayBuffer(),ge=await i.get(be).saveToIfc(x,new Uint8Array(G)),ee=new File([ge],V.name),B=document.createElement("a");B.href=URL.createObjectURL(ee),B.download=ee.name,B.click(),URL.revokeObjectURL(B.href)}),E.click()}} icon="flowbite:download-solid">`),C`
@@ -25,11 +25,11 @@ import{F as M,$ as _,H as te,q as be,T as v,l as $,w as Y,r as he,K as ne,X as o
No models has been loaded yet
- `},ve=(n,i=!0)=>{const t=v.create(De,n);if(i){const{components:l}=n,a=l.get(M),[,c]=t;a.onFragmentsLoaded.add(()=>setTimeout(()=>c())),a.onFragmentsDisposed.add(()=>c())}return t},ke=Object.freeze(Object.defineProperty({__proto__:null,modelsList:ve},Symbol.toStringTag,{value:"Module"})),de=["Name","ContainedInStructure","ForLayerSet","LayerThickness","HasProperties","HasAssociations","HasAssignments","HasPropertySets","PredefinedType","Quantities","ReferencedSource","Identification",n=>n.includes("Value"),n=>n.startsWith("Material"),n=>n.startsWith("Relating"),n=>{const i=["IsGroupedBy","IsDecomposedBy"];return n.startsWith("Is")&&!i.includes(n)}];async function Q(n,i,t,l=de,a=!1){const c=n.get($),s=await i.getProperties(t);if(!s)return{data:{Entity:`${t} properties not found...`}};const d=c.relationMaps[i.uuid],r={data:{}};for(const o in s){const p=l.map(f=>typeof f=="string"?o===f:f(o)).includes(!0);if(!(o==="type"||p))continue;const u=s[o];if(u)if(u.type===5){r.children||(r.children=[]);const f=await Q(n,i,u.value,l,a);r.children.push(f)}else if(typeof u=="object"&&!Array.isArray(u)){const{value:f,type:e}=u;if(a)e===1||e===2||e===3||(r.data[o]=f);else{const m=typeof f=="number"?Number(f.toFixed(3)):f;r.data[o]=m}}else if(Array.isArray(u))for(const f of u){if(f.type!==5)continue;r.children||(r.children=[]);const e=await Q(n,i,f.value,l,a);r.children.push(e)}else if(o==="type"){const f=Y[u];r.data.Entity=f}else r.data[o]=u}if(d&&d.get(s.expressID)){const o=d.get(s.expressID);for(const p of l){const u=[];if(typeof p=="string"){const f=c._inverseAttributes.indexOf(p);f!==-1&&u.push(f)}else{const f=c._inverseAttributes.filter(e=>p(e));for(const e of f){const m=c._inverseAttributes.indexOf(e);u.push(m)}}for(const f of u){const e=o.get(f);if(e)for(const m of e){const h=await Q(n,i,m,l,a);r.children||(r.children=[]),r.children.push(h)}}}}return r}const Oe=n=>{const{components:i,fragmentIdMap:t,attributesToInclude:l,editable:a,tableDefinition:c}=n,s=i.get(M);let d;return typeof l=="function"?d=l(de):d=l,C`{if(!o)return;const p=o,u=[],f=[];for(const e in t){const m=s.list.get(e);if(!(m&&m.group))continue;const h=m.group,x=f.find(w=>w.model===h);if(x)for(const w of t[e])x.expressIDs.add(w);else{const w={model:h,expressIDs:new Set(t[e])};f.push(w)}}for(const e of f){const{model:m,expressIDs:h}=e;for(const x of h){const w=await Q(i,m,x,d,a);u.push(w)}}p.dataTransform=c,p.data=u,p.columns=[{name:"Entity",width:"minmax(15rem, 1fr)"}]})}>`},Le=n=>v.create(Oe,n),Fe=Object.freeze(Object.defineProperty({__proto__:null,entityAttributes:Le},Symbol.toStringTag,{value:"Module"}));let L;const Me=n=>{const{components:i,classifications:t}=n,l=i.get(he),a=i.get(te);L||(L=document.createElement("bim-table"),L.headersHidden=!0,L.hiddenColumns=["system"],L.columns=["Name",{name:"Actions",width:"auto"}],L.dataTransform={Actions:(s,d)=>{const{system:r,Name:o}=d;if(!(typeof r=="string"&&typeof o=="string"))return s;const p=l.list[r];if(!(p&&p[o]))return s;const u=p[o],{map:f}=u;return C`
+ `},ve=(n,i=!0)=>{const t=v.create(De,n);if(i){const{components:l}=n,a=l.get(M),[,c]=t;a.onFragmentsLoaded.add(()=>setTimeout(()=>c())),a.onFragmentsDisposed.add(()=>c())}return t},ke=Object.freeze(Object.defineProperty({__proto__:null,modelsList:ve},Symbol.toStringTag,{value:"Module"})),de=["Name","ContainedInStructure","ForLayerSet","LayerThickness","HasProperties","HasAssociations","HasAssignments","HasPropertySets","PredefinedType","Quantities","ReferencedSource","Identification",n=>n.includes("Value"),n=>n.startsWith("Material"),n=>n.startsWith("Relating"),n=>{const i=["IsGroupedBy","IsDecomposedBy"];return n.startsWith("Is")&&!i.includes(n)}];async function Q(n,i,t,l=de,a=!1){const c=n.get($),s=await i.getProperties(t);if(!s)return{data:{Entity:`${t} properties not found...`}};const d=c.relationMaps[i.uuid],r={data:{}};for(const o in s){const p=l.map(f=>typeof f=="string"?o===f:f(o)).includes(!0);if(!(o==="type"||p))continue;const u=s[o];if(u)if(u.type===5){r.children||(r.children=[]);const f=await Q(n,i,u.value,l,a);r.children.push(f)}else if(typeof u=="object"&&!Array.isArray(u)){const{value:f,type:e}=u;if(a)e===1||e===2||e===3||(r.data[o]=f);else{const m=typeof f=="number"?Number(f.toFixed(3)):f;r.data[o]=m}}else if(Array.isArray(u))for(const f of u){if(f.type!==5)continue;r.children||(r.children=[]);const e=await Q(n,i,f.value,l,a);r.children.push(e)}else if(o==="type"){const f=Y[u];r.data.Entity=f}else r.data[o]=u}if(d&&d.get(s.expressID)){const o=d.get(s.expressID);for(const p of l){const u=[];if(typeof p=="string"){const f=c._inverseAttributes.indexOf(p);f!==-1&&u.push(f)}else{const f=c._inverseAttributes.filter(e=>p(e));for(const e of f){const m=c._inverseAttributes.indexOf(e);u.push(m)}}for(const f of u){const e=o.get(f);if(e)for(const m of e){const h=await Q(n,i,m,l,a);r.children||(r.children=[]),r.children.push(h)}}}}return r}const Oe=n=>{const{components:i,fragmentIdMap:t,attributesToInclude:l,editable:a,tableDefinition:c}=n,s=i.get(M);let d;return typeof l=="function"?d=l(de):d=l,C`{if(!o)return;const p=o,u=[],f=[];for(const e in t){const m=s.list.get(e);if(!(m&&m.group))continue;const h=m.group,N=f.find(w=>w.model===h);if(N)for(const w of t[e])N.expressIDs.add(w);else{const w={model:h,expressIDs:new Set(t[e])};f.push(w)}}for(const e of f){const{model:m,expressIDs:h}=e;for(const N of h){const w=await Q(i,m,N,d,a);u.push(w)}}p.dataTransform=c,p.data=u,p.columns=[{name:"Entity",width:"minmax(15rem, 1fr)"}]})}>`},Le=n=>v.create(Oe,n),Fe=Object.freeze(Object.defineProperty({__proto__:null,entityAttributes:Le},Symbol.toStringTag,{value:"Module"}));let L;const Me=n=>{const{components:i,classifications:t}=n,l=i.get(he),a=i.get(te);L||(L=document.createElement("bim-table"),L.headersHidden=!0,L.hiddenColumns=["system"],L.columns=["Name",{name:"Actions",width:"auto"}],L.dataTransform={Actions:(s,d)=>{const{system:r,Name:o}=d;if(!(typeof r=="string"&&typeof o=="string"))return s;const p=l.list[r];if(!(p&&p[o]))return s;const u=p[o],{map:f}=u;return C`
{const h=m.target;a.set(h.value,f)}}>
- `}});const c=[];for(const s of t){const d=typeof s=="string"?s:s.system,r=typeof s=="string"?s:s.label,o=l.list[d];o&&c.push({data:{Name:r,system:d},children:Object.keys(o).map(p=>({data:{Name:p,system:d,Actions:""}}))})}return L.data=c,C`${L}`},_e=(n,i=!0)=>{const t=v.create(Me,n);if(i){const{components:l}=n,a=l.get(M),[,c]=t;a.onFragmentsDisposed.add(()=>c())}return t},Ve=Object.freeze(Object.defineProperty({__proto__:null,classificationTree:_e},Symbol.toStringTag,{value:"Module"})),me=async(n,i,t)=>{var d,r,o,p;const l=n.get($),a={data:{Name:(d=t.Name)==null?void 0:d.value},children:[{data:{Name:"Identification",Value:(r=t.Identification)==null?void 0:r.value}},{data:{Name:"Name",Value:(o=t.Name)==null?void 0:o.value}},{data:{Name:"Description",Value:(p=t.Description)==null?void 0:p.value}}]},c=l.getEntityRelations(i,t.expressID,"IsNestedBy");if(!c)return a;a.children||(a.children=[]);const s=[];a.children.push({data:{Name:"Tasks"},children:s});for(const u of c){const f=await i.getProperties(u);if(!f)continue;const e=await me(n,i,f);s.push(e)}return a},Ge=async(n,i,t)=>{const l=[];for(const c of t){const s=await me(n,i,c);l.push(s)}return{data:{Name:"Tasks"},children:l}},Pe=async(n,i)=>{var l,a,c,s;const t={data:{Name:"Classifications"}};for(const d of i){const{value:r}=d.ReferencedSource,o=await n.getProperties(r);if(!o)continue;const p={data:{Name:(l=o.Name)==null?void 0:l.value},children:[{data:{Name:"Identification",Value:((a=d.Identification)==null?void 0:a.value)||((c=d.ItemReference)==null?void 0:c.value)}},{data:{Name:"Name",Value:(s=d.Name)==null?void 0:s.value}}]};t.children||(t.children=[]),t.children.push(p)}return t},We=async(n,i)=>{var l,a,c,s,d,r;const t={data:{Name:"Materials"}};for(const o of i){if(o.type===ne){const p=(l=o.ForLayerSet)==null?void 0:l.value,u=await n.getProperties(p);if(!u)continue;for(const f of u.MaterialLayers){const{value:e}=f,m=await n.getProperties(e);if(!m)continue;const h=await n.getProperties((a=m.Material)==null?void 0:a.value);if(!h)continue;const x={data:{Name:"Layer"},children:[{data:{Name:"Thickness",Value:(c=m.LayerThickness)==null?void 0:c.value}},{data:{Name:"Material",Value:(s=h.Name)==null?void 0:s.value}}]};t.children||(t.children=[]),t.children.push(x)}}if(o.type===oe)for(const p of o.Materials){const{value:u}=p,f=await n.getProperties(u);if(!f)continue;const e={data:{Name:"Name",Value:(d=f.Name)==null?void 0:d.value}};t.children||(t.children=[]),t.children.push(e)}if(o.type===ie){const p={data:{Name:"Name",Value:(r=o.Name)==null?void 0:r.value}};t.children||(t.children=[]),t.children.push(p)}}return t},je={IFCLENGTHMEASURE:"LENGTHUNIT",IFCAREAMEASURE:"AREAUNIT",IFCVOLUMEMEASURE:"VOLUMEUNIT",IFCPLANEANGLEMEASURE:"PLANEANGLEUNIT"},He={MILLIMETRE:{symbol:"mm",digits:0},METRE:{symbol:"m",digits:2},KILOMETRE:{symbol:"km",digits:2},SQUARE_METRE:{symbol:"m²",digits:2},CUBIC_METRE:{symbol:"m³",digits:2},DEGREE:{symbol:"°",digits:2},RADIAN:{symbol:"rad",digits:2},GRAM:{symbol:"g",digits:0},KILOGRAM:{symbol:"kg",digits:2},MILLISECOND:{symbol:"ms",digits:0},SECOND:{symbol:"s",digits:0}},fe=async(n,i)=>{var a,c,s;const t=Object.values(await n.getAllPropertiesOfType(ye))[0];let l;for(const d of t.Units){const r=await n.getProperties(d.value);if(r&&((a=r.UnitType)==null?void 0:a.value)===je[i]){l=`${((c=r.Prefix)==null?void 0:c.value)??""}${((s=r.Name)==null?void 0:s.value)??""}`;break}}return l?He[l]:null},Ue=async(n,i,t)=>{var c,s;const{displayUnits:l}=t,a={data:{Name:"PropertySets"}};for(const d of i){const r={data:{Name:(c=d.Name)==null?void 0:c.value}};if(d.type===se){for(const o of d.HasProperties){const{value:p}=o,u=await n.getProperties(p);if(!u)continue;const f=Object.keys(u).find(x=>x.includes("Value"));if(!(f&&u[f]))continue;let e=u[f].value,m="";if(l){const{name:x}=u[f],w=await fe(n,x)??{};m=w.symbol,e=u[f].value,typeof e=="number"&&w.digits&&(e=e.toFixed(w.digits))}const h={data:{Name:(s=u.Name)==null?void 0:s.value,Value:`${e} ${m??""}`}};r.children||(r.children=[]),r.children.push(h)}r.children&&(a.children||(a.children=[]),a.children.push(r))}}return a},Be=async(n,i,t)=>{var c,s;const{displayUnits:l}=t,a={data:{Name:"QuantitySets"}};for(const d of i){const r={data:{Name:(c=d.Name)==null?void 0:c.value}};if(d.type===re){for(const o of d.Quantities){const{value:p}=o,u=await n.getProperties(p);if(!u)continue;const f=Object.keys(u).find(x=>x.includes("Value"));if(!(f&&u[f]))continue;let e=u[f].value,m="";if(l){const{name:x}=u[f],w=await fe(n,x)??{};m=w.symbol,e=u[f].value,typeof e=="number"&&w.digits&&(e=e.toFixed(w.digits))}const h={data:{Name:(s=u.Name)==null?void 0:s.value,Value:`${e} ${m??""}`}};r.children||(r.children=[]),r.children.push(h)}r.children&&(a.children||(a.children=[]),a.children.push(r))}}return a},ze=["OwnerHistory","ObjectPlacement","CompositionType"],pe=async(n,i)=>{const l={...{groupName:"Attributes",includeClass:!1},...i},{groupName:a,includeClass:c}=l,s={data:{Name:a}};c&&(s.children||(s.children=[]),s.children.push({data:{Name:"Class",Value:Y[n.type]}}));for(const d in n){if(ze.includes(d))continue;const r=n[d];if(r&&typeof r=="object"&&!Array.isArray(r)){if(r.type===Ce)continue;const o={data:{Name:d,Value:r.value}};s.children||(s.children=[]),s.children.push(o)}}return s},W=(n,...i)=>{n.children||(n.children=[]),n.children.push(...i)},Je=async(n,i,t,l,a)=>{const s=n.get($).getEntityRelations(i,t,"IsDefinedBy");if(s){const d=[],r=[];for(const u of s){const f=await i.getProperties(u);f&&(f.type===se&&d.push(f),f.type===re&&r.push(f))}const o=await Ue(i,d,a);o.children&&W(l,o);const p=await Be(i,r,a);p.children&&W(l,p)}},qe=async(n,i,t,l)=>{const c=n.get($).getEntityRelations(i,t,"HasAssociations");if(c){const s=[],d=[];for(const p of c){const u=await i.getProperties(p);u&&(u.type===Ie&&s.push(u),(u.type===ne||u.type===we||u.type===xe||u.type===ie||u.type===oe)&&d.push(u))}const r=await Pe(i,s);r.children&&W(l,r);const o=await We(i,d);o.children&&W(l,o)}},Qe=async(n,i,t,l)=>{const c=n.get($).getEntityRelations(i,t,"HasAssignments");if(c){const s=[];for(const r of c){const o=await i.getProperties(r);o&&o.type===Ne&&s.push(o)}const d=await Ge(n,i,s);d.children&&W(l,d)}},Ye=async(n,i,t,l)=>{const c=n.get($).getEntityRelations(i,t,"ContainedInStructure");if(c&&c[0]){const s=c[0],d=await i.getProperties(s);if(d){const r=await pe(d,{groupName:"SpatialContainer"});W(l,r)}}};let J={};const Ke=async(n,i,t)=>{var d;const l=n.get($),a=n.get(M),c=a.getModelIdMap(i);Object.keys(i).length===0&&(J={});const s=[];for(const r in c){const o=a.groups.get(r);if(!o)continue;const p=l.relationMaps[o.uuid];if(!p)continue;r in J||(J[r]=new Map);const u=J[r],f=c[r];for(const e of f){let m=u.get(e);if(m){s.push(m);continue}const h=await o.getProperties(e);if(!h)continue;m={data:{Name:(d=h.Name)==null?void 0:d.value}},s.push(m),u.set(e,m);const x=await pe(h,{includeClass:!0});m.children||(m.children=[]),m.children.push(x),p.get(e)&&(await Je(n,o,e,m,t),await qe(n,o,e,m),await Qe(n,o,e,m),await Ye(n,o,e,m))}}return s},Xe=n=>{const i={emptySelectionWarning:!0,...n},{components:t,fragmentIdMap:l,emptySelectionWarning:a}=i;return C`
+ `}});const c=[];for(const s of t){const d=typeof s=="string"?s:s.system,r=typeof s=="string"?s:s.label,o=l.list[d];o&&c.push({data:{Name:r,system:d},children:Object.keys(o).map(p=>({data:{Name:p,system:d,Actions:""}}))})}return L.data=c,C`${L}`},_e=(n,i=!0)=>{const t=v.create(Me,n);if(i){const{components:l}=n,a=l.get(M),[,c]=t;a.onFragmentsDisposed.add(()=>c())}return t},Ve=Object.freeze(Object.defineProperty({__proto__:null,classificationTree:_e},Symbol.toStringTag,{value:"Module"})),me=async(n,i,t)=>{var d,r,o,p;const l=n.get($),a={data:{Name:(d=t.Name)==null?void 0:d.value},children:[{data:{Name:"Identification",Value:(r=t.Identification)==null?void 0:r.value}},{data:{Name:"Name",Value:(o=t.Name)==null?void 0:o.value}},{data:{Name:"Description",Value:(p=t.Description)==null?void 0:p.value}}]},c=l.getEntityRelations(i,t.expressID,"IsNestedBy");if(!c)return a;a.children||(a.children=[]);const s=[];a.children.push({data:{Name:"Tasks"},children:s});for(const u of c){const f=await i.getProperties(u);if(!f)continue;const e=await me(n,i,f);s.push(e)}return a},Ge=async(n,i,t)=>{const l=[];for(const c of t){const s=await me(n,i,c);l.push(s)}return{data:{Name:"Tasks"},children:l}},Pe=async(n,i)=>{var l,a,c,s;const t={data:{Name:"Classifications"}};for(const d of i){const{value:r}=d.ReferencedSource,o=await n.getProperties(r);if(!o)continue;const p={data:{Name:(l=o.Name)==null?void 0:l.value},children:[{data:{Name:"Identification",Value:((a=d.Identification)==null?void 0:a.value)||((c=d.ItemReference)==null?void 0:c.value)}},{data:{Name:"Name",Value:(s=d.Name)==null?void 0:s.value}}]};t.children||(t.children=[]),t.children.push(p)}return t},We=async(n,i)=>{var l,a,c,s,d,r;const t={data:{Name:"Materials"}};for(const o of i){if(o.type===ne){const p=(l=o.ForLayerSet)==null?void 0:l.value,u=await n.getProperties(p);if(!u)continue;for(const f of u.MaterialLayers){const{value:e}=f,m=await n.getProperties(e);if(!m)continue;const h=await n.getProperties((a=m.Material)==null?void 0:a.value);if(!h)continue;const N={data:{Name:"Layer"},children:[{data:{Name:"Thickness",Value:(c=m.LayerThickness)==null?void 0:c.value}},{data:{Name:"Material",Value:(s=h.Name)==null?void 0:s.value}}]};t.children||(t.children=[]),t.children.push(N)}}if(o.type===oe)for(const p of o.Materials){const{value:u}=p,f=await n.getProperties(u);if(!f)continue;const e={data:{Name:"Name",Value:(d=f.Name)==null?void 0:d.value}};t.children||(t.children=[]),t.children.push(e)}if(o.type===ie){const p={data:{Name:"Name",Value:(r=o.Name)==null?void 0:r.value}};t.children||(t.children=[]),t.children.push(p)}}return t},je={IFCLENGTHMEASURE:"LENGTHUNIT",IFCAREAMEASURE:"AREAUNIT",IFCVOLUMEMEASURE:"VOLUMEUNIT",IFCPLANEANGLEMEASURE:"PLANEANGLEUNIT"},He={MILLIMETRE:{symbol:"mm",digits:0},METRE:{symbol:"m",digits:2},KILOMETRE:{symbol:"km",digits:2},SQUARE_METRE:{symbol:"m²",digits:2},CUBIC_METRE:{symbol:"m³",digits:2},DEGREE:{symbol:"°",digits:2},RADIAN:{symbol:"rad",digits:2},GRAM:{symbol:"g",digits:0},KILOGRAM:{symbol:"kg",digits:2},MILLISECOND:{symbol:"ms",digits:0},SECOND:{symbol:"s",digits:0}},fe=async(n,i)=>{var a,c,s;const t=Object.values(await n.getAllPropertiesOfType(ye))[0];let l;for(const d of t.Units){const r=await n.getProperties(d.value);if(r&&((a=r.UnitType)==null?void 0:a.value)===je[i]){l=`${((c=r.Prefix)==null?void 0:c.value)??""}${((s=r.Name)==null?void 0:s.value)??""}`;break}}return l?He[l]:null},Ue=async(n,i,t)=>{var c,s;const{displayUnits:l}=t,a={data:{Name:"PropertySets"}};for(const d of i){const r={data:{Name:(c=d.Name)==null?void 0:c.value}};if(d.type===se){for(const o of d.HasProperties){const{value:p}=o,u=await n.getProperties(p);if(!u)continue;const f=Object.keys(u).find(N=>N.includes("Value"));if(!(f&&u[f]))continue;let e=u[f].value,m="";if(l){const{name:N}=u[f],w=await fe(n,N)??{};m=w.symbol,e=u[f].value,typeof e=="number"&&w.digits&&(e=e.toFixed(w.digits))}const h={data:{Name:(s=u.Name)==null?void 0:s.value,Value:`${e} ${m??""}`}};r.children||(r.children=[]),r.children.push(h)}r.children&&(a.children||(a.children=[]),a.children.push(r))}}return a},Be=async(n,i,t)=>{var c,s;const{displayUnits:l}=t,a={data:{Name:"QuantitySets"}};for(const d of i){const r={data:{Name:(c=d.Name)==null?void 0:c.value}};if(d.type===re){for(const o of d.Quantities){const{value:p}=o,u=await n.getProperties(p);if(!u)continue;const f=Object.keys(u).find(N=>N.includes("Value"));if(!(f&&u[f]))continue;let e=u[f].value,m="";if(l){const{name:N}=u[f],w=await fe(n,N)??{};m=w.symbol,e=u[f].value,typeof e=="number"&&w.digits&&(e=e.toFixed(w.digits))}const h={data:{Name:(s=u.Name)==null?void 0:s.value,Value:`${e} ${m??""}`}};r.children||(r.children=[]),r.children.push(h)}r.children&&(a.children||(a.children=[]),a.children.push(r))}}return a},ze=["OwnerHistory","ObjectPlacement","CompositionType"],pe=async(n,i)=>{const l={...{groupName:"Attributes",includeClass:!1},...i},{groupName:a,includeClass:c}=l,s={data:{Name:a}};c&&(s.children||(s.children=[]),s.children.push({data:{Name:"Class",Value:Y[n.type]}}));for(const d in n){if(ze.includes(d))continue;const r=n[d];if(r&&typeof r=="object"&&!Array.isArray(r)){if(r.type===Ce)continue;const o={data:{Name:d,Value:r.value}};s.children||(s.children=[]),s.children.push(o)}}return s},W=(n,...i)=>{n.children||(n.children=[]),n.children.push(...i)},Je=async(n,i,t,l,a)=>{const s=n.get($).getEntityRelations(i,t,"IsDefinedBy");if(s){const d=[],r=[];for(const u of s){const f=await i.getProperties(u);f&&(f.type===se&&d.push(f),f.type===re&&r.push(f))}const o=await Ue(i,d,a);o.children&&W(l,o);const p=await Be(i,r,a);p.children&&W(l,p)}},qe=async(n,i,t,l)=>{const c=n.get($).getEntityRelations(i,t,"HasAssociations");if(c){const s=[],d=[];for(const p of c){const u=await i.getProperties(p);u&&(u.type===Ie&&s.push(u),(u.type===ne||u.type===we||u.type===Ne||u.type===ie||u.type===oe)&&d.push(u))}const r=await Pe(i,s);r.children&&W(l,r);const o=await We(i,d);o.children&&W(l,o)}},Qe=async(n,i,t,l)=>{const c=n.get($).getEntityRelations(i,t,"HasAssignments");if(c){const s=[];for(const r of c){const o=await i.getProperties(r);o&&o.type===xe&&s.push(o)}const d=await Ge(n,i,s);d.children&&W(l,d)}},Ye=async(n,i,t,l)=>{const c=n.get($).getEntityRelations(i,t,"ContainedInStructure");if(c&&c[0]){const s=c[0],d=await i.getProperties(s);if(d){const r=await pe(d,{groupName:"SpatialContainer"});W(l,r)}}};let J={};const Ke=async(n,i,t)=>{var d;const l=n.get($),a=n.get(M),c=a.getModelIdMap(i);Object.keys(i).length===0&&(J={});const s=[];for(const r in c){const o=a.groups.get(r);if(!o)continue;const p=l.relationMaps[o.uuid];if(!p)continue;r in J||(J[r]=new Map);const u=J[r],f=c[r];for(const e of f){let m=u.get(e);if(m){s.push(m);continue}const h=await o.getProperties(e);if(!h)continue;m={data:{Name:(d=h.Name)==null?void 0:d.value}},s.push(m),u.set(e,m);const N=await pe(h,{includeClass:!0});m.children||(m.children=[]),m.children.push(N),p.get(e)&&(await Je(n,o,e,m,t),await qe(n,o,e,m),await Qe(n,o,e,m),await Ye(n,o,e,m))}}return s},Xe=n=>{const i={emptySelectionWarning:!0,...n},{components:t,fragmentIdMap:l,emptySelectionWarning:a}=i;return C`
{const{cell:r}=d;r.column==="Name"&&!("Value"in r.rowData)&&(r.style.gridColumn="1 / -1")}} ${_(async d=>{if(!d)return;const r=d;r.columns=[{name:"Name",width:"12rem"}],r.headersHidden=!0,r.loadFunction=()=>Ke(t,l,n),await r.loadData(!0)&&r.dispatchEvent(new Event("datacomputed"))})}>
${a?C`
@@ -40,7 +40,7 @@ import{F as M,$ as _,H as te,q as be,T as v,l as $,w as Y,r as he,K as ne,X as o
Something went wrong with the properties
- `},Ze=n=>v.create(Xe,n),et=Object.freeze(Object.defineProperty({__proto__:null,elementProperties:Ze},Symbol.toStringTag,{value:"Module"})),X=async(n,i,t,l)=>{var o;const a=[],c=n.get($),s=await i.getProperties(t);if(!s)return a;const{type:d}=s,r={data:{Entity:Y[d],Name:(o=s.Name)==null?void 0:o.value,modelID:i.uuid,expressID:t}};for(const p of l){const u=c.getEntityRelations(i,t,p);if(!u)continue;r.children||(r.children=[]),r.data.relations=JSON.stringify(u);const f={};for(const e of u){const m=await X(n,i,e,l);for(const h of m)if(h.data.relations)r.children.push(h);else{const x=i.data.get(e);if(!x){r.children.push(h);continue}const w=x[1][1],N=Y[w];N in f||(f[N]=[]),h.data.Entity=h.data.Name,delete h.data.Name,f[N].push(h)}}for(const e in f){const m=f[e],h=m.map(w=>w.data.expressID),x={data:{Entity:e,modelID:i.uuid,relations:JSON.stringify(h)},children:m};r.children.push(x)}}return a.push(r),a},tt=async(n,i,t,l)=>{const a=n.get($),c=[];for(const s of i){let d;if(l)d={data:{Entity:s.name!==""?s.name:s.uuid},children:await X(n,s,l,t)};else{const r=a.relationMaps[s.uuid],o=await s.getAllPropertiesOfType(Ae);if(!(r&&o))continue;const{expressID:p}=Object.values(o)[0];d={data:{Entity:s.name!==""?s.name:s.uuid},children:await X(n,s,p,t)}}c.push(d)}return c};let D;const nt=(n,i)=>{const t=n.get(M),{modelID:l,expressID:a,relations:c}=i;if(!l)return null;const s=t.groups.get(l);return s?s.getFragmentMap([a,...JSON.parse(c??"[]")]):null},ot=n=>{const{components:i,models:t,expressID:l}=n,a=n.selectHighlighterName??"select",c=n.hoverHighlighterName??"hover";D||(D=document.createElement("bim-table"),D.hiddenColumns=["modelID","expressID","relations"],D.columns=["Entity","Name"],D.headersHidden=!0,D.addEventListener("cellcreated",({detail:d})=>{const{cell:r}=d;r.column==="Entity"&&!("Name"in r.rowData)&&(r.style.gridColumn="1 / -1")})),D.addEventListener("rowcreated",d=>{d.stopImmediatePropagation();const{row:r}=d.detail,o=i.get(Te),p=nt(i,r.data);p&&Object.keys(p).length!==0&&(r.onmouseover=()=>{c&&(r.style.backgroundColor="var(--bim-ui_bg-contrast-20)",o.highlightByID(c,p,!0,!1,o.selection[a]??{}))},r.onmouseout=()=>{r.style.backgroundColor="",o.clear(c)},r.onclick=()=>{a&&o.highlightByID(a,p,!0,!0)})});const s=n.inverseAttributes??["IsDecomposedBy","ContainsElements"];return tt(i,t,s,l).then(d=>D.data=d),C`${D}`},it=(n,i=!0)=>{const t=v.create(ot,n);if(i){const[,l]=t,{components:a}=n,c=a.get(M),s=a.get($),d=()=>l({models:c.groups.values()});s.onRelationsIndexed.add(d),c.onFragmentsDisposed.add(d)}return t},st=Object.freeze(Object.defineProperty({__proto__:null,relationsTree:it},Symbol.toStringTag,{value:"Module"})),H=(n,i)=>[...n.get(Se).list.values()].find(a=>a.world===i),rt=(n,i)=>C`
+ `},Ze=n=>v.create(Xe,n),et=Object.freeze(Object.defineProperty({__proto__:null,elementProperties:Ze},Symbol.toStringTag,{value:"Module"})),X=async(n,i,t,l)=>{var o;const a=[],c=n.get($),s=await i.getProperties(t);if(!s)return a;const{type:d}=s,r={data:{Entity:Y[d],Name:(o=s.Name)==null?void 0:o.value,modelID:i.uuid,expressID:t}};for(const p of l){const u=c.getEntityRelations(i,t,p);if(!u)continue;r.children||(r.children=[]),r.data.relations=JSON.stringify(u);const f={};for(const e of u){const m=await X(n,i,e,l);for(const h of m)if(h.data.relations)r.children.push(h);else{const N=i.data.get(e);if(!N){r.children.push(h);continue}const w=N[1][1],x=Y[w];x in f||(f[x]=[]),h.data.Entity=h.data.Name,delete h.data.Name,f[x].push(h)}}for(const e in f){const m=f[e],h=m.map(w=>w.data.expressID),N={data:{Entity:e,modelID:i.uuid,relations:JSON.stringify(h)},children:m};r.children.push(N)}}return a.push(r),a},tt=async(n,i,t,l)=>{const a=n.get($),c=[];for(const s of i){let d;if(l)d={data:{Entity:s.name!==""?s.name:s.uuid},children:await X(n,s,l,t)};else{const r=a.relationMaps[s.uuid],o=await s.getAllPropertiesOfType(Ae);if(!(r&&o))continue;const{expressID:p}=Object.values(o)[0];d={data:{Entity:s.name!==""?s.name:s.uuid},children:await X(n,s,p,t)}}c.push(d)}return c};let D;const nt=(n,i)=>{const t=n.get(M),{modelID:l,expressID:a,relations:c}=i;if(!l)return null;const s=t.groups.get(l);return s?s.getFragmentMap([a,...JSON.parse(c??"[]")]):null},ot=n=>{const{components:i,models:t,expressID:l}=n,a=n.selectHighlighterName??"select",c=n.hoverHighlighterName??"hover";D||(D=document.createElement("bim-table"),D.hiddenColumns=["modelID","expressID","relations"],D.columns=["Entity","Name"],D.headersHidden=!0,D.addEventListener("cellcreated",({detail:d})=>{const{cell:r}=d;r.column==="Entity"&&!("Name"in r.rowData)&&(r.style.gridColumn="1 / -1")})),D.addEventListener("rowcreated",d=>{d.stopImmediatePropagation();const{row:r}=d.detail,o=i.get(Te),p=nt(i,r.data);p&&Object.keys(p).length!==0&&(r.onmouseover=()=>{c&&(r.style.backgroundColor="var(--bim-ui_bg-contrast-20)",o.highlightByID(c,p,!0,!1,o.selection[a]??{}))},r.onmouseout=()=>{r.style.backgroundColor="",o.clear(c)},r.onclick=()=>{a&&o.highlightByID(a,p,!0,!0)})});const s=n.inverseAttributes??["IsDecomposedBy","ContainsElements"];return tt(i,t,s,l).then(d=>D.data=d),C`${D}`},it=(n,i=!0)=>{const t=v.create(ot,n);if(i){const[,l]=t,{components:a}=n,c=a.get(M),s=a.get($),d=()=>l({models:c.groups.values()});s.onRelationsIndexed.add(d),c.onFragmentsDisposed.add(d)}return t},st=Object.freeze(Object.defineProperty({__proto__:null,relationsTree:it},Symbol.toStringTag,{value:"Module"})),H=(n,i)=>[...n.get(Se).list.values()].find(a=>a.world===i),rt=(n,i)=>C`
{const a=l.target;n.color=new U(a.color)}} color=${i}>
`,at=(n,i)=>{const{postproduction:t}=n,l=t.n8ao.configuration;return C`
{const s=c.target;l.color=new U(s.color)}} color=${i}>
@@ -68,11 +68,11 @@ import{F as M,$ as _,H as te,q as be,T as v,l as $,w as Y,r as he,K as ne,X as o
@change="${e=>{const h=e.target.value;n[i]=h,u(h)}}"
>
`},ft=n=>{const{components:i}=n,t=i.get(ae);return C`
- {const s=c.cell.parentNode;if(!s)return;const d=s.querySelector("bim-table-cell[column='Name']"),r=s.querySelector("bim-table-cell[column='Value']");d&&!r&&(d.style.gridColumn="1 / -1")}} ${_(async c=>{var r,o,p,u,f;if(!c)return;const s=c;s.preserveStructureOnFilter=!0,s.dataTransform={Value:(e,m)=>{const h=m.World,x=t.list.get(h);if(!x)return e;const{scene:w,camera:N,renderer:g}=x,b=m.Name;if(b==="Grid"&&m.IsGridConfig&&typeof e=="boolean"){const y=H(i,x);return y?F(y,"visible",e):e}if(b==="Color"&&m.IsGridConfig&&typeof e=="string"){const y=H(i,x);return y?lt(y,e):e}if(b==="Distance"&&m.IsGridConfig&&typeof e=="number"){const y=H(i,x);return y?T(y.material.uniforms.uDistance,"value",e,{slider:!0,min:300,max:1e3}):e}if(b==="Size"&&m.IsGridConfig&&typeof e=="string"){const y=H(i,x);if(!y)return e;const{x:I,y:A}=JSON.parse(e),k=T(y.material.uniforms.uSize1,"value",I,{slider:!0,suffix:"m",prefix:"A",min:1,max:20}),O=T(y.material.uniforms.uSize2,"value",A,{slider:!0,suffix:"m",prefix:"B",min:1,max:20});return C`
+ {const s=c.cell.parentNode;if(!s)return;const d=s.querySelector("bim-table-cell[column='Name']"),r=s.querySelector("bim-table-cell[column='Value']");d&&!r&&(d.style.gridColumn="1 / -1")}} ${_(async c=>{var r,o,p,u,f;if(!c)return;const s=c;s.preserveStructureOnFilter=!0,s.dataTransform={Value:(e,m)=>{const h=m.World,N=t.list.get(h);if(!N)return e;const{scene:w,camera:x,renderer:g}=N,b=m.Name;if(b==="Grid"&&m.IsGridConfig&&typeof e=="boolean"){const y=H(i,N);return y?F(y,"visible",e):e}if(b==="Color"&&m.IsGridConfig&&typeof e=="string"){const y=H(i,N);return y?lt(y,e):e}if(b==="Distance"&&m.IsGridConfig&&typeof e=="number"){const y=H(i,N);return y?T(y.material.uniforms.uDistance,"value",e,{slider:!0,min:300,max:1e3}):e}if(b==="Size"&&m.IsGridConfig&&typeof e=="string"){const y=H(i,N);if(!y)return e;const{x:I,y:A}=JSON.parse(e),k=T(y.material.uniforms.uSize1,"value",I,{slider:!0,suffix:"m",prefix:"A",min:1,max:20}),O=T(y.material.uniforms.uSize2,"value",A,{slider:!0,suffix:"m",prefix:"B",min:1,max:20});return C`