diff --git a/examples/Button/index.html b/examples/Button/index.html index a7938676..166edfca 100644 --- a/examples/Button/index.html +++ b/examples/Button/index.html @@ -16,8 +16,8 @@ - - + + diff --git a/examples/Checkbox/index.html b/examples/Checkbox/index.html index 5e4d89b0..3a7098c3 100644 --- a/examples/Checkbox/index.html +++ b/examples/Checkbox/index.html @@ -16,8 +16,8 @@ - - + + diff --git a/examples/ClassificationsTree/index.html b/examples/ClassificationsTree/index.html index 6d28853e..6aa74777 100644 --- a/examples/ClassificationsTree/index.html +++ b/examples/ClassificationsTree/index.html @@ -24,9 +24,9 @@ - - - + + + diff --git a/examples/ColorInput/index.html b/examples/ColorInput/index.html index 44314c3f..fae20f65 100644 --- a/examples/ColorInput/index.html +++ b/examples/ColorInput/index.html @@ -16,8 +16,8 @@ - - + + diff --git a/examples/Component/index.html b/examples/Component/index.html index e9c9fb30..a514afcf 100644 --- a/examples/Component/index.html +++ b/examples/Component/index.html @@ -18,8 +18,8 @@ - - + + diff --git a/examples/Dropdown/index.html b/examples/Dropdown/index.html index 515d6d0f..1fe7f667 100644 --- a/examples/Dropdown/index.html +++ b/examples/Dropdown/index.html @@ -20,8 +20,8 @@ - - + + diff --git a/examples/ElementProperties/index.html b/examples/ElementProperties/index.html index 581003b7..b80fb408 100644 --- a/examples/ElementProperties/index.html +++ b/examples/ElementProperties/index.html @@ -28,8 +28,8 @@ - - + + diff --git a/examples/EntityAttributes/index.html b/examples/EntityAttributes/index.html index f0bbefc4..241b9f9d 100644 --- a/examples/EntityAttributes/index.html +++ b/examples/EntityAttributes/index.html @@ -34,8 +34,8 @@ - - + + diff --git a/examples/Grid/index.html b/examples/Grid/index.html index ca0fa0d3..6305839c 100644 --- a/examples/Grid/index.html +++ b/examples/Grid/index.html @@ -38,8 +38,8 @@ - - + + diff --git a/examples/Label/index.html b/examples/Label/index.html index 7a8d2bc5..176eab4f 100644 --- a/examples/Label/index.html +++ b/examples/Label/index.html @@ -21,8 +21,8 @@ - - + + diff --git a/examples/ModelsList/index.html b/examples/ModelsList/index.html index d70afb34..6a1f5060 100644 --- a/examples/ModelsList/index.html +++ b/examples/ModelsList/index.html @@ -24,9 +24,9 @@ - - - + + + diff --git a/examples/NumberInput/index.html b/examples/NumberInput/index.html index 45cf0eeb..eec7e8b2 100644 --- a/examples/NumberInput/index.html +++ b/examples/NumberInput/index.html @@ -16,8 +16,8 @@ - - + + diff --git a/examples/Panel/index.html b/examples/Panel/index.html index c0836004..42023457 100644 --- a/examples/Panel/index.html +++ b/examples/Panel/index.html @@ -43,8 +43,8 @@ - - + + diff --git a/examples/RelationsTree/index.html b/examples/RelationsTree/index.html index 17863558..8da5ccb0 100644 --- a/examples/RelationsTree/index.html +++ b/examples/RelationsTree/index.html @@ -24,9 +24,9 @@ - - - + + + diff --git a/examples/Selector/index.html b/examples/Selector/index.html index be72146d..f91fc394 100644 --- a/examples/Selector/index.html +++ b/examples/Selector/index.html @@ -20,8 +20,8 @@ - - + + diff --git a/examples/Table/index.html b/examples/Table/index.html index a6525110..7189ebbe 100644 --- a/examples/Table/index.html +++ b/examples/Table/index.html @@ -16,13 +16,15 @@ - - + +
+ + diff --git a/examples/Tabs/index.html b/examples/Tabs/index.html index 34c2e02e..1cc8c573 100644 --- a/examples/Tabs/index.html +++ b/examples/Tabs/index.html @@ -33,8 +33,8 @@ - - + + diff --git a/examples/TextInput/index.html b/examples/TextInput/index.html index dd0c3fb2..52fe2008 100644 --- a/examples/TextInput/index.html +++ b/examples/TextInput/index.html @@ -23,8 +23,8 @@ - - + + diff --git a/examples/Toolbar/index.html b/examples/Toolbar/index.html index 51b96f1a..6ebe44f8 100644 --- a/examples/Toolbar/index.html +++ b/examples/Toolbar/index.html @@ -20,8 +20,8 @@ - - + + diff --git a/examples/ViewCube/index.html b/examples/ViewCube/index.html index 9615a6b9..cd2fde1f 100644 --- a/examples/ViewCube/index.html +++ b/examples/ViewCube/index.html @@ -17,9 +17,9 @@ - - - + + + diff --git a/examples/World2D/index.html b/examples/World2D/index.html index a8598e96..0db2cdf2 100644 --- a/examples/World2D/index.html +++ b/examples/World2D/index.html @@ -18,9 +18,9 @@ - - - + + + diff --git a/examples/WorldsConfiguration/index.html b/examples/WorldsConfiguration/index.html index 446f159e..fd56547d 100644 --- a/examples/WorldsConfiguration/index.html +++ b/examples/WorldsConfiguration/index.html @@ -28,8 +28,8 @@ - - + + diff --git a/examples/assets/button.js b/examples/assets/button.js index 0125ee0c..58e607ab 100644 --- a/examples/assets/button.js +++ b/examples/assets/button.js @@ -1 +1 @@ -import"./modulepreload-polyfill-B5Qt9EMX.js";import{M as e}from"./index-BRXkzNmn.js";import"./state-CdSmRkb4.js";e.init();const t=document.body.querySelector("bim-button");t.addEventListener("click",()=>{alert("Your schedule has been created!")}); +import"./modulepreload-polyfill-B5Qt9EMX.js";import{M as e}from"./index-DhhQtOkc.js";import"./state-HK6D0hVF.js";e.init();const t=document.body.querySelector("bim-button");t.addEventListener("click",()=>{alert("Your schedule has been created!")}); diff --git a/examples/assets/checkbox.js b/examples/assets/checkbox.js index 3e4e7191..b271f67a 100644 --- a/examples/assets/checkbox.js +++ b/examples/assets/checkbox.js @@ -1 +1 @@ -import"./modulepreload-polyfill-B5Qt9EMX.js";import{M as t}from"./index-BRXkzNmn.js";import"./state-CdSmRkb4.js";t.init();const e=document.body.querySelector("bim-checkbox");e.addEventListener("change",()=>{const{checked:o}=e;alert(o?"You want BIM Tiles! :)":"You don't want BIM Tiles :(")}); +import"./modulepreload-polyfill-B5Qt9EMX.js";import{M as t}from"./index-DhhQtOkc.js";import"./state-HK6D0hVF.js";t.init();const e=document.body.querySelector("bim-checkbox");e.addEventListener("change",()=>{const{checked:o}=e;alert(o?"You want BIM Tiles! :)":"You don't want BIM Tiles :(")}); diff --git a/examples/assets/classificationsTree.js b/examples/assets/classificationsTree.js index b51ca70b..dca966d4 100644 --- a/examples/assets/classificationsTree.js +++ b/examples/assets/classificationsTree.js @@ -1,4 +1,4 @@ -import"./modulepreload-polyfill-B5Qt9EMX.js";import{p as m,a as d,C as l,i as f,n as b,k as u,u as w,R as g,b as y,A as C,h as T,j as v}from"./index-iHSjA6qM.js";import{b as E}from"./index-B3Tx1nQG.js";import{t as L}from"./index-BdZzXOWY.js";m.init();const e=new d,a=document.createElement("bim-viewport");a.name="viewer";const A=e.get(l),t=A.create(),o=new f(e);o.setup();t.scene=o;const c=new b(e,a);t.renderer=c;const r=new u(e);t.camera=r;a.addEventListener("resize",()=>{c.resize(),r.updateAspect()});const I=e.get(w);I.create(t);e.init();const $=e.get(g);await $.setup();const p=e.get(y);p.onFragmentsLoaded.add(n=>{t.scene&&t.scene.three.add(n)});const[h,k]=L.classificationTree({components:e,classifications:{}}),i=e.get(C);p.onFragmentsLoaded.add(async n=>{i.byEntity(n),await i.byPredefinedType(n),k({classifications:{Entities:["entities","predefinedTypes"],"Predefined Types":["predefinedTypes"]}})});const z=T.create(()=>{const[n]=E.loadIfc({components:e});return v` +import"./modulepreload-polyfill-B5Qt9EMX.js";import{p as m,a as d,C as l,i as f,n as b,k as u,u as w,R as g,b as y,A as C,J as T,h as v}from"./template-DtWW1qyz.js";import{b as E}from"./index-Dx4AauaH.js";import{t as L}from"./index-CAZguOLS.js";m.init();const e=new d,a=document.createElement("bim-viewport");a.name="viewer";const A=e.get(l),t=A.create(),o=new f(e);o.setup();t.scene=o;const c=new b(e,a);t.renderer=c;const r=new u(e);t.camera=r;a.addEventListener("resize",()=>{c.resize(),r.updateAspect()});const I=e.get(w);I.create(t);e.init();const $=e.get(g);await $.setup();const p=e.get(y);p.onFragmentsLoaded.add(n=>{t.scene&&t.scene.three.add(n)});const[h,k]=L.classificationTree({components:e,classifications:{}}),i=e.get(C);p.onFragmentsLoaded.add(async n=>{i.byEntity(n),await i.byPredefinedType(n),k({classifications:{Entities:["entities"],"Predefined Types":["predefinedTypes"]}})});const z=T.create(()=>{const[n]=E.loadIfc({components:e});return v` ${n} diff --git a/examples/assets/colorInput.js b/examples/assets/colorInput.js index e1ad96c1..e2cf6799 100644 --- a/examples/assets/colorInput.js +++ b/examples/assets/colorInput.js @@ -1 +1 @@ -import"./modulepreload-polyfill-B5Qt9EMX.js";import{M as n}from"./index-BRXkzNmn.js";import"./state-CdSmRkb4.js";n.init();const o=document.body.querySelector("bim-color-input");o.addEventListener("input",()=>{const{color:t}=o;console.log(t)}); +import"./modulepreload-polyfill-B5Qt9EMX.js";import{M as n}from"./index-DhhQtOkc.js";import"./state-HK6D0hVF.js";n.init();const o=document.body.querySelector("bim-color-input");o.addEventListener("input",()=>{const{color:t}=o;console.log(t)}); diff --git a/examples/assets/component.js b/examples/assets/component.js index fc2235bd..0a87c57b 100644 --- a/examples/assets/component.js +++ b/examples/assets/component.js @@ -1,4 +1,4 @@ -import"./modulepreload-polyfill-B5Qt9EMX.js";import{M as c,C as t}from"./index-BRXkzNmn.js";import{x as n}from"./state-CdSmRkb4.js";c.init();const b=t.create(()=>n` +import"./modulepreload-polyfill-B5Qt9EMX.js";import{M as c,C as t}from"./index-DhhQtOkc.js";import{x as n}from"./state-HK6D0hVF.js";c.init();const b=t.create(()=>n` diff --git a/examples/assets/dropdown.js b/examples/assets/dropdown.js index 2bfb6f48..f9abc91b 100644 --- a/examples/assets/dropdown.js +++ b/examples/assets/dropdown.js @@ -1 +1 @@ -import"./modulepreload-polyfill-B5Qt9EMX.js";import{M as t}from"./index-BRXkzNmn.js";import"./state-CdSmRkb4.js";t.init();const e=document.body.querySelector("bim-dropdown");e.addEventListener("change",()=>{const o=e.value;alert(`You've selected: ${o.join(", ")}.`)}); +import"./modulepreload-polyfill-B5Qt9EMX.js";import{M as t}from"./index-DhhQtOkc.js";import"./state-HK6D0hVF.js";t.init();const e=document.body.querySelector("bim-dropdown");e.addEventListener("change",()=>{const o=e.value;alert(`You've selected: ${o.join(", ")}.`)}); diff --git a/examples/assets/elementProperties.js b/examples/assets/elementProperties.js index a2b0504c..fff38857 100644 --- a/examples/assets/elementProperties.js +++ b/examples/assets/elementProperties.js @@ -1,4 +1,4 @@ -import"./modulepreload-polyfill-B5Qt9EMX.js";import{p as f,a as x,C as y,i as h,n as v,k as C,u as T,R as S,W as E,S as P,h as $,j as k}from"./index-iHSjA6qM.js";import{t as A}from"./index-BdZzXOWY.js";f.init();const r=document.createElement("bim-viewport"),e=new x,I=e.get(y),n=I.create(),l=new h(e);l.setup();n.scene=l;const d=new v(e,r);n.renderer=d;const i=new C(e);n.camera=i;i.controls.setLookAt(10,5.5,5,-4,-1,-6.5);r.addEventListener("resize",()=>{d.resize(),i.updateAspect()});e.init();const L=e.get(T);L.create(n);const m=e.get(S);await m.setup();const z=await fetch("https://thatopen.github.io/engine_ui-components/resources/small.ifc"),M=await z.arrayBuffer(),R=new Uint8Array(M),u=await m.load(R);n.scene.three.add(u);const V=e.get(E);await V.process(u);const[t,b]=A.elementProperties({components:e,fragmentIdMap:{}});t.preserveStructureOnFilter=!0;t.indentationInText=!1;const p=e.get(P);p.setup({world:n});p.events.select.onHighlight.add(o=>{b({fragmentIdMap:o})});p.events.select.onClear.add(()=>b({fragmentIdMap:{}}));const W=$.create(()=>{const o=s=>{const a=s.target;t.queryString=a.value!==""?a.value:null},g=s=>{const a=s.target;t.expanded=!t.expanded,a.label=t.expanded?"Collapse":"Expand"},w=async()=>{await navigator.clipboard.writeText(t.tsv)};return k` +import"./modulepreload-polyfill-B5Qt9EMX.js";import{p as f,a as x,C as y,i as h,n as v,k as C,u as T,R as S,W as E,S as P,J as $,h as k}from"./template-DtWW1qyz.js";import{t as A}from"./index-CAZguOLS.js";f.init();const r=document.createElement("bim-viewport"),e=new x,I=e.get(y),n=I.create(),l=new h(e);l.setup();n.scene=l;const d=new v(e,r);n.renderer=d;const i=new C(e);n.camera=i;i.controls.setLookAt(10,5.5,5,-4,-1,-6.5);r.addEventListener("resize",()=>{d.resize(),i.updateAspect()});e.init();const L=e.get(T);L.create(n);const m=e.get(S);await m.setup();const z=await fetch("https://thatopen.github.io/engine_ui-components/resources/small.ifc"),J=await z.arrayBuffer(),M=new Uint8Array(J),u=await m.load(M);n.scene.three.add(u);const R=e.get(E);await R.process(u);const[t,b]=A.elementProperties({components:e,fragmentIdMap:{}});t.preserveStructureOnFilter=!0;t.indentationInText=!1;const p=e.get(P);p.setup({world:n});p.events.select.onHighlight.add(o=>{b({fragmentIdMap:o})});p.events.select.onClear.add(()=>b({fragmentIdMap:{}}));const V=$.create(()=>{const o=s=>{const a=s.target;t.queryString=a.value!==""?a.value:null},g=s=>{const a=s.target;t.expanded=!t.expanded,a.label=t.expanded?"Collapse":"Expand"},w=async()=>{await navigator.clipboard.writeText(t.tsv)};return k`
@@ -12,4 +12,4 @@ import"./modulepreload-polyfill-B5Qt9EMX.js";import{p as f,a as x,C as y,i as h, `}),c=document.createElement("bim-grid");c.layouts={main:{template:` "propertiesPanel viewport" /25rem 1fr - `,elements:{propertiesPanel:W,viewport:r}}};c.layout="main";document.body.append(c); + `,elements:{propertiesPanel:V,viewport:r}}};c.layout="main";document.body.append(c); diff --git a/examples/assets/entityAttributes.js b/examples/assets/entityAttributes.js index 985da9e8..b0d35e41 100644 --- a/examples/assets/entityAttributes.js +++ b/examples/assets/entityAttributes.js @@ -1,4 +1,4 @@ -import"./modulepreload-polyfill-B5Qt9EMX.js";import{p as I,a as v,C as T,i as A,n as P,k as $,u as E,R as W,W as L,S as N,h as R,j as p,t as b,l as H,I as O}from"./index-iHSjA6qM.js";import{t as V}from"./index-BdZzXOWY.js";I.init();const o=new v,B=o.get(T),a=B.create(),w=new A(o);w.setup();a.scene=w;const d=document.createElement("bim-viewport"),S=new P(o,d);a.renderer=S;const u=new $(o);a.camera=u;u.controls.setLookAt(10,5.5,5,-4,-1,-6.5);d.addEventListener("resize",()=>{S.resize(),u.updateAspect()});o.init();const M=o.get(E);M.create(a);const C=o.get(W);await C.setup();const D=await fetch("https://thatopen.github.io/engine_ui-components/resources/small.ifc"),F=await D.arrayBuffer(),J=new Uint8Array(F),x=await C.load(J);a.scene.three.add(x);const j=o.get(L);await j.process(x);const l={padding:"0.25rem",borderRadius:"0.25rem"},z={Entity:e=>{let t={};return e===H[O]&&(t={...l,backgroundColor:"purple",color:"white"}),String(e).includes("IFCWALL")&&(t={...l,backgroundColor:"green",color:"white"}),p`${e}`},PredefinedType:e=>{const t=["#1c8d83","#3c1c8d","#386c19","#837c24"],c=Math.floor(Math.random()*t.length),g=t[c],f={...l,backgroundColor:g,color:"white"};return p`${e}`},NominalValue:e=>{let t={};return typeof e=="boolean"&&e===!1&&(t={...l,backgroundColor:"#b13535",color:"white"}),typeof e=="boolean"&&e===!0&&(t={...l,backgroundColor:"#18882c",color:"white"}),p`${e}`}},[n,m]=V.entityAttributes({components:o,fragmentIdMap:{},tableDefinition:z,attributesToInclude:()=>["Name","ContainedInStructure","HasProperties","HasPropertySets",t=>t.includes("Value"),t=>t.startsWith("Material"),t=>t.startsWith("Relating"),t=>{const c=["IsGroupedBy","IsDecomposedBy"];return t.startsWith("Is")&&!c.includes(t)}]});n.expanded=!0;n.indentationInText=!0;n.preserveStructureOnFilter=!0;const h=o.get(N);h.setup({world:a});h.events.select.onHighlight.add(e=>{m({fragmentIdMap:e})});h.events.select.onClear.add(()=>m({fragmentIdMap:{}}));const G=R.create(()=>p` +import"./modulepreload-polyfill-B5Qt9EMX.js";import{p as I,a as v,C as T,i as A,n as P,k as $,u as E,R as W,W as L,S as N,J as R,h as p,D as b,j as D,I as H}from"./template-DtWW1qyz.js";import{t as O}from"./index-CAZguOLS.js";I.init();const o=new v,V=o.get(T),a=V.create(),w=new A(o);w.setup();a.scene=w;const d=document.createElement("bim-viewport"),S=new P(o,d);a.renderer=S;const u=new $(o);a.camera=u;u.controls.setLookAt(10,5.5,5,-4,-1,-6.5);d.addEventListener("resize",()=>{S.resize(),u.updateAspect()});o.init();const B=o.get(E);B.create(a);const C=o.get(W);await C.setup();const J=await fetch("https://thatopen.github.io/engine_ui-components/resources/small.ifc"),M=await J.arrayBuffer(),F=new Uint8Array(M),x=await C.load(F);a.scene.three.add(x);const j=o.get(L);await j.process(x);const l={padding:"0.25rem",borderRadius:"0.25rem"},z={Entity:e=>{let t={};return e===D[H]&&(t={...l,backgroundColor:"purple",color:"white"}),String(e).includes("IFCWALL")&&(t={...l,backgroundColor:"green",color:"white"}),p`${e}`},PredefinedType:e=>{const t=["#1c8d83","#3c1c8d","#386c19","#837c24"],c=Math.floor(Math.random()*t.length),g=t[c],f={...l,backgroundColor:g,color:"white"};return p`${e}`},NominalValue:e=>{let t={};return typeof e=="boolean"&&e===!1&&(t={...l,backgroundColor:"#b13535",color:"white"}),typeof e=="boolean"&&e===!0&&(t={...l,backgroundColor:"#18882c",color:"white"}),p`${e}`}},[n,m]=O.entityAttributes({components:o,fragmentIdMap:{},tableDefinition:z,attributesToInclude:()=>["Name","ContainedInStructure","HasProperties","HasPropertySets",t=>t.includes("Value"),t=>t.startsWith("Material"),t=>t.startsWith("Relating"),t=>{const c=["IsGroupedBy","IsDecomposedBy"];return t.startsWith("Is")&&!c.includes(t)}]});n.expanded=!0;n.indentationInText=!0;n.preserveStructureOnFilter=!0;const h=o.get(N);h.setup({world:a});h.events.select.onHighlight.add(e=>{m({fragmentIdMap:e})});h.events.select.onClear.add(()=>m({fragmentIdMap:{}}));const G=R.create(()=>p`
diff --git a/examples/assets/grid.js b/examples/assets/grid.js index 1c25f635..a71e06ce 100644 --- a/examples/assets/grid.js +++ b/examples/assets/grid.js @@ -1,4 +1,4 @@ -import"./modulepreload-polyfill-B5Qt9EMX.js";import{e as d,i as u,t as p,M as g,C as b,n as h}from"./index-BRXkzNmn.js";import{w as f,x as r}from"./state-CdSmRkb4.js";/** +import"./modulepreload-polyfill-B5Qt9EMX.js";import{e as d,i as u,t as p,M as g,C as b,n as h}from"./index-DhhQtOkc.js";import{w as f,x as r}from"./state-HK6D0hVF.js";/** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause diff --git a/examples/assets/index-BdZzXOWY.js b/examples/assets/index-BdZzXOWY.js deleted file mode 100644 index 9bac847d..00000000 --- a/examples/assets/index-BdZzXOWY.js +++ /dev/null @@ -1,43 +0,0 @@ -import{b as V,j as A,h as P,q as k,W,l as H,A as ne,I as J,r as B,s as Q,v as oe,w as ie,y as Y,z as K,D as U,H as re,J as se,S as ae,C as X,P as _,K as G,x as S,N as ce,Q as le,T as ue,g as F,u as de}from"./index-iHSjA6qM.js";const fe=n=>{const{components:i}=n,o=i.get(V),a=document.createElement("bim-table");a.columns=["Model"],a.headersHidden=!0;const s=[];for(const[,r]of o.groups){if(!r)continue;const l={data:{Model:r.name||r.uuid,Actions:r.uuid}};s.push(l)}return a.dataTransform={Actions:r=>{if(typeof r!="string")return r;const l=o.groups.get(r);return l?A` - {l.visible=!l.visible;const I=d.target;I.icon=l.visible?"mdi:eye":"mdi:eye-off"}} icon="mdi:eye"> - o.disposeGroup(l)} icon="mdi:delete"> - `:r}},a.columns=["Model",{name:"Actions",width:"auto"}],a.data=s,A` -
- ${s.length===0?A`No models has been loaded yet`:a} -
- `},me=(n,i=!0)=>{const o=P.create(fe,n);if(i){const{components:a}=n,s=a.get(V),[,r]=o;s.onFragmentsLoaded.add(()=>setTimeout(()=>r())),s.onFragmentsDisposed.add(()=>r())}return o},pe=Object.freeze(Object.defineProperty({__proto__:null,modelsList:me},Symbol.toStringTag,{value:"Module"})),Z=["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 j(n,i,o,a=Z,s=!1){const r=n.get(W),l=await i.getProperties(o);if(!l)return{data:{Entity:`${o} properties not found...`}};const p=r.relationMaps[i.uuid],u={data:{}};for(const d in l){const I=a.map(e=>typeof e=="string"?d===e:e(d)).includes(!0);if(!(d==="type"||I))continue;const g=l[d];if(g)if(g.type===5){u.children||(u.children=[]);const e=await j(n,i,g.value,a,s);u.children.push(e)}else if(typeof g=="object"&&!Array.isArray(g)){const{value:e,type:t}=g;if(s)t===1||t===2||t===3||(u.data[d]=e);else{const f=typeof e=="number"?Number(e.toFixed(3)):e;u.data[d]=f}}else if(Array.isArray(g))for(const e of g){if(e.type!==5)continue;u.children||(u.children=[]);const t=await j(n,i,e.value,a,s);u.children.push(t)}else if(d==="type"){const e=H[g];u.data.Entity=e}else u.data[d]=g}if(p&&p.get(l.expressID)){const d=p.get(l.expressID);for(const I of a){const g=[];if(typeof I=="string"){const e=r._inverseAttributes.indexOf(I);e!==-1&&g.push(e)}else{const e=r._inverseAttributes.filter(t=>I(t));for(const t of e){const f=r._inverseAttributes.indexOf(t);g.push(f)}}for(const e of g){const t=d.get(e);if(t)for(const f of t){const y=await j(n,i,f,a,s);u.children||(u.children=[]),u.children.push(y)}}}}return u}const ge=n=>{const{components:i,fragmentIdMap:o,attributesToInclude:a,editable:s,tableDefinition:r}=n,l=i.get(V);let p;return typeof a=="function"?p=a(Z):p=a,A`{if(!d)return;const I=d,g=[],e=[];for(const t in o){const f=l.list.get(t);if(!(f&&f.group))continue;const y=f.group,w=e.find(b=>b.model===y);if(w)for(const b of o[t])w.expressIDs.add(b);else{const b={model:y,expressIDs:new Set(o[t])};e.push(b)}}for(const t of e){const{model:f,expressIDs:y}=t;for(const w of y){const b=await j(i,f,w,p,s);g.push(b)}}I.dataTransform=r,I.data=g,I.columns=[{name:"Entity",width:"minmax(15rem, 1fr)"}]})}>`},he=n=>P.create(ge,n),ye=Object.freeze(Object.defineProperty({__proto__:null,entityAttributes:he},Symbol.toStringTag,{value:"Module"}));function be(n){const i=Object.keys(n).pop();return i&&n[i].length>0?n[i][0]:""}function ee(n){return n.map(i=>{const o={data:{System:be(i.filter)}};return i.children&&i.children.length>0&&(o.children=ee(i.children)),o})}const Ce=n=>{const{components:i,classifications:o}=n,a=i.get(ne),s=r=>{if(!r)return;const l=r;l.dataTransform={Actions:d=>d};const p=(d,I={})=>{const g=a.list,e=d[0],t=g[e],f=[];if(!e||!t)return f;for(const y in t){const w={...I,[e]:[y]},b=a.find(w);if(Object.keys(b).length>0){const m={filter:w};m.children=p(d.slice(1),w),f.push(m)}}return f},u=[];for(const d in o){const I=o[d],g=p(I),e=ee(g);u.push({data:{System:d},children:e})}l.data=u};return A` -
- ${Object.keys(o).length===0?A``:A``} -
- `},Ie=(n,i=!0)=>{const o=P.create(Ce,n);if(i){const{components:a}=n,s=a.get(V),[,r]=o;s.onFragmentsDisposed.add(()=>r())}return o},we=Object.freeze(Object.defineProperty({__proto__:null,classificationTree:Ie},Symbol.toStringTag,{value:"Module"})),xe=["OwnerHistory","ObjectPlacement","CompositionType"],z=async(n,i,o)=>{const s={...{groupName:"Attributes",includeClass:!1},...o},{groupName:r,includeClass:l}=s,p=await n.getProperties(i)??{},u={data:{Name:r}};l&&(u.children||(u.children=[]),u.children.push({data:{Name:"Class",Value:H[p.type]}}));for(const d in p){if(xe.includes(d))continue;const I=p[d];if(I&&typeof I=="object"&&!Array.isArray(I)){if(I.type===re)continue;const g={data:{Name:d,Value:I.value}};u.children||(u.children=[]),u.children.push(g)}}return u},Ne=async(n,i)=>{const o={data:{Name:"Property Sets"}};for(const a of i){const s=await n.getProperties(a);if(!s)continue;const r={data:{Name:s.Name.value}};if(s.type===J){for(const l of s.HasProperties){const{value:p}=l,u=await n.getProperties(p);if(!u)continue;const d=Object.keys(u).find(g=>g.includes("Value"));if(!(d&&u[d]))continue;const I={data:{Name:u.Name.value,Value:u[d].value}};r.children||(r.children=[]),r.children.push(I)}r.children&&(o.children||(o.children=[]),o.children.push(r))}}return o},Ae=async(n,i)=>{const o={data:{Name:"Quantity Sets"}};for(const a of i){const s=await n.getProperties(a);if(!s)continue;const r={data:{Name:s.Name.value}};if(s.type===B){for(const l of s.Quantities){const{value:p}=l,u=await n.getProperties(p);if(!u)continue;const d=Object.keys(u).find(g=>g.includes("Value"));if(!(d&&u[d]))continue;const I={data:{Name:u.Name.value,Value:u[d].value}};r.children||(r.children=[]),r.children.push(I)}r.children&&(o.children||(o.children=[]),o.children.push(r))}}return o},Se=async(n,i)=>{const o={data:{Name:"Materials"}};for(const a of i){const s=await n.getProperties(a);if(s.type===Q){const r=s.ForLayerSet.value,l=await n.getProperties(r);for(const p of l.MaterialLayers){const{value:u}=p,d=await n.getProperties(u),I=await n.getProperties(d.Material.value),g={data:{Name:"Layer"},children:[{data:{Name:"Thickness",Value:d.LayerThickness.value}},{data:{Name:"Material",Value:I.Name.value}}]};o.children||(o.children=[]),o.children.push(g)}}if(s.type===K)for(const r of s.Materials){const{value:l}=r,u={data:{Name:"Name",Value:(await n.getProperties(l)).Name.value}};o.children||(o.children=[]),o.children.push(u)}if(s.type===Y){const l={data:{Name:"Name",Value:(await n.getProperties(a)).Name.value}};o.children||(o.children=[]),o.children.push(l)}}return o},Re=async(n,i)=>{var a,s;const o={data:{Name:"Classifications"}};for(const r of i){const l=await n.getProperties(r);if(l.type===U){const{value:p}=l.ReferencedSource,d={data:{Name:(await n.getProperties(p)).Name.value},children:[{data:{Name:"Identification",Value:((a=l.Identification)==null?void 0:a.value)||((s=l.ItemReference)==null?void 0:s.value)}},{data:{Name:"Name",Value:l.Name.value}}]};o.children||(o.children=[]),o.children.push(d)}}return o},Ee=n=>{const{components:i,fragmentIdMap:o}=n,a=i.get(W),s=i.get(V);return A`{var I;if(!l)return;const p=[],u=[];for(const g in o){const e=s.list.get(g);if(!(e&&e.group))continue;const t=e.group,f=u.find(y=>y.model===t);if(f)for(const y of o[g])f.expressIDs.add(y);else{const y={model:t,expressIDs:new Set(o[g])};u.push(y)}}for(const g in u){const{model:e,expressIDs:t}=u[g],f=a.relationMaps[e.uuid];if(!f)return;for(const y of t){const w=await e.getProperties(y);if(!w)continue;const b={data:{Name:(I=w.Name)==null?void 0:I.value}};p.push(b);const c=await z(e,y,{includeClass:!0});if(b.children||(b.children=[]),b.children.push(c),!f.get(y))continue;const h=a.getEntityRelations(e,y,"IsDefinedBy");if(h){const E=h.filter(async D=>{const R=await e.getProperties(D);return R?R.type===J:!1}),O=await Ne(e,E);O.children&&b.children.push(O);const $=h.filter(async D=>{const R=await e.getProperties(D);return R?R.type===B:!1}),L=await Ae(e,$);L.children&&b.children.push(L)}const C=a.getEntityRelations(e,y,"HasAssociations");if(C){const E=C.filter(async D=>{const R=await e.getProperties(D);return R?R.type===Q||R.type===oe||R.type===ie||R.type===Y||R.type===K:!1}),O=await Se(e,E);O.children&&b.children.push(O);const $=C.filter(async D=>{const R=await e.getProperties(D);return R?R.type===U:!1}),L=await Re(e,$);L.children&&b.children.push(L)}const N=a.getEntityRelations(e,y,"ContainedInStructure");if(N){const E=N[0],O=await z(e,E,{groupName:"SpatialContainer"});b.children.push(O)}}}const d=l;d.addEventListener("cellcreated",({detail:g})=>{const e=g.cell.parentNode;if(!e)return;const t=e.querySelector("bim-table-cell[column='Name']"),f=e.querySelector("bim-table-cell[column='Value']");t&&!f&&(t.style.gridColumn="1 / -1")}),d.columns=[{name:"Name",width:"12rem"}],d.data=p})} headers-hidden>`},Oe=n=>P.create(Ee,n),De=Object.freeze(Object.defineProperty({__proto__:null,elementProperties:Oe},Symbol.toStringTag,{value:"Module"})),v=async(n,i,o,a)=>{var d;const s=[],r=n.get(W),l=await i.getProperties(o);if(!l)return s;const{type:p}=l,u={data:{Entity:H[p],Name:(d=l.Name)==null?void 0:d.value,modelID:i.uuid}};for(const I of a){const g=r.getEntityRelations(i,o,I);if(u.data.expressID=o,!!g){u.data.relations=JSON.stringify(g);for(const e of g){const t=await v(n,i,e,a);u.children||(u.children=[]),u.children.push(...t)}}}return s.push(u),s},q=(n,i)=>{const o=n.get(V),{modelID:a,expressID:s,relations:r}=i.data;if(!(a&&s))return null;const l=o.groups.get(a);return l?l.getFragmentMap([s,...JSON.parse(r??"[]")]):null},Te=n=>{const{components:i,models:o,inverseAttributes:a,expressID:s,selectHighlighterName:r,hoverHighlighterName:l}=n,p=a??["IsDecomposedBy","ContainsElements"];return A`{if(!d)return;const I=i.get(W),g=[];for(const t of o){let f;if(s)f={data:{Entity:t.name!==""?t.name:t.uuid},children:await v(i,t,s,p)};else{const y=I.relationMaps[t.uuid],w=await t.getAllPropertiesOfType(se);if(!(y&&w))continue;const{expressID:b}=Object.values(w)[0];f={data:{Entity:t.name!==""?t.name:t.uuid},children:await v(i,t,b,p)}}g.push(f)}const e=d;e.addEventListener("rowcreated",({detail:t})=>{const{row:f}=t,y=i.get(ae);f.onmouseover=()=>{if(!l)return;const w=q(i,f);w&&Object.keys(w).length!==0&&(f.style.backgroundColor="var(--bim-ui_bg-contrast-20)",y.highlightByID(l,w,!0,!1))},f.onmouseout=()=>{f.style.backgroundColor="",y.clear(l)},f.onclick=()=>{if(!r)return;const w=q(i,f);w&&Object.keys(w).length!==0&&y.highlightByID(r,w,!0,!0)}}),e.addEventListener("cellcreated",({detail:t})=>{const f=t.cell.parentNode;if(!f)return;const y=f.querySelector("bim-table-cell[column='Entity']"),w=f.querySelector("bim-table-cell[column='Name']");y&&!w&&(y.style.gridColumn="1 / -1")}),e.hiddenColumns=["modelID","expressID","relations"],e.columns=["Entity","Name"],e.data=g})} headers-hidden>`},Le=(n,i=!0)=>{const o=P.create(Te,n);if(i){const[,a]=o,{components:s}=n,r=s.get(V),l=s.get(W),p=()=>a({models:r.groups.values()});l.onRelationsIndexed.add(p),r.onFragmentsDisposed.add(p)}return o},Ve=Object.freeze(Object.defineProperty({__proto__:null,relationsTree:Le},Symbol.toStringTag,{value:"Module"})),M=(n,i)=>[...n.get(de).list.values()].find(s=>s.world===i),Pe=(n,i)=>A` - {const s=a.target;n.color=new F(s.color)}} color=${i}> - `,$e=(n,i)=>{const{postproduction:o}=n,a=o.n8ao.configuration;return A` - {const l=r.target;a.color=new F(l.color)}} color=${i}> - `},Ge=(n,i)=>{const{color:o,opacity:a}=JSON.parse(i),{postproduction:s}=n,{customEffects:r}=s;return A` - {const{color:u,opacity:d}=p.target;r.lineColor=new F(u).getHex(),d&&(r.opacity=d/100)}} color=${o} opacity=${a*100}> - `},Me=(n,i)=>A` - {const s=a.target,r=new F(s.color);n.material.uniforms.uColor.value=r,console.log(n.material.uniforms)}} color=${i}> - `,ke=(n,i)=>{const{postproduction:o}=n;return A` - {const r=s.target;o.setPasses({ao:r.checked})}} .checked=${i}> - `},We=(n,i)=>{const{postproduction:o}=n;return A` - {const r=s.target;o.setPasses({gamma:r.checked})}} .checked=${i}> - `},Fe=(n,i)=>{const{postproduction:o}=n;return A` - {const r=s.target;o.setPasses({custom:r.checked})}} .checked=${i}> - `},T=(n,i,o,a=()=>{})=>A` - - `,x=(n,i,o,a)=>{const s={slider:!1,min:0,max:100,step:1,prefix:null,suffix:null,onInputSet:()=>{},...a},{slider:r,min:l,max:p,step:u,suffix:d,prefix:I,onInputSet:g}=s;return A` - - `},_e=n=>{const{components:i}=n,o=i.get(X);return A`{var p,u,d,I,g;if(!s)return;const r=s;r.preserveStructureOnFilter=!0,r.dataTransform={Value:(e,t)=>{const f=t.World,y=o.list.get(f);if(!y)return e;const{scene:w,camera:b,renderer:c}=y,m=t.Name;if(m==="Grid"&&t.IsGridConfig&&typeof e=="boolean"){const h=M(i,y);return h?T(h,"visible",e):e}if(m==="Color"&&t.IsGridConfig&&typeof e=="string"){const h=M(i,y);return h?Me(h,e):e}if(m==="Distance"&&t.IsGridConfig&&typeof e=="number"){const h=M(i,y);return h?x(h.material.uniforms.uDistance,"value",e,{slider:!0,min:300,max:1e3}):e}if(m==="Size"&&t.IsGridConfig&&typeof e=="string"){const h=M(i,y);if(!h)return e;const{x:C,y:N}=JSON.parse(e),E=x(h.material.uniforms.uSize1,"value",C,{slider:!0,suffix:"m",prefix:"A",min:1,max:20}),O=x(h.material.uniforms.uSize2,"value",N,{slider:!0,suffix:"m",prefix:"B",min:1,max:20});return A` -
${E}${O}
- `}if(m==="Near Frustum"&&b.three instanceof _&&typeof e=="number"){const h=b.three;return x(b.three,"near",e,{slider:!0,min:.1,max:10,step:.1,onInputSet:()=>h.updateProjectionMatrix()})}if(m==="Far Frustum"&&b.three instanceof _&&typeof e=="number"){const h=b.three;return x(b.three,"far",e,{slider:!0,min:300,max:2e3,step:10,onInputSet:()=>h.updateProjectionMatrix()})}if(m==="Field of View"&&b.three instanceof _&&typeof e=="number"){const h=b.three;return x(b.three,"fov",e,{slider:!0,min:10,max:120,onInputSet:()=>h.updateProjectionMatrix()})}if(m==="Invert Drag"&&b.hasCameraControls()&&typeof e=="boolean")return T(b.controls,"dollyDragInverted",e);if(m==="Dolly Speed"&&b.hasCameraControls()&&typeof e=="number")return x(b.controls,"dollySpeed",e,{slider:!0,min:.5,max:3,step:.1});if(m==="Truck Speed"&&b.hasCameraControls()&&typeof e=="number")return x(b.controls,"truckSpeed",e,{slider:!0,min:.5,max:6,step:.1});if(m==="Smooth Time"&&b.hasCameraControls()&&typeof e=="number")return x(b.controls,"smoothTime",e,{slider:!0,min:.01,max:2,step:.01});if(m==="Intensity"&&typeof e=="number"){if(t.Light&&typeof t.Light=="string"){const h=w.three.children.find(C=>C.uuid===t.Light);return h&&h instanceof G?x(h,"intensity",e,{slider:!0,min:0,max:10,step:.1}):e}if(t.IsAOConfig&&c instanceof S)return x(c.postproduction.n8ao.configuration,"intensity",e,{slider:!0,max:16,step:.1})}if(m==="Color"&&typeof e=="string"){const h=t.Light,C=w.three.children.find(N=>N.uuid===h);if(C&&C instanceof G)return Pe(C,e);if(t.IsAOConfig&&c instanceof S)return $e(c,e)}if(m==="Ambient Oclussion"&&typeof e=="boolean"&&t.IsAOConfig&&c instanceof S)return ke(c,e);if(m==="Half Resolution"&&t.IsAOConfig&&c instanceof S&&typeof e=="boolean")return T(c.postproduction.n8ao.configuration,"halfRes",e);if(m==="Screen Space Radius"&&t.IsAOConfig&&c instanceof S&&typeof e=="boolean")return T(c.postproduction.n8ao.configuration,"screenSpaceRadius",e);if(m==="Radius"&&t.IsAOConfig&&c instanceof S&&typeof e=="number")return x(c.postproduction.n8ao.configuration,"aoRadius",e,{slider:!0,max:2,step:.1});if(m==="Denoise Samples"&&t.IsAOConfig&&c instanceof S&&typeof e=="number")return x(c.postproduction.n8ao.configuration,"denoiseSamples",e,{slider:!0,min:1,max:16});if(m==="Samples"&&t.IsAOConfig&&c instanceof S&&typeof e=="number")return x(c.postproduction.n8ao.configuration,"aoSamples",e,{slider:!0,min:1,max:16});if(m==="Denoise Radius"&&t.IsAOConfig&&c instanceof S&&typeof e=="number")return x(c.postproduction.n8ao.configuration,"denoiseRadius",e,{slider:!0,min:0,max:16,step:.1});if(m==="Distance Falloff"&&t.IsAOConfig&&c instanceof S&&typeof e=="number")return x(c.postproduction.n8ao.configuration,"distanceFalloff",e,{slider:!0,min:0,max:4,step:.1});if(m==="Directional Light"&&t.Light&&typeof t.Light=="string"&&typeof e=="boolean"){const h=w.three.children.find(C=>C.uuid===t.Light);return h&&h instanceof G?T(h,"visible",e):e}if(m==="Ambient Light"&&t.Light&&typeof t.Light=="string"&&typeof e=="boolean"){const h=w.three.children.find(C=>C.uuid===t.Light);return h&&h instanceof G?T(h,"visible",e):e}if(m==="Position"&&t.Light&&typeof t.Light=="string"&&typeof e=="string"){const h=w.three.children.find(D=>D.uuid===t.Light);if(!(h&&h instanceof G))return e;const{x:C,y:N,z:E}=JSON.parse(e),O=x(h.position,"x",C,{slider:!0,prefix:"X",suffix:"m",min:-50,max:50}),$=x(h.position,"y",N,{slider:!0,prefix:"Y",suffix:"m",min:-50,max:50}),L=x(h.position,"z",E,{slider:!0,prefix:"Z",suffix:"m",min:-50,max:50});return A` -
${O}${$}${L}
- `}return m==="Custom Effects"&&t.IsCEConfig&&c instanceof S&&typeof e=="boolean"?Fe(c,e):m==="Color"&&t.IsOutlineConfig&&c instanceof S&&typeof e=="string"?Ge(c,e):m==="Tolerance"&&t.IsOutlineConfig&&c instanceof S&&typeof e=="number"?x(c.postproduction.customEffects,"tolerance",e,{slider:!0,min:0,max:6,step:.01}):m==="Outline"&&t.IsOutlineConfig&&c instanceof S&&typeof e=="boolean"?T(c.postproduction.customEffects,"outlineEnabled",e):m==="Gloss"&&t.IsGlossConfig&&c instanceof S&&typeof e=="boolean"?T(c.postproduction.customEffects,"glossEnabled",e):m==="Min"&&t.IsGlossConfig&&c instanceof S&&typeof e=="number"?x(c.postproduction.customEffects,"minGloss",e,{slider:!0,min:-.5,max:.5,step:.01}):m==="Max"&&t.IsGlossConfig&&c instanceof S&&typeof e=="number"?x(c.postproduction.customEffects,"maxGloss",e,{slider:!0,min:-.5,max:.5,step:.01}):m==="Exponent"&&t.IsGlossConfig&&c instanceof S&&typeof e=="number"?x(c.postproduction.customEffects,"glossExponent",e,{slider:!0,min:0,max:5,step:.01}):m==="Gamma Correction"&&t.IsGammaConfig&&c instanceof S&&typeof e=="boolean"?We(c,e):e}},r.addEventListener("cellcreated",({detail:e})=>{const t=e.cell.parentNode;if(!t)return;const f=t.querySelector("bim-table-cell[column='Name']"),y=t.querySelector("bim-table-cell[column='Value']");f&&!y&&(f.style.gridColumn="1 / -1")});const l=[];for(const[,e]of o.list){const{scene:t,camera:f,renderer:y}=e,w=M(i,e),b={data:{Name:e instanceof ce&&e.name||e.uuid},children:[]};if(t){const c={data:{Name:"Scene"}};if(w){const C={data:{Name:"Grid",Value:w.three.visible,World:e.uuid,IsGridConfig:!0},children:[{data:{Name:"Color",get Value(){return`#${w.material.uniforms.uColor.value.getHexString()}`},World:e.uuid,IsGridConfig:!0}},{data:{Name:"Size",get Value(){const N=w.material.uniforms.uSize1.value,E=w.material.uniforms.uSize2.value;return JSON.stringify({x:N,y:E})},World:e.uuid,IsGridConfig:!0}},{data:{Name:"Distance",Value:w.material.uniforms.uDistance.value,World:e.uuid,IsGridConfig:!0}}]};c.children||(c.children=[]),c.children.push(C)}const m=t.three.children.filter(C=>C instanceof le);for(const C of m){const N={data:{Name:"Directional Light",Value:C.visible,World:e.uuid,Light:C.uuid},children:[{data:{Name:"Position",Value:JSON.stringify(C.position),World:e.uuid,Light:C.uuid}},{data:{Name:"Intensity",Value:C.intensity,World:e.uuid,Light:C.uuid}},{data:{Name:"Color",Value:`#${C.color.getHexString()}`,World:e.uuid,Light:C.uuid}}]};c.children||(c.children=[]),c.children.push(N)}const h=t.three.children.filter(C=>C instanceof ue);for(const C of h){const N={data:{Name:"Ambient Light",Value:C.visible,World:e.uuid,Light:C.uuid},children:[{data:{Name:"Intensity",Value:C.intensity,World:e.uuid,Light:C.uuid}},{data:{Name:"Color",Value:`#${C.color.getHexString()}`,World:e.uuid,Light:C.uuid}}]};c.children||(c.children=[]),c.children.push(N)}c.children&&((p=c.children)==null?void 0:p.length)>0&&((u=b.children)==null||u.push(c))}if(f.three instanceof _){const c={data:{Name:"Perspective Camera"},children:[{data:{Name:"Near Frustum",Value:f.three.near,World:e.uuid}},{data:{Name:"Far Frustum",Value:f.three.far,World:e.uuid}},{data:{Name:"Field of View",Value:f.three.fov,World:e.uuid}}]};if(f.hasCameraControls()){const{controls:m}=f,h={dollyDragInverted:"Invert Drag",dollySpeed:"Dolly Speed",truckSpeed:"Truck Speed",smoothTime:"Smooth Time"};for(const C in h){const N=m[C];N!=null&&((d=c.children)==null||d.push({data:{Name:h[C],Value:N,World:e.uuid}}))}}(I=b.children)==null||I.push(c)}if(y instanceof S){const{postproduction:c}=y,m=c.n8ao.configuration,h={data:{Name:"Renderer"},children:[{data:{Name:"Gamma Correction",Value:c.settings.gamma??!1,World:e.uuid,IsGammaConfig:!0}},{data:{Name:"Ambient Oclussion",Value:c.settings.ao??!1,World:e.uuid,IsAOConfig:!0},children:[{data:{Name:"Samples",Value:m.aoSamples,World:e.uuid,IsAOConfig:!0}},{data:{Name:"Color",Value:`#${m.color.getHexString()}`,World:e.uuid,IsAOConfig:!0}},{data:{Name:"Half Resolution",Value:m.halfRes,World:e.uuid,IsAOConfig:!0}},{data:{Name:"Screen Space Radius",Value:m.screenSpaceRadius,World:e.uuid,IsAOConfig:!0}},{data:{Name:"Radius",Value:m.aoRadius,World:e.uuid,IsAOConfig:!0}},{data:{Name:"Intensity",Value:m.intensity,World:e.uuid,IsAOConfig:!0}},{data:{Name:"Distance Falloff",Value:m.distanceFalloff,World:e.uuid,IsAOConfig:!0}},{data:{Name:"Denoise Samples",Value:m.denoiseSamples,World:e.uuid,IsAOConfig:!0}},{data:{Name:"Denoise Radius",Value:m.denoiseRadius,World:e.uuid,IsAOConfig:!0}}]},{data:{Name:"Custom Effects",Value:c.settings.custom??!1,World:e.uuid,IsCEConfig:!0},children:[{data:{Name:"Gloss",Value:c.customEffects.glossEnabled,World:e.uuid,IsGlossConfig:!0},children:[{data:{Name:"Min",Value:c.customEffects.minGloss,World:e.uuid,IsGlossConfig:!0}},{data:{Name:"Max",Value:c.customEffects.maxGloss,World:e.uuid,IsGlossConfig:!0}},{data:{Name:"Exponent",Value:c.customEffects.glossExponent,World:e.uuid,IsGlossConfig:!0}}]},{data:{Name:"Outline",Value:c.customEffects.outlineEnabled,World:e.uuid,IsOutlineConfig:!0},children:[{data:{Name:"Color",get Value(){const C=new F(c.customEffects.lineColor),N=c.customEffects.opacity;return JSON.stringify({color:`#${C.getHexString()}`,opacity:N})},World:e.uuid,IsOutlineConfig:!0}},{data:{Name:"Tolerance",Value:c.customEffects.tolerance,World:e.uuid,IsOutlineConfig:!0}}]}]}]};(g=b.children)==null||g.push(h)}l.push(b)}r.columns=[{name:"Name",width:"11rem"}],r.hiddenColumns=["World","Light","IsAOConfig","IsCEConfig","IsGlossConfig","IsOutlineConfig","IsGammaConfig","IsGridConfig"],r.data=l})} headers-hidden expanded>
`},je=(n,i=!0)=>{const o=P.create(_e,n);if(i){const[a]=o,s=()=>o[1](),{components:r}=n,l=r.get(X);l.onDisposed.add(a.remove);for(const[,p]of l.list)p.onDisposed.add(s);a.addEventListener("disconnected",()=>{l.onDisposed.remove(a.remove);for(const[,p]of l.list)p.onDisposed.remove(s)})}return o},ve=Object.freeze(Object.defineProperty({__proto__:null,worldsConfiguration:je},Symbol.toStringTag,{value:"Module"})),ze={...pe,...ye,...we,...De,...Ve,...ve};export{ze as t}; diff --git a/examples/assets/index-CAZguOLS.js b/examples/assets/index-CAZguOLS.js new file mode 100644 index 00000000..27da662b --- /dev/null +++ b/examples/assets/index-CAZguOLS.js @@ -0,0 +1,43 @@ +import{b as V,h as w,J as $,l as R,W as _,j as J,A as B,q,r as K,C as P,P as T,s as E,x as O,t as Q,v as X,w as Y,g as L,u as Z}from"./template-DtWW1qyz.js";const U=o=>{const{components:i}=o,s=i.get(V),a=document.createElement("bim-table");a.columns=["Model"],a.headersHidden=!0;const l=[];for(const[,r]of s.groups){if(!r)continue;const f={data:{Model:r.name||r.uuid,Actions:r.uuid}};l.push(f)}return a.dataTransform={Actions:r=>{if(typeof r!="string")return r;const f=s.groups.get(r);return f?w` + {f.visible=!f.visible;const S=m.target;S.icon=f.visible?"mdi:eye":"mdi:eye-off"}} icon="mdi:eye"> + s.disposeGroup(f)} icon="mdi:delete"> + `:r}},a.columns=["Model",{name:"Actions",width:"auto"}],a.data=l,w` +
+ ${l.length===0?w`No models has been loaded yet`:a} +
+ `},v=(o,i=!0)=>{const s=$.create(U,o);if(i){const{components:a}=o,l=a.get(V),[,r]=s;l.onFragmentsLoaded.add(()=>setTimeout(()=>r())),l.onFragmentsDisposed.add(()=>r())}return s},ee=Object.freeze(Object.defineProperty({__proto__:null,modelsList:v},Symbol.toStringTag,{value:"Module"})),j=["Name","ContainedInStructure","ForLayerSet","LayerThickness","HasProperties","HasAssociations","HasAssignments","HasPropertySets","PredefinedType","Quantities","ReferencedSource","Identification",o=>o.includes("Value"),o=>o.startsWith("Material"),o=>o.startsWith("Relating"),o=>{const i=["IsGroupedBy","IsDecomposedBy"];return o.startsWith("Is")&&!i.includes(o)}];async function D(o,i,s,a=j,l=!1){const r=o.get(_),f=await i.getProperties(s);if(!f)return{data:{Entity:`${s} properties not found...`}};const g=r.relationMaps[i.uuid],b={data:{}};for(const m in f){const S=a.map(e=>typeof e=="string"?m===e:e(m)).includes(!0);if(!(m==="type"||S))continue;const y=f[m];if(y)if(y.type===5){b.children||(b.children=[]);const e=await D(o,i,y.value,a,l);b.children.push(e)}else if(typeof y=="object"&&!Array.isArray(y)){const{value:e,type:t}=y;if(l)t===1||t===2||t===3||(b.data[m]=e);else{const h=typeof e=="number"?Number(e.toFixed(3)):e;b.data[m]=h}}else if(Array.isArray(y))for(const e of y){if(e.type!==5)continue;b.children||(b.children=[]);const t=await D(o,i,e.value,a,l);b.children.push(t)}else if(m==="type"){const e=J[y];b.data.Entity=e}else b.data[m]=y}if(g&&g.get(f.expressID)){const m=g.get(f.expressID);for(const S of a){const y=[];if(typeof S=="string"){const e=r._inverseAttributes.indexOf(S);e!==-1&&y.push(e)}else{const e=r._inverseAttributes.filter(t=>S(t));for(const t of e){const h=r._inverseAttributes.indexOf(t);y.push(h)}}for(const e of y){const t=m.get(e);if(t)for(const h of t){const C=await D(o,i,h,a,l);b.children||(b.children=[]),b.children.push(C)}}}}return b}const te=o=>{const{components:i,fragmentIdMap:s,attributesToInclude:a,editable:l,tableDefinition:r}=o,f=i.get(V);let g;return typeof a=="function"?g=a(j):g=a,w`{if(!m)return;const S=m,y=[],e=[];for(const t in s){const h=f.list.get(t);if(!(h&&h.group))continue;const C=h.group,x=e.find(p=>p.model===C);if(x)for(const p of s[t])x.expressIDs.add(p);else{const p={model:C,expressIDs:new Set(s[t])};e.push(p)}}for(const t of e){const{model:h,expressIDs:C}=t;for(const x of C){const p=await D(i,h,x,g,l);y.push(p)}}S.dataTransform=r,S.data=y,S.columns=[{name:"Entity",width:"minmax(15rem, 1fr)"}]})}>`},ne=o=>$.create(te,o),oe=Object.freeze(Object.defineProperty({__proto__:null,entityAttributes:ne},Symbol.toStringTag,{value:"Module"}));function ie(o){const i=Object.keys(o).pop();return i&&o[i].length>0?o[i][0]:""}function M(o){return o.map(i=>{const s={data:{System:ie(i.filter)}};return i.children&&i.children.length>0&&(s.children=M(i.children)),s})}const re=o=>{const{components:i,classifications:s}=o,a=i.get(B),l=r=>{if(!r)return;const f=r;f.dataTransform={Actions:m=>m};const g=(m,S={})=>{const y=a.list,e=m[0],t=y[e],h=[];if(!e||!t)return h;for(const C in t){const x={...S,[e]:[C]},p=a.find(x);if(Object.keys(p).length>0){const c={filter:x};c.children=g(m.slice(1),x),h.push(c)}}return h},b=[];for(const m in s){const S=s[m],y=g(S),e=M(y);b.push({data:{System:m},children:e})}f.data=b};return w` +
+ ${Object.keys(s).length===0?w``:w``} +
+ `},se=(o,i=!0)=>{const s=$.create(re,o);if(i){const{components:a}=o,l=a.get(V),[,r]=s;l.onFragmentsDisposed.add(()=>r())}return s},ce=Object.freeze(Object.defineProperty({__proto__:null,classificationTree:se},Symbol.toStringTag,{value:"Module"})),ae=o=>$.create(q,o),ue=Object.freeze(Object.defineProperty({__proto__:null,elementProperties:ae},Symbol.toStringTag,{value:"Module"})),le=(o,i=!0)=>{const s=$.create(K,o);if(i){const[,a]=s,{components:l}=o,r=l.get(V),f=l.get(_),g=()=>a({models:r.groups.values()});f.onRelationsIndexed.add(g),r.onFragmentsDisposed.add(g)}return s},de=Object.freeze(Object.defineProperty({__proto__:null,relationsTree:le},Symbol.toStringTag,{value:"Module"})),W=(o,i)=>[...o.get(Z).list.values()].find(l=>l.world===i),fe=(o,i)=>w` + {const l=a.target;o.color=new L(l.color)}} color=${i}> + `,me=(o,i)=>{const{postproduction:s}=o,a=s.n8ao.configuration;return w` + {const f=r.target;a.color=new L(f.color)}} color=${i}> + `},pe=(o,i)=>{const{color:s,opacity:a}=JSON.parse(i),{postproduction:l}=o,{customEffects:r}=l;return w` + {const{color:b,opacity:m}=g.target;r.lineColor=new L(b).getHex(),m&&(r.opacity=m/100)}} color=${s} opacity=${a*100}> + `},ge=(o,i)=>w` + {const l=a.target,r=new L(l.color);o.material.uniforms.uColor.value=r}} color=${i}> + `,he=(o,i)=>{const{postproduction:s}=o;return w` + {const r=l.target;s.setPasses({ao:r.checked})}} .checked=${i}> + `},be=(o,i)=>{const{postproduction:s}=o;return w` + {const r=l.target;s.setPasses({gamma:r.checked})}} .checked=${i}> + `},ye=(o,i)=>{const{postproduction:s}=o;return w` + {const r=l.target;s.setPasses({custom:r.checked})}} .checked=${i}> + `},A=(o,i,s,a=()=>{})=>w` + + `,I=(o,i,s,a)=>{const l={slider:!1,min:0,max:100,step:1,prefix:null,suffix:null,onInputSet:()=>{},...a},{slider:r,min:f,max:g,step:b,suffix:m,prefix:S,onInputSet:y}=l;return w` + + `},Ce=o=>{const{components:i}=o,s=i.get(P);return w`{var g,b,m,S,y;if(!l)return;const r=l;r.preserveStructureOnFilter=!0,r.dataTransform={Value:(e,t)=>{const h=t.World,C=s.list.get(h);if(!C)return e;const{scene:x,camera:p,renderer:n}=C,c=t.Name;if(c==="Grid"&&t.IsGridConfig&&typeof e=="boolean"){const u=W(i,C);return u?A(u,"visible",e):e}if(c==="Color"&&t.IsGridConfig&&typeof e=="string"){const u=W(i,C);return u?ge(u,e):e}if(c==="Distance"&&t.IsGridConfig&&typeof e=="number"){const u=W(i,C);return u?I(u.material.uniforms.uDistance,"value",e,{slider:!0,min:300,max:1e3}):e}if(c==="Size"&&t.IsGridConfig&&typeof e=="string"){const u=W(i,C);if(!u)return e;const{x:d,y:N}=JSON.parse(e),G=I(u.material.uniforms.uSize1,"value",d,{slider:!0,suffix:"m",prefix:"A",min:1,max:20}),k=I(u.material.uniforms.uSize2,"value",N,{slider:!0,suffix:"m",prefix:"B",min:1,max:20});return w` +
${G}${k}
+ `}if(c==="Near Frustum"&&p.three instanceof T&&typeof e=="number"){const u=p.three;return I(p.three,"near",e,{slider:!0,min:.1,max:10,step:.1,onInputSet:()=>u.updateProjectionMatrix()})}if(c==="Far Frustum"&&p.three instanceof T&&typeof e=="number"){const u=p.three;return I(p.three,"far",e,{slider:!0,min:300,max:2e3,step:10,onInputSet:()=>u.updateProjectionMatrix()})}if(c==="Field of View"&&p.three instanceof T&&typeof e=="number"){const u=p.three;return I(p.three,"fov",e,{slider:!0,min:10,max:120,onInputSet:()=>u.updateProjectionMatrix()})}if(c==="Invert Drag"&&p.hasCameraControls()&&typeof e=="boolean")return A(p.controls,"dollyDragInverted",e);if(c==="Dolly Speed"&&p.hasCameraControls()&&typeof e=="number")return I(p.controls,"dollySpeed",e,{slider:!0,min:.5,max:3,step:.1});if(c==="Truck Speed"&&p.hasCameraControls()&&typeof e=="number")return I(p.controls,"truckSpeed",e,{slider:!0,min:.5,max:6,step:.1});if(c==="Smooth Time"&&p.hasCameraControls()&&typeof e=="number")return I(p.controls,"smoothTime",e,{slider:!0,min:.01,max:2,step:.01});if(c==="Intensity"&&typeof e=="number"){if(t.Light&&typeof t.Light=="string"){const u=x.three.children.find(d=>d.uuid===t.Light);return u&&u instanceof E?I(u,"intensity",e,{slider:!0,min:0,max:10,step:.1}):e}if(t.IsAOConfig&&n instanceof O)return I(n.postproduction.n8ao.configuration,"intensity",e,{slider:!0,max:16,step:.1})}if(c==="Color"&&typeof e=="string"){const u=t.Light,d=x.three.children.find(N=>N.uuid===u);if(d&&d instanceof E)return fe(d,e);if(t.IsAOConfig&&n instanceof O)return me(n,e)}if(c==="Ambient Oclussion"&&typeof e=="boolean"&&t.IsAOConfig&&n instanceof O)return he(n,e);if(c==="Half Resolution"&&t.IsAOConfig&&n instanceof O&&typeof e=="boolean")return A(n.postproduction.n8ao.configuration,"halfRes",e);if(c==="Screen Space Radius"&&t.IsAOConfig&&n instanceof O&&typeof e=="boolean")return A(n.postproduction.n8ao.configuration,"screenSpaceRadius",e);if(c==="Radius"&&t.IsAOConfig&&n instanceof O&&typeof e=="number")return I(n.postproduction.n8ao.configuration,"aoRadius",e,{slider:!0,max:2,step:.1});if(c==="Denoise Samples"&&t.IsAOConfig&&n instanceof O&&typeof e=="number")return I(n.postproduction.n8ao.configuration,"denoiseSamples",e,{slider:!0,min:1,max:16});if(c==="Samples"&&t.IsAOConfig&&n instanceof O&&typeof e=="number")return I(n.postproduction.n8ao.configuration,"aoSamples",e,{slider:!0,min:1,max:16});if(c==="Denoise Radius"&&t.IsAOConfig&&n instanceof O&&typeof e=="number")return I(n.postproduction.n8ao.configuration,"denoiseRadius",e,{slider:!0,min:0,max:16,step:.1});if(c==="Distance Falloff"&&t.IsAOConfig&&n instanceof O&&typeof e=="number")return I(n.postproduction.n8ao.configuration,"distanceFalloff",e,{slider:!0,min:0,max:4,step:.1});if(c==="Directional Light"&&t.Light&&typeof t.Light=="string"&&typeof e=="boolean"){const u=x.three.children.find(d=>d.uuid===t.Light);return u&&u instanceof E?A(u,"visible",e):e}if(c==="Ambient Light"&&t.Light&&typeof t.Light=="string"&&typeof e=="boolean"){const u=x.three.children.find(d=>d.uuid===t.Light);return u&&u instanceof E?A(u,"visible",e):e}if(c==="Position"&&t.Light&&typeof t.Light=="string"&&typeof e=="string"){const u=x.three.children.find(H=>H.uuid===t.Light);if(!(u&&u instanceof E))return e;const{x:d,y:N,z:G}=JSON.parse(e),k=I(u.position,"x",d,{slider:!0,prefix:"X",suffix:"m",min:-50,max:50}),F=I(u.position,"y",N,{slider:!0,prefix:"Y",suffix:"m",min:-50,max:50}),z=I(u.position,"z",G,{slider:!0,prefix:"Z",suffix:"m",min:-50,max:50});return w` +
${k}${F}${z}
+ `}return c==="Custom Effects"&&t.IsCEConfig&&n instanceof O&&typeof e=="boolean"?ye(n,e):c==="Color"&&t.IsOutlineConfig&&n instanceof O&&typeof e=="string"?pe(n,e):c==="Tolerance"&&t.IsOutlineConfig&&n instanceof O&&typeof e=="number"?I(n.postproduction.customEffects,"tolerance",e,{slider:!0,min:0,max:6,step:.01}):c==="Outline"&&t.IsOutlineConfig&&n instanceof O&&typeof e=="boolean"?A(n.postproduction.customEffects,"outlineEnabled",e):c==="Gloss"&&t.IsGlossConfig&&n instanceof O&&typeof e=="boolean"?A(n.postproduction.customEffects,"glossEnabled",e):c==="Min"&&t.IsGlossConfig&&n instanceof O&&typeof e=="number"?I(n.postproduction.customEffects,"minGloss",e,{slider:!0,min:-.5,max:.5,step:.01}):c==="Max"&&t.IsGlossConfig&&n instanceof O&&typeof e=="number"?I(n.postproduction.customEffects,"maxGloss",e,{slider:!0,min:-.5,max:.5,step:.01}):c==="Exponent"&&t.IsGlossConfig&&n instanceof O&&typeof e=="number"?I(n.postproduction.customEffects,"glossExponent",e,{slider:!0,min:0,max:5,step:.01}):c==="Gamma Correction"&&t.IsGammaConfig&&n instanceof O&&typeof e=="boolean"?be(n,e):e}},r.addEventListener("cellcreated",({detail:e})=>{const t=e.cell.parentNode;if(!t)return;const h=t.querySelector("bim-table-cell[column='Name']"),C=t.querySelector("bim-table-cell[column='Value']");h&&!C&&(h.style.gridColumn="1 / -1")});const f=[];for(const[,e]of s.list){const{scene:t,camera:h,renderer:C}=e,x=W(i,e),p={data:{Name:e instanceof Q&&e.name||e.uuid},children:[]};if(t){const n={data:{Name:"Scene"}};if(x){const d={data:{Name:"Grid",Value:x.three.visible,World:e.uuid,IsGridConfig:!0},children:[{data:{Name:"Color",get Value(){return`#${x.material.uniforms.uColor.value.getHexString()}`},World:e.uuid,IsGridConfig:!0}},{data:{Name:"Size",get Value(){const N=x.material.uniforms.uSize1.value,G=x.material.uniforms.uSize2.value;return JSON.stringify({x:N,y:G})},World:e.uuid,IsGridConfig:!0}},{data:{Name:"Distance",Value:x.material.uniforms.uDistance.value,World:e.uuid,IsGridConfig:!0}}]};n.children||(n.children=[]),n.children.push(d)}const c=t.three.children.filter(d=>d instanceof X);for(const d of c){const N={data:{Name:"Directional Light",Value:d.visible,World:e.uuid,Light:d.uuid},children:[{data:{Name:"Position",Value:JSON.stringify(d.position),World:e.uuid,Light:d.uuid}},{data:{Name:"Intensity",Value:d.intensity,World:e.uuid,Light:d.uuid}},{data:{Name:"Color",Value:`#${d.color.getHexString()}`,World:e.uuid,Light:d.uuid}}]};n.children||(n.children=[]),n.children.push(N)}const u=t.three.children.filter(d=>d instanceof Y);for(const d of u){const N={data:{Name:"Ambient Light",Value:d.visible,World:e.uuid,Light:d.uuid},children:[{data:{Name:"Intensity",Value:d.intensity,World:e.uuid,Light:d.uuid}},{data:{Name:"Color",Value:`#${d.color.getHexString()}`,World:e.uuid,Light:d.uuid}}]};n.children||(n.children=[]),n.children.push(N)}n.children&&((g=n.children)==null?void 0:g.length)>0&&((b=p.children)==null||b.push(n))}if(h.three instanceof T){const n={data:{Name:"Perspective Camera"},children:[{data:{Name:"Near Frustum",Value:h.three.near,World:e.uuid}},{data:{Name:"Far Frustum",Value:h.three.far,World:e.uuid}},{data:{Name:"Field of View",Value:h.three.fov,World:e.uuid}}]};if(h.hasCameraControls()){const{controls:c}=h,u={dollyDragInverted:"Invert Drag",dollySpeed:"Dolly Speed",truckSpeed:"Truck Speed",smoothTime:"Smooth Time"};for(const d in u){const N=c[d];N!=null&&((m=n.children)==null||m.push({data:{Name:u[d],Value:N,World:e.uuid}}))}}(S=p.children)==null||S.push(n)}if(C instanceof O){const{postproduction:n}=C,c=n.n8ao.configuration,u={data:{Name:"Renderer"},children:[{data:{Name:"Gamma Correction",Value:n.settings.gamma??!1,World:e.uuid,IsGammaConfig:!0}},{data:{Name:"Ambient Oclussion",Value:n.settings.ao??!1,World:e.uuid,IsAOConfig:!0},children:[{data:{Name:"Samples",Value:c.aoSamples,World:e.uuid,IsAOConfig:!0}},{data:{Name:"Color",Value:`#${c.color.getHexString()}`,World:e.uuid,IsAOConfig:!0}},{data:{Name:"Half Resolution",Value:c.halfRes,World:e.uuid,IsAOConfig:!0}},{data:{Name:"Screen Space Radius",Value:c.screenSpaceRadius,World:e.uuid,IsAOConfig:!0}},{data:{Name:"Radius",Value:c.aoRadius,World:e.uuid,IsAOConfig:!0}},{data:{Name:"Intensity",Value:c.intensity,World:e.uuid,IsAOConfig:!0}},{data:{Name:"Distance Falloff",Value:c.distanceFalloff,World:e.uuid,IsAOConfig:!0}},{data:{Name:"Denoise Samples",Value:c.denoiseSamples,World:e.uuid,IsAOConfig:!0}},{data:{Name:"Denoise Radius",Value:c.denoiseRadius,World:e.uuid,IsAOConfig:!0}}]},{data:{Name:"Custom Effects",Value:n.settings.custom??!1,World:e.uuid,IsCEConfig:!0},children:[{data:{Name:"Gloss",Value:n.customEffects.glossEnabled,World:e.uuid,IsGlossConfig:!0},children:[{data:{Name:"Min",Value:n.customEffects.minGloss,World:e.uuid,IsGlossConfig:!0}},{data:{Name:"Max",Value:n.customEffects.maxGloss,World:e.uuid,IsGlossConfig:!0}},{data:{Name:"Exponent",Value:n.customEffects.glossExponent,World:e.uuid,IsGlossConfig:!0}}]},{data:{Name:"Outline",Value:n.customEffects.outlineEnabled,World:e.uuid,IsOutlineConfig:!0},children:[{data:{Name:"Color",get Value(){const d=new L(n.customEffects.lineColor),N=n.customEffects.opacity;return JSON.stringify({color:`#${d.getHexString()}`,opacity:N})},World:e.uuid,IsOutlineConfig:!0}},{data:{Name:"Tolerance",Value:n.customEffects.tolerance,World:e.uuid,IsOutlineConfig:!0}}]}]}]};(y=p.children)==null||y.push(u)}f.push(p)}r.columns=[{name:"Name",width:"11rem"}],r.hiddenColumns=["World","Light","IsAOConfig","IsCEConfig","IsGlossConfig","IsOutlineConfig","IsGammaConfig","IsGridConfig"],r.data=f})} headers-hidden expanded>
`},Ie=(o,i=!0)=>{const s=$.create(Ce,o);if(i){const[a]=s,l=()=>s[1](),{components:r}=o,f=r.get(P);f.onDisposed.add(a.remove);for(const[,g]of f.list)g.onDisposed.add(l);a.addEventListener("disconnected",()=>{f.onDisposed.remove(a.remove);for(const[,g]of f.list)g.onDisposed.remove(l)})}return s},xe=Object.freeze(Object.defineProperty({__proto__:null,worldsConfiguration:Ie},Symbol.toStringTag,{value:"Module"})),Oe={...ee,...oe,...ce,...ue,...de,...xe};export{Oe as t}; diff --git a/examples/assets/index-BopBFlpa.js b/examples/assets/index-CDPOqkDG.js similarity index 52% rename from examples/assets/index-BopBFlpa.js rename to examples/assets/index-CDPOqkDG.js index 9b3f77a9..10b3aaab 100644 --- a/examples/assets/index-BopBFlpa.js +++ b/examples/assets/index-CDPOqkDG.js @@ -1,4 +1,4 @@ -import{O as ht,V as dt,c as O,M as w,d as P,F as ut,L as mt,B as Y,e as pt,f as ft,C as gt,i as bt,G as _t,o as xt,p as N}from"./index-iHSjA6qM.js";import{s as G,i as B,x as F,n as l,r as vt}from"./state-CdSmRkb4.js";class yt extends ht{constructor(t=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=t,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new dt(.5,.5),this.addEventListener("removed",function(){this.traverse(function(e){e.element instanceof Element&&e.element.parentNode!==null&&e.element.parentNode.removeChild(e.element)})})}copy(t,e){return super.copy(t,e),this.element=t.element.cloneNode(!0),this.center=t.center,this}}new O;new w;new w;new O;new O;class wt{constructor(t,e){this._group=new P,this._frustum=new ut,this._frustumMat=new w,this._regenerateDelay=200,this._regenerateCounter=0,this.material=new mt({color:"#2e3338"}),this.numbers=new P,this.maxRegenerateRetrys=4,this.gridsFactor=5,this._scaleX=1,this._scaleY=1,this._camera=t,this._container=e;const i=this.newGrid(-1),s=this.newGrid(-2);this.grids={main:i,secondary:s},this._group.add(s,i,this.numbers)}set scaleX(t){this._scaleX=t,this.regenerate()}get scaleX(){return this._scaleX}set scaleY(t){this._scaleY=t,this.regenerate()}get scaleY(){return this._scaleY}get(){return this._group}dispose(){const{main:t,secondary:e}=this.grids;t.removeFromParent(),e.removeFromParent(),t.geometry.dispose(),t.material.dispose(),e.geometry.dispose(),e.material.dispose()}regenerate(){if(!this.isGridReady()){if(this._regenerateCounter++,this._regenerateCounter>this.maxRegenerateRetrys)throw new Error("Grid could not be regenerated");setTimeout(()=>this.regenerate,this._regenerateDelay);return}this._regenerateCounter=0,this._camera.updateMatrix(),this._camera.updateMatrixWorld();const e=this._frustumMat.multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse);this._frustum.setFromProjectionMatrix(e);const{planes:i}=this._frustum,s=i[0].constant*-i[0].normal.x,r=i[1].constant*-i[1].normal.x,a=i[2].constant*-i[2].normal.y,M=i[3].constant*-i[3].normal.y,x=Math.abs(s-r),v=Math.abs(M-a),{clientWidth:R,clientHeight:A}=this._container,j=Math.max(R,A),k=Math.max(x,v)/j,H=Math.ceil(Math.log10(x/this.scaleX)),V=Math.ceil(Math.log10(v/this.scaleY)),f=10**(H-2)*this.scaleX,g=10**(V-2)*this.scaleY,d=f*this.gridsFactor,b=g*this.gridsFactor,Z=Math.ceil(v/b),E=Math.ceil(x/d),I=Math.ceil(v/g),W=Math.ceil(x/f),U=f*Math.ceil(r/f),q=g*Math.ceil(a/g),C=d*Math.ceil(r/d),J=b*Math.ceil(a/b),K=[...this.numbers.children];for(const o of K)o.removeFromParent();this.numbers.children=[];const $=[],Q=9*k,u=1e4,tt=Math.round(Math.abs(C/this.scaleX)*u)/u,et=(E-1)*d,st=Math.round(Math.abs((C+et)/this.scaleX)*u)/u,it=Math.max(tt,st).toString().length*Q;let S=Math.ceil(it/d)*d;for(let o=0;o.01)continue;const ct=this.newNumber(_),lt=12*k;ct.position.set(n,a+lt,0)}for(let o=0;o{for(var s=kt(t,e),r=h.length-1,a;r>=0;r--)(a=h[r])&&(s=a(t,e,s)||s);return s&&Mt(t,e,s),s};const T=class T extends G{constructor(){super(...arguments),this._grid=null,this._world=null,this.resize=()=>{this._world&&this._grid&&this._grid.regenerate()}}set gridColor(t){if(this._gridColor=t,!(t&&this._grid))return;const e=Number(t.replace("#","0x"));Number.isNaN(e)||this._grid.material.color.setHex(e)}get gridColor(){return this._gridColor}set gridScaleX(t){this._gridScaleX=t,t&&this._grid&&(this._grid.scaleX=t)}get gridScaleX(){return this._gridScaleX}set gridScaleY(t){this._gridScaleY=t,t&&this._grid&&(this._grid.scaleY=t)}get gridScaleY(){return this._gridScaleY}set components(t){this.dispose();const i=t.get(gt).create();this._world=i,i.scene=new bt(t),i.scene.setup(),i.renderer=new _t(t,this);const s=new xt(t);i.camera=s;const r=new wt(s.threeOrtho,this);this._grid=r,i.scene.three.add(r.get()),s.controls.addEventListener("update",()=>r.regenerate()),setTimeout(async()=>{i.camera.updateAspect(),s.set("Plan"),await s.controls.setLookAt(0,0,100,0,0,0),await s.projection.set("Orthographic"),s.controls.dollySpeed=3,s.controls.draggingSmoothTime=.085,s.controls.maxZoom=1e3,s.controls.zoom(4)})}get world(){return this._world}dispose(){var t;(t=this.world)==null||t.dispose(),this._world=null,this._grid=null}connectedCallback(){super.connectedCallback(),new ResizeObserver(this.resize).observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.dispose()}render(){return F``}};T.styles=B` +import{O as ht,V as dt,c as O,M as w,d as P,F as ut,L as mt,B as Y,e as pt,f as ft,C as gt,i as bt,G as _t,o as xt,p as N}from"./template-DtWW1qyz.js";import{s as G,i as B,x as F,n as l,r as vt}from"./state-HK6D0hVF.js";class yt extends ht{constructor(t=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=t,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new dt(.5,.5),this.addEventListener("removed",function(){this.traverse(function(e){e.element instanceof Element&&e.element.parentNode!==null&&e.element.parentNode.removeChild(e.element)})})}copy(t,e){return super.copy(t,e),this.element=t.element.cloneNode(!0),this.center=t.center,this}}new O;new w;new w;new O;new O;class wt{constructor(t,e){this._group=new P,this._frustum=new ut,this._frustumMat=new w,this._regenerateDelay=200,this._regenerateCounter=0,this.material=new mt({color:"#2e3338"}),this.numbers=new P,this.maxRegenerateRetrys=4,this.gridsFactor=5,this._scaleX=1,this._scaleY=1,this._camera=t,this._container=e;const i=this.newGrid(-1),s=this.newGrid(-2);this.grids={main:i,secondary:s},this._group.add(s,i,this.numbers)}set scaleX(t){this._scaleX=t,this.regenerate()}get scaleX(){return this._scaleX}set scaleY(t){this._scaleY=t,this.regenerate()}get scaleY(){return this._scaleY}get(){return this._group}dispose(){const{main:t,secondary:e}=this.grids;t.removeFromParent(),e.removeFromParent(),t.geometry.dispose(),t.material.dispose(),e.geometry.dispose(),e.material.dispose()}regenerate(){if(!this.isGridReady()){if(this._regenerateCounter++,this._regenerateCounter>this.maxRegenerateRetrys)throw new Error("Grid could not be regenerated");setTimeout(()=>this.regenerate,this._regenerateDelay);return}this._regenerateCounter=0,this._camera.updateMatrix(),this._camera.updateMatrixWorld();const e=this._frustumMat.multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse);this._frustum.setFromProjectionMatrix(e);const{planes:i}=this._frustum,s=i[0].constant*-i[0].normal.x,r=i[1].constant*-i[1].normal.x,a=i[2].constant*-i[2].normal.y,M=i[3].constant*-i[3].normal.y,x=Math.abs(s-r),v=Math.abs(M-a),{clientWidth:R,clientHeight:A}=this._container,j=Math.max(R,A),k=Math.max(x,v)/j,H=Math.ceil(Math.log10(x/this.scaleX)),V=Math.ceil(Math.log10(v/this.scaleY)),f=10**(H-2)*this.scaleX,g=10**(V-2)*this.scaleY,d=f*this.gridsFactor,b=g*this.gridsFactor,Z=Math.ceil(v/b),E=Math.ceil(x/d),I=Math.ceil(v/g),W=Math.ceil(x/f),U=f*Math.ceil(r/f),q=g*Math.ceil(a/g),C=d*Math.ceil(r/d),J=b*Math.ceil(a/b),K=[...this.numbers.children];for(const o of K)o.removeFromParent();this.numbers.children=[];const $=[],Q=9*k,u=1e4,tt=Math.round(Math.abs(C/this.scaleX)*u)/u,et=(E-1)*d,st=Math.round(Math.abs((C+et)/this.scaleX)*u)/u,it=Math.max(tt,st).toString().length*Q;let S=Math.ceil(it/d)*d;for(let o=0;o.01)continue;const ct=this.newNumber(_),lt=12*k;ct.position.set(n,a+lt,0)}for(let o=0;o{for(var s=kt(t,e),r=h.length-1,a;r>=0;r--)(a=h[r])&&(s=a(t,e,s)||s);return s&&Mt(t,e,s),s};const T=class T extends G{constructor(){super(...arguments),this._grid=null,this._world=null,this.resize=()=>{this._world&&this._grid&&this._grid.regenerate()}}set gridColor(t){if(this._gridColor=t,!(t&&this._grid))return;const e=Number(t.replace("#","0x"));Number.isNaN(e)||this._grid.material.color.setHex(e)}get gridColor(){return this._gridColor}set gridScaleX(t){this._gridScaleX=t,t&&this._grid&&(this._grid.scaleX=t)}get gridScaleX(){return this._gridScaleX}set gridScaleY(t){this._gridScaleY=t,t&&this._grid&&(this._grid.scaleY=t)}get gridScaleY(){return this._gridScaleY}set components(t){this.dispose();const i=t.get(gt).create();this._world=i,i.scene=new bt(t),i.scene.setup(),i.renderer=new _t(t,this);const s=new xt(t);i.camera=s;const r=new wt(s.threeOrtho,this);this._grid=r,i.scene.three.add(r.get()),s.controls.addEventListener("update",()=>r.regenerate()),setTimeout(async()=>{i.camera.updateAspect(),s.set("Plan"),await s.controls.setLookAt(0,0,100,0,0,0),await s.projection.set("Orthographic"),s.controls.dollySpeed=3,s.controls.draggingSmoothTime=.085,s.controls.maxZoom=1e3,s.controls.zoom(4)})}get world(){return this._world}dispose(){var t;(t=this.world)==null||t.dispose(),this._world=null,this._grid=null}connectedCallback(){super.connectedCallback(),new ResizeObserver(this.resize).observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.dispose()}render(){return F``}};T.styles=B` :host { position: relative; display: flex; diff --git a/examples/assets/index-BRXkzNmn.js b/examples/assets/index-DhhQtOkc.js similarity index 60% rename from examples/assets/index-BRXkzNmn.js rename to examples/assets/index-DhhQtOkc.js index f07d21c1..9ac4b76c 100644 --- a/examples/assets/index-BRXkzNmn.js +++ b/examples/assets/index-DhhQtOkc.js @@ -1,20 +1,20 @@ -var Xn=Object.defineProperty;var Jn=(i,t,e)=>t in i?Xn(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var Z=(i,t,e)=>(Jn(i,typeof t!="symbol"?t+"":t,e),e);import{z as Kn,T as ie,s as E,i as C,x as m,n as h,j as Pe,r as Nt}from"./state-CdSmRkb4.js";const Ct=Math.min,U=Math.max,ne=Math.round,et=i=>({x:i,y:i}),Zn={left:"right",right:"left",bottom:"top",top:"bottom"},ts={start:"end",end:"start"};function Si(i,t,e){return U(i,Ct(t,e))}function Ft(i,t){return typeof i=="function"?i(t):i}function Y(i){return i.split("-")[0]}function be(i){return i.split("-")[1]}function sn(i){return i==="x"?"y":"x"}function on(i){return i==="y"?"height":"width"}function Ht(i){return["top","bottom"].includes(Y(i))?"y":"x"}function rn(i){return sn(Ht(i))}function es(i,t,e){e===void 0&&(e=!1);const s=be(i),n=rn(i),o=on(n);let r=n==="x"?s===(e?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=se(r)),[r,se(r)]}function is(i){const t=se(i);return[Ie(i),t,Ie(t)]}function Ie(i){return i.replace(/start|end/g,t=>ts[t])}function ns(i,t,e){const s=["left","right"],n=["right","left"],o=["top","bottom"],r=["bottom","top"];switch(i){case"top":case"bottom":return e?t?n:s:t?s:n;case"left":case"right":return t?o:r;default:return[]}}function ss(i,t,e,s){const n=be(i);let o=ns(Y(i),e==="start",s);return n&&(o=o.map(r=>r+"-"+n),t&&(o=o.concat(o.map(Ie)))),o}function se(i){return i.replace(/left|right|bottom|top/g,t=>Zn[t])}function os(i){return{top:0,right:0,bottom:0,left:0,...i}}function ln(i){return typeof i!="number"?os(i):{top:i,right:i,bottom:i,left:i}}function $t(i){const{x:t,y:e,width:s,height:n}=i;return{width:s,height:n,top:e,left:t,right:t+s,bottom:e+n,x:t,y:e}}function ki(i,t,e){let{reference:s,floating:n}=i;const o=Ht(t),r=rn(t),a=on(r),l=Y(t),c=o==="y",u=s.x+s.width/2-n.width/2,d=s.y+s.height/2-n.height/2,f=s[a]/2-n[a]/2;let p;switch(l){case"top":p={x:u,y:s.y-n.height};break;case"bottom":p={x:u,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:d};break;case"left":p={x:s.x-n.width,y:d};break;default:p={x:s.x,y:s.y}}switch(be(t)){case"start":p[r]-=f*(e&&c?-1:1);break;case"end":p[r]+=f*(e&&c?-1:1);break}return p}const rs=async(i,t,e)=>{const{placement:s="bottom",strategy:n="absolute",middleware:o=[],platform:r}=e,a=o.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let c=await r.getElementRects({reference:i,floating:t,strategy:n}),{x:u,y:d}=ki(c,s,l),f=s,p={},b=0;for(let v=0;vN<=0)){var q,O;const N=(((q=o.flip)==null?void 0:q.index)||0)+1,xt=k[N];if(xt)return{data:{index:N,overflows:L},reset:{placement:xt}};let K=(O=L.filter(F=>F.overflows[0]<=0).sort((F,W)=>F.overflows[1]-W.overflows[1])[0])==null?void 0:O.placement;if(!K)switch(p){case"bestFit":{var _t;const F=(_t=L.map(W=>[W.placement,W.overflows.filter(bt=>bt>0).reduce((bt,Ee)=>bt+Ee,0)]).sort((W,bt)=>W[1]-bt[1])[0])==null?void 0:_t[0];F&&(K=F);break}case"initialPlacement":K=a;break}if(n!==K)return{reset:{placement:K}}}return{}}}};function an(i){const t=Ct(...i.map(o=>o.left)),e=Ct(...i.map(o=>o.top)),s=U(...i.map(o=>o.right)),n=U(...i.map(o=>o.bottom));return{x:t,y:e,width:s-t,height:n-e}}function as(i){const t=i.slice().sort((n,o)=>n.y-o.y),e=[];let s=null;for(let n=0;ns.height/2?e.push([o]):e[e.length-1].push(o),s=o}return e.map(n=>$t(an(n)))}const cs=function(i){return i===void 0&&(i={}),{name:"inline",options:i,async fn(t){const{placement:e,elements:s,rects:n,platform:o,strategy:r}=t,{padding:a=2,x:l,y:c}=Ft(i,t),u=Array.from(await(o.getClientRects==null?void 0:o.getClientRects(s.reference))||[]),d=as(u),f=$t(an(u)),p=ln(a);function b(){if(d.length===2&&d[0].left>d[1].right&&l!=null&&c!=null)return d.find(g=>l>g.left-p.left&&lg.top-p.top&&c=2){if(Ht(e)==="y"){const O=d[0],_t=d[d.length-1],N=Y(e)==="top",xt=O.top,K=_t.bottom,F=N?O.left:_t.left,W=N?O.right:_t.right,bt=W-F,Ee=K-xt;return{top:xt,bottom:K,left:F,right:W,width:bt,height:Ee,x:F,y:xt}}const g=Y(e)==="left",S=U(...d.map(O=>O.right)),$=Ct(...d.map(O=>O.left)),x=d.filter(O=>g?O.left===$:O.right===S),w=x[0].top,k=x[x.length-1].bottom,y=$,T=S,L=T-y,q=k-w;return{top:w,bottom:k,left:y,right:T,width:L,height:q,x:y,y:w}}return f}const v=await o.getElementRects({reference:{getBoundingClientRect:b},floating:s.floating,strategy:r});return n.reference.x!==v.reference.x||n.reference.y!==v.reference.y||n.reference.width!==v.reference.width||n.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}};async function us(i,t){const{placement:e,platform:s,elements:n}=i,o=await(s.isRTL==null?void 0:s.isRTL(n.floating)),r=Y(e),a=be(e),l=Ht(e)==="y",c=["left","top"].includes(r)?-1:1,u=o&&l?-1:1,d=Ft(t,i);let{mainAxis:f,crossAxis:p,alignmentAxis:b}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof b=="number"&&(p=a==="end"?b*-1:b),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}const cn=function(i){return{name:"offset",options:i,async fn(t){var e,s;const{x:n,y:o,placement:r,middlewareData:a}=t,l=await us(t,i);return r===((e=a.offset)==null?void 0:e.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:n+l.x,y:o+l.y,data:{...l,placement:r}}}}},hs=function(i){return i===void 0&&(i={}),{name:"shift",options:i,async fn(t){const{x:e,y:s,placement:n}=t,{mainAxis:o=!0,crossAxis:r=!1,limiter:a={fn:g=>{let{x:S,y:$}=g;return{x:S,y:$}}},...l}=Ft(i,t),c={x:e,y:s},u=await Ue(t,l),d=Ht(Y(n)),f=sn(d);let p=c[f],b=c[d];if(o){const g=f==="y"?"top":"left",S=f==="y"?"bottom":"right",$=p+u[g],x=p-u[S];p=Si($,p,x)}if(r){const g=d==="y"?"top":"left",S=d==="y"?"bottom":"right",$=b+u[g],x=b-u[S];b=Si($,b,x)}const v=a.fn({...t,[f]:p,[d]:b});return{...v,data:{x:v.x-e,y:v.y-s}}}}};function it(i){return un(i)?(i.nodeName||"").toLowerCase():"#document"}function z(i){var t;return(i==null||(t=i.ownerDocument)==null?void 0:t.defaultView)||window}function dt(i){var t;return(t=(un(i)?i.ownerDocument:i.document)||window.document)==null?void 0:t.documentElement}function un(i){return i instanceof Node||i instanceof z(i).Node}function G(i){return i instanceof Element||i instanceof z(i).Element}function H(i){return i instanceof HTMLElement||i instanceof z(i).HTMLElement}function Oi(i){return typeof ShadowRoot>"u"?!1:i instanceof ShadowRoot||i instanceof z(i).ShadowRoot}function Vt(i){const{overflow:t,overflowX:e,overflowY:s,display:n}=j(i);return/auto|scroll|overlay|hidden|clip/.test(t+s+e)&&!["inline","contents"].includes(n)}function ds(i){return["table","td","th"].includes(it(i))}function Qe(i){const t=Ye(),e=j(i);return e.transform!=="none"||e.perspective!=="none"||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||["transform","perspective","filter"].some(s=>(e.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(e.contain||"").includes(s))}function fs(i){let t=Et(i);for(;H(t)&&!ge(t);){if(Qe(t))return t;t=Et(t)}return null}function Ye(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ge(i){return["html","body","#document"].includes(it(i))}function j(i){return z(i).getComputedStyle(i)}function ve(i){return G(i)?{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}:{scrollLeft:i.pageXOffset,scrollTop:i.pageYOffset}}function Et(i){if(it(i)==="html")return i;const t=i.assignedSlot||i.parentNode||Oi(i)&&i.host||dt(i);return Oi(t)?t.host:t}function hn(i){const t=Et(i);return ge(t)?i.ownerDocument?i.ownerDocument.body:i.body:H(t)&&Vt(t)?t:hn(t)}function Le(i,t,e){var s;t===void 0&&(t=[]),e===void 0&&(e=!0);const n=hn(i),o=n===((s=i.ownerDocument)==null?void 0:s.body),r=z(n);return o?t.concat(r,r.visualViewport||[],Vt(n)?n:[],r.frameElement&&e?Le(r.frameElement):[]):t.concat(n,Le(n,[],e))}function dn(i){const t=j(i);let e=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const n=H(i),o=n?i.offsetWidth:e,r=n?i.offsetHeight:s,a=ne(e)!==o||ne(s)!==r;return a&&(e=o,s=r),{width:e,height:s,$:a}}function fn(i){return G(i)?i:i.contextElement}function wt(i){const t=fn(i);if(!H(t))return et(1);const e=t.getBoundingClientRect(),{width:s,height:n,$:o}=dn(t);let r=(o?ne(e.width):e.width)/s,a=(o?ne(e.height):e.height)/n;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const ps=et(0);function pn(i){const t=z(i);return!Ye()||!t.visualViewport?ps:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ms(i,t,e){return t===void 0&&(t=!1),!e||t&&e!==z(i)?!1:t}function jt(i,t,e,s){t===void 0&&(t=!1),e===void 0&&(e=!1);const n=i.getBoundingClientRect(),o=fn(i);let r=et(1);t&&(s?G(s)&&(r=wt(s)):r=wt(i));const a=ms(o,e,s)?pn(o):et(0);let l=(n.left+a.x)/r.x,c=(n.top+a.y)/r.y,u=n.width/r.x,d=n.height/r.y;if(o){const f=z(o),p=s&&G(s)?z(s):s;let b=f,v=b.frameElement;for(;v&&s&&p!==b;){const g=wt(v),S=v.getBoundingClientRect(),$=j(v),x=S.left+(v.clientLeft+parseFloat($.paddingLeft))*g.x,w=S.top+(v.clientTop+parseFloat($.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,d*=g.y,l+=x,c+=w,b=z(v),v=b.frameElement}}return $t({width:u,height:d,x:l,y:c})}const bs=[":popover-open",":modal"];function mn(i){return bs.some(t=>{try{return i.matches(t)}catch{return!1}})}function gs(i){let{elements:t,rect:e,offsetParent:s,strategy:n}=i;const o=n==="fixed",r=dt(s),a=t?mn(t.floating):!1;if(s===r||a&&o)return e;let l={scrollLeft:0,scrollTop:0},c=et(1);const u=et(0),d=H(s);if((d||!d&&!o)&&((it(s)!=="body"||Vt(r))&&(l=ve(s)),H(s))){const f=jt(s);c=wt(s),u.x=f.x+s.clientLeft,u.y=f.y+s.clientTop}return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-l.scrollLeft*c.x+u.x,y:e.y*c.y-l.scrollTop*c.y+u.y}}function vs(i){return Array.from(i.getClientRects())}function bn(i){return jt(dt(i)).left+ve(i).scrollLeft}function ys(i){const t=dt(i),e=ve(i),s=i.ownerDocument.body,n=U(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),o=U(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let r=-e.scrollLeft+bn(i);const a=-e.scrollTop;return j(s).direction==="rtl"&&(r+=U(t.clientWidth,s.clientWidth)-n),{width:n,height:o,x:r,y:a}}function _s(i,t){const e=z(i),s=dt(i),n=e.visualViewport;let o=s.clientWidth,r=s.clientHeight,a=0,l=0;if(n){o=n.width,r=n.height;const c=Ye();(!c||c&&t==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:o,height:r,x:a,y:l}}function xs(i,t){const e=jt(i,!0,t==="fixed"),s=e.top+i.clientTop,n=e.left+i.clientLeft,o=H(i)?wt(i):et(1),r=i.clientWidth*o.x,a=i.clientHeight*o.y,l=n*o.x,c=s*o.y;return{width:r,height:a,x:l,y:c}}function Ai(i,t,e){let s;if(t==="viewport")s=_s(i,e);else if(t==="document")s=ys(dt(i));else if(G(t))s=xs(t,e);else{const n=pn(i);s={...t,x:t.x-n.x,y:t.y-n.y}}return $t(s)}function gn(i,t){const e=Et(i);return e===t||!G(e)||ge(e)?!1:j(e).position==="fixed"||gn(e,t)}function ws(i,t){const e=t.get(i);if(e)return e;let s=Le(i,[],!1).filter(a=>G(a)&&it(a)!=="body"),n=null;const o=j(i).position==="fixed";let r=o?Et(i):i;for(;G(r)&&!ge(r);){const a=j(r),l=Qe(r);!l&&a.position==="fixed"&&(n=null),(o?!l&&!n:!l&&a.position==="static"&&!!n&&["absolute","fixed"].includes(n.position)||Vt(r)&&!l&&gn(i,r))?s=s.filter(u=>u!==r):n=a,r=Et(r)}return t.set(i,s),s}function Cs(i){let{element:t,boundary:e,rootBoundary:s,strategy:n}=i;const r=[...e==="clippingAncestors"?ws(t,this._c):[].concat(e),s],a=r[0],l=r.reduce((c,u)=>{const d=Ai(t,u,n);return c.top=U(d.top,c.top),c.right=Ct(d.right,c.right),c.bottom=Ct(d.bottom,c.bottom),c.left=U(d.left,c.left),c},Ai(t,a,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function $s(i){const{width:t,height:e}=dn(i);return{width:t,height:e}}function Es(i,t,e){const s=H(t),n=dt(t),o=e==="fixed",r=jt(i,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=et(0);if(s||!s&&!o)if((it(t)!=="body"||Vt(n))&&(a=ve(t)),s){const d=jt(t,!0,o,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else n&&(l.x=bn(n));const c=r.left+a.scrollLeft-l.x,u=r.top+a.scrollTop-l.y;return{x:c,y:u,width:r.width,height:r.height}}function Ti(i,t){return!H(i)||j(i).position==="fixed"?null:t?t(i):i.offsetParent}function vn(i,t){const e=z(i);if(!H(i)||mn(i))return e;let s=Ti(i,t);for(;s&&ds(s)&&j(s).position==="static";)s=Ti(s,t);return s&&(it(s)==="html"||it(s)==="body"&&j(s).position==="static"&&!Qe(s))?e:s||fs(i)||e}const Ss=async function(i){const t=this.getOffsetParent||vn,e=this.getDimensions;return{reference:Es(i.reference,await t(i.floating),i.strategy),floating:{x:0,y:0,...await e(i.floating)}}};function ks(i){return j(i).direction==="rtl"}const Os={convertOffsetParentRelativeRectToViewportRelativeRect:gs,getDocumentElement:dt,getClippingRect:Cs,getOffsetParent:vn,getElementRects:Ss,getClientRects:vs,getDimensions:$s,getScale:wt,isElement:G,isRTL:ks},yn=hs,_n=ls,xn=cs,wn=(i,t,e)=>{const s=new Map,n={platform:Os,...e},o={...n.platform,_c:s};return rs(i,t,{...n,platform:o})};/** +var Fn=Object.defineProperty;var Vn=(i,t,e)=>t in i?Fn(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var K=(i,t,e)=>(Vn(i,typeof t!="symbol"?t+"":t,e),e);import{T as Te,s as E,i as C,x as m,n as h,j as Pe,r as Nt}from"./state-HK6D0hVF.js";const Ct=Math.min,U=Math.max,ie=Math.round,et=i=>({x:i,y:i}),qn={left:"right",right:"left",bottom:"top",top:"bottom"},Wn={start:"end",end:"start"};function Si(i,t,e){return U(i,Ct(t,e))}function Ht(i,t){return typeof i=="function"?i(t):i}function Q(i){return i.split("-")[0]}function me(i){return i.split("-")[1]}function Ji(i){return i==="x"?"y":"x"}function Ki(i){return i==="y"?"height":"width"}function Ft(i){return["top","bottom"].includes(Q(i))?"y":"x"}function Zi(i){return Ji(Ft(i))}function Un(i,t,e){e===void 0&&(e=!1);const s=me(i),n=Zi(i),o=Ki(n);let r=n==="x"?s===(e?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=ne(r)),[r,ne(r)]}function Qn(i){const t=ne(i);return[Le(i),t,Le(t)]}function Le(i){return i.replace(/start|end/g,t=>Wn[t])}function Yn(i,t,e){const s=["left","right"],n=["right","left"],o=["top","bottom"],r=["bottom","top"];switch(i){case"top":case"bottom":return e?t?n:s:t?s:n;case"left":case"right":return t?o:r;default:return[]}}function Gn(i,t,e,s){const n=me(i);let o=Yn(Q(i),e==="start",s);return n&&(o=o.map(r=>r+"-"+n),t&&(o=o.concat(o.map(Le)))),o}function ne(i){return i.replace(/left|right|bottom|top/g,t=>qn[t])}function Xn(i){return{top:0,right:0,bottom:0,left:0,...i}}function tn(i){return typeof i!="number"?Xn(i):{top:i,right:i,bottom:i,left:i}}function $t(i){const{x:t,y:e,width:s,height:n}=i;return{width:s,height:n,top:e,left:t,right:t+s,bottom:e+n,x:t,y:e}}function ki(i,t,e){let{reference:s,floating:n}=i;const o=Ft(t),r=Zi(t),a=Ki(r),l=Q(t),c=o==="y",u=s.x+s.width/2-n.width/2,d=s.y+s.height/2-n.height/2,f=s[a]/2-n[a]/2;let p;switch(l){case"top":p={x:u,y:s.y-n.height};break;case"bottom":p={x:u,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:d};break;case"left":p={x:s.x-n.width,y:d};break;default:p={x:s.x,y:s.y}}switch(me(t)){case"start":p[r]-=f*(e&&c?-1:1);break;case"end":p[r]+=f*(e&&c?-1:1);break}return p}const Jn=async(i,t,e)=>{const{placement:s="bottom",strategy:n="absolute",middleware:o=[],platform:r}=e,a=o.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let c=await r.getElementRects({reference:i,floating:t,strategy:n}),{x:u,y:d}=ki(c,s,l),f=s,p={},b=0;for(let v=0;vN<=0)){var q,O;const N=(((q=o.flip)==null?void 0:q.index)||0)+1,xt=k[N];if(xt)return{data:{index:N,overflows:z},reset:{placement:xt}};let J=(O=z.filter(H=>H.overflows[0]<=0).sort((H,W)=>H.overflows[1]-W.overflows[1])[0])==null?void 0:O.placement;if(!J)switch(p){case"bestFit":{var _t;const H=(_t=z.map(W=>[W.placement,W.overflows.filter(bt=>bt>0).reduce((bt,$e)=>bt+$e,0)]).sort((W,bt)=>W[1]-bt[1])[0])==null?void 0:_t[0];H&&(J=H);break}case"initialPlacement":J=a;break}if(n!==J)return{reset:{placement:J}}}return{}}}};function en(i){const t=Ct(...i.map(o=>o.left)),e=Ct(...i.map(o=>o.top)),s=U(...i.map(o=>o.right)),n=U(...i.map(o=>o.bottom));return{x:t,y:e,width:s-t,height:n-e}}function Zn(i){const t=i.slice().sort((n,o)=>n.y-o.y),e=[];let s=null;for(let n=0;ns.height/2?e.push([o]):e[e.length-1].push(o),s=o}return e.map(n=>$t(en(n)))}const ts=function(i){return i===void 0&&(i={}),{name:"inline",options:i,async fn(t){const{placement:e,elements:s,rects:n,platform:o,strategy:r}=t,{padding:a=2,x:l,y:c}=Ht(i,t),u=Array.from(await(o.getClientRects==null?void 0:o.getClientRects(s.reference))||[]),d=Zn(u),f=$t(en(u)),p=tn(a);function b(){if(d.length===2&&d[0].left>d[1].right&&l!=null&&c!=null)return d.find(g=>l>g.left-p.left&&lg.top-p.top&&c=2){if(Ft(e)==="y"){const O=d[0],_t=d[d.length-1],N=Q(e)==="top",xt=O.top,J=_t.bottom,H=N?O.left:_t.left,W=N?O.right:_t.right,bt=W-H,$e=J-xt;return{top:xt,bottom:J,left:H,right:W,width:bt,height:$e,x:H,y:xt}}const g=Q(e)==="left",S=U(...d.map(O=>O.right)),$=Ct(...d.map(O=>O.left)),x=d.filter(O=>g?O.left===$:O.right===S),w=x[0].top,k=x[x.length-1].bottom,y=$,T=S,z=T-y,q=k-w;return{top:w,bottom:k,left:y,right:T,width:z,height:q,x:y,y:w}}return f}const v=await o.getElementRects({reference:{getBoundingClientRect:b},floating:s.floating,strategy:r});return n.reference.x!==v.reference.x||n.reference.y!==v.reference.y||n.reference.width!==v.reference.width||n.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}};async function es(i,t){const{placement:e,platform:s,elements:n}=i,o=await(s.isRTL==null?void 0:s.isRTL(n.floating)),r=Q(e),a=me(e),l=Ft(e)==="y",c=["left","top"].includes(r)?-1:1,u=o&&l?-1:1,d=Ht(t,i);let{mainAxis:f,crossAxis:p,alignmentAxis:b}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof b=="number"&&(p=a==="end"?b*-1:b),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}const nn=function(i){return{name:"offset",options:i,async fn(t){var e,s;const{x:n,y:o,placement:r,middlewareData:a}=t,l=await es(t,i);return r===((e=a.offset)==null?void 0:e.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:n+l.x,y:o+l.y,data:{...l,placement:r}}}}},is=function(i){return i===void 0&&(i={}),{name:"shift",options:i,async fn(t){const{x:e,y:s,placement:n}=t,{mainAxis:o=!0,crossAxis:r=!1,limiter:a={fn:g=>{let{x:S,y:$}=g;return{x:S,y:$}}},...l}=Ht(i,t),c={x:e,y:s},u=await Ue(t,l),d=Ft(Q(n)),f=Ji(d);let p=c[f],b=c[d];if(o){const g=f==="y"?"top":"left",S=f==="y"?"bottom":"right",$=p+u[g],x=p-u[S];p=Si($,p,x)}if(r){const g=d==="y"?"top":"left",S=d==="y"?"bottom":"right",$=b+u[g],x=b-u[S];b=Si($,b,x)}const v=a.fn({...t,[f]:p,[d]:b});return{...v,data:{x:v.x-e,y:v.y-s}}}}};function it(i){return sn(i)?(i.nodeName||"").toLowerCase():"#document"}function I(i){var t;return(i==null||(t=i.ownerDocument)==null?void 0:t.defaultView)||window}function dt(i){var t;return(t=(sn(i)?i.ownerDocument:i.document)||window.document)==null?void 0:t.documentElement}function sn(i){return i instanceof Node||i instanceof I(i).Node}function Y(i){return i instanceof Element||i instanceof I(i).Element}function F(i){return i instanceof HTMLElement||i instanceof I(i).HTMLElement}function Oi(i){return typeof ShadowRoot>"u"?!1:i instanceof ShadowRoot||i instanceof I(i).ShadowRoot}function Vt(i){const{overflow:t,overflowX:e,overflowY:s,display:n}=j(i);return/auto|scroll|overlay|hidden|clip/.test(t+s+e)&&!["inline","contents"].includes(n)}function ns(i){return["table","td","th"].includes(it(i))}function Qe(i){const t=Ye(),e=j(i);return e.transform!=="none"||e.perspective!=="none"||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||["transform","perspective","filter"].some(s=>(e.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(e.contain||"").includes(s))}function ss(i){let t=Et(i);for(;F(t)&&!be(t);){if(Qe(t))return t;t=Et(t)}return null}function Ye(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function be(i){return["html","body","#document"].includes(it(i))}function j(i){return I(i).getComputedStyle(i)}function ge(i){return Y(i)?{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}:{scrollLeft:i.pageXOffset,scrollTop:i.pageYOffset}}function Et(i){if(it(i)==="html")return i;const t=i.assignedSlot||i.parentNode||Oi(i)&&i.host||dt(i);return Oi(t)?t.host:t}function on(i){const t=Et(i);return be(t)?i.ownerDocument?i.ownerDocument.body:i.body:F(t)&&Vt(t)?t:on(t)}function ze(i,t,e){var s;t===void 0&&(t=[]),e===void 0&&(e=!0);const n=on(i),o=n===((s=i.ownerDocument)==null?void 0:s.body),r=I(n);return o?t.concat(r,r.visualViewport||[],Vt(n)?n:[],r.frameElement&&e?ze(r.frameElement):[]):t.concat(n,ze(n,[],e))}function rn(i){const t=j(i);let e=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const n=F(i),o=n?i.offsetWidth:e,r=n?i.offsetHeight:s,a=ie(e)!==o||ie(s)!==r;return a&&(e=o,s=r),{width:e,height:s,$:a}}function ln(i){return Y(i)?i:i.contextElement}function wt(i){const t=ln(i);if(!F(t))return et(1);const e=t.getBoundingClientRect(),{width:s,height:n,$:o}=rn(t);let r=(o?ie(e.width):e.width)/s,a=(o?ie(e.height):e.height)/n;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const os=et(0);function an(i){const t=I(i);return!Ye()||!t.visualViewport?os:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rs(i,t,e){return t===void 0&&(t=!1),!e||t&&e!==I(i)?!1:t}function jt(i,t,e,s){t===void 0&&(t=!1),e===void 0&&(e=!1);const n=i.getBoundingClientRect(),o=ln(i);let r=et(1);t&&(s?Y(s)&&(r=wt(s)):r=wt(i));const a=rs(o,e,s)?an(o):et(0);let l=(n.left+a.x)/r.x,c=(n.top+a.y)/r.y,u=n.width/r.x,d=n.height/r.y;if(o){const f=I(o),p=s&&Y(s)?I(s):s;let b=f,v=b.frameElement;for(;v&&s&&p!==b;){const g=wt(v),S=v.getBoundingClientRect(),$=j(v),x=S.left+(v.clientLeft+parseFloat($.paddingLeft))*g.x,w=S.top+(v.clientTop+parseFloat($.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,d*=g.y,l+=x,c+=w,b=I(v),v=b.frameElement}}return $t({width:u,height:d,x:l,y:c})}const ls=[":popover-open",":modal"];function cn(i){return ls.some(t=>{try{return i.matches(t)}catch{return!1}})}function as(i){let{elements:t,rect:e,offsetParent:s,strategy:n}=i;const o=n==="fixed",r=dt(s),a=t?cn(t.floating):!1;if(s===r||a&&o)return e;let l={scrollLeft:0,scrollTop:0},c=et(1);const u=et(0),d=F(s);if((d||!d&&!o)&&((it(s)!=="body"||Vt(r))&&(l=ge(s)),F(s))){const f=jt(s);c=wt(s),u.x=f.x+s.clientLeft,u.y=f.y+s.clientTop}return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-l.scrollLeft*c.x+u.x,y:e.y*c.y-l.scrollTop*c.y+u.y}}function cs(i){return Array.from(i.getClientRects())}function un(i){return jt(dt(i)).left+ge(i).scrollLeft}function us(i){const t=dt(i),e=ge(i),s=i.ownerDocument.body,n=U(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),o=U(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let r=-e.scrollLeft+un(i);const a=-e.scrollTop;return j(s).direction==="rtl"&&(r+=U(t.clientWidth,s.clientWidth)-n),{width:n,height:o,x:r,y:a}}function hs(i,t){const e=I(i),s=dt(i),n=e.visualViewport;let o=s.clientWidth,r=s.clientHeight,a=0,l=0;if(n){o=n.width,r=n.height;const c=Ye();(!c||c&&t==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:o,height:r,x:a,y:l}}function ds(i,t){const e=jt(i,!0,t==="fixed"),s=e.top+i.clientTop,n=e.left+i.clientLeft,o=F(i)?wt(i):et(1),r=i.clientWidth*o.x,a=i.clientHeight*o.y,l=n*o.x,c=s*o.y;return{width:r,height:a,x:l,y:c}}function Ai(i,t,e){let s;if(t==="viewport")s=hs(i,e);else if(t==="document")s=us(dt(i));else if(Y(t))s=ds(t,e);else{const n=an(i);s={...t,x:t.x-n.x,y:t.y-n.y}}return $t(s)}function hn(i,t){const e=Et(i);return e===t||!Y(e)||be(e)?!1:j(e).position==="fixed"||hn(e,t)}function fs(i,t){const e=t.get(i);if(e)return e;let s=ze(i,[],!1).filter(a=>Y(a)&&it(a)!=="body"),n=null;const o=j(i).position==="fixed";let r=o?Et(i):i;for(;Y(r)&&!be(r);){const a=j(r),l=Qe(r);!l&&a.position==="fixed"&&(n=null),(o?!l&&!n:!l&&a.position==="static"&&!!n&&["absolute","fixed"].includes(n.position)||Vt(r)&&!l&&hn(i,r))?s=s.filter(u=>u!==r):n=a,r=Et(r)}return t.set(i,s),s}function ps(i){let{element:t,boundary:e,rootBoundary:s,strategy:n}=i;const r=[...e==="clippingAncestors"?fs(t,this._c):[].concat(e),s],a=r[0],l=r.reduce((c,u)=>{const d=Ai(t,u,n);return c.top=U(d.top,c.top),c.right=Ct(d.right,c.right),c.bottom=Ct(d.bottom,c.bottom),c.left=U(d.left,c.left),c},Ai(t,a,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function ms(i){const{width:t,height:e}=rn(i);return{width:t,height:e}}function bs(i,t,e){const s=F(t),n=dt(t),o=e==="fixed",r=jt(i,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=et(0);if(s||!s&&!o)if((it(t)!=="body"||Vt(n))&&(a=ge(t)),s){const d=jt(t,!0,o,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else n&&(l.x=un(n));const c=r.left+a.scrollLeft-l.x,u=r.top+a.scrollTop-l.y;return{x:c,y:u,width:r.width,height:r.height}}function Ti(i,t){return!F(i)||j(i).position==="fixed"?null:t?t(i):i.offsetParent}function dn(i,t){const e=I(i);if(!F(i)||cn(i))return e;let s=Ti(i,t);for(;s&&ns(s)&&j(s).position==="static";)s=Ti(s,t);return s&&(it(s)==="html"||it(s)==="body"&&j(s).position==="static"&&!Qe(s))?e:s||ss(i)||e}const gs=async function(i){const t=this.getOffsetParent||dn,e=this.getDimensions;return{reference:bs(i.reference,await t(i.floating),i.strategy),floating:{x:0,y:0,...await e(i.floating)}}};function vs(i){return j(i).direction==="rtl"}const ys={convertOffsetParentRelativeRectToViewportRelativeRect:as,getDocumentElement:dt,getClippingRect:ps,getOffsetParent:dn,getElementRects:gs,getClientRects:cs,getDimensions:ms,getScale:wt,isElement:Y,isRTL:vs},fn=is,pn=Kn,mn=ts,bn=(i,t,e)=>{const s=new Map,n={platform:ys,...e},o={...n.platform,_c:s};return Jn(i,t,{...n,platform:o})};/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const{I:As}=Kn,Pi=(i,t)=>(i==null?void 0:i._$litType$)!==void 0,Ts=i=>{var t;return((t=i==null?void 0:i._$litType$)==null?void 0:t.h)!=null},Ps=i=>i.strings===void 0,Ii=()=>document.createComment(""),Li=(i,t,e)=>{var o;const s=i._$AA.parentNode,n=i._$AB;if(e===void 0){const r=s.insertBefore(Ii(),n),a=s.insertBefore(Ii(),n);e=new As(r,a,i,i.options)}else{const r=e._$AB.nextSibling,a=e._$AM,l=a!==i;if(l){let c;(o=e._$AQ)==null||o.call(e,i),e._$AM=i,e._$AP!==void 0&&(c=i._$AU)!==a._$AU&&e._$AP(c)}if(r!==n||l){let c=e._$AA;for(;c!==r;){const u=c.nextSibling;s.insertBefore(c,n),c=u}}}return e},Is={},zi=(i,t=Is)=>i._$AH=t,ji=i=>i._$AH,Ls=i=>{i._$AR()};/** + */const _s=i=>i.strings===void 0;/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const zs={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Cn=i=>(...t)=>({_$litDirective$:i,values:t});class $n{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/** + */const xs={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ws=i=>(...t)=>({_$litDirective$:i,values:t});class Cs{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const It=(i,t)=>{var s;const e=i._$AN;if(e===void 0)return!1;for(const n of e)(s=n._$AO)==null||s.call(n,t,!1),It(n,t);return!0},oe=i=>{let t,e;do{if((t=i._$AM)===void 0)break;e=t._$AN,e.delete(i),i=t}while((e==null?void 0:e.size)===0)},En=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),Rs(t)}};function js(i){this._$AN!==void 0?(oe(this),this._$AM=i,En(this)):this._$AM=i}function Ms(i,t=!1,e=0){const s=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(t)if(Array.isArray(s))for(let o=e;o{i.type==zs.CHILD&&(i._$AP??(i._$AP=Ms),i._$AQ??(i._$AQ=js))};class Bs extends $n{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),En(this),this.isConnected=t._$AU}_$AO(t,e=!0){var s,n;t!==this.isConnected&&(this.isConnected=t,t?(s=this.reconnected)==null||s.call(this):(n=this.disconnected)==null||n.call(this)),e&&(It(this,t),oe(this))}setValue(t){if(Ps(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}/** + */const Lt=(i,t)=>{var s;const e=i._$AN;if(e===void 0)return!1;for(const n of e)(s=n._$AO)==null||s.call(n,t,!1),Lt(n,t);return!0},se=i=>{let t,e;do{if((t=i._$AM)===void 0)break;e=t._$AN,e.delete(i),i=t}while((e==null?void 0:e.size)===0)},gn=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),Ss(t)}};function $s(i){this._$AN!==void 0?(se(this),this._$AM=i,gn(this)):this._$AM=i}function Es(i,t=!1,e=0){const s=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(t)if(Array.isArray(s))for(let o=e;o{i.type==xs.CHILD&&(i._$AP??(i._$AP=Es),i._$AQ??(i._$AQ=$s))};class ks extends Cs{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),gn(this),this.isConnected=t._$AU}_$AO(t,e=!0){var s,n;t!==this.isConnected&&(this.isConnected=t,t?(s=this.reconnected)==null||s.call(this):(n=this.disconnected)==null||n.call(this)),e&&(Lt(this,t),se(this))}setValue(t){if(_s(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const tt=()=>new Ds;let Ds=class{};const Se=new WeakMap,Q=Cn(class extends Bs{render(i){return ie}update(i,[t]){var s;const e=t!==this.Y;return e&&this.Y!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.Y=t,this.ht=(s=i.options)==null?void 0:s.host,this.rt(this.ct=i.element)),ie}rt(i){if(typeof this.Y=="function"){const t=this.ht??globalThis;let e=Se.get(t);e===void 0&&(e=new WeakMap,Se.set(t,e)),e.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),e.set(this.Y,i),i!==void 0&&this.Y.call(this.ht,i)}else this.Y.value=i}get lt(){var i,t;return typeof this.Y=="function"?(i=Se.get(this.ht??globalThis))==null?void 0:i.get(this.Y):(t=this.Y)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});/** + */const Z=()=>new Os;class Os{}const Ee=new WeakMap,tt=ws(class extends ks{render(i){return Te}update(i,[t]){var s;const e=t!==this.Y;return e&&this.Y!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.Y=t,this.ht=(s=i.options)==null?void 0:s.host,this.rt(this.ct=i.element)),Te}rt(i){if(typeof this.Y=="function"){const t=this.ht??globalThis;let e=Ee.get(t);e===void 0&&(e=new WeakMap,Ee.set(t,e)),e.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),e.set(this.Y,i),i!==void 0&&this.Y.call(this.ht,i)}else this.Y.value=i}get lt(){var i,t;return typeof this.Y=="function"?(i=Ee.get(this.ht??globalThis))==null?void 0:i.get(this.Y):(t=this.Y)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});/** * (c) Iconify * * For the full copyright and license information, please view the license.txt @@ -24,8 +24,8 @@ var Xn=Object.defineProperty;var Jn=(i,t,e)=>t in i?Xn(i,t,{enumerable:!0,config * * @license MIT * @version 2.0.0 -*/const Sn=Object.freeze({left:0,top:0,width:16,height:16}),re=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),qt=Object.freeze({...Sn,...re}),ze=Object.freeze({...qt,body:"",hidden:!1}),Ns=Object.freeze({width:null,height:null}),kn=Object.freeze({...Ns,...re});function Fs(i,t=0){const e=i.replace(/^-?[0-9.]*/,"");function s(n){for(;n<0;)n+=4;return n%4}if(e===""){const n=parseInt(i);return isNaN(n)?0:s(n)}else if(e!==i){let n=0;switch(e){case"%":n=25;break;case"deg":n=90}if(n){let o=parseFloat(i.slice(0,i.length-e.length));return isNaN(o)?0:(o=o/n,o%1===0?s(o):0)}}return t}const Hs=/[\s,]+/;function Vs(i,t){t.split(Hs).forEach(e=>{switch(e.trim()){case"horizontal":i.hFlip=!0;break;case"vertical":i.vFlip=!0;break}})}const On={...kn,preserveAspectRatio:""};function Mi(i){const t={...On},e=(s,n)=>i.getAttribute(s)||n;return t.width=e("width",null),t.height=e("height",null),t.rotate=Fs(e("rotate","")),Vs(t,e("flip","")),t.preserveAspectRatio=e("preserveAspectRatio",e("preserveaspectratio","")),t}function qs(i,t){for(const e in On)if(i[e]!==t[e])return!0;return!1}const Lt=/^[a-z0-9]+(-[a-z0-9]+)*$/,Wt=(i,t,e,s="")=>{const n=i.split(":");if(i.slice(0,1)==="@"){if(n.length<2||n.length>3)return null;s=n.shift().slice(1)}if(n.length>3||!n.length)return null;if(n.length>1){const a=n.pop(),l=n.pop(),c={provider:n.length>0?n[0]:s,prefix:l,name:a};return t&&!te(c)?null:c}const o=n[0],r=o.split("-");if(r.length>1){const a={provider:s,prefix:r.shift(),name:r.join("-")};return t&&!te(a)?null:a}if(e&&s===""){const a={provider:s,prefix:"",name:o};return t&&!te(a,e)?null:a}return null},te=(i,t)=>i?!!((i.provider===""||i.provider.match(Lt))&&(t&&i.prefix===""||i.prefix.match(Lt))&&i.name.match(Lt)):!1;function Ws(i,t){const e={};!i.hFlip!=!t.hFlip&&(e.hFlip=!0),!i.vFlip!=!t.vFlip&&(e.vFlip=!0);const s=((i.rotate||0)+(t.rotate||0))%4;return s&&(e.rotate=s),e}function Ri(i,t){const e=Ws(i,t);for(const s in ze)s in re?s in i&&!(s in e)&&(e[s]=re[s]):s in t?e[s]=t[s]:s in i&&(e[s]=i[s]);return e}function Us(i,t){const e=i.icons,s=i.aliases||Object.create(null),n=Object.create(null);function o(r){if(e[r])return n[r]=[];if(!(r in n)){n[r]=null;const a=s[r]&&s[r].parent,l=a&&o(a);l&&(n[r]=[a].concat(l))}return n[r]}return Object.keys(e).concat(Object.keys(s)).forEach(o),n}function Qs(i,t,e){const s=i.icons,n=i.aliases||Object.create(null);let o={};function r(a){o=Ri(s[a]||n[a],o)}return r(t),e.forEach(r),Ri(i,o)}function An(i,t){const e=[];if(typeof i!="object"||typeof i.icons!="object")return e;i.not_found instanceof Array&&i.not_found.forEach(n=>{t(n,null),e.push(n)});const s=Us(i);for(const n in s){const o=s[n];o&&(t(n,Qs(i,n,o)),e.push(n))}return e}const Ys={provider:"",aliases:{},not_found:{},...Sn};function ke(i,t){for(const e in t)if(e in i&&typeof i[e]!=typeof t[e])return!1;return!0}function Tn(i){if(typeof i!="object"||i===null)return null;const t=i;if(typeof t.prefix!="string"||!i.icons||typeof i.icons!="object"||!ke(i,Ys))return null;const e=t.icons;for(const n in e){const o=e[n];if(!n.match(Lt)||typeof o.body!="string"||!ke(o,ze))return null}const s=t.aliases||Object.create(null);for(const n in s){const o=s[n],r=o.parent;if(!n.match(Lt)||typeof r!="string"||!e[r]&&!s[r]||!ke(o,ze))return null}return t}const le=Object.create(null);function Gs(i,t){return{provider:i,prefix:t,icons:Object.create(null),missing:new Set}}function nt(i,t){const e=le[i]||(le[i]=Object.create(null));return e[t]||(e[t]=Gs(i,t))}function Ge(i,t){return Tn(t)?An(t,(e,s)=>{s?i.icons[e]=s:i.missing.add(e)}):[]}function Xs(i,t,e){try{if(typeof e.body=="string")return i.icons[t]={...e},!0}catch{}return!1}function Js(i,t){let e=[];return(typeof i=="string"?[i]:Object.keys(le)).forEach(n=>{(typeof n=="string"&&typeof t=="string"?[t]:Object.keys(le[n]||{})).forEach(r=>{const a=nt(n,r);e=e.concat(Object.keys(a.icons).map(l=>(n!==""?"@"+n+":":"")+r+":"+l))})}),e}let Mt=!1;function Pn(i){return typeof i=="boolean"&&(Mt=i),Mt}function Rt(i){const t=typeof i=="string"?Wt(i,!0,Mt):i;if(t){const e=nt(t.provider,t.prefix),s=t.name;return e.icons[s]||(e.missing.has(s)?null:void 0)}}function In(i,t){const e=Wt(i,!0,Mt);if(!e)return!1;const s=nt(e.provider,e.prefix);return Xs(s,e.name,t)}function Bi(i,t){if(typeof i!="object")return!1;if(typeof t!="string"&&(t=i.provider||""),Mt&&!t&&!i.prefix){let n=!1;return Tn(i)&&(i.prefix="",An(i,(o,r)=>{r&&In(o,r)&&(n=!0)})),n}const e=i.prefix;if(!te({provider:t,prefix:e,name:"a"}))return!1;const s=nt(t,e);return!!Ge(s,i)}function Di(i){return!!Rt(i)}function Ks(i){const t=Rt(i);return t?{...qt,...t}:null}function Zs(i){const t={loaded:[],missing:[],pending:[]},e=Object.create(null);i.sort((n,o)=>n.provider!==o.provider?n.provider.localeCompare(o.provider):n.prefix!==o.prefix?n.prefix.localeCompare(o.prefix):n.name.localeCompare(o.name));let s={provider:"",prefix:"",name:""};return i.forEach(n=>{if(s.name===n.name&&s.prefix===n.prefix&&s.provider===n.provider)return;s=n;const o=n.provider,r=n.prefix,a=n.name,l=e[o]||(e[o]=Object.create(null)),c=l[r]||(l[r]=nt(o,r));let u;a in c.icons?u=t.loaded:r===""||c.missing.has(a)?u=t.missing:u=t.pending;const d={provider:o,prefix:r,name:a};u.push(d)}),t}function Ln(i,t){i.forEach(e=>{const s=e.loaderCallbacks;s&&(e.loaderCallbacks=s.filter(n=>n.id!==t))})}function to(i){i.pendingCallbacksFlag||(i.pendingCallbacksFlag=!0,setTimeout(()=>{i.pendingCallbacksFlag=!1;const t=i.loaderCallbacks?i.loaderCallbacks.slice(0):[];if(!t.length)return;let e=!1;const s=i.provider,n=i.prefix;t.forEach(o=>{const r=o.icons,a=r.pending.length;r.pending=r.pending.filter(l=>{if(l.prefix!==n)return!0;const c=l.name;if(i.icons[c])r.loaded.push({provider:s,prefix:n,name:c});else if(i.missing.has(c))r.missing.push({provider:s,prefix:n,name:c});else return e=!0,!0;return!1}),r.pending.length!==a&&(e||Ln([i],o.id),o.callback(r.loaded.slice(0),r.missing.slice(0),r.pending.slice(0),o.abort))})}))}let eo=0;function io(i,t,e){const s=eo++,n=Ln.bind(null,e,s);if(!t.pending.length)return n;const o={id:s,icons:t,callback:i,abort:n};return e.forEach(r=>{(r.loaderCallbacks||(r.loaderCallbacks=[])).push(o)}),n}const je=Object.create(null);function Ni(i,t){je[i]=t}function Me(i){return je[i]||je[""]}function no(i,t=!0,e=!1){const s=[];return i.forEach(n=>{const o=typeof n=="string"?Wt(n,t,e):n;o&&s.push(o)}),s}var so={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function oo(i,t,e,s){const n=i.resources.length,o=i.random?Math.floor(Math.random()*n):i.index;let r;if(i.random){let y=i.resources.slice(0);for(r=[];y.length>1;){const T=Math.floor(Math.random()*y.length);r.push(y[T]),y=y.slice(0,T).concat(y.slice(T+1))}r=r.concat(y)}else r=i.resources.slice(o).concat(i.resources.slice(0,o));const a=Date.now();let l="pending",c=0,u,d=null,f=[],p=[];typeof s=="function"&&p.push(s);function b(){d&&(clearTimeout(d),d=null)}function v(){l==="pending"&&(l="aborted"),b(),f.forEach(y=>{y.status==="pending"&&(y.status="aborted")}),f=[]}function g(y,T){T&&(p=[]),typeof y=="function"&&p.push(y)}function S(){return{startTime:a,payload:t,status:l,queriesSent:c,queriesPending:f.length,subscribe:g,abort:v}}function $(){l="failed",p.forEach(y=>{y(void 0,u)})}function x(){f.forEach(y=>{y.status==="pending"&&(y.status="aborted")}),f=[]}function w(y,T,L){const q=T!=="success";switch(f=f.filter(O=>O!==y),l){case"pending":break;case"failed":if(q||!i.dataAfterTimeout)return;break;default:return}if(T==="abort"){u=L,$();return}if(q){u=L,f.length||(r.length?k():$());return}if(b(),x(),!i.random){const O=i.resources.indexOf(y.resource);O!==-1&&O!==i.index&&(i.index=O)}l="completed",p.forEach(O=>{O(L)})}function k(){if(l!=="pending")return;b();const y=r.shift();if(y===void 0){if(f.length){d=setTimeout(()=>{b(),l==="pending"&&(x(),$())},i.timeout);return}$();return}const T={status:"pending",resource:y,callback:(L,q)=>{w(T,L,q)}};f.push(T),c++,d=setTimeout(k,i.rotate),e(y,t,T.callback)}return setTimeout(k),S}function zn(i){const t={...so,...i};let e=[];function s(){e=e.filter(a=>a().status==="pending")}function n(a,l,c){const u=oo(t,a,l,(d,f)=>{s(),c&&c(d,f)});return e.push(u),u}function o(a){return e.find(l=>a(l))||null}return{query:n,find:o,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:s}}function Xe(i){let t;if(typeof i.resources=="string")t=[i.resources];else if(t=i.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:i.path||"/",maxURL:i.maxURL||500,rotate:i.rotate||750,timeout:i.timeout||5e3,random:i.random===!0,index:i.index||0,dataAfterTimeout:i.dataAfterTimeout!==!1}}const ye=Object.create(null),Pt=["https://api.simplesvg.com","https://api.unisvg.com"],ee=[];for(;Pt.length>0;)Pt.length===1||Math.random()>.5?ee.push(Pt.shift()):ee.push(Pt.pop());ye[""]=Xe({resources:["https://api.iconify.design"].concat(ee)});function Fi(i,t){const e=Xe(t);return e===null?!1:(ye[i]=e,!0)}function _e(i){return ye[i]}function ro(){return Object.keys(ye)}function Hi(){}const Oe=Object.create(null);function lo(i){if(!Oe[i]){const t=_e(i);if(!t)return;const e=zn(t),s={config:t,redundancy:e};Oe[i]=s}return Oe[i]}function jn(i,t,e){let s,n;if(typeof i=="string"){const o=Me(i);if(!o)return e(void 0,424),Hi;n=o.send;const r=lo(i);r&&(s=r.redundancy)}else{const o=Xe(i);if(o){s=zn(o);const r=i.resources?i.resources[0]:"",a=Me(r);a&&(n=a.send)}}return!s||!n?(e(void 0,424),Hi):s.query(t,n,e)().abort}const Vi="iconify2",Bt="iconify",Mn=Bt+"-count",qi=Bt+"-version",Rn=36e5,ao=168,co=50;function Re(i,t){try{return i.getItem(t)}catch{}}function Je(i,t,e){try{return i.setItem(t,e),!0}catch{}}function Wi(i,t){try{i.removeItem(t)}catch{}}function Be(i,t){return Je(i,Mn,t.toString())}function De(i){return parseInt(Re(i,Mn))||0}const gt={local:!0,session:!0},Bn={local:new Set,session:new Set};let Ke=!1;function uo(i){Ke=i}let Zt=typeof window>"u"?{}:window;function Dn(i){const t=i+"Storage";try{if(Zt&&Zt[t]&&typeof Zt[t].length=="number")return Zt[t]}catch{}gt[i]=!1}function Nn(i,t){const e=Dn(i);if(!e)return;const s=Re(e,qi);if(s!==Vi){if(s){const a=De(e);for(let l=0;l{const l=Bt+a.toString(),c=Re(e,l);if(typeof c=="string"){try{const u=JSON.parse(c);if(typeof u=="object"&&typeof u.cached=="number"&&u.cached>n&&typeof u.provider=="string"&&typeof u.data=="object"&&typeof u.data.prefix=="string"&&t(u,a))return!0}catch{}Wi(e,l)}};let r=De(e);for(let a=r-1;a>=0;a--)o(a)||(a===r-1?(r--,Be(e,r)):Bn[i].add(a))}function Fn(){if(!Ke){uo(!0);for(const i in gt)Nn(i,t=>{const e=t.data,s=t.provider,n=e.prefix,o=nt(s,n);if(!Ge(o,e).length)return!1;const r=e.lastModified||-1;return o.lastModifiedCached=o.lastModifiedCached?Math.min(o.lastModifiedCached,r):r,!0})}}function ho(i,t){const e=i.lastModifiedCached;if(e&&e>=t)return e===t;if(i.lastModifiedCached=t,e)for(const s in gt)Nn(s,n=>{const o=n.data;return n.provider!==i.provider||o.prefix!==i.prefix||o.lastModified===t});return!0}function fo(i,t){Ke||Fn();function e(s){let n;if(!gt[s]||!(n=Dn(s)))return;const o=Bn[s];let r;if(o.size)o.delete(r=Array.from(o).shift());else if(r=De(n),r>=co||!Be(n,r+1))return;const a={cached:Math.floor(Date.now()/Rn),provider:i.provider,data:t};return Je(n,Bt+r.toString(),JSON.stringify(a))}t.lastModified&&!ho(i,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),e("local")||e("session"))}function Ui(){}function po(i){i.iconsLoaderFlag||(i.iconsLoaderFlag=!0,setTimeout(()=>{i.iconsLoaderFlag=!1,to(i)}))}function mo(i,t){i.iconsToLoad?i.iconsToLoad=i.iconsToLoad.concat(t).sort():i.iconsToLoad=t,i.iconsQueueFlag||(i.iconsQueueFlag=!0,setTimeout(()=>{i.iconsQueueFlag=!1;const{provider:e,prefix:s}=i,n=i.iconsToLoad;delete i.iconsToLoad;let o;if(!n||!(o=Me(e)))return;o.prepare(e,s,n).forEach(a=>{jn(e,a,l=>{if(typeof l!="object")a.icons.forEach(c=>{i.missing.add(c)});else try{const c=Ge(i,l);if(!c.length)return;const u=i.pendingIcons;u&&c.forEach(d=>{u.delete(d)}),fo(i,l)}catch(c){console.error(c)}po(i)})})}))}const Ze=(i,t)=>{const e=no(i,!0,Pn()),s=Zs(e);if(!s.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(s.loaded,s.missing,s.pending,Ui)}),()=>{l=!1}}const n=Object.create(null),o=[];let r,a;return s.pending.forEach(l=>{const{provider:c,prefix:u}=l;if(u===a&&c===r)return;r=c,a=u,o.push(nt(c,u));const d=n[c]||(n[c]=Object.create(null));d[u]||(d[u]=[])}),s.pending.forEach(l=>{const{provider:c,prefix:u,name:d}=l,f=nt(c,u),p=f.pendingIcons||(f.pendingIcons=new Set);p.has(d)||(p.add(d),n[c][u].push(d))}),o.forEach(l=>{const{provider:c,prefix:u}=l;n[c][u].length&&mo(l,n[c][u])}),t?io(t,s,o):Ui},bo=i=>new Promise((t,e)=>{const s=typeof i=="string"?Wt(i,!0):i;if(!s){e(i);return}Ze([s||i],n=>{if(n.length&&s){const o=Rt(s);if(o){t({...qt,...o});return}}e(i)})});function go(i){try{const t=typeof i=="string"?JSON.parse(i):i;if(typeof t.body=="string")return{...t}}catch{}}function vo(i,t){const e=typeof i=="string"?Wt(i,!0,!0):null;if(!e){const o=go(i);return{value:i,data:o}}const s=Rt(e);if(s!==void 0||!e.prefix)return{value:i,name:e,data:s};const n=Ze([e],()=>t(i,e,Rt(e)));return{value:i,name:e,loading:n}}function Ae(i){return i.hasAttribute("inline")}let Hn=!1;try{Hn=navigator.vendor.indexOf("Apple")===0}catch{}function yo(i,t){switch(t){case"svg":case"bg":case"mask":return t}return t!=="style"&&(Hn||i.indexOf("=0;){const n=i.indexOf(">",s),o=i.indexOf("",o);if(r===-1)break;e+=i.slice(n+1,o).trim(),i=i.slice(0,s).trim()+i.slice(r+1)}return{defs:e,content:i}}function Co(i,t){return i?""+i+""+t:t}function $o(i,t,e){const s=wo(i);return Co(s.defs,t+s.content+e)}const Eo=i=>i==="unset"||i==="undefined"||i==="none";function Vn(i,t){const e={...qt,...i},s={...kn,...t},n={left:e.left,top:e.top,width:e.width,height:e.height};let o=e.body;[e,s].forEach(v=>{const g=[],S=v.hFlip,$=v.vFlip;let x=v.rotate;S?$?x+=2:(g.push("translate("+(n.width+n.left).toString()+" "+(0-n.top).toString()+")"),g.push("scale(-1 1)"),n.top=n.left=0):$&&(g.push("translate("+(0-n.left).toString()+" "+(n.height+n.top).toString()+")"),g.push("scale(1 -1)"),n.top=n.left=0);let w;switch(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){case 1:w=n.height/2+n.top,g.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:g.unshift("rotate(180 "+(n.width/2+n.left).toString()+" "+(n.height/2+n.top).toString()+")");break;case 3:w=n.width/2+n.left,g.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}x%2===1&&(n.left!==n.top&&(w=n.left,n.left=n.top,n.top=w),n.width!==n.height&&(w=n.width,n.width=n.height,n.height=w)),g.length&&(o=$o(o,'',""))});const r=s.width,a=s.height,l=n.width,c=n.height;let u,d;r===null?(d=a===null?"1em":a==="auto"?c:a,u=Ne(d,l/c)):(u=r==="auto"?l:r,d=a===null?Ne(u,c/l):a==="auto"?c:a);const f={},p=(v,g)=>{Eo(g)||(f[v]=g.toString())};p("width",u),p("height",d);const b=[n.left,n.top,l,c];return f.viewBox=b.join(" "),{attributes:f,viewBox:b,body:o}}function ti(i,t){let e=i.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const s in t)e+=" "+s+'="'+t[s]+'"';return'"+i+""}function So(i){return i.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function ko(i){return"data:image/svg+xml,"+So(i)}function qn(i){return'url("'+ko(i)+'")'}const Oo=()=>{let i;try{if(i=fetch,typeof i=="function")return i}catch{}};let ae=Oo();function Ao(i){ae=i}function To(){return ae}function Po(i,t){const e=_e(i);if(!e)return 0;let s;if(!e.maxURL)s=0;else{let n=0;e.resources.forEach(r=>{n=Math.max(n,r.length)});const o=t+".json?icons=";s=e.maxURL-n-e.path.length-o.length}return s}function Io(i){return i===404}const Lo=(i,t,e)=>{const s=[],n=Po(i,t),o="icons";let r={type:o,provider:i,prefix:t,icons:[]},a=0;return e.forEach((l,c)=>{a+=l.length+1,a>=n&&c>0&&(s.push(r),r={type:o,provider:i,prefix:t,icons:[]},a=l.length),r.icons.push(l)}),s.push(r),s};function zo(i){if(typeof i=="string"){const t=_e(i);if(t)return t.path}return"/"}const jo=(i,t,e)=>{if(!ae){e("abort",424);return}let s=zo(t.provider);switch(t.type){case"icons":{const o=t.prefix,a=t.icons.join(","),l=new URLSearchParams({icons:a});s+=o+".json?"+l.toString();break}case"custom":{const o=t.uri;s+=o.slice(0,1)==="/"?o.slice(1):o;break}default:e("abort",400);return}let n=503;ae(i+s).then(o=>{const r=o.status;if(r!==200){setTimeout(()=>{e(Io(r)?"abort":"next",r)});return}return n=501,o.json()}).then(o=>{if(typeof o!="object"||o===null){setTimeout(()=>{o===404?e("abort",o):e("next",n)});return}setTimeout(()=>{e("success",o)})}).catch(()=>{e("next",n)})},Mo={prepare:Lo,send:jo};function Qi(i,t){switch(i){case"local":case"session":gt[i]=t;break;case"all":for(const e in gt)gt[e]=t;break}}const Te="data-style";let Wn="";function Ro(i){Wn=i}function Yi(i,t){let e=Array.from(i.childNodes).find(s=>s.hasAttribute&&s.hasAttribute(Te));e||(e=document.createElement("style"),e.setAttribute(Te,Te),i.appendChild(e)),e.textContent=":host{display:inline-block;vertical-align:"+(t?"-0.125em":"0")+"}span,svg{display:block}"+Wn}function Un(){Ni("",Mo),Pn(!0);let i;try{i=window}catch{}if(i){if(Fn(),i.IconifyPreload!==void 0){const e=i.IconifyPreload,s="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(n=>{try{(typeof n!="object"||n===null||n instanceof Array||typeof n.icons!="object"||typeof n.prefix!="string"||!Bi(n))&&console.error(s)}catch{console.error(s)}})}if(i.IconifyProviders!==void 0){const e=i.IconifyProviders;if(typeof e=="object"&&e!==null)for(const s in e){const n="IconifyProviders["+s+"] is invalid.";try{const o=e[s];if(typeof o!="object"||!o||o.resources===void 0)continue;Fi(s,o)||console.error(n)}catch{console.error(n)}}}}return{enableCache:e=>Qi(e,!0),disableCache:e=>Qi(e,!1),iconLoaded:Di,iconExists:Di,getIcon:Ks,listIcons:Js,addIcon:In,addCollection:Bi,calculateSize:Ne,buildIcon:Vn,iconToHTML:ti,svgToURL:qn,loadIcons:Ze,loadIcon:bo,addAPIProvider:Fi,appendCustomStyle:Ro,_api:{getAPIConfig:_e,setAPIModule:Ni,sendAPIQuery:jn,setFetch:Ao,getFetch:To,listAPIProviders:ro}}}const Fe={"background-color":"currentColor"},Qn={"background-color":"transparent"},Gi={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Xi={"-webkit-mask":Fe,mask:Fe,background:Qn};for(const i in Xi){const t=Xi[i];for(const e in Gi)t[i+"-"+e]=Gi[e]}function Ji(i){return i?i+(i.match(/^[-0-9.]+$/)?"px":""):"inherit"}function Bo(i,t,e){const s=document.createElement("span");let n=i.body;n.indexOf("");const o=i.attributes,r=ti(n,{...o,width:t.width+"",height:t.height+""}),a=qn(r),l=s.style,c={"--svg":a,width:Ji(o.width),height:Ji(o.height),...e?Fe:Qn};for(const u in c)l.setProperty(u,c[u]);return s}let zt;function Do(){try{zt=window.trustedTypes.createPolicy("iconify",{createHTML:i=>i})}catch{zt=null}}function No(i){return zt===void 0&&Do(),zt?zt.createHTML(i):i}function Fo(i){const t=document.createElement("span"),e=i.attributes;let s="";e.width||(s="width: inherit;"),e.height||(s+="height: inherit;"),s&&(e.style=s);const n=ti(i.body,e);return t.innerHTML=No(n),t.firstChild}function He(i){return Array.from(i.childNodes).find(t=>{const e=t.tagName&&t.tagName.toUpperCase();return e==="SPAN"||e==="SVG"})}function Ki(i,t){const e=t.icon.data,s=t.customisations,n=Vn(e,s);s.preserveAspectRatio&&(n.attributes.preserveAspectRatio=s.preserveAspectRatio);const o=t.renderedMode;let r;switch(o){case"svg":r=Fo(n);break;default:r=Bo(n,{...qt,...e},o==="mask")}const a=He(i);a?r.tagName==="SPAN"&&a.tagName===r.tagName?a.setAttribute("style",r.getAttribute("style")):i.replaceChild(r,a):i.appendChild(r)}function Zi(i,t,e){const s=e&&(e.rendered?e:e.lastRender);return{rendered:!1,inline:t,icon:i,lastRender:s}}function Ho(i="iconify-icon"){let t,e;try{t=window.customElements,e=window.HTMLElement}catch{return}if(!t||!e)return;const s=t.get(i);if(s)return s;const n=["icon","mode","inline","observe","width","height","rotate","flip"],o=class extends e{constructor(){super();Z(this,"_shadowRoot");Z(this,"_initialised",!1);Z(this,"_state");Z(this,"_checkQueued",!1);Z(this,"_connected",!1);Z(this,"_observer",null);Z(this,"_visible",!0);const l=this._shadowRoot=this.attachShadow({mode:"open"}),c=Ae(this);Yi(l,c),this._state=Zi({value:""},c),this._queueCheck()}connectedCallback(){this._connected=!0,this.startObserver()}disconnectedCallback(){this._connected=!1,this.stopObserver()}static get observedAttributes(){return n.slice(0)}attributeChangedCallback(l){switch(l){case"inline":{const c=Ae(this),u=this._state;c!==u.inline&&(u.inline=c,Yi(this._shadowRoot,c));break}case"observer":{this.observer?this.startObserver():this.stopObserver();break}default:this._queueCheck()}}get icon(){const l=this.getAttribute("icon");if(l&&l.slice(0,1)==="{")try{return JSON.parse(l)}catch{}return l}set icon(l){typeof l=="object"&&(l=JSON.stringify(l)),this.setAttribute("icon",l)}get inline(){return Ae(this)}set inline(l){l?this.setAttribute("inline","true"):this.removeAttribute("inline")}get observer(){return this.hasAttribute("observer")}set observer(l){l?this.setAttribute("observer","true"):this.removeAttribute("observer")}restartAnimation(){const l=this._state;if(l.rendered){const c=this._shadowRoot;if(l.renderedMode==="svg")try{c.lastChild.setCurrentTime(0);return}catch{}Ki(c,l)}}get status(){const l=this._state;return l.rendered?"rendered":l.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const l=this._state,c=this.getAttribute("icon");if(c!==l.icon.value){this._iconChanged(c);return}if(!l.rendered||!this._visible)return;const u=this.getAttribute("mode"),d=Mi(this);(l.attrMode!==u||qs(l.customisations,d)||!He(this._shadowRoot))&&this._renderIcon(l.icon,d,u)}_iconChanged(l){const c=vo(l,(u,d,f)=>{const p=this._state;if(p.rendered||this.getAttribute("icon")!==u)return;const b={value:u,name:d,data:f};b.data?this._gotIconData(b):p.icon=b});c.data?this._gotIconData(c):this._state=Zi(c,this._state.inline,this._state)}_forceRender(){if(!this._visible){const l=He(this._shadowRoot);l&&this._shadowRoot.removeChild(l);return}this._queueCheck()}_gotIconData(l){this._checkQueued=!1,this._renderIcon(l,Mi(this),this.getAttribute("mode"))}_renderIcon(l,c,u){const d=yo(l.data.body,u),f=this._state.inline;Ki(this._shadowRoot,this._state={rendered:!0,icon:l,inline:f,customisations:c,attrMode:u,renderedMode:d})}startObserver(){if(!this._observer)try{this._observer=new IntersectionObserver(l=>{const c=l.some(u=>u.isIntersecting);c!==this._visible&&(this._visible=c,this._forceRender())}),this._observer.observe(this)}catch{if(this._observer){try{this._observer.disconnect()}catch{}this._observer=null}}}stopObserver(){this._observer&&(this._observer.disconnect(),this._observer=null,this._visible=!0,this._connected&&this._forceRender())}};n.forEach(a=>{a in o.prototype||Object.defineProperty(o.prototype,a,{get:function(){return this.getAttribute(a)},set:function(l){l!==null?this.setAttribute(a,l):this.removeAttribute(a)}})});const r=Un();for(const a in r)o[a]=o.prototype[a]=r[a];return t.define(i,o),o}Ho()||Un();var Vo=Object.defineProperty,V=(i,t,e,s)=>{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&Vo(t,e,n),n},Ot;const D=(Ot=class extends E{constructor(){super(),this.labelHidden=!1,this.active=!1,this.disabled=!1,this.vertical=!1,this.tooltipVisible=!1,this._parent=tt(),this._tooltip=tt(),this._contextMenu=tt(),this._mouseLeave=!1,this.onWindowMouseUp=t=>{const{value:e}=this._contextMenu;!this.contains(t.target)&&e&&(e.visible=!1)},this.mouseLeave=!0,this.addEventListener("click",t=>t.stopPropagation())}set mouseLeave(t){this._mouseLeave=t,t&&(this.tooltipVisible=!1,clearTimeout(this.timeoutID))}get mouseLeave(){return this._mouseLeave}computeTooltipPosition(){const{value:t}=this._parent,{value:e}=this._tooltip;t&&e&&wn(t,e,{placement:"bottom",middleware:[cn(10),xn(),_n(),yn({padding:5})]}).then(s=>{const{x:n,y:o}=s;Object.assign(e.style,{left:`${n}px`,top:`${o}px`})})}onMouseEnter(){if(!(this.tooltipTitle||this.tooltipText))return;this.mouseLeave=!1;const t=this.tooltipTime??700;this.timeoutID=setTimeout(()=>{this.mouseLeave||(this.computeTooltipPosition(),this.tooltipVisible=!0)},t)}onChildrenClick(t){t.stopPropagation();const{value:e}=this._contextMenu;e&&(e.visible=!e.visible)}onSlotChange(t){const{value:e}=this._contextMenu,s=t.target.assignedElements();for(const n of s){if(!(n instanceof Ot)){n.remove(),console.warn("Only bim-button is allowed inside bim-button. Child has been removed.");continue}n.addEventListener("click",()=>e==null?void 0:e.updatePosition())}this.requestUpdate()}connectedCallback(){super.connectedCallback(),window.addEventListener("mouseup",this.onWindowMouseUp)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mouseup",this.onWindowMouseUp)}render(){const t=m` -
+*/const vn=Object.freeze({left:0,top:0,width:16,height:16}),oe=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),qt=Object.freeze({...vn,...oe}),Ie=Object.freeze({...qt,body:"",hidden:!1}),As=Object.freeze({width:null,height:null}),yn=Object.freeze({...As,...oe});function Ts(i,t=0){const e=i.replace(/^-?[0-9.]*/,"");function s(n){for(;n<0;)n+=4;return n%4}if(e===""){const n=parseInt(i);return isNaN(n)?0:s(n)}else if(e!==i){let n=0;switch(e){case"%":n=25;break;case"deg":n=90}if(n){let o=parseFloat(i.slice(0,i.length-e.length));return isNaN(o)?0:(o=o/n,o%1===0?s(o):0)}}return t}const Ps=/[\s,]+/;function Ls(i,t){t.split(Ps).forEach(e=>{switch(e.trim()){case"horizontal":i.hFlip=!0;break;case"vertical":i.vFlip=!0;break}})}const _n={...yn,preserveAspectRatio:""};function Pi(i){const t={..._n},e=(s,n)=>i.getAttribute(s)||n;return t.width=e("width",null),t.height=e("height",null),t.rotate=Ts(e("rotate","")),Ls(t,e("flip","")),t.preserveAspectRatio=e("preserveAspectRatio",e("preserveaspectratio","")),t}function zs(i,t){for(const e in _n)if(i[e]!==t[e])return!0;return!1}const zt=/^[a-z0-9]+(-[a-z0-9]+)*$/,Wt=(i,t,e,s="")=>{const n=i.split(":");if(i.slice(0,1)==="@"){if(n.length<2||n.length>3)return null;s=n.shift().slice(1)}if(n.length>3||!n.length)return null;if(n.length>1){const a=n.pop(),l=n.pop(),c={provider:n.length>0?n[0]:s,prefix:l,name:a};return t&&!te(c)?null:c}const o=n[0],r=o.split("-");if(r.length>1){const a={provider:s,prefix:r.shift(),name:r.join("-")};return t&&!te(a)?null:a}if(e&&s===""){const a={provider:s,prefix:"",name:o};return t&&!te(a,e)?null:a}return null},te=(i,t)=>i?!!((i.provider===""||i.provider.match(zt))&&(t&&i.prefix===""||i.prefix.match(zt))&&i.name.match(zt)):!1;function Is(i,t){const e={};!i.hFlip!=!t.hFlip&&(e.hFlip=!0),!i.vFlip!=!t.vFlip&&(e.vFlip=!0);const s=((i.rotate||0)+(t.rotate||0))%4;return s&&(e.rotate=s),e}function Li(i,t){const e=Is(i,t);for(const s in Ie)s in oe?s in i&&!(s in e)&&(e[s]=oe[s]):s in t?e[s]=t[s]:s in i&&(e[s]=i[s]);return e}function js(i,t){const e=i.icons,s=i.aliases||Object.create(null),n=Object.create(null);function o(r){if(e[r])return n[r]=[];if(!(r in n)){n[r]=null;const a=s[r]&&s[r].parent,l=a&&o(a);l&&(n[r]=[a].concat(l))}return n[r]}return Object.keys(e).concat(Object.keys(s)).forEach(o),n}function Ms(i,t,e){const s=i.icons,n=i.aliases||Object.create(null);let o={};function r(a){o=Li(s[a]||n[a],o)}return r(t),e.forEach(r),Li(i,o)}function xn(i,t){const e=[];if(typeof i!="object"||typeof i.icons!="object")return e;i.not_found instanceof Array&&i.not_found.forEach(n=>{t(n,null),e.push(n)});const s=js(i);for(const n in s){const o=s[n];o&&(t(n,Ms(i,n,o)),e.push(n))}return e}const Rs={provider:"",aliases:{},not_found:{},...vn};function Se(i,t){for(const e in t)if(e in i&&typeof i[e]!=typeof t[e])return!1;return!0}function wn(i){if(typeof i!="object"||i===null)return null;const t=i;if(typeof t.prefix!="string"||!i.icons||typeof i.icons!="object"||!Se(i,Rs))return null;const e=t.icons;for(const n in e){const o=e[n];if(!n.match(zt)||typeof o.body!="string"||!Se(o,Ie))return null}const s=t.aliases||Object.create(null);for(const n in s){const o=s[n],r=o.parent;if(!n.match(zt)||typeof r!="string"||!e[r]&&!s[r]||!Se(o,Ie))return null}return t}const re=Object.create(null);function Bs(i,t){return{provider:i,prefix:t,icons:Object.create(null),missing:new Set}}function nt(i,t){const e=re[i]||(re[i]=Object.create(null));return e[t]||(e[t]=Bs(i,t))}function Ge(i,t){return wn(t)?xn(t,(e,s)=>{s?i.icons[e]=s:i.missing.add(e)}):[]}function Ds(i,t,e){try{if(typeof e.body=="string")return i.icons[t]={...e},!0}catch{}return!1}function Ns(i,t){let e=[];return(typeof i=="string"?[i]:Object.keys(re)).forEach(n=>{(typeof n=="string"&&typeof t=="string"?[t]:Object.keys(re[n]||{})).forEach(r=>{const a=nt(n,r);e=e.concat(Object.keys(a.icons).map(l=>(n!==""?"@"+n+":":"")+r+":"+l))})}),e}let Mt=!1;function Cn(i){return typeof i=="boolean"&&(Mt=i),Mt}function Rt(i){const t=typeof i=="string"?Wt(i,!0,Mt):i;if(t){const e=nt(t.provider,t.prefix),s=t.name;return e.icons[s]||(e.missing.has(s)?null:void 0)}}function $n(i,t){const e=Wt(i,!0,Mt);if(!e)return!1;const s=nt(e.provider,e.prefix);return Ds(s,e.name,t)}function zi(i,t){if(typeof i!="object")return!1;if(typeof t!="string"&&(t=i.provider||""),Mt&&!t&&!i.prefix){let n=!1;return wn(i)&&(i.prefix="",xn(i,(o,r)=>{r&&$n(o,r)&&(n=!0)})),n}const e=i.prefix;if(!te({provider:t,prefix:e,name:"a"}))return!1;const s=nt(t,e);return!!Ge(s,i)}function Ii(i){return!!Rt(i)}function Hs(i){const t=Rt(i);return t?{...qt,...t}:null}function Fs(i){const t={loaded:[],missing:[],pending:[]},e=Object.create(null);i.sort((n,o)=>n.provider!==o.provider?n.provider.localeCompare(o.provider):n.prefix!==o.prefix?n.prefix.localeCompare(o.prefix):n.name.localeCompare(o.name));let s={provider:"",prefix:"",name:""};return i.forEach(n=>{if(s.name===n.name&&s.prefix===n.prefix&&s.provider===n.provider)return;s=n;const o=n.provider,r=n.prefix,a=n.name,l=e[o]||(e[o]=Object.create(null)),c=l[r]||(l[r]=nt(o,r));let u;a in c.icons?u=t.loaded:r===""||c.missing.has(a)?u=t.missing:u=t.pending;const d={provider:o,prefix:r,name:a};u.push(d)}),t}function En(i,t){i.forEach(e=>{const s=e.loaderCallbacks;s&&(e.loaderCallbacks=s.filter(n=>n.id!==t))})}function Vs(i){i.pendingCallbacksFlag||(i.pendingCallbacksFlag=!0,setTimeout(()=>{i.pendingCallbacksFlag=!1;const t=i.loaderCallbacks?i.loaderCallbacks.slice(0):[];if(!t.length)return;let e=!1;const s=i.provider,n=i.prefix;t.forEach(o=>{const r=o.icons,a=r.pending.length;r.pending=r.pending.filter(l=>{if(l.prefix!==n)return!0;const c=l.name;if(i.icons[c])r.loaded.push({provider:s,prefix:n,name:c});else if(i.missing.has(c))r.missing.push({provider:s,prefix:n,name:c});else return e=!0,!0;return!1}),r.pending.length!==a&&(e||En([i],o.id),o.callback(r.loaded.slice(0),r.missing.slice(0),r.pending.slice(0),o.abort))})}))}let qs=0;function Ws(i,t,e){const s=qs++,n=En.bind(null,e,s);if(!t.pending.length)return n;const o={id:s,icons:t,callback:i,abort:n};return e.forEach(r=>{(r.loaderCallbacks||(r.loaderCallbacks=[])).push(o)}),n}const je=Object.create(null);function ji(i,t){je[i]=t}function Me(i){return je[i]||je[""]}function Us(i,t=!0,e=!1){const s=[];return i.forEach(n=>{const o=typeof n=="string"?Wt(n,t,e):n;o&&s.push(o)}),s}var Qs={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Ys(i,t,e,s){const n=i.resources.length,o=i.random?Math.floor(Math.random()*n):i.index;let r;if(i.random){let y=i.resources.slice(0);for(r=[];y.length>1;){const T=Math.floor(Math.random()*y.length);r.push(y[T]),y=y.slice(0,T).concat(y.slice(T+1))}r=r.concat(y)}else r=i.resources.slice(o).concat(i.resources.slice(0,o));const a=Date.now();let l="pending",c=0,u,d=null,f=[],p=[];typeof s=="function"&&p.push(s);function b(){d&&(clearTimeout(d),d=null)}function v(){l==="pending"&&(l="aborted"),b(),f.forEach(y=>{y.status==="pending"&&(y.status="aborted")}),f=[]}function g(y,T){T&&(p=[]),typeof y=="function"&&p.push(y)}function S(){return{startTime:a,payload:t,status:l,queriesSent:c,queriesPending:f.length,subscribe:g,abort:v}}function $(){l="failed",p.forEach(y=>{y(void 0,u)})}function x(){f.forEach(y=>{y.status==="pending"&&(y.status="aborted")}),f=[]}function w(y,T,z){const q=T!=="success";switch(f=f.filter(O=>O!==y),l){case"pending":break;case"failed":if(q||!i.dataAfterTimeout)return;break;default:return}if(T==="abort"){u=z,$();return}if(q){u=z,f.length||(r.length?k():$());return}if(b(),x(),!i.random){const O=i.resources.indexOf(y.resource);O!==-1&&O!==i.index&&(i.index=O)}l="completed",p.forEach(O=>{O(z)})}function k(){if(l!=="pending")return;b();const y=r.shift();if(y===void 0){if(f.length){d=setTimeout(()=>{b(),l==="pending"&&(x(),$())},i.timeout);return}$();return}const T={status:"pending",resource:y,callback:(z,q)=>{w(T,z,q)}};f.push(T),c++,d=setTimeout(k,i.rotate),e(y,t,T.callback)}return setTimeout(k),S}function Sn(i){const t={...Qs,...i};let e=[];function s(){e=e.filter(a=>a().status==="pending")}function n(a,l,c){const u=Ys(t,a,l,(d,f)=>{s(),c&&c(d,f)});return e.push(u),u}function o(a){return e.find(l=>a(l))||null}return{query:n,find:o,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:s}}function Xe(i){let t;if(typeof i.resources=="string")t=[i.resources];else if(t=i.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:i.path||"/",maxURL:i.maxURL||500,rotate:i.rotate||750,timeout:i.timeout||5e3,random:i.random===!0,index:i.index||0,dataAfterTimeout:i.dataAfterTimeout!==!1}}const ve=Object.create(null),Pt=["https://api.simplesvg.com","https://api.unisvg.com"],ee=[];for(;Pt.length>0;)Pt.length===1||Math.random()>.5?ee.push(Pt.shift()):ee.push(Pt.pop());ve[""]=Xe({resources:["https://api.iconify.design"].concat(ee)});function Mi(i,t){const e=Xe(t);return e===null?!1:(ve[i]=e,!0)}function ye(i){return ve[i]}function Gs(){return Object.keys(ve)}function Ri(){}const ke=Object.create(null);function Xs(i){if(!ke[i]){const t=ye(i);if(!t)return;const e=Sn(t),s={config:t,redundancy:e};ke[i]=s}return ke[i]}function kn(i,t,e){let s,n;if(typeof i=="string"){const o=Me(i);if(!o)return e(void 0,424),Ri;n=o.send;const r=Xs(i);r&&(s=r.redundancy)}else{const o=Xe(i);if(o){s=Sn(o);const r=i.resources?i.resources[0]:"",a=Me(r);a&&(n=a.send)}}return!s||!n?(e(void 0,424),Ri):s.query(t,n,e)().abort}const Bi="iconify2",Bt="iconify",On=Bt+"-count",Di=Bt+"-version",An=36e5,Js=168,Ks=50;function Re(i,t){try{return i.getItem(t)}catch{}}function Je(i,t,e){try{return i.setItem(t,e),!0}catch{}}function Ni(i,t){try{i.removeItem(t)}catch{}}function Be(i,t){return Je(i,On,t.toString())}function De(i){return parseInt(Re(i,On))||0}const gt={local:!0,session:!0},Tn={local:new Set,session:new Set};let Ke=!1;function Zs(i){Ke=i}let Zt=typeof window>"u"?{}:window;function Pn(i){const t=i+"Storage";try{if(Zt&&Zt[t]&&typeof Zt[t].length=="number")return Zt[t]}catch{}gt[i]=!1}function Ln(i,t){const e=Pn(i);if(!e)return;const s=Re(e,Di);if(s!==Bi){if(s){const a=De(e);for(let l=0;l{const l=Bt+a.toString(),c=Re(e,l);if(typeof c=="string"){try{const u=JSON.parse(c);if(typeof u=="object"&&typeof u.cached=="number"&&u.cached>n&&typeof u.provider=="string"&&typeof u.data=="object"&&typeof u.data.prefix=="string"&&t(u,a))return!0}catch{}Ni(e,l)}};let r=De(e);for(let a=r-1;a>=0;a--)o(a)||(a===r-1?(r--,Be(e,r)):Tn[i].add(a))}function zn(){if(!Ke){Zs(!0);for(const i in gt)Ln(i,t=>{const e=t.data,s=t.provider,n=e.prefix,o=nt(s,n);if(!Ge(o,e).length)return!1;const r=e.lastModified||-1;return o.lastModifiedCached=o.lastModifiedCached?Math.min(o.lastModifiedCached,r):r,!0})}}function to(i,t){const e=i.lastModifiedCached;if(e&&e>=t)return e===t;if(i.lastModifiedCached=t,e)for(const s in gt)Ln(s,n=>{const o=n.data;return n.provider!==i.provider||o.prefix!==i.prefix||o.lastModified===t});return!0}function eo(i,t){Ke||zn();function e(s){let n;if(!gt[s]||!(n=Pn(s)))return;const o=Tn[s];let r;if(o.size)o.delete(r=Array.from(o).shift());else if(r=De(n),r>=Ks||!Be(n,r+1))return;const a={cached:Math.floor(Date.now()/An),provider:i.provider,data:t};return Je(n,Bt+r.toString(),JSON.stringify(a))}t.lastModified&&!to(i,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),e("local")||e("session"))}function Hi(){}function io(i){i.iconsLoaderFlag||(i.iconsLoaderFlag=!0,setTimeout(()=>{i.iconsLoaderFlag=!1,Vs(i)}))}function no(i,t){i.iconsToLoad?i.iconsToLoad=i.iconsToLoad.concat(t).sort():i.iconsToLoad=t,i.iconsQueueFlag||(i.iconsQueueFlag=!0,setTimeout(()=>{i.iconsQueueFlag=!1;const{provider:e,prefix:s}=i,n=i.iconsToLoad;delete i.iconsToLoad;let o;if(!n||!(o=Me(e)))return;o.prepare(e,s,n).forEach(a=>{kn(e,a,l=>{if(typeof l!="object")a.icons.forEach(c=>{i.missing.add(c)});else try{const c=Ge(i,l);if(!c.length)return;const u=i.pendingIcons;u&&c.forEach(d=>{u.delete(d)}),eo(i,l)}catch(c){console.error(c)}io(i)})})}))}const Ze=(i,t)=>{const e=Us(i,!0,Cn()),s=Fs(e);if(!s.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(s.loaded,s.missing,s.pending,Hi)}),()=>{l=!1}}const n=Object.create(null),o=[];let r,a;return s.pending.forEach(l=>{const{provider:c,prefix:u}=l;if(u===a&&c===r)return;r=c,a=u,o.push(nt(c,u));const d=n[c]||(n[c]=Object.create(null));d[u]||(d[u]=[])}),s.pending.forEach(l=>{const{provider:c,prefix:u,name:d}=l,f=nt(c,u),p=f.pendingIcons||(f.pendingIcons=new Set);p.has(d)||(p.add(d),n[c][u].push(d))}),o.forEach(l=>{const{provider:c,prefix:u}=l;n[c][u].length&&no(l,n[c][u])}),t?Ws(t,s,o):Hi},so=i=>new Promise((t,e)=>{const s=typeof i=="string"?Wt(i,!0):i;if(!s){e(i);return}Ze([s||i],n=>{if(n.length&&s){const o=Rt(s);if(o){t({...qt,...o});return}}e(i)})});function oo(i){try{const t=typeof i=="string"?JSON.parse(i):i;if(typeof t.body=="string")return{...t}}catch{}}function ro(i,t){const e=typeof i=="string"?Wt(i,!0,!0):null;if(!e){const o=oo(i);return{value:i,data:o}}const s=Rt(e);if(s!==void 0||!e.prefix)return{value:i,name:e,data:s};const n=Ze([e],()=>t(i,e,Rt(e)));return{value:i,name:e,loading:n}}function Oe(i){return i.hasAttribute("inline")}let In=!1;try{In=navigator.vendor.indexOf("Apple")===0}catch{}function lo(i,t){switch(t){case"svg":case"bg":case"mask":return t}return t!=="style"&&(In||i.indexOf("=0;){const n=i.indexOf(">",s),o=i.indexOf("",o);if(r===-1)break;e+=i.slice(n+1,o).trim(),i=i.slice(0,s).trim()+i.slice(r+1)}return{defs:e,content:i}}function ho(i,t){return i?""+i+""+t:t}function fo(i,t,e){const s=uo(i);return ho(s.defs,t+s.content+e)}const po=i=>i==="unset"||i==="undefined"||i==="none";function jn(i,t){const e={...qt,...i},s={...yn,...t},n={left:e.left,top:e.top,width:e.width,height:e.height};let o=e.body;[e,s].forEach(v=>{const g=[],S=v.hFlip,$=v.vFlip;let x=v.rotate;S?$?x+=2:(g.push("translate("+(n.width+n.left).toString()+" "+(0-n.top).toString()+")"),g.push("scale(-1 1)"),n.top=n.left=0):$&&(g.push("translate("+(0-n.left).toString()+" "+(n.height+n.top).toString()+")"),g.push("scale(1 -1)"),n.top=n.left=0);let w;switch(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){case 1:w=n.height/2+n.top,g.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:g.unshift("rotate(180 "+(n.width/2+n.left).toString()+" "+(n.height/2+n.top).toString()+")");break;case 3:w=n.width/2+n.left,g.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}x%2===1&&(n.left!==n.top&&(w=n.left,n.left=n.top,n.top=w),n.width!==n.height&&(w=n.width,n.width=n.height,n.height=w)),g.length&&(o=fo(o,'',""))});const r=s.width,a=s.height,l=n.width,c=n.height;let u,d;r===null?(d=a===null?"1em":a==="auto"?c:a,u=Ne(d,l/c)):(u=r==="auto"?l:r,d=a===null?Ne(u,c/l):a==="auto"?c:a);const f={},p=(v,g)=>{po(g)||(f[v]=g.toString())};p("width",u),p("height",d);const b=[n.left,n.top,l,c];return f.viewBox=b.join(" "),{attributes:f,viewBox:b,body:o}}function ti(i,t){let e=i.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const s in t)e+=" "+s+'="'+t[s]+'"';return'"+i+""}function mo(i){return i.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function bo(i){return"data:image/svg+xml,"+mo(i)}function Mn(i){return'url("'+bo(i)+'")'}const go=()=>{let i;try{if(i=fetch,typeof i=="function")return i}catch{}};let le=go();function vo(i){le=i}function yo(){return le}function _o(i,t){const e=ye(i);if(!e)return 0;let s;if(!e.maxURL)s=0;else{let n=0;e.resources.forEach(r=>{n=Math.max(n,r.length)});const o=t+".json?icons=";s=e.maxURL-n-e.path.length-o.length}return s}function xo(i){return i===404}const wo=(i,t,e)=>{const s=[],n=_o(i,t),o="icons";let r={type:o,provider:i,prefix:t,icons:[]},a=0;return e.forEach((l,c)=>{a+=l.length+1,a>=n&&c>0&&(s.push(r),r={type:o,provider:i,prefix:t,icons:[]},a=l.length),r.icons.push(l)}),s.push(r),s};function Co(i){if(typeof i=="string"){const t=ye(i);if(t)return t.path}return"/"}const $o=(i,t,e)=>{if(!le){e("abort",424);return}let s=Co(t.provider);switch(t.type){case"icons":{const o=t.prefix,a=t.icons.join(","),l=new URLSearchParams({icons:a});s+=o+".json?"+l.toString();break}case"custom":{const o=t.uri;s+=o.slice(0,1)==="/"?o.slice(1):o;break}default:e("abort",400);return}let n=503;le(i+s).then(o=>{const r=o.status;if(r!==200){setTimeout(()=>{e(xo(r)?"abort":"next",r)});return}return n=501,o.json()}).then(o=>{if(typeof o!="object"||o===null){setTimeout(()=>{o===404?e("abort",o):e("next",n)});return}setTimeout(()=>{e("success",o)})}).catch(()=>{e("next",n)})},Eo={prepare:wo,send:$o};function Fi(i,t){switch(i){case"local":case"session":gt[i]=t;break;case"all":for(const e in gt)gt[e]=t;break}}const Ae="data-style";let Rn="";function So(i){Rn=i}function Vi(i,t){let e=Array.from(i.childNodes).find(s=>s.hasAttribute&&s.hasAttribute(Ae));e||(e=document.createElement("style"),e.setAttribute(Ae,Ae),i.appendChild(e)),e.textContent=":host{display:inline-block;vertical-align:"+(t?"-0.125em":"0")+"}span,svg{display:block}"+Rn}function Bn(){ji("",Eo),Cn(!0);let i;try{i=window}catch{}if(i){if(zn(),i.IconifyPreload!==void 0){const e=i.IconifyPreload,s="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(n=>{try{(typeof n!="object"||n===null||n instanceof Array||typeof n.icons!="object"||typeof n.prefix!="string"||!zi(n))&&console.error(s)}catch{console.error(s)}})}if(i.IconifyProviders!==void 0){const e=i.IconifyProviders;if(typeof e=="object"&&e!==null)for(const s in e){const n="IconifyProviders["+s+"] is invalid.";try{const o=e[s];if(typeof o!="object"||!o||o.resources===void 0)continue;Mi(s,o)||console.error(n)}catch{console.error(n)}}}}return{enableCache:e=>Fi(e,!0),disableCache:e=>Fi(e,!1),iconLoaded:Ii,iconExists:Ii,getIcon:Hs,listIcons:Ns,addIcon:$n,addCollection:zi,calculateSize:Ne,buildIcon:jn,iconToHTML:ti,svgToURL:Mn,loadIcons:Ze,loadIcon:so,addAPIProvider:Mi,appendCustomStyle:So,_api:{getAPIConfig:ye,setAPIModule:ji,sendAPIQuery:kn,setFetch:vo,getFetch:yo,listAPIProviders:Gs}}}const He={"background-color":"currentColor"},Dn={"background-color":"transparent"},qi={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Wi={"-webkit-mask":He,mask:He,background:Dn};for(const i in Wi){const t=Wi[i];for(const e in qi)t[i+"-"+e]=qi[e]}function Ui(i){return i?i+(i.match(/^[-0-9.]+$/)?"px":""):"inherit"}function ko(i,t,e){const s=document.createElement("span");let n=i.body;n.indexOf("");const o=i.attributes,r=ti(n,{...o,width:t.width+"",height:t.height+""}),a=Mn(r),l=s.style,c={"--svg":a,width:Ui(o.width),height:Ui(o.height),...e?He:Dn};for(const u in c)l.setProperty(u,c[u]);return s}let It;function Oo(){try{It=window.trustedTypes.createPolicy("iconify",{createHTML:i=>i})}catch{It=null}}function Ao(i){return It===void 0&&Oo(),It?It.createHTML(i):i}function To(i){const t=document.createElement("span"),e=i.attributes;let s="";e.width||(s="width: inherit;"),e.height||(s+="height: inherit;"),s&&(e.style=s);const n=ti(i.body,e);return t.innerHTML=Ao(n),t.firstChild}function Fe(i){return Array.from(i.childNodes).find(t=>{const e=t.tagName&&t.tagName.toUpperCase();return e==="SPAN"||e==="SVG"})}function Qi(i,t){const e=t.icon.data,s=t.customisations,n=jn(e,s);s.preserveAspectRatio&&(n.attributes.preserveAspectRatio=s.preserveAspectRatio);const o=t.renderedMode;let r;switch(o){case"svg":r=To(n);break;default:r=ko(n,{...qt,...e},o==="mask")}const a=Fe(i);a?r.tagName==="SPAN"&&a.tagName===r.tagName?a.setAttribute("style",r.getAttribute("style")):i.replaceChild(r,a):i.appendChild(r)}function Yi(i,t,e){const s=e&&(e.rendered?e:e.lastRender);return{rendered:!1,inline:t,icon:i,lastRender:s}}function Po(i="iconify-icon"){let t,e;try{t=window.customElements,e=window.HTMLElement}catch{return}if(!t||!e)return;const s=t.get(i);if(s)return s;const n=["icon","mode","inline","observe","width","height","rotate","flip"],o=class extends e{constructor(){super();K(this,"_shadowRoot");K(this,"_initialised",!1);K(this,"_state");K(this,"_checkQueued",!1);K(this,"_connected",!1);K(this,"_observer",null);K(this,"_visible",!0);const l=this._shadowRoot=this.attachShadow({mode:"open"}),c=Oe(this);Vi(l,c),this._state=Yi({value:""},c),this._queueCheck()}connectedCallback(){this._connected=!0,this.startObserver()}disconnectedCallback(){this._connected=!1,this.stopObserver()}static get observedAttributes(){return n.slice(0)}attributeChangedCallback(l){switch(l){case"inline":{const c=Oe(this),u=this._state;c!==u.inline&&(u.inline=c,Vi(this._shadowRoot,c));break}case"observer":{this.observer?this.startObserver():this.stopObserver();break}default:this._queueCheck()}}get icon(){const l=this.getAttribute("icon");if(l&&l.slice(0,1)==="{")try{return JSON.parse(l)}catch{}return l}set icon(l){typeof l=="object"&&(l=JSON.stringify(l)),this.setAttribute("icon",l)}get inline(){return Oe(this)}set inline(l){l?this.setAttribute("inline","true"):this.removeAttribute("inline")}get observer(){return this.hasAttribute("observer")}set observer(l){l?this.setAttribute("observer","true"):this.removeAttribute("observer")}restartAnimation(){const l=this._state;if(l.rendered){const c=this._shadowRoot;if(l.renderedMode==="svg")try{c.lastChild.setCurrentTime(0);return}catch{}Qi(c,l)}}get status(){const l=this._state;return l.rendered?"rendered":l.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const l=this._state,c=this.getAttribute("icon");if(c!==l.icon.value){this._iconChanged(c);return}if(!l.rendered||!this._visible)return;const u=this.getAttribute("mode"),d=Pi(this);(l.attrMode!==u||zs(l.customisations,d)||!Fe(this._shadowRoot))&&this._renderIcon(l.icon,d,u)}_iconChanged(l){const c=ro(l,(u,d,f)=>{const p=this._state;if(p.rendered||this.getAttribute("icon")!==u)return;const b={value:u,name:d,data:f};b.data?this._gotIconData(b):p.icon=b});c.data?this._gotIconData(c):this._state=Yi(c,this._state.inline,this._state)}_forceRender(){if(!this._visible){const l=Fe(this._shadowRoot);l&&this._shadowRoot.removeChild(l);return}this._queueCheck()}_gotIconData(l){this._checkQueued=!1,this._renderIcon(l,Pi(this),this.getAttribute("mode"))}_renderIcon(l,c,u){const d=lo(l.data.body,u),f=this._state.inline;Qi(this._shadowRoot,this._state={rendered:!0,icon:l,inline:f,customisations:c,attrMode:u,renderedMode:d})}startObserver(){if(!this._observer)try{this._observer=new IntersectionObserver(l=>{const c=l.some(u=>u.isIntersecting);c!==this._visible&&(this._visible=c,this._forceRender())}),this._observer.observe(this)}catch{if(this._observer){try{this._observer.disconnect()}catch{}this._observer=null}}}stopObserver(){this._observer&&(this._observer.disconnect(),this._observer=null,this._visible=!0,this._connected&&this._forceRender())}};n.forEach(a=>{a in o.prototype||Object.defineProperty(o.prototype,a,{get:function(){return this.getAttribute(a)},set:function(l){l!==null?this.setAttribute(a,l):this.removeAttribute(a)}})});const r=Bn();for(const a in r)o[a]=o.prototype[a]=r[a];return t.define(i,o),o}Po()||Bn();var Lo=Object.defineProperty,V=(i,t,e,s)=>{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&Lo(t,e,n),n},Ot;const D=(Ot=class extends E{constructor(){super(),this.labelHidden=!1,this.active=!1,this.disabled=!1,this.vertical=!1,this.tooltipVisible=!1,this._parent=Z(),this._tooltip=Z(),this._contextMenu=Z(),this._mouseLeave=!1,this.onWindowMouseUp=t=>{const{value:e}=this._contextMenu;!this.contains(t.target)&&e&&(e.visible=!1)},this.mouseLeave=!0,this.addEventListener("click",t=>t.stopPropagation())}set mouseLeave(t){this._mouseLeave=t,t&&(this.tooltipVisible=!1,clearTimeout(this.timeoutID))}get mouseLeave(){return this._mouseLeave}computeTooltipPosition(){const{value:t}=this._parent,{value:e}=this._tooltip;t&&e&&bn(t,e,{placement:"bottom",middleware:[nn(10),mn(),pn(),fn({padding:5})]}).then(s=>{const{x:n,y:o}=s;Object.assign(e.style,{left:`${n}px`,top:`${o}px`})})}onMouseEnter(){if(!(this.tooltipTitle||this.tooltipText))return;this.mouseLeave=!1;const t=this.tooltipTime??700;this.timeoutID=setTimeout(()=>{this.mouseLeave||(this.computeTooltipPosition(),this.tooltipVisible=!0)},t)}onChildrenClick(t){t.stopPropagation();const{value:e}=this._contextMenu;e&&(e.visible=!e.visible)}onSlotChange(t){const{value:e}=this._contextMenu,s=t.target.assignedElements();for(const n of s){if(!(n instanceof Ot)){n.remove(),console.warn("Only bim-button is allowed inside bim-button. Child has been removed.");continue}n.addEventListener("click",()=>e==null?void 0:e.updatePosition())}this.requestUpdate()}connectedCallback(){super.connectedCallback(),window.addEventListener("mouseup",this.onWindowMouseUp)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mouseup",this.onWindowMouseUp)}render(){const t=m` +
${this.tooltipTitle?m`

${this.tooltipTitle}

`:null} @@ -46,7 +46,7 @@ var Xn=Object.defineProperty;var Jn=(i,t,e)=>t in i?Xn(i,t,{enumerable:!0,config ); } -
+
${this.label||this.icon?m`
t in i?Xn(i,t,{enumerable:!0,config
`:null} @@ -190,7 +190,7 @@ var Xn=Object.defineProperty;var Jn=(i,t,e)=>t in i?Xn(i,t,{enumerable:!0,config :host(:not([tooltip-visible])) .tooltip { display: none; } - `,Ot);V([h({type:String,reflect:!0})],D.prototype,"label");V([h({type:Boolean,attribute:"label-hidden",reflect:!0})],D.prototype,"labelHidden");V([h({type:Boolean,reflect:!0})],D.prototype,"active");V([h({type:Boolean,reflect:!0,attribute:"disabled"})],D.prototype,"disabled");V([h({type:String,reflect:!0})],D.prototype,"icon");V([h({type:Boolean,reflect:!0})],D.prototype,"vertical");V([h({type:Number,attribute:"tooltip-time",reflect:!0})],D.prototype,"tooltipTime");V([h({type:Boolean,attribute:"tooltip-visible",reflect:!0})],D.prototype,"tooltipVisible");V([h({type:String,attribute:"tooltip-title",reflect:!0})],D.prototype,"tooltipTitle");V([h({type:String,attribute:"tooltip-text",reflect:!0})],D.prototype,"tooltipText");let qo=D;var Wo=Object.defineProperty,Ut=(i,t,e,s)=>{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&Wo(t,e,n),n};const ii=class ii extends E{constructor(){super(...arguments),this.checked=!1,this.inverted=!1,this.onValueChange=new Event("change")}get value(){return this.checked}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.dispatchEvent(this.onValueChange)}render(){return m` + `,Ot);V([h({type:String,reflect:!0})],D.prototype,"label");V([h({type:Boolean,attribute:"label-hidden",reflect:!0})],D.prototype,"labelHidden");V([h({type:Boolean,reflect:!0})],D.prototype,"active");V([h({type:Boolean,reflect:!0,attribute:"disabled"})],D.prototype,"disabled");V([h({type:String,reflect:!0})],D.prototype,"icon");V([h({type:Boolean,reflect:!0})],D.prototype,"vertical");V([h({type:Number,attribute:"tooltip-time",reflect:!0})],D.prototype,"tooltipTime");V([h({type:Boolean,attribute:"tooltip-visible",reflect:!0})],D.prototype,"tooltipVisible");V([h({type:String,attribute:"tooltip-title",reflect:!0})],D.prototype,"tooltipTitle");V([h({type:String,attribute:"tooltip-text",reflect:!0})],D.prototype,"tooltipText");let zo=D;var Io=Object.defineProperty,Ut=(i,t,e,s)=>{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&Io(t,e,n),n};const ii=class ii extends E{constructor(){super(...arguments),this.checked=!1,this.inverted=!1,this.onValueChange=new Event("change")}get value(){return this.checked}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.dispatchEvent(this.onValueChange)}render(){return m`
${this.label?m`${this.label} `:null} t in i?Xn(i,t,{enumerable:!0,config outline: var(--bim-checkbox--olw, 2px) solid var(--bim-checkbox--olc, var(--bim-ui_color-accent)); } - `;let st=ii;Ut([h({type:String,reflect:!0})],st.prototype,"icon");Ut([h({type:String,reflect:!0})],st.prototype,"name");Ut([h({type:String,reflect:!0})],st.prototype,"label");Ut([h({type:Boolean,reflect:!0})],st.prototype,"checked");Ut([h({type:Boolean,reflect:!0})],st.prototype,"inverted");var Uo=Object.defineProperty,At=(i,t,e,s)=>{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&Uo(t,e,n),n};const ni=class ni extends E{constructor(){super(...arguments),this.vertical=!1,this.color="#bcf124",this._colorInput=tt(),this._textInput=tt(),this.onValueChange=new Event("input"),this.onOpacityInput=t=>{const e=t.target;this.opacity=e.value,this.dispatchEvent(this.onValueChange)}}set value(t){const{color:e,opacity:s}=t;this.color=e,s&&(this.opacity=s)}get value(){const t={color:this.color};return this.opacity&&(t.opacity=this.opacity),t}onColorInput(t){t.stopPropagation();const{value:e}=this._colorInput;e&&(this.color=e.value,this.dispatchEvent(this.onValueChange))}onTextInput(t){t.stopPropagation();const{value:e}=this._textInput;if(!e)return;const{value:s}=e;let n=s.replace(/[^a-fA-F0-9]/g,"");n.startsWith("#")||(n=`#${n}`),e.value=n.slice(0,7),e.value.length===7&&(this.color=e.value,this.dispatchEvent(this.onValueChange))}focus(){const{value:t}=this._colorInput;t&&t.click()}render(){return m` + `;let st=ii;Ut([h({type:String,reflect:!0})],st.prototype,"icon");Ut([h({type:String,reflect:!0})],st.prototype,"name");Ut([h({type:String,reflect:!0})],st.prototype,"label");Ut([h({type:Boolean,reflect:!0})],st.prototype,"checked");Ut([h({type:Boolean,reflect:!0})],st.prototype,"inverted");var jo=Object.defineProperty,At=(i,t,e,s)=>{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&jo(t,e,n),n};const ni=class ni extends E{constructor(){super(...arguments),this.vertical=!1,this.color="#bcf124",this._colorInput=Z(),this._textInput=Z(),this.onValueChange=new Event("input"),this.onOpacityInput=t=>{const e=t.target;this.opacity=e.value,this.dispatchEvent(this.onValueChange)}}set value(t){const{color:e,opacity:s}=t;this.color=e,s&&(this.opacity=s)}get value(){const t={color:this.color};return this.opacity&&(t.opacity=this.opacity),t}onColorInput(t){t.stopPropagation();const{value:e}=this._colorInput;e&&(this.color=e.value,this.dispatchEvent(this.onValueChange))}onTextInput(t){t.stopPropagation();const{value:e}=this._textInput;if(!e)return;const{value:s}=e;let n=s.replace(/[^a-fA-F0-9]/g,"");n.startsWith("#")||(n=`#${n}`),e.value=n.slice(0,7),e.value.length===7&&(this.color=e.value,this.dispatchEvent(this.onValueChange))}focus(){const{value:t}=this._colorInput;t&&t.click()}render(){return m`
t in i?Xn(i,t,{enumerable:!0,config style="display: flex; align-items: center; gap: .375rem; height: 100%; flex: 1; padding: 0 0.5rem;" > t in i?Xn(i,t,{enumerable:!0,config style="background-color: ${this.color}" >
t in i?Xn(i,t,{enumerable:!0,config bim-number-input { flex-grow: 0; } - `;let X=ni;At([h({type:String,reflect:!0})],X.prototype,"name");At([h({type:String,reflect:!0})],X.prototype,"label");At([h({type:String,reflect:!0})],X.prototype,"icon");At([h({type:Boolean,reflect:!0})],X.prototype,"vertical");At([h({type:Number,reflect:!0})],X.prototype,"opacity");At([h({type:String,reflect:!0})],X.prototype,"color");const Qo=C` + `;let G=ni;At([h({type:String,reflect:!0})],G.prototype,"name");At([h({type:String,reflect:!0})],G.prototype,"label");At([h({type:String,reflect:!0})],G.prototype,"icon");At([h({type:Boolean,reflect:!0})],G.prototype,"vertical");At([h({type:Number,reflect:!0})],G.prototype,"opacity");At([h({type:String,reflect:!0})],G.prototype,"color");const Mo=C` ::-webkit-scrollbar { width: 0.4rem; height: 0.4rem; @@ -352,7 +352,7 @@ var Xn=Object.defineProperty;var Jn=(i,t,e)=>t in i?Xn(i,t,{enumerable:!0,config ::-webkit-scrollbar-track { background-color: var(--bim-scrollbar--bgc, var(--bim-ui_bg-base)); } -`,Yo=C` +`,Ro=C` :root { /* Backgrounds */ --bim-ui_bg-base: hsl(210 10% 5%); @@ -452,7 +452,7 @@ var Xn=Object.defineProperty;var Jn=(i,t,e)=>t in i?Xn(i,t,{enumerable:!0,config bim-grid[floating] bim-toolbars-container { background-color: transparent; } -`,yt={scrollbar:Qo,globalStyles:Yo};var Go=Object.defineProperty,Xo=Object.getOwnPropertyDescriptor,Jo=(i,t,e,s)=>{for(var n=Xo(t,e),o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&Go(t,e,n),n};const si=class si extends E{constructor(){super(...arguments),this._visible=!1,this._middleware={name:"middleware",async fn(t){const{right:e,top:s}=await Ue(t);return t.x-=Math.sign(e)===1?e+5:0,t.y-=Math.sign(s)===1?s+5:0,t}}}get visible(){return this._visible}set visible(t){this._visible=t,t&&this.updatePosition()}async updatePosition(t){const e=t||this.parentNode;if(!e){this.visible=!1,console.warn("No target element found for context-menu.");return}const s=await wn(e,this,{placement:"right",middleware:[cn(10),xn(),_n(),yn({padding:5}),this._middleware]}),{x:n,y:o}=s;this.style.left=`${n}px`,this.style.top=`${o}px`}render(){return m` `}};si.styles=[yt.scrollbar,C` +`,yt={scrollbar:Mo,globalStyles:Ro};var Bo=Object.defineProperty,Do=Object.getOwnPropertyDescriptor,No=(i,t,e,s)=>{for(var n=Do(t,e),o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&Bo(t,e,n),n};const si=class si extends E{constructor(){super(...arguments),this._visible=!1,this._middleware={name:"middleware",async fn(t){const{right:e,top:s}=await Ue(t);return t.x-=Math.sign(e)===1?e+5:0,t.y-=Math.sign(s)===1?s+5:0,t}}}get visible(){return this._visible}set visible(t){this._visible=t,t&&this.updatePosition()}async updatePosition(t){const e=t||this.parentNode;if(!e){this.visible=!1,console.warn("No target element found for context-menu.");return}const s=await bn(e,this,{placement:"right",middleware:[nn(10),mn(),pn(),fn({padding:5}),this._middleware]}),{x:n,y:o}=s;this.style.left=`${n}px`,this.style.top=`${o}px`}render(){return m` `}};si.styles=[yt.scrollbar,C` :host { --bim-label--fz: var(--bim-ui_size-xs); position: absolute; @@ -479,7 +479,7 @@ var Xn=Object.defineProperty;var Jn=(i,t,e)=>t in i?Xn(i,t,{enumerable:!0,config :host(:not([visible])) { display: none; } - `];let ce=si;Jo([h({type:Boolean,reflect:!0})],ce.prototype,"visible");class Ko extends E{constructor(){super(...arguments),this._lazyLoadObserver=null,this._visibleElements=[],this.ELEMENTS_BEFORE_OBSERVER=20,this.useObserver=!1,this.elements=new Set,this.observe=t=>{if(!this.useObserver)return;for(const s of t)this.elements.add(s);const e=t.slice(this.ELEMENTS_BEFORE_OBSERVER);for(const s of e)s.remove();this.observeLastElement()}}set visibleElements(t){this._visibleElements=this.useObserver?t:[],this.requestUpdate()}get visibleElements(){return this._visibleElements}getLazyObserver(){if(!this.useObserver)return null;if(this._lazyLoadObserver)return this._lazyLoadObserver;const t=new IntersectionObserver(e=>{const s=e[0];if(!s.isIntersecting)return;const n=s.target;t.unobserve(n);const o=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length,r=[...this.elements][o];r&&(this.visibleElements=[...this.visibleElements,r],t.observe(r))},{threshold:.5});return t}observeLastElement(){const t=this.getLazyObserver();if(!t)return;const e=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length-1,s=[...this.elements][e];s&&t.observe(s)}resetVisibleElements(){const t=this.getLazyObserver();if(t){for(const e of this.elements)t.unobserve(e);this.visibleElements=[],this.observeLastElement()}}static create(t,e){const s=document.createDocumentFragment();if(t.length===0)return Pe(t(),s),s.firstElementChild;if(!e)throw new Error("UIComponent: Initial state is required for statefull components.");let n=e;const o=t,r=l=>(n={...n,...l},Pe(o(n),s),n);return r(e),[s.firstElementChild,r]}}const ue=(i,t=!0)=>{let e={};for(const s of i.children){const n=s,o=n.getAttribute("name")||n.getAttribute("label");if(o){if("value"in n){const r=n.value;if(typeof r=="object"&&!Array.isArray(r)&&Object.keys(r).length===0)continue;e[o]=n.value}else if(t){const r=ue(n);if(Object.keys(r).length===0)continue;e[o]=r}}else t&&(e={...e,...ue(n)})}return e},xe=i=>i==="true"||i==="false"?i==="true":i&&!isNaN(Number(i))&&i.trim()!==""?Number(i):i,Zo=[">=","<=","=",">","<","?","/","#"];function tn(i){const t=Zo.find(a=>i.split(a).length===2),e=i.split(t).map(a=>a.trim()),[s,n]=e,o=n.startsWith("'")&&n.endsWith("'")?n.replace(/'/g,""):xe(n);return{key:s,condition:t,value:o}}const Ve=i=>{try{const t=[],e=i.split(/&(?![^()]*\))/).map(s=>s.trim());for(const s of e){const n=!s.startsWith("(")&&!s.endsWith(")"),o=s.startsWith("(")&&s.endsWith(")");if(n){const r=tn(s);t.push(r)}if(o){const c={operator:"&",queries:s.replace(/^(\()|(\))$/g,"").split("&").map(u=>u.trim()).map((u,d)=>{const f=tn(u);return d>0&&(f.operator="&"),f})};t.push(c)}}return t}catch{return null}},en=(i,t,e)=>{let s=!1;switch(t){case"=":s=i===e;break;case"?":s=String(i).includes(String(e));break;case"<":(typeof i=="number"||typeof e=="number")&&(s=i":(typeof i=="number"||typeof e=="number")&&(s=i>e);break;case">=":(typeof i=="number"||typeof e=="number")&&(s=i>=e);break;case"/":s=String(i).startsWith(String(e));break}return s};var tr=Object.defineProperty,er=Object.getOwnPropertyDescriptor,ft=(i,t,e,s)=>{for(var n=s>1?void 0:s?er(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&tr(t,e,n),n};const oi=class oi extends E{constructor(){super(...arguments),this.checked=!1,this.checkbox=!1,this.noMark=!1,this.vertical=!1}get value(){return this._value!==void 0?this._value:this.label?xe(this.label):this.label}set value(t){this._value=t}render(){return m` + `];let ae=si;No([h({type:Boolean,reflect:!0})],ae.prototype,"visible");class Ho extends E{constructor(){super(...arguments),this._lazyLoadObserver=null,this._visibleElements=[],this.ELEMENTS_BEFORE_OBSERVER=20,this.useObserver=!1,this.elements=new Set,this.observe=t=>{if(!this.useObserver)return;for(const s of t)this.elements.add(s);const e=t.slice(this.ELEMENTS_BEFORE_OBSERVER);for(const s of e)s.remove();this.observeLastElement()}}set visibleElements(t){this._visibleElements=this.useObserver?t:[],this.requestUpdate()}get visibleElements(){return this._visibleElements}getLazyObserver(){if(!this.useObserver)return null;if(this._lazyLoadObserver)return this._lazyLoadObserver;const t=new IntersectionObserver(e=>{const s=e[0];if(!s.isIntersecting)return;const n=s.target;t.unobserve(n);const o=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length,r=[...this.elements][o];r&&(this.visibleElements=[...this.visibleElements,r],t.observe(r))},{threshold:.5});return t}observeLastElement(){const t=this.getLazyObserver();if(!t)return;const e=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length-1,s=[...this.elements][e];s&&t.observe(s)}resetVisibleElements(){const t=this.getLazyObserver();if(t){for(const e of this.elements)t.unobserve(e);this.visibleElements=[],this.observeLastElement()}}static create(t,e){const s=document.createDocumentFragment();if(t.length===0)return Pe(t(),s),s.firstElementChild;if(!e)throw new Error("UIComponent: Initial state is required for statefull components.");let n=e;const o=t,r=l=>(n={...n,...l},Pe(o(n),s),n);return r(e),[s.firstElementChild,r]}}const ce=(i,t=!0)=>{let e={};for(const s of i.children){const n=s,o=n.getAttribute("name")||n.getAttribute("label");if(o){if("value"in n){const r=n.value;if(typeof r=="object"&&!Array.isArray(r)&&Object.keys(r).length===0)continue;e[o]=n.value}else if(t){const r=ce(n);if(Object.keys(r).length===0)continue;e[o]=r}}else t&&(e={...e,...ce(n)})}return e},_e=i=>i==="true"||i==="false"?i==="true":i&&!isNaN(Number(i))&&i.trim()!==""?Number(i):i,Fo=[">=","<=","=",">","<","?","/","#"];function Gi(i){const t=Fo.find(a=>i.split(a).length===2),e=i.split(t).map(a=>a.trim()),[s,n]=e,o=n.startsWith("'")&&n.endsWith("'")?n.replace(/'/g,""):_e(n);return{key:s,condition:t,value:o}}const Ve=i=>{try{const t=[],e=i.split(/&(?![^()]*\))/).map(s=>s.trim());for(const s of e){const n=!s.startsWith("(")&&!s.endsWith(")"),o=s.startsWith("(")&&s.endsWith(")");if(n){const r=Gi(s);t.push(r)}if(o){const c={operator:"&",queries:s.replace(/^(\()|(\))$/g,"").split("&").map(u=>u.trim()).map((u,d)=>{const f=Gi(u);return d>0&&(f.operator="&"),f})};t.push(c)}}return t}catch{return null}},Xi=(i,t,e)=>{let s=!1;switch(t){case"=":s=i===e;break;case"?":s=String(i).includes(String(e));break;case"<":(typeof i=="number"||typeof e=="number")&&(s=i":(typeof i=="number"||typeof e=="number")&&(s=i>e);break;case">=":(typeof i=="number"||typeof e=="number")&&(s=i>=e);break;case"/":s=String(i).startsWith(String(e));break}return s};var Vo=Object.defineProperty,qo=Object.getOwnPropertyDescriptor,ft=(i,t,e,s)=>{for(var n=s>1?void 0:s?qo(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&Vo(t,e,n),n};const oi=class oi extends E{constructor(){super(...arguments),this.checked=!1,this.checkbox=!1,this.noMark=!1,this.vertical=!1}get value(){return this._value!==void 0?this._value:this.label?_e(this.label):this.label}set value(t){this._value=t}render(){return m`
${this.img||this.icon||this.label?m`
${this.checkbox&&!this.noMark?m`t in i?Xn(i,t,{enumerable:!0,config bim-label { pointer-events: none; } - `;let A=oi;ft([h({type:String,reflect:!0})],A.prototype,"img",2);ft([h({type:String,reflect:!0})],A.prototype,"label",2);ft([h({type:String,reflect:!0})],A.prototype,"icon",2);ft([h({type:Boolean,reflect:!0})],A.prototype,"checked",2);ft([h({type:Boolean,reflect:!0})],A.prototype,"checkbox",2);ft([h({type:Boolean,attribute:"no-mark",reflect:!0})],A.prototype,"noMark",2);ft([h({converter:{fromAttribute(i){return i&&xe(i)}}})],A.prototype,"value",1);ft([h({type:Boolean,reflect:!0})],A.prototype,"vertical",2);var ir=Object.defineProperty,nr=Object.getOwnPropertyDescriptor,pt=(i,t,e,s)=>{for(var n=s>1?void 0:s?nr(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&ir(t,e,n),n};const ri=class ri extends Ko{constructor(){super(),this.multiple=!1,this.required=!1,this.vertical=!1,this._inputContainer=tt(),this._listElement=tt(),this._visible=!1,this._value=[],this.onValueChange=new Event("change"),this.onWindowMouseUp=t=>{this.visible&&(this.contains(t.target)||(this.visible=!1))},this.onOptionClick=t=>{const e=t.target,s=this._value.includes(e);if(!this.multiple&&!this.required&&!s)this._value=[e];else if(!this.multiple&&!this.required&&s)this._value=[];else if(!this.multiple&&this.required&&!s)this._value=[e];else if(this.multiple&&!this.required&&!s)this._value=[...this._value,e];else if(this.multiple&&!this.required&&s)this._value=this._value.filter(n=>n!==e);else if(this.multiple&&this.required&&!s)this._value=[...this._value,e];else if(this.multiple&&this.required&&s){const n=this._value.filter(o=>o!==e);n.length!==0&&(this._value=n)}this.updateOptionsState(),this.dispatchEvent(this.onValueChange)},this.useObserver=!0}set visible(t){this._visible=t,t||this.resetVisibleElements()}get visible(){return this._visible}set value(t){if(this.required&&Object.keys(t).length===0)return;const e=[];for(const s of t){const n=this.findOption(s);if(n&&(e.push(n),!this.multiple&&Object.keys(t).length>1))break}this._value=e,this.updateOptionsState(),this.dispatchEvent(this.onValueChange)}get value(){return this._value.filter(e=>e instanceof A&&e.checked).map(e=>e.value)}get _options(){const t=[...this.elements];for(const e of this.children)e instanceof A&&t.push(e);return t}onSlotChange(t){const e=t.target.assignedElements();this.observe(e);for(const s of e){if(!(s instanceof A)){s.remove();continue}s.removeEventListener("click",this.onOptionClick),s.addEventListener("click",this.onOptionClick)}}updateOptionsState(){for(const t of this._options)t instanceof A&&(this._value.includes(t)?t.checked=!0:t.checked=!1)}findOption(t){return this._options.find(s=>s instanceof A?s.label===t||s.value===t:!1)}connectedCallback(){super.connectedCallback(),window.addEventListener("mouseup",this.onWindowMouseUp)}firstUpdated(){for(const t of this.children)t instanceof A&&t.checked&&this._value.push(t)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mouseup",this.onWindowMouseUp)}render(){let t,e,s;if(this._value.length===0)t="Select an option...";else if(this._value.length===1){const n=this._value[0];t=(n==null?void 0:n.label)||(n==null?void 0:n.value),e=n==null?void 0:n.img,s=n==null?void 0:n.icon}else t=`Multiple (${this._value.length})`;return m` + `;let A=oi;ft([h({type:String,reflect:!0})],A.prototype,"img",2);ft([h({type:String,reflect:!0})],A.prototype,"label",2);ft([h({type:String,reflect:!0})],A.prototype,"icon",2);ft([h({type:Boolean,reflect:!0})],A.prototype,"checked",2);ft([h({type:Boolean,reflect:!0})],A.prototype,"checkbox",2);ft([h({type:Boolean,attribute:"no-mark",reflect:!0})],A.prototype,"noMark",2);ft([h({converter:{fromAttribute(i){return i&&_e(i)}}})],A.prototype,"value",1);ft([h({type:Boolean,reflect:!0})],A.prototype,"vertical",2);var Wo=Object.defineProperty,Uo=Object.getOwnPropertyDescriptor,pt=(i,t,e,s)=>{for(var n=s>1?void 0:s?Uo(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&Wo(t,e,n),n};const ri=class ri extends Ho{constructor(){super(),this.multiple=!1,this.required=!1,this.vertical=!1,this._inputContainer=Z(),this._listElement=Z(),this._visible=!1,this._value=[],this.onValueChange=new Event("change"),this.onWindowMouseUp=t=>{this.visible&&(this.contains(t.target)||(this.visible=!1))},this.onOptionClick=t=>{const e=t.target,s=this._value.includes(e);if(!this.multiple&&!this.required&&!s)this._value=[e];else if(!this.multiple&&!this.required&&s)this._value=[];else if(!this.multiple&&this.required&&!s)this._value=[e];else if(this.multiple&&!this.required&&!s)this._value=[...this._value,e];else if(this.multiple&&!this.required&&s)this._value=this._value.filter(n=>n!==e);else if(this.multiple&&this.required&&!s)this._value=[...this._value,e];else if(this.multiple&&this.required&&s){const n=this._value.filter(o=>o!==e);n.length!==0&&(this._value=n)}this.updateOptionsState(),this.dispatchEvent(this.onValueChange)},this.useObserver=!0}set visible(t){this._visible=t,t||this.resetVisibleElements()}get visible(){return this._visible}set value(t){if(this.required&&Object.keys(t).length===0)return;const e=[];for(const s of t){const n=this.findOption(s);if(n&&(e.push(n),!this.multiple&&Object.keys(t).length>1))break}this._value=e,this.updateOptionsState(),this.dispatchEvent(this.onValueChange)}get value(){return this._value.filter(e=>e instanceof A&&e.checked).map(e=>e.value)}get _options(){const t=[...this.elements];for(const e of this.children)e instanceof A&&t.push(e);return t}onSlotChange(t){const e=t.target.assignedElements();this.observe(e);for(const s of e){if(!(s instanceof A)){s.remove();continue}s.removeEventListener("click",this.onOptionClick),s.addEventListener("click",this.onOptionClick)}}updateOptionsState(){for(const t of this._options)t instanceof A&&(this._value.includes(t)?t.checked=!0:t.checked=!1)}findOption(t){return this._options.find(s=>s instanceof A?s.label===t||s.value===t:!1)}connectedCallback(){super.connectedCallback(),window.addEventListener("mouseup",this.onWindowMouseUp)}firstUpdated(){for(const t of this.children)t instanceof A&&t.checked&&this._value.push(t)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mouseup",this.onWindowMouseUp)}render(){let t,e,s;if(this._value.length===0)t="Select an option...";else if(this._value.length===1){const n=this._value[0];t=(n==null?void 0:n.label)||(n==null?void 0:n.value),e=n==null?void 0:n.img,s=n==null?void 0:n.icon}else t=`Multiple (${this._value.length})`;return m` t in i?Xn(i,t,{enumerable:!0,config .vertical=${this.vertical} >
this.visible=!this.visible} > @@ -589,7 +589,7 @@ var Xn=Object.defineProperty;var Jn=(i,t,e)=>t in i?Xn(i,t,{enumerable:!0,config
- + ${this.visibleElements.map(n=>n)} @@ -632,7 +632,7 @@ var Xn=Object.defineProperty;var Jn=(i,t,e)=>t in i?Xn(i,t,{enumerable:!0,config bim-label { pointer-events: none; } - `];let R=ri;pt([h({type:String,reflect:!0})],R.prototype,"name",2);pt([h({type:String,reflect:!0})],R.prototype,"icon",2);pt([h({type:String,reflect:!0})],R.prototype,"label",2);pt([h({type:Boolean,reflect:!0})],R.prototype,"multiple",2);pt([h({type:Boolean,reflect:!0})],R.prototype,"required",2);pt([h({type:Boolean,reflect:!0})],R.prototype,"vertical",2);pt([h({type:Boolean,reflect:!0})],R.prototype,"visible",1);pt([Nt()],R.prototype,"_value",2);var sr=Object.defineProperty,Yn=(i,t,e,s)=>{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&sr(t,e,n),n};const li=class li extends E{constructor(){super(...arguments),this.floating=!1,this.layouts={}}getUniqueAreasFromTemplate(t){const n=t.split(` + `];let R=ri;pt([h({type:String,reflect:!0})],R.prototype,"name",2);pt([h({type:String,reflect:!0})],R.prototype,"icon",2);pt([h({type:String,reflect:!0})],R.prototype,"label",2);pt([h({type:Boolean,reflect:!0})],R.prototype,"multiple",2);pt([h({type:Boolean,reflect:!0})],R.prototype,"required",2);pt([h({type:Boolean,reflect:!0})],R.prototype,"vertical",2);pt([h({type:Boolean,reflect:!0})],R.prototype,"visible",1);pt([Nt()],R.prototype,"_value",2);var Qo=Object.defineProperty,Nn=(i,t,e,s)=>{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&Qo(t,e,n),n};const li=class li extends E{constructor(){super(...arguments),this.floating=!1,this.layouts={}}getUniqueAreasFromTemplate(t){const n=t.split(` `).map(r=>r.trim()).map(r=>r.split('"')[1]).filter(r=>r!==void 0).flatMap(r=>r.split(/\s+/));return[...new Set(n)].filter(r=>r!=="")}firstUpdated(){this._onLayoutChange=new Event("layoutchange")}render(){if(this.layout){if(this.layouts[this.layout]){this.innerHTML="";const t=this.layouts[this.layout],s=this.getUniqueAreasFromTemplate(t.template).map(n=>{const o=t.elements[n];return o&&(o.style.gridArea=n),o}).filter(n=>!!n);this.style.gridTemplate=t.template,this._onLayoutChange&&this.dispatchEvent(this._onLayoutChange),this.append(...s)}}else this.innerHTML="",this.style.gridTemplate="",this._onLayoutChange&&this.dispatchEvent(this._onLayoutChange);return m``}};li.styles=C` :host { display: grid; @@ -662,9 +662,9 @@ var Xn=Object.defineProperty;var Jn=(i,t,e)=>t in i?Xn(i,t,{enumerable:!0,config background-color: var(--bim-ui_bg-contrast-20); gap: 1px; } - `;let Dt=li;Yn([h({type:Boolean,reflect:!0})],Dt.prototype,"floating");Yn([h({type:String,reflect:!0})],Dt.prototype,"layout");const me=class me extends E{render(){return m` + `;let Dt=li;Nn([h({type:Boolean,reflect:!0})],Dt.prototype,"floating");Nn([h({type:String,reflect:!0})],Dt.prototype,"layout");const pe=class pe extends E{render(){return m` - `}};me.styles=C` + `}};pe.styles=C` :host { height: var(--bim-icon--fz, var(--bim-ui_size-sm)); width: var(--bim-icon--fz, var(--bim-ui_size-sm)); @@ -675,7 +675,7 @@ var Xn=Object.defineProperty;var Jn=(i,t,e)=>t in i?Xn(i,t,{enumerable:!0,config width: var(--bim-icon--fz, var(--bim-ui_size-sm)); color: var(--bim-icon--c); } - `,me.properties={icon:{type:String}};let qe=me;var or=Object.defineProperty,we=(i,t,e,s)=>{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&or(t,e,n),n};const ai=class ai extends E{constructor(){super(),this.onValueChange=new Event("change"),this.vertical=!1}get value(){const t={};for(const e of this.children){const s=e;"value"in s?t[s.name||s.label]=s.value:"checked"in s&&(t[s.name||s.label]=s.checked)}return t}set value(t){const e=[...this.children];for(const s in t){const n=e.find(a=>{const l=a;return l.name===s||l.label===s});if(!n)continue;const o=n,r=t[s];typeof r=="boolean"?o.checked=r:o.value=r}}render(){return m` + `,pe.properties={icon:{type:String}};let qe=pe;var Yo=Object.defineProperty,xe=(i,t,e,s)=>{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&Yo(t,e,n),n};const ai=class ai extends E{constructor(){super(),this.onValueChange=new Event("change"),this.vertical=!1}get value(){const t={};for(const e of this.children){const s=e;"value"in s?t[s.name||s.label]=s.value:"checked"in s&&(t[s.name||s.label]=s.checked)}return t}set value(t){const e=[...this.children];for(const s in t){const n=e.find(a=>{const l=a;return l.name===s||l.label===s});if(!n)continue;const o=n,r=t[s];typeof r=="boolean"?o.checked=r:o.value=r}}render(){return m`
${this.label||this.icon?m`${this.label}`:null}
@@ -729,7 +729,7 @@ var Xn=Object.defineProperty;var Jn=(i,t,e)=>t in i?Xn(i,t,{enumerable:!0,config :host(:not([vertical])[label]) .input { max-width: fit-content; } - `;let vt=ai;we([h({type:String,reflect:!0})],vt.prototype,"name");we([h({type:String,reflect:!0})],vt.prototype,"label");we([h({type:String,reflect:!0})],vt.prototype,"icon");we([h({type:Boolean,reflect:!0})],vt.prototype,"vertical");var rr=Object.defineProperty,Qt=(i,t,e,s)=>{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&rr(t,e,n),n};const ci=class ci extends E{constructor(){super(...arguments),this.labelHidden=!1,this.iconHidden=!1,this.vertical=!1}get value(){return this.textContent?xe(this.textContent):this.textContent}render(){return m` + `;let vt=ai;xe([h({type:String,reflect:!0})],vt.prototype,"name");xe([h({type:String,reflect:!0})],vt.prototype,"label");xe([h({type:String,reflect:!0})],vt.prototype,"icon");xe([h({type:Boolean,reflect:!0})],vt.prototype,"vertical");var Go=Object.defineProperty,Qt=(i,t,e,s)=>{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&Go(t,e,n),n};const ci=class ci extends E{constructor(){super(...arguments),this.labelHidden=!1,this.iconHidden=!1,this.vertical=!1}get value(){return this.textContent?_e(this.textContent):this.textContent}render(){return m`
${this.img?m``:null} ${!this.iconHidden&&this.icon?m``:null} @@ -790,7 +790,7 @@ var Xn=Object.defineProperty;var Jn=(i,t,e)=>t in i?Xn(i,t,{enumerable:!0,config calc(var(--bim-label--fz, var(--bim-ui_size-xs)) * 4) ); } - `;let ot=ci;Qt([h({type:String,reflect:!0})],ot.prototype,"img");Qt([h({type:Boolean,attribute:"label-hidden",reflect:!0})],ot.prototype,"labelHidden");Qt([h({type:String,reflect:!0})],ot.prototype,"icon");Qt([h({type:Boolean,attribute:"icon-hidden",reflect:!0})],ot.prototype,"iconHidden");Qt([h({type:Boolean,reflect:!0})],ot.prototype,"vertical");var lr=Object.defineProperty,ar=Object.getOwnPropertyDescriptor,M=(i,t,e,s)=>{for(var n=s>1?void 0:s?ar(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&lr(t,e,n),n};const ui=class ui extends E{constructor(){super(...arguments),this._value=0,this.vertical=!1,this.slider=!1,this._input=tt(),this.onValueChange=new Event("change")}set value(t){this.setValue(t.toString())}get value(){return this._value}onChange(t){t.stopPropagation();const{value:e}=this._input;e&&this.setValue(e.value)}setValue(t){const{value:e}=this._input;let s=t;if(s=s.replace(/[^0-9.-]/g,""),s=s.replace(/(\..*)\./g,"$1"),s.endsWith(".")||(s.lastIndexOf("-")>0&&(s=s[0]+s.substring(1).replace(/-/g,"")),s==="-"||s==="-0"))return;let n=Number(s);Number.isNaN(n)||(n=this.min!==void 0?Math.max(n,this.min):n,n=this.max!==void 0?Math.min(n,this.max):n,this.value!==n&&(this._value=n,e&&(e.value=this.value.toString()),this.requestUpdate(),this.dispatchEvent(this.onValueChange)))}onBlur(){const{value:t}=this._input;t&&Number.isNaN(Number(t.value))&&(t.value=this.value.toString())}onSliderMouseDown(t){document.body.style.cursor="w-resize";const{clientX:e}=t,s=this.value;let n=!1;const o=l=>{var v;n=!0;const{clientX:c}=l,u=this.step??1,d=((v=u.toString().split(".")[1])==null?void 0:v.length)||0,f=1/(this.sensitivity??1),p=(c-e)/f;if(Math.floor(Math.abs(p))!==Math.abs(p))return;const b=s+p*u;this.setValue(b.toFixed(d))},r=()=>{this.slider=!0,this.removeEventListener("blur",r)},a=()=>{document.removeEventListener("mousemove",o),document.body.style.cursor="default",n?n=!1:(this.addEventListener("blur",r),this.slider=!1,requestAnimationFrame(()=>this.focus())),document.removeEventListener("mouseup",a)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",a)}onFocus(t){t.stopPropagation();const e=s=>{s.key==="Escape"&&(this.blur(),window.removeEventListener("keydown",e))};window.addEventListener("keydown",e)}connectedCallback(){super.connectedCallback(),this.min&&this.min>this.value&&(this._value=this.min),this.max&&this.max{for(var n=s>1?void 0:s?Jo(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&Xo(t,e,n),n};const ui=class ui extends E{constructor(){super(...arguments),this._value=0,this.vertical=!1,this.slider=!1,this._input=Z(),this.onValueChange=new Event("change")}set value(t){this.setValue(t.toString())}get value(){return this._value}onChange(t){t.stopPropagation();const{value:e}=this._input;e&&this.setValue(e.value)}setValue(t){const{value:e}=this._input;let s=t;if(s=s.replace(/[^0-9.-]/g,""),s=s.replace(/(\..*)\./g,"$1"),s.endsWith(".")||(s.lastIndexOf("-")>0&&(s=s[0]+s.substring(1).replace(/-/g,"")),s==="-"||s==="-0"))return;let n=Number(s);Number.isNaN(n)||(n=this.min!==void 0?Math.max(n,this.min):n,n=this.max!==void 0?Math.min(n,this.max):n,this.value!==n&&(this._value=n,e&&(e.value=this.value.toString()),this.requestUpdate(),this.dispatchEvent(this.onValueChange)))}onBlur(){const{value:t}=this._input;t&&Number.isNaN(Number(t.value))&&(t.value=this.value.toString())}onSliderMouseDown(t){document.body.style.cursor="w-resize";const{clientX:e}=t,s=this.value;let n=!1;const o=l=>{var v;n=!0;const{clientX:c}=l,u=this.step??1,d=((v=u.toString().split(".")[1])==null?void 0:v.length)||0,f=1/(this.sensitivity??1),p=(c-e)/f;if(Math.floor(Math.abs(p))!==Math.abs(p))return;const b=s+p*u;this.setValue(b.toFixed(d))},r=()=>{this.slider=!0,this.removeEventListener("blur",r)},a=()=>{document.removeEventListener("mousemove",o),document.body.style.cursor="default",n?n=!1:(this.addEventListener("blur",r),this.slider=!1,requestAnimationFrame(()=>this.focus())),document.removeEventListener("mouseup",a)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",a)}onFocus(t){t.stopPropagation();const e=s=>{s.key==="Escape"&&(this.blur(),window.removeEventListener("keydown",e))};window.addEventListener("keydown",e)}connectedCallback(){super.connectedCallback(),this.min&&this.min>this.value&&(this._value=this.min),this.max&&this.maxt in i?Xn(i,t,{enumerable:!0,config >${this.pref}`:null} t in i?Xn(i,t,{enumerable:!0,config bim-label { pointer-events: none; } - `;let P=ui;M([h({type:String,reflect:!0})],P.prototype,"name",2);M([h({type:String,reflect:!0})],P.prototype,"icon",2);M([h({type:String,reflect:!0})],P.prototype,"label",2);M([h({type:String,reflect:!0})],P.prototype,"pref",2);M([h({type:Number,reflect:!0})],P.prototype,"min",2);M([h({type:Number,reflect:!0})],P.prototype,"value",1);M([h({type:Number,reflect:!0})],P.prototype,"step",2);M([h({type:Number,reflect:!0})],P.prototype,"sensitivity",2);M([h({type:Number,reflect:!0})],P.prototype,"max",2);M([h({type:String,reflect:!0})],P.prototype,"suffix",2);M([h({type:Boolean,reflect:!0})],P.prototype,"vertical",2);M([h({type:Boolean,reflect:!0})],P.prototype,"slider",2);var cr=Object.defineProperty,ur=Object.getOwnPropertyDescriptor,Yt=(i,t,e,s)=>{for(var n=s>1?void 0:s?ur(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&cr(t,e,n),n};const hi=class hi extends E{constructor(){super(...arguments),this.onValueChange=new Event("change"),this._hidden=!1,this.headerHidden=!1,this.activationButton=document.createElement("bim-button")}set hidden(t){this._hidden=t,this.activationButton.active=!t,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}get value(){return ue(this)}set value(t){const e=[...this.children];for(const s in t){const n=e.find(r=>{const a=r;return a.name===s||a.label===s});if(!n)continue;const o=n;o.value=t[s]}}connectedCallback(){super.connectedCallback(),this.activationButton.active=!this.hidden,this.activationButton.onclick=()=>this.hidden=!this.hidden}disconnectedCallback(){super.disconnectedCallback(),this.activationButton.remove()}collapseSections(){const t=this.querySelectorAll("bim-panel-section");for(const e of t)e.collapsed=!0}expandSections(){const t=this.querySelectorAll("bim-panel-section");for(const e of t)e.collapsed=!1}render(){return this.activationButton.icon=this.icon,this.activationButton.label=this.label||this.name,this.activationButton.tooltipTitle=this.label||this.name,m` + `;let P=ui;M([h({type:String,reflect:!0})],P.prototype,"name",2);M([h({type:String,reflect:!0})],P.prototype,"icon",2);M([h({type:String,reflect:!0})],P.prototype,"label",2);M([h({type:String,reflect:!0})],P.prototype,"pref",2);M([h({type:Number,reflect:!0})],P.prototype,"min",2);M([h({type:Number,reflect:!0})],P.prototype,"value",1);M([h({type:Number,reflect:!0})],P.prototype,"step",2);M([h({type:Number,reflect:!0})],P.prototype,"sensitivity",2);M([h({type:Number,reflect:!0})],P.prototype,"max",2);M([h({type:String,reflect:!0})],P.prototype,"suffix",2);M([h({type:Boolean,reflect:!0})],P.prototype,"vertical",2);M([h({type:Boolean,reflect:!0})],P.prototype,"slider",2);var Ko=Object.defineProperty,Zo=Object.getOwnPropertyDescriptor,Yt=(i,t,e,s)=>{for(var n=s>1?void 0:s?Zo(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&Ko(t,e,n),n};const hi=class hi extends E{constructor(){super(...arguments),this.onValueChange=new Event("change"),this._hidden=!1,this.headerHidden=!1,this.activationButton=document.createElement("bim-button")}set hidden(t){this._hidden=t,this.activationButton.active=!t,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}get value(){return ce(this)}set value(t){const e=[...this.children];for(const s in t){const n=e.find(r=>{const a=r;return a.name===s||a.label===s});if(!n)continue;const o=n;o.value=t[s]}}connectedCallback(){super.connectedCallback(),this.activationButton.active=!this.hidden,this.activationButton.onclick=()=>this.hidden=!this.hidden}disconnectedCallback(){super.disconnectedCallback(),this.activationButton.remove()}collapseSections(){const t=this.querySelectorAll("bim-panel-section");for(const e of t)e.collapsed=!0}expandSections(){const t=this.querySelectorAll("bim-panel-section");for(const e of t)e.collapsed=!1}render(){return this.activationButton.icon=this.icon,this.activationButton.label=this.label||this.name,this.activationButton.tooltipTitle=this.label||this.name,m`
${this.label||this.name||this.icon?m`${this.label}`:null}
@@ -976,7 +976,7 @@ var Xn=Object.defineProperty;var Jn=(i,t,e)=>t in i?Xn(i,t,{enumerable:!0,config ::slotted(bim-panel-section:not(:last-child)) { border-bottom: 1px solid var(--bim-ui_bg-contrast-20); } - `];let rt=hi;Yt([h({type:String,reflect:!0})],rt.prototype,"icon",2);Yt([h({type:String,reflect:!0})],rt.prototype,"name",2);Yt([h({type:String,reflect:!0})],rt.prototype,"label",2);Yt([h({type:Boolean,reflect:!0})],rt.prototype,"hidden",1);Yt([h({type:Boolean,attribute:"header-hidden",reflect:!0})],rt.prototype,"headerHidden",2);var hr=Object.defineProperty,Gt=(i,t,e,s)=>{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&hr(t,e,n),n};const di=class di extends E{constructor(){super(...arguments),this.onValueChange=new Event("change")}get value(){return ue(this)}set value(t){const e=[...this.children];for(const s in t){const n=e.find(r=>{const a=r;return a.name===s||a.label===s});if(!n)continue;const o=n;o.value=t[s]}}onHeaderClick(){this.fixed||(this.collapsed=!this.collapsed)}render(){const t=this.label||this.icon||this.name||this.fixed,e=m`{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&tr(t,e,n),n};const di=class di extends E{constructor(){super(...arguments),this.onValueChange=new Event("change")}get value(){return ce(this)}set value(t){const e=[...this.children];for(const s in t){const n=e.find(r=>{const a=r;return a.name===s||a.label===s});if(!n)continue;const o=n;o.value=t[s]}}onHeaderClick(){this.fixed||(this.collapsed=!this.collapsed)}render(){const t=this.label||this.icon||this.name||this.fixed,e=m`t in i?Xn(i,t,{enumerable:!0,config bim-label { pointer-events: none; } - `];let lt=di;Gt([h({type:String,reflect:!0})],lt.prototype,"icon");Gt([h({type:String,reflect:!0})],lt.prototype,"label");Gt([h({type:String,reflect:!0})],lt.prototype,"name");Gt([h({type:Boolean,reflect:!0})],lt.prototype,"fixed");Gt([h({type:Boolean,reflect:!0})],lt.prototype,"collapsed");var dr=Object.defineProperty,Xt=(i,t,e,s)=>{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&dr(t,e,n),n};const fi=class fi extends E{constructor(){super(...arguments),this.vertical=!1,this.onValueChange=new Event("change"),this._canEmitEvents=!1,this._value=document.createElement("bim-option"),this.onOptionClick=t=>{this._value=t.target,this.dispatchEvent(this.onValueChange);for(const e of this.children)e instanceof A&&(e.checked=e===t.target)}}get _options(){return[...this.querySelectorAll("bim-option")]}set value(t){const e=this.findOption(t);if(e){for(const s of this._options)s.checked=s===e;this._value=e,this._canEmitEvents&&this.dispatchEvent(this.onValueChange)}}get value(){return this._value.value}onSlotChange(t){const e=t.target.assignedElements();for(const s of e)s instanceof A&&(s.noMark=!0,s.removeEventListener("click",this.onOptionClick),s.addEventListener("click",this.onOptionClick))}findOption(t){return this._options.find(s=>s instanceof A?s.label===t||s.value===t:!1)}firstUpdated(){const t=[...this.children].find(e=>e instanceof A&&e.checked);t&&(this._value=t)}render(){return m` + `];let lt=di;Gt([h({type:String,reflect:!0})],lt.prototype,"icon");Gt([h({type:String,reflect:!0})],lt.prototype,"label");Gt([h({type:String,reflect:!0})],lt.prototype,"name");Gt([h({type:Boolean,reflect:!0})],lt.prototype,"fixed");Gt([h({type:Boolean,reflect:!0})],lt.prototype,"collapsed");var er=Object.defineProperty,Xt=(i,t,e,s)=>{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&er(t,e,n),n};const fi=class fi extends E{constructor(){super(...arguments),this.vertical=!1,this.onValueChange=new Event("change"),this._canEmitEvents=!1,this._value=document.createElement("bim-option"),this.onOptionClick=t=>{this._value=t.target,this.dispatchEvent(this.onValueChange);for(const e of this.children)e instanceof A&&(e.checked=e===t.target)}}get _options(){return[...this.querySelectorAll("bim-option")]}set value(t){const e=this.findOption(t);if(e){for(const s of this._options)s.checked=s===e;this._value=e,this._canEmitEvents&&this.dispatchEvent(this.onValueChange)}}get value(){return this._value.value}onSlotChange(t){const e=t.target.assignedElements();for(const s of e)s instanceof A&&(s.noMark=!0,s.removeEventListener("click",this.onOptionClick),s.addEventListener("click",this.onOptionClick))}findOption(t){return this._options.find(s=>s instanceof A?s.label===t||s.value===t:!1)}firstUpdated(){const t=[...this.children].find(e=>e instanceof A&&e.checked);t&&(this._value=t)}render(){return m` t in i?Xn(i,t,{enumerable:!0,config --bim-label--c: white; background-color: var(--bim-ui_color-main); } - `;let at=fi;Xt([h({type:String,reflect:!0})],at.prototype,"name");Xt([h({type:String,reflect:!0})],at.prototype,"icon");Xt([h({type:String,reflect:!0})],at.prototype,"label");Xt([h({type:Boolean,reflect:!0})],at.prototype,"vertical");Xt([Nt()],at.prototype,"_value");var fr=Object.defineProperty,pr=(i,t,e,s)=>{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&fr(t,e,n),n};const pi=class pi extends E{constructor(){super(...arguments),this.columnIndex=0,this.rowData={}}get data(){return this.column?this.rowData[this.column]:null}render(){return m` + `;let at=fi;Xt([h({type:String,reflect:!0})],at.prototype,"name");Xt([h({type:String,reflect:!0})],at.prototype,"icon");Xt([h({type:String,reflect:!0})],at.prototype,"label");Xt([h({type:Boolean,reflect:!0})],at.prototype,"vertical");Xt([Nt()],at.prototype,"_value");var ir=Object.defineProperty,nr=(i,t,e,s)=>{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&ir(t,e,n),n};const pi=class pi extends E{constructor(){super(...arguments),this.column="",this.columnIndex=0,this.rowData={}}get data(){return this.column?this.rowData[this.column]:null}render(){return m`
- `,s=document.createElement("div");s.classList.add("branch","branch-horizontal"),s.style.left=`${t-1+.5625}rem`;const n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("height","9.5"),n.setAttribute("width","7.5"),n.setAttribute("viewBox","0 0 4.6666672 7.3333333");const o=document.createElementNS("http://www.w3.org/2000/svg","path");o.setAttribute("d","m 1.7470835,6.9583848 2.5899999,-2.59 c 0.39,-0.39 0.39,-1.02 0,-1.41 L 1.7470835,0.36838483 c -0.63,-0.62000003 -1.71000005,-0.18 -1.71000005,0.70999997 v 5.17 c 0,0.9 1.08000005,1.34 1.71000005,0.71 z"),n.append(o);const r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("height","6.5"),r.setAttribute("width","9.5"),r.setAttribute("viewBox","0 0 5.9111118 5.0175439");const a=document.createElementNS("http://www.w3.org/2000/svg","path");a.setAttribute("d","M -0.33616196,1.922522 2.253838,4.5125219 c 0.39,0.39 1.02,0.39 1.41,0 L 6.2538379,1.922522 c 0.6200001,-0.63 0.18,-1.71000007 -0.7099999,-1.71000007 H 0.37383804 c -0.89999997,0 -1.33999997,1.08000007 -0.71,1.71000007 z"),r.append(a);const l=document.createElement("div");l.addEventListener("click",()=>this.toggleChildren()),l.classList.add("caret"),l.style.left=`${.125+t}rem`,this.childrenHidden?l.append(n):l.append(r);const c=document.createElement("bim-table-row");c.table=this.table,c.data=this.data.data,(f=this.table)==null||f.dispatchEvent(new CustomEvent("rowcreated",{detail:{row:c}})),this.data.children&&c.append(l),t!==0&&(!this.data.children||this.childrenHidden)&&c.append(s);let u;return this.data.children&&(u=document.createElement("bim-table-children"),this._children=u,u.table=this.table,u.data=this.data.children),m` + `,s=document.createElement("div");s.classList.add("branch","branch-horizontal"),s.style.left=`${t-1+.5625}rem`;const n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("height","9.5"),n.setAttribute("width","7.5"),n.setAttribute("viewBox","0 0 4.6666672 7.3333333");const o=document.createElementNS("http://www.w3.org/2000/svg","path");o.setAttribute("d","m 1.7470835,6.9583848 2.5899999,-2.59 c 0.39,-0.39 0.39,-1.02 0,-1.41 L 1.7470835,0.36838483 c -0.63,-0.62000003 -1.71000005,-0.18 -1.71000005,0.70999997 v 5.17 c 0,0.9 1.08000005,1.34 1.71000005,0.71 z"),n.append(o);const r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("height","6.5"),r.setAttribute("width","9.5"),r.setAttribute("viewBox","0 0 5.9111118 5.0175439");const a=document.createElementNS("http://www.w3.org/2000/svg","path");a.setAttribute("d","M -0.33616196,1.922522 2.253838,4.5125219 c 0.39,0.39 1.02,0.39 1.41,0 L 6.2538379,1.922522 c 0.6200001,-0.63 0.18,-1.71000007 -0.7099999,-1.71000007 H 0.37383804 c -0.89999997,0 -1.33999997,1.08000007 -0.71,1.71000007 z"),r.append(a);const l=document.createElement("div");l.addEventListener("click",p=>{p.stopPropagation(),this.toggleChildren()}),l.classList.add("caret"),l.style.left=`${.125+t}rem`,this.childrenHidden?l.append(n):l.append(r);const c=document.createElement("bim-table-row");c.table=this.table,c.data=this.data.data,(f=this.table)==null||f.dispatchEvent(new CustomEvent("rowcreated",{detail:{row:c}})),this.data.children&&c.append(l),t!==0&&(!this.data.children||this.childrenHidden)&&c.append(s);let u;return this.data.children&&(u=document.createElement("bim-table-children"),this._children=u,u.table=this.table,u.data=this.data.children),m`
${this.data.children&&!this.childrenHidden?e:null} ${c} ${this.childrenHidden?null:u} @@ -1202,29 +1202,19 @@ var Xn=Object.defineProperty;var Jn=(i,t,e)=>t in i?Xn(i,t,{enumerable:!0,config .caret svg { fill: var(--bim-ui_bg-contrast-60); } - `;let fe=bi;vr([h({type:Boolean,attribute:"children-hidden",reflect:!0})],fe.prototype,"childrenHidden");/** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */const nn=i=>Ts(i)?i._$litType$.h:i.strings,yr=Cn(class extends $n{constructor(i){super(i),this.et=new WeakMap}render(i){return[i]}update(i,[t]){const e=Pi(this.it)?nn(this.it):null,s=Pi(t)?nn(t):null;if(e!==null&&(s===null||e!==s)){const n=ji(i).pop();let o=this.et.get(e);if(o===void 0){const r=document.createDocumentFragment();o=Pe(ie,r),o.setConnected(!1),this.et.set(e,o)}zi(o,[n]),Li(o,void 0,n)}if(s!==null){if(e===null||e!==s){const n=this.et.get(s);if(n!==void 0){const o=ji(n).pop();Ls(i),Li(i,void 0,o),zi(i,[o])}}this.it=t}else this.it=void 0;return this.render(t)}});var _r=Object.defineProperty,Jt=(i,t,e,s)=>{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&_r(t,e,n),n};const gi=class gi extends E{constructor(){super(...arguments),this.columns=[],this.hiddenColumns=[],this.data={},this.isHeader=!1,this._table=this.closest("bim-table"),this.onTableIndentationColorChange=t=>{var r;if(!this.table)return;const e=t.detail,{indentationLevel:s,color:n}=e;((r=this.table)==null?void 0:r.getRowIndentation(this.data))===s&&(this.style.backgroundColor=n)},this.onTableColumnsChange=()=>{this.table&&(this.columns=this.table.columns)},this.onTableColumnsHidden=()=>{this.table&&(this.hiddenColumns=this.table.hiddenColumns)},this._observer=new IntersectionObserver(t=>{this._intersecting=t[0].isIntersecting},{rootMargin:"36px"})}get _columnNames(){return this.columns.filter(s=>!this.hiddenColumns.includes(s.name)).map(s=>s.name)}get _columnWidths(){return this.columns.filter(s=>!this.hiddenColumns.includes(s.name)).map(s=>s.width)}set table(t){this._table&&(this.columns=[],this.hiddenColumns=[],this._table.removeEventListener("columnschange",this.onTableColumnsChange),this._table.removeEventListener("columnshidden",this.onTableColumnsHidden)),this._table=t,this._table&&(this.columns=this._table.columns,this.hiddenColumns=this._table.hiddenColumns,this._table.addEventListener("columnschange",this.onTableColumnsChange),this._table.addEventListener("columnshidden",this.onTableColumnsHidden),this._table.addEventListener("indentation",this.onTableIndentationColorChange))}get table(){return this._table}connectedCallback(){super.connectedCallback(),this._observer.observe(this)}compute(){var n,o;const t=((n=this.table)==null?void 0:n.getRowIndentation(this.data))??0,e=this.isHeader?this.data:((o=this.table)==null?void 0:o.computeRowDeclaration(this.data))??this.data,s=[];for(const r in e){if(this.hiddenColumns.includes(r))continue;const a=e[r];let l;typeof a=="string"||typeof a=="boolean"||typeof a=="number"?l=m`${a}`:l=a;const u=` - ${this._columnNames.indexOf(r)===0&&!this.isHeader?`margin-left: ${t+.125}rem`:""} - `,f=m` - {if(!p)return;const b=p,v=this._columnNames.indexOf(r);b.setAttribute("data-column-index",String(v)),b.toggleAttribute("data-cell-header",this.isHeader),b.rowData=this.data,setTimeout(()=>{var g;(g=this.table)==null||g.dispatchEvent(new CustomEvent("cellcreated",{detail:{cell:b}}))})})} style="${u}" .column=${r} - >${l} - `;s.push(f)}return this.style.gridTemplateAreas=`"${this._columnNames.join(" ")}"`,this.style.gridTemplateColumns=`${this._columnWidths.join(" ")}`,m` + `;let de=bi;lr([h({type:Boolean,attribute:"children-hidden",reflect:!0})],de.prototype,"childrenHidden");var ar=Object.defineProperty,Jt=(i,t,e,s)=>{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&ar(t,e,n),n};const gi=class gi extends E{constructor(){super(...arguments),this.columns=[],this.hiddenColumns=[],this.data={},this.isHeader=!1,this.table=this.closest("bim-table"),this.onTableColumnsChange=()=>{this.table&&(this.columns=this.table.columns)},this.onTableColumnsHidden=()=>{this.table&&(this.hiddenColumns=this.table.hiddenColumns)},this._observer=new IntersectionObserver(t=>{this._intersecting=t[0].isIntersecting},{rootMargin:"36px"})}get _columnNames(){return this.columns.filter(s=>!this.hiddenColumns.includes(s.name)).map(s=>s.name)}get _columnWidths(){return this.columns.filter(s=>!this.hiddenColumns.includes(s.name)).map(s=>s.width)}connectedCallback(){super.connectedCallback(),this._observer.observe(this),this.table&&(this.columns=this.table.columns,this.hiddenColumns=this.table.hiddenColumns,this.table.addEventListener("columnschange",this.onTableColumnsChange),this.table.addEventListener("columnshidden",this.onTableColumnsHidden))}disconnectedCallback(){super.disconnectedCallback(),this._observer.unobserve(this),this.table&&(this.columns=[],this.hiddenColumns=[],this.table.removeEventListener("columnschange",this.onTableColumnsChange),this.table.removeEventListener("columnshidden",this.onTableColumnsHidden))}compute(){var n,o,r;const t=((n=this.table)==null?void 0:n.getRowIndentation(this.data))??0,e=this.isHeader?this.data:((o=this.table)==null?void 0:o.computeRowDeclaration(this.data))??this.data,s=[];for(const a in e){if(this.hiddenColumns.includes(a))continue;const l=e[a];let c;if(typeof l=="string"||typeof l=="boolean"||typeof l=="number"?(c=document.createElement("bim-label"),c.textContent=String(l)):l instanceof HTMLElement?c=l:(c=document.createDocumentFragment(),Pe(l,c)),!c)continue;const u=document.createElement("bim-table-cell");u.append(c),u.column=a,this._columnNames.indexOf(a)===0&&!this.isHeader&&(u.style.marginLeft=`${t+.125}rem`);const d=this._columnNames.indexOf(a);u.setAttribute("data-column-index",String(d)),u.toggleAttribute("data-cell-header",this.isHeader),u.rowData=this.data,(r=this.table)==null||r.dispatchEvent(new CustomEvent("cellcreated",{detail:{cell:u}})),s.push(u)}return this.style.gridTemplateAreas=`"${this._columnNames.join(" ")}"`,this.style.gridTemplateColumns=`${this._columnWidths.join(" ")}`,m` ${s} - `}render(){return m`${yr(this._intersecting?this.compute():m``)}`}};gi.styles=C` + `}render(){return m`${this._intersecting?this.compute():m``}`}};gi.styles=C` :host { position: relative; grid-area: Data; display: grid; min-height: 2.25rem; } - `;let ct=gi;Jt([h({attribute:!1})],ct.prototype,"columns");Jt([h({attribute:!1})],ct.prototype,"hiddenColumns");Jt([h({attribute:!1})],ct.prototype,"data");Jt([h({type:Boolean,attribute:"is-header",reflect:!0})],ct.prototype,"isHeader");Jt([Nt()],ct.prototype,"_intersecting");var xr=Object.defineProperty,wr=Object.getOwnPropertyDescriptor,Tt=(i,t,e,s)=>{for(var n=s>1?void 0:s?wr(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&xr(t,e,n),n};const vi=class vi extends E{constructor(){super(...arguments),this._columnsChange=new Event("columnschange"),this._filteredData=[],this.headersHidden=!1,this.minColWidth="4rem",this._columns=[],this._textDelimiters={comma:",",tab:" "},this._queryString=null,this._data=[],this.expanded=!1,this.preserveStructureOnFilter=!1,this.indentationInText=!1,this.dataTransform={},this._onColumnsHidden=new Event("columnshidden"),this._hiddenColumns=[],this._stringFilterFunction=(t,e)=>Object.values(e.data).some(n=>String(n).toLowerCase().includes(t.toLowerCase())),this._queryFilterFunction=(t,e)=>{let s=!1;const n=Ve(t)??[];for(const o of n){if("queries"in o){s=!1;break}const{condition:r,value:a}=o;let{key:l}=o;if(l.startsWith("[")&&l.endsWith("]")){const c=l.replace("[","").replace("]","");l=c,s=Object.keys(e.data).filter(f=>f.includes(c)).map(f=>en(e.data[f],r,a)).some(f=>f)}else s=en(e.data[l],r,a);if(!s)break}return s}}set columns(t){const e=[];for(const s of t){const n=typeof s=="string"?{name:s,width:`minmax(${this.minColWidth}, 1fr)`}:s;e.push(n)}this._columns=e,this.computeMissingColumns(this.data),this.dispatchEvent(this._columnsChange)}get columns(){return this._columns}get _headerRowData(){const t={};for(const e of this.columns)if(typeof e=="string")t[e]=e;else{const{name:s}=e;t[s]=s}return t}get value(){return this._filteredData}set queryString(t){this._queryString=t&&t.trim()!==""?t.trim():null,this.updateFilteredData()}get queryString(){return this._queryString}set data(t){this._data=t,this.updateFilteredData(),this.computeMissingColumns(t)&&(this.columns=this._columns)}get data(){return this._data}get dataAsync(){return new Promise(t=>{setTimeout(()=>{t(this.data)})})}set hiddenColumns(t){this._hiddenColumns=t,setTimeout(()=>{this.dispatchEvent(this._onColumnsHidden)})}get hiddenColumns(){return this._hiddenColumns}updateFilteredData(){this.queryString?(Ve(this.queryString)?(this.filterFunction=this._queryFilterFunction,this._filteredData=this.filter(this.queryString)):(this.filterFunction=this._stringFilterFunction,this._filteredData=this.filter(this.queryString)),this.preserveStructureOnFilter&&(this._expandedBeforeFilter===void 0&&(this._expandedBeforeFilter=this.expanded),this.expanded=!0)):(this.preserveStructureOnFilter&&this._expandedBeforeFilter!==void 0&&(this.expanded=this._expandedBeforeFilter,this._expandedBeforeFilter=void 0),this._filteredData=this.data)}computeMissingColumns(t){let e=!1;for(const s of t){const{children:n,data:o}=s;for(const r in o)this._columns.map(l=>typeof l=="string"?l:l.name).includes(r)||(this._columns.push({name:r,width:`minmax(${this.minColWidth}, 1fr)`}),e=!0);if(n){const r=this.computeMissingColumns(n);r&&!e&&(e=r)}}return e}generateText(t="comma",e=this.value,s="",n=!0){const o=this._textDelimiters[t];let r="";const a=this.columns.map(l=>l.name);if(n){this.indentationInText&&(r+=`Indentation${o}`);const l=`${a.join(o)} + `;let ct=gi;Jt([h({attribute:!1})],ct.prototype,"columns");Jt([h({attribute:!1})],ct.prototype,"hiddenColumns");Jt([h({attribute:!1})],ct.prototype,"data");Jt([h({type:Boolean,attribute:"is-header",reflect:!0})],ct.prototype,"isHeader");Jt([Nt()],ct.prototype,"_intersecting");var cr=Object.defineProperty,ur=Object.getOwnPropertyDescriptor,Tt=(i,t,e,s)=>{for(var n=s>1?void 0:s?ur(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&cr(t,e,n),n};const vi=class vi extends E{constructor(){super(...arguments),this._columnsChange=new Event("columnschange"),this._filteredData=[],this.headersHidden=!1,this.minColWidth="4rem",this._columns=[],this._textDelimiters={comma:",",tab:" "},this._queryString=null,this._data=[],this.expanded=!1,this.preserveStructureOnFilter=!1,this.indentationInText=!1,this.dataTransform={},this._onColumnsHidden=new Event("columnshidden"),this._hiddenColumns=[],this._stringFilterFunction=(t,e)=>Object.values(e.data).some(n=>String(n).toLowerCase().includes(t.toLowerCase())),this._queryFilterFunction=(t,e)=>{let s=!1;const n=Ve(t)??[];for(const o of n){if("queries"in o){s=!1;break}const{condition:r,value:a}=o;let{key:l}=o;if(l.startsWith("[")&&l.endsWith("]")){const c=l.replace("[","").replace("]","");l=c,s=Object.keys(e.data).filter(f=>f.includes(c)).map(f=>Xi(e.data[f],r,a)).some(f=>f)}else s=Xi(e.data[l],r,a);if(!s)break}return s}}set columns(t){const e=[];for(const s of t){const n=typeof s=="string"?{name:s,width:`minmax(${this.minColWidth}, 1fr)`}:s;e.push(n)}this._columns=e,this.computeMissingColumns(this.data),this.dispatchEvent(this._columnsChange)}get columns(){return this._columns}get _headerRowData(){const t={};for(const e of this.columns)if(typeof e=="string")t[e]=e;else{const{name:s}=e;t[s]=s}return t}get value(){return this._filteredData}set queryString(t){this._queryString=t&&t.trim()!==""?t.trim():null,this.updateFilteredData()}get queryString(){return this._queryString}set data(t){this._data=t,this.updateFilteredData(),this.computeMissingColumns(t)&&(this.columns=this._columns)}get data(){return this._data}get dataAsync(){return new Promise(t=>{setTimeout(()=>{t(this.data)})})}set hiddenColumns(t){this._hiddenColumns=t,setTimeout(()=>{this.dispatchEvent(this._onColumnsHidden)})}get hiddenColumns(){return this._hiddenColumns}updateFilteredData(){this.queryString?(Ve(this.queryString)?(this.filterFunction=this._queryFilterFunction,this._filteredData=this.filter(this.queryString)):(this.filterFunction=this._stringFilterFunction,this._filteredData=this.filter(this.queryString)),this.preserveStructureOnFilter&&(this._expandedBeforeFilter===void 0&&(this._expandedBeforeFilter=this.expanded),this.expanded=!0)):(this.preserveStructureOnFilter&&this._expandedBeforeFilter!==void 0&&(this.expanded=this._expandedBeforeFilter,this._expandedBeforeFilter=void 0),this._filteredData=this.data)}computeMissingColumns(t){let e=!1;for(const s of t){const{children:n,data:o}=s;for(const r in o)this._columns.map(l=>typeof l=="string"?l:l.name).includes(r)||(this._columns.push({name:r,width:`minmax(${this.minColWidth}, 1fr)`}),e=!0);if(n){const r=this.computeMissingColumns(n);r&&!e&&(e=r)}}return e}generateText(t="comma",e=this.value,s="",n=!0){const o=this._textDelimiters[t];let r="";const a=this.columns.map(l=>l.name);if(n){this.indentationInText&&(r+=`Indentation${o}`);const l=`${a.join(o)} `;r+=l}for(const[l,c]of e.entries()){const{data:u,children:d}=c,f=this.indentationInText?`${s}${l+1}${o}`:"",p=a.map(v=>u[v]??""),b=`${f}${p.join(o)} -`;r+=b,d&&(r+=this.generateText(t,c.children,`${s}${l+1}.`,!1))}return r}get csv(){return this.generateText("comma")}get tsv(){return this.generateText("tab")}computeRowDeclaration(t){const e={};for(const s in t){const n=this.dataTransform[s];n?e[s]=n(t[s],t):e[s]=t[s]}return e}downloadData(t="BIM Table Data",e="json"){let s=null;if(e==="json"&&(s=new File([JSON.stringify(this.value,void 0,2)],`${t}.json`)),e==="csv"&&(s=new File([this.csv],`${t}.csv`)),e==="tsv"&&(s=new File([this.tsv],`${t}.tsv`)),!s)return;const n=document.createElement("a");n.href=URL.createObjectURL(s),n.download=s.name,n.click(),URL.revokeObjectURL(n.href)}getRowIndentation(t,e=this.value,s=0){for(const n of e){if(n.data===t)return s;if(n.children){const o=this.getRowIndentation(t,n.children,s+1);if(o!==null)return o}}return null}getGroupIndentation(t,e=this.value,s=0){for(const n of e){if(n===t)return s;if(n.children){const o=this.getGroupIndentation(t,n.children,s+1);if(o!==null)return o}}return null}setIndentationColor(t,e){const s=new CustomEvent("indentation",{detail:{indentationLevel:t,color:e}});this.dispatchEvent(s)}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new Event("connected"))}disconnectedCallback(){super.disconnectedCallback(),this.dispatchEvent(new Event("disconnected"))}filter(t,e=this.filterFunction??this._stringFilterFunction,s=this.data){const n=[];for(const o of s)if(e(t,o)){if(this.preserveStructureOnFilter){const a={data:o.data};if(o.children){const l=this.filter(t,e,o.children);l.length&&(a.children=l)}n.push(a)}else if(n.push({data:o.data}),o.children){const a=this.filter(t,e,o.children);n.push(...a)}}else if(o.children){const a=this.filter(t,e,o.children);this.preserveStructureOnFilter&&a.length?n.push({data:o.data,children:a}):n.push(...a)}return n}render(){const t=document.createElement("bim-table-row");t.table=this,t.isHeader=!0,t.data=this._headerRowData,t.style.gridArea="Header",t.style.position="sticky",t.style.top="0",t.style.zIndex="5";const e=document.createElement("bim-table-children");return e.table=this,e.data=this.value,e.style.gridArea="Body",e.style.backgroundColor="transparent",m` +`;r+=b,d&&(r+=this.generateText(t,c.children,`${s}${l+1}.`,!1))}return r}get csv(){return this.generateText("comma")}get tsv(){return this.generateText("tab")}computeRowDeclaration(t){const e={};for(const s in t){const n=this.dataTransform[s];n?e[s]=n(t[s],t):e[s]=t[s]}return e}downloadData(t="BIM Table Data",e="json"){let s=null;if(e==="json"&&(s=new File([JSON.stringify(this.value,void 0,2)],`${t}.json`)),e==="csv"&&(s=new File([this.csv],`${t}.csv`)),e==="tsv"&&(s=new File([this.tsv],`${t}.tsv`)),!s)return;const n=document.createElement("a");n.href=URL.createObjectURL(s),n.download=s.name,n.click(),URL.revokeObjectURL(n.href)}getRowIndentation(t,e=this.value,s=0){for(const n of e){if(n.data===t)return s;if(n.children){const o=this.getRowIndentation(t,n.children,s+1);if(o!==null)return o}}return null}getGroupIndentation(t,e=this.value,s=0){for(const n of e){if(n===t)return s;if(n.children){const o=this.getGroupIndentation(t,n.children,s+1);if(o!==null)return o}}return null}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new Event("connected"))}disconnectedCallback(){super.disconnectedCallback(),this.dispatchEvent(new Event("disconnected"))}filter(t,e=this.filterFunction??this._stringFilterFunction,s=this.data){const n=[];for(const o of s)if(e(t,o)){if(this.preserveStructureOnFilter){const a={data:o.data};if(o.children){const l=this.filter(t,e,o.children);l.length&&(a.children=l)}n.push(a)}else if(n.push({data:o.data}),o.children){const a=this.filter(t,e,o.children);n.push(...a)}}else if(o.children){const a=this.filter(t,e,o.children);this.preserveStructureOnFilter&&a.length?n.push({data:o.data,children:a}):n.push(...a)}return n}render(){const t=document.createElement("bim-table-row");t.table=this,t.isHeader=!0,t.data=this._headerRowData,t.style.gridArea="Header",t.style.position="sticky",t.style.top="0",t.style.zIndex="5";const e=document.createElement("bim-table-children");return e.table=this,e.data=this.value,e.style.gridArea="Body",e.style.backgroundColor="transparent",m`
${this.headersHidden?null:t}
${e}
@@ -1262,7 +1252,7 @@ var Xn=Object.defineProperty;var Jn=(i,t,e)=>t in i?Xn(i,t,{enumerable:!0,config flex-wrap: wrap; margin-bottom: 0.5rem; } - `];let J=vi;Tt([Nt()],J.prototype,"_filteredData",2);Tt([h({type:Boolean,attribute:"headers-hidden",reflect:!0})],J.prototype,"headersHidden",2);Tt([h({type:String,attribute:"min-col-width",reflect:!0})],J.prototype,"minColWidth",2);Tt([h({type:Array,attribute:!1})],J.prototype,"columns",1);Tt([h({type:Array,attribute:!1})],J.prototype,"data",1);Tt([h({type:Boolean,reflect:!0})],J.prototype,"expanded",2);var Cr=Object.defineProperty,$r=Object.getOwnPropertyDescriptor,Ce=(i,t,e,s)=>{for(var n=s>1?void 0:s?$r(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&Cr(t,e,n),n};const yi=class yi extends E{constructor(){super(...arguments),this._defaultName="__unnamed__",this.name=this._defaultName,this._hidden=!1}set hidden(t){this._hidden=t,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}connectedCallback(){super.connectedCallback();const{parentElement:t}=this;if(t&&this.name===this._defaultName){const e=[...t.children].indexOf(this);this.name=`${this._defaultName}${e}`}}render(){return m` `}};yi.styles=C` + `];let X=vi;Tt([Nt()],X.prototype,"_filteredData",2);Tt([h({type:Boolean,attribute:"headers-hidden",reflect:!0})],X.prototype,"headersHidden",2);Tt([h({type:String,attribute:"min-col-width",reflect:!0})],X.prototype,"minColWidth",2);Tt([h({type:Array,attribute:!1})],X.prototype,"columns",1);Tt([h({type:Array,attribute:!1})],X.prototype,"data",1);Tt([h({type:Boolean,reflect:!0})],X.prototype,"expanded",2);var hr=Object.defineProperty,dr=Object.getOwnPropertyDescriptor,we=(i,t,e,s)=>{for(var n=s>1?void 0:s?dr(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&hr(t,e,n),n};const yi=class yi extends E{constructor(){super(...arguments),this._defaultName="__unnamed__",this.name=this._defaultName,this._hidden=!1}set hidden(t){this._hidden=t,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}connectedCallback(){super.connectedCallback();const{parentElement:t}=this;if(t&&this.name===this._defaultName){const e=[...t.children].indexOf(this);this.name=`${this._defaultName}${e}`}}render(){return m` `}};yi.styles=C` :host { display: block; height: 100%; @@ -1271,7 +1261,7 @@ var Xn=Object.defineProperty;var Jn=(i,t,e)=>t in i?Xn(i,t,{enumerable:!0,config :host([hidden]) { display: none; } - `;let I=yi;Ce([h({type:String,reflect:!0})],I.prototype,"name",2);Ce([h({type:String,reflect:!0})],I.prototype,"label",2);Ce([h({type:String,reflect:!0})],I.prototype,"icon",2);Ce([h({type:Boolean,reflect:!0})],I.prototype,"hidden",1);var Er=Object.defineProperty,Sr=Object.getOwnPropertyDescriptor,Kt=(i,t,e,s)=>{for(var n=s>1?void 0:s?Sr(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&Er(t,e,n),n};const _i=class _i extends E{constructor(){super(...arguments),this._switchers=[],this.bottom=!1,this.switchersHidden=!1,this.floating=!1,this.onTabHiddenChange=t=>{const e=t.target;e instanceof I&&!e.hidden&&(e.removeEventListener("hiddenchange",this.onTabHiddenChange),this.tab=e.name,e.addEventListener("hiddenchange",this.onTabHiddenChange))}}set tab(t){this._tab=t;const e=[...this.children],s=e.find(n=>n instanceof I&&n.name===t);for(const n of e){if(!(n instanceof I))continue;n.hidden=s!==n;const o=this.getTabSwitcher(n.name);o&&o.toggleAttribute("data-active",!n.hidden)}}get tab(){return this._tab}getTabSwitcher(t){return this._switchers.find(s=>s.getAttribute("data-name")===t)}createSwitchers(){this._switchers=[];for(const t of this.children){if(!(t instanceof I))continue;const e=document.createElement("div");e.addEventListener("click",()=>{this.tab===t.name?this.toggleAttribute("tab",!1):this.tab=t.name}),e.setAttribute("data-name",t.name),e.className="switcher";const s=document.createElement("bim-label");s.textContent=t.label??"",s.icon=t.icon,e.append(s),this._switchers.push(e)}}onSlotChange(t){this.createSwitchers();const e=t.target.assignedElements(),s=e.find(n=>n instanceof I?this.tab?n.name===this.tab:!n.hidden:!1);s&&s instanceof I&&(this.tab=s.name);for(const n of e){if(!(n instanceof I)){n.remove();continue}n.removeEventListener("hiddenchange",this.onTabHiddenChange),s!==n&&(n.hidden=!0),n.addEventListener("hiddenchange",this.onTabHiddenChange)}}render(){return m` + `;let L=yi;we([h({type:String,reflect:!0})],L.prototype,"name",2);we([h({type:String,reflect:!0})],L.prototype,"label",2);we([h({type:String,reflect:!0})],L.prototype,"icon",2);we([h({type:Boolean,reflect:!0})],L.prototype,"hidden",1);var fr=Object.defineProperty,pr=Object.getOwnPropertyDescriptor,Kt=(i,t,e,s)=>{for(var n=s>1?void 0:s?pr(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&fr(t,e,n),n};const _i=class _i extends E{constructor(){super(...arguments),this._switchers=[],this.bottom=!1,this.switchersHidden=!1,this.floating=!1,this.onTabHiddenChange=t=>{const e=t.target;e instanceof L&&!e.hidden&&(e.removeEventListener("hiddenchange",this.onTabHiddenChange),this.tab=e.name,e.addEventListener("hiddenchange",this.onTabHiddenChange))}}set tab(t){this._tab=t;const e=[...this.children],s=e.find(n=>n instanceof L&&n.name===t);for(const n of e){if(!(n instanceof L))continue;n.hidden=s!==n;const o=this.getTabSwitcher(n.name);o&&o.toggleAttribute("data-active",!n.hidden)}}get tab(){return this._tab}getTabSwitcher(t){return this._switchers.find(s=>s.getAttribute("data-name")===t)}createSwitchers(){this._switchers=[];for(const t of this.children){if(!(t instanceof L))continue;const e=document.createElement("div");e.addEventListener("click",()=>{this.tab===t.name?this.toggleAttribute("tab",!1):this.tab=t.name}),e.setAttribute("data-name",t.name),e.className="switcher";const s=document.createElement("bim-label");s.textContent=t.label??"",s.icon=t.icon,e.append(s),this._switchers.push(e)}}onSlotChange(t){this.createSwitchers();const e=t.target.assignedElements(),s=e.find(n=>n instanceof L?this.tab?n.name===this.tab:!n.hidden:!1);s&&s instanceof L&&(this.tab=s.name);for(const n of e){if(!(n instanceof L)){n.remove();continue}n.removeEventListener("hiddenchange",this.onTabHiddenChange),s!==n&&(n.hidden=!0),n.addEventListener("hiddenchange",this.onTabHiddenChange)}}render(){return m`
${this._switchers}
@@ -1387,7 +1377,7 @@ var Xn=Object.defineProperty;var Jn=(i,t,e)=>t in i?Xn(i,t,{enumerable:!0,config * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const kr=i=>i??ie;var Or=Object.defineProperty,Ar=Object.getOwnPropertyDescriptor,mt=(i,t,e,s)=>{for(var n=s>1?void 0:s?Ar(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&Or(t,e,n),n};const xi=class xi extends E{constructor(){super(...arguments),this._inputTypes=["date","datetime-local","email","month","password","search","tel","text","time","url","week"],this.value="",this.vertical=!1,this._type="text",this.onValueChange=new Event("input")}set type(t){this._inputTypes.includes(t)&&(this._type=t)}get type(){return this._type}get query(){return Ve(this.value)}onInputChange(t){t.stopPropagation();const e=t.target;clearTimeout(this._debounceTimeoutID),this._debounceTimeoutID=setTimeout(()=>{this.value=e.value,this.dispatchEvent(this.onValueChange)},this.debounce)}render(){return m` + */const mr=i=>i??Te;var br=Object.defineProperty,gr=Object.getOwnPropertyDescriptor,mt=(i,t,e,s)=>{for(var n=s>1?void 0:s?gr(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&br(t,e,n),n};const xi=class xi extends E{constructor(){super(...arguments),this._inputTypes=["date","datetime-local","email","month","password","search","tel","text","time","url","week"],this.value="",this.vertical=!1,this._type="text",this.onValueChange=new Event("input")}set type(t){this._inputTypes.includes(t)&&(this._type=t)}get type(){return this._type}get query(){return Ve(this.value)}onInputChange(t){t.stopPropagation();const e=t.target;clearTimeout(this._debounceTimeoutID),this._debounceTimeoutID=setTimeout(()=>{this.value=e.value,this.dispatchEvent(this.onValueChange)},this.debounce)}render(){return m` t in i?Xn(i,t,{enumerable:!0,config aria-label=${this.label||this.name||"Checkbox Input"} .type=${this.type} .value=${this.value} - placeholder=${kr(this.placeholder)} + placeholder=${mr(this.placeholder)} @input=${this.onInputChange} /> @@ -1427,7 +1417,7 @@ var Xn=Object.defineProperty;var Jn=(i,t,e)=>t in i?Xn(i,t,{enumerable:!0,config /* :host([disabled]) { --bim-input--bgc: var(--bim-ui_bg-contrast-20); } */ - `;let B=xi;mt([h({type:String,reflect:!0})],B.prototype,"icon",2);mt([h({type:String,reflect:!0})],B.prototype,"label",2);mt([h({type:String,reflect:!0})],B.prototype,"name",2);mt([h({type:String,reflect:!0})],B.prototype,"placeholder",2);mt([h({type:String,reflect:!0})],B.prototype,"value",2);mt([h({type:Boolean,reflect:!0})],B.prototype,"vertical",2);mt([h({type:Number,reflect:!0})],B.prototype,"debounce",2);mt([h({type:String,reflect:!0})],B.prototype,"type",1);var Tr=Object.defineProperty,Pr=Object.getOwnPropertyDescriptor,Gn=(i,t,e,s)=>{for(var n=s>1?void 0:s?Pr(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&Tr(t,e,n),n};const wi=class wi extends E{constructor(){super(...arguments),this.rows=2,this._vertical=!1}set vertical(t){this._vertical=t,this.updateChildren()}get vertical(){return this._vertical}updateChildren(){const t=this.children;for(const e of t)this.vertical?e.setAttribute("label-hidden",""):e.removeAttribute("label-hidden")}render(){return m` + `;let B=xi;mt([h({type:String,reflect:!0})],B.prototype,"icon",2);mt([h({type:String,reflect:!0})],B.prototype,"label",2);mt([h({type:String,reflect:!0})],B.prototype,"name",2);mt([h({type:String,reflect:!0})],B.prototype,"placeholder",2);mt([h({type:String,reflect:!0})],B.prototype,"value",2);mt([h({type:Boolean,reflect:!0})],B.prototype,"vertical",2);mt([h({type:Number,reflect:!0})],B.prototype,"debounce",2);mt([h({type:String,reflect:!0})],B.prototype,"type",1);var vr=Object.defineProperty,yr=Object.getOwnPropertyDescriptor,Hn=(i,t,e,s)=>{for(var n=s>1?void 0:s?yr(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&vr(t,e,n),n};const wi=class wi extends E{constructor(){super(...arguments),this.rows=2,this._vertical=!1}set vertical(t){this._vertical=t,this.updateChildren()}get vertical(){return this._vertical}updateChildren(){const t=this.children;for(const e of t)this.vertical?e.setAttribute("label-hidden",""):e.removeAttribute("label-hidden")}render(){return m` -
+
${this.label||this.icon?ks`
t in e?Yie(e,t,{enumerable:!0,configu
`:null}
- `}},sW.styles=Ei` + `}},aW.styles=Ei` :host { display: block; flex: 1; @@ -216,7 +216,7 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu :host(:not([tooltip-visible])) .tooltip { display: none; } - `,sW);Ig([mn({type:String,reflect:!0})],Cm.prototype,"label");Ig([mn({type:Boolean,attribute:"label-hidden",reflect:!0})],Cm.prototype,"labelHidden");Ig([mn({type:Boolean,reflect:!0})],Cm.prototype,"active");Ig([mn({type:Boolean,reflect:!0,attribute:"disabled"})],Cm.prototype,"disabled");Ig([mn({type:String,reflect:!0})],Cm.prototype,"icon");Ig([mn({type:Boolean,reflect:!0})],Cm.prototype,"vertical");Ig([mn({type:Number,attribute:"tooltip-time",reflect:!0})],Cm.prototype,"tooltipTime");Ig([mn({type:Boolean,attribute:"tooltip-visible",reflect:!0})],Cm.prototype,"tooltipVisible");Ig([mn({type:String,attribute:"tooltip-title",reflect:!0})],Cm.prototype,"tooltipTitle");Ig([mn({type:String,attribute:"tooltip-text",reflect:!0})],Cm.prototype,"tooltipText");let Que=Cm;var Zue=Object.defineProperty,PV=(e,t,n,s)=>{for(var l=void 0,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&Zue(t,n,l),l};const Une=class extends li{constructor(){super(...arguments),this.checked=!1,this.inverted=!1,this.onValueChange=new Event("change")}get value(){return this.checked}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.dispatchEvent(this.onValueChange)}render(){return ks` + `,aW);pg([mn({type:String,reflect:!0})],bm.prototype,"label");pg([mn({type:Boolean,attribute:"label-hidden",reflect:!0})],bm.prototype,"labelHidden");pg([mn({type:Boolean,reflect:!0})],bm.prototype,"active");pg([mn({type:Boolean,reflect:!0,attribute:"disabled"})],bm.prototype,"disabled");pg([mn({type:String,reflect:!0})],bm.prototype,"icon");pg([mn({type:Boolean,reflect:!0})],bm.prototype,"vertical");pg([mn({type:Number,attribute:"tooltip-time",reflect:!0})],bm.prototype,"tooltipTime");pg([mn({type:Boolean,attribute:"tooltip-visible",reflect:!0})],bm.prototype,"tooltipVisible");pg([mn({type:String,attribute:"tooltip-title",reflect:!0})],bm.prototype,"tooltipTitle");pg([mn({type:String,attribute:"tooltip-text",reflect:!0})],bm.prototype,"tooltipText");let kue=bm;var jue=Object.defineProperty,MV=(e,t,n,s)=>{for(var l=void 0,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&jue(t,n,l),l};const Cne=class extends li{constructor(){super(...arguments),this.checked=!1,this.inverted=!1,this.onValueChange=new Event("change")}get value(){return this.checked}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.dispatchEvent(this.onValueChange)}render(){return ks`
${this.label?ks`${this.label} `:null} t in e?Yie(e,t,{enumerable:!0,configu .checked="${this.checked}" />
- `}};Une.styles=Ei` + `}};Cne.styles=Ei` :host { display: block; } @@ -258,7 +258,7 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu outline: var(--bim-checkbox--olw, 2px) solid var(--bim-checkbox--olc, var(--bim-ui_color-accent)); } - `;let $M=Une;PV([mn({type:String,reflect:!0})],$M.prototype,"icon");PV([mn({type:String,reflect:!0})],$M.prototype,"name");PV([mn({type:String,reflect:!0})],$M.prototype,"label");PV([mn({type:Boolean,reflect:!0})],$M.prototype,"checked");PV([mn({type:Boolean,reflect:!0})],$M.prototype,"inverted");var $ue=Object.defineProperty,JM=(e,t,n,s)=>{for(var l=void 0,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&$ue(t,n,l),l};const Fne=class extends li{constructor(){super(...arguments),this.vertical=!1,this.color="#bcf124",this._colorInput=wN(),this._textInput=wN(),this.onValueChange=new Event("input"),this.onOpacityInput=t=>{const n=t.target;this.opacity=n.value,this.dispatchEvent(this.onValueChange)}}set value(t){const{color:n,opacity:s}=t;this.color=n,s&&(this.opacity=s)}get value(){const t={color:this.color};return this.opacity&&(t.opacity=this.opacity),t}onColorInput(t){t.stopPropagation();const{value:n}=this._colorInput;n&&(this.color=n.value,this.dispatchEvent(this.onValueChange))}onTextInput(t){t.stopPropagation();const{value:n}=this._textInput;if(!n)return;const{value:s}=n;let l=s.replace(/[^a-fA-F0-9]/g,"");l.startsWith("#")||(l=`#${l}`),n.value=l.slice(0,7),n.value.length===7&&(this.color=n.value,this.dispatchEvent(this.onValueChange))}focus(){const{value:t}=this._colorInput;t&&t.click()}render(){return ks` + `;let JM=Cne;MV([mn({type:String,reflect:!0})],JM.prototype,"icon");MV([mn({type:String,reflect:!0})],JM.prototype,"name");MV([mn({type:String,reflect:!0})],JM.prototype,"label");MV([mn({type:Boolean,reflect:!0})],JM.prototype,"checked");MV([mn({type:Boolean,reflect:!0})],JM.prototype,"inverted");var que=Object.defineProperty,XM=(e,t,n,s)=>{for(var l=void 0,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&que(t,n,l),l};const bne=class extends li{constructor(){super(...arguments),this.vertical=!1,this.color="#bcf124",this._colorInput=EN(),this._textInput=EN(),this.onValueChange=new Event("input"),this.onOpacityInput=t=>{const n=t.target;this.opacity=n.value,this.dispatchEvent(this.onValueChange)}}set value(t){const{color:n,opacity:s}=t;this.color=n,s&&(this.opacity=s)}get value(){const t={color:this.color};return this.opacity&&(t.opacity=this.opacity),t}onColorInput(t){t.stopPropagation();const{value:n}=this._colorInput;n&&(this.color=n.value,this.dispatchEvent(this.onValueChange))}onTextInput(t){t.stopPropagation();const{value:n}=this._textInput;if(!n)return;const{value:s}=n;let l=s.replace(/[^a-fA-F0-9]/g,"");l.startsWith("#")||(l=`#${l}`),n.value=l.slice(0,7),n.value.length===7&&(this.color=n.value,this.dispatchEvent(this.onValueChange))}focus(){const{value:t}=this._colorInput;t&&t.click()}render(){return ks`
t in e?Yie(e,t,{enumerable:!0,configu style="display: flex; align-items: center; gap: .375rem; height: 100%; flex: 1; padding: 0 0.5rem;" > t in e?Yie(e,t,{enumerable:!0,configu style="background-color: ${this.color}" >
t in e?Yie(e,t,{enumerable:!0,configu
- `}};Fne.styles=Ei` + `}};bne.styles=Ei` :host { --bim-input--bgc: var(--bim-ui_bg-contrast-20); flex: 1; @@ -360,7 +360,7 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu bim-number-input { flex-grow: 0; } - `;let CL=Fne;JM([mn({type:String,reflect:!0})],CL.prototype,"name");JM([mn({type:String,reflect:!0})],CL.prototype,"label");JM([mn({type:String,reflect:!0})],CL.prototype,"icon");JM([mn({type:Boolean,reflect:!0})],CL.prototype,"vertical");JM([mn({type:Number,reflect:!0})],CL.prototype,"opacity");JM([mn({type:String,reflect:!0})],CL.prototype,"color");const Jue=Ei` + `;let CL=bne;XM([mn({type:String,reflect:!0})],CL.prototype,"name");XM([mn({type:String,reflect:!0})],CL.prototype,"label");XM([mn({type:String,reflect:!0})],CL.prototype,"icon");XM([mn({type:Boolean,reflect:!0})],CL.prototype,"vertical");XM([mn({type:Number,reflect:!0})],CL.prototype,"opacity");XM([mn({type:String,reflect:!0})],CL.prototype,"color");const Kue=Ei` ::-webkit-scrollbar { width: 0.4rem; height: 0.4rem; @@ -378,7 +378,7 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu ::-webkit-scrollbar-track { background-color: var(--bim-scrollbar--bgc, var(--bim-ui_bg-base)); } -`,Xue=Ei` +`,Que=Ei` :root { /* Backgrounds */ --bim-ui_bg-base: hsl(210 10% 5%); @@ -478,7 +478,7 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu bim-grid[floating] bim-toolbars-container { background-color: transparent; } -`,bL={scrollbar:Jue,globalStyles:Xue};var vue=Object.defineProperty,eoe=Object.getOwnPropertyDescriptor,toe=(e,t,n,s)=>{for(var l=eoe(t,n),u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&vue(t,n,l),l};const Bne=class extends li{constructor(){super(...arguments),this._visible=!1,this._middleware={name:"middleware",async fn(t){const{right:n,top:s}=await IZ(t);return t.x-=Math.sign(n)===1?n+5:0,t.y-=Math.sign(s)===1?s+5:0,t}}}get visible(){return this._visible}set visible(t){this._visible=t,t&&this.updatePosition()}async updatePosition(t){const n=t||this.parentNode;if(!n){this.visible=!1,console.warn("No target element found for context-menu.");return}const s=await $te(n,this,{placement:"right",middleware:[Hte(10),Zte(),Qte(),Kte({padding:5}),this._middleware]}),{x:l,y:u}=s;this.style.left=`${l}px`,this.style.top=`${u}px`}render(){return ks` `}};Bne.styles=[bL.scrollbar,Ei` +`,bL={scrollbar:Kue,globalStyles:Que};var Zue=Object.defineProperty,$ue=Object.getOwnPropertyDescriptor,Jue=(e,t,n,s)=>{for(var l=$ue(t,n),u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&Zue(t,n,l),l};const Lne=class extends li{constructor(){super(...arguments),this._visible=!1,this._middleware={name:"middleware",async fn(t){const{right:n,top:s}=await RZ(t);return t.x-=Math.sign(n)===1?n+5:0,t.y-=Math.sign(s)===1?s+5:0,t}}}get visible(){return this._visible}set visible(t){this._visible=t,t&&this.updatePosition()}async updatePosition(t){const n=t||this.parentNode;if(!n){this.visible=!1,console.warn("No target element found for context-menu.");return}const s=await Kte(n,this,{placement:"right",middleware:[Ute(10),qte(),jte(),kte({padding:5}),this._middleware]}),{x:l,y:u}=s;this.style.left=`${l}px`,this.style.top=`${u}px`}render(){return ks` `}};Lne.styles=[bL.scrollbar,Ei` :host { --bim-label--fz: var(--bim-ui_size-xs); position: absolute; @@ -505,7 +505,7 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu :host(:not([visible])) { display: none; } - `];let Hne=Bne;toe([mn({type:Boolean,reflect:!0})],Hne.prototype,"visible");class noe extends li{constructor(){super(...arguments),this._lazyLoadObserver=null,this._visibleElements=[],this.ELEMENTS_BEFORE_OBSERVER=20,this.useObserver=!1,this.elements=new Set,this.observe=t=>{if(!this.useObserver)return;for(const s of t)this.elements.add(s);const n=t.slice(this.ELEMENTS_BEFORE_OBSERVER);for(const s of n)s.remove();this.observeLastElement()}}set visibleElements(t){this._visibleElements=this.useObserver?t:[],this.requestUpdate()}get visibleElements(){return this._visibleElements}getLazyObserver(){if(!this.useObserver)return null;if(this._lazyLoadObserver)return this._lazyLoadObserver;const t=new IntersectionObserver(n=>{const s=n[0];if(!s.isIntersecting)return;const l=s.target;t.unobserve(l);const u=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length,o=[...this.elements][u];o&&(this.visibleElements=[...this.visibleElements,o],t.observe(o))},{threshold:.5});return t}observeLastElement(){const t=this.getLazyObserver();if(!t)return;const n=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length-1,s=[...this.elements][n];s&&t.observe(s)}resetVisibleElements(){const t=this.getLazyObserver();if(t){for(const n of this.elements)t.unobserve(n);this.visibleElements=[],this.observeLastElement()}}static create(t,n){const s=document.createDocumentFragment();if(t.length===0)return kY(t(),s),s.firstElementChild;if(!n)throw new Error("UIComponent: Initial state is required for statefull components.");let l=n;const u=t,o=h=>(l={...l,...h},kY(u(l),s),l);return o(n),[s.firstElementChild,o]}}const ZY=(e,t=!0)=>{let n={};for(const s of e.children){const l=s,u=l.getAttribute("name")||l.getAttribute("label");if(u){if("value"in l){const o=l.value;if(typeof o=="object"&&!Array.isArray(o)&&Object.keys(o).length===0)continue;n[u]=l.value}else if(t){const o=ZY(l);if(Object.keys(o).length===0)continue;n[u]=o}}else t&&(n={...n,...ZY(l)})}return n},yk=e=>e==="true"||e==="false"?e==="true":e&&!isNaN(Number(e))&&e.trim()!==""?Number(e):e,soe=[">=","<=","=",">","<","?","/","#"];function zJ(e){const t=soe.find(o=>e.split(o).length===2),n=e.split(t).map(o=>o.trim()),[s,l]=n,u=l.startsWith("'")&&l.endsWith("'")?l.replace(/'/g,""):yk(l);return{key:s,condition:t,value:u}}const MK=e=>{try{const t=[],n=e.split(/&(?![^()]*\))/).map(s=>s.trim());for(const s of n){const l=!s.startsWith("(")&&!s.endsWith(")"),u=s.startsWith("(")&&s.endsWith(")");if(l){const o=zJ(s);t.push(o)}if(u){const o={operator:"&",queries:s.replace(/^(\()|(\))$/g,"").split("&").map(h=>h.trim()).map((h,f)=>{const p=zJ(h);return f>0&&(p.operator="&"),p})};t.push(o)}}return t}catch{return null}},YJ=(e,t,n)=>{let s=!1;switch(t){case"=":s=e===n;break;case"?":s=String(e).includes(String(n));break;case"<":(typeof e=="number"||typeof n=="number")&&(s=e":(typeof e=="number"||typeof n=="number")&&(s=e>n);break;case">=":(typeof e=="number"||typeof n=="number")&&(s=e>=n);break;case"/":s=String(e).startsWith(String(n));break}return s};var loe=Object.defineProperty,roe=Object.getOwnPropertyDescriptor,MN=(e,t,n,s)=>{for(var l=s>1?void 0:s?roe(t,n):t,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=(s?o(t,n,l):o(l))||l);return s&&l&&loe(t,n,l),l};const _ne=class extends li{constructor(){super(...arguments),this.checked=!1,this.checkbox=!1,this.noMark=!1,this.vertical=!1}get value(){return this._value!==void 0?this._value:this.label?yk(this.label):this.label}set value(t){this._value=t}render(){return ks` + `];let Pne=Lne;Jue([mn({type:Boolean,reflect:!0})],Pne.prototype,"visible");class Xue extends li{constructor(){super(...arguments),this._lazyLoadObserver=null,this._visibleElements=[],this.ELEMENTS_BEFORE_OBSERVER=20,this.useObserver=!1,this.elements=new Set,this.observe=t=>{if(!this.useObserver)return;for(const s of t)this.elements.add(s);const n=t.slice(this.ELEMENTS_BEFORE_OBSERVER);for(const s of n)s.remove();this.observeLastElement()}}set visibleElements(t){this._visibleElements=this.useObserver?t:[],this.requestUpdate()}get visibleElements(){return this._visibleElements}getLazyObserver(){if(!this.useObserver)return null;if(this._lazyLoadObserver)return this._lazyLoadObserver;const t=new IntersectionObserver(n=>{const s=n[0];if(!s.isIntersecting)return;const l=s.target;t.unobserve(l);const u=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length,o=[...this.elements][u];o&&(this.visibleElements=[...this.visibleElements,o],t.observe(o))},{threshold:.5});return t}observeLastElement(){const t=this.getLazyObserver();if(!t)return;const n=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length-1,s=[...this.elements][n];s&&t.observe(s)}resetVisibleElements(){const t=this.getLazyObserver();if(t){for(const n of this.elements)t.unobserve(n);this.visibleElements=[],this.observeLastElement()}}static create(t,n){const s=document.createDocumentFragment();if(t.length===0)return QY(t(),s),s.firstElementChild;if(!n)throw new Error("UIComponent: Initial state is required for statefull components.");let l=n;const u=t,o=h=>(l={...l,...h},QY(u(l),s),l);return o(n),[s.firstElementChild,o]}}const vY=(e,t=!0)=>{let n={};for(const s of e.children){const l=s,u=l.getAttribute("name")||l.getAttribute("label");if(u){if("value"in l){const o=l.value;if(typeof o=="object"&&!Array.isArray(o)&&Object.keys(o).length===0)continue;n[u]=l.value}else if(t){const o=vY(l);if(Object.keys(o).length===0)continue;n[u]=o}}else t&&(n={...n,...vY(l)})}return n},Tk=e=>e==="true"||e==="false"?e==="true":e&&!isNaN(Number(e))&&e.trim()!==""?Number(e):e,vue=[">=","<=","=",">","<","?","/","#"];function _J(e){const t=vue.find(o=>e.split(o).length===2),n=e.split(t).map(o=>o.trim()),[s,l]=n,u=l.startsWith("'")&&l.endsWith("'")?l.replace(/'/g,""):Tk(l);return{key:s,condition:t,value:u}}const GK=e=>{try{const t=[],n=e.split(/&(?![^()]*\))/).map(s=>s.trim());for(const s of n){const l=!s.startsWith("(")&&!s.endsWith(")"),u=s.startsWith("(")&&s.endsWith(")");if(l){const o=_J(s);t.push(o)}if(u){const o={operator:"&",queries:s.replace(/^(\()|(\))$/g,"").split("&").map(h=>h.trim()).map((h,f)=>{const p=_J(h);return f>0&&(p.operator="&"),p})};t.push(o)}}return t}catch{return null}},GJ=(e,t,n)=>{let s=!1;switch(t){case"=":s=e===n;break;case"?":s=String(e).includes(String(n));break;case"<":(typeof e=="number"||typeof n=="number")&&(s=e":(typeof e=="number"||typeof n=="number")&&(s=e>n);break;case">=":(typeof e=="number"||typeof n=="number")&&(s=e>=n);break;case"/":s=String(e).startsWith(String(n));break}return s};var eoe=Object.defineProperty,toe=Object.getOwnPropertyDescriptor,MN=(e,t,n,s)=>{for(var l=s>1?void 0:s?toe(t,n):t,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=(s?o(t,n,l):o(l))||l);return s&&l&&eoe(t,n,l),l};const xne=class extends li{constructor(){super(...arguments),this.checked=!1,this.checkbox=!1,this.noMark=!1,this.vertical=!1}get value(){return this._value!==void 0?this._value:this.label?Tk(this.label):this.label}set value(t){this._value=t}render(){return ks`
${this.img||this.icon||this.label?ks`
${this.checkbox&&!this.noMark?ks`t in e?Yie(e,t,{enumerable:!0,configu `:null}
- `}};_ne.styles=Ei` + `}};xne.styles=Ei` :host { --bim-label--c: var(--bim-ui_bg-contrast-100); display: block; @@ -585,7 +585,7 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu bim-label { pointer-events: none; } - `;let ed=_ne;MN([mn({type:String,reflect:!0})],ed.prototype,"img",2);MN([mn({type:String,reflect:!0})],ed.prototype,"label",2);MN([mn({type:String,reflect:!0})],ed.prototype,"icon",2);MN([mn({type:Boolean,reflect:!0})],ed.prototype,"checked",2);MN([mn({type:Boolean,reflect:!0})],ed.prototype,"checkbox",2);MN([mn({type:Boolean,attribute:"no-mark",reflect:!0})],ed.prototype,"noMark",2);MN([mn({converter:{fromAttribute(e){return e&&yk(e)}}})],ed.prototype,"value",1);MN([mn({type:Boolean,reflect:!0})],ed.prototype,"vertical",2);var ioe=Object.defineProperty,aoe=Object.getOwnPropertyDescriptor,UN=(e,t,n,s)=>{for(var l=s>1?void 0:s?aoe(t,n):t,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=(s?o(t,n,l):o(l))||l);return s&&l&&ioe(t,n,l),l};const Gne=class extends noe{constructor(){super(),this.multiple=!1,this.required=!1,this.vertical=!1,this._inputContainer=wN(),this._listElement=wN(),this._visible=!1,this._value=[],this.onValueChange=new Event("change"),this.onWindowMouseUp=t=>{this.visible&&(this.contains(t.target)||(this.visible=!1))},this.onOptionClick=t=>{const n=t.target,s=this._value.includes(n);if(!this.multiple&&!this.required&&!s)this._value=[n];else if(!this.multiple&&!this.required&&s)this._value=[];else if(!this.multiple&&this.required&&!s)this._value=[n];else if(this.multiple&&!this.required&&!s)this._value=[...this._value,n];else if(this.multiple&&!this.required&&s)this._value=this._value.filter(l=>l!==n);else if(this.multiple&&this.required&&!s)this._value=[...this._value,n];else if(this.multiple&&this.required&&s){const l=this._value.filter(u=>u!==n);l.length!==0&&(this._value=l)}this.updateOptionsState(),this.dispatchEvent(this.onValueChange)},this.useObserver=!0}set visible(t){this._visible=t,t||this.resetVisibleElements()}get visible(){return this._visible}set value(t){if(this.required&&Object.keys(t).length===0)return;const n=[];for(const s of t){const l=this.findOption(s);if(l&&(n.push(l),!this.multiple&&Object.keys(t).length>1))break}this._value=n,this.updateOptionsState(),this.dispatchEvent(this.onValueChange)}get value(){return this._value.filter(t=>t instanceof ed&&t.checked).map(t=>t.value)}get _options(){const t=[...this.elements];for(const n of this.children)n instanceof ed&&t.push(n);return t}onSlotChange(t){const n=t.target.assignedElements();this.observe(n);for(const s of n){if(!(s instanceof ed)){s.remove();continue}s.removeEventListener("click",this.onOptionClick),s.addEventListener("click",this.onOptionClick)}}updateOptionsState(){for(const t of this._options)t instanceof ed&&(this._value.includes(t)?t.checked=!0:t.checked=!1)}findOption(t){return this._options.find(n=>n instanceof ed?n.label===t||n.value===t:!1)}connectedCallback(){super.connectedCallback(),window.addEventListener("mouseup",this.onWindowMouseUp)}firstUpdated(){for(const t of this.children)t instanceof ed&&t.checked&&this._value.push(t)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mouseup",this.onWindowMouseUp)}render(){let t,n,s;if(this._value.length===0)t="Select an option...";else if(this._value.length===1){const l=this._value[0];t=(l==null?void 0:l.label)||(l==null?void 0:l.value),n=l==null?void 0:l.img,s=l==null?void 0:l.icon}else t=`Multiple (${this._value.length})`;return ks` + `;let ed=xne;MN([mn({type:String,reflect:!0})],ed.prototype,"img",2);MN([mn({type:String,reflect:!0})],ed.prototype,"label",2);MN([mn({type:String,reflect:!0})],ed.prototype,"icon",2);MN([mn({type:Boolean,reflect:!0})],ed.prototype,"checked",2);MN([mn({type:Boolean,reflect:!0})],ed.prototype,"checkbox",2);MN([mn({type:Boolean,attribute:"no-mark",reflect:!0})],ed.prototype,"noMark",2);MN([mn({converter:{fromAttribute(e){return e&&Tk(e)}}})],ed.prototype,"value",1);MN([mn({type:Boolean,reflect:!0})],ed.prototype,"vertical",2);var noe=Object.defineProperty,soe=Object.getOwnPropertyDescriptor,UN=(e,t,n,s)=>{for(var l=s>1?void 0:s?soe(t,n):t,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=(s?o(t,n,l):o(l))||l);return s&&l&&noe(t,n,l),l};const Mne=class extends Xue{constructor(){super(),this.multiple=!1,this.required=!1,this.vertical=!1,this._inputContainer=EN(),this._listElement=EN(),this._visible=!1,this._value=[],this.onValueChange=new Event("change"),this.onWindowMouseUp=t=>{this.visible&&(this.contains(t.target)||(this.visible=!1))},this.onOptionClick=t=>{const n=t.target,s=this._value.includes(n);if(!this.multiple&&!this.required&&!s)this._value=[n];else if(!this.multiple&&!this.required&&s)this._value=[];else if(!this.multiple&&this.required&&!s)this._value=[n];else if(this.multiple&&!this.required&&!s)this._value=[...this._value,n];else if(this.multiple&&!this.required&&s)this._value=this._value.filter(l=>l!==n);else if(this.multiple&&this.required&&!s)this._value=[...this._value,n];else if(this.multiple&&this.required&&s){const l=this._value.filter(u=>u!==n);l.length!==0&&(this._value=l)}this.updateOptionsState(),this.dispatchEvent(this.onValueChange)},this.useObserver=!0}set visible(t){this._visible=t,t||this.resetVisibleElements()}get visible(){return this._visible}set value(t){if(this.required&&Object.keys(t).length===0)return;const n=[];for(const s of t){const l=this.findOption(s);if(l&&(n.push(l),!this.multiple&&Object.keys(t).length>1))break}this._value=n,this.updateOptionsState(),this.dispatchEvent(this.onValueChange)}get value(){return this._value.filter(t=>t instanceof ed&&t.checked).map(t=>t.value)}get _options(){const t=[...this.elements];for(const n of this.children)n instanceof ed&&t.push(n);return t}onSlotChange(t){const n=t.target.assignedElements();this.observe(n);for(const s of n){if(!(s instanceof ed)){s.remove();continue}s.removeEventListener("click",this.onOptionClick),s.addEventListener("click",this.onOptionClick)}}updateOptionsState(){for(const t of this._options)t instanceof ed&&(this._value.includes(t)?t.checked=!0:t.checked=!1)}findOption(t){return this._options.find(n=>n instanceof ed?n.label===t||n.value===t:!1)}connectedCallback(){super.connectedCallback(),window.addEventListener("mouseup",this.onWindowMouseUp)}firstUpdated(){for(const t of this.children)t instanceof ed&&t.checked&&this._value.push(t)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mouseup",this.onWindowMouseUp)}render(){let t,n,s;if(this._value.length===0)t="Select an option...";else if(this._value.length===1){const l=this._value[0];t=(l==null?void 0:l.label)||(l==null?void 0:l.value),n=l==null?void 0:l.img,s=l==null?void 0:l.icon}else t=`Multiple (${this._value.length})`;return ks` t in e?Yie(e,t,{enumerable:!0,configu .vertical=${this.vertical} >
this.visible=!this.visible} > @@ -615,12 +615,12 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu
- + ${this.visibleElements.map(l=>l)}
- `}};Gne.styles=[bL.scrollbar,Ei` + `}};Mne.styles=[bL.scrollbar,Ei` :host { --bim-input--bgc: var( --bim-dropdown--bgc, @@ -658,8 +658,8 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu bim-label { pointer-events: none; } - `];let OS=Gne;UN([mn({type:String,reflect:!0})],OS.prototype,"name",2);UN([mn({type:String,reflect:!0})],OS.prototype,"icon",2);UN([mn({type:String,reflect:!0})],OS.prototype,"label",2);UN([mn({type:Boolean,reflect:!0})],OS.prototype,"multiple",2);UN([mn({type:Boolean,reflect:!0})],OS.prototype,"required",2);UN([mn({type:Boolean,reflect:!0})],OS.prototype,"vertical",2);UN([mn({type:Boolean,reflect:!0})],OS.prototype,"visible",1);UN([CV()],OS.prototype,"_value",2);var uoe=Object.defineProperty,Vne=(e,t,n,s)=>{for(var l=void 0,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&uoe(t,n,l),l};const Wne=class extends li{constructor(){super(...arguments),this.floating=!1,this.layouts={}}getUniqueAreasFromTemplate(t){const n=t.split(` -`).map(s=>s.trim()).map(s=>s.split('"')[1]).filter(s=>s!==void 0).flatMap(s=>s.split(/\s+/));return[...new Set(n)].filter(s=>s!=="")}firstUpdated(){this._onLayoutChange=new Event("layoutchange")}render(){if(this.layout){if(this.layouts[this.layout]){this.innerHTML="";const t=this.layouts[this.layout],n=this.getUniqueAreasFromTemplate(t.template).map(s=>{const l=t.elements[s];return l&&(l.style.gridArea=s),l}).filter(s=>!!s);this.style.gridTemplate=t.template,this._onLayoutChange&&this.dispatchEvent(this._onLayoutChange),this.append(...n)}}else this.innerHTML="",this.style.gridTemplate="",this._onLayoutChange&&this.dispatchEvent(this._onLayoutChange);return ks``}};Wne.styles=Ei` + `];let OS=Mne;UN([mn({type:String,reflect:!0})],OS.prototype,"name",2);UN([mn({type:String,reflect:!0})],OS.prototype,"icon",2);UN([mn({type:String,reflect:!0})],OS.prototype,"label",2);UN([mn({type:Boolean,reflect:!0})],OS.prototype,"multiple",2);UN([mn({type:Boolean,reflect:!0})],OS.prototype,"required",2);UN([mn({type:Boolean,reflect:!0})],OS.prototype,"vertical",2);UN([mn({type:Boolean,reflect:!0})],OS.prototype,"visible",1);UN([LV()],OS.prototype,"_value",2);var loe=Object.defineProperty,Une=(e,t,n,s)=>{for(var l=void 0,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&loe(t,n,l),l};const Fne=class extends li{constructor(){super(...arguments),this.floating=!1,this.layouts={}}getUniqueAreasFromTemplate(t){const n=t.split(` +`).map(s=>s.trim()).map(s=>s.split('"')[1]).filter(s=>s!==void 0).flatMap(s=>s.split(/\s+/));return[...new Set(n)].filter(s=>s!=="")}firstUpdated(){this._onLayoutChange=new Event("layoutchange")}render(){if(this.layout){if(this.layouts[this.layout]){this.innerHTML="";const t=this.layouts[this.layout],n=this.getUniqueAreasFromTemplate(t.template).map(s=>{const l=t.elements[s];return l&&(l.style.gridArea=s),l}).filter(s=>!!s);this.style.gridTemplate=t.template,this._onLayoutChange&&this.dispatchEvent(this._onLayoutChange),this.append(...n)}}else this.innerHTML="",this.style.gridTemplate="",this._onLayoutChange&&this.dispatchEvent(this._onLayoutChange);return ks``}};Fne.styles=Ei` :host { display: grid; height: 100%; @@ -688,9 +688,9 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu background-color: var(--bim-ui_bg-contrast-20); gap: 1px; } - `;let LZ=Wne;Vne([mn({type:Boolean,reflect:!0})],LZ.prototype,"floating");Vne([mn({type:String,reflect:!0})],LZ.prototype,"layout");const UK=class extends li{render(){return ks` + `;let UZ=Fne;Une([mn({type:Boolean,reflect:!0})],UZ.prototype,"floating");Une([mn({type:String,reflect:!0})],UZ.prototype,"layout");const VK=class extends li{render(){return ks` - `}};UK.styles=Ei` + `}};VK.styles=Ei` :host { height: var(--bim-icon--fz, var(--bim-ui_size-sm)); width: var(--bim-icon--fz, var(--bim-ui_size-sm)); @@ -701,14 +701,14 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu width: var(--bim-icon--fz, var(--bim-ui_size-sm)); color: var(--bim-icon--c); } - `,UK.properties={icon:{type:String}};let ooe=UK;var coe=Object.defineProperty,wk=(e,t,n,s)=>{for(var l=void 0,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&coe(t,n,l),l};const zne=class extends li{constructor(){super(),this.onValueChange=new Event("change"),this.vertical=!1}get value(){const t={};for(const n of this.children){const s=n;"value"in s?t[s.name||s.label]=s.value:"checked"in s&&(t[s.name||s.label]=s.checked)}return t}set value(t){const n=[...this.children];for(const s in t){const l=n.find(h=>{const f=h;return f.name===s||f.label===s});if(!l)continue;const u=l,o=t[s];typeof o=="boolean"?u.checked=o:u.value=o}}render(){return ks` + `,VK.properties={icon:{type:String}};let roe=VK;var ioe=Object.defineProperty,Rk=(e,t,n,s)=>{for(var l=void 0,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&ioe(t,n,l),l};const Bne=class extends li{constructor(){super(),this.onValueChange=new Event("change"),this.vertical=!1}get value(){const t={};for(const n of this.children){const s=n;"value"in s?t[s.name||s.label]=s.value:"checked"in s&&(t[s.name||s.label]=s.checked)}return t}set value(t){const n=[...this.children];for(const s in t){const l=n.find(h=>{const f=h;return f.name===s||f.label===s});if(!l)continue;const u=l,o=t[s];typeof o=="boolean"?u.checked=o:u.value=o}}render(){return ks`
${this.label||this.icon?ks`${this.label}`:null}
- `}};zne.styles=Ei` + `}};Bne.styles=Ei` :host { flex: 1; display: block; @@ -755,13 +755,13 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu :host(:not([vertical])[label]) .input { max-width: fit-content; } - `;let xV=zne;wk([mn({type:String,reflect:!0})],xV.prototype,"name");wk([mn({type:String,reflect:!0})],xV.prototype,"label");wk([mn({type:String,reflect:!0})],xV.prototype,"icon");wk([mn({type:Boolean,reflect:!0})],xV.prototype,"vertical");var hoe=Object.defineProperty,MV=(e,t,n,s)=>{for(var l=void 0,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&hoe(t,n,l),l};const Yne=class extends li{constructor(){super(...arguments),this.labelHidden=!1,this.iconHidden=!1,this.vertical=!1}get value(){return this.textContent?yk(this.textContent):this.textContent}render(){return ks` + `;let UV=Bne;Rk([mn({type:String,reflect:!0})],UV.prototype,"name");Rk([mn({type:String,reflect:!0})],UV.prototype,"label");Rk([mn({type:String,reflect:!0})],UV.prototype,"icon");Rk([mn({type:Boolean,reflect:!0})],UV.prototype,"vertical");var aoe=Object.defineProperty,FV=(e,t,n,s)=>{for(var l=void 0,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&aoe(t,n,l),l};const Hne=class extends li{constructor(){super(...arguments),this.labelHidden=!1,this.iconHidden=!1,this.vertical=!1}get value(){return this.textContent?Tk(this.textContent):this.textContent}render(){return ks`
${this.img?ks``:null} ${!this.iconHidden&&this.icon?ks``:null}

- `}};Yne.styles=Ei` + `}};Hne.styles=Ei` :host { --bim-icon--c: var(--bim-label--c); color: var(--bim-label--c, var(--bim-ui_bg-contrast-60)); @@ -816,7 +816,7 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu calc(var(--bim-label--fz, var(--bim-ui_size-xs)) * 4) ); } - `;let XM=Yne;MV([mn({type:String,reflect:!0})],XM.prototype,"img");MV([mn({type:Boolean,attribute:"label-hidden",reflect:!0})],XM.prototype,"labelHidden");MV([mn({type:String,reflect:!0})],XM.prototype,"icon");MV([mn({type:Boolean,attribute:"icon-hidden",reflect:!0})],XM.prototype,"iconHidden");MV([mn({type:Boolean,reflect:!0})],XM.prototype,"vertical");var doe=Object.defineProperty,foe=Object.getOwnPropertyDescriptor,pE=(e,t,n,s)=>{for(var l=s>1?void 0:s?foe(t,n):t,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=(s?o(t,n,l):o(l))||l);return s&&l&&doe(t,n,l),l};const kne=class extends li{constructor(){super(...arguments),this._value=0,this.vertical=!1,this.slider=!1,this._input=wN(),this.onValueChange=new Event("change")}set value(t){this.setValue(t.toString())}get value(){return this._value}onChange(t){t.stopPropagation();const{value:n}=this._input;n&&this.setValue(n.value)}setValue(t){const{value:n}=this._input;let s=t;if(s=s.replace(/[^0-9.-]/g,""),s=s.replace(/(\..*)\./g,"$1"),s.endsWith(".")||(s.lastIndexOf("-")>0&&(s=s[0]+s.substring(1).replace(/-/g,"")),s==="-"||s==="-0"))return;let l=Number(s);Number.isNaN(l)||(l=this.min!==void 0?Math.max(l,this.min):l,l=this.max!==void 0?Math.min(l,this.max):l,this.value!==l&&(this._value=l,n&&(n.value=this.value.toString()),this.requestUpdate(),this.dispatchEvent(this.onValueChange)))}onBlur(){const{value:t}=this._input;t&&Number.isNaN(Number(t.value))&&(t.value=this.value.toString())}onSliderMouseDown(t){document.body.style.cursor="w-resize";const{clientX:n}=t,s=this.value;let l=!1;const u=f=>{var p;l=!0;const{clientX:m}=f,R=this.step??1,A=((p=R.toString().split(".")[1])==null?void 0:p.length)||0,N=1/(this.sensitivity??1),B=(m-n)/N;if(Math.floor(Math.abs(B))!==Math.abs(B))return;const Y=s+B*R;this.setValue(Y.toFixed(A))},o=()=>{this.slider=!0,this.removeEventListener("blur",o)},h=()=>{document.removeEventListener("mousemove",u),document.body.style.cursor="default",l?l=!1:(this.addEventListener("blur",o),this.slider=!1,requestAnimationFrame(()=>this.focus())),document.removeEventListener("mouseup",h)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",h)}onFocus(t){t.stopPropagation();const n=s=>{s.key==="Escape"&&(this.blur(),window.removeEventListener("keydown",n))};window.addEventListener("keydown",n)}connectedCallback(){super.connectedCallback(),this.min&&this.min>this.value&&(this._value=this.min),this.max&&this.max{for(var l=s>1?void 0:s?ooe(t,n):t,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=(s?o(t,n,l):o(l))||l);return s&&l&&uoe(t,n,l),l};const _ne=class extends li{constructor(){super(...arguments),this._value=0,this.vertical=!1,this.slider=!1,this._input=EN(),this.onValueChange=new Event("change")}set value(t){this.setValue(t.toString())}get value(){return this._value}onChange(t){t.stopPropagation();const{value:n}=this._input;n&&this.setValue(n.value)}setValue(t){const{value:n}=this._input;let s=t;if(s=s.replace(/[^0-9.-]/g,""),s=s.replace(/(\..*)\./g,"$1"),s.endsWith(".")||(s.lastIndexOf("-")>0&&(s=s[0]+s.substring(1).replace(/-/g,"")),s==="-"||s==="-0"))return;let l=Number(s);Number.isNaN(l)||(l=this.min!==void 0?Math.max(l,this.min):l,l=this.max!==void 0?Math.min(l,this.max):l,this.value!==l&&(this._value=l,n&&(n.value=this.value.toString()),this.requestUpdate(),this.dispatchEvent(this.onValueChange)))}onBlur(){const{value:t}=this._input;t&&Number.isNaN(Number(t.value))&&(t.value=this.value.toString())}onSliderMouseDown(t){document.body.style.cursor="w-resize";const{clientX:n}=t,s=this.value;let l=!1;const u=f=>{var p;l=!0;const{clientX:m}=f,R=this.step??1,A=((p=R.toString().split(".")[1])==null?void 0:p.length)||0,D=1/(this.sensitivity??1),B=(m-n)/D;if(Math.floor(Math.abs(B))!==Math.abs(B))return;const Y=s+B*R;this.setValue(Y.toFixed(A))},o=()=>{this.slider=!0,this.removeEventListener("blur",o)},h=()=>{document.removeEventListener("mousemove",u),document.body.style.cursor="default",l?l=!1:(this.addEventListener("blur",o),this.slider=!1,requestAnimationFrame(()=>this.focus())),document.removeEventListener("mouseup",h)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",h)}onFocus(t){t.stopPropagation();const n=s=>{s.key==="Escape"&&(this.blur(),window.removeEventListener("keydown",n))};window.addEventListener("keydown",n)}connectedCallback(){super.connectedCallback(),this.min&&this.min>this.value&&(this._value=this.min),this.max&&this.maxt in e?Yie(e,t,{enumerable:!0,configu >${this.pref}`:null} t in e?Yie(e,t,{enumerable:!0,configu > ${this.slider?u:t} - `}};kne.styles=Ei` + `}};_ne.styles=Ei` :host { --bim-input--bgc: var( --bim-number-input--bgc, @@ -953,14 +953,14 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu bim-label { pointer-events: none; } - `;let g2=kne;pE([mn({type:String,reflect:!0})],g2.prototype,"name",2);pE([mn({type:String,reflect:!0})],g2.prototype,"icon",2);pE([mn({type:String,reflect:!0})],g2.prototype,"label",2);pE([mn({type:String,reflect:!0})],g2.prototype,"pref",2);pE([mn({type:Number,reflect:!0})],g2.prototype,"min",2);pE([mn({type:Number,reflect:!0})],g2.prototype,"value",1);pE([mn({type:Number,reflect:!0})],g2.prototype,"step",2);pE([mn({type:Number,reflect:!0})],g2.prototype,"sensitivity",2);pE([mn({type:Number,reflect:!0})],g2.prototype,"max",2);pE([mn({type:String,reflect:!0})],g2.prototype,"suffix",2);pE([mn({type:Boolean,reflect:!0})],g2.prototype,"vertical",2);pE([mn({type:Boolean,reflect:!0})],g2.prototype,"slider",2);var Ioe=Object.defineProperty,poe=Object.getOwnPropertyDescriptor,UV=(e,t,n,s)=>{for(var l=s>1?void 0:s?poe(t,n):t,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=(s?o(t,n,l):o(l))||l);return s&&l&&Ioe(t,n,l),l};const jne=class extends li{constructor(){super(...arguments),this.onValueChange=new Event("change"),this._hidden=!1,this.headerHidden=!1,this.activationButton=document.createElement("bim-button")}set hidden(t){this._hidden=t,this.activationButton.active=!t,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}get value(){return ZY(this)}set value(t){const n=[...this.children];for(const s in t){const l=n.find(o=>{const h=o;return h.name===s||h.label===s});if(!l)continue;const u=l;u.value=t[s]}}connectedCallback(){super.connectedCallback(),this.activationButton.active=!this.hidden,this.activationButton.onclick=()=>this.hidden=!this.hidden}disconnectedCallback(){super.disconnectedCallback(),this.activationButton.remove()}collapseSections(){const t=this.querySelectorAll("bim-panel-section");for(const n of t)n.collapsed=!0}expandSections(){const t=this.querySelectorAll("bim-panel-section");for(const n of t)n.collapsed=!1}render(){return this.activationButton.icon=this.icon,this.activationButton.label=this.label||this.name,this.activationButton.tooltipTitle=this.label||this.name,ks` + `;let gw=_ne;yE([mn({type:String,reflect:!0})],gw.prototype,"name",2);yE([mn({type:String,reflect:!0})],gw.prototype,"icon",2);yE([mn({type:String,reflect:!0})],gw.prototype,"label",2);yE([mn({type:String,reflect:!0})],gw.prototype,"pref",2);yE([mn({type:Number,reflect:!0})],gw.prototype,"min",2);yE([mn({type:Number,reflect:!0})],gw.prototype,"value",1);yE([mn({type:Number,reflect:!0})],gw.prototype,"step",2);yE([mn({type:Number,reflect:!0})],gw.prototype,"sensitivity",2);yE([mn({type:Number,reflect:!0})],gw.prototype,"max",2);yE([mn({type:String,reflect:!0})],gw.prototype,"suffix",2);yE([mn({type:Boolean,reflect:!0})],gw.prototype,"vertical",2);yE([mn({type:Boolean,reflect:!0})],gw.prototype,"slider",2);var coe=Object.defineProperty,hoe=Object.getOwnPropertyDescriptor,BV=(e,t,n,s)=>{for(var l=s>1?void 0:s?hoe(t,n):t,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=(s?o(t,n,l):o(l))||l);return s&&l&&coe(t,n,l),l};const Gne=class extends li{constructor(){super(...arguments),this.onValueChange=new Event("change"),this._hidden=!1,this.headerHidden=!1,this.activationButton=document.createElement("bim-button")}set hidden(t){this._hidden=t,this.activationButton.active=!t,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}get value(){return vY(this)}set value(t){const n=[...this.children];for(const s in t){const l=n.find(o=>{const h=o;return h.name===s||h.label===s});if(!l)continue;const u=l;u.value=t[s]}}connectedCallback(){super.connectedCallback(),this.activationButton.active=!this.hidden,this.activationButton.onclick=()=>this.hidden=!this.hidden}disconnectedCallback(){super.disconnectedCallback(),this.activationButton.remove()}collapseSections(){const t=this.querySelectorAll("bim-panel-section");for(const n of t)n.collapsed=!0}expandSections(){const t=this.querySelectorAll("bim-panel-section");for(const n of t)n.collapsed=!1}render(){return this.activationButton.icon=this.icon,this.activationButton.label=this.label||this.name,this.activationButton.tooltipTitle=this.label||this.name,ks`
${this.label||this.name||this.icon?ks`${this.label}`:null}
- `}};jne.styles=[bL.scrollbar,Ei` + `}};Gne.styles=[bL.scrollbar,Ei` :host { display: flex; border-radius: var(--bim-ui_size-base); @@ -1002,7 +1002,7 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu ::slotted(bim-panel-section:not(:last-child)) { border-bottom: 1px solid var(--bim-ui_bg-contrast-20); } - `];let vM=jne;UV([mn({type:String,reflect:!0})],vM.prototype,"icon",2);UV([mn({type:String,reflect:!0})],vM.prototype,"name",2);UV([mn({type:String,reflect:!0})],vM.prototype,"label",2);UV([mn({type:Boolean,reflect:!0})],vM.prototype,"hidden",1);UV([mn({type:Boolean,attribute:"header-hidden",reflect:!0})],vM.prototype,"headerHidden",2);var yoe=Object.defineProperty,FV=(e,t,n,s)=>{for(var l=void 0,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&yoe(t,n,l),l};const qne=class extends li{constructor(){super(...arguments),this.onValueChange=new Event("change")}get value(){return ZY(this)}set value(t){const n=[...this.children];for(const s in t){const l=n.find(o=>{const h=o;return h.name===s||h.label===s});if(!l)continue;const u=l;u.value=t[s]}}onHeaderClick(){this.fixed||(this.collapsed=!this.collapsed)}render(){const t=this.label||this.icon||this.name||this.fixed,n=ks`{for(var l=void 0,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&doe(t,n,l),l};const Vne=class extends li{constructor(){super(...arguments),this.onValueChange=new Event("change")}get value(){return vY(this)}set value(t){const n=[...this.children];for(const s in t){const l=n.find(o=>{const h=o;return h.name===s||h.label===s});if(!l)continue;const u=l;u.value=t[s]}}onHeaderClick(){this.fixed||(this.collapsed=!this.collapsed)}render(){const t=this.label||this.icon||this.name||this.fixed,n=ks`t in e?Yie(e,t,{enumerable:!0,configu
- `}};qne.styles=[bL.scrollbar,Ei` + `}};Vne.styles=[bL.scrollbar,Ei` :host { display: block; /* height: 100%; */ @@ -1099,7 +1099,7 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu bim-label { pointer-events: none; } - `];let eU=qne;FV([mn({type:String,reflect:!0})],eU.prototype,"icon");FV([mn({type:String,reflect:!0})],eU.prototype,"label");FV([mn({type:String,reflect:!0})],eU.prototype,"name");FV([mn({type:Boolean,reflect:!0})],eU.prototype,"fixed");FV([mn({type:Boolean,reflect:!0})],eU.prototype,"collapsed");var woe=Object.defineProperty,BV=(e,t,n,s)=>{for(var l=void 0,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&woe(t,n,l),l};const Kne=class extends li{constructor(){super(...arguments),this.vertical=!1,this.onValueChange=new Event("change"),this._canEmitEvents=!1,this._value=document.createElement("bim-option"),this.onOptionClick=t=>{this._value=t.target,this.dispatchEvent(this.onValueChange);for(const n of this.children)n instanceof ed&&(n.checked=n===t.target)}}get _options(){return[...this.querySelectorAll("bim-option")]}set value(t){const n=this.findOption(t);if(n){for(const s of this._options)s.checked=s===n;this._value=n,this._canEmitEvents&&this.dispatchEvent(this.onValueChange)}}get value(){return this._value.value}onSlotChange(t){const n=t.target.assignedElements();for(const s of n)s instanceof ed&&(s.noMark=!0,s.removeEventListener("click",this.onOptionClick),s.addEventListener("click",this.onOptionClick))}findOption(t){return this._options.find(n=>n instanceof ed?n.label===t||n.value===t:!1)}firstUpdated(){const t=[...this.children].find(n=>n instanceof ed&&n.checked);t&&(this._value=t)}render(){return ks` + `];let tU=Vne;HV([mn({type:String,reflect:!0})],tU.prototype,"icon");HV([mn({type:String,reflect:!0})],tU.prototype,"label");HV([mn({type:String,reflect:!0})],tU.prototype,"name");HV([mn({type:Boolean,reflect:!0})],tU.prototype,"fixed");HV([mn({type:Boolean,reflect:!0})],tU.prototype,"collapsed");var foe=Object.defineProperty,_V=(e,t,n,s)=>{for(var l=void 0,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&foe(t,n,l),l};const Wne=class extends li{constructor(){super(...arguments),this.vertical=!1,this.onValueChange=new Event("change"),this._canEmitEvents=!1,this._value=document.createElement("bim-option"),this.onOptionClick=t=>{this._value=t.target,this.dispatchEvent(this.onValueChange);for(const n of this.children)n instanceof ed&&(n.checked=n===t.target)}}get _options(){return[...this.querySelectorAll("bim-option")]}set value(t){const n=this.findOption(t);if(n){for(const s of this._options)s.checked=s===n;this._value=n,this._canEmitEvents&&this.dispatchEvent(this.onValueChange)}}get value(){return this._value.value}onSlotChange(t){const n=t.target.assignedElements();for(const s of n)s instanceof ed&&(s.noMark=!0,s.removeEventListener("click",this.onOptionClick),s.addEventListener("click",this.onOptionClick))}findOption(t){return this._options.find(n=>n instanceof ed?n.label===t||n.value===t:!1)}firstUpdated(){const t=[...this.children].find(n=>n instanceof ed&&n.checked);t&&(this._value=t)}render(){return ks` t in e?Yie(e,t,{enumerable:!0,configu > - `}};Kne.styles=Ei` + `}};Wne.styles=Ei` :host { --bim-input--bgc: var(--bim-ui_bg-contrast-20); --bim-input--g: 0; @@ -1124,14 +1124,14 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu --bim-label--c: white; background-color: var(--bim-ui_color-main); } - `;let tU=Kne;BV([mn({type:String,reflect:!0})],tU.prototype,"name");BV([mn({type:String,reflect:!0})],tU.prototype,"icon");BV([mn({type:String,reflect:!0})],tU.prototype,"label");BV([mn({type:Boolean,reflect:!0})],tU.prototype,"vertical");BV([CV()],tU.prototype,"_value");var Eoe=Object.defineProperty,moe=(e,t,n,s)=>{for(var l=void 0,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&Eoe(t,n,l),l};const Qne=class extends li{constructor(){super(...arguments),this.columnIndex=0,this.rowData={}}get data(){return this.column?this.rowData[this.column]:null}render(){return ks` + `;let nU=Wne;_V([mn({type:String,reflect:!0})],nU.prototype,"name");_V([mn({type:String,reflect:!0})],nU.prototype,"icon");_V([mn({type:String,reflect:!0})],nU.prototype,"label");_V([mn({type:Boolean,reflect:!0})],nU.prototype,"vertical");_V([LV()],nU.prototype,"_value");var Ioe=Object.defineProperty,poe=(e,t,n,s)=>{for(var l=void 0,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&Ioe(t,n,l),l};const zne=class extends li{constructor(){super(...arguments),this.column="",this.columnIndex=0,this.rowData={}}get data(){return this.column?this.rowData[this.column]:null}render(){return ks` - `}};Qne.styles=Ei` + `}};zne.styles=Ei` :host { padding: 0.25rem 1rem; display: flex; @@ -1162,9 +1162,9 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu white-space: normal; text-align: center; } - `;let Zne=Qne;moe([mn({type:String,reflect:!0})],Zne.prototype,"column");var Toe=Object.defineProperty,Roe=(e,t,n,s)=>{for(var l=void 0,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&Toe(t,n,l),l};const $ne=class extends li{constructor(){super(...arguments),this._groups=[],this.data=[],this.table=this.closest("bim-table")}toggleGroups(t,n=!1){for(const s of this._groups)s.childrenHidden=typeof t>"u"?!s.childrenHidden:!t,n&&s.toggleChildren(t,n)}render(){return this._groups=[],ks` + `;let Yne=zne;poe([mn({type:String,reflect:!0})],Yne.prototype,"column");var yoe=Object.defineProperty,woe=(e,t,n,s)=>{for(var l=void 0,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&yoe(t,n,l),l};const kne=class extends li{constructor(){super(...arguments),this._groups=[],this.data=[],this.table=this.closest("bim-table")}toggleGroups(t,n=!1){for(const s of this._groups)s.childrenHidden=typeof t>"u"?!s.childrenHidden:!t,n&&s.toggleChildren(t,n)}render(){return this._groups=[],ks` ${this.data.map(t=>{const n=document.createElement("bim-table-group");return this._groups.push(n),n.table=this.table,n.data=t,n})} - `}};$ne.styles=Ei` + `}};kne.styles=Ei` :host { position: relative; grid-area: Children; @@ -1173,19 +1173,19 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu :host([hidden]) { display: none; } - `;let Jne=$ne;Roe([mn({type:Array,attribute:!1})],Jne.prototype,"data");var goe=Object.defineProperty,Aoe=(e,t,n,s)=>{for(var l=void 0,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&goe(t,n,l),l};const Xne=class extends li{constructor(){super(...arguments),this.data={data:{}},this.childrenHidden=!0,this.table=this.closest("bim-table")}connectedCallback(){super.connectedCallback(),this.table&&this.table.expanded?this.childrenHidden=!1:this.childrenHidden=!0}toggleChildren(t,n=!1){this._children&&(this.childrenHidden=typeof t>"u"?!this.childrenHidden:!t,n&&this._children.toggleGroups(t,n))}render(){var t,n;const s=((t=this.table)==null?void 0:t.getGroupIndentation(this.data))??0,l=ks` + `;let jne=kne;woe([mn({type:Array,attribute:!1})],jne.prototype,"data");var Eoe=Object.defineProperty,moe=(e,t,n,s)=>{for(var l=void 0,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&Eoe(t,n,l),l};const qne=class extends li{constructor(){super(...arguments),this.data={data:{}},this.childrenHidden=!0,this.table=this.closest("bim-table")}connectedCallback(){super.connectedCallback(),this.table&&this.table.expanded?this.childrenHidden=!1:this.childrenHidden=!0}toggleChildren(t,n=!1){this._children&&(this.childrenHidden=typeof t>"u"?!this.childrenHidden:!t,n&&this._children.toggleGroups(t,n))}render(){var t,n;const s=((t=this.table)==null?void 0:t.getGroupIndentation(this.data))??0,l=ks`
- `,u=document.createElement("div");u.classList.add("branch","branch-horizontal"),u.style.left=`${s-1+.5625}rem`;const o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("height","9.5"),o.setAttribute("width","7.5"),o.setAttribute("viewBox","0 0 4.6666672 7.3333333");const h=document.createElementNS("http://www.w3.org/2000/svg","path");h.setAttribute("d","m 1.7470835,6.9583848 2.5899999,-2.59 c 0.39,-0.39 0.39,-1.02 0,-1.41 L 1.7470835,0.36838483 c -0.63,-0.62000003 -1.71000005,-0.18 -1.71000005,0.70999997 v 5.17 c 0,0.9 1.08000005,1.34 1.71000005,0.71 z"),o.append(h);const f=document.createElementNS("http://www.w3.org/2000/svg","svg");f.setAttribute("height","6.5"),f.setAttribute("width","9.5"),f.setAttribute("viewBox","0 0 5.9111118 5.0175439");const p=document.createElementNS("http://www.w3.org/2000/svg","path");p.setAttribute("d","M -0.33616196,1.922522 2.253838,4.5125219 c 0.39,0.39 1.02,0.39 1.41,0 L 6.2538379,1.922522 c 0.6200001,-0.63 0.18,-1.71000007 -0.7099999,-1.71000007 H 0.37383804 c -0.89999997,0 -1.33999997,1.08000007 -0.71,1.71000007 z"),f.append(p);const m=document.createElement("div");m.addEventListener("click",()=>this.toggleChildren()),m.classList.add("caret"),m.style.left=`${.125+s}rem`,this.childrenHidden?m.append(o):m.append(f);const R=document.createElement("bim-table-row");R.table=this.table,R.data=this.data.data,(n=this.table)==null||n.dispatchEvent(new CustomEvent("rowcreated",{detail:{row:R}})),this.data.children&&R.append(m),s!==0&&(!this.data.children||this.childrenHidden)&&R.append(u);let A;return this.data.children&&(A=document.createElement("bim-table-children"),this._children=A,A.table=this.table,A.data=this.data.children),ks` + `,u=document.createElement("div");u.classList.add("branch","branch-horizontal"),u.style.left=`${s-1+.5625}rem`;const o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("height","9.5"),o.setAttribute("width","7.5"),o.setAttribute("viewBox","0 0 4.6666672 7.3333333");const h=document.createElementNS("http://www.w3.org/2000/svg","path");h.setAttribute("d","m 1.7470835,6.9583848 2.5899999,-2.59 c 0.39,-0.39 0.39,-1.02 0,-1.41 L 1.7470835,0.36838483 c -0.63,-0.62000003 -1.71000005,-0.18 -1.71000005,0.70999997 v 5.17 c 0,0.9 1.08000005,1.34 1.71000005,0.71 z"),o.append(h);const f=document.createElementNS("http://www.w3.org/2000/svg","svg");f.setAttribute("height","6.5"),f.setAttribute("width","9.5"),f.setAttribute("viewBox","0 0 5.9111118 5.0175439");const p=document.createElementNS("http://www.w3.org/2000/svg","path");p.setAttribute("d","M -0.33616196,1.922522 2.253838,4.5125219 c 0.39,0.39 1.02,0.39 1.41,0 L 6.2538379,1.922522 c 0.6200001,-0.63 0.18,-1.71000007 -0.7099999,-1.71000007 H 0.37383804 c -0.89999997,0 -1.33999997,1.08000007 -0.71,1.71000007 z"),f.append(p);const m=document.createElement("div");m.addEventListener("click",D=>{D.stopPropagation(),this.toggleChildren()}),m.classList.add("caret"),m.style.left=`${.125+s}rem`,this.childrenHidden?m.append(o):m.append(f);const R=document.createElement("bim-table-row");R.table=this.table,R.data=this.data.data,(n=this.table)==null||n.dispatchEvent(new CustomEvent("rowcreated",{detail:{row:R}})),this.data.children&&R.append(m),s!==0&&(!this.data.children||this.childrenHidden)&&R.append(u);let A;return this.data.children&&(A=document.createElement("bim-table-children"),this._children=A,A.table=this.table,A.data=this.data.children),ks`
${this.data.children&&!this.childrenHidden?l:null} ${R} ${this.childrenHidden?null:A}
- `}};Xne.styles=Ei` + `}};qne.styles=Ei` :host { position: relative; } @@ -1228,34 +1228,24 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu .caret svg { fill: var(--bim-ui_bg-contrast-60); } - `;let vne=Xne;Aoe([mn({type:Boolean,attribute:"children-hidden",reflect:!0})],vne.prototype,"childrenHidden");/** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */const kJ=e=>Bae(e)?e._$litType$.h:e.strings,Soe=gZ(class extends AZ{constructor(e){super(e),this.et=new WeakMap}render(e){return[e]}update(e,[t]){const n=mJ(this.it)?kJ(this.it):null,s=mJ(t)?kJ(t):null;if(n!==null&&(s===null||n!==s)){const l=AJ(e).pop();let u=this.et.get(n);if(u===void 0){const o=document.createDocumentFragment();u=kY(vo,o),u.setConnected(!1),this.et.set(n,u)}gJ(u,[l]),RJ(u,void 0,l)}if(s!==null){if(n===null||n!==s){const l=this.et.get(s);if(l!==void 0){const u=AJ(l).pop();Gae(e),RJ(e,void 0,u),gJ(e,[u])}}this.it=t}else this.it=void 0;return this.render(t)}});var Doe=Object.defineProperty,HV=(e,t,n,s)=>{for(var l=void 0,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&Doe(t,n,l),l};const ese=class extends li{constructor(){super(...arguments),this.columns=[],this.hiddenColumns=[],this.data={},this.isHeader=!1,this._table=this.closest("bim-table"),this.onTableIndentationColorChange=t=>{var n;if(!this.table)return;const s=t.detail,{indentationLevel:l,color:u}=s;((n=this.table)==null?void 0:n.getRowIndentation(this.data))===l&&(this.style.backgroundColor=u)},this.onTableColumnsChange=()=>{this.table&&(this.columns=this.table.columns)},this.onTableColumnsHidden=()=>{this.table&&(this.hiddenColumns=this.table.hiddenColumns)},this._observer=new IntersectionObserver(t=>{this._intersecting=t[0].isIntersecting},{rootMargin:"36px"})}get _columnNames(){return this.columns.filter(t=>!this.hiddenColumns.includes(t.name)).map(t=>t.name)}get _columnWidths(){return this.columns.filter(t=>!this.hiddenColumns.includes(t.name)).map(t=>t.width)}set table(t){this._table&&(this.columns=[],this.hiddenColumns=[],this._table.removeEventListener("columnschange",this.onTableColumnsChange),this._table.removeEventListener("columnshidden",this.onTableColumnsHidden)),this._table=t,this._table&&(this.columns=this._table.columns,this.hiddenColumns=this._table.hiddenColumns,this._table.addEventListener("columnschange",this.onTableColumnsChange),this._table.addEventListener("columnshidden",this.onTableColumnsHidden),this._table.addEventListener("indentation",this.onTableIndentationColorChange))}get table(){return this._table}connectedCallback(){super.connectedCallback(),this._observer.observe(this)}compute(){var t,n;const s=((t=this.table)==null?void 0:t.getRowIndentation(this.data))??0,l=this.isHeader?this.data:((n=this.table)==null?void 0:n.computeRowDeclaration(this.data))??this.data,u=[];for(const o in l){if(this.hiddenColumns.includes(o))continue;const h=l[o];let f;typeof h=="string"||typeof h=="boolean"||typeof h=="number"?f=ks`${h}`:f=h;const p=` - ${this._columnNames.indexOf(o)===0&&!this.isHeader?`margin-left: ${s+.125}rem`:""} - `,m=ks` - {if(!R)return;const A=R,N=this._columnNames.indexOf(o);A.setAttribute("data-column-index",String(N)),A.toggleAttribute("data-cell-header",this.isHeader),A.rowData=this.data,setTimeout(()=>{var B;(B=this.table)==null||B.dispatchEvent(new CustomEvent("cellcreated",{detail:{cell:A}}))})})} style="${p}" .column=${o} - >${f} - `;u.push(m)}return this.style.gridTemplateAreas=`"${this._columnNames.join(" ")}"`,this.style.gridTemplateColumns=`${this._columnWidths.join(" ")}`,ks` - ${u} + `;let Kne=qne;moe([mn({type:Boolean,attribute:"children-hidden",reflect:!0})],Kne.prototype,"childrenHidden");var Toe=Object.defineProperty,GV=(e,t,n,s)=>{for(var l=void 0,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=o(t,n,l)||l);return l&&Toe(t,n,l),l};const Qne=class extends li{constructor(){super(...arguments),this.columns=[],this.hiddenColumns=[],this.data={},this.isHeader=!1,this.table=this.closest("bim-table"),this.onTableColumnsChange=()=>{this.table&&(this.columns=this.table.columns)},this.onTableColumnsHidden=()=>{this.table&&(this.hiddenColumns=this.table.hiddenColumns)},this._observer=new IntersectionObserver(t=>{this._intersecting=t[0].isIntersecting},{rootMargin:"36px"})}get _columnNames(){return this.columns.filter(t=>!this.hiddenColumns.includes(t.name)).map(t=>t.name)}get _columnWidths(){return this.columns.filter(t=>!this.hiddenColumns.includes(t.name)).map(t=>t.width)}connectedCallback(){super.connectedCallback(),this._observer.observe(this),this.table&&(this.columns=this.table.columns,this.hiddenColumns=this.table.hiddenColumns,this.table.addEventListener("columnschange",this.onTableColumnsChange),this.table.addEventListener("columnshidden",this.onTableColumnsHidden))}disconnectedCallback(){super.disconnectedCallback(),this._observer.unobserve(this),this.table&&(this.columns=[],this.hiddenColumns=[],this.table.removeEventListener("columnschange",this.onTableColumnsChange),this.table.removeEventListener("columnshidden",this.onTableColumnsHidden))}compute(){var t,n,s;const l=((t=this.table)==null?void 0:t.getRowIndentation(this.data))??0,u=this.isHeader?this.data:((n=this.table)==null?void 0:n.computeRowDeclaration(this.data))??this.data,o=[];for(const h in u){if(this.hiddenColumns.includes(h))continue;const f=u[h];let p;if(typeof f=="string"||typeof f=="boolean"||typeof f=="number"?(p=document.createElement("bim-label"),p.textContent=String(f)):f instanceof HTMLElement?p=f:(p=document.createDocumentFragment(),QY(f,p)),!p)continue;const m=document.createElement("bim-table-cell");m.append(p),m.column=h,this._columnNames.indexOf(h)===0&&!this.isHeader&&(m.style.marginLeft=`${l+.125}rem`);const R=this._columnNames.indexOf(h);m.setAttribute("data-column-index",String(R)),m.toggleAttribute("data-cell-header",this.isHeader),m.rowData=this.data,(s=this.table)==null||s.dispatchEvent(new CustomEvent("cellcreated",{detail:{cell:m}})),o.push(m)}return this.style.gridTemplateAreas=`"${this._columnNames.join(" ")}"`,this.style.gridTemplateColumns=`${this._columnWidths.join(" ")}`,ks` + ${o} - `}render(){return ks`${Soe(this._intersecting?this.compute():ks``)}`}};ese.styles=Ei` + `}render(){return ks`${this._intersecting?this.compute():ks``}`}};Qne.styles=Ei` :host { position: relative; grid-area: Data; display: grid; min-height: 2.25rem; } - `;let nU=ese;HV([mn({attribute:!1})],nU.prototype,"columns");HV([mn({attribute:!1})],nU.prototype,"hiddenColumns");HV([mn({attribute:!1})],nU.prototype,"data");HV([mn({type:Boolean,attribute:"is-header",reflect:!0})],nU.prototype,"isHeader");HV([CV()],nU.prototype,"_intersecting");var Noe=Object.defineProperty,Ooe=Object.getOwnPropertyDescriptor,sU=(e,t,n,s)=>{for(var l=s>1?void 0:s?Ooe(t,n):t,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=(s?o(t,n,l):o(l))||l);return s&&l&&Noe(t,n,l),l};const tse=class extends li{constructor(){super(...arguments),this._columnsChange=new Event("columnschange"),this._filteredData=[],this.headersHidden=!1,this.minColWidth="4rem",this._columns=[],this._textDelimiters={comma:",",tab:" "},this._queryString=null,this._data=[],this.expanded=!1,this.preserveStructureOnFilter=!1,this.indentationInText=!1,this.dataTransform={},this._onColumnsHidden=new Event("columnshidden"),this._hiddenColumns=[],this._stringFilterFunction=(t,n)=>Object.values(n.data).some(s=>String(s).toLowerCase().includes(t.toLowerCase())),this._queryFilterFunction=(t,n)=>{let s=!1;const l=MK(t)??[];for(const u of l){if("queries"in u){s=!1;break}const{condition:o,value:h}=u;let{key:f}=u;if(f.startsWith("[")&&f.endsWith("]")){const p=f.replace("[","").replace("]","");f=p,s=Object.keys(n.data).filter(m=>m.includes(p)).map(m=>YJ(n.data[m],o,h)).some(m=>m)}else s=YJ(n.data[f],o,h);if(!s)break}return s}}set columns(t){const n=[];for(const s of t){const l=typeof s=="string"?{name:s,width:`minmax(${this.minColWidth}, 1fr)`}:s;n.push(l)}this._columns=n,this.computeMissingColumns(this.data),this.dispatchEvent(this._columnsChange)}get columns(){return this._columns}get _headerRowData(){const t={};for(const n of this.columns)if(typeof n=="string")t[n]=n;else{const{name:s}=n;t[s]=s}return t}get value(){return this._filteredData}set queryString(t){this._queryString=t&&t.trim()!==""?t.trim():null,this.updateFilteredData()}get queryString(){return this._queryString}set data(t){this._data=t,this.updateFilteredData(),this.computeMissingColumns(t)&&(this.columns=this._columns)}get data(){return this._data}get dataAsync(){return new Promise(t=>{setTimeout(()=>{t(this.data)})})}set hiddenColumns(t){this._hiddenColumns=t,setTimeout(()=>{this.dispatchEvent(this._onColumnsHidden)})}get hiddenColumns(){return this._hiddenColumns}updateFilteredData(){this.queryString?(MK(this.queryString)?(this.filterFunction=this._queryFilterFunction,this._filteredData=this.filter(this.queryString)):(this.filterFunction=this._stringFilterFunction,this._filteredData=this.filter(this.queryString)),this.preserveStructureOnFilter&&(this._expandedBeforeFilter===void 0&&(this._expandedBeforeFilter=this.expanded),this.expanded=!0)):(this.preserveStructureOnFilter&&this._expandedBeforeFilter!==void 0&&(this.expanded=this._expandedBeforeFilter,this._expandedBeforeFilter=void 0),this._filteredData=this.data)}computeMissingColumns(t){let n=!1;for(const s of t){const{children:l,data:u}=s;for(const o in u)this._columns.map(h=>typeof h=="string"?h:h.name).includes(o)||(this._columns.push({name:o,width:`minmax(${this.minColWidth}, 1fr)`}),n=!0);if(l){const o=this.computeMissingColumns(l);o&&!n&&(n=o)}}return n}generateText(t="comma",n=this.value,s="",l=!0){const u=this._textDelimiters[t];let o="";const h=this.columns.map(f=>f.name);if(l){this.indentationInText&&(o+=`Indentation${u}`);const f=`${h.join(u)} -`;o+=f}for(const[f,p]of n.entries()){const{data:m,children:R}=p,A=this.indentationInText?`${s}${f+1}${u}`:"",N=h.map(Y=>m[Y]??""),B=`${A}${N.join(u)} -`;o+=B,R&&(o+=this.generateText(t,p.children,`${s}${f+1}.`,!1))}return o}get csv(){return this.generateText("comma")}get tsv(){return this.generateText("tab")}computeRowDeclaration(t){const n={};for(const s in t){const l=this.dataTransform[s];l?n[s]=l(t[s],t):n[s]=t[s]}return n}downloadData(t="BIM Table Data",n="json"){let s=null;if(n==="json"&&(s=new File([JSON.stringify(this.value,void 0,2)],`${t}.json`)),n==="csv"&&(s=new File([this.csv],`${t}.csv`)),n==="tsv"&&(s=new File([this.tsv],`${t}.tsv`)),!s)return;const l=document.createElement("a");l.href=URL.createObjectURL(s),l.download=s.name,l.click(),URL.revokeObjectURL(l.href)}getRowIndentation(t,n=this.value,s=0){for(const l of n){if(l.data===t)return s;if(l.children){const u=this.getRowIndentation(t,l.children,s+1);if(u!==null)return u}}return null}getGroupIndentation(t,n=this.value,s=0){for(const l of n){if(l===t)return s;if(l.children){const u=this.getGroupIndentation(t,l.children,s+1);if(u!==null)return u}}return null}setIndentationColor(t,n){const s=new CustomEvent("indentation",{detail:{indentationLevel:t,color:n}});this.dispatchEvent(s)}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new Event("connected"))}disconnectedCallback(){super.disconnectedCallback(),this.dispatchEvent(new Event("disconnected"))}filter(t,n=this.filterFunction??this._stringFilterFunction,s=this.data){const l=[];for(const u of s)if(n(t,u)){if(this.preserveStructureOnFilter){const o={data:u.data};if(u.children){const h=this.filter(t,n,u.children);h.length&&(o.children=h)}l.push(o)}else if(l.push({data:u.data}),u.children){const o=this.filter(t,n,u.children);l.push(...o)}}else if(u.children){const o=this.filter(t,n,u.children);this.preserveStructureOnFilter&&o.length?l.push({data:u.data,children:o}):l.push(...o)}return l}render(){const t=document.createElement("bim-table-row");t.table=this,t.isHeader=!0,t.data=this._headerRowData,t.style.gridArea="Header",t.style.position="sticky",t.style.top="0",t.style.zIndex="5";const n=document.createElement("bim-table-children");return n.table=this,n.data=this.value,n.style.gridArea="Body",n.style.backgroundColor="transparent",ks` + `;let sU=Qne;GV([mn({attribute:!1})],sU.prototype,"columns");GV([mn({attribute:!1})],sU.prototype,"hiddenColumns");GV([mn({attribute:!1})],sU.prototype,"data");GV([mn({type:Boolean,attribute:"is-header",reflect:!0})],sU.prototype,"isHeader");GV([LV()],sU.prototype,"_intersecting");var Roe=Object.defineProperty,goe=Object.getOwnPropertyDescriptor,lU=(e,t,n,s)=>{for(var l=s>1?void 0:s?goe(t,n):t,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=(s?o(t,n,l):o(l))||l);return s&&l&&Roe(t,n,l),l};const Zne=class extends li{constructor(){super(...arguments),this._columnsChange=new Event("columnschange"),this._filteredData=[],this.headersHidden=!1,this.minColWidth="4rem",this._columns=[],this._textDelimiters={comma:",",tab:" "},this._queryString=null,this._data=[],this.expanded=!1,this.preserveStructureOnFilter=!1,this.indentationInText=!1,this.dataTransform={},this._onColumnsHidden=new Event("columnshidden"),this._hiddenColumns=[],this._stringFilterFunction=(t,n)=>Object.values(n.data).some(s=>String(s).toLowerCase().includes(t.toLowerCase())),this._queryFilterFunction=(t,n)=>{let s=!1;const l=GK(t)??[];for(const u of l){if("queries"in u){s=!1;break}const{condition:o,value:h}=u;let{key:f}=u;if(f.startsWith("[")&&f.endsWith("]")){const p=f.replace("[","").replace("]","");f=p,s=Object.keys(n.data).filter(m=>m.includes(p)).map(m=>GJ(n.data[m],o,h)).some(m=>m)}else s=GJ(n.data[f],o,h);if(!s)break}return s}}set columns(t){const n=[];for(const s of t){const l=typeof s=="string"?{name:s,width:`minmax(${this.minColWidth}, 1fr)`}:s;n.push(l)}this._columns=n,this.computeMissingColumns(this.data),this.dispatchEvent(this._columnsChange)}get columns(){return this._columns}get _headerRowData(){const t={};for(const n of this.columns)if(typeof n=="string")t[n]=n;else{const{name:s}=n;t[s]=s}return t}get value(){return this._filteredData}set queryString(t){this._queryString=t&&t.trim()!==""?t.trim():null,this.updateFilteredData()}get queryString(){return this._queryString}set data(t){this._data=t,this.updateFilteredData(),this.computeMissingColumns(t)&&(this.columns=this._columns)}get data(){return this._data}get dataAsync(){return new Promise(t=>{setTimeout(()=>{t(this.data)})})}set hiddenColumns(t){this._hiddenColumns=t,setTimeout(()=>{this.dispatchEvent(this._onColumnsHidden)})}get hiddenColumns(){return this._hiddenColumns}updateFilteredData(){this.queryString?(GK(this.queryString)?(this.filterFunction=this._queryFilterFunction,this._filteredData=this.filter(this.queryString)):(this.filterFunction=this._stringFilterFunction,this._filteredData=this.filter(this.queryString)),this.preserveStructureOnFilter&&(this._expandedBeforeFilter===void 0&&(this._expandedBeforeFilter=this.expanded),this.expanded=!0)):(this.preserveStructureOnFilter&&this._expandedBeforeFilter!==void 0&&(this.expanded=this._expandedBeforeFilter,this._expandedBeforeFilter=void 0),this._filteredData=this.data)}computeMissingColumns(t){let n=!1;for(const s of t){const{children:l,data:u}=s;for(const o in u)this._columns.map(h=>typeof h=="string"?h:h.name).includes(o)||(this._columns.push({name:o,width:`minmax(${this.minColWidth}, 1fr)`}),n=!0);if(l){const o=this.computeMissingColumns(l);o&&!n&&(n=o)}}return n}generateText(t="comma",n=this.value,s="",l=!0){const u=this._textDelimiters[t];let o="";const h=this.columns.map(f=>f.name);if(l){this.indentationInText&&(o+=`Indentation${u}`);const f=`${h.join(u)} +`;o+=f}for(const[f,p]of n.entries()){const{data:m,children:R}=p,A=this.indentationInText?`${s}${f+1}${u}`:"",D=h.map(Y=>m[Y]??""),B=`${A}${D.join(u)} +`;o+=B,R&&(o+=this.generateText(t,p.children,`${s}${f+1}.`,!1))}return o}get csv(){return this.generateText("comma")}get tsv(){return this.generateText("tab")}computeRowDeclaration(t){const n={};for(const s in t){const l=this.dataTransform[s];l?n[s]=l(t[s],t):n[s]=t[s]}return n}downloadData(t="BIM Table Data",n="json"){let s=null;if(n==="json"&&(s=new File([JSON.stringify(this.value,void 0,2)],`${t}.json`)),n==="csv"&&(s=new File([this.csv],`${t}.csv`)),n==="tsv"&&(s=new File([this.tsv],`${t}.tsv`)),!s)return;const l=document.createElement("a");l.href=URL.createObjectURL(s),l.download=s.name,l.click(),URL.revokeObjectURL(l.href)}getRowIndentation(t,n=this.value,s=0){for(const l of n){if(l.data===t)return s;if(l.children){const u=this.getRowIndentation(t,l.children,s+1);if(u!==null)return u}}return null}getGroupIndentation(t,n=this.value,s=0){for(const l of n){if(l===t)return s;if(l.children){const u=this.getGroupIndentation(t,l.children,s+1);if(u!==null)return u}}return null}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new Event("connected"))}disconnectedCallback(){super.disconnectedCallback(),this.dispatchEvent(new Event("disconnected"))}filter(t,n=this.filterFunction??this._stringFilterFunction,s=this.data){const l=[];for(const u of s)if(n(t,u)){if(this.preserveStructureOnFilter){const o={data:u.data};if(u.children){const h=this.filter(t,n,u.children);h.length&&(o.children=h)}l.push(o)}else if(l.push({data:u.data}),u.children){const o=this.filter(t,n,u.children);l.push(...o)}}else if(u.children){const o=this.filter(t,n,u.children);this.preserveStructureOnFilter&&o.length?l.push({data:u.data,children:o}):l.push(...o)}return l}render(){const t=document.createElement("bim-table-row");t.table=this,t.isHeader=!0,t.data=this._headerRowData,t.style.gridArea="Header",t.style.position="sticky",t.style.top="0",t.style.zIndex="5";const n=document.createElement("bim-table-children");return n.table=this,n.data=this.value,n.style.gridArea="Body",n.style.backgroundColor="transparent",ks`
${this.headersHidden?null:t}
${n}
- `}};tse.styles=[bL.scrollbar,Ei` + `}};Zne.styles=[bL.scrollbar,Ei` :host { --bim-button--bgc: transparent; position: relative; @@ -1288,7 +1278,7 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu flex-wrap: wrap; margin-bottom: 0.5rem; } - `];let LL=tse;sU([CV()],LL.prototype,"_filteredData",2);sU([mn({type:Boolean,attribute:"headers-hidden",reflect:!0})],LL.prototype,"headersHidden",2);sU([mn({type:String,attribute:"min-col-width",reflect:!0})],LL.prototype,"minColWidth",2);sU([mn({type:Array,attribute:!1})],LL.prototype,"columns",1);sU([mn({type:Array,attribute:!1})],LL.prototype,"data",1);sU([mn({type:Boolean,reflect:!0})],LL.prototype,"expanded",2);var Coe=Object.defineProperty,boe=Object.getOwnPropertyDescriptor,Ek=(e,t,n,s)=>{for(var l=s>1?void 0:s?boe(t,n):t,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=(s?o(t,n,l):o(l))||l);return s&&l&&Coe(t,n,l),l};const nse=class extends li{constructor(){super(...arguments),this._defaultName="__unnamed__",this.name=this._defaultName,this._hidden=!1}set hidden(t){this._hidden=t,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}connectedCallback(){super.connectedCallback();const{parentElement:t}=this;if(t&&this.name===this._defaultName){const n=[...t.children].indexOf(this);this.name=`${this._defaultName}${n}`}}render(){return ks` `}};nse.styles=Ei` + `];let LL=Zne;lU([LV()],LL.prototype,"_filteredData",2);lU([mn({type:Boolean,attribute:"headers-hidden",reflect:!0})],LL.prototype,"headersHidden",2);lU([mn({type:String,attribute:"min-col-width",reflect:!0})],LL.prototype,"minColWidth",2);lU([mn({type:Array,attribute:!1})],LL.prototype,"columns",1);lU([mn({type:Array,attribute:!1})],LL.prototype,"data",1);lU([mn({type:Boolean,reflect:!0})],LL.prototype,"expanded",2);var Aoe=Object.defineProperty,Soe=Object.getOwnPropertyDescriptor,gk=(e,t,n,s)=>{for(var l=s>1?void 0:s?Soe(t,n):t,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=(s?o(t,n,l):o(l))||l);return s&&l&&Aoe(t,n,l),l};const $ne=class extends li{constructor(){super(...arguments),this._defaultName="__unnamed__",this.name=this._defaultName,this._hidden=!1}set hidden(t){this._hidden=t,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}connectedCallback(){super.connectedCallback();const{parentElement:t}=this;if(t&&this.name===this._defaultName){const n=[...t.children].indexOf(this);this.name=`${this._defaultName}${n}`}}render(){return ks` `}};$ne.styles=Ei` :host { display: block; height: 100%; @@ -1297,14 +1287,14 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu :host([hidden]) { display: none; } - `;let Yw=nse;Ek([mn({type:String,reflect:!0})],Yw.prototype,"name",2);Ek([mn({type:String,reflect:!0})],Yw.prototype,"label",2);Ek([mn({type:String,reflect:!0})],Yw.prototype,"icon",2);Ek([mn({type:Boolean,reflect:!0})],Yw.prototype,"hidden",1);var Loe=Object.defineProperty,Poe=Object.getOwnPropertyDescriptor,_V=(e,t,n,s)=>{for(var l=s>1?void 0:s?Poe(t,n):t,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=(s?o(t,n,l):o(l))||l);return s&&l&&Loe(t,n,l),l};const sse=class extends li{constructor(){super(...arguments),this._switchers=[],this.bottom=!1,this.switchersHidden=!1,this.floating=!1,this.onTabHiddenChange=t=>{const n=t.target;n instanceof Yw&&!n.hidden&&(n.removeEventListener("hiddenchange",this.onTabHiddenChange),this.tab=n.name,n.addEventListener("hiddenchange",this.onTabHiddenChange))}}set tab(t){this._tab=t;const n=[...this.children],s=n.find(l=>l instanceof Yw&&l.name===t);for(const l of n){if(!(l instanceof Yw))continue;l.hidden=s!==l;const u=this.getTabSwitcher(l.name);u&&u.toggleAttribute("data-active",!l.hidden)}}get tab(){return this._tab}getTabSwitcher(t){return this._switchers.find(n=>n.getAttribute("data-name")===t)}createSwitchers(){this._switchers=[];for(const t of this.children){if(!(t instanceof Yw))continue;const n=document.createElement("div");n.addEventListener("click",()=>{this.tab===t.name?this.toggleAttribute("tab",!1):this.tab=t.name}),n.setAttribute("data-name",t.name),n.className="switcher";const s=document.createElement("bim-label");s.textContent=t.label??"",s.icon=t.icon,n.append(s),this._switchers.push(n)}}onSlotChange(t){this.createSwitchers();const n=t.target.assignedElements(),s=n.find(l=>l instanceof Yw?this.tab?l.name===this.tab:!l.hidden:!1);s&&s instanceof Yw&&(this.tab=s.name);for(const l of n){if(!(l instanceof Yw)){l.remove();continue}l.removeEventListener("hiddenchange",this.onTabHiddenChange),s!==l&&(l.hidden=!0),l.addEventListener("hiddenchange",this.onTabHiddenChange)}}render(){return ks` + `;let Y2=$ne;gk([mn({type:String,reflect:!0})],Y2.prototype,"name",2);gk([mn({type:String,reflect:!0})],Y2.prototype,"label",2);gk([mn({type:String,reflect:!0})],Y2.prototype,"icon",2);gk([mn({type:Boolean,reflect:!0})],Y2.prototype,"hidden",1);var Doe=Object.defineProperty,Noe=Object.getOwnPropertyDescriptor,VV=(e,t,n,s)=>{for(var l=s>1?void 0:s?Noe(t,n):t,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=(s?o(t,n,l):o(l))||l);return s&&l&&Doe(t,n,l),l};const Jne=class extends li{constructor(){super(...arguments),this._switchers=[],this.bottom=!1,this.switchersHidden=!1,this.floating=!1,this.onTabHiddenChange=t=>{const n=t.target;n instanceof Y2&&!n.hidden&&(n.removeEventListener("hiddenchange",this.onTabHiddenChange),this.tab=n.name,n.addEventListener("hiddenchange",this.onTabHiddenChange))}}set tab(t){this._tab=t;const n=[...this.children],s=n.find(l=>l instanceof Y2&&l.name===t);for(const l of n){if(!(l instanceof Y2))continue;l.hidden=s!==l;const u=this.getTabSwitcher(l.name);u&&u.toggleAttribute("data-active",!l.hidden)}}get tab(){return this._tab}getTabSwitcher(t){return this._switchers.find(n=>n.getAttribute("data-name")===t)}createSwitchers(){this._switchers=[];for(const t of this.children){if(!(t instanceof Y2))continue;const n=document.createElement("div");n.addEventListener("click",()=>{this.tab===t.name?this.toggleAttribute("tab",!1):this.tab=t.name}),n.setAttribute("data-name",t.name),n.className="switcher";const s=document.createElement("bim-label");s.textContent=t.label??"",s.icon=t.icon,n.append(s),this._switchers.push(n)}}onSlotChange(t){this.createSwitchers();const n=t.target.assignedElements(),s=n.find(l=>l instanceof Y2?this.tab?l.name===this.tab:!l.hidden:!1);s&&s instanceof Y2&&(this.tab=s.name);for(const l of n){if(!(l instanceof Y2)){l.remove();continue}l.removeEventListener("hiddenchange",this.onTabHiddenChange),s!==l&&(l.hidden=!0),l.addEventListener("hiddenchange",this.onTabHiddenChange)}}render(){return ks`
${this._switchers}
- `}};sse.styles=[bL.scrollbar,Ei` + `}};Jne.styles=[bL.scrollbar,Ei` * { box-sizing: border-box; } @@ -1409,11 +1399,11 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu border-radius: var(--bim-ui_size-2xs); background-color: var(--bim-ui_bg-base); } - `];let lU=sse;_V([CV()],lU.prototype,"_switchers",2);_V([mn({type:Boolean,reflect:!0})],lU.prototype,"bottom",2);_V([mn({type:Boolean,attribute:"switchers-hidden",reflect:!0})],lU.prototype,"switchersHidden",2);_V([mn({type:Boolean,reflect:!0})],lU.prototype,"floating",2);_V([mn({type:String,reflect:!0})],lU.prototype,"tab",1);/** + `];let rU=Jne;VV([LV()],rU.prototype,"_switchers",2);VV([mn({type:Boolean,reflect:!0})],rU.prototype,"bottom",2);VV([mn({type:Boolean,attribute:"switchers-hidden",reflect:!0})],rU.prototype,"switchersHidden",2);VV([mn({type:Boolean,reflect:!0})],rU.prototype,"floating",2);VV([mn({type:String,reflect:!0})],rU.prototype,"tab",1);/** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const xoe=e=>e??vo;var Moe=Object.defineProperty,Uoe=Object.getOwnPropertyDescriptor,FN=(e,t,n,s)=>{for(var l=s>1?void 0:s?Uoe(t,n):t,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=(s?o(t,n,l):o(l))||l);return s&&l&&Moe(t,n,l),l};const lse=class extends li{constructor(){super(...arguments),this._inputTypes=["date","datetime-local","email","month","password","search","tel","text","time","url","week"],this.value="",this.vertical=!1,this._type="text",this.onValueChange=new Event("input")}set type(t){this._inputTypes.includes(t)&&(this._type=t)}get type(){return this._type}get query(){return MK(this.value)}onInputChange(t){t.stopPropagation();const n=t.target;clearTimeout(this._debounceTimeoutID),this._debounceTimeoutID=setTimeout(()=>{this.value=n.value,this.dispatchEvent(this.onValueChange)},this.debounce)}render(){return ks` + */const Ooe=e=>e??Nc;var Coe=Object.defineProperty,boe=Object.getOwnPropertyDescriptor,FN=(e,t,n,s)=>{for(var l=s>1?void 0:s?boe(t,n):t,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=(s?o(t,n,l):o(l))||l);return s&&l&&Coe(t,n,l),l};const Xne=class extends li{constructor(){super(...arguments),this._inputTypes=["date","datetime-local","email","month","password","search","tel","text","time","url","week"],this.value="",this.vertical=!1,this._type="text",this.onValueChange=new Event("input")}set type(t){this._inputTypes.includes(t)&&(this._type=t)}get type(){return this._type}get query(){return GK(this.value)}onInputChange(t){t.stopPropagation();const n=t.target;clearTimeout(this._debounceTimeoutID),this._debounceTimeoutID=setTimeout(()=>{this.value=n.value,this.dispatchEvent(this.onValueChange)},this.debounce)}render(){return ks` t in e?Yie(e,t,{enumerable:!0,configu aria-label=${this.label||this.name||"Checkbox Input"} .type=${this.type} .value=${this.value} - placeholder=${xoe(this.placeholder)} + placeholder=${Ooe(this.placeholder)} @input=${this.onInputChange} /> - `}};lse.styles=Ei` + `}};Xne.styles=Ei` :host { --bim-input--bgc: var(--bim-ui_bg-contrast-20); flex: 1; @@ -1453,7 +1443,7 @@ var Yie=Object.defineProperty,kie=(e,t,n)=>t in e?Yie(e,t,{enumerable:!0,configu /* :host([disabled]) { --bim-input--bgc: var(--bim-ui_bg-contrast-20); } */ - `;let CS=lse;FN([mn({type:String,reflect:!0})],CS.prototype,"icon",2);FN([mn({type:String,reflect:!0})],CS.prototype,"label",2);FN([mn({type:String,reflect:!0})],CS.prototype,"name",2);FN([mn({type:String,reflect:!0})],CS.prototype,"placeholder",2);FN([mn({type:String,reflect:!0})],CS.prototype,"value",2);FN([mn({type:Boolean,reflect:!0})],CS.prototype,"vertical",2);FN([mn({type:Number,reflect:!0})],CS.prototype,"debounce",2);FN([mn({type:String,reflect:!0})],CS.prototype,"type",1);var Foe=Object.defineProperty,Boe=Object.getOwnPropertyDescriptor,rse=(e,t,n,s)=>{for(var l=s>1?void 0:s?Boe(t,n):t,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=(s?o(t,n,l):o(l))||l);return s&&l&&Foe(t,n,l),l};const ise=class extends li{constructor(){super(...arguments),this.rows=2,this._vertical=!1}set vertical(t){this._vertical=t,this.updateChildren()}get vertical(){return this._vertical}updateChildren(){const t=this.children;for(const n of t)this.vertical?n.setAttribute("label-hidden",""):n.removeAttribute("label-hidden")}render(){return ks` + `;let CS=Xne;FN([mn({type:String,reflect:!0})],CS.prototype,"icon",2);FN([mn({type:String,reflect:!0})],CS.prototype,"label",2);FN([mn({type:String,reflect:!0})],CS.prototype,"name",2);FN([mn({type:String,reflect:!0})],CS.prototype,"placeholder",2);FN([mn({type:String,reflect:!0})],CS.prototype,"value",2);FN([mn({type:Boolean,reflect:!0})],CS.prototype,"vertical",2);FN([mn({type:Number,reflect:!0})],CS.prototype,"debounce",2);FN([mn({type:String,reflect:!0})],CS.prototype,"type",1);var Loe=Object.defineProperty,Poe=Object.getOwnPropertyDescriptor,vne=(e,t,n,s)=>{for(var l=s>1?void 0:s?Poe(t,n):t,u=e.length-1,o;u>=0;u--)(o=e[u])&&(l=(s?o(t,n,l):o(l))||l);return s&&l&&Loe(t,n,l),l};const ese=class extends li{constructor(){super(...arguments),this.rows=2,this._vertical=!1}set vertical(t){this._vertical=t,this.updateChildren()}get vertical(){return this._vertical}updateChildren(){const t=this.children;for(const n of t)this.vertical?n.setAttribute("label-hidden",""):n.removeAttribute("label-hidden")}render(){return ks`