@bimdata/viewer 2.17.0-beta.5 → 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.
@@ -1128,7 +1128,7 @@ startxref
1128
1128
  content: "" !important;
1129
1129
  display: none !important;
1130
1130
  }`,ZMe=function(_){XMe(_,"."+iS+JMe+nK+`
1131
- .`+rS+YMe+nK)},XMe=function(_,R){var U=_.ownerDocument;if(U){var F=U.createElement("style");F.textContent=R,_.appendChild(F)}},oK=(function(){function _(){}return _.getOrigin=function(R){var U=_._link;return U?(U.href=R,U.href=U.href,U.protocol+U.hostname+U.port):"about:blank"},_.isSameOrigin=function(R){return _.getOrigin(R)===_._origin},_.setContext=function(R){_._link=R.document.createElement("a"),_._origin=_.getOrigin(R.location.href)},_._origin="about:blank",_})(),$Me=(function(){function _(R,U){this.context=R,this._options=U,this._cache={}}return _.prototype.addImage=function(R){var U=Promise.resolve();return this.has(R)||(oS(R)||rIe(R))&&(this._cache[R]=this.loadImage(R)).catch(function(){}),U},_.prototype.match=function(R){return this._cache[R]},_.prototype.loadImage=function(R){return o(this,void 0,void 0,function(){var U,F,X,ae,Ee=this;return a(this,function(Ne){switch(Ne.label){case 0:return U=oK.isSameOrigin(R),F=!nS(R)&&this._options.useCORS===!0&&Es.SUPPORT_CORS_IMAGES&&!U,X=!nS(R)&&!U&&!oS(R)&&typeof this._options.proxy=="string"&&Es.SUPPORT_CORS_XHR&&!F,!U&&this._options.allowTaint===!1&&!nS(R)&&!oS(R)&&!X&&!F?[2]:(ae=R,X?[4,this.proxy(ae)]:[3,2]);case 1:ae=Ne.sent(),Ne.label=2;case 2:return this.context.logger.debug("Added image "+R.substring(0,256)),[4,new Promise(function(ze,pt){var xt=new Image;xt.onload=function(){return ze(xt)},xt.onerror=pt,(nIe(ae)||F)&&(xt.crossOrigin="anonymous"),xt.src=ae,xt.complete===!0&&setTimeout(function(){return ze(xt)},500),Ee._options.imageTimeout>0&&setTimeout(function(){return pt("Timed out ("+Ee._options.imageTimeout+"ms) loading image")},Ee._options.imageTimeout)})];case 3:return[2,Ne.sent()]}})})},_.prototype.has=function(R){return this._cache[R]!==void 0},_.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},_.prototype.proxy=function(R){var U=this,F=this._options.proxy;if(!F)throw Error("No proxy defined");var X=R.substring(0,256);return new Promise(function(ae,Ee){var Ne=Es.SUPPORT_RESPONSE_TYPE?"blob":"text",ze=new XMLHttpRequest;ze.onload=function(){if(ze.status===200)if(Ne==="text")ae(ze.response);else{var Rt=new FileReader;Rt.addEventListener("load",function(){return ae(Rt.result)},!1),Rt.addEventListener("error",function(Kt){return Ee(Kt)},!1),Rt.readAsDataURL(ze.response)}else Ee("Failed to proxy resource "+X+" with status code "+ze.status)},ze.onerror=Ee;var pt=F.indexOf("?")>-1?"&":"?";if(ze.open("GET",""+F+pt+"url="+encodeURIComponent(R)+"&responseType="+Ne),Ne!=="text"&&ze instanceof XMLHttpRequest&&(ze.responseType=Ne),U._options.imageTimeout){var xt=U._options.imageTimeout;ze.timeout=xt,ze.ontimeout=function(){return Ee("Timed out ("+xt+"ms) proxying "+X)}}ze.send()})},_})(),eIe=/^data:image\/svg\+xml/i,tIe=/^data:image\/.*;base64,/i,iIe=/^data:image\/.*/i,rIe=function(_){return Es.SUPPORT_SVG_DRAWING||!oIe(_)},nS=function(_){return iIe.test(_)},nIe=function(_){return tIe.test(_)},oS=function(_){return _.substr(0,4)==="blob"},oIe=function(_){return _.substr(-3).toLowerCase()==="svg"||eIe.test(_)},ki=(function(){function _(R,U){this.type=0,this.x=R,this.y=U}return _.prototype.add=function(R,U){return new _(this.x+R,this.y+U)},_})(),vm=function(_,R,U){return new ki(_.x+(R.x-_.x)*U,_.y+(R.y-_.y)*U)},v9=(function(){function _(R,U,F,X){this.type=1,this.start=R,this.startControl=U,this.endControl=F,this.end=X}return _.prototype.subdivide=function(R,U){var F=vm(this.start,this.startControl,R),X=vm(this.startControl,this.endControl,R),ae=vm(this.endControl,this.end,R),Ee=vm(F,X,R),Ne=vm(X,ae,R),ze=vm(Ee,Ne,R);return U?new _(this.start,F,Ee,ze):new _(ze,Ne,ae,this.end)},_.prototype.add=function(R,U){return new _(this.start.add(R,U),this.startControl.add(R,U),this.endControl.add(R,U),this.end.add(R,U))},_.prototype.reverse=function(){return new _(this.end,this.endControl,this.startControl,this.start)},_})(),vd=function(_){return _.type===1},aIe=(function(){function _(R){var U=R.styles,F=R.bounds,X=Nu(U.borderTopLeftRadius,F.width,F.height),ae=X[0],Ee=X[1],Ne=Nu(U.borderTopRightRadius,F.width,F.height),ze=Ne[0],pt=Ne[1],xt=Nu(U.borderBottomRightRadius,F.width,F.height),Rt=xt[0],Kt=xt[1],Ti=Nu(U.borderBottomLeftRadius,F.width,F.height),di=Ti[0],vi=Ti[1],Jr=[];Jr.push((ae+ze)/F.width),Jr.push((di+Rt)/F.width),Jr.push((Ee+vi)/F.height),Jr.push((pt+Kt)/F.height);var ir=Math.max.apply(Math,Jr);ir>1&&(ae/=ir,Ee/=ir,ze/=ir,pt/=ir,Rt/=ir,Kt/=ir,di/=ir,vi/=ir);var Yi=F.width-ze,wo=F.height-Kt,gn=F.width-Rt,dr=F.height-vi,Mi=U.borderTopWidth,pn=U.borderRightWidth,Xr=U.borderBottomWidth,Tr=U.borderLeftWidth,el=Ao(U.paddingTop,R.bounds.width),Vu=Ao(U.paddingRight,R.bounds.width),fp=Ao(U.paddingBottom,R.bounds.width),Lo=Ao(U.paddingLeft,R.bounds.width);this.topLeftBorderDoubleOuterBox=ae>0||Ee>0?Ro(F.left+Tr/3,F.top+Mi/3,ae-Tr/3,Ee-Mi/3,Qn.TOP_LEFT):new ki(F.left+Tr/3,F.top+Mi/3),this.topRightBorderDoubleOuterBox=ae>0||Ee>0?Ro(F.left+Yi,F.top+Mi/3,ze-pn/3,pt-Mi/3,Qn.TOP_RIGHT):new ki(F.left+F.width-pn/3,F.top+Mi/3),this.bottomRightBorderDoubleOuterBox=Rt>0||Kt>0?Ro(F.left+gn,F.top+wo,Rt-pn/3,Kt-Xr/3,Qn.BOTTOM_RIGHT):new ki(F.left+F.width-pn/3,F.top+F.height-Xr/3),this.bottomLeftBorderDoubleOuterBox=di>0||vi>0?Ro(F.left+Tr/3,F.top+dr,di-Tr/3,vi-Xr/3,Qn.BOTTOM_LEFT):new ki(F.left+Tr/3,F.top+F.height-Xr/3),this.topLeftBorderDoubleInnerBox=ae>0||Ee>0?Ro(F.left+Tr*2/3,F.top+Mi*2/3,ae-Tr*2/3,Ee-Mi*2/3,Qn.TOP_LEFT):new ki(F.left+Tr*2/3,F.top+Mi*2/3),this.topRightBorderDoubleInnerBox=ae>0||Ee>0?Ro(F.left+Yi,F.top+Mi*2/3,ze-pn*2/3,pt-Mi*2/3,Qn.TOP_RIGHT):new ki(F.left+F.width-pn*2/3,F.top+Mi*2/3),this.bottomRightBorderDoubleInnerBox=Rt>0||Kt>0?Ro(F.left+gn,F.top+wo,Rt-pn*2/3,Kt-Xr*2/3,Qn.BOTTOM_RIGHT):new ki(F.left+F.width-pn*2/3,F.top+F.height-Xr*2/3),this.bottomLeftBorderDoubleInnerBox=di>0||vi>0?Ro(F.left+Tr*2/3,F.top+dr,di-Tr*2/3,vi-Xr*2/3,Qn.BOTTOM_LEFT):new ki(F.left+Tr*2/3,F.top+F.height-Xr*2/3),this.topLeftBorderStroke=ae>0||Ee>0?Ro(F.left+Tr/2,F.top+Mi/2,ae-Tr/2,Ee-Mi/2,Qn.TOP_LEFT):new ki(F.left+Tr/2,F.top+Mi/2),this.topRightBorderStroke=ae>0||Ee>0?Ro(F.left+Yi,F.top+Mi/2,ze-pn/2,pt-Mi/2,Qn.TOP_RIGHT):new ki(F.left+F.width-pn/2,F.top+Mi/2),this.bottomRightBorderStroke=Rt>0||Kt>0?Ro(F.left+gn,F.top+wo,Rt-pn/2,Kt-Xr/2,Qn.BOTTOM_RIGHT):new ki(F.left+F.width-pn/2,F.top+F.height-Xr/2),this.bottomLeftBorderStroke=di>0||vi>0?Ro(F.left+Tr/2,F.top+dr,di-Tr/2,vi-Xr/2,Qn.BOTTOM_LEFT):new ki(F.left+Tr/2,F.top+F.height-Xr/2),this.topLeftBorderBox=ae>0||Ee>0?Ro(F.left,F.top,ae,Ee,Qn.TOP_LEFT):new ki(F.left,F.top),this.topRightBorderBox=ze>0||pt>0?Ro(F.left+Yi,F.top,ze,pt,Qn.TOP_RIGHT):new ki(F.left+F.width,F.top),this.bottomRightBorderBox=Rt>0||Kt>0?Ro(F.left+gn,F.top+wo,Rt,Kt,Qn.BOTTOM_RIGHT):new ki(F.left+F.width,F.top+F.height),this.bottomLeftBorderBox=di>0||vi>0?Ro(F.left,F.top+dr,di,vi,Qn.BOTTOM_LEFT):new ki(F.left,F.top+F.height),this.topLeftPaddingBox=ae>0||Ee>0?Ro(F.left+Tr,F.top+Mi,Math.max(0,ae-Tr),Math.max(0,Ee-Mi),Qn.TOP_LEFT):new ki(F.left+Tr,F.top+Mi),this.topRightPaddingBox=ze>0||pt>0?Ro(F.left+Math.min(Yi,F.width-pn),F.top+Mi,Yi>F.width+pn?0:Math.max(0,ze-pn),Math.max(0,pt-Mi),Qn.TOP_RIGHT):new ki(F.left+F.width-pn,F.top+Mi),this.bottomRightPaddingBox=Rt>0||Kt>0?Ro(F.left+Math.min(gn,F.width-Tr),F.top+Math.min(wo,F.height-Xr),Math.max(0,Rt-pn),Math.max(0,Kt-Xr),Qn.BOTTOM_RIGHT):new ki(F.left+F.width-pn,F.top+F.height-Xr),this.bottomLeftPaddingBox=di>0||vi>0?Ro(F.left+Tr,F.top+Math.min(dr,F.height-Xr),Math.max(0,di-Tr),Math.max(0,vi-Xr),Qn.BOTTOM_LEFT):new ki(F.left+Tr,F.top+F.height-Xr),this.topLeftContentBox=ae>0||Ee>0?Ro(F.left+Tr+Lo,F.top+Mi+el,Math.max(0,ae-(Tr+Lo)),Math.max(0,Ee-(Mi+el)),Qn.TOP_LEFT):new ki(F.left+Tr+Lo,F.top+Mi+el),this.topRightContentBox=ze>0||pt>0?Ro(F.left+Math.min(Yi,F.width+Tr+Lo),F.top+Mi+el,Yi>F.width+Tr+Lo?0:ze-Tr+Lo,pt-(Mi+el),Qn.TOP_RIGHT):new ki(F.left+F.width-(pn+Vu),F.top+Mi+el),this.bottomRightContentBox=Rt>0||Kt>0?Ro(F.left+Math.min(gn,F.width-(Tr+Lo)),F.top+Math.min(wo,F.height+Mi+el),Math.max(0,Rt-(pn+Vu)),Kt-(Xr+fp),Qn.BOTTOM_RIGHT):new ki(F.left+F.width-(pn+Vu),F.top+F.height-(Xr+fp)),this.bottomLeftContentBox=di>0||vi>0?Ro(F.left+Tr+Lo,F.top+dr,Math.max(0,di-(Tr+Lo)),vi-(Xr+fp),Qn.BOTTOM_LEFT):new ki(F.left+Tr+Lo,F.top+F.height-(Xr+fp))}return _})(),Qn;(function(_){_[_.TOP_LEFT=0]="TOP_LEFT",_[_.TOP_RIGHT=1]="TOP_RIGHT",_[_.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",_[_.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(Qn||={});var Ro=function(_,R,U,F,X){var ae=4*((Math.sqrt(2)-1)/3),Ee=U*ae,Ne=F*ae,ze=_+U,pt=R+F;switch(X){case Qn.TOP_LEFT:return new v9(new ki(_,pt),new ki(_,pt-Ne),new ki(ze-Ee,R),new ki(ze,R));case Qn.TOP_RIGHT:return new v9(new ki(_,R),new ki(_+Ee,R),new ki(ze,pt-Ne),new ki(ze,pt));case Qn.BOTTOM_RIGHT:return new v9(new ki(ze,R),new ki(ze,R+Ne),new ki(_+Ee,pt),new ki(_,pt));case Qn.BOTTOM_LEFT:default:return new v9(new ki(ze,pt),new ki(ze-Ee,pt),new ki(_,R+Ne),new ki(_,R))}},w9=function(_){return[_.topLeftBorderBox,_.topRightBorderBox,_.bottomRightBorderBox,_.bottomLeftBorderBox]},sIe=function(_){return[_.topLeftContentBox,_.topRightContentBox,_.bottomRightContentBox,_.bottomLeftContentBox]},b9=function(_){return[_.topLeftPaddingBox,_.topRightPaddingBox,_.bottomRightPaddingBox,_.bottomLeftPaddingBox]},lIe=(function(){function _(R,U,F){this.offsetX=R,this.offsetY=U,this.matrix=F,this.type=0,this.target=6}return _})(),y9=(function(){function _(R,U){this.path=R,this.target=U,this.type=1}return _})(),cIe=(function(){function _(R){this.opacity=R,this.type=2,this.target=6}return _})(),dIe=function(_){return _.type===0},aK=function(_){return _.type===1},uIe=function(_){return _.type===2},sK=function(_,R){return _.length===R.length?_.some(function(U,F){return U===R[F]}):!1},hIe=function(_,R,U,F,X){return _.map(function(ae,Ee){switch(Ee){case 0:return ae.add(R,U);case 1:return ae.add(R+F,U);case 2:return ae.add(R+F,U+X);case 3:return ae.add(R,U+X)}return ae})},lK=(function(){function _(R){this.element=R,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return _})(),cK=(function(){function _(R,U){if(this.container=R,this.parent=U,this.effects=[],this.curves=new aIe(this.container),this.container.styles.opacity<1&&this.effects.push(new cIe(this.container.styles.opacity)),this.container.styles.transform!==null){var F=this.container.bounds.left+this.container.styles.transformOrigin[0].number,X=this.container.bounds.top+this.container.styles.transformOrigin[1].number,ae=this.container.styles.transform;this.effects.push(new lIe(F,X,ae))}if(this.container.styles.overflowX!==0){var Ee=w9(this.curves),Ne=b9(this.curves);sK(Ee,Ne)?this.effects.push(new y9(Ee,6)):(this.effects.push(new y9(Ee,2)),this.effects.push(new y9(Ne,4)))}}return _.prototype.getEffects=function(R){for(var U=[2,3].indexOf(this.container.styles.position)===-1,F=this.parent,X=this.effects.slice(0);F;){var ae=F.effects.filter(function(ze){return!aK(ze)});if(U||F.container.styles.position!==0||!F.parent){if(X.unshift.apply(X,ae),U=[2,3].indexOf(F.container.styles.position)===-1,F.container.styles.overflowX!==0){var Ee=w9(F.curves),Ne=b9(F.curves);sK(Ee,Ne)||X.unshift(new y9(Ne,6))}}else X.unshift.apply(X,ae);F=F.parent}return X.filter(function(ze){return Ha(ze.target,R)})},_})(),aS=function(_,R,U,F){_.container.elements.forEach(function(X){var ae=Ha(X.flags,4),Ee=Ha(X.flags,2),Ne=new cK(X,_);Ha(X.styles.display,2048)&&F.push(Ne);var ze=Ha(X.flags,8)?[]:F;if(ae||Ee){var pt=ae||X.styles.isPositioned()?U:R,xt=new lK(Ne);if(X.styles.isPositioned()||X.styles.opacity<1||X.styles.isTransformed()){var Rt=X.styles.zIndex.order;if(Rt<0){var Kt=0;pt.negativeZIndex.some(function(di,vi){return Rt>di.element.container.styles.zIndex.order?(Kt=vi,!1):Kt>0}),pt.negativeZIndex.splice(Kt,0,xt)}else if(Rt>0){var Ti=0;pt.positiveZIndex.some(function(di,vi){return Rt>=di.element.container.styles.zIndex.order?(Ti=vi+1,!1):Ti>0}),pt.positiveZIndex.splice(Ti,0,xt)}else pt.zeroOrAutoZIndexOrTransformedOrOpacity.push(xt)}else X.styles.isFloating()?pt.nonPositionedFloats.push(xt):pt.nonPositionedInlineLevel.push(xt);aS(Ne,xt,ae?xt:U,ze)}else X.styles.isInlineLevel()?R.inlineLevel.push(Ne):R.nonInlineLevel.push(Ne),aS(Ne,R,U,ze);Ha(X.flags,8)&&dK(X,ze)})},dK=function(_,R){for(var U=_ instanceof JP?_.start:1,F=_ instanceof JP?_.reversed:!1,X=0;X<R.length;X++){var ae=R[X];ae.container instanceof _G&&typeof ae.container.value=="number"&&ae.container.value!==0&&(U=ae.container.value),ae.listValue=T4(U,ae.container.styles.listStyleType,!0),U+=F?-1:1}},pIe=function(_){var R=new cK(_,null),U=new lK(R),F=[];return aS(R,U,U,F),dK(R.container,F),U},uK=function(_,R){switch(R){case 0:return wd(_.topLeftBorderBox,_.topLeftPaddingBox,_.topRightBorderBox,_.topRightPaddingBox);case 1:return wd(_.topRightBorderBox,_.topRightPaddingBox,_.bottomRightBorderBox,_.bottomRightPaddingBox);case 2:return wd(_.bottomRightBorderBox,_.bottomRightPaddingBox,_.bottomLeftBorderBox,_.bottomLeftPaddingBox);default:return wd(_.bottomLeftBorderBox,_.bottomLeftPaddingBox,_.topLeftBorderBox,_.topLeftPaddingBox)}},AIe=function(_,R){switch(R){case 0:return wd(_.topLeftBorderBox,_.topLeftBorderDoubleOuterBox,_.topRightBorderBox,_.topRightBorderDoubleOuterBox);case 1:return wd(_.topRightBorderBox,_.topRightBorderDoubleOuterBox,_.bottomRightBorderBox,_.bottomRightBorderDoubleOuterBox);case 2:return wd(_.bottomRightBorderBox,_.bottomRightBorderDoubleOuterBox,_.bottomLeftBorderBox,_.bottomLeftBorderDoubleOuterBox);default:return wd(_.bottomLeftBorderBox,_.bottomLeftBorderDoubleOuterBox,_.topLeftBorderBox,_.topLeftBorderDoubleOuterBox)}},fIe=function(_,R){switch(R){case 0:return wd(_.topLeftBorderDoubleInnerBox,_.topLeftPaddingBox,_.topRightBorderDoubleInnerBox,_.topRightPaddingBox);case 1:return wd(_.topRightBorderDoubleInnerBox,_.topRightPaddingBox,_.bottomRightBorderDoubleInnerBox,_.bottomRightPaddingBox);case 2:return wd(_.bottomRightBorderDoubleInnerBox,_.bottomRightPaddingBox,_.bottomLeftBorderDoubleInnerBox,_.bottomLeftPaddingBox);default:return wd(_.bottomLeftBorderDoubleInnerBox,_.bottomLeftPaddingBox,_.topLeftBorderDoubleInnerBox,_.topLeftPaddingBox)}},gIe=function(_,R){switch(R){case 0:return C9(_.topLeftBorderStroke,_.topRightBorderStroke);case 1:return C9(_.topRightBorderStroke,_.bottomRightBorderStroke);case 2:return C9(_.bottomRightBorderStroke,_.bottomLeftBorderStroke);default:return C9(_.bottomLeftBorderStroke,_.topLeftBorderStroke)}},C9=function(_,R){var U=[];return vd(_)?U.push(_.subdivide(.5,!1)):U.push(_),vd(R)?U.push(R.subdivide(.5,!0)):U.push(R),U},wd=function(_,R,U,F){var X=[];return vd(_)?X.push(_.subdivide(.5,!1)):X.push(_),vd(U)?X.push(U.subdivide(.5,!0)):X.push(U),vd(F)?X.push(F.subdivide(.5,!0).reverse()):X.push(F),vd(R)?X.push(R.subdivide(.5,!1).reverse()):X.push(R),X},hK=function(_){var R=_.bounds,U=_.styles;return R.add(U.borderLeftWidth,U.borderTopWidth,-(U.borderRightWidth+U.borderLeftWidth),-(U.borderTopWidth+U.borderBottomWidth))},x9=function(_){var R=_.styles,U=_.bounds,F=Ao(R.paddingLeft,U.width),X=Ao(R.paddingRight,U.width),ae=Ao(R.paddingTop,U.width),Ee=Ao(R.paddingBottom,U.width);return U.add(F+R.borderLeftWidth,ae+R.borderTopWidth,-(R.borderRightWidth+R.borderLeftWidth+F+X),-(R.borderTopWidth+R.borderBottomWidth+ae+Ee))},mIe=function(_,R){return _===0?R.bounds:_===2?x9(R):hK(R)},vIe=function(_,R){return _===0?R.bounds:_===2?x9(R):hK(R)},sS=function(_,R,U){var F=mIe(bm(_.styles.backgroundOrigin,R),_),X=vIe(bm(_.styles.backgroundClip,R),_),ae=wIe(bm(_.styles.backgroundSize,R),U,F),Ee=ae[0],Ne=ae[1],ze=Nu(bm(_.styles.backgroundPosition,R),F.width-Ee,F.height-Ne);return[bIe(bm(_.styles.backgroundRepeat,R),ze,ae,F,X),Math.round(F.left+ze[0]),Math.round(F.top+ze[1]),Ee,Ne]},wm=function(_){return Ci(_)&&_.value===M4.AUTO},k9=function(_){return typeof _=="number"},wIe=function(_,R,U){var F=R[0],X=R[1],ae=R[2],Ee=_[0],Ne=_[1];if(!Ee)return[0,0];if(Ji(Ee)&&Ne&&Ji(Ne))return[Ao(Ee,U.width),Ao(Ne,U.height)];var ze=k9(ae);if(Ci(Ee)&&(Ee.value===M4.CONTAIN||Ee.value===M4.COVER))return k9(ae)?U.width/U.height<ae==(Ee.value===M4.COVER)?[U.height*ae,U.height]:[U.width,U.width/ae]:[U.width,U.height];var pt=k9(F),xt=k9(X),Rt=pt||xt;if(wm(Ee)&&(!Ne||wm(Ne)))return pt&&xt?[F,X]:!ze&&!Rt?[U.width,U.height]:Rt&&ze?[pt?F:X*ae,xt?X:F/ae]:[pt?F:U.width,xt?X:U.height];if(ze){var Kt=0,Ti=0;return Ji(Ee)?Kt=Ao(Ee,U.width):Ji(Ne)&&(Ti=Ao(Ne,U.height)),wm(Ee)?Kt=Ti*ae:(!Ne||wm(Ne))&&(Ti=Kt/ae),[Kt,Ti]}var di=null,vi=null;if(Ji(Ee)?di=Ao(Ee,U.width):Ne&&Ji(Ne)&&(vi=Ao(Ne,U.height)),di!==null&&(!Ne||wm(Ne))&&(vi=pt&&xt?di/F*X:U.height),vi!==null&&wm(Ee)&&(di=pt&&xt?vi/X*F:U.width),di!==null&&vi!==null)return[di,vi];throw Error("Unable to calculate background-size for element")},bm=function(_,R){var U=_[R];return U===void 0?_[0]:U},bIe=function(_,R,U,F,X){var ae=R[0],Ee=R[1],Ne=U[0],ze=U[1];switch(_){case 2:return[new ki(Math.round(F.left),Math.round(F.top+Ee)),new ki(Math.round(F.left+F.width),Math.round(F.top+Ee)),new ki(Math.round(F.left+F.width),Math.round(ze+F.top+Ee)),new ki(Math.round(F.left),Math.round(ze+F.top+Ee))];case 3:return[new ki(Math.round(F.left+ae),Math.round(F.top)),new ki(Math.round(F.left+ae+Ne),Math.round(F.top)),new ki(Math.round(F.left+ae+Ne),Math.round(F.height+F.top)),new ki(Math.round(F.left+ae),Math.round(F.height+F.top))];case 1:return[new ki(Math.round(F.left+ae),Math.round(F.top+Ee)),new ki(Math.round(F.left+ae+Ne),Math.round(F.top+Ee)),new ki(Math.round(F.left+ae+Ne),Math.round(F.top+Ee+ze)),new ki(Math.round(F.left+ae),Math.round(F.top+Ee+ze))];default:return[new ki(Math.round(X.left),Math.round(X.top)),new ki(Math.round(X.left+X.width),Math.round(X.top)),new ki(Math.round(X.left+X.width),Math.round(X.height+X.top)),new ki(Math.round(X.left),Math.round(X.height+X.top))]}},yIe="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",pK="Hidden Text",CIe=(function(){function _(R){this._data={},this._document=R}return _.prototype.parseMetrics=function(R,U){var F=this._document.createElement("div"),X=this._document.createElement("img"),ae=this._document.createElement("span"),Ee=this._document.body;F.style.visibility="hidden",F.style.fontFamily=R,F.style.fontSize=U,F.style.margin="0",F.style.padding="0",F.style.whiteSpace="nowrap",Ee.appendChild(F),X.src=yIe,X.width=1,X.height=1,X.style.margin="0",X.style.padding="0",X.style.verticalAlign="baseline",ae.style.fontFamily=R,ae.style.fontSize=U,ae.style.margin="0",ae.style.padding="0",ae.appendChild(this._document.createTextNode(pK)),F.appendChild(ae),F.appendChild(X);var Ne=X.offsetTop-ae.offsetTop+2;F.removeChild(ae),F.appendChild(this._document.createTextNode(pK)),F.style.lineHeight="normal",X.style.verticalAlign="super";var ze=X.offsetTop-F.offsetTop+2;return Ee.removeChild(F),{baseline:Ne,middle:ze}},_.prototype.getMetrics=function(R,U){var F=R+" "+U;return this._data[F]===void 0&&(this._data[F]=this.parseMetrics(R,U)),this._data[F]},_})(),AK=(function(){function _(R,U){this.context=R,this.options=U}return _})(),xIe=1e4,kIe=(function(_){r(R,_);function R(U,F){var X=_.call(this,U,F)||this;return X._activeEffects=[],X.canvas=F.canvas?F.canvas:document.createElement("canvas"),X.ctx=X.canvas.getContext("2d"),F.canvas||(X.canvas.width=Math.floor(F.width*F.scale),X.canvas.height=Math.floor(F.height*F.scale),X.canvas.style.width=F.width+"px",X.canvas.style.height=F.height+"px"),X.fontMetrics=new CIe(document),X.ctx.scale(X.options.scale,X.options.scale),X.ctx.translate(-F.x,-F.y),X.ctx.textBaseline="bottom",X._activeEffects=[],X.context.logger.debug("Canvas renderer initialized ("+F.width+"x"+F.height+") with scale "+F.scale),X}return R.prototype.applyEffects=function(U){for(var F=this;this._activeEffects.length;)this.popEffect();U.forEach(function(X){return F.applyEffect(X)})},R.prototype.applyEffect=function(U){this.ctx.save(),uIe(U)&&(this.ctx.globalAlpha=U.opacity),dIe(U)&&(this.ctx.translate(U.offsetX,U.offsetY),this.ctx.transform(U.matrix[0],U.matrix[1],U.matrix[2],U.matrix[3],U.matrix[4],U.matrix[5]),this.ctx.translate(-U.offsetX,-U.offsetY)),aK(U)&&(this.path(U.path),this.ctx.clip()),this._activeEffects.push(U)},R.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},R.prototype.renderStack=function(U){return o(this,void 0,void 0,function(){var F;return a(this,function(X){switch(X.label){case 0:return F=U.element.container.styles,F.isVisible()?[4,this.renderStackContent(U)]:[3,2];case 1:X.sent(),X.label=2;case 2:return[2]}})})},R.prototype.renderNode=function(U){return o(this,void 0,void 0,function(){return a(this,function(F){switch(F.label){case 0:if(Ha(U.container.flags,16))debugger;return U.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(U)]:[3,3];case 1:return F.sent(),[4,this.renderNodeContent(U)];case 2:F.sent(),F.label=3;case 3:return[2]}})})},R.prototype.renderTextWithLetterSpacing=function(U,F,X){var ae=this;F===0?this.ctx.fillText(U.text,U.bounds.left,U.bounds.top+X):WP(U.text).reduce(function(Ee,Ne){return ae.ctx.fillText(Ne,Ee,U.bounds.top+X),Ee+ae.ctx.measureText(Ne).width},U.bounds.left)},R.prototype.createFontStyle=function(U){var F=U.fontVariant.filter(function(Ee){return Ee==="normal"||Ee==="small-caps"}).join(""),X=PIe(U.fontFamily).join(", "),ae=Wi(U.fontSize)?""+U.fontSize.number+U.fontSize.unit:U.fontSize.number+"px";return[[U.fontStyle,F,U.fontWeight,ae,X].join(" "),X,ae]},R.prototype.renderTextNode=function(U,F){return o(this,void 0,void 0,function(){var X,ae,Ee,Ne,ze,pt,xt,Rt,Kt=this;return a(this,function(Ti){return X=this.createFontStyle(F),ae=X[0],Ee=X[1],Ne=X[2],this.ctx.font=ae,this.ctx.direction=F.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",ze=this.fontMetrics.getMetrics(Ee,Ne),pt=ze.baseline,xt=ze.middle,Rt=F.paintOrder,U.textBounds.forEach(function(di){Rt.forEach(function(vi){switch(vi){case 0:Kt.ctx.fillStyle=ns(F.color),Kt.renderTextWithLetterSpacing(di,F.letterSpacing,pt);var Jr=F.textShadow;Jr.length&&di.text.trim().length&&(Jr.slice(0).reverse().forEach(function(ir){Kt.ctx.shadowColor=ns(ir.color),Kt.ctx.shadowOffsetX=ir.offsetX.number*Kt.options.scale,Kt.ctx.shadowOffsetY=ir.offsetY.number*Kt.options.scale,Kt.ctx.shadowBlur=ir.blur.number,Kt.renderTextWithLetterSpacing(di,F.letterSpacing,pt)}),Kt.ctx.shadowColor="",Kt.ctx.shadowOffsetX=0,Kt.ctx.shadowOffsetY=0,Kt.ctx.shadowBlur=0),F.textDecorationLine.length&&(Kt.ctx.fillStyle=ns(F.textDecorationColor||F.color),F.textDecorationLine.forEach(function(ir){switch(ir){case 1:Kt.ctx.fillRect(di.bounds.left,Math.round(di.bounds.top+pt),di.bounds.width,1);break;case 2:Kt.ctx.fillRect(di.bounds.left,Math.round(di.bounds.top),di.bounds.width,1);break;case 3:Kt.ctx.fillRect(di.bounds.left,Math.ceil(di.bounds.top+xt),di.bounds.width,1);break}}));break;case 1:F.webkitTextStrokeWidth&&di.text.trim().length&&(Kt.ctx.strokeStyle=ns(F.webkitTextStrokeColor),Kt.ctx.lineWidth=F.webkitTextStrokeWidth,Kt.ctx.lineJoin=window.chrome?"miter":"round",Kt.ctx.strokeText(di.text,di.bounds.left,di.bounds.top+pt)),Kt.ctx.strokeStyle="",Kt.ctx.lineWidth=0,Kt.ctx.lineJoin="miter";break}})}),[2]})})},R.prototype.renderReplacedElement=function(U,F,X){if(X&&U.intrinsicWidth>0&&U.intrinsicHeight>0){var ae=x9(U),Ee=b9(F);this.path(Ee),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(X,0,0,U.intrinsicWidth,U.intrinsicHeight,ae.left,ae.top,ae.width,ae.height),this.ctx.restore()}},R.prototype.renderNodeContent=function(U){return o(this,void 0,void 0,function(){var F,X,ae,Ee,Ne,ze,Yi,Yi,pt,xt,Rt,Kt,gn,Ti,di,dr,vi,Jr,ir,Yi,wo,gn,dr;return a(this,function(Mi){switch(Mi.label){case 0:this.applyEffects(U.getEffects(4)),F=U.container,X=U.curves,ae=F.styles,Ee=0,Ne=F.textNodes,Mi.label=1;case 1:return Ee<Ne.length?(ze=Ne[Ee],[4,this.renderTextNode(ze,ae)]):[3,4];case 2:Mi.sent(),Mi.label=3;case 3:return Ee++,[3,1];case 4:if(!(F instanceof DG))return[3,8];Mi.label=5;case 5:return Mi.trys.push([5,7,,8]),[4,this.context.cache.match(F.src)];case 6:return Yi=Mi.sent(),this.renderReplacedElement(F,X,Yi),[3,8];case 7:return Mi.sent(),this.context.logger.error("Error loading image "+F.src),[3,8];case 8:if(F instanceof RG&&this.renderReplacedElement(F,X,F.canvas),!(F instanceof LG))return[3,12];Mi.label=9;case 9:return Mi.trys.push([9,11,,12]),[4,this.context.cache.match(F.svg)];case 10:return Yi=Mi.sent(),this.renderReplacedElement(F,X,Yi),[3,12];case 11:return Mi.sent(),this.context.logger.error("Error loading svg "+F.svg.substring(0,255)),[3,12];case 12:return F instanceof OG&&F.tree?(pt=new R(this.context,{scale:this.options.scale,backgroundColor:F.backgroundColor,x:0,y:0,width:F.width,height:F.height}),[4,pt.render(F.tree)]):[3,14];case 13:xt=Mi.sent(),F.width&&F.height&&this.ctx.drawImage(xt,0,0,F.width,F.height,F.bounds.left,F.bounds.top,F.bounds.width,F.bounds.height),Mi.label=14;case 14:if(F instanceof YP&&(Rt=Math.min(F.bounds.width,F.bounds.height),F.type===u9?F.checked&&(this.ctx.save(),this.path([new ki(F.bounds.left+Rt*.39363,F.bounds.top+Rt*.79),new ki(F.bounds.left+Rt*.16,F.bounds.top+Rt*.5549),new ki(F.bounds.left+Rt*.27347,F.bounds.top+Rt*.44071),new ki(F.bounds.left+Rt*.39694,F.bounds.top+Rt*.5649),new ki(F.bounds.left+Rt*.72983,F.bounds.top+Rt*.23),new ki(F.bounds.left+Rt*.84,F.bounds.top+Rt*.34085),new ki(F.bounds.left+Rt*.39363,F.bounds.top+Rt*.79)]),this.ctx.fillStyle=ns(FG),this.ctx.fill(),this.ctx.restore()):F.type===h9&&F.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(F.bounds.left+Rt/2,F.bounds.top+Rt/2,Rt/4,0,Math.PI*2,!0),this.ctx.fillStyle=ns(FG),this.ctx.fill(),this.ctx.restore())),BIe(F)&&F.value.length){switch(Kt=this.createFontStyle(ae),gn=Kt[0],Ti=Kt[1],di=this.fontMetrics.getMetrics(gn,Ti).baseline,this.ctx.font=gn,this.ctx.fillStyle=ns(ae.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=MIe(F.styles.textAlign),dr=x9(F),vi=0,F.styles.textAlign){case 1:vi+=dr.width/2;break;case 2:vi+=dr.width;break}Jr=dr.add(vi,0,0,-dr.height/2+1),this.ctx.save(),this.path([new ki(dr.left,dr.top),new ki(dr.left+dr.width,dr.top),new ki(dr.left+dr.width,dr.top+dr.height),new ki(dr.left,dr.top+dr.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new P4(F.value,Jr),ae.letterSpacing,di),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!Ha(F.styles.display,2048))return[3,20];if(F.styles.listStyleImage===null)return[3,19];if(ir=F.styles.listStyleImage,ir.type!==0)return[3,18];Yi=void 0,wo=ir.url,Mi.label=15;case 15:return Mi.trys.push([15,17,,18]),[4,this.context.cache.match(wo)];case 16:return Yi=Mi.sent(),this.ctx.drawImage(Yi,F.bounds.left-(Yi.width+10),F.bounds.top),[3,18];case 17:return Mi.sent(),this.context.logger.error("Error loading list-style-image "+wo),[3,18];case 18:return[3,20];case 19:U.listValue&&F.styles.listStyleType!==-1&&(gn=this.createFontStyle(ae)[0],this.ctx.font=gn,this.ctx.fillStyle=ns(ae.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",dr=new l(F.bounds.left,F.bounds.top+Ao(F.styles.paddingTop,F.bounds.width),F.bounds.width,hG(ae.lineHeight,ae.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new P4(U.listValue,dr),ae.letterSpacing,hG(ae.lineHeight,ae.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),Mi.label=20;case 20:return[2]}})})},R.prototype.renderStackContent=function(U){return o(this,void 0,void 0,function(){var F,X,ir,ae,Ee,ir,Ne,ze,ir,pt,xt,ir,Rt,Kt,ir,Ti,di,ir,vi,Jr,ir;return a(this,function(Yi){switch(Yi.label){case 0:if(Ha(U.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(U.element)];case 1:Yi.sent(),F=0,X=U.negativeZIndex,Yi.label=2;case 2:return F<X.length?(ir=X[F],[4,this.renderStack(ir)]):[3,5];case 3:Yi.sent(),Yi.label=4;case 4:return F++,[3,2];case 5:return[4,this.renderNodeContent(U.element)];case 6:Yi.sent(),ae=0,Ee=U.nonInlineLevel,Yi.label=7;case 7:return ae<Ee.length?(ir=Ee[ae],[4,this.renderNode(ir)]):[3,10];case 8:Yi.sent(),Yi.label=9;case 9:return ae++,[3,7];case 10:Ne=0,ze=U.nonPositionedFloats,Yi.label=11;case 11:return Ne<ze.length?(ir=ze[Ne],[4,this.renderStack(ir)]):[3,14];case 12:Yi.sent(),Yi.label=13;case 13:return Ne++,[3,11];case 14:pt=0,xt=U.nonPositionedInlineLevel,Yi.label=15;case 15:return pt<xt.length?(ir=xt[pt],[4,this.renderStack(ir)]):[3,18];case 16:Yi.sent(),Yi.label=17;case 17:return pt++,[3,15];case 18:Rt=0,Kt=U.inlineLevel,Yi.label=19;case 19:return Rt<Kt.length?(ir=Kt[Rt],[4,this.renderNode(ir)]):[3,22];case 20:Yi.sent(),Yi.label=21;case 21:return Rt++,[3,19];case 22:Ti=0,di=U.zeroOrAutoZIndexOrTransformedOrOpacity,Yi.label=23;case 23:return Ti<di.length?(ir=di[Ti],[4,this.renderStack(ir)]):[3,26];case 24:Yi.sent(),Yi.label=25;case 25:return Ti++,[3,23];case 26:vi=0,Jr=U.positiveZIndex,Yi.label=27;case 27:return vi<Jr.length?(ir=Jr[vi],[4,this.renderStack(ir)]):[3,30];case 28:Yi.sent(),Yi.label=29;case 29:return vi++,[3,27];case 30:return[2]}})})},R.prototype.mask=function(U){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(U.slice(0).reverse()),this.ctx.closePath()},R.prototype.path=function(U){this.ctx.beginPath(),this.formatPath(U),this.ctx.closePath()},R.prototype.formatPath=function(U){var F=this;U.forEach(function(X,ae){var Ee=vd(X)?X.start:X;ae===0?F.ctx.moveTo(Ee.x,Ee.y):F.ctx.lineTo(Ee.x,Ee.y),vd(X)&&F.ctx.bezierCurveTo(X.startControl.x,X.startControl.y,X.endControl.x,X.endControl.y,X.end.x,X.end.y)})},R.prototype.renderRepeat=function(U,F,X,ae){this.path(U),this.ctx.fillStyle=F,this.ctx.translate(X,ae),this.ctx.fill(),this.ctx.translate(-X,-ae)},R.prototype.resizeImage=function(U,F,X){if(U.width===F&&U.height===X)return U;var ae=(this.canvas.ownerDocument??document).createElement("canvas");return ae.width=Math.max(1,F),ae.height=Math.max(1,X),ae.getContext("2d").drawImage(U,0,0,U.width,U.height,0,0,F,X),ae},R.prototype.renderBackgroundImage=function(U){return o(this,void 0,void 0,function(){var F,X,ae,Ee,Ne,ze;return a(this,function(pt){switch(pt.label){case 0:F=U.styles.backgroundImage.length-1,X=function(xt){var Rt,Kt,Ti,el,Qu,Gu,Lo,Pc,Xr,di,el,Qu,Gu,Lo,Pc,vi,Jr,ir,Yi,wo,gn,dr,Mi,pn,Xr,Tr,el,Vu,fp,Lo,Pc,B9,Qu,Gu,lS,ym,E9,cS,dS,D4,uS,hS;return a(this,function(Cm){switch(Cm.label){case 0:if(xt.type!==0)return[3,5];Rt=void 0,Kt=xt.url,Cm.label=1;case 1:return Cm.trys.push([1,3,,4]),[4,ae.context.cache.match(Kt)];case 2:return Rt=Cm.sent(),[3,4];case 3:return Cm.sent(),ae.context.logger.error("Error loading background-image "+Kt),[3,4];case 4:return Rt&&(Ti=sS(U,F,[Rt.width,Rt.height,Rt.width/Rt.height]),el=Ti[0],Qu=Ti[1],Gu=Ti[2],Lo=Ti[3],Pc=Ti[4],Xr=ae.ctx.createPattern(ae.resizeImage(Rt,Lo,Pc),"repeat"),ae.renderRepeat(el,Xr,Qu,Gu)),[3,6];case 5:vBe(xt)?(di=sS(U,F,[null,null,null]),el=di[0],Qu=di[1],Gu=di[2],Lo=di[3],Pc=di[4],vi=pBe(xt.angle,Lo,Pc),Jr=vi[0],ir=vi[1],Yi=vi[2],wo=vi[3],gn=vi[4],dr=document.createElement("canvas"),dr.width=Lo,dr.height=Pc,Mi=dr.getContext("2d"),pn=Mi.createLinearGradient(ir,wo,Yi,gn),tG(xt.stops,Jr).forEach(function(R4){return pn.addColorStop(R4.stop,ns(R4.color))}),Mi.fillStyle=pn,Mi.fillRect(0,0,Lo,Pc),Lo>0&&Pc>0&&(Xr=ae.ctx.createPattern(dr,"repeat"),ae.renderRepeat(el,Xr,Qu,Gu))):wBe(xt)&&(Tr=sS(U,F,[null,null,null]),el=Tr[0],Vu=Tr[1],fp=Tr[2],Lo=Tr[3],Pc=Tr[4],B9=xt.position.length===0?[qA]:xt.position,Qu=Ao(B9[0],Lo),Gu=Ao(B9[B9.length-1],Pc),lS=ABe(xt,Qu,Gu,Lo,Pc),ym=lS[0],E9=lS[1],ym>0&&E9>0&&(cS=ae.ctx.createRadialGradient(Vu+Qu,fp+Gu,0,Vu+Qu,fp+Gu,ym),tG(xt.stops,ym*2).forEach(function(R4){return cS.addColorStop(R4.stop,ns(R4.color))}),ae.path(el),ae.ctx.fillStyle=cS,ym===E9?ae.ctx.fill():(dS=U.bounds.left+.5*U.bounds.width,D4=U.bounds.top+.5*U.bounds.height,uS=E9/ym,hS=1/uS,ae.ctx.save(),ae.ctx.translate(dS,D4),ae.ctx.transform(1,0,0,uS,0,0),ae.ctx.translate(-dS,-D4),ae.ctx.fillRect(Vu,hS*(fp-D4)+D4,Lo,Pc*hS),ae.ctx.restore()))),Cm.label=6;case 6:return F--,[2]}})},ae=this,Ee=0,Ne=U.styles.backgroundImage.slice(0).reverse(),pt.label=1;case 1:return Ee<Ne.length?(ze=Ne[Ee],[5,X(ze)]):[3,4];case 2:pt.sent(),pt.label=3;case 3:return Ee++,[3,1];case 4:return[2]}})})},R.prototype.renderSolidBorder=function(U,F,X){return o(this,void 0,void 0,function(){return a(this,function(ae){return this.path(uK(X,F)),this.ctx.fillStyle=ns(U),this.ctx.fill(),[2]})})},R.prototype.renderDoubleBorder=function(U,F,X,ae){return o(this,void 0,void 0,function(){var Ee,Ne;return a(this,function(ze){switch(ze.label){case 0:return F<3?[4,this.renderSolidBorder(U,X,ae)]:[3,2];case 1:return ze.sent(),[2];case 2:return Ee=AIe(ae,X),this.path(Ee),this.ctx.fillStyle=ns(U),this.ctx.fill(),Ne=fIe(ae,X),this.path(Ne),this.ctx.fill(),[2]}})})},R.prototype.renderNodeBackgroundAndBorders=function(U){return o(this,void 0,void 0,function(){var F,X,ae,Ee,Ne,ze,pt,xt,Rt=this;return a(this,function(Kt){switch(Kt.label){case 0:return this.applyEffects(U.getEffects(2)),F=U.container.styles,X=!zA(F.backgroundColor)||F.backgroundImage.length,ae=[{style:F.borderTopStyle,color:F.borderTopColor,width:F.borderTopWidth},{style:F.borderRightStyle,color:F.borderRightColor,width:F.borderRightWidth},{style:F.borderBottomStyle,color:F.borderBottomColor,width:F.borderBottomWidth},{style:F.borderLeftStyle,color:F.borderLeftColor,width:F.borderLeftWidth}],Ee=EIe(bm(F.backgroundClip,0),U.curves),X||F.boxShadow.length?(this.ctx.save(),this.path(Ee),this.ctx.clip(),zA(F.backgroundColor)||(this.ctx.fillStyle=ns(F.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(U.container)]):[3,2];case 1:Kt.sent(),this.ctx.restore(),F.boxShadow.slice(0).reverse().forEach(function(Ti){Rt.ctx.save();var di=w9(U.curves),vi=Ti.inset?0:xIe,Jr=hIe(di,-vi+(Ti.inset?1:-1)*Ti.spread.number,(Ti.inset?1:-1)*Ti.spread.number,Ti.spread.number*(Ti.inset?-2:2),Ti.spread.number*(Ti.inset?-2:2));Ti.inset?(Rt.path(di),Rt.ctx.clip(),Rt.mask(Jr)):(Rt.mask(di),Rt.ctx.clip(),Rt.path(Jr)),Rt.ctx.shadowOffsetX=Ti.offsetX.number+vi,Rt.ctx.shadowOffsetY=Ti.offsetY.number,Rt.ctx.shadowColor=ns(Ti.color),Rt.ctx.shadowBlur=Ti.blur.number,Rt.ctx.fillStyle=Ti.inset?ns(Ti.color):"rgba(0,0,0,1)",Rt.ctx.fill(),Rt.ctx.restore()}),Kt.label=2;case 2:Ne=0,ze=0,pt=ae,Kt.label=3;case 3:return ze<pt.length?(xt=pt[ze],xt.style!==0&&!zA(xt.color)&&xt.width>0?xt.style===2?[4,this.renderDashedDottedBorder(xt.color,xt.width,Ne,U.curves,2)]:[3,5]:[3,11]):[3,13];case 4:return Kt.sent(),[3,11];case 5:return xt.style===3?[4,this.renderDashedDottedBorder(xt.color,xt.width,Ne,U.curves,3)]:[3,7];case 6:return Kt.sent(),[3,11];case 7:return xt.style===4?[4,this.renderDoubleBorder(xt.color,xt.width,Ne,U.curves)]:[3,9];case 8:return Kt.sent(),[3,11];case 9:return[4,this.renderSolidBorder(xt.color,Ne,U.curves)];case 10:Kt.sent(),Kt.label=11;case 11:Ne++,Kt.label=12;case 12:return ze++,[3,3];case 13:return[2]}})})},R.prototype.renderDashedDottedBorder=function(U,F,X,ae,Ee){return o(this,void 0,void 0,function(){var Ne,ze,pt,xt,Rt,Kt,Ti,di,vi,Jr,ir,Yi,wo,gn,dr,Mi,dr,Mi;return a(this,function(pn){return this.ctx.save(),Ne=gIe(ae,X),ze=uK(ae,X),Ee===2&&(this.path(ze),this.ctx.clip()),vd(ze[0])?(pt=ze[0].start.x,xt=ze[0].start.y):(pt=ze[0].x,xt=ze[0].y),vd(ze[1])?(Rt=ze[1].end.x,Kt=ze[1].end.y):(Rt=ze[1].x,Kt=ze[1].y),Ti=Math.abs(X===0||X===2?pt-Rt:xt-Kt),this.ctx.beginPath(),Ee===3?this.formatPath(Ne):this.formatPath(ze.slice(0,2)),di=F<3?F*3:F*2,vi=F<3?F*2:F,Ee===3&&(di=F,vi=F),Jr=!0,Ti<=di*2?Jr=!1:Ti<=di*2+vi?(ir=Ti/(2*di+vi),di*=ir,vi*=ir):(Yi=Math.floor((Ti+vi)/(di+vi)),wo=(Ti-Yi*di)/(Yi-1),gn=(Ti-(Yi+1)*di)/Yi,vi=gn<=0||Math.abs(vi-wo)<Math.abs(vi-gn)?wo:gn),Jr&&(Ee===3?this.ctx.setLineDash([0,di+vi]):this.ctx.setLineDash([di,vi])),Ee===3?(this.ctx.lineCap="round",this.ctx.lineWidth=F):this.ctx.lineWidth=F*2+1.1,this.ctx.strokeStyle=ns(U),this.ctx.stroke(),this.ctx.setLineDash([]),Ee===2&&(vd(ze[0])&&(dr=ze[3],Mi=ze[0],this.ctx.beginPath(),this.formatPath([new ki(dr.end.x,dr.end.y),new ki(Mi.start.x,Mi.start.y)]),this.ctx.stroke()),vd(ze[1])&&(dr=ze[1],Mi=ze[2],this.ctx.beginPath(),this.formatPath([new ki(dr.end.x,dr.end.y),new ki(Mi.start.x,Mi.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},R.prototype.render=function(U){return o(this,void 0,void 0,function(){var F;return a(this,function(X){switch(X.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=ns(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),F=pIe(U),[4,this.renderStack(F)];case 1:return X.sent(),this.applyEffects([]),[2,this.canvas]}})})},R})(AK),BIe=function(_){return _ instanceof UG||_ instanceof jG?!0:_ instanceof YP&&_.type!==h9&&_.type!==u9},EIe=function(_,R){switch(_){case 0:return w9(R);case 2:return sIe(R);default:return b9(R)}},MIe=function(_){switch(_){case 1:return"center";case 2:return"right";default:return"left"}},IIe=["-apple-system","system-ui"],PIe=function(_){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?_.filter(function(R){return IIe.indexOf(R)===-1}):_},SIe=(function(_){r(R,_);function R(U,F){var X=_.call(this,U,F)||this;return X.canvas=F.canvas?F.canvas:document.createElement("canvas"),X.ctx=X.canvas.getContext("2d"),X.options=F,X.canvas.width=Math.floor(F.width*F.scale),X.canvas.height=Math.floor(F.height*F.scale),X.canvas.style.width=F.width+"px",X.canvas.style.height=F.height+"px",X.ctx.scale(X.options.scale,X.options.scale),X.ctx.translate(-F.x,-F.y),X.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+F.width+"x"+F.height+" at "+F.x+","+F.y+") with scale "+F.scale),X}return R.prototype.render=function(U){return o(this,void 0,void 0,function(){var F,X;return a(this,function(ae){switch(ae.label){case 0:return F=KP(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,U),[4,TIe(F)];case 1:return X=ae.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=ns(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(X,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},R})(AK),TIe=function(_){return new Promise(function(R,U){var F=new Image;F.onload=function(){R(F)},F.onerror=U,F.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(_))})},DIe=(function(){function _(R){var U=R.id,F=R.enabled;this.id=U,this.enabled=F,this.start=Date.now()}return _.prototype.debug=function(){var R=[...arguments];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,s([this.id,this.getTime()+"ms"],R)):this.info.apply(this,R))},_.prototype.getTime=function(){return Date.now()-this.start},_.prototype.info=function(){var R=[...arguments];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,s([this.id,this.getTime()+"ms"],R))},_.prototype.warn=function(){var R=[...arguments];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,s([this.id,this.getTime()+"ms"],R)):this.info.apply(this,R))},_.prototype.error=function(){var R=[...arguments];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,s([this.id,this.getTime()+"ms"],R)):this.info.apply(this,R))},_.instances={},_})(),RIe=(function(){function _(R,U){this.windowBounds=U,this.instanceName="#"+_.instanceCount++,this.logger=new DIe({id:this.instanceName,enabled:R.logging}),this.cache=R.cache??new $Me(this,R)}return _.instanceCount=1,_})(),LIe=function(_,R){return R===void 0&&(R={}),_Ie(_,R)};typeof window<"u"&&oK.setContext(window);var _Ie=function(_,R){return o(void 0,void 0,void 0,function(){var U,F,X,ae,Ee,Ne,ze,pt,xt,Rt,Kt,Ti,di,vi,Jr,ir,Yi,wo,gn,dr,pn,Mi,pn;return a(this,function(Xr){switch(Xr.label){case 0:if(!_||typeof _!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(U=_.ownerDocument,!U)throw Error("Element is not attached to a Document");if(F=U.defaultView,!F)throw Error("Document is not attached to a Window");return X={allowTaint:R.allowTaint??!1,imageTimeout:R.imageTimeout??15e3,proxy:R.proxy,useCORS:R.useCORS??!1},ae=n({logging:R.logging??!0,cache:R.cache},X),Ee={windowWidth:R.windowWidth??F.innerWidth,windowHeight:R.windowHeight??F.innerHeight,scrollX:R.scrollX??F.pageXOffset,scrollY:R.scrollY??F.pageYOffset},Ne=new l(Ee.scrollX,Ee.scrollY,Ee.windowWidth,Ee.windowHeight),ze=new RIe(ae,Ne),pt=R.foreignObjectRendering??!1,xt={allowTaint:R.allowTaint??!1,onclone:R.onclone,ignoreElements:R.ignoreElements,inlineImages:pt,copyStyles:pt},ze.logger.debug("Starting document clone with size "+Ne.width+"x"+Ne.height+" scrolled to "+-Ne.left+","+-Ne.top),Rt=new rK(ze,_,xt),Kt=Rt.clonedReferenceElement,Kt?[4,Rt.toIFrame(U,Ne)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return Ti=Xr.sent(),di=XP(Kt)||FMe(Kt)?d(Kt.ownerDocument):c(ze,Kt),vi=di.width,Jr=di.height,ir=di.left,Yi=di.top,wo=FIe(ze,Kt,R.backgroundColor),gn={canvas:R.canvas,backgroundColor:wo,scale:R.scale??F.devicePixelRatio??1,x:(R.x??0)+ir,y:(R.y??0)+Yi,width:R.width??Math.ceil(vi),height:R.height??Math.ceil(Jr)},pt?(ze.logger.debug("Document cloned, using foreign object rendering"),pn=new SIe(ze,gn),[4,pn.render(Kt)]):[3,3];case 2:return dr=Xr.sent(),[3,5];case 3:return ze.logger.debug("Document cloned, element located at "+ir+","+Yi+" with size "+vi+"x"+Jr+" using computed rendering"),ze.logger.debug("Starting DOM parsing"),Mi=qG(ze,Kt),wo===Mi.styles.backgroundColor&&(Mi.styles.backgroundColor=pp.TRANSPARENT),ze.logger.debug("Starting renderer for element at "+gn.x+","+gn.y+" with size "+gn.width+"x"+gn.height),pn=new kIe(ze,gn),[4,pn.render(Mi)];case 4:dr=Xr.sent(),Xr.label=5;case 5:return(R.removeContainer??!0)&&(rK.destroy(Ti)||ze.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),ze.logger.debug("Finished rendering"),[2,dr]}})})},FIe=function(_,R,U){var F=R.ownerDocument,X=F.documentElement?E4(_,getComputedStyle(F.documentElement).backgroundColor):pp.TRANSPARENT,ae=F.body?E4(_,getComputedStyle(F.body).backgroundColor):pp.TRANSPARENT,Ee=typeof U=="string"?E4(_,U):U===null?pp.TRANSPARENT:4294967295;return R===F.documentElement?zA(X)?zA(ae)?Ee:ae:X:Ee};return LIe}))}))(),1);async function Yk(e){let t=!1,i,r;document.fullscreenElement===e&&(t=!0,i=e.style.width,r=e.style.height,e.style.width="100vw",e.style.height="100vh");let n=await(0,Jk.default)(e);return t&&(e.style.width=i,e.style.height=r),n.toDataURL()}var Z7t={props:{elements:{type:Array,required:!0},shortcuts:{type:Array,required:!0}}},X7t={class:"shortcuts-modal"},$7t={class:"shortcuts-modal__title"},eyt={class:"shortcuts-modal__content"},tyt={class:"shortcuts-modal__content-left"},iyt={class:"shortcuts-modal__content-left__element__image"},ryt={class:"shortcuts-modal__content-left__element__text"},nyt={class:"shortcuts-modal__content-right"},oyt={class:"shortcuts-modal__content-right__element__shortcut"},ayt={key:0,class:"letter"},syt={key:1,class:"flex items-center"},lyt={class:"maj"},cyt={class:"icon"},dyt={key:2,class:"flex items-center"},uyt={class:"icon"},hyt={key:3,class:"flex items-center"},pyt={class:"icon"},Ayt={class:"shortcuts-modal__content-right__element__text"},fyt={class:"shortcuts-modal__footer"};function gyt(e,t,i,r,n,o){let a=T("BIMDataIllustration"),s=T("BIMDataIconAlt"),l=T("BIMDataButton");return M(),q("div",X7t,[x("div",$7t,[x("span",null,[Yt(e.$slots,"title",{},void 0,!0)])]),x("div",eyt,[x("div",tyt,[(M(!0),q(It,null,pi(i.elements,c=>(M(),q("div",{key:c.title,class:"shortcuts-modal__content-left__element"},[x("div",iyt,[L(a,{name:c.image,x:"200",y:"200"},null,8,["name"])]),x("div",ryt,[x("h3",null,ee(c.title),1),x("p",null,ee(c.text),1)])]))),128))]),x("div",nyt,[(M(!0),q(It,null,pi(i.shortcuts,c=>(M(),q("div",{key:c.text,class:"shortcuts-modal__content-right__element"},[x("div",oyt,[c.letter?(M(),q("span",ayt,ee(c.letter),1)):xe("",!0),c.maj?(M(),q("div",syt,[x("span",lyt,[L(s,{size:"xxs",class:"fill-primary"})]),t[1]||=x("span",{class:"more"},"+",-1),x("div",cyt,[L(a,{name:c.illustration,x:"23",y:"30"},null,8,["name"])])])):xe("",!0),c.alt?(M(),q("div",dyt,[t[2]||=x("span",{class:"alt"}," alt ",-1),t[3]||=x("span",{class:"more"},"+",-1),x("div",uyt,[L(a,{name:c.illustration,x:"23",y:"30"},null,8,["name"])])])):xe("",!0),c.shift?(M(),q("div",hyt,[t[4]||=x("span",{class:"alt"}," shift ",-1),t[5]||=x("span",{class:"more"},"+",-1),x("div",pyt,[L(a,{name:c.illustration,x:"23",y:"30"},null,8,["name"])])])):xe("",!0)]),x("div",Ayt,ee(c.text),1)]))),128))])]),x("div",fyt,[L(l,{fill:"",color:"primary",radius:"",width:"166px",onClick:t[0]||=c=>e.$emit("close")},{default:K(()=>[wt(ee(e.$t("shortcuts-helper.btn")),1)]),_:1})])])}var Zk=W(Z7t,[["render",gyt],["__scopeId","data-v-e7d92a04"]]),myt={components:{ShortcutsModal:Zk},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 vyt(e,t,i,r,n,o){let a=T("ShortcutsModal");return M(),ie(a,{class:"bimdata-shortcuts2d-helper",elements:n.elements,shortcuts:n.shortcuts},{title:K(()=>[wt(ee(e.$t("shortcuts-helper.title_modal_2d")),1)]),_:1},8,["elements","shortcuts"])}var wyt=W(myt,[["render",vyt],["__scopeId","data-v-9a9c15e3"]]);function Xk(e=null){let t=Ot("$viewer");e??=t.localContext;let i=Lr(Array.from(t.state.annotations)),r=[t.state.hub.on("annotation-added",({annotation:n})=>{i.value.push(n),t0(i)}),t.state.hub.on("annotation-updated",()=>{t0(i)}),t.state.hub.on("annotation-removed",({annotation:n})=>{i.value=i.value.filter(o=>o.id!==n.id)})];return Yr(()=>r.forEach(n=>t.state.hub.off(n))),ot(()=>i.value.filter(n=>n.modelIds.length===0?!0:n.modelIds.some(o=>e.loadedModelIds.includes(o))))}var XU=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)},$k=W({__name:"AnnotationWrapper",props:{annotation:{type:Object,required:!0},canvas:{type:HTMLCanvasElement,required:!0}},emits:["annotation-drag"],setup(e,{emit:t}){let i=e,r=t,n=De(null),o=()=>n.value?.querySelector(i.annotation.grabberSelector)??n.value,a=XU(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),r("annotation-drag",u),i.annotation.emit("drag",{nativeEvent:u}),s=!0)};return Cr(()=>{o()?.addEventListener("mousedown",l),o()?.addEventListener("touchstart",l,{passive:!1})}),ou(()=>{o()?.removeEventListener("mousedown",l),o()?.removeEventListener("touchstart",l)}),(u,h)=>(M(),q("div",{ref_key:"wrapper",ref:n,class:"annotation-wrapper",onWheel:h[0]||=(...p)=>Ft(a)&&Ft(a)(...p)},[(M(),ie(oo(e.annotation.component),Pl(e.annotation.props,{annotation:e.annotation}),null,16,["annotation"]))],544))}},[["__scopeId","data-v-840c20b2"]]),byt={class:"annotations-2d"},$U=W({__name:"Annotations2D",props:{context:{type:Object,default:null}},setup(e){let t=e,i=Ot("$viewer"),r=t.context;r||=i.localContext;let n=r.viewer,o=n.viewer??n.engine,a=o.canvas,s=Xk(r),l=ot(()=>s.value.filter(u=>!n.selectedStorey||u.z>=n.selectedStorey.absoluteElevation&&u.z<n.selectedStorey.absoluteTopElevation));o.camera.on("update",()=>t0(s));let c=(u,h)=>{let{x:p,y:A}=a.getBoundingClientRect(),{clientX:f,clientY:m}=h,{x:g,y:w}=o.camera.getPosition({x:f-p,y:m-A});n.ui?.highlightOnHover===!0&&(n.ui.highlightOnHover=!1,setTimeout(()=>n.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:w})},d=u=>{let{x:h,y:p}=o.camera.getCanvasPosition(u);return`left: ${h}px; top: ${p}px;`};return(u,h)=>(M(),q("div",byt,[(M(!0),q(It,null,pi(l.value,p=>(M(),ie($k,{key:p.instanceId,annotation:p,canvas:Ft(a),style:je(d(p)),onAnnotationDrag:A=>c(p,A)},null,8,["annotation","canvas","style","onAnnotationDrag"]))),128))]))}},[["__scopeId","data-v-87f776fe"]]),yyt={props:{autoOpen:{type:Boolean,default:!0}},setup(e){let{localContext:t}=Ot("$viewer"),i=t.viewer?.plugin.name,r=De(!0),n=ot(()=>t.loadedModels),o=De(0),a=ot(()=>n.value[o.value]||{storeys:[]}),s=ot(()=>t.selectedStorey),l=De(!1),c=()=>{l.value=!l.value},d=g=>g.key===s.value?.key,u=g=>{d(g)||t.selectStorey(g)},h=ot(()=>t.shownPlans),p=g=>h.value.some(w=>w.key===g.key),{loadingPlans:A}=qie(t),f=g=>A.value.some(w=>w.key===g.key),m=$o(new Set);return Qt([n,a],()=>{n.value.length===0||n.value.length===1&&a.value.type!=="METABUILDING"&&a.value.storeys.length<2&&(a.value.storeys[0]?.plans.length??0)===0?r.value=!1:r.value=!0,r.value&&(i==="viewer2d"||i==="plan"||i==="photosphere")&&(l.value=e.autoOpen)},{immediate:!0}),{currentModelIndex:o,currentModel:a,storeyPlanShown:m,storeyListOpen:l,isVisible:r,models:n,focus:()=>{a.value&&(l.value||=!0,s.value&&m.add(s.value.uuid))},selectStorey:u,togglePlan:g=>{h.value.some(w=>w.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:p,isPlanLoading:f}}},Cyt={class:"storey-selector"},xyt={class:"storey-selector__list"},kyt=["onClick"],Byt={class:"name"},Eyt={class:"count"},Myt={class:"storey-selector__list__entry__content plan-selector__list"},Iyt=["onClick"],Pyt={key:0,class:"loader"},Syt={class:"storey-selector__model-switcher"},Tyt={class:"actions"};function Dyt(e,t,i,r,n,o){let a=T("BIMDataRadio"),s=T("BIMDataIconStorey"),l=T("BIMDataTextbox"),c=T("BIMDataIconChevron"),d=T("BIMDataButton"),u=T("BIMDataCheckbox"),h=T("BIMDataSpinner"),p=T("BIMDataFileIcon");return M(),q("div",Cyt,[L(Hr,{name:"slide-fade-down"},{default:K(()=>[ti(x("div",xyt,[(M(!0),q(It,null,pi(r.currentModel.storeys.slice(),A=>(M(),q("div",{key:A.key,class:"storey-selector__list__entry"},[L(a,{"model-value":r.isStoreySelected(A),"onUpdate:modelValue":f=>r.selectStorey(A)},null,8,["model-value","onUpdate:modelValue"]),x("div",{class:"storey-selector__list__entry__line",onClick:f=>r.selectStorey(A)},[L(s,{size:"xs"}),x("span",Byt,[L(l,{text:A.name},null,8,["text"])]),A.plans.length>0?(M(),q(It,{key:0},[x("span",Eyt,ee(A.plans.length),1),L(d,{width:"26px",height:"26px",ghost:"",rounded:"",icon:"",onClick:ei(f=>r.togglePlansList(A),["stop"])},{default:K(()=>[L(c,{size:"xxs",rotate:r.storeyPlanShown.has(A.key)?90:0,style:{transition:"transform 0.1s linear"}},null,8,["rotate"])]),_:2},1032,["onClick"])],64)):xe("",!0)],8,kyt),L(Hr,{name:"slide-fade-up"},{default:K(()=>[ti(x("div",Myt,[(M(!0),q(It,null,pi(A.plans,f=>(M(),q("div",{key:`${f.key}`,class:"plan-selector__list__entry"},[L(u,{class:"plan-selector__list__entry__checkbox",disabled:!r.isStoreySelected(A)||r.isPlanLoading(f),"model-value":r.isPlanShown(f),"onUpdate:modelValue":m=>r.togglePlan(f)},null,8,["disabled","model-value","onUpdate:modelValue"]),x("div",{class:"plan-selector__list__entry__line",style:{cursor:"pointer"},onClick:ei(m=>{r.isStoreySelected(A)&&!r.isPlanLoading(f)&&r.togglePlan(f)},["stop"])},[r.isPlanLoading(f)?(M(),q("span",Pyt,[L(h)])):(M(),ie(p,{key:1,"file-name":f.plan.document?.file_name||f.plan.name,size:14},null,8,["file-name"])),L(l,{"max-width":"200px",text:f.plan.name},null,8,["text"])],8,Iyt)]))),128))],512),[[zi,r.storeyPlanShown.has(A.key)]])]),_:2},1024)]))),128))],512),[[zi,r.storeyListOpen&&r.isVisible]])]),_:1}),ti(x("div",Syt,[L(d,{width:"26px",height:"26px",ghost:"",radius:"",icon:"",disabled:r.currentModel.storeys.length===0,onClick:r.toggleStoreysList},{default:K(()=>[L(c,{size:"xxs",rotate:r.storeyListOpen?-90:0,style:{transition:"transform 0.1s linear"}},null,8,["rotate"])]),_:1},8,["disabled","onClick"]),x("span",{class:"name",onClick:t[0]||=(...A)=>r.toggleStoreysList&&r.toggleStoreysList(...A)},[L(l,{text:r.currentModel.name,"tooltip-position":"top"},null,8,["text"])]),x("span",Tyt,[L(d,{width:"26px",height:"26px",ghost:"",rounded:"",icon:"",disabled:r.currentModelIndex===0,onClick:t[1]||=A=>r.currentModelIndex--},{default:K(()=>[L(c,{size:"xxs",rotate:180})]),_:1},8,["disabled"]),L(d,{width:"26px",height:"26px",ghost:"",rounded:"",icon:"",disabled:r.currentModelIndex===r.models.length-1,onClick:t[2]||=A=>r.currentModelIndex++},{default:K(()=>[L(c,{size:"xxs"})]),_:1},8,["disabled"])])],512),[[zi,r.isVisible]])])}var eO=W(yyt,[["render",Dyt],["__scopeId","data-v-c590c341"]]),Ryt={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 Lyt(e,t,i,r,n,o){return M(),q("div",{class:"bimdata-help-shortcuts",onClick:t[0]||=(...a)=>o.onClick&&o.onClick(...a)},"?")}var eB=W(Ryt,[["render",Lyt],["__scopeId","data-v-78103e0c"]]);function tB(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 r=lh(),{lineWidth:n=1,lineColor:o=r,lineOpacity:a=1,fill:s=r,fillOpacity:l=.2}=i,c=e.scene.addObject({shapes:[{style:{lineWidth:n,lineColor:o,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 _yt={name:"Viewer2D",components:{Annotations:$U,BIMDataStoreySelector:eO,Help:eB},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=wyt,this.localContextSubscriptions=[],this.stateSubscriptions=[],this.queue=Rv(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=y2({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=J7t(this),this.plugins=KU(this),this.unsubscribe=K7t(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||=Y7t(this.viewer),this.camera3DSubscription=this.$viewer.globalContext.hub.on("3d-camera-update",i=>{let{eye:r,look:n,up:o}=i;this.syncRotationFrom3DCamera(r,n,o);let[a,,s]=r,[l,,c]=n;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:r,sub:n,normalize:o}=this.viewer.utils.vector2D,[a,,s]=e,[l,,c]=t,d=o(n({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?r(d,{x:0,y:1}):r({x:0,y:1},d);let h=i[1]>0?180:0,p=u/Math.PI*180+h;this.viewer.camera.setViewpoint({rotation:p})},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:r=>{let{clientX:n,clientY:o}=r,{x:a,y:s}=this.viewer.canvas.getBoundingClientRect(),l=this.viewer.camera.getPosition({x:n-a,y:o-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||=Gk(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((r,n)=>{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 o={model:i,ifc:i,plugin:this};if(this.$viewer.localContext.hub.emit("2d-model-loaded",o),this.$viewer.globalContext.hub.emit("2d-model-loaded",o),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])}r()}catch(o){n(o)}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],r=()=>{if(this.$viewer.localContext.selectStorey(null),this.model=null,this.viewer.scene.removeModel(String(i.id))){let n={model:i,ifc:i,plugin:this};return this.$viewer.localContext.hub.emit("2d-model-unloaded",n),this.$viewer.globalContext.hub.emit("2d-model-unloaded",n),!0}else return!1};t?this.queue.push(r):r()},async getSnapshot(){return{snapshot_type:"png",snapshot_data:await Yk(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:r}=e.orthogonal_camera,n=this.$viewer.state.getStoreyFromAbsoluteElevation(this.model,t.z);this.$viewer.localContext.selectStorey(n);let o=this.viewer.utils.vector2D.angle({x:1,y:0},i);this.viewer.camera.setViewpoint({...t,rotation:-(o/Math.PI)*180,zoom:r})},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:r}=this.viewer.camera.getPosition(t),n=this.selectedStorey,o=this.viewer.picker.pick(t),a=this.$viewer.state.objectsMap.get(+o?.id)??null;e({x:i,y:r,z:n.absoluteElevation,models:this.$viewer.localContext.loadedModels,storey:n,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 tB(this.viewer,e,t)}}},Fyt={class:"bimdata-viewer2d"},jyt={ref:"canvas",class:"bimdata-viewer2d__viewer__canvas"},Uyt={ref:"texter",style:{position:"absolute",top:"0px",left:"0px"}},Oyt={class:"bimdata-viewer2d__header"};function Hyt(e,t,i,r,n,o){let a=T("Annotations"),s=T("NoModelWindowPlaceHolder"),l=T("ModelsLoader"),c=T("Help"),d=T("BIMDataStoreySelector");return M(),q("div",Fyt,[x("canvas",jyt,null,512),x("div",Uyt,null,512),e.engine2dCreated?(M(),ie(a,{key:0})):xe("",!0),!e.ifc&&!e.loading?(M(),ie(s,{key:1})):xe("",!0),x("div",Oyt,[e.settings.modelLoader==="disabled"?xe("",!0):ti((M(),ie(l,{key:0,ref:"header","window-positioning":!1},null,512)),[[zi,e.modelHeaderShown]]),e.helpShown?(M(),ie(c,{key:1,modal:e.helpModal,name:"2D"},null,8,["modal"])):xe("",!0)]),ti(L(d,{ref:"storeySelector","auto-open":e.storeySelectorAutoOpen},null,8,["auto-open"]),[[zi,e.storeySelectorShown]])])}var qyt={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:W(_yt,[["render",Hyt],["__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}},Nyt="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",zyt={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:Nyt,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:r,clientY:n}=i,{x:o,y:a}=this.$el.getBoundingClientRect();this.elPosition={x:o,y:a},this.container&&(this.containerRect=this.container.getBoundingClientRect()),this.cursorTranslate={x:r-o,y:n-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:r,height:n}=this.containerRect;for(;this.cursorTranslate.x+this.elPosition.x-t>r;)this.cursorTranslate.x-=r;for(;this.cursorTranslate.x+this.elPosition.x<t;)this.cursorTranslate.x+=r;for(;this.cursorTranslate.y+this.elPosition.y-i>n;)this.cursorTranslate.y-=n;for(;this.cursorTranslate.y+this.elPosition.y<i;)this.cursorTranslate.y+=n}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()}}},Vyt=["value","disabled"],Qyt=["src"];function Gyt(e,t,i,r,n,o){let a=Mr("click-away");return ti((M(),q("div",{class:Ue(["bimdata-numerical-input",{"bimdata-numerical-input--focus":n.focused}]),onMousedown:t[3]||=(...s)=>o.onMouseDown&&o.onMouseDown(...s)},[ti(x("span",{ref:"label",class:"bimdata-numerical-input__label",style:je(`width: ${i.labelWidth}`)},ee(i.label),5),[[zi,i.label]]),x("input",{ref:"input",class:Ue(["bimdata-numerical-input__input",{"bimdata-numerical-input__input--centered":i.centered}]),value:`${o.fixedValue}${i.unit}`,disabled:i.disabled,onChange:t[0]||=(...s)=>o.onChange&&o.onChange(...s),onFocus:t[1]||=(...s)=>o.onFocus&&o.onFocus(...s),onBlur:t[2]||=(...s)=>o.onBlur&&o.onBlur(...s)},null,42,Vyt),n.grabbing?(M(),q("div",{key:0,class:"bimdata-numerical-input__cursor",style:je(o.cursorTransform)},[x("img",{src:n.cursor,style:{transform:"translate(-50%, -50%)"}},null,8,Qyt)],4)):xe("",!0)],34)),[[a,o.away]])}var Pfe=W(zyt,[["render",Gyt],["__scopeId","data-v-7438b65a"]]),Kyt={components:{BIMDataNumericalInput:Pfe},setup(){let e=Ot("$viewer"),t=Ot("root"),i=ot(()=>t.editedBitmap?t.editedBitmap:{x:0,y:0,scale:0,angle:0,opacity:0}),r=Wyt(i);return{root:t,bitmap:i,...r,submit:async()=>{try{if(t.loading=!0,t.editedBitmap.plan){let{x:o,y:a,scale:s,angle:l,opacity:c,plan:d}=t.editedBitmap,u={...d.plan.transform};Object.assign(d.plan.transform,{translate:[o,a],rotate:l,scale:s,opacity:c}),await e.state.updatePlan(d,u)}else{let{x:o,y:a,angle:s,scale:l,opacity:c}=i.value,d={translate:[o??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(o){console.error(o)}finally{t.loading=!1}}}}};function Wyt(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,r])=>{t[i]=ot({get:()=>e.value[i],set:n=>e.value[i]=r(n)})}),t}var Jyt={class:"viewer2d-background__page__edit"},Yyt={class:"viewer2d-background__page__edit__content"},Zyt={class:"viewer2d-background__page__edit__content__unit-group"},Xyt={class:"viewer2d-background__page__edit__content__unit-group__element"},$yt={class:"viewer2d-background__page__edit__content__unit-group__element"},eCt={class:"viewer2d-background__page__edit__content__unit-group__element"},tCt={class:"viewer2d-background__page__edit__content__unit"},iCt={class:"viewer2d-background__page__edit__content__unit"},rCt={class:"viewer2d-background__page__edit__content__img"},nCt=["src"],oCt={class:"viewer2d-background__page__edit__validate"};function aCt(e,t,i,r,n,o){let a=T("BIMDataNumericalInput"),s=T("BIMDataSlider"),l=T("BIMDataTextbox"),c=T("BIMDataButton");return M(),q("div",Jyt,[x("div",Yyt,[x("section",null,[x("span",null,ee(e.$t("viewer2d-background.location")),1),x("div",Zyt,[x("div",Xyt,[L(a,{modelValue:e.x,"onUpdate:modelValue":t[0]||=d=>e.x=d,label:"X",container:e.$viewer.localContext.el},null,8,["modelValue","container"])]),x("div",$yt,[L(a,{modelValue:e.y,"onUpdate:modelValue":t[1]||=d=>e.y=d,label:"Y",container:e.$viewer.localContext.el},null,8,["modelValue","container"])]),x("div",eCt,[L(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"])])])]),x("section",null,[x("span",null,ee(e.$t("viewer2d-background.rotation")),1),x("div",tCt,[L(a,{modelValue:e.angle,"onUpdate:modelValue":t[3]||=d=>e.angle=d,unit:"\xB0",centered:""},null,8,["modelValue"]),L(s,{modelValue:e.angle,"onUpdate:modelValue":t[4]||=d=>e.angle=d,min:0,max:360},null,8,["modelValue"])])]),x("section",null,[x("span",null,ee(e.$t("viewer2d-background.alpha")),1),x("div",iCt,[L(a,{modelValue:e.opacity,"onUpdate:modelValue":t[5]||=d=>e.opacity=d,centered:""},null,8,["modelValue"]),L(s,{modelValue:e.opacity,"onUpdate:modelValue":t[6]||=d=>e.opacity=d,min:0,max:1,step:.01},null,8,["modelValue"])])]),x("section",null,[x("span",null,ee(e.$t("viewer2d-background.preview")),1),x("div",rCt,[x("img",{src:r.bitmap.dataUrl,alt:"Background"},null,8,nCt),L(l,{text:r.bitmap.name,class:"viewer2d-background__page__edit__content__img__name"},null,8,["text"])])])]),x("div",oCt,[L(c,{width:"100%",color:"primary",fill:"",radius:"",onClick:r.submit},{default:K(()=>[wt(ee(r.bitmap&&r.bitmap.plan?e.$t("global.save"):e.$t("global.validate")),1)]),_:1},8,["onClick"])])])}var sCt=W(Kyt,[["render",aCt],["__scopeId","data-v-a022440a"]]);function Sfe(e,t){let i=t.anchorSynchronization===!0&&e.windowManager.registeredWindows.has("anchor-synchronization");return{anchorSynchronizationWindowAvailable:i,openAnchorSynchronizationWindow:async({model:r,storey:n,modelToSynchronize:o})=>{if(!i)throw Error("Anchor Synchronization window is not registered");if(!r||!o)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 On(),e.globalContext.localContexts[0].plugins.get("anchor-synchronization-window").synchronize(r,n,o)}}}var lCt={components:{BIMDataGED:wy},setup(){let e=Ot("viewer2d"),t=Ot("root"),i=Ot("$plugin"),r=e.$viewer,{openAnchorSynchronizationWindow:n,anchorSynchronizationWindowAvailable:o}=Sfe(r,i),a=De(null);return{root:t,selectedDocument:a,submit:async()=>{try{t.loading=!0;let s=a.value,l=await r.api.createModel(s.id);if(l=await r.api.waitForModelProcess(l),o){let c=r.state.modelsMap.get(l.id);if(c||=(await r.state.loadModels([l.id],{silent:!0}))[0],!c)throw Error("Plan model not found");await n({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,h={translate:[c,d],rotate:u,scale:1,opacity:1},p=await e.plugins.bitmaps.createBitmap(s,{plan:l},h);p.plan=null,p.edited=!0,t.editedBitmap=p,t.page="edit"}}catch(s){console.error(s),t.page="home"}finally{a.value=null,t.loading=!1}}}}},cCt={class:"viewer2d-background__page__ged"},dCt={class:"viewer2d-background__page__ged__button"};function uCt(e,t,i,r,n,o){let a=T("BIMDataGED"),s=T("BIMDataButton");return M(),q("div",cCt,[L(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=>r.selectedDocument=l[0]},null,512),x("div",dCt,[L(s,{width:"100%",height:"32px",color:"primary",fill:"",radius:"",disabled:!r.selectedDocument,onClick:r.submit},{default:K(()=>[wt(ee(e.$t("global.validate")),1)]),_:1},8,["disabled","onClick"])])])}var hCt=W(lCt,[["render",uCt],["__scopeId","data-v-d1ac46ef"]]),pCt={setup(){let e=Ot("$viewer"),t=Ot("$plugin"),i=Ot("viewer2d"),r=Ot("root"),{openAnchorSynchronizationWindow:n,anchorSynchronizationWindowAvailable:o}=Sfe(e,t),a=De(null);return{root:r,menuIndexDisplayed:a,toggleMenu:s=>{a.value=a.value===s?null:s},closeMenu:s=>{a.value===s&&(a.value=null)},onCreateClick:()=>{r.page="bond"},onEditClick:async s=>{try{if(r.loading=!0,r.selectedStorey!==s.storey&&e.localContext.selectStorey(s.storey),o){let l=e.state.modelsMap.get(s.plan.id);l||=(await e.state.loadModels([s.plan.id],{silent:!0}))[0],n({model:s.model,storey:s.storey,modelToSynchronize:l})}else await i.plugins.bitmaps.showPlan(s),r.editedBitmap=i.plugins.bitmaps.getBitmap(s),r.page="edit"}catch(l){console.error(l)}finally{r.loading=!1}},onDeleteClick:async s=>{try{r.loading=!0,await e.state.deletePlan(s)}catch(l){console.error(l)}finally{r.loading=!1}}}}},ACt={class:"viewer2d-background__page__home"},fCt={class:"viewer2d-background__page__home__description"},gCt={class:"viewer2d-background__page__home__list"},mCt={class:"viewer2d-background__page__home__list__element__icon"},vCt={class:"viewer2d-background__page__home__list__element__labels"},wCt={key:0,class:"viewer2d-background__page__home__list__element__menu"},bCt={key:0,class:"viewer2d-background__page__home__list__element__menu__menu"};function yCt(e,t,i,r,n,o){let a=T("BIMDataButton"),s=T("BIMDataIconSynchro2D"),l=T("BIMDataTextbox"),c=T("BIMDataIconEllipsis"),d=Mr("click-away");return M(),q("div",ACt,[x("div",fCt,ee(e.$t("viewer2d-background.description")),1),L(a,{class:"viewer2d-background__page__home__button",color:"primary",fill:"",radius:"",width:"60%",disabled:!e.$viewer.api.permissions.hasModelWritePermission||r.root.storeys.length===0,onClick:r.onCreateClick},{default:K(()=>[r.root.storeys.length===0?(M(),q(It,{key:0},[wt(ee(e.$t("viewer2d-background.no_ifc")),1)],64)):r.root.storeys.length>0?(M(),q(It,{key:1},[wt(ee(e.$t("global.new")),1)],64)):(M(),q(It,{key:2},[wt(ee(e.$t("viewer2d-background.start")),1)],64))]),_:1},8,["disabled","onClick"]),x("ul",gCt,[(M(!0),q(It,null,pi(r.root.plans,u=>(M(),q("li",{key:`${u.key}`,class:"viewer2d-background__page__home__list__element"},[x("div",mCt,[L(s,{size:"m",fill:"",color:"primary"})]),x("div",vCt,[L(l,{class:"viewer2d-background__page__home__list__element__labels__storey",text:u.storey.name},null,8,["text"]),L(l,{class:"viewer2d-background__page__home__list__element__labels__plan",text:u.plan.name},null,8,["text"])]),e.$viewer.api.permissions.hasModelWritePermission?ti((M(),q("div",wCt,[L(a,{color:"granite",ghost:"",rounded:"",icon:"",onClick:h=>r.toggleMenu(u.key)},{default:K(()=>[L(c,{size:"l"}),r.menuIndexDisplayed===u.key?(M(),q("div",bCt,[L(a,{width:"100%",color:"granite",ghost:"",square:"",onClick:h=>r.onEditClick(u)},{default:K(()=>[wt(ee(e.$t("global.edit")),1)]),_:1},8,["onClick"]),L(a,{width:"100%",color:"granite",ghost:"",square:"",onClick:h=>r.onDeleteClick(u)},{default:K(()=>[x("div",null,ee(e.$t("global.delete")),1)]),_:1},8,["onClick"])])):xe("",!0)]),_:2},1032,["onClick"])])),[[d,()=>r.closeMenu(u.key)]]):xe("",!0)]))),128))])])}var CCt=W(pCt,[["render",yCt],["__scopeId","data-v-ee47f509"]]),xCt={setup(){let e=Ot("$viewer");return{root:Ot("root"),selectStorey:t=>{e.localContext.selectStorey(t)}}}},kCt={class:"viewer2d-background__page__bond"},BCt={class:"viewer2d-background__page__bond__list-title"},ECt={class:"viewer2d-background__page__bond__list-title"};function MCt(e,t,i,r,n,o){let a=T("BIMDataDropdownList"),s=T("BIMDataButton");return M(),q("div",kCt,[x("div",null,[x("div",BCt," 1 - "+ee(e.$t("viewer2d-background.select_storey")),1),L(a,{width:"100%",list:r.root.storeys,"per-page":20,"element-key":"id","close-on-element-click":"",class:"viewer2d-background__page__bond__storeys",onElementClick:t[0]||=l=>r.selectStorey(l)},{header:K(()=>[wt(ee(r.root.selectedStorey?r.root.selectedStorey.name:e.$t("viewer2d-background.select_storey")),1)]),element:K(({element:l})=>[x("span",{class:Ue({"viewer2d-background__page__bond__storeys--active":r.root.selectedStorey===l})},ee(l.name),3)]),_:1},8,["list"])]),x("div",null,[x("div",ECt," 2 - "+ee(e.$t("viewer2d-background.import_file")),1),L(s,{width:"100%",color:"primary",fill:"",radius:"",disabled:!r.root.selectedStorey,onClick:t[1]||=l=>r.root.page="ged"},{default:K(()=>[wt(ee(e.$t("viewer2d-background.from_ged")),1)]),_:1},8,["disabled"])])])}var ICt={name:"Background2D",components:{edit:sCt,ged:hCt,home:CCt,bond:W(xCt,[["render",MCt],["__scopeId","data-v-2573d11f"]])},props:{isOpen:{type:Boolean,default:!1}},setup(){let e=Ot("$viewer"),t=Ot("$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=os(i),vn("viewer2d",i);let r=Ma({page:"home",loading:!1,modalDisplayed:!1,model:{},storeys:[],plans:[],selectedStorey:null,editedBitmap:null});vn("root",r);let n=e.localContext.hub.on("models-loaded",({models:[u]})=>{r.model=u,r.storeys=u.storeys,r.plans=u.storeys.flatMap(h=>h.plans)},{getLastEvent:!0}),o=e.localContext.hub.on("storey-selected",({storey:u})=>{r.selectedStorey=u,u||(r.page="home")},{getLastEvent:!0}),a=e.state.hub.on("plan-created",()=>r.plans=r.model.storeys.flatMap(u=>u.plans)),s=e.state.hub.on("plan-updated",()=>r.plans=r.model.storeys.flatMap(u=>u.plans)),l=e.state.hub.on("plan-deleted",()=>r.plans=r.model.storeys.flatMap(u=>u.plans));Yr(()=>{e.localContext.hub.off(n),e.localContext.hub.off(o),e.localContext.hub.off(a),e.localContext.hub.off(s),e.localContext.hub.off(l)}),Qt(()=>r.page,u=>{u!=="edit"&&(r.editedBitmap=null)},{immediate:!0}),Qt(()=>r.editedBitmap,(u,h)=>{h?.edit(!1),u?.edit(!0)},{immediate:!0});let c=()=>{r.page="home",r.modalDisplayed=!1,t.close()},d=!0;return{viewer2d:i,root:r,onBackClick:()=>{switch(d=!0,r.page){case"ged":r.page="bond";break;case"edit":r.editedBitmap?.edited?r.modalDisplayed=!0:r.editedBitmap.plan?(r.editedBitmap.reset(),r.page="home"):(i.plugins.bitmaps.deleteBitmap(r.editedBitmap),r.page="ged");break;default:r.page="home"}},onCloseClick:()=>{d=!1,r.editedBitmap?.edited?r.modalDisplayed=!0:c()},onLeaveClick:()=>{r.editedBitmap.plan?r.editedBitmap.reset():i.plugins.bitmaps.deleteBitmap(r.editedBitmap),d?r.editedBitmap.plan?r.page="home":r.page="ged":c(),r.modalDisplayed=!1},onKeyDown:u=>{r.loading||u.key==="Escape"&&(u.preventDefault(),r.page==="home"?c():r.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)}},PCt={class:"viewer2d-background"},SCt={class:"viewer2d-background__header__back"},TCt={class:"viewer2d-background__header__title__text"},DCt={key:1,class:"viewer2d-background__modal"},RCt={class:"viewer2d-background__modal__content"},LCt={class:"viewer2d-background__modal__content__symbols"},_Ct={class:"viewer2d-background__modal__content__buttons"};function FCt(e,t,i,r,n,o){let a=T("BIMDataLoading"),s=T("BIMDataIconArrow"),l=T("BIMDataButton"),c=T("BIMDataIconSynchro2D"),d=T("BIMDataIconClose"),u=T("BIMDataIconWarning");return M(),q("div",PCt,[r.root.loading?(M(),ie(a,{key:0})):xe("",!0),x("div",{class:Ue(["viewer2d-background__header",{"viewer2d-background__header--home":r.root.page==="home"}])},[x("div",SCt,[r.root.page==="home"?xe("",!0):(M(),ie(l,{key:0,width:"25px",height:"25px",color:"primary",ghost:"",radius:"",icon:"",onClick:r.onBackClick},{default:K(()=>[L(s,{size:"xs"})]),_:1},8,["onClick"]))]),x("div",{class:Ue(["viewer2d-background__header__title",{"viewer2d-background__header__title--home":r.root.page==="home"}])},[L(c,{size:r.root.page==="home"?"l":"xs",fill:"",color:"primary"},null,8,["size"]),x("span",TCt,ee(e.$t("viewer2d-background.title")),1)],2),L(l,{class:"viewer2d-background__header__close",width:"25px",height:"25px",ghost:"",radius:"",icon:"",onClick:r.onCloseClick},{default:K(()=>[L(d,{size:"xs",fill:"",color:"granite-light"})]),_:1},8,["onClick"])],2),x("div",{class:Ue(["viewer2d-background__page",{"viewer2d-background__page--home":r.root.page==="home"}])},[(M(),ie(A7,null,[(M(),ie(oo(r.root.page)))],1024))],2),r.root.modalDisplayed?(M(),q("div",DCt,[x("div",RCt,[x("div",LCt,[L(u,{fill:"",color:"high",size:"l"}),x("div",null,ee(e.$t("viewer2d-background.warning")),1)]),x("div",_Ct,[L(l,{width:"45%",color:"high",fill:"",radius:"",onClick:r.onLeaveClick},{default:K(()=>[wt(ee(e.$t("viewer2d-background.leave")),1)]),_:1},8,["onClick"]),L(l,{width:"45%",color:"default",outline:"",radius:"",onClick:t[0]||=h=>r.root.modalDisplayed=!1},{default:K(()=>[wt(ee(e.$t("viewer2d-background.stay")),1)]),_:1})])])])):xe("",!0)])}var Tfe=W(ICt,[["render",FCt],["__scopeId","data-v-1eece107"]]),Dfe={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"},jCt="Background",UCt="2D viewer background",OCt="Location",HCt="Scale",qCt="Rotation",NCt="Alpha",zCt="Preview",VCt="From the project GED",QCt="From your computer",GCt="To add a background, please select an IFC and a storey.",KCt="Start",WCt="Overlay your PDF plans by floor to view them in the 2D viewer",JCt="Select a floor",YCt="Import a file",ZCt="To add a background, please select an IFC.",XCt="Are you sure you want to leave this page? There may be some unvalidated information.",$Ct="Yes, leave this page",ext="Cancel, stay here",Rfe={tooltip:jCt,"tooltip-anchor-synchronization":"Synchronization",title:UCt,location:OCt,scale:HCt,rotation:qCt,alpha:NCt,preview:zCt,import:"Import element",from_ged:VCt,from_computer:QCt,no_storey:GCt,start:KCt,description:WCt,select_storey:JCt,import_file:YCt,no_ifc:ZCt,warning:XCt,leave:$Ct,stay:ext},Lfe={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"},txt="Synchronisation 2D",ixt="Synchronisation 2D",rxt="Position",nxt="Echelle",oxt="Rotation",axt="Opacit\xE9",sxt="Aper\xE7u",lxt="Depuis la GED du projet",cxt="Depuis votre ordinateur",dxt="Pour ajouter un fond, veuillez selectionner un IFC et un \xE9tage.",uxt="Commencer",hxt="Superposez vos plans PDF par \xE9tages pour les visualisez dans la visionneuse 2D",pxt="S\xE9lectionner un \xE9tage",Axt="Importer un fichier",fxt="Pour ajouter un fond, veuillez selectionner un IFC.",gxt="\xCAtes-vous s\xFBr de vouloir quitter cette page ? Il y'a peut-\xEAtre des informations non valid\xE9es.",mxt="Oui, quitter cette page",vxt="Annuler, rester ici",_fe={tooltip:txt,"tooltip-anchor-synchronization":"Synchronisation",title:ixt,location:rxt,scale:nxt,rotation:oxt,alpha:axt,preview:sxt,import:"Importer un \xE9l\xE9ment",from_ged:lxt,from_computer:cxt,no_storey:dxt,start:uxt,description:hxt,select_storey:pxt,import_file:Axt,no_ifc:fxt,warning:gxt,leave:mxt,stay:vxt},Ffe={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"},wxt={name:"viewer2d-background",i18n:{de:Dfe,en:Rfe,es:Lfe,fr:_fe,it:Ffe},addToWindows:["2d"],component:Tfe,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"}}},tO="viewer2d-parameters_parameters",bxt={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(tO)||"{}";e=JSON.parse(t)}catch{localStorage.removeItem(tO)}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(tO,JSON.stringify(e))}}},yxt={class:"viewer2d-parameters"},Cxt={class:"viewer2d-parameters_header"},xxt={class:"viewer2d-parameters_content"},kxt={class:"m-b-18"},Bxt={class:"m-b-18"},Ext={class:"m-b-18"},Mxt={class:"m-b-18"};function Ixt(e,t,i,r,n,o){let a=T("BIMDataIconParameters"),s=T("BIMDataToggle");return M(),q("div",yxt,[x("div",Cxt,[L(a,{size:"xs",margin:"0 12px 0 0"}),x("span",null,ee(e.$t("viewer2d-parameters.title")),1)]),x("div",xxt,[x("div",kxt,[x("span",null,ee(e.$t("viewer2d-parameters.ifc_spaces")),1),L(s,{modelValue:o.spacesDisplayed,"onUpdate:modelValue":t[0]||=l=>o.spacesDisplayed=l},null,8,["modelValue"])]),x("div",Bxt,[x("span",null,ee(e.$t("viewer2d-parameters.display_door_openings")),1),L(s,{modelValue:o.doorsDisplayed,"onUpdate:modelValue":t[1]||=l=>o.doorsDisplayed=l},null,8,["modelValue"])]),x("div",Ext,[x("span",null,ee(e.$t("viewer2d-parameters.display_compass")),1),L(s,{modelValue:o.compassDisplayed,"onUpdate:modelValue":t[2]||=l=>o.compassDisplayed=l},null,8,["modelValue"])]),x("div",Mxt,[x("span",null,ee(e.$t("viewer2d-parameters.highlight")),1),L(s,{modelValue:o.highlightOnHover,"onUpdate:modelValue":t[3]||=l=>o.highlightOnHover=l},null,8,["modelValue"])]),x("div",null,[x("span",null,ee(e.$t("viewer2d-parameters.camera_sync")),1),L(s,{modelValue:o.camera3DSynchronization,"onUpdate:modelValue":t[4]||=l=>o.camera3DSynchronization=l},null,8,["modelValue"])])])])}var Pxt={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:W(bxt,[["render",Ixt],["__scopeId","data-v-df342105"]]),button:{tooltip:"viewer2d-parameters.tooltip",stance:-1,position:"right",content:"simple",icon:{component:"BIMDataIconParameters",options:{size:"m"}}}},Sxt={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 r=await(0,Jk.default)(this.$viewer.localContext.el);t&&(e.style.width=i.width,e.style.height=i.height);let n=document.createElement("a");n.download=this.viewer2d.ifc&&this.viewer2d.ifc.name?String(this.viewer2d.ifc.name).split(".ifc")[0]:"2d-capture.png",n.href=r.toDataURL(),n.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"}}}},Od=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}},jfe=new Od,Txt=class{constructor(e){this.id=e,this.parentItem=null,this.groups=[],this.menuElement=null,this.shown=!1,this.mouseOver=0}},Dxt=class{constructor(){this.items=[]}},Rxt=class{constructor(e,t,i,r,n){this.id=e,this.getTitle=t,this.doAction=i,this.getEnabled=r,this.getShown=n,this.itemElement=null,this.subMenu=null,this.enabled=!0}},Lxt=class{constructor(e={}){this._id=jfe.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 r=0,n=i.length;r<n;r++)i[r](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&&(jfe.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 r=new Txt(this._getNextId());for(let n=0,o=i.length;n<o;n++){let a=i[n],s=new Dxt;r.groups.push(s);for(let l=0,c=a.length;l<c;l++){let d=a[l],u=d.items,h=u&&u.length>0,p=new Rxt(this._getNextId(),d.getTitle||(()=>d.title||""),d.doAction||d.callback||(()=>{}),d.getEnabled||(()=>!0),d.getShown||(()=>!0));if(p.parentMenu=r,s.items.push(p),h){let A=t(u);p.subMenu=A,A.parentItem=p}this._itemList.push(p),this._itemMap[p.id]=p}}return this._menuList.push(r),this._menuMap[r.id]=r,r};this._rootMenu=t(e)}_getNextId(){return"ContextMenu_"+this._id+"_"+this._nextId++}_createUI(){let e=t=>{this._createMenuUI(t);let i=t.groups;for(let r=0,n=i.length;r<n;r++){let o=i[r].items;for(let a=0,s=o.length;a<s;a++){let l=o[a].subMenu;l&&e(l)}}};e(this._rootMenu)}_createMenuUI(e){let t=e.groups,i=[],r=document.createElement("div");if(r.classList.add("xeokit-context-menu",e.id),r.style.zIndex=3e5,r.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 h=0,p=u.length;h<p;h++){let A=u[h],f=A.subMenu,m=A.title||"";f?(i.push('<li id="'+A.id+'" class="xeokit-context-menu-item xeokit-context-menu-submenu">'+m+"</li>"),c===d-1||h<p-1||i.push('<li id="'+A.id+'" class="xeokit-context-menu-item-separator"></li>')):(i.push('<li id="'+A.id+'" class="xeokit-context-menu-item">'+m+"</li>"),c===d-1||h<p-1||i.push('<li id="'+A.id+'" class="xeokit-context-menu-item-separator"></li>'))}}i.push("</ul>"),r.innerHTML=i.join(""),this._parentNode.appendChild(r),e.menuElement=r,r.style["border-radius"]="4px",r.style.display="none",r.style["z-index"]=3e5,r.style.background="white",r.style.border="1px solid black",r.style["box-shadow"]="0 4px 5px 0 gray",r.oncontextmenu=a=>{a.preventDefault()};let n=this,o=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],h=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",p=>{p.preventDefault();let A=u.subMenu;if(!A){o&&=(n._hideMenu(o.id),null);return}if(o&&o.id!==A.id&&(n._hideMenu(o.id),o=null),u.enabled===!1)return;let f=u.itemElement,m=A.menuElement,g=f.getBoundingClientRect();m.getBoundingClientRect();let w=n._offsetParent.getBoundingClientRect(),v=g.right+200<w.right,b=g.left-200>w.left;if(v)n._showMenu(A.id,g.right+window.scrollX-5,g.top+window.scrollY-1);else if(b)n._showMenu(A.id,g.left-200+window.scrollX,g.top+window.scrollY-1);else{let y=g.left-w.left,C=w.right-g.right;C>y?n._showMenu(A.id,g.right-5-(200-C),g.top+window.scrollY-1):n._showMenu(A.id,g.left-y,g.top+window.scrollY-1)}o=A}),h||(u.itemElement.addEventListener("click",p=>{p.preventDefault(),n._context&&u.enabled!==!1&&(u.doAction&&u.doAction(n._context),this._hideOnAction?n.hide():(n._updateItemsTitles(),n._updateItemsEnabledStatus()))}),u.itemElement.addEventListener("mouseup",p=>{p.which===3&&(p.preventDefault(),n._context&&u.enabled!==!1&&(u.doAction&&u.doAction(n._context),this._hideOnAction?n.hide():(n._updateItemsTitles(),n._updateItemsEnabledStatus())))}),u.itemElement.addEventListener("mouseenter",p=>{p.preventDefault(),u.enabled!==!1&&u.doHover&&u.doHover(n._context)}))}}}_updateItemsTitles(){if(this._context)for(let e=0,t=this._itemList.length;e<t;e++){let i=this._itemList[e],r=i.itemElement;if(!r)continue;let n=i.getShown;if(!n||!n(this._context))continue;let o=i.getTitle(this._context);i.subMenu,r.innerText=o}}_updateItemsEnabledStatus(){if(this._context)for(let e=0,t=this._itemList.length;e<t;e++){let i=this._itemList[e],r=i.itemElement;if(!r)continue;let n=i.getEnabled;if(!n)continue;let o=i.getShown;if(!o)continue;let a=o(this._context);if(i.shown=a,a)r.style.display="";else{r.style.display="none";continue}let s=n(this._context);i.enabled=s,s?r.classList.remove("disabled"):r.classList.add("disabled")}}_updateSubMenuInfo(){if(!this._context)return;let e,t,i,r,n,o;this._itemList.forEach(a=>{a.subMenu&&(e=a.itemElement,t=e.getBoundingClientRect(),i=a.subMenu.menuElement,r={visibility:i.style.visibility,display:i.style.display},i.style.display="block",i.style.visibility="hidden",o=a.subMenu.menuElement.getBoundingClientRect().width,i.style.visibility=r.visibility,i.style.display=r.display,n=t.right+o>window.innerWidth,e.setAttribute("data-submenuposition",n?"left":"right"))})}_showMenu(e,t,i){let r=this._menuMap[e];if(!r){console.error("Menu not found: "+e);return}if(r.shown)return;let n=r.menuElement;n&&(this._showMenuElement(n,t,i),r.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 r=e.offsetHeight,n=e.offsetWidth,o=this._offsetParent.getBoundingClientRect(),a=this._offsetParent===window.document.body&&o.bottom===0?window.innerHeight:o.bottom+window.scrollY,s=o.right+window.scrollX;i+r>a&&(i=a-r),t+n>s&&(t=s-n),e.style.left=t-o.left-window.scrollX+"px",e.style.top=i-o.top-window.scrollY+"px"}_hideMenuElement(e){e.style.display="none"}},_xt=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 r=Math.max(this._lensCanvas.width,this._lensCanvas.height)/this._zoomLevel;this._lensCanvasContext.drawImage(this._canvasElement,this._canvasPos[0]-r/2,this._canvasPos[1]-r/2,r,r,0,0,this._lensCanvas.width,this._lensCanvas.height);let n=this._lensParams.canvasSize/2-this._lensParams.cursorSize/2-this._lensParams.cursorBorder,o=this._snappedCanvasPos?this._snappedCanvasPos[0]-this._canvasPos[0]:0,a=this._snappedCanvasPos?this._snappedCanvasPos[1]-this._canvasPos[1]:0;this._lensCursorDiv.style.left=`${n+o*this._zoomLevel}px`,this._lensCursorDiv.style.top=`${n+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)}},iB=!0,Ai=iB?Float64Array:Float32Array,Lv=new Ai(3),rB=new Ai(16),nB=new Ai(16),Fxt=new Ai(4),k={setDoublePrecisionEnabled(e){iB=e,Ai=iB?Float64Array:Float32Array},getDoublePrecisionEnabled(){return iB},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 Ai(e||2)},vec3(e){return new Ai(e||3)},vec4(e){return new Ai(e||4)},mat3(e){return new Ai(e||9)},mat3ToMat4(e,t=new Ai(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 Ai(e||16)},mat4ToMat3(e,t=new Ai(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 r=new Ai(2);for(let n=0,o=e.length;n<o;n++)k.splitDouble(e[n],r),t[n]=r[0],i[n]=r[1]},splitDouble(e,t){let i=Ai.from([e])[0],r=e-i;t[0]=i,t[1]=r},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,r=Math.random()*4294967295|0,n=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[r&63|128]}${e[r>>8&255]}-${e[r>>16&255]}${e[r>>24&255]}${e[n&255]}${e[n>>8&255]}${e[n>>16&255]}${e[n>>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 Ai(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],r=e[1],n=e[2],o=t[0],a=t[1],s=t[2];return[r*s-n*a,n*o-i*s,i*a-r*o,0]},cross3Vec3(e,t,i){i||=e;let r=e[0],n=e[1],o=e[2],a=t[0],s=t[1],l=t[2];return i[0]=n*l-o*s,i[1]=o*a-r*l,i[2]=r*s-n*a,i},sqLenVec4(e){return k.dotVec4(e,e)},lenVec4(e){return Math.sqrt(k.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 k.dotVec3(e,e)},sqLenVec2(e){return k.dotVec2(e,e)},lenVec3(e){return Math.sqrt(k.sqLenVec3(e))},distVec3:(()=>{let e=new Ai(3);return(t,i)=>k.lenVec3(k.subVec3(t,i,e))})(),lenVec2(e){return Math.sqrt(k.sqLenVec2(e))},distVec2:(()=>{let e=new Ai(2);return(t,i)=>k.lenVec2(k.subVec2(t,i,e))})(),rcpVec3(e,t){return k.divScalarVec3(1,e,t)},normalizeVec4(e,t){let i=1/k.lenVec4(e);return k.mulVec4Scalar(e,i,t)},normalizeVec3(e,t){let i=1/k.lenVec3(e);return k.mulVec3Scalar(e,i,t)},normalizeVec2(e,t){let i=1/k.lenVec2(e);return k.mulVec2Scalar(e,i,t)},angleVec3(e,t){let i=k.dotVec3(e,t)/Math.sqrt(k.sqLenVec3(e)*k.sqLenVec3(t));return i=i<-1?-1:i>1?1:i,Math.acos(i)},vec3FromMat4Scale:(()=>{let e=new Ai(3);return(t,i)=>(e[0]=t[0],e[1]=t[1],e[2]=t[2],i[0]=k.lenVec3(e),e[0]=t[4],e[1]=t[5],e[2]=t[6],i[1]=k.lenVec3(e),e[0]=t[8],e[1]=t[9],e[2]=t[10],i[2]=k.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,r=t.length;i<r;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||=k.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 k.m4s(0)},setMat4ToOnes(){return k.m4s(1)},diagonalMat4v(e){return new Ai([e[0],0,0,0,0,e[1],0,0,0,0,e[2],0,0,0,0,e[3]])},diagonalMat4c(e,t,i,r){return k.diagonalMat4v([e,t,i,r])},diagonalMat4s(e){return k.diagonalMat4c(e,e,e,e)},identityMat4(e=new Ai(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 Ai(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 k.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 r=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],d=e[7],u=e[8],h=e[9],p=e[10],A=e[11],f=e[12],m=e[13],g=e[14],w=e[15],v=t[0],b=t[1],y=t[2],C=t[3],B=t[4],I=t[5],E=t[6],P=t[7],S=t[8],D=t[9],j=t[10],V=t[11],Q=t[12],z=t[13],J=t[14],Y=t[15];return i[0]=v*r+b*s+y*u+C*f,i[1]=v*n+b*l+y*h+C*m,i[2]=v*o+b*c+y*p+C*g,i[3]=v*a+b*d+y*A+C*w,i[4]=B*r+I*s+E*u+P*f,i[5]=B*n+I*l+E*h+P*m,i[6]=B*o+I*c+E*p+P*g,i[7]=B*a+I*d+E*A+P*w,i[8]=S*r+D*s+j*u+V*f,i[9]=S*n+D*l+j*h+V*m,i[10]=S*o+D*c+j*p+V*g,i[11]=S*a+D*d+j*A+V*w,i[12]=Q*r+z*s+J*u+Y*f,i[13]=Q*n+z*l+J*h+Y*m,i[14]=Q*o+z*c+J*p+Y*g,i[15]=Q*a+z*d+J*A+Y*w,i},mulMat3(e,t,i){i||=new Ai(9);let r=e[0],n=e[3],o=e[6],a=e[1],s=e[4],l=e[7],c=e[2],d=e[5],u=e[8],h=t[0],p=t[3],A=t[6],f=t[1],m=t[4],g=t[7],w=t[2],v=t[5],b=t[8];return i[0]=r*h+n*f+o*w,i[3]=r*p+n*m+o*v,i[6]=r*A+n*g+o*b,i[1]=a*h+s*f+l*w,i[4]=a*p+s*m+l*v,i[7]=a*A+s*g+l*b,i[2]=c*h+d*f+u*w,i[5]=c*p+d*m+u*v,i[8]=c*A+d*g+u*b,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=k.vec4()){let r=t[0],n=t[1],o=t[2],a=t[3];return i[0]=e[0]*r+e[4]*n+e[8]*o+e[12]*a,i[1]=e[1]*r+e[5]*n+e[9]*o+e[13]*a,i[2]=e[2]*r+e[6]*n+e[10]*o+e[14]*a,i[3]=e[3]*r+e[7]*n+e[11]*o+e[15]*a,i},transposeMat4(e,t){let i=e[4],r=e[14],n=e[8],o=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],h=e[7],p=e[11];return e[1]=i,e[2]=n,e[3]=a,e[4]=l,e[6]=s,e[7]=o,e[8]=c,e[9]=u,e[11]=r,e[12]=d,e[13]=h,e[14]=p,e}return t[0]=e[0],t[1]=i,t[2]=n,t[3]=a,t[4]=e[1],t[5]=e[5],t[6]=s,t[7]=o,t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=r,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],r=e[2],n=e[5];t[1]=e[3],t[2]=e[6],t[3]=i,t[5]=e[7],t[6]=r,t[7]=n}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],r=e[2],n=e[3],o=e[4],a=e[5],s=e[6],l=e[7],c=e[8],d=e[9],u=e[10],h=e[11],p=e[12],A=e[13],f=e[14],m=e[15];return p*d*s*n-c*A*s*n-p*a*u*n+o*A*u*n+c*a*f*n-o*d*f*n-p*d*r*l+c*A*r*l+p*i*u*l-t*A*u*l-c*i*f*l+t*d*f*l+p*a*r*h-o*A*r*h-p*i*s*h+t*A*s*h+o*i*f*h-t*a*f*h-c*a*r*m+o*d*r*m+c*i*s*m-t*d*s*m-o*i*u*m+t*a*u*m},inverseMat4(e,t){t||=e;let i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],d=e[8],u=e[9],h=e[10],p=e[11],A=e[12],f=e[13],m=e[14],g=e[15],w=i*s-r*a,v=i*l-n*a,b=i*c-o*a,y=r*l-n*s,C=r*c-o*s,B=n*c-o*l,I=d*f-u*A,E=d*m-h*A,P=d*g-p*A,S=u*m-h*f,D=u*g-p*f,j=h*g-p*m,V=1/(w*j-v*D+b*S+y*P-C*E+B*I);return t[0]=(s*j-l*D+c*S)*V,t[1]=(-r*j+n*D-o*S)*V,t[2]=(f*B-m*C+g*y)*V,t[3]=(-u*B+h*C-p*y)*V,t[4]=(-a*j+l*P-c*E)*V,t[5]=(i*j-n*P+o*E)*V,t[6]=(-A*B+m*b-g*v)*V,t[7]=(d*B-h*b+p*v)*V,t[8]=(a*D-s*P+c*I)*V,t[9]=(-i*D+r*P-o*I)*V,t[10]=(A*C-f*b+g*w)*V,t[11]=(-d*C+u*b-p*w)*V,t[12]=(-a*S+s*E-l*I)*V,t[13]=(i*S-r*E+n*I)*V,t[14]=(-A*y+f*v-m*w)*V,t[15]=(d*y-u*v+h*w)*V,t},traceMat4(e){return e[0]+e[5]+e[10]+e[15]},translationMat4v(e,t){let i=t||k.identityMat4();return i[12]=e[0],i[13]=e[1],i[14]=e[2],i},translationMat3v(e,t){let i=t||k.identityMat3();return i[6]=e[0],i[7]=e[1],i},translationMat4c:(()=>{let e=new Ai(3);return(t,i,r,n)=>(e[0]=t,e[1]=i,e[2]=r,k.translationMat4v(e,n))})(),translationMat4s(e,t){return k.translationMat4c(e,e,e,t)},translateMat4v(e,t){return k.translateMat4c(e[0],e[1],e[2],t)},translateMat4c(e,t,i,r){let n=r[3];r[0]+=n*e,r[1]+=n*t,r[2]+=n*i;let o=r[7];r[4]+=o*e,r[5]+=o*t,r[6]+=o*i;let a=r[11];r[8]+=a*e,r[9]+=a*t,r[10]+=a*i;let s=r[15];return r[12]+=s*e,r[13]+=s*t,r[14]+=s*i,r},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 r=k.normalizeVec4([t[0],t[1],t[2],0],[]),n=Math.sin(e),o=Math.cos(e),a=1-o,s=r[0],l=r[1],c=r[2],d,u,h,p,A,f;return d=s*l,u=l*c,h=c*s,p=s*n,A=l*n,f=c*n,i||=k.mat4(),i[0]=a*s*s+o,i[1]=a*d+f,i[2]=a*h-A,i[3]=0,i[4]=a*d-f,i[5]=a*l*l+o,i[6]=a*u+p,i[7]=0,i[8]=a*h+A,i[9]=a*u-p,i[10]=a*c*c+o,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},rotationMat4c(e,t,i,r,n){return k.rotationMat4v(e,[t,i,r],n)},scalingMat4v(e,t=k.identityMat4()){return t[0]=e[0],t[5]=e[1],t[10]=e[2],t},scalingMat3v(e,t=k.identityMat3()){return t[0]=e[0],t[4]=e[1],t},scalingMat4c:(()=>{let e=new Ai(3);return(t,i,r,n)=>(e[0]=t,e[1]=i,e[2]=r,k.scalingMat4v(e,n))})(),scaleMat4c(e,t,i,r){return r[0]*=e,r[4]*=t,r[8]*=i,r[1]*=e,r[5]*=t,r[9]*=i,r[2]*=e,r[6]*=t,r[10]*=i,r[3]*=e,r[7]*=t,r[11]*=i,r},scaleMat4v(e,t){let i=e[0],r=e[1],n=e[2];return t[0]*=i,t[4]*=r,t[8]*=n,t[1]*=i,t[5]*=r,t[9]*=n,t[2]*=i,t[6]*=r,t[10]*=n,t[3]*=i,t[7]*=r,t[11]*=n,t},scalingMat4s(e){return k.scalingMat4c(e,e,e)},rotationTranslationMat4(e,t,i=k.mat4()){let r=e[0],n=e[1],o=e[2],a=e[3],s=r+r,l=n+n,c=o+o,d=r*s,u=r*l,h=r*c,p=n*l,A=n*c,f=o*c,m=a*s,g=a*l,w=a*c;return i[0]=1-(p+f),i[1]=u+w,i[2]=h-g,i[3]=0,i[4]=u-w,i[5]=1-(d+f),i[6]=A+m,i[7]=0,i[8]=h+g,i[9]=A-m,i[10]=1-(d+p),i[11]=0,i[12]=t[0],i[13]=t[1],i[14]=t[2],i[15]=1,i},mat4ToEuler(e,t,i=k.vec4()){let r=k.clamp,n=e[0],o=e[4],a=e[8],s=e[1],l=e[5],c=e[9],d=e[2],u=e[6],h=e[10];return t==="XYZ"?(i[1]=Math.asin(r(a,-1,1)),Math.abs(a)<.99999?(i[0]=Math.atan2(-c,h),i[2]=Math.atan2(-o,n)):(i[0]=Math.atan2(u,l),i[2]=0)):t==="YXZ"?(i[0]=Math.asin(-r(c,-1,1)),Math.abs(c)<.99999?(i[1]=Math.atan2(a,h),i[2]=Math.atan2(s,l)):(i[1]=Math.atan2(-d,n),i[2]=0)):t==="ZXY"?(i[0]=Math.asin(r(u,-1,1)),Math.abs(u)<.99999?(i[1]=Math.atan2(-d,h),i[2]=Math.atan2(-o,l)):(i[1]=0,i[2]=Math.atan2(s,n))):t==="ZYX"?(i[1]=Math.asin(-r(d,-1,1)),Math.abs(d)<.99999?(i[0]=Math.atan2(u,h),i[2]=Math.atan2(s,n)):(i[0]=0,i[2]=Math.atan2(-o,l))):t==="YZX"?(i[2]=Math.asin(r(s,-1,1)),Math.abs(s)<.99999?(i[0]=Math.atan2(-c,l),i[1]=Math.atan2(-d,n)):(i[0]=0,i[1]=Math.atan2(a,h))):t==="XZY"&&(i[2]=Math.asin(-r(o,-1,1)),Math.abs(o)<.99999?(i[0]=Math.atan2(u,l),i[1]=Math.atan2(a,n)):(i[0]=Math.atan2(-c,h),i[1]=0)),i[0]*=k.RADTODEG,i[1]*=k.RADTODEG,i[2]*=k.RADTODEG,i},composeMat4(e,t,i,r=k.mat4()){return k.quaternionToRotationMat4(t,r),k.scaleMat4v(i,r),k.translateMat4v(e,r),r},decomposeMat4:(()=>{let e=new Ai(3),t=new Ai(16);return function(i,r,n,o){e[0]=i[0],e[1]=i[1],e[2]=i[2];let a=k.lenVec3(e);e[0]=i[4],e[1]=i[5],e[2]=i[6];let s=k.lenVec3(e);e[8]=i[8],e[9]=i[9],e[10]=i[10];let l=k.lenVec3(e);k.determinantMat4(i)<0&&(a=-a),r[0]=i[12],r[1]=i[13],r[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,k.mat4ToQuaternion(t,n),o[0]=a,o[1]=s,o[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,r){r||=k.mat4();let n=e[0],o=e[1],a=e[2],s=i[0],l=i[1],c=i[2],d=t[0],u=t[1],h=t[2];if(n===d&&o===u&&a===h)return k.identityMat4();let p,A,f,m,g,w,v,b,y,C;return p=n-d,A=o-u,f=a-h,C=1/Math.sqrt(p*p+A*A+f*f),p*=C,A*=C,f*=C,m=l*f-c*A,g=c*p-s*f,w=s*A-l*p,C=Math.sqrt(m*m+g*g+w*w),C?(C=1/C,m*=C,g*=C,w*=C):(m=0,g=0,w=0),v=A*w-f*g,b=f*m-p*w,y=p*g-A*m,C=Math.sqrt(v*v+b*b+y*y),C?(C=1/C,v*=C,b*=C,y*=C):(v=0,b=0,y=0),r[0]=m,r[1]=v,r[2]=p,r[3]=0,r[4]=g,r[5]=b,r[6]=A,r[7]=0,r[8]=w,r[9]=y,r[10]=f,r[11]=0,r[12]=-(m*n+g*o+w*a),r[13]=-(v*n+b*o+y*a),r[14]=-(p*n+A*o+f*a),r[15]=1,r},lookAtMat4c(e,t,i,r,n,o,a,s,l){return k.lookAtMat4v([e,t,i],[r,n,o],[a,s,l],[])},orthoMat4c(e,t,i,r,n,o,a){a||=k.mat4();let s=t-e,l=r-i,c=o-n;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]=-(r+i)/l,a[14]=-(o+n)/c,a[15]=1,a},frustumMat4v(e,t,i){i||=k.mat4();let r=[e[0],e[1],e[2],0],n=[t[0],t[1],t[2],0];k.addVec4(n,r,rB),k.subVec4(n,r,nB);let o=2*r[2],a=nB[0],s=nB[1],l=nB[2];return i[0]=o/a,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o/s,i[6]=0,i[7]=0,i[8]=rB[0]/a,i[9]=rB[1]/s,i[10]=-rB[2]/l,i[11]=-1,i[12]=0,i[13]=0,i[14]=-o*n[2]/l,i[15]=0,i},frustumMat4(e,t,i,r,n,o,a){a||=k.mat4();let s=t-e,l=r-i,c=o-n;return a[0]=n*2/s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=n*2/l,a[6]=0,a[7]=0,a[8]=(t+e)/s,a[9]=(r+i)/l,a[10]=-(o+n)/c,a[11]=-1,a[12]=0,a[13]=0,a[14]=-(o*n*2)/c,a[15]=0,a},perspectiveMat4(e,t,i,r,n){let o=[],a=[];return o[2]=i,a[2]=r,a[1]=o[2]*Math.tan(e/2),o[1]=-a[1],a[0]=a[1]*t,o[0]=-a[0],k.frustumMat4v(o,a,n)},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=k.vec3()){let r=t[0],n=t[1],o=t[2];return i[0]=e[0]*r+e[4]*n+e[8]*o+e[12],i[1]=e[1]*r+e[5]*n+e[9]*o+e[13],i[2]=e[2]*r+e[6]*n+e[10]*o+e[14],i},transformPoint4(e,t,i=k.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 r=i||[],n=t.length,o,a,s,l,c=e[0],d=e[1],u=e[2],h=e[3],p=e[4],A=e[5],f=e[6],m=e[7],g=e[8],w=e[9],v=e[10],b=e[11],y=e[12],C=e[13],B=e[14],I=e[15],E;for(let P=0;P<n;++P)l=t[P],o=l[0],a=l[1],s=l[2],E=r[P]||(r[P]=[0,0,0]),E[0]=c*o+p*a+g*s+y,E[1]=d*o+A*a+w*s+C,E[2]=u*o+f*a+v*s+B,E[3]=h*o+m*a+b*s+I;return r.length=n,r},transformPositions3(e,t,i=t){let r,n=t.length,o,a,s,l=e[0],c=e[1],d=e[2];e[3];let u=e[4],h=e[5],p=e[6];e[7];let A=e[8],f=e[9],m=e[10];e[11];let g=e[12],w=e[13],v=e[14];for(e[15],r=0;r<n;r+=3)o=t[r+0],a=t[r+1],s=t[r+2],i[r+0]=l*o+u*a+A*s+g,i[r+1]=c*o+h*a+f*s+w,i[r+2]=d*o+p*a+m*s+v;return i},transformPositions4(e,t,i=t){let r,n=t.length,o,a,s,l=e[0],c=e[1],d=e[2],u=e[3],h=e[4],p=e[5],A=e[6],f=e[7],m=e[8],g=e[9],w=e[10],v=e[11],b=e[12],y=e[13],C=e[14],B=e[15];for(r=0;r<n;r+=4)o=t[r+0],a=t[r+1],s=t[r+2],i[r+0]=l*o+h*a+m*s+b,i[r+1]=c*o+p*a+g*s+y,i[r+2]=d*o+A*a+w*s+C,i[r+3]=u*o+f*a+v*s+B;return i},transformVec3(e,t,i){let r=t[0],n=t[1],o=t[2];return i||=this.vec3(),i[0]=e[0]*r+e[4]*n+e[8]*o,i[1]=e[1]*r+e[5]*n+e[9]*o,i[2]=e[2]*r+e[6]*n+e[10]*o,i},transformVec4(e,t,i){let r=t[0],n=t[1],o=t[2],a=t[3];return i||=k.vec4(),i[0]=e[0]*r+e[4]*n+e[8]*o+e[12]*a,i[1]=e[1]*r+e[5]*n+e[9]*o+e[13]*a,i[2]=e[2]*r+e[6]*n+e[10]*o+e[14]*a,i[3]=e[3]*r+e[7]*n+e[11]*o+e[15]*a,i},rotateVec2(e,t,i,r=e){let n=Math.cos(i),o=Math.sin(i),a=e[0]-t[0],s=e[1]-t[1];return r[0]=a*n-s*o+t[0],r[1]=a*o+s*n+t[1],e},rotateVec3X(e,t,i,r){let n=[],o=[];return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],o[0]=n[0],o[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),o[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),r[0]=o[0]+t[0],r[1]=o[1]+t[1],r[2]=o[2]+t[2],r},rotateVec3Y(e,t,i,r){let n=[],o=[];return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],o[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),o[1]=n[1],o[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),r[0]=o[0]+t[0],r[1]=o[1]+t[1],r[2]=o[2]+t[2],r},rotateVec3Z(e,t,i,r){let n=[],o=[];return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],o[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),o[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),o[2]=n[2],r[0]=o[0]+t[0],r[1]=o[1]+t[1],r[2]=o[2]+t[2],r},projectVec4(e,t){let i=1/e[3];return t||=k.vec2(),t[0]=e[0]*i,t[1]=e[1]*i,t},unprojectVec3:(()=>{let e=new Ai(16),t=new Ai(16),i=new Ai(16);return function(r,n,o,a){return this.transformVec3(this.mulMat4(this.inverseMat4(n,e),this.inverseMat4(o,t),i),r,a)}})(),lerpVec3(e,t,i,r,n,o){let a=o||k.vec3(),s=(e-t)/(i-t);return a[0]=r[0]+s*(n[0]-r[0]),a[1]=r[1]+s*(n[1]-r[1]),a[2]=r[2]+s*(n[2]-r[2]),a},lerpMat4(e,t,i,r,n,o){let a=o||k.mat4(),s=(e-t)/(i-t);return a[0]=r[0]+s*(n[0]-r[0]),a[1]=r[1]+s*(n[1]-r[1]),a[2]=r[2]+s*(n[2]-r[2]),a[3]=r[3]+s*(n[3]-r[3]),a[4]=r[4]+s*(n[4]-r[4]),a[5]=r[5]+s*(n[5]-r[5]),a[6]=r[6]+s*(n[6]-r[6]),a[7]=r[7]+s*(n[7]-r[7]),a[8]=r[8]+s*(n[8]-r[8]),a[9]=r[9]+s*(n[9]-r[9]),a[10]=r[10]+s*(n[10]-r[10]),a[11]=r[11]+s*(n[11]-r[11]),a[12]=r[12]+s*(n[12]-r[12]),a[13]=r[13]+s*(n[13]-r[13]),a[14]=r[14]+s*(n[14]-r[14]),a[15]=r[15]+s*(n[15]-r[15]),a},flatten(e){let t=[],i,r,n,o,a;for(i=0,r=e.length;i<r;i++)for(a=e[i],n=0,o=a.length;n<o;n++)t.push(a[n]);return t},identityQuaternion(e=k.vec4()){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},eulerToQuaternion(e,t,i=k.vec4()){let r=e[0]*k.DEGTORAD/2,n=e[1]*k.DEGTORAD/2,o=e[2]*k.DEGTORAD/2,a=Math.cos(r),s=Math.cos(n),l=Math.cos(o),c=Math.sin(r),d=Math.sin(n),u=Math.sin(o);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=k.vec4()){let i=e[0],r=e[4],n=e[8],o=e[1],a=e[5],s=e[9],l=e[2],c=e[6],d=e[10],u,h=i+a+d;return h>0?(u=.5/Math.sqrt(h+1),t[3]=.25/u,t[0]=(c-s)*u,t[1]=(n-l)*u,t[2]=(o-r)*u):i>a&&i>d?(u=2*Math.sqrt(1+i-a-d),t[3]=(c-s)/u,t[0]=.25*u,t[1]=(r+o)/u,t[2]=(n+l)/u):a>d?(u=2*Math.sqrt(1+a-i-d),t[3]=(n-l)/u,t[0]=(r+o)/u,t[1]=.25*u,t[2]=(s+c)/u):(u=2*Math.sqrt(1+d-i-a),t[3]=(o-r)/u,t[0]=(n+l)/u,t[1]=(s+c)/u,t[2]=.25*u),t},vec3PairToQuaternion(e,t,i=k.vec4()){let r=Math.sqrt(k.dotVec3(e,e)*k.dotVec3(t,t)),n=r+k.dotVec3(e,t);return n<1e-8*r?(n=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])):k.cross3Vec3(e,t,i),i[3]=n,k.normalizeQuaternion(i)},angleAxisToQuaternion(e,t=k.vec4()){let i=e[3]/2,r=Math.sin(i);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(i),t},quaternionToEuler:(()=>{let e=new Ai(16);return(t,i,r)=>(r||=k.vec3(),k.quaternionToRotationMat4(t,e),k.mat4ToEuler(e,i,r),r)})(),mulQuaternions(e,t,i=k.vec4()){let r=e[0],n=e[1],o=e[2],a=e[3],s=t[0],l=t[1],c=t[2],d=t[3];return i[0]=a*s+r*d+n*c-o*l,i[1]=a*l+n*d+o*s-r*c,i[2]=a*c+o*d+r*l-n*s,i[3]=a*d-r*s-n*l-o*c,i},vec3ApplyQuaternion(e,t,i=k.vec3()){let r=t[0],n=t[1],o=t[2],a=e[0],s=e[1],l=e[2],c=e[3],d=c*r+s*o-l*n,u=c*n+l*r-a*o,h=c*o+a*n-s*r,p=-a*r-s*n-l*o;return i[0]=d*c+p*-a+u*-l-h*-s,i[1]=u*c+p*-s+h*-a-d*-l,i[2]=h*c+p*-l+d*-s-u*-a,i},quaternionToMat4(e,t){t=k.identityMat4(t);let i=e[0],r=e[1],n=e[2],o=e[3],a=2*i,s=2*r,l=2*n,c=a*o,d=s*o,u=l*o,h=a*i,p=s*i,A=l*i,f=s*r,m=l*r,g=l*n;return t[0]=1-(f+g),t[1]=p+u,t[2]=A-d,t[4]=p-u,t[5]=1-(h+g),t[6]=m+c,t[8]=A+d,t[9]=m-c,t[10]=1-(h+f),t},quaternionToRotationMat4(e,t){let i=e[0],r=e[1],n=e[2],o=e[3],a=i+i,s=r+r,l=n+n,c=i*a,d=i*s,u=i*l,h=r*s,p=r*l,A=n*l,f=o*a,m=o*s,g=o*l;return t[0]=1-(h+A),t[4]=d-g,t[8]=u+m,t[1]=d+g,t[5]=1-(c+A),t[9]=p-f,t[2]=u-m,t[6]=p+f,t[10]=1-(c+h),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=k.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 k.normalizeQuaternion(k.conjugateQuaternion(e,t))},quaternionToAngleAxis(e,t=k.vec4()){e=k.normalizeQuaternion(e,Fxt);let i=e[3],r=2*Math.acos(i),n=Math.sqrt(1-i*i);return n<.001?(t[0]=e[0],t[1]=e[1],t[2]=e[2]):(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n),t[3]=r,t},AABB3(e){return new Ai(e||6)},AABB2(e){return new Ai(e||4)},OBB3(e){return new Ai(e||32)},OBB2(e){return new Ai(e||16)},Sphere3(e,t,i,r){return new Ai([e,t,i,r])},transformOBB3(e,t,i=t){let r,n=t.length,o,a,s,l=e[0],c=e[1],d=e[2],u=e[3],h=e[4],p=e[5],A=e[6],f=e[7],m=e[8],g=e[9],w=e[10],v=e[11],b=e[12],y=e[13],C=e[14],B=e[15];for(r=0;r<n;r+=4)o=t[r+0],a=t[r+1],s=t[r+2],i[r+0]=l*o+h*a+m*s+b,i[r+1]=c*o+p*a+g*s+y,i[r+2]=d*o+A*a+w*s+C,i[r+3]=u*o+f*a+v*s+B;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 Ai(3),t=new Ai(3),i=new Ai(3);return r=>(e[0]=r[0],e[1]=r[1],e[2]=r[2],t[0]=r[3],t[1]=r[4],t[2]=r[5],k.subVec3(t,e,i),Math.abs(k.lenVec3(i)))})(),getAABB3DiagPoint:(()=>{let e=new Ai(3),t=new Ai(3),i=new Ai(3);return(r,n)=>{e[0]=r[0],e[1]=r[1],e[2]=r[2],t[0]=r[3],t[1]=r[4],t[2]=r[5];let o=k.subVec3(t,e,i),a=n[0]-r[0],s=r[3]-n[0],l=n[1]-r[1],c=r[4]-n[1],d=n[2]-r[2],u=r[5]-n[2];return o[0]+=a>s?a:s,o[1]+=l>c?l:c,o[2]+=d>u?d:u,Math.abs(k.lenVec3(o))}})(),getAABB3Area(e){let t=e[3]-e[0],i=e[4]-e[1],r=e[5]-e[2];return t*i*r},getAABB3Center(e,t){let i=t||k.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||k.vec2();return i[0]=(e[2]+e[0])/2,i[1]=(e[3]+e[1])/2,i},collapseAABB3(e=k.AABB3()){return e[0]=k.MAX_DOUBLE,e[1]=k.MAX_DOUBLE,e[2]=k.MAX_DOUBLE,e[3]=k.MIN_DOUBLE,e[4]=k.MIN_DOUBLE,e[5]=k.MIN_DOUBLE,e},AABB3ToOBB3(e,t=k.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 Ai(3);return(t,i,r)=>{i||=k.AABB3();let n=k.MAX_DOUBLE,o=k.MAX_DOUBLE,a=k.MAX_DOUBLE,s=k.MIN_DOUBLE,l=k.MIN_DOUBLE,c=k.MIN_DOUBLE,d,u,h;for(let p=0,A=t.length;p<A;p+=3)r?(e[0]=t[p+0],e[1]=t[p+1],e[2]=t[p+2],k.decompressPosition(e,r,e),d=e[0],u=e[1],h=e[2]):(d=t[p+0],u=t[p+1],h=t[p+2]),d<n&&(n=d),u<o&&(o=u),h<a&&(a=h),d>s&&(s=d),u>l&&(l=u),h>c&&(c=h);return i[0]=n,i[1]=o,i[2]=a,i[3]=s,i[4]=l,i[5]=c,i}})(),OBB3ToAABB3(e,t=k.AABB3()){let i=k.MAX_DOUBLE,r=k.MAX_DOUBLE,n=k.MAX_DOUBLE,o=k.MIN_DOUBLE,a=k.MIN_DOUBLE,s=k.MIN_DOUBLE,l,c,d;for(let u=0,h=e.length;u<h;u+=4)l=e[u+0],c=e[u+1],d=e[u+2],l<i&&(i=l),c<r&&(r=c),d<n&&(n=d),l>o&&(o=l),c>a&&(a=c),d>s&&(s=d);return t[0]=i,t[1]=r,t[2]=n,t[3]=o,t[4]=a,t[5]=s,t},points3ToAABB3(e,t=k.AABB3()){let i=k.MAX_DOUBLE,r=k.MAX_DOUBLE,n=k.MAX_DOUBLE,o=k.MIN_DOUBLE,a=k.MIN_DOUBLE,s=k.MIN_DOUBLE,l,c,d;for(let u=0,h=e.length;u<h;u++)l=e[u][0],c=e[u][1],d=e[u][2],l<i&&(i=l),c<r&&(r=c),d<n&&(n=d),l>o&&(o=l),c>a&&(a=c),d>s&&(s=d);return t[0]=i,t[1]=r,t[2]=n,t[3]=o,t[4]=a,t[5]=s,t},points3ToSphere3:(()=>{let e=new Ai(3);return(t,i)=>{i||=k.vec4();let r=0,n=0,o=0,a,s=t.length;for(a=0;a<s;a++)r+=t[a][0],n+=t[a][1],o+=t[a][2];i[0]=r/s,i[1]=n/s,i[2]=o/s;let l=0,c;for(a=0;a<s;a++)c=Math.abs(k.lenVec3(k.subVec3(t[a],i,e))),c>l&&(l=c);return i[3]=l,i}})(),positions3ToSphere3:(()=>{let e=new Ai(3),t=new Ai(3);return(i,r)=>{r||=k.vec4();let n=0,o=0,a=0,s,l=i.length,c=0;for(s=0;s<l;s+=3)n+=i[s],o+=i[s+1],a+=i[s+2];let d=l/3;r[0]=n/d,r[1]=o/d,r[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(k.lenVec3(k.subVec3(e,r,t))),u>c&&(c=u);return r[3]=c,r}})(),OBB3ToSphere3:(()=>{let e=new Ai(3),t=new Ai(3);return(i,r)=>{r||=k.vec4();let n=0,o=0,a=0,s,l=i.length,c=l/4;for(s=0;s<l;s+=4)n+=i[s+0],o+=i[s+1],a+=i[s+2];r[0]=n/c,r[1]=o/c,r[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(k.lenVec3(k.subVec3(e,r,t))),u>d&&(d=u);return r[3]=d,r}})(),getSphere3Center(e,t=k.vec3()){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},getPositionsCenter(e,t=k.vec3()){let i=0,r=0,n=0;for(var o=0,a=e.length;o<a;o+=3)i+=e[o+0],r+=e[o+1],n+=e[o+2];let s=e.length/3;return t[0]=i/s,t[1]=r/s,t[2]=n/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,r,n,o=0,a=t.length;o<a;o+=3)i=t[o],r=t[o+1],n=t[o+2],e[0]>i&&(e[0]=i),e[1]>r&&(e[1]=r),e[2]>n&&(e[2]=n),e[3]<i&&(e[3]=i),e[4]<r&&(e[4]=r),e[5]<n&&(e[5]=n);return e},collapseAABB2(e=k.AABB2()){return e[0]=k.MAX_DOUBLE,e[1]=k.MAX_DOUBLE,e[2]=k.MIN_DOUBLE,e[3]=k.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 r,n;return e[0]>0?(r=e[0]*i[0],n=e[0]*i[3]):(r=e[0]*i[3],n=e[0]*i[0]),e[1]>0?(r+=e[1]*i[1],n+=e[1]*i[4]):(r+=e[1]*i[4],n+=e[1]*i[1]),e[2]>0?(r+=e[2]*i[2],n+=e[2]*i[5]):(r+=e[2]*i[5],n+=e[2]*i[2]),r<=-t&&n<=-t?-1:r>=-t&&n>=-t?1:0},OBB3ToAABB2(e,t=k.AABB2()){let i=k.MAX_DOUBLE,r=k.MAX_DOUBLE,n=k.MIN_DOUBLE,o=k.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<r&&(r=s),a>n&&(n=a),s>o&&(o=s);return t[0]=i,t[1]=r,t[2]=n,t[3]=o,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,r=e){let n=(e[0]+1)*.5,o=(e[1]+1)*.5,a=(e[2]+1)*.5,s=(e[3]+1)*.5;return r[0]=Math.floor(n*t),r[1]=i-Math.floor(s*i),r[2]=Math.floor(a*t),r[3]=i-Math.floor(o*i),r},tangentQuadraticBezier(e,t,i,r){return 2*(1-e)*(i-t)+2*e*(r-i)},tangentQuadraticBezier3(e,t,i,r,n){return-3*t*(1-e)*(1-e)+3*i*(1-e)*(1-e)-6*e*i*(1-e)+6*e*r*(1-e)-3*e*e*r+3*e*e*n},tangentSpline(e){let t=6*e*e-6*e,i=3*e*e-4*e+1,r=-6*e*e+6*e,n=3*e*e-2*e;return t+i+r+n},catmullRomInterpolate(e,t,i,r,n){let o=(i-e)*.5,a=(r-t)*.5,s=n*n,l=n*s;return(2*t-2*i+o+a)*l+(-3*t+3*i-2*o-a)*s+o*n+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,r){return this.b2p0(e,t)+this.b2p1(e,i)+this.b2p2(e,r)},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,r,n){return this.b3p0(e,t)+this.b3p1(e,i)+this.b3p2(e,r)+this.b3p3(e,n)},triangleNormal(e,t,i,r=k.vec3()){let n=t[0]-e[0],o=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=o*c-a*l,u=a*s-n*c,h=n*l-o*s,p=Math.sqrt(d*d+u*u+h*h);return p===0?(r[0]=0,r[1]=0,r[2]=0):(r[0]=d/p,r[1]=u/p,r[2]=h/p),r},rayTriangleIntersect:(()=>{let e=new Ai(3),t=new Ai(3),i=new Ai(3),r=new Ai(3),n=new Ai(3);return(o,a,s,l,c,d)=>{d||=k.vec3();let u=k.subVec3(l,s,e),h=k.subVec3(c,s,t),p=k.cross3Vec3(a,h,i),A=k.dotVec3(u,p);if(A<1e-6)return null;let f=k.subVec3(o,s,r),m=k.dotVec3(f,p);if(m<0||m>A)return null;let g=k.cross3Vec3(f,u,n),w=k.dotVec3(a,g);if(w<0||m+w>A)return null;let v=k.dotVec3(h,g)/A;return d[0]=o[0]+v*a[0],d[1]=o[1]+v*a[1],d[2]=o[2]+v*a[2],d}})(),rayPlaneIntersect:(()=>{let e=new Ai(3),t=new Ai(3),i=new Ai(3),r=new Ai(3);return(n,o,a,s,l,c)=>{c||=k.vec3(),o=k.normalizeVec3(o,e);let d=k.subVec3(s,a,t),u=k.subVec3(l,a,i),h=k.cross3Vec3(d,u,r);k.normalizeVec3(h,h);let p=-k.dotVec3(a,h),A=-(k.dotVec3(n,h)+p)/k.dotVec3(o,h);return c[0]=n[0]+A*o[0],c[1]=n[1]+A*o[1],c[2]=n[2]+A*o[2],c}})(),cartesianToBarycentric:(()=>{let e=new Ai(3),t=new Ai(3),i=new Ai(3);return(r,n,o,a,s)=>{let l=k.subVec3(a,n,e),c=k.subVec3(o,n,t),d=k.subVec3(r,n,i),u=k.dotVec3(l,l),h=k.dotVec3(l,c),p=k.dotVec3(l,d),A=k.dotVec3(c,c),f=k.dotVec3(c,d),m=u*A-h*h;if(m===0)return null;let g=1/m,w=(A*p-h*f)*g,v=(u*f-h*p)*g;return s[0]=1-w-v,s[1]=v,s[2]=w,s}})(),barycentricInsideTriangle(e){let t=e[1],i=e[2];return i>=0&&t>=0&&i+t<1},barycentricToCartesian(e,t,i,r,n=k.vec3()){let o=e[0],a=e[1],s=e[2];return n[0]=t[0]*o+i[0]*a+r[0]*s,n[1]=t[1]*o+i[1]*a+r[1]*s,n[2]=t[2]*o+i[2]*a+r[2]*s,n},mergeVertices(e,t,i,r){let n={},o=[],a=[],s=t?[]:null,l=i?[]:null,c=[],d,u,h,p,A=10**4,f,m,g=0;for(f=0,m=e.length;f<m;f+=3)d=e[f],u=e[f+1],h=e[f+2],p=`${Math.round(d*A)}_${Math.round(u*A)}_${Math.round(h*A)}`,n[p]===void 0&&(n[p]=a.length/3,a.push(d),a.push(u),a.push(h),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]))),o[f/3]=n[p],g+=2;for(f=0,m=r.length;f<m;f++)c[f]=o[r[f]];let w={positions:a,indices:c};return s&&(w.normals=s),l&&(w.uv=l),w},buildNormals:(()=>{let e=new Ai(3),t=new Ai(3),i=new Ai(3),r=new Ai(3),n=new Ai(3),o=new Ai(3);return(a,s,l)=>{let c,d,u=Array(a.length/3),h,p,A;for(c=0,d=s.length;c<d;c+=3){h=s[c],p=s[c+1],A=s[c+2],e[0]=a[h*3],e[1]=a[h*3+1],e[2]=a[h*3+2],t[0]=a[p*3],t[1]=a[p*3+1],t[2]=a[p*3+2],i[0]=a[A*3],i[1]=a[A*3+1],i[2]=a[A*3+2],k.subVec3(t,e,r),k.subVec3(i,e,n);let v=k.vec3();k.normalizeVec3(k.cross3Vec3(r,n,o),v),u[h]||(u[h]=[]),u[p]||(u[p]=[]),u[A]||(u[A]=[]),u[h].push(v),u[p].push(v),u[A].push(v)}l=l&&l.length===a.length?l:new Float32Array(a.length);let f,m,g,w;for(c=0,d=u.length;c<d;c++){f=u[c].length,m=0,g=0,w=0;for(let v=0;v<f;v++)m+=u[c][v][0],g+=u[c][v][1],w+=u[c][v][2];l[c*3]=m/f,l[c*3+1]=g/f,l[c*3+2]=w/f}return l}})(),buildTangents:(()=>{let e=new Ai(3),t=new Ai(3),i=new Ai(3),r=new Ai(3),n=new Ai(3),o=new Ai(3),a=new Ai(3);return(s,l,c)=>{let d=new Float32Array(s.length);for(let u=0;u<l.length;u+=3){let h=l[u],p=s.subarray(h*3,h*3+3),A=c.subarray(h*2,h*2+2);h=l[u+1];let f=s.subarray(h*3,h*3+3),m=c.subarray(h*2,h*2+2);h=l[u+2];let g=s.subarray(h*3,h*3+3),w=c.subarray(h*2,h*2+2),v=k.subVec3(f,p,e),b=k.subVec3(g,p,t),y=k.subVec2(m,A,i),C=k.subVec2(w,A,r),B=1/(y[0]*C[1]-y[1]*C[0]),I=k.mulVec3Scalar(k.subVec3(k.mulVec3Scalar(v,C[1],n),k.mulVec3Scalar(b,y[1],o),a),B,o),E;for(let P=0;P<3;P++)E=l[u+P]*3,d[E]+=I[0],d[E+1]+=I[1],d[E+2]+=I[2]}return d}})(),buildPickTriangles(e,t,i){let r=t.length,n=i?new Uint16Array(r*9):new Float32Array(r*9),o=new Uint8Array(r*12),a=0,s,l=0,c=0,d,u,h,p,A;for(let f=0;f<r;f+=3)A=a>>24&255,p=a>>16&255,h=a>>8&255,u=a&255,d=t[f],s=d*3,n[l++]=e[s],n[l++]=e[s+1],n[l++]=e[s+2],o[c++]=u,o[c++]=h,o[c++]=p,o[c++]=A,d=t[f+1],s=d*3,n[l++]=e[s],n[l++]=e[s+1],n[l++]=e[s+2],o[c++]=u,o[c++]=h,o[c++]=p,o[c++]=A,d=t[f+2],s=d*3,n[l++]=e[s],n[l++]=e[s+1],n[l++]=e[s+2],o[c++]=u,o[c++]=h,o[c++]=p,o[c++]=A,a++;return{positions:n,colors:o}},faceToVertexNormals(e,t,i={}){let r=i.smoothNormalsAngleThreshold||20,n={},o=[],a={},s,l,c,d,u,h=10**4,p,A,f,m,g,w;for(A=0,m=e.length;A<m;A+=3){p=A/3,l=e[A],c=e[A+1],d=e[A+2],u=`${Math.round(l*h)}_${Math.round(c*h)}_${Math.round(d*h)}`,n[u]===void 0?n[u]=[p]:n[u].push(p);let v=k.normalizeVec3([t[A],t[A+1],t[A+2]]);o[p]=v,s=k.vec4([v[0],v[1],v[2],1]),a[p]=s}for(u in n)if(n.hasOwnProperty(u)){let v=n[u],b=v.length;for(A=0;A<b;A++){let y=v[A];for(s=a[y],f=0;f<b;f++){if(A===f)continue;let C=v[f];g=o[y],w=o[C],Math.abs(k.angleVec3(g,w)/k.DEGTORAD)<r&&(s[0]+=w[0],s[1]+=w[1],s[2]+=w[2],s[3]+=1)}}}for(A=0,m=t.length;A<m;A+=3)s=a[A/3],t[A+0]=s[0]/s[3],t[A+1]=s[1]/s[3],t[A+2]=s[2]/s[3]},transformRay:(()=>{let e=new Ai(4),t=new Ai(4);return(i,r,n,o,a)=>{e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=1,k.transformVec4(i,e,t),o[0]=t[0],o[1]=t[1],o[2]=t[2],e[0]=n[0],e[1]=n[1],e[2]=n[2],k.transformVec3(i,e,t),k.normalizeVec3(t),a[0]=t[0],a[1]=t[1],a[2]=t[2]}})(),canvasPosToWorldRay:(()=>{let e=new Ai(16),t=new Ai(4),i=new Ai(4),r=(n,o,a,s,l)=>{l[0]=n,l[1]=o,l[2]=a,l[3]=1,k.transformVec4(e,l,l),s||k.mulVec4Scalar(l,1/l[3])};return(n,o,a,s,l,c,d)=>{let u=s==="ortho";k.mulMat4(a,o,e),k.inverseMat4(e,e);let h=2*l[0]/n.clientWidth-1,p=1-2*l[1]/n.clientHeight;r(h,p,-1,u,t),r(h,p,1,u,i),c[0]=t[0],c[1]=t[1],c[2]=t[2],k.subVec3(i,t,d),k.normalizeVec3(d)}})(),canvasPosToLocalRay:(()=>{let e=new Ai(3),t=new Ai(3);return(i,r,n,o,a,s,l,c)=>{k.canvasPosToWorldRay(i,r,n,o,s,e,t),k.worldRayToLocalRay(a,e,t,l,c)}})(),worldRayToLocalRay:(()=>{let e=new Ai(16),t=new Ai(4),i=new Ai(4);return(r,n,o,a,s)=>{let l=k.inverseMat4(r,e);t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=1,k.transformVec4(l,t,i),a[0]=i[0],a[1]=i[1],a[2]=i[2],k.transformVec3(l,o,s)}})(),buildKDTree:(()=>{let e=new Float32Array;function t(i,r,n,o){let a=new Ai(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 w=r[d+g]*3;n[w]<a[0]&&(a[0]=n[w]),n[w]>a[3]&&(a[3]=n[w]),n[w+1]<a[1]&&(a[1]=n[w+1]),n[w+1]>a[4]&&(a[4]=n[w+1]),n[w+2]<a[2]&&(a[2]=n[w+2]),n[w+2]>a[5]&&(a[5]=n[w+2])}}if(i.length<20||o>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 h=(a[u]+a[u+3])/2,p=Array(i.length),A=0,f=Array(i.length),m=0;for(l=0,c=i.length;l<c;++l){var d=i[l]*3;let w=r[d],v=r[d+1],b=r[d+2],y=w*3,C=v*3,B=b*3;n[y+u]<=h||n[C+u]<=h||n[B+u]<=h?p[A++]=i[l]:f[m++]=i[l]}return p.length=A,f.length=m,s.left=t(p,r,n,o+1),s.right=t(f,r,n,o+1),s}return(i,r)=>{let n=i.length/3,o=Array(n);for(let a=0;a<n;++a)o[a]=a;return t(o,i,r,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 r=0,n=e.length;r<n;r+=3)i[r+0]=e[r+0]*t[0]+t[12],i[r+1]=e[r+1]*t[5]+t[13],i[r+2]=e[r+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 r=0,n=e.length;r<n;r+=3)i[r+0]=e[r+0]*t[0]+t[6],i[r+1]=e[r+1]*t[4]+t[7];return i},octDecodeVec2(e,t){let i=e[0],r=e[1];i=(2*i+1)/255,r=(2*r+1)/255;let n=1-Math.abs(i)-Math.abs(r);n<0&&(i=(1-Math.abs(r))*(i>=0?1:-1),r=(1-Math.abs(i))*(r>=0?1:-1));let o=Math.sqrt(i*i+r*r+n*n);return t[0]=i/o,t[1]=r/o,t[2]=n/o,t},octDecodeVec2s(e,t){for(let i=0,r=0,n=e.length;i<n;i+=2){let o=e[i+0],a=e[i+1];o=(2*o+1)/255,a=(2*a+1)/255;let s=1-Math.abs(o)-Math.abs(a);s<0&&(o=(1-Math.abs(a))*(o>=0?1:-1),a=(1-Math.abs(o))*(a>=0?1:-1));let l=Math.sqrt(o*o+a*a+s*s);t[r+0]=o/l,t[r+1]=a/l,t[r+2]=s/l,r+=3}return t}};k.buildEdgeIndices=(function(){let e=[],t=[],i=[],r=[],n=[],o=0,a=new Uint16Array(3),s=new Uint16Array(3),l=new Uint16Array(3),c=k.vec3(),d=k.vec3(),u=k.vec3(),h=k.vec3(),p=k.vec3(),A=k.vec3(),f=k.vec3();function m(w,v){let b={},y,C,B,I,E=1e4,P,S,D=0;for(P=0,S=w.length;P<S;P+=3)y=w[P],C=w[P+1],B=w[P+2],I=Math.round(y*E)+"_"+Math.round(C*E)+"_"+Math.round(B*E),b[I]===void 0&&(b[I]=D/3,e[D++]=y,e[D++]=C,e[D++]=B),t[P/3]=b[I];for(P=0,S=v.length;P<S;P++)r[P]=t[v[P]],i[r[P]]=v[P]}function g(w,v){o=0;for(let b=0,y=w;b<y;b+=3){let C=r[b]*3,B=r[b+1]*3,I=r[b+2]*3;v?(a[0]=e[C],a[1]=e[C+1],a[2]=e[C+2],s[0]=e[B],s[1]=e[B+1],s[2]=e[B+2],l[0]=e[I],l[1]=e[I+1],l[2]=e[I+2],k.decompressPosition(a,v,c),k.decompressPosition(s,v,d),k.decompressPosition(l,v,u)):(c[0]=e[C],c[1]=e[C+1],c[2]=e[C+2],d[0]=e[B],d[1]=e[B+1],d[2]=e[B+2],u[0]=e[I],u[1]=e[I+1],u[2]=e[I+2]),k.subVec3(u,d,h),k.subVec3(c,d,p),k.cross3Vec3(h,p,A),k.normalizeVec3(A,f);let E=n[o]||(n[o]={normal:k.vec3()});E.normal[0]=f[0],E.normal[1]=f[1],E.normal[2]=f[2],o++}}return function(w,v,b,y){m(w,v),g(v.length,b);let C=[],B=Math.cos(k.DEGTORAD*y),I={},E,P,S,D,j,V=!1,Q,z,J,Y,ne,ke;for(let Oe=0,_e=v.length;Oe<_e;Oe+=3){let be=Oe/3;for(let de=0;de<3;de++)E=r[Oe+de],P=r[Oe+(de+1)%3],S=Math.min(E,P),D=Math.max(E,P),j=S+","+D,I[j]===void 0?I[j]={index1:S,index2:D,face1:be,face2:void 0}:I[j].face2=be}for(j in I)Q=I[j],!(Q.face2!==void 0&&(z=n[Q.face1].normal,J=n[Q.face2].normal,Y=k.dotVec3(z,J),Y>B))&&(ne=i[Q.index1],ke=i[Q.index2],(!V&&ne>65535||ke>65535)&&(V=!0),C.push(ne),C.push(ke));return V?new Uint32Array(C):new Uint16Array(C)}})(),k.planeClipsPositions3=function(e,t,i,r=3){for(let n=0,o=i.length;n<o;n+=r)if(Lv[0]=i[n+0]-e[0],Lv[1]=i[n+1]-e[1],Lv[2]=i[n+2]-e[2],Lv[0]*t[0]+Lv[1]*t[1]+Lv[2]*t[2]<0)return!0;return!1};var jxt=15,Ag=new Float32Array(3),Uxt=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||jxt,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 r=t.aabb;if(i>=this._maxTreeDepth){e.entities=e.entities||[],e.entities.push(t);return}if(e.left&&k.containsAABB3(e.left.aabb,r)){this._insertEntity(e.left,t,i+1);return}if(e.right&&k.containsAABB3(e.right.aabb,r)){this._insertEntity(e.right,t,i+1);return}let n=e.aabb;Ag[0]=n[3]-n[0],Ag[1]=n[4]-n[1],Ag[2]=n[5]-n[2];let o=0;if(Ag[1]>Ag[o]&&(o=1),Ag[2]>Ag[o]&&(o=2),!e.left){let a=n.slice();if(a[o+3]=(n[o]+n[o+3])/2,e.left={aabb:a},k.containsAABB3(a,r)){this._insertEntity(e.left,t,i+1);return}}if(!e.right){let a=n.slice();if(a[o]=(n[o]+n[o+3])/2,e.right={aabb:a},k.containsAABB3(a,r)){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}},Ufe=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}},hn={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 Ofe(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 r={type:e.nodeName,children:[]};if(e.nodeType===e.ELEMENT_NODE)for(var n=0;n<e.attributes.length;n++){var o=e.attributes[n],a=t[o.nodeName]||o.nodeName;r[a]=o.nodeValue}for(var s=0;s<e.childNodes.length;s++){var l=e.childNodes[s],n=Ofe(l,t);n&&r.children.push(n)}return r}}function Oxt(e){return JSON.parse(JSON.stringify(e))}var Hxt=[["0",10],["A",26],["a",26],["_",1],["$",1]].map(function(e){for(var t=[],i=e[0].charCodeAt(0),r=i+e[1],n=i;n<r;++n)t.push(n);return String.fromCharCode.apply(null,t)}).join("");function Hfe(e,t){return(!t||t===4?[0,6,12,18]:[0,6]).map(function(i){return Hxt.substr(parseInt(e/(1<<i))%64,1)}).reverse().join("")}function qxt(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 Hfe(t[0],2)+[1,4,7,10,13].map(function(i){return Hfe((t[i]<<16)+(t[i+1]<<8)+t[i+2])}).join("")}function Nxt(e,t){var i=[],r=function(n){n.type===t&&i.push(n),(n.children||[]).forEach(function(o){r(o)})};return r(e),i}function zxt(e){return new Promise(function(t,i){setTimeout(t,e)})}function Vxt(e){return new Promise(function(t,i){var r=new XMLHttpRequest;r.open(e.method||"GET",e.url,!0),r.onload=function(n){r.readyState===4&&(r.status===200?t(r.responseXML):i(r.statusText))},r.send(null)})}var Qxt=(function(){for(var e={},t=window.location.search.substring(1).split("&"),i=0;i<t.length;i++){var r=t[i].split("=");if(e[r[0]]===void 0)e[r[0]]=decodeURIComponent(r[1]);else if(typeof e[r[0]]=="string"){var n=[e[r[0]],decodeURIComponent(r[1])];e[r[0]]=n}else e[r[0]].push(decodeURIComponent(r[1]))}return e})();function Gxt(e,t,i){var r=o=>{};t||=r,i||=r;var n=new XMLHttpRequest;n.overrideMimeType("application/json"),n.open("GET",e,!0),n.addEventListener("load",function(o){var a=o.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(o)},!1),n.addEventListener("error",function(o){i(o)},!1),n.send(null)}function Kxt(e,t,i){var r=s=>{};t||=r,i||=r;let n=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(n){let s=!!n[2];var o=n[3];o=window.decodeURIComponent(o),s&&(o=window.atob(o));try{let l=new ArrayBuffer(o.length),c=new Uint8Array(l);for(var a=0;a<o.length;a++)c[a]=o.charCodeAt(a);io.scheduleTask(()=>{t(l)})}catch(l){io.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 Wxt(e){return e&&!e.propertyIsEnumerable("length")&&typeof e=="object"&&typeof e.length=="number"}function Jxt(e){return typeof e=="string"||e instanceof String}function Yxt(e){return!isNaN(parseFloat(e))&&isFinite(e)}function Zxt(e){return $t.isString(e)||$t.isNumeric(e)}function Xxt(e,t){return!e||!t?!1:($t.isNumeric(e)||$t.isString(e)?`${e}`:e.id)===($t.isNumeric(t)||$t.isString(t)?`${t}`:t.id)}function $xt(e){return typeof e=="function"}function ekt(e){let t={}.constructor;return!!e&&e.constructor===t}function tkt(e){return $t.apply(e,{})}function ikt(e,t){for(let i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function rkt(e,t){for(let i in e)e.hasOwnProperty(i)&&e[i]!==void 0&&e[i]!==null&&(t[i]=e[i]);return t}function nkt(e,t){for(let i in e)e.hasOwnProperty(i)&&(t[i]===void 0||t[i]===null)&&(t[i]=e[i]);return t}function okt(e){for(let t in e)if(e.hasOwnProperty(t))return!1;return!0}function akt(e){return $t.isNumeric(e)?`${e}`:`'${e}'`}function skt(e,t){let i=new e.constructor(e.length+t.length);return i.set(e),i.set(t,e.length),i}function lkt(e){var t=[];function i(r){r.id=r.uuid,delete r.oid,t.push(r);var n=r.children;if(n)for(var o=0,a=n.length;o<a;o++){let s=n[o];s.parent=r.id,i(n[o])}r.children=[]}return i(e),t}var $t={xmlToJson:Ofe,clone:Oxt,compressGuid:qxt,findNodeOfType:Nxt,timeout:zxt,httpRequest:Vxt,loadJSON:Gxt,loadArraybuffer:Kxt,queryString:Qxt,isArray:Wxt,isString:Jxt,isNumeric:Yxt,isID:Zxt,isSameComponent:Xxt,isFunction:$xt,isObject:ekt,copy:tkt,apply:ikt,apply2:rkt,applyIf:nkt,isEmptyObject:okt,inQuotes:akt,concat:skt,flattenParentChildHierarchy:lkt},oB={},qfe=new Od,_v=new Ufe,iA={sceneId:null,time:null,startTime:null,prevTime:null,deltaTime:null},Nfe=10,Z1=[],zfe=30,lb=0,Fv,jv=0;function ckt(){this.version="1.0.0",this.scenes={},this._superTypes={},this._addScene=function(e){if(e.id){if(io.scenes[e.id]){console.error(`[ERROR] Scene ${$t.inQuotes(e.id)} already exists`);return}}else e.id=qfe.addItem({});io.scenes[e.id]=e;let t=e.ticksPerOcclusionTest,i=e.ticksPerRender;oB[e.id]={ticksPerOcclusionTest:t,ticksPerRender:i,renderCountdown:i},hn.components.scenes++,e.once("destroyed",()=>{qfe.removeItem(e.id),delete io.scenes[e.id],delete oB[e.id],hn.components.scenes--})},this.clear=function(){let e;for(let t in io.scenes)io.scenes.hasOwnProperty(t)&&(e=io.scenes[t],t==="default.scene"?e.clear():(e.destroy(),delete io.scenes[e.id]))},this.scheduleTask=function(e,t=null){_v.push(e),_v.push(t)},this.runTasks=function(e=-1){let t=new Date().getTime(),i,r,n=0;for(;_v.length>0&&(e<0||t<e);)i=_v.shift(),r=_v.shift(),r?i.call(r):i(),t=new Date().getTime(),n++;return n},this.getNumTasks=function(){return _v.length}}var io=new ckt,Vfe=function(){let e=Date.now();if(Fv=e-lb,lb>0&&Fv>0){var t=1e3/Fv;jv+=t,Z1.push(t),Z1.length>=zfe&&(jv-=Z1.shift()),hn.frame.fps=Math.round(jv/Z1.length)}for(let i in io.scenes)io.scenes[i].compile();Gfe(e),lb=e};function dkt(e,t){let i=Date.now()+t;function r(){let n=Date.now()-i;e(),i+=t,setTimeout(r,Math.max(0,t-n))}return r(),{cancel:function(){}}}dkt(()=>{Vfe()},100);var Qfe=function(){let e=Date.now();if(Fv=e-lb,lb>0&&Fv>0){var t=1e3/Fv;jv+=t,Z1.push(t),Z1.length>=zfe&&(jv-=Z1.shift()),hn.frame.fps=Math.round(jv/Z1.length)}Gfe(e),ukt(e),hkt(),window.requestPostAnimationFrame===void 0?requestAnimationFrame(Qfe):window.requestPostAnimationFrame(Vfe)};Qfe();function Gfe(e){let t=io.runTasks(e+Nfe),i=io.getNumTasks();hn.frame.tasksRun=t,hn.frame.tasksScheduled=i,hn.frame.tasksBudget=Nfe}function ukt(e){for(var t in iA.time=e,io.scenes)if(io.scenes.hasOwnProperty(t)){var i=io.scenes[t];iA.sceneId=t,iA.startTime=i.startTime,iA.deltaTime=iA.prevTime==null?0:iA.time-iA.prevTime,i.fire("tick",iA,!0)}iA.prevTime=e}function hkt(){let e=io.scenes,t,i,r,n,o;for(o in e)e.hasOwnProperty(o)&&(t=e[o],i=oB[o],i||=oB[o]={},r=t.ticksPerOcclusionTest,i.ticksPerOcclusionTest!==r&&(i.ticksPerOcclusionTest=r,i.renderCountdown=r),--t.occlusionTestCountdown<=0&&(t.doOcclusionTest(),t.occlusionTestCountdown=r),n=t.ticksPerRender,i.ticksPerRender!==n&&(i.ticksPerRender=n,i.renderCountdown=n),--i.renderCountdown===0&&(t.render(!1),i.renderCountdown=n))}var Pr=class hke{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 hke)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,r){this._events||={},this._eventSubs||(this._eventSubs={},this._eventSubsNum={}),r!==!0&&(this._events[t]=i||!0);let n=this._eventSubs[t],o;if(n)for(let a in n)n.hasOwnProperty(a)&&(o=n[a],this._eventCallDepth++,this._eventCallDepth<300?o.callback.call(o.scope,i):this.error("fire: potential stack overflow from recursive event '"+t+"' - dropping this event"),this._eventCallDepth--)}on(t,i,r){this._events||={},this._subIdMap||=new Od,this._subIdEvents||={},this._eventSubs||={},this._eventSubsNum||={};let n=this._eventSubs[t];n?this._eventSubsNum[t]++:(n={},this._eventSubs[t]=n,this._eventSubsNum[t]=1);let o=this._subIdMap.addItem();n[o]={callback:i,scope:r||this},this._subIdEvents[o]=t;let a=this._events[t];return a!==void 0&&i.call(r||this,a),o}off(t){if(t==null||!this._subIdEvents)return;let i=this._subIdEvents[t];if(i){delete this._subIdEvents[t];let r=this._eventSubs[i];r&&(delete r[t],this._eventSubsNum[i]--),this._subIdMap.removeItem(t)}}once(t,i,r){let n=this,o=this.on(t,function(a){n.off(o),i.call(r||this,a)},r)}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+" "+$t.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 r=t.component,n=t.sceneDefault,o=t.sceneSingleton,a=t.type,s=t.on,l=t.recompiles!==!1;if(r&&($t.isNumeric(r)||$t.isString(r))){let p=r;if(r=this.scene.components[p],!r){this.error("Component not found: "+$t.inQuotes(p));return}}if(!r){if(o===!0){let p=this.scene.types[a];for(let A in p)if(p.hasOwnProperty){r=p[A];break}if(!r)return this.error("Scene has no default component for '"+i+"'"),null}else if(n===!0&&(r=this.scene[i],!r))return this.error("Scene has no default component for '"+i+"'"),null}if(r){if(r.scene.id!==this.scene.id){this.error("Not in same scene: "+r.type+" "+$t.inQuotes(r.id));return}if(a&&!r.isType(a)){this.error("Expected a "+a+" type or subtype: "+r.type+" "+$t.inQuotes(r.id));return}}this._attachments||={};let c=this._attached[i],d,u,h;if(c){if(r&&c.id===r.id)return;let p=this._attachments[c.id];for(d=p.subs,u=0,h=d.length;u<h;u++)c.off(d[u]);delete this._attached[i],delete this._attachments[c.id];let A=p.params.onDetached;A&&($t.isFunction(A)?A(c):A.scope?A.callback.call(A.scope,c):A.callback(c)),p.managingLifecycle&&c.destroy()}if(r){let p={params:t,component:r,subs:[],managingLifecycle:!1};p.subs.push(r.once("destroyed",function(){p.params.component=null,this._attach(p.params)},this)),l&&p.subs.push(r.on("dirty",function(){this.fire("dirty",this)},this)),this._attached[i]=r,this._attachments[r.id]=p;let A=t.onAttached;if(A&&($t.isFunction(A)?A(r):A.scope?A.callback.call(A.scope,r):A.callback(r)),s){let f,m,g,w;for(f in s)if(s.hasOwnProperty(f)){if(m=s[f],$t.isFunction(m)?(g=m,w=null):(g=m.callback,w=m.scope),!g)continue;p.subs.push(r.on(f,g,w))}}}return l&&this.fire("dirty",this),this.fire(i,r),r}_checkComponent(t,i){if(!i.isComponent)if($t.isID(i)){let r=i;if(i=this.scene.components[r],!i){this.error("Component not found: "+r);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($t.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(i.scene.id!==this.scene.id){this.error("Not in same scene: "+i.type);return}for(var r=0,n=t.length;r<n;r++)if(t[r]===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():io.scheduleTask(this._doUpdate,this))}_doUpdate(){this._updateScheduled&&(this._updateScheduled=!1,this._update&&this._update())}scheduleTask(t){io.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,r,n,o,a;if(this._attachments){for(t in this._attachments)if(this._attachments.hasOwnProperty(t)){for(i=this._attachments[t],r=i.component,n=i.subs,o=0,a=n.length;o<a;o++)r.off(n[o]);i.managingLifecycle&&r.destroy()}}if(this._ownedComponents)for(t in this._ownedComponents)this._ownedComponents.hasOwnProperty(t)&&(r=this._ownedComponents[t],r.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}},pkt=k.vec3(),Akt=k.vec3(),fkt=k.mat4(),fg=class{constructor(){this.normal=k.vec3(),this.offset=0,this.testVertex=k.vec3()}set(e,t,i,r){let n=1/Math.sqrt(e*e+t*t+i*i);this.normal[0]=e*n,this.normal[1]=t*n,this.normal[2]=i*n,this.offset=r*n,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}},$c=class{constructor(){this.planes=[new fg,new fg,new fg,new fg,new fg,new fg]}};$c.INSIDE=0,$c.INTERSECT=1,$c.OUTSIDE=2;function Kfe(e,t,i){let r=k.mulMat4(i,t,fkt),n=r[0],o=r[1],a=r[2],s=r[3],l=r[4],c=r[5],d=r[6],u=r[7],h=r[8],p=r[9],A=r[10],f=r[11],m=r[12],g=r[13],w=r[14],v=r[15];e.planes[0].set(s-n,u-l,f-h,v-m),e.planes[1].set(s+n,u+l,f+h,v+m),e.planes[2].set(s-o,u-c,f-p,v-g),e.planes[3].set(s+o,u+c,f+p,v+g),e.planes[4].set(s-a,u-d,f-A,v-w),e.planes[5].set(s+a,u+d,f+A,v+w)}function aB(e,t){let i=$c.INSIDE,r=pkt,n=Akt;r[0]=t[0],r[1]=t[1],r[2]=t[2],n[0]=t[3],n[1]=t[4],n[2]=t[5];let o=[r,n];for(let a=0;a<6;++a){let s=e.planes[a];if(s.normal[0]*o[s.testVertex[0]][0]+s.normal[1]*o[s.testVertex[1]][1]+s.normal[2]*o[s.testVertex[2]][2]+s.offset<0)return $c.OUTSIDE;s.normal[0]*o[1-s.testVertex[0]][0]+s.normal[1]*o[1-s.testVertex[1]][1]+s.normal[2]*o[1-s.testVertex[2]][2]+s.offset<0&&(i=$c.INTERSECT)}return i}var cb=class L8 extends Pr{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=k.vec2(),this._canvasMarqueeCorner2=k.vec2(),this._canvasMarquee=k.AABB2(),this._marqueeFrustum=new $c,this._marqueeFrustumProjMat=k.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!==L8.PICK_MODE_INSIDE&&t!==L8.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===L8.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=(r,n=$c.INTERSECT)=>{if(n===$c.INTERSECT&&(n=aB(this._marqueeFrustum,r.aabb)),n!==$c.OUTSIDE){if(r.entities){let o=r.entities;for(let a=0,s=o.length;a<s;a++){let l=o[a];if(!l.visible)continue;let c=l.aabb;this._pickMode===L8.PICK_MODE_INSIDE?aB(this._marqueeFrustum,c)===$c.INSIDE&&t.push(l.id):aB(this._marqueeFrustum,c)!==$c.OUTSIDE&&t.push(l.id)}}r.left&&i(r.left,n),r.right&&i(r.right,n)}};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,r=t.clientHeight,n=t.clientLeft,o=t.clientTop,a=2/i,s=2/r,l=t.clientHeight/t.clientWidth,c=(this._canvasMarquee[0]-n)*a+-1,d=(this._canvasMarquee[2]-n)*a+-1,u=-(this._canvasMarquee[3]-o)*s+1,h=-(this._canvasMarquee[1]-o)*s+1,p=this.viewer.scene.camera.frustum.near*(17*l);k.frustumMat4(c,d,u*l,h*l,p,1e4,this._marqueeFrustumProjMat),Kfe(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)}};cb.PICK_MODE_INTERSECTS=0,cb.PICK_MODE_INSIDE=1;var gkt=class extends Pr{constructor(e){super(e.marqueePicker,e);let t=e.marqueePicker,i=t.viewer.scene.canvas.canvas,r,n,o,a,s,l,c=!1,d=!1,u=!1,h;i.addEventListener("mousedown",p=>{this.getActive()&&p.button===0&&(h=setTimeout(function(){let A=t.viewer.scene.input;A.keyDown[A.KEY_CTRL]||t.clear(),r=p.pageX,n=p.pageY,s=p.offsetX,p.offsetY,t.setMarqueeCorner1([r,n]),c=!0,t.viewer.cameraControl.pointerEnabled=!1,t.setMarqueeVisible(!0),i.style.cursor="crosshair"},400),d=!0)}),i.addEventListener("mouseup",p=>{if(!this.getActive()||!c&&!u||p.button!==0)return;clearTimeout(h),o=p.pageX,a=p.pageY;let A=Math.abs(o-r),f=Math.abs(a-n);c=!1,t.viewer.cameraControl.pointerEnabled=!0,u&&=!1,(A>3||f>3)&&t.pick()}),document.addEventListener("mouseup",p=>{this.getActive()&&p.button===0&&(clearTimeout(h),c&&(t.setMarqueeVisible(!1),c=!1,d=!1,u=!0,t.viewer.cameraControl.pointerEnabled=!0))},!0),i.addEventListener("mousemove",p=>{this.getActive()&&p.button===0&&d&&(clearTimeout(h),c&&(o=p.pageX,a=p.pageY,l=p.offsetX,p.offsetY,t.setMarqueeVisible(!0),t.setMarqueeCorner2([o,a]),t.setPickMode(s<l?cb.PICK_MODE_INSIDE:cb.PICK_MODE_INTERSECTS)))})}setActive(e){this._active!==e&&(this._active=e,this.fire("active",this._active))}getActive(){return this._active}destroy(){}},iO=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,r=n=>{if(!this._running)return;i||=n;let o=n-i,a=Math.min(o/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(r)};this._running=!0,requestAnimationFrame(r),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)}},Wfe=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 r=Jfe(e,i);return r?t?rO(r,t):r:null}translatePlurals(e,t,i){let r=this._messages[this._locale];if(!r)return null;let n=Jfe(e,r);return t=parseInt(""+t,10),n=t===0?n.zero:t>1?n.other:n.one,n?(n=rO(n,[t]),i&&(n=rO(n,i)),n):null}fire(e,t,i){this._events||={},this._eventSubs||={},i!==!0&&(this._events[e]=t||!0);let r=this._eventSubs[e];if(r)for(let n in r)r.hasOwnProperty(n)&&r[n].callback(t)}on(e,t){this._events||={},this._eventSubIDMap||=new Od,this._eventSubEvents||={},this._eventSubs||={};let i=this._eventSubs[e];i||(i={},this._eventSubs[e]=i);let r=this._eventSubIDMap.addItem();i[r]={callback:t},this._eventSubEvents[r]=e;let n=this._events[e];return n!==void 0&&t(n),r}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 Jfe(e,t){if(t[e])return t[e];let i=e.split("."),r=t;for(let n=0,o=i.length;r&&n<o;n++){let a=i[n];r=r[a]}return r}function rO(e,t=[]){return e.replace(/\{\{|\}\}|\{(\d+)\}/g,function(i,r){return i==="{{"?"{":i==="}}"?"}":t[r]})}var db=class extends Pr{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,r=e+t;i<0&&(i=0),r>1&&(r=1);var n=this.getPoint(i),o=this.getPoint(r),a=k.subVec3(o,n,[]);return k.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,r=this.getPoint(0),n,o=0;for(t.push(0),n=1;n<=e;n++)i=this.getPoint(n/e),o+=k.lenVec3(k.subVec3(i,r,[])),t.push(o),r=i;return this.cacheArcLengths=t,t}_updateArcLengths(){this.needsUpdate=!0,this._getLengths()}getUToTMapping(e,t){for(var i=this._getLengths(),r=0,n=i.length,o,a=t||e*i[n-1],s=0,l=n-1,c;s<=l;)if(r=Math.floor(s+(l-s)/2),c=i[r]-a,c<0)s=r+1;else if(c>0)l=r-1;else{l=r;break}if(r=l,i[r]===a)return o=r/(n-1),o;var d=i[r],u=i[r+1]-d,h=(a-d)/u;return o=(r+h)/(n-1),o}},sB=class extends db{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,r=Math.floor(i),n=i-r,o=t[r===0?r:r-1],a=t[r],s=t[r>t.length-2?t.length-1:r+1],l=t[r>t.length-3?t.length-1:r+2],c=k.vec3();return c[0]=k.catmullRomInterpolate(o[0],a[0],s[0],l[0],n),c[1]=k.catmullRomInterpolate(o[1],a[1],s[1],l[1],n),c[2]=k.catmullRomInterpolate(o[2],a[2],s[2],l[2],n),c}getJSON(){return{points,t:this._t}}},nO=k.vec3(),mkt=class extends Pr{get type(){return"CameraPath"}constructor(e,t={}){super(e,t),this._frames=[],this._eyeCurve=new sB(this),this._lookCurve=new sB(this),this._upCurve=new sB(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,r){let n={t:e,eye:t.slice(0),look:i.slice(0),up:r.slice(0)};this._frames.push(n),this._eyeCurve.points.push(n.eye),this._lookCurve.points.push(n.look),this._upCurve.points.push(n.up)}addFrames(e){let t;for(let i=0,r=e.length;i<r;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,nO),t.look=this._lookCurve.getPoint(e,nO),t.up=this._upCurve.getPoint(e,nO)}sampleFrame(e,t,i,r){e=e<0?0:e>1?1:e,this._eyeCurve.getPoint(e,t),this._lookCurve.getPoint(e,i),this._upCurve.getPoint(e,r)}smoothFrameTimes(e){if(this._frames.length===0)return;let t=k.vec3();var i=0;this._frames[0].t=0;let r=[];for(let o=1,a=this._frames.length;o<a;o++){var n=k.lenVec3(k.subVec3(this._frames[o].eye,this._frames[o-1].eye,t));r[o]=n,i+=n}for(let o=1,a=this._frames.length;o<a;o++){let s=r[o]/i*e;this._frames[o].t=this._frames[o-1].t+s}}clearFrames(){this._frames=[],this._eyeCurve.points=[],this._lookCurve.points=[],this._upCurve.points=[]}},oO=k.vec3(),aO=k.vec3(),sO=k.vec3(),Yfe=k.vec3(),gg=k.vec3(),lO=class yP extends Pr{get type(){return"CameraFlightAnimation"}constructor(t,i={}){super(t,i),this._look1=k.vec3(),this._eye1=k.vec3(),this._up1=k.vec3(),this._look2=k.vec3(),this._eye2=k.vec3(),this._up2=k.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,r){t||=this.scene,this._flying&&this.stop(),this._flying=!1,this._flyingEye=!1,this._flyingLook=!1,this._flyingEyeLookUp=!1,this._callback=i,this._callbackScope=r;let n=this.scene.camera,o=!!t.projection&&t.projection!==n.projection;this._eye1[0]=n.eye[0],this._eye1[1]=n.eye[1],this._eye1[2]=n.eye[2],this._look1[0]=n.look[0],this._look1[1]=n.look[1],this._look1[2]=n.look[2],this._up1[0]=n.up[0],this._up1[1]=n.up[1],this._up1[2]=n.up[2],this._orthoScale1=n.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 h=t;if(($t.isNumeric(h)||$t.isString(h))&&(d=h,h=this.scene.components[d],!h)){this.error("Component not found: "+$t.inQuotes(d)),i&&(r?i.call(r):i());return}o||(a=h.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 h=k.getAABB3Center(a);this._look2=u||h;let p=k.subVec3(this._eye1,this._look1,oO),A=k.normalizeVec3(p),f=u?k.getAABB3DiagPoint(a,u):k.getAABB3Diag(a),m=t.fitFOV||this._fitFOV,g=Math.abs(f/Math.tan(m*k.DEGTORAD));this._orthoScale2=f*1.1,this._eye2[0]=this._look2[0]+A[0]*g,this._eye2[1]=this._look2[1]+A[1]*g,this._eye2[2]=this._look2[2]+A[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]));o?(t.projection==="ortho"&&n.projection!=="ortho"&&(this._projection2="ortho",this._projMatrix1=n.projMatrix.slice(),this._projMatrix2=n.ortho.matrix.slice(),n.projection="customProjection"),t.projection==="perspective"&&n.projection!=="perspective"&&(this._projection2="perspective",this._projMatrix1=n.projMatrix.slice(),this._projMatrix2=n.perspective.matrix.slice(),n.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,io.scheduleTask(this._update,this)}jumpTo(t){this._jumpTo(t)}_jumpTo(t){this._flying&&this.stop();let i=this.scene.camera;var r,n,o,a,s;if(t.aabb)r=t.aabb;else if(t.length===6)r=t;else if(t.eye||t.look||t.up)o=t.eye,a=t.look,s=t.up;else{let d=t;if(($t.isNumeric(d)||$t.isString(d))&&(n=d,d=this.scene.components[n],!d)){this.error("Component not found: "+$t.inQuotes(n));return}r=d.aabb||this.scene.aabb}let l=t.poi;if(r){if(r[3]<=r[0]||r[4]<=r[1]||r[5]<=r[2])return;var c=l?k.getAABB3DiagPoint(r,l):k.getAABB3Diag(r);a=l||k.getAABB3Center(r,a),this._trail?k.subVec3(i.look,a,gg):k.subVec3(i.eye,i.look,gg),k.normalizeVec3(gg);let d;d=(t.fit===void 0?this._fit:t.fit)?Math.abs(c/Math.tan((t.fitFOV||this._fitFOV)*k.DEGTORAD)):k.lenVec3(k.subVec3(i.eye,i.look,oO)),k.mulVec3Scalar(gg,d),i.eye=k.addVec3(a,gg,oO),i.look=a,this.scene.camera.ortho.scale=c*1.1}else(o||a||s)&&(o&&(i.eye=o),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 r=this.easing?yP._ease(t,0,1,1):t,n=this.scene.camera;if(this._flyingEye||this._flyingLook?this._flyingEye?(k.subVec3(n.eye,n.look,gg),n.eye=k.lerpVec3(r,0,1,this._eye1,this._eye2,sO),n.look=k.subVec3(sO,gg,aO)):this._flyingLook&&(n.look=k.lerpVec3(r,0,1,this._look1,this._look2,aO),n.up=k.lerpVec3(r,0,1,this._up1,this._up2,Yfe)):this._flyingEyeLookUp&&(n.eye=k.lerpVec3(r,0,1,this._eye1,this._eye2,sO),n.look=k.lerpVec3(r,0,1,this._look1,this._look2,aO),n.up=k.lerpVec3(r,0,1,this._up1,this._up2,Yfe)),this._projection2){let o=this._projection2==="ortho"?yP._easeOutExpo(t,0,1,1):yP._easeInCubic(t,0,1,1);n.customProjection.matrix=k.lerpMat4(o,0,1,this._projMatrix1,this._projMatrix2)}else n.ortho.scale=this._orthoScale1+t*(this._orthoScale2-this._orthoScale1);if(i){n.ortho.scale=this._orthoScale2,this.stop();return}io.scheduleTask(this._update,this)}static _ease(t,i,r,n){return t/=n,-r*t*(t-2)+i}static _easeInCubic(t,i,r,n){return t/=n,r*t*t*t+i}static _easeOutExpo(t,i,r,n){return r*(-(2**(-10*t/n))+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()}},ub=class Ad extends Pr{get type(){return"CameraPathAnimation"}constructor(t,i={}){super(t,i),this._cameraFlightAnimation=new lO(this),this._t=0,this.state=Ad.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,r,n=performance.now(),o=this._lastTime?(n-this._lastTime)*.001:0;if(this._lastTime=n,o!==0)switch(this.state){case Ad.SCRUBBING:return;case Ad.PLAYING:if(this._t+=this._playingRate*o,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=Ad.SCRUBBING,this._t=this._cameraPath.frames[i-1].t,this.fire("stopped");return}t.loadFrame(this._t);break;case Ad.PLAYING_TO:r=this._t+this._playingRate*o*this._playingDir,(this._playingDir<0&&r<=this._playingToT||this._playingDir>0&&r>=this._playingToT)&&(r=this._playingToT,this.state=Ad.SCRUBBING,this.fire("stopped")),this._t=r,t.loadFrame(this._t);break}}_ease(t,i,r,n){return t/=n,-r*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=Ad.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=Ad.PLAYING_TO)}playToFrame(t){let i=this._cameraPath;if(!i)return;let r=i.frames[t];if(!r){this.error("playToFrame - frame index out of range: "+t);return}this.playToT(r.t)}flyToFrame(t,i){let r=this._cameraPath;if(!r)return;let n=r.frames[t];if(!n){this.error("flyToFrame - frame index out of range: "+t);return}this.state=Ad.SCRUBBING,this._cameraFlightAnimation.flyTo(n,i)}scrubToT(t){let i=this._cameraPath;i&&this.scene.camera&&(this._t=t,i.loadFrame(this._t),this.state=Ad.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=Ad.SCRUBBING}}stop(){this.state=Ad.SCRUBBING,this.fire("stopped")}destroy(){super.destroy(),this.scene.off(this._tick)}};ub.STOPPED=0,ub.SCRUBBING=1,ub.PLAYING=2,ub.PLAYING_TO=3;var Zfe=class extends Pr{get type(){return"Geometry"}get isGeometry(){return!0}constructor(e,t={}){super(e,t),hn.memory.meshes++}destroy(){super.destroy(),hn.memory.meshes--}},Xfe=new Od({}),_n=class{constructor(e){this.id=Xfe.addItem({});for(let t in e)e.hasOwnProperty(t)&&(this[t]=e[t])}destroy(){Xfe.removeItem(this.id)}},xi=class{constructor(e,t,i,r,n,o,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=o,this.length=0,this.dataLength=r,this.numItems=0,this.itemSize=n,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)}},X1=(function(){let e=[],t=[],i=[],r=[],n=[],o=0,a=new Uint16Array(3),s=new Uint16Array(3),l=new Uint16Array(3),c=k.vec3(),d=k.vec3(),u=k.vec3(),h=k.vec3(),p=k.vec3(),A=k.vec3(),f=k.vec3();function m(w,v){let b={},y,C,B,I,E=1e4,P,S,D=0;for(P=0,S=w.length;P<S;P+=3)y=w[P],C=w[P+1],B=w[P+2],I=Math.round(y*E)+"_"+Math.round(C*E)+"_"+Math.round(B*E),b[I]===void 0&&(b[I]=D/3,e[D++]=y,e[D++]=C,e[D++]=B),t[P/3]=b[I];for(P=0,S=v.length;P<S;P++)r[P]=t[v[P]],i[r[P]]=v[P]}function g(w,v){o=0;for(let b=0,y=w;b<y;b+=3){let C=r[b]*3,B=r[b+1]*3,I=r[b+2]*3;v?(a[0]=e[C],a[1]=e[C+1],a[2]=e[C+2],s[0]=e[B],s[1]=e[B+1],s[2]=e[B+2],l[0]=e[I],l[1]=e[I+1],l[2]=e[I+2],k.decompressPosition(a,v,c),k.decompressPosition(s,v,d),k.decompressPosition(l,v,u)):(c[0]=e[C],c[1]=e[C+1],c[2]=e[C+2],d[0]=e[B],d[1]=e[B+1],d[2]=e[B+2],u[0]=e[I],u[1]=e[I+1],u[2]=e[I+2]),k.subVec3(u,d,h),k.subVec3(c,d,p),k.cross3Vec3(h,p,A),k.normalizeVec3(A,f);let E=n[o]||(n[o]={normal:k.vec3()});E.normal[0]=f[0],E.normal[1]=f[1],E.normal[2]=f[2],o++}}return function(w,v,b,y){m(w,v),g(v.length,b);let C=[],B=Math.cos(k.DEGTORAD*y),I={},E,P,S,D,j,V=!1,Q,z,J,Y,ne,ke;for(let Oe=0,_e=v.length;Oe<_e;Oe+=3){let be=Oe/3;for(let de=0;de<3;de++)E=r[Oe+de],P=r[Oe+(de+1)%3],S=Math.min(E,P),D=Math.max(E,P),j=S+","+D,I[j]===void 0?I[j]={index1:S,index2:D,face1:be,face2:void 0}:I[j].face2=be}for(j in I)Q=I[j],!(Q.face2!==void 0&&(z=n[Q.face1].normal,J=n[Q.face2].normal,Y=k.dotVec3(z,J),Y>B))&&(ne=i[Q.index1],ke=i[Q.index2],(!V&&ne>65535||ke>65535)&&(V=!0),C.push(ne),C.push(ke));return V?new Uint32Array(C):new Uint16Array(C)}})();function vkt(e){let t=new Float32Array(3),i=new Float32Array(3),r,n;for(r=0;r<3;r++)t[r]=Number.MAX_VALUE,i[r]=-Number.MAX_VALUE;for(r=0;r<e.length;r+=3)for(n=0;n<3;n++)t[n]=Math.min(t[n],e[r+n]),i[n]=Math.max(i[n],e[r+n]);return{min:t,max:i}}var wkt=(function(){let e=k.mat4(),t=k.mat4();return function(i,r){r||=k.mat4();let n=i[0],o=i[1],a=i[2],s=i[3]-n,l=i[4]-o,c=i[5]-a,d=65535;return k.identityMat4(e),k.translationMat4v(i,e),k.identityMat4(t),k.scalingMat4v([s/d,l/d,c/d],t),k.mulMat4(e,t,r),r}})(),bkt=(function(){let e=k.mat4(),t=k.mat4();return function(i,r,n){let o=new Uint16Array(i.length),a=new Float32Array([n[0]===r[0]?0:65535/(n[0]-r[0]),n[1]===r[1]?0:65535/(n[1]-r[1]),n[2]===r[2]?0:65535/(n[2]-r[2])]),s;for(s=0;s<i.length;s+=3)o[s+0]=Math.max(0,Math.min(65535,Math.floor((i[s+0]-r[0])*a[0]))),o[s+1]=Math.max(0,Math.min(65535,Math.floor((i[s+1]-r[1])*a[1]))),o[s+2]=Math.max(0,Math.min(65535,Math.floor((i[s+2]-r[2])*a[2])));return k.identityMat4(e),k.translationMat4v(r,e),k.identityMat4(t),k.scalingMat4v([(n[0]-r[0])/65535,(n[1]-r[1])/65535,(n[2]-r[2])/65535],t),{quantized:o,decodeMatrix:k.mulMat4(e,t,k.identityMat4())}}})();function ykt(e,t,i){let r=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])*r[0]))),i[1]=Math.max(0,Math.min(65535,Math.floor((e[1]-t[1])*r[1]))),i[2]=Math.max(0,Math.min(65535,Math.floor((e[2]-t[2])*r[2])))}function Ckt(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 xkt(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 kkt(e,t,i=new Float32Array(e.length)){for(let r=0,n=e.length;r<n;r+=3)i[r+0]=e[r+0]*t[0]+t[12],i[r+1]=e[r+1]*t[5]+t[13],i[r+2]=e[r+2]*t[10]+t[14];return i}function Bkt(e){let t=new Float32Array(2),i=new Float32Array(2),r,n;for(r=0;r<2;r++)t[r]=Number.MAX_VALUE,i[r]=-Number.MAX_VALUE;for(r=0;r<e.length;r+=2)for(n=0;n<2;n++)t[n]=Math.min(t[n],e[r+n]),i[n]=Math.max(i[n],e[r+n]);return{min:t,max:i}}var Ekt=(function(){let e=k.mat3(),t=k.mat3();return function(i,r,n){let o=new Uint16Array(i.length),a=new Float32Array([65535/(n[0]-r[0]),65535/(n[1]-r[1])]),s;for(s=0;s<i.length;s+=2)o[s+0]=Math.max(0,Math.min(65535,Math.floor((i[s+0]-r[0])*a[0]))),o[s+1]=Math.max(0,Math.min(65535,Math.floor((i[s+1]-r[1])*a[1])));return k.identityMat3(e),k.translationMat3v(r,e),k.identityMat3(t),k.scalingMat3v([(n[0]-r[0])/65535,(n[1]-r[1])/65535],t),{quantized:o,decodeMatrix:k.mulMat3(e,t,k.identityMat3())}}})();function Mkt(e){let t=new Int8Array(e.length),i,r,n,o,a;for(let s=0;s<e.length;s+=3)n=i=lB(e,s,"floor","floor"),r=cB(i),o=a=dB(e,s,r),i=lB(e,s,"ceil","floor"),r=cB(i),o=dB(e,s,r),o>a&&(n=i,a=o),i=lB(e,s,"floor","ceil"),r=cB(i),o=dB(e,s,r),o>a&&(n=i,a=o),i=lB(e,s,"ceil","ceil"),r=cB(i),o=dB(e,s,r),o>a&&(n=i,a=o),t[s]=n[0],t[s+1]=n[1];return t}function lB(e,t,i,r){let n=e[t]/(Math.abs(e[t])+Math.abs(e[t+1])+Math.abs(e[t+2])),o=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(o))*(n>=0?1:-1),s=(1-Math.abs(n))*(o>=0?1:-1);n=a,o=s}return new Int8Array([Math[i](n*127.5+(n<0?-1:0)),Math[r](o*127.5+(o<0?-1:0))])}function cB(e){let t=e[0],i=e[1];t/=t<0?127:128,i/=i<0?127:128;let r=1-Math.abs(t)-Math.abs(i);r<0&&(t=(1-Math.abs(i))*(t>=0?1:-1),i=(1-Math.abs(t))*(i>=0?1:-1));let n=Math.sqrt(t*t+i*i+r*r);return[t/n,i/n,r/n]}function dB(e,t,i){return e[t]*i[0]+e[t+1]*i[1]+e[t+2]*i[2]}function Ikt(e,t,i){i[0]=e[0]*t[0]+t[6],i[1]=e[1]*t[4]+t[7]}function Pkt(e,t,i=new Float32Array(e.length)){for(let r=0,n=e.length;r<n;r+=3)i[r+0]=e[r+0]*t[0]+t[6],i[r+1]=e[r+1]*t[4]+t[7];return i}function Skt(e,t){let i=e[0],r=e[1];i=(2*i+1)/255,r=(2*r+1)/255;let n=1-Math.abs(i)-Math.abs(r);n<0&&(i=(1-Math.abs(r))*(i>=0?1:-1),r=(1-Math.abs(i))*(r>=0?1:-1));let o=Math.sqrt(i*i+r*r+n*n);return t[0]=i/o,t[1]=r/o,t[2]=n/o,t}function Tkt(e,t){for(let i=0,r=0,n=e.length;i<n;i+=2){let o=e[i+0],a=e[i+1];o=(2*o+1)/255,a=(2*a+1)/255;let s=1-Math.abs(o)-Math.abs(a);s<0&&(o=(1-Math.abs(a))*(o>=0?1:-1),a=(1-Math.abs(o))*(a>=0?1:-1));let l=Math.sqrt(o*o+a*a+s*s);t[r+0]=o/l,t[r+1]=a/l,t[r+2]=s/l,r+=3}return t}var or={getPositionsBounds:vkt,createPositionsDecodeMatrix:wkt,compressPositions:bkt,compressPosition:ykt,decompressPositions:kkt,decompressPosition:Ckt,decompressAABB:xkt,getUVBounds:Bkt,compressUVs:Ekt,decompressUVs:Pkt,decompressUV:Ikt,compressNormals:Mkt,decompressNormals:Tkt,decompressNormal:Skt},Lh=hn.memory,$fe=k.AABB3(),so=class extends Zfe{get type(){return"ReadableGeometry"}get isReadableGeometry(){return!0}constructor(e,t={}){super(e,t),this._state=new _n({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,r=this.scene.canvas.gl;switch(t.primitive=t.primitive||"triangles",t.primitive){case"points":i.primitive=r.POINTS,i.primitiveName=t.primitive;break;case"lines":i.primitive=r.LINES,i.primitiveName=t.primitive;break;case"line-loop":i.primitive=r.LINE_LOOP,i.primitiveName=t.primitive;break;case"line-strip":i.primitive=r.LINE_STRIP,i.primitiveName=t.primitive;break;case"triangles":i.primitive=r.TRIANGLES,i.primitiveName=t.primitive;break;case"triangle-strip":i.primitive=r.TRIANGLE_STRIP,i.primitiveName=t.primitive;break;case"triangle-fan":i.primitive=r.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=r.TRIANGLES,i.primitiveName=t.primitive}if(t.positions)if(this._state.compressGeometry){let n=or.getPositionsBounds(t.positions),o=or.compressPositions(t.positions,n.min,n.max);i.positions=o.quantized,i.positionsDecodeMatrix=o.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 n=or.getUVBounds(t.uv),o=or.compressUVs(t.uv,n.min,n.max);i.uv=o.quantized,i.uvDecodeMatrix=o.decodeMatrix}else i.uv=t.uv.constructor===Float32Array?t.uv:new Float32Array(t.uv);t.normals&&(this._state.compressGeometry?i.normals=or.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(),Lh.meshes++,this._buildVBOs()}_buildVBOs(){let e=this._state,t=this.scene.canvas.gl;if(e.indices&&(e.indicesBuf=new xi(t,t.ELEMENT_ARRAY_BUFFER,e.indices,e.indices.length,1,t.STATIC_DRAW),Lh.indices+=e.indicesBuf.numItems),e.positions&&(e.positionsBuf=new xi(t,t.ARRAY_BUFFER,e.positions,e.positions.length,3,t.STATIC_DRAW),Lh.positions+=e.positionsBuf.numItems),e.normals){let i=e.compressGeometry;e.normalsBuf=new xi(t,t.ARRAY_BUFFER,e.normals,e.normals.length,3,t.STATIC_DRAW,i),Lh.normals+=e.normalsBuf.numItems}e.colors&&(e.colorsBuf=new xi(t,t.ARRAY_BUFFER,e.colors,e.colors.length,4,t.STATIC_DRAW),Lh.colors+=e.colorsBuf.numItems),e.uv&&(e.uvBuf=new xi(t,t.ARRAY_BUFFER,e.uv,e.uv.length,2,t.STATIC_DRAW),Lh.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=X1(e.positions,e.indices,e.positionsDecodeMatrix,this._edgeThreshold);this._edgeIndicesBuf=new xi(t,t.ELEMENT_ARRAY_BUFFER,i,i.length,1,t.STATIC_DRAW),Lh.indices+=this._edgeIndicesBuf.numItems}_buildPickTriangleVBOs(){let e=this._state;if(!e.positions||!e.indices)return;let t=this.scene.canvas.gl,i=k.buildPickTriangles(e.positions,e.indices,e.compressGeometry),r=i.positions,n=i.colors;this._pickTrianglePositionsBuf=new xi(t,t.ARRAY_BUFFER,r,r.length,3,t.STATIC_DRAW),this._pickTriangleColorsBuf=new xi(t,t.ARRAY_BUFFER,n,n.length,4,t.STATIC_DRAW,!0),Lh.positions+=this._pickTrianglePositionsBuf.numItems,Lh.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),or.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 r=or.getPositionsBounds(e),n=or.compressPositions(e,r.min,r.max);e=n.quantized,t.positionsDecodeMatrix=n.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),or.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),or.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||=k.AABB3(),k.positions3ToAABB3(this._state.positions,this._aabb,this._state.positionsDecodeMatrix),!1),this._aabb}get obb(){return this._obbDirty&&=(this._obb||=k.OBB3(),k.positions3ToAABB3(this._state.positions,$fe,this._state.positionsDecodeMatrix),k.AABB3ToOBB3($fe,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},r=[k.vec3(),k.vec3(),k.vec3(),k.vec3()],n=0,o=k.vec3([0,0,0]);for(let a=0;a<e.length;a+=3){let s=i(a,r[0]),l=i(a+1,r[1]),c=i(a+2,r[2]);k.addVec3(s,l,r[3]),k.addVec3(c,r[3],r[3]);let d=k.lenVec3(k.cross3Vec3(k.subVec3(l,s,r[1]),k.subVec3(c,s,r[2]),r[0]))/2;n+=d,k.mulVec3Scalar(r[3],d,r[3]),k.addVec3(o,r[3],o)}this._metrics={surfaceArea:n,centroid:k.mulVec3Scalar(o,1/n/3,o)};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(),Lh.meshes--}},mg=hn.memory,e0e=k.AABB3(),t0e=class extends Zfe{get type(){return"VBOGeometry"}get isVBOGeometry(){return!0}constructor(e,t={}){super(e,t),this._state=new _n({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=k.OBB3();let i=this._state,r=this.scene.canvas.gl;switch(t.primitive=t.primitive||"triangles",t.primitive){case"points":i.primitive=r.POINTS,i.primitiveName=t.primitive;break;case"lines":i.primitive=r.LINES,i.primitiveName=t.primitive;break;case"line-loop":i.primitive=r.LINE_LOOP,i.primitiveName=t.primitive;break;case"line-strip":i.primitive=r.LINE_STRIP,i.primitiveName=t.primitive;break;case"triangles":i.primitive=r.TRIANGLES,i.primitiveName=t.primitive;break;case"triangle-strip":i.primitive=r.TRIANGLE_STRIP,i.primitiveName=t.primitive;break;case"triangle-fan":i.primitive=r.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=r.TRIANGLES,i.primitiveName=t.primitive}if(!t.positions){this.error("Config expected: positions");return}if(!t.indices){this.error("Config expected: indices");return}var n;if(!t.positionsDecodeMatrix){let o=or.getPositionsBounds(t.positions),a=or.compressPositions(t.positions,o.min,o.max);n=a.quantized,i.positionsDecodeMatrix=a.decodeMatrix,i.positionsBuf=new xi(r,r.ARRAY_BUFFER,n,n.length,3,r.STATIC_DRAW),mg.positions+=i.positionsBuf.numItems,k.positions3ToAABB3(t.positions,this._aabb),k.positions3ToAABB3(n,e0e,i.positionsDecodeMatrix),k.AABB3ToOBB3(e0e,this._obb)}if(t.colors){let o=t.colors.constructor===Float32Array?t.colors:new Float32Array(t.colors);i.colorsBuf=new xi(r,r.ARRAY_BUFFER,o,o.length,4,r.STATIC_DRAW),mg.colors+=i.colorsBuf.numItems}if(t.uv){let o=or.getUVBounds(t.uv),a=or.compressUVs(t.uv,o.min,o.max),s=a.quantized;i.uvDecodeMatrix=a.decodeMatrix,i.uvBuf=new xi(r,r.ARRAY_BUFFER,s,s.length,2,r.STATIC_DRAW),mg.uvs+=i.uvBuf.numItems}if(t.normals){let o=or.compressNormals(t.normals),a=i.compressGeometry;i.normalsBuf=new xi(r,r.ARRAY_BUFFER,o,o.length,3,r.STATIC_DRAW,a),mg.normals+=i.normalsBuf.numItems}{let o=t.indices.constructor===Uint32Array||t.indices.constructor===Uint16Array?t.indices:new Uint32Array(t.indices);i.indicesBuf=new xi(r,r.ELEMENT_ARRAY_BUFFER,o,o.length,1,r.STATIC_DRAW),mg.indices+=i.indicesBuf.numItems;let a=X1(n,o,i.positionsDecodeMatrix,this._edgeThreshold);this._edgeIndicesBuf=new xi(r,r.ELEMENT_ARRAY_BUFFER,a,a.length,1,r.STATIC_DRAW),this._state.primitiveName==="triangles"&&(this._numTriangles=t.indices.length/3)}this._buildHash(),mg.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(),mg.meshes--}},mt={};mt.load=function(e,t){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(r){t(r.target.response)},i.send()},mt.save=function(e,t){var i="data:application/octet-stream;base64,"+btoa(mt.parse._buffToStr(e));window.location.href=i},mt.clone=function(e){return JSON.parse(JSON.stringify(e))},mt.bin={},mt.bin.f=new Float32Array(1),mt.bin.fb=new Uint8Array(mt.bin.f.buffer),mt.bin.rf=function(e,t){for(var i=mt.bin.f,r=mt.bin.fb,n=0;n<4;n++)r[n]=e[t+n];return i[0]},mt.bin.rsl=function(e,t){return e[t]|e[t+1]<<8},mt.bin.ril=function(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24},mt.bin.rASCII0=function(e,t){for(var i="";e[t]!=0;)i+=String.fromCharCode(e[t++]);return i},mt.bin.wf=function(e,t,i){var r=new Float32Array(e.buffer,t,1);r[0]=i},mt.bin.wsl=function(e,t,i){e[t]=i,e[t+1]=i>>8},mt.bin.wil=function(e,t,i){e[t]=i,e[t+1]=i>>8,e[t+2]=i>>16,e[t+3]>>24},mt.parse={},mt.parse._buffToStr=function(e){for(var t=new Uint8Array(e),i="",r=0;r<t.length;r++)i=i.concat(String.fromCharCode(t[r]));return i},mt.parse._strToBuff=function(e){for(var t=new ArrayBuffer(e.length),i=new Uint8Array(t),r=0;r<e.length;r++)i[r]=e.charCodeAt(r);return t},mt.parse._readLine=function(e,t){for(var i="";e[t]!=10;)i+=String.fromCharCode(e[t++]);return i},mt.parse.fromJSON=function(e){return JSON.parse(mt.parse._buffToStr(e))},mt.parse.toJSON=function(e){var t=JSON.stringify(e);return mt.parse._strToBuff(t)},mt.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},r=0,n=new Uint8Array(e);r<n.length;){var o=mt.parse._readLine(n,r);r+=o.length+1,o=o.replace(/ +(?= )/g,""),o=o.replace(/(^\s+|\s+$)/g,"");var a=o.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("/"),h=a[3].split("/"),p=parseInt(d[0])-1,A=parseInt(u[0])-1,f=parseInt(h[0])-1,m=parseInt(d[1])-1,g=parseInt(u[1])-1,w=parseInt(h[1])-1,v=parseInt(d[2])-1,b=parseInt(u[2])-1,y=parseInt(h[2])-1,C=t.c_verts.length/3,B=t.c_uvt.length/2,I=t.c_norms.length/3;if(p<0&&(p=C+p+1),A<0&&(A=C+A+1),f<0&&(f=C+f+1),m<0&&(m=B+m+1),g<0&&(g=B+g+1),w<0&&(w=B+w+1),v<0&&(v=I+v+1),b<0&&(b=I+b+1),y<0&&(y=I+y+1),t.i_verts.push(p,A,f),t.i_uvt.push(m,g,w),t.i_norms.push(v,b,y),a.length==5){var E=a[4].split("/"),P=parseInt(E[0])-1,S=parseInt(E[1])-1,D=parseInt(E[2])-1;P<0&&(P=C+P+1),S<0&&(S=B+S+1),D<0&&(D=I+D+1),t.i_verts.push(p,f,P),t.i_uvt.push(m,w,S),t.i_norms.push(v,y,D)}}}return i.to=t.i_verts.length,t},mt.parse.fromMD2=function(e){e=new Uint8Array(e);var t={},i={};i.ident=mt.bin.ril(e,0),i.version=mt.bin.ril(e,4),i.skinwidth=mt.bin.ril(e,8),i.skinheight=mt.bin.ril(e,12),i.framesize=mt.bin.ril(e,16),i.num_skins=mt.bin.ril(e,20),i.num_vertices=mt.bin.ril(e,24),i.num_st=mt.bin.ril(e,28),i.num_tris=mt.bin.ril(e,32),i.num_glcmds=mt.bin.ril(e,36),i.num_frames=mt.bin.ril(e,40),i.offset_skins=mt.bin.ril(e,44),i.offset_st=mt.bin.ril(e,48),i.offset_tris=mt.bin.ril(e,52),i.offset_frames=mt.bin.ril(e,56),i.offset_glcmds=mt.bin.ril(e,60),i.offset_end=mt.bin.ril(e,64);var l=i.offset_st;t.c_uvt=[];for(var r=0;r<i.num_st;r++){var n=mt.bin.rsl(e,l)/i.skinwidth,o=mt.bin.rsl(e,l+2)/i.skinheight;t.c_uvt.push(n,o),l+=4}var l=i.offset_tris,a=[],s=[];t.i_verts=a,t.i_uvt=s;for(var r=0;r<i.num_tris;r++)a.push(mt.bin.rsl(e,l),mt.bin.rsl(e,l+2),mt.bin.rsl(e,l+4)),s.push(mt.bin.rsl(e,l+6),mt.bin.rsl(e,l+8),mt.bin.rsl(e,l+10)),l+=12;var l=i.offset_skins;t.skins=[];for(var r=0;r<i.num_skins;r++)t.skins.push(mt.bin.rASCII0(e,l)),l+=64;var l=i.offset_frames;t.frames=[];for(var c=mt.parse.fromMD2._normals,r=0;r<i.num_frames;r++){var d={},u=mt.bin.rf(e,l),h=mt.bin.rf(e,l+4),p=mt.bin.rf(e,l+8);l+=12;var A=mt.bin.rf(e,l),f=mt.bin.rf(e,l+4),m=mt.bin.rf(e,l+8);l+=12,d.name=mt.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+A,e[l+1]*h+f,e[l+2]*p+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},mt.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],mt.parse.fromCollada=function(e){var t=mt.parse._buffToStr(e),i=new DOMParser().parseFromString(t,"text/xml");i=i.childNodes[0];var r={},n=i.getElementsByTagName("asset")[0],o=i.getElementsByTagName("library_geometries")[0],a=i.getElementsByTagName("library_images")[0],s=i.getElementsByTagName("library_materials")[0],l=i.getElementsByTagName("library_effects")[0];return n&&(r.asset=mt.parse.fromCollada._asset(n)),o&&(r.geometries=mt.parse.fromCollada._libGeometries(o)),a&&(r.images=mt.parse.fromCollada._libImages(a)),s&&(r.materials=mt.parse.fromCollada._libMaterials(s)),l&&(r.effects=mt.parse.fromCollada._libEffects(l)),r},mt.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}},mt.parse.fromCollada._libGeometries=function(e){e=e.getElementsByTagName("geometry");for(var t=[],i=0;i<e.length;i++){var r=e[i],n=mt.parse.fromCollada._getMesh(r.getElementsByTagName("mesh")[0]);t.push(n)}return t},mt.parse.fromCollada._getMesh=function(e){for(var t={},i=e.getElementsByTagName("source"),r=t.sources={},n=0;n<i.length;n++){for(var o=i[n].getElementsByTagName("float_array")[0].textContent.split(" "),a=o.length-(o[o.length-1]==""?1:0),s=Array(a),l=0;l<a;l++)s[l]=parseFloat(o[l]);r[i[n].getAttribute("id")]=s}t.triangles=[];var c=e.getElementsByTagName("triangles");if(c==null)return t;for(var n=0;n<c.length;n++){var d={},u=c[n];d.material=u.getAttribute("material");for(var h=u.getElementsByTagName("input"),p=[],l=0;l<h.length;l++){var A=h[l],s=[];p[parseInt(A.getAttribute("offset"))]=s;var f=A.getAttribute("semantic");d["s_"+f]=f=="VERTEX"?e.getElementsByTagName("vertices")[0].getElementsByTagName("input")[0].getAttribute("source").substring(1):A.getAttribute("source").substring(1),d["i_"+f]=s,r[d["s_"+f]]}for(var m=u.getElementsByTagName("p")[0].textContent.split(" "),g=3*Math.floor(m.length/3),l=0;l<g;l++)p[l%h.length].push(parseInt(m[l]));t.triangles.push(d)}return t},mt.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},mt.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},mt.parse.fromCollada._libEffects=function(e){e=e.getElementsByTagName("effect");for(var t={},i=0;i<e.length;i++){for(var r={},n=e[i].getElementsByTagName("newparam"),o=0;o<n.length;o++){var a=n[o].getElementsByTagName("surface")[0];a&&(r.surface=a.getElementsByTagName("init_from")[0].textContent)}t[e[i].getAttribute("id")]=r}return t},mt.parse.from3DS=function(e){e=new Uint8Array(e);var t={};if(mt.bin.rsl(e,0)!=19789)return null;for(var i=mt.bin.ril(e,2),r=6;r<i;){var n=mt.bin.rsl(e,r),o=mt.bin.ril(e,r+2);n==15677&&(t.edit=mt.parse.from3DS._edit3ds(e,r,o)),n==45056&&(t.keyf=mt.parse.from3DS._keyf3ds(e,r,o)),r+=o}return t},mt.parse.from3DS._edit3ds=function(e,t,i){for(var r={},n=t+6;n<t+i;){var o=mt.bin.rsl(e,n),a=mt.bin.ril(e,n+2);o==16384&&(r.objects??=[],r.objects.push(mt.parse.from3DS._edit_object(e,n,a))),n+=a}return r},mt.parse.from3DS._keyf3ds=function(e,t,i){for(var r={},n=t+6;n<t+i;){var o=mt.bin.rsl(e,n),a=mt.bin.ril(e,n+2);o==45058&&(r.desc??=[],r.desc.push(mt.parse.from3DS._keyf_objdes(e,n,a))),n+=a}return r},mt.parse.from3DS._keyf_objdes=function(e,t,i){for(var r={},n=t+6;n<t+i;){var o=mt.bin.rsl(e,n),a=mt.bin.ril(e,n+2);o==45072&&(r.hierarchy=mt.parse.from3DS._keyf_objhierarch(e,n,a)),o==45073&&(r.dummy_name=mt.bin.rASCII0(e,n+6)),n+=a}return r},mt.parse.from3DS._keyf_objhierarch=function(e,t,i){var r={},n=t+6;return r.name=mt.bin.rASCII0(e,n),n+=r.name.length+1,r.hierarchy=mt.bin.rsl(e,n+4),r},mt.parse.from3DS._edit_object=function(e,t,i){var r={},n=t+6;for(r.name=mt.bin.rASCII0(e,n),n+=r.name.length+1;n<t+i;){var o=mt.bin.rsl(e,n),a=mt.bin.ril(e,n+2);o==16640&&(r.mesh=mt.parse.from3DS._obj_trimesh(e,n,a)),n+=a}return r},mt.parse.from3DS._obj_trimesh=function(e,t,i){for(var r={},n=t+6;n<t+i;){var o=mt.bin.rsl(e,n),a=mt.bin.ril(e,n+2);o==16656&&(r.vertices=mt.parse.from3DS._tri_vertexl(e,n,a)),o==16672&&(r.indices=mt.parse.from3DS._tri_facel1(e,n,a)),o==16704&&(r.uvt=mt.parse.from3DS._tri_mappingcoors(e,n,a)),o==16736&&(r.local=mt.parse.from3DS._tri_local(e,n,a)),n+=a}return r},mt.parse.from3DS._tri_vertexl=function(e,t,i){var r=[],n=t+6,o=mt.bin.rsl(e,n);n+=2;for(var a=0;a<o;a++)r.push(mt.bin.rf(e,n)),r.push(mt.bin.rf(e,n+4)),r.push(mt.bin.rf(e,n+8)),n+=12;return r},mt.parse.from3DS._tri_facel1=function(e,t,i){var r=[],n=t+6,o=mt.bin.rsl(e,n);n+=2;for(var a=0;a<o;a++)r.push(mt.bin.rsl(e,n)),r.push(mt.bin.rsl(e,n+2)),r.push(mt.bin.rsl(e,n+4)),n+=8;return r},mt.parse.from3DS._tri_mappingcoors=function(e,t,i){var r=[],n=t+6,o=mt.bin.rsl(e,n);n+=2;for(var a=0;a<o;a++)r.push(mt.bin.rf(e,n)),r.push(1-mt.bin.rf(e,n+4)),n+=8;return r},mt.parse.from3DS._tri_local=function(e,t,i){var r={},n=t+6;return r.X=[mt.bin.rf(e,n),mt.bin.rf(e,n+4),mt.bin.rf(e,n+8)],n+=12,r.Y=[mt.bin.rf(e,n),mt.bin.rf(e,n+4),mt.bin.rf(e,n+8)],n+=12,r.Z=[mt.bin.rf(e,n),mt.bin.rf(e,n+4),mt.bin.rf(e,n+8)],n+=12,r.C=[mt.bin.rf(e,n),mt.bin.rf(e,n+4),mt.bin.rf(e,n+8)],n+=12,r},mt.parse.fromBIV=function(e){e=new Uint8Array(e);var t={},i={};return i.id=mt.bin.ril(e,0),i.verS=mt.bin.ril(e,4),i.texS=mt.bin.ril(e,8),i.indS=mt.bin.ril(e,12),i.verO=mt.bin.ril(e,16),i.verL=mt.bin.ril(e,20),i.texO=mt.bin.ril(e,24),i.texL=mt.bin.ril(e,28),i.indO=mt.bin.ril(e,32),i.indL=mt.bin.ril(e,36),i.verO!=0&&(t.vertices=mt.parse.fromBIV._readFloats(e,i.verO,i.verL)),i.texO!=0&&(t.uvt=mt.parse.fromBIV._readFloats(e,i.texO,i.texL)),i.indO!=0&&(t.indices=mt.parse.fromBIV._readInts(e,i.indO,i.indL,i.indS)),t},mt.parse.toBIV=function(e){for(var t=0,i=0;i<e.indices.length;i++)t=Math.max(t,e.indices[i]);var r=32;t<=65535&&(r=16);var n=40;e.vertices&&(n+=e.vertices.length*4),e.uvt&&(n+=e.uvt.length*4),e.indices&&(n+=e.indices.length*r/8);var o=new Uint8Array(n);mt.bin.wil(o,0,1769365870),mt.bin.wil(o,4,32),mt.bin.wil(o,8,32),mt.bin.wil(o,12,r);var a=40;return e.vertices&&(mt.bin.wil(o,16,a),mt.bin.wil(o,20,4*e.vertices.length),mt.parse.fromBIV._writeFloats(o,a,e.vertices),a+=4*e.vertices.length),e.uvt&&(mt.bin.wil(o,24,a),mt.bin.wil(o,28,4*e.uvt.length),mt.parse.fromBIV._writeFloats(o,a,e.uvt),a+=4*e.uvt.length),e.indices&&(mt.bin.wil(o,32,a),mt.bin.wil(o,36,4*e.indices.length),mt.parse.fromBIV._writeInts(o,a,e.indices,r)),o.buffer},mt.parse.fromBIV._readFloats=function(e,t,i){for(var r=[],n=0;n<i/4;n++)r.push(mt.bin.rf(e,t+4*n));return r},mt.parse.fromBIV._writeFloats=function(e,t,i){for(var r=0;r<i.length;r++)mt.bin.wf(e,t+4*r,i[r])},mt.parse.fromBIV._readInts=function(e,t,i,r){for(var n=[],o=0;o<i/4;o++)r==16&&n.push(mt.bin.rsl(e,t+2*o)),r==32&&n.push(mt.bin.ril(e,t+4*o));return n},mt.parse.fromBIV._writeInts=function(e,t,i,r){for(var n=0;n<i.length;n++)r==16&&mt.bin.wsl(e,t+2*n,i[n]),r==32&&mt.bin.wil(e,t+4*n,i[n])},mt.gen={},mt.gen.Plane=function(e,t,i,r){i||=1,r||=1;for(var n={verts:[],inds:[],uvt:[]},o=e+1,a=t+1,s=0;s<a;s++)for(var l=0;l<o;l++){var c=-1+2/e*l,d=-1+2/t*s;n.verts.push(c,d,0),n.uvt.push(i*l/e,r*s/t),s<t&&l<e&&n.inds.push(s*o+l,s*o+l+1,(s+1)*o+l,s*o+l+1,(s+1)*o+l,(s+1)*o+l+1)}return n},mt.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]}},mt.gen.Sphere=function(e,t){var i={verts:[],inds:[],uvt:[]};2*Math.PI/e,Math.PI/t;for(var r=e+1,n=t+1,o=0;o<n;o++)for(var a=0;a<r;a++){var s=-Math.PI/2+o*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,o/t),o<t&&a<e&&i.inds.push(r*o+a,r*o+a+1,r*(o+1)+a,r*o+a+1,r*(o+1)+a,r*(o+1)+a+1)}return i},mt.mat={},mt.mat.scale=function(e,t,i){return[e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1]},mt.mat.translate=function(e,t,i){return[1,0,0,0,0,1,0,0,0,0,1,0,e,t,i,1]},mt.mat.rotateDeg=function(e,t,i){var r=Math.PI/180;return mt.mat.rotate(e*r,t*r,i*r)},mt.mat.rotate=function(e,t,i){var r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],n=e,o=t,a=i,s=Math.cos(n),l=Math.cos(o),c=Math.cos(a),d=Math.sin(n),u=Math.sin(o),h=Math.sin(a);return r[0]=l*c,r[1]=-l*h,r[2]=u,r[4]=s*h+d*u*c,r[5]=s*c-d*u*h,r[6]=-d*l,r[8]=d*h-s*u*c,r[9]=d*c+s*u*h,r[10]=s*l,r},mt.edit={},mt.edit.interpolate=function(e,t,i,r){for(var n=0;n<e.length;n++)i[n]=e[n]+r*(t[n]-e[n])},mt.edit.transform=function(e,t){for(var i=0;i<e.length;i+=3){var r=e[i],n=e[i+1],o=e[i+2];e[i+0]=t[0]*r+t[4]*n+t[8]*o+t[12],e[i+1]=t[1]*r+t[5]*n+t[9]*o+t[13],e[i+2]=t[2]*r+t[6]*n+t[10]*o+t[14]}},mt.edit.unwrap=function(e,t,i){for(var r=Array(Math.floor(e.length/3)*i),n=0;n<e.length;n++)for(var o=0;o<i;o++)r[n*i+o]=t[e[n]*i+o];return r},mt.edit.remap=function(e,t,i,r){for(var n=Array(i.length),o=0;o<e.length;o++)for(var a=0;a<r;a++)n[t[o]*r+a]=i[e[o]*r+a];return n},mt.utils={},mt.utils.getAABB=function(e){for(var t=i=r=999999999,i,r,n=o=a=-t,o,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>n&&(n=l),c<i&&(i=c),c>o&&(o=c),d<r&&(r=d),c>a&&(a=d)}return{min:{x:t,y:i,z:r},max:{x:n,y:o,z:a}}};function Dkt(e,t={}){return new Promise(function(i,r){t.src||(console.error("load3DSGeometry: Parameter expected: src"),r());var n=e.canvas.spinner;n.processes++,$t.loadArraybuffer(t.src,function(o){o.byteLength||(console.error("load3DSGeometry: no data loaded"),n.processes--,r());var a=mt.parse.from3DS(o).edit.objects[0].mesh,s=a.vertices,l=a.uvt,c=a.indices;n.processes--,i($t.apply(t,{primitive:"triangles",positions:s,normals:null,uv:l,indices:c}))},function(o){console.error("load3DSGeometry: "+o),n.processes--,r()})})}function Rkt(e,t={}){return new Promise(function(i,r){t.src||(console.error("loadOBJGeometry: Parameter expected: src"),r());var n=e.canvas.spinner;n.processes++,$t.loadArraybuffer(t.src,function(o){o.byteLength||(console.error("loadOBJGeometry: no data loaded"),n.processes--,r());for(var a=mt.parse.fromOBJ(o),s=mt.edit.unwrap(a.i_verts,a.c_verts,3),l=mt.edit.unwrap(a.i_norms,a.c_norms,3),c=mt.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;n.processes--,i($t.apply(t,{primitive:"triangles",positions:s,normals:l.length>0?l:null,autoNormals:l.length===0,uv:c,indices:d}))},function(o){console.error("loadOBJGeometry: "+o),n.processes--,r()})})}function cO(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 r=e.zSize||1;r<0&&(console.error("negative zSize not allowed - will invert"),r*=-1);let n=e.center,o=n?n[0]:0,a=n?n[1]:0,s=n?n[2]:0,l=-t+o,c=-i+a,d=-r+s,u=t+o,h=i+a,p=r+s;return $t.apply(e,{positions:[u,h,p,l,h,p,l,c,p,u,c,p,u,h,p,u,c,p,u,c,d,u,h,d,u,h,p,u,h,d,l,h,d,l,h,p,l,h,p,l,h,d,l,c,d,l,c,p,l,c,d,u,c,d,u,c,p,l,c,p,u,c,d,l,c,d,l,h,d,u,h,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 dO(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 r=e.zSize||1;r<0&&(console.error("negative zSize not allowed - will invert"),r*=-1);let n=e.center,o=n?n[0]:0,a=n?n[1]:0,s=n?n[2]:0,l=-t+o,c=-i+a,d=-r+s,u=t+o,h=i+a,p=r+s;return $t.apply(e,{primitive:"lines",positions:[l,c,d,l,c,p,l,h,d,l,h,p,u,c,d,u,c,p,u,h,d,u,h,p],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 Lkt(e={}){return dO({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 Uv(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 r=e.height||1;r<0&&(console.error("negative height not allowed - will invert"),r*=-1);let n=e.radialSegments||32;n<0&&(console.error("negative radialSegments not allowed - will invert"),n*=-1),n<3&&(n=3);let o=e.heightSegments||1;o<0&&(console.error("negative heightSegments not allowed - will invert"),o*=-1),o<1&&(o=1);let a=!!e.openEnded,s=e.center,l=s?s[0]:0,c=s?s[1]:0,d=s?s[2]:0,u=r/2,h=r/o,p=2*Math.PI/n,A=1/n,f=(t-i)/o,m=[],g=[],w=[],v=[],b,y,C,B,I,E,P,S,D,j,V,Q=(90-Math.atan(r/(i-t))*180/Math.PI)/90;for(b=0;b<=o;b++)for(I=t-b*f,E=u-b*h,y=0;y<=n;y++)C=Math.sin(y*p),B=Math.cos(y*p),g.push(I*C),g.push(Q),g.push(I*B),w.push(y*A),w.push(b*1/o),m.push(I*C+l),m.push(E+c),m.push(I*B+d);for(b=0;b<o;b++)for(y=0;y<=n;y++)P=b*(n+1)+y,S=P+n,v.push(P),v.push(S),v.push(S+1),v.push(P),v.push(S+1),v.push(P+1);if(!a&&t>0){for(D=m.length/3,g.push(0),g.push(1),g.push(0),w.push(.5),w.push(.5),m.push(0+l),m.push(u+c),m.push(0+d),y=0;y<=n;y++)C=Math.sin(y*p),B=Math.cos(y*p),j=.5*Math.sin(y*p)+.5,V=.5*Math.cos(y*p)+.5,g.push(t*C),g.push(1),g.push(t*B),w.push(j),w.push(V),m.push(t*C+l),m.push(u+c),m.push(t*B+d);for(y=0;y<n;y++)s=D,P=D+1+y,v.push(P),v.push(P+1),v.push(s)}if(!a&&i>0){for(D=m.length/3,g.push(0),g.push(-1),g.push(0),w.push(.5),w.push(.5),m.push(0+l),m.push(0-u+c),m.push(0+d),y=0;y<=n;y++)C=Math.sin(y*p),B=Math.cos(y*p),j=.5*Math.sin(y*p)+.5,V=.5*Math.cos(y*p)+.5,g.push(i*C),g.push(-1),g.push(i*B),w.push(j),w.push(V),m.push(i*C+l),m.push(0-u+c),m.push(i*B+d);for(y=0;y<n;y++)s=D,P=D+1+y,v.push(s),v.push(P+1),v.push(P)}return $t.apply(e,{positions:m,normals:g,uv:w,indices:v})}function i0e(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 r=t/i,n=t/2,o=[],a=[],s=0;for(let l=0,c=-n;l<=i;l++,c+=r)o.push(-n),o.push(0),o.push(c),o.push(n),o.push(0),o.push(c),o.push(c),o.push(0),o.push(-n),o.push(c),o.push(0),o.push(n),a.push(s++),a.push(s++),a.push(s++),a.push(s++);return $t.apply(e,{primitive:"lines",positions:o,indices:a})}function uO(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 r=e.xSegments||1;r<0&&(console.error("negative xSegments not allowed - will invert"),r*=-1),r<1&&(r=1);let n=e.xSegments||1;n<0&&(console.error("negative zSegments not allowed - will invert"),n*=-1),n<1&&(n=1);let o=e.center,a=o?o[0]:0,s=o?o[1]:0,l=o?o[2]:0,c=t/2,d=i/2,u=Math.floor(r)||1,h=Math.floor(n)||1,p=u+1,A=h+1,f=t/u,m=i/h,g=new Float32Array(p*A*3),w=new Float32Array(p*A*3),v=new Float32Array(p*A*2),b=0,y=0,C,B,I,E,P,S,D;for(C=0;C<A;C++){let V=C*m-d;for(B=0;B<p;B++)I=B*f-c,g[b]=I+a,g[b+1]=s,g[b+2]=-V+l,w[b+1]=1,v[y]=B/u,v[y+1]=(h-C)/h,b+=3,y+=2}b=0;let j=new(g.length/3>65535?Uint32Array:Uint16Array)(u*h*6);for(C=0;C<h;C++)for(B=0;B<u;B++)E=B+p*C,P=B+p*(C+1),S=B+1+p*(C+1),D=B+1+p*C,j[b]=D,j[b+1]=P,j[b+2]=E,j[b+3]=D,j[b+4]=S,j[b+5]=P,b+=6;return $t.apply(e,{positions:g,normals:w,uv:v,indices:j})}function Ov(e={}){let t=e.lod||1,i=e.center?e.center[0]:0,r=e.center?e.center[1]:0,n=e.center?e.center[2]:0,o=e.radius||1;o<0&&(console.error("negative radius not allowed - will invert"),o*=-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=[],h,p,A,f,m,g,w,v,b,y,C,B,I,E,P;for(h=0;h<=a;h++)for(A=h*Math.PI/a,f=Math.sin(A),m=Math.cos(A),p=0;p<=s;p++)g=p*2*Math.PI/s,w=Math.sin(g),v=Math.cos(g),b=v*f,y=m,C=w*f,B=1-p/s,I=h/a,c.push(b),c.push(y),c.push(C),d.push(B),d.push(I),l.push(i+o*b),l.push(r+o*y),l.push(n+o*C);for(h=0;h<a;h++)for(p=0;p<s;p++)E=h*(s+1)+p,P=E+s+1,u.push(E+1),u.push(P+1),u.push(P),u.push(E+1),u.push(P),u.push(E);return $t.apply(e,{positions:l,normals:c,uv:d,indices:u})}function hO(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 r=e.radialSegments||32;r<0&&(console.error("negative radialSegments not allowed - will invert"),r*=-1),r<4&&(r=4);let n=e.tubeSegments||24;n<0&&(console.error("negative tubeSegments not allowed - will invert"),n*=-1),n<4&&(n=4);let o=e.arc||Math.PI*2;o<0&&(console.warn("negative arc not allowed - will invert"),o*=-1),o>360&&(o=360);let a=e.center,s=a?a[0]:0,l=a?a[1]:0,c=a?a[2]:0,d=[],u=[],h=[],p=[],A,f,m,g,w,v,b,y;for(y=0;y<=n;y++)for(b=0;b<=r;b++)A=b/r*o,f=.785398+y/n*Math.PI*2,s=t*Math.cos(A),l=t*Math.sin(A),m=(t+i*Math.cos(f))*Math.cos(A),g=(t+i*Math.cos(f))*Math.sin(A),w=i*Math.sin(f),d.push(m+s),d.push(g+l),d.push(w+c),h.push(1-b/r),h.push(y/n),v=k.normalizeVec3(k.subVec3([m,g,w],[s,l,c],[]),[]),u.push(v[0]),u.push(v[1]),u.push(v[2]);let C,B,I,E;for(y=1;y<=n;y++)for(b=1;b<=r;b++)C=(r+1)*y+b-1,B=(r+1)*(y-1)+b-1,I=(r+1)*(y-1)+b,E=(r+1)*y+b,p.push(C),p.push(B),p.push(I),p.push(I),p.push(E),p.push(C);return $t.apply(e,{positions:d,normals:u,uv:h,indices:p})}var _kt={" ":{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 Hv(e={}){var t=e.origin||[0,0,0],i=t[0],r=t[1],n=t[2],o=e.size||1,a=[],s=[],l=e.text;$t.isNumeric(l)&&(l=""+l);for(var c=(l||"").split(`
1131
+ .`+rS+YMe+nK)},XMe=function(_,R){var U=_.ownerDocument;if(U){var F=U.createElement("style");F.textContent=R,_.appendChild(F)}},oK=(function(){function _(){}return _.getOrigin=function(R){var U=_._link;return U?(U.href=R,U.href=U.href,U.protocol+U.hostname+U.port):"about:blank"},_.isSameOrigin=function(R){return _.getOrigin(R)===_._origin},_.setContext=function(R){_._link=R.document.createElement("a"),_._origin=_.getOrigin(R.location.href)},_._origin="about:blank",_})(),$Me=(function(){function _(R,U){this.context=R,this._options=U,this._cache={}}return _.prototype.addImage=function(R){var U=Promise.resolve();return this.has(R)||(oS(R)||rIe(R))&&(this._cache[R]=this.loadImage(R)).catch(function(){}),U},_.prototype.match=function(R){return this._cache[R]},_.prototype.loadImage=function(R){return o(this,void 0,void 0,function(){var U,F,X,ae,Ee=this;return a(this,function(Ne){switch(Ne.label){case 0:return U=oK.isSameOrigin(R),F=!nS(R)&&this._options.useCORS===!0&&Es.SUPPORT_CORS_IMAGES&&!U,X=!nS(R)&&!U&&!oS(R)&&typeof this._options.proxy=="string"&&Es.SUPPORT_CORS_XHR&&!F,!U&&this._options.allowTaint===!1&&!nS(R)&&!oS(R)&&!X&&!F?[2]:(ae=R,X?[4,this.proxy(ae)]:[3,2]);case 1:ae=Ne.sent(),Ne.label=2;case 2:return this.context.logger.debug("Added image "+R.substring(0,256)),[4,new Promise(function(ze,pt){var xt=new Image;xt.onload=function(){return ze(xt)},xt.onerror=pt,(nIe(ae)||F)&&(xt.crossOrigin="anonymous"),xt.src=ae,xt.complete===!0&&setTimeout(function(){return ze(xt)},500),Ee._options.imageTimeout>0&&setTimeout(function(){return pt("Timed out ("+Ee._options.imageTimeout+"ms) loading image")},Ee._options.imageTimeout)})];case 3:return[2,Ne.sent()]}})})},_.prototype.has=function(R){return this._cache[R]!==void 0},_.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},_.prototype.proxy=function(R){var U=this,F=this._options.proxy;if(!F)throw Error("No proxy defined");var X=R.substring(0,256);return new Promise(function(ae,Ee){var Ne=Es.SUPPORT_RESPONSE_TYPE?"blob":"text",ze=new XMLHttpRequest;ze.onload=function(){if(ze.status===200)if(Ne==="text")ae(ze.response);else{var Rt=new FileReader;Rt.addEventListener("load",function(){return ae(Rt.result)},!1),Rt.addEventListener("error",function(Kt){return Ee(Kt)},!1),Rt.readAsDataURL(ze.response)}else Ee("Failed to proxy resource "+X+" with status code "+ze.status)},ze.onerror=Ee;var pt=F.indexOf("?")>-1?"&":"?";if(ze.open("GET",""+F+pt+"url="+encodeURIComponent(R)+"&responseType="+Ne),Ne!=="text"&&ze instanceof XMLHttpRequest&&(ze.responseType=Ne),U._options.imageTimeout){var xt=U._options.imageTimeout;ze.timeout=xt,ze.ontimeout=function(){return Ee("Timed out ("+xt+"ms) proxying "+X)}}ze.send()})},_})(),eIe=/^data:image\/svg\+xml/i,tIe=/^data:image\/.*;base64,/i,iIe=/^data:image\/.*/i,rIe=function(_){return Es.SUPPORT_SVG_DRAWING||!oIe(_)},nS=function(_){return iIe.test(_)},nIe=function(_){return tIe.test(_)},oS=function(_){return _.substr(0,4)==="blob"},oIe=function(_){return _.substr(-3).toLowerCase()==="svg"||eIe.test(_)},ki=(function(){function _(R,U){this.type=0,this.x=R,this.y=U}return _.prototype.add=function(R,U){return new _(this.x+R,this.y+U)},_})(),vm=function(_,R,U){return new ki(_.x+(R.x-_.x)*U,_.y+(R.y-_.y)*U)},v9=(function(){function _(R,U,F,X){this.type=1,this.start=R,this.startControl=U,this.endControl=F,this.end=X}return _.prototype.subdivide=function(R,U){var F=vm(this.start,this.startControl,R),X=vm(this.startControl,this.endControl,R),ae=vm(this.endControl,this.end,R),Ee=vm(F,X,R),Ne=vm(X,ae,R),ze=vm(Ee,Ne,R);return U?new _(this.start,F,Ee,ze):new _(ze,Ne,ae,this.end)},_.prototype.add=function(R,U){return new _(this.start.add(R,U),this.startControl.add(R,U),this.endControl.add(R,U),this.end.add(R,U))},_.prototype.reverse=function(){return new _(this.end,this.endControl,this.startControl,this.start)},_})(),vd=function(_){return _.type===1},aIe=(function(){function _(R){var U=R.styles,F=R.bounds,X=Nu(U.borderTopLeftRadius,F.width,F.height),ae=X[0],Ee=X[1],Ne=Nu(U.borderTopRightRadius,F.width,F.height),ze=Ne[0],pt=Ne[1],xt=Nu(U.borderBottomRightRadius,F.width,F.height),Rt=xt[0],Kt=xt[1],Ti=Nu(U.borderBottomLeftRadius,F.width,F.height),di=Ti[0],vi=Ti[1],Jr=[];Jr.push((ae+ze)/F.width),Jr.push((di+Rt)/F.width),Jr.push((Ee+vi)/F.height),Jr.push((pt+Kt)/F.height);var ir=Math.max.apply(Math,Jr);ir>1&&(ae/=ir,Ee/=ir,ze/=ir,pt/=ir,Rt/=ir,Kt/=ir,di/=ir,vi/=ir);var Yi=F.width-ze,wo=F.height-Kt,gn=F.width-Rt,dr=F.height-vi,Mi=U.borderTopWidth,pn=U.borderRightWidth,Xr=U.borderBottomWidth,Tr=U.borderLeftWidth,el=Ao(U.paddingTop,R.bounds.width),Vu=Ao(U.paddingRight,R.bounds.width),fp=Ao(U.paddingBottom,R.bounds.width),Lo=Ao(U.paddingLeft,R.bounds.width);this.topLeftBorderDoubleOuterBox=ae>0||Ee>0?Ro(F.left+Tr/3,F.top+Mi/3,ae-Tr/3,Ee-Mi/3,Qn.TOP_LEFT):new ki(F.left+Tr/3,F.top+Mi/3),this.topRightBorderDoubleOuterBox=ae>0||Ee>0?Ro(F.left+Yi,F.top+Mi/3,ze-pn/3,pt-Mi/3,Qn.TOP_RIGHT):new ki(F.left+F.width-pn/3,F.top+Mi/3),this.bottomRightBorderDoubleOuterBox=Rt>0||Kt>0?Ro(F.left+gn,F.top+wo,Rt-pn/3,Kt-Xr/3,Qn.BOTTOM_RIGHT):new ki(F.left+F.width-pn/3,F.top+F.height-Xr/3),this.bottomLeftBorderDoubleOuterBox=di>0||vi>0?Ro(F.left+Tr/3,F.top+dr,di-Tr/3,vi-Xr/3,Qn.BOTTOM_LEFT):new ki(F.left+Tr/3,F.top+F.height-Xr/3),this.topLeftBorderDoubleInnerBox=ae>0||Ee>0?Ro(F.left+Tr*2/3,F.top+Mi*2/3,ae-Tr*2/3,Ee-Mi*2/3,Qn.TOP_LEFT):new ki(F.left+Tr*2/3,F.top+Mi*2/3),this.topRightBorderDoubleInnerBox=ae>0||Ee>0?Ro(F.left+Yi,F.top+Mi*2/3,ze-pn*2/3,pt-Mi*2/3,Qn.TOP_RIGHT):new ki(F.left+F.width-pn*2/3,F.top+Mi*2/3),this.bottomRightBorderDoubleInnerBox=Rt>0||Kt>0?Ro(F.left+gn,F.top+wo,Rt-pn*2/3,Kt-Xr*2/3,Qn.BOTTOM_RIGHT):new ki(F.left+F.width-pn*2/3,F.top+F.height-Xr*2/3),this.bottomLeftBorderDoubleInnerBox=di>0||vi>0?Ro(F.left+Tr*2/3,F.top+dr,di-Tr*2/3,vi-Xr*2/3,Qn.BOTTOM_LEFT):new ki(F.left+Tr*2/3,F.top+F.height-Xr*2/3),this.topLeftBorderStroke=ae>0||Ee>0?Ro(F.left+Tr/2,F.top+Mi/2,ae-Tr/2,Ee-Mi/2,Qn.TOP_LEFT):new ki(F.left+Tr/2,F.top+Mi/2),this.topRightBorderStroke=ae>0||Ee>0?Ro(F.left+Yi,F.top+Mi/2,ze-pn/2,pt-Mi/2,Qn.TOP_RIGHT):new ki(F.left+F.width-pn/2,F.top+Mi/2),this.bottomRightBorderStroke=Rt>0||Kt>0?Ro(F.left+gn,F.top+wo,Rt-pn/2,Kt-Xr/2,Qn.BOTTOM_RIGHT):new ki(F.left+F.width-pn/2,F.top+F.height-Xr/2),this.bottomLeftBorderStroke=di>0||vi>0?Ro(F.left+Tr/2,F.top+dr,di-Tr/2,vi-Xr/2,Qn.BOTTOM_LEFT):new ki(F.left+Tr/2,F.top+F.height-Xr/2),this.topLeftBorderBox=ae>0||Ee>0?Ro(F.left,F.top,ae,Ee,Qn.TOP_LEFT):new ki(F.left,F.top),this.topRightBorderBox=ze>0||pt>0?Ro(F.left+Yi,F.top,ze,pt,Qn.TOP_RIGHT):new ki(F.left+F.width,F.top),this.bottomRightBorderBox=Rt>0||Kt>0?Ro(F.left+gn,F.top+wo,Rt,Kt,Qn.BOTTOM_RIGHT):new ki(F.left+F.width,F.top+F.height),this.bottomLeftBorderBox=di>0||vi>0?Ro(F.left,F.top+dr,di,vi,Qn.BOTTOM_LEFT):new ki(F.left,F.top+F.height),this.topLeftPaddingBox=ae>0||Ee>0?Ro(F.left+Tr,F.top+Mi,Math.max(0,ae-Tr),Math.max(0,Ee-Mi),Qn.TOP_LEFT):new ki(F.left+Tr,F.top+Mi),this.topRightPaddingBox=ze>0||pt>0?Ro(F.left+Math.min(Yi,F.width-pn),F.top+Mi,Yi>F.width+pn?0:Math.max(0,ze-pn),Math.max(0,pt-Mi),Qn.TOP_RIGHT):new ki(F.left+F.width-pn,F.top+Mi),this.bottomRightPaddingBox=Rt>0||Kt>0?Ro(F.left+Math.min(gn,F.width-Tr),F.top+Math.min(wo,F.height-Xr),Math.max(0,Rt-pn),Math.max(0,Kt-Xr),Qn.BOTTOM_RIGHT):new ki(F.left+F.width-pn,F.top+F.height-Xr),this.bottomLeftPaddingBox=di>0||vi>0?Ro(F.left+Tr,F.top+Math.min(dr,F.height-Xr),Math.max(0,di-Tr),Math.max(0,vi-Xr),Qn.BOTTOM_LEFT):new ki(F.left+Tr,F.top+F.height-Xr),this.topLeftContentBox=ae>0||Ee>0?Ro(F.left+Tr+Lo,F.top+Mi+el,Math.max(0,ae-(Tr+Lo)),Math.max(0,Ee-(Mi+el)),Qn.TOP_LEFT):new ki(F.left+Tr+Lo,F.top+Mi+el),this.topRightContentBox=ze>0||pt>0?Ro(F.left+Math.min(Yi,F.width+Tr+Lo),F.top+Mi+el,Yi>F.width+Tr+Lo?0:ze-Tr+Lo,pt-(Mi+el),Qn.TOP_RIGHT):new ki(F.left+F.width-(pn+Vu),F.top+Mi+el),this.bottomRightContentBox=Rt>0||Kt>0?Ro(F.left+Math.min(gn,F.width-(Tr+Lo)),F.top+Math.min(wo,F.height+Mi+el),Math.max(0,Rt-(pn+Vu)),Kt-(Xr+fp),Qn.BOTTOM_RIGHT):new ki(F.left+F.width-(pn+Vu),F.top+F.height-(Xr+fp)),this.bottomLeftContentBox=di>0||vi>0?Ro(F.left+Tr+Lo,F.top+dr,Math.max(0,di-(Tr+Lo)),vi-(Xr+fp),Qn.BOTTOM_LEFT):new ki(F.left+Tr+Lo,F.top+F.height-(Xr+fp))}return _})(),Qn;(function(_){_[_.TOP_LEFT=0]="TOP_LEFT",_[_.TOP_RIGHT=1]="TOP_RIGHT",_[_.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",_[_.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(Qn||={});var Ro=function(_,R,U,F,X){var ae=4*((Math.sqrt(2)-1)/3),Ee=U*ae,Ne=F*ae,ze=_+U,pt=R+F;switch(X){case Qn.TOP_LEFT:return new v9(new ki(_,pt),new ki(_,pt-Ne),new ki(ze-Ee,R),new ki(ze,R));case Qn.TOP_RIGHT:return new v9(new ki(_,R),new ki(_+Ee,R),new ki(ze,pt-Ne),new ki(ze,pt));case Qn.BOTTOM_RIGHT:return new v9(new ki(ze,R),new ki(ze,R+Ne),new ki(_+Ee,pt),new ki(_,pt));case Qn.BOTTOM_LEFT:default:return new v9(new ki(ze,pt),new ki(ze-Ee,pt),new ki(_,R+Ne),new ki(_,R))}},w9=function(_){return[_.topLeftBorderBox,_.topRightBorderBox,_.bottomRightBorderBox,_.bottomLeftBorderBox]},sIe=function(_){return[_.topLeftContentBox,_.topRightContentBox,_.bottomRightContentBox,_.bottomLeftContentBox]},b9=function(_){return[_.topLeftPaddingBox,_.topRightPaddingBox,_.bottomRightPaddingBox,_.bottomLeftPaddingBox]},lIe=(function(){function _(R,U,F){this.offsetX=R,this.offsetY=U,this.matrix=F,this.type=0,this.target=6}return _})(),y9=(function(){function _(R,U){this.path=R,this.target=U,this.type=1}return _})(),cIe=(function(){function _(R){this.opacity=R,this.type=2,this.target=6}return _})(),dIe=function(_){return _.type===0},aK=function(_){return _.type===1},uIe=function(_){return _.type===2},sK=function(_,R){return _.length===R.length?_.some(function(U,F){return U===R[F]}):!1},hIe=function(_,R,U,F,X){return _.map(function(ae,Ee){switch(Ee){case 0:return ae.add(R,U);case 1:return ae.add(R+F,U);case 2:return ae.add(R+F,U+X);case 3:return ae.add(R,U+X)}return ae})},lK=(function(){function _(R){this.element=R,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return _})(),cK=(function(){function _(R,U){if(this.container=R,this.parent=U,this.effects=[],this.curves=new aIe(this.container),this.container.styles.opacity<1&&this.effects.push(new cIe(this.container.styles.opacity)),this.container.styles.transform!==null){var F=this.container.bounds.left+this.container.styles.transformOrigin[0].number,X=this.container.bounds.top+this.container.styles.transformOrigin[1].number,ae=this.container.styles.transform;this.effects.push(new lIe(F,X,ae))}if(this.container.styles.overflowX!==0){var Ee=w9(this.curves),Ne=b9(this.curves);sK(Ee,Ne)?this.effects.push(new y9(Ee,6)):(this.effects.push(new y9(Ee,2)),this.effects.push(new y9(Ne,4)))}}return _.prototype.getEffects=function(R){for(var U=[2,3].indexOf(this.container.styles.position)===-1,F=this.parent,X=this.effects.slice(0);F;){var ae=F.effects.filter(function(ze){return!aK(ze)});if(U||F.container.styles.position!==0||!F.parent){if(X.unshift.apply(X,ae),U=[2,3].indexOf(F.container.styles.position)===-1,F.container.styles.overflowX!==0){var Ee=w9(F.curves),Ne=b9(F.curves);sK(Ee,Ne)||X.unshift(new y9(Ne,6))}}else X.unshift.apply(X,ae);F=F.parent}return X.filter(function(ze){return Ha(ze.target,R)})},_})(),aS=function(_,R,U,F){_.container.elements.forEach(function(X){var ae=Ha(X.flags,4),Ee=Ha(X.flags,2),Ne=new cK(X,_);Ha(X.styles.display,2048)&&F.push(Ne);var ze=Ha(X.flags,8)?[]:F;if(ae||Ee){var pt=ae||X.styles.isPositioned()?U:R,xt=new lK(Ne);if(X.styles.isPositioned()||X.styles.opacity<1||X.styles.isTransformed()){var Rt=X.styles.zIndex.order;if(Rt<0){var Kt=0;pt.negativeZIndex.some(function(di,vi){return Rt>di.element.container.styles.zIndex.order?(Kt=vi,!1):Kt>0}),pt.negativeZIndex.splice(Kt,0,xt)}else if(Rt>0){var Ti=0;pt.positiveZIndex.some(function(di,vi){return Rt>=di.element.container.styles.zIndex.order?(Ti=vi+1,!1):Ti>0}),pt.positiveZIndex.splice(Ti,0,xt)}else pt.zeroOrAutoZIndexOrTransformedOrOpacity.push(xt)}else X.styles.isFloating()?pt.nonPositionedFloats.push(xt):pt.nonPositionedInlineLevel.push(xt);aS(Ne,xt,ae?xt:U,ze)}else X.styles.isInlineLevel()?R.inlineLevel.push(Ne):R.nonInlineLevel.push(Ne),aS(Ne,R,U,ze);Ha(X.flags,8)&&dK(X,ze)})},dK=function(_,R){for(var U=_ instanceof JP?_.start:1,F=_ instanceof JP?_.reversed:!1,X=0;X<R.length;X++){var ae=R[X];ae.container instanceof _G&&typeof ae.container.value=="number"&&ae.container.value!==0&&(U=ae.container.value),ae.listValue=T4(U,ae.container.styles.listStyleType,!0),U+=F?-1:1}},pIe=function(_){var R=new cK(_,null),U=new lK(R),F=[];return aS(R,U,U,F),dK(R.container,F),U},uK=function(_,R){switch(R){case 0:return wd(_.topLeftBorderBox,_.topLeftPaddingBox,_.topRightBorderBox,_.topRightPaddingBox);case 1:return wd(_.topRightBorderBox,_.topRightPaddingBox,_.bottomRightBorderBox,_.bottomRightPaddingBox);case 2:return wd(_.bottomRightBorderBox,_.bottomRightPaddingBox,_.bottomLeftBorderBox,_.bottomLeftPaddingBox);default:return wd(_.bottomLeftBorderBox,_.bottomLeftPaddingBox,_.topLeftBorderBox,_.topLeftPaddingBox)}},AIe=function(_,R){switch(R){case 0:return wd(_.topLeftBorderBox,_.topLeftBorderDoubleOuterBox,_.topRightBorderBox,_.topRightBorderDoubleOuterBox);case 1:return wd(_.topRightBorderBox,_.topRightBorderDoubleOuterBox,_.bottomRightBorderBox,_.bottomRightBorderDoubleOuterBox);case 2:return wd(_.bottomRightBorderBox,_.bottomRightBorderDoubleOuterBox,_.bottomLeftBorderBox,_.bottomLeftBorderDoubleOuterBox);default:return wd(_.bottomLeftBorderBox,_.bottomLeftBorderDoubleOuterBox,_.topLeftBorderBox,_.topLeftBorderDoubleOuterBox)}},fIe=function(_,R){switch(R){case 0:return wd(_.topLeftBorderDoubleInnerBox,_.topLeftPaddingBox,_.topRightBorderDoubleInnerBox,_.topRightPaddingBox);case 1:return wd(_.topRightBorderDoubleInnerBox,_.topRightPaddingBox,_.bottomRightBorderDoubleInnerBox,_.bottomRightPaddingBox);case 2:return wd(_.bottomRightBorderDoubleInnerBox,_.bottomRightPaddingBox,_.bottomLeftBorderDoubleInnerBox,_.bottomLeftPaddingBox);default:return wd(_.bottomLeftBorderDoubleInnerBox,_.bottomLeftPaddingBox,_.topLeftBorderDoubleInnerBox,_.topLeftPaddingBox)}},gIe=function(_,R){switch(R){case 0:return C9(_.topLeftBorderStroke,_.topRightBorderStroke);case 1:return C9(_.topRightBorderStroke,_.bottomRightBorderStroke);case 2:return C9(_.bottomRightBorderStroke,_.bottomLeftBorderStroke);default:return C9(_.bottomLeftBorderStroke,_.topLeftBorderStroke)}},C9=function(_,R){var U=[];return vd(_)?U.push(_.subdivide(.5,!1)):U.push(_),vd(R)?U.push(R.subdivide(.5,!0)):U.push(R),U},wd=function(_,R,U,F){var X=[];return vd(_)?X.push(_.subdivide(.5,!1)):X.push(_),vd(U)?X.push(U.subdivide(.5,!0)):X.push(U),vd(F)?X.push(F.subdivide(.5,!0).reverse()):X.push(F),vd(R)?X.push(R.subdivide(.5,!1).reverse()):X.push(R),X},hK=function(_){var R=_.bounds,U=_.styles;return R.add(U.borderLeftWidth,U.borderTopWidth,-(U.borderRightWidth+U.borderLeftWidth),-(U.borderTopWidth+U.borderBottomWidth))},x9=function(_){var R=_.styles,U=_.bounds,F=Ao(R.paddingLeft,U.width),X=Ao(R.paddingRight,U.width),ae=Ao(R.paddingTop,U.width),Ee=Ao(R.paddingBottom,U.width);return U.add(F+R.borderLeftWidth,ae+R.borderTopWidth,-(R.borderRightWidth+R.borderLeftWidth+F+X),-(R.borderTopWidth+R.borderBottomWidth+ae+Ee))},mIe=function(_,R){return _===0?R.bounds:_===2?x9(R):hK(R)},vIe=function(_,R){return _===0?R.bounds:_===2?x9(R):hK(R)},sS=function(_,R,U){var F=mIe(bm(_.styles.backgroundOrigin,R),_),X=vIe(bm(_.styles.backgroundClip,R),_),ae=wIe(bm(_.styles.backgroundSize,R),U,F),Ee=ae[0],Ne=ae[1],ze=Nu(bm(_.styles.backgroundPosition,R),F.width-Ee,F.height-Ne);return[bIe(bm(_.styles.backgroundRepeat,R),ze,ae,F,X),Math.round(F.left+ze[0]),Math.round(F.top+ze[1]),Ee,Ne]},wm=function(_){return Ci(_)&&_.value===M4.AUTO},k9=function(_){return typeof _=="number"},wIe=function(_,R,U){var F=R[0],X=R[1],ae=R[2],Ee=_[0],Ne=_[1];if(!Ee)return[0,0];if(Ji(Ee)&&Ne&&Ji(Ne))return[Ao(Ee,U.width),Ao(Ne,U.height)];var ze=k9(ae);if(Ci(Ee)&&(Ee.value===M4.CONTAIN||Ee.value===M4.COVER))return k9(ae)?U.width/U.height<ae==(Ee.value===M4.COVER)?[U.height*ae,U.height]:[U.width,U.width/ae]:[U.width,U.height];var pt=k9(F),xt=k9(X),Rt=pt||xt;if(wm(Ee)&&(!Ne||wm(Ne)))return pt&&xt?[F,X]:!ze&&!Rt?[U.width,U.height]:Rt&&ze?[pt?F:X*ae,xt?X:F/ae]:[pt?F:U.width,xt?X:U.height];if(ze){var Kt=0,Ti=0;return Ji(Ee)?Kt=Ao(Ee,U.width):Ji(Ne)&&(Ti=Ao(Ne,U.height)),wm(Ee)?Kt=Ti*ae:(!Ne||wm(Ne))&&(Ti=Kt/ae),[Kt,Ti]}var di=null,vi=null;if(Ji(Ee)?di=Ao(Ee,U.width):Ne&&Ji(Ne)&&(vi=Ao(Ne,U.height)),di!==null&&(!Ne||wm(Ne))&&(vi=pt&&xt?di/F*X:U.height),vi!==null&&wm(Ee)&&(di=pt&&xt?vi/X*F:U.width),di!==null&&vi!==null)return[di,vi];throw Error("Unable to calculate background-size for element")},bm=function(_,R){var U=_[R];return U===void 0?_[0]:U},bIe=function(_,R,U,F,X){var ae=R[0],Ee=R[1],Ne=U[0],ze=U[1];switch(_){case 2:return[new ki(Math.round(F.left),Math.round(F.top+Ee)),new ki(Math.round(F.left+F.width),Math.round(F.top+Ee)),new ki(Math.round(F.left+F.width),Math.round(ze+F.top+Ee)),new ki(Math.round(F.left),Math.round(ze+F.top+Ee))];case 3:return[new ki(Math.round(F.left+ae),Math.round(F.top)),new ki(Math.round(F.left+ae+Ne),Math.round(F.top)),new ki(Math.round(F.left+ae+Ne),Math.round(F.height+F.top)),new ki(Math.round(F.left+ae),Math.round(F.height+F.top))];case 1:return[new ki(Math.round(F.left+ae),Math.round(F.top+Ee)),new ki(Math.round(F.left+ae+Ne),Math.round(F.top+Ee)),new ki(Math.round(F.left+ae+Ne),Math.round(F.top+Ee+ze)),new ki(Math.round(F.left+ae),Math.round(F.top+Ee+ze))];default:return[new ki(Math.round(X.left),Math.round(X.top)),new ki(Math.round(X.left+X.width),Math.round(X.top)),new ki(Math.round(X.left+X.width),Math.round(X.height+X.top)),new ki(Math.round(X.left),Math.round(X.height+X.top))]}},yIe="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",pK="Hidden Text",CIe=(function(){function _(R){this._data={},this._document=R}return _.prototype.parseMetrics=function(R,U){var F=this._document.createElement("div"),X=this._document.createElement("img"),ae=this._document.createElement("span"),Ee=this._document.body;F.style.visibility="hidden",F.style.fontFamily=R,F.style.fontSize=U,F.style.margin="0",F.style.padding="0",F.style.whiteSpace="nowrap",Ee.appendChild(F),X.src=yIe,X.width=1,X.height=1,X.style.margin="0",X.style.padding="0",X.style.verticalAlign="baseline",ae.style.fontFamily=R,ae.style.fontSize=U,ae.style.margin="0",ae.style.padding="0",ae.appendChild(this._document.createTextNode(pK)),F.appendChild(ae),F.appendChild(X);var Ne=X.offsetTop-ae.offsetTop+2;F.removeChild(ae),F.appendChild(this._document.createTextNode(pK)),F.style.lineHeight="normal",X.style.verticalAlign="super";var ze=X.offsetTop-F.offsetTop+2;return Ee.removeChild(F),{baseline:Ne,middle:ze}},_.prototype.getMetrics=function(R,U){var F=R+" "+U;return this._data[F]===void 0&&(this._data[F]=this.parseMetrics(R,U)),this._data[F]},_})(),AK=(function(){function _(R,U){this.context=R,this.options=U}return _})(),xIe=1e4,kIe=(function(_){r(R,_);function R(U,F){var X=_.call(this,U,F)||this;return X._activeEffects=[],X.canvas=F.canvas?F.canvas:document.createElement("canvas"),X.ctx=X.canvas.getContext("2d"),F.canvas||(X.canvas.width=Math.floor(F.width*F.scale),X.canvas.height=Math.floor(F.height*F.scale),X.canvas.style.width=F.width+"px",X.canvas.style.height=F.height+"px"),X.fontMetrics=new CIe(document),X.ctx.scale(X.options.scale,X.options.scale),X.ctx.translate(-F.x,-F.y),X.ctx.textBaseline="bottom",X._activeEffects=[],X.context.logger.debug("Canvas renderer initialized ("+F.width+"x"+F.height+") with scale "+F.scale),X}return R.prototype.applyEffects=function(U){for(var F=this;this._activeEffects.length;)this.popEffect();U.forEach(function(X){return F.applyEffect(X)})},R.prototype.applyEffect=function(U){this.ctx.save(),uIe(U)&&(this.ctx.globalAlpha=U.opacity),dIe(U)&&(this.ctx.translate(U.offsetX,U.offsetY),this.ctx.transform(U.matrix[0],U.matrix[1],U.matrix[2],U.matrix[3],U.matrix[4],U.matrix[5]),this.ctx.translate(-U.offsetX,-U.offsetY)),aK(U)&&(this.path(U.path),this.ctx.clip()),this._activeEffects.push(U)},R.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},R.prototype.renderStack=function(U){return o(this,void 0,void 0,function(){var F;return a(this,function(X){switch(X.label){case 0:return F=U.element.container.styles,F.isVisible()?[4,this.renderStackContent(U)]:[3,2];case 1:X.sent(),X.label=2;case 2:return[2]}})})},R.prototype.renderNode=function(U){return o(this,void 0,void 0,function(){return a(this,function(F){switch(F.label){case 0:if(Ha(U.container.flags,16))debugger;return U.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(U)]:[3,3];case 1:return F.sent(),[4,this.renderNodeContent(U)];case 2:F.sent(),F.label=3;case 3:return[2]}})})},R.prototype.renderTextWithLetterSpacing=function(U,F,X){var ae=this;F===0?this.ctx.fillText(U.text,U.bounds.left,U.bounds.top+X):WP(U.text).reduce(function(Ee,Ne){return ae.ctx.fillText(Ne,Ee,U.bounds.top+X),Ee+ae.ctx.measureText(Ne).width},U.bounds.left)},R.prototype.createFontStyle=function(U){var F=U.fontVariant.filter(function(Ee){return Ee==="normal"||Ee==="small-caps"}).join(""),X=PIe(U.fontFamily).join(", "),ae=Wi(U.fontSize)?""+U.fontSize.number+U.fontSize.unit:U.fontSize.number+"px";return[[U.fontStyle,F,U.fontWeight,ae,X].join(" "),X,ae]},R.prototype.renderTextNode=function(U,F){return o(this,void 0,void 0,function(){var X,ae,Ee,Ne,ze,pt,xt,Rt,Kt=this;return a(this,function(Ti){return X=this.createFontStyle(F),ae=X[0],Ee=X[1],Ne=X[2],this.ctx.font=ae,this.ctx.direction=F.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",ze=this.fontMetrics.getMetrics(Ee,Ne),pt=ze.baseline,xt=ze.middle,Rt=F.paintOrder,U.textBounds.forEach(function(di){Rt.forEach(function(vi){switch(vi){case 0:Kt.ctx.fillStyle=ns(F.color),Kt.renderTextWithLetterSpacing(di,F.letterSpacing,pt);var Jr=F.textShadow;Jr.length&&di.text.trim().length&&(Jr.slice(0).reverse().forEach(function(ir){Kt.ctx.shadowColor=ns(ir.color),Kt.ctx.shadowOffsetX=ir.offsetX.number*Kt.options.scale,Kt.ctx.shadowOffsetY=ir.offsetY.number*Kt.options.scale,Kt.ctx.shadowBlur=ir.blur.number,Kt.renderTextWithLetterSpacing(di,F.letterSpacing,pt)}),Kt.ctx.shadowColor="",Kt.ctx.shadowOffsetX=0,Kt.ctx.shadowOffsetY=0,Kt.ctx.shadowBlur=0),F.textDecorationLine.length&&(Kt.ctx.fillStyle=ns(F.textDecorationColor||F.color),F.textDecorationLine.forEach(function(ir){switch(ir){case 1:Kt.ctx.fillRect(di.bounds.left,Math.round(di.bounds.top+pt),di.bounds.width,1);break;case 2:Kt.ctx.fillRect(di.bounds.left,Math.round(di.bounds.top),di.bounds.width,1);break;case 3:Kt.ctx.fillRect(di.bounds.left,Math.ceil(di.bounds.top+xt),di.bounds.width,1);break}}));break;case 1:F.webkitTextStrokeWidth&&di.text.trim().length&&(Kt.ctx.strokeStyle=ns(F.webkitTextStrokeColor),Kt.ctx.lineWidth=F.webkitTextStrokeWidth,Kt.ctx.lineJoin=window.chrome?"miter":"round",Kt.ctx.strokeText(di.text,di.bounds.left,di.bounds.top+pt)),Kt.ctx.strokeStyle="",Kt.ctx.lineWidth=0,Kt.ctx.lineJoin="miter";break}})}),[2]})})},R.prototype.renderReplacedElement=function(U,F,X){if(X&&U.intrinsicWidth>0&&U.intrinsicHeight>0){var ae=x9(U),Ee=b9(F);this.path(Ee),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(X,0,0,U.intrinsicWidth,U.intrinsicHeight,ae.left,ae.top,ae.width,ae.height),this.ctx.restore()}},R.prototype.renderNodeContent=function(U){return o(this,void 0,void 0,function(){var F,X,ae,Ee,Ne,ze,Yi,Yi,pt,xt,Rt,Kt,gn,Ti,di,dr,vi,Jr,ir,Yi,wo,gn,dr;return a(this,function(Mi){switch(Mi.label){case 0:this.applyEffects(U.getEffects(4)),F=U.container,X=U.curves,ae=F.styles,Ee=0,Ne=F.textNodes,Mi.label=1;case 1:return Ee<Ne.length?(ze=Ne[Ee],[4,this.renderTextNode(ze,ae)]):[3,4];case 2:Mi.sent(),Mi.label=3;case 3:return Ee++,[3,1];case 4:if(!(F instanceof DG))return[3,8];Mi.label=5;case 5:return Mi.trys.push([5,7,,8]),[4,this.context.cache.match(F.src)];case 6:return Yi=Mi.sent(),this.renderReplacedElement(F,X,Yi),[3,8];case 7:return Mi.sent(),this.context.logger.error("Error loading image "+F.src),[3,8];case 8:if(F instanceof RG&&this.renderReplacedElement(F,X,F.canvas),!(F instanceof LG))return[3,12];Mi.label=9;case 9:return Mi.trys.push([9,11,,12]),[4,this.context.cache.match(F.svg)];case 10:return Yi=Mi.sent(),this.renderReplacedElement(F,X,Yi),[3,12];case 11:return Mi.sent(),this.context.logger.error("Error loading svg "+F.svg.substring(0,255)),[3,12];case 12:return F instanceof OG&&F.tree?(pt=new R(this.context,{scale:this.options.scale,backgroundColor:F.backgroundColor,x:0,y:0,width:F.width,height:F.height}),[4,pt.render(F.tree)]):[3,14];case 13:xt=Mi.sent(),F.width&&F.height&&this.ctx.drawImage(xt,0,0,F.width,F.height,F.bounds.left,F.bounds.top,F.bounds.width,F.bounds.height),Mi.label=14;case 14:if(F instanceof YP&&(Rt=Math.min(F.bounds.width,F.bounds.height),F.type===u9?F.checked&&(this.ctx.save(),this.path([new ki(F.bounds.left+Rt*.39363,F.bounds.top+Rt*.79),new ki(F.bounds.left+Rt*.16,F.bounds.top+Rt*.5549),new ki(F.bounds.left+Rt*.27347,F.bounds.top+Rt*.44071),new ki(F.bounds.left+Rt*.39694,F.bounds.top+Rt*.5649),new ki(F.bounds.left+Rt*.72983,F.bounds.top+Rt*.23),new ki(F.bounds.left+Rt*.84,F.bounds.top+Rt*.34085),new ki(F.bounds.left+Rt*.39363,F.bounds.top+Rt*.79)]),this.ctx.fillStyle=ns(FG),this.ctx.fill(),this.ctx.restore()):F.type===h9&&F.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(F.bounds.left+Rt/2,F.bounds.top+Rt/2,Rt/4,0,Math.PI*2,!0),this.ctx.fillStyle=ns(FG),this.ctx.fill(),this.ctx.restore())),BIe(F)&&F.value.length){switch(Kt=this.createFontStyle(ae),gn=Kt[0],Ti=Kt[1],di=this.fontMetrics.getMetrics(gn,Ti).baseline,this.ctx.font=gn,this.ctx.fillStyle=ns(ae.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=MIe(F.styles.textAlign),dr=x9(F),vi=0,F.styles.textAlign){case 1:vi+=dr.width/2;break;case 2:vi+=dr.width;break}Jr=dr.add(vi,0,0,-dr.height/2+1),this.ctx.save(),this.path([new ki(dr.left,dr.top),new ki(dr.left+dr.width,dr.top),new ki(dr.left+dr.width,dr.top+dr.height),new ki(dr.left,dr.top+dr.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new P4(F.value,Jr),ae.letterSpacing,di),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!Ha(F.styles.display,2048))return[3,20];if(F.styles.listStyleImage===null)return[3,19];if(ir=F.styles.listStyleImage,ir.type!==0)return[3,18];Yi=void 0,wo=ir.url,Mi.label=15;case 15:return Mi.trys.push([15,17,,18]),[4,this.context.cache.match(wo)];case 16:return Yi=Mi.sent(),this.ctx.drawImage(Yi,F.bounds.left-(Yi.width+10),F.bounds.top),[3,18];case 17:return Mi.sent(),this.context.logger.error("Error loading list-style-image "+wo),[3,18];case 18:return[3,20];case 19:U.listValue&&F.styles.listStyleType!==-1&&(gn=this.createFontStyle(ae)[0],this.ctx.font=gn,this.ctx.fillStyle=ns(ae.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",dr=new l(F.bounds.left,F.bounds.top+Ao(F.styles.paddingTop,F.bounds.width),F.bounds.width,hG(ae.lineHeight,ae.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new P4(U.listValue,dr),ae.letterSpacing,hG(ae.lineHeight,ae.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),Mi.label=20;case 20:return[2]}})})},R.prototype.renderStackContent=function(U){return o(this,void 0,void 0,function(){var F,X,ir,ae,Ee,ir,Ne,ze,ir,pt,xt,ir,Rt,Kt,ir,Ti,di,ir,vi,Jr,ir;return a(this,function(Yi){switch(Yi.label){case 0:if(Ha(U.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(U.element)];case 1:Yi.sent(),F=0,X=U.negativeZIndex,Yi.label=2;case 2:return F<X.length?(ir=X[F],[4,this.renderStack(ir)]):[3,5];case 3:Yi.sent(),Yi.label=4;case 4:return F++,[3,2];case 5:return[4,this.renderNodeContent(U.element)];case 6:Yi.sent(),ae=0,Ee=U.nonInlineLevel,Yi.label=7;case 7:return ae<Ee.length?(ir=Ee[ae],[4,this.renderNode(ir)]):[3,10];case 8:Yi.sent(),Yi.label=9;case 9:return ae++,[3,7];case 10:Ne=0,ze=U.nonPositionedFloats,Yi.label=11;case 11:return Ne<ze.length?(ir=ze[Ne],[4,this.renderStack(ir)]):[3,14];case 12:Yi.sent(),Yi.label=13;case 13:return Ne++,[3,11];case 14:pt=0,xt=U.nonPositionedInlineLevel,Yi.label=15;case 15:return pt<xt.length?(ir=xt[pt],[4,this.renderStack(ir)]):[3,18];case 16:Yi.sent(),Yi.label=17;case 17:return pt++,[3,15];case 18:Rt=0,Kt=U.inlineLevel,Yi.label=19;case 19:return Rt<Kt.length?(ir=Kt[Rt],[4,this.renderNode(ir)]):[3,22];case 20:Yi.sent(),Yi.label=21;case 21:return Rt++,[3,19];case 22:Ti=0,di=U.zeroOrAutoZIndexOrTransformedOrOpacity,Yi.label=23;case 23:return Ti<di.length?(ir=di[Ti],[4,this.renderStack(ir)]):[3,26];case 24:Yi.sent(),Yi.label=25;case 25:return Ti++,[3,23];case 26:vi=0,Jr=U.positiveZIndex,Yi.label=27;case 27:return vi<Jr.length?(ir=Jr[vi],[4,this.renderStack(ir)]):[3,30];case 28:Yi.sent(),Yi.label=29;case 29:return vi++,[3,27];case 30:return[2]}})})},R.prototype.mask=function(U){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(U.slice(0).reverse()),this.ctx.closePath()},R.prototype.path=function(U){this.ctx.beginPath(),this.formatPath(U),this.ctx.closePath()},R.prototype.formatPath=function(U){var F=this;U.forEach(function(X,ae){var Ee=vd(X)?X.start:X;ae===0?F.ctx.moveTo(Ee.x,Ee.y):F.ctx.lineTo(Ee.x,Ee.y),vd(X)&&F.ctx.bezierCurveTo(X.startControl.x,X.startControl.y,X.endControl.x,X.endControl.y,X.end.x,X.end.y)})},R.prototype.renderRepeat=function(U,F,X,ae){this.path(U),this.ctx.fillStyle=F,this.ctx.translate(X,ae),this.ctx.fill(),this.ctx.translate(-X,-ae)},R.prototype.resizeImage=function(U,F,X){if(U.width===F&&U.height===X)return U;var ae=(this.canvas.ownerDocument??document).createElement("canvas");return ae.width=Math.max(1,F),ae.height=Math.max(1,X),ae.getContext("2d").drawImage(U,0,0,U.width,U.height,0,0,F,X),ae},R.prototype.renderBackgroundImage=function(U){return o(this,void 0,void 0,function(){var F,X,ae,Ee,Ne,ze;return a(this,function(pt){switch(pt.label){case 0:F=U.styles.backgroundImage.length-1,X=function(xt){var Rt,Kt,Ti,el,Qu,Gu,Lo,Pc,Xr,di,el,Qu,Gu,Lo,Pc,vi,Jr,ir,Yi,wo,gn,dr,Mi,pn,Xr,Tr,el,Vu,fp,Lo,Pc,B9,Qu,Gu,lS,ym,E9,cS,dS,D4,uS,hS;return a(this,function(Cm){switch(Cm.label){case 0:if(xt.type!==0)return[3,5];Rt=void 0,Kt=xt.url,Cm.label=1;case 1:return Cm.trys.push([1,3,,4]),[4,ae.context.cache.match(Kt)];case 2:return Rt=Cm.sent(),[3,4];case 3:return Cm.sent(),ae.context.logger.error("Error loading background-image "+Kt),[3,4];case 4:return Rt&&(Ti=sS(U,F,[Rt.width,Rt.height,Rt.width/Rt.height]),el=Ti[0],Qu=Ti[1],Gu=Ti[2],Lo=Ti[3],Pc=Ti[4],Xr=ae.ctx.createPattern(ae.resizeImage(Rt,Lo,Pc),"repeat"),ae.renderRepeat(el,Xr,Qu,Gu)),[3,6];case 5:vBe(xt)?(di=sS(U,F,[null,null,null]),el=di[0],Qu=di[1],Gu=di[2],Lo=di[3],Pc=di[4],vi=pBe(xt.angle,Lo,Pc),Jr=vi[0],ir=vi[1],Yi=vi[2],wo=vi[3],gn=vi[4],dr=document.createElement("canvas"),dr.width=Lo,dr.height=Pc,Mi=dr.getContext("2d"),pn=Mi.createLinearGradient(ir,wo,Yi,gn),tG(xt.stops,Jr).forEach(function(R4){return pn.addColorStop(R4.stop,ns(R4.color))}),Mi.fillStyle=pn,Mi.fillRect(0,0,Lo,Pc),Lo>0&&Pc>0&&(Xr=ae.ctx.createPattern(dr,"repeat"),ae.renderRepeat(el,Xr,Qu,Gu))):wBe(xt)&&(Tr=sS(U,F,[null,null,null]),el=Tr[0],Vu=Tr[1],fp=Tr[2],Lo=Tr[3],Pc=Tr[4],B9=xt.position.length===0?[qA]:xt.position,Qu=Ao(B9[0],Lo),Gu=Ao(B9[B9.length-1],Pc),lS=ABe(xt,Qu,Gu,Lo,Pc),ym=lS[0],E9=lS[1],ym>0&&E9>0&&(cS=ae.ctx.createRadialGradient(Vu+Qu,fp+Gu,0,Vu+Qu,fp+Gu,ym),tG(xt.stops,ym*2).forEach(function(R4){return cS.addColorStop(R4.stop,ns(R4.color))}),ae.path(el),ae.ctx.fillStyle=cS,ym===E9?ae.ctx.fill():(dS=U.bounds.left+.5*U.bounds.width,D4=U.bounds.top+.5*U.bounds.height,uS=E9/ym,hS=1/uS,ae.ctx.save(),ae.ctx.translate(dS,D4),ae.ctx.transform(1,0,0,uS,0,0),ae.ctx.translate(-dS,-D4),ae.ctx.fillRect(Vu,hS*(fp-D4)+D4,Lo,Pc*hS),ae.ctx.restore()))),Cm.label=6;case 6:return F--,[2]}})},ae=this,Ee=0,Ne=U.styles.backgroundImage.slice(0).reverse(),pt.label=1;case 1:return Ee<Ne.length?(ze=Ne[Ee],[5,X(ze)]):[3,4];case 2:pt.sent(),pt.label=3;case 3:return Ee++,[3,1];case 4:return[2]}})})},R.prototype.renderSolidBorder=function(U,F,X){return o(this,void 0,void 0,function(){return a(this,function(ae){return this.path(uK(X,F)),this.ctx.fillStyle=ns(U),this.ctx.fill(),[2]})})},R.prototype.renderDoubleBorder=function(U,F,X,ae){return o(this,void 0,void 0,function(){var Ee,Ne;return a(this,function(ze){switch(ze.label){case 0:return F<3?[4,this.renderSolidBorder(U,X,ae)]:[3,2];case 1:return ze.sent(),[2];case 2:return Ee=AIe(ae,X),this.path(Ee),this.ctx.fillStyle=ns(U),this.ctx.fill(),Ne=fIe(ae,X),this.path(Ne),this.ctx.fill(),[2]}})})},R.prototype.renderNodeBackgroundAndBorders=function(U){return o(this,void 0,void 0,function(){var F,X,ae,Ee,Ne,ze,pt,xt,Rt=this;return a(this,function(Kt){switch(Kt.label){case 0:return this.applyEffects(U.getEffects(2)),F=U.container.styles,X=!zA(F.backgroundColor)||F.backgroundImage.length,ae=[{style:F.borderTopStyle,color:F.borderTopColor,width:F.borderTopWidth},{style:F.borderRightStyle,color:F.borderRightColor,width:F.borderRightWidth},{style:F.borderBottomStyle,color:F.borderBottomColor,width:F.borderBottomWidth},{style:F.borderLeftStyle,color:F.borderLeftColor,width:F.borderLeftWidth}],Ee=EIe(bm(F.backgroundClip,0),U.curves),X||F.boxShadow.length?(this.ctx.save(),this.path(Ee),this.ctx.clip(),zA(F.backgroundColor)||(this.ctx.fillStyle=ns(F.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(U.container)]):[3,2];case 1:Kt.sent(),this.ctx.restore(),F.boxShadow.slice(0).reverse().forEach(function(Ti){Rt.ctx.save();var di=w9(U.curves),vi=Ti.inset?0:xIe,Jr=hIe(di,-vi+(Ti.inset?1:-1)*Ti.spread.number,(Ti.inset?1:-1)*Ti.spread.number,Ti.spread.number*(Ti.inset?-2:2),Ti.spread.number*(Ti.inset?-2:2));Ti.inset?(Rt.path(di),Rt.ctx.clip(),Rt.mask(Jr)):(Rt.mask(di),Rt.ctx.clip(),Rt.path(Jr)),Rt.ctx.shadowOffsetX=Ti.offsetX.number+vi,Rt.ctx.shadowOffsetY=Ti.offsetY.number,Rt.ctx.shadowColor=ns(Ti.color),Rt.ctx.shadowBlur=Ti.blur.number,Rt.ctx.fillStyle=Ti.inset?ns(Ti.color):"rgba(0,0,0,1)",Rt.ctx.fill(),Rt.ctx.restore()}),Kt.label=2;case 2:Ne=0,ze=0,pt=ae,Kt.label=3;case 3:return ze<pt.length?(xt=pt[ze],xt.style!==0&&!zA(xt.color)&&xt.width>0?xt.style===2?[4,this.renderDashedDottedBorder(xt.color,xt.width,Ne,U.curves,2)]:[3,5]:[3,11]):[3,13];case 4:return Kt.sent(),[3,11];case 5:return xt.style===3?[4,this.renderDashedDottedBorder(xt.color,xt.width,Ne,U.curves,3)]:[3,7];case 6:return Kt.sent(),[3,11];case 7:return xt.style===4?[4,this.renderDoubleBorder(xt.color,xt.width,Ne,U.curves)]:[3,9];case 8:return Kt.sent(),[3,11];case 9:return[4,this.renderSolidBorder(xt.color,Ne,U.curves)];case 10:Kt.sent(),Kt.label=11;case 11:Ne++,Kt.label=12;case 12:return ze++,[3,3];case 13:return[2]}})})},R.prototype.renderDashedDottedBorder=function(U,F,X,ae,Ee){return o(this,void 0,void 0,function(){var Ne,ze,pt,xt,Rt,Kt,Ti,di,vi,Jr,ir,Yi,wo,gn,dr,Mi,dr,Mi;return a(this,function(pn){return this.ctx.save(),Ne=gIe(ae,X),ze=uK(ae,X),Ee===2&&(this.path(ze),this.ctx.clip()),vd(ze[0])?(pt=ze[0].start.x,xt=ze[0].start.y):(pt=ze[0].x,xt=ze[0].y),vd(ze[1])?(Rt=ze[1].end.x,Kt=ze[1].end.y):(Rt=ze[1].x,Kt=ze[1].y),Ti=Math.abs(X===0||X===2?pt-Rt:xt-Kt),this.ctx.beginPath(),Ee===3?this.formatPath(Ne):this.formatPath(ze.slice(0,2)),di=F<3?F*3:F*2,vi=F<3?F*2:F,Ee===3&&(di=F,vi=F),Jr=!0,Ti<=di*2?Jr=!1:Ti<=di*2+vi?(ir=Ti/(2*di+vi),di*=ir,vi*=ir):(Yi=Math.floor((Ti+vi)/(di+vi)),wo=(Ti-Yi*di)/(Yi-1),gn=(Ti-(Yi+1)*di)/Yi,vi=gn<=0||Math.abs(vi-wo)<Math.abs(vi-gn)?wo:gn),Jr&&(Ee===3?this.ctx.setLineDash([0,di+vi]):this.ctx.setLineDash([di,vi])),Ee===3?(this.ctx.lineCap="round",this.ctx.lineWidth=F):this.ctx.lineWidth=F*2+1.1,this.ctx.strokeStyle=ns(U),this.ctx.stroke(),this.ctx.setLineDash([]),Ee===2&&(vd(ze[0])&&(dr=ze[3],Mi=ze[0],this.ctx.beginPath(),this.formatPath([new ki(dr.end.x,dr.end.y),new ki(Mi.start.x,Mi.start.y)]),this.ctx.stroke()),vd(ze[1])&&(dr=ze[1],Mi=ze[2],this.ctx.beginPath(),this.formatPath([new ki(dr.end.x,dr.end.y),new ki(Mi.start.x,Mi.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},R.prototype.render=function(U){return o(this,void 0,void 0,function(){var F;return a(this,function(X){switch(X.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=ns(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),F=pIe(U),[4,this.renderStack(F)];case 1:return X.sent(),this.applyEffects([]),[2,this.canvas]}})})},R})(AK),BIe=function(_){return _ instanceof UG||_ instanceof jG?!0:_ instanceof YP&&_.type!==h9&&_.type!==u9},EIe=function(_,R){switch(_){case 0:return w9(R);case 2:return sIe(R);default:return b9(R)}},MIe=function(_){switch(_){case 1:return"center";case 2:return"right";default:return"left"}},IIe=["-apple-system","system-ui"],PIe=function(_){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?_.filter(function(R){return IIe.indexOf(R)===-1}):_},SIe=(function(_){r(R,_);function R(U,F){var X=_.call(this,U,F)||this;return X.canvas=F.canvas?F.canvas:document.createElement("canvas"),X.ctx=X.canvas.getContext("2d"),X.options=F,X.canvas.width=Math.floor(F.width*F.scale),X.canvas.height=Math.floor(F.height*F.scale),X.canvas.style.width=F.width+"px",X.canvas.style.height=F.height+"px",X.ctx.scale(X.options.scale,X.options.scale),X.ctx.translate(-F.x,-F.y),X.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+F.width+"x"+F.height+" at "+F.x+","+F.y+") with scale "+F.scale),X}return R.prototype.render=function(U){return o(this,void 0,void 0,function(){var F,X;return a(this,function(ae){switch(ae.label){case 0:return F=KP(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,U),[4,TIe(F)];case 1:return X=ae.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=ns(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(X,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},R})(AK),TIe=function(_){return new Promise(function(R,U){var F=new Image;F.onload=function(){R(F)},F.onerror=U,F.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(_))})},DIe=(function(){function _(R){var U=R.id,F=R.enabled;this.id=U,this.enabled=F,this.start=Date.now()}return _.prototype.debug=function(){var R=[...arguments];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,s([this.id,this.getTime()+"ms"],R)):this.info.apply(this,R))},_.prototype.getTime=function(){return Date.now()-this.start},_.prototype.info=function(){var R=[...arguments];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,s([this.id,this.getTime()+"ms"],R))},_.prototype.warn=function(){var R=[...arguments];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,s([this.id,this.getTime()+"ms"],R)):this.info.apply(this,R))},_.prototype.error=function(){var R=[...arguments];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,s([this.id,this.getTime()+"ms"],R)):this.info.apply(this,R))},_.instances={},_})(),RIe=(function(){function _(R,U){this.windowBounds=U,this.instanceName="#"+_.instanceCount++,this.logger=new DIe({id:this.instanceName,enabled:R.logging}),this.cache=R.cache??new $Me(this,R)}return _.instanceCount=1,_})(),LIe=function(_,R){return R===void 0&&(R={}),_Ie(_,R)};typeof window<"u"&&oK.setContext(window);var _Ie=function(_,R){return o(void 0,void 0,void 0,function(){var U,F,X,ae,Ee,Ne,ze,pt,xt,Rt,Kt,Ti,di,vi,Jr,ir,Yi,wo,gn,dr,pn,Mi,pn;return a(this,function(Xr){switch(Xr.label){case 0:if(!_||typeof _!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(U=_.ownerDocument,!U)throw Error("Element is not attached to a Document");if(F=U.defaultView,!F)throw Error("Document is not attached to a Window");return X={allowTaint:R.allowTaint??!1,imageTimeout:R.imageTimeout??15e3,proxy:R.proxy,useCORS:R.useCORS??!1},ae=n({logging:R.logging??!0,cache:R.cache},X),Ee={windowWidth:R.windowWidth??F.innerWidth,windowHeight:R.windowHeight??F.innerHeight,scrollX:R.scrollX??F.pageXOffset,scrollY:R.scrollY??F.pageYOffset},Ne=new l(Ee.scrollX,Ee.scrollY,Ee.windowWidth,Ee.windowHeight),ze=new RIe(ae,Ne),pt=R.foreignObjectRendering??!1,xt={allowTaint:R.allowTaint??!1,onclone:R.onclone,ignoreElements:R.ignoreElements,inlineImages:pt,copyStyles:pt},ze.logger.debug("Starting document clone with size "+Ne.width+"x"+Ne.height+" scrolled to "+-Ne.left+","+-Ne.top),Rt=new rK(ze,_,xt),Kt=Rt.clonedReferenceElement,Kt?[4,Rt.toIFrame(U,Ne)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return Ti=Xr.sent(),di=XP(Kt)||FMe(Kt)?d(Kt.ownerDocument):c(ze,Kt),vi=di.width,Jr=di.height,ir=di.left,Yi=di.top,wo=FIe(ze,Kt,R.backgroundColor),gn={canvas:R.canvas,backgroundColor:wo,scale:R.scale??F.devicePixelRatio??1,x:(R.x??0)+ir,y:(R.y??0)+Yi,width:R.width??Math.ceil(vi),height:R.height??Math.ceil(Jr)},pt?(ze.logger.debug("Document cloned, using foreign object rendering"),pn=new SIe(ze,gn),[4,pn.render(Kt)]):[3,3];case 2:return dr=Xr.sent(),[3,5];case 3:return ze.logger.debug("Document cloned, element located at "+ir+","+Yi+" with size "+vi+"x"+Jr+" using computed rendering"),ze.logger.debug("Starting DOM parsing"),Mi=qG(ze,Kt),wo===Mi.styles.backgroundColor&&(Mi.styles.backgroundColor=pp.TRANSPARENT),ze.logger.debug("Starting renderer for element at "+gn.x+","+gn.y+" with size "+gn.width+"x"+gn.height),pn=new kIe(ze,gn),[4,pn.render(Mi)];case 4:dr=Xr.sent(),Xr.label=5;case 5:return(R.removeContainer??!0)&&(rK.destroy(Ti)||ze.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),ze.logger.debug("Finished rendering"),[2,dr]}})})},FIe=function(_,R,U){var F=R.ownerDocument,X=F.documentElement?E4(_,getComputedStyle(F.documentElement).backgroundColor):pp.TRANSPARENT,ae=F.body?E4(_,getComputedStyle(F.body).backgroundColor):pp.TRANSPARENT,Ee=typeof U=="string"?E4(_,U):U===null?pp.TRANSPARENT:4294967295;return R===F.documentElement?zA(X)?zA(ae)?Ee:ae:X:Ee};return LIe}))}))(),1);async function Yk(e){let t=!1,i,r;document.fullscreenElement===e&&(t=!0,i=e.style.width,r=e.style.height,e.style.width="100vw",e.style.height="100vh");let n=await(0,Jk.default)(e);return t&&(e.style.width=i,e.style.height=r),n.toDataURL()}var Z7t={props:{elements:{type:Array,required:!0},shortcuts:{type:Array,required:!0}}},X7t={class:"shortcuts-modal"},$7t={class:"shortcuts-modal__title"},eyt={class:"shortcuts-modal__content"},tyt={class:"shortcuts-modal__content-left"},iyt={class:"shortcuts-modal__content-left__element__image"},ryt={class:"shortcuts-modal__content-left__element__text"},nyt={class:"shortcuts-modal__content-right"},oyt={class:"shortcuts-modal__content-right__element__shortcut"},ayt={key:0,class:"letter"},syt={key:1,class:"flex items-center"},lyt={class:"maj"},cyt={class:"icon"},dyt={key:2,class:"flex items-center"},uyt={class:"icon"},hyt={key:3,class:"flex items-center"},pyt={class:"icon"},Ayt={class:"shortcuts-modal__content-right__element__text"},fyt={class:"shortcuts-modal__footer"};function gyt(e,t,i,r,n,o){let a=T("BIMDataIllustration"),s=T("BIMDataIconAlt"),l=T("BIMDataButton");return M(),q("div",X7t,[x("div",$7t,[x("span",null,[Yt(e.$slots,"title",{},void 0,!0)])]),x("div",eyt,[x("div",tyt,[(M(!0),q(It,null,pi(i.elements,c=>(M(),q("div",{key:c.title,class:"shortcuts-modal__content-left__element"},[x("div",iyt,[L(a,{name:c.image,x:"200",y:"200"},null,8,["name"])]),x("div",ryt,[x("h3",null,ee(c.title),1),x("p",null,ee(c.text),1)])]))),128))]),x("div",nyt,[(M(!0),q(It,null,pi(i.shortcuts,c=>(M(),q("div",{key:c.text,class:"shortcuts-modal__content-right__element"},[x("div",oyt,[c.letter?(M(),q("span",ayt,ee(c.letter),1)):xe("",!0),c.maj?(M(),q("div",syt,[x("span",lyt,[L(s,{size:"xxs",class:"fill-primary"})]),t[1]||=x("span",{class:"more"},"+",-1),x("div",cyt,[L(a,{name:c.illustration,x:"23",y:"30"},null,8,["name"])])])):xe("",!0),c.alt?(M(),q("div",dyt,[t[2]||=x("span",{class:"alt"}," alt ",-1),t[3]||=x("span",{class:"more"},"+",-1),x("div",uyt,[L(a,{name:c.illustration,x:"23",y:"30"},null,8,["name"])])])):xe("",!0),c.shift?(M(),q("div",hyt,[t[4]||=x("span",{class:"alt"}," shift ",-1),t[5]||=x("span",{class:"more"},"+",-1),x("div",pyt,[L(a,{name:c.illustration,x:"23",y:"30"},null,8,["name"])])])):xe("",!0)]),x("div",Ayt,ee(c.text),1)]))),128))])]),x("div",fyt,[L(l,{fill:"",color:"primary",radius:"",width:"166px",onClick:t[0]||=c=>e.$emit("close")},{default:K(()=>[wt(ee(e.$t("shortcuts-helper.btn")),1)]),_:1})])])}var Zk=W(Z7t,[["render",gyt],["__scopeId","data-v-e7d92a04"]]),myt={components:{ShortcutsModal:Zk},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 vyt(e,t,i,r,n,o){let a=T("ShortcutsModal");return M(),ie(a,{class:"bimdata-shortcuts2d-helper",elements:n.elements,shortcuts:n.shortcuts},{title:K(()=>[wt(ee(e.$t("shortcuts-helper.title_modal_2d")),1)]),_:1},8,["elements","shortcuts"])}var wyt=W(myt,[["render",vyt],["__scopeId","data-v-9a9c15e3"]]);function Xk(e=null){let t=Ot("$viewer");e??=t.localContext;let i=Lr(Array.from(t.state.annotations)),r=[t.state.hub.on("annotation-added",({annotation:n})=>{i.value.push(n),t0(i)}),t.state.hub.on("annotation-updated",()=>{t0(i)}),t.state.hub.on("annotation-removed",({annotation:n})=>{i.value=i.value.filter(o=>o.id!==n.id)})];return Yr(()=>r.forEach(n=>t.state.hub.off(n))),ot(()=>i.value.filter(n=>n.modelIds.length===0?!0:n.modelIds.some(o=>e.loadedModelIds.includes(o))))}var XU=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)},$k=W({__name:"AnnotationWrapper",props:{annotation:{type:Object,required:!0},canvas:{type:HTMLCanvasElement,required:!0}},emits:["annotation-drag"],setup(e,{emit:t}){let i=e,r=t,n=De(null),o=()=>n.value?.querySelector(i.annotation.grabberSelector)??n.value,a=XU(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),r("annotation-drag",u),i.annotation.emit("drag",{nativeEvent:u}),s=!0)};return Cr(()=>{o()?.addEventListener("mousedown",l),o()?.addEventListener("touchstart",l,{passive:!1})}),ou(()=>{o()?.removeEventListener("mousedown",l),o()?.removeEventListener("touchstart",l)}),(u,h)=>(M(),q("div",{ref_key:"wrapper",ref:n,class:"annotation-wrapper",onWheel:h[0]||=(...p)=>Ft(a)&&Ft(a)(...p)},[(M(),ie(oo(e.annotation.component),Pl(e.annotation.props,{annotation:e.annotation}),null,16,["annotation"]))],544))}},[["__scopeId","data-v-840c20b2"]]),byt={class:"annotations-2d"},$U=W({__name:"Annotations2D",props:{context:{type:Object,default:null}},setup(e){let t=e,i=Ot("$viewer"),r=t.context;r||=i.localContext;let n=r.viewer,o=n.viewer??n.engine,a=o.canvas,s=Xk(r),l=ot(()=>s.value.filter(u=>!n.selectedStorey||u.z>=n.selectedStorey.absoluteElevation&&u.z<n.selectedStorey.absoluteTopElevation));o.camera.on("update",()=>t0(s));let c=(u,h)=>{let{x:p,y:A}=a.getBoundingClientRect(),{clientX:f,clientY:m}=h,{x:g,y:w}=o.camera.getPosition({x:f-p,y:m-A});n.ui?.highlightOnHover===!0&&(n.ui.highlightOnHover=!1,setTimeout(()=>n.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:w})},d=u=>{let{x:h,y:p}=o.camera.getCanvasPosition(u);return`left: ${h}px; top: ${p}px;`};return(u,h)=>(M(),q("div",byt,[(M(!0),q(It,null,pi(l.value,p=>(M(),ie($k,{key:p.instanceId,annotation:p,canvas:Ft(a),style:je(d(p)),onAnnotationDrag:A=>c(p,A)},null,8,["annotation","canvas","style","onAnnotationDrag"]))),128))]))}},[["__scopeId","data-v-87f776fe"]]),yyt={props:{autoOpen:{type:Boolean,default:!0}},setup(e){let{localContext:t}=Ot("$viewer"),i=t.viewer?.plugin.name,r=De(!0),n=ot(()=>t.loadedModels),o=De(0),a=ot(()=>n.value[o.value]||{storeys:[]}),s=ot(()=>t.selectedStorey),l=De(!1),c=()=>{l.value=!l.value},d=g=>g.key===s.value?.key,u=g=>{d(g)||t.selectStorey(g)},h=ot(()=>t.shownPlans),p=g=>h.value.some(w=>w.key===g.key),{loadingPlans:A}=qie(t),f=g=>A.value.some(w=>w.key===g.key),m=$o(new Set);return Qt([n,a],()=>{n.value.length===0||n.value.length===1&&a.value.type!=="METABUILDING"&&a.value.storeys.length<2&&(a.value.storeys[0]?.plans.length??0)===0?r.value=!1:r.value=!0,r.value&&(i==="viewer2d"||i==="plan"||i==="photosphere")&&(l.value=e.autoOpen)},{immediate:!0}),{currentModelIndex:o,currentModel:a,storeyPlanShown:m,storeyListOpen:l,isVisible:r,models:n,focus:()=>{a.value&&(l.value||=!0,s.value&&m.add(s.value.uuid))},selectStorey:u,togglePlan:g=>{h.value.some(w=>w.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:p,isPlanLoading:f}}},Cyt={class:"storey-selector"},xyt={class:"storey-selector__list"},kyt=["onClick"],Byt={class:"name"},Eyt={class:"count"},Myt={class:"storey-selector__list__entry__content plan-selector__list"},Iyt=["onClick"],Pyt={key:0,class:"loader"},Syt={class:"storey-selector__model-switcher"},Tyt={class:"actions"};function Dyt(e,t,i,r,n,o){let a=T("BIMDataRadio"),s=T("BIMDataIconStorey"),l=T("BIMDataTextbox"),c=T("BIMDataIconChevron"),d=T("BIMDataButton"),u=T("BIMDataCheckbox"),h=T("BIMDataSpinner"),p=T("BIMDataFileIcon");return M(),q("div",Cyt,[L(Hr,{name:"slide-fade-down"},{default:K(()=>[ti(x("div",xyt,[(M(!0),q(It,null,pi(r.currentModel.storeys.slice(),A=>(M(),q("div",{key:A.key,class:"storey-selector__list__entry"},[L(a,{"model-value":r.isStoreySelected(A),"onUpdate:modelValue":f=>r.selectStorey(A)},null,8,["model-value","onUpdate:modelValue"]),x("div",{class:"storey-selector__list__entry__line",onClick:f=>r.selectStorey(A)},[L(s,{size:"xs"}),x("span",Byt,[L(l,{text:A.name},null,8,["text"])]),A.plans.length>0?(M(),q(It,{key:0},[x("span",Eyt,ee(A.plans.length),1),L(d,{width:"26px",height:"26px",ghost:"",rounded:"",icon:"",onClick:ei(f=>r.togglePlansList(A),["stop"])},{default:K(()=>[L(c,{size:"xxs",rotate:r.storeyPlanShown.has(A.key)?90:0,style:{transition:"transform 0.1s linear"}},null,8,["rotate"])]),_:2},1032,["onClick"])],64)):xe("",!0)],8,kyt),L(Hr,{name:"slide-fade-up"},{default:K(()=>[ti(x("div",Myt,[(M(!0),q(It,null,pi(A.plans,f=>(M(),q("div",{key:`${f.key}`,class:"plan-selector__list__entry"},[L(u,{class:"plan-selector__list__entry__checkbox",disabled:!r.isStoreySelected(A)||r.isPlanLoading(f),"model-value":r.isPlanShown(f),"onUpdate:modelValue":m=>r.togglePlan(f)},null,8,["disabled","model-value","onUpdate:modelValue"]),x("div",{class:"plan-selector__list__entry__line",style:{cursor:"pointer"},onClick:ei(m=>{r.isStoreySelected(A)&&!r.isPlanLoading(f)&&r.togglePlan(f)},["stop"])},[r.isPlanLoading(f)?(M(),q("span",Pyt,[L(h)])):(M(),ie(p,{key:1,"file-name":f.plan.document?.file_name||f.plan.name,size:14},null,8,["file-name"])),L(l,{"max-width":"200px",text:f.plan.name},null,8,["text"])],8,Iyt)]))),128))],512),[[zi,r.storeyPlanShown.has(A.key)]])]),_:2},1024)]))),128))],512),[[zi,r.storeyListOpen&&r.isVisible]])]),_:1}),ti(x("div",Syt,[L(d,{width:"26px",height:"26px",ghost:"",radius:"",icon:"",disabled:r.currentModel.storeys.length===0,onClick:r.toggleStoreysList},{default:K(()=>[L(c,{size:"xxs",rotate:r.storeyListOpen?-90:0,style:{transition:"transform 0.1s linear"}},null,8,["rotate"])]),_:1},8,["disabled","onClick"]),x("span",{class:"name",onClick:t[0]||=(...A)=>r.toggleStoreysList&&r.toggleStoreysList(...A)},[L(l,{text:r.currentModel.name,"tooltip-position":"top"},null,8,["text"])]),x("span",Tyt,[L(d,{width:"26px",height:"26px",ghost:"",rounded:"",icon:"",disabled:r.currentModelIndex===0,onClick:t[1]||=A=>r.currentModelIndex--},{default:K(()=>[L(c,{size:"xxs",rotate:180})]),_:1},8,["disabled"]),L(d,{width:"26px",height:"26px",ghost:"",rounded:"",icon:"",disabled:r.currentModelIndex===r.models.length-1,onClick:t[2]||=A=>r.currentModelIndex++},{default:K(()=>[L(c,{size:"xxs"})]),_:1},8,["disabled"])])],512),[[zi,r.isVisible]])])}var eO=W(yyt,[["render",Dyt],["__scopeId","data-v-c590c341"]]),Ryt={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 Lyt(e,t,i,r,n,o){return M(),q("div",{class:"bimdata-help-shortcuts",onClick:t[0]||=(...a)=>o.onClick&&o.onClick(...a)},"?")}var eB=W(Ryt,[["render",Lyt],["__scopeId","data-v-78103e0c"]]);function tB(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 r=lh(),{lineWidth:n=1,lineColor:o=r,lineOpacity:a=1,fill:s=r,fillOpacity:l=.2}=i,c=e.scene.addObject({shapes:[{style:{lineWidth:n,lineColor:o,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 _yt={name:"Viewer2D",components:{Annotations:$U,BIMDataStoreySelector:eO,Help:eB},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=wyt,this.localContextSubscriptions=[],this.stateSubscriptions=[],this.queue=Rv(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=y2({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=J7t(this),this.plugins=KU(this),this.unsubscribe=K7t(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||=Y7t(this.viewer),this.camera3DSubscription=this.$viewer.globalContext.hub.on("3d-camera-update",i=>{let{eye:r,look:n,up:o}=i;this.syncRotationFrom3DCamera(r,n,o);let[a,,s]=r,[l,,c]=n;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:r,sub:n,normalize:o}=this.viewer.utils.vector2D,[a,,s]=e,[l,,c]=t,d=o(n({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?r(d,{x:0,y:1}):r({x:0,y:1},d);let h=i[1]>0?180:0,p=u/Math.PI*180+h;this.viewer.camera.setViewpoint({rotation:p})},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:r=>{let{clientX:n,clientY:o}=r,{x:a,y:s}=this.viewer.canvas.getBoundingClientRect(),l=this.viewer.camera.getPosition({x:n-a,y:o-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||=Gk(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((r,n)=>{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 o={model:i,ifc:i,plugin:this};if(this.$viewer.localContext.hub.emit("2d-model-loaded",o),this.$viewer.globalContext.hub.emit("2d-model-loaded",o),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])}r()}catch(o){n(o)}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],r=()=>{if(this.$viewer.localContext.selectStorey(null),this.model=null,this.viewer.scene.removeModel(String(i.id))){let n={model:i,ifc:i,plugin:this};return this.$viewer.localContext.hub.emit("2d-model-unloaded",n),this.$viewer.globalContext.hub.emit("2d-model-unloaded",n),!0}else return!1};t?this.queue.push(r):r()},async getSnapshot(){return{snapshot_type:"png",snapshot_data:await Yk(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:r}=e.orthogonal_camera,n=this.$viewer.state.getStoreyFromAbsoluteElevation(this.model,t.z);this.$viewer.localContext.selectStorey(n);let o=this.viewer.utils.vector2D.angle({x:1,y:0},i);this.viewer.camera.setViewpoint({...t,rotation:-(o/Math.PI)*180,zoom:r})},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:r}=this.viewer.camera.getPosition(t),n=this.selectedStorey,o=this.viewer.picker.pick(t),a=this.$viewer.state.objectsMap.get(+o?.id)??null;e({x:i,y:r,z:n.absoluteElevation,models:this.$viewer.localContext.loadedModels,storey:n,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 tB(this.viewer,e,t)}}},Fyt={class:"bimdata-viewer2d"},jyt={ref:"canvas",class:"bimdata-viewer2d__viewer__canvas"},Uyt={ref:"texter",style:{position:"absolute",top:"0px",left:"0px"}},Oyt={class:"bimdata-viewer2d__header"};function Hyt(e,t,i,r,n,o){let a=T("Annotations"),s=T("NoModelWindowPlaceHolder"),l=T("ModelsLoader"),c=T("Help"),d=T("BIMDataStoreySelector");return M(),q("div",Fyt,[x("canvas",jyt,null,512),x("div",Uyt,null,512),e.engine2dCreated?(M(),ie(a,{key:0})):xe("",!0),!e.ifc&&!e.loading?(M(),ie(s,{key:1})):xe("",!0),x("div",Oyt,[e.settings.modelLoader==="disabled"?xe("",!0):ti((M(),ie(l,{key:0,ref:"header","window-positioning":!1},null,512)),[[zi,e.modelHeaderShown]]),e.helpShown?(M(),ie(c,{key:1,modal:e.helpModal,name:"2D"},null,8,["modal"])):xe("",!0)]),ti(L(d,{ref:"storeySelector","auto-open":e.storeySelectorAutoOpen},null,8,["auto-open"]),[[zi,e.storeySelectorShown]])])}var qyt={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:W(_yt,[["render",Hyt],["__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}},Nyt="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",zyt={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:Nyt,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:r,clientY:n}=i,{x:o,y:a}=this.$el.getBoundingClientRect();this.elPosition={x:o,y:a},this.container&&(this.containerRect=this.container.getBoundingClientRect()),this.cursorTranslate={x:r-o,y:n-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:r,height:n}=this.containerRect;for(;this.cursorTranslate.x+this.elPosition.x-t>r;)this.cursorTranslate.x-=r;for(;this.cursorTranslate.x+this.elPosition.x<t;)this.cursorTranslate.x+=r;for(;this.cursorTranslate.y+this.elPosition.y-i>n;)this.cursorTranslate.y-=n;for(;this.cursorTranslate.y+this.elPosition.y<i;)this.cursorTranslate.y+=n}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()}}},Vyt=["value","disabled"],Qyt=["src"];function Gyt(e,t,i,r,n,o){let a=Mr("click-away");return ti((M(),q("div",{class:Ue(["bimdata-numerical-input",{"bimdata-numerical-input--focus":n.focused}]),onMousedown:t[3]||=(...s)=>o.onMouseDown&&o.onMouseDown(...s)},[ti(x("span",{ref:"label",class:"bimdata-numerical-input__label",style:je(`width: ${i.labelWidth}`)},ee(i.label),5),[[zi,i.label]]),x("input",{ref:"input",class:Ue(["bimdata-numerical-input__input",{"bimdata-numerical-input__input--centered":i.centered}]),value:`${o.fixedValue}${i.unit}`,disabled:i.disabled,onChange:t[0]||=(...s)=>o.onChange&&o.onChange(...s),onFocus:t[1]||=(...s)=>o.onFocus&&o.onFocus(...s),onBlur:t[2]||=(...s)=>o.onBlur&&o.onBlur(...s)},null,42,Vyt),n.grabbing?(M(),q("div",{key:0,class:"bimdata-numerical-input__cursor",style:je(o.cursorTransform)},[x("img",{src:n.cursor,style:{transform:"translate(-50%, -50%)"}},null,8,Qyt)],4)):xe("",!0)],34)),[[a,o.away]])}var Pfe=W(zyt,[["render",Gyt],["__scopeId","data-v-7438b65a"]]),Kyt={components:{BIMDataNumericalInput:Pfe},setup(){let e=Ot("$viewer"),t=Ot("root"),i=ot(()=>t.editedBitmap?t.editedBitmap:{x:0,y:0,scale:0,angle:0,opacity:0}),r=Wyt(i);return{root:t,bitmap:i,...r,submit:async()=>{try{if(t.loading=!0,t.editedBitmap.plan){let{x:o,y:a,scale:s,angle:l,opacity:c,plan:d}=t.editedBitmap,u={...d.plan.transform};Object.assign(d.plan.transform,{translate:[o,a],rotate:l,scale:s,opacity:c}),await e.state.updatePlan(d,u)}else{let{x:o,y:a,angle:s,scale:l,opacity:c}=i.value,d={translate:[o??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(o){console.error(o)}finally{t.loading=!1}}}}};function Wyt(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,r])=>{t[i]=ot({get:()=>e.value[i],set:n=>e.value[i]=r(n)})}),t}var Jyt={class:"viewer2d-background__page__edit"},Yyt={class:"viewer2d-background__page__edit__content"},Zyt={class:"viewer2d-background__page__edit__content__unit-group"},Xyt={class:"viewer2d-background__page__edit__content__unit-group__element"},$yt={class:"viewer2d-background__page__edit__content__unit-group__element"},eCt={class:"viewer2d-background__page__edit__content__unit-group__element"},tCt={class:"viewer2d-background__page__edit__content__unit"},iCt={class:"viewer2d-background__page__edit__content__unit"},rCt={class:"viewer2d-background__page__edit__content__img"},nCt=["src"],oCt={class:"viewer2d-background__page__edit__validate"};function aCt(e,t,i,r,n,o){let a=T("BIMDataNumericalInput"),s=T("BIMDataSlider"),l=T("BIMDataTextbox"),c=T("BIMDataButton");return M(),q("div",Jyt,[x("div",Yyt,[x("section",null,[x("span",null,ee(e.$t("viewer2d-background.location")),1),x("div",Zyt,[x("div",Xyt,[L(a,{modelValue:e.x,"onUpdate:modelValue":t[0]||=d=>e.x=d,label:"X",container:e.$viewer.localContext.el},null,8,["modelValue","container"])]),x("div",$yt,[L(a,{modelValue:e.y,"onUpdate:modelValue":t[1]||=d=>e.y=d,label:"Y",container:e.$viewer.localContext.el},null,8,["modelValue","container"])]),x("div",eCt,[L(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"])])])]),x("section",null,[x("span",null,ee(e.$t("viewer2d-background.rotation")),1),x("div",tCt,[L(a,{modelValue:e.angle,"onUpdate:modelValue":t[3]||=d=>e.angle=d,unit:"\xB0",centered:""},null,8,["modelValue"]),L(s,{modelValue:e.angle,"onUpdate:modelValue":t[4]||=d=>e.angle=d,min:0,max:360},null,8,["modelValue"])])]),x("section",null,[x("span",null,ee(e.$t("viewer2d-background.alpha")),1),x("div",iCt,[L(a,{modelValue:e.opacity,"onUpdate:modelValue":t[5]||=d=>e.opacity=d,centered:""},null,8,["modelValue"]),L(s,{modelValue:e.opacity,"onUpdate:modelValue":t[6]||=d=>e.opacity=d,min:0,max:1,step:.01},null,8,["modelValue"])])]),x("section",null,[x("span",null,ee(e.$t("viewer2d-background.preview")),1),x("div",rCt,[x("img",{src:r.bitmap.dataUrl,alt:"Background"},null,8,nCt),L(l,{text:r.bitmap.name,class:"viewer2d-background__page__edit__content__img__name"},null,8,["text"])])])]),x("div",oCt,[L(c,{width:"100%",color:"primary",fill:"",radius:"",onClick:r.submit},{default:K(()=>[wt(ee(r.bitmap&&r.bitmap.plan?e.$t("global.save"):e.$t("global.validate")),1)]),_:1},8,["onClick"])])])}var sCt=W(Kyt,[["render",aCt],["__scopeId","data-v-a022440a"]]);function Sfe(e,t){let i=t.anchorSynchronization===!0&&e.windowManager.registeredWindows.has("anchor-synchronization");return{anchorSynchronizationWindowAvailable:i,openAnchorSynchronizationWindow:async({model:r,storey:n,modelToSynchronize:o})=>{if(!i)throw Error("Anchor Synchronization window is not registered");if(!r||!o)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 On(),e.globalContext.localContexts[0].plugins.get("anchor-synchronization-window").synchronize(r,n,o)}}}var lCt={components:{BIMDataGED:wy},setup(){let e=Ot("viewer2d"),t=Ot("root"),i=Ot("$plugin"),r=e.$viewer,{openAnchorSynchronizationWindow:n,anchorSynchronizationWindowAvailable:o}=Sfe(r,i),a=De(null);return{root:t,selectedDocument:a,submit:async()=>{try{t.loading=!0;let s=a.value,l=await r.api.createModel(s.id);if(l=await r.api.waitForModelProcess(l),o){let c=r.state.modelsMap.get(l.id);if(c||=(await r.state.loadModels([l.id],{silent:!0}))[0],!c)throw Error("Plan model not found");await n({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,h={translate:[c,d],rotate:u,scale:1,opacity:1},p=await e.plugins.bitmaps.createBitmap(s,{plan:l},h);p.plan=null,p.edited=!0,t.editedBitmap=p,t.page="edit"}}catch(s){console.error(s),t.page="home"}finally{a.value=null,t.loading=!1}}}}},cCt={class:"viewer2d-background__page__ged"},dCt={class:"viewer2d-background__page__ged__button"};function uCt(e,t,i,r,n,o){let a=T("BIMDataGED"),s=T("BIMDataButton");return M(),q("div",cCt,[L(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=>r.selectedDocument=l[0]},null,512),x("div",dCt,[L(s,{width:"100%",height:"32px",color:"primary",fill:"",radius:"",disabled:!r.selectedDocument,onClick:r.submit},{default:K(()=>[wt(ee(e.$t("global.validate")),1)]),_:1},8,["disabled","onClick"])])])}var hCt=W(lCt,[["render",uCt],["__scopeId","data-v-d1ac46ef"]]),pCt={setup(){let e=Ot("$viewer"),t=Ot("$plugin"),i=Ot("viewer2d"),r=Ot("root"),{openAnchorSynchronizationWindow:n,anchorSynchronizationWindowAvailable:o}=Sfe(e,t),a=De(null);return{root:r,menuIndexDisplayed:a,toggleMenu:s=>{a.value=a.value===s?null:s},closeMenu:s=>{a.value===s&&(a.value=null)},onCreateClick:()=>{r.page="bond"},onEditClick:async s=>{try{if(r.loading=!0,r.selectedStorey!==s.storey&&e.localContext.selectStorey(s.storey),o){let l=e.state.modelsMap.get(s.plan.id);l||=(await e.state.loadModels([s.plan.id],{silent:!0}))[0],n({model:s.model,storey:s.storey,modelToSynchronize:l})}else await i.plugins.bitmaps.showPlan(s),r.editedBitmap=i.plugins.bitmaps.getBitmap(s),r.page="edit"}catch(l){console.error(l)}finally{r.loading=!1}},onDeleteClick:async s=>{try{r.loading=!0,await e.state.deletePlan(s)}catch(l){console.error(l)}finally{r.loading=!1}}}}},ACt={class:"viewer2d-background__page__home"},fCt={class:"viewer2d-background__page__home__description"},gCt={class:"viewer2d-background__page__home__list"},mCt={class:"viewer2d-background__page__home__list__element__icon"},vCt={class:"viewer2d-background__page__home__list__element__labels"},wCt={key:0,class:"viewer2d-background__page__home__list__element__menu"},bCt={key:0,class:"viewer2d-background__page__home__list__element__menu__menu"};function yCt(e,t,i,r,n,o){let a=T("BIMDataButton"),s=T("BIMDataIconSynchro2D"),l=T("BIMDataTextbox"),c=T("BIMDataIconEllipsis"),d=Mr("click-away");return M(),q("div",ACt,[x("div",fCt,ee(e.$t("viewer2d-background.description")),1),L(a,{class:"viewer2d-background__page__home__button",color:"primary",fill:"",radius:"",width:"60%",disabled:!e.$viewer.api.permissions.hasModelWritePermission||r.root.storeys.length===0,onClick:r.onCreateClick},{default:K(()=>[r.root.storeys.length===0?(M(),q(It,{key:0},[wt(ee(e.$t("viewer2d-background.no_ifc")),1)],64)):r.root.storeys.length>0?(M(),q(It,{key:1},[wt(ee(e.$t("global.new")),1)],64)):(M(),q(It,{key:2},[wt(ee(e.$t("viewer2d-background.start")),1)],64))]),_:1},8,["disabled","onClick"]),x("ul",gCt,[(M(!0),q(It,null,pi(r.root.plans,u=>(M(),q("li",{key:`${u.key}`,class:"viewer2d-background__page__home__list__element"},[x("div",mCt,[L(s,{size:"m",fill:"",color:"primary"})]),x("div",vCt,[L(l,{class:"viewer2d-background__page__home__list__element__labels__storey",text:u.storey.name},null,8,["text"]),L(l,{class:"viewer2d-background__page__home__list__element__labels__plan",text:u.plan.name},null,8,["text"])]),e.$viewer.api.permissions.hasModelWritePermission?ti((M(),q("div",wCt,[L(a,{color:"granite",ghost:"",rounded:"",icon:"",onClick:h=>r.toggleMenu(u.key)},{default:K(()=>[L(c,{size:"l"}),r.menuIndexDisplayed===u.key?(M(),q("div",bCt,[L(a,{width:"100%",color:"granite",ghost:"",square:"",onClick:h=>r.onEditClick(u)},{default:K(()=>[wt(ee(e.$t("global.edit")),1)]),_:1},8,["onClick"]),L(a,{width:"100%",color:"granite",ghost:"",square:"",onClick:h=>r.onDeleteClick(u)},{default:K(()=>[x("div",null,ee(e.$t("global.delete")),1)]),_:1},8,["onClick"])])):xe("",!0)]),_:2},1032,["onClick"])])),[[d,()=>r.closeMenu(u.key)]]):xe("",!0)]))),128))])])}var CCt=W(pCt,[["render",yCt],["__scopeId","data-v-ee47f509"]]),xCt={setup(){let e=Ot("$viewer");return{root:Ot("root"),selectStorey:t=>{e.localContext.selectStorey(t)}}}},kCt={class:"viewer2d-background__page__bond"},BCt={class:"viewer2d-background__page__bond__list-title"},ECt={class:"viewer2d-background__page__bond__list-title"};function MCt(e,t,i,r,n,o){let a=T("BIMDataDropdownList"),s=T("BIMDataButton");return M(),q("div",kCt,[x("div",null,[x("div",BCt," 1 - "+ee(e.$t("viewer2d-background.select_storey")),1),L(a,{width:"100%",list:r.root.storeys,"per-page":20,"element-key":"id","close-on-element-click":"",class:"viewer2d-background__page__bond__storeys",onElementClick:t[0]||=l=>r.selectStorey(l)},{header:K(()=>[wt(ee(r.root.selectedStorey?r.root.selectedStorey.name:e.$t("viewer2d-background.select_storey")),1)]),element:K(({element:l})=>[x("span",{class:Ue({"viewer2d-background__page__bond__storeys--active":r.root.selectedStorey===l})},ee(l.name),3)]),_:1},8,["list"])]),x("div",null,[x("div",ECt," 2 - "+ee(e.$t("viewer2d-background.import_file")),1),L(s,{width:"100%",color:"primary",fill:"",radius:"",disabled:!r.root.selectedStorey,onClick:t[1]||=l=>r.root.page="ged"},{default:K(()=>[wt(ee(e.$t("viewer2d-background.from_ged")),1)]),_:1},8,["disabled"])])])}var ICt={name:"Background2D",components:{edit:sCt,ged:hCt,home:CCt,bond:W(xCt,[["render",MCt],["__scopeId","data-v-2573d11f"]])},props:{isOpen:{type:Boolean,default:!1}},setup(){let e=Ot("$viewer"),t=Ot("$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=os(i),vn("viewer2d",i);let r=Ma({page:"home",loading:!1,modalDisplayed:!1,model:{},storeys:[],plans:[],selectedStorey:null,editedBitmap:null});vn("root",r);let n=e.localContext.hub.on("models-loaded",({models:[u]})=>{r.model=u,r.storeys=u.storeys,r.plans=u.storeys.flatMap(h=>h.plans)},{getLastEvent:!0}),o=e.localContext.hub.on("storey-selected",({storey:u})=>{r.selectedStorey=u,u||(r.page="home")},{getLastEvent:!0}),a=e.state.hub.on("plan-created",()=>r.plans=r.model.storeys.flatMap(u=>u.plans)),s=e.state.hub.on("plan-updated",()=>r.plans=r.model.storeys.flatMap(u=>u.plans)),l=e.state.hub.on("plan-deleted",()=>r.plans=r.model.storeys.flatMap(u=>u.plans));Yr(()=>{e.localContext.hub.off(n),e.localContext.hub.off(o),e.localContext.hub.off(a),e.localContext.hub.off(s),e.localContext.hub.off(l)}),Qt(()=>r.page,u=>{u!=="edit"&&(r.editedBitmap=null)},{immediate:!0}),Qt(()=>r.editedBitmap,(u,h)=>{h?.edit(!1),u?.edit(!0)},{immediate:!0});let c=()=>{r.page="home",r.modalDisplayed=!1,t.close()},d=!0;return{viewer2d:i,root:r,onBackClick:()=>{switch(d=!0,r.page){case"ged":r.page="bond";break;case"edit":r.editedBitmap?.edited?r.modalDisplayed=!0:r.editedBitmap.plan?(r.editedBitmap.reset(),r.page="home"):(i.plugins.bitmaps.deleteBitmap(r.editedBitmap),r.page="ged");break;default:r.page="home"}},onCloseClick:()=>{d=!1,r.editedBitmap?.edited?r.modalDisplayed=!0:c()},onLeaveClick:()=>{r.editedBitmap.plan?r.editedBitmap.reset():i.plugins.bitmaps.deleteBitmap(r.editedBitmap),d?r.editedBitmap.plan?r.page="home":r.page="ged":c(),r.modalDisplayed=!1},onKeyDown:u=>{r.loading||u.key==="Escape"&&(u.preventDefault(),r.page==="home"?c():r.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)}},PCt={class:"viewer2d-background"},SCt={class:"viewer2d-background__header__back"},TCt={class:"viewer2d-background__header__title__text"},DCt={key:1,class:"viewer2d-background__modal"},RCt={class:"viewer2d-background__modal__content"},LCt={class:"viewer2d-background__modal__content__symbols"},_Ct={class:"viewer2d-background__modal__content__buttons"};function FCt(e,t,i,r,n,o){let a=T("BIMDataLoading"),s=T("BIMDataIconArrow"),l=T("BIMDataButton"),c=T("BIMDataIconSynchro2D"),d=T("BIMDataIconClose"),u=T("BIMDataIconWarning");return M(),q("div",PCt,[r.root.loading?(M(),ie(a,{key:0})):xe("",!0),x("div",{class:Ue(["viewer2d-background__header",{"viewer2d-background__header--home":r.root.page==="home"}])},[x("div",SCt,[r.root.page==="home"?xe("",!0):(M(),ie(l,{key:0,width:"25px",height:"25px",color:"primary",ghost:"",radius:"",icon:"",onClick:r.onBackClick},{default:K(()=>[L(s,{size:"xs"})]),_:1},8,["onClick"]))]),x("div",{class:Ue(["viewer2d-background__header__title",{"viewer2d-background__header__title--home":r.root.page==="home"}])},[L(c,{size:r.root.page==="home"?"l":"xs",fill:"",color:"primary"},null,8,["size"]),x("span",TCt,ee(e.$t("viewer2d-background.title")),1)],2),L(l,{class:"viewer2d-background__header__close",width:"25px",height:"25px",ghost:"",radius:"",icon:"",onClick:r.onCloseClick},{default:K(()=>[L(d,{size:"xs",fill:"",color:"granite-light"})]),_:1},8,["onClick"])],2),x("div",{class:Ue(["viewer2d-background__page",{"viewer2d-background__page--home":r.root.page==="home"}])},[(M(),ie(A7,null,[(M(),ie(oo(r.root.page)))],1024))],2),r.root.modalDisplayed?(M(),q("div",DCt,[x("div",RCt,[x("div",LCt,[L(u,{fill:"",color:"high",size:"l"}),x("div",null,ee(e.$t("viewer2d-background.warning")),1)]),x("div",_Ct,[L(l,{width:"45%",color:"high",fill:"",radius:"",onClick:r.onLeaveClick},{default:K(()=>[wt(ee(e.$t("viewer2d-background.leave")),1)]),_:1},8,["onClick"]),L(l,{width:"45%",color:"default",outline:"",radius:"",onClick:t[0]||=h=>r.root.modalDisplayed=!1},{default:K(()=>[wt(ee(e.$t("viewer2d-background.stay")),1)]),_:1})])])])):xe("",!0)])}var Tfe=W(ICt,[["render",FCt],["__scopeId","data-v-1eece107"]]),Dfe={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"},jCt="Background",UCt="2D viewer background",OCt="Location",HCt="Scale",qCt="Rotation",NCt="Alpha",zCt="Preview",VCt="From the project GED",QCt="From your computer",GCt="To add a background, please select an IFC and a storey.",KCt="Start",WCt="Overlay your PDF plans by floor to view them in the 2D viewer",JCt="Select a storey",YCt="Import a file",ZCt="To add a background, please select an IFC with at least one storey.",XCt="Are you sure you want to leave this page? There may be some unvalidated information.",$Ct="Yes, leave this page",ext="Cancel, stay here",Rfe={tooltip:jCt,"tooltip-anchor-synchronization":"Synchronization",title:UCt,location:OCt,scale:HCt,rotation:qCt,alpha:NCt,preview:zCt,import:"Import element",from_ged:VCt,from_computer:QCt,no_storey:GCt,start:KCt,description:WCt,select_storey:JCt,import_file:YCt,no_ifc:ZCt,warning:XCt,leave:$Ct,stay:ext},Lfe={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"},txt="Synchronisation 2D",ixt="Synchronisation 2D",rxt="Position",nxt="Echelle",oxt="Rotation",axt="Opacit\xE9",sxt="Aper\xE7u",lxt="Depuis la GED du projet",cxt="Depuis votre ordinateur",dxt="Pour ajouter un fond, veuillez selectionner un IFC et un \xE9tage.",uxt="Commencer",hxt="Superposez vos plans PDF par \xE9tages pour les visualisez dans la visionneuse 2D",pxt="S\xE9lectionner un \xE9tage",Axt="Importer un fichier",fxt="Pour ajouter un fond, veuillez selectionner un IFC avec au moins un \xE9tage.",gxt="\xCAtes-vous s\xFBr de vouloir quitter cette page ? Il y'a peut-\xEAtre des informations non valid\xE9es.",mxt="Oui, quitter cette page",vxt="Annuler, rester ici",_fe={tooltip:txt,"tooltip-anchor-synchronization":"Synchronisation",title:ixt,location:rxt,scale:nxt,rotation:oxt,alpha:axt,preview:sxt,import:"Importer un \xE9l\xE9ment",from_ged:lxt,from_computer:cxt,no_storey:dxt,start:uxt,description:hxt,select_storey:pxt,import_file:Axt,no_ifc:fxt,warning:gxt,leave:mxt,stay:vxt},Ffe={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"},wxt={name:"viewer2d-background",i18n:{de:Dfe,en:Rfe,es:Lfe,fr:_fe,it:Ffe},addToWindows:["2d"],component:Tfe,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"}}},tO="viewer2d-parameters_parameters",bxt={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(tO)||"{}";e=JSON.parse(t)}catch{localStorage.removeItem(tO)}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(tO,JSON.stringify(e))}}},yxt={class:"viewer2d-parameters"},Cxt={class:"viewer2d-parameters_header"},xxt={class:"viewer2d-parameters_content"},kxt={class:"m-b-18"},Bxt={class:"m-b-18"},Ext={class:"m-b-18"},Mxt={class:"m-b-18"};function Ixt(e,t,i,r,n,o){let a=T("BIMDataIconParameters"),s=T("BIMDataToggle");return M(),q("div",yxt,[x("div",Cxt,[L(a,{size:"xs",margin:"0 12px 0 0"}),x("span",null,ee(e.$t("viewer2d-parameters.title")),1)]),x("div",xxt,[x("div",kxt,[x("span",null,ee(e.$t("viewer2d-parameters.ifc_spaces")),1),L(s,{modelValue:o.spacesDisplayed,"onUpdate:modelValue":t[0]||=l=>o.spacesDisplayed=l},null,8,["modelValue"])]),x("div",Bxt,[x("span",null,ee(e.$t("viewer2d-parameters.display_door_openings")),1),L(s,{modelValue:o.doorsDisplayed,"onUpdate:modelValue":t[1]||=l=>o.doorsDisplayed=l},null,8,["modelValue"])]),x("div",Ext,[x("span",null,ee(e.$t("viewer2d-parameters.display_compass")),1),L(s,{modelValue:o.compassDisplayed,"onUpdate:modelValue":t[2]||=l=>o.compassDisplayed=l},null,8,["modelValue"])]),x("div",Mxt,[x("span",null,ee(e.$t("viewer2d-parameters.highlight")),1),L(s,{modelValue:o.highlightOnHover,"onUpdate:modelValue":t[3]||=l=>o.highlightOnHover=l},null,8,["modelValue"])]),x("div",null,[x("span",null,ee(e.$t("viewer2d-parameters.camera_sync")),1),L(s,{modelValue:o.camera3DSynchronization,"onUpdate:modelValue":t[4]||=l=>o.camera3DSynchronization=l},null,8,["modelValue"])])])])}var Pxt={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:W(bxt,[["render",Ixt],["__scopeId","data-v-df342105"]]),button:{tooltip:"viewer2d-parameters.tooltip",stance:-1,position:"right",content:"simple",icon:{component:"BIMDataIconParameters",options:{size:"m"}}}},Sxt={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 r=await(0,Jk.default)(this.$viewer.localContext.el);t&&(e.style.width=i.width,e.style.height=i.height);let n=document.createElement("a");n.download=this.viewer2d.ifc&&this.viewer2d.ifc.name?String(this.viewer2d.ifc.name).split(".ifc")[0]:"2d-capture.png",n.href=r.toDataURL(),n.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"}}}},Od=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}},jfe=new Od,Txt=class{constructor(e){this.id=e,this.parentItem=null,this.groups=[],this.menuElement=null,this.shown=!1,this.mouseOver=0}},Dxt=class{constructor(){this.items=[]}},Rxt=class{constructor(e,t,i,r,n){this.id=e,this.getTitle=t,this.doAction=i,this.getEnabled=r,this.getShown=n,this.itemElement=null,this.subMenu=null,this.enabled=!0}},Lxt=class{constructor(e={}){this._id=jfe.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 r=0,n=i.length;r<n;r++)i[r](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&&(jfe.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 r=new Txt(this._getNextId());for(let n=0,o=i.length;n<o;n++){let a=i[n],s=new Dxt;r.groups.push(s);for(let l=0,c=a.length;l<c;l++){let d=a[l],u=d.items,h=u&&u.length>0,p=new Rxt(this._getNextId(),d.getTitle||(()=>d.title||""),d.doAction||d.callback||(()=>{}),d.getEnabled||(()=>!0),d.getShown||(()=>!0));if(p.parentMenu=r,s.items.push(p),h){let A=t(u);p.subMenu=A,A.parentItem=p}this._itemList.push(p),this._itemMap[p.id]=p}}return this._menuList.push(r),this._menuMap[r.id]=r,r};this._rootMenu=t(e)}_getNextId(){return"ContextMenu_"+this._id+"_"+this._nextId++}_createUI(){let e=t=>{this._createMenuUI(t);let i=t.groups;for(let r=0,n=i.length;r<n;r++){let o=i[r].items;for(let a=0,s=o.length;a<s;a++){let l=o[a].subMenu;l&&e(l)}}};e(this._rootMenu)}_createMenuUI(e){let t=e.groups,i=[],r=document.createElement("div");if(r.classList.add("xeokit-context-menu",e.id),r.style.zIndex=3e5,r.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 h=0,p=u.length;h<p;h++){let A=u[h],f=A.subMenu,m=A.title||"";f?(i.push('<li id="'+A.id+'" class="xeokit-context-menu-item xeokit-context-menu-submenu">'+m+"</li>"),c===d-1||h<p-1||i.push('<li id="'+A.id+'" class="xeokit-context-menu-item-separator"></li>')):(i.push('<li id="'+A.id+'" class="xeokit-context-menu-item">'+m+"</li>"),c===d-1||h<p-1||i.push('<li id="'+A.id+'" class="xeokit-context-menu-item-separator"></li>'))}}i.push("</ul>"),r.innerHTML=i.join(""),this._parentNode.appendChild(r),e.menuElement=r,r.style["border-radius"]="4px",r.style.display="none",r.style["z-index"]=3e5,r.style.background="white",r.style.border="1px solid black",r.style["box-shadow"]="0 4px 5px 0 gray",r.oncontextmenu=a=>{a.preventDefault()};let n=this,o=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],h=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",p=>{p.preventDefault();let A=u.subMenu;if(!A){o&&=(n._hideMenu(o.id),null);return}if(o&&o.id!==A.id&&(n._hideMenu(o.id),o=null),u.enabled===!1)return;let f=u.itemElement,m=A.menuElement,g=f.getBoundingClientRect();m.getBoundingClientRect();let w=n._offsetParent.getBoundingClientRect(),v=g.right+200<w.right,b=g.left-200>w.left;if(v)n._showMenu(A.id,g.right+window.scrollX-5,g.top+window.scrollY-1);else if(b)n._showMenu(A.id,g.left-200+window.scrollX,g.top+window.scrollY-1);else{let y=g.left-w.left,C=w.right-g.right;C>y?n._showMenu(A.id,g.right-5-(200-C),g.top+window.scrollY-1):n._showMenu(A.id,g.left-y,g.top+window.scrollY-1)}o=A}),h||(u.itemElement.addEventListener("click",p=>{p.preventDefault(),n._context&&u.enabled!==!1&&(u.doAction&&u.doAction(n._context),this._hideOnAction?n.hide():(n._updateItemsTitles(),n._updateItemsEnabledStatus()))}),u.itemElement.addEventListener("mouseup",p=>{p.which===3&&(p.preventDefault(),n._context&&u.enabled!==!1&&(u.doAction&&u.doAction(n._context),this._hideOnAction?n.hide():(n._updateItemsTitles(),n._updateItemsEnabledStatus())))}),u.itemElement.addEventListener("mouseenter",p=>{p.preventDefault(),u.enabled!==!1&&u.doHover&&u.doHover(n._context)}))}}}_updateItemsTitles(){if(this._context)for(let e=0,t=this._itemList.length;e<t;e++){let i=this._itemList[e],r=i.itemElement;if(!r)continue;let n=i.getShown;if(!n||!n(this._context))continue;let o=i.getTitle(this._context);i.subMenu,r.innerText=o}}_updateItemsEnabledStatus(){if(this._context)for(let e=0,t=this._itemList.length;e<t;e++){let i=this._itemList[e],r=i.itemElement;if(!r)continue;let n=i.getEnabled;if(!n)continue;let o=i.getShown;if(!o)continue;let a=o(this._context);if(i.shown=a,a)r.style.display="";else{r.style.display="none";continue}let s=n(this._context);i.enabled=s,s?r.classList.remove("disabled"):r.classList.add("disabled")}}_updateSubMenuInfo(){if(!this._context)return;let e,t,i,r,n,o;this._itemList.forEach(a=>{a.subMenu&&(e=a.itemElement,t=e.getBoundingClientRect(),i=a.subMenu.menuElement,r={visibility:i.style.visibility,display:i.style.display},i.style.display="block",i.style.visibility="hidden",o=a.subMenu.menuElement.getBoundingClientRect().width,i.style.visibility=r.visibility,i.style.display=r.display,n=t.right+o>window.innerWidth,e.setAttribute("data-submenuposition",n?"left":"right"))})}_showMenu(e,t,i){let r=this._menuMap[e];if(!r){console.error("Menu not found: "+e);return}if(r.shown)return;let n=r.menuElement;n&&(this._showMenuElement(n,t,i),r.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 r=e.offsetHeight,n=e.offsetWidth,o=this._offsetParent.getBoundingClientRect(),a=this._offsetParent===window.document.body&&o.bottom===0?window.innerHeight:o.bottom+window.scrollY,s=o.right+window.scrollX;i+r>a&&(i=a-r),t+n>s&&(t=s-n),e.style.left=t-o.left-window.scrollX+"px",e.style.top=i-o.top-window.scrollY+"px"}_hideMenuElement(e){e.style.display="none"}},_xt=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 r=Math.max(this._lensCanvas.width,this._lensCanvas.height)/this._zoomLevel;this._lensCanvasContext.drawImage(this._canvasElement,this._canvasPos[0]-r/2,this._canvasPos[1]-r/2,r,r,0,0,this._lensCanvas.width,this._lensCanvas.height);let n=this._lensParams.canvasSize/2-this._lensParams.cursorSize/2-this._lensParams.cursorBorder,o=this._snappedCanvasPos?this._snappedCanvasPos[0]-this._canvasPos[0]:0,a=this._snappedCanvasPos?this._snappedCanvasPos[1]-this._canvasPos[1]:0;this._lensCursorDiv.style.left=`${n+o*this._zoomLevel}px`,this._lensCursorDiv.style.top=`${n+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)}},iB=!0,Ai=iB?Float64Array:Float32Array,Lv=new Ai(3),rB=new Ai(16),nB=new Ai(16),Fxt=new Ai(4),k={setDoublePrecisionEnabled(e){iB=e,Ai=iB?Float64Array:Float32Array},getDoublePrecisionEnabled(){return iB},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 Ai(e||2)},vec3(e){return new Ai(e||3)},vec4(e){return new Ai(e||4)},mat3(e){return new Ai(e||9)},mat3ToMat4(e,t=new Ai(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 Ai(e||16)},mat4ToMat3(e,t=new Ai(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 r=new Ai(2);for(let n=0,o=e.length;n<o;n++)k.splitDouble(e[n],r),t[n]=r[0],i[n]=r[1]},splitDouble(e,t){let i=Ai.from([e])[0],r=e-i;t[0]=i,t[1]=r},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,r=Math.random()*4294967295|0,n=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[r&63|128]}${e[r>>8&255]}-${e[r>>16&255]}${e[r>>24&255]}${e[n&255]}${e[n>>8&255]}${e[n>>16&255]}${e[n>>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 Ai(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],r=e[1],n=e[2],o=t[0],a=t[1],s=t[2];return[r*s-n*a,n*o-i*s,i*a-r*o,0]},cross3Vec3(e,t,i){i||=e;let r=e[0],n=e[1],o=e[2],a=t[0],s=t[1],l=t[2];return i[0]=n*l-o*s,i[1]=o*a-r*l,i[2]=r*s-n*a,i},sqLenVec4(e){return k.dotVec4(e,e)},lenVec4(e){return Math.sqrt(k.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 k.dotVec3(e,e)},sqLenVec2(e){return k.dotVec2(e,e)},lenVec3(e){return Math.sqrt(k.sqLenVec3(e))},distVec3:(()=>{let e=new Ai(3);return(t,i)=>k.lenVec3(k.subVec3(t,i,e))})(),lenVec2(e){return Math.sqrt(k.sqLenVec2(e))},distVec2:(()=>{let e=new Ai(2);return(t,i)=>k.lenVec2(k.subVec2(t,i,e))})(),rcpVec3(e,t){return k.divScalarVec3(1,e,t)},normalizeVec4(e,t){let i=1/k.lenVec4(e);return k.mulVec4Scalar(e,i,t)},normalizeVec3(e,t){let i=1/k.lenVec3(e);return k.mulVec3Scalar(e,i,t)},normalizeVec2(e,t){let i=1/k.lenVec2(e);return k.mulVec2Scalar(e,i,t)},angleVec3(e,t){let i=k.dotVec3(e,t)/Math.sqrt(k.sqLenVec3(e)*k.sqLenVec3(t));return i=i<-1?-1:i>1?1:i,Math.acos(i)},vec3FromMat4Scale:(()=>{let e=new Ai(3);return(t,i)=>(e[0]=t[0],e[1]=t[1],e[2]=t[2],i[0]=k.lenVec3(e),e[0]=t[4],e[1]=t[5],e[2]=t[6],i[1]=k.lenVec3(e),e[0]=t[8],e[1]=t[9],e[2]=t[10],i[2]=k.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,r=t.length;i<r;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||=k.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 k.m4s(0)},setMat4ToOnes(){return k.m4s(1)},diagonalMat4v(e){return new Ai([e[0],0,0,0,0,e[1],0,0,0,0,e[2],0,0,0,0,e[3]])},diagonalMat4c(e,t,i,r){return k.diagonalMat4v([e,t,i,r])},diagonalMat4s(e){return k.diagonalMat4c(e,e,e,e)},identityMat4(e=new Ai(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 Ai(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 k.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 r=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],d=e[7],u=e[8],h=e[9],p=e[10],A=e[11],f=e[12],m=e[13],g=e[14],w=e[15],v=t[0],b=t[1],y=t[2],C=t[3],B=t[4],I=t[5],E=t[6],P=t[7],S=t[8],D=t[9],j=t[10],V=t[11],Q=t[12],z=t[13],J=t[14],Y=t[15];return i[0]=v*r+b*s+y*u+C*f,i[1]=v*n+b*l+y*h+C*m,i[2]=v*o+b*c+y*p+C*g,i[3]=v*a+b*d+y*A+C*w,i[4]=B*r+I*s+E*u+P*f,i[5]=B*n+I*l+E*h+P*m,i[6]=B*o+I*c+E*p+P*g,i[7]=B*a+I*d+E*A+P*w,i[8]=S*r+D*s+j*u+V*f,i[9]=S*n+D*l+j*h+V*m,i[10]=S*o+D*c+j*p+V*g,i[11]=S*a+D*d+j*A+V*w,i[12]=Q*r+z*s+J*u+Y*f,i[13]=Q*n+z*l+J*h+Y*m,i[14]=Q*o+z*c+J*p+Y*g,i[15]=Q*a+z*d+J*A+Y*w,i},mulMat3(e,t,i){i||=new Ai(9);let r=e[0],n=e[3],o=e[6],a=e[1],s=e[4],l=e[7],c=e[2],d=e[5],u=e[8],h=t[0],p=t[3],A=t[6],f=t[1],m=t[4],g=t[7],w=t[2],v=t[5],b=t[8];return i[0]=r*h+n*f+o*w,i[3]=r*p+n*m+o*v,i[6]=r*A+n*g+o*b,i[1]=a*h+s*f+l*w,i[4]=a*p+s*m+l*v,i[7]=a*A+s*g+l*b,i[2]=c*h+d*f+u*w,i[5]=c*p+d*m+u*v,i[8]=c*A+d*g+u*b,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=k.vec4()){let r=t[0],n=t[1],o=t[2],a=t[3];return i[0]=e[0]*r+e[4]*n+e[8]*o+e[12]*a,i[1]=e[1]*r+e[5]*n+e[9]*o+e[13]*a,i[2]=e[2]*r+e[6]*n+e[10]*o+e[14]*a,i[3]=e[3]*r+e[7]*n+e[11]*o+e[15]*a,i},transposeMat4(e,t){let i=e[4],r=e[14],n=e[8],o=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],h=e[7],p=e[11];return e[1]=i,e[2]=n,e[3]=a,e[4]=l,e[6]=s,e[7]=o,e[8]=c,e[9]=u,e[11]=r,e[12]=d,e[13]=h,e[14]=p,e}return t[0]=e[0],t[1]=i,t[2]=n,t[3]=a,t[4]=e[1],t[5]=e[5],t[6]=s,t[7]=o,t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=r,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],r=e[2],n=e[5];t[1]=e[3],t[2]=e[6],t[3]=i,t[5]=e[7],t[6]=r,t[7]=n}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],r=e[2],n=e[3],o=e[4],a=e[5],s=e[6],l=e[7],c=e[8],d=e[9],u=e[10],h=e[11],p=e[12],A=e[13],f=e[14],m=e[15];return p*d*s*n-c*A*s*n-p*a*u*n+o*A*u*n+c*a*f*n-o*d*f*n-p*d*r*l+c*A*r*l+p*i*u*l-t*A*u*l-c*i*f*l+t*d*f*l+p*a*r*h-o*A*r*h-p*i*s*h+t*A*s*h+o*i*f*h-t*a*f*h-c*a*r*m+o*d*r*m+c*i*s*m-t*d*s*m-o*i*u*m+t*a*u*m},inverseMat4(e,t){t||=e;let i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],d=e[8],u=e[9],h=e[10],p=e[11],A=e[12],f=e[13],m=e[14],g=e[15],w=i*s-r*a,v=i*l-n*a,b=i*c-o*a,y=r*l-n*s,C=r*c-o*s,B=n*c-o*l,I=d*f-u*A,E=d*m-h*A,P=d*g-p*A,S=u*m-h*f,D=u*g-p*f,j=h*g-p*m,V=1/(w*j-v*D+b*S+y*P-C*E+B*I);return t[0]=(s*j-l*D+c*S)*V,t[1]=(-r*j+n*D-o*S)*V,t[2]=(f*B-m*C+g*y)*V,t[3]=(-u*B+h*C-p*y)*V,t[4]=(-a*j+l*P-c*E)*V,t[5]=(i*j-n*P+o*E)*V,t[6]=(-A*B+m*b-g*v)*V,t[7]=(d*B-h*b+p*v)*V,t[8]=(a*D-s*P+c*I)*V,t[9]=(-i*D+r*P-o*I)*V,t[10]=(A*C-f*b+g*w)*V,t[11]=(-d*C+u*b-p*w)*V,t[12]=(-a*S+s*E-l*I)*V,t[13]=(i*S-r*E+n*I)*V,t[14]=(-A*y+f*v-m*w)*V,t[15]=(d*y-u*v+h*w)*V,t},traceMat4(e){return e[0]+e[5]+e[10]+e[15]},translationMat4v(e,t){let i=t||k.identityMat4();return i[12]=e[0],i[13]=e[1],i[14]=e[2],i},translationMat3v(e,t){let i=t||k.identityMat3();return i[6]=e[0],i[7]=e[1],i},translationMat4c:(()=>{let e=new Ai(3);return(t,i,r,n)=>(e[0]=t,e[1]=i,e[2]=r,k.translationMat4v(e,n))})(),translationMat4s(e,t){return k.translationMat4c(e,e,e,t)},translateMat4v(e,t){return k.translateMat4c(e[0],e[1],e[2],t)},translateMat4c(e,t,i,r){let n=r[3];r[0]+=n*e,r[1]+=n*t,r[2]+=n*i;let o=r[7];r[4]+=o*e,r[5]+=o*t,r[6]+=o*i;let a=r[11];r[8]+=a*e,r[9]+=a*t,r[10]+=a*i;let s=r[15];return r[12]+=s*e,r[13]+=s*t,r[14]+=s*i,r},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 r=k.normalizeVec4([t[0],t[1],t[2],0],[]),n=Math.sin(e),o=Math.cos(e),a=1-o,s=r[0],l=r[1],c=r[2],d,u,h,p,A,f;return d=s*l,u=l*c,h=c*s,p=s*n,A=l*n,f=c*n,i||=k.mat4(),i[0]=a*s*s+o,i[1]=a*d+f,i[2]=a*h-A,i[3]=0,i[4]=a*d-f,i[5]=a*l*l+o,i[6]=a*u+p,i[7]=0,i[8]=a*h+A,i[9]=a*u-p,i[10]=a*c*c+o,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},rotationMat4c(e,t,i,r,n){return k.rotationMat4v(e,[t,i,r],n)},scalingMat4v(e,t=k.identityMat4()){return t[0]=e[0],t[5]=e[1],t[10]=e[2],t},scalingMat3v(e,t=k.identityMat3()){return t[0]=e[0],t[4]=e[1],t},scalingMat4c:(()=>{let e=new Ai(3);return(t,i,r,n)=>(e[0]=t,e[1]=i,e[2]=r,k.scalingMat4v(e,n))})(),scaleMat4c(e,t,i,r){return r[0]*=e,r[4]*=t,r[8]*=i,r[1]*=e,r[5]*=t,r[9]*=i,r[2]*=e,r[6]*=t,r[10]*=i,r[3]*=e,r[7]*=t,r[11]*=i,r},scaleMat4v(e,t){let i=e[0],r=e[1],n=e[2];return t[0]*=i,t[4]*=r,t[8]*=n,t[1]*=i,t[5]*=r,t[9]*=n,t[2]*=i,t[6]*=r,t[10]*=n,t[3]*=i,t[7]*=r,t[11]*=n,t},scalingMat4s(e){return k.scalingMat4c(e,e,e)},rotationTranslationMat4(e,t,i=k.mat4()){let r=e[0],n=e[1],o=e[2],a=e[3],s=r+r,l=n+n,c=o+o,d=r*s,u=r*l,h=r*c,p=n*l,A=n*c,f=o*c,m=a*s,g=a*l,w=a*c;return i[0]=1-(p+f),i[1]=u+w,i[2]=h-g,i[3]=0,i[4]=u-w,i[5]=1-(d+f),i[6]=A+m,i[7]=0,i[8]=h+g,i[9]=A-m,i[10]=1-(d+p),i[11]=0,i[12]=t[0],i[13]=t[1],i[14]=t[2],i[15]=1,i},mat4ToEuler(e,t,i=k.vec4()){let r=k.clamp,n=e[0],o=e[4],a=e[8],s=e[1],l=e[5],c=e[9],d=e[2],u=e[6],h=e[10];return t==="XYZ"?(i[1]=Math.asin(r(a,-1,1)),Math.abs(a)<.99999?(i[0]=Math.atan2(-c,h),i[2]=Math.atan2(-o,n)):(i[0]=Math.atan2(u,l),i[2]=0)):t==="YXZ"?(i[0]=Math.asin(-r(c,-1,1)),Math.abs(c)<.99999?(i[1]=Math.atan2(a,h),i[2]=Math.atan2(s,l)):(i[1]=Math.atan2(-d,n),i[2]=0)):t==="ZXY"?(i[0]=Math.asin(r(u,-1,1)),Math.abs(u)<.99999?(i[1]=Math.atan2(-d,h),i[2]=Math.atan2(-o,l)):(i[1]=0,i[2]=Math.atan2(s,n))):t==="ZYX"?(i[1]=Math.asin(-r(d,-1,1)),Math.abs(d)<.99999?(i[0]=Math.atan2(u,h),i[2]=Math.atan2(s,n)):(i[0]=0,i[2]=Math.atan2(-o,l))):t==="YZX"?(i[2]=Math.asin(r(s,-1,1)),Math.abs(s)<.99999?(i[0]=Math.atan2(-c,l),i[1]=Math.atan2(-d,n)):(i[0]=0,i[1]=Math.atan2(a,h))):t==="XZY"&&(i[2]=Math.asin(-r(o,-1,1)),Math.abs(o)<.99999?(i[0]=Math.atan2(u,l),i[1]=Math.atan2(a,n)):(i[0]=Math.atan2(-c,h),i[1]=0)),i[0]*=k.RADTODEG,i[1]*=k.RADTODEG,i[2]*=k.RADTODEG,i},composeMat4(e,t,i,r=k.mat4()){return k.quaternionToRotationMat4(t,r),k.scaleMat4v(i,r),k.translateMat4v(e,r),r},decomposeMat4:(()=>{let e=new Ai(3),t=new Ai(16);return function(i,r,n,o){e[0]=i[0],e[1]=i[1],e[2]=i[2];let a=k.lenVec3(e);e[0]=i[4],e[1]=i[5],e[2]=i[6];let s=k.lenVec3(e);e[8]=i[8],e[9]=i[9],e[10]=i[10];let l=k.lenVec3(e);k.determinantMat4(i)<0&&(a=-a),r[0]=i[12],r[1]=i[13],r[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,k.mat4ToQuaternion(t,n),o[0]=a,o[1]=s,o[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,r){r||=k.mat4();let n=e[0],o=e[1],a=e[2],s=i[0],l=i[1],c=i[2],d=t[0],u=t[1],h=t[2];if(n===d&&o===u&&a===h)return k.identityMat4();let p,A,f,m,g,w,v,b,y,C;return p=n-d,A=o-u,f=a-h,C=1/Math.sqrt(p*p+A*A+f*f),p*=C,A*=C,f*=C,m=l*f-c*A,g=c*p-s*f,w=s*A-l*p,C=Math.sqrt(m*m+g*g+w*w),C?(C=1/C,m*=C,g*=C,w*=C):(m=0,g=0,w=0),v=A*w-f*g,b=f*m-p*w,y=p*g-A*m,C=Math.sqrt(v*v+b*b+y*y),C?(C=1/C,v*=C,b*=C,y*=C):(v=0,b=0,y=0),r[0]=m,r[1]=v,r[2]=p,r[3]=0,r[4]=g,r[5]=b,r[6]=A,r[7]=0,r[8]=w,r[9]=y,r[10]=f,r[11]=0,r[12]=-(m*n+g*o+w*a),r[13]=-(v*n+b*o+y*a),r[14]=-(p*n+A*o+f*a),r[15]=1,r},lookAtMat4c(e,t,i,r,n,o,a,s,l){return k.lookAtMat4v([e,t,i],[r,n,o],[a,s,l],[])},orthoMat4c(e,t,i,r,n,o,a){a||=k.mat4();let s=t-e,l=r-i,c=o-n;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]=-(r+i)/l,a[14]=-(o+n)/c,a[15]=1,a},frustumMat4v(e,t,i){i||=k.mat4();let r=[e[0],e[1],e[2],0],n=[t[0],t[1],t[2],0];k.addVec4(n,r,rB),k.subVec4(n,r,nB);let o=2*r[2],a=nB[0],s=nB[1],l=nB[2];return i[0]=o/a,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o/s,i[6]=0,i[7]=0,i[8]=rB[0]/a,i[9]=rB[1]/s,i[10]=-rB[2]/l,i[11]=-1,i[12]=0,i[13]=0,i[14]=-o*n[2]/l,i[15]=0,i},frustumMat4(e,t,i,r,n,o,a){a||=k.mat4();let s=t-e,l=r-i,c=o-n;return a[0]=n*2/s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=n*2/l,a[6]=0,a[7]=0,a[8]=(t+e)/s,a[9]=(r+i)/l,a[10]=-(o+n)/c,a[11]=-1,a[12]=0,a[13]=0,a[14]=-(o*n*2)/c,a[15]=0,a},perspectiveMat4(e,t,i,r,n){let o=[],a=[];return o[2]=i,a[2]=r,a[1]=o[2]*Math.tan(e/2),o[1]=-a[1],a[0]=a[1]*t,o[0]=-a[0],k.frustumMat4v(o,a,n)},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=k.vec3()){let r=t[0],n=t[1],o=t[2];return i[0]=e[0]*r+e[4]*n+e[8]*o+e[12],i[1]=e[1]*r+e[5]*n+e[9]*o+e[13],i[2]=e[2]*r+e[6]*n+e[10]*o+e[14],i},transformPoint4(e,t,i=k.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 r=i||[],n=t.length,o,a,s,l,c=e[0],d=e[1],u=e[2],h=e[3],p=e[4],A=e[5],f=e[6],m=e[7],g=e[8],w=e[9],v=e[10],b=e[11],y=e[12],C=e[13],B=e[14],I=e[15],E;for(let P=0;P<n;++P)l=t[P],o=l[0],a=l[1],s=l[2],E=r[P]||(r[P]=[0,0,0]),E[0]=c*o+p*a+g*s+y,E[1]=d*o+A*a+w*s+C,E[2]=u*o+f*a+v*s+B,E[3]=h*o+m*a+b*s+I;return r.length=n,r},transformPositions3(e,t,i=t){let r,n=t.length,o,a,s,l=e[0],c=e[1],d=e[2];e[3];let u=e[4],h=e[5],p=e[6];e[7];let A=e[8],f=e[9],m=e[10];e[11];let g=e[12],w=e[13],v=e[14];for(e[15],r=0;r<n;r+=3)o=t[r+0],a=t[r+1],s=t[r+2],i[r+0]=l*o+u*a+A*s+g,i[r+1]=c*o+h*a+f*s+w,i[r+2]=d*o+p*a+m*s+v;return i},transformPositions4(e,t,i=t){let r,n=t.length,o,a,s,l=e[0],c=e[1],d=e[2],u=e[3],h=e[4],p=e[5],A=e[6],f=e[7],m=e[8],g=e[9],w=e[10],v=e[11],b=e[12],y=e[13],C=e[14],B=e[15];for(r=0;r<n;r+=4)o=t[r+0],a=t[r+1],s=t[r+2],i[r+0]=l*o+h*a+m*s+b,i[r+1]=c*o+p*a+g*s+y,i[r+2]=d*o+A*a+w*s+C,i[r+3]=u*o+f*a+v*s+B;return i},transformVec3(e,t,i){let r=t[0],n=t[1],o=t[2];return i||=this.vec3(),i[0]=e[0]*r+e[4]*n+e[8]*o,i[1]=e[1]*r+e[5]*n+e[9]*o,i[2]=e[2]*r+e[6]*n+e[10]*o,i},transformVec4(e,t,i){let r=t[0],n=t[1],o=t[2],a=t[3];return i||=k.vec4(),i[0]=e[0]*r+e[4]*n+e[8]*o+e[12]*a,i[1]=e[1]*r+e[5]*n+e[9]*o+e[13]*a,i[2]=e[2]*r+e[6]*n+e[10]*o+e[14]*a,i[3]=e[3]*r+e[7]*n+e[11]*o+e[15]*a,i},rotateVec2(e,t,i,r=e){let n=Math.cos(i),o=Math.sin(i),a=e[0]-t[0],s=e[1]-t[1];return r[0]=a*n-s*o+t[0],r[1]=a*o+s*n+t[1],e},rotateVec3X(e,t,i,r){let n=[],o=[];return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],o[0]=n[0],o[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),o[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),r[0]=o[0]+t[0],r[1]=o[1]+t[1],r[2]=o[2]+t[2],r},rotateVec3Y(e,t,i,r){let n=[],o=[];return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],o[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),o[1]=n[1],o[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),r[0]=o[0]+t[0],r[1]=o[1]+t[1],r[2]=o[2]+t[2],r},rotateVec3Z(e,t,i,r){let n=[],o=[];return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],o[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),o[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),o[2]=n[2],r[0]=o[0]+t[0],r[1]=o[1]+t[1],r[2]=o[2]+t[2],r},projectVec4(e,t){let i=1/e[3];return t||=k.vec2(),t[0]=e[0]*i,t[1]=e[1]*i,t},unprojectVec3:(()=>{let e=new Ai(16),t=new Ai(16),i=new Ai(16);return function(r,n,o,a){return this.transformVec3(this.mulMat4(this.inverseMat4(n,e),this.inverseMat4(o,t),i),r,a)}})(),lerpVec3(e,t,i,r,n,o){let a=o||k.vec3(),s=(e-t)/(i-t);return a[0]=r[0]+s*(n[0]-r[0]),a[1]=r[1]+s*(n[1]-r[1]),a[2]=r[2]+s*(n[2]-r[2]),a},lerpMat4(e,t,i,r,n,o){let a=o||k.mat4(),s=(e-t)/(i-t);return a[0]=r[0]+s*(n[0]-r[0]),a[1]=r[1]+s*(n[1]-r[1]),a[2]=r[2]+s*(n[2]-r[2]),a[3]=r[3]+s*(n[3]-r[3]),a[4]=r[4]+s*(n[4]-r[4]),a[5]=r[5]+s*(n[5]-r[5]),a[6]=r[6]+s*(n[6]-r[6]),a[7]=r[7]+s*(n[7]-r[7]),a[8]=r[8]+s*(n[8]-r[8]),a[9]=r[9]+s*(n[9]-r[9]),a[10]=r[10]+s*(n[10]-r[10]),a[11]=r[11]+s*(n[11]-r[11]),a[12]=r[12]+s*(n[12]-r[12]),a[13]=r[13]+s*(n[13]-r[13]),a[14]=r[14]+s*(n[14]-r[14]),a[15]=r[15]+s*(n[15]-r[15]),a},flatten(e){let t=[],i,r,n,o,a;for(i=0,r=e.length;i<r;i++)for(a=e[i],n=0,o=a.length;n<o;n++)t.push(a[n]);return t},identityQuaternion(e=k.vec4()){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},eulerToQuaternion(e,t,i=k.vec4()){let r=e[0]*k.DEGTORAD/2,n=e[1]*k.DEGTORAD/2,o=e[2]*k.DEGTORAD/2,a=Math.cos(r),s=Math.cos(n),l=Math.cos(o),c=Math.sin(r),d=Math.sin(n),u=Math.sin(o);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=k.vec4()){let i=e[0],r=e[4],n=e[8],o=e[1],a=e[5],s=e[9],l=e[2],c=e[6],d=e[10],u,h=i+a+d;return h>0?(u=.5/Math.sqrt(h+1),t[3]=.25/u,t[0]=(c-s)*u,t[1]=(n-l)*u,t[2]=(o-r)*u):i>a&&i>d?(u=2*Math.sqrt(1+i-a-d),t[3]=(c-s)/u,t[0]=.25*u,t[1]=(r+o)/u,t[2]=(n+l)/u):a>d?(u=2*Math.sqrt(1+a-i-d),t[3]=(n-l)/u,t[0]=(r+o)/u,t[1]=.25*u,t[2]=(s+c)/u):(u=2*Math.sqrt(1+d-i-a),t[3]=(o-r)/u,t[0]=(n+l)/u,t[1]=(s+c)/u,t[2]=.25*u),t},vec3PairToQuaternion(e,t,i=k.vec4()){let r=Math.sqrt(k.dotVec3(e,e)*k.dotVec3(t,t)),n=r+k.dotVec3(e,t);return n<1e-8*r?(n=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])):k.cross3Vec3(e,t,i),i[3]=n,k.normalizeQuaternion(i)},angleAxisToQuaternion(e,t=k.vec4()){let i=e[3]/2,r=Math.sin(i);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(i),t},quaternionToEuler:(()=>{let e=new Ai(16);return(t,i,r)=>(r||=k.vec3(),k.quaternionToRotationMat4(t,e),k.mat4ToEuler(e,i,r),r)})(),mulQuaternions(e,t,i=k.vec4()){let r=e[0],n=e[1],o=e[2],a=e[3],s=t[0],l=t[1],c=t[2],d=t[3];return i[0]=a*s+r*d+n*c-o*l,i[1]=a*l+n*d+o*s-r*c,i[2]=a*c+o*d+r*l-n*s,i[3]=a*d-r*s-n*l-o*c,i},vec3ApplyQuaternion(e,t,i=k.vec3()){let r=t[0],n=t[1],o=t[2],a=e[0],s=e[1],l=e[2],c=e[3],d=c*r+s*o-l*n,u=c*n+l*r-a*o,h=c*o+a*n-s*r,p=-a*r-s*n-l*o;return i[0]=d*c+p*-a+u*-l-h*-s,i[1]=u*c+p*-s+h*-a-d*-l,i[2]=h*c+p*-l+d*-s-u*-a,i},quaternionToMat4(e,t){t=k.identityMat4(t);let i=e[0],r=e[1],n=e[2],o=e[3],a=2*i,s=2*r,l=2*n,c=a*o,d=s*o,u=l*o,h=a*i,p=s*i,A=l*i,f=s*r,m=l*r,g=l*n;return t[0]=1-(f+g),t[1]=p+u,t[2]=A-d,t[4]=p-u,t[5]=1-(h+g),t[6]=m+c,t[8]=A+d,t[9]=m-c,t[10]=1-(h+f),t},quaternionToRotationMat4(e,t){let i=e[0],r=e[1],n=e[2],o=e[3],a=i+i,s=r+r,l=n+n,c=i*a,d=i*s,u=i*l,h=r*s,p=r*l,A=n*l,f=o*a,m=o*s,g=o*l;return t[0]=1-(h+A),t[4]=d-g,t[8]=u+m,t[1]=d+g,t[5]=1-(c+A),t[9]=p-f,t[2]=u-m,t[6]=p+f,t[10]=1-(c+h),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=k.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 k.normalizeQuaternion(k.conjugateQuaternion(e,t))},quaternionToAngleAxis(e,t=k.vec4()){e=k.normalizeQuaternion(e,Fxt);let i=e[3],r=2*Math.acos(i),n=Math.sqrt(1-i*i);return n<.001?(t[0]=e[0],t[1]=e[1],t[2]=e[2]):(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n),t[3]=r,t},AABB3(e){return new Ai(e||6)},AABB2(e){return new Ai(e||4)},OBB3(e){return new Ai(e||32)},OBB2(e){return new Ai(e||16)},Sphere3(e,t,i,r){return new Ai([e,t,i,r])},transformOBB3(e,t,i=t){let r,n=t.length,o,a,s,l=e[0],c=e[1],d=e[2],u=e[3],h=e[4],p=e[5],A=e[6],f=e[7],m=e[8],g=e[9],w=e[10],v=e[11],b=e[12],y=e[13],C=e[14],B=e[15];for(r=0;r<n;r+=4)o=t[r+0],a=t[r+1],s=t[r+2],i[r+0]=l*o+h*a+m*s+b,i[r+1]=c*o+p*a+g*s+y,i[r+2]=d*o+A*a+w*s+C,i[r+3]=u*o+f*a+v*s+B;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 Ai(3),t=new Ai(3),i=new Ai(3);return r=>(e[0]=r[0],e[1]=r[1],e[2]=r[2],t[0]=r[3],t[1]=r[4],t[2]=r[5],k.subVec3(t,e,i),Math.abs(k.lenVec3(i)))})(),getAABB3DiagPoint:(()=>{let e=new Ai(3),t=new Ai(3),i=new Ai(3);return(r,n)=>{e[0]=r[0],e[1]=r[1],e[2]=r[2],t[0]=r[3],t[1]=r[4],t[2]=r[5];let o=k.subVec3(t,e,i),a=n[0]-r[0],s=r[3]-n[0],l=n[1]-r[1],c=r[4]-n[1],d=n[2]-r[2],u=r[5]-n[2];return o[0]+=a>s?a:s,o[1]+=l>c?l:c,o[2]+=d>u?d:u,Math.abs(k.lenVec3(o))}})(),getAABB3Area(e){let t=e[3]-e[0],i=e[4]-e[1],r=e[5]-e[2];return t*i*r},getAABB3Center(e,t){let i=t||k.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||k.vec2();return i[0]=(e[2]+e[0])/2,i[1]=(e[3]+e[1])/2,i},collapseAABB3(e=k.AABB3()){return e[0]=k.MAX_DOUBLE,e[1]=k.MAX_DOUBLE,e[2]=k.MAX_DOUBLE,e[3]=k.MIN_DOUBLE,e[4]=k.MIN_DOUBLE,e[5]=k.MIN_DOUBLE,e},AABB3ToOBB3(e,t=k.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 Ai(3);return(t,i,r)=>{i||=k.AABB3();let n=k.MAX_DOUBLE,o=k.MAX_DOUBLE,a=k.MAX_DOUBLE,s=k.MIN_DOUBLE,l=k.MIN_DOUBLE,c=k.MIN_DOUBLE,d,u,h;for(let p=0,A=t.length;p<A;p+=3)r?(e[0]=t[p+0],e[1]=t[p+1],e[2]=t[p+2],k.decompressPosition(e,r,e),d=e[0],u=e[1],h=e[2]):(d=t[p+0],u=t[p+1],h=t[p+2]),d<n&&(n=d),u<o&&(o=u),h<a&&(a=h),d>s&&(s=d),u>l&&(l=u),h>c&&(c=h);return i[0]=n,i[1]=o,i[2]=a,i[3]=s,i[4]=l,i[5]=c,i}})(),OBB3ToAABB3(e,t=k.AABB3()){let i=k.MAX_DOUBLE,r=k.MAX_DOUBLE,n=k.MAX_DOUBLE,o=k.MIN_DOUBLE,a=k.MIN_DOUBLE,s=k.MIN_DOUBLE,l,c,d;for(let u=0,h=e.length;u<h;u+=4)l=e[u+0],c=e[u+1],d=e[u+2],l<i&&(i=l),c<r&&(r=c),d<n&&(n=d),l>o&&(o=l),c>a&&(a=c),d>s&&(s=d);return t[0]=i,t[1]=r,t[2]=n,t[3]=o,t[4]=a,t[5]=s,t},points3ToAABB3(e,t=k.AABB3()){let i=k.MAX_DOUBLE,r=k.MAX_DOUBLE,n=k.MAX_DOUBLE,o=k.MIN_DOUBLE,a=k.MIN_DOUBLE,s=k.MIN_DOUBLE,l,c,d;for(let u=0,h=e.length;u<h;u++)l=e[u][0],c=e[u][1],d=e[u][2],l<i&&(i=l),c<r&&(r=c),d<n&&(n=d),l>o&&(o=l),c>a&&(a=c),d>s&&(s=d);return t[0]=i,t[1]=r,t[2]=n,t[3]=o,t[4]=a,t[5]=s,t},points3ToSphere3:(()=>{let e=new Ai(3);return(t,i)=>{i||=k.vec4();let r=0,n=0,o=0,a,s=t.length;for(a=0;a<s;a++)r+=t[a][0],n+=t[a][1],o+=t[a][2];i[0]=r/s,i[1]=n/s,i[2]=o/s;let l=0,c;for(a=0;a<s;a++)c=Math.abs(k.lenVec3(k.subVec3(t[a],i,e))),c>l&&(l=c);return i[3]=l,i}})(),positions3ToSphere3:(()=>{let e=new Ai(3),t=new Ai(3);return(i,r)=>{r||=k.vec4();let n=0,o=0,a=0,s,l=i.length,c=0;for(s=0;s<l;s+=3)n+=i[s],o+=i[s+1],a+=i[s+2];let d=l/3;r[0]=n/d,r[1]=o/d,r[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(k.lenVec3(k.subVec3(e,r,t))),u>c&&(c=u);return r[3]=c,r}})(),OBB3ToSphere3:(()=>{let e=new Ai(3),t=new Ai(3);return(i,r)=>{r||=k.vec4();let n=0,o=0,a=0,s,l=i.length,c=l/4;for(s=0;s<l;s+=4)n+=i[s+0],o+=i[s+1],a+=i[s+2];r[0]=n/c,r[1]=o/c,r[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(k.lenVec3(k.subVec3(e,r,t))),u>d&&(d=u);return r[3]=d,r}})(),getSphere3Center(e,t=k.vec3()){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},getPositionsCenter(e,t=k.vec3()){let i=0,r=0,n=0;for(var o=0,a=e.length;o<a;o+=3)i+=e[o+0],r+=e[o+1],n+=e[o+2];let s=e.length/3;return t[0]=i/s,t[1]=r/s,t[2]=n/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,r,n,o=0,a=t.length;o<a;o+=3)i=t[o],r=t[o+1],n=t[o+2],e[0]>i&&(e[0]=i),e[1]>r&&(e[1]=r),e[2]>n&&(e[2]=n),e[3]<i&&(e[3]=i),e[4]<r&&(e[4]=r),e[5]<n&&(e[5]=n);return e},collapseAABB2(e=k.AABB2()){return e[0]=k.MAX_DOUBLE,e[1]=k.MAX_DOUBLE,e[2]=k.MIN_DOUBLE,e[3]=k.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 r,n;return e[0]>0?(r=e[0]*i[0],n=e[0]*i[3]):(r=e[0]*i[3],n=e[0]*i[0]),e[1]>0?(r+=e[1]*i[1],n+=e[1]*i[4]):(r+=e[1]*i[4],n+=e[1]*i[1]),e[2]>0?(r+=e[2]*i[2],n+=e[2]*i[5]):(r+=e[2]*i[5],n+=e[2]*i[2]),r<=-t&&n<=-t?-1:r>=-t&&n>=-t?1:0},OBB3ToAABB2(e,t=k.AABB2()){let i=k.MAX_DOUBLE,r=k.MAX_DOUBLE,n=k.MIN_DOUBLE,o=k.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<r&&(r=s),a>n&&(n=a),s>o&&(o=s);return t[0]=i,t[1]=r,t[2]=n,t[3]=o,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,r=e){let n=(e[0]+1)*.5,o=(e[1]+1)*.5,a=(e[2]+1)*.5,s=(e[3]+1)*.5;return r[0]=Math.floor(n*t),r[1]=i-Math.floor(s*i),r[2]=Math.floor(a*t),r[3]=i-Math.floor(o*i),r},tangentQuadraticBezier(e,t,i,r){return 2*(1-e)*(i-t)+2*e*(r-i)},tangentQuadraticBezier3(e,t,i,r,n){return-3*t*(1-e)*(1-e)+3*i*(1-e)*(1-e)-6*e*i*(1-e)+6*e*r*(1-e)-3*e*e*r+3*e*e*n},tangentSpline(e){let t=6*e*e-6*e,i=3*e*e-4*e+1,r=-6*e*e+6*e,n=3*e*e-2*e;return t+i+r+n},catmullRomInterpolate(e,t,i,r,n){let o=(i-e)*.5,a=(r-t)*.5,s=n*n,l=n*s;return(2*t-2*i+o+a)*l+(-3*t+3*i-2*o-a)*s+o*n+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,r){return this.b2p0(e,t)+this.b2p1(e,i)+this.b2p2(e,r)},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,r,n){return this.b3p0(e,t)+this.b3p1(e,i)+this.b3p2(e,r)+this.b3p3(e,n)},triangleNormal(e,t,i,r=k.vec3()){let n=t[0]-e[0],o=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=o*c-a*l,u=a*s-n*c,h=n*l-o*s,p=Math.sqrt(d*d+u*u+h*h);return p===0?(r[0]=0,r[1]=0,r[2]=0):(r[0]=d/p,r[1]=u/p,r[2]=h/p),r},rayTriangleIntersect:(()=>{let e=new Ai(3),t=new Ai(3),i=new Ai(3),r=new Ai(3),n=new Ai(3);return(o,a,s,l,c,d)=>{d||=k.vec3();let u=k.subVec3(l,s,e),h=k.subVec3(c,s,t),p=k.cross3Vec3(a,h,i),A=k.dotVec3(u,p);if(A<1e-6)return null;let f=k.subVec3(o,s,r),m=k.dotVec3(f,p);if(m<0||m>A)return null;let g=k.cross3Vec3(f,u,n),w=k.dotVec3(a,g);if(w<0||m+w>A)return null;let v=k.dotVec3(h,g)/A;return d[0]=o[0]+v*a[0],d[1]=o[1]+v*a[1],d[2]=o[2]+v*a[2],d}})(),rayPlaneIntersect:(()=>{let e=new Ai(3),t=new Ai(3),i=new Ai(3),r=new Ai(3);return(n,o,a,s,l,c)=>{c||=k.vec3(),o=k.normalizeVec3(o,e);let d=k.subVec3(s,a,t),u=k.subVec3(l,a,i),h=k.cross3Vec3(d,u,r);k.normalizeVec3(h,h);let p=-k.dotVec3(a,h),A=-(k.dotVec3(n,h)+p)/k.dotVec3(o,h);return c[0]=n[0]+A*o[0],c[1]=n[1]+A*o[1],c[2]=n[2]+A*o[2],c}})(),cartesianToBarycentric:(()=>{let e=new Ai(3),t=new Ai(3),i=new Ai(3);return(r,n,o,a,s)=>{let l=k.subVec3(a,n,e),c=k.subVec3(o,n,t),d=k.subVec3(r,n,i),u=k.dotVec3(l,l),h=k.dotVec3(l,c),p=k.dotVec3(l,d),A=k.dotVec3(c,c),f=k.dotVec3(c,d),m=u*A-h*h;if(m===0)return null;let g=1/m,w=(A*p-h*f)*g,v=(u*f-h*p)*g;return s[0]=1-w-v,s[1]=v,s[2]=w,s}})(),barycentricInsideTriangle(e){let t=e[1],i=e[2];return i>=0&&t>=0&&i+t<1},barycentricToCartesian(e,t,i,r,n=k.vec3()){let o=e[0],a=e[1],s=e[2];return n[0]=t[0]*o+i[0]*a+r[0]*s,n[1]=t[1]*o+i[1]*a+r[1]*s,n[2]=t[2]*o+i[2]*a+r[2]*s,n},mergeVertices(e,t,i,r){let n={},o=[],a=[],s=t?[]:null,l=i?[]:null,c=[],d,u,h,p,A=10**4,f,m,g=0;for(f=0,m=e.length;f<m;f+=3)d=e[f],u=e[f+1],h=e[f+2],p=`${Math.round(d*A)}_${Math.round(u*A)}_${Math.round(h*A)}`,n[p]===void 0&&(n[p]=a.length/3,a.push(d),a.push(u),a.push(h),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]))),o[f/3]=n[p],g+=2;for(f=0,m=r.length;f<m;f++)c[f]=o[r[f]];let w={positions:a,indices:c};return s&&(w.normals=s),l&&(w.uv=l),w},buildNormals:(()=>{let e=new Ai(3),t=new Ai(3),i=new Ai(3),r=new Ai(3),n=new Ai(3),o=new Ai(3);return(a,s,l)=>{let c,d,u=Array(a.length/3),h,p,A;for(c=0,d=s.length;c<d;c+=3){h=s[c],p=s[c+1],A=s[c+2],e[0]=a[h*3],e[1]=a[h*3+1],e[2]=a[h*3+2],t[0]=a[p*3],t[1]=a[p*3+1],t[2]=a[p*3+2],i[0]=a[A*3],i[1]=a[A*3+1],i[2]=a[A*3+2],k.subVec3(t,e,r),k.subVec3(i,e,n);let v=k.vec3();k.normalizeVec3(k.cross3Vec3(r,n,o),v),u[h]||(u[h]=[]),u[p]||(u[p]=[]),u[A]||(u[A]=[]),u[h].push(v),u[p].push(v),u[A].push(v)}l=l&&l.length===a.length?l:new Float32Array(a.length);let f,m,g,w;for(c=0,d=u.length;c<d;c++){f=u[c].length,m=0,g=0,w=0;for(let v=0;v<f;v++)m+=u[c][v][0],g+=u[c][v][1],w+=u[c][v][2];l[c*3]=m/f,l[c*3+1]=g/f,l[c*3+2]=w/f}return l}})(),buildTangents:(()=>{let e=new Ai(3),t=new Ai(3),i=new Ai(3),r=new Ai(3),n=new Ai(3),o=new Ai(3),a=new Ai(3);return(s,l,c)=>{let d=new Float32Array(s.length);for(let u=0;u<l.length;u+=3){let h=l[u],p=s.subarray(h*3,h*3+3),A=c.subarray(h*2,h*2+2);h=l[u+1];let f=s.subarray(h*3,h*3+3),m=c.subarray(h*2,h*2+2);h=l[u+2];let g=s.subarray(h*3,h*3+3),w=c.subarray(h*2,h*2+2),v=k.subVec3(f,p,e),b=k.subVec3(g,p,t),y=k.subVec2(m,A,i),C=k.subVec2(w,A,r),B=1/(y[0]*C[1]-y[1]*C[0]),I=k.mulVec3Scalar(k.subVec3(k.mulVec3Scalar(v,C[1],n),k.mulVec3Scalar(b,y[1],o),a),B,o),E;for(let P=0;P<3;P++)E=l[u+P]*3,d[E]+=I[0],d[E+1]+=I[1],d[E+2]+=I[2]}return d}})(),buildPickTriangles(e,t,i){let r=t.length,n=i?new Uint16Array(r*9):new Float32Array(r*9),o=new Uint8Array(r*12),a=0,s,l=0,c=0,d,u,h,p,A;for(let f=0;f<r;f+=3)A=a>>24&255,p=a>>16&255,h=a>>8&255,u=a&255,d=t[f],s=d*3,n[l++]=e[s],n[l++]=e[s+1],n[l++]=e[s+2],o[c++]=u,o[c++]=h,o[c++]=p,o[c++]=A,d=t[f+1],s=d*3,n[l++]=e[s],n[l++]=e[s+1],n[l++]=e[s+2],o[c++]=u,o[c++]=h,o[c++]=p,o[c++]=A,d=t[f+2],s=d*3,n[l++]=e[s],n[l++]=e[s+1],n[l++]=e[s+2],o[c++]=u,o[c++]=h,o[c++]=p,o[c++]=A,a++;return{positions:n,colors:o}},faceToVertexNormals(e,t,i={}){let r=i.smoothNormalsAngleThreshold||20,n={},o=[],a={},s,l,c,d,u,h=10**4,p,A,f,m,g,w;for(A=0,m=e.length;A<m;A+=3){p=A/3,l=e[A],c=e[A+1],d=e[A+2],u=`${Math.round(l*h)}_${Math.round(c*h)}_${Math.round(d*h)}`,n[u]===void 0?n[u]=[p]:n[u].push(p);let v=k.normalizeVec3([t[A],t[A+1],t[A+2]]);o[p]=v,s=k.vec4([v[0],v[1],v[2],1]),a[p]=s}for(u in n)if(n.hasOwnProperty(u)){let v=n[u],b=v.length;for(A=0;A<b;A++){let y=v[A];for(s=a[y],f=0;f<b;f++){if(A===f)continue;let C=v[f];g=o[y],w=o[C],Math.abs(k.angleVec3(g,w)/k.DEGTORAD)<r&&(s[0]+=w[0],s[1]+=w[1],s[2]+=w[2],s[3]+=1)}}}for(A=0,m=t.length;A<m;A+=3)s=a[A/3],t[A+0]=s[0]/s[3],t[A+1]=s[1]/s[3],t[A+2]=s[2]/s[3]},transformRay:(()=>{let e=new Ai(4),t=new Ai(4);return(i,r,n,o,a)=>{e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=1,k.transformVec4(i,e,t),o[0]=t[0],o[1]=t[1],o[2]=t[2],e[0]=n[0],e[1]=n[1],e[2]=n[2],k.transformVec3(i,e,t),k.normalizeVec3(t),a[0]=t[0],a[1]=t[1],a[2]=t[2]}})(),canvasPosToWorldRay:(()=>{let e=new Ai(16),t=new Ai(4),i=new Ai(4),r=(n,o,a,s,l)=>{l[0]=n,l[1]=o,l[2]=a,l[3]=1,k.transformVec4(e,l,l),s||k.mulVec4Scalar(l,1/l[3])};return(n,o,a,s,l,c,d)=>{let u=s==="ortho";k.mulMat4(a,o,e),k.inverseMat4(e,e);let h=2*l[0]/n.clientWidth-1,p=1-2*l[1]/n.clientHeight;r(h,p,-1,u,t),r(h,p,1,u,i),c[0]=t[0],c[1]=t[1],c[2]=t[2],k.subVec3(i,t,d),k.normalizeVec3(d)}})(),canvasPosToLocalRay:(()=>{let e=new Ai(3),t=new Ai(3);return(i,r,n,o,a,s,l,c)=>{k.canvasPosToWorldRay(i,r,n,o,s,e,t),k.worldRayToLocalRay(a,e,t,l,c)}})(),worldRayToLocalRay:(()=>{let e=new Ai(16),t=new Ai(4),i=new Ai(4);return(r,n,o,a,s)=>{let l=k.inverseMat4(r,e);t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=1,k.transformVec4(l,t,i),a[0]=i[0],a[1]=i[1],a[2]=i[2],k.transformVec3(l,o,s)}})(),buildKDTree:(()=>{let e=new Float32Array;function t(i,r,n,o){let a=new Ai(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 w=r[d+g]*3;n[w]<a[0]&&(a[0]=n[w]),n[w]>a[3]&&(a[3]=n[w]),n[w+1]<a[1]&&(a[1]=n[w+1]),n[w+1]>a[4]&&(a[4]=n[w+1]),n[w+2]<a[2]&&(a[2]=n[w+2]),n[w+2]>a[5]&&(a[5]=n[w+2])}}if(i.length<20||o>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 h=(a[u]+a[u+3])/2,p=Array(i.length),A=0,f=Array(i.length),m=0;for(l=0,c=i.length;l<c;++l){var d=i[l]*3;let w=r[d],v=r[d+1],b=r[d+2],y=w*3,C=v*3,B=b*3;n[y+u]<=h||n[C+u]<=h||n[B+u]<=h?p[A++]=i[l]:f[m++]=i[l]}return p.length=A,f.length=m,s.left=t(p,r,n,o+1),s.right=t(f,r,n,o+1),s}return(i,r)=>{let n=i.length/3,o=Array(n);for(let a=0;a<n;++a)o[a]=a;return t(o,i,r,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 r=0,n=e.length;r<n;r+=3)i[r+0]=e[r+0]*t[0]+t[12],i[r+1]=e[r+1]*t[5]+t[13],i[r+2]=e[r+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 r=0,n=e.length;r<n;r+=3)i[r+0]=e[r+0]*t[0]+t[6],i[r+1]=e[r+1]*t[4]+t[7];return i},octDecodeVec2(e,t){let i=e[0],r=e[1];i=(2*i+1)/255,r=(2*r+1)/255;let n=1-Math.abs(i)-Math.abs(r);n<0&&(i=(1-Math.abs(r))*(i>=0?1:-1),r=(1-Math.abs(i))*(r>=0?1:-1));let o=Math.sqrt(i*i+r*r+n*n);return t[0]=i/o,t[1]=r/o,t[2]=n/o,t},octDecodeVec2s(e,t){for(let i=0,r=0,n=e.length;i<n;i+=2){let o=e[i+0],a=e[i+1];o=(2*o+1)/255,a=(2*a+1)/255;let s=1-Math.abs(o)-Math.abs(a);s<0&&(o=(1-Math.abs(a))*(o>=0?1:-1),a=(1-Math.abs(o))*(a>=0?1:-1));let l=Math.sqrt(o*o+a*a+s*s);t[r+0]=o/l,t[r+1]=a/l,t[r+2]=s/l,r+=3}return t}};k.buildEdgeIndices=(function(){let e=[],t=[],i=[],r=[],n=[],o=0,a=new Uint16Array(3),s=new Uint16Array(3),l=new Uint16Array(3),c=k.vec3(),d=k.vec3(),u=k.vec3(),h=k.vec3(),p=k.vec3(),A=k.vec3(),f=k.vec3();function m(w,v){let b={},y,C,B,I,E=1e4,P,S,D=0;for(P=0,S=w.length;P<S;P+=3)y=w[P],C=w[P+1],B=w[P+2],I=Math.round(y*E)+"_"+Math.round(C*E)+"_"+Math.round(B*E),b[I]===void 0&&(b[I]=D/3,e[D++]=y,e[D++]=C,e[D++]=B),t[P/3]=b[I];for(P=0,S=v.length;P<S;P++)r[P]=t[v[P]],i[r[P]]=v[P]}function g(w,v){o=0;for(let b=0,y=w;b<y;b+=3){let C=r[b]*3,B=r[b+1]*3,I=r[b+2]*3;v?(a[0]=e[C],a[1]=e[C+1],a[2]=e[C+2],s[0]=e[B],s[1]=e[B+1],s[2]=e[B+2],l[0]=e[I],l[1]=e[I+1],l[2]=e[I+2],k.decompressPosition(a,v,c),k.decompressPosition(s,v,d),k.decompressPosition(l,v,u)):(c[0]=e[C],c[1]=e[C+1],c[2]=e[C+2],d[0]=e[B],d[1]=e[B+1],d[2]=e[B+2],u[0]=e[I],u[1]=e[I+1],u[2]=e[I+2]),k.subVec3(u,d,h),k.subVec3(c,d,p),k.cross3Vec3(h,p,A),k.normalizeVec3(A,f);let E=n[o]||(n[o]={normal:k.vec3()});E.normal[0]=f[0],E.normal[1]=f[1],E.normal[2]=f[2],o++}}return function(w,v,b,y){m(w,v),g(v.length,b);let C=[],B=Math.cos(k.DEGTORAD*y),I={},E,P,S,D,j,V=!1,Q,z,J,Y,ne,ke;for(let Oe=0,_e=v.length;Oe<_e;Oe+=3){let be=Oe/3;for(let de=0;de<3;de++)E=r[Oe+de],P=r[Oe+(de+1)%3],S=Math.min(E,P),D=Math.max(E,P),j=S+","+D,I[j]===void 0?I[j]={index1:S,index2:D,face1:be,face2:void 0}:I[j].face2=be}for(j in I)Q=I[j],!(Q.face2!==void 0&&(z=n[Q.face1].normal,J=n[Q.face2].normal,Y=k.dotVec3(z,J),Y>B))&&(ne=i[Q.index1],ke=i[Q.index2],(!V&&ne>65535||ke>65535)&&(V=!0),C.push(ne),C.push(ke));return V?new Uint32Array(C):new Uint16Array(C)}})(),k.planeClipsPositions3=function(e,t,i,r=3){for(let n=0,o=i.length;n<o;n+=r)if(Lv[0]=i[n+0]-e[0],Lv[1]=i[n+1]-e[1],Lv[2]=i[n+2]-e[2],Lv[0]*t[0]+Lv[1]*t[1]+Lv[2]*t[2]<0)return!0;return!1};var jxt=15,Ag=new Float32Array(3),Uxt=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||jxt,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 r=t.aabb;if(i>=this._maxTreeDepth){e.entities=e.entities||[],e.entities.push(t);return}if(e.left&&k.containsAABB3(e.left.aabb,r)){this._insertEntity(e.left,t,i+1);return}if(e.right&&k.containsAABB3(e.right.aabb,r)){this._insertEntity(e.right,t,i+1);return}let n=e.aabb;Ag[0]=n[3]-n[0],Ag[1]=n[4]-n[1],Ag[2]=n[5]-n[2];let o=0;if(Ag[1]>Ag[o]&&(o=1),Ag[2]>Ag[o]&&(o=2),!e.left){let a=n.slice();if(a[o+3]=(n[o]+n[o+3])/2,e.left={aabb:a},k.containsAABB3(a,r)){this._insertEntity(e.left,t,i+1);return}}if(!e.right){let a=n.slice();if(a[o]=(n[o]+n[o+3])/2,e.right={aabb:a},k.containsAABB3(a,r)){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}},Ufe=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}},hn={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 Ofe(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 r={type:e.nodeName,children:[]};if(e.nodeType===e.ELEMENT_NODE)for(var n=0;n<e.attributes.length;n++){var o=e.attributes[n],a=t[o.nodeName]||o.nodeName;r[a]=o.nodeValue}for(var s=0;s<e.childNodes.length;s++){var l=e.childNodes[s],n=Ofe(l,t);n&&r.children.push(n)}return r}}function Oxt(e){return JSON.parse(JSON.stringify(e))}var Hxt=[["0",10],["A",26],["a",26],["_",1],["$",1]].map(function(e){for(var t=[],i=e[0].charCodeAt(0),r=i+e[1],n=i;n<r;++n)t.push(n);return String.fromCharCode.apply(null,t)}).join("");function Hfe(e,t){return(!t||t===4?[0,6,12,18]:[0,6]).map(function(i){return Hxt.substr(parseInt(e/(1<<i))%64,1)}).reverse().join("")}function qxt(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 Hfe(t[0],2)+[1,4,7,10,13].map(function(i){return Hfe((t[i]<<16)+(t[i+1]<<8)+t[i+2])}).join("")}function Nxt(e,t){var i=[],r=function(n){n.type===t&&i.push(n),(n.children||[]).forEach(function(o){r(o)})};return r(e),i}function zxt(e){return new Promise(function(t,i){setTimeout(t,e)})}function Vxt(e){return new Promise(function(t,i){var r=new XMLHttpRequest;r.open(e.method||"GET",e.url,!0),r.onload=function(n){r.readyState===4&&(r.status===200?t(r.responseXML):i(r.statusText))},r.send(null)})}var Qxt=(function(){for(var e={},t=window.location.search.substring(1).split("&"),i=0;i<t.length;i++){var r=t[i].split("=");if(e[r[0]]===void 0)e[r[0]]=decodeURIComponent(r[1]);else if(typeof e[r[0]]=="string"){var n=[e[r[0]],decodeURIComponent(r[1])];e[r[0]]=n}else e[r[0]].push(decodeURIComponent(r[1]))}return e})();function Gxt(e,t,i){var r=o=>{};t||=r,i||=r;var n=new XMLHttpRequest;n.overrideMimeType("application/json"),n.open("GET",e,!0),n.addEventListener("load",function(o){var a=o.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(o)},!1),n.addEventListener("error",function(o){i(o)},!1),n.send(null)}function Kxt(e,t,i){var r=s=>{};t||=r,i||=r;let n=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(n){let s=!!n[2];var o=n[3];o=window.decodeURIComponent(o),s&&(o=window.atob(o));try{let l=new ArrayBuffer(o.length),c=new Uint8Array(l);for(var a=0;a<o.length;a++)c[a]=o.charCodeAt(a);io.scheduleTask(()=>{t(l)})}catch(l){io.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 Wxt(e){return e&&!e.propertyIsEnumerable("length")&&typeof e=="object"&&typeof e.length=="number"}function Jxt(e){return typeof e=="string"||e instanceof String}function Yxt(e){return!isNaN(parseFloat(e))&&isFinite(e)}function Zxt(e){return $t.isString(e)||$t.isNumeric(e)}function Xxt(e,t){return!e||!t?!1:($t.isNumeric(e)||$t.isString(e)?`${e}`:e.id)===($t.isNumeric(t)||$t.isString(t)?`${t}`:t.id)}function $xt(e){return typeof e=="function"}function ekt(e){let t={}.constructor;return!!e&&e.constructor===t}function tkt(e){return $t.apply(e,{})}function ikt(e,t){for(let i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function rkt(e,t){for(let i in e)e.hasOwnProperty(i)&&e[i]!==void 0&&e[i]!==null&&(t[i]=e[i]);return t}function nkt(e,t){for(let i in e)e.hasOwnProperty(i)&&(t[i]===void 0||t[i]===null)&&(t[i]=e[i]);return t}function okt(e){for(let t in e)if(e.hasOwnProperty(t))return!1;return!0}function akt(e){return $t.isNumeric(e)?`${e}`:`'${e}'`}function skt(e,t){let i=new e.constructor(e.length+t.length);return i.set(e),i.set(t,e.length),i}function lkt(e){var t=[];function i(r){r.id=r.uuid,delete r.oid,t.push(r);var n=r.children;if(n)for(var o=0,a=n.length;o<a;o++){let s=n[o];s.parent=r.id,i(n[o])}r.children=[]}return i(e),t}var $t={xmlToJson:Ofe,clone:Oxt,compressGuid:qxt,findNodeOfType:Nxt,timeout:zxt,httpRequest:Vxt,loadJSON:Gxt,loadArraybuffer:Kxt,queryString:Qxt,isArray:Wxt,isString:Jxt,isNumeric:Yxt,isID:Zxt,isSameComponent:Xxt,isFunction:$xt,isObject:ekt,copy:tkt,apply:ikt,apply2:rkt,applyIf:nkt,isEmptyObject:okt,inQuotes:akt,concat:skt,flattenParentChildHierarchy:lkt},oB={},qfe=new Od,_v=new Ufe,iA={sceneId:null,time:null,startTime:null,prevTime:null,deltaTime:null},Nfe=10,Z1=[],zfe=30,lb=0,Fv,jv=0;function ckt(){this.version="1.0.0",this.scenes={},this._superTypes={},this._addScene=function(e){if(e.id){if(io.scenes[e.id]){console.error(`[ERROR] Scene ${$t.inQuotes(e.id)} already exists`);return}}else e.id=qfe.addItem({});io.scenes[e.id]=e;let t=e.ticksPerOcclusionTest,i=e.ticksPerRender;oB[e.id]={ticksPerOcclusionTest:t,ticksPerRender:i,renderCountdown:i},hn.components.scenes++,e.once("destroyed",()=>{qfe.removeItem(e.id),delete io.scenes[e.id],delete oB[e.id],hn.components.scenes--})},this.clear=function(){let e;for(let t in io.scenes)io.scenes.hasOwnProperty(t)&&(e=io.scenes[t],t==="default.scene"?e.clear():(e.destroy(),delete io.scenes[e.id]))},this.scheduleTask=function(e,t=null){_v.push(e),_v.push(t)},this.runTasks=function(e=-1){let t=new Date().getTime(),i,r,n=0;for(;_v.length>0&&(e<0||t<e);)i=_v.shift(),r=_v.shift(),r?i.call(r):i(),t=new Date().getTime(),n++;return n},this.getNumTasks=function(){return _v.length}}var io=new ckt,Vfe=function(){let e=Date.now();if(Fv=e-lb,lb>0&&Fv>0){var t=1e3/Fv;jv+=t,Z1.push(t),Z1.length>=zfe&&(jv-=Z1.shift()),hn.frame.fps=Math.round(jv/Z1.length)}for(let i in io.scenes)io.scenes[i].compile();Gfe(e),lb=e};function dkt(e,t){let i=Date.now()+t;function r(){let n=Date.now()-i;e(),i+=t,setTimeout(r,Math.max(0,t-n))}return r(),{cancel:function(){}}}dkt(()=>{Vfe()},100);var Qfe=function(){let e=Date.now();if(Fv=e-lb,lb>0&&Fv>0){var t=1e3/Fv;jv+=t,Z1.push(t),Z1.length>=zfe&&(jv-=Z1.shift()),hn.frame.fps=Math.round(jv/Z1.length)}Gfe(e),ukt(e),hkt(),window.requestPostAnimationFrame===void 0?requestAnimationFrame(Qfe):window.requestPostAnimationFrame(Vfe)};Qfe();function Gfe(e){let t=io.runTasks(e+Nfe),i=io.getNumTasks();hn.frame.tasksRun=t,hn.frame.tasksScheduled=i,hn.frame.tasksBudget=Nfe}function ukt(e){for(var t in iA.time=e,io.scenes)if(io.scenes.hasOwnProperty(t)){var i=io.scenes[t];iA.sceneId=t,iA.startTime=i.startTime,iA.deltaTime=iA.prevTime==null?0:iA.time-iA.prevTime,i.fire("tick",iA,!0)}iA.prevTime=e}function hkt(){let e=io.scenes,t,i,r,n,o;for(o in e)e.hasOwnProperty(o)&&(t=e[o],i=oB[o],i||=oB[o]={},r=t.ticksPerOcclusionTest,i.ticksPerOcclusionTest!==r&&(i.ticksPerOcclusionTest=r,i.renderCountdown=r),--t.occlusionTestCountdown<=0&&(t.doOcclusionTest(),t.occlusionTestCountdown=r),n=t.ticksPerRender,i.ticksPerRender!==n&&(i.ticksPerRender=n,i.renderCountdown=n),--i.renderCountdown===0&&(t.render(!1),i.renderCountdown=n))}var Pr=class hke{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 hke)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,r){this._events||={},this._eventSubs||(this._eventSubs={},this._eventSubsNum={}),r!==!0&&(this._events[t]=i||!0);let n=this._eventSubs[t],o;if(n)for(let a in n)n.hasOwnProperty(a)&&(o=n[a],this._eventCallDepth++,this._eventCallDepth<300?o.callback.call(o.scope,i):this.error("fire: potential stack overflow from recursive event '"+t+"' - dropping this event"),this._eventCallDepth--)}on(t,i,r){this._events||={},this._subIdMap||=new Od,this._subIdEvents||={},this._eventSubs||={},this._eventSubsNum||={};let n=this._eventSubs[t];n?this._eventSubsNum[t]++:(n={},this._eventSubs[t]=n,this._eventSubsNum[t]=1);let o=this._subIdMap.addItem();n[o]={callback:i,scope:r||this},this._subIdEvents[o]=t;let a=this._events[t];return a!==void 0&&i.call(r||this,a),o}off(t){if(t==null||!this._subIdEvents)return;let i=this._subIdEvents[t];if(i){delete this._subIdEvents[t];let r=this._eventSubs[i];r&&(delete r[t],this._eventSubsNum[i]--),this._subIdMap.removeItem(t)}}once(t,i,r){let n=this,o=this.on(t,function(a){n.off(o),i.call(r||this,a)},r)}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+" "+$t.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 r=t.component,n=t.sceneDefault,o=t.sceneSingleton,a=t.type,s=t.on,l=t.recompiles!==!1;if(r&&($t.isNumeric(r)||$t.isString(r))){let p=r;if(r=this.scene.components[p],!r){this.error("Component not found: "+$t.inQuotes(p));return}}if(!r){if(o===!0){let p=this.scene.types[a];for(let A in p)if(p.hasOwnProperty){r=p[A];break}if(!r)return this.error("Scene has no default component for '"+i+"'"),null}else if(n===!0&&(r=this.scene[i],!r))return this.error("Scene has no default component for '"+i+"'"),null}if(r){if(r.scene.id!==this.scene.id){this.error("Not in same scene: "+r.type+" "+$t.inQuotes(r.id));return}if(a&&!r.isType(a)){this.error("Expected a "+a+" type or subtype: "+r.type+" "+$t.inQuotes(r.id));return}}this._attachments||={};let c=this._attached[i],d,u,h;if(c){if(r&&c.id===r.id)return;let p=this._attachments[c.id];for(d=p.subs,u=0,h=d.length;u<h;u++)c.off(d[u]);delete this._attached[i],delete this._attachments[c.id];let A=p.params.onDetached;A&&($t.isFunction(A)?A(c):A.scope?A.callback.call(A.scope,c):A.callback(c)),p.managingLifecycle&&c.destroy()}if(r){let p={params:t,component:r,subs:[],managingLifecycle:!1};p.subs.push(r.once("destroyed",function(){p.params.component=null,this._attach(p.params)},this)),l&&p.subs.push(r.on("dirty",function(){this.fire("dirty",this)},this)),this._attached[i]=r,this._attachments[r.id]=p;let A=t.onAttached;if(A&&($t.isFunction(A)?A(r):A.scope?A.callback.call(A.scope,r):A.callback(r)),s){let f,m,g,w;for(f in s)if(s.hasOwnProperty(f)){if(m=s[f],$t.isFunction(m)?(g=m,w=null):(g=m.callback,w=m.scope),!g)continue;p.subs.push(r.on(f,g,w))}}}return l&&this.fire("dirty",this),this.fire(i,r),r}_checkComponent(t,i){if(!i.isComponent)if($t.isID(i)){let r=i;if(i=this.scene.components[r],!i){this.error("Component not found: "+r);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($t.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(i.scene.id!==this.scene.id){this.error("Not in same scene: "+i.type);return}for(var r=0,n=t.length;r<n;r++)if(t[r]===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():io.scheduleTask(this._doUpdate,this))}_doUpdate(){this._updateScheduled&&(this._updateScheduled=!1,this._update&&this._update())}scheduleTask(t){io.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,r,n,o,a;if(this._attachments){for(t in this._attachments)if(this._attachments.hasOwnProperty(t)){for(i=this._attachments[t],r=i.component,n=i.subs,o=0,a=n.length;o<a;o++)r.off(n[o]);i.managingLifecycle&&r.destroy()}}if(this._ownedComponents)for(t in this._ownedComponents)this._ownedComponents.hasOwnProperty(t)&&(r=this._ownedComponents[t],r.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}},pkt=k.vec3(),Akt=k.vec3(),fkt=k.mat4(),fg=class{constructor(){this.normal=k.vec3(),this.offset=0,this.testVertex=k.vec3()}set(e,t,i,r){let n=1/Math.sqrt(e*e+t*t+i*i);this.normal[0]=e*n,this.normal[1]=t*n,this.normal[2]=i*n,this.offset=r*n,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}},$c=class{constructor(){this.planes=[new fg,new fg,new fg,new fg,new fg,new fg]}};$c.INSIDE=0,$c.INTERSECT=1,$c.OUTSIDE=2;function Kfe(e,t,i){let r=k.mulMat4(i,t,fkt),n=r[0],o=r[1],a=r[2],s=r[3],l=r[4],c=r[5],d=r[6],u=r[7],h=r[8],p=r[9],A=r[10],f=r[11],m=r[12],g=r[13],w=r[14],v=r[15];e.planes[0].set(s-n,u-l,f-h,v-m),e.planes[1].set(s+n,u+l,f+h,v+m),e.planes[2].set(s-o,u-c,f-p,v-g),e.planes[3].set(s+o,u+c,f+p,v+g),e.planes[4].set(s-a,u-d,f-A,v-w),e.planes[5].set(s+a,u+d,f+A,v+w)}function aB(e,t){let i=$c.INSIDE,r=pkt,n=Akt;r[0]=t[0],r[1]=t[1],r[2]=t[2],n[0]=t[3],n[1]=t[4],n[2]=t[5];let o=[r,n];for(let a=0;a<6;++a){let s=e.planes[a];if(s.normal[0]*o[s.testVertex[0]][0]+s.normal[1]*o[s.testVertex[1]][1]+s.normal[2]*o[s.testVertex[2]][2]+s.offset<0)return $c.OUTSIDE;s.normal[0]*o[1-s.testVertex[0]][0]+s.normal[1]*o[1-s.testVertex[1]][1]+s.normal[2]*o[1-s.testVertex[2]][2]+s.offset<0&&(i=$c.INTERSECT)}return i}var cb=class L8 extends Pr{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=k.vec2(),this._canvasMarqueeCorner2=k.vec2(),this._canvasMarquee=k.AABB2(),this._marqueeFrustum=new $c,this._marqueeFrustumProjMat=k.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!==L8.PICK_MODE_INSIDE&&t!==L8.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===L8.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=(r,n=$c.INTERSECT)=>{if(n===$c.INTERSECT&&(n=aB(this._marqueeFrustum,r.aabb)),n!==$c.OUTSIDE){if(r.entities){let o=r.entities;for(let a=0,s=o.length;a<s;a++){let l=o[a];if(!l.visible)continue;let c=l.aabb;this._pickMode===L8.PICK_MODE_INSIDE?aB(this._marqueeFrustum,c)===$c.INSIDE&&t.push(l.id):aB(this._marqueeFrustum,c)!==$c.OUTSIDE&&t.push(l.id)}}r.left&&i(r.left,n),r.right&&i(r.right,n)}};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,r=t.clientHeight,n=t.clientLeft,o=t.clientTop,a=2/i,s=2/r,l=t.clientHeight/t.clientWidth,c=(this._canvasMarquee[0]-n)*a+-1,d=(this._canvasMarquee[2]-n)*a+-1,u=-(this._canvasMarquee[3]-o)*s+1,h=-(this._canvasMarquee[1]-o)*s+1,p=this.viewer.scene.camera.frustum.near*(17*l);k.frustumMat4(c,d,u*l,h*l,p,1e4,this._marqueeFrustumProjMat),Kfe(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)}};cb.PICK_MODE_INTERSECTS=0,cb.PICK_MODE_INSIDE=1;var gkt=class extends Pr{constructor(e){super(e.marqueePicker,e);let t=e.marqueePicker,i=t.viewer.scene.canvas.canvas,r,n,o,a,s,l,c=!1,d=!1,u=!1,h;i.addEventListener("mousedown",p=>{this.getActive()&&p.button===0&&(h=setTimeout(function(){let A=t.viewer.scene.input;A.keyDown[A.KEY_CTRL]||t.clear(),r=p.pageX,n=p.pageY,s=p.offsetX,p.offsetY,t.setMarqueeCorner1([r,n]),c=!0,t.viewer.cameraControl.pointerEnabled=!1,t.setMarqueeVisible(!0),i.style.cursor="crosshair"},400),d=!0)}),i.addEventListener("mouseup",p=>{if(!this.getActive()||!c&&!u||p.button!==0)return;clearTimeout(h),o=p.pageX,a=p.pageY;let A=Math.abs(o-r),f=Math.abs(a-n);c=!1,t.viewer.cameraControl.pointerEnabled=!0,u&&=!1,(A>3||f>3)&&t.pick()}),document.addEventListener("mouseup",p=>{this.getActive()&&p.button===0&&(clearTimeout(h),c&&(t.setMarqueeVisible(!1),c=!1,d=!1,u=!0,t.viewer.cameraControl.pointerEnabled=!0))},!0),i.addEventListener("mousemove",p=>{this.getActive()&&p.button===0&&d&&(clearTimeout(h),c&&(o=p.pageX,a=p.pageY,l=p.offsetX,p.offsetY,t.setMarqueeVisible(!0),t.setMarqueeCorner2([o,a]),t.setPickMode(s<l?cb.PICK_MODE_INSIDE:cb.PICK_MODE_INTERSECTS)))})}setActive(e){this._active!==e&&(this._active=e,this.fire("active",this._active))}getActive(){return this._active}destroy(){}},iO=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,r=n=>{if(!this._running)return;i||=n;let o=n-i,a=Math.min(o/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(r)};this._running=!0,requestAnimationFrame(r),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)}},Wfe=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 r=Jfe(e,i);return r?t?rO(r,t):r:null}translatePlurals(e,t,i){let r=this._messages[this._locale];if(!r)return null;let n=Jfe(e,r);return t=parseInt(""+t,10),n=t===0?n.zero:t>1?n.other:n.one,n?(n=rO(n,[t]),i&&(n=rO(n,i)),n):null}fire(e,t,i){this._events||={},this._eventSubs||={},i!==!0&&(this._events[e]=t||!0);let r=this._eventSubs[e];if(r)for(let n in r)r.hasOwnProperty(n)&&r[n].callback(t)}on(e,t){this._events||={},this._eventSubIDMap||=new Od,this._eventSubEvents||={},this._eventSubs||={};let i=this._eventSubs[e];i||(i={},this._eventSubs[e]=i);let r=this._eventSubIDMap.addItem();i[r]={callback:t},this._eventSubEvents[r]=e;let n=this._events[e];return n!==void 0&&t(n),r}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 Jfe(e,t){if(t[e])return t[e];let i=e.split("."),r=t;for(let n=0,o=i.length;r&&n<o;n++){let a=i[n];r=r[a]}return r}function rO(e,t=[]){return e.replace(/\{\{|\}\}|\{(\d+)\}/g,function(i,r){return i==="{{"?"{":i==="}}"?"}":t[r]})}var db=class extends Pr{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,r=e+t;i<0&&(i=0),r>1&&(r=1);var n=this.getPoint(i),o=this.getPoint(r),a=k.subVec3(o,n,[]);return k.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,r=this.getPoint(0),n,o=0;for(t.push(0),n=1;n<=e;n++)i=this.getPoint(n/e),o+=k.lenVec3(k.subVec3(i,r,[])),t.push(o),r=i;return this.cacheArcLengths=t,t}_updateArcLengths(){this.needsUpdate=!0,this._getLengths()}getUToTMapping(e,t){for(var i=this._getLengths(),r=0,n=i.length,o,a=t||e*i[n-1],s=0,l=n-1,c;s<=l;)if(r=Math.floor(s+(l-s)/2),c=i[r]-a,c<0)s=r+1;else if(c>0)l=r-1;else{l=r;break}if(r=l,i[r]===a)return o=r/(n-1),o;var d=i[r],u=i[r+1]-d,h=(a-d)/u;return o=(r+h)/(n-1),o}},sB=class extends db{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,r=Math.floor(i),n=i-r,o=t[r===0?r:r-1],a=t[r],s=t[r>t.length-2?t.length-1:r+1],l=t[r>t.length-3?t.length-1:r+2],c=k.vec3();return c[0]=k.catmullRomInterpolate(o[0],a[0],s[0],l[0],n),c[1]=k.catmullRomInterpolate(o[1],a[1],s[1],l[1],n),c[2]=k.catmullRomInterpolate(o[2],a[2],s[2],l[2],n),c}getJSON(){return{points,t:this._t}}},nO=k.vec3(),mkt=class extends Pr{get type(){return"CameraPath"}constructor(e,t={}){super(e,t),this._frames=[],this._eyeCurve=new sB(this),this._lookCurve=new sB(this),this._upCurve=new sB(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,r){let n={t:e,eye:t.slice(0),look:i.slice(0),up:r.slice(0)};this._frames.push(n),this._eyeCurve.points.push(n.eye),this._lookCurve.points.push(n.look),this._upCurve.points.push(n.up)}addFrames(e){let t;for(let i=0,r=e.length;i<r;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,nO),t.look=this._lookCurve.getPoint(e,nO),t.up=this._upCurve.getPoint(e,nO)}sampleFrame(e,t,i,r){e=e<0?0:e>1?1:e,this._eyeCurve.getPoint(e,t),this._lookCurve.getPoint(e,i),this._upCurve.getPoint(e,r)}smoothFrameTimes(e){if(this._frames.length===0)return;let t=k.vec3();var i=0;this._frames[0].t=0;let r=[];for(let o=1,a=this._frames.length;o<a;o++){var n=k.lenVec3(k.subVec3(this._frames[o].eye,this._frames[o-1].eye,t));r[o]=n,i+=n}for(let o=1,a=this._frames.length;o<a;o++){let s=r[o]/i*e;this._frames[o].t=this._frames[o-1].t+s}}clearFrames(){this._frames=[],this._eyeCurve.points=[],this._lookCurve.points=[],this._upCurve.points=[]}},oO=k.vec3(),aO=k.vec3(),sO=k.vec3(),Yfe=k.vec3(),gg=k.vec3(),lO=class yP extends Pr{get type(){return"CameraFlightAnimation"}constructor(t,i={}){super(t,i),this._look1=k.vec3(),this._eye1=k.vec3(),this._up1=k.vec3(),this._look2=k.vec3(),this._eye2=k.vec3(),this._up2=k.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,r){t||=this.scene,this._flying&&this.stop(),this._flying=!1,this._flyingEye=!1,this._flyingLook=!1,this._flyingEyeLookUp=!1,this._callback=i,this._callbackScope=r;let n=this.scene.camera,o=!!t.projection&&t.projection!==n.projection;this._eye1[0]=n.eye[0],this._eye1[1]=n.eye[1],this._eye1[2]=n.eye[2],this._look1[0]=n.look[0],this._look1[1]=n.look[1],this._look1[2]=n.look[2],this._up1[0]=n.up[0],this._up1[1]=n.up[1],this._up1[2]=n.up[2],this._orthoScale1=n.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 h=t;if(($t.isNumeric(h)||$t.isString(h))&&(d=h,h=this.scene.components[d],!h)){this.error("Component not found: "+$t.inQuotes(d)),i&&(r?i.call(r):i());return}o||(a=h.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 h=k.getAABB3Center(a);this._look2=u||h;let p=k.subVec3(this._eye1,this._look1,oO),A=k.normalizeVec3(p),f=u?k.getAABB3DiagPoint(a,u):k.getAABB3Diag(a),m=t.fitFOV||this._fitFOV,g=Math.abs(f/Math.tan(m*k.DEGTORAD));this._orthoScale2=f*1.1,this._eye2[0]=this._look2[0]+A[0]*g,this._eye2[1]=this._look2[1]+A[1]*g,this._eye2[2]=this._look2[2]+A[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]));o?(t.projection==="ortho"&&n.projection!=="ortho"&&(this._projection2="ortho",this._projMatrix1=n.projMatrix.slice(),this._projMatrix2=n.ortho.matrix.slice(),n.projection="customProjection"),t.projection==="perspective"&&n.projection!=="perspective"&&(this._projection2="perspective",this._projMatrix1=n.projMatrix.slice(),this._projMatrix2=n.perspective.matrix.slice(),n.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,io.scheduleTask(this._update,this)}jumpTo(t){this._jumpTo(t)}_jumpTo(t){this._flying&&this.stop();let i=this.scene.camera;var r,n,o,a,s;if(t.aabb)r=t.aabb;else if(t.length===6)r=t;else if(t.eye||t.look||t.up)o=t.eye,a=t.look,s=t.up;else{let d=t;if(($t.isNumeric(d)||$t.isString(d))&&(n=d,d=this.scene.components[n],!d)){this.error("Component not found: "+$t.inQuotes(n));return}r=d.aabb||this.scene.aabb}let l=t.poi;if(r){if(r[3]<=r[0]||r[4]<=r[1]||r[5]<=r[2])return;var c=l?k.getAABB3DiagPoint(r,l):k.getAABB3Diag(r);a=l||k.getAABB3Center(r,a),this._trail?k.subVec3(i.look,a,gg):k.subVec3(i.eye,i.look,gg),k.normalizeVec3(gg);let d;d=(t.fit===void 0?this._fit:t.fit)?Math.abs(c/Math.tan((t.fitFOV||this._fitFOV)*k.DEGTORAD)):k.lenVec3(k.subVec3(i.eye,i.look,oO)),k.mulVec3Scalar(gg,d),i.eye=k.addVec3(a,gg,oO),i.look=a,this.scene.camera.ortho.scale=c*1.1}else(o||a||s)&&(o&&(i.eye=o),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 r=this.easing?yP._ease(t,0,1,1):t,n=this.scene.camera;if(this._flyingEye||this._flyingLook?this._flyingEye?(k.subVec3(n.eye,n.look,gg),n.eye=k.lerpVec3(r,0,1,this._eye1,this._eye2,sO),n.look=k.subVec3(sO,gg,aO)):this._flyingLook&&(n.look=k.lerpVec3(r,0,1,this._look1,this._look2,aO),n.up=k.lerpVec3(r,0,1,this._up1,this._up2,Yfe)):this._flyingEyeLookUp&&(n.eye=k.lerpVec3(r,0,1,this._eye1,this._eye2,sO),n.look=k.lerpVec3(r,0,1,this._look1,this._look2,aO),n.up=k.lerpVec3(r,0,1,this._up1,this._up2,Yfe)),this._projection2){let o=this._projection2==="ortho"?yP._easeOutExpo(t,0,1,1):yP._easeInCubic(t,0,1,1);n.customProjection.matrix=k.lerpMat4(o,0,1,this._projMatrix1,this._projMatrix2)}else n.ortho.scale=this._orthoScale1+t*(this._orthoScale2-this._orthoScale1);if(i){n.ortho.scale=this._orthoScale2,this.stop();return}io.scheduleTask(this._update,this)}static _ease(t,i,r,n){return t/=n,-r*t*(t-2)+i}static _easeInCubic(t,i,r,n){return t/=n,r*t*t*t+i}static _easeOutExpo(t,i,r,n){return r*(-(2**(-10*t/n))+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()}},ub=class Ad extends Pr{get type(){return"CameraPathAnimation"}constructor(t,i={}){super(t,i),this._cameraFlightAnimation=new lO(this),this._t=0,this.state=Ad.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,r,n=performance.now(),o=this._lastTime?(n-this._lastTime)*.001:0;if(this._lastTime=n,o!==0)switch(this.state){case Ad.SCRUBBING:return;case Ad.PLAYING:if(this._t+=this._playingRate*o,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=Ad.SCRUBBING,this._t=this._cameraPath.frames[i-1].t,this.fire("stopped");return}t.loadFrame(this._t);break;case Ad.PLAYING_TO:r=this._t+this._playingRate*o*this._playingDir,(this._playingDir<0&&r<=this._playingToT||this._playingDir>0&&r>=this._playingToT)&&(r=this._playingToT,this.state=Ad.SCRUBBING,this.fire("stopped")),this._t=r,t.loadFrame(this._t);break}}_ease(t,i,r,n){return t/=n,-r*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=Ad.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=Ad.PLAYING_TO)}playToFrame(t){let i=this._cameraPath;if(!i)return;let r=i.frames[t];if(!r){this.error("playToFrame - frame index out of range: "+t);return}this.playToT(r.t)}flyToFrame(t,i){let r=this._cameraPath;if(!r)return;let n=r.frames[t];if(!n){this.error("flyToFrame - frame index out of range: "+t);return}this.state=Ad.SCRUBBING,this._cameraFlightAnimation.flyTo(n,i)}scrubToT(t){let i=this._cameraPath;i&&this.scene.camera&&(this._t=t,i.loadFrame(this._t),this.state=Ad.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=Ad.SCRUBBING}}stop(){this.state=Ad.SCRUBBING,this.fire("stopped")}destroy(){super.destroy(),this.scene.off(this._tick)}};ub.STOPPED=0,ub.SCRUBBING=1,ub.PLAYING=2,ub.PLAYING_TO=3;var Zfe=class extends Pr{get type(){return"Geometry"}get isGeometry(){return!0}constructor(e,t={}){super(e,t),hn.memory.meshes++}destroy(){super.destroy(),hn.memory.meshes--}},Xfe=new Od({}),_n=class{constructor(e){this.id=Xfe.addItem({});for(let t in e)e.hasOwnProperty(t)&&(this[t]=e[t])}destroy(){Xfe.removeItem(this.id)}},xi=class{constructor(e,t,i,r,n,o,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=o,this.length=0,this.dataLength=r,this.numItems=0,this.itemSize=n,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)}},X1=(function(){let e=[],t=[],i=[],r=[],n=[],o=0,a=new Uint16Array(3),s=new Uint16Array(3),l=new Uint16Array(3),c=k.vec3(),d=k.vec3(),u=k.vec3(),h=k.vec3(),p=k.vec3(),A=k.vec3(),f=k.vec3();function m(w,v){let b={},y,C,B,I,E=1e4,P,S,D=0;for(P=0,S=w.length;P<S;P+=3)y=w[P],C=w[P+1],B=w[P+2],I=Math.round(y*E)+"_"+Math.round(C*E)+"_"+Math.round(B*E),b[I]===void 0&&(b[I]=D/3,e[D++]=y,e[D++]=C,e[D++]=B),t[P/3]=b[I];for(P=0,S=v.length;P<S;P++)r[P]=t[v[P]],i[r[P]]=v[P]}function g(w,v){o=0;for(let b=0,y=w;b<y;b+=3){let C=r[b]*3,B=r[b+1]*3,I=r[b+2]*3;v?(a[0]=e[C],a[1]=e[C+1],a[2]=e[C+2],s[0]=e[B],s[1]=e[B+1],s[2]=e[B+2],l[0]=e[I],l[1]=e[I+1],l[2]=e[I+2],k.decompressPosition(a,v,c),k.decompressPosition(s,v,d),k.decompressPosition(l,v,u)):(c[0]=e[C],c[1]=e[C+1],c[2]=e[C+2],d[0]=e[B],d[1]=e[B+1],d[2]=e[B+2],u[0]=e[I],u[1]=e[I+1],u[2]=e[I+2]),k.subVec3(u,d,h),k.subVec3(c,d,p),k.cross3Vec3(h,p,A),k.normalizeVec3(A,f);let E=n[o]||(n[o]={normal:k.vec3()});E.normal[0]=f[0],E.normal[1]=f[1],E.normal[2]=f[2],o++}}return function(w,v,b,y){m(w,v),g(v.length,b);let C=[],B=Math.cos(k.DEGTORAD*y),I={},E,P,S,D,j,V=!1,Q,z,J,Y,ne,ke;for(let Oe=0,_e=v.length;Oe<_e;Oe+=3){let be=Oe/3;for(let de=0;de<3;de++)E=r[Oe+de],P=r[Oe+(de+1)%3],S=Math.min(E,P),D=Math.max(E,P),j=S+","+D,I[j]===void 0?I[j]={index1:S,index2:D,face1:be,face2:void 0}:I[j].face2=be}for(j in I)Q=I[j],!(Q.face2!==void 0&&(z=n[Q.face1].normal,J=n[Q.face2].normal,Y=k.dotVec3(z,J),Y>B))&&(ne=i[Q.index1],ke=i[Q.index2],(!V&&ne>65535||ke>65535)&&(V=!0),C.push(ne),C.push(ke));return V?new Uint32Array(C):new Uint16Array(C)}})();function vkt(e){let t=new Float32Array(3),i=new Float32Array(3),r,n;for(r=0;r<3;r++)t[r]=Number.MAX_VALUE,i[r]=-Number.MAX_VALUE;for(r=0;r<e.length;r+=3)for(n=0;n<3;n++)t[n]=Math.min(t[n],e[r+n]),i[n]=Math.max(i[n],e[r+n]);return{min:t,max:i}}var wkt=(function(){let e=k.mat4(),t=k.mat4();return function(i,r){r||=k.mat4();let n=i[0],o=i[1],a=i[2],s=i[3]-n,l=i[4]-o,c=i[5]-a,d=65535;return k.identityMat4(e),k.translationMat4v(i,e),k.identityMat4(t),k.scalingMat4v([s/d,l/d,c/d],t),k.mulMat4(e,t,r),r}})(),bkt=(function(){let e=k.mat4(),t=k.mat4();return function(i,r,n){let o=new Uint16Array(i.length),a=new Float32Array([n[0]===r[0]?0:65535/(n[0]-r[0]),n[1]===r[1]?0:65535/(n[1]-r[1]),n[2]===r[2]?0:65535/(n[2]-r[2])]),s;for(s=0;s<i.length;s+=3)o[s+0]=Math.max(0,Math.min(65535,Math.floor((i[s+0]-r[0])*a[0]))),o[s+1]=Math.max(0,Math.min(65535,Math.floor((i[s+1]-r[1])*a[1]))),o[s+2]=Math.max(0,Math.min(65535,Math.floor((i[s+2]-r[2])*a[2])));return k.identityMat4(e),k.translationMat4v(r,e),k.identityMat4(t),k.scalingMat4v([(n[0]-r[0])/65535,(n[1]-r[1])/65535,(n[2]-r[2])/65535],t),{quantized:o,decodeMatrix:k.mulMat4(e,t,k.identityMat4())}}})();function ykt(e,t,i){let r=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])*r[0]))),i[1]=Math.max(0,Math.min(65535,Math.floor((e[1]-t[1])*r[1]))),i[2]=Math.max(0,Math.min(65535,Math.floor((e[2]-t[2])*r[2])))}function Ckt(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 xkt(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 kkt(e,t,i=new Float32Array(e.length)){for(let r=0,n=e.length;r<n;r+=3)i[r+0]=e[r+0]*t[0]+t[12],i[r+1]=e[r+1]*t[5]+t[13],i[r+2]=e[r+2]*t[10]+t[14];return i}function Bkt(e){let t=new Float32Array(2),i=new Float32Array(2),r,n;for(r=0;r<2;r++)t[r]=Number.MAX_VALUE,i[r]=-Number.MAX_VALUE;for(r=0;r<e.length;r+=2)for(n=0;n<2;n++)t[n]=Math.min(t[n],e[r+n]),i[n]=Math.max(i[n],e[r+n]);return{min:t,max:i}}var Ekt=(function(){let e=k.mat3(),t=k.mat3();return function(i,r,n){let o=new Uint16Array(i.length),a=new Float32Array([65535/(n[0]-r[0]),65535/(n[1]-r[1])]),s;for(s=0;s<i.length;s+=2)o[s+0]=Math.max(0,Math.min(65535,Math.floor((i[s+0]-r[0])*a[0]))),o[s+1]=Math.max(0,Math.min(65535,Math.floor((i[s+1]-r[1])*a[1])));return k.identityMat3(e),k.translationMat3v(r,e),k.identityMat3(t),k.scalingMat3v([(n[0]-r[0])/65535,(n[1]-r[1])/65535],t),{quantized:o,decodeMatrix:k.mulMat3(e,t,k.identityMat3())}}})();function Mkt(e){let t=new Int8Array(e.length),i,r,n,o,a;for(let s=0;s<e.length;s+=3)n=i=lB(e,s,"floor","floor"),r=cB(i),o=a=dB(e,s,r),i=lB(e,s,"ceil","floor"),r=cB(i),o=dB(e,s,r),o>a&&(n=i,a=o),i=lB(e,s,"floor","ceil"),r=cB(i),o=dB(e,s,r),o>a&&(n=i,a=o),i=lB(e,s,"ceil","ceil"),r=cB(i),o=dB(e,s,r),o>a&&(n=i,a=o),t[s]=n[0],t[s+1]=n[1];return t}function lB(e,t,i,r){let n=e[t]/(Math.abs(e[t])+Math.abs(e[t+1])+Math.abs(e[t+2])),o=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(o))*(n>=0?1:-1),s=(1-Math.abs(n))*(o>=0?1:-1);n=a,o=s}return new Int8Array([Math[i](n*127.5+(n<0?-1:0)),Math[r](o*127.5+(o<0?-1:0))])}function cB(e){let t=e[0],i=e[1];t/=t<0?127:128,i/=i<0?127:128;let r=1-Math.abs(t)-Math.abs(i);r<0&&(t=(1-Math.abs(i))*(t>=0?1:-1),i=(1-Math.abs(t))*(i>=0?1:-1));let n=Math.sqrt(t*t+i*i+r*r);return[t/n,i/n,r/n]}function dB(e,t,i){return e[t]*i[0]+e[t+1]*i[1]+e[t+2]*i[2]}function Ikt(e,t,i){i[0]=e[0]*t[0]+t[6],i[1]=e[1]*t[4]+t[7]}function Pkt(e,t,i=new Float32Array(e.length)){for(let r=0,n=e.length;r<n;r+=3)i[r+0]=e[r+0]*t[0]+t[6],i[r+1]=e[r+1]*t[4]+t[7];return i}function Skt(e,t){let i=e[0],r=e[1];i=(2*i+1)/255,r=(2*r+1)/255;let n=1-Math.abs(i)-Math.abs(r);n<0&&(i=(1-Math.abs(r))*(i>=0?1:-1),r=(1-Math.abs(i))*(r>=0?1:-1));let o=Math.sqrt(i*i+r*r+n*n);return t[0]=i/o,t[1]=r/o,t[2]=n/o,t}function Tkt(e,t){for(let i=0,r=0,n=e.length;i<n;i+=2){let o=e[i+0],a=e[i+1];o=(2*o+1)/255,a=(2*a+1)/255;let s=1-Math.abs(o)-Math.abs(a);s<0&&(o=(1-Math.abs(a))*(o>=0?1:-1),a=(1-Math.abs(o))*(a>=0?1:-1));let l=Math.sqrt(o*o+a*a+s*s);t[r+0]=o/l,t[r+1]=a/l,t[r+2]=s/l,r+=3}return t}var or={getPositionsBounds:vkt,createPositionsDecodeMatrix:wkt,compressPositions:bkt,compressPosition:ykt,decompressPositions:kkt,decompressPosition:Ckt,decompressAABB:xkt,getUVBounds:Bkt,compressUVs:Ekt,decompressUVs:Pkt,decompressUV:Ikt,compressNormals:Mkt,decompressNormals:Tkt,decompressNormal:Skt},Lh=hn.memory,$fe=k.AABB3(),so=class extends Zfe{get type(){return"ReadableGeometry"}get isReadableGeometry(){return!0}constructor(e,t={}){super(e,t),this._state=new _n({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,r=this.scene.canvas.gl;switch(t.primitive=t.primitive||"triangles",t.primitive){case"points":i.primitive=r.POINTS,i.primitiveName=t.primitive;break;case"lines":i.primitive=r.LINES,i.primitiveName=t.primitive;break;case"line-loop":i.primitive=r.LINE_LOOP,i.primitiveName=t.primitive;break;case"line-strip":i.primitive=r.LINE_STRIP,i.primitiveName=t.primitive;break;case"triangles":i.primitive=r.TRIANGLES,i.primitiveName=t.primitive;break;case"triangle-strip":i.primitive=r.TRIANGLE_STRIP,i.primitiveName=t.primitive;break;case"triangle-fan":i.primitive=r.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=r.TRIANGLES,i.primitiveName=t.primitive}if(t.positions)if(this._state.compressGeometry){let n=or.getPositionsBounds(t.positions),o=or.compressPositions(t.positions,n.min,n.max);i.positions=o.quantized,i.positionsDecodeMatrix=o.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 n=or.getUVBounds(t.uv),o=or.compressUVs(t.uv,n.min,n.max);i.uv=o.quantized,i.uvDecodeMatrix=o.decodeMatrix}else i.uv=t.uv.constructor===Float32Array?t.uv:new Float32Array(t.uv);t.normals&&(this._state.compressGeometry?i.normals=or.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(),Lh.meshes++,this._buildVBOs()}_buildVBOs(){let e=this._state,t=this.scene.canvas.gl;if(e.indices&&(e.indicesBuf=new xi(t,t.ELEMENT_ARRAY_BUFFER,e.indices,e.indices.length,1,t.STATIC_DRAW),Lh.indices+=e.indicesBuf.numItems),e.positions&&(e.positionsBuf=new xi(t,t.ARRAY_BUFFER,e.positions,e.positions.length,3,t.STATIC_DRAW),Lh.positions+=e.positionsBuf.numItems),e.normals){let i=e.compressGeometry;e.normalsBuf=new xi(t,t.ARRAY_BUFFER,e.normals,e.normals.length,3,t.STATIC_DRAW,i),Lh.normals+=e.normalsBuf.numItems}e.colors&&(e.colorsBuf=new xi(t,t.ARRAY_BUFFER,e.colors,e.colors.length,4,t.STATIC_DRAW),Lh.colors+=e.colorsBuf.numItems),e.uv&&(e.uvBuf=new xi(t,t.ARRAY_BUFFER,e.uv,e.uv.length,2,t.STATIC_DRAW),Lh.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=X1(e.positions,e.indices,e.positionsDecodeMatrix,this._edgeThreshold);this._edgeIndicesBuf=new xi(t,t.ELEMENT_ARRAY_BUFFER,i,i.length,1,t.STATIC_DRAW),Lh.indices+=this._edgeIndicesBuf.numItems}_buildPickTriangleVBOs(){let e=this._state;if(!e.positions||!e.indices)return;let t=this.scene.canvas.gl,i=k.buildPickTriangles(e.positions,e.indices,e.compressGeometry),r=i.positions,n=i.colors;this._pickTrianglePositionsBuf=new xi(t,t.ARRAY_BUFFER,r,r.length,3,t.STATIC_DRAW),this._pickTriangleColorsBuf=new xi(t,t.ARRAY_BUFFER,n,n.length,4,t.STATIC_DRAW,!0),Lh.positions+=this._pickTrianglePositionsBuf.numItems,Lh.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),or.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 r=or.getPositionsBounds(e),n=or.compressPositions(e,r.min,r.max);e=n.quantized,t.positionsDecodeMatrix=n.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),or.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),or.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||=k.AABB3(),k.positions3ToAABB3(this._state.positions,this._aabb,this._state.positionsDecodeMatrix),!1),this._aabb}get obb(){return this._obbDirty&&=(this._obb||=k.OBB3(),k.positions3ToAABB3(this._state.positions,$fe,this._state.positionsDecodeMatrix),k.AABB3ToOBB3($fe,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},r=[k.vec3(),k.vec3(),k.vec3(),k.vec3()],n=0,o=k.vec3([0,0,0]);for(let a=0;a<e.length;a+=3){let s=i(a,r[0]),l=i(a+1,r[1]),c=i(a+2,r[2]);k.addVec3(s,l,r[3]),k.addVec3(c,r[3],r[3]);let d=k.lenVec3(k.cross3Vec3(k.subVec3(l,s,r[1]),k.subVec3(c,s,r[2]),r[0]))/2;n+=d,k.mulVec3Scalar(r[3],d,r[3]),k.addVec3(o,r[3],o)}this._metrics={surfaceArea:n,centroid:k.mulVec3Scalar(o,1/n/3,o)};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(),Lh.meshes--}},mg=hn.memory,e0e=k.AABB3(),t0e=class extends Zfe{get type(){return"VBOGeometry"}get isVBOGeometry(){return!0}constructor(e,t={}){super(e,t),this._state=new _n({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=k.OBB3();let i=this._state,r=this.scene.canvas.gl;switch(t.primitive=t.primitive||"triangles",t.primitive){case"points":i.primitive=r.POINTS,i.primitiveName=t.primitive;break;case"lines":i.primitive=r.LINES,i.primitiveName=t.primitive;break;case"line-loop":i.primitive=r.LINE_LOOP,i.primitiveName=t.primitive;break;case"line-strip":i.primitive=r.LINE_STRIP,i.primitiveName=t.primitive;break;case"triangles":i.primitive=r.TRIANGLES,i.primitiveName=t.primitive;break;case"triangle-strip":i.primitive=r.TRIANGLE_STRIP,i.primitiveName=t.primitive;break;case"triangle-fan":i.primitive=r.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=r.TRIANGLES,i.primitiveName=t.primitive}if(!t.positions){this.error("Config expected: positions");return}if(!t.indices){this.error("Config expected: indices");return}var n;if(!t.positionsDecodeMatrix){let o=or.getPositionsBounds(t.positions),a=or.compressPositions(t.positions,o.min,o.max);n=a.quantized,i.positionsDecodeMatrix=a.decodeMatrix,i.positionsBuf=new xi(r,r.ARRAY_BUFFER,n,n.length,3,r.STATIC_DRAW),mg.positions+=i.positionsBuf.numItems,k.positions3ToAABB3(t.positions,this._aabb),k.positions3ToAABB3(n,e0e,i.positionsDecodeMatrix),k.AABB3ToOBB3(e0e,this._obb)}if(t.colors){let o=t.colors.constructor===Float32Array?t.colors:new Float32Array(t.colors);i.colorsBuf=new xi(r,r.ARRAY_BUFFER,o,o.length,4,r.STATIC_DRAW),mg.colors+=i.colorsBuf.numItems}if(t.uv){let o=or.getUVBounds(t.uv),a=or.compressUVs(t.uv,o.min,o.max),s=a.quantized;i.uvDecodeMatrix=a.decodeMatrix,i.uvBuf=new xi(r,r.ARRAY_BUFFER,s,s.length,2,r.STATIC_DRAW),mg.uvs+=i.uvBuf.numItems}if(t.normals){let o=or.compressNormals(t.normals),a=i.compressGeometry;i.normalsBuf=new xi(r,r.ARRAY_BUFFER,o,o.length,3,r.STATIC_DRAW,a),mg.normals+=i.normalsBuf.numItems}{let o=t.indices.constructor===Uint32Array||t.indices.constructor===Uint16Array?t.indices:new Uint32Array(t.indices);i.indicesBuf=new xi(r,r.ELEMENT_ARRAY_BUFFER,o,o.length,1,r.STATIC_DRAW),mg.indices+=i.indicesBuf.numItems;let a=X1(n,o,i.positionsDecodeMatrix,this._edgeThreshold);this._edgeIndicesBuf=new xi(r,r.ELEMENT_ARRAY_BUFFER,a,a.length,1,r.STATIC_DRAW),this._state.primitiveName==="triangles"&&(this._numTriangles=t.indices.length/3)}this._buildHash(),mg.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(),mg.meshes--}},mt={};mt.load=function(e,t){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(r){t(r.target.response)},i.send()},mt.save=function(e,t){var i="data:application/octet-stream;base64,"+btoa(mt.parse._buffToStr(e));window.location.href=i},mt.clone=function(e){return JSON.parse(JSON.stringify(e))},mt.bin={},mt.bin.f=new Float32Array(1),mt.bin.fb=new Uint8Array(mt.bin.f.buffer),mt.bin.rf=function(e,t){for(var i=mt.bin.f,r=mt.bin.fb,n=0;n<4;n++)r[n]=e[t+n];return i[0]},mt.bin.rsl=function(e,t){return e[t]|e[t+1]<<8},mt.bin.ril=function(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24},mt.bin.rASCII0=function(e,t){for(var i="";e[t]!=0;)i+=String.fromCharCode(e[t++]);return i},mt.bin.wf=function(e,t,i){var r=new Float32Array(e.buffer,t,1);r[0]=i},mt.bin.wsl=function(e,t,i){e[t]=i,e[t+1]=i>>8},mt.bin.wil=function(e,t,i){e[t]=i,e[t+1]=i>>8,e[t+2]=i>>16,e[t+3]>>24},mt.parse={},mt.parse._buffToStr=function(e){for(var t=new Uint8Array(e),i="",r=0;r<t.length;r++)i=i.concat(String.fromCharCode(t[r]));return i},mt.parse._strToBuff=function(e){for(var t=new ArrayBuffer(e.length),i=new Uint8Array(t),r=0;r<e.length;r++)i[r]=e.charCodeAt(r);return t},mt.parse._readLine=function(e,t){for(var i="";e[t]!=10;)i+=String.fromCharCode(e[t++]);return i},mt.parse.fromJSON=function(e){return JSON.parse(mt.parse._buffToStr(e))},mt.parse.toJSON=function(e){var t=JSON.stringify(e);return mt.parse._strToBuff(t)},mt.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},r=0,n=new Uint8Array(e);r<n.length;){var o=mt.parse._readLine(n,r);r+=o.length+1,o=o.replace(/ +(?= )/g,""),o=o.replace(/(^\s+|\s+$)/g,"");var a=o.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("/"),h=a[3].split("/"),p=parseInt(d[0])-1,A=parseInt(u[0])-1,f=parseInt(h[0])-1,m=parseInt(d[1])-1,g=parseInt(u[1])-1,w=parseInt(h[1])-1,v=parseInt(d[2])-1,b=parseInt(u[2])-1,y=parseInt(h[2])-1,C=t.c_verts.length/3,B=t.c_uvt.length/2,I=t.c_norms.length/3;if(p<0&&(p=C+p+1),A<0&&(A=C+A+1),f<0&&(f=C+f+1),m<0&&(m=B+m+1),g<0&&(g=B+g+1),w<0&&(w=B+w+1),v<0&&(v=I+v+1),b<0&&(b=I+b+1),y<0&&(y=I+y+1),t.i_verts.push(p,A,f),t.i_uvt.push(m,g,w),t.i_norms.push(v,b,y),a.length==5){var E=a[4].split("/"),P=parseInt(E[0])-1,S=parseInt(E[1])-1,D=parseInt(E[2])-1;P<0&&(P=C+P+1),S<0&&(S=B+S+1),D<0&&(D=I+D+1),t.i_verts.push(p,f,P),t.i_uvt.push(m,w,S),t.i_norms.push(v,y,D)}}}return i.to=t.i_verts.length,t},mt.parse.fromMD2=function(e){e=new Uint8Array(e);var t={},i={};i.ident=mt.bin.ril(e,0),i.version=mt.bin.ril(e,4),i.skinwidth=mt.bin.ril(e,8),i.skinheight=mt.bin.ril(e,12),i.framesize=mt.bin.ril(e,16),i.num_skins=mt.bin.ril(e,20),i.num_vertices=mt.bin.ril(e,24),i.num_st=mt.bin.ril(e,28),i.num_tris=mt.bin.ril(e,32),i.num_glcmds=mt.bin.ril(e,36),i.num_frames=mt.bin.ril(e,40),i.offset_skins=mt.bin.ril(e,44),i.offset_st=mt.bin.ril(e,48),i.offset_tris=mt.bin.ril(e,52),i.offset_frames=mt.bin.ril(e,56),i.offset_glcmds=mt.bin.ril(e,60),i.offset_end=mt.bin.ril(e,64);var l=i.offset_st;t.c_uvt=[];for(var r=0;r<i.num_st;r++){var n=mt.bin.rsl(e,l)/i.skinwidth,o=mt.bin.rsl(e,l+2)/i.skinheight;t.c_uvt.push(n,o),l+=4}var l=i.offset_tris,a=[],s=[];t.i_verts=a,t.i_uvt=s;for(var r=0;r<i.num_tris;r++)a.push(mt.bin.rsl(e,l),mt.bin.rsl(e,l+2),mt.bin.rsl(e,l+4)),s.push(mt.bin.rsl(e,l+6),mt.bin.rsl(e,l+8),mt.bin.rsl(e,l+10)),l+=12;var l=i.offset_skins;t.skins=[];for(var r=0;r<i.num_skins;r++)t.skins.push(mt.bin.rASCII0(e,l)),l+=64;var l=i.offset_frames;t.frames=[];for(var c=mt.parse.fromMD2._normals,r=0;r<i.num_frames;r++){var d={},u=mt.bin.rf(e,l),h=mt.bin.rf(e,l+4),p=mt.bin.rf(e,l+8);l+=12;var A=mt.bin.rf(e,l),f=mt.bin.rf(e,l+4),m=mt.bin.rf(e,l+8);l+=12,d.name=mt.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+A,e[l+1]*h+f,e[l+2]*p+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},mt.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],mt.parse.fromCollada=function(e){var t=mt.parse._buffToStr(e),i=new DOMParser().parseFromString(t,"text/xml");i=i.childNodes[0];var r={},n=i.getElementsByTagName("asset")[0],o=i.getElementsByTagName("library_geometries")[0],a=i.getElementsByTagName("library_images")[0],s=i.getElementsByTagName("library_materials")[0],l=i.getElementsByTagName("library_effects")[0];return n&&(r.asset=mt.parse.fromCollada._asset(n)),o&&(r.geometries=mt.parse.fromCollada._libGeometries(o)),a&&(r.images=mt.parse.fromCollada._libImages(a)),s&&(r.materials=mt.parse.fromCollada._libMaterials(s)),l&&(r.effects=mt.parse.fromCollada._libEffects(l)),r},mt.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}},mt.parse.fromCollada._libGeometries=function(e){e=e.getElementsByTagName("geometry");for(var t=[],i=0;i<e.length;i++){var r=e[i],n=mt.parse.fromCollada._getMesh(r.getElementsByTagName("mesh")[0]);t.push(n)}return t},mt.parse.fromCollada._getMesh=function(e){for(var t={},i=e.getElementsByTagName("source"),r=t.sources={},n=0;n<i.length;n++){for(var o=i[n].getElementsByTagName("float_array")[0].textContent.split(" "),a=o.length-(o[o.length-1]==""?1:0),s=Array(a),l=0;l<a;l++)s[l]=parseFloat(o[l]);r[i[n].getAttribute("id")]=s}t.triangles=[];var c=e.getElementsByTagName("triangles");if(c==null)return t;for(var n=0;n<c.length;n++){var d={},u=c[n];d.material=u.getAttribute("material");for(var h=u.getElementsByTagName("input"),p=[],l=0;l<h.length;l++){var A=h[l],s=[];p[parseInt(A.getAttribute("offset"))]=s;var f=A.getAttribute("semantic");d["s_"+f]=f=="VERTEX"?e.getElementsByTagName("vertices")[0].getElementsByTagName("input")[0].getAttribute("source").substring(1):A.getAttribute("source").substring(1),d["i_"+f]=s,r[d["s_"+f]]}for(var m=u.getElementsByTagName("p")[0].textContent.split(" "),g=3*Math.floor(m.length/3),l=0;l<g;l++)p[l%h.length].push(parseInt(m[l]));t.triangles.push(d)}return t},mt.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},mt.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},mt.parse.fromCollada._libEffects=function(e){e=e.getElementsByTagName("effect");for(var t={},i=0;i<e.length;i++){for(var r={},n=e[i].getElementsByTagName("newparam"),o=0;o<n.length;o++){var a=n[o].getElementsByTagName("surface")[0];a&&(r.surface=a.getElementsByTagName("init_from")[0].textContent)}t[e[i].getAttribute("id")]=r}return t},mt.parse.from3DS=function(e){e=new Uint8Array(e);var t={};if(mt.bin.rsl(e,0)!=19789)return null;for(var i=mt.bin.ril(e,2),r=6;r<i;){var n=mt.bin.rsl(e,r),o=mt.bin.ril(e,r+2);n==15677&&(t.edit=mt.parse.from3DS._edit3ds(e,r,o)),n==45056&&(t.keyf=mt.parse.from3DS._keyf3ds(e,r,o)),r+=o}return t},mt.parse.from3DS._edit3ds=function(e,t,i){for(var r={},n=t+6;n<t+i;){var o=mt.bin.rsl(e,n),a=mt.bin.ril(e,n+2);o==16384&&(r.objects??=[],r.objects.push(mt.parse.from3DS._edit_object(e,n,a))),n+=a}return r},mt.parse.from3DS._keyf3ds=function(e,t,i){for(var r={},n=t+6;n<t+i;){var o=mt.bin.rsl(e,n),a=mt.bin.ril(e,n+2);o==45058&&(r.desc??=[],r.desc.push(mt.parse.from3DS._keyf_objdes(e,n,a))),n+=a}return r},mt.parse.from3DS._keyf_objdes=function(e,t,i){for(var r={},n=t+6;n<t+i;){var o=mt.bin.rsl(e,n),a=mt.bin.ril(e,n+2);o==45072&&(r.hierarchy=mt.parse.from3DS._keyf_objhierarch(e,n,a)),o==45073&&(r.dummy_name=mt.bin.rASCII0(e,n+6)),n+=a}return r},mt.parse.from3DS._keyf_objhierarch=function(e,t,i){var r={},n=t+6;return r.name=mt.bin.rASCII0(e,n),n+=r.name.length+1,r.hierarchy=mt.bin.rsl(e,n+4),r},mt.parse.from3DS._edit_object=function(e,t,i){var r={},n=t+6;for(r.name=mt.bin.rASCII0(e,n),n+=r.name.length+1;n<t+i;){var o=mt.bin.rsl(e,n),a=mt.bin.ril(e,n+2);o==16640&&(r.mesh=mt.parse.from3DS._obj_trimesh(e,n,a)),n+=a}return r},mt.parse.from3DS._obj_trimesh=function(e,t,i){for(var r={},n=t+6;n<t+i;){var o=mt.bin.rsl(e,n),a=mt.bin.ril(e,n+2);o==16656&&(r.vertices=mt.parse.from3DS._tri_vertexl(e,n,a)),o==16672&&(r.indices=mt.parse.from3DS._tri_facel1(e,n,a)),o==16704&&(r.uvt=mt.parse.from3DS._tri_mappingcoors(e,n,a)),o==16736&&(r.local=mt.parse.from3DS._tri_local(e,n,a)),n+=a}return r},mt.parse.from3DS._tri_vertexl=function(e,t,i){var r=[],n=t+6,o=mt.bin.rsl(e,n);n+=2;for(var a=0;a<o;a++)r.push(mt.bin.rf(e,n)),r.push(mt.bin.rf(e,n+4)),r.push(mt.bin.rf(e,n+8)),n+=12;return r},mt.parse.from3DS._tri_facel1=function(e,t,i){var r=[],n=t+6,o=mt.bin.rsl(e,n);n+=2;for(var a=0;a<o;a++)r.push(mt.bin.rsl(e,n)),r.push(mt.bin.rsl(e,n+2)),r.push(mt.bin.rsl(e,n+4)),n+=8;return r},mt.parse.from3DS._tri_mappingcoors=function(e,t,i){var r=[],n=t+6,o=mt.bin.rsl(e,n);n+=2;for(var a=0;a<o;a++)r.push(mt.bin.rf(e,n)),r.push(1-mt.bin.rf(e,n+4)),n+=8;return r},mt.parse.from3DS._tri_local=function(e,t,i){var r={},n=t+6;return r.X=[mt.bin.rf(e,n),mt.bin.rf(e,n+4),mt.bin.rf(e,n+8)],n+=12,r.Y=[mt.bin.rf(e,n),mt.bin.rf(e,n+4),mt.bin.rf(e,n+8)],n+=12,r.Z=[mt.bin.rf(e,n),mt.bin.rf(e,n+4),mt.bin.rf(e,n+8)],n+=12,r.C=[mt.bin.rf(e,n),mt.bin.rf(e,n+4),mt.bin.rf(e,n+8)],n+=12,r},mt.parse.fromBIV=function(e){e=new Uint8Array(e);var t={},i={};return i.id=mt.bin.ril(e,0),i.verS=mt.bin.ril(e,4),i.texS=mt.bin.ril(e,8),i.indS=mt.bin.ril(e,12),i.verO=mt.bin.ril(e,16),i.verL=mt.bin.ril(e,20),i.texO=mt.bin.ril(e,24),i.texL=mt.bin.ril(e,28),i.indO=mt.bin.ril(e,32),i.indL=mt.bin.ril(e,36),i.verO!=0&&(t.vertices=mt.parse.fromBIV._readFloats(e,i.verO,i.verL)),i.texO!=0&&(t.uvt=mt.parse.fromBIV._readFloats(e,i.texO,i.texL)),i.indO!=0&&(t.indices=mt.parse.fromBIV._readInts(e,i.indO,i.indL,i.indS)),t},mt.parse.toBIV=function(e){for(var t=0,i=0;i<e.indices.length;i++)t=Math.max(t,e.indices[i]);var r=32;t<=65535&&(r=16);var n=40;e.vertices&&(n+=e.vertices.length*4),e.uvt&&(n+=e.uvt.length*4),e.indices&&(n+=e.indices.length*r/8);var o=new Uint8Array(n);mt.bin.wil(o,0,1769365870),mt.bin.wil(o,4,32),mt.bin.wil(o,8,32),mt.bin.wil(o,12,r);var a=40;return e.vertices&&(mt.bin.wil(o,16,a),mt.bin.wil(o,20,4*e.vertices.length),mt.parse.fromBIV._writeFloats(o,a,e.vertices),a+=4*e.vertices.length),e.uvt&&(mt.bin.wil(o,24,a),mt.bin.wil(o,28,4*e.uvt.length),mt.parse.fromBIV._writeFloats(o,a,e.uvt),a+=4*e.uvt.length),e.indices&&(mt.bin.wil(o,32,a),mt.bin.wil(o,36,4*e.indices.length),mt.parse.fromBIV._writeInts(o,a,e.indices,r)),o.buffer},mt.parse.fromBIV._readFloats=function(e,t,i){for(var r=[],n=0;n<i/4;n++)r.push(mt.bin.rf(e,t+4*n));return r},mt.parse.fromBIV._writeFloats=function(e,t,i){for(var r=0;r<i.length;r++)mt.bin.wf(e,t+4*r,i[r])},mt.parse.fromBIV._readInts=function(e,t,i,r){for(var n=[],o=0;o<i/4;o++)r==16&&n.push(mt.bin.rsl(e,t+2*o)),r==32&&n.push(mt.bin.ril(e,t+4*o));return n},mt.parse.fromBIV._writeInts=function(e,t,i,r){for(var n=0;n<i.length;n++)r==16&&mt.bin.wsl(e,t+2*n,i[n]),r==32&&mt.bin.wil(e,t+4*n,i[n])},mt.gen={},mt.gen.Plane=function(e,t,i,r){i||=1,r||=1;for(var n={verts:[],inds:[],uvt:[]},o=e+1,a=t+1,s=0;s<a;s++)for(var l=0;l<o;l++){var c=-1+2/e*l,d=-1+2/t*s;n.verts.push(c,d,0),n.uvt.push(i*l/e,r*s/t),s<t&&l<e&&n.inds.push(s*o+l,s*o+l+1,(s+1)*o+l,s*o+l+1,(s+1)*o+l,(s+1)*o+l+1)}return n},mt.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]}},mt.gen.Sphere=function(e,t){var i={verts:[],inds:[],uvt:[]};2*Math.PI/e,Math.PI/t;for(var r=e+1,n=t+1,o=0;o<n;o++)for(var a=0;a<r;a++){var s=-Math.PI/2+o*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,o/t),o<t&&a<e&&i.inds.push(r*o+a,r*o+a+1,r*(o+1)+a,r*o+a+1,r*(o+1)+a,r*(o+1)+a+1)}return i},mt.mat={},mt.mat.scale=function(e,t,i){return[e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1]},mt.mat.translate=function(e,t,i){return[1,0,0,0,0,1,0,0,0,0,1,0,e,t,i,1]},mt.mat.rotateDeg=function(e,t,i){var r=Math.PI/180;return mt.mat.rotate(e*r,t*r,i*r)},mt.mat.rotate=function(e,t,i){var r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],n=e,o=t,a=i,s=Math.cos(n),l=Math.cos(o),c=Math.cos(a),d=Math.sin(n),u=Math.sin(o),h=Math.sin(a);return r[0]=l*c,r[1]=-l*h,r[2]=u,r[4]=s*h+d*u*c,r[5]=s*c-d*u*h,r[6]=-d*l,r[8]=d*h-s*u*c,r[9]=d*c+s*u*h,r[10]=s*l,r},mt.edit={},mt.edit.interpolate=function(e,t,i,r){for(var n=0;n<e.length;n++)i[n]=e[n]+r*(t[n]-e[n])},mt.edit.transform=function(e,t){for(var i=0;i<e.length;i+=3){var r=e[i],n=e[i+1],o=e[i+2];e[i+0]=t[0]*r+t[4]*n+t[8]*o+t[12],e[i+1]=t[1]*r+t[5]*n+t[9]*o+t[13],e[i+2]=t[2]*r+t[6]*n+t[10]*o+t[14]}},mt.edit.unwrap=function(e,t,i){for(var r=Array(Math.floor(e.length/3)*i),n=0;n<e.length;n++)for(var o=0;o<i;o++)r[n*i+o]=t[e[n]*i+o];return r},mt.edit.remap=function(e,t,i,r){for(var n=Array(i.length),o=0;o<e.length;o++)for(var a=0;a<r;a++)n[t[o]*r+a]=i[e[o]*r+a];return n},mt.utils={},mt.utils.getAABB=function(e){for(var t=i=r=999999999,i,r,n=o=a=-t,o,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>n&&(n=l),c<i&&(i=c),c>o&&(o=c),d<r&&(r=d),c>a&&(a=d)}return{min:{x:t,y:i,z:r},max:{x:n,y:o,z:a}}};function Dkt(e,t={}){return new Promise(function(i,r){t.src||(console.error("load3DSGeometry: Parameter expected: src"),r());var n=e.canvas.spinner;n.processes++,$t.loadArraybuffer(t.src,function(o){o.byteLength||(console.error("load3DSGeometry: no data loaded"),n.processes--,r());var a=mt.parse.from3DS(o).edit.objects[0].mesh,s=a.vertices,l=a.uvt,c=a.indices;n.processes--,i($t.apply(t,{primitive:"triangles",positions:s,normals:null,uv:l,indices:c}))},function(o){console.error("load3DSGeometry: "+o),n.processes--,r()})})}function Rkt(e,t={}){return new Promise(function(i,r){t.src||(console.error("loadOBJGeometry: Parameter expected: src"),r());var n=e.canvas.spinner;n.processes++,$t.loadArraybuffer(t.src,function(o){o.byteLength||(console.error("loadOBJGeometry: no data loaded"),n.processes--,r());for(var a=mt.parse.fromOBJ(o),s=mt.edit.unwrap(a.i_verts,a.c_verts,3),l=mt.edit.unwrap(a.i_norms,a.c_norms,3),c=mt.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;n.processes--,i($t.apply(t,{primitive:"triangles",positions:s,normals:l.length>0?l:null,autoNormals:l.length===0,uv:c,indices:d}))},function(o){console.error("loadOBJGeometry: "+o),n.processes--,r()})})}function cO(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 r=e.zSize||1;r<0&&(console.error("negative zSize not allowed - will invert"),r*=-1);let n=e.center,o=n?n[0]:0,a=n?n[1]:0,s=n?n[2]:0,l=-t+o,c=-i+a,d=-r+s,u=t+o,h=i+a,p=r+s;return $t.apply(e,{positions:[u,h,p,l,h,p,l,c,p,u,c,p,u,h,p,u,c,p,u,c,d,u,h,d,u,h,p,u,h,d,l,h,d,l,h,p,l,h,p,l,h,d,l,c,d,l,c,p,l,c,d,u,c,d,u,c,p,l,c,p,u,c,d,l,c,d,l,h,d,u,h,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 dO(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 r=e.zSize||1;r<0&&(console.error("negative zSize not allowed - will invert"),r*=-1);let n=e.center,o=n?n[0]:0,a=n?n[1]:0,s=n?n[2]:0,l=-t+o,c=-i+a,d=-r+s,u=t+o,h=i+a,p=r+s;return $t.apply(e,{primitive:"lines",positions:[l,c,d,l,c,p,l,h,d,l,h,p,u,c,d,u,c,p,u,h,d,u,h,p],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 Lkt(e={}){return dO({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 Uv(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 r=e.height||1;r<0&&(console.error("negative height not allowed - will invert"),r*=-1);let n=e.radialSegments||32;n<0&&(console.error("negative radialSegments not allowed - will invert"),n*=-1),n<3&&(n=3);let o=e.heightSegments||1;o<0&&(console.error("negative heightSegments not allowed - will invert"),o*=-1),o<1&&(o=1);let a=!!e.openEnded,s=e.center,l=s?s[0]:0,c=s?s[1]:0,d=s?s[2]:0,u=r/2,h=r/o,p=2*Math.PI/n,A=1/n,f=(t-i)/o,m=[],g=[],w=[],v=[],b,y,C,B,I,E,P,S,D,j,V,Q=(90-Math.atan(r/(i-t))*180/Math.PI)/90;for(b=0;b<=o;b++)for(I=t-b*f,E=u-b*h,y=0;y<=n;y++)C=Math.sin(y*p),B=Math.cos(y*p),g.push(I*C),g.push(Q),g.push(I*B),w.push(y*A),w.push(b*1/o),m.push(I*C+l),m.push(E+c),m.push(I*B+d);for(b=0;b<o;b++)for(y=0;y<=n;y++)P=b*(n+1)+y,S=P+n,v.push(P),v.push(S),v.push(S+1),v.push(P),v.push(S+1),v.push(P+1);if(!a&&t>0){for(D=m.length/3,g.push(0),g.push(1),g.push(0),w.push(.5),w.push(.5),m.push(0+l),m.push(u+c),m.push(0+d),y=0;y<=n;y++)C=Math.sin(y*p),B=Math.cos(y*p),j=.5*Math.sin(y*p)+.5,V=.5*Math.cos(y*p)+.5,g.push(t*C),g.push(1),g.push(t*B),w.push(j),w.push(V),m.push(t*C+l),m.push(u+c),m.push(t*B+d);for(y=0;y<n;y++)s=D,P=D+1+y,v.push(P),v.push(P+1),v.push(s)}if(!a&&i>0){for(D=m.length/3,g.push(0),g.push(-1),g.push(0),w.push(.5),w.push(.5),m.push(0+l),m.push(0-u+c),m.push(0+d),y=0;y<=n;y++)C=Math.sin(y*p),B=Math.cos(y*p),j=.5*Math.sin(y*p)+.5,V=.5*Math.cos(y*p)+.5,g.push(i*C),g.push(-1),g.push(i*B),w.push(j),w.push(V),m.push(i*C+l),m.push(0-u+c),m.push(i*B+d);for(y=0;y<n;y++)s=D,P=D+1+y,v.push(s),v.push(P+1),v.push(P)}return $t.apply(e,{positions:m,normals:g,uv:w,indices:v})}function i0e(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 r=t/i,n=t/2,o=[],a=[],s=0;for(let l=0,c=-n;l<=i;l++,c+=r)o.push(-n),o.push(0),o.push(c),o.push(n),o.push(0),o.push(c),o.push(c),o.push(0),o.push(-n),o.push(c),o.push(0),o.push(n),a.push(s++),a.push(s++),a.push(s++),a.push(s++);return $t.apply(e,{primitive:"lines",positions:o,indices:a})}function uO(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 r=e.xSegments||1;r<0&&(console.error("negative xSegments not allowed - will invert"),r*=-1),r<1&&(r=1);let n=e.xSegments||1;n<0&&(console.error("negative zSegments not allowed - will invert"),n*=-1),n<1&&(n=1);let o=e.center,a=o?o[0]:0,s=o?o[1]:0,l=o?o[2]:0,c=t/2,d=i/2,u=Math.floor(r)||1,h=Math.floor(n)||1,p=u+1,A=h+1,f=t/u,m=i/h,g=new Float32Array(p*A*3),w=new Float32Array(p*A*3),v=new Float32Array(p*A*2),b=0,y=0,C,B,I,E,P,S,D;for(C=0;C<A;C++){let V=C*m-d;for(B=0;B<p;B++)I=B*f-c,g[b]=I+a,g[b+1]=s,g[b+2]=-V+l,w[b+1]=1,v[y]=B/u,v[y+1]=(h-C)/h,b+=3,y+=2}b=0;let j=new(g.length/3>65535?Uint32Array:Uint16Array)(u*h*6);for(C=0;C<h;C++)for(B=0;B<u;B++)E=B+p*C,P=B+p*(C+1),S=B+1+p*(C+1),D=B+1+p*C,j[b]=D,j[b+1]=P,j[b+2]=E,j[b+3]=D,j[b+4]=S,j[b+5]=P,b+=6;return $t.apply(e,{positions:g,normals:w,uv:v,indices:j})}function Ov(e={}){let t=e.lod||1,i=e.center?e.center[0]:0,r=e.center?e.center[1]:0,n=e.center?e.center[2]:0,o=e.radius||1;o<0&&(console.error("negative radius not allowed - will invert"),o*=-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=[],h,p,A,f,m,g,w,v,b,y,C,B,I,E,P;for(h=0;h<=a;h++)for(A=h*Math.PI/a,f=Math.sin(A),m=Math.cos(A),p=0;p<=s;p++)g=p*2*Math.PI/s,w=Math.sin(g),v=Math.cos(g),b=v*f,y=m,C=w*f,B=1-p/s,I=h/a,c.push(b),c.push(y),c.push(C),d.push(B),d.push(I),l.push(i+o*b),l.push(r+o*y),l.push(n+o*C);for(h=0;h<a;h++)for(p=0;p<s;p++)E=h*(s+1)+p,P=E+s+1,u.push(E+1),u.push(P+1),u.push(P),u.push(E+1),u.push(P),u.push(E);return $t.apply(e,{positions:l,normals:c,uv:d,indices:u})}function hO(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 r=e.radialSegments||32;r<0&&(console.error("negative radialSegments not allowed - will invert"),r*=-1),r<4&&(r=4);let n=e.tubeSegments||24;n<0&&(console.error("negative tubeSegments not allowed - will invert"),n*=-1),n<4&&(n=4);let o=e.arc||Math.PI*2;o<0&&(console.warn("negative arc not allowed - will invert"),o*=-1),o>360&&(o=360);let a=e.center,s=a?a[0]:0,l=a?a[1]:0,c=a?a[2]:0,d=[],u=[],h=[],p=[],A,f,m,g,w,v,b,y;for(y=0;y<=n;y++)for(b=0;b<=r;b++)A=b/r*o,f=.785398+y/n*Math.PI*2,s=t*Math.cos(A),l=t*Math.sin(A),m=(t+i*Math.cos(f))*Math.cos(A),g=(t+i*Math.cos(f))*Math.sin(A),w=i*Math.sin(f),d.push(m+s),d.push(g+l),d.push(w+c),h.push(1-b/r),h.push(y/n),v=k.normalizeVec3(k.subVec3([m,g,w],[s,l,c],[]),[]),u.push(v[0]),u.push(v[1]),u.push(v[2]);let C,B,I,E;for(y=1;y<=n;y++)for(b=1;b<=r;b++)C=(r+1)*y+b-1,B=(r+1)*(y-1)+b-1,I=(r+1)*(y-1)+b,E=(r+1)*y+b,p.push(C),p.push(B),p.push(I),p.push(I),p.push(E),p.push(C);return $t.apply(e,{positions:d,normals:u,uv:h,indices:p})}var _kt={" ":{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 Hv(e={}){var t=e.origin||[0,0,0],i=t[0],r=t[1],n=t[2],o=e.size||1,a=[],s=[],l=e.text;$t.isNumeric(l)&&(l=""+l);for(var c=(l||"").split(`
1132
1132
  `),d=0,u=0,h,p,A,f,m=1/25,g,w,v,b,y,C=0;C<c.length;C++){h=0,p=c[C],A=p.length;for(var B=0;B<A;B++)if(f=_kt[p.charAt(B)],f){g=1,w=-1,v=-1,b=f.points.length;for(var I=0;I<b;I++){if(y=f.points[I],y[0]===-1&&y[1]===-1){g=1;continue}a.push(h+y[0]*o*m+i),a.push(u+y[1]*o*m+r),a.push(0+n),w===-1?w=d:(v===-1||(w=v),v=d),d++,g?g=!1:(s.push(w),s.push(v))}h+=f.width*m*o}u-=35*m*o}return $t.apply(e,{primitive:"lines",positions:a,indices:s})}function r0e(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 r=0;r<t-1;r++)i.push(r),i.push(r+1);return $t.apply(e,{primitive:"lines",positions:e.points,indices:i})}function Fkt(e={}){let t=e.curve.getPoints(e.divisions).map(i=>[...i]).flat();return r0e({id:e.id,points:t})}function n0e(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=[],r=e.startPoint[0],n=e.startPoint[1],o=e.startPoint[2],a=e.endPoint[0],s=e.endPoint[1],l=e.endPoint[2],c=Math.sqrt((a-r)**2+(s-n)**2+(l-o)**2),d=[(a-r)/c,(s-n)/c,(l-o)/c];if(!e.pattern)t.push(0),t.push(1),i.push(r,n,o,a,s,l);else{let u=e.pattern.length,h=!1,p=0,A=0,f=0,m=[r,n,o],g=e.pattern[A];for(i.push(m[0],m[1],m[2]);g<=c-p;){let w=[d[0]*g,d[1]*g,d[2]*g],v=[m[0]+w[0],m[1]+w[1],m[2]+w[2]];i.push(v[0],v[1],v[2]),h||(t.push(f),t.push(f+1)),h=!h,f+=1,m=v,A+=1,A>=u&&(A=0),p+=g,g=e.pattern[A]}e.extendToEnd&&(i.push(a,s,l),t.push(t.length-2),t.push(t.length-1))}return $t.apply(e,{primitive:"lines",positions:i,indices:t})}var _h=k.vec4(4),hb=k.vec4(),o0e=k.vec4(),a0e=k.vec3([1,0,0]),s0e=k.vec3([0,1,0]),l0e=k.vec3([0,0,1]),c0e=k.vec3(3),d0e=k.vec3(3),jkt=k.identityMat4(),pb=class extends Pr{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=k.vec3(),this._quaternion=k.identityQuaternion(),this._rotation=k.vec3(),this._position=k.vec3(),this._offset=k.vec3(),this._localMatrix=k.identityMat4(),this._worldMatrix=k.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 r=0,n=i.length;r<n;r++)this.addChild(i[r],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||=k.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,r=this._children.length;i<r;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,r=this._children.length;i<r;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)k.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||=k.AABB3(),this._buildAABB)this._buildAABB(this.worldMatrix,this._aabb);else{k.collapseAABB3(this._aabb);let e;for(let t=0,i=this._children.length;t<i;t++)e=this._children[t],e.collidable&&k.expandAABB3(this._aabb,e.aabb)}this._aabbDirty=!1}addChild(e,t){if($t.isNumeric(e)||$t.isString(e)){let i=e;if(e=this.scene.component[i],!e){this.warn("Component not found: "+$t.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($t.isNumeric(e)||$t.isString(e)){let t=e;if(e=this.scene.components[t],!e){this.warn("Node not found: "+$t.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]),k.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]),k.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||=k.identityMat4(),this._localMatrix.set(e||jkt),k.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||=k.identityMat4(),k.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 _h[0]=e[0],_h[1]=e[1],_h[2]=e[2],_h[3]=t*k.DEGTORAD,k.angleAxisToQuaternion(_h,hb),k.mulQuaternions(this.quaternion,hb,o0e),this.quaternion=o0e,this._setLocalMatrixDirty(),this._setAABBDirty(),this.glRedraw(),this}rotateOnWorldAxis(e,t){return _h[0]=e[0],_h[1]=e[1],_h[2]=e[2],_h[3]=t*k.DEGTORAD,k.angleAxisToQuaternion(_h,hb),k.mulQuaternions(hb,this.quaternion,hb),this}rotateX(e){return this.rotate(a0e,e)}rotateY(e){return this.rotate(s0e,e)}rotateZ(e){return this.rotate(l0e,e)}translate(e,t){return k.vec3ApplyQuaternion(this.quaternion,e,c0e),k.mulVec3Scalar(c0e,t,d0e),k.addVec3(this.position,d0e,this.position),this._setLocalMatrixDirty(),this._setAABBDirty(),this.glRedraw(),this}translateX(e){return this.translate(a0e,e)}translateY(e){return this.translate(s0e,e)}translateZ(e){return this.translate(l0e,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,r=e.length;i<r;i++)t=e[i],t.destroy()}this._children=[],this._setAABBDirty(),this.scene._aabbDirty=!0}},u0e=k.vec3(),uB=k.vec4(),In=(function(){let e=new Float64Array(16),t=new Float64Array(4),i=new Float64Array(4);return function(r,n,o){return o||=e,t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=1,k.transformVec4(r,t,i),k.setMat4Translation(r,i,o),o.slice()}})();function vg(e,t,i){let r=Float32Array.from([e[0]])[0],n=e[0]-r,o=Float32Array.from([e[1]])[0],a=e[1]-o,s=Float32Array.from([e[2]])[0],l=e[2]-s;t[0]=r,t[1]=o,t[2]=s,i[0]=n,i[1]=a,i[2]=l}function hB(e,t,i,r=1e3){let n=k.getPositionsCenter(e,u0e),o=Math.round(n[0]/r)*r,a=Math.round(n[1]/r)*r,s=Math.round(n[2]/r)*r;i[0]=o,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]-o,t[c+1]=e[c+1]-a,t[c+2]=e[c+2]-s;return l}function Ukt(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i}function sa(e,t,i,r,n){let o=n?(uB.set(i,0),uB[3]=1,k.mulMat4v4(n,uB,uB)):i,a=k.dotVec3(t,o)+e,s=k.normalizeVec3(t,u0e);return k.mulVec3Scalar(s,-a,r),r}var Hd=1e3,Fh=1001,pB=1002,pO=1003,h0e=1004,Okt=1004,Hkt=1005,AO=1005,rA=1006,qkt=1007,p0e=1007,Ab=1008,fO=1008,Nkt=1009,zkt=1010,Vkt=1011,Qkt=1012,Gkt=1013,Kkt=1014,Wkt=1015,Jkt=1016,Ykt=1017,Zkt=1018,Xkt=1020,$kt=1021,eBt=1022,A0e=1023,tBt=1024,iBt=1025,rBt=1026,nBt=1027,oBt=1028,aBt=1029,sBt=1030,lBt=1031,cBt=1033,f0e=33776,dBt=33777,uBt=33778,g0e=33779,m0e=35840,hBt=35841,v0e=35842,pBt=35843,w0e=36196,b0e=37492,y0e=37496,C0e=37808,ABt=37809,fBt=37810,gBt=37811,mBt=37812,vBt=37813,wBt=37814,bBt=37815,yBt=37816,CBt=37817,xBt=37818,kBt=37819,BBt=37820,EBt=37821,x0e=36492,wg=3e3,fb=3001,MBt=1e4,IBt=10001,PBt=10002,SBt=10003,TBt=function(e){e._material._state.type==="LambertMaterial"?(this.vertex=RBt(e),this.fragment=LBt(e)):(this.vertex=_Bt(e),this.fragment=FBt(e))},$1={};$1[wg]="linearToLinear",$1[fb]="sRGBToLinear";function k0e(e){if(!e.receivesShadow)return!1;let t=e.scene._lightsState.lights;if(!t||t.length===0)return!1;for(let i=0,r=t.length;i<r;i++)if(t[i].castsShadow)return!0;return!1}function DBt(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 B0e(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 RBt(e){let t=e.scene,i=e.scene._sectionPlanesState,r=e.scene._lightsState,n=e._geometry._state,o=e._state.billboard,a=e._state.stationary,s=i.getNumAllocatedSectionPlanes()>0,l=!!n.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;"),n.normalsBuf){c.push("in vec3 normal;"),c.push("uniform mat4 modelNormalMatrix;"),c.push("uniform mat4 viewNormalMatrix;");for(let d=0,u=r.lights.length;d<u;d++){let h=r.lights[d];h.type!=="ambient"&&(c.push("uniform vec4 lightColor"+d+";"),h.type==="dir"&&c.push("uniform vec3 lightDir"+d+";"),h.type==="point"&&c.push("uniform vec3 lightPos"+d+";"),h.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;"),n.primitiveName==="points"&&c.push("uniform float pointSize;"),(o==="spherical"||o==="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;"),o==="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;"),n.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;"),o==="spherical"||o==="cylindrical"?(c.push("mat4 modelViewMatrix = viewMatrix2 * modelMatrix2;"),c.push("billboard(modelMatrix2);"),c.push("billboard(viewMatrix2);"),c.push("billboard(modelViewMatrix);"),n.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; ")),n.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;"),n.normalsBuf)for(let d=0,u=r.lights.length;d<u;d++){let h=r.lights[d];if(h.type!=="ambient"){if(h.type==="dir")h.space==="view"?c.push("viewLightDir = normalize(lightDir"+d+");"):c.push("viewLightDir = normalize((viewMatrix2 * vec4(lightDir"+d+", 0.0)).xyz);");else if(h.type==="point")h.space==="view"?c.push("viewLightDir = -normalize(lightPos"+d+" - viewPosition.xyz);"):c.push("viewLightDir = -normalize((viewMatrix2 * vec4(lightPos"+d+", 0.0)).xyz);");else if(h.type==="spot")h.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;"),n.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 LBt(e){let t=e.scene,i=t._sectionPlanesState;e._material._state;let r=e._geometry._state,n=i.getNumAllocatedSectionPlanes()>0,o=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;")),n){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;"),o&&(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) {"),n){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 r.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;"),o?a.push("outColor = linearToGamma(vColor, gammaFactor);"):a.push("outColor = vColor;"),a.push("}"),a}function _Bt(e){let t=e.scene;e._material;let i=e._state,r=t._sectionPlanesState,n=e._geometry._state,o=t._lightsState,a,s=i.billboard,l=i.background,c=i.stationary,d=DBt(e),u=B0e(e),h=r.getNumAllocatedSectionPlanes()>0,p=k0e(e),A=!!n.compressGeometry,f=[];if(f.push("#version 300 es"),f.push("// Drawing vertex shader"),f.push("in vec3 position;"),A&&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;"),h&&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;")),o.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=o.lights.length;m<g;m++)a=o.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+";"));A&&(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;"),A&&f.push("uniform mat3 uvDecodeMatrix;")),n.colors&&(f.push("in vec4 color;"),f.push("out vec4 vColor;")),n.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("}")),p){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=o.lights.length;m<g;m++)o.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;"),A&&f.push("localPosition = positionsDecodeMatrix * localPosition;"),u&&(A?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; "),o.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=o.lights.length;m<g;m++)a=o.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&&(A?f.push("vUV = (uvDecodeMatrix * vec3(uv, 1.0)).xy;"):f.push("vUV = uv;")),n.colors&&f.push("vColor = color;"),n.primitiveName==="points"&&f.push("gl_PointSize = pointSize;"),h&&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;"),p){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=o.lights.length;m<g;m++)o.lights[m].castsShadow&&f.push("vShadowPosFromLight"+m+" = texUnitConverter * shadowProjMatrix"+m+" * (shadowViewMatrix"+m+" * worldPosition); ")}return f.push("}"),f}function FBt(e){let t=e.scene;t.canvas.gl;let i=e._material,r=e._geometry._state,n=e.scene._sectionPlanesState,o=e.scene._lightsState,a=e._material._state,s=n.getNumAllocatedSectionPlanes()>0,l=B0e(e),c=r.uvBuf,d=a.type==="PhongMaterial",u=a.type==="MetallicMaterial",h=a.type==="SpecularMaterial",p=k0e(e);t.gammaInput;let A=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;")),p&&(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("}"),A&&(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<n.getNumAllocatedSectionPlanes();m++)f.push("uniform bool sectionPlaneActive"+m+";"),f.push("uniform vec3 sectionPlanePos"+m+";"),f.push("uniform vec3 sectionPlaneDir"+m+";")}if(l&&(o.lightMaps.length>0&&(f.push("uniform samplerCube lightMap;"),f.push("uniform mat4 viewNormalMatrix;")),o.reflectionMaps.length>0&&f.push("uniform samplerCube reflectionMap;"),(o.lightMaps.length>0||o.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&&((o.lightMaps.length>0||o.reflectionMaps.length>0)&&(f.push("void computePhongLightMapping(const in Geometry geometry, const in Material material, inout ReflectedLight reflectedLight) {"),o.lightMaps.length>0&&(f.push(" vec3 irradiance = "+$1[o.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;")),o.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||h)&&(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("}"),o.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 = "+$1[o.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("}"),(o.lightMaps.length>0||o.reflectionMaps.length>0)&&(f.push("void computePBRLightMapping(const in Geometry geometry, const in Material material, inout ReflectedLight reflectedLight) {"),o.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;")),o.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;"),r.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&&(o.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,w=o.lights.length;g<w;g++){let v=o.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(p)for(let g=0,w=o.lights.length;g<w;g++)o.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<n.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(r.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);"),r.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];"),r.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 = "+$1[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 = "+$1[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 = "+$1[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 = "+$1[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&&(o.lights.length>0||o.lightMaps.length>0||o.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;")),h&&(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;"),o.lightMaps.length>0&&f.push("geometry.worldNormal = normalize(vWorldNormal);"),f.push("geometry.viewNormal = viewNormal;"),f.push("geometry.viewEyeDir = viewEyeDir;"),d&&(o.lightMaps.length>0||o.reflectionMaps.length>0)&&f.push("computePhongLightMapping(geometry, material, reflectedLight);"),(h||u)&&(o.lightMaps.length>0||o.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,w=o.lights.length;g<w;g++){let v=o.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);"),p&&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);"),(h||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;"),A&&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 E0e=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 r=i.split(`
1133
1133
  `),n=[];for(let o=0;o<r.length;o++)n.push(o+1+": "+r[o]+`
1134
1134
  `);this.errors=[],this.errors.push(""),this.errors.push(e.getShaderInfoLog(this.handle)),this.errors=this.errors.concat(n.join(""))}}destroy(){}},jBt=class{constructor(e,t){this.bindTexture=function(i,r){return i.bind(r)?(e.uniform1i(t,r),!0):!1}}},UBt=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))}},M0e=new Od({});function I0e(e){let t=[],i,r;for(let n=0,o=e.length;n<o;n++)i=e[n],r=i.indexOf("/"),r>0&&i.charAt(r+1)==="/"&&(i=i.substring(0,r)),t.push(i);return t.join(`
@@ -2612,7 +2612,7 @@ void main() {
2612
2612
  `},zoomImageTransform(){return`
2613
2613
  scale(${this.zoomFactor})
2614
2614
  translate(-${this.zoomX}px, -${this.zoomY}px)
2615
- `}},methods:{onMouseMove({offsetX:e,offsetY:t}){this.zoomX=e,this.zoomY=t}}},xai=["src"],kai=["src"];function Bai(e,t,i,r,n,o){return M(),q("div",{class:"preview-2d",onMouseenter:t[0]||=a=>n.hover=!0,onMouseleave:t[1]||=a=>n.hover=!1,onMousemove:t[2]||=(...a)=>o.onMouseMove&&o.onMouseMove(...a)},[x("img",{loading:"lazy",src:o.imgUrl},null,8,xai),ti(x("div",{class:"zoom",style:je({transform:o.zoomTransform})},[x("div",{class:"zoomImage",style:je({width:`${i.width}px`,height:`${i.height}px`,transform:o.zoomImageTransform})},[x("img",{loading:"lazy",src:o.imgUrl},null,8,kai)],4)],4),[[zi,n.hover]])],32)}var Eai=W(Cai,[["render",Bai],["__scopeId","data-v-b92f4cf9"]]),H6e=15,Mai={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(H6e*(1-e/this.width));t=Math.abs(t),t=Math.min(t,H6e),this.translation=(t-1)*this.viewportWidth}}},Iai=["src"];function Pai(e,t,i,r,n,o){return M(),q("div",{class:"preview-3d",onMousemove:t[0]||=(...a)=>o.onMouseMove&&o.onMouseMove(...a)},[x("div",{class:"viewport",style:je({width:`${o.viewportWidth}px`,height:`${i.height}px`})},[x("img",{loading:"lazy",src:i.previewUrl||i.defaultUrl,style:je({transform:`translateX(-${n.translation}px)`})},null,12,Iai)],4)],32)}var Sai={components:{Preview2D:Eai,Preview3D:W(Mai,[["render",Pai],["__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 Tai(e,t,i,r,n,o){return M(),ie(oo(o.previewComponent),Pl({class:"bimdata-model-preview",style:{width:`${i.width}px`,height:`${i.height}px`,backgroundColor:i.backgroundColor}},e.$props),null,16,["style"])}var Dai=W(Sai,[["render",Tai]]),Rai={class:"placeholder"},Lai={class:"list-item"},_ai={class:"count"},Fai=W({__name:"StoreySelector",props:{storeys:{type:Object,required:!0},storey:{type:Object,default:null}},emits:["storey-selected"],setup(e,{emit:t}){let i=e,r=De(null);return Qt([()=>i.storeys,()=>i.storey],([n,o])=>{(!o||n.some(a=>a.uuid===o.uuid)&&o.uuid!==r.value?.uuid)&&(r.value=o)},{immediate:!0}),(n,o)=>{let a=T("BIMDataIconStorey"),s=T("BIMDataTextbox"),l=T("BIMDataIconPlan"),c=T("BIMDataDropdownList");return M(),ie(c,{class:"storey-selector",width:"100%",list:e.storeys,elementKey:"uuid",closeOnElementClick:!0,onElementClick:o[0]||=d=>n.$emit("storey-selected",d)},{header:K(()=>[L(a,{size:"xs"}),x("span",Rai,ee(r.value?.name??n.$t("MetaBuildingStructure.StoreySelector.placeholder")),1)]),element:K(({element:d})=>[x("div",Lai,[L(s,{class:"text",text:d.name},null,8,["text"]),L(l,{size:"xs"}),x("span",_ai,ee(d.plans.length),1)])]),_:1},8,["list"])}}},[["__scopeId","data-v-49c78195"]]),jai={class:"photosphere-building"},Uai={class:"title"},Oai={class:"head"},Hai={class:"body"},qai={class:"loading"},q6e=W({__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,r=t,n=De(!1),o=De([]),a=De(null),s=ot(()=>a.value?.plans??[]),l=De(null);Qt(()=>i.model,async u=>{if(u)try{n.value=!0,o.value=await i.apiClient.modelApi.getStoreys(i.space.id,u.id,i.project.id),o.value.some(({uuid:h})=>a.value?.uuid===h)||(a.value=o.value[0]??null)}finally{n.value=!1}else o.value=[],a.value=null},{immediate:!0}),Qt(()=>i.storey,u=>{a.value=u},{immediate:!0}),Qt(()=>i.plan,u=>{l.value=u?.plan?.id},{immediate:!0});let c=u=>(a.value=u,r("storey-selected",u)),d=u=>r("plan-selected",u);return(u,h)=>{let p=T("BIMDataIconBuilding"),A=T("BIMDataRadio"),f=T("BIMDataFileIcon"),m=T("BIMDataTextbox"),g=T("BIMDataSpinner");return M(),q("div",jai,[x("div",Uai,[L(p,{size:"s"}),x("span",null,ee(u.$t("PhotosphereBuilding.title")),1)]),x("div",Oai,[L(Fai,{storeys:o.value,storey:a.value,onStoreySelected:c},null,8,["storeys","storey"])]),x("div",Hai,[(M(!0),q(It,null,pi(s.value,w=>(M(),q("div",{class:"list-item",key:w.plan.id},[e.selectable?(M(),ie(A,{key:0,value:w.plan.id,modelValue:l.value,"onUpdate:modelValue":[h[0]||=v=>l.value=v,v=>d(w)]},null,8,["value","modelValue","onUpdate:modelValue"])):xe("",!0),L(f,{fileName:w.plan.document?.file_name??w.plan.name,size:14},null,8,["fileName"]),L(m,{class:"text",text:w.plan.name},null,8,["text"])]))),128))]),L(Hr,{name:"fade"},{default:K(()=>[ti(x("div",qai,[L(g)],512),[[zi,n.value]])]),_:1})])}}},[["__scopeId","data-v-94317752"]]);function wz(e,t){return Array.isArray(e)?e=e.map(i=>wz(i,t)):(e.expandedRef=De(!0),e.parent=t,e.children=e.children?.map(i=>wz(i,e))??[]),e}function Nai(e,t,i){return[{id:1,text:e.name,component:"StructureRootNode",children:t.map(r=>zai(r,i))}]}var zai=(e,t)=>({id:e.uuid,text:e.name,component:"StoreyNode",children:e.plans?.map(i=>Vai(e,i))??[],storey:e}),Vai=(e,t)=>({id:t.plan.id,text:t.plan.name,component:"PlanNode",storey:e,plan:t}),Qai={class:"generic-tree-node"},Gai={class:"end"},$M=W({__name:"GenericTreeNode",props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},setup(e){return(t,i)=>{let r=T("BIMDataTextbox");return M(),q("div",Qai,[Yt(t.$slots,"icon",{},void 0,!0),L(r,{class:"text",text:e.node.text},null,8,["text"]),x("div",Gai,[Yt(t.$slots,"end",{},void 0,!0)])])}}},[["__scopeId","data-v-fab13549"]]),Kai={__name:"PlanNode",props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},emits:["delete-plan"],setup(e){let t=e,i=ot(()=>t.node.storey),r=ot(()=>t.node.plan);return(n,o)=>{let a=T("BIMDataFileIcon"),s=T("BIMDataIconDelete"),l=T("BIMDataButton");return M(),ie($M,yd(oh(n.$props)),{icon:K(()=>[L(a,{"file-name":r.value.plan.document?.file_name??r.value.plan.name,size:12},null,8,["file-name"])]),end:K(()=>[L(l,{width:"24px",height:"24px",color:"high",ghost:"",rounded:"",icon:"",onClick:o[0]||=c=>n.$emit("delete-plan",{storey:i.value,plan:r.value})},{default:K(()=>[L(s,{size:"xxs"})]),_:1})]),_:1},16)}}},Wai=W({__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,r=t,n=[{key:1,text:"BuildingMaker.view.addFile",icon:"plus",action:()=>(o.value=!1,r("add-plans",i.node.storey))},{key:2,text:"BIMDataComponents.t.rename",icon:"edit",action:()=>(o.value=!1,r("update-storey",i.node.storey)),divider:!0},{key:3,text:"BIMDataComponents.t.delete",icon:"delete",color:"var(--color-high)",action:()=>(o.value=!1,r("delete-storey",i.node.storey))}],o=De(!1);return(a,s)=>{let l=T("BIMDataIconStorey"),c=T("BIMDataIconEllipsis"),d=T("BIMDataButton"),u=T("BIMDataIcon"),h=T("BIMDataMenu");return M(),ie($M,Pl({class:"storey-node"},a.$props),{icon:K(()=>[L(l,{size:"xxs"})]),end:K(()=>[L(d,{width:"24px",height:"24px",color:"granite",ghost:"",rounded:"",icon:"",onClick:s[0]||=p=>o.value=!o.value},{default:K(()=>[L(c,{customSize:"24"})]),_:1}),L(Hr,{name:"fade"},{default:K(()=>[ti(L(h,{class:"storey-node__menu",menuItems:n,width:"180px"},{item:K(({item:p})=>[L(u,{name:p.icon,size:"xs",margin:"0 12px 0 0"},null,8,["name"]),x("span",null,ee(a.$t(p.text)),1)]),_:1},512),[[zi,o.value]])]),_:1})]),_:1},16)}}},[["__scopeId","data-v-a66bc7dd"]]),Jai={__name:"StructureRootNode",props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},emits:["create-storey"],setup(e){return(t,i)=>{let r=T("BIMDataIconBuilding"),n=T("BIMDataIconPlus"),o=T("BIMDataButton");return M(),ie($M,yd(oh(t.$props)),{icon:K(()=>[L(r,{size:"xs"})]),end:K(()=>[L(o,{width:"23px",height:"23px",color:"primary",fill:"",radius:"",icon:"",onClick:i[0]||=a=>t.$emit("create-storey")},{default:K(()=>[L(n,{size:"xxs"})]),_:1})]),_:1},16)}}},Yai={__name:"ZoneNode",props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},setup(e){return(t,i)=>{let r=T("BIMDataIconZone2");return M(),ie($M,yd(oh(t.$props)),{icon:K(()=>[L(r,{size:"xxs"})]),_:1},16)}}},Zai={class:"building-view"},Xai={key:0,class:"content"},$ai={key:1,class:"content"},esi={class:"building-view__tree"},tsi=W(Object.assign({components:{PlanNode:Kai,StoreyNode:Wai,StructureRootNode:Jai,ZoneNode:Yai}},{__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,r=Ot("service"),n=Ot("loading"),o=De(""),a=De(""),s=De(!1),l=De(!1),c=De([]),d=De(null),u=De([]),h=De([]),p=ot(()=>wz(Nai(i.model,c.value,h.value))),A=async()=>{try{n.value=!0,c.value=await r.fetchStoreys(i.model)}finally{n.value=!1}},f=async()=>{try{n.value=!0,h.value=await r.fetchZones(i.model)}finally{n.value=!1}},m=async I=>{await r.createStorey(i.model,I),A()},g=async I=>{await r.updateStorey(i.model,I),A()},w=async I=>{await r.deleteStorey(i.model,I),A()},v=I=>{d.value=I,l.value=!0},b=()=>{d.value=null,l.value=!1},y=I=>{o.value=i.apiClient.config.configuration.basePath,a.value=i.apiClient.accessToken,d.value=I,s.value=!0},C=async()=>{let I=[],E=[];for(let{document:S,pdfPage:D}of u.value)D?E.push(D):I.push(S);let P=(await r.createPlanModels(I)).concat(E);await r.createStoreyPlans(i.model,d.value,P),A(),u.value=[],d.value=null,s.value=!1},B=async({storey:I,plan:E})=>{await r.deleteStoreyPlan(i.model,I,E),A()};return Cr(()=>{A(),f()}),(I,E)=>{let P=T("BIMDataFileManager"),S=T("BIMDataButton"),D=T("BIMDataTree");return M(),q("div",Zai,[L(Hr,{name:"fade",mode:"out-in"},{default:K(()=>[s.value&&o.value&&a.value&&d.value?(M(),q("div",Xai,[L(P,{class:"building-view__dms",spaceId:e.space.id,projectId:e.project.id,apiUrl:o.value,archiveUrl:"",accessToken:a.value,locale:I.$i18n.locale,select:!0,pdfPageSelect:!0,multi:!0,headerButtons:!1,selectableFileTypes:Ft(ebe),onSelectionChange:E[0]||=j=>u.value=j},null,8,["spaceId","projectId","apiUrl","accessToken","locale","selectableFileTypes"]),L(S,{width:"100%",color:"primary",fill:"",radius:"",onClick:C},{default:K(()=>[wt(ee(I.$t("BIMDataComponents.t.validate")),1)]),_:1})])):(M(),q("div",$ai,[x("div",esi,[L(D,{data:p.value},{node:K(({node:j,depth:V})=>[(M(),ie(oo(j.component),{node:j,depth:V,onCreateStorey:v,onUpdateStorey:v,onDeleteStorey:w,onAddPlans:y,onDeletePlan:B},null,40,["node","depth"]))]),_:1},8,["data"])]),L(S,{width:"100%",color:"primary",fill:"",radius:"",onClick:E[1]||=j=>I.$emit("close")},{default:K(()=>[wt(ee(I.$t("BIMDataComponents.t.finish")),1)]),_:1}),L(Hr,{name:"fade"},{default:K(()=>[l.value?(M(),ie(rbe,{key:0,class:"building-view__form",storey:d.value,onCreateStorey:m,onUpdateStorey:g,onClose:b},null,8,["storey"])):xe("",!0)]),_:1})]))]),_:1})])}}}),[["__scopeId","data-v-5bedb26f"]]),isi={class:"bimdata-building-maker"},rsi=["src"],nsi={class:"bimdata-building-maker__body"},osi={class:"bimdata-building-maker__loader"},asi=W({__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,r=t,n=Object.freeze({FORM:"form",LIST:"list",VIEW:"view"}),o=$we(i.apiClient,i.space,i.project),a=De(!1);vn("service",o),vn("loading",a);let s=De(n.LIST),l=De([]),c=De(null),d=async()=>{a.value=!0,l.value=await o.fetchPhotosphereBuildings(),a.value=!1},u=async g=>{await o.deleteMetaBuilding(g),d(),r("metaBuilding-deleted")},h=g=>{c.value=g??null,s.value=n.FORM},p=g=>{c.value=g,s.value=n.VIEW},A=async g=>{await d(),p(g),r("metaBuilding-created")},f=()=>{d(),s.value=n.LIST,r("metaBuilding-updated")},m=()=>{s.value=n.LIST};return Qt(()=>i.model,g=>{g&&p(g)},{immediate:!0}),Cr(()=>d()),(g,w)=>{let v=T("BIMDataIconArrow"),b=T("BIMDataButton"),y=T("BIMDataSpinner");return M(),q("div",isi,[x("div",{class:"bimdata-building-maker__header",style:je({visibility:s.value===Ft(n).LIST?"hidden":"visible"})},[L(b,{class:"bimdata-building-maker__header__btn-back",ghost:"",radius:"",disabled:a.value.value,onClick:m},{default:K(()=>[L(v,{size:"xxs",margin:"0 6px 0 0"}),x("span",null,ee(g.$t("BIMDataComponents.t.back")),1)]),_:1},8,["disabled"]),x("img",{src:Ft(M6)},null,8,rsi),x("span",null,ee(g.$t("PhotosphereBuilding.title")),1)],4),x("div",nsi,[L(Hr,{name:"fade",mode:"out-in"},{default:K(()=>[s.value===Ft(n).FORM?(M(),ie(tbe,{key:0,type:Ft(HN).PHOTOSPHERE_BUILDING,metaBuilding:c.value,onMetaBuildingCreated:A,onMetaBuildingUpdated:f},null,8,["type","metaBuilding"])):s.value===Ft(n).VIEW&&c.value?(M(),ie(tsi,{key:1,apiClient:e.apiClient,space:e.space,project:e.project,model:c.value,onClose:m},null,8,["apiClient","space","project","model"])):(M(),ie(ibe,{key:2,metaBuildings:l.value,onOpenMetaBuilding:p,onCreateMetaBuilding:h,onUpdateMetaBuilding:h,onDeleteMetaBuilding:u},null,8,["metaBuildings"]))]),_:1})]),L(Hr,{name:"fade"},{default:K(()=>[ti(x("div",osi,[L(y)],512),[[zi,a.value]])]),_:1})])}}},[["__scopeId","data-v-235bd404"]]),ssi={class:"overlay"},lsi={class:"safe-zone__icon"},csi={class:"safe-zone__title"},dsi={class:"safe-zone__text"},usi={class:"safe-zone__actions"},hsi=W({__name:"BIMDataSafeZoneModal",props:{width:{type:String,default:"350px"},iconName:{type:String,default:"warning"}},setup(e){return(t,i)=>{let r=T("BIMDataIcon");return M(),q("div",ssi,[x("div",{class:"safe-zone",style:je({width:e.width})},[x("div",lsi,[L(r,{name:e.iconName,size:"s",fill:"",color:"high"},null,8,["name"])]),x("h2",csi,[Yt(t.$slots,"title",{},void 0,!0)]),x("div",dsi,[Yt(t.$slots,"text",{},void 0,!0)]),x("div",usi,[Yt(t.$slots,"actions",{},void 0,!0)])],4)])}}},[["__scopeId","data-v-01a25253"]]),psi=bo({BIMDataBuildingMaker:()=>nbe,BIMDataFileManager:()=>Toi,BIMDataGuidedTour:()=>Zoi,BIMDataMetaBuildingStructure:()=>O6e,BIMDataModelPreview:()=>Dai,BIMDataPDFViewer:()=>I6e,BIMDataPhotosphereBuilding:()=>q6e,BIMDataPhotosphereBuildingMaker:()=>asi,BIMDataSafeZoneModal:()=>hsi}),Asi={name:"buildingMaker",component:{setup(){let{apiClient:e,cloudId:t,projectId:i}=Ot("$viewer").api;return()=>ao(nbe,{apiClient:e,space:{id:t},project:{id:i}})}},window:{name:"buildingMaker",label:"Building Maker",noModel:!0,icon:{imgUri:M6}}},fsi={components:{BIMDataNumericalInput:Pfe},setup(){let e=Ot("$viewer"),t=Ot("viewerPlan"),i=Ot("root"),r=Ot("close"),n=ot(()=>i.editedBitmap?.plan),o=ot(()=>i.editedBitmap?i.editedBitmap:{x:0,y:0,scale:0,angle:0,opacity:0}),a=gsi(o),{x:s,y:l,angle:c,scale:d}=a,u,h,p=new Map;return Qt(n,(f,m)=>{m&&p.set(m.key,u),f||p.clear(),u=p.get(f?.key)??null,h=null}),Qt([s,l,c,d],()=>{n.value&&(u||=n.value.plan.transform,h={translate:[s.value,l.value],rotate:c.value,scale:d.value},t.planObjectRegistry.updatePlanObjectsTransform(n.value,{oldTransform:u,newTransform:h}),u=h)}),{root:i,bitmap:o,...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:w,angle:v,opacity:b,plan:y}=f,C={...y.plan.transform},B={translate:[m,g],rotate:v,scale:w,opacity:b};t.planObjectRegistry.updatePlanObjectsTransform(y,{oldTransform:B,newTransform:C}),y.plan.transform||(y.plan.transform={}),Object.assign(y.plan.transform,B),await e.state.updatePlan(y,C),f.edited=!1}))}catch(f){console.error(f)}finally{i.loading=!1,r()}}}}};function gsi(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,r])=>{t[i]=ot({get:()=>e.value[i],set:n=>e.value[i]=r(n)})}),t}var msi={class:"synchronization__page__edit"},vsi={class:"synchronization__page__edit__content"},wsi={class:"synchronization__page__edit__content__unit-group"},bsi={class:"synchronization__page__edit__content__unit-group__element"},ysi={class:"synchronization__page__edit__content__unit-group__element"},Csi={class:"synchronization__page__edit__content__unit-group__element"},xsi={class:"synchronization__page__edit__content__unit"},ksi={class:"synchronization__page__edit__content__unit"},Bsi={class:"synchronization__page__edit__content__img"},Esi=["src"],Msi={class:"synchronization__page__edit__validate"};function Isi(e,t,i,r,n,o){let a=T("BIMDataNumericalInput"),s=T("BIMDataSlider"),l=T("BIMDataTextbox"),c=T("BIMDataButton");return M(),q("div",msi,[x("div",vsi,[x("section",null,[x("span",null,ee(e.$t("synchronization.location")),1),x("div",wsi,[x("div",bsi,[L(a,{modelValue:e.x,"onUpdate:modelValue":t[0]||=d=>e.x=d,label:"X",container:e.$viewer.localContext.el},null,8,["modelValue","container"])]),x("div",ysi,[L(a,{modelValue:e.y,"onUpdate:modelValue":t[1]||=d=>e.y=d,label:"Y",container:e.$viewer.localContext.el},null,8,["modelValue","container"])]),x("div",Csi,[L(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"])])])]),x("section",null,[x("span",null,ee(e.$t("synchronization.rotation")),1),x("div",xsi,[L(a,{modelValue:e.angle,"onUpdate:modelValue":t[3]||=d=>e.angle=d,unit:"\xB0",centered:""},null,8,["modelValue"]),L(s,{modelValue:e.angle,"onUpdate:modelValue":t[4]||=d=>e.angle=d,min:0,max:360},null,8,["modelValue"])])]),x("section",null,[x("span",null,ee(e.$t("synchronization.alpha")),1),x("div",ksi,[L(a,{modelValue:e.opacity,"onUpdate:modelValue":t[5]||=d=>e.opacity=d,centered:""},null,8,["modelValue"]),L(s,{modelValue:e.opacity,"onUpdate:modelValue":t[6]||=d=>e.opacity=d,min:0,max:1,step:.01},null,8,["modelValue"])])]),x("section",null,[x("span",null,ee(e.$t("synchronization.preview")),1),x("div",Bsi,[x("img",{src:r.bitmap.dataUrl,alt:"Background"},null,8,Esi),L(l,{text:r.bitmap.name,class:"synchronization__page__edit__content__img__name"},null,8,["text"])])])]),x("div",Msi,[L(c,{width:"100%",color:"primary",fill:"",radius:"",onClick:r.submit},{default:K(()=>[wt(ee(r.bitmap&&r.bitmap.plan?e.$t("global.save"):e.$t("global.validate")),1)]),_:1},8,["onClick"])])])}var Psi={name:"BimdataSynchronization",components:{edit:W(fsi,[["render",Isi],["__scopeId","data-v-63e956d5"]])},setup(){let{localContext:e}=Ot("$viewer"),t=Ot("$plugin"),i=e.pluginComponentInstances.get("plan");if(!i)throw Error("[Synchronization] plugin cannot work without viewerPlan plugin with 2d engine on.");i=os(i),vn("viewerPlan",i);let r=ot(()=>e.loadedModels[0]);Qt(r,p=>{!p||p.type!=="METABUILDING"?t.hide():t.show()},{immediate:!0}),Qt(()=>t.shown,p=>{r.value?.type!=="METABUILDING"&&p&&t.hide()});let n=Ma({page:"edit",loading:!1,modalDisplayed:!1,model:null,storeys:[],selectedStorey:null,plans:[],bitmaps:[],editedBitmap:null});vn("root",n);let o=()=>{n.editedBitmap&&(n.bitmaps.map(p=>(p.edit(!1),p)).filter(p=>p.edited).forEach(p=>{let{x:A,y:f,scale:m,angle:g,plan:w}=p,v=w.plan.transform,b={translate:[A,f],rotate:g,scale:m};i.planObjectRegistry.updatePlanObjectsTransform(w,{oldTransform:b,newTransform:v}),p.reset()}),n.modalDisplayed=!1,i.storeyRightOffset=0,e.showUI(),document.removeEventListener("keydown",d),n.editedBitmap=null,n.bitmaps=[])},a=()=>{o(),t.close()};vn("close",a);let s=()=>{n.bitmaps.some(p=>p.edited)?n.modalDisplayed=!0:a()},l=()=>{a()},c=p=>{n.editedBitmap=p},d=p=>{n.loading||p.key==="Escape"&&(p.preventDefault(),n.modalDisplayed?n.modalDisplayed=!1:a())},u=e.hub.on("model-loaded",({model:p})=>{n.model=p,n.storeys=p.storeys,n.plans=p.storeys.flatMap(A=>A.plans)},{getLastEvent:!0}),h=e.hub.on("storey-selected",({storey:p})=>{n.selectedStorey=p,(!p||p.plans.length<2)&&a()},{getLastEvent:!0});return Yr(()=>{e.hub.off(u),e.hub.off(h)}),Qt(()=>n.editedBitmap,(p,A)=>{A?.edit(!1),p?.edit(!0)},{immediate:!0}),{viewerPlan:i,root:n,onBitmapClick:c,onCloseClick:s,onLeaveClick:l,onKeyDown:d,clean:o}},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()}},Ssi={class:"bimdata-synchronization"},Tsi={class:"bimdata-synchronization__header"},Dsi={class:"bimdata-synchronization__header__top"},Rsi={class:"bimdata-synchronization__header__top__title"},Lsi={class:"bimdata-synchronization__header__top__title__text"},_si={class:"bimdata-synchronization__header__select__header"},Fsi={class:"bimdata-info-length bimdata-synchronization__header__select__header__length"},jsi={class:"bimdata-synchronization__page"},Usi={key:1,class:"bimdata-synchronization__modal"},Osi={class:"bimdata-synchronization__modal__content"},Hsi={class:"bimdata-synchronization__modal__content__symbols"},qsi={class:"bimdata-synchronization__modal__content__buttons"};function Nsi(e,t,i,r,n,o){let a=T("BIMDataLoading"),s=T("BIMDataIconSynchro2D"),l=T("BIMDataIconClose"),c=T("BIMDataButton"),d=T("BIMDataTextbox"),u=T("BIMDataDropdownList"),h=T("BIMDataIconWarning");return M(),q("div",Ssi,[r.root.loading?(M(),ie(a,{key:0})):xe("",!0),x("div",Tsi,[x("div",Dsi,[x("div",Rsi,[L(s,{size:"xs",fill:"",color:"primary"}),x("span",Lsi,ee(e.$t("synchronization.title")),1)]),L(c,{class:"bimdata-synchronization__header__top__close",width:"25px",height:"25px",ghost:"",radius:"",icon:"",onClick:r.onCloseClick},{default:K(()=>[L(l,{size:"xs",fill:"",color:"granite-light"})]),_:1},8,["onClick"])]),x("div",null,[L(u,{width:"100%",list:r.root.bitmaps,"element-key":"id","per-page":30,"close-on-element-click":!0,class:"bimdata-synchronization__header__select",onElementClick:r.onBitmapClick},{header:K(()=>[x("div",_si,[x("div",Fsi,[x("span",null,ee(r.root.bitmaps.length),1)]),x("div",null,[L(d,{width:"265px",text:r.root.editedBitmap?.name},null,8,["text"])])])]),element:K(({element:p})=>[x("div",{class:Ue(["bimdata-synchronization__header__select__element",{"bimdata-synchronization__header__select__element--selected":p===r.root.editedBitmap}])},ee(p.name),3)]),_:1},8,["list","onElementClick"])])]),x("div",jsi,[(M(),ie(A7,null,[(M(),ie(oo(r.root.page)))],1024))]),r.root.modalDisplayed?(M(),q("div",Usi,[x("div",Osi,[x("div",Hsi,[L(h,{fill:"",color:"high",size:"l"}),x("div",null,ee(e.$t("synchronization.warning")),1)]),x("div",qsi,[L(c,{width:"45%",color:"high",fill:"",radius:"",onClick:r.onLeaveClick},{default:K(()=>[wt(ee(e.$t("synchronization.leave")),1)]),_:1},8,["onClick"]),L(c,{width:"45%",color:"default",outline:"",radius:"",onClick:t[0]||=p=>r.root.modalDisplayed=!1},{default:K(()=>[wt(ee(e.$t("synchronization.stay")),1)]),_:1})])])])):xe("",!0)])}var zsi={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:W(Psi,[["render",Nsi],["__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"}}},Vsi={name:"anchor-synchronization",i18n:{de:Dfe,en:Rfe,es:Lfe,fr:_fe,it:Ffe},addToWindows:["2d"],component:Tfe,anchorSynchronization:!0,button:{tooltip:"anchor-synchronization.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"}}},Qsi={},Gsi={width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ksi(e,t){return M(),q("svg",Gsi,[...t[0]||=[Ts('<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 Wsi=W(Qsi,[["render",Ksi]]),Jsi={class:"bimdata-anchor-synchronization__header"},Ysi={class:"bimdata-anchor-synchronization__header__texts"},Zsi={class:"bimdata-anchor-synchronization__header__texts__title"},Xsi={class:"bimdata-anchor-synchronization__header__buttons"},$si=W({__name:"AnchorSynchronizationHeader",setup(e){let t=Ot("$viewer"),i=Ot("state"),r=Ot("service"),n=ot(()=>i.allAnchorsValidated),o=De(!1),a=null;t.globalContext.hub.once("anchor-synchronization:open",(c=null)=>{a=c},{getLastEvent:!0});let s=()=>{t.globalContext.layout=a},l=async()=>{o.value=!0,await r.saveAnchors(),t.globalContext.layout=a};return(c,d)=>{let u=T("BIMDataButton"),h=T("BIMDataSpinner");return M(),q("div",Jsi,[x("div",Ysi,[L(Wsi,{class:"m-x-6"}),x("span",Zsi,ee(c.$t("anchor-synchronization-window.title")),1)]),x("div",Xsi,[L(u,{color:"high",fill:"",radius:"",class:"m-x-6",width:"120px",onClick:s},{default:K(()=>[wt(ee(c.$t("global.cancel")),1)]),_:1}),L(u,{color:"primary",fill:"",radius:"",class:"m-x-6",width:"120px",disabled:!n.value,onClick:l},{default:K(()=>[o.value?(M(),ie(h,{key:0})):(M(),q(It,{key:1},[wt(ee(c.$t("global.done")),1)],64))]),_:1},8,["disabled"])])])}}},[["__scopeId","data-v-a7ce6c34"]]),eli={class:"anchor-content"},tli={class:"anchor-label"},eI={__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,r={x:i.isSecondAnchor?"70px":"20px",y:"90%"},n=ot(()=>i.position?{x:i.position.x+"px",y:i.position.y+"px"}:r),o=t,a=De(!1),s=De(null);function l(u){a.value=!0,s.value?.setPointerCapture(u.pointerId),u.preventDefault()}function c(u){if(!a.value)return;let h=i.position;if(!h){let{x:p,y:A}=s.value.getBoundingClientRect(),{x:f,y:m}=s.value.parentElement.getBoundingClientRect();h={x:p-f+15,y:A-m+51}}o("change",{x:h.x+u.movementX,y:h.y+u.movementY})}function d(u){a.value&&s.value&&s.value?.releasePointerCapture(u.pointerId),a.value=!1,o("validate")}return Yr(()=>{a.value=!1}),(u,h)=>(M(),q("div",{class:"bimdata-anchor-synchronization__anchor",style:je({left:n.value.x,top:n.value.y,color:e.color,cursor:a.value?"none":"grab"}),onPointerdown:l,onPointermove:c,onPointerup:d,ref_key:"anchorElement",ref:s},[x("div",eli,[h[0]||=x("svg",{width:"30",height:"60",viewBox:"0 0 30 60",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[x("rect",{x:"14",y:"42",width:"2",height:"18",fill:"currentColor"}),x("rect",{x:"24",y:"50",width:"2",height:"18",transform:"rotate(90 24 50)",fill:"currentColor"}),x("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),x("div",tli,ee(e.isSecondAnchor?2:1),1)])],36))}},N6e=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2}),z6e=(e,t)=>Math.hypot(t.x-e.x,t.y-e.y),V6e=(e,t)=>Math.atan2(t.y-e.y,t.x-e.x),ili=(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 Q6e(e){let{anchorA1Position:t,anchorA2Position:i,anchorB1Position:r,anchorB2Position:n,model:o,modelToSynchronize:a}=e;if(!o||!a)throw Error("[BIMDataViewer - AnchorSynchronization] Models are mandatory to calculate transform.");let{translate:s,rotate:l,scale:c}=a.transform??Pie.IDENTITY,d=z6e(t,i)/z6e(r,n)*c,u=V6e(t,i),h=(V6e(r,n)-u)*(180/Math.PI)*-1,p=l+h,A=N6e(t,i),f=N6e(r,n),m=ili({x:f.x-s[0],y:f.y-s[1]},h*Math.PI/180),g={x:m.x/c*d,y:m.y/c*d};return{scale:d,rotate:p,translate:[A.x-g.x,A.y-g.y,0]}}var rli={class:"bimdata-viewer-ifc-2d",ref:"canvasContainer"},nli=W({__name:"ViewerIfc2D",props:{model:{type:Object,default:null},storeyIndex:{type:Number,default:0}},emits:["camera-update"],setup(e,{expose:t,emit:i}){let r=e,n=i,o=Ot("$viewer"),a=Ot("state"),s=De(null),l=null,c=null,d=null,{promise:u,resolve:h,reject:p}=Promise.withResolvers(),A=()=>{c=y2({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:w}=c;w.on("update",()=>{n("camera-update",w)});let v={engine:c,viewer:c,$viewer:o};l=Gk(v),d=new zU(v)};Cr(()=>{try{A()}catch(w){p(w)}h()});let f=(w,v)=>{let b=w.storeys[v];if(!b)return;let y=b.objects.map(C=>String(C.id));c.scene.showObjects(y)},m=async w=>{await u,await l(w.map_file,w.id);let v=c.scene.objects.map(b=>b.id);if(c.scene.hideObjects(v),f(w,r.storeyIndex),w.recommanded_2d_angle!==void 0){let b=c.camera.rotation;c.camera.rotate(-b-w.recommanded_2d_angle)}c.camera.fitView()};Qt(()=>r.model,async w=>{w&&await m(w)},{immediate:!0});let g=!1;return t({getWorldPosition(w){return c.camera.getPosition(w)},get canvas(){return s.value},async showPlan(w){if(g)return;let v=await d.showPlan(w),b=v.mask?.crop_path,y={opacity:.5,crop_path:b};v.tempMask=y,g=!0;let C={translate:[v.x,v.y],scale:v.scale,rotate:v.angle},{anchorA1Position:B,anchorA2Position:I,anchorB1Position:E,anchorB2Position:P}=N4(a);Qt([B,I,E,P],()=>{let S=Q6e(a);b?.length>0&&(y.crop_path=Y5(Y5(b,C,{inverse:!0}),S)),v.x=S.translate[0],v.y=S.translate[1],v.scale=S.scale,v.angle=S.rotate},{immediate:!0})}}),(w,v)=>(M(),q("div",rli,[x("canvas",{ref_key:"canvasElement",ref:s,style:{width:"100%",height:"100%",position:"absolute"}},null,512)],512))}},[["__scopeId","data-v-c0725497"]]),oli={__name:"ViewerImage",props:{model:{type:Object,default:null}},emits:["camera-update"],setup(e,{expose:t,emit:i}){let r=e,n=i,o=()=>{let{camera:d}=a.value.viewer;d.on("update",()=>{n("camera-update",d)})},a=De(null),{promise:s,resolve:l}=Promise.withResolvers();Qt(()=>r.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}),Cr(()=>{l()});let c=$o({get loadedModels(){return r.model?[r.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)=>(M(),ie(Ng,{ref_key:"viewerPlan",ref:a,stateContext:c,onMounted:o},null,8,["stateContext"]))}},ali={class:"bimdata-anchor-synchronization__viewer"},sli={class:"viewer-container-A"},lli={class:"viewer-container-B"},cli=W({__name:"AnchorSynchronizationViewer",setup(e,{expose:t}){let i=De(null),r=De(null),n=Ot("state"),o=(b,y)=>{y.preventDefault();let C=b==="A"?i.value:r.value;C&&XU(C.canvas)(y)},a=De(null),s=De(null),l=De(null),c=De(null),d={anchorA1Position:a,anchorA2Position:s,anchorB1Position:l,anchorB2Position:c},u=(b,y)=>{(b==="A"?["anchorA1Position","anchorA2Position"].filter(C=>d[C].value!==null):["anchorB1Position","anchorB2Position"].filter(C=>d[C].value!==null)).forEach(C=>{let B=n[C];d[C].value=y.getCanvasPosition(B)})},h=(b,y)=>{let C=b.startsWith("A")?i.value:r.value,B=`anchor${b}Position`;n[B]=C.getWorldPosition(y),d[B].value=y},p=Lr(null),A=De(0),f=Lr(null),m=Qt(()=>n.allAnchorsValidated,b=>{if(!b)return;let y={plan:f.value,storey:{}};i.value.showPlan(y),m()}),g=b=>{if(!b)return null;let y=b.type;switch(y){case"IFC":return nli;case"PNG":case"JPEG":case"PDF":case"PHOTOSPHERE":return oli;default:throw Error(`[BIMData AnchorSynchronizationViewer] Unsupported model type: ${y}`)}},w=async(b,y,C)=>{p.value=b;let B=b.storeys.findIndex(I=>I.uuid===y.uuid);if(B===-1)throw Error("[BIMData AnchorSynchronizationViewer] Storey not found in main model.");A.value=B,f.value=C},v=()=>{n.allAnchorsValidated||a.value&&s.value&&l.value&&c.value&&(n.allAnchorsValidated=!0)};return t({synchronize:w}),(b,y)=>(M(),q("div",ali,[x("div",sli,[(M(),ie(oo(g(p.value)??"div"),{model:p.value,ref_key:"viewerA",ref:i,onCameraUpdate:y[0]||=C=>u("A",C),storeyIndex:A.value},null,40,["model","storeyIndex"])),p.value?(M(),q(It,{key:0},[L(eI,{onChange:y[1]||=C=>h("A1",C),onValidate:v,position:a.value,onWheel:y[2]||=C=>o("A",C)},null,8,["position"]),L(eI,{onChange:y[3]||=C=>h("A2",C),onValidate:v,position:s.value,onWheel:y[4]||=C=>o("A",C),isSecondAnchor:!0},null,8,["position"])],64)):xe("",!0)]),x("div",lli,[(M(),ie(oo(g(f.value)??"div"),{model:f.value,ref_key:"viewerB",ref:r,onCameraUpdate:y[5]||=C=>u("B",C)},null,40,["model"])),f.value?(M(),q(It,{key:0},[L(eI,{onChange:y[6]||=C=>h("B1",C),onValidate:v,position:l.value,onWheel:y[7]||=C=>o("B",C)},null,8,["position"]),L(eI,{onChange:y[8]||=C=>h("B2",C),onValidate:v,position:c.value,onWheel:y[9]||=C=>o("B",C),isSecondAnchor:!0},null,8,["position"])],64)):xe("",!0)])]))}},[["__scopeId","data-v-3947e679"]]),dli=class{state;$viewer;constructor(e,t){this.$viewer=e,this.state=t}async saveAnchors(){let{state:e}=this.$viewer,{model:t,storey:i,modelToSynchronize:r}=this.state;if(!t||!r||!i)throw Error("[BIMDataViewer - AnchorSynchronization] Models and storey are mandatory to save anchors.");let n=Q6e(this.state),o=i.plans.find(a=>a.plan.id===r.id);try{if(o){let a={...r.transform};o.plan.transform=n,await e.updatePlan(o,a)}else await e.createPlan(t,i,r.document,n)}catch(a){throw console.error("[BIMDataViewer - Anchor Synchronization Service] Failed to save anchors:",a),a}}},uli=class{model=null;storey=null;modelToSynchronize=null;anchorA1Position=null;anchorA2Position=null;anchorB1Position=null;anchorB2Position=null;allAnchorsValidated=!1;constructor(){return $o(this)}},hli={components:{AnchorSynchronizationHeader:$si,AnchorSynchronizationViewer:cli},setup(){let e=De(null),t=new uli;return vn("state",t),vn("service",new dli(Ot("$viewer"),t)),{viewer:e,synchronize:(i,r,n)=>(t.model=i,t.storey=r,t.modelToSynchronize=n,e.value.synchronize(i,r,n)),positioned:De(!1)}}},pli={class:"bimdata-anchor-synchronization"};function Ali(e,t,i,r,n,o){let a=T("AnchorSynchronizationHeader"),s=T("AnchorSynchronizationViewer");return M(),q("div",pli,[L(a,{valid:r.positioned},null,8,["valid"]),L(s,{class:"bimdata-anchor-synchronization__content__viewer",ref:"viewer",onPositioned:t[0]||=l=>r.positioned=!0})])}var fli={name:"anchor-synchronization-window",i18n:{en:{title:"Synchronization"},fr:{title:"Synchronisation"}},component:W(hli,[["render",Ali],["__scopeId","data-v-7f15ad3b"]]),window:{name:"anchor-synchronization",header:!1,displayedInWindowSelector:!1,multiModel:!1}},gli={name:"PointCloudViewer",components:{Annotations:U5e},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=kA},mounted(){let e=new b3e({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 rM(e,{originatingSystem:"BIMDataViewer/v1.0",authoringTool:"BIMData.io"}),this.distanceMeasurementsPlugin=new M3e(e,{defaultAxisVisible:!1,container:this.$el,zIndex:0}),this.angleMeasurementsPlugin=new ZE(e,{container:this.$el,zIndex:0}),this.tilesetLoaderPlugin=new F5e(e,{sensitivity:this.sensitivity,debugMode:!1}),this.navCubeVisible&&(this.navCube=new hN(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(o=>!this.loadedModels.some(a=>a.id===o.id)));let{apiUrl:t,cloudId:i,projectId:r,accessToken:n}=this.$viewer.api;e.forEach(async(o,a)=>{try{this.$viewer.localContext.loadingProcessStart();let s=await(await fetch(`${t}/cloud/${i}/project/${r}/model/${o.id}/tileset?tile_format=xkt`,{headers:new Headers({Authorization:`Bearer ${n}`})})).json();s.name=String(o.id);let l=this.tilesetLoaderPlugin.load(s);this.tilesets.set(o,l);let c={model:o,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 ",o.id,"with error: ",s),this.loadedModels=this.loadedModels.filter(l=>l.id!==o.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(r=>r.id===i.id)),e.forEach(i=>{let r={model:i,plugin:this};this.$viewer.localContext.hub.emit("pointcloud-model-unloaded",r),this.$viewer.globalContext.hub.emit("pointcloud-model-unloaded",r)}),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 r=null;await new Promise(n=>{r=this.$watch("loading",o=>{o||n()},{immediate:!0})}),r(),this.viewpointPending=!1}await new Promise(r=>setTimeout(r,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 r=this.xeokit.scene.pick({pickSurface:!0,canvasPos:i});if(r){let[n,o,a]=r.worldPos;e({x:n,y:a,z:o,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}}},mli={class:"bimdata-viewer-point-cloud"},vli={ref:"header",class:"bimdata-viewer-point-cloud__header"},wli={ref:"bimdata-xeokit-navcube-canvas",class:"bimdata-viewer-point-cloud__nav-cube"},bli=["id"];function yli(e,t,i,r,n,o){let a=T("NoModelWindowPlaceHolder"),s=T("ModelsLoader"),l=T("Annotations");return M(),q("div",mli,[n.loadedModels.length===0?(M(),ie(a,{key:0})):xe("",!0),x("div",vli,[n.settings.modelLoader==="disabled"?xe("",!0):ti((M(),ie(s,{key:0,"window-positioning":!1,preview:""},null,512)),[[zi,n.modelHeaderShown]])],512),x("canvas",{ref:"bimdata-xeokit-canvas",class:"bimdata-viewer-point-cloud__viewer",onWheel:t[0]||=ei(()=>{},["prevent"])},null,544),n.xeokitCreated?(M(),ie(l,{key:1})):xe("",!0),ti(x("canvas",wli,null,512),[[zi,n.navCubeVisible]]),x("div",{id:n.spinnerCanvasId},null,8,bli)])}var Cli={name:"pointCloud",isViewer:!0,component:W(gli,[["render",yli],["__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"}}},bz="viewer-point-cloud-parameters_parameters",xli={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(bz)||"{}";e=JSON.parse(t)}catch{localStorage.removeItem(bz)}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(bz,JSON.stringify(t))}}},kli={class:"viewer-point-cloud-parameters"},Bli={class:"viewer-point-cloud-parameters_header"},Eli={class:"viewer-point-cloud-parameters_content"},Mli={class:"m-b-18"},Ili={class:"flex justify-between"},Pli={class:"viewer-point-cloud-parameters_content__value"},Sli={class:"flex justify-between"},Tli={class:"viewer-point-cloud-parameters_content__value"};function Dli(e,t,i,r,n,o){let a=T("BIMDataIconParameters"),s=T("BIMDataSlider");return M(),q("div",kli,[x("div",Bli,[L(a,{size:"xs",margin:"0 12px 0 0"}),x("span",null,ee(e.$t("pointCloudParameters.title")),1)]),x("div",Eli,[x("div",Mli,[x("div",Ili,[x("span",null,ee(e.$t("pointCloudParameters.sensitivity")),1),x("span",Pli,ee(o.sensitivity),1)]),L(s,{modelValue:o.sensitivity,"onUpdate:modelValue":t[0]||=l=>o.sensitivity=l,min:20,max:1e3},null,8,["modelValue"])]),x("div",null,[x("div",Sli,[x("span",null,ee(e.$t("pointCloudParameters.fov")),1),x("span",Tli,ee(o.fov),1)]),L(s,{modelValue:o.fov,"onUpdate:modelValue":t[1]||=l=>o.fov=l,min:20,max:120},null,8,["modelValue"])])])])}var Rli={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:W(xli,[["render",Dli],["__scopeId","data-v-e97be8b2"]]),button:{tooltip:"pointCloudParameters.tooltip",position:"right",content:"simple",icon:{component:"BIMDataIconParameters",options:{size:"m"}}}},R6=class{constructor(e,t,i=null,r=!0){this.name=e,this.icon=t,this.group=i,this.label=`drawing-tools.action.${e}`,this.lineStyleComponentDisplayed=r}onActivate(){throw Error("Not implemented")}onDeactivate(){throw Error("Not implemented")}},Lli={},_li={width:"18",height:"18",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg"};function Fli(e,t){return M(),q("svg",_li,[...t[0]||=[x("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 jli=W(Lli,[["render",Fli]]),Uli=class{constructor(){this._listenersTarget=new Map}on(e,t,i=window,r={}){this._listenersTarget.has(i)||this._listenersTarget.set(i,new Map);let n=this._listenersTarget.get(i);n.has(e)||n.set(e,new Map);let o=t.bind(this);return r?.once&&(o=(...a)=>{t.call(this,...a),this.off(e,t,i)}),i.addEventListener(e,o,r),n.get(e).set(t,o),()=>{this.off(e,t,i)}}off(e,t,i=window){if(!this._listenersTarget.has(i))return;let r=this._listenersTarget.get(i);if(!r.has(e))return;let n=r.get(e).get(t);i.removeEventListener(e,n),r.get(e).delete(t),r.get(e).size===0&&r.delete(e),r.size===0&&this._listenersTarget.delete(i)}},Oli="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",Hli="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",qli=`url("${Oli}") 0 20, auto`,Nli=`url("${Hli}") 1 23, auto`,tI=class extends Uli{constructor(e,{pointerUpCursor:t=qli,pointerDownCursor:i=Nli,element:r=e.canvas}={}){super(),this._engine2d=e,this.element=r,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:r,y:n}=this._engine2d.canvas.getBoundingClientRect();return this._engine2d.camera.getPosition({x:Math.max(t-r,0),y:Math.max(i-n,0)})}_getCanvasPosition(e){let{clientX:t,clientY:i}=this._getClientPosition(e),{x:r,y:n}=this.element.getBoundingClientRect();return{x:Math.max(t-r,0),y:Math.max(i-n,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,r=this._eventCache.length>1;e.shiftKey||t||i||r||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()}},G6e=`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`,zli=class extends R6{constructor({viewer:e},t){super("pointer",jli,"pointers",!1),this._pointerManager=new Vli(e,t)}onActivate(){this._pointerManager.enable()}onDeactivate(){this._pointerManager.disable()}},Vli=class extends tI{constructor(e,t){super(e,{pointerUpCursor:G6e,pointerDownCursor:G6e,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 r=0,n=0;if(window.TouchEvent&&t instanceof TouchEvent){let c=t.touches[0];this.previousTouch&&(r=c.pageX-this.previousTouch.pageX,n=c.pageY-this.previousTouch.pageY),this.previousTouch=c}else{let{movementX:c,movementY:d}=t;r=c,n=d}let o={x:i.x-r,y:i.y-n},a=this._engine2d.camera.getPosition(o),s=e.x-a.x,l=e.y-a.y;this._currentDrawing.x+=s,this._currentDrawing.y+=l}},Qli={},Gli={width:"14",height:"16",viewBox:"0 0 14 16",xmlns:"http://www.w3.org/2000/svg"};function Kli(e,t){return M(),q("svg",Gli,[...t[0]||=[x("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 Wli=W(Qli,[["render",Kli]]),Jli="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",Yli="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",Zli=`url("${Jli}") 7 23, auto`,Xli=`url("${Yli}") 7 18, auto`,$li=class extends R6{constructor({viewer:e}){super("pan",Wli,"pointers",!1),this._pointerManager=new eci(e)}onActivate(){this._pointerManager.enable()}onDeactivate(){this._pointerManager.disable()}},eci=class extends tI{constructor(e){super(e,{pointerUpCursor:Zli,pointerDownCursor:Xli}),this.previousTouch=null}onDrag({mouseEvent:e}){let t=0,i=0;if(window.TouchEvent&&e instanceof TouchEvent){let r=e.touches[0];this.previousTouch&&(t=r.pageX-this.previousTouch.pageX,i=r.pageY-this.previousTouch.pageY),this.previousTouch=r}else{let{movementX:r,movementY:n}=e;t=r,i=n}this._engine2d.camera.translate(-t*window.devicePixelRatio,-i*window.devicePixelRatio)}onMouseUp(){this.previousTouch=null}},L6=class extends R6{constructor(e,t,i,r,n,o=i){super(i,r,n),this._pointermanager=new tci(e,t,o)}onActivate(){this._pointermanager.enable()}onDeactivate(){this._pointermanager.disable()}},tci=class extends tI{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)}},ici={},rci={width:"18",height:"18",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg"};function nci(e,t){return M(),q("svg",rci,[...t[0]||=[x("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 oci=W(ici,[["render",nci]]),aci=class extends L6{constructor({viewer:e},t){super(e,t,"pen",oci,null,"freehand")}},sci={},lci={width:"22",height:"22",viewBox:"0 0 22 23",xmlns:"http://www.w3.org/2000/svg"};function cci(e,t){return M(),q("svg",lci,[...t[0]||=[x("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 dci=W(sci,[["render",cci]]),uci=`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`,hci=class extends R6{constructor(e,t){super("text",dci,null,!1),this._viewerPlanPlugin=e,this._drawer=t,this.canvas=e.engine.canvas;let i=De(!1);this.autoDeactivateCallback=null,this.connector={enabledRef:i,deactivateAction(){this.autoDeactivateCallback?.()}},this.onClick=r=>{this.autoDeactivateCallback();let{x:n,y:o}=e.viewer.camera.getPosition({x:r.offsetX,y:r.offsetY});t.makeDrawing("text",{x:n,y:o})}}onActivate(e){this.canvas.addEventListener("click",this.onClick),this._viewerPlanPlugin.$viewer.localContext.el.style.cursor=uci,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}},pci={},Aci={width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"};function fci(e,t){return M(),q("svg",Aci,[...t[0]||=[x("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0 0H16V16H0V0ZM2 2V14H14V2H2Z"},null,-1)]])}var gci=W(pci,[["render",fci]]),mci=class extends L6{constructor({viewer:e},t){super(e,t,"rectangle",gci,"shapes")}},vci={},wci={width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"};function bci(e,t){return M(),q("svg",wci,[...t[0]||=[x("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16 1.37853L1.37853 16L0 14.6215L14.6215 0L16 1.37853Z"},null,-1)]])}var yci=W(vci,[["render",bci]]),Cci=class extends L6{constructor({viewer:e},t){super(e,t,"line",yci,"shapes")}},xci={},kci={width:"17",height:"17",viewBox:"0 0 17 17",xmlns:"http://www.w3.org/2000/svg"};function Bci(e,t){return M(),q("svg",kci,[...t[0]||=[x("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 Eci=W(xci,[["render",Bci]]),Mci=class extends L6{constructor({viewer:e},t){super(e,t,"arrow",Eci,"shapes")}},Ici={},Pci={width:"17",height:"17",viewBox:"0 0 17 17",xmlns:"http://www.w3.org/2000/svg"};function Sci(e,t){return M(),q("svg",Pci,[...t[0]||=[x("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 Tci=W(Ici,[["render",Sci]]),Dci=class extends L6{constructor({viewer:e},t){super(e,t,"ellipse",Tci,"shapes")}},Rci={name:"EraserIcon",props:{color:{type:String,default:"currentColor"}}},Lci=["fill"];function _ci(e,t,i,r,n,o){return M(),q("svg",{width:"20",height:"20",viewBox:"0 0 22 22",fill:i.color,xmlns:"http://www.w3.org/2000/svg"},[...t[0]||=[x("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,Lci)}var Fci=W(Rci,[["render",_ci]]),jci="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",Uci="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",Oci=`url("${jci}") 7 23, auto`,Hci=`url("${Uci}") 7 18, auto`,qci=class extends R6{constructor({viewer:e},t){super("eraser",Fci,null,!1),this._pointerManager=new Nci(e,t)}onActivate(){this._pointerManager.enable()}onDeactivate(){this._pointerManager.disable()}},Nci=class extends tI{constructor(e,t){super(e,{element:e.canvas.parentElement,pointerUpCursor:Oci,pointerDownCursor:Hci}),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)}},j3=class{constructor(e){this.drawingType=e}parse(e){throw Error("Not implemented")}toString(e){throw Error("Not implemented")}},zci=class extends j3{constructor(){super("rectangle")}toString(e){let{p1:t,p2:i,p3:r,p4:n,lineColor:o,lineWidth:a}=e;return`<path d="M ${t.x} ${t.y} L ${i.x} ${i.y} L ${r.x} ${r.y} L ${n.x} ${n.y} Z" stroke-width="${a}" stroke="#${o.toString(16).padStart(6,0)}"/>`}parse(e){let t=e.querySelector("path"),[,i,r,,n,o,,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(r)},p2:{x:parseFloat(n),y:parseFloat(o)},p3:{x:parseFloat(a),y:parseFloat(s)},p4:{x:parseFloat(l),y:parseFloat(c)},lineColor:parseInt(d,16),lineWidth:parseFloat(u)}}},Vci=class extends j3{constructor(){super("line")}toString(e){let{p1:t,p2:i,lineWidth:r,lineColor:n}=e;return`<line x1="${t.x}" y1="${t.y}" x2="${i.x}" y2="${i.y}" stroke-width="${r}" stroke="#${n.toString(16).padStart(6,0)}"/>`}parse(e){let t=e.querySelector("line"),i=t.getAttribute("x1"),r=t.getAttribute("y1"),n=t.getAttribute("x2"),o=t.getAttribute("y2"),a=t.getAttribute("stroke")?.substring(1),s=t.getAttribute("stroke-width");return{p1:{x:parseFloat(i),y:parseFloat(r)},p2:{x:parseFloat(n),y:parseFloat(o)},lineWidth:parseFloat(s),lineColor:parseInt(a,16)}}},Qci=class extends j3{constructor(){super("arrow")}toString(e){let{p1:t,p2:i,lineWidth:r,lineColor:n}=e;return`<line x1="${t.x}" y1="${t.y}" x2="${i.x}" y2="${i.y}" stroke-width="${r}" stroke="#${n.toString(16).padStart(6,0)}"/>`}parse(e){let t=e.querySelector("line"),i=t.getAttribute("x1"),r=t.getAttribute("y1"),n=t.getAttribute("x2"),o=t.getAttribute("y2"),a=t.getAttribute("stroke")?.substring(1),s=t.getAttribute("stroke-width");return{p1:{x:parseFloat(i),y:parseFloat(r)},p2:{x:parseFloat(n),y:parseFloat(o)},lineWidth:parseFloat(s),lineColor:parseInt(a,16)}}};function K6e(e){if(e.length===0)return"";let t=e[0],i=`M ${t.x} ${t.y}`;for(let r=0;r<e.length;r++){let n=e[r];i+=` C ${n.cpX1} ${n.cpY1} ${n.cpX2} ${n.cpY2} ${n.toX} ${n.toY}`}return i}function W6e(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 r=parseFloat(t.shift()),n=parseFloat(t.shift()),o=[];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());o.push({type:"curve",x:r,y:n,cpX1:a,cpY1:s,cpX2:l,cpY2:c,toX:d,toY:u}),r=d,n=u}return o}var Gci=class extends j3{constructor(){super("ellipse")}toString(e){let{curve1:t,curve2:i,curve3:r,curve4:n,lineColor:o,lineWidth:a}=e;return`<path d="${K6e([t,i,r,n])} Z" stroke-width="${a}" stroke="#${o.toString(16).padStart(6,0)}" />`}parse(e){let t=e.querySelector("path"),i=W6e(t.getAttribute("d")),r=t.getAttribute("stroke")?.substring(1),n=t.getAttribute("stroke-width");return{curves:i,lineColor:parseInt(r,16),lineWidth:parseFloat(n)}}},Kci=class extends j3{constructor(){super("text")}toString(e){let{x:t,y:i,rotation:r,scale:n,text:o,size:a,color:s}=e;return`<text x="${t}" y="${i}" tranform="rotate(${r}) scale(${n})" font-size="${a}px" ${s?`color="#${s}"`:""}>${o}</text>`}parse(e){let t=e.querySelector("text"),i=t.getAttribute("x"),r=t.getAttribute("y"),n=t.getAttribute("tranform").match(/rotate\((.*)\)/)?.[1]??0,o=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(r),rotation:parseFloat(n),scale:parseFloat(o),text:a,size:parseFloat(s),color:l?l.slice(1):null}}},Wci=class extends j3{constructor(){super("freehand")}toString(e){let{curves:t,lineWidth:i,lineColor:r}=e,n=`stroke-width="${i}" stroke="#${r.toString(16).padStart(6,0)}"`;return`<path d="${K6e(t)}" ${n}/>`}parse(e){let t=e.querySelector("path"),i=W6e(t.getAttribute("d")),r=t.getAttribute("stroke")?.substring(1),n=t.getAttribute("stroke-width");return{curves:i,lineWidth:parseFloat(n),lineColor:parseInt(r,16)}}},Jci=class{constructor(){this.drawingSvgParsers=new Map,[new zci,new Vci,new Qci,new Gci,new Wci,new Kci].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"),r=+t.querySelector("svg").getAttribute("data-bimdata-elevation"),n=this.drawingSvgParsers.get(i);if(!n)throw TypeError(`No drawing parser for type ${i}`);let o=n.parse(t);return o.apiId=e.id,o.type=i,o.z=r,o}catch(t){console.warn(`[Drawing Tools - Parser] Error parsing drawing ${e.id}, ignored.`,t)}}toString(e){let{type:t,z:i}=e,r=this.drawingSvgParsers.get(t);if(!r)throw TypeError(`No drawing parser for type ${t}`);return`<svg type="${t}" data-bimdata-elevation="${i}" xmlns="http://www.w3.org/2000/svg">${r.toString(e)}</svg>`}},Yci=class{constructor(e){this._api=e,this._parser=new Jci,this.queue=Rv()}async getDrawingsData(e){let{cloudId:t,projectId:i}=this._api;return(await this._api.apiClient.modelApi.getDrawings(t,e,i)).map(r=>this._parser.parse(r)).filter(Boolean)}save(e,t){let i=this._parser.toString(e);if(!i)return;let{cloudId:r,projectId:n}=this._api,o={content:i},a;a=e.apiId?async()=>{try{await this._api.apiClient.modelApi.updateDrawing(r,e.apiId,t,n,o)}catch(s){console.error(`Cannot update drawing of type: "${e.type}"`,s)}}:async()=>{try{e.apiId=(await this._api.apiClient.modelApi.createDrawing(r,t,n,o)).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:r}=this._api;try{await this._api.apiClient.modelApi.deleteDrawing(i,e.apiId,t,r)}catch(n){console.error(`Cannot delete drawing of type: "${e.type}"`,n)}}},J6e=class{constructor(e){this.drawingTypes=e}pick(e,t){throw Error("Not implemented")}},Zci=class extends J6e{constructor(e){super(["rectangle","ellipse","arrow","line","freehand"]),this._engine2d=e}pick(e,t){let{canvasPosition:i}=t,r=this._engine2d.picker.pick(i);if(r)return e.get(r.id)}},Xci=class extends J6e{constructor(){super(["text"])}pick(e,t){let{mouseEvent:i}=t,r=i.target;return e.get(r.id)}},Y6e=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.")}},Z6e=class{constructor(e){this.drawingTypes=e}create(e,t){throw Error("Not implemented")}},$ci="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",edi="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",tdi=4,idi=40,X6e=4,rdi=2,ndi={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=Ot("$viewer").localContext.viewer.viewer.canvas,r=De(e.newMarker),n=De(e.initText),o=De(e.initSize),a=De(e.initColor);Qt(n,y=>t("text-update",y)),Qt(o,y=>t("size-update",y)),Qt(a,y=>t("color-update",y));let s=De(null),l=()=>s.value?.focus(),c=De(null),d=De(null),u=De(null);async function h(){if(!r.value)return;await On();let{width:y}=c.value.getBoundingClientRect();d.value=y+12,u.value=1,await On();let{scrollHeight:C}=s.value;u.value=C+2}Qt([()=>e.scale,r,n,o],h);let p=()=>{e.textToolEnabled&&(r.value=!0)},A=y=>{y.key==="Escape"&&(r.value=!1)};Qt(r,async y=>{t("edit-update",y),y?(document.addEventListener("keydown",A),await On(),l()):(document.removeEventListener("keydown",A),v.value=!1)});let f=ot(()=>o.value/(rdi*window.devicePixelRatio)),m=()=>{o.value>tdi&&(o.value-=X6e),l()},g=()=>{o.value<idi&&(o.value+=X6e),l()},w=De(null),v=De(!1),b=De(!1);return Cr(()=>{h(),l()}),{paletteSvg:$ci,textCursor:edi,textarea:s,textEl:c,colorElement:w,edit:r,text:n,textAreaWidth:d,textAreaHeight:u,size:f,sizeRef:o,color:a,colorSelectorDisplayed:v,colorSelectorTop:b,onTextClick:p,decrementSize:m,incrementSize:g,onTextColorClick:()=>{if(v.value=!v.value,v.value){let{y,height:C}=i.getBoundingClientRect(),{y:B}=w.value.getBoundingClientRect();b.value=B>y+C/2}},onTextColorUpdate:y=>{a.value=y,v.value=!1,l()},onDeleteClick:()=>{t("delete-marker"),t("delete-drawing")}}}},odi=["id"],adi={key:0},sdi={class:"bimdata-drawing-tools__text-marker__edit-content",style:"transform: translate(-1px, -1px)"},ldi={class:"bimdata-drawing-tools__text-marker__edit-content__header"},cdi=["src"];function ddi(e,t,i,r,n,o){let a=T("BIMDataColorSelector"),s=T("BIMDataIconDelete"),l=Mr("click-away");return M(),q("div",{class:"bimdata-drawing-tools__text-marker",style:je(`font-size:${r.size}px; z-index: ${r.edit?1:0};`)},[x("div",{style:je(`cursor: ${i.textToolEnabled?r.textCursor:""}`)},[x("div",{ref:"textEl",class:"bimdata-drawing-tools__text-marker__text",style:je(`
2615
+ `}},methods:{onMouseMove({offsetX:e,offsetY:t}){this.zoomX=e,this.zoomY=t}}},xai=["src"],kai=["src"];function Bai(e,t,i,r,n,o){return M(),q("div",{class:"preview-2d",onMouseenter:t[0]||=a=>n.hover=!0,onMouseleave:t[1]||=a=>n.hover=!1,onMousemove:t[2]||=(...a)=>o.onMouseMove&&o.onMouseMove(...a)},[x("img",{loading:"lazy",src:o.imgUrl},null,8,xai),ti(x("div",{class:"zoom",style:je({transform:o.zoomTransform})},[x("div",{class:"zoomImage",style:je({width:`${i.width}px`,height:`${i.height}px`,transform:o.zoomImageTransform})},[x("img",{loading:"lazy",src:o.imgUrl},null,8,kai)],4)],4),[[zi,n.hover]])],32)}var Eai=W(Cai,[["render",Bai],["__scopeId","data-v-b92f4cf9"]]),H6e=15,Mai={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(H6e*(1-e/this.width));t=Math.abs(t),t=Math.min(t,H6e),this.translation=(t-1)*this.viewportWidth}}},Iai=["src"];function Pai(e,t,i,r,n,o){return M(),q("div",{class:"preview-3d",onMousemove:t[0]||=(...a)=>o.onMouseMove&&o.onMouseMove(...a)},[x("div",{class:"viewport",style:je({width:`${o.viewportWidth}px`,height:`${i.height}px`})},[x("img",{loading:"lazy",src:i.previewUrl||i.defaultUrl,style:je({transform:`translateX(-${n.translation}px)`})},null,12,Iai)],4)],32)}var Sai={components:{Preview2D:Eai,Preview3D:W(Mai,[["render",Pai],["__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 Tai(e,t,i,r,n,o){return M(),ie(oo(o.previewComponent),Pl({class:"bimdata-model-preview",style:{width:`${i.width}px`,height:`${i.height}px`,backgroundColor:i.backgroundColor}},e.$props),null,16,["style"])}var Dai=W(Sai,[["render",Tai]]),Rai={class:"placeholder"},Lai={class:"list-item"},_ai={class:"count"},Fai=W({__name:"StoreySelector",props:{storeys:{type:Object,required:!0},storey:{type:Object,default:null}},emits:["storey-selected"],setup(e,{emit:t}){let i=e,r=De(null);return Qt([()=>i.storeys,()=>i.storey],([n,o])=>{(!o||n.some(a=>a.uuid===o.uuid)&&o.uuid!==r.value?.uuid)&&(r.value=o)},{immediate:!0}),(n,o)=>{let a=T("BIMDataIconStorey"),s=T("BIMDataTextbox"),l=T("BIMDataIconPlan"),c=T("BIMDataDropdownList");return M(),ie(c,{class:"storey-selector",width:"100%",list:e.storeys,elementKey:"uuid",closeOnElementClick:!0,onElementClick:o[0]||=d=>n.$emit("storey-selected",d)},{header:K(()=>[L(a,{size:"xs"}),x("span",Rai,ee(r.value?.name??n.$t("MetaBuildingStructure.StoreySelector.placeholder")),1)]),element:K(({element:d})=>[x("div",Lai,[L(s,{class:"text",text:d.name},null,8,["text"]),L(l,{size:"xs"}),x("span",_ai,ee(d.plans.length),1)])]),_:1},8,["list"])}}},[["__scopeId","data-v-49c78195"]]),jai={class:"photosphere-building"},Uai={class:"title"},Oai={class:"head"},Hai={class:"body"},qai={class:"loading"},q6e=W({__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,r=t,n=De(!1),o=De([]),a=De(null),s=ot(()=>a.value?.plans??[]),l=De(null);Qt(()=>i.model,async u=>{if(u)try{n.value=!0,o.value=await i.apiClient.modelApi.getStoreys(i.space.id,u.id,i.project.id),o.value.some(({uuid:h})=>a.value?.uuid===h)||(a.value=o.value[0]??null)}finally{n.value=!1}else o.value=[],a.value=null},{immediate:!0}),Qt(()=>i.storey,u=>{a.value=u},{immediate:!0}),Qt(()=>i.plan,u=>{l.value=u?.plan?.id},{immediate:!0});let c=u=>(a.value=u,r("storey-selected",u)),d=u=>r("plan-selected",u);return(u,h)=>{let p=T("BIMDataIconBuilding"),A=T("BIMDataRadio"),f=T("BIMDataFileIcon"),m=T("BIMDataTextbox"),g=T("BIMDataSpinner");return M(),q("div",jai,[x("div",Uai,[L(p,{size:"s"}),x("span",null,ee(u.$t("PhotosphereBuilding.title")),1)]),x("div",Oai,[L(Fai,{storeys:o.value,storey:a.value,onStoreySelected:c},null,8,["storeys","storey"])]),x("div",Hai,[(M(!0),q(It,null,pi(s.value,w=>(M(),q("div",{class:"list-item",key:w.plan.id},[e.selectable?(M(),ie(A,{key:0,value:w.plan.id,modelValue:l.value,"onUpdate:modelValue":[h[0]||=v=>l.value=v,v=>d(w)]},null,8,["value","modelValue","onUpdate:modelValue"])):xe("",!0),L(f,{fileName:w.plan.document?.file_name??w.plan.name,size:14},null,8,["fileName"]),L(m,{class:"text",text:w.plan.name},null,8,["text"])]))),128))]),L(Hr,{name:"fade"},{default:K(()=>[ti(x("div",qai,[L(g)],512),[[zi,n.value]])]),_:1})])}}},[["__scopeId","data-v-94317752"]]);function wz(e,t){return Array.isArray(e)?e=e.map(i=>wz(i,t)):(e.expandedRef=De(!0),e.parent=t,e.children=e.children?.map(i=>wz(i,e))??[]),e}function Nai(e,t,i){return[{id:1,text:e.name,component:"StructureRootNode",children:t.map(r=>zai(r,i))}]}var zai=(e,t)=>({id:e.uuid,text:e.name,component:"StoreyNode",children:e.plans?.map(i=>Vai(e,i))??[],storey:e}),Vai=(e,t)=>({id:t.plan.id,text:t.plan.name,component:"PlanNode",storey:e,plan:t}),Qai={class:"generic-tree-node"},Gai={class:"end"},$M=W({__name:"GenericTreeNode",props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},setup(e){return(t,i)=>{let r=T("BIMDataTextbox");return M(),q("div",Qai,[Yt(t.$slots,"icon",{},void 0,!0),L(r,{class:"text",text:e.node.text},null,8,["text"]),x("div",Gai,[Yt(t.$slots,"end",{},void 0,!0)])])}}},[["__scopeId","data-v-fab13549"]]),Kai={__name:"PlanNode",props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},emits:["delete-plan"],setup(e){let t=e,i=ot(()=>t.node.storey),r=ot(()=>t.node.plan);return(n,o)=>{let a=T("BIMDataFileIcon"),s=T("BIMDataIconDelete"),l=T("BIMDataButton");return M(),ie($M,yd(oh(n.$props)),{icon:K(()=>[L(a,{"file-name":r.value.plan.document?.file_name??r.value.plan.name,size:12},null,8,["file-name"])]),end:K(()=>[L(l,{width:"24px",height:"24px",color:"high",ghost:"",rounded:"",icon:"",onClick:o[0]||=c=>n.$emit("delete-plan",{storey:i.value,plan:r.value})},{default:K(()=>[L(s,{size:"xxs"})]),_:1})]),_:1},16)}}},Wai=W({__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,r=t,n=[{key:1,text:"BuildingMaker.view.addFile",icon:"plus",action:()=>(o.value=!1,r("add-plans",i.node.storey))},{key:2,text:"BIMDataComponents.t.rename",icon:"edit",action:()=>(o.value=!1,r("update-storey",i.node.storey)),divider:!0},{key:3,text:"BIMDataComponents.t.delete",icon:"delete",color:"var(--color-high)",action:()=>(o.value=!1,r("delete-storey",i.node.storey))}],o=De(!1);return(a,s)=>{let l=T("BIMDataIconStorey"),c=T("BIMDataIconEllipsis"),d=T("BIMDataButton"),u=T("BIMDataIcon"),h=T("BIMDataMenu");return M(),ie($M,Pl({class:"storey-node"},a.$props),{icon:K(()=>[L(l,{size:"xxs"})]),end:K(()=>[L(d,{width:"24px",height:"24px",color:"granite",ghost:"",rounded:"",icon:"",onClick:s[0]||=p=>o.value=!o.value},{default:K(()=>[L(c,{customSize:"24"})]),_:1}),L(Hr,{name:"fade"},{default:K(()=>[ti(L(h,{class:"storey-node__menu",menuItems:n,width:"180px"},{item:K(({item:p})=>[L(u,{name:p.icon,size:"xs",margin:"0 12px 0 0"},null,8,["name"]),x("span",null,ee(a.$t(p.text)),1)]),_:1},512),[[zi,o.value]])]),_:1})]),_:1},16)}}},[["__scopeId","data-v-a66bc7dd"]]),Jai={__name:"StructureRootNode",props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},emits:["create-storey"],setup(e){return(t,i)=>{let r=T("BIMDataIconBuilding"),n=T("BIMDataIconPlus"),o=T("BIMDataButton");return M(),ie($M,yd(oh(t.$props)),{icon:K(()=>[L(r,{size:"xs"})]),end:K(()=>[L(o,{width:"23px",height:"23px",color:"primary",fill:"",radius:"",icon:"",onClick:i[0]||=a=>t.$emit("create-storey")},{default:K(()=>[L(n,{size:"xxs"})]),_:1})]),_:1},16)}}},Yai={__name:"ZoneNode",props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},setup(e){return(t,i)=>{let r=T("BIMDataIconZone2");return M(),ie($M,yd(oh(t.$props)),{icon:K(()=>[L(r,{size:"xxs"})]),_:1},16)}}},Zai={class:"building-view"},Xai={key:0,class:"content"},$ai={key:1,class:"content"},esi={class:"building-view__tree"},tsi=W(Object.assign({components:{PlanNode:Kai,StoreyNode:Wai,StructureRootNode:Jai,ZoneNode:Yai}},{__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,r=Ot("service"),n=Ot("loading"),o=De(""),a=De(""),s=De(!1),l=De(!1),c=De([]),d=De(null),u=De([]),h=De([]),p=ot(()=>wz(Nai(i.model,c.value,h.value))),A=async()=>{try{n.value=!0,c.value=await r.fetchStoreys(i.model)}finally{n.value=!1}},f=async()=>{try{n.value=!0,h.value=await r.fetchZones(i.model)}finally{n.value=!1}},m=async I=>{await r.createStorey(i.model,I),A()},g=async I=>{await r.updateStorey(i.model,I),A()},w=async I=>{await r.deleteStorey(i.model,I),A()},v=I=>{d.value=I,l.value=!0},b=()=>{d.value=null,l.value=!1},y=I=>{o.value=i.apiClient.config.configuration.basePath,a.value=i.apiClient.accessToken,d.value=I,s.value=!0},C=async()=>{let I=[],E=[];for(let{document:S,pdfPage:D}of u.value)D?E.push(D):I.push(S);let P=(await r.createPlanModels(I)).concat(E);await r.createStoreyPlans(i.model,d.value,P),A(),u.value=[],d.value=null,s.value=!1},B=async({storey:I,plan:E})=>{await r.deleteStoreyPlan(i.model,I,E),A()};return Cr(()=>{A(),f()}),(I,E)=>{let P=T("BIMDataFileManager"),S=T("BIMDataButton"),D=T("BIMDataTree");return M(),q("div",Zai,[L(Hr,{name:"fade",mode:"out-in"},{default:K(()=>[s.value&&o.value&&a.value&&d.value?(M(),q("div",Xai,[L(P,{class:"building-view__dms",spaceId:e.space.id,projectId:e.project.id,apiUrl:o.value,archiveUrl:"",accessToken:a.value,locale:I.$i18n.locale,select:!0,pdfPageSelect:!0,multi:!0,headerButtons:!1,selectableFileTypes:Ft(ebe),onSelectionChange:E[0]||=j=>u.value=j},null,8,["spaceId","projectId","apiUrl","accessToken","locale","selectableFileTypes"]),L(S,{width:"100%",color:"primary",fill:"",radius:"",onClick:C},{default:K(()=>[wt(ee(I.$t("BIMDataComponents.t.validate")),1)]),_:1})])):(M(),q("div",$ai,[x("div",esi,[L(D,{data:p.value},{node:K(({node:j,depth:V})=>[(M(),ie(oo(j.component),{node:j,depth:V,onCreateStorey:v,onUpdateStorey:v,onDeleteStorey:w,onAddPlans:y,onDeletePlan:B},null,40,["node","depth"]))]),_:1},8,["data"])]),L(S,{width:"100%",color:"primary",fill:"",radius:"",onClick:E[1]||=j=>I.$emit("close")},{default:K(()=>[wt(ee(I.$t("BIMDataComponents.t.finish")),1)]),_:1}),L(Hr,{name:"fade"},{default:K(()=>[l.value?(M(),ie(rbe,{key:0,class:"building-view__form",storey:d.value,onCreateStorey:m,onUpdateStorey:g,onClose:b},null,8,["storey"])):xe("",!0)]),_:1})]))]),_:1})])}}}),[["__scopeId","data-v-5bedb26f"]]),isi={class:"bimdata-building-maker"},rsi=["src"],nsi={class:"bimdata-building-maker__body"},osi={class:"bimdata-building-maker__loader"},asi=W({__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,r=t,n=Object.freeze({FORM:"form",LIST:"list",VIEW:"view"}),o=$we(i.apiClient,i.space,i.project),a=De(!1);vn("service",o),vn("loading",a);let s=De(n.LIST),l=De([]),c=De(null),d=async()=>{a.value=!0,l.value=await o.fetchPhotosphereBuildings(),a.value=!1},u=async g=>{await o.deleteMetaBuilding(g),d(),r("metaBuilding-deleted")},h=g=>{c.value=g??null,s.value=n.FORM},p=g=>{c.value=g,s.value=n.VIEW},A=async g=>{await d(),p(g),r("metaBuilding-created")},f=()=>{d(),s.value=n.LIST,r("metaBuilding-updated")},m=()=>{s.value=n.LIST};return Qt(()=>i.model,g=>{g&&p(g)},{immediate:!0}),Cr(()=>d()),(g,w)=>{let v=T("BIMDataIconArrow"),b=T("BIMDataButton"),y=T("BIMDataSpinner");return M(),q("div",isi,[x("div",{class:"bimdata-building-maker__header",style:je({visibility:s.value===Ft(n).LIST?"hidden":"visible"})},[L(b,{class:"bimdata-building-maker__header__btn-back",ghost:"",radius:"",disabled:a.value.value,onClick:m},{default:K(()=>[L(v,{size:"xxs",margin:"0 6px 0 0"}),x("span",null,ee(g.$t("BIMDataComponents.t.back")),1)]),_:1},8,["disabled"]),x("img",{src:Ft(M6)},null,8,rsi),x("span",null,ee(g.$t("PhotosphereBuilding.title")),1)],4),x("div",nsi,[L(Hr,{name:"fade",mode:"out-in"},{default:K(()=>[s.value===Ft(n).FORM?(M(),ie(tbe,{key:0,type:Ft(HN).PHOTOSPHERE_BUILDING,metaBuilding:c.value,onMetaBuildingCreated:A,onMetaBuildingUpdated:f},null,8,["type","metaBuilding"])):s.value===Ft(n).VIEW&&c.value?(M(),ie(tsi,{key:1,apiClient:e.apiClient,space:e.space,project:e.project,model:c.value,onClose:m},null,8,["apiClient","space","project","model"])):(M(),ie(ibe,{key:2,metaBuildings:l.value,onOpenMetaBuilding:p,onCreateMetaBuilding:h,onUpdateMetaBuilding:h,onDeleteMetaBuilding:u},null,8,["metaBuildings"]))]),_:1})]),L(Hr,{name:"fade"},{default:K(()=>[ti(x("div",osi,[L(y)],512),[[zi,a.value]])]),_:1})])}}},[["__scopeId","data-v-235bd404"]]),ssi={class:"overlay"},lsi={class:"safe-zone__icon"},csi={class:"safe-zone__title"},dsi={class:"safe-zone__text"},usi={class:"safe-zone__actions"},hsi=W({__name:"BIMDataSafeZoneModal",props:{width:{type:String,default:"350px"},iconName:{type:String,default:"warning"}},setup(e){return(t,i)=>{let r=T("BIMDataIcon");return M(),q("div",ssi,[x("div",{class:"safe-zone",style:je({width:e.width})},[x("div",lsi,[L(r,{name:e.iconName,size:"s",fill:"",color:"high"},null,8,["name"])]),x("h2",csi,[Yt(t.$slots,"title",{},void 0,!0)]),x("div",dsi,[Yt(t.$slots,"text",{},void 0,!0)]),x("div",usi,[Yt(t.$slots,"actions",{},void 0,!0)])],4)])}}},[["__scopeId","data-v-01a25253"]]),psi=bo({BIMDataBuildingMaker:()=>nbe,BIMDataFileManager:()=>Toi,BIMDataGuidedTour:()=>Zoi,BIMDataMetaBuildingStructure:()=>O6e,BIMDataModelPreview:()=>Dai,BIMDataPDFViewer:()=>I6e,BIMDataPhotosphereBuilding:()=>q6e,BIMDataPhotosphereBuildingMaker:()=>asi,BIMDataSafeZoneModal:()=>hsi}),Asi={name:"buildingMaker",component:{setup(){let{apiClient:e,cloudId:t,projectId:i}=Ot("$viewer").api;return()=>ao(nbe,{apiClient:e,space:{id:t},project:{id:i}})}},window:{name:"buildingMaker",label:"Building Maker",noModel:!0,icon:{imgUri:M6}}},fsi={components:{BIMDataNumericalInput:Pfe},setup(){let e=Ot("$viewer"),t=Ot("viewerPlan"),i=Ot("root"),r=Ot("close"),n=ot(()=>i.editedBitmap?.plan),o=ot(()=>i.editedBitmap?i.editedBitmap:{x:0,y:0,scale:0,angle:0,opacity:0}),a=gsi(o),{x:s,y:l,angle:c,scale:d}=a,u,h,p=new Map;return Qt(n,(f,m)=>{m&&p.set(m.key,u),f||p.clear(),u=p.get(f?.key)??null,h=null}),Qt([s,l,c,d],()=>{n.value&&(u||=n.value.plan.transform,h={translate:[s.value,l.value],rotate:c.value,scale:d.value},t.planObjectRegistry.updatePlanObjectsTransform(n.value,{oldTransform:u,newTransform:h}),u=h)}),{root:i,bitmap:o,...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:w,angle:v,opacity:b,plan:y}=f,C={...y.plan.transform},B={translate:[m,g],rotate:v,scale:w,opacity:b};t.planObjectRegistry.updatePlanObjectsTransform(y,{oldTransform:B,newTransform:C}),y.plan.transform||(y.plan.transform={}),Object.assign(y.plan.transform,B),await e.state.updatePlan(y,C),f.edited=!1}))}catch(f){console.error(f)}finally{i.loading=!1,r()}}}}};function gsi(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,r])=>{t[i]=ot({get:()=>e.value[i],set:n=>e.value[i]=r(n)})}),t}var msi={class:"synchronization__page__edit"},vsi={class:"synchronization__page__edit__content"},wsi={class:"synchronization__page__edit__content__unit-group"},bsi={class:"synchronization__page__edit__content__unit-group__element"},ysi={class:"synchronization__page__edit__content__unit-group__element"},Csi={class:"synchronization__page__edit__content__unit-group__element"},xsi={class:"synchronization__page__edit__content__unit"},ksi={class:"synchronization__page__edit__content__unit"},Bsi={class:"synchronization__page__edit__content__img"},Esi=["src"],Msi={class:"synchronization__page__edit__validate"};function Isi(e,t,i,r,n,o){let a=T("BIMDataNumericalInput"),s=T("BIMDataSlider"),l=T("BIMDataTextbox"),c=T("BIMDataButton");return M(),q("div",msi,[x("div",vsi,[x("section",null,[x("span",null,ee(e.$t("synchronization.location")),1),x("div",wsi,[x("div",bsi,[L(a,{modelValue:e.x,"onUpdate:modelValue":t[0]||=d=>e.x=d,label:"X",container:e.$viewer.localContext.el},null,8,["modelValue","container"])]),x("div",ysi,[L(a,{modelValue:e.y,"onUpdate:modelValue":t[1]||=d=>e.y=d,label:"Y",container:e.$viewer.localContext.el},null,8,["modelValue","container"])]),x("div",Csi,[L(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"])])])]),x("section",null,[x("span",null,ee(e.$t("synchronization.rotation")),1),x("div",xsi,[L(a,{modelValue:e.angle,"onUpdate:modelValue":t[3]||=d=>e.angle=d,unit:"\xB0",centered:""},null,8,["modelValue"]),L(s,{modelValue:e.angle,"onUpdate:modelValue":t[4]||=d=>e.angle=d,min:0,max:360},null,8,["modelValue"])])]),x("section",null,[x("span",null,ee(e.$t("synchronization.alpha")),1),x("div",ksi,[L(a,{modelValue:e.opacity,"onUpdate:modelValue":t[5]||=d=>e.opacity=d,centered:""},null,8,["modelValue"]),L(s,{modelValue:e.opacity,"onUpdate:modelValue":t[6]||=d=>e.opacity=d,min:0,max:1,step:.01},null,8,["modelValue"])])]),x("section",null,[x("span",null,ee(e.$t("synchronization.preview")),1),x("div",Bsi,[x("img",{src:r.bitmap.dataUrl,alt:"Background"},null,8,Esi),L(l,{text:r.bitmap.name,class:"synchronization__page__edit__content__img__name"},null,8,["text"])])])]),x("div",Msi,[L(c,{width:"100%",color:"primary",fill:"",radius:"",onClick:r.submit},{default:K(()=>[wt(ee(r.bitmap&&r.bitmap.plan?e.$t("global.save"):e.$t("global.validate")),1)]),_:1},8,["onClick"])])])}var Psi={name:"BimdataSynchronization",components:{edit:W(fsi,[["render",Isi],["__scopeId","data-v-63e956d5"]])},setup(){let{localContext:e}=Ot("$viewer"),t=Ot("$plugin"),i=e.pluginComponentInstances.get("plan");if(!i)throw Error("[Synchronization] plugin cannot work without viewerPlan plugin with 2d engine on.");i=os(i),vn("viewerPlan",i);let r=ot(()=>e.loadedModels[0]);Qt(r,p=>{!p||p.type!=="METABUILDING"?t.hide():t.show()},{immediate:!0}),Qt(()=>t.shown,p=>{r.value?.type!=="METABUILDING"&&p&&t.hide()});let n=Ma({page:"edit",loading:!1,modalDisplayed:!1,model:null,storeys:[],selectedStorey:null,plans:[],bitmaps:[],editedBitmap:null});vn("root",n);let o=()=>{n.editedBitmap&&(n.bitmaps.map(p=>(p.edit(!1),p)).filter(p=>p.edited).forEach(p=>{let{x:A,y:f,scale:m,angle:g,plan:w}=p,v=w.plan.transform,b={translate:[A,f],rotate:g,scale:m};i.planObjectRegistry.updatePlanObjectsTransform(w,{oldTransform:b,newTransform:v}),p.reset()}),n.modalDisplayed=!1,i.storeyRightOffset=0,e.showUI(),document.removeEventListener("keydown",d),n.editedBitmap=null,n.bitmaps=[])},a=()=>{o(),t.close()};vn("close",a);let s=()=>{n.bitmaps.some(p=>p.edited)?n.modalDisplayed=!0:a()},l=()=>{a()},c=p=>{n.editedBitmap=p},d=p=>{n.loading||p.key==="Escape"&&(p.preventDefault(),n.modalDisplayed?n.modalDisplayed=!1:a())},u=e.hub.on("model-loaded",({model:p})=>{n.model=p,n.storeys=p.storeys,n.plans=p.storeys.flatMap(A=>A.plans)},{getLastEvent:!0}),h=e.hub.on("storey-selected",({storey:p})=>{n.selectedStorey=p,(!p||p.plans.length<2)&&a()},{getLastEvent:!0});return Yr(()=>{e.hub.off(u),e.hub.off(h)}),Qt(()=>n.editedBitmap,(p,A)=>{A?.edit(!1),p?.edit(!0)},{immediate:!0}),{viewerPlan:i,root:n,onBitmapClick:c,onCloseClick:s,onLeaveClick:l,onKeyDown:d,clean:o}},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()}},Ssi={class:"bimdata-synchronization"},Tsi={class:"bimdata-synchronization__header"},Dsi={class:"bimdata-synchronization__header__top"},Rsi={class:"bimdata-synchronization__header__top__title"},Lsi={class:"bimdata-synchronization__header__top__title__text"},_si={class:"bimdata-synchronization__header__select__header"},Fsi={class:"bimdata-info-length bimdata-synchronization__header__select__header__length"},jsi={class:"bimdata-synchronization__page"},Usi={key:1,class:"bimdata-synchronization__modal"},Osi={class:"bimdata-synchronization__modal__content"},Hsi={class:"bimdata-synchronization__modal__content__symbols"},qsi={class:"bimdata-synchronization__modal__content__buttons"};function Nsi(e,t,i,r,n,o){let a=T("BIMDataLoading"),s=T("BIMDataIconSynchro2D"),l=T("BIMDataIconClose"),c=T("BIMDataButton"),d=T("BIMDataTextbox"),u=T("BIMDataDropdownList"),h=T("BIMDataIconWarning");return M(),q("div",Ssi,[r.root.loading?(M(),ie(a,{key:0})):xe("",!0),x("div",Tsi,[x("div",Dsi,[x("div",Rsi,[L(s,{size:"xs",fill:"",color:"primary"}),x("span",Lsi,ee(e.$t("synchronization.title")),1)]),L(c,{class:"bimdata-synchronization__header__top__close",width:"25px",height:"25px",ghost:"",radius:"",icon:"",onClick:r.onCloseClick},{default:K(()=>[L(l,{size:"xs",fill:"",color:"granite-light"})]),_:1},8,["onClick"])]),x("div",null,[L(u,{width:"100%",list:r.root.bitmaps,"element-key":"id","per-page":30,"close-on-element-click":!0,class:"bimdata-synchronization__header__select",onElementClick:r.onBitmapClick},{header:K(()=>[x("div",_si,[x("div",Fsi,[x("span",null,ee(r.root.bitmaps.length),1)]),x("div",null,[L(d,{width:"265px",text:r.root.editedBitmap?.name},null,8,["text"])])])]),element:K(({element:p})=>[x("div",{class:Ue(["bimdata-synchronization__header__select__element",{"bimdata-synchronization__header__select__element--selected":p===r.root.editedBitmap}])},ee(p.name),3)]),_:1},8,["list","onElementClick"])])]),x("div",jsi,[(M(),ie(A7,null,[(M(),ie(oo(r.root.page)))],1024))]),r.root.modalDisplayed?(M(),q("div",Usi,[x("div",Osi,[x("div",Hsi,[L(h,{fill:"",color:"high",size:"l"}),x("div",null,ee(e.$t("synchronization.warning")),1)]),x("div",qsi,[L(c,{width:"45%",color:"high",fill:"",radius:"",onClick:r.onLeaveClick},{default:K(()=>[wt(ee(e.$t("synchronization.leave")),1)]),_:1},8,["onClick"]),L(c,{width:"45%",color:"default",outline:"",radius:"",onClick:t[0]||=p=>r.root.modalDisplayed=!1},{default:K(()=>[wt(ee(e.$t("synchronization.stay")),1)]),_:1})])])])):xe("",!0)])}var zsi={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:W(Psi,[["render",Nsi],["__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"}}},Vsi={name:"anchor-synchronization",i18n:{de:Dfe,en:Rfe,es:Lfe,fr:_fe,it:Ffe},i18nTokenPrefix:"viewer2d-background",addToWindows:["2d"],component:Tfe,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"}}},Qsi={},Gsi={width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ksi(e,t){return M(),q("svg",Gsi,[...t[0]||=[Ts('<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 Wsi=W(Qsi,[["render",Ksi]]),Jsi={class:"bimdata-anchor-synchronization__header"},Ysi={class:"bimdata-anchor-synchronization__header__texts"},Zsi={class:"bimdata-anchor-synchronization__header__texts__title"},Xsi={class:"bimdata-anchor-synchronization__header__buttons"},$si=W({__name:"AnchorSynchronizationHeader",setup(e){let t=Ot("$viewer"),i=Ot("state"),r=Ot("service"),n=ot(()=>i.allAnchorsValidated),o=De(!1),a=null;t.globalContext.hub.once("anchor-synchronization:open",(c=null)=>{a=c},{getLastEvent:!0});let s=()=>{t.globalContext.layout=a},l=async()=>{o.value=!0,await r.saveAnchors(),t.globalContext.layout=a};return(c,d)=>{let u=T("BIMDataButton"),h=T("BIMDataSpinner");return M(),q("div",Jsi,[x("div",Ysi,[L(Wsi,{class:"m-x-6"}),x("span",Zsi,ee(c.$t("anchor-synchronization-window.title")),1)]),x("div",Xsi,[L(u,{color:"high",fill:"",radius:"",class:"m-x-6",width:"120px",onClick:s},{default:K(()=>[wt(ee(c.$t("global.cancel")),1)]),_:1}),L(u,{color:"primary",fill:"",radius:"",class:"m-x-6",width:"120px",disabled:!n.value,onClick:l},{default:K(()=>[o.value?(M(),ie(h,{key:0})):(M(),q(It,{key:1},[wt(ee(c.$t("global.done")),1)],64))]),_:1},8,["disabled"])])])}}},[["__scopeId","data-v-a7ce6c34"]]),eli={class:"anchor-content"},tli={class:"anchor-label"},eI={__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,r={x:i.isSecondAnchor?"70px":"20px",y:"90%"},n=ot(()=>i.position?{x:i.position.x+"px",y:i.position.y+"px"}:r),o=t,a=De(!1),s=De(null);function l(u){a.value=!0,s.value?.setPointerCapture(u.pointerId),u.preventDefault()}function c(u){if(!a.value)return;let h=i.position;if(!h){let{x:p,y:A}=s.value.getBoundingClientRect(),{x:f,y:m}=s.value.parentElement.getBoundingClientRect();h={x:p-f+15,y:A-m+51}}o("change",{x:h.x+u.movementX,y:h.y+u.movementY})}function d(u){a.value&&s.value&&s.value?.releasePointerCapture(u.pointerId),a.value=!1,o("validate")}return Yr(()=>{a.value=!1}),(u,h)=>(M(),q("div",{class:"bimdata-anchor-synchronization__anchor",style:je({left:n.value.x,top:n.value.y,color:e.color,cursor:a.value?"none":"grab"}),onPointerdown:l,onPointermove:c,onPointerup:d,ref_key:"anchorElement",ref:s},[x("div",eli,[h[0]||=x("svg",{width:"30",height:"60",viewBox:"0 0 30 60",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[x("rect",{x:"14",y:"42",width:"2",height:"18",fill:"currentColor"}),x("rect",{x:"24",y:"50",width:"2",height:"18",transform:"rotate(90 24 50)",fill:"currentColor"}),x("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),x("div",tli,ee(e.isSecondAnchor?2:1),1)])],36))}},N6e=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2}),z6e=(e,t)=>Math.hypot(t.x-e.x,t.y-e.y),V6e=(e,t)=>Math.atan2(t.y-e.y,t.x-e.x),ili=(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 Q6e(e){let{anchorA1Position:t,anchorA2Position:i,anchorB1Position:r,anchorB2Position:n,model:o,modelToSynchronize:a}=e;if(!o||!a)throw Error("[BIMDataViewer - AnchorSynchronization] Models are mandatory to calculate transform.");let{translate:s,rotate:l,scale:c}=a.transform??Pie.IDENTITY,d=z6e(t,i)/z6e(r,n)*c,u=V6e(t,i),h=(V6e(r,n)-u)*(180/Math.PI)*-1,p=l+h,A=N6e(t,i),f=N6e(r,n),m=ili({x:f.x-s[0],y:f.y-s[1]},h*Math.PI/180),g={x:m.x/c*d,y:m.y/c*d};return{scale:d,rotate:p,translate:[A.x-g.x,A.y-g.y,0]}}var rli={class:"bimdata-viewer-ifc-2d",ref:"canvasContainer"},nli=W({__name:"ViewerIfc2D",props:{model:{type:Object,default:null},storeyIndex:{type:Number,default:0}},emits:["camera-update"],setup(e,{expose:t,emit:i}){let r=e,n=i,o=Ot("$viewer"),a=Ot("state"),s=De(null),l=null,c=null,d=null,{promise:u,resolve:h,reject:p}=Promise.withResolvers(),A=()=>{c=y2({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:w}=c;w.on("update",()=>{n("camera-update",w)});let v={engine:c,viewer:c,$viewer:o};l=Gk(v),d=new zU(v)};Cr(()=>{try{A()}catch(w){p(w)}h()});let f=(w,v)=>{let b=w.storeys[v];if(!b)return;let y=b.objects.map(C=>String(C.id));c.scene.showObjects(y)},m=async w=>{await u,await l(w.map_file,w.id);let v=c.scene.objects.map(b=>b.id);if(c.scene.hideObjects(v),f(w,r.storeyIndex),w.recommanded_2d_angle!==void 0){let b=c.camera.rotation;c.camera.rotate(-b-w.recommanded_2d_angle)}c.camera.fitView()};Qt(()=>r.model,async w=>{w&&await m(w)},{immediate:!0});let g=!1;return t({getWorldPosition(w){return c.camera.getPosition(w)},get canvas(){return s.value},async showPlan(w){if(g)return;let v=await d.showPlan(w),b=v.mask?.crop_path,y={opacity:.5,crop_path:b};v.tempMask=y,g=!0;let C={translate:[v.x,v.y],scale:v.scale,rotate:v.angle},{anchorA1Position:B,anchorA2Position:I,anchorB1Position:E,anchorB2Position:P}=N4(a);Qt([B,I,E,P],()=>{let S=Q6e(a);b?.length>0&&(y.crop_path=Y5(Y5(b,C,{inverse:!0}),S)),v.x=S.translate[0],v.y=S.translate[1],v.scale=S.scale,v.angle=S.rotate},{immediate:!0})}}),(w,v)=>(M(),q("div",rli,[x("canvas",{ref_key:"canvasElement",ref:s,style:{width:"100%",height:"100%",position:"absolute"}},null,512)],512))}},[["__scopeId","data-v-c0725497"]]),oli={__name:"ViewerImage",props:{model:{type:Object,default:null}},emits:["camera-update"],setup(e,{expose:t,emit:i}){let r=e,n=i,o=()=>{let{camera:d}=a.value.viewer;d.on("update",()=>{n("camera-update",d)})},a=De(null),{promise:s,resolve:l}=Promise.withResolvers();Qt(()=>r.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}),Cr(()=>{l()});let c=$o({get loadedModels(){return r.model?[r.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)=>(M(),ie(Ng,{ref_key:"viewerPlan",ref:a,stateContext:c,onMounted:o},null,8,["stateContext"]))}},ali={class:"bimdata-anchor-synchronization__viewer"},sli={class:"viewer-container-A"},lli={class:"viewer-container-B"},cli=W({__name:"AnchorSynchronizationViewer",setup(e,{expose:t}){let i=De(null),r=De(null),n=Ot("state"),o=(b,y)=>{y.preventDefault();let C=b==="A"?i.value:r.value;C&&XU(C.canvas)(y)},a=De(null),s=De(null),l=De(null),c=De(null),d={anchorA1Position:a,anchorA2Position:s,anchorB1Position:l,anchorB2Position:c},u=(b,y)=>{(b==="A"?["anchorA1Position","anchorA2Position"].filter(C=>d[C].value!==null):["anchorB1Position","anchorB2Position"].filter(C=>d[C].value!==null)).forEach(C=>{let B=n[C];d[C].value=y.getCanvasPosition(B)})},h=(b,y)=>{let C=b.startsWith("A")?i.value:r.value,B=`anchor${b}Position`;n[B]=C.getWorldPosition(y),d[B].value=y},p=Lr(null),A=De(0),f=Lr(null),m=Qt(()=>n.allAnchorsValidated,b=>{if(!b)return;let y={plan:f.value,storey:{}};i.value.showPlan(y),m()}),g=b=>{if(!b)return null;let y=b.type;switch(y){case"IFC":return nli;case"PNG":case"JPEG":case"PDF":case"PHOTOSPHERE":return oli;default:throw Error(`[BIMData AnchorSynchronizationViewer] Unsupported model type: ${y}`)}},w=async(b,y,C)=>{p.value=b;let B=b.storeys.findIndex(I=>I.uuid===y.uuid);if(B===-1)throw Error("[BIMData AnchorSynchronizationViewer] Storey not found in main model.");A.value=B,f.value=C},v=()=>{n.allAnchorsValidated||a.value&&s.value&&l.value&&c.value&&(n.allAnchorsValidated=!0)};return t({synchronize:w}),(b,y)=>(M(),q("div",ali,[x("div",sli,[(M(),ie(oo(g(p.value)??"div"),{model:p.value,ref_key:"viewerA",ref:i,onCameraUpdate:y[0]||=C=>u("A",C),storeyIndex:A.value},null,40,["model","storeyIndex"])),p.value?(M(),q(It,{key:0},[L(eI,{onChange:y[1]||=C=>h("A1",C),onValidate:v,position:a.value,onWheel:y[2]||=C=>o("A",C)},null,8,["position"]),L(eI,{onChange:y[3]||=C=>h("A2",C),onValidate:v,position:s.value,onWheel:y[4]||=C=>o("A",C),isSecondAnchor:!0},null,8,["position"])],64)):xe("",!0)]),x("div",lli,[(M(),ie(oo(g(f.value)??"div"),{model:f.value,ref_key:"viewerB",ref:r,onCameraUpdate:y[5]||=C=>u("B",C)},null,40,["model"])),f.value?(M(),q(It,{key:0},[L(eI,{onChange:y[6]||=C=>h("B1",C),onValidate:v,position:l.value,onWheel:y[7]||=C=>o("B",C)},null,8,["position"]),L(eI,{onChange:y[8]||=C=>h("B2",C),onValidate:v,position:c.value,onWheel:y[9]||=C=>o("B",C),isSecondAnchor:!0},null,8,["position"])],64)):xe("",!0)])]))}},[["__scopeId","data-v-3947e679"]]),dli=class{state;$viewer;constructor(e,t){this.$viewer=e,this.state=t}async saveAnchors(){let{state:e}=this.$viewer,{model:t,storey:i,modelToSynchronize:r}=this.state;if(!t||!r||!i)throw Error("[BIMDataViewer - AnchorSynchronization] Models and storey are mandatory to save anchors.");let n=Q6e(this.state),o=i.plans.find(a=>a.plan.id===r.id);try{if(o){let a={...r.transform};o.plan.transform=n,await e.updatePlan(o,a)}else await e.createPlan(t,i,r.document,n)}catch(a){throw console.error("[BIMDataViewer - Anchor Synchronization Service] Failed to save anchors:",a),a}}},uli=class{model=null;storey=null;modelToSynchronize=null;anchorA1Position=null;anchorA2Position=null;anchorB1Position=null;anchorB2Position=null;allAnchorsValidated=!1;constructor(){return $o(this)}},hli={components:{AnchorSynchronizationHeader:$si,AnchorSynchronizationViewer:cli},setup(){let e=De(null),t=new uli;return vn("state",t),vn("service",new dli(Ot("$viewer"),t)),{viewer:e,synchronize:(i,r,n)=>(t.model=i,t.storey=r,t.modelToSynchronize=n,e.value.synchronize(i,r,n)),positioned:De(!1)}}},pli={class:"bimdata-anchor-synchronization"};function Ali(e,t,i,r,n,o){let a=T("AnchorSynchronizationHeader"),s=T("AnchorSynchronizationViewer");return M(),q("div",pli,[L(a,{valid:r.positioned},null,8,["valid"]),L(s,{class:"bimdata-anchor-synchronization__content__viewer",ref:"viewer",onPositioned:t[0]||=l=>r.positioned=!0})])}var fli={name:"anchor-synchronization-window",i18n:{en:{title:"Synchronization"},fr:{title:"Synchronisation"}},component:W(hli,[["render",Ali],["__scopeId","data-v-7f15ad3b"]]),window:{name:"anchor-synchronization",header:!1,displayedInWindowSelector:!1,multiModel:!1}},gli={name:"PointCloudViewer",components:{Annotations:U5e},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=kA},mounted(){let e=new b3e({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 rM(e,{originatingSystem:"BIMDataViewer/v1.0",authoringTool:"BIMData.io"}),this.distanceMeasurementsPlugin=new M3e(e,{defaultAxisVisible:!1,container:this.$el,zIndex:0}),this.angleMeasurementsPlugin=new ZE(e,{container:this.$el,zIndex:0}),this.tilesetLoaderPlugin=new F5e(e,{sensitivity:this.sensitivity,debugMode:!1}),this.navCubeVisible&&(this.navCube=new hN(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(o=>!this.loadedModels.some(a=>a.id===o.id)));let{apiUrl:t,cloudId:i,projectId:r,accessToken:n}=this.$viewer.api;e.forEach(async(o,a)=>{try{this.$viewer.localContext.loadingProcessStart();let s=await(await fetch(`${t}/cloud/${i}/project/${r}/model/${o.id}/tileset?tile_format=xkt`,{headers:new Headers({Authorization:`Bearer ${n}`})})).json();s.name=String(o.id);let l=this.tilesetLoaderPlugin.load(s);this.tilesets.set(o,l);let c={model:o,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 ",o.id,"with error: ",s),this.loadedModels=this.loadedModels.filter(l=>l.id!==o.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(r=>r.id===i.id)),e.forEach(i=>{let r={model:i,plugin:this};this.$viewer.localContext.hub.emit("pointcloud-model-unloaded",r),this.$viewer.globalContext.hub.emit("pointcloud-model-unloaded",r)}),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 r=null;await new Promise(n=>{r=this.$watch("loading",o=>{o||n()},{immediate:!0})}),r(),this.viewpointPending=!1}await new Promise(r=>setTimeout(r,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 r=this.xeokit.scene.pick({pickSurface:!0,canvasPos:i});if(r){let[n,o,a]=r.worldPos;e({x:n,y:a,z:o,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}}},mli={class:"bimdata-viewer-point-cloud"},vli={ref:"header",class:"bimdata-viewer-point-cloud__header"},wli={ref:"bimdata-xeokit-navcube-canvas",class:"bimdata-viewer-point-cloud__nav-cube"},bli=["id"];function yli(e,t,i,r,n,o){let a=T("NoModelWindowPlaceHolder"),s=T("ModelsLoader"),l=T("Annotations");return M(),q("div",mli,[n.loadedModels.length===0?(M(),ie(a,{key:0})):xe("",!0),x("div",vli,[n.settings.modelLoader==="disabled"?xe("",!0):ti((M(),ie(s,{key:0,"window-positioning":!1,preview:""},null,512)),[[zi,n.modelHeaderShown]])],512),x("canvas",{ref:"bimdata-xeokit-canvas",class:"bimdata-viewer-point-cloud__viewer",onWheel:t[0]||=ei(()=>{},["prevent"])},null,544),n.xeokitCreated?(M(),ie(l,{key:1})):xe("",!0),ti(x("canvas",wli,null,512),[[zi,n.navCubeVisible]]),x("div",{id:n.spinnerCanvasId},null,8,bli)])}var Cli={name:"pointCloud",isViewer:!0,component:W(gli,[["render",yli],["__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"}}},bz="viewer-point-cloud-parameters_parameters",xli={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(bz)||"{}";e=JSON.parse(t)}catch{localStorage.removeItem(bz)}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(bz,JSON.stringify(t))}}},kli={class:"viewer-point-cloud-parameters"},Bli={class:"viewer-point-cloud-parameters_header"},Eli={class:"viewer-point-cloud-parameters_content"},Mli={class:"m-b-18"},Ili={class:"flex justify-between"},Pli={class:"viewer-point-cloud-parameters_content__value"},Sli={class:"flex justify-between"},Tli={class:"viewer-point-cloud-parameters_content__value"};function Dli(e,t,i,r,n,o){let a=T("BIMDataIconParameters"),s=T("BIMDataSlider");return M(),q("div",kli,[x("div",Bli,[L(a,{size:"xs",margin:"0 12px 0 0"}),x("span",null,ee(e.$t("pointCloudParameters.title")),1)]),x("div",Eli,[x("div",Mli,[x("div",Ili,[x("span",null,ee(e.$t("pointCloudParameters.sensitivity")),1),x("span",Pli,ee(o.sensitivity),1)]),L(s,{modelValue:o.sensitivity,"onUpdate:modelValue":t[0]||=l=>o.sensitivity=l,min:20,max:1e3},null,8,["modelValue"])]),x("div",null,[x("div",Sli,[x("span",null,ee(e.$t("pointCloudParameters.fov")),1),x("span",Tli,ee(o.fov),1)]),L(s,{modelValue:o.fov,"onUpdate:modelValue":t[1]||=l=>o.fov=l,min:20,max:120},null,8,["modelValue"])])])])}var Rli={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:W(xli,[["render",Dli],["__scopeId","data-v-e97be8b2"]]),button:{tooltip:"pointCloudParameters.tooltip",position:"right",content:"simple",icon:{component:"BIMDataIconParameters",options:{size:"m"}}}},R6=class{constructor(e,t,i=null,r=!0){this.name=e,this.icon=t,this.group=i,this.label=`drawing-tools.action.${e}`,this.lineStyleComponentDisplayed=r}onActivate(){throw Error("Not implemented")}onDeactivate(){throw Error("Not implemented")}},Lli={},_li={width:"18",height:"18",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg"};function Fli(e,t){return M(),q("svg",_li,[...t[0]||=[x("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 jli=W(Lli,[["render",Fli]]),Uli=class{constructor(){this._listenersTarget=new Map}on(e,t,i=window,r={}){this._listenersTarget.has(i)||this._listenersTarget.set(i,new Map);let n=this._listenersTarget.get(i);n.has(e)||n.set(e,new Map);let o=t.bind(this);return r?.once&&(o=(...a)=>{t.call(this,...a),this.off(e,t,i)}),i.addEventListener(e,o,r),n.get(e).set(t,o),()=>{this.off(e,t,i)}}off(e,t,i=window){if(!this._listenersTarget.has(i))return;let r=this._listenersTarget.get(i);if(!r.has(e))return;let n=r.get(e).get(t);i.removeEventListener(e,n),r.get(e).delete(t),r.get(e).size===0&&r.delete(e),r.size===0&&this._listenersTarget.delete(i)}},Oli="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",Hli="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",qli=`url("${Oli}") 0 20, auto`,Nli=`url("${Hli}") 1 23, auto`,tI=class extends Uli{constructor(e,{pointerUpCursor:t=qli,pointerDownCursor:i=Nli,element:r=e.canvas}={}){super(),this._engine2d=e,this.element=r,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:r,y:n}=this._engine2d.canvas.getBoundingClientRect();return this._engine2d.camera.getPosition({x:Math.max(t-r,0),y:Math.max(i-n,0)})}_getCanvasPosition(e){let{clientX:t,clientY:i}=this._getClientPosition(e),{x:r,y:n}=this.element.getBoundingClientRect();return{x:Math.max(t-r,0),y:Math.max(i-n,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,r=this._eventCache.length>1;e.shiftKey||t||i||r||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()}},G6e=`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`,zli=class extends R6{constructor({viewer:e},t){super("pointer",jli,"pointers",!1),this._pointerManager=new Vli(e,t)}onActivate(){this._pointerManager.enable()}onDeactivate(){this._pointerManager.disable()}},Vli=class extends tI{constructor(e,t){super(e,{pointerUpCursor:G6e,pointerDownCursor:G6e,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 r=0,n=0;if(window.TouchEvent&&t instanceof TouchEvent){let c=t.touches[0];this.previousTouch&&(r=c.pageX-this.previousTouch.pageX,n=c.pageY-this.previousTouch.pageY),this.previousTouch=c}else{let{movementX:c,movementY:d}=t;r=c,n=d}let o={x:i.x-r,y:i.y-n},a=this._engine2d.camera.getPosition(o),s=e.x-a.x,l=e.y-a.y;this._currentDrawing.x+=s,this._currentDrawing.y+=l}},Qli={},Gli={width:"14",height:"16",viewBox:"0 0 14 16",xmlns:"http://www.w3.org/2000/svg"};function Kli(e,t){return M(),q("svg",Gli,[...t[0]||=[x("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 Wli=W(Qli,[["render",Kli]]),Jli="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",Yli="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",Zli=`url("${Jli}") 7 23, auto`,Xli=`url("${Yli}") 7 18, auto`,$li=class extends R6{constructor({viewer:e}){super("pan",Wli,"pointers",!1),this._pointerManager=new eci(e)}onActivate(){this._pointerManager.enable()}onDeactivate(){this._pointerManager.disable()}},eci=class extends tI{constructor(e){super(e,{pointerUpCursor:Zli,pointerDownCursor:Xli}),this.previousTouch=null}onDrag({mouseEvent:e}){let t=0,i=0;if(window.TouchEvent&&e instanceof TouchEvent){let r=e.touches[0];this.previousTouch&&(t=r.pageX-this.previousTouch.pageX,i=r.pageY-this.previousTouch.pageY),this.previousTouch=r}else{let{movementX:r,movementY:n}=e;t=r,i=n}this._engine2d.camera.translate(-t*window.devicePixelRatio,-i*window.devicePixelRatio)}onMouseUp(){this.previousTouch=null}},L6=class extends R6{constructor(e,t,i,r,n,o=i){super(i,r,n),this._pointermanager=new tci(e,t,o)}onActivate(){this._pointermanager.enable()}onDeactivate(){this._pointermanager.disable()}},tci=class extends tI{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)}},ici={},rci={width:"18",height:"18",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg"};function nci(e,t){return M(),q("svg",rci,[...t[0]||=[x("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 oci=W(ici,[["render",nci]]),aci=class extends L6{constructor({viewer:e},t){super(e,t,"pen",oci,null,"freehand")}},sci={},lci={width:"22",height:"22",viewBox:"0 0 22 23",xmlns:"http://www.w3.org/2000/svg"};function cci(e,t){return M(),q("svg",lci,[...t[0]||=[x("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 dci=W(sci,[["render",cci]]),uci=`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`,hci=class extends R6{constructor(e,t){super("text",dci,null,!1),this._viewerPlanPlugin=e,this._drawer=t,this.canvas=e.engine.canvas;let i=De(!1);this.autoDeactivateCallback=null,this.connector={enabledRef:i,deactivateAction(){this.autoDeactivateCallback?.()}},this.onClick=r=>{this.autoDeactivateCallback();let{x:n,y:o}=e.viewer.camera.getPosition({x:r.offsetX,y:r.offsetY});t.makeDrawing("text",{x:n,y:o})}}onActivate(e){this.canvas.addEventListener("click",this.onClick),this._viewerPlanPlugin.$viewer.localContext.el.style.cursor=uci,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}},pci={},Aci={width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"};function fci(e,t){return M(),q("svg",Aci,[...t[0]||=[x("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0 0H16V16H0V0ZM2 2V14H14V2H2Z"},null,-1)]])}var gci=W(pci,[["render",fci]]),mci=class extends L6{constructor({viewer:e},t){super(e,t,"rectangle",gci,"shapes")}},vci={},wci={width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"};function bci(e,t){return M(),q("svg",wci,[...t[0]||=[x("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16 1.37853L1.37853 16L0 14.6215L14.6215 0L16 1.37853Z"},null,-1)]])}var yci=W(vci,[["render",bci]]),Cci=class extends L6{constructor({viewer:e},t){super(e,t,"line",yci,"shapes")}},xci={},kci={width:"17",height:"17",viewBox:"0 0 17 17",xmlns:"http://www.w3.org/2000/svg"};function Bci(e,t){return M(),q("svg",kci,[...t[0]||=[x("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 Eci=W(xci,[["render",Bci]]),Mci=class extends L6{constructor({viewer:e},t){super(e,t,"arrow",Eci,"shapes")}},Ici={},Pci={width:"17",height:"17",viewBox:"0 0 17 17",xmlns:"http://www.w3.org/2000/svg"};function Sci(e,t){return M(),q("svg",Pci,[...t[0]||=[x("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 Tci=W(Ici,[["render",Sci]]),Dci=class extends L6{constructor({viewer:e},t){super(e,t,"ellipse",Tci,"shapes")}},Rci={name:"EraserIcon",props:{color:{type:String,default:"currentColor"}}},Lci=["fill"];function _ci(e,t,i,r,n,o){return M(),q("svg",{width:"20",height:"20",viewBox:"0 0 22 22",fill:i.color,xmlns:"http://www.w3.org/2000/svg"},[...t[0]||=[x("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,Lci)}var Fci=W(Rci,[["render",_ci]]),jci="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",Uci="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",Oci=`url("${jci}") 7 23, auto`,Hci=`url("${Uci}") 7 18, auto`,qci=class extends R6{constructor({viewer:e},t){super("eraser",Fci,null,!1),this._pointerManager=new Nci(e,t)}onActivate(){this._pointerManager.enable()}onDeactivate(){this._pointerManager.disable()}},Nci=class extends tI{constructor(e,t){super(e,{element:e.canvas.parentElement,pointerUpCursor:Oci,pointerDownCursor:Hci}),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)}},j3=class{constructor(e){this.drawingType=e}parse(e){throw Error("Not implemented")}toString(e){throw Error("Not implemented")}},zci=class extends j3{constructor(){super("rectangle")}toString(e){let{p1:t,p2:i,p3:r,p4:n,lineColor:o,lineWidth:a}=e;return`<path d="M ${t.x} ${t.y} L ${i.x} ${i.y} L ${r.x} ${r.y} L ${n.x} ${n.y} Z" stroke-width="${a}" stroke="#${o.toString(16).padStart(6,0)}"/>`}parse(e){let t=e.querySelector("path"),[,i,r,,n,o,,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(r)},p2:{x:parseFloat(n),y:parseFloat(o)},p3:{x:parseFloat(a),y:parseFloat(s)},p4:{x:parseFloat(l),y:parseFloat(c)},lineColor:parseInt(d,16),lineWidth:parseFloat(u)}}},Vci=class extends j3{constructor(){super("line")}toString(e){let{p1:t,p2:i,lineWidth:r,lineColor:n}=e;return`<line x1="${t.x}" y1="${t.y}" x2="${i.x}" y2="${i.y}" stroke-width="${r}" stroke="#${n.toString(16).padStart(6,0)}"/>`}parse(e){let t=e.querySelector("line"),i=t.getAttribute("x1"),r=t.getAttribute("y1"),n=t.getAttribute("x2"),o=t.getAttribute("y2"),a=t.getAttribute("stroke")?.substring(1),s=t.getAttribute("stroke-width");return{p1:{x:parseFloat(i),y:parseFloat(r)},p2:{x:parseFloat(n),y:parseFloat(o)},lineWidth:parseFloat(s),lineColor:parseInt(a,16)}}},Qci=class extends j3{constructor(){super("arrow")}toString(e){let{p1:t,p2:i,lineWidth:r,lineColor:n}=e;return`<line x1="${t.x}" y1="${t.y}" x2="${i.x}" y2="${i.y}" stroke-width="${r}" stroke="#${n.toString(16).padStart(6,0)}"/>`}parse(e){let t=e.querySelector("line"),i=t.getAttribute("x1"),r=t.getAttribute("y1"),n=t.getAttribute("x2"),o=t.getAttribute("y2"),a=t.getAttribute("stroke")?.substring(1),s=t.getAttribute("stroke-width");return{p1:{x:parseFloat(i),y:parseFloat(r)},p2:{x:parseFloat(n),y:parseFloat(o)},lineWidth:parseFloat(s),lineColor:parseInt(a,16)}}};function K6e(e){if(e.length===0)return"";let t=e[0],i=`M ${t.x} ${t.y}`;for(let r=0;r<e.length;r++){let n=e[r];i+=` C ${n.cpX1} ${n.cpY1} ${n.cpX2} ${n.cpY2} ${n.toX} ${n.toY}`}return i}function W6e(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 r=parseFloat(t.shift()),n=parseFloat(t.shift()),o=[];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());o.push({type:"curve",x:r,y:n,cpX1:a,cpY1:s,cpX2:l,cpY2:c,toX:d,toY:u}),r=d,n=u}return o}var Gci=class extends j3{constructor(){super("ellipse")}toString(e){let{curve1:t,curve2:i,curve3:r,curve4:n,lineColor:o,lineWidth:a}=e;return`<path d="${K6e([t,i,r,n])} Z" stroke-width="${a}" stroke="#${o.toString(16).padStart(6,0)}" />`}parse(e){let t=e.querySelector("path"),i=W6e(t.getAttribute("d")),r=t.getAttribute("stroke")?.substring(1),n=t.getAttribute("stroke-width");return{curves:i,lineColor:parseInt(r,16),lineWidth:parseFloat(n)}}},Kci=class extends j3{constructor(){super("text")}toString(e){let{x:t,y:i,rotation:r,scale:n,text:o,size:a,color:s}=e;return`<text x="${t}" y="${i}" tranform="rotate(${r}) scale(${n})" font-size="${a}px" ${s?`color="#${s}"`:""}>${o}</text>`}parse(e){let t=e.querySelector("text"),i=t.getAttribute("x"),r=t.getAttribute("y"),n=t.getAttribute("tranform").match(/rotate\((.*)\)/)?.[1]??0,o=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(r),rotation:parseFloat(n),scale:parseFloat(o),text:a,size:parseFloat(s),color:l?l.slice(1):null}}},Wci=class extends j3{constructor(){super("freehand")}toString(e){let{curves:t,lineWidth:i,lineColor:r}=e,n=`stroke-width="${i}" stroke="#${r.toString(16).padStart(6,0)}"`;return`<path d="${K6e(t)}" ${n}/>`}parse(e){let t=e.querySelector("path"),i=W6e(t.getAttribute("d")),r=t.getAttribute("stroke")?.substring(1),n=t.getAttribute("stroke-width");return{curves:i,lineWidth:parseFloat(n),lineColor:parseInt(r,16)}}},Jci=class{constructor(){this.drawingSvgParsers=new Map,[new zci,new Vci,new Qci,new Gci,new Wci,new Kci].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"),r=+t.querySelector("svg").getAttribute("data-bimdata-elevation"),n=this.drawingSvgParsers.get(i);if(!n)throw TypeError(`No drawing parser for type ${i}`);let o=n.parse(t);return o.apiId=e.id,o.type=i,o.z=r,o}catch(t){console.warn(`[Drawing Tools - Parser] Error parsing drawing ${e.id}, ignored.`,t)}}toString(e){let{type:t,z:i}=e,r=this.drawingSvgParsers.get(t);if(!r)throw TypeError(`No drawing parser for type ${t}`);return`<svg type="${t}" data-bimdata-elevation="${i}" xmlns="http://www.w3.org/2000/svg">${r.toString(e)}</svg>`}},Yci=class{constructor(e){this._api=e,this._parser=new Jci,this.queue=Rv()}async getDrawingsData(e){let{cloudId:t,projectId:i}=this._api;return(await this._api.apiClient.modelApi.getDrawings(t,e,i)).map(r=>this._parser.parse(r)).filter(Boolean)}save(e,t){let i=this._parser.toString(e);if(!i)return;let{cloudId:r,projectId:n}=this._api,o={content:i},a;a=e.apiId?async()=>{try{await this._api.apiClient.modelApi.updateDrawing(r,e.apiId,t,n,o)}catch(s){console.error(`Cannot update drawing of type: "${e.type}"`,s)}}:async()=>{try{e.apiId=(await this._api.apiClient.modelApi.createDrawing(r,t,n,o)).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:r}=this._api;try{await this._api.apiClient.modelApi.deleteDrawing(i,e.apiId,t,r)}catch(n){console.error(`Cannot delete drawing of type: "${e.type}"`,n)}}},J6e=class{constructor(e){this.drawingTypes=e}pick(e,t){throw Error("Not implemented")}},Zci=class extends J6e{constructor(e){super(["rectangle","ellipse","arrow","line","freehand"]),this._engine2d=e}pick(e,t){let{canvasPosition:i}=t,r=this._engine2d.picker.pick(i);if(r)return e.get(r.id)}},Xci=class extends J6e{constructor(){super(["text"])}pick(e,t){let{mouseEvent:i}=t,r=i.target;return e.get(r.id)}},Y6e=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.")}},Z6e=class{constructor(e){this.drawingTypes=e}create(e,t){throw Error("Not implemented")}},$ci="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",edi="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",tdi=4,idi=40,X6e=4,rdi=2,ndi={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=Ot("$viewer").localContext.viewer.viewer.canvas,r=De(e.newMarker),n=De(e.initText),o=De(e.initSize),a=De(e.initColor);Qt(n,y=>t("text-update",y)),Qt(o,y=>t("size-update",y)),Qt(a,y=>t("color-update",y));let s=De(null),l=()=>s.value?.focus(),c=De(null),d=De(null),u=De(null);async function h(){if(!r.value)return;await On();let{width:y}=c.value.getBoundingClientRect();d.value=y+12,u.value=1,await On();let{scrollHeight:C}=s.value;u.value=C+2}Qt([()=>e.scale,r,n,o],h);let p=()=>{e.textToolEnabled&&(r.value=!0)},A=y=>{y.key==="Escape"&&(r.value=!1)};Qt(r,async y=>{t("edit-update",y),y?(document.addEventListener("keydown",A),await On(),l()):(document.removeEventListener("keydown",A),v.value=!1)});let f=ot(()=>o.value/(rdi*window.devicePixelRatio)),m=()=>{o.value>tdi&&(o.value-=X6e),l()},g=()=>{o.value<idi&&(o.value+=X6e),l()},w=De(null),v=De(!1),b=De(!1);return Cr(()=>{h(),l()}),{paletteSvg:$ci,textCursor:edi,textarea:s,textEl:c,colorElement:w,edit:r,text:n,textAreaWidth:d,textAreaHeight:u,size:f,sizeRef:o,color:a,colorSelectorDisplayed:v,colorSelectorTop:b,onTextClick:p,decrementSize:m,incrementSize:g,onTextColorClick:()=>{if(v.value=!v.value,v.value){let{y,height:C}=i.getBoundingClientRect(),{y:B}=w.value.getBoundingClientRect();b.value=B>y+C/2}},onTextColorUpdate:y=>{a.value=y,v.value=!1,l()},onDeleteClick:()=>{t("delete-marker"),t("delete-drawing")}}}},odi=["id"],adi={key:0},sdi={class:"bimdata-drawing-tools__text-marker__edit-content",style:"transform: translate(-1px, -1px)"},ldi={class:"bimdata-drawing-tools__text-marker__edit-content__header"},cdi=["src"];function ddi(e,t,i,r,n,o){let a=T("BIMDataColorSelector"),s=T("BIMDataIconDelete"),l=Mr("click-away");return M(),q("div",{class:"bimdata-drawing-tools__text-marker",style:je(`font-size:${r.size}px; z-index: ${r.edit?1:0};`)},[x("div",{style:je(`cursor: ${i.textToolEnabled?r.textCursor:""}`)},[x("div",{ref:"textEl",class:"bimdata-drawing-tools__text-marker__text",style:je(`
2616
2616
  font-size:${r.size}px;
2617
2617
  transform-origin: top left;
2618
2618
  transform: scale(${i.scale});
@@ -6502,5 +6502,5 @@ void main() {
6502
6502
  --bimdata-local-context-width: ${r.width}px;
6503
6503
  --bimdata-local-context-center-width: ${r.centerWidth}px;
6504
6504
  --bimdata-local-context-resolution: ${r.resolution};
6505
- `),onMouseenter:t[0]||=(...h)=>r.onMouseEnter&&r.onMouseEnter(...h),onMouseleave:t[1]||=(...h)=>r.onMouseLeave&&r.onMouseLeave(...h)},[L(a,{ref:"modalManagerTemplateRef"},null,512),x("div",bbi,[r.windowPlugins.leftSidePanel?(M(),ie(s,{key:0,plugin:r.windowPlugins.leftSidePanel},null,8,["plugin"])):xe("",!0),x("div",ybi,[(M(!0),q(It,null,pi(r.windowPlugins.free,h=>(M(),ie(l,{key:h.name,class:Ue({"window-container__content__center__viewer":h.isViewer}),plugin:h},null,8,["class","plugin"]))),128)),L(c,{position:"left",plugins:r.windowPlugins.leftButtonColumn},null,8,["plugins"]),L(c,{position:"right",plugins:r.windowPlugins.rightButtonColumn},null,8,["plugins"])]),r.windowPlugins.rightSidePanel?(M(),ie(s,{key:1,plugin:r.windowPlugins.rightSidePanel},null,8,["plugin"])):xe("",!0)]),r.loading?(M(),q("div",Cbi,[r.spinner&&r.spinner.component?(M(),ie(oo(r.spinner.component),yd(Pl({key:0},r.spinner.props)),null,16)):(M(),ie(d,{key:1,size:"20px",border:"3px"}))])):xe("",!0),r.layoutSettingsDisplayed?(M(),q("div",xbi,[L(u)])):xe("",!0)],36)}var Bbi=W(wbi,[["render",kbi],["__scopeId","data-v-485f288e"]]),Ebi=class{constructor(e=!0){let t=gwi(iy,null,{resizable:e});t.registerContent("default",Bbi),this.settings=Ma({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?mwi(e):null}copy(e,t=!0){return vwi(this.areas.layout,e,t)}open({ratio:e,direction:t,insertAfter:i,windowName:r=null,windowState:n=null,localContextId:o=null}={}){let a=r?{options:{windowName:r,windowState:n}}:null;return o===null?this.areas.splitLayout(e,t,i,a):this.areas.split(o,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),r=new Set(t.windowState?.modelIds);return i.size===r.size&&[...i].every(n=>r.has(n))}return e.windowName||t.windowName||e.direction!==t.direction||e.children.length!==t.children.length?!1:e.children.every((i,r)=>this.compare(i,t.children[r]))}},Mbi={name:"@bimdata/viewer",type:"module",version:"2.17.0-beta.5",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"}},Ibi=1,Pbi=class{math=r3t;constructor({plugins:e,api:t,ui:i,locale:r="fr"}){this.instanceId=Ibi++,this.pluginManager=new s3i(e),this.windowManager=new c3i,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new C5i(t),this.globalContext=new q_e(this),this.state=_5i(this),this.shortcutManager=QIe(this.state),this.uiSettings=i||{},this.i18n=new O_e(r),this._contextMenu=null,this.layout=new Ebi(this.uiSettings.resizable!==!1),this._darkTheme=De(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 Mbi.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||zIe}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 Sbi(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 Tbi=Object.freeze({25:"GUEST",50:"USER",100:"ADMIN"}),v4=Object.freeze({READ:"read",WRITE:"write"});function rxe(e){let t={};return e.forEach(i=>{let[r,n]=i.split(":");t[r]?t[r].push(n):t[r]=[n]}),t}var Dbi={token_scopes:[],usable_scopes:[],user_role:25};function nxe(e=Dbi){let t=rxe(e.token_scopes),i=rxe(e.usable_scopes);return{...pfe(e),tokenScopes:t,usableScopes:i,userRole:Tbi[e.user_role],user:e.user?pfe(e.user):null,hasBcfReadPermission:i.bcf?.includes(v4.READ)??!1,hasBcfWritePermission:i.bcf?.includes(v4.WRITE)??!1,hasModelReadPermission:i.model?.includes(v4.READ)??!1,hasModelWritePermission:i.model?.includes(v4.WRITE)??!1,hasDocReadPermission:i.document?.includes(v4.READ)??!1,hasDocWritePermission:i.document?.includes(v4.WRITE)??!1}}var Rbi={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"}}}}},Lbi=({apiClient:e,fetchUsers:t,i18nPlugin:i}={})=>({install(r){e?wn.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(Rbi).forEach(([n,o])=>{i.global.mergeLocaleMessage(n,o)}):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(_He).forEach(([n,o])=>{r.component(n,o)})}}),_bi={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"}}},Fbi=({i18nPlugin:e}={})=>({install(t){e?Object.entries(_bi).forEach(([i,r])=>{e.global.mergeLocaleMessage(i,r)}):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(psi).forEach(([i,r])=>{t.component(i,r)})}}),jbi={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(r=>r===e)||t.value()},window.addEventListener("mousedown",e.clickAwayHandler,!0)},unmounted(e){window.removeEventListener("mousedown",e.clickAwayHandler,!0),delete e.clickAwayHandler}},Ubi=bo({BIMDataClickAway:()=>sh,BIMDataClickInputAway:()=>jbi}),Obi=e=>({install(t){Object.entries(qpt).forEach(([i,r])=>{e&&e.excludedComponents&&e.excludedComponents.length>0&&e.excludedComponents.includes(i)||(!e||!e.includedComponents||e.includedComponents.includes(i))&&t.component(i,r)}),(!e||e.directives!==!1)&&Object.entries(Ubi).forEach(([i,r])=>t.directive(i.split("BIMData")[1],r))}}),Hbi={name:"LiWrapper",render(){return ao("li",this.$slots.default())}};function qbi(e,t){var i=new Set([]);return e.forEach(r=>{t.has(r)||i.add(r)}),i}var ap=tl("id"),Nbi=({contextMenu:e,objects:t=[],state:i=e.$viewer.state,pictos:r})=>[{name:"selectAll",get group(){return e.groupPositions.select},position:1,get label(){return e.$t("context_menu.select_all")},get picto(){return r.get(this.name)},execute:()=>i.selectObjects(t.filter(Ku(cn("visible"),Jf("selected"))).map(ap)),predicate:()=>t.some(Ku(cn("visible"),Jf("selected")))},{name:"deselectAll",get group(){return e.groupPositions.select},position:2,get label(){return e.$t("context_menu.deselect_all")},get picto(){return r.get(this.name)},execute:()=>i.deselectObjects(t.filter(cn("selected")).map(ap)),predicate:()=>t.some(cn("selected"))},{name:"selectSimilar",get group(){return e.groupPositions.select},position:3,get label(){return e.$t("context_menu.select_similar")},get picto(){return r.get(this.name)},execute(){let n=t.filter(o=>o.visible&&o.type===this.selectedObject.type&&o.id!==this.selectedObject.id).map(ap);i.selectObjects(n)},selectedObject:null,predicate(){let n=t.filter(Ku(cn("visible"),cn("selected")));return n.length===1&&n[0].type!==void 0?(this.selectedObject=n[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 n=new Set(t.filter(cn("selected")).map(ap)),o=new Set(t.filter(cn("visible")).map(ap));i.selectObjects(Array.from(qbi(o,n)),{exclusive:!0})},predicate:()=>t.some(Ku(Jf("selected"),cn("visible")))&&t.some(Ku(cn("selected"),cn("visible")))},{name:"showAll",get group(){return e.groupPositions.visibility},position:1,get label(){return e.$t("context_menu.show_all")},get picto(){return r.get(this.name)},execute:()=>i.showObjects(t.filter(Jf("visible")).map(ap)),predicate:()=>t.some(Jf("visible"))},{name:"hide",get group(){return e.groupPositions.visibility},position:2,get label(){return e.$t("context_menu.hide")},get picto(){return r.get(this.name)},objectsToHide:null,execute(){let n=this.objectsToHide.filter(cn("selected"));n.length>0&&i.deselectObjects(n.map(ap)),i.hideObjects(this.objectsToHide.map(ap))},predicate(){return this.objectsToHide=t.filter(Ku(cn("selected"),cn("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 n=t.filter(cn("visible"));n.some(cn("selected"))&&i.deselectObjects(n.filter(cn("selected")).map(ap)),i.hideObjects(n.map(ap))},predicate:()=>t.some(cn("visible"))}].filter(n=>n.predicate()),zbi={components:{LiWrapper:Hbi},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 r=new Map;return i&&this.$viewer.shortcutManager.getShortcuts(i).forEach(n=>r.set(n.name,n.key)),Nbi({contextMenu:this,objects:e,state:t,pictos:r})},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,r)=>(i.position=i.position||0,r.position=r.position||0,i.position-r.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}}},Vbi={key:0,class:"separator"},Qbi={class:"menu-text"},Gbi={key:1,class:"menu-picto"},Kbi={key:0,class:"context-menu__spinner"};function Wbi(e,t,i,r,n,o){let a=T("BIMDataIconChevron"),s=T("LiWrapper"),l=T("BIMDataSpinner"),c=Mr("click-away");return n.displayed&&(n.currentCommands.length||n.asyncPredicateRunning)?ti((M(),q("ul",{key:0,class:"bimdata-list context-menu",style:je(o.position)},[(M(!0),q(It,null,pi(n.currentCommands,(d,u)=>(M(),ie(s,{key:d.label,class:"context-menu__element",onClick:h=>o.executeCommand(d)},{default:K(()=>[o.isGroupIntersection(u)?(M(),q("div",Vbi)):xe("",!0),x("div",Qbi,ee(d.label),1),!d.component&&d.picto?(M(),q("span",Gbi,ee(d.picto),1)):d.component?(M(),ie(a,{key:2,size:"xxs",class:"fill-primary"})):xe("",!0)]),_:2},1032,["onClick"]))),128)),n.asyncPredicateRunning?(M(),q("li",Kbi,[L(l)])):xe("",!0)],4)),[[c,o.away]]):xe("",!0)}var Jbi=W(zbi,[["render",Wbi],["__scopeId","data-v-5b87d4a3"]]),Ybi={name:"ViewerHeader",inject:["$viewer"],props:{visible:{type:Boolean,default:!0}},setup(){let e=Ot("$viewer"),t=Ma(new Map);return{logo:e.uiSettings.bimdataLogo!==!1,version:e.uiSettings.version===!1?null:e.version,headerContent:t,headerRightContentComponents:ot(()=>Array.from(t.values()).filter(i=>i.position==="right").sort((i,r)=>i.order-r.order).map(i=>i.component)),headerLeftContentComponents:ot(()=>Array.from(t.values()).filter(i=>i.position==="left").sort((i,r)=>i.order-r.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}}},Zbi={class:"viewer-header"},Xbi={class:"viewer-header__content"},$bi={class:"viewer-header__content__left"},e6i={class:"viewer-header__content__right"},t6i={key:0,class:"m-l-6 flex items-center"},i6i={key:1,class:"viewer-header__version"};function r6i(e,t,i,r,n,o){let a=T("BIMDataIllustration");return ti((M(),q("div",Zbi,[x("div",Xbi,[x("div",$bi,[(M(!0),q(It,null,pi(r.headerLeftContentComponents,s=>(M(),ie(oo(s),{key:s.name}))),128))]),x("div",e6i,[(M(!0),q(It,null,pi(r.headerRightContentComponents,s=>(M(),ie(oo(s),{key:s.name}))),128))])]),r.logo||r.version?(M(),q("div",t6i,[r.logo?(M(),ie(a,{key:0,name:"logo",width:"30px",height:"30px"})):xe("",!0),r.version?(M(),q("div",i6i,ee(r.version),1)):xe("",!0)])):xe("",!0)],512)),[[zi,i.visible]])}var n6i=W(Ybi,[["render",r6i],["__scopeId","data-v-5c9ea6b6"]]),o6i={emits:["resize"],setup(e,{emit:t}){return{onResizerMousedown:i=>{i.preventDefault();let r=i.clientX,n=a=>{a.preventDefault();let s=a.clientX-r;r=a.clientX,t("resize",s)},o=a=>{a.preventDefault(),window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",o)};window.addEventListener("mousemove",n),window.addEventListener("mouseup",o)}}}},a6i={class:"bimdata-separator"};function s6i(e,t,i,r,n,o){return M(),q("div",a6i,[t[1]||=x("div",{class:"bimdata-separator__line"},null,-1),x("div",{class:"bimdata-separator__resizer",onMousedown:t[0]||=(...a)=>r.onResizerMousedown&&r.onResizerMousedown(...a)},null,32)])}var l6i={components:{Separator:W(o6i,[["render",s6i],["__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=De(null),i=De(e.sidePanel.width??400);return Qt(()=>e.sidePanel,()=>{Object.defineProperty(e.sidePanel,"width",{get(){return i.value},set(r){if(typeof r!="number"||r<=0){console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof r}`);return}i.value=r}}),Object.defineProperty(e.sidePanel,"componentInstance",{get(){return t.value},enumerable:!0})},{immediate:!0}),{componentInstance:t,width:i,onResize:(r,n=1)=>{let o=i.value+r*n;i.value=Math.max(0,o)}}}},c6i={class:"bimdata-global-side-panel__component"};function d6i(e,t,i,r,n,o){let a=T("Separator");return M(),q("div",{class:"bimdata-global-side-panel",style:je(`width: ${r.width}px`)},[i.sidePanel.resizable&&i.position==="right"?(M(),ie(a,{key:0,onResize:t[0]||=s=>r.onResize(s,-1)})):xe("",!0),x("div",c6i,[(M(),ie(oo(i.sidePanel.component),{ref:"componentInstance"},null,512))]),i.sidePanel.resizable&&i.position==="left"?(M(),ie(a,{key:1,onResize:t[1]||=s=>r.onResize(s)})):xe("",!0)],4)}var u6i={name:"BimdataViewer",components:{ContextMenu:Jbi,ViewerHeader:n6i,ModalManager:exe,GlobalSidePanel:W(l6i,[["render",d6i],["__scopeId","data-v-82d0d4cb"]])},setup(){let e=Ot("$viewer"),{globalContext:t,shortcutManager:i}=e;Yr(()=>{i&&i.destroy(),t.hub.clear()}),Cr(()=>{e.pluginManager.runPluginsScripts(e)});let r=ot(()=>e.uiSettings.bimdataLogo!==!1&&(t.localContexts.length!==1||t.localContexts[0].window?.logoAndVersion)),n=ot(()=>e.uiSettings.version!==!1&&(t.localContexts.length!==1||t.localContexts[0].window?.logoAndVersion)?e.version:null),o=ot(()=>t.leftSidePanel),a=ot(()=>t.rightSidePanel),s=ot(()=>{let p=e.uiSettings.header!==!1,A=t.localContexts.length===1&&t.localContexts[0].window?.header===!1,f=!!(o.value||a.value);return p&&(!A||f)}),l=e.uiSettings.contextMenu!==!1,c=De(null);function d(p){l&&c.value.open(p)}function u(){e.shortcutManager.active=!0}function h(){e.shortcutManager.active=!1}return{Layout:e.layout.areas.component,onContextMenu:d,onMouseenter:u,onMouseleave:h,isHeaderVisible:s,viewerTemplateRef:t.templateRef,modalManagerTemplateRef:t.modalManagerTemplateRef,headerTemplateRef:t.headerTemplateRef,contextMenuTemplateRef:c,contextMenuEnabled:l,bimdataLogoOnSingleWindow:r,viewerVersionOnSingleWindow:n,version:e.version,loading:ot(()=>t.loading),spinner:ot(()=>t.spinner),leftSidePanel:o,rightSidePanel:a}}},h6i={key:1,class:"bimdata-context-loading-overlay",style:{"z-index":"3"}},p6i={key:2,class:"viewer__logo"},A6i={key:1,class:"version m-t-6"};function f6i(e,t,i,r,n,o){let a=T("ModalManager"),s=T("ContextMenu"),l=T("ViewerHeader"),c=T("GlobalSidePanel"),d=T("BIMDataSpinner"),u=T("BIMDataIllustration");return M(),q("div",{id:"bimdata-viewer",ref:"viewerTemplateRef",class:"bimdata-viewer bimdata-design-system bimdata-scrollbar",onContextmenu:t[0]||=(...h)=>r.onContextMenu&&r.onContextMenu(...h),onMouseenter:t[1]||=(...h)=>r.onMouseenter&&r.onMouseenter(...h),onMouseleave:t[2]||=(...h)=>r.onMouseleave&&r.onMouseleave(...h)},[L(a,{ref:"modalManagerTemplateRef"},null,512),r.contextMenuEnabled?(M(),ie(s,{key:0,ref:"contextMenuTemplateRef"},null,512)):xe("",!0),L(l,{ref:"headerTemplateRef",visible:r.isHeaderVisible},null,8,["visible"]),x("div",{class:"bimdata-viewer__content",style:je(r.isHeaderVisible?"height: calc(100% - var(--bimdata-viewer-header-height, 40px))":"height: 100%")},[r.leftSidePanel?(M(),ie(c,{key:0,"side-panel":r.leftSidePanel,position:"left"},null,8,["side-panel"])):xe("",!0),(M(),ie(oo(r.Layout),{style:"height: 100%; flex-grow: 1;"})),r.rightSidePanel?(M(),ie(c,{key:1,"side-panel":r.rightSidePanel,position:"right"},null,8,["side-panel"])):xe("",!0)],4),r.loading?(M(),q("div",h6i,[r.spinner&&r.spinner.component?(M(),ie(oo(r.spinner.component),yd(Pl({key:0},r.spinner.props)),null,16)):(M(),ie(d,{key:1,size:"40px",border:"5px"}))])):xe("",!0),!r.isHeaderVisible&&(r.bimdataLogoOnSingleWindow||r.viewerVersionOnSingleWindow)?(M(),q("div",p6i,[r.bimdataLogoOnSingleWindow?(M(),ie(u,{key:0,name:"logo"})):xe("",!0),r.viewerVersionOnSingleWindow?(M(),q("div",A6i,ee(r.version),1)):xe("",!0)])):xe("",!0)],544)}var g6i=W(u6i,[["render",f6i],["__scopeId","data-v-0c1c941a"]]),m6i=["src"],v6i={class:"bimdata-models__header"},w6i={key:0,class:"bimdata-models__header__loader"},b6i={class:"bimdata-models__header__picto"},y6i={class:"bimdata-models__header__name"},C6i={key:0,class:"bimdata-models__header__name--empty"},x6i={key:1,class:"bimdata-models__header__name--empty"},k6i={key:3},B6i=["onMousemove","onClick"],oxe=W({__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=Ot("$viewer"),r=De(),n=De(0),o=De(0),a=De(),s=Lr([]),l=De(!1),c=ot(()=>i.localContext.loadedModels),d=ot(()=>i.localContext.loadedModelIds),u=ot(()=>i.localContext.loadingModelIds),h=ot(()=>i.localContext.multiModel),p=ot(()=>(t.customFilter?s.value.filter(t.customFilter):s.value).map(C=>c.value.find(B=>B.document?.head_id!=null&&B.document.head_id===C.document.id)??C)),A=C=>d.value.includes(C),f=C=>u.value.includes(C),m=ot(()=>{let{x:C,y:B}=a.value?.getBoundingClientRect()??{x:0,y:0};return`top:${o.value-B}px; left:${n.value-C}px;`}),g=C=>{!h.value&&A(C.id)||u.value.length>0||(i.localContext.loadedModelIds.includes(C.id)?i.localContext.unloadModels([C.id]):i.localContext.loadModels([C.id]))},w=C=>{switch(C){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},v=(C,B)=>{C?.viewer_360_file&&(n.value=B.clientX,o.value=B.clientY),r.value=C?.viewer_360_file},b=async C=>{l.value=!0;try{return(await i.api.apiClient.modelApi.getModels(i.api.cloudId,i.api.projectId,void 0,void 0,C)).filter(B=>i.state.models.some(I=>I.archived)||!B.archived).sort(hh("updated_at",!1))}catch(B){console.error("[Models] Cannot get project models. Error: ",B)}finally{l.value=!1}return[]},y=C=>C.children?.some(B=>A(B.id))??!1;return b(i.localContext.modelTypes).then(C=>{s.value=C}),(C,B)=>{let I=T("BIMDataSpinner"),E=T("BIMDataIconModel3D"),P=T("BIMDataTextbox"),S=T("BIMDataCheckbox"),D=T("BIMDataRadio"),j=T("BIMDataIcon"),V=T("BIMDataDropdownList");return M(),q("div",{ref_key:"templateRef",ref:a,class:Ue(["bimdata-models",{"bimdata-models--window-positioning":e.windowPositioning}])},[r.value?(M(),q("div",{key:0,class:"bimdata-models__preview",style:je(m.value)},[x("img",{src:r.value},null,8,m6i)],4)):xe("",!0),L(V,{style:je(`--bimdata-models-width: ${e.width};`),width:e.width,list:p.value,"element-key":"id","per-page":40,loading:l.value,class:"bimdata-models__list",disabled:p.value.length===0,onElementClick:g},{header:K(({isOpen:Q})=>[x("div",v6i,[l.value||u.value.length>0?(M(),q("div",w6i,[L(I)])):(M(),q(It,{key:1},[x("div",b6i,[L(E)]),x("div",{class:Ue(["bimdata-models__header__number bimdata-info-length",{"bimdata-models__header__number--empty":d.value.length===0}])},[x("span",null,ee(d.value.length),1)],2),x("div",y6i,[p.value.length===0?(M(),q("span",C6i,ee(C.$t("model.no_model")),1)):d.value.length===0?(M(),q("span",x6i,ee(C.$t("model.no_loaded_model")),1)):d.value.length===1?(M(),ie(P,{key:2,text:c.value[0].name,tooltip:!Q},null,8,["text","tooltip"])):d.value.length>1?(M(),q("span",k6i,ee(C.$t("model.selected_models")),1)):xe("",!0)])],64))])]),element:K(({element:Q,close:z})=>[x("div",{class:"bimdata-models__model",onMousemove:J=>e.preview&&v(Q,J),onMouseout:B[0]||=J=>e.preview&&v(),onClick:()=>{!h.value&&!A(Q.id)&&z()}},[h.value?(M(),ie(S,{key:0,"model-value":A(Q.id)||y(Q),disabled:Q.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])):(M(),ie(D,{key:1,"model-value":A(Q.id)||y(Q),disabled:Q.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])),L(j,{margin:"0 calc(var(--spacing-unit) / 2)",name:w(Q.status),size:"xs",class:Ue({"fill-success":Q.status==="C","fill-high":Q.status==="E"})},null,8,["name","class"]),L(P,{class:Ue({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":Q.status!=="C"||u.value.length>0}),text:Q.name,width:`calc(100% -
6505
+ `),onMouseenter:t[0]||=(...h)=>r.onMouseEnter&&r.onMouseEnter(...h),onMouseleave:t[1]||=(...h)=>r.onMouseLeave&&r.onMouseLeave(...h)},[L(a,{ref:"modalManagerTemplateRef"},null,512),x("div",bbi,[r.windowPlugins.leftSidePanel?(M(),ie(s,{key:0,plugin:r.windowPlugins.leftSidePanel},null,8,["plugin"])):xe("",!0),x("div",ybi,[(M(!0),q(It,null,pi(r.windowPlugins.free,h=>(M(),ie(l,{key:h.name,class:Ue({"window-container__content__center__viewer":h.isViewer}),plugin:h},null,8,["class","plugin"]))),128)),L(c,{position:"left",plugins:r.windowPlugins.leftButtonColumn},null,8,["plugins"]),L(c,{position:"right",plugins:r.windowPlugins.rightButtonColumn},null,8,["plugins"])]),r.windowPlugins.rightSidePanel?(M(),ie(s,{key:1,plugin:r.windowPlugins.rightSidePanel},null,8,["plugin"])):xe("",!0)]),r.loading?(M(),q("div",Cbi,[r.spinner&&r.spinner.component?(M(),ie(oo(r.spinner.component),yd(Pl({key:0},r.spinner.props)),null,16)):(M(),ie(d,{key:1,size:"20px",border:"3px"}))])):xe("",!0),r.layoutSettingsDisplayed?(M(),q("div",xbi,[L(u)])):xe("",!0)],36)}var Bbi=W(wbi,[["render",kbi],["__scopeId","data-v-485f288e"]]),Ebi=class{constructor(e=!0){let t=gwi(iy,null,{resizable:e});t.registerContent("default",Bbi),this.settings=Ma({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?mwi(e):null}copy(e,t=!0){return vwi(this.areas.layout,e,t)}open({ratio:e,direction:t,insertAfter:i,windowName:r=null,windowState:n=null,localContextId:o=null}={}){let a=r?{options:{windowName:r,windowState:n}}:null;return o===null?this.areas.splitLayout(e,t,i,a):this.areas.split(o,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),r=new Set(t.windowState?.modelIds);return i.size===r.size&&[...i].every(n=>r.has(n))}return e.windowName||t.windowName||e.direction!==t.direction||e.children.length!==t.children.length?!1:e.children.every((i,r)=>this.compare(i,t.children[r]))}},Mbi={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"}},Ibi=1,Pbi=class{math=r3t;constructor({plugins:e,api:t,ui:i,locale:r="fr"}){this.instanceId=Ibi++,this.pluginManager=new s3i(e),this.windowManager=new c3i,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new C5i(t),this.globalContext=new q_e(this),this.state=_5i(this),this.shortcutManager=QIe(this.state),this.uiSettings=i||{},this.i18n=new O_e(r),this._contextMenu=null,this.layout=new Ebi(this.uiSettings.resizable!==!1),this._darkTheme=De(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 Mbi.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||zIe}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 Sbi(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 Tbi=Object.freeze({25:"GUEST",50:"USER",100:"ADMIN"}),v4=Object.freeze({READ:"read",WRITE:"write"});function rxe(e){let t={};return e.forEach(i=>{let[r,n]=i.split(":");t[r]?t[r].push(n):t[r]=[n]}),t}var Dbi={token_scopes:[],usable_scopes:[],user_role:25};function nxe(e=Dbi){let t=rxe(e.token_scopes),i=rxe(e.usable_scopes);return{...pfe(e),tokenScopes:t,usableScopes:i,userRole:Tbi[e.user_role],user:e.user?pfe(e.user):null,hasBcfReadPermission:i.bcf?.includes(v4.READ)??!1,hasBcfWritePermission:i.bcf?.includes(v4.WRITE)??!1,hasModelReadPermission:i.model?.includes(v4.READ)??!1,hasModelWritePermission:i.model?.includes(v4.WRITE)??!1,hasDocReadPermission:i.document?.includes(v4.READ)??!1,hasDocWritePermission:i.document?.includes(v4.WRITE)??!1}}var Rbi={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"}}}}},Lbi=({apiClient:e,fetchUsers:t,i18nPlugin:i}={})=>({install(r){e?wn.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(Rbi).forEach(([n,o])=>{i.global.mergeLocaleMessage(n,o)}):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(_He).forEach(([n,o])=>{r.component(n,o)})}}),_bi={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"}}},Fbi=({i18nPlugin:e}={})=>({install(t){e?Object.entries(_bi).forEach(([i,r])=>{e.global.mergeLocaleMessage(i,r)}):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(psi).forEach(([i,r])=>{t.component(i,r)})}}),jbi={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(r=>r===e)||t.value()},window.addEventListener("mousedown",e.clickAwayHandler,!0)},unmounted(e){window.removeEventListener("mousedown",e.clickAwayHandler,!0),delete e.clickAwayHandler}},Ubi=bo({BIMDataClickAway:()=>sh,BIMDataClickInputAway:()=>jbi}),Obi=e=>({install(t){Object.entries(qpt).forEach(([i,r])=>{e&&e.excludedComponents&&e.excludedComponents.length>0&&e.excludedComponents.includes(i)||(!e||!e.includedComponents||e.includedComponents.includes(i))&&t.component(i,r)}),(!e||e.directives!==!1)&&Object.entries(Ubi).forEach(([i,r])=>t.directive(i.split("BIMData")[1],r))}}),Hbi={name:"LiWrapper",render(){return ao("li",this.$slots.default())}};function qbi(e,t){var i=new Set([]);return e.forEach(r=>{t.has(r)||i.add(r)}),i}var ap=tl("id"),Nbi=({contextMenu:e,objects:t=[],state:i=e.$viewer.state,pictos:r})=>[{name:"selectAll",get group(){return e.groupPositions.select},position:1,get label(){return e.$t("context_menu.select_all")},get picto(){return r.get(this.name)},execute:()=>i.selectObjects(t.filter(Ku(cn("visible"),Jf("selected"))).map(ap)),predicate:()=>t.some(Ku(cn("visible"),Jf("selected")))},{name:"deselectAll",get group(){return e.groupPositions.select},position:2,get label(){return e.$t("context_menu.deselect_all")},get picto(){return r.get(this.name)},execute:()=>i.deselectObjects(t.filter(cn("selected")).map(ap)),predicate:()=>t.some(cn("selected"))},{name:"selectSimilar",get group(){return e.groupPositions.select},position:3,get label(){return e.$t("context_menu.select_similar")},get picto(){return r.get(this.name)},execute(){let n=t.filter(o=>o.visible&&o.type===this.selectedObject.type&&o.id!==this.selectedObject.id).map(ap);i.selectObjects(n)},selectedObject:null,predicate(){let n=t.filter(Ku(cn("visible"),cn("selected")));return n.length===1&&n[0].type!==void 0?(this.selectedObject=n[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 n=new Set(t.filter(cn("selected")).map(ap)),o=new Set(t.filter(cn("visible")).map(ap));i.selectObjects(Array.from(qbi(o,n)),{exclusive:!0})},predicate:()=>t.some(Ku(Jf("selected"),cn("visible")))&&t.some(Ku(cn("selected"),cn("visible")))},{name:"showAll",get group(){return e.groupPositions.visibility},position:1,get label(){return e.$t("context_menu.show_all")},get picto(){return r.get(this.name)},execute:()=>i.showObjects(t.filter(Jf("visible")).map(ap)),predicate:()=>t.some(Jf("visible"))},{name:"hide",get group(){return e.groupPositions.visibility},position:2,get label(){return e.$t("context_menu.hide")},get picto(){return r.get(this.name)},objectsToHide:null,execute(){let n=this.objectsToHide.filter(cn("selected"));n.length>0&&i.deselectObjects(n.map(ap)),i.hideObjects(this.objectsToHide.map(ap))},predicate(){return this.objectsToHide=t.filter(Ku(cn("selected"),cn("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 n=t.filter(cn("visible"));n.some(cn("selected"))&&i.deselectObjects(n.filter(cn("selected")).map(ap)),i.hideObjects(n.map(ap))},predicate:()=>t.some(cn("visible"))}].filter(n=>n.predicate()),zbi={components:{LiWrapper:Hbi},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 r=new Map;return i&&this.$viewer.shortcutManager.getShortcuts(i).forEach(n=>r.set(n.name,n.key)),Nbi({contextMenu:this,objects:e,state:t,pictos:r})},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,r)=>(i.position=i.position||0,r.position=r.position||0,i.position-r.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}}},Vbi={key:0,class:"separator"},Qbi={class:"menu-text"},Gbi={key:1,class:"menu-picto"},Kbi={key:0,class:"context-menu__spinner"};function Wbi(e,t,i,r,n,o){let a=T("BIMDataIconChevron"),s=T("LiWrapper"),l=T("BIMDataSpinner"),c=Mr("click-away");return n.displayed&&(n.currentCommands.length||n.asyncPredicateRunning)?ti((M(),q("ul",{key:0,class:"bimdata-list context-menu",style:je(o.position)},[(M(!0),q(It,null,pi(n.currentCommands,(d,u)=>(M(),ie(s,{key:d.label,class:"context-menu__element",onClick:h=>o.executeCommand(d)},{default:K(()=>[o.isGroupIntersection(u)?(M(),q("div",Vbi)):xe("",!0),x("div",Qbi,ee(d.label),1),!d.component&&d.picto?(M(),q("span",Gbi,ee(d.picto),1)):d.component?(M(),ie(a,{key:2,size:"xxs",class:"fill-primary"})):xe("",!0)]),_:2},1032,["onClick"]))),128)),n.asyncPredicateRunning?(M(),q("li",Kbi,[L(l)])):xe("",!0)],4)),[[c,o.away]]):xe("",!0)}var Jbi=W(zbi,[["render",Wbi],["__scopeId","data-v-5b87d4a3"]]),Ybi={name:"ViewerHeader",inject:["$viewer"],props:{visible:{type:Boolean,default:!0}},setup(){let e=Ot("$viewer"),t=Ma(new Map);return{logo:e.uiSettings.bimdataLogo!==!1,version:e.uiSettings.version===!1?null:e.version,headerContent:t,headerRightContentComponents:ot(()=>Array.from(t.values()).filter(i=>i.position==="right").sort((i,r)=>i.order-r.order).map(i=>i.component)),headerLeftContentComponents:ot(()=>Array.from(t.values()).filter(i=>i.position==="left").sort((i,r)=>i.order-r.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}}},Zbi={class:"viewer-header"},Xbi={class:"viewer-header__content"},$bi={class:"viewer-header__content__left"},e6i={class:"viewer-header__content__right"},t6i={key:0,class:"m-l-6 flex items-center"},i6i={key:1,class:"viewer-header__version"};function r6i(e,t,i,r,n,o){let a=T("BIMDataIllustration");return ti((M(),q("div",Zbi,[x("div",Xbi,[x("div",$bi,[(M(!0),q(It,null,pi(r.headerLeftContentComponents,s=>(M(),ie(oo(s),{key:s.name}))),128))]),x("div",e6i,[(M(!0),q(It,null,pi(r.headerRightContentComponents,s=>(M(),ie(oo(s),{key:s.name}))),128))])]),r.logo||r.version?(M(),q("div",t6i,[r.logo?(M(),ie(a,{key:0,name:"logo",width:"30px",height:"30px"})):xe("",!0),r.version?(M(),q("div",i6i,ee(r.version),1)):xe("",!0)])):xe("",!0)],512)),[[zi,i.visible]])}var n6i=W(Ybi,[["render",r6i],["__scopeId","data-v-5c9ea6b6"]]),o6i={emits:["resize"],setup(e,{emit:t}){return{onResizerMousedown:i=>{i.preventDefault();let r=i.clientX,n=a=>{a.preventDefault();let s=a.clientX-r;r=a.clientX,t("resize",s)},o=a=>{a.preventDefault(),window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",o)};window.addEventListener("mousemove",n),window.addEventListener("mouseup",o)}}}},a6i={class:"bimdata-separator"};function s6i(e,t,i,r,n,o){return M(),q("div",a6i,[t[1]||=x("div",{class:"bimdata-separator__line"},null,-1),x("div",{class:"bimdata-separator__resizer",onMousedown:t[0]||=(...a)=>r.onResizerMousedown&&r.onResizerMousedown(...a)},null,32)])}var l6i={components:{Separator:W(o6i,[["render",s6i],["__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=De(null),i=De(e.sidePanel.width??400);return Qt(()=>e.sidePanel,()=>{Object.defineProperty(e.sidePanel,"width",{get(){return i.value},set(r){if(typeof r!="number"||r<=0){console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof r}`);return}i.value=r}}),Object.defineProperty(e.sidePanel,"componentInstance",{get(){return t.value},enumerable:!0})},{immediate:!0}),{componentInstance:t,width:i,onResize:(r,n=1)=>{let o=i.value+r*n;i.value=Math.max(0,o)}}}},c6i={class:"bimdata-global-side-panel__component"};function d6i(e,t,i,r,n,o){let a=T("Separator");return M(),q("div",{class:"bimdata-global-side-panel",style:je(`width: ${r.width}px`)},[i.sidePanel.resizable&&i.position==="right"?(M(),ie(a,{key:0,onResize:t[0]||=s=>r.onResize(s,-1)})):xe("",!0),x("div",c6i,[(M(),ie(oo(i.sidePanel.component),{ref:"componentInstance"},null,512))]),i.sidePanel.resizable&&i.position==="left"?(M(),ie(a,{key:1,onResize:t[1]||=s=>r.onResize(s)})):xe("",!0)],4)}var u6i={name:"BimdataViewer",components:{ContextMenu:Jbi,ViewerHeader:n6i,ModalManager:exe,GlobalSidePanel:W(l6i,[["render",d6i],["__scopeId","data-v-82d0d4cb"]])},setup(){let e=Ot("$viewer"),{globalContext:t,shortcutManager:i}=e;Yr(()=>{i&&i.destroy(),t.hub.clear()}),Cr(()=>{e.pluginManager.runPluginsScripts(e)});let r=ot(()=>e.uiSettings.bimdataLogo!==!1&&(t.localContexts.length!==1||t.localContexts[0].window?.logoAndVersion)),n=ot(()=>e.uiSettings.version!==!1&&(t.localContexts.length!==1||t.localContexts[0].window?.logoAndVersion)?e.version:null),o=ot(()=>t.leftSidePanel),a=ot(()=>t.rightSidePanel),s=ot(()=>{let p=e.uiSettings.header!==!1,A=t.localContexts.length===1&&t.localContexts[0].window?.header===!1,f=!!(o.value||a.value);return p&&(!A||f)}),l=e.uiSettings.contextMenu!==!1,c=De(null);function d(p){l&&c.value.open(p)}function u(){e.shortcutManager.active=!0}function h(){e.shortcutManager.active=!1}return{Layout:e.layout.areas.component,onContextMenu:d,onMouseenter:u,onMouseleave:h,isHeaderVisible:s,viewerTemplateRef:t.templateRef,modalManagerTemplateRef:t.modalManagerTemplateRef,headerTemplateRef:t.headerTemplateRef,contextMenuTemplateRef:c,contextMenuEnabled:l,bimdataLogoOnSingleWindow:r,viewerVersionOnSingleWindow:n,version:e.version,loading:ot(()=>t.loading),spinner:ot(()=>t.spinner),leftSidePanel:o,rightSidePanel:a}}},h6i={key:1,class:"bimdata-context-loading-overlay",style:{"z-index":"3"}},p6i={key:2,class:"viewer__logo"},A6i={key:1,class:"version m-t-6"};function f6i(e,t,i,r,n,o){let a=T("ModalManager"),s=T("ContextMenu"),l=T("ViewerHeader"),c=T("GlobalSidePanel"),d=T("BIMDataSpinner"),u=T("BIMDataIllustration");return M(),q("div",{id:"bimdata-viewer",ref:"viewerTemplateRef",class:"bimdata-viewer bimdata-design-system bimdata-scrollbar",onContextmenu:t[0]||=(...h)=>r.onContextMenu&&r.onContextMenu(...h),onMouseenter:t[1]||=(...h)=>r.onMouseenter&&r.onMouseenter(...h),onMouseleave:t[2]||=(...h)=>r.onMouseleave&&r.onMouseleave(...h)},[L(a,{ref:"modalManagerTemplateRef"},null,512),r.contextMenuEnabled?(M(),ie(s,{key:0,ref:"contextMenuTemplateRef"},null,512)):xe("",!0),L(l,{ref:"headerTemplateRef",visible:r.isHeaderVisible},null,8,["visible"]),x("div",{class:"bimdata-viewer__content",style:je(r.isHeaderVisible?"height: calc(100% - var(--bimdata-viewer-header-height, 40px))":"height: 100%")},[r.leftSidePanel?(M(),ie(c,{key:0,"side-panel":r.leftSidePanel,position:"left"},null,8,["side-panel"])):xe("",!0),(M(),ie(oo(r.Layout),{style:"height: 100%; flex-grow: 1;"})),r.rightSidePanel?(M(),ie(c,{key:1,"side-panel":r.rightSidePanel,position:"right"},null,8,["side-panel"])):xe("",!0)],4),r.loading?(M(),q("div",h6i,[r.spinner&&r.spinner.component?(M(),ie(oo(r.spinner.component),yd(Pl({key:0},r.spinner.props)),null,16)):(M(),ie(d,{key:1,size:"40px",border:"5px"}))])):xe("",!0),!r.isHeaderVisible&&(r.bimdataLogoOnSingleWindow||r.viewerVersionOnSingleWindow)?(M(),q("div",p6i,[r.bimdataLogoOnSingleWindow?(M(),ie(u,{key:0,name:"logo"})):xe("",!0),r.viewerVersionOnSingleWindow?(M(),q("div",A6i,ee(r.version),1)):xe("",!0)])):xe("",!0)],544)}var g6i=W(u6i,[["render",f6i],["__scopeId","data-v-0c1c941a"]]),m6i=["src"],v6i={class:"bimdata-models__header"},w6i={key:0,class:"bimdata-models__header__loader"},b6i={class:"bimdata-models__header__picto"},y6i={class:"bimdata-models__header__name"},C6i={key:0,class:"bimdata-models__header__name--empty"},x6i={key:1,class:"bimdata-models__header__name--empty"},k6i={key:3},B6i=["onMousemove","onClick"],oxe=W({__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=Ot("$viewer"),r=De(),n=De(0),o=De(0),a=De(),s=Lr([]),l=De(!1),c=ot(()=>i.localContext.loadedModels),d=ot(()=>i.localContext.loadedModelIds),u=ot(()=>i.localContext.loadingModelIds),h=ot(()=>i.localContext.multiModel),p=ot(()=>(t.customFilter?s.value.filter(t.customFilter):s.value).map(C=>c.value.find(B=>B.document?.head_id!=null&&B.document.head_id===C.document.id)??C)),A=C=>d.value.includes(C),f=C=>u.value.includes(C),m=ot(()=>{let{x:C,y:B}=a.value?.getBoundingClientRect()??{x:0,y:0};return`top:${o.value-B}px; left:${n.value-C}px;`}),g=C=>{!h.value&&A(C.id)||u.value.length>0||(i.localContext.loadedModelIds.includes(C.id)?i.localContext.unloadModels([C.id]):i.localContext.loadModels([C.id]))},w=C=>{switch(C){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},v=(C,B)=>{C?.viewer_360_file&&(n.value=B.clientX,o.value=B.clientY),r.value=C?.viewer_360_file},b=async C=>{l.value=!0;try{return(await i.api.apiClient.modelApi.getModels(i.api.cloudId,i.api.projectId,void 0,void 0,C)).filter(B=>i.state.models.some(I=>I.archived)||!B.archived).sort(hh("updated_at",!1))}catch(B){console.error("[Models] Cannot get project models. Error: ",B)}finally{l.value=!1}return[]},y=C=>C.children?.some(B=>A(B.id))??!1;return b(i.localContext.modelTypes).then(C=>{s.value=C}),(C,B)=>{let I=T("BIMDataSpinner"),E=T("BIMDataIconModel3D"),P=T("BIMDataTextbox"),S=T("BIMDataCheckbox"),D=T("BIMDataRadio"),j=T("BIMDataIcon"),V=T("BIMDataDropdownList");return M(),q("div",{ref_key:"templateRef",ref:a,class:Ue(["bimdata-models",{"bimdata-models--window-positioning":e.windowPositioning}])},[r.value?(M(),q("div",{key:0,class:"bimdata-models__preview",style:je(m.value)},[x("img",{src:r.value},null,8,m6i)],4)):xe("",!0),L(V,{style:je(`--bimdata-models-width: ${e.width};`),width:e.width,list:p.value,"element-key":"id","per-page":40,loading:l.value,class:"bimdata-models__list",disabled:p.value.length===0,onElementClick:g},{header:K(({isOpen:Q})=>[x("div",v6i,[l.value||u.value.length>0?(M(),q("div",w6i,[L(I)])):(M(),q(It,{key:1},[x("div",b6i,[L(E)]),x("div",{class:Ue(["bimdata-models__header__number bimdata-info-length",{"bimdata-models__header__number--empty":d.value.length===0}])},[x("span",null,ee(d.value.length),1)],2),x("div",y6i,[p.value.length===0?(M(),q("span",C6i,ee(C.$t("model.no_model")),1)):d.value.length===0?(M(),q("span",x6i,ee(C.$t("model.no_loaded_model")),1)):d.value.length===1?(M(),ie(P,{key:2,text:c.value[0].name,tooltip:!Q},null,8,["text","tooltip"])):d.value.length>1?(M(),q("span",k6i,ee(C.$t("model.selected_models")),1)):xe("",!0)])],64))])]),element:K(({element:Q,close:z})=>[x("div",{class:"bimdata-models__model",onMousemove:J=>e.preview&&v(Q,J),onMouseout:B[0]||=J=>e.preview&&v(),onClick:()=>{!h.value&&!A(Q.id)&&z()}},[h.value?(M(),ie(S,{key:0,"model-value":A(Q.id)||y(Q),disabled:Q.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])):(M(),ie(D,{key:1,"model-value":A(Q.id)||y(Q),disabled:Q.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])),L(j,{margin:"0 calc(var(--spacing-unit) / 2)",name:w(Q.status),size:"xs",class:Ue({"fill-success":Q.status==="C","fill-high":Q.status==="E"})},null,8,["name","class"]),L(P,{class:Ue({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":Q.status!=="C"||u.value.length>0}),text:Q.name,width:`calc(100% -
6506
6506
  ${h.value?13:23}px - 2 * 6px - 16px)`},null,8,["class","text","width"]),Q.document&&!Q.document.is_head_version?(M(),ie(j,{key:2,name:"versioning",fill:"",color:"default",size:"xs",margin:"0 0 0 6px"})):xe("",!0)],40,B6i),f(Q.id)?(M(),ie(I,{key:0,class:"bimdata-models__model__spinner"})):xe("",!0)]),_:1},8,["style","width","list","loading","disabled"])],2)}}},[["__scopeId","data-v-34c2cf79"]]),E6i="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",M6i=["src"],I6i={key:0,class:"bimdata-multi-model-loader__header-container"},P6i={key:0,class:"bimdata-multi-model-loader__header__loader"},S6i={class:"bimdata-multi-model-loader__header__picto"},T6i=["src"],D6i={class:"bimdata-multi-model-loader__header__name"},R6i={key:0,class:"bimdata-multi-model-loader__header__name--empty"},L6i={key:1,class:"bimdata-multi-model-loader__header__name--empty"},_6i={key:3},F6i={key:1,class:"bimdata-multi-model-loader__main"},j6i=["onMousemove","onClick"],U6i=W({__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=Ot("$viewer"),r=De(),n=De(0),o=De(0),a=De(),s=Lr([]),l=De(!1),c=De(!0),d=D=>{D.key==="Escape"?c.value=!0:D.key==="Enter"&&I()};Qt(c,D=>{D?(window.removeEventListener("keydown",d),v.clear(),w.clear(),r.value=null):window.addEventListener("keydown",d)});let u=ot(()=>i.localContext.loadedModels),h=ot(()=>i.localContext.loadedModelIds),p=ot(()=>i.localContext.loadingModelIds),A=ot(()=>i.localContext.multiModel),f=ot(()=>(t.customFilter?s.value.filter(t.customFilter):s.value).map(D=>u.value.find(j=>j.document?.head_id!=null&&j.document.head_id===D.document.id)??D)),m=D=>h.value.includes(D),g=D=>p.value.includes(D),w=Ma(new Set),v=Ma(new Set),b=D=>D.children?.some(j=>m(j.id))??!1,y=D=>(m(D.id)||b(D)||w.has(D))&&!v.has(D),C=ot(()=>{let{x:D,y:j}=a.value.getBoundingClientRect();return`top:${o.value-j}px; left:${n.value-D}px;`}),B=D=>{D.status==="C"&&(!A.value&&m(D.id)||(m(D.id)?v.has(D)?v.delete(D):v.add(D):w.has(D)?w.delete(D):w.add(D)))},I=()=>{w.size>0&&i.localContext.loadModels(Array.from(w).map(D=>D.id)),v.size>0&&i.localContext.unloadModels(Array.from(v).map(D=>D.id)),c.value=!0},E=D=>{switch(D){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},P=D=>D.document&&!D.document.is_head_version,S=(D,j)=>{!t.preview||c.value||(D?.viewer_360_file&&(n.value=j.clientX,o.value=j.clientY),r.value=D?.viewer_360_file)};return(async D=>{l.value=!0;try{return(await i.api.apiClient.modelApi.getModels(i.api.cloudId,i.api.projectId,void 0,void 0,D)).filter(j=>i.state.models.some(V=>V.archived)||!j.archived).sort(hh("updated_at",!1))}catch(j){console.error("[Models] Cannot get project models. Error: ",j)}finally{l.value=!1}return[]})(i.localContext.modelTypes).then(D=>{s.value=D}),(D,j)=>{let V=T("BIMDataSpinner"),Q=T("BIMDataTextbox"),z=T("BIMDataIconChevron"),J=T("BIMDataButton"),Y=T("BIMDataIconFileIfcPolychrome"),ne=T("BIMDataCheckbox"),ke=T("BIMDataRadio"),Oe=T("BIMDataIcon"),_e=T("BIMDataPaginatedList"),be=Mr("click-away");return M(),q("div",{ref_key:"templateRef",ref:a,class:Ue(["bimdata-multi-model-loader",{"bimdata-multi-model-loader--window-positioning":e.windowPositioning}])},[r.value?(M(),q("div",{key:0,class:"bimdata-multi-model-loader__preview",style:je(C.value)},[x("img",{src:r.value},null,8,M6i)],4)):xe("",!0),L(Hr,{name:"fade",mode:"out-in"},{default:K(()=>[c.value?(M(),q("div",I6i,[Yt(D.$slots,"left",{},void 0,!0),x("div",{class:"bimdata-multi-model-loader__header",onClick:j[0]||=de=>c.value=!1},[l.value||p.value.length>0?(M(),q("div",P6i,[L(V)])):(M(),q(It,{key:1},[x("div",S6i,[x("img",{src:Ft(E6i),alt:"file icon"},null,8,T6i)]),x("div",{class:Ue(["bimdata-multi-model-loader__header__number bimdata-info-length",{"bimdata-multi-model-loader__header__number--empty":h.value.length===0}])},[x("span",null,ee(h.value.length),1)],2),x("div",D6i,[f.value.length===0?(M(),q("span",R6i,ee(D.$t("model.no_model")),1)):h.value.length===0?(M(),q("span",L6i,ee(D.$t("model.no_loaded_model")),1)):h.value.length===1?(M(),ie(Q,{key:2,text:u.value[0].name,tooltip:c.value,width:"233px"},null,8,["text","tooltip"])):h.value.length>1?(M(),q("span",_6i,ee(D.$t("model.selected_models")),1)):xe("",!0)]),L(J,{color:"default",icon:"",radius:"",fill:"",width:"21px",height:"21px"},{default:K(()=>[L(z,{size:"xxxs"})]),_:1})],64))]),Yt(D.$slots,"right",{},void 0,!0)])):ti((M(),q("div",F6i,[L(_e,{list:f.value,"per-page":10},{element:K(({element:de})=>[x("div",{class:Ue(["bimdata-multi-model-loader__main__model",{"bimdata-multi-model-loader__main__model--disabled":de.status!=="C"}]),onMousemove:Ce=>S(de,Ce),onMouseout:j[1]||=Ce=>S(),onClick:Ce=>B(de)},[L(Y,{fill:"",color:"default",size:"xs"}),A.value?(M(),ie(ne,{key:0,"model-value":y(de),disabled:de.status!=="C"},null,8,["model-value","disabled"])):(M(),ie(ke,{key:1,"model-value":y(de),disabled:de.status!=="C"},null,8,["model-value","disabled"])),L(Q,{class:Ue({"bimdata-multi-model-loader__main__model__name":!0,"bimdata-multi-model-loader__main__model__name--disabled":de.status!=="C"}),text:de.name,width:P(de)?"333px":"363px"},null,8,["class","text","width"]),P(de)?(M(),ie(Oe,{key:2,name:"versioning",fill:"",color:"default",size:"xs",margin:"0 0 0 6px"})):xe("",!0),g(de.id)?(M(),ie(V,{key:3,class:"bimdata-multi-model-loader__main__model__spinner"})):(M(),ie(Oe,{key:4,name:E(de.status),size:"xs",class:Ue({"fill-success":de.status==="C","fill-high":de.status==="E"})},null,8,["name","class"]))],42,j6i)]),_:1},8,["list"]),L(J,{class:"bimdata-multi-model-loader__main__validate",width:"93px",color:"primary",fill:"",radius:"",disabled:Ft(w).size===0&&Ft(v).size===0,onClick:I},{default:K(()=>[wt(ee(D.$t("global.validate")),1)]),_:1},8,["disabled"])])),[[be,()=>c.value=!0]])]),_:3})],2)}}},[["__scopeId","data-v-44e6af66"]]),O6i={data(){return{shown:!1}},mounted(){setTimeout(()=>{this.shown=!0},500)}};function H6i(e,t,i,r,n,o){let a=T("BIMDataIllustration");return M(),q("div",{class:"bimdata__no-model",style:je({"--no-model--opacity":n.shown?1:0})},[L(a,{name:"emptyViewer",x:"90",y:"90"}),x("span",null,ee(e.$t("model.select_model")),1)],4)}var axe=W(O6i,[["render",H6i],["__scopeId","data-v-5ffd9bc0"]]);window.BIMDataViewerVue=iy;var q6i=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 Pbi(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=nxe(l)}catch{i.api.permissions=nxe()}let r=this.api.accessToken,{i18n:n}=i;n.registerTranslations(i.pluginManager.pluginTranslations),i.layout.apply(t);let o=s5({i18n:n.i18nVuePlugin,data(){return{accessToken:r}},render(){return ao(g6i,{style:"height: 100%"})}}).use(n.i18nVuePlugin).use(Obi()).use(Fbi({i18nPlugin:n.i18nVuePlugin})).use(Lbi({apiClient:i.api.apiClient,i18nPlugin:n.i18nVuePlugin}));o.provide("$viewer",i),o.provide("BIMDATA_DESIGN_SYSTEM_DARK_THEME",ot(()=>i.darkTheme)),o.component("BIMDataModelLoader",oxe),o.component("BIMDataMultiModelLoader",U6i),o.component("BIMDataNoModelWindowPlaceHolder",axe),o.component("BIMDataStoreySelector",eO),o.component("ModelsLoader",oxe),o.component("NoModelWindowPlaceHolder",axe);let a=e instanceof HTMLElement?e:document.querySelector(e);a&&(a.style.height="100%");let s=o.mount(e);return s.$viewer=i,Sbi(s.$el,this.uiCfg?.style),typeof window<"u"&&(window.bimdataViewer=s),this.vueApp=o,s}destroy(){this.vueApp?.unmount()}setLocale(e){if(!NX.includes(e))throw Error(`Viewer available locales are ${NX.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)}},sxe=(e={})=>new q6i(e);window.makeBIMDataViewer=sxe;export{sxe as default};