@bimdata/viewer 2.14.0-beta.2 → 2.14.0-beta.3
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.
|
@@ -5530,7 +5530,7 @@ void main() {
|
|
|
5530
5530
|
`,this.viewer.addEventListener(sr.type,this),this.__updateContent(),this.hide()}destroy(){this.viewer.removeEventListener(sr.type,this),super.destroy()}handleEvent(i){i instanceof sr&&i.containsOptions("loadingImg","loadingTxt","lang")&&this.__updateContent()}setProgress(i){this.container.classList.remove("psv-loader--undefined");const e=rn.clamp(i,0,99.999)/100*Math.PI*2,t=this.size/2,n=t,o=this.thickness/2+this.border,r=(this.size-this.thickness)/2-this.border,s=Math.sin(e)*r+t,a=-Math.cos(e)*r+t,l=i>50?"1":"0";this.canvas.querySelector("path").setAttributeNS(null,"d",`M ${n} ${o} A ${r} ${r} 0 ${l} 1 ${s} ${a}`)}showUndefined(){this.show(),this.setProgress(25),this.container.classList.add("psv-loader--undefined")}__updateContent(){const i=this.loader.querySelector(".psv-loader-image, .psv-loader-text");i&&this.loader.removeChild(i);let e;if(this.viewer.config.loadingImg?(e=document.createElement("img"),e.className="psv-loader-image",e.src=this.viewer.config.loadingImg):this.viewer.config.loadingTxt!==null&&(e=document.createElement("div"),e.className="psv-loader-text",e.innerHTML=this.viewer.config.loadingTxt||this.viewer.config.lang.loading),e){const t=Math.round(Math.sqrt(2*Math.pow(this.size/2-this.thickness/2-this.border,2)));e.style.maxWidth=t+"px",e.style.maxHeight=t+"px",this.loader.appendChild(e)}}},AVt=class extends Vh{constructor(i){super(i,{className:"psv-notification"}),this.state={visible:!1,contentId:null,timeout:null},this.content=document.createElement("div"),this.content.className="psv-notification-content",this.container.appendChild(this.content),this.content.addEventListener("click",()=>this.hide())}isVisible(i){return this.state.visible&&(!i||!this.state.contentId||this.state.contentId===i)}toggle(){throw new tn("Notification cannot be toggled")}show(i){this.state.timeout&&(clearTimeout(this.state.timeout),this.state.timeout=null),typeof i=="string"&&(i={content:i}),this.state.contentId=i.id||null,this.content.innerHTML=i.content,this.container.classList.add("psv-notification--visible"),this.state.visible=!0,this.viewer.dispatchEvent(new x5(this.state.contentId)),i.timeout&&(this.state.timeout=setTimeout(()=>this.hide(this.state.contentId),i.timeout))}hide(i){if(this.isVisible(i)){const e=this.state.contentId;this.container.classList.remove("psv-notification--visible"),this.state.visible=!1,this.state.contentId=null,this.viewer.dispatchEvent(new y5(e))}}},mVt=class extends Vh{constructor(i){super(i,{className:`psv-overlay ${f5}`}),this.state={visible:!1,contentId:null,dismissible:!0},this.image=document.createElement("div"),this.image.className="psv-overlay-image",this.container.appendChild(this.image),this.title=document.createElement("div"),this.title.className="psv-overlay-title",this.container.appendChild(this.title),this.text=document.createElement("div"),this.text.className="psv-overlay-text",this.container.appendChild(this.text),this.container.addEventListener("click",this),this.viewer.addEventListener(ad.type,this),super.hide()}destroy(){this.viewer.removeEventListener(ad.type,this),super.destroy()}handleEvent(i){i.type==="click"?this.isVisible()&&this.state.dismissible&&(this.hide(),i.stopPropagation()):i instanceof ad&&this.isVisible()&&this.state.dismissible&&i.matches(Lo.Escape)&&(this.hide(),i.preventDefault())}isVisible(i){return this.state.visible&&(!i||!this.state.contentId||this.state.contentId===i)}toggle(){throw new tn("Overlay cannot be toggled")}show(i){typeof i=="string"&&(i={title:i}),this.state.contentId=i.id||null,this.state.dismissible=i.dismissible!==!1,this.image.innerHTML=i.image||"",this.title.innerHTML=i.title||"",this.text.innerHTML=i.text||"",super.show(),this.viewer.dispatchEvent(new Mde(this.state.contentId))}hide(i){if(this.isVisible(i)){const e=this.state.contentId;super.hide(),this.state.contentId=null,this.viewer.dispatchEvent(new nde(e))}}},gVt=200,OD="psv-panel-content--no-interaction",vVt=class extends Vh{constructor(i){super(i,{className:`psv-panel ${f5}`}),this.state={visible:!1,contentId:null,mouseX:0,mouseY:0,mousedown:!1,clickHandler:null,keyHandler:null,width:{}};const e=document.createElement("div");e.className="psv-panel-resizer",this.container.appendChild(e);const t=document.createElement("div");t.className="psv-panel-close-button",t.innerHTML=Da.close,t.title=i.config.lang.close,this.container.appendChild(t),this.content=document.createElement("div"),this.content.className="psv-panel-content",this.container.appendChild(this.content),t.addEventListener("click",()=>this.hide()),e.addEventListener("mousedown",this),e.addEventListener("touchstart",this),this.viewer.container.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchend",this),this.viewer.container.addEventListener("mousemove",this),this.viewer.container.addEventListener("touchmove",this),this.viewer.addEventListener(ad.type,this)}destroy(){this.viewer.removeEventListener(ad.type,this),this.viewer.container.removeEventListener("mousemove",this),this.viewer.container.removeEventListener("touchmove",this),this.viewer.container.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchend",this),super.destroy()}handleEvent(i){switch(i.type){case"mousedown":this.__onMouseDown(i);break;case"touchstart":this.__onTouchStart(i);break;case"mousemove":this.__onMouseMove(i);break;case"touchmove":this.__onTouchMove(i);break;case"mouseup":this.__onMouseUp(i);break;case"touchend":this.__onTouchEnd(i);break;case ad.type:this.__onKeyPress(i);break}}isVisible(i){return this.state.visible&&(!i||!this.state.contentId||this.state.contentId===i)}toggle(){throw new tn("Panel cannot be toggled")}show(i){typeof i=="string"&&(i={content:i});const e=this.isVisible(i.id);this.state.contentId=i.id||null,this.state.visible=!0,this.state.clickHandler&&(this.content.removeEventListener("click",this.state.clickHandler),this.content.removeEventListener("keydown",this.state.keyHandler),this.state.clickHandler=null,this.state.keyHandler=null),i.id&&this.state.width[i.id]?this.container.style.width=this.state.width[i.id]:i.width?this.container.style.width=i.width:this.container.style.width=null,this.content.innerHTML=i.content,this.content.scrollTop=0,this.container.classList.add("psv-panel--open"),_w(this.content,"psv-panel-content--no-margin",i.noMargin===!0),i.clickHandler&&(this.state.clickHandler=t=>{i.clickHandler(Lw(t))},this.state.keyHandler=t=>{t.key===Lo.Enter&&i.clickHandler(Lw(t))},this.content.addEventListener("click",this.state.clickHandler),this.content.addEventListener("keydown",this.state.keyHandler),e||setTimeout(()=>{this.content.querySelector("a,button,[tabindex]")?.focus()},300)),this.viewer.dispatchEvent(new ld(this.state.contentId))}hide(i){if(this.isVisible(i)){const e=this.state.contentId;this.state.visible=!1,this.state.contentId=null,this.content.innerHTML=null,this.container.classList.remove("psv-panel--open"),this.state.clickHandler&&(this.content.removeEventListener("click",this.state.clickHandler),this.content.removeEventListener("keydown",this.state.keyHandler),this.state.clickHandler=null,this.state.keyHandler=null),this.viewer.dispatchEvent(new rd(e))}}__onMouseDown(i){i.stopPropagation(),this.__startResize(i.clientX,i.clientY)}__onTouchStart(i){if(i.stopPropagation(),i.touches.length===1){const e=i.touches[0];this.__startResize(e.clientX,e.clientY)}}__onMouseUp(i){this.state.mousedown&&(i.stopPropagation(),this.state.mousedown=!1,this.content.classList.remove(OD))}__onTouchEnd(i){this.state.mousedown&&(i.stopPropagation(),i.touches.length===0&&(this.state.mousedown=!1,this.content.classList.remove(OD)))}__onMouseMove(i){this.state.mousedown&&(i.stopPropagation(),this.__resize(i.clientX,i.clientY))}__onTouchMove(i){if(this.state.mousedown){const e=i.touches[0];this.__resize(e.clientX,e.clientY)}}__onKeyPress(i){this.isVisible()&&i.matches(Lo.Escape)&&(this.hide(),i.preventDefault())}__startResize(i,e){this.state.mouseX=i,this.state.mouseY=e,this.state.mousedown=!0,this.content.classList.add(OD)}__resize(i,e){const t=i,n=e,o=Math.max(gVt,this.container.offsetWidth-(t-this.state.mouseX))+"px";this.state.contentId&&(this.state.width[this.state.contentId]=o),this.container.style.width=o,this.state.mouseX=t,this.state.mouseY=n}},yVt=class extends Vh{constructor(i,e){super(i,{className:"psv-tooltip"}),this.state={visible:!0,arrow:0,border:0,state:0,width:0,height:0,pos:"",config:null,data:null,hideTimeout:null},this.content=document.createElement("div"),this.content.className="psv-tooltip-content",this.container.appendChild(this.content),this.arrow=document.createElement("div"),this.arrow.className="psv-tooltip-arrow",this.container.appendChild(this.arrow),this.container.addEventListener("transitionend",this),this.container.addEventListener("touchdown",t=>t.stopPropagation()),this.container.addEventListener("mousedown",t=>t.stopPropagation()),this.container.style.top="-1000px",this.container.style.left="-1000px",this.show(e)}handleEvent(i){i.type==="transitionend"&&this.__onTransitionEnd(i)}destroy(){clearTimeout(this.state.hideTimeout),delete this.state.data,super.destroy()}toggle(){throw new tn("Tooltip cannot be toggled")}show(i){if(this.state.state!==0)throw new tn("Initialized tooltip cannot be re-initialized");i.className&&gD(this.container,i.className),i.style&&Object.assign(this.container.style,i.style),this.state.state=3,this.update(i.content,i),this.state.data=i.data,this.state.state=1,this.viewer.dispatchEvent(new Ide(this,this.state.data)),this.__waitImages()}update(i,e){this.content.innerHTML=i;const t=this.container.getBoundingClientRect();this.state.width=t.right-t.left,this.state.height=t.bottom-t.top,this.state.arrow=parseInt(xl(this.arrow,"border-top-width"),10),this.state.border=parseInt(xl(this.container,"border-top-left-radius"),10),this.move(e??this.state.config),this.__waitImages()}move(i){if(this.state.state!==1&&this.state.state!==3)throw new tn("Uninitialized tooltip cannot be moved");i.box=i.box??this.state.config?.box??{width:0,height:0},this.state.config=i;const e=this.container,t=this.arrow,n={posClass:Lue(i.position,{allowCenter:!1,cssOrder:!1})||["top","center"],width:this.state.width,height:this.state.height,top:0,left:0,arrowTop:0,arrowLeft:0};this.__computeTooltipPosition(n,i);let o=null,r=null;if(n.top<0?o="bottom":n.top+n.height>this.viewer.state.size.height&&(o="top"),n.left<0?r="right":n.left+n.width>this.viewer.state.size.width&&(r="left"),r||o){const a=MD(n.posClass);o&&(n.posClass[a?0:1]=o),r&&(n.posClass[a?1:0]=r),this.__computeTooltipPosition(n,i)}e.style.top=n.top+"px",e.style.left=n.left+"px",t.style.top=n.arrowTop+"px",t.style.left=n.arrowLeft+"px";const s=n.posClass.join("-");s!==this.state.pos&&(e.classList.remove(`psv-tooltip--${this.state.pos}`),this.state.pos=s,e.classList.add(`psv-tooltip--${this.state.pos}`))}hide(){this.container.classList.remove("psv-tooltip--visible"),this.state.state=2,this.viewer.dispatchEvent(new rde(this.state.data));const i=parseFloat(xl(this.container,"transition-duration"));this.state.hideTimeout=setTimeout(()=>{this.destroy()},i*2)}__onTransitionEnd(i){if(i.propertyName==="transform")switch(this.state.state){case 1:this.container.classList.add("psv-tooltip--visible"),this.state.state=3;break;case 2:this.state.state=0,this.destroy();break}}__computeTooltipPosition(i,e){const t=this.state.arrow,n=e.top,o=i.height,r=e.left,s=i.width,a=t+this.state.border,l=e.box.width/2+t*2,c=e.box.height/2+t*2;switch(i.posClass.join("-")){case"top-left":i.top=n-c-o,i.left=r+a-s,i.arrowTop=o,i.arrowLeft=s-a-t;break;case"top-center":i.top=n-c-o,i.left=r-s/2,i.arrowTop=o,i.arrowLeft=s/2-t;break;case"top-right":i.top=n-c-o,i.left=r-a,i.arrowTop=o,i.arrowLeft=t;break;case"bottom-left":i.top=n+c,i.left=r+a-s,i.arrowTop=-t*2,i.arrowLeft=s-a-t;break;case"bottom-center":i.top=n+c,i.left=r-s/2,i.arrowTop=-t*2,i.arrowLeft=s/2-t;break;case"bottom-right":i.top=n+c,i.left=r-a,i.arrowTop=-t*2,i.arrowLeft=t;break;case"left-top":i.top=n+a-o,i.left=r-l-s,i.arrowTop=o-a-t,i.arrowLeft=s;break;case"center-left":i.top=n-o/2,i.left=r-l-s,i.arrowTop=o/2-t,i.arrowLeft=s;break;case"left-bottom":i.top=n-a,i.left=r-l-s,i.arrowTop=t,i.arrowLeft=s;break;case"right-top":i.top=n+a-o,i.left=r+l,i.arrowTop=o-a-t,i.arrowLeft=-t*2;break;case"center-right":i.top=n-o/2,i.left=r+l,i.arrowTop=o/2-t,i.arrowLeft=-t*2;break;case"right-bottom":i.top=n-a,i.left=r+l,i.arrowTop=t,i.arrowLeft=-t*2;break}}__waitImages(){const i=this.content.querySelectorAll("img");if(i.length>0){const e=[];i.forEach(t=>{t.complete||e.push(new Promise(n=>{t.onload=n,t.onerror=n}))}),e.length&&Promise.all(e).then(()=>{if(this.state.state===1||this.state.state===3){const t=this.container.getBoundingClientRect();this.state.width=t.right-t.left,this.state.height=t.bottom-t.top,this.move(this.state.config)}})}}},wVt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="15 15 70 70"><path fill="currentColor" d="M50,16.2c-18.6,0-33.8,15.1-33.8,33.8S31.4,83.7,50,83.7S83.8,68.6,83.8,50S68.6,16.2,50,16.2z M50,80.2c-16.7,0-30.2-13.6-30.2-30.2S33.3,19.7,50,19.7S80.3,33.3,80.3,50S66.7,80.2,50,80.2z"/><rect fill="currentColor" x="48" y="31.7" width="4" height="28"/><rect fill="currentColor" x="48" y="63.2" width="4" height="5"/><!--Created by Shastry from the Noun Project--></svg>
|
|
5531
5531
|
`,P5=class{constructor(i){this.viewer=i,this.config=i.config,this.state=i.state}destroy(){}},_a=new nt,Jw=new yl(0,0,0,"ZXY"),CVt=class extends P5{constructor(i){super(i)}fovToZoomLevel(i){const e=Math.round((i-this.config.minFov)/(this.config.maxFov-this.config.minFov)*100);return rn.clamp(e-2*(e-50),0,100)}zoomLevelToFov(i){return this.config.maxFov+i/100*(this.config.minFov-this.config.maxFov)}vFovToHFov(i){return rn.radToDeg(2*Math.atan(Math.tan(rn.degToRad(i)/2)*this.state.aspect))}hFovToVFov(i){return rn.radToDeg(2*Math.atan(Math.tan(rn.degToRad(i)/2)/this.state.aspect))}getAnimationProperties(i,e,t){const n=!Fo(e),o=!Fo(t),r={};let s=null;if(n){const a=this.viewer.getPosition(),l=vue(a.yaw,e.yaw);r.yaw={start:a.yaw,end:a.yaw+l},r.pitch={start:a.pitch,end:e.pitch},s=BD(i,yue(a,e))}if(o){const a=this.viewer.getZoomLevel(),l=Math.abs(t-a);r.zoom={start:a,end:t},s===null&&(s=BD(i,Math.PI/4*l/100))}return s===null?typeof i=="number"?s=i:s=mD:s=Math.max(mD,s),{duration:s,properties:r}}getTransitionOptions(i){let e;const t=this.config.defaultTransition??Nm.defaultTransition;return i.transition===!1||i.transition===null?e=null:i.transition===!0?e={...t}:typeof i.transition=="object"?e={...t,...i.transition}:e=this.config.defaultTransition,e}textureCoordsToSphericalCoords(i){if(!this.state.textureData?.panoData)throw new tn("Current adapter does not support texture coordinates or no texture has been loaded");const e=this.viewer.adapter.textureCoordsToSphericalCoords(i,this.state.textureData.panoData);return!Jw.equals(this.viewer.renderer.panoramaPose)||!Jw.equals(this.viewer.renderer.sphereCorrection)?(this.sphericalCoordsToVector3(e,_a),_a.applyEuler(this.viewer.renderer.panoramaPose),_a.applyEuler(this.viewer.renderer.sphereCorrection),this.vector3ToSphericalCoords(_a)):e}sphericalCoordsToTextureCoords(i){if(!this.state.textureData?.panoData)throw new tn("Current adapter does not support texture coordinates or no texture has been loaded");return(!Jw.equals(this.viewer.renderer.panoramaPose)||!Jw.equals(this.viewer.renderer.sphereCorrection))&&(this.sphericalCoordsToVector3(i,_a),ID(_a,this.viewer.renderer.sphereCorrection),ID(_a,this.viewer.renderer.panoramaPose),i=this.vector3ToSphericalCoords(_a)),this.viewer.adapter.sphericalCoordsToTextureCoords(i,this.state.textureData.panoData)}sphericalCoordsToVector3(i,e,t=Nh){return e||(e=new nt),e.x=t*-Math.cos(i.pitch)*Math.sin(i.yaw),e.y=t*Math.sin(i.pitch),e.z=t*Math.cos(i.pitch)*Math.cos(i.yaw),e}vector3ToSphericalCoords(i){const e=Math.acos(i.y/Math.sqrt(i.x*i.x+i.y*i.y+i.z*i.z)),t=Math.atan2(i.x,i.z);return{yaw:t<0?-t:Math.PI*2-t,pitch:Math.PI/2-e}}viewerCoordsToVector3(i){const e=this.viewer.renderer.getIntersections(i).filter(t=>t.object.userData[od]);return e.length?e[0].point:null}viewerCoordsToSphericalCoords(i){const e=this.viewerCoordsToVector3(i);return e?this.vector3ToSphericalCoords(e):null}vector3ToViewerCoords(i){const e=i.clone();return e.project(this.viewer.renderer.camera),{x:Math.round((e.x+1)/2*this.state.size.width),y:Math.round((1-e.y)/2*this.state.size.height)}}sphericalCoordsToViewerCoords(i){return this.sphericalCoordsToVector3(i,_a),this.vector3ToViewerCoords(_a)}isPointVisible(i){let e,t;if(i instanceof nt)e=i,t=this.vector3ToViewerCoords(i);else if(xD(i))e=this.sphericalCoordsToVector3(i,_a),t=this.vector3ToViewerCoords(e);else return!1;return e.dot(this.viewer.state.direction)>0&&t.x>=0&&t.x<=this.viewer.state.size.width&&t.y>=0&&t.y<=this.viewer.state.size.height}cleanPosition(i){if("yaw"in i||"pitch"in i){if(!("yaw"in i)||!("pitch"in i))throw new tn("Position is missing 'yaw' or 'pitch'");return{yaw:Ml(i.yaw),pitch:Ml(i.pitch,!0)}}else return this.textureCoordsToSphericalCoords(i)}cleanSphereCorrection(i){return{pan:Ml(i?.pan||0),tilt:Ml(i?.tilt||0,!0),roll:Ml(i?.roll||0,!0,!1)}}cleanPanoramaPose(i){return{pan:rn.degToRad(i?.poseHeading||0),tilt:rn.degToRad(i?.posePitch||0),roll:rn.degToRad(i?.poseRoll||0)}}cleanPanoramaOptions(i,e){return e?.isEquirectangular&&(Fo(i.zoom)&&!Fo(e.initialFov)&&(i={...i,zoom:this.fovToZoomLevel(this.hFovToVFov(e.initialFov))}),Fo(i.position)&&!Fo(e.initialHeading)&&!Fo(e.initialPitch)&&(i={...i,position:{yaw:Ml(e.initialHeading),pitch:Ml(e.initialPitch,!0)}})),i}},bVt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="currentColor" d="M33.38 33.2a1.96 1.96 0 0 0 1.5-3.23 10.61 10.61 0 0 1 7.18-17.51c.7-.06 1.31-.49 1.61-1.12a13.02 13.02 0 0 1 11.74-7.43c7.14 0 12.96 5.8 12.96 12.9 0 3.07-1.1 6.05-3.1 8.38-.7.82-.61 2.05.21 2.76.83.7 2.07.6 2.78-.22a16.77 16.77 0 0 0 4.04-10.91C72.3 7.54 64.72 0 55.4 0a16.98 16.98 0 0 0-14.79 8.7 14.6 14.6 0 0 0-12.23 14.36c0 3.46 1.25 6.82 3.5 9.45.4.45.94.69 1.5.69m45.74 43.55a22.13 22.13 0 0 1-5.23 12.4c-4 4.55-9.53 6.86-16.42 6.86-12.6 0-20.1-10.8-20.17-10.91a1.82 1.82 0 0 0-.08-.1c-5.3-6.83-14.55-23.82-17.27-28.87-.05-.1 0-.21.02-.23a6.3 6.3 0 0 1 8.24 1.85l9.38 12.59a1.97 1.97 0 0 0 3.54-1.17V25.34a4 4 0 0 1 1.19-2.87 3.32 3.32 0 0 1 2.4-.95c1.88.05 3.4 1.82 3.4 3.94v24.32a1.96 1.96 0 0 0 3.93 0v-33.1a3.5 3.5 0 0 1 7 0v35.39a1.96 1.96 0 0 0 3.93 0v-.44c.05-2.05 1.6-3.7 3.49-3.7 1.93 0 3.5 1.7 3.5 3.82v5.63c0 .24.04.48.13.71l.1.26a1.97 1.97 0 0 0 3.76-.37c.33-1.78 1.77-3.07 3.43-3.07 1.9 0 3.45 1.67 3.5 3.74l-1.77 18.1zM77.39 51c-1.25 0-2.45.32-3.5.9v-.15c0-4.27-3.33-7.74-7.42-7.74-1.26 0-2.45.33-3.5.9V16.69a7.42 7.42 0 0 0-14.85 0v1.86a7 7 0 0 0-3.28-.94 7.21 7.21 0 0 0-5.26 2.07 7.92 7.92 0 0 0-2.38 5.67v37.9l-5.83-7.82a10.2 10.2 0 0 0-13.35-2.92 4.1 4.1 0 0 0-1.53 5.48C20 64.52 28.74 80.45 34.07 87.34c.72 1.04 9.02 12.59 23.4 12.59 7.96 0 14.66-2.84 19.38-8.2a26.06 26.06 0 0 0 6.18-14.6l1.78-18.2v-.2c0-4.26-3.32-7.73-7.42-7.73z"/><!--Created by AomAm from the Noun Project--></svg>
|
|
5532
5532
|
`,xVt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="10 17 79 79"><path fill="currentColor" d="M38.1 29.27c-.24 0-.44.2-.44.45v10.7a.45.45 0 00.9 0v-10.7c0-.25-.2-.45-.45-.45zm10.2 26.66a11.54 11.54 0 01-8.48-6.14.45.45 0 10-.8.41 12.45 12.45 0 009.22 6.62.45.45 0 00.07-.9zm24.55-13.08a23.04 23.04 0 00-22.56-23v7.07l-.01.05a2.83 2.83 0 012.39 2.78v14.03l.09-.02h8.84v-9.22a.45.45 0 11.9 0v9.22h10.35v-.9zm0 27.33V44.66H62.5c-.02 2.01-.52 4-1.47 5.76a.45.45 0 01-.61.18.45.45 0 01-.19-.61 11.54 11.54 0 001.36-5.33h-8.83l-.1-.01a2.83 2.83 0 01-2.83 2.84h-.04-.04a2.83 2.83 0 01-2.83-2.83v-14.9a2.82 2.82 0 012.47-2.8v-7.11a23.04 23.04 0 00-22.57 23v.91h14.72V29.88a8.2 8.2 0 015.02-7.57c.22-.1.5.01.59.24.1.23-.01.5-.24.6a7.3 7.3 0 00-4.47 6.73v13.88h3.9a.45.45 0 110 .9h-3.9v.15a7.32 7.32 0 0011.23 6.17.45.45 0 01.49.76 8.22 8.22 0 01-12.62-6.93v-.15H26.82v25.52a23.04 23.04 0 0023.01 23.01 23.04 23.04 0 0023.02-23.01zm1.8-27.33v27.33A24.85 24.85 0 0149.84 95a24.85 24.85 0 01-24.82-24.82V42.85a24.85 24.85 0 0124.82-24.82 24.85 24.85 0 0124.83 24.82zM57.98 29.88v9.36a.45.45 0 11-.9 0v-9.36a7.28 7.28 0 00-3.4-6.17.45.45 0 01.49-.76 8.18 8.18 0 013.8 6.93z"/><!-- Created by Icon Island from the Noun Project --></svg>
|
|
5533
|
-
`,Ww=class c0e{constructor(){this.$=c0e.IDLE}is(...e){return e.some(t=>this.$&t)}set(e){this.$=e}add(e){this.$|=e}remove(e){this.$&=~e}};Ww.IDLE=0,Ww.CLICK=1,Ww.MOVING=2;var mo=Ww,MVt=class extends P5{constructor(i){super(i),this.data={startMouseX:0,startMouseY:0,mouseX:0,mouseY:0,pinchDist:0,moveDelta:{yaw:0,pitch:0,zoom:0},accumulatorFactor:0,ctrlKeyDown:!1,dblclickData:null,dblclickTimeout:null,longtouchTimeout:null,twofingersTimeout:null,ctrlZoomTimeout:null},this.step=new mo,this.keyHandler=new jw,this.resizeObserver=new ResizeObserver(Iue(()=>this.viewer.autoSize(),50)),this.moveThreshold=uue*Os.pixelRatio}init(){window.addEventListener("keydown",this,{passive:!1}),window.addEventListener("keyup",this),this.viewer.container.addEventListener("mousedown",this),window.addEventListener("mousemove",this,{passive:!1}),window.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchstart",this,{passive:!1}),window.addEventListener("touchmove",this,{passive:!1}),window.addEventListener("touchend",this,{passive:!1}),this.viewer.container.addEventListener("wheel",this,{passive:!1}),document.addEventListener("fullscreenchange",this),this.resizeObserver.observe(this.viewer.container),this.viewer.addEventListener(g5.type,this),this.viewer.addEventListener(B5.type,this)}destroy(){window.removeEventListener("keydown",this),window.removeEventListener("keyup",this),this.viewer.container.removeEventListener("mousedown",this),window.removeEventListener("mousemove",this),window.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchstart",this),window.removeEventListener("touchmove",this),window.removeEventListener("touchend",this),this.viewer.container.removeEventListener("wheel",this),document.removeEventListener("fullscreenchange",this),this.resizeObserver.disconnect(),this.viewer.removeEventListener(g5.type,this),this.viewer.removeEventListener(B5.type,this),clearTimeout(this.data.dblclickTimeout),clearTimeout(this.data.longtouchTimeout),clearTimeout(this.data.twofingersTimeout),clearTimeout(this.data.ctrlZoomTimeout),super.destroy()}handleEvent(i){switch(i.type){case"keydown":this.__onKeyDown(i);break;case"keyup":this.__onKeyUp();break;case"mousemove":this.__onMouseMove(i);break;case"mouseup":this.__onMouseUp(i);break;case"touchmove":this.__onTouchMove(i);break;case"touchend":this.__onTouchEnd(i);break;case"fullscreenchange":this.__onFullscreenChange();break;case g5.type:this.__applyMoveDelta();break;case B5.type:this.__clearMoveDelta();break}if(!bue(i,"."+f5))switch(i.type){case"mousedown":this.__onMouseDown(i);break;case"touchstart":this.__onTouchStart(i);break;case"wheel":this.__onMouseWheel(i);break}}__onKeyDown(i){if(this.config.mousewheelCtrlKey&&(this.data.ctrlKeyDown=i.key===Lo.Control,this.data.ctrlKeyDown&&(clearTimeout(this.data.ctrlZoomTimeout),this.viewer.overlay.hide(Jo.CTRL_ZOOM))),!!this.viewer.dispatchEvent(new ad(i.key,i))&&!(!this.state.keyboardEnabled||!this.config.keyboardActions||this.keyHandler.pending)){for(const[e,t]of Object.entries(this.config.keyboardActions))if(yD(i,e)){if(typeof t=="function")t(this.viewer,i);else{switch(t!=="ZOOM_IN"&&t!=="ZOOM_OUT"&&this.viewer.stopAll(),t){case"ROTATE_UP":this.viewer.dynamics.position.roll({pitch:!1});break;case"ROTATE_DOWN":this.viewer.dynamics.position.roll({pitch:!0});break;case"ROTATE_RIGHT":this.viewer.dynamics.position.roll({yaw:!1});break;case"ROTATE_LEFT":this.viewer.dynamics.position.roll({yaw:!0});break;case"ZOOM_IN":this.viewer.dynamics.zoom.roll(!1);break;case"ZOOM_OUT":this.viewer.dynamics.zoom.roll(!0);break}this.keyHandler.down(t)}i.preventDefault();return}}}__onKeyUp(){this.data.ctrlKeyDown=!1,this.state.keyboardEnabled&&this.keyHandler.up(i=>{i==="ZOOM_IN"||i==="ZOOM_OUT"?this.viewer.dynamics.zoom.stop():(this.viewer.dynamics.position.stop(),this.viewer.resetIdleTimer())})}__onMouseDown(i){this.step.add(mo.CLICK),this.data.startMouseX=i.clientX,this.data.startMouseY=i.clientY,this.config.mousemove&&i.preventDefault()}__onMouseUp(i){this.step.is(mo.CLICK,mo.MOVING)&&this.__stopMove(i.clientX,i.clientY,i,i.button===2)}__onMouseMove(i){this.config.mousemove&&this.step.is(mo.CLICK,mo.MOVING)&&(i.preventDefault(),this.__doMove(i.clientX,i.clientY)),this.__handleObjectsEvents(i)}__onTouchStart(i){i.touches.length===1?(this.step.add(mo.CLICK),this.data.startMouseX=i.touches[0].clientX,this.data.startMouseY=i.touches[0].clientY,this.data.longtouchTimeout||(this.data.longtouchTimeout=setTimeout(()=>{const e=i.touches[0];this.__stopMove(e.clientX,e.clientY,i,!0),this.data.longtouchTimeout=null},hue))):i.touches.length===2&&(this.step.set(mo.IDLE),this.__cancelLongTouch(),this.config.mousemove&&(this.__cancelTwoFingersOverlay(),this.__startMoveZoom(i),i.preventDefault()))}__onTouchEnd(i){if(this.__cancelLongTouch(),this.step.is(mo.CLICK,mo.MOVING)){if(i.preventDefault(),this.__cancelTwoFingersOverlay(),i.touches.length===1)this.__stopMove(this.data.mouseX,this.data.mouseY);else if(i.touches.length===0){const e=i.changedTouches[0];this.__stopMove(e.clientX,e.clientY,i)}}}__onTouchMove(i){if(this.__cancelLongTouch(),!!this.config.mousemove)if(i.touches.length===1){if(this.config.touchmoveTwoFingers)this.step.is(mo.CLICK)&&!this.data.twofingersTimeout&&(this.data.twofingersTimeout=setTimeout(()=>{this.viewer.overlay.show({id:Jo.TWO_FINGERS,image:bVt,title:this.config.lang.twoFingers})},pue));else if(this.step.is(mo.CLICK,mo.MOVING)){i.preventDefault();const e=i.touches[0];this.__doMove(e.clientX,e.clientY)}}else this.__doMoveZoom(i),this.__cancelTwoFingersOverlay()}__cancelLongTouch(){this.data.longtouchTimeout&&(clearTimeout(this.data.longtouchTimeout),this.data.longtouchTimeout=null)}__cancelTwoFingersOverlay(){this.config.touchmoveTwoFingers&&(this.data.twofingersTimeout&&(clearTimeout(this.data.twofingersTimeout),this.data.twofingersTimeout=null),this.viewer.overlay.hide(Jo.TWO_FINGERS))}__onMouseWheel(i){if(!this.config.mousewheel||!i.deltaY)return;if(this.config.mousewheelCtrlKey&&!this.data.ctrlKeyDown){this.viewer.overlay.show({id:Jo.CTRL_ZOOM,image:xVt,title:this.config.lang.ctrlZoom}),clearTimeout(this.data.ctrlZoomTimeout),this.data.ctrlZoomTimeout=setTimeout(()=>this.viewer.overlay.hide(Jo.CTRL_ZOOM),fue);return}i.preventDefault(),i.stopPropagation();const e=i.deltaY/Math.abs(i.deltaY)*5*this.config.zoomSpeed;e!==0&&this.viewer.dynamics.zoom.step(-e,5)}__onFullscreenChange(){const i=this.viewer.isFullscreenEnabled();this.config.keyboard==="fullscreen"&&(i?this.viewer.startKeyboardControl():this.viewer.stopKeyboardControl()),this.viewer.dispatchEvent(new v5(i))}__resetMove(){this.step.set(mo.IDLE),this.data.mouseX=0,this.data.mouseY=0,this.data.startMouseX=0,this.data.startMouseY=0}__startMoveZoom(i){this.viewer.stopAll(),this.__resetMove();const e=vD(i);this.step.set(mo.MOVING),this.data.accumulatorFactor=this.config.moveInertia,{distance:this.data.pinchDist,center:{x:this.data.mouseX,y:this.data.mouseY}}=e}__stopMove(i,e,t,n=!1){this.step.is(mo.CLICK)&&!this.__moveThresholdReached(i,e)&&this.__doClick(i,e,t,n),this.config.moveInertia&&(this.data.accumulatorFactor=Math.pow(this.config.moveInertia,.5)),this.__resetMove(),this.viewer.resetIdleTimer()}__doClick(i,e,t,n=!1){const o=this.viewer.container.getBoundingClientRect(),r=i-o.left,s=e-o.top,a=this.viewer.renderer.getIntersections({x:r,y:s}),l=a.find(c=>c.object.userData[od]);if(l){const c=this.viewer.dataHelper.vector3ToSphericalCoords(l.point),u={rightclick:n,originalEvent:t,target:Lw(t),clientX:i,clientY:e,viewerX:r,viewerY:s,yaw:c.yaw,pitch:c.pitch,objects:a.map(d=>d.object).filter(d=>!d.userData[od])};try{const d=this.viewer.dataHelper.sphericalCoordsToTextureCoords(u);Object.assign(u,d)}catch{}this.data.dblclickTimeout?(Math.abs(this.data.dblclickData.clientX-u.clientX)<this.moveThreshold&&Math.abs(this.data.dblclickData.clientY-u.clientY)<this.moveThreshold&&this.viewer.dispatchEvent(new $ue(this.data.dblclickData)),clearTimeout(this.data.dblclickTimeout),this.data.dblclickTimeout=null,this.data.dblclickData=null):(this.viewer.dispatchEvent(new Zue(u)),this.data.dblclickData=Ow(u),this.data.dblclickTimeout=setTimeout(()=>{this.data.dblclickTimeout=null,this.data.dblclickData=null},due))}}__handleObjectsEvents(i){if(!Pue(this.state.objectsObservers)&&i.composedPath().includes(this.viewer.container)){const e=xue(this.viewer.container),t={x:i.clientX-e.x,y:i.clientY-e.y},n=this.viewer.renderer.getIntersections(t),o=(r,s,a)=>{this.viewer.dispatchEvent(new a(i,r,t,s))};for(const[r,s]of Object.entries(this.state.objectsObservers)){const a=n.find(l=>l.object.userData[r]);a?(s&&a.object!==s&&(o(s,r,TD),this.state.objectsObservers[r]=null),s?o(a.object,r,Lde):(this.state.objectsObservers[r]=a.object,o(a.object,r,Rde))):s&&(o(s,r,TD),this.state.objectsObservers[r]=null)}}}__doMove(i,e){if(this.step.is(mo.CLICK)&&this.__moveThresholdReached(i,e))this.viewer.stopAll(),this.__resetMove(),this.step.set(mo.MOVING),this.data.mouseX=i,this.data.mouseY=e,this.data.accumulatorFactor=this.config.moveInertia;else if(this.step.is(mo.MOVING)){const t=(i-this.data.mouseX)*Math.cos(this.state.roll)-(e-this.data.mouseY)*Math.sin(this.state.roll),n=(e-this.data.mouseY)*Math.cos(this.state.roll)+(i-this.data.mouseX)*Math.sin(this.state.roll),o={yaw:this.config.moveSpeed*(t/this.state.size.width)*rn.degToRad(this.state.hFov),pitch:this.config.moveSpeed*(n/this.state.size.height)*rn.degToRad(this.state.vFov)};this.data.moveDelta.yaw+=o.yaw,this.data.moveDelta.pitch+=o.pitch,this.data.mouseX=i,this.data.mouseY=e}}__moveThresholdReached(i,e){return Math.abs(i-this.data.startMouseX)>=this.moveThreshold||Math.abs(e-this.data.startMouseY)>=this.moveThreshold}__doMoveZoom(i){if(this.step.is(mo.MOVING)){i.preventDefault();const e=vD(i);this.__doMove(e.center.x,e.center.y),this.data.moveDelta.zoom+=this.config.zoomSpeed*((e.distance-this.data.pinchDist)/Os.pixelRatio),this.data.pinchDist=e.distance}}__applyMoveDelta(){if(Math.abs(this.data.moveDelta.yaw)>0||Math.abs(this.data.moveDelta.pitch)>0){const e=this.viewer.getPosition();this.viewer.rotate({yaw:e.yaw-this.data.moveDelta.yaw*(1-this.config.moveInertia),pitch:e.pitch+this.data.moveDelta.pitch*(1-this.config.moveInertia)}),this.data.moveDelta.yaw*=this.data.accumulatorFactor,this.data.moveDelta.pitch*=this.data.accumulatorFactor,Math.abs(this.data.moveDelta.yaw)<=.001&&(this.data.moveDelta.yaw=0),Math.abs(this.data.moveDelta.pitch)<=.001&&(this.data.moveDelta.pitch=0)}if(Math.abs(this.data.moveDelta.zoom)>0){const e=this.viewer.getZoomLevel();this.viewer.zoom(e+this.data.moveDelta.zoom*(1-this.config.moveInertia)),this.data.moveDelta.zoom*=this.config.moveInertia,Math.abs(this.data.moveDelta.zoom)<=.001&&(this.data.moveDelta.zoom=0)}}__clearMoveDelta(){this.data.moveDelta.yaw=0,this.data.moveDelta.pitch=0,this.data.moveDelta.zoom=0}};Oi.enabled=!1;var Zw=new an,Wde=new lo,Zde=new wm,BVt=class extends P5{constructor(i){super(i),this.frustumNeedsUpdate=!0,this.renderer=new _Nt(this.config.rendererParameters),this.renderer.setPixelRatio(Os.pixelRatio),this.renderer.outputColorSpace=Ph,this.renderer.toneMapping=zle,this.renderer.domElement.className="psv-canvas",this.renderer.domElement.style.background=this.config.canvasBackground,this.scene=new Pce,this.camera=new ea(50,16/9,.1,2*Nh),this.camera.matrixAutoUpdate=!1;const e=new $r(new h5(Nh).scale(-1,1,1),new c5({opacity:0,transparent:!0,depthTest:!1,depthWrite:!1}));e.userData={[od]:!0},this.scene.add(e),this.raycaster=new kLt,this.frustum=new oD,this.container=document.createElement("div"),this.container.className="psv-canvas-container",this.container.appendChild(this.renderer.domElement),this.viewer.container.appendChild(this.container),this.container.addEventListener("contextmenu",t=>t.preventDefault()),this.viewer.addEventListener(M5.type,this),this.viewer.addEventListener(_c.type,this),this.viewer.addEventListener(w5.type,this),this.viewer.addEventListener(C5.type,this),this.viewer.addEventListener(sr.type,this),this.hide()}get panoramaPose(){return this.mesh.rotation}get sphereCorrection(){return this.meshContainer.rotation}init(){this.show(),this.renderer.setAnimationLoop(i=>this.__renderLoop(i))}destroy(){this.renderer.setAnimationLoop(null),this.cleanScene(this.scene),this.renderer.dispose(),this.viewer.container.removeChild(this.container),this.viewer.removeEventListener(M5.type,this),this.viewer.removeEventListener(_c.type,this),this.viewer.removeEventListener(w5.type,this),this.viewer.removeEventListener(C5.type,this),this.viewer.removeEventListener(sr.type,this),super.destroy()}handleEvent(i){switch(i.type){case M5.type:this.__onSizeUpdated();break;case _c.type:this.__onZoomUpdated();break;case w5.type:this.__onPositionUpdated();break;case C5.type:this.__onPositionUpdated();break;case sr.type:i.containsOptions("fisheye")&&this.__onPositionUpdated(),i.containsOptions("canvasBackground")&&(this.renderer.domElement.style.background=this.config.canvasBackground);break}}hide(){this.container.style.opacity="0"}show(){this.container.style.opacity="1"}setCustomRenderer(i){i?this.customRenderer=i(this.renderer):this.customRenderer=null,this.viewer.needsUpdate()}__onSizeUpdated(){this.renderer.setSize(this.state.size.width,this.state.size.height),this.camera.aspect=this.state.aspect,this.camera.updateProjectionMatrix(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__onZoomUpdated(){this.camera.fov=this.state.vFov,this.camera.updateProjectionMatrix(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__onPositionUpdated(){this.camera.position.set(0,0,0),this.camera.lookAt(this.state.direction),this.config.fisheye&&this.camera.position.copy(this.state.direction).multiplyScalar(this.config.fisheye/2).negate(),this.camera.rotateZ(-this.state.roll),this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__renderLoop(i){const e=this.timestamp?i-this.timestamp:0;this.timestamp=i,this.viewer.dispatchEvent(new g5(i,e)),this.viewer.dynamics.update(e),(this.state.needsUpdate||this.state.continuousUpdateCount>0)&&(this.state.needsUpdate=!1,(this.customRenderer||this.renderer).render(this.scene,this.camera),this.viewer.dispatchEvent(new Cde))}setTexture(i){this.meshContainer||(this.meshContainer=new Dm,this.scene.add(this.meshContainer)),this.state.textureData&&this.viewer.adapter.disposeTexture(this.state.textureData),this.mesh&&(this.meshContainer.remove(this.mesh),this.viewer.adapter.disposeMesh(this.mesh)),this.mesh=this.viewer.adapter.createMesh(i.panoData),this.viewer.adapter.setTexture(this.mesh,i,!1),this.meshContainer.add(this.mesh),this.state.textureData=i,this.viewer.needsUpdate()}setPanoramaPose(i,e=this.mesh){const t=this.viewer.dataHelper.cleanPanoramaPose(i);e.rotation.set(t.tilt,t.pan,t.roll,"YXZ")}setSphereCorrection(i,e=this.meshContainer){const t=this.viewer.dataHelper.cleanSphereCorrection(i);e.rotation.set(t.tilt,t.pan,t.roll,"YXZ")}transition(i,e,t){const n=t.effect==="fade"||t.rotation,o=!Fo(e.position),r=!Fo(e.zoom),s=new PD(o?this.viewer.dataHelper.cleanPosition(e.position):void 0,e.zoom);this.viewer.dispatchEvent(s);const a=new Dm,l=this.viewer.adapter.createMesh(i.panoData);if(this.viewer.adapter.setTexture(l,i,!0),this.viewer.adapter.setTextureOpacity(l,0),this.setPanoramaPose(i.panoData,l),this.setSphereCorrection(e.sphereCorrection,a),o&&!t.rotation){const h=this.viewer.getPosition(),p=new nt(0,1,0);a.rotateOnWorldAxis(p,s.position.yaw-h.yaw);const A=new nt(0,1,0).cross(this.camera.getWorldDirection(new nt)).normalize();a.rotateOnWorldAxis(A,s.position.pitch-h.pitch)}a.add(l),this.scene.add(a),this.renderer.setRenderTarget(new Ju),this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null);const{duration:c,properties:u}=this.viewer.dataHelper.getAnimationProperties(t.speed,t.rotation?s.position:null,n?s.zoomLevel:null),d=new zw({properties:{...u,opacity:{start:0,end:1}},duration:c,easing:"inOutCubic",onTick:h=>{switch(t.effect){case"fade":this.viewer.adapter.setTextureOpacity(l,h.opacity);break;case"black":case"white":h.opacity<.5?this.renderer.toneMappingExposure=t.effect==="black"?rn.mapLinear(h.opacity,0,.5,1,0):rn.mapLinear(h.opacity,0,.5,1,5):(this.renderer.toneMappingExposure=t.effect==="black"?rn.mapLinear(h.opacity,.5,1,0,1):rn.mapLinear(h.opacity,.5,1,5,1),this.mesh.visible=!1,this.viewer.adapter.setTextureOpacity(l,1),r&&!n&&this.viewer.dynamics.zoom.setValue(s.zoomLevel));break}o&&t.rotation&&this.viewer.dynamics.position.setValue({yaw:h.yaw,pitch:h.pitch}),r&&n&&this.viewer.dynamics.zoom.setValue(h.zoom),this.viewer.needsUpdate()}});return d.then(h=>{a.remove(l),this.scene.remove(a),h?(this.viewer.adapter.disposeTexture(this.state.textureData),this.meshContainer.remove(this.mesh),this.viewer.adapter.disposeMesh(this.mesh),this.mesh=l,this.meshContainer.add(l),this.state.textureData=i,this.setPanoramaPose(i.panoData),this.setSphereCorrection(e.sphereCorrection),o&&!t.rotation&&this.viewer.rotate(e.position)):(this.viewer.adapter.disposeTexture(i),this.viewer.adapter.disposeMesh(l))}),d}getIntersections(i){Zw.x=2*i.x/this.state.size.width-1,Zw.y=-2*i.y/this.state.size.height+1,this.raycaster.setFromCamera(Zw,this.camera);const e=this.raycaster.intersectObjects(this.scene.children,!0).filter(t=>t.object.visible).filter(t=>t.object.isMesh&&!!t.object.userData);return this.customRenderer?.getIntersections&&e.push(...this.customRenderer.getIntersections(this.raycaster,Zw)),e}isObjectVisible(i){if(!i)return!1;if(this.frustumNeedsUpdate&&(Wde.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),this.frustum.setFromProjectionMatrix(Wde),this.frustumNeedsUpdate=!1),i.isVector3)return this.frustum.containsPoint(i);if(i.isMesh&&i.geometry){const e=i;return e.geometry.boundingBox||e.geometry.computeBoundingBox(),Zde.copy(e.geometry.boundingBox).applyMatrix4(e.matrixWorld),this.frustum.intersectsBox(Zde)}else return i.isObject3D?this.frustum.intersectsObject(i):!1}addObject(i){this.scene.add(i)}removeObject(i){this.scene.remove(i)}cleanScene(i){const e=t=>{t.map?.dispose(),t.uniforms&&Object.values(t.uniforms).forEach(n=>{n.value?.dispose?.()}),t.dispose()};i.traverse(t=>{t.geometry?.dispose(),t.material&&(Array.isArray(t.material)?t.material.forEach(n=>{e(n)}):e(t.material)),t instanceof Pce||t.dispose?.(),t!==i&&this.cleanScene(t)})}},EVt=class extends SLt{constructor(){super(...arguments),this._abortController=new AbortController}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}load(i,e,t,n){const o=this._abortController.signal,r=super.load(i,l=>{a(),e(l)},t,l=>{if(a(),o.aborted){const c=new Error;c.name="AbortError",c.message="The operation was aborted.",n(c)}else n(l)});function s(){r.src=""}function a(){o.removeEventListener("abort",s,!1)}return o.addEventListener("abort",s,!1),r}},IVt=class extends P5{constructor(i){super(i),this.fileLoader=new ILt,this.fileLoader.setResponseType("blob"),this.imageLoader=new EVt}destroy(){this.abortLoading(),super.destroy()}abortLoading(){this.fileLoader.abort?.(),this.imageLoader.abort()}loadFile(i,e,t){const n=Hm.get(i,t);if(n){if(n instanceof Blob)return e?.(100),Promise.resolve(n);Hm.remove(i,t)}this.config.requestHeaders&&this.fileLoader.setRequestHeader(this.config.requestHeaders(i)),this.fileLoader.setWithCredentials(this.config.withCredentials(i));let o=0;return e?.(o),this.fileLoader.loadAsync(i,r=>{if(r.lengthComputable){const s=r.loaded/r.total*100;s>o&&(o=s,e?.(o))}}).then(r=>(o=100,e?.(o),Hm.add(i,t,r),r))}loadImage(i,e,t){const n=Hm.get(i,t);return n?(e?.(100),n instanceof Blob?this.blobToImage(n):Promise.resolve(n)):!e&&!this.config.requestHeaders?(this.imageLoader.setWithCredentials(this.config.withCredentials(i)),this.imageLoader.loadAsync(i).then(o=>(Hm.add(i,t,o),o))):this.loadFile(i,e,t).then(o=>this.blobToImage(o))}blobToImage(i){return new Promise((e,t)=>{const n=document.createElement("img");n.onload=()=>{URL.revokeObjectURL(n.src),e(n)},n.onerror=t,n.src=URL.createObjectURL(i)})}preloadPanorama(i){return this.viewer.adapter.supportsPreload(i)?this.viewer.adapter.loadTexture(i,!1):Promise.reject(new tn("Current adapter does not support preload"))}dispatchProgress(i){this.viewer.loader.setProgress(i),this.viewer.dispatchEvent(new cde(Math.round(i)))}},SVt=class extends P5{constructor(i){super(i),this.zoom=new m5(e=>{this.viewer.state.vFov=this.viewer.dataHelper.zoomLevelToFov(e),this.viewer.state.hFov=this.viewer.dataHelper.vFovToHFov(this.viewer.state.vFov),this.viewer.dispatchEvent(new _c(e))},{defaultValue:this.viewer.config.defaultZoomLvl,min:0,max:100,wrap:!1}),this.position=new Hue(e=>{this.viewer.dataHelper.sphericalCoordsToVector3(e,this.viewer.state.direction),this.viewer.dispatchEvent(new w5(e))},{yaw:new m5(null,{defaultValue:this.config.defaultYaw,min:0,max:2*Math.PI,wrap:!0}),pitch:new m5(null,{defaultValue:this.config.defaultPitch,min:-Math.PI/2,max:Math.PI/2,wrap:!1})}),this.roll=new m5(e=>{this.viewer.state.roll=e,this.viewer.dispatchEvent(new C5(e))},{defaultValue:0,min:-Math.PI,max:Math.PI,wrap:!1}),this.updateSpeeds()}updateSpeeds(){this.zoom.setSpeed(this.config.zoomSpeed*50),this.position.setSpeed(rn.degToRad(this.config.moveSpeed*50)),this.roll.setSpeed(rn.degToRad(this.config.moveSpeed*50))}update(i){this.zoom.update(i),this.position.update(i),this.roll.update(i)}},PVt=class{constructor(){this.ready=!1,this.needsUpdate=!1,this.continuousUpdateCount=0,this.keyboardEnabled=!1,this.direction=new nt(0,0,Nh),this.roll=0,this.vFov=60,this.hFov=60,this.aspect=1,this.animation=null,this.transitionAnimation=null,this.loadingPromise=null,this.idleTime=-1,this.objectsObservers={},this.size={width:0,height:0}}},TVt=class extends Gue{constructor(e){if(super(),this.plugins={},this.children=[],this.parent=wue(e.container),!this.parent)throw new tn('"container" element not found.');this.parent[od]=this,this.container=document.createElement("div"),this.container.classList.add("psv-container"),this.parent.appendChild(this.container),Nue(this.parent),Uue(this.container,"core"),this.state=new PVt,this.config=dVt(e),this.__setSize(this.config.size),this.overlay=new mVt(this);try{Os.load()}catch(t){console.error(t),this.showError(this.config.lang.webglError);return}Hm.init(),this.adapter=new this.config.adapter[0](this,this.config.adapter[1]),this.renderer=new BVt(this),this.textureLoader=new IVt(this),this.eventsHandler=new MVt(this),this.dataHelper=new CVt(this),this.dynamics=new SVt(this),this.adapter.init?.(),this.loader=new fVt(this),this.navbar=new pVt(this),this.panel=new vVt(this),this.notification=new AVt(this),this.autoSize(),this.setCursor(null),CD(Os.isTouchEnabled,t=>{_w(this.container,"psv--is-touch",t)}),this.config.plugins.forEach(([t,n])=>{this.plugins[t.id]=new t(this,n)});for(const t of Object.values(this.plugins))t.init?.();this.config.navbar&&this.navbar.setButtons(this.config.navbar),this.state.loadingPromise||(this.config.panorama?this.setPanorama(this.config.panorama,{sphereCorrection:this.config.sphereCorrection,panoData:this.config.panoData}):this.loader.show())}destroy(){this.stopAll(),this.stopKeyboardControl(),this.exitFullscreen();for(const[e,t]of Object.entries(this.plugins))t.destroy(),delete this.plugins[e];this.children.slice().forEach(e=>e.destroy()),this.children.length=0,this.eventsHandler?.destroy(),this.renderer?.destroy(),this.textureLoader?.destroy(),this.dataHelper?.destroy(),this.adapter?.destroy(),this.dynamics?.destroy(),this.parent.removeChild(this.container),delete this.parent[od]}init(){this.eventsHandler.init(),this.renderer.init(),this.config.navbar&&this.navbar.show(),this.config.keyboard==="always"&&this.startKeyboardControl(),this.resetIdleTimer(),this.state.ready=!0,this.dispatchEvent(new b5)}resetIdleTimer(){this.state.idleTime=performance.now()}disableIdleTimer(){this.state.idleTime=-1}getPlugin(e){if(typeof e=="string")return this.plugins[e];{const t=_D(e);return t?this.plugins[t.id]:null}}getPosition(){return this.dataHelper.cleanPosition(this.dynamics.position.current)}getZoomLevel(){return this.dynamics.zoom.current}getSize(){return{...this.state.size}}isFullscreenEnabled(){return Mue(this.parent,Os.isIphone)}needsUpdate(){this.state.needsUpdate=!0}needsContinuousUpdate(e){e?this.state.continuousUpdateCount++:this.state.continuousUpdateCount>0&&this.state.continuousUpdateCount--}autoSize(){(this.container.clientWidth!==this.state.size.width||this.container.clientHeight!==this.state.size.height)&&(this.state.size.width=Math.round(this.container.clientWidth),this.state.size.height=Math.round(this.container.clientHeight),this.state.aspect=this.state.size.width/this.state.size.height,this.state.hFov=this.dataHelper.vFovToHFov(this.state.vFov),this.dispatchEvent(new M5(this.getSize())),this.navbar.autoSize())}setPanorama(e,t={}){this.textureLoader.abortLoading(),this.state.transitionAnimation?.cancel();const n=this.dataHelper.getTransitionOptions(t);t.showLoader===void 0&&(t.showLoader=!0),t.caption===void 0&&(t.caption=this.config.caption),t.description===void 0&&(t.description=this.config.description),!t.panoData&&typeof this.config.panoData=="function"&&(t.panoData=this.config.panoData),this.hideError(),this.resetIdleTimer(),this.config.panorama=e,this.config.caption=t.caption,this.config.description=t.description,this.config.sphereCorrection=t.sphereCorrection,(typeof this.config.panoData!="function"||typeof t.panoData=="function")&&(this.config.panoData=t.panoData);const o=s=>{if(Rue(s))return!1;if(this.loader.hide(),this.state.loadingPromise=null,s)throw this.navbar.setCaption(null),this.showError(this.config.lang.loadError),console.error(s),this.dispatchEvent(new fde(e,s)),s;return this.navbar.setCaption(this.config.caption),!0};this.navbar.setCaption(`<em>${this.config.lang.loading}</em>`),(t.showLoader||!this.state.ready)&&this.loader.show(),this.dispatchEvent(new dde(e));const r=this.adapter.loadTexture(this.config.panorama,!0,t.panoData).then(s=>{if(s.panorama!==this.config.panorama)throw this.adapter.disposeTexture(s),bD();const a=this.dataHelper.cleanPanoramaOptions(t,s.panoData);return(!Fo(a.zoom)||!Fo(a.position))&&this.stopAll(),{textureData:s,cleanOptions:a}});return!n||!this.state.ready||!this.adapter.supportsTransition(this.config.panorama)?this.state.loadingPromise=r.then(({textureData:s,cleanOptions:a})=>{this.renderer.show(),this.renderer.setTexture(s),this.renderer.setPanoramaPose(s.panoData),this.renderer.setSphereCorrection(t.sphereCorrection),this.state.ready||this.init(),this.dispatchEvent(new Um(s)),Fo(a.zoom)||this.zoom(a.zoom),Fo(a.position)||this.rotate(a.position)}).then(()=>o(),s=>o(s)):this.state.loadingPromise=r.then(({textureData:s,cleanOptions:a})=>(this.loader.hide(),this.dispatchEvent(new Um(s)),this.state.transitionAnimation=this.renderer.transition(s,a,n),this.state.transitionAnimation)).then(s=>{if(this.state.transitionAnimation=null,this.dispatchEvent(new mde(s)),!s)throw bD()}).then(()=>o(),s=>o(s)),this.state.loadingPromise}setOptions(e){const t={...this.config,...e};for(let[n,o]of Object.entries(e)){if(!(n in Nm)){Wo(`Unknown option ${n}`);continue}if(n in Jde){Wo(Jde[n]);continue}switch(n in LD&&(o=LD[n](o,{rawConfig:t,defValue:Nm[n]})),this.config[n]=o,n){case"mousemove":this.state.cursorOverride||this.setCursor(null);break;case"caption":this.navbar.setCaption(this.config.caption);break;case"size":this.resize(this.config.size);break;case"sphereCorrection":this.renderer.setSphereCorrection(this.config.sphereCorrection);break;case"navbar":case"lang":this.navbar.setButtons(this.config.navbar);break;case"moveSpeed":case"zoomSpeed":this.dynamics.updateSpeeds();break;case"minFov":case"maxFov":this.dynamics.zoom.setValue(this.dataHelper.fovToZoomLevel(this.state.vFov)),this.dispatchEvent(new _c(this.getZoomLevel()));break;case"keyboard":this.config.keyboard==="always"?this.startKeyboardControl():this.stopKeyboardControl();break}}this.needsUpdate(),this.dispatchEvent(new sr(Object.keys(e)))}setOption(e,t){this.setOptions({[e]:t})}showError(e){this.overlay.show({id:Jo.ERROR,image:wVt,title:e,dismissible:!1})}hideError(){this.overlay.hide(Jo.ERROR)}rotate(e){const t=new Jue(this.dataHelper.cleanPosition(e));this.dispatchEvent(t),!t.defaultPrevented&&this.dynamics.position.setValue(t.position)}zoom(e){this.dynamics.zoom.setValue(e)}zoomIn(e=1){this.dynamics.zoom.step(e)}zoomOut(e=1){this.dynamics.zoom.step(-e)}animate(e){const t=xD(e),n=!Fo(e.zoom),o=new PD(t?this.dataHelper.cleanPosition(e):void 0,e.zoom);if(this.dispatchEvent(o),o.defaultPrevented)return;this.stopAll();const{duration:r,properties:s}=this.dataHelper.getAnimationProperties(e.speed,o.position,o.zoomLevel);return r?(this.state.animation=new zw({properties:s,duration:r,easing:e.easing||"inOutSine",onTick:a=>{t&&this.dynamics.position.setValue({yaw:a.yaw,pitch:a.pitch}),n&&this.dynamics.zoom.setValue(a.zoom)}}),this.state.animation.then(()=>{this.state.animation=null,this.resetIdleTimer()}),this.state.animation):(t&&this.rotate(o.position),n&&this.zoom(o.zoomLevel),new zw(null))}stopAnimation(){return this.state.animation?(this.state.animation.cancel(),this.state.animation):Promise.resolve()}resize(e){this.__setSize(e),this.autoSize()}__setSize(e){["width","height"].forEach(t=>{e?.[t]&&(/^[0-9.]+$/.test(e[t])&&(e[t]+="px"),this.parent.style[t]=e[t])})}enterFullscreen(){this.isFullscreenEnabled()||Bue(this.parent,Os.isIphone)}exitFullscreen(){this.isFullscreenEnabled()&&Eue(Os.isIphone)}toggleFullscreen(){this.isFullscreenEnabled()?this.exitFullscreen():this.enterFullscreen()}startKeyboardControl(){this.state.keyboardEnabled=!0}stopKeyboardControl(){this.state.keyboardEnabled=!1}createTooltip(e){return new yVt(this,e)}setCursor(e){this.state.cursorOverride=e,e?this.container.style.cursor=e:this.container.style.cursor=this.config.mousemove?"move":"default"}observeObjects(e){this.state.objectsObservers[e]||(this.state.objectsObservers[e]=null)}unobserveObjects(e){delete this.state.objectsObservers[e]}stopAll(){return this.dispatchEvent(new B5),this.disableIdleTimer(),this.stopAnimation()}};const kVt={class:"annotations-photosphere"},RVt={name:"ViewerPhotosphere",components:{Annotations:H({__name:"AnnotationsPhotosphere",setup(i){const e=ut("$viewer"),{localContext:t}=e,n=t.viewer,o=n.viewer,r=o.renderer.renderer.domElement,s=mI(),a=Fe(()=>s.value.filter(u=>!n.selectedStorey||u.z>=n.selectedStorey.absoluteElevation&&u.z<n.selectedStorey.absoluteTopElevation));o.addEventListener("render",()=>sp(a));const l=(u,d)=>{const{x:h,y:p}=r.getBoundingClientRect(),{clientX:A,clientY:f}=d,g=o.dataHelper.viewerCoordsToSphericalCoords({x:A-h,y:f-p}),{textureX:m,textureY:w}=o.dataHelper.sphericalCoordsToTextureCoords(g);u.x=m,u.y=w},c=u=>{const d=o.dataHelper.textureCoordsToSphericalCoords({textureX:u.x,textureY:u.y}),h=o.dataHelper.sphericalCoordsToVector3(d),p=o.dataHelper.sphericalCoordsToViewerCoords(d),{width:A,height:f}=o.state.size;if(!(h.dot(o.state.direction)>0&&p.x>=0&&p.x<=A&&p.y>=0&&p.y<=f))return"display: none;";const{x:m,y:w}=p;return`left: ${m}px; top: ${w}px;`};return(u,d)=>(B(),F("div",kVt,[(B(!0),F(it,null,It(a.value,h=>(B(),K(gI,{annotation:h,canvas:rt(r),style:ue(c(h)),onAnnotationDrag:p=>l(h,p)},null,8,["annotation","canvas","style","onAnnotationDrag"]))),256))]))}},[["__scopeId","data-v-fd653bd2"]])},data(){const{settings:i}=this.$plugin;return{settings:i,model:null,photosphere:null,selectedStorey:null,loading:!1,modelHeaderShown:this.$options.$cfg?.modelLoader!=="hidden",annotationMode:!1,markerId:1,localContextSubscriptions:[],photoSphereViewerCreated:!1}},watch:{loading(i){i?this.$viewer.localContext.loadingProcessStart():this.$viewer.localContext.loadingProcessEnd()}},created(){this.isMounted=new Promise(i=>{this.setMounted=i})},mounted(){const i=new TVt({loadingImg:null,loadingTxt:null,container:this.$refs.canvas,touchmoveTwoFingers:!0,navbar:null,defaultZoomLvl:0,rendererParameters:{alpha:!0,antialias:!0,preserveDrawingBuffer:!0}});i.renderer.renderer.preserveDrawingBuffer=!0,this.viewer=i,this.photoSphereViewerCreated=!0,this.setMounted()},unmounted(){this.viewer?.destroy(),this.localContextSubscriptions.forEach(i=>this.$viewer.localContext.hub.off(i))},methods:{async loadModels([i]){this.$viewer.localContext.hub.off(this.metaBuildingLocalContextSub),this.loading=!0,await this.isMounted,this.model&&this.unloadModels(),this.model=i,i.type==="PHOTOSPHERE_BUILDING"?(this.metaBuildingLocalContextSub=this.$viewer.localContext.hub.on("storey-selected",async({storey:e})=>{e&&(this.photosphere=e.plans[0]?.plan,this.photosphere&&await this.viewer.setPanorama(this.photosphere.document.file,{transition:!1}),this.selectedStorey=e)},{getLastEvent:!0}),this.$viewer.localContext.selectStorey(i.storeys[0])):(this.photosphere=i,await this.viewer.setPanorama(i.document.file,{transition:!1})),this.loading=!1,this.$viewer.localContext.hub.emit("photosphere-model-loaded",{model:i,plugin:this}),this.$viewer.globalContext.hub.emit("photosphere-model-loaded",{model:i,plugin:this})},unloadModels(){this.$viewer.localContext.hub.emit("photosphere-model-unloaded",{model:this.model,plugin:this}),this.$viewer.globalContext.hub.emit("photosphere-model-unloaded",{model:this.model,plugin:this}),this.selectedStorey=null,this.model=null},hideUI(){[...this.$viewer.localContext.plugins.entries()].forEach(([,i])=>i.$hide()),this.modelHeaderShown=!1},showUI(){[...this.$viewer.localContext.plugins.entries()].forEach(([,i])=>i.$show()),this.modelHeaderShown=this.$options.$cfg?.modelLoader!=="hidden"},async getSnapshot(){return{snapshot_type:"png",snapshot_data:this.viewer.renderer.renderer.domElement.toDataURL()}},async getViewpoint(){const i=this.viewer.renderer.camera,e=this.viewer.getPosition(),{textureX:t,textureY:n}=this.viewer.dataHelper.sphericalCoordsToTextureCoords(e);return{order:6,originating_system:"photosphere",authoring_tool_id:this.photosphere?String(this.photosphere.id):void 0,models:this.$viewer.localContext.loadedModels.map(o=>o.id),perspective_camera:{camera_direction:{x:t,y:n,z:0},camera_up_vector:{x:0,y:0,z:0},camera_view_point:{x:0,y:0,z:this.selectedStorey?.absoluteElevation??0},field_of_view:i.fov}}},async setViewpoint(i){const e=this.$viewer.state.getStoreyFromAbsoluteElevation(this.$viewer.localContext.loadedModels[0],i?.perspective_camera?.camera_view_point.z);if(e&&e.uuid!==this.selectedStorey?.uuid){this.$viewer.localContext.selectStorey(e),await new Promise(a=>this.viewer.addEventListener("panorama-loaded",a,{once:!0}));const s=e.plans.find(a=>a.plan.id===+i.authoring_tool_id)?.plan;s&&(this.photosphere=s,await this.viewer.setPanorama(s.document.file,{transition:!1}))}const{x:t,y:n}=i?.perspective_camera?.camera_direction??{x:0,y:0};this.viewer.rotate({textureX:t,textureY:n});const o=i?.perspective_camera?.field_of_view,r=this.viewer.dataHelper.fovToZoomLevel(o);r&&this.viewer.zoom(r)},startAnnotationMode(i){this.annotationMode||(this.annotationMode=!0,this.annotationListener=({data:e})=>{const t=this.selectedStorey;i({x:e.textureX,y:e.textureY,z:t?.absoluteElevation??0,models:this.$viewer.localContext.loadedModels,storey:t})},this.canvasCursor=this.viewer.renderer.renderer.domElement.style.cursor,this.viewer.renderer.renderer.domElement.style.cursor="copy",this.viewer.addEventListener("click",this.annotationListener))},stopAnnotationMode(){this.annotationMode&&(this.viewer.removeEventListener("click",this.annotationListener),this.annotationMode=!1,this.viewer.renderer.renderer.domElement.style.cursor=this.canvasCursor)}}},DVt={class:"bimdata-viewer-photosphere"},_Vt={ref:"canvas",class:"bimdata-viewer-photosphere__viewer__canvas"};function LVt(i,e,t,n,o,r){const s=T("NoModelWindowPlaceHolder"),a=T("Annotations"),l=T("ModelsLoader");return B(),F("div",DVt,[C("div",_Vt,null,512),!i.model&&!i.loading?(B(),K(s,{key:0})):oe("",!0),i.photoSphereViewerCreated?(B(),K(a,{key:1})):oe("",!0),i.settings.modelLoader!=="disabled"?vt((B(),K(l,{key:2,ref:"header",multi:!1},null,512)),[[Gt,i.modelHeaderShown]]):oe("",!0)])}const FVt={name:"photosphere",isViewer:!0,i18n:{en:{window_label:"Photosphere Viewer"},fr:{window_label:"Visionneuse Photosphère"}},component:H(RVt,[["render",LVt],["__scopeId","data-v-d5fe6555"]]),window:{name:"photosphere",label:"photosphere.window_label",header:!1,plugins:["fullscreen"],icon:{imgUri:"data:image/svg+xml,%3csvg%20width='23'%20height='23'%20viewBox='0%200%2023%2023'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.19485%207.90625L10.5819%201.79688V5.97245V7.90625H4.19485ZM21.3153%202.3C21.3153%201.035%2020.2453%200%2018.9228%200H9.30458L2.09094%206.9V20.7C2.09094%2021.965%203.17261%2023%204.49549%2023H18.9348C20.2573%2023%2021.3273%2021.965%2021.3273%2020.7L21.3153%202.3Z'%20class='fill-primary'%20fill='%232F374A'%20/%3e%3cpath%20d='M0%2013C0%2012.4477%200.468066%2012%201.04545%2012H21.9545C22.5319%2012%2023%2012.4477%2023%2013V20C23%2020.5523%2022.5319%2021%2021.9545%2021H1.04545C0.468066%2021%200%2020.5523%200%2020V13Z'%20fill='%23009B9D'%20/%3e%3cpath%20d='M4.79347%2019.9225C4.26792%2019.9225%203.79985%2019.8383%203.38926%2019.67C2.98102%2019.4994%202.65842%2019.2655%202.42145%2018.9681C2.18683%2018.6685%202.066%2018.3231%202.05896%2017.9317H3.59338C3.60277%2018.0956%203.66025%2018.24%203.76583%2018.3646C3.87376%2018.487%204.01687%2018.5822%204.19519%2018.6499C4.3735%2018.7177%204.5741%2018.7516%204.79699%2018.7516C5.02927%2018.7516%205.23456%2018.7134%205.41287%2018.6368C5.59118%2018.5603%205.73078%2018.4542%205.83167%2018.3187C5.93256%2018.1831%205.983%2018.0268%205.983%2017.8497C5.983%2017.6704%205.92904%2017.5118%205.82111%2017.3741C5.71553%2017.2341%205.56303%2017.1248%205.3636%2017.0461C5.16652%2016.9674%204.9319%2016.928%204.65974%2016.928H3.98755V15.885H4.65974C4.88967%2015.885%205.09261%2015.8479%205.26858%2015.7735C5.44689%2015.6992%205.58532%2015.5964%205.68386%2015.4652C5.7824%2015.3318%205.83167%2015.1766%205.83167%2014.9995C5.83167%2014.8311%205.78827%2014.6835%205.70146%2014.5567C5.61699%2014.4277%205.49734%2014.3271%205.34249%2014.255C5.18998%2014.1828%205.01167%2014.1467%204.80755%2014.1467C4.60108%2014.1467%204.41221%2014.1817%204.24094%2014.2517C4.06966%2014.3195%203.93241%2014.4168%203.82918%2014.5436C3.72594%2014.6704%203.67081%2014.8191%203.66377%2014.9896H2.20325C2.21029%2014.6026%202.32877%2014.2615%202.5587%2013.9663C2.78863%2013.6711%203.09833%2013.4405%203.4878%2013.2743C3.87962%2013.1059%204.32188%2013.0217%204.81459%2013.0217C5.31198%2013.0217%205.74721%2013.1059%206.12025%2013.2743C6.4933%2013.4426%206.78306%2013.67%206.98953%2013.9565C7.19834%2014.2407%207.30157%2014.56%207.29923%2014.9142C7.30157%2015.2903%207.17605%2015.6041%206.92266%2015.8555C6.67162%2016.107%206.34432%2016.2666%205.94077%2016.3344V16.3868C6.47101%2016.4503%206.87456%2016.6219%207.15142%2016.9018C7.43062%2017.1795%207.56904%2017.5271%207.5667%2017.9448C7.56904%2018.3274%207.45056%2018.6674%207.21124%2018.9648C6.97428%2019.2622%206.64698%2019.4961%206.22935%2019.6667C5.81173%2019.8372%205.3331%2019.9225%204.79347%2019.9225Z'%20fill='white'%20/%3e%3cpath%20d='M11.4283%2019.9225C11.0576%2019.9203%2010.6998%2019.8624%2010.3549%2019.7487C10.0123%2019.635%209.70498%2019.4502%209.43281%2019.1944C9.16065%2018.9386%208.9448%2018.5997%208.78526%2018.1776C8.62806%2017.7556%208.54947%2017.2374%208.54947%2016.623C8.55181%2016.0589%208.62103%2015.5549%208.75711%2015.111C8.89553%2014.6649%209.09261%2014.2867%209.34835%2013.9762C9.60643%2013.6657%209.91496%2013.4295%2010.2739%2013.2677C10.6329%2013.1037%2011.0353%2013.0217%2011.4811%2013.0217C11.962%2013.0217%2012.3867%2013.1092%2012.7551%2013.2841C13.1234%2013.4569%2013.419%2013.6919%2013.6419%2013.9893C13.8672%2014.2867%2014.0032%2014.6201%2014.0502%2014.9896H12.5474C12.4888%2014.7557%2012.3656%2014.572%2012.1779%2014.4386C11.9902%2014.3052%2011.7579%2014.2386%2011.4811%2014.2386C11.0118%2014.2386%2010.6552%2014.4288%2010.4112%2014.8092C10.1695%2015.1897%2010.0463%2015.7068%2010.0417%2016.3606H10.0909C10.1989%2016.1616%2010.3443%2015.9922%2010.5273%2015.8522C10.7127%2015.7101%2010.9227%2015.6019%2011.1573%2015.5275C11.3942%2015.451%2011.6441%2015.4127%2011.9069%2015.4127C12.3339%2015.4127%2012.714%2015.5068%2013.0472%2015.6948C13.3803%2015.8807%2013.6431%2016.1365%2013.8355%2016.4623C14.0279%2016.7881%2014.1241%2017.1609%2014.1241%2017.5807C14.1241%2018.0355%2014.0103%2018.44%2013.7827%2018.7943C13.5575%2019.1485%2013.2419%2019.4262%2012.836%2019.6273C12.4324%2019.8263%2011.9632%2019.9247%2011.4283%2019.9225ZM11.4212%2018.8074C11.6559%2018.8074%2011.8658%2018.7549%2012.0512%2018.6499C12.2365%2018.545%2012.382%2018.4029%2012.4876%2018.2236C12.5932%2018.0443%2012.646%2017.8431%2012.646%2017.6201C12.646%2017.397%2012.5932%2017.197%2012.4876%2017.0199C12.3844%2016.8427%2012.2412%2016.7017%2012.0582%2016.5968C11.8752%2016.4918%2011.6664%2016.4393%2011.4318%2016.4393C11.2558%2016.4393%2011.0928%2016.4699%2010.9426%2016.5312C10.7948%2016.5924%2010.6646%2016.6777%2010.552%2016.787C10.4417%2016.8963%2010.3549%2017.0231%2010.2915%2017.1675C10.2282%2017.3096%2010.1965%2017.4615%2010.1965%2017.6234C10.1965%2017.8398%2010.2493%2018.0377%2010.3549%2018.217C10.4628%2018.3963%2010.6083%2018.5395%2010.7913%2018.6467C10.9766%2018.7538%2011.1866%2018.8074%2011.4212%2018.8074Z'%20fill='white'%20/%3e%3cpath%20d='M18.0305%2019.9783C17.4252%2019.9761%2016.9043%2019.8372%2016.4679%2019.5617C16.0339%2019.2862%2015.6996%2018.8872%2015.4649%2018.3646C15.2327%2017.842%2015.1177%2017.2134%2015.12%2016.4787C15.12%2015.7462%2015.2362%2015.1219%2015.4684%2014.6059C15.7031%2014.0899%2016.0374%2013.6974%2016.4715%2013.4284C16.9079%2013.1573%2017.4275%2013.0217%2018.0305%2013.0217C18.6335%2013.0217%2019.152%2013.1573%2019.5861%2013.4284C20.0224%2013.6996%2020.358%2014.0931%2020.5926%2014.6092C20.8272%2015.123%2020.9433%2015.7462%2020.941%2016.4787C20.941%2017.2156%2020.8237%2017.8453%2020.5891%2018.3679C20.3568%2018.8905%2020.0236%2019.2895%2019.5896%2019.565C19.1555%2019.8405%2018.6358%2019.9783%2018.0305%2019.9783ZM18.0305%2018.8008C18.4434%2018.8008%2018.7731%2018.6073%2019.0194%2018.2203C19.2658%2017.8333%2019.3878%2017.2527%2019.3855%2016.4787C19.3855%2015.9692%2019.3291%2015.545%2019.2165%2015.2061C19.1063%2014.8672%2018.9491%2014.6125%2018.7449%2014.4419C18.5432%2014.2713%2018.305%2014.1861%2018.0305%2014.1861C17.6199%2014.1861%2017.2915%2014.3774%2017.0451%2014.76C16.7988%2015.1427%2016.6744%2015.7156%2016.6721%2016.4787C16.6721%2016.9947%2016.7272%2017.4255%2016.8375%2017.7709C16.9501%2018.1142%2017.1085%2018.3722%2017.3126%2018.545C17.5167%2018.7155%2017.756%2018.8008%2018.0305%2018.8008Z'%20fill='white'%20/%3e%3c/svg%3e"},modelTypes:["PHOTOSPHERE","PHOTOSPHERE_BUILDING"],multiModel:!1}},OVt={name:"photosphereBuilding",component:{setup(){const i=ut("$viewer"),e=ut("$plugin"),{apiClient:t,cloudId:n,projectId:o}=i.api,r=Fe(()=>i.localContext.loadedModels[0]),s=Fe(()=>i.localContext.selectedStorey),a=Fe(()=>i.localContext.viewer.photosphere),l=Fe(()=>s.value?.plans.find(d=>d.plan.id===a.value?.id));dt([r,()=>e.shown],([{type:d}={}])=>{d==="PHOTOSPHERE_BUILDING"?e.show():e.hide()},{immediate:!0});const c=d=>{r.value&&i.localContext.selectStorey(r.value.storeys.find(h=>h.uuid===d.uuid))},u=d=>{if(!d)return;const{viewer:h}=i.localContext,p=h.viewer;h.photosphere=d.plan,p.setPanorama(d.plan.document.file,{transition:!1})};return()=>Jn(vle,{apiClient:t,space:{id:n},project:{id:o},model:r.value,storey:s.value,plan:l.value,selectable:!0,onStoreySelected:c,onPlanSelected:u})}},addToWindows:["photosphere"],sidePanel:{position:"right",width:400}},UVt={props:{color:{type:String,required:!0}}},NVt=["fill"];function VVt(i,e,t,n,o,r){return B(),F("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:t.color,xmlns:"http://www.w3.org/2000/svg"},[...e[0]||(e[0]=[ss('<rect width="3" height="3"></rect><rect y="9" width="3" height="3"></rect><rect x="9" width="3" height="3"></rect><rect x="9" y="9" width="3" height="3"></rect><rect x="3" y="1" width="6" height="1"></rect><rect x="3" y="10" width="6" height="1"></rect><rect x="11" y="3" width="6" height="1" transform="rotate(90 11 3)"></rect><rect x="2" y="3" width="6" height="1" transform="rotate(90 2 3)"></rect>',8)])],8,NVt)}const Yde=H(UVt,[["render",VVt]]),HVt={class:"bimdata-label-list"},zVt={class:"bimdata-label-list__classes"},jVt={class:"bimdata-label-list__classes__title"},GVt={class:"bimdata-label-list__classes__list"},QVt={class:"bimdata-label-list__labels"},qVt={class:"bimdata-label-list__labels__title"},KVt=["onClick","onMouseover"],JVt=H({__name:"LabelList",setup(i){const e=ut("state"),t=Fe(()=>e.classes),n=Fe(()=>e.labels),o=s=>{e.selectedClass=s},r=s=>e.labels.filter(a=>!a.deleted).filter(a=>a.name===s.name).indexOf(s);return(s,a)=>{const l=T("BIMDataIconPlus"),c=T("BIMDataButton");return B(),F("div",HVt,[C("div",zVt,[C("div",jVt,[C("div",null,Q(s.$t("label.classes.title")),1),a[2]||(a[2]=Xe(" ",-1)),C("div",null,"("+Q(s.$t("label.classes.description"))+")",1)]),C("ul",GVt,[(B(!0),F(it,null,It(t.value,u=>(B(),F("li",{key:u.name,class:le({active:rt(e).selectedClass?.name===u.name})},[C("div",null,[k(Yde,{color:`#${u.color}`,class:"m-r-18"},null,8,["color"]),C("span",null,Q(u.name),1)]),k(c,{color:"primary",outline:"",radius:"",icon:"",width:"20px",height:"20px",onClick:d=>o(u)},{default:N(()=>[k(l,{customSize:6})]),_:1},8,["onClick"])],2))),128))])]),C("div",QVt,[C("div",qVt,[C("div",null,Q(s.$t("label.labels.title")),1),a[3]||(a[3]=Xe(" ",-1)),C("div",null,"("+Q(s.$t("label.labels.description"))+")",1)]),C("ul",{class:"bimdata-label-list__classes__list",onClick:a[1]||(a[1]=u=>rt(e).selectedLabel=null)},[(B(!0),F(it,null,It(n.value.filter(u=>!u.deleted),u=>(B(),F("li",{class:le({highlighted:rt(e).highlightedLabel===u,active:rt(e).selectedLabel===u}),onClick:gt(d=>rt(e).selectedLabel=u,["stop"]),style:{cursor:"pointer"},onMouseover:d=>rt(e).highlightedLabel=u,onMouseleave:a[0]||(a[0]=d=>rt(e).highlightedLabel=null)},[C("div",null,[k(Yde,{color:`#${u.color}`,class:"m-r-18"},null,8,["color"]),C("span",null,Q(u.name)+"-"+Q(r(u)),1)])],42,KVt))),256))])])])}}},[["__scopeId","data-v-70b81c34"]]),WVt={},ZVt={width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function YVt(i,e){return B(),F("svg",ZVt,[...e[0]||(e[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.176395 0.13889C0.342301 -0.00852533 0.584825 -0.0419546 0.786658 0.0547728L21.6969 10.0759C21.9052 10.1757 22.0251 10.3924 21.9956 10.6155C21.966 10.8386 21.7935 11.019 21.566 11.0647L12.0932 12.9697L9.57365 21.6158C9.51015 21.8337 9.31 21.9881 9.07635 21.9993C8.8427 22.0106 8.6277 21.8763 8.54214 21.6655L0.03777 0.720195C-0.0446022 0.517321 0.0104881 0.286306 0.176395 0.13889Z",fill:"#2F374A"},null,-1)])])}const XVt=H(WVt,[["render",YVt]]),$Vt={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},eHt=["fill"],tHt={__name:"Rectangle",props:{disabled:{type:Boolean,default:!1}},setup(i){return(e,t)=>(B(),F("svg",$Vt,[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0 0H20V20H0V0ZM2.5 2.5V17.5H17.5V2.5H2.5Z",fill:i.disabled?"var(--color-silver)":"var(--color-primary)"},null,8,eHt)]))}},iHt={class:"bimdata-label-viewer-draw-tools"},nHt=H({__name:"LabelDrawTools",props:{activeTool:{type:String,default:null}},setup(i){const e=ut("state");return(t,n)=>{const o=T("BIMDataIconArrow"),r=T("BIMDataButton");return B(),F("div",iHt,[k(r,{color:"primary",ghost:"",radius:"",icon:"",class:"bimdata-label-viewer-draw-tools__back",onClick:n[0]||(n[0]=s=>t.$emit("back"))},{default:N(()=>[k(o,{size:"xs",fill:"",color:"default"})]),_:1}),n[3]||(n[3]=C("div",{class:"bimdata-label-viewer-draw-tools__separator"},null,-1)),k(r,{color:i.activeTool===null?"secondary":"primary",ghost:i.activeTool!==null,fill:i.activeTool===null,radius:"",icon:"",class:"bimdata-label-viewer-draw-tools__pointer",onClick:n[1]||(n[1]=s=>t.$emit("tool-click",null))},{default:N(()=>[k(XVt)]),_:1},8,["color","ghost","fill"]),k(r,{color:i.activeTool==="rectangle"?"secondary":"primary",ghost:i.activeTool!=="rectangle",fill:i.activeTool==="rectangle",radius:"",icon:"",class:"bimdata-label-viewer-draw-tools__rectangle",disabled:rt(e).selectedClass===null,onClick:n[2]||(n[2]=s=>t.$emit("tool-click",i.activeTool==="rectangle"?null:"rectangle"))},{default:N(()=>[k(tHt,{disabled:rt(e).selectedClass===null},null,8,["disabled"])]),_:1},8,["color","ghost","fill","disabled"])])}}},[["__scopeId","data-v-423df785"]]),oHt={class:"bimdata-label-viewer__model-selector"},sHt={class:"bimdata-label-viewer__model-selector__select"},rHt={class:"bimdata-label-viewer__model-selector__select__text"},aHt={key:1},lHt=H({__name:"ModelSelector",props:{currentModelIndex:{type:Number,default:0},modelCount:{type:Number,required:!0},loading:{type:Boolean,default:!1}},emits:["previous","next","validate"],setup(i){return(e,t)=>{const n=T("BIMDataIconChevron"),o=T("BIMDataButton"),r=T("BIMDataSpinner");return B(),F("div",oHt,[C("div",sHt,[k(o,{ghost:"",rounded:"",icon:"",width:"30px",height:"30px",onClick:t[0]||(t[0]=s=>e.$emit("previous")),disabled:i.currentModelIndex<=0},{default:N(()=>[k(n,{size:"xxxs",rotate:180})]),_:1},8,["disabled"]),C("div",rHt,[i.loading?(B(),K(r,{key:0})):(B(),F("span",aHt,Q(i.currentModelIndex+1)+"/"+Q(i.modelCount),1))]),k(o,{ghost:"",rounded:"",icon:"",width:"30px",height:"30px",onClick:t[1]||(t[1]=s=>e.$emit("next")),disabled:i.currentModelIndex+1>=i.modelCount},{default:N(()=>[k(n,{size:"xxxs"})]),_:1},8,["disabled"])]),k(o,{color:"secondary",fill:"",radius:"",width:"87px",height:"32px",style:{"border-radius":"17px"},onClick:t[2]||(t[2]=s=>e.$emit("validate"))},{default:N(()=>[Xe(Q(e.$t("global.validate")),1)]),_:1})])}}},[["__scopeId","data-v-13384e53"]]),cHt={},uHt={width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function dHt(i,e){return B(),F("svg",uHt,[...e[0]||(e[0]=[C("path",{d:"M19.8667 21.5L12.5167 14.15C11.9333 14.6167 11.2625 14.9861 10.5042 15.2583C9.74583 15.5306 8.93889 15.6667 8.08333 15.6667C5.96389 15.6667 4.17014 14.9326 2.70208 13.4646C1.23403 11.9965 0.5 10.2028 0.5 8.08333C0.5 5.96389 1.23403 4.17014 2.70208 2.70208C4.17014 1.23403 5.96389 0.5 8.08333 0.5C10.2028 0.5 11.9965 1.23403 13.4646 2.70208C14.9326 4.17014 15.6667 5.96389 15.6667 8.08333C15.6667 8.93889 15.5306 9.74583 15.2583 10.5042C14.9861 11.2625 14.6167 11.9333 14.15 12.5167L21.5 19.8667L19.8667 21.5ZM8.08333 13.3333C9.54167 13.3333 10.7812 12.8229 11.8021 11.8021C12.8229 10.7812 13.3333 9.54167 13.3333 8.08333C13.3333 6.625 12.8229 5.38542 11.8021 4.36458C10.7812 3.34375 9.54167 2.83333 8.08333 2.83333C6.625 2.83333 5.38542 3.34375 4.36458 4.36458C3.34375 5.38542 2.83333 6.625 2.83333 8.08333C2.83333 9.54167 3.34375 10.7812 4.36458 11.8021C5.38542 12.8229 6.625 13.3333 8.08333 13.3333ZM6.91667 11.5833V9.25H4.58333V6.91667H6.91667V4.58333H9.25V6.91667H11.5833V9.25H9.25V11.5833H6.91667Z",fill:"#2F374A"},null,-1)])])}const hHt=H(cHt,[["render",dHt]]),pHt={},fHt={width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function AHt(i,e){return B(),F("svg",fHt,[...e[0]||(e[0]=[C("path",{d:"M19.8667 21.5L12.5167 14.15C11.9333 14.6167 11.2625 14.9861 10.5042 15.2583C9.74583 15.5306 8.93889 15.6667 8.08333 15.6667C5.96389 15.6667 4.17014 14.9326 2.70208 13.4646C1.23403 11.9965 0.5 10.2028 0.5 8.08333C0.5 5.96389 1.23403 4.17014 2.70208 2.70208C4.17014 1.23403 5.96389 0.5 8.08333 0.5C10.2028 0.5 11.9965 1.23403 13.4646 2.70208C14.9326 4.17014 15.6667 5.96389 15.6667 8.08333C15.6667 8.93889 15.5306 9.74583 15.2583 10.5042C14.9861 11.2625 14.6167 11.9333 14.15 12.5167L21.5 19.8667L19.8667 21.5ZM8.08333 13.3333C9.54167 13.3333 10.7812 12.8229 11.8021 11.8021C12.8229 10.7812 13.3333 9.54167 13.3333 8.08333C13.3333 6.625 12.8229 5.38542 11.8021 4.36458C10.7812 3.34375 9.54167 2.83333 8.08333 2.83333C6.625 2.83333 5.38542 3.34375 4.36458 4.36458C3.34375 5.38542 2.83333 6.625 2.83333 8.08333C2.83333 9.54167 3.34375 10.7812 4.36458 11.8021C5.38542 12.8229 6.625 13.3333 8.08333 13.3333ZM5.16667 9.25V6.91667H11V9.25H5.16667Z",fill:"#2F374A"},null,-1)])])}const mHt=H(pHt,[["render",AHt]]);function gHt(i,e=()=>{}){const t=ut("state"),n=ut("$viewer");let o=null,r=null;const s=pe(null),a=Fe(()=>t.selectedLabel&&s.value===null),l=Fe(()=>s.value!==null&&!a.value);ci(()=>{r=i.value,r.engine.ui.rotatable=!1,r.plugins.pen.pathLineWidth=2,o=vHt(r,t,l)}),ki(()=>{o?.()}),dt(()=>n.localContext.loadedModels,()=>{t.selectedLabel=null,t.highlightedLabel=null,t.labels.forEach(u=>u.path?.destroy())}),dt(()=>t.selectedClass,(u,d)=>{u&&(t.selectedLabel=null,d?r.plugins.pen.primaryColor=Number.parseInt(u.color,16):s.value="rectangle")}),dt(()=>t.labels.length,()=>{if(!r)return;const{pen:u}=r.plugins;for(const d of t.labels.filter(h=>!h.deleted))d.geometry&&!d.path&&(u.primaryColor=Number.parseInt(d.color,16),d.path=u.draw(d.geometry))},{immediate:!0}),dt(a,u=>{const{pen:d}=r.plugins;u?(d.path=t.selectedLabel.path,d.path.previousPoints=d.path.points,d.startRectangleEditing()):(d.stopRectangleEditing(),d.path=null)});let c=null;return dt(l,u=>{const{pen:d}=r.plugins;u?(d.drawMode="rectangle",d.primaryColor=Number.parseInt(t.selectedClass.color,16),d.startDrawing(),c=d.on("add",({path:h})=>e(h))):(d.stopDrawing(),a.value||(d.path=null),d.off(c))}),dt(()=>t.selectedLabel,(u,d)=>{if(d&&u){const{pen:h}=r.plugins;h.stopRectangleEditing(),h.path=u.path,h.startRectangleEditing()}else u&&(s.value=null,t.selectedClass=null)}),dt(()=>t.highlightedLabel,(u,d)=>{if(d?.path&&(d.path.object.getShape().style.fillOpacity=.2),!u)return;let h=u.parent;for(;h;)h.expanded=!0,h=h.parent;u.path&&(u.path.object.getShape().style.fillOpacity=.3)}),{drawMode:s}}function vHt(i,e,t,n){const o=i.viewer.canvas.parentElement,r=i.viewer.ui.on("click",({object:a})=>{if(!t.value)if(a){const l=e.labels.filter(c=>!c.deleted).find(c=>c.path.object.id===a.id);if(!l)return;e.selectedLabel=l}else t.value||(e.selectedLabel=null)}),s=i.viewer.ui.on("mousemove",({object:a})=>{if(!t.value)if(a){o.style.cursor="pointer";const l=e.labels.filter(c=>!c.deleted).find(c=>c.path.object.id===a.id);if(!l)return;e.highlightedLabel=l}else o.style.cursor="default",e.highlightedLabel=null});return()=>{i.viewer.ui.off(r),i.viewer.ui.off(s)}}const yHt={__name:"Marker",props:{label:{type:Object,required:!0}},setup(i,{expose:e}){const t=i,n=ut("state"),o=`#${t.label.color}`,r=n.labels.filter(l=>l.name===t.label.name),s=`${t.label.name}-${r.indexOf(t.label)}`,a=qn({x:0,y:0});return e({label:t.label,position:a}),(l,c)=>vt((B(),F("div",{class:"bimdata-label__marker",style:ue({left:a.x+"px",top:a.y+"px",backgroundColor:o}),ref:u=>{i.label.marker=u}},Q(s),4)),[[Gt,rt(n).selectedLabel!==i.label]])}};let wHt=0;class Xde{constructor(e,t,n=null,o=null,r=null){this.name=e,this.color=t,this.geometry=n,this.path=o,this.apiId=r,this.id=wHt++,this.marker=pe(null),this.deleted=!1}getTopLeftPosition(){const e=this.path?.points??this.geometry,t=Math.min(...e.map(o=>o.x)),n=Math.min(...e.map(o=>o.y));return{x:t,y:n}}hasBeenModified(){if(!this.path||!this.geometry)return!1;if(this.path.points.length!==this.geometry.length)return!0;for(let e=0;e<this.path.points.length;e++){const t=this.path.points[e],n=this.geometry[e];if(t.x!==n.x||t.y!==n.y)return!0}return!1}}function CHt(i){const e=pe(null),t=()=>{const o=e.value;o&&o.forEach(r=>{const s=r.label;if(!s||!s.marker)return;const a=s.getTopLeftPosition(),l=i.value.engine.camera.getCanvasPosition(a);r.position.x=l.x-1,r.position.y=l.y-1})};ci(()=>{i.value.engine.camera.on("update",()=>t()),i.value.engine.scene.on("object-update",()=>t())});const n=ut("state");return dt(()=>n.labels,()=>{un(()=>t())}),{markersRef:e,updateMarkersPosition:t}}const bHt={class:"bimdata-label-viewer"},xHt={class:"bimdata-label-viewer__markers"},MHt={class:"bimdata-label-viewer__right-tools"},BHt={key:0,class:"bimdata-label-viewer__unsaved-changes-modal"},EHt={class:"bimdata-label-viewer__unsaved-changes-modal__content"},IHt={class:"bimdata-label-viewer__unsaved-changes-modal__content__icon"},SHt={class:"bimdata-label-viewer__unsaved-changes-modal__content__title"},PHt={class:"bimdata-label-viewer__unsaved-changes-modal__content__text"},THt={class:"bimdata-label-viewer__unsaved-changes-modal__content__buttons"},kHt=H({__name:"LabelViewer",setup(i){const e=Ci(null),t=pe(!1),n=ut("$viewer"),o=ut("state"),r=ut("service"),s=Fe(()=>n.localContext.loadingModelIds.length>0);dt(()=>n.localContext.loadedModels[0],(D,L)=>{L&&e.value?.unloadModels([L.id]),D&&e.value?.loadModels([D])},{immediate:!0});const a=Fe(()=>r.projectModels.length),l=Fe(()=>{if(a.value===0)return 0;const D=n.localContext.loadedModels[0];return D?r.projectModels.findIndex(L=>L.id===D.id):0}),{markersRef:c,updateMarkersPosition:u}=CHt(e),d=D=>{const L=o.selectedClass;if(!L){console.warn("No class selected for the label.");return}const U=new Xde(L.name,L.color,null,D);o.labels.push(U),un(()=>u())},{drawMode:h}=gHt(e,d),p=D=>{D.apiId?D.deleted=!0:o.labels=o.labels.filter(L=>L.id!==D.id),D.path.destroy(),D.path=null};let A=null;document.addEventListener("keydown",A=D=>{if(D.key==="Escape"&&(h.value=null,o.selectedClass=null,o.selectedLabel=null),(D.key==="Delete"||D.key==="Backspace")&&o.selectedLabel){const L=o.selectedLabel;o.selectedLabel=null,p(L)}}),ki(()=>{document.removeEventListener("keydown",A)});const f=D=>{h.value=D},g=()=>{h.value=null},m=()=>{e.value.engine.camera.zoomIn()},w=()=>{e.value.engine.camera.zoomOut()},v=()=>{const D=n.localContext.loadedModels[0];r.saveLabels(D.id,o.labels),r.loadNextModel()},y=()=>o.labels.some(D=>!D.apiId||D.deleted||D.hasBeenModified());let x=null;const M=()=>{if(y()){t.value=!0,x=E;return}E()},E=()=>{const D=r.projectModels[l.value-1];D&&n.localContext.loadModels([D.id]),h.value=null},S=()=>{if(y()){t.value=!0,x=I;return}I()},I=()=>{const D=r.projectModels[l.value+1];D&&n.localContext.loadModels([D.id]),h.value=null},R=()=>{t.value=!1},P=()=>{x?.(),t.value=!1};return(D,L)=>{const U=T("BIMDataButton"),z=T("BIMDataIconWarning");return B(),F("div",bHt,[k(L4,{ref_key:"viewer",ref:e,enablePenPlugin:!0},null,512),C("div",xHt,[(B(!0),F(it,null,It(rt(o).labels.filter(j=>!j.deleted),j=>(B(),K(yHt,{key:j.id,label:j,ref_for:!0,ref_key:"markersRef",ref:c},null,8,["label"]))),128))]),k(nHt,{onBack:g,onToolClick:f,class:"bimdata-label-viewer__left-tools",activeTool:rt(h)},null,8,["activeTool"]),C("div",MHt,[k(lHt,{class:"bimdata-label-viewer__right-tools__model-selector",modelCount:a.value,currentModelIndex:l.value,loading:s.value,onValidate:v,onPrevious:M,onNext:S},null,8,["modelCount","currentModelIndex","loading"]),k(U,{class:"bimdata-label-viewer__right-tools__button--1",color:"default",fill:"",radius:"",icon:"",width:"50px",height:"50px",style:{"border-radius":"6px"},onClick:m},{default:N(()=>[k(hHt)]),_:1}),k(U,{class:"bimdata-label-viewer__right-tools__button--2",color:"default",fill:"",radius:"",icon:"",width:"50px",height:"50px",style:{"border-radius":"6px"},onClick:w},{default:N(()=>[k(mHt)]),_:1})]),t.value?(B(),F("div",BHt,[C("div",EHt,[C("div",IHt,[k(z,{size:"m",fill:"",color:"high"})]),C("div",SHt,Q(D.$t("global.warning"))+"! ",1),C("div",PHt,Q(D.$t("label.unsaved-changes")),1),C("div",THt,[k(U,{color:"primary",ghost:"",radius:"",onClick:R,width:"120px"},{default:N(()=>[Xe(Q(D.$t("global.cancel")),1)]),_:1}),k(U,{color:"high",fill:"",radius:"",onClick:P,width:"120px"},{default:N(()=>[Xe(Q(D.$t("global.ok")),1)]),_:1})])])])):oe("",!0)])}}},[["__scopeId","data-v-d495d63a"]]),RHt=[{name:"Class test 1",color:"76ffd6"},{name:"Class test 2",color:"ff64da"},{name:"Class test 3",color:"e1ff25"}];class DHt{constructor(){this.$viewer=ut("$viewer");const e=ut("$plugin");let t=Array.isArray(e.settings?.classes)?e.settings.classes:null;t&&(t.length===0||!t.every(n=>typeof n.name=="string"&&typeof n.color=="string"&&n.color.length===6&&[...n.color].every(o=>/[0-9a-fA-F]/.test(o))))&&(console.warn("[BIMDataLabel - Service] Invalid classes provided to the plugin. Using default classes instead. Expected format: [{ name: string, color: string (6 hex characters) }]"),t=null),this.loading=pe(!1),this.classes=t??RHt,this._projectModels=pe([]),this.getAvailableModels().then(n=>{if(this._projectModels.value=n,n.length>0){const{localContext:o}=this.$viewer;o.loadedModels.length===0&&o.loadingModelIds.length===0&&o.loadModels([n[0].id])}})}get projectModels(){return this._projectModels.value}getClasses(){return Promise.resolve(this.classes)}async getLabels(e){if(!e)throw new TypeError("[BIMDataViewer - Label.Service] modelId is required to get labels.");const{apiClient:t,cloudId:n,projectId:o}=this.$viewer.api;try{return(await t.modelApi.getLabels(n,e,o)).map(s=>new Xde(s.name,s.color,s.geometry,null,s.id))}catch(r){return console.error("[BIMDataViewer - Label.Service] Cannot get labels for modelId: ",e,". Error: ",r),[]}}saveLabels(e,t){if(!e)throw new TypeError("[BIMDataViewer - Label.Service] modelId is required to save labels.");const n=[],o=[],r=[];for(const u of t)u.apiId===null?n.push(u):u.deleted?o.push(u):u.hasBeenModified()&&r.push(u);const{apiClient:s,cloudId:a,projectId:l}=this.$viewer.api,c=[];return n.length>0&&c.push(...n.map(u=>s.modelApi.createLabel(a,e,l,{name:u.name,color:u.color,geometry:u.path.points}))),o.length>0&&c.push(...o.map(u=>s.modelApi.deleteLabel(a,u.apiId,e,l))),r.length>0&&c.push(...r.map(u=>s.modelApi.updateLabel(a,u.apiId,e,l,{geometry:u.path.points}))),Promise.all(c)}loadNextModel(){const{localContext:e}=this.$viewer,t=this.projectModels.findIndex(n=>n.id===e.loadedModels[0]?.id);if(t<this.projectModels.length-1){const n=this.projectModels[t+1];e.loadModels([n.id])}}async getAvailableModels(){const{api:e,state:t,localContext:n}=this.$viewer;this.loading.value=!0;try{return(await e.apiClient.modelApi.getModels(e.cloudId,e.projectId,void 0,void 0,n.modelTypes)).filter(r=>t.models.some(s=>s.archived)||!r.archived).sort(il("updated_at",!1))}catch(o){console.error("[BIMDataLabel - Service] Cannot get project models. Error: ",o)}finally{this.loading.value=!1}return[]}}const _Ht={class:"bimdata-label"},LHt={name:"label",i18n:{de:{},en:{classes:{title:"Classes",description:"Equipment categories"},labels:{title:"Labels",description:"Created equipment"},"unsaved-changes":"You have unsaved changes. Are you sure you want to leave without validating them ?"},es:{},fr:{classes:{title:"Classes",description:"Catégories d'équipements"},labels:{title:"Labels",description:"Equipements créés"},"unsaved-changes":"Vous avez des modifications non enregistrées. Êtes-vous sûr de vouloir quitter sans les valider ?"}},component:H({__name:"BIMDataLabel",setup(i){const e=new DHt,t=qn({classes:[],selectedClass:null,labels:[],selectedLabel:null,highlightedLabel:null});window.state=t,qi("state",t),qi("service",e),e.getClasses().then(o=>{t.classes=o});const n=ut("$viewer");return dt(()=>n.localContext.loadedModels[0],async o=>{if(o)try{n.localContext.loadingProcessStart(),t.labels=await e.getLabels(o.id),t.selectedLabel=null,t.highlightedLabel=null}finally{n.localContext.loadingProcessEnd()}},{immediate:!0}),(o,r)=>(B(),F("div",_Ht,[k(JVt,{class:"bimdata-label__list"}),k(kHt,{class:"bimdata-label__viewer"})]))}},[["__scopeId","data-v-5813dd8b"]]),window:{name:"label",header:!1,displayedInWindowSelector:!1,modelTypes:["JPEG","PNG"],multiModel:!1}},FHt={},OHt={width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function UHt(i,e){return B(),F("svg",OHt,[...e[0]||(e[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5 0H7V2H5V0ZM3 8H5V10H3V8ZM10 3H8V5H10V3ZM0 5H2V7H0V5ZM2 10H0V12H2V10ZM20 5H22V7H20V5ZM22 10H20V12H22V10ZM0 15H2V17H0V15ZM2 20H0V22H2V20ZM10 0H12V2H10V0ZM7 22V20H5V22H7ZM12 20V22H10V20H12ZM17 0H15V2H17V0ZM20 0H22V2H20V0ZM11 6H13V8H11V6ZM9.70711 16.0711C9.31658 15.6806 9.31658 15.0474 9.70711 14.6569L14.6569 9.70711C15.0474 9.31659 15.6805 9.31659 16.0711 9.70711L24.5563 18.1924C24.9469 18.5829 24.9469 19.2161 24.5563 19.6066L19.6066 24.5564C19.2161 24.9469 18.5829 24.9469 18.1924 24.5564L9.70711 16.0711ZM12.5355 16.0711C12.145 15.6806 12.145 15.0474 12.5355 14.6569L14.6569 12.5355C15.0474 12.145 15.6805 12.145 16.0711 12.5355L17.4853 13.9498C17.8758 14.3403 17.8758 14.9734 17.4853 15.364L15.364 17.4853C14.9734 17.8758 14.3403 17.8758 13.9497 17.4853L12.5355 16.0711ZM8 13V11H6V13H8Z",fill:"#2F374A"},null,-1)])])}const NHt={name:"plan-mask-button",i18n:{en:{tooltip:"Plan cleaning"},fr:{tooltip:"Nettoyage de plan"}},addToWindows:["plan"],button:{tooltip:"plan-mask-button.tooltip",position:"right",content:"free",icon:{component:H(FHt,[["render",UHt]])}},component:{render(){return null},setup(){const i=ut("$viewer"),e=ut("$plugin");_r(()=>{i.localContext.loadedModels.length===1?e.shown||e.show():e.shown&&e.hide()})},onOpen(){const i=this.$viewer.globalContext.layout;this.$viewer.globalContext.hub.emit("plan-mask:open",i);const e=this.$viewer.localContext.loadedModels[0];let t=e.id;if(e.type==="METABUILDING"){const r=this.$viewer.localContext.selectedStorey?.plans[0]?.plan.id;r!==void 0&&(t=r)}const n=this.$viewer.localContext.selectedStorey?.key;this.$viewer.globalContext.layout={windowName:"plan-mask",windowState:{modelIds:[t],storey:n}}}}},VHt={},HHt={width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function zHt(i,e){return B(),F("svg",HHt,[...e[0]||(e[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5 0H7V2H5V0ZM3 8H5V10H3V8ZM10 3H8V5H10V3ZM0 5H2V7H0V5ZM2 10H0V12H2V10ZM20 5H22V7H20V5ZM22 10H20V12H22V10ZM0 15H2V17H0V15ZM2 20H0V22H2V20ZM10 0H12V2H10V0ZM7 22V20H5V22H7ZM12 20V22H10V20H12ZM17 0H15V2H17V0ZM20 0H22V2H20V0ZM11 6H13V8H11V6ZM9.70711 16.0711C9.31658 15.6806 9.31658 15.0474 9.70711 14.6569L14.6569 9.70711C15.0474 9.31659 15.6805 9.31659 16.0711 9.70711L24.5563 18.1924C24.9469 18.5829 24.9469 19.2161 24.5563 19.6066L19.6066 24.5564C19.2161 24.9469 18.5829 24.9469 18.1924 24.5564L9.70711 16.0711ZM12.5355 16.0711C12.145 15.6806 12.145 15.0474 12.5355 14.6569L14.6569 12.5355C15.0474 12.145 15.6805 12.145 16.0711 12.5355L17.4853 13.9498C17.8758 14.3403 17.8758 14.9734 17.4853 15.364L15.364 17.4853C14.9734 17.8758 14.3403 17.8758 13.9497 17.4853L12.5355 16.0711ZM8 13V11H6V13H8Z",fill:"#2F374A"},null,-1)])])}const jHt=H(VHt,[["render",zHt]]),GHt={class:"bimdata-plan-mask__header"},QHt={class:"bimdata-plan-mask__header__texts"},qHt={class:"bimdata-plan-mask__header__texts__title"},KHt={class:"bimdata-plan-mask__header__texts__model"},JHt={class:"bimdata-plan-mask__header__buttons"},WHt=H({__name:"PlanMaskHeader",setup(i){const e=ut("$viewer"),t=ut("state"),n=ut("service"),o=Fe(()=>t.newCropPathByModelId.size===0&&t.newFiltersByModelId.size===0),r=pe(!1),s=Fe(()=>e.localContext.loadedModels.length===0);let a=null;e.globalContext.hub.once("plan-mask:open",(d=null)=>{a=d},{getLastEvent:!0});const l=Fe(()=>e.localContext.loadedModels[0]),c=()=>{e.globalContext.layout=a},u=async()=>{r.value=!0,await n.savePlanMasks(t),delete a.windowState.viewpoint,e.globalContext.layout=a};return(d,h)=>{const p=T("BIMDataButton"),A=T("BIMDataSpinner");return B(),F("div",GHt,[C("div",QHt,[k(jHt,{class:"m-x-6"}),C("span",qHt,Q(d.$t("plan-mask.title")),1),h[0]||(h[0]=C("span",{class:"m-x-12"},"-",-1)),C("span",KHt,Q(l.value?l.value.name:`... ${d.$t("global.loading")}`),1)]),C("div",JHt,[k(p,{color:"high",fill:"",radius:"",class:"m-x-6",width:"120px",onClick:c},{default:N(()=>[Xe(Q(d.$t("global.cancel")),1)]),_:1}),k(p,{color:"primary",fill:"",radius:"",class:"m-x-6",width:"120px",disabled:o.value,onClick:u},{default:N(()=>[r.value||s.value?(B(),K(A,{key:0})):(B(),F(it,{key:1},[Xe(Q(d.$t("global.done")),1)],64))]),_:1},8,["disabled"])])])}}},[["__scopeId","data-v-5f535646"]]),ZHt={},YHt={width:"13",height:"17",viewBox:"0 0 13 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function XHt(i,e){return B(),F("svg",YHt,[...e[0]||(e[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.0205887 0.760241C-0.0369001 0.612234 0.0293064 0.447777 0.177996 0.369239L0.794439 0.0436382C0.943129 -0.0348991 1.13191 -0.00512553 1.24327 0.114426C2.20441 1.14624 3.98875 2.45304 5.91415 3.77084C6.67376 4.29074 7.45537 4.81236 8.20995 5.31594C9.3481 6.0755 10.4248 6.79402 11.2717 7.40369C12.7916 8.49791 13.1419 9.88267 12.9535 11.1463C12.784 12.2835 12.1812 13.3235 11.6281 13.9998L12.22 14.9378C12.3183 15.0935 12.26 15.2927 12.0898 15.3826L9.11031 16.9563C8.94008 17.0462 8.72242 16.9929 8.62414 16.8371L8.0322 15.8992C7.11546 15.9992 5.82958 15.9568 4.66823 15.5225C3.3779 15.04 2.24219 14.0701 1.96637 12.3187C1.82059 11.393 1.68028 10.2545 1.53148 9.04694C1.41992 8.14169 1.30358 7.19767 1.17658 6.27549C0.876924 4.09967 0.517281 2.039 0.0205887 0.760241ZM1.10889 1.88952C1.4235 3.12855 1.67045 4.65216 1.8828 6.19409C2.01281 7.13806 2.12977 8.08803 2.24122 8.99317C2.38829 10.1877 2.52577 11.3043 2.67091 12.2258C2.90528 13.714 3.84317 14.5105 4.93756 14.9197C6.05334 15.337 7.33156 15.3476 8.16398 15.225C8.30978 15.2035 8.45493 15.2666 8.52877 15.3836L9.06263 16.2296L11.4257 14.9814L10.8918 14.1355C10.818 14.0185 10.8308 13.8719 10.924 13.7671C11.4563 13.1689 12.0853 12.1509 12.2483 11.0582C12.408 9.98654 12.1231 8.84526 10.8315 7.91546C9.99174 7.31094 8.93656 6.60686 7.80965 5.85492C7.05354 5.3504 6.26503 4.82427 5.48775 4.29227C4.0633 3.31734 2.67549 2.32196 1.63764 1.42496L6.84795 9.68113C7.39973 9.55339 7.99902 9.7688 8.29767 10.242C8.65803 10.813 8.44417 11.5432 7.82001 11.8729C7.19585 12.2026 6.39774 12.0069 6.03738 11.4359C5.73868 10.9626 5.83449 10.38 6.23147 10.0067L1.10889 1.88952Z",fill:"#2F374A"},null,-1)])])}const $Ht=H(ZHt,[["render",XHt]]);function ezt(i,e){const t=ut("state"),{newFiltersByModelId:n}=t,o=pe(!1),r=pe(100),s=pe(100),a=pe(1),l=Fe({get:()=>Math.round(a.value*100),set:v=>{a.value=v/100}}),c=Fe(()=>o.value===!1&&r.value===100&&s.value===100&&a.value===1),u=pe(!1);dt(e,v=>{if(u.value=!1,!v?.mask_2d)return;const y=v.mask_2d;o.value=y.grayscale??!1,r.value=y.brightness??100,s.value=y.contrast??100,a.value=y.opacity??1},{immediate:!0});const d=pe(!1),h=()=>{d.value=!1},p=()=>{const v=n.get(e.value?.id);if(v)o.value=v.grayscale??!1,r.value=v.brightness??100,s.value=v.contrast??100,a.value=v.opacity??1;else{const y=e.value?.mask_2d;o.value=y?.grayscale??!1,r.value=y?.brightness??100,s.value=y?.contrast??100,a.value=y?.opacity??1}u.value=!1,d.value=!1},A=Fe(()=>{if(!e.value)return!1;if(!n.has(e.value?.id)){const y=e.value.mask_2d;return y?(y.grayscale??!1)!==o.value||(y.brightness??100)!==r.value||(y.contrast??100)!==s.value||(y.opacity??1)!==a.value:o.value!==!1||r.value!==100||s.value!==100||a.value!==1}const v=n.get(e.value?.id);return v&&((v.grayscale??!1)!==o.value||(v.brightness??100)!==r.value||(v.contrast??100)!==s.value||(v.opacity??1)!==a.value)}),f=()=>{u.value===!1?u.value=!0:A.value?d.value=!0:u.value=!1};dt([o,r,s,a],()=>{if(!e.value)return;const v=e.value.parent?.document??e.value.document,y=i.value.plugins.bitmaps,x=y.bitmaps.find(M=>M.document.id===v.id);x&&(x.tempMask===void 0&&(x.tempMask=null),c.value?x.tempMask&&(x.tempMask.crop_path?(x.tempMask.grayscale=void 0,x.tempMask.brightness=void 0,x.tempMask.contrast=void 0,x.tempMask.opacity=void 0):x.tempMask=null):(x.tempMask||(x.tempMask={}),x.tempMask.grayscale=o.value!==!1?o.value:void 0,x.tempMask.brightness=r.value!==100?r.value:void 0,x.tempMask.contrast=s.value!==100?s.value:void 0,x.tempMask.opacity=a.value!==1?a.value:void 0),y.draw())},{immediate:!0});const g=()=>{o.value=!1,r.value=100,s.value=100,a.value=1};function m(v={}){return v.grayscale=o.value!==!1?o.value:void 0,v.brightness=r.value!==100?r.value:void 0,v.contrast=s.value!==100?s.value:void 0,v.opacity=a.value!==1?a.value:void 0,v}return{parametersDisplayed:u,onDisplayParametersClick:f,warningModelDisplayed:d,unsavedChanges:A,allFiltersDefault:c,onModalCancel:h,onModalOk:p,grayscale:o,brightness:r,contrast:s,opacity:l,onResetParametersClick:g,onApplyParametersClick:()=>{if(!e.value)return;const v=c.value,y=n.get(e.value.id);y?v?e.value.mask_2d?n.set(e.value.id,null):n.delete(e.value.id):m(y):v?e.value.mask_2d&&n.set(e.value.id,null):n.set(e.value.id,m()),u.value=!1}}}function tzt(){const i=pe(null),e=(n="path")=>{i.value===n?i.value=null:i.value=n},t=n=>{n.key==="Escape"&&(i.value=null)};return document.addEventListener("keydown",t),ki(()=>{document.removeEventListener("keydown",t)}),{drawMode:i,onDrawClick:e}}function izt(i,e,t){const n=ut("state"),{newCropPathByModelId:o}=n;let r=null;dt(t,c=>{const{pen:u}=i.value.plugins;u.primaryColor=8840,c!==null?(u.drawMode=c,u.startDrawing(),r=u.once("add",({path:d})=>{t.value=null,o.set(e.value.id,d.points.slice()),setTimeout(()=>d.destroy(),0)})):(u.stopDrawing(),u.path=null,u.off(r))});const s=()=>{e.value.mask_2d?o.set(e.value.id,null):o.delete(e.value.id)},a=Fe(()=>{if(!e.value)return null;if(o.has(e.value.id))return o.get(e.value.id);if(e.value.mask_2d?.crop_path)return e.value.mask_2d.crop_path.map(c=>({x:c[0],y:c[1]}))});let l=null;return dt(a,c=>{if(l?.destroy(),c){const{pen:u}=i.value.plugins;u.primaryColor=16711680,l=u.draw(c)}},{immediate:!0}),{currentCropPath:a,onDeleteClick:s}}function nzt(i){const e=ut("$viewer"),t=Fe(()=>e.localContext.loadedModels[0]);dt(t,s=>{s&&i.value?.loadModels([s])},{immediate:!0});const n=Fe(()=>i.value?.pdfPages??[]),o=Fe(()=>i.value?.pdfPageIndex??0);return{model:t,pdfPages:n,pdfPageIndex:o,setPdfPage:s=>{i.value?.setPdfPage(s)}}}const ozt={class:"bimdata-plan-mask__viewer"},szt={key:0,class:"bimdata-plan-mask__viewer__options"},rzt={class:"bimdata-plan-mask__viewer__options__buttons"},azt={key:0,class:"bimdata-plan-mask__viewer__options__parameters"},lzt={key:0,class:"bimdata-plan-mask__viewer__options__parameters__warning"},czt={class:"bimdata-plan-mask__viewer__options__parameters__warning__icon"},uzt={class:"bimdata-plan-mask__viewer__options__parameters__warning__title"},dzt={class:"bimdata-plan-mask__viewer__options__parameters__warning__text"},hzt={class:"bimdata-plan-mask__viewer__options__parameters__warning__buttons"},pzt={class:"bimdata-plan-mask__viewer__options__parameters__title"},fzt={class:"bimdata-plan-mask__viewer__options__parameters__parameter--toggle"},Azt={class:"bimdata-plan-mask__viewer__options__parameters__parameter--range"},mzt={class:"bimdata-plan-mask__viewer__options__parameters__parameter--range"},gzt={class:"bimdata-plan-mask__viewer__options__parameters__parameter--range"},vzt={class:"bimdata-plan-mask__viewer__options__parameters__buttons"},yzt=H({__name:"PlanMaskViewer",setup(i){const e=Ci(null),{drawMode:t,onDrawClick:n}=tzt(),{model:o,pdfPages:r,pdfPageIndex:s,setPdfPage:a}=nzt(e),{currentCropPath:l,onDeleteClick:c}=izt(e,o,t),{parametersDisplayed:u,onDisplayParametersClick:d,warningModelDisplayed:h,onModalCancel:p,onModalOk:A,unsavedChanges:f,allFiltersDefault:g,grayscale:m,brightness:w,contrast:v,opacity:y,onResetParametersClick:x,onApplyParametersClick:M}=ezt(e,o);return(E,S)=>{const I=T("BIMDataIconParameters"),R=T("BIMDataButton"),P=T("BIMDataIconDelete"),D=T("BIMDataIconWarning"),L=T("BIMDataToggle"),U=T("BIMDataSlider");return B(),F("div",ozt,[rt(o)?(B(),F("div",szt,[C("div",rzt,[k(R,{fill:"",square:"",icon:"",onClick:rt(d),color:rt(u)?"secondary":"default"},{default:N(()=>[k(I,{fill:"",size:"xs"})]),_:1},8,["onClick","color"]),rt(l)?(B(),K(R,{key:1,fill:"",square:"",icon:"",onClick:S[2]||(S[2]=z=>rt(c)())},{default:N(()=>[k(P,{fill:"",color:"high",size:"xs"})]),_:1})):(B(),F(it,{key:0},[k(R,{color:rt(t)==="rectangle"?"secondary":"default",fill:"",square:"",icon:"",onClick:S[0]||(S[0]=z=>rt(n)("rectangle"))},{default:N(()=>[...S[7]||(S[7]=[C("div",{class:"bimdata-plan-mask__viewer__rectangle-icon"},null,-1)])]),_:1},8,["color"]),k(R,{color:rt(t)==="path"?"secondary":"default",fill:"",square:"",icon:"",onClick:S[1]||(S[1]=z=>rt(n)("path"))},{default:N(()=>[k($Ht)]),_:1},8,["color"])],64))]),rt(u)?(B(),F("div",azt,[rt(h)?(B(),F("div",lzt,[C("div",czt,[k(D,{size:"m",fill:"",color:"high"})]),C("div",uzt,Q(E.$t("global.warning"))+"! ",1),C("div",dzt,Q(E.$t("plan-mask.parameters.warning_text")),1),C("div",hzt,[k(R,{color:"primary",ghost:"",radius:"",onClick:rt(p),width:"120px"},{default:N(()=>[Xe(Q(E.$t("global.cancel")),1)]),_:1},8,["onClick"]),k(R,{color:"high",fill:"",radius:"",onClick:rt(A),width:"120px"},{default:N(()=>[Xe(Q(E.$t("global.ok")),1)]),_:1},8,["onClick"])])])):(B(),F(it,{key:1},[C("div",pzt,[k(I,{fill:"",size:"xs"}),C("span",null,Q(E.$t("plan-mask.parameters.title")),1)]),C("div",fzt,[C("span",null,Q(E.$t("plan-mask.parameters.grayscale")),1),k(L,{modelValue:rt(m),"onUpdate:modelValue":S[3]||(S[3]=z=>cn(m)?m.value=z:null)},null,8,["modelValue"])]),C("div",Azt,[C("div",null,Q(E.$t("plan-mask.parameters.brightness"))+" : "+Q(rt(w))+"% ",1),k(U,{modelValue:rt(w),"onUpdate:modelValue":S[4]||(S[4]=z=>cn(w)?w.value=z:null),min:0,max:200,step:1},null,8,["modelValue"])]),C("div",mzt,[C("div",null,Q(E.$t("plan-mask.parameters.contrast"))+" : "+Q(rt(v))+"% ",1),k(U,{modelValue:rt(v),"onUpdate:modelValue":S[5]||(S[5]=z=>cn(v)?v.value=z:null),min:0,max:200,step:1},null,8,["modelValue"])]),C("div",gzt,[C("div",null,Q(E.$t("plan-mask.parameters.opacity"))+" : "+Q(rt(y))+"%",1),k(U,{modelValue:rt(y),"onUpdate:modelValue":S[6]||(S[6]=z=>cn(y)?y.value=z:null),min:0,max:100,step:1},null,8,["modelValue"])]),C("div",vzt,[k(R,{color:"primary",outline:"",radius:"",width:"135px",height:"36px",disabled:rt(g),onClick:rt(x)},{default:N(()=>[Xe(Q(E.$t("global.reset")),1)]),_:1},8,["disabled","onClick"]),k(R,{color:"primary",fill:"",radius:"",width:"135px",height:"36px",disabled:!rt(f),onClick:rt(M)},{default:N(()=>[Xe(Q(E.$t("global.apply")),1)]),_:1},8,["disabled","onClick"])])],64))])):oe("",!0)])):oe("",!0),k(L4,{ref_key:"viewer",ref:e,enablePenPlugin:"",enablePlanMask:!1,ignoreCropPathWhileFitView:""},{default:N(()=>[rt(r).length>0?(B(),K(aT,{key:0,pages:rt(r),index:rt(s),onInput:rt(a),onPrev:rt(a),onNext:rt(a)},null,8,["pages","index","onInput","onPrev","onNext"])):oe("",!0)]),_:1},512)])}}},[["__scopeId","data-v-c240912b"]]);class wzt{constructor(e){this.$viewer=e}async savePlanMasks(e){const{$viewer:t}=this,{newCropPathByModelId:n,newFiltersByModelId:o}=e,r=[...Array.from(new Set(n.keys())),...Array.from(new Set(o.keys()))],s=new Map;for(const a of r){const l=n.get(a),c=o.get(a),u=t.state.modelsMap.get(a);if(!u){console.warn(`[Plan Mask] Model with ID ${a} not found in state.modelsMap`);continue}if(u.mask_2d&&l===null&&c===null){s.set(a,null);continue}const d={};n.has(a)&&(d.crop_path=l?.map(h=>[h.x,h.y])??null),o.has(a)&&(d.grayscale=c?.grayscale??!1,d.contrast=c?.contrast??100,d.brightness=c?.brightness??100,d.opacity=c?.opacity??1),s.set(a,d)}try{const{apiClient:a,cloudId:l,projectId:c}=t.api;await Promise.all(Array.from(s.entries()).map(async([u,d])=>{if(d===null)await a.modelApi.deleteMask2D(l,u,c),$6(t.state,u,null);else if(t.state.modelsMap.get(u).mask_2d){const h=await a.modelApi.updateMask2D(l,u,c,d);$6(t.state,u,h)}else{const h=await a.modelApi.createMask2D(l,u,c,d);$6(t.state,u,h)}}))}catch(a){console.error(`[Plan Mask] Impossible to save the masks of the models : ${Array.from(s.keys()).join(", ")}`,a)}}}const Czt={class:"bimdata-plan-mask"},bzt={name:"plan-mask",i18n:{en:{title:"Targeted Display",parameters:{title:"Adjust image",grayscale:"Grayscale",brightness:"Brightness",contrast:"Contrast",opacity:"Opacity",warning_text:"You have unsaved changes, are you sure you want to quit?"}},fr:{title:"Affichage Ciblé",parameters:{title:"Ajuster l'image",grayscale:"Niveaux de gris",brightness:"Luminosité",contrast:"Contraste",opacity:"Opacité",warning_text:"Vous avez des modifications non enregistrées, êtes-vous sûr de vouloir quitter ?"}}},component:H({__name:"PlanMask",setup(i){const e=qn({newCropPathByModelId:new Map,newFiltersByModelId:new Map});qi("state",e);const t=new wzt(ut("$viewer"));return qi("service",t),(n,o)=>(B(),F("div",Czt,[k(WHt),k(yzt,{class:"bimdata-plan-mask__content__viewer"})]))}},[["__scopeId","data-v-8df06378"]]),window:{name:"plan-mask",header:!1,displayedInWindowSelector:!1,modelTypes:["PDF","JPEG","PNG","METABUILDING"],multiModel:!1}};function $de(i=()=>{},e=()=>{},t=null){const n=pe(!1),o=pe(t),r=qn({x:0,y:0});function s(c){if((e?.(c)??!0)===!1)return;n.value=!0;const{x:d,y:h}=o.value.getBoundingClientRect();r.x=c.clientX-d,r.y=c.clientY-h,document.addEventListener("mouseup",a),document.addEventListener("mousemove",l)}function a(){document.removeEventListener("mousemove",l),n.value=!1}function l(c){i?.(c)}return ci(()=>o.value.addEventListener("mousedown",s)),ra(()=>o.value.removeEventListener("mousedown",s)),{grabbing:n,templateRef:o,startPosition:r}}const xzt=["attrs"],Mzt={key:0,width:"140",height:"140",viewBox:"0 0 140 140",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",transform:"translate(-50%, -50%)","pointer-events":"none"}},Bzt=["d","fill"],Ezt=["width","viewBox"],Izt=["x2"],Szt=["x2","stroke-dasharray"],Pzt=["opacity"],Tzt={key:3,width:"6",height:"6",viewBox:"0 0 6 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",transform:"translate(-50%, -50%)","pointer-events":"none"}},kzt=25,Rzt={__name:"Rotation2D",props:{canvasPosition:{type:Object,required:!0},position:{type:Object,required:!0}},emits:["marker-move"],setup(i,{emit:e}){const n=ut("$viewer").localContext.viewer.viewer,o=n.canvas.parentElement.style,r=o.cursor,s=e,a=i,l=qn({x:a.canvasPosition.x,y:a.canvasPosition.y}),c=Fe(()=>({x:l.x-a.canvasPosition.x,y:l.y-a.canvasPosition.y})),u=Fe(()=>{const{x:U,y:z}=c.value;return Math.sqrt(U*U+z*z)}),d=Fe(()=>{const{x:U,y:z}=c.value;return Math.atan2(z,U)*(180/Math.PI)}),{grabbing:h,templateRef:p}=$de(U=>{const{clientX:z,clientY:j}=U,{x:Z,y:W}=n.canvas.getBoundingClientRect(),{x:ee,y:ae}=n.camera.getPosition({x:z-Z,y:j-W});l.x=z-Z,l.y=j-W,s("marker-move",{x:ee,y:ae})},U=>{U.stopPropagation(),U.preventDefault()}),A=Fe(()=>{const{x:U,y:z}=a.canvasPosition,{x:j,y:Z}=E;return Math.atan2(Z-z,j-U)*(180/Math.PI)}),f=Fe(()=>{const{x:U,y:z}=a.canvasPosition,{x:j,y:Z}=E,W=j-U,ee=Z-z,Be=68/Math.sqrt(W*W+ee*ee);return{x:W*Be,y:ee*Be}}),g=Fe(()=>{const{x:U,y:z}=c.value,Z=68/Math.sqrt(U*U+z*z);return{x:U*Z+70,y:z*Z+70}}),m=Fe(()=>{const{x:U,y:z}=g.value;return Math.atan2(z-70,U-70)});function w(U,z,j){return`url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="${z}" height="${j}" viewBox="0 0 ${z} ${j}">${U}</svg>')`}const v=Fe(()=>`${w(`<path d="M19.7004 2.28955L19.2674 1.53955L18.8344 2.28955L14.9856 8.95583L14.5526 9.70583H15.4186H18.1325V16.507V17.007H18.6325H19.9023H20.4023V16.507V9.70583H23.1162H23.9822L23.5492 8.95583L19.7004 2.28955ZM18.8344 37.0733L19.2674 37.8233L19.7004 37.0733L23.5492 30.407L23.9822 29.657H23.1162H20.4023V22.8558V22.3558H19.9023H18.6325H18.1325V22.8558V29.657H15.4186H14.5526L14.9856 30.407L18.8344 37.0733Z" fill="black" stroke="white" transform="rotate(${m.value*(180/Math.PI)})" transform-origin="center" />`,39,39)} 20 20, auto`);dt(v,U=>{o.cursor=U},{immediate:!0}),dt(h,U=>{U?o.cursor="crosshair":o.cursor=v.value});const y=Fe(()=>{const{x:U,y:z}=f.value,j=Math.atan2(z,U);let W=m.value-j;return W<-Math.PI?W+=2*Math.PI:W>Math.PI&&(W-=2*Math.PI),W});let x=0;const{grabbing:M,startPosition:E}=$de(()=>{const U=-(y.value/Math.PI)*180;n.camera.rotate(U-x,a.position),x=U},U=>{if(U.shiftKey)return!1;U.stopPropagation(),U.preventDefault()},n.canvas);dt(M,U=>{U?(n.ui.rotatable=!1,n.ui.translatable=!1,n.ui.scallable=!1):(x=0,n.ui.rotatable=!0,n.ui.translatable=!0,n.ui.scallable=!0)});const S=pe(!1),I=Fe(()=>S.value&&M.value);n.ui.on("mousemove",({canvasPosition:U,altKey:z})=>{const{x:j,y:Z}=U;if(!M.value||z){l.x=j,l.y=Z,S.value=!1;return}const W={x:j-a.canvasPosition.x,y:Z-a.canvasPosition.y},ee=Math.atan2(W.y,W.x),ae=Math.round(ee/(Math.PI/4))*(Math.PI/4),Be=Math.cos(ae)*Math.sqrt(W.x*W.x+W.y*W.y),Ee=Math.sin(ae)*Math.sqrt(W.x*W.x+W.y*W.y);Math.sqrt((Be-W.x)*(Be-W.x)+(Ee-W.y)*(Ee-W.y))<kzt?(l.x=a.canvasPosition.x+Be,l.y=a.canvasPosition.y+Ee,S.value=!0):(l.x=j,l.y=Z,S.value=!1)});const R=Fe(()=>y.value>0?1:0),P=pe(!1),D=pe("grab");let L=null;return dt(P,U=>{U&&!L?L=setInterval(()=>{P.value&&(D.value=D.value==="grab"?"grabbing":"grab")},500):!U&&L&&(clearInterval(L),L=null,D.value="grab")}),ki(()=>{o.cursor=r}),(U,z)=>(B(),F(it,null,[(B(),F("svg",{attrs:U.$attrs,width:"140",height:"140",viewBox:"0 0 140 140",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",transform:"translate(-50%, -50%)","pointer-events":"none"}},[...z[2]||(z[2]=[C("circle",{cx:"70",cy:"70",r:"68",stroke:"#2F374A","stroke-width":"2"},null,-1)])],8,xzt)),rt(M)?(B(),F("svg",Mzt,[C("path",{d:`
|
|
5533
|
+
`,Ww=class c0e{constructor(){this.$=c0e.IDLE}is(...e){return e.some(t=>this.$&t)}set(e){this.$=e}add(e){this.$|=e}remove(e){this.$&=~e}};Ww.IDLE=0,Ww.CLICK=1,Ww.MOVING=2;var mo=Ww,MVt=class extends P5{constructor(i){super(i),this.data={startMouseX:0,startMouseY:0,mouseX:0,mouseY:0,pinchDist:0,moveDelta:{yaw:0,pitch:0,zoom:0},accumulatorFactor:0,ctrlKeyDown:!1,dblclickData:null,dblclickTimeout:null,longtouchTimeout:null,twofingersTimeout:null,ctrlZoomTimeout:null},this.step=new mo,this.keyHandler=new jw,this.resizeObserver=new ResizeObserver(Iue(()=>this.viewer.autoSize(),50)),this.moveThreshold=uue*Os.pixelRatio}init(){window.addEventListener("keydown",this,{passive:!1}),window.addEventListener("keyup",this),this.viewer.container.addEventListener("mousedown",this),window.addEventListener("mousemove",this,{passive:!1}),window.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchstart",this,{passive:!1}),window.addEventListener("touchmove",this,{passive:!1}),window.addEventListener("touchend",this,{passive:!1}),this.viewer.container.addEventListener("wheel",this,{passive:!1}),document.addEventListener("fullscreenchange",this),this.resizeObserver.observe(this.viewer.container),this.viewer.addEventListener(g5.type,this),this.viewer.addEventListener(B5.type,this)}destroy(){window.removeEventListener("keydown",this),window.removeEventListener("keyup",this),this.viewer.container.removeEventListener("mousedown",this),window.removeEventListener("mousemove",this),window.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchstart",this),window.removeEventListener("touchmove",this),window.removeEventListener("touchend",this),this.viewer.container.removeEventListener("wheel",this),document.removeEventListener("fullscreenchange",this),this.resizeObserver.disconnect(),this.viewer.removeEventListener(g5.type,this),this.viewer.removeEventListener(B5.type,this),clearTimeout(this.data.dblclickTimeout),clearTimeout(this.data.longtouchTimeout),clearTimeout(this.data.twofingersTimeout),clearTimeout(this.data.ctrlZoomTimeout),super.destroy()}handleEvent(i){switch(i.type){case"keydown":this.__onKeyDown(i);break;case"keyup":this.__onKeyUp();break;case"mousemove":this.__onMouseMove(i);break;case"mouseup":this.__onMouseUp(i);break;case"touchmove":this.__onTouchMove(i);break;case"touchend":this.__onTouchEnd(i);break;case"fullscreenchange":this.__onFullscreenChange();break;case g5.type:this.__applyMoveDelta();break;case B5.type:this.__clearMoveDelta();break}if(!bue(i,"."+f5))switch(i.type){case"mousedown":this.__onMouseDown(i);break;case"touchstart":this.__onTouchStart(i);break;case"wheel":this.__onMouseWheel(i);break}}__onKeyDown(i){if(this.config.mousewheelCtrlKey&&(this.data.ctrlKeyDown=i.key===Lo.Control,this.data.ctrlKeyDown&&(clearTimeout(this.data.ctrlZoomTimeout),this.viewer.overlay.hide(Jo.CTRL_ZOOM))),!!this.viewer.dispatchEvent(new ad(i.key,i))&&!(!this.state.keyboardEnabled||!this.config.keyboardActions||this.keyHandler.pending)){for(const[e,t]of Object.entries(this.config.keyboardActions))if(yD(i,e)){if(typeof t=="function")t(this.viewer,i);else{switch(t!=="ZOOM_IN"&&t!=="ZOOM_OUT"&&this.viewer.stopAll(),t){case"ROTATE_UP":this.viewer.dynamics.position.roll({pitch:!1});break;case"ROTATE_DOWN":this.viewer.dynamics.position.roll({pitch:!0});break;case"ROTATE_RIGHT":this.viewer.dynamics.position.roll({yaw:!1});break;case"ROTATE_LEFT":this.viewer.dynamics.position.roll({yaw:!0});break;case"ZOOM_IN":this.viewer.dynamics.zoom.roll(!1);break;case"ZOOM_OUT":this.viewer.dynamics.zoom.roll(!0);break}this.keyHandler.down(t)}i.preventDefault();return}}}__onKeyUp(){this.data.ctrlKeyDown=!1,this.state.keyboardEnabled&&this.keyHandler.up(i=>{i==="ZOOM_IN"||i==="ZOOM_OUT"?this.viewer.dynamics.zoom.stop():(this.viewer.dynamics.position.stop(),this.viewer.resetIdleTimer())})}__onMouseDown(i){this.step.add(mo.CLICK),this.data.startMouseX=i.clientX,this.data.startMouseY=i.clientY,this.config.mousemove&&i.preventDefault()}__onMouseUp(i){this.step.is(mo.CLICK,mo.MOVING)&&this.__stopMove(i.clientX,i.clientY,i,i.button===2)}__onMouseMove(i){this.config.mousemove&&this.step.is(mo.CLICK,mo.MOVING)&&(i.preventDefault(),this.__doMove(i.clientX,i.clientY)),this.__handleObjectsEvents(i)}__onTouchStart(i){i.touches.length===1?(this.step.add(mo.CLICK),this.data.startMouseX=i.touches[0].clientX,this.data.startMouseY=i.touches[0].clientY,this.data.longtouchTimeout||(this.data.longtouchTimeout=setTimeout(()=>{const e=i.touches[0];this.__stopMove(e.clientX,e.clientY,i,!0),this.data.longtouchTimeout=null},hue))):i.touches.length===2&&(this.step.set(mo.IDLE),this.__cancelLongTouch(),this.config.mousemove&&(this.__cancelTwoFingersOverlay(),this.__startMoveZoom(i),i.preventDefault()))}__onTouchEnd(i){if(this.__cancelLongTouch(),this.step.is(mo.CLICK,mo.MOVING)){if(i.preventDefault(),this.__cancelTwoFingersOverlay(),i.touches.length===1)this.__stopMove(this.data.mouseX,this.data.mouseY);else if(i.touches.length===0){const e=i.changedTouches[0];this.__stopMove(e.clientX,e.clientY,i)}}}__onTouchMove(i){if(this.__cancelLongTouch(),!!this.config.mousemove)if(i.touches.length===1){if(this.config.touchmoveTwoFingers)this.step.is(mo.CLICK)&&!this.data.twofingersTimeout&&(this.data.twofingersTimeout=setTimeout(()=>{this.viewer.overlay.show({id:Jo.TWO_FINGERS,image:bVt,title:this.config.lang.twoFingers})},pue));else if(this.step.is(mo.CLICK,mo.MOVING)){i.preventDefault();const e=i.touches[0];this.__doMove(e.clientX,e.clientY)}}else this.__doMoveZoom(i),this.__cancelTwoFingersOverlay()}__cancelLongTouch(){this.data.longtouchTimeout&&(clearTimeout(this.data.longtouchTimeout),this.data.longtouchTimeout=null)}__cancelTwoFingersOverlay(){this.config.touchmoveTwoFingers&&(this.data.twofingersTimeout&&(clearTimeout(this.data.twofingersTimeout),this.data.twofingersTimeout=null),this.viewer.overlay.hide(Jo.TWO_FINGERS))}__onMouseWheel(i){if(!this.config.mousewheel||!i.deltaY)return;if(this.config.mousewheelCtrlKey&&!this.data.ctrlKeyDown){this.viewer.overlay.show({id:Jo.CTRL_ZOOM,image:xVt,title:this.config.lang.ctrlZoom}),clearTimeout(this.data.ctrlZoomTimeout),this.data.ctrlZoomTimeout=setTimeout(()=>this.viewer.overlay.hide(Jo.CTRL_ZOOM),fue);return}i.preventDefault(),i.stopPropagation();const e=i.deltaY/Math.abs(i.deltaY)*5*this.config.zoomSpeed;e!==0&&this.viewer.dynamics.zoom.step(-e,5)}__onFullscreenChange(){const i=this.viewer.isFullscreenEnabled();this.config.keyboard==="fullscreen"&&(i?this.viewer.startKeyboardControl():this.viewer.stopKeyboardControl()),this.viewer.dispatchEvent(new v5(i))}__resetMove(){this.step.set(mo.IDLE),this.data.mouseX=0,this.data.mouseY=0,this.data.startMouseX=0,this.data.startMouseY=0}__startMoveZoom(i){this.viewer.stopAll(),this.__resetMove();const e=vD(i);this.step.set(mo.MOVING),this.data.accumulatorFactor=this.config.moveInertia,{distance:this.data.pinchDist,center:{x:this.data.mouseX,y:this.data.mouseY}}=e}__stopMove(i,e,t,n=!1){this.step.is(mo.CLICK)&&!this.__moveThresholdReached(i,e)&&this.__doClick(i,e,t,n),this.config.moveInertia&&(this.data.accumulatorFactor=Math.pow(this.config.moveInertia,.5)),this.__resetMove(),this.viewer.resetIdleTimer()}__doClick(i,e,t,n=!1){const o=this.viewer.container.getBoundingClientRect(),r=i-o.left,s=e-o.top,a=this.viewer.renderer.getIntersections({x:r,y:s}),l=a.find(c=>c.object.userData[od]);if(l){const c=this.viewer.dataHelper.vector3ToSphericalCoords(l.point),u={rightclick:n,originalEvent:t,target:Lw(t),clientX:i,clientY:e,viewerX:r,viewerY:s,yaw:c.yaw,pitch:c.pitch,objects:a.map(d=>d.object).filter(d=>!d.userData[od])};try{const d=this.viewer.dataHelper.sphericalCoordsToTextureCoords(u);Object.assign(u,d)}catch{}this.data.dblclickTimeout?(Math.abs(this.data.dblclickData.clientX-u.clientX)<this.moveThreshold&&Math.abs(this.data.dblclickData.clientY-u.clientY)<this.moveThreshold&&this.viewer.dispatchEvent(new $ue(this.data.dblclickData)),clearTimeout(this.data.dblclickTimeout),this.data.dblclickTimeout=null,this.data.dblclickData=null):(this.viewer.dispatchEvent(new Zue(u)),this.data.dblclickData=Ow(u),this.data.dblclickTimeout=setTimeout(()=>{this.data.dblclickTimeout=null,this.data.dblclickData=null},due))}}__handleObjectsEvents(i){if(!Pue(this.state.objectsObservers)&&i.composedPath().includes(this.viewer.container)){const e=xue(this.viewer.container),t={x:i.clientX-e.x,y:i.clientY-e.y},n=this.viewer.renderer.getIntersections(t),o=(r,s,a)=>{this.viewer.dispatchEvent(new a(i,r,t,s))};for(const[r,s]of Object.entries(this.state.objectsObservers)){const a=n.find(l=>l.object.userData[r]);a?(s&&a.object!==s&&(o(s,r,TD),this.state.objectsObservers[r]=null),s?o(a.object,r,Lde):(this.state.objectsObservers[r]=a.object,o(a.object,r,Rde))):s&&(o(s,r,TD),this.state.objectsObservers[r]=null)}}}__doMove(i,e){if(this.step.is(mo.CLICK)&&this.__moveThresholdReached(i,e))this.viewer.stopAll(),this.__resetMove(),this.step.set(mo.MOVING),this.data.mouseX=i,this.data.mouseY=e,this.data.accumulatorFactor=this.config.moveInertia;else if(this.step.is(mo.MOVING)){const t=(i-this.data.mouseX)*Math.cos(this.state.roll)-(e-this.data.mouseY)*Math.sin(this.state.roll),n=(e-this.data.mouseY)*Math.cos(this.state.roll)+(i-this.data.mouseX)*Math.sin(this.state.roll),o={yaw:this.config.moveSpeed*(t/this.state.size.width)*rn.degToRad(this.state.hFov),pitch:this.config.moveSpeed*(n/this.state.size.height)*rn.degToRad(this.state.vFov)};this.data.moveDelta.yaw+=o.yaw,this.data.moveDelta.pitch+=o.pitch,this.data.mouseX=i,this.data.mouseY=e}}__moveThresholdReached(i,e){return Math.abs(i-this.data.startMouseX)>=this.moveThreshold||Math.abs(e-this.data.startMouseY)>=this.moveThreshold}__doMoveZoom(i){if(this.step.is(mo.MOVING)){i.preventDefault();const e=vD(i);this.__doMove(e.center.x,e.center.y),this.data.moveDelta.zoom+=this.config.zoomSpeed*((e.distance-this.data.pinchDist)/Os.pixelRatio),this.data.pinchDist=e.distance}}__applyMoveDelta(){if(Math.abs(this.data.moveDelta.yaw)>0||Math.abs(this.data.moveDelta.pitch)>0){const e=this.viewer.getPosition();this.viewer.rotate({yaw:e.yaw-this.data.moveDelta.yaw*(1-this.config.moveInertia),pitch:e.pitch+this.data.moveDelta.pitch*(1-this.config.moveInertia)}),this.data.moveDelta.yaw*=this.data.accumulatorFactor,this.data.moveDelta.pitch*=this.data.accumulatorFactor,Math.abs(this.data.moveDelta.yaw)<=.001&&(this.data.moveDelta.yaw=0),Math.abs(this.data.moveDelta.pitch)<=.001&&(this.data.moveDelta.pitch=0)}if(Math.abs(this.data.moveDelta.zoom)>0){const e=this.viewer.getZoomLevel();this.viewer.zoom(e+this.data.moveDelta.zoom*(1-this.config.moveInertia)),this.data.moveDelta.zoom*=this.config.moveInertia,Math.abs(this.data.moveDelta.zoom)<=.001&&(this.data.moveDelta.zoom=0)}}__clearMoveDelta(){this.data.moveDelta.yaw=0,this.data.moveDelta.pitch=0,this.data.moveDelta.zoom=0}};Oi.enabled=!1;var Zw=new an,Wde=new lo,Zde=new wm,BVt=class extends P5{constructor(i){super(i),this.frustumNeedsUpdate=!0,this.renderer=new _Nt(this.config.rendererParameters),this.renderer.setPixelRatio(Os.pixelRatio),this.renderer.outputColorSpace=Ph,this.renderer.toneMapping=zle,this.renderer.domElement.className="psv-canvas",this.renderer.domElement.style.background=this.config.canvasBackground,this.scene=new Pce,this.camera=new ea(50,16/9,.1,2*Nh),this.camera.matrixAutoUpdate=!1;const e=new $r(new h5(Nh).scale(-1,1,1),new c5({opacity:0,transparent:!0,depthTest:!1,depthWrite:!1}));e.userData={[od]:!0},this.scene.add(e),this.raycaster=new kLt,this.frustum=new oD,this.container=document.createElement("div"),this.container.className="psv-canvas-container",this.container.appendChild(this.renderer.domElement),this.viewer.container.appendChild(this.container),this.container.addEventListener("contextmenu",t=>t.preventDefault()),this.viewer.addEventListener(M5.type,this),this.viewer.addEventListener(_c.type,this),this.viewer.addEventListener(w5.type,this),this.viewer.addEventListener(C5.type,this),this.viewer.addEventListener(sr.type,this),this.hide()}get panoramaPose(){return this.mesh.rotation}get sphereCorrection(){return this.meshContainer.rotation}init(){this.show(),this.renderer.setAnimationLoop(i=>this.__renderLoop(i))}destroy(){this.renderer.setAnimationLoop(null),this.cleanScene(this.scene),this.renderer.dispose(),this.viewer.container.removeChild(this.container),this.viewer.removeEventListener(M5.type,this),this.viewer.removeEventListener(_c.type,this),this.viewer.removeEventListener(w5.type,this),this.viewer.removeEventListener(C5.type,this),this.viewer.removeEventListener(sr.type,this),super.destroy()}handleEvent(i){switch(i.type){case M5.type:this.__onSizeUpdated();break;case _c.type:this.__onZoomUpdated();break;case w5.type:this.__onPositionUpdated();break;case C5.type:this.__onPositionUpdated();break;case sr.type:i.containsOptions("fisheye")&&this.__onPositionUpdated(),i.containsOptions("canvasBackground")&&(this.renderer.domElement.style.background=this.config.canvasBackground);break}}hide(){this.container.style.opacity="0"}show(){this.container.style.opacity="1"}setCustomRenderer(i){i?this.customRenderer=i(this.renderer):this.customRenderer=null,this.viewer.needsUpdate()}__onSizeUpdated(){this.renderer.setSize(this.state.size.width,this.state.size.height),this.camera.aspect=this.state.aspect,this.camera.updateProjectionMatrix(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__onZoomUpdated(){this.camera.fov=this.state.vFov,this.camera.updateProjectionMatrix(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__onPositionUpdated(){this.camera.position.set(0,0,0),this.camera.lookAt(this.state.direction),this.config.fisheye&&this.camera.position.copy(this.state.direction).multiplyScalar(this.config.fisheye/2).negate(),this.camera.rotateZ(-this.state.roll),this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__renderLoop(i){const e=this.timestamp?i-this.timestamp:0;this.timestamp=i,this.viewer.dispatchEvent(new g5(i,e)),this.viewer.dynamics.update(e),(this.state.needsUpdate||this.state.continuousUpdateCount>0)&&(this.state.needsUpdate=!1,(this.customRenderer||this.renderer).render(this.scene,this.camera),this.viewer.dispatchEvent(new Cde))}setTexture(i){this.meshContainer||(this.meshContainer=new Dm,this.scene.add(this.meshContainer)),this.state.textureData&&this.viewer.adapter.disposeTexture(this.state.textureData),this.mesh&&(this.meshContainer.remove(this.mesh),this.viewer.adapter.disposeMesh(this.mesh)),this.mesh=this.viewer.adapter.createMesh(i.panoData),this.viewer.adapter.setTexture(this.mesh,i,!1),this.meshContainer.add(this.mesh),this.state.textureData=i,this.viewer.needsUpdate()}setPanoramaPose(i,e=this.mesh){const t=this.viewer.dataHelper.cleanPanoramaPose(i);e.rotation.set(t.tilt,t.pan,t.roll,"YXZ")}setSphereCorrection(i,e=this.meshContainer){const t=this.viewer.dataHelper.cleanSphereCorrection(i);e.rotation.set(t.tilt,t.pan,t.roll,"YXZ")}transition(i,e,t){const n=t.effect==="fade"||t.rotation,o=!Fo(e.position),r=!Fo(e.zoom),s=new PD(o?this.viewer.dataHelper.cleanPosition(e.position):void 0,e.zoom);this.viewer.dispatchEvent(s);const a=new Dm,l=this.viewer.adapter.createMesh(i.panoData);if(this.viewer.adapter.setTexture(l,i,!0),this.viewer.adapter.setTextureOpacity(l,0),this.setPanoramaPose(i.panoData,l),this.setSphereCorrection(e.sphereCorrection,a),o&&!t.rotation){const h=this.viewer.getPosition(),p=new nt(0,1,0);a.rotateOnWorldAxis(p,s.position.yaw-h.yaw);const A=new nt(0,1,0).cross(this.camera.getWorldDirection(new nt)).normalize();a.rotateOnWorldAxis(A,s.position.pitch-h.pitch)}a.add(l),this.scene.add(a),this.renderer.setRenderTarget(new Ju),this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null);const{duration:c,properties:u}=this.viewer.dataHelper.getAnimationProperties(t.speed,t.rotation?s.position:null,n?s.zoomLevel:null),d=new zw({properties:{...u,opacity:{start:0,end:1}},duration:c,easing:"inOutCubic",onTick:h=>{switch(t.effect){case"fade":this.viewer.adapter.setTextureOpacity(l,h.opacity);break;case"black":case"white":h.opacity<.5?this.renderer.toneMappingExposure=t.effect==="black"?rn.mapLinear(h.opacity,0,.5,1,0):rn.mapLinear(h.opacity,0,.5,1,5):(this.renderer.toneMappingExposure=t.effect==="black"?rn.mapLinear(h.opacity,.5,1,0,1):rn.mapLinear(h.opacity,.5,1,5,1),this.mesh.visible=!1,this.viewer.adapter.setTextureOpacity(l,1),r&&!n&&this.viewer.dynamics.zoom.setValue(s.zoomLevel));break}o&&t.rotation&&this.viewer.dynamics.position.setValue({yaw:h.yaw,pitch:h.pitch}),r&&n&&this.viewer.dynamics.zoom.setValue(h.zoom),this.viewer.needsUpdate()}});return d.then(h=>{a.remove(l),this.scene.remove(a),h?(this.viewer.adapter.disposeTexture(this.state.textureData),this.meshContainer.remove(this.mesh),this.viewer.adapter.disposeMesh(this.mesh),this.mesh=l,this.meshContainer.add(l),this.state.textureData=i,this.setPanoramaPose(i.panoData),this.setSphereCorrection(e.sphereCorrection),o&&!t.rotation&&this.viewer.rotate(e.position)):(this.viewer.adapter.disposeTexture(i),this.viewer.adapter.disposeMesh(l))}),d}getIntersections(i){Zw.x=2*i.x/this.state.size.width-1,Zw.y=-2*i.y/this.state.size.height+1,this.raycaster.setFromCamera(Zw,this.camera);const e=this.raycaster.intersectObjects(this.scene.children,!0).filter(t=>t.object.visible).filter(t=>t.object.isMesh&&!!t.object.userData);return this.customRenderer?.getIntersections&&e.push(...this.customRenderer.getIntersections(this.raycaster,Zw)),e}isObjectVisible(i){if(!i)return!1;if(this.frustumNeedsUpdate&&(Wde.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),this.frustum.setFromProjectionMatrix(Wde),this.frustumNeedsUpdate=!1),i.isVector3)return this.frustum.containsPoint(i);if(i.isMesh&&i.geometry){const e=i;return e.geometry.boundingBox||e.geometry.computeBoundingBox(),Zde.copy(e.geometry.boundingBox).applyMatrix4(e.matrixWorld),this.frustum.intersectsBox(Zde)}else return i.isObject3D?this.frustum.intersectsObject(i):!1}addObject(i){this.scene.add(i)}removeObject(i){this.scene.remove(i)}cleanScene(i){const e=t=>{t.map?.dispose(),t.uniforms&&Object.values(t.uniforms).forEach(n=>{n.value?.dispose?.()}),t.dispose()};i.traverse(t=>{t.geometry?.dispose(),t.material&&(Array.isArray(t.material)?t.material.forEach(n=>{e(n)}):e(t.material)),t instanceof Pce||t.dispose?.(),t!==i&&this.cleanScene(t)})}},EVt=class extends SLt{constructor(){super(...arguments),this._abortController=new AbortController}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}load(i,e,t,n){const o=this._abortController.signal,r=super.load(i,l=>{a(),e(l)},t,l=>{if(a(),o.aborted){const c=new Error;c.name="AbortError",c.message="The operation was aborted.",n(c)}else n(l)});function s(){r.src=""}function a(){o.removeEventListener("abort",s,!1)}return o.addEventListener("abort",s,!1),r}},IVt=class extends P5{constructor(i){super(i),this.fileLoader=new ILt,this.fileLoader.setResponseType("blob"),this.imageLoader=new EVt}destroy(){this.abortLoading(),super.destroy()}abortLoading(){this.fileLoader.abort?.(),this.imageLoader.abort()}loadFile(i,e,t){const n=Hm.get(i,t);if(n){if(n instanceof Blob)return e?.(100),Promise.resolve(n);Hm.remove(i,t)}this.config.requestHeaders&&this.fileLoader.setRequestHeader(this.config.requestHeaders(i)),this.fileLoader.setWithCredentials(this.config.withCredentials(i));let o=0;return e?.(o),this.fileLoader.loadAsync(i,r=>{if(r.lengthComputable){const s=r.loaded/r.total*100;s>o&&(o=s,e?.(o))}}).then(r=>(o=100,e?.(o),Hm.add(i,t,r),r))}loadImage(i,e,t){const n=Hm.get(i,t);return n?(e?.(100),n instanceof Blob?this.blobToImage(n):Promise.resolve(n)):!e&&!this.config.requestHeaders?(this.imageLoader.setWithCredentials(this.config.withCredentials(i)),this.imageLoader.loadAsync(i).then(o=>(Hm.add(i,t,o),o))):this.loadFile(i,e,t).then(o=>this.blobToImage(o))}blobToImage(i){return new Promise((e,t)=>{const n=document.createElement("img");n.onload=()=>{URL.revokeObjectURL(n.src),e(n)},n.onerror=t,n.src=URL.createObjectURL(i)})}preloadPanorama(i){return this.viewer.adapter.supportsPreload(i)?this.viewer.adapter.loadTexture(i,!1):Promise.reject(new tn("Current adapter does not support preload"))}dispatchProgress(i){this.viewer.loader.setProgress(i),this.viewer.dispatchEvent(new cde(Math.round(i)))}},SVt=class extends P5{constructor(i){super(i),this.zoom=new m5(e=>{this.viewer.state.vFov=this.viewer.dataHelper.zoomLevelToFov(e),this.viewer.state.hFov=this.viewer.dataHelper.vFovToHFov(this.viewer.state.vFov),this.viewer.dispatchEvent(new _c(e))},{defaultValue:this.viewer.config.defaultZoomLvl,min:0,max:100,wrap:!1}),this.position=new Hue(e=>{this.viewer.dataHelper.sphericalCoordsToVector3(e,this.viewer.state.direction),this.viewer.dispatchEvent(new w5(e))},{yaw:new m5(null,{defaultValue:this.config.defaultYaw,min:0,max:2*Math.PI,wrap:!0}),pitch:new m5(null,{defaultValue:this.config.defaultPitch,min:-Math.PI/2,max:Math.PI/2,wrap:!1})}),this.roll=new m5(e=>{this.viewer.state.roll=e,this.viewer.dispatchEvent(new C5(e))},{defaultValue:0,min:-Math.PI,max:Math.PI,wrap:!1}),this.updateSpeeds()}updateSpeeds(){this.zoom.setSpeed(this.config.zoomSpeed*50),this.position.setSpeed(rn.degToRad(this.config.moveSpeed*50)),this.roll.setSpeed(rn.degToRad(this.config.moveSpeed*50))}update(i){this.zoom.update(i),this.position.update(i),this.roll.update(i)}},PVt=class{constructor(){this.ready=!1,this.needsUpdate=!1,this.continuousUpdateCount=0,this.keyboardEnabled=!1,this.direction=new nt(0,0,Nh),this.roll=0,this.vFov=60,this.hFov=60,this.aspect=1,this.animation=null,this.transitionAnimation=null,this.loadingPromise=null,this.idleTime=-1,this.objectsObservers={},this.size={width:0,height:0}}},TVt=class extends Gue{constructor(e){if(super(),this.plugins={},this.children=[],this.parent=wue(e.container),!this.parent)throw new tn('"container" element not found.');this.parent[od]=this,this.container=document.createElement("div"),this.container.classList.add("psv-container"),this.parent.appendChild(this.container),Nue(this.parent),Uue(this.container,"core"),this.state=new PVt,this.config=dVt(e),this.__setSize(this.config.size),this.overlay=new mVt(this);try{Os.load()}catch(t){console.error(t),this.showError(this.config.lang.webglError);return}Hm.init(),this.adapter=new this.config.adapter[0](this,this.config.adapter[1]),this.renderer=new BVt(this),this.textureLoader=new IVt(this),this.eventsHandler=new MVt(this),this.dataHelper=new CVt(this),this.dynamics=new SVt(this),this.adapter.init?.(),this.loader=new fVt(this),this.navbar=new pVt(this),this.panel=new vVt(this),this.notification=new AVt(this),this.autoSize(),this.setCursor(null),CD(Os.isTouchEnabled,t=>{_w(this.container,"psv--is-touch",t)}),this.config.plugins.forEach(([t,n])=>{this.plugins[t.id]=new t(this,n)});for(const t of Object.values(this.plugins))t.init?.();this.config.navbar&&this.navbar.setButtons(this.config.navbar),this.state.loadingPromise||(this.config.panorama?this.setPanorama(this.config.panorama,{sphereCorrection:this.config.sphereCorrection,panoData:this.config.panoData}):this.loader.show())}destroy(){this.stopAll(),this.stopKeyboardControl(),this.exitFullscreen();for(const[e,t]of Object.entries(this.plugins))t.destroy(),delete this.plugins[e];this.children.slice().forEach(e=>e.destroy()),this.children.length=0,this.eventsHandler?.destroy(),this.renderer?.destroy(),this.textureLoader?.destroy(),this.dataHelper?.destroy(),this.adapter?.destroy(),this.dynamics?.destroy(),this.parent.removeChild(this.container),delete this.parent[od]}init(){this.eventsHandler.init(),this.renderer.init(),this.config.navbar&&this.navbar.show(),this.config.keyboard==="always"&&this.startKeyboardControl(),this.resetIdleTimer(),this.state.ready=!0,this.dispatchEvent(new b5)}resetIdleTimer(){this.state.idleTime=performance.now()}disableIdleTimer(){this.state.idleTime=-1}getPlugin(e){if(typeof e=="string")return this.plugins[e];{const t=_D(e);return t?this.plugins[t.id]:null}}getPosition(){return this.dataHelper.cleanPosition(this.dynamics.position.current)}getZoomLevel(){return this.dynamics.zoom.current}getSize(){return{...this.state.size}}isFullscreenEnabled(){return Mue(this.parent,Os.isIphone)}needsUpdate(){this.state.needsUpdate=!0}needsContinuousUpdate(e){e?this.state.continuousUpdateCount++:this.state.continuousUpdateCount>0&&this.state.continuousUpdateCount--}autoSize(){(this.container.clientWidth!==this.state.size.width||this.container.clientHeight!==this.state.size.height)&&(this.state.size.width=Math.round(this.container.clientWidth),this.state.size.height=Math.round(this.container.clientHeight),this.state.aspect=this.state.size.width/this.state.size.height,this.state.hFov=this.dataHelper.vFovToHFov(this.state.vFov),this.dispatchEvent(new M5(this.getSize())),this.navbar.autoSize())}setPanorama(e,t={}){this.textureLoader.abortLoading(),this.state.transitionAnimation?.cancel();const n=this.dataHelper.getTransitionOptions(t);t.showLoader===void 0&&(t.showLoader=!0),t.caption===void 0&&(t.caption=this.config.caption),t.description===void 0&&(t.description=this.config.description),!t.panoData&&typeof this.config.panoData=="function"&&(t.panoData=this.config.panoData),this.hideError(),this.resetIdleTimer(),this.config.panorama=e,this.config.caption=t.caption,this.config.description=t.description,this.config.sphereCorrection=t.sphereCorrection,(typeof this.config.panoData!="function"||typeof t.panoData=="function")&&(this.config.panoData=t.panoData);const o=s=>{if(Rue(s))return!1;if(this.loader.hide(),this.state.loadingPromise=null,s)throw this.navbar.setCaption(null),this.showError(this.config.lang.loadError),console.error(s),this.dispatchEvent(new fde(e,s)),s;return this.navbar.setCaption(this.config.caption),!0};this.navbar.setCaption(`<em>${this.config.lang.loading}</em>`),(t.showLoader||!this.state.ready)&&this.loader.show(),this.dispatchEvent(new dde(e));const r=this.adapter.loadTexture(this.config.panorama,!0,t.panoData).then(s=>{if(s.panorama!==this.config.panorama)throw this.adapter.disposeTexture(s),bD();const a=this.dataHelper.cleanPanoramaOptions(t,s.panoData);return(!Fo(a.zoom)||!Fo(a.position))&&this.stopAll(),{textureData:s,cleanOptions:a}});return!n||!this.state.ready||!this.adapter.supportsTransition(this.config.panorama)?this.state.loadingPromise=r.then(({textureData:s,cleanOptions:a})=>{this.renderer.show(),this.renderer.setTexture(s),this.renderer.setPanoramaPose(s.panoData),this.renderer.setSphereCorrection(t.sphereCorrection),this.state.ready||this.init(),this.dispatchEvent(new Um(s)),Fo(a.zoom)||this.zoom(a.zoom),Fo(a.position)||this.rotate(a.position)}).then(()=>o(),s=>o(s)):this.state.loadingPromise=r.then(({textureData:s,cleanOptions:a})=>(this.loader.hide(),this.dispatchEvent(new Um(s)),this.state.transitionAnimation=this.renderer.transition(s,a,n),this.state.transitionAnimation)).then(s=>{if(this.state.transitionAnimation=null,this.dispatchEvent(new mde(s)),!s)throw bD()}).then(()=>o(),s=>o(s)),this.state.loadingPromise}setOptions(e){const t={...this.config,...e};for(let[n,o]of Object.entries(e)){if(!(n in Nm)){Wo(`Unknown option ${n}`);continue}if(n in Jde){Wo(Jde[n]);continue}switch(n in LD&&(o=LD[n](o,{rawConfig:t,defValue:Nm[n]})),this.config[n]=o,n){case"mousemove":this.state.cursorOverride||this.setCursor(null);break;case"caption":this.navbar.setCaption(this.config.caption);break;case"size":this.resize(this.config.size);break;case"sphereCorrection":this.renderer.setSphereCorrection(this.config.sphereCorrection);break;case"navbar":case"lang":this.navbar.setButtons(this.config.navbar);break;case"moveSpeed":case"zoomSpeed":this.dynamics.updateSpeeds();break;case"minFov":case"maxFov":this.dynamics.zoom.setValue(this.dataHelper.fovToZoomLevel(this.state.vFov)),this.dispatchEvent(new _c(this.getZoomLevel()));break;case"keyboard":this.config.keyboard==="always"?this.startKeyboardControl():this.stopKeyboardControl();break}}this.needsUpdate(),this.dispatchEvent(new sr(Object.keys(e)))}setOption(e,t){this.setOptions({[e]:t})}showError(e){this.overlay.show({id:Jo.ERROR,image:wVt,title:e,dismissible:!1})}hideError(){this.overlay.hide(Jo.ERROR)}rotate(e){const t=new Jue(this.dataHelper.cleanPosition(e));this.dispatchEvent(t),!t.defaultPrevented&&this.dynamics.position.setValue(t.position)}zoom(e){this.dynamics.zoom.setValue(e)}zoomIn(e=1){this.dynamics.zoom.step(e)}zoomOut(e=1){this.dynamics.zoom.step(-e)}animate(e){const t=xD(e),n=!Fo(e.zoom),o=new PD(t?this.dataHelper.cleanPosition(e):void 0,e.zoom);if(this.dispatchEvent(o),o.defaultPrevented)return;this.stopAll();const{duration:r,properties:s}=this.dataHelper.getAnimationProperties(e.speed,o.position,o.zoomLevel);return r?(this.state.animation=new zw({properties:s,duration:r,easing:e.easing||"inOutSine",onTick:a=>{t&&this.dynamics.position.setValue({yaw:a.yaw,pitch:a.pitch}),n&&this.dynamics.zoom.setValue(a.zoom)}}),this.state.animation.then(()=>{this.state.animation=null,this.resetIdleTimer()}),this.state.animation):(t&&this.rotate(o.position),n&&this.zoom(o.zoomLevel),new zw(null))}stopAnimation(){return this.state.animation?(this.state.animation.cancel(),this.state.animation):Promise.resolve()}resize(e){this.__setSize(e),this.autoSize()}__setSize(e){["width","height"].forEach(t=>{e?.[t]&&(/^[0-9.]+$/.test(e[t])&&(e[t]+="px"),this.parent.style[t]=e[t])})}enterFullscreen(){this.isFullscreenEnabled()||Bue(this.parent,Os.isIphone)}exitFullscreen(){this.isFullscreenEnabled()&&Eue(Os.isIphone)}toggleFullscreen(){this.isFullscreenEnabled()?this.exitFullscreen():this.enterFullscreen()}startKeyboardControl(){this.state.keyboardEnabled=!0}stopKeyboardControl(){this.state.keyboardEnabled=!1}createTooltip(e){return new yVt(this,e)}setCursor(e){this.state.cursorOverride=e,e?this.container.style.cursor=e:this.container.style.cursor=this.config.mousemove?"move":"default"}observeObjects(e){this.state.objectsObservers[e]||(this.state.objectsObservers[e]=null)}unobserveObjects(e){delete this.state.objectsObservers[e]}stopAll(){return this.dispatchEvent(new B5),this.disableIdleTimer(),this.stopAnimation()}};const kVt={class:"annotations-photosphere"},RVt={name:"ViewerPhotosphere",components:{Annotations:H({__name:"AnnotationsPhotosphere",setup(i){const e=ut("$viewer"),{localContext:t}=e,n=t.viewer,o=n.viewer,r=o.renderer.renderer.domElement,s=mI(),a=Fe(()=>s.value.filter(u=>!n.selectedStorey||u.z>=n.selectedStorey.absoluteElevation&&u.z<n.selectedStorey.absoluteTopElevation));o.addEventListener("render",()=>sp(a));const l=(u,d)=>{const{x:h,y:p}=r.getBoundingClientRect(),{clientX:A,clientY:f}=d,g=o.dataHelper.viewerCoordsToSphericalCoords({x:A-h,y:f-p}),{textureX:m,textureY:w}=o.dataHelper.sphericalCoordsToTextureCoords(g);u.x=m,u.y=w},c=u=>{const d=o.dataHelper.textureCoordsToSphericalCoords({textureX:u.x,textureY:u.y}),h=o.dataHelper.sphericalCoordsToVector3(d),p=o.dataHelper.sphericalCoordsToViewerCoords(d),{width:A,height:f}=o.state.size;if(!(h.dot(o.state.direction)>0&&p.x>=0&&p.x<=A&&p.y>=0&&p.y<=f))return"display: none;";const{x:m,y:w}=p;return`left: ${m}px; top: ${w}px;`};return(u,d)=>(B(),F("div",kVt,[(B(!0),F(it,null,It(a.value,h=>(B(),K(gI,{annotation:h,canvas:rt(r),style:ue(c(h)),onAnnotationDrag:p=>l(h,p)},null,8,["annotation","canvas","style","onAnnotationDrag"]))),256))]))}},[["__scopeId","data-v-fd653bd2"]])},data(){const{settings:i}=this.$plugin;return{settings:i,model:null,photosphere:null,selectedStorey:null,loading:!1,modelHeaderShown:this.$options.$cfg?.modelLoader!=="hidden",annotationMode:!1,markerId:1,localContextSubscriptions:[],photoSphereViewerCreated:!1}},watch:{loading(i){i?this.$viewer.localContext.loadingProcessStart():this.$viewer.localContext.loadingProcessEnd()}},created(){this.isMounted=new Promise(i=>{this.setMounted=i})},mounted(){const i=new TVt({loadingImg:null,loadingTxt:null,container:this.$refs.canvas,touchmoveTwoFingers:!0,navbar:null,defaultZoomLvl:0,rendererParameters:{alpha:!0,antialias:!0,preserveDrawingBuffer:!0}});i.renderer.renderer.preserveDrawingBuffer=!0,this.viewer=i,this.photoSphereViewerCreated=!0,this.setMounted()},unmounted(){this.viewer?.destroy(),this.localContextSubscriptions.forEach(i=>this.$viewer.localContext.hub.off(i))},methods:{async loadModels([i]){this.$viewer.localContext.hub.off(this.metaBuildingLocalContextSub),this.loading=!0,await this.isMounted,this.model&&this.unloadModels(),this.model=i,i.type==="PHOTOSPHERE_BUILDING"?(this.metaBuildingLocalContextSub=this.$viewer.localContext.hub.on("storey-selected",async({storey:e})=>{e&&(this.photosphere=e.plans[0]?.plan,this.photosphere&&await this.viewer.setPanorama(this.photosphere.document.file,{transition:!1}),this.selectedStorey=e)},{getLastEvent:!0}),this.$viewer.localContext.selectStorey(i.storeys[0])):(this.photosphere=i,await this.viewer.setPanorama(i.document.file,{transition:!1})),this.loading=!1,this.$viewer.localContext.hub.emit("photosphere-model-loaded",{model:i,plugin:this}),this.$viewer.globalContext.hub.emit("photosphere-model-loaded",{model:i,plugin:this})},unloadModels(){this.$viewer.localContext.hub.emit("photosphere-model-unloaded",{model:this.model,plugin:this}),this.$viewer.globalContext.hub.emit("photosphere-model-unloaded",{model:this.model,plugin:this}),this.selectedStorey=null,this.model=null},hideUI(){[...this.$viewer.localContext.plugins.entries()].forEach(([,i])=>i.$hide()),this.modelHeaderShown=!1},showUI(){[...this.$viewer.localContext.plugins.entries()].forEach(([,i])=>i.$show()),this.modelHeaderShown=this.$options.$cfg?.modelLoader!=="hidden"},async getSnapshot(){return{snapshot_type:"png",snapshot_data:this.viewer.renderer.renderer.domElement.toDataURL()}},async getViewpoint(){const i=this.viewer.renderer.camera,e=this.viewer.getPosition(),{textureX:t,textureY:n}=this.viewer.dataHelper.sphericalCoordsToTextureCoords(e);return{order:6,originating_system:"photosphere",authoring_tool_id:this.photosphere?String(this.photosphere.id):void 0,models:this.$viewer.localContext.loadedModels.map(o=>o.id),perspective_camera:{camera_direction:{x:t,y:n,z:0},camera_up_vector:{x:0,y:0,z:0},camera_view_point:{x:0,y:0,z:this.selectedStorey?.absoluteElevation??0},field_of_view:i.fov}}},async setViewpoint(i){const e=this.$viewer.state.getStoreyFromAbsoluteElevation(this.$viewer.localContext.loadedModels[0],i?.perspective_camera?.camera_view_point.z);if(e&&e.uuid!==this.selectedStorey?.uuid){this.$viewer.localContext.selectStorey(e),await new Promise(a=>this.viewer.addEventListener("panorama-loaded",a,{once:!0}));const s=e.plans.find(a=>a.plan.id===+i.authoring_tool_id)?.plan;s&&(this.photosphere=s,await this.viewer.setPanorama(s.document.file,{transition:!1}))}const{x:t,y:n}=i?.perspective_camera?.camera_direction??{x:0,y:0};this.viewer.rotate({textureX:t,textureY:n});const o=i?.perspective_camera?.field_of_view,r=this.viewer.dataHelper.fovToZoomLevel(o);r&&this.viewer.zoom(r)},startAnnotationMode(i){this.annotationMode||(this.annotationMode=!0,this.annotationListener=({data:e})=>{const t=this.selectedStorey;i({x:e.textureX,y:e.textureY,z:t?.absoluteElevation??0,models:this.$viewer.localContext.loadedModels,storey:t})},this.canvasCursor=this.viewer.renderer.renderer.domElement.style.cursor,this.viewer.renderer.renderer.domElement.style.cursor="copy",this.viewer.addEventListener("click",this.annotationListener))},stopAnnotationMode(){this.annotationMode&&(this.viewer.removeEventListener("click",this.annotationListener),this.annotationMode=!1,this.viewer.renderer.renderer.domElement.style.cursor=this.canvasCursor)}}},DVt={class:"bimdata-viewer-photosphere"},_Vt={ref:"canvas",class:"bimdata-viewer-photosphere__viewer__canvas"};function LVt(i,e,t,n,o,r){const s=T("NoModelWindowPlaceHolder"),a=T("Annotations"),l=T("ModelsLoader");return B(),F("div",DVt,[C("div",_Vt,null,512),!i.model&&!i.loading?(B(),K(s,{key:0})):oe("",!0),i.photoSphereViewerCreated?(B(),K(a,{key:1})):oe("",!0),i.settings.modelLoader!=="disabled"?vt((B(),K(l,{key:2,ref:"header",multi:!1},null,512)),[[Gt,i.modelHeaderShown]]):oe("",!0)])}const FVt={name:"photosphere",isViewer:!0,i18n:{en:{window_label:"Photosphere Viewer"},fr:{window_label:"Visionneuse Photosphère"}},component:H(RVt,[["render",LVt],["__scopeId","data-v-d5fe6555"]]),window:{name:"photosphere",label:"photosphere.window_label",header:!1,plugins:["fullscreen"],icon:{imgUri:"data:image/svg+xml,%3csvg%20width='23'%20height='23'%20viewBox='0%200%2023%2023'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.19485%207.90625L10.5819%201.79688V5.97245V7.90625H4.19485ZM21.3153%202.3C21.3153%201.035%2020.2453%200%2018.9228%200H9.30458L2.09094%206.9V20.7C2.09094%2021.965%203.17261%2023%204.49549%2023H18.9348C20.2573%2023%2021.3273%2021.965%2021.3273%2020.7L21.3153%202.3Z'%20class='fill-primary'%20fill='%232F374A'%20/%3e%3cpath%20d='M0%2013C0%2012.4477%200.468066%2012%201.04545%2012H21.9545C22.5319%2012%2023%2012.4477%2023%2013V20C23%2020.5523%2022.5319%2021%2021.9545%2021H1.04545C0.468066%2021%200%2020.5523%200%2020V13Z'%20fill='%23009B9D'%20/%3e%3cpath%20d='M4.79347%2019.9225C4.26792%2019.9225%203.79985%2019.8383%203.38926%2019.67C2.98102%2019.4994%202.65842%2019.2655%202.42145%2018.9681C2.18683%2018.6685%202.066%2018.3231%202.05896%2017.9317H3.59338C3.60277%2018.0956%203.66025%2018.24%203.76583%2018.3646C3.87376%2018.487%204.01687%2018.5822%204.19519%2018.6499C4.3735%2018.7177%204.5741%2018.7516%204.79699%2018.7516C5.02927%2018.7516%205.23456%2018.7134%205.41287%2018.6368C5.59118%2018.5603%205.73078%2018.4542%205.83167%2018.3187C5.93256%2018.1831%205.983%2018.0268%205.983%2017.8497C5.983%2017.6704%205.92904%2017.5118%205.82111%2017.3741C5.71553%2017.2341%205.56303%2017.1248%205.3636%2017.0461C5.16652%2016.9674%204.9319%2016.928%204.65974%2016.928H3.98755V15.885H4.65974C4.88967%2015.885%205.09261%2015.8479%205.26858%2015.7735C5.44689%2015.6992%205.58532%2015.5964%205.68386%2015.4652C5.7824%2015.3318%205.83167%2015.1766%205.83167%2014.9995C5.83167%2014.8311%205.78827%2014.6835%205.70146%2014.5567C5.61699%2014.4277%205.49734%2014.3271%205.34249%2014.255C5.18998%2014.1828%205.01167%2014.1467%204.80755%2014.1467C4.60108%2014.1467%204.41221%2014.1817%204.24094%2014.2517C4.06966%2014.3195%203.93241%2014.4168%203.82918%2014.5436C3.72594%2014.6704%203.67081%2014.8191%203.66377%2014.9896H2.20325C2.21029%2014.6026%202.32877%2014.2615%202.5587%2013.9663C2.78863%2013.6711%203.09833%2013.4405%203.4878%2013.2743C3.87962%2013.1059%204.32188%2013.0217%204.81459%2013.0217C5.31198%2013.0217%205.74721%2013.1059%206.12025%2013.2743C6.4933%2013.4426%206.78306%2013.67%206.98953%2013.9565C7.19834%2014.2407%207.30157%2014.56%207.29923%2014.9142C7.30157%2015.2903%207.17605%2015.6041%206.92266%2015.8555C6.67162%2016.107%206.34432%2016.2666%205.94077%2016.3344V16.3868C6.47101%2016.4503%206.87456%2016.6219%207.15142%2016.9018C7.43062%2017.1795%207.56904%2017.5271%207.5667%2017.9448C7.56904%2018.3274%207.45056%2018.6674%207.21124%2018.9648C6.97428%2019.2622%206.64698%2019.4961%206.22935%2019.6667C5.81173%2019.8372%205.3331%2019.9225%204.79347%2019.9225Z'%20fill='white'%20/%3e%3cpath%20d='M11.4283%2019.9225C11.0576%2019.9203%2010.6998%2019.8624%2010.3549%2019.7487C10.0123%2019.635%209.70498%2019.4502%209.43281%2019.1944C9.16065%2018.9386%208.9448%2018.5997%208.78526%2018.1776C8.62806%2017.7556%208.54947%2017.2374%208.54947%2016.623C8.55181%2016.0589%208.62103%2015.5549%208.75711%2015.111C8.89553%2014.6649%209.09261%2014.2867%209.34835%2013.9762C9.60643%2013.6657%209.91496%2013.4295%2010.2739%2013.2677C10.6329%2013.1037%2011.0353%2013.0217%2011.4811%2013.0217C11.962%2013.0217%2012.3867%2013.1092%2012.7551%2013.2841C13.1234%2013.4569%2013.419%2013.6919%2013.6419%2013.9893C13.8672%2014.2867%2014.0032%2014.6201%2014.0502%2014.9896H12.5474C12.4888%2014.7557%2012.3656%2014.572%2012.1779%2014.4386C11.9902%2014.3052%2011.7579%2014.2386%2011.4811%2014.2386C11.0118%2014.2386%2010.6552%2014.4288%2010.4112%2014.8092C10.1695%2015.1897%2010.0463%2015.7068%2010.0417%2016.3606H10.0909C10.1989%2016.1616%2010.3443%2015.9922%2010.5273%2015.8522C10.7127%2015.7101%2010.9227%2015.6019%2011.1573%2015.5275C11.3942%2015.451%2011.6441%2015.4127%2011.9069%2015.4127C12.3339%2015.4127%2012.714%2015.5068%2013.0472%2015.6948C13.3803%2015.8807%2013.6431%2016.1365%2013.8355%2016.4623C14.0279%2016.7881%2014.1241%2017.1609%2014.1241%2017.5807C14.1241%2018.0355%2014.0103%2018.44%2013.7827%2018.7943C13.5575%2019.1485%2013.2419%2019.4262%2012.836%2019.6273C12.4324%2019.8263%2011.9632%2019.9247%2011.4283%2019.9225ZM11.4212%2018.8074C11.6559%2018.8074%2011.8658%2018.7549%2012.0512%2018.6499C12.2365%2018.545%2012.382%2018.4029%2012.4876%2018.2236C12.5932%2018.0443%2012.646%2017.8431%2012.646%2017.6201C12.646%2017.397%2012.5932%2017.197%2012.4876%2017.0199C12.3844%2016.8427%2012.2412%2016.7017%2012.0582%2016.5968C11.8752%2016.4918%2011.6664%2016.4393%2011.4318%2016.4393C11.2558%2016.4393%2011.0928%2016.4699%2010.9426%2016.5312C10.7948%2016.5924%2010.6646%2016.6777%2010.552%2016.787C10.4417%2016.8963%2010.3549%2017.0231%2010.2915%2017.1675C10.2282%2017.3096%2010.1965%2017.4615%2010.1965%2017.6234C10.1965%2017.8398%2010.2493%2018.0377%2010.3549%2018.217C10.4628%2018.3963%2010.6083%2018.5395%2010.7913%2018.6467C10.9766%2018.7538%2011.1866%2018.8074%2011.4212%2018.8074Z'%20fill='white'%20/%3e%3cpath%20d='M18.0305%2019.9783C17.4252%2019.9761%2016.9043%2019.8372%2016.4679%2019.5617C16.0339%2019.2862%2015.6996%2018.8872%2015.4649%2018.3646C15.2327%2017.842%2015.1177%2017.2134%2015.12%2016.4787C15.12%2015.7462%2015.2362%2015.1219%2015.4684%2014.6059C15.7031%2014.0899%2016.0374%2013.6974%2016.4715%2013.4284C16.9079%2013.1573%2017.4275%2013.0217%2018.0305%2013.0217C18.6335%2013.0217%2019.152%2013.1573%2019.5861%2013.4284C20.0224%2013.6996%2020.358%2014.0931%2020.5926%2014.6092C20.8272%2015.123%2020.9433%2015.7462%2020.941%2016.4787C20.941%2017.2156%2020.8237%2017.8453%2020.5891%2018.3679C20.3568%2018.8905%2020.0236%2019.2895%2019.5896%2019.565C19.1555%2019.8405%2018.6358%2019.9783%2018.0305%2019.9783ZM18.0305%2018.8008C18.4434%2018.8008%2018.7731%2018.6073%2019.0194%2018.2203C19.2658%2017.8333%2019.3878%2017.2527%2019.3855%2016.4787C19.3855%2015.9692%2019.3291%2015.545%2019.2165%2015.2061C19.1063%2014.8672%2018.9491%2014.6125%2018.7449%2014.4419C18.5432%2014.2713%2018.305%2014.1861%2018.0305%2014.1861C17.6199%2014.1861%2017.2915%2014.3774%2017.0451%2014.76C16.7988%2015.1427%2016.6744%2015.7156%2016.6721%2016.4787C16.6721%2016.9947%2016.7272%2017.4255%2016.8375%2017.7709C16.9501%2018.1142%2017.1085%2018.3722%2017.3126%2018.545C17.5167%2018.7155%2017.756%2018.8008%2018.0305%2018.8008Z'%20fill='white'%20/%3e%3c/svg%3e"},modelTypes:["PHOTOSPHERE","PHOTOSPHERE_BUILDING"],multiModel:!1}},OVt={name:"photosphereBuilding",component:{setup(){const i=ut("$viewer"),e=ut("$plugin"),{apiClient:t,cloudId:n,projectId:o}=i.api,r=Fe(()=>i.localContext.loadedModels[0]),s=Fe(()=>i.localContext.selectedStorey),a=Fe(()=>i.localContext.viewer.photosphere),l=Fe(()=>s.value?.plans.find(d=>d.plan.id===a.value?.id));dt([r,()=>e.shown],([{type:d}={}])=>{d==="PHOTOSPHERE_BUILDING"?e.show():e.hide()},{immediate:!0});const c=d=>{r.value&&i.localContext.selectStorey(r.value.storeys.find(h=>h.uuid===d.uuid))},u=d=>{if(!d)return;const{viewer:h}=i.localContext,p=h.viewer;h.photosphere=d.plan,p.setPanorama(d.plan.document.file,{transition:!1})};return()=>Jn(vle,{apiClient:t,space:{id:n},project:{id:o},model:r.value,storey:s.value,plan:l.value,selectable:!0,onStoreySelected:c,onPlanSelected:u})}},addToWindows:["photosphere"],sidePanel:{position:"right",width:400}},UVt={props:{color:{type:String,required:!0}}},NVt=["fill"];function VVt(i,e,t,n,o,r){return B(),F("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:t.color,xmlns:"http://www.w3.org/2000/svg"},[...e[0]||(e[0]=[ss('<rect width="3" height="3"></rect><rect y="9" width="3" height="3"></rect><rect x="9" width="3" height="3"></rect><rect x="9" y="9" width="3" height="3"></rect><rect x="3" y="1" width="6" height="1"></rect><rect x="3" y="10" width="6" height="1"></rect><rect x="11" y="3" width="6" height="1" transform="rotate(90 11 3)"></rect><rect x="2" y="3" width="6" height="1" transform="rotate(90 2 3)"></rect>',8)])],8,NVt)}const Yde=H(UVt,[["render",VVt]]),HVt={class:"bimdata-label-list"},zVt={class:"bimdata-label-list__classes"},jVt={class:"bimdata-label-list__classes__title"},GVt={class:"bimdata-label-list__classes__list"},QVt={class:"bimdata-label-list__labels"},qVt={class:"bimdata-label-list__labels__title"},KVt=["onClick","onMouseover"],JVt=H({__name:"LabelList",setup(i){const e=ut("state"),t=Fe(()=>e.classes),n=Fe(()=>e.labels),o=s=>{e.selectedClass=s},r=s=>e.labels.filter(a=>!a.deleted).filter(a=>a.name===s.name).indexOf(s);return(s,a)=>{const l=T("BIMDataIconPlus"),c=T("BIMDataButton");return B(),F("div",HVt,[C("div",zVt,[C("div",jVt,[C("div",null,Q(s.$t("label.classes.title")),1),a[2]||(a[2]=Xe(" ",-1)),C("div",null,"("+Q(s.$t("label.classes.description"))+")",1)]),C("ul",GVt,[(B(!0),F(it,null,It(t.value,u=>(B(),F("li",{key:u.name,class:le({active:rt(e).selectedClass?.name===u.name})},[C("div",null,[k(Yde,{color:`#${u.color}`,class:"m-r-18"},null,8,["color"]),C("span",null,Q(u.name),1)]),k(c,{color:"primary",outline:"",radius:"",icon:"",width:"20px",height:"20px",onClick:d=>o(u)},{default:N(()=>[k(l,{customSize:6})]),_:1},8,["onClick"])],2))),128))])]),C("div",QVt,[C("div",qVt,[C("div",null,Q(s.$t("label.labels.title")),1),a[3]||(a[3]=Xe(" ",-1)),C("div",null,"("+Q(s.$t("label.labels.description"))+")",1)]),C("ul",{class:"bimdata-label-list__classes__list",onClick:a[1]||(a[1]=u=>rt(e).selectedLabel=null)},[(B(!0),F(it,null,It(n.value.filter(u=>!u.deleted),u=>(B(),F("li",{class:le({highlighted:rt(e).highlightedLabel===u,active:rt(e).selectedLabel===u}),onClick:gt(d=>rt(e).selectedLabel=u,["stop"]),style:{cursor:"pointer"},onMouseover:d=>rt(e).highlightedLabel=u,onMouseleave:a[0]||(a[0]=d=>rt(e).highlightedLabel=null)},[C("div",null,[k(Yde,{color:`#${u.color}`,class:"m-r-18"},null,8,["color"]),C("span",null,Q(u.name)+"-"+Q(r(u)),1)])],42,KVt))),256))])])])}}},[["__scopeId","data-v-70b81c34"]]),WVt={},ZVt={width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function YVt(i,e){return B(),F("svg",ZVt,[...e[0]||(e[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.176395 0.13889C0.342301 -0.00852533 0.584825 -0.0419546 0.786658 0.0547728L21.6969 10.0759C21.9052 10.1757 22.0251 10.3924 21.9956 10.6155C21.966 10.8386 21.7935 11.019 21.566 11.0647L12.0932 12.9697L9.57365 21.6158C9.51015 21.8337 9.31 21.9881 9.07635 21.9993C8.8427 22.0106 8.6277 21.8763 8.54214 21.6655L0.03777 0.720195C-0.0446022 0.517321 0.0104881 0.286306 0.176395 0.13889Z",fill:"#2F374A"},null,-1)])])}const XVt=H(WVt,[["render",YVt]]),$Vt={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},eHt=["fill"],tHt={__name:"Rectangle",props:{disabled:{type:Boolean,default:!1}},setup(i){return(e,t)=>(B(),F("svg",$Vt,[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0 0H20V20H0V0ZM2.5 2.5V17.5H17.5V2.5H2.5Z",fill:i.disabled?"var(--color-silver)":"var(--color-primary)"},null,8,eHt)]))}},iHt={class:"bimdata-label-viewer-draw-tools"},nHt=H({__name:"LabelDrawTools",props:{activeTool:{type:String,default:null}},setup(i){const e=ut("state");return(t,n)=>{const o=T("BIMDataIconArrow"),r=T("BIMDataButton");return B(),F("div",iHt,[k(r,{color:"primary",ghost:"",radius:"",icon:"",class:"bimdata-label-viewer-draw-tools__back",onClick:n[0]||(n[0]=s=>t.$emit("back"))},{default:N(()=>[k(o,{size:"xs",fill:"",color:"default"})]),_:1}),n[3]||(n[3]=C("div",{class:"bimdata-label-viewer-draw-tools__separator"},null,-1)),k(r,{color:i.activeTool===null?"secondary":"primary",ghost:i.activeTool!==null,fill:i.activeTool===null,radius:"",icon:"",class:"bimdata-label-viewer-draw-tools__pointer",onClick:n[1]||(n[1]=s=>t.$emit("tool-click",null))},{default:N(()=>[k(XVt)]),_:1},8,["color","ghost","fill"]),k(r,{color:i.activeTool==="rectangle"?"secondary":"primary",ghost:i.activeTool!=="rectangle",fill:i.activeTool==="rectangle",radius:"",icon:"",class:"bimdata-label-viewer-draw-tools__rectangle",disabled:rt(e).selectedClass===null,onClick:n[2]||(n[2]=s=>t.$emit("tool-click",i.activeTool==="rectangle"?null:"rectangle"))},{default:N(()=>[k(tHt,{disabled:rt(e).selectedClass===null},null,8,["disabled"])]),_:1},8,["color","ghost","fill","disabled"])])}}},[["__scopeId","data-v-423df785"]]),oHt={class:"bimdata-label-viewer__model-selector"},sHt={class:"bimdata-label-viewer__model-selector__select"},rHt={class:"bimdata-label-viewer__model-selector__select__text"},aHt={key:1},lHt=H({__name:"ModelSelector",props:{currentModelIndex:{type:Number,default:0},modelCount:{type:Number,required:!0},loading:{type:Boolean,default:!1}},emits:["previous","next","validate"],setup(i){return(e,t)=>{const n=T("BIMDataIconChevron"),o=T("BIMDataButton"),r=T("BIMDataSpinner");return B(),F("div",oHt,[C("div",sHt,[k(o,{ghost:"",rounded:"",icon:"",width:"30px",height:"30px",onClick:t[0]||(t[0]=s=>e.$emit("previous")),disabled:i.currentModelIndex<=0},{default:N(()=>[k(n,{size:"xxxs",rotate:180})]),_:1},8,["disabled"]),C("div",rHt,[i.loading?(B(),K(r,{key:0})):(B(),F("span",aHt,Q(i.currentModelIndex+1)+"/"+Q(i.modelCount),1))]),k(o,{ghost:"",rounded:"",icon:"",width:"30px",height:"30px",onClick:t[1]||(t[1]=s=>e.$emit("next")),disabled:i.currentModelIndex+1>=i.modelCount},{default:N(()=>[k(n,{size:"xxxs"})]),_:1},8,["disabled"])]),k(o,{color:"secondary",fill:"",radius:"",width:"87px",height:"32px",style:{"border-radius":"17px"},onClick:t[2]||(t[2]=s=>e.$emit("validate"))},{default:N(()=>[Xe(Q(e.$t("global.validate")),1)]),_:1})])}}},[["__scopeId","data-v-13384e53"]]),cHt={},uHt={width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function dHt(i,e){return B(),F("svg",uHt,[...e[0]||(e[0]=[C("path",{d:"M19.8667 21.5L12.5167 14.15C11.9333 14.6167 11.2625 14.9861 10.5042 15.2583C9.74583 15.5306 8.93889 15.6667 8.08333 15.6667C5.96389 15.6667 4.17014 14.9326 2.70208 13.4646C1.23403 11.9965 0.5 10.2028 0.5 8.08333C0.5 5.96389 1.23403 4.17014 2.70208 2.70208C4.17014 1.23403 5.96389 0.5 8.08333 0.5C10.2028 0.5 11.9965 1.23403 13.4646 2.70208C14.9326 4.17014 15.6667 5.96389 15.6667 8.08333C15.6667 8.93889 15.5306 9.74583 15.2583 10.5042C14.9861 11.2625 14.6167 11.9333 14.15 12.5167L21.5 19.8667L19.8667 21.5ZM8.08333 13.3333C9.54167 13.3333 10.7812 12.8229 11.8021 11.8021C12.8229 10.7812 13.3333 9.54167 13.3333 8.08333C13.3333 6.625 12.8229 5.38542 11.8021 4.36458C10.7812 3.34375 9.54167 2.83333 8.08333 2.83333C6.625 2.83333 5.38542 3.34375 4.36458 4.36458C3.34375 5.38542 2.83333 6.625 2.83333 8.08333C2.83333 9.54167 3.34375 10.7812 4.36458 11.8021C5.38542 12.8229 6.625 13.3333 8.08333 13.3333ZM6.91667 11.5833V9.25H4.58333V6.91667H6.91667V4.58333H9.25V6.91667H11.5833V9.25H9.25V11.5833H6.91667Z",fill:"#2F374A"},null,-1)])])}const hHt=H(cHt,[["render",dHt]]),pHt={},fHt={width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function AHt(i,e){return B(),F("svg",fHt,[...e[0]||(e[0]=[C("path",{d:"M19.8667 21.5L12.5167 14.15C11.9333 14.6167 11.2625 14.9861 10.5042 15.2583C9.74583 15.5306 8.93889 15.6667 8.08333 15.6667C5.96389 15.6667 4.17014 14.9326 2.70208 13.4646C1.23403 11.9965 0.5 10.2028 0.5 8.08333C0.5 5.96389 1.23403 4.17014 2.70208 2.70208C4.17014 1.23403 5.96389 0.5 8.08333 0.5C10.2028 0.5 11.9965 1.23403 13.4646 2.70208C14.9326 4.17014 15.6667 5.96389 15.6667 8.08333C15.6667 8.93889 15.5306 9.74583 15.2583 10.5042C14.9861 11.2625 14.6167 11.9333 14.15 12.5167L21.5 19.8667L19.8667 21.5ZM8.08333 13.3333C9.54167 13.3333 10.7812 12.8229 11.8021 11.8021C12.8229 10.7812 13.3333 9.54167 13.3333 8.08333C13.3333 6.625 12.8229 5.38542 11.8021 4.36458C10.7812 3.34375 9.54167 2.83333 8.08333 2.83333C6.625 2.83333 5.38542 3.34375 4.36458 4.36458C3.34375 5.38542 2.83333 6.625 2.83333 8.08333C2.83333 9.54167 3.34375 10.7812 4.36458 11.8021C5.38542 12.8229 6.625 13.3333 8.08333 13.3333ZM5.16667 9.25V6.91667H11V9.25H5.16667Z",fill:"#2F374A"},null,-1)])])}const mHt=H(pHt,[["render",AHt]]);function gHt(i,e=()=>{}){const t=ut("state"),n=ut("$viewer");let o=null,r=null;const s=pe(null),a=Fe(()=>t.selectedLabel&&s.value===null),l=Fe(()=>s.value!==null&&!a.value);ci(()=>{r=i.value,r.engine.ui.rotatable=!1,r.plugins.pen.pathLineWidth=2,o=vHt(r,t,l)}),ki(()=>{o?.()}),dt(()=>n.localContext.loadedModels,()=>{t.selectedLabel=null,t.highlightedLabel=null,t.labels.forEach(u=>u.path?.destroy())}),dt(()=>t.selectedClass,(u,d)=>{u&&(t.selectedLabel=null,d?r.plugins.pen.primaryColor=Number.parseInt(u.color,16):s.value="rectangle")}),dt(()=>t.labels.length,()=>{if(!r)return;const{pen:u}=r.plugins;for(const d of t.labels.filter(h=>!h.deleted))d.geometry&&!d.path&&(u.primaryColor=Number.parseInt(d.color,16),d.path=u.draw(d.geometry))},{immediate:!0}),dt(a,u=>{const{pen:d}=r.plugins;u?(d.path=t.selectedLabel.path,d.path.previousPoints=d.path.points,d.startRectangleEditing()):(d.stopRectangleEditing(),d.path=null)});let c=null;return dt(l,u=>{const{pen:d}=r.plugins;u?(d.drawMode="rectangle",d.primaryColor=Number.parseInt(t.selectedClass.color,16),d.startDrawing(),c=d.on("add",({path:h})=>e(h))):(d.stopDrawing(),a.value||(d.path=null),d.off(c))}),dt(()=>t.selectedLabel,(u,d)=>{if(d&&u){const{pen:h}=r.plugins;h.stopRectangleEditing(),h.path=u.path,h.startRectangleEditing()}else u&&(s.value=null,t.selectedClass=null)}),dt(()=>t.highlightedLabel,(u,d)=>{if(d?.path&&(d.path.object.getShape().style.fillOpacity=.2),!u)return;let h=u.parent;for(;h;)h.expanded=!0,h=h.parent;u.path&&(u.path.object.getShape().style.fillOpacity=.3)}),{drawMode:s}}function vHt(i,e,t,n){const o=i.viewer.canvas.parentElement,r=i.viewer.ui.on("click",({object:a})=>{if(!t.value)if(a){const l=e.labels.filter(c=>!c.deleted).find(c=>c.path.object.id===a.id);if(!l)return;e.selectedLabel=l}else t.value||(e.selectedLabel=null)}),s=i.viewer.ui.on("mousemove",({object:a})=>{if(!t.value)if(a){o.style.cursor="pointer";const l=e.labels.filter(c=>!c.deleted).find(c=>c.path.object.id===a.id);if(!l)return;e.highlightedLabel=l}else o.style.cursor="default",e.highlightedLabel=null});return()=>{i.viewer.ui.off(r),i.viewer.ui.off(s)}}const yHt={__name:"Marker",props:{label:{type:Object,required:!0}},setup(i,{expose:e}){const t=i,n=ut("state"),o=`#${t.label.color}`,r=n.labels.filter(l=>l.name===t.label.name),s=`${t.label.name}-${r.indexOf(t.label)}`,a=qn({x:0,y:0});return e({label:t.label,position:a}),(l,c)=>vt((B(),F("div",{class:"bimdata-label__marker",style:ue({left:a.x+"px",top:a.y+"px",backgroundColor:o}),ref:u=>{i.label.marker=u}},Q(s),4)),[[Gt,rt(n).selectedLabel!==i.label]])}};let wHt=0;class Xde{constructor(e,t,n=null,o=null,r=null){this.name=e,this.color=t,this.geometry=n,this.path=o,this.apiId=r,this.id=wHt++,this.marker=pe(null),this.deleted=!1}getTopLeftPosition(){const e=this.path?.points??this.geometry,t=Math.min(...e.map(o=>o.x)),n=Math.min(...e.map(o=>o.y));return{x:t,y:n}}hasBeenModified(){if(!this.path||!this.geometry)return!1;if(this.path.points.length!==this.geometry.length)return!0;for(let e=0;e<this.path.points.length;e++){const t=this.path.points[e],n=this.geometry[e];if(t.x!==n.x||t.y!==n.y)return!0}return!1}}function CHt(i){const e=pe(null),t=()=>{const o=e.value;o&&o.forEach(r=>{const s=r.label;if(!s||!s.marker)return;const a=s.getTopLeftPosition(),l=i.value.engine.camera.getCanvasPosition(a);r.position.x=l.x-1,r.position.y=l.y-1})};ci(()=>{i.value.engine.camera.on("update",()=>t()),i.value.engine.scene.on("object-update",()=>t())});const n=ut("state");return dt(()=>n.labels,()=>{un(()=>t())}),{markersRef:e,updateMarkersPosition:t}}const bHt={class:"bimdata-label-viewer"},xHt={class:"bimdata-label-viewer__markers"},MHt={class:"bimdata-label-viewer__right-tools"},BHt={key:0,class:"bimdata-label-viewer__unsaved-changes-modal"},EHt={class:"bimdata-label-viewer__unsaved-changes-modal__content"},IHt={class:"bimdata-label-viewer__unsaved-changes-modal__content__icon"},SHt={class:"bimdata-label-viewer__unsaved-changes-modal__content__title"},PHt={class:"bimdata-label-viewer__unsaved-changes-modal__content__text"},THt={class:"bimdata-label-viewer__unsaved-changes-modal__content__buttons"},kHt=H({__name:"LabelViewer",setup(i){const e=Ci(null),t=pe(!1),n=ut("$viewer"),o=ut("state"),r=ut("service"),s=Fe(()=>n.localContext.loadingModelIds.length>0);dt(()=>n.localContext.loadedModels[0],(D,L)=>{L&&e.value?.unloadModels([L.id]),D&&e.value?.loadModels([D])},{immediate:!0});const a=Fe(()=>r.projectModels.length),l=Fe(()=>{if(a.value===0)return 0;const D=n.localContext.loadedModels[0];return D?r.projectModels.findIndex(L=>L.id===D.id):0}),{markersRef:c,updateMarkersPosition:u}=CHt(e),d=D=>{const L=o.selectedClass;if(!L){console.warn("No class selected for the label.");return}const U=new Xde(L.name,L.color,null,D);o.labels.push(U),un(()=>u())},{drawMode:h}=gHt(e,d),p=D=>{D.apiId?D.deleted=!0:o.labels=o.labels.filter(L=>L.id!==D.id),D.path.destroy(),D.path=null};let A=null;document.addEventListener("keydown",A=D=>{if(D.key==="Escape"&&(h.value=null,o.selectedClass=null,o.selectedLabel=null),(D.key==="Delete"||D.key==="Backspace")&&o.selectedLabel){const L=o.selectedLabel;o.selectedLabel=null,p(L)}}),ki(()=>{document.removeEventListener("keydown",A)});const f=D=>{h.value=D},g=()=>{h.value=null},m=()=>{e.value.engine.camera.zoomIn()},w=()=>{e.value.engine.camera.zoomOut()},v=()=>{const D=n.localContext.loadedModels[0];r.saveLabels(D.id,o.labels),r.loadNextModel()},y=()=>o.labels.some(D=>!D.apiId||D.deleted||D.hasBeenModified());let x=null;const M=()=>{if(y()){t.value=!0,x=E;return}E()},E=()=>{const D=r.projectModels[l.value-1];D&&n.localContext.loadModels([D.id]),h.value=null},S=()=>{if(y()){t.value=!0,x=I;return}I()},I=()=>{const D=r.projectModels[l.value+1];D&&n.localContext.loadModels([D.id]),h.value=null},R=()=>{t.value=!1},P=()=>{x?.(),t.value=!1};return(D,L)=>{const U=T("BIMDataButton"),z=T("BIMDataIconWarning");return B(),F("div",bHt,[k(L4,{ref_key:"viewer",ref:e,enablePenPlugin:!0},null,512),C("div",xHt,[(B(!0),F(it,null,It(rt(o).labels.filter(j=>!j.deleted),j=>(B(),K(yHt,{key:j.id,label:j,ref_for:!0,ref_key:"markersRef",ref:c},null,8,["label"]))),128))]),k(nHt,{onBack:g,onToolClick:f,class:"bimdata-label-viewer__left-tools",activeTool:rt(h)},null,8,["activeTool"]),C("div",MHt,[k(lHt,{class:"bimdata-label-viewer__right-tools__model-selector",modelCount:a.value,currentModelIndex:l.value,loading:s.value,onValidate:v,onPrevious:M,onNext:S},null,8,["modelCount","currentModelIndex","loading"]),k(U,{class:"bimdata-label-viewer__right-tools__button--1",color:"default",fill:"",radius:"",icon:"",width:"50px",height:"50px",style:{"border-radius":"6px"},onClick:m},{default:N(()=>[k(hHt)]),_:1}),k(U,{class:"bimdata-label-viewer__right-tools__button--2",color:"default",fill:"",radius:"",icon:"",width:"50px",height:"50px",style:{"border-radius":"6px"},onClick:w},{default:N(()=>[k(mHt)]),_:1})]),t.value?(B(),F("div",BHt,[C("div",EHt,[C("div",IHt,[k(z,{size:"m",fill:"",color:"high"})]),C("div",SHt,Q(D.$t("global.warning"))+"! ",1),C("div",PHt,Q(D.$t("label.unsaved-changes")),1),C("div",THt,[k(U,{color:"primary",ghost:"",radius:"",onClick:R,width:"120px"},{default:N(()=>[Xe(Q(D.$t("global.cancel")),1)]),_:1}),k(U,{color:"high",fill:"",radius:"",onClick:P,width:"120px"},{default:N(()=>[Xe(Q(D.$t("global.ok")),1)]),_:1})])])])):oe("",!0)])}}},[["__scopeId","data-v-d495d63a"]]),RHt=[{name:"Dallage",color:"e57373"},{name:"Mur",color:"f06292"},{name:"Plancher",color:"ba68c8"},{name:"Balcon",color:"9575cd"},{name:"Ferme",color:"7986cb"},{name:"Escalier",color:"64b5f6"},{name:"Parement de façade",color:"4dd0e1"},{name:"Mur rideau",color:"4db6ac"},{name:"Bardage",color:"81c784"},{name:"Fenêtre extérieure",color:"aed581"},{name:"Occultation mobile extérieure",color:"dce775"},{name:"Couverture en petits éléments",color:"fff176"},{name:"Couverture en plaque",color:"ffd54f"},{name:"Etanchéité",color:"ffb74d"},{name:"Cheminée",color:"a1887f"},{name:"Cloison fixe",color:"90a4ae"},{name:"Porte intérieure",color:"f44336"},{name:"Faux plafond",color:"e91e63"},{name:"Protection contre les chutes",color:"9c27b0"},{name:"Chaudière",color:"673ab7"},{name:"PAC à compression électrique",color:"3f51b5"},{name:"Centrale de Traitement d'Air (CTA)",color:"2196f3"},{name:"Ventilation mécanique",color:"00bcd4"},{name:"Entrée d'air",color:"009688"},{name:"Stockage ECS",color:"4caf50"},{name:"Ballon électrique",color:"8bc34a"},{name:"Adoucisseur",color:"cddc39"},{name:"Receveur sanitaire",color:"ffeb3b"},{name:"TGBT",color:"ffc107"},{name:"Transformateur",color:"ff9800"},{name:"Luminaire",color:"795548"},{name:"Eclairage de sécurité",color:"607d8b"},{name:"Interphonie",color:"b71c1c"},{name:"Compteur électrique",color:"880e4f"},{name:"Compteur d'eau",color:"4a148c"},{name:"Compteur de gaz",color:"1a237e"},{name:"Ascenseur",color:"01579b"},{name:"Monte-charge",color:"004d40"}];class DHt{constructor(){this.$viewer=ut("$viewer");const e=ut("$plugin");let t=Array.isArray(e.settings?.classes)?e.settings.classes:null;t&&(t.length===0||!t.every(n=>typeof n.name=="string"&&typeof n.color=="string"&&n.color.length===6&&[...n.color].every(o=>/[0-9a-fA-F]/.test(o))))&&(console.warn("[BIMDataLabel - Service] Invalid classes provided to the plugin. Using default classes instead. Expected format: [{ name: string, color: string (6 hex characters) }]"),t=null),this.loading=pe(!1),this.classes=t??RHt,this._projectModels=pe([]),this.getAvailableModels().then(n=>{if(this._projectModels.value=n,n.length>0){const{localContext:o}=this.$viewer;o.loadedModels.length===0&&o.loadingModelIds.length===0&&o.loadModels([n[0].id])}})}get projectModels(){return this._projectModels.value}getClasses(){return Promise.resolve(this.classes)}async getLabels(e){if(!e)throw new TypeError("[BIMDataViewer - Label.Service] modelId is required to get labels.");const{apiClient:t,cloudId:n,projectId:o}=this.$viewer.api;try{return(await t.modelApi.getLabels(n,e,o)).map(s=>new Xde(s.name,s.color,s.geometry,null,s.id))}catch(r){return console.error("[BIMDataViewer - Label.Service] Cannot get labels for modelId: ",e,". Error: ",r),[]}}saveLabels(e,t){if(!e)throw new TypeError("[BIMDataViewer - Label.Service] modelId is required to save labels.");const n=[],o=[],r=[];for(const u of t)u.apiId===null?n.push(u):u.deleted?o.push(u):u.hasBeenModified()&&r.push(u);const{apiClient:s,cloudId:a,projectId:l}=this.$viewer.api,c=[];return n.length>0&&c.push(...n.map(u=>s.modelApi.createLabel(a,e,l,{name:u.name,color:u.color,geometry:u.path.points}))),o.length>0&&c.push(...o.map(u=>s.modelApi.deleteLabel(a,u.apiId,e,l))),r.length>0&&c.push(...r.map(u=>s.modelApi.updateLabel(a,u.apiId,e,l,{geometry:u.path.points}))),Promise.all(c)}loadNextModel(){const{localContext:e}=this.$viewer,t=this.projectModels.findIndex(n=>n.id===e.loadedModels[0]?.id);if(t<this.projectModels.length-1){const n=this.projectModels[t+1];e.loadModels([n.id])}}async getAvailableModels(){const{api:e,state:t,localContext:n}=this.$viewer;this.loading.value=!0;try{return(await e.apiClient.modelApi.getModels(e.cloudId,e.projectId,void 0,void 0,n.modelTypes)).filter(r=>t.models.some(s=>s.archived)||!r.archived).sort(il("updated_at",!1))}catch(o){console.error("[BIMDataLabel - Service] Cannot get project models. Error: ",o)}finally{this.loading.value=!1}return[]}}const _Ht={class:"bimdata-label"},LHt={name:"label",i18n:{de:{},en:{classes:{title:"Classes",description:"Equipment categories"},labels:{title:"Labels",description:"Created equipment"},"unsaved-changes":"You have unsaved changes. Are you sure you want to leave without validating them ?"},es:{},fr:{classes:{title:"Classes",description:"Catégories d'équipements"},labels:{title:"Labels",description:"Equipements créés"},"unsaved-changes":"Vous avez des modifications non enregistrées. Êtes-vous sûr de vouloir quitter sans les valider ?"}},component:H({__name:"BIMDataLabel",setup(i){const e=new DHt,t=qn({classes:[],selectedClass:null,labels:[],selectedLabel:null,highlightedLabel:null});window.state=t,qi("state",t),qi("service",e),e.getClasses().then(o=>{t.classes=o});const n=ut("$viewer");return dt(()=>n.localContext.loadedModels[0],async o=>{if(o)try{n.localContext.loadingProcessStart(),t.labels=await e.getLabels(o.id),t.selectedLabel=null,t.highlightedLabel=null}finally{n.localContext.loadingProcessEnd()}},{immediate:!0}),(o,r)=>(B(),F("div",_Ht,[k(JVt,{class:"bimdata-label__list"}),k(kHt,{class:"bimdata-label__viewer"})]))}},[["__scopeId","data-v-5813dd8b"]]),window:{name:"label",header:!1,displayedInWindowSelector:!1,modelTypes:["JPEG","PNG"],multiModel:!1}},FHt={},OHt={width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function UHt(i,e){return B(),F("svg",OHt,[...e[0]||(e[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5 0H7V2H5V0ZM3 8H5V10H3V8ZM10 3H8V5H10V3ZM0 5H2V7H0V5ZM2 10H0V12H2V10ZM20 5H22V7H20V5ZM22 10H20V12H22V10ZM0 15H2V17H0V15ZM2 20H0V22H2V20ZM10 0H12V2H10V0ZM7 22V20H5V22H7ZM12 20V22H10V20H12ZM17 0H15V2H17V0ZM20 0H22V2H20V0ZM11 6H13V8H11V6ZM9.70711 16.0711C9.31658 15.6806 9.31658 15.0474 9.70711 14.6569L14.6569 9.70711C15.0474 9.31659 15.6805 9.31659 16.0711 9.70711L24.5563 18.1924C24.9469 18.5829 24.9469 19.2161 24.5563 19.6066L19.6066 24.5564C19.2161 24.9469 18.5829 24.9469 18.1924 24.5564L9.70711 16.0711ZM12.5355 16.0711C12.145 15.6806 12.145 15.0474 12.5355 14.6569L14.6569 12.5355C15.0474 12.145 15.6805 12.145 16.0711 12.5355L17.4853 13.9498C17.8758 14.3403 17.8758 14.9734 17.4853 15.364L15.364 17.4853C14.9734 17.8758 14.3403 17.8758 13.9497 17.4853L12.5355 16.0711ZM8 13V11H6V13H8Z",fill:"#2F374A"},null,-1)])])}const NHt={name:"plan-mask-button",i18n:{en:{tooltip:"Plan cleaning"},fr:{tooltip:"Nettoyage de plan"}},addToWindows:["plan"],button:{tooltip:"plan-mask-button.tooltip",position:"right",content:"free",icon:{component:H(FHt,[["render",UHt]])}},component:{render(){return null},setup(){const i=ut("$viewer"),e=ut("$plugin");_r(()=>{i.localContext.loadedModels.length===1?e.shown||e.show():e.shown&&e.hide()})},onOpen(){const i=this.$viewer.globalContext.layout;this.$viewer.globalContext.hub.emit("plan-mask:open",i);const e=this.$viewer.localContext.loadedModels[0];let t=e.id;if(e.type==="METABUILDING"){const r=this.$viewer.localContext.selectedStorey?.plans[0]?.plan.id;r!==void 0&&(t=r)}const n=this.$viewer.localContext.selectedStorey?.key;this.$viewer.globalContext.layout={windowName:"plan-mask",windowState:{modelIds:[t],storey:n}}}}},VHt={},HHt={width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function zHt(i,e){return B(),F("svg",HHt,[...e[0]||(e[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5 0H7V2H5V0ZM3 8H5V10H3V8ZM10 3H8V5H10V3ZM0 5H2V7H0V5ZM2 10H0V12H2V10ZM20 5H22V7H20V5ZM22 10H20V12H22V10ZM0 15H2V17H0V15ZM2 20H0V22H2V20ZM10 0H12V2H10V0ZM7 22V20H5V22H7ZM12 20V22H10V20H12ZM17 0H15V2H17V0ZM20 0H22V2H20V0ZM11 6H13V8H11V6ZM9.70711 16.0711C9.31658 15.6806 9.31658 15.0474 9.70711 14.6569L14.6569 9.70711C15.0474 9.31659 15.6805 9.31659 16.0711 9.70711L24.5563 18.1924C24.9469 18.5829 24.9469 19.2161 24.5563 19.6066L19.6066 24.5564C19.2161 24.9469 18.5829 24.9469 18.1924 24.5564L9.70711 16.0711ZM12.5355 16.0711C12.145 15.6806 12.145 15.0474 12.5355 14.6569L14.6569 12.5355C15.0474 12.145 15.6805 12.145 16.0711 12.5355L17.4853 13.9498C17.8758 14.3403 17.8758 14.9734 17.4853 15.364L15.364 17.4853C14.9734 17.8758 14.3403 17.8758 13.9497 17.4853L12.5355 16.0711ZM8 13V11H6V13H8Z",fill:"#2F374A"},null,-1)])])}const jHt=H(VHt,[["render",zHt]]),GHt={class:"bimdata-plan-mask__header"},QHt={class:"bimdata-plan-mask__header__texts"},qHt={class:"bimdata-plan-mask__header__texts__title"},KHt={class:"bimdata-plan-mask__header__texts__model"},JHt={class:"bimdata-plan-mask__header__buttons"},WHt=H({__name:"PlanMaskHeader",setup(i){const e=ut("$viewer"),t=ut("state"),n=ut("service"),o=Fe(()=>t.newCropPathByModelId.size===0&&t.newFiltersByModelId.size===0),r=pe(!1),s=Fe(()=>e.localContext.loadedModels.length===0);let a=null;e.globalContext.hub.once("plan-mask:open",(d=null)=>{a=d},{getLastEvent:!0});const l=Fe(()=>e.localContext.loadedModels[0]),c=()=>{e.globalContext.layout=a},u=async()=>{r.value=!0,await n.savePlanMasks(t),delete a.windowState.viewpoint,e.globalContext.layout=a};return(d,h)=>{const p=T("BIMDataButton"),A=T("BIMDataSpinner");return B(),F("div",GHt,[C("div",QHt,[k(jHt,{class:"m-x-6"}),C("span",qHt,Q(d.$t("plan-mask.title")),1),h[0]||(h[0]=C("span",{class:"m-x-12"},"-",-1)),C("span",KHt,Q(l.value?l.value.name:`... ${d.$t("global.loading")}`),1)]),C("div",JHt,[k(p,{color:"high",fill:"",radius:"",class:"m-x-6",width:"120px",onClick:c},{default:N(()=>[Xe(Q(d.$t("global.cancel")),1)]),_:1}),k(p,{color:"primary",fill:"",radius:"",class:"m-x-6",width:"120px",disabled:o.value,onClick:u},{default:N(()=>[r.value||s.value?(B(),K(A,{key:0})):(B(),F(it,{key:1},[Xe(Q(d.$t("global.done")),1)],64))]),_:1},8,["disabled"])])])}}},[["__scopeId","data-v-5f535646"]]),ZHt={},YHt={width:"13",height:"17",viewBox:"0 0 13 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function XHt(i,e){return B(),F("svg",YHt,[...e[0]||(e[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.0205887 0.760241C-0.0369001 0.612234 0.0293064 0.447777 0.177996 0.369239L0.794439 0.0436382C0.943129 -0.0348991 1.13191 -0.00512553 1.24327 0.114426C2.20441 1.14624 3.98875 2.45304 5.91415 3.77084C6.67376 4.29074 7.45537 4.81236 8.20995 5.31594C9.3481 6.0755 10.4248 6.79402 11.2717 7.40369C12.7916 8.49791 13.1419 9.88267 12.9535 11.1463C12.784 12.2835 12.1812 13.3235 11.6281 13.9998L12.22 14.9378C12.3183 15.0935 12.26 15.2927 12.0898 15.3826L9.11031 16.9563C8.94008 17.0462 8.72242 16.9929 8.62414 16.8371L8.0322 15.8992C7.11546 15.9992 5.82958 15.9568 4.66823 15.5225C3.3779 15.04 2.24219 14.0701 1.96637 12.3187C1.82059 11.393 1.68028 10.2545 1.53148 9.04694C1.41992 8.14169 1.30358 7.19767 1.17658 6.27549C0.876924 4.09967 0.517281 2.039 0.0205887 0.760241ZM1.10889 1.88952C1.4235 3.12855 1.67045 4.65216 1.8828 6.19409C2.01281 7.13806 2.12977 8.08803 2.24122 8.99317C2.38829 10.1877 2.52577 11.3043 2.67091 12.2258C2.90528 13.714 3.84317 14.5105 4.93756 14.9197C6.05334 15.337 7.33156 15.3476 8.16398 15.225C8.30978 15.2035 8.45493 15.2666 8.52877 15.3836L9.06263 16.2296L11.4257 14.9814L10.8918 14.1355C10.818 14.0185 10.8308 13.8719 10.924 13.7671C11.4563 13.1689 12.0853 12.1509 12.2483 11.0582C12.408 9.98654 12.1231 8.84526 10.8315 7.91546C9.99174 7.31094 8.93656 6.60686 7.80965 5.85492C7.05354 5.3504 6.26503 4.82427 5.48775 4.29227C4.0633 3.31734 2.67549 2.32196 1.63764 1.42496L6.84795 9.68113C7.39973 9.55339 7.99902 9.7688 8.29767 10.242C8.65803 10.813 8.44417 11.5432 7.82001 11.8729C7.19585 12.2026 6.39774 12.0069 6.03738 11.4359C5.73868 10.9626 5.83449 10.38 6.23147 10.0067L1.10889 1.88952Z",fill:"#2F374A"},null,-1)])])}const $Ht=H(ZHt,[["render",XHt]]);function ezt(i,e){const t=ut("state"),{newFiltersByModelId:n}=t,o=pe(!1),r=pe(100),s=pe(100),a=pe(1),l=Fe({get:()=>Math.round(a.value*100),set:v=>{a.value=v/100}}),c=Fe(()=>o.value===!1&&r.value===100&&s.value===100&&a.value===1),u=pe(!1);dt(e,v=>{if(u.value=!1,!v?.mask_2d)return;const y=v.mask_2d;o.value=y.grayscale??!1,r.value=y.brightness??100,s.value=y.contrast??100,a.value=y.opacity??1},{immediate:!0});const d=pe(!1),h=()=>{d.value=!1},p=()=>{const v=n.get(e.value?.id);if(v)o.value=v.grayscale??!1,r.value=v.brightness??100,s.value=v.contrast??100,a.value=v.opacity??1;else{const y=e.value?.mask_2d;o.value=y?.grayscale??!1,r.value=y?.brightness??100,s.value=y?.contrast??100,a.value=y?.opacity??1}u.value=!1,d.value=!1},A=Fe(()=>{if(!e.value)return!1;if(!n.has(e.value?.id)){const y=e.value.mask_2d;return y?(y.grayscale??!1)!==o.value||(y.brightness??100)!==r.value||(y.contrast??100)!==s.value||(y.opacity??1)!==a.value:o.value!==!1||r.value!==100||s.value!==100||a.value!==1}const v=n.get(e.value?.id);return v&&((v.grayscale??!1)!==o.value||(v.brightness??100)!==r.value||(v.contrast??100)!==s.value||(v.opacity??1)!==a.value)}),f=()=>{u.value===!1?u.value=!0:A.value?d.value=!0:u.value=!1};dt([o,r,s,a],()=>{if(!e.value)return;const v=e.value.parent?.document??e.value.document,y=i.value.plugins.bitmaps,x=y.bitmaps.find(M=>M.document.id===v.id);x&&(x.tempMask===void 0&&(x.tempMask=null),c.value?x.tempMask&&(x.tempMask.crop_path?(x.tempMask.grayscale=void 0,x.tempMask.brightness=void 0,x.tempMask.contrast=void 0,x.tempMask.opacity=void 0):x.tempMask=null):(x.tempMask||(x.tempMask={}),x.tempMask.grayscale=o.value!==!1?o.value:void 0,x.tempMask.brightness=r.value!==100?r.value:void 0,x.tempMask.contrast=s.value!==100?s.value:void 0,x.tempMask.opacity=a.value!==1?a.value:void 0),y.draw())},{immediate:!0});const g=()=>{o.value=!1,r.value=100,s.value=100,a.value=1};function m(v={}){return v.grayscale=o.value!==!1?o.value:void 0,v.brightness=r.value!==100?r.value:void 0,v.contrast=s.value!==100?s.value:void 0,v.opacity=a.value!==1?a.value:void 0,v}return{parametersDisplayed:u,onDisplayParametersClick:f,warningModelDisplayed:d,unsavedChanges:A,allFiltersDefault:c,onModalCancel:h,onModalOk:p,grayscale:o,brightness:r,contrast:s,opacity:l,onResetParametersClick:g,onApplyParametersClick:()=>{if(!e.value)return;const v=c.value,y=n.get(e.value.id);y?v?e.value.mask_2d?n.set(e.value.id,null):n.delete(e.value.id):m(y):v?e.value.mask_2d&&n.set(e.value.id,null):n.set(e.value.id,m()),u.value=!1}}}function tzt(){const i=pe(null),e=(n="path")=>{i.value===n?i.value=null:i.value=n},t=n=>{n.key==="Escape"&&(i.value=null)};return document.addEventListener("keydown",t),ki(()=>{document.removeEventListener("keydown",t)}),{drawMode:i,onDrawClick:e}}function izt(i,e,t){const n=ut("state"),{newCropPathByModelId:o}=n;let r=null;dt(t,c=>{const{pen:u}=i.value.plugins;u.primaryColor=8840,c!==null?(u.drawMode=c,u.startDrawing(),r=u.once("add",({path:d})=>{t.value=null,o.set(e.value.id,d.points.slice()),setTimeout(()=>d.destroy(),0)})):(u.stopDrawing(),u.path=null,u.off(r))});const s=()=>{e.value.mask_2d?o.set(e.value.id,null):o.delete(e.value.id)},a=Fe(()=>{if(!e.value)return null;if(o.has(e.value.id))return o.get(e.value.id);if(e.value.mask_2d?.crop_path)return e.value.mask_2d.crop_path.map(c=>({x:c[0],y:c[1]}))});let l=null;return dt(a,c=>{if(l?.destroy(),c){const{pen:u}=i.value.plugins;u.primaryColor=16711680,l=u.draw(c)}},{immediate:!0}),{currentCropPath:a,onDeleteClick:s}}function nzt(i){const e=ut("$viewer"),t=Fe(()=>e.localContext.loadedModels[0]);dt(t,s=>{s&&i.value?.loadModels([s])},{immediate:!0});const n=Fe(()=>i.value?.pdfPages??[]),o=Fe(()=>i.value?.pdfPageIndex??0);return{model:t,pdfPages:n,pdfPageIndex:o,setPdfPage:s=>{i.value?.setPdfPage(s)}}}const ozt={class:"bimdata-plan-mask__viewer"},szt={key:0,class:"bimdata-plan-mask__viewer__options"},rzt={class:"bimdata-plan-mask__viewer__options__buttons"},azt={key:0,class:"bimdata-plan-mask__viewer__options__parameters"},lzt={key:0,class:"bimdata-plan-mask__viewer__options__parameters__warning"},czt={class:"bimdata-plan-mask__viewer__options__parameters__warning__icon"},uzt={class:"bimdata-plan-mask__viewer__options__parameters__warning__title"},dzt={class:"bimdata-plan-mask__viewer__options__parameters__warning__text"},hzt={class:"bimdata-plan-mask__viewer__options__parameters__warning__buttons"},pzt={class:"bimdata-plan-mask__viewer__options__parameters__title"},fzt={class:"bimdata-plan-mask__viewer__options__parameters__parameter--toggle"},Azt={class:"bimdata-plan-mask__viewer__options__parameters__parameter--range"},mzt={class:"bimdata-plan-mask__viewer__options__parameters__parameter--range"},gzt={class:"bimdata-plan-mask__viewer__options__parameters__parameter--range"},vzt={class:"bimdata-plan-mask__viewer__options__parameters__buttons"},yzt=H({__name:"PlanMaskViewer",setup(i){const e=Ci(null),{drawMode:t,onDrawClick:n}=tzt(),{model:o,pdfPages:r,pdfPageIndex:s,setPdfPage:a}=nzt(e),{currentCropPath:l,onDeleteClick:c}=izt(e,o,t),{parametersDisplayed:u,onDisplayParametersClick:d,warningModelDisplayed:h,onModalCancel:p,onModalOk:A,unsavedChanges:f,allFiltersDefault:g,grayscale:m,brightness:w,contrast:v,opacity:y,onResetParametersClick:x,onApplyParametersClick:M}=ezt(e,o);return(E,S)=>{const I=T("BIMDataIconParameters"),R=T("BIMDataButton"),P=T("BIMDataIconDelete"),D=T("BIMDataIconWarning"),L=T("BIMDataToggle"),U=T("BIMDataSlider");return B(),F("div",ozt,[rt(o)?(B(),F("div",szt,[C("div",rzt,[k(R,{fill:"",square:"",icon:"",onClick:rt(d),color:rt(u)?"secondary":"default"},{default:N(()=>[k(I,{fill:"",size:"xs"})]),_:1},8,["onClick","color"]),rt(l)?(B(),K(R,{key:1,fill:"",square:"",icon:"",onClick:S[2]||(S[2]=z=>rt(c)())},{default:N(()=>[k(P,{fill:"",color:"high",size:"xs"})]),_:1})):(B(),F(it,{key:0},[k(R,{color:rt(t)==="rectangle"?"secondary":"default",fill:"",square:"",icon:"",onClick:S[0]||(S[0]=z=>rt(n)("rectangle"))},{default:N(()=>[...S[7]||(S[7]=[C("div",{class:"bimdata-plan-mask__viewer__rectangle-icon"},null,-1)])]),_:1},8,["color"]),k(R,{color:rt(t)==="path"?"secondary":"default",fill:"",square:"",icon:"",onClick:S[1]||(S[1]=z=>rt(n)("path"))},{default:N(()=>[k($Ht)]),_:1},8,["color"])],64))]),rt(u)?(B(),F("div",azt,[rt(h)?(B(),F("div",lzt,[C("div",czt,[k(D,{size:"m",fill:"",color:"high"})]),C("div",uzt,Q(E.$t("global.warning"))+"! ",1),C("div",dzt,Q(E.$t("plan-mask.parameters.warning_text")),1),C("div",hzt,[k(R,{color:"primary",ghost:"",radius:"",onClick:rt(p),width:"120px"},{default:N(()=>[Xe(Q(E.$t("global.cancel")),1)]),_:1},8,["onClick"]),k(R,{color:"high",fill:"",radius:"",onClick:rt(A),width:"120px"},{default:N(()=>[Xe(Q(E.$t("global.ok")),1)]),_:1},8,["onClick"])])])):(B(),F(it,{key:1},[C("div",pzt,[k(I,{fill:"",size:"xs"}),C("span",null,Q(E.$t("plan-mask.parameters.title")),1)]),C("div",fzt,[C("span",null,Q(E.$t("plan-mask.parameters.grayscale")),1),k(L,{modelValue:rt(m),"onUpdate:modelValue":S[3]||(S[3]=z=>cn(m)?m.value=z:null)},null,8,["modelValue"])]),C("div",Azt,[C("div",null,Q(E.$t("plan-mask.parameters.brightness"))+" : "+Q(rt(w))+"% ",1),k(U,{modelValue:rt(w),"onUpdate:modelValue":S[4]||(S[4]=z=>cn(w)?w.value=z:null),min:0,max:200,step:1},null,8,["modelValue"])]),C("div",mzt,[C("div",null,Q(E.$t("plan-mask.parameters.contrast"))+" : "+Q(rt(v))+"% ",1),k(U,{modelValue:rt(v),"onUpdate:modelValue":S[5]||(S[5]=z=>cn(v)?v.value=z:null),min:0,max:200,step:1},null,8,["modelValue"])]),C("div",gzt,[C("div",null,Q(E.$t("plan-mask.parameters.opacity"))+" : "+Q(rt(y))+"%",1),k(U,{modelValue:rt(y),"onUpdate:modelValue":S[6]||(S[6]=z=>cn(y)?y.value=z:null),min:0,max:100,step:1},null,8,["modelValue"])]),C("div",vzt,[k(R,{color:"primary",outline:"",radius:"",width:"135px",height:"36px",disabled:rt(g),onClick:rt(x)},{default:N(()=>[Xe(Q(E.$t("global.reset")),1)]),_:1},8,["disabled","onClick"]),k(R,{color:"primary",fill:"",radius:"",width:"135px",height:"36px",disabled:!rt(f),onClick:rt(M)},{default:N(()=>[Xe(Q(E.$t("global.apply")),1)]),_:1},8,["disabled","onClick"])])],64))])):oe("",!0)])):oe("",!0),k(L4,{ref_key:"viewer",ref:e,enablePenPlugin:"",enablePlanMask:!1,ignoreCropPathWhileFitView:""},{default:N(()=>[rt(r).length>0?(B(),K(aT,{key:0,pages:rt(r),index:rt(s),onInput:rt(a),onPrev:rt(a),onNext:rt(a)},null,8,["pages","index","onInput","onPrev","onNext"])):oe("",!0)]),_:1},512)])}}},[["__scopeId","data-v-c240912b"]]);class wzt{constructor(e){this.$viewer=e}async savePlanMasks(e){const{$viewer:t}=this,{newCropPathByModelId:n,newFiltersByModelId:o}=e,r=[...Array.from(new Set(n.keys())),...Array.from(new Set(o.keys()))],s=new Map;for(const a of r){const l=n.get(a),c=o.get(a),u=t.state.modelsMap.get(a);if(!u){console.warn(`[Plan Mask] Model with ID ${a} not found in state.modelsMap`);continue}if(u.mask_2d&&l===null&&c===null){s.set(a,null);continue}const d={};n.has(a)&&(d.crop_path=l?.map(h=>[h.x,h.y])??null),o.has(a)&&(d.grayscale=c?.grayscale??!1,d.contrast=c?.contrast??100,d.brightness=c?.brightness??100,d.opacity=c?.opacity??1),s.set(a,d)}try{const{apiClient:a,cloudId:l,projectId:c}=t.api;await Promise.all(Array.from(s.entries()).map(async([u,d])=>{if(d===null)await a.modelApi.deleteMask2D(l,u,c),$6(t.state,u,null);else if(t.state.modelsMap.get(u).mask_2d){const h=await a.modelApi.updateMask2D(l,u,c,d);$6(t.state,u,h)}else{const h=await a.modelApi.createMask2D(l,u,c,d);$6(t.state,u,h)}}))}catch(a){console.error(`[Plan Mask] Impossible to save the masks of the models : ${Array.from(s.keys()).join(", ")}`,a)}}}const Czt={class:"bimdata-plan-mask"},bzt={name:"plan-mask",i18n:{en:{title:"Targeted Display",parameters:{title:"Adjust image",grayscale:"Grayscale",brightness:"Brightness",contrast:"Contrast",opacity:"Opacity",warning_text:"You have unsaved changes, are you sure you want to quit?"}},fr:{title:"Affichage Ciblé",parameters:{title:"Ajuster l'image",grayscale:"Niveaux de gris",brightness:"Luminosité",contrast:"Contraste",opacity:"Opacité",warning_text:"Vous avez des modifications non enregistrées, êtes-vous sûr de vouloir quitter ?"}}},component:H({__name:"PlanMask",setup(i){const e=qn({newCropPathByModelId:new Map,newFiltersByModelId:new Map});qi("state",e);const t=new wzt(ut("$viewer"));return qi("service",t),(n,o)=>(B(),F("div",Czt,[k(WHt),k(yzt,{class:"bimdata-plan-mask__content__viewer"})]))}},[["__scopeId","data-v-8df06378"]]),window:{name:"plan-mask",header:!1,displayedInWindowSelector:!1,modelTypes:["PDF","JPEG","PNG","METABUILDING"],multiModel:!1}};function $de(i=()=>{},e=()=>{},t=null){const n=pe(!1),o=pe(t),r=qn({x:0,y:0});function s(c){if((e?.(c)??!0)===!1)return;n.value=!0;const{x:d,y:h}=o.value.getBoundingClientRect();r.x=c.clientX-d,r.y=c.clientY-h,document.addEventListener("mouseup",a),document.addEventListener("mousemove",l)}function a(){document.removeEventListener("mousemove",l),n.value=!1}function l(c){i?.(c)}return ci(()=>o.value.addEventListener("mousedown",s)),ra(()=>o.value.removeEventListener("mousedown",s)),{grabbing:n,templateRef:o,startPosition:r}}const xzt=["attrs"],Mzt={key:0,width:"140",height:"140",viewBox:"0 0 140 140",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",transform:"translate(-50%, -50%)","pointer-events":"none"}},Bzt=["d","fill"],Ezt=["width","viewBox"],Izt=["x2"],Szt=["x2","stroke-dasharray"],Pzt=["opacity"],Tzt={key:3,width:"6",height:"6",viewBox:"0 0 6 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",transform:"translate(-50%, -50%)","pointer-events":"none"}},kzt=25,Rzt={__name:"Rotation2D",props:{canvasPosition:{type:Object,required:!0},position:{type:Object,required:!0}},emits:["marker-move"],setup(i,{emit:e}){const n=ut("$viewer").localContext.viewer.viewer,o=n.canvas.parentElement.style,r=o.cursor,s=e,a=i,l=qn({x:a.canvasPosition.x,y:a.canvasPosition.y}),c=Fe(()=>({x:l.x-a.canvasPosition.x,y:l.y-a.canvasPosition.y})),u=Fe(()=>{const{x:U,y:z}=c.value;return Math.sqrt(U*U+z*z)}),d=Fe(()=>{const{x:U,y:z}=c.value;return Math.atan2(z,U)*(180/Math.PI)}),{grabbing:h,templateRef:p}=$de(U=>{const{clientX:z,clientY:j}=U,{x:Z,y:W}=n.canvas.getBoundingClientRect(),{x:ee,y:ae}=n.camera.getPosition({x:z-Z,y:j-W});l.x=z-Z,l.y=j-W,s("marker-move",{x:ee,y:ae})},U=>{U.stopPropagation(),U.preventDefault()}),A=Fe(()=>{const{x:U,y:z}=a.canvasPosition,{x:j,y:Z}=E;return Math.atan2(Z-z,j-U)*(180/Math.PI)}),f=Fe(()=>{const{x:U,y:z}=a.canvasPosition,{x:j,y:Z}=E,W=j-U,ee=Z-z,Be=68/Math.sqrt(W*W+ee*ee);return{x:W*Be,y:ee*Be}}),g=Fe(()=>{const{x:U,y:z}=c.value,Z=68/Math.sqrt(U*U+z*z);return{x:U*Z+70,y:z*Z+70}}),m=Fe(()=>{const{x:U,y:z}=g.value;return Math.atan2(z-70,U-70)});function w(U,z,j){return`url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="${z}" height="${j}" viewBox="0 0 ${z} ${j}">${U}</svg>')`}const v=Fe(()=>`${w(`<path d="M19.7004 2.28955L19.2674 1.53955L18.8344 2.28955L14.9856 8.95583L14.5526 9.70583H15.4186H18.1325V16.507V17.007H18.6325H19.9023H20.4023V16.507V9.70583H23.1162H23.9822L23.5492 8.95583L19.7004 2.28955ZM18.8344 37.0733L19.2674 37.8233L19.7004 37.0733L23.5492 30.407L23.9822 29.657H23.1162H20.4023V22.8558V22.3558H19.9023H18.6325H18.1325V22.8558V29.657H15.4186H14.5526L14.9856 30.407L18.8344 37.0733Z" fill="black" stroke="white" transform="rotate(${m.value*(180/Math.PI)})" transform-origin="center" />`,39,39)} 20 20, auto`);dt(v,U=>{o.cursor=U},{immediate:!0}),dt(h,U=>{U?o.cursor="crosshair":o.cursor=v.value});const y=Fe(()=>{const{x:U,y:z}=f.value,j=Math.atan2(z,U);let W=m.value-j;return W<-Math.PI?W+=2*Math.PI:W>Math.PI&&(W-=2*Math.PI),W});let x=0;const{grabbing:M,startPosition:E}=$de(()=>{const U=-(y.value/Math.PI)*180;n.camera.rotate(U-x,a.position),x=U},U=>{if(U.shiftKey)return!1;U.stopPropagation(),U.preventDefault()},n.canvas);dt(M,U=>{U?(n.ui.rotatable=!1,n.ui.translatable=!1,n.ui.scallable=!1):(x=0,n.ui.rotatable=!0,n.ui.translatable=!0,n.ui.scallable=!0)});const S=pe(!1),I=Fe(()=>S.value&&M.value);n.ui.on("mousemove",({canvasPosition:U,altKey:z})=>{const{x:j,y:Z}=U;if(!M.value||z){l.x=j,l.y=Z,S.value=!1;return}const W={x:j-a.canvasPosition.x,y:Z-a.canvasPosition.y},ee=Math.atan2(W.y,W.x),ae=Math.round(ee/(Math.PI/4))*(Math.PI/4),Be=Math.cos(ae)*Math.sqrt(W.x*W.x+W.y*W.y),Ee=Math.sin(ae)*Math.sqrt(W.x*W.x+W.y*W.y);Math.sqrt((Be-W.x)*(Be-W.x)+(Ee-W.y)*(Ee-W.y))<kzt?(l.x=a.canvasPosition.x+Be,l.y=a.canvasPosition.y+Ee,S.value=!0):(l.x=j,l.y=Z,S.value=!1)});const R=Fe(()=>y.value>0?1:0),P=pe(!1),D=pe("grab");let L=null;return dt(P,U=>{U&&!L?L=setInterval(()=>{P.value&&(D.value=D.value==="grab"?"grabbing":"grab")},500):!U&&L&&(clearInterval(L),L=null,D.value="grab")}),ki(()=>{o.cursor=r}),(U,z)=>(B(),F(it,null,[(B(),F("svg",{attrs:U.$attrs,width:"140",height:"140",viewBox:"0 0 140 140",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",transform:"translate(-50%, -50%)","pointer-events":"none"}},[...z[2]||(z[2]=[C("circle",{cx:"70",cy:"70",r:"68",stroke:"#2F374A","stroke-width":"2"},null,-1)])],8,xzt)),rt(M)?(B(),F("svg",Mzt,[C("path",{d:`
|
|
5534
5534
|
m${g.value.x+","+g.value.y}
|
|
5535
5535
|
L70,70
|
|
5536
5536
|
l${f.value.x+","+f.value.y}
|
|
@@ -5544,5 +5544,5 @@ void main() {
|
|
|
5544
5544
|
--bimdata-local-context-width: ${n.width}px;
|
|
5545
5545
|
--bimdata-local-context-center-width: ${n.centerWidth}px;
|
|
5546
5546
|
--bimdata-local-context-resolution: ${n.resolution};
|
|
5547
|
-
`),onMouseenter:e[0]||(e[0]=(...h)=>n.onMouseEnter&&n.onMouseEnter(...h)),onMouseleave:e[1]||(e[1]=(...h)=>n.onMouseLeave&&n.onMouseLeave(...h))},[k(s,{ref:"modalManagerTemplateRef"},null,512),C("div",UJt,[n.windowPlugins.leftSidePanel?(B(),K(a,{key:0,plugin:n.windowPlugins.leftSidePanel},null,8,["plugin"])):oe("",!0),C("div",NJt,[(B(!0),F(it,null,It(n.windowPlugins.free,h=>(B(),K(l,{key:h.name,class:le({"window-container__content__center__viewer":h.isViewer}),plugin:h},null,8,["class","plugin"]))),128)),k(c,{position:"left",plugins:n.windowPlugins.leftButtonColumn},null,8,["plugins"]),k(c,{position:"right",plugins:n.windowPlugins.rightButtonColumn},null,8,["plugins"])]),n.windowPlugins.rightSidePanel?(B(),K(a,{key:1,plugin:n.windowPlugins.rightSidePanel},null,8,["plugin"])):oe("",!0)]),n.loading?(B(),F("div",VJt,[n.spinner&&n.spinner.component?(B(),K(Sn(n.spinner.component),Rr(xs({key:0},n.spinner.props)),null,16)):(B(),K(u,{key:1,size:"20px",border:"3px"}))])):oe("",!0),n.layoutSettingsDisplayed?(B(),F("div",HJt,[k(d)])):oe("",!0)],36)}const jJt=H(OJt,[["render",zJt],["__scopeId","data-v-3ed35f9c"]]);class GJt{constructor(e=!0){const t=_Kt(PH,null,{resizable:e});t.registerContent("default",jJt),this.settings=ns({edit:!1,swap:!1,full:!1}),this.areas=t}get resizable(){return this.areas.resizable}set resizable(e){this.areas.resizable=e}apply(e=null){this.areas.layout=e?LKt(e):null}copy(e,t=!0){return FKt(this.areas.layout,e,t)}open({ratio:e,direction:t,insertAfter:n,windowName:o=null,windowState:r=null,localContextId:s=null}={}){const a=o?{options:{windowName:o,windowState:r}}:null;return s===null?this.areas.splitLayout(e,t,n,a):this.areas.split(s,e,t,n,a)}swap(e,t){return this.areas.swap(e,t)}close(e){return this.areas.delete(e)}compare(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;if(typeof e=="string"&&typeof t=="string")return e===t;if(typeof e=="string"||typeof t=="string")return!1;if(e.windowName&&t.windowName){if(e.windowName!==t.windowName)return!1;const n=new Set(e.windowState?.modelIds),o=new Set(t.windowState?.modelIds);return n.size===o.size&&[...n].every(s=>o.has(s))}return e.windowName||t.windowName||e.direction!==t.direction||e.children.length!==t.children.length?!1:e.children.every((n,o)=>this.compare(n,t.children[o]))}}const QJt={version:"2.14.0-beta.2"};let qJt=1;class KJt{constructor({plugins:e,api:t,ui:n,locale:o="fr"}){this.instanceId=qJt++,this.pluginManager=new nGt(e),this.windowManager=new sGt,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new zqt(t),this.globalContext=new T5e(this),this.state=$qt(this),this.shortcutManager=h0e(this.state),this.uiSettings=n||{},this.i18n=new S5e(o),this._contextMenu=null,this.layout=new GJt(this.uiSettings.resizable!==!1),this._darkTheme=pe(n?.darkTheme??!1),this.localContext=null,window.$viewer=this}get darkTheme(){return this._darkTheme.value}set darkTheme(e){this._darkTheme.value=e}get version(){return QJt.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||u0e}set contextMenu(e){this._contextMenu=e}get registeredWindows(){return[...this.windowManager.registeredWindows.keys()]}get registeredPlugins(){return[...this.pluginManager.registeredPlugins.keys()]}get pluginsCfg(){return this.pluginManager.cfg}registerPlugin(e){this.pluginManager.registerPlugin(e),this.windowManager.registerAndAddPluginsToWindows([e])}}function JJt(i,e={}){e.backgroundColor&&(i.style.setProperty("--bimdata-viewer-background-color",e.backgroundColor),e.backgroundColor==="transparent"&&i.style.setProperty("--areas-separator-color","transparent")),e.colorPrimary&&i.style.setProperty("--color-primary",e.colorPrimary),e.colorPrimaryLighter&&i.style.setProperty("--color-primary-lighter",e.colorPrimaryLighter),e.colorPrimaryLight&&i.style.setProperty("--color-primary-light",e.colorPrimaryLight),e.colorPrimaryDark&&i.style.setProperty("--color-primary-dark",e.colorPrimaryDark),e.colorSecondary&&i.style.setProperty("--color-secondary",e.colorSecondary),e.colorSecondaryLighter&&i.style.setProperty("--color-secondary-lighter",e.colorSecondaryLighter),e.colorSecondaryLight&&i.style.setProperty("--color-secondary-light",e.colorSecondaryLight),e.colorSecondaryDark&&i.style.setProperty("--color-secondary-dark",e.colorSecondaryDark),e.colorSilverLight&&i.style.setProperty("--color-silver-light",e.colorSilverLight),e.colorSilver&&i.style.setProperty("--color-silver",e.colorSilver),e.colorSilverDark&&i.style.setProperty("--color-silver-dark",e.colorSilverDark),e.colorGraniteLight&&i.style.setProperty("--color-granite-light",e.colorGraniteLight),e.colorGranite&&i.style.setProperty("--color-granite",e.colorGranite),e.colorSuccess&&i.style.setProperty("--color-success",e.colorSuccess),e.colorSuccessLighter&&i.style.setProperty("--color-success-Lighter",e.colorSuccessLighter),e.colorSuccessLight&&i.style.setProperty("--color-success-Light",e.colorSuccessLight),e.colorSuccessDark&&i.style.setProperty("--color-success-Dark",e.colorSuccessDark),e.colorWarning&&i.style.setProperty("--color-warning",e.colorWarning),e.colorWarningLighter&&i.style.setProperty("--color-warning-Lighter",e.colorWarningLighter),e.colorWarningLight&&i.style.setProperty("--color-warning-Light",e.colorWarningLight),e.colorWarningDark&&i.style.setProperty("--color-warning-Dark",e.colorWarningDark),e.colorHigh&&i.style.setProperty("--color-high",e.colorHigh),e.colorHighLighter&&i.style.setProperty("--color-high-lighter",e.colorHighLighter),e.colorHighLight&&i.style.setProperty("--color-high-light",e.colorHighLight),e.colorHighDark&&i.style.setProperty("--color-high-dark",e.colorHighDark),e.colorText&&i.style.setProperty("--color-text",e.colorText),(!e.backgroundColor||e.backgroundColor!=="transparent")&&i.style.setProperty("--areas-separator-color","rgba(216, 216, 216, 1)"),e.headerHeight!=null&&i.style.setProperty("--bimdata-viewer-header-height",e.headerHeight),i.style.setProperty("--areas-background-color","transparent")}const WJt=Object.freeze({25:"GUEST",50:"USER",100:"ADMIN"}),Km=Object.freeze({READ:"read",WRITE:"write"});function Q1e(i){const e={};return i.forEach(t=>{const[n,o]=t.split(":");e[n]?e[n].push(o):e[n]=[o]}),e}const ZJt={token_scopes:[],usable_scopes:[],user_role:25};function q1e(i=ZJt){const e=Q1e(i.token_scopes),t=Q1e(i.usable_scopes);return{...Iq(i),tokenScopes:e,usableScopes:t,userRole:WJt[i.user_role],user:i.user?Iq(i.user):null,hasBcfReadPermission:t.bcf?.includes(Km.READ)??!1,hasBcfWritePermission:t.bcf?.includes(Km.WRITE)??!1,hasModelReadPermission:t.model?.includes(Km.READ)??!1,hasModelWritePermission:t.model?.includes(Km.WRITE)??!1,hasDocReadPermission:t.document?.includes(Km.READ)??!1,hasDocWritePermission:t.document?.includes(Km.WRITE)??!1}}const YJt={de:{BcfComponents:{back:"Zurück",BcfFilters:{filtersButton:"Filter",filtersTitle:"Filter",priorityLabel:"Priorität",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",creatorsLabel:"Erstellt von",tagsLabel:"Tags",resetButton:"Zurücksetzen",searchButton:"Suchen",undefined:"Nicht definiert",datePlaceholder:"Erstellungsdatum"},BcfSettings:{title:"BCF-Parameter",text:"Erstellen, füllen und listen Sie die BCF-Einstellungen auf, die Sie für dieses Projekt haben möchten.",validateButton:"Die BCF-Parameter anerkennen"},BcfStatistics:{emptyText:"Fügen Sie Fragen hinzu, um zugehörige Statistiken hier anzuzeigen.",issues:"Probleme",extension:{Priority:"Priorität",PriorityNotDefined:"Keine Priorität",PriorityTitle:"Prioritäten",Status:"Status",StatusNotDefined:"Kein Status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priorität",noPriority:"Keine",assignedTo:"Zugewiesen an",elements:"Elemente",notSpecified:"Nicht definiert",see:"Anzeigen"},BcfTopicCreationCard:{text:"Ein neues BCF-Thema erstellen",createBcfSideTitle:"Ein Problem melden"},BcfTopicForm:{dragDropImageText:"Bitte wählen Sie eine Datei aus.",addObjectButton:"Objekt",addAnnotationButton:"Annotation",annotationButtonTooltip:"Zu diesem Thema gibt es derzeit keine Ansichten.",addPictureButton:"Fügen Sie ein Bild hinzu.",titlePlaceholder:"Titel *",titleErrorMessage:"Titel fehlt",typeLabel:"Typ",priorityLabel:"Priorität",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",dueDateLabel:"Fälligkeitsdatum (TT.MM.JJJJ)",descriptionLabel:"Beschreibung",labelsLabel:"Tags",createButton:"Bestätigen",updateButton:"Änderungen übernehmen",modalText:"Sie sind dabei, die Bearbeitung der Ausgabe {Name} zu beenden, aber es gibt noch ungespeicherte Änderungen.",cancelButton:"Änderungen verwerfen",continueButton:"Änderungen fortsetzen",createTitle:"Ein Problem melden",dragDropImageTextTablet:"Foto machen",takeSnapshot:"Mach einen Schnappschuss",importFile:"Eine Datei importieren",searchPlaceholder:"Suchen",emptySearch:"kein Ergebnis"},BcfTopicOverview:{openViewer:"Im Viewer öffnen",openViewerNoModels:"Es sind keine Vorlagen zur Ansicht bereit",elements:"{count} Elemente",noElements:"kein Element",type:"Typ",noTypeSpecified:"Kein Typ angegeben",description:"Beschreibung",noDescriptionProvided:"Keine Beschreibung angegeben",assignedTo:"Zugeteilt an",notAssigned:"Nicht zugewiesen",dueDate:"Fälligkeitsdatum",noDueDate:"Kein Fälligkeitsdatum",informations:"Informationen",status:"Status",noStatusSpecified:"Kein Status angegeben",stage:"Phase",noStageProvided:"Keine Phase angegeben",priority:"Priorität",priorityNotDefined:"Nicht definiert",tags:"Tags",noTags:"Keine Tags",commentButton:"Ein Kommentar veröffentlichen",deleteText:"Sie löschen jetzt {Name}",deleteBcfButton:"Dieses BCF löschen",keepBcfButton:"Dieses BCF beibehalten",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Priorität",status:"Status",title:"Titel",creator:"Autor",date:"Datum"}},BcfTopicActionsCell:{seeButton:"Anzeigen"},BcfTopicComments:{commentButton:"Ein Kommentar verfassen",commentLabel:"Ein Kommentar verfassen",commentText:"Kommentar",cancelButton:"Abbrechen",publishButton:"Veröffentlichen",commentsText:"Kommentare",deleteCommentText:"Diesen Kommentar löschen?",deleteButton:"Löschen",takeSnapshot:"Mach einen Schnappschuss"},BcfTopicPriorityCell:{noPriority:"Keine"},SettingCard:{addButton:"ein Element hinzufügen",cancelButton:"Abbrechen",validateButton:"Bestätigen",deleteExtensionText:"Diesen Parameter löschen",deleteButton:"Löschen",title:{Priority:"Prioritäten",Label:"Tags",Status:"Status",Type:"Typen",Stage:"Phasen"},input:{Priority:"Eine neue Priorität hinzufügen",Label:"Ein neues Etikett hinzufügen",Status:"Einen neuen Status hinzufügen",Type:"Einen neuen Typ hinzufügen",Stage:"Eine neue Phase hinzufügen"},text:{Priority:"Liste der Prioritäten",Label:"Liste von Tags",Status:"Liste der Status",Type:"Liste der Typen",Stage:"Liste der Phasen"}}}},en:{BcfComponents:{back:"Back",BcfFilters:{filtersButton:"Filters",filtersTitle:"Filters",priorityLabel:"Priority",statusLabel:"Status",stageLabel:"Stage",assignedToLabel:"Assigned to",creatorsLabel:"Created by",tagsLabel:"Tags",resetButton:"Reset",searchButton:"Search",undefined:"Not defined",datePlaceholder:"Creation date"},BcfSettings:{title:"BCF Settings",text:"Create, enter in, and list the BCF settings you would like to have for this project",validateButton:"Validate BCF settings"},BcfStatistics:{emptyText:"Add BCF Topics to start to have some stats here.",issues:"issues",extension:{Priority:"Priority",PriorityNotDefined:"No priority",PriorityTitle:"Priorities",Status:"Status",StatusNotDefined:"No status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priority",noPriority:"None",assignedTo:"Assigned to",elements:"Elements",notSpecified:"Not specified",see:"See"},BcfTopicCreationCard:{text:"Create a new BCF topic",createBcfSideTitle:"Report a problem"},BcfTopicForm:{dragDropImageText:"Please select a file",addObjectButton:"Object",addAnnotationButton:"Annotation",annotationButtonTooltip:"This topic has no viewpoint",addPictureButton:"Add a picture",titlePlaceholder:"Title *",titleErrorMessage:"Missing title",typeLabel:"Type",priorityLabel:"Priority",statusLabel:"Status",stageLabel:"Stage",assignedToLabel:"Assigned to",dueDateLabel:"Due date",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Validate",updateButton:"Modify this BCF",modalText:"You are about to quit editing issue {name} but there are unsaved changes.",cancelButton:"Discard changes",continueButton:"Continue editing",createTitle:"Report a problem",dragDropImageTextTablet:"Take a picture",takeSnapshot:"Take a snapshot",importFile:"Import a file",searchPlaceholder:"Search",emptySearch:"No result",documentsLabel:"Add a file",documentsCount:"Files - {count} selected files",validateDocuments:"Validate"},BcfTopicOverview:{openViewer:"Open in viewer",openViewerNoModels:"No model to open",elements:"{count} Elements",noElements:"No element",type:"Type",noTypeSpecified:"No type specified",description:"Description",noDescriptionProvided:"No description provided",assignedTo:"Assigned to",notAssigned:"Not assigned",dueDate:"Due date",noDueDate:"No due date",informations:"Informations",status:"Status",noStatusSpecified:"No status specified",stage:"Stage",noStageProvided:"No stage provided",priority:"Priority",priorityNotDefined:"Not defined",tags:"Tags",noTags:"No tags",commentButton:"Post a comment",deleteText:"You are about to delete {name}",deleteBcfButton:"Delete this BCF",keepBcfButton:"Keep this BCF",author:"Author"},BcfTopicsTable:{headers:{index:"#",priority:"Priority",status:"Status",title:"Title",creator:"Author",date:"Date"}},BcfTopicActionsCell:{seeButton:"See"},BcfTopicComments:{commentButton:"Post a comment",commentLabel:"Post a comment",commentText:"Comment",cancelButton:"Cancel",publishButton:"Publish",commentsText:"Comments",deleteCommentText:"Delete this comment ?",deleteButton:"Delete",takeSnapshot:"Take a snapshot",edited:"edited"},BcfTopicPriorityCell:{noPriority:"None"},SettingCard:{addButton:"add an element",cancelButton:"Cancel",validateButton:"Validate",deleteExtensionText:"Remove this setting",deleteButton:"Delete",title:{Priority:"Priorities",Label:"Labels",Status:"Status",Type:"Types",Stage:"Stages"},input:{Priority:"Add a new priority",Label:"Add a new label",Status:"Add new status",Type:"Add a new type",Stage:"Add a new stage"},text:{Priority:"Priority list",Label:"Labels list",Status:"Status list",Type:"Type list",Stage:"Stage list"}}}},es:{BcfComponents:{back:"Volver",BcfFilters:{filtersButton:"Filtros",filtersTitle:"Filtros",priorityLabel:"Prioridad",statusLabel:"Estado",stageLabel:"Fase",assignedToLabel:"Asignado a",creatorsLabel:"Creado por",tagsLabel:"Etiquetas:",resetButton:"Restablecer",searchButton:"Buscar en",undefined:"No definido",datePlaceholder:"Fecha de creación"},BcfSettings:{title:"Parámetros del BCF",text:"Cree, rellene y enumere los parámetros del BCF que desea tener en este proyecto",validateButton:"Validar los parámetros del BCF"},BcfStatistics:{emptyText:"Añada preguntas para ver las estadísticas asociadas aquí.",issues:"problemas",extension:{Priority:"Prioridad",PriorityNotDefined:"Sin prioridad",PriorityTitle:"Prioridades",Status:"Estado",StatusNotDefined:"Sin estado",StatusTitle:"Estatutos"}},BcfTopicCard:{priority:"Prioridad",noPriority:"Sin",assignedTo:"Asignado a",elements:"Elementos",notSpecified:"No definido",see:"Ver"},BcfTopicCreationCard:{text:"Crear un nuevo tema BCF",createBcfSideTitle:"Informar de un problema"},BcfTopicForm:{dragDropImageText:"Seleccione un archivo",addObjectButton:"Objeto",addAnnotationButton:"Anotación",annotationButtonTooltip:"Actualmente este tema no posee ningún punto de vista",addPictureButton:"Añadir una imagen",titlePlaceholder:"Título *",titleErrorMessage:"Falta el título",typeLabel:"Tipo",priorityLabel:"Prioridad",statusLabel:"Estado",stageLabel:"Fase",assignedToLabel:"Asignado a",dueDateLabel:"Fecha de vencimiento (DD/MM/AAAA)",descriptionLabel:"Descripción",labelsLabel:"Etiquetas",createButton:"Validar",updateButton:"Modificar este BCF",modalText:"Está a punto de salir de la edición del problema de {name} pero hay cambios sin guardar.",cancelButton:"Cancelar los cambios",continueButton:"Continuar con los cambios",createTitle:"Informar de un problema",dragDropImageTextTablet:"Tomar una fotografía",takeSnapshot:"Tomar un snapshot",importFile:"Importar un archivo",searchPlaceholder:"Buscar",emptySearch:"No hay resultados"},BcfTopicOverview:{openViewer:"Abrir en el visor",openViewerNoModels:"No hay ningún modelo listo para la visualización",elements:"{count} Elementos",noElements:"Ningún elemento",type:"Tipo",noTypeSpecified:"No se especifica el tipo",description:"Descripción",noDescriptionProvided:"No hay descripción",assignedTo:"Asignado a",notAssigned:"No asignado",dueDate:"Plazo",noDueDate:"Sin fecha de vencimiento",informations:"Información",status:"Estado",noStatusSpecified:"No se especifica el estado",stage:"Fase",noStageProvided:"No se indica ninguna fase",priority:"Prioridad",priorityNotDefined:"No definido",tags:"Etiquetas",noTags:"Sin etiquetas",commentButton:"Publicar un comentario",deleteText:"Estás a punto de borrar {name}",deleteBcfButton:"Borrar este BCF",keepBcfButton:"Mantenga este BCF",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Prioridad",status:"Estado",title:"Título",creator:"Autor",date:"Fecha"}},BcfTopicActionsCell:{seeButton:"Ver"},BcfTopicComments:{commentButton:"Publicar un comentario",commentLabel:"Publicar un comentario",commentText:"Comentario",cancelButton:"Cancelar",publishButton:"Publicar",commentsText:"comentarios",deleteCommentText:"¿Borrar este comentario?",deleteButton:"Borrar",takeSnapshot:"Tomar un snapshot"},BcfTopicPriorityCell:{noPriority:"Sin"},SettingCard:{addButton:"añadir un elemento",cancelButton:"Cancelar",validateButton:"Validar",deleteExtensionText:"Borrar esta configuración",deleteButton:"Borrar",title:{Priority:"Prioridades",Label:"Etiquetas:",Status:"Estatutos",Type:"Tipos",Stage:"Fases"},input:{Priority:"Añadir una nueva prioridad",Label:"Añadir una nueva etiqueta",Status:"Añadir un nuevo estado",Type:"Añadir un nuevo tipo",Stage:"Añadir una nueva fase"},text:{Priority:"Lista de prioridades",Label:"Lista de etiquetas",Status:"Lista de estatutos",Type:"Lista de tipos",Stage:"Lista de fases"}}}},fr:{BcfComponents:{back:"Retour",BcfFilters:{filtersButton:"Filtres",filtersTitle:"Filtres",priorityLabel:"Priorité",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assigné à",creatorsLabel:"Créé par",tagsLabel:"Tags",resetButton:"Réinitialiser",searchButton:"Rechercher",undefined:"Non défini",datePlaceholder:"Date de création"},BcfSettings:{title:"Paramètres BCF",text:"Créez, renseignez et listez les paramètres BCF que vous souhaitez avoir sur ce projet",validateButton:"Valider les paramètres BCF"},BcfStatistics:{emptyText:"Ajoutez des questions pour voir les statistiques associées ici.",issues:"problèmes",extension:{Priority:"Priorité",PriorityNotDefined:"Aucune priorité",PriorityTitle:"Priorités",Status:"Statut",StatusNotDefined:"Aucun statut",StatusTitle:"Statuts"}},BcfTopicCard:{priority:"Priorité",noPriority:"Aucune",assignedTo:"Assigné à",elements:"{n} Élements",notSpecified:"Non défini",see:"Voir"},BcfTopicCreationCard:{text:"Créer un nouveau topic BCF",createBcfSideTitle:"Signaler un problème"},BcfTopicForm:{dragDropImageText:"Veuillez sélectionner un fichier",addObjectButton:"Objet",addAnnotationButton:"Annotation",annotationButtonTooltip:"Ce topic ne possède actuellement aucun point de vue",addPictureButton:"Ajouter une image",titlePlaceholder:"Titre *",titleErrorMessage:"Titre manquant",typeLabel:"Type",priorityLabel:"Priorité",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assigné à",dueDateLabel:"Date d'échéance",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Valider",updateButton:"Modifier ce BCF",modalText:"Vous êtes sur le point de quitter l'édition de l'issue {name} mais il y'a des modifications non enregistrées.",cancelButton:"Annuler les modifications",continueButton:"Continuer les modifications",createTitle:"Signaler un problème",dragDropImageTextTablet:"Prendre une photo",takeSnapshot:"Prendre un snapshot",importFile:"Importer un fichier",searchPlaceholder:"Rechercher",emptySearch:"Pas de résultat",documentsLabel:"Documents",documentsCount:"Documents - {count} documents sélectionnés",validateDocuments:"Valider"},BcfTopicOverview:{openViewer:"Ouvrir dans le viewer",openViewerNoModels:"Il n'y a aucun modèle prêt pour une visualisation",elements:"{count} Élements",noElements:"Aucun élément concerné",type:"Type",noTypeSpecified:"Pas de type spécifié",description:"Description",noDescriptionProvided:"Pas de description renseignée",assignedTo:"Assigné à",notAssigned:"Non assigné",dueDate:"Échéance",noDueDate:"Pas de date d'échéance",informations:"Informations",status:"Statut",noStatusSpecified:"Pas de statut spécifié",stage:"Phase",noStageProvided:"Pas de phase renseignée",priority:"Priorité",priorityNotDefined:"Non défini",tags:"Tags",noTags:"Pas de tags",commentButton:"Poster un commentaire",deleteText:"Vous êtes sur le point de supprimer {name}",deleteBcfButton:"Supprimer ce BCF",keepBcfButton:"Conserver ce BCF",author:"Auteur"},BcfTopicsTable:{headers:{index:"#",priority:"Priorité",status:"Statut",title:"Titre",creator:"Auteur",date:"Date"}},BcfTopicActionsCell:{seeButton:"Voir"},BcfTopicComments:{commentButton:"Poster un commentaire",commentLabel:"Poster un commentaire",commentText:"Commentaire",cancelButton:"Annuler",publishButton:"Publier",commentsText:"commentaires",deleteCommentText:"Supprimer ce commentaire ?",deleteButton:"Supprimer",takeSnapshot:"Prendre un snapshot",edited:"edité"},BcfTopicPriorityCell:{noPriority:"Aucune"},SettingCard:{addButton:"ajouter un élément",cancelButton:"Annuler",validateButton:"Valider",deleteExtensionText:"Supprimmer ce paramètre",deleteButton:"Supprimer",title:{Priority:"Priorités",Label:"Tags",Status:"Statuts",Type:"Types",Stage:"Phases"},input:{Priority:"Ajouter une nouvelle priorité",Label:"Ajouter un nouveau label",Status:"Ajouter un nouveau statut",Type:"Ajouter un nouveau type",Stage:"Ajouter une nouvelle phase"},text:{Priority:"Liste des priorités",Label:"Liste des tags",Status:"Liste des statuts",Type:"Liste des types",Stage:"Liste des phases"}}}},it:{BcfComponents:{back:"Indietro",BcfFilters:{filtersButton:"Filtri",filtersTitle:"Filtri",priorityLabel:"Priorità",statusLabel:"Stato",stageLabel:"Fase",datePlaceholder:"Data di creazione",assignedToLabel:"Assegnato a",creatorsLabel:"Creato da",tagsLabel:"Etichette",resetButton:"Ripristina",searchButton:"Cerca",undefined:"Non definito"},BcfSettings:{title:"Parametri BCF",text:"Creare, notificare e elencare i parametri BCF che si desidera avere su questo progetto",validateButton:"Conferma i parametri BCF"},BcfStatistics:{emptyText:"Aggiungi delle domande per vedere le statistiche associate qui.",issues:"problemi",extension:{Priority:"Priorità",PriorityNotDefined:"Nessuna priorità",PriorityTitle:"Priorità",Status:"Stato",StatusNotDefined:"Nessuno stato",StatusTitle:"Stati"}},BcfTopicCard:{priority:"Priorità",noPriority:"Nessuno",assignedTo:"Assegnato a",elements:"Elementi",noElements:"0 elementi",notSpecified:"Non definito",see:"Visualizza"},BcfTopicCreationCard:{text:"Crea un nuovo topic BCF",createBcfSideTitle:"Segnala un problema"},BcfTopicForm:{dragDropImageText:"Selezionare un file",addObjectButton:"Oggetto",addAnnotationButton:"Annotazione",annotationButtonTooltip:"Attualmente questo argomento non presenta alcun punto di vista",addPictureButton:"Aggiungere un'immagine",titlePlaceholder:"Titolo *",titleErrorMessage:"Titolo mancante",typeLabel:"Tipo",priorityLabel:"Priorità",statusLabel:"Stato",stageLabel:"Fase",assignedToLabel:"Assegnato a",dueDateLabel:"Data di scadenza",descriptionLabel:"Descrizione",labelsLabel:"Tag",createButton:"Conferma",updateButton:"Modificare questo BCF",modalText:"State per abbandonare la modifica di {name} ma ci sono modifiche non salvate.",cancelButton:"Annullare le modifiche",continueButton:"Continuare le modifiche",createTitle:"Segnala un problema"},BcfTopicOverview:{openViewer:"Apri nel visualizzatore",openViewerNoModels:"Non esistono modelli pronti per la visualizzazione",elements:"{count} Elementi",noElements:"Nessun elemento",type:"Tipo",noTypeSpecified:"Nessun tipo specificato",description:"Descrizione",noDescriptionProvided:"Nessuna descrizione inserita",assignedTo:"Assegnato a",notAssigned:"Non assegnato",dueDate:"Scadenza",noDueDate:"Nessuna data di scadenza",informations:"Informazioni",status:"Stato",noStatusSpecified:"Nessuno stato specificato",stage:"Fase",noStageProvided:"Nessuna fase inserita",priority:"Priorità",priorityNotDefined:"Non definita",tags:"Etichette",noTags:"Nessuna etichetta",commentButton:"Pubblica un commento",deleteText:"Stai per eliminare {name}",deleteBcfButton:"Elimina questo BCF",keepBcfButton:"Conserva questo BCF",author:"Autore"},BcfTopicsTable:{headers:{index:"#",priority:"Priorità",status:"Stato",title:"Titolo",creator:"Autore",date:"Data"}},BcfTopicActionsCell:{seeButton:"Visualizza"},BcfTopicComments:{commentButton:"Pubblica un commento",commentLabel:"Pubblica un commento",commentText:"Commento",cancelButton:"Annulla",publishButton:"Pubblica",commentsText:"commenti",deleteCommentText:"Eliminare questo commento?",deleteButton:"Elimina"},BcfTopicPriorityCell:{noPriority:"Nessuno"},SettingCard:{addButton:"aggiungi un elemento",cancelButton:"Annulla",validateButton:"Conferma",deleteExtensionText:"Elimina questo parametro",deleteButton:"Elimina",title:{Priority:"Priorità",Label:"Etichette",Status:"Stati",Type:"Tipi",Stage:"Fasi"},input:{Priority:"Aggiungi una nuova priorità",Label:"Aggiungi una nuova etichetta",Status:"Aggiungi un nuovo stato",Type:"Aggiungi un nuovo tipo",Stage:"Aggiungi una nuova fase"},text:{Priority:"Elenco delle priorità",Label:"Elenco delle etichette",Status:"Elenco degli stati",Type:"Elenco dei tipi",Stage:"Elenco delle fasi"}}}}},XJt=({apiClient:i,fetchUsers:e,i18nPlugin:t}={})=>({install(n){i?Ni.setup({apiClient:i,fetchUsers:e}):console.error("[BCF Components Plugin] No api client provided. You must provide an api client for the components to work properly."),t?Object.entries(YJt).forEach(([o,r])=>{t.global.mergeLocaleMessage(o,r)}):console.warn("[BCF Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(f7e).forEach(([o,r])=>{n.component(o,r)})}}),$Jt={de:{BuildingMaker:{title:"Building Maker",back:"Zurück",list:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschließend Ihre PDFs herunter.",createButton:"Neues Projekt",updateButton:"Umbenennen",deleteButton:"Löschen"},form:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschließend Ihre PDFs herunter.",input:"Name des Gebäudes",error:"Ungültiger Name",createButton:"Erstellen",updateButton:"Bestätigen"},view:{addStoreyButton:"Etage",addPlanButton:"Grundriss",closeButton:"Fertigstellen",submitFilesButton:"Bestätigen"},storeyForm:{title:"Neue Etage",input:"Name",error:"Ungültiger Name",cancelButton:"Abbrechen",submitButton:"Bestätigen"}},FileManager:{creationFormTitle:"Ordner erstellen",renameFormPlaceholder:"Datei- / Ordnernam",nameInputPlaceholder:"Ordnername",emptyFolder:"Dieser Ordner ist leer",newFolderSuccess:"Neuer Ordner erstellt",renameFolderSuccess:"Umbenannter Ordner",deleteFolderSuccess:"Ordner gelöscht",newFileSuccess:"Datei hinzugefügt",renameFileSuccess:"Umbenannte Datei",deleteFileSuccess:"Datei gelöscht",nameInputErrorMessage:"Ungültiger name",cancel:"Abbrechen",submit:"Bestätigen",buttonText:"Neuer Ordner",addFileButtonText:"Datei laden",rename:"Umbenennen",view:"Sehen",download:"Herunterladen",delete:"Löschen",deleteTitle:"Dateien löschen",deleteDetail:"Sie sind im Begriff, die folgenden Dateien / Ordner endgültig zu löschen"}},en:{BIMDataComponents:{t:{back:"Back",cancel:"Cancel",create:"Create",delete:"Delete",download:"Download",finish:"Finish",rename:"Rename",search:"Search",see:"View",storey:"Storey",validate:"Validate"}},BuildingMaker:{title:"Building Maker",list:{text:"Create and edit storeys, then download your PDFs.",new:"New project"},form:{input:"Building name",error:"Invalid"},view:{addStorey:"Add Storey",addFile:"Add File",addPlan:"Add Plan"},storeyForm:{title:"New storey",input:"Name",error:"Invalid name"}},FileManager:{creationFormTitle:"Create folder",renameFormPlaceholder:"Folder/File name",nameInputPlaceholder:"Folder name",emptyFolder:"This folder is empty",newFolderSuccess:"New folder created",renameFolderSuccess:"Folder renamed",deleteFolderSuccess:"Folder deleted",newFileSuccess:"File added",renameFileSuccess:"File renamed",deleteFileSuccess:"File deleted",nameInputErrorMessage:"Invalid name",buttonText:"New folder",addFileButtonText:"Upload a file",deleteTitle:"Deleting Files",deleteDetail:"You are about to permanently delete the following files / folders",dmsRoot:"Root of the project's DMS",pdfPageSelectorTitle:"Select a page"},MetaBuildingStructure:{title:"Meta-Building Structure",tab:{structure:"Structure",zones:"Zones",equipments:"Equipments"},StoreySelector:{placeholder:"Select a storey"}},PhotosphereBuilding:{title:"Photosphere Building"}},es:{BuildingMaker:{title:"Building Maker",back:"Vuelta",list:{text:"Cree y edite los pisos después cargue los PDF.",createButton:"Nuevo proyecto",updateButton:"Renombrar",deleteButton:"Suprimir"},form:{text:"Cree y edite los pisos después cargue los PDF.",input:"Nombre del edificio",error:"Nombre no válido",createButton:"Crear",updateButton:"Validar"},view:{addStoreyButton:"Piso",addPlanButton:"Plano",closeButton:"Terminar",submitFilesButton:"Validar"},storeyForm:{title:"Nuevo piso",input:"Nombre",error:"Nombre no válido",cancelButton:"Anular",submitButton:"Validar"}},FileManager:{creationFormTitle:"Crear un archivo",renameFormPlaceholder:"Nombre de archivo / carpeta",nameInputPlaceholder:"Nombre de la carpeta",emptyFolder:"Esta carpeta está vacía",newFolderSuccess:"Nueva carpeta creada",renameFolderSuccess:"Carpeta renombrada",deleteFolderSuccess:"Carpeta eliminada",newFileSuccess:"Archivo agregado",renameFileSuccess:"Archivo renombrado",deleteFileSuccess:"Archivo eliminado",nameInputErrorMessage:"Nombre inválida",cancel:"Cancelar",submit:"Validar",buttonText:"Carpeta nueva",addFileButtonText:"Cargar un archivo",rename:"Renombrar",view:"Ver",download:"Descargar",delete:"Borrar",deleteTitle:"Eliminar archivos",deleteDetail:"Está a punto de eliminar permanentemente los siguientes archivos / carpetas"}},fr:{BIMDataComponents:{t:{back:"Retour",cancel:"Annuler",create:"Créer",delete:"Supprimer",download:"Télécharger",finish:"Terminer",rename:"Renommer",search:"Rechercher",see:"Voir",storey:"Étage",validate:"Valider"}},BuildingMaker:{title:"Building Maker",list:{text:"Créez et éditez les étages puis téléchagez vos PDF.",new:"Nouveau projet"},form:{input:"Nom du bâtiment",error:"Nom invalide"},view:{addStorey:"Ajouter un Étage",addFile:"Ajouter un fichier",addPlan:"Ajouter un plan"},storeyForm:{title:"Nouvel étage",input:"Nom",error:"Nom invalide"}},FileManager:{creationFormTitle:"Créer un dossier",renameFormPlaceholder:"Nom du fichier/dosier",nameInputPlaceholder:"Nom du dossier",emptyFolder:"Ce dossier est vide",newFolderSuccess:"Nouveau dossier créé",renameFolderSuccess:"Dossier renommé",deleteFolderSuccess:"Dossier supprimé",newFileSuccess:"Fichier ajouté",renameFileSuccess:"Fichier renommé",deleteFileSuccess:"Fichier supprimé",nameInputErrorMessage:"Nom invalide",buttonText:"Nouveau dossier",addFileButtonText:"Charger un fichier",deleteTitle:"Supression de fichiers",deleteDetail:"Vous êtes sur le point de supprimer définitivement les fichiers/dossiers suivants",dmsRoot:"Racine de la GED du projet",pdfPageSelectorTitle:"Sélectionner une page"},MetaBuildingStructure:{title:"Structure Méta-Building",tab:{structure:"Structure",zones:"Zones",equipments:"Équipements"},StoreySelector:{placeholder:"Sélectionner un étage"}},PhotosphereBuilding:{title:"Photosphère Building"}},it:{BuildingMaker:{title:"Building Maker",back:"Reso",list:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",createButton:"Nuovo progetto",updateButton:"Rinominare",deleteButton:"Eliminare"},form:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",input:"Nome della costruzione",error:"Nome non corretto",createButton:"Creare",updateButton:"Convalidare"},view:{addStoreyButton:"Piano",addPlanButton:"Mappa",closeButton:"Finire",submitFilesButton:"Convalidare"},storeyForm:{title:"Nuovo piano",input:"Nome",error:"Nome non corretto",cancelButton:"Annullare",submitButton:"Convalidare"}},FileManager:{creationFormTitle:"Crea una cartella",renameFormPlaceholder:"Nome file/cartella",nameInputPlaceholder:"Nome della cartella",emptyFolder:"Questa cartella è vuota",newFolderSuccess:"Nuova cartella creata",renameFolderSuccess:"Cartella rinominata",deleteFolderSuccess:"Cartella eliminata",newFileSuccess:"File aggiunto",renameFileSuccess:"File rinominato",deleteFileSuccess:"File cancellato",nameInputErrorMessage:"Nome non valido",cancel:"Annulla",submit:"Invia",buttonText:"Nuova cartella",addFileButtonText:"Carica un file",rename:"Rinominare",view:"Vedere",download:"Scaricare",delete:"Cancellare",deleteTitle:"Eliminazione di file",deleteDetail:"Stai per eliminare definitivamente i seguenti file/cartelle"}}},eWt=({i18nPlugin:i}={})=>({install(e){i?Object.entries($Jt).forEach(([t,n])=>{i.global.mergeLocaleMessage(t,n)}):console.warn("[BIMData Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(kSt).forEach(([t,n])=>{e.component(t,n)})}}),tWt=Object.freeze(Object.defineProperty({__proto__:null,BIMDataClickAway:Ya,BIMDataClickInputAway:{beforeMount(i,e){if(typeof e.value!="function")throw Error(`click away directive needs function, got ${typeof e.value}`);i.clickAwayHandler=t=>{(t.path||t.composedPath&&t.composedPath()).find(o=>o===i)||e.value()},window.addEventListener("mousedown",i.clickAwayHandler,!0)},unmounted(i){window.removeEventListener("mousedown",i.clickAwayHandler,!0),delete i.clickAwayHandler}}},Symbol.toStringTag,{value:"Module"})),iWt=i=>({install(e){Object.entries(xQe).forEach(([t,n])=>{e.component(t,n)}),Object.entries(tWt).forEach(([t,n])=>e.directive(t.split("BIMData")[1],n))}}),nWt={name:"LiWrapper",render(){return Jn("li",this.$slots.default())}};function oWt(i,e){var t=new Set([]);return i.forEach(n=>{e.has(n)||t.add(n)}),t}const Sl=$o("id"),sWt=({contextMenu:i,objects:e=[],state:t=i.$viewer.state,pictos:n})=>[{name:"selectAll",get group(){return i.groupPositions.select},position:1,get label(){return i.$t("context_menu.select_all")},get picto(){return n.get(this.name)},execute:()=>t.selectObjects(e.filter(Fa(Ii("visible"),Ad("selected"))).map(Sl)),predicate:()=>e.some(Fa(Ii("visible"),Ad("selected")))},{name:"deselectAll",get group(){return i.groupPositions.select},position:2,get label(){return i.$t("context_menu.deselect_all")},get picto(){return n.get(this.name)},execute:()=>t.deselectObjects(e.filter(Ii("selected")).map(Sl)),predicate:()=>e.some(Ii("selected"))},{name:"selectSimilar",get group(){return i.groupPositions.select},position:3,get label(){return i.$t("context_menu.select_similar")},get picto(){return n.get(this.name)},execute(){const o=e.filter(r=>r.visible&&r.type===this.selectedObject.type&&r.id!==this.selectedObject.id).map(Sl);t.selectObjects(o)},selectedObject:null,predicate(){const o=e.filter(Fa(Ii("visible"),Ii("selected")));return o.length===1&&o[0].type!==void 0?(this.selectedObject=o[0],!0):(this.selectedObject=null,!1)}},{name:"reverseSelection",get label(){return i.$t("context_menu.reverse_selection")},get group(){return i.groupPositions.select},position:4,execute:()=>{const o=new Set(e.filter(Ii("selected")).map(Sl)),r=new Set(e.filter(Ii("visible")).map(Sl));t.selectObjects(Array.from(oWt(r,o)),{exclusive:!0})},predicate:()=>e.some(Fa(Ad("selected"),Ii("visible")))&&e.some(Fa(Ii("selected"),Ii("visible")))},{name:"showAll",get group(){return i.groupPositions.visibility},position:1,get label(){return i.$t("context_menu.show_all")},get picto(){return n.get(this.name)},execute:()=>t.showObjects(e.filter(Ad("visible")).map(Sl)),predicate:()=>e.some(Ad("visible"))},{name:"hide",get group(){return i.groupPositions.visibility},position:2,get label(){return i.$t("context_menu.hide")},get picto(){return n.get(this.name)},objectsToHide:null,execute(){const o=this.objectsToHide.filter(Ii("selected"));o.length>0&&t.deselectObjects(o.map(Sl)),t.hideObjects(this.objectsToHide.map(Sl))},predicate(){return this.objectsToHide=e.filter(Fa(Ii("selected"),Ii("visible"))),this.objectsToHide.length>0}},{name:"hideAll",get group(){return i.groupPositions.visibility},position:3,get label(){return i.$t("context_menu.hide_all")},execute:()=>{const o=e.filter(Ii("visible"));o.some(Ii("selected"))&&t.deselectObjects(o.filter(Ii("selected")).map(Sl)),t.hideObjects(o.map(Sl))},predicate:()=>e.some(Ii("visible"))}].filter(o=>o.predicate()),rWt={components:{LiWrapper:nWt},inject:["$viewer"],data(){return{defaultPrevented:!1,displayed:!1,top:null,bottom:null,left:null,width:200,nextCommandId:1,currentCommands:[],contextCommands:[],registeredCommands:[],groupPositions:{select:10,visibility:20},asyncPredicateRunning:!1}},computed:{position(){return{top:this.top?this.top+"px":"unset",bottom:this.bottom?this.bottom+"px":"unset",left:this.left+"px",width:this.width+"px"}}},watch:{displayed(i){i?document.addEventListener("keydown",this.onKeyDown):document.removeEventListener("keydown",this.onKeyDown)}},created(){this.$viewer.contextMenu=this,this.asyncPredicates=new Set},methods:{onKeyDown(i){i.key==="Escape"&&this.away()},setPosition(i){const t=(document.fullscreenElement?document.fullscreenElement:this.$parent.$el).getBoundingClientRect();this.left=i.clientX-t.left,this.top=i.clientY-t.top,this.left+this.width>t.width&&(this.left=this.left-this.width),i.clientY>t.top+t.height/2?(this.bottom=t.height-this.top,this.top=null):this.bottom=null},typeCheckCommand(i={}){let e=null;if((!i.execute||typeof i.execute!="function")&!i.component&&(e="Cannot register context menu command. A command must have an execute function or a component property."),i.label||(e="Cannot register context menu command. A command must have a label."),e)throw console.error(e),new Error(e);return i.id=this.nextCommandId++,i},open(i){this.currentCommands=[],this.setPosition(i),this.originEvent=i,i.preventDefault(),this.setCurrentCommands(),this.groupCurrentCommands(),this.defaultPrevented=!1,this.displayed=!0,document.fullscreenElement?(this.$el.parentElement.removeChild(this.$el),this.adoptiveParent=document.fullscreenElement,this.adoptiveParent.appendChild(this.$el)):this.adoptiveParent&&this.adoptiveParent!==this.$viewer.globalContext.el&&(this.adoptiveParent.removeChild(this.$el),this.$viewer.globalContext.el.appendChild(this.$el),this.adoptiveParent=null)},setCurrentCommands(){this.asyncPredicates.clear(),this.asyncPredicateRunning=!1,this.defaultPrevented||this.registeredCommands.forEach(async i=>{if(typeof i.predicate=="function"){const e=i.predicate(this.$viewer.globalContext.activeLocalContext);if(e===!0)this.currentCommands.push(i);else if(typeof e?.then=="function"){this.asyncPredicates.add(e),this.asyncPredicateRunning=!0;const t=await e;this.asyncPredicates.has(e)&&(this.asyncPredicates.delete(e),this.asyncPredicateRunning=this.asyncPredicates.size>0,t===!0&&this.currentCommands.push(i))}}else this.currentCommands.push(i)}),this.currentCommands.push(...this.contextCommands),this.contextCommands=[]},getDefaultCommands({objects:i=[],state:e=this.$viewer.state,context:t=null}){const n=new Map;return t&&this.$viewer.shortcutManager.getShortcuts(t).forEach(o=>n.set(o.name,o.key)),sWt({contextMenu:this,objects:i,state:e,pictos:n})},executeCommand(i){if(i.execute&&(i.execute(this.originEvent),this.displayed=!1),i.component&&!i.menu)throw new Error("Command with component property must have a `menu` property")},away(){this.displayed=!1},groupCurrentCommands(){const i=new Map;this.currentCommands.forEach(n=>{(n.group===null||n.group===void 0)&&(n.group=0),i.has(n.group)?i.get(n.group).push(n):i.set(n.group,[n])}),i.forEach(n=>n.sort((o,r)=>(o.position=o.position||0,r.position=r.position||0,o.position-r.position)));const t=[...i.keys()].sort((n,o)=>n-o).map(n=>i.get(n)).flat();this.currentCommands=t},isGroupIntersection(i){if(i===0)return!1;const e=this.currentCommands[i-1],t=this.currentCommands[i];return e.group<t.group},registerContextCommand(i){const e=this.typeCheckCommand(i);return this.contextCommands.push(e),i.id},registerCommand(i){const e=this.typeCheckCommand(i);return this.registeredCommands.push(e),i.id},unregisterCommand(i){return this.registeredCommands.find(e=>e.id===i)?(this.registeredCommands=this.registeredCommands.filter(e=>e.id!==i),!0):!1},preventDefault(){this.defaultPrevented=!0}}},aWt={key:0,class:"separator"},lWt={class:"menu-text"},cWt={key:1,class:"menu-picto"},uWt={key:0,class:"context-menu__spinner"};function dWt(i,e,t,n,o,r){const s=T("BIMDataIconChevron"),a=T("LiWrapper"),l=T("BIMDataSpinner"),c=ui("click-away");return o.displayed&&(o.currentCommands.length||o.asyncPredicateRunning)?vt((B(),F("ul",{key:0,class:"bimdata-list context-menu",style:ue(r.position)},[(B(!0),F(it,null,It(o.currentCommands,(u,d)=>(B(),K(a,{key:u.label,class:"context-menu__element",onClick:h=>r.executeCommand(u)},{default:N(()=>[r.isGroupIntersection(d)?(B(),F("div",aWt)):oe("",!0),C("div",lWt,Q(u.label),1),!u.component&&u.picto?(B(),F("span",cWt,Q(u.picto),1)):u.component?(B(),K(s,{key:2,size:"xxs",class:"fill-primary"})):oe("",!0)]),_:2},1032,["onClick"]))),128)),o.asyncPredicateRunning?(B(),F("li",uWt,[k(l)])):oe("",!0)],4)),[[c,r.away]]):oe("",!0)}const hWt=H(rWt,[["render",dWt],["__scopeId","data-v-5b87d4a3"]]),pWt={name:"ViewerHeader",inject:["$viewer"],props:{visible:{type:Boolean,default:!0}},setup(){const i=ut("$viewer"),e=ns(new Map),t=o=>{if(!o.name)throw new TypeError("[Viewer Header] Content must have a name");if(e.has(o.name))throw new Error(`[Viewer Header] Content with name ${o.name} already exists`);e.set(o.name,o)},n=o=>e.has(o)?(e.delete(o),!0):!1;return{logo:i.uiSettings.bimdataLogo!==!1,version:i.uiSettings.version!==!1?i.version:null,headerContent:e,headerRightContentComponents:Fe(()=>Array.from(e.values()).filter(o=>o.position==="right").sort((o,r)=>o.order-r.order).map(o=>o.component)),headerLeftContentComponents:Fe(()=>Array.from(e.values()).filter(o=>o.position==="left").sort((o,r)=>o.order-r.order).map(o=>o.component)),addContent:t,removeContent:n}}},fWt={class:"viewer-header"},AWt={class:"viewer-header__content"},mWt={class:"viewer-header__content__left"},gWt={class:"viewer-header__content__right"},vWt={key:0,class:"m-l-6 flex items-center"},yWt={key:1,class:"viewer-header__version"};function wWt(i,e,t,n,o,r){const s=T("BIMDataIllustration");return vt((B(),F("div",fWt,[C("div",AWt,[C("div",mWt,[(B(!0),F(it,null,It(n.headerLeftContentComponents,a=>(B(),K(Sn(a),{key:a.name}))),128))]),C("div",gWt,[(B(!0),F(it,null,It(n.headerRightContentComponents,a=>(B(),K(Sn(a),{key:a.name}))),128))])]),n.logo||n.version?(B(),F("div",vWt,[n.logo?(B(),K(s,{key:0,name:"logo",width:"30px",height:"30px"})):oe("",!0),n.version?(B(),F("div",yWt,Q(n.version),1)):oe("",!0)])):oe("",!0)],512)),[[Gt,t.visible]])}const CWt=H(pWt,[["render",wWt],["__scopeId","data-v-5c9ea6b6"]]),bWt={emits:["resize"],setup(i,{emit:e}){return{onResizerMousedown:n=>{n.preventDefault();let o=n.clientX;const r=a=>{a.preventDefault();const l=a.clientX-o;o=a.clientX,e("resize",l)},s=a=>{a.preventDefault(),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",s)};window.addEventListener("mousemove",r),window.addEventListener("mouseup",s)}}}},xWt={class:"bimdata-separator"};function MWt(i,e,t,n,o,r){return B(),F("div",xWt,[e[1]||(e[1]=C("div",{class:"bimdata-separator__line"},null,-1)),C("div",{class:"bimdata-separator__resizer",onMousedown:e[0]||(e[0]=(...s)=>n.onResizerMousedown&&n.onResizerMousedown(...s))},null,32)])}const BWt={components:{Separator:H(bWt,[["render",MWt],["__scopeId","data-v-79a3b3af"]])},props:{position:{type:String,required:!0,validator(i){return["left","right"].includes(i)}},sidePanel:{type:Object,required:!0,validator(i){if(i.width&&(typeof i.width!="number"||i.width<0))return console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof i.width}`),!1;const e=typeof i?.component=="object";return e||console.error("[GlobalSidePanel] sidePanel must have a component property"),e}}},setup(i){const e=pe(null),t=pe(i.sidePanel.width??400),n=(o,r=1)=>{const s=t.value+o*r;t.value=Math.max(0,s)};return dt(()=>i.sidePanel,()=>{Object.defineProperty(i.sidePanel,"width",{get(){return t.value},set(o){if(typeof o!="number"||o<=0){console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof o}`);return}t.value=o}}),Object.defineProperty(i.sidePanel,"componentInstance",{get(){return e.value},enumerable:!0})},{immediate:!0}),{componentInstance:e,width:t,onResize:n}}},EWt={class:"bimdata-global-side-panel__component"};function IWt(i,e,t,n,o,r){const s=T("Separator");return B(),F("div",{class:"bimdata-global-side-panel",style:ue(`width: ${n.width}px`)},[t.sidePanel.resizable&&t.position==="right"?(B(),K(s,{key:0,onResize:e[0]||(e[0]=a=>n.onResize(a,-1))})):oe("",!0),C("div",EWt,[(B(),K(Sn(t.sidePanel.component),{ref:"componentInstance"},null,512))]),t.sidePanel.resizable&&t.position==="left"?(B(),K(s,{key:1,onResize:e[1]||(e[1]=a=>n.onResize(a))})):oe("",!0)],4)}const SWt={name:"BimdataViewer",components:{ContextMenu:hWt,ViewerHeader:CWt,ModalManager:z1e,GlobalSidePanel:H(BWt,[["render",IWt],["__scopeId","data-v-82d0d4cb"]])},setup(){const i=ut("$viewer"),{globalContext:e,shortcutManager:t}=i;ki(()=>{t&&t.destroy(),e.hub.clear()}),ci(()=>{i.pluginManager.runPluginsScripts(i)});const n=Fe(()=>i.uiSettings.bimdataLogo!==!1&&(e.localContexts.length!==1||e.localContexts[0].window?.logoAndVersion)),o=Fe(()=>i.uiSettings.version!==!1&&(e.localContexts.length!==1||e.localContexts[0].window?.logoAndVersion)?i.version:null),r=Fe(()=>e.leftSidePanel),s=Fe(()=>e.rightSidePanel),a=Fe(()=>{const p=i.uiSettings.header!==!1,A=e.localContexts.length===1&&e.localContexts[0].window?.header===!1,f=!!(r.value||s.value);return p&&(!A||f)}),l=i.uiSettings.contextMenu!==!1,c=pe(null);function u(p){l&&c.value.open(p)}function d(){i.shortcutManager.active=!0}function h(){i.shortcutManager.active=!1}return{Layout:i.layout.areas.component,onContextMenu:u,onMouseenter:d,onMouseleave:h,isHeaderVisible:a,viewerTemplateRef:e.templateRef,modalManagerTemplateRef:e.modalManagerTemplateRef,headerTemplateRef:e.headerTemplateRef,contextMenuTemplateRef:c,contextMenuEnabled:l,bimdataLogoOnSingleWindow:n,viewerVersionOnSingleWindow:o,version:i.version,loading:Fe(()=>e.loading),spinner:Fe(()=>e.spinner),leftSidePanel:r,rightSidePanel:s}}},PWt={key:1,class:"bimdata-context-loading-overlay",style:{"z-index":"3"}},TWt={key:2,class:"viewer__logo"},kWt={key:1,class:"version m-t-6"};function RWt(i,e,t,n,o,r){const s=T("ModalManager"),a=T("ContextMenu"),l=T("ViewerHeader"),c=T("GlobalSidePanel"),u=T("BIMDataSpinner"),d=T("BIMDataIllustration");return B(),F("div",{id:"bimdata-viewer",ref:"viewerTemplateRef",class:"bimdata-viewer bimdata-design-system bimdata-scrollbar",onContextmenu:e[0]||(e[0]=(...h)=>n.onContextMenu&&n.onContextMenu(...h)),onMouseenter:e[1]||(e[1]=(...h)=>n.onMouseenter&&n.onMouseenter(...h)),onMouseleave:e[2]||(e[2]=(...h)=>n.onMouseleave&&n.onMouseleave(...h))},[k(s,{ref:"modalManagerTemplateRef"},null,512),n.contextMenuEnabled?(B(),K(a,{key:0,ref:"contextMenuTemplateRef"},null,512)):oe("",!0),k(l,{ref:"headerTemplateRef",visible:n.isHeaderVisible},null,8,["visible"]),C("div",{class:"bimdata-viewer__content",style:ue(n.isHeaderVisible?"height: calc(100% - var(--bimdata-viewer-header-height, 40px))":"height: 100%")},[n.leftSidePanel?(B(),K(c,{key:0,"side-panel":n.leftSidePanel,position:"left"},null,8,["side-panel"])):oe("",!0),(B(),K(Sn(n.Layout),{style:"height: 100%; flex-grow: 1;"})),n.rightSidePanel?(B(),K(c,{key:1,"side-panel":n.rightSidePanel,position:"right"},null,8,["side-panel"])):oe("",!0)],4),n.loading?(B(),F("div",PWt,[n.spinner&&n.spinner.component?(B(),K(Sn(n.spinner.component),Rr(xs({key:0},n.spinner.props)),null,16)):(B(),K(u,{key:1,size:"40px",border:"5px"}))])):oe("",!0),!n.isHeaderVisible&&(n.bimdataLogoOnSingleWindow||n.viewerVersionOnSingleWindow)?(B(),F("div",TWt,[n.bimdataLogoOnSingleWindow?(B(),K(d,{key:0,name:"logo"})):oe("",!0),n.viewerVersionOnSingleWindow?(B(),F("div",kWt,Q(n.version),1)):oe("",!0)])):oe("",!0)],544)}const DWt=H(SWt,[["render",RWt],["__scopeId","data-v-0c1c941a"]]),_Wt=["src"],LWt={class:"bimdata-models__header"},FWt={key:0,class:"bimdata-models__header__loader"},OWt={class:"bimdata-models__header__picto"},UWt={class:"bimdata-models__header__name"},NWt={key:0,class:"bimdata-models__header__name--empty"},VWt={key:1,class:"bimdata-models__header__name--empty"},HWt={key:3},zWt=["onMousemove","onClick"],K1e=H({__name:"Models",props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:"350px"}},setup(i){const e=i,t=ut("$viewer"),n=pe(),o=pe(0),r=pe(0),s=pe(),a=Ci([]),l=pe(!1),c=Fe(()=>t.localContext.loadedModels),u=Fe(()=>t.localContext.loadedModelIds),d=Fe(()=>t.localContext.loadingModelIds),h=Fe(()=>t.localContext.multiModel),p=Fe(()=>(e.customFilter?a.value.filter(e.customFilter):a.value).map(E=>c.value.find(S=>S.document?.head_id!=null&&S.document.head_id===E.document.id)??E)),A=M=>u.value.includes(M),f=M=>d.value.includes(M),g=Fe(()=>{const{x:M,y:E}=s.value?.getBoundingClientRect()??{x:0,y:0};return`top:${r.value-E}px; left:${o.value-M}px;`}),m=M=>{!h.value&&A(M.id)||d.value.length>0||(t.localContext.loadedModelIds.includes(M.id)?t.localContext.unloadModels([M.id]):t.localContext.loadModels([M.id]))},w=M=>{switch(M){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},v=(M,E)=>{M?.viewer_360_file&&(o.value=E.clientX,r.value=E.clientY),n.value=M?.viewer_360_file},y=async M=>{l.value=!0;try{return(await t.api.apiClient.modelApi.getModels(t.api.cloudId,t.api.projectId,void 0,void 0,M)).filter(S=>t.state.models.some(I=>I.archived)||!S.archived).sort(il("updated_at",!1))}catch(E){console.error("[Models] Cannot get project models. Error: ",E)}finally{l.value=!1}return[]},x=M=>M.children?.some(E=>A(E.id))??!1;return y(t.localContext.modelTypes).then(M=>{a.value=M}),(M,E)=>{const S=T("BIMDataSpinner"),I=T("BIMDataIconModel3D"),R=T("BIMDataTextbox"),P=T("BIMDataCheckbox"),D=T("BIMDataRadio"),L=T("BIMDataIcon"),U=T("BIMDataDropdownList");return B(),F("div",{ref_key:"templateRef",ref:s,class:le(["bimdata-models",{"bimdata-models--window-positioning":i.windowPositioning}])},[n.value?(B(),F("div",{key:0,class:"bimdata-models__preview",style:ue(g.value)},[C("img",{src:n.value},null,8,_Wt)],4)):oe("",!0),k(U,{style:ue(`--bimdata-models-width: ${i.width};`),width:i.width,list:p.value,"element-key":"id","per-page":40,loading:l.value,class:"bimdata-models__list",disabled:p.value.length===0,onElementClick:m},{header:N(({isOpen:z})=>[C("div",LWt,[l.value||d.value.length>0?(B(),F("div",FWt,[k(S)])):(B(),F(it,{key:1},[C("div",OWt,[k(I)]),C("div",{class:le(["bimdata-models__header__number bimdata-info-length",{"bimdata-models__header__number--empty":u.value.length===0}])},[C("span",null,Q(u.value.length),1)],2),C("div",UWt,[p.value.length===0?(B(),F("span",NWt,Q(M.$t("model.no_model")),1)):u.value.length===0?(B(),F("span",VWt,Q(M.$t("model.no_loaded_model")),1)):u.value.length===1?(B(),K(R,{key:2,text:c.value[0].name,tooltip:!z},null,8,["text","tooltip"])):u.value.length>1?(B(),F("span",HWt,Q(M.$t("model.selected_models")),1)):oe("",!0)])],64))])]),element:N(({element:z,close:j})=>[C("div",{class:"bimdata-models__model",onMousemove:Z=>i.preview&&v(z,Z),onMouseout:E[0]||(E[0]=Z=>i.preview&&v()),onClick:()=>{!h.value&&!A(z.id)&&j()}},[h.value?(B(),K(P,{key:0,"model-value":A(z.id)||x(z),disabled:z.status!=="C"||d.value.length>0},null,8,["model-value","disabled"])):(B(),K(D,{key:1,"model-value":A(z.id)||x(z),disabled:z.status!=="C"||d.value.length>0},null,8,["model-value","disabled"])),k(L,{margin:"0 calc(var(--spacing-unit) / 2)",name:w(z.status),size:"xs",class:le({"fill-success":z.status==="C","fill-high":z.status==="E"})},null,8,["name","class"]),k(R,{class:le({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":z.status!=="C"||d.value.length>0}),text:z.name,width:`calc(100% -
|
|
5547
|
+
`),onMouseenter:e[0]||(e[0]=(...h)=>n.onMouseEnter&&n.onMouseEnter(...h)),onMouseleave:e[1]||(e[1]=(...h)=>n.onMouseLeave&&n.onMouseLeave(...h))},[k(s,{ref:"modalManagerTemplateRef"},null,512),C("div",UJt,[n.windowPlugins.leftSidePanel?(B(),K(a,{key:0,plugin:n.windowPlugins.leftSidePanel},null,8,["plugin"])):oe("",!0),C("div",NJt,[(B(!0),F(it,null,It(n.windowPlugins.free,h=>(B(),K(l,{key:h.name,class:le({"window-container__content__center__viewer":h.isViewer}),plugin:h},null,8,["class","plugin"]))),128)),k(c,{position:"left",plugins:n.windowPlugins.leftButtonColumn},null,8,["plugins"]),k(c,{position:"right",plugins:n.windowPlugins.rightButtonColumn},null,8,["plugins"])]),n.windowPlugins.rightSidePanel?(B(),K(a,{key:1,plugin:n.windowPlugins.rightSidePanel},null,8,["plugin"])):oe("",!0)]),n.loading?(B(),F("div",VJt,[n.spinner&&n.spinner.component?(B(),K(Sn(n.spinner.component),Rr(xs({key:0},n.spinner.props)),null,16)):(B(),K(u,{key:1,size:"20px",border:"3px"}))])):oe("",!0),n.layoutSettingsDisplayed?(B(),F("div",HJt,[k(d)])):oe("",!0)],36)}const jJt=H(OJt,[["render",zJt],["__scopeId","data-v-3ed35f9c"]]);class GJt{constructor(e=!0){const t=_Kt(PH,null,{resizable:e});t.registerContent("default",jJt),this.settings=ns({edit:!1,swap:!1,full:!1}),this.areas=t}get resizable(){return this.areas.resizable}set resizable(e){this.areas.resizable=e}apply(e=null){this.areas.layout=e?LKt(e):null}copy(e,t=!0){return FKt(this.areas.layout,e,t)}open({ratio:e,direction:t,insertAfter:n,windowName:o=null,windowState:r=null,localContextId:s=null}={}){const a=o?{options:{windowName:o,windowState:r}}:null;return s===null?this.areas.splitLayout(e,t,n,a):this.areas.split(s,e,t,n,a)}swap(e,t){return this.areas.swap(e,t)}close(e){return this.areas.delete(e)}compare(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;if(typeof e=="string"&&typeof t=="string")return e===t;if(typeof e=="string"||typeof t=="string")return!1;if(e.windowName&&t.windowName){if(e.windowName!==t.windowName)return!1;const n=new Set(e.windowState?.modelIds),o=new Set(t.windowState?.modelIds);return n.size===o.size&&[...n].every(s=>o.has(s))}return e.windowName||t.windowName||e.direction!==t.direction||e.children.length!==t.children.length?!1:e.children.every((n,o)=>this.compare(n,t.children[o]))}}const QJt={version:"2.14.0-beta.3"};let qJt=1;class KJt{constructor({plugins:e,api:t,ui:n,locale:o="fr"}){this.instanceId=qJt++,this.pluginManager=new nGt(e),this.windowManager=new sGt,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new zqt(t),this.globalContext=new T5e(this),this.state=$qt(this),this.shortcutManager=h0e(this.state),this.uiSettings=n||{},this.i18n=new S5e(o),this._contextMenu=null,this.layout=new GJt(this.uiSettings.resizable!==!1),this._darkTheme=pe(n?.darkTheme??!1),this.localContext=null,window.$viewer=this}get darkTheme(){return this._darkTheme.value}set darkTheme(e){this._darkTheme.value=e}get version(){return QJt.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||u0e}set contextMenu(e){this._contextMenu=e}get registeredWindows(){return[...this.windowManager.registeredWindows.keys()]}get registeredPlugins(){return[...this.pluginManager.registeredPlugins.keys()]}get pluginsCfg(){return this.pluginManager.cfg}registerPlugin(e){this.pluginManager.registerPlugin(e),this.windowManager.registerAndAddPluginsToWindows([e])}}function JJt(i,e={}){e.backgroundColor&&(i.style.setProperty("--bimdata-viewer-background-color",e.backgroundColor),e.backgroundColor==="transparent"&&i.style.setProperty("--areas-separator-color","transparent")),e.colorPrimary&&i.style.setProperty("--color-primary",e.colorPrimary),e.colorPrimaryLighter&&i.style.setProperty("--color-primary-lighter",e.colorPrimaryLighter),e.colorPrimaryLight&&i.style.setProperty("--color-primary-light",e.colorPrimaryLight),e.colorPrimaryDark&&i.style.setProperty("--color-primary-dark",e.colorPrimaryDark),e.colorSecondary&&i.style.setProperty("--color-secondary",e.colorSecondary),e.colorSecondaryLighter&&i.style.setProperty("--color-secondary-lighter",e.colorSecondaryLighter),e.colorSecondaryLight&&i.style.setProperty("--color-secondary-light",e.colorSecondaryLight),e.colorSecondaryDark&&i.style.setProperty("--color-secondary-dark",e.colorSecondaryDark),e.colorSilverLight&&i.style.setProperty("--color-silver-light",e.colorSilverLight),e.colorSilver&&i.style.setProperty("--color-silver",e.colorSilver),e.colorSilverDark&&i.style.setProperty("--color-silver-dark",e.colorSilverDark),e.colorGraniteLight&&i.style.setProperty("--color-granite-light",e.colorGraniteLight),e.colorGranite&&i.style.setProperty("--color-granite",e.colorGranite),e.colorSuccess&&i.style.setProperty("--color-success",e.colorSuccess),e.colorSuccessLighter&&i.style.setProperty("--color-success-Lighter",e.colorSuccessLighter),e.colorSuccessLight&&i.style.setProperty("--color-success-Light",e.colorSuccessLight),e.colorSuccessDark&&i.style.setProperty("--color-success-Dark",e.colorSuccessDark),e.colorWarning&&i.style.setProperty("--color-warning",e.colorWarning),e.colorWarningLighter&&i.style.setProperty("--color-warning-Lighter",e.colorWarningLighter),e.colorWarningLight&&i.style.setProperty("--color-warning-Light",e.colorWarningLight),e.colorWarningDark&&i.style.setProperty("--color-warning-Dark",e.colorWarningDark),e.colorHigh&&i.style.setProperty("--color-high",e.colorHigh),e.colorHighLighter&&i.style.setProperty("--color-high-lighter",e.colorHighLighter),e.colorHighLight&&i.style.setProperty("--color-high-light",e.colorHighLight),e.colorHighDark&&i.style.setProperty("--color-high-dark",e.colorHighDark),e.colorText&&i.style.setProperty("--color-text",e.colorText),(!e.backgroundColor||e.backgroundColor!=="transparent")&&i.style.setProperty("--areas-separator-color","rgba(216, 216, 216, 1)"),e.headerHeight!=null&&i.style.setProperty("--bimdata-viewer-header-height",e.headerHeight),i.style.setProperty("--areas-background-color","transparent")}const WJt=Object.freeze({25:"GUEST",50:"USER",100:"ADMIN"}),Km=Object.freeze({READ:"read",WRITE:"write"});function Q1e(i){const e={};return i.forEach(t=>{const[n,o]=t.split(":");e[n]?e[n].push(o):e[n]=[o]}),e}const ZJt={token_scopes:[],usable_scopes:[],user_role:25};function q1e(i=ZJt){const e=Q1e(i.token_scopes),t=Q1e(i.usable_scopes);return{...Iq(i),tokenScopes:e,usableScopes:t,userRole:WJt[i.user_role],user:i.user?Iq(i.user):null,hasBcfReadPermission:t.bcf?.includes(Km.READ)??!1,hasBcfWritePermission:t.bcf?.includes(Km.WRITE)??!1,hasModelReadPermission:t.model?.includes(Km.READ)??!1,hasModelWritePermission:t.model?.includes(Km.WRITE)??!1,hasDocReadPermission:t.document?.includes(Km.READ)??!1,hasDocWritePermission:t.document?.includes(Km.WRITE)??!1}}const YJt={de:{BcfComponents:{back:"Zurück",BcfFilters:{filtersButton:"Filter",filtersTitle:"Filter",priorityLabel:"Priorität",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",creatorsLabel:"Erstellt von",tagsLabel:"Tags",resetButton:"Zurücksetzen",searchButton:"Suchen",undefined:"Nicht definiert",datePlaceholder:"Erstellungsdatum"},BcfSettings:{title:"BCF-Parameter",text:"Erstellen, füllen und listen Sie die BCF-Einstellungen auf, die Sie für dieses Projekt haben möchten.",validateButton:"Die BCF-Parameter anerkennen"},BcfStatistics:{emptyText:"Fügen Sie Fragen hinzu, um zugehörige Statistiken hier anzuzeigen.",issues:"Probleme",extension:{Priority:"Priorität",PriorityNotDefined:"Keine Priorität",PriorityTitle:"Prioritäten",Status:"Status",StatusNotDefined:"Kein Status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priorität",noPriority:"Keine",assignedTo:"Zugewiesen an",elements:"Elemente",notSpecified:"Nicht definiert",see:"Anzeigen"},BcfTopicCreationCard:{text:"Ein neues BCF-Thema erstellen",createBcfSideTitle:"Ein Problem melden"},BcfTopicForm:{dragDropImageText:"Bitte wählen Sie eine Datei aus.",addObjectButton:"Objekt",addAnnotationButton:"Annotation",annotationButtonTooltip:"Zu diesem Thema gibt es derzeit keine Ansichten.",addPictureButton:"Fügen Sie ein Bild hinzu.",titlePlaceholder:"Titel *",titleErrorMessage:"Titel fehlt",typeLabel:"Typ",priorityLabel:"Priorität",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",dueDateLabel:"Fälligkeitsdatum (TT.MM.JJJJ)",descriptionLabel:"Beschreibung",labelsLabel:"Tags",createButton:"Bestätigen",updateButton:"Änderungen übernehmen",modalText:"Sie sind dabei, die Bearbeitung der Ausgabe {Name} zu beenden, aber es gibt noch ungespeicherte Änderungen.",cancelButton:"Änderungen verwerfen",continueButton:"Änderungen fortsetzen",createTitle:"Ein Problem melden",dragDropImageTextTablet:"Foto machen",takeSnapshot:"Mach einen Schnappschuss",importFile:"Eine Datei importieren",searchPlaceholder:"Suchen",emptySearch:"kein Ergebnis"},BcfTopicOverview:{openViewer:"Im Viewer öffnen",openViewerNoModels:"Es sind keine Vorlagen zur Ansicht bereit",elements:"{count} Elemente",noElements:"kein Element",type:"Typ",noTypeSpecified:"Kein Typ angegeben",description:"Beschreibung",noDescriptionProvided:"Keine Beschreibung angegeben",assignedTo:"Zugeteilt an",notAssigned:"Nicht zugewiesen",dueDate:"Fälligkeitsdatum",noDueDate:"Kein Fälligkeitsdatum",informations:"Informationen",status:"Status",noStatusSpecified:"Kein Status angegeben",stage:"Phase",noStageProvided:"Keine Phase angegeben",priority:"Priorität",priorityNotDefined:"Nicht definiert",tags:"Tags",noTags:"Keine Tags",commentButton:"Ein Kommentar veröffentlichen",deleteText:"Sie löschen jetzt {Name}",deleteBcfButton:"Dieses BCF löschen",keepBcfButton:"Dieses BCF beibehalten",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Priorität",status:"Status",title:"Titel",creator:"Autor",date:"Datum"}},BcfTopicActionsCell:{seeButton:"Anzeigen"},BcfTopicComments:{commentButton:"Ein Kommentar verfassen",commentLabel:"Ein Kommentar verfassen",commentText:"Kommentar",cancelButton:"Abbrechen",publishButton:"Veröffentlichen",commentsText:"Kommentare",deleteCommentText:"Diesen Kommentar löschen?",deleteButton:"Löschen",takeSnapshot:"Mach einen Schnappschuss"},BcfTopicPriorityCell:{noPriority:"Keine"},SettingCard:{addButton:"ein Element hinzufügen",cancelButton:"Abbrechen",validateButton:"Bestätigen",deleteExtensionText:"Diesen Parameter löschen",deleteButton:"Löschen",title:{Priority:"Prioritäten",Label:"Tags",Status:"Status",Type:"Typen",Stage:"Phasen"},input:{Priority:"Eine neue Priorität hinzufügen",Label:"Ein neues Etikett hinzufügen",Status:"Einen neuen Status hinzufügen",Type:"Einen neuen Typ hinzufügen",Stage:"Eine neue Phase hinzufügen"},text:{Priority:"Liste der Prioritäten",Label:"Liste von Tags",Status:"Liste der Status",Type:"Liste der Typen",Stage:"Liste der Phasen"}}}},en:{BcfComponents:{back:"Back",BcfFilters:{filtersButton:"Filters",filtersTitle:"Filters",priorityLabel:"Priority",statusLabel:"Status",stageLabel:"Stage",assignedToLabel:"Assigned to",creatorsLabel:"Created by",tagsLabel:"Tags",resetButton:"Reset",searchButton:"Search",undefined:"Not defined",datePlaceholder:"Creation date"},BcfSettings:{title:"BCF Settings",text:"Create, enter in, and list the BCF settings you would like to have for this project",validateButton:"Validate BCF settings"},BcfStatistics:{emptyText:"Add BCF Topics to start to have some stats here.",issues:"issues",extension:{Priority:"Priority",PriorityNotDefined:"No priority",PriorityTitle:"Priorities",Status:"Status",StatusNotDefined:"No status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priority",noPriority:"None",assignedTo:"Assigned to",elements:"Elements",notSpecified:"Not specified",see:"See"},BcfTopicCreationCard:{text:"Create a new BCF topic",createBcfSideTitle:"Report a problem"},BcfTopicForm:{dragDropImageText:"Please select a file",addObjectButton:"Object",addAnnotationButton:"Annotation",annotationButtonTooltip:"This topic has no viewpoint",addPictureButton:"Add a picture",titlePlaceholder:"Title *",titleErrorMessage:"Missing title",typeLabel:"Type",priorityLabel:"Priority",statusLabel:"Status",stageLabel:"Stage",assignedToLabel:"Assigned to",dueDateLabel:"Due date",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Validate",updateButton:"Modify this BCF",modalText:"You are about to quit editing issue {name} but there are unsaved changes.",cancelButton:"Discard changes",continueButton:"Continue editing",createTitle:"Report a problem",dragDropImageTextTablet:"Take a picture",takeSnapshot:"Take a snapshot",importFile:"Import a file",searchPlaceholder:"Search",emptySearch:"No result",documentsLabel:"Add a file",documentsCount:"Files - {count} selected files",validateDocuments:"Validate"},BcfTopicOverview:{openViewer:"Open in viewer",openViewerNoModels:"No model to open",elements:"{count} Elements",noElements:"No element",type:"Type",noTypeSpecified:"No type specified",description:"Description",noDescriptionProvided:"No description provided",assignedTo:"Assigned to",notAssigned:"Not assigned",dueDate:"Due date",noDueDate:"No due date",informations:"Informations",status:"Status",noStatusSpecified:"No status specified",stage:"Stage",noStageProvided:"No stage provided",priority:"Priority",priorityNotDefined:"Not defined",tags:"Tags",noTags:"No tags",commentButton:"Post a comment",deleteText:"You are about to delete {name}",deleteBcfButton:"Delete this BCF",keepBcfButton:"Keep this BCF",author:"Author"},BcfTopicsTable:{headers:{index:"#",priority:"Priority",status:"Status",title:"Title",creator:"Author",date:"Date"}},BcfTopicActionsCell:{seeButton:"See"},BcfTopicComments:{commentButton:"Post a comment",commentLabel:"Post a comment",commentText:"Comment",cancelButton:"Cancel",publishButton:"Publish",commentsText:"Comments",deleteCommentText:"Delete this comment ?",deleteButton:"Delete",takeSnapshot:"Take a snapshot",edited:"edited"},BcfTopicPriorityCell:{noPriority:"None"},SettingCard:{addButton:"add an element",cancelButton:"Cancel",validateButton:"Validate",deleteExtensionText:"Remove this setting",deleteButton:"Delete",title:{Priority:"Priorities",Label:"Labels",Status:"Status",Type:"Types",Stage:"Stages"},input:{Priority:"Add a new priority",Label:"Add a new label",Status:"Add new status",Type:"Add a new type",Stage:"Add a new stage"},text:{Priority:"Priority list",Label:"Labels list",Status:"Status list",Type:"Type list",Stage:"Stage list"}}}},es:{BcfComponents:{back:"Volver",BcfFilters:{filtersButton:"Filtros",filtersTitle:"Filtros",priorityLabel:"Prioridad",statusLabel:"Estado",stageLabel:"Fase",assignedToLabel:"Asignado a",creatorsLabel:"Creado por",tagsLabel:"Etiquetas:",resetButton:"Restablecer",searchButton:"Buscar en",undefined:"No definido",datePlaceholder:"Fecha de creación"},BcfSettings:{title:"Parámetros del BCF",text:"Cree, rellene y enumere los parámetros del BCF que desea tener en este proyecto",validateButton:"Validar los parámetros del BCF"},BcfStatistics:{emptyText:"Añada preguntas para ver las estadísticas asociadas aquí.",issues:"problemas",extension:{Priority:"Prioridad",PriorityNotDefined:"Sin prioridad",PriorityTitle:"Prioridades",Status:"Estado",StatusNotDefined:"Sin estado",StatusTitle:"Estatutos"}},BcfTopicCard:{priority:"Prioridad",noPriority:"Sin",assignedTo:"Asignado a",elements:"Elementos",notSpecified:"No definido",see:"Ver"},BcfTopicCreationCard:{text:"Crear un nuevo tema BCF",createBcfSideTitle:"Informar de un problema"},BcfTopicForm:{dragDropImageText:"Seleccione un archivo",addObjectButton:"Objeto",addAnnotationButton:"Anotación",annotationButtonTooltip:"Actualmente este tema no posee ningún punto de vista",addPictureButton:"Añadir una imagen",titlePlaceholder:"Título *",titleErrorMessage:"Falta el título",typeLabel:"Tipo",priorityLabel:"Prioridad",statusLabel:"Estado",stageLabel:"Fase",assignedToLabel:"Asignado a",dueDateLabel:"Fecha de vencimiento (DD/MM/AAAA)",descriptionLabel:"Descripción",labelsLabel:"Etiquetas",createButton:"Validar",updateButton:"Modificar este BCF",modalText:"Está a punto de salir de la edición del problema de {name} pero hay cambios sin guardar.",cancelButton:"Cancelar los cambios",continueButton:"Continuar con los cambios",createTitle:"Informar de un problema",dragDropImageTextTablet:"Tomar una fotografía",takeSnapshot:"Tomar un snapshot",importFile:"Importar un archivo",searchPlaceholder:"Buscar",emptySearch:"No hay resultados"},BcfTopicOverview:{openViewer:"Abrir en el visor",openViewerNoModels:"No hay ningún modelo listo para la visualización",elements:"{count} Elementos",noElements:"Ningún elemento",type:"Tipo",noTypeSpecified:"No se especifica el tipo",description:"Descripción",noDescriptionProvided:"No hay descripción",assignedTo:"Asignado a",notAssigned:"No asignado",dueDate:"Plazo",noDueDate:"Sin fecha de vencimiento",informations:"Información",status:"Estado",noStatusSpecified:"No se especifica el estado",stage:"Fase",noStageProvided:"No se indica ninguna fase",priority:"Prioridad",priorityNotDefined:"No definido",tags:"Etiquetas",noTags:"Sin etiquetas",commentButton:"Publicar un comentario",deleteText:"Estás a punto de borrar {name}",deleteBcfButton:"Borrar este BCF",keepBcfButton:"Mantenga este BCF",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Prioridad",status:"Estado",title:"Título",creator:"Autor",date:"Fecha"}},BcfTopicActionsCell:{seeButton:"Ver"},BcfTopicComments:{commentButton:"Publicar un comentario",commentLabel:"Publicar un comentario",commentText:"Comentario",cancelButton:"Cancelar",publishButton:"Publicar",commentsText:"comentarios",deleteCommentText:"¿Borrar este comentario?",deleteButton:"Borrar",takeSnapshot:"Tomar un snapshot"},BcfTopicPriorityCell:{noPriority:"Sin"},SettingCard:{addButton:"añadir un elemento",cancelButton:"Cancelar",validateButton:"Validar",deleteExtensionText:"Borrar esta configuración",deleteButton:"Borrar",title:{Priority:"Prioridades",Label:"Etiquetas:",Status:"Estatutos",Type:"Tipos",Stage:"Fases"},input:{Priority:"Añadir una nueva prioridad",Label:"Añadir una nueva etiqueta",Status:"Añadir un nuevo estado",Type:"Añadir un nuevo tipo",Stage:"Añadir una nueva fase"},text:{Priority:"Lista de prioridades",Label:"Lista de etiquetas",Status:"Lista de estatutos",Type:"Lista de tipos",Stage:"Lista de fases"}}}},fr:{BcfComponents:{back:"Retour",BcfFilters:{filtersButton:"Filtres",filtersTitle:"Filtres",priorityLabel:"Priorité",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assigné à",creatorsLabel:"Créé par",tagsLabel:"Tags",resetButton:"Réinitialiser",searchButton:"Rechercher",undefined:"Non défini",datePlaceholder:"Date de création"},BcfSettings:{title:"Paramètres BCF",text:"Créez, renseignez et listez les paramètres BCF que vous souhaitez avoir sur ce projet",validateButton:"Valider les paramètres BCF"},BcfStatistics:{emptyText:"Ajoutez des questions pour voir les statistiques associées ici.",issues:"problèmes",extension:{Priority:"Priorité",PriorityNotDefined:"Aucune priorité",PriorityTitle:"Priorités",Status:"Statut",StatusNotDefined:"Aucun statut",StatusTitle:"Statuts"}},BcfTopicCard:{priority:"Priorité",noPriority:"Aucune",assignedTo:"Assigné à",elements:"{n} Élements",notSpecified:"Non défini",see:"Voir"},BcfTopicCreationCard:{text:"Créer un nouveau topic BCF",createBcfSideTitle:"Signaler un problème"},BcfTopicForm:{dragDropImageText:"Veuillez sélectionner un fichier",addObjectButton:"Objet",addAnnotationButton:"Annotation",annotationButtonTooltip:"Ce topic ne possède actuellement aucun point de vue",addPictureButton:"Ajouter une image",titlePlaceholder:"Titre *",titleErrorMessage:"Titre manquant",typeLabel:"Type",priorityLabel:"Priorité",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assigné à",dueDateLabel:"Date d'échéance",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Valider",updateButton:"Modifier ce BCF",modalText:"Vous êtes sur le point de quitter l'édition de l'issue {name} mais il y'a des modifications non enregistrées.",cancelButton:"Annuler les modifications",continueButton:"Continuer les modifications",createTitle:"Signaler un problème",dragDropImageTextTablet:"Prendre une photo",takeSnapshot:"Prendre un snapshot",importFile:"Importer un fichier",searchPlaceholder:"Rechercher",emptySearch:"Pas de résultat",documentsLabel:"Documents",documentsCount:"Documents - {count} documents sélectionnés",validateDocuments:"Valider"},BcfTopicOverview:{openViewer:"Ouvrir dans le viewer",openViewerNoModels:"Il n'y a aucun modèle prêt pour une visualisation",elements:"{count} Élements",noElements:"Aucun élément concerné",type:"Type",noTypeSpecified:"Pas de type spécifié",description:"Description",noDescriptionProvided:"Pas de description renseignée",assignedTo:"Assigné à",notAssigned:"Non assigné",dueDate:"Échéance",noDueDate:"Pas de date d'échéance",informations:"Informations",status:"Statut",noStatusSpecified:"Pas de statut spécifié",stage:"Phase",noStageProvided:"Pas de phase renseignée",priority:"Priorité",priorityNotDefined:"Non défini",tags:"Tags",noTags:"Pas de tags",commentButton:"Poster un commentaire",deleteText:"Vous êtes sur le point de supprimer {name}",deleteBcfButton:"Supprimer ce BCF",keepBcfButton:"Conserver ce BCF",author:"Auteur"},BcfTopicsTable:{headers:{index:"#",priority:"Priorité",status:"Statut",title:"Titre",creator:"Auteur",date:"Date"}},BcfTopicActionsCell:{seeButton:"Voir"},BcfTopicComments:{commentButton:"Poster un commentaire",commentLabel:"Poster un commentaire",commentText:"Commentaire",cancelButton:"Annuler",publishButton:"Publier",commentsText:"commentaires",deleteCommentText:"Supprimer ce commentaire ?",deleteButton:"Supprimer",takeSnapshot:"Prendre un snapshot",edited:"edité"},BcfTopicPriorityCell:{noPriority:"Aucune"},SettingCard:{addButton:"ajouter un élément",cancelButton:"Annuler",validateButton:"Valider",deleteExtensionText:"Supprimmer ce paramètre",deleteButton:"Supprimer",title:{Priority:"Priorités",Label:"Tags",Status:"Statuts",Type:"Types",Stage:"Phases"},input:{Priority:"Ajouter une nouvelle priorité",Label:"Ajouter un nouveau label",Status:"Ajouter un nouveau statut",Type:"Ajouter un nouveau type",Stage:"Ajouter une nouvelle phase"},text:{Priority:"Liste des priorités",Label:"Liste des tags",Status:"Liste des statuts",Type:"Liste des types",Stage:"Liste des phases"}}}},it:{BcfComponents:{back:"Indietro",BcfFilters:{filtersButton:"Filtri",filtersTitle:"Filtri",priorityLabel:"Priorità",statusLabel:"Stato",stageLabel:"Fase",datePlaceholder:"Data di creazione",assignedToLabel:"Assegnato a",creatorsLabel:"Creato da",tagsLabel:"Etichette",resetButton:"Ripristina",searchButton:"Cerca",undefined:"Non definito"},BcfSettings:{title:"Parametri BCF",text:"Creare, notificare e elencare i parametri BCF che si desidera avere su questo progetto",validateButton:"Conferma i parametri BCF"},BcfStatistics:{emptyText:"Aggiungi delle domande per vedere le statistiche associate qui.",issues:"problemi",extension:{Priority:"Priorità",PriorityNotDefined:"Nessuna priorità",PriorityTitle:"Priorità",Status:"Stato",StatusNotDefined:"Nessuno stato",StatusTitle:"Stati"}},BcfTopicCard:{priority:"Priorità",noPriority:"Nessuno",assignedTo:"Assegnato a",elements:"Elementi",noElements:"0 elementi",notSpecified:"Non definito",see:"Visualizza"},BcfTopicCreationCard:{text:"Crea un nuovo topic BCF",createBcfSideTitle:"Segnala un problema"},BcfTopicForm:{dragDropImageText:"Selezionare un file",addObjectButton:"Oggetto",addAnnotationButton:"Annotazione",annotationButtonTooltip:"Attualmente questo argomento non presenta alcun punto di vista",addPictureButton:"Aggiungere un'immagine",titlePlaceholder:"Titolo *",titleErrorMessage:"Titolo mancante",typeLabel:"Tipo",priorityLabel:"Priorità",statusLabel:"Stato",stageLabel:"Fase",assignedToLabel:"Assegnato a",dueDateLabel:"Data di scadenza",descriptionLabel:"Descrizione",labelsLabel:"Tag",createButton:"Conferma",updateButton:"Modificare questo BCF",modalText:"State per abbandonare la modifica di {name} ma ci sono modifiche non salvate.",cancelButton:"Annullare le modifiche",continueButton:"Continuare le modifiche",createTitle:"Segnala un problema"},BcfTopicOverview:{openViewer:"Apri nel visualizzatore",openViewerNoModels:"Non esistono modelli pronti per la visualizzazione",elements:"{count} Elementi",noElements:"Nessun elemento",type:"Tipo",noTypeSpecified:"Nessun tipo specificato",description:"Descrizione",noDescriptionProvided:"Nessuna descrizione inserita",assignedTo:"Assegnato a",notAssigned:"Non assegnato",dueDate:"Scadenza",noDueDate:"Nessuna data di scadenza",informations:"Informazioni",status:"Stato",noStatusSpecified:"Nessuno stato specificato",stage:"Fase",noStageProvided:"Nessuna fase inserita",priority:"Priorità",priorityNotDefined:"Non definita",tags:"Etichette",noTags:"Nessuna etichetta",commentButton:"Pubblica un commento",deleteText:"Stai per eliminare {name}",deleteBcfButton:"Elimina questo BCF",keepBcfButton:"Conserva questo BCF",author:"Autore"},BcfTopicsTable:{headers:{index:"#",priority:"Priorità",status:"Stato",title:"Titolo",creator:"Autore",date:"Data"}},BcfTopicActionsCell:{seeButton:"Visualizza"},BcfTopicComments:{commentButton:"Pubblica un commento",commentLabel:"Pubblica un commento",commentText:"Commento",cancelButton:"Annulla",publishButton:"Pubblica",commentsText:"commenti",deleteCommentText:"Eliminare questo commento?",deleteButton:"Elimina"},BcfTopicPriorityCell:{noPriority:"Nessuno"},SettingCard:{addButton:"aggiungi un elemento",cancelButton:"Annulla",validateButton:"Conferma",deleteExtensionText:"Elimina questo parametro",deleteButton:"Elimina",title:{Priority:"Priorità",Label:"Etichette",Status:"Stati",Type:"Tipi",Stage:"Fasi"},input:{Priority:"Aggiungi una nuova priorità",Label:"Aggiungi una nuova etichetta",Status:"Aggiungi un nuovo stato",Type:"Aggiungi un nuovo tipo",Stage:"Aggiungi una nuova fase"},text:{Priority:"Elenco delle priorità",Label:"Elenco delle etichette",Status:"Elenco degli stati",Type:"Elenco dei tipi",Stage:"Elenco delle fasi"}}}}},XJt=({apiClient:i,fetchUsers:e,i18nPlugin:t}={})=>({install(n){i?Ni.setup({apiClient:i,fetchUsers:e}):console.error("[BCF Components Plugin] No api client provided. You must provide an api client for the components to work properly."),t?Object.entries(YJt).forEach(([o,r])=>{t.global.mergeLocaleMessage(o,r)}):console.warn("[BCF Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(f7e).forEach(([o,r])=>{n.component(o,r)})}}),$Jt={de:{BuildingMaker:{title:"Building Maker",back:"Zurück",list:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschließend Ihre PDFs herunter.",createButton:"Neues Projekt",updateButton:"Umbenennen",deleteButton:"Löschen"},form:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschließend Ihre PDFs herunter.",input:"Name des Gebäudes",error:"Ungültiger Name",createButton:"Erstellen",updateButton:"Bestätigen"},view:{addStoreyButton:"Etage",addPlanButton:"Grundriss",closeButton:"Fertigstellen",submitFilesButton:"Bestätigen"},storeyForm:{title:"Neue Etage",input:"Name",error:"Ungültiger Name",cancelButton:"Abbrechen",submitButton:"Bestätigen"}},FileManager:{creationFormTitle:"Ordner erstellen",renameFormPlaceholder:"Datei- / Ordnernam",nameInputPlaceholder:"Ordnername",emptyFolder:"Dieser Ordner ist leer",newFolderSuccess:"Neuer Ordner erstellt",renameFolderSuccess:"Umbenannter Ordner",deleteFolderSuccess:"Ordner gelöscht",newFileSuccess:"Datei hinzugefügt",renameFileSuccess:"Umbenannte Datei",deleteFileSuccess:"Datei gelöscht",nameInputErrorMessage:"Ungültiger name",cancel:"Abbrechen",submit:"Bestätigen",buttonText:"Neuer Ordner",addFileButtonText:"Datei laden",rename:"Umbenennen",view:"Sehen",download:"Herunterladen",delete:"Löschen",deleteTitle:"Dateien löschen",deleteDetail:"Sie sind im Begriff, die folgenden Dateien / Ordner endgültig zu löschen"}},en:{BIMDataComponents:{t:{back:"Back",cancel:"Cancel",create:"Create",delete:"Delete",download:"Download",finish:"Finish",rename:"Rename",search:"Search",see:"View",storey:"Storey",validate:"Validate"}},BuildingMaker:{title:"Building Maker",list:{text:"Create and edit storeys, then download your PDFs.",new:"New project"},form:{input:"Building name",error:"Invalid"},view:{addStorey:"Add Storey",addFile:"Add File",addPlan:"Add Plan"},storeyForm:{title:"New storey",input:"Name",error:"Invalid name"}},FileManager:{creationFormTitle:"Create folder",renameFormPlaceholder:"Folder/File name",nameInputPlaceholder:"Folder name",emptyFolder:"This folder is empty",newFolderSuccess:"New folder created",renameFolderSuccess:"Folder renamed",deleteFolderSuccess:"Folder deleted",newFileSuccess:"File added",renameFileSuccess:"File renamed",deleteFileSuccess:"File deleted",nameInputErrorMessage:"Invalid name",buttonText:"New folder",addFileButtonText:"Upload a file",deleteTitle:"Deleting Files",deleteDetail:"You are about to permanently delete the following files / folders",dmsRoot:"Root of the project's DMS",pdfPageSelectorTitle:"Select a page"},MetaBuildingStructure:{title:"Meta-Building Structure",tab:{structure:"Structure",zones:"Zones",equipments:"Equipments"},StoreySelector:{placeholder:"Select a storey"}},PhotosphereBuilding:{title:"Photosphere Building"}},es:{BuildingMaker:{title:"Building Maker",back:"Vuelta",list:{text:"Cree y edite los pisos después cargue los PDF.",createButton:"Nuevo proyecto",updateButton:"Renombrar",deleteButton:"Suprimir"},form:{text:"Cree y edite los pisos después cargue los PDF.",input:"Nombre del edificio",error:"Nombre no válido",createButton:"Crear",updateButton:"Validar"},view:{addStoreyButton:"Piso",addPlanButton:"Plano",closeButton:"Terminar",submitFilesButton:"Validar"},storeyForm:{title:"Nuevo piso",input:"Nombre",error:"Nombre no válido",cancelButton:"Anular",submitButton:"Validar"}},FileManager:{creationFormTitle:"Crear un archivo",renameFormPlaceholder:"Nombre de archivo / carpeta",nameInputPlaceholder:"Nombre de la carpeta",emptyFolder:"Esta carpeta está vacía",newFolderSuccess:"Nueva carpeta creada",renameFolderSuccess:"Carpeta renombrada",deleteFolderSuccess:"Carpeta eliminada",newFileSuccess:"Archivo agregado",renameFileSuccess:"Archivo renombrado",deleteFileSuccess:"Archivo eliminado",nameInputErrorMessage:"Nombre inválida",cancel:"Cancelar",submit:"Validar",buttonText:"Carpeta nueva",addFileButtonText:"Cargar un archivo",rename:"Renombrar",view:"Ver",download:"Descargar",delete:"Borrar",deleteTitle:"Eliminar archivos",deleteDetail:"Está a punto de eliminar permanentemente los siguientes archivos / carpetas"}},fr:{BIMDataComponents:{t:{back:"Retour",cancel:"Annuler",create:"Créer",delete:"Supprimer",download:"Télécharger",finish:"Terminer",rename:"Renommer",search:"Rechercher",see:"Voir",storey:"Étage",validate:"Valider"}},BuildingMaker:{title:"Building Maker",list:{text:"Créez et éditez les étages puis téléchagez vos PDF.",new:"Nouveau projet"},form:{input:"Nom du bâtiment",error:"Nom invalide"},view:{addStorey:"Ajouter un Étage",addFile:"Ajouter un fichier",addPlan:"Ajouter un plan"},storeyForm:{title:"Nouvel étage",input:"Nom",error:"Nom invalide"}},FileManager:{creationFormTitle:"Créer un dossier",renameFormPlaceholder:"Nom du fichier/dosier",nameInputPlaceholder:"Nom du dossier",emptyFolder:"Ce dossier est vide",newFolderSuccess:"Nouveau dossier créé",renameFolderSuccess:"Dossier renommé",deleteFolderSuccess:"Dossier supprimé",newFileSuccess:"Fichier ajouté",renameFileSuccess:"Fichier renommé",deleteFileSuccess:"Fichier supprimé",nameInputErrorMessage:"Nom invalide",buttonText:"Nouveau dossier",addFileButtonText:"Charger un fichier",deleteTitle:"Supression de fichiers",deleteDetail:"Vous êtes sur le point de supprimer définitivement les fichiers/dossiers suivants",dmsRoot:"Racine de la GED du projet",pdfPageSelectorTitle:"Sélectionner une page"},MetaBuildingStructure:{title:"Structure Méta-Building",tab:{structure:"Structure",zones:"Zones",equipments:"Équipements"},StoreySelector:{placeholder:"Sélectionner un étage"}},PhotosphereBuilding:{title:"Photosphère Building"}},it:{BuildingMaker:{title:"Building Maker",back:"Reso",list:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",createButton:"Nuovo progetto",updateButton:"Rinominare",deleteButton:"Eliminare"},form:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",input:"Nome della costruzione",error:"Nome non corretto",createButton:"Creare",updateButton:"Convalidare"},view:{addStoreyButton:"Piano",addPlanButton:"Mappa",closeButton:"Finire",submitFilesButton:"Convalidare"},storeyForm:{title:"Nuovo piano",input:"Nome",error:"Nome non corretto",cancelButton:"Annullare",submitButton:"Convalidare"}},FileManager:{creationFormTitle:"Crea una cartella",renameFormPlaceholder:"Nome file/cartella",nameInputPlaceholder:"Nome della cartella",emptyFolder:"Questa cartella è vuota",newFolderSuccess:"Nuova cartella creata",renameFolderSuccess:"Cartella rinominata",deleteFolderSuccess:"Cartella eliminata",newFileSuccess:"File aggiunto",renameFileSuccess:"File rinominato",deleteFileSuccess:"File cancellato",nameInputErrorMessage:"Nome non valido",cancel:"Annulla",submit:"Invia",buttonText:"Nuova cartella",addFileButtonText:"Carica un file",rename:"Rinominare",view:"Vedere",download:"Scaricare",delete:"Cancellare",deleteTitle:"Eliminazione di file",deleteDetail:"Stai per eliminare definitivamente i seguenti file/cartelle"}}},eWt=({i18nPlugin:i}={})=>({install(e){i?Object.entries($Jt).forEach(([t,n])=>{i.global.mergeLocaleMessage(t,n)}):console.warn("[BIMData Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(kSt).forEach(([t,n])=>{e.component(t,n)})}}),tWt=Object.freeze(Object.defineProperty({__proto__:null,BIMDataClickAway:Ya,BIMDataClickInputAway:{beforeMount(i,e){if(typeof e.value!="function")throw Error(`click away directive needs function, got ${typeof e.value}`);i.clickAwayHandler=t=>{(t.path||t.composedPath&&t.composedPath()).find(o=>o===i)||e.value()},window.addEventListener("mousedown",i.clickAwayHandler,!0)},unmounted(i){window.removeEventListener("mousedown",i.clickAwayHandler,!0),delete i.clickAwayHandler}}},Symbol.toStringTag,{value:"Module"})),iWt=i=>({install(e){Object.entries(xQe).forEach(([t,n])=>{e.component(t,n)}),Object.entries(tWt).forEach(([t,n])=>e.directive(t.split("BIMData")[1],n))}}),nWt={name:"LiWrapper",render(){return Jn("li",this.$slots.default())}};function oWt(i,e){var t=new Set([]);return i.forEach(n=>{e.has(n)||t.add(n)}),t}const Sl=$o("id"),sWt=({contextMenu:i,objects:e=[],state:t=i.$viewer.state,pictos:n})=>[{name:"selectAll",get group(){return i.groupPositions.select},position:1,get label(){return i.$t("context_menu.select_all")},get picto(){return n.get(this.name)},execute:()=>t.selectObjects(e.filter(Fa(Ii("visible"),Ad("selected"))).map(Sl)),predicate:()=>e.some(Fa(Ii("visible"),Ad("selected")))},{name:"deselectAll",get group(){return i.groupPositions.select},position:2,get label(){return i.$t("context_menu.deselect_all")},get picto(){return n.get(this.name)},execute:()=>t.deselectObjects(e.filter(Ii("selected")).map(Sl)),predicate:()=>e.some(Ii("selected"))},{name:"selectSimilar",get group(){return i.groupPositions.select},position:3,get label(){return i.$t("context_menu.select_similar")},get picto(){return n.get(this.name)},execute(){const o=e.filter(r=>r.visible&&r.type===this.selectedObject.type&&r.id!==this.selectedObject.id).map(Sl);t.selectObjects(o)},selectedObject:null,predicate(){const o=e.filter(Fa(Ii("visible"),Ii("selected")));return o.length===1&&o[0].type!==void 0?(this.selectedObject=o[0],!0):(this.selectedObject=null,!1)}},{name:"reverseSelection",get label(){return i.$t("context_menu.reverse_selection")},get group(){return i.groupPositions.select},position:4,execute:()=>{const o=new Set(e.filter(Ii("selected")).map(Sl)),r=new Set(e.filter(Ii("visible")).map(Sl));t.selectObjects(Array.from(oWt(r,o)),{exclusive:!0})},predicate:()=>e.some(Fa(Ad("selected"),Ii("visible")))&&e.some(Fa(Ii("selected"),Ii("visible")))},{name:"showAll",get group(){return i.groupPositions.visibility},position:1,get label(){return i.$t("context_menu.show_all")},get picto(){return n.get(this.name)},execute:()=>t.showObjects(e.filter(Ad("visible")).map(Sl)),predicate:()=>e.some(Ad("visible"))},{name:"hide",get group(){return i.groupPositions.visibility},position:2,get label(){return i.$t("context_menu.hide")},get picto(){return n.get(this.name)},objectsToHide:null,execute(){const o=this.objectsToHide.filter(Ii("selected"));o.length>0&&t.deselectObjects(o.map(Sl)),t.hideObjects(this.objectsToHide.map(Sl))},predicate(){return this.objectsToHide=e.filter(Fa(Ii("selected"),Ii("visible"))),this.objectsToHide.length>0}},{name:"hideAll",get group(){return i.groupPositions.visibility},position:3,get label(){return i.$t("context_menu.hide_all")},execute:()=>{const o=e.filter(Ii("visible"));o.some(Ii("selected"))&&t.deselectObjects(o.filter(Ii("selected")).map(Sl)),t.hideObjects(o.map(Sl))},predicate:()=>e.some(Ii("visible"))}].filter(o=>o.predicate()),rWt={components:{LiWrapper:nWt},inject:["$viewer"],data(){return{defaultPrevented:!1,displayed:!1,top:null,bottom:null,left:null,width:200,nextCommandId:1,currentCommands:[],contextCommands:[],registeredCommands:[],groupPositions:{select:10,visibility:20},asyncPredicateRunning:!1}},computed:{position(){return{top:this.top?this.top+"px":"unset",bottom:this.bottom?this.bottom+"px":"unset",left:this.left+"px",width:this.width+"px"}}},watch:{displayed(i){i?document.addEventListener("keydown",this.onKeyDown):document.removeEventListener("keydown",this.onKeyDown)}},created(){this.$viewer.contextMenu=this,this.asyncPredicates=new Set},methods:{onKeyDown(i){i.key==="Escape"&&this.away()},setPosition(i){const t=(document.fullscreenElement?document.fullscreenElement:this.$parent.$el).getBoundingClientRect();this.left=i.clientX-t.left,this.top=i.clientY-t.top,this.left+this.width>t.width&&(this.left=this.left-this.width),i.clientY>t.top+t.height/2?(this.bottom=t.height-this.top,this.top=null):this.bottom=null},typeCheckCommand(i={}){let e=null;if((!i.execute||typeof i.execute!="function")&!i.component&&(e="Cannot register context menu command. A command must have an execute function or a component property."),i.label||(e="Cannot register context menu command. A command must have a label."),e)throw console.error(e),new Error(e);return i.id=this.nextCommandId++,i},open(i){this.currentCommands=[],this.setPosition(i),this.originEvent=i,i.preventDefault(),this.setCurrentCommands(),this.groupCurrentCommands(),this.defaultPrevented=!1,this.displayed=!0,document.fullscreenElement?(this.$el.parentElement.removeChild(this.$el),this.adoptiveParent=document.fullscreenElement,this.adoptiveParent.appendChild(this.$el)):this.adoptiveParent&&this.adoptiveParent!==this.$viewer.globalContext.el&&(this.adoptiveParent.removeChild(this.$el),this.$viewer.globalContext.el.appendChild(this.$el),this.adoptiveParent=null)},setCurrentCommands(){this.asyncPredicates.clear(),this.asyncPredicateRunning=!1,this.defaultPrevented||this.registeredCommands.forEach(async i=>{if(typeof i.predicate=="function"){const e=i.predicate(this.$viewer.globalContext.activeLocalContext);if(e===!0)this.currentCommands.push(i);else if(typeof e?.then=="function"){this.asyncPredicates.add(e),this.asyncPredicateRunning=!0;const t=await e;this.asyncPredicates.has(e)&&(this.asyncPredicates.delete(e),this.asyncPredicateRunning=this.asyncPredicates.size>0,t===!0&&this.currentCommands.push(i))}}else this.currentCommands.push(i)}),this.currentCommands.push(...this.contextCommands),this.contextCommands=[]},getDefaultCommands({objects:i=[],state:e=this.$viewer.state,context:t=null}){const n=new Map;return t&&this.$viewer.shortcutManager.getShortcuts(t).forEach(o=>n.set(o.name,o.key)),sWt({contextMenu:this,objects:i,state:e,pictos:n})},executeCommand(i){if(i.execute&&(i.execute(this.originEvent),this.displayed=!1),i.component&&!i.menu)throw new Error("Command with component property must have a `menu` property")},away(){this.displayed=!1},groupCurrentCommands(){const i=new Map;this.currentCommands.forEach(n=>{(n.group===null||n.group===void 0)&&(n.group=0),i.has(n.group)?i.get(n.group).push(n):i.set(n.group,[n])}),i.forEach(n=>n.sort((o,r)=>(o.position=o.position||0,r.position=r.position||0,o.position-r.position)));const t=[...i.keys()].sort((n,o)=>n-o).map(n=>i.get(n)).flat();this.currentCommands=t},isGroupIntersection(i){if(i===0)return!1;const e=this.currentCommands[i-1],t=this.currentCommands[i];return e.group<t.group},registerContextCommand(i){const e=this.typeCheckCommand(i);return this.contextCommands.push(e),i.id},registerCommand(i){const e=this.typeCheckCommand(i);return this.registeredCommands.push(e),i.id},unregisterCommand(i){return this.registeredCommands.find(e=>e.id===i)?(this.registeredCommands=this.registeredCommands.filter(e=>e.id!==i),!0):!1},preventDefault(){this.defaultPrevented=!0}}},aWt={key:0,class:"separator"},lWt={class:"menu-text"},cWt={key:1,class:"menu-picto"},uWt={key:0,class:"context-menu__spinner"};function dWt(i,e,t,n,o,r){const s=T("BIMDataIconChevron"),a=T("LiWrapper"),l=T("BIMDataSpinner"),c=ui("click-away");return o.displayed&&(o.currentCommands.length||o.asyncPredicateRunning)?vt((B(),F("ul",{key:0,class:"bimdata-list context-menu",style:ue(r.position)},[(B(!0),F(it,null,It(o.currentCommands,(u,d)=>(B(),K(a,{key:u.label,class:"context-menu__element",onClick:h=>r.executeCommand(u)},{default:N(()=>[r.isGroupIntersection(d)?(B(),F("div",aWt)):oe("",!0),C("div",lWt,Q(u.label),1),!u.component&&u.picto?(B(),F("span",cWt,Q(u.picto),1)):u.component?(B(),K(s,{key:2,size:"xxs",class:"fill-primary"})):oe("",!0)]),_:2},1032,["onClick"]))),128)),o.asyncPredicateRunning?(B(),F("li",uWt,[k(l)])):oe("",!0)],4)),[[c,r.away]]):oe("",!0)}const hWt=H(rWt,[["render",dWt],["__scopeId","data-v-5b87d4a3"]]),pWt={name:"ViewerHeader",inject:["$viewer"],props:{visible:{type:Boolean,default:!0}},setup(){const i=ut("$viewer"),e=ns(new Map),t=o=>{if(!o.name)throw new TypeError("[Viewer Header] Content must have a name");if(e.has(o.name))throw new Error(`[Viewer Header] Content with name ${o.name} already exists`);e.set(o.name,o)},n=o=>e.has(o)?(e.delete(o),!0):!1;return{logo:i.uiSettings.bimdataLogo!==!1,version:i.uiSettings.version!==!1?i.version:null,headerContent:e,headerRightContentComponents:Fe(()=>Array.from(e.values()).filter(o=>o.position==="right").sort((o,r)=>o.order-r.order).map(o=>o.component)),headerLeftContentComponents:Fe(()=>Array.from(e.values()).filter(o=>o.position==="left").sort((o,r)=>o.order-r.order).map(o=>o.component)),addContent:t,removeContent:n}}},fWt={class:"viewer-header"},AWt={class:"viewer-header__content"},mWt={class:"viewer-header__content__left"},gWt={class:"viewer-header__content__right"},vWt={key:0,class:"m-l-6 flex items-center"},yWt={key:1,class:"viewer-header__version"};function wWt(i,e,t,n,o,r){const s=T("BIMDataIllustration");return vt((B(),F("div",fWt,[C("div",AWt,[C("div",mWt,[(B(!0),F(it,null,It(n.headerLeftContentComponents,a=>(B(),K(Sn(a),{key:a.name}))),128))]),C("div",gWt,[(B(!0),F(it,null,It(n.headerRightContentComponents,a=>(B(),K(Sn(a),{key:a.name}))),128))])]),n.logo||n.version?(B(),F("div",vWt,[n.logo?(B(),K(s,{key:0,name:"logo",width:"30px",height:"30px"})):oe("",!0),n.version?(B(),F("div",yWt,Q(n.version),1)):oe("",!0)])):oe("",!0)],512)),[[Gt,t.visible]])}const CWt=H(pWt,[["render",wWt],["__scopeId","data-v-5c9ea6b6"]]),bWt={emits:["resize"],setup(i,{emit:e}){return{onResizerMousedown:n=>{n.preventDefault();let o=n.clientX;const r=a=>{a.preventDefault();const l=a.clientX-o;o=a.clientX,e("resize",l)},s=a=>{a.preventDefault(),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",s)};window.addEventListener("mousemove",r),window.addEventListener("mouseup",s)}}}},xWt={class:"bimdata-separator"};function MWt(i,e,t,n,o,r){return B(),F("div",xWt,[e[1]||(e[1]=C("div",{class:"bimdata-separator__line"},null,-1)),C("div",{class:"bimdata-separator__resizer",onMousedown:e[0]||(e[0]=(...s)=>n.onResizerMousedown&&n.onResizerMousedown(...s))},null,32)])}const BWt={components:{Separator:H(bWt,[["render",MWt],["__scopeId","data-v-79a3b3af"]])},props:{position:{type:String,required:!0,validator(i){return["left","right"].includes(i)}},sidePanel:{type:Object,required:!0,validator(i){if(i.width&&(typeof i.width!="number"||i.width<0))return console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof i.width}`),!1;const e=typeof i?.component=="object";return e||console.error("[GlobalSidePanel] sidePanel must have a component property"),e}}},setup(i){const e=pe(null),t=pe(i.sidePanel.width??400),n=(o,r=1)=>{const s=t.value+o*r;t.value=Math.max(0,s)};return dt(()=>i.sidePanel,()=>{Object.defineProperty(i.sidePanel,"width",{get(){return t.value},set(o){if(typeof o!="number"||o<=0){console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof o}`);return}t.value=o}}),Object.defineProperty(i.sidePanel,"componentInstance",{get(){return e.value},enumerable:!0})},{immediate:!0}),{componentInstance:e,width:t,onResize:n}}},EWt={class:"bimdata-global-side-panel__component"};function IWt(i,e,t,n,o,r){const s=T("Separator");return B(),F("div",{class:"bimdata-global-side-panel",style:ue(`width: ${n.width}px`)},[t.sidePanel.resizable&&t.position==="right"?(B(),K(s,{key:0,onResize:e[0]||(e[0]=a=>n.onResize(a,-1))})):oe("",!0),C("div",EWt,[(B(),K(Sn(t.sidePanel.component),{ref:"componentInstance"},null,512))]),t.sidePanel.resizable&&t.position==="left"?(B(),K(s,{key:1,onResize:e[1]||(e[1]=a=>n.onResize(a))})):oe("",!0)],4)}const SWt={name:"BimdataViewer",components:{ContextMenu:hWt,ViewerHeader:CWt,ModalManager:z1e,GlobalSidePanel:H(BWt,[["render",IWt],["__scopeId","data-v-82d0d4cb"]])},setup(){const i=ut("$viewer"),{globalContext:e,shortcutManager:t}=i;ki(()=>{t&&t.destroy(),e.hub.clear()}),ci(()=>{i.pluginManager.runPluginsScripts(i)});const n=Fe(()=>i.uiSettings.bimdataLogo!==!1&&(e.localContexts.length!==1||e.localContexts[0].window?.logoAndVersion)),o=Fe(()=>i.uiSettings.version!==!1&&(e.localContexts.length!==1||e.localContexts[0].window?.logoAndVersion)?i.version:null),r=Fe(()=>e.leftSidePanel),s=Fe(()=>e.rightSidePanel),a=Fe(()=>{const p=i.uiSettings.header!==!1,A=e.localContexts.length===1&&e.localContexts[0].window?.header===!1,f=!!(r.value||s.value);return p&&(!A||f)}),l=i.uiSettings.contextMenu!==!1,c=pe(null);function u(p){l&&c.value.open(p)}function d(){i.shortcutManager.active=!0}function h(){i.shortcutManager.active=!1}return{Layout:i.layout.areas.component,onContextMenu:u,onMouseenter:d,onMouseleave:h,isHeaderVisible:a,viewerTemplateRef:e.templateRef,modalManagerTemplateRef:e.modalManagerTemplateRef,headerTemplateRef:e.headerTemplateRef,contextMenuTemplateRef:c,contextMenuEnabled:l,bimdataLogoOnSingleWindow:n,viewerVersionOnSingleWindow:o,version:i.version,loading:Fe(()=>e.loading),spinner:Fe(()=>e.spinner),leftSidePanel:r,rightSidePanel:s}}},PWt={key:1,class:"bimdata-context-loading-overlay",style:{"z-index":"3"}},TWt={key:2,class:"viewer__logo"},kWt={key:1,class:"version m-t-6"};function RWt(i,e,t,n,o,r){const s=T("ModalManager"),a=T("ContextMenu"),l=T("ViewerHeader"),c=T("GlobalSidePanel"),u=T("BIMDataSpinner"),d=T("BIMDataIllustration");return B(),F("div",{id:"bimdata-viewer",ref:"viewerTemplateRef",class:"bimdata-viewer bimdata-design-system bimdata-scrollbar",onContextmenu:e[0]||(e[0]=(...h)=>n.onContextMenu&&n.onContextMenu(...h)),onMouseenter:e[1]||(e[1]=(...h)=>n.onMouseenter&&n.onMouseenter(...h)),onMouseleave:e[2]||(e[2]=(...h)=>n.onMouseleave&&n.onMouseleave(...h))},[k(s,{ref:"modalManagerTemplateRef"},null,512),n.contextMenuEnabled?(B(),K(a,{key:0,ref:"contextMenuTemplateRef"},null,512)):oe("",!0),k(l,{ref:"headerTemplateRef",visible:n.isHeaderVisible},null,8,["visible"]),C("div",{class:"bimdata-viewer__content",style:ue(n.isHeaderVisible?"height: calc(100% - var(--bimdata-viewer-header-height, 40px))":"height: 100%")},[n.leftSidePanel?(B(),K(c,{key:0,"side-panel":n.leftSidePanel,position:"left"},null,8,["side-panel"])):oe("",!0),(B(),K(Sn(n.Layout),{style:"height: 100%; flex-grow: 1;"})),n.rightSidePanel?(B(),K(c,{key:1,"side-panel":n.rightSidePanel,position:"right"},null,8,["side-panel"])):oe("",!0)],4),n.loading?(B(),F("div",PWt,[n.spinner&&n.spinner.component?(B(),K(Sn(n.spinner.component),Rr(xs({key:0},n.spinner.props)),null,16)):(B(),K(u,{key:1,size:"40px",border:"5px"}))])):oe("",!0),!n.isHeaderVisible&&(n.bimdataLogoOnSingleWindow||n.viewerVersionOnSingleWindow)?(B(),F("div",TWt,[n.bimdataLogoOnSingleWindow?(B(),K(d,{key:0,name:"logo"})):oe("",!0),n.viewerVersionOnSingleWindow?(B(),F("div",kWt,Q(n.version),1)):oe("",!0)])):oe("",!0)],544)}const DWt=H(SWt,[["render",RWt],["__scopeId","data-v-0c1c941a"]]),_Wt=["src"],LWt={class:"bimdata-models__header"},FWt={key:0,class:"bimdata-models__header__loader"},OWt={class:"bimdata-models__header__picto"},UWt={class:"bimdata-models__header__name"},NWt={key:0,class:"bimdata-models__header__name--empty"},VWt={key:1,class:"bimdata-models__header__name--empty"},HWt={key:3},zWt=["onMousemove","onClick"],K1e=H({__name:"Models",props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:"350px"}},setup(i){const e=i,t=ut("$viewer"),n=pe(),o=pe(0),r=pe(0),s=pe(),a=Ci([]),l=pe(!1),c=Fe(()=>t.localContext.loadedModels),u=Fe(()=>t.localContext.loadedModelIds),d=Fe(()=>t.localContext.loadingModelIds),h=Fe(()=>t.localContext.multiModel),p=Fe(()=>(e.customFilter?a.value.filter(e.customFilter):a.value).map(E=>c.value.find(S=>S.document?.head_id!=null&&S.document.head_id===E.document.id)??E)),A=M=>u.value.includes(M),f=M=>d.value.includes(M),g=Fe(()=>{const{x:M,y:E}=s.value?.getBoundingClientRect()??{x:0,y:0};return`top:${r.value-E}px; left:${o.value-M}px;`}),m=M=>{!h.value&&A(M.id)||d.value.length>0||(t.localContext.loadedModelIds.includes(M.id)?t.localContext.unloadModels([M.id]):t.localContext.loadModels([M.id]))},w=M=>{switch(M){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},v=(M,E)=>{M?.viewer_360_file&&(o.value=E.clientX,r.value=E.clientY),n.value=M?.viewer_360_file},y=async M=>{l.value=!0;try{return(await t.api.apiClient.modelApi.getModels(t.api.cloudId,t.api.projectId,void 0,void 0,M)).filter(S=>t.state.models.some(I=>I.archived)||!S.archived).sort(il("updated_at",!1))}catch(E){console.error("[Models] Cannot get project models. Error: ",E)}finally{l.value=!1}return[]},x=M=>M.children?.some(E=>A(E.id))??!1;return y(t.localContext.modelTypes).then(M=>{a.value=M}),(M,E)=>{const S=T("BIMDataSpinner"),I=T("BIMDataIconModel3D"),R=T("BIMDataTextbox"),P=T("BIMDataCheckbox"),D=T("BIMDataRadio"),L=T("BIMDataIcon"),U=T("BIMDataDropdownList");return B(),F("div",{ref_key:"templateRef",ref:s,class:le(["bimdata-models",{"bimdata-models--window-positioning":i.windowPositioning}])},[n.value?(B(),F("div",{key:0,class:"bimdata-models__preview",style:ue(g.value)},[C("img",{src:n.value},null,8,_Wt)],4)):oe("",!0),k(U,{style:ue(`--bimdata-models-width: ${i.width};`),width:i.width,list:p.value,"element-key":"id","per-page":40,loading:l.value,class:"bimdata-models__list",disabled:p.value.length===0,onElementClick:m},{header:N(({isOpen:z})=>[C("div",LWt,[l.value||d.value.length>0?(B(),F("div",FWt,[k(S)])):(B(),F(it,{key:1},[C("div",OWt,[k(I)]),C("div",{class:le(["bimdata-models__header__number bimdata-info-length",{"bimdata-models__header__number--empty":u.value.length===0}])},[C("span",null,Q(u.value.length),1)],2),C("div",UWt,[p.value.length===0?(B(),F("span",NWt,Q(M.$t("model.no_model")),1)):u.value.length===0?(B(),F("span",VWt,Q(M.$t("model.no_loaded_model")),1)):u.value.length===1?(B(),K(R,{key:2,text:c.value[0].name,tooltip:!z},null,8,["text","tooltip"])):u.value.length>1?(B(),F("span",HWt,Q(M.$t("model.selected_models")),1)):oe("",!0)])],64))])]),element:N(({element:z,close:j})=>[C("div",{class:"bimdata-models__model",onMousemove:Z=>i.preview&&v(z,Z),onMouseout:E[0]||(E[0]=Z=>i.preview&&v()),onClick:()=>{!h.value&&!A(z.id)&&j()}},[h.value?(B(),K(P,{key:0,"model-value":A(z.id)||x(z),disabled:z.status!=="C"||d.value.length>0},null,8,["model-value","disabled"])):(B(),K(D,{key:1,"model-value":A(z.id)||x(z),disabled:z.status!=="C"||d.value.length>0},null,8,["model-value","disabled"])),k(L,{margin:"0 calc(var(--spacing-unit) / 2)",name:w(z.status),size:"xs",class:le({"fill-success":z.status==="C","fill-high":z.status==="E"})},null,8,["name","class"]),k(R,{class:le({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":z.status!=="C"||d.value.length>0}),text:z.name,width:`calc(100% -
|
|
5548
5548
|
${h.value?13:23}px - 2 * 6px - 16px)`},null,8,["class","text","width"]),z.document&&!z.document.is_head_version?(B(),K(L,{key:2,name:"versioning",fill:"",color:"default",size:"xs",margin:"0 0 0 6px"})):oe("",!0)],40,zWt),f(z.id)?(B(),K(S,{key:0,class:"bimdata-models__model__spinner"})):oe("",!0)]),_:1},8,["style","width","list","loading","disabled"])],2)}}},[["__scopeId","data-v-34c2cf79"]]),jWt="data:image/svg+xml,%3csvg%20width='16'%20height='21'%20viewBox='0%200%2016%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.47193%202.76644C7.65699%202.84439%207.77716%203.02565%207.777%203.22661L7.77339%207.94624C7.77318%208.22238%207.54916%208.44655%207.27301%208.44693L2.4192%208.45366C2.21569%208.45394%202.03258%208.33085%201.95617%208.1424C1.87975%207.95394%201.92528%207.73773%202.07129%207.59566L6.92872%202.86931C7.0729%202.72902%207.28688%202.6885%207.47193%202.76644ZM3.65141%207.45195L6.77378%207.44762L6.7761%204.41157L3.65141%207.45195ZM5.81657%200.893911L6.02338%200.893274L13.3879%200.870595C14.679%200.866619%2015.7208%201.91642%2015.722%203.20083L15.2221%203.20237L15.722%203.20052L15.722%203.20083L15.745%2017.8999L15.745%2017.9002C15.7462%2019.1846%2014.7063%2020.2408%2013.4153%2020.2448L2.35929%2020.2788C1.07114%2020.2828%200.0171799%2019.2362%200.0159721%2017.9486L0.00563138%206.92409L0.00543684%206.71668L0.152103%206.56972L5.67032%201.04045L5.81657%200.893911ZM6.23113%201.89264L1.00582%207.12841L1.01597%2017.9455C1.01666%2018.6791%201.62068%2019.2811%202.35835%2019.2788L13.4143%2019.2448C14.1484%2019.2425%2014.7456%2018.6402%2014.745%2017.9035C14.745%2017.9034%2014.745%2017.9033%2014.745%2017.9033L14.722%203.20423L14.722%203.20391C14.7213%202.46716%2014.123%201.86833%2013.3888%201.87059L6.23113%201.89264Z'%20fill='%232F374A'/%3e%3c/svg%3e",GWt=["src"],QWt={key:0,class:"bimdata-multi-model-loader__header-container"},qWt={key:0,class:"bimdata-multi-model-loader__header__loader"},KWt={class:"bimdata-multi-model-loader__header__picto"},JWt=["src"],WWt={class:"bimdata-multi-model-loader__header__name"},ZWt={key:0,class:"bimdata-multi-model-loader__header__name--empty"},YWt={key:1,class:"bimdata-multi-model-loader__header__name--empty"},XWt={key:3},$Wt={key:1,class:"bimdata-multi-model-loader__main"},eZt=["onMousemove","onClick"],tZt=H({__name:"BIMDataMultiModelLoader",props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:"350px"}},setup(i){const e=i,t=ut("$viewer"),n=pe(),o=pe(0),r=pe(0),s=pe(),a=Ci([]),l=pe(!1),c=pe(!0),u=L=>{L.key==="Escape"?c.value=!0:L.key==="Enter"&&S()};dt(c,L=>{L?(window.removeEventListener("keydown",u),v.clear(),w.clear(),n.value=null):window.addEventListener("keydown",u)});const d=Fe(()=>t.localContext.loadedModels),h=Fe(()=>t.localContext.loadedModelIds),p=Fe(()=>t.localContext.loadingModelIds),A=Fe(()=>t.localContext.multiModel),f=Fe(()=>(e.customFilter?a.value.filter(e.customFilter):a.value).map(U=>d.value.find(z=>z.document?.head_id!=null&&z.document.head_id===U.document.id)??U)),g=L=>h.value.includes(L),m=L=>p.value.includes(L),w=ns(new Set),v=ns(new Set),y=L=>L.children?.some(U=>g(U.id))??!1,x=L=>(g(L.id)||y(L)||w.has(L))&&!v.has(L),M=Fe(()=>{const{x:L,y:U}=s.value.getBoundingClientRect();return`top:${r.value-U}px; left:${o.value-L}px;`}),E=L=>{L.status==="C"&&(!A.value&&g(L.id)||(g(L.id)?v.has(L)?v.delete(L):v.add(L):w.has(L)?w.delete(L):w.add(L)))},S=()=>{w.size>0&&t.localContext.loadModels(Array.from(w).map(L=>L.id)),v.size>0&&t.localContext.unloadModels(Array.from(v).map(L=>L.id)),c.value=!0},I=L=>{switch(L){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},R=L=>L.document&&!L.document.is_head_version,P=(L,U)=>{!e.preview||c.value||(L?.viewer_360_file&&(o.value=U.clientX,r.value=U.clientY),n.value=L?.viewer_360_file)};return(async L=>{l.value=!0;try{return(await t.api.apiClient.modelApi.getModels(t.api.cloudId,t.api.projectId,void 0,void 0,L)).filter(z=>t.state.models.some(j=>j.archived)||!z.archived).sort(il("updated_at",!1))}catch(U){console.error("[Models] Cannot get project models. Error: ",U)}finally{l.value=!1}return[]})(t.localContext.modelTypes).then(L=>{a.value=L}),(L,U)=>{const z=T("BIMDataSpinner"),j=T("BIMDataTextbox"),Z=T("BIMDataIconChevron"),W=T("BIMDataButton"),ee=T("BIMDataIconFileIfcPolychrome"),ae=T("BIMDataCheckbox"),Be=T("BIMDataRadio"),Ee=T("BIMDataIcon"),ze=T("BIMDataPaginatedList"),Qe=ui("click-away");return B(),F("div",{ref_key:"templateRef",ref:s,class:le(["bimdata-multi-model-loader",{"bimdata-multi-model-loader--window-positioning":i.windowPositioning}])},[n.value?(B(),F("div",{key:0,class:"bimdata-multi-model-loader__preview",style:ue(M.value)},[C("img",{src:n.value},null,8,GWt)],4)):oe("",!0),k(Ai,{name:"fade",mode:"out-in"},{default:N(()=>[c.value?(B(),F("div",QWt,[pt(L.$slots,"left",{},void 0,!0),C("div",{class:"bimdata-multi-model-loader__header",onClick:U[0]||(U[0]=me=>c.value=!1)},[l.value||p.value.length>0?(B(),F("div",qWt,[k(z)])):(B(),F(it,{key:1},[C("div",KWt,[C("img",{src:rt(jWt),alt:"file icon"},null,8,JWt)]),C("div",{class:le(["bimdata-multi-model-loader__header__number bimdata-info-length",{"bimdata-multi-model-loader__header__number--empty":h.value.length===0}])},[C("span",null,Q(h.value.length),1)],2),C("div",WWt,[f.value.length===0?(B(),F("span",ZWt,Q(L.$t("model.no_model")),1)):h.value.length===0?(B(),F("span",YWt,Q(L.$t("model.no_loaded_model")),1)):h.value.length===1?(B(),K(j,{key:2,text:d.value[0].name,tooltip:c.value,width:"233px"},null,8,["text","tooltip"])):h.value.length>1?(B(),F("span",XWt,Q(L.$t("model.selected_models")),1)):oe("",!0)]),k(W,{color:"default",icon:"",radius:"",fill:"",width:"21px",height:"21px"},{default:N(()=>[k(Z,{size:"xxxs"})]),_:1})],64))]),pt(L.$slots,"right",{},void 0,!0)])):vt((B(),F("div",$Wt,[k(ze,{list:f.value,"per-page":10},{element:N(({element:me})=>[C("div",{class:le(["bimdata-multi-model-loader__main__model",{"bimdata-multi-model-loader__main__model--disabled":me.status!=="C"}]),onMousemove:De=>P(me,De),onMouseout:U[1]||(U[1]=De=>P()),onClick:De=>E(me)},[k(ee,{fill:"",color:"default",size:"xs"}),A.value?(B(),K(ae,{key:0,"model-value":x(me),disabled:me.status!=="C"},null,8,["model-value","disabled"])):(B(),K(Be,{key:1,"model-value":x(me),disabled:me.status!=="C"},null,8,["model-value","disabled"])),k(j,{class:le({"bimdata-multi-model-loader__main__model__name":!0,"bimdata-multi-model-loader__main__model__name--disabled":me.status!=="C"}),text:me.name,width:R(me)?"333px":"363px"},null,8,["class","text","width"]),R(me)?(B(),K(Ee,{key:2,name:"versioning",fill:"",color:"default",size:"xs",margin:"0 0 0 6px"})):oe("",!0),m(me.id)?(B(),K(z,{key:3,class:"bimdata-multi-model-loader__main__model__spinner"})):(B(),K(Ee,{key:4,name:I(me.status),size:"xs",class:le({"fill-success":me.status==="C","fill-high":me.status==="E"})},null,8,["name","class"]))],42,eZt)]),_:1},8,["list"]),k(W,{class:"bimdata-multi-model-loader__main__validate",width:"93px",color:"primary",fill:"",radius:"",disabled:rt(w).size===0&&rt(v).size===0,onClick:S},{default:N(()=>[Xe(Q(L.$t("global.validate")),1)]),_:1},8,["disabled"])])),[[Qe,()=>c.value=!0]])]),_:3})],2)}}},[["__scopeId","data-v-44e6af66"]]),iZt={data(){return{shown:!1}},mounted(){setTimeout(()=>{this.shown=!0},500)}};function nZt(i,e,t,n,o,r){const s=T("BIMDataIllustration");return B(),F("div",{class:"bimdata__no-model",style:ue({"--no-model--opacity":o.shown?1:0})},[k(s,{name:"emptyViewer",x:"90",y:"90"}),C("span",null,Q(i.$t("model.select_model")),1)],4)}const J1e=H(iZt,[["render",nZt],["__scopeId","data-v-5ffd9bc0"]]);window.BIMDataViewerVue=PH;class oZt{constructor(e={}){const{api:t={},ui:n}=e;this.uiCfg=n,t.apiUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `apiUrl` not set, use 'https://api.bimdata.io' by default."),t.apiUrl="https://api.bimdata.io"),t.archiveUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `archiveUrl` not set, use 'https://archive.bimdata.io' by default."),t.archiveUrl="https://archive.bimdata.io"),t.pdfBackendUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `pdfBackendUrl` not set, use 'https://pdf-backend.bimdata.io' by default."),t.pdfBackendUrl="https://pdf-backend.bimdata.io"),t.ifcIds&&(console.warn("[BIMData Viewer] DEPRECATED - Viewer config - please use the `modelIds` property instead of `ifcIds`."),t.modelIds===void 0&&(t.modelIds=t.ifcIds)),t.modelIds||(t.modelIds=[]),t.offline?.dataFile&&(t.offline.data=t.offline.dataFile),this.$viewer=new KJt(e),t.offline?.enabled?this.$viewer.api.enableOfflineMode(t.offline.data,t.offline.options).then(()=>this.state.loadModels(t.modelIds)):(this.$viewer.globalContext.loadingProcessStart(),this.state.loadModels(t.modelIds).finally(()=>this.$viewer.globalContext.loadingProcessEnd())),this.vueApp=null}get state(){return this.$viewer.state}get api(){return this.$viewer.api}async mount(e,t="3d"){const{$viewer:n}=this;await n.api.ready;try{const u=await n.api.apiClient.collaborationApi.checkProjectAccess(n.api.cloudId,n.api.projectId);n.api.permissions=q1e(u)}catch{n.api.permissions=q1e()}const o=this.api.accessToken,{i18n:r}=n;r.registerTranslations(n.pluginManager.pluginTranslations),n.layout.apply(t);const s={i18n:r.i18nVuePlugin,data(){return{accessToken:o}},render(){return Jn(DWt,{style:"height: 100%"})}},a=xg(s).use(r.i18nVuePlugin).use(iWt()).use(eWt({i18nPlugin:r.i18nVuePlugin})).use(XJt({apiClient:n.api.apiClient,i18nPlugin:r.i18nVuePlugin}));a.provide("$viewer",n),a.provide("BIMDATA_DESIGN_SYSTEM_DARK_THEME",Fe(()=>n.darkTheme)),a.component("BIMDataModelLoader",K1e),a.component("BIMDataMultiModelLoader",tZt),a.component("BIMDataNoModelWindowPlaceHolder",J1e),a.component("BIMDataStoreySelector",yI),a.component("ModelsLoader",K1e),a.component("NoModelWindowPlaceHolder",J1e);const l=e instanceof HTMLElement?e:document.querySelector(e);l&&(l.style.height="100%");const c=a.mount(e);return c.$viewer=n,JJt(c.$el,this.uiCfg?.style),typeof window<"u"&&(window.bimdataViewer=c),this.vueApp=a,c}destroy(){this.vueApp?.unmount()}setLocale(e){if(!KH.includes(e))throw new Error(`Viewer available locales are ${KH.join(", ")}.`);this.$viewer.i18n.locale=e}registerPlugin(e){this.$viewer.registerPlugin(e)}registerWindow(e){return this.$viewer.windowManager.registerWindow(e)}unregisterWindow(e){return this.$viewer.windowManager.unregisterWindow(e)}setAccessToken(e){this.api.accessToken=e}async loadModels(e){this.$viewer.globalContext.loadingProcessStart();const t=await this.state.loadModels(e);return this.$viewer.globalContext.loadingProcessEnd(),t}loadIfcs(e){return console.warn("[BIMData Viewer] DEPRECATED - Viewer - please use the loadModels method instead of loadIfcs."),this.loadModels(e)}}const W1e=(i={})=>new oZt(i);return window.makeBIMDataViewer=W1e,W1e}));
|