@bimdata/viewer 2.17.0-beta.6 → 2.17.0-beta.7

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.
@@ -1064,7 +1064,7 @@ ${c.toFixed(2)}m\xB2`,u=t.addText(d,s,0,!0);d&&i.push(u)})}return{show:r,clear:o
1064
1064
  content: "" !important;
1065
1065
  display: none !important;
1066
1066
  }`,wce=function(L){bce(L,"."+F7+vce+vT+`
1067
- .`+U7+yce+vT)},bce=function(L,S){var F=L.ownerDocument;if(F){var _=F.createElement("style");_.textContent=S,L.appendChild(_)}},yT=(function(){function L(){}return L.getOrigin=function(S){var F=L._link;return F?(F.href=S,F.href=F.href,F.protocol+F.hostname+F.port):"about:blank"},L.isSameOrigin=function(S){return L.getOrigin(S)===L._origin},L.setContext=function(S){L._link=S.document.createElement("a"),L._origin=L.getOrigin(S.location.href)},L._origin="about:blank",L})(),Cce=(function(){function L(S,F){this.context=S,this._options=F,this._cache={}}return L.prototype.addImage=function(S){var F=Promise.resolve();return this.has(S)||(N7(S)||Ece(S))&&(this._cache[S]=this.loadImage(S)).catch(function(){}),F},L.prototype.match=function(S){return this._cache[S]},L.prototype.loadImage=function(S){return n(this,void 0,void 0,function(){var F,_,q,$,de=this;return a(this,function(be){switch(be.label){case 0:return F=yT.isSameOrigin(S),_=!O7(S)&&this._options.useCORS===!0&&kn.SUPPORT_CORS_IMAGES&&!F,q=!O7(S)&&!F&&!N7(S)&&typeof this._options.proxy=="string"&&kn.SUPPORT_CORS_XHR&&!_,!F&&this._options.allowTaint===!1&&!O7(S)&&!N7(S)&&!q&&!_?[2]:($=S,q?[4,this.proxy($)]:[3,2]);case 1:$=be.sent(),be.label=2;case 2:return this.context.logger.debug("Added image "+S.substring(0,256)),[4,new Promise(function(ke,We){var lt=new Image;lt.onload=function(){return ke(lt)},lt.onerror=We,(Mce($)||_)&&(lt.crossOrigin="anonymous"),lt.src=$,lt.complete===!0&&setTimeout(function(){return ke(lt)},500),de._options.imageTimeout>0&&setTimeout(function(){return We("Timed out ("+de._options.imageTimeout+"ms) loading image")},de._options.imageTimeout)})];case 3:return[2,be.sent()]}})})},L.prototype.has=function(S){return this._cache[S]!==void 0},L.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},L.prototype.proxy=function(S){var F=this,_=this._options.proxy;if(!_)throw Error("No proxy defined");var q=S.substring(0,256);return new Promise(function($,de){var be=kn.SUPPORT_RESPONSE_TYPE?"blob":"text",ke=new XMLHttpRequest;ke.onload=function(){if(ke.status===200)if(be==="text")$(ke.response);else{var ft=new FileReader;ft.addEventListener("load",function(){return $(ft.result)},!1),ft.addEventListener("error",function(Et){return de(Et)},!1),ft.readAsDataURL(ke.response)}else de("Failed to proxy resource "+q+" with status code "+ke.status)},ke.onerror=de;var We=_.indexOf("?")>-1?"&":"?";if(ke.open("GET",""+_+We+"url="+encodeURIComponent(S)+"&responseType="+be),be!=="text"&&ke instanceof XMLHttpRequest&&(ke.responseType=be),F._options.imageTimeout){var lt=F._options.imageTimeout;ke.timeout=lt,ke.ontimeout=function(){return de("Timed out ("+lt+"ms) proxying "+q)}}ke.send()})},L})(),xce=/^data:image\/svg\+xml/i,Bce=/^data:image\/.*;base64,/i,kce=/^data:image\/.*/i,Ece=function(L){return kn.SUPPORT_SVG_DRAWING||!Pce(L)},O7=function(L){return kce.test(L)},Mce=function(L){return Bce.test(L)},N7=function(L){return L.substr(0,4)==="blob"},Pce=function(L){return L.substr(-3).toLowerCase()==="svg"||xce.test(L)},Yt=(function(){function L(S,F){this.type=0,this.x=S,this.y=F}return L.prototype.add=function(S,F){return new L(this.x+S,this.y+F)},L})(),sp=function(L,S,F){return new Yt(L.x+(S.x-L.x)*F,L.y+(S.y-L.y)*F)},Uv=(function(){function L(S,F,_,q){this.type=1,this.start=S,this.startControl=F,this.endControl=_,this.end=q}return L.prototype.subdivide=function(S,F){var _=sp(this.start,this.startControl,S),q=sp(this.startControl,this.endControl,S),$=sp(this.endControl,this.end,S),de=sp(_,q,S),be=sp(q,$,S),ke=sp(de,be,S);return F?new L(this.start,_,de,ke):new L(ke,be,$,this.end)},L.prototype.add=function(S,F){return new L(this.start.add(S,F),this.startControl.add(S,F),this.endControl.add(S,F),this.end.add(S,F))},L.prototype.reverse=function(){return new L(this.end,this.endControl,this.startControl,this.start)},L})(),ys=function(L){return L.type===1},Ice=(function(){function L(S){var F=S.styles,_=S.bounds,q=kl(F.borderTopLeftRadius,_.width,_.height),$=q[0],de=q[1],be=kl(F.borderTopRightRadius,_.width,_.height),ke=be[0],We=be[1],lt=kl(F.borderBottomRightRadius,_.width,_.height),ft=lt[0],Et=lt[1],ri=kl(F.borderBottomLeftRadius,_.width,_.height),Ut=ri[0],Gt=ri[1],Xi=[];Xi.push(($+ke)/_.width),Xi.push((Ut+ft)/_.width),Xi.push((de+Gt)/_.height),Xi.push((We+Et)/_.height);var mi=Math.max.apply(Math,Xi);mi>1&&($/=mi,de/=mi,ke/=mi,We/=mi,ft/=mi,Et/=mi,Ut/=mi,Gt/=mi);var fi=_.width-ke,to=_.height-Et,Ar=_.width-ft,ki=_.height-Gt,ei=F.borderTopWidth,cr=F.borderRightWidth,er=F.borderBottomWidth,_i=F.borderLeftWidth,jn=Yr(F.paddingTop,S.bounds.width),Ml=Yr(F.paddingRight,S.bounds.width),Tc=Yr(F.paddingBottom,S.bounds.width),lo=Yr(F.paddingLeft,S.bounds.width);this.topLeftBorderDoubleOuterBox=$>0||de>0?so(_.left+_i/3,_.top+ei/3,$-_i/3,de-ei/3,Rr.TOP_LEFT):new Yt(_.left+_i/3,_.top+ei/3),this.topRightBorderDoubleOuterBox=$>0||de>0?so(_.left+fi,_.top+ei/3,ke-cr/3,We-ei/3,Rr.TOP_RIGHT):new Yt(_.left+_.width-cr/3,_.top+ei/3),this.bottomRightBorderDoubleOuterBox=ft>0||Et>0?so(_.left+Ar,_.top+to,ft-cr/3,Et-er/3,Rr.BOTTOM_RIGHT):new Yt(_.left+_.width-cr/3,_.top+_.height-er/3),this.bottomLeftBorderDoubleOuterBox=Ut>0||Gt>0?so(_.left+_i/3,_.top+ki,Ut-_i/3,Gt-er/3,Rr.BOTTOM_LEFT):new Yt(_.left+_i/3,_.top+_.height-er/3),this.topLeftBorderDoubleInnerBox=$>0||de>0?so(_.left+_i*2/3,_.top+ei*2/3,$-_i*2/3,de-ei*2/3,Rr.TOP_LEFT):new Yt(_.left+_i*2/3,_.top+ei*2/3),this.topRightBorderDoubleInnerBox=$>0||de>0?so(_.left+fi,_.top+ei*2/3,ke-cr*2/3,We-ei*2/3,Rr.TOP_RIGHT):new Yt(_.left+_.width-cr*2/3,_.top+ei*2/3),this.bottomRightBorderDoubleInnerBox=ft>0||Et>0?so(_.left+Ar,_.top+to,ft-cr*2/3,Et-er*2/3,Rr.BOTTOM_RIGHT):new Yt(_.left+_.width-cr*2/3,_.top+_.height-er*2/3),this.bottomLeftBorderDoubleInnerBox=Ut>0||Gt>0?so(_.left+_i*2/3,_.top+ki,Ut-_i*2/3,Gt-er*2/3,Rr.BOTTOM_LEFT):new Yt(_.left+_i*2/3,_.top+_.height-er*2/3),this.topLeftBorderStroke=$>0||de>0?so(_.left+_i/2,_.top+ei/2,$-_i/2,de-ei/2,Rr.TOP_LEFT):new Yt(_.left+_i/2,_.top+ei/2),this.topRightBorderStroke=$>0||de>0?so(_.left+fi,_.top+ei/2,ke-cr/2,We-ei/2,Rr.TOP_RIGHT):new Yt(_.left+_.width-cr/2,_.top+ei/2),this.bottomRightBorderStroke=ft>0||Et>0?so(_.left+Ar,_.top+to,ft-cr/2,Et-er/2,Rr.BOTTOM_RIGHT):new Yt(_.left+_.width-cr/2,_.top+_.height-er/2),this.bottomLeftBorderStroke=Ut>0||Gt>0?so(_.left+_i/2,_.top+ki,Ut-_i/2,Gt-er/2,Rr.BOTTOM_LEFT):new Yt(_.left+_i/2,_.top+_.height-er/2),this.topLeftBorderBox=$>0||de>0?so(_.left,_.top,$,de,Rr.TOP_LEFT):new Yt(_.left,_.top),this.topRightBorderBox=ke>0||We>0?so(_.left+fi,_.top,ke,We,Rr.TOP_RIGHT):new Yt(_.left+_.width,_.top),this.bottomRightBorderBox=ft>0||Et>0?so(_.left+Ar,_.top+to,ft,Et,Rr.BOTTOM_RIGHT):new Yt(_.left+_.width,_.top+_.height),this.bottomLeftBorderBox=Ut>0||Gt>0?so(_.left,_.top+ki,Ut,Gt,Rr.BOTTOM_LEFT):new Yt(_.left,_.top+_.height),this.topLeftPaddingBox=$>0||de>0?so(_.left+_i,_.top+ei,Math.max(0,$-_i),Math.max(0,de-ei),Rr.TOP_LEFT):new Yt(_.left+_i,_.top+ei),this.topRightPaddingBox=ke>0||We>0?so(_.left+Math.min(fi,_.width-cr),_.top+ei,fi>_.width+cr?0:Math.max(0,ke-cr),Math.max(0,We-ei),Rr.TOP_RIGHT):new Yt(_.left+_.width-cr,_.top+ei),this.bottomRightPaddingBox=ft>0||Et>0?so(_.left+Math.min(Ar,_.width-_i),_.top+Math.min(to,_.height-er),Math.max(0,ft-cr),Math.max(0,Et-er),Rr.BOTTOM_RIGHT):new Yt(_.left+_.width-cr,_.top+_.height-er),this.bottomLeftPaddingBox=Ut>0||Gt>0?so(_.left+_i,_.top+Math.min(ki,_.height-er),Math.max(0,Ut-_i),Math.max(0,Gt-er),Rr.BOTTOM_LEFT):new Yt(_.left+_i,_.top+_.height-er),this.topLeftContentBox=$>0||de>0?so(_.left+_i+lo,_.top+ei+jn,Math.max(0,$-(_i+lo)),Math.max(0,de-(ei+jn)),Rr.TOP_LEFT):new Yt(_.left+_i+lo,_.top+ei+jn),this.topRightContentBox=ke>0||We>0?so(_.left+Math.min(fi,_.width+_i+lo),_.top+ei+jn,fi>_.width+_i+lo?0:ke-_i+lo,We-(ei+jn),Rr.TOP_RIGHT):new Yt(_.left+_.width-(cr+Ml),_.top+ei+jn),this.bottomRightContentBox=ft>0||Et>0?so(_.left+Math.min(Ar,_.width-(_i+lo)),_.top+Math.min(to,_.height+ei+jn),Math.max(0,ft-(cr+Ml)),Et-(er+Tc),Rr.BOTTOM_RIGHT):new Yt(_.left+_.width-(cr+Ml),_.top+_.height-(er+Tc)),this.bottomLeftContentBox=Ut>0||Gt>0?so(_.left+_i+lo,_.top+ki,Math.max(0,Ut-(_i+lo)),Gt-(er+Tc),Rr.BOTTOM_LEFT):new Yt(_.left+_i+lo,_.top+_.height-(er+Tc))}return L})(),Rr;(function(L){L[L.TOP_LEFT=0]="TOP_LEFT",L[L.TOP_RIGHT=1]="TOP_RIGHT",L[L.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",L[L.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(Rr||={});var so=function(L,S,F,_,q){var $=4*((Math.sqrt(2)-1)/3),de=F*$,be=_*$,ke=L+F,We=S+_;switch(q){case Rr.TOP_LEFT:return new Uv(new Yt(L,We),new Yt(L,We-be),new Yt(ke-de,S),new Yt(ke,S));case Rr.TOP_RIGHT:return new Uv(new Yt(L,S),new Yt(L+de,S),new Yt(ke,We-be),new Yt(ke,We));case Rr.BOTTOM_RIGHT:return new Uv(new Yt(ke,S),new Yt(ke,S+be),new Yt(L+de,We),new Yt(L,We));case Rr.BOTTOM_LEFT:default:return new Uv(new Yt(ke,We),new Yt(ke-de,We),new Yt(L,S+be),new Yt(L,S))}},Ov=function(L){return[L.topLeftBorderBox,L.topRightBorderBox,L.bottomRightBorderBox,L.bottomLeftBorderBox]},Sce=function(L){return[L.topLeftContentBox,L.topRightContentBox,L.bottomRightContentBox,L.bottomLeftContentBox]},Nv=function(L){return[L.topLeftPaddingBox,L.topRightPaddingBox,L.bottomRightPaddingBox,L.bottomLeftPaddingBox]},Dce=(function(){function L(S,F,_){this.offsetX=S,this.offsetY=F,this.matrix=_,this.type=0,this.target=6}return L})(),Hv=(function(){function L(S,F){this.path=S,this.target=F,this.type=1}return L})(),Tce=(function(){function L(S){this.opacity=S,this.type=2,this.target=6}return L})(),Lce=function(L){return L.type===0},wT=function(L){return L.type===1},Rce=function(L){return L.type===2},bT=function(L,S){return L.length===S.length?L.some(function(F,_){return F===S[_]}):!1},_ce=function(L,S,F,_,q){return L.map(function($,de){switch(de){case 0:return $.add(S,F);case 1:return $.add(S+_,F);case 2:return $.add(S+_,F+q);case 3:return $.add(S,F+q)}return $})},CT=(function(){function L(S){this.element=S,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return L})(),xT=(function(){function L(S,F){if(this.container=S,this.parent=F,this.effects=[],this.curves=new Ice(this.container),this.container.styles.opacity<1&&this.effects.push(new Tce(this.container.styles.opacity)),this.container.styles.transform!==null){var _=this.container.bounds.left+this.container.styles.transformOrigin[0].number,q=this.container.bounds.top+this.container.styles.transformOrigin[1].number,$=this.container.styles.transform;this.effects.push(new Dce(_,q,$))}if(this.container.styles.overflowX!==0){var de=Ov(this.curves),be=Nv(this.curves);bT(de,be)?this.effects.push(new Hv(de,6)):(this.effects.push(new Hv(de,2)),this.effects.push(new Hv(be,4)))}}return L.prototype.getEffects=function(S){for(var F=[2,3].indexOf(this.container.styles.position)===-1,_=this.parent,q=this.effects.slice(0);_;){var $=_.effects.filter(function(ke){return!wT(ke)});if(F||_.container.styles.position!==0||!_.parent){if(q.unshift.apply(q,$),F=[2,3].indexOf(_.container.styles.position)===-1,_.container.styles.overflowX!==0){var de=Ov(_.curves),be=Nv(_.curves);bT(de,be)||q.unshift(new Hv(be,6))}}else q.unshift.apply(q,$);_=_.parent}return q.filter(function(ke){return $o(ke.target,S)})},L})(),H7=function(L,S,F,_){L.container.elements.forEach(function(q){var $=$o(q.flags,4),de=$o(q.flags,2),be=new xT(q,L);$o(q.styles.display,2048)&&_.push(be);var ke=$o(q.flags,8)?[]:_;if($||de){var We=$||q.styles.isPositioned()?F:S,lt=new CT(be);if(q.styles.isPositioned()||q.styles.opacity<1||q.styles.isTransformed()){var ft=q.styles.zIndex.order;if(ft<0){var Et=0;We.negativeZIndex.some(function(Ut,Gt){return ft>Ut.element.container.styles.zIndex.order?(Et=Gt,!1):Et>0}),We.negativeZIndex.splice(Et,0,lt)}else if(ft>0){var ri=0;We.positiveZIndex.some(function(Ut,Gt){return ft>=Ut.element.container.styles.zIndex.order?(ri=Gt+1,!1):ri>0}),We.positiveZIndex.splice(ri,0,lt)}else We.zeroOrAutoZIndexOrTransformedOrOpacity.push(lt)}else q.styles.isFloating()?We.nonPositionedFloats.push(lt):We.nonPositionedInlineLevel.push(lt);H7(be,lt,$?lt:F,ke)}else q.styles.isInlineLevel()?S.inlineLevel.push(be):S.nonInlineLevel.push(be),H7(be,S,F,ke);$o(q.flags,8)&&BT(q,ke)})},BT=function(L,S){for(var F=L instanceof I7?L.start:1,_=L instanceof I7?L.reversed:!1,q=0;q<S.length;q++){var $=S[q];$.container instanceof ZD&&typeof $.container.value=="number"&&$.container.value!==0&&(F=$.container.value),$.listValue=ff(F,$.container.styles.listStyleType,!0),F+=_?-1:1}},Fce=function(L){var S=new xT(L,null),F=new CT(S),_=[];return H7(S,F,F,_),BT(S.container,_),F},kT=function(L,S){switch(S){case 0:return ws(L.topLeftBorderBox,L.topLeftPaddingBox,L.topRightBorderBox,L.topRightPaddingBox);case 1:return ws(L.topRightBorderBox,L.topRightPaddingBox,L.bottomRightBorderBox,L.bottomRightPaddingBox);case 2:return ws(L.bottomRightBorderBox,L.bottomRightPaddingBox,L.bottomLeftBorderBox,L.bottomLeftPaddingBox);default:return ws(L.bottomLeftBorderBox,L.bottomLeftPaddingBox,L.topLeftBorderBox,L.topLeftPaddingBox)}},Uce=function(L,S){switch(S){case 0:return ws(L.topLeftBorderBox,L.topLeftBorderDoubleOuterBox,L.topRightBorderBox,L.topRightBorderDoubleOuterBox);case 1:return ws(L.topRightBorderBox,L.topRightBorderDoubleOuterBox,L.bottomRightBorderBox,L.bottomRightBorderDoubleOuterBox);case 2:return ws(L.bottomRightBorderBox,L.bottomRightBorderDoubleOuterBox,L.bottomLeftBorderBox,L.bottomLeftBorderDoubleOuterBox);default:return ws(L.bottomLeftBorderBox,L.bottomLeftBorderDoubleOuterBox,L.topLeftBorderBox,L.topLeftBorderDoubleOuterBox)}},Oce=function(L,S){switch(S){case 0:return ws(L.topLeftBorderDoubleInnerBox,L.topLeftPaddingBox,L.topRightBorderDoubleInnerBox,L.topRightPaddingBox);case 1:return ws(L.topRightBorderDoubleInnerBox,L.topRightPaddingBox,L.bottomRightBorderDoubleInnerBox,L.bottomRightPaddingBox);case 2:return ws(L.bottomRightBorderDoubleInnerBox,L.bottomRightPaddingBox,L.bottomLeftBorderDoubleInnerBox,L.bottomLeftPaddingBox);default:return ws(L.bottomLeftBorderDoubleInnerBox,L.bottomLeftPaddingBox,L.topLeftBorderDoubleInnerBox,L.topLeftPaddingBox)}},Nce=function(L,S){switch(S){case 0:return Vv(L.topLeftBorderStroke,L.topRightBorderStroke);case 1:return Vv(L.topRightBorderStroke,L.bottomRightBorderStroke);case 2:return Vv(L.bottomRightBorderStroke,L.bottomLeftBorderStroke);default:return Vv(L.bottomLeftBorderStroke,L.topLeftBorderStroke)}},Vv=function(L,S){var F=[];return ys(L)?F.push(L.subdivide(.5,!1)):F.push(L),ys(S)?F.push(S.subdivide(.5,!0)):F.push(S),F},ws=function(L,S,F,_){var q=[];return ys(L)?q.push(L.subdivide(.5,!1)):q.push(L),ys(F)?q.push(F.subdivide(.5,!0)):q.push(F),ys(_)?q.push(_.subdivide(.5,!0).reverse()):q.push(_),ys(S)?q.push(S.subdivide(.5,!1).reverse()):q.push(S),q},ET=function(L){var S=L.bounds,F=L.styles;return S.add(F.borderLeftWidth,F.borderTopWidth,-(F.borderRightWidth+F.borderLeftWidth),-(F.borderTopWidth+F.borderBottomWidth))},jv=function(L){var S=L.styles,F=L.bounds,_=Yr(S.paddingLeft,F.width),q=Yr(S.paddingRight,F.width),$=Yr(S.paddingTop,F.width),de=Yr(S.paddingBottom,F.width);return F.add(_+S.borderLeftWidth,$+S.borderTopWidth,-(S.borderRightWidth+S.borderLeftWidth+_+q),-(S.borderTopWidth+S.borderBottomWidth+$+de))},Hce=function(L,S){return L===0?S.bounds:L===2?jv(S):ET(S)},Vce=function(L,S){return L===0?S.bounds:L===2?jv(S):ET(S)},V7=function(L,S,F){var _=Hce(cp(L.styles.backgroundOrigin,S),L),q=Vce(cp(L.styles.backgroundClip,S),L),$=jce(cp(L.styles.backgroundSize,S),F,_),de=$[0],be=$[1],ke=kl(cp(L.styles.backgroundPosition,S),_.width-de,_.height-be);return[Qce(cp(L.styles.backgroundRepeat,S),ke,$,_,q),Math.round(_.left+ke[0]),Math.round(_.top+ke[1]),de,be]},lp=function(L){return Jt(L)&&L.value===uf.AUTO},Qv=function(L){return typeof L=="number"},jce=function(L,S,F){var _=S[0],q=S[1],$=S[2],de=L[0],be=L[1];if(!de)return[0,0];if(pi(de)&&be&&pi(be))return[Yr(de,F.width),Yr(be,F.height)];var ke=Qv($);if(Jt(de)&&(de.value===uf.CONTAIN||de.value===uf.COVER))return Qv($)?F.width/F.height<$==(de.value===uf.COVER)?[F.height*$,F.height]:[F.width,F.width/$]:[F.width,F.height];var We=Qv(_),lt=Qv(q),ft=We||lt;if(lp(de)&&(!be||lp(be)))return We&&lt?[_,q]:!ke&&!ft?[F.width,F.height]:ft&&ke?[We?_:q*$,lt?q:_/$]:[We?_:F.width,lt?q:F.height];if(ke){var Et=0,ri=0;return pi(de)?Et=Yr(de,F.width):pi(be)&&(ri=Yr(be,F.height)),lp(de)?Et=ri*$:(!be||lp(be))&&(ri=Et/$),[Et,ri]}var Ut=null,Gt=null;if(pi(de)?Ut=Yr(de,F.width):be&&pi(be)&&(Gt=Yr(be,F.height)),Ut!==null&&(!be||lp(be))&&(Gt=We&&lt?Ut/_*q:F.height),Gt!==null&&lp(de)&&(Ut=We&&lt?Gt/q*_:F.width),Ut!==null&&Gt!==null)return[Ut,Gt];throw Error("Unable to calculate background-size for element")},cp=function(L,S){var F=L[S];return F===void 0?L[0]:F},Qce=function(L,S,F,_,q){var $=S[0],de=S[1],be=F[0],ke=F[1];switch(L){case 2:return[new Yt(Math.round(_.left),Math.round(_.top+de)),new Yt(Math.round(_.left+_.width),Math.round(_.top+de)),new Yt(Math.round(_.left+_.width),Math.round(ke+_.top+de)),new Yt(Math.round(_.left),Math.round(ke+_.top+de))];case 3:return[new Yt(Math.round(_.left+$),Math.round(_.top)),new Yt(Math.round(_.left+$+be),Math.round(_.top)),new Yt(Math.round(_.left+$+be),Math.round(_.height+_.top)),new Yt(Math.round(_.left+$),Math.round(_.height+_.top))];case 1:return[new Yt(Math.round(_.left+$),Math.round(_.top+de)),new Yt(Math.round(_.left+$+be),Math.round(_.top+de)),new Yt(Math.round(_.left+$+be),Math.round(_.top+de+ke)),new Yt(Math.round(_.left+$),Math.round(_.top+de+ke))];default:return[new Yt(Math.round(q.left),Math.round(q.top)),new Yt(Math.round(q.left+q.width),Math.round(q.top)),new Yt(Math.round(q.left+q.width),Math.round(q.height+q.top)),new Yt(Math.round(q.left),Math.round(q.height+q.top))]}},zce="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",MT="Hidden Text",qce=(function(){function L(S){this._data={},this._document=S}return L.prototype.parseMetrics=function(S,F){var _=this._document.createElement("div"),q=this._document.createElement("img"),$=this._document.createElement("span"),de=this._document.body;_.style.visibility="hidden",_.style.fontFamily=S,_.style.fontSize=F,_.style.margin="0",_.style.padding="0",_.style.whiteSpace="nowrap",de.appendChild(_),q.src=zce,q.width=1,q.height=1,q.style.margin="0",q.style.padding="0",q.style.verticalAlign="baseline",$.style.fontFamily=S,$.style.fontSize=F,$.style.margin="0",$.style.padding="0",$.appendChild(this._document.createTextNode(MT)),_.appendChild($),_.appendChild(q);var be=q.offsetTop-$.offsetTop+2;_.removeChild($),_.appendChild(this._document.createTextNode(MT)),_.style.lineHeight="normal",q.style.verticalAlign="super";var ke=q.offsetTop-_.offsetTop+2;return de.removeChild(_),{baseline:be,middle:ke}},L.prototype.getMetrics=function(S,F){var _=S+" "+F;return this._data[_]===void 0&&(this._data[_]=this.parseMetrics(S,F)),this._data[_]},L})(),PT=(function(){function L(S,F){this.context=S,this.options=F}return L})(),Gce=1e4,Kce=(function(L){o(S,L);function S(F,_){var q=L.call(this,F,_)||this;return q._activeEffects=[],q.canvas=_.canvas?_.canvas:document.createElement("canvas"),q.ctx=q.canvas.getContext("2d"),_.canvas||(q.canvas.width=Math.floor(_.width*_.scale),q.canvas.height=Math.floor(_.height*_.scale),q.canvas.style.width=_.width+"px",q.canvas.style.height=_.height+"px"),q.fontMetrics=new qce(document),q.ctx.scale(q.options.scale,q.options.scale),q.ctx.translate(-_.x,-_.y),q.ctx.textBaseline="bottom",q._activeEffects=[],q.context.logger.debug("Canvas renderer initialized ("+_.width+"x"+_.height+") with scale "+_.scale),q}return S.prototype.applyEffects=function(F){for(var _=this;this._activeEffects.length;)this.popEffect();F.forEach(function(q){return _.applyEffect(q)})},S.prototype.applyEffect=function(F){this.ctx.save(),Rce(F)&&(this.ctx.globalAlpha=F.opacity),Lce(F)&&(this.ctx.translate(F.offsetX,F.offsetY),this.ctx.transform(F.matrix[0],F.matrix[1],F.matrix[2],F.matrix[3],F.matrix[4],F.matrix[5]),this.ctx.translate(-F.offsetX,-F.offsetY)),wT(F)&&(this.path(F.path),this.ctx.clip()),this._activeEffects.push(F)},S.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},S.prototype.renderStack=function(F){return n(this,void 0,void 0,function(){var _;return a(this,function(q){switch(q.label){case 0:return _=F.element.container.styles,_.isVisible()?[4,this.renderStackContent(F)]:[3,2];case 1:q.sent(),q.label=2;case 2:return[2]}})})},S.prototype.renderNode=function(F){return n(this,void 0,void 0,function(){return a(this,function(_){switch(_.label){case 0:if($o(F.container.flags,16))debugger;return F.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(F)]:[3,3];case 1:return _.sent(),[4,this.renderNodeContent(F)];case 2:_.sent(),_.label=3;case 3:return[2]}})})},S.prototype.renderTextWithLetterSpacing=function(F,_,q){var $=this;_===0?this.ctx.fillText(F.text,F.bounds.left,F.bounds.top+q):P7(F.text).reduce(function(de,be){return $.ctx.fillText(be,de,F.bounds.top+q),de+$.ctx.measureText(be).width},F.bounds.left)},S.prototype.createFontStyle=function(F){var _=F.fontVariant.filter(function(de){return de==="normal"||de==="small-caps"}).join(""),q=Xce(F.fontFamily).join(", "),$=hi(F.fontSize)?""+F.fontSize.number+F.fontSize.unit:F.fontSize.number+"px";return[[F.fontStyle,_,F.fontWeight,$,q].join(" "),q,$]},S.prototype.renderTextNode=function(F,_){return n(this,void 0,void 0,function(){var q,$,de,be,ke,We,lt,ft,Et=this;return a(this,function(ri){return q=this.createFontStyle(_),$=q[0],de=q[1],be=q[2],this.ctx.font=$,this.ctx.direction=_.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",ke=this.fontMetrics.getMetrics(de,be),We=ke.baseline,lt=ke.middle,ft=_.paintOrder,F.textBounds.forEach(function(Ut){ft.forEach(function(Gt){switch(Gt){case 0:Et.ctx.fillStyle=dn(_.color),Et.renderTextWithLetterSpacing(Ut,_.letterSpacing,We);var Xi=_.textShadow;Xi.length&&Ut.text.trim().length&&(Xi.slice(0).reverse().forEach(function(mi){Et.ctx.shadowColor=dn(mi.color),Et.ctx.shadowOffsetX=mi.offsetX.number*Et.options.scale,Et.ctx.shadowOffsetY=mi.offsetY.number*Et.options.scale,Et.ctx.shadowBlur=mi.blur.number,Et.renderTextWithLetterSpacing(Ut,_.letterSpacing,We)}),Et.ctx.shadowColor="",Et.ctx.shadowOffsetX=0,Et.ctx.shadowOffsetY=0,Et.ctx.shadowBlur=0),_.textDecorationLine.length&&(Et.ctx.fillStyle=dn(_.textDecorationColor||_.color),_.textDecorationLine.forEach(function(mi){switch(mi){case 1:Et.ctx.fillRect(Ut.bounds.left,Math.round(Ut.bounds.top+We),Ut.bounds.width,1);break;case 2:Et.ctx.fillRect(Ut.bounds.left,Math.round(Ut.bounds.top),Ut.bounds.width,1);break;case 3:Et.ctx.fillRect(Ut.bounds.left,Math.ceil(Ut.bounds.top+lt),Ut.bounds.width,1);break}}));break;case 1:_.webkitTextStrokeWidth&&Ut.text.trim().length&&(Et.ctx.strokeStyle=dn(_.webkitTextStrokeColor),Et.ctx.lineWidth=_.webkitTextStrokeWidth,Et.ctx.lineJoin=window.chrome?"miter":"round",Et.ctx.strokeText(Ut.text,Ut.bounds.left,Ut.bounds.top+We)),Et.ctx.strokeStyle="",Et.ctx.lineWidth=0,Et.ctx.lineJoin="miter";break}})}),[2]})})},S.prototype.renderReplacedElement=function(F,_,q){if(q&&F.intrinsicWidth>0&&F.intrinsicHeight>0){var $=jv(F),de=Nv(_);this.path(de),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(q,0,0,F.intrinsicWidth,F.intrinsicHeight,$.left,$.top,$.width,$.height),this.ctx.restore()}},S.prototype.renderNodeContent=function(F){return n(this,void 0,void 0,function(){var _,q,$,de,be,ke,fi,fi,We,lt,ft,Et,Ar,ri,Ut,ki,Gt,Xi,mi,fi,to,Ar,ki;return a(this,function(ei){switch(ei.label){case 0:this.applyEffects(F.getEffects(4)),_=F.container,q=F.curves,$=_.styles,de=0,be=_.textNodes,ei.label=1;case 1:return de<be.length?(ke=be[de],[4,this.renderTextNode(ke,$)]):[3,4];case 2:ei.sent(),ei.label=3;case 3:return de++,[3,1];case 4:if(!(_ instanceof GD))return[3,8];ei.label=5;case 5:return ei.trys.push([5,7,,8]),[4,this.context.cache.match(_.src)];case 6:return fi=ei.sent(),this.renderReplacedElement(_,q,fi),[3,8];case 7:return ei.sent(),this.context.logger.error("Error loading image "+_.src),[3,8];case 8:if(_ instanceof KD&&this.renderReplacedElement(_,q,_.canvas),!(_ instanceof JD))return[3,12];ei.label=9;case 9:return ei.trys.push([9,11,,12]),[4,this.context.cache.match(_.svg)];case 10:return fi=ei.sent(),this.renderReplacedElement(_,q,fi),[3,12];case 11:return ei.sent(),this.context.logger.error("Error loading svg "+_.svg.substring(0,255)),[3,12];case 12:return _ instanceof $D&&_.tree?(We=new S(this.context,{scale:this.options.scale,backgroundColor:_.backgroundColor,x:0,y:0,width:_.width,height:_.height}),[4,We.render(_.tree)]):[3,14];case 13:lt=ei.sent(),_.width&&_.height&&this.ctx.drawImage(lt,0,0,_.width,_.height,_.bounds.left,_.bounds.top,_.bounds.width,_.bounds.height),ei.label=14;case 14:if(_ instanceof S7&&(ft=Math.min(_.bounds.width,_.bounds.height),_.type===Sv?_.checked&&(this.ctx.save(),this.path([new Yt(_.bounds.left+ft*.39363,_.bounds.top+ft*.79),new Yt(_.bounds.left+ft*.16,_.bounds.top+ft*.5549),new Yt(_.bounds.left+ft*.27347,_.bounds.top+ft*.44071),new Yt(_.bounds.left+ft*.39694,_.bounds.top+ft*.5649),new Yt(_.bounds.left+ft*.72983,_.bounds.top+ft*.23),new Yt(_.bounds.left+ft*.84,_.bounds.top+ft*.34085),new Yt(_.bounds.left+ft*.39363,_.bounds.top+ft*.79)]),this.ctx.fillStyle=dn(WD),this.ctx.fill(),this.ctx.restore()):_.type===Dv&&_.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(_.bounds.left+ft/2,_.bounds.top+ft/2,ft/4,0,Math.PI*2,!0),this.ctx.fillStyle=dn(WD),this.ctx.fill(),this.ctx.restore())),Jce(_)&&_.value.length){switch(Et=this.createFontStyle($),Ar=Et[0],ri=Et[1],Ut=this.fontMetrics.getMetrics(Ar,ri).baseline,this.ctx.font=Ar,this.ctx.fillStyle=dn($.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Wce(_.styles.textAlign),ki=jv(_),Gt=0,_.styles.textAlign){case 1:Gt+=ki.width/2;break;case 2:Gt+=ki.width;break}Xi=ki.add(Gt,0,0,-ki.height/2+1),this.ctx.save(),this.path([new Yt(ki.left,ki.top),new Yt(ki.left+ki.width,ki.top),new Yt(ki.left+ki.width,ki.top+ki.height),new Yt(ki.left,ki.top+ki.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new hf(_.value,Xi),$.letterSpacing,Ut),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!$o(_.styles.display,2048))return[3,20];if(_.styles.listStyleImage===null)return[3,19];if(mi=_.styles.listStyleImage,mi.type!==0)return[3,18];fi=void 0,to=mi.url,ei.label=15;case 15:return ei.trys.push([15,17,,18]),[4,this.context.cache.match(to)];case 16:return fi=ei.sent(),this.ctx.drawImage(fi,_.bounds.left-(fi.width+10),_.bounds.top),[3,18];case 17:return ei.sent(),this.context.logger.error("Error loading list-style-image "+to),[3,18];case 18:return[3,20];case 19:F.listValue&&_.styles.listStyleType!==-1&&(Ar=this.createFontStyle($)[0],this.ctx.font=Ar,this.ctx.fillStyle=dn($.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",ki=new l(_.bounds.left,_.bounds.top+Yr(_.styles.paddingTop,_.bounds.width),_.bounds.width,ED($.lineHeight,$.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new hf(F.listValue,ki),$.letterSpacing,ED($.lineHeight,$.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),ei.label=20;case 20:return[2]}})})},S.prototype.renderStackContent=function(F){return n(this,void 0,void 0,function(){var _,q,mi,$,de,mi,be,ke,mi,We,lt,mi,ft,Et,mi,ri,Ut,mi,Gt,Xi,mi;return a(this,function(fi){switch(fi.label){case 0:if($o(F.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(F.element)];case 1:fi.sent(),_=0,q=F.negativeZIndex,fi.label=2;case 2:return _<q.length?(mi=q[_],[4,this.renderStack(mi)]):[3,5];case 3:fi.sent(),fi.label=4;case 4:return _++,[3,2];case 5:return[4,this.renderNodeContent(F.element)];case 6:fi.sent(),$=0,de=F.nonInlineLevel,fi.label=7;case 7:return $<de.length?(mi=de[$],[4,this.renderNode(mi)]):[3,10];case 8:fi.sent(),fi.label=9;case 9:return $++,[3,7];case 10:be=0,ke=F.nonPositionedFloats,fi.label=11;case 11:return be<ke.length?(mi=ke[be],[4,this.renderStack(mi)]):[3,14];case 12:fi.sent(),fi.label=13;case 13:return be++,[3,11];case 14:We=0,lt=F.nonPositionedInlineLevel,fi.label=15;case 15:return We<lt.length?(mi=lt[We],[4,this.renderStack(mi)]):[3,18];case 16:fi.sent(),fi.label=17;case 17:return We++,[3,15];case 18:ft=0,Et=F.inlineLevel,fi.label=19;case 19:return ft<Et.length?(mi=Et[ft],[4,this.renderNode(mi)]):[3,22];case 20:fi.sent(),fi.label=21;case 21:return ft++,[3,19];case 22:ri=0,Ut=F.zeroOrAutoZIndexOrTransformedOrOpacity,fi.label=23;case 23:return ri<Ut.length?(mi=Ut[ri],[4,this.renderStack(mi)]):[3,26];case 24:fi.sent(),fi.label=25;case 25:return ri++,[3,23];case 26:Gt=0,Xi=F.positiveZIndex,fi.label=27;case 27:return Gt<Xi.length?(mi=Xi[Gt],[4,this.renderStack(mi)]):[3,30];case 28:fi.sent(),fi.label=29;case 29:return Gt++,[3,27];case 30:return[2]}})})},S.prototype.mask=function(F){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(F.slice(0).reverse()),this.ctx.closePath()},S.prototype.path=function(F){this.ctx.beginPath(),this.formatPath(F),this.ctx.closePath()},S.prototype.formatPath=function(F){var _=this;F.forEach(function(q,$){var de=ys(q)?q.start:q;$===0?_.ctx.moveTo(de.x,de.y):_.ctx.lineTo(de.x,de.y),ys(q)&&_.ctx.bezierCurveTo(q.startControl.x,q.startControl.y,q.endControl.x,q.endControl.y,q.end.x,q.end.y)})},S.prototype.renderRepeat=function(F,_,q,$){this.path(F),this.ctx.fillStyle=_,this.ctx.translate(q,$),this.ctx.fill(),this.ctx.translate(-q,-$)},S.prototype.resizeImage=function(F,_,q){if(F.width===_&&F.height===q)return F;var $=(this.canvas.ownerDocument??document).createElement("canvas");return $.width=Math.max(1,_),$.height=Math.max(1,q),$.getContext("2d").drawImage(F,0,0,F.width,F.height,0,0,_,q),$},S.prototype.renderBackgroundImage=function(F){return n(this,void 0,void 0,function(){var _,q,$,de,be,ke;return a(this,function(We){switch(We.label){case 0:_=F.styles.backgroundImage.length-1,q=function(lt){var ft,Et,ri,jn,Pl,Il,lo,za,er,Ut,jn,Pl,Il,lo,za,Gt,Xi,mi,fi,to,Ar,ki,ei,cr,er,_i,jn,Ml,Tc,lo,za,zv,Pl,Il,j7,dp,qv,Q7,z7,gf,q7,G7;return a(this,function(up){switch(up.label){case 0:if(lt.type!==0)return[3,5];ft=void 0,Et=lt.url,up.label=1;case 1:return up.trys.push([1,3,,4]),[4,$.context.cache.match(Et)];case 2:return ft=up.sent(),[3,4];case 3:return up.sent(),$.context.logger.error("Error loading background-image "+Et),[3,4];case 4:return ft&&(ri=V7(F,_,[ft.width,ft.height,ft.width/ft.height]),jn=ri[0],Pl=ri[1],Il=ri[2],lo=ri[3],za=ri[4],er=$.ctx.createPattern($.resizeImage(ft,lo,za),"repeat"),$.renderRepeat(jn,er,Pl,Il)),[3,6];case 5:Vae(lt)?(Ut=V7(F,_,[null,null,null]),jn=Ut[0],Pl=Ut[1],Il=Ut[2],lo=Ut[3],za=Ut[4],Gt=Fae(lt.angle,lo,za),Xi=Gt[0],mi=Gt[1],fi=Gt[2],to=Gt[3],Ar=Gt[4],ki=document.createElement("canvas"),ki.width=lo,ki.height=za,ei=ki.getContext("2d"),cr=ei.createLinearGradient(mi,to,fi,Ar),fD(lt.stops,Xi).forEach(function(mf){return cr.addColorStop(mf.stop,dn(mf.color))}),ei.fillStyle=cr,ei.fillRect(0,0,lo,za),lo>0&&za>0&&(er=$.ctx.createPattern(ki,"repeat"),$.renderRepeat(jn,er,Pl,Il))):jae(lt)&&(_i=V7(F,_,[null,null,null]),jn=_i[0],Ml=_i[1],Tc=_i[2],lo=_i[3],za=_i[4],zv=lt.position.length===0?[qd]:lt.position,Pl=Yr(zv[0],lo),Il=Yr(zv[zv.length-1],za),j7=Uae(lt,Pl,Il,lo,za),dp=j7[0],qv=j7[1],dp>0&&qv>0&&(Q7=$.ctx.createRadialGradient(Ml+Pl,Tc+Il,0,Ml+Pl,Tc+Il,dp),fD(lt.stops,dp*2).forEach(function(mf){return Q7.addColorStop(mf.stop,dn(mf.color))}),$.path(jn),$.ctx.fillStyle=Q7,dp===qv?$.ctx.fill():(z7=F.bounds.left+.5*F.bounds.width,gf=F.bounds.top+.5*F.bounds.height,q7=qv/dp,G7=1/q7,$.ctx.save(),$.ctx.translate(z7,gf),$.ctx.transform(1,0,0,q7,0,0),$.ctx.translate(-z7,-gf),$.ctx.fillRect(Ml,G7*(Tc-gf)+gf,lo,za*G7),$.ctx.restore()))),up.label=6;case 6:return _--,[2]}})},$=this,de=0,be=F.styles.backgroundImage.slice(0).reverse(),We.label=1;case 1:return de<be.length?(ke=be[de],[5,q(ke)]):[3,4];case 2:We.sent(),We.label=3;case 3:return de++,[3,1];case 4:return[2]}})})},S.prototype.renderSolidBorder=function(F,_,q){return n(this,void 0,void 0,function(){return a(this,function($){return this.path(kT(q,_)),this.ctx.fillStyle=dn(F),this.ctx.fill(),[2]})})},S.prototype.renderDoubleBorder=function(F,_,q,$){return n(this,void 0,void 0,function(){var de,be;return a(this,function(ke){switch(ke.label){case 0:return _<3?[4,this.renderSolidBorder(F,q,$)]:[3,2];case 1:return ke.sent(),[2];case 2:return de=Uce($,q),this.path(de),this.ctx.fillStyle=dn(F),this.ctx.fill(),be=Oce($,q),this.path(be),this.ctx.fill(),[2]}})})},S.prototype.renderNodeBackgroundAndBorders=function(F){return n(this,void 0,void 0,function(){var _,q,$,de,be,ke,We,lt,ft=this;return a(this,function(Et){switch(Et.label){case 0:return this.applyEffects(F.getEffects(2)),_=F.container.styles,q=!Kd(_.backgroundColor)||_.backgroundImage.length,$=[{style:_.borderTopStyle,color:_.borderTopColor,width:_.borderTopWidth},{style:_.borderRightStyle,color:_.borderRightColor,width:_.borderRightWidth},{style:_.borderBottomStyle,color:_.borderBottomColor,width:_.borderBottomWidth},{style:_.borderLeftStyle,color:_.borderLeftColor,width:_.borderLeftWidth}],de=Zce(cp(_.backgroundClip,0),F.curves),q||_.boxShadow.length?(this.ctx.save(),this.path(de),this.ctx.clip(),Kd(_.backgroundColor)||(this.ctx.fillStyle=dn(_.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(F.container)]):[3,2];case 1:Et.sent(),this.ctx.restore(),_.boxShadow.slice(0).reverse().forEach(function(ri){ft.ctx.save();var Ut=Ov(F.curves),Gt=ri.inset?0:Gce,Xi=_ce(Ut,-Gt+(ri.inset?1:-1)*ri.spread.number,(ri.inset?1:-1)*ri.spread.number,ri.spread.number*(ri.inset?-2:2),ri.spread.number*(ri.inset?-2:2));ri.inset?(ft.path(Ut),ft.ctx.clip(),ft.mask(Xi)):(ft.mask(Ut),ft.ctx.clip(),ft.path(Xi)),ft.ctx.shadowOffsetX=ri.offsetX.number+Gt,ft.ctx.shadowOffsetY=ri.offsetY.number,ft.ctx.shadowColor=dn(ri.color),ft.ctx.shadowBlur=ri.blur.number,ft.ctx.fillStyle=ri.inset?dn(ri.color):"rgba(0,0,0,1)",ft.ctx.fill(),ft.ctx.restore()}),Et.label=2;case 2:be=0,ke=0,We=$,Et.label=3;case 3:return ke<We.length?(lt=We[ke],lt.style!==0&&!Kd(lt.color)&&lt.width>0?lt.style===2?[4,this.renderDashedDottedBorder(lt.color,lt.width,be,F.curves,2)]:[3,5]:[3,11]):[3,13];case 4:return Et.sent(),[3,11];case 5:return lt.style===3?[4,this.renderDashedDottedBorder(lt.color,lt.width,be,F.curves,3)]:[3,7];case 6:return Et.sent(),[3,11];case 7:return lt.style===4?[4,this.renderDoubleBorder(lt.color,lt.width,be,F.curves)]:[3,9];case 8:return Et.sent(),[3,11];case 9:return[4,this.renderSolidBorder(lt.color,be,F.curves)];case 10:Et.sent(),Et.label=11;case 11:be++,Et.label=12;case 12:return ke++,[3,3];case 13:return[2]}})})},S.prototype.renderDashedDottedBorder=function(F,_,q,$,de){return n(this,void 0,void 0,function(){var be,ke,We,lt,ft,Et,ri,Ut,Gt,Xi,mi,fi,to,Ar,ki,ei,ki,ei;return a(this,function(cr){return this.ctx.save(),be=Nce($,q),ke=kT($,q),de===2&&(this.path(ke),this.ctx.clip()),ys(ke[0])?(We=ke[0].start.x,lt=ke[0].start.y):(We=ke[0].x,lt=ke[0].y),ys(ke[1])?(ft=ke[1].end.x,Et=ke[1].end.y):(ft=ke[1].x,Et=ke[1].y),ri=Math.abs(q===0||q===2?We-ft:lt-Et),this.ctx.beginPath(),de===3?this.formatPath(be):this.formatPath(ke.slice(0,2)),Ut=_<3?_*3:_*2,Gt=_<3?_*2:_,de===3&&(Ut=_,Gt=_),Xi=!0,ri<=Ut*2?Xi=!1:ri<=Ut*2+Gt?(mi=ri/(2*Ut+Gt),Ut*=mi,Gt*=mi):(fi=Math.floor((ri+Gt)/(Ut+Gt)),to=(ri-fi*Ut)/(fi-1),Ar=(ri-(fi+1)*Ut)/fi,Gt=Ar<=0||Math.abs(Gt-to)<Math.abs(Gt-Ar)?to:Ar),Xi&&(de===3?this.ctx.setLineDash([0,Ut+Gt]):this.ctx.setLineDash([Ut,Gt])),de===3?(this.ctx.lineCap="round",this.ctx.lineWidth=_):this.ctx.lineWidth=_*2+1.1,this.ctx.strokeStyle=dn(F),this.ctx.stroke(),this.ctx.setLineDash([]),de===2&&(ys(ke[0])&&(ki=ke[3],ei=ke[0],this.ctx.beginPath(),this.formatPath([new Yt(ki.end.x,ki.end.y),new Yt(ei.start.x,ei.start.y)]),this.ctx.stroke()),ys(ke[1])&&(ki=ke[1],ei=ke[2],this.ctx.beginPath(),this.formatPath([new Yt(ki.end.x,ki.end.y),new Yt(ei.start.x,ei.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},S.prototype.render=function(F){return n(this,void 0,void 0,function(){var _;return a(this,function(q){switch(q.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=dn(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),_=Fce(F),[4,this.renderStack(_)];case 1:return q.sent(),this.applyEffects([]),[2,this.canvas]}})})},S})(PT),Jce=function(L){return L instanceof XD||L instanceof YD?!0:L instanceof S7&&L.type!==Dv&&L.type!==Sv},Zce=function(L,S){switch(L){case 0:return Ov(S);case 2:return Sce(S);default:return Nv(S)}},Wce=function(L){switch(L){case 1:return"center";case 2:return"right";default:return"left"}},Yce=["-apple-system","system-ui"],Xce=function(L){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?L.filter(function(S){return Yce.indexOf(S)===-1}):L},$ce=(function(L){o(S,L);function S(F,_){var q=L.call(this,F,_)||this;return q.canvas=_.canvas?_.canvas:document.createElement("canvas"),q.ctx=q.canvas.getContext("2d"),q.options=_,q.canvas.width=Math.floor(_.width*_.scale),q.canvas.height=Math.floor(_.height*_.scale),q.canvas.style.width=_.width+"px",q.canvas.style.height=_.height+"px",q.ctx.scale(q.options.scale,q.options.scale),q.ctx.translate(-_.x,-_.y),q.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+_.width+"x"+_.height+" at "+_.x+","+_.y+") with scale "+_.scale),q}return S.prototype.render=function(F){return n(this,void 0,void 0,function(){var _,q;return a(this,function($){switch($.label){case 0:return _=M7(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,F),[4,ede(_)];case 1:return q=$.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=dn(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(q,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},S})(PT),ede=function(L){return new Promise(function(S,F){var _=new Image;_.onload=function(){S(_)},_.onerror=F,_.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(L))})},tde=(function(){function L(S){var F=S.id,_=S.enabled;this.id=F,this.enabled=_,this.start=Date.now()}return L.prototype.debug=function(){var S=[...arguments];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,s([this.id,this.getTime()+"ms"],S)):this.info.apply(this,S))},L.prototype.getTime=function(){return Date.now()-this.start},L.prototype.info=function(){var S=[...arguments];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,s([this.id,this.getTime()+"ms"],S))},L.prototype.warn=function(){var S=[...arguments];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,s([this.id,this.getTime()+"ms"],S)):this.info.apply(this,S))},L.prototype.error=function(){var S=[...arguments];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,s([this.id,this.getTime()+"ms"],S)):this.info.apply(this,S))},L.instances={},L})(),ide=(function(){function L(S,F){this.windowBounds=F,this.instanceName="#"+L.instanceCount++,this.logger=new tde({id:this.instanceName,enabled:S.logging}),this.cache=S.cache??new Cce(this,S)}return L.instanceCount=1,L})(),rde=function(L,S){return S===void 0&&(S={}),ode(L,S)};typeof window<"u"&&yT.setContext(window);var ode=function(L,S){return n(void 0,void 0,void 0,function(){var F,_,q,$,de,be,ke,We,lt,ft,Et,ri,Ut,Gt,Xi,mi,fi,to,Ar,ki,cr,ei,cr;return a(this,function(er){switch(er.label){case 0:if(!L||typeof L!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(F=L.ownerDocument,!F)throw Error("Element is not attached to a Document");if(_=F.defaultView,!_)throw Error("Document is not attached to a Window");return q={allowTaint:S.allowTaint??!1,imageTimeout:S.imageTimeout??15e3,proxy:S.proxy,useCORS:S.useCORS??!1},$=r({logging:S.logging??!0,cache:S.cache},q),de={windowWidth:S.windowWidth??_.innerWidth,windowHeight:S.windowHeight??_.innerHeight,scrollX:S.scrollX??_.pageXOffset,scrollY:S.scrollY??_.pageYOffset},be=new l(de.scrollX,de.scrollY,de.windowWidth,de.windowHeight),ke=new ide($,be),We=S.foreignObjectRendering??!1,lt={allowTaint:S.allowTaint??!1,onclone:S.onclone,ignoreElements:S.ignoreElements,inlineImages:We,copyStyles:We},ke.logger.debug("Starting document clone with size "+be.width+"x"+be.height+" scrolled to "+-be.left+","+-be.top),ft=new mT(ke,L,lt),Et=ft.clonedReferenceElement,Et?[4,ft.toIFrame(F,be)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return ri=er.sent(),Ut=T7(Et)||nce(Et)?d(Et.ownerDocument):c(ke,Et),Gt=Ut.width,Xi=Ut.height,mi=Ut.left,fi=Ut.top,to=nde(ke,Et,S.backgroundColor),Ar={canvas:S.canvas,backgroundColor:to,scale:S.scale??_.devicePixelRatio??1,x:(S.x??0)+mi,y:(S.y??0)+fi,width:S.width??Math.ceil(Gt),height:S.height??Math.ceil(Xi)},We?(ke.logger.debug("Document cloned, using foreign object rendering"),cr=new $ce(ke,Ar),[4,cr.render(Et)]):[3,3];case 2:return ki=er.sent(),[3,5];case 3:return ke.logger.debug("Document cloned, element located at "+mi+","+fi+" with size "+Gt+"x"+Xi+" using computed rendering"),ke.logger.debug("Starting DOM parsing"),ei=tT(ke,Et),to===ei.styles.backgroundColor&&(ei.styles.backgroundColor=Sc.TRANSPARENT),ke.logger.debug("Starting renderer for element at "+Ar.x+","+Ar.y+" with size "+Ar.width+"x"+Ar.height),cr=new Kce(ke,Ar),[4,cr.render(ei)];case 4:ki=er.sent(),er.label=5;case 5:return(S.removeContainer??!0)&&(mT.destroy(ri)||ke.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),ke.logger.debug("Finished rendering"),[2,ki]}})})},nde=function(L,S,F){var _=S.ownerDocument,q=_.documentElement?df(L,getComputedStyle(_.documentElement).backgroundColor):Sc.TRANSPARENT,$=_.body?df(L,getComputedStyle(_.body).backgroundColor):Sc.TRANSPARENT,de=typeof F=="string"?df(L,F):F===null?Sc.TRANSPARENT:4294967295;return S===_.documentElement?Kd(q)?Kd($)?de:$:q:de};return rde}))}))(),1);async function O5(e){let t=!1,i,o;document.fullscreenElement===e&&(t=!0,i=e.style.width,o=e.style.height,e.style.width="100vw",e.style.height="100vh");let r=await(0,U5.default)(e);return t&&(e.style.width=i,e.style.height=o),r.toDataURL()}var g$e={props:{elements:{type:Array,required:!0},shortcuts:{type:Array,required:!0}}},m$e={class:"shortcuts-modal"},v$e={class:"shortcuts-modal__title"},y$e={class:"shortcuts-modal__content"},w$e={class:"shortcuts-modal__content-left"},b$e={class:"shortcuts-modal__content-left__element__image"},C$e={class:"shortcuts-modal__content-left__element__text"},x$e={class:"shortcuts-modal__content-right"},B$e={class:"shortcuts-modal__content-right__element__shortcut"},k$e={key:0,class:"letter"},E$e={key:1,class:"flex items-center"},M$e={class:"maj"},P$e={class:"icon"},I$e={key:2,class:"flex items-center"},S$e={class:"icon"},D$e={key:3,class:"flex items-center"},T$e={class:"icon"},L$e={class:"shortcuts-modal__content-right__element__text"},R$e={class:"shortcuts-modal__footer"};function _$e(e,t,i,o,r,n){let a=I("BIMDataIllustration"),s=I("BIMDataIconAlt"),l=I("BIMDataButton");return k(),N("div",m$e,[w("div",v$e,[w("span",null,[Pt(e.$slots,"title",{},void 0,!0)])]),w("div",y$e,[w("div",w$e,[(k(!0),N(ut,null,Vt(i.elements,c=>(k(),N("div",{key:c.title,class:"shortcuts-modal__content-left__element"},[w("div",b$e,[T(a,{name:c.image,x:"200",y:"200"},null,8,["name"])]),w("div",C$e,[w("h3",null,G(c.title),1),w("p",null,G(c.text),1)])]))),128))]),w("div",x$e,[(k(!0),N(ut,null,Vt(i.shortcuts,c=>(k(),N("div",{key:c.text,class:"shortcuts-modal__content-right__element"},[w("div",B$e,[c.letter?(k(),N("span",k$e,G(c.letter),1)):le("",!0),c.maj?(k(),N("div",E$e,[w("span",M$e,[T(s,{size:"xxs",class:"fill-primary"})]),t[1]||=w("span",{class:"more"},"+",-1),w("div",P$e,[T(a,{name:c.illustration,x:"23",y:"30"},null,8,["name"])])])):le("",!0),c.alt?(k(),N("div",I$e,[t[2]||=w("span",{class:"alt"}," alt ",-1),t[3]||=w("span",{class:"more"},"+",-1),w("div",S$e,[T(a,{name:c.illustration,x:"23",y:"30"},null,8,["name"])])])):le("",!0),c.shift?(k(),N("div",D$e,[t[4]||=w("span",{class:"alt"}," shift ",-1),t[5]||=w("span",{class:"more"},"+",-1),w("div",T$e,[T(a,{name:c.illustration,x:"23",y:"30"},null,8,["name"])])])):le("",!0)]),w("div",L$e,G(c.text),1)]))),128))])]),w("div",R$e,[T(l,{fill:"",color:"primary",radius:"",width:"166px",onClick:t[0]||=c=>e.$emit("close")},{default:j(()=>[nt(G(e.$t("shortcuts-helper.btn")),1)]),_:1})])])}var N5=Q(g$e,[["render",_$e],["__scopeId","data-v-e7d92a04"]]),F$e={components:{ShortcutsModal:N5},data(){return{elements:[{image:"shortcutMove2D",title:this.$t("shortcuts-helper.title_move"),text:this.$t("shortcuts-helper.text_move")},{image:"shortcutRotate2D",title:this.$t("shortcuts-helper.title_rotate_2d"),text:this.$t("shortcuts-helper.text_rotate_2d")},{image:"shortcutZoom2D",title:this.$t("shortcuts-helper.title_zoom"),text:this.$t("shortcuts-helper.text_zoom_2d")},{image:"shortcutOpen2D",title:this.$t("shortcuts-helper.title_open"),text:this.$t("shortcuts-helper.text_open_2d")}],shortcuts:[{letter:"F",text:this.$t("context_menu.fit_view")},{letter:"C",text:this.$t("context_menu.select_all")},{letter:"V",text:this.$t("context_menu.deselect_all")},{letter:"H",text:this.$t("context_menu.hide")},{letter:"Y",text:this.$t("context_menu.select_similar")},{letter:"R",text:this.$t("context_menu.show_all")},{alt:!0,text:this.$t("shortcuts-helper.shortcut_open"),illustration:"click"},{shift:!0,text:this.$t("shortcuts-helper.shortcut_multiselect"),illustration:"click"}]}}};function U$e(e,t,i,o,r,n){let a=I("ShortcutsModal");return k(),W(a,{class:"bimdata-shortcuts2d-helper",elements:r.elements,shortcuts:r.shortcuts},{title:j(()=>[nt(G(e.$t("shortcuts-helper.title_modal_2d")),1)]),_:1},8,["elements","shortcuts"])}var O$e=Q(F$e,[["render",U$e],["__scopeId","data-v-9a9c15e3"]]);function H5(e=null){let t=bt("$viewer");e??=t.localContext;let i=Ui(Array.from(t.state.annotations)),o=[t.state.hub.on("annotation-added",({annotation:r})=>{i.value.push(r),kA(i)}),t.state.hub.on("annotation-updated",()=>{kA(i)}),t.state.hub.on("annotation-removed",({annotation:r})=>{i.value=i.value.filter(n=>n.id!==r.id)})];return $i(()=>o.forEach(r=>t.state.hub.off(r))),je(()=>i.value.filter(r=>r.modelIds.length===0?!0:r.modelIds.some(n=>e.loadedModelIds.includes(n))))}var _B=e=>t=>{t.preventDefault();let i=new CustomEvent("wheel",{bubbles:!0,cancelable:!0,detail:t});i.deltaY=t.deltaY,i.clientX=t.clientX,i.clientY=t.clientY,e.dispatchEvent(i)},V5=Q({__name:"AnnotationWrapper",props:{annotation:{type:Object,required:!0},canvas:{type:HTMLCanvasElement,required:!0}},emits:["annotation-drag"],setup(e,{emit:t}){let i=e,o=t,r=pe(null),n=()=>r.value?.querySelector(i.annotation.grabberSelector)??r.value,a=_B(i.canvas),s=!1,l=u=>{u.button!==2&&(u.targetTouches&&(u.stopPropagation(),u.preventDefault()),i.annotation.draggable&&(document.addEventListener("mouseup",c),document.addEventListener("touchend",c),document.addEventListener("touchcancel",c),document.addEventListener("mousemove",d),document.addEventListener("touchmove",d,{passive:!1}),i.annotation.emit("drag-start",{nativeEvent:u})))},c=u=>{i.annotation.draggable&&(document.removeEventListener("mousemove",d),document.removeEventListener("touchmove",d),s&&(s=!1,i.annotation.emit("drag-end",{nativeEvent:u})))},d=u=>{u.targetTouches&&(u.stopPropagation(),u.preventDefault()),i.annotation.draggable&&(u.targetTouches&&(u.clientX=u.targetTouches[0].clientX,u.clientY=u.targetTouches[0].clientY),o("annotation-drag",u),i.annotation.emit("drag",{nativeEvent:u}),s=!0)};return Di(()=>{n()?.addEventListener("mousedown",l),n()?.addEventListener("touchstart",l,{passive:!1})}),Ws(()=>{n()?.removeEventListener("mousedown",l),n()?.removeEventListener("touchstart",l)}),(u,A)=>(k(),N("div",{ref_key:"wrapper",ref:r,class:"annotation-wrapper",onWheel:A[0]||=(...h)=>mt(a)&&mt(a)(...h)},[(k(),W(qr(e.annotation.component),la(e.annotation.props,{annotation:e.annotation}),null,16,["annotation"]))],544))}},[["__scopeId","data-v-840c20b2"]]),N$e={class:"annotations-2d"},FB=Q({__name:"Annotations2D",props:{context:{type:Object,default:null}},setup(e){let t=e,i=bt("$viewer"),o=t.context;o||=i.localContext;let r=o.viewer,n=r.viewer??r.engine,a=n.canvas,s=H5(o),l=je(()=>s.value.filter(u=>!r.selectedStorey||u.z>=r.selectedStorey.absoluteElevation&&u.z<r.selectedStorey.absoluteTopElevation));n.camera.on("update",()=>kA(s));let c=(u,A)=>{let{x:h,y:p}=a.getBoundingClientRect(),{clientX:f,clientY:m}=A,{x:g,y}=n.camera.getPosition({x:f-h,y:m-p});r.ui?.highlightOnHover===!0&&(r.ui.highlightOnHover=!1,setTimeout(()=>r.ui.highlightOnHover=!0,300)),i.state.highlightedObjects.length>0&&i.state.unhighlightObjects(i.state.highlightedObjects.map(v=>v.id)),Object.assign(u,{x:g,y})},d=u=>{let{x:A,y:h}=n.camera.getCanvasPosition(u);return`left: ${A}px; top: ${h}px;`};return(u,A)=>(k(),N("div",N$e,[(k(!0),N(ut,null,Vt(l.value,h=>(k(),W(V5,{key:h.instanceId,annotation:h,canvas:mt(a),style:ve(d(h)),onAnnotationDrag:p=>c(h,p)},null,8,["annotation","canvas","style","onAnnotationDrag"]))),128))]))}},[["__scopeId","data-v-87f776fe"]]),H$e={props:{autoOpen:{type:Boolean,default:!0}},setup(e){let{localContext:t}=bt("$viewer"),i=t.viewer?.plugin.name,o=pe(!0),r=je(()=>t.loadedModels),n=pe(0),a=je(()=>r.value[n.value]||{storeys:[]}),s=je(()=>t.selectedStorey),l=pe(!1),c=()=>{l.value=!l.value},d=g=>g.key===s.value?.key,u=g=>{d(g)||t.selectStorey(g)},A=je(()=>t.shownPlans),h=g=>A.value.some(y=>y.key===g.key),{loadingPlans:p}=tj(t),f=g=>p.value.some(y=>y.key===g.key),m=ko(new Set);return xt([r,a],()=>{r.value.length===0||r.value.length===1&&a.value.type!=="METABUILDING"&&a.value.storeys.length<2&&(a.value.storeys[0]?.plans.length??0)===0?o.value=!1:o.value=!0,o.value&&(i==="viewer2d"||i==="plan"||i==="photosphere")&&(l.value=e.autoOpen)},{immediate:!0}),{currentModelIndex:n,currentModel:a,storeyPlanShown:m,storeyListOpen:l,isVisible:o,models:r,focus:()=>{a.value&&(l.value||=!0,s.value&&m.add(s.value.uuid))},selectStorey:u,togglePlan:g=>{A.value.some(y=>y.key===g.key)?t.hidePlan(g):t.showPlan(g)},togglePlansList:g=>{m.has(g.key)?m.delete(g.key):m.add(g.key)},toggleStoreysList:c,isStoreySelected:d,isPlanShown:h,isPlanLoading:f}}},V$e={class:"storey-selector"},j$e={class:"storey-selector__list"},Q$e=["onClick"],z$e={class:"name"},q$e={class:"count"},G$e={class:"storey-selector__list__entry__content plan-selector__list"},K$e=["onClick"],J$e={key:0,class:"loader"},Z$e={class:"storey-selector__model-switcher"},W$e={class:"actions"};function Y$e(e,t,i,o,r,n){let a=I("BIMDataRadio"),s=I("BIMDataIconStorey"),l=I("BIMDataTextbox"),c=I("BIMDataIconChevron"),d=I("BIMDataButton"),u=I("BIMDataCheckbox"),A=I("BIMDataSpinner"),h=I("BIMDataFileIcon");return k(),N("div",V$e,[T(Qi,{name:"slide-fade-down"},{default:j(()=>[Tt(w("div",j$e,[(k(!0),N(ut,null,Vt(o.currentModel.storeys.slice(),p=>(k(),N("div",{key:p.key,class:"storey-selector__list__entry"},[T(a,{"model-value":o.isStoreySelected(p),"onUpdate:modelValue":f=>o.selectStorey(p)},null,8,["model-value","onUpdate:modelValue"]),w("div",{class:"storey-selector__list__entry__line",onClick:f=>o.selectStorey(p)},[T(s,{size:"xs"}),w("span",z$e,[T(l,{text:p.name},null,8,["text"])]),p.plans.length>0?(k(),N(ut,{key:0},[w("span",q$e,G(p.plans.length),1),T(d,{width:"26px",height:"26px",ghost:"",rounded:"",icon:"",onClick:Dt(f=>o.togglePlansList(p),["stop"])},{default:j(()=>[T(c,{size:"xxs",rotate:o.storeyPlanShown.has(p.key)?90:0,style:{transition:"transform 0.1s linear"}},null,8,["rotate"])]),_:2},1032,["onClick"])],64)):le("",!0)],8,Q$e),T(Qi,{name:"slide-fade-up"},{default:j(()=>[Tt(w("div",G$e,[(k(!0),N(ut,null,Vt(p.plans,f=>(k(),N("div",{key:`${f.key}`,class:"plan-selector__list__entry"},[T(u,{class:"plan-selector__list__entry__checkbox",disabled:!o.isStoreySelected(p)||o.isPlanLoading(f),"model-value":o.isPlanShown(f),"onUpdate:modelValue":m=>o.togglePlan(f)},null,8,["disabled","model-value","onUpdate:modelValue"]),w("div",{class:"plan-selector__list__entry__line",style:{cursor:"pointer"},onClick:Dt(m=>{o.isStoreySelected(p)&&!o.isPlanLoading(f)&&o.togglePlan(f)},["stop"])},[o.isPlanLoading(f)?(k(),N("span",J$e,[T(A)])):(k(),W(h,{key:1,"file-name":f.plan.document?.file_name||f.plan.name,size:14},null,8,["file-name"])),T(l,{"max-width":"200px",text:f.plan.name},null,8,["text"])],8,K$e)]))),128))],512),[[ui,o.storeyPlanShown.has(p.key)]])]),_:2},1024)]))),128))],512),[[ui,o.storeyListOpen&&o.isVisible]])]),_:1}),Tt(w("div",Z$e,[T(d,{width:"26px",height:"26px",ghost:"",radius:"",icon:"",disabled:o.currentModel.storeys.length===0,onClick:o.toggleStoreysList},{default:j(()=>[T(c,{size:"xxs",rotate:o.storeyListOpen?-90:0,style:{transition:"transform 0.1s linear"}},null,8,["rotate"])]),_:1},8,["disabled","onClick"]),w("span",{class:"name",onClick:t[0]||=(...p)=>o.toggleStoreysList&&o.toggleStoreysList(...p)},[T(l,{text:o.currentModel.name,"tooltip-position":"top"},null,8,["text"])]),w("span",W$e,[T(d,{width:"26px",height:"26px",ghost:"",rounded:"",icon:"",disabled:o.currentModelIndex===0,onClick:t[1]||=p=>o.currentModelIndex--},{default:j(()=>[T(c,{size:"xxs",rotate:180})]),_:1},8,["disabled"]),T(d,{width:"26px",height:"26px",ghost:"",rounded:"",icon:"",disabled:o.currentModelIndex===o.models.length-1,onClick:t[2]||=p=>o.currentModelIndex++},{default:j(()=>[T(c,{size:"xxs"})]),_:1},8,["disabled"])])],512),[[ui,o.isVisible]])])}var UB=Q(H$e,[["render",Y$e],["__scopeId","data-v-c590c341"]]),X$e={props:{modal:{type:Object,required:!0},name:{type:String,required:!0}},mounted(){localStorage.getItem("BIMDataViewer_helpShown_"+this.name)||(this.$viewer.localContext.modals.pushModal(this.modal),localStorage.setItem("BIMDataViewer_helpShown_"+this.name,!0))},methods:{onClick(){this.$viewer.localContext.modals.pushModal(this.modal)}}};function $$e(e,t,i,o,r,n){return k(),N("div",{class:"bimdata-help-shortcuts",onClick:t[0]||=(...a)=>n.onClick&&n.onClick(...a)},"?")}var j5=Q(X$e,[["render",$$e],["__scopeId","data-v-78103e0c"]]);function Q5(e,t,i={}){if(!Array.isArray(t)||t.some(d=>!Number.isFinite(d.x)||!Number.isFinite(d.y)))throw TypeError("[Viewer2d - drawArea] An array of point with x and y properties as finit numbers is requested.");let o=ql(),{lineWidth:r=1,lineColor:n=o,lineOpacity:a=1,fill:s=o,fillOpacity:l=.2}=i,c=e.scene.addObject({shapes:[{style:{lineWidth:r,lineColor:n,lineOpacity:a,fill:s,fillOpacity:l,nonScalingLineWidth:!0},paths:[{type:"line",points:t.flatMap(({x:d,y:u})=>[d,u]),close:!0}]}]});return{object:c,get visible(){return c.visible},set visible(d){c.visible=!!d},points:t,destroy(){e.scene.removeObject(c.id)}}}var eet={name:"Viewer2D",components:{Annotations:FB,BIMDataStoreySelector:UB,Help:j5},data(){let{settings:e}=this.$plugin;return{settings:e,model:null,loading:!1,highlightOnHover:!0,selectOnClick:!0,storeyRightOffset:0,spacesVisible:!0,doorsDisplayed:!1,compassDisplayed:e.compass!==!1,camera3DSynchronization:!1,engine2dCreated:!1,modelHeaderShown:e.modelLoader!=="hidden",annotationMode:!1,helpShown:e.help!==!1,storeySelectorShown:e.storeySelector!==!1,storeySelectorAutoOpen:e.storeySelectorAutoOpen!==!1}},computed:{ifc(){return this.model},selectedStorey(){return this.$viewer.localContext.selectedStorey}},created(){this.helpModal=O$e,this.localContextSubscriptions=[],this.stateSubscriptions=[],this.queue=h1(new Promise(e=>{this.mounted=e}))},watch:{loading(e){e?this.$viewer.localContext.loadingProcessStart():this.$viewer.localContext.loadingProcessEnd()},selectedStorey(e){e?this.plugins.spaceNames.show(e):this.plugins.spaceNames.clear(),this.cameraObject&&this.viewer.scene.showObjects([this.cameraObject.object.id]),e&&this.plugins.bitmaps&&this.plugins.bitmaps.showPlans(e.plans)},doorsDisplayed(e){e?this.plugins.doors.enable():this.plugins.doors.disable()},compassDisplayed(e){e?this.plugins.compass.show():this.plugins.compass.hide()}},mounted(){this.$viewer.localContext.el.addEventListener("contextmenu",this.onContextMenu);let e=d1({canvas:this.$refs.canvas});if(e.styles.default.lineWidth=.01,e.settings.rotateSpeed=.05,e.settings.snapMargin=.04,e.textureManager.textureMatrix.scale(.01,.01),this.viewer=e,this.engine=e,window.engine2d=this.viewer,this.engine2dCreated=!0,this.ui=p$e(this),this.plugins=SB(this),this.unsubscribe=A$e(this),this.plugins.bitmaps){let t=this.plugins.bitmaps;this.localContextSubscriptions.push(this.$viewer.localContext.hub.on("plan-shown",({plan:i})=>{t.showPlan(i)}),this.$viewer.localContext.hub.on("plan-hidden",({plan:i})=>{t.hidePlan(i)})),this.stateSubscriptions.push(this.$viewer.state.hub.on("plan-deleted",({plan:i})=>{t.deletePlan(i)}))}this.$watch("selectOnClick",t=>{this.ui.selectOnClick=t},{immediate:!0}),this.$watch("highlightOnHover",t=>{this.ui.highlightOnHover=t},{immediate:!0}),this.$watch("camera3DSynchronization",t=>{t?(this.cameraObject||=f$e(this.viewer),this.camera3DSubscription=this.$viewer.globalContext.hub.on("3d-camera-update",i=>{let{eye:o,look:r,up:n}=i;this.syncRotationFrom3DCamera(o,r,n);let[a,,s]=o,[l,,c]=r;this.cameraObject.sync({x:a,y:s},{x:l,y:c})},{getLastEvent:!0})):(this.$viewer.globalContext.hub.off(this.camera3DSubscription),this.cameraObject?.destroy(),this.cameraObject=null)},{immediate:!0}),this.registerShortcuts(),this.mounted()},unmounted(){this.$viewer.localContext.el?.removeEventListener("contextmenu",this.onContextMenu),this.$viewer.globalContext.hub.off(this.camera3DSubscription),[...this.defaultShortcutNames??[],"fitview"].forEach(e=>this.$viewer.localContext.unregisterShortcut(e)),this.queue?.clear(),this.unsubscribe?.(),Object.values(this.plugins).forEach(e=>e.destroy?.()),this.viewer?.destroy(),this.localContextSubscriptions.forEach(e=>this.$viewer.localContext.hub.off(e)),this.stateSubscriptions.forEach(e=>this.$viewer.state.hub.off(e))},methods:{setSpacesVisible(e){let t=this.selectedStorey?.objects.filter(i=>i.type==="space").map(i=>String(i.id))??[];e?this.selectedStorey&&(this.viewer.scene.showObjects(t),this.plugins.spaceNames.show(this.selectedStorey)):(this.viewer.scene.hideObjects(t),this.plugins.spaceNames.clear()),this.spacesVisible=e},syncRotationFrom3DCamera(e=[0,0,0],t=[0,0,0],i=[0,1,0]){if(Math.abs(i[0])<2**-52||Math.abs(i[1])<2**-52)return;let{angle:o,sub:r,normalize:n}=this.viewer.utils.vector2D,[a,,s]=e,[l,,c]=t,d=n(r({x:a,y:s},{x:l,y:c}));if(Math.abs(d.x)<2**-52&&Math.abs(d.y)<2**-52)return;let u=null;u=d.x<0?o(d,{x:0,y:1}):o({x:0,y:1},d);let A=i[1]>0?180:0,h=u/Math.PI*180+A;this.viewer.camera.setViewpoint({rotation:h})},hideUI(){this.modelHeaderShown=!1,this.helpShown=!1,this.storeySelectorShown=!1},showUI(){this.modelHeaderShown=this.settings.modelLoader!=="hidden",this.helpShown=this.settings.help!==!1,this.storeySelectorShown=this.settings.storeySelector!==!1},registerShortcuts(){let e=this.$viewer.shortcutManager.getDefaultShortcuts(()=>this.selectedStorey?.objects??[]);this.defaultShortcutNames=e.map(t=>t.name),[...e,{name:"fitview",key:"F",execute:()=>this.fitViewSelectedObjects()}].forEach(t=>this.$viewer.localContext.registerShortcut(t))},onContextMenu(){let e=this,t=this.$viewer.contextMenu;if([...t.getDefaultCommands({objects:this.selectedStorey?.objects??[],context:this.$viewer.localContext}),{get label(){return e.$t("global.fit_view")},picto:"F",execute:()=>this.fitViewSelectedObjects()}].map(i=>t.registerContextCommand(i)),this.camera3DSynchronization&&this.$viewer.globalContext.pluginComponentInstances.has("viewer3d")){let i=this.$viewer.globalContext.pluginComponentInstances.get("viewer3d")[0];this.$viewer.contextMenu.registerContextCommand({get label(){return e.$t("viewer2d.move_3d_camera")},execute:o=>{let{clientX:r,clientY:n}=o,{x:a,y:s}=this.viewer.canvas.getBoundingClientRect(),l=this.viewer.camera.getPosition({x:r-a,y:n-s}),c=i.xeokit.camera.eye;i.xeokit.cameraFlight.flyTo({eye:[l.x,c[1],l.y]})}})}},fitViewSelectedObjects(){console.warn("[BIMData Viewer] DEPRECATED - viewer2d - `fitViewSelectedObjects` is deprecated use `fitView` instead."),this.fitView(this.viewer.scene.selectedObjects)},fitView(e){if(e.length>0){if(typeof e[0]=="object"){console.warn("[BIMData Viewer] DEPRECATED - fitView should be called with an array of uuids instead of objects"),this.viewer.camera.fitView(e);return}let t=this.$viewer.state.getObjectsByUuids(e).map(i=>this.viewer.scene.objectsMap.get(String(i.id))).filter(Boolean);this.viewer.camera.fitView(t)}else this.viewer.camera.fitView()},async load2DEngineIfc(e){this.loadIfcFromSVG||=R5(this);let t=await this.loadIfcFromSVG(e.map_file,e.id,e.onlyLoadUuids);if(e.recommanded_2d_angle!==void 0){let i=this.viewer.camera.rotation;this.viewer.camera.rotate(-i-e.recommanded_2d_angle)}this.viewer.camera.fitView(t)},loadIfc(e){return console.warn("[BIMData Viewer] DEPRECATED - viewer2d: `loadIfc` is deprecated use `loadModels` instead."),this.loadModels([e])},async loadModels(e,t=null){let i=e[0];if(!i.map_file)throw Error("Viewer --- ERROR --- Viewer2D Plugin - Impossible to load ifc without a map_file.");return this.loading=!0,new Promise((o,r)=>{this.queue.push(async()=>{try{this.model&&this.unloadIfc(this.model,!1),await this.load2DEngineIfc(i),this.plugins.compass.onIfcChange(i),this.loading=!1,this.model=i;let n={model:i,ifc:i,plugin:this};if(this.$viewer.localContext.hub.emit("2d-model-loaded",n),this.$viewer.globalContext.hub.emit("2d-model-loaded",n),i.storeys.length>0){let a=0;if(t?.storeyKey){let s=i.storeys.findIndex(l=>l.key===t.storeyKey);s!==-1&&(a=s)}this.$viewer.localContext.selectStorey(i.storeys[a])}o()}catch(n){r(n)}finally{this.loading=!1}})})},unloadIfc(e,t=!0){return console.warn("[BIMData Viewer] DEPRECATED - viewer2d: `unloadIfc` is deprecated use `unloadModels` instead."),this.unloadModels([e],t)},unloadModels(e,t=!0){let i=e[0],o=()=>{if(this.$viewer.localContext.selectStorey(null),this.model=null,this.viewer.scene.removeModel(String(i.id))){let r={model:i,ifc:i,plugin:this};return this.$viewer.localContext.hub.emit("2d-model-unloaded",r),this.$viewer.globalContext.hub.emit("2d-model-unloaded",r),!0}else return!1};t?this.queue.push(o):o()},async getSnapshot(){return{snapshot_type:"png",snapshot_data:await O5(this.$el)}},getViewpoint(){if(!this.selectedStorey)return;let e=this.viewer.camera.getViewpoint(),t=this.viewer.utils.vector2D.rotateAround({x:1,y:0},{x:0,y:0},e.rotation/180*Math.PI);return{order:3,originating_system:"ifc2d",models:this.$viewer.localContext.loadedModels.map(i=>i.id),orthogonal_camera:{camera_direction:{x:0,y:0,z:-1},camera_up_vector:{...t,z:0},camera_view_point:{x:e.x,y:e.y,z:this.selectedStorey.absoluteElevation},view_to_world_scale:e.zoom}}},async setViewpoint(e){if(this.loading){let a=null;await new Promise(s=>{a=this.$watch("loading",l=>{l||s()},{immediate:!0})}),a()}if(!this.model)return;let{camera_view_point:t,camera_up_vector:i,view_to_world_scale:o}=e.orthogonal_camera,r=this.$viewer.state.getStoreyFromAbsoluteElevation(this.model,t.z);this.$viewer.localContext.selectStorey(r);let n=this.viewer.utils.vector2D.angle({x:1,y:0},i);this.viewer.camera.setViewpoint({...t,rotation:-(n/Math.PI)*180,zoom:o})},startAnnotationMode(e){this.annotationMode||(this.annotationMode=!0,this.selectOnClick=!1,this.ui.enabled=!1,this.canvasCursor=this.viewer.canvas.style.cursor,this.viewer.canvas.style.cursor="copy",this.annotationListener=this.viewer.ui.on("click",({canvasPosition:t})=>{let{x:i,y:o}=this.viewer.camera.getPosition(t),r=this.selectedStorey,n=this.viewer.picker.pick(t),a=this.$viewer.state.objectsMap.get(+n?.id)??null;e({x:i,y:o,z:r.absoluteElevation,models:this.$viewer.localContext.loadedModels,storey:r,object:a})}))},stopAnnotationMode(){this.annotationMode&&(this.annotationMode=!1,this.selectOnClick=!0,this.ui.enabled=!0,this.viewer.canvas.style.cursor=this.canvasCursor,this.viewer.ui.off(this.annotationListener))},drawArea(e,t){return Q5(this.viewer,e,t)}}},tet={class:"bimdata-viewer2d"},iet={ref:"canvas",class:"bimdata-viewer2d__viewer__canvas"},ret={ref:"texter",style:{position:"absolute",top:"0px",left:"0px"}},oet={class:"bimdata-viewer2d__header"};function net(e,t,i,o,r,n){let a=I("Annotations"),s=I("NoModelWindowPlaceHolder"),l=I("ModelsLoader"),c=I("Help"),d=I("BIMDataStoreySelector");return k(),N("div",tet,[w("canvas",iet,null,512),w("div",ret,null,512),e.engine2dCreated?(k(),W(a,{key:0})):le("",!0),!e.ifc&&!e.loading?(k(),W(s,{key:1})):le("",!0),w("div",oet,[e.settings.modelLoader==="disabled"?le("",!0):Tt((k(),W(l,{key:0,ref:"header","window-positioning":!1},null,512)),[[ui,e.modelHeaderShown]]),e.helpShown?(k(),W(c,{key:1,modal:e.helpModal,name:"2D"},null,8,["modal"])):le("",!0)]),Tt(T(d,{ref:"storeySelector","auto-open":e.storeySelectorAutoOpen},null,8,["auto-open"]),[[ui,e.storeySelectorShown]])])}var aet={name:"viewer2d",isViewer:!0,i18n:{de:{window_label:"2D-Viewer",compass:{N:"N",NE:"NO",E:"O",SE:"SO",S:"S",SW:"SW",W:"W",NW:"NW"},move_3d_camera:"Bewegen Sie die 3D-Kamera hierher"},en:{window_label:"2D Viewer",compass:{N:"N",NE:"NE",E:"E",SE:"SE",S:"S",SW:"SW",W:"W",NW:"NW"},move_3d_camera:"Move the 3D camera here"},es:{window_label:"Visor 2D",compass:{N:"N",NE:"NE",E:"E",SE:"SE",S:"S",SW:"SO",W:"O",NW:"NO"},move_3d_camera:"Mueva la c\xE1mara 3D aqu\xED"},fr:{window_label:"Visionneuse 2D",compass:{N:"N",NE:"NE",E:"E",SE:"SE",S:"S",SW:"SO",W:"O",NW:"NO"},move_3d_camera:"D\xE9placer la cam\xE9ra 3D ici"},it:{window_label:"Visualizzatore 2D",compass:{N:"N",NE:"NE",E:"E",SE:"SE",S:"S",SW:"SO",W:"O",NW:"NO"},move_3d_camera:"Sposta qui la fotocamera 3D"}},component:Q(eet,[["render",net],["__scopeId","data-v-c1d8ad28"]]),window:{name:"2d",label:"viewer2d.window_label",plugins:["fullscreen"],header:!1,icon:{imgUri:"data:image/svg+xml,%3csvg%20width='34'%20height='31'%20viewBox='0%200%2034%2031'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0%200H22.3399V12.9335H26.0665L24.4253%2014.5747H20.5579V1.64122H12.6918V8.49273H12.6918V9.47627H12.6918V14.4431H11.6238V9.47627H9.38118V8.77118L8.11422%206.74457L8.578%206.49865L9.82463%208.49273H11.6238V1.64122H1.78206V8.49273H6.33753V9.47627H1.78206V18.8199H8.55356V19.8034H1.78206V26.3588H14.8444V19.8034H11.5971L11.5971%2019.0443L10.2855%2016.9463L10.7493%2016.7004L12.0744%2018.8199H14.9078V18.8347H20.1653L18.5241%2020.4759H16.6264V28H0V0Z'%20fill='%232F374A'/%3e%3crect%20x='4.1546'%20y='21.9932'%20width='8.09972'%20height='2.55908'%20fill='%23F8C62C'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M22.4478%2020.8232L26.1748%2017.0962V19.6435V20.8232H22.4478ZM32.438%2017.4031C32.438%2016.6314%2031.8136%2016%2031.0419%2016H25.4294L21.2201%2020.2093V28.628C21.2201%2029.3997%2021.8513%2030.0311%2022.6232%2030.0311H31.0489C31.8206%2030.0311%2032.445%2029.3997%2032.445%2028.628L32.438%2017.4031Z'%20fill='%232F374A'/%3e%3crect%20x='20'%20y='23.3208'%20width='13.421'%20height='5.49043'%20rx='1'%20fill='%23205DBD'/%3e%3cpath%20d='M23.4905%2028.2011H22.5969V23.864H23.4905V28.2011Z'%20fill='white'/%3e%3cpath%20d='M26.9309%2026.4287H25.2152V28.2011H24.3216V23.864H27.1454V24.5879H25.2152V25.7079H26.9309V26.4287Z'%20fill='white'/%3e%3cpath%20d='M31.0684%2026.7564C31.0347%2027.2231%2030.8619%2027.5904%2030.5501%2027.8585C30.2403%2028.1266%2029.8312%2028.2607%2029.3229%2028.2607C28.7668%2028.2607%2028.329%2028.074%2028.0092%2027.7006C27.6915%2027.3253%2027.5326%2026.811%2027.5326%2026.1577V25.8925C27.5326%2025.4755%2027.6061%2025.1081%2027.7531%2024.7904C27.9%2024.4727%2028.1095%2024.2294%2028.3816%2024.0606C28.6556%2023.8898%2028.9734%2023.8044%2029.3348%2023.8044C29.8352%2023.8044%2030.2383%2023.9385%2030.5442%2024.2066C30.85%2024.4747%2031.0267%2024.851%2031.0744%2025.3355H30.1808C30.1589%2025.0555%2030.0805%2024.853%2029.9454%2024.7279C29.8124%2024.6008%2029.6088%2024.5372%2029.3348%2024.5372C29.0369%2024.5372%2028.8135%2024.6445%2028.6646%2024.8589C28.5176%2025.0714%2028.4422%2025.402%2028.4382%2025.8508V26.1785C28.4382%2026.6472%2028.5087%2026.9897%2028.6497%2027.2062C28.7927%2027.4226%2029.0171%2027.5309%2029.3229%2027.5309C29.5989%2027.5309%2029.8044%2027.4683%2029.9395%2027.3432C30.0765%2027.2161%2030.1549%2027.0205%2030.1748%2026.7564H31.0684Z'%20fill='white'/%3e%3c/svg%3e"},modelTypes:["IFC"],multiModel:!1}},set="data:image/svg+xml,%3csvg%20width='42'%20height='40'%20viewBox='0%200%2042%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_d)'%3e%3cmask%20id='path-1-inside-1'%20fill='white'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.10059%2020.1082L11.6969%2015.8022V18.4526L30.2653%2018.4526V15.8035L37.8616%2020.1094L30.2653%2024.4153V21.7673L11.6969%2021.7673V24.4141L4.10059%2020.1082Z'/%3e%3c/mask%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.10059%2020.1082L11.6969%2015.8022V18.4526L30.2653%2018.4526V15.8035L37.8616%2020.1094L30.2653%2024.4153V21.7673L11.6969%2021.7673V24.4141L4.10059%2020.1082Z'%20fill='%232F374A'/%3e%3cpath%20d='M11.6969%2015.8022L12.4969%2015.8022V14.4292L11.3024%2015.1063L11.6969%2015.8022ZM4.10059%2020.1082L3.70608%2019.4122L2.47829%2020.1082L3.70608%2020.8041L4.10059%2020.1082ZM11.6969%2018.4526H10.8969V19.2526H11.6969V18.4526ZM30.2653%2018.4526V19.2526H31.0653V18.4526H30.2653ZM30.2653%2015.8035L30.6598%2015.1075L29.4653%2014.4304V15.8035H30.2653ZM37.8616%2020.1094L38.2562%2020.8053L39.4839%2020.1094L38.2562%2019.4134L37.8616%2020.1094ZM30.2653%2024.4153H29.4653V25.7883L30.6598%2025.1112L30.2653%2024.4153ZM30.2653%2021.7673H31.0653V20.9673H30.2653V21.7673ZM11.6969%2021.7673V20.9673H10.8969V21.7673H11.6969ZM11.6969%2024.4141L11.3024%2025.11L12.4969%2025.7871V24.4141H11.6969ZM11.3024%2015.1063L3.70608%2019.4122L4.49509%2020.8041L12.0914%2016.4982L11.3024%2015.1063ZM12.4969%2018.4526L12.4969%2015.8022L10.8969%2015.8022V18.4526H12.4969ZM30.2653%2017.6526L11.6969%2017.6526V19.2526L30.2653%2019.2526V17.6526ZM31.0653%2018.4526V15.8035H29.4653V18.4526H31.0653ZM29.8708%2016.4994L37.4671%2020.8053L38.2562%2019.4134L30.6598%2015.1075L29.8708%2016.4994ZM37.4671%2019.4134L29.8708%2023.7193L30.6598%2025.1112L38.2562%2020.8053L37.4671%2019.4134ZM31.0653%2024.4153V21.7673H29.4653V24.4153H31.0653ZM11.6969%2022.5673L30.2653%2022.5673V20.9673L11.6969%2020.9673V22.5673ZM12.4969%2024.4141V21.7673H10.8969V24.4141H12.4969ZM3.70608%2020.8041L11.3024%2025.11L12.0914%2023.7181L4.49509%2019.4122L3.70608%2020.8041Z'%20fill='white'%20mask='url(%23path-1-inside-1)'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d'%20x='0.100586'%20y='12.8022'%20width='41.7611'%20height='16.613'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='1'/%3e%3cfeGaussianBlur%20stdDeviation='2'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.25%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",cet={props:{label:{type:String,default:""},container:HTMLElement,step:{type:Number,default:1},labelWidth:{type:String,default:"50px"},modelValue:{type:Number,default:null},digits:{type:Number,default:2},unit:{type:String,default:""},grabber:{type:Boolean,default:!1},centered:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},min:{type:Number,default:null},max:{type:Number,default:null}},emits:["update:modelValue"],data(){return{focused:!1,grabbing:!1,cursor:set,cursorTranslate:{x:0,y:0}}},computed:{fixedValue(){return+this.modelValue.toFixed(this.digits)},cursorTransform(){return`transform: translate(${this.cursorTranslate.x}px, ${this.cursorTranslate.y}px)`}},mounted(){let e=this.$refs.input;this.focused=e===document.activeElement,document.addEventListener("keydown",this.keydownHandler=i=>{i.key==="Enter"&&e.blur()});let t=this.$refs.label;t.addEventListener("mousedown",i=>{document.addEventListener("mousemove",this.onMouseMove),t.requestPointerLock(),this.grabbing=!0;let{clientX:o,clientY:r}=i,{x:n,y:a}=this.$el.getBoundingClientRect();this.elPosition={x:n,y:a},this.container&&(this.containerRect=this.container.getBoundingClientRect()),this.cursorTranslate={x:o-n,y:r-a}}),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",this.onMouseMove),document.exitPointerLock(),this.grabbing=!1,this.containerRect=null,this.elPosition=null})},unmounted(){document.removeEventListener("keydown",this.keydownHandler)},methods:{onMouseMove(e){if(this.cursorTranslate={x:this.cursorTranslate.x+e.movementX,y:this.cursorTranslate.y+e.movementY},this.containerRect){let{x:t,y:i,width:o,height:r}=this.containerRect;for(;this.cursorTranslate.x+this.elPosition.x-t>o;)this.cursorTranslate.x-=o;for(;this.cursorTranslate.x+this.elPosition.x<t;)this.cursorTranslate.x+=o;for(;this.cursorTranslate.y+this.elPosition.y-i>r;)this.cursorTranslate.y-=r;for(;this.cursorTranslate.y+this.elPosition.y<i;)this.cursorTranslate.y+=r}this.requestUpdate(this.modelValue+e.movementX*this.step)},onMouseDown(e){e.preventDefault(),this.focus()},focus(){let e=this.$refs.input;e&&e.focus()},blur(){let e=this.$refs.input;e&&e.blur()},onFocus(){this.focused=!0},onBlur(){this.focused=!1},onChange(e){let t=this.fixedValue,i=parseFloat(e.target.value);isNaN(i)&&(i=t),this.requestUpdate(i)},requestUpdate(e){this.min!==null&&(e=Math.max(this.min,e)),this.max!==null&&(e=Math.min(this.max,e)),this.$emit("update:modelValue",e)},away(){this.blur()}}},det=["value","disabled"],uet=["src"];function Aet(e,t,i,o,r,n){let a=Li("click-away");return Tt((k(),N("div",{class:ye(["bimdata-numerical-input",{"bimdata-numerical-input--focus":r.focused}]),onMousedown:t[3]||=(...s)=>n.onMouseDown&&n.onMouseDown(...s)},[Tt(w("span",{ref:"label",class:"bimdata-numerical-input__label",style:ve(`width: ${i.labelWidth}`)},G(i.label),5),[[ui,i.label]]),w("input",{ref:"input",class:ye(["bimdata-numerical-input__input",{"bimdata-numerical-input__input--centered":i.centered}]),value:`${n.fixedValue}${i.unit}`,disabled:i.disabled,onChange:t[0]||=(...s)=>n.onChange&&n.onChange(...s),onFocus:t[1]||=(...s)=>n.onFocus&&n.onFocus(...s),onBlur:t[2]||=(...s)=>n.onBlur&&n.onBlur(...s)},null,42,det),r.grabbing?(k(),N("div",{key:0,class:"bimdata-numerical-input__cursor",style:ve(n.cursorTransform)},[w("img",{src:r.cursor,style:{transform:"translate(-50%, -50%)"}},null,8,uet)],4)):le("",!0)],34)),[[a,n.away]])}var Ij=Q(cet,[["render",Aet],["__scopeId","data-v-7438b65a"]]),het={components:{BIMDataNumericalInput:Ij},setup(){let e=bt("$viewer"),t=bt("root"),i=je(()=>t.editedBitmap?t.editedBitmap:{x:0,y:0,scale:0,angle:0,opacity:0}),o=pet(i);return{root:t,bitmap:i,...o,submit:async()=>{try{if(t.loading=!0,t.editedBitmap.plan){let{x:n,y:a,scale:s,angle:l,opacity:c,plan:d}=t.editedBitmap,u={...d.plan.transform};Object.assign(d.plan.transform,{translate:[n,a],rotate:l,scale:s,opacity:c}),await e.state.updatePlan(d,u)}else{let{x:n,y:a,angle:s,scale:l,opacity:c}=i.value,d={translate:[n??0,a??0],rotate:s??0,scale:l??1,opacity:c??1},u=await e.state.createPlan(t.model,t.selectedStorey,i.value.document,d);i.value.plan=u}i.value.edited=!1,t.page="home"}catch(n){console.error(n)}finally{t.loading=!1}}}}};function pet(e){let t={};return Object.entries({x:i=>i,y:i=>i,scale:i=>i,angle:i=>i<0||i>360?(i%360+360)%360:i,opacity:i=>i<0?0:i>1?1:i}).forEach(([i,o])=>{t[i]=je({get:()=>e.value[i],set:r=>e.value[i]=o(r)})}),t}var fet={class:"viewer2d-background__page__edit"},get={class:"viewer2d-background__page__edit__content"},met={class:"viewer2d-background__page__edit__content__unit-group"},vet={class:"viewer2d-background__page__edit__content__unit-group__element"},yet={class:"viewer2d-background__page__edit__content__unit-group__element"},wet={class:"viewer2d-background__page__edit__content__unit-group__element"},bet={class:"viewer2d-background__page__edit__content__unit"},Cet={class:"viewer2d-background__page__edit__content__unit"},xet={class:"viewer2d-background__page__edit__content__img"},Bet=["src"],ket={class:"viewer2d-background__page__edit__validate"};function Eet(e,t,i,o,r,n){let a=I("BIMDataNumericalInput"),s=I("BIMDataSlider"),l=I("BIMDataTextbox"),c=I("BIMDataButton");return k(),N("div",fet,[w("div",get,[w("section",null,[w("span",null,G(e.$t("viewer2d-background.location")),1),w("div",met,[w("div",vet,[T(a,{modelValue:e.x,"onUpdate:modelValue":t[0]||=d=>e.x=d,label:"X",container:e.$viewer.localContext.el},null,8,["modelValue","container"])]),w("div",yet,[T(a,{modelValue:e.y,"onUpdate:modelValue":t[1]||=d=>e.y=d,label:"Y",container:e.$viewer.localContext.el},null,8,["modelValue","container"])]),w("div",wet,[T(a,{modelValue:e.scale,"onUpdate:modelValue":t[2]||=d=>e.scale=d,label:e.$t("viewer2d-background.scale"),step:.01,min:.01,container:e.$viewer.localContext.el},null,8,["modelValue","label","container"])])])]),w("section",null,[w("span",null,G(e.$t("viewer2d-background.rotation")),1),w("div",bet,[T(a,{modelValue:e.angle,"onUpdate:modelValue":t[3]||=d=>e.angle=d,unit:"\xB0",centered:""},null,8,["modelValue"]),T(s,{modelValue:e.angle,"onUpdate:modelValue":t[4]||=d=>e.angle=d,min:0,max:360},null,8,["modelValue"])])]),w("section",null,[w("span",null,G(e.$t("viewer2d-background.alpha")),1),w("div",Cet,[T(a,{modelValue:e.opacity,"onUpdate:modelValue":t[5]||=d=>e.opacity=d,centered:""},null,8,["modelValue"]),T(s,{modelValue:e.opacity,"onUpdate:modelValue":t[6]||=d=>e.opacity=d,min:0,max:1,step:.01},null,8,["modelValue"])])]),w("section",null,[w("span",null,G(e.$t("viewer2d-background.preview")),1),w("div",xet,[w("img",{src:o.bitmap.dataUrl,alt:"Background"},null,8,Bet),T(l,{text:o.bitmap.name,class:"viewer2d-background__page__edit__content__img__name"},null,8,["text"])])])]),w("div",ket,[T(c,{width:"100%",color:"primary",fill:"",radius:"",onClick:o.submit},{default:j(()=>[nt(G(o.bitmap&&o.bitmap.plan?e.$t("global.save"):e.$t("global.validate")),1)]),_:1},8,["onClick"])])])}var Met=Q(het,[["render",Eet],["__scopeId","data-v-a022440a"]]);function Sj(e,t){let i=t.anchorSynchronization===!0&&e.windowManager.registeredWindows.has("anchor-synchronization");return{anchorSynchronizationWindowAvailable:i,openAnchorSynchronizationWindow:async({model:o,storey:r,modelToSynchronize:n})=>{if(!i)throw Error("Anchor Synchronization window is not registered");if(!o||!n)throw Error("Both model and modelToSynchronize must be provided");let a=e.globalContext.getLayout(!1);e.globalContext.hub.emit("anchor-synchronization:open",a),e.globalContext.layout={windowName:"anchor-synchronization"},await Ir(),e.globalContext.localContexts[0].plugins.get("anchor-synchronization-window").synchronize(o,r,n)}}}var Pet={components:{BIMDataGED:O4},setup(){let e=bt("viewer2d"),t=bt("root"),i=bt("$plugin"),o=e.$viewer,{openAnchorSynchronizationWindow:r,anchorSynchronizationWindowAvailable:n}=Sj(o,i),a=pe(null);return{root:t,selectedDocument:a,submit:async()=>{try{t.loading=!0;let s=a.value,l=await o.api.createModel(s.id);if(l=await o.api.waitForModelProcess(l),n){let c=o.state.modelsMap.get(l.id);if(c||=(await o.state.loadModels([l.id],{silent:!0}))[0],!c)throw Error("Plan model not found");await r({model:t.model,storey:t.selectedStorey,modelToSynchronize:c})}else{let{x:c,y:d}=e.viewer.camera.position,u=(e.viewer.camera.rotation%360+360)%360,A={translate:[c,d],rotate:u,scale:1,opacity:1},h=await e.plugins.bitmaps.createBitmap(s,{plan:l},A);h.plan=null,h.edited=!0,t.editedBitmap=h,t.page="edit"}}catch(s){console.error(s),t.page="home"}finally{a.value=null,t.loading=!1}}}}},Iet={class:"viewer2d-background__page__ged"},Det={class:"viewer2d-background__page__ged__button"};function Tet(e,t,i,o,r,n){let a=I("BIMDataGED"),s=I("BIMDataButton");return k(),N("div",Iet,[T(a,{ref:"ged",class:"viewer2d-background__page__ged__ged","header-buttons":!1,"single-select-mode":"","selectable-file-types":["pdf","jpeg","jpg","png"],onSelectionChange:t[0]||=l=>o.selectedDocument=l[0]},null,512),w("div",Det,[T(s,{width:"100%",height:"32px",color:"primary",fill:"",radius:"",disabled:!o.selectedDocument,onClick:o.submit},{default:j(()=>[nt(G(e.$t("global.validate")),1)]),_:1},8,["disabled","onClick"])])])}var Let=Q(Pet,[["render",Tet],["__scopeId","data-v-d1ac46ef"]]),Ret={setup(){let e=bt("$viewer"),t=bt("$plugin"),i=bt("viewer2d"),o=bt("root"),{openAnchorSynchronizationWindow:r,anchorSynchronizationWindowAvailable:n}=Sj(e,t),a=pe(null);return{root:o,menuIndexDisplayed:a,toggleMenu:s=>{a.value=a.value===s?null:s},closeMenu:s=>{a.value===s&&(a.value=null)},onCreateClick:()=>{o.page="bond"},onEditClick:async s=>{try{if(o.loading=!0,o.selectedStorey!==s.storey&&e.localContext.selectStorey(s.storey),n){let l=e.state.modelsMap.get(s.plan.id);l||=(await e.state.loadModels([s.plan.id],{silent:!0}))[0],r({model:s.model,storey:s.storey,modelToSynchronize:l})}else await i.plugins.bitmaps.showPlan(s),o.editedBitmap=i.plugins.bitmaps.getBitmap(s),o.page="edit"}catch(l){console.error(l)}finally{o.loading=!1}},onDeleteClick:async s=>{try{o.loading=!0,await e.state.deletePlan(s)}catch(l){console.error(l)}finally{o.loading=!1}}}}},_et={class:"viewer2d-background__page__home"},Fet={class:"viewer2d-background__page__home__description"},Uet={class:"viewer2d-background__page__home__list"},Oet={class:"viewer2d-background__page__home__list__element__icon"},Net={class:"viewer2d-background__page__home__list__element__labels"},Het={key:0,class:"viewer2d-background__page__home__list__element__menu"},Vet={key:0,class:"viewer2d-background__page__home__list__element__menu__menu"};function jet(e,t,i,o,r,n){let a=I("BIMDataButton"),s=I("BIMDataIconSynchro2D"),l=I("BIMDataTextbox"),c=I("BIMDataIconEllipsis"),d=Li("click-away");return k(),N("div",_et,[w("div",Fet,G(e.$t("viewer2d-background.description")),1),T(a,{class:"viewer2d-background__page__home__button",color:"primary",fill:"",radius:"",width:"60%",disabled:!e.$viewer.api.permissions.hasModelWritePermission||o.root.storeys.length===0,onClick:o.onCreateClick},{default:j(()=>[o.root.storeys.length===0?(k(),N(ut,{key:0},[nt(G(e.$t("viewer2d-background.no_ifc")),1)],64)):o.root.storeys.length>0?(k(),N(ut,{key:1},[nt(G(e.$t("global.new")),1)],64)):(k(),N(ut,{key:2},[nt(G(e.$t("viewer2d-background.start")),1)],64))]),_:1},8,["disabled","onClick"]),w("ul",Uet,[(k(!0),N(ut,null,Vt(o.root.plans,u=>(k(),N("li",{key:`${u.key}`,class:"viewer2d-background__page__home__list__element"},[w("div",Oet,[T(s,{size:"m",fill:"",color:"primary"})]),w("div",Net,[T(l,{class:"viewer2d-background__page__home__list__element__labels__storey",text:u.storey.name},null,8,["text"]),T(l,{class:"viewer2d-background__page__home__list__element__labels__plan",text:u.plan.name},null,8,["text"])]),e.$viewer.api.permissions.hasModelWritePermission?Tt((k(),N("div",Het,[T(a,{color:"granite",ghost:"",rounded:"",icon:"",onClick:A=>o.toggleMenu(u.key)},{default:j(()=>[T(c,{size:"l"}),o.menuIndexDisplayed===u.key?(k(),N("div",Vet,[T(a,{width:"100%",color:"granite",ghost:"",square:"",onClick:A=>o.onEditClick(u)},{default:j(()=>[nt(G(e.$t("global.edit")),1)]),_:1},8,["onClick"]),T(a,{width:"100%",color:"granite",ghost:"",square:"",onClick:A=>o.onDeleteClick(u)},{default:j(()=>[w("div",null,G(e.$t("global.delete")),1)]),_:1},8,["onClick"])])):le("",!0)]),_:2},1032,["onClick"])])),[[d,()=>o.closeMenu(u.key)]]):le("",!0)]))),128))])])}var Qet=Q(Ret,[["render",jet],["__scopeId","data-v-ee47f509"]]),zet={setup(){let e=bt("$viewer");return{root:bt("root"),selectStorey:t=>{e.localContext.selectStorey(t)}}}},qet={class:"viewer2d-background__page__bond"},Get={class:"viewer2d-background__page__bond__list-title"},Ket={class:"viewer2d-background__page__bond__list-title"};function Jet(e,t,i,o,r,n){let a=I("BIMDataDropdownList"),s=I("BIMDataButton");return k(),N("div",qet,[w("div",null,[w("div",Get," 1 - "+G(e.$t("viewer2d-background.select_storey")),1),T(a,{width:"100%",list:o.root.storeys,"per-page":20,"element-key":"id","close-on-element-click":"",class:"viewer2d-background__page__bond__storeys",onElementClick:t[0]||=l=>o.selectStorey(l)},{header:j(()=>[nt(G(o.root.selectedStorey?o.root.selectedStorey.name:e.$t("viewer2d-background.select_storey")),1)]),element:j(({element:l})=>[w("span",{class:ye({"viewer2d-background__page__bond__storeys--active":o.root.selectedStorey===l})},G(l.name),3)]),_:1},8,["list"])]),w("div",null,[w("div",Ket," 2 - "+G(e.$t("viewer2d-background.import_file")),1),T(s,{width:"100%",color:"primary",fill:"",radius:"",disabled:!o.root.selectedStorey,onClick:t[1]||=l=>o.root.page="ged"},{default:j(()=>[nt(G(e.$t("viewer2d-background.from_ged")),1)]),_:1},8,["disabled"])])])}var Zet={name:"Background2D",components:{edit:Met,ged:Let,home:Qet,bond:Q(zet,[["render",Jet],["__scopeId","data-v-2573d11f"]])},props:{isOpen:{type:Boolean,default:!1}},setup(){let e=bt("$viewer"),t=bt("$plugin"),i;try{i=e.localContext.pluginComponentInstances.get("viewer2d")}catch(u){i={},console.error(u)}if(!i)throw Error("[Viewer 2D - synchronization] plugin cannot work without viewer2d plugin with 2d engine on.");i=un(i),pr("viewer2d",i);let o=qo({page:"home",loading:!1,modalDisplayed:!1,model:{},storeys:[],plans:[],selectedStorey:null,editedBitmap:null});pr("root",o);let r=e.localContext.hub.on("models-loaded",({models:[u]})=>{o.model=u,o.storeys=u.storeys,o.plans=u.storeys.flatMap(A=>A.plans)},{getLastEvent:!0}),n=e.localContext.hub.on("storey-selected",({storey:u})=>{o.selectedStorey=u,u||(o.page="home")},{getLastEvent:!0}),a=e.state.hub.on("plan-created",()=>o.plans=o.model.storeys.flatMap(u=>u.plans)),s=e.state.hub.on("plan-updated",()=>o.plans=o.model.storeys.flatMap(u=>u.plans)),l=e.state.hub.on("plan-deleted",()=>o.plans=o.model.storeys.flatMap(u=>u.plans));$i(()=>{e.localContext.hub.off(r),e.localContext.hub.off(n),e.localContext.hub.off(a),e.localContext.hub.off(s),e.localContext.hub.off(l)}),xt(()=>o.page,u=>{u!=="edit"&&(o.editedBitmap=null)},{immediate:!0}),xt(()=>o.editedBitmap,(u,A)=>{A?.edit(!1),u?.edit(!0)},{immediate:!0});let c=()=>{o.page="home",o.modalDisplayed=!1,t.close()},d=!0;return{viewer2d:i,root:o,onBackClick:()=>{switch(d=!0,o.page){case"ged":o.page="bond";break;case"edit":o.editedBitmap?.edited?o.modalDisplayed=!0:o.editedBitmap.plan?(o.editedBitmap.reset(),o.page="home"):(i.plugins.bitmaps.deleteBitmap(o.editedBitmap),o.page="ged");break;default:o.page="home"}},onCloseClick:()=>{d=!1,o.editedBitmap?.edited?o.modalDisplayed=!0:c()},onLeaveClick:()=>{o.editedBitmap.plan?o.editedBitmap.reset():i.plugins.bitmaps.deleteBitmap(o.editedBitmap),d?o.editedBitmap.plan?o.page="home":o.page="ged":c(),o.modalDisplayed=!1},onKeyDown:u=>{o.loading||u.key==="Escape"&&(u.preventDefault(),o.page==="home"?c():o.modalDisplayed&&=!1)}}},async onOpen(){this.$viewer.localContext.pluginComponentInstances.forEach(e=>{e!==this&&e.$close?.()}),this.viewer2d.storeyRightOffset=380,await this.$viewer.localContext.hideUI({exceptions:[this.$plugin.name]}),this.viewer2d.viewer.ui.mode=null,this.root.selectedStorey&&this.root.selectedStorey.plans.forEach(e=>this.viewer2d.plugins.bitmaps.showPlan(e)),document.addEventListener("keydown",this.onKeyDown)},onClose(){this.viewer2d.storeyRightOffset=0,this.$viewer.localContext.showUI(),this.viewer2d.viewer.ui.mode="pick",this.root.selectedStorey&&this.root.selectedStorey.plans.forEach(e=>{this.$viewer.localContext.shownPlans.some(t=>t.key===e.key)?this.viewer2d.plugins.bitmaps.showPlan(e):this.viewer2d.plugins.bitmaps.hidePlan(e)}),document.removeEventListener("keydown",this.onKeyDown)}},Wet={class:"viewer2d-background"},Yet={class:"viewer2d-background__header__back"},Xet={class:"viewer2d-background__header__title__text"},$et={key:1,class:"viewer2d-background__modal"},ett={class:"viewer2d-background__modal__content"},ttt={class:"viewer2d-background__modal__content__symbols"},itt={class:"viewer2d-background__modal__content__buttons"};function rtt(e,t,i,o,r,n){let a=I("BIMDataLoading"),s=I("BIMDataIconArrow"),l=I("BIMDataButton"),c=I("BIMDataIconSynchro2D"),d=I("BIMDataIconClose"),u=I("BIMDataIconWarning");return k(),N("div",Wet,[o.root.loading?(k(),W(a,{key:0})):le("",!0),w("div",{class:ye(["viewer2d-background__header",{"viewer2d-background__header--home":o.root.page==="home"}])},[w("div",Yet,[o.root.page==="home"?le("",!0):(k(),W(l,{key:0,width:"25px",height:"25px",color:"primary",ghost:"",radius:"",icon:"",onClick:o.onBackClick},{default:j(()=>[T(s,{size:"xs"})]),_:1},8,["onClick"]))]),w("div",{class:ye(["viewer2d-background__header__title",{"viewer2d-background__header__title--home":o.root.page==="home"}])},[T(c,{size:o.root.page==="home"?"l":"xs",fill:"",color:"primary"},null,8,["size"]),w("span",Xet,G(e.$t("viewer2d-background.title")),1)],2),T(l,{class:"viewer2d-background__header__close",width:"25px",height:"25px",ghost:"",radius:"",icon:"",onClick:o.onCloseClick},{default:j(()=>[T(d,{size:"xs",fill:"",color:"granite-light"})]),_:1},8,["onClick"])],2),w("div",{class:ye(["viewer2d-background__page",{"viewer2d-background__page--home":o.root.page==="home"}])},[(k(),W(L3,null,[(k(),W(qr(o.root.page)))],1024))],2),o.root.modalDisplayed?(k(),N("div",$et,[w("div",ett,[w("div",ttt,[T(u,{fill:"",color:"high",size:"l"}),w("div",null,G(e.$t("viewer2d-background.warning")),1)]),w("div",itt,[T(l,{width:"45%",color:"high",fill:"",radius:"",onClick:o.onLeaveClick},{default:j(()=>[nt(G(e.$t("viewer2d-background.leave")),1)]),_:1},8,["onClick"]),T(l,{width:"45%",color:"default",outline:"",radius:"",onClick:t[0]||=A=>o.root.modalDisplayed=!1},{default:j(()=>[nt(G(e.$t("viewer2d-background.stay")),1)]),_:1})])])])):le("",!0)])}var Dj=Q(Zet,[["render",rtt],["__scopeId","data-v-1eece107"]]),Tj={tooltip:"Hintergrund",title:"2D-Viewer-Hintergrund",location:"Position",scale:"Ma\xDFstab",rotation:"Rotation",alpha:"Lichtundurchl\xE4ssigkeit",preview:"Vorschau",import:"Ein Element importieren",from_ged:"Von dem DMS des Projekts",from_computer:"Von Ihrem Computer",no_storey:"Um einen Hintergrund hinzuzuf\xFCgen, w\xE4hlen Sie bitte eine IFC und eine Etage aus.",start:"Start",description:"\xDCberlagern Sie Ihre PDF-Grundrisse, um sie im 2D-Viewer anzuzeigen",select_storey:"W\xE4hlen Sie eine Etage aus",import_file:"Importieren Sie eine Datei",no_ifc:"Um einen Hintergrund hinzuzuf\xFCgen, w\xE4hlen Sie bitte eine IFC aus.",warning:"M\xF6chten Sie diese Seite wirklich verlassen? M\xF6glicherweise gibt es unbest\xE4tigte Informationen.",leave:"Ja, diese Seite verlassen",stay:"Abbrechen, hier bleiben"},ott="Background",ntt="2D viewer background",att="Location",stt="Scale",ltt="Rotation",ctt="Alpha",dtt="Preview",utt="From the project GED",Att="From your computer",htt="To add a background, please select an IFC and a storey.",ptt="Start",ftt="Overlay your PDF plans by floor to view them in the 2D viewer",gtt="Select a floor",mtt="Import a file",vtt="To add a background, please select an IFC.",ytt="Are you sure you want to leave this page? There may be some unvalidated information.",wtt="Yes, leave this page",btt="Cancel, stay here",Lj={tooltip:ott,"tooltip-anchor-synchronization":"Synchronization",title:ntt,location:att,scale:stt,rotation:ltt,alpha:ctt,preview:dtt,import:"Import element",from_ged:utt,from_computer:Att,no_storey:htt,start:ptt,description:ftt,select_storey:gtt,import_file:mtt,no_ifc:vtt,warning:ytt,leave:wtt,stay:btt},Rj={tooltip:"Fondo",title:"Fondo de visor 2D",location:"Ubicaci\xF3n",scale:"Escala",rotation:"Rotaci\xF3n",alpha:"Alfa",preview:"Vista previa",import:"Elemento de importaci\xF3n",from_ged:"Del proyecto GED",from_computer:"Desde el ordenador",no_storey:"Para agregar un fondo, seleccione un IFC y un piso.",start:"Comenzar",description:"Superponga sus planos en PDF por planta para que pueda verlos en el visor 2D",select_storey:"Seleccionar una planta",import_file:"Importar un fichero",no_ifc:"Seleccione un IFC para a\xF1adir un fondo",warning:"\xBFEst\xE1 seguro de que quiere abandonar esta p\xE1gina? Podr\xEDa haber informaci\xF3n sin validar.",leave:"S\xED, salir de esta p\xE1gina",stay:"Cancelar y permanecer aqu\xED"},Ctt="Synchronisation 2D",xtt="Synchronisation 2D",Btt="Position",ktt="Echelle",Ett="Rotation",Mtt="Opacit\xE9",Ptt="Aper\xE7u",Itt="Depuis la GED du projet",Stt="Depuis votre ordinateur",Dtt="Pour ajouter un fond, veuillez selectionner un IFC et un \xE9tage.",Ttt="Commencer",Ltt="Superposez vos plans PDF par \xE9tages pour les visualisez dans la visionneuse 2D",Rtt="S\xE9lectionner un \xE9tage",_tt="Importer un fichier",Ftt="Pour ajouter un fond, veuillez selectionner un IFC.",Utt="\xCAtes-vous s\xFBr de vouloir quitter cette page ? Il y'a peut-\xEAtre des informations non valid\xE9es.",Ott="Oui, quitter cette page",Ntt="Annuler, rester ici",_j={tooltip:Ctt,"tooltip-anchor-synchronization":"Synchronisation",title:xtt,location:Btt,scale:ktt,rotation:Ett,alpha:Mtt,preview:Ptt,import:"Importer un \xE9l\xE9ment",from_ged:Itt,from_computer:Stt,no_storey:Dtt,start:Ttt,description:Ltt,select_storey:Rtt,import_file:_tt,no_ifc:Ftt,warning:Utt,leave:Ott,stay:Ntt},Fj={tooltip:"Sincronizzazione 2D",title:"Sincronizzazione 2D",location:"Posizione",scale:"Scala",rotation:"Rotazione",alpha:"Opacit\xE0",preview:"Anteprima",import:"Importa un elemento",from_ged:"Dalla GED del progetto",from_computer:"Dal tuo computer",no_storey:"Per aggiungere uno sfondo, seleziona un IFC e un livello.",start:"Iniziare",description:"Sovrapporre le planimetrie PDF per visualizzarle in modalit\xE0 2 D",select_storey:"Selezionare un piano",import_file:"Importare un file",no_ifc:"Per aggiungere uno sfondo, selezionare un IFC.",warning:"Sei sicuro di abbandonare questa pagina? Possono esserci informazioni non salvate.",leave:"S\xEC, abbandona questa pagina",stay:"Annulla, resta qui"},Htt={name:"viewer2d-background",i18n:{de:Tj,en:Lj,es:Rj,fr:_j,it:Fj},addToWindows:["2d"],component:Dj,anchorSynchronization:!1,button:{tooltip:"viewer2d-background.tooltip",position:"right",content:"free",keepOpen:!0,icon:{imgUri:"data:image/svg+xml,%3csvg%20width='24'%20height='20'%20viewBox='0%200%2024%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.88872%200.566772L1.04927%202.40024C0.725277%202.48709%200.5%202.78072%200.5%203.11615V18.2831C0.5%2018.7699%200.961394%2019.1246%201.43186%2018.9993L7.88972%2017.2801C7.88906%2017.272%207.88872%2017.2638%207.88872%2017.2554V14.7773L3.17858%2016.0333C2.85509%2016.1195%202.53773%2015.8757%202.53773%2015.5409V4.74845C2.53773%204.51759%202.69293%204.31557%202.916%204.25608L7.88872%202.93012V0.566772ZM8.49094%2014.7855V17.2554C8.49094%2017.2696%208.48996%2017.2835%208.48808%2017.2971L15.486%2019.4156C15.4859%2019.4136%2015.4859%2019.4115%2015.4859%2019.4095V16.8485L8.49094%2014.7855ZM15.4859%204.99423L8.49094%202.93124V0.570797L15.5016%202.54386C15.4914%202.57409%2015.4859%202.60647%2015.4859%202.64013V4.99423ZM16.0881%2016.8573L21.0609%2015.5314C21.2839%2015.4719%2021.4391%2015.2699%2021.4391%2015.039V4.24655C21.4391%203.91175%2021.1218%203.66793%2020.7983%203.75419L16.0881%205.01014V2.64013C16.0881%202.63282%2016.0879%202.62557%2016.0873%202.61838C16.0996%202.61571%2016.1118%202.61272%2016.1239%202.60942L22.5642%200.856573C23.0356%200.728268%2023.5%201.08318%2023.5%201.57174V16.7222C23.5%2017.0518%2023.2823%2017.3419%2022.9657%2017.4339L16.0872%2019.4332C16.0875%2019.4296%2016.0877%2019.4259%2016.0879%2019.4222C16.088%2019.418%2016.0881%2019.4138%2016.0881%2019.4095V16.8573ZM12.1876%204.98741L15.3238%205.91236V15.8348L8.65309%2013.8674V3.945L11.7243%204.85078V11.7826L10.2056%2011.3757L10.1957%2011.8232L13.8163%2012.7933L13.8262%2012.3458L12.1876%2011.9068V4.98741ZM16.2503%208.87403V5.92576L20.5126%204.78921V7.73192L16.2503%208.87403ZM16.2503%209.32413V15.8553L20.5126%2014.7187V11.6974C20.2851%2011.7578%2020.0295%2011.8473%2019.7867%2012.0031C19.5622%2012.1472%2019.3588%2012.3444%2019.2172%2012.6226C19.0755%2012.9009%2018.9884%2013.2744%2019.0183%2013.7819C19.0258%2013.9096%2018.9284%2014.0193%2018.8006%2014.0268C18.673%2014.0343%2018.5633%2013.9368%2018.5558%2013.8091C18.522%2013.2339%2018.6193%2012.7759%2018.8044%2012.4124C18.9895%2012.0488%2019.2553%2011.7937%2019.5365%2011.6133C19.8666%2011.4014%2020.233%2011.2872%2020.5126%2011.2189V8.18203L16.2503%209.32413ZM7.7266%203.93221V9.53559L3.46421%2010.6777V8.46597C3.75116%208.40016%204.15552%208.28527%204.51661%208.05354C4.79783%207.87306%205.06361%207.61801%205.24874%207.25436C5.43381%206.89086%205.53112%206.43293%205.49728%205.85765C5.48977%205.72995%205.38016%205.63252%205.25246%205.64003C5.12476%205.64754%205.02733%205.75715%205.03484%205.88485C5.0647%206.3924%204.97762%206.76586%204.83592%207.04418C4.6943%207.32236%204.49096%207.51957%204.26641%207.66368C3.99613%207.83713%203.70982%207.92849%203.46421%207.98882V5.06876L7.7266%203.93221ZM7.7266%2013.8617V9.98569L3.46421%2011.1278V14.9983L7.7266%2013.8617Z'%20fill='%232F374A'/%3e%3c/svg%3e"}}},OB="viewer2d-parameters_parameters",Vtt={computed:{viewer2d(){let e=this.$viewer.localContext.pluginComponentInstances.get("viewer2d");if(e)return e;{let t="'Viewer 2D Parameters' plugin cannot work without viewer2d plugin.";throw console.error(t),Error(t)}},spacesDisplayed:{get(){return this.viewer2d.spacesVisible},set(e){this.viewer2d.setSpacesVisible(e),this.saveParameters()}},doorsDisplayed:{get(){return this.viewer2d.doorsDisplayed},set(e){this.viewer2d.doorsDisplayed=e,this.saveParameters()}},compassDisplayed:{get(){return this.viewer2d.compassDisplayed},set(e){this.viewer2d.compassDisplayed=e,this.saveParameters()}},highlightOnHover:{get(){return this.viewer2d.highlightOnHover},set(e){this.viewer2d.highlightOnHover=e,this.saveParameters()}},camera3DSynchronization:{get(){return this.viewer2d.camera3DSynchronization},set(e){this.viewer2d.camera3DSynchronization=e,this.saveParameters()}}},mounted(){this.applySavedParameters(),this.subscription=this.$viewer.localContext.hub.on("2d-model-loaded",()=>{this.applySavedParameters()})},unmounted(){this.$viewer.localContext.hub.off(this.subscription)},methods:{getSavedParameters(){let e={};try{let t=localStorage.getItem(OB)||"{}";e=JSON.parse(t)}catch{localStorage.removeItem(OB)}return Object.assign({},this.getDefaultParameters(),e)},getDefaultParameters(){return{spacesDisplayed:!0,doorsDisplayed:!1,compassDisplayed:!0,highlightOnHover:!0}},applySavedParameters(){let e=this.getSavedParameters();this.spacesDisplayed=e.spacesDisplayed,this.doorsDisplayed=e.doorsDisplayed,this.viewer2d.settings.compass===void 0?this.compassDisplayed=e.compassDisplayed:this.compassDisplayed=this.viewer2d.settings.compass,this.highlightOnHover=e.highlightOnHover},saveParameters(){let e={spacesDisplayed:this.spacesDisplayed,doorsDisplayed:this.doorsDisplayed,compassDisplayed:this.compassDisplayed,highlightOnHover:this.highlightOnHover};localStorage.setItem(OB,JSON.stringify(e))}}},jtt={class:"viewer2d-parameters"},Qtt={class:"viewer2d-parameters_header"},ztt={class:"viewer2d-parameters_content"},qtt={class:"m-b-18"},Gtt={class:"m-b-18"},Ktt={class:"m-b-18"},Jtt={class:"m-b-18"};function Ztt(e,t,i,o,r,n){let a=I("BIMDataIconParameters"),s=I("BIMDataToggle");return k(),N("div",jtt,[w("div",Qtt,[T(a,{size:"xs",margin:"0 12px 0 0"}),w("span",null,G(e.$t("viewer2d-parameters.title")),1)]),w("div",ztt,[w("div",qtt,[w("span",null,G(e.$t("viewer2d-parameters.ifc_spaces")),1),T(s,{modelValue:n.spacesDisplayed,"onUpdate:modelValue":t[0]||=l=>n.spacesDisplayed=l},null,8,["modelValue"])]),w("div",Gtt,[w("span",null,G(e.$t("viewer2d-parameters.display_door_openings")),1),T(s,{modelValue:n.doorsDisplayed,"onUpdate:modelValue":t[1]||=l=>n.doorsDisplayed=l},null,8,["modelValue"])]),w("div",Ktt,[w("span",null,G(e.$t("viewer2d-parameters.display_compass")),1),T(s,{modelValue:n.compassDisplayed,"onUpdate:modelValue":t[2]||=l=>n.compassDisplayed=l},null,8,["modelValue"])]),w("div",Jtt,[w("span",null,G(e.$t("viewer2d-parameters.highlight")),1),T(s,{modelValue:n.highlightOnHover,"onUpdate:modelValue":t[3]||=l=>n.highlightOnHover=l},null,8,["modelValue"])]),w("div",null,[w("span",null,G(e.$t("viewer2d-parameters.camera_sync")),1),T(s,{modelValue:n.camera3DSynchronization,"onUpdate:modelValue":t[4]||=l=>n.camera3DSynchronization=l},null,8,["modelValue"])])])])}var Wtt={name:"viewer2d-parameters",i18n:{de:{tooltip:"Einstellungen",title:"2D-Viewer Einstellungen",display_door_openings:"T\xFCr\xF6ffnungen anzeigen",display_compass:"Kompass anzeigen",highlight:"Farbliche Markierung",camera_sync:"Mit 3D-Kamera synchronisieren",ifc_spaces:"R\xE4ume"},en:{tooltip:"Parameters",title:"2D viewer settings",display_door_openings:"Display door openings",display_compass:"Display compass",highlight:"Highlight",camera_sync:"Synchronize with a 3D camera",ifc_spaces:"Spaces"},es:{tooltip:"Par\xE1metros",title:"Configuraci\xF3n del visor 2D",display_door_openings:"Abrir las puertas de la pantalla",display_compass:"Br\xFAjula de visualizaci\xF3n",highlight:"Destacar",camera_sync:"Sincronizaci\xF3n con una c\xE1mara 3D",ifc_spaces:"Espacios"},fr:{tooltip:"Param\xE8tres",title:"Param\xE8tres du viewer 2D",display_door_openings:"Afficher l\u2019ouverture de porte",display_compass:"Afficher la boussole",highlight:"Surbrillance",camera_sync:"Synchroniser avec une camera 3D",ifc_spaces:"Espaces"},it:{tooltip:"Impostazioni",title:"Impostazioni del visualizzatore 2D",display_door_openings:"Mostra l'apertura della porta",display_compass:"Mostra la bussola",highlight:"Selezione",camera_sync:"Sincronizza con una fotocamera 3D",ifc_spaces:"Spazi"}},addToWindows:["2d"],component:Q(Vtt,[["render",Ztt],["__scopeId","data-v-df342105"]]),button:{tooltip:"viewer2d-parameters.tooltip",stance:-1,position:"right",content:"simple",icon:{component:"BIMDataIconParameters",options:{size:"m"}}}},Ytt={name:"viewer2d-screenshot",i18n:{de:{tooltip:"Bildschirmaufnahme"},en:{tooltip:"Screenshot"},es:{tooltip:"Captura de pantalla"},fr:{tooltip:"Capture d'\xE9cran"},it:{tooltip:"Screenshot"}},addToWindows:["2d"],component:{computed:{viewer2d(){let e=this.$viewer.localContext.pluginComponentInstances.get("viewer2d");if(e)return e;{let t="'Viewer 2D Screenshot' plugin cannot work without viewer2d plugin.";throw console.error(t),Error(t)}}},async onOpen(){await this.capture(),setTimeout(()=>this.$close())},methods:{async capture(){try{await this.$viewer.localContext.hideUI();let e=this.$viewer.localContext.el,t=!1,i={};document.fullscreenElement===e&&(t=!0,i.width=e.style.width,i.height=e.style.height,e.style.width="100vw",e.style.height="100vh");let o=await(0,U5.default)(this.$viewer.localContext.el);t&&(e.style.width=i.width,e.style.height=i.height);let r=document.createElement("a");r.download=this.viewer2d.ifc&&this.viewer2d.ifc.name?String(this.viewer2d.ifc.name).split(".ifc")[0]:"2d-capture.png",r.href=o.toDataURL(),r.click()}catch(e){console.error(`Unable to take screenshot. err: ${e.message}`)}finally{this.$viewer.localContext.showUI()}}},render:()=>null},button:{tooltip:"viewer2d-screenshot.tooltip",position:"right",content:"simple",icon:{component:"BIMDataIconScreenshot",options:{size:"m"}}}},Ss=class{constructor(e,t){this.items=e||[],this._lastUniqueId=(t||0)+1}addItem(){let e;if(arguments.length===2){let t=arguments[0];if(e=arguments[1],this.items[t])throw"ID clash: '"+t+"'";return this.items[t]=e,t}else for(e=arguments[0]||{};;){let t=this._lastUniqueId++;if(!this.items[t])return this.items[t]=e,t}}removeItem(e){let t=this.items[e];return delete this.items[e],t}},Uj=new Ss,Xtt=class{constructor(e){this.id=e,this.parentItem=null,this.groups=[],this.menuElement=null,this.shown=!1,this.mouseOver=0}},$tt=class{constructor(){this.items=[]}},eit=class{constructor(e,t,i,o,r){this.id=e,this.getTitle=t,this.doAction=i,this.getEnabled=o,this.getShown=r,this.itemElement=null,this.subMenu=null,this.enabled=!0}},tit=class{constructor(e={}){this._id=Uj.addItem(),this._context=null,this._enabled=!1,this._itemsCfg=[],this._rootMenu=null,this._menuList=[],this._menuMap={},this._itemList=[],this._itemMap={},this._shown=!1,this._nextId=0,this._parentNode=e.parentNode||document.body,this._offsetParent=this._parentNode instanceof ShadowRoot?this._parentNode.host:this._parentNode,this._eventSubs={},e.hideOnMouseDown!==!1&&(this._parentNode.addEventListener("mousedown",t=>{t.target.classList.contains("xeokit-context-menu-item")||this.hide()}),this._parentNode.addEventListener("touchstart",this._canvasTouchStartHandler=t=>{t.target.classList.contains("xeokit-context-menu-item")||this.hide()})),e.items&&(this.items=e.items),this._hideOnAction=e.hideOnAction!==!1,this.context=e.context,this.enabled=e.enabled!==!1,this.hide()}on(e,t){let i=this._eventSubs[e];i||(i=[],this._eventSubs[e]=i),i.push(t)}fire(e,t){let i=this._eventSubs[e];if(i)for(let o=0,r=i.length;o<r;o++)i[o](t)}set items(e){this._clear(),this._itemsCfg=e||[],this._parseItems(e),this._createUI()}get items(){return this._itemsCfg}set enabled(e){e=!!e,e!==this._enabled&&(this._enabled=e,this._enabled||this.hide())}get enabled(){return this._enabled}set context(e){this._context=e}get context(){return this._context}show(e,t){if(!this._context){console.error("ContextMenu cannot be shown without a context - set context first");return}this._enabled&&(this._shown||(this._hideAllMenus(),this._updateItemsTitles(),this._updateItemsEnabledStatus(),this._showMenu(this._rootMenu.id,e,t),this._updateSubMenuInfo(),this._shown=!0,this.fire("shown",{})))}get shown(){return this._shown}hide(){this._enabled&&this._shown&&(this._hideAllMenus(),this._shown=!1,this.fire("hidden",{}))}destroy(){this._context=null,this._clear(),this._id!==null&&(Uj.removeItem(this._id),this._id=null)}_clear(){for(let e=0,t=this._menuList.length;e<t;e++)this._menuList[e].menuElement.remove();this._itemsCfg=[],this._rootMenu=null,this._menuList=[],this._menuMap={},this._itemList=[],this._itemMap={}}_parseItems(e){let t=i=>{let o=new Xtt(this._getNextId());for(let r=0,n=i.length;r<n;r++){let a=i[r],s=new $tt;o.groups.push(s);for(let l=0,c=a.length;l<c;l++){let d=a[l],u=d.items,A=u&&u.length>0,h=new eit(this._getNextId(),d.getTitle||(()=>d.title||""),d.doAction||d.callback||(()=>{}),d.getEnabled||(()=>!0),d.getShown||(()=>!0));if(h.parentMenu=o,s.items.push(h),A){let p=t(u);h.subMenu=p,p.parentItem=h}this._itemList.push(h),this._itemMap[h.id]=h}}return this._menuList.push(o),this._menuMap[o.id]=o,o};this._rootMenu=t(e)}_getNextId(){return"ContextMenu_"+this._id+"_"+this._nextId++}_createUI(){let e=t=>{this._createMenuUI(t);let i=t.groups;for(let o=0,r=i.length;o<r;o++){let n=i[o].items;for(let a=0,s=n.length;a<s;a++){let l=n[a].subMenu;l&&e(l)}}};e(this._rootMenu)}_createMenuUI(e){let t=e.groups,i=[],o=document.createElement("div");if(o.classList.add("xeokit-context-menu",e.id),o.style.zIndex=3e5,o.style.position="absolute",i.push("<ul>"),t)for(let a=0,s=t.length;a<s;a++){let l=t[a],c=a,d=s,u=l.items;if(u)for(let A=0,h=u.length;A<h;A++){let p=u[A],f=p.subMenu,m=p.title||"";f?(i.push('<li id="'+p.id+'" class="xeokit-context-menu-item xeokit-context-menu-submenu">'+m+"</li>"),c===d-1||A<h-1||i.push('<li id="'+p.id+'" class="xeokit-context-menu-item-separator"></li>')):(i.push('<li id="'+p.id+'" class="xeokit-context-menu-item">'+m+"</li>"),c===d-1||A<h-1||i.push('<li id="'+p.id+'" class="xeokit-context-menu-item-separator"></li>'))}}i.push("</ul>"),o.innerHTML=i.join(""),this._parentNode.appendChild(o),e.menuElement=o,o.style["border-radius"]="4px",o.style.display="none",o.style["z-index"]=3e5,o.style.background="white",o.style.border="1px solid black",o.style["box-shadow"]="0 4px 5px 0 gray",o.oncontextmenu=a=>{a.preventDefault()};let r=this,n=null;if(t)for(let a=0,s=t.length;a<s;a++){let l=t[a].items;if(l)for(let c=0,d=l.length;c<d;c++){let u=l[c],A=u.subMenu;if(u.itemElement=this._parentNode.querySelector(`#${u.id}`),!u.itemElement){console.error("ContextMenu item element not found: "+u.id);continue}u.itemElement.addEventListener("mouseenter",h=>{h.preventDefault();let p=u.subMenu;if(!p){n&&=(r._hideMenu(n.id),null);return}if(n&&n.id!==p.id&&(r._hideMenu(n.id),n=null),u.enabled===!1)return;let f=u.itemElement,m=p.menuElement,g=f.getBoundingClientRect();m.getBoundingClientRect();let y=r._offsetParent.getBoundingClientRect(),v=g.right+200<y.right,C=g.left-200>y.left;if(v)r._showMenu(p.id,g.right+window.scrollX-5,g.top+window.scrollY-1);else if(C)r._showMenu(p.id,g.left-200+window.scrollX,g.top+window.scrollY-1);else{let x=g.left-y.left,B=y.right-g.right;B>x?r._showMenu(p.id,g.right-5-(200-B),g.top+window.scrollY-1):r._showMenu(p.id,g.left-x,g.top+window.scrollY-1)}n=p}),A||(u.itemElement.addEventListener("click",h=>{h.preventDefault(),r._context&&u.enabled!==!1&&(u.doAction&&u.doAction(r._context),this._hideOnAction?r.hide():(r._updateItemsTitles(),r._updateItemsEnabledStatus()))}),u.itemElement.addEventListener("mouseup",h=>{h.which===3&&(h.preventDefault(),r._context&&u.enabled!==!1&&(u.doAction&&u.doAction(r._context),this._hideOnAction?r.hide():(r._updateItemsTitles(),r._updateItemsEnabledStatus())))}),u.itemElement.addEventListener("mouseenter",h=>{h.preventDefault(),u.enabled!==!1&&u.doHover&&u.doHover(r._context)}))}}}_updateItemsTitles(){if(this._context)for(let e=0,t=this._itemList.length;e<t;e++){let i=this._itemList[e],o=i.itemElement;if(!o)continue;let r=i.getShown;if(!r||!r(this._context))continue;let n=i.getTitle(this._context);i.subMenu,o.innerText=n}}_updateItemsEnabledStatus(){if(this._context)for(let e=0,t=this._itemList.length;e<t;e++){let i=this._itemList[e],o=i.itemElement;if(!o)continue;let r=i.getEnabled;if(!r)continue;let n=i.getShown;if(!n)continue;let a=n(this._context);if(i.shown=a,a)o.style.display="";else{o.style.display="none";continue}let s=r(this._context);i.enabled=s,s?o.classList.remove("disabled"):o.classList.add("disabled")}}_updateSubMenuInfo(){if(!this._context)return;let e,t,i,o,r,n;this._itemList.forEach(a=>{a.subMenu&&(e=a.itemElement,t=e.getBoundingClientRect(),i=a.subMenu.menuElement,o={visibility:i.style.visibility,display:i.style.display},i.style.display="block",i.style.visibility="hidden",n=a.subMenu.menuElement.getBoundingClientRect().width,i.style.visibility=o.visibility,i.style.display=o.display,r=t.right+n>window.innerWidth,e.setAttribute("data-submenuposition",r?"left":"right"))})}_showMenu(e,t,i){let o=this._menuMap[e];if(!o){console.error("Menu not found: "+e);return}if(o.shown)return;let r=o.menuElement;r&&(this._showMenuElement(r,t,i),o.shown=!0)}_hideMenu(e){let t=this._menuMap[e];if(!t){console.error("Menu not found: "+e);return}if(!t.shown)return;let i=t.menuElement;i&&(this._hideMenuElement(i),t.shown=!1)}_hideAllMenus(){for(let e=0,t=this._menuList.length;e<t;e++){let i=this._menuList[e];this._hideMenu(i.id)}}_showMenuElement(e,t,i){e.style.display="block";let o=e.offsetHeight,r=e.offsetWidth,n=this._offsetParent.getBoundingClientRect(),a=this._offsetParent===window.document.body&&n.bottom===0?window.innerHeight:n.bottom+window.scrollY,s=n.right+window.scrollX;i+o>a&&(i=a-o),t+r>s&&(t=s-r),e.style.left=t-n.left-window.scrollX+"px",e.style.top=i-n.top-window.scrollY+"px"}_hideMenuElement(e){e.style.display="none"}},iit=class{constructor(e,t={}){this.viewer=e,this.scene=this.viewer.scene,this._lensCursorDiv=document.createElement("div"),this._lensParams={canvasSize:300,cursorBorder:2,cursorSize:10},this._lensCursorDiv.style.borderRadius="50%",this._lensCursorDiv.style.width=this._lensParams.cursorSize+"px",this._lensCursorDiv.style.height=this._lensParams.cursorSize+"px",this._lensCursorDiv.style.zIndex="100000",this._lensCursorDiv.style.position="absolute",this._lensCursorDiv.style.pointerEvents="none",this._lensContainer=document.createElement("div"),this._lensContainerId=t.containerId||"xeokit-lens",this._lensContainer.setAttribute("id",this._lensContainerId),this._lensContainer.style.border="1px solid black",this._lensContainer.style.background="white",this._lensContainer.style.borderRadius="50%",this._lensContainer.style.width=this._lensParams.canvasSize+"px",this._lensContainer.style.height=this._lensParams.canvasSize+"px",this._lensContainer.style.zIndex="15000",this._lensContainer.style.position="absolute",this._lensContainer.style.pointerEvents="none",this._lensContainer.style.visibility="hidden",this._lensCanvas=document.createElement("canvas"),this._lensCanvas.id=`${this._lensContainerId}-canvas`,this._lensCanvas.style.borderRadius="50%",this._lensCanvas.style.width=this._lensParams.canvasSize+"px",this._lensCanvas.style.height=this._lensParams.canvasSize+"px",this._lensCanvas.style.zIndex="15000",this._lensCanvas.style.pointerEvents="none",document.body.appendChild(this._lensContainer),this._lensContainer.appendChild(this._lensCanvas),this._lensContainer.appendChild(this._lensCursorDiv),this._lensCanvasContext=this._lensCanvas.getContext("2d"),this._canvasElement=this.viewer.scene.canvas.canvas,this._canvasPos=null,this._snappedCanvasPos=null,this._lensPosToggle=t.lensPosToggle||!0,this._lensPosToggleAmount=t.lensPosToggleAmount||85,this._lensPosMarginLeft=t.lensPosMarginLeft||85,this._lensPosMarginTop=t.lensPosMarginTop||25,this._lensContainer.style.marginTop=`${this._lensPosMarginTop}px`,this._lensContainer.style.marginLeft=`${this._lensPosMarginLeft}px`,this._zoomLevel=t.zoomLevel||2,this._active=t.active!==!1,this._visible=!1,this.snapped=!1,this._onViewerRendering=this.viewer.scene.on("rendering",()=>{this._active&&this._visible&&this.update()})}update(){if(!this._active||!this._visible||!this._canvasPos)return;let e=this._lensContainer.getBoundingClientRect(),t=this._canvasElement.getBoundingClientRect(),i=this._canvasPos[0]<e.right&&this._canvasPos[0]>e.left&&this._canvasPos[1]<e.bottom&&this._canvasPos[1]>e.top;this._lensContainer.style.marginLeft=`${this._lensPosMarginLeft}px`,i&&(this._lensPosToggle?this._lensContainer.style.marginTop=`${t.bottom-t.top-this._lensCanvas.height-this._lensPosToggleAmount}px`:this._lensContainer.style.marginTop=`${this._lensPosMarginTop}px`,this._lensPosToggle=!this._lensPosToggle),this._lensCanvasContext.clearRect(0,0,this._lensCanvas.width,this._lensCanvas.height);let o=Math.max(this._lensCanvas.width,this._lensCanvas.height)/this._zoomLevel;this._lensCanvasContext.drawImage(this._canvasElement,this._canvasPos[0]-o/2,this._canvasPos[1]-o/2,o,o,0,0,this._lensCanvas.width,this._lensCanvas.height);let r=this._lensParams.canvasSize/2-this._lensParams.cursorSize/2-this._lensParams.cursorBorder,n=this._snappedCanvasPos?this._snappedCanvasPos[0]-this._canvasPos[0]:0,a=this._snappedCanvasPos?this._snappedCanvasPos[1]-this._canvasPos[1]:0;this._lensCursorDiv.style.left=`${r+n*this._zoomLevel}px`,this._lensCursorDiv.style.top=`${r+a*this._zoomLevel}px`}set zoomFactor(e){this._zoomFactor=e,this.update()}get zoomFactor(){return this._zoomFactor}set canvasPos(e){this._canvasPos=e,this.update()}get canvasPos(){return this._canvasPos}set snappedCanvasPos(e){this._snappedCanvasPos=e,this.update()}get snappedCanvasPos(){return this._snappedCanvasPos}set snapped(e){this._snapped=e;let[t,i]=e?["greenyellow","green"]:["pink","red"];this._lensCursorDiv.style.background=t,this._lensCursorDiv.style.border=this._lensParams.cursorBorder+"px solid "+i}get snapped(){return this._snapped}_updateActiveVisible(){this._lensContainer.style.visibility=this._active&&this._visible?"visible":"hidden",this.update()}set active(e){this._active=e,this._updateActiveVisible()}get active(){return this._active}set visible(e){this._visible=e,this._updateActiveVisible()}get visible(){return this._visible}destroy(){this._destroyed||=(this.viewer.scene.off(this._onViewerRendering),this._lensContainer.removeChild(this._lensCanvas),document.body.removeChild(this._lensContainer),!0)}},z5=!0,jt=z5?Float64Array:Float32Array,p1=new jt(3),q5=new jt(16),G5=new jt(16),rit=new jt(4),b={setDoublePrecisionEnabled(e){z5=e,jt=z5?Float64Array:Float32Array},getDoublePrecisionEnabled(){return z5},MIN_DOUBLE:-(2**53-1),MAX_DOUBLE:2**53-1,MAX_INT:1e7,DEGTORAD:.0174532925,RADTODEG:57.295779513,unglobalizeObjectId(e,t){let i=t.indexOf("#");return i===e.length&&t.startsWith(e)?t.substring(i+1):t},globalizeObjectId(e,t){return e+"#"+t},safeInv(e){let t=1/e;return isNaN(t)||!isFinite(t)?1:t},vec2(e){return new jt(e||2)},vec3(e){return new jt(e||3)},vec4(e){return new jt(e||4)},mat3(e){return new jt(e||9)},mat3ToMat4(e,t=new jt(16)){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},mat4(e){return new jt(e||16)},mat4ToMat3(e,t=new jt(9)){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},doublesToFloats(e,t,i){let o=new jt(2);for(let r=0,n=e.length;r<n;r++)b.splitDouble(e[r],o),t[r]=o[0],i[r]=o[1]},splitDouble(e,t){let i=jt.from([e])[0],o=e-i;t[0]=i,t[1]=o},createUUID:(()=>{let e=[];for(let t=0;t<256;t++)e[t]=(t<16?"0":"")+t.toString(16);return()=>{let t=Math.random()*4294967295|0,i=Math.random()*4294967295|0,o=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return`${e[t&255]+e[t>>8&255]+e[t>>16&255]+e[t>>24&255]}-${e[i&255]}${e[i>>8&255]}-${e[i>>16&15|64]}${e[i>>24&255]}-${e[o&63|128]}${e[o>>8&255]}-${e[o>>16&255]}${e[o>>24&255]}${e[r&255]}${e[r>>8&255]}${e[r>>16&255]}${e[r>>24&255]}`}})(),clamp(e,t,i){return Math.max(t,Math.min(i,e))},fmod(e,t){if(e<t)return console.error("math.fmod : Attempting to find modulus within negative range - would be infinite loop - ignoring"),e;for(;t<=e;)e-=t;return e},compareVec3(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},compareVec4(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},negateVec3(e,t){return t||=e,t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},negateVec4(e,t){return t||=e,t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},addVec4(e,t,i){return i||=e,i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i},addVec4Scalar(e,t,i){return i||=e,i[0]=e[0]+t,i[1]=e[1]+t,i[2]=e[2]+t,i[3]=e[3]+t,i},addVec3(e,t,i){return i||=e,i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i},addVec3Scalar(e,t,i){return i||=e,i[0]=e[0]+t,i[1]=e[1]+t,i[2]=e[2]+t,i},subVec4(e,t,i){return i||=e,i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i},subVec3(e,t,i){return i||=e,i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i},subVec2(e,t,i){return i||=e,i[0]=e[0]-t[0],i[1]=e[1]-t[1],i},geometricMeanVec2(...e){let t=new jt(e[0]);for(let i=1;i<e.length;i++)t[0]+=e[i][0],t[1]+=e[i][1];return t[0]/=e.length,t[1]/=e.length,t},subVec4Scalar(e,t,i){return i||=e,i[0]=e[0]-t,i[1]=e[1]-t,i[2]=e[2]-t,i[3]=e[3]-t,i},subScalarVec4(e,t,i){return i||=e,i[0]=t-e[0],i[1]=t-e[1],i[2]=t-e[2],i[3]=t-e[3],i},mulVec4(e,t,i){return i||=e,i[0]=e[0]*t[0],i[1]=e[1]*t[1],i[2]=e[2]*t[2],i[3]=e[3]*t[3],i},mulVec4Scalar(e,t,i){return i||=e,i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i},mulVec3Scalar(e,t,i){return i||=e,i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i},mulVec2Scalar(e,t,i){return i||=e,i[0]=e[0]*t,i[1]=e[1]*t,i},divVec3(e,t,i){return i||=e,i[0]=e[0]/t[0],i[1]=e[1]/t[1],i[2]=e[2]/t[2],i},divVec4(e,t,i){return i||=e,i[0]=e[0]/t[0],i[1]=e[1]/t[1],i[2]=e[2]/t[2],i[3]=e[3]/t[3],i},divScalarVec3(e,t,i){return i||=t,i[0]=e/t[0],i[1]=e/t[1],i[2]=e/t[2],i},divVec3Scalar(e,t,i){return i||=e,i[0]=e[0]/t,i[1]=e[1]/t,i[2]=e[2]/t,i},divVec4Scalar(e,t,i){return i||=e,i[0]=e[0]/t,i[1]=e[1]/t,i[2]=e[2]/t,i[3]=e[3]/t,i},divScalarVec4(e,t,i){return i||=t,i[0]=e/t[0],i[1]=e/t[1],i[2]=e/t[2],i[3]=e/t[3],i},dotVec4(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},cross3Vec4(e,t){let i=e[0],o=e[1],r=e[2],n=t[0],a=t[1],s=t[2];return[o*s-r*a,r*n-i*s,i*a-o*n,0]},cross3Vec3(e,t,i){i||=e;let o=e[0],r=e[1],n=e[2],a=t[0],s=t[1],l=t[2];return i[0]=r*l-n*s,i[1]=n*a-o*l,i[2]=o*s-r*a,i},sqLenVec4(e){return b.dotVec4(e,e)},lenVec4(e){return Math.sqrt(b.sqLenVec4(e))},dotVec3(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},dotVec2(e,t){return e[0]*t[0]+e[1]*t[1]},sqLenVec3(e){return b.dotVec3(e,e)},sqLenVec2(e){return b.dotVec2(e,e)},lenVec3(e){return Math.sqrt(b.sqLenVec3(e))},distVec3:(()=>{let e=new jt(3);return(t,i)=>b.lenVec3(b.subVec3(t,i,e))})(),lenVec2(e){return Math.sqrt(b.sqLenVec2(e))},distVec2:(()=>{let e=new jt(2);return(t,i)=>b.lenVec2(b.subVec2(t,i,e))})(),rcpVec3(e,t){return b.divScalarVec3(1,e,t)},normalizeVec4(e,t){let i=1/b.lenVec4(e);return b.mulVec4Scalar(e,i,t)},normalizeVec3(e,t){let i=1/b.lenVec3(e);return b.mulVec3Scalar(e,i,t)},normalizeVec2(e,t){let i=1/b.lenVec2(e);return b.mulVec2Scalar(e,i,t)},angleVec3(e,t){let i=b.dotVec3(e,t)/Math.sqrt(b.sqLenVec3(e)*b.sqLenVec3(t));return i=i<-1?-1:i>1?1:i,Math.acos(i)},vec3FromMat4Scale:(()=>{let e=new jt(3);return(t,i)=>(e[0]=t[0],e[1]=t[1],e[2]=t[2],i[0]=b.lenVec3(e),e[0]=t[4],e[1]=t[5],e[2]=t[6],i[1]=b.lenVec3(e),e[0]=t[8],e[1]=t[9],e[2]=t[10],i[2]=b.lenVec3(e),i)})(),vecToArray:(()=>{function e(t){return Math.round(t*1e5)/1e5}return t=>{t=Array.prototype.slice.call(t);for(let i=0,o=t.length;i<o;i++)t[i]=e(t[i]);return t}})(),xyzArrayToObject(e){return{x:e[0],y:e[1],z:e[2]}},xyzObjectToArray(e,t){return t||=b.vec3(),t[0]=e.x,t[1]=e.y,t[2]=e.z,t},dupMat4(e){return e.slice(0,16)},mat4To3(e){return[e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]]},m4s(e){return[e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e]},setMat4ToZeroes(){return b.m4s(0)},setMat4ToOnes(){return b.m4s(1)},diagonalMat4v(e){return new jt([e[0],0,0,0,0,e[1],0,0,0,0,e[2],0,0,0,0,e[3]])},diagonalMat4c(e,t,i,o){return b.diagonalMat4v([e,t,i,o])},diagonalMat4s(e){return b.diagonalMat4c(e,e,e,e)},identityMat4(e=new jt(16)){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},identityMat3(e=new jt(9)){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},isIdentityMat4(e){return!(e[0]!==1||e[1]!==0||e[2]!==0||e[3]!==0||e[4]!==0||e[5]!==1||e[6]!==0||e[7]!==0||e[8]!==0||e[9]!==0||e[10]!==1||e[11]!==0||e[12]!==0||e[13]!==0||e[14]!==0||e[15]!==1)},negateMat4(e,t){return t||=e,t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},addMat4(e,t,i){return i||=e,i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i[9]=e[9]+t[9],i[10]=e[10]+t[10],i[11]=e[11]+t[11],i[12]=e[12]+t[12],i[13]=e[13]+t[13],i[14]=e[14]+t[14],i[15]=e[15]+t[15],i},addMat4Scalar(e,t,i){return i||=e,i[0]=e[0]+t,i[1]=e[1]+t,i[2]=e[2]+t,i[3]=e[3]+t,i[4]=e[4]+t,i[5]=e[5]+t,i[6]=e[6]+t,i[7]=e[7]+t,i[8]=e[8]+t,i[9]=e[9]+t,i[10]=e[10]+t,i[11]=e[11]+t,i[12]=e[12]+t,i[13]=e[13]+t,i[14]=e[14]+t,i[15]=e[15]+t,i},addScalarMat4(e,t,i){return b.addMat4Scalar(t,e,i)},subMat4(e,t,i){return i||=e,i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i[9]=e[9]-t[9],i[10]=e[10]-t[10],i[11]=e[11]-t[11],i[12]=e[12]-t[12],i[13]=e[13]-t[13],i[14]=e[14]-t[14],i[15]=e[15]-t[15],i},subMat4Scalar(e,t,i){return i||=e,i[0]=e[0]-t,i[1]=e[1]-t,i[2]=e[2]-t,i[3]=e[3]-t,i[4]=e[4]-t,i[5]=e[5]-t,i[6]=e[6]-t,i[7]=e[7]-t,i[8]=e[8]-t,i[9]=e[9]-t,i[10]=e[10]-t,i[11]=e[11]-t,i[12]=e[12]-t,i[13]=e[13]-t,i[14]=e[14]-t,i[15]=e[15]-t,i},subScalarMat4(e,t,i){return i||=t,i[0]=e-t[0],i[1]=e-t[1],i[2]=e-t[2],i[3]=e-t[3],i[4]=e-t[4],i[5]=e-t[5],i[6]=e-t[6],i[7]=e-t[7],i[8]=e-t[8],i[9]=e-t[9],i[10]=e-t[10],i[11]=e-t[11],i[12]=e-t[12],i[13]=e-t[13],i[14]=e-t[14],i[15]=e-t[15],i},mulMat4(e,t,i){i||=e;let o=e[0],r=e[1],n=e[2],a=e[3],s=e[4],l=e[5],c=e[6],d=e[7],u=e[8],A=e[9],h=e[10],p=e[11],f=e[12],m=e[13],g=e[14],y=e[15],v=t[0],C=t[1],x=t[2],B=t[3],E=t[4],D=t[5],P=t[6],M=t[7],R=t[8],O=t[9],V=t[10],z=t[11],K=t[12],Z=t[13],te=t[14],ie=t[15];return i[0]=v*o+C*s+x*u+B*f,i[1]=v*r+C*l+x*A+B*m,i[2]=v*n+C*c+x*h+B*g,i[3]=v*a+C*d+x*p+B*y,i[4]=E*o+D*s+P*u+M*f,i[5]=E*r+D*l+P*A+M*m,i[6]=E*n+D*c+P*h+M*g,i[7]=E*a+D*d+P*p+M*y,i[8]=R*o+O*s+V*u+z*f,i[9]=R*r+O*l+V*A+z*m,i[10]=R*n+O*c+V*h+z*g,i[11]=R*a+O*d+V*p+z*y,i[12]=K*o+Z*s+te*u+ie*f,i[13]=K*r+Z*l+te*A+ie*m,i[14]=K*n+Z*c+te*h+ie*g,i[15]=K*a+Z*d+te*p+ie*y,i},mulMat3(e,t,i){i||=new jt(9);let o=e[0],r=e[3],n=e[6],a=e[1],s=e[4],l=e[7],c=e[2],d=e[5],u=e[8],A=t[0],h=t[3],p=t[6],f=t[1],m=t[4],g=t[7],y=t[2],v=t[5],C=t[8];return i[0]=o*A+r*f+n*y,i[3]=o*h+r*m+n*v,i[6]=o*p+r*g+n*C,i[1]=a*A+s*f+l*y,i[4]=a*h+s*m+l*v,i[7]=a*p+s*g+l*C,i[2]=c*A+d*f+u*y,i[5]=c*h+d*m+u*v,i[8]=c*p+d*g+u*C,i},mulMat4Scalar(e,t,i){return i||=e,i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i[9]=e[9]*t,i[10]=e[10]*t,i[11]=e[11]*t,i[12]=e[12]*t,i[13]=e[13]*t,i[14]=e[14]*t,i[15]=e[15]*t,i},mulMat4v4(e,t,i=b.vec4()){let o=t[0],r=t[1],n=t[2],a=t[3];return i[0]=e[0]*o+e[4]*r+e[8]*n+e[12]*a,i[1]=e[1]*o+e[5]*r+e[9]*n+e[13]*a,i[2]=e[2]*o+e[6]*r+e[10]*n+e[14]*a,i[3]=e[3]*o+e[7]*r+e[11]*n+e[15]*a,i},transposeMat4(e,t){let i=e[4],o=e[14],r=e[8],n=e[13],a=e[12],s=e[9];if(!t||e===t){let l=e[1],c=e[2],d=e[3],u=e[6],A=e[7],h=e[11];return e[1]=i,e[2]=r,e[3]=a,e[4]=l,e[6]=s,e[7]=n,e[8]=c,e[9]=u,e[11]=o,e[12]=d,e[13]=A,e[14]=h,e}return t[0]=e[0],t[1]=i,t[2]=r,t[3]=a,t[4]=e[1],t[5]=e[5],t[6]=s,t[7]=n,t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=o,t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t},transposeMat3(e,t){if(t===e){let i=e[1],o=e[2],r=e[5];t[1]=e[3],t[2]=e[6],t[3]=i,t[5]=e[7],t[6]=o,t[7]=r}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},determinantMat4(e){let t=e[0],i=e[1],o=e[2],r=e[3],n=e[4],a=e[5],s=e[6],l=e[7],c=e[8],d=e[9],u=e[10],A=e[11],h=e[12],p=e[13],f=e[14],m=e[15];return h*d*s*r-c*p*s*r-h*a*u*r+n*p*u*r+c*a*f*r-n*d*f*r-h*d*o*l+c*p*o*l+h*i*u*l-t*p*u*l-c*i*f*l+t*d*f*l+h*a*o*A-n*p*o*A-h*i*s*A+t*p*s*A+n*i*f*A-t*a*f*A-c*a*o*m+n*d*o*m+c*i*s*m-t*d*s*m-n*i*u*m+t*a*u*m},inverseMat4(e,t){t||=e;let i=e[0],o=e[1],r=e[2],n=e[3],a=e[4],s=e[5],l=e[6],c=e[7],d=e[8],u=e[9],A=e[10],h=e[11],p=e[12],f=e[13],m=e[14],g=e[15],y=i*s-o*a,v=i*l-r*a,C=i*c-n*a,x=o*l-r*s,B=o*c-n*s,E=r*c-n*l,D=d*f-u*p,P=d*m-A*p,M=d*g-h*p,R=u*m-A*f,O=u*g-h*f,V=A*g-h*m,z=1/(y*V-v*O+C*R+x*M-B*P+E*D);return t[0]=(s*V-l*O+c*R)*z,t[1]=(-o*V+r*O-n*R)*z,t[2]=(f*E-m*B+g*x)*z,t[3]=(-u*E+A*B-h*x)*z,t[4]=(-a*V+l*M-c*P)*z,t[5]=(i*V-r*M+n*P)*z,t[6]=(-p*E+m*C-g*v)*z,t[7]=(d*E-A*C+h*v)*z,t[8]=(a*O-s*M+c*D)*z,t[9]=(-i*O+o*M-n*D)*z,t[10]=(p*B-f*C+g*y)*z,t[11]=(-d*B+u*C-h*y)*z,t[12]=(-a*R+s*P-l*D)*z,t[13]=(i*R-o*P+r*D)*z,t[14]=(-p*x+f*v-m*y)*z,t[15]=(d*x-u*v+A*y)*z,t},traceMat4(e){return e[0]+e[5]+e[10]+e[15]},translationMat4v(e,t){let i=t||b.identityMat4();return i[12]=e[0],i[13]=e[1],i[14]=e[2],i},translationMat3v(e,t){let i=t||b.identityMat3();return i[6]=e[0],i[7]=e[1],i},translationMat4c:(()=>{let e=new jt(3);return(t,i,o,r)=>(e[0]=t,e[1]=i,e[2]=o,b.translationMat4v(e,r))})(),translationMat4s(e,t){return b.translationMat4c(e,e,e,t)},translateMat4v(e,t){return b.translateMat4c(e[0],e[1],e[2],t)},translateMat4c(e,t,i,o){let r=o[3];o[0]+=r*e,o[1]+=r*t,o[2]+=r*i;let n=o[7];o[4]+=n*e,o[5]+=n*t,o[6]+=n*i;let a=o[11];o[8]+=a*e,o[9]+=a*t,o[10]+=a*i;let s=o[15];return o[12]+=s*e,o[13]+=s*t,o[14]+=s*i,o},setMat4Translation(e,t,i){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=t[0],i[13]=t[1],i[14]=t[2],i[15]=e[15],i},rotationMat4v(e,t,i){let o=b.normalizeVec4([t[0],t[1],t[2],0],[]),r=Math.sin(e),n=Math.cos(e),a=1-n,s=o[0],l=o[1],c=o[2],d,u,A,h,p,f;return d=s*l,u=l*c,A=c*s,h=s*r,p=l*r,f=c*r,i||=b.mat4(),i[0]=a*s*s+n,i[1]=a*d+f,i[2]=a*A-p,i[3]=0,i[4]=a*d-f,i[5]=a*l*l+n,i[6]=a*u+h,i[7]=0,i[8]=a*A+p,i[9]=a*u-h,i[10]=a*c*c+n,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},rotationMat4c(e,t,i,o,r){return b.rotationMat4v(e,[t,i,o],r)},scalingMat4v(e,t=b.identityMat4()){return t[0]=e[0],t[5]=e[1],t[10]=e[2],t},scalingMat3v(e,t=b.identityMat3()){return t[0]=e[0],t[4]=e[1],t},scalingMat4c:(()=>{let e=new jt(3);return(t,i,o,r)=>(e[0]=t,e[1]=i,e[2]=o,b.scalingMat4v(e,r))})(),scaleMat4c(e,t,i,o){return o[0]*=e,o[4]*=t,o[8]*=i,o[1]*=e,o[5]*=t,o[9]*=i,o[2]*=e,o[6]*=t,o[10]*=i,o[3]*=e,o[7]*=t,o[11]*=i,o},scaleMat4v(e,t){let i=e[0],o=e[1],r=e[2];return t[0]*=i,t[4]*=o,t[8]*=r,t[1]*=i,t[5]*=o,t[9]*=r,t[2]*=i,t[6]*=o,t[10]*=r,t[3]*=i,t[7]*=o,t[11]*=r,t},scalingMat4s(e){return b.scalingMat4c(e,e,e)},rotationTranslationMat4(e,t,i=b.mat4()){let o=e[0],r=e[1],n=e[2],a=e[3],s=o+o,l=r+r,c=n+n,d=o*s,u=o*l,A=o*c,h=r*l,p=r*c,f=n*c,m=a*s,g=a*l,y=a*c;return i[0]=1-(h+f),i[1]=u+y,i[2]=A-g,i[3]=0,i[4]=u-y,i[5]=1-(d+f),i[6]=p+m,i[7]=0,i[8]=A+g,i[9]=p-m,i[10]=1-(d+h),i[11]=0,i[12]=t[0],i[13]=t[1],i[14]=t[2],i[15]=1,i},mat4ToEuler(e,t,i=b.vec4()){let o=b.clamp,r=e[0],n=e[4],a=e[8],s=e[1],l=e[5],c=e[9],d=e[2],u=e[6],A=e[10];return t==="XYZ"?(i[1]=Math.asin(o(a,-1,1)),Math.abs(a)<.99999?(i[0]=Math.atan2(-c,A),i[2]=Math.atan2(-n,r)):(i[0]=Math.atan2(u,l),i[2]=0)):t==="YXZ"?(i[0]=Math.asin(-o(c,-1,1)),Math.abs(c)<.99999?(i[1]=Math.atan2(a,A),i[2]=Math.atan2(s,l)):(i[1]=Math.atan2(-d,r),i[2]=0)):t==="ZXY"?(i[0]=Math.asin(o(u,-1,1)),Math.abs(u)<.99999?(i[1]=Math.atan2(-d,A),i[2]=Math.atan2(-n,l)):(i[1]=0,i[2]=Math.atan2(s,r))):t==="ZYX"?(i[1]=Math.asin(-o(d,-1,1)),Math.abs(d)<.99999?(i[0]=Math.atan2(u,A),i[2]=Math.atan2(s,r)):(i[0]=0,i[2]=Math.atan2(-n,l))):t==="YZX"?(i[2]=Math.asin(o(s,-1,1)),Math.abs(s)<.99999?(i[0]=Math.atan2(-c,l),i[1]=Math.atan2(-d,r)):(i[0]=0,i[1]=Math.atan2(a,A))):t==="XZY"&&(i[2]=Math.asin(-o(n,-1,1)),Math.abs(n)<.99999?(i[0]=Math.atan2(u,l),i[1]=Math.atan2(a,r)):(i[0]=Math.atan2(-c,A),i[1]=0)),i[0]*=b.RADTODEG,i[1]*=b.RADTODEG,i[2]*=b.RADTODEG,i},composeMat4(e,t,i,o=b.mat4()){return b.quaternionToRotationMat4(t,o),b.scaleMat4v(i,o),b.translateMat4v(e,o),o},decomposeMat4:(()=>{let e=new jt(3),t=new jt(16);return function(i,o,r,n){e[0]=i[0],e[1]=i[1],e[2]=i[2];let a=b.lenVec3(e);e[0]=i[4],e[1]=i[5],e[2]=i[6];let s=b.lenVec3(e);e[8]=i[8],e[9]=i[9],e[10]=i[10];let l=b.lenVec3(e);b.determinantMat4(i)<0&&(a=-a),o[0]=i[12],o[1]=i[13],o[2]=i[14],t.set(i);let c=1/a,d=1/s,u=1/l;return t[0]*=c,t[1]*=c,t[2]*=c,t[4]*=d,t[5]*=d,t[6]*=d,t[8]*=u,t[9]*=u,t[10]*=u,b.mat4ToQuaternion(t,r),n[0]=a,n[1]=s,n[2]=l,this}})(),getColMat4(e,t){let i=t*4;return[e[i],e[i+1],e[i+2],e[i+3]]},setRowMat4(e,t,i){e[t]=i[0],e[t+4]=i[1],e[t+8]=i[2],e[t+12]=i[3]},lookAtMat4v(e,t,i,o){o||=b.mat4();let r=e[0],n=e[1],a=e[2],s=i[0],l=i[1],c=i[2],d=t[0],u=t[1],A=t[2];if(r===d&&n===u&&a===A)return b.identityMat4();let h,p,f,m,g,y,v,C,x,B;return h=r-d,p=n-u,f=a-A,B=1/Math.sqrt(h*h+p*p+f*f),h*=B,p*=B,f*=B,m=l*f-c*p,g=c*h-s*f,y=s*p-l*h,B=Math.sqrt(m*m+g*g+y*y),B?(B=1/B,m*=B,g*=B,y*=B):(m=0,g=0,y=0),v=p*y-f*g,C=f*m-h*y,x=h*g-p*m,B=Math.sqrt(v*v+C*C+x*x),B?(B=1/B,v*=B,C*=B,x*=B):(v=0,C=0,x=0),o[0]=m,o[1]=v,o[2]=h,o[3]=0,o[4]=g,o[5]=C,o[6]=p,o[7]=0,o[8]=y,o[9]=x,o[10]=f,o[11]=0,o[12]=-(m*r+g*n+y*a),o[13]=-(v*r+C*n+x*a),o[14]=-(h*r+p*n+f*a),o[15]=1,o},lookAtMat4c(e,t,i,o,r,n,a,s,l){return b.lookAtMat4v([e,t,i],[o,r,n],[a,s,l],[])},orthoMat4c(e,t,i,o,r,n,a){a||=b.mat4();let s=t-e,l=o-i,c=n-r;return a[0]=2/s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=2/l,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=-2/c,a[11]=0,a[12]=-(e+t)/s,a[13]=-(o+i)/l,a[14]=-(n+r)/c,a[15]=1,a},frustumMat4v(e,t,i){i||=b.mat4();let o=[e[0],e[1],e[2],0],r=[t[0],t[1],t[2],0];b.addVec4(r,o,q5),b.subVec4(r,o,G5);let n=2*o[2],a=G5[0],s=G5[1],l=G5[2];return i[0]=n/a,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=n/s,i[6]=0,i[7]=0,i[8]=q5[0]/a,i[9]=q5[1]/s,i[10]=-q5[2]/l,i[11]=-1,i[12]=0,i[13]=0,i[14]=-n*r[2]/l,i[15]=0,i},frustumMat4(e,t,i,o,r,n,a){a||=b.mat4();let s=t-e,l=o-i,c=n-r;return a[0]=r*2/s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=r*2/l,a[6]=0,a[7]=0,a[8]=(t+e)/s,a[9]=(o+i)/l,a[10]=-(n+r)/c,a[11]=-1,a[12]=0,a[13]=0,a[14]=-(n*r*2)/c,a[15]=0,a},perspectiveMat4(e,t,i,o,r){let n=[],a=[];return n[2]=i,a[2]=o,a[1]=n[2]*Math.tan(e/2),n[1]=-a[1],a[0]=a[1]*t,n[0]=-a[0],b.frustumMat4v(n,a,r)},compareMat4(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]},transformPoint3(e,t,i=b.vec3()){let o=t[0],r=t[1],n=t[2];return i[0]=e[0]*o+e[4]*r+e[8]*n+e[12],i[1]=e[1]*o+e[5]*r+e[9]*n+e[13],i[2]=e[2]*o+e[6]*r+e[10]*n+e[14],i},transformPoint4(e,t,i=b.vec4()){return i[0]=e[0]*t[0]+e[4]*t[1]+e[8]*t[2]+e[12]*t[3],i[1]=e[1]*t[0]+e[5]*t[1]+e[9]*t[2]+e[13]*t[3],i[2]=e[2]*t[0]+e[6]*t[1]+e[10]*t[2]+e[14]*t[3],i[3]=e[3]*t[0]+e[7]*t[1]+e[11]*t[2]+e[15]*t[3],i},transformPoints3(e,t,i){let o=i||[],r=t.length,n,a,s,l,c=e[0],d=e[1],u=e[2],A=e[3],h=e[4],p=e[5],f=e[6],m=e[7],g=e[8],y=e[9],v=e[10],C=e[11],x=e[12],B=e[13],E=e[14],D=e[15],P;for(let M=0;M<r;++M)l=t[M],n=l[0],a=l[1],s=l[2],P=o[M]||(o[M]=[0,0,0]),P[0]=c*n+h*a+g*s+x,P[1]=d*n+p*a+y*s+B,P[2]=u*n+f*a+v*s+E,P[3]=A*n+m*a+C*s+D;return o.length=r,o},transformPositions3(e,t,i=t){let o,r=t.length,n,a,s,l=e[0],c=e[1],d=e[2];e[3];let u=e[4],A=e[5],h=e[6];e[7];let p=e[8],f=e[9],m=e[10];e[11];let g=e[12],y=e[13],v=e[14];for(e[15],o=0;o<r;o+=3)n=t[o+0],a=t[o+1],s=t[o+2],i[o+0]=l*n+u*a+p*s+g,i[o+1]=c*n+A*a+f*s+y,i[o+2]=d*n+h*a+m*s+v;return i},transformPositions4(e,t,i=t){let o,r=t.length,n,a,s,l=e[0],c=e[1],d=e[2],u=e[3],A=e[4],h=e[5],p=e[6],f=e[7],m=e[8],g=e[9],y=e[10],v=e[11],C=e[12],x=e[13],B=e[14],E=e[15];for(o=0;o<r;o+=4)n=t[o+0],a=t[o+1],s=t[o+2],i[o+0]=l*n+A*a+m*s+C,i[o+1]=c*n+h*a+g*s+x,i[o+2]=d*n+p*a+y*s+B,i[o+3]=u*n+f*a+v*s+E;return i},transformVec3(e,t,i){let o=t[0],r=t[1],n=t[2];return i||=this.vec3(),i[0]=e[0]*o+e[4]*r+e[8]*n,i[1]=e[1]*o+e[5]*r+e[9]*n,i[2]=e[2]*o+e[6]*r+e[10]*n,i},transformVec4(e,t,i){let o=t[0],r=t[1],n=t[2],a=t[3];return i||=b.vec4(),i[0]=e[0]*o+e[4]*r+e[8]*n+e[12]*a,i[1]=e[1]*o+e[5]*r+e[9]*n+e[13]*a,i[2]=e[2]*o+e[6]*r+e[10]*n+e[14]*a,i[3]=e[3]*o+e[7]*r+e[11]*n+e[15]*a,i},rotateVec2(e,t,i,o=e){let r=Math.cos(i),n=Math.sin(i),a=e[0]-t[0],s=e[1]-t[1];return o[0]=a*r-s*n+t[0],o[1]=a*n+s*r+t[1],e},rotateVec3X(e,t,i,o){let r=[],n=[];return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],n[0]=r[0],n[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),n[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),o[0]=n[0]+t[0],o[1]=n[1]+t[1],o[2]=n[2]+t[2],o},rotateVec3Y(e,t,i,o){let r=[],n=[];return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],n[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),n[1]=r[1],n[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),o[0]=n[0]+t[0],o[1]=n[1]+t[1],o[2]=n[2]+t[2],o},rotateVec3Z(e,t,i,o){let r=[],n=[];return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],n[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),n[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),n[2]=r[2],o[0]=n[0]+t[0],o[1]=n[1]+t[1],o[2]=n[2]+t[2],o},projectVec4(e,t){let i=1/e[3];return t||=b.vec2(),t[0]=e[0]*i,t[1]=e[1]*i,t},unprojectVec3:(()=>{let e=new jt(16),t=new jt(16),i=new jt(16);return function(o,r,n,a){return this.transformVec3(this.mulMat4(this.inverseMat4(r,e),this.inverseMat4(n,t),i),o,a)}})(),lerpVec3(e,t,i,o,r,n){let a=n||b.vec3(),s=(e-t)/(i-t);return a[0]=o[0]+s*(r[0]-o[0]),a[1]=o[1]+s*(r[1]-o[1]),a[2]=o[2]+s*(r[2]-o[2]),a},lerpMat4(e,t,i,o,r,n){let a=n||b.mat4(),s=(e-t)/(i-t);return a[0]=o[0]+s*(r[0]-o[0]),a[1]=o[1]+s*(r[1]-o[1]),a[2]=o[2]+s*(r[2]-o[2]),a[3]=o[3]+s*(r[3]-o[3]),a[4]=o[4]+s*(r[4]-o[4]),a[5]=o[5]+s*(r[5]-o[5]),a[6]=o[6]+s*(r[6]-o[6]),a[7]=o[7]+s*(r[7]-o[7]),a[8]=o[8]+s*(r[8]-o[8]),a[9]=o[9]+s*(r[9]-o[9]),a[10]=o[10]+s*(r[10]-o[10]),a[11]=o[11]+s*(r[11]-o[11]),a[12]=o[12]+s*(r[12]-o[12]),a[13]=o[13]+s*(r[13]-o[13]),a[14]=o[14]+s*(r[14]-o[14]),a[15]=o[15]+s*(r[15]-o[15]),a},flatten(e){let t=[],i,o,r,n,a;for(i=0,o=e.length;i<o;i++)for(a=e[i],r=0,n=a.length;r<n;r++)t.push(a[r]);return t},identityQuaternion(e=b.vec4()){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},eulerToQuaternion(e,t,i=b.vec4()){let o=e[0]*b.DEGTORAD/2,r=e[1]*b.DEGTORAD/2,n=e[2]*b.DEGTORAD/2,a=Math.cos(o),s=Math.cos(r),l=Math.cos(n),c=Math.sin(o),d=Math.sin(r),u=Math.sin(n);return t==="XYZ"?(i[0]=c*s*l+a*d*u,i[1]=a*d*l-c*s*u,i[2]=a*s*u+c*d*l,i[3]=a*s*l-c*d*u):t==="YXZ"?(i[0]=c*s*l+a*d*u,i[1]=a*d*l-c*s*u,i[2]=a*s*u-c*d*l,i[3]=a*s*l+c*d*u):t==="ZXY"?(i[0]=c*s*l-a*d*u,i[1]=a*d*l+c*s*u,i[2]=a*s*u+c*d*l,i[3]=a*s*l-c*d*u):t==="ZYX"?(i[0]=c*s*l-a*d*u,i[1]=a*d*l+c*s*u,i[2]=a*s*u-c*d*l,i[3]=a*s*l+c*d*u):t==="YZX"?(i[0]=c*s*l+a*d*u,i[1]=a*d*l+c*s*u,i[2]=a*s*u-c*d*l,i[3]=a*s*l-c*d*u):t==="XZY"&&(i[0]=c*s*l-a*d*u,i[1]=a*d*l-c*s*u,i[2]=a*s*u+c*d*l,i[3]=a*s*l+c*d*u),i},mat4ToQuaternion(e,t=b.vec4()){let i=e[0],o=e[4],r=e[8],n=e[1],a=e[5],s=e[9],l=e[2],c=e[6],d=e[10],u,A=i+a+d;return A>0?(u=.5/Math.sqrt(A+1),t[3]=.25/u,t[0]=(c-s)*u,t[1]=(r-l)*u,t[2]=(n-o)*u):i>a&&i>d?(u=2*Math.sqrt(1+i-a-d),t[3]=(c-s)/u,t[0]=.25*u,t[1]=(o+n)/u,t[2]=(r+l)/u):a>d?(u=2*Math.sqrt(1+a-i-d),t[3]=(r-l)/u,t[0]=(o+n)/u,t[1]=.25*u,t[2]=(s+c)/u):(u=2*Math.sqrt(1+d-i-a),t[3]=(n-o)/u,t[0]=(r+l)/u,t[1]=(s+c)/u,t[2]=.25*u),t},vec3PairToQuaternion(e,t,i=b.vec4()){let o=Math.sqrt(b.dotVec3(e,e)*b.dotVec3(t,t)),r=o+b.dotVec3(e,t);return r<1e-8*o?(r=0,Math.abs(e[0])>Math.abs(e[2])?(i[0]=-e[1],i[1]=e[0],i[2]=0):(i[0]=0,i[1]=-e[2],i[2]=e[1])):b.cross3Vec3(e,t,i),i[3]=r,b.normalizeQuaternion(i)},angleAxisToQuaternion(e,t=b.vec4()){let i=e[3]/2,o=Math.sin(i);return t[0]=o*e[0],t[1]=o*e[1],t[2]=o*e[2],t[3]=Math.cos(i),t},quaternionToEuler:(()=>{let e=new jt(16);return(t,i,o)=>(o||=b.vec3(),b.quaternionToRotationMat4(t,e),b.mat4ToEuler(e,i,o),o)})(),mulQuaternions(e,t,i=b.vec4()){let o=e[0],r=e[1],n=e[2],a=e[3],s=t[0],l=t[1],c=t[2],d=t[3];return i[0]=a*s+o*d+r*c-n*l,i[1]=a*l+r*d+n*s-o*c,i[2]=a*c+n*d+o*l-r*s,i[3]=a*d-o*s-r*l-n*c,i},vec3ApplyQuaternion(e,t,i=b.vec3()){let o=t[0],r=t[1],n=t[2],a=e[0],s=e[1],l=e[2],c=e[3],d=c*o+s*n-l*r,u=c*r+l*o-a*n,A=c*n+a*r-s*o,h=-a*o-s*r-l*n;return i[0]=d*c+h*-a+u*-l-A*-s,i[1]=u*c+h*-s+A*-a-d*-l,i[2]=A*c+h*-l+d*-s-u*-a,i},quaternionToMat4(e,t){t=b.identityMat4(t);let i=e[0],o=e[1],r=e[2],n=e[3],a=2*i,s=2*o,l=2*r,c=a*n,d=s*n,u=l*n,A=a*i,h=s*i,p=l*i,f=s*o,m=l*o,g=l*r;return t[0]=1-(f+g),t[1]=h+u,t[2]=p-d,t[4]=h-u,t[5]=1-(A+g),t[6]=m+c,t[8]=p+d,t[9]=m-c,t[10]=1-(A+f),t},quaternionToRotationMat4(e,t){let i=e[0],o=e[1],r=e[2],n=e[3],a=i+i,s=o+o,l=r+r,c=i*a,d=i*s,u=i*l,A=o*s,h=o*l,p=r*l,f=n*a,m=n*s,g=n*l;return t[0]=1-(A+p),t[4]=d-g,t[8]=u+m,t[1]=d+g,t[5]=1-(c+p),t[9]=h-f,t[2]=u-m,t[6]=h+f,t[10]=1-(c+A),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},normalizeQuaternion(e,t=e){let i=b.lenVec4([e[0],e[1],e[2],e[3]]);return t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i,t[3]=e[3]/i,t},conjugateQuaternion(e,t=e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},inverseQuaternion(e,t){return b.normalizeQuaternion(b.conjugateQuaternion(e,t))},quaternionToAngleAxis(e,t=b.vec4()){e=b.normalizeQuaternion(e,rit);let i=e[3],o=2*Math.acos(i),r=Math.sqrt(1-i*i);return r<.001?(t[0]=e[0],t[1]=e[1],t[2]=e[2]):(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r),t[3]=o,t},AABB3(e){return new jt(e||6)},AABB2(e){return new jt(e||4)},OBB3(e){return new jt(e||32)},OBB2(e){return new jt(e||16)},Sphere3(e,t,i,o){return new jt([e,t,i,o])},transformOBB3(e,t,i=t){let o,r=t.length,n,a,s,l=e[0],c=e[1],d=e[2],u=e[3],A=e[4],h=e[5],p=e[6],f=e[7],m=e[8],g=e[9],y=e[10],v=e[11],C=e[12],x=e[13],B=e[14],E=e[15];for(o=0;o<r;o+=4)n=t[o+0],a=t[o+1],s=t[o+2],i[o+0]=l*n+A*a+m*s+C,i[o+1]=c*n+h*a+g*s+x,i[o+2]=d*n+p*a+y*s+B,i[o+3]=u*n+f*a+v*s+E;return i},containsAABB3:function(e,t){return e[0]<=t[0]&&t[3]<=e[3]&&e[1]<=t[1]&&t[4]<=e[4]&&e[2]<=t[2]&&t[5]<=e[5]},getAABB3Diag:(()=>{let e=new jt(3),t=new jt(3),i=new jt(3);return o=>(e[0]=o[0],e[1]=o[1],e[2]=o[2],t[0]=o[3],t[1]=o[4],t[2]=o[5],b.subVec3(t,e,i),Math.abs(b.lenVec3(i)))})(),getAABB3DiagPoint:(()=>{let e=new jt(3),t=new jt(3),i=new jt(3);return(o,r)=>{e[0]=o[0],e[1]=o[1],e[2]=o[2],t[0]=o[3],t[1]=o[4],t[2]=o[5];let n=b.subVec3(t,e,i),a=r[0]-o[0],s=o[3]-r[0],l=r[1]-o[1],c=o[4]-r[1],d=r[2]-o[2],u=o[5]-r[2];return n[0]+=a>s?a:s,n[1]+=l>c?l:c,n[2]+=d>u?d:u,Math.abs(b.lenVec3(n))}})(),getAABB3Area(e){let t=e[3]-e[0],i=e[4]-e[1],o=e[5]-e[2];return t*i*o},getAABB3Center(e,t){let i=t||b.vec3();return i[0]=(e[0]+e[3])/2,i[1]=(e[1]+e[4])/2,i[2]=(e[2]+e[5])/2,i},getAABB2Center(e,t){let i=t||b.vec2();return i[0]=(e[2]+e[0])/2,i[1]=(e[3]+e[1])/2,i},collapseAABB3(e=b.AABB3()){return e[0]=b.MAX_DOUBLE,e[1]=b.MAX_DOUBLE,e[2]=b.MAX_DOUBLE,e[3]=b.MIN_DOUBLE,e[4]=b.MIN_DOUBLE,e[5]=b.MIN_DOUBLE,e},AABB3ToOBB3(e,t=b.OBB3()){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t[4]=e[3],t[5]=e[1],t[6]=e[2],t[7]=1,t[8]=e[3],t[9]=e[4],t[10]=e[2],t[11]=1,t[12]=e[0],t[13]=e[4],t[14]=e[2],t[15]=1,t[16]=e[0],t[17]=e[1],t[18]=e[5],t[19]=1,t[20]=e[3],t[21]=e[1],t[22]=e[5],t[23]=1,t[24]=e[3],t[25]=e[4],t[26]=e[5],t[27]=1,t[28]=e[0],t[29]=e[4],t[30]=e[5],t[31]=1,t},positions3ToAABB3:(()=>{let e=new jt(3);return(t,i,o)=>{i||=b.AABB3();let r=b.MAX_DOUBLE,n=b.MAX_DOUBLE,a=b.MAX_DOUBLE,s=b.MIN_DOUBLE,l=b.MIN_DOUBLE,c=b.MIN_DOUBLE,d,u,A;for(let h=0,p=t.length;h<p;h+=3)o?(e[0]=t[h+0],e[1]=t[h+1],e[2]=t[h+2],b.decompressPosition(e,o,e),d=e[0],u=e[1],A=e[2]):(d=t[h+0],u=t[h+1],A=t[h+2]),d<r&&(r=d),u<n&&(n=u),A<a&&(a=A),d>s&&(s=d),u>l&&(l=u),A>c&&(c=A);return i[0]=r,i[1]=n,i[2]=a,i[3]=s,i[4]=l,i[5]=c,i}})(),OBB3ToAABB3(e,t=b.AABB3()){let i=b.MAX_DOUBLE,o=b.MAX_DOUBLE,r=b.MAX_DOUBLE,n=b.MIN_DOUBLE,a=b.MIN_DOUBLE,s=b.MIN_DOUBLE,l,c,d;for(let u=0,A=e.length;u<A;u+=4)l=e[u+0],c=e[u+1],d=e[u+2],l<i&&(i=l),c<o&&(o=c),d<r&&(r=d),l>n&&(n=l),c>a&&(a=c),d>s&&(s=d);return t[0]=i,t[1]=o,t[2]=r,t[3]=n,t[4]=a,t[5]=s,t},points3ToAABB3(e,t=b.AABB3()){let i=b.MAX_DOUBLE,o=b.MAX_DOUBLE,r=b.MAX_DOUBLE,n=b.MIN_DOUBLE,a=b.MIN_DOUBLE,s=b.MIN_DOUBLE,l,c,d;for(let u=0,A=e.length;u<A;u++)l=e[u][0],c=e[u][1],d=e[u][2],l<i&&(i=l),c<o&&(o=c),d<r&&(r=d),l>n&&(n=l),c>a&&(a=c),d>s&&(s=d);return t[0]=i,t[1]=o,t[2]=r,t[3]=n,t[4]=a,t[5]=s,t},points3ToSphere3:(()=>{let e=new jt(3);return(t,i)=>{i||=b.vec4();let o=0,r=0,n=0,a,s=t.length;for(a=0;a<s;a++)o+=t[a][0],r+=t[a][1],n+=t[a][2];i[0]=o/s,i[1]=r/s,i[2]=n/s;let l=0,c;for(a=0;a<s;a++)c=Math.abs(b.lenVec3(b.subVec3(t[a],i,e))),c>l&&(l=c);return i[3]=l,i}})(),positions3ToSphere3:(()=>{let e=new jt(3),t=new jt(3);return(i,o)=>{o||=b.vec4();let r=0,n=0,a=0,s,l=i.length,c=0;for(s=0;s<l;s+=3)r+=i[s],n+=i[s+1],a+=i[s+2];let d=l/3;o[0]=r/d,o[1]=n/d,o[2]=a/d;let u;for(s=0;s<l;s+=3)e[0]=i[s],e[1]=i[s+1],e[2]=i[s+2],u=Math.abs(b.lenVec3(b.subVec3(e,o,t))),u>c&&(c=u);return o[3]=c,o}})(),OBB3ToSphere3:(()=>{let e=new jt(3),t=new jt(3);return(i,o)=>{o||=b.vec4();let r=0,n=0,a=0,s,l=i.length,c=l/4;for(s=0;s<l;s+=4)r+=i[s+0],n+=i[s+1],a+=i[s+2];o[0]=r/c,o[1]=n/c,o[2]=a/c;let d=0,u;for(s=0;s<l;s+=4)e[0]=i[s+0],e[1]=i[s+1],e[2]=i[s+2],u=Math.abs(b.lenVec3(b.subVec3(e,o,t))),u>d&&(d=u);return o[3]=d,o}})(),getSphere3Center(e,t=b.vec3()){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},getPositionsCenter(e,t=b.vec3()){let i=0,o=0,r=0;for(var n=0,a=e.length;n<a;n+=3)i+=e[n+0],o+=e[n+1],r+=e[n+2];let s=e.length/3;return t[0]=i/s,t[1]=o/s,t[2]=r/s,t},expandAABB3(e,t){return e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]>t[2]&&(e[2]=t[2]),e[3]<t[3]&&(e[3]=t[3]),e[4]<t[4]&&(e[4]=t[4]),e[5]<t[5]&&(e[5]=t[5]),e},expandAABB3Point3(e,t){return e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]>t[2]&&(e[2]=t[2]),e[3]<t[0]&&(e[3]=t[0]),e[4]<t[1]&&(e[4]=t[1]),e[5]<t[2]&&(e[5]=t[2]),e},expandAABB3Points3(e,t){for(var i,o,r,n=0,a=t.length;n<a;n+=3)i=t[n],o=t[n+1],r=t[n+2],e[0]>i&&(e[0]=i),e[1]>o&&(e[1]=o),e[2]>r&&(e[2]=r),e[3]<i&&(e[3]=i),e[4]<o&&(e[4]=o),e[5]<r&&(e[5]=r);return e},collapseAABB2(e=b.AABB2()){return e[0]=b.MAX_DOUBLE,e[1]=b.MAX_DOUBLE,e[2]=b.MIN_DOUBLE,e[3]=b.MIN_DOUBLE,e},point3AABB3Intersect(e,t){return e[0]>t[0]||e[3]<t[0]||e[1]>t[1]||e[4]<t[1]||e[2]>t[2]||e[5]<t[2]},point3AABB3AbsoluteIntersect(e,t){return e[0]<=t[0]&&e[3]>=t[0]&&e[1]<=t[1]&&e[4]>=t[1]&&e[2]<=t[2]&&e[5]>=t[2]},planeAABB3Intersect(e,t,i){let o,r;return e[0]>0?(o=e[0]*i[0],r=e[0]*i[3]):(o=e[0]*i[3],r=e[0]*i[0]),e[1]>0?(o+=e[1]*i[1],r+=e[1]*i[4]):(o+=e[1]*i[4],r+=e[1]*i[1]),e[2]>0?(o+=e[2]*i[2],r+=e[2]*i[5]):(o+=e[2]*i[5],r+=e[2]*i[2]),o<=-t&&r<=-t?-1:o>=-t&&r>=-t?1:0},OBB3ToAABB2(e,t=b.AABB2()){let i=b.MAX_DOUBLE,o=b.MAX_DOUBLE,r=b.MIN_DOUBLE,n=b.MIN_DOUBLE,a,s,l,c;for(let d=0,u=e.length;d<u;d+=4)a=e[d+0],s=e[d+1],l=e[d+3]||1,c=1/l,a*=c,s*=c,a<i&&(i=a),s<o&&(o=s),a>r&&(r=a),s>n&&(n=s);return t[0]=i,t[1]=o,t[2]=r,t[3]=n,t},expandAABB2(e,t){return e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[2]&&(e[2]=t[2]),e[3]<t[3]&&(e[3]=t[3]),e},expandAABB2Point2(e,t){return e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1]),e},AABB2ToCanvas(e,t,i,o=e){let r=(e[0]+1)*.5,n=(e[1]+1)*.5,a=(e[2]+1)*.5,s=(e[3]+1)*.5;return o[0]=Math.floor(r*t),o[1]=i-Math.floor(s*i),o[2]=Math.floor(a*t),o[3]=i-Math.floor(n*i),o},tangentQuadraticBezier(e,t,i,o){return 2*(1-e)*(i-t)+2*e*(o-i)},tangentQuadraticBezier3(e,t,i,o,r){return-3*t*(1-e)*(1-e)+3*i*(1-e)*(1-e)-6*e*i*(1-e)+6*e*o*(1-e)-3*e*e*o+3*e*e*r},tangentSpline(e){let t=6*e*e-6*e,i=3*e*e-4*e+1,o=-6*e*e+6*e,r=3*e*e-2*e;return t+i+o+r},catmullRomInterpolate(e,t,i,o,r){let n=(i-e)*.5,a=(o-t)*.5,s=r*r,l=r*s;return(2*t-2*i+n+a)*l+(-3*t+3*i-2*n-a)*s+n*r+t},b2p0(e,t){let i=1-e;return i*i*t},b2p1(e,t){return 2*(1-e)*e*t},b2p2(e,t){return e*e*t},b2(e,t,i,o){return this.b2p0(e,t)+this.b2p1(e,i)+this.b2p2(e,o)},b3p0(e,t){let i=1-e;return i*i*i*t},b3p1(e,t){let i=1-e;return 3*i*i*e*t},b3p2(e,t){return 3*(1-e)*e*e*t},b3p3(e,t){return e*e*e*t},b3(e,t,i,o,r){return this.b3p0(e,t)+this.b3p1(e,i)+this.b3p2(e,o)+this.b3p3(e,r)},triangleNormal(e,t,i,o=b.vec3()){let r=t[0]-e[0],n=t[1]-e[1],a=t[2]-e[2],s=i[0]-e[0],l=i[1]-e[1],c=i[2]-e[2],d=n*c-a*l,u=a*s-r*c,A=r*l-n*s,h=Math.sqrt(d*d+u*u+A*A);return h===0?(o[0]=0,o[1]=0,o[2]=0):(o[0]=d/h,o[1]=u/h,o[2]=A/h),o},rayTriangleIntersect:(()=>{let e=new jt(3),t=new jt(3),i=new jt(3),o=new jt(3),r=new jt(3);return(n,a,s,l,c,d)=>{d||=b.vec3();let u=b.subVec3(l,s,e),A=b.subVec3(c,s,t),h=b.cross3Vec3(a,A,i),p=b.dotVec3(u,h);if(p<1e-6)return null;let f=b.subVec3(n,s,o),m=b.dotVec3(f,h);if(m<0||m>p)return null;let g=b.cross3Vec3(f,u,r),y=b.dotVec3(a,g);if(y<0||m+y>p)return null;let v=b.dotVec3(A,g)/p;return d[0]=n[0]+v*a[0],d[1]=n[1]+v*a[1],d[2]=n[2]+v*a[2],d}})(),rayPlaneIntersect:(()=>{let e=new jt(3),t=new jt(3),i=new jt(3),o=new jt(3);return(r,n,a,s,l,c)=>{c||=b.vec3(),n=b.normalizeVec3(n,e);let d=b.subVec3(s,a,t),u=b.subVec3(l,a,i),A=b.cross3Vec3(d,u,o);b.normalizeVec3(A,A);let h=-b.dotVec3(a,A),p=-(b.dotVec3(r,A)+h)/b.dotVec3(n,A);return c[0]=r[0]+p*n[0],c[1]=r[1]+p*n[1],c[2]=r[2]+p*n[2],c}})(),cartesianToBarycentric:(()=>{let e=new jt(3),t=new jt(3),i=new jt(3);return(o,r,n,a,s)=>{let l=b.subVec3(a,r,e),c=b.subVec3(n,r,t),d=b.subVec3(o,r,i),u=b.dotVec3(l,l),A=b.dotVec3(l,c),h=b.dotVec3(l,d),p=b.dotVec3(c,c),f=b.dotVec3(c,d),m=u*p-A*A;if(m===0)return null;let g=1/m,y=(p*h-A*f)*g,v=(u*f-A*h)*g;return s[0]=1-y-v,s[1]=v,s[2]=y,s}})(),barycentricInsideTriangle(e){let t=e[1],i=e[2];return i>=0&&t>=0&&i+t<1},barycentricToCartesian(e,t,i,o,r=b.vec3()){let n=e[0],a=e[1],s=e[2];return r[0]=t[0]*n+i[0]*a+o[0]*s,r[1]=t[1]*n+i[1]*a+o[1]*s,r[2]=t[2]*n+i[2]*a+o[2]*s,r},mergeVertices(e,t,i,o){let r={},n=[],a=[],s=t?[]:null,l=i?[]:null,c=[],d,u,A,h,p=10**4,f,m,g=0;for(f=0,m=e.length;f<m;f+=3)d=e[f],u=e[f+1],A=e[f+2],h=`${Math.round(d*p)}_${Math.round(u*p)}_${Math.round(A*p)}`,r[h]===void 0&&(r[h]=a.length/3,a.push(d),a.push(u),a.push(A),t&&(s.push(t[f]),s.push(t[f+1]),s.push(t[f+2])),i&&(l.push(i[g]),l.push(i[g+1]))),n[f/3]=r[h],g+=2;for(f=0,m=o.length;f<m;f++)c[f]=n[o[f]];let y={positions:a,indices:c};return s&&(y.normals=s),l&&(y.uv=l),y},buildNormals:(()=>{let e=new jt(3),t=new jt(3),i=new jt(3),o=new jt(3),r=new jt(3),n=new jt(3);return(a,s,l)=>{let c,d,u=Array(a.length/3),A,h,p;for(c=0,d=s.length;c<d;c+=3){A=s[c],h=s[c+1],p=s[c+2],e[0]=a[A*3],e[1]=a[A*3+1],e[2]=a[A*3+2],t[0]=a[h*3],t[1]=a[h*3+1],t[2]=a[h*3+2],i[0]=a[p*3],i[1]=a[p*3+1],i[2]=a[p*3+2],b.subVec3(t,e,o),b.subVec3(i,e,r);let v=b.vec3();b.normalizeVec3(b.cross3Vec3(o,r,n),v),u[A]||(u[A]=[]),u[h]||(u[h]=[]),u[p]||(u[p]=[]),u[A].push(v),u[h].push(v),u[p].push(v)}l=l&&l.length===a.length?l:new Float32Array(a.length);let f,m,g,y;for(c=0,d=u.length;c<d;c++){f=u[c].length,m=0,g=0,y=0;for(let v=0;v<f;v++)m+=u[c][v][0],g+=u[c][v][1],y+=u[c][v][2];l[c*3]=m/f,l[c*3+1]=g/f,l[c*3+2]=y/f}return l}})(),buildTangents:(()=>{let e=new jt(3),t=new jt(3),i=new jt(3),o=new jt(3),r=new jt(3),n=new jt(3),a=new jt(3);return(s,l,c)=>{let d=new Float32Array(s.length);for(let u=0;u<l.length;u+=3){let A=l[u],h=s.subarray(A*3,A*3+3),p=c.subarray(A*2,A*2+2);A=l[u+1];let f=s.subarray(A*3,A*3+3),m=c.subarray(A*2,A*2+2);A=l[u+2];let g=s.subarray(A*3,A*3+3),y=c.subarray(A*2,A*2+2),v=b.subVec3(f,h,e),C=b.subVec3(g,h,t),x=b.subVec2(m,p,i),B=b.subVec2(y,p,o),E=1/(x[0]*B[1]-x[1]*B[0]),D=b.mulVec3Scalar(b.subVec3(b.mulVec3Scalar(v,B[1],r),b.mulVec3Scalar(C,x[1],n),a),E,n),P;for(let M=0;M<3;M++)P=l[u+M]*3,d[P]+=D[0],d[P+1]+=D[1],d[P+2]+=D[2]}return d}})(),buildPickTriangles(e,t,i){let o=t.length,r=i?new Uint16Array(o*9):new Float32Array(o*9),n=new Uint8Array(o*12),a=0,s,l=0,c=0,d,u,A,h,p;for(let f=0;f<o;f+=3)p=a>>24&255,h=a>>16&255,A=a>>8&255,u=a&255,d=t[f],s=d*3,r[l++]=e[s],r[l++]=e[s+1],r[l++]=e[s+2],n[c++]=u,n[c++]=A,n[c++]=h,n[c++]=p,d=t[f+1],s=d*3,r[l++]=e[s],r[l++]=e[s+1],r[l++]=e[s+2],n[c++]=u,n[c++]=A,n[c++]=h,n[c++]=p,d=t[f+2],s=d*3,r[l++]=e[s],r[l++]=e[s+1],r[l++]=e[s+2],n[c++]=u,n[c++]=A,n[c++]=h,n[c++]=p,a++;return{positions:r,colors:n}},faceToVertexNormals(e,t,i={}){let o=i.smoothNormalsAngleThreshold||20,r={},n=[],a={},s,l,c,d,u,A=10**4,h,p,f,m,g,y;for(p=0,m=e.length;p<m;p+=3){h=p/3,l=e[p],c=e[p+1],d=e[p+2],u=`${Math.round(l*A)}_${Math.round(c*A)}_${Math.round(d*A)}`,r[u]===void 0?r[u]=[h]:r[u].push(h);let v=b.normalizeVec3([t[p],t[p+1],t[p+2]]);n[h]=v,s=b.vec4([v[0],v[1],v[2],1]),a[h]=s}for(u in r)if(r.hasOwnProperty(u)){let v=r[u],C=v.length;for(p=0;p<C;p++){let x=v[p];for(s=a[x],f=0;f<C;f++){if(p===f)continue;let B=v[f];g=n[x],y=n[B],Math.abs(b.angleVec3(g,y)/b.DEGTORAD)<o&&(s[0]+=y[0],s[1]+=y[1],s[2]+=y[2],s[3]+=1)}}}for(p=0,m=t.length;p<m;p+=3)s=a[p/3],t[p+0]=s[0]/s[3],t[p+1]=s[1]/s[3],t[p+2]=s[2]/s[3]},transformRay:(()=>{let e=new jt(4),t=new jt(4);return(i,o,r,n,a)=>{e[0]=o[0],e[1]=o[1],e[2]=o[2],e[3]=1,b.transformVec4(i,e,t),n[0]=t[0],n[1]=t[1],n[2]=t[2],e[0]=r[0],e[1]=r[1],e[2]=r[2],b.transformVec3(i,e,t),b.normalizeVec3(t),a[0]=t[0],a[1]=t[1],a[2]=t[2]}})(),canvasPosToWorldRay:(()=>{let e=new jt(16),t=new jt(4),i=new jt(4),o=(r,n,a,s,l)=>{l[0]=r,l[1]=n,l[2]=a,l[3]=1,b.transformVec4(e,l,l),s||b.mulVec4Scalar(l,1/l[3])};return(r,n,a,s,l,c,d)=>{let u=s==="ortho";b.mulMat4(a,n,e),b.inverseMat4(e,e);let A=2*l[0]/r.clientWidth-1,h=1-2*l[1]/r.clientHeight;o(A,h,-1,u,t),o(A,h,1,u,i),c[0]=t[0],c[1]=t[1],c[2]=t[2],b.subVec3(i,t,d),b.normalizeVec3(d)}})(),canvasPosToLocalRay:(()=>{let e=new jt(3),t=new jt(3);return(i,o,r,n,a,s,l,c)=>{b.canvasPosToWorldRay(i,o,r,n,s,e,t),b.worldRayToLocalRay(a,e,t,l,c)}})(),worldRayToLocalRay:(()=>{let e=new jt(16),t=new jt(4),i=new jt(4);return(o,r,n,a,s)=>{let l=b.inverseMat4(o,e);t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=1,b.transformVec4(l,t,i),a[0]=i[0],a[1]=i[1],a[2]=i[2],b.transformVec3(l,n,s)}})(),buildKDTree:(()=>{let e=new Float32Array;function t(i,o,r,n){let a=new jt(6),s={triangles:null,left:null,right:null,leaf:!1,splitDim:0,aabb:a};a[0]=a[1]=a[2]=1/0,a[3]=a[4]=a[5]=-1/0;let l,c;for(l=0,c=i.length;l<c;++l){var d=i[l]*3;for(let g=0;g<3;++g){let y=o[d+g]*3;r[y]<a[0]&&(a[0]=r[y]),r[y]>a[3]&&(a[3]=r[y]),r[y+1]<a[1]&&(a[1]=r[y+1]),r[y+1]>a[4]&&(a[4]=r[y+1]),r[y+2]<a[2]&&(a[2]=r[y+2]),r[y+2]>a[5]&&(a[5]=r[y+2])}}if(i.length<20||n>10)return s.triangles=i,s.leaf=!0,s;e[0]=a[3]-a[0],e[1]=a[4]-a[1],e[2]=a[5]-a[2];let u=0;e[1]>e[u]&&(u=1),e[2]>e[u]&&(u=2),s.splitDim=u;let A=(a[u]+a[u+3])/2,h=Array(i.length),p=0,f=Array(i.length),m=0;for(l=0,c=i.length;l<c;++l){var d=i[l]*3;let y=o[d],v=o[d+1],C=o[d+2],x=y*3,B=v*3,E=C*3;r[x+u]<=A||r[B+u]<=A||r[E+u]<=A?h[p++]=i[l]:f[m++]=i[l]}return h.length=p,f.length=m,s.left=t(h,o,r,n+1),s.right=t(f,o,r,n+1),s}return(i,o)=>{let r=i.length/3,n=Array(r);for(let a=0;a<r;++a)n[a]=a;return t(n,i,o,0)}})(),decompressPosition(e,t,i){i||=e,i[0]=e[0]*t[0]+t[12],i[1]=e[1]*t[5]+t[13],i[2]=e[2]*t[10]+t[14]},decompressPositions(e,t,i=new Float32Array(e.length)){for(let o=0,r=e.length;o<r;o+=3)i[o+0]=e[o+0]*t[0]+t[12],i[o+1]=e[o+1]*t[5]+t[13],i[o+2]=e[o+2]*t[10]+t[14];return i},decompressUV(e,t,i){i[0]=e[0]*t[0]+t[6],i[1]=e[1]*t[4]+t[7]},decompressUVs(e,t,i=new Float32Array(e.length)){for(let o=0,r=e.length;o<r;o+=3)i[o+0]=e[o+0]*t[0]+t[6],i[o+1]=e[o+1]*t[4]+t[7];return i},octDecodeVec2(e,t){let i=e[0],o=e[1];i=(2*i+1)/255,o=(2*o+1)/255;let r=1-Math.abs(i)-Math.abs(o);r<0&&(i=(1-Math.abs(o))*(i>=0?1:-1),o=(1-Math.abs(i))*(o>=0?1:-1));let n=Math.sqrt(i*i+o*o+r*r);return t[0]=i/n,t[1]=o/n,t[2]=r/n,t},octDecodeVec2s(e,t){for(let i=0,o=0,r=e.length;i<r;i+=2){let n=e[i+0],a=e[i+1];n=(2*n+1)/255,a=(2*a+1)/255;let s=1-Math.abs(n)-Math.abs(a);s<0&&(n=(1-Math.abs(a))*(n>=0?1:-1),a=(1-Math.abs(n))*(a>=0?1:-1));let l=Math.sqrt(n*n+a*a+s*s);t[o+0]=n/l,t[o+1]=a/l,t[o+2]=s/l,o+=3}return t}};b.buildEdgeIndices=(function(){let e=[],t=[],i=[],o=[],r=[],n=0,a=new Uint16Array(3),s=new Uint16Array(3),l=new Uint16Array(3),c=b.vec3(),d=b.vec3(),u=b.vec3(),A=b.vec3(),h=b.vec3(),p=b.vec3(),f=b.vec3();function m(y,v){let C={},x,B,E,D,P=1e4,M,R,O=0;for(M=0,R=y.length;M<R;M+=3)x=y[M],B=y[M+1],E=y[M+2],D=Math.round(x*P)+"_"+Math.round(B*P)+"_"+Math.round(E*P),C[D]===void 0&&(C[D]=O/3,e[O++]=x,e[O++]=B,e[O++]=E),t[M/3]=C[D];for(M=0,R=v.length;M<R;M++)o[M]=t[v[M]],i[o[M]]=v[M]}function g(y,v){n=0;for(let C=0,x=y;C<x;C+=3){let B=o[C]*3,E=o[C+1]*3,D=o[C+2]*3;v?(a[0]=e[B],a[1]=e[B+1],a[2]=e[B+2],s[0]=e[E],s[1]=e[E+1],s[2]=e[E+2],l[0]=e[D],l[1]=e[D+1],l[2]=e[D+2],b.decompressPosition(a,v,c),b.decompressPosition(s,v,d),b.decompressPosition(l,v,u)):(c[0]=e[B],c[1]=e[B+1],c[2]=e[B+2],d[0]=e[E],d[1]=e[E+1],d[2]=e[E+2],u[0]=e[D],u[1]=e[D+1],u[2]=e[D+2]),b.subVec3(u,d,A),b.subVec3(c,d,h),b.cross3Vec3(A,h,p),b.normalizeVec3(p,f);let P=r[n]||(r[n]={normal:b.vec3()});P.normal[0]=f[0],P.normal[1]=f[1],P.normal[2]=f[2],n++}}return function(y,v,C,x){m(y,v),g(v.length,C);let B=[],E=Math.cos(b.DEGTORAD*x),D={},P,M,R,O,V,z=!1,K,Z,te,ie,se,Be;for(let qe=0,ze=v.length;qe<ze;qe+=3){let st=qe/3;for(let Pe=0;Pe<3;Pe++)P=o[qe+Pe],M=o[qe+(Pe+1)%3],R=Math.min(P,M),O=Math.max(P,M),V=R+","+O,D[V]===void 0?D[V]={index1:R,index2:O,face1:st,face2:void 0}:D[V].face2=st}for(V in D)K=D[V],!(K.face2!==void 0&&(Z=r[K.face1].normal,te=r[K.face2].normal,ie=b.dotVec3(Z,te),ie>E))&&(se=i[K.index1],Be=i[K.index2],(!z&&se>65535||Be>65535)&&(z=!0),B.push(se),B.push(Be));return z?new Uint32Array(B):new Uint16Array(B)}})(),b.planeClipsPositions3=function(e,t,i,o=3){for(let r=0,n=i.length;r<n;r+=o)if(p1[0]=i[r+0]-e[0],p1[1]=i[r+1]-e[1],p1[2]=i[r+2]-e[2],p1[0]*t[0]+p1[1]*t[1]+p1[2]*t[2]<0)return!0;return!1};var oit=15,oh=new Float32Array(3),nit=class{constructor(e){if(!e)throw"Parameter expected: cfg";if(!e.viewer)throw"Parameter expected: cfg.viewer";this.viewer=e.viewer,this._maxTreeDepth=e.maxTreeDepth||oit,this._root=null,this._needsRebuild=!0,this._onModelLoaded=this.viewer.scene.on("modelLoaded",t=>{this._needsRebuild=!0}),this._onModelUnloaded=this.viewer.scene.on("modelUnloaded",t=>{this._needsRebuild=!0})}get root(){return this._needsRebuild&&this._rebuild(),this._root}_rebuild(){let e=this.viewer.scene;this._root={aabb:e.getAABB()};for(let t in e.objects){let i=e.objects[t];this._insertEntity(this._root,i,1)}this._needsRebuild=!1}_insertEntity(e,t,i){let o=t.aabb;if(i>=this._maxTreeDepth){e.entities=e.entities||[],e.entities.push(t);return}if(e.left&&b.containsAABB3(e.left.aabb,o)){this._insertEntity(e.left,t,i+1);return}if(e.right&&b.containsAABB3(e.right.aabb,o)){this._insertEntity(e.right,t,i+1);return}let r=e.aabb;oh[0]=r[3]-r[0],oh[1]=r[4]-r[1],oh[2]=r[5]-r[2];let n=0;if(oh[1]>oh[n]&&(n=1),oh[2]>oh[n]&&(n=2),!e.left){let a=r.slice();if(a[n+3]=(r[n]+r[n+3])/2,e.left={aabb:a},b.containsAABB3(a,o)){this._insertEntity(e.left,t,i+1);return}}if(!e.right){let a=r.slice();if(a[n]=(r[n]+r[n+3])/2,e.right={aabb:a},b.containsAABB3(a,o)){this._insertEntity(e.right,t,i+1);return}}e.entities=e.entities||[],e.entities.push(t)}destroy(){let e=this.viewer.scene;e.off(this._onModelLoaded),e.off(this._onModelUnloaded),this._root=null,this._needsRebuild=!0}},Oj=class{constructor(){this._head=[],this._headLength=0,this._tail=[],this._index=0,this._length=0}get length(){return this._length}shift(){if(this._index>=this._headLength){let t=this._head;if(t.length=0,this._head=this._tail,this._tail=t,this._index=0,this._headLength=this._head.length,!this._headLength)return}let e=this._head[this._index];return this._index<0?delete this._head[this._index++]:this._head[this._index++]=void 0,this._length--,e}push(e){return this._length++,this._tail.push(e),this}unshift(e){return this._head[--this._index]=e,this._length++,this}},lr={build:{version:"0.8"},client:{browser:navigator&&navigator.userAgent?navigator.userAgent:"n/a"},components:{scenes:0,models:0,meshes:0,objects:0},memory:{meshes:0,positions:0,colors:0,normals:0,uvs:0,indices:0,textures:0,transforms:0,materials:0,programs:0},frame:{frameCount:0,fps:0,useProgram:0,bindTexture:0,bindArray:0,drawElements:0,drawArrays:0,tasksRun:0,tasksScheduled:0}};function Nj(e,t){if(e.nodeType===e.TEXT_NODE){var i=e.nodeValue;if(i.match(/^\s+$/)===null)return i}else if(e.nodeType===e.ELEMENT_NODE||e.nodeType===e.DOCUMENT_NODE){var o={type:e.nodeName,children:[]};if(e.nodeType===e.ELEMENT_NODE)for(var r=0;r<e.attributes.length;r++){var n=e.attributes[r],a=t[n.nodeName]||n.nodeName;o[a]=n.nodeValue}for(var s=0;s<e.childNodes.length;s++){var l=e.childNodes[s],r=Nj(l,t);r&&o.children.push(r)}return o}}function ait(e){return JSON.parse(JSON.stringify(e))}var sit=[["0",10],["A",26],["a",26],["_",1],["$",1]].map(function(e){for(var t=[],i=e[0].charCodeAt(0),o=i+e[1],r=i;r<o;++r)t.push(r);return String.fromCharCode.apply(null,t)}).join("");function Hj(e,t){return(!t||t===4?[0,6,12,18]:[0,6]).map(function(i){return sit.substr(parseInt(e/(1<<i))%64,1)}).reverse().join("")}function lit(e){var t=[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30].map(function(i){return parseInt(e.substr(i,2),16)});return Hj(t[0],2)+[1,4,7,10,13].map(function(i){return Hj((t[i]<<16)+(t[i+1]<<8)+t[i+2])}).join("")}function cit(e,t){var i=[],o=function(r){r.type===t&&i.push(r),(r.children||[]).forEach(function(n){o(n)})};return o(e),i}function dit(e){return new Promise(function(t,i){setTimeout(t,e)})}function uit(e){return new Promise(function(t,i){var o=new XMLHttpRequest;o.open(e.method||"GET",e.url,!0),o.onload=function(r){o.readyState===4&&(o.status===200?t(o.responseXML):i(o.statusText))},o.send(null)})}var Ait=(function(){for(var e={},t=window.location.search.substring(1).split("&"),i=0;i<t.length;i++){var o=t[i].split("=");if(e[o[0]]===void 0)e[o[0]]=decodeURIComponent(o[1]);else if(typeof e[o[0]]=="string"){var r=[e[o[0]],decodeURIComponent(o[1])];e[o[0]]=r}else e[o[0]].push(decodeURIComponent(o[1]))}return e})();function hit(e,t,i){var o=n=>{};t||=o,i||=o;var r=new XMLHttpRequest;r.overrideMimeType("application/json"),r.open("GET",e,!0),r.addEventListener("load",function(n){var a=n.target.response;if(this.status===200){var s;try{s=JSON.parse(a)}catch(l){i(`utils.loadJSON(): Failed to parse JSON response - ${l}`)}t(s)}else if(this.status===0){console.warn("loadFile: HTTP Status 0 received.");try{t(JSON.parse(a))}catch(l){i(`utils.loadJSON(): Failed to parse JSON response - ${l}`)}}else i(n)},!1),r.addEventListener("error",function(n){i(n)},!1),r.send(null)}function pit(e,t,i){var o=s=>{};t||=o,i||=o;let r=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(r){let s=!!r[2];var n=r[3];n=window.decodeURIComponent(n),s&&(n=window.atob(n));try{let l=new ArrayBuffer(n.length),c=new Uint8Array(l);for(var a=0;a<n.length;a++)c[a]=n.charCodeAt(a);jr.scheduleTask(()=>{t(l)})}catch(l){jr.scheduleTask(()=>{i(l)})}}else{let s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="arraybuffer",s.onreadystatechange=function(){s.readyState===4&&(s.status===200?t(s.response):i("loadArrayBuffer error : "+s.response))},s.send(null)}}function fit(e){return e&&!e.propertyIsEnumerable("length")&&typeof e=="object"&&typeof e.length=="number"}function git(e){return typeof e=="string"||e instanceof String}function mit(e){return!isNaN(parseFloat(e))&&isFinite(e)}function vit(e){return St.isString(e)||St.isNumeric(e)}function yit(e,t){return!e||!t?!1:(St.isNumeric(e)||St.isString(e)?`${e}`:e.id)===(St.isNumeric(t)||St.isString(t)?`${t}`:t.id)}function wit(e){return typeof e=="function"}function bit(e){let t={}.constructor;return!!e&&e.constructor===t}function Cit(e){return St.apply(e,{})}function xit(e,t){for(let i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function Bit(e,t){for(let i in e)e.hasOwnProperty(i)&&e[i]!==void 0&&e[i]!==null&&(t[i]=e[i]);return t}function kit(e,t){for(let i in e)e.hasOwnProperty(i)&&(t[i]===void 0||t[i]===null)&&(t[i]=e[i]);return t}function Eit(e){for(let t in e)if(e.hasOwnProperty(t))return!1;return!0}function Mit(e){return St.isNumeric(e)?`${e}`:`'${e}'`}function Pit(e,t){let i=new e.constructor(e.length+t.length);return i.set(e),i.set(t,e.length),i}function Iit(e){var t=[];function i(o){o.id=o.uuid,delete o.oid,t.push(o);var r=o.children;if(r)for(var n=0,a=r.length;n<a;n++){let s=r[n];s.parent=o.id,i(r[n])}o.children=[]}return i(e),t}var St={xmlToJson:Nj,clone:ait,compressGuid:lit,findNodeOfType:cit,timeout:dit,httpRequest:uit,loadJSON:hit,loadArraybuffer:pit,queryString:Ait,isArray:fit,isString:git,isNumeric:mit,isID:vit,isSameComponent:yit,isFunction:wit,isObject:bit,copy:Cit,apply:xit,apply2:Bit,applyIf:kit,isEmptyObject:Eit,inQuotes:Mit,concat:Pit,flattenParentChildHierarchy:Iit},K5={},Vj=new Ss,f1=new Oj,nd={sceneId:null,time:null,startTime:null,prevTime:null,deltaTime:null},jj=10,xu=[],Qj=30,Fg=0,g1,m1=0;function Sit(){this.version="1.0.0",this.scenes={},this._superTypes={},this._addScene=function(e){if(e.id){if(jr.scenes[e.id]){console.error(`[ERROR] Scene ${St.inQuotes(e.id)} already exists`);return}}else e.id=Vj.addItem({});jr.scenes[e.id]=e;let t=e.ticksPerOcclusionTest,i=e.ticksPerRender;K5[e.id]={ticksPerOcclusionTest:t,ticksPerRender:i,renderCountdown:i},lr.components.scenes++,e.once("destroyed",()=>{Vj.removeItem(e.id),delete jr.scenes[e.id],delete K5[e.id],lr.components.scenes--})},this.clear=function(){let e;for(let t in jr.scenes)jr.scenes.hasOwnProperty(t)&&(e=jr.scenes[t],t==="default.scene"?e.clear():(e.destroy(),delete jr.scenes[e.id]))},this.scheduleTask=function(e,t=null){f1.push(e),f1.push(t)},this.runTasks=function(e=-1){let t=new Date().getTime(),i,o,r=0;for(;f1.length>0&&(e<0||t<e);)i=f1.shift(),o=f1.shift(),o?i.call(o):i(),t=new Date().getTime(),r++;return r},this.getNumTasks=function(){return f1.length}}var jr=new Sit,zj=function(){let e=Date.now();if(g1=e-Fg,Fg>0&&g1>0){var t=1e3/g1;m1+=t,xu.push(t),xu.length>=Qj&&(m1-=xu.shift()),lr.frame.fps=Math.round(m1/xu.length)}for(let i in jr.scenes)jr.scenes[i].compile();Gj(e),Fg=e};function Dit(e,t){let i=Date.now()+t;function o(){let r=Date.now()-i;e(),i+=t,setTimeout(o,Math.max(0,t-r))}return o(),{cancel:function(){}}}Dit(()=>{zj()},100);var qj=function(){let e=Date.now();if(g1=e-Fg,Fg>0&&g1>0){var t=1e3/g1;m1+=t,xu.push(t),xu.length>=Qj&&(m1-=xu.shift()),lr.frame.fps=Math.round(m1/xu.length)}Gj(e),Tit(e),Lit(),window.requestPostAnimationFrame===void 0?requestAnimationFrame(qj):window.requestPostAnimationFrame(zj)};qj();function Gj(e){let t=jr.runTasks(e+jj),i=jr.getNumTasks();lr.frame.tasksRun=t,lr.frame.tasksScheduled=i,lr.frame.tasksBudget=jj}function Tit(e){for(var t in nd.time=e,jr.scenes)if(jr.scenes.hasOwnProperty(t)){var i=jr.scenes[t];nd.sceneId=t,nd.startTime=i.startTime,nd.deltaTime=nd.prevTime==null?0:nd.time-nd.prevTime,i.fire("tick",nd,!0)}nd.prevTime=e}function Lit(){let e=jr.scenes,t,i,o,r,n;for(n in e)e.hasOwnProperty(n)&&(t=e[n],i=K5[n],i||=K5[n]={},o=t.ticksPerOcclusionTest,i.ticksPerOcclusionTest!==o&&(i.ticksPerOcclusionTest=o,i.renderCountdown=o),--t.occlusionTestCountdown<=0&&(t.doOcclusionTest(),t.occlusionTestCountdown=o),r=t.ticksPerRender,i.ticksPerRender!==r&&(i.ticksPerRender=r,i.renderCountdown=r),--i.renderCountdown===0&&(t.render(!1),i.renderCountdown=r))}var Ri=class _ne{get type(){return"Component"}get isComponent(){return!0}constructor(t=null,i={}){if(this.scene=null,this.type==="Scene")this.scene=this,this.viewer=i.viewer;else{if(t.type==="Scene")this.scene=t;else if(t instanceof _ne)this.scene=t.scene;else throw"Invalid param: owner must be a Component";this._owner=t}this._dontClear=!!i.dontClear,this._renderer=this.scene._renderer,this.meta=i.meta||{},this.id=i.id,this.destroyed=!1,this._attached={},this._attachments=null,this._subIdMap=null,this._subIdEvents=null,this._eventSubs=null,this._eventSubsNum=null,this._events=null,this._eventCallDepth=0,this._ownedComponents=null,this!==this.scene&&this.scene._addComponent(this),this._updateScheduled=!1,t&&t._own(this)}glRedraw(){this._renderer&&(this._renderer.imageDirty(),this.castsShadow&&this._renderer.shadowsDirty())}glResort(){this._renderer&&this._renderer.needStateSort()}get owner(){return this._owner}isType(t){return this.type===t}fire(t,i,o){this._events||={},this._eventSubs||(this._eventSubs={},this._eventSubsNum={}),o!==!0&&(this._events[t]=i||!0);let r=this._eventSubs[t],n;if(r)for(let a in r)r.hasOwnProperty(a)&&(n=r[a],this._eventCallDepth++,this._eventCallDepth<300?n.callback.call(n.scope,i):this.error("fire: potential stack overflow from recursive event '"+t+"' - dropping this event"),this._eventCallDepth--)}on(t,i,o){this._events||={},this._subIdMap||=new Ss,this._subIdEvents||={},this._eventSubs||={},this._eventSubsNum||={};let r=this._eventSubs[t];r?this._eventSubsNum[t]++:(r={},this._eventSubs[t]=r,this._eventSubsNum[t]=1);let n=this._subIdMap.addItem();r[n]={callback:i,scope:o||this},this._subIdEvents[n]=t;let a=this._events[t];return a!==void 0&&i.call(o||this,a),n}off(t){if(t==null||!this._subIdEvents)return;let i=this._subIdEvents[t];if(i){delete this._subIdEvents[t];let o=this._eventSubs[i];o&&(delete o[t],this._eventSubsNum[i]--),this._subIdMap.removeItem(t)}}once(t,i,o){let r=this,n=this.on(t,function(a){r.off(n),i.call(o||this,a)},o)}hasSubs(t){return this._eventSubsNum&&this._eventSubsNum[t]>0}log(t){t="[LOG]"+this._message(t),window.console.log(t),this.scene.fire("log",t)}_message(t){return" ["+this.type+" "+St.inQuotes(this.id)+"]: "+t}warn(t){t="[WARN]"+this._message(t),window.console.warn(t),this.scene.fire("warn",t)}error(t){t="[ERROR]"+this._message(t),window.console.error(t),this.scene.fire("error",t)}_attach(t){let i=t.name;if(!i){this.error("Component 'name' expected");return}let o=t.component,r=t.sceneDefault,n=t.sceneSingleton,a=t.type,s=t.on,l=t.recompiles!==!1;if(o&&(St.isNumeric(o)||St.isString(o))){let h=o;if(o=this.scene.components[h],!o){this.error("Component not found: "+St.inQuotes(h));return}}if(!o){if(n===!0){let h=this.scene.types[a];for(let p in h)if(h.hasOwnProperty){o=h[p];break}if(!o)return this.error("Scene has no default component for '"+i+"'"),null}else if(r===!0&&(o=this.scene[i],!o))return this.error("Scene has no default component for '"+i+"'"),null}if(o){if(o.scene.id!==this.scene.id){this.error("Not in same scene: "+o.type+" "+St.inQuotes(o.id));return}if(a&&!o.isType(a)){this.error("Expected a "+a+" type or subtype: "+o.type+" "+St.inQuotes(o.id));return}}this._attachments||={};let c=this._attached[i],d,u,A;if(c){if(o&&c.id===o.id)return;let h=this._attachments[c.id];for(d=h.subs,u=0,A=d.length;u<A;u++)c.off(d[u]);delete this._attached[i],delete this._attachments[c.id];let p=h.params.onDetached;p&&(St.isFunction(p)?p(c):p.scope?p.callback.call(p.scope,c):p.callback(c)),h.managingLifecycle&&c.destroy()}if(o){let h={params:t,component:o,subs:[],managingLifecycle:!1};h.subs.push(o.once("destroyed",function(){h.params.component=null,this._attach(h.params)},this)),l&&h.subs.push(o.on("dirty",function(){this.fire("dirty",this)},this)),this._attached[i]=o,this._attachments[o.id]=h;let p=t.onAttached;if(p&&(St.isFunction(p)?p(o):p.scope?p.callback.call(p.scope,o):p.callback(o)),s){let f,m,g,y;for(f in s)if(s.hasOwnProperty(f)){if(m=s[f],St.isFunction(m)?(g=m,y=null):(g=m.callback,y=m.scope),!g)continue;h.subs.push(o.on(f,g,y))}}}return l&&this.fire("dirty",this),this.fire(i,o),o}_checkComponent(t,i){if(!i.isComponent)if(St.isID(i)){let o=i;if(i=this.scene.components[o],!i){this.error("Component not found: "+o);return}}else{this.error("Expected a Component or ID");return}if(t!==i.type){this.error("Expected a "+t+" Component");return}if(i.scene.id!==this.scene.id){this.error("Not in same scene: "+i.type);return}return i}_checkComponent2(t,i){if(!i.isComponent)if(St.isID(i)){let n=i;if(i=this.scene.components[n],!i){this.error("Component not found: "+n);return}}else{this.error("Expected a Component or ID");return}if(i.scene.id!==this.scene.id){this.error("Not in same scene: "+i.type);return}for(var o=0,r=t.length;o<r;o++)if(t[o]===i.type)return i;return this.error("Expected component types: "+t),null}_own(t){this._ownedComponents||={},this._ownedComponents[t.id]||(this._ownedComponents[t.id]=t),t.once("destroyed",()=>{delete this._ownedComponents[t.id]},this)}_needUpdate(t){this._updateScheduled||(this._updateScheduled=!0,t===0?this._doUpdate():jr.scheduleTask(this._doUpdate,this))}_doUpdate(){this._updateScheduled&&(this._updateScheduled=!1,this._update&&this._update())}scheduleTask(t){jr.scheduleTask(t,null)}_update(){}clear(){if(this._ownedComponents)for(var t in this._ownedComponents)this._ownedComponents.hasOwnProperty(t)&&(this._ownedComponents[t].destroy(),delete this._ownedComponents[t])}destroy(){if(this.destroyed)return;this.fire("destroyed",this.destroyed=!0);let t,i,o,r,n,a;if(this._attachments){for(t in this._attachments)if(this._attachments.hasOwnProperty(t)){for(i=this._attachments[t],o=i.component,r=i.subs,n=0,a=r.length;n<a;n++)o.off(r[n]);i.managingLifecycle&&o.destroy()}}if(this._ownedComponents)for(t in this._ownedComponents)this._ownedComponents.hasOwnProperty(t)&&(o=this._ownedComponents[t],o.destroy(),delete this._ownedComponents[t]);this.scene._removeComponent(this),this._attached={},this._attachments=null,this._subIdMap=null,this._subIdEvents=null,this._eventSubs=null,this._events=null,this._eventCallDepth=0,this._ownedComponents=null,this._updateScheduled=!1}},Rit=b.vec3(),_it=b.vec3(),Fit=b.mat4(),nh=class{constructor(){this.normal=b.vec3(),this.offset=0,this.testVertex=b.vec3()}set(e,t,i,o){let r=1/Math.sqrt(e*e+t*t+i*i);this.normal[0]=e*r,this.normal[1]=t*r,this.normal[2]=i*r,this.offset=o*r,this.testVertex[0]=this.normal[0]>=0?1:0,this.testVertex[1]=this.normal[1]>=0?1:0,this.testVertex[2]=this.normal[2]>=0?1:0}},ts=class{constructor(){this.planes=[new nh,new nh,new nh,new nh,new nh,new nh]}};ts.INSIDE=0,ts.INTERSECT=1,ts.OUTSIDE=2;function Kj(e,t,i){let o=b.mulMat4(i,t,Fit),r=o[0],n=o[1],a=o[2],s=o[3],l=o[4],c=o[5],d=o[6],u=o[7],A=o[8],h=o[9],p=o[10],f=o[11],m=o[12],g=o[13],y=o[14],v=o[15];e.planes[0].set(s-r,u-l,f-A,v-m),e.planes[1].set(s+r,u+l,f+A,v+m),e.planes[2].set(s-n,u-c,f-h,v-g),e.planes[3].set(s+n,u+c,f+h,v+g),e.planes[4].set(s-a,u-d,f-p,v-y),e.planes[5].set(s+a,u+d,f+p,v+y)}function J5(e,t){let i=ts.INSIDE,o=Rit,r=_it;o[0]=t[0],o[1]=t[1],o[2]=t[2],r[0]=t[3],r[1]=t[4],r[2]=t[5];let n=[o,r];for(let a=0;a<6;++a){let s=e.planes[a];if(s.normal[0]*n[s.testVertex[0]][0]+s.normal[1]*n[s.testVertex[1]][1]+s.normal[2]*n[s.testVertex[2]][2]+s.offset<0)return ts.OUTSIDE;s.normal[0]*n[1-s.testVertex[0]][0]+s.normal[1]*n[1-s.testVertex[1]][1]+s.normal[2]*n[1-s.testVertex[2]][2]+s.offset<0&&(i=ts.INTERSECT)}return i}var Ug=class $m extends Ri{constructor(t={}){if(!t.viewer)throw"[MarqueePicker] Missing config: viewer";if(!t.objectsKdTree3)throw"[MarqueePicker] Missing config: objectsKdTree3";super(t.viewer.scene,t),this.viewer=t.viewer,this._objectsKdTree3=t.objectsKdTree3,this._canvasMarqueeCorner1=b.vec2(),this._canvasMarqueeCorner2=b.vec2(),this._canvasMarquee=b.AABB2(),this._marqueeFrustum=new ts,this._marqueeFrustumProjMat=b.mat4(),this._pickMode=!1,this._marqueeElement=document.createElement("div"),document.body.appendChild(this._marqueeElement),this._marqueeElement.style.position="absolute",this._marqueeElement.style["z-index"]="40000005",this._marqueeElement.style.width="8px",this._marqueeElement.style.height="8px",this._marqueeElement.style.visibility="hidden",this._marqueeElement.style.top="0px",this._marqueeElement.style.left="0px",this._marqueeElement.style["box-shadow"]="0 2px 5px 0 #182A3D;",this._marqueeElement.style.opacity=1,this._marqueeElement.style["pointer-events"]="none"}setMarqueeCorner1(t){this._canvasMarqueeCorner1.set(t),this._canvasMarqueeCorner2.set(t),this._updateMarquee()}setMarqueeCorner2(t){this._canvasMarqueeCorner2.set(t),this._updateMarquee()}setMarquee(t,i){this._canvasMarqueeCorner1.set(t),this._canvasMarqueeCorner2.set(i),this._updateMarquee()}setMarqueeVisible(t){this._marqueVisible=t,this._marqueeElement.style.visibility=t?"visible":"hidden"}getMarqueeVisible(){return this._marqueVisible}setPickMode(t){if(t!==$m.PICK_MODE_INSIDE&&t!==$m.PICK_MODE_INTERSECTS)throw"Illegal MarqueePicker pickMode: must be MarqueePicker.PICK_MODE_INSIDE or MarqueePicker.PICK_MODE_INTERSECTS";t!==this._pickMode&&(this._marqueeElement.style["background-image"]=t===$m.PICK_MODE_INSIDE?`url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='6' ry='6' stroke='%23333' stroke-width='4'/%3e%3c/svg%3e")`:`url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='6' ry='6' stroke='%23333' stroke-width='4' stroke-dasharray='6%2c 14' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e")`,this._pickMode=t)}getPickMode(){return this._pickMode}clear(){this.fire("clear",{})}pick(){this._updateMarquee(),this._buildMarqueeFrustum();let t=[],i=(o,r=ts.INTERSECT)=>{if(r===ts.INTERSECT&&(r=J5(this._marqueeFrustum,o.aabb)),r!==ts.OUTSIDE){if(o.entities){let n=o.entities;for(let a=0,s=n.length;a<s;a++){let l=n[a];if(!l.visible)continue;let c=l.aabb;this._pickMode===$m.PICK_MODE_INSIDE?J5(this._marqueeFrustum,c)===ts.INSIDE&&t.push(l.id):J5(this._marqueeFrustum,c)!==ts.OUTSIDE&&t.push(l.id)}}o.left&&i(o.left,r),o.right&&i(o.right,r)}};return(this._canvasMarquee[2]-this._canvasMarquee[0]>3||this._canvasMarquee[3]-this._canvasMarquee[1]>3)&&i(this._objectsKdTree3.root),this.fire("picked",t),t}_updateMarquee(){this._canvasMarquee[0]=Math.min(this._canvasMarqueeCorner1[0],this._canvasMarqueeCorner2[0]),this._canvasMarquee[1]=Math.min(this._canvasMarqueeCorner1[1],this._canvasMarqueeCorner2[1]),this._canvasMarquee[2]=Math.max(this._canvasMarqueeCorner1[0],this._canvasMarqueeCorner2[0]),this._canvasMarquee[3]=Math.max(this._canvasMarqueeCorner1[1],this._canvasMarqueeCorner2[1]),this._marqueeElement.style.width=`${this._canvasMarquee[2]-this._canvasMarquee[0]}px`,this._marqueeElement.style.height=`${this._canvasMarquee[3]-this._canvasMarquee[1]}px`,this._marqueeElement.style.left=`${this._canvasMarquee[0]}px`,this._marqueeElement.style.top=`${this._canvasMarquee[1]}px`}_buildMarqueeFrustum(){let t=this.viewer.scene.canvas.canvas,i=t.clientWidth,o=t.clientHeight,r=t.clientLeft,n=t.clientTop,a=2/i,s=2/o,l=t.clientHeight/t.clientWidth,c=(this._canvasMarquee[0]-r)*a+-1,d=(this._canvasMarquee[2]-r)*a+-1,u=-(this._canvasMarquee[3]-n)*s+1,A=-(this._canvasMarquee[1]-n)*s+1,h=this.viewer.scene.camera.frustum.near*(17*l);b.frustumMat4(c,d,u*l,A*l,h,1e4,this._marqueeFrustumProjMat),Kj(this._marqueeFrustum,this.viewer.scene.camera.viewMatrix,this._marqueeFrustumProjMat)}destroy(){super.destroy(),this._marqueeElement.parentElement&&(this._marqueeElement.parentElement.removeChild(this._marqueeElement),this._marqueeElement=null,this._objectsKdTree3=null)}};Ug.PICK_MODE_INTERSECTS=0,Ug.PICK_MODE_INSIDE=1;var Uit=class extends Ri{constructor(e){super(e.marqueePicker,e);let t=e.marqueePicker,i=t.viewer.scene.canvas.canvas,o,r,n,a,s,l,c=!1,d=!1,u=!1,A;i.addEventListener("mousedown",h=>{this.getActive()&&h.button===0&&(A=setTimeout(function(){let p=t.viewer.scene.input;p.keyDown[p.KEY_CTRL]||t.clear(),o=h.pageX,r=h.pageY,s=h.offsetX,h.offsetY,t.setMarqueeCorner1([o,r]),c=!0,t.viewer.cameraControl.pointerEnabled=!1,t.setMarqueeVisible(!0),i.style.cursor="crosshair"},400),d=!0)}),i.addEventListener("mouseup",h=>{if(!this.getActive()||!c&&!u||h.button!==0)return;clearTimeout(A),n=h.pageX,a=h.pageY;let p=Math.abs(n-o),f=Math.abs(a-r);c=!1,t.viewer.cameraControl.pointerEnabled=!0,u&&=!1,(p>3||f>3)&&t.pick()}),document.addEventListener("mouseup",h=>{this.getActive()&&h.button===0&&(clearTimeout(A),c&&(t.setMarqueeVisible(!1),c=!1,d=!1,u=!0,t.viewer.cameraControl.pointerEnabled=!0))},!0),i.addEventListener("mousemove",h=>{this.getActive()&&h.button===0&&d&&(clearTimeout(A),c&&(n=h.pageX,a=h.pageY,l=h.offsetX,h.offsetY,t.setMarqueeVisible(!0),t.setMarqueeCorner2([n,a]),t.setPickMode(s<l?Ug.PICK_MODE_INSIDE:Ug.PICK_MODE_INTERSECTS)))})}setActive(e){this._active!==e&&(this._active=e,this.fire("active",this._active))}getActive(){return this._active}destroy(){}},NB=class{constructor(e,t={}){this.viewer=e,this.scene=this.viewer.scene,this._circleDiv=document.createElement("div"),this.viewer.scene.canvas.canvas.parentNode.insertBefore(this._circleDiv,this.viewer.scene.canvas.canvas),this._circleDiv.style.backgroundColor="transparent",this._circleDiv.style.border="2px solid green",this._circleDiv.style.borderRadius="50px",this._circleDiv.style.width="50px",this._circleDiv.style.height="50px",this._circleDiv.style.margin="-200px -200px",this._circleDiv.style.zIndex="100000",this._circleDiv.style.position="absolute",this._circleDiv.style.pointerEvents="none",this._circlePos=null,this._circleMaxRadius=200,this._circleMinRadius=2,this._active=t.active!==!1,this._visible=!1,this._running=!1,this._destroyed=!1}start(e){if(this._destroyed)return;this._circlePos=e,this._running=!1,this._circleRadius=this._circleMaxRadius,this._circleDiv.style.borderRadius=`${this._circleRadius}px`,this._circleDiv.style.marginLeft=`${this._circlePos[0]-this._circleRadius}px`,this._circleDiv.style.marginTop=`${this._circlePos[1]-this._circleRadius}px`;let t=this._circleMaxRadius,i,o=r=>{if(!this._running)return;i||=r;let n=r-i,a=Math.min(n/300,1);this._circleRadius=t+(2-t)*a,this._circleDiv.style.width=`${this._circleRadius}px`,this._circleDiv.style.height=`${this._circleRadius}px`,this._circleDiv.style.marginLeft=`${this._circlePos[0]-this._circleRadius/2}px`,this._circleDiv.style.marginTop=`${this._circlePos[1]-this._circleRadius/2}px`,a<1&&requestAnimationFrame(o)};this._running=!0,requestAnimationFrame(o),this._circleDiv.style.visibility="visible"}stop(){this._destroyed||(this._running=!1,this._circleRadius=this._circleMaxRadius,this._circleDiv.style.borderRadius=`${this._circleRadius}px`,this._circleDiv.style.visibility="hidden")}set durationMs(e){this.stop(),this._durationMs=e}get durationMs(){return this._durationMs}destroy(){this._destroyed||=(this.stop(),this._circleDiv.parentElement.removeChild(this._circleDiv),!0)}},Jj=class{constructor(e={}){this._eventSubIDMap=null,this._eventSubEvents=null,this._eventSubs=null,this._events=null,this._locale="en",this._messages={},this._locales=[],this._locale="en",this.messages=e.messages,this.locale=e.locale}set messages(e){this._messages=e||{},this._locales=Object.keys(this._messages),this.fire("updated",this)}loadMessages(e={}){for(let t in e)this._messages[t]=e[t];this.messages=this._messages}clearMessages(){this.messages={}}get locales(){return this._locales}set locale(e){e||="de",this._locale!==e&&(this._locale=e,this.fire("updated",e))}get locale(){return this._locale}translate(e,t){let i=this._messages[this._locale];if(!i)return null;let o=Zj(e,i);return o?t?HB(o,t):o:null}translatePlurals(e,t,i){let o=this._messages[this._locale];if(!o)return null;let r=Zj(e,o);return t=parseInt(""+t,10),r=t===0?r.zero:t>1?r.other:r.one,r?(r=HB(r,[t]),i&&(r=HB(r,i)),r):null}fire(e,t,i){this._events||={},this._eventSubs||={},i!==!0&&(this._events[e]=t||!0);let o=this._eventSubs[e];if(o)for(let r in o)o.hasOwnProperty(r)&&o[r].callback(t)}on(e,t){this._events||={},this._eventSubIDMap||=new Ss,this._eventSubEvents||={},this._eventSubs||={};let i=this._eventSubs[e];i||(i={},this._eventSubs[e]=i);let o=this._eventSubIDMap.addItem();i[o]={callback:t},this._eventSubEvents[o]=e;let r=this._events[e];return r!==void 0&&t(r),o}off(e){if(e==null||!this._eventSubEvents)return;let t=this._eventSubEvents[e];if(t){delete this._eventSubEvents[e];let i=this._eventSubs[t];i&&delete i[e],this._eventSubIDMap.removeItem(e)}}};function Zj(e,t){if(t[e])return t[e];let i=e.split("."),o=t;for(let r=0,n=i.length;o&&r<n;r++){let a=i[r];o=o[a]}return o}function HB(e,t=[]){return e.replace(/\{\{|\}\}|\{(\d+)\}/g,function(i,o){return i==="{{"?"{":i==="}}"?"}":t[o]})}var Og=class extends Ri{constructor(e,t={}){super(e,t),this.t=t.t}set t(e){e||=0,this._t=e<0?0:e>1?1:e}get t(){return this._t}get tangent(){return this.getTangent(this._t)}get length(){var e=this._getLengths();return e[e.length-1]}getTangent(e){var t=1e-4;e===void 0&&(e=this._t);var i=e-t,o=e+t;i<0&&(i=0),o>1&&(o=1);var r=this.getPoint(i),n=this.getPoint(o),a=b.subVec3(n,r,[]);return b.normalizeVec3(a,[])}getPointAt(e){var t=this.getUToTMapping(e);return this.getPoint(t)}getPoints(e){e||=5;var t,i=[];for(t=0;t<=e;t++)i.push(this.getPoint(t/e));return i}_getLengths(e){if(e||=this.__arcLengthDivisions?this.__arcLengthDivisions:200,this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t=[],i,o=this.getPoint(0),r,n=0;for(t.push(0),r=1;r<=e;r++)i=this.getPoint(r/e),n+=b.lenVec3(b.subVec3(i,o,[])),t.push(n),o=i;return this.cacheArcLengths=t,t}_updateArcLengths(){this.needsUpdate=!0,this._getLengths()}getUToTMapping(e,t){for(var i=this._getLengths(),o=0,r=i.length,n,a=t||e*i[r-1],s=0,l=r-1,c;s<=l;)if(o=Math.floor(s+(l-s)/2),c=i[o]-a,c<0)s=o+1;else if(c>0)l=o-1;else{l=o;break}if(o=l,i[o]===a)return n=o/(r-1),n;var d=i[o],u=i[o+1]-d,A=(a-d)/u;return n=(o+A)/(r-1),n}},Z5=class extends Og{constructor(e,t={}){super(e,t),this.points=t.points,this.t=t.t}set points(e){this._points=e||[]}get points(){return this._points}set t(e){e||=0,this._t=e<0?0:e>1?1:e}get t(){return this._t}get point(){return this.getPoint(this._t)}getPoint(e){var t=this.points;if(t.length<3){this.error("Can't sample point from SplineCurve - not enough points on curve - returning [0,0,0].");return}var i=(t.length-1)*e,o=Math.floor(i),r=i-o,n=t[o===0?o:o-1],a=t[o],s=t[o>t.length-2?t.length-1:o+1],l=t[o>t.length-3?t.length-1:o+2],c=b.vec3();return c[0]=b.catmullRomInterpolate(n[0],a[0],s[0],l[0],r),c[1]=b.catmullRomInterpolate(n[1],a[1],s[1],l[1],r),c[2]=b.catmullRomInterpolate(n[2],a[2],s[2],l[2],r),c}getJSON(){return{points,t:this._t}}},VB=b.vec3(),Oit=class extends Ri{get type(){return"CameraPath"}constructor(e,t={}){super(e,t),this._frames=[],this._eyeCurve=new Z5(this),this._lookCurve=new Z5(this),this._upCurve=new Z5(this),t.frames&&(this.addFrames(t.frames),this.smoothFrameTimes(1))}get frames(){return this._frames}get eyeCurve(){return this._eyeCurve}get lookCurve(){return this._lookCurve}get upCurve(){return this._upCurve}saveFrame(e){let t=this.scene.camera;this.addFrame(e,t.eye,t.look,t.up)}addFrame(e,t,i,o){let r={t:e,eye:t.slice(0),look:i.slice(0),up:o.slice(0)};this._frames.push(r),this._eyeCurve.points.push(r.eye),this._lookCurve.points.push(r.look),this._upCurve.points.push(r.up)}addFrames(e){let t;for(let i=0,o=e.length;i<o;i++)t=e[i],this.addFrame(t.t||0,t.eye,t.look,t.up)}loadFrame(e){let t=this.scene.camera;e/=this._frames[this._frames.length-1].t-this._frames[0].t,e=e<0?0:e>1?1:e,t.eye=this._eyeCurve.getPoint(e,VB),t.look=this._lookCurve.getPoint(e,VB),t.up=this._upCurve.getPoint(e,VB)}sampleFrame(e,t,i,o){e=e<0?0:e>1?1:e,this._eyeCurve.getPoint(e,t),this._lookCurve.getPoint(e,i),this._upCurve.getPoint(e,o)}smoothFrameTimes(e){if(this._frames.length===0)return;let t=b.vec3();var i=0;this._frames[0].t=0;let o=[];for(let n=1,a=this._frames.length;n<a;n++){var r=b.lenVec3(b.subVec3(this._frames[n].eye,this._frames[n-1].eye,t));o[n]=r,i+=r}for(let n=1,a=this._frames.length;n<a;n++){let s=o[n]/i*e;this._frames[n].t=this._frames[n-1].t+s}}clearFrames(){this._frames=[],this._eyeCurve.points=[],this._lookCurve.points=[],this._upCurve.points=[]}},jB=b.vec3(),QB=b.vec3(),zB=b.vec3(),Wj=b.vec3(),ah=b.vec3(),qB=class t7 extends Ri{get type(){return"CameraFlightAnimation"}constructor(t,i={}){super(t,i),this._look1=b.vec3(),this._eye1=b.vec3(),this._up1=b.vec3(),this._look2=b.vec3(),this._eye2=b.vec3(),this._up2=b.vec3(),this._orthoScale1=1,this._orthoScale2=1,this._flying=!1,this._flyEyeLookUp=!1,this._flyingEye=!1,this._flyingLook=!1,this._callback=null,this._callbackScope=null,this._time1=null,this._time2=null,this.easing=i.easing!==!1,this.duration=i.duration,this.fit=i.fit,this.fitFOV=i.fitFOV,this.trail=i.trail}flyTo(t,i,o){t||=this.scene,this._flying&&this.stop(),this._flying=!1,this._flyingEye=!1,this._flyingLook=!1,this._flyingEyeLookUp=!1,this._callback=i,this._callbackScope=o;let r=this.scene.camera,n=!!t.projection&&t.projection!==r.projection;this._eye1[0]=r.eye[0],this._eye1[1]=r.eye[1],this._eye1[2]=r.eye[2],this._look1[0]=r.look[0],this._look1[1]=r.look[1],this._look1[2]=r.look[2],this._up1[0]=r.up[0],this._up1[1]=r.up[1],this._up1[2]=r.up[2],this._orthoScale1=r.ortho.scale,this._orthoScale2=t.orthoScale||this._orthoScale1;let a,s,l,c,d;if(t.aabb)a=t.aabb;else if(t.length===6)a=t;else if(t.eye&&t.look||t.up)s=t.eye,l=t.look,c=t.up;else if(t.eye)s=t.eye;else if(t.look)l=t.look;else{let A=t;if((St.isNumeric(A)||St.isString(A))&&(d=A,A=this.scene.components[d],!A)){this.error("Component not found: "+St.inQuotes(d)),i&&(o?i.call(o):i());return}n||(a=A.aabb||this.scene.aabb)}let u=t.poi;if(a){if(a[3]<a[0]||a[4]<a[1]||a[5]<a[2]||a[3]===a[0]&&a[4]===a[1]&&a[5]===a[2])return;a=a.slice();let A=b.getAABB3Center(a);this._look2=u||A;let h=b.subVec3(this._eye1,this._look1,jB),p=b.normalizeVec3(h),f=u?b.getAABB3DiagPoint(a,u):b.getAABB3Diag(a),m=t.fitFOV||this._fitFOV,g=Math.abs(f/Math.tan(m*b.DEGTORAD));this._orthoScale2=f*1.1,this._eye2[0]=this._look2[0]+p[0]*g,this._eye2[1]=this._look2[1]+p[1]*g,this._eye2[2]=this._look2[2]+p[2]*g,this._up2[0]=this._up1[0],this._up2[1]=this._up1[1],this._up2[2]=this._up1[2],this._flyingEyeLookUp=!0}else(s||l||c)&&(this._flyingEyeLookUp=!!s&&!!l&&!!c,this._flyingEye=!!s&&!l,this._flyingLook=!!l&&!s,s&&(this._eye2[0]=s[0],this._eye2[1]=s[1],this._eye2[2]=s[2]),l&&(this._look2[0]=l[0],this._look2[1]=l[1],this._look2[2]=l[2]),c&&(this._up2[0]=c[0],this._up2[1]=c[1],this._up2[2]=c[2]));n?(t.projection==="ortho"&&r.projection!=="ortho"&&(this._projection2="ortho",this._projMatrix1=r.projMatrix.slice(),this._projMatrix2=r.ortho.matrix.slice(),r.projection="customProjection"),t.projection==="perspective"&&r.projection!=="perspective"&&(this._projection2="perspective",this._projMatrix1=r.projMatrix.slice(),this._projMatrix2=r.perspective.matrix.slice(),r.projection="customProjection")):this._projection2=null,this.fire("started",t,!0),this._time1=Date.now(),this._time2=this._time1+(Number.isFinite(t.duration)?t.duration*1e3:this._duration),this._flying=!0,jr.scheduleTask(this._update,this)}jumpTo(t){this._jumpTo(t)}_jumpTo(t){this._flying&&this.stop();let i=this.scene.camera;var o,r,n,a,s;if(t.aabb)o=t.aabb;else if(t.length===6)o=t;else if(t.eye||t.look||t.up)n=t.eye,a=t.look,s=t.up;else{let d=t;if((St.isNumeric(d)||St.isString(d))&&(r=d,d=this.scene.components[r],!d)){this.error("Component not found: "+St.inQuotes(r));return}o=d.aabb||this.scene.aabb}let l=t.poi;if(o){if(o[3]<=o[0]||o[4]<=o[1]||o[5]<=o[2])return;var c=l?b.getAABB3DiagPoint(o,l):b.getAABB3Diag(o);a=l||b.getAABB3Center(o,a),this._trail?b.subVec3(i.look,a,ah):b.subVec3(i.eye,i.look,ah),b.normalizeVec3(ah);let d;d=(t.fit===void 0?this._fit:t.fit)?Math.abs(c/Math.tan((t.fitFOV||this._fitFOV)*b.DEGTORAD)):b.lenVec3(b.subVec3(i.eye,i.look,jB)),b.mulVec3Scalar(ah,d),i.eye=b.addVec3(a,ah,jB),i.look=a,this.scene.camera.ortho.scale=c*1.1}else(n||a||s)&&(n&&(i.eye=n),a&&(i.look=a),s&&(i.up=s));t.projection&&(i.projection=t.projection)}_update(){if(!this._flying)return;let t=(Date.now()-this._time1)/(this._time2-this._time1),i=t>=1;t>1&&(t=1);let o=this.easing?t7._ease(t,0,1,1):t,r=this.scene.camera;if(this._flyingEye||this._flyingLook?this._flyingEye?(b.subVec3(r.eye,r.look,ah),r.eye=b.lerpVec3(o,0,1,this._eye1,this._eye2,zB),r.look=b.subVec3(zB,ah,QB)):this._flyingLook&&(r.look=b.lerpVec3(o,0,1,this._look1,this._look2,QB),r.up=b.lerpVec3(o,0,1,this._up1,this._up2,Wj)):this._flyingEyeLookUp&&(r.eye=b.lerpVec3(o,0,1,this._eye1,this._eye2,zB),r.look=b.lerpVec3(o,0,1,this._look1,this._look2,QB),r.up=b.lerpVec3(o,0,1,this._up1,this._up2,Wj)),this._projection2){let n=this._projection2==="ortho"?t7._easeOutExpo(t,0,1,1):t7._easeInCubic(t,0,1,1);r.customProjection.matrix=b.lerpMat4(n,0,1,this._projMatrix1,this._projMatrix2)}else r.ortho.scale=this._orthoScale1+t*(this._orthoScale2-this._orthoScale1);if(i){r.ortho.scale=this._orthoScale2,this.stop();return}jr.scheduleTask(this._update,this)}static _ease(t,i,o,r){return t/=r,-o*t*(t-2)+i}static _easeInCubic(t,i,o,r){return t/=r,o*t*t*t+i}static _easeOutExpo(t,i,o,r){return o*(-(2**(-10*t/r))+1)+i}stop(){if(!this._flying)return;this._flying=!1,this._time1=null,this._time2=null,this._projection2&&(this.scene.camera.projection=this._projection2);let t=this._callback;t&&(this._callback=null,this._callbackScope?t.call(this._callbackScope):t()),this.fire("stopped",!0,!0)}cancel(){this._flying&&(this._flying=!1,this._time1=null,this._time2=null,this._callback&&=null,this.fire("canceled",!0,!0))}set duration(t){this._duration=Number.isFinite(t)?t*1e3:500,this.stop()}get duration(){return this._duration/1e3}set fit(t){this._fit=t!==!1}get fit(){return this._fit}set fitFOV(t){this._fitFOV=t||45}get fitFOV(){return this._fitFOV}set trail(t){this._trail=!!t}get trail(){return this._trail}destroy(){this.stop(),super.destroy()}},Ng=class fs extends Ri{get type(){return"CameraPathAnimation"}constructor(t,i={}){super(t,i),this._cameraFlightAnimation=new qB(this),this._t=0,this.state=fs.SCRUBBING,this._playingFromT=0,this._playingToT=0,this._playingRate=i.playingRate||1,this._playingDir=1,this._lastTime=null,this.cameraPath=i.cameraPath,this._tick=this.scene.on("tick",this._updateT,this)}_updateT(){let t=this._cameraPath;if(!t)return;let i,o,r=performance.now(),n=this._lastTime?(r-this._lastTime)*.001:0;if(this._lastTime=r,n!==0)switch(this.state){case fs.SCRUBBING:return;case fs.PLAYING:if(this._t+=this._playingRate*n,i=this._cameraPath.frames.length,i===0||this._playingDir<0&&this._t<=0||this._playingDir>0&&this._t>=this._cameraPath.frames[i-1].t){this.state=fs.SCRUBBING,this._t=this._cameraPath.frames[i-1].t,this.fire("stopped");return}t.loadFrame(this._t);break;case fs.PLAYING_TO:o=this._t+this._playingRate*n*this._playingDir,(this._playingDir<0&&o<=this._playingToT||this._playingDir>0&&o>=this._playingToT)&&(o=this._playingToT,this.state=fs.SCRUBBING,this.fire("stopped")),this._t=o,t.loadFrame(this._t);break}}_ease(t,i,o,r){return t/=r,-o*t*(t-2)+i}set cameraPath(t){this._cameraPath=t}get cameraPath(){return this._cameraPath}set rate(t){this._playingRate=t}get rate(){return this._playingRate}play(){this._cameraPath&&(this._lastTime=null,this.state=fs.PLAYING)}playToT(t){this._cameraPath&&(this._playingFromT=this._t,this._playingToT=t,this._playingDir=this._playingToT-this._playingFromT<0?-1:1,this._lastTime=null,this.state=fs.PLAYING_TO)}playToFrame(t){let i=this._cameraPath;if(!i)return;let o=i.frames[t];if(!o){this.error("playToFrame - frame index out of range: "+t);return}this.playToT(o.t)}flyToFrame(t,i){let o=this._cameraPath;if(!o)return;let r=o.frames[t];if(!r){this.error("flyToFrame - frame index out of range: "+t);return}this.state=fs.SCRUBBING,this._cameraFlightAnimation.flyTo(r,i)}scrubToT(t){let i=this._cameraPath;i&&this.scene.camera&&(this._t=t,i.loadFrame(this._t),this.state=fs.SCRUBBING)}scrubToFrame(t){let i=this._cameraPath;if(i&&this.scene.camera){if(!i.frames[t]){this.error("playToFrame - frame index out of range: "+t);return}i.loadFrame(this._t),this.state=fs.SCRUBBING}}stop(){this.state=fs.SCRUBBING,this.fire("stopped")}destroy(){super.destroy(),this.scene.off(this._tick)}};Ng.STOPPED=0,Ng.SCRUBBING=1,Ng.PLAYING=2,Ng.PLAYING_TO=3;var Yj=class extends Ri{get type(){return"Geometry"}get isGeometry(){return!0}constructor(e,t={}){super(e,t),lr.memory.meshes++}destroy(){super.destroy(),lr.memory.meshes--}},Xj=new Ss({}),kr=class{constructor(e){this.id=Xj.addItem({});for(let t in e)e.hasOwnProperty(t)&&(this[t]=e[t])}destroy(){Xj.removeItem(this.id)}},Zt=class{constructor(e,t,i,o,r,n,a,s,l){switch(this._gl=e,this.type=t,this.allocated=!1,this.ConstructorType=i.constructor,i.constructor){case Uint8Array:this.itemType=e.UNSIGNED_BYTE,this.itemByteSize=1;break;case Int8Array:this.itemType=e.BYTE,this.itemByteSize=1;break;case Uint16Array:this.itemType=e.UNSIGNED_SHORT,this.itemByteSize=2;break;case Int16Array:this.itemType=e.SHORT,this.itemByteSize=2;break;case Uint32Array:this.itemType=e.UNSIGNED_INT,this.itemByteSize=4;break;case Int32Array:this.itemType=e.INT,this.itemByteSize=4;break;default:this.itemType=e.FLOAT,this.itemByteSize=4}this.usage=n,this.length=0,this.dataLength=o,this.numItems=0,this.itemSize=r,this.normalized=!!a,this.stride=s||0,this.offset=l||0,this._allocate(i)}_allocate(e){if(this.allocated=!1,this._handle=this._gl.createBuffer(),!this._handle)throw"Failed to allocate WebGL ArrayBuffer";this._handle&&(this._gl.bindBuffer(this.type,this._handle),this._gl.bufferData(this.type,e.length>this.dataLength?e.slice(0,this.dataLength):e,this.usage),this._gl.bindBuffer(this.type,null),this.length=e.length,this.numItems=this.length/this.itemSize,this.allocated=!0)}setData(e,t){this.allocated&&(e.length+(t||0)>this.length?(this.destroy(),this._allocate(e)):(this._gl.bindBuffer(this.type,this._handle),t||t===0?this._gl.bufferSubData(this.type,t*this.itemByteSize,e):this._gl.bufferData(this.type,e,this.usage),this._gl.bindBuffer(this.type,null)))}getData(e=0,t=this.numItems-e){if(!this.allocated)return[];let i=new this.ConstructorType(t*this.itemSize);return this._gl.bindBuffer(this.type,this._handle),this._gl.getBufferSubData(this.type,e*this.itemByteSize*this.itemSize,i,0,t*this.itemSize),i}bind(){this.allocated&&this._gl.bindBuffer(this.type,this._handle)}unbind(){this.allocated&&this._gl.bindBuffer(this.type,null)}destroy(){this.allocated&&=(this._gl.deleteBuffer(this._handle),this._handle=null,!1)}},Bu=(function(){let e=[],t=[],i=[],o=[],r=[],n=0,a=new Uint16Array(3),s=new Uint16Array(3),l=new Uint16Array(3),c=b.vec3(),d=b.vec3(),u=b.vec3(),A=b.vec3(),h=b.vec3(),p=b.vec3(),f=b.vec3();function m(y,v){let C={},x,B,E,D,P=1e4,M,R,O=0;for(M=0,R=y.length;M<R;M+=3)x=y[M],B=y[M+1],E=y[M+2],D=Math.round(x*P)+"_"+Math.round(B*P)+"_"+Math.round(E*P),C[D]===void 0&&(C[D]=O/3,e[O++]=x,e[O++]=B,e[O++]=E),t[M/3]=C[D];for(M=0,R=v.length;M<R;M++)o[M]=t[v[M]],i[o[M]]=v[M]}function g(y,v){n=0;for(let C=0,x=y;C<x;C+=3){let B=o[C]*3,E=o[C+1]*3,D=o[C+2]*3;v?(a[0]=e[B],a[1]=e[B+1],a[2]=e[B+2],s[0]=e[E],s[1]=e[E+1],s[2]=e[E+2],l[0]=e[D],l[1]=e[D+1],l[2]=e[D+2],b.decompressPosition(a,v,c),b.decompressPosition(s,v,d),b.decompressPosition(l,v,u)):(c[0]=e[B],c[1]=e[B+1],c[2]=e[B+2],d[0]=e[E],d[1]=e[E+1],d[2]=e[E+2],u[0]=e[D],u[1]=e[D+1],u[2]=e[D+2]),b.subVec3(u,d,A),b.subVec3(c,d,h),b.cross3Vec3(A,h,p),b.normalizeVec3(p,f);let P=r[n]||(r[n]={normal:b.vec3()});P.normal[0]=f[0],P.normal[1]=f[1],P.normal[2]=f[2],n++}}return function(y,v,C,x){m(y,v),g(v.length,C);let B=[],E=Math.cos(b.DEGTORAD*x),D={},P,M,R,O,V,z=!1,K,Z,te,ie,se,Be;for(let qe=0,ze=v.length;qe<ze;qe+=3){let st=qe/3;for(let Pe=0;Pe<3;Pe++)P=o[qe+Pe],M=o[qe+(Pe+1)%3],R=Math.min(P,M),O=Math.max(P,M),V=R+","+O,D[V]===void 0?D[V]={index1:R,index2:O,face1:st,face2:void 0}:D[V].face2=st}for(V in D)K=D[V],!(K.face2!==void 0&&(Z=r[K.face1].normal,te=r[K.face2].normal,ie=b.dotVec3(Z,te),ie>E))&&(se=i[K.index1],Be=i[K.index2],(!z&&se>65535||Be>65535)&&(z=!0),B.push(se),B.push(Be));return z?new Uint32Array(B):new Uint16Array(B)}})();function Nit(e){let t=new Float32Array(3),i=new Float32Array(3),o,r;for(o=0;o<3;o++)t[o]=Number.MAX_VALUE,i[o]=-Number.MAX_VALUE;for(o=0;o<e.length;o+=3)for(r=0;r<3;r++)t[r]=Math.min(t[r],e[o+r]),i[r]=Math.max(i[r],e[o+r]);return{min:t,max:i}}var Hit=(function(){let e=b.mat4(),t=b.mat4();return function(i,o){o||=b.mat4();let r=i[0],n=i[1],a=i[2],s=i[3]-r,l=i[4]-n,c=i[5]-a,d=65535;return b.identityMat4(e),b.translationMat4v(i,e),b.identityMat4(t),b.scalingMat4v([s/d,l/d,c/d],t),b.mulMat4(e,t,o),o}})(),Vit=(function(){let e=b.mat4(),t=b.mat4();return function(i,o,r){let n=new Uint16Array(i.length),a=new Float32Array([r[0]===o[0]?0:65535/(r[0]-o[0]),r[1]===o[1]?0:65535/(r[1]-o[1]),r[2]===o[2]?0:65535/(r[2]-o[2])]),s;for(s=0;s<i.length;s+=3)n[s+0]=Math.max(0,Math.min(65535,Math.floor((i[s+0]-o[0])*a[0]))),n[s+1]=Math.max(0,Math.min(65535,Math.floor((i[s+1]-o[1])*a[1]))),n[s+2]=Math.max(0,Math.min(65535,Math.floor((i[s+2]-o[2])*a[2])));return b.identityMat4(e),b.translationMat4v(o,e),b.identityMat4(t),b.scalingMat4v([(r[0]-o[0])/65535,(r[1]-o[1])/65535,(r[2]-o[2])/65535],t),{quantized:n,decodeMatrix:b.mulMat4(e,t,b.identityMat4())}}})();function jit(e,t,i){let o=new Float32Array([t[3]===t[0]?0:65535/(t[3]-t[0]),t[4]===t[1]?0:65535/(t[4]-t[1]),t[5]===t[2]?0:65535/(t[5]-t[2])]);i[0]=Math.max(0,Math.min(65535,Math.floor((e[0]-t[0])*o[0]))),i[1]=Math.max(0,Math.min(65535,Math.floor((e[1]-t[1])*o[1]))),i[2]=Math.max(0,Math.min(65535,Math.floor((e[2]-t[2])*o[2])))}function Qit(e,t,i){return i[0]=e[0]*t[0]+t[12],i[1]=e[1]*t[5]+t[13],i[2]=e[2]*t[10]+t[14],i}function zit(e,t,i=e){return i[0]=e[0]*t[0]+t[12],i[1]=e[1]*t[5]+t[13],i[2]=e[2]*t[10]+t[14],i[3]=e[3]*t[0]+t[12],i[4]=e[4]*t[5]+t[13],i[5]=e[5]*t[10]+t[14],i}function qit(e,t,i=new Float32Array(e.length)){for(let o=0,r=e.length;o<r;o+=3)i[o+0]=e[o+0]*t[0]+t[12],i[o+1]=e[o+1]*t[5]+t[13],i[o+2]=e[o+2]*t[10]+t[14];return i}function Git(e){let t=new Float32Array(2),i=new Float32Array(2),o,r;for(o=0;o<2;o++)t[o]=Number.MAX_VALUE,i[o]=-Number.MAX_VALUE;for(o=0;o<e.length;o+=2)for(r=0;r<2;r++)t[r]=Math.min(t[r],e[o+r]),i[r]=Math.max(i[r],e[o+r]);return{min:t,max:i}}var Kit=(function(){let e=b.mat3(),t=b.mat3();return function(i,o,r){let n=new Uint16Array(i.length),a=new Float32Array([65535/(r[0]-o[0]),65535/(r[1]-o[1])]),s;for(s=0;s<i.length;s+=2)n[s+0]=Math.max(0,Math.min(65535,Math.floor((i[s+0]-o[0])*a[0]))),n[s+1]=Math.max(0,Math.min(65535,Math.floor((i[s+1]-o[1])*a[1])));return b.identityMat3(e),b.translationMat3v(o,e),b.identityMat3(t),b.scalingMat3v([(r[0]-o[0])/65535,(r[1]-o[1])/65535],t),{quantized:n,decodeMatrix:b.mulMat3(e,t,b.identityMat3())}}})();function Jit(e){let t=new Int8Array(e.length),i,o,r,n,a;for(let s=0;s<e.length;s+=3)r=i=W5(e,s,"floor","floor"),o=Y5(i),n=a=X5(e,s,o),i=W5(e,s,"ceil","floor"),o=Y5(i),n=X5(e,s,o),n>a&&(r=i,a=n),i=W5(e,s,"floor","ceil"),o=Y5(i),n=X5(e,s,o),n>a&&(r=i,a=n),i=W5(e,s,"ceil","ceil"),o=Y5(i),n=X5(e,s,o),n>a&&(r=i,a=n),t[s]=r[0],t[s+1]=r[1];return t}function W5(e,t,i,o){let r=e[t]/(Math.abs(e[t])+Math.abs(e[t+1])+Math.abs(e[t+2])),n=e[t+1]/(Math.abs(e[t])+Math.abs(e[t+1])+Math.abs(e[t+2]));if(e[t+2]<0){let a=(1-Math.abs(n))*(r>=0?1:-1),s=(1-Math.abs(r))*(n>=0?1:-1);r=a,n=s}return new Int8Array([Math[i](r*127.5+(r<0?-1:0)),Math[o](n*127.5+(n<0?-1:0))])}function Y5(e){let t=e[0],i=e[1];t/=t<0?127:128,i/=i<0?127:128;let o=1-Math.abs(t)-Math.abs(i);o<0&&(t=(1-Math.abs(i))*(t>=0?1:-1),i=(1-Math.abs(t))*(i>=0?1:-1));let r=Math.sqrt(t*t+i*i+o*o);return[t/r,i/r,o/r]}function X5(e,t,i){return e[t]*i[0]+e[t+1]*i[1]+e[t+2]*i[2]}function Zit(e,t,i){i[0]=e[0]*t[0]+t[6],i[1]=e[1]*t[4]+t[7]}function Wit(e,t,i=new Float32Array(e.length)){for(let o=0,r=e.length;o<r;o+=3)i[o+0]=e[o+0]*t[0]+t[6],i[o+1]=e[o+1]*t[4]+t[7];return i}function Yit(e,t){let i=e[0],o=e[1];i=(2*i+1)/255,o=(2*o+1)/255;let r=1-Math.abs(i)-Math.abs(o);r<0&&(i=(1-Math.abs(o))*(i>=0?1:-1),o=(1-Math.abs(i))*(o>=0?1:-1));let n=Math.sqrt(i*i+o*o+r*r);return t[0]=i/n,t[1]=o/n,t[2]=r/n,t}function Xit(e,t){for(let i=0,o=0,r=e.length;i<r;i+=2){let n=e[i+0],a=e[i+1];n=(2*n+1)/255,a=(2*a+1)/255;let s=1-Math.abs(n)-Math.abs(a);s<0&&(n=(1-Math.abs(a))*(n>=0?1:-1),a=(1-Math.abs(n))*(a>=0?1:-1));let l=Math.sqrt(n*n+a*a+s*s);t[o+0]=n/l,t[o+1]=a/l,t[o+2]=s/l,o+=3}return t}var bi={getPositionsBounds:Nit,createPositionsDecodeMatrix:Hit,compressPositions:Vit,compressPosition:jit,decompressPositions:qit,decompressPosition:Qit,decompressAABB:zit,getUVBounds:Git,compressUVs:Kit,decompressUVs:Wit,decompressUV:Zit,compressNormals:Jit,decompressNormals:Xit,decompressNormal:Yit},Xl=lr.memory,$j=b.AABB3(),Kr=class extends Yj{get type(){return"ReadableGeometry"}get isReadableGeometry(){return!0}constructor(e,t={}){super(e,t),this._state=new kr({compressGeometry:!!t.compressGeometry,primitive:null,primitiveName:null,positions:null,normals:null,colors:null,uv:null,indices:null,positionsDecodeMatrix:null,uvDecodeMatrix:null,positionsBuf:null,normalsBuf:null,colorsbuf:null,uvBuf:null,indicesBuf:null,hash:""}),this._numTriangles=0,this._edgeThreshold=t.edgeThreshold||10,this._edgeIndicesBuf=null,this._pickTrianglePositionsBuf=null,this._pickTriangleColorsBuf=null,this._aabbDirty=!0,this._boundingSphere=!0,this._aabb=null,this._aabbDirty=!0,this._obb=null,this._obbDirty=!0;let i=this._state,o=this.scene.canvas.gl;switch(t.primitive=t.primitive||"triangles",t.primitive){case"points":i.primitive=o.POINTS,i.primitiveName=t.primitive;break;case"lines":i.primitive=o.LINES,i.primitiveName=t.primitive;break;case"line-loop":i.primitive=o.LINE_LOOP,i.primitiveName=t.primitive;break;case"line-strip":i.primitive=o.LINE_STRIP,i.primitiveName=t.primitive;break;case"triangles":i.primitive=o.TRIANGLES,i.primitiveName=t.primitive;break;case"triangle-strip":i.primitive=o.TRIANGLE_STRIP,i.primitiveName=t.primitive;break;case"triangle-fan":i.primitive=o.TRIANGLE_FAN,i.primitiveName=t.primitive;break;default:this.error("Unsupported value for 'primitive': '"+t.primitive+"' - supported values are 'points', 'lines', 'line-loop', 'line-strip', 'triangles', 'triangle-strip' and 'triangle-fan'. Defaulting to 'triangles'."),i.primitive=o.TRIANGLES,i.primitiveName=t.primitive}if(t.positions)if(this._state.compressGeometry){let r=bi.getPositionsBounds(t.positions),n=bi.compressPositions(t.positions,r.min,r.max);i.positions=n.quantized,i.positionsDecodeMatrix=n.decodeMatrix}else i.positions=t.positions.constructor===Float32Array?t.positions:new Float32Array(t.positions);if(t.colors&&(i.colors=t.colors.constructor===Float32Array?t.colors:new Float32Array(t.colors)),t.uv)if(this._state.compressGeometry){let r=bi.getUVBounds(t.uv),n=bi.compressUVs(t.uv,r.min,r.max);i.uv=n.quantized,i.uvDecodeMatrix=n.decodeMatrix}else i.uv=t.uv.constructor===Float32Array?t.uv:new Float32Array(t.uv);t.normals&&(this._state.compressGeometry?i.normals=bi.compressNormals(t.normals):i.normals=t.normals.constructor===Float32Array?t.normals:new Float32Array(t.normals)),t.indices&&(i.indices=t.indices.constructor===Uint32Array||t.indices.constructor===Uint16Array?t.indices:new Uint32Array(t.indices),this._state.primitiveName==="triangles"&&(this._numTriangles=t.indices.length/3)),this._buildHash(),Xl.meshes++,this._buildVBOs()}_buildVBOs(){let e=this._state,t=this.scene.canvas.gl;if(e.indices&&(e.indicesBuf=new Zt(t,t.ELEMENT_ARRAY_BUFFER,e.indices,e.indices.length,1,t.STATIC_DRAW),Xl.indices+=e.indicesBuf.numItems),e.positions&&(e.positionsBuf=new Zt(t,t.ARRAY_BUFFER,e.positions,e.positions.length,3,t.STATIC_DRAW),Xl.positions+=e.positionsBuf.numItems),e.normals){let i=e.compressGeometry;e.normalsBuf=new Zt(t,t.ARRAY_BUFFER,e.normals,e.normals.length,3,t.STATIC_DRAW,i),Xl.normals+=e.normalsBuf.numItems}e.colors&&(e.colorsBuf=new Zt(t,t.ARRAY_BUFFER,e.colors,e.colors.length,4,t.STATIC_DRAW),Xl.colors+=e.colorsBuf.numItems),e.uv&&(e.uvBuf=new Zt(t,t.ARRAY_BUFFER,e.uv,e.uv.length,2,t.STATIC_DRAW),Xl.uvs+=e.uvBuf.numItems)}_buildHash(){let e=this._state,t=["/g"];t.push("/"+e.primitive+";"),e.positions&&t.push("p"),e.colors&&t.push("c"),(e.normals||e.autoVertexNormals)&&t.push("n"),e.uv&&t.push("u"),e.compressGeometry&&t.push("cp"),t.push(";"),e.hash=t.join("")}_getEdgeIndices(){return this._edgeIndicesBuf||this._buildEdgeIndices(),this._edgeIndicesBuf}_getPickTrianglePositions(){return this._pickTrianglePositionsBuf||this._buildPickTriangleVBOs(),this._pickTrianglePositionsBuf}_getPickTriangleColors(){return this._pickTriangleColorsBuf||this._buildPickTriangleVBOs(),this._pickTriangleColorsBuf}_buildEdgeIndices(){let e=this._state;if(!e.positions||!e.indices)return;let t=this.scene.canvas.gl,i=Bu(e.positions,e.indices,e.positionsDecodeMatrix,this._edgeThreshold);this._edgeIndicesBuf=new Zt(t,t.ELEMENT_ARRAY_BUFFER,i,i.length,1,t.STATIC_DRAW),Xl.indices+=this._edgeIndicesBuf.numItems}_buildPickTriangleVBOs(){let e=this._state;if(!e.positions||!e.indices)return;let t=this.scene.canvas.gl,i=b.buildPickTriangles(e.positions,e.indices,e.compressGeometry),o=i.positions,r=i.colors;this._pickTrianglePositionsBuf=new Zt(t,t.ARRAY_BUFFER,o,o.length,3,t.STATIC_DRAW),this._pickTriangleColorsBuf=new Zt(t,t.ARRAY_BUFFER,r,r.length,4,t.STATIC_DRAW,!0),Xl.positions+=this._pickTrianglePositionsBuf.numItems,Xl.colors+=this._pickTriangleColorsBuf.numItems}_buildPickVertexVBOs(){}_webglContextLost(){this._sceneVertexBufs&&this._sceneVertexBufs.webglContextLost()}_webglContextRestored(){this._sceneVertexBufs&&this._sceneVertexBufs.webglContextRestored(),this._buildVBOs(),this._edgeIndicesBuf=null,this._pickVertexPositionsBuf=null,this._pickTrianglePositionsBuf=null,this._pickTriangleColorsBuf=null,this._pickVertexPositionsBuf=null,this._pickVertexColorsBuf=null}get primitive(){return this._state.primitiveName}get compressGeometry(){return this._state.compressGeometry}get positions(){return this._state.positions?this._state.compressGeometry?(this._decompressedPositions||(this._decompressedPositions=new Float32Array(this._state.positions.length),bi.decompressPositions(this._state.positions,this._state.positionsDecodeMatrix,this._decompressedPositions)),this._decompressedPositions):this._state.positions:null}set positions(e){let t=this._state,i=t.positions;if(!i){this.error("can't update geometry positions - geometry has no positions");return}if(i.length!==e.length){this.error("can't update geometry positions - new positions are wrong length");return}if(this._state.compressGeometry){let o=bi.getPositionsBounds(e),r=bi.compressPositions(e,o.min,o.max);e=r.quantized,t.positionsDecodeMatrix=r.decodeMatrix}i.set(e),t.positionsBuf&&t.positionsBuf.setData(i),this._setAABBDirty(),this.glRedraw()}get normals(){if(this._state.normals){if(!this._state.compressGeometry)return this._state.normals;if(!this._decompressedNormals){let e=this._state.normals.length,t=e+e/2;this._decompressedNormals=new Float32Array(t),bi.decompressNormals(this._state.normals,this._decompressedNormals)}return this._decompressedNormals}}set normals(e){if(this._state.compressGeometry){this.error("can't update geometry normals - quantized geometry is immutable");return}let t=this._state,i=t.normals;if(!i){this.error("can't update geometry normals - geometry has no normals");return}if(i.length!==e.length){this.error("can't update geometry normals - new normals are wrong length");return}i.set(e),t.normalsBuf&&t.normalsBuf.setData(i),this.glRedraw()}get uv(){return this._state.uv?this._state.compressGeometry?(this._decompressedUV||(this._decompressedUV=new Float32Array(this._state.uv.length),bi.decompressUVs(this._state.uv,this._state.uvDecodeMatrix,this._decompressedUV)),this._decompressedUV):this._state.uv:null}set uv(e){if(this._state.compressGeometry){this.error("can't update geometry UVs - quantized geometry is immutable");return}let t=this._state,i=t.uv;if(!i){this.error("can't update geometry UVs - geometry has no UVs");return}if(i.length!==e.length){this.error("can't update geometry UVs - new UVs are wrong length");return}i.set(e),t.uvBuf&&t.uvBuf.setData(i),this.glRedraw()}get colors(){return this._state.colors}set colors(e){if(this._state.compressGeometry){this.error("can't update geometry colors - quantized geometry is immutable");return}let t=this._state,i=t.colors;if(!i){this.error("can't update geometry colors - geometry has no colors");return}if(i.length!==e.length){this.error("can't update geometry colors - new colors are wrong length");return}i.set(e),t.colorsBuf&&t.colorsBuf.setData(i),this.glRedraw()}get indices(){return this._state.indices}get aabb(){return this._aabbDirty&&=(this._aabb||=b.AABB3(),b.positions3ToAABB3(this._state.positions,this._aabb,this._state.positionsDecodeMatrix),!1),this._aabb}get obb(){return this._obbDirty&&=(this._obb||=b.OBB3(),b.positions3ToAABB3(this._state.positions,$j,this._state.positionsDecodeMatrix),b.AABB3ToOBB3($j,this._obb),!1),this._obb}_getMetrics(){if(!("_metrics"in this))switch(this._state.primitiveName){case"solid":case"surface":case"triangles":{let e=this._state.indices,t=this._state.positions,i=(a,s)=>{let l=e[a]*3;for(let c=0;c<3;++c)s[c]=t[l+c];return s},o=[b.vec3(),b.vec3(),b.vec3(),b.vec3()],r=0,n=b.vec3([0,0,0]);for(let a=0;a<e.length;a+=3){let s=i(a,o[0]),l=i(a+1,o[1]),c=i(a+2,o[2]);b.addVec3(s,l,o[3]),b.addVec3(c,o[3],o[3]);let d=b.lenVec3(b.cross3Vec3(b.subVec3(l,s,o[1]),b.subVec3(c,s,o[2]),o[0]))/2;r+=d,b.mulVec3Scalar(o[3],d,o[3]),b.addVec3(n,o[3],n)}this._metrics={surfaceArea:r,centroid:b.mulVec3Scalar(n,1/r/3,n)};break}default:this._metrics={surfaceArea:0};break}return this._metrics}get surfaceArea(){return this._getMetrics().surfaceArea}get centroid(){return this._getMetrics().centroid}get numTriangles(){return this._numTriangles}_setAABBDirty(){this._aabbDirty||(this._aabbDirty=!0,this._aabbDirty=!0,this._obbDirty=!0)}_getState(){return this._state}destroy(){super.destroy();let e=this._state;e.indicesBuf&&e.indicesBuf.destroy(),e.positionsBuf&&e.positionsBuf.destroy(),e.normalsBuf&&e.normalsBuf.destroy(),e.uvBuf&&e.uvBuf.destroy(),e.colorsBuf&&e.colorsBuf.destroy(),this._edgeIndicesBuf&&this._edgeIndicesBuf.destroy(),this._pickTrianglePositionsBuf&&this._pickTrianglePositionsBuf.destroy(),this._pickTriangleColorsBuf&&this._pickTriangleColorsBuf.destroy(),this._pickVertexPositionsBuf&&this._pickVertexPositionsBuf.destroy(),this._pickVertexColorsBuf&&this._pickVertexColorsBuf.destroy(),e.destroy(),Xl.meshes--}},sh=lr.memory,eQ=b.AABB3(),tQ=class extends Yj{get type(){return"VBOGeometry"}get isVBOGeometry(){return!0}constructor(e,t={}){super(e,t),this._state=new kr({compressGeometry:!0,primitive:null,primitiveName:null,positionsDecodeMatrix:null,uvDecodeMatrix:null,positionsBuf:null,normalsBuf:null,colorsbuf:null,uvBuf:null,indicesBuf:null,hash:""}),this._numTriangles=0,this._edgeThreshold=t.edgeThreshold||10,this._aabb=null,this._obb=b.OBB3();let i=this._state,o=this.scene.canvas.gl;switch(t.primitive=t.primitive||"triangles",t.primitive){case"points":i.primitive=o.POINTS,i.primitiveName=t.primitive;break;case"lines":i.primitive=o.LINES,i.primitiveName=t.primitive;break;case"line-loop":i.primitive=o.LINE_LOOP,i.primitiveName=t.primitive;break;case"line-strip":i.primitive=o.LINE_STRIP,i.primitiveName=t.primitive;break;case"triangles":i.primitive=o.TRIANGLES,i.primitiveName=t.primitive;break;case"triangle-strip":i.primitive=o.TRIANGLE_STRIP,i.primitiveName=t.primitive;break;case"triangle-fan":i.primitive=o.TRIANGLE_FAN,i.primitiveName=t.primitive;break;default:this.error("Unsupported value for 'primitive': '"+t.primitive+"' - supported values are 'points', 'lines', 'line-loop', 'line-strip', 'triangles', 'triangle-strip' and 'triangle-fan'. Defaulting to 'triangles'."),i.primitive=o.TRIANGLES,i.primitiveName=t.primitive}if(!t.positions){this.error("Config expected: positions");return}if(!t.indices){this.error("Config expected: indices");return}var r;if(!t.positionsDecodeMatrix){let n=bi.getPositionsBounds(t.positions),a=bi.compressPositions(t.positions,n.min,n.max);r=a.quantized,i.positionsDecodeMatrix=a.decodeMatrix,i.positionsBuf=new Zt(o,o.ARRAY_BUFFER,r,r.length,3,o.STATIC_DRAW),sh.positions+=i.positionsBuf.numItems,b.positions3ToAABB3(t.positions,this._aabb),b.positions3ToAABB3(r,eQ,i.positionsDecodeMatrix),b.AABB3ToOBB3(eQ,this._obb)}if(t.colors){let n=t.colors.constructor===Float32Array?t.colors:new Float32Array(t.colors);i.colorsBuf=new Zt(o,o.ARRAY_BUFFER,n,n.length,4,o.STATIC_DRAW),sh.colors+=i.colorsBuf.numItems}if(t.uv){let n=bi.getUVBounds(t.uv),a=bi.compressUVs(t.uv,n.min,n.max),s=a.quantized;i.uvDecodeMatrix=a.decodeMatrix,i.uvBuf=new Zt(o,o.ARRAY_BUFFER,s,s.length,2,o.STATIC_DRAW),sh.uvs+=i.uvBuf.numItems}if(t.normals){let n=bi.compressNormals(t.normals),a=i.compressGeometry;i.normalsBuf=new Zt(o,o.ARRAY_BUFFER,n,n.length,3,o.STATIC_DRAW,a),sh.normals+=i.normalsBuf.numItems}{let n=t.indices.constructor===Uint32Array||t.indices.constructor===Uint16Array?t.indices:new Uint32Array(t.indices);i.indicesBuf=new Zt(o,o.ELEMENT_ARRAY_BUFFER,n,n.length,1,o.STATIC_DRAW),sh.indices+=i.indicesBuf.numItems;let a=Bu(r,n,i.positionsDecodeMatrix,this._edgeThreshold);this._edgeIndicesBuf=new Zt(o,o.ELEMENT_ARRAY_BUFFER,a,a.length,1,o.STATIC_DRAW),this._state.primitiveName==="triangles"&&(this._numTriangles=t.indices.length/3)}this._buildHash(),sh.meshes++}_buildHash(){let e=this._state,t=["/g"];t.push("/"+e.primitive+";"),e.positionsBuf&&t.push("p"),e.colorsBuf&&t.push("c"),(e.normalsBuf||e.autoVertexNormals)&&t.push("n"),e.uvBuf&&t.push("u"),t.push("cp"),t.push(";"),e.hash=t.join("")}_getEdgeIndices(){return this._edgeIndicesBuf}get primitive(){return this._state.primitiveName}get aabb(){return this._aabb}get obb(){return this._obb}get numTriangles(){return this._numTriangles}_getState(){return this._state}destroy(){super.destroy();let e=this._state;e.indicesBuf&&e.indicesBuf.destroy(),e.positionsBuf&&e.positionsBuf.destroy(),e.normalsBuf&&e.normalsBuf.destroy(),e.uvBuf&&e.uvBuf.destroy(),e.colorsBuf&&e.colorsBuf.destroy(),this._edgeIndicesBuf&&this._edgeIndicesBuf.destroy(),e.destroy(),sh.meshes--}},tt={};tt.load=function(e,t){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(o){t(o.target.response)},i.send()},tt.save=function(e,t){var i="data:application/octet-stream;base64,"+btoa(tt.parse._buffToStr(e));window.location.href=i},tt.clone=function(e){return JSON.parse(JSON.stringify(e))},tt.bin={},tt.bin.f=new Float32Array(1),tt.bin.fb=new Uint8Array(tt.bin.f.buffer),tt.bin.rf=function(e,t){for(var i=tt.bin.f,o=tt.bin.fb,r=0;r<4;r++)o[r]=e[t+r];return i[0]},tt.bin.rsl=function(e,t){return e[t]|e[t+1]<<8},tt.bin.ril=function(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24},tt.bin.rASCII0=function(e,t){for(var i="";e[t]!=0;)i+=String.fromCharCode(e[t++]);return i},tt.bin.wf=function(e,t,i){var o=new Float32Array(e.buffer,t,1);o[0]=i},tt.bin.wsl=function(e,t,i){e[t]=i,e[t+1]=i>>8},tt.bin.wil=function(e,t,i){e[t]=i,e[t+1]=i>>8,e[t+2]=i>>16,e[t+3]>>24},tt.parse={},tt.parse._buffToStr=function(e){for(var t=new Uint8Array(e),i="",o=0;o<t.length;o++)i=i.concat(String.fromCharCode(t[o]));return i},tt.parse._strToBuff=function(e){for(var t=new ArrayBuffer(e.length),i=new Uint8Array(t),o=0;o<e.length;o++)i[o]=e.charCodeAt(o);return t},tt.parse._readLine=function(e,t){for(var i="";e[t]!=10;)i+=String.fromCharCode(e[t++]);return i},tt.parse.fromJSON=function(e){return JSON.parse(tt.parse._buffToStr(e))},tt.parse.toJSON=function(e){var t=JSON.stringify(e);return tt.parse._strToBuff(t)},tt.parse.fromOBJ=function(e){var t={};t.groups={},t.c_verts=[],t.c_uvt=[],t.c_norms=[],t.i_verts=[],t.i_uvt=[],t.i_norms=[];for(var i={from:0,to:0},o=0,r=new Uint8Array(e);o<r.length;){var n=tt.parse._readLine(r,o);o+=n.length+1,n=n.replace(/ +(?= )/g,""),n=n.replace(/(^\s+|\s+$)/g,"");var a=n.split(" ");if(a[0]=="g"&&(i.to=t.i_verts.length,t.groups[a[1]]??(t.groups[a[1]]={from:t.i_verts.length,to:0}),i=t.groups[a[1]]),a[0]=="v"){var s=parseFloat(a[1]),l=parseFloat(a[2]),c=parseFloat(a[3]);t.c_verts.push(s,l,c)}if(a[0]=="vt"){var s=parseFloat(a[1]),l=1-parseFloat(a[2]);t.c_uvt.push(s,l)}if(a[0]=="vn"){var s=parseFloat(a[1]),l=parseFloat(a[2]),c=parseFloat(a[3]);t.c_norms.push(s,l,c)}if(a[0]=="f"){var d=a[1].split("/"),u=a[2].split("/"),A=a[3].split("/"),h=parseInt(d[0])-1,p=parseInt(u[0])-1,f=parseInt(A[0])-1,m=parseInt(d[1])-1,g=parseInt(u[1])-1,y=parseInt(A[1])-1,v=parseInt(d[2])-1,C=parseInt(u[2])-1,x=parseInt(A[2])-1,B=t.c_verts.length/3,E=t.c_uvt.length/2,D=t.c_norms.length/3;if(h<0&&(h=B+h+1),p<0&&(p=B+p+1),f<0&&(f=B+f+1),m<0&&(m=E+m+1),g<0&&(g=E+g+1),y<0&&(y=E+y+1),v<0&&(v=D+v+1),C<0&&(C=D+C+1),x<0&&(x=D+x+1),t.i_verts.push(h,p,f),t.i_uvt.push(m,g,y),t.i_norms.push(v,C,x),a.length==5){var P=a[4].split("/"),M=parseInt(P[0])-1,R=parseInt(P[1])-1,O=parseInt(P[2])-1;M<0&&(M=B+M+1),R<0&&(R=E+R+1),O<0&&(O=D+O+1),t.i_verts.push(h,f,M),t.i_uvt.push(m,y,R),t.i_norms.push(v,x,O)}}}return i.to=t.i_verts.length,t},tt.parse.fromMD2=function(e){e=new Uint8Array(e);var t={},i={};i.ident=tt.bin.ril(e,0),i.version=tt.bin.ril(e,4),i.skinwidth=tt.bin.ril(e,8),i.skinheight=tt.bin.ril(e,12),i.framesize=tt.bin.ril(e,16),i.num_skins=tt.bin.ril(e,20),i.num_vertices=tt.bin.ril(e,24),i.num_st=tt.bin.ril(e,28),i.num_tris=tt.bin.ril(e,32),i.num_glcmds=tt.bin.ril(e,36),i.num_frames=tt.bin.ril(e,40),i.offset_skins=tt.bin.ril(e,44),i.offset_st=tt.bin.ril(e,48),i.offset_tris=tt.bin.ril(e,52),i.offset_frames=tt.bin.ril(e,56),i.offset_glcmds=tt.bin.ril(e,60),i.offset_end=tt.bin.ril(e,64);var l=i.offset_st;t.c_uvt=[];for(var o=0;o<i.num_st;o++){var r=tt.bin.rsl(e,l)/i.skinwidth,n=tt.bin.rsl(e,l+2)/i.skinheight;t.c_uvt.push(r,n),l+=4}var l=i.offset_tris,a=[],s=[];t.i_verts=a,t.i_uvt=s;for(var o=0;o<i.num_tris;o++)a.push(tt.bin.rsl(e,l),tt.bin.rsl(e,l+2),tt.bin.rsl(e,l+4)),s.push(tt.bin.rsl(e,l+6),tt.bin.rsl(e,l+8),tt.bin.rsl(e,l+10)),l+=12;var l=i.offset_skins;t.skins=[];for(var o=0;o<i.num_skins;o++)t.skins.push(tt.bin.rASCII0(e,l)),l+=64;var l=i.offset_frames;t.frames=[];for(var c=tt.parse.fromMD2._normals,o=0;o<i.num_frames;o++){var d={},u=tt.bin.rf(e,l),A=tt.bin.rf(e,l+4),h=tt.bin.rf(e,l+8);l+=12;var p=tt.bin.rf(e,l),f=tt.bin.rf(e,l+4),m=tt.bin.rf(e,l+8);l+=12,d.name=tt.bin.rASCII0(e,l),l+=16,d.verts=[],d.norms=[];for(var g=0;g<i.num_vertices;g++)d.verts.push(e[l]*u+p,e[l+1]*A+f,e[l+2]*h+m),d.norms.push(c[3*e[l+3]],c[3*e[l+3]+1],c[3*e[l+3]+2]),l+=4;t.frames.push(d)}return t},tt.parse.fromMD2._normals=[-.525731,0,.850651,-.442863,.238856,.864188,-.295242,0,.955423,-.309017,.5,.809017,-.16246,.262866,.951056,0,0,1,0,.850651,.525731,-.147621,.716567,.681718,.147621,.716567,.681718,0,.525731,.850651,.309017,.5,.809017,.525731,0,.850651,.295242,0,.955423,.442863,.238856,.864188,.16246,.262866,.951056,-.681718,.147621,.716567,-.809017,.309017,.5,-.587785,.425325,.688191,-.850651,.525731,0,-.864188,.442863,.238856,-.716567,.681718,.147621,-.688191,.587785,.425325,-.5,.809017,.309017,-.238856,.864188,.442863,-.425325,.688191,.587785,-.716567,.681718,-.147621,-.5,.809017,-.309017,-.525731,.850651,0,0,.850651,-.525731,-.238856,.864188,-.442863,0,.955423,-.295242,-.262866,.951056,-.16246,0,1,0,0,.955423,.295242,-.262866,.951056,.16246,.238856,.864188,.442863,.262866,.951056,.16246,.5,.809017,.309017,.238856,.864188,-.442863,.262866,.951056,-.16246,.5,.809017,-.309017,.850651,.525731,0,.716567,.681718,.147621,.716567,.681718,-.147621,.525731,.850651,0,.425325,.688191,.587785,.864188,.442863,.238856,.688191,.587785,.425325,.809017,.309017,.5,.681718,.147621,.716567,.587785,.425325,.688191,.955423,.295242,0,1,0,0,.951056,.16246,.262866,.850651,-.525731,0,.955423,-.295242,0,.864188,-.442863,.238856,.951056,-.16246,.262866,.809017,-.309017,.5,.681718,-.147621,.716567,.850651,0,.525731,.864188,.442863,-.238856,.809017,.309017,-.5,.951056,.16246,-.262866,.525731,0,-.850651,.681718,.147621,-.716567,.681718,-.147621,-.716567,.850651,0,-.525731,.809017,-.309017,-.5,.864188,-.442863,-.238856,.951056,-.16246,-.262866,.147621,.716567,-.681718,.309017,.5,-.809017,.425325,.688191,-.587785,.442863,.238856,-.864188,.587785,.425325,-.688191,.688191,.587785,-.425325,-.147621,.716567,-.681718,-.309017,.5,-.809017,0,.525731,-.850651,-.525731,0,-.850651,-.442863,.238856,-.864188,-.295242,0,-.955423,-.16246,.262866,-.951056,0,0,-1,.295242,0,-.955423,.16246,.262866,-.951056,-.442863,-.238856,-.864188,-.309017,-.5,-.809017,-.16246,-.262866,-.951056,0,-.850651,-.525731,-.147621,-.716567,-.681718,.147621,-.716567,-.681718,0,-.525731,-.850651,.309017,-.5,-.809017,.442863,-.238856,-.864188,.16246,-.262866,-.951056,.238856,-.864188,-.442863,.5,-.809017,-.309017,.425325,-.688191,-.587785,.716567,-.681718,-.147621,.688191,-.587785,-.425325,.587785,-.425325,-.688191,0,-.955423,-.295242,0,-1,0,.262866,-.951056,-.16246,0,-.850651,.525731,0,-.955423,.295242,.238856,-.864188,.442863,.262866,-.951056,.16246,.5,-.809017,.309017,.716567,-.681718,.147621,.525731,-.850651,0,-.238856,-.864188,-.442863,-.5,-.809017,-.309017,-.262866,-.951056,-.16246,-.850651,-.525731,0,-.716567,-.681718,-.147621,-.716567,-.681718,.147621,-.525731,-.850651,0,-.5,-.809017,.309017,-.238856,-.864188,.442863,-.262866,-.951056,.16246,-.864188,-.442863,.238856,-.809017,-.309017,.5,-.688191,-.587785,.425325,-.681718,-.147621,.716567,-.442863,-.238856,.864188,-.587785,-.425325,.688191,-.309017,-.5,.809017,-.147621,-.716567,.681718,-.425325,-.688191,.587785,-.16246,-.262866,.951056,.442863,-.238856,.864188,.16246,-.262866,.951056,.309017,-.5,.809017,.147621,-.716567,.681718,0,-.525731,.850651,.425325,-.688191,.587785,.587785,-.425325,.688191,.688191,-.587785,.425325,-.955423,.295242,0,-.951056,.16246,.262866,-1,0,0,-.850651,0,.525731,-.955423,-.295242,0,-.951056,-.16246,.262866,-.864188,.442863,-.238856,-.951056,.16246,-.262866,-.809017,.309017,-.5,-.864188,-.442863,-.238856,-.951056,-.16246,-.262866,-.809017,-.309017,-.5,-.681718,.147621,-.716567,-.681718,-.147621,-.716567,-.850651,0,-.525731,-.688191,.587785,-.425325,-.587785,.425325,-.688191,-.425325,.688191,-.587785,-.425325,-.688191,-.587785,-.587785,-.425325,-.688191,-.688191,-.587785,-.425325],tt.parse.fromCollada=function(e){var t=tt.parse._buffToStr(e),i=new DOMParser().parseFromString(t,"text/xml");i=i.childNodes[0];var o={},r=i.getElementsByTagName("asset")[0],n=i.getElementsByTagName("library_geometries")[0],a=i.getElementsByTagName("library_images")[0],s=i.getElementsByTagName("library_materials")[0],l=i.getElementsByTagName("library_effects")[0];return r&&(o.asset=tt.parse.fromCollada._asset(r)),n&&(o.geometries=tt.parse.fromCollada._libGeometries(n)),a&&(o.images=tt.parse.fromCollada._libImages(a)),s&&(o.materials=tt.parse.fromCollada._libMaterials(s)),l&&(o.effects=tt.parse.fromCollada._libEffects(l)),o},tt.parse.fromCollada._asset=function(e){return{created:e.getElementsByTagName("created")[0].textContent,modified:e.getElementsByTagName("modified")[0].textContent,up_axis:e.getElementsByTagName("up_axis")[0].textContent}},tt.parse.fromCollada._libGeometries=function(e){e=e.getElementsByTagName("geometry");for(var t=[],i=0;i<e.length;i++){var o=e[i],r=tt.parse.fromCollada._getMesh(o.getElementsByTagName("mesh")[0]);t.push(r)}return t},tt.parse.fromCollada._getMesh=function(e){for(var t={},i=e.getElementsByTagName("source"),o=t.sources={},r=0;r<i.length;r++){for(var n=i[r].getElementsByTagName("float_array")[0].textContent.split(" "),a=n.length-(n[n.length-1]==""?1:0),s=Array(a),l=0;l<a;l++)s[l]=parseFloat(n[l]);o[i[r].getAttribute("id")]=s}t.triangles=[];var c=e.getElementsByTagName("triangles");if(c==null)return t;for(var r=0;r<c.length;r++){var d={},u=c[r];d.material=u.getAttribute("material");for(var A=u.getElementsByTagName("input"),h=[],l=0;l<A.length;l++){var p=A[l],s=[];h[parseInt(p.getAttribute("offset"))]=s;var f=p.getAttribute("semantic");d["s_"+f]=f=="VERTEX"?e.getElementsByTagName("vertices")[0].getElementsByTagName("input")[0].getAttribute("source").substring(1):p.getAttribute("source").substring(1),d["i_"+f]=s,o[d["s_"+f]]}for(var m=u.getElementsByTagName("p")[0].textContent.split(" "),g=3*Math.floor(m.length/3),l=0;l<g;l++)h[l%A.length].push(parseInt(m[l]));t.triangles.push(d)}return t},tt.parse.fromCollada._libImages=function(e){e=e.getElementsByTagName("image");for(var t={},i=0;i<e.length;i++)t[e[i].getAttribute("id")]=e[i].getElementsByTagName("init_from")[0].textContent;return t},tt.parse.fromCollada._libMaterials=function(e){e=e.getElementsByTagName("material");for(var t={},i=0;i<e.length;i++)t[e[i].getAttribute("name")]=e[i].getElementsByTagName("instance_effect")[0].getAttribute("url").substring(1);return t},tt.parse.fromCollada._libEffects=function(e){e=e.getElementsByTagName("effect");for(var t={},i=0;i<e.length;i++){for(var o={},r=e[i].getElementsByTagName("newparam"),n=0;n<r.length;n++){var a=r[n].getElementsByTagName("surface")[0];a&&(o.surface=a.getElementsByTagName("init_from")[0].textContent)}t[e[i].getAttribute("id")]=o}return t},tt.parse.from3DS=function(e){e=new Uint8Array(e);var t={};if(tt.bin.rsl(e,0)!=19789)return null;for(var i=tt.bin.ril(e,2),o=6;o<i;){var r=tt.bin.rsl(e,o),n=tt.bin.ril(e,o+2);r==15677&&(t.edit=tt.parse.from3DS._edit3ds(e,o,n)),r==45056&&(t.keyf=tt.parse.from3DS._keyf3ds(e,o,n)),o+=n}return t},tt.parse.from3DS._edit3ds=function(e,t,i){for(var o={},r=t+6;r<t+i;){var n=tt.bin.rsl(e,r),a=tt.bin.ril(e,r+2);n==16384&&(o.objects??=[],o.objects.push(tt.parse.from3DS._edit_object(e,r,a))),r+=a}return o},tt.parse.from3DS._keyf3ds=function(e,t,i){for(var o={},r=t+6;r<t+i;){var n=tt.bin.rsl(e,r),a=tt.bin.ril(e,r+2);n==45058&&(o.desc??=[],o.desc.push(tt.parse.from3DS._keyf_objdes(e,r,a))),r+=a}return o},tt.parse.from3DS._keyf_objdes=function(e,t,i){for(var o={},r=t+6;r<t+i;){var n=tt.bin.rsl(e,r),a=tt.bin.ril(e,r+2);n==45072&&(o.hierarchy=tt.parse.from3DS._keyf_objhierarch(e,r,a)),n==45073&&(o.dummy_name=tt.bin.rASCII0(e,r+6)),r+=a}return o},tt.parse.from3DS._keyf_objhierarch=function(e,t,i){var o={},r=t+6;return o.name=tt.bin.rASCII0(e,r),r+=o.name.length+1,o.hierarchy=tt.bin.rsl(e,r+4),o},tt.parse.from3DS._edit_object=function(e,t,i){var o={},r=t+6;for(o.name=tt.bin.rASCII0(e,r),r+=o.name.length+1;r<t+i;){var n=tt.bin.rsl(e,r),a=tt.bin.ril(e,r+2);n==16640&&(o.mesh=tt.parse.from3DS._obj_trimesh(e,r,a)),r+=a}return o},tt.parse.from3DS._obj_trimesh=function(e,t,i){for(var o={},r=t+6;r<t+i;){var n=tt.bin.rsl(e,r),a=tt.bin.ril(e,r+2);n==16656&&(o.vertices=tt.parse.from3DS._tri_vertexl(e,r,a)),n==16672&&(o.indices=tt.parse.from3DS._tri_facel1(e,r,a)),n==16704&&(o.uvt=tt.parse.from3DS._tri_mappingcoors(e,r,a)),n==16736&&(o.local=tt.parse.from3DS._tri_local(e,r,a)),r+=a}return o},tt.parse.from3DS._tri_vertexl=function(e,t,i){var o=[],r=t+6,n=tt.bin.rsl(e,r);r+=2;for(var a=0;a<n;a++)o.push(tt.bin.rf(e,r)),o.push(tt.bin.rf(e,r+4)),o.push(tt.bin.rf(e,r+8)),r+=12;return o},tt.parse.from3DS._tri_facel1=function(e,t,i){var o=[],r=t+6,n=tt.bin.rsl(e,r);r+=2;for(var a=0;a<n;a++)o.push(tt.bin.rsl(e,r)),o.push(tt.bin.rsl(e,r+2)),o.push(tt.bin.rsl(e,r+4)),r+=8;return o},tt.parse.from3DS._tri_mappingcoors=function(e,t,i){var o=[],r=t+6,n=tt.bin.rsl(e,r);r+=2;for(var a=0;a<n;a++)o.push(tt.bin.rf(e,r)),o.push(1-tt.bin.rf(e,r+4)),r+=8;return o},tt.parse.from3DS._tri_local=function(e,t,i){var o={},r=t+6;return o.X=[tt.bin.rf(e,r),tt.bin.rf(e,r+4),tt.bin.rf(e,r+8)],r+=12,o.Y=[tt.bin.rf(e,r),tt.bin.rf(e,r+4),tt.bin.rf(e,r+8)],r+=12,o.Z=[tt.bin.rf(e,r),tt.bin.rf(e,r+4),tt.bin.rf(e,r+8)],r+=12,o.C=[tt.bin.rf(e,r),tt.bin.rf(e,r+4),tt.bin.rf(e,r+8)],r+=12,o},tt.parse.fromBIV=function(e){e=new Uint8Array(e);var t={},i={};return i.id=tt.bin.ril(e,0),i.verS=tt.bin.ril(e,4),i.texS=tt.bin.ril(e,8),i.indS=tt.bin.ril(e,12),i.verO=tt.bin.ril(e,16),i.verL=tt.bin.ril(e,20),i.texO=tt.bin.ril(e,24),i.texL=tt.bin.ril(e,28),i.indO=tt.bin.ril(e,32),i.indL=tt.bin.ril(e,36),i.verO!=0&&(t.vertices=tt.parse.fromBIV._readFloats(e,i.verO,i.verL)),i.texO!=0&&(t.uvt=tt.parse.fromBIV._readFloats(e,i.texO,i.texL)),i.indO!=0&&(t.indices=tt.parse.fromBIV._readInts(e,i.indO,i.indL,i.indS)),t},tt.parse.toBIV=function(e){for(var t=0,i=0;i<e.indices.length;i++)t=Math.max(t,e.indices[i]);var o=32;t<=65535&&(o=16);var r=40;e.vertices&&(r+=e.vertices.length*4),e.uvt&&(r+=e.uvt.length*4),e.indices&&(r+=e.indices.length*o/8);var n=new Uint8Array(r);tt.bin.wil(n,0,1769365870),tt.bin.wil(n,4,32),tt.bin.wil(n,8,32),tt.bin.wil(n,12,o);var a=40;return e.vertices&&(tt.bin.wil(n,16,a),tt.bin.wil(n,20,4*e.vertices.length),tt.parse.fromBIV._writeFloats(n,a,e.vertices),a+=4*e.vertices.length),e.uvt&&(tt.bin.wil(n,24,a),tt.bin.wil(n,28,4*e.uvt.length),tt.parse.fromBIV._writeFloats(n,a,e.uvt),a+=4*e.uvt.length),e.indices&&(tt.bin.wil(n,32,a),tt.bin.wil(n,36,4*e.indices.length),tt.parse.fromBIV._writeInts(n,a,e.indices,o)),n.buffer},tt.parse.fromBIV._readFloats=function(e,t,i){for(var o=[],r=0;r<i/4;r++)o.push(tt.bin.rf(e,t+4*r));return o},tt.parse.fromBIV._writeFloats=function(e,t,i){for(var o=0;o<i.length;o++)tt.bin.wf(e,t+4*o,i[o])},tt.parse.fromBIV._readInts=function(e,t,i,o){for(var r=[],n=0;n<i/4;n++)o==16&&r.push(tt.bin.rsl(e,t+2*n)),o==32&&r.push(tt.bin.ril(e,t+4*n));return r},tt.parse.fromBIV._writeInts=function(e,t,i,o){for(var r=0;r<i.length;r++)o==16&&tt.bin.wsl(e,t+2*r,i[r]),o==32&&tt.bin.wil(e,t+4*r,i[r])},tt.gen={},tt.gen.Plane=function(e,t,i,o){i||=1,o||=1;for(var r={verts:[],inds:[],uvt:[]},n=e+1,a=t+1,s=0;s<a;s++)for(var l=0;l<n;l++){var c=-1+2/e*l,d=-1+2/t*s;r.verts.push(c,d,0),r.uvt.push(i*l/e,o*s/t),s<t&&l<e&&r.inds.push(s*n+l,s*n+l+1,(s+1)*n+l,s*n+l+1,(s+1)*n+l,(s+1)*n+l+1)}return r},tt.gen.Cube=function(){return{verts:[-1,1,-1,1,1,-1,-1,-1,-1,1,-1,-1,-1,1,1,1,1,1,-1,-1,1,1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,-1,1,1,1,1,1,-1,1,-1,1,1,-1,-1,-1,1,-1,1,1,-1,-1,1,1,1,1,1,-1,-1,-1,1,-1,-1,-1,-1,1,1,-1,1],inds:[0,1,2,1,2,3,4,5,6,5,6,7,8,9,10,9,10,11,12,13,14,13,14,15,16,17,18,17,18,19,20,21,22,21,22,23],uvt:[1/4,1/4,2/4,1/4,1/4,2/4,2/4,2/4,4/4,1/4,3/4,1/4,4/4,2/4,3/4,2/4,0/4,1/4,1/4,1/4,0/4,2/4,1/4,2/4,3/4,1/4,2/4,1/4,3/4,2/4,2/4,2/4,1/4,1/4,2/4,1/4,1/4,0/4,2/4,0/4,1/4,2/4,2/4,2/4,1/4,3/4,2/4,3/4]}},tt.gen.Sphere=function(e,t){var i={verts:[],inds:[],uvt:[]};2*Math.PI/e,Math.PI/t;for(var o=e+1,r=t+1,n=0;n<r;n++)for(var a=0;a<o;a++){var s=-Math.PI/2+n*Math.PI/t,l=a*2*Math.PI/e,c=Math.cos(s)*Math.cos(l),d=Math.sin(s),u=Math.cos(s)*Math.sin(l);i.verts.push(c,d,u),i.uvt.push(a/e,n/t),n<t&&a<e&&i.inds.push(o*n+a,o*n+a+1,o*(n+1)+a,o*n+a+1,o*(n+1)+a,o*(n+1)+a+1)}return i},tt.mat={},tt.mat.scale=function(e,t,i){return[e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1]},tt.mat.translate=function(e,t,i){return[1,0,0,0,0,1,0,0,0,0,1,0,e,t,i,1]},tt.mat.rotateDeg=function(e,t,i){var o=Math.PI/180;return tt.mat.rotate(e*o,t*o,i*o)},tt.mat.rotate=function(e,t,i){var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],r=e,n=t,a=i,s=Math.cos(r),l=Math.cos(n),c=Math.cos(a),d=Math.sin(r),u=Math.sin(n),A=Math.sin(a);return o[0]=l*c,o[1]=-l*A,o[2]=u,o[4]=s*A+d*u*c,o[5]=s*c-d*u*A,o[6]=-d*l,o[8]=d*A-s*u*c,o[9]=d*c+s*u*A,o[10]=s*l,o},tt.edit={},tt.edit.interpolate=function(e,t,i,o){for(var r=0;r<e.length;r++)i[r]=e[r]+o*(t[r]-e[r])},tt.edit.transform=function(e,t){for(var i=0;i<e.length;i+=3){var o=e[i],r=e[i+1],n=e[i+2];e[i+0]=t[0]*o+t[4]*r+t[8]*n+t[12],e[i+1]=t[1]*o+t[5]*r+t[9]*n+t[13],e[i+2]=t[2]*o+t[6]*r+t[10]*n+t[14]}},tt.edit.unwrap=function(e,t,i){for(var o=Array(Math.floor(e.length/3)*i),r=0;r<e.length;r++)for(var n=0;n<i;n++)o[r*i+n]=t[e[r]*i+n];return o},tt.edit.remap=function(e,t,i,o){for(var r=Array(i.length),n=0;n<e.length;n++)for(var a=0;a<o;a++)r[t[n]*o+a]=i[e[n]*o+a];return r},tt.utils={},tt.utils.getAABB=function(e){for(var t=i=o=999999999,i,o,r=n=a=-t,n,a,s=0;s<e.length;s+=3){var l=e[s+0],c=e[s+1],d=e[s+2];l<t&&(t=l),l>r&&(r=l),c<i&&(i=c),c>n&&(n=c),d<o&&(o=d),c>a&&(a=d)}return{min:{x:t,y:i,z:o},max:{x:r,y:n,z:a}}};function $it(e,t={}){return new Promise(function(i,o){t.src||(console.error("load3DSGeometry: Parameter expected: src"),o());var r=e.canvas.spinner;r.processes++,St.loadArraybuffer(t.src,function(n){n.byteLength||(console.error("load3DSGeometry: no data loaded"),r.processes--,o());var a=tt.parse.from3DS(n).edit.objects[0].mesh,s=a.vertices,l=a.uvt,c=a.indices;r.processes--,i(St.apply(t,{primitive:"triangles",positions:s,normals:null,uv:l,indices:c}))},function(n){console.error("load3DSGeometry: "+n),r.processes--,o()})})}function ert(e,t={}){return new Promise(function(i,o){t.src||(console.error("loadOBJGeometry: Parameter expected: src"),o());var r=e.canvas.spinner;r.processes++,St.loadArraybuffer(t.src,function(n){n.byteLength||(console.error("loadOBJGeometry: no data loaded"),r.processes--,o());for(var a=tt.parse.fromOBJ(n),s=tt.edit.unwrap(a.i_verts,a.c_verts,3),l=tt.edit.unwrap(a.i_norms,a.c_norms,3),c=tt.edit.unwrap(a.i_uvt,a.c_uvt,2),d=new Int32Array(a.i_verts.length),u=0;u<a.i_verts.length;u++)d[u]=u;r.processes--,i(St.apply(t,{primitive:"triangles",positions:s,normals:l.length>0?l:null,autoNormals:l.length===0,uv:c,indices:d}))},function(n){console.error("loadOBJGeometry: "+n),r.processes--,o()})})}function GB(e={}){let t=e.xSize||1;t<0&&(console.error("negative xSize not allowed - will invert"),t*=-1);let i=e.ySize||1;i<0&&(console.error("negative ySize not allowed - will invert"),i*=-1);let o=e.zSize||1;o<0&&(console.error("negative zSize not allowed - will invert"),o*=-1);let r=e.center,n=r?r[0]:0,a=r?r[1]:0,s=r?r[2]:0,l=-t+n,c=-i+a,d=-o+s,u=t+n,A=i+a,h=o+s;return St.apply(e,{positions:[u,A,h,l,A,h,l,c,h,u,c,h,u,A,h,u,c,h,u,c,d,u,A,d,u,A,h,u,A,d,l,A,d,l,A,h,l,A,h,l,A,d,l,c,d,l,c,h,l,c,d,u,c,d,u,c,h,l,c,h,u,c,d,l,c,d,l,A,d,u,A,d],normals:[0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1],uv:[1,0,0,0,0,1,1,1,0,0,0,1,1,1,1,0,1,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0],indices:[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]})}function KB(e={}){let t=e.xSize||1;t<0&&(console.error("negative xSize not allowed - will invert"),t*=-1);let i=e.ySize||1;i<0&&(console.error("negative ySize not allowed - will invert"),i*=-1);let o=e.zSize||1;o<0&&(console.error("negative zSize not allowed - will invert"),o*=-1);let r=e.center,n=r?r[0]:0,a=r?r[1]:0,s=r?r[2]:0,l=-t+n,c=-i+a,d=-o+s,u=t+n,A=i+a,h=o+s;return St.apply(e,{primitive:"lines",positions:[l,c,d,l,c,h,l,A,d,l,A,h,u,c,d,u,c,h,u,A,d,u,A,h],indices:[0,1,1,3,3,2,2,0,4,5,5,7,7,6,6,4,0,4,1,5,2,6,3,7]})}function trt(e={}){return KB({id:e.id,center:[(e.aabb[0]+e.aabb[3])/2,(e.aabb[1]+e.aabb[4])/2,(e.aabb[2]+e.aabb[5])/2],xSize:Math.abs(e.aabb[3]-e.aabb[0])/2,ySize:Math.abs(e.aabb[4]-e.aabb[1])/2,zSize:Math.abs(e.aabb[5]-e.aabb[2])/2})}function v1(e={}){let t=e.radiusTop||1;t<0&&(console.error("negative radiusTop not allowed - will invert"),t*=-1);let i=e.radiusBottom||1;i<0&&(console.error("negative radiusBottom not allowed - will invert"),i*=-1);let o=e.height||1;o<0&&(console.error("negative height not allowed - will invert"),o*=-1);let r=e.radialSegments||32;r<0&&(console.error("negative radialSegments not allowed - will invert"),r*=-1),r<3&&(r=3);let n=e.heightSegments||1;n<0&&(console.error("negative heightSegments not allowed - will invert"),n*=-1),n<1&&(n=1);let a=!!e.openEnded,s=e.center,l=s?s[0]:0,c=s?s[1]:0,d=s?s[2]:0,u=o/2,A=o/n,h=2*Math.PI/r,p=1/r,f=(t-i)/n,m=[],g=[],y=[],v=[],C,x,B,E,D,P,M,R,O,V,z,K=(90-Math.atan(o/(i-t))*180/Math.PI)/90;for(C=0;C<=n;C++)for(D=t-C*f,P=u-C*A,x=0;x<=r;x++)B=Math.sin(x*h),E=Math.cos(x*h),g.push(D*B),g.push(K),g.push(D*E),y.push(x*p),y.push(C*1/n),m.push(D*B+l),m.push(P+c),m.push(D*E+d);for(C=0;C<n;C++)for(x=0;x<=r;x++)M=C*(r+1)+x,R=M+r,v.push(M),v.push(R),v.push(R+1),v.push(M),v.push(R+1),v.push(M+1);if(!a&&t>0){for(O=m.length/3,g.push(0),g.push(1),g.push(0),y.push(.5),y.push(.5),m.push(0+l),m.push(u+c),m.push(0+d),x=0;x<=r;x++)B=Math.sin(x*h),E=Math.cos(x*h),V=.5*Math.sin(x*h)+.5,z=.5*Math.cos(x*h)+.5,g.push(t*B),g.push(1),g.push(t*E),y.push(V),y.push(z),m.push(t*B+l),m.push(u+c),m.push(t*E+d);for(x=0;x<r;x++)s=O,M=O+1+x,v.push(M),v.push(M+1),v.push(s)}if(!a&&i>0){for(O=m.length/3,g.push(0),g.push(-1),g.push(0),y.push(.5),y.push(.5),m.push(0+l),m.push(0-u+c),m.push(0+d),x=0;x<=r;x++)B=Math.sin(x*h),E=Math.cos(x*h),V=.5*Math.sin(x*h)+.5,z=.5*Math.cos(x*h)+.5,g.push(i*B),g.push(-1),g.push(i*E),y.push(V),y.push(z),m.push(i*B+l),m.push(0-u+c),m.push(i*E+d);for(x=0;x<r;x++)s=O,M=O+1+x,v.push(s),v.push(M+1),v.push(M)}return St.apply(e,{positions:m,normals:g,uv:y,indices:v})}function iQ(e={}){let t=e.size||1;t<0&&(console.error("negative size not allowed - will invert"),t*=-1);let i=e.divisions||1;i<0&&(console.error("negative divisions not allowed - will invert"),i*=-1),i<1&&(i=1),t||=10,i||=10;let o=t/i,r=t/2,n=[],a=[],s=0;for(let l=0,c=-r;l<=i;l++,c+=o)n.push(-r),n.push(0),n.push(c),n.push(r),n.push(0),n.push(c),n.push(c),n.push(0),n.push(-r),n.push(c),n.push(0),n.push(r),a.push(s++),a.push(s++),a.push(s++),a.push(s++);return St.apply(e,{primitive:"lines",positions:n,indices:a})}function JB(e={}){let t=e.xSize||1;t<0&&(console.error("negative xSize not allowed - will invert"),t*=-1);let i=e.zSize||1;i<0&&(console.error("negative zSize not allowed - will invert"),i*=-1);let o=e.xSegments||1;o<0&&(console.error("negative xSegments not allowed - will invert"),o*=-1),o<1&&(o=1);let r=e.xSegments||1;r<0&&(console.error("negative zSegments not allowed - will invert"),r*=-1),r<1&&(r=1);let n=e.center,a=n?n[0]:0,s=n?n[1]:0,l=n?n[2]:0,c=t/2,d=i/2,u=Math.floor(o)||1,A=Math.floor(r)||1,h=u+1,p=A+1,f=t/u,m=i/A,g=new Float32Array(h*p*3),y=new Float32Array(h*p*3),v=new Float32Array(h*p*2),C=0,x=0,B,E,D,P,M,R,O;for(B=0;B<p;B++){let z=B*m-d;for(E=0;E<h;E++)D=E*f-c,g[C]=D+a,g[C+1]=s,g[C+2]=-z+l,y[C+1]=1,v[x]=E/u,v[x+1]=(A-B)/A,C+=3,x+=2}C=0;let V=new(g.length/3>65535?Uint32Array:Uint16Array)(u*A*6);for(B=0;B<A;B++)for(E=0;E<u;E++)P=E+h*B,M=E+h*(B+1),R=E+1+h*(B+1),O=E+1+h*B,V[C]=O,V[C+1]=M,V[C+2]=P,V[C+3]=O,V[C+4]=R,V[C+5]=M,C+=6;return St.apply(e,{positions:g,normals:y,uv:v,indices:V})}function y1(e={}){let t=e.lod||1,i=e.center?e.center[0]:0,o=e.center?e.center[1]:0,r=e.center?e.center[2]:0,n=e.radius||1;n<0&&(console.error("negative radius not allowed - will invert"),n*=-1);let a=e.heightSegments||18;a<0&&(console.error("negative heightSegments not allowed - will invert"),a*=-1),a=Math.floor(t*a),a<18&&(a=18);let s=e.widthSegments||18;s<0&&(console.error("negative widthSegments not allowed - will invert"),s*=-1),s=Math.floor(t*s),s<18&&(s=18);let l=[],c=[],d=[],u=[],A,h,p,f,m,g,y,v,C,x,B,E,D,P,M;for(A=0;A<=a;A++)for(p=A*Math.PI/a,f=Math.sin(p),m=Math.cos(p),h=0;h<=s;h++)g=h*2*Math.PI/s,y=Math.sin(g),v=Math.cos(g),C=v*f,x=m,B=y*f,E=1-h/s,D=A/a,c.push(C),c.push(x),c.push(B),d.push(E),d.push(D),l.push(i+n*C),l.push(o+n*x),l.push(r+n*B);for(A=0;A<a;A++)for(h=0;h<s;h++)P=A*(s+1)+h,M=P+s+1,u.push(P+1),u.push(M+1),u.push(M),u.push(P+1),u.push(M),u.push(P);return St.apply(e,{positions:l,normals:c,uv:d,indices:u})}function ZB(e={}){let t=e.radius||1;t<0&&(console.error("negative radius not allowed - will invert"),t*=-1),t*=.5;let i=e.tube||.3;i<0&&(console.error("negative tube not allowed - will invert"),i*=-1);let o=e.radialSegments||32;o<0&&(console.error("negative radialSegments not allowed - will invert"),o*=-1),o<4&&(o=4);let r=e.tubeSegments||24;r<0&&(console.error("negative tubeSegments not allowed - will invert"),r*=-1),r<4&&(r=4);let n=e.arc||Math.PI*2;n<0&&(console.warn("negative arc not allowed - will invert"),n*=-1),n>360&&(n=360);let a=e.center,s=a?a[0]:0,l=a?a[1]:0,c=a?a[2]:0,d=[],u=[],A=[],h=[],p,f,m,g,y,v,C,x;for(x=0;x<=r;x++)for(C=0;C<=o;C++)p=C/o*n,f=.785398+x/r*Math.PI*2,s=t*Math.cos(p),l=t*Math.sin(p),m=(t+i*Math.cos(f))*Math.cos(p),g=(t+i*Math.cos(f))*Math.sin(p),y=i*Math.sin(f),d.push(m+s),d.push(g+l),d.push(y+c),A.push(1-C/o),A.push(x/r),v=b.normalizeVec3(b.subVec3([m,g,y],[s,l,c],[]),[]),u.push(v[0]),u.push(v[1]),u.push(v[2]);let B,E,D,P;for(x=1;x<=r;x++)for(C=1;C<=o;C++)B=(o+1)*x+C-1,E=(o+1)*(x-1)+C-1,D=(o+1)*(x-1)+C,P=(o+1)*x+C,h.push(B),h.push(E),h.push(D),h.push(D),h.push(P),h.push(B);return St.apply(e,{positions:d,normals:u,uv:A,indices:h})}var irt={" ":{width:16,points:[]},"!":{width:10,points:[[5,21],[5,7],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]]},'"':{width:16,points:[[4,21],[4,14],[-1,-1],[12,21],[12,14]]},"#":{width:21,points:[[11,25],[4,-7],[-1,-1],[17,25],[10,-7],[-1,-1],[4,12],[18,12],[-1,-1],[3,6],[17,6]]},$:{width:20,points:[[8,25],[8,-4],[-1,-1],[12,25],[12,-4],[-1,-1],[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]]},"%":{width:24,points:[[21,21],[3,0],[-1,-1],[8,21],[10,19],[10,17],[9,15],[7,14],[5,14],[3,16],[3,18],[4,20],[6,21],[8,21],[10,20],[13,19],[16,19],[19,20],[21,21],[-1,-1],[17,7],[15,6],[14,4],[14,2],[16,0],[18,0],[20,1],[21,3],[21,5],[19,7],[17,7]]},"&":{width:26,points:[[23,12],[23,13],[22,14],[21,14],[20,13],[19,11],[17,6],[15,3],[13,1],[11,0],[7,0],[5,1],[4,2],[3,4],[3,6],[4,8],[5,9],[12,13],[13,14],[14,16],[14,18],[13,20],[11,21],[9,20],[8,18],[8,16],[9,13],[11,10],[16,3],[18,1],[20,0],[22,0],[23,1],[23,2]]},"'":{width:10,points:[[5,19],[4,20],[5,21],[6,20],[6,18],[5,16],[4,15]]},"(":{width:14,points:[[11,25],[9,23],[7,20],[5,16],[4,11],[4,7],[5,2],[7,-2],[9,-5],[11,-7]]},")":{width:14,points:[[3,25],[5,23],[7,20],[9,16],[10,11],[10,7],[9,2],[7,-2],[5,-5],[3,-7]]},"*":{width:16,points:[[8,21],[8,9],[-1,-1],[3,18],[13,12],[-1,-1],[13,18],[3,12]]},"+":{width:26,points:[[13,18],[13,0],[-1,-1],[4,9],[22,9]]},",":{width:10,points:[[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]]},"-":{width:26,points:[[4,9],[22,9]]},".":{width:10,points:[[5,2],[4,1],[5,0],[6,1],[5,2]]},"/":{width:22,points:[[20,25],[2,-7]]},0:{width:20,points:[[9,21],[6,20],[4,17],[3,12],[3,9],[4,4],[6,1],[9,0],[11,0],[14,1],[16,4],[17,9],[17,12],[16,17],[14,20],[11,21],[9,21]]},1:{width:20,points:[[6,17],[8,18],[11,21],[11,0]]},2:{width:20,points:[[4,16],[4,17],[5,19],[6,20],[8,21],[12,21],[14,20],[15,19],[16,17],[16,15],[15,13],[13,10],[3,0],[17,0]]},3:{width:20,points:[[5,21],[16,21],[10,13],[13,13],[15,12],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]]},4:{width:20,points:[[13,21],[3,7],[18,7],[-1,-1],[13,21],[13,0]]},5:{width:20,points:[[15,21],[5,21],[4,12],[5,13],[8,14],[11,14],[14,13],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]]},6:{width:20,points:[[16,18],[15,20],[12,21],[10,21],[7,20],[5,17],[4,12],[4,7],[5,3],[7,1],[10,0],[11,0],[14,1],[16,3],[17,6],[17,7],[16,10],[14,12],[11,13],[10,13],[7,12],[5,10],[4,7]]},7:{width:20,points:[[17,21],[7,0],[-1,-1],[3,21],[17,21]]},8:{width:20,points:[[8,21],[5,20],[4,18],[4,16],[5,14],[7,13],[11,12],[14,11],[16,9],[17,7],[17,4],[16,2],[15,1],[12,0],[8,0],[5,1],[4,2],[3,4],[3,7],[4,9],[6,11],[9,12],[13,13],[15,14],[16,16],[16,18],[15,20],[12,21],[8,21]]},9:{width:20,points:[[16,14],[15,11],[13,9],[10,8],[9,8],[6,9],[4,11],[3,14],[3,15],[4,18],[6,20],[9,21],[10,21],[13,20],[15,18],[16,14],[16,9],[15,4],[13,1],[10,0],[8,0],[5,1],[4,3]]},":":{width:10,points:[[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]]},";":{width:10,points:[[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]]},"<":{width:24,points:[[20,18],[4,9],[20,0]]},"=":{width:26,points:[[4,12],[22,12],[-1,-1],[4,6],[22,6]]},">":{width:24,points:[[4,18],[20,9],[4,0]]},"?":{width:18,points:[[3,16],[3,17],[4,19],[5,20],[7,21],[11,21],[13,20],[14,19],[15,17],[15,15],[14,13],[13,12],[9,10],[9,7],[-1,-1],[9,2],[8,1],[9,0],[10,1],[9,2]]},"@":{width:27,points:[[18,13],[17,15],[15,16],[12,16],[10,15],[9,14],[8,11],[8,8],[9,6],[11,5],[14,5],[16,6],[17,8],[-1,-1],[12,16],[10,14],[9,11],[9,8],[10,6],[11,5],[-1,-1],[18,16],[17,8],[17,6],[19,5],[21,5],[23,7],[24,10],[24,12],[23,15],[22,17],[20,19],[18,20],[15,21],[12,21],[9,20],[7,19],[5,17],[4,15],[3,12],[3,9],[4,6],[5,4],[7,2],[9,1],[12,0],[15,0],[18,1],[20,2],[21,3],[-1,-1],[19,16],[18,8],[18,6],[19,5]]},A:{width:18,points:[[9,21],[1,0],[-1,-1],[9,21],[17,0],[-1,-1],[4,7],[14,7]]},B:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[-1,-1],[4,11],[13,11],[16,10],[17,9],[18,7],[18,4],[17,2],[16,1],[13,0],[4,0]]},C:{width:21,points:[[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5]]},D:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[11,21],[14,20],[16,18],[17,16],[18,13],[18,8],[17,5],[16,3],[14,1],[11,0],[4,0]]},E:{width:19,points:[[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11],[-1,-1],[4,0],[17,0]]},F:{width:18,points:[[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11]]},G:{width:21,points:[[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[18,8],[-1,-1],[13,8],[18,8]]},H:{width:22,points:[[4,21],[4,0],[-1,-1],[18,21],[18,0],[-1,-1],[4,11],[18,11]]},I:{width:8,points:[[4,21],[4,0]]},J:{width:16,points:[[12,21],[12,5],[11,2],[10,1],[8,0],[6,0],[4,1],[3,2],[2,5],[2,7]]},K:{width:21,points:[[4,21],[4,0],[-1,-1],[18,21],[4,7],[-1,-1],[9,12],[18,0]]},L:{width:17,points:[[4,21],[4,0],[-1,-1],[4,0],[16,0]]},M:{width:24,points:[[4,21],[4,0],[-1,-1],[4,21],[12,0],[-1,-1],[20,21],[12,0],[-1,-1],[20,21],[20,0]]},N:{width:22,points:[[4,21],[4,0],[-1,-1],[4,21],[18,0],[-1,-1],[18,21],[18,0]]},O:{width:22,points:[[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21]]},P:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,14],[17,12],[16,11],[13,10],[4,10]]},Q:{width:22,points:[[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21],[-1,-1],[12,4],[18,-2]]},R:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[4,11],[-1,-1],[11,11],[18,0]]},S:{width:20,points:[[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]]},T:{width:16,points:[[8,21],[8,0],[-1,-1],[1,21],[15,21]]},U:{width:22,points:[[4,21],[4,6],[5,3],[7,1],[10,0],[12,0],[15,1],[17,3],[18,6],[18,21]]},V:{width:18,points:[[1,21],[9,0],[-1,-1],[17,21],[9,0]]},W:{width:24,points:[[2,21],[7,0],[-1,-1],[12,21],[7,0],[-1,-1],[12,21],[17,0],[-1,-1],[22,21],[17,0]]},X:{width:20,points:[[3,21],[17,0],[-1,-1],[17,21],[3,0]]},Y:{width:18,points:[[1,21],[9,11],[9,0],[-1,-1],[17,21],[9,11]]},Z:{width:20,points:[[17,21],[3,0],[-1,-1],[3,21],[17,21],[-1,-1],[3,0],[17,0]]},"[":{width:14,points:[[4,25],[4,-7],[-1,-1],[5,25],[5,-7],[-1,-1],[4,25],[11,25],[-1,-1],[4,-7],[11,-7]]},"\\":{width:14,points:[[0,21],[14,-3]]},"]":{width:14,points:[[9,25],[9,-7],[-1,-1],[10,25],[10,-7],[-1,-1],[3,25],[10,25],[-1,-1],[3,-7],[10,-7]]},"^":{width:16,points:[[6,15],[8,18],[10,15],[-1,-1],[3,12],[8,17],[13,12],[-1,-1],[8,17],[8,0]]},_:{width:16,points:[[0,-2],[16,-2]]},"`":{width:10,points:[[6,21],[5,20],[4,18],[4,16],[5,15],[6,16],[5,17]]},a:{width:19,points:[[15,14],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},b:{width:19,points:[[4,21],[4,0],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]]},c:{width:18,points:[[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},d:{width:19,points:[[15,21],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},e:{width:18,points:[[3,8],[15,8],[15,10],[14,12],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},f:{width:12,points:[[10,21],[8,21],[6,20],[5,17],[5,0],[-1,-1],[2,14],[9,14]]},g:{width:19,points:[[15,14],[15,-2],[14,-5],[13,-6],[11,-7],[8,-7],[6,-6],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},h:{width:19,points:[[4,21],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]]},i:{width:8,points:[[3,21],[4,20],[5,21],[4,22],[3,21],[-1,-1],[4,14],[4,0]]},j:{width:10,points:[[5,21],[6,20],[7,21],[6,22],[5,21],[-1,-1],[6,14],[6,-3],[5,-6],[3,-7],[1,-7]]},k:{width:17,points:[[4,21],[4,0],[-1,-1],[14,14],[4,4],[-1,-1],[8,8],[15,0]]},l:{width:8,points:[[4,21],[4,0]]},m:{width:30,points:[[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0],[-1,-1],[15,10],[18,13],[20,14],[23,14],[25,13],[26,10],[26,0]]},n:{width:19,points:[[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]]},o:{width:19,points:[[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3],[16,6],[16,8],[15,11],[13,13],[11,14],[8,14]]},p:{width:19,points:[[4,14],[4,-7],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]]},q:{width:19,points:[[15,14],[15,-7],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},r:{width:13,points:[[4,14],[4,0],[-1,-1],[4,8],[5,11],[7,13],[9,14],[12,14]]},s:{width:17,points:[[14,11],[13,13],[10,14],[7,14],[4,13],[3,11],[4,9],[6,8],[11,7],[13,6],[14,4],[14,3],[13,1],[10,0],[7,0],[4,1],[3,3]]},t:{width:12,points:[[5,21],[5,4],[6,1],[8,0],[10,0],[-1,-1],[2,14],[9,14]]},u:{width:19,points:[[4,14],[4,4],[5,1],[7,0],[10,0],[12,1],[15,4],[-1,-1],[15,14],[15,0]]},v:{width:16,points:[[2,14],[8,0],[-1,-1],[14,14],[8,0]]},w:{width:22,points:[[3,14],[7,0],[-1,-1],[11,14],[7,0],[-1,-1],[11,14],[15,0],[-1,-1],[19,14],[15,0]]},x:{width:17,points:[[3,14],[14,0],[-1,-1],[14,14],[3,0]]},y:{width:16,points:[[2,14],[8,0],[-1,-1],[14,14],[8,0],[6,-4],[4,-6],[2,-7],[1,-7]]},z:{width:17,points:[[14,14],[3,0],[-1,-1],[3,14],[14,14],[-1,-1],[3,0],[14,0]]},"{":{width:14,points:[[9,25],[7,24],[6,23],[5,21],[5,19],[6,17],[7,16],[8,14],[8,12],[6,10],[-1,-1],[7,24],[6,22],[6,20],[7,18],[8,17],[9,15],[9,13],[8,11],[4,9],[8,7],[9,5],[9,3],[8,1],[7,0],[6,-2],[6,-4],[7,-6],[-1,-1],[6,8],[8,6],[8,4],[7,2],[6,1],[5,-1],[5,-3],[6,-5],[7,-6],[9,-7]]},"|":{width:8,points:[[4,25],[4,-7]]},"}":{width:14,points:[[5,25],[7,24],[8,23],[9,21],[9,19],[8,17],[7,16],[6,14],[6,12],[8,10],[-1,-1],[7,24],[8,22],[8,20],[7,18],[6,17],[5,15],[5,13],[6,11],[10,9],[6,7],[5,5],[5,3],[6,1],[7,0],[8,-2],[8,-4],[7,-6],[-1,-1],[8,8],[6,6],[6,4],[7,2],[8,1],[9,-1],[9,-3],[8,-5],[7,-6],[5,-7]]},"~":{width:24,points:[[3,6],[3,8],[4,11],[6,12],[8,12],[10,11],[14,8],[16,7],[18,7],[20,8],[21,10],[-1,-1],[3,8],[4,10],[6,11],[8,11],[10,10],[14,7],[16,6],[18,6],[20,7],[21,10],[21,12]]}};function w1(e={}){var t=e.origin||[0,0,0],i=t[0],o=t[1],r=t[2],n=e.size||1,a=[],s=[],l=e.text;St.isNumeric(l)&&(l=""+l);for(var c=(l||"").split(`
1067
+ .`+U7+yce+vT)},bce=function(L,S){var F=L.ownerDocument;if(F){var _=F.createElement("style");_.textContent=S,L.appendChild(_)}},yT=(function(){function L(){}return L.getOrigin=function(S){var F=L._link;return F?(F.href=S,F.href=F.href,F.protocol+F.hostname+F.port):"about:blank"},L.isSameOrigin=function(S){return L.getOrigin(S)===L._origin},L.setContext=function(S){L._link=S.document.createElement("a"),L._origin=L.getOrigin(S.location.href)},L._origin="about:blank",L})(),Cce=(function(){function L(S,F){this.context=S,this._options=F,this._cache={}}return L.prototype.addImage=function(S){var F=Promise.resolve();return this.has(S)||(N7(S)||Ece(S))&&(this._cache[S]=this.loadImage(S)).catch(function(){}),F},L.prototype.match=function(S){return this._cache[S]},L.prototype.loadImage=function(S){return n(this,void 0,void 0,function(){var F,_,q,$,de=this;return a(this,function(be){switch(be.label){case 0:return F=yT.isSameOrigin(S),_=!O7(S)&&this._options.useCORS===!0&&kn.SUPPORT_CORS_IMAGES&&!F,q=!O7(S)&&!F&&!N7(S)&&typeof this._options.proxy=="string"&&kn.SUPPORT_CORS_XHR&&!_,!F&&this._options.allowTaint===!1&&!O7(S)&&!N7(S)&&!q&&!_?[2]:($=S,q?[4,this.proxy($)]:[3,2]);case 1:$=be.sent(),be.label=2;case 2:return this.context.logger.debug("Added image "+S.substring(0,256)),[4,new Promise(function(ke,We){var lt=new Image;lt.onload=function(){return ke(lt)},lt.onerror=We,(Mce($)||_)&&(lt.crossOrigin="anonymous"),lt.src=$,lt.complete===!0&&setTimeout(function(){return ke(lt)},500),de._options.imageTimeout>0&&setTimeout(function(){return We("Timed out ("+de._options.imageTimeout+"ms) loading image")},de._options.imageTimeout)})];case 3:return[2,be.sent()]}})})},L.prototype.has=function(S){return this._cache[S]!==void 0},L.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},L.prototype.proxy=function(S){var F=this,_=this._options.proxy;if(!_)throw Error("No proxy defined");var q=S.substring(0,256);return new Promise(function($,de){var be=kn.SUPPORT_RESPONSE_TYPE?"blob":"text",ke=new XMLHttpRequest;ke.onload=function(){if(ke.status===200)if(be==="text")$(ke.response);else{var ft=new FileReader;ft.addEventListener("load",function(){return $(ft.result)},!1),ft.addEventListener("error",function(Et){return de(Et)},!1),ft.readAsDataURL(ke.response)}else de("Failed to proxy resource "+q+" with status code "+ke.status)},ke.onerror=de;var We=_.indexOf("?")>-1?"&":"?";if(ke.open("GET",""+_+We+"url="+encodeURIComponent(S)+"&responseType="+be),be!=="text"&&ke instanceof XMLHttpRequest&&(ke.responseType=be),F._options.imageTimeout){var lt=F._options.imageTimeout;ke.timeout=lt,ke.ontimeout=function(){return de("Timed out ("+lt+"ms) proxying "+q)}}ke.send()})},L})(),xce=/^data:image\/svg\+xml/i,Bce=/^data:image\/.*;base64,/i,kce=/^data:image\/.*/i,Ece=function(L){return kn.SUPPORT_SVG_DRAWING||!Pce(L)},O7=function(L){return kce.test(L)},Mce=function(L){return Bce.test(L)},N7=function(L){return L.substr(0,4)==="blob"},Pce=function(L){return L.substr(-3).toLowerCase()==="svg"||xce.test(L)},Yt=(function(){function L(S,F){this.type=0,this.x=S,this.y=F}return L.prototype.add=function(S,F){return new L(this.x+S,this.y+F)},L})(),sp=function(L,S,F){return new Yt(L.x+(S.x-L.x)*F,L.y+(S.y-L.y)*F)},Uv=(function(){function L(S,F,_,q){this.type=1,this.start=S,this.startControl=F,this.endControl=_,this.end=q}return L.prototype.subdivide=function(S,F){var _=sp(this.start,this.startControl,S),q=sp(this.startControl,this.endControl,S),$=sp(this.endControl,this.end,S),de=sp(_,q,S),be=sp(q,$,S),ke=sp(de,be,S);return F?new L(this.start,_,de,ke):new L(ke,be,$,this.end)},L.prototype.add=function(S,F){return new L(this.start.add(S,F),this.startControl.add(S,F),this.endControl.add(S,F),this.end.add(S,F))},L.prototype.reverse=function(){return new L(this.end,this.endControl,this.startControl,this.start)},L})(),ys=function(L){return L.type===1},Ice=(function(){function L(S){var F=S.styles,_=S.bounds,q=kl(F.borderTopLeftRadius,_.width,_.height),$=q[0],de=q[1],be=kl(F.borderTopRightRadius,_.width,_.height),ke=be[0],We=be[1],lt=kl(F.borderBottomRightRadius,_.width,_.height),ft=lt[0],Et=lt[1],ri=kl(F.borderBottomLeftRadius,_.width,_.height),Ut=ri[0],Gt=ri[1],Xi=[];Xi.push(($+ke)/_.width),Xi.push((Ut+ft)/_.width),Xi.push((de+Gt)/_.height),Xi.push((We+Et)/_.height);var mi=Math.max.apply(Math,Xi);mi>1&&($/=mi,de/=mi,ke/=mi,We/=mi,ft/=mi,Et/=mi,Ut/=mi,Gt/=mi);var fi=_.width-ke,to=_.height-Et,Ar=_.width-ft,ki=_.height-Gt,ei=F.borderTopWidth,cr=F.borderRightWidth,er=F.borderBottomWidth,_i=F.borderLeftWidth,jn=Yr(F.paddingTop,S.bounds.width),Ml=Yr(F.paddingRight,S.bounds.width),Tc=Yr(F.paddingBottom,S.bounds.width),lo=Yr(F.paddingLeft,S.bounds.width);this.topLeftBorderDoubleOuterBox=$>0||de>0?so(_.left+_i/3,_.top+ei/3,$-_i/3,de-ei/3,Rr.TOP_LEFT):new Yt(_.left+_i/3,_.top+ei/3),this.topRightBorderDoubleOuterBox=$>0||de>0?so(_.left+fi,_.top+ei/3,ke-cr/3,We-ei/3,Rr.TOP_RIGHT):new Yt(_.left+_.width-cr/3,_.top+ei/3),this.bottomRightBorderDoubleOuterBox=ft>0||Et>0?so(_.left+Ar,_.top+to,ft-cr/3,Et-er/3,Rr.BOTTOM_RIGHT):new Yt(_.left+_.width-cr/3,_.top+_.height-er/3),this.bottomLeftBorderDoubleOuterBox=Ut>0||Gt>0?so(_.left+_i/3,_.top+ki,Ut-_i/3,Gt-er/3,Rr.BOTTOM_LEFT):new Yt(_.left+_i/3,_.top+_.height-er/3),this.topLeftBorderDoubleInnerBox=$>0||de>0?so(_.left+_i*2/3,_.top+ei*2/3,$-_i*2/3,de-ei*2/3,Rr.TOP_LEFT):new Yt(_.left+_i*2/3,_.top+ei*2/3),this.topRightBorderDoubleInnerBox=$>0||de>0?so(_.left+fi,_.top+ei*2/3,ke-cr*2/3,We-ei*2/3,Rr.TOP_RIGHT):new Yt(_.left+_.width-cr*2/3,_.top+ei*2/3),this.bottomRightBorderDoubleInnerBox=ft>0||Et>0?so(_.left+Ar,_.top+to,ft-cr*2/3,Et-er*2/3,Rr.BOTTOM_RIGHT):new Yt(_.left+_.width-cr*2/3,_.top+_.height-er*2/3),this.bottomLeftBorderDoubleInnerBox=Ut>0||Gt>0?so(_.left+_i*2/3,_.top+ki,Ut-_i*2/3,Gt-er*2/3,Rr.BOTTOM_LEFT):new Yt(_.left+_i*2/3,_.top+_.height-er*2/3),this.topLeftBorderStroke=$>0||de>0?so(_.left+_i/2,_.top+ei/2,$-_i/2,de-ei/2,Rr.TOP_LEFT):new Yt(_.left+_i/2,_.top+ei/2),this.topRightBorderStroke=$>0||de>0?so(_.left+fi,_.top+ei/2,ke-cr/2,We-ei/2,Rr.TOP_RIGHT):new Yt(_.left+_.width-cr/2,_.top+ei/2),this.bottomRightBorderStroke=ft>0||Et>0?so(_.left+Ar,_.top+to,ft-cr/2,Et-er/2,Rr.BOTTOM_RIGHT):new Yt(_.left+_.width-cr/2,_.top+_.height-er/2),this.bottomLeftBorderStroke=Ut>0||Gt>0?so(_.left+_i/2,_.top+ki,Ut-_i/2,Gt-er/2,Rr.BOTTOM_LEFT):new Yt(_.left+_i/2,_.top+_.height-er/2),this.topLeftBorderBox=$>0||de>0?so(_.left,_.top,$,de,Rr.TOP_LEFT):new Yt(_.left,_.top),this.topRightBorderBox=ke>0||We>0?so(_.left+fi,_.top,ke,We,Rr.TOP_RIGHT):new Yt(_.left+_.width,_.top),this.bottomRightBorderBox=ft>0||Et>0?so(_.left+Ar,_.top+to,ft,Et,Rr.BOTTOM_RIGHT):new Yt(_.left+_.width,_.top+_.height),this.bottomLeftBorderBox=Ut>0||Gt>0?so(_.left,_.top+ki,Ut,Gt,Rr.BOTTOM_LEFT):new Yt(_.left,_.top+_.height),this.topLeftPaddingBox=$>0||de>0?so(_.left+_i,_.top+ei,Math.max(0,$-_i),Math.max(0,de-ei),Rr.TOP_LEFT):new Yt(_.left+_i,_.top+ei),this.topRightPaddingBox=ke>0||We>0?so(_.left+Math.min(fi,_.width-cr),_.top+ei,fi>_.width+cr?0:Math.max(0,ke-cr),Math.max(0,We-ei),Rr.TOP_RIGHT):new Yt(_.left+_.width-cr,_.top+ei),this.bottomRightPaddingBox=ft>0||Et>0?so(_.left+Math.min(Ar,_.width-_i),_.top+Math.min(to,_.height-er),Math.max(0,ft-cr),Math.max(0,Et-er),Rr.BOTTOM_RIGHT):new Yt(_.left+_.width-cr,_.top+_.height-er),this.bottomLeftPaddingBox=Ut>0||Gt>0?so(_.left+_i,_.top+Math.min(ki,_.height-er),Math.max(0,Ut-_i),Math.max(0,Gt-er),Rr.BOTTOM_LEFT):new Yt(_.left+_i,_.top+_.height-er),this.topLeftContentBox=$>0||de>0?so(_.left+_i+lo,_.top+ei+jn,Math.max(0,$-(_i+lo)),Math.max(0,de-(ei+jn)),Rr.TOP_LEFT):new Yt(_.left+_i+lo,_.top+ei+jn),this.topRightContentBox=ke>0||We>0?so(_.left+Math.min(fi,_.width+_i+lo),_.top+ei+jn,fi>_.width+_i+lo?0:ke-_i+lo,We-(ei+jn),Rr.TOP_RIGHT):new Yt(_.left+_.width-(cr+Ml),_.top+ei+jn),this.bottomRightContentBox=ft>0||Et>0?so(_.left+Math.min(Ar,_.width-(_i+lo)),_.top+Math.min(to,_.height+ei+jn),Math.max(0,ft-(cr+Ml)),Et-(er+Tc),Rr.BOTTOM_RIGHT):new Yt(_.left+_.width-(cr+Ml),_.top+_.height-(er+Tc)),this.bottomLeftContentBox=Ut>0||Gt>0?so(_.left+_i+lo,_.top+ki,Math.max(0,Ut-(_i+lo)),Gt-(er+Tc),Rr.BOTTOM_LEFT):new Yt(_.left+_i+lo,_.top+_.height-(er+Tc))}return L})(),Rr;(function(L){L[L.TOP_LEFT=0]="TOP_LEFT",L[L.TOP_RIGHT=1]="TOP_RIGHT",L[L.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",L[L.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(Rr||={});var so=function(L,S,F,_,q){var $=4*((Math.sqrt(2)-1)/3),de=F*$,be=_*$,ke=L+F,We=S+_;switch(q){case Rr.TOP_LEFT:return new Uv(new Yt(L,We),new Yt(L,We-be),new Yt(ke-de,S),new Yt(ke,S));case Rr.TOP_RIGHT:return new Uv(new Yt(L,S),new Yt(L+de,S),new Yt(ke,We-be),new Yt(ke,We));case Rr.BOTTOM_RIGHT:return new Uv(new Yt(ke,S),new Yt(ke,S+be),new Yt(L+de,We),new Yt(L,We));case Rr.BOTTOM_LEFT:default:return new Uv(new Yt(ke,We),new Yt(ke-de,We),new Yt(L,S+be),new Yt(L,S))}},Ov=function(L){return[L.topLeftBorderBox,L.topRightBorderBox,L.bottomRightBorderBox,L.bottomLeftBorderBox]},Sce=function(L){return[L.topLeftContentBox,L.topRightContentBox,L.bottomRightContentBox,L.bottomLeftContentBox]},Nv=function(L){return[L.topLeftPaddingBox,L.topRightPaddingBox,L.bottomRightPaddingBox,L.bottomLeftPaddingBox]},Dce=(function(){function L(S,F,_){this.offsetX=S,this.offsetY=F,this.matrix=_,this.type=0,this.target=6}return L})(),Hv=(function(){function L(S,F){this.path=S,this.target=F,this.type=1}return L})(),Tce=(function(){function L(S){this.opacity=S,this.type=2,this.target=6}return L})(),Lce=function(L){return L.type===0},wT=function(L){return L.type===1},Rce=function(L){return L.type===2},bT=function(L,S){return L.length===S.length?L.some(function(F,_){return F===S[_]}):!1},_ce=function(L,S,F,_,q){return L.map(function($,de){switch(de){case 0:return $.add(S,F);case 1:return $.add(S+_,F);case 2:return $.add(S+_,F+q);case 3:return $.add(S,F+q)}return $})},CT=(function(){function L(S){this.element=S,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return L})(),xT=(function(){function L(S,F){if(this.container=S,this.parent=F,this.effects=[],this.curves=new Ice(this.container),this.container.styles.opacity<1&&this.effects.push(new Tce(this.container.styles.opacity)),this.container.styles.transform!==null){var _=this.container.bounds.left+this.container.styles.transformOrigin[0].number,q=this.container.bounds.top+this.container.styles.transformOrigin[1].number,$=this.container.styles.transform;this.effects.push(new Dce(_,q,$))}if(this.container.styles.overflowX!==0){var de=Ov(this.curves),be=Nv(this.curves);bT(de,be)?this.effects.push(new Hv(de,6)):(this.effects.push(new Hv(de,2)),this.effects.push(new Hv(be,4)))}}return L.prototype.getEffects=function(S){for(var F=[2,3].indexOf(this.container.styles.position)===-1,_=this.parent,q=this.effects.slice(0);_;){var $=_.effects.filter(function(ke){return!wT(ke)});if(F||_.container.styles.position!==0||!_.parent){if(q.unshift.apply(q,$),F=[2,3].indexOf(_.container.styles.position)===-1,_.container.styles.overflowX!==0){var de=Ov(_.curves),be=Nv(_.curves);bT(de,be)||q.unshift(new Hv(be,6))}}else q.unshift.apply(q,$);_=_.parent}return q.filter(function(ke){return $o(ke.target,S)})},L})(),H7=function(L,S,F,_){L.container.elements.forEach(function(q){var $=$o(q.flags,4),de=$o(q.flags,2),be=new xT(q,L);$o(q.styles.display,2048)&&_.push(be);var ke=$o(q.flags,8)?[]:_;if($||de){var We=$||q.styles.isPositioned()?F:S,lt=new CT(be);if(q.styles.isPositioned()||q.styles.opacity<1||q.styles.isTransformed()){var ft=q.styles.zIndex.order;if(ft<0){var Et=0;We.negativeZIndex.some(function(Ut,Gt){return ft>Ut.element.container.styles.zIndex.order?(Et=Gt,!1):Et>0}),We.negativeZIndex.splice(Et,0,lt)}else if(ft>0){var ri=0;We.positiveZIndex.some(function(Ut,Gt){return ft>=Ut.element.container.styles.zIndex.order?(ri=Gt+1,!1):ri>0}),We.positiveZIndex.splice(ri,0,lt)}else We.zeroOrAutoZIndexOrTransformedOrOpacity.push(lt)}else q.styles.isFloating()?We.nonPositionedFloats.push(lt):We.nonPositionedInlineLevel.push(lt);H7(be,lt,$?lt:F,ke)}else q.styles.isInlineLevel()?S.inlineLevel.push(be):S.nonInlineLevel.push(be),H7(be,S,F,ke);$o(q.flags,8)&&BT(q,ke)})},BT=function(L,S){for(var F=L instanceof I7?L.start:1,_=L instanceof I7?L.reversed:!1,q=0;q<S.length;q++){var $=S[q];$.container instanceof ZD&&typeof $.container.value=="number"&&$.container.value!==0&&(F=$.container.value),$.listValue=ff(F,$.container.styles.listStyleType,!0),F+=_?-1:1}},Fce=function(L){var S=new xT(L,null),F=new CT(S),_=[];return H7(S,F,F,_),BT(S.container,_),F},kT=function(L,S){switch(S){case 0:return ws(L.topLeftBorderBox,L.topLeftPaddingBox,L.topRightBorderBox,L.topRightPaddingBox);case 1:return ws(L.topRightBorderBox,L.topRightPaddingBox,L.bottomRightBorderBox,L.bottomRightPaddingBox);case 2:return ws(L.bottomRightBorderBox,L.bottomRightPaddingBox,L.bottomLeftBorderBox,L.bottomLeftPaddingBox);default:return ws(L.bottomLeftBorderBox,L.bottomLeftPaddingBox,L.topLeftBorderBox,L.topLeftPaddingBox)}},Uce=function(L,S){switch(S){case 0:return ws(L.topLeftBorderBox,L.topLeftBorderDoubleOuterBox,L.topRightBorderBox,L.topRightBorderDoubleOuterBox);case 1:return ws(L.topRightBorderBox,L.topRightBorderDoubleOuterBox,L.bottomRightBorderBox,L.bottomRightBorderDoubleOuterBox);case 2:return ws(L.bottomRightBorderBox,L.bottomRightBorderDoubleOuterBox,L.bottomLeftBorderBox,L.bottomLeftBorderDoubleOuterBox);default:return ws(L.bottomLeftBorderBox,L.bottomLeftBorderDoubleOuterBox,L.topLeftBorderBox,L.topLeftBorderDoubleOuterBox)}},Oce=function(L,S){switch(S){case 0:return ws(L.topLeftBorderDoubleInnerBox,L.topLeftPaddingBox,L.topRightBorderDoubleInnerBox,L.topRightPaddingBox);case 1:return ws(L.topRightBorderDoubleInnerBox,L.topRightPaddingBox,L.bottomRightBorderDoubleInnerBox,L.bottomRightPaddingBox);case 2:return ws(L.bottomRightBorderDoubleInnerBox,L.bottomRightPaddingBox,L.bottomLeftBorderDoubleInnerBox,L.bottomLeftPaddingBox);default:return ws(L.bottomLeftBorderDoubleInnerBox,L.bottomLeftPaddingBox,L.topLeftBorderDoubleInnerBox,L.topLeftPaddingBox)}},Nce=function(L,S){switch(S){case 0:return Vv(L.topLeftBorderStroke,L.topRightBorderStroke);case 1:return Vv(L.topRightBorderStroke,L.bottomRightBorderStroke);case 2:return Vv(L.bottomRightBorderStroke,L.bottomLeftBorderStroke);default:return Vv(L.bottomLeftBorderStroke,L.topLeftBorderStroke)}},Vv=function(L,S){var F=[];return ys(L)?F.push(L.subdivide(.5,!1)):F.push(L),ys(S)?F.push(S.subdivide(.5,!0)):F.push(S),F},ws=function(L,S,F,_){var q=[];return ys(L)?q.push(L.subdivide(.5,!1)):q.push(L),ys(F)?q.push(F.subdivide(.5,!0)):q.push(F),ys(_)?q.push(_.subdivide(.5,!0).reverse()):q.push(_),ys(S)?q.push(S.subdivide(.5,!1).reverse()):q.push(S),q},ET=function(L){var S=L.bounds,F=L.styles;return S.add(F.borderLeftWidth,F.borderTopWidth,-(F.borderRightWidth+F.borderLeftWidth),-(F.borderTopWidth+F.borderBottomWidth))},jv=function(L){var S=L.styles,F=L.bounds,_=Yr(S.paddingLeft,F.width),q=Yr(S.paddingRight,F.width),$=Yr(S.paddingTop,F.width),de=Yr(S.paddingBottom,F.width);return F.add(_+S.borderLeftWidth,$+S.borderTopWidth,-(S.borderRightWidth+S.borderLeftWidth+_+q),-(S.borderTopWidth+S.borderBottomWidth+$+de))},Hce=function(L,S){return L===0?S.bounds:L===2?jv(S):ET(S)},Vce=function(L,S){return L===0?S.bounds:L===2?jv(S):ET(S)},V7=function(L,S,F){var _=Hce(cp(L.styles.backgroundOrigin,S),L),q=Vce(cp(L.styles.backgroundClip,S),L),$=jce(cp(L.styles.backgroundSize,S),F,_),de=$[0],be=$[1],ke=kl(cp(L.styles.backgroundPosition,S),_.width-de,_.height-be);return[Qce(cp(L.styles.backgroundRepeat,S),ke,$,_,q),Math.round(_.left+ke[0]),Math.round(_.top+ke[1]),de,be]},lp=function(L){return Jt(L)&&L.value===uf.AUTO},Qv=function(L){return typeof L=="number"},jce=function(L,S,F){var _=S[0],q=S[1],$=S[2],de=L[0],be=L[1];if(!de)return[0,0];if(pi(de)&&be&&pi(be))return[Yr(de,F.width),Yr(be,F.height)];var ke=Qv($);if(Jt(de)&&(de.value===uf.CONTAIN||de.value===uf.COVER))return Qv($)?F.width/F.height<$==(de.value===uf.COVER)?[F.height*$,F.height]:[F.width,F.width/$]:[F.width,F.height];var We=Qv(_),lt=Qv(q),ft=We||lt;if(lp(de)&&(!be||lp(be)))return We&&lt?[_,q]:!ke&&!ft?[F.width,F.height]:ft&&ke?[We?_:q*$,lt?q:_/$]:[We?_:F.width,lt?q:F.height];if(ke){var Et=0,ri=0;return pi(de)?Et=Yr(de,F.width):pi(be)&&(ri=Yr(be,F.height)),lp(de)?Et=ri*$:(!be||lp(be))&&(ri=Et/$),[Et,ri]}var Ut=null,Gt=null;if(pi(de)?Ut=Yr(de,F.width):be&&pi(be)&&(Gt=Yr(be,F.height)),Ut!==null&&(!be||lp(be))&&(Gt=We&&lt?Ut/_*q:F.height),Gt!==null&&lp(de)&&(Ut=We&&lt?Gt/q*_:F.width),Ut!==null&&Gt!==null)return[Ut,Gt];throw Error("Unable to calculate background-size for element")},cp=function(L,S){var F=L[S];return F===void 0?L[0]:F},Qce=function(L,S,F,_,q){var $=S[0],de=S[1],be=F[0],ke=F[1];switch(L){case 2:return[new Yt(Math.round(_.left),Math.round(_.top+de)),new Yt(Math.round(_.left+_.width),Math.round(_.top+de)),new Yt(Math.round(_.left+_.width),Math.round(ke+_.top+de)),new Yt(Math.round(_.left),Math.round(ke+_.top+de))];case 3:return[new Yt(Math.round(_.left+$),Math.round(_.top)),new Yt(Math.round(_.left+$+be),Math.round(_.top)),new Yt(Math.round(_.left+$+be),Math.round(_.height+_.top)),new Yt(Math.round(_.left+$),Math.round(_.height+_.top))];case 1:return[new Yt(Math.round(_.left+$),Math.round(_.top+de)),new Yt(Math.round(_.left+$+be),Math.round(_.top+de)),new Yt(Math.round(_.left+$+be),Math.round(_.top+de+ke)),new Yt(Math.round(_.left+$),Math.round(_.top+de+ke))];default:return[new Yt(Math.round(q.left),Math.round(q.top)),new Yt(Math.round(q.left+q.width),Math.round(q.top)),new Yt(Math.round(q.left+q.width),Math.round(q.height+q.top)),new Yt(Math.round(q.left),Math.round(q.height+q.top))]}},zce="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",MT="Hidden Text",qce=(function(){function L(S){this._data={},this._document=S}return L.prototype.parseMetrics=function(S,F){var _=this._document.createElement("div"),q=this._document.createElement("img"),$=this._document.createElement("span"),de=this._document.body;_.style.visibility="hidden",_.style.fontFamily=S,_.style.fontSize=F,_.style.margin="0",_.style.padding="0",_.style.whiteSpace="nowrap",de.appendChild(_),q.src=zce,q.width=1,q.height=1,q.style.margin="0",q.style.padding="0",q.style.verticalAlign="baseline",$.style.fontFamily=S,$.style.fontSize=F,$.style.margin="0",$.style.padding="0",$.appendChild(this._document.createTextNode(MT)),_.appendChild($),_.appendChild(q);var be=q.offsetTop-$.offsetTop+2;_.removeChild($),_.appendChild(this._document.createTextNode(MT)),_.style.lineHeight="normal",q.style.verticalAlign="super";var ke=q.offsetTop-_.offsetTop+2;return de.removeChild(_),{baseline:be,middle:ke}},L.prototype.getMetrics=function(S,F){var _=S+" "+F;return this._data[_]===void 0&&(this._data[_]=this.parseMetrics(S,F)),this._data[_]},L})(),PT=(function(){function L(S,F){this.context=S,this.options=F}return L})(),Gce=1e4,Kce=(function(L){o(S,L);function S(F,_){var q=L.call(this,F,_)||this;return q._activeEffects=[],q.canvas=_.canvas?_.canvas:document.createElement("canvas"),q.ctx=q.canvas.getContext("2d"),_.canvas||(q.canvas.width=Math.floor(_.width*_.scale),q.canvas.height=Math.floor(_.height*_.scale),q.canvas.style.width=_.width+"px",q.canvas.style.height=_.height+"px"),q.fontMetrics=new qce(document),q.ctx.scale(q.options.scale,q.options.scale),q.ctx.translate(-_.x,-_.y),q.ctx.textBaseline="bottom",q._activeEffects=[],q.context.logger.debug("Canvas renderer initialized ("+_.width+"x"+_.height+") with scale "+_.scale),q}return S.prototype.applyEffects=function(F){for(var _=this;this._activeEffects.length;)this.popEffect();F.forEach(function(q){return _.applyEffect(q)})},S.prototype.applyEffect=function(F){this.ctx.save(),Rce(F)&&(this.ctx.globalAlpha=F.opacity),Lce(F)&&(this.ctx.translate(F.offsetX,F.offsetY),this.ctx.transform(F.matrix[0],F.matrix[1],F.matrix[2],F.matrix[3],F.matrix[4],F.matrix[5]),this.ctx.translate(-F.offsetX,-F.offsetY)),wT(F)&&(this.path(F.path),this.ctx.clip()),this._activeEffects.push(F)},S.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},S.prototype.renderStack=function(F){return n(this,void 0,void 0,function(){var _;return a(this,function(q){switch(q.label){case 0:return _=F.element.container.styles,_.isVisible()?[4,this.renderStackContent(F)]:[3,2];case 1:q.sent(),q.label=2;case 2:return[2]}})})},S.prototype.renderNode=function(F){return n(this,void 0,void 0,function(){return a(this,function(_){switch(_.label){case 0:if($o(F.container.flags,16))debugger;return F.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(F)]:[3,3];case 1:return _.sent(),[4,this.renderNodeContent(F)];case 2:_.sent(),_.label=3;case 3:return[2]}})})},S.prototype.renderTextWithLetterSpacing=function(F,_,q){var $=this;_===0?this.ctx.fillText(F.text,F.bounds.left,F.bounds.top+q):P7(F.text).reduce(function(de,be){return $.ctx.fillText(be,de,F.bounds.top+q),de+$.ctx.measureText(be).width},F.bounds.left)},S.prototype.createFontStyle=function(F){var _=F.fontVariant.filter(function(de){return de==="normal"||de==="small-caps"}).join(""),q=Xce(F.fontFamily).join(", "),$=hi(F.fontSize)?""+F.fontSize.number+F.fontSize.unit:F.fontSize.number+"px";return[[F.fontStyle,_,F.fontWeight,$,q].join(" "),q,$]},S.prototype.renderTextNode=function(F,_){return n(this,void 0,void 0,function(){var q,$,de,be,ke,We,lt,ft,Et=this;return a(this,function(ri){return q=this.createFontStyle(_),$=q[0],de=q[1],be=q[2],this.ctx.font=$,this.ctx.direction=_.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",ke=this.fontMetrics.getMetrics(de,be),We=ke.baseline,lt=ke.middle,ft=_.paintOrder,F.textBounds.forEach(function(Ut){ft.forEach(function(Gt){switch(Gt){case 0:Et.ctx.fillStyle=dn(_.color),Et.renderTextWithLetterSpacing(Ut,_.letterSpacing,We);var Xi=_.textShadow;Xi.length&&Ut.text.trim().length&&(Xi.slice(0).reverse().forEach(function(mi){Et.ctx.shadowColor=dn(mi.color),Et.ctx.shadowOffsetX=mi.offsetX.number*Et.options.scale,Et.ctx.shadowOffsetY=mi.offsetY.number*Et.options.scale,Et.ctx.shadowBlur=mi.blur.number,Et.renderTextWithLetterSpacing(Ut,_.letterSpacing,We)}),Et.ctx.shadowColor="",Et.ctx.shadowOffsetX=0,Et.ctx.shadowOffsetY=0,Et.ctx.shadowBlur=0),_.textDecorationLine.length&&(Et.ctx.fillStyle=dn(_.textDecorationColor||_.color),_.textDecorationLine.forEach(function(mi){switch(mi){case 1:Et.ctx.fillRect(Ut.bounds.left,Math.round(Ut.bounds.top+We),Ut.bounds.width,1);break;case 2:Et.ctx.fillRect(Ut.bounds.left,Math.round(Ut.bounds.top),Ut.bounds.width,1);break;case 3:Et.ctx.fillRect(Ut.bounds.left,Math.ceil(Ut.bounds.top+lt),Ut.bounds.width,1);break}}));break;case 1:_.webkitTextStrokeWidth&&Ut.text.trim().length&&(Et.ctx.strokeStyle=dn(_.webkitTextStrokeColor),Et.ctx.lineWidth=_.webkitTextStrokeWidth,Et.ctx.lineJoin=window.chrome?"miter":"round",Et.ctx.strokeText(Ut.text,Ut.bounds.left,Ut.bounds.top+We)),Et.ctx.strokeStyle="",Et.ctx.lineWidth=0,Et.ctx.lineJoin="miter";break}})}),[2]})})},S.prototype.renderReplacedElement=function(F,_,q){if(q&&F.intrinsicWidth>0&&F.intrinsicHeight>0){var $=jv(F),de=Nv(_);this.path(de),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(q,0,0,F.intrinsicWidth,F.intrinsicHeight,$.left,$.top,$.width,$.height),this.ctx.restore()}},S.prototype.renderNodeContent=function(F){return n(this,void 0,void 0,function(){var _,q,$,de,be,ke,fi,fi,We,lt,ft,Et,Ar,ri,Ut,ki,Gt,Xi,mi,fi,to,Ar,ki;return a(this,function(ei){switch(ei.label){case 0:this.applyEffects(F.getEffects(4)),_=F.container,q=F.curves,$=_.styles,de=0,be=_.textNodes,ei.label=1;case 1:return de<be.length?(ke=be[de],[4,this.renderTextNode(ke,$)]):[3,4];case 2:ei.sent(),ei.label=3;case 3:return de++,[3,1];case 4:if(!(_ instanceof GD))return[3,8];ei.label=5;case 5:return ei.trys.push([5,7,,8]),[4,this.context.cache.match(_.src)];case 6:return fi=ei.sent(),this.renderReplacedElement(_,q,fi),[3,8];case 7:return ei.sent(),this.context.logger.error("Error loading image "+_.src),[3,8];case 8:if(_ instanceof KD&&this.renderReplacedElement(_,q,_.canvas),!(_ instanceof JD))return[3,12];ei.label=9;case 9:return ei.trys.push([9,11,,12]),[4,this.context.cache.match(_.svg)];case 10:return fi=ei.sent(),this.renderReplacedElement(_,q,fi),[3,12];case 11:return ei.sent(),this.context.logger.error("Error loading svg "+_.svg.substring(0,255)),[3,12];case 12:return _ instanceof $D&&_.tree?(We=new S(this.context,{scale:this.options.scale,backgroundColor:_.backgroundColor,x:0,y:0,width:_.width,height:_.height}),[4,We.render(_.tree)]):[3,14];case 13:lt=ei.sent(),_.width&&_.height&&this.ctx.drawImage(lt,0,0,_.width,_.height,_.bounds.left,_.bounds.top,_.bounds.width,_.bounds.height),ei.label=14;case 14:if(_ instanceof S7&&(ft=Math.min(_.bounds.width,_.bounds.height),_.type===Sv?_.checked&&(this.ctx.save(),this.path([new Yt(_.bounds.left+ft*.39363,_.bounds.top+ft*.79),new Yt(_.bounds.left+ft*.16,_.bounds.top+ft*.5549),new Yt(_.bounds.left+ft*.27347,_.bounds.top+ft*.44071),new Yt(_.bounds.left+ft*.39694,_.bounds.top+ft*.5649),new Yt(_.bounds.left+ft*.72983,_.bounds.top+ft*.23),new Yt(_.bounds.left+ft*.84,_.bounds.top+ft*.34085),new Yt(_.bounds.left+ft*.39363,_.bounds.top+ft*.79)]),this.ctx.fillStyle=dn(WD),this.ctx.fill(),this.ctx.restore()):_.type===Dv&&_.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(_.bounds.left+ft/2,_.bounds.top+ft/2,ft/4,0,Math.PI*2,!0),this.ctx.fillStyle=dn(WD),this.ctx.fill(),this.ctx.restore())),Jce(_)&&_.value.length){switch(Et=this.createFontStyle($),Ar=Et[0],ri=Et[1],Ut=this.fontMetrics.getMetrics(Ar,ri).baseline,this.ctx.font=Ar,this.ctx.fillStyle=dn($.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Wce(_.styles.textAlign),ki=jv(_),Gt=0,_.styles.textAlign){case 1:Gt+=ki.width/2;break;case 2:Gt+=ki.width;break}Xi=ki.add(Gt,0,0,-ki.height/2+1),this.ctx.save(),this.path([new Yt(ki.left,ki.top),new Yt(ki.left+ki.width,ki.top),new Yt(ki.left+ki.width,ki.top+ki.height),new Yt(ki.left,ki.top+ki.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new hf(_.value,Xi),$.letterSpacing,Ut),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!$o(_.styles.display,2048))return[3,20];if(_.styles.listStyleImage===null)return[3,19];if(mi=_.styles.listStyleImage,mi.type!==0)return[3,18];fi=void 0,to=mi.url,ei.label=15;case 15:return ei.trys.push([15,17,,18]),[4,this.context.cache.match(to)];case 16:return fi=ei.sent(),this.ctx.drawImage(fi,_.bounds.left-(fi.width+10),_.bounds.top),[3,18];case 17:return ei.sent(),this.context.logger.error("Error loading list-style-image "+to),[3,18];case 18:return[3,20];case 19:F.listValue&&_.styles.listStyleType!==-1&&(Ar=this.createFontStyle($)[0],this.ctx.font=Ar,this.ctx.fillStyle=dn($.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",ki=new l(_.bounds.left,_.bounds.top+Yr(_.styles.paddingTop,_.bounds.width),_.bounds.width,ED($.lineHeight,$.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new hf(F.listValue,ki),$.letterSpacing,ED($.lineHeight,$.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),ei.label=20;case 20:return[2]}})})},S.prototype.renderStackContent=function(F){return n(this,void 0,void 0,function(){var _,q,mi,$,de,mi,be,ke,mi,We,lt,mi,ft,Et,mi,ri,Ut,mi,Gt,Xi,mi;return a(this,function(fi){switch(fi.label){case 0:if($o(F.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(F.element)];case 1:fi.sent(),_=0,q=F.negativeZIndex,fi.label=2;case 2:return _<q.length?(mi=q[_],[4,this.renderStack(mi)]):[3,5];case 3:fi.sent(),fi.label=4;case 4:return _++,[3,2];case 5:return[4,this.renderNodeContent(F.element)];case 6:fi.sent(),$=0,de=F.nonInlineLevel,fi.label=7;case 7:return $<de.length?(mi=de[$],[4,this.renderNode(mi)]):[3,10];case 8:fi.sent(),fi.label=9;case 9:return $++,[3,7];case 10:be=0,ke=F.nonPositionedFloats,fi.label=11;case 11:return be<ke.length?(mi=ke[be],[4,this.renderStack(mi)]):[3,14];case 12:fi.sent(),fi.label=13;case 13:return be++,[3,11];case 14:We=0,lt=F.nonPositionedInlineLevel,fi.label=15;case 15:return We<lt.length?(mi=lt[We],[4,this.renderStack(mi)]):[3,18];case 16:fi.sent(),fi.label=17;case 17:return We++,[3,15];case 18:ft=0,Et=F.inlineLevel,fi.label=19;case 19:return ft<Et.length?(mi=Et[ft],[4,this.renderNode(mi)]):[3,22];case 20:fi.sent(),fi.label=21;case 21:return ft++,[3,19];case 22:ri=0,Ut=F.zeroOrAutoZIndexOrTransformedOrOpacity,fi.label=23;case 23:return ri<Ut.length?(mi=Ut[ri],[4,this.renderStack(mi)]):[3,26];case 24:fi.sent(),fi.label=25;case 25:return ri++,[3,23];case 26:Gt=0,Xi=F.positiveZIndex,fi.label=27;case 27:return Gt<Xi.length?(mi=Xi[Gt],[4,this.renderStack(mi)]):[3,30];case 28:fi.sent(),fi.label=29;case 29:return Gt++,[3,27];case 30:return[2]}})})},S.prototype.mask=function(F){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(F.slice(0).reverse()),this.ctx.closePath()},S.prototype.path=function(F){this.ctx.beginPath(),this.formatPath(F),this.ctx.closePath()},S.prototype.formatPath=function(F){var _=this;F.forEach(function(q,$){var de=ys(q)?q.start:q;$===0?_.ctx.moveTo(de.x,de.y):_.ctx.lineTo(de.x,de.y),ys(q)&&_.ctx.bezierCurveTo(q.startControl.x,q.startControl.y,q.endControl.x,q.endControl.y,q.end.x,q.end.y)})},S.prototype.renderRepeat=function(F,_,q,$){this.path(F),this.ctx.fillStyle=_,this.ctx.translate(q,$),this.ctx.fill(),this.ctx.translate(-q,-$)},S.prototype.resizeImage=function(F,_,q){if(F.width===_&&F.height===q)return F;var $=(this.canvas.ownerDocument??document).createElement("canvas");return $.width=Math.max(1,_),$.height=Math.max(1,q),$.getContext("2d").drawImage(F,0,0,F.width,F.height,0,0,_,q),$},S.prototype.renderBackgroundImage=function(F){return n(this,void 0,void 0,function(){var _,q,$,de,be,ke;return a(this,function(We){switch(We.label){case 0:_=F.styles.backgroundImage.length-1,q=function(lt){var ft,Et,ri,jn,Pl,Il,lo,za,er,Ut,jn,Pl,Il,lo,za,Gt,Xi,mi,fi,to,Ar,ki,ei,cr,er,_i,jn,Ml,Tc,lo,za,zv,Pl,Il,j7,dp,qv,Q7,z7,gf,q7,G7;return a(this,function(up){switch(up.label){case 0:if(lt.type!==0)return[3,5];ft=void 0,Et=lt.url,up.label=1;case 1:return up.trys.push([1,3,,4]),[4,$.context.cache.match(Et)];case 2:return ft=up.sent(),[3,4];case 3:return up.sent(),$.context.logger.error("Error loading background-image "+Et),[3,4];case 4:return ft&&(ri=V7(F,_,[ft.width,ft.height,ft.width/ft.height]),jn=ri[0],Pl=ri[1],Il=ri[2],lo=ri[3],za=ri[4],er=$.ctx.createPattern($.resizeImage(ft,lo,za),"repeat"),$.renderRepeat(jn,er,Pl,Il)),[3,6];case 5:Vae(lt)?(Ut=V7(F,_,[null,null,null]),jn=Ut[0],Pl=Ut[1],Il=Ut[2],lo=Ut[3],za=Ut[4],Gt=Fae(lt.angle,lo,za),Xi=Gt[0],mi=Gt[1],fi=Gt[2],to=Gt[3],Ar=Gt[4],ki=document.createElement("canvas"),ki.width=lo,ki.height=za,ei=ki.getContext("2d"),cr=ei.createLinearGradient(mi,to,fi,Ar),fD(lt.stops,Xi).forEach(function(mf){return cr.addColorStop(mf.stop,dn(mf.color))}),ei.fillStyle=cr,ei.fillRect(0,0,lo,za),lo>0&&za>0&&(er=$.ctx.createPattern(ki,"repeat"),$.renderRepeat(jn,er,Pl,Il))):jae(lt)&&(_i=V7(F,_,[null,null,null]),jn=_i[0],Ml=_i[1],Tc=_i[2],lo=_i[3],za=_i[4],zv=lt.position.length===0?[qd]:lt.position,Pl=Yr(zv[0],lo),Il=Yr(zv[zv.length-1],za),j7=Uae(lt,Pl,Il,lo,za),dp=j7[0],qv=j7[1],dp>0&&qv>0&&(Q7=$.ctx.createRadialGradient(Ml+Pl,Tc+Il,0,Ml+Pl,Tc+Il,dp),fD(lt.stops,dp*2).forEach(function(mf){return Q7.addColorStop(mf.stop,dn(mf.color))}),$.path(jn),$.ctx.fillStyle=Q7,dp===qv?$.ctx.fill():(z7=F.bounds.left+.5*F.bounds.width,gf=F.bounds.top+.5*F.bounds.height,q7=qv/dp,G7=1/q7,$.ctx.save(),$.ctx.translate(z7,gf),$.ctx.transform(1,0,0,q7,0,0),$.ctx.translate(-z7,-gf),$.ctx.fillRect(Ml,G7*(Tc-gf)+gf,lo,za*G7),$.ctx.restore()))),up.label=6;case 6:return _--,[2]}})},$=this,de=0,be=F.styles.backgroundImage.slice(0).reverse(),We.label=1;case 1:return de<be.length?(ke=be[de],[5,q(ke)]):[3,4];case 2:We.sent(),We.label=3;case 3:return de++,[3,1];case 4:return[2]}})})},S.prototype.renderSolidBorder=function(F,_,q){return n(this,void 0,void 0,function(){return a(this,function($){return this.path(kT(q,_)),this.ctx.fillStyle=dn(F),this.ctx.fill(),[2]})})},S.prototype.renderDoubleBorder=function(F,_,q,$){return n(this,void 0,void 0,function(){var de,be;return a(this,function(ke){switch(ke.label){case 0:return _<3?[4,this.renderSolidBorder(F,q,$)]:[3,2];case 1:return ke.sent(),[2];case 2:return de=Uce($,q),this.path(de),this.ctx.fillStyle=dn(F),this.ctx.fill(),be=Oce($,q),this.path(be),this.ctx.fill(),[2]}})})},S.prototype.renderNodeBackgroundAndBorders=function(F){return n(this,void 0,void 0,function(){var _,q,$,de,be,ke,We,lt,ft=this;return a(this,function(Et){switch(Et.label){case 0:return this.applyEffects(F.getEffects(2)),_=F.container.styles,q=!Kd(_.backgroundColor)||_.backgroundImage.length,$=[{style:_.borderTopStyle,color:_.borderTopColor,width:_.borderTopWidth},{style:_.borderRightStyle,color:_.borderRightColor,width:_.borderRightWidth},{style:_.borderBottomStyle,color:_.borderBottomColor,width:_.borderBottomWidth},{style:_.borderLeftStyle,color:_.borderLeftColor,width:_.borderLeftWidth}],de=Zce(cp(_.backgroundClip,0),F.curves),q||_.boxShadow.length?(this.ctx.save(),this.path(de),this.ctx.clip(),Kd(_.backgroundColor)||(this.ctx.fillStyle=dn(_.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(F.container)]):[3,2];case 1:Et.sent(),this.ctx.restore(),_.boxShadow.slice(0).reverse().forEach(function(ri){ft.ctx.save();var Ut=Ov(F.curves),Gt=ri.inset?0:Gce,Xi=_ce(Ut,-Gt+(ri.inset?1:-1)*ri.spread.number,(ri.inset?1:-1)*ri.spread.number,ri.spread.number*(ri.inset?-2:2),ri.spread.number*(ri.inset?-2:2));ri.inset?(ft.path(Ut),ft.ctx.clip(),ft.mask(Xi)):(ft.mask(Ut),ft.ctx.clip(),ft.path(Xi)),ft.ctx.shadowOffsetX=ri.offsetX.number+Gt,ft.ctx.shadowOffsetY=ri.offsetY.number,ft.ctx.shadowColor=dn(ri.color),ft.ctx.shadowBlur=ri.blur.number,ft.ctx.fillStyle=ri.inset?dn(ri.color):"rgba(0,0,0,1)",ft.ctx.fill(),ft.ctx.restore()}),Et.label=2;case 2:be=0,ke=0,We=$,Et.label=3;case 3:return ke<We.length?(lt=We[ke],lt.style!==0&&!Kd(lt.color)&&lt.width>0?lt.style===2?[4,this.renderDashedDottedBorder(lt.color,lt.width,be,F.curves,2)]:[3,5]:[3,11]):[3,13];case 4:return Et.sent(),[3,11];case 5:return lt.style===3?[4,this.renderDashedDottedBorder(lt.color,lt.width,be,F.curves,3)]:[3,7];case 6:return Et.sent(),[3,11];case 7:return lt.style===4?[4,this.renderDoubleBorder(lt.color,lt.width,be,F.curves)]:[3,9];case 8:return Et.sent(),[3,11];case 9:return[4,this.renderSolidBorder(lt.color,be,F.curves)];case 10:Et.sent(),Et.label=11;case 11:be++,Et.label=12;case 12:return ke++,[3,3];case 13:return[2]}})})},S.prototype.renderDashedDottedBorder=function(F,_,q,$,de){return n(this,void 0,void 0,function(){var be,ke,We,lt,ft,Et,ri,Ut,Gt,Xi,mi,fi,to,Ar,ki,ei,ki,ei;return a(this,function(cr){return this.ctx.save(),be=Nce($,q),ke=kT($,q),de===2&&(this.path(ke),this.ctx.clip()),ys(ke[0])?(We=ke[0].start.x,lt=ke[0].start.y):(We=ke[0].x,lt=ke[0].y),ys(ke[1])?(ft=ke[1].end.x,Et=ke[1].end.y):(ft=ke[1].x,Et=ke[1].y),ri=Math.abs(q===0||q===2?We-ft:lt-Et),this.ctx.beginPath(),de===3?this.formatPath(be):this.formatPath(ke.slice(0,2)),Ut=_<3?_*3:_*2,Gt=_<3?_*2:_,de===3&&(Ut=_,Gt=_),Xi=!0,ri<=Ut*2?Xi=!1:ri<=Ut*2+Gt?(mi=ri/(2*Ut+Gt),Ut*=mi,Gt*=mi):(fi=Math.floor((ri+Gt)/(Ut+Gt)),to=(ri-fi*Ut)/(fi-1),Ar=(ri-(fi+1)*Ut)/fi,Gt=Ar<=0||Math.abs(Gt-to)<Math.abs(Gt-Ar)?to:Ar),Xi&&(de===3?this.ctx.setLineDash([0,Ut+Gt]):this.ctx.setLineDash([Ut,Gt])),de===3?(this.ctx.lineCap="round",this.ctx.lineWidth=_):this.ctx.lineWidth=_*2+1.1,this.ctx.strokeStyle=dn(F),this.ctx.stroke(),this.ctx.setLineDash([]),de===2&&(ys(ke[0])&&(ki=ke[3],ei=ke[0],this.ctx.beginPath(),this.formatPath([new Yt(ki.end.x,ki.end.y),new Yt(ei.start.x,ei.start.y)]),this.ctx.stroke()),ys(ke[1])&&(ki=ke[1],ei=ke[2],this.ctx.beginPath(),this.formatPath([new Yt(ki.end.x,ki.end.y),new Yt(ei.start.x,ei.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},S.prototype.render=function(F){return n(this,void 0,void 0,function(){var _;return a(this,function(q){switch(q.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=dn(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),_=Fce(F),[4,this.renderStack(_)];case 1:return q.sent(),this.applyEffects([]),[2,this.canvas]}})})},S})(PT),Jce=function(L){return L instanceof XD||L instanceof YD?!0:L instanceof S7&&L.type!==Dv&&L.type!==Sv},Zce=function(L,S){switch(L){case 0:return Ov(S);case 2:return Sce(S);default:return Nv(S)}},Wce=function(L){switch(L){case 1:return"center";case 2:return"right";default:return"left"}},Yce=["-apple-system","system-ui"],Xce=function(L){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?L.filter(function(S){return Yce.indexOf(S)===-1}):L},$ce=(function(L){o(S,L);function S(F,_){var q=L.call(this,F,_)||this;return q.canvas=_.canvas?_.canvas:document.createElement("canvas"),q.ctx=q.canvas.getContext("2d"),q.options=_,q.canvas.width=Math.floor(_.width*_.scale),q.canvas.height=Math.floor(_.height*_.scale),q.canvas.style.width=_.width+"px",q.canvas.style.height=_.height+"px",q.ctx.scale(q.options.scale,q.options.scale),q.ctx.translate(-_.x,-_.y),q.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+_.width+"x"+_.height+" at "+_.x+","+_.y+") with scale "+_.scale),q}return S.prototype.render=function(F){return n(this,void 0,void 0,function(){var _,q;return a(this,function($){switch($.label){case 0:return _=M7(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,F),[4,ede(_)];case 1:return q=$.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=dn(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(q,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},S})(PT),ede=function(L){return new Promise(function(S,F){var _=new Image;_.onload=function(){S(_)},_.onerror=F,_.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(L))})},tde=(function(){function L(S){var F=S.id,_=S.enabled;this.id=F,this.enabled=_,this.start=Date.now()}return L.prototype.debug=function(){var S=[...arguments];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,s([this.id,this.getTime()+"ms"],S)):this.info.apply(this,S))},L.prototype.getTime=function(){return Date.now()-this.start},L.prototype.info=function(){var S=[...arguments];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,s([this.id,this.getTime()+"ms"],S))},L.prototype.warn=function(){var S=[...arguments];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,s([this.id,this.getTime()+"ms"],S)):this.info.apply(this,S))},L.prototype.error=function(){var S=[...arguments];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,s([this.id,this.getTime()+"ms"],S)):this.info.apply(this,S))},L.instances={},L})(),ide=(function(){function L(S,F){this.windowBounds=F,this.instanceName="#"+L.instanceCount++,this.logger=new tde({id:this.instanceName,enabled:S.logging}),this.cache=S.cache??new Cce(this,S)}return L.instanceCount=1,L})(),rde=function(L,S){return S===void 0&&(S={}),ode(L,S)};typeof window<"u"&&yT.setContext(window);var ode=function(L,S){return n(void 0,void 0,void 0,function(){var F,_,q,$,de,be,ke,We,lt,ft,Et,ri,Ut,Gt,Xi,mi,fi,to,Ar,ki,cr,ei,cr;return a(this,function(er){switch(er.label){case 0:if(!L||typeof L!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(F=L.ownerDocument,!F)throw Error("Element is not attached to a Document");if(_=F.defaultView,!_)throw Error("Document is not attached to a Window");return q={allowTaint:S.allowTaint??!1,imageTimeout:S.imageTimeout??15e3,proxy:S.proxy,useCORS:S.useCORS??!1},$=r({logging:S.logging??!0,cache:S.cache},q),de={windowWidth:S.windowWidth??_.innerWidth,windowHeight:S.windowHeight??_.innerHeight,scrollX:S.scrollX??_.pageXOffset,scrollY:S.scrollY??_.pageYOffset},be=new l(de.scrollX,de.scrollY,de.windowWidth,de.windowHeight),ke=new ide($,be),We=S.foreignObjectRendering??!1,lt={allowTaint:S.allowTaint??!1,onclone:S.onclone,ignoreElements:S.ignoreElements,inlineImages:We,copyStyles:We},ke.logger.debug("Starting document clone with size "+be.width+"x"+be.height+" scrolled to "+-be.left+","+-be.top),ft=new mT(ke,L,lt),Et=ft.clonedReferenceElement,Et?[4,ft.toIFrame(F,be)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return ri=er.sent(),Ut=T7(Et)||nce(Et)?d(Et.ownerDocument):c(ke,Et),Gt=Ut.width,Xi=Ut.height,mi=Ut.left,fi=Ut.top,to=nde(ke,Et,S.backgroundColor),Ar={canvas:S.canvas,backgroundColor:to,scale:S.scale??_.devicePixelRatio??1,x:(S.x??0)+mi,y:(S.y??0)+fi,width:S.width??Math.ceil(Gt),height:S.height??Math.ceil(Xi)},We?(ke.logger.debug("Document cloned, using foreign object rendering"),cr=new $ce(ke,Ar),[4,cr.render(Et)]):[3,3];case 2:return ki=er.sent(),[3,5];case 3:return ke.logger.debug("Document cloned, element located at "+mi+","+fi+" with size "+Gt+"x"+Xi+" using computed rendering"),ke.logger.debug("Starting DOM parsing"),ei=tT(ke,Et),to===ei.styles.backgroundColor&&(ei.styles.backgroundColor=Sc.TRANSPARENT),ke.logger.debug("Starting renderer for element at "+Ar.x+","+Ar.y+" with size "+Ar.width+"x"+Ar.height),cr=new Kce(ke,Ar),[4,cr.render(ei)];case 4:ki=er.sent(),er.label=5;case 5:return(S.removeContainer??!0)&&(mT.destroy(ri)||ke.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),ke.logger.debug("Finished rendering"),[2,ki]}})})},nde=function(L,S,F){var _=S.ownerDocument,q=_.documentElement?df(L,getComputedStyle(_.documentElement).backgroundColor):Sc.TRANSPARENT,$=_.body?df(L,getComputedStyle(_.body).backgroundColor):Sc.TRANSPARENT,de=typeof F=="string"?df(L,F):F===null?Sc.TRANSPARENT:4294967295;return S===_.documentElement?Kd(q)?Kd($)?de:$:q:de};return rde}))}))(),1);async function O5(e){let t=!1,i,o;document.fullscreenElement===e&&(t=!0,i=e.style.width,o=e.style.height,e.style.width="100vw",e.style.height="100vh");let r=await(0,U5.default)(e);return t&&(e.style.width=i,e.style.height=o),r.toDataURL()}var g$e={props:{elements:{type:Array,required:!0},shortcuts:{type:Array,required:!0}}},m$e={class:"shortcuts-modal"},v$e={class:"shortcuts-modal__title"},y$e={class:"shortcuts-modal__content"},w$e={class:"shortcuts-modal__content-left"},b$e={class:"shortcuts-modal__content-left__element__image"},C$e={class:"shortcuts-modal__content-left__element__text"},x$e={class:"shortcuts-modal__content-right"},B$e={class:"shortcuts-modal__content-right__element__shortcut"},k$e={key:0,class:"letter"},E$e={key:1,class:"flex items-center"},M$e={class:"maj"},P$e={class:"icon"},I$e={key:2,class:"flex items-center"},S$e={class:"icon"},D$e={key:3,class:"flex items-center"},T$e={class:"icon"},L$e={class:"shortcuts-modal__content-right__element__text"},R$e={class:"shortcuts-modal__footer"};function _$e(e,t,i,o,r,n){let a=I("BIMDataIllustration"),s=I("BIMDataIconAlt"),l=I("BIMDataButton");return k(),N("div",m$e,[w("div",v$e,[w("span",null,[Pt(e.$slots,"title",{},void 0,!0)])]),w("div",y$e,[w("div",w$e,[(k(!0),N(ut,null,Vt(i.elements,c=>(k(),N("div",{key:c.title,class:"shortcuts-modal__content-left__element"},[w("div",b$e,[T(a,{name:c.image,x:"200",y:"200"},null,8,["name"])]),w("div",C$e,[w("h3",null,G(c.title),1),w("p",null,G(c.text),1)])]))),128))]),w("div",x$e,[(k(!0),N(ut,null,Vt(i.shortcuts,c=>(k(),N("div",{key:c.text,class:"shortcuts-modal__content-right__element"},[w("div",B$e,[c.letter?(k(),N("span",k$e,G(c.letter),1)):le("",!0),c.maj?(k(),N("div",E$e,[w("span",M$e,[T(s,{size:"xxs",class:"fill-primary"})]),t[1]||=w("span",{class:"more"},"+",-1),w("div",P$e,[T(a,{name:c.illustration,x:"23",y:"30"},null,8,["name"])])])):le("",!0),c.alt?(k(),N("div",I$e,[t[2]||=w("span",{class:"alt"}," alt ",-1),t[3]||=w("span",{class:"more"},"+",-1),w("div",S$e,[T(a,{name:c.illustration,x:"23",y:"30"},null,8,["name"])])])):le("",!0),c.shift?(k(),N("div",D$e,[t[4]||=w("span",{class:"alt"}," shift ",-1),t[5]||=w("span",{class:"more"},"+",-1),w("div",T$e,[T(a,{name:c.illustration,x:"23",y:"30"},null,8,["name"])])])):le("",!0)]),w("div",L$e,G(c.text),1)]))),128))])]),w("div",R$e,[T(l,{fill:"",color:"primary",radius:"",width:"166px",onClick:t[0]||=c=>e.$emit("close")},{default:j(()=>[nt(G(e.$t("shortcuts-helper.btn")),1)]),_:1})])])}var N5=Q(g$e,[["render",_$e],["__scopeId","data-v-e7d92a04"]]),F$e={components:{ShortcutsModal:N5},data(){return{elements:[{image:"shortcutMove2D",title:this.$t("shortcuts-helper.title_move"),text:this.$t("shortcuts-helper.text_move")},{image:"shortcutRotate2D",title:this.$t("shortcuts-helper.title_rotate_2d"),text:this.$t("shortcuts-helper.text_rotate_2d")},{image:"shortcutZoom2D",title:this.$t("shortcuts-helper.title_zoom"),text:this.$t("shortcuts-helper.text_zoom_2d")},{image:"shortcutOpen2D",title:this.$t("shortcuts-helper.title_open"),text:this.$t("shortcuts-helper.text_open_2d")}],shortcuts:[{letter:"F",text:this.$t("context_menu.fit_view")},{letter:"C",text:this.$t("context_menu.select_all")},{letter:"V",text:this.$t("context_menu.deselect_all")},{letter:"H",text:this.$t("context_menu.hide")},{letter:"Y",text:this.$t("context_menu.select_similar")},{letter:"R",text:this.$t("context_menu.show_all")},{alt:!0,text:this.$t("shortcuts-helper.shortcut_open"),illustration:"click"},{shift:!0,text:this.$t("shortcuts-helper.shortcut_multiselect"),illustration:"click"}]}}};function U$e(e,t,i,o,r,n){let a=I("ShortcutsModal");return k(),W(a,{class:"bimdata-shortcuts2d-helper",elements:r.elements,shortcuts:r.shortcuts},{title:j(()=>[nt(G(e.$t("shortcuts-helper.title_modal_2d")),1)]),_:1},8,["elements","shortcuts"])}var O$e=Q(F$e,[["render",U$e],["__scopeId","data-v-9a9c15e3"]]);function H5(e=null){let t=bt("$viewer");e??=t.localContext;let i=Ui(Array.from(t.state.annotations)),o=[t.state.hub.on("annotation-added",({annotation:r})=>{i.value.push(r),kA(i)}),t.state.hub.on("annotation-updated",()=>{kA(i)}),t.state.hub.on("annotation-removed",({annotation:r})=>{i.value=i.value.filter(n=>n.id!==r.id)})];return $i(()=>o.forEach(r=>t.state.hub.off(r))),je(()=>i.value.filter(r=>r.modelIds.length===0?!0:r.modelIds.some(n=>e.loadedModelIds.includes(n))))}var _B=e=>t=>{t.preventDefault();let i=new CustomEvent("wheel",{bubbles:!0,cancelable:!0,detail:t});i.deltaY=t.deltaY,i.clientX=t.clientX,i.clientY=t.clientY,e.dispatchEvent(i)},V5=Q({__name:"AnnotationWrapper",props:{annotation:{type:Object,required:!0},canvas:{type:HTMLCanvasElement,required:!0}},emits:["annotation-drag"],setup(e,{emit:t}){let i=e,o=t,r=pe(null),n=()=>r.value?.querySelector(i.annotation.grabberSelector)??r.value,a=_B(i.canvas),s=!1,l=u=>{u.button!==2&&(u.targetTouches&&(u.stopPropagation(),u.preventDefault()),i.annotation.draggable&&(document.addEventListener("mouseup",c),document.addEventListener("touchend",c),document.addEventListener("touchcancel",c),document.addEventListener("mousemove",d),document.addEventListener("touchmove",d,{passive:!1}),i.annotation.emit("drag-start",{nativeEvent:u})))},c=u=>{i.annotation.draggable&&(document.removeEventListener("mousemove",d),document.removeEventListener("touchmove",d),s&&(s=!1,i.annotation.emit("drag-end",{nativeEvent:u})))},d=u=>{u.targetTouches&&(u.stopPropagation(),u.preventDefault()),i.annotation.draggable&&(u.targetTouches&&(u.clientX=u.targetTouches[0].clientX,u.clientY=u.targetTouches[0].clientY),o("annotation-drag",u),i.annotation.emit("drag",{nativeEvent:u}),s=!0)};return Di(()=>{n()?.addEventListener("mousedown",l),n()?.addEventListener("touchstart",l,{passive:!1})}),Ws(()=>{n()?.removeEventListener("mousedown",l),n()?.removeEventListener("touchstart",l)}),(u,A)=>(k(),N("div",{ref_key:"wrapper",ref:r,class:"annotation-wrapper",onWheel:A[0]||=(...h)=>mt(a)&&mt(a)(...h)},[(k(),W(qr(e.annotation.component),la(e.annotation.props,{annotation:e.annotation}),null,16,["annotation"]))],544))}},[["__scopeId","data-v-840c20b2"]]),N$e={class:"annotations-2d"},FB=Q({__name:"Annotations2D",props:{context:{type:Object,default:null}},setup(e){let t=e,i=bt("$viewer"),o=t.context;o||=i.localContext;let r=o.viewer,n=r.viewer??r.engine,a=n.canvas,s=H5(o),l=je(()=>s.value.filter(u=>!r.selectedStorey||u.z>=r.selectedStorey.absoluteElevation&&u.z<r.selectedStorey.absoluteTopElevation));n.camera.on("update",()=>kA(s));let c=(u,A)=>{let{x:h,y:p}=a.getBoundingClientRect(),{clientX:f,clientY:m}=A,{x:g,y}=n.camera.getPosition({x:f-h,y:m-p});r.ui?.highlightOnHover===!0&&(r.ui.highlightOnHover=!1,setTimeout(()=>r.ui.highlightOnHover=!0,300)),i.state.highlightedObjects.length>0&&i.state.unhighlightObjects(i.state.highlightedObjects.map(v=>v.id)),Object.assign(u,{x:g,y})},d=u=>{let{x:A,y:h}=n.camera.getCanvasPosition(u);return`left: ${A}px; top: ${h}px;`};return(u,A)=>(k(),N("div",N$e,[(k(!0),N(ut,null,Vt(l.value,h=>(k(),W(V5,{key:h.instanceId,annotation:h,canvas:mt(a),style:ve(d(h)),onAnnotationDrag:p=>c(h,p)},null,8,["annotation","canvas","style","onAnnotationDrag"]))),128))]))}},[["__scopeId","data-v-87f776fe"]]),H$e={props:{autoOpen:{type:Boolean,default:!0}},setup(e){let{localContext:t}=bt("$viewer"),i=t.viewer?.plugin.name,o=pe(!0),r=je(()=>t.loadedModels),n=pe(0),a=je(()=>r.value[n.value]||{storeys:[]}),s=je(()=>t.selectedStorey),l=pe(!1),c=()=>{l.value=!l.value},d=g=>g.key===s.value?.key,u=g=>{d(g)||t.selectStorey(g)},A=je(()=>t.shownPlans),h=g=>A.value.some(y=>y.key===g.key),{loadingPlans:p}=tj(t),f=g=>p.value.some(y=>y.key===g.key),m=ko(new Set);return xt([r,a],()=>{r.value.length===0||r.value.length===1&&a.value.type!=="METABUILDING"&&a.value.storeys.length<2&&(a.value.storeys[0]?.plans.length??0)===0?o.value=!1:o.value=!0,o.value&&(i==="viewer2d"||i==="plan"||i==="photosphere")&&(l.value=e.autoOpen)},{immediate:!0}),{currentModelIndex:n,currentModel:a,storeyPlanShown:m,storeyListOpen:l,isVisible:o,models:r,focus:()=>{a.value&&(l.value||=!0,s.value&&m.add(s.value.uuid))},selectStorey:u,togglePlan:g=>{A.value.some(y=>y.key===g.key)?t.hidePlan(g):t.showPlan(g)},togglePlansList:g=>{m.has(g.key)?m.delete(g.key):m.add(g.key)},toggleStoreysList:c,isStoreySelected:d,isPlanShown:h,isPlanLoading:f}}},V$e={class:"storey-selector"},j$e={class:"storey-selector__list"},Q$e=["onClick"],z$e={class:"name"},q$e={class:"count"},G$e={class:"storey-selector__list__entry__content plan-selector__list"},K$e=["onClick"],J$e={key:0,class:"loader"},Z$e={class:"storey-selector__model-switcher"},W$e={class:"actions"};function Y$e(e,t,i,o,r,n){let a=I("BIMDataRadio"),s=I("BIMDataIconStorey"),l=I("BIMDataTextbox"),c=I("BIMDataIconChevron"),d=I("BIMDataButton"),u=I("BIMDataCheckbox"),A=I("BIMDataSpinner"),h=I("BIMDataFileIcon");return k(),N("div",V$e,[T(Qi,{name:"slide-fade-down"},{default:j(()=>[Tt(w("div",j$e,[(k(!0),N(ut,null,Vt(o.currentModel.storeys.slice(),p=>(k(),N("div",{key:p.key,class:"storey-selector__list__entry"},[T(a,{"model-value":o.isStoreySelected(p),"onUpdate:modelValue":f=>o.selectStorey(p)},null,8,["model-value","onUpdate:modelValue"]),w("div",{class:"storey-selector__list__entry__line",onClick:f=>o.selectStorey(p)},[T(s,{size:"xs"}),w("span",z$e,[T(l,{text:p.name},null,8,["text"])]),p.plans.length>0?(k(),N(ut,{key:0},[w("span",q$e,G(p.plans.length),1),T(d,{width:"26px",height:"26px",ghost:"",rounded:"",icon:"",onClick:Dt(f=>o.togglePlansList(p),["stop"])},{default:j(()=>[T(c,{size:"xxs",rotate:o.storeyPlanShown.has(p.key)?90:0,style:{transition:"transform 0.1s linear"}},null,8,["rotate"])]),_:2},1032,["onClick"])],64)):le("",!0)],8,Q$e),T(Qi,{name:"slide-fade-up"},{default:j(()=>[Tt(w("div",G$e,[(k(!0),N(ut,null,Vt(p.plans,f=>(k(),N("div",{key:`${f.key}`,class:"plan-selector__list__entry"},[T(u,{class:"plan-selector__list__entry__checkbox",disabled:!o.isStoreySelected(p)||o.isPlanLoading(f),"model-value":o.isPlanShown(f),"onUpdate:modelValue":m=>o.togglePlan(f)},null,8,["disabled","model-value","onUpdate:modelValue"]),w("div",{class:"plan-selector__list__entry__line",style:{cursor:"pointer"},onClick:Dt(m=>{o.isStoreySelected(p)&&!o.isPlanLoading(f)&&o.togglePlan(f)},["stop"])},[o.isPlanLoading(f)?(k(),N("span",J$e,[T(A)])):(k(),W(h,{key:1,"file-name":f.plan.document?.file_name||f.plan.name,size:14},null,8,["file-name"])),T(l,{"max-width":"200px",text:f.plan.name},null,8,["text"])],8,K$e)]))),128))],512),[[ui,o.storeyPlanShown.has(p.key)]])]),_:2},1024)]))),128))],512),[[ui,o.storeyListOpen&&o.isVisible]])]),_:1}),Tt(w("div",Z$e,[T(d,{width:"26px",height:"26px",ghost:"",radius:"",icon:"",disabled:o.currentModel.storeys.length===0,onClick:o.toggleStoreysList},{default:j(()=>[T(c,{size:"xxs",rotate:o.storeyListOpen?-90:0,style:{transition:"transform 0.1s linear"}},null,8,["rotate"])]),_:1},8,["disabled","onClick"]),w("span",{class:"name",onClick:t[0]||=(...p)=>o.toggleStoreysList&&o.toggleStoreysList(...p)},[T(l,{text:o.currentModel.name,"tooltip-position":"top"},null,8,["text"])]),w("span",W$e,[T(d,{width:"26px",height:"26px",ghost:"",rounded:"",icon:"",disabled:o.currentModelIndex===0,onClick:t[1]||=p=>o.currentModelIndex--},{default:j(()=>[T(c,{size:"xxs",rotate:180})]),_:1},8,["disabled"]),T(d,{width:"26px",height:"26px",ghost:"",rounded:"",icon:"",disabled:o.currentModelIndex===o.models.length-1,onClick:t[2]||=p=>o.currentModelIndex++},{default:j(()=>[T(c,{size:"xxs"})]),_:1},8,["disabled"])])],512),[[ui,o.isVisible]])])}var UB=Q(H$e,[["render",Y$e],["__scopeId","data-v-c590c341"]]),X$e={props:{modal:{type:Object,required:!0},name:{type:String,required:!0}},mounted(){localStorage.getItem("BIMDataViewer_helpShown_"+this.name)||(this.$viewer.localContext.modals.pushModal(this.modal),localStorage.setItem("BIMDataViewer_helpShown_"+this.name,!0))},methods:{onClick(){this.$viewer.localContext.modals.pushModal(this.modal)}}};function $$e(e,t,i,o,r,n){return k(),N("div",{class:"bimdata-help-shortcuts",onClick:t[0]||=(...a)=>n.onClick&&n.onClick(...a)},"?")}var j5=Q(X$e,[["render",$$e],["__scopeId","data-v-78103e0c"]]);function Q5(e,t,i={}){if(!Array.isArray(t)||t.some(d=>!Number.isFinite(d.x)||!Number.isFinite(d.y)))throw TypeError("[Viewer2d - drawArea] An array of point with x and y properties as finit numbers is requested.");let o=ql(),{lineWidth:r=1,lineColor:n=o,lineOpacity:a=1,fill:s=o,fillOpacity:l=.2}=i,c=e.scene.addObject({shapes:[{style:{lineWidth:r,lineColor:n,lineOpacity:a,fill:s,fillOpacity:l,nonScalingLineWidth:!0},paths:[{type:"line",points:t.flatMap(({x:d,y:u})=>[d,u]),close:!0}]}]});return{object:c,get visible(){return c.visible},set visible(d){c.visible=!!d},points:t,destroy(){e.scene.removeObject(c.id)}}}var eet={name:"Viewer2D",components:{Annotations:FB,BIMDataStoreySelector:UB,Help:j5},data(){let{settings:e}=this.$plugin;return{settings:e,model:null,loading:!1,highlightOnHover:!0,selectOnClick:!0,storeyRightOffset:0,spacesVisible:!0,doorsDisplayed:!1,compassDisplayed:e.compass!==!1,camera3DSynchronization:!1,engine2dCreated:!1,modelHeaderShown:e.modelLoader!=="hidden",annotationMode:!1,helpShown:e.help!==!1,storeySelectorShown:e.storeySelector!==!1,storeySelectorAutoOpen:e.storeySelectorAutoOpen!==!1}},computed:{ifc(){return this.model},selectedStorey(){return this.$viewer.localContext.selectedStorey}},created(){this.helpModal=O$e,this.localContextSubscriptions=[],this.stateSubscriptions=[],this.queue=h1(new Promise(e=>{this.mounted=e}))},watch:{loading(e){e?this.$viewer.localContext.loadingProcessStart():this.$viewer.localContext.loadingProcessEnd()},selectedStorey(e){e?this.plugins.spaceNames.show(e):this.plugins.spaceNames.clear(),this.cameraObject&&this.viewer.scene.showObjects([this.cameraObject.object.id]),e&&this.plugins.bitmaps&&this.plugins.bitmaps.showPlans(e.plans)},doorsDisplayed(e){e?this.plugins.doors.enable():this.plugins.doors.disable()},compassDisplayed(e){e?this.plugins.compass.show():this.plugins.compass.hide()}},mounted(){this.$viewer.localContext.el.addEventListener("contextmenu",this.onContextMenu);let e=d1({canvas:this.$refs.canvas});if(e.styles.default.lineWidth=.01,e.settings.rotateSpeed=.05,e.settings.snapMargin=.04,e.textureManager.textureMatrix.scale(.01,.01),this.viewer=e,this.engine=e,window.engine2d=this.viewer,this.engine2dCreated=!0,this.ui=p$e(this),this.plugins=SB(this),this.unsubscribe=A$e(this),this.plugins.bitmaps){let t=this.plugins.bitmaps;this.localContextSubscriptions.push(this.$viewer.localContext.hub.on("plan-shown",({plan:i})=>{t.showPlan(i)}),this.$viewer.localContext.hub.on("plan-hidden",({plan:i})=>{t.hidePlan(i)})),this.stateSubscriptions.push(this.$viewer.state.hub.on("plan-deleted",({plan:i})=>{t.deletePlan(i)}))}this.$watch("selectOnClick",t=>{this.ui.selectOnClick=t},{immediate:!0}),this.$watch("highlightOnHover",t=>{this.ui.highlightOnHover=t},{immediate:!0}),this.$watch("camera3DSynchronization",t=>{t?(this.cameraObject||=f$e(this.viewer),this.camera3DSubscription=this.$viewer.globalContext.hub.on("3d-camera-update",i=>{let{eye:o,look:r,up:n}=i;this.syncRotationFrom3DCamera(o,r,n);let[a,,s]=o,[l,,c]=r;this.cameraObject.sync({x:a,y:s},{x:l,y:c})},{getLastEvent:!0})):(this.$viewer.globalContext.hub.off(this.camera3DSubscription),this.cameraObject?.destroy(),this.cameraObject=null)},{immediate:!0}),this.registerShortcuts(),this.mounted()},unmounted(){this.$viewer.localContext.el?.removeEventListener("contextmenu",this.onContextMenu),this.$viewer.globalContext.hub.off(this.camera3DSubscription),[...this.defaultShortcutNames??[],"fitview"].forEach(e=>this.$viewer.localContext.unregisterShortcut(e)),this.queue?.clear(),this.unsubscribe?.(),Object.values(this.plugins).forEach(e=>e.destroy?.()),this.viewer?.destroy(),this.localContextSubscriptions.forEach(e=>this.$viewer.localContext.hub.off(e)),this.stateSubscriptions.forEach(e=>this.$viewer.state.hub.off(e))},methods:{setSpacesVisible(e){let t=this.selectedStorey?.objects.filter(i=>i.type==="space").map(i=>String(i.id))??[];e?this.selectedStorey&&(this.viewer.scene.showObjects(t),this.plugins.spaceNames.show(this.selectedStorey)):(this.viewer.scene.hideObjects(t),this.plugins.spaceNames.clear()),this.spacesVisible=e},syncRotationFrom3DCamera(e=[0,0,0],t=[0,0,0],i=[0,1,0]){if(Math.abs(i[0])<2**-52||Math.abs(i[1])<2**-52)return;let{angle:o,sub:r,normalize:n}=this.viewer.utils.vector2D,[a,,s]=e,[l,,c]=t,d=n(r({x:a,y:s},{x:l,y:c}));if(Math.abs(d.x)<2**-52&&Math.abs(d.y)<2**-52)return;let u=null;u=d.x<0?o(d,{x:0,y:1}):o({x:0,y:1},d);let A=i[1]>0?180:0,h=u/Math.PI*180+A;this.viewer.camera.setViewpoint({rotation:h})},hideUI(){this.modelHeaderShown=!1,this.helpShown=!1,this.storeySelectorShown=!1},showUI(){this.modelHeaderShown=this.settings.modelLoader!=="hidden",this.helpShown=this.settings.help!==!1,this.storeySelectorShown=this.settings.storeySelector!==!1},registerShortcuts(){let e=this.$viewer.shortcutManager.getDefaultShortcuts(()=>this.selectedStorey?.objects??[]);this.defaultShortcutNames=e.map(t=>t.name),[...e,{name:"fitview",key:"F",execute:()=>this.fitViewSelectedObjects()}].forEach(t=>this.$viewer.localContext.registerShortcut(t))},onContextMenu(){let e=this,t=this.$viewer.contextMenu;if([...t.getDefaultCommands({objects:this.selectedStorey?.objects??[],context:this.$viewer.localContext}),{get label(){return e.$t("global.fit_view")},picto:"F",execute:()=>this.fitViewSelectedObjects()}].map(i=>t.registerContextCommand(i)),this.camera3DSynchronization&&this.$viewer.globalContext.pluginComponentInstances.has("viewer3d")){let i=this.$viewer.globalContext.pluginComponentInstances.get("viewer3d")[0];this.$viewer.contextMenu.registerContextCommand({get label(){return e.$t("viewer2d.move_3d_camera")},execute:o=>{let{clientX:r,clientY:n}=o,{x:a,y:s}=this.viewer.canvas.getBoundingClientRect(),l=this.viewer.camera.getPosition({x:r-a,y:n-s}),c=i.xeokit.camera.eye;i.xeokit.cameraFlight.flyTo({eye:[l.x,c[1],l.y]})}})}},fitViewSelectedObjects(){console.warn("[BIMData Viewer] DEPRECATED - viewer2d - `fitViewSelectedObjects` is deprecated use `fitView` instead."),this.fitView(this.viewer.scene.selectedObjects)},fitView(e){if(e.length>0){if(typeof e[0]=="object"){console.warn("[BIMData Viewer] DEPRECATED - fitView should be called with an array of uuids instead of objects"),this.viewer.camera.fitView(e);return}let t=this.$viewer.state.getObjectsByUuids(e).map(i=>this.viewer.scene.objectsMap.get(String(i.id))).filter(Boolean);this.viewer.camera.fitView(t)}else this.viewer.camera.fitView()},async load2DEngineIfc(e){this.loadIfcFromSVG||=R5(this);let t=await this.loadIfcFromSVG(e.map_file,e.id,e.onlyLoadUuids);if(e.recommanded_2d_angle!==void 0){let i=this.viewer.camera.rotation;this.viewer.camera.rotate(-i-e.recommanded_2d_angle)}this.viewer.camera.fitView(t)},loadIfc(e){return console.warn("[BIMData Viewer] DEPRECATED - viewer2d: `loadIfc` is deprecated use `loadModels` instead."),this.loadModels([e])},async loadModels(e,t=null){let i=e[0];if(!i.map_file)throw Error("Viewer --- ERROR --- Viewer2D Plugin - Impossible to load ifc without a map_file.");return this.loading=!0,new Promise((o,r)=>{this.queue.push(async()=>{try{this.model&&this.unloadIfc(this.model,!1),await this.load2DEngineIfc(i),this.plugins.compass.onIfcChange(i),this.loading=!1,this.model=i;let n={model:i,ifc:i,plugin:this};if(this.$viewer.localContext.hub.emit("2d-model-loaded",n),this.$viewer.globalContext.hub.emit("2d-model-loaded",n),i.storeys.length>0){let a=0;if(t?.storeyKey){let s=i.storeys.findIndex(l=>l.key===t.storeyKey);s!==-1&&(a=s)}this.$viewer.localContext.selectStorey(i.storeys[a])}o()}catch(n){r(n)}finally{this.loading=!1}})})},unloadIfc(e,t=!0){return console.warn("[BIMData Viewer] DEPRECATED - viewer2d: `unloadIfc` is deprecated use `unloadModels` instead."),this.unloadModels([e],t)},unloadModels(e,t=!0){let i=e[0],o=()=>{if(this.$viewer.localContext.selectStorey(null),this.model=null,this.viewer.scene.removeModel(String(i.id))){let r={model:i,ifc:i,plugin:this};return this.$viewer.localContext.hub.emit("2d-model-unloaded",r),this.$viewer.globalContext.hub.emit("2d-model-unloaded",r),!0}else return!1};t?this.queue.push(o):o()},async getSnapshot(){return{snapshot_type:"png",snapshot_data:await O5(this.$el)}},getViewpoint(){if(!this.selectedStorey)return;let e=this.viewer.camera.getViewpoint(),t=this.viewer.utils.vector2D.rotateAround({x:1,y:0},{x:0,y:0},e.rotation/180*Math.PI);return{order:3,originating_system:"ifc2d",models:this.$viewer.localContext.loadedModels.map(i=>i.id),orthogonal_camera:{camera_direction:{x:0,y:0,z:-1},camera_up_vector:{...t,z:0},camera_view_point:{x:e.x,y:e.y,z:this.selectedStorey.absoluteElevation},view_to_world_scale:e.zoom}}},async setViewpoint(e){if(this.loading){let a=null;await new Promise(s=>{a=this.$watch("loading",l=>{l||s()},{immediate:!0})}),a()}if(!this.model)return;let{camera_view_point:t,camera_up_vector:i,view_to_world_scale:o}=e.orthogonal_camera,r=this.$viewer.state.getStoreyFromAbsoluteElevation(this.model,t.z);this.$viewer.localContext.selectStorey(r);let n=this.viewer.utils.vector2D.angle({x:1,y:0},i);this.viewer.camera.setViewpoint({...t,rotation:-(n/Math.PI)*180,zoom:o})},startAnnotationMode(e){this.annotationMode||(this.annotationMode=!0,this.selectOnClick=!1,this.ui.enabled=!1,this.canvasCursor=this.viewer.canvas.style.cursor,this.viewer.canvas.style.cursor="copy",this.annotationListener=this.viewer.ui.on("click",({canvasPosition:t})=>{let{x:i,y:o}=this.viewer.camera.getPosition(t),r=this.selectedStorey,n=this.viewer.picker.pick(t),a=this.$viewer.state.objectsMap.get(+n?.id)??null;e({x:i,y:o,z:r.absoluteElevation,models:this.$viewer.localContext.loadedModels,storey:r,object:a})}))},stopAnnotationMode(){this.annotationMode&&(this.annotationMode=!1,this.selectOnClick=!0,this.ui.enabled=!0,this.viewer.canvas.style.cursor=this.canvasCursor,this.viewer.ui.off(this.annotationListener))},drawArea(e,t){return Q5(this.viewer,e,t)}}},tet={class:"bimdata-viewer2d"},iet={ref:"canvas",class:"bimdata-viewer2d__viewer__canvas"},ret={ref:"texter",style:{position:"absolute",top:"0px",left:"0px"}},oet={class:"bimdata-viewer2d__header"};function net(e,t,i,o,r,n){let a=I("Annotations"),s=I("NoModelWindowPlaceHolder"),l=I("ModelsLoader"),c=I("Help"),d=I("BIMDataStoreySelector");return k(),N("div",tet,[w("canvas",iet,null,512),w("div",ret,null,512),e.engine2dCreated?(k(),W(a,{key:0})):le("",!0),!e.ifc&&!e.loading?(k(),W(s,{key:1})):le("",!0),w("div",oet,[e.settings.modelLoader==="disabled"?le("",!0):Tt((k(),W(l,{key:0,ref:"header","window-positioning":!1},null,512)),[[ui,e.modelHeaderShown]]),e.helpShown?(k(),W(c,{key:1,modal:e.helpModal,name:"2D"},null,8,["modal"])):le("",!0)]),Tt(T(d,{ref:"storeySelector","auto-open":e.storeySelectorAutoOpen},null,8,["auto-open"]),[[ui,e.storeySelectorShown]])])}var aet={name:"viewer2d",isViewer:!0,i18n:{de:{window_label:"2D-Viewer",compass:{N:"N",NE:"NO",E:"O",SE:"SO",S:"S",SW:"SW",W:"W",NW:"NW"},move_3d_camera:"Bewegen Sie die 3D-Kamera hierher"},en:{window_label:"2D Viewer",compass:{N:"N",NE:"NE",E:"E",SE:"SE",S:"S",SW:"SW",W:"W",NW:"NW"},move_3d_camera:"Move the 3D camera here"},es:{window_label:"Visor 2D",compass:{N:"N",NE:"NE",E:"E",SE:"SE",S:"S",SW:"SO",W:"O",NW:"NO"},move_3d_camera:"Mueva la c\xE1mara 3D aqu\xED"},fr:{window_label:"Visionneuse 2D",compass:{N:"N",NE:"NE",E:"E",SE:"SE",S:"S",SW:"SO",W:"O",NW:"NO"},move_3d_camera:"D\xE9placer la cam\xE9ra 3D ici"},it:{window_label:"Visualizzatore 2D",compass:{N:"N",NE:"NE",E:"E",SE:"SE",S:"S",SW:"SO",W:"O",NW:"NO"},move_3d_camera:"Sposta qui la fotocamera 3D"}},component:Q(eet,[["render",net],["__scopeId","data-v-c1d8ad28"]]),window:{name:"2d",label:"viewer2d.window_label",plugins:["fullscreen"],header:!1,icon:{imgUri:"data:image/svg+xml,%3csvg%20width='34'%20height='31'%20viewBox='0%200%2034%2031'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0%200H22.3399V12.9335H26.0665L24.4253%2014.5747H20.5579V1.64122H12.6918V8.49273H12.6918V9.47627H12.6918V14.4431H11.6238V9.47627H9.38118V8.77118L8.11422%206.74457L8.578%206.49865L9.82463%208.49273H11.6238V1.64122H1.78206V8.49273H6.33753V9.47627H1.78206V18.8199H8.55356V19.8034H1.78206V26.3588H14.8444V19.8034H11.5971L11.5971%2019.0443L10.2855%2016.9463L10.7493%2016.7004L12.0744%2018.8199H14.9078V18.8347H20.1653L18.5241%2020.4759H16.6264V28H0V0Z'%20fill='%232F374A'/%3e%3crect%20x='4.1546'%20y='21.9932'%20width='8.09972'%20height='2.55908'%20fill='%23F8C62C'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M22.4478%2020.8232L26.1748%2017.0962V19.6435V20.8232H22.4478ZM32.438%2017.4031C32.438%2016.6314%2031.8136%2016%2031.0419%2016H25.4294L21.2201%2020.2093V28.628C21.2201%2029.3997%2021.8513%2030.0311%2022.6232%2030.0311H31.0489C31.8206%2030.0311%2032.445%2029.3997%2032.445%2028.628L32.438%2017.4031Z'%20fill='%232F374A'/%3e%3crect%20x='20'%20y='23.3208'%20width='13.421'%20height='5.49043'%20rx='1'%20fill='%23205DBD'/%3e%3cpath%20d='M23.4905%2028.2011H22.5969V23.864H23.4905V28.2011Z'%20fill='white'/%3e%3cpath%20d='M26.9309%2026.4287H25.2152V28.2011H24.3216V23.864H27.1454V24.5879H25.2152V25.7079H26.9309V26.4287Z'%20fill='white'/%3e%3cpath%20d='M31.0684%2026.7564C31.0347%2027.2231%2030.8619%2027.5904%2030.5501%2027.8585C30.2403%2028.1266%2029.8312%2028.2607%2029.3229%2028.2607C28.7668%2028.2607%2028.329%2028.074%2028.0092%2027.7006C27.6915%2027.3253%2027.5326%2026.811%2027.5326%2026.1577V25.8925C27.5326%2025.4755%2027.6061%2025.1081%2027.7531%2024.7904C27.9%2024.4727%2028.1095%2024.2294%2028.3816%2024.0606C28.6556%2023.8898%2028.9734%2023.8044%2029.3348%2023.8044C29.8352%2023.8044%2030.2383%2023.9385%2030.5442%2024.2066C30.85%2024.4747%2031.0267%2024.851%2031.0744%2025.3355H30.1808C30.1589%2025.0555%2030.0805%2024.853%2029.9454%2024.7279C29.8124%2024.6008%2029.6088%2024.5372%2029.3348%2024.5372C29.0369%2024.5372%2028.8135%2024.6445%2028.6646%2024.8589C28.5176%2025.0714%2028.4422%2025.402%2028.4382%2025.8508V26.1785C28.4382%2026.6472%2028.5087%2026.9897%2028.6497%2027.2062C28.7927%2027.4226%2029.0171%2027.5309%2029.3229%2027.5309C29.5989%2027.5309%2029.8044%2027.4683%2029.9395%2027.3432C30.0765%2027.2161%2030.1549%2027.0205%2030.1748%2026.7564H31.0684Z'%20fill='white'/%3e%3c/svg%3e"},modelTypes:["IFC"],multiModel:!1}},set="data:image/svg+xml,%3csvg%20width='42'%20height='40'%20viewBox='0%200%2042%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_d)'%3e%3cmask%20id='path-1-inside-1'%20fill='white'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.10059%2020.1082L11.6969%2015.8022V18.4526L30.2653%2018.4526V15.8035L37.8616%2020.1094L30.2653%2024.4153V21.7673L11.6969%2021.7673V24.4141L4.10059%2020.1082Z'/%3e%3c/mask%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.10059%2020.1082L11.6969%2015.8022V18.4526L30.2653%2018.4526V15.8035L37.8616%2020.1094L30.2653%2024.4153V21.7673L11.6969%2021.7673V24.4141L4.10059%2020.1082Z'%20fill='%232F374A'/%3e%3cpath%20d='M11.6969%2015.8022L12.4969%2015.8022V14.4292L11.3024%2015.1063L11.6969%2015.8022ZM4.10059%2020.1082L3.70608%2019.4122L2.47829%2020.1082L3.70608%2020.8041L4.10059%2020.1082ZM11.6969%2018.4526H10.8969V19.2526H11.6969V18.4526ZM30.2653%2018.4526V19.2526H31.0653V18.4526H30.2653ZM30.2653%2015.8035L30.6598%2015.1075L29.4653%2014.4304V15.8035H30.2653ZM37.8616%2020.1094L38.2562%2020.8053L39.4839%2020.1094L38.2562%2019.4134L37.8616%2020.1094ZM30.2653%2024.4153H29.4653V25.7883L30.6598%2025.1112L30.2653%2024.4153ZM30.2653%2021.7673H31.0653V20.9673H30.2653V21.7673ZM11.6969%2021.7673V20.9673H10.8969V21.7673H11.6969ZM11.6969%2024.4141L11.3024%2025.11L12.4969%2025.7871V24.4141H11.6969ZM11.3024%2015.1063L3.70608%2019.4122L4.49509%2020.8041L12.0914%2016.4982L11.3024%2015.1063ZM12.4969%2018.4526L12.4969%2015.8022L10.8969%2015.8022V18.4526H12.4969ZM30.2653%2017.6526L11.6969%2017.6526V19.2526L30.2653%2019.2526V17.6526ZM31.0653%2018.4526V15.8035H29.4653V18.4526H31.0653ZM29.8708%2016.4994L37.4671%2020.8053L38.2562%2019.4134L30.6598%2015.1075L29.8708%2016.4994ZM37.4671%2019.4134L29.8708%2023.7193L30.6598%2025.1112L38.2562%2020.8053L37.4671%2019.4134ZM31.0653%2024.4153V21.7673H29.4653V24.4153H31.0653ZM11.6969%2022.5673L30.2653%2022.5673V20.9673L11.6969%2020.9673V22.5673ZM12.4969%2024.4141V21.7673H10.8969V24.4141H12.4969ZM3.70608%2020.8041L11.3024%2025.11L12.0914%2023.7181L4.49509%2019.4122L3.70608%2020.8041Z'%20fill='white'%20mask='url(%23path-1-inside-1)'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d'%20x='0.100586'%20y='12.8022'%20width='41.7611'%20height='16.613'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='1'/%3e%3cfeGaussianBlur%20stdDeviation='2'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.25%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",cet={props:{label:{type:String,default:""},container:HTMLElement,step:{type:Number,default:1},labelWidth:{type:String,default:"50px"},modelValue:{type:Number,default:null},digits:{type:Number,default:2},unit:{type:String,default:""},grabber:{type:Boolean,default:!1},centered:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},min:{type:Number,default:null},max:{type:Number,default:null}},emits:["update:modelValue"],data(){return{focused:!1,grabbing:!1,cursor:set,cursorTranslate:{x:0,y:0}}},computed:{fixedValue(){return+this.modelValue.toFixed(this.digits)},cursorTransform(){return`transform: translate(${this.cursorTranslate.x}px, ${this.cursorTranslate.y}px)`}},mounted(){let e=this.$refs.input;this.focused=e===document.activeElement,document.addEventListener("keydown",this.keydownHandler=i=>{i.key==="Enter"&&e.blur()});let t=this.$refs.label;t.addEventListener("mousedown",i=>{document.addEventListener("mousemove",this.onMouseMove),t.requestPointerLock(),this.grabbing=!0;let{clientX:o,clientY:r}=i,{x:n,y:a}=this.$el.getBoundingClientRect();this.elPosition={x:n,y:a},this.container&&(this.containerRect=this.container.getBoundingClientRect()),this.cursorTranslate={x:o-n,y:r-a}}),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",this.onMouseMove),document.exitPointerLock(),this.grabbing=!1,this.containerRect=null,this.elPosition=null})},unmounted(){document.removeEventListener("keydown",this.keydownHandler)},methods:{onMouseMove(e){if(this.cursorTranslate={x:this.cursorTranslate.x+e.movementX,y:this.cursorTranslate.y+e.movementY},this.containerRect){let{x:t,y:i,width:o,height:r}=this.containerRect;for(;this.cursorTranslate.x+this.elPosition.x-t>o;)this.cursorTranslate.x-=o;for(;this.cursorTranslate.x+this.elPosition.x<t;)this.cursorTranslate.x+=o;for(;this.cursorTranslate.y+this.elPosition.y-i>r;)this.cursorTranslate.y-=r;for(;this.cursorTranslate.y+this.elPosition.y<i;)this.cursorTranslate.y+=r}this.requestUpdate(this.modelValue+e.movementX*this.step)},onMouseDown(e){e.preventDefault(),this.focus()},focus(){let e=this.$refs.input;e&&e.focus()},blur(){let e=this.$refs.input;e&&e.blur()},onFocus(){this.focused=!0},onBlur(){this.focused=!1},onChange(e){let t=this.fixedValue,i=parseFloat(e.target.value);isNaN(i)&&(i=t),this.requestUpdate(i)},requestUpdate(e){this.min!==null&&(e=Math.max(this.min,e)),this.max!==null&&(e=Math.min(this.max,e)),this.$emit("update:modelValue",e)},away(){this.blur()}}},det=["value","disabled"],uet=["src"];function Aet(e,t,i,o,r,n){let a=Li("click-away");return Tt((k(),N("div",{class:ye(["bimdata-numerical-input",{"bimdata-numerical-input--focus":r.focused}]),onMousedown:t[3]||=(...s)=>n.onMouseDown&&n.onMouseDown(...s)},[Tt(w("span",{ref:"label",class:"bimdata-numerical-input__label",style:ve(`width: ${i.labelWidth}`)},G(i.label),5),[[ui,i.label]]),w("input",{ref:"input",class:ye(["bimdata-numerical-input__input",{"bimdata-numerical-input__input--centered":i.centered}]),value:`${n.fixedValue}${i.unit}`,disabled:i.disabled,onChange:t[0]||=(...s)=>n.onChange&&n.onChange(...s),onFocus:t[1]||=(...s)=>n.onFocus&&n.onFocus(...s),onBlur:t[2]||=(...s)=>n.onBlur&&n.onBlur(...s)},null,42,det),r.grabbing?(k(),N("div",{key:0,class:"bimdata-numerical-input__cursor",style:ve(n.cursorTransform)},[w("img",{src:r.cursor,style:{transform:"translate(-50%, -50%)"}},null,8,uet)],4)):le("",!0)],34)),[[a,n.away]])}var Ij=Q(cet,[["render",Aet],["__scopeId","data-v-7438b65a"]]),het={components:{BIMDataNumericalInput:Ij},setup(){let e=bt("$viewer"),t=bt("root"),i=je(()=>t.editedBitmap?t.editedBitmap:{x:0,y:0,scale:0,angle:0,opacity:0}),o=pet(i);return{root:t,bitmap:i,...o,submit:async()=>{try{if(t.loading=!0,t.editedBitmap.plan){let{x:n,y:a,scale:s,angle:l,opacity:c,plan:d}=t.editedBitmap,u={...d.plan.transform};Object.assign(d.plan.transform,{translate:[n,a],rotate:l,scale:s,opacity:c}),await e.state.updatePlan(d,u)}else{let{x:n,y:a,angle:s,scale:l,opacity:c}=i.value,d={translate:[n??0,a??0],rotate:s??0,scale:l??1,opacity:c??1},u=await e.state.createPlan(t.model,t.selectedStorey,i.value.document,d);i.value.plan=u}i.value.edited=!1,t.page="home"}catch(n){console.error(n)}finally{t.loading=!1}}}}};function pet(e){let t={};return Object.entries({x:i=>i,y:i=>i,scale:i=>i,angle:i=>i<0||i>360?(i%360+360)%360:i,opacity:i=>i<0?0:i>1?1:i}).forEach(([i,o])=>{t[i]=je({get:()=>e.value[i],set:r=>e.value[i]=o(r)})}),t}var fet={class:"viewer2d-background__page__edit"},get={class:"viewer2d-background__page__edit__content"},met={class:"viewer2d-background__page__edit__content__unit-group"},vet={class:"viewer2d-background__page__edit__content__unit-group__element"},yet={class:"viewer2d-background__page__edit__content__unit-group__element"},wet={class:"viewer2d-background__page__edit__content__unit-group__element"},bet={class:"viewer2d-background__page__edit__content__unit"},Cet={class:"viewer2d-background__page__edit__content__unit"},xet={class:"viewer2d-background__page__edit__content__img"},Bet=["src"],ket={class:"viewer2d-background__page__edit__validate"};function Eet(e,t,i,o,r,n){let a=I("BIMDataNumericalInput"),s=I("BIMDataSlider"),l=I("BIMDataTextbox"),c=I("BIMDataButton");return k(),N("div",fet,[w("div",get,[w("section",null,[w("span",null,G(e.$t("viewer2d-background.location")),1),w("div",met,[w("div",vet,[T(a,{modelValue:e.x,"onUpdate:modelValue":t[0]||=d=>e.x=d,label:"X",container:e.$viewer.localContext.el},null,8,["modelValue","container"])]),w("div",yet,[T(a,{modelValue:e.y,"onUpdate:modelValue":t[1]||=d=>e.y=d,label:"Y",container:e.$viewer.localContext.el},null,8,["modelValue","container"])]),w("div",wet,[T(a,{modelValue:e.scale,"onUpdate:modelValue":t[2]||=d=>e.scale=d,label:e.$t("viewer2d-background.scale"),step:.01,min:.01,container:e.$viewer.localContext.el},null,8,["modelValue","label","container"])])])]),w("section",null,[w("span",null,G(e.$t("viewer2d-background.rotation")),1),w("div",bet,[T(a,{modelValue:e.angle,"onUpdate:modelValue":t[3]||=d=>e.angle=d,unit:"\xB0",centered:""},null,8,["modelValue"]),T(s,{modelValue:e.angle,"onUpdate:modelValue":t[4]||=d=>e.angle=d,min:0,max:360},null,8,["modelValue"])])]),w("section",null,[w("span",null,G(e.$t("viewer2d-background.alpha")),1),w("div",Cet,[T(a,{modelValue:e.opacity,"onUpdate:modelValue":t[5]||=d=>e.opacity=d,centered:""},null,8,["modelValue"]),T(s,{modelValue:e.opacity,"onUpdate:modelValue":t[6]||=d=>e.opacity=d,min:0,max:1,step:.01},null,8,["modelValue"])])]),w("section",null,[w("span",null,G(e.$t("viewer2d-background.preview")),1),w("div",xet,[w("img",{src:o.bitmap.dataUrl,alt:"Background"},null,8,Bet),T(l,{text:o.bitmap.name,class:"viewer2d-background__page__edit__content__img__name"},null,8,["text"])])])]),w("div",ket,[T(c,{width:"100%",color:"primary",fill:"",radius:"",onClick:o.submit},{default:j(()=>[nt(G(o.bitmap&&o.bitmap.plan?e.$t("global.save"):e.$t("global.validate")),1)]),_:1},8,["onClick"])])])}var Met=Q(het,[["render",Eet],["__scopeId","data-v-a022440a"]]);function Sj(e,t){let i=t.anchorSynchronization===!0&&e.windowManager.registeredWindows.has("anchor-synchronization");return{anchorSynchronizationWindowAvailable:i,openAnchorSynchronizationWindow:async({model:o,storey:r,modelToSynchronize:n})=>{if(!i)throw Error("Anchor Synchronization window is not registered");if(!o||!n)throw Error("Both model and modelToSynchronize must be provided");let a=e.globalContext.getLayout(!1);e.globalContext.hub.emit("anchor-synchronization:open",a),e.globalContext.layout={windowName:"anchor-synchronization"},await Ir(),e.globalContext.localContexts[0].plugins.get("anchor-synchronization-window").synchronize(o,r,n)}}}var Pet={components:{BIMDataGED:O4},setup(){let e=bt("viewer2d"),t=bt("root"),i=bt("$plugin"),o=e.$viewer,{openAnchorSynchronizationWindow:r,anchorSynchronizationWindowAvailable:n}=Sj(o,i),a=pe(null);return{root:t,selectedDocument:a,submit:async()=>{try{t.loading=!0;let s=a.value,l=await o.api.createModel(s.id);if(l=await o.api.waitForModelProcess(l),n){let c=o.state.modelsMap.get(l.id);if(c||=(await o.state.loadModels([l.id],{silent:!0}))[0],!c)throw Error("Plan model not found");await r({model:t.model,storey:t.selectedStorey,modelToSynchronize:c})}else{let{x:c,y:d}=e.viewer.camera.position,u=(e.viewer.camera.rotation%360+360)%360,A={translate:[c,d],rotate:u,scale:1,opacity:1},h=await e.plugins.bitmaps.createBitmap(s,{plan:l},A);h.plan=null,h.edited=!0,t.editedBitmap=h,t.page="edit"}}catch(s){console.error(s),t.page="home"}finally{a.value=null,t.loading=!1}}}}},Iet={class:"viewer2d-background__page__ged"},Det={class:"viewer2d-background__page__ged__button"};function Tet(e,t,i,o,r,n){let a=I("BIMDataGED"),s=I("BIMDataButton");return k(),N("div",Iet,[T(a,{ref:"ged",class:"viewer2d-background__page__ged__ged","header-buttons":!1,"single-select-mode":"","selectable-file-types":["pdf","jpeg","jpg","png"],onSelectionChange:t[0]||=l=>o.selectedDocument=l[0]},null,512),w("div",Det,[T(s,{width:"100%",height:"32px",color:"primary",fill:"",radius:"",disabled:!o.selectedDocument,onClick:o.submit},{default:j(()=>[nt(G(e.$t("global.validate")),1)]),_:1},8,["disabled","onClick"])])])}var Let=Q(Pet,[["render",Tet],["__scopeId","data-v-d1ac46ef"]]),Ret={setup(){let e=bt("$viewer"),t=bt("$plugin"),i=bt("viewer2d"),o=bt("root"),{openAnchorSynchronizationWindow:r,anchorSynchronizationWindowAvailable:n}=Sj(e,t),a=pe(null);return{root:o,menuIndexDisplayed:a,toggleMenu:s=>{a.value=a.value===s?null:s},closeMenu:s=>{a.value===s&&(a.value=null)},onCreateClick:()=>{o.page="bond"},onEditClick:async s=>{try{if(o.loading=!0,o.selectedStorey!==s.storey&&e.localContext.selectStorey(s.storey),n){let l=e.state.modelsMap.get(s.plan.id);l||=(await e.state.loadModels([s.plan.id],{silent:!0}))[0],r({model:s.model,storey:s.storey,modelToSynchronize:l})}else await i.plugins.bitmaps.showPlan(s),o.editedBitmap=i.plugins.bitmaps.getBitmap(s),o.page="edit"}catch(l){console.error(l)}finally{o.loading=!1}},onDeleteClick:async s=>{try{o.loading=!0,await e.state.deletePlan(s)}catch(l){console.error(l)}finally{o.loading=!1}}}}},_et={class:"viewer2d-background__page__home"},Fet={class:"viewer2d-background__page__home__description"},Uet={class:"viewer2d-background__page__home__list"},Oet={class:"viewer2d-background__page__home__list__element__icon"},Net={class:"viewer2d-background__page__home__list__element__labels"},Het={key:0,class:"viewer2d-background__page__home__list__element__menu"},Vet={key:0,class:"viewer2d-background__page__home__list__element__menu__menu"};function jet(e,t,i,o,r,n){let a=I("BIMDataButton"),s=I("BIMDataIconSynchro2D"),l=I("BIMDataTextbox"),c=I("BIMDataIconEllipsis"),d=Li("click-away");return k(),N("div",_et,[w("div",Fet,G(e.$t("viewer2d-background.description")),1),T(a,{class:"viewer2d-background__page__home__button",color:"primary",fill:"",radius:"",width:"60%",disabled:!e.$viewer.api.permissions.hasModelWritePermission||o.root.storeys.length===0,onClick:o.onCreateClick},{default:j(()=>[o.root.storeys.length===0?(k(),N(ut,{key:0},[nt(G(e.$t("viewer2d-background.no_ifc")),1)],64)):o.root.storeys.length>0?(k(),N(ut,{key:1},[nt(G(e.$t("global.new")),1)],64)):(k(),N(ut,{key:2},[nt(G(e.$t("viewer2d-background.start")),1)],64))]),_:1},8,["disabled","onClick"]),w("ul",Uet,[(k(!0),N(ut,null,Vt(o.root.plans,u=>(k(),N("li",{key:`${u.key}`,class:"viewer2d-background__page__home__list__element"},[w("div",Oet,[T(s,{size:"m",fill:"",color:"primary"})]),w("div",Net,[T(l,{class:"viewer2d-background__page__home__list__element__labels__storey",text:u.storey.name},null,8,["text"]),T(l,{class:"viewer2d-background__page__home__list__element__labels__plan",text:u.plan.name},null,8,["text"])]),e.$viewer.api.permissions.hasModelWritePermission?Tt((k(),N("div",Het,[T(a,{color:"granite",ghost:"",rounded:"",icon:"",onClick:A=>o.toggleMenu(u.key)},{default:j(()=>[T(c,{size:"l"}),o.menuIndexDisplayed===u.key?(k(),N("div",Vet,[T(a,{width:"100%",color:"granite",ghost:"",square:"",onClick:A=>o.onEditClick(u)},{default:j(()=>[nt(G(e.$t("global.edit")),1)]),_:1},8,["onClick"]),T(a,{width:"100%",color:"granite",ghost:"",square:"",onClick:A=>o.onDeleteClick(u)},{default:j(()=>[w("div",null,G(e.$t("global.delete")),1)]),_:1},8,["onClick"])])):le("",!0)]),_:2},1032,["onClick"])])),[[d,()=>o.closeMenu(u.key)]]):le("",!0)]))),128))])])}var Qet=Q(Ret,[["render",jet],["__scopeId","data-v-ee47f509"]]),zet={setup(){let e=bt("$viewer");return{root:bt("root"),selectStorey:t=>{e.localContext.selectStorey(t)}}}},qet={class:"viewer2d-background__page__bond"},Get={class:"viewer2d-background__page__bond__list-title"},Ket={class:"viewer2d-background__page__bond__list-title"};function Jet(e,t,i,o,r,n){let a=I("BIMDataDropdownList"),s=I("BIMDataButton");return k(),N("div",qet,[w("div",null,[w("div",Get," 1 - "+G(e.$t("viewer2d-background.select_storey")),1),T(a,{width:"100%",list:o.root.storeys,"per-page":20,"element-key":"id","close-on-element-click":"",class:"viewer2d-background__page__bond__storeys",onElementClick:t[0]||=l=>o.selectStorey(l)},{header:j(()=>[nt(G(o.root.selectedStorey?o.root.selectedStorey.name:e.$t("viewer2d-background.select_storey")),1)]),element:j(({element:l})=>[w("span",{class:ye({"viewer2d-background__page__bond__storeys--active":o.root.selectedStorey===l})},G(l.name),3)]),_:1},8,["list"])]),w("div",null,[w("div",Ket," 2 - "+G(e.$t("viewer2d-background.import_file")),1),T(s,{width:"100%",color:"primary",fill:"",radius:"",disabled:!o.root.selectedStorey,onClick:t[1]||=l=>o.root.page="ged"},{default:j(()=>[nt(G(e.$t("viewer2d-background.from_ged")),1)]),_:1},8,["disabled"])])])}var Zet={name:"Background2D",components:{edit:Met,ged:Let,home:Qet,bond:Q(zet,[["render",Jet],["__scopeId","data-v-2573d11f"]])},props:{isOpen:{type:Boolean,default:!1}},setup(){let e=bt("$viewer"),t=bt("$plugin"),i;try{i=e.localContext.pluginComponentInstances.get("viewer2d")}catch(u){i={},console.error(u)}if(!i)throw Error("[Viewer 2D - synchronization] plugin cannot work without viewer2d plugin with 2d engine on.");i=un(i),pr("viewer2d",i);let o=qo({page:"home",loading:!1,modalDisplayed:!1,model:{},storeys:[],plans:[],selectedStorey:null,editedBitmap:null});pr("root",o);let r=e.localContext.hub.on("models-loaded",({models:[u]})=>{o.model=u,o.storeys=u.storeys,o.plans=u.storeys.flatMap(A=>A.plans)},{getLastEvent:!0}),n=e.localContext.hub.on("storey-selected",({storey:u})=>{o.selectedStorey=u,u||(o.page="home")},{getLastEvent:!0}),a=e.state.hub.on("plan-created",()=>o.plans=o.model.storeys.flatMap(u=>u.plans)),s=e.state.hub.on("plan-updated",()=>o.plans=o.model.storeys.flatMap(u=>u.plans)),l=e.state.hub.on("plan-deleted",()=>o.plans=o.model.storeys.flatMap(u=>u.plans));$i(()=>{e.localContext.hub.off(r),e.localContext.hub.off(n),e.localContext.hub.off(a),e.localContext.hub.off(s),e.localContext.hub.off(l)}),xt(()=>o.page,u=>{u!=="edit"&&(o.editedBitmap=null)},{immediate:!0}),xt(()=>o.editedBitmap,(u,A)=>{A?.edit(!1),u?.edit(!0)},{immediate:!0});let c=()=>{o.page="home",o.modalDisplayed=!1,t.close()},d=!0;return{viewer2d:i,root:o,onBackClick:()=>{switch(d=!0,o.page){case"ged":o.page="bond";break;case"edit":o.editedBitmap?.edited?o.modalDisplayed=!0:o.editedBitmap.plan?(o.editedBitmap.reset(),o.page="home"):(i.plugins.bitmaps.deleteBitmap(o.editedBitmap),o.page="ged");break;default:o.page="home"}},onCloseClick:()=>{d=!1,o.editedBitmap?.edited?o.modalDisplayed=!0:c()},onLeaveClick:()=>{o.editedBitmap.plan?o.editedBitmap.reset():i.plugins.bitmaps.deleteBitmap(o.editedBitmap),d?o.editedBitmap.plan?o.page="home":o.page="ged":c(),o.modalDisplayed=!1},onKeyDown:u=>{o.loading||u.key==="Escape"&&(u.preventDefault(),o.page==="home"?c():o.modalDisplayed&&=!1)}}},async onOpen(){this.$viewer.localContext.pluginComponentInstances.forEach(e=>{e!==this&&e.$close?.()}),this.viewer2d.storeyRightOffset=380,await this.$viewer.localContext.hideUI({exceptions:[this.$plugin.name]}),this.viewer2d.viewer.ui.mode=null,this.root.selectedStorey&&this.root.selectedStorey.plans.forEach(e=>this.viewer2d.plugins.bitmaps.showPlan(e)),document.addEventListener("keydown",this.onKeyDown)},onClose(){this.viewer2d.storeyRightOffset=0,this.$viewer.localContext.showUI(),this.viewer2d.viewer.ui.mode="pick",this.root.selectedStorey&&this.root.selectedStorey.plans.forEach(e=>{this.$viewer.localContext.shownPlans.some(t=>t.key===e.key)?this.viewer2d.plugins.bitmaps.showPlan(e):this.viewer2d.plugins.bitmaps.hidePlan(e)}),document.removeEventListener("keydown",this.onKeyDown)}},Wet={class:"viewer2d-background"},Yet={class:"viewer2d-background__header__back"},Xet={class:"viewer2d-background__header__title__text"},$et={key:1,class:"viewer2d-background__modal"},ett={class:"viewer2d-background__modal__content"},ttt={class:"viewer2d-background__modal__content__symbols"},itt={class:"viewer2d-background__modal__content__buttons"};function rtt(e,t,i,o,r,n){let a=I("BIMDataLoading"),s=I("BIMDataIconArrow"),l=I("BIMDataButton"),c=I("BIMDataIconSynchro2D"),d=I("BIMDataIconClose"),u=I("BIMDataIconWarning");return k(),N("div",Wet,[o.root.loading?(k(),W(a,{key:0})):le("",!0),w("div",{class:ye(["viewer2d-background__header",{"viewer2d-background__header--home":o.root.page==="home"}])},[w("div",Yet,[o.root.page==="home"?le("",!0):(k(),W(l,{key:0,width:"25px",height:"25px",color:"primary",ghost:"",radius:"",icon:"",onClick:o.onBackClick},{default:j(()=>[T(s,{size:"xs"})]),_:1},8,["onClick"]))]),w("div",{class:ye(["viewer2d-background__header__title",{"viewer2d-background__header__title--home":o.root.page==="home"}])},[T(c,{size:o.root.page==="home"?"l":"xs",fill:"",color:"primary"},null,8,["size"]),w("span",Xet,G(e.$t("viewer2d-background.title")),1)],2),T(l,{class:"viewer2d-background__header__close",width:"25px",height:"25px",ghost:"",radius:"",icon:"",onClick:o.onCloseClick},{default:j(()=>[T(d,{size:"xs",fill:"",color:"granite-light"})]),_:1},8,["onClick"])],2),w("div",{class:ye(["viewer2d-background__page",{"viewer2d-background__page--home":o.root.page==="home"}])},[(k(),W(L3,null,[(k(),W(qr(o.root.page)))],1024))],2),o.root.modalDisplayed?(k(),N("div",$et,[w("div",ett,[w("div",ttt,[T(u,{fill:"",color:"high",size:"l"}),w("div",null,G(e.$t("viewer2d-background.warning")),1)]),w("div",itt,[T(l,{width:"45%",color:"high",fill:"",radius:"",onClick:o.onLeaveClick},{default:j(()=>[nt(G(e.$t("viewer2d-background.leave")),1)]),_:1},8,["onClick"]),T(l,{width:"45%",color:"default",outline:"",radius:"",onClick:t[0]||=A=>o.root.modalDisplayed=!1},{default:j(()=>[nt(G(e.$t("viewer2d-background.stay")),1)]),_:1})])])])):le("",!0)])}var Dj=Q(Zet,[["render",rtt],["__scopeId","data-v-1eece107"]]),Tj={tooltip:"Hintergrund",title:"2D-Viewer-Hintergrund",location:"Position",scale:"Ma\xDFstab",rotation:"Rotation",alpha:"Lichtundurchl\xE4ssigkeit",preview:"Vorschau",import:"Ein Element importieren",from_ged:"Von dem DMS des Projekts",from_computer:"Von Ihrem Computer",no_storey:"Um einen Hintergrund hinzuzuf\xFCgen, w\xE4hlen Sie bitte eine IFC und eine Etage aus.",start:"Start",description:"\xDCberlagern Sie Ihre PDF-Grundrisse, um sie im 2D-Viewer anzuzeigen",select_storey:"W\xE4hlen Sie eine Etage aus",import_file:"Importieren Sie eine Datei",no_ifc:"Um einen Hintergrund hinzuzuf\xFCgen, w\xE4hlen Sie bitte eine IFC aus.",warning:"M\xF6chten Sie diese Seite wirklich verlassen? M\xF6glicherweise gibt es unbest\xE4tigte Informationen.",leave:"Ja, diese Seite verlassen",stay:"Abbrechen, hier bleiben"},ott="Background",ntt="2D viewer background",att="Location",stt="Scale",ltt="Rotation",ctt="Alpha",dtt="Preview",utt="From the project GED",Att="From your computer",htt="To add a background, please select an IFC and a storey.",ptt="Start",ftt="Overlay your PDF plans by floor to view them in the 2D viewer",gtt="Select a storey",mtt="Import a file",vtt="To add a background, please select an IFC with at least one storey.",ytt="Are you sure you want to leave this page? There may be some unvalidated information.",wtt="Yes, leave this page",btt="Cancel, stay here",Lj={tooltip:ott,"tooltip-anchor-synchronization":"Synchronization",title:ntt,location:att,scale:stt,rotation:ltt,alpha:ctt,preview:dtt,import:"Import element",from_ged:utt,from_computer:Att,no_storey:htt,start:ptt,description:ftt,select_storey:gtt,import_file:mtt,no_ifc:vtt,warning:ytt,leave:wtt,stay:btt},Rj={tooltip:"Fondo",title:"Fondo de visor 2D",location:"Ubicaci\xF3n",scale:"Escala",rotation:"Rotaci\xF3n",alpha:"Alfa",preview:"Vista previa",import:"Elemento de importaci\xF3n",from_ged:"Del proyecto GED",from_computer:"Desde el ordenador",no_storey:"Para agregar un fondo, seleccione un IFC y un piso.",start:"Comenzar",description:"Superponga sus planos en PDF por planta para que pueda verlos en el visor 2D",select_storey:"Seleccionar una planta",import_file:"Importar un fichero",no_ifc:"Seleccione un IFC para a\xF1adir un fondo",warning:"\xBFEst\xE1 seguro de que quiere abandonar esta p\xE1gina? Podr\xEDa haber informaci\xF3n sin validar.",leave:"S\xED, salir de esta p\xE1gina",stay:"Cancelar y permanecer aqu\xED"},Ctt="Synchronisation 2D",xtt="Synchronisation 2D",Btt="Position",ktt="Echelle",Ett="Rotation",Mtt="Opacit\xE9",Ptt="Aper\xE7u",Itt="Depuis la GED du projet",Stt="Depuis votre ordinateur",Dtt="Pour ajouter un fond, veuillez selectionner un IFC et un \xE9tage.",Ttt="Commencer",Ltt="Superposez vos plans PDF par \xE9tages pour les visualisez dans la visionneuse 2D",Rtt="S\xE9lectionner un \xE9tage",_tt="Importer un fichier",Ftt="Pour ajouter un fond, veuillez selectionner un IFC avec au moins un \xE9tage.",Utt="\xCAtes-vous s\xFBr de vouloir quitter cette page ? Il y'a peut-\xEAtre des informations non valid\xE9es.",Ott="Oui, quitter cette page",Ntt="Annuler, rester ici",_j={tooltip:Ctt,"tooltip-anchor-synchronization":"Synchronisation",title:xtt,location:Btt,scale:ktt,rotation:Ett,alpha:Mtt,preview:Ptt,import:"Importer un \xE9l\xE9ment",from_ged:Itt,from_computer:Stt,no_storey:Dtt,start:Ttt,description:Ltt,select_storey:Rtt,import_file:_tt,no_ifc:Ftt,warning:Utt,leave:Ott,stay:Ntt},Fj={tooltip:"Sincronizzazione 2D",title:"Sincronizzazione 2D",location:"Posizione",scale:"Scala",rotation:"Rotazione",alpha:"Opacit\xE0",preview:"Anteprima",import:"Importa un elemento",from_ged:"Dalla GED del progetto",from_computer:"Dal tuo computer",no_storey:"Per aggiungere uno sfondo, seleziona un IFC e un livello.",start:"Iniziare",description:"Sovrapporre le planimetrie PDF per visualizzarle in modalit\xE0 2 D",select_storey:"Selezionare un piano",import_file:"Importare un file",no_ifc:"Per aggiungere uno sfondo, selezionare un IFC.",warning:"Sei sicuro di abbandonare questa pagina? Possono esserci informazioni non salvate.",leave:"S\xEC, abbandona questa pagina",stay:"Annulla, resta qui"},Htt={name:"viewer2d-background",i18n:{de:Tj,en:Lj,es:Rj,fr:_j,it:Fj},addToWindows:["2d"],component:Dj,anchorSynchronization:!1,button:{tooltip:"viewer2d-background.tooltip",position:"right",content:"free",keepOpen:!0,icon:{imgUri:"data:image/svg+xml,%3csvg%20width='24'%20height='20'%20viewBox='0%200%2024%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.88872%200.566772L1.04927%202.40024C0.725277%202.48709%200.5%202.78072%200.5%203.11615V18.2831C0.5%2018.7699%200.961394%2019.1246%201.43186%2018.9993L7.88972%2017.2801C7.88906%2017.272%207.88872%2017.2638%207.88872%2017.2554V14.7773L3.17858%2016.0333C2.85509%2016.1195%202.53773%2015.8757%202.53773%2015.5409V4.74845C2.53773%204.51759%202.69293%204.31557%202.916%204.25608L7.88872%202.93012V0.566772ZM8.49094%2014.7855V17.2554C8.49094%2017.2696%208.48996%2017.2835%208.48808%2017.2971L15.486%2019.4156C15.4859%2019.4136%2015.4859%2019.4115%2015.4859%2019.4095V16.8485L8.49094%2014.7855ZM15.4859%204.99423L8.49094%202.93124V0.570797L15.5016%202.54386C15.4914%202.57409%2015.4859%202.60647%2015.4859%202.64013V4.99423ZM16.0881%2016.8573L21.0609%2015.5314C21.2839%2015.4719%2021.4391%2015.2699%2021.4391%2015.039V4.24655C21.4391%203.91175%2021.1218%203.66793%2020.7983%203.75419L16.0881%205.01014V2.64013C16.0881%202.63282%2016.0879%202.62557%2016.0873%202.61838C16.0996%202.61571%2016.1118%202.61272%2016.1239%202.60942L22.5642%200.856573C23.0356%200.728268%2023.5%201.08318%2023.5%201.57174V16.7222C23.5%2017.0518%2023.2823%2017.3419%2022.9657%2017.4339L16.0872%2019.4332C16.0875%2019.4296%2016.0877%2019.4259%2016.0879%2019.4222C16.088%2019.418%2016.0881%2019.4138%2016.0881%2019.4095V16.8573ZM12.1876%204.98741L15.3238%205.91236V15.8348L8.65309%2013.8674V3.945L11.7243%204.85078V11.7826L10.2056%2011.3757L10.1957%2011.8232L13.8163%2012.7933L13.8262%2012.3458L12.1876%2011.9068V4.98741ZM16.2503%208.87403V5.92576L20.5126%204.78921V7.73192L16.2503%208.87403ZM16.2503%209.32413V15.8553L20.5126%2014.7187V11.6974C20.2851%2011.7578%2020.0295%2011.8473%2019.7867%2012.0031C19.5622%2012.1472%2019.3588%2012.3444%2019.2172%2012.6226C19.0755%2012.9009%2018.9884%2013.2744%2019.0183%2013.7819C19.0258%2013.9096%2018.9284%2014.0193%2018.8006%2014.0268C18.673%2014.0343%2018.5633%2013.9368%2018.5558%2013.8091C18.522%2013.2339%2018.6193%2012.7759%2018.8044%2012.4124C18.9895%2012.0488%2019.2553%2011.7937%2019.5365%2011.6133C19.8666%2011.4014%2020.233%2011.2872%2020.5126%2011.2189V8.18203L16.2503%209.32413ZM7.7266%203.93221V9.53559L3.46421%2010.6777V8.46597C3.75116%208.40016%204.15552%208.28527%204.51661%208.05354C4.79783%207.87306%205.06361%207.61801%205.24874%207.25436C5.43381%206.89086%205.53112%206.43293%205.49728%205.85765C5.48977%205.72995%205.38016%205.63252%205.25246%205.64003C5.12476%205.64754%205.02733%205.75715%205.03484%205.88485C5.0647%206.3924%204.97762%206.76586%204.83592%207.04418C4.6943%207.32236%204.49096%207.51957%204.26641%207.66368C3.99613%207.83713%203.70982%207.92849%203.46421%207.98882V5.06876L7.7266%203.93221ZM7.7266%2013.8617V9.98569L3.46421%2011.1278V14.9983L7.7266%2013.8617Z'%20fill='%232F374A'/%3e%3c/svg%3e"}}},OB="viewer2d-parameters_parameters",Vtt={computed:{viewer2d(){let e=this.$viewer.localContext.pluginComponentInstances.get("viewer2d");if(e)return e;{let t="'Viewer 2D Parameters' plugin cannot work without viewer2d plugin.";throw console.error(t),Error(t)}},spacesDisplayed:{get(){return this.viewer2d.spacesVisible},set(e){this.viewer2d.setSpacesVisible(e),this.saveParameters()}},doorsDisplayed:{get(){return this.viewer2d.doorsDisplayed},set(e){this.viewer2d.doorsDisplayed=e,this.saveParameters()}},compassDisplayed:{get(){return this.viewer2d.compassDisplayed},set(e){this.viewer2d.compassDisplayed=e,this.saveParameters()}},highlightOnHover:{get(){return this.viewer2d.highlightOnHover},set(e){this.viewer2d.highlightOnHover=e,this.saveParameters()}},camera3DSynchronization:{get(){return this.viewer2d.camera3DSynchronization},set(e){this.viewer2d.camera3DSynchronization=e,this.saveParameters()}}},mounted(){this.applySavedParameters(),this.subscription=this.$viewer.localContext.hub.on("2d-model-loaded",()=>{this.applySavedParameters()})},unmounted(){this.$viewer.localContext.hub.off(this.subscription)},methods:{getSavedParameters(){let e={};try{let t=localStorage.getItem(OB)||"{}";e=JSON.parse(t)}catch{localStorage.removeItem(OB)}return Object.assign({},this.getDefaultParameters(),e)},getDefaultParameters(){return{spacesDisplayed:!0,doorsDisplayed:!1,compassDisplayed:!0,highlightOnHover:!0}},applySavedParameters(){let e=this.getSavedParameters();this.spacesDisplayed=e.spacesDisplayed,this.doorsDisplayed=e.doorsDisplayed,this.viewer2d.settings.compass===void 0?this.compassDisplayed=e.compassDisplayed:this.compassDisplayed=this.viewer2d.settings.compass,this.highlightOnHover=e.highlightOnHover},saveParameters(){let e={spacesDisplayed:this.spacesDisplayed,doorsDisplayed:this.doorsDisplayed,compassDisplayed:this.compassDisplayed,highlightOnHover:this.highlightOnHover};localStorage.setItem(OB,JSON.stringify(e))}}},jtt={class:"viewer2d-parameters"},Qtt={class:"viewer2d-parameters_header"},ztt={class:"viewer2d-parameters_content"},qtt={class:"m-b-18"},Gtt={class:"m-b-18"},Ktt={class:"m-b-18"},Jtt={class:"m-b-18"};function Ztt(e,t,i,o,r,n){let a=I("BIMDataIconParameters"),s=I("BIMDataToggle");return k(),N("div",jtt,[w("div",Qtt,[T(a,{size:"xs",margin:"0 12px 0 0"}),w("span",null,G(e.$t("viewer2d-parameters.title")),1)]),w("div",ztt,[w("div",qtt,[w("span",null,G(e.$t("viewer2d-parameters.ifc_spaces")),1),T(s,{modelValue:n.spacesDisplayed,"onUpdate:modelValue":t[0]||=l=>n.spacesDisplayed=l},null,8,["modelValue"])]),w("div",Gtt,[w("span",null,G(e.$t("viewer2d-parameters.display_door_openings")),1),T(s,{modelValue:n.doorsDisplayed,"onUpdate:modelValue":t[1]||=l=>n.doorsDisplayed=l},null,8,["modelValue"])]),w("div",Ktt,[w("span",null,G(e.$t("viewer2d-parameters.display_compass")),1),T(s,{modelValue:n.compassDisplayed,"onUpdate:modelValue":t[2]||=l=>n.compassDisplayed=l},null,8,["modelValue"])]),w("div",Jtt,[w("span",null,G(e.$t("viewer2d-parameters.highlight")),1),T(s,{modelValue:n.highlightOnHover,"onUpdate:modelValue":t[3]||=l=>n.highlightOnHover=l},null,8,["modelValue"])]),w("div",null,[w("span",null,G(e.$t("viewer2d-parameters.camera_sync")),1),T(s,{modelValue:n.camera3DSynchronization,"onUpdate:modelValue":t[4]||=l=>n.camera3DSynchronization=l},null,8,["modelValue"])])])])}var Wtt={name:"viewer2d-parameters",i18n:{de:{tooltip:"Einstellungen",title:"2D-Viewer Einstellungen",display_door_openings:"T\xFCr\xF6ffnungen anzeigen",display_compass:"Kompass anzeigen",highlight:"Farbliche Markierung",camera_sync:"Mit 3D-Kamera synchronisieren",ifc_spaces:"R\xE4ume"},en:{tooltip:"Parameters",title:"2D viewer settings",display_door_openings:"Display door openings",display_compass:"Display compass",highlight:"Highlight",camera_sync:"Synchronize with a 3D camera",ifc_spaces:"Spaces"},es:{tooltip:"Par\xE1metros",title:"Configuraci\xF3n del visor 2D",display_door_openings:"Abrir las puertas de la pantalla",display_compass:"Br\xFAjula de visualizaci\xF3n",highlight:"Destacar",camera_sync:"Sincronizaci\xF3n con una c\xE1mara 3D",ifc_spaces:"Espacios"},fr:{tooltip:"Param\xE8tres",title:"Param\xE8tres du viewer 2D",display_door_openings:"Afficher l\u2019ouverture de porte",display_compass:"Afficher la boussole",highlight:"Surbrillance",camera_sync:"Synchroniser avec une camera 3D",ifc_spaces:"Espaces"},it:{tooltip:"Impostazioni",title:"Impostazioni del visualizzatore 2D",display_door_openings:"Mostra l'apertura della porta",display_compass:"Mostra la bussola",highlight:"Selezione",camera_sync:"Sincronizza con una fotocamera 3D",ifc_spaces:"Spazi"}},addToWindows:["2d"],component:Q(Vtt,[["render",Ztt],["__scopeId","data-v-df342105"]]),button:{tooltip:"viewer2d-parameters.tooltip",stance:-1,position:"right",content:"simple",icon:{component:"BIMDataIconParameters",options:{size:"m"}}}},Ytt={name:"viewer2d-screenshot",i18n:{de:{tooltip:"Bildschirmaufnahme"},en:{tooltip:"Screenshot"},es:{tooltip:"Captura de pantalla"},fr:{tooltip:"Capture d'\xE9cran"},it:{tooltip:"Screenshot"}},addToWindows:["2d"],component:{computed:{viewer2d(){let e=this.$viewer.localContext.pluginComponentInstances.get("viewer2d");if(e)return e;{let t="'Viewer 2D Screenshot' plugin cannot work without viewer2d plugin.";throw console.error(t),Error(t)}}},async onOpen(){await this.capture(),setTimeout(()=>this.$close())},methods:{async capture(){try{await this.$viewer.localContext.hideUI();let e=this.$viewer.localContext.el,t=!1,i={};document.fullscreenElement===e&&(t=!0,i.width=e.style.width,i.height=e.style.height,e.style.width="100vw",e.style.height="100vh");let o=await(0,U5.default)(this.$viewer.localContext.el);t&&(e.style.width=i.width,e.style.height=i.height);let r=document.createElement("a");r.download=this.viewer2d.ifc&&this.viewer2d.ifc.name?String(this.viewer2d.ifc.name).split(".ifc")[0]:"2d-capture.png",r.href=o.toDataURL(),r.click()}catch(e){console.error(`Unable to take screenshot. err: ${e.message}`)}finally{this.$viewer.localContext.showUI()}}},render:()=>null},button:{tooltip:"viewer2d-screenshot.tooltip",position:"right",content:"simple",icon:{component:"BIMDataIconScreenshot",options:{size:"m"}}}},Ss=class{constructor(e,t){this.items=e||[],this._lastUniqueId=(t||0)+1}addItem(){let e;if(arguments.length===2){let t=arguments[0];if(e=arguments[1],this.items[t])throw"ID clash: '"+t+"'";return this.items[t]=e,t}else for(e=arguments[0]||{};;){let t=this._lastUniqueId++;if(!this.items[t])return this.items[t]=e,t}}removeItem(e){let t=this.items[e];return delete this.items[e],t}},Uj=new Ss,Xtt=class{constructor(e){this.id=e,this.parentItem=null,this.groups=[],this.menuElement=null,this.shown=!1,this.mouseOver=0}},$tt=class{constructor(){this.items=[]}},eit=class{constructor(e,t,i,o,r){this.id=e,this.getTitle=t,this.doAction=i,this.getEnabled=o,this.getShown=r,this.itemElement=null,this.subMenu=null,this.enabled=!0}},tit=class{constructor(e={}){this._id=Uj.addItem(),this._context=null,this._enabled=!1,this._itemsCfg=[],this._rootMenu=null,this._menuList=[],this._menuMap={},this._itemList=[],this._itemMap={},this._shown=!1,this._nextId=0,this._parentNode=e.parentNode||document.body,this._offsetParent=this._parentNode instanceof ShadowRoot?this._parentNode.host:this._parentNode,this._eventSubs={},e.hideOnMouseDown!==!1&&(this._parentNode.addEventListener("mousedown",t=>{t.target.classList.contains("xeokit-context-menu-item")||this.hide()}),this._parentNode.addEventListener("touchstart",this._canvasTouchStartHandler=t=>{t.target.classList.contains("xeokit-context-menu-item")||this.hide()})),e.items&&(this.items=e.items),this._hideOnAction=e.hideOnAction!==!1,this.context=e.context,this.enabled=e.enabled!==!1,this.hide()}on(e,t){let i=this._eventSubs[e];i||(i=[],this._eventSubs[e]=i),i.push(t)}fire(e,t){let i=this._eventSubs[e];if(i)for(let o=0,r=i.length;o<r;o++)i[o](t)}set items(e){this._clear(),this._itemsCfg=e||[],this._parseItems(e),this._createUI()}get items(){return this._itemsCfg}set enabled(e){e=!!e,e!==this._enabled&&(this._enabled=e,this._enabled||this.hide())}get enabled(){return this._enabled}set context(e){this._context=e}get context(){return this._context}show(e,t){if(!this._context){console.error("ContextMenu cannot be shown without a context - set context first");return}this._enabled&&(this._shown||(this._hideAllMenus(),this._updateItemsTitles(),this._updateItemsEnabledStatus(),this._showMenu(this._rootMenu.id,e,t),this._updateSubMenuInfo(),this._shown=!0,this.fire("shown",{})))}get shown(){return this._shown}hide(){this._enabled&&this._shown&&(this._hideAllMenus(),this._shown=!1,this.fire("hidden",{}))}destroy(){this._context=null,this._clear(),this._id!==null&&(Uj.removeItem(this._id),this._id=null)}_clear(){for(let e=0,t=this._menuList.length;e<t;e++)this._menuList[e].menuElement.remove();this._itemsCfg=[],this._rootMenu=null,this._menuList=[],this._menuMap={},this._itemList=[],this._itemMap={}}_parseItems(e){let t=i=>{let o=new Xtt(this._getNextId());for(let r=0,n=i.length;r<n;r++){let a=i[r],s=new $tt;o.groups.push(s);for(let l=0,c=a.length;l<c;l++){let d=a[l],u=d.items,A=u&&u.length>0,h=new eit(this._getNextId(),d.getTitle||(()=>d.title||""),d.doAction||d.callback||(()=>{}),d.getEnabled||(()=>!0),d.getShown||(()=>!0));if(h.parentMenu=o,s.items.push(h),A){let p=t(u);h.subMenu=p,p.parentItem=h}this._itemList.push(h),this._itemMap[h.id]=h}}return this._menuList.push(o),this._menuMap[o.id]=o,o};this._rootMenu=t(e)}_getNextId(){return"ContextMenu_"+this._id+"_"+this._nextId++}_createUI(){let e=t=>{this._createMenuUI(t);let i=t.groups;for(let o=0,r=i.length;o<r;o++){let n=i[o].items;for(let a=0,s=n.length;a<s;a++){let l=n[a].subMenu;l&&e(l)}}};e(this._rootMenu)}_createMenuUI(e){let t=e.groups,i=[],o=document.createElement("div");if(o.classList.add("xeokit-context-menu",e.id),o.style.zIndex=3e5,o.style.position="absolute",i.push("<ul>"),t)for(let a=0,s=t.length;a<s;a++){let l=t[a],c=a,d=s,u=l.items;if(u)for(let A=0,h=u.length;A<h;A++){let p=u[A],f=p.subMenu,m=p.title||"";f?(i.push('<li id="'+p.id+'" class="xeokit-context-menu-item xeokit-context-menu-submenu">'+m+"</li>"),c===d-1||A<h-1||i.push('<li id="'+p.id+'" class="xeokit-context-menu-item-separator"></li>')):(i.push('<li id="'+p.id+'" class="xeokit-context-menu-item">'+m+"</li>"),c===d-1||A<h-1||i.push('<li id="'+p.id+'" class="xeokit-context-menu-item-separator"></li>'))}}i.push("</ul>"),o.innerHTML=i.join(""),this._parentNode.appendChild(o),e.menuElement=o,o.style["border-radius"]="4px",o.style.display="none",o.style["z-index"]=3e5,o.style.background="white",o.style.border="1px solid black",o.style["box-shadow"]="0 4px 5px 0 gray",o.oncontextmenu=a=>{a.preventDefault()};let r=this,n=null;if(t)for(let a=0,s=t.length;a<s;a++){let l=t[a].items;if(l)for(let c=0,d=l.length;c<d;c++){let u=l[c],A=u.subMenu;if(u.itemElement=this._parentNode.querySelector(`#${u.id}`),!u.itemElement){console.error("ContextMenu item element not found: "+u.id);continue}u.itemElement.addEventListener("mouseenter",h=>{h.preventDefault();let p=u.subMenu;if(!p){n&&=(r._hideMenu(n.id),null);return}if(n&&n.id!==p.id&&(r._hideMenu(n.id),n=null),u.enabled===!1)return;let f=u.itemElement,m=p.menuElement,g=f.getBoundingClientRect();m.getBoundingClientRect();let y=r._offsetParent.getBoundingClientRect(),v=g.right+200<y.right,C=g.left-200>y.left;if(v)r._showMenu(p.id,g.right+window.scrollX-5,g.top+window.scrollY-1);else if(C)r._showMenu(p.id,g.left-200+window.scrollX,g.top+window.scrollY-1);else{let x=g.left-y.left,B=y.right-g.right;B>x?r._showMenu(p.id,g.right-5-(200-B),g.top+window.scrollY-1):r._showMenu(p.id,g.left-x,g.top+window.scrollY-1)}n=p}),A||(u.itemElement.addEventListener("click",h=>{h.preventDefault(),r._context&&u.enabled!==!1&&(u.doAction&&u.doAction(r._context),this._hideOnAction?r.hide():(r._updateItemsTitles(),r._updateItemsEnabledStatus()))}),u.itemElement.addEventListener("mouseup",h=>{h.which===3&&(h.preventDefault(),r._context&&u.enabled!==!1&&(u.doAction&&u.doAction(r._context),this._hideOnAction?r.hide():(r._updateItemsTitles(),r._updateItemsEnabledStatus())))}),u.itemElement.addEventListener("mouseenter",h=>{h.preventDefault(),u.enabled!==!1&&u.doHover&&u.doHover(r._context)}))}}}_updateItemsTitles(){if(this._context)for(let e=0,t=this._itemList.length;e<t;e++){let i=this._itemList[e],o=i.itemElement;if(!o)continue;let r=i.getShown;if(!r||!r(this._context))continue;let n=i.getTitle(this._context);i.subMenu,o.innerText=n}}_updateItemsEnabledStatus(){if(this._context)for(let e=0,t=this._itemList.length;e<t;e++){let i=this._itemList[e],o=i.itemElement;if(!o)continue;let r=i.getEnabled;if(!r)continue;let n=i.getShown;if(!n)continue;let a=n(this._context);if(i.shown=a,a)o.style.display="";else{o.style.display="none";continue}let s=r(this._context);i.enabled=s,s?o.classList.remove("disabled"):o.classList.add("disabled")}}_updateSubMenuInfo(){if(!this._context)return;let e,t,i,o,r,n;this._itemList.forEach(a=>{a.subMenu&&(e=a.itemElement,t=e.getBoundingClientRect(),i=a.subMenu.menuElement,o={visibility:i.style.visibility,display:i.style.display},i.style.display="block",i.style.visibility="hidden",n=a.subMenu.menuElement.getBoundingClientRect().width,i.style.visibility=o.visibility,i.style.display=o.display,r=t.right+n>window.innerWidth,e.setAttribute("data-submenuposition",r?"left":"right"))})}_showMenu(e,t,i){let o=this._menuMap[e];if(!o){console.error("Menu not found: "+e);return}if(o.shown)return;let r=o.menuElement;r&&(this._showMenuElement(r,t,i),o.shown=!0)}_hideMenu(e){let t=this._menuMap[e];if(!t){console.error("Menu not found: "+e);return}if(!t.shown)return;let i=t.menuElement;i&&(this._hideMenuElement(i),t.shown=!1)}_hideAllMenus(){for(let e=0,t=this._menuList.length;e<t;e++){let i=this._menuList[e];this._hideMenu(i.id)}}_showMenuElement(e,t,i){e.style.display="block";let o=e.offsetHeight,r=e.offsetWidth,n=this._offsetParent.getBoundingClientRect(),a=this._offsetParent===window.document.body&&n.bottom===0?window.innerHeight:n.bottom+window.scrollY,s=n.right+window.scrollX;i+o>a&&(i=a-o),t+r>s&&(t=s-r),e.style.left=t-n.left-window.scrollX+"px",e.style.top=i-n.top-window.scrollY+"px"}_hideMenuElement(e){e.style.display="none"}},iit=class{constructor(e,t={}){this.viewer=e,this.scene=this.viewer.scene,this._lensCursorDiv=document.createElement("div"),this._lensParams={canvasSize:300,cursorBorder:2,cursorSize:10},this._lensCursorDiv.style.borderRadius="50%",this._lensCursorDiv.style.width=this._lensParams.cursorSize+"px",this._lensCursorDiv.style.height=this._lensParams.cursorSize+"px",this._lensCursorDiv.style.zIndex="100000",this._lensCursorDiv.style.position="absolute",this._lensCursorDiv.style.pointerEvents="none",this._lensContainer=document.createElement("div"),this._lensContainerId=t.containerId||"xeokit-lens",this._lensContainer.setAttribute("id",this._lensContainerId),this._lensContainer.style.border="1px solid black",this._lensContainer.style.background="white",this._lensContainer.style.borderRadius="50%",this._lensContainer.style.width=this._lensParams.canvasSize+"px",this._lensContainer.style.height=this._lensParams.canvasSize+"px",this._lensContainer.style.zIndex="15000",this._lensContainer.style.position="absolute",this._lensContainer.style.pointerEvents="none",this._lensContainer.style.visibility="hidden",this._lensCanvas=document.createElement("canvas"),this._lensCanvas.id=`${this._lensContainerId}-canvas`,this._lensCanvas.style.borderRadius="50%",this._lensCanvas.style.width=this._lensParams.canvasSize+"px",this._lensCanvas.style.height=this._lensParams.canvasSize+"px",this._lensCanvas.style.zIndex="15000",this._lensCanvas.style.pointerEvents="none",document.body.appendChild(this._lensContainer),this._lensContainer.appendChild(this._lensCanvas),this._lensContainer.appendChild(this._lensCursorDiv),this._lensCanvasContext=this._lensCanvas.getContext("2d"),this._canvasElement=this.viewer.scene.canvas.canvas,this._canvasPos=null,this._snappedCanvasPos=null,this._lensPosToggle=t.lensPosToggle||!0,this._lensPosToggleAmount=t.lensPosToggleAmount||85,this._lensPosMarginLeft=t.lensPosMarginLeft||85,this._lensPosMarginTop=t.lensPosMarginTop||25,this._lensContainer.style.marginTop=`${this._lensPosMarginTop}px`,this._lensContainer.style.marginLeft=`${this._lensPosMarginLeft}px`,this._zoomLevel=t.zoomLevel||2,this._active=t.active!==!1,this._visible=!1,this.snapped=!1,this._onViewerRendering=this.viewer.scene.on("rendering",()=>{this._active&&this._visible&&this.update()})}update(){if(!this._active||!this._visible||!this._canvasPos)return;let e=this._lensContainer.getBoundingClientRect(),t=this._canvasElement.getBoundingClientRect(),i=this._canvasPos[0]<e.right&&this._canvasPos[0]>e.left&&this._canvasPos[1]<e.bottom&&this._canvasPos[1]>e.top;this._lensContainer.style.marginLeft=`${this._lensPosMarginLeft}px`,i&&(this._lensPosToggle?this._lensContainer.style.marginTop=`${t.bottom-t.top-this._lensCanvas.height-this._lensPosToggleAmount}px`:this._lensContainer.style.marginTop=`${this._lensPosMarginTop}px`,this._lensPosToggle=!this._lensPosToggle),this._lensCanvasContext.clearRect(0,0,this._lensCanvas.width,this._lensCanvas.height);let o=Math.max(this._lensCanvas.width,this._lensCanvas.height)/this._zoomLevel;this._lensCanvasContext.drawImage(this._canvasElement,this._canvasPos[0]-o/2,this._canvasPos[1]-o/2,o,o,0,0,this._lensCanvas.width,this._lensCanvas.height);let r=this._lensParams.canvasSize/2-this._lensParams.cursorSize/2-this._lensParams.cursorBorder,n=this._snappedCanvasPos?this._snappedCanvasPos[0]-this._canvasPos[0]:0,a=this._snappedCanvasPos?this._snappedCanvasPos[1]-this._canvasPos[1]:0;this._lensCursorDiv.style.left=`${r+n*this._zoomLevel}px`,this._lensCursorDiv.style.top=`${r+a*this._zoomLevel}px`}set zoomFactor(e){this._zoomFactor=e,this.update()}get zoomFactor(){return this._zoomFactor}set canvasPos(e){this._canvasPos=e,this.update()}get canvasPos(){return this._canvasPos}set snappedCanvasPos(e){this._snappedCanvasPos=e,this.update()}get snappedCanvasPos(){return this._snappedCanvasPos}set snapped(e){this._snapped=e;let[t,i]=e?["greenyellow","green"]:["pink","red"];this._lensCursorDiv.style.background=t,this._lensCursorDiv.style.border=this._lensParams.cursorBorder+"px solid "+i}get snapped(){return this._snapped}_updateActiveVisible(){this._lensContainer.style.visibility=this._active&&this._visible?"visible":"hidden",this.update()}set active(e){this._active=e,this._updateActiveVisible()}get active(){return this._active}set visible(e){this._visible=e,this._updateActiveVisible()}get visible(){return this._visible}destroy(){this._destroyed||=(this.viewer.scene.off(this._onViewerRendering),this._lensContainer.removeChild(this._lensCanvas),document.body.removeChild(this._lensContainer),!0)}},z5=!0,jt=z5?Float64Array:Float32Array,p1=new jt(3),q5=new jt(16),G5=new jt(16),rit=new jt(4),b={setDoublePrecisionEnabled(e){z5=e,jt=z5?Float64Array:Float32Array},getDoublePrecisionEnabled(){return z5},MIN_DOUBLE:-(2**53-1),MAX_DOUBLE:2**53-1,MAX_INT:1e7,DEGTORAD:.0174532925,RADTODEG:57.295779513,unglobalizeObjectId(e,t){let i=t.indexOf("#");return i===e.length&&t.startsWith(e)?t.substring(i+1):t},globalizeObjectId(e,t){return e+"#"+t},safeInv(e){let t=1/e;return isNaN(t)||!isFinite(t)?1:t},vec2(e){return new jt(e||2)},vec3(e){return new jt(e||3)},vec4(e){return new jt(e||4)},mat3(e){return new jt(e||9)},mat3ToMat4(e,t=new jt(16)){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},mat4(e){return new jt(e||16)},mat4ToMat3(e,t=new jt(9)){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},doublesToFloats(e,t,i){let o=new jt(2);for(let r=0,n=e.length;r<n;r++)b.splitDouble(e[r],o),t[r]=o[0],i[r]=o[1]},splitDouble(e,t){let i=jt.from([e])[0],o=e-i;t[0]=i,t[1]=o},createUUID:(()=>{let e=[];for(let t=0;t<256;t++)e[t]=(t<16?"0":"")+t.toString(16);return()=>{let t=Math.random()*4294967295|0,i=Math.random()*4294967295|0,o=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return`${e[t&255]+e[t>>8&255]+e[t>>16&255]+e[t>>24&255]}-${e[i&255]}${e[i>>8&255]}-${e[i>>16&15|64]}${e[i>>24&255]}-${e[o&63|128]}${e[o>>8&255]}-${e[o>>16&255]}${e[o>>24&255]}${e[r&255]}${e[r>>8&255]}${e[r>>16&255]}${e[r>>24&255]}`}})(),clamp(e,t,i){return Math.max(t,Math.min(i,e))},fmod(e,t){if(e<t)return console.error("math.fmod : Attempting to find modulus within negative range - would be infinite loop - ignoring"),e;for(;t<=e;)e-=t;return e},compareVec3(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},compareVec4(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},negateVec3(e,t){return t||=e,t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},negateVec4(e,t){return t||=e,t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},addVec4(e,t,i){return i||=e,i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i},addVec4Scalar(e,t,i){return i||=e,i[0]=e[0]+t,i[1]=e[1]+t,i[2]=e[2]+t,i[3]=e[3]+t,i},addVec3(e,t,i){return i||=e,i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i},addVec3Scalar(e,t,i){return i||=e,i[0]=e[0]+t,i[1]=e[1]+t,i[2]=e[2]+t,i},subVec4(e,t,i){return i||=e,i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i},subVec3(e,t,i){return i||=e,i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i},subVec2(e,t,i){return i||=e,i[0]=e[0]-t[0],i[1]=e[1]-t[1],i},geometricMeanVec2(...e){let t=new jt(e[0]);for(let i=1;i<e.length;i++)t[0]+=e[i][0],t[1]+=e[i][1];return t[0]/=e.length,t[1]/=e.length,t},subVec4Scalar(e,t,i){return i||=e,i[0]=e[0]-t,i[1]=e[1]-t,i[2]=e[2]-t,i[3]=e[3]-t,i},subScalarVec4(e,t,i){return i||=e,i[0]=t-e[0],i[1]=t-e[1],i[2]=t-e[2],i[3]=t-e[3],i},mulVec4(e,t,i){return i||=e,i[0]=e[0]*t[0],i[1]=e[1]*t[1],i[2]=e[2]*t[2],i[3]=e[3]*t[3],i},mulVec4Scalar(e,t,i){return i||=e,i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i},mulVec3Scalar(e,t,i){return i||=e,i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i},mulVec2Scalar(e,t,i){return i||=e,i[0]=e[0]*t,i[1]=e[1]*t,i},divVec3(e,t,i){return i||=e,i[0]=e[0]/t[0],i[1]=e[1]/t[1],i[2]=e[2]/t[2],i},divVec4(e,t,i){return i||=e,i[0]=e[0]/t[0],i[1]=e[1]/t[1],i[2]=e[2]/t[2],i[3]=e[3]/t[3],i},divScalarVec3(e,t,i){return i||=t,i[0]=e/t[0],i[1]=e/t[1],i[2]=e/t[2],i},divVec3Scalar(e,t,i){return i||=e,i[0]=e[0]/t,i[1]=e[1]/t,i[2]=e[2]/t,i},divVec4Scalar(e,t,i){return i||=e,i[0]=e[0]/t,i[1]=e[1]/t,i[2]=e[2]/t,i[3]=e[3]/t,i},divScalarVec4(e,t,i){return i||=t,i[0]=e/t[0],i[1]=e/t[1],i[2]=e/t[2],i[3]=e/t[3],i},dotVec4(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},cross3Vec4(e,t){let i=e[0],o=e[1],r=e[2],n=t[0],a=t[1],s=t[2];return[o*s-r*a,r*n-i*s,i*a-o*n,0]},cross3Vec3(e,t,i){i||=e;let o=e[0],r=e[1],n=e[2],a=t[0],s=t[1],l=t[2];return i[0]=r*l-n*s,i[1]=n*a-o*l,i[2]=o*s-r*a,i},sqLenVec4(e){return b.dotVec4(e,e)},lenVec4(e){return Math.sqrt(b.sqLenVec4(e))},dotVec3(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},dotVec2(e,t){return e[0]*t[0]+e[1]*t[1]},sqLenVec3(e){return b.dotVec3(e,e)},sqLenVec2(e){return b.dotVec2(e,e)},lenVec3(e){return Math.sqrt(b.sqLenVec3(e))},distVec3:(()=>{let e=new jt(3);return(t,i)=>b.lenVec3(b.subVec3(t,i,e))})(),lenVec2(e){return Math.sqrt(b.sqLenVec2(e))},distVec2:(()=>{let e=new jt(2);return(t,i)=>b.lenVec2(b.subVec2(t,i,e))})(),rcpVec3(e,t){return b.divScalarVec3(1,e,t)},normalizeVec4(e,t){let i=1/b.lenVec4(e);return b.mulVec4Scalar(e,i,t)},normalizeVec3(e,t){let i=1/b.lenVec3(e);return b.mulVec3Scalar(e,i,t)},normalizeVec2(e,t){let i=1/b.lenVec2(e);return b.mulVec2Scalar(e,i,t)},angleVec3(e,t){let i=b.dotVec3(e,t)/Math.sqrt(b.sqLenVec3(e)*b.sqLenVec3(t));return i=i<-1?-1:i>1?1:i,Math.acos(i)},vec3FromMat4Scale:(()=>{let e=new jt(3);return(t,i)=>(e[0]=t[0],e[1]=t[1],e[2]=t[2],i[0]=b.lenVec3(e),e[0]=t[4],e[1]=t[5],e[2]=t[6],i[1]=b.lenVec3(e),e[0]=t[8],e[1]=t[9],e[2]=t[10],i[2]=b.lenVec3(e),i)})(),vecToArray:(()=>{function e(t){return Math.round(t*1e5)/1e5}return t=>{t=Array.prototype.slice.call(t);for(let i=0,o=t.length;i<o;i++)t[i]=e(t[i]);return t}})(),xyzArrayToObject(e){return{x:e[0],y:e[1],z:e[2]}},xyzObjectToArray(e,t){return t||=b.vec3(),t[0]=e.x,t[1]=e.y,t[2]=e.z,t},dupMat4(e){return e.slice(0,16)},mat4To3(e){return[e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]]},m4s(e){return[e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e]},setMat4ToZeroes(){return b.m4s(0)},setMat4ToOnes(){return b.m4s(1)},diagonalMat4v(e){return new jt([e[0],0,0,0,0,e[1],0,0,0,0,e[2],0,0,0,0,e[3]])},diagonalMat4c(e,t,i,o){return b.diagonalMat4v([e,t,i,o])},diagonalMat4s(e){return b.diagonalMat4c(e,e,e,e)},identityMat4(e=new jt(16)){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},identityMat3(e=new jt(9)){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},isIdentityMat4(e){return!(e[0]!==1||e[1]!==0||e[2]!==0||e[3]!==0||e[4]!==0||e[5]!==1||e[6]!==0||e[7]!==0||e[8]!==0||e[9]!==0||e[10]!==1||e[11]!==0||e[12]!==0||e[13]!==0||e[14]!==0||e[15]!==1)},negateMat4(e,t){return t||=e,t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},addMat4(e,t,i){return i||=e,i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i[9]=e[9]+t[9],i[10]=e[10]+t[10],i[11]=e[11]+t[11],i[12]=e[12]+t[12],i[13]=e[13]+t[13],i[14]=e[14]+t[14],i[15]=e[15]+t[15],i},addMat4Scalar(e,t,i){return i||=e,i[0]=e[0]+t,i[1]=e[1]+t,i[2]=e[2]+t,i[3]=e[3]+t,i[4]=e[4]+t,i[5]=e[5]+t,i[6]=e[6]+t,i[7]=e[7]+t,i[8]=e[8]+t,i[9]=e[9]+t,i[10]=e[10]+t,i[11]=e[11]+t,i[12]=e[12]+t,i[13]=e[13]+t,i[14]=e[14]+t,i[15]=e[15]+t,i},addScalarMat4(e,t,i){return b.addMat4Scalar(t,e,i)},subMat4(e,t,i){return i||=e,i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i[9]=e[9]-t[9],i[10]=e[10]-t[10],i[11]=e[11]-t[11],i[12]=e[12]-t[12],i[13]=e[13]-t[13],i[14]=e[14]-t[14],i[15]=e[15]-t[15],i},subMat4Scalar(e,t,i){return i||=e,i[0]=e[0]-t,i[1]=e[1]-t,i[2]=e[2]-t,i[3]=e[3]-t,i[4]=e[4]-t,i[5]=e[5]-t,i[6]=e[6]-t,i[7]=e[7]-t,i[8]=e[8]-t,i[9]=e[9]-t,i[10]=e[10]-t,i[11]=e[11]-t,i[12]=e[12]-t,i[13]=e[13]-t,i[14]=e[14]-t,i[15]=e[15]-t,i},subScalarMat4(e,t,i){return i||=t,i[0]=e-t[0],i[1]=e-t[1],i[2]=e-t[2],i[3]=e-t[3],i[4]=e-t[4],i[5]=e-t[5],i[6]=e-t[6],i[7]=e-t[7],i[8]=e-t[8],i[9]=e-t[9],i[10]=e-t[10],i[11]=e-t[11],i[12]=e-t[12],i[13]=e-t[13],i[14]=e-t[14],i[15]=e-t[15],i},mulMat4(e,t,i){i||=e;let o=e[0],r=e[1],n=e[2],a=e[3],s=e[4],l=e[5],c=e[6],d=e[7],u=e[8],A=e[9],h=e[10],p=e[11],f=e[12],m=e[13],g=e[14],y=e[15],v=t[0],C=t[1],x=t[2],B=t[3],E=t[4],D=t[5],P=t[6],M=t[7],R=t[8],O=t[9],V=t[10],z=t[11],K=t[12],Z=t[13],te=t[14],ie=t[15];return i[0]=v*o+C*s+x*u+B*f,i[1]=v*r+C*l+x*A+B*m,i[2]=v*n+C*c+x*h+B*g,i[3]=v*a+C*d+x*p+B*y,i[4]=E*o+D*s+P*u+M*f,i[5]=E*r+D*l+P*A+M*m,i[6]=E*n+D*c+P*h+M*g,i[7]=E*a+D*d+P*p+M*y,i[8]=R*o+O*s+V*u+z*f,i[9]=R*r+O*l+V*A+z*m,i[10]=R*n+O*c+V*h+z*g,i[11]=R*a+O*d+V*p+z*y,i[12]=K*o+Z*s+te*u+ie*f,i[13]=K*r+Z*l+te*A+ie*m,i[14]=K*n+Z*c+te*h+ie*g,i[15]=K*a+Z*d+te*p+ie*y,i},mulMat3(e,t,i){i||=new jt(9);let o=e[0],r=e[3],n=e[6],a=e[1],s=e[4],l=e[7],c=e[2],d=e[5],u=e[8],A=t[0],h=t[3],p=t[6],f=t[1],m=t[4],g=t[7],y=t[2],v=t[5],C=t[8];return i[0]=o*A+r*f+n*y,i[3]=o*h+r*m+n*v,i[6]=o*p+r*g+n*C,i[1]=a*A+s*f+l*y,i[4]=a*h+s*m+l*v,i[7]=a*p+s*g+l*C,i[2]=c*A+d*f+u*y,i[5]=c*h+d*m+u*v,i[8]=c*p+d*g+u*C,i},mulMat4Scalar(e,t,i){return i||=e,i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i[9]=e[9]*t,i[10]=e[10]*t,i[11]=e[11]*t,i[12]=e[12]*t,i[13]=e[13]*t,i[14]=e[14]*t,i[15]=e[15]*t,i},mulMat4v4(e,t,i=b.vec4()){let o=t[0],r=t[1],n=t[2],a=t[3];return i[0]=e[0]*o+e[4]*r+e[8]*n+e[12]*a,i[1]=e[1]*o+e[5]*r+e[9]*n+e[13]*a,i[2]=e[2]*o+e[6]*r+e[10]*n+e[14]*a,i[3]=e[3]*o+e[7]*r+e[11]*n+e[15]*a,i},transposeMat4(e,t){let i=e[4],o=e[14],r=e[8],n=e[13],a=e[12],s=e[9];if(!t||e===t){let l=e[1],c=e[2],d=e[3],u=e[6],A=e[7],h=e[11];return e[1]=i,e[2]=r,e[3]=a,e[4]=l,e[6]=s,e[7]=n,e[8]=c,e[9]=u,e[11]=o,e[12]=d,e[13]=A,e[14]=h,e}return t[0]=e[0],t[1]=i,t[2]=r,t[3]=a,t[4]=e[1],t[5]=e[5],t[6]=s,t[7]=n,t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=o,t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t},transposeMat3(e,t){if(t===e){let i=e[1],o=e[2],r=e[5];t[1]=e[3],t[2]=e[6],t[3]=i,t[5]=e[7],t[6]=o,t[7]=r}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},determinantMat4(e){let t=e[0],i=e[1],o=e[2],r=e[3],n=e[4],a=e[5],s=e[6],l=e[7],c=e[8],d=e[9],u=e[10],A=e[11],h=e[12],p=e[13],f=e[14],m=e[15];return h*d*s*r-c*p*s*r-h*a*u*r+n*p*u*r+c*a*f*r-n*d*f*r-h*d*o*l+c*p*o*l+h*i*u*l-t*p*u*l-c*i*f*l+t*d*f*l+h*a*o*A-n*p*o*A-h*i*s*A+t*p*s*A+n*i*f*A-t*a*f*A-c*a*o*m+n*d*o*m+c*i*s*m-t*d*s*m-n*i*u*m+t*a*u*m},inverseMat4(e,t){t||=e;let i=e[0],o=e[1],r=e[2],n=e[3],a=e[4],s=e[5],l=e[6],c=e[7],d=e[8],u=e[9],A=e[10],h=e[11],p=e[12],f=e[13],m=e[14],g=e[15],y=i*s-o*a,v=i*l-r*a,C=i*c-n*a,x=o*l-r*s,B=o*c-n*s,E=r*c-n*l,D=d*f-u*p,P=d*m-A*p,M=d*g-h*p,R=u*m-A*f,O=u*g-h*f,V=A*g-h*m,z=1/(y*V-v*O+C*R+x*M-B*P+E*D);return t[0]=(s*V-l*O+c*R)*z,t[1]=(-o*V+r*O-n*R)*z,t[2]=(f*E-m*B+g*x)*z,t[3]=(-u*E+A*B-h*x)*z,t[4]=(-a*V+l*M-c*P)*z,t[5]=(i*V-r*M+n*P)*z,t[6]=(-p*E+m*C-g*v)*z,t[7]=(d*E-A*C+h*v)*z,t[8]=(a*O-s*M+c*D)*z,t[9]=(-i*O+o*M-n*D)*z,t[10]=(p*B-f*C+g*y)*z,t[11]=(-d*B+u*C-h*y)*z,t[12]=(-a*R+s*P-l*D)*z,t[13]=(i*R-o*P+r*D)*z,t[14]=(-p*x+f*v-m*y)*z,t[15]=(d*x-u*v+A*y)*z,t},traceMat4(e){return e[0]+e[5]+e[10]+e[15]},translationMat4v(e,t){let i=t||b.identityMat4();return i[12]=e[0],i[13]=e[1],i[14]=e[2],i},translationMat3v(e,t){let i=t||b.identityMat3();return i[6]=e[0],i[7]=e[1],i},translationMat4c:(()=>{let e=new jt(3);return(t,i,o,r)=>(e[0]=t,e[1]=i,e[2]=o,b.translationMat4v(e,r))})(),translationMat4s(e,t){return b.translationMat4c(e,e,e,t)},translateMat4v(e,t){return b.translateMat4c(e[0],e[1],e[2],t)},translateMat4c(e,t,i,o){let r=o[3];o[0]+=r*e,o[1]+=r*t,o[2]+=r*i;let n=o[7];o[4]+=n*e,o[5]+=n*t,o[6]+=n*i;let a=o[11];o[8]+=a*e,o[9]+=a*t,o[10]+=a*i;let s=o[15];return o[12]+=s*e,o[13]+=s*t,o[14]+=s*i,o},setMat4Translation(e,t,i){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=t[0],i[13]=t[1],i[14]=t[2],i[15]=e[15],i},rotationMat4v(e,t,i){let o=b.normalizeVec4([t[0],t[1],t[2],0],[]),r=Math.sin(e),n=Math.cos(e),a=1-n,s=o[0],l=o[1],c=o[2],d,u,A,h,p,f;return d=s*l,u=l*c,A=c*s,h=s*r,p=l*r,f=c*r,i||=b.mat4(),i[0]=a*s*s+n,i[1]=a*d+f,i[2]=a*A-p,i[3]=0,i[4]=a*d-f,i[5]=a*l*l+n,i[6]=a*u+h,i[7]=0,i[8]=a*A+p,i[9]=a*u-h,i[10]=a*c*c+n,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},rotationMat4c(e,t,i,o,r){return b.rotationMat4v(e,[t,i,o],r)},scalingMat4v(e,t=b.identityMat4()){return t[0]=e[0],t[5]=e[1],t[10]=e[2],t},scalingMat3v(e,t=b.identityMat3()){return t[0]=e[0],t[4]=e[1],t},scalingMat4c:(()=>{let e=new jt(3);return(t,i,o,r)=>(e[0]=t,e[1]=i,e[2]=o,b.scalingMat4v(e,r))})(),scaleMat4c(e,t,i,o){return o[0]*=e,o[4]*=t,o[8]*=i,o[1]*=e,o[5]*=t,o[9]*=i,o[2]*=e,o[6]*=t,o[10]*=i,o[3]*=e,o[7]*=t,o[11]*=i,o},scaleMat4v(e,t){let i=e[0],o=e[1],r=e[2];return t[0]*=i,t[4]*=o,t[8]*=r,t[1]*=i,t[5]*=o,t[9]*=r,t[2]*=i,t[6]*=o,t[10]*=r,t[3]*=i,t[7]*=o,t[11]*=r,t},scalingMat4s(e){return b.scalingMat4c(e,e,e)},rotationTranslationMat4(e,t,i=b.mat4()){let o=e[0],r=e[1],n=e[2],a=e[3],s=o+o,l=r+r,c=n+n,d=o*s,u=o*l,A=o*c,h=r*l,p=r*c,f=n*c,m=a*s,g=a*l,y=a*c;return i[0]=1-(h+f),i[1]=u+y,i[2]=A-g,i[3]=0,i[4]=u-y,i[5]=1-(d+f),i[6]=p+m,i[7]=0,i[8]=A+g,i[9]=p-m,i[10]=1-(d+h),i[11]=0,i[12]=t[0],i[13]=t[1],i[14]=t[2],i[15]=1,i},mat4ToEuler(e,t,i=b.vec4()){let o=b.clamp,r=e[0],n=e[4],a=e[8],s=e[1],l=e[5],c=e[9],d=e[2],u=e[6],A=e[10];return t==="XYZ"?(i[1]=Math.asin(o(a,-1,1)),Math.abs(a)<.99999?(i[0]=Math.atan2(-c,A),i[2]=Math.atan2(-n,r)):(i[0]=Math.atan2(u,l),i[2]=0)):t==="YXZ"?(i[0]=Math.asin(-o(c,-1,1)),Math.abs(c)<.99999?(i[1]=Math.atan2(a,A),i[2]=Math.atan2(s,l)):(i[1]=Math.atan2(-d,r),i[2]=0)):t==="ZXY"?(i[0]=Math.asin(o(u,-1,1)),Math.abs(u)<.99999?(i[1]=Math.atan2(-d,A),i[2]=Math.atan2(-n,l)):(i[1]=0,i[2]=Math.atan2(s,r))):t==="ZYX"?(i[1]=Math.asin(-o(d,-1,1)),Math.abs(d)<.99999?(i[0]=Math.atan2(u,A),i[2]=Math.atan2(s,r)):(i[0]=0,i[2]=Math.atan2(-n,l))):t==="YZX"?(i[2]=Math.asin(o(s,-1,1)),Math.abs(s)<.99999?(i[0]=Math.atan2(-c,l),i[1]=Math.atan2(-d,r)):(i[0]=0,i[1]=Math.atan2(a,A))):t==="XZY"&&(i[2]=Math.asin(-o(n,-1,1)),Math.abs(n)<.99999?(i[0]=Math.atan2(u,l),i[1]=Math.atan2(a,r)):(i[0]=Math.atan2(-c,A),i[1]=0)),i[0]*=b.RADTODEG,i[1]*=b.RADTODEG,i[2]*=b.RADTODEG,i},composeMat4(e,t,i,o=b.mat4()){return b.quaternionToRotationMat4(t,o),b.scaleMat4v(i,o),b.translateMat4v(e,o),o},decomposeMat4:(()=>{let e=new jt(3),t=new jt(16);return function(i,o,r,n){e[0]=i[0],e[1]=i[1],e[2]=i[2];let a=b.lenVec3(e);e[0]=i[4],e[1]=i[5],e[2]=i[6];let s=b.lenVec3(e);e[8]=i[8],e[9]=i[9],e[10]=i[10];let l=b.lenVec3(e);b.determinantMat4(i)<0&&(a=-a),o[0]=i[12],o[1]=i[13],o[2]=i[14],t.set(i);let c=1/a,d=1/s,u=1/l;return t[0]*=c,t[1]*=c,t[2]*=c,t[4]*=d,t[5]*=d,t[6]*=d,t[8]*=u,t[9]*=u,t[10]*=u,b.mat4ToQuaternion(t,r),n[0]=a,n[1]=s,n[2]=l,this}})(),getColMat4(e,t){let i=t*4;return[e[i],e[i+1],e[i+2],e[i+3]]},setRowMat4(e,t,i){e[t]=i[0],e[t+4]=i[1],e[t+8]=i[2],e[t+12]=i[3]},lookAtMat4v(e,t,i,o){o||=b.mat4();let r=e[0],n=e[1],a=e[2],s=i[0],l=i[1],c=i[2],d=t[0],u=t[1],A=t[2];if(r===d&&n===u&&a===A)return b.identityMat4();let h,p,f,m,g,y,v,C,x,B;return h=r-d,p=n-u,f=a-A,B=1/Math.sqrt(h*h+p*p+f*f),h*=B,p*=B,f*=B,m=l*f-c*p,g=c*h-s*f,y=s*p-l*h,B=Math.sqrt(m*m+g*g+y*y),B?(B=1/B,m*=B,g*=B,y*=B):(m=0,g=0,y=0),v=p*y-f*g,C=f*m-h*y,x=h*g-p*m,B=Math.sqrt(v*v+C*C+x*x),B?(B=1/B,v*=B,C*=B,x*=B):(v=0,C=0,x=0),o[0]=m,o[1]=v,o[2]=h,o[3]=0,o[4]=g,o[5]=C,o[6]=p,o[7]=0,o[8]=y,o[9]=x,o[10]=f,o[11]=0,o[12]=-(m*r+g*n+y*a),o[13]=-(v*r+C*n+x*a),o[14]=-(h*r+p*n+f*a),o[15]=1,o},lookAtMat4c(e,t,i,o,r,n,a,s,l){return b.lookAtMat4v([e,t,i],[o,r,n],[a,s,l],[])},orthoMat4c(e,t,i,o,r,n,a){a||=b.mat4();let s=t-e,l=o-i,c=n-r;return a[0]=2/s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=2/l,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=-2/c,a[11]=0,a[12]=-(e+t)/s,a[13]=-(o+i)/l,a[14]=-(n+r)/c,a[15]=1,a},frustumMat4v(e,t,i){i||=b.mat4();let o=[e[0],e[1],e[2],0],r=[t[0],t[1],t[2],0];b.addVec4(r,o,q5),b.subVec4(r,o,G5);let n=2*o[2],a=G5[0],s=G5[1],l=G5[2];return i[0]=n/a,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=n/s,i[6]=0,i[7]=0,i[8]=q5[0]/a,i[9]=q5[1]/s,i[10]=-q5[2]/l,i[11]=-1,i[12]=0,i[13]=0,i[14]=-n*r[2]/l,i[15]=0,i},frustumMat4(e,t,i,o,r,n,a){a||=b.mat4();let s=t-e,l=o-i,c=n-r;return a[0]=r*2/s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=r*2/l,a[6]=0,a[7]=0,a[8]=(t+e)/s,a[9]=(o+i)/l,a[10]=-(n+r)/c,a[11]=-1,a[12]=0,a[13]=0,a[14]=-(n*r*2)/c,a[15]=0,a},perspectiveMat4(e,t,i,o,r){let n=[],a=[];return n[2]=i,a[2]=o,a[1]=n[2]*Math.tan(e/2),n[1]=-a[1],a[0]=a[1]*t,n[0]=-a[0],b.frustumMat4v(n,a,r)},compareMat4(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]},transformPoint3(e,t,i=b.vec3()){let o=t[0],r=t[1],n=t[2];return i[0]=e[0]*o+e[4]*r+e[8]*n+e[12],i[1]=e[1]*o+e[5]*r+e[9]*n+e[13],i[2]=e[2]*o+e[6]*r+e[10]*n+e[14],i},transformPoint4(e,t,i=b.vec4()){return i[0]=e[0]*t[0]+e[4]*t[1]+e[8]*t[2]+e[12]*t[3],i[1]=e[1]*t[0]+e[5]*t[1]+e[9]*t[2]+e[13]*t[3],i[2]=e[2]*t[0]+e[6]*t[1]+e[10]*t[2]+e[14]*t[3],i[3]=e[3]*t[0]+e[7]*t[1]+e[11]*t[2]+e[15]*t[3],i},transformPoints3(e,t,i){let o=i||[],r=t.length,n,a,s,l,c=e[0],d=e[1],u=e[2],A=e[3],h=e[4],p=e[5],f=e[6],m=e[7],g=e[8],y=e[9],v=e[10],C=e[11],x=e[12],B=e[13],E=e[14],D=e[15],P;for(let M=0;M<r;++M)l=t[M],n=l[0],a=l[1],s=l[2],P=o[M]||(o[M]=[0,0,0]),P[0]=c*n+h*a+g*s+x,P[1]=d*n+p*a+y*s+B,P[2]=u*n+f*a+v*s+E,P[3]=A*n+m*a+C*s+D;return o.length=r,o},transformPositions3(e,t,i=t){let o,r=t.length,n,a,s,l=e[0],c=e[1],d=e[2];e[3];let u=e[4],A=e[5],h=e[6];e[7];let p=e[8],f=e[9],m=e[10];e[11];let g=e[12],y=e[13],v=e[14];for(e[15],o=0;o<r;o+=3)n=t[o+0],a=t[o+1],s=t[o+2],i[o+0]=l*n+u*a+p*s+g,i[o+1]=c*n+A*a+f*s+y,i[o+2]=d*n+h*a+m*s+v;return i},transformPositions4(e,t,i=t){let o,r=t.length,n,a,s,l=e[0],c=e[1],d=e[2],u=e[3],A=e[4],h=e[5],p=e[6],f=e[7],m=e[8],g=e[9],y=e[10],v=e[11],C=e[12],x=e[13],B=e[14],E=e[15];for(o=0;o<r;o+=4)n=t[o+0],a=t[o+1],s=t[o+2],i[o+0]=l*n+A*a+m*s+C,i[o+1]=c*n+h*a+g*s+x,i[o+2]=d*n+p*a+y*s+B,i[o+3]=u*n+f*a+v*s+E;return i},transformVec3(e,t,i){let o=t[0],r=t[1],n=t[2];return i||=this.vec3(),i[0]=e[0]*o+e[4]*r+e[8]*n,i[1]=e[1]*o+e[5]*r+e[9]*n,i[2]=e[2]*o+e[6]*r+e[10]*n,i},transformVec4(e,t,i){let o=t[0],r=t[1],n=t[2],a=t[3];return i||=b.vec4(),i[0]=e[0]*o+e[4]*r+e[8]*n+e[12]*a,i[1]=e[1]*o+e[5]*r+e[9]*n+e[13]*a,i[2]=e[2]*o+e[6]*r+e[10]*n+e[14]*a,i[3]=e[3]*o+e[7]*r+e[11]*n+e[15]*a,i},rotateVec2(e,t,i,o=e){let r=Math.cos(i),n=Math.sin(i),a=e[0]-t[0],s=e[1]-t[1];return o[0]=a*r-s*n+t[0],o[1]=a*n+s*r+t[1],e},rotateVec3X(e,t,i,o){let r=[],n=[];return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],n[0]=r[0],n[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),n[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),o[0]=n[0]+t[0],o[1]=n[1]+t[1],o[2]=n[2]+t[2],o},rotateVec3Y(e,t,i,o){let r=[],n=[];return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],n[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),n[1]=r[1],n[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),o[0]=n[0]+t[0],o[1]=n[1]+t[1],o[2]=n[2]+t[2],o},rotateVec3Z(e,t,i,o){let r=[],n=[];return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],n[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),n[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),n[2]=r[2],o[0]=n[0]+t[0],o[1]=n[1]+t[1],o[2]=n[2]+t[2],o},projectVec4(e,t){let i=1/e[3];return t||=b.vec2(),t[0]=e[0]*i,t[1]=e[1]*i,t},unprojectVec3:(()=>{let e=new jt(16),t=new jt(16),i=new jt(16);return function(o,r,n,a){return this.transformVec3(this.mulMat4(this.inverseMat4(r,e),this.inverseMat4(n,t),i),o,a)}})(),lerpVec3(e,t,i,o,r,n){let a=n||b.vec3(),s=(e-t)/(i-t);return a[0]=o[0]+s*(r[0]-o[0]),a[1]=o[1]+s*(r[1]-o[1]),a[2]=o[2]+s*(r[2]-o[2]),a},lerpMat4(e,t,i,o,r,n){let a=n||b.mat4(),s=(e-t)/(i-t);return a[0]=o[0]+s*(r[0]-o[0]),a[1]=o[1]+s*(r[1]-o[1]),a[2]=o[2]+s*(r[2]-o[2]),a[3]=o[3]+s*(r[3]-o[3]),a[4]=o[4]+s*(r[4]-o[4]),a[5]=o[5]+s*(r[5]-o[5]),a[6]=o[6]+s*(r[6]-o[6]),a[7]=o[7]+s*(r[7]-o[7]),a[8]=o[8]+s*(r[8]-o[8]),a[9]=o[9]+s*(r[9]-o[9]),a[10]=o[10]+s*(r[10]-o[10]),a[11]=o[11]+s*(r[11]-o[11]),a[12]=o[12]+s*(r[12]-o[12]),a[13]=o[13]+s*(r[13]-o[13]),a[14]=o[14]+s*(r[14]-o[14]),a[15]=o[15]+s*(r[15]-o[15]),a},flatten(e){let t=[],i,o,r,n,a;for(i=0,o=e.length;i<o;i++)for(a=e[i],r=0,n=a.length;r<n;r++)t.push(a[r]);return t},identityQuaternion(e=b.vec4()){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},eulerToQuaternion(e,t,i=b.vec4()){let o=e[0]*b.DEGTORAD/2,r=e[1]*b.DEGTORAD/2,n=e[2]*b.DEGTORAD/2,a=Math.cos(o),s=Math.cos(r),l=Math.cos(n),c=Math.sin(o),d=Math.sin(r),u=Math.sin(n);return t==="XYZ"?(i[0]=c*s*l+a*d*u,i[1]=a*d*l-c*s*u,i[2]=a*s*u+c*d*l,i[3]=a*s*l-c*d*u):t==="YXZ"?(i[0]=c*s*l+a*d*u,i[1]=a*d*l-c*s*u,i[2]=a*s*u-c*d*l,i[3]=a*s*l+c*d*u):t==="ZXY"?(i[0]=c*s*l-a*d*u,i[1]=a*d*l+c*s*u,i[2]=a*s*u+c*d*l,i[3]=a*s*l-c*d*u):t==="ZYX"?(i[0]=c*s*l-a*d*u,i[1]=a*d*l+c*s*u,i[2]=a*s*u-c*d*l,i[3]=a*s*l+c*d*u):t==="YZX"?(i[0]=c*s*l+a*d*u,i[1]=a*d*l+c*s*u,i[2]=a*s*u-c*d*l,i[3]=a*s*l-c*d*u):t==="XZY"&&(i[0]=c*s*l-a*d*u,i[1]=a*d*l-c*s*u,i[2]=a*s*u+c*d*l,i[3]=a*s*l+c*d*u),i},mat4ToQuaternion(e,t=b.vec4()){let i=e[0],o=e[4],r=e[8],n=e[1],a=e[5],s=e[9],l=e[2],c=e[6],d=e[10],u,A=i+a+d;return A>0?(u=.5/Math.sqrt(A+1),t[3]=.25/u,t[0]=(c-s)*u,t[1]=(r-l)*u,t[2]=(n-o)*u):i>a&&i>d?(u=2*Math.sqrt(1+i-a-d),t[3]=(c-s)/u,t[0]=.25*u,t[1]=(o+n)/u,t[2]=(r+l)/u):a>d?(u=2*Math.sqrt(1+a-i-d),t[3]=(r-l)/u,t[0]=(o+n)/u,t[1]=.25*u,t[2]=(s+c)/u):(u=2*Math.sqrt(1+d-i-a),t[3]=(n-o)/u,t[0]=(r+l)/u,t[1]=(s+c)/u,t[2]=.25*u),t},vec3PairToQuaternion(e,t,i=b.vec4()){let o=Math.sqrt(b.dotVec3(e,e)*b.dotVec3(t,t)),r=o+b.dotVec3(e,t);return r<1e-8*o?(r=0,Math.abs(e[0])>Math.abs(e[2])?(i[0]=-e[1],i[1]=e[0],i[2]=0):(i[0]=0,i[1]=-e[2],i[2]=e[1])):b.cross3Vec3(e,t,i),i[3]=r,b.normalizeQuaternion(i)},angleAxisToQuaternion(e,t=b.vec4()){let i=e[3]/2,o=Math.sin(i);return t[0]=o*e[0],t[1]=o*e[1],t[2]=o*e[2],t[3]=Math.cos(i),t},quaternionToEuler:(()=>{let e=new jt(16);return(t,i,o)=>(o||=b.vec3(),b.quaternionToRotationMat4(t,e),b.mat4ToEuler(e,i,o),o)})(),mulQuaternions(e,t,i=b.vec4()){let o=e[0],r=e[1],n=e[2],a=e[3],s=t[0],l=t[1],c=t[2],d=t[3];return i[0]=a*s+o*d+r*c-n*l,i[1]=a*l+r*d+n*s-o*c,i[2]=a*c+n*d+o*l-r*s,i[3]=a*d-o*s-r*l-n*c,i},vec3ApplyQuaternion(e,t,i=b.vec3()){let o=t[0],r=t[1],n=t[2],a=e[0],s=e[1],l=e[2],c=e[3],d=c*o+s*n-l*r,u=c*r+l*o-a*n,A=c*n+a*r-s*o,h=-a*o-s*r-l*n;return i[0]=d*c+h*-a+u*-l-A*-s,i[1]=u*c+h*-s+A*-a-d*-l,i[2]=A*c+h*-l+d*-s-u*-a,i},quaternionToMat4(e,t){t=b.identityMat4(t);let i=e[0],o=e[1],r=e[2],n=e[3],a=2*i,s=2*o,l=2*r,c=a*n,d=s*n,u=l*n,A=a*i,h=s*i,p=l*i,f=s*o,m=l*o,g=l*r;return t[0]=1-(f+g),t[1]=h+u,t[2]=p-d,t[4]=h-u,t[5]=1-(A+g),t[6]=m+c,t[8]=p+d,t[9]=m-c,t[10]=1-(A+f),t},quaternionToRotationMat4(e,t){let i=e[0],o=e[1],r=e[2],n=e[3],a=i+i,s=o+o,l=r+r,c=i*a,d=i*s,u=i*l,A=o*s,h=o*l,p=r*l,f=n*a,m=n*s,g=n*l;return t[0]=1-(A+p),t[4]=d-g,t[8]=u+m,t[1]=d+g,t[5]=1-(c+p),t[9]=h-f,t[2]=u-m,t[6]=h+f,t[10]=1-(c+A),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},normalizeQuaternion(e,t=e){let i=b.lenVec4([e[0],e[1],e[2],e[3]]);return t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i,t[3]=e[3]/i,t},conjugateQuaternion(e,t=e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},inverseQuaternion(e,t){return b.normalizeQuaternion(b.conjugateQuaternion(e,t))},quaternionToAngleAxis(e,t=b.vec4()){e=b.normalizeQuaternion(e,rit);let i=e[3],o=2*Math.acos(i),r=Math.sqrt(1-i*i);return r<.001?(t[0]=e[0],t[1]=e[1],t[2]=e[2]):(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r),t[3]=o,t},AABB3(e){return new jt(e||6)},AABB2(e){return new jt(e||4)},OBB3(e){return new jt(e||32)},OBB2(e){return new jt(e||16)},Sphere3(e,t,i,o){return new jt([e,t,i,o])},transformOBB3(e,t,i=t){let o,r=t.length,n,a,s,l=e[0],c=e[1],d=e[2],u=e[3],A=e[4],h=e[5],p=e[6],f=e[7],m=e[8],g=e[9],y=e[10],v=e[11],C=e[12],x=e[13],B=e[14],E=e[15];for(o=0;o<r;o+=4)n=t[o+0],a=t[o+1],s=t[o+2],i[o+0]=l*n+A*a+m*s+C,i[o+1]=c*n+h*a+g*s+x,i[o+2]=d*n+p*a+y*s+B,i[o+3]=u*n+f*a+v*s+E;return i},containsAABB3:function(e,t){return e[0]<=t[0]&&t[3]<=e[3]&&e[1]<=t[1]&&t[4]<=e[4]&&e[2]<=t[2]&&t[5]<=e[5]},getAABB3Diag:(()=>{let e=new jt(3),t=new jt(3),i=new jt(3);return o=>(e[0]=o[0],e[1]=o[1],e[2]=o[2],t[0]=o[3],t[1]=o[4],t[2]=o[5],b.subVec3(t,e,i),Math.abs(b.lenVec3(i)))})(),getAABB3DiagPoint:(()=>{let e=new jt(3),t=new jt(3),i=new jt(3);return(o,r)=>{e[0]=o[0],e[1]=o[1],e[2]=o[2],t[0]=o[3],t[1]=o[4],t[2]=o[5];let n=b.subVec3(t,e,i),a=r[0]-o[0],s=o[3]-r[0],l=r[1]-o[1],c=o[4]-r[1],d=r[2]-o[2],u=o[5]-r[2];return n[0]+=a>s?a:s,n[1]+=l>c?l:c,n[2]+=d>u?d:u,Math.abs(b.lenVec3(n))}})(),getAABB3Area(e){let t=e[3]-e[0],i=e[4]-e[1],o=e[5]-e[2];return t*i*o},getAABB3Center(e,t){let i=t||b.vec3();return i[0]=(e[0]+e[3])/2,i[1]=(e[1]+e[4])/2,i[2]=(e[2]+e[5])/2,i},getAABB2Center(e,t){let i=t||b.vec2();return i[0]=(e[2]+e[0])/2,i[1]=(e[3]+e[1])/2,i},collapseAABB3(e=b.AABB3()){return e[0]=b.MAX_DOUBLE,e[1]=b.MAX_DOUBLE,e[2]=b.MAX_DOUBLE,e[3]=b.MIN_DOUBLE,e[4]=b.MIN_DOUBLE,e[5]=b.MIN_DOUBLE,e},AABB3ToOBB3(e,t=b.OBB3()){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t[4]=e[3],t[5]=e[1],t[6]=e[2],t[7]=1,t[8]=e[3],t[9]=e[4],t[10]=e[2],t[11]=1,t[12]=e[0],t[13]=e[4],t[14]=e[2],t[15]=1,t[16]=e[0],t[17]=e[1],t[18]=e[5],t[19]=1,t[20]=e[3],t[21]=e[1],t[22]=e[5],t[23]=1,t[24]=e[3],t[25]=e[4],t[26]=e[5],t[27]=1,t[28]=e[0],t[29]=e[4],t[30]=e[5],t[31]=1,t},positions3ToAABB3:(()=>{let e=new jt(3);return(t,i,o)=>{i||=b.AABB3();let r=b.MAX_DOUBLE,n=b.MAX_DOUBLE,a=b.MAX_DOUBLE,s=b.MIN_DOUBLE,l=b.MIN_DOUBLE,c=b.MIN_DOUBLE,d,u,A;for(let h=0,p=t.length;h<p;h+=3)o?(e[0]=t[h+0],e[1]=t[h+1],e[2]=t[h+2],b.decompressPosition(e,o,e),d=e[0],u=e[1],A=e[2]):(d=t[h+0],u=t[h+1],A=t[h+2]),d<r&&(r=d),u<n&&(n=u),A<a&&(a=A),d>s&&(s=d),u>l&&(l=u),A>c&&(c=A);return i[0]=r,i[1]=n,i[2]=a,i[3]=s,i[4]=l,i[5]=c,i}})(),OBB3ToAABB3(e,t=b.AABB3()){let i=b.MAX_DOUBLE,o=b.MAX_DOUBLE,r=b.MAX_DOUBLE,n=b.MIN_DOUBLE,a=b.MIN_DOUBLE,s=b.MIN_DOUBLE,l,c,d;for(let u=0,A=e.length;u<A;u+=4)l=e[u+0],c=e[u+1],d=e[u+2],l<i&&(i=l),c<o&&(o=c),d<r&&(r=d),l>n&&(n=l),c>a&&(a=c),d>s&&(s=d);return t[0]=i,t[1]=o,t[2]=r,t[3]=n,t[4]=a,t[5]=s,t},points3ToAABB3(e,t=b.AABB3()){let i=b.MAX_DOUBLE,o=b.MAX_DOUBLE,r=b.MAX_DOUBLE,n=b.MIN_DOUBLE,a=b.MIN_DOUBLE,s=b.MIN_DOUBLE,l,c,d;for(let u=0,A=e.length;u<A;u++)l=e[u][0],c=e[u][1],d=e[u][2],l<i&&(i=l),c<o&&(o=c),d<r&&(r=d),l>n&&(n=l),c>a&&(a=c),d>s&&(s=d);return t[0]=i,t[1]=o,t[2]=r,t[3]=n,t[4]=a,t[5]=s,t},points3ToSphere3:(()=>{let e=new jt(3);return(t,i)=>{i||=b.vec4();let o=0,r=0,n=0,a,s=t.length;for(a=0;a<s;a++)o+=t[a][0],r+=t[a][1],n+=t[a][2];i[0]=o/s,i[1]=r/s,i[2]=n/s;let l=0,c;for(a=0;a<s;a++)c=Math.abs(b.lenVec3(b.subVec3(t[a],i,e))),c>l&&(l=c);return i[3]=l,i}})(),positions3ToSphere3:(()=>{let e=new jt(3),t=new jt(3);return(i,o)=>{o||=b.vec4();let r=0,n=0,a=0,s,l=i.length,c=0;for(s=0;s<l;s+=3)r+=i[s],n+=i[s+1],a+=i[s+2];let d=l/3;o[0]=r/d,o[1]=n/d,o[2]=a/d;let u;for(s=0;s<l;s+=3)e[0]=i[s],e[1]=i[s+1],e[2]=i[s+2],u=Math.abs(b.lenVec3(b.subVec3(e,o,t))),u>c&&(c=u);return o[3]=c,o}})(),OBB3ToSphere3:(()=>{let e=new jt(3),t=new jt(3);return(i,o)=>{o||=b.vec4();let r=0,n=0,a=0,s,l=i.length,c=l/4;for(s=0;s<l;s+=4)r+=i[s+0],n+=i[s+1],a+=i[s+2];o[0]=r/c,o[1]=n/c,o[2]=a/c;let d=0,u;for(s=0;s<l;s+=4)e[0]=i[s+0],e[1]=i[s+1],e[2]=i[s+2],u=Math.abs(b.lenVec3(b.subVec3(e,o,t))),u>d&&(d=u);return o[3]=d,o}})(),getSphere3Center(e,t=b.vec3()){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},getPositionsCenter(e,t=b.vec3()){let i=0,o=0,r=0;for(var n=0,a=e.length;n<a;n+=3)i+=e[n+0],o+=e[n+1],r+=e[n+2];let s=e.length/3;return t[0]=i/s,t[1]=o/s,t[2]=r/s,t},expandAABB3(e,t){return e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]>t[2]&&(e[2]=t[2]),e[3]<t[3]&&(e[3]=t[3]),e[4]<t[4]&&(e[4]=t[4]),e[5]<t[5]&&(e[5]=t[5]),e},expandAABB3Point3(e,t){return e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]>t[2]&&(e[2]=t[2]),e[3]<t[0]&&(e[3]=t[0]),e[4]<t[1]&&(e[4]=t[1]),e[5]<t[2]&&(e[5]=t[2]),e},expandAABB3Points3(e,t){for(var i,o,r,n=0,a=t.length;n<a;n+=3)i=t[n],o=t[n+1],r=t[n+2],e[0]>i&&(e[0]=i),e[1]>o&&(e[1]=o),e[2]>r&&(e[2]=r),e[3]<i&&(e[3]=i),e[4]<o&&(e[4]=o),e[5]<r&&(e[5]=r);return e},collapseAABB2(e=b.AABB2()){return e[0]=b.MAX_DOUBLE,e[1]=b.MAX_DOUBLE,e[2]=b.MIN_DOUBLE,e[3]=b.MIN_DOUBLE,e},point3AABB3Intersect(e,t){return e[0]>t[0]||e[3]<t[0]||e[1]>t[1]||e[4]<t[1]||e[2]>t[2]||e[5]<t[2]},point3AABB3AbsoluteIntersect(e,t){return e[0]<=t[0]&&e[3]>=t[0]&&e[1]<=t[1]&&e[4]>=t[1]&&e[2]<=t[2]&&e[5]>=t[2]},planeAABB3Intersect(e,t,i){let o,r;return e[0]>0?(o=e[0]*i[0],r=e[0]*i[3]):(o=e[0]*i[3],r=e[0]*i[0]),e[1]>0?(o+=e[1]*i[1],r+=e[1]*i[4]):(o+=e[1]*i[4],r+=e[1]*i[1]),e[2]>0?(o+=e[2]*i[2],r+=e[2]*i[5]):(o+=e[2]*i[5],r+=e[2]*i[2]),o<=-t&&r<=-t?-1:o>=-t&&r>=-t?1:0},OBB3ToAABB2(e,t=b.AABB2()){let i=b.MAX_DOUBLE,o=b.MAX_DOUBLE,r=b.MIN_DOUBLE,n=b.MIN_DOUBLE,a,s,l,c;for(let d=0,u=e.length;d<u;d+=4)a=e[d+0],s=e[d+1],l=e[d+3]||1,c=1/l,a*=c,s*=c,a<i&&(i=a),s<o&&(o=s),a>r&&(r=a),s>n&&(n=s);return t[0]=i,t[1]=o,t[2]=r,t[3]=n,t},expandAABB2(e,t){return e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[2]&&(e[2]=t[2]),e[3]<t[3]&&(e[3]=t[3]),e},expandAABB2Point2(e,t){return e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1]),e},AABB2ToCanvas(e,t,i,o=e){let r=(e[0]+1)*.5,n=(e[1]+1)*.5,a=(e[2]+1)*.5,s=(e[3]+1)*.5;return o[0]=Math.floor(r*t),o[1]=i-Math.floor(s*i),o[2]=Math.floor(a*t),o[3]=i-Math.floor(n*i),o},tangentQuadraticBezier(e,t,i,o){return 2*(1-e)*(i-t)+2*e*(o-i)},tangentQuadraticBezier3(e,t,i,o,r){return-3*t*(1-e)*(1-e)+3*i*(1-e)*(1-e)-6*e*i*(1-e)+6*e*o*(1-e)-3*e*e*o+3*e*e*r},tangentSpline(e){let t=6*e*e-6*e,i=3*e*e-4*e+1,o=-6*e*e+6*e,r=3*e*e-2*e;return t+i+o+r},catmullRomInterpolate(e,t,i,o,r){let n=(i-e)*.5,a=(o-t)*.5,s=r*r,l=r*s;return(2*t-2*i+n+a)*l+(-3*t+3*i-2*n-a)*s+n*r+t},b2p0(e,t){let i=1-e;return i*i*t},b2p1(e,t){return 2*(1-e)*e*t},b2p2(e,t){return e*e*t},b2(e,t,i,o){return this.b2p0(e,t)+this.b2p1(e,i)+this.b2p2(e,o)},b3p0(e,t){let i=1-e;return i*i*i*t},b3p1(e,t){let i=1-e;return 3*i*i*e*t},b3p2(e,t){return 3*(1-e)*e*e*t},b3p3(e,t){return e*e*e*t},b3(e,t,i,o,r){return this.b3p0(e,t)+this.b3p1(e,i)+this.b3p2(e,o)+this.b3p3(e,r)},triangleNormal(e,t,i,o=b.vec3()){let r=t[0]-e[0],n=t[1]-e[1],a=t[2]-e[2],s=i[0]-e[0],l=i[1]-e[1],c=i[2]-e[2],d=n*c-a*l,u=a*s-r*c,A=r*l-n*s,h=Math.sqrt(d*d+u*u+A*A);return h===0?(o[0]=0,o[1]=0,o[2]=0):(o[0]=d/h,o[1]=u/h,o[2]=A/h),o},rayTriangleIntersect:(()=>{let e=new jt(3),t=new jt(3),i=new jt(3),o=new jt(3),r=new jt(3);return(n,a,s,l,c,d)=>{d||=b.vec3();let u=b.subVec3(l,s,e),A=b.subVec3(c,s,t),h=b.cross3Vec3(a,A,i),p=b.dotVec3(u,h);if(p<1e-6)return null;let f=b.subVec3(n,s,o),m=b.dotVec3(f,h);if(m<0||m>p)return null;let g=b.cross3Vec3(f,u,r),y=b.dotVec3(a,g);if(y<0||m+y>p)return null;let v=b.dotVec3(A,g)/p;return d[0]=n[0]+v*a[0],d[1]=n[1]+v*a[1],d[2]=n[2]+v*a[2],d}})(),rayPlaneIntersect:(()=>{let e=new jt(3),t=new jt(3),i=new jt(3),o=new jt(3);return(r,n,a,s,l,c)=>{c||=b.vec3(),n=b.normalizeVec3(n,e);let d=b.subVec3(s,a,t),u=b.subVec3(l,a,i),A=b.cross3Vec3(d,u,o);b.normalizeVec3(A,A);let h=-b.dotVec3(a,A),p=-(b.dotVec3(r,A)+h)/b.dotVec3(n,A);return c[0]=r[0]+p*n[0],c[1]=r[1]+p*n[1],c[2]=r[2]+p*n[2],c}})(),cartesianToBarycentric:(()=>{let e=new jt(3),t=new jt(3),i=new jt(3);return(o,r,n,a,s)=>{let l=b.subVec3(a,r,e),c=b.subVec3(n,r,t),d=b.subVec3(o,r,i),u=b.dotVec3(l,l),A=b.dotVec3(l,c),h=b.dotVec3(l,d),p=b.dotVec3(c,c),f=b.dotVec3(c,d),m=u*p-A*A;if(m===0)return null;let g=1/m,y=(p*h-A*f)*g,v=(u*f-A*h)*g;return s[0]=1-y-v,s[1]=v,s[2]=y,s}})(),barycentricInsideTriangle(e){let t=e[1],i=e[2];return i>=0&&t>=0&&i+t<1},barycentricToCartesian(e,t,i,o,r=b.vec3()){let n=e[0],a=e[1],s=e[2];return r[0]=t[0]*n+i[0]*a+o[0]*s,r[1]=t[1]*n+i[1]*a+o[1]*s,r[2]=t[2]*n+i[2]*a+o[2]*s,r},mergeVertices(e,t,i,o){let r={},n=[],a=[],s=t?[]:null,l=i?[]:null,c=[],d,u,A,h,p=10**4,f,m,g=0;for(f=0,m=e.length;f<m;f+=3)d=e[f],u=e[f+1],A=e[f+2],h=`${Math.round(d*p)}_${Math.round(u*p)}_${Math.round(A*p)}`,r[h]===void 0&&(r[h]=a.length/3,a.push(d),a.push(u),a.push(A),t&&(s.push(t[f]),s.push(t[f+1]),s.push(t[f+2])),i&&(l.push(i[g]),l.push(i[g+1]))),n[f/3]=r[h],g+=2;for(f=0,m=o.length;f<m;f++)c[f]=n[o[f]];let y={positions:a,indices:c};return s&&(y.normals=s),l&&(y.uv=l),y},buildNormals:(()=>{let e=new jt(3),t=new jt(3),i=new jt(3),o=new jt(3),r=new jt(3),n=new jt(3);return(a,s,l)=>{let c,d,u=Array(a.length/3),A,h,p;for(c=0,d=s.length;c<d;c+=3){A=s[c],h=s[c+1],p=s[c+2],e[0]=a[A*3],e[1]=a[A*3+1],e[2]=a[A*3+2],t[0]=a[h*3],t[1]=a[h*3+1],t[2]=a[h*3+2],i[0]=a[p*3],i[1]=a[p*3+1],i[2]=a[p*3+2],b.subVec3(t,e,o),b.subVec3(i,e,r);let v=b.vec3();b.normalizeVec3(b.cross3Vec3(o,r,n),v),u[A]||(u[A]=[]),u[h]||(u[h]=[]),u[p]||(u[p]=[]),u[A].push(v),u[h].push(v),u[p].push(v)}l=l&&l.length===a.length?l:new Float32Array(a.length);let f,m,g,y;for(c=0,d=u.length;c<d;c++){f=u[c].length,m=0,g=0,y=0;for(let v=0;v<f;v++)m+=u[c][v][0],g+=u[c][v][1],y+=u[c][v][2];l[c*3]=m/f,l[c*3+1]=g/f,l[c*3+2]=y/f}return l}})(),buildTangents:(()=>{let e=new jt(3),t=new jt(3),i=new jt(3),o=new jt(3),r=new jt(3),n=new jt(3),a=new jt(3);return(s,l,c)=>{let d=new Float32Array(s.length);for(let u=0;u<l.length;u+=3){let A=l[u],h=s.subarray(A*3,A*3+3),p=c.subarray(A*2,A*2+2);A=l[u+1];let f=s.subarray(A*3,A*3+3),m=c.subarray(A*2,A*2+2);A=l[u+2];let g=s.subarray(A*3,A*3+3),y=c.subarray(A*2,A*2+2),v=b.subVec3(f,h,e),C=b.subVec3(g,h,t),x=b.subVec2(m,p,i),B=b.subVec2(y,p,o),E=1/(x[0]*B[1]-x[1]*B[0]),D=b.mulVec3Scalar(b.subVec3(b.mulVec3Scalar(v,B[1],r),b.mulVec3Scalar(C,x[1],n),a),E,n),P;for(let M=0;M<3;M++)P=l[u+M]*3,d[P]+=D[0],d[P+1]+=D[1],d[P+2]+=D[2]}return d}})(),buildPickTriangles(e,t,i){let o=t.length,r=i?new Uint16Array(o*9):new Float32Array(o*9),n=new Uint8Array(o*12),a=0,s,l=0,c=0,d,u,A,h,p;for(let f=0;f<o;f+=3)p=a>>24&255,h=a>>16&255,A=a>>8&255,u=a&255,d=t[f],s=d*3,r[l++]=e[s],r[l++]=e[s+1],r[l++]=e[s+2],n[c++]=u,n[c++]=A,n[c++]=h,n[c++]=p,d=t[f+1],s=d*3,r[l++]=e[s],r[l++]=e[s+1],r[l++]=e[s+2],n[c++]=u,n[c++]=A,n[c++]=h,n[c++]=p,d=t[f+2],s=d*3,r[l++]=e[s],r[l++]=e[s+1],r[l++]=e[s+2],n[c++]=u,n[c++]=A,n[c++]=h,n[c++]=p,a++;return{positions:r,colors:n}},faceToVertexNormals(e,t,i={}){let o=i.smoothNormalsAngleThreshold||20,r={},n=[],a={},s,l,c,d,u,A=10**4,h,p,f,m,g,y;for(p=0,m=e.length;p<m;p+=3){h=p/3,l=e[p],c=e[p+1],d=e[p+2],u=`${Math.round(l*A)}_${Math.round(c*A)}_${Math.round(d*A)}`,r[u]===void 0?r[u]=[h]:r[u].push(h);let v=b.normalizeVec3([t[p],t[p+1],t[p+2]]);n[h]=v,s=b.vec4([v[0],v[1],v[2],1]),a[h]=s}for(u in r)if(r.hasOwnProperty(u)){let v=r[u],C=v.length;for(p=0;p<C;p++){let x=v[p];for(s=a[x],f=0;f<C;f++){if(p===f)continue;let B=v[f];g=n[x],y=n[B],Math.abs(b.angleVec3(g,y)/b.DEGTORAD)<o&&(s[0]+=y[0],s[1]+=y[1],s[2]+=y[2],s[3]+=1)}}}for(p=0,m=t.length;p<m;p+=3)s=a[p/3],t[p+0]=s[0]/s[3],t[p+1]=s[1]/s[3],t[p+2]=s[2]/s[3]},transformRay:(()=>{let e=new jt(4),t=new jt(4);return(i,o,r,n,a)=>{e[0]=o[0],e[1]=o[1],e[2]=o[2],e[3]=1,b.transformVec4(i,e,t),n[0]=t[0],n[1]=t[1],n[2]=t[2],e[0]=r[0],e[1]=r[1],e[2]=r[2],b.transformVec3(i,e,t),b.normalizeVec3(t),a[0]=t[0],a[1]=t[1],a[2]=t[2]}})(),canvasPosToWorldRay:(()=>{let e=new jt(16),t=new jt(4),i=new jt(4),o=(r,n,a,s,l)=>{l[0]=r,l[1]=n,l[2]=a,l[3]=1,b.transformVec4(e,l,l),s||b.mulVec4Scalar(l,1/l[3])};return(r,n,a,s,l,c,d)=>{let u=s==="ortho";b.mulMat4(a,n,e),b.inverseMat4(e,e);let A=2*l[0]/r.clientWidth-1,h=1-2*l[1]/r.clientHeight;o(A,h,-1,u,t),o(A,h,1,u,i),c[0]=t[0],c[1]=t[1],c[2]=t[2],b.subVec3(i,t,d),b.normalizeVec3(d)}})(),canvasPosToLocalRay:(()=>{let e=new jt(3),t=new jt(3);return(i,o,r,n,a,s,l,c)=>{b.canvasPosToWorldRay(i,o,r,n,s,e,t),b.worldRayToLocalRay(a,e,t,l,c)}})(),worldRayToLocalRay:(()=>{let e=new jt(16),t=new jt(4),i=new jt(4);return(o,r,n,a,s)=>{let l=b.inverseMat4(o,e);t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=1,b.transformVec4(l,t,i),a[0]=i[0],a[1]=i[1],a[2]=i[2],b.transformVec3(l,n,s)}})(),buildKDTree:(()=>{let e=new Float32Array;function t(i,o,r,n){let a=new jt(6),s={triangles:null,left:null,right:null,leaf:!1,splitDim:0,aabb:a};a[0]=a[1]=a[2]=1/0,a[3]=a[4]=a[5]=-1/0;let l,c;for(l=0,c=i.length;l<c;++l){var d=i[l]*3;for(let g=0;g<3;++g){let y=o[d+g]*3;r[y]<a[0]&&(a[0]=r[y]),r[y]>a[3]&&(a[3]=r[y]),r[y+1]<a[1]&&(a[1]=r[y+1]),r[y+1]>a[4]&&(a[4]=r[y+1]),r[y+2]<a[2]&&(a[2]=r[y+2]),r[y+2]>a[5]&&(a[5]=r[y+2])}}if(i.length<20||n>10)return s.triangles=i,s.leaf=!0,s;e[0]=a[3]-a[0],e[1]=a[4]-a[1],e[2]=a[5]-a[2];let u=0;e[1]>e[u]&&(u=1),e[2]>e[u]&&(u=2),s.splitDim=u;let A=(a[u]+a[u+3])/2,h=Array(i.length),p=0,f=Array(i.length),m=0;for(l=0,c=i.length;l<c;++l){var d=i[l]*3;let y=o[d],v=o[d+1],C=o[d+2],x=y*3,B=v*3,E=C*3;r[x+u]<=A||r[B+u]<=A||r[E+u]<=A?h[p++]=i[l]:f[m++]=i[l]}return h.length=p,f.length=m,s.left=t(h,o,r,n+1),s.right=t(f,o,r,n+1),s}return(i,o)=>{let r=i.length/3,n=Array(r);for(let a=0;a<r;++a)n[a]=a;return t(n,i,o,0)}})(),decompressPosition(e,t,i){i||=e,i[0]=e[0]*t[0]+t[12],i[1]=e[1]*t[5]+t[13],i[2]=e[2]*t[10]+t[14]},decompressPositions(e,t,i=new Float32Array(e.length)){for(let o=0,r=e.length;o<r;o+=3)i[o+0]=e[o+0]*t[0]+t[12],i[o+1]=e[o+1]*t[5]+t[13],i[o+2]=e[o+2]*t[10]+t[14];return i},decompressUV(e,t,i){i[0]=e[0]*t[0]+t[6],i[1]=e[1]*t[4]+t[7]},decompressUVs(e,t,i=new Float32Array(e.length)){for(let o=0,r=e.length;o<r;o+=3)i[o+0]=e[o+0]*t[0]+t[6],i[o+1]=e[o+1]*t[4]+t[7];return i},octDecodeVec2(e,t){let i=e[0],o=e[1];i=(2*i+1)/255,o=(2*o+1)/255;let r=1-Math.abs(i)-Math.abs(o);r<0&&(i=(1-Math.abs(o))*(i>=0?1:-1),o=(1-Math.abs(i))*(o>=0?1:-1));let n=Math.sqrt(i*i+o*o+r*r);return t[0]=i/n,t[1]=o/n,t[2]=r/n,t},octDecodeVec2s(e,t){for(let i=0,o=0,r=e.length;i<r;i+=2){let n=e[i+0],a=e[i+1];n=(2*n+1)/255,a=(2*a+1)/255;let s=1-Math.abs(n)-Math.abs(a);s<0&&(n=(1-Math.abs(a))*(n>=0?1:-1),a=(1-Math.abs(n))*(a>=0?1:-1));let l=Math.sqrt(n*n+a*a+s*s);t[o+0]=n/l,t[o+1]=a/l,t[o+2]=s/l,o+=3}return t}};b.buildEdgeIndices=(function(){let e=[],t=[],i=[],o=[],r=[],n=0,a=new Uint16Array(3),s=new Uint16Array(3),l=new Uint16Array(3),c=b.vec3(),d=b.vec3(),u=b.vec3(),A=b.vec3(),h=b.vec3(),p=b.vec3(),f=b.vec3();function m(y,v){let C={},x,B,E,D,P=1e4,M,R,O=0;for(M=0,R=y.length;M<R;M+=3)x=y[M],B=y[M+1],E=y[M+2],D=Math.round(x*P)+"_"+Math.round(B*P)+"_"+Math.round(E*P),C[D]===void 0&&(C[D]=O/3,e[O++]=x,e[O++]=B,e[O++]=E),t[M/3]=C[D];for(M=0,R=v.length;M<R;M++)o[M]=t[v[M]],i[o[M]]=v[M]}function g(y,v){n=0;for(let C=0,x=y;C<x;C+=3){let B=o[C]*3,E=o[C+1]*3,D=o[C+2]*3;v?(a[0]=e[B],a[1]=e[B+1],a[2]=e[B+2],s[0]=e[E],s[1]=e[E+1],s[2]=e[E+2],l[0]=e[D],l[1]=e[D+1],l[2]=e[D+2],b.decompressPosition(a,v,c),b.decompressPosition(s,v,d),b.decompressPosition(l,v,u)):(c[0]=e[B],c[1]=e[B+1],c[2]=e[B+2],d[0]=e[E],d[1]=e[E+1],d[2]=e[E+2],u[0]=e[D],u[1]=e[D+1],u[2]=e[D+2]),b.subVec3(u,d,A),b.subVec3(c,d,h),b.cross3Vec3(A,h,p),b.normalizeVec3(p,f);let P=r[n]||(r[n]={normal:b.vec3()});P.normal[0]=f[0],P.normal[1]=f[1],P.normal[2]=f[2],n++}}return function(y,v,C,x){m(y,v),g(v.length,C);let B=[],E=Math.cos(b.DEGTORAD*x),D={},P,M,R,O,V,z=!1,K,Z,te,ie,se,Be;for(let qe=0,ze=v.length;qe<ze;qe+=3){let st=qe/3;for(let Pe=0;Pe<3;Pe++)P=o[qe+Pe],M=o[qe+(Pe+1)%3],R=Math.min(P,M),O=Math.max(P,M),V=R+","+O,D[V]===void 0?D[V]={index1:R,index2:O,face1:st,face2:void 0}:D[V].face2=st}for(V in D)K=D[V],!(K.face2!==void 0&&(Z=r[K.face1].normal,te=r[K.face2].normal,ie=b.dotVec3(Z,te),ie>E))&&(se=i[K.index1],Be=i[K.index2],(!z&&se>65535||Be>65535)&&(z=!0),B.push(se),B.push(Be));return z?new Uint32Array(B):new Uint16Array(B)}})(),b.planeClipsPositions3=function(e,t,i,o=3){for(let r=0,n=i.length;r<n;r+=o)if(p1[0]=i[r+0]-e[0],p1[1]=i[r+1]-e[1],p1[2]=i[r+2]-e[2],p1[0]*t[0]+p1[1]*t[1]+p1[2]*t[2]<0)return!0;return!1};var oit=15,oh=new Float32Array(3),nit=class{constructor(e){if(!e)throw"Parameter expected: cfg";if(!e.viewer)throw"Parameter expected: cfg.viewer";this.viewer=e.viewer,this._maxTreeDepth=e.maxTreeDepth||oit,this._root=null,this._needsRebuild=!0,this._onModelLoaded=this.viewer.scene.on("modelLoaded",t=>{this._needsRebuild=!0}),this._onModelUnloaded=this.viewer.scene.on("modelUnloaded",t=>{this._needsRebuild=!0})}get root(){return this._needsRebuild&&this._rebuild(),this._root}_rebuild(){let e=this.viewer.scene;this._root={aabb:e.getAABB()};for(let t in e.objects){let i=e.objects[t];this._insertEntity(this._root,i,1)}this._needsRebuild=!1}_insertEntity(e,t,i){let o=t.aabb;if(i>=this._maxTreeDepth){e.entities=e.entities||[],e.entities.push(t);return}if(e.left&&b.containsAABB3(e.left.aabb,o)){this._insertEntity(e.left,t,i+1);return}if(e.right&&b.containsAABB3(e.right.aabb,o)){this._insertEntity(e.right,t,i+1);return}let r=e.aabb;oh[0]=r[3]-r[0],oh[1]=r[4]-r[1],oh[2]=r[5]-r[2];let n=0;if(oh[1]>oh[n]&&(n=1),oh[2]>oh[n]&&(n=2),!e.left){let a=r.slice();if(a[n+3]=(r[n]+r[n+3])/2,e.left={aabb:a},b.containsAABB3(a,o)){this._insertEntity(e.left,t,i+1);return}}if(!e.right){let a=r.slice();if(a[n]=(r[n]+r[n+3])/2,e.right={aabb:a},b.containsAABB3(a,o)){this._insertEntity(e.right,t,i+1);return}}e.entities=e.entities||[],e.entities.push(t)}destroy(){let e=this.viewer.scene;e.off(this._onModelLoaded),e.off(this._onModelUnloaded),this._root=null,this._needsRebuild=!0}},Oj=class{constructor(){this._head=[],this._headLength=0,this._tail=[],this._index=0,this._length=0}get length(){return this._length}shift(){if(this._index>=this._headLength){let t=this._head;if(t.length=0,this._head=this._tail,this._tail=t,this._index=0,this._headLength=this._head.length,!this._headLength)return}let e=this._head[this._index];return this._index<0?delete this._head[this._index++]:this._head[this._index++]=void 0,this._length--,e}push(e){return this._length++,this._tail.push(e),this}unshift(e){return this._head[--this._index]=e,this._length++,this}},lr={build:{version:"0.8"},client:{browser:navigator&&navigator.userAgent?navigator.userAgent:"n/a"},components:{scenes:0,models:0,meshes:0,objects:0},memory:{meshes:0,positions:0,colors:0,normals:0,uvs:0,indices:0,textures:0,transforms:0,materials:0,programs:0},frame:{frameCount:0,fps:0,useProgram:0,bindTexture:0,bindArray:0,drawElements:0,drawArrays:0,tasksRun:0,tasksScheduled:0}};function Nj(e,t){if(e.nodeType===e.TEXT_NODE){var i=e.nodeValue;if(i.match(/^\s+$/)===null)return i}else if(e.nodeType===e.ELEMENT_NODE||e.nodeType===e.DOCUMENT_NODE){var o={type:e.nodeName,children:[]};if(e.nodeType===e.ELEMENT_NODE)for(var r=0;r<e.attributes.length;r++){var n=e.attributes[r],a=t[n.nodeName]||n.nodeName;o[a]=n.nodeValue}for(var s=0;s<e.childNodes.length;s++){var l=e.childNodes[s],r=Nj(l,t);r&&o.children.push(r)}return o}}function ait(e){return JSON.parse(JSON.stringify(e))}var sit=[["0",10],["A",26],["a",26],["_",1],["$",1]].map(function(e){for(var t=[],i=e[0].charCodeAt(0),o=i+e[1],r=i;r<o;++r)t.push(r);return String.fromCharCode.apply(null,t)}).join("");function Hj(e,t){return(!t||t===4?[0,6,12,18]:[0,6]).map(function(i){return sit.substr(parseInt(e/(1<<i))%64,1)}).reverse().join("")}function lit(e){var t=[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30].map(function(i){return parseInt(e.substr(i,2),16)});return Hj(t[0],2)+[1,4,7,10,13].map(function(i){return Hj((t[i]<<16)+(t[i+1]<<8)+t[i+2])}).join("")}function cit(e,t){var i=[],o=function(r){r.type===t&&i.push(r),(r.children||[]).forEach(function(n){o(n)})};return o(e),i}function dit(e){return new Promise(function(t,i){setTimeout(t,e)})}function uit(e){return new Promise(function(t,i){var o=new XMLHttpRequest;o.open(e.method||"GET",e.url,!0),o.onload=function(r){o.readyState===4&&(o.status===200?t(o.responseXML):i(o.statusText))},o.send(null)})}var Ait=(function(){for(var e={},t=window.location.search.substring(1).split("&"),i=0;i<t.length;i++){var o=t[i].split("=");if(e[o[0]]===void 0)e[o[0]]=decodeURIComponent(o[1]);else if(typeof e[o[0]]=="string"){var r=[e[o[0]],decodeURIComponent(o[1])];e[o[0]]=r}else e[o[0]].push(decodeURIComponent(o[1]))}return e})();function hit(e,t,i){var o=n=>{};t||=o,i||=o;var r=new XMLHttpRequest;r.overrideMimeType("application/json"),r.open("GET",e,!0),r.addEventListener("load",function(n){var a=n.target.response;if(this.status===200){var s;try{s=JSON.parse(a)}catch(l){i(`utils.loadJSON(): Failed to parse JSON response - ${l}`)}t(s)}else if(this.status===0){console.warn("loadFile: HTTP Status 0 received.");try{t(JSON.parse(a))}catch(l){i(`utils.loadJSON(): Failed to parse JSON response - ${l}`)}}else i(n)},!1),r.addEventListener("error",function(n){i(n)},!1),r.send(null)}function pit(e,t,i){var o=s=>{};t||=o,i||=o;let r=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(r){let s=!!r[2];var n=r[3];n=window.decodeURIComponent(n),s&&(n=window.atob(n));try{let l=new ArrayBuffer(n.length),c=new Uint8Array(l);for(var a=0;a<n.length;a++)c[a]=n.charCodeAt(a);jr.scheduleTask(()=>{t(l)})}catch(l){jr.scheduleTask(()=>{i(l)})}}else{let s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="arraybuffer",s.onreadystatechange=function(){s.readyState===4&&(s.status===200?t(s.response):i("loadArrayBuffer error : "+s.response))},s.send(null)}}function fit(e){return e&&!e.propertyIsEnumerable("length")&&typeof e=="object"&&typeof e.length=="number"}function git(e){return typeof e=="string"||e instanceof String}function mit(e){return!isNaN(parseFloat(e))&&isFinite(e)}function vit(e){return St.isString(e)||St.isNumeric(e)}function yit(e,t){return!e||!t?!1:(St.isNumeric(e)||St.isString(e)?`${e}`:e.id)===(St.isNumeric(t)||St.isString(t)?`${t}`:t.id)}function wit(e){return typeof e=="function"}function bit(e){let t={}.constructor;return!!e&&e.constructor===t}function Cit(e){return St.apply(e,{})}function xit(e,t){for(let i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function Bit(e,t){for(let i in e)e.hasOwnProperty(i)&&e[i]!==void 0&&e[i]!==null&&(t[i]=e[i]);return t}function kit(e,t){for(let i in e)e.hasOwnProperty(i)&&(t[i]===void 0||t[i]===null)&&(t[i]=e[i]);return t}function Eit(e){for(let t in e)if(e.hasOwnProperty(t))return!1;return!0}function Mit(e){return St.isNumeric(e)?`${e}`:`'${e}'`}function Pit(e,t){let i=new e.constructor(e.length+t.length);return i.set(e),i.set(t,e.length),i}function Iit(e){var t=[];function i(o){o.id=o.uuid,delete o.oid,t.push(o);var r=o.children;if(r)for(var n=0,a=r.length;n<a;n++){let s=r[n];s.parent=o.id,i(r[n])}o.children=[]}return i(e),t}var St={xmlToJson:Nj,clone:ait,compressGuid:lit,findNodeOfType:cit,timeout:dit,httpRequest:uit,loadJSON:hit,loadArraybuffer:pit,queryString:Ait,isArray:fit,isString:git,isNumeric:mit,isID:vit,isSameComponent:yit,isFunction:wit,isObject:bit,copy:Cit,apply:xit,apply2:Bit,applyIf:kit,isEmptyObject:Eit,inQuotes:Mit,concat:Pit,flattenParentChildHierarchy:Iit},K5={},Vj=new Ss,f1=new Oj,nd={sceneId:null,time:null,startTime:null,prevTime:null,deltaTime:null},jj=10,xu=[],Qj=30,Fg=0,g1,m1=0;function Sit(){this.version="1.0.0",this.scenes={},this._superTypes={},this._addScene=function(e){if(e.id){if(jr.scenes[e.id]){console.error(`[ERROR] Scene ${St.inQuotes(e.id)} already exists`);return}}else e.id=Vj.addItem({});jr.scenes[e.id]=e;let t=e.ticksPerOcclusionTest,i=e.ticksPerRender;K5[e.id]={ticksPerOcclusionTest:t,ticksPerRender:i,renderCountdown:i},lr.components.scenes++,e.once("destroyed",()=>{Vj.removeItem(e.id),delete jr.scenes[e.id],delete K5[e.id],lr.components.scenes--})},this.clear=function(){let e;for(let t in jr.scenes)jr.scenes.hasOwnProperty(t)&&(e=jr.scenes[t],t==="default.scene"?e.clear():(e.destroy(),delete jr.scenes[e.id]))},this.scheduleTask=function(e,t=null){f1.push(e),f1.push(t)},this.runTasks=function(e=-1){let t=new Date().getTime(),i,o,r=0;for(;f1.length>0&&(e<0||t<e);)i=f1.shift(),o=f1.shift(),o?i.call(o):i(),t=new Date().getTime(),r++;return r},this.getNumTasks=function(){return f1.length}}var jr=new Sit,zj=function(){let e=Date.now();if(g1=e-Fg,Fg>0&&g1>0){var t=1e3/g1;m1+=t,xu.push(t),xu.length>=Qj&&(m1-=xu.shift()),lr.frame.fps=Math.round(m1/xu.length)}for(let i in jr.scenes)jr.scenes[i].compile();Gj(e),Fg=e};function Dit(e,t){let i=Date.now()+t;function o(){let r=Date.now()-i;e(),i+=t,setTimeout(o,Math.max(0,t-r))}return o(),{cancel:function(){}}}Dit(()=>{zj()},100);var qj=function(){let e=Date.now();if(g1=e-Fg,Fg>0&&g1>0){var t=1e3/g1;m1+=t,xu.push(t),xu.length>=Qj&&(m1-=xu.shift()),lr.frame.fps=Math.round(m1/xu.length)}Gj(e),Tit(e),Lit(),window.requestPostAnimationFrame===void 0?requestAnimationFrame(qj):window.requestPostAnimationFrame(zj)};qj();function Gj(e){let t=jr.runTasks(e+jj),i=jr.getNumTasks();lr.frame.tasksRun=t,lr.frame.tasksScheduled=i,lr.frame.tasksBudget=jj}function Tit(e){for(var t in nd.time=e,jr.scenes)if(jr.scenes.hasOwnProperty(t)){var i=jr.scenes[t];nd.sceneId=t,nd.startTime=i.startTime,nd.deltaTime=nd.prevTime==null?0:nd.time-nd.prevTime,i.fire("tick",nd,!0)}nd.prevTime=e}function Lit(){let e=jr.scenes,t,i,o,r,n;for(n in e)e.hasOwnProperty(n)&&(t=e[n],i=K5[n],i||=K5[n]={},o=t.ticksPerOcclusionTest,i.ticksPerOcclusionTest!==o&&(i.ticksPerOcclusionTest=o,i.renderCountdown=o),--t.occlusionTestCountdown<=0&&(t.doOcclusionTest(),t.occlusionTestCountdown=o),r=t.ticksPerRender,i.ticksPerRender!==r&&(i.ticksPerRender=r,i.renderCountdown=r),--i.renderCountdown===0&&(t.render(!1),i.renderCountdown=r))}var Ri=class _ne{get type(){return"Component"}get isComponent(){return!0}constructor(t=null,i={}){if(this.scene=null,this.type==="Scene")this.scene=this,this.viewer=i.viewer;else{if(t.type==="Scene")this.scene=t;else if(t instanceof _ne)this.scene=t.scene;else throw"Invalid param: owner must be a Component";this._owner=t}this._dontClear=!!i.dontClear,this._renderer=this.scene._renderer,this.meta=i.meta||{},this.id=i.id,this.destroyed=!1,this._attached={},this._attachments=null,this._subIdMap=null,this._subIdEvents=null,this._eventSubs=null,this._eventSubsNum=null,this._events=null,this._eventCallDepth=0,this._ownedComponents=null,this!==this.scene&&this.scene._addComponent(this),this._updateScheduled=!1,t&&t._own(this)}glRedraw(){this._renderer&&(this._renderer.imageDirty(),this.castsShadow&&this._renderer.shadowsDirty())}glResort(){this._renderer&&this._renderer.needStateSort()}get owner(){return this._owner}isType(t){return this.type===t}fire(t,i,o){this._events||={},this._eventSubs||(this._eventSubs={},this._eventSubsNum={}),o!==!0&&(this._events[t]=i||!0);let r=this._eventSubs[t],n;if(r)for(let a in r)r.hasOwnProperty(a)&&(n=r[a],this._eventCallDepth++,this._eventCallDepth<300?n.callback.call(n.scope,i):this.error("fire: potential stack overflow from recursive event '"+t+"' - dropping this event"),this._eventCallDepth--)}on(t,i,o){this._events||={},this._subIdMap||=new Ss,this._subIdEvents||={},this._eventSubs||={},this._eventSubsNum||={};let r=this._eventSubs[t];r?this._eventSubsNum[t]++:(r={},this._eventSubs[t]=r,this._eventSubsNum[t]=1);let n=this._subIdMap.addItem();r[n]={callback:i,scope:o||this},this._subIdEvents[n]=t;let a=this._events[t];return a!==void 0&&i.call(o||this,a),n}off(t){if(t==null||!this._subIdEvents)return;let i=this._subIdEvents[t];if(i){delete this._subIdEvents[t];let o=this._eventSubs[i];o&&(delete o[t],this._eventSubsNum[i]--),this._subIdMap.removeItem(t)}}once(t,i,o){let r=this,n=this.on(t,function(a){r.off(n),i.call(o||this,a)},o)}hasSubs(t){return this._eventSubsNum&&this._eventSubsNum[t]>0}log(t){t="[LOG]"+this._message(t),window.console.log(t),this.scene.fire("log",t)}_message(t){return" ["+this.type+" "+St.inQuotes(this.id)+"]: "+t}warn(t){t="[WARN]"+this._message(t),window.console.warn(t),this.scene.fire("warn",t)}error(t){t="[ERROR]"+this._message(t),window.console.error(t),this.scene.fire("error",t)}_attach(t){let i=t.name;if(!i){this.error("Component 'name' expected");return}let o=t.component,r=t.sceneDefault,n=t.sceneSingleton,a=t.type,s=t.on,l=t.recompiles!==!1;if(o&&(St.isNumeric(o)||St.isString(o))){let h=o;if(o=this.scene.components[h],!o){this.error("Component not found: "+St.inQuotes(h));return}}if(!o){if(n===!0){let h=this.scene.types[a];for(let p in h)if(h.hasOwnProperty){o=h[p];break}if(!o)return this.error("Scene has no default component for '"+i+"'"),null}else if(r===!0&&(o=this.scene[i],!o))return this.error("Scene has no default component for '"+i+"'"),null}if(o){if(o.scene.id!==this.scene.id){this.error("Not in same scene: "+o.type+" "+St.inQuotes(o.id));return}if(a&&!o.isType(a)){this.error("Expected a "+a+" type or subtype: "+o.type+" "+St.inQuotes(o.id));return}}this._attachments||={};let c=this._attached[i],d,u,A;if(c){if(o&&c.id===o.id)return;let h=this._attachments[c.id];for(d=h.subs,u=0,A=d.length;u<A;u++)c.off(d[u]);delete this._attached[i],delete this._attachments[c.id];let p=h.params.onDetached;p&&(St.isFunction(p)?p(c):p.scope?p.callback.call(p.scope,c):p.callback(c)),h.managingLifecycle&&c.destroy()}if(o){let h={params:t,component:o,subs:[],managingLifecycle:!1};h.subs.push(o.once("destroyed",function(){h.params.component=null,this._attach(h.params)},this)),l&&h.subs.push(o.on("dirty",function(){this.fire("dirty",this)},this)),this._attached[i]=o,this._attachments[o.id]=h;let p=t.onAttached;if(p&&(St.isFunction(p)?p(o):p.scope?p.callback.call(p.scope,o):p.callback(o)),s){let f,m,g,y;for(f in s)if(s.hasOwnProperty(f)){if(m=s[f],St.isFunction(m)?(g=m,y=null):(g=m.callback,y=m.scope),!g)continue;h.subs.push(o.on(f,g,y))}}}return l&&this.fire("dirty",this),this.fire(i,o),o}_checkComponent(t,i){if(!i.isComponent)if(St.isID(i)){let o=i;if(i=this.scene.components[o],!i){this.error("Component not found: "+o);return}}else{this.error("Expected a Component or ID");return}if(t!==i.type){this.error("Expected a "+t+" Component");return}if(i.scene.id!==this.scene.id){this.error("Not in same scene: "+i.type);return}return i}_checkComponent2(t,i){if(!i.isComponent)if(St.isID(i)){let n=i;if(i=this.scene.components[n],!i){this.error("Component not found: "+n);return}}else{this.error("Expected a Component or ID");return}if(i.scene.id!==this.scene.id){this.error("Not in same scene: "+i.type);return}for(var o=0,r=t.length;o<r;o++)if(t[o]===i.type)return i;return this.error("Expected component types: "+t),null}_own(t){this._ownedComponents||={},this._ownedComponents[t.id]||(this._ownedComponents[t.id]=t),t.once("destroyed",()=>{delete this._ownedComponents[t.id]},this)}_needUpdate(t){this._updateScheduled||(this._updateScheduled=!0,t===0?this._doUpdate():jr.scheduleTask(this._doUpdate,this))}_doUpdate(){this._updateScheduled&&(this._updateScheduled=!1,this._update&&this._update())}scheduleTask(t){jr.scheduleTask(t,null)}_update(){}clear(){if(this._ownedComponents)for(var t in this._ownedComponents)this._ownedComponents.hasOwnProperty(t)&&(this._ownedComponents[t].destroy(),delete this._ownedComponents[t])}destroy(){if(this.destroyed)return;this.fire("destroyed",this.destroyed=!0);let t,i,o,r,n,a;if(this._attachments){for(t in this._attachments)if(this._attachments.hasOwnProperty(t)){for(i=this._attachments[t],o=i.component,r=i.subs,n=0,a=r.length;n<a;n++)o.off(r[n]);i.managingLifecycle&&o.destroy()}}if(this._ownedComponents)for(t in this._ownedComponents)this._ownedComponents.hasOwnProperty(t)&&(o=this._ownedComponents[t],o.destroy(),delete this._ownedComponents[t]);this.scene._removeComponent(this),this._attached={},this._attachments=null,this._subIdMap=null,this._subIdEvents=null,this._eventSubs=null,this._events=null,this._eventCallDepth=0,this._ownedComponents=null,this._updateScheduled=!1}},Rit=b.vec3(),_it=b.vec3(),Fit=b.mat4(),nh=class{constructor(){this.normal=b.vec3(),this.offset=0,this.testVertex=b.vec3()}set(e,t,i,o){let r=1/Math.sqrt(e*e+t*t+i*i);this.normal[0]=e*r,this.normal[1]=t*r,this.normal[2]=i*r,this.offset=o*r,this.testVertex[0]=this.normal[0]>=0?1:0,this.testVertex[1]=this.normal[1]>=0?1:0,this.testVertex[2]=this.normal[2]>=0?1:0}},ts=class{constructor(){this.planes=[new nh,new nh,new nh,new nh,new nh,new nh]}};ts.INSIDE=0,ts.INTERSECT=1,ts.OUTSIDE=2;function Kj(e,t,i){let o=b.mulMat4(i,t,Fit),r=o[0],n=o[1],a=o[2],s=o[3],l=o[4],c=o[5],d=o[6],u=o[7],A=o[8],h=o[9],p=o[10],f=o[11],m=o[12],g=o[13],y=o[14],v=o[15];e.planes[0].set(s-r,u-l,f-A,v-m),e.planes[1].set(s+r,u+l,f+A,v+m),e.planes[2].set(s-n,u-c,f-h,v-g),e.planes[3].set(s+n,u+c,f+h,v+g),e.planes[4].set(s-a,u-d,f-p,v-y),e.planes[5].set(s+a,u+d,f+p,v+y)}function J5(e,t){let i=ts.INSIDE,o=Rit,r=_it;o[0]=t[0],o[1]=t[1],o[2]=t[2],r[0]=t[3],r[1]=t[4],r[2]=t[5];let n=[o,r];for(let a=0;a<6;++a){let s=e.planes[a];if(s.normal[0]*n[s.testVertex[0]][0]+s.normal[1]*n[s.testVertex[1]][1]+s.normal[2]*n[s.testVertex[2]][2]+s.offset<0)return ts.OUTSIDE;s.normal[0]*n[1-s.testVertex[0]][0]+s.normal[1]*n[1-s.testVertex[1]][1]+s.normal[2]*n[1-s.testVertex[2]][2]+s.offset<0&&(i=ts.INTERSECT)}return i}var Ug=class $m extends Ri{constructor(t={}){if(!t.viewer)throw"[MarqueePicker] Missing config: viewer";if(!t.objectsKdTree3)throw"[MarqueePicker] Missing config: objectsKdTree3";super(t.viewer.scene,t),this.viewer=t.viewer,this._objectsKdTree3=t.objectsKdTree3,this._canvasMarqueeCorner1=b.vec2(),this._canvasMarqueeCorner2=b.vec2(),this._canvasMarquee=b.AABB2(),this._marqueeFrustum=new ts,this._marqueeFrustumProjMat=b.mat4(),this._pickMode=!1,this._marqueeElement=document.createElement("div"),document.body.appendChild(this._marqueeElement),this._marqueeElement.style.position="absolute",this._marqueeElement.style["z-index"]="40000005",this._marqueeElement.style.width="8px",this._marqueeElement.style.height="8px",this._marqueeElement.style.visibility="hidden",this._marqueeElement.style.top="0px",this._marqueeElement.style.left="0px",this._marqueeElement.style["box-shadow"]="0 2px 5px 0 #182A3D;",this._marqueeElement.style.opacity=1,this._marqueeElement.style["pointer-events"]="none"}setMarqueeCorner1(t){this._canvasMarqueeCorner1.set(t),this._canvasMarqueeCorner2.set(t),this._updateMarquee()}setMarqueeCorner2(t){this._canvasMarqueeCorner2.set(t),this._updateMarquee()}setMarquee(t,i){this._canvasMarqueeCorner1.set(t),this._canvasMarqueeCorner2.set(i),this._updateMarquee()}setMarqueeVisible(t){this._marqueVisible=t,this._marqueeElement.style.visibility=t?"visible":"hidden"}getMarqueeVisible(){return this._marqueVisible}setPickMode(t){if(t!==$m.PICK_MODE_INSIDE&&t!==$m.PICK_MODE_INTERSECTS)throw"Illegal MarqueePicker pickMode: must be MarqueePicker.PICK_MODE_INSIDE or MarqueePicker.PICK_MODE_INTERSECTS";t!==this._pickMode&&(this._marqueeElement.style["background-image"]=t===$m.PICK_MODE_INSIDE?`url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='6' ry='6' stroke='%23333' stroke-width='4'/%3e%3c/svg%3e")`:`url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='6' ry='6' stroke='%23333' stroke-width='4' stroke-dasharray='6%2c 14' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e")`,this._pickMode=t)}getPickMode(){return this._pickMode}clear(){this.fire("clear",{})}pick(){this._updateMarquee(),this._buildMarqueeFrustum();let t=[],i=(o,r=ts.INTERSECT)=>{if(r===ts.INTERSECT&&(r=J5(this._marqueeFrustum,o.aabb)),r!==ts.OUTSIDE){if(o.entities){let n=o.entities;for(let a=0,s=n.length;a<s;a++){let l=n[a];if(!l.visible)continue;let c=l.aabb;this._pickMode===$m.PICK_MODE_INSIDE?J5(this._marqueeFrustum,c)===ts.INSIDE&&t.push(l.id):J5(this._marqueeFrustum,c)!==ts.OUTSIDE&&t.push(l.id)}}o.left&&i(o.left,r),o.right&&i(o.right,r)}};return(this._canvasMarquee[2]-this._canvasMarquee[0]>3||this._canvasMarquee[3]-this._canvasMarquee[1]>3)&&i(this._objectsKdTree3.root),this.fire("picked",t),t}_updateMarquee(){this._canvasMarquee[0]=Math.min(this._canvasMarqueeCorner1[0],this._canvasMarqueeCorner2[0]),this._canvasMarquee[1]=Math.min(this._canvasMarqueeCorner1[1],this._canvasMarqueeCorner2[1]),this._canvasMarquee[2]=Math.max(this._canvasMarqueeCorner1[0],this._canvasMarqueeCorner2[0]),this._canvasMarquee[3]=Math.max(this._canvasMarqueeCorner1[1],this._canvasMarqueeCorner2[1]),this._marqueeElement.style.width=`${this._canvasMarquee[2]-this._canvasMarquee[0]}px`,this._marqueeElement.style.height=`${this._canvasMarquee[3]-this._canvasMarquee[1]}px`,this._marqueeElement.style.left=`${this._canvasMarquee[0]}px`,this._marqueeElement.style.top=`${this._canvasMarquee[1]}px`}_buildMarqueeFrustum(){let t=this.viewer.scene.canvas.canvas,i=t.clientWidth,o=t.clientHeight,r=t.clientLeft,n=t.clientTop,a=2/i,s=2/o,l=t.clientHeight/t.clientWidth,c=(this._canvasMarquee[0]-r)*a+-1,d=(this._canvasMarquee[2]-r)*a+-1,u=-(this._canvasMarquee[3]-n)*s+1,A=-(this._canvasMarquee[1]-n)*s+1,h=this.viewer.scene.camera.frustum.near*(17*l);b.frustumMat4(c,d,u*l,A*l,h,1e4,this._marqueeFrustumProjMat),Kj(this._marqueeFrustum,this.viewer.scene.camera.viewMatrix,this._marqueeFrustumProjMat)}destroy(){super.destroy(),this._marqueeElement.parentElement&&(this._marqueeElement.parentElement.removeChild(this._marqueeElement),this._marqueeElement=null,this._objectsKdTree3=null)}};Ug.PICK_MODE_INTERSECTS=0,Ug.PICK_MODE_INSIDE=1;var Uit=class extends Ri{constructor(e){super(e.marqueePicker,e);let t=e.marqueePicker,i=t.viewer.scene.canvas.canvas,o,r,n,a,s,l,c=!1,d=!1,u=!1,A;i.addEventListener("mousedown",h=>{this.getActive()&&h.button===0&&(A=setTimeout(function(){let p=t.viewer.scene.input;p.keyDown[p.KEY_CTRL]||t.clear(),o=h.pageX,r=h.pageY,s=h.offsetX,h.offsetY,t.setMarqueeCorner1([o,r]),c=!0,t.viewer.cameraControl.pointerEnabled=!1,t.setMarqueeVisible(!0),i.style.cursor="crosshair"},400),d=!0)}),i.addEventListener("mouseup",h=>{if(!this.getActive()||!c&&!u||h.button!==0)return;clearTimeout(A),n=h.pageX,a=h.pageY;let p=Math.abs(n-o),f=Math.abs(a-r);c=!1,t.viewer.cameraControl.pointerEnabled=!0,u&&=!1,(p>3||f>3)&&t.pick()}),document.addEventListener("mouseup",h=>{this.getActive()&&h.button===0&&(clearTimeout(A),c&&(t.setMarqueeVisible(!1),c=!1,d=!1,u=!0,t.viewer.cameraControl.pointerEnabled=!0))},!0),i.addEventListener("mousemove",h=>{this.getActive()&&h.button===0&&d&&(clearTimeout(A),c&&(n=h.pageX,a=h.pageY,l=h.offsetX,h.offsetY,t.setMarqueeVisible(!0),t.setMarqueeCorner2([n,a]),t.setPickMode(s<l?Ug.PICK_MODE_INSIDE:Ug.PICK_MODE_INTERSECTS)))})}setActive(e){this._active!==e&&(this._active=e,this.fire("active",this._active))}getActive(){return this._active}destroy(){}},NB=class{constructor(e,t={}){this.viewer=e,this.scene=this.viewer.scene,this._circleDiv=document.createElement("div"),this.viewer.scene.canvas.canvas.parentNode.insertBefore(this._circleDiv,this.viewer.scene.canvas.canvas),this._circleDiv.style.backgroundColor="transparent",this._circleDiv.style.border="2px solid green",this._circleDiv.style.borderRadius="50px",this._circleDiv.style.width="50px",this._circleDiv.style.height="50px",this._circleDiv.style.margin="-200px -200px",this._circleDiv.style.zIndex="100000",this._circleDiv.style.position="absolute",this._circleDiv.style.pointerEvents="none",this._circlePos=null,this._circleMaxRadius=200,this._circleMinRadius=2,this._active=t.active!==!1,this._visible=!1,this._running=!1,this._destroyed=!1}start(e){if(this._destroyed)return;this._circlePos=e,this._running=!1,this._circleRadius=this._circleMaxRadius,this._circleDiv.style.borderRadius=`${this._circleRadius}px`,this._circleDiv.style.marginLeft=`${this._circlePos[0]-this._circleRadius}px`,this._circleDiv.style.marginTop=`${this._circlePos[1]-this._circleRadius}px`;let t=this._circleMaxRadius,i,o=r=>{if(!this._running)return;i||=r;let n=r-i,a=Math.min(n/300,1);this._circleRadius=t+(2-t)*a,this._circleDiv.style.width=`${this._circleRadius}px`,this._circleDiv.style.height=`${this._circleRadius}px`,this._circleDiv.style.marginLeft=`${this._circlePos[0]-this._circleRadius/2}px`,this._circleDiv.style.marginTop=`${this._circlePos[1]-this._circleRadius/2}px`,a<1&&requestAnimationFrame(o)};this._running=!0,requestAnimationFrame(o),this._circleDiv.style.visibility="visible"}stop(){this._destroyed||(this._running=!1,this._circleRadius=this._circleMaxRadius,this._circleDiv.style.borderRadius=`${this._circleRadius}px`,this._circleDiv.style.visibility="hidden")}set durationMs(e){this.stop(),this._durationMs=e}get durationMs(){return this._durationMs}destroy(){this._destroyed||=(this.stop(),this._circleDiv.parentElement.removeChild(this._circleDiv),!0)}},Jj=class{constructor(e={}){this._eventSubIDMap=null,this._eventSubEvents=null,this._eventSubs=null,this._events=null,this._locale="en",this._messages={},this._locales=[],this._locale="en",this.messages=e.messages,this.locale=e.locale}set messages(e){this._messages=e||{},this._locales=Object.keys(this._messages),this.fire("updated",this)}loadMessages(e={}){for(let t in e)this._messages[t]=e[t];this.messages=this._messages}clearMessages(){this.messages={}}get locales(){return this._locales}set locale(e){e||="de",this._locale!==e&&(this._locale=e,this.fire("updated",e))}get locale(){return this._locale}translate(e,t){let i=this._messages[this._locale];if(!i)return null;let o=Zj(e,i);return o?t?HB(o,t):o:null}translatePlurals(e,t,i){let o=this._messages[this._locale];if(!o)return null;let r=Zj(e,o);return t=parseInt(""+t,10),r=t===0?r.zero:t>1?r.other:r.one,r?(r=HB(r,[t]),i&&(r=HB(r,i)),r):null}fire(e,t,i){this._events||={},this._eventSubs||={},i!==!0&&(this._events[e]=t||!0);let o=this._eventSubs[e];if(o)for(let r in o)o.hasOwnProperty(r)&&o[r].callback(t)}on(e,t){this._events||={},this._eventSubIDMap||=new Ss,this._eventSubEvents||={},this._eventSubs||={};let i=this._eventSubs[e];i||(i={},this._eventSubs[e]=i);let o=this._eventSubIDMap.addItem();i[o]={callback:t},this._eventSubEvents[o]=e;let r=this._events[e];return r!==void 0&&t(r),o}off(e){if(e==null||!this._eventSubEvents)return;let t=this._eventSubEvents[e];if(t){delete this._eventSubEvents[e];let i=this._eventSubs[t];i&&delete i[e],this._eventSubIDMap.removeItem(e)}}};function Zj(e,t){if(t[e])return t[e];let i=e.split("."),o=t;for(let r=0,n=i.length;o&&r<n;r++){let a=i[r];o=o[a]}return o}function HB(e,t=[]){return e.replace(/\{\{|\}\}|\{(\d+)\}/g,function(i,o){return i==="{{"?"{":i==="}}"?"}":t[o]})}var Og=class extends Ri{constructor(e,t={}){super(e,t),this.t=t.t}set t(e){e||=0,this._t=e<0?0:e>1?1:e}get t(){return this._t}get tangent(){return this.getTangent(this._t)}get length(){var e=this._getLengths();return e[e.length-1]}getTangent(e){var t=1e-4;e===void 0&&(e=this._t);var i=e-t,o=e+t;i<0&&(i=0),o>1&&(o=1);var r=this.getPoint(i),n=this.getPoint(o),a=b.subVec3(n,r,[]);return b.normalizeVec3(a,[])}getPointAt(e){var t=this.getUToTMapping(e);return this.getPoint(t)}getPoints(e){e||=5;var t,i=[];for(t=0;t<=e;t++)i.push(this.getPoint(t/e));return i}_getLengths(e){if(e||=this.__arcLengthDivisions?this.__arcLengthDivisions:200,this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t=[],i,o=this.getPoint(0),r,n=0;for(t.push(0),r=1;r<=e;r++)i=this.getPoint(r/e),n+=b.lenVec3(b.subVec3(i,o,[])),t.push(n),o=i;return this.cacheArcLengths=t,t}_updateArcLengths(){this.needsUpdate=!0,this._getLengths()}getUToTMapping(e,t){for(var i=this._getLengths(),o=0,r=i.length,n,a=t||e*i[r-1],s=0,l=r-1,c;s<=l;)if(o=Math.floor(s+(l-s)/2),c=i[o]-a,c<0)s=o+1;else if(c>0)l=o-1;else{l=o;break}if(o=l,i[o]===a)return n=o/(r-1),n;var d=i[o],u=i[o+1]-d,A=(a-d)/u;return n=(o+A)/(r-1),n}},Z5=class extends Og{constructor(e,t={}){super(e,t),this.points=t.points,this.t=t.t}set points(e){this._points=e||[]}get points(){return this._points}set t(e){e||=0,this._t=e<0?0:e>1?1:e}get t(){return this._t}get point(){return this.getPoint(this._t)}getPoint(e){var t=this.points;if(t.length<3){this.error("Can't sample point from SplineCurve - not enough points on curve - returning [0,0,0].");return}var i=(t.length-1)*e,o=Math.floor(i),r=i-o,n=t[o===0?o:o-1],a=t[o],s=t[o>t.length-2?t.length-1:o+1],l=t[o>t.length-3?t.length-1:o+2],c=b.vec3();return c[0]=b.catmullRomInterpolate(n[0],a[0],s[0],l[0],r),c[1]=b.catmullRomInterpolate(n[1],a[1],s[1],l[1],r),c[2]=b.catmullRomInterpolate(n[2],a[2],s[2],l[2],r),c}getJSON(){return{points,t:this._t}}},VB=b.vec3(),Oit=class extends Ri{get type(){return"CameraPath"}constructor(e,t={}){super(e,t),this._frames=[],this._eyeCurve=new Z5(this),this._lookCurve=new Z5(this),this._upCurve=new Z5(this),t.frames&&(this.addFrames(t.frames),this.smoothFrameTimes(1))}get frames(){return this._frames}get eyeCurve(){return this._eyeCurve}get lookCurve(){return this._lookCurve}get upCurve(){return this._upCurve}saveFrame(e){let t=this.scene.camera;this.addFrame(e,t.eye,t.look,t.up)}addFrame(e,t,i,o){let r={t:e,eye:t.slice(0),look:i.slice(0),up:o.slice(0)};this._frames.push(r),this._eyeCurve.points.push(r.eye),this._lookCurve.points.push(r.look),this._upCurve.points.push(r.up)}addFrames(e){let t;for(let i=0,o=e.length;i<o;i++)t=e[i],this.addFrame(t.t||0,t.eye,t.look,t.up)}loadFrame(e){let t=this.scene.camera;e/=this._frames[this._frames.length-1].t-this._frames[0].t,e=e<0?0:e>1?1:e,t.eye=this._eyeCurve.getPoint(e,VB),t.look=this._lookCurve.getPoint(e,VB),t.up=this._upCurve.getPoint(e,VB)}sampleFrame(e,t,i,o){e=e<0?0:e>1?1:e,this._eyeCurve.getPoint(e,t),this._lookCurve.getPoint(e,i),this._upCurve.getPoint(e,o)}smoothFrameTimes(e){if(this._frames.length===0)return;let t=b.vec3();var i=0;this._frames[0].t=0;let o=[];for(let n=1,a=this._frames.length;n<a;n++){var r=b.lenVec3(b.subVec3(this._frames[n].eye,this._frames[n-1].eye,t));o[n]=r,i+=r}for(let n=1,a=this._frames.length;n<a;n++){let s=o[n]/i*e;this._frames[n].t=this._frames[n-1].t+s}}clearFrames(){this._frames=[],this._eyeCurve.points=[],this._lookCurve.points=[],this._upCurve.points=[]}},jB=b.vec3(),QB=b.vec3(),zB=b.vec3(),Wj=b.vec3(),ah=b.vec3(),qB=class t7 extends Ri{get type(){return"CameraFlightAnimation"}constructor(t,i={}){super(t,i),this._look1=b.vec3(),this._eye1=b.vec3(),this._up1=b.vec3(),this._look2=b.vec3(),this._eye2=b.vec3(),this._up2=b.vec3(),this._orthoScale1=1,this._orthoScale2=1,this._flying=!1,this._flyEyeLookUp=!1,this._flyingEye=!1,this._flyingLook=!1,this._callback=null,this._callbackScope=null,this._time1=null,this._time2=null,this.easing=i.easing!==!1,this.duration=i.duration,this.fit=i.fit,this.fitFOV=i.fitFOV,this.trail=i.trail}flyTo(t,i,o){t||=this.scene,this._flying&&this.stop(),this._flying=!1,this._flyingEye=!1,this._flyingLook=!1,this._flyingEyeLookUp=!1,this._callback=i,this._callbackScope=o;let r=this.scene.camera,n=!!t.projection&&t.projection!==r.projection;this._eye1[0]=r.eye[0],this._eye1[1]=r.eye[1],this._eye1[2]=r.eye[2],this._look1[0]=r.look[0],this._look1[1]=r.look[1],this._look1[2]=r.look[2],this._up1[0]=r.up[0],this._up1[1]=r.up[1],this._up1[2]=r.up[2],this._orthoScale1=r.ortho.scale,this._orthoScale2=t.orthoScale||this._orthoScale1;let a,s,l,c,d;if(t.aabb)a=t.aabb;else if(t.length===6)a=t;else if(t.eye&&t.look||t.up)s=t.eye,l=t.look,c=t.up;else if(t.eye)s=t.eye;else if(t.look)l=t.look;else{let A=t;if((St.isNumeric(A)||St.isString(A))&&(d=A,A=this.scene.components[d],!A)){this.error("Component not found: "+St.inQuotes(d)),i&&(o?i.call(o):i());return}n||(a=A.aabb||this.scene.aabb)}let u=t.poi;if(a){if(a[3]<a[0]||a[4]<a[1]||a[5]<a[2]||a[3]===a[0]&&a[4]===a[1]&&a[5]===a[2])return;a=a.slice();let A=b.getAABB3Center(a);this._look2=u||A;let h=b.subVec3(this._eye1,this._look1,jB),p=b.normalizeVec3(h),f=u?b.getAABB3DiagPoint(a,u):b.getAABB3Diag(a),m=t.fitFOV||this._fitFOV,g=Math.abs(f/Math.tan(m*b.DEGTORAD));this._orthoScale2=f*1.1,this._eye2[0]=this._look2[0]+p[0]*g,this._eye2[1]=this._look2[1]+p[1]*g,this._eye2[2]=this._look2[2]+p[2]*g,this._up2[0]=this._up1[0],this._up2[1]=this._up1[1],this._up2[2]=this._up1[2],this._flyingEyeLookUp=!0}else(s||l||c)&&(this._flyingEyeLookUp=!!s&&!!l&&!!c,this._flyingEye=!!s&&!l,this._flyingLook=!!l&&!s,s&&(this._eye2[0]=s[0],this._eye2[1]=s[1],this._eye2[2]=s[2]),l&&(this._look2[0]=l[0],this._look2[1]=l[1],this._look2[2]=l[2]),c&&(this._up2[0]=c[0],this._up2[1]=c[1],this._up2[2]=c[2]));n?(t.projection==="ortho"&&r.projection!=="ortho"&&(this._projection2="ortho",this._projMatrix1=r.projMatrix.slice(),this._projMatrix2=r.ortho.matrix.slice(),r.projection="customProjection"),t.projection==="perspective"&&r.projection!=="perspective"&&(this._projection2="perspective",this._projMatrix1=r.projMatrix.slice(),this._projMatrix2=r.perspective.matrix.slice(),r.projection="customProjection")):this._projection2=null,this.fire("started",t,!0),this._time1=Date.now(),this._time2=this._time1+(Number.isFinite(t.duration)?t.duration*1e3:this._duration),this._flying=!0,jr.scheduleTask(this._update,this)}jumpTo(t){this._jumpTo(t)}_jumpTo(t){this._flying&&this.stop();let i=this.scene.camera;var o,r,n,a,s;if(t.aabb)o=t.aabb;else if(t.length===6)o=t;else if(t.eye||t.look||t.up)n=t.eye,a=t.look,s=t.up;else{let d=t;if((St.isNumeric(d)||St.isString(d))&&(r=d,d=this.scene.components[r],!d)){this.error("Component not found: "+St.inQuotes(r));return}o=d.aabb||this.scene.aabb}let l=t.poi;if(o){if(o[3]<=o[0]||o[4]<=o[1]||o[5]<=o[2])return;var c=l?b.getAABB3DiagPoint(o,l):b.getAABB3Diag(o);a=l||b.getAABB3Center(o,a),this._trail?b.subVec3(i.look,a,ah):b.subVec3(i.eye,i.look,ah),b.normalizeVec3(ah);let d;d=(t.fit===void 0?this._fit:t.fit)?Math.abs(c/Math.tan((t.fitFOV||this._fitFOV)*b.DEGTORAD)):b.lenVec3(b.subVec3(i.eye,i.look,jB)),b.mulVec3Scalar(ah,d),i.eye=b.addVec3(a,ah,jB),i.look=a,this.scene.camera.ortho.scale=c*1.1}else(n||a||s)&&(n&&(i.eye=n),a&&(i.look=a),s&&(i.up=s));t.projection&&(i.projection=t.projection)}_update(){if(!this._flying)return;let t=(Date.now()-this._time1)/(this._time2-this._time1),i=t>=1;t>1&&(t=1);let o=this.easing?t7._ease(t,0,1,1):t,r=this.scene.camera;if(this._flyingEye||this._flyingLook?this._flyingEye?(b.subVec3(r.eye,r.look,ah),r.eye=b.lerpVec3(o,0,1,this._eye1,this._eye2,zB),r.look=b.subVec3(zB,ah,QB)):this._flyingLook&&(r.look=b.lerpVec3(o,0,1,this._look1,this._look2,QB),r.up=b.lerpVec3(o,0,1,this._up1,this._up2,Wj)):this._flyingEyeLookUp&&(r.eye=b.lerpVec3(o,0,1,this._eye1,this._eye2,zB),r.look=b.lerpVec3(o,0,1,this._look1,this._look2,QB),r.up=b.lerpVec3(o,0,1,this._up1,this._up2,Wj)),this._projection2){let n=this._projection2==="ortho"?t7._easeOutExpo(t,0,1,1):t7._easeInCubic(t,0,1,1);r.customProjection.matrix=b.lerpMat4(n,0,1,this._projMatrix1,this._projMatrix2)}else r.ortho.scale=this._orthoScale1+t*(this._orthoScale2-this._orthoScale1);if(i){r.ortho.scale=this._orthoScale2,this.stop();return}jr.scheduleTask(this._update,this)}static _ease(t,i,o,r){return t/=r,-o*t*(t-2)+i}static _easeInCubic(t,i,o,r){return t/=r,o*t*t*t+i}static _easeOutExpo(t,i,o,r){return o*(-(2**(-10*t/r))+1)+i}stop(){if(!this._flying)return;this._flying=!1,this._time1=null,this._time2=null,this._projection2&&(this.scene.camera.projection=this._projection2);let t=this._callback;t&&(this._callback=null,this._callbackScope?t.call(this._callbackScope):t()),this.fire("stopped",!0,!0)}cancel(){this._flying&&(this._flying=!1,this._time1=null,this._time2=null,this._callback&&=null,this.fire("canceled",!0,!0))}set duration(t){this._duration=Number.isFinite(t)?t*1e3:500,this.stop()}get duration(){return this._duration/1e3}set fit(t){this._fit=t!==!1}get fit(){return this._fit}set fitFOV(t){this._fitFOV=t||45}get fitFOV(){return this._fitFOV}set trail(t){this._trail=!!t}get trail(){return this._trail}destroy(){this.stop(),super.destroy()}},Ng=class fs extends Ri{get type(){return"CameraPathAnimation"}constructor(t,i={}){super(t,i),this._cameraFlightAnimation=new qB(this),this._t=0,this.state=fs.SCRUBBING,this._playingFromT=0,this._playingToT=0,this._playingRate=i.playingRate||1,this._playingDir=1,this._lastTime=null,this.cameraPath=i.cameraPath,this._tick=this.scene.on("tick",this._updateT,this)}_updateT(){let t=this._cameraPath;if(!t)return;let i,o,r=performance.now(),n=this._lastTime?(r-this._lastTime)*.001:0;if(this._lastTime=r,n!==0)switch(this.state){case fs.SCRUBBING:return;case fs.PLAYING:if(this._t+=this._playingRate*n,i=this._cameraPath.frames.length,i===0||this._playingDir<0&&this._t<=0||this._playingDir>0&&this._t>=this._cameraPath.frames[i-1].t){this.state=fs.SCRUBBING,this._t=this._cameraPath.frames[i-1].t,this.fire("stopped");return}t.loadFrame(this._t);break;case fs.PLAYING_TO:o=this._t+this._playingRate*n*this._playingDir,(this._playingDir<0&&o<=this._playingToT||this._playingDir>0&&o>=this._playingToT)&&(o=this._playingToT,this.state=fs.SCRUBBING,this.fire("stopped")),this._t=o,t.loadFrame(this._t);break}}_ease(t,i,o,r){return t/=r,-o*t*(t-2)+i}set cameraPath(t){this._cameraPath=t}get cameraPath(){return this._cameraPath}set rate(t){this._playingRate=t}get rate(){return this._playingRate}play(){this._cameraPath&&(this._lastTime=null,this.state=fs.PLAYING)}playToT(t){this._cameraPath&&(this._playingFromT=this._t,this._playingToT=t,this._playingDir=this._playingToT-this._playingFromT<0?-1:1,this._lastTime=null,this.state=fs.PLAYING_TO)}playToFrame(t){let i=this._cameraPath;if(!i)return;let o=i.frames[t];if(!o){this.error("playToFrame - frame index out of range: "+t);return}this.playToT(o.t)}flyToFrame(t,i){let o=this._cameraPath;if(!o)return;let r=o.frames[t];if(!r){this.error("flyToFrame - frame index out of range: "+t);return}this.state=fs.SCRUBBING,this._cameraFlightAnimation.flyTo(r,i)}scrubToT(t){let i=this._cameraPath;i&&this.scene.camera&&(this._t=t,i.loadFrame(this._t),this.state=fs.SCRUBBING)}scrubToFrame(t){let i=this._cameraPath;if(i&&this.scene.camera){if(!i.frames[t]){this.error("playToFrame - frame index out of range: "+t);return}i.loadFrame(this._t),this.state=fs.SCRUBBING}}stop(){this.state=fs.SCRUBBING,this.fire("stopped")}destroy(){super.destroy(),this.scene.off(this._tick)}};Ng.STOPPED=0,Ng.SCRUBBING=1,Ng.PLAYING=2,Ng.PLAYING_TO=3;var Yj=class extends Ri{get type(){return"Geometry"}get isGeometry(){return!0}constructor(e,t={}){super(e,t),lr.memory.meshes++}destroy(){super.destroy(),lr.memory.meshes--}},Xj=new Ss({}),kr=class{constructor(e){this.id=Xj.addItem({});for(let t in e)e.hasOwnProperty(t)&&(this[t]=e[t])}destroy(){Xj.removeItem(this.id)}},Zt=class{constructor(e,t,i,o,r,n,a,s,l){switch(this._gl=e,this.type=t,this.allocated=!1,this.ConstructorType=i.constructor,i.constructor){case Uint8Array:this.itemType=e.UNSIGNED_BYTE,this.itemByteSize=1;break;case Int8Array:this.itemType=e.BYTE,this.itemByteSize=1;break;case Uint16Array:this.itemType=e.UNSIGNED_SHORT,this.itemByteSize=2;break;case Int16Array:this.itemType=e.SHORT,this.itemByteSize=2;break;case Uint32Array:this.itemType=e.UNSIGNED_INT,this.itemByteSize=4;break;case Int32Array:this.itemType=e.INT,this.itemByteSize=4;break;default:this.itemType=e.FLOAT,this.itemByteSize=4}this.usage=n,this.length=0,this.dataLength=o,this.numItems=0,this.itemSize=r,this.normalized=!!a,this.stride=s||0,this.offset=l||0,this._allocate(i)}_allocate(e){if(this.allocated=!1,this._handle=this._gl.createBuffer(),!this._handle)throw"Failed to allocate WebGL ArrayBuffer";this._handle&&(this._gl.bindBuffer(this.type,this._handle),this._gl.bufferData(this.type,e.length>this.dataLength?e.slice(0,this.dataLength):e,this.usage),this._gl.bindBuffer(this.type,null),this.length=e.length,this.numItems=this.length/this.itemSize,this.allocated=!0)}setData(e,t){this.allocated&&(e.length+(t||0)>this.length?(this.destroy(),this._allocate(e)):(this._gl.bindBuffer(this.type,this._handle),t||t===0?this._gl.bufferSubData(this.type,t*this.itemByteSize,e):this._gl.bufferData(this.type,e,this.usage),this._gl.bindBuffer(this.type,null)))}getData(e=0,t=this.numItems-e){if(!this.allocated)return[];let i=new this.ConstructorType(t*this.itemSize);return this._gl.bindBuffer(this.type,this._handle),this._gl.getBufferSubData(this.type,e*this.itemByteSize*this.itemSize,i,0,t*this.itemSize),i}bind(){this.allocated&&this._gl.bindBuffer(this.type,this._handle)}unbind(){this.allocated&&this._gl.bindBuffer(this.type,null)}destroy(){this.allocated&&=(this._gl.deleteBuffer(this._handle),this._handle=null,!1)}},Bu=(function(){let e=[],t=[],i=[],o=[],r=[],n=0,a=new Uint16Array(3),s=new Uint16Array(3),l=new Uint16Array(3),c=b.vec3(),d=b.vec3(),u=b.vec3(),A=b.vec3(),h=b.vec3(),p=b.vec3(),f=b.vec3();function m(y,v){let C={},x,B,E,D,P=1e4,M,R,O=0;for(M=0,R=y.length;M<R;M+=3)x=y[M],B=y[M+1],E=y[M+2],D=Math.round(x*P)+"_"+Math.round(B*P)+"_"+Math.round(E*P),C[D]===void 0&&(C[D]=O/3,e[O++]=x,e[O++]=B,e[O++]=E),t[M/3]=C[D];for(M=0,R=v.length;M<R;M++)o[M]=t[v[M]],i[o[M]]=v[M]}function g(y,v){n=0;for(let C=0,x=y;C<x;C+=3){let B=o[C]*3,E=o[C+1]*3,D=o[C+2]*3;v?(a[0]=e[B],a[1]=e[B+1],a[2]=e[B+2],s[0]=e[E],s[1]=e[E+1],s[2]=e[E+2],l[0]=e[D],l[1]=e[D+1],l[2]=e[D+2],b.decompressPosition(a,v,c),b.decompressPosition(s,v,d),b.decompressPosition(l,v,u)):(c[0]=e[B],c[1]=e[B+1],c[2]=e[B+2],d[0]=e[E],d[1]=e[E+1],d[2]=e[E+2],u[0]=e[D],u[1]=e[D+1],u[2]=e[D+2]),b.subVec3(u,d,A),b.subVec3(c,d,h),b.cross3Vec3(A,h,p),b.normalizeVec3(p,f);let P=r[n]||(r[n]={normal:b.vec3()});P.normal[0]=f[0],P.normal[1]=f[1],P.normal[2]=f[2],n++}}return function(y,v,C,x){m(y,v),g(v.length,C);let B=[],E=Math.cos(b.DEGTORAD*x),D={},P,M,R,O,V,z=!1,K,Z,te,ie,se,Be;for(let qe=0,ze=v.length;qe<ze;qe+=3){let st=qe/3;for(let Pe=0;Pe<3;Pe++)P=o[qe+Pe],M=o[qe+(Pe+1)%3],R=Math.min(P,M),O=Math.max(P,M),V=R+","+O,D[V]===void 0?D[V]={index1:R,index2:O,face1:st,face2:void 0}:D[V].face2=st}for(V in D)K=D[V],!(K.face2!==void 0&&(Z=r[K.face1].normal,te=r[K.face2].normal,ie=b.dotVec3(Z,te),ie>E))&&(se=i[K.index1],Be=i[K.index2],(!z&&se>65535||Be>65535)&&(z=!0),B.push(se),B.push(Be));return z?new Uint32Array(B):new Uint16Array(B)}})();function Nit(e){let t=new Float32Array(3),i=new Float32Array(3),o,r;for(o=0;o<3;o++)t[o]=Number.MAX_VALUE,i[o]=-Number.MAX_VALUE;for(o=0;o<e.length;o+=3)for(r=0;r<3;r++)t[r]=Math.min(t[r],e[o+r]),i[r]=Math.max(i[r],e[o+r]);return{min:t,max:i}}var Hit=(function(){let e=b.mat4(),t=b.mat4();return function(i,o){o||=b.mat4();let r=i[0],n=i[1],a=i[2],s=i[3]-r,l=i[4]-n,c=i[5]-a,d=65535;return b.identityMat4(e),b.translationMat4v(i,e),b.identityMat4(t),b.scalingMat4v([s/d,l/d,c/d],t),b.mulMat4(e,t,o),o}})(),Vit=(function(){let e=b.mat4(),t=b.mat4();return function(i,o,r){let n=new Uint16Array(i.length),a=new Float32Array([r[0]===o[0]?0:65535/(r[0]-o[0]),r[1]===o[1]?0:65535/(r[1]-o[1]),r[2]===o[2]?0:65535/(r[2]-o[2])]),s;for(s=0;s<i.length;s+=3)n[s+0]=Math.max(0,Math.min(65535,Math.floor((i[s+0]-o[0])*a[0]))),n[s+1]=Math.max(0,Math.min(65535,Math.floor((i[s+1]-o[1])*a[1]))),n[s+2]=Math.max(0,Math.min(65535,Math.floor((i[s+2]-o[2])*a[2])));return b.identityMat4(e),b.translationMat4v(o,e),b.identityMat4(t),b.scalingMat4v([(r[0]-o[0])/65535,(r[1]-o[1])/65535,(r[2]-o[2])/65535],t),{quantized:n,decodeMatrix:b.mulMat4(e,t,b.identityMat4())}}})();function jit(e,t,i){let o=new Float32Array([t[3]===t[0]?0:65535/(t[3]-t[0]),t[4]===t[1]?0:65535/(t[4]-t[1]),t[5]===t[2]?0:65535/(t[5]-t[2])]);i[0]=Math.max(0,Math.min(65535,Math.floor((e[0]-t[0])*o[0]))),i[1]=Math.max(0,Math.min(65535,Math.floor((e[1]-t[1])*o[1]))),i[2]=Math.max(0,Math.min(65535,Math.floor((e[2]-t[2])*o[2])))}function Qit(e,t,i){return i[0]=e[0]*t[0]+t[12],i[1]=e[1]*t[5]+t[13],i[2]=e[2]*t[10]+t[14],i}function zit(e,t,i=e){return i[0]=e[0]*t[0]+t[12],i[1]=e[1]*t[5]+t[13],i[2]=e[2]*t[10]+t[14],i[3]=e[3]*t[0]+t[12],i[4]=e[4]*t[5]+t[13],i[5]=e[5]*t[10]+t[14],i}function qit(e,t,i=new Float32Array(e.length)){for(let o=0,r=e.length;o<r;o+=3)i[o+0]=e[o+0]*t[0]+t[12],i[o+1]=e[o+1]*t[5]+t[13],i[o+2]=e[o+2]*t[10]+t[14];return i}function Git(e){let t=new Float32Array(2),i=new Float32Array(2),o,r;for(o=0;o<2;o++)t[o]=Number.MAX_VALUE,i[o]=-Number.MAX_VALUE;for(o=0;o<e.length;o+=2)for(r=0;r<2;r++)t[r]=Math.min(t[r],e[o+r]),i[r]=Math.max(i[r],e[o+r]);return{min:t,max:i}}var Kit=(function(){let e=b.mat3(),t=b.mat3();return function(i,o,r){let n=new Uint16Array(i.length),a=new Float32Array([65535/(r[0]-o[0]),65535/(r[1]-o[1])]),s;for(s=0;s<i.length;s+=2)n[s+0]=Math.max(0,Math.min(65535,Math.floor((i[s+0]-o[0])*a[0]))),n[s+1]=Math.max(0,Math.min(65535,Math.floor((i[s+1]-o[1])*a[1])));return b.identityMat3(e),b.translationMat3v(o,e),b.identityMat3(t),b.scalingMat3v([(r[0]-o[0])/65535,(r[1]-o[1])/65535],t),{quantized:n,decodeMatrix:b.mulMat3(e,t,b.identityMat3())}}})();function Jit(e){let t=new Int8Array(e.length),i,o,r,n,a;for(let s=0;s<e.length;s+=3)r=i=W5(e,s,"floor","floor"),o=Y5(i),n=a=X5(e,s,o),i=W5(e,s,"ceil","floor"),o=Y5(i),n=X5(e,s,o),n>a&&(r=i,a=n),i=W5(e,s,"floor","ceil"),o=Y5(i),n=X5(e,s,o),n>a&&(r=i,a=n),i=W5(e,s,"ceil","ceil"),o=Y5(i),n=X5(e,s,o),n>a&&(r=i,a=n),t[s]=r[0],t[s+1]=r[1];return t}function W5(e,t,i,o){let r=e[t]/(Math.abs(e[t])+Math.abs(e[t+1])+Math.abs(e[t+2])),n=e[t+1]/(Math.abs(e[t])+Math.abs(e[t+1])+Math.abs(e[t+2]));if(e[t+2]<0){let a=(1-Math.abs(n))*(r>=0?1:-1),s=(1-Math.abs(r))*(n>=0?1:-1);r=a,n=s}return new Int8Array([Math[i](r*127.5+(r<0?-1:0)),Math[o](n*127.5+(n<0?-1:0))])}function Y5(e){let t=e[0],i=e[1];t/=t<0?127:128,i/=i<0?127:128;let o=1-Math.abs(t)-Math.abs(i);o<0&&(t=(1-Math.abs(i))*(t>=0?1:-1),i=(1-Math.abs(t))*(i>=0?1:-1));let r=Math.sqrt(t*t+i*i+o*o);return[t/r,i/r,o/r]}function X5(e,t,i){return e[t]*i[0]+e[t+1]*i[1]+e[t+2]*i[2]}function Zit(e,t,i){i[0]=e[0]*t[0]+t[6],i[1]=e[1]*t[4]+t[7]}function Wit(e,t,i=new Float32Array(e.length)){for(let o=0,r=e.length;o<r;o+=3)i[o+0]=e[o+0]*t[0]+t[6],i[o+1]=e[o+1]*t[4]+t[7];return i}function Yit(e,t){let i=e[0],o=e[1];i=(2*i+1)/255,o=(2*o+1)/255;let r=1-Math.abs(i)-Math.abs(o);r<0&&(i=(1-Math.abs(o))*(i>=0?1:-1),o=(1-Math.abs(i))*(o>=0?1:-1));let n=Math.sqrt(i*i+o*o+r*r);return t[0]=i/n,t[1]=o/n,t[2]=r/n,t}function Xit(e,t){for(let i=0,o=0,r=e.length;i<r;i+=2){let n=e[i+0],a=e[i+1];n=(2*n+1)/255,a=(2*a+1)/255;let s=1-Math.abs(n)-Math.abs(a);s<0&&(n=(1-Math.abs(a))*(n>=0?1:-1),a=(1-Math.abs(n))*(a>=0?1:-1));let l=Math.sqrt(n*n+a*a+s*s);t[o+0]=n/l,t[o+1]=a/l,t[o+2]=s/l,o+=3}return t}var bi={getPositionsBounds:Nit,createPositionsDecodeMatrix:Hit,compressPositions:Vit,compressPosition:jit,decompressPositions:qit,decompressPosition:Qit,decompressAABB:zit,getUVBounds:Git,compressUVs:Kit,decompressUVs:Wit,decompressUV:Zit,compressNormals:Jit,decompressNormals:Xit,decompressNormal:Yit},Xl=lr.memory,$j=b.AABB3(),Kr=class extends Yj{get type(){return"ReadableGeometry"}get isReadableGeometry(){return!0}constructor(e,t={}){super(e,t),this._state=new kr({compressGeometry:!!t.compressGeometry,primitive:null,primitiveName:null,positions:null,normals:null,colors:null,uv:null,indices:null,positionsDecodeMatrix:null,uvDecodeMatrix:null,positionsBuf:null,normalsBuf:null,colorsbuf:null,uvBuf:null,indicesBuf:null,hash:""}),this._numTriangles=0,this._edgeThreshold=t.edgeThreshold||10,this._edgeIndicesBuf=null,this._pickTrianglePositionsBuf=null,this._pickTriangleColorsBuf=null,this._aabbDirty=!0,this._boundingSphere=!0,this._aabb=null,this._aabbDirty=!0,this._obb=null,this._obbDirty=!0;let i=this._state,o=this.scene.canvas.gl;switch(t.primitive=t.primitive||"triangles",t.primitive){case"points":i.primitive=o.POINTS,i.primitiveName=t.primitive;break;case"lines":i.primitive=o.LINES,i.primitiveName=t.primitive;break;case"line-loop":i.primitive=o.LINE_LOOP,i.primitiveName=t.primitive;break;case"line-strip":i.primitive=o.LINE_STRIP,i.primitiveName=t.primitive;break;case"triangles":i.primitive=o.TRIANGLES,i.primitiveName=t.primitive;break;case"triangle-strip":i.primitive=o.TRIANGLE_STRIP,i.primitiveName=t.primitive;break;case"triangle-fan":i.primitive=o.TRIANGLE_FAN,i.primitiveName=t.primitive;break;default:this.error("Unsupported value for 'primitive': '"+t.primitive+"' - supported values are 'points', 'lines', 'line-loop', 'line-strip', 'triangles', 'triangle-strip' and 'triangle-fan'. Defaulting to 'triangles'."),i.primitive=o.TRIANGLES,i.primitiveName=t.primitive}if(t.positions)if(this._state.compressGeometry){let r=bi.getPositionsBounds(t.positions),n=bi.compressPositions(t.positions,r.min,r.max);i.positions=n.quantized,i.positionsDecodeMatrix=n.decodeMatrix}else i.positions=t.positions.constructor===Float32Array?t.positions:new Float32Array(t.positions);if(t.colors&&(i.colors=t.colors.constructor===Float32Array?t.colors:new Float32Array(t.colors)),t.uv)if(this._state.compressGeometry){let r=bi.getUVBounds(t.uv),n=bi.compressUVs(t.uv,r.min,r.max);i.uv=n.quantized,i.uvDecodeMatrix=n.decodeMatrix}else i.uv=t.uv.constructor===Float32Array?t.uv:new Float32Array(t.uv);t.normals&&(this._state.compressGeometry?i.normals=bi.compressNormals(t.normals):i.normals=t.normals.constructor===Float32Array?t.normals:new Float32Array(t.normals)),t.indices&&(i.indices=t.indices.constructor===Uint32Array||t.indices.constructor===Uint16Array?t.indices:new Uint32Array(t.indices),this._state.primitiveName==="triangles"&&(this._numTriangles=t.indices.length/3)),this._buildHash(),Xl.meshes++,this._buildVBOs()}_buildVBOs(){let e=this._state,t=this.scene.canvas.gl;if(e.indices&&(e.indicesBuf=new Zt(t,t.ELEMENT_ARRAY_BUFFER,e.indices,e.indices.length,1,t.STATIC_DRAW),Xl.indices+=e.indicesBuf.numItems),e.positions&&(e.positionsBuf=new Zt(t,t.ARRAY_BUFFER,e.positions,e.positions.length,3,t.STATIC_DRAW),Xl.positions+=e.positionsBuf.numItems),e.normals){let i=e.compressGeometry;e.normalsBuf=new Zt(t,t.ARRAY_BUFFER,e.normals,e.normals.length,3,t.STATIC_DRAW,i),Xl.normals+=e.normalsBuf.numItems}e.colors&&(e.colorsBuf=new Zt(t,t.ARRAY_BUFFER,e.colors,e.colors.length,4,t.STATIC_DRAW),Xl.colors+=e.colorsBuf.numItems),e.uv&&(e.uvBuf=new Zt(t,t.ARRAY_BUFFER,e.uv,e.uv.length,2,t.STATIC_DRAW),Xl.uvs+=e.uvBuf.numItems)}_buildHash(){let e=this._state,t=["/g"];t.push("/"+e.primitive+";"),e.positions&&t.push("p"),e.colors&&t.push("c"),(e.normals||e.autoVertexNormals)&&t.push("n"),e.uv&&t.push("u"),e.compressGeometry&&t.push("cp"),t.push(";"),e.hash=t.join("")}_getEdgeIndices(){return this._edgeIndicesBuf||this._buildEdgeIndices(),this._edgeIndicesBuf}_getPickTrianglePositions(){return this._pickTrianglePositionsBuf||this._buildPickTriangleVBOs(),this._pickTrianglePositionsBuf}_getPickTriangleColors(){return this._pickTriangleColorsBuf||this._buildPickTriangleVBOs(),this._pickTriangleColorsBuf}_buildEdgeIndices(){let e=this._state;if(!e.positions||!e.indices)return;let t=this.scene.canvas.gl,i=Bu(e.positions,e.indices,e.positionsDecodeMatrix,this._edgeThreshold);this._edgeIndicesBuf=new Zt(t,t.ELEMENT_ARRAY_BUFFER,i,i.length,1,t.STATIC_DRAW),Xl.indices+=this._edgeIndicesBuf.numItems}_buildPickTriangleVBOs(){let e=this._state;if(!e.positions||!e.indices)return;let t=this.scene.canvas.gl,i=b.buildPickTriangles(e.positions,e.indices,e.compressGeometry),o=i.positions,r=i.colors;this._pickTrianglePositionsBuf=new Zt(t,t.ARRAY_BUFFER,o,o.length,3,t.STATIC_DRAW),this._pickTriangleColorsBuf=new Zt(t,t.ARRAY_BUFFER,r,r.length,4,t.STATIC_DRAW,!0),Xl.positions+=this._pickTrianglePositionsBuf.numItems,Xl.colors+=this._pickTriangleColorsBuf.numItems}_buildPickVertexVBOs(){}_webglContextLost(){this._sceneVertexBufs&&this._sceneVertexBufs.webglContextLost()}_webglContextRestored(){this._sceneVertexBufs&&this._sceneVertexBufs.webglContextRestored(),this._buildVBOs(),this._edgeIndicesBuf=null,this._pickVertexPositionsBuf=null,this._pickTrianglePositionsBuf=null,this._pickTriangleColorsBuf=null,this._pickVertexPositionsBuf=null,this._pickVertexColorsBuf=null}get primitive(){return this._state.primitiveName}get compressGeometry(){return this._state.compressGeometry}get positions(){return this._state.positions?this._state.compressGeometry?(this._decompressedPositions||(this._decompressedPositions=new Float32Array(this._state.positions.length),bi.decompressPositions(this._state.positions,this._state.positionsDecodeMatrix,this._decompressedPositions)),this._decompressedPositions):this._state.positions:null}set positions(e){let t=this._state,i=t.positions;if(!i){this.error("can't update geometry positions - geometry has no positions");return}if(i.length!==e.length){this.error("can't update geometry positions - new positions are wrong length");return}if(this._state.compressGeometry){let o=bi.getPositionsBounds(e),r=bi.compressPositions(e,o.min,o.max);e=r.quantized,t.positionsDecodeMatrix=r.decodeMatrix}i.set(e),t.positionsBuf&&t.positionsBuf.setData(i),this._setAABBDirty(),this.glRedraw()}get normals(){if(this._state.normals){if(!this._state.compressGeometry)return this._state.normals;if(!this._decompressedNormals){let e=this._state.normals.length,t=e+e/2;this._decompressedNormals=new Float32Array(t),bi.decompressNormals(this._state.normals,this._decompressedNormals)}return this._decompressedNormals}}set normals(e){if(this._state.compressGeometry){this.error("can't update geometry normals - quantized geometry is immutable");return}let t=this._state,i=t.normals;if(!i){this.error("can't update geometry normals - geometry has no normals");return}if(i.length!==e.length){this.error("can't update geometry normals - new normals are wrong length");return}i.set(e),t.normalsBuf&&t.normalsBuf.setData(i),this.glRedraw()}get uv(){return this._state.uv?this._state.compressGeometry?(this._decompressedUV||(this._decompressedUV=new Float32Array(this._state.uv.length),bi.decompressUVs(this._state.uv,this._state.uvDecodeMatrix,this._decompressedUV)),this._decompressedUV):this._state.uv:null}set uv(e){if(this._state.compressGeometry){this.error("can't update geometry UVs - quantized geometry is immutable");return}let t=this._state,i=t.uv;if(!i){this.error("can't update geometry UVs - geometry has no UVs");return}if(i.length!==e.length){this.error("can't update geometry UVs - new UVs are wrong length");return}i.set(e),t.uvBuf&&t.uvBuf.setData(i),this.glRedraw()}get colors(){return this._state.colors}set colors(e){if(this._state.compressGeometry){this.error("can't update geometry colors - quantized geometry is immutable");return}let t=this._state,i=t.colors;if(!i){this.error("can't update geometry colors - geometry has no colors");return}if(i.length!==e.length){this.error("can't update geometry colors - new colors are wrong length");return}i.set(e),t.colorsBuf&&t.colorsBuf.setData(i),this.glRedraw()}get indices(){return this._state.indices}get aabb(){return this._aabbDirty&&=(this._aabb||=b.AABB3(),b.positions3ToAABB3(this._state.positions,this._aabb,this._state.positionsDecodeMatrix),!1),this._aabb}get obb(){return this._obbDirty&&=(this._obb||=b.OBB3(),b.positions3ToAABB3(this._state.positions,$j,this._state.positionsDecodeMatrix),b.AABB3ToOBB3($j,this._obb),!1),this._obb}_getMetrics(){if(!("_metrics"in this))switch(this._state.primitiveName){case"solid":case"surface":case"triangles":{let e=this._state.indices,t=this._state.positions,i=(a,s)=>{let l=e[a]*3;for(let c=0;c<3;++c)s[c]=t[l+c];return s},o=[b.vec3(),b.vec3(),b.vec3(),b.vec3()],r=0,n=b.vec3([0,0,0]);for(let a=0;a<e.length;a+=3){let s=i(a,o[0]),l=i(a+1,o[1]),c=i(a+2,o[2]);b.addVec3(s,l,o[3]),b.addVec3(c,o[3],o[3]);let d=b.lenVec3(b.cross3Vec3(b.subVec3(l,s,o[1]),b.subVec3(c,s,o[2]),o[0]))/2;r+=d,b.mulVec3Scalar(o[3],d,o[3]),b.addVec3(n,o[3],n)}this._metrics={surfaceArea:r,centroid:b.mulVec3Scalar(n,1/r/3,n)};break}default:this._metrics={surfaceArea:0};break}return this._metrics}get surfaceArea(){return this._getMetrics().surfaceArea}get centroid(){return this._getMetrics().centroid}get numTriangles(){return this._numTriangles}_setAABBDirty(){this._aabbDirty||(this._aabbDirty=!0,this._aabbDirty=!0,this._obbDirty=!0)}_getState(){return this._state}destroy(){super.destroy();let e=this._state;e.indicesBuf&&e.indicesBuf.destroy(),e.positionsBuf&&e.positionsBuf.destroy(),e.normalsBuf&&e.normalsBuf.destroy(),e.uvBuf&&e.uvBuf.destroy(),e.colorsBuf&&e.colorsBuf.destroy(),this._edgeIndicesBuf&&this._edgeIndicesBuf.destroy(),this._pickTrianglePositionsBuf&&this._pickTrianglePositionsBuf.destroy(),this._pickTriangleColorsBuf&&this._pickTriangleColorsBuf.destroy(),this._pickVertexPositionsBuf&&this._pickVertexPositionsBuf.destroy(),this._pickVertexColorsBuf&&this._pickVertexColorsBuf.destroy(),e.destroy(),Xl.meshes--}},sh=lr.memory,eQ=b.AABB3(),tQ=class extends Yj{get type(){return"VBOGeometry"}get isVBOGeometry(){return!0}constructor(e,t={}){super(e,t),this._state=new kr({compressGeometry:!0,primitive:null,primitiveName:null,positionsDecodeMatrix:null,uvDecodeMatrix:null,positionsBuf:null,normalsBuf:null,colorsbuf:null,uvBuf:null,indicesBuf:null,hash:""}),this._numTriangles=0,this._edgeThreshold=t.edgeThreshold||10,this._aabb=null,this._obb=b.OBB3();let i=this._state,o=this.scene.canvas.gl;switch(t.primitive=t.primitive||"triangles",t.primitive){case"points":i.primitive=o.POINTS,i.primitiveName=t.primitive;break;case"lines":i.primitive=o.LINES,i.primitiveName=t.primitive;break;case"line-loop":i.primitive=o.LINE_LOOP,i.primitiveName=t.primitive;break;case"line-strip":i.primitive=o.LINE_STRIP,i.primitiveName=t.primitive;break;case"triangles":i.primitive=o.TRIANGLES,i.primitiveName=t.primitive;break;case"triangle-strip":i.primitive=o.TRIANGLE_STRIP,i.primitiveName=t.primitive;break;case"triangle-fan":i.primitive=o.TRIANGLE_FAN,i.primitiveName=t.primitive;break;default:this.error("Unsupported value for 'primitive': '"+t.primitive+"' - supported values are 'points', 'lines', 'line-loop', 'line-strip', 'triangles', 'triangle-strip' and 'triangle-fan'. Defaulting to 'triangles'."),i.primitive=o.TRIANGLES,i.primitiveName=t.primitive}if(!t.positions){this.error("Config expected: positions");return}if(!t.indices){this.error("Config expected: indices");return}var r;if(!t.positionsDecodeMatrix){let n=bi.getPositionsBounds(t.positions),a=bi.compressPositions(t.positions,n.min,n.max);r=a.quantized,i.positionsDecodeMatrix=a.decodeMatrix,i.positionsBuf=new Zt(o,o.ARRAY_BUFFER,r,r.length,3,o.STATIC_DRAW),sh.positions+=i.positionsBuf.numItems,b.positions3ToAABB3(t.positions,this._aabb),b.positions3ToAABB3(r,eQ,i.positionsDecodeMatrix),b.AABB3ToOBB3(eQ,this._obb)}if(t.colors){let n=t.colors.constructor===Float32Array?t.colors:new Float32Array(t.colors);i.colorsBuf=new Zt(o,o.ARRAY_BUFFER,n,n.length,4,o.STATIC_DRAW),sh.colors+=i.colorsBuf.numItems}if(t.uv){let n=bi.getUVBounds(t.uv),a=bi.compressUVs(t.uv,n.min,n.max),s=a.quantized;i.uvDecodeMatrix=a.decodeMatrix,i.uvBuf=new Zt(o,o.ARRAY_BUFFER,s,s.length,2,o.STATIC_DRAW),sh.uvs+=i.uvBuf.numItems}if(t.normals){let n=bi.compressNormals(t.normals),a=i.compressGeometry;i.normalsBuf=new Zt(o,o.ARRAY_BUFFER,n,n.length,3,o.STATIC_DRAW,a),sh.normals+=i.normalsBuf.numItems}{let n=t.indices.constructor===Uint32Array||t.indices.constructor===Uint16Array?t.indices:new Uint32Array(t.indices);i.indicesBuf=new Zt(o,o.ELEMENT_ARRAY_BUFFER,n,n.length,1,o.STATIC_DRAW),sh.indices+=i.indicesBuf.numItems;let a=Bu(r,n,i.positionsDecodeMatrix,this._edgeThreshold);this._edgeIndicesBuf=new Zt(o,o.ELEMENT_ARRAY_BUFFER,a,a.length,1,o.STATIC_DRAW),this._state.primitiveName==="triangles"&&(this._numTriangles=t.indices.length/3)}this._buildHash(),sh.meshes++}_buildHash(){let e=this._state,t=["/g"];t.push("/"+e.primitive+";"),e.positionsBuf&&t.push("p"),e.colorsBuf&&t.push("c"),(e.normalsBuf||e.autoVertexNormals)&&t.push("n"),e.uvBuf&&t.push("u"),t.push("cp"),t.push(";"),e.hash=t.join("")}_getEdgeIndices(){return this._edgeIndicesBuf}get primitive(){return this._state.primitiveName}get aabb(){return this._aabb}get obb(){return this._obb}get numTriangles(){return this._numTriangles}_getState(){return this._state}destroy(){super.destroy();let e=this._state;e.indicesBuf&&e.indicesBuf.destroy(),e.positionsBuf&&e.positionsBuf.destroy(),e.normalsBuf&&e.normalsBuf.destroy(),e.uvBuf&&e.uvBuf.destroy(),e.colorsBuf&&e.colorsBuf.destroy(),this._edgeIndicesBuf&&this._edgeIndicesBuf.destroy(),e.destroy(),sh.meshes--}},tt={};tt.load=function(e,t){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(o){t(o.target.response)},i.send()},tt.save=function(e,t){var i="data:application/octet-stream;base64,"+btoa(tt.parse._buffToStr(e));window.location.href=i},tt.clone=function(e){return JSON.parse(JSON.stringify(e))},tt.bin={},tt.bin.f=new Float32Array(1),tt.bin.fb=new Uint8Array(tt.bin.f.buffer),tt.bin.rf=function(e,t){for(var i=tt.bin.f,o=tt.bin.fb,r=0;r<4;r++)o[r]=e[t+r];return i[0]},tt.bin.rsl=function(e,t){return e[t]|e[t+1]<<8},tt.bin.ril=function(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24},tt.bin.rASCII0=function(e,t){for(var i="";e[t]!=0;)i+=String.fromCharCode(e[t++]);return i},tt.bin.wf=function(e,t,i){var o=new Float32Array(e.buffer,t,1);o[0]=i},tt.bin.wsl=function(e,t,i){e[t]=i,e[t+1]=i>>8},tt.bin.wil=function(e,t,i){e[t]=i,e[t+1]=i>>8,e[t+2]=i>>16,e[t+3]>>24},tt.parse={},tt.parse._buffToStr=function(e){for(var t=new Uint8Array(e),i="",o=0;o<t.length;o++)i=i.concat(String.fromCharCode(t[o]));return i},tt.parse._strToBuff=function(e){for(var t=new ArrayBuffer(e.length),i=new Uint8Array(t),o=0;o<e.length;o++)i[o]=e.charCodeAt(o);return t},tt.parse._readLine=function(e,t){for(var i="";e[t]!=10;)i+=String.fromCharCode(e[t++]);return i},tt.parse.fromJSON=function(e){return JSON.parse(tt.parse._buffToStr(e))},tt.parse.toJSON=function(e){var t=JSON.stringify(e);return tt.parse._strToBuff(t)},tt.parse.fromOBJ=function(e){var t={};t.groups={},t.c_verts=[],t.c_uvt=[],t.c_norms=[],t.i_verts=[],t.i_uvt=[],t.i_norms=[];for(var i={from:0,to:0},o=0,r=new Uint8Array(e);o<r.length;){var n=tt.parse._readLine(r,o);o+=n.length+1,n=n.replace(/ +(?= )/g,""),n=n.replace(/(^\s+|\s+$)/g,"");var a=n.split(" ");if(a[0]=="g"&&(i.to=t.i_verts.length,t.groups[a[1]]??(t.groups[a[1]]={from:t.i_verts.length,to:0}),i=t.groups[a[1]]),a[0]=="v"){var s=parseFloat(a[1]),l=parseFloat(a[2]),c=parseFloat(a[3]);t.c_verts.push(s,l,c)}if(a[0]=="vt"){var s=parseFloat(a[1]),l=1-parseFloat(a[2]);t.c_uvt.push(s,l)}if(a[0]=="vn"){var s=parseFloat(a[1]),l=parseFloat(a[2]),c=parseFloat(a[3]);t.c_norms.push(s,l,c)}if(a[0]=="f"){var d=a[1].split("/"),u=a[2].split("/"),A=a[3].split("/"),h=parseInt(d[0])-1,p=parseInt(u[0])-1,f=parseInt(A[0])-1,m=parseInt(d[1])-1,g=parseInt(u[1])-1,y=parseInt(A[1])-1,v=parseInt(d[2])-1,C=parseInt(u[2])-1,x=parseInt(A[2])-1,B=t.c_verts.length/3,E=t.c_uvt.length/2,D=t.c_norms.length/3;if(h<0&&(h=B+h+1),p<0&&(p=B+p+1),f<0&&(f=B+f+1),m<0&&(m=E+m+1),g<0&&(g=E+g+1),y<0&&(y=E+y+1),v<0&&(v=D+v+1),C<0&&(C=D+C+1),x<0&&(x=D+x+1),t.i_verts.push(h,p,f),t.i_uvt.push(m,g,y),t.i_norms.push(v,C,x),a.length==5){var P=a[4].split("/"),M=parseInt(P[0])-1,R=parseInt(P[1])-1,O=parseInt(P[2])-1;M<0&&(M=B+M+1),R<0&&(R=E+R+1),O<0&&(O=D+O+1),t.i_verts.push(h,f,M),t.i_uvt.push(m,y,R),t.i_norms.push(v,x,O)}}}return i.to=t.i_verts.length,t},tt.parse.fromMD2=function(e){e=new Uint8Array(e);var t={},i={};i.ident=tt.bin.ril(e,0),i.version=tt.bin.ril(e,4),i.skinwidth=tt.bin.ril(e,8),i.skinheight=tt.bin.ril(e,12),i.framesize=tt.bin.ril(e,16),i.num_skins=tt.bin.ril(e,20),i.num_vertices=tt.bin.ril(e,24),i.num_st=tt.bin.ril(e,28),i.num_tris=tt.bin.ril(e,32),i.num_glcmds=tt.bin.ril(e,36),i.num_frames=tt.bin.ril(e,40),i.offset_skins=tt.bin.ril(e,44),i.offset_st=tt.bin.ril(e,48),i.offset_tris=tt.bin.ril(e,52),i.offset_frames=tt.bin.ril(e,56),i.offset_glcmds=tt.bin.ril(e,60),i.offset_end=tt.bin.ril(e,64);var l=i.offset_st;t.c_uvt=[];for(var o=0;o<i.num_st;o++){var r=tt.bin.rsl(e,l)/i.skinwidth,n=tt.bin.rsl(e,l+2)/i.skinheight;t.c_uvt.push(r,n),l+=4}var l=i.offset_tris,a=[],s=[];t.i_verts=a,t.i_uvt=s;for(var o=0;o<i.num_tris;o++)a.push(tt.bin.rsl(e,l),tt.bin.rsl(e,l+2),tt.bin.rsl(e,l+4)),s.push(tt.bin.rsl(e,l+6),tt.bin.rsl(e,l+8),tt.bin.rsl(e,l+10)),l+=12;var l=i.offset_skins;t.skins=[];for(var o=0;o<i.num_skins;o++)t.skins.push(tt.bin.rASCII0(e,l)),l+=64;var l=i.offset_frames;t.frames=[];for(var c=tt.parse.fromMD2._normals,o=0;o<i.num_frames;o++){var d={},u=tt.bin.rf(e,l),A=tt.bin.rf(e,l+4),h=tt.bin.rf(e,l+8);l+=12;var p=tt.bin.rf(e,l),f=tt.bin.rf(e,l+4),m=tt.bin.rf(e,l+8);l+=12,d.name=tt.bin.rASCII0(e,l),l+=16,d.verts=[],d.norms=[];for(var g=0;g<i.num_vertices;g++)d.verts.push(e[l]*u+p,e[l+1]*A+f,e[l+2]*h+m),d.norms.push(c[3*e[l+3]],c[3*e[l+3]+1],c[3*e[l+3]+2]),l+=4;t.frames.push(d)}return t},tt.parse.fromMD2._normals=[-.525731,0,.850651,-.442863,.238856,.864188,-.295242,0,.955423,-.309017,.5,.809017,-.16246,.262866,.951056,0,0,1,0,.850651,.525731,-.147621,.716567,.681718,.147621,.716567,.681718,0,.525731,.850651,.309017,.5,.809017,.525731,0,.850651,.295242,0,.955423,.442863,.238856,.864188,.16246,.262866,.951056,-.681718,.147621,.716567,-.809017,.309017,.5,-.587785,.425325,.688191,-.850651,.525731,0,-.864188,.442863,.238856,-.716567,.681718,.147621,-.688191,.587785,.425325,-.5,.809017,.309017,-.238856,.864188,.442863,-.425325,.688191,.587785,-.716567,.681718,-.147621,-.5,.809017,-.309017,-.525731,.850651,0,0,.850651,-.525731,-.238856,.864188,-.442863,0,.955423,-.295242,-.262866,.951056,-.16246,0,1,0,0,.955423,.295242,-.262866,.951056,.16246,.238856,.864188,.442863,.262866,.951056,.16246,.5,.809017,.309017,.238856,.864188,-.442863,.262866,.951056,-.16246,.5,.809017,-.309017,.850651,.525731,0,.716567,.681718,.147621,.716567,.681718,-.147621,.525731,.850651,0,.425325,.688191,.587785,.864188,.442863,.238856,.688191,.587785,.425325,.809017,.309017,.5,.681718,.147621,.716567,.587785,.425325,.688191,.955423,.295242,0,1,0,0,.951056,.16246,.262866,.850651,-.525731,0,.955423,-.295242,0,.864188,-.442863,.238856,.951056,-.16246,.262866,.809017,-.309017,.5,.681718,-.147621,.716567,.850651,0,.525731,.864188,.442863,-.238856,.809017,.309017,-.5,.951056,.16246,-.262866,.525731,0,-.850651,.681718,.147621,-.716567,.681718,-.147621,-.716567,.850651,0,-.525731,.809017,-.309017,-.5,.864188,-.442863,-.238856,.951056,-.16246,-.262866,.147621,.716567,-.681718,.309017,.5,-.809017,.425325,.688191,-.587785,.442863,.238856,-.864188,.587785,.425325,-.688191,.688191,.587785,-.425325,-.147621,.716567,-.681718,-.309017,.5,-.809017,0,.525731,-.850651,-.525731,0,-.850651,-.442863,.238856,-.864188,-.295242,0,-.955423,-.16246,.262866,-.951056,0,0,-1,.295242,0,-.955423,.16246,.262866,-.951056,-.442863,-.238856,-.864188,-.309017,-.5,-.809017,-.16246,-.262866,-.951056,0,-.850651,-.525731,-.147621,-.716567,-.681718,.147621,-.716567,-.681718,0,-.525731,-.850651,.309017,-.5,-.809017,.442863,-.238856,-.864188,.16246,-.262866,-.951056,.238856,-.864188,-.442863,.5,-.809017,-.309017,.425325,-.688191,-.587785,.716567,-.681718,-.147621,.688191,-.587785,-.425325,.587785,-.425325,-.688191,0,-.955423,-.295242,0,-1,0,.262866,-.951056,-.16246,0,-.850651,.525731,0,-.955423,.295242,.238856,-.864188,.442863,.262866,-.951056,.16246,.5,-.809017,.309017,.716567,-.681718,.147621,.525731,-.850651,0,-.238856,-.864188,-.442863,-.5,-.809017,-.309017,-.262866,-.951056,-.16246,-.850651,-.525731,0,-.716567,-.681718,-.147621,-.716567,-.681718,.147621,-.525731,-.850651,0,-.5,-.809017,.309017,-.238856,-.864188,.442863,-.262866,-.951056,.16246,-.864188,-.442863,.238856,-.809017,-.309017,.5,-.688191,-.587785,.425325,-.681718,-.147621,.716567,-.442863,-.238856,.864188,-.587785,-.425325,.688191,-.309017,-.5,.809017,-.147621,-.716567,.681718,-.425325,-.688191,.587785,-.16246,-.262866,.951056,.442863,-.238856,.864188,.16246,-.262866,.951056,.309017,-.5,.809017,.147621,-.716567,.681718,0,-.525731,.850651,.425325,-.688191,.587785,.587785,-.425325,.688191,.688191,-.587785,.425325,-.955423,.295242,0,-.951056,.16246,.262866,-1,0,0,-.850651,0,.525731,-.955423,-.295242,0,-.951056,-.16246,.262866,-.864188,.442863,-.238856,-.951056,.16246,-.262866,-.809017,.309017,-.5,-.864188,-.442863,-.238856,-.951056,-.16246,-.262866,-.809017,-.309017,-.5,-.681718,.147621,-.716567,-.681718,-.147621,-.716567,-.850651,0,-.525731,-.688191,.587785,-.425325,-.587785,.425325,-.688191,-.425325,.688191,-.587785,-.425325,-.688191,-.587785,-.587785,-.425325,-.688191,-.688191,-.587785,-.425325],tt.parse.fromCollada=function(e){var t=tt.parse._buffToStr(e),i=new DOMParser().parseFromString(t,"text/xml");i=i.childNodes[0];var o={},r=i.getElementsByTagName("asset")[0],n=i.getElementsByTagName("library_geometries")[0],a=i.getElementsByTagName("library_images")[0],s=i.getElementsByTagName("library_materials")[0],l=i.getElementsByTagName("library_effects")[0];return r&&(o.asset=tt.parse.fromCollada._asset(r)),n&&(o.geometries=tt.parse.fromCollada._libGeometries(n)),a&&(o.images=tt.parse.fromCollada._libImages(a)),s&&(o.materials=tt.parse.fromCollada._libMaterials(s)),l&&(o.effects=tt.parse.fromCollada._libEffects(l)),o},tt.parse.fromCollada._asset=function(e){return{created:e.getElementsByTagName("created")[0].textContent,modified:e.getElementsByTagName("modified")[0].textContent,up_axis:e.getElementsByTagName("up_axis")[0].textContent}},tt.parse.fromCollada._libGeometries=function(e){e=e.getElementsByTagName("geometry");for(var t=[],i=0;i<e.length;i++){var o=e[i],r=tt.parse.fromCollada._getMesh(o.getElementsByTagName("mesh")[0]);t.push(r)}return t},tt.parse.fromCollada._getMesh=function(e){for(var t={},i=e.getElementsByTagName("source"),o=t.sources={},r=0;r<i.length;r++){for(var n=i[r].getElementsByTagName("float_array")[0].textContent.split(" "),a=n.length-(n[n.length-1]==""?1:0),s=Array(a),l=0;l<a;l++)s[l]=parseFloat(n[l]);o[i[r].getAttribute("id")]=s}t.triangles=[];var c=e.getElementsByTagName("triangles");if(c==null)return t;for(var r=0;r<c.length;r++){var d={},u=c[r];d.material=u.getAttribute("material");for(var A=u.getElementsByTagName("input"),h=[],l=0;l<A.length;l++){var p=A[l],s=[];h[parseInt(p.getAttribute("offset"))]=s;var f=p.getAttribute("semantic");d["s_"+f]=f=="VERTEX"?e.getElementsByTagName("vertices")[0].getElementsByTagName("input")[0].getAttribute("source").substring(1):p.getAttribute("source").substring(1),d["i_"+f]=s,o[d["s_"+f]]}for(var m=u.getElementsByTagName("p")[0].textContent.split(" "),g=3*Math.floor(m.length/3),l=0;l<g;l++)h[l%A.length].push(parseInt(m[l]));t.triangles.push(d)}return t},tt.parse.fromCollada._libImages=function(e){e=e.getElementsByTagName("image");for(var t={},i=0;i<e.length;i++)t[e[i].getAttribute("id")]=e[i].getElementsByTagName("init_from")[0].textContent;return t},tt.parse.fromCollada._libMaterials=function(e){e=e.getElementsByTagName("material");for(var t={},i=0;i<e.length;i++)t[e[i].getAttribute("name")]=e[i].getElementsByTagName("instance_effect")[0].getAttribute("url").substring(1);return t},tt.parse.fromCollada._libEffects=function(e){e=e.getElementsByTagName("effect");for(var t={},i=0;i<e.length;i++){for(var o={},r=e[i].getElementsByTagName("newparam"),n=0;n<r.length;n++){var a=r[n].getElementsByTagName("surface")[0];a&&(o.surface=a.getElementsByTagName("init_from")[0].textContent)}t[e[i].getAttribute("id")]=o}return t},tt.parse.from3DS=function(e){e=new Uint8Array(e);var t={};if(tt.bin.rsl(e,0)!=19789)return null;for(var i=tt.bin.ril(e,2),o=6;o<i;){var r=tt.bin.rsl(e,o),n=tt.bin.ril(e,o+2);r==15677&&(t.edit=tt.parse.from3DS._edit3ds(e,o,n)),r==45056&&(t.keyf=tt.parse.from3DS._keyf3ds(e,o,n)),o+=n}return t},tt.parse.from3DS._edit3ds=function(e,t,i){for(var o={},r=t+6;r<t+i;){var n=tt.bin.rsl(e,r),a=tt.bin.ril(e,r+2);n==16384&&(o.objects??=[],o.objects.push(tt.parse.from3DS._edit_object(e,r,a))),r+=a}return o},tt.parse.from3DS._keyf3ds=function(e,t,i){for(var o={},r=t+6;r<t+i;){var n=tt.bin.rsl(e,r),a=tt.bin.ril(e,r+2);n==45058&&(o.desc??=[],o.desc.push(tt.parse.from3DS._keyf_objdes(e,r,a))),r+=a}return o},tt.parse.from3DS._keyf_objdes=function(e,t,i){for(var o={},r=t+6;r<t+i;){var n=tt.bin.rsl(e,r),a=tt.bin.ril(e,r+2);n==45072&&(o.hierarchy=tt.parse.from3DS._keyf_objhierarch(e,r,a)),n==45073&&(o.dummy_name=tt.bin.rASCII0(e,r+6)),r+=a}return o},tt.parse.from3DS._keyf_objhierarch=function(e,t,i){var o={},r=t+6;return o.name=tt.bin.rASCII0(e,r),r+=o.name.length+1,o.hierarchy=tt.bin.rsl(e,r+4),o},tt.parse.from3DS._edit_object=function(e,t,i){var o={},r=t+6;for(o.name=tt.bin.rASCII0(e,r),r+=o.name.length+1;r<t+i;){var n=tt.bin.rsl(e,r),a=tt.bin.ril(e,r+2);n==16640&&(o.mesh=tt.parse.from3DS._obj_trimesh(e,r,a)),r+=a}return o},tt.parse.from3DS._obj_trimesh=function(e,t,i){for(var o={},r=t+6;r<t+i;){var n=tt.bin.rsl(e,r),a=tt.bin.ril(e,r+2);n==16656&&(o.vertices=tt.parse.from3DS._tri_vertexl(e,r,a)),n==16672&&(o.indices=tt.parse.from3DS._tri_facel1(e,r,a)),n==16704&&(o.uvt=tt.parse.from3DS._tri_mappingcoors(e,r,a)),n==16736&&(o.local=tt.parse.from3DS._tri_local(e,r,a)),r+=a}return o},tt.parse.from3DS._tri_vertexl=function(e,t,i){var o=[],r=t+6,n=tt.bin.rsl(e,r);r+=2;for(var a=0;a<n;a++)o.push(tt.bin.rf(e,r)),o.push(tt.bin.rf(e,r+4)),o.push(tt.bin.rf(e,r+8)),r+=12;return o},tt.parse.from3DS._tri_facel1=function(e,t,i){var o=[],r=t+6,n=tt.bin.rsl(e,r);r+=2;for(var a=0;a<n;a++)o.push(tt.bin.rsl(e,r)),o.push(tt.bin.rsl(e,r+2)),o.push(tt.bin.rsl(e,r+4)),r+=8;return o},tt.parse.from3DS._tri_mappingcoors=function(e,t,i){var o=[],r=t+6,n=tt.bin.rsl(e,r);r+=2;for(var a=0;a<n;a++)o.push(tt.bin.rf(e,r)),o.push(1-tt.bin.rf(e,r+4)),r+=8;return o},tt.parse.from3DS._tri_local=function(e,t,i){var o={},r=t+6;return o.X=[tt.bin.rf(e,r),tt.bin.rf(e,r+4),tt.bin.rf(e,r+8)],r+=12,o.Y=[tt.bin.rf(e,r),tt.bin.rf(e,r+4),tt.bin.rf(e,r+8)],r+=12,o.Z=[tt.bin.rf(e,r),tt.bin.rf(e,r+4),tt.bin.rf(e,r+8)],r+=12,o.C=[tt.bin.rf(e,r),tt.bin.rf(e,r+4),tt.bin.rf(e,r+8)],r+=12,o},tt.parse.fromBIV=function(e){e=new Uint8Array(e);var t={},i={};return i.id=tt.bin.ril(e,0),i.verS=tt.bin.ril(e,4),i.texS=tt.bin.ril(e,8),i.indS=tt.bin.ril(e,12),i.verO=tt.bin.ril(e,16),i.verL=tt.bin.ril(e,20),i.texO=tt.bin.ril(e,24),i.texL=tt.bin.ril(e,28),i.indO=tt.bin.ril(e,32),i.indL=tt.bin.ril(e,36),i.verO!=0&&(t.vertices=tt.parse.fromBIV._readFloats(e,i.verO,i.verL)),i.texO!=0&&(t.uvt=tt.parse.fromBIV._readFloats(e,i.texO,i.texL)),i.indO!=0&&(t.indices=tt.parse.fromBIV._readInts(e,i.indO,i.indL,i.indS)),t},tt.parse.toBIV=function(e){for(var t=0,i=0;i<e.indices.length;i++)t=Math.max(t,e.indices[i]);var o=32;t<=65535&&(o=16);var r=40;e.vertices&&(r+=e.vertices.length*4),e.uvt&&(r+=e.uvt.length*4),e.indices&&(r+=e.indices.length*o/8);var n=new Uint8Array(r);tt.bin.wil(n,0,1769365870),tt.bin.wil(n,4,32),tt.bin.wil(n,8,32),tt.bin.wil(n,12,o);var a=40;return e.vertices&&(tt.bin.wil(n,16,a),tt.bin.wil(n,20,4*e.vertices.length),tt.parse.fromBIV._writeFloats(n,a,e.vertices),a+=4*e.vertices.length),e.uvt&&(tt.bin.wil(n,24,a),tt.bin.wil(n,28,4*e.uvt.length),tt.parse.fromBIV._writeFloats(n,a,e.uvt),a+=4*e.uvt.length),e.indices&&(tt.bin.wil(n,32,a),tt.bin.wil(n,36,4*e.indices.length),tt.parse.fromBIV._writeInts(n,a,e.indices,o)),n.buffer},tt.parse.fromBIV._readFloats=function(e,t,i){for(var o=[],r=0;r<i/4;r++)o.push(tt.bin.rf(e,t+4*r));return o},tt.parse.fromBIV._writeFloats=function(e,t,i){for(var o=0;o<i.length;o++)tt.bin.wf(e,t+4*o,i[o])},tt.parse.fromBIV._readInts=function(e,t,i,o){for(var r=[],n=0;n<i/4;n++)o==16&&r.push(tt.bin.rsl(e,t+2*n)),o==32&&r.push(tt.bin.ril(e,t+4*n));return r},tt.parse.fromBIV._writeInts=function(e,t,i,o){for(var r=0;r<i.length;r++)o==16&&tt.bin.wsl(e,t+2*r,i[r]),o==32&&tt.bin.wil(e,t+4*r,i[r])},tt.gen={},tt.gen.Plane=function(e,t,i,o){i||=1,o||=1;for(var r={verts:[],inds:[],uvt:[]},n=e+1,a=t+1,s=0;s<a;s++)for(var l=0;l<n;l++){var c=-1+2/e*l,d=-1+2/t*s;r.verts.push(c,d,0),r.uvt.push(i*l/e,o*s/t),s<t&&l<e&&r.inds.push(s*n+l,s*n+l+1,(s+1)*n+l,s*n+l+1,(s+1)*n+l,(s+1)*n+l+1)}return r},tt.gen.Cube=function(){return{verts:[-1,1,-1,1,1,-1,-1,-1,-1,1,-1,-1,-1,1,1,1,1,1,-1,-1,1,1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,-1,1,1,1,1,1,-1,1,-1,1,1,-1,-1,-1,1,-1,1,1,-1,-1,1,1,1,1,1,-1,-1,-1,1,-1,-1,-1,-1,1,1,-1,1],inds:[0,1,2,1,2,3,4,5,6,5,6,7,8,9,10,9,10,11,12,13,14,13,14,15,16,17,18,17,18,19,20,21,22,21,22,23],uvt:[1/4,1/4,2/4,1/4,1/4,2/4,2/4,2/4,4/4,1/4,3/4,1/4,4/4,2/4,3/4,2/4,0/4,1/4,1/4,1/4,0/4,2/4,1/4,2/4,3/4,1/4,2/4,1/4,3/4,2/4,2/4,2/4,1/4,1/4,2/4,1/4,1/4,0/4,2/4,0/4,1/4,2/4,2/4,2/4,1/4,3/4,2/4,3/4]}},tt.gen.Sphere=function(e,t){var i={verts:[],inds:[],uvt:[]};2*Math.PI/e,Math.PI/t;for(var o=e+1,r=t+1,n=0;n<r;n++)for(var a=0;a<o;a++){var s=-Math.PI/2+n*Math.PI/t,l=a*2*Math.PI/e,c=Math.cos(s)*Math.cos(l),d=Math.sin(s),u=Math.cos(s)*Math.sin(l);i.verts.push(c,d,u),i.uvt.push(a/e,n/t),n<t&&a<e&&i.inds.push(o*n+a,o*n+a+1,o*(n+1)+a,o*n+a+1,o*(n+1)+a,o*(n+1)+a+1)}return i},tt.mat={},tt.mat.scale=function(e,t,i){return[e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1]},tt.mat.translate=function(e,t,i){return[1,0,0,0,0,1,0,0,0,0,1,0,e,t,i,1]},tt.mat.rotateDeg=function(e,t,i){var o=Math.PI/180;return tt.mat.rotate(e*o,t*o,i*o)},tt.mat.rotate=function(e,t,i){var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],r=e,n=t,a=i,s=Math.cos(r),l=Math.cos(n),c=Math.cos(a),d=Math.sin(r),u=Math.sin(n),A=Math.sin(a);return o[0]=l*c,o[1]=-l*A,o[2]=u,o[4]=s*A+d*u*c,o[5]=s*c-d*u*A,o[6]=-d*l,o[8]=d*A-s*u*c,o[9]=d*c+s*u*A,o[10]=s*l,o},tt.edit={},tt.edit.interpolate=function(e,t,i,o){for(var r=0;r<e.length;r++)i[r]=e[r]+o*(t[r]-e[r])},tt.edit.transform=function(e,t){for(var i=0;i<e.length;i+=3){var o=e[i],r=e[i+1],n=e[i+2];e[i+0]=t[0]*o+t[4]*r+t[8]*n+t[12],e[i+1]=t[1]*o+t[5]*r+t[9]*n+t[13],e[i+2]=t[2]*o+t[6]*r+t[10]*n+t[14]}},tt.edit.unwrap=function(e,t,i){for(var o=Array(Math.floor(e.length/3)*i),r=0;r<e.length;r++)for(var n=0;n<i;n++)o[r*i+n]=t[e[r]*i+n];return o},tt.edit.remap=function(e,t,i,o){for(var r=Array(i.length),n=0;n<e.length;n++)for(var a=0;a<o;a++)r[t[n]*o+a]=i[e[n]*o+a];return r},tt.utils={},tt.utils.getAABB=function(e){for(var t=i=o=999999999,i,o,r=n=a=-t,n,a,s=0;s<e.length;s+=3){var l=e[s+0],c=e[s+1],d=e[s+2];l<t&&(t=l),l>r&&(r=l),c<i&&(i=c),c>n&&(n=c),d<o&&(o=d),c>a&&(a=d)}return{min:{x:t,y:i,z:o},max:{x:r,y:n,z:a}}};function $it(e,t={}){return new Promise(function(i,o){t.src||(console.error("load3DSGeometry: Parameter expected: src"),o());var r=e.canvas.spinner;r.processes++,St.loadArraybuffer(t.src,function(n){n.byteLength||(console.error("load3DSGeometry: no data loaded"),r.processes--,o());var a=tt.parse.from3DS(n).edit.objects[0].mesh,s=a.vertices,l=a.uvt,c=a.indices;r.processes--,i(St.apply(t,{primitive:"triangles",positions:s,normals:null,uv:l,indices:c}))},function(n){console.error("load3DSGeometry: "+n),r.processes--,o()})})}function ert(e,t={}){return new Promise(function(i,o){t.src||(console.error("loadOBJGeometry: Parameter expected: src"),o());var r=e.canvas.spinner;r.processes++,St.loadArraybuffer(t.src,function(n){n.byteLength||(console.error("loadOBJGeometry: no data loaded"),r.processes--,o());for(var a=tt.parse.fromOBJ(n),s=tt.edit.unwrap(a.i_verts,a.c_verts,3),l=tt.edit.unwrap(a.i_norms,a.c_norms,3),c=tt.edit.unwrap(a.i_uvt,a.c_uvt,2),d=new Int32Array(a.i_verts.length),u=0;u<a.i_verts.length;u++)d[u]=u;r.processes--,i(St.apply(t,{primitive:"triangles",positions:s,normals:l.length>0?l:null,autoNormals:l.length===0,uv:c,indices:d}))},function(n){console.error("loadOBJGeometry: "+n),r.processes--,o()})})}function GB(e={}){let t=e.xSize||1;t<0&&(console.error("negative xSize not allowed - will invert"),t*=-1);let i=e.ySize||1;i<0&&(console.error("negative ySize not allowed - will invert"),i*=-1);let o=e.zSize||1;o<0&&(console.error("negative zSize not allowed - will invert"),o*=-1);let r=e.center,n=r?r[0]:0,a=r?r[1]:0,s=r?r[2]:0,l=-t+n,c=-i+a,d=-o+s,u=t+n,A=i+a,h=o+s;return St.apply(e,{positions:[u,A,h,l,A,h,l,c,h,u,c,h,u,A,h,u,c,h,u,c,d,u,A,d,u,A,h,u,A,d,l,A,d,l,A,h,l,A,h,l,A,d,l,c,d,l,c,h,l,c,d,u,c,d,u,c,h,l,c,h,u,c,d,l,c,d,l,A,d,u,A,d],normals:[0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1],uv:[1,0,0,0,0,1,1,1,0,0,0,1,1,1,1,0,1,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0],indices:[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]})}function KB(e={}){let t=e.xSize||1;t<0&&(console.error("negative xSize not allowed - will invert"),t*=-1);let i=e.ySize||1;i<0&&(console.error("negative ySize not allowed - will invert"),i*=-1);let o=e.zSize||1;o<0&&(console.error("negative zSize not allowed - will invert"),o*=-1);let r=e.center,n=r?r[0]:0,a=r?r[1]:0,s=r?r[2]:0,l=-t+n,c=-i+a,d=-o+s,u=t+n,A=i+a,h=o+s;return St.apply(e,{primitive:"lines",positions:[l,c,d,l,c,h,l,A,d,l,A,h,u,c,d,u,c,h,u,A,d,u,A,h],indices:[0,1,1,3,3,2,2,0,4,5,5,7,7,6,6,4,0,4,1,5,2,6,3,7]})}function trt(e={}){return KB({id:e.id,center:[(e.aabb[0]+e.aabb[3])/2,(e.aabb[1]+e.aabb[4])/2,(e.aabb[2]+e.aabb[5])/2],xSize:Math.abs(e.aabb[3]-e.aabb[0])/2,ySize:Math.abs(e.aabb[4]-e.aabb[1])/2,zSize:Math.abs(e.aabb[5]-e.aabb[2])/2})}function v1(e={}){let t=e.radiusTop||1;t<0&&(console.error("negative radiusTop not allowed - will invert"),t*=-1);let i=e.radiusBottom||1;i<0&&(console.error("negative radiusBottom not allowed - will invert"),i*=-1);let o=e.height||1;o<0&&(console.error("negative height not allowed - will invert"),o*=-1);let r=e.radialSegments||32;r<0&&(console.error("negative radialSegments not allowed - will invert"),r*=-1),r<3&&(r=3);let n=e.heightSegments||1;n<0&&(console.error("negative heightSegments not allowed - will invert"),n*=-1),n<1&&(n=1);let a=!!e.openEnded,s=e.center,l=s?s[0]:0,c=s?s[1]:0,d=s?s[2]:0,u=o/2,A=o/n,h=2*Math.PI/r,p=1/r,f=(t-i)/n,m=[],g=[],y=[],v=[],C,x,B,E,D,P,M,R,O,V,z,K=(90-Math.atan(o/(i-t))*180/Math.PI)/90;for(C=0;C<=n;C++)for(D=t-C*f,P=u-C*A,x=0;x<=r;x++)B=Math.sin(x*h),E=Math.cos(x*h),g.push(D*B),g.push(K),g.push(D*E),y.push(x*p),y.push(C*1/n),m.push(D*B+l),m.push(P+c),m.push(D*E+d);for(C=0;C<n;C++)for(x=0;x<=r;x++)M=C*(r+1)+x,R=M+r,v.push(M),v.push(R),v.push(R+1),v.push(M),v.push(R+1),v.push(M+1);if(!a&&t>0){for(O=m.length/3,g.push(0),g.push(1),g.push(0),y.push(.5),y.push(.5),m.push(0+l),m.push(u+c),m.push(0+d),x=0;x<=r;x++)B=Math.sin(x*h),E=Math.cos(x*h),V=.5*Math.sin(x*h)+.5,z=.5*Math.cos(x*h)+.5,g.push(t*B),g.push(1),g.push(t*E),y.push(V),y.push(z),m.push(t*B+l),m.push(u+c),m.push(t*E+d);for(x=0;x<r;x++)s=O,M=O+1+x,v.push(M),v.push(M+1),v.push(s)}if(!a&&i>0){for(O=m.length/3,g.push(0),g.push(-1),g.push(0),y.push(.5),y.push(.5),m.push(0+l),m.push(0-u+c),m.push(0+d),x=0;x<=r;x++)B=Math.sin(x*h),E=Math.cos(x*h),V=.5*Math.sin(x*h)+.5,z=.5*Math.cos(x*h)+.5,g.push(i*B),g.push(-1),g.push(i*E),y.push(V),y.push(z),m.push(i*B+l),m.push(0-u+c),m.push(i*E+d);for(x=0;x<r;x++)s=O,M=O+1+x,v.push(s),v.push(M+1),v.push(M)}return St.apply(e,{positions:m,normals:g,uv:y,indices:v})}function iQ(e={}){let t=e.size||1;t<0&&(console.error("negative size not allowed - will invert"),t*=-1);let i=e.divisions||1;i<0&&(console.error("negative divisions not allowed - will invert"),i*=-1),i<1&&(i=1),t||=10,i||=10;let o=t/i,r=t/2,n=[],a=[],s=0;for(let l=0,c=-r;l<=i;l++,c+=o)n.push(-r),n.push(0),n.push(c),n.push(r),n.push(0),n.push(c),n.push(c),n.push(0),n.push(-r),n.push(c),n.push(0),n.push(r),a.push(s++),a.push(s++),a.push(s++),a.push(s++);return St.apply(e,{primitive:"lines",positions:n,indices:a})}function JB(e={}){let t=e.xSize||1;t<0&&(console.error("negative xSize not allowed - will invert"),t*=-1);let i=e.zSize||1;i<0&&(console.error("negative zSize not allowed - will invert"),i*=-1);let o=e.xSegments||1;o<0&&(console.error("negative xSegments not allowed - will invert"),o*=-1),o<1&&(o=1);let r=e.xSegments||1;r<0&&(console.error("negative zSegments not allowed - will invert"),r*=-1),r<1&&(r=1);let n=e.center,a=n?n[0]:0,s=n?n[1]:0,l=n?n[2]:0,c=t/2,d=i/2,u=Math.floor(o)||1,A=Math.floor(r)||1,h=u+1,p=A+1,f=t/u,m=i/A,g=new Float32Array(h*p*3),y=new Float32Array(h*p*3),v=new Float32Array(h*p*2),C=0,x=0,B,E,D,P,M,R,O;for(B=0;B<p;B++){let z=B*m-d;for(E=0;E<h;E++)D=E*f-c,g[C]=D+a,g[C+1]=s,g[C+2]=-z+l,y[C+1]=1,v[x]=E/u,v[x+1]=(A-B)/A,C+=3,x+=2}C=0;let V=new(g.length/3>65535?Uint32Array:Uint16Array)(u*A*6);for(B=0;B<A;B++)for(E=0;E<u;E++)P=E+h*B,M=E+h*(B+1),R=E+1+h*(B+1),O=E+1+h*B,V[C]=O,V[C+1]=M,V[C+2]=P,V[C+3]=O,V[C+4]=R,V[C+5]=M,C+=6;return St.apply(e,{positions:g,normals:y,uv:v,indices:V})}function y1(e={}){let t=e.lod||1,i=e.center?e.center[0]:0,o=e.center?e.center[1]:0,r=e.center?e.center[2]:0,n=e.radius||1;n<0&&(console.error("negative radius not allowed - will invert"),n*=-1);let a=e.heightSegments||18;a<0&&(console.error("negative heightSegments not allowed - will invert"),a*=-1),a=Math.floor(t*a),a<18&&(a=18);let s=e.widthSegments||18;s<0&&(console.error("negative widthSegments not allowed - will invert"),s*=-1),s=Math.floor(t*s),s<18&&(s=18);let l=[],c=[],d=[],u=[],A,h,p,f,m,g,y,v,C,x,B,E,D,P,M;for(A=0;A<=a;A++)for(p=A*Math.PI/a,f=Math.sin(p),m=Math.cos(p),h=0;h<=s;h++)g=h*2*Math.PI/s,y=Math.sin(g),v=Math.cos(g),C=v*f,x=m,B=y*f,E=1-h/s,D=A/a,c.push(C),c.push(x),c.push(B),d.push(E),d.push(D),l.push(i+n*C),l.push(o+n*x),l.push(r+n*B);for(A=0;A<a;A++)for(h=0;h<s;h++)P=A*(s+1)+h,M=P+s+1,u.push(P+1),u.push(M+1),u.push(M),u.push(P+1),u.push(M),u.push(P);return St.apply(e,{positions:l,normals:c,uv:d,indices:u})}function ZB(e={}){let t=e.radius||1;t<0&&(console.error("negative radius not allowed - will invert"),t*=-1),t*=.5;let i=e.tube||.3;i<0&&(console.error("negative tube not allowed - will invert"),i*=-1);let o=e.radialSegments||32;o<0&&(console.error("negative radialSegments not allowed - will invert"),o*=-1),o<4&&(o=4);let r=e.tubeSegments||24;r<0&&(console.error("negative tubeSegments not allowed - will invert"),r*=-1),r<4&&(r=4);let n=e.arc||Math.PI*2;n<0&&(console.warn("negative arc not allowed - will invert"),n*=-1),n>360&&(n=360);let a=e.center,s=a?a[0]:0,l=a?a[1]:0,c=a?a[2]:0,d=[],u=[],A=[],h=[],p,f,m,g,y,v,C,x;for(x=0;x<=r;x++)for(C=0;C<=o;C++)p=C/o*n,f=.785398+x/r*Math.PI*2,s=t*Math.cos(p),l=t*Math.sin(p),m=(t+i*Math.cos(f))*Math.cos(p),g=(t+i*Math.cos(f))*Math.sin(p),y=i*Math.sin(f),d.push(m+s),d.push(g+l),d.push(y+c),A.push(1-C/o),A.push(x/r),v=b.normalizeVec3(b.subVec3([m,g,y],[s,l,c],[]),[]),u.push(v[0]),u.push(v[1]),u.push(v[2]);let B,E,D,P;for(x=1;x<=r;x++)for(C=1;C<=o;C++)B=(o+1)*x+C-1,E=(o+1)*(x-1)+C-1,D=(o+1)*(x-1)+C,P=(o+1)*x+C,h.push(B),h.push(E),h.push(D),h.push(D),h.push(P),h.push(B);return St.apply(e,{positions:d,normals:u,uv:A,indices:h})}var irt={" ":{width:16,points:[]},"!":{width:10,points:[[5,21],[5,7],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]]},'"':{width:16,points:[[4,21],[4,14],[-1,-1],[12,21],[12,14]]},"#":{width:21,points:[[11,25],[4,-7],[-1,-1],[17,25],[10,-7],[-1,-1],[4,12],[18,12],[-1,-1],[3,6],[17,6]]},$:{width:20,points:[[8,25],[8,-4],[-1,-1],[12,25],[12,-4],[-1,-1],[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]]},"%":{width:24,points:[[21,21],[3,0],[-1,-1],[8,21],[10,19],[10,17],[9,15],[7,14],[5,14],[3,16],[3,18],[4,20],[6,21],[8,21],[10,20],[13,19],[16,19],[19,20],[21,21],[-1,-1],[17,7],[15,6],[14,4],[14,2],[16,0],[18,0],[20,1],[21,3],[21,5],[19,7],[17,7]]},"&":{width:26,points:[[23,12],[23,13],[22,14],[21,14],[20,13],[19,11],[17,6],[15,3],[13,1],[11,0],[7,0],[5,1],[4,2],[3,4],[3,6],[4,8],[5,9],[12,13],[13,14],[14,16],[14,18],[13,20],[11,21],[9,20],[8,18],[8,16],[9,13],[11,10],[16,3],[18,1],[20,0],[22,0],[23,1],[23,2]]},"'":{width:10,points:[[5,19],[4,20],[5,21],[6,20],[6,18],[5,16],[4,15]]},"(":{width:14,points:[[11,25],[9,23],[7,20],[5,16],[4,11],[4,7],[5,2],[7,-2],[9,-5],[11,-7]]},")":{width:14,points:[[3,25],[5,23],[7,20],[9,16],[10,11],[10,7],[9,2],[7,-2],[5,-5],[3,-7]]},"*":{width:16,points:[[8,21],[8,9],[-1,-1],[3,18],[13,12],[-1,-1],[13,18],[3,12]]},"+":{width:26,points:[[13,18],[13,0],[-1,-1],[4,9],[22,9]]},",":{width:10,points:[[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]]},"-":{width:26,points:[[4,9],[22,9]]},".":{width:10,points:[[5,2],[4,1],[5,0],[6,1],[5,2]]},"/":{width:22,points:[[20,25],[2,-7]]},0:{width:20,points:[[9,21],[6,20],[4,17],[3,12],[3,9],[4,4],[6,1],[9,0],[11,0],[14,1],[16,4],[17,9],[17,12],[16,17],[14,20],[11,21],[9,21]]},1:{width:20,points:[[6,17],[8,18],[11,21],[11,0]]},2:{width:20,points:[[4,16],[4,17],[5,19],[6,20],[8,21],[12,21],[14,20],[15,19],[16,17],[16,15],[15,13],[13,10],[3,0],[17,0]]},3:{width:20,points:[[5,21],[16,21],[10,13],[13,13],[15,12],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]]},4:{width:20,points:[[13,21],[3,7],[18,7],[-1,-1],[13,21],[13,0]]},5:{width:20,points:[[15,21],[5,21],[4,12],[5,13],[8,14],[11,14],[14,13],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]]},6:{width:20,points:[[16,18],[15,20],[12,21],[10,21],[7,20],[5,17],[4,12],[4,7],[5,3],[7,1],[10,0],[11,0],[14,1],[16,3],[17,6],[17,7],[16,10],[14,12],[11,13],[10,13],[7,12],[5,10],[4,7]]},7:{width:20,points:[[17,21],[7,0],[-1,-1],[3,21],[17,21]]},8:{width:20,points:[[8,21],[5,20],[4,18],[4,16],[5,14],[7,13],[11,12],[14,11],[16,9],[17,7],[17,4],[16,2],[15,1],[12,0],[8,0],[5,1],[4,2],[3,4],[3,7],[4,9],[6,11],[9,12],[13,13],[15,14],[16,16],[16,18],[15,20],[12,21],[8,21]]},9:{width:20,points:[[16,14],[15,11],[13,9],[10,8],[9,8],[6,9],[4,11],[3,14],[3,15],[4,18],[6,20],[9,21],[10,21],[13,20],[15,18],[16,14],[16,9],[15,4],[13,1],[10,0],[8,0],[5,1],[4,3]]},":":{width:10,points:[[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]]},";":{width:10,points:[[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]]},"<":{width:24,points:[[20,18],[4,9],[20,0]]},"=":{width:26,points:[[4,12],[22,12],[-1,-1],[4,6],[22,6]]},">":{width:24,points:[[4,18],[20,9],[4,0]]},"?":{width:18,points:[[3,16],[3,17],[4,19],[5,20],[7,21],[11,21],[13,20],[14,19],[15,17],[15,15],[14,13],[13,12],[9,10],[9,7],[-1,-1],[9,2],[8,1],[9,0],[10,1],[9,2]]},"@":{width:27,points:[[18,13],[17,15],[15,16],[12,16],[10,15],[9,14],[8,11],[8,8],[9,6],[11,5],[14,5],[16,6],[17,8],[-1,-1],[12,16],[10,14],[9,11],[9,8],[10,6],[11,5],[-1,-1],[18,16],[17,8],[17,6],[19,5],[21,5],[23,7],[24,10],[24,12],[23,15],[22,17],[20,19],[18,20],[15,21],[12,21],[9,20],[7,19],[5,17],[4,15],[3,12],[3,9],[4,6],[5,4],[7,2],[9,1],[12,0],[15,0],[18,1],[20,2],[21,3],[-1,-1],[19,16],[18,8],[18,6],[19,5]]},A:{width:18,points:[[9,21],[1,0],[-1,-1],[9,21],[17,0],[-1,-1],[4,7],[14,7]]},B:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[-1,-1],[4,11],[13,11],[16,10],[17,9],[18,7],[18,4],[17,2],[16,1],[13,0],[4,0]]},C:{width:21,points:[[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5]]},D:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[11,21],[14,20],[16,18],[17,16],[18,13],[18,8],[17,5],[16,3],[14,1],[11,0],[4,0]]},E:{width:19,points:[[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11],[-1,-1],[4,0],[17,0]]},F:{width:18,points:[[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11]]},G:{width:21,points:[[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[18,8],[-1,-1],[13,8],[18,8]]},H:{width:22,points:[[4,21],[4,0],[-1,-1],[18,21],[18,0],[-1,-1],[4,11],[18,11]]},I:{width:8,points:[[4,21],[4,0]]},J:{width:16,points:[[12,21],[12,5],[11,2],[10,1],[8,0],[6,0],[4,1],[3,2],[2,5],[2,7]]},K:{width:21,points:[[4,21],[4,0],[-1,-1],[18,21],[4,7],[-1,-1],[9,12],[18,0]]},L:{width:17,points:[[4,21],[4,0],[-1,-1],[4,0],[16,0]]},M:{width:24,points:[[4,21],[4,0],[-1,-1],[4,21],[12,0],[-1,-1],[20,21],[12,0],[-1,-1],[20,21],[20,0]]},N:{width:22,points:[[4,21],[4,0],[-1,-1],[4,21],[18,0],[-1,-1],[18,21],[18,0]]},O:{width:22,points:[[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21]]},P:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,14],[17,12],[16,11],[13,10],[4,10]]},Q:{width:22,points:[[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21],[-1,-1],[12,4],[18,-2]]},R:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[4,11],[-1,-1],[11,11],[18,0]]},S:{width:20,points:[[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]]},T:{width:16,points:[[8,21],[8,0],[-1,-1],[1,21],[15,21]]},U:{width:22,points:[[4,21],[4,6],[5,3],[7,1],[10,0],[12,0],[15,1],[17,3],[18,6],[18,21]]},V:{width:18,points:[[1,21],[9,0],[-1,-1],[17,21],[9,0]]},W:{width:24,points:[[2,21],[7,0],[-1,-1],[12,21],[7,0],[-1,-1],[12,21],[17,0],[-1,-1],[22,21],[17,0]]},X:{width:20,points:[[3,21],[17,0],[-1,-1],[17,21],[3,0]]},Y:{width:18,points:[[1,21],[9,11],[9,0],[-1,-1],[17,21],[9,11]]},Z:{width:20,points:[[17,21],[3,0],[-1,-1],[3,21],[17,21],[-1,-1],[3,0],[17,0]]},"[":{width:14,points:[[4,25],[4,-7],[-1,-1],[5,25],[5,-7],[-1,-1],[4,25],[11,25],[-1,-1],[4,-7],[11,-7]]},"\\":{width:14,points:[[0,21],[14,-3]]},"]":{width:14,points:[[9,25],[9,-7],[-1,-1],[10,25],[10,-7],[-1,-1],[3,25],[10,25],[-1,-1],[3,-7],[10,-7]]},"^":{width:16,points:[[6,15],[8,18],[10,15],[-1,-1],[3,12],[8,17],[13,12],[-1,-1],[8,17],[8,0]]},_:{width:16,points:[[0,-2],[16,-2]]},"`":{width:10,points:[[6,21],[5,20],[4,18],[4,16],[5,15],[6,16],[5,17]]},a:{width:19,points:[[15,14],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},b:{width:19,points:[[4,21],[4,0],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]]},c:{width:18,points:[[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},d:{width:19,points:[[15,21],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},e:{width:18,points:[[3,8],[15,8],[15,10],[14,12],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},f:{width:12,points:[[10,21],[8,21],[6,20],[5,17],[5,0],[-1,-1],[2,14],[9,14]]},g:{width:19,points:[[15,14],[15,-2],[14,-5],[13,-6],[11,-7],[8,-7],[6,-6],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},h:{width:19,points:[[4,21],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]]},i:{width:8,points:[[3,21],[4,20],[5,21],[4,22],[3,21],[-1,-1],[4,14],[4,0]]},j:{width:10,points:[[5,21],[6,20],[7,21],[6,22],[5,21],[-1,-1],[6,14],[6,-3],[5,-6],[3,-7],[1,-7]]},k:{width:17,points:[[4,21],[4,0],[-1,-1],[14,14],[4,4],[-1,-1],[8,8],[15,0]]},l:{width:8,points:[[4,21],[4,0]]},m:{width:30,points:[[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0],[-1,-1],[15,10],[18,13],[20,14],[23,14],[25,13],[26,10],[26,0]]},n:{width:19,points:[[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]]},o:{width:19,points:[[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3],[16,6],[16,8],[15,11],[13,13],[11,14],[8,14]]},p:{width:19,points:[[4,14],[4,-7],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]]},q:{width:19,points:[[15,14],[15,-7],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},r:{width:13,points:[[4,14],[4,0],[-1,-1],[4,8],[5,11],[7,13],[9,14],[12,14]]},s:{width:17,points:[[14,11],[13,13],[10,14],[7,14],[4,13],[3,11],[4,9],[6,8],[11,7],[13,6],[14,4],[14,3],[13,1],[10,0],[7,0],[4,1],[3,3]]},t:{width:12,points:[[5,21],[5,4],[6,1],[8,0],[10,0],[-1,-1],[2,14],[9,14]]},u:{width:19,points:[[4,14],[4,4],[5,1],[7,0],[10,0],[12,1],[15,4],[-1,-1],[15,14],[15,0]]},v:{width:16,points:[[2,14],[8,0],[-1,-1],[14,14],[8,0]]},w:{width:22,points:[[3,14],[7,0],[-1,-1],[11,14],[7,0],[-1,-1],[11,14],[15,0],[-1,-1],[19,14],[15,0]]},x:{width:17,points:[[3,14],[14,0],[-1,-1],[14,14],[3,0]]},y:{width:16,points:[[2,14],[8,0],[-1,-1],[14,14],[8,0],[6,-4],[4,-6],[2,-7],[1,-7]]},z:{width:17,points:[[14,14],[3,0],[-1,-1],[3,14],[14,14],[-1,-1],[3,0],[14,0]]},"{":{width:14,points:[[9,25],[7,24],[6,23],[5,21],[5,19],[6,17],[7,16],[8,14],[8,12],[6,10],[-1,-1],[7,24],[6,22],[6,20],[7,18],[8,17],[9,15],[9,13],[8,11],[4,9],[8,7],[9,5],[9,3],[8,1],[7,0],[6,-2],[6,-4],[7,-6],[-1,-1],[6,8],[8,6],[8,4],[7,2],[6,1],[5,-1],[5,-3],[6,-5],[7,-6],[9,-7]]},"|":{width:8,points:[[4,25],[4,-7]]},"}":{width:14,points:[[5,25],[7,24],[8,23],[9,21],[9,19],[8,17],[7,16],[6,14],[6,12],[8,10],[-1,-1],[7,24],[8,22],[8,20],[7,18],[6,17],[5,15],[5,13],[6,11],[10,9],[6,7],[5,5],[5,3],[6,1],[7,0],[8,-2],[8,-4],[7,-6],[-1,-1],[8,8],[6,6],[6,4],[7,2],[8,1],[9,-1],[9,-3],[8,-5],[7,-6],[5,-7]]},"~":{width:24,points:[[3,6],[3,8],[4,11],[6,12],[8,12],[10,11],[14,8],[16,7],[18,7],[20,8],[21,10],[-1,-1],[3,8],[4,10],[6,11],[8,11],[10,10],[14,7],[16,6],[18,6],[20,7],[21,10],[21,12]]}};function w1(e={}){var t=e.origin||[0,0,0],i=t[0],o=t[1],r=t[2],n=e.size||1,a=[],s=[],l=e.text;St.isNumeric(l)&&(l=""+l);for(var c=(l||"").split(`
1068
1068
  `),d=0,u=0,A,h,p,f,m=1/25,g,y,v,C,x,B=0;B<c.length;B++){A=0,h=c[B],p=h.length;for(var E=0;E<p;E++)if(f=irt[h.charAt(E)],f){g=1,y=-1,v=-1,C=f.points.length;for(var D=0;D<C;D++){if(x=f.points[D],x[0]===-1&&x[1]===-1){g=1;continue}a.push(A+x[0]*n*m+i),a.push(u+x[1]*n*m+o),a.push(0+r),y===-1?y=d:(v===-1||(y=v),v=d),d++,g?g=!1:(s.push(y),s.push(v))}A+=f.width*m*n}u-=35*m*n}return St.apply(e,{primitive:"lines",positions:a,indices:s})}function rQ(e={}){if(e.points.length%3!=0)throw"Size of points array for given polyline should be divisible by 3";let t=e.points.length/3;if(t<2)throw"There should be at least 2 points to create a polyline";let i=[];for(let o=0;o<t-1;o++)i.push(o),i.push(o+1);return St.apply(e,{primitive:"lines",positions:e.points,indices:i})}function rrt(e={}){let t=e.curve.getPoints(e.divisions).map(i=>[...i]).flat();return rQ({id:e.id,points:t})}function oQ(e={}){if(e.startPoint.length!==3)throw"Start point should contain 3 elements in array: x, y and z";if(e.endPoint.length!==3)throw"End point should contain 3 elements in array: x, y and z";let t=[],i=[],o=e.startPoint[0],r=e.startPoint[1],n=e.startPoint[2],a=e.endPoint[0],s=e.endPoint[1],l=e.endPoint[2],c=Math.sqrt((a-o)**2+(s-r)**2+(l-n)**2),d=[(a-o)/c,(s-r)/c,(l-n)/c];if(!e.pattern)t.push(0),t.push(1),i.push(o,r,n,a,s,l);else{let u=e.pattern.length,A=!1,h=0,p=0,f=0,m=[o,r,n],g=e.pattern[p];for(i.push(m[0],m[1],m[2]);g<=c-h;){let y=[d[0]*g,d[1]*g,d[2]*g],v=[m[0]+y[0],m[1]+y[1],m[2]+y[2]];i.push(v[0],v[1],v[2]),A||(t.push(f),t.push(f+1)),A=!A,f+=1,m=v,p+=1,p>=u&&(p=0),h+=g,g=e.pattern[p]}e.extendToEnd&&(i.push(a,s,l),t.push(t.length-2),t.push(t.length-1))}return St.apply(e,{primitive:"lines",positions:i,indices:t})}var $l=b.vec4(4),Hg=b.vec4(),nQ=b.vec4(),aQ=b.vec3([1,0,0]),sQ=b.vec3([0,1,0]),lQ=b.vec3([0,0,1]),cQ=b.vec3(3),dQ=b.vec3(3),ort=b.identityMat4(),Vg=class extends Ri{constructor(e,t={}){if(super(e,t),this._parentNode=null,this._children=[],this._aabb=null,this._aabbDirty=!0,this.scene._aabbDirty=!0,this._numTriangles=0,this._scale=b.vec3(),this._quaternion=b.identityQuaternion(),this._rotation=b.vec3(),this._position=b.vec3(),this._offset=b.vec3(),this._localMatrix=b.identityMat4(),this._worldMatrix=b.identityMat4(),this._localMatrixDirty=!0,this._worldMatrixDirty=!0,t.matrix?this.matrix=t.matrix:(this.scale=t.scale,this.position=t.position,t.quaternion||(this.rotation=t.rotation)),this._isModel=t.isModel,this._isModel&&this.scene._registerModel(this),this._isObject=t.isObject,this._isObject&&this.scene._registerObject(this),this.origin=t.origin,this.visible=t.visible,this.culled=t.culled,this.pickable=t.pickable,this.clippable=t.clippable,this.collidable=t.collidable,this.castsShadow=t.castsShadow,this.receivesShadow=t.receivesShadow,this.xrayed=t.xrayed,this.highlighted=t.highlighted,this.selected=t.selected,this.edges=t.edges,this.colorize=t.colorize,this.opacity=t.opacity,this.offset=t.offset,t.children){let i=t.children;for(let o=0,r=i.length;o<r;o++)this.addChild(i[o],t.inheritStates)}if(t.parentId){let i=this.scene.components[t.parentId];i?i.isNode?i.addChild(this):this.error("Parent is not a Node: '"+t.parentId+"'"):this.error("Parent not found: '"+t.parentId+"'")}else t.parent&&(t.parent.isNode||this.error("Parent is not a Node"),t.parent.addChild(this))}get isEntity(){return!0}get isModel(){return this._isModel}get isObject(){return this._isObject}get aabb(){return this._aabbDirty&&this._updateAABB(),this._aabb}set origin(e){e?(this._origin||=b.vec3(),this._origin.set(e)):this._origin&&=null;for(let t=0,i=this._children.length;t<i;t++)this._children[t].origin=e;this.glRedraw()}get origin(){return this._origin}set rtcCenter(e){this.origin=e}get rtcCenter(){return this.origin}get numTriangles(){return this._numTriangles}set visible(e){e=e!==!1,this._visible=e;for(let t=0,i=this._children.length;t<i;t++)this._children[t].visible=e;this._isObject&&this.scene._objectVisibilityUpdated(this,e)}get visible(){return this._visible}set xrayed(e){e=!!e,this._xrayed=e;for(let t=0,i=this._children.length;t<i;t++)this._children[t].xrayed=e;this._isObject&&this.scene._objectXRayedUpdated(this,e)}get xrayed(){return this._xrayed}set highlighted(e){e=!!e,this._highlighted=e;for(let t=0,i=this._children.length;t<i;t++)this._children[t].highlighted=e;this._isObject&&this.scene._objectHighlightedUpdated(this,e)}get highlighted(){return this._highlighted}set selected(e){e=!!e,this._selected=e;for(let t=0,i=this._children.length;t<i;t++)this._children[t].selected=e;this._isObject&&this.scene._objectSelectedUpdated(this,e)}get selected(){return this._selected}set edges(e){e=!!e,this._edges=e;for(let t=0,i=this._children.length;t<i;t++)this._children[t].edges=e}get edges(){return this._edges}set culled(e){e=!!e,this._culled=e;for(let t=0,i=this._children.length;t<i;t++)this._children[t].culled=e}get culled(){return this._culled}set clippable(e){e=e!==!1,this._clippable=e;for(let t=0,i=this._children.length;t<i;t++)this._children[t].clippable=e}get clippable(){return this._clippable}set collidable(e){e=e!==!1,this._collidable=e;for(let t=0,i=this._children.length;t<i;t++)this._children[t].collidable=e}get collidable(){return this._collidable}set pickable(e){e=e!==!1,this._pickable=e;for(let t=0,i=this._children.length;t<i;t++)this._children[t].pickable=e}get pickable(){return this._pickable}set colorize(e){let t=this._colorize;t||(t=this._colorize=new Float32Array(4),t[3]=1),e?(t[0]=e[0],t[1]=e[1],t[2]=e[2]):(t[0]=1,t[1]=1,t[2]=1);for(let i=0,o=this._children.length;i<o;i++)this._children[i].colorize=t;if(this._isObject){let i=!!e;this.scene._objectColorizeUpdated(this,i)}}get colorize(){return this._colorize.slice(0,3)}set opacity(e){let t=this._colorize;t||(t=this._colorize=new Float32Array(4),t[0]=1,t[1]=1,t[2]=1),t[3]=e??1;for(let i=0,o=this._children.length;i<o;i++)this._children[i].opacity=e;if(this._isObject){let i=e!=null;this.scene._objectOpacityUpdated(this,i)}}get opacity(){return this._colorize[3]}set castsShadow(e){e=!!e,this._castsShadow=e;for(let t=0,i=this._children.length;t<i;t++)this._children[t].castsShadow=e}get castsShadow(){return this._castsShadow}set receivesShadow(e){e=!!e,this._receivesShadow=e;for(let t=0,i=this._children.length;t<i;t++)this._children[t].receivesShadow=e}get receivesShadow(){return this._receivesShadow}get saoEnabled(){return!1}set offset(e){e?(this._offset[0]=e[0],this._offset[1]=e[1],this._offset[2]=e[2]):(this._offset[0]=0,this._offset[1]=0,this._offset[2]=0);for(let t=0,i=this._children.length;t<i;t++)this._children[t].offset=this._offset;this._isObject&&this.scene._objectOffsetUpdated(this,e)}get offset(){return this._offset}get isNode(){return!0}_setLocalMatrixDirty(){this._localMatrixDirty=!0,this._setWorldMatrixDirty()}_setWorldMatrixDirty(){this._worldMatrixDirty=!0;for(let e=0,t=this._children.length;e<t;e++)this._children[e]._setWorldMatrixDirty()}_buildWorldMatrix(){let e=this.matrix;if(this._parentNode)b.mulMat4(this._parentNode.worldMatrix,e,this._worldMatrix);else for(let t=0,i=e.length;t<i;t++)this._worldMatrix[t]=e[t];this._worldMatrixDirty=!1}_setSubtreeAABBsDirty(e){if(e._aabbDirty=!0,e._children)for(let t=0,i=e._children.length;t<i;t++)this._setSubtreeAABBsDirty(e._children[t])}_setAABBDirty(){if(this._setSubtreeAABBsDirty(this),this.collidable)for(let e=this;e;e=e._parentNode)e._aabbDirty=!0}_updateAABB(){if(this.scene._aabbDirty=!0,this._aabb||=b.AABB3(),this._buildAABB)this._buildAABB(this.worldMatrix,this._aabb);else{b.collapseAABB3(this._aabb);let e;for(let t=0,i=this._children.length;t<i;t++)e=this._children[t],e.collidable&&b.expandAABB3(this._aabb,e.aabb)}this._aabbDirty=!1}addChild(e,t){if(St.isNumeric(e)||St.isString(e)){let i=e;if(e=this.scene.component[i],!e){this.warn("Component not found: "+St.inQuotes(i));return}if(!e.isNode&&!e.isMesh){this.error("Not a Node or Mesh: "+i);return}}else{if(!e.isNode&&!e.isMesh){this.error("Not a Node or Mesh: "+e.id);return}if(e._parentNode){if(e._parentNode.id===this.id){this.warn("Already a child: "+e.id);return}e._parentNode.removeChild(e)}}if(e.id,e.scene.id!==this.scene.id){this.error("Child not in same Scene: "+e.id);return}return this._children.push(e),e._parentNode=this,t&&(e.visible=this.visible,e.culled=this.culled,e.xrayed=this.xrayed,e.highlited=this.highlighted,e.selected=this.selected,e.edges=this.edges,e.clippable=this.clippable,e.pickable=this.pickable,e.collidable=this.collidable,e.castsShadow=this.castsShadow,e.receivesShadow=this.receivesShadow,e.colorize=this.colorize,e.opacity=this.opacity,e.offset=this.offset),e._setWorldMatrixDirty(),e._setAABBDirty(),this._numTriangles+=e.numTriangles,e}removeChild(e){for(let t=0,i=this._children.length;t<i;t++)if(this._children[t].id===e.id){e._parentNode=null,this._children=this._children.splice(t,1),e._setWorldMatrixDirty(),e._setAABBDirty(),this._setAABBDirty(),this._numTriangles-=e.numTriangles;return}}removeChildren(){let e;for(let t=0,i=this._children.length;t<i;t++)e=this._children[t],e._parentNode=null,e._setWorldMatrixDirty(),e._setAABBDirty(),this._numTriangles-=e.numTriangles;this._children=[],this._setAABBDirty()}get numChildren(){return this._children.length}get children(){return this._children}set parent(e){if(St.isNumeric(e)||St.isString(e)){let t=e;if(e=this.scene.components[t],!e){this.warn("Node not found: "+St.inQuotes(t));return}if(!e.isNode){this.error("Not a Node: "+e.id);return}}if(e.scene.id!==this.scene.id){this.error("Node not in same Scene: "+e.id);return}if(this._parentNode&&this._parentNode.id===e.id){this.warn("Already a child of Node: "+e.id);return}e.addChild(this)}get parent(){return this._parentNode}set position(e){this._position.set(e||[0,0,0]),this._setLocalMatrixDirty(),this._setAABBDirty(),this.glRedraw()}get position(){return this._position}set rotation(e){this._rotation.set(e||[0,0,0]),b.eulerToQuaternion(this._rotation,"XYZ",this._quaternion),this._setLocalMatrixDirty(),this._setAABBDirty(),this.glRedraw()}get rotation(){return this._rotation}set quaternion(e){this._quaternion.set(e||[0,0,0,1]),b.quaternionToEuler(this._quaternion,"XYZ",this._rotation),this._setLocalMatrixDirty(),this._setAABBDirty(),this.glRedraw()}get quaternion(){return this._quaternion}set scale(e){this._scale.set(e||[1,1,1]),this._setLocalMatrixDirty(),this._setAABBDirty(),this.glRedraw()}get scale(){return this._scale}set matrix(e){this._localMatrix||=b.identityMat4(),this._localMatrix.set(e||ort),b.decomposeMat4(this._localMatrix,this._position,this._quaternion,this._scale),this._localMatrixDirty=!1,this._setWorldMatrixDirty(),this._setAABBDirty(),this.glRedraw()}get matrix(){return this._localMatrixDirty&&=(this._localMatrix||=b.identityMat4(),b.composeMat4(this._position,this._quaternion,this._scale,this._localMatrix),!1),this._localMatrix}get worldMatrix(){return this._worldMatrixDirty&&this._buildWorldMatrix(),this._worldMatrix}rotate(e,t){return $l[0]=e[0],$l[1]=e[1],$l[2]=e[2],$l[3]=t*b.DEGTORAD,b.angleAxisToQuaternion($l,Hg),b.mulQuaternions(this.quaternion,Hg,nQ),this.quaternion=nQ,this._setLocalMatrixDirty(),this._setAABBDirty(),this.glRedraw(),this}rotateOnWorldAxis(e,t){return $l[0]=e[0],$l[1]=e[1],$l[2]=e[2],$l[3]=t*b.DEGTORAD,b.angleAxisToQuaternion($l,Hg),b.mulQuaternions(Hg,this.quaternion,Hg),this}rotateX(e){return this.rotate(aQ,e)}rotateY(e){return this.rotate(sQ,e)}rotateZ(e){return this.rotate(lQ,e)}translate(e,t){return b.vec3ApplyQuaternion(this.quaternion,e,cQ),b.mulVec3Scalar(cQ,t,dQ),b.addVec3(this.position,dQ,this.position),this._setLocalMatrixDirty(),this._setAABBDirty(),this.glRedraw(),this}translateX(e){return this.translate(aQ,e)}translateY(e){return this.translate(sQ,e)}translateZ(e){return this.translate(lQ,e)}get type(){return"Node"}destroy(){if(super.destroy(),this._parentNode&&this._parentNode.removeChild(this),this._isObject&&(this.scene._deregisterObject(this),this._visible&&this.scene._objectVisibilityUpdated(this,!1,!1),this._xrayed&&this.scene._objectXRayedUpdated(this,!1,!1),this._selected&&this.scene._objectSelectedUpdated(this,!1,!1),this._highlighted&&this.scene._objectHighlightedUpdated(this,!1,!1),this.scene._objectColorizeUpdated(this,!1),this.scene._objectOpacityUpdated(this,!1),this.offset.some(e=>e!==0)&&this.scene._objectOffsetUpdated(this,!1)),this._isModel&&this.scene._deregisterModel(this),this._children.length){let e=this._children.splice(0),t;for(let i=0,o=e.length;i<o;i++)t=e[i],t.destroy()}this._children=[],this._setAABBDirty(),this.scene._aabbDirty=!0}},uQ=b.vec3(),$5=b.vec4(),wr=(function(){let e=new Float64Array(16),t=new Float64Array(4),i=new Float64Array(4);return function(o,r,n){return n||=e,t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=1,b.transformVec4(o,t,i),b.setMat4Translation(o,i,n),n.slice()}})();function lh(e,t,i){let o=Float32Array.from([e[0]])[0],r=e[0]-o,n=Float32Array.from([e[1]])[0],a=e[1]-n,s=Float32Array.from([e[2]])[0],l=e[2]-s;t[0]=o,t[1]=n,t[2]=s,i[0]=r,i[1]=a,i[2]=l}function ey(e,t,i,o=1e3){let r=b.getPositionsCenter(e,uQ),n=Math.round(r[0]/o)*o,a=Math.round(r[1]/o)*o,s=Math.round(r[2]/o)*o;i[0]=n,i[1]=a,i[2]=s;let l=i[0]!==0||i[1]!==0||i[2]!==0;if(l)for(let c=0,d=e.length;c<d;c+=3)t[c+0]=e[c+0]-n,t[c+1]=e[c+1]-a,t[c+2]=e[c+2]-s;return l}function nrt(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i}function Do(e,t,i,o,r){let n=r?($5.set(i,0),$5[3]=1,b.mulMat4v4(r,$5,$5)):i,a=b.dotVec3(t,n)+e,s=b.normalizeVec3(t,uQ);return b.mulVec3Scalar(s,-a,o),o}var Ds=1e3,ec=1001,ty=1002,WB=1003,AQ=1004,art=1004,srt=1005,YB=1005,ad=1006,lrt=1007,hQ=1007,jg=1008,XB=1008,crt=1009,drt=1010,urt=1011,Art=1012,hrt=1013,prt=1014,frt=1015,grt=1016,mrt=1017,vrt=1018,yrt=1020,wrt=1021,brt=1022,pQ=1023,Crt=1024,xrt=1025,Brt=1026,krt=1027,Ert=1028,Mrt=1029,Prt=1030,Irt=1031,Srt=1033,fQ=33776,Drt=33777,Trt=33778,gQ=33779,mQ=35840,Lrt=35841,vQ=35842,Rrt=35843,yQ=36196,wQ=37492,bQ=37496,CQ=37808,_rt=37809,Frt=37810,Urt=37811,Ort=37812,Nrt=37813,Hrt=37814,Vrt=37815,jrt=37816,Qrt=37817,zrt=37818,qrt=37819,Grt=37820,Krt=37821,xQ=36492,ch=3e3,Qg=3001,Jrt=1e4,Zrt=10001,Wrt=10002,Yrt=10003,Xrt=function(e){e._material._state.type==="LambertMaterial"?(this.vertex=eot(e),this.fragment=tot(e)):(this.vertex=iot(e),this.fragment=rot(e))},ku={};ku[ch]="linearToLinear",ku[Qg]="sRGBToLinear";function BQ(e){if(!e.receivesShadow)return!1;let t=e.scene._lightsState.lights;if(!t||t.length===0)return!1;for(let i=0,o=t.length;i<o;i++)if(t[i].castsShadow)return!0;return!1}function $rt(e){if(!e._geometry._state.uvBuf)return!1;let t=e._material;return!!(t._ambientMap||t._occlusionMap||t._baseColorMap||t._diffuseMap||t._alphaMap||t._specularMap||t._glossinessMap||t._specularGlossinessMap||t._emissiveMap||t._metallicMap||t._roughnessMap||t._metallicRoughnessMap||t._reflectivityMap||t._normalMap)}function kQ(e){let t=e._geometry._state.primitiveName;return!!((e._geometry._state.autoVertexNormals||e._geometry._state.normalsBuf)&&(t==="triangles"||t==="triangle-strip"||t==="triangle-fan"))}function eot(e){let t=e.scene,i=e.scene._sectionPlanesState,o=e.scene._lightsState,r=e._geometry._state,n=e._state.billboard,a=e._state.stationary,s=i.getNumAllocatedSectionPlanes()>0,l=!!r.compressGeometry,c=[];if(c.push("#version 300 es"),c.push("// Lambertian drawing vertex shader"),c.push("in vec3 position;"),c.push("uniform mat4 modelMatrix;"),c.push("uniform mat4 viewMatrix;"),c.push("uniform mat4 projMatrix;"),c.push("uniform vec4 colorize;"),c.push("uniform vec3 offset;"),c.push("uniform vec3 scale;"),l&&c.push("uniform mat4 positionsDecodeMatrix;"),t.logarithmicDepthBufferEnabled&&(c.push("uniform float logDepthBufFC;"),c.push("out float vFragDepth;"),c.push("bool isPerspectiveMatrix(mat4 m) {"),c.push(" return (m[2][3] == - 1.0);"),c.push("}"),c.push("out float isPerspective;")),s&&c.push("out vec4 vWorldPosition;"),c.push("uniform vec4 lightAmbient;"),c.push("uniform vec4 materialColor;"),c.push("uniform vec3 materialEmissive;"),r.normalsBuf){c.push("in vec3 normal;"),c.push("uniform mat4 modelNormalMatrix;"),c.push("uniform mat4 viewNormalMatrix;");for(let d=0,u=o.lights.length;d<u;d++){let A=o.lights[d];A.type!=="ambient"&&(c.push("uniform vec4 lightColor"+d+";"),A.type==="dir"&&c.push("uniform vec3 lightDir"+d+";"),A.type==="point"&&c.push("uniform vec3 lightPos"+d+";"),A.type==="spot"&&(c.push("uniform vec3 lightPos"+d+";"),c.push("uniform vec3 lightDir"+d+";")))}l&&(c.push("vec3 octDecode(vec2 oct) {"),c.push(" vec3 v = vec3(oct.xy, 1.0 - abs(oct.x) - abs(oct.y));"),c.push(" if (v.z < 0.0) {"),c.push(" v.xy = (1.0 - abs(v.yx)) * vec2(v.x >= 0.0 ? 1.0 : -1.0, v.y >= 0.0 ? 1.0 : -1.0);"),c.push(" }"),c.push(" return normalize(v);"),c.push("}"))}if(c.push("out vec4 vColor;"),r.primitiveName==="points"&&c.push("uniform float pointSize;"),(n==="spherical"||n==="cylindrical")&&(c.push("void billboard(inout mat4 mat) {"),c.push(" mat[0][0] = scale[0];"),c.push(" mat[0][1] = 0.0;"),c.push(" mat[0][2] = 0.0;"),n==="spherical"&&(c.push(" mat[1][0] = 0.0;"),c.push(" mat[1][1] = scale[1];"),c.push(" mat[1][2] = 0.0;")),c.push(" mat[2][0] = 0.0;"),c.push(" mat[2][1] = 0.0;"),c.push(" mat[2][2] =1.0;"),c.push("}")),c.push("void main(void) {"),c.push("vec4 localPosition = vec4(position, 1.0); "),c.push("vec4 worldPosition;"),l&&c.push("localPosition = positionsDecodeMatrix * localPosition;"),r.normalsBuf&&(l?c.push("vec4 localNormal = vec4(octDecode(normal.xy), 0.0); "):c.push("vec4 localNormal = vec4(normal, 0.0); "),c.push("mat4 modelNormalMatrix2 = modelNormalMatrix;"),c.push("mat4 viewNormalMatrix2 = viewNormalMatrix;")),c.push("mat4 viewMatrix2 = viewMatrix;"),c.push("mat4 modelMatrix2 = modelMatrix;"),a&&c.push("viewMatrix2[3][0] = viewMatrix2[3][1] = viewMatrix2[3][2] = 0.0;"),n==="spherical"||n==="cylindrical"?(c.push("mat4 modelViewMatrix = viewMatrix2 * modelMatrix2;"),c.push("billboard(modelMatrix2);"),c.push("billboard(viewMatrix2);"),c.push("billboard(modelViewMatrix);"),r.normalsBuf&&(c.push("mat4 modelViewNormalMatrix = viewNormalMatrix2 * modelNormalMatrix2;"),c.push("billboard(modelNormalMatrix2);"),c.push("billboard(viewNormalMatrix2);"),c.push("billboard(modelViewNormalMatrix);")),c.push("worldPosition = modelMatrix2 * localPosition;"),c.push("worldPosition.xyz = worldPosition.xyz + offset;"),c.push("vec4 viewPosition = modelViewMatrix * localPosition;")):(c.push("worldPosition = modelMatrix2 * localPosition;"),c.push("worldPosition.xyz = worldPosition.xyz + offset;"),c.push("vec4 viewPosition = viewMatrix2 * worldPosition; ")),r.normalsBuf&&c.push("vec3 viewNormal = normalize((viewNormalMatrix2 * modelNormalMatrix2 * localNormal).xyz);"),c.push("vec3 reflectedColor = vec3(0.0, 0.0, 0.0);"),c.push("vec3 viewLightDir = vec3(0.0, 0.0, -1.0);"),c.push("float lambertian = 1.0;"),r.normalsBuf)for(let d=0,u=o.lights.length;d<u;d++){let A=o.lights[d];if(A.type!=="ambient"){if(A.type==="dir")A.space==="view"?c.push("viewLightDir = normalize(lightDir"+d+");"):c.push("viewLightDir = normalize((viewMatrix2 * vec4(lightDir"+d+", 0.0)).xyz);");else if(A.type==="point")A.space==="view"?c.push("viewLightDir = -normalize(lightPos"+d+" - viewPosition.xyz);"):c.push("viewLightDir = -normalize((viewMatrix2 * vec4(lightPos"+d+", 0.0)).xyz);");else if(A.type==="spot")A.space==="view"?c.push("viewLightDir = normalize(lightDir"+d+");"):c.push("viewLightDir = normalize((viewMatrix2 * vec4(lightDir"+d+", 0.0)).xyz);");else continue;c.push("lambertian = max(dot(-viewNormal, viewLightDir), 0.0);"),c.push("reflectedColor += lambertian * (lightColor"+d+".rgb * lightColor"+d+".a);")}}return c.push("vColor = vec4((lightAmbient.rgb * lightAmbient.a * materialColor.rgb) + materialEmissive.rgb + (reflectedColor * materialColor.rgb), materialColor.a) * colorize;"),s&&c.push("vWorldPosition = worldPosition;"),r.primitiveName==="points"&&c.push("gl_PointSize = pointSize;"),c.push("vec4 clipPos = projMatrix * viewPosition;"),t.logarithmicDepthBufferEnabled&&(c.push("vFragDepth = 1.0 + clipPos.w;"),c.push("isPerspective = float (isPerspectiveMatrix(projMatrix));")),c.push("gl_Position = clipPos;"),c.push("}"),c}function tot(e){let t=e.scene,i=t._sectionPlanesState;e._material._state;let o=e._geometry._state,r=i.getNumAllocatedSectionPlanes()>0,n=t.gammaOutput,a=[];if(a.push("#version 300 es"),a.push("// Lambertian drawing fragment shader"),a.push("#ifdef GL_FRAGMENT_PRECISION_HIGH"),a.push("precision highp float;"),a.push("precision highp int;"),a.push("#else"),a.push("precision mediump float;"),a.push("precision mediump int;"),a.push("#endif"),t.logarithmicDepthBufferEnabled&&(a.push("in float isPerspective;"),a.push("uniform float logDepthBufFC;"),a.push("in float vFragDepth;")),r){a.push("in vec4 vWorldPosition;"),a.push("uniform bool clippable;");for(let s=0,l=i.getNumAllocatedSectionPlanes();s<l;s++)a.push("uniform bool sectionPlaneActive"+s+";"),a.push("uniform vec3 sectionPlanePos"+s+";"),a.push("uniform vec3 sectionPlaneDir"+s+";")}if(a.push("in vec4 vColor;"),n&&(a.push("uniform float gammaFactor;"),a.push(" vec4 linearToGamma( in vec4 value, in float gammaFactor ) {"),a.push(" return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );"),a.push("}")),a.push("out vec4 outColor;"),a.push("void main(void) {"),r){a.push("if (clippable) {"),a.push(" float dist = 0.0;");for(let s=0,l=i.getNumAllocatedSectionPlanes();s<l;s++)a.push("if (sectionPlaneActive"+s+") {"),a.push(" dist += clamp(dot(-sectionPlaneDir"+s+".xyz, vWorldPosition.xyz - sectionPlanePos"+s+".xyz), 0.0, 1000.0);"),a.push("}");a.push(" if (dist > 0.0) { discard; }"),a.push("}")}return o.primitiveName==="points"&&(a.push("vec2 cxy = 2.0 * gl_PointCoord - 1.0;"),a.push("float r = dot(cxy, cxy);"),a.push("if (r > 1.0) {"),a.push(" discard;"),a.push("}")),t.logarithmicDepthBufferEnabled&&a.push("gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;"),n?a.push("outColor = linearToGamma(vColor, gammaFactor);"):a.push("outColor = vColor;"),a.push("}"),a}function iot(e){let t=e.scene;e._material;let i=e._state,o=t._sectionPlanesState,r=e._geometry._state,n=t._lightsState,a,s=i.billboard,l=i.background,c=i.stationary,d=$rt(e),u=kQ(e),A=o.getNumAllocatedSectionPlanes()>0,h=BQ(e),p=!!r.compressGeometry,f=[];if(f.push("#version 300 es"),f.push("// Drawing vertex shader"),f.push("in vec3 position;"),p&&f.push("uniform mat4 positionsDecodeMatrix;"),f.push("uniform mat4 modelMatrix;"),f.push("uniform mat4 viewMatrix;"),f.push("uniform mat4 projMatrix;"),f.push("out vec3 vViewPosition;"),f.push("uniform vec3 offset;"),f.push("uniform vec3 scale;"),A&&f.push("out vec4 vWorldPosition;"),t.logarithmicDepthBufferEnabled&&(f.push("uniform float logDepthBufFC;"),f.push("out float vFragDepth;"),f.push("bool isPerspectiveMatrix(mat4 m) {"),f.push(" return (m[2][3] == - 1.0);"),f.push("}"),f.push("out float isPerspective;")),n.lightMaps.length>0&&f.push("out vec3 vWorldNormal;"),u){f.push("in vec3 normal;"),f.push("uniform mat4 modelNormalMatrix;"),f.push("uniform mat4 viewNormalMatrix;"),f.push("out vec3 vViewNormal;");for(let m=0,g=n.lights.length;m<g;m++)a=n.lights[m],a.type!=="ambient"&&(a.type==="dir"&&f.push("uniform vec3 lightDir"+m+";"),a.type==="point"&&f.push("uniform vec3 lightPos"+m+";"),a.type==="spot"&&(f.push("uniform vec3 lightPos"+m+";"),f.push("uniform vec3 lightDir"+m+";")),a.type==="dir"&&a.space==="view"||f.push("out vec4 vViewLightReverseDirAndDist"+m+";"));p&&(f.push("vec3 octDecode(vec2 oct) {"),f.push(" vec3 v = vec3(oct.xy, 1.0 - abs(oct.x) - abs(oct.y));"),f.push(" if (v.z < 0.0) {"),f.push(" v.xy = (1.0 - abs(v.yx)) * vec2(v.x >= 0.0 ? 1.0 : -1.0, v.y >= 0.0 ? 1.0 : -1.0);"),f.push(" }"),f.push(" return normalize(v);"),f.push("}"))}if(d&&(f.push("in vec2 uv;"),f.push("out vec2 vUV;"),p&&f.push("uniform mat3 uvDecodeMatrix;")),r.colors&&(f.push("in vec4 color;"),f.push("out vec4 vColor;")),r.primitiveName==="points"&&f.push("uniform float pointSize;"),(s==="spherical"||s==="cylindrical")&&(f.push("void billboard(inout mat4 mat) {"),f.push(" mat[0][0] = scale[0];"),f.push(" mat[0][1] = 0.0;"),f.push(" mat[0][2] = 0.0;"),s==="spherical"&&(f.push(" mat[1][0] = 0.0;"),f.push(" mat[1][1] = scale[1];"),f.push(" mat[1][2] = 0.0;")),f.push(" mat[2][0] = 0.0;"),f.push(" mat[2][1] = 0.0;"),f.push(" mat[2][2] =1.0;"),f.push("}")),h){f.push("const mat4 texUnitConverter = mat4(0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0);");for(let m=0,g=n.lights.length;m<g;m++)n.lights[m].castsShadow&&(f.push("uniform mat4 shadowViewMatrix"+m+";"),f.push("uniform mat4 shadowProjMatrix"+m+";"),f.push("out vec4 vShadowPosFromLight"+m+";"))}if(f.push("void main(void) {"),f.push("vec4 localPosition = vec4(position, 1.0); "),f.push("vec4 worldPosition;"),p&&f.push("localPosition = positionsDecodeMatrix * localPosition;"),u&&(p?f.push("vec4 localNormal = vec4(octDecode(normal.xy), 0.0); "):f.push("vec4 localNormal = vec4(normal, 0.0); "),f.push("mat4 modelNormalMatrix2 = modelNormalMatrix;"),f.push("mat4 viewNormalMatrix2 = viewNormalMatrix;")),f.push("mat4 viewMatrix2 = viewMatrix;"),f.push("mat4 modelMatrix2 = modelMatrix;"),c?f.push("viewMatrix2[3][0] = viewMatrix2[3][1] = viewMatrix2[3][2] = 0.0;"):l&&f.push("viewMatrix2[3] = vec4(0.0, 0.0, 0.0 ,1.0);"),s==="spherical"||s==="cylindrical"?(f.push("mat4 modelViewMatrix = viewMatrix2 * modelMatrix2;"),f.push("billboard(modelMatrix2);"),f.push("billboard(viewMatrix2);"),f.push("billboard(modelViewMatrix);"),u&&(f.push("mat4 modelViewNormalMatrix = viewNormalMatrix2 * modelNormalMatrix2;"),f.push("billboard(modelNormalMatrix2);"),f.push("billboard(viewNormalMatrix2);"),f.push("billboard(modelViewNormalMatrix);")),f.push("worldPosition = modelMatrix2 * localPosition;"),f.push("worldPosition.xyz = worldPosition.xyz + offset;"),f.push("vec4 viewPosition = modelViewMatrix * localPosition;")):(f.push("worldPosition = modelMatrix2 * localPosition;"),f.push("worldPosition.xyz = worldPosition.xyz + offset;"),f.push("vec4 viewPosition = viewMatrix2 * worldPosition; ")),u){f.push("vec3 worldNormal = (modelNormalMatrix2 * localNormal).xyz; "),n.lightMaps.length>0&&f.push("vWorldNormal = worldNormal;"),f.push("vViewNormal = normalize((viewNormalMatrix2 * vec4(worldNormal, 1.0)).xyz);"),f.push("vec3 tmpVec3;"),f.push("float lightDist;");for(let m=0,g=n.lights.length;m<g;m++)a=n.lights[m],a.type!=="ambient"&&(a.type==="dir"&&a.space==="world"&&(f.push("tmpVec3 = vec3(viewMatrix2 * vec4(lightDir"+m+", 0.0) ).xyz;"),f.push("vViewLightReverseDirAndDist"+m+" = vec4(-tmpVec3, 0.0);")),a.type==="point"&&(a.space==="world"?(f.push("tmpVec3 = (viewMatrix2 * vec4(lightPos"+m+", 1.0)).xyz - viewPosition.xyz;"),f.push("lightDist = abs(length(tmpVec3));")):(f.push("tmpVec3 = lightPos"+m+".xyz - viewPosition.xyz;"),f.push("lightDist = abs(length(tmpVec3));")),f.push("vViewLightReverseDirAndDist"+m+" = vec4(tmpVec3, lightDist);")))}if(d&&(p?f.push("vUV = (uvDecodeMatrix * vec3(uv, 1.0)).xy;"):f.push("vUV = uv;")),r.colors&&f.push("vColor = color;"),r.primitiveName==="points"&&f.push("gl_PointSize = pointSize;"),A&&f.push("vWorldPosition = worldPosition;"),f.push(" vViewPosition = viewPosition.xyz;"),f.push("vec4 clipPos = projMatrix * viewPosition;"),t.logarithmicDepthBufferEnabled&&(f.push("vFragDepth = 1.0 + clipPos.w;"),f.push("isPerspective = float (isPerspectiveMatrix(projMatrix));")),l&&f.push("clipPos.z = clipPos.w;"),f.push("gl_Position = clipPos;"),h){f.push("const mat4 texUnitConverter = mat4(0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0);"),f.push("vec4 tempx; ");for(let m=0,g=n.lights.length;m<g;m++)n.lights[m].castsShadow&&f.push("vShadowPosFromLight"+m+" = texUnitConverter * shadowProjMatrix"+m+" * (shadowViewMatrix"+m+" * worldPosition); ")}return f.push("}"),f}function rot(e){let t=e.scene;t.canvas.gl;let i=e._material,o=e._geometry._state,r=e.scene._sectionPlanesState,n=e.scene._lightsState,a=e._material._state,s=r.getNumAllocatedSectionPlanes()>0,l=kQ(e),c=o.uvBuf,d=a.type==="PhongMaterial",u=a.type==="MetallicMaterial",A=a.type==="SpecularMaterial",h=BQ(e);t.gammaInput;let p=t.gammaOutput,f=[];if(f.push("#version 300 es"),f.push("// Drawing fragment shader"),f.push("#ifdef GL_FRAGMENT_PRECISION_HIGH"),f.push("precision highp float;"),f.push("precision highp int;"),f.push("#else"),f.push("precision mediump float;"),f.push("precision mediump int;"),f.push("#endif"),t.logarithmicDepthBufferEnabled&&(f.push("in float isPerspective;"),f.push("uniform float logDepthBufFC;"),f.push("in float vFragDepth;")),h&&(f.push("float unpackDepth (vec4 color) {"),f.push(" const vec4 bitShift = vec4(1.0, 1.0/256.0, 1.0/(256.0 * 256.0), 1.0/(256.0*256.0*256.0));"),f.push(" return dot(color, bitShift);"),f.push("}")),f.push("uniform float gammaFactor;"),f.push("vec4 linearToLinear( in vec4 value ) {"),f.push(" return value;"),f.push("}"),f.push("vec4 sRGBToLinear( in vec4 value ) {"),f.push(" return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );"),f.push("}"),f.push("vec4 gammaToLinear( in vec4 value) {"),f.push(" return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );"),f.push("}"),p&&(f.push("vec4 linearToGamma( in vec4 value, in float gammaFactor ) {"),f.push(" return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );"),f.push("}")),s){f.push("in vec4 vWorldPosition;"),f.push("uniform bool clippable;");for(var m=0;m<r.getNumAllocatedSectionPlanes();m++)f.push("uniform bool sectionPlaneActive"+m+";"),f.push("uniform vec3 sectionPlanePos"+m+";"),f.push("uniform vec3 sectionPlaneDir"+m+";")}if(l&&(n.lightMaps.length>0&&(f.push("uniform samplerCube lightMap;"),f.push("uniform mat4 viewNormalMatrix;")),n.reflectionMaps.length>0&&f.push("uniform samplerCube reflectionMap;"),(n.lightMaps.length>0||n.reflectionMaps.length>0)&&f.push("uniform mat4 viewMatrix;"),f.push("#define PI 3.14159265359"),f.push("#define RECIPROCAL_PI 0.31830988618"),f.push("#define RECIPROCAL_PI2 0.15915494"),f.push("#define EPSILON 1e-6"),f.push("#define saturate(a) clamp( a, 0.0, 1.0 )"),f.push("vec3 inverseTransformDirection(in vec3 dir, in mat4 matrix) {"),f.push(" return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );"),f.push("}"),f.push("struct IncidentLight {"),f.push(" vec3 color;"),f.push(" vec3 direction;"),f.push("};"),f.push("struct ReflectedLight {"),f.push(" vec3 diffuse;"),f.push(" vec3 specular;"),f.push("};"),f.push("struct Geometry {"),f.push(" vec3 position;"),f.push(" vec3 viewNormal;"),f.push(" vec3 worldNormal;"),f.push(" vec3 viewEyeDir;"),f.push("};"),f.push("struct Material {"),f.push(" vec3 diffuseColor;"),f.push(" float specularRoughness;"),f.push(" vec3 specularColor;"),f.push(" float shine;"),f.push("};"),d&&((n.lightMaps.length>0||n.reflectionMaps.length>0)&&(f.push("void computePhongLightMapping(const in Geometry geometry, const in Material material, inout ReflectedLight reflectedLight) {"),n.lightMaps.length>0&&(f.push(" vec3 irradiance = "+ku[n.lightMaps[0].encoding]+"(texture(lightMap, geometry.worldNormal)).rgb;"),f.push(" irradiance *= PI;"),f.push(" vec3 diffuseBRDFContrib = (RECIPROCAL_PI * material.diffuseColor);"),f.push(" reflectedLight.diffuse += irradiance * diffuseBRDFContrib;")),n.reflectionMaps.length>0&&(f.push(" vec3 reflectVec = reflect(-geometry.viewEyeDir, geometry.viewNormal);"),f.push(" vec3 radiance = texture(reflectionMap, reflectVec).rgb * 0.2;"),f.push(" radiance *= PI;"),f.push(" reflectedLight.specular += radiance;")),f.push("}")),f.push("void computePhongLighting(const in IncidentLight directLight, const in Geometry geometry, const in Material material, inout ReflectedLight reflectedLight) {"),f.push(" float dotNL = saturate(dot(geometry.viewNormal, directLight.direction));"),f.push(" vec3 irradiance = dotNL * directLight.color * PI;"),f.push(" reflectedLight.diffuse += irradiance * (RECIPROCAL_PI * material.diffuseColor);"),f.push(" reflectedLight.specular += directLight.color * material.specularColor * pow(max(dot(reflect(-directLight.direction, -geometry.viewNormal), geometry.viewEyeDir), 0.0), material.shine);"),f.push("}")),(u||A)&&(f.push("float GGXRoughnessToBlinnExponent(const in float ggxRoughness) {"),f.push(" float r = ggxRoughness + 0.0001;"),f.push(" return (2.0 / (r * r) - 2.0);"),f.push("}"),f.push("float getSpecularMIPLevel(const in float blinnShininessExponent, const in int maxMIPLevel) {"),f.push(" float maxMIPLevelScalar = float( maxMIPLevel );"),f.push(" float desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( ( blinnShininessExponent * blinnShininessExponent ) + 1.0 );"),f.push(" return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );"),f.push("}"),n.reflectionMaps.length>0&&(f.push("vec3 getLightProbeIndirectRadiance(const in vec3 reflectVec, const in float blinnShininessExponent, const in int maxMIPLevel) {"),f.push(" float mipLevel = 0.5 * getSpecularMIPLevel(blinnShininessExponent, maxMIPLevel);"),f.push(" vec3 envMapColor = "+ku[n.reflectionMaps[0].encoding]+"(texture(reflectionMap, reflectVec, mipLevel)).rgb;"),f.push(" return envMapColor;"),f.push("}")),f.push("vec3 F_Schlick(const in vec3 specularColor, const in float dotLH) {"),f.push(" float fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );"),f.push(" return ( 1.0 - specularColor ) * fresnel + specularColor;"),f.push("}"),f.push("float G_GGX_Smith(const in float alpha, const in float dotNL, const in float dotNV) {"),f.push(" float a2 = ( alpha * alpha );"),f.push(" float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * ( dotNL * dotNL ) );"),f.push(" float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * ( dotNV * dotNV ) );"),f.push(" return 1.0 / ( gl * gv );"),f.push("}"),f.push("float G_GGX_SmithCorrelated(const in float alpha, const in float dotNL, const in float dotNV) {"),f.push(" float a2 = ( alpha * alpha );"),f.push(" float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * ( dotNV * dotNV ) );"),f.push(" float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * ( dotNL * dotNL ) );"),f.push(" return 0.5 / max( gv + gl, EPSILON );"),f.push("}"),f.push("float D_GGX(const in float alpha, const in float dotNH) {"),f.push(" float a2 = ( alpha * alpha );"),f.push(" float denom = ( dotNH * dotNH) * ( a2 - 1.0 ) + 1.0;"),f.push(" return RECIPROCAL_PI * a2 / ( denom * denom);"),f.push("}"),f.push("vec3 BRDF_Specular_GGX(const in IncidentLight incidentLight, const in Geometry geometry, const in vec3 specularColor, const in float roughness) {"),f.push(" float alpha = ( roughness * roughness );"),f.push(" vec3 halfDir = normalize( incidentLight.direction + geometry.viewEyeDir );"),f.push(" float dotNL = saturate( dot( geometry.viewNormal, incidentLight.direction ) );"),f.push(" float dotNV = saturate( dot( geometry.viewNormal, geometry.viewEyeDir ) );"),f.push(" float dotNH = saturate( dot( geometry.viewNormal, halfDir ) );"),f.push(" float dotLH = saturate( dot( incidentLight.direction, halfDir ) );"),f.push(" vec3 F = F_Schlick( specularColor, dotLH );"),f.push(" float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );"),f.push(" float D = D_GGX( alpha, dotNH );"),f.push(" return F * (G * D);"),f.push("}"),f.push("vec3 BRDF_Specular_GGX_Environment(const in Geometry geometry, const in vec3 specularColor, const in float roughness) {"),f.push(" float dotNV = saturate(dot(geometry.viewNormal, geometry.viewEyeDir));"),f.push(" const vec4 c0 = vec4( -1, -0.0275, -0.572, 0.022);"),f.push(" const vec4 c1 = vec4( 1, 0.0425, 1.04, -0.04);"),f.push(" vec4 r = roughness * c0 + c1;"),f.push(" float a004 = min(r.x * r.x, exp2(-9.28 * dotNV)) * r.x + r.y;"),f.push(" vec2 AB = vec2(-1.04, 1.04) * a004 + r.zw;"),f.push(" return specularColor * AB.x + AB.y;"),f.push("}"),(n.lightMaps.length>0||n.reflectionMaps.length>0)&&(f.push("void computePBRLightMapping(const in Geometry geometry, const in Material material, inout ReflectedLight reflectedLight) {"),n.lightMaps.length>0&&(f.push(" vec3 irradiance = sRGBToLinear(texture(lightMap, geometry.worldNormal)).rgb;"),f.push(" irradiance *= PI;"),f.push(" vec3 diffuseBRDFContrib = (RECIPROCAL_PI * material.diffuseColor);"),f.push(" reflectedLight.diffuse += irradiance * diffuseBRDFContrib;")),n.reflectionMaps.length>0&&(f.push(" vec3 reflectVec = reflect(-geometry.viewEyeDir, geometry.viewNormal);"),f.push(" reflectVec = inverseTransformDirection(reflectVec, viewMatrix);"),f.push(" float blinnExpFromRoughness = GGXRoughnessToBlinnExponent(material.specularRoughness);"),f.push(" vec3 radiance = getLightProbeIndirectRadiance(reflectVec, blinnExpFromRoughness, 8);"),f.push(" vec3 specularBRDFContrib = BRDF_Specular_GGX_Environment(geometry, material.specularColor, material.specularRoughness);"),f.push(" reflectedLight.specular += radiance * specularBRDFContrib;")),f.push("}")),f.push("void computePBRLighting(const in IncidentLight incidentLight, const in Geometry geometry, const in Material material, inout ReflectedLight reflectedLight) {"),f.push(" float dotNL = saturate(dot(geometry.viewNormal, incidentLight.direction));"),f.push(" vec3 irradiance = dotNL * incidentLight.color * PI;"),f.push(" reflectedLight.diffuse += irradiance * (RECIPROCAL_PI * material.diffuseColor);"),f.push(" reflectedLight.specular += irradiance * BRDF_Specular_GGX(incidentLight, geometry, material.specularColor, material.specularRoughness);"),f.push("}"))),f.push("in vec3 vViewPosition;"),o.colors&&f.push("in vec4 vColor;"),c&&(l&&i._normalMap||i._ambientMap||i._baseColorMap||i._diffuseMap||i._emissiveMap||i._metallicMap||i._roughnessMap||i._metallicRoughnessMap||i._specularMap||i._glossinessMap||i._specularGlossinessMap||i._occlusionMap||i._alphaMap)&&f.push("in vec2 vUV;"),l&&(n.lightMaps.length>0&&f.push("in vec3 vWorldNormal;"),f.push("in vec3 vViewNormal;")),a.ambient&&f.push("uniform vec3 materialAmbient;"),a.baseColor&&f.push("uniform vec3 materialBaseColor;"),a.alpha!==void 0&&a.alpha!==null&&f.push("uniform vec4 materialAlphaModeCutoff;"),a.emissive&&f.push("uniform vec3 materialEmissive;"),a.diffuse&&f.push("uniform vec3 materialDiffuse;"),a.glossiness!==void 0&&a.glossiness!==null&&f.push("uniform float materialGlossiness;"),a.shininess!==void 0&&a.shininess!==null&&f.push("uniform float materialShininess;"),a.specular&&f.push("uniform vec3 materialSpecular;"),a.metallic!==void 0&&a.metallic!==null&&f.push("uniform float materialMetallic;"),a.roughness!==void 0&&a.roughness!==null&&f.push("uniform float materialRoughness;"),a.specularF0!==void 0&&a.specularF0!==null&&f.push("uniform float materialSpecularF0;"),c&&i._ambientMap&&(f.push("uniform sampler2D ambientMap;"),i._ambientMap._state.matrix&&f.push("uniform mat4 ambientMapMatrix;")),c&&i._baseColorMap&&(f.push("uniform sampler2D baseColorMap;"),i._baseColorMap._state.matrix&&f.push("uniform mat4 baseColorMapMatrix;")),c&&i._diffuseMap&&(f.push("uniform sampler2D diffuseMap;"),i._diffuseMap._state.matrix&&f.push("uniform mat4 diffuseMapMatrix;")),c&&i._emissiveMap&&(f.push("uniform sampler2D emissiveMap;"),i._emissiveMap._state.matrix&&f.push("uniform mat4 emissiveMapMatrix;")),l&&c&&i._metallicMap&&(f.push("uniform sampler2D metallicMap;"),i._metallicMap._state.matrix&&f.push("uniform mat4 metallicMapMatrix;")),l&&c&&i._roughnessMap&&(f.push("uniform sampler2D roughnessMap;"),i._roughnessMap._state.matrix&&f.push("uniform mat4 roughnessMapMatrix;")),l&&c&&i._metallicRoughnessMap&&(f.push("uniform sampler2D metallicRoughnessMap;"),i._metallicRoughnessMap._state.matrix&&f.push("uniform mat4 metallicRoughnessMapMatrix;")),l&&i._normalMap&&(f.push("uniform sampler2D normalMap;"),i._normalMap._state.matrix&&f.push("uniform mat4 normalMapMatrix;"),f.push("vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {"),f.push(" vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );"),f.push(" vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );"),f.push(" vec2 st0 = dFdx( uv.st );"),f.push(" vec2 st1 = dFdy( uv.st );"),f.push(" vec3 S = normalize( q0 * st1.t - q1 * st0.t );"),f.push(" vec3 T = normalize( -q0 * st1.s + q1 * st0.s );"),f.push(" vec3 N = normalize( surf_norm );"),f.push(" vec3 mapN = texture( normalMap, uv ).xyz * 2.0 - 1.0;"),f.push(" mat3 tsn = mat3( S, T, N );"),f.push(" return normalize( tsn * mapN );"),f.push("}")),c&&i._occlusionMap&&(f.push("uniform sampler2D occlusionMap;"),i._occlusionMap._state.matrix&&f.push("uniform mat4 occlusionMapMatrix;")),c&&i._alphaMap&&(f.push("uniform sampler2D alphaMap;"),i._alphaMap._state.matrix&&f.push("uniform mat4 alphaMapMatrix;")),l&&c&&i._specularMap&&(f.push("uniform sampler2D specularMap;"),i._specularMap._state.matrix&&f.push("uniform mat4 specularMapMatrix;")),l&&c&&i._glossinessMap&&(f.push("uniform sampler2D glossinessMap;"),i._glossinessMap._state.matrix&&f.push("uniform mat4 glossinessMapMatrix;")),l&&c&&i._specularGlossinessMap&&(f.push("uniform sampler2D materialSpecularGlossinessMap;"),i._specularGlossinessMap._state.matrix&&f.push("uniform mat4 materialSpecularGlossinessMapMatrix;")),l&&(i._diffuseFresnel||i._specularFresnel||i._alphaFresnel||i._emissiveFresnel||i._reflectivityFresnel)&&(f.push("float fresnel(vec3 eyeDir, vec3 normal, float edgeBias, float centerBias, float power) {"),f.push(" float fr = abs(dot(eyeDir, normal));"),f.push(" float finalFr = clamp((fr - edgeBias) / (centerBias - edgeBias), 0.0, 1.0);"),f.push(" return pow(finalFr, power);"),f.push("}"),i._diffuseFresnel&&(f.push("uniform float diffuseFresnelCenterBias;"),f.push("uniform float diffuseFresnelEdgeBias;"),f.push("uniform float diffuseFresnelPower;"),f.push("uniform vec3 diffuseFresnelCenterColor;"),f.push("uniform vec3 diffuseFresnelEdgeColor;")),i._specularFresnel&&(f.push("uniform float specularFresnelCenterBias;"),f.push("uniform float specularFresnelEdgeBias;"),f.push("uniform float specularFresnelPower;"),f.push("uniform vec3 specularFresnelCenterColor;"),f.push("uniform vec3 specularFresnelEdgeColor;")),i._alphaFresnel&&(f.push("uniform float alphaFresnelCenterBias;"),f.push("uniform float alphaFresnelEdgeBias;"),f.push("uniform float alphaFresnelPower;"),f.push("uniform vec3 alphaFresnelCenterColor;"),f.push("uniform vec3 alphaFresnelEdgeColor;")),i._reflectivityFresnel&&(f.push("uniform float materialSpecularF0FresnelCenterBias;"),f.push("uniform float materialSpecularF0FresnelEdgeBias;"),f.push("uniform float materialSpecularF0FresnelPower;"),f.push("uniform vec3 materialSpecularF0FresnelCenterColor;"),f.push("uniform vec3 materialSpecularF0FresnelEdgeColor;")),i._emissiveFresnel&&(f.push("uniform float emissiveFresnelCenterBias;"),f.push("uniform float emissiveFresnelEdgeBias;"),f.push("uniform float emissiveFresnelPower;"),f.push("uniform vec3 emissiveFresnelCenterColor;"),f.push("uniform vec3 emissiveFresnelEdgeColor;"))),f.push("uniform vec4 lightAmbient;"),l)for(let g=0,y=n.lights.length;g<y;g++){let v=n.lights[g];v.type!=="ambient"&&(f.push("uniform vec4 lightColor"+g+";"),v.type==="point"&&f.push("uniform vec3 lightAttenuation"+g+";"),v.type==="dir"&&v.space==="view"&&f.push("uniform vec3 lightDir"+g+";"),v.type==="point"&&v.space==="view"?f.push("uniform vec3 lightPos"+g+";"):f.push("in vec4 vViewLightReverseDirAndDist"+g+";"))}if(h)for(let g=0,y=n.lights.length;g<y;g++)n.lights[g].castsShadow&&(f.push("in vec4 vShadowPosFromLight"+g+";"),f.push("uniform sampler2D shadowMap"+g+";"));if(f.push("uniform vec4 colorize;"),f.push("out vec4 outColor;"),f.push("void main(void) {"),s){f.push("if (clippable) {"),f.push(" float dist = 0.0;");for(var m=0;m<r.getNumAllocatedSectionPlanes();m++)f.push("if (sectionPlaneActive"+m+") {"),f.push(" dist += clamp(dot(-sectionPlaneDir"+m+".xyz, vWorldPosition.xyz - sectionPlanePos"+m+".xyz), 0.0, 1000.0);"),f.push("}");f.push(" if (dist > 0.0) { discard; }"),f.push("}")}if(o.primitiveName==="points"&&(f.push("vec2 cxy = 2.0 * gl_PointCoord - 1.0;"),f.push("float r = dot(cxy, cxy);"),f.push("if (r > 1.0) {"),f.push(" discard;"),f.push("}")),f.push("float occlusion = 1.0;"),a.ambient?f.push("vec3 ambientColor = materialAmbient;"):f.push("vec3 ambientColor = vec3(1.0, 1.0, 1.0);"),a.diffuse?f.push("vec3 diffuseColor = materialDiffuse;"):a.baseColor?f.push("vec3 diffuseColor = materialBaseColor;"):f.push("vec3 diffuseColor = vec3(1.0, 1.0, 1.0);"),o.colors&&f.push("diffuseColor *= vColor.rgb;"),a.emissive?f.push("vec3 emissiveColor = materialEmissive;"):f.push("vec3 emissiveColor = vec3(0.0, 0.0, 0.0);"),a.specular?f.push("vec3 specular = materialSpecular;"):f.push("vec3 specular = vec3(1.0, 1.0, 1.0);"),a.alpha===void 0?f.push("float alpha = 1.0;"):f.push("float alpha = materialAlphaModeCutoff[0];"),o.colors&&f.push("alpha *= vColor.a;"),a.glossiness===void 0?f.push("float glossiness = 1.0;"):f.push("float glossiness = materialGlossiness;"),a.metallic===void 0?f.push("float metallic = 1.0;"):f.push("float metallic = materialMetallic;"),a.roughness===void 0?f.push("float roughness = 1.0;"):f.push("float roughness = materialRoughness;"),a.specularF0===void 0?f.push("float specularF0 = 1.0;"):f.push("float specularF0 = materialSpecularF0;"),c&&(l&&i._normalMap||i._ambientMap||i._baseColorMap||i._diffuseMap||i._occlusionMap||i._emissiveMap||i._metallicMap||i._roughnessMap||i._metallicRoughnessMap||i._specularMap||i._glossinessMap||i._specularGlossinessMap||i._alphaMap)&&(f.push("vec4 texturePos = vec4(vUV.s, vUV.t, 1.0, 1.0);"),f.push("vec2 textureCoord;")),c&&i._ambientMap&&(i._ambientMap._state.matrix?f.push("textureCoord = (ambientMapMatrix * texturePos).xy;"):f.push("textureCoord = texturePos.xy;"),f.push("vec4 ambientTexel = texture(ambientMap, textureCoord).rgb;"),f.push("ambientTexel = "+ku[i._ambientMap._state.encoding]+"(ambientTexel);"),f.push("ambientColor *= ambientTexel.rgb;")),c&&i._diffuseMap&&(i._diffuseMap._state.matrix?f.push("textureCoord = (diffuseMapMatrix * texturePos).xy;"):f.push("textureCoord = texturePos.xy;"),f.push("vec4 diffuseTexel = texture(diffuseMap, textureCoord);"),f.push("diffuseTexel = "+ku[i._diffuseMap._state.encoding]+"(diffuseTexel);"),f.push("diffuseColor *= diffuseTexel.rgb;"),f.push("alpha *= diffuseTexel.a;")),c&&i._baseColorMap&&(i._baseColorMap._state.matrix?f.push("textureCoord = (baseColorMapMatrix * texturePos).xy;"):f.push("textureCoord = texturePos.xy;"),f.push("vec4 baseColorTexel = texture(baseColorMap, textureCoord);"),f.push("baseColorTexel = "+ku[i._baseColorMap._state.encoding]+"(baseColorTexel);"),f.push("diffuseColor *= baseColorTexel.rgb;"),f.push("alpha *= baseColorTexel.a;")),c&&i._emissiveMap&&(i._emissiveMap._state.matrix?f.push("textureCoord = (emissiveMapMatrix * texturePos).xy;"):f.push("textureCoord = texturePos.xy;"),f.push("vec4 emissiveTexel = texture(emissiveMap, textureCoord);"),f.push("emissiveTexel = "+ku[i._emissiveMap._state.encoding]+"(emissiveTexel);"),f.push("emissiveColor = emissiveTexel.rgb;")),c&&i._alphaMap&&(i._alphaMap._state.matrix?f.push("textureCoord = (alphaMapMatrix * texturePos).xy;"):f.push("textureCoord = texturePos.xy;"),f.push("alpha *= texture(alphaMap, textureCoord).r;")),c&&i._occlusionMap&&(i._occlusionMap._state.matrix?f.push("textureCoord = (occlusionMapMatrix * texturePos).xy;"):f.push("textureCoord = texturePos.xy;"),f.push("occlusion *= texture(occlusionMap, textureCoord).r;")),l&&(n.lights.length>0||n.lightMaps.length>0||n.reflectionMaps.length>0)){c&&i._normalMap?(i._normalMap._state.matrix?f.push("textureCoord = (normalMapMatrix * texturePos).xy;"):f.push("textureCoord = texturePos.xy;"),f.push("vec3 viewNormal = perturbNormal2Arb( vViewPosition, normalize(vViewNormal), textureCoord );")):f.push("vec3 viewNormal = normalize(vViewNormal);"),c&&i._specularMap&&(i._specularMap._state.matrix?f.push("textureCoord = (specularMapMatrix * texturePos).xy;"):f.push("textureCoord = texturePos.xy;"),f.push("specular *= texture(specularMap, textureCoord).rgb;")),c&&i._glossinessMap&&(i._glossinessMap._state.matrix?f.push("textureCoord = (glossinessMapMatrix * texturePos).xy;"):f.push("textureCoord = texturePos.xy;"),f.push("glossiness *= texture(glossinessMap, textureCoord).r;")),c&&i._specularGlossinessMap&&(i._specularGlossinessMap._state.matrix?f.push("textureCoord = (materialSpecularGlossinessMapMatrix * texturePos).xy;"):f.push("textureCoord = texturePos.xy;"),f.push("vec4 specGlossRGB = texture(materialSpecularGlossinessMap, textureCoord).rgba;"),f.push("specular *= specGlossRGB.rgb;"),f.push("glossiness *= specGlossRGB.a;")),c&&i._metallicMap&&(i._metallicMap._state.matrix?f.push("textureCoord = (metallicMapMatrix * texturePos).xy;"):f.push("textureCoord = texturePos.xy;"),f.push("metallic *= texture(metallicMap, textureCoord).r;")),c&&i._roughnessMap&&(i._roughnessMap._state.matrix?f.push("textureCoord = (roughnessMapMatrix * texturePos).xy;"):f.push("textureCoord = texturePos.xy;"),f.push("roughness *= texture(roughnessMap, textureCoord).r;")),c&&i._metallicRoughnessMap&&(i._metallicRoughnessMap._state.matrix?f.push("textureCoord = (metallicRoughnessMapMatrix * texturePos).xy;"):f.push("textureCoord = texturePos.xy;"),f.push("vec3 metalRoughRGB = texture(metallicRoughnessMap, textureCoord).rgb;"),f.push("metallic *= metalRoughRGB.b;"),f.push("roughness *= metalRoughRGB.g;")),f.push("vec3 viewEyeDir = normalize(-vViewPosition);"),i._diffuseFresnel&&(f.push("float diffuseFresnel = fresnel(viewEyeDir, viewNormal, diffuseFresnelEdgeBias, diffuseFresnelCenterBias, diffuseFresnelPower);"),f.push("diffuseColor *= mix(diffuseFresnelEdgeColor, diffuseFresnelCenterColor, diffuseFresnel);")),i._specularFresnel&&(f.push("float specularFresnel = fresnel(viewEyeDir, viewNormal, specularFresnelEdgeBias, specularFresnelCenterBias, specularFresnelPower);"),f.push("specular *= mix(specularFresnelEdgeColor, specularFresnelCenterColor, specularFresnel);")),i._alphaFresnel&&(f.push("float alphaFresnel = fresnel(viewEyeDir, viewNormal, alphaFresnelEdgeBias, alphaFresnelCenterBias, alphaFresnelPower);"),f.push("alpha *= mix(alphaFresnelEdgeColor.r, alphaFresnelCenterColor.r, alphaFresnel);")),i._emissiveFresnel&&(f.push("float emissiveFresnel = fresnel(viewEyeDir, viewNormal, emissiveFresnelEdgeBias, emissiveFresnelCenterBias, emissiveFresnelPower);"),f.push("emissiveColor *= mix(emissiveFresnelEdgeColor, emissiveFresnelCenterColor, emissiveFresnel);")),f.push("if (materialAlphaModeCutoff[1] == 1.0 && alpha < materialAlphaModeCutoff[2]) {"),f.push(" discard;"),f.push("}"),f.push("IncidentLight light;"),f.push("Material material;"),f.push("Geometry geometry;"),f.push("ReflectedLight reflectedLight = ReflectedLight(vec3(0.0,0.0,0.0), vec3(0.0,0.0,0.0));"),f.push("vec3 viewLightDir;"),d&&(f.push("material.diffuseColor = diffuseColor;"),f.push("material.specularColor = specular;"),f.push("material.shine = materialShininess;")),A&&(f.push("float oneMinusSpecularStrength = 1.0 - max(max(specular.r, specular.g ),specular.b);"),f.push("material.diffuseColor = diffuseColor * oneMinusSpecularStrength;"),f.push("material.specularRoughness = clamp( 1.0 - glossiness, 0.04, 1.0 );"),f.push("material.specularColor = specular;")),u&&(f.push("float dielectricSpecular = 0.16 * specularF0 * specularF0;"),f.push("material.diffuseColor = diffuseColor * (1.0 - dielectricSpecular) * (1.0 - metallic);"),f.push("material.specularRoughness = clamp(roughness, 0.04, 1.0);"),f.push("material.specularColor = mix(vec3(dielectricSpecular), diffuseColor, metallic);")),f.push("geometry.position = vViewPosition;"),n.lightMaps.length>0&&f.push("geometry.worldNormal = normalize(vWorldNormal);"),f.push("geometry.viewNormal = viewNormal;"),f.push("geometry.viewEyeDir = viewEyeDir;"),d&&(n.lightMaps.length>0||n.reflectionMaps.length>0)&&f.push("computePhongLightMapping(geometry, material, reflectedLight);"),(A||u)&&(n.lightMaps.length>0||n.reflectionMaps.length>0)&&f.push("computePBRLightMapping(geometry, material, reflectedLight);"),f.push("float shadow = 1.0;"),f.push("float shadowAcneRemover = 0.007;"),f.push("vec3 fragmentDepth;"),f.push("float texelSize = 1.0 / 1024.0;"),f.push("float amountInLight = 0.0;"),f.push("vec3 shadowCoord;"),f.push("vec4 rgbaDepth;"),f.push("float depth;");for(let g=0,y=n.lights.length;g<y;g++){let v=n.lights[g];v.type!=="ambient"&&(v.type==="dir"&&v.space==="view"?f.push("viewLightDir = -normalize(lightDir"+g+");"):v.type==="point"&&v.space==="view"?f.push("viewLightDir = normalize(lightPos"+g+" - vViewPosition);"):f.push("viewLightDir = normalize(vViewLightReverseDirAndDist"+g+".xyz);"),h&&v.castsShadow?(f.push("shadow = 0.0;"),f.push("fragmentDepth = vShadowPosFromLight"+g+".xyz;"),f.push("fragmentDepth.z -= shadowAcneRemover;"),f.push("for (int x = -3; x <= 3; x++) {"),f.push(" for (int y = -3; y <= 3; y++) {"),f.push(" float texelDepth = unpackDepth(texture(shadowMap"+g+", fragmentDepth.xy + vec2(x, y) * texelSize));"),f.push(" if (fragmentDepth.z < texelDepth) {"),f.push(" shadow += 1.0;"),f.push(" }"),f.push(" }"),f.push("}"),f.push("shadow = shadow / 9.0;"),f.push("light.color = lightColor"+g+".rgb * (lightColor"+g+".a * shadow);")):f.push("light.color = lightColor"+g+".rgb * (lightColor"+g+".a );"),f.push("light.direction = viewLightDir;"),d&&f.push("computePhongLighting(light, geometry, material, reflectedLight);"),(A||u)&&f.push("computePBRLighting(light, geometry, material, reflectedLight);"))}d?f.push("vec3 outgoingLight = (lightAmbient.rgb * lightAmbient.a * diffuseColor) + ((occlusion * (( reflectedLight.diffuse + reflectedLight.specular)))) + emissiveColor;"):f.push("vec3 outgoingLight = (occlusion * (reflectedLight.diffuse)) + (occlusion * reflectedLight.specular) + emissiveColor;")}else f.push("ambientColor *= (lightAmbient.rgb * lightAmbient.a);"),f.push("vec3 outgoingLight = emissiveColor + ambientColor;");return f.push("vec4 fragColor = vec4(outgoingLight, alpha) * colorize;"),p&&f.push("fragColor = linearToGamma(fragColor, gammaFactor);"),f.push("outColor = fragColor;"),t.logarithmicDepthBufferEnabled&&f.push("gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;"),f.push("}"),f}var EQ=class{constructor(e,t,i){if(this.allocated=!1,this.compiled=!1,this.handle=e.createShader(t),!this.handle){this.errors=["Failed to allocate"];return}if(this.allocated=!0,e.shaderSource(this.handle,i),e.compileShader(this.handle),this.compiled=e.getShaderParameter(this.handle,e.COMPILE_STATUS),!this.compiled&&!e.isContextLost()){let o=i.split(`
1069
1069
  `),r=[];for(let n=0;n<o.length;n++)r.push(n+1+": "+o[n]+`
1070
1070
  `);this.errors=[],this.errors.push(""),this.errors.push(e.getShaderInfoLog(this.handle)),this.errors=this.errors.concat(r.join(""))}}destroy(){}},oot=class{constructor(e,t){this.bindTexture=function(i,o){return i.bind(o)?(e.uniform1i(t,o),!0):!1}}},not=class{constructor(e,t){this._gl=e,this.location=t}bindArrayBuffer(e){e&&(e.bind(),this._gl.enableVertexAttribArray(this.location),this._gl.vertexAttribPointer(this.location,e.itemSize,e.itemType,e.normalized,e.stride,e.offset))}},MQ=new Ss({});function PQ(e){let t=[],i,o;for(let r=0,n=e.length;r<n;r++)i=e[r],o=i.indexOf("/"),o>0&&i.charAt(o+1)==="/"&&(i=i.substring(0,o)),t.push(i);return t.join(`
@@ -2548,7 +2548,7 @@ void main() {
2548
2548
  `},zoomImageTransform(){return`
2549
2549
  scale(${this.zoomFactor})
2550
2550
  translate(-${this.zoomX}px, -${this.zoomY}px)
2551
- `}},methods:{onMouseMove({offsetX:e,offsetY:t}){this.zoomX=e,this.zoomY=t}}},zPt=["src"],qPt=["src"];function GPt(e,t,i,o,r,n){return k(),N("div",{class:"preview-2d",onMouseenter:t[0]||=a=>r.hover=!0,onMouseleave:t[1]||=a=>r.hover=!1,onMousemove:t[2]||=(...a)=>n.onMouseMove&&n.onMouseMove(...a)},[w("img",{loading:"lazy",src:n.imgUrl},null,8,zPt),Tt(w("div",{class:"zoom",style:ve({transform:n.zoomTransform})},[w("div",{class:"zoomImage",style:ve({width:`${i.width}px`,height:`${i.height}px`,transform:n.zoomImageTransform})},[w("img",{loading:"lazy",src:n.imgUrl},null,8,qPt)],4)],4),[[ui,r.hover]])],32)}var KPt=Q(QPt,[["render",GPt],["__scopeId","data-v-b92f4cf9"]]),H$=15,JPt={props:{width:{type:Number},height:{type:Number},previewUrl:{type:String},defaultUrl:{type:String}},data(){return{translation:0}},computed:{viewportWidth(){return Math.min(this.width,this.height)}},methods:{onMouseMove({offsetX:e}){let t=Math.ceil(H$*(1-e/this.width));t=Math.abs(t),t=Math.min(t,H$),this.translation=(t-1)*this.viewportWidth}}},ZPt=["src"];function WPt(e,t,i,o,r,n){return k(),N("div",{class:"preview-3d",onMousemove:t[0]||=(...a)=>n.onMouseMove&&n.onMouseMove(...a)},[w("div",{class:"viewport",style:ve({width:`${n.viewportWidth}px`,height:`${i.height}px`})},[w("img",{loading:"lazy",src:i.previewUrl||i.defaultUrl,style:ve({transform:`translateX(-${r.translation}px)`})},null,12,ZPt)],4)],32)}var YPt={components:{Preview2D:KPt,Preview3D:Q(JPt,[["render",WPt],["__scopeId","data-v-81707204"]])},props:{type:{type:String,default:"3d",validator:e=>["2d","3d"].includes(e)},width:{type:Number,default:240},height:{type:Number,default:240},previewUrl:{type:String},defaultUrl:{type:String},backgroundColor:{type:String,default:"var(--color-silver-light)"},zoomFactor:{type:Number,default:3}},computed:{previewComponent(){return this.type==="3d"?"Preview3D":"Preview2D"}}};function XPt(e,t,i,o,r,n){return k(),W(qr(n.previewComponent),la({class:"bimdata-model-preview",style:{width:`${i.width}px`,height:`${i.height}px`,backgroundColor:i.backgroundColor}},e.$props),null,16,["style"])}var $Pt=Q(YPt,[["render",XPt]]),eIt={class:"placeholder"},tIt={class:"list-item"},iIt={class:"count"},rIt=Q({__name:"StoreySelector",props:{storeys:{type:Object,required:!0},storey:{type:Object,default:null}},emits:["storey-selected"],setup(e,{emit:t}){let i=e,o=pe(null);return xt([()=>i.storeys,()=>i.storey],([r,n])=>{(!n||r.some(a=>a.uuid===n.uuid)&&n.uuid!==o.value?.uuid)&&(o.value=n)},{immediate:!0}),(r,n)=>{let a=I("BIMDataIconStorey"),s=I("BIMDataTextbox"),l=I("BIMDataIconPlan"),c=I("BIMDataDropdownList");return k(),W(c,{class:"storey-selector",width:"100%",list:e.storeys,elementKey:"uuid",closeOnElementClick:!0,onElementClick:n[0]||=d=>r.$emit("storey-selected",d)},{header:j(()=>[T(a,{size:"xs"}),w("span",eIt,G(o.value?.name??r.$t("MetaBuildingStructure.StoreySelector.placeholder")),1)]),element:j(({element:d})=>[w("div",tIt,[T(s,{class:"text",text:d.name},null,8,["text"]),T(l,{size:"xs"}),w("span",iIt,G(d.plans.length),1)])]),_:1},8,["list"])}}},[["__scopeId","data-v-49c78195"]]),oIt={class:"photosphere-building"},nIt={class:"title"},aIt={class:"head"},sIt={class:"body"},lIt={class:"loading"},V$=Q({__name:"BIMDataPhotosphereBuilding",props:{apiClient:{type:Object,required:!0},space:{type:Object,required:!0},project:{type:Object,required:!0},model:{type:Object,default:null},storey:{type:Object,default:null},plan:{type:Object,default:null},selectable:{type:Boolean,default:!1}},emits:["storey-selected","plan-selected"],setup(e,{emit:t}){let i=e,o=t,r=pe(!1),n=pe([]),a=pe(null),s=je(()=>a.value?.plans??[]),l=pe(null);xt(()=>i.model,async u=>{if(u)try{r.value=!0,n.value=await i.apiClient.modelApi.getStoreys(i.space.id,u.id,i.project.id),n.value.some(({uuid:A})=>a.value?.uuid===A)||(a.value=n.value[0]??null)}finally{r.value=!1}else n.value=[],a.value=null},{immediate:!0}),xt(()=>i.storey,u=>{a.value=u},{immediate:!0}),xt(()=>i.plan,u=>{l.value=u?.plan?.id},{immediate:!0});let c=u=>(a.value=u,o("storey-selected",u)),d=u=>o("plan-selected",u);return(u,A)=>{let h=I("BIMDataIconBuilding"),p=I("BIMDataRadio"),f=I("BIMDataFileIcon"),m=I("BIMDataTextbox"),g=I("BIMDataSpinner");return k(),N("div",oIt,[w("div",nIt,[T(h,{size:"s"}),w("span",null,G(u.$t("PhotosphereBuilding.title")),1)]),w("div",aIt,[T(rIt,{storeys:n.value,storey:a.value,onStoreySelected:c},null,8,["storeys","storey"])]),w("div",sIt,[(k(!0),N(ut,null,Vt(s.value,y=>(k(),N("div",{class:"list-item",key:y.plan.id},[e.selectable?(k(),W(p,{key:0,value:y.plan.id,modelValue:l.value,"onUpdate:modelValue":[A[0]||=v=>l.value=v,v=>d(y)]},null,8,["value","modelValue","onUpdate:modelValue"])):le("",!0),T(f,{fileName:y.plan.document?.file_name??y.plan.name,size:14},null,8,["fileName"]),T(m,{class:"text",text:y.plan.name},null,8,["text"])]))),128))]),T(Qi,{name:"fade"},{default:j(()=>[Tt(w("div",lIt,[T(g)],512),[[ui,r.value]])]),_:1})])}}},[["__scopeId","data-v-94317752"]]);function iI(e,t){return Array.isArray(e)?e=e.map(i=>iI(i,t)):(e.expandedRef=pe(!0),e.parent=t,e.children=e.children?.map(i=>iI(i,e))??[]),e}function cIt(e,t,i){return[{id:1,text:e.name,component:"StructureRootNode",children:t.map(o=>dIt(o,i))}]}var dIt=(e,t)=>({id:e.uuid,text:e.name,component:"StoreyNode",children:e.plans?.map(i=>uIt(e,i))??[],storey:e}),uIt=(e,t)=>({id:t.plan.id,text:t.plan.name,component:"PlanNode",storey:e,plan:t}),AIt={class:"generic-tree-node"},hIt={class:"end"},V8=Q({__name:"GenericTreeNode",props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},setup(e){return(t,i)=>{let o=I("BIMDataTextbox");return k(),N("div",AIt,[Pt(t.$slots,"icon",{},void 0,!0),T(o,{class:"text",text:e.node.text},null,8,["text"]),w("div",hIt,[Pt(t.$slots,"end",{},void 0,!0)])])}}},[["__scopeId","data-v-fab13549"]]),pIt={__name:"PlanNode",props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},emits:["delete-plan"],setup(e){let t=e,i=je(()=>t.node.storey),o=je(()=>t.node.plan);return(r,n)=>{let a=I("BIMDataFileIcon"),s=I("BIMDataIconDelete"),l=I("BIMDataButton");return k(),W(V8,Cs(jl(r.$props)),{icon:j(()=>[T(a,{"file-name":o.value.plan.document?.file_name??o.value.plan.name,size:12},null,8,["file-name"])]),end:j(()=>[T(l,{width:"24px",height:"24px",color:"high",ghost:"",rounded:"",icon:"",onClick:n[0]||=c=>r.$emit("delete-plan",{storey:i.value,plan:o.value})},{default:j(()=>[T(s,{size:"xxs"})]),_:1})]),_:1},16)}}},fIt=Q({__name:"StoreyNode",props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},emits:["add-plans","delete-storey","update-storey"],setup(e,{emit:t}){let i=e,o=t,r=[{key:1,text:"BuildingMaker.view.addFile",icon:"plus",action:()=>(n.value=!1,o("add-plans",i.node.storey))},{key:2,text:"BIMDataComponents.t.rename",icon:"edit",action:()=>(n.value=!1,o("update-storey",i.node.storey)),divider:!0},{key:3,text:"BIMDataComponents.t.delete",icon:"delete",color:"var(--color-high)",action:()=>(n.value=!1,o("delete-storey",i.node.storey))}],n=pe(!1);return(a,s)=>{let l=I("BIMDataIconStorey"),c=I("BIMDataIconEllipsis"),d=I("BIMDataButton"),u=I("BIMDataIcon"),A=I("BIMDataMenu");return k(),W(V8,la({class:"storey-node"},a.$props),{icon:j(()=>[T(l,{size:"xxs"})]),end:j(()=>[T(d,{width:"24px",height:"24px",color:"granite",ghost:"",rounded:"",icon:"",onClick:s[0]||=h=>n.value=!n.value},{default:j(()=>[T(c,{customSize:"24"})]),_:1}),T(Qi,{name:"fade"},{default:j(()=>[Tt(T(A,{class:"storey-node__menu",menuItems:r,width:"180px"},{item:j(({item:h})=>[T(u,{name:h.icon,size:"xs",margin:"0 12px 0 0"},null,8,["name"]),w("span",null,G(a.$t(h.text)),1)]),_:1},512),[[ui,n.value]])]),_:1})]),_:1},16)}}},[["__scopeId","data-v-a66bc7dd"]]),gIt={__name:"StructureRootNode",props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},emits:["create-storey"],setup(e){return(t,i)=>{let o=I("BIMDataIconBuilding"),r=I("BIMDataIconPlus"),n=I("BIMDataButton");return k(),W(V8,Cs(jl(t.$props)),{icon:j(()=>[T(o,{size:"xs"})]),end:j(()=>[T(n,{width:"23px",height:"23px",color:"primary",fill:"",radius:"",icon:"",onClick:i[0]||=a=>t.$emit("create-storey")},{default:j(()=>[T(r,{size:"xxs"})]),_:1})]),_:1},16)}}},mIt={__name:"ZoneNode",props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},setup(e){return(t,i)=>{let o=I("BIMDataIconZone2");return k(),W(V8,Cs(jl(t.$props)),{icon:j(()=>[T(o,{size:"xxs"})]),_:1},16)}}},vIt={class:"building-view"},yIt={key:0,class:"content"},wIt={key:1,class:"content"},bIt={class:"building-view__tree"},CIt=Q(Object.assign({components:{PlanNode:pIt,StoreyNode:fIt,StructureRootNode:gIt,ZoneNode:mIt}},{__name:"PhotosphereBuildingView",props:{apiClient:{type:Object,required:!0},space:{type:Object,required:!0},project:{type:Object,required:!0},model:{type:Object,required:!0}},emits:["close"],setup(e,{emit:t}){let i=e,o=bt("service"),r=bt("loading"),n=pe(""),a=pe(""),s=pe(!1),l=pe(!1),c=pe([]),d=pe(null),u=pe([]),A=pe([]),h=je(()=>iI(cIt(i.model,c.value,A.value))),p=async()=>{try{r.value=!0,c.value=await o.fetchStoreys(i.model)}finally{r.value=!1}},f=async()=>{try{r.value=!0,A.value=await o.fetchZones(i.model)}finally{r.value=!1}},m=async D=>{await o.createStorey(i.model,D),p()},g=async D=>{await o.updateStorey(i.model,D),p()},y=async D=>{await o.deleteStorey(i.model,D),p()},v=D=>{d.value=D,l.value=!0},C=()=>{d.value=null,l.value=!1},x=D=>{n.value=i.apiClient.config.configuration.basePath,a.value=i.apiClient.accessToken,d.value=D,s.value=!0},B=async()=>{let D=[],P=[];for(let{document:R,pdfPage:O}of u.value)O?P.push(O):D.push(R);let M=(await o.createPlanModels(D)).concat(P);await o.createStoreyPlans(i.model,d.value,M),p(),u.value=[],d.value=null,s.value=!1},E=async({storey:D,plan:P})=>{await o.deleteStoreyPlan(i.model,D,P),p()};return Di(()=>{p(),f()}),(D,P)=>{let M=I("BIMDataFileManager"),R=I("BIMDataButton"),O=I("BIMDataTree");return k(),N("div",vIt,[T(Qi,{name:"fade",mode:"out-in"},{default:j(()=>[s.value&&n.value&&a.value&&d.value?(k(),N("div",yIt,[T(M,{class:"building-view__dms",spaceId:e.space.id,projectId:e.project.id,apiUrl:n.value,archiveUrl:"",accessToken:a.value,locale:D.$i18n.locale,select:!0,pdfPageSelect:!0,multi:!0,headerButtons:!1,selectableFileTypes:mt(eX),onSelectionChange:P[0]||=V=>u.value=V},null,8,["spaceId","projectId","apiUrl","accessToken","locale","selectableFileTypes"]),T(R,{width:"100%",color:"primary",fill:"",radius:"",onClick:B},{default:j(()=>[nt(G(D.$t("BIMDataComponents.t.validate")),1)]),_:1})])):(k(),N("div",wIt,[w("div",bIt,[T(O,{data:h.value},{node:j(({node:V,depth:z})=>[(k(),W(qr(V.component),{node:V,depth:z,onCreateStorey:v,onUpdateStorey:v,onDeleteStorey:y,onAddPlans:x,onDeletePlan:E},null,40,["node","depth"]))]),_:1},8,["data"])]),T(R,{width:"100%",color:"primary",fill:"",radius:"",onClick:P[1]||=V=>D.$emit("close")},{default:j(()=>[nt(G(D.$t("BIMDataComponents.t.finish")),1)]),_:1}),T(Qi,{name:"fade"},{default:j(()=>[l.value?(k(),W(rX,{key:0,class:"building-view__form",storey:d.value,onCreateStorey:m,onUpdateStorey:g,onClose:C},null,8,["storey"])):le("",!0)]),_:1})]))]),_:1})])}}}),[["__scopeId","data-v-5bedb26f"]]),xIt={class:"bimdata-building-maker"},BIt=["src"],kIt={class:"bimdata-building-maker__body"},EIt={class:"bimdata-building-maker__loader"},MIt=Q({__name:"BIMDataPhotosphereBuildingMaker",props:{apiClient:{type:Object,required:!0},space:{type:Object,required:!0},project:{type:Object,required:!0},model:{type:Object,default:null}},emits:["metaBuilding-created","metaBuilding-updated","metaBuilding-deleted"],setup(e,{emit:t}){let i=e,o=t,r=Object.freeze({FORM:"form",LIST:"list",VIEW:"view"}),n=$Y(i.apiClient,i.space,i.project),a=pe(!1);pr("service",n),pr("loading",a);let s=pe(r.LIST),l=pe([]),c=pe(null),d=async()=>{a.value=!0,l.value=await n.fetchPhotosphereBuildings(),a.value=!1},u=async g=>{await n.deleteMetaBuilding(g),d(),o("metaBuilding-deleted")},A=g=>{c.value=g??null,s.value=r.FORM},h=g=>{c.value=g,s.value=r.VIEW},p=async g=>{await d(),h(g),o("metaBuilding-created")},f=()=>{d(),s.value=r.LIST,o("metaBuilding-updated")},m=()=>{s.value=r.LIST};return xt(()=>i.model,g=>{g&&h(g)},{immediate:!0}),Di(()=>d()),(g,y)=>{let v=I("BIMDataIconArrow"),C=I("BIMDataButton"),x=I("BIMDataSpinner");return k(),N("div",xIt,[w("div",{class:"bimdata-building-maker__header",style:ve({visibility:s.value===mt(r).LIST?"hidden":"visible"})},[T(C,{class:"bimdata-building-maker__header__btn-back",ghost:"",radius:"",disabled:a.value.value,onClick:m},{default:j(()=>[T(v,{size:"xxs",margin:"0 6px 0 0"}),w("span",null,G(g.$t("BIMDataComponents.t.back")),1)]),_:1},8,["disabled"]),w("img",{src:mt(tm)},null,8,BIt),w("span",null,G(g.$t("PhotosphereBuilding.title")),1)],4),w("div",kIt,[T(Qi,{name:"fade",mode:"out-in"},{default:j(()=>[s.value===mt(r).FORM?(k(),W(tX,{key:0,type:mt(xP).PHOTOSPHERE_BUILDING,metaBuilding:c.value,onMetaBuildingCreated:p,onMetaBuildingUpdated:f},null,8,["type","metaBuilding"])):s.value===mt(r).VIEW&&c.value?(k(),W(CIt,{key:1,apiClient:e.apiClient,space:e.space,project:e.project,model:c.value,onClose:m},null,8,["apiClient","space","project","model"])):(k(),W(iX,{key:2,metaBuildings:l.value,onOpenMetaBuilding:h,onCreateMetaBuilding:A,onUpdateMetaBuilding:A,onDeleteMetaBuilding:u},null,8,["metaBuildings"]))]),_:1})]),T(Qi,{name:"fade"},{default:j(()=>[Tt(w("div",EIt,[T(x)],512),[[ui,a.value]])]),_:1})])}}},[["__scopeId","data-v-235bd404"]]),PIt={class:"overlay"},IIt={class:"safe-zone__icon"},SIt={class:"safe-zone__title"},DIt={class:"safe-zone__text"},TIt={class:"safe-zone__actions"},LIt=Q({__name:"BIMDataSafeZoneModal",props:{width:{type:String,default:"350px"},iconName:{type:String,default:"warning"}},setup(e){return(t,i)=>{let o=I("BIMDataIcon");return k(),N("div",PIt,[w("div",{class:"safe-zone",style:ve({width:e.width})},[w("div",IIt,[T(o,{name:e.iconName,size:"s",fill:"",color:"high"},null,8,["name"])]),w("h2",SIt,[Pt(t.$slots,"title",{},void 0,!0)]),w("div",DIt,[Pt(t.$slots,"text",{},void 0,!0)]),w("div",TIt,[Pt(t.$slots,"actions",{},void 0,!0)])],4)])}}},[["__scopeId","data-v-01a25253"]]),RIt=co({BIMDataBuildingMaker:()=>oX,BIMDataFileManager:()=>XMt,BIMDataGuidedTour:()=>vPt,BIMDataMetaBuildingStructure:()=>N$,BIMDataModelPreview:()=>$Pt,BIMDataPDFViewer:()=>P$,BIMDataPhotosphereBuilding:()=>V$,BIMDataPhotosphereBuildingMaker:()=>MIt,BIMDataSafeZoneModal:()=>LIt}),_It={name:"buildingMaker",component:{setup(){let{apiClient:e,cloudId:t,projectId:i}=bt("$viewer").api;return()=>Gr(oX,{apiClient:e,space:{id:t},project:{id:i}})}},window:{name:"buildingMaker",label:"Building Maker",noModel:!0,icon:{imgUri:tm}}},FIt={components:{BIMDataNumericalInput:Ij},setup(){let e=bt("$viewer"),t=bt("viewerPlan"),i=bt("root"),o=bt("close"),r=je(()=>i.editedBitmap?.plan),n=je(()=>i.editedBitmap?i.editedBitmap:{x:0,y:0,scale:0,angle:0,opacity:0}),a=UIt(n),{x:s,y:l,angle:c,scale:d}=a,u,A,h=new Map;return xt(r,(f,m)=>{m&&h.set(m.key,u),f||h.clear(),u=h.get(f?.key)??null,A=null}),xt([s,l,c,d],()=>{r.value&&(u||=r.value.plan.transform,A={translate:[s.value,l.value],rotate:c.value,scale:d.value},t.planObjectRegistry.updatePlanObjectsTransform(r.value,{oldTransform:u,newTransform:A}),u=A)}),{root:i,bitmap:n,...a,submit:async()=>{try{i.loading=!0,await Promise.all(i.bitmaps.filter(f=>f.edited).map(async f=>{let{x:m,y:g,scale:y,angle:v,opacity:C,plan:x}=f,B={...x.plan.transform},E={translate:[m,g],rotate:v,scale:y,opacity:C};t.planObjectRegistry.updatePlanObjectsTransform(x,{oldTransform:E,newTransform:B}),x.plan.transform||(x.plan.transform={}),Object.assign(x.plan.transform,E),await e.state.updatePlan(x,B),f.edited=!1}))}catch(f){console.error(f)}finally{i.loading=!1,o()}}}}};function UIt(e){let t={};return Object.entries({x:i=>i,y:i=>i,scale:i=>i,angle:i=>i<0||i>360?(i%360+360)%360:i,opacity:i=>i<0?0:i>1?1:i}).forEach(([i,o])=>{t[i]=je({get:()=>e.value[i],set:r=>e.value[i]=o(r)})}),t}var OIt={class:"synchronization__page__edit"},NIt={class:"synchronization__page__edit__content"},HIt={class:"synchronization__page__edit__content__unit-group"},VIt={class:"synchronization__page__edit__content__unit-group__element"},jIt={class:"synchronization__page__edit__content__unit-group__element"},QIt={class:"synchronization__page__edit__content__unit-group__element"},zIt={class:"synchronization__page__edit__content__unit"},qIt={class:"synchronization__page__edit__content__unit"},GIt={class:"synchronization__page__edit__content__img"},KIt=["src"],JIt={class:"synchronization__page__edit__validate"};function ZIt(e,t,i,o,r,n){let a=I("BIMDataNumericalInput"),s=I("BIMDataSlider"),l=I("BIMDataTextbox"),c=I("BIMDataButton");return k(),N("div",OIt,[w("div",NIt,[w("section",null,[w("span",null,G(e.$t("synchronization.location")),1),w("div",HIt,[w("div",VIt,[T(a,{modelValue:e.x,"onUpdate:modelValue":t[0]||=d=>e.x=d,label:"X",container:e.$viewer.localContext.el},null,8,["modelValue","container"])]),w("div",jIt,[T(a,{modelValue:e.y,"onUpdate:modelValue":t[1]||=d=>e.y=d,label:"Y",container:e.$viewer.localContext.el},null,8,["modelValue","container"])]),w("div",QIt,[T(a,{modelValue:e.scale,"onUpdate:modelValue":t[2]||=d=>e.scale=d,label:e.$t("synchronization.scale"),step:.01,min:.01,container:e.$viewer.localContext.el},null,8,["modelValue","label","container"])])])]),w("section",null,[w("span",null,G(e.$t("synchronization.rotation")),1),w("div",zIt,[T(a,{modelValue:e.angle,"onUpdate:modelValue":t[3]||=d=>e.angle=d,unit:"\xB0",centered:""},null,8,["modelValue"]),T(s,{modelValue:e.angle,"onUpdate:modelValue":t[4]||=d=>e.angle=d,min:0,max:360},null,8,["modelValue"])])]),w("section",null,[w("span",null,G(e.$t("synchronization.alpha")),1),w("div",qIt,[T(a,{modelValue:e.opacity,"onUpdate:modelValue":t[5]||=d=>e.opacity=d,centered:""},null,8,["modelValue"]),T(s,{modelValue:e.opacity,"onUpdate:modelValue":t[6]||=d=>e.opacity=d,min:0,max:1,step:.01},null,8,["modelValue"])])]),w("section",null,[w("span",null,G(e.$t("synchronization.preview")),1),w("div",GIt,[w("img",{src:o.bitmap.dataUrl,alt:"Background"},null,8,KIt),T(l,{text:o.bitmap.name,class:"synchronization__page__edit__content__img__name"},null,8,["text"])])])]),w("div",JIt,[T(c,{width:"100%",color:"primary",fill:"",radius:"",onClick:o.submit},{default:j(()=>[nt(G(o.bitmap&&o.bitmap.plan?e.$t("global.save"):e.$t("global.validate")),1)]),_:1},8,["onClick"])])])}var WIt={name:"BimdataSynchronization",components:{edit:Q(FIt,[["render",ZIt],["__scopeId","data-v-63e956d5"]])},setup(){let{localContext:e}=bt("$viewer"),t=bt("$plugin"),i=e.pluginComponentInstances.get("plan");if(!i)throw Error("[Synchronization] plugin cannot work without viewerPlan plugin with 2d engine on.");i=un(i),pr("viewerPlan",i);let o=je(()=>e.loadedModels[0]);xt(o,h=>{!h||h.type!=="METABUILDING"?t.hide():t.show()},{immediate:!0}),xt(()=>t.shown,h=>{o.value?.type!=="METABUILDING"&&h&&t.hide()});let r=qo({page:"edit",loading:!1,modalDisplayed:!1,model:null,storeys:[],selectedStorey:null,plans:[],bitmaps:[],editedBitmap:null});pr("root",r);let n=()=>{r.editedBitmap&&(r.bitmaps.map(h=>(h.edit(!1),h)).filter(h=>h.edited).forEach(h=>{let{x:p,y:f,scale:m,angle:g,plan:y}=h,v=y.plan.transform,C={translate:[p,f],rotate:g,scale:m};i.planObjectRegistry.updatePlanObjectsTransform(y,{oldTransform:C,newTransform:v}),h.reset()}),r.modalDisplayed=!1,i.storeyRightOffset=0,e.showUI(),document.removeEventListener("keydown",d),r.editedBitmap=null,r.bitmaps=[])},a=()=>{n(),t.close()};pr("close",a);let s=()=>{r.bitmaps.some(h=>h.edited)?r.modalDisplayed=!0:a()},l=()=>{a()},c=h=>{r.editedBitmap=h},d=h=>{r.loading||h.key==="Escape"&&(h.preventDefault(),r.modalDisplayed?r.modalDisplayed=!1:a())},u=e.hub.on("model-loaded",({model:h})=>{r.model=h,r.storeys=h.storeys,r.plans=h.storeys.flatMap(p=>p.plans)},{getLastEvent:!0}),A=e.hub.on("storey-selected",({storey:h})=>{r.selectedStorey=h,(!h||h.plans.length<2)&&a()},{getLastEvent:!0});return $i(()=>{e.hub.off(u),e.hub.off(A)}),xt(()=>r.editedBitmap,(h,p)=>{p?.edit(!1),h?.edit(!0)},{immediate:!0}),{viewerPlan:i,root:r,onBitmapClick:c,onCloseClick:s,onLeaveClick:l,onKeyDown:d,clean:n}},async onOpen(){this.$viewer.localContext.pluginComponentInstances.forEach(t=>{t!==this&&t.$close?.()}),this.viewerPlan.storeyRightOffset=380,await this.$viewer.localContext.hideUI({exceptions:[this.$plugin.name]}),document.addEventListener("keydown",this.onKeyDown);let e=this.$viewer.localContext.selectedStorey?.plans.map(t=>t.key)??[];this.root.bitmaps=Array.from(this.viewerPlan.bitmaps.filter(t=>e.includes(t.plan.key))),this.root.editedBitmap=this.root.bitmaps[0],this.root.bitmaps.filter(t=>!t.visible).forEach(t=>{this.$viewer.localContext.showPlan(t.plan),t.show()}),this.viewerPlan.$refs.storeySelector?.focus()},onClose(){this.clean()}},YIt={class:"bimdata-synchronization"},XIt={class:"bimdata-synchronization__header"},$It={class:"bimdata-synchronization__header__top"},eSt={class:"bimdata-synchronization__header__top__title"},tSt={class:"bimdata-synchronization__header__top__title__text"},iSt={class:"bimdata-synchronization__header__select__header"},rSt={class:"bimdata-info-length bimdata-synchronization__header__select__header__length"},oSt={class:"bimdata-synchronization__page"},nSt={key:1,class:"bimdata-synchronization__modal"},aSt={class:"bimdata-synchronization__modal__content"},sSt={class:"bimdata-synchronization__modal__content__symbols"},lSt={class:"bimdata-synchronization__modal__content__buttons"};function cSt(e,t,i,o,r,n){let a=I("BIMDataLoading"),s=I("BIMDataIconSynchro2D"),l=I("BIMDataIconClose"),c=I("BIMDataButton"),d=I("BIMDataTextbox"),u=I("BIMDataDropdownList"),A=I("BIMDataIconWarning");return k(),N("div",YIt,[o.root.loading?(k(),W(a,{key:0})):le("",!0),w("div",XIt,[w("div",$It,[w("div",eSt,[T(s,{size:"xs",fill:"",color:"primary"}),w("span",tSt,G(e.$t("synchronization.title")),1)]),T(c,{class:"bimdata-synchronization__header__top__close",width:"25px",height:"25px",ghost:"",radius:"",icon:"",onClick:o.onCloseClick},{default:j(()=>[T(l,{size:"xs",fill:"",color:"granite-light"})]),_:1},8,["onClick"])]),w("div",null,[T(u,{width:"100%",list:o.root.bitmaps,"element-key":"id","per-page":30,"close-on-element-click":!0,class:"bimdata-synchronization__header__select",onElementClick:o.onBitmapClick},{header:j(()=>[w("div",iSt,[w("div",rSt,[w("span",null,G(o.root.bitmaps.length),1)]),w("div",null,[T(d,{width:"265px",text:o.root.editedBitmap?.name},null,8,["text"])])])]),element:j(({element:h})=>[w("div",{class:ye(["bimdata-synchronization__header__select__element",{"bimdata-synchronization__header__select__element--selected":h===o.root.editedBitmap}])},G(h.name),3)]),_:1},8,["list","onElementClick"])])]),w("div",oSt,[(k(),W(L3,null,[(k(),W(qr(o.root.page)))],1024))]),o.root.modalDisplayed?(k(),N("div",nSt,[w("div",aSt,[w("div",sSt,[T(A,{fill:"",color:"high",size:"l"}),w("div",null,G(e.$t("synchronization.warning")),1)]),w("div",lSt,[T(c,{width:"45%",color:"high",fill:"",radius:"",onClick:o.onLeaveClick},{default:j(()=>[nt(G(e.$t("synchronization.leave")),1)]),_:1},8,["onClick"]),T(c,{width:"45%",color:"default",outline:"",radius:"",onClick:t[0]||=h=>o.root.modalDisplayed=!1},{default:j(()=>[nt(G(e.$t("synchronization.stay")),1)]),_:1})])])])):le("",!0)])}var dSt={name:"synchronization",i18n:{de:{tooltip:"2D-Synchronisierung",title:"2D-Synchronisierung",start:"Beginnen",description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",select_storey:"Eine Etage ausw\xE4hlen",import_file:"Eine Datei importieren",location:"Position",scale:"Skala",rotation:"Rotation",alpha:"Undurchsichtigkeit",preview:"\xDCbersicht",import:"Ein Element importieren",from_ged:"Von der DMS des Projekts aus",from_computer:"Von Ihrem Computer aus",no_storey:"Um einen Hintergrund hinzuzuf\xFCgen, w\xE4hlen Sie bitte eine IFC und eine Etage aus.",no_ifc:"Um einen Hintergrund hinzuzuf\xFCgen, w\xE4hlen Sie bitte eine IFC aus.",warning:"M\xF6chten Sie diese Seite wirklich verlassen? Sie enth\xE4lt m\xF6glicherweise Informationen, die nicht best\xE4tigt sind.",leave:"Ja, diese Seite verlassen",stay:"Abbrechen, hierbleiben"},en:{tooltip:"2D Synchronization",title:"2D Synchronization",start:"Start",description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",select_storey:"Select a floor",import_file:"Import a file",location:"Position",scale:"Scale",rotation:"Rotation",alpha:"Opacity",preview:"Preview",import:"Import an element",from_ged:"From the project's DMS",from_computer:"From your computer",no_storey:"To add a background, please select an IFC and a floor.",no_ifc:"To add a background, please select an IFC.",warning:"Are you sure you want to leave this page? There may be some informations that are not validated.",leave:"Yes, leave this page",stay:"Cancel, stay here"},es:{tooltip:"Sincronizaci\xF3n 2D",title:"Sincronizaci\xF3n 2D",start:"Comenzar",description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",select_storey:"Seleccionar una planta",import_file:"Importar un fichero",location:"Posici\xF3n",scale:"Escala",rotation:"Rotaci\xF3n",alpha:"Opacidad",preview:"Vista r\xE1pida",import:"Importar un elemento",from_ged:"Desde el GED del proyecto",from_computer:"Desde su ordenador",no_storey:"Para agregar un fondo seleccione un IFC y una planta.",no_ifc:"Para agregar un fondo seleccione un IFC.",warning:"\xBFEsta usted seguro de que quiere abandonar esta p\xE1gina? Puede haber informaciones no validadas.",leave:"S\xED, abandonar la p\xE1gina",stay:"Cancelar, permanecer aqu\xED"},fr:{tooltip:"Synchronisation 2D",title:"Synchronisation 2D",start:"Commencer",description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",select_storey:"S\xE9lectionner un \xE9tage",import_file:"Importer un fichier",location:"Position",scale:"Echelle",rotation:"Rotation",alpha:"Opacit\xE9",preview:"Aper\xE7u",import:"Importer un \xE9l\xE9ment",from_ged:"Depuis la GED du projet",from_computer:"Depuis votre ordinateur",no_storey:"Pour ajouter un fond, veuillez selectionner un IFC et un \xE9tage.",no_ifc:"Pour ajouter un fond, veuillez selectionner un IFC.",warning:"\xCAtes-vous s\xFBr de vouloir quitter cette page ? Il y'a peut-\xEAtre des informations non valid\xE9es.",leave:"Oui, quitter cette page",stay:"Annuler, rester ici"},it:{tooltip:"Sincronizzazione 2D",title:"Sincronizzazione 2D",start:"Iniziare",description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",select_storey:"Selezionare un piano",import_file:"Importare un file",location:"Posizione",scale:"Scala",rotation:"Rotazione",alpha:"Opacit\xE0",preview:"Anteprima",import:"Importare un elemento",from_ged:"Dal cassetto informatico del progetto",from_computer:"Dal computer",no_storey:"Per aggiungere uno sfondo, selezionare un file IFC e un piano.",no_ifc:"Per aggiungere uno sfondo, selezionare un file IFC.",warning:"Si \xE8 sicuri di voler lasciare questa pagina? \xC8 possibile che alcune informazioni non siano state ancora convalidate.",leave:"S\xEC, uscire da questa pagina",stay:"Annulla, rimanere a questa pagina"}},component:Q(WIt,[["render",cSt],["__scopeId","data-v-98c2db44"]]),button:{tooltip:"synchronization.tooltip",position:"right",stance:1,content:"free",keepOpen:!0,icon:{imgUri:"data:image/svg+xml,%3csvg%20width='30'%20height='30'%20viewBox='0%200%2030%2030'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='6.52344'%20y='4.25488'%20width='16.1039'%20height='21.7744'%20stroke='%232F374A'/%3e%3crect%20x='3.12646'%20y='13.0261'%20width='14'%20height='20.043'%20transform='rotate(-45%203.12646%2013.0261)'%20fill='%232F374A'/%3e%3cmask%20id='path-3-outside-1_1838_531'%20maskUnits='userSpaceOnUse'%20x='-0.414214'%20y='-0.414216'%20width='31.1127'%20height='31.1127'%20fill='black'%3e%3crect%20fill='white'%20x='-0.414214'%20y='-0.414216'%20width='31.1127'%20height='31.1127'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.41421%2013.0208L4.35876%2014.9654L5.06586%2014.2582L3.82843%2013.0208L5.15425%2011.695L4.44715%2010.9879L2.41421%2013.0208ZM5.68458%209.75044L6.39169%2010.4576L10.4576%206.39169L9.75045%205.68458L5.68458%209.75044ZM10.9879%204.44714L11.695%205.15425L13.0208%203.82842L14.2583%205.06586L14.9654%204.35875L13.0208%202.41421L10.9879%204.44714ZM16.026%205.41942L15.3189%206.12652L19.208%2010.0156L19.9151%209.3085L16.026%205.41942ZM20.9758%2010.3692L20.2687%2011.0763L24.1577%2014.9654L24.8649%2014.2582L20.9758%2010.3692ZM25.9255%2015.3189L25.2184%2016.026L26.4558%2017.2635L25.13%2018.5893L25.8371%2019.2964L27.8701%2017.2635L25.9255%2015.3189ZM24.5997%2020.5338L23.8926%2019.8267L19.8267%2023.8926L20.5338%2024.5997L24.5997%2020.5338ZM19.2964%2025.8371L18.5893%2025.13L17.2635%2026.4558L16.026%2025.2184L15.3189%2025.9255L17.2635%2027.8701L19.2964%2025.8371ZM14.2583%2024.8649L14.9654%2024.1577L11.0763%2020.2687L10.3692%2020.9758L14.2583%2024.8649ZM9.3085%2019.9151L10.0156%2019.208L6.12652%2015.3189L5.41942%2016.026L9.3085%2019.9151Z'/%3e%3cpath%20d='M1%2013.0208L3.12132%2010.8995L5.24264%2013.0208L3.12132%2015.1421L1%2013.0208Z'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.12132%2012.3137L2.41421%2013.0208L3.12132%2013.7279L3.82843%2013.0208L3.12132%2012.3137ZM1%2013.0208L3.12132%2015.1421L5.24264%2013.0208L3.12132%2010.8995L1%2013.0208Z'/%3e%3cpath%20d='M10.8995%203.12132L13.0208%200.999998L15.1421%203.12132L13.0208%205.24264L10.8995%203.12132Z'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.0208%202.41421L12.3137%203.12132L13.0208%203.82842L13.7279%203.12132L13.0208%202.41421ZM10.8995%203.12132L13.0208%205.24264L15.1421%203.12132L13.0208%200.999998L10.8995%203.12132Z'/%3e%3cpath%20d='M25.0416%2017.2635L27.163%2015.1421L29.2843%2017.2635L27.163%2019.3848L25.0416%2017.2635Z'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M27.163%2016.5563L26.4558%2017.2635L27.163%2017.9706L27.8701%2017.2635L27.163%2016.5563ZM25.0416%2017.2635L27.163%2019.3848L29.2843%2017.2635L27.163%2015.1421L25.0416%2017.2635Z'/%3e%3cpath%20d='M15.1421%2027.1629L17.2635%2025.0416L19.3848%2027.1629L17.2635%2029.2843L15.1421%2027.1629Z'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.2635%2026.4558L16.5563%2027.1629L17.2635%2027.8701L17.9706%2027.1629L17.2635%2026.4558ZM15.1421%2027.1629L17.2635%2029.2843L19.3848%2027.1629L17.2635%2025.0416L15.1421%2027.1629Z'/%3e%3c/mask%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.41421%2013.0208L4.35876%2014.9654L5.06586%2014.2582L3.82843%2013.0208L5.15425%2011.695L4.44715%2010.9879L2.41421%2013.0208ZM5.68458%209.75044L6.39169%2010.4576L10.4576%206.39169L9.75045%205.68458L5.68458%209.75044ZM10.9879%204.44714L11.695%205.15425L13.0208%203.82842L14.2583%205.06586L14.9654%204.35875L13.0208%202.41421L10.9879%204.44714ZM16.026%205.41942L15.3189%206.12652L19.208%2010.0156L19.9151%209.3085L16.026%205.41942ZM20.9758%2010.3692L20.2687%2011.0763L24.1577%2014.9654L24.8649%2014.2582L20.9758%2010.3692ZM25.9255%2015.3189L25.2184%2016.026L26.4558%2017.2635L25.13%2018.5893L25.8371%2019.2964L27.8701%2017.2635L25.9255%2015.3189ZM24.5997%2020.5338L23.8926%2019.8267L19.8267%2023.8926L20.5338%2024.5997L24.5997%2020.5338ZM19.2964%2025.8371L18.5893%2025.13L17.2635%2026.4558L16.026%2025.2184L15.3189%2025.9255L17.2635%2027.8701L19.2964%2025.8371ZM14.2583%2024.8649L14.9654%2024.1577L11.0763%2020.2687L10.3692%2020.9758L14.2583%2024.8649ZM9.3085%2019.9151L10.0156%2019.208L6.12652%2015.3189L5.41942%2016.026L9.3085%2019.9151Z'%20fill='%232F374A'/%3e%3cpath%20d='M1%2013.0208L3.12132%2010.8995L5.24264%2013.0208L3.12132%2015.1421L1%2013.0208Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.12132%2012.3137L2.41421%2013.0208L3.12132%2013.7279L3.82843%2013.0208L3.12132%2012.3137ZM1%2013.0208L3.12132%2015.1421L5.24264%2013.0208L3.12132%2010.8995L1%2013.0208Z'%20fill='%232F374A'/%3e%3cpath%20d='M10.8995%203.12132L13.0208%200.999998L15.1421%203.12132L13.0208%205.24264L10.8995%203.12132Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.0208%202.41421L12.3137%203.12132L13.0208%203.82842L13.7279%203.12132L13.0208%202.41421ZM10.8995%203.12132L13.0208%205.24264L15.1421%203.12132L13.0208%200.999998L10.8995%203.12132Z'%20fill='%232F374A'/%3e%3cpath%20d='M25.0416%2017.2635L27.163%2015.1421L29.2843%2017.2635L27.163%2019.3848L25.0416%2017.2635Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M27.163%2016.5563L26.4558%2017.2635L27.163%2017.9706L27.8701%2017.2635L27.163%2016.5563ZM25.0416%2017.2635L27.163%2019.3848L29.2843%2017.2635L27.163%2015.1421L25.0416%2017.2635Z'%20fill='%232F374A'/%3e%3cpath%20d='M15.1421%2027.1629L17.2635%2025.0416L19.3848%2027.1629L17.2635%2029.2843L15.1421%2027.1629Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.2635%2026.4558L16.5563%2027.1629L17.2635%2027.8701L17.9706%2027.1629L17.2635%2026.4558ZM15.1421%2027.1629L17.2635%2029.2843L19.3848%2027.1629L17.2635%2025.0416L15.1421%2027.1629Z'%20fill='%232F374A'/%3e%3cpath%20d='M1%2013.0208L0.646447%2012.6673L0.292893%2013.0208L0.646447%2013.3744L1%2013.0208ZM3.12132%2010.8995L3.47487%2010.5459L3.12132%2010.1924L2.76777%2010.5459L3.12132%2010.8995ZM5.24264%2013.0208L5.59619%2013.3744L5.94975%2013.0208L5.59619%2012.6673L5.24264%2013.0208ZM3.12132%2015.1421L2.76777%2015.4957L3.12132%2015.8492L3.47487%2015.4957L3.12132%2015.1421ZM10.8995%203.12132L10.5459%202.76776L10.1924%203.12132L10.5459%203.47487L10.8995%203.12132ZM13.0208%200.999998L13.3744%200.646445L13.0208%200.292891L12.6673%200.646445L13.0208%200.999998ZM15.1421%203.12132L15.4957%203.47487L15.8492%203.12132L15.4957%202.76776L15.1421%203.12132ZM13.0208%205.24264L12.6673%205.59619L13.0208%205.94975L13.3744%205.59619L13.0208%205.24264ZM25.0416%2017.2635L24.6881%2016.9099L24.3345%2017.2635L24.6881%2017.617L25.0416%2017.2635ZM27.163%2015.1421L27.5165%2014.7886L27.163%2014.435L26.8094%2014.7886L27.163%2015.1421ZM29.2843%2017.2635L29.6378%2017.617L29.9914%2017.2635L29.6378%2016.9099L29.2843%2017.2635ZM27.163%2019.3848L26.8094%2019.7383L27.163%2020.0919L27.5165%2019.7383L27.163%2019.3848ZM15.1421%2027.1629L14.7886%2026.8094L14.435%2027.1629L14.7886%2027.5165L15.1421%2027.1629ZM17.2635%2025.0416L17.617%2024.6881L17.2635%2024.3345L16.9099%2024.6881L17.2635%2025.0416ZM19.3848%2027.1629L19.7383%2027.5165L20.0919%2027.1629L19.7383%2026.8094L19.3848%2027.1629ZM17.2635%2029.2843L16.9099%2029.6378L17.2635%2029.9914L17.617%2029.6378L17.2635%2029.2843ZM1.35355%2013.3744L3.47487%2011.253L2.76777%2010.5459L0.646447%2012.6673L1.35355%2013.3744ZM2.76777%2011.253L4.88909%2013.3744L5.59619%2012.6673L3.47487%2010.5459L2.76777%2011.253ZM4.88909%2012.6673L2.76777%2014.7886L3.47487%2015.4957L5.59619%2013.3744L4.88909%2012.6673ZM3.47487%2014.7886L1.35355%2012.6673L0.646447%2013.3744L2.76777%2015.4957L3.47487%2014.7886ZM11.253%203.47487L13.3744%201.35355L12.6673%200.646445L10.5459%202.76776L11.253%203.47487ZM12.6673%201.35355L14.7886%203.47487L15.4957%202.76776L13.3744%200.646445L12.6673%201.35355ZM14.7886%202.76776L12.6673%204.88909L13.3744%205.59619L15.4957%203.47487L14.7886%202.76776ZM13.3744%204.88909L11.253%202.76776L10.5459%203.47487L12.6673%205.59619L13.3744%204.88909ZM25.3952%2017.617L27.5165%2015.4957L26.8094%2014.7886L24.6881%2016.9099L25.3952%2017.617ZM26.8094%2015.4957L28.9307%2017.617L29.6378%2016.9099L27.5165%2014.7886L26.8094%2015.4957ZM28.9307%2016.9099L26.8094%2019.0312L27.5165%2019.7383L29.6378%2017.617L28.9307%2016.9099ZM27.5165%2019.0312L25.3952%2016.9099L24.6881%2017.617L26.8094%2019.7383L27.5165%2019.0312ZM15.4957%2027.5165L17.617%2025.3952L16.9099%2024.6881L14.7886%2026.8094L15.4957%2027.5165ZM16.9099%2025.3952L19.0312%2027.5165L19.7383%2026.8094L17.617%2024.6881L16.9099%2025.3952ZM19.0312%2026.8094L16.9099%2028.9307L17.617%2029.6378L19.7383%2027.5165L19.0312%2026.8094ZM17.617%2028.9307L15.4957%2026.8094L14.7886%2027.5165L16.9099%2029.6378L17.617%2028.9307ZM2.41421%2013.0208L1.70711%2012.3137L1%2013.0208L1.70711%2013.7279L2.41421%2013.0208ZM4.35876%2014.9654L3.65165%2015.6725L4.35876%2016.3796L5.06586%2015.6725L4.35876%2014.9654ZM5.06586%2014.2582L5.77297%2014.9654L6.48008%2014.2582L5.77297%2013.5511L5.06586%2014.2582ZM5.15425%2011.695L5.86136%2012.4021L6.56847%2011.695L5.86136%2010.9879L5.15425%2011.695ZM4.44715%2010.9879L5.15425%2010.2808L4.44715%209.57367L3.74004%2010.2808L4.44715%2010.9879ZM5.68458%209.75044L4.97748%209.04334L4.27037%209.75044L4.97748%2010.4576L5.68458%209.75044ZM6.39169%2010.4576L5.68458%2011.1647L6.39169%2011.8718L7.0988%2011.1647L6.39169%2010.4576ZM10.4576%206.39169L11.1647%207.09879L11.8718%206.39169L11.1647%205.68458L10.4576%206.39169ZM9.75045%205.68458L10.4576%204.97747L9.75045%204.27037L9.04334%204.97747L9.75045%205.68458ZM10.9879%204.44714L10.2808%203.74004L9.57367%204.44714L10.2808%205.15425L10.9879%204.44714ZM11.695%205.15425L10.9879%205.86136L11.695%206.56846L12.4021%205.86136L11.695%205.15425ZM14.2583%205.06586L13.5511%205.77297L14.2583%206.48008L14.9654%205.77297L14.2583%205.06586ZM14.9654%204.35875L15.6725%205.06586L16.3796%204.35875L15.6725%203.65165L14.9654%204.35875ZM13.0208%202.41421L13.7279%201.7071L13.0208%200.999998L12.3137%201.7071L13.0208%202.41421ZM16.026%205.41942L16.7331%204.71231L16.026%204.0052L15.3189%204.71231L16.026%205.41942ZM15.3189%206.12652L14.6118%205.41942L13.9047%206.12652L14.6118%206.83363L15.3189%206.12652ZM19.208%2010.0156L18.5009%2010.7227L19.208%2011.4298L19.9151%2010.7227L19.208%2010.0156ZM19.9151%209.3085L20.6222%2010.0156L21.3293%209.3085L20.6222%208.6014L19.9151%209.3085ZM20.9758%2010.3692L21.6829%209.66206L20.9758%208.95495L20.2687%209.66206L20.9758%2010.3692ZM20.2687%2011.0763L19.5616%2010.3692L18.8544%2011.0763L19.5616%2011.7834L20.2687%2011.0763ZM24.1577%2014.9654L23.4506%2015.6725L24.1577%2016.3796L24.8649%2015.6725L24.1577%2014.9654ZM24.8649%2014.2582L25.572%2014.9654L26.2791%2014.2582L25.572%2013.5511L24.8649%2014.2582ZM25.9255%2015.3189L26.6326%2014.6118L25.9255%2013.9047L25.2184%2014.6118L25.9255%2015.3189ZM25.2184%2016.026L24.5113%2015.3189L23.8042%2016.026L24.5113%2016.7331L25.2184%2016.026ZM25.13%2018.5893L24.4229%2017.8822L23.7158%2018.5893L24.4229%2019.2964L25.13%2018.5893ZM25.8371%2019.2964L25.13%2020.0035L25.8371%2020.7106L26.5442%2020.0035L25.8371%2019.2964ZM27.8701%2017.2635L28.5772%2017.9706L29.2843%2017.2635L28.5772%2016.5563L27.8701%2017.2635ZM24.5997%2020.5338L25.3068%2021.2409L26.0139%2020.5338L25.3068%2019.8267L24.5997%2020.5338ZM23.8926%2019.8267L24.5997%2019.1196L23.8926%2018.4125L23.1855%2019.1196L23.8926%2019.8267ZM19.8267%2023.8926L19.1196%2023.1855L18.4125%2023.8926L19.1196%2024.5997L19.8267%2023.8926ZM20.5338%2024.5997L19.8267%2025.3068L20.5338%2026.0139L21.2409%2025.3068L20.5338%2024.5997ZM19.2964%2025.8371L20.0035%2026.5442L20.7106%2025.8371L20.0035%2025.13L19.2964%2025.8371ZM18.5893%2025.13L19.2964%2024.4229L18.5893%2023.7158L17.8822%2024.4229L18.5893%2025.13ZM16.026%2025.2184L16.7331%2024.5113L16.026%2023.8042L15.3189%2024.5113L16.026%2025.2184ZM15.3189%2025.9255L14.6118%2025.2184L13.9047%2025.9255L14.6118%2026.6326L15.3189%2025.9255ZM17.2635%2027.8701L16.5563%2028.5772L17.2635%2029.2843L17.9706%2028.5772L17.2635%2027.8701ZM14.2583%2024.8649L13.5511%2025.572L14.2583%2026.2791L14.9654%2025.572L14.2583%2024.8649ZM14.9654%2024.1577L15.6725%2024.8649L16.3796%2024.1577L15.6725%2023.4506L14.9654%2024.1577ZM11.0763%2020.2687L11.7834%2019.5616L11.0763%2018.8544L10.3692%2019.5616L11.0763%2020.2687ZM10.3692%2020.9758L9.66206%2020.2687L8.95495%2020.9758L9.66206%2021.6829L10.3692%2020.9758ZM9.3085%2019.9151L8.6014%2020.6222L9.3085%2021.3293L10.0156%2020.6222L9.3085%2019.9151ZM10.0156%2019.208L10.7227%2019.9151L11.4298%2019.208L10.7227%2018.5009L10.0156%2019.208ZM6.12652%2015.3189L6.83363%2014.6118L6.12652%2013.9047L5.41942%2014.6118L6.12652%2015.3189ZM5.41942%2016.026L4.71231%2015.3189L4.0052%2016.026L4.71231%2016.7331L5.41942%2016.026ZM3.12132%2012.3137L3.82843%2011.6066L3.12132%2010.8995L2.41421%2011.6066L3.12132%2012.3137ZM3.12132%2013.7279L2.41421%2014.435L3.12132%2015.1421L3.82843%2014.435L3.12132%2013.7279ZM12.3137%203.12132L11.6066%202.41421L10.8995%203.12132L11.6066%203.82842L12.3137%203.12132ZM13.7279%203.12132L14.435%203.82842L15.1421%203.12132L14.435%202.41421L13.7279%203.12132ZM27.163%2016.5563L27.8701%2015.8492L27.163%2015.1421L26.4558%2015.8492L27.163%2016.5563ZM27.163%2017.9706L26.4558%2018.6777L27.163%2019.3848L27.8701%2018.6777L27.163%2017.9706ZM16.5563%2027.1629L15.8492%2026.4558L15.1421%2027.1629L15.8492%2027.8701L16.5563%2027.1629ZM17.9706%2027.1629L18.6777%2027.8701L19.3848%2027.1629L18.6777%2026.4558L17.9706%2027.1629ZM5.06586%2015.6725L5.77297%2014.9654L4.35876%2013.5511L3.65165%2014.2582L5.06586%2015.6725ZM5.86136%2010.9879L5.15425%2010.2808L3.74004%2011.695L4.44715%2012.4021L5.86136%2010.9879ZM4.97748%2010.4576L5.68458%2011.1647L7.0988%209.75044L6.39169%209.04334L4.97748%2010.4576ZM11.1647%205.68458L10.4576%204.97747L9.04334%206.39169L9.75045%207.09879L11.1647%205.68458ZM10.2808%205.15425L10.9879%205.86136L12.4021%204.44714L11.695%203.74004L10.2808%205.15425ZM14.9654%205.77297L15.6725%205.06586L14.2583%203.65165L13.5511%204.35875L14.9654%205.77297ZM15.3189%204.71231L14.6118%205.41942L16.026%206.83363L16.7331%206.12652L15.3189%204.71231ZM19.9151%2010.7227L20.6222%2010.0156L19.208%208.6014L18.5009%209.3085L19.9151%2010.7227ZM20.2687%209.66206L19.5616%2010.3692L20.9758%2011.7834L21.6829%2011.0763L20.2687%209.66206ZM24.8649%2015.6725L25.572%2014.9654L24.1577%2013.5511L23.4506%2014.2582L24.8649%2015.6725ZM25.2184%2014.6118L24.5113%2015.3189L25.9255%2016.7331L26.6326%2016.026L25.2184%2014.6118ZM24.4229%2019.2964L25.13%2020.0035L26.5442%2018.5893L25.8371%2017.8822L24.4229%2019.2964ZM25.3068%2019.8267L24.5997%2019.1196L23.1855%2020.5338L23.8926%2021.2409L25.3068%2019.8267ZM19.1196%2024.5997L19.8267%2025.3068L21.2409%2023.8926L20.5338%2023.1855L19.1196%2024.5997ZM20.0035%2025.13L19.2964%2024.4229L17.8822%2025.8371L18.5893%2026.5442L20.0035%2025.13ZM15.3189%2024.5113L14.6118%2025.2184L16.026%2026.6326L16.7331%2025.9255L15.3189%2024.5113ZM14.9654%2025.572L15.6725%2024.8649L14.2583%2023.4506L13.5511%2024.1577L14.9654%2025.572ZM10.3692%2019.5616L9.66206%2020.2687L11.0763%2021.6829L11.7834%2020.9758L10.3692%2019.5616ZM10.0156%2020.6222L10.7227%2019.9151L9.3085%2018.5009L8.6014%2019.208L10.0156%2020.6222ZM5.41942%2014.6118L4.71231%2015.3189L6.12652%2016.7331L6.83363%2016.026L5.41942%2014.6118ZM3.12132%2013.7279L5.15425%2011.695L3.74004%2010.2808L1.70711%2012.3137L3.12132%2013.7279ZM5.06586%2014.2582L3.12132%2012.3137L1.70711%2013.7279L3.65165%2015.6725L5.06586%2014.2582ZM5.77297%2013.5511L4.53553%2012.3137L3.12132%2013.7279L4.35876%2014.9654L5.77297%2013.5511ZM4.53553%2013.7279L5.86136%2012.4021L4.44715%2010.9879L3.12132%2012.3137L4.53553%2013.7279ZM7.0988%2011.1647L11.1647%207.09879L9.75045%205.68458L5.68458%209.75044L7.0988%2011.1647ZM6.39169%2010.4576L10.4576%206.39169L9.04334%204.97747L4.97748%209.04334L6.39169%2010.4576ZM12.4021%205.86136L13.7279%204.53553L12.3137%203.12132L10.9879%204.44714L12.4021%205.86136ZM12.3137%204.53553L13.5511%205.77297L14.9654%204.35875L13.7279%203.12132L12.3137%204.53553ZM12.3137%203.12132L14.2583%205.06586L15.6725%203.65165L13.7279%201.7071L12.3137%203.12132ZM11.695%205.15425L13.7279%203.12132L12.3137%201.7071L10.2808%203.74004L11.695%205.15425ZM14.6118%206.83363L18.5009%2010.7227L19.9151%209.3085L16.026%205.41942L14.6118%206.83363ZM15.3189%206.12652L19.208%2010.0156L20.6222%208.6014L16.7331%204.71231L15.3189%206.12652ZM19.5616%2011.7834L23.4506%2015.6725L24.8649%2014.2582L20.9758%2010.3692L19.5616%2011.7834ZM20.2687%2011.0763L24.1577%2014.9654L25.572%2013.5511L21.6829%209.66206L20.2687%2011.0763ZM24.5113%2016.7331L25.7487%2017.9706L27.163%2016.5563L25.9255%2015.3189L24.5113%2016.7331ZM25.7487%2016.5563L24.4229%2017.8822L25.8371%2019.2964L27.163%2017.9706L25.7487%2016.5563ZM27.163%2016.5563L25.13%2018.5893L26.5442%2020.0035L28.5772%2017.9706L27.163%2016.5563ZM25.2184%2016.026L27.163%2017.9706L28.5772%2016.5563L26.6326%2014.6118L25.2184%2016.026ZM23.1855%2019.1196L19.1196%2023.1855L20.5338%2024.5997L24.5997%2020.5338L23.1855%2019.1196ZM23.8926%2019.8267L19.8267%2023.8926L21.2409%2025.3068L25.3068%2021.2409L23.8926%2019.8267ZM17.8822%2024.4229L16.5563%2025.7487L17.9706%2027.1629L19.2964%2025.8371L17.8822%2024.4229ZM17.9706%2025.7487L16.7331%2024.5113L15.3189%2025.9255L16.5563%2027.1629L17.9706%2025.7487ZM17.9706%2027.1629L16.026%2025.2184L14.6118%2026.6326L16.5563%2028.5772L17.9706%2027.1629ZM18.5893%2025.13L16.5563%2027.1629L17.9706%2028.5772L20.0035%2026.5442L18.5893%2025.13ZM15.6725%2023.4506L11.7834%2019.5616L10.3692%2020.9758L14.2583%2024.8649L15.6725%2023.4506ZM14.9654%2024.1577L11.0763%2020.2687L9.66206%2021.6829L13.5511%2025.572L14.9654%2024.1577ZM10.7227%2018.5009L6.83363%2014.6118L5.41942%2016.026L9.3085%2019.9151L10.7227%2018.5009ZM10.0156%2019.208L6.12652%2015.3189L4.71231%2016.7331L8.6014%2020.6222L10.0156%2019.208ZM3.12132%2013.7279L3.82843%2013.0208L2.41421%2011.6066L1.70711%2012.3137L3.12132%2013.7279ZM3.82843%2013.0208L3.12132%2012.3137L1.70711%2013.7279L2.41421%2014.435L3.82843%2013.0208ZM3.12132%2012.3137L2.41421%2013.0208L3.82843%2014.435L4.53553%2013.7279L3.12132%2012.3137ZM2.41421%2013.0208L3.12132%2013.7279L4.53553%2012.3137L3.82843%2011.6066L2.41421%2013.0208ZM13.0208%203.82842L13.7279%203.12132L12.3137%201.7071L11.6066%202.41421L13.0208%203.82842ZM13.7279%203.12132L13.0208%202.41421L11.6066%203.82842L12.3137%204.53553L13.7279%203.12132ZM13.0208%202.41421L12.3137%203.12132L13.7279%204.53553L14.435%203.82842L13.0208%202.41421ZM12.3137%203.12132L13.0208%203.82842L14.435%202.41421L13.7279%201.7071L12.3137%203.12132ZM27.163%2017.9706L27.8701%2017.2635L26.4558%2015.8492L25.7487%2016.5563L27.163%2017.9706ZM27.8701%2017.2635L27.163%2016.5563L25.7487%2017.9706L26.4558%2018.6777L27.8701%2017.2635ZM27.163%2016.5563L26.4558%2017.2635L27.8701%2018.6777L28.5772%2017.9706L27.163%2016.5563ZM26.4558%2017.2635L27.163%2017.9706L28.5772%2016.5563L27.8701%2015.8492L26.4558%2017.2635ZM17.2635%2027.8701L17.9706%2027.1629L16.5563%2025.7487L15.8492%2026.4558L17.2635%2027.8701ZM17.9706%2027.1629L17.2635%2026.4558L15.8492%2027.8701L16.5563%2028.5772L17.9706%2027.1629ZM17.2635%2026.4558L16.5563%2027.1629L17.9706%2028.5772L18.6777%2027.8701L17.2635%2026.4558ZM16.5563%2027.1629L17.2635%2027.8701L18.6777%2026.4558L17.9706%2025.7487L16.5563%2027.1629Z'%20fill='white'%20mask='url(%23path-3-outside-1_1838_531)'/%3e%3c/svg%3e"}}},uSt={name:"anchor-synchronization",i18n:{de:Tj,en:Lj,es:Rj,fr:_j,it:Fj},i18nTokenPrefix:"viewer2d-background",addToWindows:["2d"],component:Dj,anchorSynchronization:!0,button:{tooltip:"viewer2d-background.tooltip-anchor-synchronization",position:"right",content:"free",keepOpen:!0,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.41394%209.62621L11.4418%2013.8807L18.5438%209.5459L21.4788%2011.2012L11.4522%2017.3112L1.47266%2011.2795L4.41394%209.62621Z'%20fill='%232F374A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11.4418%2017.9342L4.41439%2013.6799L1.47266%2015.3335L11.4522%2021.3651L21.4788%2015.2552L18.5433%2013.5996L11.4418%2017.9342ZM18.5621%2014.6894L11.4438%2019.0342L4.39683%2014.7681L3.33862%2015.3629L11.4502%2020.2656L19.621%2015.2865L18.5621%2014.6894Z'%20fill='%232F374A'/%3e%3crect%20x='17.7969'%20width='5.07596'%20height='1.00266'%20fill='%232F374A'/%3e%3crect%20x='22.873'%20width='5.07596'%20height='1.00266'%20transform='rotate(90%2022.873%200)'%20fill='%232F374A'/%3e%3crect%20x='22.873'%20y='17.9229'%20width='5.07596'%20height='1.00266'%20transform='rotate(90%2022.873%2017.9229)'%20fill='%232F374A'/%3e%3crect%20x='22.873'%20y='23'%20width='5.07596'%20height='1.00266'%20transform='rotate(-180%2022.873%2023)'%20fill='%232F374A'/%3e%3crect%20width='5.07596'%20height='1.00266'%20transform='matrix(-1%200%200%201%205.07617%200)'%20fill='%232F374A'/%3e%3crect%20width='5.07596'%20height='1.00266'%20transform='matrix(4.37114e-08%201%201%20-4.37114e-08%200%200)'%20fill='%232F374A'/%3e%3crect%20width='5.07596'%20height='1.00266'%20transform='matrix(4.37114e-08%201%201%20-4.37114e-08%200%2017.9229)'%20fill='%232F374A'/%3e%3crect%20width='5.07596'%20height='1.00266'%20transform='matrix(1%20-8.74228e-08%20-8.74228e-08%20-1%200%2023)'%20fill='%232F374A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9.39866%202.7199L11.5619%201.50391L13.5913%202.64842L11.4369%203.89253L9.39866%202.7199ZM8.62875%203.15267L6.70871%204.23195L8.78367%205.42476L10.6773%204.33121L8.62875%203.15267ZM5.9388%204.66472L4.10291%205.6967L6.21181%206.90997L8.02403%205.86344L5.9388%204.66472ZM3.33301%206.12947L1.47266%207.1752L3.56388%208.43912L5.45218%207.34865L3.33301%206.12947ZM4.27628%208.8697L6.10371%209.97419L8.05507%208.84612L6.18256%207.76885L4.27628%208.8697ZM6.8161%2010.4048L8.69738%2011.5418L10.7132%2010.3754L8.78542%209.2663L6.8161%2010.4048ZM9.40976%2011.9723L11.4522%2013.2068L13.4834%2011.9691L11.4435%2010.7955L9.40976%2011.9723ZM14.2226%2011.5186L15.989%2010.4422L14.0152%209.3075L12.2024%2010.3564L14.2226%2011.5186ZM16.7282%209.99177L18.5679%208.87073L16.6635%207.77511L14.7741%208.86839L16.7282%209.99177ZM19.3071%208.42029L21.4788%207.09686L19.6339%206.05634L17.4224%207.336L19.3071%208.42029ZM18.8963%205.64036L16.9533%204.54452L14.767%205.80837L16.692%206.91583L18.8963%205.64036ZM16.2157%204.12853L14.3289%203.06443L12.1673%204.31273L14.0367%205.38819L16.2157%204.12853ZM14.0078%206.24727L15.9331%207.35494L14.0434%208.44839L12.1165%207.34065L14.0078%206.24727ZM11.3572%207.77956L13.2846%208.8875L11.4721%209.93625L9.54466%208.82739L11.3572%207.77956ZM8.8143%208.40721L10.6266%207.35954L8.75469%206.28347L6.94219%207.33017L8.8143%208.40721ZM11.3858%206.92063L13.2774%205.8271L11.4077%204.7514L9.51433%205.84479L11.3858%206.92063Z'%20fill='%232F374A'/%3e%3c/svg%3e"}}},ASt={},hSt={width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function pSt(e,t){return k(),N("svg",hSt,[...t[0]||=[Sn('<path fill-rule="evenodd" clip-rule="evenodd" d="M3.28121 7.15444L8.50434 10.3164L13.7826 7.09473L15.964 8.325L8.51215 12.866L1.09521 8.38321L3.28121 7.15444Z" fill="#2F374A"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.50364 13.3289L3.28081 10.1671L1.09448 11.3961L8.51142 15.8788L15.9633 11.3379L13.7816 10.1074L8.50364 13.3289ZM13.7956 10.9174L8.50513 14.1465L3.26776 10.9759L2.48129 11.418L8.50993 15.0616L14.5825 11.3612L13.7956 10.9174Z" fill="#2F374A"></path><rect x="13.2275" width="3.77251" height="0.745187" fill="#2F374A"></rect><rect x="16.9998" width="3.77251" height="0.745187" transform="rotate(90 16.9998 0)" fill="#2F374A"></rect><rect x="17" y="13.3203" width="3.77251" height="0.745187" transform="rotate(90 17 13.3203)" fill="#2F374A"></rect><rect x="16.9998" y="17.0938" width="3.77251" height="0.745187" transform="rotate(-180 16.9998 17.0938)" fill="#2F374A"></rect><rect width="3.77251" height="0.745187" transform="matrix(-1 0 0 1 3.77246 0)" fill="#2F374A"></rect><rect width="3.77251" height="0.745187" transform="matrix(4.37114e-08 1 1 -4.37114e-08 0 0)" fill="#2F374A"></rect><rect width="3.77251" height="0.745187" transform="matrix(4.37114e-08 1 1 -4.37114e-08 0.000244141 13.3203)" fill="#2F374A"></rect><rect width="3.77251" height="0.745187" transform="matrix(1 -8.74228e-08 -8.74228e-08 -1 0.000244141 17.0938)" fill="#2F374A"></rect><path fill-rule="evenodd" clip-rule="evenodd" d="M6.9851 2.02194L8.59292 1.11816L10.1013 1.96887L8.50013 2.89355L6.9851 2.02194ZM6.4129 2.34358L4.986 3.14566L6.52829 4.03226L7.93556 3.21958L6.4129 2.34358ZM4.4138 3.4673L3.04956 4.23416L4.61708 5.13596L5.96372 4.35829L4.4138 3.4673ZM2.47736 4.5558L1.09448 5.33313L2.64886 6.27259L4.05251 5.46199L2.47736 4.5558ZM3.17832 6.59259L4.53651 7.41348L5.98703 6.57494L4.59533 5.77429L3.17832 6.59259ZM5.06597 7.73348L6.46392 8.57839L7.96234 7.71136L6.52984 6.88722L5.06597 7.73348ZM6.99336 8.89839L8.51142 9.81589L10.0212 8.89585L8.50513 8.02363L6.99336 8.89839ZM10.5706 8.56108L11.8832 7.76118L10.4162 6.91783L9.06914 7.69728L10.5706 8.56108ZM12.4326 7.42641L13.7998 6.59331L12.3843 5.779L10.9802 6.59148L12.4326 7.42641ZM14.3491 6.25853L15.9633 5.27491L14.592 4.50155L12.9483 5.45264L14.3491 6.25853ZM14.0439 4.19239L12.6 3.37809L10.9751 4.31743L12.4056 5.14037L14.0439 4.19239ZM12.0518 3.06892L10.6495 2.27805L9.04295 3.20584L10.4323 4.00515L12.0518 3.06892ZM10.4108 4.64363L11.8415 5.46672L10.4372 6.27933L9.00528 5.45618L10.4108 4.64363ZM8.44101 5.78238L9.87318 6.60568L8.52635 7.385L7.09411 6.56102L8.44101 5.78238ZM6.5513 6.24874L7.89799 5.47022L6.50676 4.67046L5.1599 5.44826L6.5513 6.24874ZM8.46227 5.14402L9.86804 4.33135L8.47838 3.53187L7.07133 4.34443L8.46227 5.14402Z" fill="#2F374A"></path>',11)]])}var fSt=Q(ASt,[["render",pSt]]),gSt={class:"bimdata-anchor-synchronization__header"},mSt={class:"bimdata-anchor-synchronization__header__texts"},vSt={class:"bimdata-anchor-synchronization__header__texts__title"},ySt={class:"bimdata-anchor-synchronization__header__buttons"},wSt=Q({__name:"AnchorSynchronizationHeader",setup(e){let t=bt("$viewer"),i=bt("state"),o=bt("service"),r=je(()=>i.allAnchorsValidated),n=pe(!1),a=null;t.globalContext.hub.once("anchor-synchronization:open",(c=null)=>{a=c},{getLastEvent:!0});let s=()=>{t.globalContext.layout=a},l=async()=>{n.value=!0,await o.saveAnchors(),t.globalContext.layout=a};return(c,d)=>{let u=I("BIMDataButton"),A=I("BIMDataSpinner");return k(),N("div",gSt,[w("div",mSt,[T(fSt,{class:"m-x-6"}),w("span",vSt,G(c.$t("anchor-synchronization-window.title")),1)]),w("div",ySt,[T(u,{color:"high",fill:"",radius:"",class:"m-x-6",width:"120px",onClick:s},{default:j(()=>[nt(G(c.$t("global.cancel")),1)]),_:1}),T(u,{color:"primary",fill:"",radius:"",class:"m-x-6",width:"120px",disabled:!r.value,onClick:l},{default:j(()=>[n.value?(k(),W(A,{key:0})):(k(),N(ut,{key:1},[nt(G(c.$t("global.done")),1)],64))]),_:1},8,["disabled"])])])}}},[["__scopeId","data-v-a7ce6c34"]]),bSt={class:"anchor-content"},CSt={class:"anchor-label"},j8={__name:"Anchor",props:{position:{type:Object,default:null},isSecondAnchor:{type:Boolean,default:!1},color:{type:String,default:"#FF9100"}},emits:["change","validate"],setup(e,{emit:t}){let i=e,o={x:i.isSecondAnchor?"70px":"20px",y:"90%"},r=je(()=>i.position?{x:i.position.x+"px",y:i.position.y+"px"}:o),n=t,a=pe(!1),s=pe(null);function l(u){a.value=!0,s.value?.setPointerCapture(u.pointerId),u.preventDefault()}function c(u){if(!a.value)return;let A=i.position;if(!A){let{x:h,y:p}=s.value.getBoundingClientRect(),{x:f,y:m}=s.value.parentElement.getBoundingClientRect();A={x:h-f+15,y:p-m+51}}n("change",{x:A.x+u.movementX,y:A.y+u.movementY})}function d(u){a.value&&s.value&&s.value?.releasePointerCapture(u.pointerId),a.value=!1,n("validate")}return $i(()=>{a.value=!1}),(u,A)=>(k(),N("div",{class:"bimdata-anchor-synchronization__anchor",style:ve({left:r.value.x,top:r.value.y,color:e.color,cursor:a.value?"none":"grab"}),onPointerdown:l,onPointermove:c,onPointerup:d,ref_key:"anchorElement",ref:s},[w("div",bSt,[A[0]||=w("svg",{width:"30",height:"60",viewBox:"0 0 30 60",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[w("rect",{x:"14",y:"42",width:"2",height:"18",fill:"currentColor"}),w("rect",{x:"24",y:"50",width:"2",height:"18",transform:"rotate(90 24 50)",fill:"currentColor"}),w("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0 14.3929C0 6.43566 6.70714 0 15 0C23.2929 0 30 6.43566 30 14.3929C30 25.1875 15 41.1224 15 41.1224C15 41.1224 0 25.1875 0 14.3929ZM9.64274 14.3932C9.64274 17.2307 12.0427 19.5335 14.9999 19.5335C17.957 19.5335 20.357 17.2307 20.357 14.3932C20.357 11.5558 17.957 9.25293 14.9999 9.25293C12.0427 9.25293 9.64274 11.5558 9.64274 14.3932Z",fill:"currentColor"})],-1),w("div",CSt,G(e.isSecondAnchor?2:1),1)])],36))}},j$=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2}),Q$=(e,t)=>Math.hypot(t.x-e.x,t.y-e.y),z$=(e,t)=>Math.atan2(t.y-e.y,t.x-e.x),xSt=(e,t)=>({x:e.x*Math.cos(t)-e.y*Math.sin(t),y:e.x*Math.sin(t)+e.y*Math.cos(t)});function q$(e){let{anchorA1Position:t,anchorA2Position:i,anchorB1Position:o,anchorB2Position:r,model:n,modelToSynchronize:a}=e;if(!n||!a)throw Error("[BIMDataViewer - AnchorSynchronization] Models are mandatory to calculate transform.");let{translate:s,rotate:l,scale:c}=a.transform??QV.IDENTITY,d=Q$(t,i)/Q$(o,r)*c,u=z$(t,i),A=(z$(o,r)-u)*(180/Math.PI)*-1,h=l+A,p=j$(t,i),f=j$(o,r),m=xSt({x:f.x-s[0],y:f.y-s[1]},A*Math.PI/180),g={x:m.x/c*d,y:m.y/c*d};return{scale:d,rotate:h,translate:[p.x-g.x,p.y-g.y,0]}}var BSt={class:"bimdata-viewer-ifc-2d",ref:"canvasContainer"},kSt=Q({__name:"ViewerIfc2D",props:{model:{type:Object,default:null},storeyIndex:{type:Number,default:0}},emits:["camera-update"],setup(e,{expose:t,emit:i}){let o=e,r=i,n=bt("$viewer"),a=bt("state"),s=pe(null),l=null,c=null,d=null,{promise:u,resolve:A,reject:h}=Promise.withResolvers(),p=()=>{c=d1({canvas:s.value}),c.styles.default.lineWidth=.01,c.settings.rotateSpeed=.05,c.settings.snapMargin=.04,c.settings.minScale=10,c.textureManager.textureMatrix.scale(.01,.01);let{camera:y}=c;y.on("update",()=>{r("camera-update",y)});let v={engine:c,viewer:c,$viewer:n};l=R5(v),d=new EB(v)};Di(()=>{try{p()}catch(y){h(y)}A()});let f=(y,v)=>{let C=y.storeys[v];if(!C)return;let x=C.objects.map(B=>String(B.id));c.scene.showObjects(x)},m=async y=>{await u,await l(y.map_file,y.id);let v=c.scene.objects.map(C=>C.id);if(c.scene.hideObjects(v),f(y,o.storeyIndex),y.recommanded_2d_angle!==void 0){let C=c.camera.rotation;c.camera.rotate(-C-y.recommanded_2d_angle)}c.camera.fitView()};xt(()=>o.model,async y=>{y&&await m(y)},{immediate:!0});let g=!1;return t({getWorldPosition(y){return c.camera.getPosition(y)},get canvas(){return s.value},async showPlan(y){if(g)return;let v=await d.showPlan(y),C=v.mask?.crop_path,x={opacity:.5,crop_path:C};v.tempMask=x,g=!0;let B={translate:[v.x,v.y],scale:v.scale,rotate:v.angle},{anchorA1Position:E,anchorA2Position:D,anchorB1Position:P,anchorB2Position:M}=Ef(a);xt([E,D,P,M],()=>{let R=q$(a);C?.length>0&&(x.crop_path=Rg(Rg(C,B,{inverse:!0}),R)),v.x=R.translate[0],v.y=R.translate[1],v.scale=R.scale,v.angle=R.rotate},{immediate:!0})}}),(y,v)=>(k(),N("div",BSt,[w("canvas",{ref_key:"canvasElement",ref:s,style:{width:"100%",height:"100%",position:"absolute"}},null,512)],512))}},[["__scopeId","data-v-c0725497"]]),ESt={__name:"ViewerImage",props:{model:{type:Object,default:null}},emits:["camera-update"],setup(e,{expose:t,emit:i}){let o=e,r=i,n=()=>{let{camera:d}=a.value.viewer;d.on("update",()=>{r("camera-update",d)})},a=pe(null),{promise:s,resolve:l}=Promise.withResolvers();xt(()=>o.model,async d=>{await s,d&&(a.value.loadModels([d]),a.value.viewer.renderer.offset.dx===0&&a.value.viewer.renderer.offset.dy===0&&(a.value.viewer.renderer.offset={dx:-d.transform.translate[0],dy:-d.transform.translate[1]}))},{immediate:!0}),Di(()=>{l()});let c=ko({get loadedModels(){return o.model?[o.model]:[]},get selectedStorey(){return null}});return t({getWorldPosition(d){return a.value.engine.camera.getPosition(d)},get canvas(){return a.value.engine.canvas}}),(d,u)=>(k(),W(Th,{ref_key:"viewerPlan",ref:a,stateContext:c,onMounted:n},null,8,["stateContext"]))}},MSt={class:"bimdata-anchor-synchronization__viewer"},PSt={class:"viewer-container-A"},ISt={class:"viewer-container-B"},SSt=Q({__name:"AnchorSynchronizationViewer",setup(e,{expose:t}){let i=pe(null),o=pe(null),r=bt("state"),n=(C,x)=>{x.preventDefault();let B=C==="A"?i.value:o.value;B&&_B(B.canvas)(x)},a=pe(null),s=pe(null),l=pe(null),c=pe(null),d={anchorA1Position:a,anchorA2Position:s,anchorB1Position:l,anchorB2Position:c},u=(C,x)=>{(C==="A"?["anchorA1Position","anchorA2Position"].filter(B=>d[B].value!==null):["anchorB1Position","anchorB2Position"].filter(B=>d[B].value!==null)).forEach(B=>{let E=r[B];d[B].value=x.getCanvasPosition(E)})},A=(C,x)=>{let B=C.startsWith("A")?i.value:o.value,E=`anchor${C}Position`;r[E]=B.getWorldPosition(x),d[E].value=x},h=Ui(null),p=pe(0),f=Ui(null),m=xt(()=>r.allAnchorsValidated,C=>{if(!C)return;let x={plan:f.value,storey:{}};i.value.showPlan(x),m()}),g=C=>{if(!C)return null;let x=C.type;switch(x){case"IFC":return kSt;case"PNG":case"JPEG":case"PDF":case"PHOTOSPHERE":return ESt;default:throw Error(`[BIMData AnchorSynchronizationViewer] Unsupported model type: ${x}`)}},y=async(C,x,B)=>{h.value=C;let E=C.storeys.findIndex(D=>D.uuid===x.uuid);if(E===-1)throw Error("[BIMData AnchorSynchronizationViewer] Storey not found in main model.");p.value=E,f.value=B},v=()=>{r.allAnchorsValidated||a.value&&s.value&&l.value&&c.value&&(r.allAnchorsValidated=!0)};return t({synchronize:y}),(C,x)=>(k(),N("div",MSt,[w("div",PSt,[(k(),W(qr(g(h.value)??"div"),{model:h.value,ref_key:"viewerA",ref:i,onCameraUpdate:x[0]||=B=>u("A",B),storeyIndex:p.value},null,40,["model","storeyIndex"])),h.value?(k(),N(ut,{key:0},[T(j8,{onChange:x[1]||=B=>A("A1",B),onValidate:v,position:a.value,onWheel:x[2]||=B=>n("A",B)},null,8,["position"]),T(j8,{onChange:x[3]||=B=>A("A2",B),onValidate:v,position:s.value,onWheel:x[4]||=B=>n("A",B),isSecondAnchor:!0},null,8,["position"])],64)):le("",!0)]),w("div",ISt,[(k(),W(qr(g(f.value)??"div"),{model:f.value,ref_key:"viewerB",ref:o,onCameraUpdate:x[5]||=B=>u("B",B)},null,40,["model"])),f.value?(k(),N(ut,{key:0},[T(j8,{onChange:x[6]||=B=>A("B1",B),onValidate:v,position:l.value,onWheel:x[7]||=B=>n("B",B)},null,8,["position"]),T(j8,{onChange:x[8]||=B=>A("B2",B),onValidate:v,position:c.value,onWheel:x[9]||=B=>n("B",B),isSecondAnchor:!0},null,8,["position"])],64)):le("",!0)])]))}},[["__scopeId","data-v-3947e679"]]),DSt=class{state;$viewer;constructor(e,t){this.$viewer=e,this.state=t}async saveAnchors(){let{state:e}=this.$viewer,{model:t,storey:i,modelToSynchronize:o}=this.state;if(!t||!o||!i)throw Error("[BIMDataViewer - AnchorSynchronization] Models and storey are mandatory to save anchors.");let r=q$(this.state),n=i.plans.find(a=>a.plan.id===o.id);try{if(n){let a={...o.transform};n.plan.transform=r,await e.updatePlan(n,a)}else await e.createPlan(t,i,o.document,r)}catch(a){throw console.error("[BIMDataViewer - Anchor Synchronization Service] Failed to save anchors:",a),a}}},TSt=class{model=null;storey=null;modelToSynchronize=null;anchorA1Position=null;anchorA2Position=null;anchorB1Position=null;anchorB2Position=null;allAnchorsValidated=!1;constructor(){return ko(this)}},LSt={components:{AnchorSynchronizationHeader:wSt,AnchorSynchronizationViewer:SSt},setup(){let e=pe(null),t=new TSt;return pr("state",t),pr("service",new DSt(bt("$viewer"),t)),{viewer:e,synchronize:(i,o,r)=>(t.model=i,t.storey=o,t.modelToSynchronize=r,e.value.synchronize(i,o,r)),positioned:pe(!1)}}},RSt={class:"bimdata-anchor-synchronization"};function _St(e,t,i,o,r,n){let a=I("AnchorSynchronizationHeader"),s=I("AnchorSynchronizationViewer");return k(),N("div",RSt,[T(a,{valid:o.positioned},null,8,["valid"]),T(s,{class:"bimdata-anchor-synchronization__content__viewer",ref:"viewer",onPositioned:t[0]||=l=>o.positioned=!0})])}var FSt={name:"anchor-synchronization-window",i18n:{en:{title:"Synchronization"},fr:{title:"Synchronisation"}},component:Q(LSt,[["render",_St],["__scopeId","data-v-7f15ad3b"]]),window:{name:"anchor-synchronization",header:!1,displayedInWindowSelector:!1,multiModel:!1}},USt={name:"PointCloudViewer",components:{Annotations:OW},data(){let{settings:e}=this.$plugin;return{settings:e,canvasId:null,spinnerCanvasId:null,xeokitCreated:!1,loadedModels:[],tilesets:new Map,sensitivity:200,fov:90,annotationMode:!1,modelHeaderShown:e.modelLoader!=="hidden",navCubeVisible:e.navCube!==!1,loading:!1}},watch:{sensitivity(e){this.tilesetLoaderPlugin&&(this.tilesetLoaderPlugin.sensitivity=e)},fov(e){this.xeokit.camera.perspective.fov=e}},created(){this.spinnerCanvasId=`spinner-canvas-id-${this.$viewer.localContext.id}-${this.$viewer.instanceId}`,this.xeokitSdk=Md},mounted(){let e=new wJ({canvasElement:this.$refs["bimdata-xeokit-canvas"],transparent:!0,spinnerElementId:this.spinnerCanvasId,backgroundColorFromAmbientLight:!1});e.cameraControl.doublePickFlyTo=!1,e.cameraControl.panRightClick=!1,e.cameraControl.followPointer=!0,e.cameraControl.smartPivot=!0,this.settings.pivotMarker!==!1&&e.cameraControl.enablePivotSphere({size:1,color:[.25,.25,.25]}),e.cameraControl.touchDollyRate=1,e.cameraControl.mouseWheelDollyRate=60,e.cameraControl.keyboardDollyRate=20,e.cameraControl.dragRotationRate=450,e.cameraControl.rotationInertia=0,e.cameraControl.dollyInertia=0,e.camera.perspective.near=.1,e.camera.perspective.far=1e3,e.camera.ortho.near=.1,e.camera.ortho.far=1e3,this.bcfViewpointsPlugin=new q6(e,{originatingSystem:"BIMDataViewer/v1.0",authoringTool:"BIMData.io"}),this.distanceMeasurementsPlugin=new MJ(e,{defaultAxisVisible:!1,container:this.$el,zIndex:0}),this.angleMeasurementsPlugin=new N6(e,{container:this.$el,zIndex:0}),this.tilesetLoaderPlugin=new FW(e,{sensitivity:this.sensitivity,debugMode:!1}),this.navCubeVisible&&(this.navCube=new ZM(e,{canvasElement:this.$refs["bimdata-xeokit-navcube-canvas"],visible:!1,cameraFly:!0,cameraFitFOV:45,cameraFlyDuration:.5,color:"#FFFFFF"})),this.xeokit=e,this.xeokitCreated=!0,window.xeokitPointCloud=this.xeokit},beforeUnmount(){this.xeokit?.destroy()},methods:{async loadModels(e){this.loading=!0,this.loadedModels.push(...e.filter(n=>!this.loadedModels.some(a=>a.id===n.id)));let{apiUrl:t,cloudId:i,projectId:o,accessToken:r}=this.$viewer.api;e.forEach(async(n,a)=>{try{this.$viewer.localContext.loadingProcessStart();let s=await(await fetch(`${t}/cloud/${i}/project/${o}/model/${n.id}/tileset?tile_format=xkt`,{headers:new Headers({Authorization:`Bearer ${r}`})})).json();s.name=String(n.id);let l=this.tilesetLoaderPlugin.load(s);this.tilesets.set(n,l);let c={model:n,plugin:this};this.$viewer.localContext.hub.emit("pointcloud-model-loaded",c),this.$viewer.globalContext.hub.emit("pointcloud-model-loaded",c),a===0&&!this.viewpointPending&&this.xeokit.cameraFlight.flyTo()}catch(s){console.error("Error while loading Tileset ",n.id,"with error: ",s),this.loadedModels=this.loadedModels.filter(l=>l.id!==n.id)}finally{this.$viewer.localContext.loadingProcessEnd(),this.loading=!1}}),this.loadedModels.length>0&&this.navCube?.setVisible(!0)},unloadModels(e){let t=e.map(i=>this.tilesets.get(i)).filter(Boolean);e.forEach(i=>this.tilesets.delete(i)),t.forEach(i=>i.destroy()),this.loadedModels=this.loadedModels.filter(i=>!e.find(o=>o.id===i.id)),e.forEach(i=>{let o={model:i,plugin:this};this.$viewer.localContext.hub.emit("pointcloud-model-unloaded",o),this.$viewer.globalContext.hub.emit("pointcloud-model-unloaded",o)}),this.loadedModels.length===0&&this.navCube?.setVisible(!1)},fitView(){this.xeokit.cameraFlight.flyTo()},async getSnapshot(){return{snapshot_type:"png",snapshot_data:await this.xeokit.getSnapshotWithPlugins({format:"png"})}},getViewpoint(){let e=this.bcfViewpointsPlugin.getViewpoint({snapshot:!1});return e.order=2,e.originating_system="pointCloud",e.models=this.$viewer.localContext.loadedModels.map(t=>t.id),e},async setViewpoint(e,{immediate:t=!1,duration:i=.3}={}){if(this.loading){this.viewpointPending=!0;let o=null;await new Promise(r=>{o=this.$watch("loading",n=>{n||r()},{immediate:!0})}),o(),this.viewpointPending=!1}await new Promise(o=>setTimeout(o,200)),this.bcfViewpointsPlugin.setViewpoint(e,{rayCast:!1,immediate:t,duration:i})},startAnnotationMode(e){if(this.annotationMode)return;this.annotationMode=!0;let t=this.xeokit.scene.canvas.canvas;this.canvasCursor=t.style.cursor,t.style.cursor="copy",this.annotationListener=this.xeokit.scene.input.on("mouseclicked",i=>{let o=this.xeokit.scene.pick({pickSurface:!0,canvasPos:i});if(o){let[r,n,a]=o.worldPos;e({x:r,y:a,z:n,models:this.$viewer.localContext.loadedModels})}})},stopAnnotationMode(){this.annotationMode&&(this.annotationMode=!1,this.xeokit.scene.canvas.canvas.style.cursor=this.canvasCursor,this.xeokit.scene.input.off(this.annotationListener))},showUI(){this.modelHeaderShown=this.settings.modelLoader!=="hidden",this.navCubeVisible=this.settings.navCube!==!1},hideUI(){this.modelHeaderShown=!1,this.navCubeVisible=!1}}},OSt={class:"bimdata-viewer-point-cloud"},NSt={ref:"header",class:"bimdata-viewer-point-cloud__header"},HSt={ref:"bimdata-xeokit-navcube-canvas",class:"bimdata-viewer-point-cloud__nav-cube"},VSt=["id"];function jSt(e,t,i,o,r,n){let a=I("NoModelWindowPlaceHolder"),s=I("ModelsLoader"),l=I("Annotations");return k(),N("div",OSt,[r.loadedModels.length===0?(k(),W(a,{key:0})):le("",!0),w("div",NSt,[r.settings.modelLoader==="disabled"?le("",!0):Tt((k(),W(s,{key:0,"window-positioning":!1,preview:""},null,512)),[[ui,r.modelHeaderShown]])],512),w("canvas",{ref:"bimdata-xeokit-canvas",class:"bimdata-viewer-point-cloud__viewer",onWheel:t[0]||=Dt(()=>{},["prevent"])},null,544),r.xeokitCreated?(k(),W(l,{key:1})):le("",!0),Tt(w("canvas",HSt,null,512),[[ui,r.navCubeVisible]]),w("div",{id:r.spinnerCanvasId},null,8,VSt)])}var QSt={name:"pointCloud",isViewer:!0,component:Q(USt,[["render",jSt],["__scopeId","data-v-b7df122c"]]),window:{name:"pointCloud",label:"pointCloud.window_label",header:!1,logoAndVersion:!0,plugins:["fullscreen","measure3d"],icon:{imgUri:"data:image/svg+xml,%3csvg%20width='29'%20height='28'%20viewBox='0%200%2029%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.61725%209.64469L13.0214%202.20528L13.03%207.28128L13.034%209.63208L5.61725%209.64469ZM25.4847%202.79589C25.4821%201.25822%2024.2376%200.00224431%2022.702%200.00485529L11.5341%200.0238442L3.17246%208.42535L3.20099%2025.1999C3.2036%2026.7375%204.46169%2027.9935%205.99771%2027.9909L22.7635%2027.9624C24.2991%2027.9598%2025.5393%2026.6996%2025.5367%2025.1619L25.4847%202.79589Z'%20fill='%232F374A'/%3e%3crect%20y='12.1958'%20width='28.001'%20height='14.6092'%20rx='1'%20transform='rotate(-0.097421%200%2012.1958)'%20fill='%23E544FF'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.1933%2014.0615C13.3783%2014.0615%2013.5282%2013.9114%2013.5282%2013.7262C13.5282%2013.541%2013.3783%2013.3909%2013.1933%2013.3909C13.0083%2013.3909%2012.8584%2013.541%2012.8584%2013.7262C12.8584%2013.9114%2013.0084%2014.0615%2013.1933%2014.0615ZM11.8911%2014.7695C11.8911%2014.9547%2011.7411%2015.1048%2011.5562%2015.1048C11.3712%2015.1048%2011.2213%2014.9547%2011.2213%2014.7695C11.2213%2014.5843%2011.3712%2014.4341%2011.5562%2014.4341C11.7411%2014.4341%2011.8911%2014.5843%2011.8911%2014.7695ZM15.9351%2014.4664C15.78%2014.412%2015.6101%2014.4938%2015.5558%2014.6492C15.5014%2014.8045%2015.5831%2014.9746%2015.7382%2015.0291L18.6786%2016.1209L14.4692%2018.42L11.3925%2017.3811C11.2367%2017.3285%2011.0678%2017.4123%2011.0153%2017.5683C10.9627%2017.7243%2011.0464%2017.8934%2011.2022%2017.946L14.1997%2018.9582L14.1997%2024.8387L11.4366%2023.8296C11.2821%2023.7732%2011.1112%2023.8529%2011.0549%2024.0075C10.9986%2024.1622%2011.0781%2024.3333%2011.2326%2024.3897L14.3954%2025.5448C14.4786%2025.5752%2014.571%2025.5669%2014.6474%2025.5222L19.5592%2022.6532C19.6506%2022.5997%2019.7068%2022.5017%2019.7068%2022.3957L19.7068%2016.0614C19.7068%2015.9347%2019.6269%2015.8219%2019.5076%2015.7801L15.9351%2014.4664ZM14.7951%2018.9211L19.1115%2016.5635L19.1115%2022.2245L14.7951%2024.7458L14.7951%2018.9211ZM10.4397%2017.564C10.6246%2017.564%2010.7746%2017.4139%2010.7746%2017.2287C10.7746%2017.0435%2010.6246%2016.8934%2010.4397%2016.8934C10.2547%2016.8934%2010.1048%2017.0435%2010.1048%2017.2287C10.1048%2017.4139%2010.2547%2017.564%2010.4397%2017.564ZM9.88169%2016.9306C9.8817%2017.1158%209.73176%2017.2659%209.5468%2017.2659C9.36185%2017.2659%209.21191%2017.1158%209.21191%2016.9306C9.21191%2016.7454%209.36185%2016.5952%209.5468%2016.5952C9.73176%2016.5952%209.88169%2016.7454%209.88169%2016.9306ZM8.65364%2016.8932C8.8386%2016.8932%208.98853%2016.7431%208.98853%2016.5579C8.98853%2016.3727%208.8386%2016.2225%208.65364%2016.2225C8.46869%2016.2225%208.31875%2016.3727%208.31875%2016.5579C8.31875%2016.7431%208.46868%2016.8932%208.65364%2016.8932ZM9.95585%2015.9619C9.95585%2016.1471%209.80592%2016.2973%209.62096%2016.2973C9.43601%2016.2973%209.28607%2016.1471%209.28607%2015.9619C9.28607%2015.7767%209.436%2015.6266%209.62096%2015.6266C9.80592%2015.6266%209.95585%2015.7767%209.95585%2015.9619ZM10.5884%2015.7007C10.7734%2015.7007%2010.9233%2015.5506%2010.9233%2015.3654C10.9233%2015.1802%2010.7734%2015.03%2010.5884%2015.03C10.4035%2015.03%2010.2535%2015.1802%2010.2535%2015.3654C10.2535%2015.5506%2010.4035%2015.7007%2010.5884%2015.7007ZM14.456%2014.0531C14.456%2014.2384%2014.306%2014.3885%2014.1211%2014.3885C13.9361%2014.3885%2013.7862%2014.2384%2013.7862%2014.0531C13.7862%2013.8679%2013.9361%2013.7178%2014.1211%2013.7178C14.306%2013.7178%2014.456%2013.8679%2014.456%2014.0531ZM12.3748%2014.5832C12.5597%2014.5832%2012.7096%2014.433%2012.7096%2014.2478C12.7096%2014.0626%2012.5597%2013.9125%2012.3747%2013.9125C12.1898%2013.9125%2012.0399%2014.0626%2012.0399%2014.2478C12.0399%2014.433%2012.1898%2014.5832%2012.3748%2014.5832ZM8.98853%2017.6011C8.98853%2017.7863%208.83859%2017.9365%208.65364%2017.9365C8.46868%2017.9365%208.31875%2017.7863%208.31875%2017.6011C8.31875%2017.4159%208.46869%2017.2658%208.65364%2017.2658C8.8386%2017.2658%208.98853%2017.4159%208.98853%2017.6011ZM8.65364%2018.9797C8.83859%2018.9797%208.98853%2018.8296%208.98853%2018.6444C8.98853%2018.4592%208.8386%2018.309%208.65364%2018.309C8.46869%2018.309%208.31875%2018.4592%208.31875%2018.6444C8.31875%2018.8296%208.46868%2018.9797%208.65364%2018.9797ZM8.98853%2019.6876C8.98853%2019.8728%208.83859%2020.023%208.65364%2020.023C8.46868%2020.023%208.31875%2019.8728%208.31875%2019.6876C8.31875%2019.5024%208.46869%2019.3523%208.65364%2019.3523C8.8386%2019.3523%208.98853%2019.5024%208.98853%2019.6876ZM8.65364%2021.0665C8.8386%2021.0665%208.98853%2020.9164%208.98853%2020.7312C8.98853%2020.546%208.8386%2020.3958%208.65364%2020.3958C8.46869%2020.3958%208.31875%2020.546%208.31875%2020.7312C8.31875%2020.9164%208.46868%2021.0665%208.65364%2021.0665ZM8.98853%2021.7744C8.98853%2021.9597%208.83859%2022.1098%208.65364%2022.1098C8.46868%2022.1098%208.31875%2021.9597%208.31875%2021.7745C8.31875%2021.5892%208.46869%2021.4391%208.65364%2021.4391C8.8386%2021.4391%208.98853%2021.5892%208.98853%2021.7744ZM8.65364%2023.1531C8.83859%2023.1531%208.98853%2023.0029%208.98853%2022.8177C8.98853%2022.6325%208.8386%2022.4824%208.65364%2022.4824C8.46869%2022.4824%208.31875%2022.6325%208.31875%2022.8177C8.31875%2023.0029%208.46868%2023.1531%208.65364%2023.1531ZM9.88169%2023.3393C9.8817%2023.5245%209.73176%2023.6747%209.5468%2023.6747C9.36185%2023.6747%209.21191%2023.5245%209.21191%2023.3393C9.21191%2023.1541%209.36185%2023.004%209.5468%2023.004C9.73176%2023.004%209.88169%2023.1541%209.88169%2023.3393ZM10.4397%2023.9728C10.6246%2023.9728%2010.7746%2023.8227%2010.7746%2023.6375C10.7746%2023.4523%2010.6246%2023.3021%2010.4397%2023.3021C10.2547%2023.3021%2010.1048%2023.4523%2010.1048%2023.6375C10.1048%2023.8227%2010.2547%2023.9728%2010.4397%2023.9728ZM10.8575%2016.3028C10.8575%2016.4881%2010.7076%2016.6382%2010.5226%2016.6382C10.3376%2016.6382%2010.1877%2016.488%2010.1877%2016.3028C10.1877%2016.1176%2010.3376%2015.9675%2010.5226%2015.9675C10.7075%2015.9675%2010.8575%2016.1176%2010.8575%2016.3028ZM11.4899%2016.0417C11.6749%2016.0417%2011.8248%2015.8915%2011.8248%2015.7063C11.8248%2015.5211%2011.6749%2015.371%2011.4899%2015.371C11.305%2015.371%2011.155%2015.5211%2011.155%2015.7063C11.155%2015.8915%2011.305%2016.0417%2011.4899%2016.0417ZM12.7926%2015.1104C12.7926%2015.2956%2012.6426%2015.4457%2012.4577%2015.4457C12.2727%2015.4457%2012.1228%2015.2956%2012.1228%2015.1104C12.1228%2014.9252%2012.2727%2014.775%2012.4577%2014.775C12.6426%2014.775%2012.7926%2014.9252%2012.7926%2015.1104ZM13.2762%2014.9241C13.4612%2014.9241%2013.6111%2014.774%2013.6111%2014.5887C13.6111%2014.4035%2013.4612%2014.2534%2013.2762%2014.2534C13.0913%2014.2534%2012.9413%2014.4035%2012.9413%2014.5887C12.9413%2014.774%2013.0913%2014.9241%2013.2762%2014.9241ZM11.6695%2016.732C11.6695%2016.9172%2011.5196%2017.0674%2011.3346%2017.0674C11.1497%2017.0674%2010.9997%2016.9172%2010.9997%2016.732C10.9997%2016.5468%2011.1497%2016.3967%2011.3346%2016.3967C11.5196%2016.3967%2011.6695%2016.5468%2011.6695%2016.732ZM12.3021%2016.4711C12.487%2016.4711%2012.637%2016.321%2012.637%2016.1358C12.637%2015.9506%2012.487%2015.8005%2012.3021%2015.8005C12.1171%2015.8005%2011.9672%2015.9506%2011.9672%2016.1358C11.9672%2016.321%2012.1171%2016.4711%2012.3021%2016.4711ZM13.6047%2015.5399C13.6047%2015.7251%2013.4548%2015.8752%2013.2698%2015.8752C13.0849%2015.8752%2012.935%2015.7251%2012.935%2015.5399C12.935%2015.3547%2013.0849%2015.2045%2013.2698%2015.2045C13.4548%2015.2045%2013.6047%2015.3547%2013.6047%2015.5399ZM14.0883%2015.3533C14.2732%2015.3533%2014.4231%2015.2031%2014.4231%2015.0179C14.4231%2014.8327%2014.2732%2014.6826%2014.0883%2014.6826C13.9033%2014.6826%2013.7534%2014.8327%2013.7534%2015.0179C13.7534%2015.2031%2013.9033%2015.3533%2014.0883%2015.3533ZM15.2991%2014.4927C15.2991%2014.678%2015.1491%2014.8281%2014.9642%2014.8281C14.7792%2014.8281%2014.6293%2014.678%2014.6293%2014.4927C14.6293%2014.3075%2014.7792%2014.1574%2014.9642%2014.1574C15.1491%2014.1574%2015.2991%2014.3075%2015.2991%2014.4927ZM9.56761%2018.3508C9.75257%2018.3508%209.9025%2018.2007%209.9025%2018.0155C9.9025%2017.8302%209.75257%2017.6801%209.56761%2017.6801C9.38265%2017.6801%209.23272%2017.8302%209.23272%2018.0155C9.23272%2018.2007%209.38266%2018.3508%209.56761%2018.3508ZM9.9025%2019.0587C9.9025%2019.2439%209.75257%2019.3941%209.56761%2019.3941C9.38266%2019.3941%209.23272%2019.2439%209.23272%2019.0587C9.23272%2018.8735%209.38265%2018.7234%209.56761%2018.7234C9.75257%2018.7234%209.9025%2018.8735%209.9025%2019.0587ZM9.56761%2020.4373C9.75257%2020.4373%209.9025%2020.2872%209.9025%2020.102C9.9025%2019.9168%209.75257%2019.7666%209.56761%2019.7666C9.38265%2019.7666%209.23272%2019.9168%209.23272%2020.102C9.23272%2020.2872%209.38266%2020.4373%209.56761%2020.4373ZM9.9025%2021.1452C9.9025%2021.3304%209.75257%2021.4806%209.56761%2021.4806C9.38266%2021.4806%209.23272%2021.3304%209.23272%2021.1452C9.23272%2020.96%209.38265%2020.8099%209.56761%2020.8099C9.75257%2020.8099%209.9025%2020.96%209.9025%2021.1452ZM9.56761%2022.5241C9.75257%2022.5241%209.9025%2022.374%209.9025%2022.1888C9.9025%2022.0036%209.75257%2021.8534%209.56761%2021.8534C9.38265%2021.8534%209.23272%2022.0036%209.23272%2022.1888C9.23272%2022.374%209.38266%2022.5241%209.56761%2022.5241ZM10.8163%2018.4729C10.8163%2018.6581%2010.6664%2018.8082%2010.4814%2018.8082C10.2965%2018.8082%2010.1465%2018.6581%2010.1465%2018.4729C10.1465%2018.2877%2010.2965%2018.1375%2010.4814%2018.1375C10.6664%2018.1375%2010.8163%2018.2877%2010.8163%2018.4729ZM10.4814%2019.8515C10.6664%2019.8515%2010.8163%2019.7013%2010.8163%2019.5161C10.8163%2019.3309%2010.6664%2019.1808%2010.4814%2019.1808C10.2965%2019.1808%2010.1465%2019.3309%2010.1465%2019.5161C10.1465%2019.7013%2010.2965%2019.8515%2010.4814%2019.8515ZM10.8163%2020.5594C10.8163%2020.7446%2010.6664%2020.8947%2010.4814%2020.8947C10.2965%2020.8947%2010.1465%2020.7446%2010.1465%2020.5594C10.1465%2020.3742%2010.2965%2020.2241%2010.4814%2020.2241C10.6664%2020.2241%2010.8163%2020.3742%2010.8163%2020.5594ZM10.4814%2021.9383C10.6664%2021.9383%2010.8163%2021.7882%2010.8163%2021.603C10.8163%2021.4178%2010.6664%2021.2676%2010.4814%2021.2676C10.2965%2021.2676%2010.1465%2021.4177%2010.1465%2021.603C10.1465%2021.7882%2010.2965%2021.9383%2010.4814%2021.9383ZM10.8163%2022.6462C10.8163%2022.8314%2010.6664%2022.9816%2010.4814%2022.9816C10.2965%2022.9816%2010.1465%2022.8314%2010.1465%2022.6462C10.1465%2022.461%2010.2965%2022.3109%2010.4814%2022.3109C10.6664%2022.3109%2010.8163%2022.461%2010.8163%2022.6462ZM12.5057%2017.4918C12.6906%2017.4918%2012.8406%2017.3417%2012.8406%2017.1565C12.8406%2016.9713%2012.6906%2016.8211%2012.5057%2016.8211C12.3207%2016.8211%2012.1708%2016.9713%2012.1708%2017.1565C12.1708%2017.3417%2012.3207%2017.4918%2012.5057%2017.4918ZM13.8082%2016.5602C13.8082%2016.7454%2013.6582%2016.8956%2013.4733%2016.8956C13.2883%2016.8956%2013.1384%2016.7454%2013.1384%2016.5602C13.1384%2016.375%2013.2883%2016.2249%2013.4733%2016.2249C13.6582%2016.2249%2013.8082%2016.375%2013.8082%2016.5602ZM14.4411%2016.2994C14.626%2016.2994%2014.7759%2016.1492%2014.7759%2015.964C14.7759%2015.7788%2014.626%2015.6287%2014.4411%2015.6287C14.2561%2015.6287%2014.1062%2015.7788%2014.1062%2015.964C14.1062%2016.1492%2014.2561%2016.2994%2014.4411%2016.2994ZM15.5945%2015.4424C15.5945%2015.6276%2015.4446%2015.7777%2015.2596%2015.7777C15.0747%2015.7777%2014.9247%2015.6276%2014.9247%2015.4424C14.9247%2015.2572%2015.0747%2015.107%2015.2596%2015.107C15.4446%2015.107%2015.5945%2015.2572%2015.5945%2015.4424ZM11.4966%2019.0986C11.6816%2019.0986%2011.8315%2018.9485%2011.8315%2018.7633C11.8315%2018.5781%2011.6816%2018.4279%2011.4966%2018.4279C11.3116%2018.4279%2011.1617%2018.5781%2011.1617%2018.7633C11.1617%2018.9485%2011.3116%2019.0986%2011.4966%2019.0986ZM11.8315%2019.8065C11.8315%2019.9917%2011.6816%2020.1419%2011.4966%2020.1419C11.3116%2020.1419%2011.1617%2019.9917%2011.1617%2019.8065C11.1617%2019.6213%2011.3116%2019.4712%2011.4966%2019.4712C11.6816%2019.4712%2011.8315%2019.6213%2011.8315%2019.8065ZM11.4966%2021.1851C11.6816%2021.1851%2011.8315%2021.035%2011.8315%2020.8498C11.8315%2020.6646%2011.6816%2020.5144%2011.4966%2020.5144C11.3116%2020.5144%2011.1617%2020.6646%2011.1617%2020.8498C11.1617%2021.035%2011.3116%2021.1851%2011.4966%2021.1851ZM11.8315%2021.8933C11.8315%2022.0786%2011.6816%2022.2287%2011.4966%2022.2287C11.3116%2022.2287%2011.1617%2022.0786%2011.1617%2021.8933C11.1617%2021.7081%2011.3116%2021.558%2011.4966%2021.558C11.6816%2021.558%2011.8315%2021.7081%2011.8315%2021.8933ZM11.4966%2023.272C11.6816%2023.272%2011.8315%2023.1218%2011.8315%2022.9366C11.8315%2022.7514%2011.6816%2022.6013%2011.4966%2022.6013C11.3116%2022.6013%2011.1617%2022.7514%2011.1617%2022.9366C11.1617%2023.1218%2011.3116%2023.272%2011.4966%2023.272Z'%20fill='white'/%3e%3c/svg%3e"},modelTypes:["POINT_CLOUD"]},i18n:{en:{window_label:"Point Cloud"},fr:{window_label:"Point Cloud"}}},rI="viewer-point-cloud-parameters_parameters",zSt={computed:{viewer(){let e=this.$viewer.localContext.pluginComponentInstances.get("pointCloud");if(e)return e;{let t="'Viewer Point Cloud Parameters' plugin cannot work without Viewer Point Cloud plugin.";throw console.error(t),Error(t)}},sensitivity:{get(){return this.viewer.sensitivity},set(e){this.viewer.sensitivity=e,this.saveParameters({sensitivity:e})}},fov:{get(){return this.viewer.fov},set(e){this.viewer.fov=e,this.saveParameters({fov:e})}}},mounted(){this.subscription=this.$viewer.localContext.hub.on("pointcloud-model-loaded",()=>{this.applySavedParameters()})},unmounted(){this.$viewer.localContext.hub.off(this.subscription)},methods:{getSavedParameters(){let e={};try{let t=localStorage.getItem(rI)||"{}";e=JSON.parse(t)}catch{localStorage.removeItem(rI)}return Object.assign({},this.getDefaultParameters(),e)},applySavedParameters(){let e=this.getSavedParameters();this.viewer.sensitivity=e.sensitivity,this.viewer.fov=e.fov},getDefaultParameters(){return{sensitivity:200,fov:90}},saveParameters(e){let t={sensitivity:e.sensitivity||this.sensitivity,fov:e.fov||this.fov};localStorage.setItem(rI,JSON.stringify(t))}}},qSt={class:"viewer-point-cloud-parameters"},GSt={class:"viewer-point-cloud-parameters_header"},KSt={class:"viewer-point-cloud-parameters_content"},JSt={class:"m-b-18"},ZSt={class:"flex justify-between"},WSt={class:"viewer-point-cloud-parameters_content__value"},YSt={class:"flex justify-between"},XSt={class:"viewer-point-cloud-parameters_content__value"};function $St(e,t,i,o,r,n){let a=I("BIMDataIconParameters"),s=I("BIMDataSlider");return k(),N("div",qSt,[w("div",GSt,[T(a,{size:"xs",margin:"0 12px 0 0"}),w("span",null,G(e.$t("pointCloudParameters.title")),1)]),w("div",KSt,[w("div",JSt,[w("div",ZSt,[w("span",null,G(e.$t("pointCloudParameters.sensitivity")),1),w("span",WSt,G(n.sensitivity),1)]),T(s,{modelValue:n.sensitivity,"onUpdate:modelValue":t[0]||=l=>n.sensitivity=l,min:20,max:1e3},null,8,["modelValue"])]),w("div",null,[w("div",YSt,[w("span",null,G(e.$t("pointCloudParameters.fov")),1),w("span",XSt,G(n.fov),1)]),T(s,{modelValue:n.fov,"onUpdate:modelValue":t[1]||=l=>n.fov=l,min:20,max:120},null,8,["modelValue"])])])])}var eDt={name:"pointCloudParameters",i18n:{en:{tooltip:"Parameters",title:"Point Cloud Viewer settings",sensitivity:"Sensitivity",fov:"Field of view"},fr:{tooltip:"Param\xE8tres",title:"Param\xE8tres du nuage de points",sensitivity:"Sensibilit\xE9",fov:"Angle de vision"}},addToWindows:["pointCloud"],component:Q(zSt,[["render",$St],["__scopeId","data-v-e97be8b2"]]),button:{tooltip:"pointCloudParameters.tooltip",position:"right",content:"simple",icon:{component:"BIMDataIconParameters",options:{size:"m"}}}},sm=class{constructor(e,t,i=null,o=!0){this.name=e,this.icon=t,this.group=i,this.label=`drawing-tools.action.${e}`,this.lineStyleComponentDisplayed=o}onActivate(){throw Error("Not implemented")}onDeactivate(){throw Error("Not implemented")}},tDt={},iDt={width:"18",height:"18",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg"};function rDt(e,t){return k(),N("svg",iDt,[...t[0]||=[w("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"},null,-1)]])}var oDt=Q(tDt,[["render",rDt]]),nDt=class{constructor(){this._listenersTarget=new Map}on(e,t,i=window,o={}){this._listenersTarget.has(i)||this._listenersTarget.set(i,new Map);let r=this._listenersTarget.get(i);r.has(e)||r.set(e,new Map);let n=t.bind(this);return o?.once&&(n=(...a)=>{t.call(this,...a),this.off(e,t,i)}),i.addEventListener(e,n,o),r.get(e).set(t,n),()=>{this.off(e,t,i)}}off(e,t,i=window){if(!this._listenersTarget.has(i))return;let o=this._listenersTarget.get(i);if(!o.has(e))return;let r=o.get(e).get(t);i.removeEventListener(e,r),o.get(e).delete(t),o.get(e).size===0&&o.delete(e),o.size===0&&this._listenersTarget.delete(i)}},aDt="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M19.6749%202.92459C20.1081%203.35787%2020.1081%204.05777%2019.6749%204.49104L17.6418%206.5241L13.4757%202.358L15.5088%200.324952C15.9421%20-0.108322%2016.642%20-0.108322%2017.0752%200.324952L19.6749%202.92459ZM0%2020.0001V15.834L12.2872%203.54683L16.4533%207.71292L4.16609%2020.0001H0Z'%20fill='%232F374A'/%3e%3c/svg%3e",sDt="data:image/svg+xml,%3csvg%20width='19'%20height='19'%20viewBox='0%200%2019%2019'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M18.6749%202.9246C19.1081%203.35787%2019.1081%204.05777%2018.6749%204.49105L16.6418%206.5241L12.4757%202.35801L14.5088%200.324955C14.9421%20-0.108318%2015.642%20-0.108318%2016.0752%200.324955L18.6749%202.9246ZM0%2018V14.834L11.2872%203.54684L15.4533%207.71293L4.16609%2019.0001H1L0%2018Z'%20fill='%232F374A'/%3e%3c/svg%3e",lDt=`url("${aDt}") 0 20, auto`,cDt=`url("${sDt}") 1 23, auto`,Q8=class extends nDt{constructor(e,{pointerUpCursor:t=lDt,pointerDownCursor:i=cDt,element:o=e.canvas}={}){super(),this._engine2d=e,this.element=o,this.pointerUpCursor=t,this.pointerDownCursor=i,this._eventCache=[]}_getClientPosition(e){return{clientX:e.clientX,clientY:e.clientY}}_getPositions(e){let{clientX:t,clientY:i}=this._getClientPosition(e),{x:o,y:r}=this._engine2d.canvas.getBoundingClientRect();return this._engine2d.camera.getPosition({x:Math.max(t-o,0),y:Math.max(i-r,0)})}_getCanvasPosition(e){let{clientX:t,clientY:i}=this._getClientPosition(e),{x:o,y:r}=this.element.getBoundingClientRect();return{x:Math.max(t-o,0),y:Math.max(i-r,0)}}_getPositionedCallbackPayload(e){let t=this;return{get position(){return t._getPositions(e)},get canvasPosition(){return t._getCanvasPosition(e)},mouseEvent:e}}onEnabled(){}onMouseDown(){}onDrag(){}onMouseUp(){}onDisabled(){}_onMouseDown(e){this._eventCache.push(e),this.on("pointerup",()=>{this._eventCache=this._eventCache.filter(t=>t!==e)},window,{once:!0}),!(this._eventCache.length>1)&&(this.element.style.cursor=this.pointerDownCursor,this.onMouseDown(this._getPositionedCallbackPayload(e)),this.off("pointermove",this._onMouseMove,window),this.off("pointerup",this._onMouseUp,window),this.off("pointercancel",this._onMouseUp,window),this.on("pointermove",this._onMouseMove,window),this.on("pointerup",this._onMouseUp,window,{once:!0}),this.on("pointercancel",this._onMouseUp,window,{once:!0}))}_onMouseMove(e){e.preventDefault();let t=e.buttons===4,i=!e.isPrimary,o=this._eventCache.length>1;e.shiftKey||t||i||o||this.onDrag(this._getPositionedCallbackPayload(e))}_onMouseUp(e){this.off("pointermove",this._onMouseMove,window),this.off("pointerup",this._onMouseUp,window),this.off("pointercancel",this._onMouseUp,window),this.element.style.cursor=this.pointerUpCursor,this.onMouseUp(this._getPositionedCallbackPayload(e))}disable(){this._engine2d.ui.translatableWithOneTouch=!0,this._eventCache=[],this.off("pointerdown",this._onMouseDown,this.element),this.off("pointermove",this._onMouseMove,window),this.off("pointerup",this._onMouseUp,window),this.off("pointercancel",this._onMouseUp,window),this.element.style.cursor="",this.onDisabled()}enable(){this._engine2d.ui.translatableWithOneTouch=!1,this._eventCache=[],this.on("pointerdown",this._onMouseDown,this.element),this.element.style.cursor=this.pointerUpCursor,this.onEnabled()}},G$=`url("data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2022%2022'%20xmlns='http://www.w3.org/2000/svg'%20%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0.176395%200.13889C0.342301%20-0.00852533%200.584825%20-0.0419546%200.786658%200.0547728L21.6969%2010.0759C21.9052%2010.1757%2022.0251%2010.3924%2021.9956%2010.6155C21.966%2010.8386%2021.7935%2011.019%2021.566%2011.0647L12.0932%2012.9697L9.57365%2021.6158C9.51015%2021.8337%209.31%2021.9881%209.07635%2021.9993C8.8427%2022.0106%208.6277%2021.8763%208.54214%2021.6655L0.03777%200.720195C-0.0446022%200.517321%200.0104881%200.286306%200.176395%200.13889Z'%20/%3e%3c/svg%3e"), auto`,dDt=class extends sm{constructor({viewer:e},t){super("pointer",oDt,"pointers",!1),this._pointerManager=new uDt(e,t)}onActivate(){this._pointerManager.enable()}onDeactivate(){this._pointerManager.disable()}},uDt=class extends Q8{constructor(e,t){super(e,{pointerUpCursor:G$,pointerDownCursor:G$,element:e.canvas.parentElement}),this._drawer=t,this._currentDrawing=null,this.previousTouch=null}onMouseDown(e){this._currentDrawing=this._drawer.pick(e)}onMouseUp(){this._currentDrawing&&this._drawer.save(this._currentDrawing),this._currentDrawing=null,this.previousTouch=null}onDrag({position:e,mouseEvent:t,canvasPosition:i}){if(!this._currentDrawing)return;let o=0,r=0;if(window.TouchEvent&&t instanceof TouchEvent){let c=t.touches[0];this.previousTouch&&(o=c.pageX-this.previousTouch.pageX,r=c.pageY-this.previousTouch.pageY),this.previousTouch=c}else{let{movementX:c,movementY:d}=t;o=c,r=d}let n={x:i.x-o,y:i.y-r},a=this._engine2d.camera.getPosition(n),s=e.x-a.x,l=e.y-a.y;this._currentDrawing.x+=s,this._currentDrawing.y+=l}},ADt={},hDt={width:"14",height:"16",viewBox:"0 0 14 16",xmlns:"http://www.w3.org/2000/svg"};function pDt(e,t){return k(),N("svg",hDt,[...t[0]||=[w("path",{d:"M6.43587 16C6.09019 16 5.76756 15.9196 5.46797 15.7588C5.16839 15.5979 4.91888 15.3672 4.71944 15.0666L0 7.91354L0.307859 7.60694C0.508253 7.39952 0.745433 7.28253 1.0194 7.25596C1.29337 7.22942 1.54313 7.29881 1.7687 7.46414L4.1836 9.20471V2.14936C4.1836 1.98328 4.2379 1.84407 4.34649 1.73171C4.45509 1.61936 4.58965 1.56318 4.75018 1.56318C4.91071 1.56318 5.04519 1.61936 5.15361 1.73171C5.26203 1.84407 5.31624 1.98328 5.31624 2.14936V7.79331H7.08062V0.586175C7.08062 0.420099 7.13491 0.280884 7.2435 0.168531C7.35209 0.0561769 7.48665 0 7.64718 0C7.80771 0 7.94219 0.0561769 8.05061 0.168531C8.15904 0.280884 8.21325 0.420099 8.21325 0.586175V7.79331H9.97762V1.36777C9.97762 1.20169 10.0319 1.06248 10.1405 0.950122C10.2491 0.837768 10.3837 0.781592 10.5442 0.781592C10.7047 0.781592 10.8392 0.837768 10.9476 0.950122C11.056 1.06248 11.1102 1.20169 11.1102 1.36777V7.79331H12.8674V2.713C12.8674 2.54691 12.9217 2.40769 13.0302 2.29534C13.1388 2.18298 13.2734 2.12681 13.4339 2.12681C13.5945 2.12681 13.7289 2.18298 13.8373 2.29534C13.9458 2.40769 14 2.54691 14 2.713V13.0691C14 13.8787 13.7236 14.5696 13.1708 15.1418C12.6181 15.7139 11.9506 16 11.1683 16H6.43587Z"},null,-1)]])}var fDt=Q(ADt,[["render",pDt]]),gDt="data:image/svg+xml,%3csvg%20width='14'%20height='16'%20viewBox='0%200%2014%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6.43587%2016C6.09019%2016%205.76756%2015.9196%205.46797%2015.7588C5.16839%2015.5979%204.91888%2015.3672%204.71944%2015.0666L0%207.91354L0.307859%207.60694C0.508252%207.39952%200.745433%207.28253%201.0194%207.25596C1.29337%207.22942%201.54313%207.29881%201.7687%207.46414L4.1836%209.20471V2.14936C4.1836%201.98328%204.2379%201.84407%204.34649%201.73171C4.45509%201.61936%204.58965%201.56318%204.75018%201.56318C4.91071%201.56318%205.04519%201.61936%205.15361%201.73171C5.26203%201.84407%205.31624%201.98328%205.31624%202.14936V7.79331H7.08062V0.586175C7.08062%200.420099%207.13491%200.280884%207.2435%200.168531C7.35209%200.0561769%207.48665%200%207.64718%200C7.80771%200%207.94219%200.0561769%208.05061%200.168531C8.15904%200.280884%208.21325%200.420099%208.21325%200.586175V7.79331H9.97762V1.36777C9.97762%201.20169%2010.0319%201.06248%2010.1405%200.950122C10.2491%200.837768%2010.3837%200.781592%2010.5442%200.781592C10.7047%200.781592%2010.8392%200.837768%2010.9476%200.950122C11.056%201.06248%2011.1102%201.20169%2011.1102%201.36777V7.79331H12.8674V2.713C12.8674%202.54691%2012.9217%202.40769%2013.0302%202.29534C13.1388%202.18298%2013.2734%202.12681%2013.4339%202.12681C13.5945%202.12681%2013.7289%202.18298%2013.8373%202.29534C13.9458%202.40769%2014%202.54691%2014%202.713V13.0691C14%2013.8787%2013.7236%2014.5696%2013.1708%2015.1418C12.6181%2015.7139%2011.9506%2016%2011.1683%2016H6.43587Z'%20fill='%232F374A'/%3e%3c/svg%3e",mDt="data:image/svg+xml,%3csvg%20width='11'%20height='11'%20viewBox='0%200%2011%2011'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.43587%2011C3.09019%2011%202.76756%2010.9196%202.46797%2010.7588C2.16839%2010.5979%201.91888%2010.3672%201.71944%2010.0666L0%206.91354C0.5%205.5%200.780254%205.53908%201.1836%205.5V4.20471V2.14936C1.1836%201.98328%201.2379%201.84407%201.34649%201.73172C1.45509%201.61936%201.58965%201.56318%201.75018%201.56318C1.91071%201.56318%202.04519%201.61936%202.15361%201.73172C2.26203%201.84407%202.31624%201.98328%202.31624%202.14936V2.79331H4.08062V0.586175C4.08062%200.4201%204.13491%200.280884%204.2435%200.16853C4.35209%200.0561767%204.48665%200%204.64718%200C4.80771%200%204.94219%200.0561767%205.05061%200.16853C5.15904%200.280884%205.21325%200.4201%205.21325%200.586175V2.79331H6.97762V1.36777C6.97762%201.20169%207.03191%201.06248%207.1405%200.950122C7.24909%200.837768%207.38365%200.781591%207.54418%200.781591C7.70471%200.781591%207.83919%200.837768%207.94762%200.950122C8.05604%201.06248%208.11025%201.20169%208.11025%201.36777V2.79331H9.86735V2.713C9.86735%202.54691%209.92165%202.40769%2010.0302%202.29534C10.1388%202.18298%2010.2734%202.12681%2010.4339%202.12681C10.5945%202.12681%2010.7289%202.18298%2010.8373%202.29534C10.9458%202.40769%2011%202.54691%2011%202.713V8.06905C11%208.87869%2010.7236%209.56959%2010.1708%2010.1418C9.61805%2010.7139%208.95055%2011%208.16833%2011H3.43587Z'%20fill='%232F374A'/%3e%3c/svg%3e",vDt=`url("${gDt}") 7 23, auto`,yDt=`url("${mDt}") 7 18, auto`,wDt=class extends sm{constructor({viewer:e}){super("pan",fDt,"pointers",!1),this._pointerManager=new bDt(e)}onActivate(){this._pointerManager.enable()}onDeactivate(){this._pointerManager.disable()}},bDt=class extends Q8{constructor(e){super(e,{pointerUpCursor:vDt,pointerDownCursor:yDt}),this.previousTouch=null}onDrag({mouseEvent:e}){let t=0,i=0;if(window.TouchEvent&&e instanceof TouchEvent){let o=e.touches[0];this.previousTouch&&(t=o.pageX-this.previousTouch.pageX,i=o.pageY-this.previousTouch.pageY),this.previousTouch=o}else{let{movementX:o,movementY:r}=e;t=o,i=r}this._engine2d.camera.translate(-t*window.devicePixelRatio,-i*window.devicePixelRatio)}onMouseUp(){this.previousTouch=null}},lm=class extends sm{constructor(e,t,i,o,r,n=i){super(i,o,r),this._pointermanager=new CDt(e,t,n)}onActivate(){this._pointermanager.enable()}onDeactivate(){this._pointermanager.disable()}},CDt=class extends Q8{constructor(e,t,i){super(e),this._drawer=t,this._currentDrawing=null,this.shape=i}onMouseDown({position:e}){this._currentDrawing=this._drawer.makeDrawing(this.shape,{p1:e})}onMouseUp(){this._currentDrawing&&this._drawer.save(this._currentDrawing),this._currentDrawing=null}onDrag(e){this._currentDrawing.dragTo(e)}},xDt={},BDt={width:"18",height:"18",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg"};function kDt(e,t){return k(),N("svg",BDt,[...t[0]||=[w("path",{d:"M1.22223 22V17.6324L17.3486 0.577372C17.5382 0.376633 17.7466 0.230225 17.9738 0.138148C18.201 0.0460498 18.4282 0 18.6554 0C18.8951 0 19.1274 0.0460498 19.3523 0.138148C19.5771 0.230225 19.7742 0.376633 19.9434 0.577372L21.4547 2.17759C21.6443 2.35678 21.7826 2.56541 21.8695 2.80349C21.9565 3.04156 22 3.28752 22 3.54136C22 3.78194 21.9565 4.02251 21.8695 4.26306C21.7826 4.50364 21.6443 4.7243 21.4547 4.92504L5.34718 22H1.22223ZM18.4697 5.35812L20.1667 3.56126L18.6366 1.94115L16.9396 3.73801L18.4697 5.35812ZM12.9979 22C14.4269 22 15.7518 21.63 16.9724 20.89C18.1931 20.1501 18.8034 19.1181 18.8034 17.7941C18.8034 17.0342 18.5884 16.3698 18.1582 15.8007C17.7281 15.2316 17.1244 14.7504 16.3472 14.3572L14.9793 15.8056C15.6045 16.0545 16.0926 16.3477 16.4436 16.6854C16.7946 17.023 16.9701 17.3926 16.9701 17.7941C16.9701 18.4063 16.5729 18.9368 15.7785 19.3856C14.984 19.8344 14.0571 20.0588 12.9979 20.0588C12.7378 20.0588 12.52 20.1518 12.3445 20.3376C12.169 20.5234 12.0812 20.754 12.0812 21.0294C12.0812 21.3048 12.169 21.5354 12.3445 21.7212C12.52 21.9071 12.7378 22 12.9979 22ZM1.94853 12.8591L3.31174 11.4032C2.83381 11.1892 2.46793 10.9677 2.21409 10.7387C1.96024 10.5098 1.83331 10.2733 1.83331 10.0294C1.83331 9.70425 2.03819 9.3832 2.44796 9.06629C2.85772 8.7494 3.67292 8.31305 4.89358 7.75722C6.59216 6.98739 7.72899 6.29098 8.30404 5.66799C8.87912 5.04498 9.16666 4.34193 9.16666 3.55883C9.16666 2.49699 8.74397 1.63839 7.8986 0.983047C7.05323 0.327683 5.94814 0 4.58335 0C3.74502 0 2.97408 0.160117 2.27053 0.480347C1.56695 0.800556 1.04124 1.1921 0.693399 1.65499C0.524161 1.86901 0.454036 2.10502 0.483023 2.363C0.512011 2.62098 0.627572 2.83294 0.829708 2.99887C1.03184 3.16974 1.25278 3.23982 1.49252 3.20913C1.73226 3.17844 1.93674 3.07351 2.10596 2.89433C2.41465 2.56748 2.76957 2.32691 3.17073 2.1726C3.57186 2.0183 4.04273 1.94115 4.58335 1.94115C5.48121 1.94115 6.16402 2.10168 6.63176 2.42273C7.09949 2.74378 7.33335 3.12248 7.33335 3.55883C7.33335 3.93547 7.13161 4.27684 6.72814 4.58294C6.32464 4.88906 5.46947 5.35487 4.16262 5.98036C2.58783 6.71038 1.50036 7.36407 0.90023 7.94144C0.300076 8.51881 0 9.21481 0 10.0294C0 10.6367 0.171193 11.1705 0.513579 11.6309C0.855965 12.0913 1.33428 12.5007 1.94853 12.8591Z"},null,-1)]])}var EDt=Q(xDt,[["render",kDt]]),MDt=class extends lm{constructor({viewer:e},t){super(e,t,"pen",EDt,null,"freehand")}},PDt={},IDt={width:"22",height:"22",viewBox:"0 0 22 23",xmlns:"http://www.w3.org/2000/svg"};function SDt(e,t){return k(),N("svg",IDt,[...t[0]||=[w("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1 0.769226C0.447715 0.769226 0 1.21694 0 1.76923V4.32096C0 4.87324 0.447716 5.32096 1 5.32096H1.51723V18.2175H1C0.447715 18.2175 0 18.6652 0 19.2175V21.7692C0 22.3215 0.447716 22.7692 1 22.7692H3.55173C4.10401 22.7692 4.55173 22.3215 4.55173 21.7692V21.252H17.4482V21.7692C17.4482 22.3215 17.896 22.7692 18.4482 22.7692H21C21.5523 22.7692 22 22.3215 22 21.7692V19.2175C22 18.6652 21.5523 18.2175 21 18.2175H20.4828V5.32096H21C21.5523 5.32096 22 4.87324 22 4.32095V1.76923C22 1.21694 21.5523 0.769226 21 0.769226H18.4482C17.896 0.769226 17.4482 1.21694 17.4482 1.76923V2.28643H4.55173V1.76923C4.55173 1.21694 4.10401 0.769226 3.55173 0.769226H1ZM3.03448 5.32096H3.55173C4.10401 5.32096 4.55173 4.87324 4.55173 4.32095V3.80367H17.4482V4.32096C17.4482 4.87324 17.896 5.32096 18.4482 5.32096H18.9655V18.2175H18.4482C17.896 18.2175 17.4482 18.6652 17.4482 19.2175V19.7347H4.55173V19.2175C4.55173 18.6652 4.10401 18.2175 3.55173 18.2175H3.03448V5.32096ZM11.4216 6.83819H11.9202L15.931 17.4589H13.79L12.9878 15.0955H9.00098L8.20266 17.4589H6.06894L10.0578 6.83819H10.549H11.4216ZM9.53565 13.5126H12.4505L10.9896 9.2082L9.53565 13.5126Z"},null,-1)]])}var DDt=Q(PDt,[["render",SDt]]),TDt=`url("data:image/svg+xml,%3csvg%20width='14'%20height='15'%20viewBox='0%200%2014%2015'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5%201.96296V7.5M5%201.96296L3%201H1M5%201.96296L7%201H9M5%2013.037V7.5M5%2013.037L7%2014H9M5%2013.037L3%2014H1M5%207.5H7M5%207.5H3'%20stroke='%232F374A'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11%209V11M11%2013V11M11%2011H13M11%2011H9'%20stroke='%232F374A'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e") 5 7, auto`,LDt=class extends sm{constructor(e,t){super("text",DDt,null,!1),this._viewerPlanPlugin=e,this._drawer=t,this.canvas=e.engine.canvas;let i=pe(!1);this.autoDeactivateCallback=null,this.connector={enabledRef:i,deactivateAction(){this.autoDeactivateCallback?.()}},this.onClick=o=>{this.autoDeactivateCallback();let{x:r,y:n}=e.viewer.camera.getPosition({x:o.offsetX,y:o.offsetY});t.makeDrawing("text",{x:r,y:n})}}onActivate(e){this.canvas.addEventListener("click",this.onClick),this._viewerPlanPlugin.$viewer.localContext.el.style.cursor=TDt,this.autoDeactivateCallback=e,this.connector.enabledRef.value=!0}onDeactivate(){this.canvas.removeEventListener("click",this.onClick),this._viewerPlanPlugin.$viewer.localContext.el.style.cursor="",this.autoDeactivateCallback=null,this.connector.enabledRef.value=!1}},RDt={},_Dt={width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"};function FDt(e,t){return k(),N("svg",_Dt,[...t[0]||=[w("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0 0H16V16H0V0ZM2 2V14H14V2H2Z"},null,-1)]])}var UDt=Q(RDt,[["render",FDt]]),ODt=class extends lm{constructor({viewer:e},t){super(e,t,"rectangle",UDt,"shapes")}},NDt={},HDt={width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"};function VDt(e,t){return k(),N("svg",HDt,[...t[0]||=[w("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16 1.37853L1.37853 16L0 14.6215L14.6215 0L16 1.37853Z"},null,-1)]])}var jDt=Q(NDt,[["render",VDt]]),QDt=class extends lm{constructor({viewer:e},t){super(e,t,"line",jDt,"shapes")}},zDt={},qDt={width:"17",height:"17",viewBox:"0 0 17 17",xmlns:"http://www.w3.org/2000/svg"};function GDt(e,t){return k(),N("svg",qDt,[...t[0]||=[w("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.9914 1.88377H10.0848V0H16.207V6.12225H14.3233V3.21594L1.33203 16.2072L0 14.8751L12.9914 1.88377Z"},null,-1)]])}var KDt=Q(zDt,[["render",GDt]]),JDt=class extends lm{constructor({viewer:e},t){super(e,t,"arrow",KDt,"shapes")}},ZDt={},WDt={width:"17",height:"17",viewBox:"0 0 17 17",xmlns:"http://www.w3.org/2000/svg"};function YDt(e,t){return k(),N("svg",WDt,[...t[0]||=[w("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.5 14.875C12.0208 14.875 14.875 12.0208 14.875 8.5C14.875 4.97919 12.0208 2.125 8.5 2.125C4.97919 2.125 2.125 4.97919 2.125 8.5C2.125 12.0208 4.97919 14.875 8.5 14.875ZM8.5 17C13.1944 17 17 13.1944 17 8.5C17 3.80558 13.1944 0 8.5 0C3.80558 0 0 3.80558 0 8.5C0 13.1944 3.80558 17 8.5 17Z"},null,-1)]])}var XDt=Q(ZDt,[["render",YDt]]),$Dt=class extends lm{constructor({viewer:e},t){super(e,t,"ellipse",XDt,"shapes")}},eTt={name:"EraserIcon",props:{color:{type:String,default:"currentColor"}}},tTt=["fill"];function iTt(e,t,i,o,r,n){return k(),N("svg",{width:"20",height:"20",viewBox:"0 0 22 22",fill:i.color,xmlns:"http://www.w3.org/2000/svg"},[...t[0]||=[w("path",{d:"M16.6425 18.2998H22V20H14.9369L16.6425 18.2998ZM2.62548 20L0.613685 17.9946C0.214257 17.5964 0.00980528 17.1125 0.00032939 16.5428C-0.0091465 15.9731 0.18583 15.4798 0.585258 15.0627L12.6123 2.62019C13.0118 2.20312 13.4943 1.9964 14.0599 2.00005C14.6256 2.00367 15.1081 2.20458 15.5075 2.60277L20.6617 7.74061C21.0611 8.13879 21.2627 8.62453 21.2663 9.19783C21.27 9.77112 21.072 10.2569 20.6726 10.655L11.5255 20H2.62548Z"},null,-1)]],8,tTt)}var rTt=Q(eTt,[["render",iTt]]),oTt="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%20d='M13.1614%200.604227C13.9322%20-0.186875%2015.1984%20-0.203279%2015.9895%200.567585L21.551%205.98681C22.3421%206.75768%2022.3586%208.0239%2021.5877%208.815L8.99392%2021.7394C8.22305%2022.5305%206.95683%2022.5469%206.16573%2021.776L0.604228%2016.3568C-0.186874%2015.5859%20-0.20328%2014.3197%200.567585%2013.5286L13.1614%200.604227Z'%20fill='%232F374A'/%3e%3c/svg%3e",nTt="data:image/svg+xml,%3csvg%20width='22'%20height='18'%20viewBox='0%200%2022%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.62548%2018L0.613685%2015.9946C0.214257%2015.5964%200.00980528%2015.1125%200.00032939%2014.5428C-0.0091465%2013.9731%200.18583%2013.4798%200.585258%2013.0627L12.6123%200.620194C13.0118%200.203116%2013.4943%20-0.00359875%2014.0599%204.73985e-05C14.6256%200.00367466%2015.1081%200.204581%2015.5075%200.602767L20.6617%205.74061C21.0611%206.13879%2021.2627%206.62453%2021.2663%207.19783C21.27%207.77112%2021.072%208.25686%2020.6726%208.65502L11.5255%2018H2.62548Z'%20fill='%232F374A'/%3e%3c/svg%3e",aTt=`url("${oTt}") 7 23, auto`,sTt=`url("${nTt}") 7 18, auto`,lTt=class extends sm{constructor({viewer:e},t){super("eraser",rTt,null,!1),this._pointerManager=new cTt(e,t)}onActivate(){this._pointerManager.enable()}onDeactivate(){this._pointerManager.disable()}},cTt=class extends Q8{constructor(e,t){super(e,{element:e.canvas.parentElement,pointerUpCursor:aTt,pointerDownCursor:sTt}),this._drawer=t}erase(e){let t=this._drawer.pick(e);t&&this._drawer.deleteDrawing(t.id)}onMouseDown(e){this.erase(e)}onDrag(e){this.erase(e)}},m0=class{constructor(e){this.drawingType=e}parse(e){throw Error("Not implemented")}toString(e){throw Error("Not implemented")}},dTt=class extends m0{constructor(){super("rectangle")}toString(e){let{p1:t,p2:i,p3:o,p4:r,lineColor:n,lineWidth:a}=e;return`<path d="M ${t.x} ${t.y} L ${i.x} ${i.y} L ${o.x} ${o.y} L ${r.x} ${r.y} Z" stroke-width="${a}" stroke="#${n.toString(16).padStart(6,0)}"/>`}parse(e){let t=e.querySelector("path"),[,i,o,,r,n,,a,s,,l,c]=t.getAttribute("d").split(" "),d=t.getAttribute("stroke")?.substring(1),u=t.getAttribute("stroke-width");return{p1:{x:parseFloat(i),y:parseFloat(o)},p2:{x:parseFloat(r),y:parseFloat(n)},p3:{x:parseFloat(a),y:parseFloat(s)},p4:{x:parseFloat(l),y:parseFloat(c)},lineColor:parseInt(d,16),lineWidth:parseFloat(u)}}},uTt=class extends m0{constructor(){super("line")}toString(e){let{p1:t,p2:i,lineWidth:o,lineColor:r}=e;return`<line x1="${t.x}" y1="${t.y}" x2="${i.x}" y2="${i.y}" stroke-width="${o}" stroke="#${r.toString(16).padStart(6,0)}"/>`}parse(e){let t=e.querySelector("line"),i=t.getAttribute("x1"),o=t.getAttribute("y1"),r=t.getAttribute("x2"),n=t.getAttribute("y2"),a=t.getAttribute("stroke")?.substring(1),s=t.getAttribute("stroke-width");return{p1:{x:parseFloat(i),y:parseFloat(o)},p2:{x:parseFloat(r),y:parseFloat(n)},lineWidth:parseFloat(s),lineColor:parseInt(a,16)}}},ATt=class extends m0{constructor(){super("arrow")}toString(e){let{p1:t,p2:i,lineWidth:o,lineColor:r}=e;return`<line x1="${t.x}" y1="${t.y}" x2="${i.x}" y2="${i.y}" stroke-width="${o}" stroke="#${r.toString(16).padStart(6,0)}"/>`}parse(e){let t=e.querySelector("line"),i=t.getAttribute("x1"),o=t.getAttribute("y1"),r=t.getAttribute("x2"),n=t.getAttribute("y2"),a=t.getAttribute("stroke")?.substring(1),s=t.getAttribute("stroke-width");return{p1:{x:parseFloat(i),y:parseFloat(o)},p2:{x:parseFloat(r),y:parseFloat(n)},lineWidth:parseFloat(s),lineColor:parseInt(a,16)}}};function K$(e){if(e.length===0)return"";let t=e[0],i=`M ${t.x} ${t.y}`;for(let o=0;o<e.length;o++){let r=e[o];i+=` C ${r.cpX1} ${r.cpY1} ${r.cpX2} ${r.cpY2} ${r.toX} ${r.toY}`}return i}function J$(e){let t=e.split(" "),i=t.shift();if(i!=="M")throw Error(`svgPathStringToCurves: invalid svg path string. Must start with M, got "${i}"`);let o=parseFloat(t.shift()),r=parseFloat(t.shift()),n=[];for(;t.shift()==="C";){let a=parseFloat(t.shift()),s=parseFloat(t.shift()),l=parseFloat(t.shift()),c=parseFloat(t.shift()),d=parseFloat(t.shift()),u=parseFloat(t.shift());n.push({type:"curve",x:o,y:r,cpX1:a,cpY1:s,cpX2:l,cpY2:c,toX:d,toY:u}),o=d,r=u}return n}var hTt=class extends m0{constructor(){super("ellipse")}toString(e){let{curve1:t,curve2:i,curve3:o,curve4:r,lineColor:n,lineWidth:a}=e;return`<path d="${K$([t,i,o,r])} Z" stroke-width="${a}" stroke="#${n.toString(16).padStart(6,0)}" />`}parse(e){let t=e.querySelector("path"),i=J$(t.getAttribute("d")),o=t.getAttribute("stroke")?.substring(1),r=t.getAttribute("stroke-width");return{curves:i,lineColor:parseInt(o,16),lineWidth:parseFloat(r)}}},pTt=class extends m0{constructor(){super("text")}toString(e){let{x:t,y:i,rotation:o,scale:r,text:n,size:a,color:s}=e;return`<text x="${t}" y="${i}" tranform="rotate(${o}) scale(${r})" font-size="${a}px" ${s?`color="#${s}"`:""}>${n}</text>`}parse(e){let t=e.querySelector("text"),i=t.getAttribute("x"),o=t.getAttribute("y"),r=t.getAttribute("tranform").match(/rotate\((.*)\)/)?.[1]??0,n=t.getAttribute("tranform").match(/scale\((.*)\)/)?.[1]??1,a=t.textContent==="null"?null:t.textContent,s=t.getAttribute("font-size").slice(0,-2),l=t.getAttribute("color");return{x:parseFloat(i),y:parseFloat(o),rotation:parseFloat(r),scale:parseFloat(n),text:a,size:parseFloat(s),color:l?l.slice(1):null}}},fTt=class extends m0{constructor(){super("freehand")}toString(e){let{curves:t,lineWidth:i,lineColor:o}=e,r=`stroke-width="${i}" stroke="#${o.toString(16).padStart(6,0)}"`;return`<path d="${K$(t)}" ${r}/>`}parse(e){let t=e.querySelector("path"),i=J$(t.getAttribute("d")),o=t.getAttribute("stroke")?.substring(1),r=t.getAttribute("stroke-width");return{curves:i,lineWidth:parseFloat(r),lineColor:parseInt(o,16)}}},gTt=class{constructor(){this.drawingSvgParsers=new Map,[new dTt,new uTt,new ATt,new hTt,new fTt,new pTt].map(e=>this.drawingSvgParsers.set(e.drawingType,e))}parse(e){try{let t=new DOMParser().parseFromString(e.content,"image/svg+xml"),i=t.querySelector("svg").getAttribute("type"),o=+t.querySelector("svg").getAttribute("data-bimdata-elevation"),r=this.drawingSvgParsers.get(i);if(!r)throw TypeError(`No drawing parser for type ${i}`);let n=r.parse(t);return n.apiId=e.id,n.type=i,n.z=o,n}catch(t){console.warn(`[Drawing Tools - Parser] Error parsing drawing ${e.id}, ignored.`,t)}}toString(e){let{type:t,z:i}=e,o=this.drawingSvgParsers.get(t);if(!o)throw TypeError(`No drawing parser for type ${t}`);return`<svg type="${t}" data-bimdata-elevation="${i}" xmlns="http://www.w3.org/2000/svg">${o.toString(e)}</svg>`}},mTt=class{constructor(e){this._api=e,this._parser=new gTt,this.queue=h1()}async getDrawingsData(e){let{cloudId:t,projectId:i}=this._api;return(await this._api.apiClient.modelApi.getDrawings(t,e,i)).map(o=>this._parser.parse(o)).filter(Boolean)}save(e,t){let i=this._parser.toString(e);if(!i)return;let{cloudId:o,projectId:r}=this._api,n={content:i},a;a=e.apiId?async()=>{try{await this._api.apiClient.modelApi.updateDrawing(o,e.apiId,t,r,n)}catch(s){console.error(`Cannot update drawing of type: "${e.type}"`,s)}}:async()=>{try{e.apiId=(await this._api.apiClient.modelApi.createDrawing(o,t,r,n)).id}catch(s){console.error(`Cannot create drawing of type: "${e.type}"`,s)}},this.queue.push(a)}async delete(e,t){if(!e.apiId)return;let{cloudId:i,projectId:o}=this._api;try{await this._api.apiClient.modelApi.deleteDrawing(i,e.apiId,t,o)}catch(r){console.error(`Cannot delete drawing of type: "${e.type}"`,r)}}},Z$=class{constructor(e){this.drawingTypes=e}pick(e,t){throw Error("Not implemented")}},vTt=class extends Z${constructor(e){super(["rectangle","ellipse","arrow","line","freehand"]),this._engine2d=e}pick(e,t){let{canvasPosition:i}=t,o=this._engine2d.picker.pick(i);if(o)return e.get(o.id)}},yTt=class extends Z${constructor(){super(["text"])}pick(e,t){let{mouseEvent:i}=t,o=i.target;return e.get(o.id)}},W$=class{constructor(e,t){if(!e)throw TypeError("Drawing type is required");this.type=e,this.z=t}destroy(){throw Error("Method 'destroy' not implemented.")}},Y$=class{constructor(e){this.drawingTypes=e}create(e,t){throw Error("Not implemented")}},wTt="data:image/svg+xml,%3csvg%20width='17'%20height='17'%20viewBox='0%200%2017%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.5%200C3.80611%200%200%203.80611%200%208.5C0%2013.1939%203.80611%2017%208.5%2017C9.28389%2017%209.91667%2016.3672%209.91667%2015.5833C9.91667%2015.215%209.775%2014.8844%209.54833%2014.6294C9.33111%2014.3839%209.18944%2014.0533%209.18944%2013.6944C9.18944%2012.9106%209.82222%2012.2778%2010.6061%2012.2778H12.2778C14.8844%2012.2778%2017%2010.1622%2017%207.55556C17%203.38111%2013.1939%200%208.5%200ZM3.30556%208.5C2.52167%208.5%201.88889%207.86722%201.88889%207.08333C1.88889%206.29944%202.52167%205.66667%203.30556%205.66667C4.08944%205.66667%204.72222%206.29944%204.72222%207.08333C4.72222%207.86722%204.08944%208.5%203.30556%208.5ZM6.13889%204.72222C5.355%204.72222%204.72222%204.08944%204.72222%203.30556C4.72222%202.52167%205.355%201.88889%206.13889%201.88889C6.92278%201.88889%207.55556%202.52167%207.55556%203.30556C7.55556%204.08944%206.92278%204.72222%206.13889%204.72222ZM10.8611%204.72222C10.0772%204.72222%209.44444%204.08944%209.44444%203.30556C9.44444%202.52167%2010.0772%201.88889%2010.8611%201.88889C11.645%201.88889%2012.2778%202.52167%2012.2778%203.30556C12.2778%204.08944%2011.645%204.72222%2010.8611%204.72222ZM13.6944%208.5C12.9106%208.5%2012.2778%207.86722%2012.2778%207.08333C12.2778%206.29944%2012.9106%205.66667%2013.6944%205.66667C14.4783%205.66667%2015.1111%206.29944%2015.1111%207.08333C15.1111%207.86722%2014.4783%208.5%2013.6944%208.5Z'%20fill='white'/%3e%3c/svg%3e",bTt="url(data:image/svg+xml,%3csvg%20width='10'%20height='15'%20viewBox='0%200%2010%2015'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5%201.96296V7.5M5%201.96296L3%201H1M5%201.96296L7%201H9M5%2013.037V7.5M5%2013.037L7%2014H9M5%2013.037L3%2014H1M5%207.5H7M5%207.5H3'%20stroke='%232F374A'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e) 5 7, auto",CTt=4,xTt=40,X$=4,BTt=2,kTt={props:{id:{type:String,required:!0},newMarker:{type:Boolean,default:!1},textToolEnabled:{type:Boolean,required:!0},rotation:{type:Number,required:!0},scale:{type:Number,required:!0},initText:{type:String,default:""},initSize:{type:Number,default:12},initColor:{type:String,default:"000000"}},emits:["edit-update","text-update","size-update","color-update","delete-marker","delete-drawing"],setup(e,{emit:t}){let i=bt("$viewer").localContext.viewer.viewer.canvas,o=pe(e.newMarker),r=pe(e.initText),n=pe(e.initSize),a=pe(e.initColor);xt(r,x=>t("text-update",x)),xt(n,x=>t("size-update",x)),xt(a,x=>t("color-update",x));let s=pe(null),l=()=>s.value?.focus(),c=pe(null),d=pe(null),u=pe(null);async function A(){if(!o.value)return;await Ir();let{width:x}=c.value.getBoundingClientRect();d.value=x+12,u.value=1,await Ir();let{scrollHeight:B}=s.value;u.value=B+2}xt([()=>e.scale,o,r,n],A);let h=()=>{e.textToolEnabled&&(o.value=!0)},p=x=>{x.key==="Escape"&&(o.value=!1)};xt(o,async x=>{t("edit-update",x),x?(document.addEventListener("keydown",p),await Ir(),l()):(document.removeEventListener("keydown",p),v.value=!1)});let f=je(()=>n.value/(BTt*window.devicePixelRatio)),m=()=>{n.value>CTt&&(n.value-=X$),l()},g=()=>{n.value<xTt&&(n.value+=X$),l()},y=pe(null),v=pe(!1),C=pe(!1);return Di(()=>{A(),l()}),{paletteSvg:wTt,textCursor:bTt,textarea:s,textEl:c,colorElement:y,edit:o,text:r,textAreaWidth:d,textAreaHeight:u,size:f,sizeRef:n,color:a,colorSelectorDisplayed:v,colorSelectorTop:C,onTextClick:h,decrementSize:m,incrementSize:g,onTextColorClick:()=>{if(v.value=!v.value,v.value){let{y:x,height:B}=i.getBoundingClientRect(),{y:E}=y.value.getBoundingClientRect();C.value=E>x+B/2}},onTextColorUpdate:x=>{a.value=x,v.value=!1,l()},onDeleteClick:()=>{t("delete-marker"),t("delete-drawing")}}}},ETt=["id"],MTt={key:0},PTt={class:"bimdata-drawing-tools__text-marker__edit-content",style:"transform: translate(-1px, -1px)"},ITt={class:"bimdata-drawing-tools__text-marker__edit-content__header"},STt=["src"];function DTt(e,t,i,o,r,n){let a=I("BIMDataColorSelector"),s=I("BIMDataIconDelete"),l=Li("click-away");return k(),N("div",{class:"bimdata-drawing-tools__text-marker",style:ve(`font-size:${o.size}px; z-index: ${o.edit?1:0};`)},[w("div",{style:ve(`cursor: ${i.textToolEnabled?o.textCursor:""}`)},[w("div",{ref:"textEl",class:"bimdata-drawing-tools__text-marker__text",style:ve(`
2551
+ `}},methods:{onMouseMove({offsetX:e,offsetY:t}){this.zoomX=e,this.zoomY=t}}},zPt=["src"],qPt=["src"];function GPt(e,t,i,o,r,n){return k(),N("div",{class:"preview-2d",onMouseenter:t[0]||=a=>r.hover=!0,onMouseleave:t[1]||=a=>r.hover=!1,onMousemove:t[2]||=(...a)=>n.onMouseMove&&n.onMouseMove(...a)},[w("img",{loading:"lazy",src:n.imgUrl},null,8,zPt),Tt(w("div",{class:"zoom",style:ve({transform:n.zoomTransform})},[w("div",{class:"zoomImage",style:ve({width:`${i.width}px`,height:`${i.height}px`,transform:n.zoomImageTransform})},[w("img",{loading:"lazy",src:n.imgUrl},null,8,qPt)],4)],4),[[ui,r.hover]])],32)}var KPt=Q(QPt,[["render",GPt],["__scopeId","data-v-b92f4cf9"]]),H$=15,JPt={props:{width:{type:Number},height:{type:Number},previewUrl:{type:String},defaultUrl:{type:String}},data(){return{translation:0}},computed:{viewportWidth(){return Math.min(this.width,this.height)}},methods:{onMouseMove({offsetX:e}){let t=Math.ceil(H$*(1-e/this.width));t=Math.abs(t),t=Math.min(t,H$),this.translation=(t-1)*this.viewportWidth}}},ZPt=["src"];function WPt(e,t,i,o,r,n){return k(),N("div",{class:"preview-3d",onMousemove:t[0]||=(...a)=>n.onMouseMove&&n.onMouseMove(...a)},[w("div",{class:"viewport",style:ve({width:`${n.viewportWidth}px`,height:`${i.height}px`})},[w("img",{loading:"lazy",src:i.previewUrl||i.defaultUrl,style:ve({transform:`translateX(-${r.translation}px)`})},null,12,ZPt)],4)],32)}var YPt={components:{Preview2D:KPt,Preview3D:Q(JPt,[["render",WPt],["__scopeId","data-v-81707204"]])},props:{type:{type:String,default:"3d",validator:e=>["2d","3d"].includes(e)},width:{type:Number,default:240},height:{type:Number,default:240},previewUrl:{type:String},defaultUrl:{type:String},backgroundColor:{type:String,default:"var(--color-silver-light)"},zoomFactor:{type:Number,default:3}},computed:{previewComponent(){return this.type==="3d"?"Preview3D":"Preview2D"}}};function XPt(e,t,i,o,r,n){return k(),W(qr(n.previewComponent),la({class:"bimdata-model-preview",style:{width:`${i.width}px`,height:`${i.height}px`,backgroundColor:i.backgroundColor}},e.$props),null,16,["style"])}var $Pt=Q(YPt,[["render",XPt]]),eIt={class:"placeholder"},tIt={class:"list-item"},iIt={class:"count"},rIt=Q({__name:"StoreySelector",props:{storeys:{type:Object,required:!0},storey:{type:Object,default:null}},emits:["storey-selected"],setup(e,{emit:t}){let i=e,o=pe(null);return xt([()=>i.storeys,()=>i.storey],([r,n])=>{(!n||r.some(a=>a.uuid===n.uuid)&&n.uuid!==o.value?.uuid)&&(o.value=n)},{immediate:!0}),(r,n)=>{let a=I("BIMDataIconStorey"),s=I("BIMDataTextbox"),l=I("BIMDataIconPlan"),c=I("BIMDataDropdownList");return k(),W(c,{class:"storey-selector",width:"100%",list:e.storeys,elementKey:"uuid",closeOnElementClick:!0,onElementClick:n[0]||=d=>r.$emit("storey-selected",d)},{header:j(()=>[T(a,{size:"xs"}),w("span",eIt,G(o.value?.name??r.$t("MetaBuildingStructure.StoreySelector.placeholder")),1)]),element:j(({element:d})=>[w("div",tIt,[T(s,{class:"text",text:d.name},null,8,["text"]),T(l,{size:"xs"}),w("span",iIt,G(d.plans.length),1)])]),_:1},8,["list"])}}},[["__scopeId","data-v-49c78195"]]),oIt={class:"photosphere-building"},nIt={class:"title"},aIt={class:"head"},sIt={class:"body"},lIt={class:"loading"},V$=Q({__name:"BIMDataPhotosphereBuilding",props:{apiClient:{type:Object,required:!0},space:{type:Object,required:!0},project:{type:Object,required:!0},model:{type:Object,default:null},storey:{type:Object,default:null},plan:{type:Object,default:null},selectable:{type:Boolean,default:!1}},emits:["storey-selected","plan-selected"],setup(e,{emit:t}){let i=e,o=t,r=pe(!1),n=pe([]),a=pe(null),s=je(()=>a.value?.plans??[]),l=pe(null);xt(()=>i.model,async u=>{if(u)try{r.value=!0,n.value=await i.apiClient.modelApi.getStoreys(i.space.id,u.id,i.project.id),n.value.some(({uuid:A})=>a.value?.uuid===A)||(a.value=n.value[0]??null)}finally{r.value=!1}else n.value=[],a.value=null},{immediate:!0}),xt(()=>i.storey,u=>{a.value=u},{immediate:!0}),xt(()=>i.plan,u=>{l.value=u?.plan?.id},{immediate:!0});let c=u=>(a.value=u,o("storey-selected",u)),d=u=>o("plan-selected",u);return(u,A)=>{let h=I("BIMDataIconBuilding"),p=I("BIMDataRadio"),f=I("BIMDataFileIcon"),m=I("BIMDataTextbox"),g=I("BIMDataSpinner");return k(),N("div",oIt,[w("div",nIt,[T(h,{size:"s"}),w("span",null,G(u.$t("PhotosphereBuilding.title")),1)]),w("div",aIt,[T(rIt,{storeys:n.value,storey:a.value,onStoreySelected:c},null,8,["storeys","storey"])]),w("div",sIt,[(k(!0),N(ut,null,Vt(s.value,y=>(k(),N("div",{class:"list-item",key:y.plan.id},[e.selectable?(k(),W(p,{key:0,value:y.plan.id,modelValue:l.value,"onUpdate:modelValue":[A[0]||=v=>l.value=v,v=>d(y)]},null,8,["value","modelValue","onUpdate:modelValue"])):le("",!0),T(f,{fileName:y.plan.document?.file_name??y.plan.name,size:14},null,8,["fileName"]),T(m,{class:"text",text:y.plan.name},null,8,["text"])]))),128))]),T(Qi,{name:"fade"},{default:j(()=>[Tt(w("div",lIt,[T(g)],512),[[ui,r.value]])]),_:1})])}}},[["__scopeId","data-v-94317752"]]);function iI(e,t){return Array.isArray(e)?e=e.map(i=>iI(i,t)):(e.expandedRef=pe(!0),e.parent=t,e.children=e.children?.map(i=>iI(i,e))??[]),e}function cIt(e,t,i){return[{id:1,text:e.name,component:"StructureRootNode",children:t.map(o=>dIt(o,i))}]}var dIt=(e,t)=>({id:e.uuid,text:e.name,component:"StoreyNode",children:e.plans?.map(i=>uIt(e,i))??[],storey:e}),uIt=(e,t)=>({id:t.plan.id,text:t.plan.name,component:"PlanNode",storey:e,plan:t}),AIt={class:"generic-tree-node"},hIt={class:"end"},V8=Q({__name:"GenericTreeNode",props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},setup(e){return(t,i)=>{let o=I("BIMDataTextbox");return k(),N("div",AIt,[Pt(t.$slots,"icon",{},void 0,!0),T(o,{class:"text",text:e.node.text},null,8,["text"]),w("div",hIt,[Pt(t.$slots,"end",{},void 0,!0)])])}}},[["__scopeId","data-v-fab13549"]]),pIt={__name:"PlanNode",props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},emits:["delete-plan"],setup(e){let t=e,i=je(()=>t.node.storey),o=je(()=>t.node.plan);return(r,n)=>{let a=I("BIMDataFileIcon"),s=I("BIMDataIconDelete"),l=I("BIMDataButton");return k(),W(V8,Cs(jl(r.$props)),{icon:j(()=>[T(a,{"file-name":o.value.plan.document?.file_name??o.value.plan.name,size:12},null,8,["file-name"])]),end:j(()=>[T(l,{width:"24px",height:"24px",color:"high",ghost:"",rounded:"",icon:"",onClick:n[0]||=c=>r.$emit("delete-plan",{storey:i.value,plan:o.value})},{default:j(()=>[T(s,{size:"xxs"})]),_:1})]),_:1},16)}}},fIt=Q({__name:"StoreyNode",props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},emits:["add-plans","delete-storey","update-storey"],setup(e,{emit:t}){let i=e,o=t,r=[{key:1,text:"BuildingMaker.view.addFile",icon:"plus",action:()=>(n.value=!1,o("add-plans",i.node.storey))},{key:2,text:"BIMDataComponents.t.rename",icon:"edit",action:()=>(n.value=!1,o("update-storey",i.node.storey)),divider:!0},{key:3,text:"BIMDataComponents.t.delete",icon:"delete",color:"var(--color-high)",action:()=>(n.value=!1,o("delete-storey",i.node.storey))}],n=pe(!1);return(a,s)=>{let l=I("BIMDataIconStorey"),c=I("BIMDataIconEllipsis"),d=I("BIMDataButton"),u=I("BIMDataIcon"),A=I("BIMDataMenu");return k(),W(V8,la({class:"storey-node"},a.$props),{icon:j(()=>[T(l,{size:"xxs"})]),end:j(()=>[T(d,{width:"24px",height:"24px",color:"granite",ghost:"",rounded:"",icon:"",onClick:s[0]||=h=>n.value=!n.value},{default:j(()=>[T(c,{customSize:"24"})]),_:1}),T(Qi,{name:"fade"},{default:j(()=>[Tt(T(A,{class:"storey-node__menu",menuItems:r,width:"180px"},{item:j(({item:h})=>[T(u,{name:h.icon,size:"xs",margin:"0 12px 0 0"},null,8,["name"]),w("span",null,G(a.$t(h.text)),1)]),_:1},512),[[ui,n.value]])]),_:1})]),_:1},16)}}},[["__scopeId","data-v-a66bc7dd"]]),gIt={__name:"StructureRootNode",props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},emits:["create-storey"],setup(e){return(t,i)=>{let o=I("BIMDataIconBuilding"),r=I("BIMDataIconPlus"),n=I("BIMDataButton");return k(),W(V8,Cs(jl(t.$props)),{icon:j(()=>[T(o,{size:"xs"})]),end:j(()=>[T(n,{width:"23px",height:"23px",color:"primary",fill:"",radius:"",icon:"",onClick:i[0]||=a=>t.$emit("create-storey")},{default:j(()=>[T(r,{size:"xxs"})]),_:1})]),_:1},16)}}},mIt={__name:"ZoneNode",props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},setup(e){return(t,i)=>{let o=I("BIMDataIconZone2");return k(),W(V8,Cs(jl(t.$props)),{icon:j(()=>[T(o,{size:"xxs"})]),_:1},16)}}},vIt={class:"building-view"},yIt={key:0,class:"content"},wIt={key:1,class:"content"},bIt={class:"building-view__tree"},CIt=Q(Object.assign({components:{PlanNode:pIt,StoreyNode:fIt,StructureRootNode:gIt,ZoneNode:mIt}},{__name:"PhotosphereBuildingView",props:{apiClient:{type:Object,required:!0},space:{type:Object,required:!0},project:{type:Object,required:!0},model:{type:Object,required:!0}},emits:["close"],setup(e,{emit:t}){let i=e,o=bt("service"),r=bt("loading"),n=pe(""),a=pe(""),s=pe(!1),l=pe(!1),c=pe([]),d=pe(null),u=pe([]),A=pe([]),h=je(()=>iI(cIt(i.model,c.value,A.value))),p=async()=>{try{r.value=!0,c.value=await o.fetchStoreys(i.model)}finally{r.value=!1}},f=async()=>{try{r.value=!0,A.value=await o.fetchZones(i.model)}finally{r.value=!1}},m=async D=>{await o.createStorey(i.model,D),p()},g=async D=>{await o.updateStorey(i.model,D),p()},y=async D=>{await o.deleteStorey(i.model,D),p()},v=D=>{d.value=D,l.value=!0},C=()=>{d.value=null,l.value=!1},x=D=>{n.value=i.apiClient.config.configuration.basePath,a.value=i.apiClient.accessToken,d.value=D,s.value=!0},B=async()=>{let D=[],P=[];for(let{document:R,pdfPage:O}of u.value)O?P.push(O):D.push(R);let M=(await o.createPlanModels(D)).concat(P);await o.createStoreyPlans(i.model,d.value,M),p(),u.value=[],d.value=null,s.value=!1},E=async({storey:D,plan:P})=>{await o.deleteStoreyPlan(i.model,D,P),p()};return Di(()=>{p(),f()}),(D,P)=>{let M=I("BIMDataFileManager"),R=I("BIMDataButton"),O=I("BIMDataTree");return k(),N("div",vIt,[T(Qi,{name:"fade",mode:"out-in"},{default:j(()=>[s.value&&n.value&&a.value&&d.value?(k(),N("div",yIt,[T(M,{class:"building-view__dms",spaceId:e.space.id,projectId:e.project.id,apiUrl:n.value,archiveUrl:"",accessToken:a.value,locale:D.$i18n.locale,select:!0,pdfPageSelect:!0,multi:!0,headerButtons:!1,selectableFileTypes:mt(eX),onSelectionChange:P[0]||=V=>u.value=V},null,8,["spaceId","projectId","apiUrl","accessToken","locale","selectableFileTypes"]),T(R,{width:"100%",color:"primary",fill:"",radius:"",onClick:B},{default:j(()=>[nt(G(D.$t("BIMDataComponents.t.validate")),1)]),_:1})])):(k(),N("div",wIt,[w("div",bIt,[T(O,{data:h.value},{node:j(({node:V,depth:z})=>[(k(),W(qr(V.component),{node:V,depth:z,onCreateStorey:v,onUpdateStorey:v,onDeleteStorey:y,onAddPlans:x,onDeletePlan:E},null,40,["node","depth"]))]),_:1},8,["data"])]),T(R,{width:"100%",color:"primary",fill:"",radius:"",onClick:P[1]||=V=>D.$emit("close")},{default:j(()=>[nt(G(D.$t("BIMDataComponents.t.finish")),1)]),_:1}),T(Qi,{name:"fade"},{default:j(()=>[l.value?(k(),W(rX,{key:0,class:"building-view__form",storey:d.value,onCreateStorey:m,onUpdateStorey:g,onClose:C},null,8,["storey"])):le("",!0)]),_:1})]))]),_:1})])}}}),[["__scopeId","data-v-5bedb26f"]]),xIt={class:"bimdata-building-maker"},BIt=["src"],kIt={class:"bimdata-building-maker__body"},EIt={class:"bimdata-building-maker__loader"},MIt=Q({__name:"BIMDataPhotosphereBuildingMaker",props:{apiClient:{type:Object,required:!0},space:{type:Object,required:!0},project:{type:Object,required:!0},model:{type:Object,default:null}},emits:["metaBuilding-created","metaBuilding-updated","metaBuilding-deleted"],setup(e,{emit:t}){let i=e,o=t,r=Object.freeze({FORM:"form",LIST:"list",VIEW:"view"}),n=$Y(i.apiClient,i.space,i.project),a=pe(!1);pr("service",n),pr("loading",a);let s=pe(r.LIST),l=pe([]),c=pe(null),d=async()=>{a.value=!0,l.value=await n.fetchPhotosphereBuildings(),a.value=!1},u=async g=>{await n.deleteMetaBuilding(g),d(),o("metaBuilding-deleted")},A=g=>{c.value=g??null,s.value=r.FORM},h=g=>{c.value=g,s.value=r.VIEW},p=async g=>{await d(),h(g),o("metaBuilding-created")},f=()=>{d(),s.value=r.LIST,o("metaBuilding-updated")},m=()=>{s.value=r.LIST};return xt(()=>i.model,g=>{g&&h(g)},{immediate:!0}),Di(()=>d()),(g,y)=>{let v=I("BIMDataIconArrow"),C=I("BIMDataButton"),x=I("BIMDataSpinner");return k(),N("div",xIt,[w("div",{class:"bimdata-building-maker__header",style:ve({visibility:s.value===mt(r).LIST?"hidden":"visible"})},[T(C,{class:"bimdata-building-maker__header__btn-back",ghost:"",radius:"",disabled:a.value.value,onClick:m},{default:j(()=>[T(v,{size:"xxs",margin:"0 6px 0 0"}),w("span",null,G(g.$t("BIMDataComponents.t.back")),1)]),_:1},8,["disabled"]),w("img",{src:mt(tm)},null,8,BIt),w("span",null,G(g.$t("PhotosphereBuilding.title")),1)],4),w("div",kIt,[T(Qi,{name:"fade",mode:"out-in"},{default:j(()=>[s.value===mt(r).FORM?(k(),W(tX,{key:0,type:mt(xP).PHOTOSPHERE_BUILDING,metaBuilding:c.value,onMetaBuildingCreated:p,onMetaBuildingUpdated:f},null,8,["type","metaBuilding"])):s.value===mt(r).VIEW&&c.value?(k(),W(CIt,{key:1,apiClient:e.apiClient,space:e.space,project:e.project,model:c.value,onClose:m},null,8,["apiClient","space","project","model"])):(k(),W(iX,{key:2,metaBuildings:l.value,onOpenMetaBuilding:h,onCreateMetaBuilding:A,onUpdateMetaBuilding:A,onDeleteMetaBuilding:u},null,8,["metaBuildings"]))]),_:1})]),T(Qi,{name:"fade"},{default:j(()=>[Tt(w("div",EIt,[T(x)],512),[[ui,a.value]])]),_:1})])}}},[["__scopeId","data-v-235bd404"]]),PIt={class:"overlay"},IIt={class:"safe-zone__icon"},SIt={class:"safe-zone__title"},DIt={class:"safe-zone__text"},TIt={class:"safe-zone__actions"},LIt=Q({__name:"BIMDataSafeZoneModal",props:{width:{type:String,default:"350px"},iconName:{type:String,default:"warning"}},setup(e){return(t,i)=>{let o=I("BIMDataIcon");return k(),N("div",PIt,[w("div",{class:"safe-zone",style:ve({width:e.width})},[w("div",IIt,[T(o,{name:e.iconName,size:"s",fill:"",color:"high"},null,8,["name"])]),w("h2",SIt,[Pt(t.$slots,"title",{},void 0,!0)]),w("div",DIt,[Pt(t.$slots,"text",{},void 0,!0)]),w("div",TIt,[Pt(t.$slots,"actions",{},void 0,!0)])],4)])}}},[["__scopeId","data-v-01a25253"]]),RIt=co({BIMDataBuildingMaker:()=>oX,BIMDataFileManager:()=>XMt,BIMDataGuidedTour:()=>vPt,BIMDataMetaBuildingStructure:()=>N$,BIMDataModelPreview:()=>$Pt,BIMDataPDFViewer:()=>P$,BIMDataPhotosphereBuilding:()=>V$,BIMDataPhotosphereBuildingMaker:()=>MIt,BIMDataSafeZoneModal:()=>LIt}),_It={name:"buildingMaker",component:{setup(){let{apiClient:e,cloudId:t,projectId:i}=bt("$viewer").api;return()=>Gr(oX,{apiClient:e,space:{id:t},project:{id:i}})}},window:{name:"buildingMaker",label:"Building Maker",noModel:!0,icon:{imgUri:tm}}},FIt={components:{BIMDataNumericalInput:Ij},setup(){let e=bt("$viewer"),t=bt("viewerPlan"),i=bt("root"),o=bt("close"),r=je(()=>i.editedBitmap?.plan),n=je(()=>i.editedBitmap?i.editedBitmap:{x:0,y:0,scale:0,angle:0,opacity:0}),a=UIt(n),{x:s,y:l,angle:c,scale:d}=a,u,A,h=new Map;return xt(r,(f,m)=>{m&&h.set(m.key,u),f||h.clear(),u=h.get(f?.key)??null,A=null}),xt([s,l,c,d],()=>{r.value&&(u||=r.value.plan.transform,A={translate:[s.value,l.value],rotate:c.value,scale:d.value},t.planObjectRegistry.updatePlanObjectsTransform(r.value,{oldTransform:u,newTransform:A}),u=A)}),{root:i,bitmap:n,...a,submit:async()=>{try{i.loading=!0,await Promise.all(i.bitmaps.filter(f=>f.edited).map(async f=>{let{x:m,y:g,scale:y,angle:v,opacity:C,plan:x}=f,B={...x.plan.transform},E={translate:[m,g],rotate:v,scale:y,opacity:C};t.planObjectRegistry.updatePlanObjectsTransform(x,{oldTransform:E,newTransform:B}),x.plan.transform||(x.plan.transform={}),Object.assign(x.plan.transform,E),await e.state.updatePlan(x,B),f.edited=!1}))}catch(f){console.error(f)}finally{i.loading=!1,o()}}}}};function UIt(e){let t={};return Object.entries({x:i=>i,y:i=>i,scale:i=>i,angle:i=>i<0||i>360?(i%360+360)%360:i,opacity:i=>i<0?0:i>1?1:i}).forEach(([i,o])=>{t[i]=je({get:()=>e.value[i],set:r=>e.value[i]=o(r)})}),t}var OIt={class:"synchronization__page__edit"},NIt={class:"synchronization__page__edit__content"},HIt={class:"synchronization__page__edit__content__unit-group"},VIt={class:"synchronization__page__edit__content__unit-group__element"},jIt={class:"synchronization__page__edit__content__unit-group__element"},QIt={class:"synchronization__page__edit__content__unit-group__element"},zIt={class:"synchronization__page__edit__content__unit"},qIt={class:"synchronization__page__edit__content__unit"},GIt={class:"synchronization__page__edit__content__img"},KIt=["src"],JIt={class:"synchronization__page__edit__validate"};function ZIt(e,t,i,o,r,n){let a=I("BIMDataNumericalInput"),s=I("BIMDataSlider"),l=I("BIMDataTextbox"),c=I("BIMDataButton");return k(),N("div",OIt,[w("div",NIt,[w("section",null,[w("span",null,G(e.$t("synchronization.location")),1),w("div",HIt,[w("div",VIt,[T(a,{modelValue:e.x,"onUpdate:modelValue":t[0]||=d=>e.x=d,label:"X",container:e.$viewer.localContext.el},null,8,["modelValue","container"])]),w("div",jIt,[T(a,{modelValue:e.y,"onUpdate:modelValue":t[1]||=d=>e.y=d,label:"Y",container:e.$viewer.localContext.el},null,8,["modelValue","container"])]),w("div",QIt,[T(a,{modelValue:e.scale,"onUpdate:modelValue":t[2]||=d=>e.scale=d,label:e.$t("synchronization.scale"),step:.01,min:.01,container:e.$viewer.localContext.el},null,8,["modelValue","label","container"])])])]),w("section",null,[w("span",null,G(e.$t("synchronization.rotation")),1),w("div",zIt,[T(a,{modelValue:e.angle,"onUpdate:modelValue":t[3]||=d=>e.angle=d,unit:"\xB0",centered:""},null,8,["modelValue"]),T(s,{modelValue:e.angle,"onUpdate:modelValue":t[4]||=d=>e.angle=d,min:0,max:360},null,8,["modelValue"])])]),w("section",null,[w("span",null,G(e.$t("synchronization.alpha")),1),w("div",qIt,[T(a,{modelValue:e.opacity,"onUpdate:modelValue":t[5]||=d=>e.opacity=d,centered:""},null,8,["modelValue"]),T(s,{modelValue:e.opacity,"onUpdate:modelValue":t[6]||=d=>e.opacity=d,min:0,max:1,step:.01},null,8,["modelValue"])])]),w("section",null,[w("span",null,G(e.$t("synchronization.preview")),1),w("div",GIt,[w("img",{src:o.bitmap.dataUrl,alt:"Background"},null,8,KIt),T(l,{text:o.bitmap.name,class:"synchronization__page__edit__content__img__name"},null,8,["text"])])])]),w("div",JIt,[T(c,{width:"100%",color:"primary",fill:"",radius:"",onClick:o.submit},{default:j(()=>[nt(G(o.bitmap&&o.bitmap.plan?e.$t("global.save"):e.$t("global.validate")),1)]),_:1},8,["onClick"])])])}var WIt={name:"BimdataSynchronization",components:{edit:Q(FIt,[["render",ZIt],["__scopeId","data-v-63e956d5"]])},setup(){let{localContext:e}=bt("$viewer"),t=bt("$plugin"),i=e.pluginComponentInstances.get("plan");if(!i)throw Error("[Synchronization] plugin cannot work without viewerPlan plugin with 2d engine on.");i=un(i),pr("viewerPlan",i);let o=je(()=>e.loadedModels[0]);xt(o,h=>{!h||h.type!=="METABUILDING"?t.hide():t.show()},{immediate:!0}),xt(()=>t.shown,h=>{o.value?.type!=="METABUILDING"&&h&&t.hide()});let r=qo({page:"edit",loading:!1,modalDisplayed:!1,model:null,storeys:[],selectedStorey:null,plans:[],bitmaps:[],editedBitmap:null});pr("root",r);let n=()=>{r.editedBitmap&&(r.bitmaps.map(h=>(h.edit(!1),h)).filter(h=>h.edited).forEach(h=>{let{x:p,y:f,scale:m,angle:g,plan:y}=h,v=y.plan.transform,C={translate:[p,f],rotate:g,scale:m};i.planObjectRegistry.updatePlanObjectsTransform(y,{oldTransform:C,newTransform:v}),h.reset()}),r.modalDisplayed=!1,i.storeyRightOffset=0,e.showUI(),document.removeEventListener("keydown",d),r.editedBitmap=null,r.bitmaps=[])},a=()=>{n(),t.close()};pr("close",a);let s=()=>{r.bitmaps.some(h=>h.edited)?r.modalDisplayed=!0:a()},l=()=>{a()},c=h=>{r.editedBitmap=h},d=h=>{r.loading||h.key==="Escape"&&(h.preventDefault(),r.modalDisplayed?r.modalDisplayed=!1:a())},u=e.hub.on("model-loaded",({model:h})=>{r.model=h,r.storeys=h.storeys,r.plans=h.storeys.flatMap(p=>p.plans)},{getLastEvent:!0}),A=e.hub.on("storey-selected",({storey:h})=>{r.selectedStorey=h,(!h||h.plans.length<2)&&a()},{getLastEvent:!0});return $i(()=>{e.hub.off(u),e.hub.off(A)}),xt(()=>r.editedBitmap,(h,p)=>{p?.edit(!1),h?.edit(!0)},{immediate:!0}),{viewerPlan:i,root:r,onBitmapClick:c,onCloseClick:s,onLeaveClick:l,onKeyDown:d,clean:n}},async onOpen(){this.$viewer.localContext.pluginComponentInstances.forEach(t=>{t!==this&&t.$close?.()}),this.viewerPlan.storeyRightOffset=380,await this.$viewer.localContext.hideUI({exceptions:[this.$plugin.name]}),document.addEventListener("keydown",this.onKeyDown);let e=this.$viewer.localContext.selectedStorey?.plans.map(t=>t.key)??[];this.root.bitmaps=Array.from(this.viewerPlan.bitmaps.filter(t=>e.includes(t.plan.key))),this.root.editedBitmap=this.root.bitmaps[0],this.root.bitmaps.filter(t=>!t.visible).forEach(t=>{this.$viewer.localContext.showPlan(t.plan),t.show()}),this.viewerPlan.$refs.storeySelector?.focus()},onClose(){this.clean()}},YIt={class:"bimdata-synchronization"},XIt={class:"bimdata-synchronization__header"},$It={class:"bimdata-synchronization__header__top"},eSt={class:"bimdata-synchronization__header__top__title"},tSt={class:"bimdata-synchronization__header__top__title__text"},iSt={class:"bimdata-synchronization__header__select__header"},rSt={class:"bimdata-info-length bimdata-synchronization__header__select__header__length"},oSt={class:"bimdata-synchronization__page"},nSt={key:1,class:"bimdata-synchronization__modal"},aSt={class:"bimdata-synchronization__modal__content"},sSt={class:"bimdata-synchronization__modal__content__symbols"},lSt={class:"bimdata-synchronization__modal__content__buttons"};function cSt(e,t,i,o,r,n){let a=I("BIMDataLoading"),s=I("BIMDataIconSynchro2D"),l=I("BIMDataIconClose"),c=I("BIMDataButton"),d=I("BIMDataTextbox"),u=I("BIMDataDropdownList"),A=I("BIMDataIconWarning");return k(),N("div",YIt,[o.root.loading?(k(),W(a,{key:0})):le("",!0),w("div",XIt,[w("div",$It,[w("div",eSt,[T(s,{size:"xs",fill:"",color:"primary"}),w("span",tSt,G(e.$t("synchronization.title")),1)]),T(c,{class:"bimdata-synchronization__header__top__close",width:"25px",height:"25px",ghost:"",radius:"",icon:"",onClick:o.onCloseClick},{default:j(()=>[T(l,{size:"xs",fill:"",color:"granite-light"})]),_:1},8,["onClick"])]),w("div",null,[T(u,{width:"100%",list:o.root.bitmaps,"element-key":"id","per-page":30,"close-on-element-click":!0,class:"bimdata-synchronization__header__select",onElementClick:o.onBitmapClick},{header:j(()=>[w("div",iSt,[w("div",rSt,[w("span",null,G(o.root.bitmaps.length),1)]),w("div",null,[T(d,{width:"265px",text:o.root.editedBitmap?.name},null,8,["text"])])])]),element:j(({element:h})=>[w("div",{class:ye(["bimdata-synchronization__header__select__element",{"bimdata-synchronization__header__select__element--selected":h===o.root.editedBitmap}])},G(h.name),3)]),_:1},8,["list","onElementClick"])])]),w("div",oSt,[(k(),W(L3,null,[(k(),W(qr(o.root.page)))],1024))]),o.root.modalDisplayed?(k(),N("div",nSt,[w("div",aSt,[w("div",sSt,[T(A,{fill:"",color:"high",size:"l"}),w("div",null,G(e.$t("synchronization.warning")),1)]),w("div",lSt,[T(c,{width:"45%",color:"high",fill:"",radius:"",onClick:o.onLeaveClick},{default:j(()=>[nt(G(e.$t("synchronization.leave")),1)]),_:1},8,["onClick"]),T(c,{width:"45%",color:"default",outline:"",radius:"",onClick:t[0]||=h=>o.root.modalDisplayed=!1},{default:j(()=>[nt(G(e.$t("synchronization.stay")),1)]),_:1})])])])):le("",!0)])}var dSt={name:"synchronization",i18n:{de:{tooltip:"2D-Synchronisierung",title:"2D-Synchronisierung",start:"Beginnen",description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",select_storey:"Eine Etage ausw\xE4hlen",import_file:"Eine Datei importieren",location:"Position",scale:"Skala",rotation:"Rotation",alpha:"Undurchsichtigkeit",preview:"\xDCbersicht",import:"Ein Element importieren",from_ged:"Von der DMS des Projekts aus",from_computer:"Von Ihrem Computer aus",no_storey:"Um einen Hintergrund hinzuzuf\xFCgen, w\xE4hlen Sie bitte eine IFC und eine Etage aus.",no_ifc:"Um einen Hintergrund hinzuzuf\xFCgen, w\xE4hlen Sie bitte eine IFC aus.",warning:"M\xF6chten Sie diese Seite wirklich verlassen? Sie enth\xE4lt m\xF6glicherweise Informationen, die nicht best\xE4tigt sind.",leave:"Ja, diese Seite verlassen",stay:"Abbrechen, hierbleiben"},en:{tooltip:"2D Synchronization",title:"2D Synchronization",start:"Start",description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",select_storey:"Select a storey",import_file:"Import a file",location:"Position",scale:"Scale",rotation:"Rotation",alpha:"Opacity",preview:"Preview",import:"Import an element",from_ged:"From the project's DMS",from_computer:"From your computer",no_storey:"To add a background, please select an IFC and a storey.",no_ifc:"To add a background, please select an IFC with at least one storey.",warning:"Are you sure you want to leave this page? There may be some information that is not validated.",leave:"Yes, leave this page",stay:"Cancel, stay here"},es:{tooltip:"Sincronizaci\xF3n 2D",title:"Sincronizaci\xF3n 2D",start:"Comenzar",description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",select_storey:"Seleccionar una planta",import_file:"Importar un fichero",location:"Posici\xF3n",scale:"Escala",rotation:"Rotaci\xF3n",alpha:"Opacidad",preview:"Vista r\xE1pida",import:"Importar un elemento",from_ged:"Desde el GED del proyecto",from_computer:"Desde su ordenador",no_storey:"Para agregar un fondo seleccione un IFC y una planta.",no_ifc:"Para agregar un fondo seleccione un IFC.",warning:"\xBFEsta usted seguro de que quiere abandonar esta p\xE1gina? Puede haber informaciones no validadas.",leave:"S\xED, abandonar la p\xE1gina",stay:"Cancelar, permanecer aqu\xED"},fr:{tooltip:"Synchronisation 2D",title:"Synchronisation 2D",start:"Commencer",description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",select_storey:"S\xE9lectionner un \xE9tage",import_file:"Importer un fichier",location:"Position",scale:"Echelle",rotation:"Rotation",alpha:"Opacit\xE9",preview:"Aper\xE7u",import:"Importer un \xE9l\xE9ment",from_ged:"Depuis la GED du projet",from_computer:"Depuis votre ordinateur",no_storey:"Pour ajouter un fond, veuillez selectionner un IFC et un \xE9tage.",no_ifc:"Pour ajouter un fond, veuillez selectionner un IFC avec au moins un \xE9tage.",warning:"\xCAtes-vous s\xFBr de vouloir quitter cette page ? Il y'a peut-\xEAtre des informations non valid\xE9es.",leave:"Oui, quitter cette page",stay:"Annuler, rester ici"},it:{tooltip:"Sincronizzazione 2D",title:"Sincronizzazione 2D",start:"Iniziare",description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",select_storey:"Selezionare un piano",import_file:"Importare un file",location:"Posizione",scale:"Scala",rotation:"Rotazione",alpha:"Opacit\xE0",preview:"Anteprima",import:"Importare un elemento",from_ged:"Dal cassetto informatico del progetto",from_computer:"Dal computer",no_storey:"Per aggiungere uno sfondo, selezionare un file IFC e un piano.",no_ifc:"Per aggiungere uno sfondo, selezionare un file IFC.",warning:"Si \xE8 sicuri di voler lasciare questa pagina? \xC8 possibile che alcune informazioni non siano state ancora convalidate.",leave:"S\xEC, uscire da questa pagina",stay:"Annulla, rimanere a questa pagina"}},component:Q(WIt,[["render",cSt],["__scopeId","data-v-98c2db44"]]),button:{tooltip:"synchronization.tooltip",position:"right",stance:1,content:"free",keepOpen:!0,icon:{imgUri:"data:image/svg+xml,%3csvg%20width='30'%20height='30'%20viewBox='0%200%2030%2030'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='6.52344'%20y='4.25488'%20width='16.1039'%20height='21.7744'%20stroke='%232F374A'/%3e%3crect%20x='3.12646'%20y='13.0261'%20width='14'%20height='20.043'%20transform='rotate(-45%203.12646%2013.0261)'%20fill='%232F374A'/%3e%3cmask%20id='path-3-outside-1_1838_531'%20maskUnits='userSpaceOnUse'%20x='-0.414214'%20y='-0.414216'%20width='31.1127'%20height='31.1127'%20fill='black'%3e%3crect%20fill='white'%20x='-0.414214'%20y='-0.414216'%20width='31.1127'%20height='31.1127'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.41421%2013.0208L4.35876%2014.9654L5.06586%2014.2582L3.82843%2013.0208L5.15425%2011.695L4.44715%2010.9879L2.41421%2013.0208ZM5.68458%209.75044L6.39169%2010.4576L10.4576%206.39169L9.75045%205.68458L5.68458%209.75044ZM10.9879%204.44714L11.695%205.15425L13.0208%203.82842L14.2583%205.06586L14.9654%204.35875L13.0208%202.41421L10.9879%204.44714ZM16.026%205.41942L15.3189%206.12652L19.208%2010.0156L19.9151%209.3085L16.026%205.41942ZM20.9758%2010.3692L20.2687%2011.0763L24.1577%2014.9654L24.8649%2014.2582L20.9758%2010.3692ZM25.9255%2015.3189L25.2184%2016.026L26.4558%2017.2635L25.13%2018.5893L25.8371%2019.2964L27.8701%2017.2635L25.9255%2015.3189ZM24.5997%2020.5338L23.8926%2019.8267L19.8267%2023.8926L20.5338%2024.5997L24.5997%2020.5338ZM19.2964%2025.8371L18.5893%2025.13L17.2635%2026.4558L16.026%2025.2184L15.3189%2025.9255L17.2635%2027.8701L19.2964%2025.8371ZM14.2583%2024.8649L14.9654%2024.1577L11.0763%2020.2687L10.3692%2020.9758L14.2583%2024.8649ZM9.3085%2019.9151L10.0156%2019.208L6.12652%2015.3189L5.41942%2016.026L9.3085%2019.9151Z'/%3e%3cpath%20d='M1%2013.0208L3.12132%2010.8995L5.24264%2013.0208L3.12132%2015.1421L1%2013.0208Z'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.12132%2012.3137L2.41421%2013.0208L3.12132%2013.7279L3.82843%2013.0208L3.12132%2012.3137ZM1%2013.0208L3.12132%2015.1421L5.24264%2013.0208L3.12132%2010.8995L1%2013.0208Z'/%3e%3cpath%20d='M10.8995%203.12132L13.0208%200.999998L15.1421%203.12132L13.0208%205.24264L10.8995%203.12132Z'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.0208%202.41421L12.3137%203.12132L13.0208%203.82842L13.7279%203.12132L13.0208%202.41421ZM10.8995%203.12132L13.0208%205.24264L15.1421%203.12132L13.0208%200.999998L10.8995%203.12132Z'/%3e%3cpath%20d='M25.0416%2017.2635L27.163%2015.1421L29.2843%2017.2635L27.163%2019.3848L25.0416%2017.2635Z'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M27.163%2016.5563L26.4558%2017.2635L27.163%2017.9706L27.8701%2017.2635L27.163%2016.5563ZM25.0416%2017.2635L27.163%2019.3848L29.2843%2017.2635L27.163%2015.1421L25.0416%2017.2635Z'/%3e%3cpath%20d='M15.1421%2027.1629L17.2635%2025.0416L19.3848%2027.1629L17.2635%2029.2843L15.1421%2027.1629Z'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.2635%2026.4558L16.5563%2027.1629L17.2635%2027.8701L17.9706%2027.1629L17.2635%2026.4558ZM15.1421%2027.1629L17.2635%2029.2843L19.3848%2027.1629L17.2635%2025.0416L15.1421%2027.1629Z'/%3e%3c/mask%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.41421%2013.0208L4.35876%2014.9654L5.06586%2014.2582L3.82843%2013.0208L5.15425%2011.695L4.44715%2010.9879L2.41421%2013.0208ZM5.68458%209.75044L6.39169%2010.4576L10.4576%206.39169L9.75045%205.68458L5.68458%209.75044ZM10.9879%204.44714L11.695%205.15425L13.0208%203.82842L14.2583%205.06586L14.9654%204.35875L13.0208%202.41421L10.9879%204.44714ZM16.026%205.41942L15.3189%206.12652L19.208%2010.0156L19.9151%209.3085L16.026%205.41942ZM20.9758%2010.3692L20.2687%2011.0763L24.1577%2014.9654L24.8649%2014.2582L20.9758%2010.3692ZM25.9255%2015.3189L25.2184%2016.026L26.4558%2017.2635L25.13%2018.5893L25.8371%2019.2964L27.8701%2017.2635L25.9255%2015.3189ZM24.5997%2020.5338L23.8926%2019.8267L19.8267%2023.8926L20.5338%2024.5997L24.5997%2020.5338ZM19.2964%2025.8371L18.5893%2025.13L17.2635%2026.4558L16.026%2025.2184L15.3189%2025.9255L17.2635%2027.8701L19.2964%2025.8371ZM14.2583%2024.8649L14.9654%2024.1577L11.0763%2020.2687L10.3692%2020.9758L14.2583%2024.8649ZM9.3085%2019.9151L10.0156%2019.208L6.12652%2015.3189L5.41942%2016.026L9.3085%2019.9151Z'%20fill='%232F374A'/%3e%3cpath%20d='M1%2013.0208L3.12132%2010.8995L5.24264%2013.0208L3.12132%2015.1421L1%2013.0208Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.12132%2012.3137L2.41421%2013.0208L3.12132%2013.7279L3.82843%2013.0208L3.12132%2012.3137ZM1%2013.0208L3.12132%2015.1421L5.24264%2013.0208L3.12132%2010.8995L1%2013.0208Z'%20fill='%232F374A'/%3e%3cpath%20d='M10.8995%203.12132L13.0208%200.999998L15.1421%203.12132L13.0208%205.24264L10.8995%203.12132Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.0208%202.41421L12.3137%203.12132L13.0208%203.82842L13.7279%203.12132L13.0208%202.41421ZM10.8995%203.12132L13.0208%205.24264L15.1421%203.12132L13.0208%200.999998L10.8995%203.12132Z'%20fill='%232F374A'/%3e%3cpath%20d='M25.0416%2017.2635L27.163%2015.1421L29.2843%2017.2635L27.163%2019.3848L25.0416%2017.2635Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M27.163%2016.5563L26.4558%2017.2635L27.163%2017.9706L27.8701%2017.2635L27.163%2016.5563ZM25.0416%2017.2635L27.163%2019.3848L29.2843%2017.2635L27.163%2015.1421L25.0416%2017.2635Z'%20fill='%232F374A'/%3e%3cpath%20d='M15.1421%2027.1629L17.2635%2025.0416L19.3848%2027.1629L17.2635%2029.2843L15.1421%2027.1629Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.2635%2026.4558L16.5563%2027.1629L17.2635%2027.8701L17.9706%2027.1629L17.2635%2026.4558ZM15.1421%2027.1629L17.2635%2029.2843L19.3848%2027.1629L17.2635%2025.0416L15.1421%2027.1629Z'%20fill='%232F374A'/%3e%3cpath%20d='M1%2013.0208L0.646447%2012.6673L0.292893%2013.0208L0.646447%2013.3744L1%2013.0208ZM3.12132%2010.8995L3.47487%2010.5459L3.12132%2010.1924L2.76777%2010.5459L3.12132%2010.8995ZM5.24264%2013.0208L5.59619%2013.3744L5.94975%2013.0208L5.59619%2012.6673L5.24264%2013.0208ZM3.12132%2015.1421L2.76777%2015.4957L3.12132%2015.8492L3.47487%2015.4957L3.12132%2015.1421ZM10.8995%203.12132L10.5459%202.76776L10.1924%203.12132L10.5459%203.47487L10.8995%203.12132ZM13.0208%200.999998L13.3744%200.646445L13.0208%200.292891L12.6673%200.646445L13.0208%200.999998ZM15.1421%203.12132L15.4957%203.47487L15.8492%203.12132L15.4957%202.76776L15.1421%203.12132ZM13.0208%205.24264L12.6673%205.59619L13.0208%205.94975L13.3744%205.59619L13.0208%205.24264ZM25.0416%2017.2635L24.6881%2016.9099L24.3345%2017.2635L24.6881%2017.617L25.0416%2017.2635ZM27.163%2015.1421L27.5165%2014.7886L27.163%2014.435L26.8094%2014.7886L27.163%2015.1421ZM29.2843%2017.2635L29.6378%2017.617L29.9914%2017.2635L29.6378%2016.9099L29.2843%2017.2635ZM27.163%2019.3848L26.8094%2019.7383L27.163%2020.0919L27.5165%2019.7383L27.163%2019.3848ZM15.1421%2027.1629L14.7886%2026.8094L14.435%2027.1629L14.7886%2027.5165L15.1421%2027.1629ZM17.2635%2025.0416L17.617%2024.6881L17.2635%2024.3345L16.9099%2024.6881L17.2635%2025.0416ZM19.3848%2027.1629L19.7383%2027.5165L20.0919%2027.1629L19.7383%2026.8094L19.3848%2027.1629ZM17.2635%2029.2843L16.9099%2029.6378L17.2635%2029.9914L17.617%2029.6378L17.2635%2029.2843ZM1.35355%2013.3744L3.47487%2011.253L2.76777%2010.5459L0.646447%2012.6673L1.35355%2013.3744ZM2.76777%2011.253L4.88909%2013.3744L5.59619%2012.6673L3.47487%2010.5459L2.76777%2011.253ZM4.88909%2012.6673L2.76777%2014.7886L3.47487%2015.4957L5.59619%2013.3744L4.88909%2012.6673ZM3.47487%2014.7886L1.35355%2012.6673L0.646447%2013.3744L2.76777%2015.4957L3.47487%2014.7886ZM11.253%203.47487L13.3744%201.35355L12.6673%200.646445L10.5459%202.76776L11.253%203.47487ZM12.6673%201.35355L14.7886%203.47487L15.4957%202.76776L13.3744%200.646445L12.6673%201.35355ZM14.7886%202.76776L12.6673%204.88909L13.3744%205.59619L15.4957%203.47487L14.7886%202.76776ZM13.3744%204.88909L11.253%202.76776L10.5459%203.47487L12.6673%205.59619L13.3744%204.88909ZM25.3952%2017.617L27.5165%2015.4957L26.8094%2014.7886L24.6881%2016.9099L25.3952%2017.617ZM26.8094%2015.4957L28.9307%2017.617L29.6378%2016.9099L27.5165%2014.7886L26.8094%2015.4957ZM28.9307%2016.9099L26.8094%2019.0312L27.5165%2019.7383L29.6378%2017.617L28.9307%2016.9099ZM27.5165%2019.0312L25.3952%2016.9099L24.6881%2017.617L26.8094%2019.7383L27.5165%2019.0312ZM15.4957%2027.5165L17.617%2025.3952L16.9099%2024.6881L14.7886%2026.8094L15.4957%2027.5165ZM16.9099%2025.3952L19.0312%2027.5165L19.7383%2026.8094L17.617%2024.6881L16.9099%2025.3952ZM19.0312%2026.8094L16.9099%2028.9307L17.617%2029.6378L19.7383%2027.5165L19.0312%2026.8094ZM17.617%2028.9307L15.4957%2026.8094L14.7886%2027.5165L16.9099%2029.6378L17.617%2028.9307ZM2.41421%2013.0208L1.70711%2012.3137L1%2013.0208L1.70711%2013.7279L2.41421%2013.0208ZM4.35876%2014.9654L3.65165%2015.6725L4.35876%2016.3796L5.06586%2015.6725L4.35876%2014.9654ZM5.06586%2014.2582L5.77297%2014.9654L6.48008%2014.2582L5.77297%2013.5511L5.06586%2014.2582ZM5.15425%2011.695L5.86136%2012.4021L6.56847%2011.695L5.86136%2010.9879L5.15425%2011.695ZM4.44715%2010.9879L5.15425%2010.2808L4.44715%209.57367L3.74004%2010.2808L4.44715%2010.9879ZM5.68458%209.75044L4.97748%209.04334L4.27037%209.75044L4.97748%2010.4576L5.68458%209.75044ZM6.39169%2010.4576L5.68458%2011.1647L6.39169%2011.8718L7.0988%2011.1647L6.39169%2010.4576ZM10.4576%206.39169L11.1647%207.09879L11.8718%206.39169L11.1647%205.68458L10.4576%206.39169ZM9.75045%205.68458L10.4576%204.97747L9.75045%204.27037L9.04334%204.97747L9.75045%205.68458ZM10.9879%204.44714L10.2808%203.74004L9.57367%204.44714L10.2808%205.15425L10.9879%204.44714ZM11.695%205.15425L10.9879%205.86136L11.695%206.56846L12.4021%205.86136L11.695%205.15425ZM14.2583%205.06586L13.5511%205.77297L14.2583%206.48008L14.9654%205.77297L14.2583%205.06586ZM14.9654%204.35875L15.6725%205.06586L16.3796%204.35875L15.6725%203.65165L14.9654%204.35875ZM13.0208%202.41421L13.7279%201.7071L13.0208%200.999998L12.3137%201.7071L13.0208%202.41421ZM16.026%205.41942L16.7331%204.71231L16.026%204.0052L15.3189%204.71231L16.026%205.41942ZM15.3189%206.12652L14.6118%205.41942L13.9047%206.12652L14.6118%206.83363L15.3189%206.12652ZM19.208%2010.0156L18.5009%2010.7227L19.208%2011.4298L19.9151%2010.7227L19.208%2010.0156ZM19.9151%209.3085L20.6222%2010.0156L21.3293%209.3085L20.6222%208.6014L19.9151%209.3085ZM20.9758%2010.3692L21.6829%209.66206L20.9758%208.95495L20.2687%209.66206L20.9758%2010.3692ZM20.2687%2011.0763L19.5616%2010.3692L18.8544%2011.0763L19.5616%2011.7834L20.2687%2011.0763ZM24.1577%2014.9654L23.4506%2015.6725L24.1577%2016.3796L24.8649%2015.6725L24.1577%2014.9654ZM24.8649%2014.2582L25.572%2014.9654L26.2791%2014.2582L25.572%2013.5511L24.8649%2014.2582ZM25.9255%2015.3189L26.6326%2014.6118L25.9255%2013.9047L25.2184%2014.6118L25.9255%2015.3189ZM25.2184%2016.026L24.5113%2015.3189L23.8042%2016.026L24.5113%2016.7331L25.2184%2016.026ZM25.13%2018.5893L24.4229%2017.8822L23.7158%2018.5893L24.4229%2019.2964L25.13%2018.5893ZM25.8371%2019.2964L25.13%2020.0035L25.8371%2020.7106L26.5442%2020.0035L25.8371%2019.2964ZM27.8701%2017.2635L28.5772%2017.9706L29.2843%2017.2635L28.5772%2016.5563L27.8701%2017.2635ZM24.5997%2020.5338L25.3068%2021.2409L26.0139%2020.5338L25.3068%2019.8267L24.5997%2020.5338ZM23.8926%2019.8267L24.5997%2019.1196L23.8926%2018.4125L23.1855%2019.1196L23.8926%2019.8267ZM19.8267%2023.8926L19.1196%2023.1855L18.4125%2023.8926L19.1196%2024.5997L19.8267%2023.8926ZM20.5338%2024.5997L19.8267%2025.3068L20.5338%2026.0139L21.2409%2025.3068L20.5338%2024.5997ZM19.2964%2025.8371L20.0035%2026.5442L20.7106%2025.8371L20.0035%2025.13L19.2964%2025.8371ZM18.5893%2025.13L19.2964%2024.4229L18.5893%2023.7158L17.8822%2024.4229L18.5893%2025.13ZM16.026%2025.2184L16.7331%2024.5113L16.026%2023.8042L15.3189%2024.5113L16.026%2025.2184ZM15.3189%2025.9255L14.6118%2025.2184L13.9047%2025.9255L14.6118%2026.6326L15.3189%2025.9255ZM17.2635%2027.8701L16.5563%2028.5772L17.2635%2029.2843L17.9706%2028.5772L17.2635%2027.8701ZM14.2583%2024.8649L13.5511%2025.572L14.2583%2026.2791L14.9654%2025.572L14.2583%2024.8649ZM14.9654%2024.1577L15.6725%2024.8649L16.3796%2024.1577L15.6725%2023.4506L14.9654%2024.1577ZM11.0763%2020.2687L11.7834%2019.5616L11.0763%2018.8544L10.3692%2019.5616L11.0763%2020.2687ZM10.3692%2020.9758L9.66206%2020.2687L8.95495%2020.9758L9.66206%2021.6829L10.3692%2020.9758ZM9.3085%2019.9151L8.6014%2020.6222L9.3085%2021.3293L10.0156%2020.6222L9.3085%2019.9151ZM10.0156%2019.208L10.7227%2019.9151L11.4298%2019.208L10.7227%2018.5009L10.0156%2019.208ZM6.12652%2015.3189L6.83363%2014.6118L6.12652%2013.9047L5.41942%2014.6118L6.12652%2015.3189ZM5.41942%2016.026L4.71231%2015.3189L4.0052%2016.026L4.71231%2016.7331L5.41942%2016.026ZM3.12132%2012.3137L3.82843%2011.6066L3.12132%2010.8995L2.41421%2011.6066L3.12132%2012.3137ZM3.12132%2013.7279L2.41421%2014.435L3.12132%2015.1421L3.82843%2014.435L3.12132%2013.7279ZM12.3137%203.12132L11.6066%202.41421L10.8995%203.12132L11.6066%203.82842L12.3137%203.12132ZM13.7279%203.12132L14.435%203.82842L15.1421%203.12132L14.435%202.41421L13.7279%203.12132ZM27.163%2016.5563L27.8701%2015.8492L27.163%2015.1421L26.4558%2015.8492L27.163%2016.5563ZM27.163%2017.9706L26.4558%2018.6777L27.163%2019.3848L27.8701%2018.6777L27.163%2017.9706ZM16.5563%2027.1629L15.8492%2026.4558L15.1421%2027.1629L15.8492%2027.8701L16.5563%2027.1629ZM17.9706%2027.1629L18.6777%2027.8701L19.3848%2027.1629L18.6777%2026.4558L17.9706%2027.1629ZM5.06586%2015.6725L5.77297%2014.9654L4.35876%2013.5511L3.65165%2014.2582L5.06586%2015.6725ZM5.86136%2010.9879L5.15425%2010.2808L3.74004%2011.695L4.44715%2012.4021L5.86136%2010.9879ZM4.97748%2010.4576L5.68458%2011.1647L7.0988%209.75044L6.39169%209.04334L4.97748%2010.4576ZM11.1647%205.68458L10.4576%204.97747L9.04334%206.39169L9.75045%207.09879L11.1647%205.68458ZM10.2808%205.15425L10.9879%205.86136L12.4021%204.44714L11.695%203.74004L10.2808%205.15425ZM14.9654%205.77297L15.6725%205.06586L14.2583%203.65165L13.5511%204.35875L14.9654%205.77297ZM15.3189%204.71231L14.6118%205.41942L16.026%206.83363L16.7331%206.12652L15.3189%204.71231ZM19.9151%2010.7227L20.6222%2010.0156L19.208%208.6014L18.5009%209.3085L19.9151%2010.7227ZM20.2687%209.66206L19.5616%2010.3692L20.9758%2011.7834L21.6829%2011.0763L20.2687%209.66206ZM24.8649%2015.6725L25.572%2014.9654L24.1577%2013.5511L23.4506%2014.2582L24.8649%2015.6725ZM25.2184%2014.6118L24.5113%2015.3189L25.9255%2016.7331L26.6326%2016.026L25.2184%2014.6118ZM24.4229%2019.2964L25.13%2020.0035L26.5442%2018.5893L25.8371%2017.8822L24.4229%2019.2964ZM25.3068%2019.8267L24.5997%2019.1196L23.1855%2020.5338L23.8926%2021.2409L25.3068%2019.8267ZM19.1196%2024.5997L19.8267%2025.3068L21.2409%2023.8926L20.5338%2023.1855L19.1196%2024.5997ZM20.0035%2025.13L19.2964%2024.4229L17.8822%2025.8371L18.5893%2026.5442L20.0035%2025.13ZM15.3189%2024.5113L14.6118%2025.2184L16.026%2026.6326L16.7331%2025.9255L15.3189%2024.5113ZM14.9654%2025.572L15.6725%2024.8649L14.2583%2023.4506L13.5511%2024.1577L14.9654%2025.572ZM10.3692%2019.5616L9.66206%2020.2687L11.0763%2021.6829L11.7834%2020.9758L10.3692%2019.5616ZM10.0156%2020.6222L10.7227%2019.9151L9.3085%2018.5009L8.6014%2019.208L10.0156%2020.6222ZM5.41942%2014.6118L4.71231%2015.3189L6.12652%2016.7331L6.83363%2016.026L5.41942%2014.6118ZM3.12132%2013.7279L5.15425%2011.695L3.74004%2010.2808L1.70711%2012.3137L3.12132%2013.7279ZM5.06586%2014.2582L3.12132%2012.3137L1.70711%2013.7279L3.65165%2015.6725L5.06586%2014.2582ZM5.77297%2013.5511L4.53553%2012.3137L3.12132%2013.7279L4.35876%2014.9654L5.77297%2013.5511ZM4.53553%2013.7279L5.86136%2012.4021L4.44715%2010.9879L3.12132%2012.3137L4.53553%2013.7279ZM7.0988%2011.1647L11.1647%207.09879L9.75045%205.68458L5.68458%209.75044L7.0988%2011.1647ZM6.39169%2010.4576L10.4576%206.39169L9.04334%204.97747L4.97748%209.04334L6.39169%2010.4576ZM12.4021%205.86136L13.7279%204.53553L12.3137%203.12132L10.9879%204.44714L12.4021%205.86136ZM12.3137%204.53553L13.5511%205.77297L14.9654%204.35875L13.7279%203.12132L12.3137%204.53553ZM12.3137%203.12132L14.2583%205.06586L15.6725%203.65165L13.7279%201.7071L12.3137%203.12132ZM11.695%205.15425L13.7279%203.12132L12.3137%201.7071L10.2808%203.74004L11.695%205.15425ZM14.6118%206.83363L18.5009%2010.7227L19.9151%209.3085L16.026%205.41942L14.6118%206.83363ZM15.3189%206.12652L19.208%2010.0156L20.6222%208.6014L16.7331%204.71231L15.3189%206.12652ZM19.5616%2011.7834L23.4506%2015.6725L24.8649%2014.2582L20.9758%2010.3692L19.5616%2011.7834ZM20.2687%2011.0763L24.1577%2014.9654L25.572%2013.5511L21.6829%209.66206L20.2687%2011.0763ZM24.5113%2016.7331L25.7487%2017.9706L27.163%2016.5563L25.9255%2015.3189L24.5113%2016.7331ZM25.7487%2016.5563L24.4229%2017.8822L25.8371%2019.2964L27.163%2017.9706L25.7487%2016.5563ZM27.163%2016.5563L25.13%2018.5893L26.5442%2020.0035L28.5772%2017.9706L27.163%2016.5563ZM25.2184%2016.026L27.163%2017.9706L28.5772%2016.5563L26.6326%2014.6118L25.2184%2016.026ZM23.1855%2019.1196L19.1196%2023.1855L20.5338%2024.5997L24.5997%2020.5338L23.1855%2019.1196ZM23.8926%2019.8267L19.8267%2023.8926L21.2409%2025.3068L25.3068%2021.2409L23.8926%2019.8267ZM17.8822%2024.4229L16.5563%2025.7487L17.9706%2027.1629L19.2964%2025.8371L17.8822%2024.4229ZM17.9706%2025.7487L16.7331%2024.5113L15.3189%2025.9255L16.5563%2027.1629L17.9706%2025.7487ZM17.9706%2027.1629L16.026%2025.2184L14.6118%2026.6326L16.5563%2028.5772L17.9706%2027.1629ZM18.5893%2025.13L16.5563%2027.1629L17.9706%2028.5772L20.0035%2026.5442L18.5893%2025.13ZM15.6725%2023.4506L11.7834%2019.5616L10.3692%2020.9758L14.2583%2024.8649L15.6725%2023.4506ZM14.9654%2024.1577L11.0763%2020.2687L9.66206%2021.6829L13.5511%2025.572L14.9654%2024.1577ZM10.7227%2018.5009L6.83363%2014.6118L5.41942%2016.026L9.3085%2019.9151L10.7227%2018.5009ZM10.0156%2019.208L6.12652%2015.3189L4.71231%2016.7331L8.6014%2020.6222L10.0156%2019.208ZM3.12132%2013.7279L3.82843%2013.0208L2.41421%2011.6066L1.70711%2012.3137L3.12132%2013.7279ZM3.82843%2013.0208L3.12132%2012.3137L1.70711%2013.7279L2.41421%2014.435L3.82843%2013.0208ZM3.12132%2012.3137L2.41421%2013.0208L3.82843%2014.435L4.53553%2013.7279L3.12132%2012.3137ZM2.41421%2013.0208L3.12132%2013.7279L4.53553%2012.3137L3.82843%2011.6066L2.41421%2013.0208ZM13.0208%203.82842L13.7279%203.12132L12.3137%201.7071L11.6066%202.41421L13.0208%203.82842ZM13.7279%203.12132L13.0208%202.41421L11.6066%203.82842L12.3137%204.53553L13.7279%203.12132ZM13.0208%202.41421L12.3137%203.12132L13.7279%204.53553L14.435%203.82842L13.0208%202.41421ZM12.3137%203.12132L13.0208%203.82842L14.435%202.41421L13.7279%201.7071L12.3137%203.12132ZM27.163%2017.9706L27.8701%2017.2635L26.4558%2015.8492L25.7487%2016.5563L27.163%2017.9706ZM27.8701%2017.2635L27.163%2016.5563L25.7487%2017.9706L26.4558%2018.6777L27.8701%2017.2635ZM27.163%2016.5563L26.4558%2017.2635L27.8701%2018.6777L28.5772%2017.9706L27.163%2016.5563ZM26.4558%2017.2635L27.163%2017.9706L28.5772%2016.5563L27.8701%2015.8492L26.4558%2017.2635ZM17.2635%2027.8701L17.9706%2027.1629L16.5563%2025.7487L15.8492%2026.4558L17.2635%2027.8701ZM17.9706%2027.1629L17.2635%2026.4558L15.8492%2027.8701L16.5563%2028.5772L17.9706%2027.1629ZM17.2635%2026.4558L16.5563%2027.1629L17.9706%2028.5772L18.6777%2027.8701L17.2635%2026.4558ZM16.5563%2027.1629L17.2635%2027.8701L18.6777%2026.4558L17.9706%2025.7487L16.5563%2027.1629Z'%20fill='white'%20mask='url(%23path-3-outside-1_1838_531)'/%3e%3c/svg%3e"}}},uSt={name:"anchor-synchronization",i18n:{de:Tj,en:Lj,es:Rj,fr:_j,it:Fj},i18nTokenPrefix:"viewer2d-background",addToWindows:["2d"],component:Dj,anchorSynchronization:!0,button:{tooltip:"viewer2d-background.tooltip-anchor-synchronization",position:"right",content:"free",keepOpen:!0,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.41394%209.62621L11.4418%2013.8807L18.5438%209.5459L21.4788%2011.2012L11.4522%2017.3112L1.47266%2011.2795L4.41394%209.62621Z'%20fill='%232F374A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11.4418%2017.9342L4.41439%2013.6799L1.47266%2015.3335L11.4522%2021.3651L21.4788%2015.2552L18.5433%2013.5996L11.4418%2017.9342ZM18.5621%2014.6894L11.4438%2019.0342L4.39683%2014.7681L3.33862%2015.3629L11.4502%2020.2656L19.621%2015.2865L18.5621%2014.6894Z'%20fill='%232F374A'/%3e%3crect%20x='17.7969'%20width='5.07596'%20height='1.00266'%20fill='%232F374A'/%3e%3crect%20x='22.873'%20width='5.07596'%20height='1.00266'%20transform='rotate(90%2022.873%200)'%20fill='%232F374A'/%3e%3crect%20x='22.873'%20y='17.9229'%20width='5.07596'%20height='1.00266'%20transform='rotate(90%2022.873%2017.9229)'%20fill='%232F374A'/%3e%3crect%20x='22.873'%20y='23'%20width='5.07596'%20height='1.00266'%20transform='rotate(-180%2022.873%2023)'%20fill='%232F374A'/%3e%3crect%20width='5.07596'%20height='1.00266'%20transform='matrix(-1%200%200%201%205.07617%200)'%20fill='%232F374A'/%3e%3crect%20width='5.07596'%20height='1.00266'%20transform='matrix(4.37114e-08%201%201%20-4.37114e-08%200%200)'%20fill='%232F374A'/%3e%3crect%20width='5.07596'%20height='1.00266'%20transform='matrix(4.37114e-08%201%201%20-4.37114e-08%200%2017.9229)'%20fill='%232F374A'/%3e%3crect%20width='5.07596'%20height='1.00266'%20transform='matrix(1%20-8.74228e-08%20-8.74228e-08%20-1%200%2023)'%20fill='%232F374A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9.39866%202.7199L11.5619%201.50391L13.5913%202.64842L11.4369%203.89253L9.39866%202.7199ZM8.62875%203.15267L6.70871%204.23195L8.78367%205.42476L10.6773%204.33121L8.62875%203.15267ZM5.9388%204.66472L4.10291%205.6967L6.21181%206.90997L8.02403%205.86344L5.9388%204.66472ZM3.33301%206.12947L1.47266%207.1752L3.56388%208.43912L5.45218%207.34865L3.33301%206.12947ZM4.27628%208.8697L6.10371%209.97419L8.05507%208.84612L6.18256%207.76885L4.27628%208.8697ZM6.8161%2010.4048L8.69738%2011.5418L10.7132%2010.3754L8.78542%209.2663L6.8161%2010.4048ZM9.40976%2011.9723L11.4522%2013.2068L13.4834%2011.9691L11.4435%2010.7955L9.40976%2011.9723ZM14.2226%2011.5186L15.989%2010.4422L14.0152%209.3075L12.2024%2010.3564L14.2226%2011.5186ZM16.7282%209.99177L18.5679%208.87073L16.6635%207.77511L14.7741%208.86839L16.7282%209.99177ZM19.3071%208.42029L21.4788%207.09686L19.6339%206.05634L17.4224%207.336L19.3071%208.42029ZM18.8963%205.64036L16.9533%204.54452L14.767%205.80837L16.692%206.91583L18.8963%205.64036ZM16.2157%204.12853L14.3289%203.06443L12.1673%204.31273L14.0367%205.38819L16.2157%204.12853ZM14.0078%206.24727L15.9331%207.35494L14.0434%208.44839L12.1165%207.34065L14.0078%206.24727ZM11.3572%207.77956L13.2846%208.8875L11.4721%209.93625L9.54466%208.82739L11.3572%207.77956ZM8.8143%208.40721L10.6266%207.35954L8.75469%206.28347L6.94219%207.33017L8.8143%208.40721ZM11.3858%206.92063L13.2774%205.8271L11.4077%204.7514L9.51433%205.84479L11.3858%206.92063Z'%20fill='%232F374A'/%3e%3c/svg%3e"}}},ASt={},hSt={width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function pSt(e,t){return k(),N("svg",hSt,[...t[0]||=[Sn('<path fill-rule="evenodd" clip-rule="evenodd" d="M3.28121 7.15444L8.50434 10.3164L13.7826 7.09473L15.964 8.325L8.51215 12.866L1.09521 8.38321L3.28121 7.15444Z" fill="#2F374A"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.50364 13.3289L3.28081 10.1671L1.09448 11.3961L8.51142 15.8788L15.9633 11.3379L13.7816 10.1074L8.50364 13.3289ZM13.7956 10.9174L8.50513 14.1465L3.26776 10.9759L2.48129 11.418L8.50993 15.0616L14.5825 11.3612L13.7956 10.9174Z" fill="#2F374A"></path><rect x="13.2275" width="3.77251" height="0.745187" fill="#2F374A"></rect><rect x="16.9998" width="3.77251" height="0.745187" transform="rotate(90 16.9998 0)" fill="#2F374A"></rect><rect x="17" y="13.3203" width="3.77251" height="0.745187" transform="rotate(90 17 13.3203)" fill="#2F374A"></rect><rect x="16.9998" y="17.0938" width="3.77251" height="0.745187" transform="rotate(-180 16.9998 17.0938)" fill="#2F374A"></rect><rect width="3.77251" height="0.745187" transform="matrix(-1 0 0 1 3.77246 0)" fill="#2F374A"></rect><rect width="3.77251" height="0.745187" transform="matrix(4.37114e-08 1 1 -4.37114e-08 0 0)" fill="#2F374A"></rect><rect width="3.77251" height="0.745187" transform="matrix(4.37114e-08 1 1 -4.37114e-08 0.000244141 13.3203)" fill="#2F374A"></rect><rect width="3.77251" height="0.745187" transform="matrix(1 -8.74228e-08 -8.74228e-08 -1 0.000244141 17.0938)" fill="#2F374A"></rect><path fill-rule="evenodd" clip-rule="evenodd" d="M6.9851 2.02194L8.59292 1.11816L10.1013 1.96887L8.50013 2.89355L6.9851 2.02194ZM6.4129 2.34358L4.986 3.14566L6.52829 4.03226L7.93556 3.21958L6.4129 2.34358ZM4.4138 3.4673L3.04956 4.23416L4.61708 5.13596L5.96372 4.35829L4.4138 3.4673ZM2.47736 4.5558L1.09448 5.33313L2.64886 6.27259L4.05251 5.46199L2.47736 4.5558ZM3.17832 6.59259L4.53651 7.41348L5.98703 6.57494L4.59533 5.77429L3.17832 6.59259ZM5.06597 7.73348L6.46392 8.57839L7.96234 7.71136L6.52984 6.88722L5.06597 7.73348ZM6.99336 8.89839L8.51142 9.81589L10.0212 8.89585L8.50513 8.02363L6.99336 8.89839ZM10.5706 8.56108L11.8832 7.76118L10.4162 6.91783L9.06914 7.69728L10.5706 8.56108ZM12.4326 7.42641L13.7998 6.59331L12.3843 5.779L10.9802 6.59148L12.4326 7.42641ZM14.3491 6.25853L15.9633 5.27491L14.592 4.50155L12.9483 5.45264L14.3491 6.25853ZM14.0439 4.19239L12.6 3.37809L10.9751 4.31743L12.4056 5.14037L14.0439 4.19239ZM12.0518 3.06892L10.6495 2.27805L9.04295 3.20584L10.4323 4.00515L12.0518 3.06892ZM10.4108 4.64363L11.8415 5.46672L10.4372 6.27933L9.00528 5.45618L10.4108 4.64363ZM8.44101 5.78238L9.87318 6.60568L8.52635 7.385L7.09411 6.56102L8.44101 5.78238ZM6.5513 6.24874L7.89799 5.47022L6.50676 4.67046L5.1599 5.44826L6.5513 6.24874ZM8.46227 5.14402L9.86804 4.33135L8.47838 3.53187L7.07133 4.34443L8.46227 5.14402Z" fill="#2F374A"></path>',11)]])}var fSt=Q(ASt,[["render",pSt]]),gSt={class:"bimdata-anchor-synchronization__header"},mSt={class:"bimdata-anchor-synchronization__header__texts"},vSt={class:"bimdata-anchor-synchronization__header__texts__title"},ySt={class:"bimdata-anchor-synchronization__header__buttons"},wSt=Q({__name:"AnchorSynchronizationHeader",setup(e){let t=bt("$viewer"),i=bt("state"),o=bt("service"),r=je(()=>i.allAnchorsValidated),n=pe(!1),a=null;t.globalContext.hub.once("anchor-synchronization:open",(c=null)=>{a=c},{getLastEvent:!0});let s=()=>{t.globalContext.layout=a},l=async()=>{n.value=!0,await o.saveAnchors(),t.globalContext.layout=a};return(c,d)=>{let u=I("BIMDataButton"),A=I("BIMDataSpinner");return k(),N("div",gSt,[w("div",mSt,[T(fSt,{class:"m-x-6"}),w("span",vSt,G(c.$t("anchor-synchronization-window.title")),1)]),w("div",ySt,[T(u,{color:"high",fill:"",radius:"",class:"m-x-6",width:"120px",onClick:s},{default:j(()=>[nt(G(c.$t("global.cancel")),1)]),_:1}),T(u,{color:"primary",fill:"",radius:"",class:"m-x-6",width:"120px",disabled:!r.value,onClick:l},{default:j(()=>[n.value?(k(),W(A,{key:0})):(k(),N(ut,{key:1},[nt(G(c.$t("global.done")),1)],64))]),_:1},8,["disabled"])])])}}},[["__scopeId","data-v-a7ce6c34"]]),bSt={class:"anchor-content"},CSt={class:"anchor-label"},j8={__name:"Anchor",props:{position:{type:Object,default:null},isSecondAnchor:{type:Boolean,default:!1},color:{type:String,default:"#FF9100"}},emits:["change","validate"],setup(e,{emit:t}){let i=e,o={x:i.isSecondAnchor?"70px":"20px",y:"90%"},r=je(()=>i.position?{x:i.position.x+"px",y:i.position.y+"px"}:o),n=t,a=pe(!1),s=pe(null);function l(u){a.value=!0,s.value?.setPointerCapture(u.pointerId),u.preventDefault()}function c(u){if(!a.value)return;let A=i.position;if(!A){let{x:h,y:p}=s.value.getBoundingClientRect(),{x:f,y:m}=s.value.parentElement.getBoundingClientRect();A={x:h-f+15,y:p-m+51}}n("change",{x:A.x+u.movementX,y:A.y+u.movementY})}function d(u){a.value&&s.value&&s.value?.releasePointerCapture(u.pointerId),a.value=!1,n("validate")}return $i(()=>{a.value=!1}),(u,A)=>(k(),N("div",{class:"bimdata-anchor-synchronization__anchor",style:ve({left:r.value.x,top:r.value.y,color:e.color,cursor:a.value?"none":"grab"}),onPointerdown:l,onPointermove:c,onPointerup:d,ref_key:"anchorElement",ref:s},[w("div",bSt,[A[0]||=w("svg",{width:"30",height:"60",viewBox:"0 0 30 60",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[w("rect",{x:"14",y:"42",width:"2",height:"18",fill:"currentColor"}),w("rect",{x:"24",y:"50",width:"2",height:"18",transform:"rotate(90 24 50)",fill:"currentColor"}),w("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0 14.3929C0 6.43566 6.70714 0 15 0C23.2929 0 30 6.43566 30 14.3929C30 25.1875 15 41.1224 15 41.1224C15 41.1224 0 25.1875 0 14.3929ZM9.64274 14.3932C9.64274 17.2307 12.0427 19.5335 14.9999 19.5335C17.957 19.5335 20.357 17.2307 20.357 14.3932C20.357 11.5558 17.957 9.25293 14.9999 9.25293C12.0427 9.25293 9.64274 11.5558 9.64274 14.3932Z",fill:"currentColor"})],-1),w("div",CSt,G(e.isSecondAnchor?2:1),1)])],36))}},j$=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2}),Q$=(e,t)=>Math.hypot(t.x-e.x,t.y-e.y),z$=(e,t)=>Math.atan2(t.y-e.y,t.x-e.x),xSt=(e,t)=>({x:e.x*Math.cos(t)-e.y*Math.sin(t),y:e.x*Math.sin(t)+e.y*Math.cos(t)});function q$(e){let{anchorA1Position:t,anchorA2Position:i,anchorB1Position:o,anchorB2Position:r,model:n,modelToSynchronize:a}=e;if(!n||!a)throw Error("[BIMDataViewer - AnchorSynchronization] Models are mandatory to calculate transform.");let{translate:s,rotate:l,scale:c}=a.transform??QV.IDENTITY,d=Q$(t,i)/Q$(o,r)*c,u=z$(t,i),A=(z$(o,r)-u)*(180/Math.PI)*-1,h=l+A,p=j$(t,i),f=j$(o,r),m=xSt({x:f.x-s[0],y:f.y-s[1]},A*Math.PI/180),g={x:m.x/c*d,y:m.y/c*d};return{scale:d,rotate:h,translate:[p.x-g.x,p.y-g.y,0]}}var BSt={class:"bimdata-viewer-ifc-2d",ref:"canvasContainer"},kSt=Q({__name:"ViewerIfc2D",props:{model:{type:Object,default:null},storeyIndex:{type:Number,default:0}},emits:["camera-update"],setup(e,{expose:t,emit:i}){let o=e,r=i,n=bt("$viewer"),a=bt("state"),s=pe(null),l=null,c=null,d=null,{promise:u,resolve:A,reject:h}=Promise.withResolvers(),p=()=>{c=d1({canvas:s.value}),c.styles.default.lineWidth=.01,c.settings.rotateSpeed=.05,c.settings.snapMargin=.04,c.settings.minScale=10,c.textureManager.textureMatrix.scale(.01,.01);let{camera:y}=c;y.on("update",()=>{r("camera-update",y)});let v={engine:c,viewer:c,$viewer:n};l=R5(v),d=new EB(v)};Di(()=>{try{p()}catch(y){h(y)}A()});let f=(y,v)=>{let C=y.storeys[v];if(!C)return;let x=C.objects.map(B=>String(B.id));c.scene.showObjects(x)},m=async y=>{await u,await l(y.map_file,y.id);let v=c.scene.objects.map(C=>C.id);if(c.scene.hideObjects(v),f(y,o.storeyIndex),y.recommanded_2d_angle!==void 0){let C=c.camera.rotation;c.camera.rotate(-C-y.recommanded_2d_angle)}c.camera.fitView()};xt(()=>o.model,async y=>{y&&await m(y)},{immediate:!0});let g=!1;return t({getWorldPosition(y){return c.camera.getPosition(y)},get canvas(){return s.value},async showPlan(y){if(g)return;let v=await d.showPlan(y),C=v.mask?.crop_path,x={opacity:.5,crop_path:C};v.tempMask=x,g=!0;let B={translate:[v.x,v.y],scale:v.scale,rotate:v.angle},{anchorA1Position:E,anchorA2Position:D,anchorB1Position:P,anchorB2Position:M}=Ef(a);xt([E,D,P,M],()=>{let R=q$(a);C?.length>0&&(x.crop_path=Rg(Rg(C,B,{inverse:!0}),R)),v.x=R.translate[0],v.y=R.translate[1],v.scale=R.scale,v.angle=R.rotate},{immediate:!0})}}),(y,v)=>(k(),N("div",BSt,[w("canvas",{ref_key:"canvasElement",ref:s,style:{width:"100%",height:"100%",position:"absolute"}},null,512)],512))}},[["__scopeId","data-v-c0725497"]]),ESt={__name:"ViewerImage",props:{model:{type:Object,default:null}},emits:["camera-update"],setup(e,{expose:t,emit:i}){let o=e,r=i,n=()=>{let{camera:d}=a.value.viewer;d.on("update",()=>{r("camera-update",d)})},a=pe(null),{promise:s,resolve:l}=Promise.withResolvers();xt(()=>o.model,async d=>{await s,d&&(a.value.loadModels([d]),a.value.viewer.renderer.offset.dx===0&&a.value.viewer.renderer.offset.dy===0&&(a.value.viewer.renderer.offset={dx:-d.transform.translate[0],dy:-d.transform.translate[1]}))},{immediate:!0}),Di(()=>{l()});let c=ko({get loadedModels(){return o.model?[o.model]:[]},get selectedStorey(){return null}});return t({getWorldPosition(d){return a.value.engine.camera.getPosition(d)},get canvas(){return a.value.engine.canvas}}),(d,u)=>(k(),W(Th,{ref_key:"viewerPlan",ref:a,stateContext:c,onMounted:n},null,8,["stateContext"]))}},MSt={class:"bimdata-anchor-synchronization__viewer"},PSt={class:"viewer-container-A"},ISt={class:"viewer-container-B"},SSt=Q({__name:"AnchorSynchronizationViewer",setup(e,{expose:t}){let i=pe(null),o=pe(null),r=bt("state"),n=(C,x)=>{x.preventDefault();let B=C==="A"?i.value:o.value;B&&_B(B.canvas)(x)},a=pe(null),s=pe(null),l=pe(null),c=pe(null),d={anchorA1Position:a,anchorA2Position:s,anchorB1Position:l,anchorB2Position:c},u=(C,x)=>{(C==="A"?["anchorA1Position","anchorA2Position"].filter(B=>d[B].value!==null):["anchorB1Position","anchorB2Position"].filter(B=>d[B].value!==null)).forEach(B=>{let E=r[B];d[B].value=x.getCanvasPosition(E)})},A=(C,x)=>{let B=C.startsWith("A")?i.value:o.value,E=`anchor${C}Position`;r[E]=B.getWorldPosition(x),d[E].value=x},h=Ui(null),p=pe(0),f=Ui(null),m=xt(()=>r.allAnchorsValidated,C=>{if(!C)return;let x={plan:f.value,storey:{}};i.value.showPlan(x),m()}),g=C=>{if(!C)return null;let x=C.type;switch(x){case"IFC":return kSt;case"PNG":case"JPEG":case"PDF":case"PHOTOSPHERE":return ESt;default:throw Error(`[BIMData AnchorSynchronizationViewer] Unsupported model type: ${x}`)}},y=async(C,x,B)=>{h.value=C;let E=C.storeys.findIndex(D=>D.uuid===x.uuid);if(E===-1)throw Error("[BIMData AnchorSynchronizationViewer] Storey not found in main model.");p.value=E,f.value=B},v=()=>{r.allAnchorsValidated||a.value&&s.value&&l.value&&c.value&&(r.allAnchorsValidated=!0)};return t({synchronize:y}),(C,x)=>(k(),N("div",MSt,[w("div",PSt,[(k(),W(qr(g(h.value)??"div"),{model:h.value,ref_key:"viewerA",ref:i,onCameraUpdate:x[0]||=B=>u("A",B),storeyIndex:p.value},null,40,["model","storeyIndex"])),h.value?(k(),N(ut,{key:0},[T(j8,{onChange:x[1]||=B=>A("A1",B),onValidate:v,position:a.value,onWheel:x[2]||=B=>n("A",B)},null,8,["position"]),T(j8,{onChange:x[3]||=B=>A("A2",B),onValidate:v,position:s.value,onWheel:x[4]||=B=>n("A",B),isSecondAnchor:!0},null,8,["position"])],64)):le("",!0)]),w("div",ISt,[(k(),W(qr(g(f.value)??"div"),{model:f.value,ref_key:"viewerB",ref:o,onCameraUpdate:x[5]||=B=>u("B",B)},null,40,["model"])),f.value?(k(),N(ut,{key:0},[T(j8,{onChange:x[6]||=B=>A("B1",B),onValidate:v,position:l.value,onWheel:x[7]||=B=>n("B",B)},null,8,["position"]),T(j8,{onChange:x[8]||=B=>A("B2",B),onValidate:v,position:c.value,onWheel:x[9]||=B=>n("B",B),isSecondAnchor:!0},null,8,["position"])],64)):le("",!0)])]))}},[["__scopeId","data-v-3947e679"]]),DSt=class{state;$viewer;constructor(e,t){this.$viewer=e,this.state=t}async saveAnchors(){let{state:e}=this.$viewer,{model:t,storey:i,modelToSynchronize:o}=this.state;if(!t||!o||!i)throw Error("[BIMDataViewer - AnchorSynchronization] Models and storey are mandatory to save anchors.");let r=q$(this.state),n=i.plans.find(a=>a.plan.id===o.id);try{if(n){let a={...o.transform};n.plan.transform=r,await e.updatePlan(n,a)}else await e.createPlan(t,i,o.document,r)}catch(a){throw console.error("[BIMDataViewer - Anchor Synchronization Service] Failed to save anchors:",a),a}}},TSt=class{model=null;storey=null;modelToSynchronize=null;anchorA1Position=null;anchorA2Position=null;anchorB1Position=null;anchorB2Position=null;allAnchorsValidated=!1;constructor(){return ko(this)}},LSt={components:{AnchorSynchronizationHeader:wSt,AnchorSynchronizationViewer:SSt},setup(){let e=pe(null),t=new TSt;return pr("state",t),pr("service",new DSt(bt("$viewer"),t)),{viewer:e,synchronize:(i,o,r)=>(t.model=i,t.storey=o,t.modelToSynchronize=r,e.value.synchronize(i,o,r)),positioned:pe(!1)}}},RSt={class:"bimdata-anchor-synchronization"};function _St(e,t,i,o,r,n){let a=I("AnchorSynchronizationHeader"),s=I("AnchorSynchronizationViewer");return k(),N("div",RSt,[T(a,{valid:o.positioned},null,8,["valid"]),T(s,{class:"bimdata-anchor-synchronization__content__viewer",ref:"viewer",onPositioned:t[0]||=l=>o.positioned=!0})])}var FSt={name:"anchor-synchronization-window",i18n:{en:{title:"Synchronization"},fr:{title:"Synchronisation"}},component:Q(LSt,[["render",_St],["__scopeId","data-v-7f15ad3b"]]),window:{name:"anchor-synchronization",header:!1,displayedInWindowSelector:!1,multiModel:!1}},USt={name:"PointCloudViewer",components:{Annotations:OW},data(){let{settings:e}=this.$plugin;return{settings:e,canvasId:null,spinnerCanvasId:null,xeokitCreated:!1,loadedModels:[],tilesets:new Map,sensitivity:200,fov:90,annotationMode:!1,modelHeaderShown:e.modelLoader!=="hidden",navCubeVisible:e.navCube!==!1,loading:!1}},watch:{sensitivity(e){this.tilesetLoaderPlugin&&(this.tilesetLoaderPlugin.sensitivity=e)},fov(e){this.xeokit.camera.perspective.fov=e}},created(){this.spinnerCanvasId=`spinner-canvas-id-${this.$viewer.localContext.id}-${this.$viewer.instanceId}`,this.xeokitSdk=Md},mounted(){let e=new wJ({canvasElement:this.$refs["bimdata-xeokit-canvas"],transparent:!0,spinnerElementId:this.spinnerCanvasId,backgroundColorFromAmbientLight:!1});e.cameraControl.doublePickFlyTo=!1,e.cameraControl.panRightClick=!1,e.cameraControl.followPointer=!0,e.cameraControl.smartPivot=!0,this.settings.pivotMarker!==!1&&e.cameraControl.enablePivotSphere({size:1,color:[.25,.25,.25]}),e.cameraControl.touchDollyRate=1,e.cameraControl.mouseWheelDollyRate=60,e.cameraControl.keyboardDollyRate=20,e.cameraControl.dragRotationRate=450,e.cameraControl.rotationInertia=0,e.cameraControl.dollyInertia=0,e.camera.perspective.near=.1,e.camera.perspective.far=1e3,e.camera.ortho.near=.1,e.camera.ortho.far=1e3,this.bcfViewpointsPlugin=new q6(e,{originatingSystem:"BIMDataViewer/v1.0",authoringTool:"BIMData.io"}),this.distanceMeasurementsPlugin=new MJ(e,{defaultAxisVisible:!1,container:this.$el,zIndex:0}),this.angleMeasurementsPlugin=new N6(e,{container:this.$el,zIndex:0}),this.tilesetLoaderPlugin=new FW(e,{sensitivity:this.sensitivity,debugMode:!1}),this.navCubeVisible&&(this.navCube=new ZM(e,{canvasElement:this.$refs["bimdata-xeokit-navcube-canvas"],visible:!1,cameraFly:!0,cameraFitFOV:45,cameraFlyDuration:.5,color:"#FFFFFF"})),this.xeokit=e,this.xeokitCreated=!0,window.xeokitPointCloud=this.xeokit},beforeUnmount(){this.xeokit?.destroy()},methods:{async loadModels(e){this.loading=!0,this.loadedModels.push(...e.filter(n=>!this.loadedModels.some(a=>a.id===n.id)));let{apiUrl:t,cloudId:i,projectId:o,accessToken:r}=this.$viewer.api;e.forEach(async(n,a)=>{try{this.$viewer.localContext.loadingProcessStart();let s=await(await fetch(`${t}/cloud/${i}/project/${o}/model/${n.id}/tileset?tile_format=xkt`,{headers:new Headers({Authorization:`Bearer ${r}`})})).json();s.name=String(n.id);let l=this.tilesetLoaderPlugin.load(s);this.tilesets.set(n,l);let c={model:n,plugin:this};this.$viewer.localContext.hub.emit("pointcloud-model-loaded",c),this.$viewer.globalContext.hub.emit("pointcloud-model-loaded",c),a===0&&!this.viewpointPending&&this.xeokit.cameraFlight.flyTo()}catch(s){console.error("Error while loading Tileset ",n.id,"with error: ",s),this.loadedModels=this.loadedModels.filter(l=>l.id!==n.id)}finally{this.$viewer.localContext.loadingProcessEnd(),this.loading=!1}}),this.loadedModels.length>0&&this.navCube?.setVisible(!0)},unloadModels(e){let t=e.map(i=>this.tilesets.get(i)).filter(Boolean);e.forEach(i=>this.tilesets.delete(i)),t.forEach(i=>i.destroy()),this.loadedModels=this.loadedModels.filter(i=>!e.find(o=>o.id===i.id)),e.forEach(i=>{let o={model:i,plugin:this};this.$viewer.localContext.hub.emit("pointcloud-model-unloaded",o),this.$viewer.globalContext.hub.emit("pointcloud-model-unloaded",o)}),this.loadedModels.length===0&&this.navCube?.setVisible(!1)},fitView(){this.xeokit.cameraFlight.flyTo()},async getSnapshot(){return{snapshot_type:"png",snapshot_data:await this.xeokit.getSnapshotWithPlugins({format:"png"})}},getViewpoint(){let e=this.bcfViewpointsPlugin.getViewpoint({snapshot:!1});return e.order=2,e.originating_system="pointCloud",e.models=this.$viewer.localContext.loadedModels.map(t=>t.id),e},async setViewpoint(e,{immediate:t=!1,duration:i=.3}={}){if(this.loading){this.viewpointPending=!0;let o=null;await new Promise(r=>{o=this.$watch("loading",n=>{n||r()},{immediate:!0})}),o(),this.viewpointPending=!1}await new Promise(o=>setTimeout(o,200)),this.bcfViewpointsPlugin.setViewpoint(e,{rayCast:!1,immediate:t,duration:i})},startAnnotationMode(e){if(this.annotationMode)return;this.annotationMode=!0;let t=this.xeokit.scene.canvas.canvas;this.canvasCursor=t.style.cursor,t.style.cursor="copy",this.annotationListener=this.xeokit.scene.input.on("mouseclicked",i=>{let o=this.xeokit.scene.pick({pickSurface:!0,canvasPos:i});if(o){let[r,n,a]=o.worldPos;e({x:r,y:a,z:n,models:this.$viewer.localContext.loadedModels})}})},stopAnnotationMode(){this.annotationMode&&(this.annotationMode=!1,this.xeokit.scene.canvas.canvas.style.cursor=this.canvasCursor,this.xeokit.scene.input.off(this.annotationListener))},showUI(){this.modelHeaderShown=this.settings.modelLoader!=="hidden",this.navCubeVisible=this.settings.navCube!==!1},hideUI(){this.modelHeaderShown=!1,this.navCubeVisible=!1}}},OSt={class:"bimdata-viewer-point-cloud"},NSt={ref:"header",class:"bimdata-viewer-point-cloud__header"},HSt={ref:"bimdata-xeokit-navcube-canvas",class:"bimdata-viewer-point-cloud__nav-cube"},VSt=["id"];function jSt(e,t,i,o,r,n){let a=I("NoModelWindowPlaceHolder"),s=I("ModelsLoader"),l=I("Annotations");return k(),N("div",OSt,[r.loadedModels.length===0?(k(),W(a,{key:0})):le("",!0),w("div",NSt,[r.settings.modelLoader==="disabled"?le("",!0):Tt((k(),W(s,{key:0,"window-positioning":!1,preview:""},null,512)),[[ui,r.modelHeaderShown]])],512),w("canvas",{ref:"bimdata-xeokit-canvas",class:"bimdata-viewer-point-cloud__viewer",onWheel:t[0]||=Dt(()=>{},["prevent"])},null,544),r.xeokitCreated?(k(),W(l,{key:1})):le("",!0),Tt(w("canvas",HSt,null,512),[[ui,r.navCubeVisible]]),w("div",{id:r.spinnerCanvasId},null,8,VSt)])}var QSt={name:"pointCloud",isViewer:!0,component:Q(USt,[["render",jSt],["__scopeId","data-v-b7df122c"]]),window:{name:"pointCloud",label:"pointCloud.window_label",header:!1,logoAndVersion:!0,plugins:["fullscreen","measure3d"],icon:{imgUri:"data:image/svg+xml,%3csvg%20width='29'%20height='28'%20viewBox='0%200%2029%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.61725%209.64469L13.0214%202.20528L13.03%207.28128L13.034%209.63208L5.61725%209.64469ZM25.4847%202.79589C25.4821%201.25822%2024.2376%200.00224431%2022.702%200.00485529L11.5341%200.0238442L3.17246%208.42535L3.20099%2025.1999C3.2036%2026.7375%204.46169%2027.9935%205.99771%2027.9909L22.7635%2027.9624C24.2991%2027.9598%2025.5393%2026.6996%2025.5367%2025.1619L25.4847%202.79589Z'%20fill='%232F374A'/%3e%3crect%20y='12.1958'%20width='28.001'%20height='14.6092'%20rx='1'%20transform='rotate(-0.097421%200%2012.1958)'%20fill='%23E544FF'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.1933%2014.0615C13.3783%2014.0615%2013.5282%2013.9114%2013.5282%2013.7262C13.5282%2013.541%2013.3783%2013.3909%2013.1933%2013.3909C13.0083%2013.3909%2012.8584%2013.541%2012.8584%2013.7262C12.8584%2013.9114%2013.0084%2014.0615%2013.1933%2014.0615ZM11.8911%2014.7695C11.8911%2014.9547%2011.7411%2015.1048%2011.5562%2015.1048C11.3712%2015.1048%2011.2213%2014.9547%2011.2213%2014.7695C11.2213%2014.5843%2011.3712%2014.4341%2011.5562%2014.4341C11.7411%2014.4341%2011.8911%2014.5843%2011.8911%2014.7695ZM15.9351%2014.4664C15.78%2014.412%2015.6101%2014.4938%2015.5558%2014.6492C15.5014%2014.8045%2015.5831%2014.9746%2015.7382%2015.0291L18.6786%2016.1209L14.4692%2018.42L11.3925%2017.3811C11.2367%2017.3285%2011.0678%2017.4123%2011.0153%2017.5683C10.9627%2017.7243%2011.0464%2017.8934%2011.2022%2017.946L14.1997%2018.9582L14.1997%2024.8387L11.4366%2023.8296C11.2821%2023.7732%2011.1112%2023.8529%2011.0549%2024.0075C10.9986%2024.1622%2011.0781%2024.3333%2011.2326%2024.3897L14.3954%2025.5448C14.4786%2025.5752%2014.571%2025.5669%2014.6474%2025.5222L19.5592%2022.6532C19.6506%2022.5997%2019.7068%2022.5017%2019.7068%2022.3957L19.7068%2016.0614C19.7068%2015.9347%2019.6269%2015.8219%2019.5076%2015.7801L15.9351%2014.4664ZM14.7951%2018.9211L19.1115%2016.5635L19.1115%2022.2245L14.7951%2024.7458L14.7951%2018.9211ZM10.4397%2017.564C10.6246%2017.564%2010.7746%2017.4139%2010.7746%2017.2287C10.7746%2017.0435%2010.6246%2016.8934%2010.4397%2016.8934C10.2547%2016.8934%2010.1048%2017.0435%2010.1048%2017.2287C10.1048%2017.4139%2010.2547%2017.564%2010.4397%2017.564ZM9.88169%2016.9306C9.8817%2017.1158%209.73176%2017.2659%209.5468%2017.2659C9.36185%2017.2659%209.21191%2017.1158%209.21191%2016.9306C9.21191%2016.7454%209.36185%2016.5952%209.5468%2016.5952C9.73176%2016.5952%209.88169%2016.7454%209.88169%2016.9306ZM8.65364%2016.8932C8.8386%2016.8932%208.98853%2016.7431%208.98853%2016.5579C8.98853%2016.3727%208.8386%2016.2225%208.65364%2016.2225C8.46869%2016.2225%208.31875%2016.3727%208.31875%2016.5579C8.31875%2016.7431%208.46868%2016.8932%208.65364%2016.8932ZM9.95585%2015.9619C9.95585%2016.1471%209.80592%2016.2973%209.62096%2016.2973C9.43601%2016.2973%209.28607%2016.1471%209.28607%2015.9619C9.28607%2015.7767%209.436%2015.6266%209.62096%2015.6266C9.80592%2015.6266%209.95585%2015.7767%209.95585%2015.9619ZM10.5884%2015.7007C10.7734%2015.7007%2010.9233%2015.5506%2010.9233%2015.3654C10.9233%2015.1802%2010.7734%2015.03%2010.5884%2015.03C10.4035%2015.03%2010.2535%2015.1802%2010.2535%2015.3654C10.2535%2015.5506%2010.4035%2015.7007%2010.5884%2015.7007ZM14.456%2014.0531C14.456%2014.2384%2014.306%2014.3885%2014.1211%2014.3885C13.9361%2014.3885%2013.7862%2014.2384%2013.7862%2014.0531C13.7862%2013.8679%2013.9361%2013.7178%2014.1211%2013.7178C14.306%2013.7178%2014.456%2013.8679%2014.456%2014.0531ZM12.3748%2014.5832C12.5597%2014.5832%2012.7096%2014.433%2012.7096%2014.2478C12.7096%2014.0626%2012.5597%2013.9125%2012.3747%2013.9125C12.1898%2013.9125%2012.0399%2014.0626%2012.0399%2014.2478C12.0399%2014.433%2012.1898%2014.5832%2012.3748%2014.5832ZM8.98853%2017.6011C8.98853%2017.7863%208.83859%2017.9365%208.65364%2017.9365C8.46868%2017.9365%208.31875%2017.7863%208.31875%2017.6011C8.31875%2017.4159%208.46869%2017.2658%208.65364%2017.2658C8.8386%2017.2658%208.98853%2017.4159%208.98853%2017.6011ZM8.65364%2018.9797C8.83859%2018.9797%208.98853%2018.8296%208.98853%2018.6444C8.98853%2018.4592%208.8386%2018.309%208.65364%2018.309C8.46869%2018.309%208.31875%2018.4592%208.31875%2018.6444C8.31875%2018.8296%208.46868%2018.9797%208.65364%2018.9797ZM8.98853%2019.6876C8.98853%2019.8728%208.83859%2020.023%208.65364%2020.023C8.46868%2020.023%208.31875%2019.8728%208.31875%2019.6876C8.31875%2019.5024%208.46869%2019.3523%208.65364%2019.3523C8.8386%2019.3523%208.98853%2019.5024%208.98853%2019.6876ZM8.65364%2021.0665C8.8386%2021.0665%208.98853%2020.9164%208.98853%2020.7312C8.98853%2020.546%208.8386%2020.3958%208.65364%2020.3958C8.46869%2020.3958%208.31875%2020.546%208.31875%2020.7312C8.31875%2020.9164%208.46868%2021.0665%208.65364%2021.0665ZM8.98853%2021.7744C8.98853%2021.9597%208.83859%2022.1098%208.65364%2022.1098C8.46868%2022.1098%208.31875%2021.9597%208.31875%2021.7745C8.31875%2021.5892%208.46869%2021.4391%208.65364%2021.4391C8.8386%2021.4391%208.98853%2021.5892%208.98853%2021.7744ZM8.65364%2023.1531C8.83859%2023.1531%208.98853%2023.0029%208.98853%2022.8177C8.98853%2022.6325%208.8386%2022.4824%208.65364%2022.4824C8.46869%2022.4824%208.31875%2022.6325%208.31875%2022.8177C8.31875%2023.0029%208.46868%2023.1531%208.65364%2023.1531ZM9.88169%2023.3393C9.8817%2023.5245%209.73176%2023.6747%209.5468%2023.6747C9.36185%2023.6747%209.21191%2023.5245%209.21191%2023.3393C9.21191%2023.1541%209.36185%2023.004%209.5468%2023.004C9.73176%2023.004%209.88169%2023.1541%209.88169%2023.3393ZM10.4397%2023.9728C10.6246%2023.9728%2010.7746%2023.8227%2010.7746%2023.6375C10.7746%2023.4523%2010.6246%2023.3021%2010.4397%2023.3021C10.2547%2023.3021%2010.1048%2023.4523%2010.1048%2023.6375C10.1048%2023.8227%2010.2547%2023.9728%2010.4397%2023.9728ZM10.8575%2016.3028C10.8575%2016.4881%2010.7076%2016.6382%2010.5226%2016.6382C10.3376%2016.6382%2010.1877%2016.488%2010.1877%2016.3028C10.1877%2016.1176%2010.3376%2015.9675%2010.5226%2015.9675C10.7075%2015.9675%2010.8575%2016.1176%2010.8575%2016.3028ZM11.4899%2016.0417C11.6749%2016.0417%2011.8248%2015.8915%2011.8248%2015.7063C11.8248%2015.5211%2011.6749%2015.371%2011.4899%2015.371C11.305%2015.371%2011.155%2015.5211%2011.155%2015.7063C11.155%2015.8915%2011.305%2016.0417%2011.4899%2016.0417ZM12.7926%2015.1104C12.7926%2015.2956%2012.6426%2015.4457%2012.4577%2015.4457C12.2727%2015.4457%2012.1228%2015.2956%2012.1228%2015.1104C12.1228%2014.9252%2012.2727%2014.775%2012.4577%2014.775C12.6426%2014.775%2012.7926%2014.9252%2012.7926%2015.1104ZM13.2762%2014.9241C13.4612%2014.9241%2013.6111%2014.774%2013.6111%2014.5887C13.6111%2014.4035%2013.4612%2014.2534%2013.2762%2014.2534C13.0913%2014.2534%2012.9413%2014.4035%2012.9413%2014.5887C12.9413%2014.774%2013.0913%2014.9241%2013.2762%2014.9241ZM11.6695%2016.732C11.6695%2016.9172%2011.5196%2017.0674%2011.3346%2017.0674C11.1497%2017.0674%2010.9997%2016.9172%2010.9997%2016.732C10.9997%2016.5468%2011.1497%2016.3967%2011.3346%2016.3967C11.5196%2016.3967%2011.6695%2016.5468%2011.6695%2016.732ZM12.3021%2016.4711C12.487%2016.4711%2012.637%2016.321%2012.637%2016.1358C12.637%2015.9506%2012.487%2015.8005%2012.3021%2015.8005C12.1171%2015.8005%2011.9672%2015.9506%2011.9672%2016.1358C11.9672%2016.321%2012.1171%2016.4711%2012.3021%2016.4711ZM13.6047%2015.5399C13.6047%2015.7251%2013.4548%2015.8752%2013.2698%2015.8752C13.0849%2015.8752%2012.935%2015.7251%2012.935%2015.5399C12.935%2015.3547%2013.0849%2015.2045%2013.2698%2015.2045C13.4548%2015.2045%2013.6047%2015.3547%2013.6047%2015.5399ZM14.0883%2015.3533C14.2732%2015.3533%2014.4231%2015.2031%2014.4231%2015.0179C14.4231%2014.8327%2014.2732%2014.6826%2014.0883%2014.6826C13.9033%2014.6826%2013.7534%2014.8327%2013.7534%2015.0179C13.7534%2015.2031%2013.9033%2015.3533%2014.0883%2015.3533ZM15.2991%2014.4927C15.2991%2014.678%2015.1491%2014.8281%2014.9642%2014.8281C14.7792%2014.8281%2014.6293%2014.678%2014.6293%2014.4927C14.6293%2014.3075%2014.7792%2014.1574%2014.9642%2014.1574C15.1491%2014.1574%2015.2991%2014.3075%2015.2991%2014.4927ZM9.56761%2018.3508C9.75257%2018.3508%209.9025%2018.2007%209.9025%2018.0155C9.9025%2017.8302%209.75257%2017.6801%209.56761%2017.6801C9.38265%2017.6801%209.23272%2017.8302%209.23272%2018.0155C9.23272%2018.2007%209.38266%2018.3508%209.56761%2018.3508ZM9.9025%2019.0587C9.9025%2019.2439%209.75257%2019.3941%209.56761%2019.3941C9.38266%2019.3941%209.23272%2019.2439%209.23272%2019.0587C9.23272%2018.8735%209.38265%2018.7234%209.56761%2018.7234C9.75257%2018.7234%209.9025%2018.8735%209.9025%2019.0587ZM9.56761%2020.4373C9.75257%2020.4373%209.9025%2020.2872%209.9025%2020.102C9.9025%2019.9168%209.75257%2019.7666%209.56761%2019.7666C9.38265%2019.7666%209.23272%2019.9168%209.23272%2020.102C9.23272%2020.2872%209.38266%2020.4373%209.56761%2020.4373ZM9.9025%2021.1452C9.9025%2021.3304%209.75257%2021.4806%209.56761%2021.4806C9.38266%2021.4806%209.23272%2021.3304%209.23272%2021.1452C9.23272%2020.96%209.38265%2020.8099%209.56761%2020.8099C9.75257%2020.8099%209.9025%2020.96%209.9025%2021.1452ZM9.56761%2022.5241C9.75257%2022.5241%209.9025%2022.374%209.9025%2022.1888C9.9025%2022.0036%209.75257%2021.8534%209.56761%2021.8534C9.38265%2021.8534%209.23272%2022.0036%209.23272%2022.1888C9.23272%2022.374%209.38266%2022.5241%209.56761%2022.5241ZM10.8163%2018.4729C10.8163%2018.6581%2010.6664%2018.8082%2010.4814%2018.8082C10.2965%2018.8082%2010.1465%2018.6581%2010.1465%2018.4729C10.1465%2018.2877%2010.2965%2018.1375%2010.4814%2018.1375C10.6664%2018.1375%2010.8163%2018.2877%2010.8163%2018.4729ZM10.4814%2019.8515C10.6664%2019.8515%2010.8163%2019.7013%2010.8163%2019.5161C10.8163%2019.3309%2010.6664%2019.1808%2010.4814%2019.1808C10.2965%2019.1808%2010.1465%2019.3309%2010.1465%2019.5161C10.1465%2019.7013%2010.2965%2019.8515%2010.4814%2019.8515ZM10.8163%2020.5594C10.8163%2020.7446%2010.6664%2020.8947%2010.4814%2020.8947C10.2965%2020.8947%2010.1465%2020.7446%2010.1465%2020.5594C10.1465%2020.3742%2010.2965%2020.2241%2010.4814%2020.2241C10.6664%2020.2241%2010.8163%2020.3742%2010.8163%2020.5594ZM10.4814%2021.9383C10.6664%2021.9383%2010.8163%2021.7882%2010.8163%2021.603C10.8163%2021.4178%2010.6664%2021.2676%2010.4814%2021.2676C10.2965%2021.2676%2010.1465%2021.4177%2010.1465%2021.603C10.1465%2021.7882%2010.2965%2021.9383%2010.4814%2021.9383ZM10.8163%2022.6462C10.8163%2022.8314%2010.6664%2022.9816%2010.4814%2022.9816C10.2965%2022.9816%2010.1465%2022.8314%2010.1465%2022.6462C10.1465%2022.461%2010.2965%2022.3109%2010.4814%2022.3109C10.6664%2022.3109%2010.8163%2022.461%2010.8163%2022.6462ZM12.5057%2017.4918C12.6906%2017.4918%2012.8406%2017.3417%2012.8406%2017.1565C12.8406%2016.9713%2012.6906%2016.8211%2012.5057%2016.8211C12.3207%2016.8211%2012.1708%2016.9713%2012.1708%2017.1565C12.1708%2017.3417%2012.3207%2017.4918%2012.5057%2017.4918ZM13.8082%2016.5602C13.8082%2016.7454%2013.6582%2016.8956%2013.4733%2016.8956C13.2883%2016.8956%2013.1384%2016.7454%2013.1384%2016.5602C13.1384%2016.375%2013.2883%2016.2249%2013.4733%2016.2249C13.6582%2016.2249%2013.8082%2016.375%2013.8082%2016.5602ZM14.4411%2016.2994C14.626%2016.2994%2014.7759%2016.1492%2014.7759%2015.964C14.7759%2015.7788%2014.626%2015.6287%2014.4411%2015.6287C14.2561%2015.6287%2014.1062%2015.7788%2014.1062%2015.964C14.1062%2016.1492%2014.2561%2016.2994%2014.4411%2016.2994ZM15.5945%2015.4424C15.5945%2015.6276%2015.4446%2015.7777%2015.2596%2015.7777C15.0747%2015.7777%2014.9247%2015.6276%2014.9247%2015.4424C14.9247%2015.2572%2015.0747%2015.107%2015.2596%2015.107C15.4446%2015.107%2015.5945%2015.2572%2015.5945%2015.4424ZM11.4966%2019.0986C11.6816%2019.0986%2011.8315%2018.9485%2011.8315%2018.7633C11.8315%2018.5781%2011.6816%2018.4279%2011.4966%2018.4279C11.3116%2018.4279%2011.1617%2018.5781%2011.1617%2018.7633C11.1617%2018.9485%2011.3116%2019.0986%2011.4966%2019.0986ZM11.8315%2019.8065C11.8315%2019.9917%2011.6816%2020.1419%2011.4966%2020.1419C11.3116%2020.1419%2011.1617%2019.9917%2011.1617%2019.8065C11.1617%2019.6213%2011.3116%2019.4712%2011.4966%2019.4712C11.6816%2019.4712%2011.8315%2019.6213%2011.8315%2019.8065ZM11.4966%2021.1851C11.6816%2021.1851%2011.8315%2021.035%2011.8315%2020.8498C11.8315%2020.6646%2011.6816%2020.5144%2011.4966%2020.5144C11.3116%2020.5144%2011.1617%2020.6646%2011.1617%2020.8498C11.1617%2021.035%2011.3116%2021.1851%2011.4966%2021.1851ZM11.8315%2021.8933C11.8315%2022.0786%2011.6816%2022.2287%2011.4966%2022.2287C11.3116%2022.2287%2011.1617%2022.0786%2011.1617%2021.8933C11.1617%2021.7081%2011.3116%2021.558%2011.4966%2021.558C11.6816%2021.558%2011.8315%2021.7081%2011.8315%2021.8933ZM11.4966%2023.272C11.6816%2023.272%2011.8315%2023.1218%2011.8315%2022.9366C11.8315%2022.7514%2011.6816%2022.6013%2011.4966%2022.6013C11.3116%2022.6013%2011.1617%2022.7514%2011.1617%2022.9366C11.1617%2023.1218%2011.3116%2023.272%2011.4966%2023.272Z'%20fill='white'/%3e%3c/svg%3e"},modelTypes:["POINT_CLOUD"]},i18n:{en:{window_label:"Point Cloud"},fr:{window_label:"Point Cloud"}}},rI="viewer-point-cloud-parameters_parameters",zSt={computed:{viewer(){let e=this.$viewer.localContext.pluginComponentInstances.get("pointCloud");if(e)return e;{let t="'Viewer Point Cloud Parameters' plugin cannot work without Viewer Point Cloud plugin.";throw console.error(t),Error(t)}},sensitivity:{get(){return this.viewer.sensitivity},set(e){this.viewer.sensitivity=e,this.saveParameters({sensitivity:e})}},fov:{get(){return this.viewer.fov},set(e){this.viewer.fov=e,this.saveParameters({fov:e})}}},mounted(){this.subscription=this.$viewer.localContext.hub.on("pointcloud-model-loaded",()=>{this.applySavedParameters()})},unmounted(){this.$viewer.localContext.hub.off(this.subscription)},methods:{getSavedParameters(){let e={};try{let t=localStorage.getItem(rI)||"{}";e=JSON.parse(t)}catch{localStorage.removeItem(rI)}return Object.assign({},this.getDefaultParameters(),e)},applySavedParameters(){let e=this.getSavedParameters();this.viewer.sensitivity=e.sensitivity,this.viewer.fov=e.fov},getDefaultParameters(){return{sensitivity:200,fov:90}},saveParameters(e){let t={sensitivity:e.sensitivity||this.sensitivity,fov:e.fov||this.fov};localStorage.setItem(rI,JSON.stringify(t))}}},qSt={class:"viewer-point-cloud-parameters"},GSt={class:"viewer-point-cloud-parameters_header"},KSt={class:"viewer-point-cloud-parameters_content"},JSt={class:"m-b-18"},ZSt={class:"flex justify-between"},WSt={class:"viewer-point-cloud-parameters_content__value"},YSt={class:"flex justify-between"},XSt={class:"viewer-point-cloud-parameters_content__value"};function $St(e,t,i,o,r,n){let a=I("BIMDataIconParameters"),s=I("BIMDataSlider");return k(),N("div",qSt,[w("div",GSt,[T(a,{size:"xs",margin:"0 12px 0 0"}),w("span",null,G(e.$t("pointCloudParameters.title")),1)]),w("div",KSt,[w("div",JSt,[w("div",ZSt,[w("span",null,G(e.$t("pointCloudParameters.sensitivity")),1),w("span",WSt,G(n.sensitivity),1)]),T(s,{modelValue:n.sensitivity,"onUpdate:modelValue":t[0]||=l=>n.sensitivity=l,min:20,max:1e3},null,8,["modelValue"])]),w("div",null,[w("div",YSt,[w("span",null,G(e.$t("pointCloudParameters.fov")),1),w("span",XSt,G(n.fov),1)]),T(s,{modelValue:n.fov,"onUpdate:modelValue":t[1]||=l=>n.fov=l,min:20,max:120},null,8,["modelValue"])])])])}var eDt={name:"pointCloudParameters",i18n:{en:{tooltip:"Parameters",title:"Point Cloud Viewer settings",sensitivity:"Sensitivity",fov:"Field of view"},fr:{tooltip:"Param\xE8tres",title:"Param\xE8tres du nuage de points",sensitivity:"Sensibilit\xE9",fov:"Angle de vision"}},addToWindows:["pointCloud"],component:Q(zSt,[["render",$St],["__scopeId","data-v-e97be8b2"]]),button:{tooltip:"pointCloudParameters.tooltip",position:"right",content:"simple",icon:{component:"BIMDataIconParameters",options:{size:"m"}}}},sm=class{constructor(e,t,i=null,o=!0){this.name=e,this.icon=t,this.group=i,this.label=`drawing-tools.action.${e}`,this.lineStyleComponentDisplayed=o}onActivate(){throw Error("Not implemented")}onDeactivate(){throw Error("Not implemented")}},tDt={},iDt={width:"18",height:"18",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg"};function rDt(e,t){return k(),N("svg",iDt,[...t[0]||=[w("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"},null,-1)]])}var oDt=Q(tDt,[["render",rDt]]),nDt=class{constructor(){this._listenersTarget=new Map}on(e,t,i=window,o={}){this._listenersTarget.has(i)||this._listenersTarget.set(i,new Map);let r=this._listenersTarget.get(i);r.has(e)||r.set(e,new Map);let n=t.bind(this);return o?.once&&(n=(...a)=>{t.call(this,...a),this.off(e,t,i)}),i.addEventListener(e,n,o),r.get(e).set(t,n),()=>{this.off(e,t,i)}}off(e,t,i=window){if(!this._listenersTarget.has(i))return;let o=this._listenersTarget.get(i);if(!o.has(e))return;let r=o.get(e).get(t);i.removeEventListener(e,r),o.get(e).delete(t),o.get(e).size===0&&o.delete(e),o.size===0&&this._listenersTarget.delete(i)}},aDt="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M19.6749%202.92459C20.1081%203.35787%2020.1081%204.05777%2019.6749%204.49104L17.6418%206.5241L13.4757%202.358L15.5088%200.324952C15.9421%20-0.108322%2016.642%20-0.108322%2017.0752%200.324952L19.6749%202.92459ZM0%2020.0001V15.834L12.2872%203.54683L16.4533%207.71292L4.16609%2020.0001H0Z'%20fill='%232F374A'/%3e%3c/svg%3e",sDt="data:image/svg+xml,%3csvg%20width='19'%20height='19'%20viewBox='0%200%2019%2019'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M18.6749%202.9246C19.1081%203.35787%2019.1081%204.05777%2018.6749%204.49105L16.6418%206.5241L12.4757%202.35801L14.5088%200.324955C14.9421%20-0.108318%2015.642%20-0.108318%2016.0752%200.324955L18.6749%202.9246ZM0%2018V14.834L11.2872%203.54684L15.4533%207.71293L4.16609%2019.0001H1L0%2018Z'%20fill='%232F374A'/%3e%3c/svg%3e",lDt=`url("${aDt}") 0 20, auto`,cDt=`url("${sDt}") 1 23, auto`,Q8=class extends nDt{constructor(e,{pointerUpCursor:t=lDt,pointerDownCursor:i=cDt,element:o=e.canvas}={}){super(),this._engine2d=e,this.element=o,this.pointerUpCursor=t,this.pointerDownCursor=i,this._eventCache=[]}_getClientPosition(e){return{clientX:e.clientX,clientY:e.clientY}}_getPositions(e){let{clientX:t,clientY:i}=this._getClientPosition(e),{x:o,y:r}=this._engine2d.canvas.getBoundingClientRect();return this._engine2d.camera.getPosition({x:Math.max(t-o,0),y:Math.max(i-r,0)})}_getCanvasPosition(e){let{clientX:t,clientY:i}=this._getClientPosition(e),{x:o,y:r}=this.element.getBoundingClientRect();return{x:Math.max(t-o,0),y:Math.max(i-r,0)}}_getPositionedCallbackPayload(e){let t=this;return{get position(){return t._getPositions(e)},get canvasPosition(){return t._getCanvasPosition(e)},mouseEvent:e}}onEnabled(){}onMouseDown(){}onDrag(){}onMouseUp(){}onDisabled(){}_onMouseDown(e){this._eventCache.push(e),this.on("pointerup",()=>{this._eventCache=this._eventCache.filter(t=>t!==e)},window,{once:!0}),!(this._eventCache.length>1)&&(this.element.style.cursor=this.pointerDownCursor,this.onMouseDown(this._getPositionedCallbackPayload(e)),this.off("pointermove",this._onMouseMove,window),this.off("pointerup",this._onMouseUp,window),this.off("pointercancel",this._onMouseUp,window),this.on("pointermove",this._onMouseMove,window),this.on("pointerup",this._onMouseUp,window,{once:!0}),this.on("pointercancel",this._onMouseUp,window,{once:!0}))}_onMouseMove(e){e.preventDefault();let t=e.buttons===4,i=!e.isPrimary,o=this._eventCache.length>1;e.shiftKey||t||i||o||this.onDrag(this._getPositionedCallbackPayload(e))}_onMouseUp(e){this.off("pointermove",this._onMouseMove,window),this.off("pointerup",this._onMouseUp,window),this.off("pointercancel",this._onMouseUp,window),this.element.style.cursor=this.pointerUpCursor,this.onMouseUp(this._getPositionedCallbackPayload(e))}disable(){this._engine2d.ui.translatableWithOneTouch=!0,this._eventCache=[],this.off("pointerdown",this._onMouseDown,this.element),this.off("pointermove",this._onMouseMove,window),this.off("pointerup",this._onMouseUp,window),this.off("pointercancel",this._onMouseUp,window),this.element.style.cursor="",this.onDisabled()}enable(){this._engine2d.ui.translatableWithOneTouch=!1,this._eventCache=[],this.on("pointerdown",this._onMouseDown,this.element),this.element.style.cursor=this.pointerUpCursor,this.onEnabled()}},G$=`url("data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2022%2022'%20xmlns='http://www.w3.org/2000/svg'%20%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0.176395%200.13889C0.342301%20-0.00852533%200.584825%20-0.0419546%200.786658%200.0547728L21.6969%2010.0759C21.9052%2010.1757%2022.0251%2010.3924%2021.9956%2010.6155C21.966%2010.8386%2021.7935%2011.019%2021.566%2011.0647L12.0932%2012.9697L9.57365%2021.6158C9.51015%2021.8337%209.31%2021.9881%209.07635%2021.9993C8.8427%2022.0106%208.6277%2021.8763%208.54214%2021.6655L0.03777%200.720195C-0.0446022%200.517321%200.0104881%200.286306%200.176395%200.13889Z'%20/%3e%3c/svg%3e"), auto`,dDt=class extends sm{constructor({viewer:e},t){super("pointer",oDt,"pointers",!1),this._pointerManager=new uDt(e,t)}onActivate(){this._pointerManager.enable()}onDeactivate(){this._pointerManager.disable()}},uDt=class extends Q8{constructor(e,t){super(e,{pointerUpCursor:G$,pointerDownCursor:G$,element:e.canvas.parentElement}),this._drawer=t,this._currentDrawing=null,this.previousTouch=null}onMouseDown(e){this._currentDrawing=this._drawer.pick(e)}onMouseUp(){this._currentDrawing&&this._drawer.save(this._currentDrawing),this._currentDrawing=null,this.previousTouch=null}onDrag({position:e,mouseEvent:t,canvasPosition:i}){if(!this._currentDrawing)return;let o=0,r=0;if(window.TouchEvent&&t instanceof TouchEvent){let c=t.touches[0];this.previousTouch&&(o=c.pageX-this.previousTouch.pageX,r=c.pageY-this.previousTouch.pageY),this.previousTouch=c}else{let{movementX:c,movementY:d}=t;o=c,r=d}let n={x:i.x-o,y:i.y-r},a=this._engine2d.camera.getPosition(n),s=e.x-a.x,l=e.y-a.y;this._currentDrawing.x+=s,this._currentDrawing.y+=l}},ADt={},hDt={width:"14",height:"16",viewBox:"0 0 14 16",xmlns:"http://www.w3.org/2000/svg"};function pDt(e,t){return k(),N("svg",hDt,[...t[0]||=[w("path",{d:"M6.43587 16C6.09019 16 5.76756 15.9196 5.46797 15.7588C5.16839 15.5979 4.91888 15.3672 4.71944 15.0666L0 7.91354L0.307859 7.60694C0.508253 7.39952 0.745433 7.28253 1.0194 7.25596C1.29337 7.22942 1.54313 7.29881 1.7687 7.46414L4.1836 9.20471V2.14936C4.1836 1.98328 4.2379 1.84407 4.34649 1.73171C4.45509 1.61936 4.58965 1.56318 4.75018 1.56318C4.91071 1.56318 5.04519 1.61936 5.15361 1.73171C5.26203 1.84407 5.31624 1.98328 5.31624 2.14936V7.79331H7.08062V0.586175C7.08062 0.420099 7.13491 0.280884 7.2435 0.168531C7.35209 0.0561769 7.48665 0 7.64718 0C7.80771 0 7.94219 0.0561769 8.05061 0.168531C8.15904 0.280884 8.21325 0.420099 8.21325 0.586175V7.79331H9.97762V1.36777C9.97762 1.20169 10.0319 1.06248 10.1405 0.950122C10.2491 0.837768 10.3837 0.781592 10.5442 0.781592C10.7047 0.781592 10.8392 0.837768 10.9476 0.950122C11.056 1.06248 11.1102 1.20169 11.1102 1.36777V7.79331H12.8674V2.713C12.8674 2.54691 12.9217 2.40769 13.0302 2.29534C13.1388 2.18298 13.2734 2.12681 13.4339 2.12681C13.5945 2.12681 13.7289 2.18298 13.8373 2.29534C13.9458 2.40769 14 2.54691 14 2.713V13.0691C14 13.8787 13.7236 14.5696 13.1708 15.1418C12.6181 15.7139 11.9506 16 11.1683 16H6.43587Z"},null,-1)]])}var fDt=Q(ADt,[["render",pDt]]),gDt="data:image/svg+xml,%3csvg%20width='14'%20height='16'%20viewBox='0%200%2014%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6.43587%2016C6.09019%2016%205.76756%2015.9196%205.46797%2015.7588C5.16839%2015.5979%204.91888%2015.3672%204.71944%2015.0666L0%207.91354L0.307859%207.60694C0.508252%207.39952%200.745433%207.28253%201.0194%207.25596C1.29337%207.22942%201.54313%207.29881%201.7687%207.46414L4.1836%209.20471V2.14936C4.1836%201.98328%204.2379%201.84407%204.34649%201.73171C4.45509%201.61936%204.58965%201.56318%204.75018%201.56318C4.91071%201.56318%205.04519%201.61936%205.15361%201.73171C5.26203%201.84407%205.31624%201.98328%205.31624%202.14936V7.79331H7.08062V0.586175C7.08062%200.420099%207.13491%200.280884%207.2435%200.168531C7.35209%200.0561769%207.48665%200%207.64718%200C7.80771%200%207.94219%200.0561769%208.05061%200.168531C8.15904%200.280884%208.21325%200.420099%208.21325%200.586175V7.79331H9.97762V1.36777C9.97762%201.20169%2010.0319%201.06248%2010.1405%200.950122C10.2491%200.837768%2010.3837%200.781592%2010.5442%200.781592C10.7047%200.781592%2010.8392%200.837768%2010.9476%200.950122C11.056%201.06248%2011.1102%201.20169%2011.1102%201.36777V7.79331H12.8674V2.713C12.8674%202.54691%2012.9217%202.40769%2013.0302%202.29534C13.1388%202.18298%2013.2734%202.12681%2013.4339%202.12681C13.5945%202.12681%2013.7289%202.18298%2013.8373%202.29534C13.9458%202.40769%2014%202.54691%2014%202.713V13.0691C14%2013.8787%2013.7236%2014.5696%2013.1708%2015.1418C12.6181%2015.7139%2011.9506%2016%2011.1683%2016H6.43587Z'%20fill='%232F374A'/%3e%3c/svg%3e",mDt="data:image/svg+xml,%3csvg%20width='11'%20height='11'%20viewBox='0%200%2011%2011'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.43587%2011C3.09019%2011%202.76756%2010.9196%202.46797%2010.7588C2.16839%2010.5979%201.91888%2010.3672%201.71944%2010.0666L0%206.91354C0.5%205.5%200.780254%205.53908%201.1836%205.5V4.20471V2.14936C1.1836%201.98328%201.2379%201.84407%201.34649%201.73172C1.45509%201.61936%201.58965%201.56318%201.75018%201.56318C1.91071%201.56318%202.04519%201.61936%202.15361%201.73172C2.26203%201.84407%202.31624%201.98328%202.31624%202.14936V2.79331H4.08062V0.586175C4.08062%200.4201%204.13491%200.280884%204.2435%200.16853C4.35209%200.0561767%204.48665%200%204.64718%200C4.80771%200%204.94219%200.0561767%205.05061%200.16853C5.15904%200.280884%205.21325%200.4201%205.21325%200.586175V2.79331H6.97762V1.36777C6.97762%201.20169%207.03191%201.06248%207.1405%200.950122C7.24909%200.837768%207.38365%200.781591%207.54418%200.781591C7.70471%200.781591%207.83919%200.837768%207.94762%200.950122C8.05604%201.06248%208.11025%201.20169%208.11025%201.36777V2.79331H9.86735V2.713C9.86735%202.54691%209.92165%202.40769%2010.0302%202.29534C10.1388%202.18298%2010.2734%202.12681%2010.4339%202.12681C10.5945%202.12681%2010.7289%202.18298%2010.8373%202.29534C10.9458%202.40769%2011%202.54691%2011%202.713V8.06905C11%208.87869%2010.7236%209.56959%2010.1708%2010.1418C9.61805%2010.7139%208.95055%2011%208.16833%2011H3.43587Z'%20fill='%232F374A'/%3e%3c/svg%3e",vDt=`url("${gDt}") 7 23, auto`,yDt=`url("${mDt}") 7 18, auto`,wDt=class extends sm{constructor({viewer:e}){super("pan",fDt,"pointers",!1),this._pointerManager=new bDt(e)}onActivate(){this._pointerManager.enable()}onDeactivate(){this._pointerManager.disable()}},bDt=class extends Q8{constructor(e){super(e,{pointerUpCursor:vDt,pointerDownCursor:yDt}),this.previousTouch=null}onDrag({mouseEvent:e}){let t=0,i=0;if(window.TouchEvent&&e instanceof TouchEvent){let o=e.touches[0];this.previousTouch&&(t=o.pageX-this.previousTouch.pageX,i=o.pageY-this.previousTouch.pageY),this.previousTouch=o}else{let{movementX:o,movementY:r}=e;t=o,i=r}this._engine2d.camera.translate(-t*window.devicePixelRatio,-i*window.devicePixelRatio)}onMouseUp(){this.previousTouch=null}},lm=class extends sm{constructor(e,t,i,o,r,n=i){super(i,o,r),this._pointermanager=new CDt(e,t,n)}onActivate(){this._pointermanager.enable()}onDeactivate(){this._pointermanager.disable()}},CDt=class extends Q8{constructor(e,t,i){super(e),this._drawer=t,this._currentDrawing=null,this.shape=i}onMouseDown({position:e}){this._currentDrawing=this._drawer.makeDrawing(this.shape,{p1:e})}onMouseUp(){this._currentDrawing&&this._drawer.save(this._currentDrawing),this._currentDrawing=null}onDrag(e){this._currentDrawing.dragTo(e)}},xDt={},BDt={width:"18",height:"18",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg"};function kDt(e,t){return k(),N("svg",BDt,[...t[0]||=[w("path",{d:"M1.22223 22V17.6324L17.3486 0.577372C17.5382 0.376633 17.7466 0.230225 17.9738 0.138148C18.201 0.0460498 18.4282 0 18.6554 0C18.8951 0 19.1274 0.0460498 19.3523 0.138148C19.5771 0.230225 19.7742 0.376633 19.9434 0.577372L21.4547 2.17759C21.6443 2.35678 21.7826 2.56541 21.8695 2.80349C21.9565 3.04156 22 3.28752 22 3.54136C22 3.78194 21.9565 4.02251 21.8695 4.26306C21.7826 4.50364 21.6443 4.7243 21.4547 4.92504L5.34718 22H1.22223ZM18.4697 5.35812L20.1667 3.56126L18.6366 1.94115L16.9396 3.73801L18.4697 5.35812ZM12.9979 22C14.4269 22 15.7518 21.63 16.9724 20.89C18.1931 20.1501 18.8034 19.1181 18.8034 17.7941C18.8034 17.0342 18.5884 16.3698 18.1582 15.8007C17.7281 15.2316 17.1244 14.7504 16.3472 14.3572L14.9793 15.8056C15.6045 16.0545 16.0926 16.3477 16.4436 16.6854C16.7946 17.023 16.9701 17.3926 16.9701 17.7941C16.9701 18.4063 16.5729 18.9368 15.7785 19.3856C14.984 19.8344 14.0571 20.0588 12.9979 20.0588C12.7378 20.0588 12.52 20.1518 12.3445 20.3376C12.169 20.5234 12.0812 20.754 12.0812 21.0294C12.0812 21.3048 12.169 21.5354 12.3445 21.7212C12.52 21.9071 12.7378 22 12.9979 22ZM1.94853 12.8591L3.31174 11.4032C2.83381 11.1892 2.46793 10.9677 2.21409 10.7387C1.96024 10.5098 1.83331 10.2733 1.83331 10.0294C1.83331 9.70425 2.03819 9.3832 2.44796 9.06629C2.85772 8.7494 3.67292 8.31305 4.89358 7.75722C6.59216 6.98739 7.72899 6.29098 8.30404 5.66799C8.87912 5.04498 9.16666 4.34193 9.16666 3.55883C9.16666 2.49699 8.74397 1.63839 7.8986 0.983047C7.05323 0.327683 5.94814 0 4.58335 0C3.74502 0 2.97408 0.160117 2.27053 0.480347C1.56695 0.800556 1.04124 1.1921 0.693399 1.65499C0.524161 1.86901 0.454036 2.10502 0.483023 2.363C0.512011 2.62098 0.627572 2.83294 0.829708 2.99887C1.03184 3.16974 1.25278 3.23982 1.49252 3.20913C1.73226 3.17844 1.93674 3.07351 2.10596 2.89433C2.41465 2.56748 2.76957 2.32691 3.17073 2.1726C3.57186 2.0183 4.04273 1.94115 4.58335 1.94115C5.48121 1.94115 6.16402 2.10168 6.63176 2.42273C7.09949 2.74378 7.33335 3.12248 7.33335 3.55883C7.33335 3.93547 7.13161 4.27684 6.72814 4.58294C6.32464 4.88906 5.46947 5.35487 4.16262 5.98036C2.58783 6.71038 1.50036 7.36407 0.90023 7.94144C0.300076 8.51881 0 9.21481 0 10.0294C0 10.6367 0.171193 11.1705 0.513579 11.6309C0.855965 12.0913 1.33428 12.5007 1.94853 12.8591Z"},null,-1)]])}var EDt=Q(xDt,[["render",kDt]]),MDt=class extends lm{constructor({viewer:e},t){super(e,t,"pen",EDt,null,"freehand")}},PDt={},IDt={width:"22",height:"22",viewBox:"0 0 22 23",xmlns:"http://www.w3.org/2000/svg"};function SDt(e,t){return k(),N("svg",IDt,[...t[0]||=[w("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1 0.769226C0.447715 0.769226 0 1.21694 0 1.76923V4.32096C0 4.87324 0.447716 5.32096 1 5.32096H1.51723V18.2175H1C0.447715 18.2175 0 18.6652 0 19.2175V21.7692C0 22.3215 0.447716 22.7692 1 22.7692H3.55173C4.10401 22.7692 4.55173 22.3215 4.55173 21.7692V21.252H17.4482V21.7692C17.4482 22.3215 17.896 22.7692 18.4482 22.7692H21C21.5523 22.7692 22 22.3215 22 21.7692V19.2175C22 18.6652 21.5523 18.2175 21 18.2175H20.4828V5.32096H21C21.5523 5.32096 22 4.87324 22 4.32095V1.76923C22 1.21694 21.5523 0.769226 21 0.769226H18.4482C17.896 0.769226 17.4482 1.21694 17.4482 1.76923V2.28643H4.55173V1.76923C4.55173 1.21694 4.10401 0.769226 3.55173 0.769226H1ZM3.03448 5.32096H3.55173C4.10401 5.32096 4.55173 4.87324 4.55173 4.32095V3.80367H17.4482V4.32096C17.4482 4.87324 17.896 5.32096 18.4482 5.32096H18.9655V18.2175H18.4482C17.896 18.2175 17.4482 18.6652 17.4482 19.2175V19.7347H4.55173V19.2175C4.55173 18.6652 4.10401 18.2175 3.55173 18.2175H3.03448V5.32096ZM11.4216 6.83819H11.9202L15.931 17.4589H13.79L12.9878 15.0955H9.00098L8.20266 17.4589H6.06894L10.0578 6.83819H10.549H11.4216ZM9.53565 13.5126H12.4505L10.9896 9.2082L9.53565 13.5126Z"},null,-1)]])}var DDt=Q(PDt,[["render",SDt]]),TDt=`url("data:image/svg+xml,%3csvg%20width='14'%20height='15'%20viewBox='0%200%2014%2015'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5%201.96296V7.5M5%201.96296L3%201H1M5%201.96296L7%201H9M5%2013.037V7.5M5%2013.037L7%2014H9M5%2013.037L3%2014H1M5%207.5H7M5%207.5H3'%20stroke='%232F374A'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11%209V11M11%2013V11M11%2011H13M11%2011H9'%20stroke='%232F374A'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e") 5 7, auto`,LDt=class extends sm{constructor(e,t){super("text",DDt,null,!1),this._viewerPlanPlugin=e,this._drawer=t,this.canvas=e.engine.canvas;let i=pe(!1);this.autoDeactivateCallback=null,this.connector={enabledRef:i,deactivateAction(){this.autoDeactivateCallback?.()}},this.onClick=o=>{this.autoDeactivateCallback();let{x:r,y:n}=e.viewer.camera.getPosition({x:o.offsetX,y:o.offsetY});t.makeDrawing("text",{x:r,y:n})}}onActivate(e){this.canvas.addEventListener("click",this.onClick),this._viewerPlanPlugin.$viewer.localContext.el.style.cursor=TDt,this.autoDeactivateCallback=e,this.connector.enabledRef.value=!0}onDeactivate(){this.canvas.removeEventListener("click",this.onClick),this._viewerPlanPlugin.$viewer.localContext.el.style.cursor="",this.autoDeactivateCallback=null,this.connector.enabledRef.value=!1}},RDt={},_Dt={width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"};function FDt(e,t){return k(),N("svg",_Dt,[...t[0]||=[w("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0 0H16V16H0V0ZM2 2V14H14V2H2Z"},null,-1)]])}var UDt=Q(RDt,[["render",FDt]]),ODt=class extends lm{constructor({viewer:e},t){super(e,t,"rectangle",UDt,"shapes")}},NDt={},HDt={width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"};function VDt(e,t){return k(),N("svg",HDt,[...t[0]||=[w("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16 1.37853L1.37853 16L0 14.6215L14.6215 0L16 1.37853Z"},null,-1)]])}var jDt=Q(NDt,[["render",VDt]]),QDt=class extends lm{constructor({viewer:e},t){super(e,t,"line",jDt,"shapes")}},zDt={},qDt={width:"17",height:"17",viewBox:"0 0 17 17",xmlns:"http://www.w3.org/2000/svg"};function GDt(e,t){return k(),N("svg",qDt,[...t[0]||=[w("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.9914 1.88377H10.0848V0H16.207V6.12225H14.3233V3.21594L1.33203 16.2072L0 14.8751L12.9914 1.88377Z"},null,-1)]])}var KDt=Q(zDt,[["render",GDt]]),JDt=class extends lm{constructor({viewer:e},t){super(e,t,"arrow",KDt,"shapes")}},ZDt={},WDt={width:"17",height:"17",viewBox:"0 0 17 17",xmlns:"http://www.w3.org/2000/svg"};function YDt(e,t){return k(),N("svg",WDt,[...t[0]||=[w("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.5 14.875C12.0208 14.875 14.875 12.0208 14.875 8.5C14.875 4.97919 12.0208 2.125 8.5 2.125C4.97919 2.125 2.125 4.97919 2.125 8.5C2.125 12.0208 4.97919 14.875 8.5 14.875ZM8.5 17C13.1944 17 17 13.1944 17 8.5C17 3.80558 13.1944 0 8.5 0C3.80558 0 0 3.80558 0 8.5C0 13.1944 3.80558 17 8.5 17Z"},null,-1)]])}var XDt=Q(ZDt,[["render",YDt]]),$Dt=class extends lm{constructor({viewer:e},t){super(e,t,"ellipse",XDt,"shapes")}},eTt={name:"EraserIcon",props:{color:{type:String,default:"currentColor"}}},tTt=["fill"];function iTt(e,t,i,o,r,n){return k(),N("svg",{width:"20",height:"20",viewBox:"0 0 22 22",fill:i.color,xmlns:"http://www.w3.org/2000/svg"},[...t[0]||=[w("path",{d:"M16.6425 18.2998H22V20H14.9369L16.6425 18.2998ZM2.62548 20L0.613685 17.9946C0.214257 17.5964 0.00980528 17.1125 0.00032939 16.5428C-0.0091465 15.9731 0.18583 15.4798 0.585258 15.0627L12.6123 2.62019C13.0118 2.20312 13.4943 1.9964 14.0599 2.00005C14.6256 2.00367 15.1081 2.20458 15.5075 2.60277L20.6617 7.74061C21.0611 8.13879 21.2627 8.62453 21.2663 9.19783C21.27 9.77112 21.072 10.2569 20.6726 10.655L11.5255 20H2.62548Z"},null,-1)]],8,tTt)}var rTt=Q(eTt,[["render",iTt]]),oTt="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%20d='M13.1614%200.604227C13.9322%20-0.186875%2015.1984%20-0.203279%2015.9895%200.567585L21.551%205.98681C22.3421%206.75768%2022.3586%208.0239%2021.5877%208.815L8.99392%2021.7394C8.22305%2022.5305%206.95683%2022.5469%206.16573%2021.776L0.604228%2016.3568C-0.186874%2015.5859%20-0.20328%2014.3197%200.567585%2013.5286L13.1614%200.604227Z'%20fill='%232F374A'/%3e%3c/svg%3e",nTt="data:image/svg+xml,%3csvg%20width='22'%20height='18'%20viewBox='0%200%2022%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.62548%2018L0.613685%2015.9946C0.214257%2015.5964%200.00980528%2015.1125%200.00032939%2014.5428C-0.0091465%2013.9731%200.18583%2013.4798%200.585258%2013.0627L12.6123%200.620194C13.0118%200.203116%2013.4943%20-0.00359875%2014.0599%204.73985e-05C14.6256%200.00367466%2015.1081%200.204581%2015.5075%200.602767L20.6617%205.74061C21.0611%206.13879%2021.2627%206.62453%2021.2663%207.19783C21.27%207.77112%2021.072%208.25686%2020.6726%208.65502L11.5255%2018H2.62548Z'%20fill='%232F374A'/%3e%3c/svg%3e",aTt=`url("${oTt}") 7 23, auto`,sTt=`url("${nTt}") 7 18, auto`,lTt=class extends sm{constructor({viewer:e},t){super("eraser",rTt,null,!1),this._pointerManager=new cTt(e,t)}onActivate(){this._pointerManager.enable()}onDeactivate(){this._pointerManager.disable()}},cTt=class extends Q8{constructor(e,t){super(e,{element:e.canvas.parentElement,pointerUpCursor:aTt,pointerDownCursor:sTt}),this._drawer=t}erase(e){let t=this._drawer.pick(e);t&&this._drawer.deleteDrawing(t.id)}onMouseDown(e){this.erase(e)}onDrag(e){this.erase(e)}},m0=class{constructor(e){this.drawingType=e}parse(e){throw Error("Not implemented")}toString(e){throw Error("Not implemented")}},dTt=class extends m0{constructor(){super("rectangle")}toString(e){let{p1:t,p2:i,p3:o,p4:r,lineColor:n,lineWidth:a}=e;return`<path d="M ${t.x} ${t.y} L ${i.x} ${i.y} L ${o.x} ${o.y} L ${r.x} ${r.y} Z" stroke-width="${a}" stroke="#${n.toString(16).padStart(6,0)}"/>`}parse(e){let t=e.querySelector("path"),[,i,o,,r,n,,a,s,,l,c]=t.getAttribute("d").split(" "),d=t.getAttribute("stroke")?.substring(1),u=t.getAttribute("stroke-width");return{p1:{x:parseFloat(i),y:parseFloat(o)},p2:{x:parseFloat(r),y:parseFloat(n)},p3:{x:parseFloat(a),y:parseFloat(s)},p4:{x:parseFloat(l),y:parseFloat(c)},lineColor:parseInt(d,16),lineWidth:parseFloat(u)}}},uTt=class extends m0{constructor(){super("line")}toString(e){let{p1:t,p2:i,lineWidth:o,lineColor:r}=e;return`<line x1="${t.x}" y1="${t.y}" x2="${i.x}" y2="${i.y}" stroke-width="${o}" stroke="#${r.toString(16).padStart(6,0)}"/>`}parse(e){let t=e.querySelector("line"),i=t.getAttribute("x1"),o=t.getAttribute("y1"),r=t.getAttribute("x2"),n=t.getAttribute("y2"),a=t.getAttribute("stroke")?.substring(1),s=t.getAttribute("stroke-width");return{p1:{x:parseFloat(i),y:parseFloat(o)},p2:{x:parseFloat(r),y:parseFloat(n)},lineWidth:parseFloat(s),lineColor:parseInt(a,16)}}},ATt=class extends m0{constructor(){super("arrow")}toString(e){let{p1:t,p2:i,lineWidth:o,lineColor:r}=e;return`<line x1="${t.x}" y1="${t.y}" x2="${i.x}" y2="${i.y}" stroke-width="${o}" stroke="#${r.toString(16).padStart(6,0)}"/>`}parse(e){let t=e.querySelector("line"),i=t.getAttribute("x1"),o=t.getAttribute("y1"),r=t.getAttribute("x2"),n=t.getAttribute("y2"),a=t.getAttribute("stroke")?.substring(1),s=t.getAttribute("stroke-width");return{p1:{x:parseFloat(i),y:parseFloat(o)},p2:{x:parseFloat(r),y:parseFloat(n)},lineWidth:parseFloat(s),lineColor:parseInt(a,16)}}};function K$(e){if(e.length===0)return"";let t=e[0],i=`M ${t.x} ${t.y}`;for(let o=0;o<e.length;o++){let r=e[o];i+=` C ${r.cpX1} ${r.cpY1} ${r.cpX2} ${r.cpY2} ${r.toX} ${r.toY}`}return i}function J$(e){let t=e.split(" "),i=t.shift();if(i!=="M")throw Error(`svgPathStringToCurves: invalid svg path string. Must start with M, got "${i}"`);let o=parseFloat(t.shift()),r=parseFloat(t.shift()),n=[];for(;t.shift()==="C";){let a=parseFloat(t.shift()),s=parseFloat(t.shift()),l=parseFloat(t.shift()),c=parseFloat(t.shift()),d=parseFloat(t.shift()),u=parseFloat(t.shift());n.push({type:"curve",x:o,y:r,cpX1:a,cpY1:s,cpX2:l,cpY2:c,toX:d,toY:u}),o=d,r=u}return n}var hTt=class extends m0{constructor(){super("ellipse")}toString(e){let{curve1:t,curve2:i,curve3:o,curve4:r,lineColor:n,lineWidth:a}=e;return`<path d="${K$([t,i,o,r])} Z" stroke-width="${a}" stroke="#${n.toString(16).padStart(6,0)}" />`}parse(e){let t=e.querySelector("path"),i=J$(t.getAttribute("d")),o=t.getAttribute("stroke")?.substring(1),r=t.getAttribute("stroke-width");return{curves:i,lineColor:parseInt(o,16),lineWidth:parseFloat(r)}}},pTt=class extends m0{constructor(){super("text")}toString(e){let{x:t,y:i,rotation:o,scale:r,text:n,size:a,color:s}=e;return`<text x="${t}" y="${i}" tranform="rotate(${o}) scale(${r})" font-size="${a}px" ${s?`color="#${s}"`:""}>${n}</text>`}parse(e){let t=e.querySelector("text"),i=t.getAttribute("x"),o=t.getAttribute("y"),r=t.getAttribute("tranform").match(/rotate\((.*)\)/)?.[1]??0,n=t.getAttribute("tranform").match(/scale\((.*)\)/)?.[1]??1,a=t.textContent==="null"?null:t.textContent,s=t.getAttribute("font-size").slice(0,-2),l=t.getAttribute("color");return{x:parseFloat(i),y:parseFloat(o),rotation:parseFloat(r),scale:parseFloat(n),text:a,size:parseFloat(s),color:l?l.slice(1):null}}},fTt=class extends m0{constructor(){super("freehand")}toString(e){let{curves:t,lineWidth:i,lineColor:o}=e,r=`stroke-width="${i}" stroke="#${o.toString(16).padStart(6,0)}"`;return`<path d="${K$(t)}" ${r}/>`}parse(e){let t=e.querySelector("path"),i=J$(t.getAttribute("d")),o=t.getAttribute("stroke")?.substring(1),r=t.getAttribute("stroke-width");return{curves:i,lineWidth:parseFloat(r),lineColor:parseInt(o,16)}}},gTt=class{constructor(){this.drawingSvgParsers=new Map,[new dTt,new uTt,new ATt,new hTt,new fTt,new pTt].map(e=>this.drawingSvgParsers.set(e.drawingType,e))}parse(e){try{let t=new DOMParser().parseFromString(e.content,"image/svg+xml"),i=t.querySelector("svg").getAttribute("type"),o=+t.querySelector("svg").getAttribute("data-bimdata-elevation"),r=this.drawingSvgParsers.get(i);if(!r)throw TypeError(`No drawing parser for type ${i}`);let n=r.parse(t);return n.apiId=e.id,n.type=i,n.z=o,n}catch(t){console.warn(`[Drawing Tools - Parser] Error parsing drawing ${e.id}, ignored.`,t)}}toString(e){let{type:t,z:i}=e,o=this.drawingSvgParsers.get(t);if(!o)throw TypeError(`No drawing parser for type ${t}`);return`<svg type="${t}" data-bimdata-elevation="${i}" xmlns="http://www.w3.org/2000/svg">${o.toString(e)}</svg>`}},mTt=class{constructor(e){this._api=e,this._parser=new gTt,this.queue=h1()}async getDrawingsData(e){let{cloudId:t,projectId:i}=this._api;return(await this._api.apiClient.modelApi.getDrawings(t,e,i)).map(o=>this._parser.parse(o)).filter(Boolean)}save(e,t){let i=this._parser.toString(e);if(!i)return;let{cloudId:o,projectId:r}=this._api,n={content:i},a;a=e.apiId?async()=>{try{await this._api.apiClient.modelApi.updateDrawing(o,e.apiId,t,r,n)}catch(s){console.error(`Cannot update drawing of type: "${e.type}"`,s)}}:async()=>{try{e.apiId=(await this._api.apiClient.modelApi.createDrawing(o,t,r,n)).id}catch(s){console.error(`Cannot create drawing of type: "${e.type}"`,s)}},this.queue.push(a)}async delete(e,t){if(!e.apiId)return;let{cloudId:i,projectId:o}=this._api;try{await this._api.apiClient.modelApi.deleteDrawing(i,e.apiId,t,o)}catch(r){console.error(`Cannot delete drawing of type: "${e.type}"`,r)}}},Z$=class{constructor(e){this.drawingTypes=e}pick(e,t){throw Error("Not implemented")}},vTt=class extends Z${constructor(e){super(["rectangle","ellipse","arrow","line","freehand"]),this._engine2d=e}pick(e,t){let{canvasPosition:i}=t,o=this._engine2d.picker.pick(i);if(o)return e.get(o.id)}},yTt=class extends Z${constructor(){super(["text"])}pick(e,t){let{mouseEvent:i}=t,o=i.target;return e.get(o.id)}},W$=class{constructor(e,t){if(!e)throw TypeError("Drawing type is required");this.type=e,this.z=t}destroy(){throw Error("Method 'destroy' not implemented.")}},Y$=class{constructor(e){this.drawingTypes=e}create(e,t){throw Error("Not implemented")}},wTt="data:image/svg+xml,%3csvg%20width='17'%20height='17'%20viewBox='0%200%2017%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.5%200C3.80611%200%200%203.80611%200%208.5C0%2013.1939%203.80611%2017%208.5%2017C9.28389%2017%209.91667%2016.3672%209.91667%2015.5833C9.91667%2015.215%209.775%2014.8844%209.54833%2014.6294C9.33111%2014.3839%209.18944%2014.0533%209.18944%2013.6944C9.18944%2012.9106%209.82222%2012.2778%2010.6061%2012.2778H12.2778C14.8844%2012.2778%2017%2010.1622%2017%207.55556C17%203.38111%2013.1939%200%208.5%200ZM3.30556%208.5C2.52167%208.5%201.88889%207.86722%201.88889%207.08333C1.88889%206.29944%202.52167%205.66667%203.30556%205.66667C4.08944%205.66667%204.72222%206.29944%204.72222%207.08333C4.72222%207.86722%204.08944%208.5%203.30556%208.5ZM6.13889%204.72222C5.355%204.72222%204.72222%204.08944%204.72222%203.30556C4.72222%202.52167%205.355%201.88889%206.13889%201.88889C6.92278%201.88889%207.55556%202.52167%207.55556%203.30556C7.55556%204.08944%206.92278%204.72222%206.13889%204.72222ZM10.8611%204.72222C10.0772%204.72222%209.44444%204.08944%209.44444%203.30556C9.44444%202.52167%2010.0772%201.88889%2010.8611%201.88889C11.645%201.88889%2012.2778%202.52167%2012.2778%203.30556C12.2778%204.08944%2011.645%204.72222%2010.8611%204.72222ZM13.6944%208.5C12.9106%208.5%2012.2778%207.86722%2012.2778%207.08333C12.2778%206.29944%2012.9106%205.66667%2013.6944%205.66667C14.4783%205.66667%2015.1111%206.29944%2015.1111%207.08333C15.1111%207.86722%2014.4783%208.5%2013.6944%208.5Z'%20fill='white'/%3e%3c/svg%3e",bTt="url(data:image/svg+xml,%3csvg%20width='10'%20height='15'%20viewBox='0%200%2010%2015'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5%201.96296V7.5M5%201.96296L3%201H1M5%201.96296L7%201H9M5%2013.037V7.5M5%2013.037L7%2014H9M5%2013.037L3%2014H1M5%207.5H7M5%207.5H3'%20stroke='%232F374A'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e) 5 7, auto",CTt=4,xTt=40,X$=4,BTt=2,kTt={props:{id:{type:String,required:!0},newMarker:{type:Boolean,default:!1},textToolEnabled:{type:Boolean,required:!0},rotation:{type:Number,required:!0},scale:{type:Number,required:!0},initText:{type:String,default:""},initSize:{type:Number,default:12},initColor:{type:String,default:"000000"}},emits:["edit-update","text-update","size-update","color-update","delete-marker","delete-drawing"],setup(e,{emit:t}){let i=bt("$viewer").localContext.viewer.viewer.canvas,o=pe(e.newMarker),r=pe(e.initText),n=pe(e.initSize),a=pe(e.initColor);xt(r,x=>t("text-update",x)),xt(n,x=>t("size-update",x)),xt(a,x=>t("color-update",x));let s=pe(null),l=()=>s.value?.focus(),c=pe(null),d=pe(null),u=pe(null);async function A(){if(!o.value)return;await Ir();let{width:x}=c.value.getBoundingClientRect();d.value=x+12,u.value=1,await Ir();let{scrollHeight:B}=s.value;u.value=B+2}xt([()=>e.scale,o,r,n],A);let h=()=>{e.textToolEnabled&&(o.value=!0)},p=x=>{x.key==="Escape"&&(o.value=!1)};xt(o,async x=>{t("edit-update",x),x?(document.addEventListener("keydown",p),await Ir(),l()):(document.removeEventListener("keydown",p),v.value=!1)});let f=je(()=>n.value/(BTt*window.devicePixelRatio)),m=()=>{n.value>CTt&&(n.value-=X$),l()},g=()=>{n.value<xTt&&(n.value+=X$),l()},y=pe(null),v=pe(!1),C=pe(!1);return Di(()=>{A(),l()}),{paletteSvg:wTt,textCursor:bTt,textarea:s,textEl:c,colorElement:y,edit:o,text:r,textAreaWidth:d,textAreaHeight:u,size:f,sizeRef:n,color:a,colorSelectorDisplayed:v,colorSelectorTop:C,onTextClick:h,decrementSize:m,incrementSize:g,onTextColorClick:()=>{if(v.value=!v.value,v.value){let{y:x,height:B}=i.getBoundingClientRect(),{y:E}=y.value.getBoundingClientRect();C.value=E>x+B/2}},onTextColorUpdate:x=>{a.value=x,v.value=!1,l()},onDeleteClick:()=>{t("delete-marker"),t("delete-drawing")}}}},ETt=["id"],MTt={key:0},PTt={class:"bimdata-drawing-tools__text-marker__edit-content",style:"transform: translate(-1px, -1px)"},ITt={class:"bimdata-drawing-tools__text-marker__edit-content__header"},STt=["src"];function DTt(e,t,i,o,r,n){let a=I("BIMDataColorSelector"),s=I("BIMDataIconDelete"),l=Li("click-away");return k(),N("div",{class:"bimdata-drawing-tools__text-marker",style:ve(`font-size:${o.size}px; z-index: ${o.edit?1:0};`)},[w("div",{style:ve(`cursor: ${i.textToolEnabled?o.textCursor:""}`)},[w("div",{ref:"textEl",class:"bimdata-drawing-tools__text-marker__text",style:ve(`
2552
2552
  font-size:${o.size}px;
2553
2553
  transform-origin: top left;
2554
2554
  transform: scale(${i.scale});
@@ -6438,5 +6438,5 @@ void main() {
6438
6438
  --bimdata-local-context-width: ${o.width}px;
6439
6439
  --bimdata-local-context-center-width: ${o.centerWidth}px;
6440
6440
  --bimdata-local-context-resolution: ${o.resolution};
6441
- `),onMouseenter:t[0]||=(...A)=>o.onMouseEnter&&o.onMouseEnter(...A),onMouseleave:t[1]||=(...A)=>o.onMouseLeave&&o.onMouseLeave(...A)},[T(a,{ref:"modalManagerTemplateRef"},null,512),w("div",VJt,[o.windowPlugins.leftSidePanel?(k(),W(s,{key:0,plugin:o.windowPlugins.leftSidePanel},null,8,["plugin"])):le("",!0),w("div",jJt,[(k(!0),N(ut,null,Vt(o.windowPlugins.free,A=>(k(),W(l,{key:A.name,class:ye({"window-container__content__center__viewer":A.isViewer}),plugin:A},null,8,["class","plugin"]))),128)),T(c,{position:"left",plugins:o.windowPlugins.leftButtonColumn},null,8,["plugins"]),T(c,{position:"right",plugins:o.windowPlugins.rightButtonColumn},null,8,["plugins"])]),o.windowPlugins.rightSidePanel?(k(),W(s,{key:1,plugin:o.windowPlugins.rightSidePanel},null,8,["plugin"])):le("",!0)]),o.loading?(k(),N("div",QJt,[o.spinner&&o.spinner.component?(k(),W(qr(o.spinner.component),Cs(la({key:0},o.spinner.props)),null,16)):(k(),W(d,{key:1,size:"20px",border:"3px"}))])):le("",!0),o.layoutSettingsDisplayed?(k(),N("div",zJt,[T(u)])):le("",!0)],36)}var GJt=Q(HJt,[["render",qJt],["__scopeId","data-v-485f288e"]]),KJt=class{constructor(e=!0){let t=UKt(b4,null,{resizable:e});t.registerContent("default",GJt),this.settings=qo({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?OKt(e):null}copy(e,t=!0){return NKt(this.areas.layout,e,t)}open({ratio:e,direction:t,insertAfter:i,windowName:o=null,windowState:r=null,localContextId:n=null}={}){let a=o?{options:{windowName:o,windowState:r}}:null;return n===null?this.areas.splitLayout(e,t,i,a):this.areas.split(n,e,t,i,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;let i=new Set(e.windowState?.modelIds),o=new Set(t.windowState?.modelIds);return i.size===o.size&&[...i].every(r=>o.has(r))}return e.windowName||t.windowName||e.direction!==t.direction||e.children.length!==t.children.length?!1:e.children.every((i,o)=>this.compare(i,t.children[o]))}},JJt={name:"@bimdata/viewer",type:"module",version:"2.17.0-beta.6",description:"A customizable BIM viewer.",keywords:["bim","viewer","bimdata","ifc","bcf"],types:"./index.d.ts",author:"BIMData.io",homepage:"https://developers.bimdata.io/viewer/index.html",repository:{url:"https://github.com/bimdata/viewer"},bugs:{email:"support@bimdata.io"},browserslist:["last 2 chrome version","last 2 firefox version"],main:"dist/bimdata-viewer.esm.min.js",module:"dist/bimdata-viewer.esm.min.js",scripts:{dev:"vite -c build/vite.config.dev.js",build:"node scripts/build.mjs","build:prod":"vite build -c build/vite.config.prod.js && esbuild dist/bimdata-viewer.esm.min.js --minify --outfile=dist/bimdata-viewer.esm.min.js --allow-overwrite","build:offline":"vite build -c build/vite.config.offline.js && esbuild dist/bimdata-viewer.offline.esm.min.js --minify --outfile=dist/bimdata-viewer.offline.esm.min.js --allow-overwrite","build:runtime":"vite build -c build/vite.config.runtime.js && esbuild dist/bimdata-viewer.runtime.esm.min.js --minify --outfile=dist/bimdata-viewer.runtime.esm.min.js --allow-overwrite","build:split":"vite build -c build/vite.config.split.js && esbuild dist/bimdata-viewer.split.esm.min.js --minify --outfile=dist/bimdata-viewer.split.esm.min.js --allow-overwrite","build:umd":"vite build -c build/vite.config.umd.js && esbuild dist/bimdata-viewer.umd.cjs --minify --outfile=dist/bimdata-viewer.umd.min.cjs","cy:run":"cypress run","cy:open":"cypress open",prebuild:"rm -rf dist",prepublishOnly:"npm run build","semantic-release":"semantic-release",serve:"http-server -c-1 --silent",test:"npm run test:unit & npm run build & npm run test:e2e","test:unit":"jest","test:e2e":"start-server-and-test 'npm run serve -- -p 8080' http://localhost:8080 cy:run","test:e2e-dev":"start-server-and-test 'npm run serve -- -p 8080' http://localhost:8080 cy:open",version:"echo $npm_package_version",ts:"tsc"},files:["dist/*","types/*","CHANGELOG.md","README.md","package.json","package-lock.json","index.d.ts"],devDependencies:{"@babel/preset-env":"^7.29.0","@bimdata/2d-engine":"2.6.7","@bimdata/areas-next":"0.1.17","@bimdata/bcf-components":"6.7.7","@bimdata/components":"1.10.1","@bimdata/design-system":"2.3.0","@bimdata/engine-2d":"0.0.23","@bimdata/html-to-image":"1.11.16","@bimdata/typescript-fetch-api-client":"10.33.0","@eslint/eslintrc":"^3.3.4","@eslint/js":"^10.0.1","@photo-sphere-viewer/core":"^5.14.1","@rollup/plugin-alias":"^6.0.0","@rollup/plugin-babel":"^7.0.0","@rollup/plugin-commonjs":"^29.0.0","@rollup/plugin-image":"^3.0.3","@rollup/plugin-replace":"^6.0.3","@semantic-release/changelog":"^6.0.3","@semantic-release/commit-analyzer":"^13.0.1","@semantic-release/git":"^10.0.1","@semantic-release/github":"^12.0.6","@semantic-release/npm":"^13.1.5","@semantic-release/release-notes-generator":"^14.1.0","@vitejs/plugin-vue":"^6.0.4","@xeokit/xeokit-sdk":"git+https://git@github.com/Amoki/xeokit-sdk.git#b3227526bbbe8ac49c8c0c1d121363ca79781824","@zip.js/zip.js":"^2.8.21",async:"^3.2.6",autoprefixer:"^10.4.27","babel-core":"^7.0.0-bridge.0","babel-jest":"^30.2.0","conventional-changelog-eslint":"^6.0.0",cypress:"^15.11.0",esbuild:"^0.27.3",eslint:"^10.0.2","eslint-config-prettier":"^10.1.8","eslint-plugin-cypress":"^6.1.0","eslint-plugin-jest":"^29.15.0","eslint-plugin-prettier":"^5.5.5","eslint-plugin-vue":"^10.8.0",globals:"^17.4.0",html2canvas:"^1.4.1","http-server":"^14.1.1",jest:"^30.2.0","jest-environment-jsdom":"^30.2.0",lodash:"^4.17.23","pdfjs-dist":"^5.5.207",postcss:"^8.5.6",prettier:"^3.8.1","sass-embedded":"^1.97.3","semantic-release":"^25.0.3","start-server-and-test":"^2.1.5",vite:"^8.0.0","vite-plugin-css-injected-by-js":"^4.0.1",vue:"^3.5.29","vue-eslint-parser":"^10.4.0","vue-i18n":"^11.2.8"}},ZJt=1,WJt=class{math=BKe;constructor({plugins:e,api:t,ui:i,locale:o="fr"}){this.instanceId=ZJt++,this.pluginManager=new Pzt(e),this.windowManager=new Szt,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new QGt(t),this.globalContext=new dfe(this),this.state=iKt(this),this.shortcutManager=pde(this.state),this.uiSettings=i||{},this.i18n=new lfe(o),this._contextMenu=null,this.layout=new KJt(this.uiSettings.resizable!==!1),this._darkTheme=pe(i?.darkTheme??!1),this.localContext=null,window.$viewer=this}get darkTheme(){return this._darkTheme.value}set darkTheme(e){this._darkTheme.value=e}get version(){return JJt.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||Ade}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 YJt(e,t={}){t.backgroundColor&&(e.style.setProperty("--bimdata-viewer-background-color",t.backgroundColor),t.backgroundColor==="transparent"&&e.style.setProperty("--areas-separator-color","transparent")),t.colorPrimary&&e.style.setProperty("--color-primary",t.colorPrimary),t.colorPrimaryLighter&&e.style.setProperty("--color-primary-lighter",t.colorPrimaryLighter),t.colorPrimaryLight&&e.style.setProperty("--color-primary-light",t.colorPrimaryLight),t.colorPrimaryDark&&e.style.setProperty("--color-primary-dark",t.colorPrimaryDark),t.colorSecondary&&e.style.setProperty("--color-secondary",t.colorSecondary),t.colorSecondaryLighter&&e.style.setProperty("--color-secondary-lighter",t.colorSecondaryLighter),t.colorSecondaryLight&&e.style.setProperty("--color-secondary-light",t.colorSecondaryLight),t.colorSecondaryDark&&e.style.setProperty("--color-secondary-dark",t.colorSecondaryDark),t.colorSilverLight&&e.style.setProperty("--color-silver-light",t.colorSilverLight),t.colorSilver&&e.style.setProperty("--color-silver",t.colorSilver),t.colorSilverDark&&e.style.setProperty("--color-silver-dark",t.colorSilverDark),t.colorGraniteLight&&e.style.setProperty("--color-granite-light",t.colorGraniteLight),t.colorGranite&&e.style.setProperty("--color-granite",t.colorGranite),t.colorSuccess&&e.style.setProperty("--color-success",t.colorSuccess),t.colorSuccessLighter&&e.style.setProperty("--color-success-Lighter",t.colorSuccessLighter),t.colorSuccessLight&&e.style.setProperty("--color-success-Light",t.colorSuccessLight),t.colorSuccessDark&&e.style.setProperty("--color-success-Dark",t.colorSuccessDark),t.colorWarning&&e.style.setProperty("--color-warning",t.colorWarning),t.colorWarningLighter&&e.style.setProperty("--color-warning-Lighter",t.colorWarningLighter),t.colorWarningLight&&e.style.setProperty("--color-warning-Light",t.colorWarningLight),t.colorWarningDark&&e.style.setProperty("--color-warning-Dark",t.colorWarningDark),t.colorHigh&&e.style.setProperty("--color-high",t.colorHigh),t.colorHighLighter&&e.style.setProperty("--color-high-lighter",t.colorHighLighter),t.colorHighLight&&e.style.setProperty("--color-high-light",t.colorHighLight),t.colorHighDark&&e.style.setProperty("--color-high-dark",t.colorHighDark),t.colorText&&e.style.setProperty("--color-text",t.colorText),(!t.backgroundColor||t.backgroundColor!=="transparent")&&e.style.setProperty("--areas-separator-color","rgba(216, 216, 216, 1)"),t.headerHeight!=null&&e.style.setProperty("--bimdata-viewer-header-height",t.headerHeight),e.style.setProperty("--areas-background-color","transparent")}var XJt=Object.freeze({25:"GUEST",50:"USER",100:"ADMIN"}),X0=Object.freeze({READ:"read",WRITE:"write"});function rne(e){let t={};return e.forEach(i=>{let[o,r]=i.split(":");t[o]?t[o].push(r):t[o]=[r]}),t}var $Jt={token_scopes:[],usable_scopes:[],user_role:25};function one(e=$Jt){let t=rne(e.token_scopes),i=rne(e.usable_scopes);return{...hj(e),tokenScopes:t,usableScopes:i,userRole:XJt[e.user_role],user:e.user?hj(e.user):null,hasBcfReadPermission:i.bcf?.includes(X0.READ)??!1,hasBcfWritePermission:i.bcf?.includes(X0.WRITE)??!1,hasModelReadPermission:i.model?.includes(X0.READ)??!1,hasModelWritePermission:i.model?.includes(X0.WRITE)??!1,hasDocReadPermission:i.document?.includes(X0.READ)??!1,hasDocWritePermission:i.document?.includes(X0.WRITE)??!1}}var eZt={de:{BcfComponents:{back:"Zur\xFCck",BcfFilters:{filtersButton:"Filter",filtersTitle:"Filter",priorityLabel:"Priorit\xE4t",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",creatorsLabel:"Erstellt von",tagsLabel:"Tags",resetButton:"Zur\xFCcksetzen",searchButton:"Suchen",undefined:"Nicht definiert",datePlaceholder:"Erstellungsdatum"},BcfSettings:{title:"BCF-Parameter",text:"Erstellen, f\xFCllen und listen Sie die BCF-Einstellungen auf, die Sie f\xFCr dieses Projekt haben m\xF6chten.",validateButton:"Die BCF-Parameter anerkennen"},BcfStatistics:{emptyText:"F\xFCgen Sie Fragen hinzu, um zugeh\xF6rige Statistiken hier anzuzeigen.",issues:"Probleme",extension:{Priority:"Priorit\xE4t",PriorityNotDefined:"Keine Priorit\xE4t",PriorityTitle:"Priorit\xE4ten",Status:"Status",StatusNotDefined:"Kein Status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priorit\xE4t",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\xE4hlen Sie eine Datei aus.",addObjectButton:"Objekt",addAnnotationButton:"Annotation",annotationButtonTooltip:"Zu diesem Thema gibt es derzeit keine Ansichten.",addPictureButton:"F\xFCgen Sie ein Bild hinzu.",titlePlaceholder:"Titel *",titleErrorMessage:"Titel fehlt",typeLabel:"Typ",priorityLabel:"Priorit\xE4t",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",dueDateLabel:"F\xE4lligkeitsdatum (TT.MM.JJJJ)",descriptionLabel:"Beschreibung",labelsLabel:"Tags",createButton:"Best\xE4tigen",updateButton:"\xC4nderungen \xFCbernehmen",modalText:"Sie sind dabei, die Bearbeitung der Ausgabe {Name} zu beenden, aber es gibt noch ungespeicherte \xC4nderungen.",cancelButton:"\xC4nderungen verwerfen",continueButton:"\xC4nderungen fortsetzen",createTitle:"Ein Problem melden",dragDropImageTextTablet:"Foto machen",takeSnapshot:"Mach einen Schnappschuss",importFile:"Eine Datei importieren",searchPlaceholder:"Suchen",emptySearch:"kein Ergebnis",documentsLabel:"Dokumente",documentsCount:"Dokumente \u2013 {count} ausgew\xE4hlte Dokumente",groupsLabel:"Berechtigungen",groupsCount:"Berechtigungen \u2013 {count} ausgew\xE4hlte Gruppen",groupsText:"W\xE4hlen Sie die Benutzergruppen aus, die dieses Thema sehen und damit interagieren d\xFCrfen.",validate:"Best\xE4tigen"},BcfTopicOverview:{openViewer:"Im Viewer \xF6ffnen",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\xE4lligkeitsdatum",noDueDate:"Kein F\xE4lligkeitsdatum",informations:"Informationen",status:"Status",noStatusSpecified:"Kein Status angegeben",stage:"Phase",noStageProvided:"Keine Phase angegeben",priority:"Priorit\xE4t",priorityNotDefined:"Nicht definiert",tags:"Tags",noTags:"Keine Tags",commentButton:"Ein Kommentar ver\xF6ffentlichen",deleteText:"Sie l\xF6schen jetzt {Name}",deleteBcfButton:"Dieses BCF l\xF6schen",keepBcfButton:"Dieses BCF beibehalten",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE4t",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\xF6ffentlichen",commentsText:"Kommentare",deleteCommentText:"Diesen Kommentar l\xF6schen?",deleteButton:"L\xF6schen",takeSnapshot:"Mach einen Schnappschuss",edited:"bearbeitet"},BcfTopicPriorityCell:{noPriority:"Keine"},SettingCard:{addButton:"ein Element hinzuf\xFCgen",cancelButton:"Abbrechen",validateButton:"Best\xE4tigen",deleteExtensionText:"Diesen Parameter l\xF6schen",deleteButton:"L\xF6schen",title:{Priority:"Priorit\xE4ten",Label:"Tags",Status:"Status",Type:"Typen",Stage:"Phasen"},input:{Priority:"Eine neue Priorit\xE4t hinzuf\xFCgen",Label:"Ein neues Etikett hinzuf\xFCgen",Status:"Einen neuen Status hinzuf\xFCgen",Type:"Einen neuen Typ hinzuf\xFCgen",Stage:"Eine neue Phase hinzuf\xFCgen"},text:{Priority:"Liste der Priorit\xE4ten",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",groupsLabel:"Permissions",groupsCount:"Permissions - {count} selected groups",groupsText:"You are now setting the access rights: choose the user group(s) that will be exclusively authorized to see and interact with this topic.",validate:"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\xF3n"},BcfSettings:{title:"Par\xE1metros del BCF",text:"Cree, rellene y enumere los par\xE1metros del BCF que desea tener en este proyecto",validateButton:"Validar los par\xE1metros del BCF"},BcfStatistics:{emptyText:"A\xF1ada preguntas para ver las estad\xEDsticas asociadas aqu\xED.",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\xF3n",annotationButtonTooltip:"Actualmente este tema no posee ning\xFAn punto de vista",addPictureButton:"A\xF1adir una imagen",titlePlaceholder:"T\xEDtulo *",titleErrorMessage:"Falta el t\xEDtulo",typeLabel:"Tipo",priorityLabel:"Prioridad",statusLabel:"Estado",stageLabel:"Fase",assignedToLabel:"Asignado a",dueDateLabel:"Fecha de vencimiento (DD/MM/AAAA)",descriptionLabel:"Descripci\xF3n",labelsLabel:"Etiquetas",createButton:"Validar",updateButton:"Modificar este BCF",modalText:"Est\xE1 a punto de salir de la edici\xF3n 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\xEDa",takeSnapshot:"Tomar un snapshot",importFile:"Importar un archivo",searchPlaceholder:"Buscar",emptySearch:"No hay resultados"},BcfTopicOverview:{openViewer:"Abrir en el visor",openViewerNoModels:"No hay ning\xFAn modelo listo para la visualizaci\xF3n",elements:"{count} Elementos",noElements:"Ning\xFAn elemento",type:"Tipo",noTypeSpecified:"No se especifica el tipo",description:"Descripci\xF3n",noDescriptionProvided:"No hay descripci\xF3n",assignedTo:"Asignado a",notAssigned:"No asignado",dueDate:"Plazo",noDueDate:"Sin fecha de vencimiento",informations:"Informaci\xF3n",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\xE1s a punto de borrar {name}",deleteBcfButton:"Borrar este BCF",keepBcfButton:"Mantenga este BCF",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Prioridad",status:"Estado",title:"T\xEDtulo",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:"\xBFBorrar este comentario?",deleteButton:"Borrar",takeSnapshot:"Tomar un snapshot"},BcfTopicPriorityCell:{noPriority:"Sin"},SettingCard:{addButton:"a\xF1adir un elemento",cancelButton:"Cancelar",validateButton:"Validar",deleteExtensionText:"Borrar esta configuraci\xF3n",deleteButton:"Borrar",title:{Priority:"Prioridades",Label:"Etiquetas:",Status:"Estatutos",Type:"Tipos",Stage:"Fases"},input:{Priority:"A\xF1adir una nueva prioridad",Label:"A\xF1adir una nueva etiqueta",Status:"A\xF1adir un nuevo estado",Type:"A\xF1adir un nuevo tipo",Stage:"A\xF1adir 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\xE9",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assign\xE9 \xE0",creatorsLabel:"Cr\xE9\xE9 par",tagsLabel:"Tags",resetButton:"R\xE9initialiser",searchButton:"Rechercher",undefined:"Non d\xE9fini",datePlaceholder:"Date de cr\xE9ation"},BcfSettings:{title:"Param\xE8tres BCF",text:"Cr\xE9ez, renseignez et listez les param\xE8tres BCF que vous souhaitez avoir sur ce projet",validateButton:"Valider les param\xE8tres BCF"},BcfStatistics:{emptyText:"Ajoutez des questions pour voir les statistiques associ\xE9es ici.",issues:"probl\xE8mes",extension:{Priority:"Priorit\xE9",PriorityNotDefined:"Aucune priorit\xE9",PriorityTitle:"Priorit\xE9s",Status:"Statut",StatusNotDefined:"Aucun statut",StatusTitle:"Statuts"}},BcfTopicCard:{priority:"Priorit\xE9",noPriority:"Aucune",assignedTo:"Assign\xE9 \xE0",elements:"{n} \xC9lements",notSpecified:"Non d\xE9fini",see:"Voir"},BcfTopicCreationCard:{text:"Cr\xE9er un nouveau topic BCF",createBcfSideTitle:"Signaler un probl\xE8me"},BcfTopicForm:{dragDropImageText:"Veuillez s\xE9lectionner un fichier",addObjectButton:"Objet",addAnnotationButton:"Annotation",annotationButtonTooltip:"Ce topic ne poss\xE8de actuellement aucun point de vue",addPictureButton:"Ajouter une image",titlePlaceholder:"Titre *",titleErrorMessage:"Titre manquant",typeLabel:"Type",priorityLabel:"Priorit\xE9",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assign\xE9 \xE0",dueDateLabel:"Date d'\xE9ch\xE9ance",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Valider",updateButton:"Modifier ce BCF",modalText:"Vous \xEAtes sur le point de quitter l'\xE9dition de l'issue {name} mais il y'a des modifications non enregistr\xE9es.",cancelButton:"Annuler les modifications",continueButton:"Continuer les modifications",createTitle:"Signaler un probl\xE8me",dragDropImageTextTablet:"Prendre une photo",takeSnapshot:"Prendre un snapshot",importFile:"Importer un fichier",searchPlaceholder:"Rechercher",emptySearch:"Pas de r\xE9sultat",documentsLabel:"Documents",documentsCount:"Documents - {count} documents s\xE9lectionn\xE9s",groupsLabel:"Permissions",groupsCount:"Permissions - {count} groupes s\xE9lectionn\xE9s",groupsText:"S\xE9lectionner les groupes utilisateur qui peuvent voir ce topic et int\xE9ragir avec.",validate:"Valider"},BcfTopicOverview:{openViewer:"Ouvrir dans le viewer",openViewerNoModels:"Il n'y a aucun mod\xE8le pr\xEAt pour une visualisation",elements:"{count} \xC9lements",noElements:"Aucun \xE9l\xE9ment concern\xE9",type:"Type",noTypeSpecified:"Pas de type sp\xE9cifi\xE9",description:"Description",noDescriptionProvided:"Pas de description renseign\xE9e",assignedTo:"Assign\xE9 \xE0",notAssigned:"Non assign\xE9",dueDate:"\xC9ch\xE9ance",noDueDate:"Pas de date d'\xE9ch\xE9ance",informations:"Informations",status:"Statut",noStatusSpecified:"Pas de statut sp\xE9cifi\xE9",stage:"Phase",noStageProvided:"Pas de phase renseign\xE9e",priority:"Priorit\xE9",priorityNotDefined:"Non d\xE9fini",tags:"Tags",noTags:"Pas de tags",commentButton:"Poster un commentaire",deleteText:"Vous \xEAtes sur le point de supprimer {name}",deleteBcfButton:"Supprimer ce BCF",keepBcfButton:"Conserver ce BCF",author:"Auteur"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE9",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\xE9"},BcfTopicPriorityCell:{noPriority:"Aucune"},SettingCard:{addButton:"ajouter un \xE9l\xE9ment",cancelButton:"Annuler",validateButton:"Valider",deleteExtensionText:"Supprimmer ce param\xE8tre",deleteButton:"Supprimer",title:{Priority:"Priorit\xE9s",Label:"Tags",Status:"Statuts",Type:"Types",Stage:"Phases"},input:{Priority:"Ajouter une nouvelle priorit\xE9",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\xE9s",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\xE0",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\xE0",PriorityNotDefined:"Nessuna priorit\xE0",PriorityTitle:"Priorit\xE0",Status:"Stato",StatusNotDefined:"Nessuno stato",StatusTitle:"Stati"}},BcfTopicCard:{priority:"Priorit\xE0",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\xE0",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\xE0",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\xE0",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\xE0",Label:"Etichette",Status:"Stati",Type:"Tipi",Stage:"Fasi"},input:{Priority:"Aggiungi una nuova priorit\xE0",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\xE0",Label:"Elenco delle etichette",Status:"Elenco degli stati",Type:"Elenco dei tipi",Stage:"Elenco delle fasi"}}}}},tZt=({apiClient:e,fetchUsers:t,i18nPlugin:i}={})=>({install(o){e?fr.setup({apiClient:e,fetchUsers:t}):console.error("[BCF Components Plugin] No api client provided. You must provide an api client for the components to work properly."),i?Object.entries(eZt).forEach(([r,n])=>{i.global.mergeLocaleMessage(r,n)}):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(o3e).forEach(([r,n])=>{o.component(r,n)})}}),iZt={de:{BuildingMaker:{title:"Building Maker",back:"Zur\xFCck",list:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",createButton:"Neues Projekt",updateButton:"Umbenennen",deleteButton:"L\xF6schen"},form:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",input:"Name des Geb\xE4udes",error:"Ung\xFCltiger Name",createButton:"Erstellen",updateButton:"Best\xE4tigen"},view:{addStoreyButton:"Etage",addPlanButton:"Grundriss",closeButton:"Fertigstellen",submitFilesButton:"Best\xE4tigen"},storeyForm:{title:"Neue Etage",input:"Name",error:"Ung\xFCltiger Name",cancelButton:"Abbrechen",submitButton:"Best\xE4tigen"}},FileManager:{creationFormTitle:"Ordner erstellen",renameFormPlaceholder:"Datei- / Ordnernam",nameInputPlaceholder:"Ordnername",emptyFolder:"Dieser Ordner ist leer",newFolderSuccess:"Neuer Ordner erstellt",renameFolderSuccess:"Umbenannter Ordner",deleteFolderSuccess:"Ordner gel\xF6scht",newFileSuccess:"Datei hinzugef\xFCgt",renameFileSuccess:"Umbenannte Datei",deleteFileSuccess:"Datei gel\xF6scht",nameInputErrorMessage:"Ung\xFCltiger name",cancel:"Abbrechen",submit:"Best\xE4tigen",buttonText:"Neuer Ordner",addFileButtonText:"Datei laden",rename:"Umbenennen",view:"Sehen",download:"Herunterladen",delete:"L\xF6schen",deleteTitle:"Dateien l\xF6schen",deleteDetail:"Sie sind im Begriff, die folgenden Dateien / Ordner endg\xFCltig zu l\xF6schen"}},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\xE9s cargue los PDF.",createButton:"Nuevo proyecto",updateButton:"Renombrar",deleteButton:"Suprimir"},form:{text:"Cree y edite los pisos despu\xE9s cargue los PDF.",input:"Nombre del edificio",error:"Nombre no v\xE1lido",createButton:"Crear",updateButton:"Validar"},view:{addStoreyButton:"Piso",addPlanButton:"Plano",closeButton:"Terminar",submitFilesButton:"Validar"},storeyForm:{title:"Nuevo piso",input:"Nombre",error:"Nombre no v\xE1lido",cancelButton:"Anular",submitButton:"Validar"}},FileManager:{creationFormTitle:"Crear un archivo",renameFormPlaceholder:"Nombre de archivo / carpeta",nameInputPlaceholder:"Nombre de la carpeta",emptyFolder:"Esta carpeta est\xE1 vac\xEDa",newFolderSuccess:"Nueva carpeta creada",renameFolderSuccess:"Carpeta renombrada",deleteFolderSuccess:"Carpeta eliminada",newFileSuccess:"Archivo agregado",renameFileSuccess:"Archivo renombrado",deleteFileSuccess:"Archivo eliminado",nameInputErrorMessage:"Nombre inv\xE1lida",cancel:"Cancelar",submit:"Validar",buttonText:"Carpeta nueva",addFileButtonText:"Cargar un archivo",rename:"Renombrar",view:"Ver",download:"Descargar",delete:"Borrar",deleteTitle:"Eliminar archivos",deleteDetail:"Est\xE1 a punto de eliminar permanentemente los siguientes archivos / carpetas"}},fr:{BIMDataComponents:{t:{back:"Retour",cancel:"Annuler",create:"Cr\xE9er",delete:"Supprimer",download:"T\xE9l\xE9charger",finish:"Terminer",rename:"Renommer",search:"Rechercher",see:"Voir",storey:"\xC9tage",validate:"Valider"}},BuildingMaker:{title:"Building Maker",list:{text:"Cr\xE9ez et \xE9ditez les \xE9tages puis t\xE9l\xE9chagez vos PDF.",new:"Nouveau projet"},form:{input:"Nom du b\xE2timent",error:"Nom invalide"},view:{addStorey:"Ajouter un \xC9tage",addFile:"Ajouter un fichier",addPlan:"Ajouter un plan"},storeyForm:{title:"Nouvel \xE9tage",input:"Nom",error:"Nom invalide"}},FileManager:{creationFormTitle:"Cr\xE9er un dossier",renameFormPlaceholder:"Nom du fichier/dosier",nameInputPlaceholder:"Nom du dossier",emptyFolder:"Ce dossier est vide",newFolderSuccess:"Nouveau dossier cr\xE9\xE9",renameFolderSuccess:"Dossier renomm\xE9",deleteFolderSuccess:"Dossier supprim\xE9",newFileSuccess:"Fichier ajout\xE9",renameFileSuccess:"Fichier renomm\xE9",deleteFileSuccess:"Fichier supprim\xE9",nameInputErrorMessage:"Nom invalide",buttonText:"Nouveau dossier",addFileButtonText:"Charger un fichier",deleteTitle:"Supression de fichiers",deleteDetail:"Vous \xEAtes sur le point de supprimer d\xE9finitivement les fichiers/dossiers suivants",dmsRoot:"Racine de la GED du projet",pdfPageSelectorTitle:"S\xE9lectionner une page"},MetaBuildingStructure:{title:"Structure M\xE9ta-Building",tab:{structure:"Structure",zones:"Zones",equipments:"\xC9quipements"},StoreySelector:{placeholder:"S\xE9lectionner un \xE9tage"}},PhotosphereBuilding:{title:"Photosph\xE8re 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 \xE8 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"}}},rZt=({i18nPlugin:e}={})=>({install(t){e?Object.entries(iZt).forEach(([i,o])=>{e.global.mergeLocaleMessage(i,o)}):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(RIt).forEach(([i,o])=>{t.component(i,o)})}}),oZt={beforeMount(e,t){if(typeof t.value!="function")throw Error(`click away directive needs function, got ${typeof t.value}`);e.clickAwayHandler=i=>{(i.path||i.composedPath&&i.composedPath()).find(o=>o===e)||t.value()},window.addEventListener("mousedown",e.clickAwayHandler,!0)},unmounted(e){window.removeEventListener("mousedown",e.clickAwayHandler,!0),delete e.clickAwayHandler}},nZt=co({BIMDataClickAway:()=>zl,BIMDataClickInputAway:()=>oZt}),aZt=e=>({install(t){Object.entries(lNe).forEach(([i,o])=>{e&&e.excludedComponents&&e.excludedComponents.length>0&&e.excludedComponents.includes(i)||(!e||!e.includedComponents||e.includedComponents.includes(i))&&t.component(i,o)}),(!e||e.directives!==!1)&&Object.entries(nZt).forEach(([i,o])=>t.directive(i.split("BIMData")[1],o))}}),sZt={name:"LiWrapper",render(){return Gr("li",this.$slots.default())}};function lZt(e,t){var i=new Set([]);return e.forEach(o=>{t.has(o)||i.add(o)}),i}var Bc=Qn("id"),cZt=({contextMenu:e,objects:t=[],state:i=e.$viewer.state,pictos:o})=>[{name:"selectAll",get group(){return e.groupPositions.select},position:1,get label(){return e.$t("context_menu.select_all")},get picto(){return o.get(this.name)},execute:()=>i.selectObjects(t.filter(Sl(ar("visible"),yA("selected"))).map(Bc)),predicate:()=>t.some(Sl(ar("visible"),yA("selected")))},{name:"deselectAll",get group(){return e.groupPositions.select},position:2,get label(){return e.$t("context_menu.deselect_all")},get picto(){return o.get(this.name)},execute:()=>i.deselectObjects(t.filter(ar("selected")).map(Bc)),predicate:()=>t.some(ar("selected"))},{name:"selectSimilar",get group(){return e.groupPositions.select},position:3,get label(){return e.$t("context_menu.select_similar")},get picto(){return o.get(this.name)},execute(){let r=t.filter(n=>n.visible&&n.type===this.selectedObject.type&&n.id!==this.selectedObject.id).map(Bc);i.selectObjects(r)},selectedObject:null,predicate(){let r=t.filter(Sl(ar("visible"),ar("selected")));return r.length===1&&r[0].type!==void 0?(this.selectedObject=r[0],!0):(this.selectedObject=null,!1)}},{name:"reverseSelection",get label(){return e.$t("context_menu.reverse_selection")},get group(){return e.groupPositions.select},position:4,execute:()=>{let r=new Set(t.filter(ar("selected")).map(Bc)),n=new Set(t.filter(ar("visible")).map(Bc));i.selectObjects(Array.from(lZt(n,r)),{exclusive:!0})},predicate:()=>t.some(Sl(yA("selected"),ar("visible")))&&t.some(Sl(ar("selected"),ar("visible")))},{name:"showAll",get group(){return e.groupPositions.visibility},position:1,get label(){return e.$t("context_menu.show_all")},get picto(){return o.get(this.name)},execute:()=>i.showObjects(t.filter(yA("visible")).map(Bc)),predicate:()=>t.some(yA("visible"))},{name:"hide",get group(){return e.groupPositions.visibility},position:2,get label(){return e.$t("context_menu.hide")},get picto(){return o.get(this.name)},objectsToHide:null,execute(){let r=this.objectsToHide.filter(ar("selected"));r.length>0&&i.deselectObjects(r.map(Bc)),i.hideObjects(this.objectsToHide.map(Bc))},predicate(){return this.objectsToHide=t.filter(Sl(ar("selected"),ar("visible"))),this.objectsToHide.length>0}},{name:"hideAll",get group(){return e.groupPositions.visibility},position:3,get label(){return e.$t("context_menu.hide_all")},execute:()=>{let r=t.filter(ar("visible"));r.some(ar("selected"))&&i.deselectObjects(r.filter(ar("selected")).map(Bc)),i.hideObjects(r.map(Bc))},predicate:()=>t.some(ar("visible"))}].filter(r=>r.predicate()),dZt={components:{LiWrapper:sZt},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(e){e?document.addEventListener("keydown",this.onKeyDown):document.removeEventListener("keydown",this.onKeyDown)}},created(){this.$viewer.contextMenu=this,this.asyncPredicates=new Set},methods:{onKeyDown(e){e.key==="Escape"&&this.away()},setPosition(e){let t=(document.fullscreenElement?document.fullscreenElement:this.$parent.$el).getBoundingClientRect();this.left=e.clientX-t.left,this.top=e.clientY-t.top,this.left+this.width>t.width&&(this.left-=this.width),e.clientY>t.top+t.height/2?(this.bottom=t.height-this.top,this.top=null):this.bottom=null},typeCheckCommand(e={}){let t=null;if((!e.execute||typeof e.execute!="function")&!e.component&&(t="Cannot register context menu command. A command must have an execute function or a component property."),e.label||(t="Cannot register context menu command. A command must have a label."),t)throw console.error(t),Error(t);return e.id=this.nextCommandId++,e},open(e){this.currentCommands=[],this.setPosition(e),this.originEvent=e,e.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 e=>{if(typeof e.predicate=="function"){let t=e.predicate(this.$viewer.globalContext.activeLocalContext);if(t===!0)this.currentCommands.push(e);else if(typeof t?.then=="function"){this.asyncPredicates.add(t),this.asyncPredicateRunning=!0;let i=await t;this.asyncPredicates.has(t)&&(this.asyncPredicates.delete(t),this.asyncPredicateRunning=this.asyncPredicates.size>0,i===!0&&this.currentCommands.push(e))}}else this.currentCommands.push(e)}),this.currentCommands.push(...this.contextCommands),this.contextCommands=[]},getDefaultCommands({objects:e=[],state:t=this.$viewer.state,context:i=null}){let o=new Map;return i&&this.$viewer.shortcutManager.getShortcuts(i).forEach(r=>o.set(r.name,r.key)),cZt({contextMenu:this,objects:e,state:t,pictos:o})},executeCommand(e){if(e.execute&&(e.execute(this.originEvent),this.displayed=!1),e.component&&!e.menu)throw Error("Command with component property must have a `menu` property")},away(){this.displayed=!1},groupCurrentCommands(){let e=new Map;this.currentCommands.forEach(t=>{(t.group===null||t.group===void 0)&&(t.group=0),e.has(t.group)?e.get(t.group).push(t):e.set(t.group,[t])}),e.forEach(t=>t.sort((i,o)=>(i.position=i.position||0,o.position=o.position||0,i.position-o.position))),this.currentCommands=[...e.keys()].sort((t,i)=>t-i).map(t=>e.get(t)).flat()},isGroupIntersection(e){if(e===0)return!1;let t=this.currentCommands[e-1],i=this.currentCommands[e];return t.group<i.group},registerContextCommand(e){let t=this.typeCheckCommand(e);return this.contextCommands.push(t),e.id},registerCommand(e){let t=this.typeCheckCommand(e);return this.registeredCommands.push(t),e.id},unregisterCommand(e){return this.registeredCommands.find(t=>t.id===e)?(this.registeredCommands=this.registeredCommands.filter(t=>t.id!==e),!0):!1},preventDefault(){this.defaultPrevented=!0}}},uZt={key:0,class:"separator"},AZt={class:"menu-text"},hZt={key:1,class:"menu-picto"},pZt={key:0,class:"context-menu__spinner"};function fZt(e,t,i,o,r,n){let a=I("BIMDataIconChevron"),s=I("LiWrapper"),l=I("BIMDataSpinner"),c=Li("click-away");return r.displayed&&(r.currentCommands.length||r.asyncPredicateRunning)?Tt((k(),N("ul",{key:0,class:"bimdata-list context-menu",style:ve(n.position)},[(k(!0),N(ut,null,Vt(r.currentCommands,(d,u)=>(k(),W(s,{key:d.label,class:"context-menu__element",onClick:A=>n.executeCommand(d)},{default:j(()=>[n.isGroupIntersection(u)?(k(),N("div",uZt)):le("",!0),w("div",AZt,G(d.label),1),!d.component&&d.picto?(k(),N("span",hZt,G(d.picto),1)):d.component?(k(),W(a,{key:2,size:"xxs",class:"fill-primary"})):le("",!0)]),_:2},1032,["onClick"]))),128)),r.asyncPredicateRunning?(k(),N("li",pZt,[T(l)])):le("",!0)],4)),[[c,n.away]]):le("",!0)}var gZt=Q(dZt,[["render",fZt],["__scopeId","data-v-5b87d4a3"]]),mZt={name:"ViewerHeader",inject:["$viewer"],props:{visible:{type:Boolean,default:!0}},setup(){let e=bt("$viewer"),t=qo(new Map);return{logo:e.uiSettings.bimdataLogo!==!1,version:e.uiSettings.version===!1?null:e.version,headerContent:t,headerRightContentComponents:je(()=>Array.from(t.values()).filter(i=>i.position==="right").sort((i,o)=>i.order-o.order).map(i=>i.component)),headerLeftContentComponents:je(()=>Array.from(t.values()).filter(i=>i.position==="left").sort((i,o)=>i.order-o.order).map(i=>i.component)),addContent:i=>{if(!i.name)throw TypeError("[Viewer Header] Content must have a name");if(t.has(i.name))throw Error(`[Viewer Header] Content with name ${i.name} already exists`);t.set(i.name,i)},removeContent:i=>t.has(i)?(t.delete(i),!0):!1}}},vZt={class:"viewer-header"},yZt={class:"viewer-header__content"},wZt={class:"viewer-header__content__left"},bZt={class:"viewer-header__content__right"},CZt={key:0,class:"m-l-6 flex items-center"},xZt={key:1,class:"viewer-header__version"};function BZt(e,t,i,o,r,n){let a=I("BIMDataIllustration");return Tt((k(),N("div",vZt,[w("div",yZt,[w("div",wZt,[(k(!0),N(ut,null,Vt(o.headerLeftContentComponents,s=>(k(),W(qr(s),{key:s.name}))),128))]),w("div",bZt,[(k(!0),N(ut,null,Vt(o.headerRightContentComponents,s=>(k(),W(qr(s),{key:s.name}))),128))])]),o.logo||o.version?(k(),N("div",CZt,[o.logo?(k(),W(a,{key:0,name:"logo",width:"30px",height:"30px"})):le("",!0),o.version?(k(),N("div",xZt,G(o.version),1)):le("",!0)])):le("",!0)],512)),[[ui,i.visible]])}var kZt=Q(mZt,[["render",BZt],["__scopeId","data-v-5c9ea6b6"]]),EZt={emits:["resize"],setup(e,{emit:t}){return{onResizerMousedown:i=>{i.preventDefault();let o=i.clientX,r=a=>{a.preventDefault();let s=a.clientX-o;o=a.clientX,t("resize",s)},n=a=>{a.preventDefault(),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",r),window.addEventListener("mouseup",n)}}}},MZt={class:"bimdata-separator"};function PZt(e,t,i,o,r,n){return k(),N("div",MZt,[t[1]||=w("div",{class:"bimdata-separator__line"},null,-1),w("div",{class:"bimdata-separator__resizer",onMousedown:t[0]||=(...a)=>o.onResizerMousedown&&o.onResizerMousedown(...a)},null,32)])}var IZt={components:{Separator:Q(EZt,[["render",PZt],["__scopeId","data-v-79a3b3af"]])},props:{position:{type:String,required:!0,validator(e){return["left","right"].includes(e)}},sidePanel:{type:Object,required:!0,validator(e){if(e.width&&(typeof e.width!="number"||e.width<0))return console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof e.width}`),!1;let t=typeof e?.component=="object";return t||console.error("[GlobalSidePanel] sidePanel must have a component property"),t}}},setup(e){let t=pe(null),i=pe(e.sidePanel.width??400);return xt(()=>e.sidePanel,()=>{Object.defineProperty(e.sidePanel,"width",{get(){return i.value},set(o){if(typeof o!="number"||o<=0){console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof o}`);return}i.value=o}}),Object.defineProperty(e.sidePanel,"componentInstance",{get(){return t.value},enumerable:!0})},{immediate:!0}),{componentInstance:t,width:i,onResize:(o,r=1)=>{let n=i.value+o*r;i.value=Math.max(0,n)}}}},SZt={class:"bimdata-global-side-panel__component"};function DZt(e,t,i,o,r,n){let a=I("Separator");return k(),N("div",{class:"bimdata-global-side-panel",style:ve(`width: ${o.width}px`)},[i.sidePanel.resizable&&i.position==="right"?(k(),W(a,{key:0,onResize:t[0]||=s=>o.onResize(s,-1)})):le("",!0),w("div",SZt,[(k(),W(qr(i.sidePanel.component),{ref:"componentInstance"},null,512))]),i.sidePanel.resizable&&i.position==="left"?(k(),W(a,{key:1,onResize:t[1]||=s=>o.onResize(s)})):le("",!0)],4)}var TZt={name:"BimdataViewer",components:{ContextMenu:gZt,ViewerHeader:kZt,ModalManager:ene,GlobalSidePanel:Q(IZt,[["render",DZt],["__scopeId","data-v-82d0d4cb"]])},setup(){let e=bt("$viewer"),{globalContext:t,shortcutManager:i}=e;$i(()=>{i&&i.destroy(),t.hub.clear()}),Di(()=>{e.pluginManager.runPluginsScripts(e)});let o=je(()=>e.uiSettings.bimdataLogo!==!1&&(t.localContexts.length!==1||t.localContexts[0].window?.logoAndVersion)),r=je(()=>e.uiSettings.version!==!1&&(t.localContexts.length!==1||t.localContexts[0].window?.logoAndVersion)?e.version:null),n=je(()=>t.leftSidePanel),a=je(()=>t.rightSidePanel),s=je(()=>{let h=e.uiSettings.header!==!1,p=t.localContexts.length===1&&t.localContexts[0].window?.header===!1,f=!!(n.value||a.value);return h&&(!p||f)}),l=e.uiSettings.contextMenu!==!1,c=pe(null);function d(h){l&&c.value.open(h)}function u(){e.shortcutManager.active=!0}function A(){e.shortcutManager.active=!1}return{Layout:e.layout.areas.component,onContextMenu:d,onMouseenter:u,onMouseleave:A,isHeaderVisible:s,viewerTemplateRef:t.templateRef,modalManagerTemplateRef:t.modalManagerTemplateRef,headerTemplateRef:t.headerTemplateRef,contextMenuTemplateRef:c,contextMenuEnabled:l,bimdataLogoOnSingleWindow:o,viewerVersionOnSingleWindow:r,version:e.version,loading:je(()=>t.loading),spinner:je(()=>t.spinner),leftSidePanel:n,rightSidePanel:a}}},LZt={key:1,class:"bimdata-context-loading-overlay",style:{"z-index":"3"}},RZt={key:2,class:"viewer__logo"},_Zt={key:1,class:"version m-t-6"};function FZt(e,t,i,o,r,n){let a=I("ModalManager"),s=I("ContextMenu"),l=I("ViewerHeader"),c=I("GlobalSidePanel"),d=I("BIMDataSpinner"),u=I("BIMDataIllustration");return k(),N("div",{id:"bimdata-viewer",ref:"viewerTemplateRef",class:"bimdata-viewer bimdata-design-system bimdata-scrollbar",onContextmenu:t[0]||=(...A)=>o.onContextMenu&&o.onContextMenu(...A),onMouseenter:t[1]||=(...A)=>o.onMouseenter&&o.onMouseenter(...A),onMouseleave:t[2]||=(...A)=>o.onMouseleave&&o.onMouseleave(...A)},[T(a,{ref:"modalManagerTemplateRef"},null,512),o.contextMenuEnabled?(k(),W(s,{key:0,ref:"contextMenuTemplateRef"},null,512)):le("",!0),T(l,{ref:"headerTemplateRef",visible:o.isHeaderVisible},null,8,["visible"]),w("div",{class:"bimdata-viewer__content",style:ve(o.isHeaderVisible?"height: calc(100% - var(--bimdata-viewer-header-height, 40px))":"height: 100%")},[o.leftSidePanel?(k(),W(c,{key:0,"side-panel":o.leftSidePanel,position:"left"},null,8,["side-panel"])):le("",!0),(k(),W(qr(o.Layout),{style:"height: 100%; flex-grow: 1;"})),o.rightSidePanel?(k(),W(c,{key:1,"side-panel":o.rightSidePanel,position:"right"},null,8,["side-panel"])):le("",!0)],4),o.loading?(k(),N("div",LZt,[o.spinner&&o.spinner.component?(k(),W(qr(o.spinner.component),Cs(la({key:0},o.spinner.props)),null,16)):(k(),W(d,{key:1,size:"40px",border:"5px"}))])):le("",!0),!o.isHeaderVisible&&(o.bimdataLogoOnSingleWindow||o.viewerVersionOnSingleWindow)?(k(),N("div",RZt,[o.bimdataLogoOnSingleWindow?(k(),W(u,{key:0,name:"logo"})):le("",!0),o.viewerVersionOnSingleWindow?(k(),N("div",_Zt,G(o.version),1)):le("",!0)])):le("",!0)],544)}var UZt=Q(TZt,[["render",FZt],["__scopeId","data-v-0c1c941a"]]),OZt=["src"],NZt={class:"bimdata-models__header"},HZt={key:0,class:"bimdata-models__header__loader"},VZt={class:"bimdata-models__header__picto"},jZt={class:"bimdata-models__header__name"},QZt={key:0,class:"bimdata-models__header__name--empty"},zZt={key:1,class:"bimdata-models__header__name--empty"},qZt={key:3},GZt=["onMousemove","onClick"],nne=Q({__name:"Models",props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:"350px"}},setup(e){let t=e,i=bt("$viewer"),o=pe(),r=pe(0),n=pe(0),a=pe(),s=Ui([]),l=pe(!1),c=je(()=>i.localContext.loadedModels),d=je(()=>i.localContext.loadedModelIds),u=je(()=>i.localContext.loadingModelIds),A=je(()=>i.localContext.multiModel),h=je(()=>(t.customFilter?s.value.filter(t.customFilter):s.value).map(B=>c.value.find(E=>E.document?.head_id!=null&&E.document.head_id===B.document.id)??B)),p=B=>d.value.includes(B),f=B=>u.value.includes(B),m=je(()=>{let{x:B,y:E}=a.value?.getBoundingClientRect()??{x:0,y:0};return`top:${n.value-E}px; left:${r.value-B}px;`}),g=B=>{!A.value&&p(B.id)||u.value.length>0||(i.localContext.loadedModelIds.includes(B.id)?i.localContext.unloadModels([B.id]):i.localContext.loadModels([B.id]))},y=B=>{switch(B){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},v=(B,E)=>{B?.viewer_360_file&&(r.value=E.clientX,n.value=E.clientY),o.value=B?.viewer_360_file},C=async B=>{l.value=!0;try{return(await i.api.apiClient.modelApi.getModels(i.api.cloudId,i.api.projectId,void 0,void 0,B)).filter(E=>i.state.models.some(D=>D.archived)||!E.archived).sort(Zl("updated_at",!1))}catch(E){console.error("[Models] Cannot get project models. Error: ",E)}finally{l.value=!1}return[]},x=B=>B.children?.some(E=>p(E.id))??!1;return C(i.localContext.modelTypes).then(B=>{s.value=B}),(B,E)=>{let D=I("BIMDataSpinner"),P=I("BIMDataIconModel3D"),M=I("BIMDataTextbox"),R=I("BIMDataCheckbox"),O=I("BIMDataRadio"),V=I("BIMDataIcon"),z=I("BIMDataDropdownList");return k(),N("div",{ref_key:"templateRef",ref:a,class:ye(["bimdata-models",{"bimdata-models--window-positioning":e.windowPositioning}])},[o.value?(k(),N("div",{key:0,class:"bimdata-models__preview",style:ve(m.value)},[w("img",{src:o.value},null,8,OZt)],4)):le("",!0),T(z,{style:ve(`--bimdata-models-width: ${e.width};`),width:e.width,list:h.value,"element-key":"id","per-page":40,loading:l.value,class:"bimdata-models__list",disabled:h.value.length===0,onElementClick:g},{header:j(({isOpen:K})=>[w("div",NZt,[l.value||u.value.length>0?(k(),N("div",HZt,[T(D)])):(k(),N(ut,{key:1},[w("div",VZt,[T(P)]),w("div",{class:ye(["bimdata-models__header__number bimdata-info-length",{"bimdata-models__header__number--empty":d.value.length===0}])},[w("span",null,G(d.value.length),1)],2),w("div",jZt,[h.value.length===0?(k(),N("span",QZt,G(B.$t("model.no_model")),1)):d.value.length===0?(k(),N("span",zZt,G(B.$t("model.no_loaded_model")),1)):d.value.length===1?(k(),W(M,{key:2,text:c.value[0].name,tooltip:!K},null,8,["text","tooltip"])):d.value.length>1?(k(),N("span",qZt,G(B.$t("model.selected_models")),1)):le("",!0)])],64))])]),element:j(({element:K,close:Z})=>[w("div",{class:"bimdata-models__model",onMousemove:te=>e.preview&&v(K,te),onMouseout:E[0]||=te=>e.preview&&v(),onClick:()=>{!A.value&&!p(K.id)&&Z()}},[A.value?(k(),W(R,{key:0,"model-value":p(K.id)||x(K),disabled:K.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])):(k(),W(O,{key:1,"model-value":p(K.id)||x(K),disabled:K.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])),T(V,{margin:"0 calc(var(--spacing-unit) / 2)",name:y(K.status),size:"xs",class:ye({"fill-success":K.status==="C","fill-high":K.status==="E"})},null,8,["name","class"]),T(M,{class:ye({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":K.status!=="C"||u.value.length>0}),text:K.name,width:`calc(100% -
6441
+ `),onMouseenter:t[0]||=(...A)=>o.onMouseEnter&&o.onMouseEnter(...A),onMouseleave:t[1]||=(...A)=>o.onMouseLeave&&o.onMouseLeave(...A)},[T(a,{ref:"modalManagerTemplateRef"},null,512),w("div",VJt,[o.windowPlugins.leftSidePanel?(k(),W(s,{key:0,plugin:o.windowPlugins.leftSidePanel},null,8,["plugin"])):le("",!0),w("div",jJt,[(k(!0),N(ut,null,Vt(o.windowPlugins.free,A=>(k(),W(l,{key:A.name,class:ye({"window-container__content__center__viewer":A.isViewer}),plugin:A},null,8,["class","plugin"]))),128)),T(c,{position:"left",plugins:o.windowPlugins.leftButtonColumn},null,8,["plugins"]),T(c,{position:"right",plugins:o.windowPlugins.rightButtonColumn},null,8,["plugins"])]),o.windowPlugins.rightSidePanel?(k(),W(s,{key:1,plugin:o.windowPlugins.rightSidePanel},null,8,["plugin"])):le("",!0)]),o.loading?(k(),N("div",QJt,[o.spinner&&o.spinner.component?(k(),W(qr(o.spinner.component),Cs(la({key:0},o.spinner.props)),null,16)):(k(),W(d,{key:1,size:"20px",border:"3px"}))])):le("",!0),o.layoutSettingsDisplayed?(k(),N("div",zJt,[T(u)])):le("",!0)],36)}var GJt=Q(HJt,[["render",qJt],["__scopeId","data-v-485f288e"]]),KJt=class{constructor(e=!0){let t=UKt(b4,null,{resizable:e});t.registerContent("default",GJt),this.settings=qo({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?OKt(e):null}copy(e,t=!0){return NKt(this.areas.layout,e,t)}open({ratio:e,direction:t,insertAfter:i,windowName:o=null,windowState:r=null,localContextId:n=null}={}){let a=o?{options:{windowName:o,windowState:r}}:null;return n===null?this.areas.splitLayout(e,t,i,a):this.areas.split(n,e,t,i,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;let i=new Set(e.windowState?.modelIds),o=new Set(t.windowState?.modelIds);return i.size===o.size&&[...i].every(r=>o.has(r))}return e.windowName||t.windowName||e.direction!==t.direction||e.children.length!==t.children.length?!1:e.children.every((i,o)=>this.compare(i,t.children[o]))}},JJt={name:"@bimdata/viewer",type:"module",version:"2.17.0-beta.7",description:"A customizable BIM viewer.",keywords:["bim","viewer","bimdata","ifc","bcf"],types:"./index.d.ts",author:"BIMData.io",homepage:"https://developers.bimdata.io/viewer/index.html",repository:{url:"https://github.com/bimdata/viewer"},bugs:{email:"support@bimdata.io"},browserslist:["last 2 chrome version","last 2 firefox version"],main:"dist/bimdata-viewer.esm.min.js",module:"dist/bimdata-viewer.esm.min.js",scripts:{dev:"vite -c build/vite.config.dev.js",build:"node scripts/build.mjs","build:prod":"vite build -c build/vite.config.prod.js && esbuild dist/bimdata-viewer.esm.min.js --minify --outfile=dist/bimdata-viewer.esm.min.js --allow-overwrite","build:offline":"vite build -c build/vite.config.offline.js && esbuild dist/bimdata-viewer.offline.esm.min.js --minify --outfile=dist/bimdata-viewer.offline.esm.min.js --allow-overwrite","build:runtime":"vite build -c build/vite.config.runtime.js && esbuild dist/bimdata-viewer.runtime.esm.min.js --minify --outfile=dist/bimdata-viewer.runtime.esm.min.js --allow-overwrite","build:split":"vite build -c build/vite.config.split.js && esbuild dist/bimdata-viewer.split.esm.min.js --minify --outfile=dist/bimdata-viewer.split.esm.min.js --allow-overwrite","build:umd":"vite build -c build/vite.config.umd.js && esbuild dist/bimdata-viewer.umd.cjs --minify --outfile=dist/bimdata-viewer.umd.min.cjs","cy:run":"cypress run","cy:open":"cypress open",prebuild:"rm -rf dist",prepublishOnly:"npm run build","semantic-release":"semantic-release",serve:"http-server -c-1 --silent",test:"npm run test:unit & npm run build & npm run test:e2e","test:unit":"jest","test:e2e":"start-server-and-test 'npm run serve -- -p 8080' http://localhost:8080 cy:run","test:e2e-dev":"start-server-and-test 'npm run serve -- -p 8080' http://localhost:8080 cy:open",version:"echo $npm_package_version",ts:"tsc"},files:["dist/*","types/*","CHANGELOG.md","README.md","package.json","package-lock.json","index.d.ts"],devDependencies:{"@babel/preset-env":"^7.29.0","@bimdata/2d-engine":"2.6.7","@bimdata/areas-next":"0.1.17","@bimdata/bcf-components":"6.7.7","@bimdata/components":"1.10.1","@bimdata/design-system":"2.3.0","@bimdata/engine-2d":"0.0.23","@bimdata/html-to-image":"1.11.16","@bimdata/typescript-fetch-api-client":"10.33.0","@eslint/eslintrc":"^3.3.4","@eslint/js":"^10.0.1","@photo-sphere-viewer/core":"^5.14.1","@rollup/plugin-alias":"^6.0.0","@rollup/plugin-babel":"^7.0.0","@rollup/plugin-commonjs":"^29.0.0","@rollup/plugin-image":"^3.0.3","@rollup/plugin-replace":"^6.0.3","@semantic-release/changelog":"^6.0.3","@semantic-release/commit-analyzer":"^13.0.1","@semantic-release/git":"^10.0.1","@semantic-release/github":"^12.0.6","@semantic-release/npm":"^13.1.5","@semantic-release/release-notes-generator":"^14.1.0","@vitejs/plugin-vue":"^6.0.4","@xeokit/xeokit-sdk":"git+https://git@github.com/Amoki/xeokit-sdk.git#b3227526bbbe8ac49c8c0c1d121363ca79781824","@zip.js/zip.js":"^2.8.21",async:"^3.2.6",autoprefixer:"^10.4.27","babel-core":"^7.0.0-bridge.0","babel-jest":"^30.2.0","conventional-changelog-eslint":"^6.0.0",cypress:"^15.11.0",esbuild:"^0.27.3",eslint:"^10.0.2","eslint-config-prettier":"^10.1.8","eslint-plugin-cypress":"^6.1.0","eslint-plugin-jest":"^29.15.0","eslint-plugin-prettier":"^5.5.5","eslint-plugin-vue":"^10.8.0",globals:"^17.4.0",html2canvas:"^1.4.1","http-server":"^14.1.1",jest:"^30.2.0","jest-environment-jsdom":"^30.2.0",lodash:"^4.17.23","pdfjs-dist":"^5.5.207",postcss:"^8.5.6",prettier:"^3.8.1","sass-embedded":"^1.97.3","semantic-release":"^25.0.3","start-server-and-test":"^2.1.5",vite:"^8.0.0","vite-plugin-css-injected-by-js":"^4.0.1",vue:"^3.5.29","vue-eslint-parser":"^10.4.0","vue-i18n":"^11.2.8"}},ZJt=1,WJt=class{math=BKe;constructor({plugins:e,api:t,ui:i,locale:o="fr"}){this.instanceId=ZJt++,this.pluginManager=new Pzt(e),this.windowManager=new Szt,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new QGt(t),this.globalContext=new dfe(this),this.state=iKt(this),this.shortcutManager=pde(this.state),this.uiSettings=i||{},this.i18n=new lfe(o),this._contextMenu=null,this.layout=new KJt(this.uiSettings.resizable!==!1),this._darkTheme=pe(i?.darkTheme??!1),this.localContext=null,window.$viewer=this}get darkTheme(){return this._darkTheme.value}set darkTheme(e){this._darkTheme.value=e}get version(){return JJt.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||Ade}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 YJt(e,t={}){t.backgroundColor&&(e.style.setProperty("--bimdata-viewer-background-color",t.backgroundColor),t.backgroundColor==="transparent"&&e.style.setProperty("--areas-separator-color","transparent")),t.colorPrimary&&e.style.setProperty("--color-primary",t.colorPrimary),t.colorPrimaryLighter&&e.style.setProperty("--color-primary-lighter",t.colorPrimaryLighter),t.colorPrimaryLight&&e.style.setProperty("--color-primary-light",t.colorPrimaryLight),t.colorPrimaryDark&&e.style.setProperty("--color-primary-dark",t.colorPrimaryDark),t.colorSecondary&&e.style.setProperty("--color-secondary",t.colorSecondary),t.colorSecondaryLighter&&e.style.setProperty("--color-secondary-lighter",t.colorSecondaryLighter),t.colorSecondaryLight&&e.style.setProperty("--color-secondary-light",t.colorSecondaryLight),t.colorSecondaryDark&&e.style.setProperty("--color-secondary-dark",t.colorSecondaryDark),t.colorSilverLight&&e.style.setProperty("--color-silver-light",t.colorSilverLight),t.colorSilver&&e.style.setProperty("--color-silver",t.colorSilver),t.colorSilverDark&&e.style.setProperty("--color-silver-dark",t.colorSilverDark),t.colorGraniteLight&&e.style.setProperty("--color-granite-light",t.colorGraniteLight),t.colorGranite&&e.style.setProperty("--color-granite",t.colorGranite),t.colorSuccess&&e.style.setProperty("--color-success",t.colorSuccess),t.colorSuccessLighter&&e.style.setProperty("--color-success-Lighter",t.colorSuccessLighter),t.colorSuccessLight&&e.style.setProperty("--color-success-Light",t.colorSuccessLight),t.colorSuccessDark&&e.style.setProperty("--color-success-Dark",t.colorSuccessDark),t.colorWarning&&e.style.setProperty("--color-warning",t.colorWarning),t.colorWarningLighter&&e.style.setProperty("--color-warning-Lighter",t.colorWarningLighter),t.colorWarningLight&&e.style.setProperty("--color-warning-Light",t.colorWarningLight),t.colorWarningDark&&e.style.setProperty("--color-warning-Dark",t.colorWarningDark),t.colorHigh&&e.style.setProperty("--color-high",t.colorHigh),t.colorHighLighter&&e.style.setProperty("--color-high-lighter",t.colorHighLighter),t.colorHighLight&&e.style.setProperty("--color-high-light",t.colorHighLight),t.colorHighDark&&e.style.setProperty("--color-high-dark",t.colorHighDark),t.colorText&&e.style.setProperty("--color-text",t.colorText),(!t.backgroundColor||t.backgroundColor!=="transparent")&&e.style.setProperty("--areas-separator-color","rgba(216, 216, 216, 1)"),t.headerHeight!=null&&e.style.setProperty("--bimdata-viewer-header-height",t.headerHeight),e.style.setProperty("--areas-background-color","transparent")}var XJt=Object.freeze({25:"GUEST",50:"USER",100:"ADMIN"}),X0=Object.freeze({READ:"read",WRITE:"write"});function rne(e){let t={};return e.forEach(i=>{let[o,r]=i.split(":");t[o]?t[o].push(r):t[o]=[r]}),t}var $Jt={token_scopes:[],usable_scopes:[],user_role:25};function one(e=$Jt){let t=rne(e.token_scopes),i=rne(e.usable_scopes);return{...hj(e),tokenScopes:t,usableScopes:i,userRole:XJt[e.user_role],user:e.user?hj(e.user):null,hasBcfReadPermission:i.bcf?.includes(X0.READ)??!1,hasBcfWritePermission:i.bcf?.includes(X0.WRITE)??!1,hasModelReadPermission:i.model?.includes(X0.READ)??!1,hasModelWritePermission:i.model?.includes(X0.WRITE)??!1,hasDocReadPermission:i.document?.includes(X0.READ)??!1,hasDocWritePermission:i.document?.includes(X0.WRITE)??!1}}var eZt={de:{BcfComponents:{back:"Zur\xFCck",BcfFilters:{filtersButton:"Filter",filtersTitle:"Filter",priorityLabel:"Priorit\xE4t",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",creatorsLabel:"Erstellt von",tagsLabel:"Tags",resetButton:"Zur\xFCcksetzen",searchButton:"Suchen",undefined:"Nicht definiert",datePlaceholder:"Erstellungsdatum"},BcfSettings:{title:"BCF-Parameter",text:"Erstellen, f\xFCllen und listen Sie die BCF-Einstellungen auf, die Sie f\xFCr dieses Projekt haben m\xF6chten.",validateButton:"Die BCF-Parameter anerkennen"},BcfStatistics:{emptyText:"F\xFCgen Sie Fragen hinzu, um zugeh\xF6rige Statistiken hier anzuzeigen.",issues:"Probleme",extension:{Priority:"Priorit\xE4t",PriorityNotDefined:"Keine Priorit\xE4t",PriorityTitle:"Priorit\xE4ten",Status:"Status",StatusNotDefined:"Kein Status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priorit\xE4t",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\xE4hlen Sie eine Datei aus.",addObjectButton:"Objekt",addAnnotationButton:"Annotation",annotationButtonTooltip:"Zu diesem Thema gibt es derzeit keine Ansichten.",addPictureButton:"F\xFCgen Sie ein Bild hinzu.",titlePlaceholder:"Titel *",titleErrorMessage:"Titel fehlt",typeLabel:"Typ",priorityLabel:"Priorit\xE4t",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",dueDateLabel:"F\xE4lligkeitsdatum (TT.MM.JJJJ)",descriptionLabel:"Beschreibung",labelsLabel:"Tags",createButton:"Best\xE4tigen",updateButton:"\xC4nderungen \xFCbernehmen",modalText:"Sie sind dabei, die Bearbeitung der Ausgabe {Name} zu beenden, aber es gibt noch ungespeicherte \xC4nderungen.",cancelButton:"\xC4nderungen verwerfen",continueButton:"\xC4nderungen fortsetzen",createTitle:"Ein Problem melden",dragDropImageTextTablet:"Foto machen",takeSnapshot:"Mach einen Schnappschuss",importFile:"Eine Datei importieren",searchPlaceholder:"Suchen",emptySearch:"kein Ergebnis",documentsLabel:"Dokumente",documentsCount:"Dokumente \u2013 {count} ausgew\xE4hlte Dokumente",groupsLabel:"Berechtigungen",groupsCount:"Berechtigungen \u2013 {count} ausgew\xE4hlte Gruppen",groupsText:"W\xE4hlen Sie die Benutzergruppen aus, die dieses Thema sehen und damit interagieren d\xFCrfen.",validate:"Best\xE4tigen"},BcfTopicOverview:{openViewer:"Im Viewer \xF6ffnen",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\xE4lligkeitsdatum",noDueDate:"Kein F\xE4lligkeitsdatum",informations:"Informationen",status:"Status",noStatusSpecified:"Kein Status angegeben",stage:"Phase",noStageProvided:"Keine Phase angegeben",priority:"Priorit\xE4t",priorityNotDefined:"Nicht definiert",tags:"Tags",noTags:"Keine Tags",commentButton:"Ein Kommentar ver\xF6ffentlichen",deleteText:"Sie l\xF6schen jetzt {Name}",deleteBcfButton:"Dieses BCF l\xF6schen",keepBcfButton:"Dieses BCF beibehalten",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE4t",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\xF6ffentlichen",commentsText:"Kommentare",deleteCommentText:"Diesen Kommentar l\xF6schen?",deleteButton:"L\xF6schen",takeSnapshot:"Mach einen Schnappschuss",edited:"bearbeitet"},BcfTopicPriorityCell:{noPriority:"Keine"},SettingCard:{addButton:"ein Element hinzuf\xFCgen",cancelButton:"Abbrechen",validateButton:"Best\xE4tigen",deleteExtensionText:"Diesen Parameter l\xF6schen",deleteButton:"L\xF6schen",title:{Priority:"Priorit\xE4ten",Label:"Tags",Status:"Status",Type:"Typen",Stage:"Phasen"},input:{Priority:"Eine neue Priorit\xE4t hinzuf\xFCgen",Label:"Ein neues Etikett hinzuf\xFCgen",Status:"Einen neuen Status hinzuf\xFCgen",Type:"Einen neuen Typ hinzuf\xFCgen",Stage:"Eine neue Phase hinzuf\xFCgen"},text:{Priority:"Liste der Priorit\xE4ten",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",groupsLabel:"Permissions",groupsCount:"Permissions - {count} selected groups",groupsText:"You are now setting the access rights: choose the user group(s) that will be exclusively authorized to see and interact with this topic.",validate:"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\xF3n"},BcfSettings:{title:"Par\xE1metros del BCF",text:"Cree, rellene y enumere los par\xE1metros del BCF que desea tener en este proyecto",validateButton:"Validar los par\xE1metros del BCF"},BcfStatistics:{emptyText:"A\xF1ada preguntas para ver las estad\xEDsticas asociadas aqu\xED.",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\xF3n",annotationButtonTooltip:"Actualmente este tema no posee ning\xFAn punto de vista",addPictureButton:"A\xF1adir una imagen",titlePlaceholder:"T\xEDtulo *",titleErrorMessage:"Falta el t\xEDtulo",typeLabel:"Tipo",priorityLabel:"Prioridad",statusLabel:"Estado",stageLabel:"Fase",assignedToLabel:"Asignado a",dueDateLabel:"Fecha de vencimiento (DD/MM/AAAA)",descriptionLabel:"Descripci\xF3n",labelsLabel:"Etiquetas",createButton:"Validar",updateButton:"Modificar este BCF",modalText:"Est\xE1 a punto de salir de la edici\xF3n 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\xEDa",takeSnapshot:"Tomar un snapshot",importFile:"Importar un archivo",searchPlaceholder:"Buscar",emptySearch:"No hay resultados"},BcfTopicOverview:{openViewer:"Abrir en el visor",openViewerNoModels:"No hay ning\xFAn modelo listo para la visualizaci\xF3n",elements:"{count} Elementos",noElements:"Ning\xFAn elemento",type:"Tipo",noTypeSpecified:"No se especifica el tipo",description:"Descripci\xF3n",noDescriptionProvided:"No hay descripci\xF3n",assignedTo:"Asignado a",notAssigned:"No asignado",dueDate:"Plazo",noDueDate:"Sin fecha de vencimiento",informations:"Informaci\xF3n",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\xE1s a punto de borrar {name}",deleteBcfButton:"Borrar este BCF",keepBcfButton:"Mantenga este BCF",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Prioridad",status:"Estado",title:"T\xEDtulo",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:"\xBFBorrar este comentario?",deleteButton:"Borrar",takeSnapshot:"Tomar un snapshot"},BcfTopicPriorityCell:{noPriority:"Sin"},SettingCard:{addButton:"a\xF1adir un elemento",cancelButton:"Cancelar",validateButton:"Validar",deleteExtensionText:"Borrar esta configuraci\xF3n",deleteButton:"Borrar",title:{Priority:"Prioridades",Label:"Etiquetas:",Status:"Estatutos",Type:"Tipos",Stage:"Fases"},input:{Priority:"A\xF1adir una nueva prioridad",Label:"A\xF1adir una nueva etiqueta",Status:"A\xF1adir un nuevo estado",Type:"A\xF1adir un nuevo tipo",Stage:"A\xF1adir 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\xE9",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assign\xE9 \xE0",creatorsLabel:"Cr\xE9\xE9 par",tagsLabel:"Tags",resetButton:"R\xE9initialiser",searchButton:"Rechercher",undefined:"Non d\xE9fini",datePlaceholder:"Date de cr\xE9ation"},BcfSettings:{title:"Param\xE8tres BCF",text:"Cr\xE9ez, renseignez et listez les param\xE8tres BCF que vous souhaitez avoir sur ce projet",validateButton:"Valider les param\xE8tres BCF"},BcfStatistics:{emptyText:"Ajoutez des questions pour voir les statistiques associ\xE9es ici.",issues:"probl\xE8mes",extension:{Priority:"Priorit\xE9",PriorityNotDefined:"Aucune priorit\xE9",PriorityTitle:"Priorit\xE9s",Status:"Statut",StatusNotDefined:"Aucun statut",StatusTitle:"Statuts"}},BcfTopicCard:{priority:"Priorit\xE9",noPriority:"Aucune",assignedTo:"Assign\xE9 \xE0",elements:"{n} \xC9lements",notSpecified:"Non d\xE9fini",see:"Voir"},BcfTopicCreationCard:{text:"Cr\xE9er un nouveau topic BCF",createBcfSideTitle:"Signaler un probl\xE8me"},BcfTopicForm:{dragDropImageText:"Veuillez s\xE9lectionner un fichier",addObjectButton:"Objet",addAnnotationButton:"Annotation",annotationButtonTooltip:"Ce topic ne poss\xE8de actuellement aucun point de vue",addPictureButton:"Ajouter une image",titlePlaceholder:"Titre *",titleErrorMessage:"Titre manquant",typeLabel:"Type",priorityLabel:"Priorit\xE9",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assign\xE9 \xE0",dueDateLabel:"Date d'\xE9ch\xE9ance",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Valider",updateButton:"Modifier ce BCF",modalText:"Vous \xEAtes sur le point de quitter l'\xE9dition de l'issue {name} mais il y'a des modifications non enregistr\xE9es.",cancelButton:"Annuler les modifications",continueButton:"Continuer les modifications",createTitle:"Signaler un probl\xE8me",dragDropImageTextTablet:"Prendre une photo",takeSnapshot:"Prendre un snapshot",importFile:"Importer un fichier",searchPlaceholder:"Rechercher",emptySearch:"Pas de r\xE9sultat",documentsLabel:"Documents",documentsCount:"Documents - {count} documents s\xE9lectionn\xE9s",groupsLabel:"Permissions",groupsCount:"Permissions - {count} groupes s\xE9lectionn\xE9s",groupsText:"S\xE9lectionner les groupes utilisateur qui peuvent voir ce topic et int\xE9ragir avec.",validate:"Valider"},BcfTopicOverview:{openViewer:"Ouvrir dans le viewer",openViewerNoModels:"Il n'y a aucun mod\xE8le pr\xEAt pour une visualisation",elements:"{count} \xC9lements",noElements:"Aucun \xE9l\xE9ment concern\xE9",type:"Type",noTypeSpecified:"Pas de type sp\xE9cifi\xE9",description:"Description",noDescriptionProvided:"Pas de description renseign\xE9e",assignedTo:"Assign\xE9 \xE0",notAssigned:"Non assign\xE9",dueDate:"\xC9ch\xE9ance",noDueDate:"Pas de date d'\xE9ch\xE9ance",informations:"Informations",status:"Statut",noStatusSpecified:"Pas de statut sp\xE9cifi\xE9",stage:"Phase",noStageProvided:"Pas de phase renseign\xE9e",priority:"Priorit\xE9",priorityNotDefined:"Non d\xE9fini",tags:"Tags",noTags:"Pas de tags",commentButton:"Poster un commentaire",deleteText:"Vous \xEAtes sur le point de supprimer {name}",deleteBcfButton:"Supprimer ce BCF",keepBcfButton:"Conserver ce BCF",author:"Auteur"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE9",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\xE9"},BcfTopicPriorityCell:{noPriority:"Aucune"},SettingCard:{addButton:"ajouter un \xE9l\xE9ment",cancelButton:"Annuler",validateButton:"Valider",deleteExtensionText:"Supprimmer ce param\xE8tre",deleteButton:"Supprimer",title:{Priority:"Priorit\xE9s",Label:"Tags",Status:"Statuts",Type:"Types",Stage:"Phases"},input:{Priority:"Ajouter une nouvelle priorit\xE9",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\xE9s",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\xE0",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\xE0",PriorityNotDefined:"Nessuna priorit\xE0",PriorityTitle:"Priorit\xE0",Status:"Stato",StatusNotDefined:"Nessuno stato",StatusTitle:"Stati"}},BcfTopicCard:{priority:"Priorit\xE0",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\xE0",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\xE0",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\xE0",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\xE0",Label:"Etichette",Status:"Stati",Type:"Tipi",Stage:"Fasi"},input:{Priority:"Aggiungi una nuova priorit\xE0",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\xE0",Label:"Elenco delle etichette",Status:"Elenco degli stati",Type:"Elenco dei tipi",Stage:"Elenco delle fasi"}}}}},tZt=({apiClient:e,fetchUsers:t,i18nPlugin:i}={})=>({install(o){e?fr.setup({apiClient:e,fetchUsers:t}):console.error("[BCF Components Plugin] No api client provided. You must provide an api client for the components to work properly."),i?Object.entries(eZt).forEach(([r,n])=>{i.global.mergeLocaleMessage(r,n)}):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(o3e).forEach(([r,n])=>{o.component(r,n)})}}),iZt={de:{BuildingMaker:{title:"Building Maker",back:"Zur\xFCck",list:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",createButton:"Neues Projekt",updateButton:"Umbenennen",deleteButton:"L\xF6schen"},form:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",input:"Name des Geb\xE4udes",error:"Ung\xFCltiger Name",createButton:"Erstellen",updateButton:"Best\xE4tigen"},view:{addStoreyButton:"Etage",addPlanButton:"Grundriss",closeButton:"Fertigstellen",submitFilesButton:"Best\xE4tigen"},storeyForm:{title:"Neue Etage",input:"Name",error:"Ung\xFCltiger Name",cancelButton:"Abbrechen",submitButton:"Best\xE4tigen"}},FileManager:{creationFormTitle:"Ordner erstellen",renameFormPlaceholder:"Datei- / Ordnernam",nameInputPlaceholder:"Ordnername",emptyFolder:"Dieser Ordner ist leer",newFolderSuccess:"Neuer Ordner erstellt",renameFolderSuccess:"Umbenannter Ordner",deleteFolderSuccess:"Ordner gel\xF6scht",newFileSuccess:"Datei hinzugef\xFCgt",renameFileSuccess:"Umbenannte Datei",deleteFileSuccess:"Datei gel\xF6scht",nameInputErrorMessage:"Ung\xFCltiger name",cancel:"Abbrechen",submit:"Best\xE4tigen",buttonText:"Neuer Ordner",addFileButtonText:"Datei laden",rename:"Umbenennen",view:"Sehen",download:"Herunterladen",delete:"L\xF6schen",deleteTitle:"Dateien l\xF6schen",deleteDetail:"Sie sind im Begriff, die folgenden Dateien / Ordner endg\xFCltig zu l\xF6schen"}},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\xE9s cargue los PDF.",createButton:"Nuevo proyecto",updateButton:"Renombrar",deleteButton:"Suprimir"},form:{text:"Cree y edite los pisos despu\xE9s cargue los PDF.",input:"Nombre del edificio",error:"Nombre no v\xE1lido",createButton:"Crear",updateButton:"Validar"},view:{addStoreyButton:"Piso",addPlanButton:"Plano",closeButton:"Terminar",submitFilesButton:"Validar"},storeyForm:{title:"Nuevo piso",input:"Nombre",error:"Nombre no v\xE1lido",cancelButton:"Anular",submitButton:"Validar"}},FileManager:{creationFormTitle:"Crear un archivo",renameFormPlaceholder:"Nombre de archivo / carpeta",nameInputPlaceholder:"Nombre de la carpeta",emptyFolder:"Esta carpeta est\xE1 vac\xEDa",newFolderSuccess:"Nueva carpeta creada",renameFolderSuccess:"Carpeta renombrada",deleteFolderSuccess:"Carpeta eliminada",newFileSuccess:"Archivo agregado",renameFileSuccess:"Archivo renombrado",deleteFileSuccess:"Archivo eliminado",nameInputErrorMessage:"Nombre inv\xE1lida",cancel:"Cancelar",submit:"Validar",buttonText:"Carpeta nueva",addFileButtonText:"Cargar un archivo",rename:"Renombrar",view:"Ver",download:"Descargar",delete:"Borrar",deleteTitle:"Eliminar archivos",deleteDetail:"Est\xE1 a punto de eliminar permanentemente los siguientes archivos / carpetas"}},fr:{BIMDataComponents:{t:{back:"Retour",cancel:"Annuler",create:"Cr\xE9er",delete:"Supprimer",download:"T\xE9l\xE9charger",finish:"Terminer",rename:"Renommer",search:"Rechercher",see:"Voir",storey:"\xC9tage",validate:"Valider"}},BuildingMaker:{title:"Building Maker",list:{text:"Cr\xE9ez et \xE9ditez les \xE9tages puis t\xE9l\xE9chagez vos PDF.",new:"Nouveau projet"},form:{input:"Nom du b\xE2timent",error:"Nom invalide"},view:{addStorey:"Ajouter un \xC9tage",addFile:"Ajouter un fichier",addPlan:"Ajouter un plan"},storeyForm:{title:"Nouvel \xE9tage",input:"Nom",error:"Nom invalide"}},FileManager:{creationFormTitle:"Cr\xE9er un dossier",renameFormPlaceholder:"Nom du fichier/dosier",nameInputPlaceholder:"Nom du dossier",emptyFolder:"Ce dossier est vide",newFolderSuccess:"Nouveau dossier cr\xE9\xE9",renameFolderSuccess:"Dossier renomm\xE9",deleteFolderSuccess:"Dossier supprim\xE9",newFileSuccess:"Fichier ajout\xE9",renameFileSuccess:"Fichier renomm\xE9",deleteFileSuccess:"Fichier supprim\xE9",nameInputErrorMessage:"Nom invalide",buttonText:"Nouveau dossier",addFileButtonText:"Charger un fichier",deleteTitle:"Supression de fichiers",deleteDetail:"Vous \xEAtes sur le point de supprimer d\xE9finitivement les fichiers/dossiers suivants",dmsRoot:"Racine de la GED du projet",pdfPageSelectorTitle:"S\xE9lectionner une page"},MetaBuildingStructure:{title:"Structure M\xE9ta-Building",tab:{structure:"Structure",zones:"Zones",equipments:"\xC9quipements"},StoreySelector:{placeholder:"S\xE9lectionner un \xE9tage"}},PhotosphereBuilding:{title:"Photosph\xE8re 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 \xE8 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"}}},rZt=({i18nPlugin:e}={})=>({install(t){e?Object.entries(iZt).forEach(([i,o])=>{e.global.mergeLocaleMessage(i,o)}):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(RIt).forEach(([i,o])=>{t.component(i,o)})}}),oZt={beforeMount(e,t){if(typeof t.value!="function")throw Error(`click away directive needs function, got ${typeof t.value}`);e.clickAwayHandler=i=>{(i.path||i.composedPath&&i.composedPath()).find(o=>o===e)||t.value()},window.addEventListener("mousedown",e.clickAwayHandler,!0)},unmounted(e){window.removeEventListener("mousedown",e.clickAwayHandler,!0),delete e.clickAwayHandler}},nZt=co({BIMDataClickAway:()=>zl,BIMDataClickInputAway:()=>oZt}),aZt=e=>({install(t){Object.entries(lNe).forEach(([i,o])=>{e&&e.excludedComponents&&e.excludedComponents.length>0&&e.excludedComponents.includes(i)||(!e||!e.includedComponents||e.includedComponents.includes(i))&&t.component(i,o)}),(!e||e.directives!==!1)&&Object.entries(nZt).forEach(([i,o])=>t.directive(i.split("BIMData")[1],o))}}),sZt={name:"LiWrapper",render(){return Gr("li",this.$slots.default())}};function lZt(e,t){var i=new Set([]);return e.forEach(o=>{t.has(o)||i.add(o)}),i}var Bc=Qn("id"),cZt=({contextMenu:e,objects:t=[],state:i=e.$viewer.state,pictos:o})=>[{name:"selectAll",get group(){return e.groupPositions.select},position:1,get label(){return e.$t("context_menu.select_all")},get picto(){return o.get(this.name)},execute:()=>i.selectObjects(t.filter(Sl(ar("visible"),yA("selected"))).map(Bc)),predicate:()=>t.some(Sl(ar("visible"),yA("selected")))},{name:"deselectAll",get group(){return e.groupPositions.select},position:2,get label(){return e.$t("context_menu.deselect_all")},get picto(){return o.get(this.name)},execute:()=>i.deselectObjects(t.filter(ar("selected")).map(Bc)),predicate:()=>t.some(ar("selected"))},{name:"selectSimilar",get group(){return e.groupPositions.select},position:3,get label(){return e.$t("context_menu.select_similar")},get picto(){return o.get(this.name)},execute(){let r=t.filter(n=>n.visible&&n.type===this.selectedObject.type&&n.id!==this.selectedObject.id).map(Bc);i.selectObjects(r)},selectedObject:null,predicate(){let r=t.filter(Sl(ar("visible"),ar("selected")));return r.length===1&&r[0].type!==void 0?(this.selectedObject=r[0],!0):(this.selectedObject=null,!1)}},{name:"reverseSelection",get label(){return e.$t("context_menu.reverse_selection")},get group(){return e.groupPositions.select},position:4,execute:()=>{let r=new Set(t.filter(ar("selected")).map(Bc)),n=new Set(t.filter(ar("visible")).map(Bc));i.selectObjects(Array.from(lZt(n,r)),{exclusive:!0})},predicate:()=>t.some(Sl(yA("selected"),ar("visible")))&&t.some(Sl(ar("selected"),ar("visible")))},{name:"showAll",get group(){return e.groupPositions.visibility},position:1,get label(){return e.$t("context_menu.show_all")},get picto(){return o.get(this.name)},execute:()=>i.showObjects(t.filter(yA("visible")).map(Bc)),predicate:()=>t.some(yA("visible"))},{name:"hide",get group(){return e.groupPositions.visibility},position:2,get label(){return e.$t("context_menu.hide")},get picto(){return o.get(this.name)},objectsToHide:null,execute(){let r=this.objectsToHide.filter(ar("selected"));r.length>0&&i.deselectObjects(r.map(Bc)),i.hideObjects(this.objectsToHide.map(Bc))},predicate(){return this.objectsToHide=t.filter(Sl(ar("selected"),ar("visible"))),this.objectsToHide.length>0}},{name:"hideAll",get group(){return e.groupPositions.visibility},position:3,get label(){return e.$t("context_menu.hide_all")},execute:()=>{let r=t.filter(ar("visible"));r.some(ar("selected"))&&i.deselectObjects(r.filter(ar("selected")).map(Bc)),i.hideObjects(r.map(Bc))},predicate:()=>t.some(ar("visible"))}].filter(r=>r.predicate()),dZt={components:{LiWrapper:sZt},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(e){e?document.addEventListener("keydown",this.onKeyDown):document.removeEventListener("keydown",this.onKeyDown)}},created(){this.$viewer.contextMenu=this,this.asyncPredicates=new Set},methods:{onKeyDown(e){e.key==="Escape"&&this.away()},setPosition(e){let t=(document.fullscreenElement?document.fullscreenElement:this.$parent.$el).getBoundingClientRect();this.left=e.clientX-t.left,this.top=e.clientY-t.top,this.left+this.width>t.width&&(this.left-=this.width),e.clientY>t.top+t.height/2?(this.bottom=t.height-this.top,this.top=null):this.bottom=null},typeCheckCommand(e={}){let t=null;if((!e.execute||typeof e.execute!="function")&!e.component&&(t="Cannot register context menu command. A command must have an execute function or a component property."),e.label||(t="Cannot register context menu command. A command must have a label."),t)throw console.error(t),Error(t);return e.id=this.nextCommandId++,e},open(e){this.currentCommands=[],this.setPosition(e),this.originEvent=e,e.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 e=>{if(typeof e.predicate=="function"){let t=e.predicate(this.$viewer.globalContext.activeLocalContext);if(t===!0)this.currentCommands.push(e);else if(typeof t?.then=="function"){this.asyncPredicates.add(t),this.asyncPredicateRunning=!0;let i=await t;this.asyncPredicates.has(t)&&(this.asyncPredicates.delete(t),this.asyncPredicateRunning=this.asyncPredicates.size>0,i===!0&&this.currentCommands.push(e))}}else this.currentCommands.push(e)}),this.currentCommands.push(...this.contextCommands),this.contextCommands=[]},getDefaultCommands({objects:e=[],state:t=this.$viewer.state,context:i=null}){let o=new Map;return i&&this.$viewer.shortcutManager.getShortcuts(i).forEach(r=>o.set(r.name,r.key)),cZt({contextMenu:this,objects:e,state:t,pictos:o})},executeCommand(e){if(e.execute&&(e.execute(this.originEvent),this.displayed=!1),e.component&&!e.menu)throw Error("Command with component property must have a `menu` property")},away(){this.displayed=!1},groupCurrentCommands(){let e=new Map;this.currentCommands.forEach(t=>{(t.group===null||t.group===void 0)&&(t.group=0),e.has(t.group)?e.get(t.group).push(t):e.set(t.group,[t])}),e.forEach(t=>t.sort((i,o)=>(i.position=i.position||0,o.position=o.position||0,i.position-o.position))),this.currentCommands=[...e.keys()].sort((t,i)=>t-i).map(t=>e.get(t)).flat()},isGroupIntersection(e){if(e===0)return!1;let t=this.currentCommands[e-1],i=this.currentCommands[e];return t.group<i.group},registerContextCommand(e){let t=this.typeCheckCommand(e);return this.contextCommands.push(t),e.id},registerCommand(e){let t=this.typeCheckCommand(e);return this.registeredCommands.push(t),e.id},unregisterCommand(e){return this.registeredCommands.find(t=>t.id===e)?(this.registeredCommands=this.registeredCommands.filter(t=>t.id!==e),!0):!1},preventDefault(){this.defaultPrevented=!0}}},uZt={key:0,class:"separator"},AZt={class:"menu-text"},hZt={key:1,class:"menu-picto"},pZt={key:0,class:"context-menu__spinner"};function fZt(e,t,i,o,r,n){let a=I("BIMDataIconChevron"),s=I("LiWrapper"),l=I("BIMDataSpinner"),c=Li("click-away");return r.displayed&&(r.currentCommands.length||r.asyncPredicateRunning)?Tt((k(),N("ul",{key:0,class:"bimdata-list context-menu",style:ve(n.position)},[(k(!0),N(ut,null,Vt(r.currentCommands,(d,u)=>(k(),W(s,{key:d.label,class:"context-menu__element",onClick:A=>n.executeCommand(d)},{default:j(()=>[n.isGroupIntersection(u)?(k(),N("div",uZt)):le("",!0),w("div",AZt,G(d.label),1),!d.component&&d.picto?(k(),N("span",hZt,G(d.picto),1)):d.component?(k(),W(a,{key:2,size:"xxs",class:"fill-primary"})):le("",!0)]),_:2},1032,["onClick"]))),128)),r.asyncPredicateRunning?(k(),N("li",pZt,[T(l)])):le("",!0)],4)),[[c,n.away]]):le("",!0)}var gZt=Q(dZt,[["render",fZt],["__scopeId","data-v-5b87d4a3"]]),mZt={name:"ViewerHeader",inject:["$viewer"],props:{visible:{type:Boolean,default:!0}},setup(){let e=bt("$viewer"),t=qo(new Map);return{logo:e.uiSettings.bimdataLogo!==!1,version:e.uiSettings.version===!1?null:e.version,headerContent:t,headerRightContentComponents:je(()=>Array.from(t.values()).filter(i=>i.position==="right").sort((i,o)=>i.order-o.order).map(i=>i.component)),headerLeftContentComponents:je(()=>Array.from(t.values()).filter(i=>i.position==="left").sort((i,o)=>i.order-o.order).map(i=>i.component)),addContent:i=>{if(!i.name)throw TypeError("[Viewer Header] Content must have a name");if(t.has(i.name))throw Error(`[Viewer Header] Content with name ${i.name} already exists`);t.set(i.name,i)},removeContent:i=>t.has(i)?(t.delete(i),!0):!1}}},vZt={class:"viewer-header"},yZt={class:"viewer-header__content"},wZt={class:"viewer-header__content__left"},bZt={class:"viewer-header__content__right"},CZt={key:0,class:"m-l-6 flex items-center"},xZt={key:1,class:"viewer-header__version"};function BZt(e,t,i,o,r,n){let a=I("BIMDataIllustration");return Tt((k(),N("div",vZt,[w("div",yZt,[w("div",wZt,[(k(!0),N(ut,null,Vt(o.headerLeftContentComponents,s=>(k(),W(qr(s),{key:s.name}))),128))]),w("div",bZt,[(k(!0),N(ut,null,Vt(o.headerRightContentComponents,s=>(k(),W(qr(s),{key:s.name}))),128))])]),o.logo||o.version?(k(),N("div",CZt,[o.logo?(k(),W(a,{key:0,name:"logo",width:"30px",height:"30px"})):le("",!0),o.version?(k(),N("div",xZt,G(o.version),1)):le("",!0)])):le("",!0)],512)),[[ui,i.visible]])}var kZt=Q(mZt,[["render",BZt],["__scopeId","data-v-5c9ea6b6"]]),EZt={emits:["resize"],setup(e,{emit:t}){return{onResizerMousedown:i=>{i.preventDefault();let o=i.clientX,r=a=>{a.preventDefault();let s=a.clientX-o;o=a.clientX,t("resize",s)},n=a=>{a.preventDefault(),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",r),window.addEventListener("mouseup",n)}}}},MZt={class:"bimdata-separator"};function PZt(e,t,i,o,r,n){return k(),N("div",MZt,[t[1]||=w("div",{class:"bimdata-separator__line"},null,-1),w("div",{class:"bimdata-separator__resizer",onMousedown:t[0]||=(...a)=>o.onResizerMousedown&&o.onResizerMousedown(...a)},null,32)])}var IZt={components:{Separator:Q(EZt,[["render",PZt],["__scopeId","data-v-79a3b3af"]])},props:{position:{type:String,required:!0,validator(e){return["left","right"].includes(e)}},sidePanel:{type:Object,required:!0,validator(e){if(e.width&&(typeof e.width!="number"||e.width<0))return console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof e.width}`),!1;let t=typeof e?.component=="object";return t||console.error("[GlobalSidePanel] sidePanel must have a component property"),t}}},setup(e){let t=pe(null),i=pe(e.sidePanel.width??400);return xt(()=>e.sidePanel,()=>{Object.defineProperty(e.sidePanel,"width",{get(){return i.value},set(o){if(typeof o!="number"||o<=0){console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof o}`);return}i.value=o}}),Object.defineProperty(e.sidePanel,"componentInstance",{get(){return t.value},enumerable:!0})},{immediate:!0}),{componentInstance:t,width:i,onResize:(o,r=1)=>{let n=i.value+o*r;i.value=Math.max(0,n)}}}},SZt={class:"bimdata-global-side-panel__component"};function DZt(e,t,i,o,r,n){let a=I("Separator");return k(),N("div",{class:"bimdata-global-side-panel",style:ve(`width: ${o.width}px`)},[i.sidePanel.resizable&&i.position==="right"?(k(),W(a,{key:0,onResize:t[0]||=s=>o.onResize(s,-1)})):le("",!0),w("div",SZt,[(k(),W(qr(i.sidePanel.component),{ref:"componentInstance"},null,512))]),i.sidePanel.resizable&&i.position==="left"?(k(),W(a,{key:1,onResize:t[1]||=s=>o.onResize(s)})):le("",!0)],4)}var TZt={name:"BimdataViewer",components:{ContextMenu:gZt,ViewerHeader:kZt,ModalManager:ene,GlobalSidePanel:Q(IZt,[["render",DZt],["__scopeId","data-v-82d0d4cb"]])},setup(){let e=bt("$viewer"),{globalContext:t,shortcutManager:i}=e;$i(()=>{i&&i.destroy(),t.hub.clear()}),Di(()=>{e.pluginManager.runPluginsScripts(e)});let o=je(()=>e.uiSettings.bimdataLogo!==!1&&(t.localContexts.length!==1||t.localContexts[0].window?.logoAndVersion)),r=je(()=>e.uiSettings.version!==!1&&(t.localContexts.length!==1||t.localContexts[0].window?.logoAndVersion)?e.version:null),n=je(()=>t.leftSidePanel),a=je(()=>t.rightSidePanel),s=je(()=>{let h=e.uiSettings.header!==!1,p=t.localContexts.length===1&&t.localContexts[0].window?.header===!1,f=!!(n.value||a.value);return h&&(!p||f)}),l=e.uiSettings.contextMenu!==!1,c=pe(null);function d(h){l&&c.value.open(h)}function u(){e.shortcutManager.active=!0}function A(){e.shortcutManager.active=!1}return{Layout:e.layout.areas.component,onContextMenu:d,onMouseenter:u,onMouseleave:A,isHeaderVisible:s,viewerTemplateRef:t.templateRef,modalManagerTemplateRef:t.modalManagerTemplateRef,headerTemplateRef:t.headerTemplateRef,contextMenuTemplateRef:c,contextMenuEnabled:l,bimdataLogoOnSingleWindow:o,viewerVersionOnSingleWindow:r,version:e.version,loading:je(()=>t.loading),spinner:je(()=>t.spinner),leftSidePanel:n,rightSidePanel:a}}},LZt={key:1,class:"bimdata-context-loading-overlay",style:{"z-index":"3"}},RZt={key:2,class:"viewer__logo"},_Zt={key:1,class:"version m-t-6"};function FZt(e,t,i,o,r,n){let a=I("ModalManager"),s=I("ContextMenu"),l=I("ViewerHeader"),c=I("GlobalSidePanel"),d=I("BIMDataSpinner"),u=I("BIMDataIllustration");return k(),N("div",{id:"bimdata-viewer",ref:"viewerTemplateRef",class:"bimdata-viewer bimdata-design-system bimdata-scrollbar",onContextmenu:t[0]||=(...A)=>o.onContextMenu&&o.onContextMenu(...A),onMouseenter:t[1]||=(...A)=>o.onMouseenter&&o.onMouseenter(...A),onMouseleave:t[2]||=(...A)=>o.onMouseleave&&o.onMouseleave(...A)},[T(a,{ref:"modalManagerTemplateRef"},null,512),o.contextMenuEnabled?(k(),W(s,{key:0,ref:"contextMenuTemplateRef"},null,512)):le("",!0),T(l,{ref:"headerTemplateRef",visible:o.isHeaderVisible},null,8,["visible"]),w("div",{class:"bimdata-viewer__content",style:ve(o.isHeaderVisible?"height: calc(100% - var(--bimdata-viewer-header-height, 40px))":"height: 100%")},[o.leftSidePanel?(k(),W(c,{key:0,"side-panel":o.leftSidePanel,position:"left"},null,8,["side-panel"])):le("",!0),(k(),W(qr(o.Layout),{style:"height: 100%; flex-grow: 1;"})),o.rightSidePanel?(k(),W(c,{key:1,"side-panel":o.rightSidePanel,position:"right"},null,8,["side-panel"])):le("",!0)],4),o.loading?(k(),N("div",LZt,[o.spinner&&o.spinner.component?(k(),W(qr(o.spinner.component),Cs(la({key:0},o.spinner.props)),null,16)):(k(),W(d,{key:1,size:"40px",border:"5px"}))])):le("",!0),!o.isHeaderVisible&&(o.bimdataLogoOnSingleWindow||o.viewerVersionOnSingleWindow)?(k(),N("div",RZt,[o.bimdataLogoOnSingleWindow?(k(),W(u,{key:0,name:"logo"})):le("",!0),o.viewerVersionOnSingleWindow?(k(),N("div",_Zt,G(o.version),1)):le("",!0)])):le("",!0)],544)}var UZt=Q(TZt,[["render",FZt],["__scopeId","data-v-0c1c941a"]]),OZt=["src"],NZt={class:"bimdata-models__header"},HZt={key:0,class:"bimdata-models__header__loader"},VZt={class:"bimdata-models__header__picto"},jZt={class:"bimdata-models__header__name"},QZt={key:0,class:"bimdata-models__header__name--empty"},zZt={key:1,class:"bimdata-models__header__name--empty"},qZt={key:3},GZt=["onMousemove","onClick"],nne=Q({__name:"Models",props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:"350px"}},setup(e){let t=e,i=bt("$viewer"),o=pe(),r=pe(0),n=pe(0),a=pe(),s=Ui([]),l=pe(!1),c=je(()=>i.localContext.loadedModels),d=je(()=>i.localContext.loadedModelIds),u=je(()=>i.localContext.loadingModelIds),A=je(()=>i.localContext.multiModel),h=je(()=>(t.customFilter?s.value.filter(t.customFilter):s.value).map(B=>c.value.find(E=>E.document?.head_id!=null&&E.document.head_id===B.document.id)??B)),p=B=>d.value.includes(B),f=B=>u.value.includes(B),m=je(()=>{let{x:B,y:E}=a.value?.getBoundingClientRect()??{x:0,y:0};return`top:${n.value-E}px; left:${r.value-B}px;`}),g=B=>{!A.value&&p(B.id)||u.value.length>0||(i.localContext.loadedModelIds.includes(B.id)?i.localContext.unloadModels([B.id]):i.localContext.loadModels([B.id]))},y=B=>{switch(B){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},v=(B,E)=>{B?.viewer_360_file&&(r.value=E.clientX,n.value=E.clientY),o.value=B?.viewer_360_file},C=async B=>{l.value=!0;try{return(await i.api.apiClient.modelApi.getModels(i.api.cloudId,i.api.projectId,void 0,void 0,B)).filter(E=>i.state.models.some(D=>D.archived)||!E.archived).sort(Zl("updated_at",!1))}catch(E){console.error("[Models] Cannot get project models. Error: ",E)}finally{l.value=!1}return[]},x=B=>B.children?.some(E=>p(E.id))??!1;return C(i.localContext.modelTypes).then(B=>{s.value=B}),(B,E)=>{let D=I("BIMDataSpinner"),P=I("BIMDataIconModel3D"),M=I("BIMDataTextbox"),R=I("BIMDataCheckbox"),O=I("BIMDataRadio"),V=I("BIMDataIcon"),z=I("BIMDataDropdownList");return k(),N("div",{ref_key:"templateRef",ref:a,class:ye(["bimdata-models",{"bimdata-models--window-positioning":e.windowPositioning}])},[o.value?(k(),N("div",{key:0,class:"bimdata-models__preview",style:ve(m.value)},[w("img",{src:o.value},null,8,OZt)],4)):le("",!0),T(z,{style:ve(`--bimdata-models-width: ${e.width};`),width:e.width,list:h.value,"element-key":"id","per-page":40,loading:l.value,class:"bimdata-models__list",disabled:h.value.length===0,onElementClick:g},{header:j(({isOpen:K})=>[w("div",NZt,[l.value||u.value.length>0?(k(),N("div",HZt,[T(D)])):(k(),N(ut,{key:1},[w("div",VZt,[T(P)]),w("div",{class:ye(["bimdata-models__header__number bimdata-info-length",{"bimdata-models__header__number--empty":d.value.length===0}])},[w("span",null,G(d.value.length),1)],2),w("div",jZt,[h.value.length===0?(k(),N("span",QZt,G(B.$t("model.no_model")),1)):d.value.length===0?(k(),N("span",zZt,G(B.$t("model.no_loaded_model")),1)):d.value.length===1?(k(),W(M,{key:2,text:c.value[0].name,tooltip:!K},null,8,["text","tooltip"])):d.value.length>1?(k(),N("span",qZt,G(B.$t("model.selected_models")),1)):le("",!0)])],64))])]),element:j(({element:K,close:Z})=>[w("div",{class:"bimdata-models__model",onMousemove:te=>e.preview&&v(K,te),onMouseout:E[0]||=te=>e.preview&&v(),onClick:()=>{!A.value&&!p(K.id)&&Z()}},[A.value?(k(),W(R,{key:0,"model-value":p(K.id)||x(K),disabled:K.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])):(k(),W(O,{key:1,"model-value":p(K.id)||x(K),disabled:K.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])),T(V,{margin:"0 calc(var(--spacing-unit) / 2)",name:y(K.status),size:"xs",class:ye({"fill-success":K.status==="C","fill-high":K.status==="E"})},null,8,["name","class"]),T(M,{class:ye({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":K.status!=="C"||u.value.length>0}),text:K.name,width:`calc(100% -
6442
6442
  ${A.value?13:23}px - 2 * 6px - 16px)`},null,8,["class","text","width"]),K.document&&!K.document.is_head_version?(k(),W(V,{key:2,name:"versioning",fill:"",color:"default",size:"xs",margin:"0 0 0 6px"})):le("",!0)],40,GZt),f(K.id)?(k(),W(D,{key:0,class:"bimdata-models__model__spinner"})):le("",!0)]),_:1},8,["style","width","list","loading","disabled"])],2)}}},[["__scopeId","data-v-34c2cf79"]]),KZt="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",JZt=["src"],ZZt={key:0,class:"bimdata-multi-model-loader__header-container"},WZt={key:0,class:"bimdata-multi-model-loader__header__loader"},YZt={class:"bimdata-multi-model-loader__header__picto"},XZt=["src"],$Zt={class:"bimdata-multi-model-loader__header__name"},eWt={key:0,class:"bimdata-multi-model-loader__header__name--empty"},tWt={key:1,class:"bimdata-multi-model-loader__header__name--empty"},iWt={key:3},rWt={key:1,class:"bimdata-multi-model-loader__main"},oWt=["onMousemove","onClick"],nWt=Q({__name:"BIMDataMultiModelLoader",props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:"350px"}},setup(e){let t=e,i=bt("$viewer"),o=pe(),r=pe(0),n=pe(0),a=pe(),s=Ui([]),l=pe(!1),c=pe(!0),d=O=>{O.key==="Escape"?c.value=!0:O.key==="Enter"&&D()};xt(c,O=>{O?(window.removeEventListener("keydown",d),v.clear(),y.clear(),o.value=null):window.addEventListener("keydown",d)});let u=je(()=>i.localContext.loadedModels),A=je(()=>i.localContext.loadedModelIds),h=je(()=>i.localContext.loadingModelIds),p=je(()=>i.localContext.multiModel),f=je(()=>(t.customFilter?s.value.filter(t.customFilter):s.value).map(O=>u.value.find(V=>V.document?.head_id!=null&&V.document.head_id===O.document.id)??O)),m=O=>A.value.includes(O),g=O=>h.value.includes(O),y=qo(new Set),v=qo(new Set),C=O=>O.children?.some(V=>m(V.id))??!1,x=O=>(m(O.id)||C(O)||y.has(O))&&!v.has(O),B=je(()=>{let{x:O,y:V}=a.value.getBoundingClientRect();return`top:${n.value-V}px; left:${r.value-O}px;`}),E=O=>{O.status==="C"&&(!p.value&&m(O.id)||(m(O.id)?v.has(O)?v.delete(O):v.add(O):y.has(O)?y.delete(O):y.add(O)))},D=()=>{y.size>0&&i.localContext.loadModels(Array.from(y).map(O=>O.id)),v.size>0&&i.localContext.unloadModels(Array.from(v).map(O=>O.id)),c.value=!0},P=O=>{switch(O){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},M=O=>O.document&&!O.document.is_head_version,R=(O,V)=>{!t.preview||c.value||(O?.viewer_360_file&&(r.value=V.clientX,n.value=V.clientY),o.value=O?.viewer_360_file)};return(async O=>{l.value=!0;try{return(await i.api.apiClient.modelApi.getModels(i.api.cloudId,i.api.projectId,void 0,void 0,O)).filter(V=>i.state.models.some(z=>z.archived)||!V.archived).sort(Zl("updated_at",!1))}catch(V){console.error("[Models] Cannot get project models. Error: ",V)}finally{l.value=!1}return[]})(i.localContext.modelTypes).then(O=>{s.value=O}),(O,V)=>{let z=I("BIMDataSpinner"),K=I("BIMDataTextbox"),Z=I("BIMDataIconChevron"),te=I("BIMDataButton"),ie=I("BIMDataIconFileIfcPolychrome"),se=I("BIMDataCheckbox"),Be=I("BIMDataRadio"),qe=I("BIMDataIcon"),ze=I("BIMDataPaginatedList"),st=Li("click-away");return k(),N("div",{ref_key:"templateRef",ref:a,class:ye(["bimdata-multi-model-loader",{"bimdata-multi-model-loader--window-positioning":e.windowPositioning}])},[o.value?(k(),N("div",{key:0,class:"bimdata-multi-model-loader__preview",style:ve(B.value)},[w("img",{src:o.value},null,8,JZt)],4)):le("",!0),T(Qi,{name:"fade",mode:"out-in"},{default:j(()=>[c.value?(k(),N("div",ZZt,[Pt(O.$slots,"left",{},void 0,!0),w("div",{class:"bimdata-multi-model-loader__header",onClick:V[0]||=Pe=>c.value=!1},[l.value||h.value.length>0?(k(),N("div",WZt,[T(z)])):(k(),N(ut,{key:1},[w("div",YZt,[w("img",{src:mt(KZt),alt:"file icon"},null,8,XZt)]),w("div",{class:ye(["bimdata-multi-model-loader__header__number bimdata-info-length",{"bimdata-multi-model-loader__header__number--empty":A.value.length===0}])},[w("span",null,G(A.value.length),1)],2),w("div",$Zt,[f.value.length===0?(k(),N("span",eWt,G(O.$t("model.no_model")),1)):A.value.length===0?(k(),N("span",tWt,G(O.$t("model.no_loaded_model")),1)):A.value.length===1?(k(),W(K,{key:2,text:u.value[0].name,tooltip:c.value,width:"233px"},null,8,["text","tooltip"])):A.value.length>1?(k(),N("span",iWt,G(O.$t("model.selected_models")),1)):le("",!0)]),T(te,{color:"default",icon:"",radius:"",fill:"",width:"21px",height:"21px"},{default:j(()=>[T(Z,{size:"xxxs"})]),_:1})],64))]),Pt(O.$slots,"right",{},void 0,!0)])):Tt((k(),N("div",rWt,[T(ze,{list:f.value,"per-page":10},{element:j(({element:Pe})=>[w("div",{class:ye(["bimdata-multi-model-loader__main__model",{"bimdata-multi-model-loader__main__model--disabled":Pe.status!=="C"}]),onMousemove:Ge=>R(Pe,Ge),onMouseout:V[1]||=Ge=>R(),onClick:Ge=>E(Pe)},[T(ie,{fill:"",color:"default",size:"xs"}),p.value?(k(),W(se,{key:0,"model-value":x(Pe),disabled:Pe.status!=="C"},null,8,["model-value","disabled"])):(k(),W(Be,{key:1,"model-value":x(Pe),disabled:Pe.status!=="C"},null,8,["model-value","disabled"])),T(K,{class:ye({"bimdata-multi-model-loader__main__model__name":!0,"bimdata-multi-model-loader__main__model__name--disabled":Pe.status!=="C"}),text:Pe.name,width:M(Pe)?"333px":"363px"},null,8,["class","text","width"]),M(Pe)?(k(),W(qe,{key:2,name:"versioning",fill:"",color:"default",size:"xs",margin:"0 0 0 6px"})):le("",!0),g(Pe.id)?(k(),W(z,{key:3,class:"bimdata-multi-model-loader__main__model__spinner"})):(k(),W(qe,{key:4,name:P(Pe.status),size:"xs",class:ye({"fill-success":Pe.status==="C","fill-high":Pe.status==="E"})},null,8,["name","class"]))],42,oWt)]),_:1},8,["list"]),T(te,{class:"bimdata-multi-model-loader__main__validate",width:"93px",color:"primary",fill:"",radius:"",disabled:mt(y).size===0&&mt(v).size===0,onClick:D},{default:j(()=>[nt(G(O.$t("global.validate")),1)]),_:1},8,["disabled"])])),[[st,()=>c.value=!0]])]),_:3})],2)}}},[["__scopeId","data-v-44e6af66"]]),aWt={data(){return{shown:!1}},mounted(){setTimeout(()=>{this.shown=!0},500)}};function sWt(e,t,i,o,r,n){let a=I("BIMDataIllustration");return k(),N("div",{class:"bimdata__no-model",style:ve({"--no-model--opacity":r.shown?1:0})},[T(a,{name:"emptyViewer",x:"90",y:"90"}),w("span",null,G(e.$t("model.select_model")),1)],4)}var ane=Q(aWt,[["render",sWt],["__scopeId","data-v-5ffd9bc0"]]);window.BIMDataViewerVue=b4;var lWt=class{constructor(e={}){let{api:t={},ui:i}=e;this.uiCfg=i,t.apiUrl||=(console.info("[BIMData Viewer] INFO - Viewer config - `apiUrl` not set, use 'https://api.bimdata.io' by default."),"https://api.bimdata.io"),t.archiveUrl||=(console.info("[BIMData Viewer] INFO - Viewer config - `archiveUrl` not set, use 'https://archive.bimdata.io' by default."),"https://archive.bimdata.io"),t.pdfBackendUrl||=(console.info("[BIMData Viewer] INFO - Viewer config - `pdfBackendUrl` not set, use 'https://pdf-backend.bimdata.io' by default."),"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.offline?.dataFile&&(t.offline.data=t.offline.dataFile),this.$viewer=new WJt(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"){let{$viewer:i}=this;await i.api.ready;try{let l=await i.api.apiClient.collaborationApi.checkProjectAccess(i.api.cloudId,i.api.projectId);i.api.permissions=one(l)}catch{i.api.permissions=one()}let o=this.api.accessToken,{i18n:r}=i;r.registerTranslations(i.pluginManager.pluginTranslations),i.layout.apply(t);let n=qf({i18n:r.i18nVuePlugin,data(){return{accessToken:o}},render(){return Gr(UZt,{style:"height: 100%"})}}).use(r.i18nVuePlugin).use(aZt()).use(rZt({i18nPlugin:r.i18nVuePlugin})).use(tZt({apiClient:i.api.apiClient,i18nPlugin:r.i18nVuePlugin}));n.provide("$viewer",i),n.provide("BIMDATA_DESIGN_SYSTEM_DARK_THEME",je(()=>i.darkTheme)),n.component("BIMDataModelLoader",nne),n.component("BIMDataMultiModelLoader",nWt),n.component("BIMDataNoModelWindowPlaceHolder",ane),n.component("BIMDataStoreySelector",UB),n.component("ModelsLoader",nne),n.component("NoModelWindowPlaceHolder",ane);let a=e instanceof HTMLElement?e:document.querySelector(e);a&&(a.style.height="100%");let s=n.mount(e);return s.$viewer=i,YJt(s.$el,this.uiCfg?.style),typeof window<"u"&&(window.bimdataViewer=s),this.vueApp=n,s}destroy(){this.vueApp?.unmount()}setLocale(e){if(!iO.includes(e))throw Error(`Viewer available locales are ${iO.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();let 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)}},sne=(e={})=>new lWt(e);window.makeBIMDataViewer=sne;export{sne as default};