@qaecy/cue-ui 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[426],{6426(en,se,_){_.d(se,{BIMFragmentsViewer:()=>Kt});var l=_(5802),u=_(7705),g=_(2271),B=_(8807),f=_(467),v=_(4784),h=_(4701),C=_(8158);let L=(()=>{class i extends v.uA{static uuid="ab45d0a7-feea-4afc-927c-80832dae76dd";enabled=!0;_fragments=null;set fragments(t){this._fragments=t}geometries=new C.jp;get(t,n){var o=this;return(0,f.A)(function*(){const{material:s,coordinate:a,applyTransformation:c}={coordinate:!0,applyTransformation:!0,...n},d=new C.jp;for(const[m,p]of Object.entries(t)){const y=o._fragments.models.list.get(m);if(!y)continue;const b=o.getModelMeshes(m);for(const M of p){let T=d.get(m);T||(T=new C.jp,d.set(m,T));let w=b.get(M);if(w&&w.length>0){const R=[];for(const[,{geometry:I}]of w.entries()){const X=yield o.createMesh(y,I,{material:s,applyTransformation:c,coordinate:a});R.push(X)}T.set(M,R);continue}w=[],b.set(M,w);const[ie]=yield y.getItemsGeometry([M]);if(!ie)continue;const oe=[];for(const R of ie){const I=o.createGeometry(R);if(!I)continue;const{geometry:X}=I;w.push(I);const qt=yield o.createMesh(y,X,{material:s,applyTransformation:c,coordinate:a});oe.push(qt)}T.set(M,oe)}}return d})()}getModelMeshes(t){let n=this.geometries.get(t);return n||(n=new C.jp,this.geometries.set(t,n)),n}remove(t=[...this.geometries.keys()]){for(const n of t){const o=this.geometries.get(n);if(o){for(const[,s]of o)for(const{geometry:a}of s)a.dispose();this.geometries.delete(n)}}}onDisposed=new v.Jh;dispose(t=!0){this.remove(),t&&this.geometries.dispose(),this.onDisposed.trigger(i.uuid)}getMeshesFromResult(t){const n=[];for(const o of t.values())for(const s of o.values())n.push(...s);return n}createGeometry(t){const{positions:n,indices:o,normals:s,transform:a}=t;if(!(n&&o&&s))return null;const c=new h.LoY;return c.setAttribute("position",new h.THS(n,3)),c.setAttribute("normal",new h.THS(s,3,!0)),c.setIndex(new h.THS(o,1)),c.applyMatrix4(a),{geometry:c,transform:a}}createMesh(t,n,o){var s=this;return(0,f.A)(function*(){const{material:a,applyTransformation:c,coordinate:d}={applyTransformation:!0,coordinate:!0,...o},m=s.components.get(v.HB),p=new h.eaF(n,a);if(p.applyMatrix4(t.object.matrixWorld),c||p.position.set(0,0,0),d&&m.baseCoordinationModel!==t.modelId){const y=yield t.getCoordinationMatrix();m.applyBaseCoordinateSystem(p,y)}return p})()}}return i})(),O=(()=>{class i extends v.uA{static uuid="2695289f-e6c1-4980-919e-88b7591d7ea3";enabled=!0;originalColors=new Map;_ghostColor=new h.Q1f("white");_ghostedMaterials=[];set ghostColor(t){this._ghostColor=t}_ghostApplied=!1;get ghostApplied(){return this._ghostApplied}_world;set world(t){this._world=t,this._initEventListeners()}get ghostedMaterials(){return this._ghostedMaterials}_fragments;set fragments(t){this._fragments=t,this._initEventListeners()}onDisposed=new v.Jh;constructor(t){super(t)}dispose(){this.onDisposed.trigger(i.uuid),this._ghostedMaterials=[]}setModelTransparent(t){const n=[...t.models.materials.list.values()];for(const o of n){if(o.userData.customId)continue;let s;s="color"in o?o.color.getHex():o.lodColor.getHex(),this.originalColors.set(o,{color:s,transparent:o.transparent,opacity:o.opacity}),o.transparent=!0,o.opacity=.05,o.needsUpdate=!0,"color"in o?o.color=this._ghostColor:o.lodColor=this._ghostColor,this._ghostedMaterials.push(o)}this._ghostApplied=!0}restoreModelMaterials(){for(const[t,n]of this.originalColors){const{color:o,transparent:s,opacity:a}=n;t.transparent=s,t.opacity=a,"color"in t?t.color.setHex(o):t.lodColor.setHex(o),t.needsUpdate=!0}this.originalColors.clear(),this._ghostedMaterials=[],this._ghostApplied=!1}toggleGhost(t){this.originalColors.size?this.restoreModelMaterials():this.setModelTransparent(t)}_initEventListeners(){void 0!==this._world&&void 0!==this._fragments&&(this._world.camera.controls.addEventListener("rest",()=>{this.enabled?this.setModelTransparent(this._fragments):this.restoreModelMaterials()}),this._fragments.models.list.onItemSet.add(({value:t})=>{console.log(`Model ${t.modelId} is ready`),setTimeout(()=>{this.enabled?(console.log("GHOST"),this.setModelTransparent(this._fragments)):this.restoreModelMaterials()},1500)}))}}return i})();var re=_(9904);const Y=(i,r)=>{const t={...i};return Object.keys(r).forEach(n=>{t[n]=new Set([...t[n]||[],...r[n]])}),t},H=function(){var i=(0,f.A)(function*(r,t,n,o={}){const s=[];for(const[,d]of t.models.list){const m=yield d.raycast(n);if(m){const p={};p[d.modelId]=new Set,p[d.modelId].add(m.localId),s.push({...m,idMap:p})}}if(0===s.length)return W(t,o,!0),null;let a=s[0],c=a.distance;for(let d=1;d<s.length;d++)s[d].distance<c&&(c=s[d].distance,console.log(c),a=s[d]);return r.get(O).ghostApplied&&!((i,r)=>{if(null===r)return!1;let t=!1;return Object.keys(i).forEach(n=>{r[n].forEach(o=>{i[n].has(o)&&(t=!0)})}),t})(r.get(re.T).colorOverrides,a.idMap)?(W(t,o=Y(o,a.idMap),!1),H(r,t,n,o)):a});return function(t,n,o){return i.apply(this,arguments)}}();function W(i,r,t){for(const n of Object.keys(r))i.models.list.get(n)?.setVisible([...r[n]],t)}class de{hoveredElement=new v.Jh}let $=(()=>{class i extends v.uA{static uuid="26fbd870-b1b2-4b71-b747-4063d484de1b";HOVERER_OPACITY_KEY="_maxHoverOpacity";_hoverTimeout=null;_meshes=new C.PG;_localId=null;_fadeAnimation=null;_world=null;_fragments=null;set world(t){if(t){this._world=t,this.setupEvents(!0);for(const n of this._meshes)t.scene.three.add(n)}else{this.setupEvents(!1),this._world=null;for(const n of this._meshes)n.removeFromParent()}}get world(){return this._world}events=new de;set fragments(t){this._fragments=t}_enabled=!1;set enabled(t){this.setupEvents(t),this._enabled=t}get enabled(){return this._enabled}_material=new h.V9B({color:16777215,transparent:!0,opacity:.5,depthTest:!1,userData:{[this.HOVERER_OPACITY_KEY]:.5}});set material(t){t.userData[this.HOVERER_OPACITY_KEY]=t.opacity;for(const n of this._meshes)n.material=t;this._material.dispose(),this._material=t}get material(){return this._material}onDisposed=new v.Jh;duration=200;animation=!0;constructor(t){super(t),t.add(i.uuid,this),this._meshes.onBeforeDelete.add(n=>{n.removeFromParent(),n.geometry.dispose(),this._setCursor(!1)}),this._meshes.onItemAdded.add(n=>{this.world&&(this._setCursor(!0),this.world.scene.three.add(n))}),this._meshes.onCleared.add(()=>{this._localId=null,this._hoverTimeout&&(clearTimeout(this._hoverTimeout),this._hoverTimeout=null)})}setupEvents(t){if(!this.world||this.world.isDisposing)return;if(!this.world.renderer)throw new Error("The given world doesn't have a renderer!");const n=this.world.renderer.three.domElement;n.removeEventListener("mousemove",this.onMouseMove),n.removeEventListener("mouseleave",this.onMouseMove),t&&(n.addEventListener("mousemove",this.onMouseMove),n.addEventListener("mouseleave",this.onMouseLeave))}mouseStopTimeout=null;onMouseMove=t=>{null!==this.mouseStopTimeout&&clearTimeout(this.mouseStopTimeout),this.mouseStopTimeout=window.setTimeout(()=>this.hover(t),50)};onMouseLeave=()=>{this._meshes.clear()};animate=()=>{if(!(this._fadeAnimation&&this.animation&&this.material.transparent))return;const{startTime:t,duration:n,fadeIn:o}=this._fadeAnimation,s=Date.now()-t,a=Math.min(s/n,1),d=this.material.userData[this.HOVERER_OPACITY_KEY];this.material.opacity=(o?a:1-a)*(void 0!==d?d:1),a<1?requestAnimationFrame(this.animate):(o||this._meshes.clear(),this._fadeAnimation=null)};hover(t){var n=this;return(0,f.A)(function*(){if(!n.enabled||!n.world||!n._fragments)return;const o=new h.I9Y(t.clientX,t.clientY),s=yield H(n.components,n._fragments,{camera:n.world.camera.three,mouse:o,dom:n.world.renderer.three.domElement});if(!s)return n._meshes.clear(),void n.events.hoveredElement.trigger(null);if(n.components.get(O).ghostApplied&&!(yield s.fragments.getHighlightItemIds()).includes(s.localId))return console.log("Not a highlighted object!"),void n.events.hoveredElement.trigger(null);n.events.hoveredElement.trigger(s);const{fragments:a,localId:c}=s;n._localId!==c&&(n._meshes.clear(),n._localId=c,n._hoverTimeout=window.setTimeout((0,f.A)(function*(){const d={[a.modelId]:new Set([c])},m=n.components.get(L);m.fragments=n._fragments;const p=yield m.get(d);for(const[,y]of p.entries()){const b=[...y.values()].flat();for(const M of b)M.material=n.material,M.position.set(0,0,0),M.rotation.set(0,0,0),M.scale.set(1,1,1),M.applyMatrix4(a.object.matrixWorld),n._meshes.add(M)}n._fadeAnimation={startTime:Date.now(),duration:n.duration,fadeIn:!0},n.animate()}),100))})()}_setCursor(t){const n=this._world.renderer?.three.domElement;n&&(n.style.cursor=t?"pointer":"default")}clear(){this._meshes.clear()}dispose(){this._enabled=!1,this._meshes.clear(),this._fadeAnimation=null,this._hoverTimeout=null,this.onDisposed.trigger()}}return i})();var ue=_(9595);const me=function(){var i=(0,f.A)(function*(r,t){const n=Object.keys(t)[0];if(n&&r.models.list.get(n)){const o=r.models.list.get(n),[s]=yield o.getItemsData([...t[n]],{attributesDefault:!1,attributes:["Name","NominalValue"],relations:{IsDefinedBy:{attributes:!0,relations:!0},DefinesOcurrence:{attributes:!1,relations:!1}}});return s||null}return null});return function(t,n){return i.apply(this,arguments)}}();var j=_(1452);class pe{clickedElement=new v.Jh;clickedCanvas=new v.Jh;selection=new v.Jh}let Q=(()=>{class i extends v.uA{static uuid="b7e0b697-172f-43db-b530-d775a2a34d55";HIGHLIGHT_ID="cue_selection";enabled=!0;multiSelect=!1;resetOnCanvasClick=!0;_fragments=null;set fragments(t){this._fragments=t}hoveredElement=null;selectedElements=null;set styles(t){const n=this.components.get(j.TF);n.fillOpacity=t.fillOpacity,n.fillColor=t.fillColor,n.color=t.outlineColor}onDisposed=new v.Jh;events=new pe;constructor(t){super(t),this._initEventListeners()}dispose(){this.hoveredElement=null,this.selectedElements=null,this.onDisposed.trigger(i.uuid)}_initEventListeners(){var t=this;this.components.get($).events.hoveredElement.add(function(){var s=(0,f.A)(function*(a){if(!a)return void(t.hoveredElement=null);const c=a.localId,d=a.fragments.modelId;t.hoveredElement={[d]:new Set([c])}});return function(a){return s.apply(this,arguments)}}()),ue.B.getInstance().events.addListener("shortPressedLeft",(0,f.A)(function*(){if(!t.enabled)return;const s=t.components.get(j.TF);s.clean();const a=t.hoveredElement;if(!a)return t.resetOnCanvasClick&&(t.selectedElements=null,t.events.selection.trigger(null),s.clean()),void t.events.clickedCanvas.trigger();const c=yield me(t._fragments,a);c&&t.events.clickedElement.trigger(c);const d=Object.keys(a)[0],m=[...a[d]][0];let p=t.selectedElements?Object.assign({},t.selectedElements):null;p=t.multiSelect?p?t.resetOnCanvasClick&&p&&p[d]?.has(m)?((i,r)=>{const t={...i};return Object.keys(r).forEach(n=>{const o=r[n];t[n]&&(t[n]=new Set([...t[n]||[]].filter(s=>!o.has(s))),0===t[n].size&&delete t[n])}),0===Object.keys(t).length?null:t})(p,a):Y(p,a):a:t.resetOnCanvasClick&&p&&p[d]?.has(m)?null:a,t.selectedElements=p,t.events.selection.trigger(p),p?s.addItems(p):s.clean()}))}}return i})(),he=(()=>{class i extends v.uA{_world;_fragments;set world(t){this._world=t,t&&this.getRenderer().postproduction.excludedObjectsPass.addExcludedMaterial(this._points.material)}get world(){return this._world}set fragments(t){this._fragments=t}styles=new C.PG;outlinePositions=!1;_mesh=null;get _points(){return this._mesh||(this._mesh=new h.ONl(new h.LoY,new h.BH$({size:10,sizeAttenuation:!1,depthTest:!1}))),this._mesh}get enabled(){return!(!this.world||this.world.isDisposing)&&this.getRenderer().postproduction.outlinesEnabled}set enabled(t){this.world&&!this.world.isDisposing&&(this.getRenderer().postproduction.outlinesEnabled=t,this.outlinePositions&&(this._points.material.color=this.color,this.world.scene.three.add(this._points)))}get color(){return this.getRenderer().postproduction.outlinePass.outlineColor}set color(t){this.getRenderer().postproduction.outlinePass.outlineColor.copy(t),this._points.material.color.copy(t)}get thickness(){return this.getRenderer().postproduction.outlinePass.thickness}set thickness(t){this.getRenderer().postproduction.outlinePass.thickness=t}get fillColor(){return this.getRenderer().postproduction.outlinePass.fillColor}set fillColor(t){this.getRenderer().postproduction.outlinePass.fillColor.copy(t)}get fillOpacity(){return this.getRenderer().postproduction.outlinePass.fillOpacity}set fillOpacity(t){this.getRenderer().postproduction.outlinePass.fillOpacity=t}onDisposed=new v.Jh;static uuid="2fd3bcc5-b3b6-4ded-9f64-f47a02854a10";_meshes=[];_map={};_activeStyles=new Set;constructor(t){super(t),t.add(i.uuid,this)}update(){var t=this;return(0,f.A)(function*(n=t._map){if(n===t._map&&t.cleanMeshes(),t.outlinePositions&&t.updatePoints(),0===Object.keys(n).length)return;const s=t.getRenderer().postproduction.outlinePass,c=yield t.components.get(L).get(n);for(const d of Object.keys(n)){const m=t._fragments?.models.list.get(d);if(m)for(const[,p]of c.entries()){const y=[...p.values()].flat();for(const b of y)b.position.set(0,0,0),b.rotation.set(0,0,0),b.scale.set(1,1,1),b.applyMatrix4(m.object.matrixWorld),t._meshes.push(b),s.scene.add(b)}}}).apply(this,arguments)}addItems(t){var n=this;return(0,f.A)(function*(){v.OS.add(n._map,t),yield n.update(t)})()}removeItems(t){var n=this;return(0,f.A)(function*(){v.OS.remove(n._map,t),yield n.update()})()}clean(){this._map={},this._activeStyles.clear(),this.cleanMeshes(),this._mesh&&this.components.get(v.W_).destroy(this._mesh,!0,!0),this._mesh=null}dispose(){this.styles.clear(),this.clean(),this.onDisposed.trigger(i.uuid)}cleanMeshes(){for(const t of this._meshes)t.removeFromParent();this._meshes=[]}updatePoints(){var t=this;return(0,f.A)(function*(){let n=0;for(const[,a]of Object.entries(t._map))n+=a.size;t._points.geometry.setAttribute("position",new h.qtW(new Float32Array(3*n),3));const s=yield t.components.get(v.HB).getPositions(t._map);for(let a=0;a<s.length;a++){const{x:c,y:d,z:m}=s[a];t._points.geometry.attributes.position.array[3*a]=c,t._points.geometry.attributes.position.array[3*a+1]=d,t._points.geometry.attributes.position.array[3*a+2]=m}t._points.geometry.attributes.position.needsUpdate=!0})()}getRenderer(){if(!this.world)throw new Error("You must set a world to use the outliner!");const t=this.world.renderer;if(!t.postproduction)throw new Error("The world given to the outliner must use the postproduction renderer.");return t}}return i})();var E=_(2147);const fe={"#e2f552":"accent","#2859e1":"primary","#1744c2":"secondary","#ffffff":"default","#8394b0":"fade"},ve={accent:new h.Q1f("#2859e1"),primary:new h.Q1f("#1744c2"),secondary:new h.Q1f("#2859e1"),default:new h.Q1f("#e2f552"),fade:new h.Q1f("#e2f552")},be={accent:new h.Q1f("#e2f552"),primary:new h.Q1f("#1744c2"),secondary:new h.Q1f("#1744c2"),default:new h.Q1f("#1744c2"),fade:new h.Q1f("#1744c2")},ye={accent:new h.Q1f("#2859e1"),primary:new h.Q1f("#e2f552"),secondary:new h.Q1f("#e2f552"),default:new h.Q1f("#e2f552"),fade:new h.Q1f("#e2f552")},xe=i=>{const r=new h.Q1f(i),n=.299*r.r+.587*r.g+.114*r.b>.5?.75:1.25;return new h.Q1f(Math.min(r.r*n,1),Math.min(r.g*n,1),Math.min(r.b*n,1))};function Ce(i){let r="";return r=i.LongName?.value?i.LongName.value:i.Name?.value?i.Name.value:i.type||"(no name)",`${r} [${i._category.value}]`}function Z(i,r,t){return G.apply(this,arguments)}function G(){return(G=(0,f.A)(function*(i,r,t){console.log(r);const n=yield i.getItemsData(r,{relations:{Decomposes:{attributes:!0,relations:!0}}});console.log(n),void 0===t.children&&(t.children=[]);for(const o of n){const s=[];for(const a of o.Decomposes||[]){const c=a._localId.value,d=yield i.getItemsData([c],{relations:{IsDecomposedBy:{attributes:!0,relations:!0}}});console.log(d);const m={id:c,label:Ce(a)};yield Z(i,[c],m),s.push(m)}t.children.push(...s)}})).apply(this,arguments)}function N(){return(N=(0,f.A)(function*(i,r){const t=yield i.getItemsOfCategories([/IFCSITE/]),n={label:r,children:[]};yield Z(i,t.IFCSITE,n),console.log(n)})).apply(this,arguments)}let z=(()=>{class i{_workerUrl=(0,l.WQX)(E.g$);_container=(0,l.vPA)(void 0);modelsAreLoading=(0,l.vPA)(!1);settings=(0,l.vPA)(new B.R_);_previousHighlights=null;raycastResult=(0,l.vPA)(null);hoveredElement=(0,g.EW)(()=>{const t=this.raycastResult()?.localId??null,n=this.raycastResult()?.fragments.modelId??null;return n&&t?{[n]:new Set([t])}:null},{equal:(t,n)=>((i,r)=>{if(!i&&!r)return!0;if(!i||!r)return!1;const t=Object.keys(i),n=Object.keys(r);if(t.length!==n.length||t[0]!==n[0])return!1;const o=i[t[0]],s=r[n[0]];if(o.size!==s.size)return!1;const a=Array.from(o.values()),c=Array.from(s.values());return a[0]===c[0]})(t,n)});clickedElement=(0,l.vPA)(null);selectedElements=(0,l.vPA)(null);init(t){this._container.set(t)}_colorDef=(0,g.EW)(()=>{const t=this._container();if(t)return(i=>{const t=window.getComputedStyle(i).getPropertyValue("--background-color"),n=fe[t];return{hoverColor:ve[n]??new h.Q1f("#e2f552"),selectionColor:be[n]??new h.Q1f("#1744c2"),selectionOutlineColor:ye[n]??new h.Q1f("#e2f552"),ghostColor:xe(t)}})(t)});_loadedModels=(0,l.vPA)([]);_components=(0,g.EW)(()=>{if(void 0!==this._container())return console.info("Building components..."),new v.XF});_world=(0,g.EW)(()=>{const t=this._components(),n=this._container();if(void 0!==t&&void 0!==n)return console.info("Setting up scene..."),((i,r)=>{const n=i.get(v.mg).create();n.scene=new v.VS(i),n.scene.setup(),n.scene.three.background=null,n.renderer=new j.Hs(i,r);const{postproduction:o}=n.renderer;return n.camera=new v.g2(i),i.init(),n.scene.setup(),o.enabled=!0,n.scene.three.background=null,n.camera.controls.restThreshold=.25,n})(t,n)});_fragments=(0,g.EW)(()=>{const t=this._world();if(void 0===t)return;const n=this._components();return void 0!==n?(console.info("Setting up fragments..."),(0,E.bI)(n,t,this._workerUrl)):void 0});viewerReady=(0,g.EW)(()=>!(void 0===this._components()||void 0===this._world()||void 0===this._fragments()));get loadedModels(){return this._loadedModels}constructor(){(0,l.QZP)(()=>{this.viewerReady()&&(console.info("Initializing event listeners..."),this._initEventListeners(),console.info("BIM Fragments Viewer is ready"))}),(0,l.QZP)(()=>{const t=this.settings(),n=this._world(),o=this._components(),s=this._fragments(),a=this._colorDef();void 0===t||void 0===n||void 0===o||void 0===s||void 0===a||this.viewerReady()&&(((i,r,t,n,o)=>{t.dynamicAnchor=i.dynamicAnchor;const s=t.renderer?.postproduction;if(s&&(s.enabled=i.postProductionSettings.enabled,s.style=i.postProductionSettings.style),i.clickEnabled){const a=r.get($);a.world=t,a.fragments=n,a.enabled=!0,a.material=new h.V9B({color:o.hoverColor,transparent:!0,opacity:.5,depthTest:!1});const c=r.get(he);c.world=t,c.fragments=n,c.enabled=!0;const d=r.get(Q);d.enabled=!0,d.fragments=n,d.multiSelect=i.multiSelect,d.styles={fillColor:o.selectionColor,outlineColor:o.selectionOutlineColor,fillOpacity:.5}}if(i.applyGhosting){const a=r.get(O);a.enabled=!0,a.ghostColor=o.ghostColor,a.fragments=n,a.world=t}console.info("Settings updated")})(t,o,n,s,a),console.info("Settings updated"))})}dispose(){var t=this;return(0,f.A)(function*(){yield t.disposeModels()})()}loadFragmentFiles(t){var n=this;return(0,f.A)(function*(){console.log("LOAD FRAGMENTS");const o=n._fragments();if(void 0===o)throw new Error("Fragments not available");n.modelsAreLoading.set(!0);const s=yield(0,E.Mf)(o,t);n._loadedModels.update(()=>[...s]),console.log("YYY"),console.log(s),n.modelsAreLoading.set(!1)})()}disposeModels(t){var n=this;return(0,f.A)(function*(){const o=t?t.map(a=>a.id):void 0,s=n._fragments();if(void 0===s)throw new Error("Fragments not available");yield(0,E.tA)(s,o),void 0!==t&&t.forEach(a=>a.visible=!1)})()}updateModels(t){var n=this;return(0,f.A)(function*(){const o=n._fragments();if(void 0===o)throw new Error("Fragments not available");const s=yield(0,E.zz)(o,t);n._loadedModels.update(()=>[...s])})()}getSpatialStructure(t){var n=this;return(0,f.A)(function*(){const o=n._fragments()?.models.list.get(t.id);return void 0!==o&&function we(i,r){N.apply(this,arguments)}(o,t.name),o?.getSpatialStructure()})()}updateAspectRatio(){this._world()?.renderer?.resize(),this._world()?.camera.updateAspect()}_initEventListeners(){var t=this;const n=this._components().get(Q);n.events.clickedElement.add(s=>{const a=this.hoveredElement();null!==a&&this.clickedElement.update(()=>({itemData:s,element:a}))}),n.events.clickedCanvas.add(()=>{this.clickedElement.update(()=>null)}),n.events.selection.add(s=>{this.selectedElements.update(()=>s)}),this._components().get($).events.hoveredElement.add(function(){var s=(0,f.A)(function*(a){t.raycastResult.update(()=>a)});return function(a){return s.apply(this,arguments)}}()),this._fragments().models.list.onItemSet.add(()=>{})}static \u0275fac=function(n){return new(n||i)};static \u0275prov=l.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var J=_(7023),Ee=_(5970),x=_(5381),S=_(5187),F=_(1696),V=_(3319),e=_(5547);function Fe(i,r){if(1&i){const t=e.RV6();e.j41(0,"cue-flexcontainer",3)(1,"cue-button",5),e.bIt("click",function(){l.eBV(t);const o=e.XpG();return l.Njj(o.zoomOut())}),e.nrm(2,"cue-button-icon",6),e.k0s(),e.j41(3,"cue-button",5),e.bIt("click",function(){l.eBV(t);const o=e.XpG();return l.Njj(o.zoomIn())}),e.nrm(4,"cue-button-icon",7),e.k0s(),e.j41(5,"cue-button",5),e.bIt("click",function(){l.eBV(t);const o=e.XpG();return l.Njj(o.zoomFit())}),e.nrm(6,"cue-button-icon",8),e.k0s()()}}function ke(i,r){if(1&i){const t=e.RV6();e.j41(0,"cue-button",5),e.bIt("click",function(){l.eBV(t);const o=e.XpG();return l.Njj(o.toggleLayersVisible())}),e.nrm(1,"cue-button-icon",9),e.k0s()}if(2&i){const t=e.XpG();e.AVh("border-left",t.options().displayZoom&&t.displayDecompositionTree())}}let Te=(()=>{class i{settings=(0,u.hFB)(new B.R_);options=(0,g.EW)(()=>this.settings().toolbar);selectMenuPositions=(0,g.EW)(()=>"top"===this.options().position?"bottomleft":"topleft");displayDecompositionTree=(0,g.EW)(()=>void 0!==this.options().displayDecompositionTree);zoomIn(){}zoomOut(){}zoomFit(){}toggleLayersVisible(){}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=e.VBU({type:i,selectors:[["cue-bim-fragments-toolbar"]],inputs:{settings:[1,"settings"]},decls:5,vars:3,consts:[["align","center",1,"container"],[1,"toolbar",3,"padded"],["align","center"],["align","center","gap","s"],["size","xs","variant","tertiary",3,"border-left"],["size","xs","variant","tertiary",3,"click"],["icon","zoom-out"],["icon","zoom-in"],["icon","zoom-fit"],["icon","tree"]],template:function(n,o){1&n&&(e.j41(0,"cue-flexcontainer",0)(1,"cue-card",1)(2,"cue-flexcontainer",2),e.nVh(3,Fe,7,0,"cue-flexcontainer",3),e.nVh(4,ke,2,2,"cue-button",4),e.k0s()()()),2&n&&(e.R7$(),e.Y8G("padded",!1),e.R7$(2),e.vxM(o.options().displayZoom?3:-1),e.R7$(),e.vxM(o.displayDecompositionTree()?4:-1))},dependencies:[x.n,S.Z,F.$,V.a],styles:[".container[_ngcontent-%COMP%]{height:100%;pointer-events:none}.toolbar[_ngcontent-%COMP%]{pointer-events:all;padding:5px 10px}.border-left[_ngcontent-%COMP%]{border-left:1px solid;padding-left:12px}"],changeDetection:0})}return i})();var Ie=_(8359),Ve=_(6939),Pe=_(63),A=_(7089),P=_(356),D=_(6279);const De=()=>({position:"bottomleft"}),U=(i,r)=>r.label||i;function Re(i,r){if(1&i){const t=e.RV6();e.j41(0,"cue-menu-item",4),e.bIt("click",function(){const o=l.eBV(t).$implicit;return l.Njj(o.action())}),e.EFF(1),e.k0s()}if(2&i){const t=r.$implicit;e.Y8G("selected",t.selected),e.R7$(),e.JRh(t.label)}}function Be(i,r){if(1&i&&(e.j41(0,"cue-menu-wrap"),e.Z7z(1,Re,2,2,"cue-menu-item",3,U),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.Dyx(t.contextMenuItems())}}function Oe(i,r){if(1&i){const t=e.RV6();e.j41(0,"cue-button",5),e.bIt("click",function(o){const s=l.eBV(t).$implicit,a=e.XpG();return l.Njj(a.handleClick(o,s))}),e.nrm(1,"cue-button-icon",6),e.k0s()}if(2&i){const t=r.$implicit,n=e.XpG(),o=e.sdS(1);e.Y8G("cueTooltip",t.label)("variant",t.variant?t.variant:n.variant())("size",n.size())("cueContextMenu",o)("contextMenuData",e.lJ4(7,De))("cueContextEnabled",void 0!==t.contextMenuItems&&t.contextMenuItems.length>0),e.R7$(),e.Y8G("icon",t.icon)}}let $e=(()=>{class i{items=u.hFB.required();noGap=(0,u.hFB)(!0);direction=(0,u.hFB)("row");size=(0,u.hFB)("xs");variant=(0,u.hFB)("tertiary");mouseEnter=(0,u.CGW)();mouseLeave=(0,u.CGW)();contextMenuItems=(0,l.vPA)([]);handleClick(t,n){t.stopPropagation(),n.contextMenuItems&&n.contextMenuItems.length>0?this.contextMenuItems.set(n.contextMenuItems):n.action&&(this.contextMenuItems.set([]),n.action())}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=e.VBU({type:i,selectors:[["cue-entity-menu"]],inputs:{items:[1,"items"],noGap:[1,"noGap"],direction:[1,"direction"],size:[1,"size"],variant:[1,"variant"]},outputs:{mouseEnter:"mouseEnter",mouseLeave:"mouseLeave"},decls:5,vars:2,consts:[["contextMenu",""],["gap","s","justify","end",2,"width","100%",3,"mouseenter","mouseleave","direction","noGap"],["trigger","leftclick",3,"cueTooltip","variant","size","cueContextMenu","contextMenuData","cueContextEnabled"],[3,"selected"],[3,"click","selected"],["trigger","leftclick",3,"click","cueTooltip","variant","size","cueContextMenu","contextMenuData","cueContextEnabled"],[3,"icon"]],template:function(n,o){1&n&&(e.DNE(0,Be,3,0,"ng-template",null,0,e.C5r),e.j41(2,"cue-flexcontainer",1),e.bIt("mouseenter",function(){return o.mouseEnter.emit()})("mouseleave",function(){return o.mouseLeave.emit()}),e.Z7z(3,Oe,2,8,"cue-button",2,U),e.k0s()),2&n&&(e.R7$(2),e.Y8G("direction",o.direction())("noGap",o.noGap()),e.R7$(),e.Dyx(o.items()))},dependencies:[x.n,F.$,A.d,V.a,J.Q,P.M,D.D],encapsulation:2,changeDetection:0})}return i})(),je=(()=>{class i{_targetEl=(0,l.WQX)(e.aKT);_overlay=(0,l.WQX)(Pe.hJ);_overlayRef;_isOverlayHovered=!1;_subscriptions;display=(0,u.hFB)("on-hover");menuItems=u.hFB.required();menuEnabled=(0,u.hFB)(!0);onMouseEnter(){if("on-hover"===this.display()){if(!this.menuItems().length)return void this.removeOverlayMenu();this.appendOverlayMenu()}}onMouseLeave(){this._checkShouldRemoveOverlay()}appendOverlayMenu(){if(!this.menuItems().length||this._overlayRef)return;const t=this._overlay.create({positionStrategy:this._overlay.position().flexibleConnectedTo(this._targetEl).withPositions([{originX:"end",originY:"center",overlayX:"start",overlayY:"center",offsetX:2,offsetY:0}])});this._overlayRef=t;const n=window.getComputedStyle(this._targetEl.nativeElement).color;t.overlayElement.style.color=n;const o=new Ve.A8($e),s=t.attach(o);s.instance.items=this.menuItems,this._subscriptions&&this._subscriptions.unsubscribe(),this._subscriptions=new Ie.yU,this._subscriptions.add(s.instance.mouseEnter.subscribe(()=>{this._isOverlayHovered=!0})),this._subscriptions.add(s.instance.mouseLeave.subscribe(()=>{this._isOverlayHovered=!1,this._checkShouldRemoveOverlay()}))}removeOverlayMenu(){this._overlayRef&&(this._subscriptions&&(this._subscriptions.unsubscribe(),this._subscriptions=void 0),this._overlayRef.detach(),this._overlayRef.dispose(),this._overlayRef=void 0)}_checkShouldRemoveOverlay(){setTimeout(()=>{this._isOverlayHovered||this.removeOverlayMenu()},300)}static \u0275fac=function(n){return new(n||i)};static \u0275dir=e.FsC({type:i,selectors:[["","cueEntityMenu",""]],hostBindings:function(n,o){1&n&&e.bIt("mouseenter",function(){return o.onMouseEnter()})("mouseleave",function(){return o.onMouseLeave()})},inputs:{display:[1,"display"],menuItems:[1,"menuItems"],menuEnabled:[1,"menuEnabled"]}})}return i})();var k=_(2245);let Ge=(()=>{class i{entityMenuDirective;size=(0,u.hFB)("m");key=u.hFB.required();val=u.geq.required();options=(0,u.hFB)([]);suffix=(0,u.hFB)("");valueChange=(0,u.CGW)();editModeEnabled=(0,l.vPA)(!1);valueChanged=(0,g.EW)(()=>this.val()!==this.newValue());newValue=(0,g.uu)(()=>this.val());labelSize=(0,g.EW)(()=>{switch(this.size()){case"s":return"xs";case"m":return"s";case"l":return"m";case"xl":return"l"}});onKeyPress(t){this.editModeEnabled()&&("Escape"===t.key?(this._reset(),t.stopPropagation()):"Enter"===t.key&&this._emitChange())}saveCancelMenu=(0,g.EW)(()=>{const t=[{icon:"close",label:"Cancel",action:()=>this._reset()}];return this.valueChanged()&&t.push({icon:"save",label:"Save",action:()=>this._emitChange()}),t});selectionChange(t){this.newValue.set(t?.toString()??"")}inputChange(t){this.newValue.set(t)}_emitChange(){this.valueChange.emit(this.newValue()),this.val.set(this.newValue()),this.editModeEnabled.set(!1)}_reset(){this.newValue.set(this.val()),this.editModeEnabled.set(!1)}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=e.VBU({type:i,selectors:[["cue-key-val"]],viewQuery:function(n,o){if(1&n&&e.GBs(je,5),2&n){let s;e.mGM(s=e.lsd())&&(o.entityMenuDirective=s.first)}},hostBindings:function(n,o){1&n&&e.bIt("keydown",function(a){return o.onKeyPress(a)},e.EBC)},inputs:{size:[1,"size"],key:[1,"key"],val:[1,"val"],options:[1,"options"],suffix:[1,"suffix"]},outputs:{val:"valChange",valueChange:"valueChange"},decls:8,vars:5,consts:[[1,"key-val-container"],[3,"size"],[1,"value-content"]],template:function(n,o){1&n&&(e.j41(0,"dl",0)(1,"dt")(2,"cue-typography",1),e.EFF(3),e.k0s()(),e.j41(4,"dd")(5,"cue-typography",1)(6,"span",2),e.EFF(7),e.k0s()()()()),2&n&&(e.R7$(2),e.Y8G("size",o.labelSize()),e.R7$(),e.JRh(o.key()),e.R7$(2),e.Y8G("size",o.size()),e.R7$(2),e.Lme("",o.val()," ",o.suffix()))},dependencies:[k.o],styles:[".key-val-container[_ngcontent-%COMP%]{margin:0;display:flex;flex-direction:column;gap:var(--cue-grid-gap-s, 8px)}dt[_ngcontent-%COMP%], dd[_ngcontent-%COMP%]{margin:0}.read-mode-container[_ngcontent-%COMP%]{display:inline-flex;align-items:center;width:100%;position:relative}.read-mode-container.interactive[_ngcontent-%COMP%]:hover{cursor:pointer}.value-content[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%]{color:var(--cue-typography-text-color, inherit)}dt[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%], dd[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%], .value-content[_ngcontent-%COMP%]{color:var(--cue-typography-text-color, inherit)!important}dt[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%] div[_ngcontent-%COMP%], dd[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{color:var(--cue-typography-text-color, inherit)!important}[_ngcontent-%COMP%]:deep(cue-svg-icon), [_ngcontent-%COMP%]:deep(cue-entity-menu cue-svg-icon){color:var(--cue-icon-color, inherit)!important}.dirty-indicator[_ngcontent-%COMP%]{opacity:.8;margin-left:4px;color:var(--cue-typography-text-color, inherit)!important;font-weight:700;font-size:.4em;transform:translateY(-1em)}"]})}return i})();const Ne=["*"];let ze=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275cmp=e.VBU({type:i,selectors:[["cue-key-val-list"]],ngContentSelectors:Ne,decls:2,vars:0,consts:[[1,"key-val-list"]],template:function(n,o){1&n&&(e.NAR(),e.rj2(0,"div",0),e.SdG(1),e.eux())},styles:[".key-val-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--cue-grid-gap-s)}"]})}return i})();function Se(i,r){if(1&i&&e.nrm(0,"cue-key-val",3),2&i){const t=e.XpG();e.Y8G("val",t.name)}}function Ae(i,r){if(1&i&&e.nrm(0,"cue-key-val",5),2&i){const t=r.$implicit;e.Y8G("key",t.label)("val",t.value)}}function Xe(i,r){if(1&i&&(e.j41(0,"cue-typography",4),e.EFF(1),e.k0s(),e.j41(2,"cue-key-val-list"),e.Z7z(3,Ae,1,2,"cue-key-val",5,e.Vm6),e.k0s()),2&i){const t=r.$implicit;e.R7$(),e.JRh(t.psetName),e.R7$(2),e.Dyx(t.props)}}function Le(i,r){if(1&i&&e.Z7z(0,Xe,5,1,null,null,e.Vm6),2&i){const t=e.XpG();e.Dyx(t.psets)}}function Ye(i,r){if(1&i&&(e.nVh(0,Se,1,1,"cue-key-val",3),e.nVh(1,Le,2,0)),2&i){const t=r;e.vxM(t.name?0:-1),e.R7$(),e.vxM(t.psets.length>0?1:-1)}}function He(i,r){if(1&i&&(e.j41(0,"cue-card",1)(1,"cue-flexcontainer",2),e.nVh(2,Ye,2,2),e.k0s()()),2&i){let t;const n=e.XpG();e.Y8G("padded",!1)("scrollable",!0),e.R7$(2),e.vxM((t=n.props())?2:-1,t)}}function We(i,r){if(1&i&&e.nrm(0,"cue-key-val",3),2&i){const t=e.XpG();e.Y8G("val",t.name)}}function Qe(i,r){if(1&i&&e.nrm(0,"cue-key-val",5),2&i){const t=r.$implicit;e.Y8G("key",t.label)("val",t.value)}}function Ze(i,r){if(1&i&&(e.j41(0,"cue-typography",4),e.EFF(1),e.k0s(),e.j41(2,"cue-key-val-list"),e.Z7z(3,Qe,1,2,"cue-key-val",5,e.Vm6),e.k0s()),2&i){const t=r.$implicit;e.R7$(),e.JRh(t.psetName),e.R7$(2),e.Dyx(t.props)}}function Je(i,r){if(1&i&&e.Z7z(0,Ze,5,1,null,null,e.Vm6),2&i){const t=e.XpG();e.Dyx(t.psets)}}function Ue(i,r){if(1&i&&(e.nVh(0,We,1,1,"cue-key-val",3),e.nVh(1,Je,2,0)),2&i){const t=r;e.vxM(t.name?0:-1),e.R7$(),e.vxM(t.psets.length>0?1:-1)}}function Ke(i,r){if(1&i&&(e.j41(0,"cue-flexcontainer",2),e.nVh(1,Ue,2,2),e.k0s()),2&i){let t;const n=e.XpG();e.R7$(),e.vxM((t=n.props())?1:-1,t)}}let qe=(()=>{class i{element=u.hFB.required();wrapInCard=(0,u.hFB)(!0);props=(0,g.EW)(()=>{const t=this.element().itemData,n=this.formatItemPsets(t.IsDefinedBy||[]);return{name:t.Name?.value||"No name",psets:n}});formatItemPsets(t){const n=[];for(const[,o]of t.entries()){const{Name:s,HasProperties:a}=o;if(!("value"in s)||!Array.isArray(a))continue;const c=[];for(const[,d]of a.entries()){const{Name:m,NominalValue:p}=d;if(!("value"in m)||!("value"in p))continue;const y=m.value,b=p.value;y&&void 0!==b&&c.push({label:y,value:b.toString()})}n.push({psetName:s.value,props:c})}return n}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=e.VBU({type:i,selectors:[["cue-bim-fragments-props-viewer"]],inputs:{element:[1,"element"],wrapInCard:[1,"wrapInCard"]},decls:3,vars:1,consts:[["direction","column","justify","center",1,"container"],[1,"card",3,"padded","scrollable"],["align","start","direction","column"],["key","Name",3,"val"],["size","s","weight","semibold"],[3,"key","val"]],template:function(n,o){1&n&&(e.j41(0,"cue-flexcontainer",0),e.nVh(1,He,3,3,"cue-card",1)(2,Ke,2,1,"cue-flexcontainer",2),e.k0s()),2&n&&(e.R7$(),e.vxM(o.wrapInCard()?1:2))},dependencies:[x.n,S.Z,Ge,ze,k.o],styles:[".container[_ngcontent-%COMP%]{height:100%;pointer-events:none}.card[_ngcontent-%COMP%]{pointer-events:all;max-height:100%;width:300px;flex:1 1}.border-left[_ngcontent-%COMP%]{border-left:1px solid;padding-left:12px}"],changeDetection:0})}return i})();var K=_(9769);let et=(()=>{class i{selectedItem=(0,l.vPA)(void 0);static \u0275fac=function(n){return new(n||i)};static \u0275prov=l.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var tt=_(5448),q=_(6117);const ee=(i,r)=>r.path;function nt(i,r){if(1&i){const t=e.RV6();e.j41(0,"cue-menu-item",7),e.bIt("click",function(o){const s=l.eBV(t).$implicit,a=e.XpG(2);return l.Njj(a.navigateTo(o,s.path))}),e.EFF(1),e.k0s()}if(2&i){const t=r.$implicit;e.R7$(),e.SpI(" ",t.name," ")}}function it(i,r){if(1&i&&(e.j41(0,"cue-flexcontainer",2)(1,"cue-menu")(2,"cue-button",4,0)(4,"cue-button-label"),e.EFF(5,"..."),e.k0s()(),e.j41(6,"cue-menu-wrap",5),e.Z7z(7,nt,2,1,"cue-menu-item",null,ee),e.k0s()(),e.j41(9,"cue-typography",6),e.EFF(10," \u203a "),e.k0s()()),2&i){const t=e.XpG();e.R7$(2),e.Y8G("size",t.buttonSize())("cueTooltip",t.hiddenPartsTooltip()),e.R7$(5),e.Dyx(t.hidddenParts()),e.R7$(2),e.Y8G("size",t.size())}}function ot(i,r){if(1&i&&(e.j41(0,"cue-typography",6),e.EFF(1," \u203a "),e.k0s()),2&i){const t=e.XpG(2);e.Y8G("size",t.size())}}function st(i,r){if(1&i){const t=e.RV6();e.j41(0,"cue-flexcontainer",8),e.bIt("click",function(o){const s=l.eBV(t),a=s.$implicit,c=s.$index,d=s.$count,m=e.XpG();return l.Njj(c!==d-1&&!m.buttonMode()&&m.navigateTo(o,a.path))}),e.j41(1,"cue-typography",9),e.EFF(2),e.k0s(),e.nVh(3,ot,2,1,"cue-typography",6),e.k0s()}if(2&i){const t=r.$implicit,n=r.$index,o=r.$count,s=e.XpG();e.AVh("clickable",n!==o-1&&s.updatePathOnClick()&&!s.buttonMode()),e.R7$(),e.AVh("full-length",s.nameFullLength()),e.Y8G("size",s.size())("weight",n===o-1?"medium":"regular")("title",t.name),e.R7$(),e.SpI(" ",t.name," "),e.R7$(),e.vxM(n!==o-1?3:-1)}}let rt=(()=>{class i{path=u.geq.required();size=(0,u.hFB)("xs");rootName=(0,u.hFB)(null);maxVisibleParts=(0,u.hFB)(3);nameFullLength=(0,u.hFB)(!1);updatePathOnClick=(0,u.hFB)(!0);buttonMode=(0,u.hFB)(!1);buttonSize=(0,g.EW)(()=>{switch(this.size()){case"xs":case"s":default:return"s";case"m":case"l":case"xl":return"m"}});get sizeAttribute(){return this.size()}get buttonModeClass(){return this.buttonMode()}onHostClick(t){this.buttonMode()&&(t.stopPropagation(),this.clickedPath.emit(this.path()))}pathChange=(0,u.CGW)();clickedPath=(0,u.CGW)();allBreadcrumbParts=(0,g.EW)(()=>{const t=this.path().split("/").filter(a=>""!==a),n=[],o=this.rootName();null!==o&&n.push({name:o,path:"/"});let s="";for(const a of t)s+=`/${a}`,n.push({name:a,path:s.endsWith("/")?s:`${s}/`});return n});shouldShowEllipsis=(0,g.EW)(()=>this.allBreadcrumbParts().length>this.maxVisibleParts());visibleBreadcrumbParts=(0,g.EW)(()=>{const t=this.allBreadcrumbParts(),n=this.maxVisibleParts();return t.length<=n?t:t.slice(-n)});hidddenParts=(0,g.EW)(()=>{const t=this.allBreadcrumbParts(),n=this.maxVisibleParts();return t.length<=n?[]:t.slice(0,-n)});hiddenPartsTooltip=(0,g.EW)(()=>{const t=this.hidddenParts();return 0===t.length?"":`${t.map(n=>n.name).join(" \u203a ")}`});navigateTo(t,n){console.log("Navigating to:",n),t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault(),this.clickedPath.emit(n),this.updatePathOnClick()&&(this.path.set(n),this.pathChange.emit(n))}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=e.VBU({type:i,selectors:[["cue-breadcrumb"]],hostVars:3,hostBindings:function(n,o){1&n&&e.bIt("click",function(a){return o.onHostClick(a)}),2&n&&(e.BMQ("size",o.sizeAttribute),e.AVh("button-mode",o.buttonModeClass))},inputs:{path:[1,"path"],size:[1,"size"],rootName:[1,"rootName"],maxVisibleParts:[1,"maxVisibleParts"],nameFullLength:[1,"nameFullLength"],updatePathOnClick:[1,"updatePathOnClick"],buttonMode:[1,"buttonMode"]},outputs:{path:"pathChange",pathChange:"pathChange",clickedPath:"clickedPath"},decls:4,vars:1,consts:[["trigger",""],["direction","row","gap","s","align","center"],["direction","row","gap","s","align","center",1,"ellipsis-container"],["direction","row","gap","s",3,"clickable"],["trigger","","variant","ghost",3,"size","cueTooltip"],["menu",""],["weight","semibold",3,"size"],[3,"click"],["direction","row","gap","s",3,"click"],[1,"breadcrumb-text",3,"size","weight","title"]],template:function(n,o){1&n&&(e.j41(0,"cue-flexcontainer",1),e.nVh(1,it,11,3,"cue-flexcontainer",2),e.Z7z(2,st,4,9,"cue-flexcontainer",3,ee),e.k0s()),2&n&&(e.R7$(),e.vxM(o.shouldShowEllipsis()?1:-1),e.R7$(),e.Dyx(o.visibleBreadcrumbParts()))},dependencies:[K.MD,k.o,x.n,F.$,tt.L,A.d,q.W,P.M,D.D],styles:['.clickable[_ngcontent-%COMP%]{cursor:pointer}.clickable[_ngcontent-%COMP%]:hover{text-decoration:underline}.separator[_ngcontent-%COMP%]{color:#666;padding:0 4px}.full-length[_ngcontent-%COMP%]{max-width:none!important}.full-length[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:none!important;overflow:visible!important;text-overflow:unset!important;white-space:normal!important}.breadcrumb-text[_ngcontent-%COMP%]:not(.full-length){max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}.breadcrumb-text[_ngcontent-%COMP%]:not(.full-length) > div[_ngcontent-%COMP%]{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ellipsis-container[_ngcontent-%COMP%]{cursor:default;display:flex;align-items:center}.ellipsis-text[_ngcontent-%COMP%]{color:#666;font-style:italic;line-height:1;display:flex;align-items:center;text-align:center;vertical-align:middle;justify-content:center;height:100%;min-height:1em}.ellipsis-text[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:inline-block!important}.ellipsis-text[_ngcontent-%COMP%] *{display:flex!important;align-items:center!important;justify-content:center!important;height:100%!important;line-height:1!important}.button-mode[_nghost-%COMP%]{cursor:pointer}[size="xs"][_nghost-%COMP%] .breadcrumb-text[_ngcontent-%COMP%]:not(.full-length){max-width:70px}[size="s"][_nghost-%COMP%] .breadcrumb-text[_ngcontent-%COMP%]:not(.full-length){max-width:80px}[size="m"][_nghost-%COMP%] .breadcrumb-text[_ngcontent-%COMP%]:not(.full-length){max-width:100px}[size="l"][_nghost-%COMP%] .breadcrumb-text[_ngcontent-%COMP%]:not(.full-length){max-width:120px}[size="xl"][_nghost-%COMP%] .breadcrumb-text[_ngcontent-%COMP%]:not(.full-length){max-width:150px}']})}return i})();var at=_(29);const lt=()=>[],ct=()=>({}),dt=(i,r)=>r.label;function ut(i,r){if(1&i&&e.nrm(0,"cue-svg-icon",17),2&i){const t=e.XpG().$implicit;e.Y8G("name",t.icon)}}function mt(i,r){if(1&i){const t=e.RV6();e.j41(0,"cue-menu-item",16),e.bIt("click",function(){const o=l.eBV(t).$implicit;return l.Njj(o.action())}),e.nVh(1,ut,1,1,"cue-svg-icon",17),e.EFF(2),e.k0s()}if(2&i){const t=r.$implicit;e.Y8G("tooltip",t.tooltip??""),e.R7$(),e.vxM(t.icon?1:-1),e.R7$(),e.SpI(" ",t.label," ")}}function pt(i,r){if(1&i&&(e.j41(0,"cue-menu",11),e.bIt("click",function(n){return n.stopPropagation()}),e.j41(1,"cue-button",12),e.nrm(2,"cue-button-icon",13),e.k0s(),e.j41(3,"cue-menu-wrap",14),e.Z7z(4,mt,3,3,"cue-menu-item",15,dt),e.k0s()()),2&i){const t=e.XpG().$implicit;e.R7$(),e.Y8G("cueTooltip",t.tooltip??""),e.R7$(),e.Y8G("icon",t.icon),e.R7$(2),e.Dyx(t.menuItems)}}function ht(i,r){if(1&i){const t=e.RV6();e.j41(0,"cue-button",18),e.bIt("click",function(o){return l.eBV(t),e.XpG().$implicit.action(),l.Njj(o.stopPropagation())}),e.nrm(1,"cue-button-icon",13),e.k0s()}if(2&i){const t=e.XpG().$implicit;e.Y8G("cueTooltip",t.tooltip??""),e.R7$(),e.Y8G("icon",t.icon)}}function _t(i,r){if(1&i&&e.nVh(0,pt,6,2,"cue-menu")(1,ht,2,2,"cue-button",10),2&i){const t=r.$implicit;e.vxM(null!=t.menuItems&&t.menuItems.length?0:t.action?1:-1)}}function gt(i,r){if(1&i&&(e.j41(0,"cue-flexcontainer",3),e.Z7z(1,_t,2,1,null,null,e.Vm6),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(),e.Dyx(t.buttons)}}function ft(i,r){if(1&i&&(e.j41(0,"cue-typography",20),e.EFF(1),e.k0s()),2&i){const t=e.XpG(2).$implicit;e.R7$(),e.JRh(t.subLabel)}}function vt(i,r){if(1&i&&(e.j41(0,"div",4)(1,"cue-typography",19),e.EFF(2),e.k0s(),e.nVh(3,ft,2,1,"cue-typography",20),e.k0s()),2&i){const t=e.XpG().$implicit,n=e.XpG();e.R7$(),e.Y8G("weight",n.isSelected(t)?"semibold":"regular")("size",n.size()),e.R7$(),e.JRh(t.label),e.R7$(),e.vxM(t.subLabel?3:-1)}}function bt(i,r){if(1&i&&e.nrm(0,"cue-breadcrumb",6),2&i){const t=e.XpG().$implicit,n=e.XpG();e.Y8G("maxVisibleParts",5)("path",t.label)("size",n.size())("nameFullLength",!0)("updatePathOnClick",!1)}}function yt(i,r){if(1&i&&e.nrm(0,"cue-svg-icon",21),2&i){const t=e.XpG().$implicit,n=e.XpG();e.AVh("expanded",n.isExpanded(t))}}function Mt(i,r){if(1&i&&(e.j41(0,"div",8),e.nrm(1,"cue-tree-menu",22),e.k0s()),2&i){const t=e.XpG().$implicit,n=e.XpG();e.R7$(),e.Y8G("items",t.children||e.lJ4(2,lt))("size",n.size())}}function xt(i,r){if(1&i&&(e.j41(0,"div",23),e.bIt("click",function(n){return n.stopPropagation()}),e.eu8(1,24),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(),e.Y8G("ngTemplateOutlet",t.contentTemplate)("ngTemplateOutletContext",t.templateContext??e.lJ4(2,ct))}}function Ct(i,r){if(1&i){const t=e.RV6();e.j41(0,"li",1)(1,"cue-flexcontainer",2),e.bIt("click",function(){const o=l.eBV(t).$implicit,s=e.XpG();return l.Njj(s.handleItemClick(o))}),e.nVh(2,gt,3,0,"cue-flexcontainer",3),e.nVh(3,vt,4,4,"div",4),e.nrm(4,"span",5),e.nVh(5,bt,1,5,"cue-breadcrumb",6),e.nVh(6,yt,1,2,"cue-svg-icon",7),e.k0s(),e.nVh(7,Mt,2,3,"div",8),e.nVh(8,xt,2,3,"div",9),e.k0s()}if(2&i){const t=r.$implicit,n=e.XpG();e.R7$(),e.AVh("has-children",n.hasChildren(t)),e.R7$(),e.vxM(null!=t.buttons&&t.buttons.length?2:-1),e.R7$(),e.vxM(void 0===t.type||"text"===t.type?3:-1),e.R7$(2),e.vxM("breadcrumb"===t.type?5:-1),e.R7$(),e.vxM(n.hasChildren(t)?6:-1),e.R7$(),e.vxM(n.hasChildren(t)&&n.isExpanded(t)?7:-1),e.R7$(),e.vxM(t.contentTemplate?8:-1)}}let wt=(()=>{class i{_service=(0,l.WQX)(et);items=(0,u.geq)([]);size=(0,u.hFB)("m");collapseOnSelect=(0,u.hFB)(!1);initialExpandDepth=(0,u.hFB)(-1);expandedItems=new Set;selectionChanged=(0,u.CGW)();onItemsChange=(0,l.QZP)(()=>{this.collapseOnSelect()||this._initialExpandSelected()});onSelectionChange=(0,l.QZP)(()=>{const t=this._service.selectedItem();void 0!==t&&this.selectionChanged.emit(t)});ngOnDestroy(){this.items.update(()=>[])}handleItemClick(t){if(this.hasChildren(t)){this.expandedItems.has(t)?this.expandedItems.delete(t):this.expandedItems.add(t);const n=this._service.selectedItem();void 0!==n&&(n.selected=!1),t.selected=!0,this._service.selectedItem.set(t)}else this._setSelected(t),this._update()}hasChildren(t){return!!t.children&&t.children.length>0}isExpanded(t){return this.expandedItems.has(t)}isSelected(t){return t.selected}_setSelected(t){const n=this._service.selectedItem();void 0!==n&&(n.selected=!1),t.selected=!0}_update(){this.items.update(()=>[...this.items()])}_initialExpandSelected(){this.expandedItems.clear();const t=this.initialExpandDepth(),n=(o,s=[],a=0)=>{for(const c of o){if(t>=0&&a<=t&&this.hasChildren(c)&&this.expandedItems.add(c),c.selected){this._service.selectedItem.set(c);for(const d of s)this.expandedItems.add(d)}c.children&&c.children.length>0&&n(c.children,[...s,c],a+1)}};n(this.items()??[])}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=e.VBU({type:i,selectors:[["cue-tree-menu"]],inputs:{items:[1,"items"],size:[1,"size"],collapseOnSelect:[1,"collapseOnSelect"],initialExpandDepth:[1,"initialExpandDepth"]},outputs:{items:"itemsChange",selectionChanged:"selectionChanged"},decls:3,vars:0,consts:[[1,"menu"],[1,"menu-item"],["justify","start","align","center","gap","s",1,"menu-item-header",3,"click"],["gap","s","align","center"],[2,"display","flex","flex-direction","row","align-items","baseline","gap","6px"],[2,"flex","1"],[3,"maxVisibleParts","path","size","nameFullLength","updatePathOnClick"],["name","arrow-dropdown",1,"menu-item-arrow",3,"expanded"],[1,"submenu"],[1,"menu-item-content"],["size","xs","variant","ghost","tooltipPlacement","right",3,"cueTooltip"],[3,"click"],["trigger","","size","xs","variant","ghost","tooltipPlacement","right",3,"cueTooltip"],[3,"icon"],["menu",""],[3,"tooltip"],[3,"click","tooltip"],["before","",3,"name"],["size","xs","variant","ghost","tooltipPlacement","right",3,"click","cueTooltip"],[3,"weight","size"],["size","xs",2,"opacity","0.6"],["name","arrow-dropdown",1,"menu-item-arrow"],[3,"items","size"],[1,"menu-item-content",3,"click"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(n,o){1&n&&(e.j41(0,"ul",0),e.Z7z(1,Ct,9,8,"li",1,e.Vm6),e.k0s()),2&n&&(e.R7$(),e.Dyx(o.items()))},dependencies:[i,k.o,x.n,rt,F.$,V.a,at.A,A.d,K.T3,q.W,D.D,P.M],styles:[".menu[_ngcontent-%COMP%]{list-style:none;padding:0;margin:0}.menu-item[_ngcontent-%COMP%]{cursor:pointer;-webkit-user-select:none;user-select:none}.menu-item-header[_ngcontent-%COMP%]{padding:8px 16px;transition:background-color .2s}.menu-item-header[_ngcontent-%COMP%]:hover{background-color:var(--cue-color-green);color:var(--cue-color-black)}.menu-item-header[_ngcontent-%COMP%]:hover *{color:var(--cue-color-black);fill:var(--cue-color-black)}.menu-item-header.has-children[_ngcontent-%COMP%]{font-weight:700}.menu-item-arrow[_ngcontent-%COMP%]{transition:transform .2s;flex-shrink:0}.menu-item-arrow.expanded[_ngcontent-%COMP%]{transform:rotate(180deg)}.submenu[_ngcontent-%COMP%]{padding-left:16px;border-left:1px solid}"]})}return i})(),Et=(()=>{class i{_service=(0,l.WQX)(z);type=(0,u.hFB)("spatial");models=u.geq.required();treeItems=(0,l.vPA)([]);constructor(){var t=this;(0,l.QZP)((0,f.A)(function*(){if(!t._service.loadedModels().length)return;console.log(t._service.loadedModels());const n=yield Promise.all(t.models().map(s=>t.getSpatialStructure(s)));console.log("Model Trees:",n);const o=[];t.models().forEach(s=>{o.push({label:s.name,buttons:[{icon:s.visible?"view-inactive":"view-active",action:()=>t.toggleVisibility(s)}]})}),t.treeItems.update(()=>[...o])}))}toggleVisibility(t){var n=this;return(0,f.A)(function*(){t.visible?(yield n._service.disposeModels([t]),console.log(`Model ${t.name} (${t.id}) disposed`)):yield n._service.loadFragmentFiles([t]),n.models.update(()=>[...n.models()])})()}getSpatialStructure(t){var n=this;return(0,f.A)(function*(){const o=yield n._service.getSpatialStructure(t);if(o)return{label:o.category,children:o.children?.map(s=>({label:s.name,children:s.children?.map(a=>({label:a.name}))}))}})()}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=e.VBU({type:i,selectors:[["cue-bim-fragments-tree-viewer"]],inputs:{type:[1,"type"],models:[1,"models"]},outputs:{models:"modelsChange"},decls:1,vars:1,consts:[["size","s",3,"items"]],template:function(n,o){1&n&&e.nrm(0,"cue-tree-menu",0),2&n&&e.Y8G("items",o.treeItems())},dependencies:[wt],styles:[".container[_ngcontent-%COMP%]{height:100%;pointer-events:none}.card[_ngcontent-%COMP%]{pointer-events:all;max-height:100%;width:300px;flex:1 1}.border-left[_ngcontent-%COMP%]{border-left:1px solid;padding-left:12px}"],changeDetection:0})}return i})();var Ft=_(6034);const te=(i,r)=>r.id;function kt(i,r){1&i&&(e.j41(0,"cue-typography",4),e.EFF(1,"Loading..."),e.k0s())}function Tt(i,r){if(1&i){const t=e.RV6();e.j41(0,"cue-typography",4),e.EFF(1),e.k0s(),e.j41(2,"cue-button",6),e.bIt("click",function(){const o=l.eBV(t).$implicit,s=e.XpG(3);return l.Njj(s.toggleVisibility(o))}),e.nrm(3,"cue-button-icon",7),e.k0s()}if(2&i){const t=r.$implicit;e.R7$(),e.JRh(t.name),e.R7$(2),e.Y8G("icon",t.visible?"view-inactive":"view-active")}}function It(i,r){if(1&i&&(e.j41(0,"cue-flexcontainer",5),e.Z7z(1,Tt,4,2,null,null,te),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Dyx(t.models())}}function Vt(i,r){if(1&i){const t=e.RV6();e.j41(0,"cue-typography",3),e.EFF(1),e.k0s(),e.j41(2,"cue-bim-fragments-tree-viewer",8),e.mxI("modelsChange",function(o){l.eBV(t);const s=e.XpG(2);return e.DH7(s.models,o)||(s.models=o),l.Njj(o)}),e.k0s()}if(2&i){const t=e.XpG(2);e.R7$(),e.JRh(t.treeLabel()),e.R7$(),e.R50("models",t.models)}}function Pt(i,r){if(1&i&&(e.j41(0,"cue-draggable-card",0)(1,"cue-flexcontainer",1)(2,"cue-flexcontainer",2)(3,"cue-typography",3),e.EFF(4,"Models"),e.k0s(),e.nVh(5,kt,2,0,"cue-typography",4)(6,It,3,0,"cue-flexcontainer",5),e.k0s(),e.nVh(7,Vt,3,2),e.k0s()()),2&i){const t=e.XpG();e.Y8G("padded",!1),e.R7$(5),e.vxM(t.modelsAreLoading()?5:6),e.R7$(2),e.vxM(t.displayDecompositionTree()?7:-1)}}function Dt(i,r){1&i&&(e.j41(0,"cue-typography",4),e.EFF(1,"Loading..."),e.k0s())}function Rt(i,r){if(1&i){const t=e.RV6();e.j41(0,"cue-typography",4),e.EFF(1),e.k0s(),e.j41(2,"cue-button",6),e.bIt("click",function(){const o=l.eBV(t).$implicit,s=e.XpG(3);return l.Njj(s.toggleVisibility(o))}),e.nrm(3,"cue-button-icon",7),e.k0s()}if(2&i){const t=r.$implicit;e.R7$(),e.JRh(t.name),e.R7$(2),e.Y8G("icon",t.visible?"view-inactive":"view-active")}}function Bt(i,r){if(1&i&&(e.j41(0,"cue-flexcontainer",5),e.Z7z(1,Rt,4,2,null,null,te),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Dyx(t.models())}}function Ot(i,r){if(1&i){const t=e.RV6();e.j41(0,"cue-typography",3),e.EFF(1),e.k0s(),e.j41(2,"cue-bim-fragments-tree-viewer",8),e.mxI("modelsChange",function(o){l.eBV(t);const s=e.XpG(2);return e.DH7(s.models,o)||(s.models=o),l.Njj(o)}),e.k0s()}if(2&i){const t=e.XpG(2);e.R7$(),e.JRh(t.treeLabel()),e.R7$(),e.R50("models",t.models)}}function $t(i,r){if(1&i&&(e.j41(0,"cue-flexcontainer",1)(1,"cue-flexcontainer",2)(2,"cue-typography",3),e.EFF(3,"Models"),e.k0s(),e.nVh(4,Dt,2,0,"cue-typography",4)(5,Bt,3,0,"cue-flexcontainer",5),e.k0s(),e.nVh(6,Ot,3,2),e.k0s()),2&i){const t=e.XpG();e.R7$(4),e.vxM(t.modelsAreLoading()?4:5),e.R7$(2),e.vxM(t.displayDecompositionTree()?6:-1)}}let jt=(()=>{class i{_service=(0,l.WQX)(z);models=u.geq.required();draggable=(0,u.hFB)(!0);modelsAreLoading=this._service.modelsAreLoading;displayDecompositionTree=(0,g.EW)(()=>void 0!==this._service.settings().toolbar.displayDecompositionTree);treeLabel=(0,g.EW)(()=>"spatial"===this._service.settings().toolbar.displayDecompositionTree?"Spatial Decomposition":"System Decomposition");toggleVisibility(t){var n=this;return(0,f.A)(function*(){console.log("TOGGLE VISIBILITY",t),t.visible?(yield n._service.disposeModels([t]),console.log(`Model ${t.name} (${t.id}) disposed`)):yield n._service.loadFragmentFiles([t]),n.models.update(()=>[...n.models()])})()}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=e.VBU({type:i,selectors:[["cue-bim-fragments-visibility-menu"]],inputs:{models:[1,"models"],draggable:[1,"draggable"]},outputs:{models:"modelsChange"},decls:2,vars:1,consts:[["margin","0",1,"draggable",3,"padded"],["direction","column","gap","l",2,"padding","0 10px 10px 10px"],["align","start","direction","column",2,"width","100%"],["size","s","weight","semibold"],["size","s"],["direction","row","justify","space-between","align","center",2,"width","100%"],["size","xs",3,"click"],[3,"icon"],[3,"modelsChange","models"]],template:function(n,o){1&n&&e.nVh(0,Pt,8,3,"cue-draggable-card",0)(1,$t,7,2,"cue-flexcontainer",1),2&n&&e.vxM(o.draggable()?0:1)},dependencies:[Ft.y,k.o,x.n,F.$,V.a,Et],styles:[".draggable[_ngcontent-%COMP%]{z-index:101}"],changeDetection:0})}return i})();const Gt=["bimViewer"],ne=()=>({position:"bottomleft"}),Nt=(i,r)=>r.label;function zt(i,r){if(1&i){const t=e.RV6();e.j41(0,"cue-menu-item",4),e.bIt("click",function(){const o=l.eBV(t).$implicit;return l.Njj(o.action())}),e.EFF(1),e.k0s()}if(2&i){const t=r.$implicit;e.R7$(),e.JRh(t.label)}}function St(i,r){if(1&i&&(e.j41(0,"cue-menu-wrap"),e.Z7z(1,zt,2,1,"cue-menu-item",null,Nt),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.Dyx(t.contextMenuItems())}}function At(i,r){if(1&i){const t=e.RV6();e.j41(0,"cue-bim-fragments-visibility-menu",10),e.mxI("modelsChange",function(o){l.eBV(t);const s=e.XpG(2);return e.DH7(s.models,o)||(s.models=o),l.Njj(o)}),e.k0s()}if(2&i){const t=e.XpG(2);e.R50("models",t.models),e.Y8G("draggable",!1)}}function Xt(i,r){if(1&i&&e.nrm(0,"cue-bim-fragments-toolbar",12),2&i){const t=e.XpG(3),n=e.r8f(3);e.Aen(t.toolbarStyle()),e.Y8G("settings",n)}}function Lt(i,r){1&i&&e.nVh(0,Xt,1,3,"cue-bim-fragments-toolbar",11),2&i&&e.vxM(r.hidden?-1:0)}function Yt(i,r){if(1&i&&(e.j41(0,"cue-card",13),e.nrm(1,"cue-bim-fragments-props-viewer",14),e.k0s()),2&i){const t=e.XpG(2);e.AVh("hidden",null===t.$clickedElement()),e.R7$(),e.Y8G("element",r)("wrapInCard",!1)}}function Ht(i,r){if(1&i){const t=e.RV6();e.j41(0,"cue-card",5),e.nVh(1,At,1,2,"cue-bim-fragments-visibility-menu",6),e.k0s(),e.j41(2,"cue-card",7)(3,"div",8,1),e.bIt("resized",function(){l.eBV(t);const o=e.XpG();return l.Njj(o.onResized())})("windowResized",function(){l.eBV(t);const o=e.XpG();return l.Njj(o.onResized())}),e.k0s(),e.nVh(5,Lt,1,1),e.k0s(),e.nVh(6,Yt,2,4,"cue-card",9)}if(2&i){let t,n;const o=e.XpG(),s=e.sdS(1),a=e.r8f(3);e.R7$(),e.vxM(a.showModelList&&o.models().length?1:-1),e.R7$(2),e.Y8G("cueContextMenu",s)("contextMenuData",e.lJ4(6,ne))("cueContextEnabled",null!==o.$hoveredElement()),e.R7$(2),e.vxM((t=a.toolbar)?5:-1,t),e.R7$(),e.vxM((n=o.$clickedElement())?6:-1,n)}}function Wt(i,r){if(1&i&&e.nrm(0,"cue-bim-fragments-toolbar",12),2&i){const t=e.XpG(3),n=e.r8f(3);e.Aen(t.toolbarStyle()),e.Y8G("settings",n)}}function Qt(i,r){1&i&&e.nVh(0,Wt,1,3,"cue-bim-fragments-toolbar",11),2&i&&e.vxM(r.hidden?-1:0)}function Zt(i,r){1&i&&(e.j41(0,"div",16),e.nrm(1,"cue-bim-fragments-props-viewer",18),e.k0s()),2&i&&(e.R7$(),e.Y8G("element",r))}function Jt(i,r){if(1&i){const t=e.RV6();e.j41(0,"cue-bim-fragments-visibility-menu",19),e.mxI("modelsChange",function(o){l.eBV(t);const s=e.XpG(2);return e.DH7(s.models,o)||(s.models=o),l.Njj(o)}),e.k0s()}if(2&i){const t=e.XpG(2);e.R50("models",t.models)}}function Ut(i,r){if(1&i){const t=e.RV6();e.j41(0,"div",15,1),e.bIt("resized",function(){l.eBV(t);const o=e.XpG();return l.Njj(o.onResized())}),e.nVh(2,Qt,1,1),e.nVh(3,Zt,2,1,"div",16),e.nVh(4,Jt,1,1,"cue-bim-fragments-visibility-menu",17),e.k0s()}if(2&i){let t,n;const o=e.XpG(),s=e.sdS(1),a=e.r8f(3);e.Y8G("cueContextMenu",s)("contextMenuData",e.lJ4(6,ne))("cueContextEnabled",null!==o.$hoveredElement()),e.R7$(2),e.vxM((t=a.toolbar)?2:-1,t),e.R7$(),e.vxM((n=o.$clickedElement())?3:-1,n),e.R7$(),e.vxM(a.showModelList&&o.models().length?4:-1)}}let Kt=(()=>{class i{_service=(0,l.WQX)(z);data=(0,u.hFB)(void 0);settings=(0,u.hFB)(new B.R_);clickedElement=(0,u.CGW)();hoveredElement=(0,u.CGW)();selectedElements=(0,u.CGW)();$hoveredElement=(0,l.vPA)(null);$clickedElement=(0,l.vPA)(null);models=(0,g.uu)(()=>this.data()?.models??[]);detailedView=(0,g.EW)(()=>!0===this.settings().detailedViewEnabled);toolbarStyle=(0,g.EW)(()=>{const t=this.settings().toolbar;return{position:"absolute",left:t.margin,right:t.margin,["top"===t.position?"top":"bottom"]:t.margin,"z-index":"10",display:"flex","justify-content":"center"}});contextMenuItems=(0,g.EW)(()=>{const t=[];return this.settings().showPropertiesOnClick&&(console.log("ADDING PROPERTIES MENU ITEM"),t.push({label:"Show Properties",action:()=>{this.$clickedElement.update(()=>this._service.clickedElement())}})),this.settings().elementClickOptions&&t.push(...this.settings().elementClickOptions),t});viewerReady=this._service.viewerReady;onClickElement=(0,l.QZP)(()=>{this._service.clickedElement()||this.$clickedElement.set(null),this.clickedElement.emit(this._service.clickedElement())});onHoverElement=(0,l.QZP)(()=>{this.$hoveredElement.set(this._service.hoveredElement()),this.hoveredElement.emit(this._service.hoveredElement())});onSelectionChange=(0,l.QZP)(()=>{this.selectedElements.emit(this._service.selectedElements())});set bimViewer(t){t&&this._service.init(t.nativeElement)}loadFilesOnData=(0,l.QZP)(()=>{const t=this.models();console.log(t),this.viewerReady()&&t.length&&(console.info("Loading models:",t),this._service.updateModels(t))});setSettings=(0,l.QZP)(()=>this._service.settings.update(()=>Object.assign({},this.settings())));ngOnDestroy(){this._service.dispose()}onResized(){this._service.updateAspectRatio()}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=e.VBU({type:i,selectors:[["cue-bim-fragments-viewer"]],viewQuery:function(n,o){if(1&n&&e.GBs(Gt,5),2&n){let s;e.mGM(s=e.lsd())&&(o.bimViewer=s.first)}},inputs:{data:[1,"data"],settings:[1,"settings"]},outputs:{clickedElement:"clickedElement",hoveredElement:"hoveredElement",selectedElements:"selectedElements"},decls:6,vars:2,consts:[["hoveringElement",""],["bimViewer",""],["direction","row",2,"flex","1 1","height","100%"],["cueResized","","trigger","leftclick",2,"height","100%","width","100%","position","relative",3,"cueContextMenu","contextMenuData","cueContextEnabled"],[3,"click"],["variant","primary",2,"flex","0 0 250px","min-width","0","display","flex","flex-direction","column","gap","0.5rem","padding","0.5rem"],[3,"models","draggable"],[2,"flex","1 1 0","min-width","0","position","relative","display","flex"],["cueResized","","trigger","leftclick",2,"height","100%","width","100%","min-width","0","min-height","0","flex","1 1 0",3,"resized","windowResized","cueContextMenu","contextMenuData","cueContextEnabled"],["variant","accent",2,"flex","0 0 250px","min-width","0","display","flex","flex-direction","column","gap","0.5rem","padding","0.5rem",3,"hidden"],[3,"modelsChange","models","draggable"],[3,"settings","style"],[3,"settings"],["variant","accent",2,"flex","0 0 250px","min-width","0","display","flex","flex-direction","column","gap","0.5rem","padding","0.5rem"],[2,"flex","1 1","min-height","0",3,"element","wrapInCard"],["cueResized","","trigger","leftclick",2,"height","100%","width","100%","position","relative",3,"resized","cueContextMenu","contextMenuData","cueContextEnabled"],[1,"viewer-popup","props-popup"],[3,"models"],[3,"element"],[3,"modelsChange","models"]],template:function(n,o){1&n&&(e.DNE(0,St,3,0,"ng-template",null,0,e.C5r),e.j41(2,"cue-flexcontainer",2),e.SS7(3),e.nVh(4,Ht,7,7)(5,Ut,5,7,"div",3),e.k0s()),2&n&&(e.R7$(3),e.bH3(o.settings()),e.R7$(),e.vxM(o.detailedView()?4:5))},dependencies:[Ee.C,P.M,D.D,x.n,S.Z,J.Q,Te,qe,jt],styles:["[_nghost-%COMP%]{display:contents}.viewer-popup[_ngcontent-%COMP%]{position:absolute;z-index:100}.props-popup[_ngcontent-%COMP%]{top:1rem;right:1rem;bottom:1rem;width:300px}.hidden[_ngcontent-%COMP%]{display:none;color:red}"],changeDetection:0})}return i})()}}]);