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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -938,7 +938,7 @@ else `),n<e-1&&(t+=`if(textureId < ${n}.5)`),t+=`
938
938
  content: "" !important;
939
939
  display: none !important;
940
940
  }`,jc=function(e){Mc(e,`.`+Oc+Ec+Ac+`
941
- .`+kc+Dc+Ac)},Mc=function(e,t){var n=e.ownerDocument;if(n){var r=n.createElement(`style`);r.textContent=t,e.appendChild(r)}},R=function(){function e(){}return e.getOrigin=function(t){var n=e._link;return n?(n.href=t,n.href=n.href,n.protocol+n.hostname+n.port):`about:blank`},e.isSameOrigin=function(t){return e.getOrigin(t)===e._origin},e.setContext=function(t){e._link=t.document.createElement(`a`),e._origin=e.getOrigin(t.location.href)},e._origin=`about:blank`,e}(),Nc=function(){function e(e,t){this.context=e,this._options=t,this._cache={}}return e.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)||(Bc(e)||Lc(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),t},e.prototype.match=function(e){return this._cache[e]},e.prototype.loadImage=function(e){return r(this,void 0,void 0,function(){var t,n,r,a,o=this;return i(this,function(i){switch(i.label){case 0:return t=R.isSameOrigin(e),n=!Rc(e)&&this._options.useCORS===!0&&L.SUPPORT_CORS_IMAGES&&!t,r=!Rc(e)&&!t&&!Bc(e)&&typeof this._options.proxy==`string`&&L.SUPPORT_CORS_XHR&&!n,!t&&this._options.allowTaint===!1&&!Rc(e)&&!Bc(e)&&!r&&!n?[2]:(a=e,r?[4,this.proxy(a)]:[3,2]);case 1:a=i.sent(),i.label=2;case 2:return this.context.logger.debug(`Added image `+e.substring(0,256)),[4,new Promise(function(e,t){var r=new Image;r.onload=function(){return e(r)},r.onerror=t,(zc(a)||n)&&(r.crossOrigin=`anonymous`),r.src=a,r.complete===!0&&setTimeout(function(){return e(r)},500),o._options.imageTimeout>0&&setTimeout(function(){return t(`Timed out (`+o._options.imageTimeout+`ms) loading image`)},o._options.imageTimeout)})];case 3:return[2,i.sent()]}})})},e.prototype.has=function(e){return this._cache[e]!==void 0},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(e){var t=this,n=this._options.proxy;if(!n)throw Error(`No proxy defined`);var r=e.substring(0,256);return new Promise(function(i,a){var o=L.SUPPORT_RESPONSE_TYPE?`blob`:`text`,s=new XMLHttpRequest;s.onload=function(){if(s.status===200)if(o===`text`)i(s.response);else{var e=new FileReader;e.addEventListener(`load`,function(){return i(e.result)},!1),e.addEventListener(`error`,function(e){return a(e)},!1),e.readAsDataURL(s.response)}else a(`Failed to proxy resource `+r+` with status code `+s.status)},s.onerror=a;var c=n.indexOf(`?`)>-1?`&`:`?`;if(s.open(`GET`,``+n+c+`url=`+encodeURIComponent(e)+`&responseType=`+o),o!==`text`&&s instanceof XMLHttpRequest&&(s.responseType=o),t._options.imageTimeout){var l=t._options.imageTimeout;s.timeout=l,s.ontimeout=function(){return a(`Timed out (`+l+`ms) proxying `+r)}}s.send()})},e}(),Pc=/^data:image\/svg\+xml/i,Fc=/^data:image\/.*;base64,/i,Ic=/^data:image\/.*/i,Lc=function(e){return L.SUPPORT_SVG_DRAWING||!Vc(e)},Rc=function(e){return Ic.test(e)},zc=function(e){return Fc.test(e)},Bc=function(e){return e.substr(0,4)===`blob`},Vc=function(e){return e.substr(-3).toLowerCase()===`svg`||Pc.test(e)},Hc=function(){function e(e,t){this.type=0,this.x=e,this.y=t}return e.prototype.add=function(t,n){return new e(this.x+t,this.y+n)},e}(),Uc=function(e,t,n){return new Hc(e.x+(t.x-e.x)*n,e.y+(t.y-e.y)*n)},Wc=function(){function e(e,t,n,r){this.type=1,this.start=e,this.startControl=t,this.endControl=n,this.end=r}return e.prototype.subdivide=function(t,n){var r=Uc(this.start,this.startControl,t),i=Uc(this.startControl,this.endControl,t),a=Uc(this.endControl,this.end,t),o=Uc(r,i,t),s=Uc(i,a,t),c=Uc(o,s,t);return n?new e(this.start,r,o,c):new e(c,s,a,this.end)},e.prototype.add=function(t,n){return new e(this.start.add(t,n),this.startControl.add(t,n),this.endControl.add(t,n),this.end.add(t,n))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),Gc=function(e){return e.type===1},Kc=function(){function e(e){var t=e.styles,n=e.bounds,r=hr(t.borderTopLeftRadius,n.width,n.height),i=r[0],a=r[1],o=hr(t.borderTopRightRadius,n.width,n.height),s=o[0],c=o[1],l=hr(t.borderBottomRightRadius,n.width,n.height),u=l[0],d=l[1],f=hr(t.borderBottomLeftRadius,n.width,n.height),p=f[0],m=f[1],h=[];h.push((i+s)/n.width),h.push((p+u)/n.width),h.push((a+m)/n.height),h.push((c+d)/n.height);var g=Math.max.apply(Math,h);g>1&&(i/=g,a/=g,s/=g,c/=g,u/=g,d/=g,p/=g,m/=g);var _=n.width-s,v=n.height-d,y=n.width-u,b=n.height-m,x=t.borderTopWidth,S=t.borderRightWidth,C=t.borderBottomWidth,w=t.borderLeftWidth,T=gr(t.paddingTop,e.bounds.width),E=gr(t.paddingRight,e.bounds.width),D=gr(t.paddingBottom,e.bounds.width),O=gr(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=i>0||a>0?Jc(n.left+w/3,n.top+x/3,i-w/3,a-x/3,qc.TOP_LEFT):new Hc(n.left+w/3,n.top+x/3),this.topRightBorderDoubleOuterBox=i>0||a>0?Jc(n.left+_,n.top+x/3,s-S/3,c-x/3,qc.TOP_RIGHT):new Hc(n.left+n.width-S/3,n.top+x/3),this.bottomRightBorderDoubleOuterBox=u>0||d>0?Jc(n.left+y,n.top+v,u-S/3,d-C/3,qc.BOTTOM_RIGHT):new Hc(n.left+n.width-S/3,n.top+n.height-C/3),this.bottomLeftBorderDoubleOuterBox=p>0||m>0?Jc(n.left+w/3,n.top+b,p-w/3,m-C/3,qc.BOTTOM_LEFT):new Hc(n.left+w/3,n.top+n.height-C/3),this.topLeftBorderDoubleInnerBox=i>0||a>0?Jc(n.left+w*2/3,n.top+x*2/3,i-w*2/3,a-x*2/3,qc.TOP_LEFT):new Hc(n.left+w*2/3,n.top+x*2/3),this.topRightBorderDoubleInnerBox=i>0||a>0?Jc(n.left+_,n.top+x*2/3,s-S*2/3,c-x*2/3,qc.TOP_RIGHT):new Hc(n.left+n.width-S*2/3,n.top+x*2/3),this.bottomRightBorderDoubleInnerBox=u>0||d>0?Jc(n.left+y,n.top+v,u-S*2/3,d-C*2/3,qc.BOTTOM_RIGHT):new Hc(n.left+n.width-S*2/3,n.top+n.height-C*2/3),this.bottomLeftBorderDoubleInnerBox=p>0||m>0?Jc(n.left+w*2/3,n.top+b,p-w*2/3,m-C*2/3,qc.BOTTOM_LEFT):new Hc(n.left+w*2/3,n.top+n.height-C*2/3),this.topLeftBorderStroke=i>0||a>0?Jc(n.left+w/2,n.top+x/2,i-w/2,a-x/2,qc.TOP_LEFT):new Hc(n.left+w/2,n.top+x/2),this.topRightBorderStroke=i>0||a>0?Jc(n.left+_,n.top+x/2,s-S/2,c-x/2,qc.TOP_RIGHT):new Hc(n.left+n.width-S/2,n.top+x/2),this.bottomRightBorderStroke=u>0||d>0?Jc(n.left+y,n.top+v,u-S/2,d-C/2,qc.BOTTOM_RIGHT):new Hc(n.left+n.width-S/2,n.top+n.height-C/2),this.bottomLeftBorderStroke=p>0||m>0?Jc(n.left+w/2,n.top+b,p-w/2,m-C/2,qc.BOTTOM_LEFT):new Hc(n.left+w/2,n.top+n.height-C/2),this.topLeftBorderBox=i>0||a>0?Jc(n.left,n.top,i,a,qc.TOP_LEFT):new Hc(n.left,n.top),this.topRightBorderBox=s>0||c>0?Jc(n.left+_,n.top,s,c,qc.TOP_RIGHT):new Hc(n.left+n.width,n.top),this.bottomRightBorderBox=u>0||d>0?Jc(n.left+y,n.top+v,u,d,qc.BOTTOM_RIGHT):new Hc(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=p>0||m>0?Jc(n.left,n.top+b,p,m,qc.BOTTOM_LEFT):new Hc(n.left,n.top+n.height),this.topLeftPaddingBox=i>0||a>0?Jc(n.left+w,n.top+x,Math.max(0,i-w),Math.max(0,a-x),qc.TOP_LEFT):new Hc(n.left+w,n.top+x),this.topRightPaddingBox=s>0||c>0?Jc(n.left+Math.min(_,n.width-S),n.top+x,_>n.width+S?0:Math.max(0,s-S),Math.max(0,c-x),qc.TOP_RIGHT):new Hc(n.left+n.width-S,n.top+x),this.bottomRightPaddingBox=u>0||d>0?Jc(n.left+Math.min(y,n.width-w),n.top+Math.min(v,n.height-C),Math.max(0,u-S),Math.max(0,d-C),qc.BOTTOM_RIGHT):new Hc(n.left+n.width-S,n.top+n.height-C),this.bottomLeftPaddingBox=p>0||m>0?Jc(n.left+w,n.top+Math.min(b,n.height-C),Math.max(0,p-w),Math.max(0,m-C),qc.BOTTOM_LEFT):new Hc(n.left+w,n.top+n.height-C),this.topLeftContentBox=i>0||a>0?Jc(n.left+w+O,n.top+x+T,Math.max(0,i-(w+O)),Math.max(0,a-(x+T)),qc.TOP_LEFT):new Hc(n.left+w+O,n.top+x+T),this.topRightContentBox=s>0||c>0?Jc(n.left+Math.min(_,n.width+w+O),n.top+x+T,_>n.width+w+O?0:s-w+O,c-(x+T),qc.TOP_RIGHT):new Hc(n.left+n.width-(S+E),n.top+x+T),this.bottomRightContentBox=u>0||d>0?Jc(n.left+Math.min(y,n.width-(w+O)),n.top+Math.min(v,n.height+x+T),Math.max(0,u-(S+E)),d-(C+D),qc.BOTTOM_RIGHT):new Hc(n.left+n.width-(S+E),n.top+n.height-(C+D)),this.bottomLeftContentBox=p>0||m>0?Jc(n.left+w+O,n.top+b,Math.max(0,p-(w+O)),m-(C+D),qc.BOTTOM_LEFT):new Hc(n.left+w+O,n.top+n.height-(C+D))}return e}(),qc;(function(e){e[e.TOP_LEFT=0]=`TOP_LEFT`,e[e.TOP_RIGHT=1]=`TOP_RIGHT`,e[e.BOTTOM_RIGHT=2]=`BOTTOM_RIGHT`,e[e.BOTTOM_LEFT=3]=`BOTTOM_LEFT`})(qc||={});var Jc=function(e,t,n,r,i){var a=4*((Math.sqrt(2)-1)/3),o=n*a,s=r*a,c=e+n,l=t+r;switch(i){case qc.TOP_LEFT:return new Wc(new Hc(e,l),new Hc(e,l-s),new Hc(c-o,t),new Hc(c,t));case qc.TOP_RIGHT:return new Wc(new Hc(e,t),new Hc(e+o,t),new Hc(c,l-s),new Hc(c,l));case qc.BOTTOM_RIGHT:return new Wc(new Hc(c,t),new Hc(c,t+s),new Hc(e+o,l),new Hc(e,l));case qc.BOTTOM_LEFT:default:return new Wc(new Hc(c,l),new Hc(c-o,l),new Hc(e,t+s),new Hc(e,t))}},Yc=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},Xc=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},Zc=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},Qc=function(){function e(e,t,n){this.offsetX=e,this.offsetY=t,this.matrix=n,this.type=0,this.target=6}return e}(),$c=function(){function e(e,t){this.path=e,this.target=t,this.type=1}return e}(),el=function(){function e(e){this.opacity=e,this.type=2,this.target=6}return e}(),tl=function(e){return e.type===0},nl=function(e){return e.type===1},rl=function(e){return e.type===2},il=function(e,t){return e.length===t.length?e.some(function(e,n){return e===t[n]}):!1},al=function(e,t,n,r,i){return e.map(function(e,a){switch(a){case 0:return e.add(t,n);case 1:return e.add(t+r,n);case 2:return e.add(t+r,n+i);case 3:return e.add(t,n+i)}return e})},ol=function(){function e(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e}(),sl=function(){function e(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new Kc(this.container),this.container.styles.opacity<1&&this.effects.push(new el(this.container.styles.opacity)),this.container.styles.transform!==null){var n=this.container.bounds.left+this.container.styles.transformOrigin[0].number,r=this.container.bounds.top+this.container.styles.transformOrigin[1].number,i=this.container.styles.transform;this.effects.push(new Qc(n,r,i))}if(this.container.styles.overflowX!==0){var a=Yc(this.curves),o=Zc(this.curves);il(a,o)?this.effects.push(new $c(a,6)):(this.effects.push(new $c(a,2)),this.effects.push(new $c(o,4)))}}return e.prototype.getEffects=function(e){for(var t=[2,3].indexOf(this.container.styles.position)===-1,n=this.parent,r=this.effects.slice(0);n;){var i=n.effects.filter(function(e){return!nl(e)});if(t||n.container.styles.position!==0||!n.parent){if(r.unshift.apply(r,i),t=[2,3].indexOf(n.container.styles.position)===-1,n.container.styles.overflowX!==0){var a=Yc(n.curves),o=Zc(n.curves);il(a,o)||r.unshift(new $c(o,6))}}else r.unshift.apply(r,i);n=n.parent}return r.filter(function(t){return Da(t.target,e)})},e}(),cl=function(e,t,n,r){e.container.elements.forEach(function(i){var a=Da(i.flags,4),o=Da(i.flags,2),s=new sl(i,e);Da(i.styles.display,2048)&&r.push(s);var c=Da(i.flags,8)?[]:r;if(a||o){var l=a||i.styles.isPositioned()?n:t,u=new ol(s);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var d=i.styles.zIndex.order;if(d<0){var f=0;l.negativeZIndex.some(function(e,t){return d>e.element.container.styles.zIndex.order?(f=t,!1):f>0}),l.negativeZIndex.splice(f,0,u)}else if(d>0){var p=0;l.positiveZIndex.some(function(e,t){return d>=e.element.container.styles.zIndex.order?(p=t+1,!1):p>0}),l.positiveZIndex.splice(p,0,u)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(u)}else i.styles.isFloating()?l.nonPositionedFloats.push(u):l.nonPositionedInlineLevel.push(u);cl(s,u,a?u:n,c)}else i.styles.isInlineLevel()?t.inlineLevel.push(s):t.nonInlineLevel.push(s),cl(s,t,n,c);Da(i.flags,8)&&ll(i,c)})},ll=function(e,t){for(var n=e instanceof us?e.start:1,r=e instanceof us?e.reversed:!1,i=0;i<t.length;i++){var a=t[i];a.container instanceof ls&&typeof a.container.value==`number`&&a.container.value!==0&&(n=a.container.value),a.listValue=pc(n,a.container.styles.listStyleType,!0),n+=r?-1:1}},ul=function(e){var t=new sl(e,null),n=new ol(t),r=[];return cl(t,n,n,r),ll(t.container,r),n},dl=function(e,t){switch(t){case 0:return gl(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return gl(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return gl(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);default:return gl(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},fl=function(e,t){switch(t){case 0:return gl(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return gl(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return gl(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);default:return gl(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}},pl=function(e,t){switch(t){case 0:return gl(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return gl(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return gl(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);default:return gl(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}},ml=function(e,t){switch(t){case 0:return hl(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return hl(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return hl(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);default:return hl(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}},hl=function(e,t){var n=[];return Gc(e)?n.push(e.subdivide(.5,!1)):n.push(e),Gc(t)?n.push(t.subdivide(.5,!0)):n.push(t),n},gl=function(e,t,n,r){var i=[];return Gc(e)?i.push(e.subdivide(.5,!1)):i.push(e),Gc(n)?i.push(n.subdivide(.5,!0)):i.push(n),Gc(r)?i.push(r.subdivide(.5,!0).reverse()):i.push(r),Gc(t)?i.push(t.subdivide(.5,!1).reverse()):i.push(t),i},_l=function(e){var t=e.bounds,n=e.styles;return t.add(n.borderLeftWidth,n.borderTopWidth,-(n.borderRightWidth+n.borderLeftWidth),-(n.borderTopWidth+n.borderBottomWidth))},vl=function(e){var t=e.styles,n=e.bounds,r=gr(t.paddingLeft,n.width),i=gr(t.paddingRight,n.width),a=gr(t.paddingTop,n.width),o=gr(t.paddingBottom,n.width);return n.add(r+t.borderLeftWidth,a+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+r+i),-(t.borderTopWidth+t.borderBottomWidth+a+o))},yl=function(e,t){return e===0?t.bounds:e===2?vl(t):_l(t)},bl=function(e,t){return e===0?t.bounds:e===2?vl(t):_l(t)},xl=function(e,t,n){var r=yl(Tl(e.styles.backgroundOrigin,t),e),i=bl(Tl(e.styles.backgroundClip,t),e),a=wl(Tl(e.styles.backgroundSize,t),n,r),o=a[0],s=a[1],c=hr(Tl(e.styles.backgroundPosition,t),r.width-o,r.height-s);return[El(Tl(e.styles.backgroundRepeat,t),c,a,r,i),Math.round(r.left+c[0]),Math.round(r.top+c[1]),o,s]},Sl=function(e){return nr(e)&&e.value===di.AUTO},Cl=function(e){return typeof e==`number`},wl=function(e,t,n){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1];if(!o)return[0,0];if(ur(o)&&s&&ur(s))return[gr(o,n.width),gr(s,n.height)];var c=Cl(a);if(nr(o)&&(o.value===di.CONTAIN||o.value===di.COVER))return Cl(a)?n.width/n.height<a==(o.value===di.COVER)?[n.height*a,n.height]:[n.width,n.width/a]:[n.width,n.height];var l=Cl(r),u=Cl(i),d=l||u;if(Sl(o)&&(!s||Sl(s)))return l&&u?[r,i]:!c&&!d?[n.width,n.height]:d&&c?[l?r:i*a,u?i:r/a]:[l?r:n.width,u?i:n.height];if(c){var f=0,p=0;return ur(o)?f=gr(o,n.width):ur(s)&&(p=gr(s,n.height)),Sl(o)?f=p*a:(!s||Sl(s))&&(p=f/a),[f,p]}var m=null,h=null;if(ur(o)?m=gr(o,n.width):s&&ur(s)&&(h=gr(s,n.height)),m!==null&&(!s||Sl(s))&&(h=l&&u?m/r*i:n.height),h!==null&&Sl(o)&&(m=l&&u?h/i*r:n.width),m!==null&&h!==null)return[m,h];throw Error(`Unable to calculate background-size for element`)},Tl=function(e,t){var n=e[t];return n===void 0?e[0]:n},El=function(e,t,n,r,i){var a=t[0],o=t[1],s=n[0],c=n[1];switch(e){case 2:return[new Hc(Math.round(r.left),Math.round(r.top+o)),new Hc(Math.round(r.left+r.width),Math.round(r.top+o)),new Hc(Math.round(r.left+r.width),Math.round(c+r.top+o)),new Hc(Math.round(r.left),Math.round(c+r.top+o))];case 3:return[new Hc(Math.round(r.left+a),Math.round(r.top)),new Hc(Math.round(r.left+a+s),Math.round(r.top)),new Hc(Math.round(r.left+a+s),Math.round(r.height+r.top)),new Hc(Math.round(r.left+a),Math.round(r.height+r.top))];case 1:return[new Hc(Math.round(r.left+a),Math.round(r.top+o)),new Hc(Math.round(r.left+a+s),Math.round(r.top+o)),new Hc(Math.round(r.left+a+s),Math.round(r.top+o+c)),new Hc(Math.round(r.left+a),Math.round(r.top+o+c))];default:return[new Hc(Math.round(i.left),Math.round(i.top)),new Hc(Math.round(i.left+i.width),Math.round(i.top)),new Hc(Math.round(i.left+i.width),Math.round(i.height+i.top)),new Hc(Math.round(i.left),Math.round(i.height+i.top))]}},Dl=`data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7`,Ol=`Hidden Text`,kl=function(){function e(e){this._data={},this._document=e}return e.prototype.parseMetrics=function(e,t){var n=this._document.createElement(`div`),r=this._document.createElement(`img`),i=this._document.createElement(`span`),a=this._document.body;n.style.visibility=`hidden`,n.style.fontFamily=e,n.style.fontSize=t,n.style.margin=`0`,n.style.padding=`0`,n.style.whiteSpace=`nowrap`,a.appendChild(n),r.src=Dl,r.width=1,r.height=1,r.style.margin=`0`,r.style.padding=`0`,r.style.verticalAlign=`baseline`,i.style.fontFamily=e,i.style.fontSize=t,i.style.margin=`0`,i.style.padding=`0`,i.appendChild(this._document.createTextNode(Ol)),n.appendChild(i),n.appendChild(r);var o=r.offsetTop-i.offsetTop+2;n.removeChild(i),n.appendChild(this._document.createTextNode(Ol)),n.style.lineHeight=`normal`,r.style.verticalAlign=`super`;var s=r.offsetTop-n.offsetTop+2;return a.removeChild(n),{baseline:o,middle:s}},e.prototype.getMetrics=function(e,t){var n=e+` `+t;return this._data[n]===void 0&&(this._data[n]=this.parseMetrics(e,t)),this._data[n]},e}(),Al=function(){function e(e,t){this.context=e,this.options=t}return e}(),jl=1e4,Ml=function(e){t(n,e);function n(t,n){var r=e.call(this,t,n)||this;return r._activeEffects=[],r.canvas=n.canvas?n.canvas:document.createElement(`canvas`),r.ctx=r.canvas.getContext(`2d`),n.canvas||(r.canvas.width=Math.floor(n.width*n.scale),r.canvas.height=Math.floor(n.height*n.scale),r.canvas.style.width=n.width+`px`,r.canvas.style.height=n.height+`px`),r.fontMetrics=new kl(document),r.ctx.scale(r.options.scale,r.options.scale),r.ctx.translate(-n.x,-n.y),r.ctx.textBaseline=`bottom`,r._activeEffects=[],r.context.logger.debug(`Canvas renderer initialized (`+n.width+`x`+n.height+`) with scale `+n.scale),r}return n.prototype.applyEffects=function(e){for(var t=this;this._activeEffects.length;)this.popEffect();e.forEach(function(e){return t.applyEffect(e)})},n.prototype.applyEffect=function(e){this.ctx.save(),rl(e)&&(this.ctx.globalAlpha=e.opacity),tl(e)&&(this.ctx.translate(e.offsetX,e.offsetY),this.ctx.transform(e.matrix[0],e.matrix[1],e.matrix[2],e.matrix[3],e.matrix[4],e.matrix[5]),this.ctx.translate(-e.offsetX,-e.offsetY)),nl(e)&&(this.path(e.path),this.ctx.clip()),this._activeEffects.push(e)},n.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},n.prototype.renderStack=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return t=e.element.container.styles,t.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},n.prototype.renderNode=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:if(Da(e.container.flags,16))debugger;return e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return t.sent(),[4,this.renderNodeContent(e)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},n.prototype.renderTextWithLetterSpacing=function(e,t,n){var r=this;t===0?this.ctx.fillText(e.text,e.bounds.left,e.bounds.top+n):Zo(e.text).reduce(function(t,i){return r.ctx.fillText(i,t,e.bounds.top+n),t+r.ctx.measureText(i).width},e.bounds.left)},n.prototype.createFontStyle=function(e){var t=e.fontVariant.filter(function(e){return e===`normal`||e===`small-caps`}).join(``),n=Ll(e.fontFamily).join(`, `),r=er(e.fontSize)?``+e.fontSize.number+e.fontSize.unit:e.fontSize.number+`px`;return[[e.fontStyle,t,e.fontWeight,r,n].join(` `),n,r]},n.prototype.renderTextNode=function(e,t){return r(this,void 0,void 0,function(){var n,r,a,o,s,c,l,u,d=this;return i(this,function(i){return n=this.createFontStyle(t),r=n[0],a=n[1],o=n[2],this.ctx.font=r,this.ctx.direction=t.direction===1?`rtl`:`ltr`,this.ctx.textAlign=`left`,this.ctx.textBaseline=`alphabetic`,s=this.fontMetrics.getMetrics(a,o),c=s.baseline,l=s.middle,u=t.paintOrder,e.textBounds.forEach(function(e){u.forEach(function(n){switch(n){case 0:d.ctx.fillStyle=Dr(t.color),d.renderTextWithLetterSpacing(e,t.letterSpacing,c);var r=t.textShadow;r.length&&e.text.trim().length&&(r.slice(0).reverse().forEach(function(n){d.ctx.shadowColor=Dr(n.color),d.ctx.shadowOffsetX=n.offsetX.number*d.options.scale,d.ctx.shadowOffsetY=n.offsetY.number*d.options.scale,d.ctx.shadowBlur=n.blur.number,d.renderTextWithLetterSpacing(e,t.letterSpacing,c)}),d.ctx.shadowColor=``,d.ctx.shadowOffsetX=0,d.ctx.shadowOffsetY=0,d.ctx.shadowBlur=0),t.textDecorationLine.length&&(d.ctx.fillStyle=Dr(t.textDecorationColor||t.color),t.textDecorationLine.forEach(function(t){switch(t){case 1:d.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top+c),e.bounds.width,1);break;case 2:d.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top),e.bounds.width,1);break;case 3:d.ctx.fillRect(e.bounds.left,Math.ceil(e.bounds.top+l),e.bounds.width,1);break}}));break;case 1:t.webkitTextStrokeWidth&&e.text.trim().length&&(d.ctx.strokeStyle=Dr(t.webkitTextStrokeColor),d.ctx.lineWidth=t.webkitTextStrokeWidth,d.ctx.lineJoin=window.chrome?`miter`:`round`,d.ctx.strokeText(e.text,e.bounds.left,e.bounds.top+c)),d.ctx.strokeStyle=``,d.ctx.lineWidth=0,d.ctx.lineJoin=`miter`;break}})}),[2]})})},n.prototype.renderReplacedElement=function(e,t,n){if(n&&e.intrinsicWidth>0&&e.intrinsicHeight>0){var r=vl(e),i=Zc(t);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,e.intrinsicWidth,e.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore()}},n.prototype.renderNodeContent=function(e){return r(this,void 0,void 0,function(){var t,r,a,s,c,l,u,u,d,f,p,m,h,g,_,v,y,b,x,u,S,h,v;return i(this,function(i){switch(i.label){case 0:this.applyEffects(e.getEffects(4)),t=e.container,r=e.curves,a=t.styles,s=0,c=t.textNodes,i.label=1;case 1:return s<c.length?(l=c[s],[4,this.renderTextNode(l,a)]):[3,4];case 2:i.sent(),i.label=3;case 3:return s++,[3,1];case 4:if(!(t instanceof os))return[3,8];i.label=5;case 5:return i.trys.push([5,7,,8]),[4,this.context.cache.match(t.src)];case 6:return u=i.sent(),this.renderReplacedElement(t,r,u),[3,8];case 7:return i.sent(),this.context.logger.error(`Error loading image `+t.src),[3,8];case 8:if(t instanceof ss&&this.renderReplacedElement(t,r,t.canvas),!(t instanceof cs))return[3,12];i.label=9;case 9:return i.trys.push([9,11,,12]),[4,this.context.cache.match(t.svg)];case 10:return u=i.sent(),this.renderReplacedElement(t,r,u),[3,12];case 11:return i.sent(),this.context.logger.error(`Error loading svg `+t.svg.substring(0,255)),[3,12];case 12:return t instanceof Ss&&t.tree?(d=new n(this.context,{scale:this.options.scale,backgroundColor:t.backgroundColor,x:0,y:0,width:t.width,height:t.height}),[4,d.render(t.tree)]):[3,14];case 13:f=i.sent(),t.width&&t.height&&this.ctx.drawImage(f,0,0,t.width,t.height,t.bounds.left,t.bounds.top,t.bounds.width,t.bounds.height),i.label=14;case 14:if(t instanceof ys&&(p=Math.min(t.bounds.width,t.bounds.height),t.type===hs?t.checked&&(this.ctx.save(),this.path([new Hc(t.bounds.left+p*.39363,t.bounds.top+p*.79),new Hc(t.bounds.left+p*.16,t.bounds.top+p*.5549),new Hc(t.bounds.left+p*.27347,t.bounds.top+p*.44071),new Hc(t.bounds.left+p*.39694,t.bounds.top+p*.5649),new Hc(t.bounds.left+p*.72983,t.bounds.top+p*.23),new Hc(t.bounds.left+p*.84,t.bounds.top+p*.34085),new Hc(t.bounds.left+p*.39363,t.bounds.top+p*.79)]),this.ctx.fillStyle=Dr(vs),this.ctx.fill(),this.ctx.restore()):t.type===gs&&t.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.bounds.left+p/2,t.bounds.top+p/2,p/4,0,Math.PI*2,!0),this.ctx.fillStyle=Dr(vs),this.ctx.fill(),this.ctx.restore())),Nl(t)&&t.value.length){switch(m=this.createFontStyle(a),h=m[0],g=m[1],_=this.fontMetrics.getMetrics(h,g).baseline,this.ctx.font=h,this.ctx.fillStyle=Dr(a.color),this.ctx.textBaseline=`alphabetic`,this.ctx.textAlign=Fl(t.styles.textAlign),v=vl(t),y=0,t.styles.textAlign){case 1:y+=v.width/2;break;case 2:y+=v.width;break}b=v.add(y,0,0,-v.height/2+1),this.ctx.save(),this.path([new Hc(v.left,v.top),new Hc(v.left+v.width,v.top),new Hc(v.left+v.width,v.top+v.height),new Hc(v.left,v.top+v.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new qo(t.value,b),a.letterSpacing,_),this.ctx.restore(),this.ctx.textBaseline=`alphabetic`,this.ctx.textAlign=`left`}if(!Da(t.styles.display,2048))return[3,20];if(t.styles.listStyleImage===null)return[3,19];if(x=t.styles.listStyleImage,x.type!==0)return[3,18];u=void 0,S=x.url,i.label=15;case 15:return i.trys.push([15,17,,18]),[4,this.context.cache.match(S)];case 16:return u=i.sent(),this.ctx.drawImage(u,t.bounds.left-(u.width+10),t.bounds.top),[3,18];case 17:return i.sent(),this.context.logger.error(`Error loading list-style-image `+S),[3,18];case 18:return[3,20];case 19:e.listValue&&t.styles.listStyleType!==-1&&(h=this.createFontStyle(a)[0],this.ctx.font=h,this.ctx.fillStyle=Dr(a.color),this.ctx.textBaseline=`middle`,this.ctx.textAlign=`right`,v=new o(t.bounds.left,t.bounds.top+gr(t.styles.paddingTop,t.bounds.width),t.bounds.width,Ui(a.lineHeight,a.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new qo(e.listValue,v),a.letterSpacing,Ui(a.lineHeight,a.fontSize.number)/2+2),this.ctx.textBaseline=`bottom`,this.ctx.textAlign=`left`),i.label=20;case 20:return[2]}})})},n.prototype.renderStackContent=function(e){return r(this,void 0,void 0,function(){var t,n,r,a,o,r,s,c,r,l,u,r,d,f,r,p,m,r,h,g,r;return i(this,function(i){switch(i.label){case 0:if(Da(e.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(e.element)];case 1:i.sent(),t=0,n=e.negativeZIndex,i.label=2;case 2:return t<n.length?(r=n[t],[4,this.renderStack(r)]):[3,5];case 3:i.sent(),i.label=4;case 4:return t++,[3,2];case 5:return[4,this.renderNodeContent(e.element)];case 6:i.sent(),a=0,o=e.nonInlineLevel,i.label=7;case 7:return a<o.length?(r=o[a],[4,this.renderNode(r)]):[3,10];case 8:i.sent(),i.label=9;case 9:return a++,[3,7];case 10:s=0,c=e.nonPositionedFloats,i.label=11;case 11:return s<c.length?(r=c[s],[4,this.renderStack(r)]):[3,14];case 12:i.sent(),i.label=13;case 13:return s++,[3,11];case 14:l=0,u=e.nonPositionedInlineLevel,i.label=15;case 15:return l<u.length?(r=u[l],[4,this.renderStack(r)]):[3,18];case 16:i.sent(),i.label=17;case 17:return l++,[3,15];case 18:d=0,f=e.inlineLevel,i.label=19;case 19:return d<f.length?(r=f[d],[4,this.renderNode(r)]):[3,22];case 20:i.sent(),i.label=21;case 21:return d++,[3,19];case 22:p=0,m=e.zeroOrAutoZIndexOrTransformedOrOpacity,i.label=23;case 23:return p<m.length?(r=m[p],[4,this.renderStack(r)]):[3,26];case 24:i.sent(),i.label=25;case 25:return p++,[3,23];case 26:h=0,g=e.positiveZIndex,i.label=27;case 27:return h<g.length?(r=g[h],[4,this.renderStack(r)]):[3,30];case 28:i.sent(),i.label=29;case 29:return h++,[3,27];case 30:return[2]}})})},n.prototype.mask=function(e){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(e.slice(0).reverse()),this.ctx.closePath()},n.prototype.path=function(e){this.ctx.beginPath(),this.formatPath(e),this.ctx.closePath()},n.prototype.formatPath=function(e){var t=this;e.forEach(function(e,n){var r=Gc(e)?e.start:e;n===0?t.ctx.moveTo(r.x,r.y):t.ctx.lineTo(r.x,r.y),Gc(e)&&t.ctx.bezierCurveTo(e.startControl.x,e.startControl.y,e.endControl.x,e.endControl.y,e.end.x,e.end.y)})},n.prototype.renderRepeat=function(e,t,n,r){this.path(e),this.ctx.fillStyle=t,this.ctx.translate(n,r),this.ctx.fill(),this.ctx.translate(-n,-r)},n.prototype.resizeImage=function(e,t,n){if(e.width===t&&e.height===n)return e;var r=(this.canvas.ownerDocument??document).createElement(`canvas`);return r.width=Math.max(1,t),r.height=Math.max(1,n),r.getContext(`2d`).drawImage(e,0,0,e.width,e.height,0,0,t,n),r},n.prototype.renderBackgroundImage=function(e){return r(this,void 0,void 0,function(){var t,n,r,a,o,s;return i(this,function(c){switch(c.label){case 0:t=e.styles.backgroundImage.length-1,n=function(n){var a,o,s,c,l,u,d,f,p,m,c,l,u,d,f,h,g,_,v,y,b,x,S,C,p,w,c,T,E,d,f,D,l,u,O,k,A,ee,j,te,ne,re;return i(this,function(i){switch(i.label){case 0:if(n.type!==0)return[3,5];a=void 0,o=n.url,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r.context.cache.match(o)];case 2:return a=i.sent(),[3,4];case 3:return i.sent(),r.context.logger.error(`Error loading background-image `+o),[3,4];case 4:return a&&(s=xl(e,t,[a.width,a.height,a.width/a.height]),c=s[0],l=s[1],u=s[2],d=s[3],f=s[4],p=r.ctx.createPattern(r.resizeImage(a,d,f),`repeat`),r.renderRepeat(c,p,l,u)),[3,6];case 5:F(n)?(m=xl(e,t,[null,null,null]),c=m[0],l=m[1],u=m[2],d=m[3],f=m[4],h=P(n.angle,d,f),g=h[0],_=h[1],v=h[2],y=h[3],b=h[4],x=document.createElement(`canvas`),x.width=d,x.height=f,S=x.getContext(`2d`),C=S.createLinearGradient(_,y,v,b),Rr(n.stops,g).forEach(function(e){return C.addColorStop(e.stop,Dr(e.color))}),S.fillStyle=C,S.fillRect(0,0,d,f),d>0&&f>0&&(p=r.ctx.createPattern(x,`repeat`),r.renderRepeat(c,p,l,u))):ni(n)&&(w=xl(e,t,[null,null,null]),c=w[0],T=w[1],E=w[2],d=w[3],f=w[4],D=n.position.length===0?[pr]:n.position,l=gr(D[0],d),u=gr(D[D.length-1],f),O=Hr(n,l,u,d,f),k=O[0],A=O[1],k>0&&A>0&&(ee=r.ctx.createRadialGradient(T+l,E+u,0,T+l,E+u,k),Rr(n.stops,k*2).forEach(function(e){return ee.addColorStop(e.stop,Dr(e.color))}),r.path(c),r.ctx.fillStyle=ee,k===A?r.ctx.fill():(j=e.bounds.left+.5*e.bounds.width,te=e.bounds.top+.5*e.bounds.height,ne=A/k,re=1/ne,r.ctx.save(),r.ctx.translate(j,te),r.ctx.transform(1,0,0,ne,0,0),r.ctx.translate(-j,-te),r.ctx.fillRect(T,re*(E-te)+te,d,f*re),r.ctx.restore()))),i.label=6;case 6:return t--,[2]}})},r=this,a=0,o=e.styles.backgroundImage.slice(0).reverse(),c.label=1;case 1:return a<o.length?(s=o[a],[5,n(s)]):[3,4];case 2:c.sent(),c.label=3;case 3:return a++,[3,1];case 4:return[2]}})})},n.prototype.renderSolidBorder=function(e,t,n){return r(this,void 0,void 0,function(){return i(this,function(r){return this.path(dl(n,t)),this.ctx.fillStyle=Dr(e),this.ctx.fill(),[2]})})},n.prototype.renderDoubleBorder=function(e,t,n,a){return r(this,void 0,void 0,function(){var r,o;return i(this,function(i){switch(i.label){case 0:return t<3?[4,this.renderSolidBorder(e,n,a)]:[3,2];case 1:return i.sent(),[2];case 2:return r=fl(a,n),this.path(r),this.ctx.fillStyle=Dr(e),this.ctx.fill(),o=pl(a,n),this.path(o),this.ctx.fill(),[2]}})})},n.prototype.renderNodeBackgroundAndBorders=function(e){return r(this,void 0,void 0,function(){var t,n,r,a,o,s,c,l,u=this;return i(this,function(i){switch(i.label){case 0:return this.applyEffects(e.getEffects(2)),t=e.container.styles,n=!Er(t.backgroundColor)||t.backgroundImage.length,r=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],a=Pl(Tl(t.backgroundClip,0),e.curves),n||t.boxShadow.length?(this.ctx.save(),this.path(a),this.ctx.clip(),Er(t.backgroundColor)||(this.ctx.fillStyle=Dr(t.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(e.container)]):[3,2];case 1:i.sent(),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach(function(t){u.ctx.save();var n=Yc(e.curves),r=t.inset?0:jl,i=al(n,-r+(t.inset?1:-1)*t.spread.number,(t.inset?1:-1)*t.spread.number,t.spread.number*(t.inset?-2:2),t.spread.number*(t.inset?-2:2));t.inset?(u.path(n),u.ctx.clip(),u.mask(i)):(u.mask(n),u.ctx.clip(),u.path(i)),u.ctx.shadowOffsetX=t.offsetX.number+r,u.ctx.shadowOffsetY=t.offsetY.number,u.ctx.shadowColor=Dr(t.color),u.ctx.shadowBlur=t.blur.number,u.ctx.fillStyle=t.inset?Dr(t.color):`rgba(0,0,0,1)`,u.ctx.fill(),u.ctx.restore()}),i.label=2;case 2:o=0,s=0,c=r,i.label=3;case 3:return s<c.length?(l=c[s],l.style!==0&&!Er(l.color)&&l.width>0?l.style===2?[4,this.renderDashedDottedBorder(l.color,l.width,o,e.curves,2)]:[3,5]:[3,11]):[3,13];case 4:return i.sent(),[3,11];case 5:return l.style===3?[4,this.renderDashedDottedBorder(l.color,l.width,o,e.curves,3)]:[3,7];case 6:return i.sent(),[3,11];case 7:return l.style===4?[4,this.renderDoubleBorder(l.color,l.width,o,e.curves)]:[3,9];case 8:return i.sent(),[3,11];case 9:return[4,this.renderSolidBorder(l.color,o,e.curves)];case 10:i.sent(),i.label=11;case 11:o++,i.label=12;case 12:return s++,[3,3];case 13:return[2]}})})},n.prototype.renderDashedDottedBorder=function(e,t,n,a,o){return r(this,void 0,void 0,function(){var r,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,b,x;return i(this,function(i){return this.ctx.save(),r=ml(a,n),s=dl(a,n),o===2&&(this.path(s),this.ctx.clip()),Gc(s[0])?(c=s[0].start.x,l=s[0].start.y):(c=s[0].x,l=s[0].y),Gc(s[1])?(u=s[1].end.x,d=s[1].end.y):(u=s[1].x,d=s[1].y),f=Math.abs(n===0||n===2?c-u:l-d),this.ctx.beginPath(),o===3?this.formatPath(r):this.formatPath(s.slice(0,2)),p=t<3?t*3:t*2,m=t<3?t*2:t,o===3&&(p=t,m=t),h=!0,f<=p*2?h=!1:f<=p*2+m?(g=f/(2*p+m),p*=g,m*=g):(_=Math.floor((f+m)/(p+m)),v=(f-_*p)/(_-1),y=(f-(_+1)*p)/_,m=y<=0||Math.abs(m-v)<Math.abs(m-y)?v:y),h&&(o===3?this.ctx.setLineDash([0,p+m]):this.ctx.setLineDash([p,m])),o===3?(this.ctx.lineCap=`round`,this.ctx.lineWidth=t):this.ctx.lineWidth=t*2+1.1,this.ctx.strokeStyle=Dr(e),this.ctx.stroke(),this.ctx.setLineDash([]),o===2&&(Gc(s[0])&&(b=s[3],x=s[0],this.ctx.beginPath(),this.formatPath([new Hc(b.end.x,b.end.y),new Hc(x.start.x,x.start.y)]),this.ctx.stroke()),Gc(s[1])&&(b=s[1],x=s[2],this.ctx.beginPath(),this.formatPath([new Hc(b.end.x,b.end.y),new Hc(x.start.x,x.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},n.prototype.render=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=Dr(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),t=ul(e),[4,this.renderStack(t)];case 1:return n.sent(),this.applyEffects([]),[2,this.canvas]}})})},n}(Al),Nl=function(e){return e instanceof xs||e instanceof bs?!0:e instanceof ys&&e.type!==gs&&e.type!==hs},Pl=function(e,t){switch(e){case 0:return Yc(t);case 2:return Xc(t);default:return Zc(t)}},Fl=function(e){switch(e){case 1:return`center`;case 2:return`right`;default:return`left`}},Il=[`-apple-system`,`system-ui`],Ll=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter(function(e){return Il.indexOf(e)===-1}):e},Rl=function(e){t(n,e);function n(t,n){var r=e.call(this,t,n)||this;return r.canvas=n.canvas?n.canvas:document.createElement(`canvas`),r.ctx=r.canvas.getContext(`2d`),r.options=n,r.canvas.width=Math.floor(n.width*n.scale),r.canvas.height=Math.floor(n.height*n.scale),r.canvas.style.width=n.width+`px`,r.canvas.style.height=n.height+`px`,r.ctx.scale(r.options.scale,r.options.scale),r.ctx.translate(-n.x,-n.y),r.context.logger.debug(`EXPERIMENTAL ForeignObject renderer initialized (`+n.width+`x`+n.height+` at `+n.x+`,`+n.y+`) with scale `+n.scale),r}return n.prototype.render=function(e){return r(this,void 0,void 0,function(){var t,n;return i(this,function(r){switch(r.label){case 0:return t=Go(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,e),[4,zl(t)];case 1:return n=r.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=Dr(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(n,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},n}(Al),zl=function(e){return new Promise(function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=n,r.src=`data:image/svg+xml;charset=utf-8,`+encodeURIComponent(new XMLSerializer().serializeToString(e))})},Bl=function(){function e(e){var t=e.id,n=e.enabled;this.id=t,this.enabled=n,this.start=Date.now()}return e.prototype.debug=function(){var e=[...arguments];this.enabled&&(typeof window<`u`&&window.console&&typeof console.debug==`function`?console.debug.apply(console,a([this.id,this.getTime()+`ms`],e)):this.info.apply(this,e))},e.prototype.getTime=function(){return Date.now()-this.start},e.prototype.info=function(){var e=[...arguments];this.enabled&&typeof window<`u`&&window.console&&typeof console.info==`function`&&console.info.apply(console,a([this.id,this.getTime()+`ms`],e))},e.prototype.warn=function(){var e=[...arguments];this.enabled&&(typeof window<`u`&&window.console&&typeof console.warn==`function`?console.warn.apply(console,a([this.id,this.getTime()+`ms`],e)):this.info.apply(this,e))},e.prototype.error=function(){var e=[...arguments];this.enabled&&(typeof window<`u`&&window.console&&typeof console.error==`function`?console.error.apply(console,a([this.id,this.getTime()+`ms`],e)):this.info.apply(this,e))},e.instances={},e}(),Vl=function(){function e(t,n){this.windowBounds=n,this.instanceName=`#`+ e.instanceCount++,this.logger=new Bl({id:this.instanceName,enabled:t.logging}),this.cache=t.cache??new Nc(this,t)}return e.instanceCount=1,e}(),Hl=function(e,t){return t===void 0&&(t={}),Ul(e,t)};typeof window<`u`&&R.setContext(window);var Ul=function(e,t){return r(void 0,void 0,void 0,function(){var r,a,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,D;return i(this,function(i){switch(i.label){case 0:if(!e||typeof e!=`object`)return[2,Promise.reject(`Invalid element provided as first argument`)];if(r=e.ownerDocument,!r)throw Error(`Element is not attached to a Document`);if(a=r.defaultView,!a)throw Error(`Document is not attached to a Window`);return l={allowTaint:t.allowTaint??!1,imageTimeout:t.imageTimeout??15e3,proxy:t.proxy,useCORS:t.useCORS??!1},u=n({logging:t.logging??!0,cache:t.cache},l),d={windowWidth:t.windowWidth??a.innerWidth,windowHeight:t.windowHeight??a.innerHeight,scrollX:t.scrollX??a.pageXOffset,scrollY:t.scrollY??a.pageYOffset},f=new o(d.scrollX,d.scrollY,d.windowWidth,d.windowHeight),p=new Vl(u,f),m=t.foreignObjectRendering??!1,h={allowTaint:t.allowTaint??!1,onclone:t.onclone,ignoreElements:t.ignoreElements,inlineImages:m,copyStyles:m},p.logger.debug(`Starting document clone with size `+f.width+`x`+f.height+` scrolled to `+-f.left+`,`+-f.top),g=new hc(p,e,h),_=g.clonedReferenceElement,_?[4,g.toIFrame(r,f)]:[2,Promise.reject(`Unable to find element in cloned iframe`)];case 1:return v=i.sent(),y=Rs(_)||Is(_)?c(_.ownerDocument):s(p,_),b=y.width,x=y.height,S=y.left,C=y.top,w=Wl(p,_,t.backgroundColor),T={canvas:t.canvas,backgroundColor:w,scale:t.scale??a.devicePixelRatio??1,x:(t.x??0)+S,y:(t.y??0)+C,width:t.width??Math.ceil(b),height:t.height??Math.ceil(x)},m?(p.logger.debug(`Document cloned, using foreign object rendering`),D=new Rl(p,T),[4,D.render(_)]):[3,3];case 2:return E=i.sent(),[3,5];case 3:return p.logger.debug(`Document cloned, element located at `+S+`,`+C+` with size `+b+`x`+x+` using computed rendering`),p.logger.debug(`Starting DOM parsing`),O=Es(p,_),w===O.styles.backgroundColor&&(O.styles.backgroundColor=Fr.TRANSPARENT),p.logger.debug(`Starting renderer for element at `+T.x+`,`+T.y+` with size `+T.width+`x`+T.height),D=new Ml(p,T),[4,D.render(O)];case 4:E=i.sent(),i.label=5;case 5:return(t.removeContainer??!0)&&(hc.destroy(v)||p.logger.error(`Cannot detach cloned iframe as it is not in the DOM anymore`)),p.logger.debug(`Finished rendering`),[2,E]}})})},Wl=function(e,t,n){var r=t.ownerDocument,i=r.documentElement?Pr(e,getComputedStyle(r.documentElement).backgroundColor):Fr.TRANSPARENT,a=r.body?Pr(e,getComputedStyle(r.body).backgroundColor):Fr.TRANSPARENT,o=typeof n==`string`?Pr(e,n):n===null?Fr.TRANSPARENT:4294967295;return t===r.documentElement?Er(i)?Er(a)?o:a:i:o};return Hl}))}))(),1);async function vD(e){let t=!1,n,r;document.fullscreenElement===e&&(t=!0,n=e.style.width,r=e.style.height,e.style.width=`100vw`,e.style.height=`100vh`);let i=await(0,_D.default)(e);return t&&(e.style.width=n,e.style.height=r),i.toDataURL()}var rXe={props:{elements:{type:Array,required:!0},shortcuts:{type:Array,required:!0}}},iXe={class:`shortcuts-modal`},aXe={class:`shortcuts-modal__title`},oXe={class:`shortcuts-modal__content`},sXe={class:`shortcuts-modal__content-left`},cXe={class:`shortcuts-modal__content-left__element__image`},lXe={class:`shortcuts-modal__content-left__element__text`},uXe={class:`shortcuts-modal__content-right`},dXe={class:`shortcuts-modal__content-right__element__shortcut`},fXe={key:0,class:`letter`},pXe={key:1,class:`flex items-center`},mXe={class:`maj`},hXe={class:`icon`},gXe={key:2,class:`flex items-center`},_Xe={class:`icon`},vXe={key:3,class:`flex items-center`},yXe={class:`icon`},bXe={class:`shortcuts-modal__content-right__element__text`},xXe={class:`shortcuts-modal__footer`};function SXe(e,t,n,r,i,a){let o=R(`BIMDataIllustration`),s=R(`BIMDataIconAlt`),c=R(`BIMDataButton`);return z(),B(`div`,iXe,[H(`div`,aXe,[H(`span`,null,[Bc(e.$slots,`title`,{},void 0,!0)])]),H(`div`,oXe,[H(`div`,sXe,[(z(!0),B(bu,null,Rc(n.elements,e=>(z(),B(`div`,{key:e.title,class:`shortcuts-modal__content-left__element`},[H(`div`,cXe,[U(o,{name:e.image,x:`200`,y:`200`},null,8,[`name`])]),H(`div`,lXe,[H(`h3`,null,F(e.title),1),H(`p`,null,F(e.text),1)])]))),128))]),H(`div`,uXe,[(z(!0),B(bu,null,Rc(n.shortcuts,e=>(z(),B(`div`,{key:e.text,class:`shortcuts-modal__content-right__element`},[H(`div`,dXe,[e.letter?(z(),B(`span`,fXe,F(e.letter),1)):G(``,!0),e.maj?(z(),B(`div`,pXe,[H(`span`,mXe,[U(s,{size:`xxs`,class:`fill-primary`})]),t[1]||=H(`span`,{class:`more`},`+`,-1),H(`div`,hXe,[U(o,{name:e.illustration,x:`23`,y:`30`},null,8,[`name`])])])):G(``,!0),e.alt?(z(),B(`div`,gXe,[t[2]||=H(`span`,{class:`alt`},` alt `,-1),t[3]||=H(`span`,{class:`more`},`+`,-1),H(`div`,_Xe,[U(o,{name:e.illustration,x:`23`,y:`30`},null,8,[`name`])])])):G(``,!0),e.shift?(z(),B(`div`,vXe,[t[4]||=H(`span`,{class:`alt`},` shift `,-1),t[5]||=H(`span`,{class:`more`},`+`,-1),H(`div`,yXe,[U(o,{name:e.illustration,x:`23`,y:`30`},null,8,[`name`])])])):G(``,!0)]),H(`div`,bXe,F(e.text),1)]))),128))])]),H(`div`,xXe,[U(c,{fill:``,color:`primary`,radius:``,width:`166px`,onClick:t[0]||=t=>e.$emit(`close`)},{default:L(()=>[W(F(e.$t(`shortcuts-helper.btn`)),1)]),_:1})])])}var yD=q(rXe,[[`render`,SXe],[`__scopeId`,`data-v-e7d92a04`]]),CXe={components:{ShortcutsModal:yD},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 wXe(e,t,n,r,i,a){let o=R(`ShortcutsModal`);return z(),V(o,{class:`bimdata-shortcuts2d-helper`,elements:i.elements,shortcuts:i.shortcuts},{title:L(()=>[W(F(e.$t(`shortcuts-helper.title_modal_2d`)),1)]),_:1},8,[`elements`,`shortcuts`])}var TXe=q(CXe,[[`render`,wXe],[`__scopeId`,`data-v-9a9c15e3`]]);function bD(e=null){let t=Xo(`$viewer`);e??=t.localContext;let n=za(Array.from(t.state.annotations)),r=[t.state.hub.on(`annotation-added`,({annotation:e})=>{n.value.push(e),Ha(n)}),t.state.hub.on(`annotation-updated`,()=>{Ha(n)}),t.state.hub.on(`annotation-removed`,({annotation:e})=>{n.value=n.value.filter(t=>t.id!==e.id)})];return Ec(()=>r.forEach(e=>t.state.hub.off(e))),K(()=>n.value.filter(t=>t.modelIds.length===0?!0:t.modelIds.some(t=>e.loadedModelIds.includes(t))))}var xD=e=>t=>{t.preventDefault();let n=new CustomEvent(`wheel`,{bubbles:!0,cancelable:!0,detail:t});n.deltaY=t.deltaY,n.clientX=t.clientX,n.clientY=t.clientY,e.dispatchEvent(n)},SD=q({__name:`AnnotationWrapper`,props:{annotation:{type:Object,required:!0},canvas:{type:HTMLCanvasElement,required:!0}},emits:[`annotation-drag`],setup(e,{emit:t}){let n=e,r=t,i=I(null),a=()=>i.value?.querySelector(n.annotation.grabberSelector)??i.value,o=xD(n.canvas),s=!1,c=e=>{e.button!==2&&(e.targetTouches&&(e.stopPropagation(),e.preventDefault()),n.annotation.draggable&&(document.addEventListener(`mouseup`,l),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,l),document.addEventListener(`mousemove`,u),document.addEventListener(`touchmove`,u,{passive:!1}),n.annotation.emit(`drag-start`,{nativeEvent:e})))},l=e=>{n.annotation.draggable&&(document.removeEventListener(`mousemove`,u),document.removeEventListener(`touchmove`,u),s&&(s=!1,n.annotation.emit(`drag-end`,{nativeEvent:e})))},u=e=>{e.targetTouches&&(e.stopPropagation(),e.preventDefault()),n.annotation.draggable&&(e.targetTouches&&(e.clientX=e.targetTouches[0].clientX,e.clientY=e.targetTouches[0].clientY),r(`annotation-drag`,e),n.annotation.emit(`drag`,{nativeEvent:e}),s=!0)};return Sc(()=>{a()?.addEventListener(`mousedown`,c),a()?.addEventListener(`touchstart`,c,{passive:!1})}),Tc(()=>{a()?.removeEventListener(`mousedown`,c),a()?.removeEventListener(`touchstart`,c)}),(t,n)=>(z(),B(`div`,{ref_key:`wrapper`,ref:i,class:`annotation-wrapper`,onWheel:n[0]||=(...e)=>Ua(o)&&Ua(o)(...e)},[(z(),V(Pc(e.annotation.component),Vu(e.annotation.props,{annotation:e.annotation}),null,16,[`annotation`]))],544))}},[[`__scopeId`,`data-v-840c20b2`]]),EXe={class:`annotations-2d`},CD=q({__name:`Annotations2D`,props:{context:{type:Object,default:null}},setup(e){let t=e,n=Xo(`$viewer`),r=t.context;r||=n.localContext;let i=r.viewer,a=i.viewer??i.engine,o=a.canvas,s=bD(r),c=K(()=>s.value.filter(e=>!i.selectedStorey||e.z>=i.selectedStorey.absoluteElevation&&e.z<i.selectedStorey.absoluteTopElevation));a.camera.on(`update`,()=>Ha(s));let l=(e,t)=>{let{x:r,y:s}=o.getBoundingClientRect(),{clientX:c,clientY:l}=t,{x:u,y:d}=a.camera.getPosition({x:c-r,y:l-s});i.ui?.highlightOnHover===!0&&(i.ui.highlightOnHover=!1,setTimeout(()=>i.ui.highlightOnHover=!0,300)),n.state.highlightedObjects.length>0&&n.state.unhighlightObjects(n.state.highlightedObjects.map(e=>e.id)),Object.assign(e,{x:u,y:d})},u=e=>{let{x:t,y:n}=a.camera.getCanvasPosition(e);return`left: ${t}px; top: ${n}px;`};return(e,t)=>(z(),B(`div`,EXe,[(z(!0),B(bu,null,Rc(c.value,e=>(z(),V(SD,{key:e.instanceId,annotation:e,canvas:Ua(o),style:N(u(e)),onAnnotationDrag:t=>l(e,t)},null,8,[`annotation`,`canvas`,`style`,`onAnnotationDrag`]))),128))]))}},[[`__scopeId`,`data-v-87f776fe`]]),DXe={props:{autoOpen:{type:Boolean,default:!0}},setup(e){let{localContext:t}=Xo(`$viewer`),n=t.viewer?.plugin.name,r=I(!0),i=K(()=>t.loadedModels),a=I(0),o=K(()=>i.value[a.value]||{storeys:[]}),s=K(()=>t.selectedStorey),c=I(!1),l=()=>{c.value=!c.value},u=e=>e.key===s.value?.key,d=e=>{u(e)||t.selectStorey(e)},f=K(()=>t.shownPlans),p=e=>f.value.some(t=>t.key===e.key),{loadingPlans:m}=yE(t),h=e=>m.value.some(t=>t.key===e.key),g=Ta(new Set);return rs([i,o],()=>{i.value.length===0||i.value.length===1&&o.value.type!==`METABUILDING`&&o.value.storeys.length<2&&(o.value.storeys[0]?.plans.length??0)===0?r.value=!1:r.value=!0,r.value&&(n===`viewer2d`||n===`plan`||n===`photosphere`)&&(c.value=e.autoOpen)},{immediate:!0}),{currentModelIndex:a,currentModel:o,storeyPlanShown:g,storeyListOpen:c,isVisible:r,models:i,focus:()=>{o.value&&(c.value||=!0,s.value&&g.add(s.value.uuid))},selectStorey:d,togglePlan:e=>{f.value.some(t=>t.key===e.key)?t.hidePlan(e):t.showPlan(e)},togglePlansList:e=>{g.has(e.key)?g.delete(e.key):g.add(e.key)},toggleStoreysList:l,isStoreySelected:u,isPlanShown:p,isPlanLoading:h}}},OXe={class:`storey-selector`},kXe={class:`storey-selector__list`},AXe=[`onClick`],jXe={class:`name`},MXe={class:`count`},NXe={class:`storey-selector__list__entry__content plan-selector__list`},PXe=[`onClick`],FXe={key:0,class:`loader`},IXe={class:`storey-selector__model-switcher`},LXe={class:`actions`};function RXe(e,t,n,r,i,a){let o=R(`BIMDataRadio`),s=R(`BIMDataIconStorey`),c=R(`BIMDataTextbox`),l=R(`BIMDataIconChevron`),u=R(`BIMDataButton`),d=R(`BIMDataCheckbox`),f=R(`BIMDataSpinner`),p=R(`BIMDataFileIcon`);return z(),B(`div`,OXe,[U(kd,{name:`slide-fade-down`},{default:L(()=>[qo(H(`div`,kXe,[(z(!0),B(bu,null,Rc(r.currentModel.storeys.slice(),e=>(z(),B(`div`,{key:e.key,class:`storey-selector__list__entry`},[U(o,{"model-value":r.isStoreySelected(e),"onUpdate:modelValue":t=>r.selectStorey(e)},null,8,[`model-value`,`onUpdate:modelValue`]),H(`div`,{class:`storey-selector__list__entry__line`,onClick:t=>r.selectStorey(e)},[U(s,{size:`xs`}),H(`span`,jXe,[U(c,{text:e.name},null,8,[`text`])]),e.plans.length>0?(z(),B(bu,{key:0},[H(`span`,MXe,F(e.plans.length),1),U(u,{width:`26px`,height:`26px`,ghost:``,rounded:``,icon:``,onClick:Rf(t=>r.togglePlansList(e),[`stop`])},{default:L(()=>[U(l,{size:`xxs`,rotate:r.storeyPlanShown.has(e.key)?90:0,style:{transition:`transform 0.1s linear`}},null,8,[`rotate`])]),_:2},1032,[`onClick`])],64)):G(``,!0)],8,AXe),U(kd,{name:`slide-fade-up`},{default:L(()=>[qo(H(`div`,NXe,[(z(!0),B(bu,null,Rc(e.plans,t=>(z(),B(`div`,{key:`${t.key}`,class:`plan-selector__list__entry`},[U(d,{class:`plan-selector__list__entry__checkbox`,disabled:!r.isStoreySelected(e)||r.isPlanLoading(t),"model-value":r.isPlanShown(t),"onUpdate:modelValue":e=>r.togglePlan(t)},null,8,[`disabled`,`model-value`,`onUpdate:modelValue`]),H(`div`,{class:`plan-selector__list__entry__line`,style:{cursor:`pointer`},onClick:Rf(n=>{r.isStoreySelected(e)&&!r.isPlanLoading(t)&&r.togglePlan(t)},[`stop`])},[r.isPlanLoading(t)?(z(),B(`span`,FXe,[U(f)])):(z(),V(p,{key:1,"file-name":t.plan.document?.file_name||t.plan.name,size:14},null,8,[`file-name`])),U(c,{"max-width":`200px`,text:t.plan.name},null,8,[`text`])],8,PXe)]))),128))],512),[[Wd,r.storeyPlanShown.has(e.key)]])]),_:2},1024)]))),128))],512),[[Wd,r.storeyListOpen&&r.isVisible]])]),_:1}),qo(H(`div`,IXe,[U(u,{width:`26px`,height:`26px`,ghost:``,radius:``,icon:``,disabled:r.currentModel.storeys.length===0,onClick:r.toggleStoreysList},{default:L(()=>[U(l,{size:`xxs`,rotate:r.storeyListOpen?-90:0,style:{transition:`transform 0.1s linear`}},null,8,[`rotate`])]),_:1},8,[`disabled`,`onClick`]),H(`span`,{class:`name`,onClick:t[0]||=(...e)=>r.toggleStoreysList&&r.toggleStoreysList(...e)},[U(c,{text:r.currentModel.name,"tooltip-position":`top`},null,8,[`text`])]),H(`span`,LXe,[U(u,{width:`26px`,height:`26px`,ghost:``,rounded:``,icon:``,disabled:r.currentModelIndex===0,onClick:t[1]||=e=>r.currentModelIndex--},{default:L(()=>[U(l,{size:`xxs`,rotate:180})]),_:1},8,[`disabled`]),U(u,{width:`26px`,height:`26px`,ghost:``,rounded:``,icon:``,disabled:r.currentModelIndex===r.models.length-1,onClick:t[2]||=e=>r.currentModelIndex++},{default:L(()=>[U(l,{size:`xxs`})]),_:1},8,[`disabled`])])],512),[[Wd,r.isVisible]])])}var wD=q(DXe,[[`render`,RXe],[`__scopeId`,`data-v-c590c341`]]),zXe={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 BXe(e,t,n,r,i,a){return z(),B(`div`,{class:`bimdata-help-shortcuts`,onClick:t[0]||=(...e)=>a.onClick&&a.onClick(...e)},`?`)}var TD=q(zXe,[[`render`,BXe],[`__scopeId`,`data-v-78103e0c`]]);function ED(e,t,n={}){if(!Array.isArray(t)||t.some(e=>!Number.isFinite(e.x)||!Number.isFinite(e.y)))throw TypeError(`[Viewer2d - drawArea] An array of point with x and y properties as finit numbers is requested.`);let r=dv(),{lineWidth:i=1,lineColor:a=r,lineOpacity:o=1,fill:s=r,fillOpacity:c=.2}=n,l=e.scene.addObject({shapes:[{style:{lineWidth:i,lineColor:a,lineOpacity:o,fill:s,fillOpacity:c,nonScalingLineWidth:!0},paths:[{type:`line`,points:t.flatMap(({x:e,y:t})=>[e,t]),close:!0}]}]});return{object:l,get visible(){return l.visible},set visible(e){l.visible=!!e},points:t,destroy(){e.scene.removeObject(l.id)}}}var VXe={name:`Viewer2D`,components:{Annotations:CD,BIMDataStoreySelector:wD,Help:TD},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=TXe,this.localContextSubscriptions=[],this.stateSubscriptions=[],this.queue=QE(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=VT({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=tXe(this),this.plugins=XE(this),this.unsubscribe=$Ye(this),this.plugins.bitmaps){let e=this.plugins.bitmaps;this.localContextSubscriptions.push(this.$viewer.localContext.hub.on(`plan-shown`,({plan:t})=>{e.showPlan(t)}),this.$viewer.localContext.hub.on(`plan-hidden`,({plan:t})=>{e.hidePlan(t)})),this.stateSubscriptions.push(this.$viewer.state.hub.on(`plan-deleted`,({plan:t})=>{e.deletePlan(t)}))}this.$watch(`selectOnClick`,e=>{this.ui.selectOnClick=e},{immediate:!0}),this.$watch(`highlightOnHover`,e=>{this.ui.highlightOnHover=e},{immediate:!0}),this.$watch(`camera3DSynchronization`,e=>{e?(this.cameraObject||=nXe(this.viewer),this.camera3DSubscription=this.$viewer.globalContext.hub.on(`3d-camera-update`,e=>{let{eye:t,look:n,up:r}=e;this.syncRotationFrom3DCamera(t,n,r);let[i,,a]=t,[o,,s]=n;this.cameraObject.sync({x:i,y:a},{x:o,y:s})},{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(e=>e.type===`space`).map(e=>String(e.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],n=[0,1,0]){if(Math.abs(n[0])<2**-52||Math.abs(n[1])<2**-52)return;let{angle:r,sub:i,normalize:a}=this.viewer.utils.vector2D,[o,,s]=e,[c,,l]=t,u=a(i({x:o,y:s},{x:c,y:l}));if(Math.abs(u.x)<2**-52&&Math.abs(u.y)<2**-52)return;let d=null;d=u.x<0?r(u,{x:0,y:1}):r({x:0,y:1},u);let f=n[1]>0?180:0,p=d/Math.PI*180+f;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(e=>e.name),[...e,{name:`fitview`,key:`F`,execute:()=>this.fitViewSelectedObjects()}].forEach(e=>this.$viewer.localContext.registerShortcut(e))},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(e=>t.registerContextCommand(e)),this.camera3DSynchronization&&this.$viewer.globalContext.pluginComponentInstances.has(`viewer3d`)){let t=this.$viewer.globalContext.pluginComponentInstances.get(`viewer3d`)[0];this.$viewer.contextMenu.registerContextCommand({get label(){return e.$t(`viewer2d.move_3d_camera`)},execute:e=>{let{clientX:n,clientY:r}=e,{x:i,y:a}=this.viewer.canvas.getBoundingClientRect(),o=this.viewer.camera.getPosition({x:n-i,y:r-a}),s=t.xeokit.camera.eye;t.xeokit.cameraFlight.flyTo({eye:[o.x,s[1],o.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(e=>this.viewer.scene.objectsMap.get(String(e.id))).filter(Boolean);this.viewer.camera.fitView(t)}else this.viewer.camera.fitView()},async load2DEngineIfc(e){this.loadIfcFromSVG||=ZE(this);let t=await this.loadIfcFromSVG(e.map_file,e.id,e.onlyLoadUuids);if(e.recommanded_2d_angle!==void 0){let t=this.viewer.camera.rotation;this.viewer.camera.rotate(-t-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 n=e[0];if(!n.map_file)throw Error(`Viewer --- ERROR --- Viewer2D Plugin - Impossible to load ifc without a map_file.`);return this.loading=!0,new Promise((e,r)=>{this.queue.push(async()=>{try{this.model&&this.unloadIfc(this.model,!1),await this.load2DEngineIfc(n),this.plugins.compass.onIfcChange(n),this.loading=!1,this.model=n;let r={model:n,ifc:n,plugin:this};if(this.$viewer.localContext.hub.emit(`2d-model-loaded`,r),this.$viewer.globalContext.hub.emit(`2d-model-loaded`,r),n.storeys.length>0){let e=0;if(t?.storeyKey){let r=n.storeys.findIndex(e=>e.key===t.storeyKey);r!==-1&&(e=r)}this.$viewer.localContext.selectStorey(n.storeys[e])}e()}catch(e){r(e)}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 n=e[0],r=()=>{if(this.$viewer.localContext.selectStorey(null),this.model=null,this.viewer.scene.removeModel(String(n.id))){let e={model:n,ifc:n,plugin:this};return this.$viewer.localContext.hub.emit(`2d-model-unloaded`,e),this.$viewer.globalContext.hub.emit(`2d-model-unloaded`,e),!0}else return!1};t?this.queue.push(r):r()},async getSnapshot(){return{snapshot_type:`png`,snapshot_data:await vD(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(e=>e.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 e=null;await new Promise(t=>{e=this.$watch(`loading`,e=>{e||t()},{immediate:!0})}),e()}if(!this.model)return;let{camera_view_point:t,camera_up_vector:n,view_to_world_scale:r}=e.orthogonal_camera,i=this.$viewer.state.getStoreyFromAbsoluteElevation(this.model,t.z);this.$viewer.localContext.selectStorey(i);let a=this.viewer.utils.vector2D.angle({x:1,y:0},n);this.viewer.camera.setViewpoint({...t,rotation:-(a/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:n,y:r}=this.viewer.camera.getPosition(t),i=this.selectedStorey,a=this.viewer.picker.pick(t),o=this.$viewer.state.objectsMap.get(+a?.id)??null;e({x:n,y:r,z:i.absoluteElevation,models:this.$viewer.localContext.loadedModels,storey:i,object:o})}))},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 ED(this.viewer,e,t)}}},HXe={class:`bimdata-viewer2d`},UXe={ref:`canvas`,class:`bimdata-viewer2d__viewer__canvas`},WXe={ref:`texter`,style:{position:`absolute`,top:`0px`,left:`0px`}},GXe={class:`bimdata-viewer2d__header`};function KXe(e,t,n,r,i,a){let o=R(`Annotations`),s=R(`NoModelWindowPlaceHolder`),c=R(`ModelsLoader`),l=R(`Help`),u=R(`BIMDataStoreySelector`);return z(),B(`div`,HXe,[H(`canvas`,UXe,null,512),H(`div`,WXe,null,512),e.engine2dCreated?(z(),V(o,{key:0})):G(``,!0),!e.ifc&&!e.loading?(z(),V(s,{key:1})):G(``,!0),H(`div`,GXe,[e.settings.modelLoader===`disabled`?G(``,!0):qo((z(),V(c,{key:0,ref:`header`,"window-positioning":!1},null,512)),[[Wd,e.modelHeaderShown]]),e.helpShown?(z(),V(l,{key:1,modal:e.helpModal,name:`2D`},null,8,[`modal`])):G(``,!0)]),qo(U(u,{ref:`storeySelector`,"auto-open":e.storeySelectorAutoOpen},null,8,[`auto-open`]),[[Wd,e.storeySelectorShown]])])}var qXe={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ámara 3D aquí`},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éplacer la caméra 3D ici`},it:{window_label:`Visualizzatore 2D`,compass:{N:`N`,NE:`NE`,E:`E`,SE:`SE`,S:`S`,SW:`SO`,W:`O`,NW:`NO`},move_3d_camera:`Sposta qui la fotocamera 3D`}},component:q(VXe,[[`render`,KXe],[`__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}},JXe=`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`,YXe={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:JXe,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=t=>{t.key===`Enter`&&e.blur()});let t=this.$refs.label;t.addEventListener(`mousedown`,e=>{document.addEventListener(`mousemove`,this.onMouseMove),t.requestPointerLock(),this.grabbing=!0;let{clientX:n,clientY:r}=e,{x:i,y:a}=this.$el.getBoundingClientRect();this.elPosition={x:i,y:a},this.container&&(this.containerRect=this.container.getBoundingClientRect()),this.cursorTranslate={x:n-i,y:r-a}}),document.addEventListener(`mouseup`,()=>{document.removeEventListener(`mousemove`,this.onMouseMove),document.exitPointerLock(),this.grabbing=!1,this.containerRect=null,this.elPosition=null})},unmounted(){document.removeEventListener(`keydown`,this.keydownHandler)},methods:{onMouseMove(e){if(this.cursorTranslate={x:this.cursorTranslate.x+e.movementX,y:this.cursorTranslate.y+e.movementY},this.containerRect){let{x:e,y:t,width:n,height:r}=this.containerRect;for(;this.cursorTranslate.x+this.elPosition.x-e>n;)this.cursorTranslate.x-=n;for(;this.cursorTranslate.x+this.elPosition.x<e;)this.cursorTranslate.x+=n;for(;this.cursorTranslate.y+this.elPosition.y-t>r;)this.cursorTranslate.y-=r;for(;this.cursorTranslate.y+this.elPosition.y<t;)this.cursorTranslate.y+=r}this.requestUpdate(this.modelValue+e.movementX*this.step)},onMouseDown(e){e.preventDefault(),this.focus()},focus(){let e=this.$refs.input;e&&e.focus()},blur(){let e=this.$refs.input;e&&e.blur()},onFocus(){this.focused=!0},onBlur(){this.focused=!1},onChange(e){let t=this.fixedValue,n=parseFloat(e.target.value);isNaN(n)&&(n=t),this.requestUpdate(n)},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()}}},XXe=[`value`,`disabled`],ZXe=[`src`];function QXe(e,t,n,r,i,a){let o=Fc(`click-away`);return qo((z(),B(`div`,{class:P([`bimdata-numerical-input`,{"bimdata-numerical-input--focus":i.focused}]),onMousedown:t[3]||=(...e)=>a.onMouseDown&&a.onMouseDown(...e)},[qo(H(`span`,{ref:`label`,class:`bimdata-numerical-input__label`,style:N(`width: ${n.labelWidth}`)},F(n.label),5),[[Wd,n.label]]),H(`input`,{ref:`input`,class:P([`bimdata-numerical-input__input`,{"bimdata-numerical-input__input--centered":n.centered}]),value:`${a.fixedValue}${n.unit}`,disabled:n.disabled,onChange:t[0]||=(...e)=>a.onChange&&a.onChange(...e),onFocus:t[1]||=(...e)=>a.onFocus&&a.onFocus(...e),onBlur:t[2]||=(...e)=>a.onBlur&&a.onBlur(...e)},null,42,XXe),i.grabbing?(z(),B(`div`,{key:0,class:`bimdata-numerical-input__cursor`,style:N(a.cursorTransform)},[H(`img`,{src:i.cursor,style:{transform:`translate(-50%, -50%)`}},null,8,ZXe)],4)):G(``,!0)],34)),[[o,a.away]])}var DD=q(YXe,[[`render`,QXe],[`__scopeId`,`data-v-7438b65a`]]),$Xe={components:{BIMDataNumericalInput:DD},setup(){let e=Xo(`$viewer`),t=Xo(`root`),n=K(()=>t.editedBitmap?t.editedBitmap:{x:0,y:0,scale:0,angle:0,opacity:0}),r=eZe(n),i=async()=>{try{if(t.loading=!0,t.editedBitmap.plan){let{x:n,y:r,scale:i,angle:a,opacity:o,plan:s}=t.editedBitmap,c={...s.plan.transform};Object.assign(s.plan.transform,{translate:[n,r],rotate:a,scale:i,opacity:o}),await e.state.updatePlan(s,c)}else{let{x:r,y:i,angle:a,scale:o,opacity:s}=n.value,c={translate:[r??0,i??0],rotate:a??0,scale:o??1,opacity:s??1},l=await e.state.createPlan(t.model,t.selectedStorey,n.value.document,c);n.value.plan=l}n.value.edited=!1,t.page=`home`}catch(e){console.error(e)}finally{t.loading=!1}};return{root:t,bitmap:n,...r,submit:i}}};function eZe(e){let t={};return Object.entries({x:e=>e,y:e=>e,scale:e=>e,angle:e=>e<0||e>360?(e%360+360)%360:e,opacity:e=>e<0?0:e>1?1:e}).forEach(([n,r])=>{t[n]=K({get:()=>e.value[n],set:t=>e.value[n]=r(t)})}),t}var tZe={class:`viewer2d-background__page__edit`},nZe={class:`viewer2d-background__page__edit__content`},rZe={class:`viewer2d-background__page__edit__content__unit-group`},iZe={class:`viewer2d-background__page__edit__content__unit-group__element`},aZe={class:`viewer2d-background__page__edit__content__unit-group__element`},oZe={class:`viewer2d-background__page__edit__content__unit-group__element`},sZe={class:`viewer2d-background__page__edit__content__unit`},cZe={class:`viewer2d-background__page__edit__content__unit`},lZe={class:`viewer2d-background__page__edit__content__img`},uZe=[`src`],dZe={class:`viewer2d-background__page__edit__validate`};function fZe(e,t,n,r,i,a){let o=R(`BIMDataNumericalInput`),s=R(`BIMDataSlider`),c=R(`BIMDataTextbox`),l=R(`BIMDataButton`);return z(),B(`div`,tZe,[H(`div`,nZe,[H(`section`,null,[H(`span`,null,F(e.$t(`viewer2d-background.location`)),1),H(`div`,rZe,[H(`div`,iZe,[U(o,{modelValue:e.x,"onUpdate:modelValue":t[0]||=t=>e.x=t,label:`X`,container:e.$viewer.localContext.el},null,8,[`modelValue`,`container`])]),H(`div`,aZe,[U(o,{modelValue:e.y,"onUpdate:modelValue":t[1]||=t=>e.y=t,label:`Y`,container:e.$viewer.localContext.el},null,8,[`modelValue`,`container`])]),H(`div`,oZe,[U(o,{modelValue:e.scale,"onUpdate:modelValue":t[2]||=t=>e.scale=t,label:e.$t(`viewer2d-background.scale`),step:.01,min:.01,container:e.$viewer.localContext.el},null,8,[`modelValue`,`label`,`container`])])])]),H(`section`,null,[H(`span`,null,F(e.$t(`viewer2d-background.rotation`)),1),H(`div`,sZe,[U(o,{modelValue:e.angle,"onUpdate:modelValue":t[3]||=t=>e.angle=t,unit:`°`,centered:``},null,8,[`modelValue`]),U(s,{modelValue:e.angle,"onUpdate:modelValue":t[4]||=t=>e.angle=t,min:0,max:360},null,8,[`modelValue`])])]),H(`section`,null,[H(`span`,null,F(e.$t(`viewer2d-background.alpha`)),1),H(`div`,cZe,[U(o,{modelValue:e.opacity,"onUpdate:modelValue":t[5]||=t=>e.opacity=t,centered:``},null,8,[`modelValue`]),U(s,{modelValue:e.opacity,"onUpdate:modelValue":t[6]||=t=>e.opacity=t,min:0,max:1,step:.01},null,8,[`modelValue`])])]),H(`section`,null,[H(`span`,null,F(e.$t(`viewer2d-background.preview`)),1),H(`div`,lZe,[H(`img`,{src:r.bitmap.dataUrl,alt:`Background`},null,8,uZe),U(c,{text:r.bitmap.name,class:`viewer2d-background__page__edit__content__img__name`},null,8,[`text`])])])]),H(`div`,dZe,[U(l,{width:`100%`,color:`primary`,fill:``,radius:``,onClick:r.submit},{default:L(()=>[W(F(r.bitmap&&r.bitmap.plan?e.$t(`global.save`):e.$t(`global.validate`)),1)]),_:1},8,[`onClick`])])])}var pZe=q($Xe,[[`render`,fZe],[`__scopeId`,`data-v-a022440a`]]);function OD(e,t){let n=t.anchorSynchronization===!0&&e.windowManager.registeredWindows.has(`anchor-synchronization`);return{anchorSynchronizationWindowAvailable:n,openAnchorSynchronizationWindow:async({model:t,storey:r,modelToSynchronize:i})=>{if(!n)throw Error(`Anchor Synchronization window is not registered`);if(!t||!i)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 ko(),e.globalContext.localContexts[0].plugins.get(`anchor-synchronization-window`).synchronize(t,r,i)}}}var mZe={components:{BIMDataGED:gv},setup(){let e=Xo(`viewer2d`),t=Xo(`root`),n=Xo(`$plugin`),r=e.$viewer,{openAnchorSynchronizationWindow:i,anchorSynchronizationWindowAvailable:a}=OD(r,n),o=I(null);return{root:t,selectedDocument:o,submit:async()=>{try{t.loading=!0;let n=o.value,s=await r.api.createModel(n.id);if(s=await r.api.waitForModelProcess(s),a){let e=r.state.modelsMap.get(s.id);if(e||=(await r.state.loadModels([s.id],{silent:!0}))[0],!e)throw Error(`Plan model not found`);await i({model:t.model,storey:t.selectedStorey,modelToSynchronize:e})}else{let{x:r,y:i}=e.viewer.camera.position,a=(e.viewer.camera.rotation%360+360)%360,o={translate:[r,i],rotate:a,scale:1,opacity:1},c=await e.plugins.bitmaps.createBitmap(n,{plan:s},o);c.plan=null,c.edited=!0,t.editedBitmap=c,t.page=`edit`}}catch(e){console.error(e),t.page=`home`}finally{o.value=null,t.loading=!1}}}}},hZe={class:`viewer2d-background__page__ged`},gZe={class:`viewer2d-background__page__ged__button`};function _Ze(e,t,n,r,i,a){let o=R(`BIMDataGED`),s=R(`BIMDataButton`);return z(),B(`div`,hZe,[U(o,{ref:`ged`,class:`viewer2d-background__page__ged__ged`,"header-buttons":!1,"single-select-mode":``,"selectable-file-types":[`pdf`,`jpeg`,`jpg`,`png`],onSelectionChange:t[0]||=e=>r.selectedDocument=e[0]},null,512),H(`div`,gZe,[U(s,{width:`100%`,height:`32px`,color:`primary`,fill:``,radius:``,disabled:!r.selectedDocument,onClick:r.submit},{default:L(()=>[W(F(e.$t(`global.validate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var vZe=q(mZe,[[`render`,_Ze],[`__scopeId`,`data-v-d1ac46ef`]]),yZe={setup(){let e=Xo(`$viewer`),t=Xo(`$plugin`),n=Xo(`viewer2d`),r=Xo(`root`),{openAnchorSynchronizationWindow:i,anchorSynchronizationWindowAvailable:a}=OD(e,t),o=I(null);return{root:r,menuIndexDisplayed:o,toggleMenu:e=>{o.value=o.value===e?null:e},closeMenu:e=>{o.value===e&&(o.value=null)},onCreateClick:()=>{r.page=`bond`},onEditClick:async t=>{try{if(r.loading=!0,r.selectedStorey!==t.storey&&e.localContext.selectStorey(t.storey),a){let n=e.state.modelsMap.get(t.plan.id);n||=(await e.state.loadModels([t.plan.id],{silent:!0}))[0],i({model:t.model,storey:t.storey,modelToSynchronize:n})}else await n.plugins.bitmaps.showPlan(t),r.editedBitmap=n.plugins.bitmaps.getBitmap(t),r.page=`edit`}catch(e){console.error(e)}finally{r.loading=!1}},onDeleteClick:async t=>{try{r.loading=!0,await e.state.deletePlan(t)}catch(e){console.error(e)}finally{r.loading=!1}}}}},bZe={class:`viewer2d-background__page__home`},xZe={class:`viewer2d-background__page__home__description`},SZe={class:`viewer2d-background__page__home__list`},CZe={class:`viewer2d-background__page__home__list__element__icon`},wZe={class:`viewer2d-background__page__home__list__element__labels`},TZe={key:0,class:`viewer2d-background__page__home__list__element__menu`},EZe={key:0,class:`viewer2d-background__page__home__list__element__menu__menu`};function DZe(e,t,n,r,i,a){let o=R(`BIMDataButton`),s=R(`BIMDataIconSynchro2D`),c=R(`BIMDataTextbox`),l=R(`BIMDataIconEllipsis`),u=Fc(`click-away`);return z(),B(`div`,bZe,[H(`div`,xZe,F(e.$t(`viewer2d-background.description`)),1),U(o,{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:L(()=>[r.root.storeys.length===0?(z(),B(bu,{key:0},[W(F(e.$t(`viewer2d-background.no_ifc`)),1)],64)):r.root.storeys.length>0?(z(),B(bu,{key:1},[W(F(e.$t(`global.new`)),1)],64)):(z(),B(bu,{key:2},[W(F(e.$t(`viewer2d-background.start`)),1)],64))]),_:1},8,[`disabled`,`onClick`]),H(`ul`,SZe,[(z(!0),B(bu,null,Rc(r.root.plans,t=>(z(),B(`li`,{key:`${t.key}`,class:`viewer2d-background__page__home__list__element`},[H(`div`,CZe,[U(s,{size:`m`,fill:``,color:`primary`})]),H(`div`,wZe,[U(c,{class:`viewer2d-background__page__home__list__element__labels__storey`,text:t.storey.name},null,8,[`text`]),U(c,{class:`viewer2d-background__page__home__list__element__labels__plan`,text:t.plan.name},null,8,[`text`])]),e.$viewer.api.permissions.hasModelWritePermission?qo((z(),B(`div`,TZe,[U(o,{color:`granite`,ghost:``,rounded:``,icon:``,onClick:e=>r.toggleMenu(t.key)},{default:L(()=>[U(l,{size:`l`}),r.menuIndexDisplayed===t.key?(z(),B(`div`,EZe,[U(o,{width:`100%`,color:`granite`,ghost:``,square:``,onClick:e=>r.onEditClick(t)},{default:L(()=>[W(F(e.$t(`global.edit`)),1)]),_:1},8,[`onClick`]),U(o,{width:`100%`,color:`granite`,ghost:``,square:``,onClick:e=>r.onDeleteClick(t)},{default:L(()=>[H(`div`,null,F(e.$t(`global.delete`)),1)]),_:1},8,[`onClick`])])):G(``,!0)]),_:2},1032,[`onClick`])])),[[u,()=>r.closeMenu(t.key)]]):G(``,!0)]))),128))])])}var OZe=q(yZe,[[`render`,DZe],[`__scopeId`,`data-v-ee47f509`]]),kZe={setup(){let e=Xo(`$viewer`);return{root:Xo(`root`),selectStorey:t=>{e.localContext.selectStorey(t)}}}},AZe={class:`viewer2d-background__page__bond`},jZe={class:`viewer2d-background__page__bond__list-title`},MZe={class:`viewer2d-background__page__bond__list-title`};function NZe(e,t,n,r,i,a){let o=R(`BIMDataDropdownList`),s=R(`BIMDataButton`);return z(),B(`div`,AZe,[H(`div`,null,[H(`div`,jZe,` 1 - `+F(e.$t(`viewer2d-background.select_storey`)),1),U(o,{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]||=e=>r.selectStorey(e)},{header:L(()=>[W(F(r.root.selectedStorey?r.root.selectedStorey.name:e.$t(`viewer2d-background.select_storey`)),1)]),element:L(({element:e})=>[H(`span`,{class:P({"viewer2d-background__page__bond__storeys--active":r.root.selectedStorey===e})},F(e.name),3)]),_:1},8,[`list`])]),H(`div`,null,[H(`div`,MZe,` 2 - `+F(e.$t(`viewer2d-background.import_file`)),1),U(s,{width:`100%`,color:`primary`,fill:``,radius:``,disabled:!r.root.selectedStorey,onClick:t[1]||=e=>r.root.page=`ged`},{default:L(()=>[W(F(e.$t(`viewer2d-background.from_ged`)),1)]),_:1},8,[`disabled`])])])}var PZe={name:`Background2D`,components:{edit:pZe,ged:vZe,home:OZe,bond:q(kZe,[[`render`,NZe],[`__scopeId`,`data-v-2573d11f`]])},props:{isOpen:{type:Boolean,default:!1}},setup(){let e=Xo(`$viewer`),t=Xo(`$plugin`),n;try{n=e.localContext.pluginComponentInstances.get(`viewer2d`)}catch(e){n={},console.error(e)}if(!n)throw Error(`[Viewer 2D - synchronization] plugin cannot work without viewer2d plugin with 2d engine on.`);n=Fa(n),Yo(`viewer2d`,n);let r=Ea({page:`home`,loading:!1,modalDisplayed:!1,model:{},storeys:[],plans:[],selectedStorey:null,editedBitmap:null});Yo(`root`,r);let i=e.localContext.hub.on(`models-loaded`,({models:[e]})=>{r.model=e,r.storeys=e.storeys,r.plans=e.storeys.flatMap(e=>e.plans)},{getLastEvent:!0}),a=e.localContext.hub.on(`storey-selected`,({storey:e})=>{r.selectedStorey=e,e||(r.page=`home`)},{getLastEvent:!0}),o=e.state.hub.on(`plan-created`,()=>r.plans=r.model.storeys.flatMap(e=>e.plans)),s=e.state.hub.on(`plan-updated`,()=>r.plans=r.model.storeys.flatMap(e=>e.plans)),c=e.state.hub.on(`plan-deleted`,()=>r.plans=r.model.storeys.flatMap(e=>e.plans));Ec(()=>{e.localContext.hub.off(i),e.localContext.hub.off(a),e.localContext.hub.off(o),e.localContext.hub.off(s),e.localContext.hub.off(c)}),rs(()=>r.page,e=>{e!==`edit`&&(r.editedBitmap=null)},{immediate:!0}),rs(()=>r.editedBitmap,(e,t)=>{t?.edit(!1),e?.edit(!0)},{immediate:!0});let l=()=>{r.page=`home`,r.modalDisplayed=!1,t.close()},u=!0;return{viewer2d:n,root:r,onBackClick:()=>{switch(u=!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`):(n.plugins.bitmaps.deleteBitmap(r.editedBitmap),r.page=`ged`);break;default:r.page=`home`}},onCloseClick:()=>{u=!1,r.editedBitmap?.edited?r.modalDisplayed=!0:l()},onLeaveClick:()=>{r.editedBitmap.plan?r.editedBitmap.reset():n.plugins.bitmaps.deleteBitmap(r.editedBitmap),u?r.editedBitmap.plan?r.page=`home`:r.page=`ged`:l(),r.modalDisplayed=!1},onKeyDown:e=>{r.loading||e.key===`Escape`&&(e.preventDefault(),r.page===`home`?l():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)}},FZe={class:`viewer2d-background`},IZe={class:`viewer2d-background__header__back`},LZe={class:`viewer2d-background__header__title__text`},RZe={key:1,class:`viewer2d-background__modal`},zZe={class:`viewer2d-background__modal__content`},BZe={class:`viewer2d-background__modal__content__symbols`},VZe={class:`viewer2d-background__modal__content__buttons`};function HZe(e,t,n,r,i,a){let o=R(`BIMDataLoading`),s=R(`BIMDataIconArrow`),c=R(`BIMDataButton`),l=R(`BIMDataIconSynchro2D`),u=R(`BIMDataIconClose`),d=R(`BIMDataIconWarning`);return z(),B(`div`,FZe,[r.root.loading?(z(),V(o,{key:0})):G(``,!0),H(`div`,{class:P([`viewer2d-background__header`,{"viewer2d-background__header--home":r.root.page===`home`}])},[H(`div`,IZe,[r.root.page===`home`?G(``,!0):(z(),V(c,{key:0,width:`25px`,height:`25px`,color:`primary`,ghost:``,radius:``,icon:``,onClick:r.onBackClick},{default:L(()=>[U(s,{size:`xs`})]),_:1},8,[`onClick`]))]),H(`div`,{class:P([`viewer2d-background__header__title`,{"viewer2d-background__header__title--home":r.root.page===`home`}])},[U(l,{size:r.root.page===`home`?`l`:`xs`,fill:``,color:`primary`},null,8,[`size`]),H(`span`,LZe,F(e.$t(`viewer2d-background.title`)),1)],2),U(c,{class:`viewer2d-background__header__close`,width:`25px`,height:`25px`,ghost:``,radius:``,icon:``,onClick:r.onCloseClick},{default:L(()=>[U(u,{size:`xs`,fill:``,color:`granite-light`})]),_:1},8,[`onClick`])],2),H(`div`,{class:P([`viewer2d-background__page`,{"viewer2d-background__page--home":r.root.page===`home`}])},[(z(),V(dc,null,[(z(),V(Pc(r.root.page)))],1024))],2),r.root.modalDisplayed?(z(),B(`div`,RZe,[H(`div`,zZe,[H(`div`,BZe,[U(d,{fill:``,color:`high`,size:`l`}),H(`div`,null,F(e.$t(`viewer2d-background.warning`)),1)]),H(`div`,VZe,[U(c,{width:`45%`,color:`high`,fill:``,radius:``,onClick:r.onLeaveClick},{default:L(()=>[W(F(e.$t(`viewer2d-background.leave`)),1)]),_:1},8,[`onClick`]),U(c,{width:`45%`,color:`default`,outline:``,radius:``,onClick:t[0]||=e=>r.root.modalDisplayed=!1},{default:L(()=>[W(F(e.$t(`viewer2d-background.stay`)),1)]),_:1})])])])):G(``,!0)])}var kD=q(PZe,[[`render`,HZe],[`__scopeId`,`data-v-1eece107`]]),AD={tooltip:`Hintergrund`,title:`2D-Viewer-Hintergrund`,location:`Position`,scale:`Maßstab`,rotation:`Rotation`,alpha:`Lichtundurchlässigkeit`,preview:`Vorschau`,import:`Ein Element importieren`,from_ged:`Von dem DMS des Projekts`,from_computer:`Von Ihrem Computer`,no_storey:`Um einen Hintergrund hinzuzufügen, wählen Sie bitte eine IFC und eine Etage aus.`,start:`Start`,description:`Überlagern Sie Ihre PDF-Grundrisse, um sie im 2D-Viewer anzuzeigen`,select_storey:`Wählen Sie eine Etage aus`,import_file:`Importieren Sie eine Datei`,no_ifc:`Um einen Hintergrund hinzuzufügen, wählen Sie bitte eine IFC aus.`,warning:`Möchten Sie diese Seite wirklich verlassen? Möglicherweise gibt es unbestätigte Informationen.`,leave:`Ja, diese Seite verlassen`,stay:`Abbrechen, hier bleiben`},UZe=`Background`,WZe=`2D viewer background`,GZe=`Location`,KZe=`Scale`,qZe=`Rotation`,JZe=`Alpha`,YZe=`Preview`,XZe=`From the project GED`,ZZe=`From your computer`,QZe=`To add a background, please select an IFC and a storey.`,$Ze=`Start`,eQe=`Overlay your PDF plans by floor to view them in the 2D viewer`,tQe=`Select a floor`,nQe=`Import a file`,rQe=`To add a background, please select an IFC.`,iQe=`Are you sure you want to leave this page? There may be some unvalidated information.`,aQe=`Yes, leave this page`,oQe=`Cancel, stay here`,jD={tooltip:UZe,"tooltip-anchor-synchronization":`Synchronization`,title:WZe,location:GZe,scale:KZe,rotation:qZe,alpha:JZe,preview:YZe,import:`Import element`,from_ged:XZe,from_computer:ZZe,no_storey:QZe,start:$Ze,description:eQe,select_storey:tQe,import_file:nQe,no_ifc:rQe,warning:iQe,leave:aQe,stay:oQe},MD={tooltip:`Fondo`,title:`Fondo de visor 2D`,location:`Ubicación`,scale:`Escala`,rotation:`Rotación`,alpha:`Alfa`,preview:`Vista previa`,import:`Elemento de importación`,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ñadir un fondo`,warning:`¿Está seguro de que quiere abandonar esta página? Podría haber información sin validar.`,leave:`Sí, salir de esta página`,stay:`Cancelar y permanecer aquí`},sQe=`Synchronisation 2D`,cQe=`Synchronisation 2D`,lQe=`Position`,uQe=`Echelle`,dQe=`Rotation`,fQe=`Opacité`,pQe=`Aperçu`,mQe=`Depuis la GED du projet`,hQe=`Depuis votre ordinateur`,gQe=`Pour ajouter un fond, veuillez selectionner un IFC et un étage.`,_Qe=`Commencer`,vQe=`Superposez vos plans PDF par étages pour les visualisez dans la visionneuse 2D`,yQe=`Sélectionner un étage`,bQe=`Importer un fichier`,xQe=`Pour ajouter un fond, veuillez selectionner un IFC.`,SQe=`Êtes-vous sûr de vouloir quitter cette page ? Il y'a peut-être des informations non validées.`,CQe=`Oui, quitter cette page`,wQe=`Annuler, rester ici`,ND={tooltip:sQe,"tooltip-anchor-synchronization":`Synchronisation`,title:cQe,location:lQe,scale:uQe,rotation:dQe,alpha:fQe,preview:pQe,import:`Importer un élément`,from_ged:mQe,from_computer:hQe,no_storey:gQe,start:_Qe,description:vQe,select_storey:yQe,import_file:bQe,no_ifc:xQe,warning:SQe,leave:CQe,stay:wQe},PD={tooltip:`Sincronizzazione 2D`,title:`Sincronizzazione 2D`,location:`Posizione`,scale:`Scala`,rotation:`Rotazione`,alpha:`Opacità`,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à 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ì, abbandona questa pagina`,stay:`Annulla, resta qui`},TQe={name:`viewer2d-background`,i18n:{de:AD,en:jD,es:MD,fr:ND,it:PD},addToWindows:[`2d`],component:kD,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`}}},FD=`viewer2d-parameters_parameters`,EQe={computed:{viewer2d(){let e=this.$viewer.localContext.pluginComponentInstances.get(`viewer2d`);if(e)return e;{let e=`'Viewer 2D Parameters' plugin cannot work without viewer2d plugin.`;throw console.error(e),Error(e)}},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(FD)||`{}`;e=JSON.parse(t)}catch{localStorage.removeItem(FD)}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(FD,JSON.stringify(e))}}},DQe={class:`viewer2d-parameters`},OQe={class:`viewer2d-parameters_header`},kQe={class:`viewer2d-parameters_content`},AQe={class:`m-b-18`},jQe={class:`m-b-18`},MQe={class:`m-b-18`},NQe={class:`m-b-18`};function PQe(e,t,n,r,i,a){let o=R(`BIMDataIconParameters`),s=R(`BIMDataToggle`);return z(),B(`div`,DQe,[H(`div`,OQe,[U(o,{size:`xs`,margin:`0 12px 0 0`}),H(`span`,null,F(e.$t(`viewer2d-parameters.title`)),1)]),H(`div`,kQe,[H(`div`,AQe,[H(`span`,null,F(e.$t(`viewer2d-parameters.ifc_spaces`)),1),U(s,{modelValue:a.spacesDisplayed,"onUpdate:modelValue":t[0]||=e=>a.spacesDisplayed=e},null,8,[`modelValue`])]),H(`div`,jQe,[H(`span`,null,F(e.$t(`viewer2d-parameters.display_door_openings`)),1),U(s,{modelValue:a.doorsDisplayed,"onUpdate:modelValue":t[1]||=e=>a.doorsDisplayed=e},null,8,[`modelValue`])]),H(`div`,MQe,[H(`span`,null,F(e.$t(`viewer2d-parameters.display_compass`)),1),U(s,{modelValue:a.compassDisplayed,"onUpdate:modelValue":t[2]||=e=>a.compassDisplayed=e},null,8,[`modelValue`])]),H(`div`,NQe,[H(`span`,null,F(e.$t(`viewer2d-parameters.highlight`)),1),U(s,{modelValue:a.highlightOnHover,"onUpdate:modelValue":t[3]||=e=>a.highlightOnHover=e},null,8,[`modelValue`])]),H(`div`,null,[H(`span`,null,F(e.$t(`viewer2d-parameters.camera_sync`)),1),U(s,{modelValue:a.camera3DSynchronization,"onUpdate:modelValue":t[4]||=e=>a.camera3DSynchronization=e},null,8,[`modelValue`])])])])}var FQe={name:`viewer2d-parameters`,i18n:{de:{tooltip:`Einstellungen`,title:`2D-Viewer Einstellungen`,display_door_openings:`Türöffnungen anzeigen`,display_compass:`Kompass anzeigen`,highlight:`Farbliche Markierung`,camera_sync:`Mit 3D-Kamera synchronisieren`,ifc_spaces:`Räume`},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ámetros`,title:`Configuración del visor 2D`,display_door_openings:`Abrir las puertas de la pantalla`,display_compass:`Brújula de visualización`,highlight:`Destacar`,camera_sync:`Sincronización con una cámara 3D`,ifc_spaces:`Espacios`},fr:{tooltip:`Paramètres`,title:`Paramètres du viewer 2D`,display_door_openings:`Afficher l’ouverture de porte`,display_compass:`Afficher la boussole`,highlight:`Surbrillance`,camera_sync:`Synchroniser avec une camera 3D`,ifc_spaces:`Espaces`},it:{tooltip:`Impostazioni`,title:`Impostazioni del visualizzatore 2D`,display_door_openings:`Mostra l'apertura della porta`,display_compass:`Mostra la bussola`,highlight:`Selezione`,camera_sync:`Sincronizza con una fotocamera 3D`,ifc_spaces:`Spazi`}},addToWindows:[`2d`],component:q(EQe,[[`render`,PQe],[`__scopeId`,`data-v-df342105`]]),button:{tooltip:`viewer2d-parameters.tooltip`,stance:-1,position:`right`,content:`simple`,icon:{component:`BIMDataIconParameters`,options:{size:`m`}}}},IQe={name:`viewer2d-screenshot`,i18n:{de:{tooltip:`Bildschirmaufnahme`},en:{tooltip:`Screenshot`},es:{tooltip:`Captura de pantalla`},fr:{tooltip:`Capture d'écran`},it:{tooltip:`Screenshot`}},addToWindows:[`2d`],component:{computed:{viewer2d(){let e=this.$viewer.localContext.pluginComponentInstances.get(`viewer2d`);if(e)return e;{let e=`'Viewer 2D Screenshot' plugin cannot work without viewer2d plugin.`;throw console.error(e),Error(e)}}},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,n={};document.fullscreenElement===e&&(t=!0,n.width=e.style.width,n.height=e.style.height,e.style.width=`100vw`,e.style.height=`100vh`);let r=await(0,_D.default)(this.$viewer.localContext.el);t&&(e.style.width=n.width,e.style.height=n.height);let i=document.createElement(`a`);i.download=this.viewer2d.ifc&&this.viewer2d.ifc.name?String(this.viewer2d.ifc.name).split(`.ifc`)[0]:`2d-capture.png`,i.href=r.toDataURL(),i.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`}}}},ID=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}},LD=new ID,LQe=class{constructor(e){this.id=e,this.parentItem=null,this.groups=[],this.menuElement=null,this.shown=!1,this.mouseOver=0}},RQe=class{constructor(){this.items=[]}},zQe=class{constructor(e,t,n,r,i){this.id=e,this.getTitle=t,this.doAction=n,this.getEnabled=r,this.getShown=i,this.itemElement=null,this.subMenu=null,this.enabled=!0}},BQe=class{constructor(e={}){this._id=LD.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`,e=>{e.target.classList.contains(`xeokit-context-menu-item`)||this.hide()}),this._parentNode.addEventListener(`touchstart`,this._canvasTouchStartHandler=e=>{e.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 n=this._eventSubs[e];n||(n=[],this._eventSubs[e]=n),n.push(t)}fire(e,t){let n=this._eventSubs[e];if(n)for(let e=0,r=n.length;e<r;e++)n[e](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&&(LD.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=e=>{let n=new LQe(this._getNextId());for(let r=0,i=e.length;r<i;r++){let i=e[r],a=new RQe;n.groups.push(a);for(let e=0,r=i.length;e<r;e++){let r=i[e],o=r.items,s=o&&o.length>0,c=new zQe(this._getNextId(),r.getTitle||(()=>r.title||``),r.doAction||r.callback||(()=>{}),r.getEnabled||(()=>!0),r.getShown||(()=>!0));if(c.parentMenu=n,a.items.push(c),s){let e=t(o);c.subMenu=e,e.parentItem=c}this._itemList.push(c),this._itemMap[c.id]=c}}return this._menuList.push(n),this._menuMap[n.id]=n,n};this._rootMenu=t(e)}_getNextId(){return`ContextMenu_`+this._id+`_`+ this._nextId++}_createUI(){let e=t=>{this._createMenuUI(t);let n=t.groups;for(let t=0,r=n.length;t<r;t++){let r=n[t].items;for(let t=0,n=r.length;t<n;t++){let n=r[t].subMenu;n&&e(n)}}};e(this._rootMenu)}_createMenuUI(e){let t=e.groups,n=[],r=document.createElement(`div`);if(r.classList.add(`xeokit-context-menu`,e.id),r.style.zIndex=3e5,r.style.position=`absolute`,n.push(`<ul>`),t)for(let e=0,r=t.length;e<r;e++){let i=t[e],a=e,o=r,s=i.items;if(s)for(let e=0,t=s.length;e<t;e++){let r=s[e],i=r.subMenu,c=r.title||``;i?(n.push(`<li id="`+r.id+`" class="xeokit-context-menu-item xeokit-context-menu-submenu">`+c+`</li>`),a===o-1||e<t-1||n.push(`<li id="`+r.id+`" class="xeokit-context-menu-item-separator"></li>`)):(n.push(`<li id="`+r.id+`" class="xeokit-context-menu-item">`+c+`</li>`),a===o-1||e<t-1||n.push(`<li id="`+r.id+`" class="xeokit-context-menu-item-separator"></li>`))}}n.push(`</ul>`),r.innerHTML=n.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=e=>{e.preventDefault()};let i=this,a=null;if(t)for(let e=0,n=t.length;e<n;e++){let n=t[e].items;if(n)for(let e=0,t=n.length;e<t;e++){let t=n[e],r=t.subMenu;if(t.itemElement=this._parentNode.querySelector(`#${t.id}`),!t.itemElement){console.error(`ContextMenu item element not found: `+t.id);continue}t.itemElement.addEventListener(`mouseenter`,e=>{e.preventDefault();let n=t.subMenu;if(!n){a&&=(i._hideMenu(a.id),null);return}if(a&&a.id!==n.id&&(i._hideMenu(a.id),a=null),t.enabled===!1)return;let r=t.itemElement,o=n.menuElement,s=r.getBoundingClientRect();o.getBoundingClientRect();let c=i._offsetParent.getBoundingClientRect(),l=s.right+200<c.right,u=s.left-200>c.left;if(l)i._showMenu(n.id,s.right+window.scrollX-5,s.top+window.scrollY-1);else if(u)i._showMenu(n.id,s.left-200+window.scrollX,s.top+window.scrollY-1);else{let e=s.left-c.left,t=c.right-s.right;t>e?i._showMenu(n.id,s.right-5-(200-t),s.top+window.scrollY-1):i._showMenu(n.id,s.left-e,s.top+window.scrollY-1)}a=n}),r||(t.itemElement.addEventListener(`click`,e=>{e.preventDefault(),i._context&&t.enabled!==!1&&(t.doAction&&t.doAction(i._context),this._hideOnAction?i.hide():(i._updateItemsTitles(),i._updateItemsEnabledStatus()))}),t.itemElement.addEventListener(`mouseup`,e=>{e.which===3&&(e.preventDefault(),i._context&&t.enabled!==!1&&(t.doAction&&t.doAction(i._context),this._hideOnAction?i.hide():(i._updateItemsTitles(),i._updateItemsEnabledStatus())))}),t.itemElement.addEventListener(`mouseenter`,e=>{e.preventDefault(),t.enabled!==!1&&t.doHover&&t.doHover(i._context)}))}}}_updateItemsTitles(){if(this._context)for(let e=0,t=this._itemList.length;e<t;e++){let t=this._itemList[e],n=t.itemElement;if(!n)continue;let r=t.getShown;if(!r||!r(this._context))continue;let i=t.getTitle(this._context);t.subMenu,n.innerText=i}}_updateItemsEnabledStatus(){if(this._context)for(let e=0,t=this._itemList.length;e<t;e++){let t=this._itemList[e],n=t.itemElement;if(!n)continue;let r=t.getEnabled;if(!r)continue;let i=t.getShown;if(!i)continue;let a=i(this._context);if(t.shown=a,a)n.style.display=``;else{n.style.display=`none`;continue}let o=r(this._context);t.enabled=o,o?n.classList.remove(`disabled`):n.classList.add(`disabled`)}}_updateSubMenuInfo(){if(!this._context)return;let e,t,n,r,i,a;this._itemList.forEach(o=>{o.subMenu&&(e=o.itemElement,t=e.getBoundingClientRect(),n=o.subMenu.menuElement,r={visibility:n.style.visibility,display:n.style.display},n.style.display=`block`,n.style.visibility=`hidden`,a=o.subMenu.menuElement.getBoundingClientRect().width,n.style.visibility=r.visibility,n.style.display=r.display,i=t.right+a>window.innerWidth,e.setAttribute(`data-submenuposition`,i?`left`:`right`))})}_showMenu(e,t,n){let r=this._menuMap[e];if(!r){console.error(`Menu not found: `+e);return}if(r.shown)return;let i=r.menuElement;i&&(this._showMenuElement(i,t,n),r.shown=!0)}_hideMenu(e){let t=this._menuMap[e];if(!t){console.error(`Menu not found: `+e);return}if(!t.shown)return;let n=t.menuElement;n&&(this._hideMenuElement(n),t.shown=!1)}_hideAllMenus(){for(let e=0,t=this._menuList.length;e<t;e++){let t=this._menuList[e];this._hideMenu(t.id)}}_showMenuElement(e,t,n){e.style.display=`block`;let r=e.offsetHeight,i=e.offsetWidth,a=this._offsetParent.getBoundingClientRect(),o=this._offsetParent===window.document.body&&a.bottom===0?window.innerHeight:a.bottom+window.scrollY,s=a.right+window.scrollX;n+r>o&&(n=o-r),t+i>s&&(t=s-i),e.style.left=t-a.left-window.scrollX+`px`,e.style.top=n-a.top-window.scrollY+`px`}_hideMenuElement(e){e.style.display=`none`}},VQe=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(),n=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`,n&&(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 i=this._lensParams.canvasSize/2-this._lensParams.cursorSize/2-this._lensParams.cursorBorder,a=this._snappedCanvasPos?this._snappedCanvasPos[0]-this._canvasPos[0]:0,o=this._snappedCanvasPos?this._snappedCanvasPos[1]-this._canvasPos[1]:0;this._lensCursorDiv.style.left=`${i+a*this._zoomLevel}px`,this._lensCursorDiv.style.top=`${i+o*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,n]=e?[`greenyellow`,`green`]:[`pink`,`red`];this._lensCursorDiv.style.background=t,this._lensCursorDiv.style.border=this._lensParams.cursorBorder+`px solid `+n}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)}},RD=!0,zD=RD?Float64Array:Float32Array,BD=new zD(3),VD=new zD(16),HD=new zD(16),HQe=new zD(4),Y={setDoublePrecisionEnabled(e){RD=e,zD=RD?Float64Array:Float32Array},getDoublePrecisionEnabled(){return RD},MIN_DOUBLE:-(2**53-1),MAX_DOUBLE:2**53-1,MAX_INT:1e7,DEGTORAD:.0174532925,RADTODEG:57.295779513,unglobalizeObjectId(e,t){let n=t.indexOf(`#`);return n===e.length&&t.startsWith(e)?t.substring(n+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 zD(e||2)},vec3(e){return new zD(e||3)},vec4(e){return new zD(e||4)},mat3(e){return new zD(e||9)},mat3ToMat4(e,t=new zD(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 zD(e||16)},mat4ToMat3(e,t=new zD(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,n){let r=new zD(2);for(let i=0,a=e.length;i<a;i++)Y.splitDouble(e[i],r),t[i]=r[0],n[i]=r[1]},splitDouble(e,t){let n=zD.from([e])[0],r=e-n;t[0]=n,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,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return`${e[t&255]+e[t>>8&255]+e[t>>16&255]+e[t>>24&255]}-${e[n&255]}${e[n>>8&255]}-${e[n>>16&15|64]}${e[n>>24&255]}-${e[r&63|128]}${e[r>>8&255]}-${e[r>>16&255]}${e[r>>24&255]}${e[i&255]}${e[i>>8&255]}${e[i>>16&255]}${e[i>>24&255]}`}})(),clamp(e,t,n){return Math.max(t,Math.min(n,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,n){return n||=e,n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n},addVec4Scalar(e,t,n){return n||=e,n[0]=e[0]+t,n[1]=e[1]+t,n[2]=e[2]+t,n[3]=e[3]+t,n},addVec3(e,t,n){return n||=e,n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n},addVec3Scalar(e,t,n){return n||=e,n[0]=e[0]+t,n[1]=e[1]+t,n[2]=e[2]+t,n},subVec4(e,t,n){return n||=e,n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n},subVec3(e,t,n){return n||=e,n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n},subVec2(e,t,n){return n||=e,n[0]=e[0]-t[0],n[1]=e[1]-t[1],n},geometricMeanVec2(...e){let t=new zD(e[0]);for(let n=1;n<e.length;n++)t[0]+=e[n][0],t[1]+=e[n][1];return t[0]/=e.length,t[1]/=e.length,t},subVec4Scalar(e,t,n){return n||=e,n[0]=e[0]-t,n[1]=e[1]-t,n[2]=e[2]-t,n[3]=e[3]-t,n},subScalarVec4(e,t,n){return n||=e,n[0]=t-e[0],n[1]=t-e[1],n[2]=t-e[2],n[3]=t-e[3],n},mulVec4(e,t,n){return n||=e,n[0]=e[0]*t[0],n[1]=e[1]*t[1],n[2]=e[2]*t[2],n[3]=e[3]*t[3],n},mulVec4Scalar(e,t,n){return n||=e,n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n},mulVec3Scalar(e,t,n){return n||=e,n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n},mulVec2Scalar(e,t,n){return n||=e,n[0]=e[0]*t,n[1]=e[1]*t,n},divVec3(e,t,n){return n||=e,n[0]=e[0]/t[0],n[1]=e[1]/t[1],n[2]=e[2]/t[2],n},divVec4(e,t,n){return n||=e,n[0]=e[0]/t[0],n[1]=e[1]/t[1],n[2]=e[2]/t[2],n[3]=e[3]/t[3],n},divScalarVec3(e,t,n){return n||=t,n[0]=e/t[0],n[1]=e/t[1],n[2]=e/t[2],n},divVec3Scalar(e,t,n){return n||=e,n[0]=e[0]/t,n[1]=e[1]/t,n[2]=e[2]/t,n},divVec4Scalar(e,t,n){return n||=e,n[0]=e[0]/t,n[1]=e[1]/t,n[2]=e[2]/t,n[3]=e[3]/t,n},divScalarVec4(e,t,n){return n||=t,n[0]=e/t[0],n[1]=e/t[1],n[2]=e/t[2],n[3]=e/t[3],n},dotVec4(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},cross3Vec4(e,t){let n=e[0],r=e[1],i=e[2],a=t[0],o=t[1],s=t[2];return[r*s-i*o,i*a-n*s,n*o-r*a,0]},cross3Vec3(e,t,n){n||=e;let r=e[0],i=e[1],a=e[2],o=t[0],s=t[1],c=t[2];return n[0]=i*c-a*s,n[1]=a*o-r*c,n[2]=r*s-i*o,n},sqLenVec4(e){return Y.dotVec4(e,e)},lenVec4(e){return Math.sqrt(Y.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 Y.dotVec3(e,e)},sqLenVec2(e){return Y.dotVec2(e,e)},lenVec3(e){return Math.sqrt(Y.sqLenVec3(e))},distVec3:(()=>{let e=new zD(3);return(t,n)=>Y.lenVec3(Y.subVec3(t,n,e))})(),lenVec2(e){return Math.sqrt(Y.sqLenVec2(e))},distVec2:(()=>{let e=new zD(2);return(t,n)=>Y.lenVec2(Y.subVec2(t,n,e))})(),rcpVec3(e,t){return Y.divScalarVec3(1,e,t)},normalizeVec4(e,t){let n=1/Y.lenVec4(e);return Y.mulVec4Scalar(e,n,t)},normalizeVec3(e,t){let n=1/Y.lenVec3(e);return Y.mulVec3Scalar(e,n,t)},normalizeVec2(e,t){let n=1/Y.lenVec2(e);return Y.mulVec2Scalar(e,n,t)},angleVec3(e,t){let n=Y.dotVec3(e,t)/Math.sqrt(Y.sqLenVec3(e)*Y.sqLenVec3(t));return n=n<-1?-1:n>1?1:n,Math.acos(n)},vec3FromMat4Scale:(()=>{let e=new zD(3);return(t,n)=>(e[0]=t[0],e[1]=t[1],e[2]=t[2],n[0]=Y.lenVec3(e),e[0]=t[4],e[1]=t[5],e[2]=t[6],n[1]=Y.lenVec3(e),e[0]=t[8],e[1]=t[9],e[2]=t[10],n[2]=Y.lenVec3(e),n)})(),vecToArray:(()=>{function e(e){return Math.round(e*1e5)/1e5}return t=>{t=Array.prototype.slice.call(t);for(let n=0,r=t.length;n<r;n++)t[n]=e(t[n]);return t}})(),xyzArrayToObject(e){return{x:e[0],y:e[1],z:e[2]}},xyzObjectToArray(e,t){return t||=Y.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 Y.m4s(0)},setMat4ToOnes(){return Y.m4s(1)},diagonalMat4v(e){return new zD([e[0],0,0,0,0,e[1],0,0,0,0,e[2],0,0,0,0,e[3]])},diagonalMat4c(e,t,n,r){return Y.diagonalMat4v([e,t,n,r])},diagonalMat4s(e){return Y.diagonalMat4c(e,e,e,e)},identityMat4(e=new zD(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 zD(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,n){return n||=e,n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},addMat4Scalar(e,t,n){return n||=e,n[0]=e[0]+t,n[1]=e[1]+t,n[2]=e[2]+t,n[3]=e[3]+t,n[4]=e[4]+t,n[5]=e[5]+t,n[6]=e[6]+t,n[7]=e[7]+t,n[8]=e[8]+t,n[9]=e[9]+t,n[10]=e[10]+t,n[11]=e[11]+t,n[12]=e[12]+t,n[13]=e[13]+t,n[14]=e[14]+t,n[15]=e[15]+t,n},addScalarMat4(e,t,n){return Y.addMat4Scalar(t,e,n)},subMat4(e,t,n){return n||=e,n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},subMat4Scalar(e,t,n){return n||=e,n[0]=e[0]-t,n[1]=e[1]-t,n[2]=e[2]-t,n[3]=e[3]-t,n[4]=e[4]-t,n[5]=e[5]-t,n[6]=e[6]-t,n[7]=e[7]-t,n[8]=e[8]-t,n[9]=e[9]-t,n[10]=e[10]-t,n[11]=e[11]-t,n[12]=e[12]-t,n[13]=e[13]-t,n[14]=e[14]-t,n[15]=e[15]-t,n},subScalarMat4(e,t,n){return n||=t,n[0]=e-t[0],n[1]=e-t[1],n[2]=e-t[2],n[3]=e-t[3],n[4]=e-t[4],n[5]=e-t[5],n[6]=e-t[6],n[7]=e-t[7],n[8]=e-t[8],n[9]=e-t[9],n[10]=e-t[10],n[11]=e-t[11],n[12]=e-t[12],n[13]=e-t[13],n[14]=e-t[14],n[15]=e-t[15],n},mulMat4(e,t,n){n||=e;let r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],l=e[6],u=e[7],d=e[8],f=e[9],p=e[10],m=e[11],h=e[12],g=e[13],_=e[14],v=e[15],y=t[0],b=t[1],x=t[2],S=t[3],C=t[4],w=t[5],T=t[6],E=t[7],D=t[8],O=t[9],k=t[10],A=t[11],ee=t[12],j=t[13],te=t[14],ne=t[15];return n[0]=y*r+b*s+x*d+S*h,n[1]=y*i+b*c+x*f+S*g,n[2]=y*a+b*l+x*p+S*_,n[3]=y*o+b*u+x*m+S*v,n[4]=C*r+w*s+T*d+E*h,n[5]=C*i+w*c+T*f+E*g,n[6]=C*a+w*l+T*p+E*_,n[7]=C*o+w*u+T*m+E*v,n[8]=D*r+O*s+k*d+A*h,n[9]=D*i+O*c+k*f+A*g,n[10]=D*a+O*l+k*p+A*_,n[11]=D*o+O*u+k*m+A*v,n[12]=ee*r+j*s+te*d+ne*h,n[13]=ee*i+j*c+te*f+ne*g,n[14]=ee*a+j*l+te*p+ne*_,n[15]=ee*o+j*u+te*m+ne*v,n},mulMat3(e,t,n){n||=new zD(9);let r=e[0],i=e[3],a=e[6],o=e[1],s=e[4],c=e[7],l=e[2],u=e[5],d=e[8],f=t[0],p=t[3],m=t[6],h=t[1],g=t[4],_=t[7],v=t[2],y=t[5],b=t[8];return n[0]=r*f+i*h+a*v,n[3]=r*p+i*g+a*y,n[6]=r*m+i*_+a*b,n[1]=o*f+s*h+c*v,n[4]=o*p+s*g+c*y,n[7]=o*m+s*_+c*b,n[2]=l*f+u*h+d*v,n[5]=l*p+u*g+d*y,n[8]=l*m+u*_+d*b,n},mulMat4Scalar(e,t,n){return n||=e,n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},mulMat4v4(e,t,n=Y.vec4()){let r=t[0],i=t[1],a=t[2],o=t[3];return n[0]=e[0]*r+e[4]*i+e[8]*a+e[12]*o,n[1]=e[1]*r+e[5]*i+e[9]*a+e[13]*o,n[2]=e[2]*r+e[6]*i+e[10]*a+e[14]*o,n[3]=e[3]*r+e[7]*i+e[11]*a+e[15]*o,n},transposeMat4(e,t){let n=e[4],r=e[14],i=e[8],a=e[13],o=e[12],s=e[9];if(!t||e===t){let t=e[1],c=e[2],l=e[3],u=e[6],d=e[7],f=e[11];return e[1]=n,e[2]=i,e[3]=o,e[4]=t,e[6]=s,e[7]=a,e[8]=c,e[9]=u,e[11]=r,e[12]=l,e[13]=d,e[14]=f,e}return t[0]=e[0],t[1]=n,t[2]=i,t[3]=o,t[4]=e[1],t[5]=e[5],t[6]=s,t[7]=a,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 n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}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],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15];return p*u*s*i-l*m*s*i-p*o*d*i+a*m*d*i+l*o*h*i-a*u*h*i-p*u*r*c+l*m*r*c+p*n*d*c-t*m*d*c-l*n*h*c+t*u*h*c+p*o*r*f-a*m*r*f-p*n*s*f+t*m*s*f+a*n*h*f-t*o*h*f-l*o*r*g+a*u*r*g+l*n*s*g-t*u*s*g-a*n*d*g+t*o*d*g},inverseMat4(e,t){t||=e;let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],d=e[9],f=e[10],p=e[11],m=e[12],h=e[13],g=e[14],_=e[15],v=n*s-r*o,y=n*c-i*o,b=n*l-a*o,x=r*c-i*s,S=r*l-a*s,C=i*l-a*c,w=u*h-d*m,T=u*g-f*m,E=u*_-p*m,D=d*g-f*h,O=d*_-p*h,k=f*_-p*g,A=1/(v*k-y*O+b*D+x*E-S*T+C*w);return t[0]=(s*k-c*O+l*D)*A,t[1]=(-r*k+i*O-a*D)*A,t[2]=(h*C-g*S+_*x)*A,t[3]=(-d*C+f*S-p*x)*A,t[4]=(-o*k+c*E-l*T)*A,t[5]=(n*k-i*E+a*T)*A,t[6]=(-m*C+g*b-_*y)*A,t[7]=(u*C-f*b+p*y)*A,t[8]=(o*O-s*E+l*w)*A,t[9]=(-n*O+r*E-a*w)*A,t[10]=(m*S-h*b+_*v)*A,t[11]=(-u*S+d*b-p*v)*A,t[12]=(-o*D+s*T-c*w)*A,t[13]=(n*D-r*T+i*w)*A,t[14]=(-m*x+h*y-g*v)*A,t[15]=(u*x-d*y+f*v)*A,t},traceMat4(e){return e[0]+e[5]+e[10]+e[15]},translationMat4v(e,t){let n=t||Y.identityMat4();return n[12]=e[0],n[13]=e[1],n[14]=e[2],n},translationMat3v(e,t){let n=t||Y.identityMat3();return n[6]=e[0],n[7]=e[1],n},translationMat4c:(()=>{let e=new zD(3);return(t,n,r,i)=>(e[0]=t,e[1]=n,e[2]=r,Y.translationMat4v(e,i))})(),translationMat4s(e,t){return Y.translationMat4c(e,e,e,t)},translateMat4v(e,t){return Y.translateMat4c(e[0],e[1],e[2],t)},translateMat4c(e,t,n,r){let i=r[3];r[0]+=i*e,r[1]+=i*t,r[2]+=i*n;let a=r[7];r[4]+=a*e,r[5]+=a*t,r[6]+=a*n;let o=r[11];r[8]+=o*e,r[9]+=o*t,r[10]+=o*n;let s=r[15];return r[12]+=s*e,r[13]+=s*t,r[14]+=s*n,r},setMat4Translation(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t[0],n[13]=t[1],n[14]=t[2],n[15]=e[15],n},rotationMat4v(e,t,n){let r=Y.normalizeVec4([t[0],t[1],t[2],0],[]),i=Math.sin(e),a=Math.cos(e),o=1-a,s=r[0],c=r[1],l=r[2],u,d,f,p,m,h;return u=s*c,d=c*l,f=l*s,p=s*i,m=c*i,h=l*i,n||=Y.mat4(),n[0]=o*s*s+a,n[1]=o*u+h,n[2]=o*f-m,n[3]=0,n[4]=o*u-h,n[5]=o*c*c+a,n[6]=o*d+p,n[7]=0,n[8]=o*f+m,n[9]=o*d-p,n[10]=o*l*l+a,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n},rotationMat4c(e,t,n,r,i){return Y.rotationMat4v(e,[t,n,r],i)},scalingMat4v(e,t=Y.identityMat4()){return t[0]=e[0],t[5]=e[1],t[10]=e[2],t},scalingMat3v(e,t=Y.identityMat3()){return t[0]=e[0],t[4]=e[1],t},scalingMat4c:(()=>{let e=new zD(3);return(t,n,r,i)=>(e[0]=t,e[1]=n,e[2]=r,Y.scalingMat4v(e,i))})(),scaleMat4c(e,t,n,r){return r[0]*=e,r[4]*=t,r[8]*=n,r[1]*=e,r[5]*=t,r[9]*=n,r[2]*=e,r[6]*=t,r[10]*=n,r[3]*=e,r[7]*=t,r[11]*=n,r},scaleMat4v(e,t){let n=e[0],r=e[1],i=e[2];return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,t},scalingMat4s(e){return Y.scalingMat4c(e,e,e)},rotationTranslationMat4(e,t,n=Y.mat4()){let r=e[0],i=e[1],a=e[2],o=e[3],s=r+r,c=i+i,l=a+a,u=r*s,d=r*c,f=r*l,p=i*c,m=i*l,h=a*l,g=o*s,_=o*c,v=o*l;return n[0]=1-(p+h),n[1]=d+v,n[2]=f-_,n[3]=0,n[4]=d-v,n[5]=1-(u+h),n[6]=m+g,n[7]=0,n[8]=f+_,n[9]=m-g,n[10]=1-(u+p),n[11]=0,n[12]=t[0],n[13]=t[1],n[14]=t[2],n[15]=1,n},mat4ToEuler(e,t,n=Y.vec4()){let r=Y.clamp,i=e[0],a=e[4],o=e[8],s=e[1],c=e[5],l=e[9],u=e[2],d=e[6],f=e[10];return t===`XYZ`?(n[1]=Math.asin(r(o,-1,1)),Math.abs(o)<.99999?(n[0]=Math.atan2(-l,f),n[2]=Math.atan2(-a,i)):(n[0]=Math.atan2(d,c),n[2]=0)):t===`YXZ`?(n[0]=Math.asin(-r(l,-1,1)),Math.abs(l)<.99999?(n[1]=Math.atan2(o,f),n[2]=Math.atan2(s,c)):(n[1]=Math.atan2(-u,i),n[2]=0)):t===`ZXY`?(n[0]=Math.asin(r(d,-1,1)),Math.abs(d)<.99999?(n[1]=Math.atan2(-u,f),n[2]=Math.atan2(-a,c)):(n[1]=0,n[2]=Math.atan2(s,i))):t===`ZYX`?(n[1]=Math.asin(-r(u,-1,1)),Math.abs(u)<.99999?(n[0]=Math.atan2(d,f),n[2]=Math.atan2(s,i)):(n[0]=0,n[2]=Math.atan2(-a,c))):t===`YZX`?(n[2]=Math.asin(r(s,-1,1)),Math.abs(s)<.99999?(n[0]=Math.atan2(-l,c),n[1]=Math.atan2(-u,i)):(n[0]=0,n[1]=Math.atan2(o,f))):t===`XZY`&&(n[2]=Math.asin(-r(a,-1,1)),Math.abs(a)<.99999?(n[0]=Math.atan2(d,c),n[1]=Math.atan2(o,i)):(n[0]=Math.atan2(-l,f),n[1]=0)),n[0]*=Y.RADTODEG,n[1]*=Y.RADTODEG,n[2]*=Y.RADTODEG,n},composeMat4(e,t,n,r=Y.mat4()){return Y.quaternionToRotationMat4(t,r),Y.scaleMat4v(n,r),Y.translateMat4v(e,r),r},decomposeMat4:(()=>{let e=new zD(3),t=new zD(16);return function(n,r,i,a){e[0]=n[0],e[1]=n[1],e[2]=n[2];let o=Y.lenVec3(e);e[0]=n[4],e[1]=n[5],e[2]=n[6];let s=Y.lenVec3(e);e[8]=n[8],e[9]=n[9],e[10]=n[10];let c=Y.lenVec3(e);Y.determinantMat4(n)<0&&(o=-o),r[0]=n[12],r[1]=n[13],r[2]=n[14],t.set(n);let l=1/o,u=1/s,d=1/c;return t[0]*=l,t[1]*=l,t[2]*=l,t[4]*=u,t[5]*=u,t[6]*=u,t[8]*=d,t[9]*=d,t[10]*=d,Y.mat4ToQuaternion(t,i),a[0]=o,a[1]=s,a[2]=c,this}})(),getColMat4(e,t){let n=t*4;return[e[n],e[n+1],e[n+2],e[n+3]]},setRowMat4(e,t,n){e[t]=n[0],e[t+4]=n[1],e[t+8]=n[2],e[t+12]=n[3]},lookAtMat4v(e,t,n,r){r||=Y.mat4();let i=e[0],a=e[1],o=e[2],s=n[0],c=n[1],l=n[2],u=t[0],d=t[1],f=t[2];if(i===u&&a===d&&o===f)return Y.identityMat4();let p,m,h,g,_,v,y,b,x,S;return p=i-u,m=a-d,h=o-f,S=1/Math.sqrt(p*p+m*m+h*h),p*=S,m*=S,h*=S,g=c*h-l*m,_=l*p-s*h,v=s*m-c*p,S=Math.sqrt(g*g+_*_+v*v),S?(S=1/S,g*=S,_*=S,v*=S):(g=0,_=0,v=0),y=m*v-h*_,b=h*g-p*v,x=p*_-m*g,S=Math.sqrt(y*y+b*b+x*x),S?(S=1/S,y*=S,b*=S,x*=S):(y=0,b=0,x=0),r[0]=g,r[1]=y,r[2]=p,r[3]=0,r[4]=_,r[5]=b,r[6]=m,r[7]=0,r[8]=v,r[9]=x,r[10]=h,r[11]=0,r[12]=-(g*i+_*a+v*o),r[13]=-(y*i+b*a+x*o),r[14]=-(p*i+m*a+h*o),r[15]=1,r},lookAtMat4c(e,t,n,r,i,a,o,s,c){return Y.lookAtMat4v([e,t,n],[r,i,a],[o,s,c],[])},orthoMat4c(e,t,n,r,i,a,o){o||=Y.mat4();let s=t-e,c=r-n,l=a-i;return o[0]=2/s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2/c,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=-2/l,o[11]=0,o[12]=-(e+t)/s,o[13]=-(r+n)/c,o[14]=-(a+i)/l,o[15]=1,o},frustumMat4v(e,t,n){n||=Y.mat4();let r=[e[0],e[1],e[2],0],i=[t[0],t[1],t[2],0];Y.addVec4(i,r,VD),Y.subVec4(i,r,HD);let a=2*r[2],o=HD[0],s=HD[1],c=HD[2];return n[0]=a/o,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a/s,n[6]=0,n[7]=0,n[8]=VD[0]/o,n[9]=VD[1]/s,n[10]=-VD[2]/c,n[11]=-1,n[12]=0,n[13]=0,n[14]=-a*i[2]/c,n[15]=0,n},frustumMat4(e,t,n,r,i,a,o){o||=Y.mat4();let s=t-e,c=r-n,l=a-i;return o[0]=i*2/s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=i*2/c,o[6]=0,o[7]=0,o[8]=(t+e)/s,o[9]=(r+n)/c,o[10]=-(a+i)/l,o[11]=-1,o[12]=0,o[13]=0,o[14]=-(a*i*2)/l,o[15]=0,o},perspectiveMat4(e,t,n,r,i){let a=[],o=[];return a[2]=n,o[2]=r,o[1]=a[2]*Math.tan(e/2),a[1]=-o[1],o[0]=o[1]*t,a[0]=-o[0],Y.frustumMat4v(a,o,i)},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,n=Y.vec3()){let r=t[0],i=t[1],a=t[2];return n[0]=e[0]*r+e[4]*i+e[8]*a+e[12],n[1]=e[1]*r+e[5]*i+e[9]*a+e[13],n[2]=e[2]*r+e[6]*i+e[10]*a+e[14],n},transformPoint4(e,t,n=Y.vec4()){return n[0]=e[0]*t[0]+e[4]*t[1]+e[8]*t[2]+e[12]*t[3],n[1]=e[1]*t[0]+e[5]*t[1]+e[9]*t[2]+e[13]*t[3],n[2]=e[2]*t[0]+e[6]*t[1]+e[10]*t[2]+e[14]*t[3],n[3]=e[3]*t[0]+e[7]*t[1]+e[11]*t[2]+e[15]*t[3],n},transformPoints3(e,t,n){let r=n||[],i=t.length,a,o,s,c,l=e[0],u=e[1],d=e[2],f=e[3],p=e[4],m=e[5],h=e[6],g=e[7],_=e[8],v=e[9],y=e[10],b=e[11],x=e[12],S=e[13],C=e[14],w=e[15],T;for(let e=0;e<i;++e)c=t[e],a=c[0],o=c[1],s=c[2],T=r[e]||(r[e]=[0,0,0]),T[0]=l*a+p*o+_*s+x,T[1]=u*a+m*o+v*s+S,T[2]=d*a+h*o+y*s+C,T[3]=f*a+g*o+b*s+w;return r.length=i,r},transformPositions3(e,t,n=t){let r,i=t.length,a,o,s,c=e[0],l=e[1],u=e[2];e[3];let d=e[4],f=e[5],p=e[6];e[7];let m=e[8],h=e[9],g=e[10];e[11];let _=e[12],v=e[13],y=e[14];for(e[15],r=0;r<i;r+=3)a=t[r+0],o=t[r+1],s=t[r+2],n[r+0]=c*a+d*o+m*s+_,n[r+1]=l*a+f*o+h*s+v,n[r+2]=u*a+p*o+g*s+y;return n},transformPositions4(e,t,n=t){let r,i=t.length,a,o,s,c=e[0],l=e[1],u=e[2],d=e[3],f=e[4],p=e[5],m=e[6],h=e[7],g=e[8],_=e[9],v=e[10],y=e[11],b=e[12],x=e[13],S=e[14],C=e[15];for(r=0;r<i;r+=4)a=t[r+0],o=t[r+1],s=t[r+2],n[r+0]=c*a+f*o+g*s+b,n[r+1]=l*a+p*o+_*s+x,n[r+2]=u*a+m*o+v*s+S,n[r+3]=d*a+h*o+y*s+C;return n},transformVec3(e,t,n){let r=t[0],i=t[1],a=t[2];return n||=this.vec3(),n[0]=e[0]*r+e[4]*i+e[8]*a,n[1]=e[1]*r+e[5]*i+e[9]*a,n[2]=e[2]*r+e[6]*i+e[10]*a,n},transformVec4(e,t,n){let r=t[0],i=t[1],a=t[2],o=t[3];return n||=Y.vec4(),n[0]=e[0]*r+e[4]*i+e[8]*a+e[12]*o,n[1]=e[1]*r+e[5]*i+e[9]*a+e[13]*o,n[2]=e[2]*r+e[6]*i+e[10]*a+e[14]*o,n[3]=e[3]*r+e[7]*i+e[11]*a+e[15]*o,n},rotateVec2(e,t,n,r=e){let i=Math.cos(n),a=Math.sin(n),o=e[0]-t[0],s=e[1]-t[1];return r[0]=o*i-s*a+t[0],r[1]=o*a+s*i+t[1],e},rotateVec3X(e,t,n,r){let i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),r[0]=a[0]+t[0],r[1]=a[1]+t[1],r[2]=a[2]+t[2],r},rotateVec3Y(e,t,n,r){let i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),r[0]=a[0]+t[0],r[1]=a[1]+t[1],r[2]=a[2]+t[2],r},rotateVec3Z(e,t,n,r){let i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],r[0]=a[0]+t[0],r[1]=a[1]+t[1],r[2]=a[2]+t[2],r},projectVec4(e,t){let n=1/e[3];return t||=Y.vec2(),t[0]=e[0]*n,t[1]=e[1]*n,t},unprojectVec3:(()=>{let e=new zD(16),t=new zD(16),n=new zD(16);return function(r,i,a,o){return this.transformVec3(this.mulMat4(this.inverseMat4(i,e),this.inverseMat4(a,t),n),r,o)}})(),lerpVec3(e,t,n,r,i,a){let o=a||Y.vec3(),s=(e-t)/(n-t);return o[0]=r[0]+s*(i[0]-r[0]),o[1]=r[1]+s*(i[1]-r[1]),o[2]=r[2]+s*(i[2]-r[2]),o},lerpMat4(e,t,n,r,i,a){let o=a||Y.mat4(),s=(e-t)/(n-t);return o[0]=r[0]+s*(i[0]-r[0]),o[1]=r[1]+s*(i[1]-r[1]),o[2]=r[2]+s*(i[2]-r[2]),o[3]=r[3]+s*(i[3]-r[3]),o[4]=r[4]+s*(i[4]-r[4]),o[5]=r[5]+s*(i[5]-r[5]),o[6]=r[6]+s*(i[6]-r[6]),o[7]=r[7]+s*(i[7]-r[7]),o[8]=r[8]+s*(i[8]-r[8]),o[9]=r[9]+s*(i[9]-r[9]),o[10]=r[10]+s*(i[10]-r[10]),o[11]=r[11]+s*(i[11]-r[11]),o[12]=r[12]+s*(i[12]-r[12]),o[13]=r[13]+s*(i[13]-r[13]),o[14]=r[14]+s*(i[14]-r[14]),o[15]=r[15]+s*(i[15]-r[15]),o},flatten(e){let t=[],n,r,i,a,o;for(n=0,r=e.length;n<r;n++)for(o=e[n],i=0,a=o.length;i<a;i++)t.push(o[i]);return t},identityQuaternion(e=Y.vec4()){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},eulerToQuaternion(e,t,n=Y.vec4()){let r=e[0]*Y.DEGTORAD/2,i=e[1]*Y.DEGTORAD/2,a=e[2]*Y.DEGTORAD/2,o=Math.cos(r),s=Math.cos(i),c=Math.cos(a),l=Math.sin(r),u=Math.sin(i),d=Math.sin(a);return t===`XYZ`?(n[0]=l*s*c+o*u*d,n[1]=o*u*c-l*s*d,n[2]=o*s*d+l*u*c,n[3]=o*s*c-l*u*d):t===`YXZ`?(n[0]=l*s*c+o*u*d,n[1]=o*u*c-l*s*d,n[2]=o*s*d-l*u*c,n[3]=o*s*c+l*u*d):t===`ZXY`?(n[0]=l*s*c-o*u*d,n[1]=o*u*c+l*s*d,n[2]=o*s*d+l*u*c,n[3]=o*s*c-l*u*d):t===`ZYX`?(n[0]=l*s*c-o*u*d,n[1]=o*u*c+l*s*d,n[2]=o*s*d-l*u*c,n[3]=o*s*c+l*u*d):t===`YZX`?(n[0]=l*s*c+o*u*d,n[1]=o*u*c+l*s*d,n[2]=o*s*d-l*u*c,n[3]=o*s*c-l*u*d):t===`XZY`&&(n[0]=l*s*c-o*u*d,n[1]=o*u*c-l*s*d,n[2]=o*s*d+l*u*c,n[3]=o*s*c+l*u*d),n},mat4ToQuaternion(e,t=Y.vec4()){let n=e[0],r=e[4],i=e[8],a=e[1],o=e[5],s=e[9],c=e[2],l=e[6],u=e[10],d,f=n+o+u;return f>0?(d=.5/Math.sqrt(f+1),t[3]=.25/d,t[0]=(l-s)*d,t[1]=(i-c)*d,t[2]=(a-r)*d):n>o&&n>u?(d=2*Math.sqrt(1+n-o-u),t[3]=(l-s)/d,t[0]=.25*d,t[1]=(r+a)/d,t[2]=(i+c)/d):o>u?(d=2*Math.sqrt(1+o-n-u),t[3]=(i-c)/d,t[0]=(r+a)/d,t[1]=.25*d,t[2]=(s+l)/d):(d=2*Math.sqrt(1+u-n-o),t[3]=(a-r)/d,t[0]=(i+c)/d,t[1]=(s+l)/d,t[2]=.25*d),t},vec3PairToQuaternion(e,t,n=Y.vec4()){let r=Math.sqrt(Y.dotVec3(e,e)*Y.dotVec3(t,t)),i=r+Y.dotVec3(e,t);return i<1e-8*r?(i=0,Math.abs(e[0])>Math.abs(e[2])?(n[0]=-e[1],n[1]=e[0],n[2]=0):(n[0]=0,n[1]=-e[2],n[2]=e[1])):Y.cross3Vec3(e,t,n),n[3]=i,Y.normalizeQuaternion(n)},angleAxisToQuaternion(e,t=Y.vec4()){let n=e[3]/2,r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t},quaternionToEuler:(()=>{let e=new zD(16);return(t,n,r)=>(r||=Y.vec3(),Y.quaternionToRotationMat4(t,e),Y.mat4ToEuler(e,n,r),r)})(),mulQuaternions(e,t,n=Y.vec4()){let r=e[0],i=e[1],a=e[2],o=e[3],s=t[0],c=t[1],l=t[2],u=t[3];return n[0]=o*s+r*u+i*l-a*c,n[1]=o*c+i*u+a*s-r*l,n[2]=o*l+a*u+r*c-i*s,n[3]=o*u-r*s-i*c-a*l,n},vec3ApplyQuaternion(e,t,n=Y.vec3()){let r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],c=e[2],l=e[3],u=l*r+s*a-c*i,d=l*i+c*r-o*a,f=l*a+o*i-s*r,p=-o*r-s*i-c*a;return n[0]=u*l+p*-o+d*-c-f*-s,n[1]=d*l+p*-s+f*-o-u*-c,n[2]=f*l+p*-c+u*-s-d*-o,n},quaternionToMat4(e,t){t=Y.identityMat4(t);let n=e[0],r=e[1],i=e[2],a=e[3],o=2*n,s=2*r,c=2*i,l=o*a,u=s*a,d=c*a,f=o*n,p=s*n,m=c*n,h=s*r,g=c*r,_=c*i;return t[0]=1-(h+_),t[1]=p+d,t[2]=m-u,t[4]=p-d,t[5]=1-(f+_),t[6]=g+l,t[8]=m+u,t[9]=g-l,t[10]=1-(f+h),t},quaternionToRotationMat4(e,t){let n=e[0],r=e[1],i=e[2],a=e[3],o=n+n,s=r+r,c=i+i,l=n*o,u=n*s,d=n*c,f=r*s,p=r*c,m=i*c,h=a*o,g=a*s,_=a*c;return t[0]=1-(f+m),t[4]=u-_,t[8]=d+g,t[1]=u+_,t[5]=1-(l+m),t[9]=p-h,t[2]=d-g,t[6]=p+h,t[10]=1-(l+f),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 n=Y.lenVec4([e[0],e[1],e[2],e[3]]);return t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n,t[3]=e[3]/n,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 Y.normalizeQuaternion(Y.conjugateQuaternion(e,t))},quaternionToAngleAxis(e,t=Y.vec4()){e=Y.normalizeQuaternion(e,HQe);let n=e[3],r=2*Math.acos(n),i=Math.sqrt(1-n*n);return i<.001?(t[0]=e[0],t[1]=e[1],t[2]=e[2]):(t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i),t[3]=r,t},AABB3(e){return new zD(e||6)},AABB2(e){return new zD(e||4)},OBB3(e){return new zD(e||32)},OBB2(e){return new zD(e||16)},Sphere3(e,t,n,r){return new zD([e,t,n,r])},transformOBB3(e,t,n=t){let r,i=t.length,a,o,s,c=e[0],l=e[1],u=e[2],d=e[3],f=e[4],p=e[5],m=e[6],h=e[7],g=e[8],_=e[9],v=e[10],y=e[11],b=e[12],x=e[13],S=e[14],C=e[15];for(r=0;r<i;r+=4)a=t[r+0],o=t[r+1],s=t[r+2],n[r+0]=c*a+f*o+g*s+b,n[r+1]=l*a+p*o+_*s+x,n[r+2]=u*a+m*o+v*s+S,n[r+3]=d*a+h*o+y*s+C;return n},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 zD(3),t=new zD(3),n=new zD(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],Y.subVec3(t,e,n),Math.abs(Y.lenVec3(n)))})(),getAABB3DiagPoint:(()=>{let e=new zD(3),t=new zD(3),n=new zD(3);return(r,i)=>{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 a=Y.subVec3(t,e,n),o=i[0]-r[0],s=r[3]-i[0],c=i[1]-r[1],l=r[4]-i[1],u=i[2]-r[2],d=r[5]-i[2];return a[0]+=o>s?o:s,a[1]+=c>l?c:l,a[2]+=u>d?u:d,Math.abs(Y.lenVec3(a))}})(),getAABB3Area(e){let t=e[3]-e[0],n=e[4]-e[1],r=e[5]-e[2];return t*n*r},getAABB3Center(e,t){let n=t||Y.vec3();return n[0]=(e[0]+e[3])/2,n[1]=(e[1]+e[4])/2,n[2]=(e[2]+e[5])/2,n},getAABB2Center(e,t){let n=t||Y.vec2();return n[0]=(e[2]+e[0])/2,n[1]=(e[3]+e[1])/2,n},collapseAABB3(e=Y.AABB3()){return e[0]=Y.MAX_DOUBLE,e[1]=Y.MAX_DOUBLE,e[2]=Y.MAX_DOUBLE,e[3]=Y.MIN_DOUBLE,e[4]=Y.MIN_DOUBLE,e[5]=Y.MIN_DOUBLE,e},AABB3ToOBB3(e,t=Y.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 zD(3);return(t,n,r)=>{n||=Y.AABB3();let i=Y.MAX_DOUBLE,a=Y.MAX_DOUBLE,o=Y.MAX_DOUBLE,s=Y.MIN_DOUBLE,c=Y.MIN_DOUBLE,l=Y.MIN_DOUBLE,u,d,f;for(let n=0,p=t.length;n<p;n+=3)r?(e[0]=t[n+0],e[1]=t[n+1],e[2]=t[n+2],Y.decompressPosition(e,r,e),u=e[0],d=e[1],f=e[2]):(u=t[n+0],d=t[n+1],f=t[n+2]),u<i&&(i=u),d<a&&(a=d),f<o&&(o=f),u>s&&(s=u),d>c&&(c=d),f>l&&(l=f);return n[0]=i,n[1]=a,n[2]=o,n[3]=s,n[4]=c,n[5]=l,n}})(),OBB3ToAABB3(e,t=Y.AABB3()){let n=Y.MAX_DOUBLE,r=Y.MAX_DOUBLE,i=Y.MAX_DOUBLE,a=Y.MIN_DOUBLE,o=Y.MIN_DOUBLE,s=Y.MIN_DOUBLE,c,l,u;for(let t=0,d=e.length;t<d;t+=4)c=e[t+0],l=e[t+1],u=e[t+2],c<n&&(n=c),l<r&&(r=l),u<i&&(i=u),c>a&&(a=c),l>o&&(o=l),u>s&&(s=u);return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t},points3ToAABB3(e,t=Y.AABB3()){let n=Y.MAX_DOUBLE,r=Y.MAX_DOUBLE,i=Y.MAX_DOUBLE,a=Y.MIN_DOUBLE,o=Y.MIN_DOUBLE,s=Y.MIN_DOUBLE,c,l,u;for(let t=0,d=e.length;t<d;t++)c=e[t][0],l=e[t][1],u=e[t][2],c<n&&(n=c),l<r&&(r=l),u<i&&(i=u),c>a&&(a=c),l>o&&(o=l),u>s&&(s=u);return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t},points3ToSphere3:(()=>{let e=new zD(3);return(t,n)=>{n||=Y.vec4();let r=0,i=0,a=0,o,s=t.length;for(o=0;o<s;o++)r+=t[o][0],i+=t[o][1],a+=t[o][2];n[0]=r/s,n[1]=i/s,n[2]=a/s;let c=0,l;for(o=0;o<s;o++)l=Math.abs(Y.lenVec3(Y.subVec3(t[o],n,e))),l>c&&(c=l);return n[3]=c,n}})(),positions3ToSphere3:(()=>{let e=new zD(3),t=new zD(3);return(n,r)=>{r||=Y.vec4();let i=0,a=0,o=0,s,c=n.length,l=0;for(s=0;s<c;s+=3)i+=n[s],a+=n[s+1],o+=n[s+2];let u=c/3;r[0]=i/u,r[1]=a/u,r[2]=o/u;let d;for(s=0;s<c;s+=3)e[0]=n[s],e[1]=n[s+1],e[2]=n[s+2],d=Math.abs(Y.lenVec3(Y.subVec3(e,r,t))),d>l&&(l=d);return r[3]=l,r}})(),OBB3ToSphere3:(()=>{let e=new zD(3),t=new zD(3);return(n,r)=>{r||=Y.vec4();let i=0,a=0,o=0,s,c=n.length,l=c/4;for(s=0;s<c;s+=4)i+=n[s+0],a+=n[s+1],o+=n[s+2];r[0]=i/l,r[1]=a/l,r[2]=o/l;let u=0,d;for(s=0;s<c;s+=4)e[0]=n[s+0],e[1]=n[s+1],e[2]=n[s+2],d=Math.abs(Y.lenVec3(Y.subVec3(e,r,t))),d>u&&(u=d);return r[3]=u,r}})(),getSphere3Center(e,t=Y.vec3()){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},getPositionsCenter(e,t=Y.vec3()){let n=0,r=0,i=0;for(var a=0,o=e.length;a<o;a+=3)n+=e[a+0],r+=e[a+1],i+=e[a+2];let s=e.length/3;return t[0]=n/s,t[1]=r/s,t[2]=i/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 n,r,i,a=0,o=t.length;a<o;a+=3)n=t[a],r=t[a+1],i=t[a+2],e[0]>n&&(e[0]=n),e[1]>r&&(e[1]=r),e[2]>i&&(e[2]=i),e[3]<n&&(e[3]=n),e[4]<r&&(e[4]=r),e[5]<i&&(e[5]=i);return e},collapseAABB2(e=Y.AABB2()){return e[0]=Y.MAX_DOUBLE,e[1]=Y.MAX_DOUBLE,e[2]=Y.MIN_DOUBLE,e[3]=Y.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,n){let r,i;return e[0]>0?(r=e[0]*n[0],i=e[0]*n[3]):(r=e[0]*n[3],i=e[0]*n[0]),e[1]>0?(r+=e[1]*n[1],i+=e[1]*n[4]):(r+=e[1]*n[4],i+=e[1]*n[1]),e[2]>0?(r+=e[2]*n[2],i+=e[2]*n[5]):(r+=e[2]*n[5],i+=e[2]*n[2]),r<=-t&&i<=-t?-1:r>=-t&&i>=-t?1:0},OBB3ToAABB2(e,t=Y.AABB2()){let n=Y.MAX_DOUBLE,r=Y.MAX_DOUBLE,i=Y.MIN_DOUBLE,a=Y.MIN_DOUBLE,o,s,c,l;for(let t=0,u=e.length;t<u;t+=4)o=e[t+0],s=e[t+1],c=e[t+3]||1,l=1/c,o*=l,s*=l,o<n&&(n=o),s<r&&(r=s),o>i&&(i=o),s>a&&(a=s);return t[0]=n,t[1]=r,t[2]=i,t[3]=a,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,n,r=e){let i=(e[0]+1)*.5,a=(e[1]+1)*.5,o=(e[2]+1)*.5,s=(e[3]+1)*.5;return r[0]=Math.floor(i*t),r[1]=n-Math.floor(s*n),r[2]=Math.floor(o*t),r[3]=n-Math.floor(a*n),r},tangentQuadraticBezier(e,t,n,r){return 2*(1-e)*(n-t)+2*e*(r-n)},tangentQuadraticBezier3(e,t,n,r,i){return-3*t*(1-e)*(1-e)+3*n*(1-e)*(1-e)-6*e*n*(1-e)+6*e*r*(1-e)-3*e*e*r+3*e*e*i},tangentSpline(e){let t=6*e*e-6*e,n=3*e*e-4*e+1,r=-6*e*e+6*e,i=3*e*e-2*e;return t+n+r+i},catmullRomInterpolate(e,t,n,r,i){let a=(n-e)*.5,o=(r-t)*.5,s=i*i,c=i*s;return(2*t-2*n+a+o)*c+(-3*t+3*n-2*a-o)*s+a*i+t},b2p0(e,t){let n=1-e;return n*n*t},b2p1(e,t){return 2*(1-e)*e*t},b2p2(e,t){return e*e*t},b2(e,t,n,r){return this.b2p0(e,t)+this.b2p1(e,n)+this.b2p2(e,r)},b3p0(e,t){let n=1-e;return n*n*n*t},b3p1(e,t){let n=1-e;return 3*n*n*e*t},b3p2(e,t){return 3*(1-e)*e*e*t},b3p3(e,t){return e*e*e*t},b3(e,t,n,r,i){return this.b3p0(e,t)+this.b3p1(e,n)+this.b3p2(e,r)+this.b3p3(e,i)},triangleNormal(e,t,n,r=Y.vec3()){let i=t[0]-e[0],a=t[1]-e[1],o=t[2]-e[2],s=n[0]-e[0],c=n[1]-e[1],l=n[2]-e[2],u=a*l-o*c,d=o*s-i*l,f=i*c-a*s,p=Math.sqrt(u*u+d*d+f*f);return p===0?(r[0]=0,r[1]=0,r[2]=0):(r[0]=u/p,r[1]=d/p,r[2]=f/p),r},rayTriangleIntersect:(()=>{let e=new zD(3),t=new zD(3),n=new zD(3),r=new zD(3),i=new zD(3);return(a,o,s,c,l,u)=>{u||=Y.vec3();let d=Y.subVec3(c,s,e),f=Y.subVec3(l,s,t),p=Y.cross3Vec3(o,f,n),m=Y.dotVec3(d,p);if(m<1e-6)return null;let h=Y.subVec3(a,s,r),g=Y.dotVec3(h,p);if(g<0||g>m)return null;let _=Y.cross3Vec3(h,d,i),v=Y.dotVec3(o,_);if(v<0||g+v>m)return null;let y=Y.dotVec3(f,_)/m;return u[0]=a[0]+y*o[0],u[1]=a[1]+y*o[1],u[2]=a[2]+y*o[2],u}})(),rayPlaneIntersect:(()=>{let e=new zD(3),t=new zD(3),n=new zD(3),r=new zD(3);return(i,a,o,s,c,l)=>{l||=Y.vec3(),a=Y.normalizeVec3(a,e);let u=Y.subVec3(s,o,t),d=Y.subVec3(c,o,n),f=Y.cross3Vec3(u,d,r);Y.normalizeVec3(f,f);let p=-Y.dotVec3(o,f),m=-(Y.dotVec3(i,f)+p)/Y.dotVec3(a,f);return l[0]=i[0]+m*a[0],l[1]=i[1]+m*a[1],l[2]=i[2]+m*a[2],l}})(),cartesianToBarycentric:(()=>{let e=new zD(3),t=new zD(3),n=new zD(3);return(r,i,a,o,s)=>{let c=Y.subVec3(o,i,e),l=Y.subVec3(a,i,t),u=Y.subVec3(r,i,n),d=Y.dotVec3(c,c),f=Y.dotVec3(c,l),p=Y.dotVec3(c,u),m=Y.dotVec3(l,l),h=Y.dotVec3(l,u),g=d*m-f*f;if(g===0)return null;let _=1/g,v=(m*p-f*h)*_,y=(d*h-f*p)*_;return s[0]=1-v-y,s[1]=y,s[2]=v,s}})(),barycentricInsideTriangle(e){let t=e[1],n=e[2];return n>=0&&t>=0&&n+t<1},barycentricToCartesian(e,t,n,r,i=Y.vec3()){let a=e[0],o=e[1],s=e[2];return i[0]=t[0]*a+n[0]*o+r[0]*s,i[1]=t[1]*a+n[1]*o+r[1]*s,i[2]=t[2]*a+n[2]*o+r[2]*s,i},mergeVertices(e,t,n,r){let i={},a=[],o=[],s=t?[]:null,c=n?[]:null,l=[],u,d,f,p,m=10**4,h,g,_=0;for(h=0,g=e.length;h<g;h+=3)u=e[h],d=e[h+1],f=e[h+2],p=`${Math.round(u*m)}_${Math.round(d*m)}_${Math.round(f*m)}`,i[p]===void 0&&(i[p]=o.length/3,o.push(u),o.push(d),o.push(f),t&&(s.push(t[h]),s.push(t[h+1]),s.push(t[h+2])),n&&(c.push(n[_]),c.push(n[_+1]))),a[h/3]=i[p],_+=2;for(h=0,g=r.length;h<g;h++)l[h]=a[r[h]];let v={positions:o,indices:l};return s&&(v.normals=s),c&&(v.uv=c),v},buildNormals:(()=>{let e=new zD(3),t=new zD(3),n=new zD(3),r=new zD(3),i=new zD(3),a=new zD(3);return(o,s,c)=>{let l,u,d=Array(o.length/3),f,p,m;for(l=0,u=s.length;l<u;l+=3){f=s[l],p=s[l+1],m=s[l+2],e[0]=o[f*3],e[1]=o[f*3+1],e[2]=o[f*3+2],t[0]=o[p*3],t[1]=o[p*3+1],t[2]=o[p*3+2],n[0]=o[m*3],n[1]=o[m*3+1],n[2]=o[m*3+2],Y.subVec3(t,e,r),Y.subVec3(n,e,i);let c=Y.vec3();Y.normalizeVec3(Y.cross3Vec3(r,i,a),c),d[f]||(d[f]=[]),d[p]||(d[p]=[]),d[m]||(d[m]=[]),d[f].push(c),d[p].push(c),d[m].push(c)}c=c&&c.length===o.length?c:new Float32Array(o.length);let h,g,_,v;for(l=0,u=d.length;l<u;l++){h=d[l].length,g=0,_=0,v=0;for(let e=0;e<h;e++)g+=d[l][e][0],_+=d[l][e][1],v+=d[l][e][2];c[l*3]=g/h,c[l*3+1]=_/h,c[l*3+2]=v/h}return c}})(),buildTangents:(()=>{let e=new zD(3),t=new zD(3),n=new zD(3),r=new zD(3),i=new zD(3),a=new zD(3),o=new zD(3);return(s,c,l)=>{let u=new Float32Array(s.length);for(let d=0;d<c.length;d+=3){let f=c[d],p=s.subarray(f*3,f*3+3),m=l.subarray(f*2,f*2+2);f=c[d+1];let h=s.subarray(f*3,f*3+3),g=l.subarray(f*2,f*2+2);f=c[d+2];let _=s.subarray(f*3,f*3+3),v=l.subarray(f*2,f*2+2),y=Y.subVec3(h,p,e),b=Y.subVec3(_,p,t),x=Y.subVec2(g,m,n),S=Y.subVec2(v,m,r),C=1/(x[0]*S[1]-x[1]*S[0]),w=Y.mulVec3Scalar(Y.subVec3(Y.mulVec3Scalar(y,S[1],i),Y.mulVec3Scalar(b,x[1],a),o),C,a),T;for(let e=0;e<3;e++)T=c[d+e]*3,u[T]+=w[0],u[T+1]+=w[1],u[T+2]+=w[2]}return u}})(),buildPickTriangles(e,t,n){let r=t.length,i=n?new Uint16Array(r*9):new Float32Array(r*9),a=new Uint8Array(r*12),o=0,s,c=0,l=0,u,d,f,p,m;for(let n=0;n<r;n+=3)m=o>>24&255,p=o>>16&255,f=o>>8&255,d=o&255,u=t[n],s=u*3,i[c++]=e[s],i[c++]=e[s+1],i[c++]=e[s+2],a[l++]=d,a[l++]=f,a[l++]=p,a[l++]=m,u=t[n+1],s=u*3,i[c++]=e[s],i[c++]=e[s+1],i[c++]=e[s+2],a[l++]=d,a[l++]=f,a[l++]=p,a[l++]=m,u=t[n+2],s=u*3,i[c++]=e[s],i[c++]=e[s+1],i[c++]=e[s+2],a[l++]=d,a[l++]=f,a[l++]=p,a[l++]=m,o++;return{positions:i,colors:a}},faceToVertexNormals(e,t,n={}){let r=n.smoothNormalsAngleThreshold||20,i={},a=[],o={},s,c,l,u,d,f=10**4,p,m,h,g,_,v;for(m=0,g=e.length;m<g;m+=3){p=m/3,c=e[m],l=e[m+1],u=e[m+2],d=`${Math.round(c*f)}_${Math.round(l*f)}_${Math.round(u*f)}`,i[d]===void 0?i[d]=[p]:i[d].push(p);let n=Y.normalizeVec3([t[m],t[m+1],t[m+2]]);a[p]=n,s=Y.vec4([n[0],n[1],n[2],1]),o[p]=s}for(d in i)if(i.hasOwnProperty(d)){let e=i[d],t=e.length;for(m=0;m<t;m++){let n=e[m];for(s=o[n],h=0;h<t;h++){if(m===h)continue;let t=e[h];_=a[n],v=a[t],Math.abs(Y.angleVec3(_,v)/Y.DEGTORAD)<r&&(s[0]+=v[0],s[1]+=v[1],s[2]+=v[2],s[3]+=1)}}}for(m=0,g=t.length;m<g;m+=3)s=o[m/3],t[m+0]=s[0]/s[3],t[m+1]=s[1]/s[3],t[m+2]=s[2]/s[3]},transformRay:(()=>{let e=new zD(4),t=new zD(4);return(n,r,i,a,o)=>{e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=1,Y.transformVec4(n,e,t),a[0]=t[0],a[1]=t[1],a[2]=t[2],e[0]=i[0],e[1]=i[1],e[2]=i[2],Y.transformVec3(n,e,t),Y.normalizeVec3(t),o[0]=t[0],o[1]=t[1],o[2]=t[2]}})(),canvasPosToWorldRay:(()=>{let e=new zD(16),t=new zD(4),n=new zD(4),r=(t,n,r,i,a)=>{a[0]=t,a[1]=n,a[2]=r,a[3]=1,Y.transformVec4(e,a,a),i||Y.mulVec4Scalar(a,1/a[3])};return(i,a,o,s,c,l,u)=>{let d=s===`ortho`;Y.mulMat4(o,a,e),Y.inverseMat4(e,e);let f=2*c[0]/i.clientWidth-1,p=1-2*c[1]/i.clientHeight;r(f,p,-1,d,t),r(f,p,1,d,n),l[0]=t[0],l[1]=t[1],l[2]=t[2],Y.subVec3(n,t,u),Y.normalizeVec3(u)}})(),canvasPosToLocalRay:(()=>{let e=new zD(3),t=new zD(3);return(n,r,i,a,o,s,c,l)=>{Y.canvasPosToWorldRay(n,r,i,a,s,e,t),Y.worldRayToLocalRay(o,e,t,c,l)}})(),worldRayToLocalRay:(()=>{let e=new zD(16),t=new zD(4),n=new zD(4);return(r,i,a,o,s)=>{let c=Y.inverseMat4(r,e);t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=1,Y.transformVec4(c,t,n),o[0]=n[0],o[1]=n[1],o[2]=n[2],Y.transformVec3(c,a,s)}})(),buildKDTree:(()=>{let e=new Float32Array;function t(n,r,i,a){let o=new zD(6),s={triangles:null,left:null,right:null,leaf:!1,splitDim:0,aabb:o};o[0]=o[1]=o[2]=1/0,o[3]=o[4]=o[5]=-1/0;let c,l;for(c=0,l=n.length;c<l;++c){var u=n[c]*3;for(let e=0;e<3;++e){let t=r[u+e]*3;i[t]<o[0]&&(o[0]=i[t]),i[t]>o[3]&&(o[3]=i[t]),i[t+1]<o[1]&&(o[1]=i[t+1]),i[t+1]>o[4]&&(o[4]=i[t+1]),i[t+2]<o[2]&&(o[2]=i[t+2]),i[t+2]>o[5]&&(o[5]=i[t+2])}}if(n.length<20||a>10)return s.triangles=n,s.leaf=!0,s;e[0]=o[3]-o[0],e[1]=o[4]-o[1],e[2]=o[5]-o[2];let d=0;e[1]>e[d]&&(d=1),e[2]>e[d]&&(d=2),s.splitDim=d;let f=(o[d]+o[d+3])/2,p=Array(n.length),m=0,h=Array(n.length),g=0;for(c=0,l=n.length;c<l;++c){var u=n[c]*3;let e=r[u],t=r[u+1],a=r[u+2],o=e*3,s=t*3,l=a*3;i[o+d]<=f||i[s+d]<=f||i[l+d]<=f?p[m++]=n[c]:h[g++]=n[c]}return p.length=m,h.length=g,s.left=t(p,r,i,a+1),s.right=t(h,r,i,a+1),s}return(e,n)=>{let r=e.length/3,i=Array(r);for(let e=0;e<r;++e)i[e]=e;return t(i,e,n,0)}})(),decompressPosition(e,t,n){n||=e,n[0]=e[0]*t[0]+t[12],n[1]=e[1]*t[5]+t[13],n[2]=e[2]*t[10]+t[14]},decompressPositions(e,t,n=new Float32Array(e.length)){for(let r=0,i=e.length;r<i;r+=3)n[r+0]=e[r+0]*t[0]+t[12],n[r+1]=e[r+1]*t[5]+t[13],n[r+2]=e[r+2]*t[10]+t[14];return n},decompressUV(e,t,n){n[0]=e[0]*t[0]+t[6],n[1]=e[1]*t[4]+t[7]},decompressUVs(e,t,n=new Float32Array(e.length)){for(let r=0,i=e.length;r<i;r+=3)n[r+0]=e[r+0]*t[0]+t[6],n[r+1]=e[r+1]*t[4]+t[7];return n},octDecodeVec2(e,t){let n=e[0],r=e[1];n=(2*n+1)/255,r=(2*r+1)/255;let i=1-Math.abs(n)-Math.abs(r);i<0&&(n=(1-Math.abs(r))*(n>=0?1:-1),r=(1-Math.abs(n))*(r>=0?1:-1));let a=Math.sqrt(n*n+r*r+i*i);return t[0]=n/a,t[1]=r/a,t[2]=i/a,t},octDecodeVec2s(e,t){for(let n=0,r=0,i=e.length;n<i;n+=2){let i=e[n+0],a=e[n+1];i=(2*i+1)/255,a=(2*a+1)/255;let o=1-Math.abs(i)-Math.abs(a);o<0&&(i=(1-Math.abs(a))*(i>=0?1:-1),a=(1-Math.abs(i))*(a>=0?1:-1));let s=Math.sqrt(i*i+a*a+o*o);t[r+0]=i/s,t[r+1]=a/s,t[r+2]=o/s,r+=3}return t}};Y.buildEdgeIndices=(function(){let e=[],t=[],n=[],r=[],i=[],a=0,o=new Uint16Array(3),s=new Uint16Array(3),c=new Uint16Array(3),l=Y.vec3(),u=Y.vec3(),d=Y.vec3(),f=Y.vec3(),p=Y.vec3(),m=Y.vec3(),h=Y.vec3();function g(i,a){let o={},s,c,l,u,d=10**4,f,p,m=0;for(f=0,p=i.length;f<p;f+=3)s=i[f],c=i[f+1],l=i[f+2],u=Math.round(s*d)+`_`+Math.round(c*d)+`_`+Math.round(l*d),o[u]===void 0&&(o[u]=m/3,e[m++]=s,e[m++]=c,e[m++]=l),t[f/3]=o[u];for(f=0,p=a.length;f<p;f++)r[f]=t[a[f]],n[r[f]]=a[f]}function _(t,n){a=0;for(let g=0,_=t;g<_;g+=3){let t=r[g]*3,_=r[g+1]*3,v=r[g+2]*3;n?(o[0]=e[t],o[1]=e[t+1],o[2]=e[t+2],s[0]=e[_],s[1]=e[_+1],s[2]=e[_+2],c[0]=e[v],c[1]=e[v+1],c[2]=e[v+2],Y.decompressPosition(o,n,l),Y.decompressPosition(s,n,u),Y.decompressPosition(c,n,d)):(l[0]=e[t],l[1]=e[t+1],l[2]=e[t+2],u[0]=e[_],u[1]=e[_+1],u[2]=e[_+2],d[0]=e[v],d[1]=e[v+1],d[2]=e[v+2]),Y.subVec3(d,u,f),Y.subVec3(l,u,p),Y.cross3Vec3(f,p,m),Y.normalizeVec3(m,h);let y=i[a]||(i[a]={normal:Y.vec3()});y.normal[0]=h[0],y.normal[1]=h[1],y.normal[2]=h[2],a++}}return function(e,t,a,o){g(e,t),_(t.length,a);let s=[],c=Math.cos(Y.DEGTORAD*o),l={},u,d,f,p,m,h=!1,v,y,b,x,S,C;for(let e=0,n=t.length;e<n;e+=3){let t=e/3;for(let n=0;n<3;n++)u=r[e+n],d=r[e+(n+1)%3],f=Math.min(u,d),p=Math.max(u,d),m=f+`,`+p,l[m]===void 0?l[m]={index1:f,index2:p,face1:t,face2:void 0}:l[m].face2=t}for(m in l)v=l[m],!(v.face2!==void 0&&(y=i[v.face1].normal,b=i[v.face2].normal,x=Y.dotVec3(y,b),x>c))&&(S=n[v.index1],C=n[v.index2],(!h&&S>65535||C>65535)&&(h=!0),s.push(S),s.push(C));return h?new Uint32Array(s):new Uint16Array(s)}})(),Y.planeClipsPositions3=function(e,t,n,r=3){for(let i=0,a=n.length;i<a;i+=r)if(BD[0]=n[i+0]-e[0],BD[1]=n[i+1]-e[1],BD[2]=n[i+2]-e[2],BD[0]*t[0]+BD[1]*t[1]+BD[2]*t[2]<0)return!0;return!1};var UQe=15,UD=new Float32Array(3),WQe=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||UQe,this._root=null,this._needsRebuild=!0,this._onModelLoaded=this.viewer.scene.on(`modelLoaded`,e=>{this._needsRebuild=!0}),this._onModelUnloaded=this.viewer.scene.on(`modelUnloaded`,e=>{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 n=e.objects[t];this._insertEntity(this._root,n,1)}this._needsRebuild=!1}_insertEntity(e,t,n){let r=t.aabb;if(n>=this._maxTreeDepth){e.entities=e.entities||[],e.entities.push(t);return}if(e.left&&Y.containsAABB3(e.left.aabb,r)){this._insertEntity(e.left,t,n+1);return}if(e.right&&Y.containsAABB3(e.right.aabb,r)){this._insertEntity(e.right,t,n+1);return}let i=e.aabb;UD[0]=i[3]-i[0],UD[1]=i[4]-i[1],UD[2]=i[5]-i[2];let a=0;if(UD[1]>UD[a]&&(a=1),UD[2]>UD[a]&&(a=2),!e.left){let o=i.slice();if(o[a+3]=(i[a]+i[a+3])/2,e.left={aabb:o},Y.containsAABB3(o,r)){this._insertEntity(e.left,t,n+1);return}}if(!e.right){let o=i.slice();if(o[a]=(i[a]+i[a+3])/2,e.right={aabb:o},Y.containsAABB3(o,r)){this._insertEntity(e.right,t,n+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}},WD=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 e=this._head;if(e.length=0,this._head=this._tail,this._tail=e,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}},GD={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 KD(e,t){if(e.nodeType===e.TEXT_NODE){var n=e.nodeValue;if(n.match(/^\s+$/)===null)return n}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 i=0;i<e.attributes.length;i++){var a=e.attributes[i],o=t[a.nodeName]||a.nodeName;r[o]=a.nodeValue}for(var s=0;s<e.childNodes.length;s++){var c=e.childNodes[s],i=KD(c,t);i&&r.children.push(i)}return r}}function GQe(e){return JSON.parse(JSON.stringify(e))}var KQe=[[`0`,10],[`A`,26],[`a`,26],[`_`,1],[`$`,1]].map(function(e){for(var t=[],n=e[0].charCodeAt(0),r=n+e[1],i=n;i<r;++i)t.push(i);return String.fromCharCode.apply(null,t)}).join(``);function qD(e,t){return(!t||t===4?[0,6,12,18]:[0,6]).map(function(t){return KQe.substr(parseInt(e/(1<<t))%64,1)}).reverse().join(``)}function qQe(e){var t=[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30].map(function(t){return parseInt(e.substr(t,2),16)});return qD(t[0],2)+[1,4,7,10,13].map(function(e){return qD((t[e]<<16)+(t[e+1]<<8)+t[e+2])}).join(``)}function JQe(e,t){var n=[],r=function(e){e.type===t&&n.push(e),(e.children||[]).forEach(function(e){r(e)})};return r(e),n}function YQe(e){return new Promise(function(t,n){setTimeout(t,e)})}function XQe(e){return new Promise(function(t,n){var r=new XMLHttpRequest;r.open(e.method||`GET`,e.url,!0),r.onload=function(e){r.readyState===4&&(r.status===200?t(r.responseXML):n(r.statusText))},r.send(null)})}var ZQe=function(){for(var e={},t=window.location.search.substring(1).split(`&`),n=0;n<t.length;n++){var r=t[n].split(`=`);if(e[r[0]]===void 0)e[r[0]]=decodeURIComponent(r[1]);else if(typeof e[r[0]]==`string`){var i=[e[r[0]],decodeURIComponent(r[1])];e[r[0]]=i}else e[r[0]].push(decodeURIComponent(r[1]))}return e}();function QQe(e,t,n){var r=e=>void 0;t||=r,n||=r;var i=new XMLHttpRequest;i.overrideMimeType(`application/json`),i.open(`GET`,e,!0),i.addEventListener(`load`,function(e){var r=e.target.response;if(this.status===200){var i;try{i=JSON.parse(r)}catch(e){n(`utils.loadJSON(): Failed to parse JSON response - ${e}`)}t(i)}else if(this.status===0){console.warn(`loadFile: HTTP Status 0 received.`);try{t(JSON.parse(r))}catch(e){n(`utils.loadJSON(): Failed to parse JSON response - ${e}`)}}else n(e)},!1),i.addEventListener(`error`,function(e){n(e)},!1),i.send(null)}function $Qe(e,t,n){var r=e=>void 0;t||=r,n||=r;let i=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(i){let e=!!i[2];var a=i[3];a=window.decodeURIComponent(a),e&&(a=window.atob(a));try{let e=new ArrayBuffer(a.length),n=new Uint8Array(e);for(var o=0;o<a.length;o++)n[o]=a.charCodeAt(o);aO.scheduleTask(()=>{t(e)})}catch(e){aO.scheduleTask(()=>{n(e)})}}else{let r=new XMLHttpRequest;r.open(`GET`,e,!0),r.responseType=`arraybuffer`,r.onreadystatechange=function(){r.readyState===4&&(r.status===200?t(r.response):n(`loadArrayBuffer error : `+r.response))},r.send(null)}}function e$e(e){return e&&!e.propertyIsEnumerable(`length`)&&typeof e==`object`&&typeof e.length==`number`}function t$e(e){return typeof e==`string`||e instanceof String}function n$e(e){return!isNaN(parseFloat(e))&&isFinite(e)}function r$e(e){return JD.isString(e)||JD.isNumeric(e)}function i$e(e,t){return!e||!t?!1:(JD.isNumeric(e)||JD.isString(e)?`${e}`:e.id)===(JD.isNumeric(t)||JD.isString(t)?`${t}`:t.id)}function a$e(e){return typeof e==`function`}function o$e(e){let t={}.constructor;return!!e&&e.constructor===t}function s$e(e){return JD.apply(e,{})}function c$e(e,t){for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function l$e(e,t){for(let n in e)e.hasOwnProperty(n)&&e[n]!==void 0&&e[n]!==null&&(t[n]=e[n]);return t}function u$e(e,t){for(let n in e)e.hasOwnProperty(n)&&(t[n]===void 0||t[n]===null)&&(t[n]=e[n]);return t}function d$e(e){for(let t in e)if(e.hasOwnProperty(t))return!1;return!0}function f$e(e){return JD.isNumeric(e)?`${e}`:`'${e}'`}function p$e(e,t){let n=new e.constructor(e.length+t.length);return n.set(e),n.set(t,e.length),n}function m$e(e){var t=[];function n(e){e.id=e.uuid,delete e.oid,t.push(e);var r=e.children;if(r)for(var i=0,a=r.length;i<a;i++){let t=r[i];t.parent=e.id,n(r[i])}e.children=[]}return n(e),t}var JD={xmlToJson:KD,clone:GQe,compressGuid:qQe,findNodeOfType:JQe,timeout:YQe,httpRequest:XQe,loadJSON:QQe,loadArraybuffer:$Qe,queryString:ZQe,isArray:e$e,isString:t$e,isNumeric:n$e,isID:r$e,isSameComponent:i$e,isFunction:a$e,isObject:o$e,copy:s$e,apply:c$e,apply2:l$e,applyIf:u$e,isEmptyObject:d$e,inQuotes:f$e,concat:p$e,flattenParentChildHierarchy:m$e},YD={},XD=new ID,ZD=new WD,QD={sceneId:null,time:null,startTime:null,prevTime:null,deltaTime:null},$D=10,eO=[],tO=30,nO=0,rO,iO=0;function h$e(){this.version=`1.0.0`,this.scenes={},this._superTypes={},this._addScene=function(e){if(e.id){if(aO.scenes[e.id]){console.error(`[ERROR] Scene ${JD.inQuotes(e.id)} already exists`);return}}else e.id=XD.addItem({});aO.scenes[e.id]=e;let t=e.ticksPerOcclusionTest,n=e.ticksPerRender;YD[e.id]={ticksPerOcclusionTest:t,ticksPerRender:n,renderCountdown:n},GD.components.scenes++,e.once(`destroyed`,()=>{XD.removeItem(e.id),delete aO.scenes[e.id],delete YD[e.id],GD.components.scenes--})},this.clear=function(){let e;for(let t in aO.scenes)aO.scenes.hasOwnProperty(t)&&(e=aO.scenes[t],t===`default.scene`?e.clear():(e.destroy(),delete aO.scenes[e.id]))},this.scheduleTask=function(e,t=null){ZD.push(e),ZD.push(t)},this.runTasks=function(e=-1){let t=new Date().getTime(),n,r,i=0;for(;ZD.length>0&&(e<0||t<e);)n=ZD.shift(),r=ZD.shift(),r?n.call(r):n(),t=new Date().getTime(),i++;return i},this.getNumTasks=function(){return ZD.length}}var aO=new h$e,oO=function(){let e=Date.now();if(rO=e-nO,nO>0&&rO>0){var t=1e3/rO;iO+=t,eO.push(t),eO.length>=tO&&(iO-=eO.shift()),GD.frame.fps=Math.round(iO/eO.length)}for(let e in aO.scenes)aO.scenes[e].compile();cO(e),nO=e};function g$e(e,t){let n=Date.now()+t;function r(){let i=Date.now()-n;e(),n+=t,setTimeout(r,Math.max(0,t-i))}return r(),{cancel:function(){}}}g$e(()=>{oO()},100);var sO=function(){let e=Date.now();if(rO=e-nO,nO>0&&rO>0){var t=1e3/rO;iO+=t,eO.push(t),eO.length>=tO&&(iO-=eO.shift()),GD.frame.fps=Math.round(iO/eO.length)}cO(e),_$e(e),v$e(),window.requestPostAnimationFrame===void 0?requestAnimationFrame(sO):window.requestPostAnimationFrame(oO)};sO();function cO(e){let t=aO.runTasks(e+$D),n=aO.getNumTasks();GD.frame.tasksRun=t,GD.frame.tasksScheduled=n,GD.frame.tasksBudget=$D}function _$e(e){for(var t in QD.time=e,aO.scenes)if(aO.scenes.hasOwnProperty(t)){var n=aO.scenes[t];QD.sceneId=t,QD.startTime=n.startTime,QD.deltaTime=QD.prevTime==null?0:QD.time-QD.prevTime,n.fire(`tick`,QD,!0)}QD.prevTime=e}function v$e(){let e=aO.scenes,t,n,r,i,a;for(a in e)e.hasOwnProperty(a)&&(t=e[a],n=YD[a],n||=YD[a]={},r=t.ticksPerOcclusionTest,n.ticksPerOcclusionTest!==r&&(n.ticksPerOcclusionTest=r,n.renderCountdown=r),--t.occlusionTestCountdown<=0&&(t.doOcclusionTest(),t.occlusionTestCountdown=r),i=t.ticksPerRender,n.ticksPerRender!==i&&(n.ticksPerRender=i,n.renderCountdown=i),--n.renderCountdown===0&&(t.render(!1),n.renderCountdown=i))}var lO=class e{get type(){return`Component`}get isComponent(){return!0}constructor(t=null,n={}){if(this.scene=null,this.type===`Scene`)this.scene=this,this.viewer=n.viewer;else{if(t.type===`Scene`)this.scene=t;else if(t instanceof e)this.scene=t.scene;else throw`Invalid param: owner must be a Component`;this._owner=t}this._dontClear=!!n.dontClear,this._renderer=this.scene._renderer,this.meta=n.meta||{},this.id=n.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(e){return this.type===e}fire(e,t,n){this._events||={},this._eventSubs||(this._eventSubs={},this._eventSubsNum={}),n!==!0&&(this._events[e]=t||!0);let r=this._eventSubs[e],i;if(r)for(let n in r)r.hasOwnProperty(n)&&(i=r[n],this._eventCallDepth++,this._eventCallDepth<300?i.callback.call(i.scope,t):this.error(`fire: potential stack overflow from recursive event '`+e+`' - dropping this event`),this._eventCallDepth--)}on(e,t,n){this._events||={},this._subIdMap||=new ID,this._subIdEvents||={},this._eventSubs||={},this._eventSubsNum||={};let r=this._eventSubs[e];r?this._eventSubsNum[e]++:(r={},this._eventSubs[e]=r,this._eventSubsNum[e]=1);let i=this._subIdMap.addItem();r[i]={callback:t,scope:n||this},this._subIdEvents[i]=e;let a=this._events[e];return a!==void 0&&t.call(n||this,a),i}off(e){if(e==null||!this._subIdEvents)return;let t=this._subIdEvents[e];if(t){delete this._subIdEvents[e];let n=this._eventSubs[t];n&&(delete n[e],this._eventSubsNum[t]--),this._subIdMap.removeItem(e)}}once(e,t,n){let r=this,i=this.on(e,function(e){r.off(i),t.call(n||this,e)},n)}hasSubs(e){return this._eventSubsNum&&this._eventSubsNum[e]>0}log(e){e=`[LOG]`+this._message(e),window.console.log(e),this.scene.fire(`log`,e)}_message(e){return` [`+this.type+` `+JD.inQuotes(this.id)+`]: `+e}warn(e){e=`[WARN]`+this._message(e),window.console.warn(e),this.scene.fire(`warn`,e)}error(e){e=`[ERROR]`+this._message(e),window.console.error(e),this.scene.fire(`error`,e)}_attach(e){let t=e.name;if(!t){this.error(`Component 'name' expected`);return}let n=e.component,r=e.sceneDefault,i=e.sceneSingleton,a=e.type,o=e.on,s=e.recompiles!==!1;if(n&&(JD.isNumeric(n)||JD.isString(n))){let e=n;if(n=this.scene.components[e],!n){this.error(`Component not found: `+JD.inQuotes(e));return}}if(!n){if(i===!0){let e=this.scene.types[a];for(let t in e)if(e.hasOwnProperty){n=e[t];break}if(!n)return this.error(`Scene has no default component for '`+t+`'`),null}else if(r===!0&&(n=this.scene[t],!n))return this.error(`Scene has no default component for '`+t+`'`),null}if(n){if(n.scene.id!==this.scene.id){this.error(`Not in same scene: `+n.type+` `+JD.inQuotes(n.id));return}if(a&&!n.isType(a)){this.error(`Expected a `+a+` type or subtype: `+n.type+` `+JD.inQuotes(n.id));return}}this._attachments||={};let c=this._attached[t],l,u,d;if(c){if(n&&c.id===n.id)return;let e=this._attachments[c.id];for(l=e.subs,u=0,d=l.length;u<d;u++)c.off(l[u]);delete this._attached[t],delete this._attachments[c.id];let r=e.params.onDetached;r&&(JD.isFunction(r)?r(c):r.scope?r.callback.call(r.scope,c):r.callback(c)),e.managingLifecycle&&c.destroy()}if(n){let r={params:e,component:n,subs:[],managingLifecycle:!1};r.subs.push(n.once(`destroyed`,function(){r.params.component=null,this._attach(r.params)},this)),s&&r.subs.push(n.on(`dirty`,function(){this.fire(`dirty`,this)},this)),this._attached[t]=n,this._attachments[n.id]=r;let i=e.onAttached;if(i&&(JD.isFunction(i)?i(n):i.scope?i.callback.call(i.scope,n):i.callback(n)),o){let e,t,i,a;for(e in o)if(o.hasOwnProperty(e)){if(t=o[e],JD.isFunction(t)?(i=t,a=null):(i=t.callback,a=t.scope),!i)continue;r.subs.push(n.on(e,i,a))}}}return s&&this.fire(`dirty`,this),this.fire(t,n),n}_checkComponent(e,t){if(!t.isComponent)if(JD.isID(t)){let e=t;if(t=this.scene.components[e],!t){this.error(`Component not found: `+e);return}}else{this.error(`Expected a Component or ID`);return}if(e!==t.type){this.error(`Expected a `+e+` Component`);return}if(t.scene.id!==this.scene.id){this.error(`Not in same scene: `+t.type);return}return t}_checkComponent2(e,t){if(!t.isComponent)if(JD.isID(t)){let e=t;if(t=this.scene.components[e],!t){this.error(`Component not found: `+e);return}}else{this.error(`Expected a Component or ID`);return}if(t.scene.id!==this.scene.id){this.error(`Not in same scene: `+t.type);return}for(var n=0,r=e.length;n<r;n++)if(e[n]===t.type)return t;return this.error(`Expected component types: `+e),null}_own(e){this._ownedComponents||={},this._ownedComponents[e.id]||(this._ownedComponents[e.id]=e),e.once(`destroyed`,()=>{delete this._ownedComponents[e.id]},this)}_needUpdate(e){this._updateScheduled||(this._updateScheduled=!0,e===0?this._doUpdate():aO.scheduleTask(this._doUpdate,this))}_doUpdate(){this._updateScheduled&&(this._updateScheduled=!1,this._update&&this._update())}scheduleTask(e){aO.scheduleTask(e,null)}_update(){}clear(){if(this._ownedComponents)for(var e in this._ownedComponents)this._ownedComponents.hasOwnProperty(e)&&(this._ownedComponents[e].destroy(),delete this._ownedComponents[e])}destroy(){if(this.destroyed)return;this.fire(`destroyed`,this.destroyed=!0);let e,t,n,r,i,a;if(this._attachments){for(e in this._attachments)if(this._attachments.hasOwnProperty(e)){for(t=this._attachments[e],n=t.component,r=t.subs,i=0,a=r.length;i<a;i++)n.off(r[i]);t.managingLifecycle&&n.destroy()}}if(this._ownedComponents)for(e in this._ownedComponents)this._ownedComponents.hasOwnProperty(e)&&(n=this._ownedComponents[e],n.destroy(),delete this._ownedComponents[e]);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}},y$e=Y.vec3(),b$e=Y.vec3(),x$e=Y.mat4(),uO=class{constructor(){this.normal=Y.vec3(),this.offset=0,this.testVertex=Y.vec3()}set(e,t,n,r){let i=1/Math.sqrt(e*e+t*t+n*n);this.normal[0]=e*i,this.normal[1]=t*i,this.normal[2]=n*i,this.offset=r*i,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}},dO=class{constructor(){this.planes=[new uO,new uO,new uO,new uO,new uO,new uO]}};dO.INSIDE=0,dO.INTERSECT=1,dO.OUTSIDE=2;function fO(e,t,n){let r=Y.mulMat4(n,t,x$e),i=r[0],a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],u=r[6],d=r[7],f=r[8],p=r[9],m=r[10],h=r[11],g=r[12],_=r[13],v=r[14],y=r[15];e.planes[0].set(s-i,d-c,h-f,y-g),e.planes[1].set(s+i,d+c,h+f,y+g),e.planes[2].set(s-a,d-l,h-p,y-_),e.planes[3].set(s+a,d+l,h+p,y+_),e.planes[4].set(s-o,d-u,h-m,y-v),e.planes[5].set(s+o,d+u,h+m,y+v)}function pO(e,t){let n=dO.INSIDE,r=y$e,i=b$e;r[0]=t[0],r[1]=t[1],r[2]=t[2],i[0]=t[3],i[1]=t[4],i[2]=t[5];let a=[r,i];for(let t=0;t<6;++t){let r=e.planes[t];if(r.normal[0]*a[r.testVertex[0]][0]+r.normal[1]*a[r.testVertex[1]][1]+r.normal[2]*a[r.testVertex[2]][2]+r.offset<0)return dO.OUTSIDE;r.normal[0]*a[1-r.testVertex[0]][0]+r.normal[1]*a[1-r.testVertex[1]][1]+r.normal[2]*a[1-r.testVertex[2]][2]+r.offset<0&&(n=dO.INTERSECT)}return n}var mO=class e extends lO{constructor(e={}){if(!e.viewer)throw`[MarqueePicker] Missing config: viewer`;if(!e.objectsKdTree3)throw`[MarqueePicker] Missing config: objectsKdTree3`;super(e.viewer.scene,e),this.viewer=e.viewer,this._objectsKdTree3=e.objectsKdTree3,this._canvasMarqueeCorner1=Y.vec2(),this._canvasMarqueeCorner2=Y.vec2(),this._canvasMarquee=Y.AABB2(),this._marqueeFrustum=new dO,this._marqueeFrustumProjMat=Y.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(e){this._canvasMarqueeCorner1.set(e),this._canvasMarqueeCorner2.set(e),this._updateMarquee()}setMarqueeCorner2(e){this._canvasMarqueeCorner2.set(e),this._updateMarquee()}setMarquee(e,t){this._canvasMarqueeCorner1.set(e),this._canvasMarqueeCorner2.set(t),this._updateMarquee()}setMarqueeVisible(e){this._marqueVisible=e,this._marqueeElement.style.visibility=e?`visible`:`hidden`}getMarqueeVisible(){return this._marqueVisible}setPickMode(t){if(t!==e.PICK_MODE_INSIDE&&t!==e.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===e.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=[],n=(r,i=dO.INTERSECT)=>{if(i===dO.INTERSECT&&(i=pO(this._marqueeFrustum,r.aabb)),i!==dO.OUTSIDE){if(r.entities){let n=r.entities;for(let r=0,i=n.length;r<i;r++){let i=n[r];if(!i.visible)continue;let a=i.aabb;this._pickMode===e.PICK_MODE_INSIDE?pO(this._marqueeFrustum,a)===dO.INSIDE&&t.push(i.id):pO(this._marqueeFrustum,a)!==dO.OUTSIDE&&t.push(i.id)}}r.left&&n(r.left,i),r.right&&n(r.right,i)}};return(this._canvasMarquee[2]-this._canvasMarquee[0]>3||this._canvasMarquee[3]-this._canvasMarquee[1]>3)&&n(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 e=this.viewer.scene.canvas.canvas,t=e.clientWidth,n=e.clientHeight,r=e.clientLeft,i=e.clientTop,a=2/t,o=2/n,s=e.clientHeight/e.clientWidth,c=(this._canvasMarquee[0]-r)*a+-1,l=(this._canvasMarquee[2]-r)*a+-1,u=-(this._canvasMarquee[3]-i)*o+1,d=-(this._canvasMarquee[1]-i)*o+1,f=this.viewer.scene.camera.frustum.near*(17*s);Y.frustumMat4(c,l,u*s,d*s,f,1e4,this._marqueeFrustumProjMat),fO(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)}};mO.PICK_MODE_INTERSECTS=0,mO.PICK_MODE_INSIDE=1;var S$e=class extends lO{constructor(e){super(e.marqueePicker,e);let t=e.marqueePicker,n=t.viewer.scene.canvas.canvas,r,i,a,o,s,c,l=!1,u=!1,d=!1,f;n.addEventListener(`mousedown`,e=>{this.getActive()&&e.button===0&&(f=setTimeout(function(){let a=t.viewer.scene.input;a.keyDown[a.KEY_CTRL]||t.clear(),r=e.pageX,i=e.pageY,s=e.offsetX,e.offsetY,t.setMarqueeCorner1([r,i]),l=!0,t.viewer.cameraControl.pointerEnabled=!1,t.setMarqueeVisible(!0),n.style.cursor=`crosshair`},400),u=!0)}),n.addEventListener(`mouseup`,e=>{if(!this.getActive()||!l&&!d||e.button!==0)return;clearTimeout(f),a=e.pageX,o=e.pageY;let n=Math.abs(a-r),s=Math.abs(o-i);l=!1,t.viewer.cameraControl.pointerEnabled=!0,d&&=!1,(n>3||s>3)&&t.pick()}),document.addEventListener(`mouseup`,e=>{this.getActive()&&e.button===0&&(clearTimeout(f),l&&(t.setMarqueeVisible(!1),l=!1,u=!1,d=!0,t.viewer.cameraControl.pointerEnabled=!0))},!0),n.addEventListener(`mousemove`,e=>{this.getActive()&&e.button===0&&u&&(clearTimeout(f),l&&(a=e.pageX,o=e.pageY,c=e.offsetX,e.offsetY,t.setMarqueeVisible(!0),t.setMarqueeCorner2([a,o]),t.setPickMode(s<c?mO.PICK_MODE_INSIDE:mO.PICK_MODE_INTERSECTS)))})}setActive(e){this._active!==e&&(this._active=e,this.fire(`active`,this._active))}getActive(){return this._active}destroy(){}},hO=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,n,r=e=>{if(!this._running)return;n||=e;let i=e-n,a=Math.min(i/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)}},gO=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 n=this._messages[this._locale];if(!n)return null;let r=_O(e,n);return r?t?vO(r,t):r:null}translatePlurals(e,t,n){let r=this._messages[this._locale];if(!r)return null;let i=_O(e,r);return t=parseInt(``+t,10),i=t===0?i.zero:t>1?i.other:i.one,i?(i=vO(i,[t]),n&&(i=vO(i,n)),i):null}fire(e,t,n){this._events||={},this._eventSubs||={},n!==!0&&(this._events[e]=t||!0);let r=this._eventSubs[e];if(r)for(let e in r)r.hasOwnProperty(e)&&r[e].callback(t)}on(e,t){this._events||={},this._eventSubIDMap||=new ID,this._eventSubEvents||={},this._eventSubs||={};let n=this._eventSubs[e];n||(n={},this._eventSubs[e]=n);let r=this._eventSubIDMap.addItem();n[r]={callback:t},this._eventSubEvents[r]=e;let i=this._events[e];return i!==void 0&&t(i),r}off(e){if(e==null||!this._eventSubEvents)return;let t=this._eventSubEvents[e];if(t){delete this._eventSubEvents[e];let n=this._eventSubs[t];n&&delete n[e],this._eventSubIDMap.removeItem(e)}}};function _O(e,t){if(t[e])return t[e];let n=e.split(`.`),r=t;for(let e=0,t=n.length;r&&e<t;e++){let t=n[e];r=r[t]}return r}function vO(e,t=[]){return e.replace(/\{\{|\}\}|\{(\d+)\}/g,function(e,n){return e===`{{`?`{`:e===`}}`?`}`:t[n]})}var yO=class extends lO{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 n=e-t,r=e+t;n<0&&(n=0),r>1&&(r=1);var i=this.getPoint(n),a=this.getPoint(r),o=Y.subVec3(a,i,[]);return Y.normalizeVec3(o,[])}getPointAt(e){var t=this.getUToTMapping(e);return this.getPoint(t)}getPoints(e){e||=5;var t,n=[];for(t=0;t<=e;t++)n.push(this.getPoint(t/e));return n}_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=[],n,r=this.getPoint(0),i,a=0;for(t.push(0),i=1;i<=e;i++)n=this.getPoint(i/e),a+=Y.lenVec3(Y.subVec3(n,r,[])),t.push(a),r=n;return this.cacheArcLengths=t,t}_updateArcLengths(){this.needsUpdate=!0,this._getLengths()}getUToTMapping(e,t){for(var n=this._getLengths(),r=0,i=n.length,a,o=t||e*n[i-1],s=0,c=i-1,l;s<=c;)if(r=Math.floor(s+(c-s)/2),l=n[r]-o,l<0)s=r+1;else if(l>0)c=r-1;else{c=r;break}if(r=c,n[r]===o)return a=r/(i-1),a;var u=n[r],d=n[r+1]-u,f=(o-u)/d;return a=(r+f)/(i-1),a}},bO=class extends yO{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 n=(t.length-1)*e,r=Math.floor(n),i=n-r,a=t[r===0?r:r-1],o=t[r],s=t[r>t.length-2?t.length-1:r+1],c=t[r>t.length-3?t.length-1:r+2],l=Y.vec3();return l[0]=Y.catmullRomInterpolate(a[0],o[0],s[0],c[0],i),l[1]=Y.catmullRomInterpolate(a[1],o[1],s[1],c[1],i),l[2]=Y.catmullRomInterpolate(a[2],o[2],s[2],c[2],i),l}getJSON(){return{points,t:this._t}}},xO=Y.vec3(),C$e=class extends lO{get type(){return`CameraPath`}constructor(e,t={}){super(e,t),this._frames=[],this._eyeCurve=new bO(this),this._lookCurve=new bO(this),this._upCurve=new bO(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,n,r){let i={t:e,eye:t.slice(0),look:n.slice(0),up:r.slice(0)};this._frames.push(i),this._eyeCurve.points.push(i.eye),this._lookCurve.points.push(i.look),this._upCurve.points.push(i.up)}addFrames(e){let t;for(let n=0,r=e.length;n<r;n++)t=e[n],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,xO),t.look=this._lookCurve.getPoint(e,xO),t.up=this._upCurve.getPoint(e,xO)}sampleFrame(e,t,n,r){e=e<0?0:e>1?1:e,this._eyeCurve.getPoint(e,t),this._lookCurve.getPoint(e,n),this._upCurve.getPoint(e,r)}smoothFrameTimes(e){if(this._frames.length===0)return;let t=Y.vec3();var n=0;this._frames[0].t=0;let r=[];for(let e=1,a=this._frames.length;e<a;e++){var i=Y.lenVec3(Y.subVec3(this._frames[e].eye,this._frames[e-1].eye,t));r[e]=i,n+=i}for(let t=1,i=this._frames.length;t<i;t++){let i=r[t]/n*e;this._frames[t].t=this._frames[t-1].t+i}}clearFrames(){this._frames=[],this._eyeCurve.points=[],this._lookCurve.points=[],this._upCurve.points=[]}},SO=Y.vec3(),CO=Y.vec3(),wO=Y.vec3(),TO=Y.vec3(),EO=Y.vec3(),DO=class e extends lO{get type(){return`CameraFlightAnimation`}constructor(e,t={}){super(e,t),this._look1=Y.vec3(),this._eye1=Y.vec3(),this._up1=Y.vec3(),this._look2=Y.vec3(),this._eye2=Y.vec3(),this._up2=Y.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=t.easing!==!1,this.duration=t.duration,this.fit=t.fit,this.fitFOV=t.fitFOV,this.trail=t.trail}flyTo(e,t,n){e||=this.scene,this._flying&&this.stop(),this._flying=!1,this._flyingEye=!1,this._flyingLook=!1,this._flyingEyeLookUp=!1,this._callback=t,this._callbackScope=n;let r=this.scene.camera,i=!!e.projection&&e.projection!==r.projection;this._eye1[0]=r.eye[0],this._eye1[1]=r.eye[1],this._eye1[2]=r.eye[2],this._look1[0]=r.look[0],this._look1[1]=r.look[1],this._look1[2]=r.look[2],this._up1[0]=r.up[0],this._up1[1]=r.up[1],this._up1[2]=r.up[2],this._orthoScale1=r.ortho.scale,this._orthoScale2=e.orthoScale||this._orthoScale1;let a,o,s,c,l;if(e.aabb)a=e.aabb;else if(e.length===6)a=e;else if(e.eye&&e.look||e.up)o=e.eye,s=e.look,c=e.up;else if(e.eye)o=e.eye;else if(e.look)s=e.look;else{let r=e;if((JD.isNumeric(r)||JD.isString(r))&&(l=r,r=this.scene.components[l],!r)){this.error(`Component not found: `+JD.inQuotes(l)),t&&(n?t.call(n):t());return}i||(a=r.aabb||this.scene.aabb)}let u=e.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 t=Y.getAABB3Center(a);this._look2=u||t;let n=Y.subVec3(this._eye1,this._look1,SO),r=Y.normalizeVec3(n),i=u?Y.getAABB3DiagPoint(a,u):Y.getAABB3Diag(a),o=e.fitFOV||this._fitFOV,s=Math.abs(i/Math.tan(o*Y.DEGTORAD));this._orthoScale2=i*1.1,this._eye2[0]=this._look2[0]+r[0]*s,this._eye2[1]=this._look2[1]+r[1]*s,this._eye2[2]=this._look2[2]+r[2]*s,this._up2[0]=this._up1[0],this._up2[1]=this._up1[1],this._up2[2]=this._up1[2],this._flyingEyeLookUp=!0}else (o||s||c)&&(this._flyingEyeLookUp=!!o&&!!s&&!!c,this._flyingEye=!!o&&!s,this._flyingLook=!!s&&!o,o&&(this._eye2[0]=o[0],this._eye2[1]=o[1],this._eye2[2]=o[2]),s&&(this._look2[0]=s[0],this._look2[1]=s[1],this._look2[2]=s[2]),c&&(this._up2[0]=c[0],this._up2[1]=c[1],this._up2[2]=c[2]));i?(e.projection===`ortho`&&r.projection!==`ortho`&&(this._projection2=`ortho`,this._projMatrix1=r.projMatrix.slice(),this._projMatrix2=r.ortho.matrix.slice(),r.projection=`customProjection`),e.projection===`perspective`&&r.projection!==`perspective`&&(this._projection2=`perspective`,this._projMatrix1=r.projMatrix.slice(),this._projMatrix2=r.perspective.matrix.slice(),r.projection=`customProjection`)):this._projection2=null,this.fire(`started`,e,!0),this._time1=Date.now(),this._time2=this._time1+(Number.isFinite(e.duration)?e.duration*1e3:this._duration),this._flying=!0,aO.scheduleTask(this._update,this)}jumpTo(e){this._jumpTo(e)}_jumpTo(e){this._flying&&this.stop();let t=this.scene.camera;var n,r,i,a,o;if(e.aabb)n=e.aabb;else if(e.length===6)n=e;else if(e.eye||e.look||e.up)i=e.eye,a=e.look,o=e.up;else{let t=e;if((JD.isNumeric(t)||JD.isString(t))&&(r=t,t=this.scene.components[r],!t)){this.error(`Component not found: `+JD.inQuotes(r));return}n=t.aabb||this.scene.aabb}let s=e.poi;if(n){if(n[3]<=n[0]||n[4]<=n[1]||n[5]<=n[2])return;var c=s?Y.getAABB3DiagPoint(n,s):Y.getAABB3Diag(n);a=s||Y.getAABB3Center(n,a),this._trail?Y.subVec3(t.look,a,EO):Y.subVec3(t.eye,t.look,EO),Y.normalizeVec3(EO);let r;r=(e.fit===void 0?this._fit:e.fit)?Math.abs(c/Math.tan((e.fitFOV||this._fitFOV)*Y.DEGTORAD)):Y.lenVec3(Y.subVec3(t.eye,t.look,SO)),Y.mulVec3Scalar(EO,r),t.eye=Y.addVec3(a,EO,SO),t.look=a,this.scene.camera.ortho.scale=c*1.1}else (i||a||o)&&(i&&(t.eye=i),a&&(t.look=a),o&&(t.up=o));e.projection&&(t.projection=e.projection)}_update(){if(!this._flying)return;let t=(Date.now()-this._time1)/(this._time2-this._time1),n=t>=1;t>1&&(t=1);let r=this.easing?e._ease(t,0,1,1):t,i=this.scene.camera;if(this._flyingEye||this._flyingLook?this._flyingEye?(Y.subVec3(i.eye,i.look,EO),i.eye=Y.lerpVec3(r,0,1,this._eye1,this._eye2,wO),i.look=Y.subVec3(wO,EO,CO)):this._flyingLook&&(i.look=Y.lerpVec3(r,0,1,this._look1,this._look2,CO),i.up=Y.lerpVec3(r,0,1,this._up1,this._up2,TO)):this._flyingEyeLookUp&&(i.eye=Y.lerpVec3(r,0,1,this._eye1,this._eye2,wO),i.look=Y.lerpVec3(r,0,1,this._look1,this._look2,CO),i.up=Y.lerpVec3(r,0,1,this._up1,this._up2,TO)),this._projection2){let n=this._projection2===`ortho`?e._easeOutExpo(t,0,1,1):e._easeInCubic(t,0,1,1);i.customProjection.matrix=Y.lerpMat4(n,0,1,this._projMatrix1,this._projMatrix2)}else i.ortho.scale=this._orthoScale1+t*(this._orthoScale2-this._orthoScale1);if(n){i.ortho.scale=this._orthoScale2,this.stop();return}aO.scheduleTask(this._update,this)}static _ease(e,t,n,r){return e/=r,-n*e*(e-2)+t}static _easeInCubic(e,t,n,r){return e/=r,n*e*e*e+t}static _easeOutExpo(e,t,n,r){return n*(-(2**(-10*e/r))+1)+t}stop(){if(!this._flying)return;this._flying=!1,this._time1=null,this._time2=null,this._projection2&&(this.scene.camera.projection=this._projection2);let e=this._callback;e&&(this._callback=null,this._callbackScope?e.call(this._callbackScope):e()),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(e){this._duration=Number.isFinite(e)?e*1e3:500,this.stop()}get duration(){return this._duration/1e3}set fit(e){this._fit=e!==!1}get fit(){return this._fit}set fitFOV(e){this._fitFOV=e||45}get fitFOV(){return this._fitFOV}set trail(e){this._trail=!!e}get trail(){return this._trail}destroy(){this.stop(),super.destroy()}},OO=class e extends lO{get type(){return`CameraPathAnimation`}constructor(t,n={}){super(t,n),this._cameraFlightAnimation=new DO(this),this._t=0,this.state=e.SCRUBBING,this._playingFromT=0,this._playingToT=0,this._playingRate=n.playingRate||1,this._playingDir=1,this._lastTime=null,this.cameraPath=n.cameraPath,this._tick=this.scene.on(`tick`,this._updateT,this)}_updateT(){let t=this._cameraPath;if(!t)return;let n,r,i=performance.now(),a=this._lastTime?(i-this._lastTime)*.001:0;if(this._lastTime=i,a!==0)switch(this.state){case e.SCRUBBING:return;case e.PLAYING:if(this._t+=this._playingRate*a,n=this._cameraPath.frames.length,n===0||this._playingDir<0&&this._t<=0||this._playingDir>0&&this._t>=this._cameraPath.frames[n-1].t){this.state=e.SCRUBBING,this._t=this._cameraPath.frames[n-1].t,this.fire(`stopped`);return}t.loadFrame(this._t);break;case e.PLAYING_TO:r=this._t+this._playingRate*a*this._playingDir,(this._playingDir<0&&r<=this._playingToT||this._playingDir>0&&r>=this._playingToT)&&(r=this._playingToT,this.state=e.SCRUBBING,this.fire(`stopped`)),this._t=r,t.loadFrame(this._t);break}}_ease(e,t,n,r){return e/=r,-n*e*(e-2)+t}set cameraPath(e){this._cameraPath=e}get cameraPath(){return this._cameraPath}set rate(e){this._playingRate=e}get rate(){return this._playingRate}play(){this._cameraPath&&(this._lastTime=null,this.state=e.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=e.PLAYING_TO)}playToFrame(e){let t=this._cameraPath;if(!t)return;let n=t.frames[e];if(!n){this.error(`playToFrame - frame index out of range: `+e);return}this.playToT(n.t)}flyToFrame(t,n){let r=this._cameraPath;if(!r)return;let i=r.frames[t];if(!i){this.error(`flyToFrame - frame index out of range: `+t);return}this.state=e.SCRUBBING,this._cameraFlightAnimation.flyTo(i,n)}scrubToT(t){let n=this._cameraPath;n&&this.scene.camera&&(this._t=t,n.loadFrame(this._t),this.state=e.SCRUBBING)}scrubToFrame(t){let n=this._cameraPath;if(n&&this.scene.camera){if(!n.frames[t]){this.error(`playToFrame - frame index out of range: `+t);return}n.loadFrame(this._t),this.state=e.SCRUBBING}}stop(){this.state=e.SCRUBBING,this.fire(`stopped`)}destroy(){super.destroy(),this.scene.off(this._tick)}};OO.STOPPED=0,OO.SCRUBBING=1,OO.PLAYING=2,OO.PLAYING_TO=3;var kO=class extends lO{get type(){return`Geometry`}get isGeometry(){return!0}constructor(e,t={}){super(e,t),GD.memory.meshes++}destroy(){super.destroy(),GD.memory.meshes--}},AO=new ID({}),jO=class{constructor(e){this.id=AO.addItem({});for(let t in e)e.hasOwnProperty(t)&&(this[t]=e[t])}destroy(){AO.removeItem(this.id)}},MO=class{constructor(e,t,n,r,i,a,o,s,c){switch(this._gl=e,this.type=t,this.allocated=!1,this.ConstructorType=n.constructor,n.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=a,this.length=0,this.dataLength=r,this.numItems=0,this.itemSize=i,this.normalized=!!o,this.stride=s||0,this.offset=c||0,this._allocate(n)}_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 n=new this.ConstructorType(t*this.itemSize);return this._gl.bindBuffer(this.type,this._handle),this._gl.getBufferSubData(this.type,e*this.itemByteSize*this.itemSize,n,0,t*this.itemSize),n}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)}},NO=(function(){let e=[],t=[],n=[],r=[],i=[],a=0,o=new Uint16Array(3),s=new Uint16Array(3),c=new Uint16Array(3),l=Y.vec3(),u=Y.vec3(),d=Y.vec3(),f=Y.vec3(),p=Y.vec3(),m=Y.vec3(),h=Y.vec3();function g(i,a){let o={},s,c,l,u,d=10**4,f,p,m=0;for(f=0,p=i.length;f<p;f+=3)s=i[f],c=i[f+1],l=i[f+2],u=Math.round(s*d)+`_`+Math.round(c*d)+`_`+Math.round(l*d),o[u]===void 0&&(o[u]=m/3,e[m++]=s,e[m++]=c,e[m++]=l),t[f/3]=o[u];for(f=0,p=a.length;f<p;f++)r[f]=t[a[f]],n[r[f]]=a[f]}function _(t,n){a=0;for(let g=0,_=t;g<_;g+=3){let t=r[g]*3,_=r[g+1]*3,v=r[g+2]*3;n?(o[0]=e[t],o[1]=e[t+1],o[2]=e[t+2],s[0]=e[_],s[1]=e[_+1],s[2]=e[_+2],c[0]=e[v],c[1]=e[v+1],c[2]=e[v+2],Y.decompressPosition(o,n,l),Y.decompressPosition(s,n,u),Y.decompressPosition(c,n,d)):(l[0]=e[t],l[1]=e[t+1],l[2]=e[t+2],u[0]=e[_],u[1]=e[_+1],u[2]=e[_+2],d[0]=e[v],d[1]=e[v+1],d[2]=e[v+2]),Y.subVec3(d,u,f),Y.subVec3(l,u,p),Y.cross3Vec3(f,p,m),Y.normalizeVec3(m,h);let y=i[a]||(i[a]={normal:Y.vec3()});y.normal[0]=h[0],y.normal[1]=h[1],y.normal[2]=h[2],a++}}return function(e,t,a,o){g(e,t),_(t.length,a);let s=[],c=Math.cos(Y.DEGTORAD*o),l={},u,d,f,p,m,h=!1,v,y,b,x,S,C;for(let e=0,n=t.length;e<n;e+=3){let t=e/3;for(let n=0;n<3;n++)u=r[e+n],d=r[e+(n+1)%3],f=Math.min(u,d),p=Math.max(u,d),m=f+`,`+p,l[m]===void 0?l[m]={index1:f,index2:p,face1:t,face2:void 0}:l[m].face2=t}for(m in l)v=l[m],!(v.face2!==void 0&&(y=i[v.face1].normal,b=i[v.face2].normal,x=Y.dotVec3(y,b),x>c))&&(S=n[v.index1],C=n[v.index2],(!h&&S>65535||C>65535)&&(h=!0),s.push(S),s.push(C));return h?new Uint32Array(s):new Uint16Array(s)}})();function w$e(e){let t=new Float32Array(3),n=new Float32Array(3),r,i;for(r=0;r<3;r++)t[r]=Number.MAX_VALUE,n[r]=-Number.MAX_VALUE;for(r=0;r<e.length;r+=3)for(i=0;i<3;i++)t[i]=Math.min(t[i],e[r+i]),n[i]=Math.max(n[i],e[r+i]);return{min:t,max:n}}var T$e=(function(){let e=Y.mat4(),t=Y.mat4();return function(n,r){r||=Y.mat4();let i=n[0],a=n[1],o=n[2],s=n[3]-i,c=n[4]-a,l=n[5]-o,u=65535;return Y.identityMat4(e),Y.translationMat4v(n,e),Y.identityMat4(t),Y.scalingMat4v([s/u,c/u,l/u],t),Y.mulMat4(e,t,r),r}})(),E$e=(function(){let e=Y.mat4(),t=Y.mat4();return function(n,r,i){let a=new Uint16Array(n.length),o=new Float32Array([i[0]===r[0]?0:65535/(i[0]-r[0]),i[1]===r[1]?0:65535/(i[1]-r[1]),i[2]===r[2]?0:65535/(i[2]-r[2])]),s;for(s=0;s<n.length;s+=3)a[s+0]=Math.max(0,Math.min(65535,Math.floor((n[s+0]-r[0])*o[0]))),a[s+1]=Math.max(0,Math.min(65535,Math.floor((n[s+1]-r[1])*o[1]))),a[s+2]=Math.max(0,Math.min(65535,Math.floor((n[s+2]-r[2])*o[2])));return Y.identityMat4(e),Y.translationMat4v(r,e),Y.identityMat4(t),Y.scalingMat4v([(i[0]-r[0])/65535,(i[1]-r[1])/65535,(i[2]-r[2])/65535],t),{quantized:a,decodeMatrix:Y.mulMat4(e,t,Y.identityMat4())}}})();function D$e(e,t,n){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])]);n[0]=Math.max(0,Math.min(65535,Math.floor((e[0]-t[0])*r[0]))),n[1]=Math.max(0,Math.min(65535,Math.floor((e[1]-t[1])*r[1]))),n[2]=Math.max(0,Math.min(65535,Math.floor((e[2]-t[2])*r[2])))}function O$e(e,t,n){return n[0]=e[0]*t[0]+t[12],n[1]=e[1]*t[5]+t[13],n[2]=e[2]*t[10]+t[14],n}function k$e(e,t,n=e){return n[0]=e[0]*t[0]+t[12],n[1]=e[1]*t[5]+t[13],n[2]=e[2]*t[10]+t[14],n[3]=e[3]*t[0]+t[12],n[4]=e[4]*t[5]+t[13],n[5]=e[5]*t[10]+t[14],n}function A$e(e,t,n=new Float32Array(e.length)){for(let r=0,i=e.length;r<i;r+=3)n[r+0]=e[r+0]*t[0]+t[12],n[r+1]=e[r+1]*t[5]+t[13],n[r+2]=e[r+2]*t[10]+t[14];return n}function j$e(e){let t=new Float32Array(2),n=new Float32Array(2),r,i;for(r=0;r<2;r++)t[r]=Number.MAX_VALUE,n[r]=-Number.MAX_VALUE;for(r=0;r<e.length;r+=2)for(i=0;i<2;i++)t[i]=Math.min(t[i],e[r+i]),n[i]=Math.max(n[i],e[r+i]);return{min:t,max:n}}var M$e=(function(){let e=Y.mat3(),t=Y.mat3();return function(n,r,i){let a=new Uint16Array(n.length),o=new Float32Array([65535/(i[0]-r[0]),65535/(i[1]-r[1])]),s;for(s=0;s<n.length;s+=2)a[s+0]=Math.max(0,Math.min(65535,Math.floor((n[s+0]-r[0])*o[0]))),a[s+1]=Math.max(0,Math.min(65535,Math.floor((n[s+1]-r[1])*o[1])));return Y.identityMat3(e),Y.translationMat3v(r,e),Y.identityMat3(t),Y.scalingMat3v([(i[0]-r[0])/65535,(i[1]-r[1])/65535],t),{quantized:a,decodeMatrix:Y.mulMat3(e,t,Y.identityMat3())}}})();function N$e(e){let t=new Int8Array(e.length),n,r,i,a,o;for(let s=0;s<e.length;s+=3)i=n=PO(e,s,`floor`,`floor`),r=FO(n),a=o=IO(e,s,r),n=PO(e,s,`ceil`,`floor`),r=FO(n),a=IO(e,s,r),a>o&&(i=n,o=a),n=PO(e,s,`floor`,`ceil`),r=FO(n),a=IO(e,s,r),a>o&&(i=n,o=a),n=PO(e,s,`ceil`,`ceil`),r=FO(n),a=IO(e,s,r),a>o&&(i=n,o=a),t[s]=i[0],t[s+1]=i[1];return t}function PO(e,t,n,r){let i=e[t]/(Math.abs(e[t])+Math.abs(e[t+1])+Math.abs(e[t+2])),a=e[t+1]/(Math.abs(e[t])+Math.abs(e[t+1])+Math.abs(e[t+2]));if(e[t+2]<0){let e=(1-Math.abs(a))*(i>=0?1:-1),t=(1-Math.abs(i))*(a>=0?1:-1);i=e,a=t}return new Int8Array([Math[n](i*127.5+(i<0?-1:0)),Math[r](a*127.5+(a<0?-1:0))])}function FO(e){let t=e[0],n=e[1];t/=t<0?127:128,n/=n<0?127:128;let r=1-Math.abs(t)-Math.abs(n);r<0&&(t=(1-Math.abs(n))*(t>=0?1:-1),n=(1-Math.abs(t))*(n>=0?1:-1));let i=Math.sqrt(t*t+n*n+r*r);return[t/i,n/i,r/i]}function IO(e,t,n){return e[t]*n[0]+e[t+1]*n[1]+e[t+2]*n[2]}function P$e(e,t,n){n[0]=e[0]*t[0]+t[6],n[1]=e[1]*t[4]+t[7]}function F$e(e,t,n=new Float32Array(e.length)){for(let r=0,i=e.length;r<i;r+=3)n[r+0]=e[r+0]*t[0]+t[6],n[r+1]=e[r+1]*t[4]+t[7];return n}function I$e(e,t){let n=e[0],r=e[1];n=(2*n+1)/255,r=(2*r+1)/255;let i=1-Math.abs(n)-Math.abs(r);i<0&&(n=(1-Math.abs(r))*(n>=0?1:-1),r=(1-Math.abs(n))*(r>=0?1:-1));let a=Math.sqrt(n*n+r*r+i*i);return t[0]=n/a,t[1]=r/a,t[2]=i/a,t}function L$e(e,t){for(let n=0,r=0,i=e.length;n<i;n+=2){let i=e[n+0],a=e[n+1];i=(2*i+1)/255,a=(2*a+1)/255;let o=1-Math.abs(i)-Math.abs(a);o<0&&(i=(1-Math.abs(a))*(i>=0?1:-1),a=(1-Math.abs(i))*(a>=0?1:-1));let s=Math.sqrt(i*i+a*a+o*o);t[r+0]=i/s,t[r+1]=a/s,t[r+2]=o/s,r+=3}return t}var LO={getPositionsBounds:w$e,createPositionsDecodeMatrix:T$e,compressPositions:E$e,compressPosition:D$e,decompressPositions:A$e,decompressPosition:O$e,decompressAABB:k$e,getUVBounds:j$e,compressUVs:M$e,decompressUVs:F$e,decompressUV:P$e,compressNormals:N$e,decompressNormals:L$e,decompressNormal:I$e},RO=GD.memory,zO=Y.AABB3(),BO=class extends kO{get type(){return`ReadableGeometry`}get isReadableGeometry(){return!0}constructor(e,t={}){super(e,t),this._state=new jO({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 n=this._state,r=this.scene.canvas.gl;switch(t.primitive=t.primitive||`triangles`,t.primitive){case`points`:n.primitive=r.POINTS,n.primitiveName=t.primitive;break;case`lines`:n.primitive=r.LINES,n.primitiveName=t.primitive;break;case`line-loop`:n.primitive=r.LINE_LOOP,n.primitiveName=t.primitive;break;case`line-strip`:n.primitive=r.LINE_STRIP,n.primitiveName=t.primitive;break;case`triangles`:n.primitive=r.TRIANGLES,n.primitiveName=t.primitive;break;case`triangle-strip`:n.primitive=r.TRIANGLE_STRIP,n.primitiveName=t.primitive;break;case`triangle-fan`:n.primitive=r.TRIANGLE_FAN,n.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'.`),n.primitive=r.TRIANGLES,n.primitiveName=t.primitive}if(t.positions)if(this._state.compressGeometry){let e=LO.getPositionsBounds(t.positions),r=LO.compressPositions(t.positions,e.min,e.max);n.positions=r.quantized,n.positionsDecodeMatrix=r.decodeMatrix}else n.positions=t.positions.constructor===Float32Array?t.positions:new Float32Array(t.positions);if(t.colors&&(n.colors=t.colors.constructor===Float32Array?t.colors:new Float32Array(t.colors)),t.uv)if(this._state.compressGeometry){let e=LO.getUVBounds(t.uv),r=LO.compressUVs(t.uv,e.min,e.max);n.uv=r.quantized,n.uvDecodeMatrix=r.decodeMatrix}else n.uv=t.uv.constructor===Float32Array?t.uv:new Float32Array(t.uv);t.normals&&(this._state.compressGeometry?n.normals=LO.compressNormals(t.normals):n.normals=t.normals.constructor===Float32Array?t.normals:new Float32Array(t.normals)),t.indices&&(n.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(),RO.meshes++,this._buildVBOs()}_buildVBOs(){let e=this._state,t=this.scene.canvas.gl;if(e.indices&&(e.indicesBuf=new MO(t,t.ELEMENT_ARRAY_BUFFER,e.indices,e.indices.length,1,t.STATIC_DRAW),RO.indices+=e.indicesBuf.numItems),e.positions&&(e.positionsBuf=new MO(t,t.ARRAY_BUFFER,e.positions,e.positions.length,3,t.STATIC_DRAW),RO.positions+=e.positionsBuf.numItems),e.normals){let n=e.compressGeometry;e.normalsBuf=new MO(t,t.ARRAY_BUFFER,e.normals,e.normals.length,3,t.STATIC_DRAW,n),RO.normals+=e.normalsBuf.numItems}e.colors&&(e.colorsBuf=new MO(t,t.ARRAY_BUFFER,e.colors,e.colors.length,4,t.STATIC_DRAW),RO.colors+=e.colorsBuf.numItems),e.uv&&(e.uvBuf=new MO(t,t.ARRAY_BUFFER,e.uv,e.uv.length,2,t.STATIC_DRAW),RO.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,n=NO(e.positions,e.indices,e.positionsDecodeMatrix,this._edgeThreshold);this._edgeIndicesBuf=new MO(t,t.ELEMENT_ARRAY_BUFFER,n,n.length,1,t.STATIC_DRAW),RO.indices+=this._edgeIndicesBuf.numItems}_buildPickTriangleVBOs(){let e=this._state;if(!e.positions||!e.indices)return;let t=this.scene.canvas.gl,n=Y.buildPickTriangles(e.positions,e.indices,e.compressGeometry),r=n.positions,i=n.colors;this._pickTrianglePositionsBuf=new MO(t,t.ARRAY_BUFFER,r,r.length,3,t.STATIC_DRAW),this._pickTriangleColorsBuf=new MO(t,t.ARRAY_BUFFER,i,i.length,4,t.STATIC_DRAW,!0),RO.positions+=this._pickTrianglePositionsBuf.numItems,RO.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),LO.decompressPositions(this._state.positions,this._state.positionsDecodeMatrix,this._decompressedPositions)),this._decompressedPositions):this._state.positions:null}set positions(e){let t=this._state,n=t.positions;if(!n){this.error(`can't update geometry positions - geometry has no positions`);return}if(n.length!==e.length){this.error(`can't update geometry positions - new positions are wrong length`);return}if(this._state.compressGeometry){let n=LO.getPositionsBounds(e),r=LO.compressPositions(e,n.min,n.max);e=r.quantized,t.positionsDecodeMatrix=r.decodeMatrix}n.set(e),t.positionsBuf&&t.positionsBuf.setData(n),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),LO.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,n=t.normals;if(!n){this.error(`can't update geometry normals - geometry has no normals`);return}if(n.length!==e.length){this.error(`can't update geometry normals - new normals are wrong length`);return}n.set(e),t.normalsBuf&&t.normalsBuf.setData(n),this.glRedraw()}get uv(){return this._state.uv?this._state.compressGeometry?(this._decompressedUV||(this._decompressedUV=new Float32Array(this._state.uv.length),LO.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,n=t.uv;if(!n){this.error(`can't update geometry UVs - geometry has no UVs`);return}if(n.length!==e.length){this.error(`can't update geometry UVs - new UVs are wrong length`);return}n.set(e),t.uvBuf&&t.uvBuf.setData(n),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,n=t.colors;if(!n){this.error(`can't update geometry colors - geometry has no colors`);return}if(n.length!==e.length){this.error(`can't update geometry colors - new colors are wrong length`);return}n.set(e),t.colorsBuf&&t.colorsBuf.setData(n),this.glRedraw()}get indices(){return this._state.indices}get aabb(){return this._aabbDirty&&=(this._aabb||=Y.AABB3(),Y.positions3ToAABB3(this._state.positions,this._aabb,this._state.positionsDecodeMatrix),!1),this._aabb}get obb(){return this._obbDirty&&=(this._obb||=Y.OBB3(),Y.positions3ToAABB3(this._state.positions,zO,this._state.positionsDecodeMatrix),Y.AABB3ToOBB3(zO,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,n=(n,r)=>{let i=e[n]*3;for(let e=0;e<3;++e)r[e]=t[i+e];return r},r=[Y.vec3(),Y.vec3(),Y.vec3(),Y.vec3()],i=0,a=Y.vec3([0,0,0]);for(let t=0;t<e.length;t+=3){let e=n(t,r[0]),o=n(t+1,r[1]),s=n(t+2,r[2]);Y.addVec3(e,o,r[3]),Y.addVec3(s,r[3],r[3]);let c=Y.lenVec3(Y.cross3Vec3(Y.subVec3(o,e,r[1]),Y.subVec3(s,e,r[2]),r[0]))/2;i+=c,Y.mulVec3Scalar(r[3],c,r[3]),Y.addVec3(a,r[3],a)}this._metrics={surfaceArea:i,centroid:Y.mulVec3Scalar(a,1/i/3,a)};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(),RO.meshes--}},VO=GD.memory,HO=Y.AABB3(),UO=class extends kO{get type(){return`VBOGeometry`}get isVBOGeometry(){return!0}constructor(e,t={}){super(e,t),this._state=new jO({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=Y.OBB3();let n=this._state,r=this.scene.canvas.gl;switch(t.primitive=t.primitive||`triangles`,t.primitive){case`points`:n.primitive=r.POINTS,n.primitiveName=t.primitive;break;case`lines`:n.primitive=r.LINES,n.primitiveName=t.primitive;break;case`line-loop`:n.primitive=r.LINE_LOOP,n.primitiveName=t.primitive;break;case`line-strip`:n.primitive=r.LINE_STRIP,n.primitiveName=t.primitive;break;case`triangles`:n.primitive=r.TRIANGLES,n.primitiveName=t.primitive;break;case`triangle-strip`:n.primitive=r.TRIANGLE_STRIP,n.primitiveName=t.primitive;break;case`triangle-fan`:n.primitive=r.TRIANGLE_FAN,n.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'.`),n.primitive=r.TRIANGLES,n.primitiveName=t.primitive}if(!t.positions){this.error(`Config expected: positions`);return}if(!t.indices){this.error(`Config expected: indices`);return}var i;if(!t.positionsDecodeMatrix){let e=LO.getPositionsBounds(t.positions),a=LO.compressPositions(t.positions,e.min,e.max);i=a.quantized,n.positionsDecodeMatrix=a.decodeMatrix,n.positionsBuf=new MO(r,r.ARRAY_BUFFER,i,i.length,3,r.STATIC_DRAW),VO.positions+=n.positionsBuf.numItems,Y.positions3ToAABB3(t.positions,this._aabb),Y.positions3ToAABB3(i,HO,n.positionsDecodeMatrix),Y.AABB3ToOBB3(HO,this._obb)}if(t.colors){let e=t.colors.constructor===Float32Array?t.colors:new Float32Array(t.colors);n.colorsBuf=new MO(r,r.ARRAY_BUFFER,e,e.length,4,r.STATIC_DRAW),VO.colors+=n.colorsBuf.numItems}if(t.uv){let e=LO.getUVBounds(t.uv),i=LO.compressUVs(t.uv,e.min,e.max),a=i.quantized;n.uvDecodeMatrix=i.decodeMatrix,n.uvBuf=new MO(r,r.ARRAY_BUFFER,a,a.length,2,r.STATIC_DRAW),VO.uvs+=n.uvBuf.numItems}if(t.normals){let e=LO.compressNormals(t.normals),i=n.compressGeometry;n.normalsBuf=new MO(r,r.ARRAY_BUFFER,e,e.length,3,r.STATIC_DRAW,i),VO.normals+=n.normalsBuf.numItems}{let e=t.indices.constructor===Uint32Array||t.indices.constructor===Uint16Array?t.indices:new Uint32Array(t.indices);n.indicesBuf=new MO(r,r.ELEMENT_ARRAY_BUFFER,e,e.length,1,r.STATIC_DRAW),VO.indices+=n.indicesBuf.numItems;let a=NO(i,e,n.positionsDecodeMatrix,this._edgeThreshold);this._edgeIndicesBuf=new MO(r,r.ELEMENT_ARRAY_BUFFER,a,a.length,1,r.STATIC_DRAW),this._state.primitiveName===`triangles`&&(this._numTriangles=t.indices.length/3)}this._buildHash(),VO.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(),VO.meshes--}},X={};X.load=function(e,t){var n=new XMLHttpRequest;n.open(`GET`,e,!0),n.responseType=`arraybuffer`,n.onload=function(e){t(e.target.response)},n.send()},X.save=function(e,t){var n=`data:application/octet-stream;base64,`+btoa(X.parse._buffToStr(e));window.location.href=n},X.clone=function(e){return JSON.parse(JSON.stringify(e))},X.bin={},X.bin.f=new Float32Array(1),X.bin.fb=new Uint8Array(X.bin.f.buffer),X.bin.rf=function(e,t){for(var n=X.bin.f,r=X.bin.fb,i=0;i<4;i++)r[i]=e[t+i];return n[0]},X.bin.rsl=function(e,t){return e[t]|e[t+1]<<8},X.bin.ril=function(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24},X.bin.rASCII0=function(e,t){for(var n=``;e[t]!=0;)n+=String.fromCharCode(e[t++]);return n},X.bin.wf=function(e,t,n){var r=new Float32Array(e.buffer,t,1);r[0]=n},X.bin.wsl=function(e,t,n){e[t]=n,e[t+1]=n>>8},X.bin.wil=function(e,t,n){e[t]=n,e[t+1]=n>>8,e[t+2]=n>>16,e[t+3]>>24},X.parse={},X.parse._buffToStr=function(e){for(var t=new Uint8Array(e),n=``,r=0;r<t.length;r++)n=n.concat(String.fromCharCode(t[r]));return n},X.parse._strToBuff=function(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return t},X.parse._readLine=function(e,t){for(var n=``;e[t]!=10;)n+=String.fromCharCode(e[t++]);return n},X.parse.fromJSON=function(e){return JSON.parse(X.parse._buffToStr(e))},X.parse.toJSON=function(e){var t=JSON.stringify(e);return X.parse._strToBuff(t)},X.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 n={from:0,to:0},r=0,i=new Uint8Array(e);r<i.length;){var a=X.parse._readLine(i,r);r+=a.length+1,a=a.replace(/ +(?= )/g,``),a=a.replace(/(^\s+|\s+$)/g,``);var o=a.split(` `);if(o[0]==`g`&&(n.to=t.i_verts.length,t.groups[o[1]]??(t.groups[o[1]]={from:t.i_verts.length,to:0}),n=t.groups[o[1]]),o[0]==`v`){var s=parseFloat(o[1]),c=parseFloat(o[2]),l=parseFloat(o[3]);t.c_verts.push(s,c,l)}if(o[0]==`vt`){var s=parseFloat(o[1]),c=1-parseFloat(o[2]);t.c_uvt.push(s,c)}if(o[0]==`vn`){var s=parseFloat(o[1]),c=parseFloat(o[2]),l=parseFloat(o[3]);t.c_norms.push(s,c,l)}if(o[0]==`f`){var u=o[1].split(`/`),d=o[2].split(`/`),f=o[3].split(`/`),p=parseInt(u[0])-1,m=parseInt(d[0])-1,h=parseInt(f[0])-1,g=parseInt(u[1])-1,_=parseInt(d[1])-1,v=parseInt(f[1])-1,y=parseInt(u[2])-1,b=parseInt(d[2])-1,x=parseInt(f[2])-1,S=t.c_verts.length/3,C=t.c_uvt.length/2,w=t.c_norms.length/3;if(p<0&&(p=S+p+1),m<0&&(m=S+m+1),h<0&&(h=S+h+1),g<0&&(g=C+g+1),_<0&&(_=C+_+1),v<0&&(v=C+v+1),y<0&&(y=w+y+1),b<0&&(b=w+b+1),x<0&&(x=w+x+1),t.i_verts.push(p,m,h),t.i_uvt.push(g,_,v),t.i_norms.push(y,b,x),o.length==5){var T=o[4].split(`/`),E=parseInt(T[0])-1,D=parseInt(T[1])-1,O=parseInt(T[2])-1;E<0&&(E=S+E+1),D<0&&(D=C+D+1),O<0&&(O=w+O+1),t.i_verts.push(p,h,E),t.i_uvt.push(g,v,D),t.i_norms.push(y,x,O)}}}return n.to=t.i_verts.length,t},X.parse.fromMD2=function(e){e=new Uint8Array(e);var t={},n={};n.ident=X.bin.ril(e,0),n.version=X.bin.ril(e,4),n.skinwidth=X.bin.ril(e,8),n.skinheight=X.bin.ril(e,12),n.framesize=X.bin.ril(e,16),n.num_skins=X.bin.ril(e,20),n.num_vertices=X.bin.ril(e,24),n.num_st=X.bin.ril(e,28),n.num_tris=X.bin.ril(e,32),n.num_glcmds=X.bin.ril(e,36),n.num_frames=X.bin.ril(e,40),n.offset_skins=X.bin.ril(e,44),n.offset_st=X.bin.ril(e,48),n.offset_tris=X.bin.ril(e,52),n.offset_frames=X.bin.ril(e,56),n.offset_glcmds=X.bin.ril(e,60),n.offset_end=X.bin.ril(e,64);var r=n.offset_st;t.c_uvt=[];for(var i=0;i<n.num_st;i++){var a=X.bin.rsl(e,r)/n.skinwidth,o=X.bin.rsl(e,r+2)/n.skinheight;t.c_uvt.push(a,o),r+=4}var r=n.offset_tris,s=[],c=[];t.i_verts=s,t.i_uvt=c;for(var i=0;i<n.num_tris;i++)s.push(X.bin.rsl(e,r),X.bin.rsl(e,r+2),X.bin.rsl(e,r+4)),c.push(X.bin.rsl(e,r+6),X.bin.rsl(e,r+8),X.bin.rsl(e,r+10)),r+=12;var r=n.offset_skins;t.skins=[];for(var i=0;i<n.num_skins;i++)t.skins.push(X.bin.rASCII0(e,r)),r+=64;var r=n.offset_frames;t.frames=[];for(var l=X.parse.fromMD2._normals,i=0;i<n.num_frames;i++){var u={},d=X.bin.rf(e,r),f=X.bin.rf(e,r+4),p=X.bin.rf(e,r+8);r+=12;var m=X.bin.rf(e,r),h=X.bin.rf(e,r+4),g=X.bin.rf(e,r+8);r+=12,u.name=X.bin.rASCII0(e,r),r+=16,u.verts=[],u.norms=[];for(var _=0;_<n.num_vertices;_++)u.verts.push(e[r]*d+m,e[r+1]*f+h,e[r+2]*p+g),u.norms.push(l[3*e[r+3]],l[3*e[r+3]+1],l[3*e[r+3]+2]),r+=4;t.frames.push(u)}return t},X.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],X.parse.fromCollada=function(e){var t=X.parse._buffToStr(e),n=new DOMParser().parseFromString(t,`text/xml`);n=n.childNodes[0];var r={},i=n.getElementsByTagName(`asset`)[0],a=n.getElementsByTagName(`library_geometries`)[0],o=n.getElementsByTagName(`library_images`)[0],s=n.getElementsByTagName(`library_materials`)[0],c=n.getElementsByTagName(`library_effects`)[0];return i&&(r.asset=X.parse.fromCollada._asset(i)),a&&(r.geometries=X.parse.fromCollada._libGeometries(a)),o&&(r.images=X.parse.fromCollada._libImages(o)),s&&(r.materials=X.parse.fromCollada._libMaterials(s)),c&&(r.effects=X.parse.fromCollada._libEffects(c)),r},X.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}},X.parse.fromCollada._libGeometries=function(e){e=e.getElementsByTagName(`geometry`);for(var t=[],n=0;n<e.length;n++){var r=e[n],i=X.parse.fromCollada._getMesh(r.getElementsByTagName(`mesh`)[0]);t.push(i)}return t},X.parse.fromCollada._getMesh=function(e){for(var t={},n=e.getElementsByTagName(`source`),r=t.sources={},i=0;i<n.length;i++){for(var a=n[i].getElementsByTagName(`float_array`)[0].textContent.split(` `),o=a.length-(a[a.length-1]==``?1:0),s=Array(o),c=0;c<o;c++)s[c]=parseFloat(a[c]);r[n[i].getAttribute(`id`)]=s}t.triangles=[];var l=e.getElementsByTagName(`triangles`);if(l==null)return t;for(var i=0;i<l.length;i++){var u={},d=l[i];u.material=d.getAttribute(`material`);for(var f=d.getElementsByTagName(`input`),p=[],c=0;c<f.length;c++){var m=f[c],s=[];p[parseInt(m.getAttribute(`offset`))]=s;var h=m.getAttribute(`semantic`);u[`s_`+h]=h==`VERTEX`?e.getElementsByTagName(`vertices`)[0].getElementsByTagName(`input`)[0].getAttribute(`source`).substring(1):m.getAttribute(`source`).substring(1),u[`i_`+h]=s,r[u[`s_`+h]]}for(var g=d.getElementsByTagName(`p`)[0].textContent.split(` `),_=3*Math.floor(g.length/3),c=0;c<_;c++)p[c%f.length].push(parseInt(g[c]));t.triangles.push(u)}return t},X.parse.fromCollada._libImages=function(e){e=e.getElementsByTagName(`image`);for(var t={},n=0;n<e.length;n++)t[e[n].getAttribute(`id`)]=e[n].getElementsByTagName(`init_from`)[0].textContent;return t},X.parse.fromCollada._libMaterials=function(e){e=e.getElementsByTagName(`material`);for(var t={},n=0;n<e.length;n++)t[e[n].getAttribute(`name`)]=e[n].getElementsByTagName(`instance_effect`)[0].getAttribute(`url`).substring(1);return t},X.parse.fromCollada._libEffects=function(e){e=e.getElementsByTagName(`effect`);for(var t={},n=0;n<e.length;n++){for(var r={},i=e[n].getElementsByTagName(`newparam`),a=0;a<i.length;a++){var o=i[a].getElementsByTagName(`surface`)[0];o&&(r.surface=o.getElementsByTagName(`init_from`)[0].textContent)}t[e[n].getAttribute(`id`)]=r}return t},X.parse.from3DS=function(e){e=new Uint8Array(e);var t={};if(X.bin.rsl(e,0)!=19789)return null;for(var n=X.bin.ril(e,2),r=6;r<n;){var i=X.bin.rsl(e,r),a=X.bin.ril(e,r+2);i==15677&&(t.edit=X.parse.from3DS._edit3ds(e,r,a)),i==45056&&(t.keyf=X.parse.from3DS._keyf3ds(e,r,a)),r+=a}return t},X.parse.from3DS._edit3ds=function(e,t,n){for(var r={},i=t+6;i<t+n;){var a=X.bin.rsl(e,i),o=X.bin.ril(e,i+2);a==16384&&(r.objects??=[],r.objects.push(X.parse.from3DS._edit_object(e,i,o))),i+=o}return r},X.parse.from3DS._keyf3ds=function(e,t,n){for(var r={},i=t+6;i<t+n;){var a=X.bin.rsl(e,i),o=X.bin.ril(e,i+2);a==45058&&(r.desc??=[],r.desc.push(X.parse.from3DS._keyf_objdes(e,i,o))),i+=o}return r},X.parse.from3DS._keyf_objdes=function(e,t,n){for(var r={},i=t+6;i<t+n;){var a=X.bin.rsl(e,i),o=X.bin.ril(e,i+2);a==45072&&(r.hierarchy=X.parse.from3DS._keyf_objhierarch(e,i,o)),a==45073&&(r.dummy_name=X.bin.rASCII0(e,i+6)),i+=o}return r},X.parse.from3DS._keyf_objhierarch=function(e,t,n){var r={},i=t+6;return r.name=X.bin.rASCII0(e,i),i+=r.name.length+1,r.hierarchy=X.bin.rsl(e,i+4),r},X.parse.from3DS._edit_object=function(e,t,n){var r={},i=t+6;for(r.name=X.bin.rASCII0(e,i),i+=r.name.length+1;i<t+n;){var a=X.bin.rsl(e,i),o=X.bin.ril(e,i+2);a==16640&&(r.mesh=X.parse.from3DS._obj_trimesh(e,i,o)),i+=o}return r},X.parse.from3DS._obj_trimesh=function(e,t,n){for(var r={},i=t+6;i<t+n;){var a=X.bin.rsl(e,i),o=X.bin.ril(e,i+2);a==16656&&(r.vertices=X.parse.from3DS._tri_vertexl(e,i,o)),a==16672&&(r.indices=X.parse.from3DS._tri_facel1(e,i,o)),a==16704&&(r.uvt=X.parse.from3DS._tri_mappingcoors(e,i,o)),a==16736&&(r.local=X.parse.from3DS._tri_local(e,i,o)),i+=o}return r},X.parse.from3DS._tri_vertexl=function(e,t,n){var r=[],i=t+6,a=X.bin.rsl(e,i);i+=2;for(var o=0;o<a;o++)r.push(X.bin.rf(e,i)),r.push(X.bin.rf(e,i+4)),r.push(X.bin.rf(e,i+8)),i+=12;return r},X.parse.from3DS._tri_facel1=function(e,t,n){var r=[],i=t+6,a=X.bin.rsl(e,i);i+=2;for(var o=0;o<a;o++)r.push(X.bin.rsl(e,i)),r.push(X.bin.rsl(e,i+2)),r.push(X.bin.rsl(e,i+4)),i+=8;return r},X.parse.from3DS._tri_mappingcoors=function(e,t,n){var r=[],i=t+6,a=X.bin.rsl(e,i);i+=2;for(var o=0;o<a;o++)r.push(X.bin.rf(e,i)),r.push(1-X.bin.rf(e,i+4)),i+=8;return r},X.parse.from3DS._tri_local=function(e,t,n){var r={},i=t+6;return r.X=[X.bin.rf(e,i),X.bin.rf(e,i+4),X.bin.rf(e,i+8)],i+=12,r.Y=[X.bin.rf(e,i),X.bin.rf(e,i+4),X.bin.rf(e,i+8)],i+=12,r.Z=[X.bin.rf(e,i),X.bin.rf(e,i+4),X.bin.rf(e,i+8)],i+=12,r.C=[X.bin.rf(e,i),X.bin.rf(e,i+4),X.bin.rf(e,i+8)],i+=12,r},X.parse.fromBIV=function(e){e=new Uint8Array(e);var t={},n={};return n.id=X.bin.ril(e,0),n.verS=X.bin.ril(e,4),n.texS=X.bin.ril(e,8),n.indS=X.bin.ril(e,12),n.verO=X.bin.ril(e,16),n.verL=X.bin.ril(e,20),n.texO=X.bin.ril(e,24),n.texL=X.bin.ril(e,28),n.indO=X.bin.ril(e,32),n.indL=X.bin.ril(e,36),n.verO!=0&&(t.vertices=X.parse.fromBIV._readFloats(e,n.verO,n.verL)),n.texO!=0&&(t.uvt=X.parse.fromBIV._readFloats(e,n.texO,n.texL)),n.indO!=0&&(t.indices=X.parse.fromBIV._readInts(e,n.indO,n.indL,n.indS)),t},X.parse.toBIV=function(e){for(var t=0,n=0;n<e.indices.length;n++)t=Math.max(t,e.indices[n]);var r=32;t<=65535&&(r=16);var i=40;e.vertices&&(i+=e.vertices.length*4),e.uvt&&(i+=e.uvt.length*4),e.indices&&(i+=e.indices.length*r/8);var a=new Uint8Array(i);X.bin.wil(a,0,1769365870),X.bin.wil(a,4,32),X.bin.wil(a,8,32),X.bin.wil(a,12,r);var o=40;return e.vertices&&(X.bin.wil(a,16,o),X.bin.wil(a,20,4*e.vertices.length),X.parse.fromBIV._writeFloats(a,o,e.vertices),o+=4*e.vertices.length),e.uvt&&(X.bin.wil(a,24,o),X.bin.wil(a,28,4*e.uvt.length),X.parse.fromBIV._writeFloats(a,o,e.uvt),o+=4*e.uvt.length),e.indices&&(X.bin.wil(a,32,o),X.bin.wil(a,36,4*e.indices.length),X.parse.fromBIV._writeInts(a,o,e.indices,r)),a.buffer},X.parse.fromBIV._readFloats=function(e,t,n){for(var r=[],i=0;i<n/4;i++)r.push(X.bin.rf(e,t+4*i));return r},X.parse.fromBIV._writeFloats=function(e,t,n){for(var r=0;r<n.length;r++)X.bin.wf(e,t+4*r,n[r])},X.parse.fromBIV._readInts=function(e,t,n,r){for(var i=[],a=0;a<n/4;a++)r==16&&i.push(X.bin.rsl(e,t+2*a)),r==32&&i.push(X.bin.ril(e,t+4*a));return i},X.parse.fromBIV._writeInts=function(e,t,n,r){for(var i=0;i<n.length;i++)r==16&&X.bin.wsl(e,t+2*i,n[i]),r==32&&X.bin.wil(e,t+4*i,n[i])},X.gen={},X.gen.Plane=function(e,t,n,r){n||=1,r||=1;for(var i={verts:[],inds:[],uvt:[]},a=e+1,o=t+1,s=0;s<o;s++)for(var c=0;c<a;c++){var l=-1+2/e*c,u=-1+2/t*s;i.verts.push(l,u,0),i.uvt.push(n*c/e,r*s/t),s<t&&c<e&&i.inds.push(s*a+c,s*a+c+1,(s+1)*a+c,s*a+c+1,(s+1)*a+c,(s+1)*a+c+1)}return i},X.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]}},X.gen.Sphere=function(e,t){var n={verts:[],inds:[],uvt:[]};2*Math.PI/e,Math.PI/t;for(var r=e+1,i=t+1,a=0;a<i;a++)for(var o=0;o<r;o++){var s=-Math.PI/2+a*Math.PI/t,c=o*2*Math.PI/e,l=Math.cos(s)*Math.cos(c),u=Math.sin(s),d=Math.cos(s)*Math.sin(c);n.verts.push(l,u,d),n.uvt.push(o/e,a/t),a<t&&o<e&&n.inds.push(r*a+o,r*a+o+1,r*(a+1)+o,r*a+o+1,r*(a+1)+o,r*(a+1)+o+1)}return n},X.mat={},X.mat.scale=function(e,t,n){return[e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1]},X.mat.translate=function(e,t,n){return[1,0,0,0,0,1,0,0,0,0,1,0,e,t,n,1]},X.mat.rotateDeg=function(e,t,n){var r=Math.PI/180;return X.mat.rotate(e*r,t*r,n*r)},X.mat.rotate=function(e,t,n){var r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],i=e,a=t,o=n,s=Math.cos(i),c=Math.cos(a),l=Math.cos(o),u=Math.sin(i),d=Math.sin(a),f=Math.sin(o);return r[0]=c*l,r[1]=-c*f,r[2]=d,r[4]=s*f+u*d*l,r[5]=s*l-u*d*f,r[6]=-u*c,r[8]=u*f-s*d*l,r[9]=u*l+s*d*f,r[10]=s*c,r},X.edit={},X.edit.interpolate=function(e,t,n,r){for(var i=0;i<e.length;i++)n[i]=e[i]+r*(t[i]-e[i])},X.edit.transform=function(e,t){for(var n=0;n<e.length;n+=3){var r=e[n],i=e[n+1],a=e[n+2];e[n+0]=t[0]*r+t[4]*i+t[8]*a+t[12],e[n+1]=t[1]*r+t[5]*i+t[9]*a+t[13],e[n+2]=t[2]*r+t[6]*i+t[10]*a+t[14]}},X.edit.unwrap=function(e,t,n){for(var r=Array(Math.floor(e.length/3)*n),i=0;i<e.length;i++)for(var a=0;a<n;a++)r[i*n+a]=t[e[i]*n+a];return r},X.edit.remap=function(e,t,n,r){for(var i=Array(n.length),a=0;a<e.length;a++)for(var o=0;o<r;o++)i[t[a]*r+o]=n[e[a]*r+o];return i},X.utils={},X.utils.getAABB=function(e){for(var t=n=r=999999999,n,r,i=a=o=-t,a,o,s=0;s<e.length;s+=3){var c=e[s+0],l=e[s+1],u=e[s+2];c<t&&(t=c),c>i&&(i=c),l<n&&(n=l),l>a&&(a=l),u<r&&(r=u),l>o&&(o=u)}return{min:{x:t,y:n,z:r},max:{x:i,y:a,z:o}}};function R$e(e,t={}){return new Promise(function(n,r){t.src||(console.error(`load3DSGeometry: Parameter expected: src`),r());var i=e.canvas.spinner;i.processes++,JD.loadArraybuffer(t.src,function(e){e.byteLength||(console.error(`load3DSGeometry: no data loaded`),i.processes--,r());var a=X.parse.from3DS(e).edit.objects[0].mesh,o=a.vertices,s=a.uvt,c=a.indices;i.processes--,n(JD.apply(t,{primitive:`triangles`,positions:o,normals:null,uv:s,indices:c}))},function(e){console.error(`load3DSGeometry: `+e),i.processes--,r()})})}function z$e(e,t={}){return new Promise(function(n,r){t.src||(console.error(`loadOBJGeometry: Parameter expected: src`),r());var i=e.canvas.spinner;i.processes++,JD.loadArraybuffer(t.src,function(e){e.byteLength||(console.error(`loadOBJGeometry: no data loaded`),i.processes--,r());for(var a=X.parse.fromOBJ(e),o=X.edit.unwrap(a.i_verts,a.c_verts,3),s=X.edit.unwrap(a.i_norms,a.c_norms,3),c=X.edit.unwrap(a.i_uvt,a.c_uvt,2),l=new Int32Array(a.i_verts.length),u=0;u<a.i_verts.length;u++)l[u]=u;i.processes--,n(JD.apply(t,{primitive:`triangles`,positions:o,normals:s.length>0?s:null,autoNormals:s.length===0,uv:c,indices:l}))},function(e){console.error(`loadOBJGeometry: `+e),i.processes--,r()})})}function WO(e={}){let t=e.xSize||1;t<0&&(console.error(`negative xSize not allowed - will invert`),t*=-1);let n=e.ySize||1;n<0&&(console.error(`negative ySize not allowed - will invert`),n*=-1);let r=e.zSize||1;r<0&&(console.error(`negative zSize not allowed - will invert`),r*=-1);let i=e.center,a=i?i[0]:0,o=i?i[1]:0,s=i?i[2]:0,c=-t+a,l=-n+o,u=-r+s,d=t+a,f=n+o,p=r+s;return JD.apply(e,{positions:[d,f,p,c,f,p,c,l,p,d,l,p,d,f,p,d,l,p,d,l,u,d,f,u,d,f,p,d,f,u,c,f,u,c,f,p,c,f,p,c,f,u,c,l,u,c,l,p,c,l,u,d,l,u,d,l,p,c,l,p,d,l,u,c,l,u,c,f,u,d,f,u],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 GO(e={}){let t=e.xSize||1;t<0&&(console.error(`negative xSize not allowed - will invert`),t*=-1);let n=e.ySize||1;n<0&&(console.error(`negative ySize not allowed - will invert`),n*=-1);let r=e.zSize||1;r<0&&(console.error(`negative zSize not allowed - will invert`),r*=-1);let i=e.center,a=i?i[0]:0,o=i?i[1]:0,s=i?i[2]:0,c=-t+a,l=-n+o,u=-r+s,d=t+a,f=n+o,p=r+s;return JD.apply(e,{primitive:`lines`,positions:[c,l,u,c,l,p,c,f,u,c,f,p,d,l,u,d,l,p,d,f,u,d,f,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 B$e(e={}){return GO({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 KO(e={}){let t=e.radiusTop||1;t<0&&(console.error(`negative radiusTop not allowed - will invert`),t*=-1);let n=e.radiusBottom||1;n<0&&(console.error(`negative radiusBottom not allowed - will invert`),n*=-1);let r=e.height||1;r<0&&(console.error(`negative height not allowed - will invert`),r*=-1);let i=e.radialSegments||32;i<0&&(console.error(`negative radialSegments not allowed - will invert`),i*=-1),i<3&&(i=3);let a=e.heightSegments||1;a<0&&(console.error(`negative heightSegments not allowed - will invert`),a*=-1),a<1&&(a=1);let o=!!e.openEnded,s=e.center,c=s?s[0]:0,l=s?s[1]:0,u=s?s[2]:0,d=r/2,f=r/a,p=2*Math.PI/i,m=1/i,h=(t-n)/a,g=[],_=[],v=[],y=[],b,x,S,C,w,T,E,D,O,k,A,ee=(90-Math.atan(r/(n-t))*180/Math.PI)/90;for(b=0;b<=a;b++)for(w=t-b*h,T=d-b*f,x=0;x<=i;x++)S=Math.sin(x*p),C=Math.cos(x*p),_.push(w*S),_.push(ee),_.push(w*C),v.push(x*m),v.push(b*1/a),g.push(w*S+c),g.push(T+l),g.push(w*C+u);for(b=0;b<a;b++)for(x=0;x<=i;x++)E=b*(i+1)+x,D=E+i,y.push(E),y.push(D),y.push(D+1),y.push(E),y.push(D+1),y.push(E+1);if(!o&&t>0){for(O=g.length/3,_.push(0),_.push(1),_.push(0),v.push(.5),v.push(.5),g.push(0+c),g.push(d+l),g.push(0+u),x=0;x<=i;x++)S=Math.sin(x*p),C=Math.cos(x*p),k=.5*Math.sin(x*p)+.5,A=.5*Math.cos(x*p)+.5,_.push(t*S),_.push(1),_.push(t*C),v.push(k),v.push(A),g.push(t*S+c),g.push(d+l),g.push(t*C+u);for(x=0;x<i;x++)s=O,E=O+1+x,y.push(E),y.push(E+1),y.push(s)}if(!o&&n>0){for(O=g.length/3,_.push(0),_.push(-1),_.push(0),v.push(.5),v.push(.5),g.push(0+c),g.push(0-d+l),g.push(0+u),x=0;x<=i;x++)S=Math.sin(x*p),C=Math.cos(x*p),k=.5*Math.sin(x*p)+.5,A=.5*Math.cos(x*p)+.5,_.push(n*S),_.push(-1),_.push(n*C),v.push(k),v.push(A),g.push(n*S+c),g.push(0-d+l),g.push(n*C+u);for(x=0;x<i;x++)s=O,E=O+1+x,y.push(s),y.push(E+1),y.push(E)}return JD.apply(e,{positions:g,normals:_,uv:v,indices:y})}function qO(e={}){let t=e.size||1;t<0&&(console.error(`negative size not allowed - will invert`),t*=-1);let n=e.divisions||1;n<0&&(console.error(`negative divisions not allowed - will invert`),n*=-1),n<1&&(n=1),t||=10,n||=10;let r=t/n,i=t/2,a=[],o=[],s=0;for(let e=0,t=-i;e<=n;e++,t+=r)a.push(-i),a.push(0),a.push(t),a.push(i),a.push(0),a.push(t),a.push(t),a.push(0),a.push(-i),a.push(t),a.push(0),a.push(i),o.push(s++),o.push(s++),o.push(s++),o.push(s++);return JD.apply(e,{primitive:`lines`,positions:a,indices:o})}function JO(e={}){let t=e.xSize||1;t<0&&(console.error(`negative xSize not allowed - will invert`),t*=-1);let n=e.zSize||1;n<0&&(console.error(`negative zSize not allowed - will invert`),n*=-1);let r=e.xSegments||1;r<0&&(console.error(`negative xSegments not allowed - will invert`),r*=-1),r<1&&(r=1);let i=e.xSegments||1;i<0&&(console.error(`negative zSegments not allowed - will invert`),i*=-1),i<1&&(i=1);let a=e.center,o=a?a[0]:0,s=a?a[1]:0,c=a?a[2]:0,l=t/2,u=n/2,d=Math.floor(r)||1,f=Math.floor(i)||1,p=d+1,m=f+1,h=t/d,g=n/f,_=new Float32Array(p*m*3),v=new Float32Array(p*m*3),y=new Float32Array(p*m*2),b=0,x=0,S,C,w,T,E,D,O;for(S=0;S<m;S++){let e=S*g-u;for(C=0;C<p;C++)w=C*h-l,_[b]=w+o,_[b+1]=s,_[b+2]=-e+c,v[b+1]=1,y[x]=C/d,y[x+1]=(f-S)/f,b+=3,x+=2}b=0;let k=new(_.length/3>65535?Uint32Array:Uint16Array)(d*f*6);for(S=0;S<f;S++)for(C=0;C<d;C++)T=C+p*S,E=C+p*(S+1),D=C+1+p*(S+1),O=C+1+p*S,k[b]=O,k[b+1]=E,k[b+2]=T,k[b+3]=O,k[b+4]=D,k[b+5]=E,b+=6;return JD.apply(e,{positions:_,normals:v,uv:y,indices:k})}function YO(e={}){let t=e.lod||1,n=e.center?e.center[0]:0,r=e.center?e.center[1]:0,i=e.center?e.center[2]:0,a=e.radius||1;a<0&&(console.error(`negative radius not allowed - will invert`),a*=-1);let o=e.heightSegments||18;o<0&&(console.error(`negative heightSegments not allowed - will invert`),o*=-1),o=Math.floor(t*o),o<18&&(o=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 c=[],l=[],u=[],d=[],f,p,m,h,g,_,v,y,b,x,S,C,w,T,E;for(f=0;f<=o;f++)for(m=f*Math.PI/o,h=Math.sin(m),g=Math.cos(m),p=0;p<=s;p++)_=p*2*Math.PI/s,v=Math.sin(_),y=Math.cos(_),b=y*h,x=g,S=v*h,C=1-p/s,w=f/o,l.push(b),l.push(x),l.push(S),u.push(C),u.push(w),c.push(n+a*b),c.push(r+a*x),c.push(i+a*S);for(f=0;f<o;f++)for(p=0;p<s;p++)T=f*(s+1)+p,E=T+s+1,d.push(T+1),d.push(E+1),d.push(E),d.push(T+1),d.push(E),d.push(T);return JD.apply(e,{positions:c,normals:l,uv:u,indices:d})}function XO(e={}){let t=e.radius||1;t<0&&(console.error(`negative radius not allowed - will invert`),t*=-1),t*=.5;let n=e.tube||.3;n<0&&(console.error(`negative tube not allowed - will invert`),n*=-1);let r=e.radialSegments||32;r<0&&(console.error(`negative radialSegments not allowed - will invert`),r*=-1),r<4&&(r=4);let i=e.tubeSegments||24;i<0&&(console.error(`negative tubeSegments not allowed - will invert`),i*=-1),i<4&&(i=4);let a=e.arc||Math.PI*2;a<0&&(console.warn(`negative arc not allowed - will invert`),a*=-1),a>360&&(a=360);let o=e.center,s=o?o[0]:0,c=o?o[1]:0,l=o?o[2]:0,u=[],d=[],f=[],p=[],m,h,g,_,v,y,b,x;for(x=0;x<=i;x++)for(b=0;b<=r;b++)m=b/r*a,h=.785398+x/i*Math.PI*2,s=t*Math.cos(m),c=t*Math.sin(m),g=(t+n*Math.cos(h))*Math.cos(m),_=(t+n*Math.cos(h))*Math.sin(m),v=n*Math.sin(h),u.push(g+s),u.push(_+c),u.push(v+l),f.push(1-b/r),f.push(x/i),y=Y.normalizeVec3(Y.subVec3([g,_,v],[s,c,l],[]),[]),d.push(y[0]),d.push(y[1]),d.push(y[2]);let S,C,w,T;for(x=1;x<=i;x++)for(b=1;b<=r;b++)S=(r+1)*x+b-1,C=(r+1)*(x-1)+b-1,w=(r+1)*(x-1)+b,T=(r+1)*x+b,p.push(S),p.push(C),p.push(w),p.push(w),p.push(T),p.push(S);return JD.apply(e,{positions:u,normals:d,uv:f,indices:p})}var V$e={" ":{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 ZO(e={}){var t=e.origin||[0,0,0],n=t[0],r=t[1],i=t[2],a=e.size||1,o=[],s=[],c=e.text;JD.isNumeric(c)&&(c=``+c);for(var l=(c||``).split(`
941
+ .`+kc+Dc+Ac)},Mc=function(e,t){var n=e.ownerDocument;if(n){var r=n.createElement(`style`);r.textContent=t,e.appendChild(r)}},R=function(){function e(){}return e.getOrigin=function(t){var n=e._link;return n?(n.href=t,n.href=n.href,n.protocol+n.hostname+n.port):`about:blank`},e.isSameOrigin=function(t){return e.getOrigin(t)===e._origin},e.setContext=function(t){e._link=t.document.createElement(`a`),e._origin=e.getOrigin(t.location.href)},e._origin=`about:blank`,e}(),Nc=function(){function e(e,t){this.context=e,this._options=t,this._cache={}}return e.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)||(Bc(e)||Lc(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),t},e.prototype.match=function(e){return this._cache[e]},e.prototype.loadImage=function(e){return r(this,void 0,void 0,function(){var t,n,r,a,o=this;return i(this,function(i){switch(i.label){case 0:return t=R.isSameOrigin(e),n=!Rc(e)&&this._options.useCORS===!0&&L.SUPPORT_CORS_IMAGES&&!t,r=!Rc(e)&&!t&&!Bc(e)&&typeof this._options.proxy==`string`&&L.SUPPORT_CORS_XHR&&!n,!t&&this._options.allowTaint===!1&&!Rc(e)&&!Bc(e)&&!r&&!n?[2]:(a=e,r?[4,this.proxy(a)]:[3,2]);case 1:a=i.sent(),i.label=2;case 2:return this.context.logger.debug(`Added image `+e.substring(0,256)),[4,new Promise(function(e,t){var r=new Image;r.onload=function(){return e(r)},r.onerror=t,(zc(a)||n)&&(r.crossOrigin=`anonymous`),r.src=a,r.complete===!0&&setTimeout(function(){return e(r)},500),o._options.imageTimeout>0&&setTimeout(function(){return t(`Timed out (`+o._options.imageTimeout+`ms) loading image`)},o._options.imageTimeout)})];case 3:return[2,i.sent()]}})})},e.prototype.has=function(e){return this._cache[e]!==void 0},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(e){var t=this,n=this._options.proxy;if(!n)throw Error(`No proxy defined`);var r=e.substring(0,256);return new Promise(function(i,a){var o=L.SUPPORT_RESPONSE_TYPE?`blob`:`text`,s=new XMLHttpRequest;s.onload=function(){if(s.status===200)if(o===`text`)i(s.response);else{var e=new FileReader;e.addEventListener(`load`,function(){return i(e.result)},!1),e.addEventListener(`error`,function(e){return a(e)},!1),e.readAsDataURL(s.response)}else a(`Failed to proxy resource `+r+` with status code `+s.status)},s.onerror=a;var c=n.indexOf(`?`)>-1?`&`:`?`;if(s.open(`GET`,``+n+c+`url=`+encodeURIComponent(e)+`&responseType=`+o),o!==`text`&&s instanceof XMLHttpRequest&&(s.responseType=o),t._options.imageTimeout){var l=t._options.imageTimeout;s.timeout=l,s.ontimeout=function(){return a(`Timed out (`+l+`ms) proxying `+r)}}s.send()})},e}(),Pc=/^data:image\/svg\+xml/i,Fc=/^data:image\/.*;base64,/i,Ic=/^data:image\/.*/i,Lc=function(e){return L.SUPPORT_SVG_DRAWING||!Vc(e)},Rc=function(e){return Ic.test(e)},zc=function(e){return Fc.test(e)},Bc=function(e){return e.substr(0,4)===`blob`},Vc=function(e){return e.substr(-3).toLowerCase()===`svg`||Pc.test(e)},Hc=function(){function e(e,t){this.type=0,this.x=e,this.y=t}return e.prototype.add=function(t,n){return new e(this.x+t,this.y+n)},e}(),Uc=function(e,t,n){return new Hc(e.x+(t.x-e.x)*n,e.y+(t.y-e.y)*n)},Wc=function(){function e(e,t,n,r){this.type=1,this.start=e,this.startControl=t,this.endControl=n,this.end=r}return e.prototype.subdivide=function(t,n){var r=Uc(this.start,this.startControl,t),i=Uc(this.startControl,this.endControl,t),a=Uc(this.endControl,this.end,t),o=Uc(r,i,t),s=Uc(i,a,t),c=Uc(o,s,t);return n?new e(this.start,r,o,c):new e(c,s,a,this.end)},e.prototype.add=function(t,n){return new e(this.start.add(t,n),this.startControl.add(t,n),this.endControl.add(t,n),this.end.add(t,n))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),Gc=function(e){return e.type===1},Kc=function(){function e(e){var t=e.styles,n=e.bounds,r=hr(t.borderTopLeftRadius,n.width,n.height),i=r[0],a=r[1],o=hr(t.borderTopRightRadius,n.width,n.height),s=o[0],c=o[1],l=hr(t.borderBottomRightRadius,n.width,n.height),u=l[0],d=l[1],f=hr(t.borderBottomLeftRadius,n.width,n.height),p=f[0],m=f[1],h=[];h.push((i+s)/n.width),h.push((p+u)/n.width),h.push((a+m)/n.height),h.push((c+d)/n.height);var g=Math.max.apply(Math,h);g>1&&(i/=g,a/=g,s/=g,c/=g,u/=g,d/=g,p/=g,m/=g);var _=n.width-s,v=n.height-d,y=n.width-u,b=n.height-m,x=t.borderTopWidth,S=t.borderRightWidth,C=t.borderBottomWidth,w=t.borderLeftWidth,T=gr(t.paddingTop,e.bounds.width),E=gr(t.paddingRight,e.bounds.width),D=gr(t.paddingBottom,e.bounds.width),O=gr(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=i>0||a>0?Jc(n.left+w/3,n.top+x/3,i-w/3,a-x/3,qc.TOP_LEFT):new Hc(n.left+w/3,n.top+x/3),this.topRightBorderDoubleOuterBox=i>0||a>0?Jc(n.left+_,n.top+x/3,s-S/3,c-x/3,qc.TOP_RIGHT):new Hc(n.left+n.width-S/3,n.top+x/3),this.bottomRightBorderDoubleOuterBox=u>0||d>0?Jc(n.left+y,n.top+v,u-S/3,d-C/3,qc.BOTTOM_RIGHT):new Hc(n.left+n.width-S/3,n.top+n.height-C/3),this.bottomLeftBorderDoubleOuterBox=p>0||m>0?Jc(n.left+w/3,n.top+b,p-w/3,m-C/3,qc.BOTTOM_LEFT):new Hc(n.left+w/3,n.top+n.height-C/3),this.topLeftBorderDoubleInnerBox=i>0||a>0?Jc(n.left+w*2/3,n.top+x*2/3,i-w*2/3,a-x*2/3,qc.TOP_LEFT):new Hc(n.left+w*2/3,n.top+x*2/3),this.topRightBorderDoubleInnerBox=i>0||a>0?Jc(n.left+_,n.top+x*2/3,s-S*2/3,c-x*2/3,qc.TOP_RIGHT):new Hc(n.left+n.width-S*2/3,n.top+x*2/3),this.bottomRightBorderDoubleInnerBox=u>0||d>0?Jc(n.left+y,n.top+v,u-S*2/3,d-C*2/3,qc.BOTTOM_RIGHT):new Hc(n.left+n.width-S*2/3,n.top+n.height-C*2/3),this.bottomLeftBorderDoubleInnerBox=p>0||m>0?Jc(n.left+w*2/3,n.top+b,p-w*2/3,m-C*2/3,qc.BOTTOM_LEFT):new Hc(n.left+w*2/3,n.top+n.height-C*2/3),this.topLeftBorderStroke=i>0||a>0?Jc(n.left+w/2,n.top+x/2,i-w/2,a-x/2,qc.TOP_LEFT):new Hc(n.left+w/2,n.top+x/2),this.topRightBorderStroke=i>0||a>0?Jc(n.left+_,n.top+x/2,s-S/2,c-x/2,qc.TOP_RIGHT):new Hc(n.left+n.width-S/2,n.top+x/2),this.bottomRightBorderStroke=u>0||d>0?Jc(n.left+y,n.top+v,u-S/2,d-C/2,qc.BOTTOM_RIGHT):new Hc(n.left+n.width-S/2,n.top+n.height-C/2),this.bottomLeftBorderStroke=p>0||m>0?Jc(n.left+w/2,n.top+b,p-w/2,m-C/2,qc.BOTTOM_LEFT):new Hc(n.left+w/2,n.top+n.height-C/2),this.topLeftBorderBox=i>0||a>0?Jc(n.left,n.top,i,a,qc.TOP_LEFT):new Hc(n.left,n.top),this.topRightBorderBox=s>0||c>0?Jc(n.left+_,n.top,s,c,qc.TOP_RIGHT):new Hc(n.left+n.width,n.top),this.bottomRightBorderBox=u>0||d>0?Jc(n.left+y,n.top+v,u,d,qc.BOTTOM_RIGHT):new Hc(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=p>0||m>0?Jc(n.left,n.top+b,p,m,qc.BOTTOM_LEFT):new Hc(n.left,n.top+n.height),this.topLeftPaddingBox=i>0||a>0?Jc(n.left+w,n.top+x,Math.max(0,i-w),Math.max(0,a-x),qc.TOP_LEFT):new Hc(n.left+w,n.top+x),this.topRightPaddingBox=s>0||c>0?Jc(n.left+Math.min(_,n.width-S),n.top+x,_>n.width+S?0:Math.max(0,s-S),Math.max(0,c-x),qc.TOP_RIGHT):new Hc(n.left+n.width-S,n.top+x),this.bottomRightPaddingBox=u>0||d>0?Jc(n.left+Math.min(y,n.width-w),n.top+Math.min(v,n.height-C),Math.max(0,u-S),Math.max(0,d-C),qc.BOTTOM_RIGHT):new Hc(n.left+n.width-S,n.top+n.height-C),this.bottomLeftPaddingBox=p>0||m>0?Jc(n.left+w,n.top+Math.min(b,n.height-C),Math.max(0,p-w),Math.max(0,m-C),qc.BOTTOM_LEFT):new Hc(n.left+w,n.top+n.height-C),this.topLeftContentBox=i>0||a>0?Jc(n.left+w+O,n.top+x+T,Math.max(0,i-(w+O)),Math.max(0,a-(x+T)),qc.TOP_LEFT):new Hc(n.left+w+O,n.top+x+T),this.topRightContentBox=s>0||c>0?Jc(n.left+Math.min(_,n.width+w+O),n.top+x+T,_>n.width+w+O?0:s-w+O,c-(x+T),qc.TOP_RIGHT):new Hc(n.left+n.width-(S+E),n.top+x+T),this.bottomRightContentBox=u>0||d>0?Jc(n.left+Math.min(y,n.width-(w+O)),n.top+Math.min(v,n.height+x+T),Math.max(0,u-(S+E)),d-(C+D),qc.BOTTOM_RIGHT):new Hc(n.left+n.width-(S+E),n.top+n.height-(C+D)),this.bottomLeftContentBox=p>0||m>0?Jc(n.left+w+O,n.top+b,Math.max(0,p-(w+O)),m-(C+D),qc.BOTTOM_LEFT):new Hc(n.left+w+O,n.top+n.height-(C+D))}return e}(),qc;(function(e){e[e.TOP_LEFT=0]=`TOP_LEFT`,e[e.TOP_RIGHT=1]=`TOP_RIGHT`,e[e.BOTTOM_RIGHT=2]=`BOTTOM_RIGHT`,e[e.BOTTOM_LEFT=3]=`BOTTOM_LEFT`})(qc||={});var Jc=function(e,t,n,r,i){var a=4*((Math.sqrt(2)-1)/3),o=n*a,s=r*a,c=e+n,l=t+r;switch(i){case qc.TOP_LEFT:return new Wc(new Hc(e,l),new Hc(e,l-s),new Hc(c-o,t),new Hc(c,t));case qc.TOP_RIGHT:return new Wc(new Hc(e,t),new Hc(e+o,t),new Hc(c,l-s),new Hc(c,l));case qc.BOTTOM_RIGHT:return new Wc(new Hc(c,t),new Hc(c,t+s),new Hc(e+o,l),new Hc(e,l));case qc.BOTTOM_LEFT:default:return new Wc(new Hc(c,l),new Hc(c-o,l),new Hc(e,t+s),new Hc(e,t))}},Yc=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},Xc=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},Zc=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},Qc=function(){function e(e,t,n){this.offsetX=e,this.offsetY=t,this.matrix=n,this.type=0,this.target=6}return e}(),$c=function(){function e(e,t){this.path=e,this.target=t,this.type=1}return e}(),el=function(){function e(e){this.opacity=e,this.type=2,this.target=6}return e}(),tl=function(e){return e.type===0},nl=function(e){return e.type===1},rl=function(e){return e.type===2},il=function(e,t){return e.length===t.length?e.some(function(e,n){return e===t[n]}):!1},al=function(e,t,n,r,i){return e.map(function(e,a){switch(a){case 0:return e.add(t,n);case 1:return e.add(t+r,n);case 2:return e.add(t+r,n+i);case 3:return e.add(t,n+i)}return e})},ol=function(){function e(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e}(),sl=function(){function e(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new Kc(this.container),this.container.styles.opacity<1&&this.effects.push(new el(this.container.styles.opacity)),this.container.styles.transform!==null){var n=this.container.bounds.left+this.container.styles.transformOrigin[0].number,r=this.container.bounds.top+this.container.styles.transformOrigin[1].number,i=this.container.styles.transform;this.effects.push(new Qc(n,r,i))}if(this.container.styles.overflowX!==0){var a=Yc(this.curves),o=Zc(this.curves);il(a,o)?this.effects.push(new $c(a,6)):(this.effects.push(new $c(a,2)),this.effects.push(new $c(o,4)))}}return e.prototype.getEffects=function(e){for(var t=[2,3].indexOf(this.container.styles.position)===-1,n=this.parent,r=this.effects.slice(0);n;){var i=n.effects.filter(function(e){return!nl(e)});if(t||n.container.styles.position!==0||!n.parent){if(r.unshift.apply(r,i),t=[2,3].indexOf(n.container.styles.position)===-1,n.container.styles.overflowX!==0){var a=Yc(n.curves),o=Zc(n.curves);il(a,o)||r.unshift(new $c(o,6))}}else r.unshift.apply(r,i);n=n.parent}return r.filter(function(t){return Da(t.target,e)})},e}(),cl=function(e,t,n,r){e.container.elements.forEach(function(i){var a=Da(i.flags,4),o=Da(i.flags,2),s=new sl(i,e);Da(i.styles.display,2048)&&r.push(s);var c=Da(i.flags,8)?[]:r;if(a||o){var l=a||i.styles.isPositioned()?n:t,u=new ol(s);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var d=i.styles.zIndex.order;if(d<0){var f=0;l.negativeZIndex.some(function(e,t){return d>e.element.container.styles.zIndex.order?(f=t,!1):f>0}),l.negativeZIndex.splice(f,0,u)}else if(d>0){var p=0;l.positiveZIndex.some(function(e,t){return d>=e.element.container.styles.zIndex.order?(p=t+1,!1):p>0}),l.positiveZIndex.splice(p,0,u)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(u)}else i.styles.isFloating()?l.nonPositionedFloats.push(u):l.nonPositionedInlineLevel.push(u);cl(s,u,a?u:n,c)}else i.styles.isInlineLevel()?t.inlineLevel.push(s):t.nonInlineLevel.push(s),cl(s,t,n,c);Da(i.flags,8)&&ll(i,c)})},ll=function(e,t){for(var n=e instanceof us?e.start:1,r=e instanceof us?e.reversed:!1,i=0;i<t.length;i++){var a=t[i];a.container instanceof ls&&typeof a.container.value==`number`&&a.container.value!==0&&(n=a.container.value),a.listValue=pc(n,a.container.styles.listStyleType,!0),n+=r?-1:1}},ul=function(e){var t=new sl(e,null),n=new ol(t),r=[];return cl(t,n,n,r),ll(t.container,r),n},dl=function(e,t){switch(t){case 0:return gl(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return gl(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return gl(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);default:return gl(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},fl=function(e,t){switch(t){case 0:return gl(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return gl(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return gl(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);default:return gl(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}},pl=function(e,t){switch(t){case 0:return gl(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return gl(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return gl(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);default:return gl(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}},ml=function(e,t){switch(t){case 0:return hl(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return hl(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return hl(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);default:return hl(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}},hl=function(e,t){var n=[];return Gc(e)?n.push(e.subdivide(.5,!1)):n.push(e),Gc(t)?n.push(t.subdivide(.5,!0)):n.push(t),n},gl=function(e,t,n,r){var i=[];return Gc(e)?i.push(e.subdivide(.5,!1)):i.push(e),Gc(n)?i.push(n.subdivide(.5,!0)):i.push(n),Gc(r)?i.push(r.subdivide(.5,!0).reverse()):i.push(r),Gc(t)?i.push(t.subdivide(.5,!1).reverse()):i.push(t),i},_l=function(e){var t=e.bounds,n=e.styles;return t.add(n.borderLeftWidth,n.borderTopWidth,-(n.borderRightWidth+n.borderLeftWidth),-(n.borderTopWidth+n.borderBottomWidth))},vl=function(e){var t=e.styles,n=e.bounds,r=gr(t.paddingLeft,n.width),i=gr(t.paddingRight,n.width),a=gr(t.paddingTop,n.width),o=gr(t.paddingBottom,n.width);return n.add(r+t.borderLeftWidth,a+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+r+i),-(t.borderTopWidth+t.borderBottomWidth+a+o))},yl=function(e,t){return e===0?t.bounds:e===2?vl(t):_l(t)},bl=function(e,t){return e===0?t.bounds:e===2?vl(t):_l(t)},xl=function(e,t,n){var r=yl(Tl(e.styles.backgroundOrigin,t),e),i=bl(Tl(e.styles.backgroundClip,t),e),a=wl(Tl(e.styles.backgroundSize,t),n,r),o=a[0],s=a[1],c=hr(Tl(e.styles.backgroundPosition,t),r.width-o,r.height-s);return[El(Tl(e.styles.backgroundRepeat,t),c,a,r,i),Math.round(r.left+c[0]),Math.round(r.top+c[1]),o,s]},Sl=function(e){return nr(e)&&e.value===di.AUTO},Cl=function(e){return typeof e==`number`},wl=function(e,t,n){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1];if(!o)return[0,0];if(ur(o)&&s&&ur(s))return[gr(o,n.width),gr(s,n.height)];var c=Cl(a);if(nr(o)&&(o.value===di.CONTAIN||o.value===di.COVER))return Cl(a)?n.width/n.height<a==(o.value===di.COVER)?[n.height*a,n.height]:[n.width,n.width/a]:[n.width,n.height];var l=Cl(r),u=Cl(i),d=l||u;if(Sl(o)&&(!s||Sl(s)))return l&&u?[r,i]:!c&&!d?[n.width,n.height]:d&&c?[l?r:i*a,u?i:r/a]:[l?r:n.width,u?i:n.height];if(c){var f=0,p=0;return ur(o)?f=gr(o,n.width):ur(s)&&(p=gr(s,n.height)),Sl(o)?f=p*a:(!s||Sl(s))&&(p=f/a),[f,p]}var m=null,h=null;if(ur(o)?m=gr(o,n.width):s&&ur(s)&&(h=gr(s,n.height)),m!==null&&(!s||Sl(s))&&(h=l&&u?m/r*i:n.height),h!==null&&Sl(o)&&(m=l&&u?h/i*r:n.width),m!==null&&h!==null)return[m,h];throw Error(`Unable to calculate background-size for element`)},Tl=function(e,t){var n=e[t];return n===void 0?e[0]:n},El=function(e,t,n,r,i){var a=t[0],o=t[1],s=n[0],c=n[1];switch(e){case 2:return[new Hc(Math.round(r.left),Math.round(r.top+o)),new Hc(Math.round(r.left+r.width),Math.round(r.top+o)),new Hc(Math.round(r.left+r.width),Math.round(c+r.top+o)),new Hc(Math.round(r.left),Math.round(c+r.top+o))];case 3:return[new Hc(Math.round(r.left+a),Math.round(r.top)),new Hc(Math.round(r.left+a+s),Math.round(r.top)),new Hc(Math.round(r.left+a+s),Math.round(r.height+r.top)),new Hc(Math.round(r.left+a),Math.round(r.height+r.top))];case 1:return[new Hc(Math.round(r.left+a),Math.round(r.top+o)),new Hc(Math.round(r.left+a+s),Math.round(r.top+o)),new Hc(Math.round(r.left+a+s),Math.round(r.top+o+c)),new Hc(Math.round(r.left+a),Math.round(r.top+o+c))];default:return[new Hc(Math.round(i.left),Math.round(i.top)),new Hc(Math.round(i.left+i.width),Math.round(i.top)),new Hc(Math.round(i.left+i.width),Math.round(i.height+i.top)),new Hc(Math.round(i.left),Math.round(i.height+i.top))]}},Dl=`data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7`,Ol=`Hidden Text`,kl=function(){function e(e){this._data={},this._document=e}return e.prototype.parseMetrics=function(e,t){var n=this._document.createElement(`div`),r=this._document.createElement(`img`),i=this._document.createElement(`span`),a=this._document.body;n.style.visibility=`hidden`,n.style.fontFamily=e,n.style.fontSize=t,n.style.margin=`0`,n.style.padding=`0`,n.style.whiteSpace=`nowrap`,a.appendChild(n),r.src=Dl,r.width=1,r.height=1,r.style.margin=`0`,r.style.padding=`0`,r.style.verticalAlign=`baseline`,i.style.fontFamily=e,i.style.fontSize=t,i.style.margin=`0`,i.style.padding=`0`,i.appendChild(this._document.createTextNode(Ol)),n.appendChild(i),n.appendChild(r);var o=r.offsetTop-i.offsetTop+2;n.removeChild(i),n.appendChild(this._document.createTextNode(Ol)),n.style.lineHeight=`normal`,r.style.verticalAlign=`super`;var s=r.offsetTop-n.offsetTop+2;return a.removeChild(n),{baseline:o,middle:s}},e.prototype.getMetrics=function(e,t){var n=e+` `+t;return this._data[n]===void 0&&(this._data[n]=this.parseMetrics(e,t)),this._data[n]},e}(),Al=function(){function e(e,t){this.context=e,this.options=t}return e}(),jl=1e4,Ml=function(e){t(n,e);function n(t,n){var r=e.call(this,t,n)||this;return r._activeEffects=[],r.canvas=n.canvas?n.canvas:document.createElement(`canvas`),r.ctx=r.canvas.getContext(`2d`),n.canvas||(r.canvas.width=Math.floor(n.width*n.scale),r.canvas.height=Math.floor(n.height*n.scale),r.canvas.style.width=n.width+`px`,r.canvas.style.height=n.height+`px`),r.fontMetrics=new kl(document),r.ctx.scale(r.options.scale,r.options.scale),r.ctx.translate(-n.x,-n.y),r.ctx.textBaseline=`bottom`,r._activeEffects=[],r.context.logger.debug(`Canvas renderer initialized (`+n.width+`x`+n.height+`) with scale `+n.scale),r}return n.prototype.applyEffects=function(e){for(var t=this;this._activeEffects.length;)this.popEffect();e.forEach(function(e){return t.applyEffect(e)})},n.prototype.applyEffect=function(e){this.ctx.save(),rl(e)&&(this.ctx.globalAlpha=e.opacity),tl(e)&&(this.ctx.translate(e.offsetX,e.offsetY),this.ctx.transform(e.matrix[0],e.matrix[1],e.matrix[2],e.matrix[3],e.matrix[4],e.matrix[5]),this.ctx.translate(-e.offsetX,-e.offsetY)),nl(e)&&(this.path(e.path),this.ctx.clip()),this._activeEffects.push(e)},n.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},n.prototype.renderStack=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return t=e.element.container.styles,t.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},n.prototype.renderNode=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:if(Da(e.container.flags,16))debugger;return e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return t.sent(),[4,this.renderNodeContent(e)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},n.prototype.renderTextWithLetterSpacing=function(e,t,n){var r=this;t===0?this.ctx.fillText(e.text,e.bounds.left,e.bounds.top+n):Zo(e.text).reduce(function(t,i){return r.ctx.fillText(i,t,e.bounds.top+n),t+r.ctx.measureText(i).width},e.bounds.left)},n.prototype.createFontStyle=function(e){var t=e.fontVariant.filter(function(e){return e===`normal`||e===`small-caps`}).join(``),n=Ll(e.fontFamily).join(`, `),r=er(e.fontSize)?``+e.fontSize.number+e.fontSize.unit:e.fontSize.number+`px`;return[[e.fontStyle,t,e.fontWeight,r,n].join(` `),n,r]},n.prototype.renderTextNode=function(e,t){return r(this,void 0,void 0,function(){var n,r,a,o,s,c,l,u,d=this;return i(this,function(i){return n=this.createFontStyle(t),r=n[0],a=n[1],o=n[2],this.ctx.font=r,this.ctx.direction=t.direction===1?`rtl`:`ltr`,this.ctx.textAlign=`left`,this.ctx.textBaseline=`alphabetic`,s=this.fontMetrics.getMetrics(a,o),c=s.baseline,l=s.middle,u=t.paintOrder,e.textBounds.forEach(function(e){u.forEach(function(n){switch(n){case 0:d.ctx.fillStyle=Dr(t.color),d.renderTextWithLetterSpacing(e,t.letterSpacing,c);var r=t.textShadow;r.length&&e.text.trim().length&&(r.slice(0).reverse().forEach(function(n){d.ctx.shadowColor=Dr(n.color),d.ctx.shadowOffsetX=n.offsetX.number*d.options.scale,d.ctx.shadowOffsetY=n.offsetY.number*d.options.scale,d.ctx.shadowBlur=n.blur.number,d.renderTextWithLetterSpacing(e,t.letterSpacing,c)}),d.ctx.shadowColor=``,d.ctx.shadowOffsetX=0,d.ctx.shadowOffsetY=0,d.ctx.shadowBlur=0),t.textDecorationLine.length&&(d.ctx.fillStyle=Dr(t.textDecorationColor||t.color),t.textDecorationLine.forEach(function(t){switch(t){case 1:d.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top+c),e.bounds.width,1);break;case 2:d.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top),e.bounds.width,1);break;case 3:d.ctx.fillRect(e.bounds.left,Math.ceil(e.bounds.top+l),e.bounds.width,1);break}}));break;case 1:t.webkitTextStrokeWidth&&e.text.trim().length&&(d.ctx.strokeStyle=Dr(t.webkitTextStrokeColor),d.ctx.lineWidth=t.webkitTextStrokeWidth,d.ctx.lineJoin=window.chrome?`miter`:`round`,d.ctx.strokeText(e.text,e.bounds.left,e.bounds.top+c)),d.ctx.strokeStyle=``,d.ctx.lineWidth=0,d.ctx.lineJoin=`miter`;break}})}),[2]})})},n.prototype.renderReplacedElement=function(e,t,n){if(n&&e.intrinsicWidth>0&&e.intrinsicHeight>0){var r=vl(e),i=Zc(t);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,e.intrinsicWidth,e.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore()}},n.prototype.renderNodeContent=function(e){return r(this,void 0,void 0,function(){var t,r,a,s,c,l,u,u,d,f,p,m,h,g,_,v,y,b,x,u,S,h,v;return i(this,function(i){switch(i.label){case 0:this.applyEffects(e.getEffects(4)),t=e.container,r=e.curves,a=t.styles,s=0,c=t.textNodes,i.label=1;case 1:return s<c.length?(l=c[s],[4,this.renderTextNode(l,a)]):[3,4];case 2:i.sent(),i.label=3;case 3:return s++,[3,1];case 4:if(!(t instanceof os))return[3,8];i.label=5;case 5:return i.trys.push([5,7,,8]),[4,this.context.cache.match(t.src)];case 6:return u=i.sent(),this.renderReplacedElement(t,r,u),[3,8];case 7:return i.sent(),this.context.logger.error(`Error loading image `+t.src),[3,8];case 8:if(t instanceof ss&&this.renderReplacedElement(t,r,t.canvas),!(t instanceof cs))return[3,12];i.label=9;case 9:return i.trys.push([9,11,,12]),[4,this.context.cache.match(t.svg)];case 10:return u=i.sent(),this.renderReplacedElement(t,r,u),[3,12];case 11:return i.sent(),this.context.logger.error(`Error loading svg `+t.svg.substring(0,255)),[3,12];case 12:return t instanceof Ss&&t.tree?(d=new n(this.context,{scale:this.options.scale,backgroundColor:t.backgroundColor,x:0,y:0,width:t.width,height:t.height}),[4,d.render(t.tree)]):[3,14];case 13:f=i.sent(),t.width&&t.height&&this.ctx.drawImage(f,0,0,t.width,t.height,t.bounds.left,t.bounds.top,t.bounds.width,t.bounds.height),i.label=14;case 14:if(t instanceof ys&&(p=Math.min(t.bounds.width,t.bounds.height),t.type===hs?t.checked&&(this.ctx.save(),this.path([new Hc(t.bounds.left+p*.39363,t.bounds.top+p*.79),new Hc(t.bounds.left+p*.16,t.bounds.top+p*.5549),new Hc(t.bounds.left+p*.27347,t.bounds.top+p*.44071),new Hc(t.bounds.left+p*.39694,t.bounds.top+p*.5649),new Hc(t.bounds.left+p*.72983,t.bounds.top+p*.23),new Hc(t.bounds.left+p*.84,t.bounds.top+p*.34085),new Hc(t.bounds.left+p*.39363,t.bounds.top+p*.79)]),this.ctx.fillStyle=Dr(vs),this.ctx.fill(),this.ctx.restore()):t.type===gs&&t.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.bounds.left+p/2,t.bounds.top+p/2,p/4,0,Math.PI*2,!0),this.ctx.fillStyle=Dr(vs),this.ctx.fill(),this.ctx.restore())),Nl(t)&&t.value.length){switch(m=this.createFontStyle(a),h=m[0],g=m[1],_=this.fontMetrics.getMetrics(h,g).baseline,this.ctx.font=h,this.ctx.fillStyle=Dr(a.color),this.ctx.textBaseline=`alphabetic`,this.ctx.textAlign=Fl(t.styles.textAlign),v=vl(t),y=0,t.styles.textAlign){case 1:y+=v.width/2;break;case 2:y+=v.width;break}b=v.add(y,0,0,-v.height/2+1),this.ctx.save(),this.path([new Hc(v.left,v.top),new Hc(v.left+v.width,v.top),new Hc(v.left+v.width,v.top+v.height),new Hc(v.left,v.top+v.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new qo(t.value,b),a.letterSpacing,_),this.ctx.restore(),this.ctx.textBaseline=`alphabetic`,this.ctx.textAlign=`left`}if(!Da(t.styles.display,2048))return[3,20];if(t.styles.listStyleImage===null)return[3,19];if(x=t.styles.listStyleImage,x.type!==0)return[3,18];u=void 0,S=x.url,i.label=15;case 15:return i.trys.push([15,17,,18]),[4,this.context.cache.match(S)];case 16:return u=i.sent(),this.ctx.drawImage(u,t.bounds.left-(u.width+10),t.bounds.top),[3,18];case 17:return i.sent(),this.context.logger.error(`Error loading list-style-image `+S),[3,18];case 18:return[3,20];case 19:e.listValue&&t.styles.listStyleType!==-1&&(h=this.createFontStyle(a)[0],this.ctx.font=h,this.ctx.fillStyle=Dr(a.color),this.ctx.textBaseline=`middle`,this.ctx.textAlign=`right`,v=new o(t.bounds.left,t.bounds.top+gr(t.styles.paddingTop,t.bounds.width),t.bounds.width,Ui(a.lineHeight,a.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new qo(e.listValue,v),a.letterSpacing,Ui(a.lineHeight,a.fontSize.number)/2+2),this.ctx.textBaseline=`bottom`,this.ctx.textAlign=`left`),i.label=20;case 20:return[2]}})})},n.prototype.renderStackContent=function(e){return r(this,void 0,void 0,function(){var t,n,r,a,o,r,s,c,r,l,u,r,d,f,r,p,m,r,h,g,r;return i(this,function(i){switch(i.label){case 0:if(Da(e.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(e.element)];case 1:i.sent(),t=0,n=e.negativeZIndex,i.label=2;case 2:return t<n.length?(r=n[t],[4,this.renderStack(r)]):[3,5];case 3:i.sent(),i.label=4;case 4:return t++,[3,2];case 5:return[4,this.renderNodeContent(e.element)];case 6:i.sent(),a=0,o=e.nonInlineLevel,i.label=7;case 7:return a<o.length?(r=o[a],[4,this.renderNode(r)]):[3,10];case 8:i.sent(),i.label=9;case 9:return a++,[3,7];case 10:s=0,c=e.nonPositionedFloats,i.label=11;case 11:return s<c.length?(r=c[s],[4,this.renderStack(r)]):[3,14];case 12:i.sent(),i.label=13;case 13:return s++,[3,11];case 14:l=0,u=e.nonPositionedInlineLevel,i.label=15;case 15:return l<u.length?(r=u[l],[4,this.renderStack(r)]):[3,18];case 16:i.sent(),i.label=17;case 17:return l++,[3,15];case 18:d=0,f=e.inlineLevel,i.label=19;case 19:return d<f.length?(r=f[d],[4,this.renderNode(r)]):[3,22];case 20:i.sent(),i.label=21;case 21:return d++,[3,19];case 22:p=0,m=e.zeroOrAutoZIndexOrTransformedOrOpacity,i.label=23;case 23:return p<m.length?(r=m[p],[4,this.renderStack(r)]):[3,26];case 24:i.sent(),i.label=25;case 25:return p++,[3,23];case 26:h=0,g=e.positiveZIndex,i.label=27;case 27:return h<g.length?(r=g[h],[4,this.renderStack(r)]):[3,30];case 28:i.sent(),i.label=29;case 29:return h++,[3,27];case 30:return[2]}})})},n.prototype.mask=function(e){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(e.slice(0).reverse()),this.ctx.closePath()},n.prototype.path=function(e){this.ctx.beginPath(),this.formatPath(e),this.ctx.closePath()},n.prototype.formatPath=function(e){var t=this;e.forEach(function(e,n){var r=Gc(e)?e.start:e;n===0?t.ctx.moveTo(r.x,r.y):t.ctx.lineTo(r.x,r.y),Gc(e)&&t.ctx.bezierCurveTo(e.startControl.x,e.startControl.y,e.endControl.x,e.endControl.y,e.end.x,e.end.y)})},n.prototype.renderRepeat=function(e,t,n,r){this.path(e),this.ctx.fillStyle=t,this.ctx.translate(n,r),this.ctx.fill(),this.ctx.translate(-n,-r)},n.prototype.resizeImage=function(e,t,n){if(e.width===t&&e.height===n)return e;var r=(this.canvas.ownerDocument??document).createElement(`canvas`);return r.width=Math.max(1,t),r.height=Math.max(1,n),r.getContext(`2d`).drawImage(e,0,0,e.width,e.height,0,0,t,n),r},n.prototype.renderBackgroundImage=function(e){return r(this,void 0,void 0,function(){var t,n,r,a,o,s;return i(this,function(c){switch(c.label){case 0:t=e.styles.backgroundImage.length-1,n=function(n){var a,o,s,c,l,u,d,f,p,m,c,l,u,d,f,h,g,_,v,y,b,x,S,C,p,w,c,T,E,d,f,D,l,u,O,k,A,ee,j,te,ne,re;return i(this,function(i){switch(i.label){case 0:if(n.type!==0)return[3,5];a=void 0,o=n.url,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r.context.cache.match(o)];case 2:return a=i.sent(),[3,4];case 3:return i.sent(),r.context.logger.error(`Error loading background-image `+o),[3,4];case 4:return a&&(s=xl(e,t,[a.width,a.height,a.width/a.height]),c=s[0],l=s[1],u=s[2],d=s[3],f=s[4],p=r.ctx.createPattern(r.resizeImage(a,d,f),`repeat`),r.renderRepeat(c,p,l,u)),[3,6];case 5:F(n)?(m=xl(e,t,[null,null,null]),c=m[0],l=m[1],u=m[2],d=m[3],f=m[4],h=P(n.angle,d,f),g=h[0],_=h[1],v=h[2],y=h[3],b=h[4],x=document.createElement(`canvas`),x.width=d,x.height=f,S=x.getContext(`2d`),C=S.createLinearGradient(_,y,v,b),Rr(n.stops,g).forEach(function(e){return C.addColorStop(e.stop,Dr(e.color))}),S.fillStyle=C,S.fillRect(0,0,d,f),d>0&&f>0&&(p=r.ctx.createPattern(x,`repeat`),r.renderRepeat(c,p,l,u))):ni(n)&&(w=xl(e,t,[null,null,null]),c=w[0],T=w[1],E=w[2],d=w[3],f=w[4],D=n.position.length===0?[pr]:n.position,l=gr(D[0],d),u=gr(D[D.length-1],f),O=Hr(n,l,u,d,f),k=O[0],A=O[1],k>0&&A>0&&(ee=r.ctx.createRadialGradient(T+l,E+u,0,T+l,E+u,k),Rr(n.stops,k*2).forEach(function(e){return ee.addColorStop(e.stop,Dr(e.color))}),r.path(c),r.ctx.fillStyle=ee,k===A?r.ctx.fill():(j=e.bounds.left+.5*e.bounds.width,te=e.bounds.top+.5*e.bounds.height,ne=A/k,re=1/ne,r.ctx.save(),r.ctx.translate(j,te),r.ctx.transform(1,0,0,ne,0,0),r.ctx.translate(-j,-te),r.ctx.fillRect(T,re*(E-te)+te,d,f*re),r.ctx.restore()))),i.label=6;case 6:return t--,[2]}})},r=this,a=0,o=e.styles.backgroundImage.slice(0).reverse(),c.label=1;case 1:return a<o.length?(s=o[a],[5,n(s)]):[3,4];case 2:c.sent(),c.label=3;case 3:return a++,[3,1];case 4:return[2]}})})},n.prototype.renderSolidBorder=function(e,t,n){return r(this,void 0,void 0,function(){return i(this,function(r){return this.path(dl(n,t)),this.ctx.fillStyle=Dr(e),this.ctx.fill(),[2]})})},n.prototype.renderDoubleBorder=function(e,t,n,a){return r(this,void 0,void 0,function(){var r,o;return i(this,function(i){switch(i.label){case 0:return t<3?[4,this.renderSolidBorder(e,n,a)]:[3,2];case 1:return i.sent(),[2];case 2:return r=fl(a,n),this.path(r),this.ctx.fillStyle=Dr(e),this.ctx.fill(),o=pl(a,n),this.path(o),this.ctx.fill(),[2]}})})},n.prototype.renderNodeBackgroundAndBorders=function(e){return r(this,void 0,void 0,function(){var t,n,r,a,o,s,c,l,u=this;return i(this,function(i){switch(i.label){case 0:return this.applyEffects(e.getEffects(2)),t=e.container.styles,n=!Er(t.backgroundColor)||t.backgroundImage.length,r=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],a=Pl(Tl(t.backgroundClip,0),e.curves),n||t.boxShadow.length?(this.ctx.save(),this.path(a),this.ctx.clip(),Er(t.backgroundColor)||(this.ctx.fillStyle=Dr(t.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(e.container)]):[3,2];case 1:i.sent(),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach(function(t){u.ctx.save();var n=Yc(e.curves),r=t.inset?0:jl,i=al(n,-r+(t.inset?1:-1)*t.spread.number,(t.inset?1:-1)*t.spread.number,t.spread.number*(t.inset?-2:2),t.spread.number*(t.inset?-2:2));t.inset?(u.path(n),u.ctx.clip(),u.mask(i)):(u.mask(n),u.ctx.clip(),u.path(i)),u.ctx.shadowOffsetX=t.offsetX.number+r,u.ctx.shadowOffsetY=t.offsetY.number,u.ctx.shadowColor=Dr(t.color),u.ctx.shadowBlur=t.blur.number,u.ctx.fillStyle=t.inset?Dr(t.color):`rgba(0,0,0,1)`,u.ctx.fill(),u.ctx.restore()}),i.label=2;case 2:o=0,s=0,c=r,i.label=3;case 3:return s<c.length?(l=c[s],l.style!==0&&!Er(l.color)&&l.width>0?l.style===2?[4,this.renderDashedDottedBorder(l.color,l.width,o,e.curves,2)]:[3,5]:[3,11]):[3,13];case 4:return i.sent(),[3,11];case 5:return l.style===3?[4,this.renderDashedDottedBorder(l.color,l.width,o,e.curves,3)]:[3,7];case 6:return i.sent(),[3,11];case 7:return l.style===4?[4,this.renderDoubleBorder(l.color,l.width,o,e.curves)]:[3,9];case 8:return i.sent(),[3,11];case 9:return[4,this.renderSolidBorder(l.color,o,e.curves)];case 10:i.sent(),i.label=11;case 11:o++,i.label=12;case 12:return s++,[3,3];case 13:return[2]}})})},n.prototype.renderDashedDottedBorder=function(e,t,n,a,o){return r(this,void 0,void 0,function(){var r,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,b,x;return i(this,function(i){return this.ctx.save(),r=ml(a,n),s=dl(a,n),o===2&&(this.path(s),this.ctx.clip()),Gc(s[0])?(c=s[0].start.x,l=s[0].start.y):(c=s[0].x,l=s[0].y),Gc(s[1])?(u=s[1].end.x,d=s[1].end.y):(u=s[1].x,d=s[1].y),f=Math.abs(n===0||n===2?c-u:l-d),this.ctx.beginPath(),o===3?this.formatPath(r):this.formatPath(s.slice(0,2)),p=t<3?t*3:t*2,m=t<3?t*2:t,o===3&&(p=t,m=t),h=!0,f<=p*2?h=!1:f<=p*2+m?(g=f/(2*p+m),p*=g,m*=g):(_=Math.floor((f+m)/(p+m)),v=(f-_*p)/(_-1),y=(f-(_+1)*p)/_,m=y<=0||Math.abs(m-v)<Math.abs(m-y)?v:y),h&&(o===3?this.ctx.setLineDash([0,p+m]):this.ctx.setLineDash([p,m])),o===3?(this.ctx.lineCap=`round`,this.ctx.lineWidth=t):this.ctx.lineWidth=t*2+1.1,this.ctx.strokeStyle=Dr(e),this.ctx.stroke(),this.ctx.setLineDash([]),o===2&&(Gc(s[0])&&(b=s[3],x=s[0],this.ctx.beginPath(),this.formatPath([new Hc(b.end.x,b.end.y),new Hc(x.start.x,x.start.y)]),this.ctx.stroke()),Gc(s[1])&&(b=s[1],x=s[2],this.ctx.beginPath(),this.formatPath([new Hc(b.end.x,b.end.y),new Hc(x.start.x,x.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},n.prototype.render=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=Dr(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),t=ul(e),[4,this.renderStack(t)];case 1:return n.sent(),this.applyEffects([]),[2,this.canvas]}})})},n}(Al),Nl=function(e){return e instanceof xs||e instanceof bs?!0:e instanceof ys&&e.type!==gs&&e.type!==hs},Pl=function(e,t){switch(e){case 0:return Yc(t);case 2:return Xc(t);default:return Zc(t)}},Fl=function(e){switch(e){case 1:return`center`;case 2:return`right`;default:return`left`}},Il=[`-apple-system`,`system-ui`],Ll=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter(function(e){return Il.indexOf(e)===-1}):e},Rl=function(e){t(n,e);function n(t,n){var r=e.call(this,t,n)||this;return r.canvas=n.canvas?n.canvas:document.createElement(`canvas`),r.ctx=r.canvas.getContext(`2d`),r.options=n,r.canvas.width=Math.floor(n.width*n.scale),r.canvas.height=Math.floor(n.height*n.scale),r.canvas.style.width=n.width+`px`,r.canvas.style.height=n.height+`px`,r.ctx.scale(r.options.scale,r.options.scale),r.ctx.translate(-n.x,-n.y),r.context.logger.debug(`EXPERIMENTAL ForeignObject renderer initialized (`+n.width+`x`+n.height+` at `+n.x+`,`+n.y+`) with scale `+n.scale),r}return n.prototype.render=function(e){return r(this,void 0,void 0,function(){var t,n;return i(this,function(r){switch(r.label){case 0:return t=Go(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,e),[4,zl(t)];case 1:return n=r.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=Dr(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(n,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},n}(Al),zl=function(e){return new Promise(function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=n,r.src=`data:image/svg+xml;charset=utf-8,`+encodeURIComponent(new XMLSerializer().serializeToString(e))})},Bl=function(){function e(e){var t=e.id,n=e.enabled;this.id=t,this.enabled=n,this.start=Date.now()}return e.prototype.debug=function(){var e=[...arguments];this.enabled&&(typeof window<`u`&&window.console&&typeof console.debug==`function`?console.debug.apply(console,a([this.id,this.getTime()+`ms`],e)):this.info.apply(this,e))},e.prototype.getTime=function(){return Date.now()-this.start},e.prototype.info=function(){var e=[...arguments];this.enabled&&typeof window<`u`&&window.console&&typeof console.info==`function`&&console.info.apply(console,a([this.id,this.getTime()+`ms`],e))},e.prototype.warn=function(){var e=[...arguments];this.enabled&&(typeof window<`u`&&window.console&&typeof console.warn==`function`?console.warn.apply(console,a([this.id,this.getTime()+`ms`],e)):this.info.apply(this,e))},e.prototype.error=function(){var e=[...arguments];this.enabled&&(typeof window<`u`&&window.console&&typeof console.error==`function`?console.error.apply(console,a([this.id,this.getTime()+`ms`],e)):this.info.apply(this,e))},e.instances={},e}(),Vl=function(){function e(t,n){this.windowBounds=n,this.instanceName=`#`+ e.instanceCount++,this.logger=new Bl({id:this.instanceName,enabled:t.logging}),this.cache=t.cache??new Nc(this,t)}return e.instanceCount=1,e}(),Hl=function(e,t){return t===void 0&&(t={}),Ul(e,t)};typeof window<`u`&&R.setContext(window);var Ul=function(e,t){return r(void 0,void 0,void 0,function(){var r,a,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,D;return i(this,function(i){switch(i.label){case 0:if(!e||typeof e!=`object`)return[2,Promise.reject(`Invalid element provided as first argument`)];if(r=e.ownerDocument,!r)throw Error(`Element is not attached to a Document`);if(a=r.defaultView,!a)throw Error(`Document is not attached to a Window`);return l={allowTaint:t.allowTaint??!1,imageTimeout:t.imageTimeout??15e3,proxy:t.proxy,useCORS:t.useCORS??!1},u=n({logging:t.logging??!0,cache:t.cache},l),d={windowWidth:t.windowWidth??a.innerWidth,windowHeight:t.windowHeight??a.innerHeight,scrollX:t.scrollX??a.pageXOffset,scrollY:t.scrollY??a.pageYOffset},f=new o(d.scrollX,d.scrollY,d.windowWidth,d.windowHeight),p=new Vl(u,f),m=t.foreignObjectRendering??!1,h={allowTaint:t.allowTaint??!1,onclone:t.onclone,ignoreElements:t.ignoreElements,inlineImages:m,copyStyles:m},p.logger.debug(`Starting document clone with size `+f.width+`x`+f.height+` scrolled to `+-f.left+`,`+-f.top),g=new hc(p,e,h),_=g.clonedReferenceElement,_?[4,g.toIFrame(r,f)]:[2,Promise.reject(`Unable to find element in cloned iframe`)];case 1:return v=i.sent(),y=Rs(_)||Is(_)?c(_.ownerDocument):s(p,_),b=y.width,x=y.height,S=y.left,C=y.top,w=Wl(p,_,t.backgroundColor),T={canvas:t.canvas,backgroundColor:w,scale:t.scale??a.devicePixelRatio??1,x:(t.x??0)+S,y:(t.y??0)+C,width:t.width??Math.ceil(b),height:t.height??Math.ceil(x)},m?(p.logger.debug(`Document cloned, using foreign object rendering`),D=new Rl(p,T),[4,D.render(_)]):[3,3];case 2:return E=i.sent(),[3,5];case 3:return p.logger.debug(`Document cloned, element located at `+S+`,`+C+` with size `+b+`x`+x+` using computed rendering`),p.logger.debug(`Starting DOM parsing`),O=Es(p,_),w===O.styles.backgroundColor&&(O.styles.backgroundColor=Fr.TRANSPARENT),p.logger.debug(`Starting renderer for element at `+T.x+`,`+T.y+` with size `+T.width+`x`+T.height),D=new Ml(p,T),[4,D.render(O)];case 4:E=i.sent(),i.label=5;case 5:return(t.removeContainer??!0)&&(hc.destroy(v)||p.logger.error(`Cannot detach cloned iframe as it is not in the DOM anymore`)),p.logger.debug(`Finished rendering`),[2,E]}})})},Wl=function(e,t,n){var r=t.ownerDocument,i=r.documentElement?Pr(e,getComputedStyle(r.documentElement).backgroundColor):Fr.TRANSPARENT,a=r.body?Pr(e,getComputedStyle(r.body).backgroundColor):Fr.TRANSPARENT,o=typeof n==`string`?Pr(e,n):n===null?Fr.TRANSPARENT:4294967295;return t===r.documentElement?Er(i)?Er(a)?o:a:i:o};return Hl}))}))(),1);async function vD(e){let t=!1,n,r;document.fullscreenElement===e&&(t=!0,n=e.style.width,r=e.style.height,e.style.width=`100vw`,e.style.height=`100vh`);let i=await(0,_D.default)(e);return t&&(e.style.width=n,e.style.height=r),i.toDataURL()}var rXe={props:{elements:{type:Array,required:!0},shortcuts:{type:Array,required:!0}}},iXe={class:`shortcuts-modal`},aXe={class:`shortcuts-modal__title`},oXe={class:`shortcuts-modal__content`},sXe={class:`shortcuts-modal__content-left`},cXe={class:`shortcuts-modal__content-left__element__image`},lXe={class:`shortcuts-modal__content-left__element__text`},uXe={class:`shortcuts-modal__content-right`},dXe={class:`shortcuts-modal__content-right__element__shortcut`},fXe={key:0,class:`letter`},pXe={key:1,class:`flex items-center`},mXe={class:`maj`},hXe={class:`icon`},gXe={key:2,class:`flex items-center`},_Xe={class:`icon`},vXe={key:3,class:`flex items-center`},yXe={class:`icon`},bXe={class:`shortcuts-modal__content-right__element__text`},xXe={class:`shortcuts-modal__footer`};function SXe(e,t,n,r,i,a){let o=R(`BIMDataIllustration`),s=R(`BIMDataIconAlt`),c=R(`BIMDataButton`);return z(),B(`div`,iXe,[H(`div`,aXe,[H(`span`,null,[Bc(e.$slots,`title`,{},void 0,!0)])]),H(`div`,oXe,[H(`div`,sXe,[(z(!0),B(bu,null,Rc(n.elements,e=>(z(),B(`div`,{key:e.title,class:`shortcuts-modal__content-left__element`},[H(`div`,cXe,[U(o,{name:e.image,x:`200`,y:`200`},null,8,[`name`])]),H(`div`,lXe,[H(`h3`,null,F(e.title),1),H(`p`,null,F(e.text),1)])]))),128))]),H(`div`,uXe,[(z(!0),B(bu,null,Rc(n.shortcuts,e=>(z(),B(`div`,{key:e.text,class:`shortcuts-modal__content-right__element`},[H(`div`,dXe,[e.letter?(z(),B(`span`,fXe,F(e.letter),1)):G(``,!0),e.maj?(z(),B(`div`,pXe,[H(`span`,mXe,[U(s,{size:`xxs`,class:`fill-primary`})]),t[1]||=H(`span`,{class:`more`},`+`,-1),H(`div`,hXe,[U(o,{name:e.illustration,x:`23`,y:`30`},null,8,[`name`])])])):G(``,!0),e.alt?(z(),B(`div`,gXe,[t[2]||=H(`span`,{class:`alt`},` alt `,-1),t[3]||=H(`span`,{class:`more`},`+`,-1),H(`div`,_Xe,[U(o,{name:e.illustration,x:`23`,y:`30`},null,8,[`name`])])])):G(``,!0),e.shift?(z(),B(`div`,vXe,[t[4]||=H(`span`,{class:`alt`},` shift `,-1),t[5]||=H(`span`,{class:`more`},`+`,-1),H(`div`,yXe,[U(o,{name:e.illustration,x:`23`,y:`30`},null,8,[`name`])])])):G(``,!0)]),H(`div`,bXe,F(e.text),1)]))),128))])]),H(`div`,xXe,[U(c,{fill:``,color:`primary`,radius:``,width:`166px`,onClick:t[0]||=t=>e.$emit(`close`)},{default:L(()=>[W(F(e.$t(`shortcuts-helper.btn`)),1)]),_:1})])])}var yD=q(rXe,[[`render`,SXe],[`__scopeId`,`data-v-e7d92a04`]]),CXe={components:{ShortcutsModal:yD},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 wXe(e,t,n,r,i,a){let o=R(`ShortcutsModal`);return z(),V(o,{class:`bimdata-shortcuts2d-helper`,elements:i.elements,shortcuts:i.shortcuts},{title:L(()=>[W(F(e.$t(`shortcuts-helper.title_modal_2d`)),1)]),_:1},8,[`elements`,`shortcuts`])}var TXe=q(CXe,[[`render`,wXe],[`__scopeId`,`data-v-9a9c15e3`]]);function bD(e=null){let t=Xo(`$viewer`);e??=t.localContext;let n=za(Array.from(t.state.annotations)),r=[t.state.hub.on(`annotation-added`,({annotation:e})=>{n.value.push(e),Ha(n)}),t.state.hub.on(`annotation-updated`,()=>{Ha(n)}),t.state.hub.on(`annotation-removed`,({annotation:e})=>{n.value=n.value.filter(t=>t.id!==e.id)})];return Ec(()=>r.forEach(e=>t.state.hub.off(e))),K(()=>n.value.filter(t=>t.modelIds.length===0?!0:t.modelIds.some(t=>e.loadedModelIds.includes(t))))}var xD=e=>t=>{t.preventDefault();let n=new CustomEvent(`wheel`,{bubbles:!0,cancelable:!0,detail:t});n.deltaY=t.deltaY,n.clientX=t.clientX,n.clientY=t.clientY,e.dispatchEvent(n)},SD=q({__name:`AnnotationWrapper`,props:{annotation:{type:Object,required:!0},canvas:{type:HTMLCanvasElement,required:!0}},emits:[`annotation-drag`],setup(e,{emit:t}){let n=e,r=t,i=I(null),a=()=>i.value?.querySelector(n.annotation.grabberSelector)??i.value,o=xD(n.canvas),s=!1,c=e=>{e.button!==2&&(e.targetTouches&&(e.stopPropagation(),e.preventDefault()),n.annotation.draggable&&(document.addEventListener(`mouseup`,l),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,l),document.addEventListener(`mousemove`,u),document.addEventListener(`touchmove`,u,{passive:!1}),n.annotation.emit(`drag-start`,{nativeEvent:e})))},l=e=>{n.annotation.draggable&&(document.removeEventListener(`mousemove`,u),document.removeEventListener(`touchmove`,u),s&&(s=!1,n.annotation.emit(`drag-end`,{nativeEvent:e})))},u=e=>{e.targetTouches&&(e.stopPropagation(),e.preventDefault()),n.annotation.draggable&&(e.targetTouches&&(e.clientX=e.targetTouches[0].clientX,e.clientY=e.targetTouches[0].clientY),r(`annotation-drag`,e),n.annotation.emit(`drag`,{nativeEvent:e}),s=!0)};return Sc(()=>{a()?.addEventListener(`mousedown`,c),a()?.addEventListener(`touchstart`,c,{passive:!1})}),Tc(()=>{a()?.removeEventListener(`mousedown`,c),a()?.removeEventListener(`touchstart`,c)}),(t,n)=>(z(),B(`div`,{ref_key:`wrapper`,ref:i,class:`annotation-wrapper`,onWheel:n[0]||=(...e)=>Ua(o)&&Ua(o)(...e)},[(z(),V(Pc(e.annotation.component),Vu(e.annotation.props,{annotation:e.annotation}),null,16,[`annotation`]))],544))}},[[`__scopeId`,`data-v-840c20b2`]]),EXe={class:`annotations-2d`},CD=q({__name:`Annotations2D`,props:{context:{type:Object,default:null}},setup(e){let t=e,n=Xo(`$viewer`),r=t.context;r||=n.localContext;let i=r.viewer,a=i.viewer??i.engine,o=a.canvas,s=bD(r),c=K(()=>s.value.filter(e=>!i.selectedStorey||e.z>=i.selectedStorey.absoluteElevation&&e.z<i.selectedStorey.absoluteTopElevation));a.camera.on(`update`,()=>Ha(s));let l=(e,t)=>{let{x:r,y:s}=o.getBoundingClientRect(),{clientX:c,clientY:l}=t,{x:u,y:d}=a.camera.getPosition({x:c-r,y:l-s});i.ui?.highlightOnHover===!0&&(i.ui.highlightOnHover=!1,setTimeout(()=>i.ui.highlightOnHover=!0,300)),n.state.highlightedObjects.length>0&&n.state.unhighlightObjects(n.state.highlightedObjects.map(e=>e.id)),Object.assign(e,{x:u,y:d})},u=e=>{let{x:t,y:n}=a.camera.getCanvasPosition(e);return`left: ${t}px; top: ${n}px;`};return(e,t)=>(z(),B(`div`,EXe,[(z(!0),B(bu,null,Rc(c.value,e=>(z(),V(SD,{key:e.instanceId,annotation:e,canvas:Ua(o),style:N(u(e)),onAnnotationDrag:t=>l(e,t)},null,8,[`annotation`,`canvas`,`style`,`onAnnotationDrag`]))),128))]))}},[[`__scopeId`,`data-v-87f776fe`]]),DXe={props:{autoOpen:{type:Boolean,default:!0}},setup(e){let{localContext:t}=Xo(`$viewer`),n=t.viewer?.plugin.name,r=I(!0),i=K(()=>t.loadedModels),a=I(0),o=K(()=>i.value[a.value]||{storeys:[]}),s=K(()=>t.selectedStorey),c=I(!1),l=()=>{c.value=!c.value},u=e=>e.key===s.value?.key,d=e=>{u(e)||t.selectStorey(e)},f=K(()=>t.shownPlans),p=e=>f.value.some(t=>t.key===e.key),{loadingPlans:m}=yE(t),h=e=>m.value.some(t=>t.key===e.key),g=Ta(new Set);return rs([i,o],()=>{i.value.length===0||i.value.length===1&&o.value.type!==`METABUILDING`&&o.value.storeys.length<2&&(o.value.storeys[0]?.plans.length??0)===0?r.value=!1:r.value=!0,r.value&&(n===`viewer2d`||n===`plan`||n===`photosphere`)&&(c.value=e.autoOpen)},{immediate:!0}),{currentModelIndex:a,currentModel:o,storeyPlanShown:g,storeyListOpen:c,isVisible:r,models:i,focus:()=>{o.value&&(c.value||=!0,s.value&&g.add(s.value.uuid))},selectStorey:d,togglePlan:e=>{f.value.some(t=>t.key===e.key)?t.hidePlan(e):t.showPlan(e)},togglePlansList:e=>{g.has(e.key)?g.delete(e.key):g.add(e.key)},toggleStoreysList:l,isStoreySelected:u,isPlanShown:p,isPlanLoading:h}}},OXe={class:`storey-selector`},kXe={class:`storey-selector__list`},AXe=[`onClick`],jXe={class:`name`},MXe={class:`count`},NXe={class:`storey-selector__list__entry__content plan-selector__list`},PXe=[`onClick`],FXe={key:0,class:`loader`},IXe={class:`storey-selector__model-switcher`},LXe={class:`actions`};function RXe(e,t,n,r,i,a){let o=R(`BIMDataRadio`),s=R(`BIMDataIconStorey`),c=R(`BIMDataTextbox`),l=R(`BIMDataIconChevron`),u=R(`BIMDataButton`),d=R(`BIMDataCheckbox`),f=R(`BIMDataSpinner`),p=R(`BIMDataFileIcon`);return z(),B(`div`,OXe,[U(kd,{name:`slide-fade-down`},{default:L(()=>[qo(H(`div`,kXe,[(z(!0),B(bu,null,Rc(r.currentModel.storeys.slice(),e=>(z(),B(`div`,{key:e.key,class:`storey-selector__list__entry`},[U(o,{"model-value":r.isStoreySelected(e),"onUpdate:modelValue":t=>r.selectStorey(e)},null,8,[`model-value`,`onUpdate:modelValue`]),H(`div`,{class:`storey-selector__list__entry__line`,onClick:t=>r.selectStorey(e)},[U(s,{size:`xs`}),H(`span`,jXe,[U(c,{text:e.name},null,8,[`text`])]),e.plans.length>0?(z(),B(bu,{key:0},[H(`span`,MXe,F(e.plans.length),1),U(u,{width:`26px`,height:`26px`,ghost:``,rounded:``,icon:``,onClick:Rf(t=>r.togglePlansList(e),[`stop`])},{default:L(()=>[U(l,{size:`xxs`,rotate:r.storeyPlanShown.has(e.key)?90:0,style:{transition:`transform 0.1s linear`}},null,8,[`rotate`])]),_:2},1032,[`onClick`])],64)):G(``,!0)],8,AXe),U(kd,{name:`slide-fade-up`},{default:L(()=>[qo(H(`div`,NXe,[(z(!0),B(bu,null,Rc(e.plans,t=>(z(),B(`div`,{key:`${t.key}`,class:`plan-selector__list__entry`},[U(d,{class:`plan-selector__list__entry__checkbox`,disabled:!r.isStoreySelected(e)||r.isPlanLoading(t),"model-value":r.isPlanShown(t),"onUpdate:modelValue":e=>r.togglePlan(t)},null,8,[`disabled`,`model-value`,`onUpdate:modelValue`]),H(`div`,{class:`plan-selector__list__entry__line`,style:{cursor:`pointer`},onClick:Rf(n=>{r.isStoreySelected(e)&&!r.isPlanLoading(t)&&r.togglePlan(t)},[`stop`])},[r.isPlanLoading(t)?(z(),B(`span`,FXe,[U(f)])):(z(),V(p,{key:1,"file-name":t.plan.document?.file_name||t.plan.name,size:14},null,8,[`file-name`])),U(c,{"max-width":`200px`,text:t.plan.name},null,8,[`text`])],8,PXe)]))),128))],512),[[Wd,r.storeyPlanShown.has(e.key)]])]),_:2},1024)]))),128))],512),[[Wd,r.storeyListOpen&&r.isVisible]])]),_:1}),qo(H(`div`,IXe,[U(u,{width:`26px`,height:`26px`,ghost:``,radius:``,icon:``,disabled:r.currentModel.storeys.length===0,onClick:r.toggleStoreysList},{default:L(()=>[U(l,{size:`xxs`,rotate:r.storeyListOpen?-90:0,style:{transition:`transform 0.1s linear`}},null,8,[`rotate`])]),_:1},8,[`disabled`,`onClick`]),H(`span`,{class:`name`,onClick:t[0]||=(...e)=>r.toggleStoreysList&&r.toggleStoreysList(...e)},[U(c,{text:r.currentModel.name,"tooltip-position":`top`},null,8,[`text`])]),H(`span`,LXe,[U(u,{width:`26px`,height:`26px`,ghost:``,rounded:``,icon:``,disabled:r.currentModelIndex===0,onClick:t[1]||=e=>r.currentModelIndex--},{default:L(()=>[U(l,{size:`xxs`,rotate:180})]),_:1},8,[`disabled`]),U(u,{width:`26px`,height:`26px`,ghost:``,rounded:``,icon:``,disabled:r.currentModelIndex===r.models.length-1,onClick:t[2]||=e=>r.currentModelIndex++},{default:L(()=>[U(l,{size:`xxs`})]),_:1},8,[`disabled`])])],512),[[Wd,r.isVisible]])])}var wD=q(DXe,[[`render`,RXe],[`__scopeId`,`data-v-c590c341`]]),zXe={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 BXe(e,t,n,r,i,a){return z(),B(`div`,{class:`bimdata-help-shortcuts`,onClick:t[0]||=(...e)=>a.onClick&&a.onClick(...e)},`?`)}var TD=q(zXe,[[`render`,BXe],[`__scopeId`,`data-v-78103e0c`]]);function ED(e,t,n={}){if(!Array.isArray(t)||t.some(e=>!Number.isFinite(e.x)||!Number.isFinite(e.y)))throw TypeError(`[Viewer2d - drawArea] An array of point with x and y properties as finit numbers is requested.`);let r=dv(),{lineWidth:i=1,lineColor:a=r,lineOpacity:o=1,fill:s=r,fillOpacity:c=.2}=n,l=e.scene.addObject({shapes:[{style:{lineWidth:i,lineColor:a,lineOpacity:o,fill:s,fillOpacity:c,nonScalingLineWidth:!0},paths:[{type:`line`,points:t.flatMap(({x:e,y:t})=>[e,t]),close:!0}]}]});return{object:l,get visible(){return l.visible},set visible(e){l.visible=!!e},points:t,destroy(){e.scene.removeObject(l.id)}}}var VXe={name:`Viewer2D`,components:{Annotations:CD,BIMDataStoreySelector:wD,Help:TD},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=TXe,this.localContextSubscriptions=[],this.stateSubscriptions=[],this.queue=QE(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=VT({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=tXe(this),this.plugins=XE(this),this.unsubscribe=$Ye(this),this.plugins.bitmaps){let e=this.plugins.bitmaps;this.localContextSubscriptions.push(this.$viewer.localContext.hub.on(`plan-shown`,({plan:t})=>{e.showPlan(t)}),this.$viewer.localContext.hub.on(`plan-hidden`,({plan:t})=>{e.hidePlan(t)})),this.stateSubscriptions.push(this.$viewer.state.hub.on(`plan-deleted`,({plan:t})=>{e.deletePlan(t)}))}this.$watch(`selectOnClick`,e=>{this.ui.selectOnClick=e},{immediate:!0}),this.$watch(`highlightOnHover`,e=>{this.ui.highlightOnHover=e},{immediate:!0}),this.$watch(`camera3DSynchronization`,e=>{e?(this.cameraObject||=nXe(this.viewer),this.camera3DSubscription=this.$viewer.globalContext.hub.on(`3d-camera-update`,e=>{let{eye:t,look:n,up:r}=e;this.syncRotationFrom3DCamera(t,n,r);let[i,,a]=t,[o,,s]=n;this.cameraObject.sync({x:i,y:a},{x:o,y:s})},{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(e=>e.type===`space`).map(e=>String(e.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],n=[0,1,0]){if(Math.abs(n[0])<2**-52||Math.abs(n[1])<2**-52)return;let{angle:r,sub:i,normalize:a}=this.viewer.utils.vector2D,[o,,s]=e,[c,,l]=t,u=a(i({x:o,y:s},{x:c,y:l}));if(Math.abs(u.x)<2**-52&&Math.abs(u.y)<2**-52)return;let d=null;d=u.x<0?r(u,{x:0,y:1}):r({x:0,y:1},u);let f=n[1]>0?180:0,p=d/Math.PI*180+f;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(e=>e.name),[...e,{name:`fitview`,key:`F`,execute:()=>this.fitViewSelectedObjects()}].forEach(e=>this.$viewer.localContext.registerShortcut(e))},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(e=>t.registerContextCommand(e)),this.camera3DSynchronization&&this.$viewer.globalContext.pluginComponentInstances.has(`viewer3d`)){let t=this.$viewer.globalContext.pluginComponentInstances.get(`viewer3d`)[0];this.$viewer.contextMenu.registerContextCommand({get label(){return e.$t(`viewer2d.move_3d_camera`)},execute:e=>{let{clientX:n,clientY:r}=e,{x:i,y:a}=this.viewer.canvas.getBoundingClientRect(),o=this.viewer.camera.getPosition({x:n-i,y:r-a}),s=t.xeokit.camera.eye;t.xeokit.cameraFlight.flyTo({eye:[o.x,s[1],o.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(e=>this.viewer.scene.objectsMap.get(String(e.id))).filter(Boolean);this.viewer.camera.fitView(t)}else this.viewer.camera.fitView()},async load2DEngineIfc(e){this.loadIfcFromSVG||=ZE(this);let t=await this.loadIfcFromSVG(e.map_file,e.id,e.onlyLoadUuids);if(e.recommanded_2d_angle!==void 0){let t=this.viewer.camera.rotation;this.viewer.camera.rotate(-t-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 n=e[0];if(!n.map_file)throw Error(`Viewer --- ERROR --- Viewer2D Plugin - Impossible to load ifc without a map_file.`);return this.loading=!0,new Promise((e,r)=>{this.queue.push(async()=>{try{this.model&&this.unloadIfc(this.model,!1),await this.load2DEngineIfc(n),this.plugins.compass.onIfcChange(n),this.loading=!1,this.model=n;let r={model:n,ifc:n,plugin:this};if(this.$viewer.localContext.hub.emit(`2d-model-loaded`,r),this.$viewer.globalContext.hub.emit(`2d-model-loaded`,r),n.storeys.length>0){let e=0;if(t?.storeyKey){let r=n.storeys.findIndex(e=>e.key===t.storeyKey);r!==-1&&(e=r)}this.$viewer.localContext.selectStorey(n.storeys[e])}e()}catch(e){r(e)}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 n=e[0],r=()=>{if(this.$viewer.localContext.selectStorey(null),this.model=null,this.viewer.scene.removeModel(String(n.id))){let e={model:n,ifc:n,plugin:this};return this.$viewer.localContext.hub.emit(`2d-model-unloaded`,e),this.$viewer.globalContext.hub.emit(`2d-model-unloaded`,e),!0}else return!1};t?this.queue.push(r):r()},async getSnapshot(){return{snapshot_type:`png`,snapshot_data:await vD(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(e=>e.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 e=null;await new Promise(t=>{e=this.$watch(`loading`,e=>{e||t()},{immediate:!0})}),e()}if(!this.model)return;let{camera_view_point:t,camera_up_vector:n,view_to_world_scale:r}=e.orthogonal_camera,i=this.$viewer.state.getStoreyFromAbsoluteElevation(this.model,t.z);this.$viewer.localContext.selectStorey(i);let a=this.viewer.utils.vector2D.angle({x:1,y:0},n);this.viewer.camera.setViewpoint({...t,rotation:-(a/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:n,y:r}=this.viewer.camera.getPosition(t),i=this.selectedStorey,a=this.viewer.picker.pick(t),o=this.$viewer.state.objectsMap.get(+a?.id)??null;e({x:n,y:r,z:i.absoluteElevation,models:this.$viewer.localContext.loadedModels,storey:i,object:o})}))},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 ED(this.viewer,e,t)}}},HXe={class:`bimdata-viewer2d`},UXe={ref:`canvas`,class:`bimdata-viewer2d__viewer__canvas`},WXe={ref:`texter`,style:{position:`absolute`,top:`0px`,left:`0px`}},GXe={class:`bimdata-viewer2d__header`};function KXe(e,t,n,r,i,a){let o=R(`Annotations`),s=R(`NoModelWindowPlaceHolder`),c=R(`ModelsLoader`),l=R(`Help`),u=R(`BIMDataStoreySelector`);return z(),B(`div`,HXe,[H(`canvas`,UXe,null,512),H(`div`,WXe,null,512),e.engine2dCreated?(z(),V(o,{key:0})):G(``,!0),!e.ifc&&!e.loading?(z(),V(s,{key:1})):G(``,!0),H(`div`,GXe,[e.settings.modelLoader===`disabled`?G(``,!0):qo((z(),V(c,{key:0,ref:`header`,"window-positioning":!1},null,512)),[[Wd,e.modelHeaderShown]]),e.helpShown?(z(),V(l,{key:1,modal:e.helpModal,name:`2D`},null,8,[`modal`])):G(``,!0)]),qo(U(u,{ref:`storeySelector`,"auto-open":e.storeySelectorAutoOpen},null,8,[`auto-open`]),[[Wd,e.storeySelectorShown]])])}var qXe={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ámara 3D aquí`},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éplacer la caméra 3D ici`},it:{window_label:`Visualizzatore 2D`,compass:{N:`N`,NE:`NE`,E:`E`,SE:`SE`,S:`S`,SW:`SO`,W:`O`,NW:`NO`},move_3d_camera:`Sposta qui la fotocamera 3D`}},component:q(VXe,[[`render`,KXe],[`__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}},JXe=`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`,YXe={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:JXe,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=t=>{t.key===`Enter`&&e.blur()});let t=this.$refs.label;t.addEventListener(`mousedown`,e=>{document.addEventListener(`mousemove`,this.onMouseMove),t.requestPointerLock(),this.grabbing=!0;let{clientX:n,clientY:r}=e,{x:i,y:a}=this.$el.getBoundingClientRect();this.elPosition={x:i,y:a},this.container&&(this.containerRect=this.container.getBoundingClientRect()),this.cursorTranslate={x:n-i,y:r-a}}),document.addEventListener(`mouseup`,()=>{document.removeEventListener(`mousemove`,this.onMouseMove),document.exitPointerLock(),this.grabbing=!1,this.containerRect=null,this.elPosition=null})},unmounted(){document.removeEventListener(`keydown`,this.keydownHandler)},methods:{onMouseMove(e){if(this.cursorTranslate={x:this.cursorTranslate.x+e.movementX,y:this.cursorTranslate.y+e.movementY},this.containerRect){let{x:e,y:t,width:n,height:r}=this.containerRect;for(;this.cursorTranslate.x+this.elPosition.x-e>n;)this.cursorTranslate.x-=n;for(;this.cursorTranslate.x+this.elPosition.x<e;)this.cursorTranslate.x+=n;for(;this.cursorTranslate.y+this.elPosition.y-t>r;)this.cursorTranslate.y-=r;for(;this.cursorTranslate.y+this.elPosition.y<t;)this.cursorTranslate.y+=r}this.requestUpdate(this.modelValue+e.movementX*this.step)},onMouseDown(e){e.preventDefault(),this.focus()},focus(){let e=this.$refs.input;e&&e.focus()},blur(){let e=this.$refs.input;e&&e.blur()},onFocus(){this.focused=!0},onBlur(){this.focused=!1},onChange(e){let t=this.fixedValue,n=parseFloat(e.target.value);isNaN(n)&&(n=t),this.requestUpdate(n)},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()}}},XXe=[`value`,`disabled`],ZXe=[`src`];function QXe(e,t,n,r,i,a){let o=Fc(`click-away`);return qo((z(),B(`div`,{class:P([`bimdata-numerical-input`,{"bimdata-numerical-input--focus":i.focused}]),onMousedown:t[3]||=(...e)=>a.onMouseDown&&a.onMouseDown(...e)},[qo(H(`span`,{ref:`label`,class:`bimdata-numerical-input__label`,style:N(`width: ${n.labelWidth}`)},F(n.label),5),[[Wd,n.label]]),H(`input`,{ref:`input`,class:P([`bimdata-numerical-input__input`,{"bimdata-numerical-input__input--centered":n.centered}]),value:`${a.fixedValue}${n.unit}`,disabled:n.disabled,onChange:t[0]||=(...e)=>a.onChange&&a.onChange(...e),onFocus:t[1]||=(...e)=>a.onFocus&&a.onFocus(...e),onBlur:t[2]||=(...e)=>a.onBlur&&a.onBlur(...e)},null,42,XXe),i.grabbing?(z(),B(`div`,{key:0,class:`bimdata-numerical-input__cursor`,style:N(a.cursorTransform)},[H(`img`,{src:i.cursor,style:{transform:`translate(-50%, -50%)`}},null,8,ZXe)],4)):G(``,!0)],34)),[[o,a.away]])}var DD=q(YXe,[[`render`,QXe],[`__scopeId`,`data-v-7438b65a`]]),$Xe={components:{BIMDataNumericalInput:DD},setup(){let e=Xo(`$viewer`),t=Xo(`root`),n=K(()=>t.editedBitmap?t.editedBitmap:{x:0,y:0,scale:0,angle:0,opacity:0}),r=eZe(n),i=async()=>{try{if(t.loading=!0,t.editedBitmap.plan){let{x:n,y:r,scale:i,angle:a,opacity:o,plan:s}=t.editedBitmap,c={...s.plan.transform};Object.assign(s.plan.transform,{translate:[n,r],rotate:a,scale:i,opacity:o}),await e.state.updatePlan(s,c)}else{let{x:r,y:i,angle:a,scale:o,opacity:s}=n.value,c={translate:[r??0,i??0],rotate:a??0,scale:o??1,opacity:s??1},l=await e.state.createPlan(t.model,t.selectedStorey,n.value.document,c);n.value.plan=l}n.value.edited=!1,t.page=`home`}catch(e){console.error(e)}finally{t.loading=!1}};return{root:t,bitmap:n,...r,submit:i}}};function eZe(e){let t={};return Object.entries({x:e=>e,y:e=>e,scale:e=>e,angle:e=>e<0||e>360?(e%360+360)%360:e,opacity:e=>e<0?0:e>1?1:e}).forEach(([n,r])=>{t[n]=K({get:()=>e.value[n],set:t=>e.value[n]=r(t)})}),t}var tZe={class:`viewer2d-background__page__edit`},nZe={class:`viewer2d-background__page__edit__content`},rZe={class:`viewer2d-background__page__edit__content__unit-group`},iZe={class:`viewer2d-background__page__edit__content__unit-group__element`},aZe={class:`viewer2d-background__page__edit__content__unit-group__element`},oZe={class:`viewer2d-background__page__edit__content__unit-group__element`},sZe={class:`viewer2d-background__page__edit__content__unit`},cZe={class:`viewer2d-background__page__edit__content__unit`},lZe={class:`viewer2d-background__page__edit__content__img`},uZe=[`src`],dZe={class:`viewer2d-background__page__edit__validate`};function fZe(e,t,n,r,i,a){let o=R(`BIMDataNumericalInput`),s=R(`BIMDataSlider`),c=R(`BIMDataTextbox`),l=R(`BIMDataButton`);return z(),B(`div`,tZe,[H(`div`,nZe,[H(`section`,null,[H(`span`,null,F(e.$t(`viewer2d-background.location`)),1),H(`div`,rZe,[H(`div`,iZe,[U(o,{modelValue:e.x,"onUpdate:modelValue":t[0]||=t=>e.x=t,label:`X`,container:e.$viewer.localContext.el},null,8,[`modelValue`,`container`])]),H(`div`,aZe,[U(o,{modelValue:e.y,"onUpdate:modelValue":t[1]||=t=>e.y=t,label:`Y`,container:e.$viewer.localContext.el},null,8,[`modelValue`,`container`])]),H(`div`,oZe,[U(o,{modelValue:e.scale,"onUpdate:modelValue":t[2]||=t=>e.scale=t,label:e.$t(`viewer2d-background.scale`),step:.01,min:.01,container:e.$viewer.localContext.el},null,8,[`modelValue`,`label`,`container`])])])]),H(`section`,null,[H(`span`,null,F(e.$t(`viewer2d-background.rotation`)),1),H(`div`,sZe,[U(o,{modelValue:e.angle,"onUpdate:modelValue":t[3]||=t=>e.angle=t,unit:`°`,centered:``},null,8,[`modelValue`]),U(s,{modelValue:e.angle,"onUpdate:modelValue":t[4]||=t=>e.angle=t,min:0,max:360},null,8,[`modelValue`])])]),H(`section`,null,[H(`span`,null,F(e.$t(`viewer2d-background.alpha`)),1),H(`div`,cZe,[U(o,{modelValue:e.opacity,"onUpdate:modelValue":t[5]||=t=>e.opacity=t,centered:``},null,8,[`modelValue`]),U(s,{modelValue:e.opacity,"onUpdate:modelValue":t[6]||=t=>e.opacity=t,min:0,max:1,step:.01},null,8,[`modelValue`])])]),H(`section`,null,[H(`span`,null,F(e.$t(`viewer2d-background.preview`)),1),H(`div`,lZe,[H(`img`,{src:r.bitmap.dataUrl,alt:`Background`},null,8,uZe),U(c,{text:r.bitmap.name,class:`viewer2d-background__page__edit__content__img__name`},null,8,[`text`])])])]),H(`div`,dZe,[U(l,{width:`100%`,color:`primary`,fill:``,radius:``,onClick:r.submit},{default:L(()=>[W(F(r.bitmap&&r.bitmap.plan?e.$t(`global.save`):e.$t(`global.validate`)),1)]),_:1},8,[`onClick`])])])}var pZe=q($Xe,[[`render`,fZe],[`__scopeId`,`data-v-a022440a`]]);function OD(e,t){let n=t.anchorSynchronization===!0&&e.windowManager.registeredWindows.has(`anchor-synchronization`);return{anchorSynchronizationWindowAvailable:n,openAnchorSynchronizationWindow:async({model:t,storey:r,modelToSynchronize:i})=>{if(!n)throw Error(`Anchor Synchronization window is not registered`);if(!t||!i)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 ko(),e.globalContext.localContexts[0].plugins.get(`anchor-synchronization-window`).synchronize(t,r,i)}}}var mZe={components:{BIMDataGED:gv},setup(){let e=Xo(`viewer2d`),t=Xo(`root`),n=Xo(`$plugin`),r=e.$viewer,{openAnchorSynchronizationWindow:i,anchorSynchronizationWindowAvailable:a}=OD(r,n),o=I(null);return{root:t,selectedDocument:o,submit:async()=>{try{t.loading=!0;let n=o.value,s=await r.api.createModel(n.id);if(s=await r.api.waitForModelProcess(s),a){let e=r.state.modelsMap.get(s.id);if(e||=(await r.state.loadModels([s.id],{silent:!0}))[0],!e)throw Error(`Plan model not found`);await i({model:t.model,storey:t.selectedStorey,modelToSynchronize:e})}else{let{x:r,y:i}=e.viewer.camera.position,a=(e.viewer.camera.rotation%360+360)%360,o={translate:[r,i],rotate:a,scale:1,opacity:1},c=await e.plugins.bitmaps.createBitmap(n,{plan:s},o);c.plan=null,c.edited=!0,t.editedBitmap=c,t.page=`edit`}}catch(e){console.error(e),t.page=`home`}finally{o.value=null,t.loading=!1}}}}},hZe={class:`viewer2d-background__page__ged`},gZe={class:`viewer2d-background__page__ged__button`};function _Ze(e,t,n,r,i,a){let o=R(`BIMDataGED`),s=R(`BIMDataButton`);return z(),B(`div`,hZe,[U(o,{ref:`ged`,class:`viewer2d-background__page__ged__ged`,"header-buttons":!1,"single-select-mode":``,"selectable-file-types":[`pdf`,`jpeg`,`jpg`,`png`],onSelectionChange:t[0]||=e=>r.selectedDocument=e[0]},null,512),H(`div`,gZe,[U(s,{width:`100%`,height:`32px`,color:`primary`,fill:``,radius:``,disabled:!r.selectedDocument,onClick:r.submit},{default:L(()=>[W(F(e.$t(`global.validate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var vZe=q(mZe,[[`render`,_Ze],[`__scopeId`,`data-v-d1ac46ef`]]),yZe={setup(){let e=Xo(`$viewer`),t=Xo(`$plugin`),n=Xo(`viewer2d`),r=Xo(`root`),{openAnchorSynchronizationWindow:i,anchorSynchronizationWindowAvailable:a}=OD(e,t),o=I(null);return{root:r,menuIndexDisplayed:o,toggleMenu:e=>{o.value=o.value===e?null:e},closeMenu:e=>{o.value===e&&(o.value=null)},onCreateClick:()=>{r.page=`bond`},onEditClick:async t=>{try{if(r.loading=!0,r.selectedStorey!==t.storey&&e.localContext.selectStorey(t.storey),a){let n=e.state.modelsMap.get(t.plan.id);n||=(await e.state.loadModels([t.plan.id],{silent:!0}))[0],i({model:t.model,storey:t.storey,modelToSynchronize:n})}else await n.plugins.bitmaps.showPlan(t),r.editedBitmap=n.plugins.bitmaps.getBitmap(t),r.page=`edit`}catch(e){console.error(e)}finally{r.loading=!1}},onDeleteClick:async t=>{try{r.loading=!0,await e.state.deletePlan(t)}catch(e){console.error(e)}finally{r.loading=!1}}}}},bZe={class:`viewer2d-background__page__home`},xZe={class:`viewer2d-background__page__home__description`},SZe={class:`viewer2d-background__page__home__list`},CZe={class:`viewer2d-background__page__home__list__element__icon`},wZe={class:`viewer2d-background__page__home__list__element__labels`},TZe={key:0,class:`viewer2d-background__page__home__list__element__menu`},EZe={key:0,class:`viewer2d-background__page__home__list__element__menu__menu`};function DZe(e,t,n,r,i,a){let o=R(`BIMDataButton`),s=R(`BIMDataIconSynchro2D`),c=R(`BIMDataTextbox`),l=R(`BIMDataIconEllipsis`),u=Fc(`click-away`);return z(),B(`div`,bZe,[H(`div`,xZe,F(e.$t(`viewer2d-background.description`)),1),U(o,{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:L(()=>[r.root.storeys.length===0?(z(),B(bu,{key:0},[W(F(e.$t(`viewer2d-background.no_ifc`)),1)],64)):r.root.storeys.length>0?(z(),B(bu,{key:1},[W(F(e.$t(`global.new`)),1)],64)):(z(),B(bu,{key:2},[W(F(e.$t(`viewer2d-background.start`)),1)],64))]),_:1},8,[`disabled`,`onClick`]),H(`ul`,SZe,[(z(!0),B(bu,null,Rc(r.root.plans,t=>(z(),B(`li`,{key:`${t.key}`,class:`viewer2d-background__page__home__list__element`},[H(`div`,CZe,[U(s,{size:`m`,fill:``,color:`primary`})]),H(`div`,wZe,[U(c,{class:`viewer2d-background__page__home__list__element__labels__storey`,text:t.storey.name},null,8,[`text`]),U(c,{class:`viewer2d-background__page__home__list__element__labels__plan`,text:t.plan.name},null,8,[`text`])]),e.$viewer.api.permissions.hasModelWritePermission?qo((z(),B(`div`,TZe,[U(o,{color:`granite`,ghost:``,rounded:``,icon:``,onClick:e=>r.toggleMenu(t.key)},{default:L(()=>[U(l,{size:`l`}),r.menuIndexDisplayed===t.key?(z(),B(`div`,EZe,[U(o,{width:`100%`,color:`granite`,ghost:``,square:``,onClick:e=>r.onEditClick(t)},{default:L(()=>[W(F(e.$t(`global.edit`)),1)]),_:1},8,[`onClick`]),U(o,{width:`100%`,color:`granite`,ghost:``,square:``,onClick:e=>r.onDeleteClick(t)},{default:L(()=>[H(`div`,null,F(e.$t(`global.delete`)),1)]),_:1},8,[`onClick`])])):G(``,!0)]),_:2},1032,[`onClick`])])),[[u,()=>r.closeMenu(t.key)]]):G(``,!0)]))),128))])])}var OZe=q(yZe,[[`render`,DZe],[`__scopeId`,`data-v-ee47f509`]]),kZe={setup(){let e=Xo(`$viewer`);return{root:Xo(`root`),selectStorey:t=>{e.localContext.selectStorey(t)}}}},AZe={class:`viewer2d-background__page__bond`},jZe={class:`viewer2d-background__page__bond__list-title`},MZe={class:`viewer2d-background__page__bond__list-title`};function NZe(e,t,n,r,i,a){let o=R(`BIMDataDropdownList`),s=R(`BIMDataButton`);return z(),B(`div`,AZe,[H(`div`,null,[H(`div`,jZe,` 1 - `+F(e.$t(`viewer2d-background.select_storey`)),1),U(o,{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]||=e=>r.selectStorey(e)},{header:L(()=>[W(F(r.root.selectedStorey?r.root.selectedStorey.name:e.$t(`viewer2d-background.select_storey`)),1)]),element:L(({element:e})=>[H(`span`,{class:P({"viewer2d-background__page__bond__storeys--active":r.root.selectedStorey===e})},F(e.name),3)]),_:1},8,[`list`])]),H(`div`,null,[H(`div`,MZe,` 2 - `+F(e.$t(`viewer2d-background.import_file`)),1),U(s,{width:`100%`,color:`primary`,fill:``,radius:``,disabled:!r.root.selectedStorey,onClick:t[1]||=e=>r.root.page=`ged`},{default:L(()=>[W(F(e.$t(`viewer2d-background.from_ged`)),1)]),_:1},8,[`disabled`])])])}var PZe={name:`Background2D`,components:{edit:pZe,ged:vZe,home:OZe,bond:q(kZe,[[`render`,NZe],[`__scopeId`,`data-v-2573d11f`]])},props:{isOpen:{type:Boolean,default:!1}},setup(){let e=Xo(`$viewer`),t=Xo(`$plugin`),n;try{n=e.localContext.pluginComponentInstances.get(`viewer2d`)}catch(e){n={},console.error(e)}if(!n)throw Error(`[Viewer 2D - synchronization] plugin cannot work without viewer2d plugin with 2d engine on.`);n=Fa(n),Yo(`viewer2d`,n);let r=Ea({page:`home`,loading:!1,modalDisplayed:!1,model:{},storeys:[],plans:[],selectedStorey:null,editedBitmap:null});Yo(`root`,r);let i=e.localContext.hub.on(`models-loaded`,({models:[e]})=>{r.model=e,r.storeys=e.storeys,r.plans=e.storeys.flatMap(e=>e.plans)},{getLastEvent:!0}),a=e.localContext.hub.on(`storey-selected`,({storey:e})=>{r.selectedStorey=e,e||(r.page=`home`)},{getLastEvent:!0}),o=e.state.hub.on(`plan-created`,()=>r.plans=r.model.storeys.flatMap(e=>e.plans)),s=e.state.hub.on(`plan-updated`,()=>r.plans=r.model.storeys.flatMap(e=>e.plans)),c=e.state.hub.on(`plan-deleted`,()=>r.plans=r.model.storeys.flatMap(e=>e.plans));Ec(()=>{e.localContext.hub.off(i),e.localContext.hub.off(a),e.localContext.hub.off(o),e.localContext.hub.off(s),e.localContext.hub.off(c)}),rs(()=>r.page,e=>{e!==`edit`&&(r.editedBitmap=null)},{immediate:!0}),rs(()=>r.editedBitmap,(e,t)=>{t?.edit(!1),e?.edit(!0)},{immediate:!0});let l=()=>{r.page=`home`,r.modalDisplayed=!1,t.close()},u=!0;return{viewer2d:n,root:r,onBackClick:()=>{switch(u=!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`):(n.plugins.bitmaps.deleteBitmap(r.editedBitmap),r.page=`ged`);break;default:r.page=`home`}},onCloseClick:()=>{u=!1,r.editedBitmap?.edited?r.modalDisplayed=!0:l()},onLeaveClick:()=>{r.editedBitmap.plan?r.editedBitmap.reset():n.plugins.bitmaps.deleteBitmap(r.editedBitmap),u?r.editedBitmap.plan?r.page=`home`:r.page=`ged`:l(),r.modalDisplayed=!1},onKeyDown:e=>{r.loading||e.key===`Escape`&&(e.preventDefault(),r.page===`home`?l():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)}},FZe={class:`viewer2d-background`},IZe={class:`viewer2d-background__header__back`},LZe={class:`viewer2d-background__header__title__text`},RZe={key:1,class:`viewer2d-background__modal`},zZe={class:`viewer2d-background__modal__content`},BZe={class:`viewer2d-background__modal__content__symbols`},VZe={class:`viewer2d-background__modal__content__buttons`};function HZe(e,t,n,r,i,a){let o=R(`BIMDataLoading`),s=R(`BIMDataIconArrow`),c=R(`BIMDataButton`),l=R(`BIMDataIconSynchro2D`),u=R(`BIMDataIconClose`),d=R(`BIMDataIconWarning`);return z(),B(`div`,FZe,[r.root.loading?(z(),V(o,{key:0})):G(``,!0),H(`div`,{class:P([`viewer2d-background__header`,{"viewer2d-background__header--home":r.root.page===`home`}])},[H(`div`,IZe,[r.root.page===`home`?G(``,!0):(z(),V(c,{key:0,width:`25px`,height:`25px`,color:`primary`,ghost:``,radius:``,icon:``,onClick:r.onBackClick},{default:L(()=>[U(s,{size:`xs`})]),_:1},8,[`onClick`]))]),H(`div`,{class:P([`viewer2d-background__header__title`,{"viewer2d-background__header__title--home":r.root.page===`home`}])},[U(l,{size:r.root.page===`home`?`l`:`xs`,fill:``,color:`primary`},null,8,[`size`]),H(`span`,LZe,F(e.$t(`viewer2d-background.title`)),1)],2),U(c,{class:`viewer2d-background__header__close`,width:`25px`,height:`25px`,ghost:``,radius:``,icon:``,onClick:r.onCloseClick},{default:L(()=>[U(u,{size:`xs`,fill:``,color:`granite-light`})]),_:1},8,[`onClick`])],2),H(`div`,{class:P([`viewer2d-background__page`,{"viewer2d-background__page--home":r.root.page===`home`}])},[(z(),V(dc,null,[(z(),V(Pc(r.root.page)))],1024))],2),r.root.modalDisplayed?(z(),B(`div`,RZe,[H(`div`,zZe,[H(`div`,BZe,[U(d,{fill:``,color:`high`,size:`l`}),H(`div`,null,F(e.$t(`viewer2d-background.warning`)),1)]),H(`div`,VZe,[U(c,{width:`45%`,color:`high`,fill:``,radius:``,onClick:r.onLeaveClick},{default:L(()=>[W(F(e.$t(`viewer2d-background.leave`)),1)]),_:1},8,[`onClick`]),U(c,{width:`45%`,color:`default`,outline:``,radius:``,onClick:t[0]||=e=>r.root.modalDisplayed=!1},{default:L(()=>[W(F(e.$t(`viewer2d-background.stay`)),1)]),_:1})])])])):G(``,!0)])}var kD=q(PZe,[[`render`,HZe],[`__scopeId`,`data-v-1eece107`]]),AD={tooltip:`Hintergrund`,title:`2D-Viewer-Hintergrund`,location:`Position`,scale:`Maßstab`,rotation:`Rotation`,alpha:`Lichtundurchlässigkeit`,preview:`Vorschau`,import:`Ein Element importieren`,from_ged:`Von dem DMS des Projekts`,from_computer:`Von Ihrem Computer`,no_storey:`Um einen Hintergrund hinzuzufügen, wählen Sie bitte eine IFC und eine Etage aus.`,start:`Start`,description:`Überlagern Sie Ihre PDF-Grundrisse, um sie im 2D-Viewer anzuzeigen`,select_storey:`Wählen Sie eine Etage aus`,import_file:`Importieren Sie eine Datei`,no_ifc:`Um einen Hintergrund hinzuzufügen, wählen Sie bitte eine IFC aus.`,warning:`Möchten Sie diese Seite wirklich verlassen? Möglicherweise gibt es unbestätigte Informationen.`,leave:`Ja, diese Seite verlassen`,stay:`Abbrechen, hier bleiben`},UZe=`Background`,WZe=`2D viewer background`,GZe=`Location`,KZe=`Scale`,qZe=`Rotation`,JZe=`Alpha`,YZe=`Preview`,XZe=`From the project GED`,ZZe=`From your computer`,QZe=`To add a background, please select an IFC and a storey.`,$Ze=`Start`,eQe=`Overlay your PDF plans by floor to view them in the 2D viewer`,tQe=`Select a storey`,nQe=`Import a file`,rQe=`To add a background, please select an IFC with at least one storey.`,iQe=`Are you sure you want to leave this page? There may be some unvalidated information.`,aQe=`Yes, leave this page`,oQe=`Cancel, stay here`,jD={tooltip:UZe,"tooltip-anchor-synchronization":`Synchronization`,title:WZe,location:GZe,scale:KZe,rotation:qZe,alpha:JZe,preview:YZe,import:`Import element`,from_ged:XZe,from_computer:ZZe,no_storey:QZe,start:$Ze,description:eQe,select_storey:tQe,import_file:nQe,no_ifc:rQe,warning:iQe,leave:aQe,stay:oQe},MD={tooltip:`Fondo`,title:`Fondo de visor 2D`,location:`Ubicación`,scale:`Escala`,rotation:`Rotación`,alpha:`Alfa`,preview:`Vista previa`,import:`Elemento de importación`,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ñadir un fondo`,warning:`¿Está seguro de que quiere abandonar esta página? Podría haber información sin validar.`,leave:`Sí, salir de esta página`,stay:`Cancelar y permanecer aquí`},sQe=`Synchronisation 2D`,cQe=`Synchronisation 2D`,lQe=`Position`,uQe=`Echelle`,dQe=`Rotation`,fQe=`Opacité`,pQe=`Aperçu`,mQe=`Depuis la GED du projet`,hQe=`Depuis votre ordinateur`,gQe=`Pour ajouter un fond, veuillez selectionner un IFC et un étage.`,_Qe=`Commencer`,vQe=`Superposez vos plans PDF par étages pour les visualisez dans la visionneuse 2D`,yQe=`Sélectionner un étage`,bQe=`Importer un fichier`,xQe=`Pour ajouter un fond, veuillez selectionner un IFC avec au moins un étage.`,SQe=`Êtes-vous sûr de vouloir quitter cette page ? Il y'a peut-être des informations non validées.`,CQe=`Oui, quitter cette page`,wQe=`Annuler, rester ici`,ND={tooltip:sQe,"tooltip-anchor-synchronization":`Synchronisation`,title:cQe,location:lQe,scale:uQe,rotation:dQe,alpha:fQe,preview:pQe,import:`Importer un élément`,from_ged:mQe,from_computer:hQe,no_storey:gQe,start:_Qe,description:vQe,select_storey:yQe,import_file:bQe,no_ifc:xQe,warning:SQe,leave:CQe,stay:wQe},PD={tooltip:`Sincronizzazione 2D`,title:`Sincronizzazione 2D`,location:`Posizione`,scale:`Scala`,rotation:`Rotazione`,alpha:`Opacità`,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à 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ì, abbandona questa pagina`,stay:`Annulla, resta qui`},TQe={name:`viewer2d-background`,i18n:{de:AD,en:jD,es:MD,fr:ND,it:PD},addToWindows:[`2d`],component:kD,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`}}},FD=`viewer2d-parameters_parameters`,EQe={computed:{viewer2d(){let e=this.$viewer.localContext.pluginComponentInstances.get(`viewer2d`);if(e)return e;{let e=`'Viewer 2D Parameters' plugin cannot work without viewer2d plugin.`;throw console.error(e),Error(e)}},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(FD)||`{}`;e=JSON.parse(t)}catch{localStorage.removeItem(FD)}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(FD,JSON.stringify(e))}}},DQe={class:`viewer2d-parameters`},OQe={class:`viewer2d-parameters_header`},kQe={class:`viewer2d-parameters_content`},AQe={class:`m-b-18`},jQe={class:`m-b-18`},MQe={class:`m-b-18`},NQe={class:`m-b-18`};function PQe(e,t,n,r,i,a){let o=R(`BIMDataIconParameters`),s=R(`BIMDataToggle`);return z(),B(`div`,DQe,[H(`div`,OQe,[U(o,{size:`xs`,margin:`0 12px 0 0`}),H(`span`,null,F(e.$t(`viewer2d-parameters.title`)),1)]),H(`div`,kQe,[H(`div`,AQe,[H(`span`,null,F(e.$t(`viewer2d-parameters.ifc_spaces`)),1),U(s,{modelValue:a.spacesDisplayed,"onUpdate:modelValue":t[0]||=e=>a.spacesDisplayed=e},null,8,[`modelValue`])]),H(`div`,jQe,[H(`span`,null,F(e.$t(`viewer2d-parameters.display_door_openings`)),1),U(s,{modelValue:a.doorsDisplayed,"onUpdate:modelValue":t[1]||=e=>a.doorsDisplayed=e},null,8,[`modelValue`])]),H(`div`,MQe,[H(`span`,null,F(e.$t(`viewer2d-parameters.display_compass`)),1),U(s,{modelValue:a.compassDisplayed,"onUpdate:modelValue":t[2]||=e=>a.compassDisplayed=e},null,8,[`modelValue`])]),H(`div`,NQe,[H(`span`,null,F(e.$t(`viewer2d-parameters.highlight`)),1),U(s,{modelValue:a.highlightOnHover,"onUpdate:modelValue":t[3]||=e=>a.highlightOnHover=e},null,8,[`modelValue`])]),H(`div`,null,[H(`span`,null,F(e.$t(`viewer2d-parameters.camera_sync`)),1),U(s,{modelValue:a.camera3DSynchronization,"onUpdate:modelValue":t[4]||=e=>a.camera3DSynchronization=e},null,8,[`modelValue`])])])])}var FQe={name:`viewer2d-parameters`,i18n:{de:{tooltip:`Einstellungen`,title:`2D-Viewer Einstellungen`,display_door_openings:`Türöffnungen anzeigen`,display_compass:`Kompass anzeigen`,highlight:`Farbliche Markierung`,camera_sync:`Mit 3D-Kamera synchronisieren`,ifc_spaces:`Räume`},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ámetros`,title:`Configuración del visor 2D`,display_door_openings:`Abrir las puertas de la pantalla`,display_compass:`Brújula de visualización`,highlight:`Destacar`,camera_sync:`Sincronización con una cámara 3D`,ifc_spaces:`Espacios`},fr:{tooltip:`Paramètres`,title:`Paramètres du viewer 2D`,display_door_openings:`Afficher l’ouverture de porte`,display_compass:`Afficher la boussole`,highlight:`Surbrillance`,camera_sync:`Synchroniser avec une camera 3D`,ifc_spaces:`Espaces`},it:{tooltip:`Impostazioni`,title:`Impostazioni del visualizzatore 2D`,display_door_openings:`Mostra l'apertura della porta`,display_compass:`Mostra la bussola`,highlight:`Selezione`,camera_sync:`Sincronizza con una fotocamera 3D`,ifc_spaces:`Spazi`}},addToWindows:[`2d`],component:q(EQe,[[`render`,PQe],[`__scopeId`,`data-v-df342105`]]),button:{tooltip:`viewer2d-parameters.tooltip`,stance:-1,position:`right`,content:`simple`,icon:{component:`BIMDataIconParameters`,options:{size:`m`}}}},IQe={name:`viewer2d-screenshot`,i18n:{de:{tooltip:`Bildschirmaufnahme`},en:{tooltip:`Screenshot`},es:{tooltip:`Captura de pantalla`},fr:{tooltip:`Capture d'écran`},it:{tooltip:`Screenshot`}},addToWindows:[`2d`],component:{computed:{viewer2d(){let e=this.$viewer.localContext.pluginComponentInstances.get(`viewer2d`);if(e)return e;{let e=`'Viewer 2D Screenshot' plugin cannot work without viewer2d plugin.`;throw console.error(e),Error(e)}}},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,n={};document.fullscreenElement===e&&(t=!0,n.width=e.style.width,n.height=e.style.height,e.style.width=`100vw`,e.style.height=`100vh`);let r=await(0,_D.default)(this.$viewer.localContext.el);t&&(e.style.width=n.width,e.style.height=n.height);let i=document.createElement(`a`);i.download=this.viewer2d.ifc&&this.viewer2d.ifc.name?String(this.viewer2d.ifc.name).split(`.ifc`)[0]:`2d-capture.png`,i.href=r.toDataURL(),i.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`}}}},ID=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}},LD=new ID,LQe=class{constructor(e){this.id=e,this.parentItem=null,this.groups=[],this.menuElement=null,this.shown=!1,this.mouseOver=0}},RQe=class{constructor(){this.items=[]}},zQe=class{constructor(e,t,n,r,i){this.id=e,this.getTitle=t,this.doAction=n,this.getEnabled=r,this.getShown=i,this.itemElement=null,this.subMenu=null,this.enabled=!0}},BQe=class{constructor(e={}){this._id=LD.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`,e=>{e.target.classList.contains(`xeokit-context-menu-item`)||this.hide()}),this._parentNode.addEventListener(`touchstart`,this._canvasTouchStartHandler=e=>{e.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 n=this._eventSubs[e];n||(n=[],this._eventSubs[e]=n),n.push(t)}fire(e,t){let n=this._eventSubs[e];if(n)for(let e=0,r=n.length;e<r;e++)n[e](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&&(LD.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=e=>{let n=new LQe(this._getNextId());for(let r=0,i=e.length;r<i;r++){let i=e[r],a=new RQe;n.groups.push(a);for(let e=0,r=i.length;e<r;e++){let r=i[e],o=r.items,s=o&&o.length>0,c=new zQe(this._getNextId(),r.getTitle||(()=>r.title||``),r.doAction||r.callback||(()=>{}),r.getEnabled||(()=>!0),r.getShown||(()=>!0));if(c.parentMenu=n,a.items.push(c),s){let e=t(o);c.subMenu=e,e.parentItem=c}this._itemList.push(c),this._itemMap[c.id]=c}}return this._menuList.push(n),this._menuMap[n.id]=n,n};this._rootMenu=t(e)}_getNextId(){return`ContextMenu_`+this._id+`_`+ this._nextId++}_createUI(){let e=t=>{this._createMenuUI(t);let n=t.groups;for(let t=0,r=n.length;t<r;t++){let r=n[t].items;for(let t=0,n=r.length;t<n;t++){let n=r[t].subMenu;n&&e(n)}}};e(this._rootMenu)}_createMenuUI(e){let t=e.groups,n=[],r=document.createElement(`div`);if(r.classList.add(`xeokit-context-menu`,e.id),r.style.zIndex=3e5,r.style.position=`absolute`,n.push(`<ul>`),t)for(let e=0,r=t.length;e<r;e++){let i=t[e],a=e,o=r,s=i.items;if(s)for(let e=0,t=s.length;e<t;e++){let r=s[e],i=r.subMenu,c=r.title||``;i?(n.push(`<li id="`+r.id+`" class="xeokit-context-menu-item xeokit-context-menu-submenu">`+c+`</li>`),a===o-1||e<t-1||n.push(`<li id="`+r.id+`" class="xeokit-context-menu-item-separator"></li>`)):(n.push(`<li id="`+r.id+`" class="xeokit-context-menu-item">`+c+`</li>`),a===o-1||e<t-1||n.push(`<li id="`+r.id+`" class="xeokit-context-menu-item-separator"></li>`))}}n.push(`</ul>`),r.innerHTML=n.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=e=>{e.preventDefault()};let i=this,a=null;if(t)for(let e=0,n=t.length;e<n;e++){let n=t[e].items;if(n)for(let e=0,t=n.length;e<t;e++){let t=n[e],r=t.subMenu;if(t.itemElement=this._parentNode.querySelector(`#${t.id}`),!t.itemElement){console.error(`ContextMenu item element not found: `+t.id);continue}t.itemElement.addEventListener(`mouseenter`,e=>{e.preventDefault();let n=t.subMenu;if(!n){a&&=(i._hideMenu(a.id),null);return}if(a&&a.id!==n.id&&(i._hideMenu(a.id),a=null),t.enabled===!1)return;let r=t.itemElement,o=n.menuElement,s=r.getBoundingClientRect();o.getBoundingClientRect();let c=i._offsetParent.getBoundingClientRect(),l=s.right+200<c.right,u=s.left-200>c.left;if(l)i._showMenu(n.id,s.right+window.scrollX-5,s.top+window.scrollY-1);else if(u)i._showMenu(n.id,s.left-200+window.scrollX,s.top+window.scrollY-1);else{let e=s.left-c.left,t=c.right-s.right;t>e?i._showMenu(n.id,s.right-5-(200-t),s.top+window.scrollY-1):i._showMenu(n.id,s.left-e,s.top+window.scrollY-1)}a=n}),r||(t.itemElement.addEventListener(`click`,e=>{e.preventDefault(),i._context&&t.enabled!==!1&&(t.doAction&&t.doAction(i._context),this._hideOnAction?i.hide():(i._updateItemsTitles(),i._updateItemsEnabledStatus()))}),t.itemElement.addEventListener(`mouseup`,e=>{e.which===3&&(e.preventDefault(),i._context&&t.enabled!==!1&&(t.doAction&&t.doAction(i._context),this._hideOnAction?i.hide():(i._updateItemsTitles(),i._updateItemsEnabledStatus())))}),t.itemElement.addEventListener(`mouseenter`,e=>{e.preventDefault(),t.enabled!==!1&&t.doHover&&t.doHover(i._context)}))}}}_updateItemsTitles(){if(this._context)for(let e=0,t=this._itemList.length;e<t;e++){let t=this._itemList[e],n=t.itemElement;if(!n)continue;let r=t.getShown;if(!r||!r(this._context))continue;let i=t.getTitle(this._context);t.subMenu,n.innerText=i}}_updateItemsEnabledStatus(){if(this._context)for(let e=0,t=this._itemList.length;e<t;e++){let t=this._itemList[e],n=t.itemElement;if(!n)continue;let r=t.getEnabled;if(!r)continue;let i=t.getShown;if(!i)continue;let a=i(this._context);if(t.shown=a,a)n.style.display=``;else{n.style.display=`none`;continue}let o=r(this._context);t.enabled=o,o?n.classList.remove(`disabled`):n.classList.add(`disabled`)}}_updateSubMenuInfo(){if(!this._context)return;let e,t,n,r,i,a;this._itemList.forEach(o=>{o.subMenu&&(e=o.itemElement,t=e.getBoundingClientRect(),n=o.subMenu.menuElement,r={visibility:n.style.visibility,display:n.style.display},n.style.display=`block`,n.style.visibility=`hidden`,a=o.subMenu.menuElement.getBoundingClientRect().width,n.style.visibility=r.visibility,n.style.display=r.display,i=t.right+a>window.innerWidth,e.setAttribute(`data-submenuposition`,i?`left`:`right`))})}_showMenu(e,t,n){let r=this._menuMap[e];if(!r){console.error(`Menu not found: `+e);return}if(r.shown)return;let i=r.menuElement;i&&(this._showMenuElement(i,t,n),r.shown=!0)}_hideMenu(e){let t=this._menuMap[e];if(!t){console.error(`Menu not found: `+e);return}if(!t.shown)return;let n=t.menuElement;n&&(this._hideMenuElement(n),t.shown=!1)}_hideAllMenus(){for(let e=0,t=this._menuList.length;e<t;e++){let t=this._menuList[e];this._hideMenu(t.id)}}_showMenuElement(e,t,n){e.style.display=`block`;let r=e.offsetHeight,i=e.offsetWidth,a=this._offsetParent.getBoundingClientRect(),o=this._offsetParent===window.document.body&&a.bottom===0?window.innerHeight:a.bottom+window.scrollY,s=a.right+window.scrollX;n+r>o&&(n=o-r),t+i>s&&(t=s-i),e.style.left=t-a.left-window.scrollX+`px`,e.style.top=n-a.top-window.scrollY+`px`}_hideMenuElement(e){e.style.display=`none`}},VQe=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(),n=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`,n&&(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 i=this._lensParams.canvasSize/2-this._lensParams.cursorSize/2-this._lensParams.cursorBorder,a=this._snappedCanvasPos?this._snappedCanvasPos[0]-this._canvasPos[0]:0,o=this._snappedCanvasPos?this._snappedCanvasPos[1]-this._canvasPos[1]:0;this._lensCursorDiv.style.left=`${i+a*this._zoomLevel}px`,this._lensCursorDiv.style.top=`${i+o*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,n]=e?[`greenyellow`,`green`]:[`pink`,`red`];this._lensCursorDiv.style.background=t,this._lensCursorDiv.style.border=this._lensParams.cursorBorder+`px solid `+n}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)}},RD=!0,zD=RD?Float64Array:Float32Array,BD=new zD(3),VD=new zD(16),HD=new zD(16),HQe=new zD(4),Y={setDoublePrecisionEnabled(e){RD=e,zD=RD?Float64Array:Float32Array},getDoublePrecisionEnabled(){return RD},MIN_DOUBLE:-(2**53-1),MAX_DOUBLE:2**53-1,MAX_INT:1e7,DEGTORAD:.0174532925,RADTODEG:57.295779513,unglobalizeObjectId(e,t){let n=t.indexOf(`#`);return n===e.length&&t.startsWith(e)?t.substring(n+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 zD(e||2)},vec3(e){return new zD(e||3)},vec4(e){return new zD(e||4)},mat3(e){return new zD(e||9)},mat3ToMat4(e,t=new zD(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 zD(e||16)},mat4ToMat3(e,t=new zD(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,n){let r=new zD(2);for(let i=0,a=e.length;i<a;i++)Y.splitDouble(e[i],r),t[i]=r[0],n[i]=r[1]},splitDouble(e,t){let n=zD.from([e])[0],r=e-n;t[0]=n,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,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return`${e[t&255]+e[t>>8&255]+e[t>>16&255]+e[t>>24&255]}-${e[n&255]}${e[n>>8&255]}-${e[n>>16&15|64]}${e[n>>24&255]}-${e[r&63|128]}${e[r>>8&255]}-${e[r>>16&255]}${e[r>>24&255]}${e[i&255]}${e[i>>8&255]}${e[i>>16&255]}${e[i>>24&255]}`}})(),clamp(e,t,n){return Math.max(t,Math.min(n,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,n){return n||=e,n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n},addVec4Scalar(e,t,n){return n||=e,n[0]=e[0]+t,n[1]=e[1]+t,n[2]=e[2]+t,n[3]=e[3]+t,n},addVec3(e,t,n){return n||=e,n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n},addVec3Scalar(e,t,n){return n||=e,n[0]=e[0]+t,n[1]=e[1]+t,n[2]=e[2]+t,n},subVec4(e,t,n){return n||=e,n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n},subVec3(e,t,n){return n||=e,n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n},subVec2(e,t,n){return n||=e,n[0]=e[0]-t[0],n[1]=e[1]-t[1],n},geometricMeanVec2(...e){let t=new zD(e[0]);for(let n=1;n<e.length;n++)t[0]+=e[n][0],t[1]+=e[n][1];return t[0]/=e.length,t[1]/=e.length,t},subVec4Scalar(e,t,n){return n||=e,n[0]=e[0]-t,n[1]=e[1]-t,n[2]=e[2]-t,n[3]=e[3]-t,n},subScalarVec4(e,t,n){return n||=e,n[0]=t-e[0],n[1]=t-e[1],n[2]=t-e[2],n[3]=t-e[3],n},mulVec4(e,t,n){return n||=e,n[0]=e[0]*t[0],n[1]=e[1]*t[1],n[2]=e[2]*t[2],n[3]=e[3]*t[3],n},mulVec4Scalar(e,t,n){return n||=e,n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n},mulVec3Scalar(e,t,n){return n||=e,n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n},mulVec2Scalar(e,t,n){return n||=e,n[0]=e[0]*t,n[1]=e[1]*t,n},divVec3(e,t,n){return n||=e,n[0]=e[0]/t[0],n[1]=e[1]/t[1],n[2]=e[2]/t[2],n},divVec4(e,t,n){return n||=e,n[0]=e[0]/t[0],n[1]=e[1]/t[1],n[2]=e[2]/t[2],n[3]=e[3]/t[3],n},divScalarVec3(e,t,n){return n||=t,n[0]=e/t[0],n[1]=e/t[1],n[2]=e/t[2],n},divVec3Scalar(e,t,n){return n||=e,n[0]=e[0]/t,n[1]=e[1]/t,n[2]=e[2]/t,n},divVec4Scalar(e,t,n){return n||=e,n[0]=e[0]/t,n[1]=e[1]/t,n[2]=e[2]/t,n[3]=e[3]/t,n},divScalarVec4(e,t,n){return n||=t,n[0]=e/t[0],n[1]=e/t[1],n[2]=e/t[2],n[3]=e/t[3],n},dotVec4(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},cross3Vec4(e,t){let n=e[0],r=e[1],i=e[2],a=t[0],o=t[1],s=t[2];return[r*s-i*o,i*a-n*s,n*o-r*a,0]},cross3Vec3(e,t,n){n||=e;let r=e[0],i=e[1],a=e[2],o=t[0],s=t[1],c=t[2];return n[0]=i*c-a*s,n[1]=a*o-r*c,n[2]=r*s-i*o,n},sqLenVec4(e){return Y.dotVec4(e,e)},lenVec4(e){return Math.sqrt(Y.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 Y.dotVec3(e,e)},sqLenVec2(e){return Y.dotVec2(e,e)},lenVec3(e){return Math.sqrt(Y.sqLenVec3(e))},distVec3:(()=>{let e=new zD(3);return(t,n)=>Y.lenVec3(Y.subVec3(t,n,e))})(),lenVec2(e){return Math.sqrt(Y.sqLenVec2(e))},distVec2:(()=>{let e=new zD(2);return(t,n)=>Y.lenVec2(Y.subVec2(t,n,e))})(),rcpVec3(e,t){return Y.divScalarVec3(1,e,t)},normalizeVec4(e,t){let n=1/Y.lenVec4(e);return Y.mulVec4Scalar(e,n,t)},normalizeVec3(e,t){let n=1/Y.lenVec3(e);return Y.mulVec3Scalar(e,n,t)},normalizeVec2(e,t){let n=1/Y.lenVec2(e);return Y.mulVec2Scalar(e,n,t)},angleVec3(e,t){let n=Y.dotVec3(e,t)/Math.sqrt(Y.sqLenVec3(e)*Y.sqLenVec3(t));return n=n<-1?-1:n>1?1:n,Math.acos(n)},vec3FromMat4Scale:(()=>{let e=new zD(3);return(t,n)=>(e[0]=t[0],e[1]=t[1],e[2]=t[2],n[0]=Y.lenVec3(e),e[0]=t[4],e[1]=t[5],e[2]=t[6],n[1]=Y.lenVec3(e),e[0]=t[8],e[1]=t[9],e[2]=t[10],n[2]=Y.lenVec3(e),n)})(),vecToArray:(()=>{function e(e){return Math.round(e*1e5)/1e5}return t=>{t=Array.prototype.slice.call(t);for(let n=0,r=t.length;n<r;n++)t[n]=e(t[n]);return t}})(),xyzArrayToObject(e){return{x:e[0],y:e[1],z:e[2]}},xyzObjectToArray(e,t){return t||=Y.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 Y.m4s(0)},setMat4ToOnes(){return Y.m4s(1)},diagonalMat4v(e){return new zD([e[0],0,0,0,0,e[1],0,0,0,0,e[2],0,0,0,0,e[3]])},diagonalMat4c(e,t,n,r){return Y.diagonalMat4v([e,t,n,r])},diagonalMat4s(e){return Y.diagonalMat4c(e,e,e,e)},identityMat4(e=new zD(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 zD(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,n){return n||=e,n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},addMat4Scalar(e,t,n){return n||=e,n[0]=e[0]+t,n[1]=e[1]+t,n[2]=e[2]+t,n[3]=e[3]+t,n[4]=e[4]+t,n[5]=e[5]+t,n[6]=e[6]+t,n[7]=e[7]+t,n[8]=e[8]+t,n[9]=e[9]+t,n[10]=e[10]+t,n[11]=e[11]+t,n[12]=e[12]+t,n[13]=e[13]+t,n[14]=e[14]+t,n[15]=e[15]+t,n},addScalarMat4(e,t,n){return Y.addMat4Scalar(t,e,n)},subMat4(e,t,n){return n||=e,n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},subMat4Scalar(e,t,n){return n||=e,n[0]=e[0]-t,n[1]=e[1]-t,n[2]=e[2]-t,n[3]=e[3]-t,n[4]=e[4]-t,n[5]=e[5]-t,n[6]=e[6]-t,n[7]=e[7]-t,n[8]=e[8]-t,n[9]=e[9]-t,n[10]=e[10]-t,n[11]=e[11]-t,n[12]=e[12]-t,n[13]=e[13]-t,n[14]=e[14]-t,n[15]=e[15]-t,n},subScalarMat4(e,t,n){return n||=t,n[0]=e-t[0],n[1]=e-t[1],n[2]=e-t[2],n[3]=e-t[3],n[4]=e-t[4],n[5]=e-t[5],n[6]=e-t[6],n[7]=e-t[7],n[8]=e-t[8],n[9]=e-t[9],n[10]=e-t[10],n[11]=e-t[11],n[12]=e-t[12],n[13]=e-t[13],n[14]=e-t[14],n[15]=e-t[15],n},mulMat4(e,t,n){n||=e;let r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],l=e[6],u=e[7],d=e[8],f=e[9],p=e[10],m=e[11],h=e[12],g=e[13],_=e[14],v=e[15],y=t[0],b=t[1],x=t[2],S=t[3],C=t[4],w=t[5],T=t[6],E=t[7],D=t[8],O=t[9],k=t[10],A=t[11],ee=t[12],j=t[13],te=t[14],ne=t[15];return n[0]=y*r+b*s+x*d+S*h,n[1]=y*i+b*c+x*f+S*g,n[2]=y*a+b*l+x*p+S*_,n[3]=y*o+b*u+x*m+S*v,n[4]=C*r+w*s+T*d+E*h,n[5]=C*i+w*c+T*f+E*g,n[6]=C*a+w*l+T*p+E*_,n[7]=C*o+w*u+T*m+E*v,n[8]=D*r+O*s+k*d+A*h,n[9]=D*i+O*c+k*f+A*g,n[10]=D*a+O*l+k*p+A*_,n[11]=D*o+O*u+k*m+A*v,n[12]=ee*r+j*s+te*d+ne*h,n[13]=ee*i+j*c+te*f+ne*g,n[14]=ee*a+j*l+te*p+ne*_,n[15]=ee*o+j*u+te*m+ne*v,n},mulMat3(e,t,n){n||=new zD(9);let r=e[0],i=e[3],a=e[6],o=e[1],s=e[4],c=e[7],l=e[2],u=e[5],d=e[8],f=t[0],p=t[3],m=t[6],h=t[1],g=t[4],_=t[7],v=t[2],y=t[5],b=t[8];return n[0]=r*f+i*h+a*v,n[3]=r*p+i*g+a*y,n[6]=r*m+i*_+a*b,n[1]=o*f+s*h+c*v,n[4]=o*p+s*g+c*y,n[7]=o*m+s*_+c*b,n[2]=l*f+u*h+d*v,n[5]=l*p+u*g+d*y,n[8]=l*m+u*_+d*b,n},mulMat4Scalar(e,t,n){return n||=e,n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},mulMat4v4(e,t,n=Y.vec4()){let r=t[0],i=t[1],a=t[2],o=t[3];return n[0]=e[0]*r+e[4]*i+e[8]*a+e[12]*o,n[1]=e[1]*r+e[5]*i+e[9]*a+e[13]*o,n[2]=e[2]*r+e[6]*i+e[10]*a+e[14]*o,n[3]=e[3]*r+e[7]*i+e[11]*a+e[15]*o,n},transposeMat4(e,t){let n=e[4],r=e[14],i=e[8],a=e[13],o=e[12],s=e[9];if(!t||e===t){let t=e[1],c=e[2],l=e[3],u=e[6],d=e[7],f=e[11];return e[1]=n,e[2]=i,e[3]=o,e[4]=t,e[6]=s,e[7]=a,e[8]=c,e[9]=u,e[11]=r,e[12]=l,e[13]=d,e[14]=f,e}return t[0]=e[0],t[1]=n,t[2]=i,t[3]=o,t[4]=e[1],t[5]=e[5],t[6]=s,t[7]=a,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 n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}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],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15];return p*u*s*i-l*m*s*i-p*o*d*i+a*m*d*i+l*o*h*i-a*u*h*i-p*u*r*c+l*m*r*c+p*n*d*c-t*m*d*c-l*n*h*c+t*u*h*c+p*o*r*f-a*m*r*f-p*n*s*f+t*m*s*f+a*n*h*f-t*o*h*f-l*o*r*g+a*u*r*g+l*n*s*g-t*u*s*g-a*n*d*g+t*o*d*g},inverseMat4(e,t){t||=e;let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],d=e[9],f=e[10],p=e[11],m=e[12],h=e[13],g=e[14],_=e[15],v=n*s-r*o,y=n*c-i*o,b=n*l-a*o,x=r*c-i*s,S=r*l-a*s,C=i*l-a*c,w=u*h-d*m,T=u*g-f*m,E=u*_-p*m,D=d*g-f*h,O=d*_-p*h,k=f*_-p*g,A=1/(v*k-y*O+b*D+x*E-S*T+C*w);return t[0]=(s*k-c*O+l*D)*A,t[1]=(-r*k+i*O-a*D)*A,t[2]=(h*C-g*S+_*x)*A,t[3]=(-d*C+f*S-p*x)*A,t[4]=(-o*k+c*E-l*T)*A,t[5]=(n*k-i*E+a*T)*A,t[6]=(-m*C+g*b-_*y)*A,t[7]=(u*C-f*b+p*y)*A,t[8]=(o*O-s*E+l*w)*A,t[9]=(-n*O+r*E-a*w)*A,t[10]=(m*S-h*b+_*v)*A,t[11]=(-u*S+d*b-p*v)*A,t[12]=(-o*D+s*T-c*w)*A,t[13]=(n*D-r*T+i*w)*A,t[14]=(-m*x+h*y-g*v)*A,t[15]=(u*x-d*y+f*v)*A,t},traceMat4(e){return e[0]+e[5]+e[10]+e[15]},translationMat4v(e,t){let n=t||Y.identityMat4();return n[12]=e[0],n[13]=e[1],n[14]=e[2],n},translationMat3v(e,t){let n=t||Y.identityMat3();return n[6]=e[0],n[7]=e[1],n},translationMat4c:(()=>{let e=new zD(3);return(t,n,r,i)=>(e[0]=t,e[1]=n,e[2]=r,Y.translationMat4v(e,i))})(),translationMat4s(e,t){return Y.translationMat4c(e,e,e,t)},translateMat4v(e,t){return Y.translateMat4c(e[0],e[1],e[2],t)},translateMat4c(e,t,n,r){let i=r[3];r[0]+=i*e,r[1]+=i*t,r[2]+=i*n;let a=r[7];r[4]+=a*e,r[5]+=a*t,r[6]+=a*n;let o=r[11];r[8]+=o*e,r[9]+=o*t,r[10]+=o*n;let s=r[15];return r[12]+=s*e,r[13]+=s*t,r[14]+=s*n,r},setMat4Translation(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t[0],n[13]=t[1],n[14]=t[2],n[15]=e[15],n},rotationMat4v(e,t,n){let r=Y.normalizeVec4([t[0],t[1],t[2],0],[]),i=Math.sin(e),a=Math.cos(e),o=1-a,s=r[0],c=r[1],l=r[2],u,d,f,p,m,h;return u=s*c,d=c*l,f=l*s,p=s*i,m=c*i,h=l*i,n||=Y.mat4(),n[0]=o*s*s+a,n[1]=o*u+h,n[2]=o*f-m,n[3]=0,n[4]=o*u-h,n[5]=o*c*c+a,n[6]=o*d+p,n[7]=0,n[8]=o*f+m,n[9]=o*d-p,n[10]=o*l*l+a,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n},rotationMat4c(e,t,n,r,i){return Y.rotationMat4v(e,[t,n,r],i)},scalingMat4v(e,t=Y.identityMat4()){return t[0]=e[0],t[5]=e[1],t[10]=e[2],t},scalingMat3v(e,t=Y.identityMat3()){return t[0]=e[0],t[4]=e[1],t},scalingMat4c:(()=>{let e=new zD(3);return(t,n,r,i)=>(e[0]=t,e[1]=n,e[2]=r,Y.scalingMat4v(e,i))})(),scaleMat4c(e,t,n,r){return r[0]*=e,r[4]*=t,r[8]*=n,r[1]*=e,r[5]*=t,r[9]*=n,r[2]*=e,r[6]*=t,r[10]*=n,r[3]*=e,r[7]*=t,r[11]*=n,r},scaleMat4v(e,t){let n=e[0],r=e[1],i=e[2];return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,t},scalingMat4s(e){return Y.scalingMat4c(e,e,e)},rotationTranslationMat4(e,t,n=Y.mat4()){let r=e[0],i=e[1],a=e[2],o=e[3],s=r+r,c=i+i,l=a+a,u=r*s,d=r*c,f=r*l,p=i*c,m=i*l,h=a*l,g=o*s,_=o*c,v=o*l;return n[0]=1-(p+h),n[1]=d+v,n[2]=f-_,n[3]=0,n[4]=d-v,n[5]=1-(u+h),n[6]=m+g,n[7]=0,n[8]=f+_,n[9]=m-g,n[10]=1-(u+p),n[11]=0,n[12]=t[0],n[13]=t[1],n[14]=t[2],n[15]=1,n},mat4ToEuler(e,t,n=Y.vec4()){let r=Y.clamp,i=e[0],a=e[4],o=e[8],s=e[1],c=e[5],l=e[9],u=e[2],d=e[6],f=e[10];return t===`XYZ`?(n[1]=Math.asin(r(o,-1,1)),Math.abs(o)<.99999?(n[0]=Math.atan2(-l,f),n[2]=Math.atan2(-a,i)):(n[0]=Math.atan2(d,c),n[2]=0)):t===`YXZ`?(n[0]=Math.asin(-r(l,-1,1)),Math.abs(l)<.99999?(n[1]=Math.atan2(o,f),n[2]=Math.atan2(s,c)):(n[1]=Math.atan2(-u,i),n[2]=0)):t===`ZXY`?(n[0]=Math.asin(r(d,-1,1)),Math.abs(d)<.99999?(n[1]=Math.atan2(-u,f),n[2]=Math.atan2(-a,c)):(n[1]=0,n[2]=Math.atan2(s,i))):t===`ZYX`?(n[1]=Math.asin(-r(u,-1,1)),Math.abs(u)<.99999?(n[0]=Math.atan2(d,f),n[2]=Math.atan2(s,i)):(n[0]=0,n[2]=Math.atan2(-a,c))):t===`YZX`?(n[2]=Math.asin(r(s,-1,1)),Math.abs(s)<.99999?(n[0]=Math.atan2(-l,c),n[1]=Math.atan2(-u,i)):(n[0]=0,n[1]=Math.atan2(o,f))):t===`XZY`&&(n[2]=Math.asin(-r(a,-1,1)),Math.abs(a)<.99999?(n[0]=Math.atan2(d,c),n[1]=Math.atan2(o,i)):(n[0]=Math.atan2(-l,f),n[1]=0)),n[0]*=Y.RADTODEG,n[1]*=Y.RADTODEG,n[2]*=Y.RADTODEG,n},composeMat4(e,t,n,r=Y.mat4()){return Y.quaternionToRotationMat4(t,r),Y.scaleMat4v(n,r),Y.translateMat4v(e,r),r},decomposeMat4:(()=>{let e=new zD(3),t=new zD(16);return function(n,r,i,a){e[0]=n[0],e[1]=n[1],e[2]=n[2];let o=Y.lenVec3(e);e[0]=n[4],e[1]=n[5],e[2]=n[6];let s=Y.lenVec3(e);e[8]=n[8],e[9]=n[9],e[10]=n[10];let c=Y.lenVec3(e);Y.determinantMat4(n)<0&&(o=-o),r[0]=n[12],r[1]=n[13],r[2]=n[14],t.set(n);let l=1/o,u=1/s,d=1/c;return t[0]*=l,t[1]*=l,t[2]*=l,t[4]*=u,t[5]*=u,t[6]*=u,t[8]*=d,t[9]*=d,t[10]*=d,Y.mat4ToQuaternion(t,i),a[0]=o,a[1]=s,a[2]=c,this}})(),getColMat4(e,t){let n=t*4;return[e[n],e[n+1],e[n+2],e[n+3]]},setRowMat4(e,t,n){e[t]=n[0],e[t+4]=n[1],e[t+8]=n[2],e[t+12]=n[3]},lookAtMat4v(e,t,n,r){r||=Y.mat4();let i=e[0],a=e[1],o=e[2],s=n[0],c=n[1],l=n[2],u=t[0],d=t[1],f=t[2];if(i===u&&a===d&&o===f)return Y.identityMat4();let p,m,h,g,_,v,y,b,x,S;return p=i-u,m=a-d,h=o-f,S=1/Math.sqrt(p*p+m*m+h*h),p*=S,m*=S,h*=S,g=c*h-l*m,_=l*p-s*h,v=s*m-c*p,S=Math.sqrt(g*g+_*_+v*v),S?(S=1/S,g*=S,_*=S,v*=S):(g=0,_=0,v=0),y=m*v-h*_,b=h*g-p*v,x=p*_-m*g,S=Math.sqrt(y*y+b*b+x*x),S?(S=1/S,y*=S,b*=S,x*=S):(y=0,b=0,x=0),r[0]=g,r[1]=y,r[2]=p,r[3]=0,r[4]=_,r[5]=b,r[6]=m,r[7]=0,r[8]=v,r[9]=x,r[10]=h,r[11]=0,r[12]=-(g*i+_*a+v*o),r[13]=-(y*i+b*a+x*o),r[14]=-(p*i+m*a+h*o),r[15]=1,r},lookAtMat4c(e,t,n,r,i,a,o,s,c){return Y.lookAtMat4v([e,t,n],[r,i,a],[o,s,c],[])},orthoMat4c(e,t,n,r,i,a,o){o||=Y.mat4();let s=t-e,c=r-n,l=a-i;return o[0]=2/s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2/c,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=-2/l,o[11]=0,o[12]=-(e+t)/s,o[13]=-(r+n)/c,o[14]=-(a+i)/l,o[15]=1,o},frustumMat4v(e,t,n){n||=Y.mat4();let r=[e[0],e[1],e[2],0],i=[t[0],t[1],t[2],0];Y.addVec4(i,r,VD),Y.subVec4(i,r,HD);let a=2*r[2],o=HD[0],s=HD[1],c=HD[2];return n[0]=a/o,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a/s,n[6]=0,n[7]=0,n[8]=VD[0]/o,n[9]=VD[1]/s,n[10]=-VD[2]/c,n[11]=-1,n[12]=0,n[13]=0,n[14]=-a*i[2]/c,n[15]=0,n},frustumMat4(e,t,n,r,i,a,o){o||=Y.mat4();let s=t-e,c=r-n,l=a-i;return o[0]=i*2/s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=i*2/c,o[6]=0,o[7]=0,o[8]=(t+e)/s,o[9]=(r+n)/c,o[10]=-(a+i)/l,o[11]=-1,o[12]=0,o[13]=0,o[14]=-(a*i*2)/l,o[15]=0,o},perspectiveMat4(e,t,n,r,i){let a=[],o=[];return a[2]=n,o[2]=r,o[1]=a[2]*Math.tan(e/2),a[1]=-o[1],o[0]=o[1]*t,a[0]=-o[0],Y.frustumMat4v(a,o,i)},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,n=Y.vec3()){let r=t[0],i=t[1],a=t[2];return n[0]=e[0]*r+e[4]*i+e[8]*a+e[12],n[1]=e[1]*r+e[5]*i+e[9]*a+e[13],n[2]=e[2]*r+e[6]*i+e[10]*a+e[14],n},transformPoint4(e,t,n=Y.vec4()){return n[0]=e[0]*t[0]+e[4]*t[1]+e[8]*t[2]+e[12]*t[3],n[1]=e[1]*t[0]+e[5]*t[1]+e[9]*t[2]+e[13]*t[3],n[2]=e[2]*t[0]+e[6]*t[1]+e[10]*t[2]+e[14]*t[3],n[3]=e[3]*t[0]+e[7]*t[1]+e[11]*t[2]+e[15]*t[3],n},transformPoints3(e,t,n){let r=n||[],i=t.length,a,o,s,c,l=e[0],u=e[1],d=e[2],f=e[3],p=e[4],m=e[5],h=e[6],g=e[7],_=e[8],v=e[9],y=e[10],b=e[11],x=e[12],S=e[13],C=e[14],w=e[15],T;for(let e=0;e<i;++e)c=t[e],a=c[0],o=c[1],s=c[2],T=r[e]||(r[e]=[0,0,0]),T[0]=l*a+p*o+_*s+x,T[1]=u*a+m*o+v*s+S,T[2]=d*a+h*o+y*s+C,T[3]=f*a+g*o+b*s+w;return r.length=i,r},transformPositions3(e,t,n=t){let r,i=t.length,a,o,s,c=e[0],l=e[1],u=e[2];e[3];let d=e[4],f=e[5],p=e[6];e[7];let m=e[8],h=e[9],g=e[10];e[11];let _=e[12],v=e[13],y=e[14];for(e[15],r=0;r<i;r+=3)a=t[r+0],o=t[r+1],s=t[r+2],n[r+0]=c*a+d*o+m*s+_,n[r+1]=l*a+f*o+h*s+v,n[r+2]=u*a+p*o+g*s+y;return n},transformPositions4(e,t,n=t){let r,i=t.length,a,o,s,c=e[0],l=e[1],u=e[2],d=e[3],f=e[4],p=e[5],m=e[6],h=e[7],g=e[8],_=e[9],v=e[10],y=e[11],b=e[12],x=e[13],S=e[14],C=e[15];for(r=0;r<i;r+=4)a=t[r+0],o=t[r+1],s=t[r+2],n[r+0]=c*a+f*o+g*s+b,n[r+1]=l*a+p*o+_*s+x,n[r+2]=u*a+m*o+v*s+S,n[r+3]=d*a+h*o+y*s+C;return n},transformVec3(e,t,n){let r=t[0],i=t[1],a=t[2];return n||=this.vec3(),n[0]=e[0]*r+e[4]*i+e[8]*a,n[1]=e[1]*r+e[5]*i+e[9]*a,n[2]=e[2]*r+e[6]*i+e[10]*a,n},transformVec4(e,t,n){let r=t[0],i=t[1],a=t[2],o=t[3];return n||=Y.vec4(),n[0]=e[0]*r+e[4]*i+e[8]*a+e[12]*o,n[1]=e[1]*r+e[5]*i+e[9]*a+e[13]*o,n[2]=e[2]*r+e[6]*i+e[10]*a+e[14]*o,n[3]=e[3]*r+e[7]*i+e[11]*a+e[15]*o,n},rotateVec2(e,t,n,r=e){let i=Math.cos(n),a=Math.sin(n),o=e[0]-t[0],s=e[1]-t[1];return r[0]=o*i-s*a+t[0],r[1]=o*a+s*i+t[1],e},rotateVec3X(e,t,n,r){let i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),r[0]=a[0]+t[0],r[1]=a[1]+t[1],r[2]=a[2]+t[2],r},rotateVec3Y(e,t,n,r){let i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),r[0]=a[0]+t[0],r[1]=a[1]+t[1],r[2]=a[2]+t[2],r},rotateVec3Z(e,t,n,r){let i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],r[0]=a[0]+t[0],r[1]=a[1]+t[1],r[2]=a[2]+t[2],r},projectVec4(e,t){let n=1/e[3];return t||=Y.vec2(),t[0]=e[0]*n,t[1]=e[1]*n,t},unprojectVec3:(()=>{let e=new zD(16),t=new zD(16),n=new zD(16);return function(r,i,a,o){return this.transformVec3(this.mulMat4(this.inverseMat4(i,e),this.inverseMat4(a,t),n),r,o)}})(),lerpVec3(e,t,n,r,i,a){let o=a||Y.vec3(),s=(e-t)/(n-t);return o[0]=r[0]+s*(i[0]-r[0]),o[1]=r[1]+s*(i[1]-r[1]),o[2]=r[2]+s*(i[2]-r[2]),o},lerpMat4(e,t,n,r,i,a){let o=a||Y.mat4(),s=(e-t)/(n-t);return o[0]=r[0]+s*(i[0]-r[0]),o[1]=r[1]+s*(i[1]-r[1]),o[2]=r[2]+s*(i[2]-r[2]),o[3]=r[3]+s*(i[3]-r[3]),o[4]=r[4]+s*(i[4]-r[4]),o[5]=r[5]+s*(i[5]-r[5]),o[6]=r[6]+s*(i[6]-r[6]),o[7]=r[7]+s*(i[7]-r[7]),o[8]=r[8]+s*(i[8]-r[8]),o[9]=r[9]+s*(i[9]-r[9]),o[10]=r[10]+s*(i[10]-r[10]),o[11]=r[11]+s*(i[11]-r[11]),o[12]=r[12]+s*(i[12]-r[12]),o[13]=r[13]+s*(i[13]-r[13]),o[14]=r[14]+s*(i[14]-r[14]),o[15]=r[15]+s*(i[15]-r[15]),o},flatten(e){let t=[],n,r,i,a,o;for(n=0,r=e.length;n<r;n++)for(o=e[n],i=0,a=o.length;i<a;i++)t.push(o[i]);return t},identityQuaternion(e=Y.vec4()){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},eulerToQuaternion(e,t,n=Y.vec4()){let r=e[0]*Y.DEGTORAD/2,i=e[1]*Y.DEGTORAD/2,a=e[2]*Y.DEGTORAD/2,o=Math.cos(r),s=Math.cos(i),c=Math.cos(a),l=Math.sin(r),u=Math.sin(i),d=Math.sin(a);return t===`XYZ`?(n[0]=l*s*c+o*u*d,n[1]=o*u*c-l*s*d,n[2]=o*s*d+l*u*c,n[3]=o*s*c-l*u*d):t===`YXZ`?(n[0]=l*s*c+o*u*d,n[1]=o*u*c-l*s*d,n[2]=o*s*d-l*u*c,n[3]=o*s*c+l*u*d):t===`ZXY`?(n[0]=l*s*c-o*u*d,n[1]=o*u*c+l*s*d,n[2]=o*s*d+l*u*c,n[3]=o*s*c-l*u*d):t===`ZYX`?(n[0]=l*s*c-o*u*d,n[1]=o*u*c+l*s*d,n[2]=o*s*d-l*u*c,n[3]=o*s*c+l*u*d):t===`YZX`?(n[0]=l*s*c+o*u*d,n[1]=o*u*c+l*s*d,n[2]=o*s*d-l*u*c,n[3]=o*s*c-l*u*d):t===`XZY`&&(n[0]=l*s*c-o*u*d,n[1]=o*u*c-l*s*d,n[2]=o*s*d+l*u*c,n[3]=o*s*c+l*u*d),n},mat4ToQuaternion(e,t=Y.vec4()){let n=e[0],r=e[4],i=e[8],a=e[1],o=e[5],s=e[9],c=e[2],l=e[6],u=e[10],d,f=n+o+u;return f>0?(d=.5/Math.sqrt(f+1),t[3]=.25/d,t[0]=(l-s)*d,t[1]=(i-c)*d,t[2]=(a-r)*d):n>o&&n>u?(d=2*Math.sqrt(1+n-o-u),t[3]=(l-s)/d,t[0]=.25*d,t[1]=(r+a)/d,t[2]=(i+c)/d):o>u?(d=2*Math.sqrt(1+o-n-u),t[3]=(i-c)/d,t[0]=(r+a)/d,t[1]=.25*d,t[2]=(s+l)/d):(d=2*Math.sqrt(1+u-n-o),t[3]=(a-r)/d,t[0]=(i+c)/d,t[1]=(s+l)/d,t[2]=.25*d),t},vec3PairToQuaternion(e,t,n=Y.vec4()){let r=Math.sqrt(Y.dotVec3(e,e)*Y.dotVec3(t,t)),i=r+Y.dotVec3(e,t);return i<1e-8*r?(i=0,Math.abs(e[0])>Math.abs(e[2])?(n[0]=-e[1],n[1]=e[0],n[2]=0):(n[0]=0,n[1]=-e[2],n[2]=e[1])):Y.cross3Vec3(e,t,n),n[3]=i,Y.normalizeQuaternion(n)},angleAxisToQuaternion(e,t=Y.vec4()){let n=e[3]/2,r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t},quaternionToEuler:(()=>{let e=new zD(16);return(t,n,r)=>(r||=Y.vec3(),Y.quaternionToRotationMat4(t,e),Y.mat4ToEuler(e,n,r),r)})(),mulQuaternions(e,t,n=Y.vec4()){let r=e[0],i=e[1],a=e[2],o=e[3],s=t[0],c=t[1],l=t[2],u=t[3];return n[0]=o*s+r*u+i*l-a*c,n[1]=o*c+i*u+a*s-r*l,n[2]=o*l+a*u+r*c-i*s,n[3]=o*u-r*s-i*c-a*l,n},vec3ApplyQuaternion(e,t,n=Y.vec3()){let r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],c=e[2],l=e[3],u=l*r+s*a-c*i,d=l*i+c*r-o*a,f=l*a+o*i-s*r,p=-o*r-s*i-c*a;return n[0]=u*l+p*-o+d*-c-f*-s,n[1]=d*l+p*-s+f*-o-u*-c,n[2]=f*l+p*-c+u*-s-d*-o,n},quaternionToMat4(e,t){t=Y.identityMat4(t);let n=e[0],r=e[1],i=e[2],a=e[3],o=2*n,s=2*r,c=2*i,l=o*a,u=s*a,d=c*a,f=o*n,p=s*n,m=c*n,h=s*r,g=c*r,_=c*i;return t[0]=1-(h+_),t[1]=p+d,t[2]=m-u,t[4]=p-d,t[5]=1-(f+_),t[6]=g+l,t[8]=m+u,t[9]=g-l,t[10]=1-(f+h),t},quaternionToRotationMat4(e,t){let n=e[0],r=e[1],i=e[2],a=e[3],o=n+n,s=r+r,c=i+i,l=n*o,u=n*s,d=n*c,f=r*s,p=r*c,m=i*c,h=a*o,g=a*s,_=a*c;return t[0]=1-(f+m),t[4]=u-_,t[8]=d+g,t[1]=u+_,t[5]=1-(l+m),t[9]=p-h,t[2]=d-g,t[6]=p+h,t[10]=1-(l+f),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 n=Y.lenVec4([e[0],e[1],e[2],e[3]]);return t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n,t[3]=e[3]/n,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 Y.normalizeQuaternion(Y.conjugateQuaternion(e,t))},quaternionToAngleAxis(e,t=Y.vec4()){e=Y.normalizeQuaternion(e,HQe);let n=e[3],r=2*Math.acos(n),i=Math.sqrt(1-n*n);return i<.001?(t[0]=e[0],t[1]=e[1],t[2]=e[2]):(t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i),t[3]=r,t},AABB3(e){return new zD(e||6)},AABB2(e){return new zD(e||4)},OBB3(e){return new zD(e||32)},OBB2(e){return new zD(e||16)},Sphere3(e,t,n,r){return new zD([e,t,n,r])},transformOBB3(e,t,n=t){let r,i=t.length,a,o,s,c=e[0],l=e[1],u=e[2],d=e[3],f=e[4],p=e[5],m=e[6],h=e[7],g=e[8],_=e[9],v=e[10],y=e[11],b=e[12],x=e[13],S=e[14],C=e[15];for(r=0;r<i;r+=4)a=t[r+0],o=t[r+1],s=t[r+2],n[r+0]=c*a+f*o+g*s+b,n[r+1]=l*a+p*o+_*s+x,n[r+2]=u*a+m*o+v*s+S,n[r+3]=d*a+h*o+y*s+C;return n},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 zD(3),t=new zD(3),n=new zD(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],Y.subVec3(t,e,n),Math.abs(Y.lenVec3(n)))})(),getAABB3DiagPoint:(()=>{let e=new zD(3),t=new zD(3),n=new zD(3);return(r,i)=>{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 a=Y.subVec3(t,e,n),o=i[0]-r[0],s=r[3]-i[0],c=i[1]-r[1],l=r[4]-i[1],u=i[2]-r[2],d=r[5]-i[2];return a[0]+=o>s?o:s,a[1]+=c>l?c:l,a[2]+=u>d?u:d,Math.abs(Y.lenVec3(a))}})(),getAABB3Area(e){let t=e[3]-e[0],n=e[4]-e[1],r=e[5]-e[2];return t*n*r},getAABB3Center(e,t){let n=t||Y.vec3();return n[0]=(e[0]+e[3])/2,n[1]=(e[1]+e[4])/2,n[2]=(e[2]+e[5])/2,n},getAABB2Center(e,t){let n=t||Y.vec2();return n[0]=(e[2]+e[0])/2,n[1]=(e[3]+e[1])/2,n},collapseAABB3(e=Y.AABB3()){return e[0]=Y.MAX_DOUBLE,e[1]=Y.MAX_DOUBLE,e[2]=Y.MAX_DOUBLE,e[3]=Y.MIN_DOUBLE,e[4]=Y.MIN_DOUBLE,e[5]=Y.MIN_DOUBLE,e},AABB3ToOBB3(e,t=Y.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 zD(3);return(t,n,r)=>{n||=Y.AABB3();let i=Y.MAX_DOUBLE,a=Y.MAX_DOUBLE,o=Y.MAX_DOUBLE,s=Y.MIN_DOUBLE,c=Y.MIN_DOUBLE,l=Y.MIN_DOUBLE,u,d,f;for(let n=0,p=t.length;n<p;n+=3)r?(e[0]=t[n+0],e[1]=t[n+1],e[2]=t[n+2],Y.decompressPosition(e,r,e),u=e[0],d=e[1],f=e[2]):(u=t[n+0],d=t[n+1],f=t[n+2]),u<i&&(i=u),d<a&&(a=d),f<o&&(o=f),u>s&&(s=u),d>c&&(c=d),f>l&&(l=f);return n[0]=i,n[1]=a,n[2]=o,n[3]=s,n[4]=c,n[5]=l,n}})(),OBB3ToAABB3(e,t=Y.AABB3()){let n=Y.MAX_DOUBLE,r=Y.MAX_DOUBLE,i=Y.MAX_DOUBLE,a=Y.MIN_DOUBLE,o=Y.MIN_DOUBLE,s=Y.MIN_DOUBLE,c,l,u;for(let t=0,d=e.length;t<d;t+=4)c=e[t+0],l=e[t+1],u=e[t+2],c<n&&(n=c),l<r&&(r=l),u<i&&(i=u),c>a&&(a=c),l>o&&(o=l),u>s&&(s=u);return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t},points3ToAABB3(e,t=Y.AABB3()){let n=Y.MAX_DOUBLE,r=Y.MAX_DOUBLE,i=Y.MAX_DOUBLE,a=Y.MIN_DOUBLE,o=Y.MIN_DOUBLE,s=Y.MIN_DOUBLE,c,l,u;for(let t=0,d=e.length;t<d;t++)c=e[t][0],l=e[t][1],u=e[t][2],c<n&&(n=c),l<r&&(r=l),u<i&&(i=u),c>a&&(a=c),l>o&&(o=l),u>s&&(s=u);return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t},points3ToSphere3:(()=>{let e=new zD(3);return(t,n)=>{n||=Y.vec4();let r=0,i=0,a=0,o,s=t.length;for(o=0;o<s;o++)r+=t[o][0],i+=t[o][1],a+=t[o][2];n[0]=r/s,n[1]=i/s,n[2]=a/s;let c=0,l;for(o=0;o<s;o++)l=Math.abs(Y.lenVec3(Y.subVec3(t[o],n,e))),l>c&&(c=l);return n[3]=c,n}})(),positions3ToSphere3:(()=>{let e=new zD(3),t=new zD(3);return(n,r)=>{r||=Y.vec4();let i=0,a=0,o=0,s,c=n.length,l=0;for(s=0;s<c;s+=3)i+=n[s],a+=n[s+1],o+=n[s+2];let u=c/3;r[0]=i/u,r[1]=a/u,r[2]=o/u;let d;for(s=0;s<c;s+=3)e[0]=n[s],e[1]=n[s+1],e[2]=n[s+2],d=Math.abs(Y.lenVec3(Y.subVec3(e,r,t))),d>l&&(l=d);return r[3]=l,r}})(),OBB3ToSphere3:(()=>{let e=new zD(3),t=new zD(3);return(n,r)=>{r||=Y.vec4();let i=0,a=0,o=0,s,c=n.length,l=c/4;for(s=0;s<c;s+=4)i+=n[s+0],a+=n[s+1],o+=n[s+2];r[0]=i/l,r[1]=a/l,r[2]=o/l;let u=0,d;for(s=0;s<c;s+=4)e[0]=n[s+0],e[1]=n[s+1],e[2]=n[s+2],d=Math.abs(Y.lenVec3(Y.subVec3(e,r,t))),d>u&&(u=d);return r[3]=u,r}})(),getSphere3Center(e,t=Y.vec3()){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},getPositionsCenter(e,t=Y.vec3()){let n=0,r=0,i=0;for(var a=0,o=e.length;a<o;a+=3)n+=e[a+0],r+=e[a+1],i+=e[a+2];let s=e.length/3;return t[0]=n/s,t[1]=r/s,t[2]=i/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 n,r,i,a=0,o=t.length;a<o;a+=3)n=t[a],r=t[a+1],i=t[a+2],e[0]>n&&(e[0]=n),e[1]>r&&(e[1]=r),e[2]>i&&(e[2]=i),e[3]<n&&(e[3]=n),e[4]<r&&(e[4]=r),e[5]<i&&(e[5]=i);return e},collapseAABB2(e=Y.AABB2()){return e[0]=Y.MAX_DOUBLE,e[1]=Y.MAX_DOUBLE,e[2]=Y.MIN_DOUBLE,e[3]=Y.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,n){let r,i;return e[0]>0?(r=e[0]*n[0],i=e[0]*n[3]):(r=e[0]*n[3],i=e[0]*n[0]),e[1]>0?(r+=e[1]*n[1],i+=e[1]*n[4]):(r+=e[1]*n[4],i+=e[1]*n[1]),e[2]>0?(r+=e[2]*n[2],i+=e[2]*n[5]):(r+=e[2]*n[5],i+=e[2]*n[2]),r<=-t&&i<=-t?-1:r>=-t&&i>=-t?1:0},OBB3ToAABB2(e,t=Y.AABB2()){let n=Y.MAX_DOUBLE,r=Y.MAX_DOUBLE,i=Y.MIN_DOUBLE,a=Y.MIN_DOUBLE,o,s,c,l;for(let t=0,u=e.length;t<u;t+=4)o=e[t+0],s=e[t+1],c=e[t+3]||1,l=1/c,o*=l,s*=l,o<n&&(n=o),s<r&&(r=s),o>i&&(i=o),s>a&&(a=s);return t[0]=n,t[1]=r,t[2]=i,t[3]=a,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,n,r=e){let i=(e[0]+1)*.5,a=(e[1]+1)*.5,o=(e[2]+1)*.5,s=(e[3]+1)*.5;return r[0]=Math.floor(i*t),r[1]=n-Math.floor(s*n),r[2]=Math.floor(o*t),r[3]=n-Math.floor(a*n),r},tangentQuadraticBezier(e,t,n,r){return 2*(1-e)*(n-t)+2*e*(r-n)},tangentQuadraticBezier3(e,t,n,r,i){return-3*t*(1-e)*(1-e)+3*n*(1-e)*(1-e)-6*e*n*(1-e)+6*e*r*(1-e)-3*e*e*r+3*e*e*i},tangentSpline(e){let t=6*e*e-6*e,n=3*e*e-4*e+1,r=-6*e*e+6*e,i=3*e*e-2*e;return t+n+r+i},catmullRomInterpolate(e,t,n,r,i){let a=(n-e)*.5,o=(r-t)*.5,s=i*i,c=i*s;return(2*t-2*n+a+o)*c+(-3*t+3*n-2*a-o)*s+a*i+t},b2p0(e,t){let n=1-e;return n*n*t},b2p1(e,t){return 2*(1-e)*e*t},b2p2(e,t){return e*e*t},b2(e,t,n,r){return this.b2p0(e,t)+this.b2p1(e,n)+this.b2p2(e,r)},b3p0(e,t){let n=1-e;return n*n*n*t},b3p1(e,t){let n=1-e;return 3*n*n*e*t},b3p2(e,t){return 3*(1-e)*e*e*t},b3p3(e,t){return e*e*e*t},b3(e,t,n,r,i){return this.b3p0(e,t)+this.b3p1(e,n)+this.b3p2(e,r)+this.b3p3(e,i)},triangleNormal(e,t,n,r=Y.vec3()){let i=t[0]-e[0],a=t[1]-e[1],o=t[2]-e[2],s=n[0]-e[0],c=n[1]-e[1],l=n[2]-e[2],u=a*l-o*c,d=o*s-i*l,f=i*c-a*s,p=Math.sqrt(u*u+d*d+f*f);return p===0?(r[0]=0,r[1]=0,r[2]=0):(r[0]=u/p,r[1]=d/p,r[2]=f/p),r},rayTriangleIntersect:(()=>{let e=new zD(3),t=new zD(3),n=new zD(3),r=new zD(3),i=new zD(3);return(a,o,s,c,l,u)=>{u||=Y.vec3();let d=Y.subVec3(c,s,e),f=Y.subVec3(l,s,t),p=Y.cross3Vec3(o,f,n),m=Y.dotVec3(d,p);if(m<1e-6)return null;let h=Y.subVec3(a,s,r),g=Y.dotVec3(h,p);if(g<0||g>m)return null;let _=Y.cross3Vec3(h,d,i),v=Y.dotVec3(o,_);if(v<0||g+v>m)return null;let y=Y.dotVec3(f,_)/m;return u[0]=a[0]+y*o[0],u[1]=a[1]+y*o[1],u[2]=a[2]+y*o[2],u}})(),rayPlaneIntersect:(()=>{let e=new zD(3),t=new zD(3),n=new zD(3),r=new zD(3);return(i,a,o,s,c,l)=>{l||=Y.vec3(),a=Y.normalizeVec3(a,e);let u=Y.subVec3(s,o,t),d=Y.subVec3(c,o,n),f=Y.cross3Vec3(u,d,r);Y.normalizeVec3(f,f);let p=-Y.dotVec3(o,f),m=-(Y.dotVec3(i,f)+p)/Y.dotVec3(a,f);return l[0]=i[0]+m*a[0],l[1]=i[1]+m*a[1],l[2]=i[2]+m*a[2],l}})(),cartesianToBarycentric:(()=>{let e=new zD(3),t=new zD(3),n=new zD(3);return(r,i,a,o,s)=>{let c=Y.subVec3(o,i,e),l=Y.subVec3(a,i,t),u=Y.subVec3(r,i,n),d=Y.dotVec3(c,c),f=Y.dotVec3(c,l),p=Y.dotVec3(c,u),m=Y.dotVec3(l,l),h=Y.dotVec3(l,u),g=d*m-f*f;if(g===0)return null;let _=1/g,v=(m*p-f*h)*_,y=(d*h-f*p)*_;return s[0]=1-v-y,s[1]=y,s[2]=v,s}})(),barycentricInsideTriangle(e){let t=e[1],n=e[2];return n>=0&&t>=0&&n+t<1},barycentricToCartesian(e,t,n,r,i=Y.vec3()){let a=e[0],o=e[1],s=e[2];return i[0]=t[0]*a+n[0]*o+r[0]*s,i[1]=t[1]*a+n[1]*o+r[1]*s,i[2]=t[2]*a+n[2]*o+r[2]*s,i},mergeVertices(e,t,n,r){let i={},a=[],o=[],s=t?[]:null,c=n?[]:null,l=[],u,d,f,p,m=10**4,h,g,_=0;for(h=0,g=e.length;h<g;h+=3)u=e[h],d=e[h+1],f=e[h+2],p=`${Math.round(u*m)}_${Math.round(d*m)}_${Math.round(f*m)}`,i[p]===void 0&&(i[p]=o.length/3,o.push(u),o.push(d),o.push(f),t&&(s.push(t[h]),s.push(t[h+1]),s.push(t[h+2])),n&&(c.push(n[_]),c.push(n[_+1]))),a[h/3]=i[p],_+=2;for(h=0,g=r.length;h<g;h++)l[h]=a[r[h]];let v={positions:o,indices:l};return s&&(v.normals=s),c&&(v.uv=c),v},buildNormals:(()=>{let e=new zD(3),t=new zD(3),n=new zD(3),r=new zD(3),i=new zD(3),a=new zD(3);return(o,s,c)=>{let l,u,d=Array(o.length/3),f,p,m;for(l=0,u=s.length;l<u;l+=3){f=s[l],p=s[l+1],m=s[l+2],e[0]=o[f*3],e[1]=o[f*3+1],e[2]=o[f*3+2],t[0]=o[p*3],t[1]=o[p*3+1],t[2]=o[p*3+2],n[0]=o[m*3],n[1]=o[m*3+1],n[2]=o[m*3+2],Y.subVec3(t,e,r),Y.subVec3(n,e,i);let c=Y.vec3();Y.normalizeVec3(Y.cross3Vec3(r,i,a),c),d[f]||(d[f]=[]),d[p]||(d[p]=[]),d[m]||(d[m]=[]),d[f].push(c),d[p].push(c),d[m].push(c)}c=c&&c.length===o.length?c:new Float32Array(o.length);let h,g,_,v;for(l=0,u=d.length;l<u;l++){h=d[l].length,g=0,_=0,v=0;for(let e=0;e<h;e++)g+=d[l][e][0],_+=d[l][e][1],v+=d[l][e][2];c[l*3]=g/h,c[l*3+1]=_/h,c[l*3+2]=v/h}return c}})(),buildTangents:(()=>{let e=new zD(3),t=new zD(3),n=new zD(3),r=new zD(3),i=new zD(3),a=new zD(3),o=new zD(3);return(s,c,l)=>{let u=new Float32Array(s.length);for(let d=0;d<c.length;d+=3){let f=c[d],p=s.subarray(f*3,f*3+3),m=l.subarray(f*2,f*2+2);f=c[d+1];let h=s.subarray(f*3,f*3+3),g=l.subarray(f*2,f*2+2);f=c[d+2];let _=s.subarray(f*3,f*3+3),v=l.subarray(f*2,f*2+2),y=Y.subVec3(h,p,e),b=Y.subVec3(_,p,t),x=Y.subVec2(g,m,n),S=Y.subVec2(v,m,r),C=1/(x[0]*S[1]-x[1]*S[0]),w=Y.mulVec3Scalar(Y.subVec3(Y.mulVec3Scalar(y,S[1],i),Y.mulVec3Scalar(b,x[1],a),o),C,a),T;for(let e=0;e<3;e++)T=c[d+e]*3,u[T]+=w[0],u[T+1]+=w[1],u[T+2]+=w[2]}return u}})(),buildPickTriangles(e,t,n){let r=t.length,i=n?new Uint16Array(r*9):new Float32Array(r*9),a=new Uint8Array(r*12),o=0,s,c=0,l=0,u,d,f,p,m;for(let n=0;n<r;n+=3)m=o>>24&255,p=o>>16&255,f=o>>8&255,d=o&255,u=t[n],s=u*3,i[c++]=e[s],i[c++]=e[s+1],i[c++]=e[s+2],a[l++]=d,a[l++]=f,a[l++]=p,a[l++]=m,u=t[n+1],s=u*3,i[c++]=e[s],i[c++]=e[s+1],i[c++]=e[s+2],a[l++]=d,a[l++]=f,a[l++]=p,a[l++]=m,u=t[n+2],s=u*3,i[c++]=e[s],i[c++]=e[s+1],i[c++]=e[s+2],a[l++]=d,a[l++]=f,a[l++]=p,a[l++]=m,o++;return{positions:i,colors:a}},faceToVertexNormals(e,t,n={}){let r=n.smoothNormalsAngleThreshold||20,i={},a=[],o={},s,c,l,u,d,f=10**4,p,m,h,g,_,v;for(m=0,g=e.length;m<g;m+=3){p=m/3,c=e[m],l=e[m+1],u=e[m+2],d=`${Math.round(c*f)}_${Math.round(l*f)}_${Math.round(u*f)}`,i[d]===void 0?i[d]=[p]:i[d].push(p);let n=Y.normalizeVec3([t[m],t[m+1],t[m+2]]);a[p]=n,s=Y.vec4([n[0],n[1],n[2],1]),o[p]=s}for(d in i)if(i.hasOwnProperty(d)){let e=i[d],t=e.length;for(m=0;m<t;m++){let n=e[m];for(s=o[n],h=0;h<t;h++){if(m===h)continue;let t=e[h];_=a[n],v=a[t],Math.abs(Y.angleVec3(_,v)/Y.DEGTORAD)<r&&(s[0]+=v[0],s[1]+=v[1],s[2]+=v[2],s[3]+=1)}}}for(m=0,g=t.length;m<g;m+=3)s=o[m/3],t[m+0]=s[0]/s[3],t[m+1]=s[1]/s[3],t[m+2]=s[2]/s[3]},transformRay:(()=>{let e=new zD(4),t=new zD(4);return(n,r,i,a,o)=>{e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=1,Y.transformVec4(n,e,t),a[0]=t[0],a[1]=t[1],a[2]=t[2],e[0]=i[0],e[1]=i[1],e[2]=i[2],Y.transformVec3(n,e,t),Y.normalizeVec3(t),o[0]=t[0],o[1]=t[1],o[2]=t[2]}})(),canvasPosToWorldRay:(()=>{let e=new zD(16),t=new zD(4),n=new zD(4),r=(t,n,r,i,a)=>{a[0]=t,a[1]=n,a[2]=r,a[3]=1,Y.transformVec4(e,a,a),i||Y.mulVec4Scalar(a,1/a[3])};return(i,a,o,s,c,l,u)=>{let d=s===`ortho`;Y.mulMat4(o,a,e),Y.inverseMat4(e,e);let f=2*c[0]/i.clientWidth-1,p=1-2*c[1]/i.clientHeight;r(f,p,-1,d,t),r(f,p,1,d,n),l[0]=t[0],l[1]=t[1],l[2]=t[2],Y.subVec3(n,t,u),Y.normalizeVec3(u)}})(),canvasPosToLocalRay:(()=>{let e=new zD(3),t=new zD(3);return(n,r,i,a,o,s,c,l)=>{Y.canvasPosToWorldRay(n,r,i,a,s,e,t),Y.worldRayToLocalRay(o,e,t,c,l)}})(),worldRayToLocalRay:(()=>{let e=new zD(16),t=new zD(4),n=new zD(4);return(r,i,a,o,s)=>{let c=Y.inverseMat4(r,e);t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=1,Y.transformVec4(c,t,n),o[0]=n[0],o[1]=n[1],o[2]=n[2],Y.transformVec3(c,a,s)}})(),buildKDTree:(()=>{let e=new Float32Array;function t(n,r,i,a){let o=new zD(6),s={triangles:null,left:null,right:null,leaf:!1,splitDim:0,aabb:o};o[0]=o[1]=o[2]=1/0,o[3]=o[4]=o[5]=-1/0;let c,l;for(c=0,l=n.length;c<l;++c){var u=n[c]*3;for(let e=0;e<3;++e){let t=r[u+e]*3;i[t]<o[0]&&(o[0]=i[t]),i[t]>o[3]&&(o[3]=i[t]),i[t+1]<o[1]&&(o[1]=i[t+1]),i[t+1]>o[4]&&(o[4]=i[t+1]),i[t+2]<o[2]&&(o[2]=i[t+2]),i[t+2]>o[5]&&(o[5]=i[t+2])}}if(n.length<20||a>10)return s.triangles=n,s.leaf=!0,s;e[0]=o[3]-o[0],e[1]=o[4]-o[1],e[2]=o[5]-o[2];let d=0;e[1]>e[d]&&(d=1),e[2]>e[d]&&(d=2),s.splitDim=d;let f=(o[d]+o[d+3])/2,p=Array(n.length),m=0,h=Array(n.length),g=0;for(c=0,l=n.length;c<l;++c){var u=n[c]*3;let e=r[u],t=r[u+1],a=r[u+2],o=e*3,s=t*3,l=a*3;i[o+d]<=f||i[s+d]<=f||i[l+d]<=f?p[m++]=n[c]:h[g++]=n[c]}return p.length=m,h.length=g,s.left=t(p,r,i,a+1),s.right=t(h,r,i,a+1),s}return(e,n)=>{let r=e.length/3,i=Array(r);for(let e=0;e<r;++e)i[e]=e;return t(i,e,n,0)}})(),decompressPosition(e,t,n){n||=e,n[0]=e[0]*t[0]+t[12],n[1]=e[1]*t[5]+t[13],n[2]=e[2]*t[10]+t[14]},decompressPositions(e,t,n=new Float32Array(e.length)){for(let r=0,i=e.length;r<i;r+=3)n[r+0]=e[r+0]*t[0]+t[12],n[r+1]=e[r+1]*t[5]+t[13],n[r+2]=e[r+2]*t[10]+t[14];return n},decompressUV(e,t,n){n[0]=e[0]*t[0]+t[6],n[1]=e[1]*t[4]+t[7]},decompressUVs(e,t,n=new Float32Array(e.length)){for(let r=0,i=e.length;r<i;r+=3)n[r+0]=e[r+0]*t[0]+t[6],n[r+1]=e[r+1]*t[4]+t[7];return n},octDecodeVec2(e,t){let n=e[0],r=e[1];n=(2*n+1)/255,r=(2*r+1)/255;let i=1-Math.abs(n)-Math.abs(r);i<0&&(n=(1-Math.abs(r))*(n>=0?1:-1),r=(1-Math.abs(n))*(r>=0?1:-1));let a=Math.sqrt(n*n+r*r+i*i);return t[0]=n/a,t[1]=r/a,t[2]=i/a,t},octDecodeVec2s(e,t){for(let n=0,r=0,i=e.length;n<i;n+=2){let i=e[n+0],a=e[n+1];i=(2*i+1)/255,a=(2*a+1)/255;let o=1-Math.abs(i)-Math.abs(a);o<0&&(i=(1-Math.abs(a))*(i>=0?1:-1),a=(1-Math.abs(i))*(a>=0?1:-1));let s=Math.sqrt(i*i+a*a+o*o);t[r+0]=i/s,t[r+1]=a/s,t[r+2]=o/s,r+=3}return t}};Y.buildEdgeIndices=(function(){let e=[],t=[],n=[],r=[],i=[],a=0,o=new Uint16Array(3),s=new Uint16Array(3),c=new Uint16Array(3),l=Y.vec3(),u=Y.vec3(),d=Y.vec3(),f=Y.vec3(),p=Y.vec3(),m=Y.vec3(),h=Y.vec3();function g(i,a){let o={},s,c,l,u,d=10**4,f,p,m=0;for(f=0,p=i.length;f<p;f+=3)s=i[f],c=i[f+1],l=i[f+2],u=Math.round(s*d)+`_`+Math.round(c*d)+`_`+Math.round(l*d),o[u]===void 0&&(o[u]=m/3,e[m++]=s,e[m++]=c,e[m++]=l),t[f/3]=o[u];for(f=0,p=a.length;f<p;f++)r[f]=t[a[f]],n[r[f]]=a[f]}function _(t,n){a=0;for(let g=0,_=t;g<_;g+=3){let t=r[g]*3,_=r[g+1]*3,v=r[g+2]*3;n?(o[0]=e[t],o[1]=e[t+1],o[2]=e[t+2],s[0]=e[_],s[1]=e[_+1],s[2]=e[_+2],c[0]=e[v],c[1]=e[v+1],c[2]=e[v+2],Y.decompressPosition(o,n,l),Y.decompressPosition(s,n,u),Y.decompressPosition(c,n,d)):(l[0]=e[t],l[1]=e[t+1],l[2]=e[t+2],u[0]=e[_],u[1]=e[_+1],u[2]=e[_+2],d[0]=e[v],d[1]=e[v+1],d[2]=e[v+2]),Y.subVec3(d,u,f),Y.subVec3(l,u,p),Y.cross3Vec3(f,p,m),Y.normalizeVec3(m,h);let y=i[a]||(i[a]={normal:Y.vec3()});y.normal[0]=h[0],y.normal[1]=h[1],y.normal[2]=h[2],a++}}return function(e,t,a,o){g(e,t),_(t.length,a);let s=[],c=Math.cos(Y.DEGTORAD*o),l={},u,d,f,p,m,h=!1,v,y,b,x,S,C;for(let e=0,n=t.length;e<n;e+=3){let t=e/3;for(let n=0;n<3;n++)u=r[e+n],d=r[e+(n+1)%3],f=Math.min(u,d),p=Math.max(u,d),m=f+`,`+p,l[m]===void 0?l[m]={index1:f,index2:p,face1:t,face2:void 0}:l[m].face2=t}for(m in l)v=l[m],!(v.face2!==void 0&&(y=i[v.face1].normal,b=i[v.face2].normal,x=Y.dotVec3(y,b),x>c))&&(S=n[v.index1],C=n[v.index2],(!h&&S>65535||C>65535)&&(h=!0),s.push(S),s.push(C));return h?new Uint32Array(s):new Uint16Array(s)}})(),Y.planeClipsPositions3=function(e,t,n,r=3){for(let i=0,a=n.length;i<a;i+=r)if(BD[0]=n[i+0]-e[0],BD[1]=n[i+1]-e[1],BD[2]=n[i+2]-e[2],BD[0]*t[0]+BD[1]*t[1]+BD[2]*t[2]<0)return!0;return!1};var UQe=15,UD=new Float32Array(3),WQe=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||UQe,this._root=null,this._needsRebuild=!0,this._onModelLoaded=this.viewer.scene.on(`modelLoaded`,e=>{this._needsRebuild=!0}),this._onModelUnloaded=this.viewer.scene.on(`modelUnloaded`,e=>{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 n=e.objects[t];this._insertEntity(this._root,n,1)}this._needsRebuild=!1}_insertEntity(e,t,n){let r=t.aabb;if(n>=this._maxTreeDepth){e.entities=e.entities||[],e.entities.push(t);return}if(e.left&&Y.containsAABB3(e.left.aabb,r)){this._insertEntity(e.left,t,n+1);return}if(e.right&&Y.containsAABB3(e.right.aabb,r)){this._insertEntity(e.right,t,n+1);return}let i=e.aabb;UD[0]=i[3]-i[0],UD[1]=i[4]-i[1],UD[2]=i[5]-i[2];let a=0;if(UD[1]>UD[a]&&(a=1),UD[2]>UD[a]&&(a=2),!e.left){let o=i.slice();if(o[a+3]=(i[a]+i[a+3])/2,e.left={aabb:o},Y.containsAABB3(o,r)){this._insertEntity(e.left,t,n+1);return}}if(!e.right){let o=i.slice();if(o[a]=(i[a]+i[a+3])/2,e.right={aabb:o},Y.containsAABB3(o,r)){this._insertEntity(e.right,t,n+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}},WD=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 e=this._head;if(e.length=0,this._head=this._tail,this._tail=e,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}},GD={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 KD(e,t){if(e.nodeType===e.TEXT_NODE){var n=e.nodeValue;if(n.match(/^\s+$/)===null)return n}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 i=0;i<e.attributes.length;i++){var a=e.attributes[i],o=t[a.nodeName]||a.nodeName;r[o]=a.nodeValue}for(var s=0;s<e.childNodes.length;s++){var c=e.childNodes[s],i=KD(c,t);i&&r.children.push(i)}return r}}function GQe(e){return JSON.parse(JSON.stringify(e))}var KQe=[[`0`,10],[`A`,26],[`a`,26],[`_`,1],[`$`,1]].map(function(e){for(var t=[],n=e[0].charCodeAt(0),r=n+e[1],i=n;i<r;++i)t.push(i);return String.fromCharCode.apply(null,t)}).join(``);function qD(e,t){return(!t||t===4?[0,6,12,18]:[0,6]).map(function(t){return KQe.substr(parseInt(e/(1<<t))%64,1)}).reverse().join(``)}function qQe(e){var t=[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30].map(function(t){return parseInt(e.substr(t,2),16)});return qD(t[0],2)+[1,4,7,10,13].map(function(e){return qD((t[e]<<16)+(t[e+1]<<8)+t[e+2])}).join(``)}function JQe(e,t){var n=[],r=function(e){e.type===t&&n.push(e),(e.children||[]).forEach(function(e){r(e)})};return r(e),n}function YQe(e){return new Promise(function(t,n){setTimeout(t,e)})}function XQe(e){return new Promise(function(t,n){var r=new XMLHttpRequest;r.open(e.method||`GET`,e.url,!0),r.onload=function(e){r.readyState===4&&(r.status===200?t(r.responseXML):n(r.statusText))},r.send(null)})}var ZQe=function(){for(var e={},t=window.location.search.substring(1).split(`&`),n=0;n<t.length;n++){var r=t[n].split(`=`);if(e[r[0]]===void 0)e[r[0]]=decodeURIComponent(r[1]);else if(typeof e[r[0]]==`string`){var i=[e[r[0]],decodeURIComponent(r[1])];e[r[0]]=i}else e[r[0]].push(decodeURIComponent(r[1]))}return e}();function QQe(e,t,n){var r=e=>void 0;t||=r,n||=r;var i=new XMLHttpRequest;i.overrideMimeType(`application/json`),i.open(`GET`,e,!0),i.addEventListener(`load`,function(e){var r=e.target.response;if(this.status===200){var i;try{i=JSON.parse(r)}catch(e){n(`utils.loadJSON(): Failed to parse JSON response - ${e}`)}t(i)}else if(this.status===0){console.warn(`loadFile: HTTP Status 0 received.`);try{t(JSON.parse(r))}catch(e){n(`utils.loadJSON(): Failed to parse JSON response - ${e}`)}}else n(e)},!1),i.addEventListener(`error`,function(e){n(e)},!1),i.send(null)}function $Qe(e,t,n){var r=e=>void 0;t||=r,n||=r;let i=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(i){let e=!!i[2];var a=i[3];a=window.decodeURIComponent(a),e&&(a=window.atob(a));try{let e=new ArrayBuffer(a.length),n=new Uint8Array(e);for(var o=0;o<a.length;o++)n[o]=a.charCodeAt(o);aO.scheduleTask(()=>{t(e)})}catch(e){aO.scheduleTask(()=>{n(e)})}}else{let r=new XMLHttpRequest;r.open(`GET`,e,!0),r.responseType=`arraybuffer`,r.onreadystatechange=function(){r.readyState===4&&(r.status===200?t(r.response):n(`loadArrayBuffer error : `+r.response))},r.send(null)}}function e$e(e){return e&&!e.propertyIsEnumerable(`length`)&&typeof e==`object`&&typeof e.length==`number`}function t$e(e){return typeof e==`string`||e instanceof String}function n$e(e){return!isNaN(parseFloat(e))&&isFinite(e)}function r$e(e){return JD.isString(e)||JD.isNumeric(e)}function i$e(e,t){return!e||!t?!1:(JD.isNumeric(e)||JD.isString(e)?`${e}`:e.id)===(JD.isNumeric(t)||JD.isString(t)?`${t}`:t.id)}function a$e(e){return typeof e==`function`}function o$e(e){let t={}.constructor;return!!e&&e.constructor===t}function s$e(e){return JD.apply(e,{})}function c$e(e,t){for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function l$e(e,t){for(let n in e)e.hasOwnProperty(n)&&e[n]!==void 0&&e[n]!==null&&(t[n]=e[n]);return t}function u$e(e,t){for(let n in e)e.hasOwnProperty(n)&&(t[n]===void 0||t[n]===null)&&(t[n]=e[n]);return t}function d$e(e){for(let t in e)if(e.hasOwnProperty(t))return!1;return!0}function f$e(e){return JD.isNumeric(e)?`${e}`:`'${e}'`}function p$e(e,t){let n=new e.constructor(e.length+t.length);return n.set(e),n.set(t,e.length),n}function m$e(e){var t=[];function n(e){e.id=e.uuid,delete e.oid,t.push(e);var r=e.children;if(r)for(var i=0,a=r.length;i<a;i++){let t=r[i];t.parent=e.id,n(r[i])}e.children=[]}return n(e),t}var JD={xmlToJson:KD,clone:GQe,compressGuid:qQe,findNodeOfType:JQe,timeout:YQe,httpRequest:XQe,loadJSON:QQe,loadArraybuffer:$Qe,queryString:ZQe,isArray:e$e,isString:t$e,isNumeric:n$e,isID:r$e,isSameComponent:i$e,isFunction:a$e,isObject:o$e,copy:s$e,apply:c$e,apply2:l$e,applyIf:u$e,isEmptyObject:d$e,inQuotes:f$e,concat:p$e,flattenParentChildHierarchy:m$e},YD={},XD=new ID,ZD=new WD,QD={sceneId:null,time:null,startTime:null,prevTime:null,deltaTime:null},$D=10,eO=[],tO=30,nO=0,rO,iO=0;function h$e(){this.version=`1.0.0`,this.scenes={},this._superTypes={},this._addScene=function(e){if(e.id){if(aO.scenes[e.id]){console.error(`[ERROR] Scene ${JD.inQuotes(e.id)} already exists`);return}}else e.id=XD.addItem({});aO.scenes[e.id]=e;let t=e.ticksPerOcclusionTest,n=e.ticksPerRender;YD[e.id]={ticksPerOcclusionTest:t,ticksPerRender:n,renderCountdown:n},GD.components.scenes++,e.once(`destroyed`,()=>{XD.removeItem(e.id),delete aO.scenes[e.id],delete YD[e.id],GD.components.scenes--})},this.clear=function(){let e;for(let t in aO.scenes)aO.scenes.hasOwnProperty(t)&&(e=aO.scenes[t],t===`default.scene`?e.clear():(e.destroy(),delete aO.scenes[e.id]))},this.scheduleTask=function(e,t=null){ZD.push(e),ZD.push(t)},this.runTasks=function(e=-1){let t=new Date().getTime(),n,r,i=0;for(;ZD.length>0&&(e<0||t<e);)n=ZD.shift(),r=ZD.shift(),r?n.call(r):n(),t=new Date().getTime(),i++;return i},this.getNumTasks=function(){return ZD.length}}var aO=new h$e,oO=function(){let e=Date.now();if(rO=e-nO,nO>0&&rO>0){var t=1e3/rO;iO+=t,eO.push(t),eO.length>=tO&&(iO-=eO.shift()),GD.frame.fps=Math.round(iO/eO.length)}for(let e in aO.scenes)aO.scenes[e].compile();cO(e),nO=e};function g$e(e,t){let n=Date.now()+t;function r(){let i=Date.now()-n;e(),n+=t,setTimeout(r,Math.max(0,t-i))}return r(),{cancel:function(){}}}g$e(()=>{oO()},100);var sO=function(){let e=Date.now();if(rO=e-nO,nO>0&&rO>0){var t=1e3/rO;iO+=t,eO.push(t),eO.length>=tO&&(iO-=eO.shift()),GD.frame.fps=Math.round(iO/eO.length)}cO(e),_$e(e),v$e(),window.requestPostAnimationFrame===void 0?requestAnimationFrame(sO):window.requestPostAnimationFrame(oO)};sO();function cO(e){let t=aO.runTasks(e+$D),n=aO.getNumTasks();GD.frame.tasksRun=t,GD.frame.tasksScheduled=n,GD.frame.tasksBudget=$D}function _$e(e){for(var t in QD.time=e,aO.scenes)if(aO.scenes.hasOwnProperty(t)){var n=aO.scenes[t];QD.sceneId=t,QD.startTime=n.startTime,QD.deltaTime=QD.prevTime==null?0:QD.time-QD.prevTime,n.fire(`tick`,QD,!0)}QD.prevTime=e}function v$e(){let e=aO.scenes,t,n,r,i,a;for(a in e)e.hasOwnProperty(a)&&(t=e[a],n=YD[a],n||=YD[a]={},r=t.ticksPerOcclusionTest,n.ticksPerOcclusionTest!==r&&(n.ticksPerOcclusionTest=r,n.renderCountdown=r),--t.occlusionTestCountdown<=0&&(t.doOcclusionTest(),t.occlusionTestCountdown=r),i=t.ticksPerRender,n.ticksPerRender!==i&&(n.ticksPerRender=i,n.renderCountdown=i),--n.renderCountdown===0&&(t.render(!1),n.renderCountdown=i))}var lO=class e{get type(){return`Component`}get isComponent(){return!0}constructor(t=null,n={}){if(this.scene=null,this.type===`Scene`)this.scene=this,this.viewer=n.viewer;else{if(t.type===`Scene`)this.scene=t;else if(t instanceof e)this.scene=t.scene;else throw`Invalid param: owner must be a Component`;this._owner=t}this._dontClear=!!n.dontClear,this._renderer=this.scene._renderer,this.meta=n.meta||{},this.id=n.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(e){return this.type===e}fire(e,t,n){this._events||={},this._eventSubs||(this._eventSubs={},this._eventSubsNum={}),n!==!0&&(this._events[e]=t||!0);let r=this._eventSubs[e],i;if(r)for(let n in r)r.hasOwnProperty(n)&&(i=r[n],this._eventCallDepth++,this._eventCallDepth<300?i.callback.call(i.scope,t):this.error(`fire: potential stack overflow from recursive event '`+e+`' - dropping this event`),this._eventCallDepth--)}on(e,t,n){this._events||={},this._subIdMap||=new ID,this._subIdEvents||={},this._eventSubs||={},this._eventSubsNum||={};let r=this._eventSubs[e];r?this._eventSubsNum[e]++:(r={},this._eventSubs[e]=r,this._eventSubsNum[e]=1);let i=this._subIdMap.addItem();r[i]={callback:t,scope:n||this},this._subIdEvents[i]=e;let a=this._events[e];return a!==void 0&&t.call(n||this,a),i}off(e){if(e==null||!this._subIdEvents)return;let t=this._subIdEvents[e];if(t){delete this._subIdEvents[e];let n=this._eventSubs[t];n&&(delete n[e],this._eventSubsNum[t]--),this._subIdMap.removeItem(e)}}once(e,t,n){let r=this,i=this.on(e,function(e){r.off(i),t.call(n||this,e)},n)}hasSubs(e){return this._eventSubsNum&&this._eventSubsNum[e]>0}log(e){e=`[LOG]`+this._message(e),window.console.log(e),this.scene.fire(`log`,e)}_message(e){return` [`+this.type+` `+JD.inQuotes(this.id)+`]: `+e}warn(e){e=`[WARN]`+this._message(e),window.console.warn(e),this.scene.fire(`warn`,e)}error(e){e=`[ERROR]`+this._message(e),window.console.error(e),this.scene.fire(`error`,e)}_attach(e){let t=e.name;if(!t){this.error(`Component 'name' expected`);return}let n=e.component,r=e.sceneDefault,i=e.sceneSingleton,a=e.type,o=e.on,s=e.recompiles!==!1;if(n&&(JD.isNumeric(n)||JD.isString(n))){let e=n;if(n=this.scene.components[e],!n){this.error(`Component not found: `+JD.inQuotes(e));return}}if(!n){if(i===!0){let e=this.scene.types[a];for(let t in e)if(e.hasOwnProperty){n=e[t];break}if(!n)return this.error(`Scene has no default component for '`+t+`'`),null}else if(r===!0&&(n=this.scene[t],!n))return this.error(`Scene has no default component for '`+t+`'`),null}if(n){if(n.scene.id!==this.scene.id){this.error(`Not in same scene: `+n.type+` `+JD.inQuotes(n.id));return}if(a&&!n.isType(a)){this.error(`Expected a `+a+` type or subtype: `+n.type+` `+JD.inQuotes(n.id));return}}this._attachments||={};let c=this._attached[t],l,u,d;if(c){if(n&&c.id===n.id)return;let e=this._attachments[c.id];for(l=e.subs,u=0,d=l.length;u<d;u++)c.off(l[u]);delete this._attached[t],delete this._attachments[c.id];let r=e.params.onDetached;r&&(JD.isFunction(r)?r(c):r.scope?r.callback.call(r.scope,c):r.callback(c)),e.managingLifecycle&&c.destroy()}if(n){let r={params:e,component:n,subs:[],managingLifecycle:!1};r.subs.push(n.once(`destroyed`,function(){r.params.component=null,this._attach(r.params)},this)),s&&r.subs.push(n.on(`dirty`,function(){this.fire(`dirty`,this)},this)),this._attached[t]=n,this._attachments[n.id]=r;let i=e.onAttached;if(i&&(JD.isFunction(i)?i(n):i.scope?i.callback.call(i.scope,n):i.callback(n)),o){let e,t,i,a;for(e in o)if(o.hasOwnProperty(e)){if(t=o[e],JD.isFunction(t)?(i=t,a=null):(i=t.callback,a=t.scope),!i)continue;r.subs.push(n.on(e,i,a))}}}return s&&this.fire(`dirty`,this),this.fire(t,n),n}_checkComponent(e,t){if(!t.isComponent)if(JD.isID(t)){let e=t;if(t=this.scene.components[e],!t){this.error(`Component not found: `+e);return}}else{this.error(`Expected a Component or ID`);return}if(e!==t.type){this.error(`Expected a `+e+` Component`);return}if(t.scene.id!==this.scene.id){this.error(`Not in same scene: `+t.type);return}return t}_checkComponent2(e,t){if(!t.isComponent)if(JD.isID(t)){let e=t;if(t=this.scene.components[e],!t){this.error(`Component not found: `+e);return}}else{this.error(`Expected a Component or ID`);return}if(t.scene.id!==this.scene.id){this.error(`Not in same scene: `+t.type);return}for(var n=0,r=e.length;n<r;n++)if(e[n]===t.type)return t;return this.error(`Expected component types: `+e),null}_own(e){this._ownedComponents||={},this._ownedComponents[e.id]||(this._ownedComponents[e.id]=e),e.once(`destroyed`,()=>{delete this._ownedComponents[e.id]},this)}_needUpdate(e){this._updateScheduled||(this._updateScheduled=!0,e===0?this._doUpdate():aO.scheduleTask(this._doUpdate,this))}_doUpdate(){this._updateScheduled&&(this._updateScheduled=!1,this._update&&this._update())}scheduleTask(e){aO.scheduleTask(e,null)}_update(){}clear(){if(this._ownedComponents)for(var e in this._ownedComponents)this._ownedComponents.hasOwnProperty(e)&&(this._ownedComponents[e].destroy(),delete this._ownedComponents[e])}destroy(){if(this.destroyed)return;this.fire(`destroyed`,this.destroyed=!0);let e,t,n,r,i,a;if(this._attachments){for(e in this._attachments)if(this._attachments.hasOwnProperty(e)){for(t=this._attachments[e],n=t.component,r=t.subs,i=0,a=r.length;i<a;i++)n.off(r[i]);t.managingLifecycle&&n.destroy()}}if(this._ownedComponents)for(e in this._ownedComponents)this._ownedComponents.hasOwnProperty(e)&&(n=this._ownedComponents[e],n.destroy(),delete this._ownedComponents[e]);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}},y$e=Y.vec3(),b$e=Y.vec3(),x$e=Y.mat4(),uO=class{constructor(){this.normal=Y.vec3(),this.offset=0,this.testVertex=Y.vec3()}set(e,t,n,r){let i=1/Math.sqrt(e*e+t*t+n*n);this.normal[0]=e*i,this.normal[1]=t*i,this.normal[2]=n*i,this.offset=r*i,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}},dO=class{constructor(){this.planes=[new uO,new uO,new uO,new uO,new uO,new uO]}};dO.INSIDE=0,dO.INTERSECT=1,dO.OUTSIDE=2;function fO(e,t,n){let r=Y.mulMat4(n,t,x$e),i=r[0],a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],u=r[6],d=r[7],f=r[8],p=r[9],m=r[10],h=r[11],g=r[12],_=r[13],v=r[14],y=r[15];e.planes[0].set(s-i,d-c,h-f,y-g),e.planes[1].set(s+i,d+c,h+f,y+g),e.planes[2].set(s-a,d-l,h-p,y-_),e.planes[3].set(s+a,d+l,h+p,y+_),e.planes[4].set(s-o,d-u,h-m,y-v),e.planes[5].set(s+o,d+u,h+m,y+v)}function pO(e,t){let n=dO.INSIDE,r=y$e,i=b$e;r[0]=t[0],r[1]=t[1],r[2]=t[2],i[0]=t[3],i[1]=t[4],i[2]=t[5];let a=[r,i];for(let t=0;t<6;++t){let r=e.planes[t];if(r.normal[0]*a[r.testVertex[0]][0]+r.normal[1]*a[r.testVertex[1]][1]+r.normal[2]*a[r.testVertex[2]][2]+r.offset<0)return dO.OUTSIDE;r.normal[0]*a[1-r.testVertex[0]][0]+r.normal[1]*a[1-r.testVertex[1]][1]+r.normal[2]*a[1-r.testVertex[2]][2]+r.offset<0&&(n=dO.INTERSECT)}return n}var mO=class e extends lO{constructor(e={}){if(!e.viewer)throw`[MarqueePicker] Missing config: viewer`;if(!e.objectsKdTree3)throw`[MarqueePicker] Missing config: objectsKdTree3`;super(e.viewer.scene,e),this.viewer=e.viewer,this._objectsKdTree3=e.objectsKdTree3,this._canvasMarqueeCorner1=Y.vec2(),this._canvasMarqueeCorner2=Y.vec2(),this._canvasMarquee=Y.AABB2(),this._marqueeFrustum=new dO,this._marqueeFrustumProjMat=Y.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(e){this._canvasMarqueeCorner1.set(e),this._canvasMarqueeCorner2.set(e),this._updateMarquee()}setMarqueeCorner2(e){this._canvasMarqueeCorner2.set(e),this._updateMarquee()}setMarquee(e,t){this._canvasMarqueeCorner1.set(e),this._canvasMarqueeCorner2.set(t),this._updateMarquee()}setMarqueeVisible(e){this._marqueVisible=e,this._marqueeElement.style.visibility=e?`visible`:`hidden`}getMarqueeVisible(){return this._marqueVisible}setPickMode(t){if(t!==e.PICK_MODE_INSIDE&&t!==e.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===e.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=[],n=(r,i=dO.INTERSECT)=>{if(i===dO.INTERSECT&&(i=pO(this._marqueeFrustum,r.aabb)),i!==dO.OUTSIDE){if(r.entities){let n=r.entities;for(let r=0,i=n.length;r<i;r++){let i=n[r];if(!i.visible)continue;let a=i.aabb;this._pickMode===e.PICK_MODE_INSIDE?pO(this._marqueeFrustum,a)===dO.INSIDE&&t.push(i.id):pO(this._marqueeFrustum,a)!==dO.OUTSIDE&&t.push(i.id)}}r.left&&n(r.left,i),r.right&&n(r.right,i)}};return(this._canvasMarquee[2]-this._canvasMarquee[0]>3||this._canvasMarquee[3]-this._canvasMarquee[1]>3)&&n(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 e=this.viewer.scene.canvas.canvas,t=e.clientWidth,n=e.clientHeight,r=e.clientLeft,i=e.clientTop,a=2/t,o=2/n,s=e.clientHeight/e.clientWidth,c=(this._canvasMarquee[0]-r)*a+-1,l=(this._canvasMarquee[2]-r)*a+-1,u=-(this._canvasMarquee[3]-i)*o+1,d=-(this._canvasMarquee[1]-i)*o+1,f=this.viewer.scene.camera.frustum.near*(17*s);Y.frustumMat4(c,l,u*s,d*s,f,1e4,this._marqueeFrustumProjMat),fO(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)}};mO.PICK_MODE_INTERSECTS=0,mO.PICK_MODE_INSIDE=1;var S$e=class extends lO{constructor(e){super(e.marqueePicker,e);let t=e.marqueePicker,n=t.viewer.scene.canvas.canvas,r,i,a,o,s,c,l=!1,u=!1,d=!1,f;n.addEventListener(`mousedown`,e=>{this.getActive()&&e.button===0&&(f=setTimeout(function(){let a=t.viewer.scene.input;a.keyDown[a.KEY_CTRL]||t.clear(),r=e.pageX,i=e.pageY,s=e.offsetX,e.offsetY,t.setMarqueeCorner1([r,i]),l=!0,t.viewer.cameraControl.pointerEnabled=!1,t.setMarqueeVisible(!0),n.style.cursor=`crosshair`},400),u=!0)}),n.addEventListener(`mouseup`,e=>{if(!this.getActive()||!l&&!d||e.button!==0)return;clearTimeout(f),a=e.pageX,o=e.pageY;let n=Math.abs(a-r),s=Math.abs(o-i);l=!1,t.viewer.cameraControl.pointerEnabled=!0,d&&=!1,(n>3||s>3)&&t.pick()}),document.addEventListener(`mouseup`,e=>{this.getActive()&&e.button===0&&(clearTimeout(f),l&&(t.setMarqueeVisible(!1),l=!1,u=!1,d=!0,t.viewer.cameraControl.pointerEnabled=!0))},!0),n.addEventListener(`mousemove`,e=>{this.getActive()&&e.button===0&&u&&(clearTimeout(f),l&&(a=e.pageX,o=e.pageY,c=e.offsetX,e.offsetY,t.setMarqueeVisible(!0),t.setMarqueeCorner2([a,o]),t.setPickMode(s<c?mO.PICK_MODE_INSIDE:mO.PICK_MODE_INTERSECTS)))})}setActive(e){this._active!==e&&(this._active=e,this.fire(`active`,this._active))}getActive(){return this._active}destroy(){}},hO=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,n,r=e=>{if(!this._running)return;n||=e;let i=e-n,a=Math.min(i/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)}},gO=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 n=this._messages[this._locale];if(!n)return null;let r=_O(e,n);return r?t?vO(r,t):r:null}translatePlurals(e,t,n){let r=this._messages[this._locale];if(!r)return null;let i=_O(e,r);return t=parseInt(``+t,10),i=t===0?i.zero:t>1?i.other:i.one,i?(i=vO(i,[t]),n&&(i=vO(i,n)),i):null}fire(e,t,n){this._events||={},this._eventSubs||={},n!==!0&&(this._events[e]=t||!0);let r=this._eventSubs[e];if(r)for(let e in r)r.hasOwnProperty(e)&&r[e].callback(t)}on(e,t){this._events||={},this._eventSubIDMap||=new ID,this._eventSubEvents||={},this._eventSubs||={};let n=this._eventSubs[e];n||(n={},this._eventSubs[e]=n);let r=this._eventSubIDMap.addItem();n[r]={callback:t},this._eventSubEvents[r]=e;let i=this._events[e];return i!==void 0&&t(i),r}off(e){if(e==null||!this._eventSubEvents)return;let t=this._eventSubEvents[e];if(t){delete this._eventSubEvents[e];let n=this._eventSubs[t];n&&delete n[e],this._eventSubIDMap.removeItem(e)}}};function _O(e,t){if(t[e])return t[e];let n=e.split(`.`),r=t;for(let e=0,t=n.length;r&&e<t;e++){let t=n[e];r=r[t]}return r}function vO(e,t=[]){return e.replace(/\{\{|\}\}|\{(\d+)\}/g,function(e,n){return e===`{{`?`{`:e===`}}`?`}`:t[n]})}var yO=class extends lO{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 n=e-t,r=e+t;n<0&&(n=0),r>1&&(r=1);var i=this.getPoint(n),a=this.getPoint(r),o=Y.subVec3(a,i,[]);return Y.normalizeVec3(o,[])}getPointAt(e){var t=this.getUToTMapping(e);return this.getPoint(t)}getPoints(e){e||=5;var t,n=[];for(t=0;t<=e;t++)n.push(this.getPoint(t/e));return n}_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=[],n,r=this.getPoint(0),i,a=0;for(t.push(0),i=1;i<=e;i++)n=this.getPoint(i/e),a+=Y.lenVec3(Y.subVec3(n,r,[])),t.push(a),r=n;return this.cacheArcLengths=t,t}_updateArcLengths(){this.needsUpdate=!0,this._getLengths()}getUToTMapping(e,t){for(var n=this._getLengths(),r=0,i=n.length,a,o=t||e*n[i-1],s=0,c=i-1,l;s<=c;)if(r=Math.floor(s+(c-s)/2),l=n[r]-o,l<0)s=r+1;else if(l>0)c=r-1;else{c=r;break}if(r=c,n[r]===o)return a=r/(i-1),a;var u=n[r],d=n[r+1]-u,f=(o-u)/d;return a=(r+f)/(i-1),a}},bO=class extends yO{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 n=(t.length-1)*e,r=Math.floor(n),i=n-r,a=t[r===0?r:r-1],o=t[r],s=t[r>t.length-2?t.length-1:r+1],c=t[r>t.length-3?t.length-1:r+2],l=Y.vec3();return l[0]=Y.catmullRomInterpolate(a[0],o[0],s[0],c[0],i),l[1]=Y.catmullRomInterpolate(a[1],o[1],s[1],c[1],i),l[2]=Y.catmullRomInterpolate(a[2],o[2],s[2],c[2],i),l}getJSON(){return{points,t:this._t}}},xO=Y.vec3(),C$e=class extends lO{get type(){return`CameraPath`}constructor(e,t={}){super(e,t),this._frames=[],this._eyeCurve=new bO(this),this._lookCurve=new bO(this),this._upCurve=new bO(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,n,r){let i={t:e,eye:t.slice(0),look:n.slice(0),up:r.slice(0)};this._frames.push(i),this._eyeCurve.points.push(i.eye),this._lookCurve.points.push(i.look),this._upCurve.points.push(i.up)}addFrames(e){let t;for(let n=0,r=e.length;n<r;n++)t=e[n],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,xO),t.look=this._lookCurve.getPoint(e,xO),t.up=this._upCurve.getPoint(e,xO)}sampleFrame(e,t,n,r){e=e<0?0:e>1?1:e,this._eyeCurve.getPoint(e,t),this._lookCurve.getPoint(e,n),this._upCurve.getPoint(e,r)}smoothFrameTimes(e){if(this._frames.length===0)return;let t=Y.vec3();var n=0;this._frames[0].t=0;let r=[];for(let e=1,a=this._frames.length;e<a;e++){var i=Y.lenVec3(Y.subVec3(this._frames[e].eye,this._frames[e-1].eye,t));r[e]=i,n+=i}for(let t=1,i=this._frames.length;t<i;t++){let i=r[t]/n*e;this._frames[t].t=this._frames[t-1].t+i}}clearFrames(){this._frames=[],this._eyeCurve.points=[],this._lookCurve.points=[],this._upCurve.points=[]}},SO=Y.vec3(),CO=Y.vec3(),wO=Y.vec3(),TO=Y.vec3(),EO=Y.vec3(),DO=class e extends lO{get type(){return`CameraFlightAnimation`}constructor(e,t={}){super(e,t),this._look1=Y.vec3(),this._eye1=Y.vec3(),this._up1=Y.vec3(),this._look2=Y.vec3(),this._eye2=Y.vec3(),this._up2=Y.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=t.easing!==!1,this.duration=t.duration,this.fit=t.fit,this.fitFOV=t.fitFOV,this.trail=t.trail}flyTo(e,t,n){e||=this.scene,this._flying&&this.stop(),this._flying=!1,this._flyingEye=!1,this._flyingLook=!1,this._flyingEyeLookUp=!1,this._callback=t,this._callbackScope=n;let r=this.scene.camera,i=!!e.projection&&e.projection!==r.projection;this._eye1[0]=r.eye[0],this._eye1[1]=r.eye[1],this._eye1[2]=r.eye[2],this._look1[0]=r.look[0],this._look1[1]=r.look[1],this._look1[2]=r.look[2],this._up1[0]=r.up[0],this._up1[1]=r.up[1],this._up1[2]=r.up[2],this._orthoScale1=r.ortho.scale,this._orthoScale2=e.orthoScale||this._orthoScale1;let a,o,s,c,l;if(e.aabb)a=e.aabb;else if(e.length===6)a=e;else if(e.eye&&e.look||e.up)o=e.eye,s=e.look,c=e.up;else if(e.eye)o=e.eye;else if(e.look)s=e.look;else{let r=e;if((JD.isNumeric(r)||JD.isString(r))&&(l=r,r=this.scene.components[l],!r)){this.error(`Component not found: `+JD.inQuotes(l)),t&&(n?t.call(n):t());return}i||(a=r.aabb||this.scene.aabb)}let u=e.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 t=Y.getAABB3Center(a);this._look2=u||t;let n=Y.subVec3(this._eye1,this._look1,SO),r=Y.normalizeVec3(n),i=u?Y.getAABB3DiagPoint(a,u):Y.getAABB3Diag(a),o=e.fitFOV||this._fitFOV,s=Math.abs(i/Math.tan(o*Y.DEGTORAD));this._orthoScale2=i*1.1,this._eye2[0]=this._look2[0]+r[0]*s,this._eye2[1]=this._look2[1]+r[1]*s,this._eye2[2]=this._look2[2]+r[2]*s,this._up2[0]=this._up1[0],this._up2[1]=this._up1[1],this._up2[2]=this._up1[2],this._flyingEyeLookUp=!0}else (o||s||c)&&(this._flyingEyeLookUp=!!o&&!!s&&!!c,this._flyingEye=!!o&&!s,this._flyingLook=!!s&&!o,o&&(this._eye2[0]=o[0],this._eye2[1]=o[1],this._eye2[2]=o[2]),s&&(this._look2[0]=s[0],this._look2[1]=s[1],this._look2[2]=s[2]),c&&(this._up2[0]=c[0],this._up2[1]=c[1],this._up2[2]=c[2]));i?(e.projection===`ortho`&&r.projection!==`ortho`&&(this._projection2=`ortho`,this._projMatrix1=r.projMatrix.slice(),this._projMatrix2=r.ortho.matrix.slice(),r.projection=`customProjection`),e.projection===`perspective`&&r.projection!==`perspective`&&(this._projection2=`perspective`,this._projMatrix1=r.projMatrix.slice(),this._projMatrix2=r.perspective.matrix.slice(),r.projection=`customProjection`)):this._projection2=null,this.fire(`started`,e,!0),this._time1=Date.now(),this._time2=this._time1+(Number.isFinite(e.duration)?e.duration*1e3:this._duration),this._flying=!0,aO.scheduleTask(this._update,this)}jumpTo(e){this._jumpTo(e)}_jumpTo(e){this._flying&&this.stop();let t=this.scene.camera;var n,r,i,a,o;if(e.aabb)n=e.aabb;else if(e.length===6)n=e;else if(e.eye||e.look||e.up)i=e.eye,a=e.look,o=e.up;else{let t=e;if((JD.isNumeric(t)||JD.isString(t))&&(r=t,t=this.scene.components[r],!t)){this.error(`Component not found: `+JD.inQuotes(r));return}n=t.aabb||this.scene.aabb}let s=e.poi;if(n){if(n[3]<=n[0]||n[4]<=n[1]||n[5]<=n[2])return;var c=s?Y.getAABB3DiagPoint(n,s):Y.getAABB3Diag(n);a=s||Y.getAABB3Center(n,a),this._trail?Y.subVec3(t.look,a,EO):Y.subVec3(t.eye,t.look,EO),Y.normalizeVec3(EO);let r;r=(e.fit===void 0?this._fit:e.fit)?Math.abs(c/Math.tan((e.fitFOV||this._fitFOV)*Y.DEGTORAD)):Y.lenVec3(Y.subVec3(t.eye,t.look,SO)),Y.mulVec3Scalar(EO,r),t.eye=Y.addVec3(a,EO,SO),t.look=a,this.scene.camera.ortho.scale=c*1.1}else (i||a||o)&&(i&&(t.eye=i),a&&(t.look=a),o&&(t.up=o));e.projection&&(t.projection=e.projection)}_update(){if(!this._flying)return;let t=(Date.now()-this._time1)/(this._time2-this._time1),n=t>=1;t>1&&(t=1);let r=this.easing?e._ease(t,0,1,1):t,i=this.scene.camera;if(this._flyingEye||this._flyingLook?this._flyingEye?(Y.subVec3(i.eye,i.look,EO),i.eye=Y.lerpVec3(r,0,1,this._eye1,this._eye2,wO),i.look=Y.subVec3(wO,EO,CO)):this._flyingLook&&(i.look=Y.lerpVec3(r,0,1,this._look1,this._look2,CO),i.up=Y.lerpVec3(r,0,1,this._up1,this._up2,TO)):this._flyingEyeLookUp&&(i.eye=Y.lerpVec3(r,0,1,this._eye1,this._eye2,wO),i.look=Y.lerpVec3(r,0,1,this._look1,this._look2,CO),i.up=Y.lerpVec3(r,0,1,this._up1,this._up2,TO)),this._projection2){let n=this._projection2===`ortho`?e._easeOutExpo(t,0,1,1):e._easeInCubic(t,0,1,1);i.customProjection.matrix=Y.lerpMat4(n,0,1,this._projMatrix1,this._projMatrix2)}else i.ortho.scale=this._orthoScale1+t*(this._orthoScale2-this._orthoScale1);if(n){i.ortho.scale=this._orthoScale2,this.stop();return}aO.scheduleTask(this._update,this)}static _ease(e,t,n,r){return e/=r,-n*e*(e-2)+t}static _easeInCubic(e,t,n,r){return e/=r,n*e*e*e+t}static _easeOutExpo(e,t,n,r){return n*(-(2**(-10*e/r))+1)+t}stop(){if(!this._flying)return;this._flying=!1,this._time1=null,this._time2=null,this._projection2&&(this.scene.camera.projection=this._projection2);let e=this._callback;e&&(this._callback=null,this._callbackScope?e.call(this._callbackScope):e()),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(e){this._duration=Number.isFinite(e)?e*1e3:500,this.stop()}get duration(){return this._duration/1e3}set fit(e){this._fit=e!==!1}get fit(){return this._fit}set fitFOV(e){this._fitFOV=e||45}get fitFOV(){return this._fitFOV}set trail(e){this._trail=!!e}get trail(){return this._trail}destroy(){this.stop(),super.destroy()}},OO=class e extends lO{get type(){return`CameraPathAnimation`}constructor(t,n={}){super(t,n),this._cameraFlightAnimation=new DO(this),this._t=0,this.state=e.SCRUBBING,this._playingFromT=0,this._playingToT=0,this._playingRate=n.playingRate||1,this._playingDir=1,this._lastTime=null,this.cameraPath=n.cameraPath,this._tick=this.scene.on(`tick`,this._updateT,this)}_updateT(){let t=this._cameraPath;if(!t)return;let n,r,i=performance.now(),a=this._lastTime?(i-this._lastTime)*.001:0;if(this._lastTime=i,a!==0)switch(this.state){case e.SCRUBBING:return;case e.PLAYING:if(this._t+=this._playingRate*a,n=this._cameraPath.frames.length,n===0||this._playingDir<0&&this._t<=0||this._playingDir>0&&this._t>=this._cameraPath.frames[n-1].t){this.state=e.SCRUBBING,this._t=this._cameraPath.frames[n-1].t,this.fire(`stopped`);return}t.loadFrame(this._t);break;case e.PLAYING_TO:r=this._t+this._playingRate*a*this._playingDir,(this._playingDir<0&&r<=this._playingToT||this._playingDir>0&&r>=this._playingToT)&&(r=this._playingToT,this.state=e.SCRUBBING,this.fire(`stopped`)),this._t=r,t.loadFrame(this._t);break}}_ease(e,t,n,r){return e/=r,-n*e*(e-2)+t}set cameraPath(e){this._cameraPath=e}get cameraPath(){return this._cameraPath}set rate(e){this._playingRate=e}get rate(){return this._playingRate}play(){this._cameraPath&&(this._lastTime=null,this.state=e.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=e.PLAYING_TO)}playToFrame(e){let t=this._cameraPath;if(!t)return;let n=t.frames[e];if(!n){this.error(`playToFrame - frame index out of range: `+e);return}this.playToT(n.t)}flyToFrame(t,n){let r=this._cameraPath;if(!r)return;let i=r.frames[t];if(!i){this.error(`flyToFrame - frame index out of range: `+t);return}this.state=e.SCRUBBING,this._cameraFlightAnimation.flyTo(i,n)}scrubToT(t){let n=this._cameraPath;n&&this.scene.camera&&(this._t=t,n.loadFrame(this._t),this.state=e.SCRUBBING)}scrubToFrame(t){let n=this._cameraPath;if(n&&this.scene.camera){if(!n.frames[t]){this.error(`playToFrame - frame index out of range: `+t);return}n.loadFrame(this._t),this.state=e.SCRUBBING}}stop(){this.state=e.SCRUBBING,this.fire(`stopped`)}destroy(){super.destroy(),this.scene.off(this._tick)}};OO.STOPPED=0,OO.SCRUBBING=1,OO.PLAYING=2,OO.PLAYING_TO=3;var kO=class extends lO{get type(){return`Geometry`}get isGeometry(){return!0}constructor(e,t={}){super(e,t),GD.memory.meshes++}destroy(){super.destroy(),GD.memory.meshes--}},AO=new ID({}),jO=class{constructor(e){this.id=AO.addItem({});for(let t in e)e.hasOwnProperty(t)&&(this[t]=e[t])}destroy(){AO.removeItem(this.id)}},MO=class{constructor(e,t,n,r,i,a,o,s,c){switch(this._gl=e,this.type=t,this.allocated=!1,this.ConstructorType=n.constructor,n.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=a,this.length=0,this.dataLength=r,this.numItems=0,this.itemSize=i,this.normalized=!!o,this.stride=s||0,this.offset=c||0,this._allocate(n)}_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 n=new this.ConstructorType(t*this.itemSize);return this._gl.bindBuffer(this.type,this._handle),this._gl.getBufferSubData(this.type,e*this.itemByteSize*this.itemSize,n,0,t*this.itemSize),n}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)}},NO=(function(){let e=[],t=[],n=[],r=[],i=[],a=0,o=new Uint16Array(3),s=new Uint16Array(3),c=new Uint16Array(3),l=Y.vec3(),u=Y.vec3(),d=Y.vec3(),f=Y.vec3(),p=Y.vec3(),m=Y.vec3(),h=Y.vec3();function g(i,a){let o={},s,c,l,u,d=10**4,f,p,m=0;for(f=0,p=i.length;f<p;f+=3)s=i[f],c=i[f+1],l=i[f+2],u=Math.round(s*d)+`_`+Math.round(c*d)+`_`+Math.round(l*d),o[u]===void 0&&(o[u]=m/3,e[m++]=s,e[m++]=c,e[m++]=l),t[f/3]=o[u];for(f=0,p=a.length;f<p;f++)r[f]=t[a[f]],n[r[f]]=a[f]}function _(t,n){a=0;for(let g=0,_=t;g<_;g+=3){let t=r[g]*3,_=r[g+1]*3,v=r[g+2]*3;n?(o[0]=e[t],o[1]=e[t+1],o[2]=e[t+2],s[0]=e[_],s[1]=e[_+1],s[2]=e[_+2],c[0]=e[v],c[1]=e[v+1],c[2]=e[v+2],Y.decompressPosition(o,n,l),Y.decompressPosition(s,n,u),Y.decompressPosition(c,n,d)):(l[0]=e[t],l[1]=e[t+1],l[2]=e[t+2],u[0]=e[_],u[1]=e[_+1],u[2]=e[_+2],d[0]=e[v],d[1]=e[v+1],d[2]=e[v+2]),Y.subVec3(d,u,f),Y.subVec3(l,u,p),Y.cross3Vec3(f,p,m),Y.normalizeVec3(m,h);let y=i[a]||(i[a]={normal:Y.vec3()});y.normal[0]=h[0],y.normal[1]=h[1],y.normal[2]=h[2],a++}}return function(e,t,a,o){g(e,t),_(t.length,a);let s=[],c=Math.cos(Y.DEGTORAD*o),l={},u,d,f,p,m,h=!1,v,y,b,x,S,C;for(let e=0,n=t.length;e<n;e+=3){let t=e/3;for(let n=0;n<3;n++)u=r[e+n],d=r[e+(n+1)%3],f=Math.min(u,d),p=Math.max(u,d),m=f+`,`+p,l[m]===void 0?l[m]={index1:f,index2:p,face1:t,face2:void 0}:l[m].face2=t}for(m in l)v=l[m],!(v.face2!==void 0&&(y=i[v.face1].normal,b=i[v.face2].normal,x=Y.dotVec3(y,b),x>c))&&(S=n[v.index1],C=n[v.index2],(!h&&S>65535||C>65535)&&(h=!0),s.push(S),s.push(C));return h?new Uint32Array(s):new Uint16Array(s)}})();function w$e(e){let t=new Float32Array(3),n=new Float32Array(3),r,i;for(r=0;r<3;r++)t[r]=Number.MAX_VALUE,n[r]=-Number.MAX_VALUE;for(r=0;r<e.length;r+=3)for(i=0;i<3;i++)t[i]=Math.min(t[i],e[r+i]),n[i]=Math.max(n[i],e[r+i]);return{min:t,max:n}}var T$e=(function(){let e=Y.mat4(),t=Y.mat4();return function(n,r){r||=Y.mat4();let i=n[0],a=n[1],o=n[2],s=n[3]-i,c=n[4]-a,l=n[5]-o,u=65535;return Y.identityMat4(e),Y.translationMat4v(n,e),Y.identityMat4(t),Y.scalingMat4v([s/u,c/u,l/u],t),Y.mulMat4(e,t,r),r}})(),E$e=(function(){let e=Y.mat4(),t=Y.mat4();return function(n,r,i){let a=new Uint16Array(n.length),o=new Float32Array([i[0]===r[0]?0:65535/(i[0]-r[0]),i[1]===r[1]?0:65535/(i[1]-r[1]),i[2]===r[2]?0:65535/(i[2]-r[2])]),s;for(s=0;s<n.length;s+=3)a[s+0]=Math.max(0,Math.min(65535,Math.floor((n[s+0]-r[0])*o[0]))),a[s+1]=Math.max(0,Math.min(65535,Math.floor((n[s+1]-r[1])*o[1]))),a[s+2]=Math.max(0,Math.min(65535,Math.floor((n[s+2]-r[2])*o[2])));return Y.identityMat4(e),Y.translationMat4v(r,e),Y.identityMat4(t),Y.scalingMat4v([(i[0]-r[0])/65535,(i[1]-r[1])/65535,(i[2]-r[2])/65535],t),{quantized:a,decodeMatrix:Y.mulMat4(e,t,Y.identityMat4())}}})();function D$e(e,t,n){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])]);n[0]=Math.max(0,Math.min(65535,Math.floor((e[0]-t[0])*r[0]))),n[1]=Math.max(0,Math.min(65535,Math.floor((e[1]-t[1])*r[1]))),n[2]=Math.max(0,Math.min(65535,Math.floor((e[2]-t[2])*r[2])))}function O$e(e,t,n){return n[0]=e[0]*t[0]+t[12],n[1]=e[1]*t[5]+t[13],n[2]=e[2]*t[10]+t[14],n}function k$e(e,t,n=e){return n[0]=e[0]*t[0]+t[12],n[1]=e[1]*t[5]+t[13],n[2]=e[2]*t[10]+t[14],n[3]=e[3]*t[0]+t[12],n[4]=e[4]*t[5]+t[13],n[5]=e[5]*t[10]+t[14],n}function A$e(e,t,n=new Float32Array(e.length)){for(let r=0,i=e.length;r<i;r+=3)n[r+0]=e[r+0]*t[0]+t[12],n[r+1]=e[r+1]*t[5]+t[13],n[r+2]=e[r+2]*t[10]+t[14];return n}function j$e(e){let t=new Float32Array(2),n=new Float32Array(2),r,i;for(r=0;r<2;r++)t[r]=Number.MAX_VALUE,n[r]=-Number.MAX_VALUE;for(r=0;r<e.length;r+=2)for(i=0;i<2;i++)t[i]=Math.min(t[i],e[r+i]),n[i]=Math.max(n[i],e[r+i]);return{min:t,max:n}}var M$e=(function(){let e=Y.mat3(),t=Y.mat3();return function(n,r,i){let a=new Uint16Array(n.length),o=new Float32Array([65535/(i[0]-r[0]),65535/(i[1]-r[1])]),s;for(s=0;s<n.length;s+=2)a[s+0]=Math.max(0,Math.min(65535,Math.floor((n[s+0]-r[0])*o[0]))),a[s+1]=Math.max(0,Math.min(65535,Math.floor((n[s+1]-r[1])*o[1])));return Y.identityMat3(e),Y.translationMat3v(r,e),Y.identityMat3(t),Y.scalingMat3v([(i[0]-r[0])/65535,(i[1]-r[1])/65535],t),{quantized:a,decodeMatrix:Y.mulMat3(e,t,Y.identityMat3())}}})();function N$e(e){let t=new Int8Array(e.length),n,r,i,a,o;for(let s=0;s<e.length;s+=3)i=n=PO(e,s,`floor`,`floor`),r=FO(n),a=o=IO(e,s,r),n=PO(e,s,`ceil`,`floor`),r=FO(n),a=IO(e,s,r),a>o&&(i=n,o=a),n=PO(e,s,`floor`,`ceil`),r=FO(n),a=IO(e,s,r),a>o&&(i=n,o=a),n=PO(e,s,`ceil`,`ceil`),r=FO(n),a=IO(e,s,r),a>o&&(i=n,o=a),t[s]=i[0],t[s+1]=i[1];return t}function PO(e,t,n,r){let i=e[t]/(Math.abs(e[t])+Math.abs(e[t+1])+Math.abs(e[t+2])),a=e[t+1]/(Math.abs(e[t])+Math.abs(e[t+1])+Math.abs(e[t+2]));if(e[t+2]<0){let e=(1-Math.abs(a))*(i>=0?1:-1),t=(1-Math.abs(i))*(a>=0?1:-1);i=e,a=t}return new Int8Array([Math[n](i*127.5+(i<0?-1:0)),Math[r](a*127.5+(a<0?-1:0))])}function FO(e){let t=e[0],n=e[1];t/=t<0?127:128,n/=n<0?127:128;let r=1-Math.abs(t)-Math.abs(n);r<0&&(t=(1-Math.abs(n))*(t>=0?1:-1),n=(1-Math.abs(t))*(n>=0?1:-1));let i=Math.sqrt(t*t+n*n+r*r);return[t/i,n/i,r/i]}function IO(e,t,n){return e[t]*n[0]+e[t+1]*n[1]+e[t+2]*n[2]}function P$e(e,t,n){n[0]=e[0]*t[0]+t[6],n[1]=e[1]*t[4]+t[7]}function F$e(e,t,n=new Float32Array(e.length)){for(let r=0,i=e.length;r<i;r+=3)n[r+0]=e[r+0]*t[0]+t[6],n[r+1]=e[r+1]*t[4]+t[7];return n}function I$e(e,t){let n=e[0],r=e[1];n=(2*n+1)/255,r=(2*r+1)/255;let i=1-Math.abs(n)-Math.abs(r);i<0&&(n=(1-Math.abs(r))*(n>=0?1:-1),r=(1-Math.abs(n))*(r>=0?1:-1));let a=Math.sqrt(n*n+r*r+i*i);return t[0]=n/a,t[1]=r/a,t[2]=i/a,t}function L$e(e,t){for(let n=0,r=0,i=e.length;n<i;n+=2){let i=e[n+0],a=e[n+1];i=(2*i+1)/255,a=(2*a+1)/255;let o=1-Math.abs(i)-Math.abs(a);o<0&&(i=(1-Math.abs(a))*(i>=0?1:-1),a=(1-Math.abs(i))*(a>=0?1:-1));let s=Math.sqrt(i*i+a*a+o*o);t[r+0]=i/s,t[r+1]=a/s,t[r+2]=o/s,r+=3}return t}var LO={getPositionsBounds:w$e,createPositionsDecodeMatrix:T$e,compressPositions:E$e,compressPosition:D$e,decompressPositions:A$e,decompressPosition:O$e,decompressAABB:k$e,getUVBounds:j$e,compressUVs:M$e,decompressUVs:F$e,decompressUV:P$e,compressNormals:N$e,decompressNormals:L$e,decompressNormal:I$e},RO=GD.memory,zO=Y.AABB3(),BO=class extends kO{get type(){return`ReadableGeometry`}get isReadableGeometry(){return!0}constructor(e,t={}){super(e,t),this._state=new jO({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 n=this._state,r=this.scene.canvas.gl;switch(t.primitive=t.primitive||`triangles`,t.primitive){case`points`:n.primitive=r.POINTS,n.primitiveName=t.primitive;break;case`lines`:n.primitive=r.LINES,n.primitiveName=t.primitive;break;case`line-loop`:n.primitive=r.LINE_LOOP,n.primitiveName=t.primitive;break;case`line-strip`:n.primitive=r.LINE_STRIP,n.primitiveName=t.primitive;break;case`triangles`:n.primitive=r.TRIANGLES,n.primitiveName=t.primitive;break;case`triangle-strip`:n.primitive=r.TRIANGLE_STRIP,n.primitiveName=t.primitive;break;case`triangle-fan`:n.primitive=r.TRIANGLE_FAN,n.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'.`),n.primitive=r.TRIANGLES,n.primitiveName=t.primitive}if(t.positions)if(this._state.compressGeometry){let e=LO.getPositionsBounds(t.positions),r=LO.compressPositions(t.positions,e.min,e.max);n.positions=r.quantized,n.positionsDecodeMatrix=r.decodeMatrix}else n.positions=t.positions.constructor===Float32Array?t.positions:new Float32Array(t.positions);if(t.colors&&(n.colors=t.colors.constructor===Float32Array?t.colors:new Float32Array(t.colors)),t.uv)if(this._state.compressGeometry){let e=LO.getUVBounds(t.uv),r=LO.compressUVs(t.uv,e.min,e.max);n.uv=r.quantized,n.uvDecodeMatrix=r.decodeMatrix}else n.uv=t.uv.constructor===Float32Array?t.uv:new Float32Array(t.uv);t.normals&&(this._state.compressGeometry?n.normals=LO.compressNormals(t.normals):n.normals=t.normals.constructor===Float32Array?t.normals:new Float32Array(t.normals)),t.indices&&(n.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(),RO.meshes++,this._buildVBOs()}_buildVBOs(){let e=this._state,t=this.scene.canvas.gl;if(e.indices&&(e.indicesBuf=new MO(t,t.ELEMENT_ARRAY_BUFFER,e.indices,e.indices.length,1,t.STATIC_DRAW),RO.indices+=e.indicesBuf.numItems),e.positions&&(e.positionsBuf=new MO(t,t.ARRAY_BUFFER,e.positions,e.positions.length,3,t.STATIC_DRAW),RO.positions+=e.positionsBuf.numItems),e.normals){let n=e.compressGeometry;e.normalsBuf=new MO(t,t.ARRAY_BUFFER,e.normals,e.normals.length,3,t.STATIC_DRAW,n),RO.normals+=e.normalsBuf.numItems}e.colors&&(e.colorsBuf=new MO(t,t.ARRAY_BUFFER,e.colors,e.colors.length,4,t.STATIC_DRAW),RO.colors+=e.colorsBuf.numItems),e.uv&&(e.uvBuf=new MO(t,t.ARRAY_BUFFER,e.uv,e.uv.length,2,t.STATIC_DRAW),RO.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,n=NO(e.positions,e.indices,e.positionsDecodeMatrix,this._edgeThreshold);this._edgeIndicesBuf=new MO(t,t.ELEMENT_ARRAY_BUFFER,n,n.length,1,t.STATIC_DRAW),RO.indices+=this._edgeIndicesBuf.numItems}_buildPickTriangleVBOs(){let e=this._state;if(!e.positions||!e.indices)return;let t=this.scene.canvas.gl,n=Y.buildPickTriangles(e.positions,e.indices,e.compressGeometry),r=n.positions,i=n.colors;this._pickTrianglePositionsBuf=new MO(t,t.ARRAY_BUFFER,r,r.length,3,t.STATIC_DRAW),this._pickTriangleColorsBuf=new MO(t,t.ARRAY_BUFFER,i,i.length,4,t.STATIC_DRAW,!0),RO.positions+=this._pickTrianglePositionsBuf.numItems,RO.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),LO.decompressPositions(this._state.positions,this._state.positionsDecodeMatrix,this._decompressedPositions)),this._decompressedPositions):this._state.positions:null}set positions(e){let t=this._state,n=t.positions;if(!n){this.error(`can't update geometry positions - geometry has no positions`);return}if(n.length!==e.length){this.error(`can't update geometry positions - new positions are wrong length`);return}if(this._state.compressGeometry){let n=LO.getPositionsBounds(e),r=LO.compressPositions(e,n.min,n.max);e=r.quantized,t.positionsDecodeMatrix=r.decodeMatrix}n.set(e),t.positionsBuf&&t.positionsBuf.setData(n),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),LO.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,n=t.normals;if(!n){this.error(`can't update geometry normals - geometry has no normals`);return}if(n.length!==e.length){this.error(`can't update geometry normals - new normals are wrong length`);return}n.set(e),t.normalsBuf&&t.normalsBuf.setData(n),this.glRedraw()}get uv(){return this._state.uv?this._state.compressGeometry?(this._decompressedUV||(this._decompressedUV=new Float32Array(this._state.uv.length),LO.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,n=t.uv;if(!n){this.error(`can't update geometry UVs - geometry has no UVs`);return}if(n.length!==e.length){this.error(`can't update geometry UVs - new UVs are wrong length`);return}n.set(e),t.uvBuf&&t.uvBuf.setData(n),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,n=t.colors;if(!n){this.error(`can't update geometry colors - geometry has no colors`);return}if(n.length!==e.length){this.error(`can't update geometry colors - new colors are wrong length`);return}n.set(e),t.colorsBuf&&t.colorsBuf.setData(n),this.glRedraw()}get indices(){return this._state.indices}get aabb(){return this._aabbDirty&&=(this._aabb||=Y.AABB3(),Y.positions3ToAABB3(this._state.positions,this._aabb,this._state.positionsDecodeMatrix),!1),this._aabb}get obb(){return this._obbDirty&&=(this._obb||=Y.OBB3(),Y.positions3ToAABB3(this._state.positions,zO,this._state.positionsDecodeMatrix),Y.AABB3ToOBB3(zO,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,n=(n,r)=>{let i=e[n]*3;for(let e=0;e<3;++e)r[e]=t[i+e];return r},r=[Y.vec3(),Y.vec3(),Y.vec3(),Y.vec3()],i=0,a=Y.vec3([0,0,0]);for(let t=0;t<e.length;t+=3){let e=n(t,r[0]),o=n(t+1,r[1]),s=n(t+2,r[2]);Y.addVec3(e,o,r[3]),Y.addVec3(s,r[3],r[3]);let c=Y.lenVec3(Y.cross3Vec3(Y.subVec3(o,e,r[1]),Y.subVec3(s,e,r[2]),r[0]))/2;i+=c,Y.mulVec3Scalar(r[3],c,r[3]),Y.addVec3(a,r[3],a)}this._metrics={surfaceArea:i,centroid:Y.mulVec3Scalar(a,1/i/3,a)};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(),RO.meshes--}},VO=GD.memory,HO=Y.AABB3(),UO=class extends kO{get type(){return`VBOGeometry`}get isVBOGeometry(){return!0}constructor(e,t={}){super(e,t),this._state=new jO({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=Y.OBB3();let n=this._state,r=this.scene.canvas.gl;switch(t.primitive=t.primitive||`triangles`,t.primitive){case`points`:n.primitive=r.POINTS,n.primitiveName=t.primitive;break;case`lines`:n.primitive=r.LINES,n.primitiveName=t.primitive;break;case`line-loop`:n.primitive=r.LINE_LOOP,n.primitiveName=t.primitive;break;case`line-strip`:n.primitive=r.LINE_STRIP,n.primitiveName=t.primitive;break;case`triangles`:n.primitive=r.TRIANGLES,n.primitiveName=t.primitive;break;case`triangle-strip`:n.primitive=r.TRIANGLE_STRIP,n.primitiveName=t.primitive;break;case`triangle-fan`:n.primitive=r.TRIANGLE_FAN,n.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'.`),n.primitive=r.TRIANGLES,n.primitiveName=t.primitive}if(!t.positions){this.error(`Config expected: positions`);return}if(!t.indices){this.error(`Config expected: indices`);return}var i;if(!t.positionsDecodeMatrix){let e=LO.getPositionsBounds(t.positions),a=LO.compressPositions(t.positions,e.min,e.max);i=a.quantized,n.positionsDecodeMatrix=a.decodeMatrix,n.positionsBuf=new MO(r,r.ARRAY_BUFFER,i,i.length,3,r.STATIC_DRAW),VO.positions+=n.positionsBuf.numItems,Y.positions3ToAABB3(t.positions,this._aabb),Y.positions3ToAABB3(i,HO,n.positionsDecodeMatrix),Y.AABB3ToOBB3(HO,this._obb)}if(t.colors){let e=t.colors.constructor===Float32Array?t.colors:new Float32Array(t.colors);n.colorsBuf=new MO(r,r.ARRAY_BUFFER,e,e.length,4,r.STATIC_DRAW),VO.colors+=n.colorsBuf.numItems}if(t.uv){let e=LO.getUVBounds(t.uv),i=LO.compressUVs(t.uv,e.min,e.max),a=i.quantized;n.uvDecodeMatrix=i.decodeMatrix,n.uvBuf=new MO(r,r.ARRAY_BUFFER,a,a.length,2,r.STATIC_DRAW),VO.uvs+=n.uvBuf.numItems}if(t.normals){let e=LO.compressNormals(t.normals),i=n.compressGeometry;n.normalsBuf=new MO(r,r.ARRAY_BUFFER,e,e.length,3,r.STATIC_DRAW,i),VO.normals+=n.normalsBuf.numItems}{let e=t.indices.constructor===Uint32Array||t.indices.constructor===Uint16Array?t.indices:new Uint32Array(t.indices);n.indicesBuf=new MO(r,r.ELEMENT_ARRAY_BUFFER,e,e.length,1,r.STATIC_DRAW),VO.indices+=n.indicesBuf.numItems;let a=NO(i,e,n.positionsDecodeMatrix,this._edgeThreshold);this._edgeIndicesBuf=new MO(r,r.ELEMENT_ARRAY_BUFFER,a,a.length,1,r.STATIC_DRAW),this._state.primitiveName===`triangles`&&(this._numTriangles=t.indices.length/3)}this._buildHash(),VO.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(),VO.meshes--}},X={};X.load=function(e,t){var n=new XMLHttpRequest;n.open(`GET`,e,!0),n.responseType=`arraybuffer`,n.onload=function(e){t(e.target.response)},n.send()},X.save=function(e,t){var n=`data:application/octet-stream;base64,`+btoa(X.parse._buffToStr(e));window.location.href=n},X.clone=function(e){return JSON.parse(JSON.stringify(e))},X.bin={},X.bin.f=new Float32Array(1),X.bin.fb=new Uint8Array(X.bin.f.buffer),X.bin.rf=function(e,t){for(var n=X.bin.f,r=X.bin.fb,i=0;i<4;i++)r[i]=e[t+i];return n[0]},X.bin.rsl=function(e,t){return e[t]|e[t+1]<<8},X.bin.ril=function(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24},X.bin.rASCII0=function(e,t){for(var n=``;e[t]!=0;)n+=String.fromCharCode(e[t++]);return n},X.bin.wf=function(e,t,n){var r=new Float32Array(e.buffer,t,1);r[0]=n},X.bin.wsl=function(e,t,n){e[t]=n,e[t+1]=n>>8},X.bin.wil=function(e,t,n){e[t]=n,e[t+1]=n>>8,e[t+2]=n>>16,e[t+3]>>24},X.parse={},X.parse._buffToStr=function(e){for(var t=new Uint8Array(e),n=``,r=0;r<t.length;r++)n=n.concat(String.fromCharCode(t[r]));return n},X.parse._strToBuff=function(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return t},X.parse._readLine=function(e,t){for(var n=``;e[t]!=10;)n+=String.fromCharCode(e[t++]);return n},X.parse.fromJSON=function(e){return JSON.parse(X.parse._buffToStr(e))},X.parse.toJSON=function(e){var t=JSON.stringify(e);return X.parse._strToBuff(t)},X.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 n={from:0,to:0},r=0,i=new Uint8Array(e);r<i.length;){var a=X.parse._readLine(i,r);r+=a.length+1,a=a.replace(/ +(?= )/g,``),a=a.replace(/(^\s+|\s+$)/g,``);var o=a.split(` `);if(o[0]==`g`&&(n.to=t.i_verts.length,t.groups[o[1]]??(t.groups[o[1]]={from:t.i_verts.length,to:0}),n=t.groups[o[1]]),o[0]==`v`){var s=parseFloat(o[1]),c=parseFloat(o[2]),l=parseFloat(o[3]);t.c_verts.push(s,c,l)}if(o[0]==`vt`){var s=parseFloat(o[1]),c=1-parseFloat(o[2]);t.c_uvt.push(s,c)}if(o[0]==`vn`){var s=parseFloat(o[1]),c=parseFloat(o[2]),l=parseFloat(o[3]);t.c_norms.push(s,c,l)}if(o[0]==`f`){var u=o[1].split(`/`),d=o[2].split(`/`),f=o[3].split(`/`),p=parseInt(u[0])-1,m=parseInt(d[0])-1,h=parseInt(f[0])-1,g=parseInt(u[1])-1,_=parseInt(d[1])-1,v=parseInt(f[1])-1,y=parseInt(u[2])-1,b=parseInt(d[2])-1,x=parseInt(f[2])-1,S=t.c_verts.length/3,C=t.c_uvt.length/2,w=t.c_norms.length/3;if(p<0&&(p=S+p+1),m<0&&(m=S+m+1),h<0&&(h=S+h+1),g<0&&(g=C+g+1),_<0&&(_=C+_+1),v<0&&(v=C+v+1),y<0&&(y=w+y+1),b<0&&(b=w+b+1),x<0&&(x=w+x+1),t.i_verts.push(p,m,h),t.i_uvt.push(g,_,v),t.i_norms.push(y,b,x),o.length==5){var T=o[4].split(`/`),E=parseInt(T[0])-1,D=parseInt(T[1])-1,O=parseInt(T[2])-1;E<0&&(E=S+E+1),D<0&&(D=C+D+1),O<0&&(O=w+O+1),t.i_verts.push(p,h,E),t.i_uvt.push(g,v,D),t.i_norms.push(y,x,O)}}}return n.to=t.i_verts.length,t},X.parse.fromMD2=function(e){e=new Uint8Array(e);var t={},n={};n.ident=X.bin.ril(e,0),n.version=X.bin.ril(e,4),n.skinwidth=X.bin.ril(e,8),n.skinheight=X.bin.ril(e,12),n.framesize=X.bin.ril(e,16),n.num_skins=X.bin.ril(e,20),n.num_vertices=X.bin.ril(e,24),n.num_st=X.bin.ril(e,28),n.num_tris=X.bin.ril(e,32),n.num_glcmds=X.bin.ril(e,36),n.num_frames=X.bin.ril(e,40),n.offset_skins=X.bin.ril(e,44),n.offset_st=X.bin.ril(e,48),n.offset_tris=X.bin.ril(e,52),n.offset_frames=X.bin.ril(e,56),n.offset_glcmds=X.bin.ril(e,60),n.offset_end=X.bin.ril(e,64);var r=n.offset_st;t.c_uvt=[];for(var i=0;i<n.num_st;i++){var a=X.bin.rsl(e,r)/n.skinwidth,o=X.bin.rsl(e,r+2)/n.skinheight;t.c_uvt.push(a,o),r+=4}var r=n.offset_tris,s=[],c=[];t.i_verts=s,t.i_uvt=c;for(var i=0;i<n.num_tris;i++)s.push(X.bin.rsl(e,r),X.bin.rsl(e,r+2),X.bin.rsl(e,r+4)),c.push(X.bin.rsl(e,r+6),X.bin.rsl(e,r+8),X.bin.rsl(e,r+10)),r+=12;var r=n.offset_skins;t.skins=[];for(var i=0;i<n.num_skins;i++)t.skins.push(X.bin.rASCII0(e,r)),r+=64;var r=n.offset_frames;t.frames=[];for(var l=X.parse.fromMD2._normals,i=0;i<n.num_frames;i++){var u={},d=X.bin.rf(e,r),f=X.bin.rf(e,r+4),p=X.bin.rf(e,r+8);r+=12;var m=X.bin.rf(e,r),h=X.bin.rf(e,r+4),g=X.bin.rf(e,r+8);r+=12,u.name=X.bin.rASCII0(e,r),r+=16,u.verts=[],u.norms=[];for(var _=0;_<n.num_vertices;_++)u.verts.push(e[r]*d+m,e[r+1]*f+h,e[r+2]*p+g),u.norms.push(l[3*e[r+3]],l[3*e[r+3]+1],l[3*e[r+3]+2]),r+=4;t.frames.push(u)}return t},X.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],X.parse.fromCollada=function(e){var t=X.parse._buffToStr(e),n=new DOMParser().parseFromString(t,`text/xml`);n=n.childNodes[0];var r={},i=n.getElementsByTagName(`asset`)[0],a=n.getElementsByTagName(`library_geometries`)[0],o=n.getElementsByTagName(`library_images`)[0],s=n.getElementsByTagName(`library_materials`)[0],c=n.getElementsByTagName(`library_effects`)[0];return i&&(r.asset=X.parse.fromCollada._asset(i)),a&&(r.geometries=X.parse.fromCollada._libGeometries(a)),o&&(r.images=X.parse.fromCollada._libImages(o)),s&&(r.materials=X.parse.fromCollada._libMaterials(s)),c&&(r.effects=X.parse.fromCollada._libEffects(c)),r},X.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}},X.parse.fromCollada._libGeometries=function(e){e=e.getElementsByTagName(`geometry`);for(var t=[],n=0;n<e.length;n++){var r=e[n],i=X.parse.fromCollada._getMesh(r.getElementsByTagName(`mesh`)[0]);t.push(i)}return t},X.parse.fromCollada._getMesh=function(e){for(var t={},n=e.getElementsByTagName(`source`),r=t.sources={},i=0;i<n.length;i++){for(var a=n[i].getElementsByTagName(`float_array`)[0].textContent.split(` `),o=a.length-(a[a.length-1]==``?1:0),s=Array(o),c=0;c<o;c++)s[c]=parseFloat(a[c]);r[n[i].getAttribute(`id`)]=s}t.triangles=[];var l=e.getElementsByTagName(`triangles`);if(l==null)return t;for(var i=0;i<l.length;i++){var u={},d=l[i];u.material=d.getAttribute(`material`);for(var f=d.getElementsByTagName(`input`),p=[],c=0;c<f.length;c++){var m=f[c],s=[];p[parseInt(m.getAttribute(`offset`))]=s;var h=m.getAttribute(`semantic`);u[`s_`+h]=h==`VERTEX`?e.getElementsByTagName(`vertices`)[0].getElementsByTagName(`input`)[0].getAttribute(`source`).substring(1):m.getAttribute(`source`).substring(1),u[`i_`+h]=s,r[u[`s_`+h]]}for(var g=d.getElementsByTagName(`p`)[0].textContent.split(` `),_=3*Math.floor(g.length/3),c=0;c<_;c++)p[c%f.length].push(parseInt(g[c]));t.triangles.push(u)}return t},X.parse.fromCollada._libImages=function(e){e=e.getElementsByTagName(`image`);for(var t={},n=0;n<e.length;n++)t[e[n].getAttribute(`id`)]=e[n].getElementsByTagName(`init_from`)[0].textContent;return t},X.parse.fromCollada._libMaterials=function(e){e=e.getElementsByTagName(`material`);for(var t={},n=0;n<e.length;n++)t[e[n].getAttribute(`name`)]=e[n].getElementsByTagName(`instance_effect`)[0].getAttribute(`url`).substring(1);return t},X.parse.fromCollada._libEffects=function(e){e=e.getElementsByTagName(`effect`);for(var t={},n=0;n<e.length;n++){for(var r={},i=e[n].getElementsByTagName(`newparam`),a=0;a<i.length;a++){var o=i[a].getElementsByTagName(`surface`)[0];o&&(r.surface=o.getElementsByTagName(`init_from`)[0].textContent)}t[e[n].getAttribute(`id`)]=r}return t},X.parse.from3DS=function(e){e=new Uint8Array(e);var t={};if(X.bin.rsl(e,0)!=19789)return null;for(var n=X.bin.ril(e,2),r=6;r<n;){var i=X.bin.rsl(e,r),a=X.bin.ril(e,r+2);i==15677&&(t.edit=X.parse.from3DS._edit3ds(e,r,a)),i==45056&&(t.keyf=X.parse.from3DS._keyf3ds(e,r,a)),r+=a}return t},X.parse.from3DS._edit3ds=function(e,t,n){for(var r={},i=t+6;i<t+n;){var a=X.bin.rsl(e,i),o=X.bin.ril(e,i+2);a==16384&&(r.objects??=[],r.objects.push(X.parse.from3DS._edit_object(e,i,o))),i+=o}return r},X.parse.from3DS._keyf3ds=function(e,t,n){for(var r={},i=t+6;i<t+n;){var a=X.bin.rsl(e,i),o=X.bin.ril(e,i+2);a==45058&&(r.desc??=[],r.desc.push(X.parse.from3DS._keyf_objdes(e,i,o))),i+=o}return r},X.parse.from3DS._keyf_objdes=function(e,t,n){for(var r={},i=t+6;i<t+n;){var a=X.bin.rsl(e,i),o=X.bin.ril(e,i+2);a==45072&&(r.hierarchy=X.parse.from3DS._keyf_objhierarch(e,i,o)),a==45073&&(r.dummy_name=X.bin.rASCII0(e,i+6)),i+=o}return r},X.parse.from3DS._keyf_objhierarch=function(e,t,n){var r={},i=t+6;return r.name=X.bin.rASCII0(e,i),i+=r.name.length+1,r.hierarchy=X.bin.rsl(e,i+4),r},X.parse.from3DS._edit_object=function(e,t,n){var r={},i=t+6;for(r.name=X.bin.rASCII0(e,i),i+=r.name.length+1;i<t+n;){var a=X.bin.rsl(e,i),o=X.bin.ril(e,i+2);a==16640&&(r.mesh=X.parse.from3DS._obj_trimesh(e,i,o)),i+=o}return r},X.parse.from3DS._obj_trimesh=function(e,t,n){for(var r={},i=t+6;i<t+n;){var a=X.bin.rsl(e,i),o=X.bin.ril(e,i+2);a==16656&&(r.vertices=X.parse.from3DS._tri_vertexl(e,i,o)),a==16672&&(r.indices=X.parse.from3DS._tri_facel1(e,i,o)),a==16704&&(r.uvt=X.parse.from3DS._tri_mappingcoors(e,i,o)),a==16736&&(r.local=X.parse.from3DS._tri_local(e,i,o)),i+=o}return r},X.parse.from3DS._tri_vertexl=function(e,t,n){var r=[],i=t+6,a=X.bin.rsl(e,i);i+=2;for(var o=0;o<a;o++)r.push(X.bin.rf(e,i)),r.push(X.bin.rf(e,i+4)),r.push(X.bin.rf(e,i+8)),i+=12;return r},X.parse.from3DS._tri_facel1=function(e,t,n){var r=[],i=t+6,a=X.bin.rsl(e,i);i+=2;for(var o=0;o<a;o++)r.push(X.bin.rsl(e,i)),r.push(X.bin.rsl(e,i+2)),r.push(X.bin.rsl(e,i+4)),i+=8;return r},X.parse.from3DS._tri_mappingcoors=function(e,t,n){var r=[],i=t+6,a=X.bin.rsl(e,i);i+=2;for(var o=0;o<a;o++)r.push(X.bin.rf(e,i)),r.push(1-X.bin.rf(e,i+4)),i+=8;return r},X.parse.from3DS._tri_local=function(e,t,n){var r={},i=t+6;return r.X=[X.bin.rf(e,i),X.bin.rf(e,i+4),X.bin.rf(e,i+8)],i+=12,r.Y=[X.bin.rf(e,i),X.bin.rf(e,i+4),X.bin.rf(e,i+8)],i+=12,r.Z=[X.bin.rf(e,i),X.bin.rf(e,i+4),X.bin.rf(e,i+8)],i+=12,r.C=[X.bin.rf(e,i),X.bin.rf(e,i+4),X.bin.rf(e,i+8)],i+=12,r},X.parse.fromBIV=function(e){e=new Uint8Array(e);var t={},n={};return n.id=X.bin.ril(e,0),n.verS=X.bin.ril(e,4),n.texS=X.bin.ril(e,8),n.indS=X.bin.ril(e,12),n.verO=X.bin.ril(e,16),n.verL=X.bin.ril(e,20),n.texO=X.bin.ril(e,24),n.texL=X.bin.ril(e,28),n.indO=X.bin.ril(e,32),n.indL=X.bin.ril(e,36),n.verO!=0&&(t.vertices=X.parse.fromBIV._readFloats(e,n.verO,n.verL)),n.texO!=0&&(t.uvt=X.parse.fromBIV._readFloats(e,n.texO,n.texL)),n.indO!=0&&(t.indices=X.parse.fromBIV._readInts(e,n.indO,n.indL,n.indS)),t},X.parse.toBIV=function(e){for(var t=0,n=0;n<e.indices.length;n++)t=Math.max(t,e.indices[n]);var r=32;t<=65535&&(r=16);var i=40;e.vertices&&(i+=e.vertices.length*4),e.uvt&&(i+=e.uvt.length*4),e.indices&&(i+=e.indices.length*r/8);var a=new Uint8Array(i);X.bin.wil(a,0,1769365870),X.bin.wil(a,4,32),X.bin.wil(a,8,32),X.bin.wil(a,12,r);var o=40;return e.vertices&&(X.bin.wil(a,16,o),X.bin.wil(a,20,4*e.vertices.length),X.parse.fromBIV._writeFloats(a,o,e.vertices),o+=4*e.vertices.length),e.uvt&&(X.bin.wil(a,24,o),X.bin.wil(a,28,4*e.uvt.length),X.parse.fromBIV._writeFloats(a,o,e.uvt),o+=4*e.uvt.length),e.indices&&(X.bin.wil(a,32,o),X.bin.wil(a,36,4*e.indices.length),X.parse.fromBIV._writeInts(a,o,e.indices,r)),a.buffer},X.parse.fromBIV._readFloats=function(e,t,n){for(var r=[],i=0;i<n/4;i++)r.push(X.bin.rf(e,t+4*i));return r},X.parse.fromBIV._writeFloats=function(e,t,n){for(var r=0;r<n.length;r++)X.bin.wf(e,t+4*r,n[r])},X.parse.fromBIV._readInts=function(e,t,n,r){for(var i=[],a=0;a<n/4;a++)r==16&&i.push(X.bin.rsl(e,t+2*a)),r==32&&i.push(X.bin.ril(e,t+4*a));return i},X.parse.fromBIV._writeInts=function(e,t,n,r){for(var i=0;i<n.length;i++)r==16&&X.bin.wsl(e,t+2*i,n[i]),r==32&&X.bin.wil(e,t+4*i,n[i])},X.gen={},X.gen.Plane=function(e,t,n,r){n||=1,r||=1;for(var i={verts:[],inds:[],uvt:[]},a=e+1,o=t+1,s=0;s<o;s++)for(var c=0;c<a;c++){var l=-1+2/e*c,u=-1+2/t*s;i.verts.push(l,u,0),i.uvt.push(n*c/e,r*s/t),s<t&&c<e&&i.inds.push(s*a+c,s*a+c+1,(s+1)*a+c,s*a+c+1,(s+1)*a+c,(s+1)*a+c+1)}return i},X.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]}},X.gen.Sphere=function(e,t){var n={verts:[],inds:[],uvt:[]};2*Math.PI/e,Math.PI/t;for(var r=e+1,i=t+1,a=0;a<i;a++)for(var o=0;o<r;o++){var s=-Math.PI/2+a*Math.PI/t,c=o*2*Math.PI/e,l=Math.cos(s)*Math.cos(c),u=Math.sin(s),d=Math.cos(s)*Math.sin(c);n.verts.push(l,u,d),n.uvt.push(o/e,a/t),a<t&&o<e&&n.inds.push(r*a+o,r*a+o+1,r*(a+1)+o,r*a+o+1,r*(a+1)+o,r*(a+1)+o+1)}return n},X.mat={},X.mat.scale=function(e,t,n){return[e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1]},X.mat.translate=function(e,t,n){return[1,0,0,0,0,1,0,0,0,0,1,0,e,t,n,1]},X.mat.rotateDeg=function(e,t,n){var r=Math.PI/180;return X.mat.rotate(e*r,t*r,n*r)},X.mat.rotate=function(e,t,n){var r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],i=e,a=t,o=n,s=Math.cos(i),c=Math.cos(a),l=Math.cos(o),u=Math.sin(i),d=Math.sin(a),f=Math.sin(o);return r[0]=c*l,r[1]=-c*f,r[2]=d,r[4]=s*f+u*d*l,r[5]=s*l-u*d*f,r[6]=-u*c,r[8]=u*f-s*d*l,r[9]=u*l+s*d*f,r[10]=s*c,r},X.edit={},X.edit.interpolate=function(e,t,n,r){for(var i=0;i<e.length;i++)n[i]=e[i]+r*(t[i]-e[i])},X.edit.transform=function(e,t){for(var n=0;n<e.length;n+=3){var r=e[n],i=e[n+1],a=e[n+2];e[n+0]=t[0]*r+t[4]*i+t[8]*a+t[12],e[n+1]=t[1]*r+t[5]*i+t[9]*a+t[13],e[n+2]=t[2]*r+t[6]*i+t[10]*a+t[14]}},X.edit.unwrap=function(e,t,n){for(var r=Array(Math.floor(e.length/3)*n),i=0;i<e.length;i++)for(var a=0;a<n;a++)r[i*n+a]=t[e[i]*n+a];return r},X.edit.remap=function(e,t,n,r){for(var i=Array(n.length),a=0;a<e.length;a++)for(var o=0;o<r;o++)i[t[a]*r+o]=n[e[a]*r+o];return i},X.utils={},X.utils.getAABB=function(e){for(var t=n=r=999999999,n,r,i=a=o=-t,a,o,s=0;s<e.length;s+=3){var c=e[s+0],l=e[s+1],u=e[s+2];c<t&&(t=c),c>i&&(i=c),l<n&&(n=l),l>a&&(a=l),u<r&&(r=u),l>o&&(o=u)}return{min:{x:t,y:n,z:r},max:{x:i,y:a,z:o}}};function R$e(e,t={}){return new Promise(function(n,r){t.src||(console.error(`load3DSGeometry: Parameter expected: src`),r());var i=e.canvas.spinner;i.processes++,JD.loadArraybuffer(t.src,function(e){e.byteLength||(console.error(`load3DSGeometry: no data loaded`),i.processes--,r());var a=X.parse.from3DS(e).edit.objects[0].mesh,o=a.vertices,s=a.uvt,c=a.indices;i.processes--,n(JD.apply(t,{primitive:`triangles`,positions:o,normals:null,uv:s,indices:c}))},function(e){console.error(`load3DSGeometry: `+e),i.processes--,r()})})}function z$e(e,t={}){return new Promise(function(n,r){t.src||(console.error(`loadOBJGeometry: Parameter expected: src`),r());var i=e.canvas.spinner;i.processes++,JD.loadArraybuffer(t.src,function(e){e.byteLength||(console.error(`loadOBJGeometry: no data loaded`),i.processes--,r());for(var a=X.parse.fromOBJ(e),o=X.edit.unwrap(a.i_verts,a.c_verts,3),s=X.edit.unwrap(a.i_norms,a.c_norms,3),c=X.edit.unwrap(a.i_uvt,a.c_uvt,2),l=new Int32Array(a.i_verts.length),u=0;u<a.i_verts.length;u++)l[u]=u;i.processes--,n(JD.apply(t,{primitive:`triangles`,positions:o,normals:s.length>0?s:null,autoNormals:s.length===0,uv:c,indices:l}))},function(e){console.error(`loadOBJGeometry: `+e),i.processes--,r()})})}function WO(e={}){let t=e.xSize||1;t<0&&(console.error(`negative xSize not allowed - will invert`),t*=-1);let n=e.ySize||1;n<0&&(console.error(`negative ySize not allowed - will invert`),n*=-1);let r=e.zSize||1;r<0&&(console.error(`negative zSize not allowed - will invert`),r*=-1);let i=e.center,a=i?i[0]:0,o=i?i[1]:0,s=i?i[2]:0,c=-t+a,l=-n+o,u=-r+s,d=t+a,f=n+o,p=r+s;return JD.apply(e,{positions:[d,f,p,c,f,p,c,l,p,d,l,p,d,f,p,d,l,p,d,l,u,d,f,u,d,f,p,d,f,u,c,f,u,c,f,p,c,f,p,c,f,u,c,l,u,c,l,p,c,l,u,d,l,u,d,l,p,c,l,p,d,l,u,c,l,u,c,f,u,d,f,u],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 GO(e={}){let t=e.xSize||1;t<0&&(console.error(`negative xSize not allowed - will invert`),t*=-1);let n=e.ySize||1;n<0&&(console.error(`negative ySize not allowed - will invert`),n*=-1);let r=e.zSize||1;r<0&&(console.error(`negative zSize not allowed - will invert`),r*=-1);let i=e.center,a=i?i[0]:0,o=i?i[1]:0,s=i?i[2]:0,c=-t+a,l=-n+o,u=-r+s,d=t+a,f=n+o,p=r+s;return JD.apply(e,{primitive:`lines`,positions:[c,l,u,c,l,p,c,f,u,c,f,p,d,l,u,d,l,p,d,f,u,d,f,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 B$e(e={}){return GO({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 KO(e={}){let t=e.radiusTop||1;t<0&&(console.error(`negative radiusTop not allowed - will invert`),t*=-1);let n=e.radiusBottom||1;n<0&&(console.error(`negative radiusBottom not allowed - will invert`),n*=-1);let r=e.height||1;r<0&&(console.error(`negative height not allowed - will invert`),r*=-1);let i=e.radialSegments||32;i<0&&(console.error(`negative radialSegments not allowed - will invert`),i*=-1),i<3&&(i=3);let a=e.heightSegments||1;a<0&&(console.error(`negative heightSegments not allowed - will invert`),a*=-1),a<1&&(a=1);let o=!!e.openEnded,s=e.center,c=s?s[0]:0,l=s?s[1]:0,u=s?s[2]:0,d=r/2,f=r/a,p=2*Math.PI/i,m=1/i,h=(t-n)/a,g=[],_=[],v=[],y=[],b,x,S,C,w,T,E,D,O,k,A,ee=(90-Math.atan(r/(n-t))*180/Math.PI)/90;for(b=0;b<=a;b++)for(w=t-b*h,T=d-b*f,x=0;x<=i;x++)S=Math.sin(x*p),C=Math.cos(x*p),_.push(w*S),_.push(ee),_.push(w*C),v.push(x*m),v.push(b*1/a),g.push(w*S+c),g.push(T+l),g.push(w*C+u);for(b=0;b<a;b++)for(x=0;x<=i;x++)E=b*(i+1)+x,D=E+i,y.push(E),y.push(D),y.push(D+1),y.push(E),y.push(D+1),y.push(E+1);if(!o&&t>0){for(O=g.length/3,_.push(0),_.push(1),_.push(0),v.push(.5),v.push(.5),g.push(0+c),g.push(d+l),g.push(0+u),x=0;x<=i;x++)S=Math.sin(x*p),C=Math.cos(x*p),k=.5*Math.sin(x*p)+.5,A=.5*Math.cos(x*p)+.5,_.push(t*S),_.push(1),_.push(t*C),v.push(k),v.push(A),g.push(t*S+c),g.push(d+l),g.push(t*C+u);for(x=0;x<i;x++)s=O,E=O+1+x,y.push(E),y.push(E+1),y.push(s)}if(!o&&n>0){for(O=g.length/3,_.push(0),_.push(-1),_.push(0),v.push(.5),v.push(.5),g.push(0+c),g.push(0-d+l),g.push(0+u),x=0;x<=i;x++)S=Math.sin(x*p),C=Math.cos(x*p),k=.5*Math.sin(x*p)+.5,A=.5*Math.cos(x*p)+.5,_.push(n*S),_.push(-1),_.push(n*C),v.push(k),v.push(A),g.push(n*S+c),g.push(0-d+l),g.push(n*C+u);for(x=0;x<i;x++)s=O,E=O+1+x,y.push(s),y.push(E+1),y.push(E)}return JD.apply(e,{positions:g,normals:_,uv:v,indices:y})}function qO(e={}){let t=e.size||1;t<0&&(console.error(`negative size not allowed - will invert`),t*=-1);let n=e.divisions||1;n<0&&(console.error(`negative divisions not allowed - will invert`),n*=-1),n<1&&(n=1),t||=10,n||=10;let r=t/n,i=t/2,a=[],o=[],s=0;for(let e=0,t=-i;e<=n;e++,t+=r)a.push(-i),a.push(0),a.push(t),a.push(i),a.push(0),a.push(t),a.push(t),a.push(0),a.push(-i),a.push(t),a.push(0),a.push(i),o.push(s++),o.push(s++),o.push(s++),o.push(s++);return JD.apply(e,{primitive:`lines`,positions:a,indices:o})}function JO(e={}){let t=e.xSize||1;t<0&&(console.error(`negative xSize not allowed - will invert`),t*=-1);let n=e.zSize||1;n<0&&(console.error(`negative zSize not allowed - will invert`),n*=-1);let r=e.xSegments||1;r<0&&(console.error(`negative xSegments not allowed - will invert`),r*=-1),r<1&&(r=1);let i=e.xSegments||1;i<0&&(console.error(`negative zSegments not allowed - will invert`),i*=-1),i<1&&(i=1);let a=e.center,o=a?a[0]:0,s=a?a[1]:0,c=a?a[2]:0,l=t/2,u=n/2,d=Math.floor(r)||1,f=Math.floor(i)||1,p=d+1,m=f+1,h=t/d,g=n/f,_=new Float32Array(p*m*3),v=new Float32Array(p*m*3),y=new Float32Array(p*m*2),b=0,x=0,S,C,w,T,E,D,O;for(S=0;S<m;S++){let e=S*g-u;for(C=0;C<p;C++)w=C*h-l,_[b]=w+o,_[b+1]=s,_[b+2]=-e+c,v[b+1]=1,y[x]=C/d,y[x+1]=(f-S)/f,b+=3,x+=2}b=0;let k=new(_.length/3>65535?Uint32Array:Uint16Array)(d*f*6);for(S=0;S<f;S++)for(C=0;C<d;C++)T=C+p*S,E=C+p*(S+1),D=C+1+p*(S+1),O=C+1+p*S,k[b]=O,k[b+1]=E,k[b+2]=T,k[b+3]=O,k[b+4]=D,k[b+5]=E,b+=6;return JD.apply(e,{positions:_,normals:v,uv:y,indices:k})}function YO(e={}){let t=e.lod||1,n=e.center?e.center[0]:0,r=e.center?e.center[1]:0,i=e.center?e.center[2]:0,a=e.radius||1;a<0&&(console.error(`negative radius not allowed - will invert`),a*=-1);let o=e.heightSegments||18;o<0&&(console.error(`negative heightSegments not allowed - will invert`),o*=-1),o=Math.floor(t*o),o<18&&(o=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 c=[],l=[],u=[],d=[],f,p,m,h,g,_,v,y,b,x,S,C,w,T,E;for(f=0;f<=o;f++)for(m=f*Math.PI/o,h=Math.sin(m),g=Math.cos(m),p=0;p<=s;p++)_=p*2*Math.PI/s,v=Math.sin(_),y=Math.cos(_),b=y*h,x=g,S=v*h,C=1-p/s,w=f/o,l.push(b),l.push(x),l.push(S),u.push(C),u.push(w),c.push(n+a*b),c.push(r+a*x),c.push(i+a*S);for(f=0;f<o;f++)for(p=0;p<s;p++)T=f*(s+1)+p,E=T+s+1,d.push(T+1),d.push(E+1),d.push(E),d.push(T+1),d.push(E),d.push(T);return JD.apply(e,{positions:c,normals:l,uv:u,indices:d})}function XO(e={}){let t=e.radius||1;t<0&&(console.error(`negative radius not allowed - will invert`),t*=-1),t*=.5;let n=e.tube||.3;n<0&&(console.error(`negative tube not allowed - will invert`),n*=-1);let r=e.radialSegments||32;r<0&&(console.error(`negative radialSegments not allowed - will invert`),r*=-1),r<4&&(r=4);let i=e.tubeSegments||24;i<0&&(console.error(`negative tubeSegments not allowed - will invert`),i*=-1),i<4&&(i=4);let a=e.arc||Math.PI*2;a<0&&(console.warn(`negative arc not allowed - will invert`),a*=-1),a>360&&(a=360);let o=e.center,s=o?o[0]:0,c=o?o[1]:0,l=o?o[2]:0,u=[],d=[],f=[],p=[],m,h,g,_,v,y,b,x;for(x=0;x<=i;x++)for(b=0;b<=r;b++)m=b/r*a,h=.785398+x/i*Math.PI*2,s=t*Math.cos(m),c=t*Math.sin(m),g=(t+n*Math.cos(h))*Math.cos(m),_=(t+n*Math.cos(h))*Math.sin(m),v=n*Math.sin(h),u.push(g+s),u.push(_+c),u.push(v+l),f.push(1-b/r),f.push(x/i),y=Y.normalizeVec3(Y.subVec3([g,_,v],[s,c,l],[]),[]),d.push(y[0]),d.push(y[1]),d.push(y[2]);let S,C,w,T;for(x=1;x<=i;x++)for(b=1;b<=r;b++)S=(r+1)*x+b-1,C=(r+1)*(x-1)+b-1,w=(r+1)*(x-1)+b,T=(r+1)*x+b,p.push(S),p.push(C),p.push(w),p.push(w),p.push(T),p.push(S);return JD.apply(e,{positions:u,normals:d,uv:f,indices:p})}var V$e={" ":{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 ZO(e={}){var t=e.origin||[0,0,0],n=t[0],r=t[1],i=t[2],a=e.size||1,o=[],s=[],c=e.text;JD.isNumeric(c)&&(c=``+c);for(var l=(c||``).split(`
942
942
  `),u=0,d=0,f,p,m,h,g=1/25,_,v,y,b,x,S=0;S<l.length;S++){f=0,p=l[S],m=p.length;for(var C=0;C<m;C++)if(h=V$e[p.charAt(C)],h){_=1,v=-1,y=-1,b=h.points.length;for(var w=0;w<b;w++){if(x=h.points[w],x[0]===-1&&x[1]===-1){_=1;continue}o.push(f+x[0]*a*g+n),o.push(d+x[1]*a*g+r),o.push(0+i),v===-1?v=u:(y===-1||(v=y),y=u),u++,_?_=!1:(s.push(v),s.push(y))}f+=h.width*g*a}d-=35*g*a}return JD.apply(e,{primitive:`lines`,positions:o,indices:s})}function QO(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 n=[];for(let e=0;e<t-1;e++)n.push(e),n.push(e+1);return JD.apply(e,{primitive:`lines`,positions:e.points,indices:n})}function H$e(e={}){let t=e.curve.getPoints(e.divisions).map(e=>[...e]).flat();return QO({id:e.id,points:t})}function $O(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=[],n=[],r=e.startPoint[0],i=e.startPoint[1],a=e.startPoint[2],o=e.endPoint[0],s=e.endPoint[1],c=e.endPoint[2],l=Math.sqrt((o-r)**2+(s-i)**2+(c-a)**2),u=[(o-r)/l,(s-i)/l,(c-a)/l];if(!e.pattern)t.push(0),t.push(1),n.push(r,i,a,o,s,c);else{let d=e.pattern.length,f=!1,p=0,m=0,h=0,g=[r,i,a],_=e.pattern[m];for(n.push(g[0],g[1],g[2]);_<=l-p;){let r=[u[0]*_,u[1]*_,u[2]*_],i=[g[0]+r[0],g[1]+r[1],g[2]+r[2]];n.push(i[0],i[1],i[2]),f||(t.push(h),t.push(h+1)),f=!f,h+=1,g=i,m+=1,m>=d&&(m=0),p+=_,_=e.pattern[m]}e.extendToEnd&&(n.push(o,s,c),t.push(t.length-2),t.push(t.length-1))}return JD.apply(e,{primitive:`lines`,positions:n,indices:t})}var ek=Y.vec4(4),tk=Y.vec4(),nk=Y.vec4(),rk=Y.vec3([1,0,0]),ik=Y.vec3([0,1,0]),ak=Y.vec3([0,0,1]),ok=Y.vec3(3),sk=Y.vec3(3),U$e=Y.identityMat4(),ck=class extends lO{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=Y.vec3(),this._quaternion=Y.identityQuaternion(),this._rotation=Y.vec3(),this._position=Y.vec3(),this._offset=Y.vec3(),this._localMatrix=Y.identityMat4(),this._worldMatrix=Y.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 e=t.children;for(let n=0,r=e.length;n<r;n++)this.addChild(e[n],t.inheritStates)}if(t.parentId){let e=this.scene.components[t.parentId];e?e.isNode?e.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||=Y.vec3(),this._origin.set(e)):this._origin&&=null;for(let t=0,n=this._children.length;t<n;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,n=this._children.length;t<n;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,n=this._children.length;t<n;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,n=this._children.length;t<n;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,n=this._children.length;t<n;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,n=this._children.length;t<n;t++)this._children[t].edges=e}get edges(){return this._edges}set culled(e){e=!!e,this._culled=e;for(let t=0,n=this._children.length;t<n;t++)this._children[t].culled=e}get culled(){return this._culled}set clippable(e){e=e!==!1,this._clippable=e;for(let t=0,n=this._children.length;t<n;t++)this._children[t].clippable=e}get clippable(){return this._clippable}set collidable(e){e=e!==!1,this._collidable=e;for(let t=0,n=this._children.length;t<n;t++)this._children[t].collidable=e}get collidable(){return this._collidable}set pickable(e){e=e!==!1,this._pickable=e;for(let t=0,n=this._children.length;t<n;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 e=0,n=this._children.length;e<n;e++)this._children[e].colorize=t;if(this._isObject){let t=!!e;this.scene._objectColorizeUpdated(this,t)}}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 t=0,n=this._children.length;t<n;t++)this._children[t].opacity=e;if(this._isObject){let t=e!=null;this.scene._objectOpacityUpdated(this,t)}}get opacity(){return this._colorize[3]}set castsShadow(e){e=!!e,this._castsShadow=e;for(let t=0,n=this._children.length;t<n;t++)this._children[t].castsShadow=e}get castsShadow(){return this._castsShadow}set receivesShadow(e){e=!!e,this._receivesShadow=e;for(let t=0,n=this._children.length;t<n;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 e=0,t=this._children.length;e<t;e++)this._children[e].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)Y.mulMat4(this._parentNode.worldMatrix,e,this._worldMatrix);else for(let t=0,n=e.length;t<n;t++)this._worldMatrix[t]=e[t];this._worldMatrixDirty=!1}_setSubtreeAABBsDirty(e){if(e._aabbDirty=!0,e._children)for(let t=0,n=e._children.length;t<n;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||=Y.AABB3(),this._buildAABB)this._buildAABB(this.worldMatrix,this._aabb);else{Y.collapseAABB3(this._aabb);let e;for(let t=0,n=this._children.length;t<n;t++)e=this._children[t],e.collidable&&Y.expandAABB3(this._aabb,e.aabb)}this._aabbDirty=!1}addChild(e,t){if(JD.isNumeric(e)||JD.isString(e)){let t=e;if(e=this.scene.component[t],!e){this.warn(`Component not found: `+JD.inQuotes(t));return}if(!e.isNode&&!e.isMesh){this.error(`Not a Node or Mesh: `+t);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,n=this._children.length;t<n;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,n=this._children.length;t<n;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(JD.isNumeric(e)||JD.isString(e)){let t=e;if(e=this.scene.components[t],!e){this.warn(`Node not found: `+JD.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]),Y.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]),Y.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||=Y.identityMat4(),this._localMatrix.set(e||U$e),Y.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||=Y.identityMat4(),Y.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 ek[0]=e[0],ek[1]=e[1],ek[2]=e[2],ek[3]=t*Y.DEGTORAD,Y.angleAxisToQuaternion(ek,tk),Y.mulQuaternions(this.quaternion,tk,nk),this.quaternion=nk,this._setLocalMatrixDirty(),this._setAABBDirty(),this.glRedraw(),this}rotateOnWorldAxis(e,t){return ek[0]=e[0],ek[1]=e[1],ek[2]=e[2],ek[3]=t*Y.DEGTORAD,Y.angleAxisToQuaternion(ek,tk),Y.mulQuaternions(tk,this.quaternion,tk),this}rotateX(e){return this.rotate(rk,e)}rotateY(e){return this.rotate(ik,e)}rotateZ(e){return this.rotate(ak,e)}translate(e,t){return Y.vec3ApplyQuaternion(this.quaternion,e,ok),Y.mulVec3Scalar(ok,t,sk),Y.addVec3(this.position,sk,this.position),this._setLocalMatrixDirty(),this._setAABBDirty(),this.glRedraw(),this}translateX(e){return this.translate(rk,e)}translateY(e){return this.translate(ik,e)}translateZ(e){return this.translate(ak,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 n=0,r=e.length;n<r;n++)t=e[n],t.destroy()}this._children=[],this._setAABBDirty(),this.scene._aabbDirty=!0}},lk=Y.vec3(),uk=Y.vec4(),dk=function(){let e=new Float64Array(16),t=new Float64Array(4),n=new Float64Array(4);return function(r,i,a){return a||=e,t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=1,Y.transformVec4(r,t,n),Y.setMat4Translation(r,n,a),a.slice()}}();function fk(e,t,n){let r=Float32Array.from([e[0]])[0],i=e[0]-r,a=Float32Array.from([e[1]])[0],o=e[1]-a,s=Float32Array.from([e[2]])[0],c=e[2]-s;t[0]=r,t[1]=a,t[2]=s,n[0]=i,n[1]=o,n[2]=c}function pk(e,t,n,r=1e3){let i=Y.getPositionsCenter(e,lk),a=Math.round(i[0]/r)*r,o=Math.round(i[1]/r)*r,s=Math.round(i[2]/r)*r;n[0]=a,n[1]=o,n[2]=s;let c=n[0]!==0||n[1]!==0||n[2]!==0;if(c)for(let n=0,r=e.length;n<r;n+=3)t[n+0]=e[n+0]-a,t[n+1]=e[n+1]-o,t[n+2]=e[n+2]-s;return c}function W$e(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n}function mk(e,t,n,r,i){let a=i?(uk.set(n,0),uk[3]=1,Y.mulMat4v4(i,uk,uk)):n,o=Y.dotVec3(t,a)+e,s=Y.normalizeVec3(t,lk);return Y.mulVec3Scalar(s,-o,r),r}var hk=1e3,gk=1001,_k=1002,vk=1003,yk=1004,G$e=1004,K$e=1005,bk=1005,xk=1006,q$e=1007,Sk=1007,Ck=1008,wk=1008,J$e=1009,Y$e=1010,X$e=1011,Z$e=1012,Q$e=1013,$$e=1014,e1e=1015,t1e=1016,n1e=1017,r1e=1018,i1e=1020,a1e=1021,o1e=1022,Tk=1023,s1e=1024,c1e=1025,l1e=1026,u1e=1027,d1e=1028,f1e=1029,p1e=1030,m1e=1031,h1e=1033,Ek=33776,g1e=33777,_1e=33778,Dk=33779,Ok=35840,v1e=35841,kk=35842,y1e=35843,Ak=36196,jk=37492,Mk=37496,Nk=37808,b1e=37809,x1e=37810,S1e=37811,C1e=37812,w1e=37813,T1e=37814,E1e=37815,D1e=37816,O1e=37817,k1e=37818,A1e=37819,j1e=37820,M1e=37821,Pk=36492,Fk=3e3,Ik=3001,N1e=1e4,P1e=10001,F1e=10002,I1e=10003,L1e=function(e){e._material._state.type===`LambertMaterial`?(this.vertex=z1e(e),this.fragment=B1e(e)):(this.vertex=V1e(e),this.fragment=H1e(e))},Lk={};Lk[Fk]=`linearToLinear`,Lk[Ik]=`sRGBToLinear`;function Rk(e){if(!e.receivesShadow)return!1;let t=e.scene._lightsState.lights;if(!t||t.length===0)return!1;for(let e=0,n=t.length;e<n;e++)if(t[e].castsShadow)return!0;return!1}function R1e(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 zk(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 z1e(e){let t=e.scene,n=e.scene._sectionPlanesState,r=e.scene._lightsState,i=e._geometry._state,a=e._state.billboard,o=e._state.stationary,s=n.getNumAllocatedSectionPlanes()>0,c=!!i.compressGeometry,l=[];if(l.push(`#version 300 es`),l.push(`// Lambertian drawing vertex shader`),l.push(`in vec3 position;`),l.push(`uniform mat4 modelMatrix;`),l.push(`uniform mat4 viewMatrix;`),l.push(`uniform mat4 projMatrix;`),l.push(`uniform vec4 colorize;`),l.push(`uniform vec3 offset;`),l.push(`uniform vec3 scale;`),c&&l.push(`uniform mat4 positionsDecodeMatrix;`),t.logarithmicDepthBufferEnabled&&(l.push(`uniform float logDepthBufFC;`),l.push(`out float vFragDepth;`),l.push(`bool isPerspectiveMatrix(mat4 m) {`),l.push(` return (m[2][3] == - 1.0);`),l.push(`}`),l.push(`out float isPerspective;`)),s&&l.push(`out vec4 vWorldPosition;`),l.push(`uniform vec4 lightAmbient;`),l.push(`uniform vec4 materialColor;`),l.push(`uniform vec3 materialEmissive;`),i.normalsBuf){l.push(`in vec3 normal;`),l.push(`uniform mat4 modelNormalMatrix;`),l.push(`uniform mat4 viewNormalMatrix;`);for(let e=0,t=r.lights.length;e<t;e++){let t=r.lights[e];t.type!==`ambient`&&(l.push(`uniform vec4 lightColor`+e+`;`),t.type===`dir`&&l.push(`uniform vec3 lightDir`+e+`;`),t.type===`point`&&l.push(`uniform vec3 lightPos`+e+`;`),t.type===`spot`&&(l.push(`uniform vec3 lightPos`+e+`;`),l.push(`uniform vec3 lightDir`+e+`;`)))}c&&(l.push(`vec3 octDecode(vec2 oct) {`),l.push(` vec3 v = vec3(oct.xy, 1.0 - abs(oct.x) - abs(oct.y));`),l.push(` if (v.z < 0.0) {`),l.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);`),l.push(` }`),l.push(` return normalize(v);`),l.push(`}`))}if(l.push(`out vec4 vColor;`),i.primitiveName===`points`&&l.push(`uniform float pointSize;`),(a===`spherical`||a===`cylindrical`)&&(l.push(`void billboard(inout mat4 mat) {`),l.push(` mat[0][0] = scale[0];`),l.push(` mat[0][1] = 0.0;`),l.push(` mat[0][2] = 0.0;`),a===`spherical`&&(l.push(` mat[1][0] = 0.0;`),l.push(` mat[1][1] = scale[1];`),l.push(` mat[1][2] = 0.0;`)),l.push(` mat[2][0] = 0.0;`),l.push(` mat[2][1] = 0.0;`),l.push(` mat[2][2] =1.0;`),l.push(`}`)),l.push(`void main(void) {`),l.push(`vec4 localPosition = vec4(position, 1.0); `),l.push(`vec4 worldPosition;`),c&&l.push(`localPosition = positionsDecodeMatrix * localPosition;`),i.normalsBuf&&(c?l.push(`vec4 localNormal = vec4(octDecode(normal.xy), 0.0); `):l.push(`vec4 localNormal = vec4(normal, 0.0); `),l.push(`mat4 modelNormalMatrix2 = modelNormalMatrix;`),l.push(`mat4 viewNormalMatrix2 = viewNormalMatrix;`)),l.push(`mat4 viewMatrix2 = viewMatrix;`),l.push(`mat4 modelMatrix2 = modelMatrix;`),o&&l.push(`viewMatrix2[3][0] = viewMatrix2[3][1] = viewMatrix2[3][2] = 0.0;`),a===`spherical`||a===`cylindrical`?(l.push(`mat4 modelViewMatrix = viewMatrix2 * modelMatrix2;`),l.push(`billboard(modelMatrix2);`),l.push(`billboard(viewMatrix2);`),l.push(`billboard(modelViewMatrix);`),i.normalsBuf&&(l.push(`mat4 modelViewNormalMatrix = viewNormalMatrix2 * modelNormalMatrix2;`),l.push(`billboard(modelNormalMatrix2);`),l.push(`billboard(viewNormalMatrix2);`),l.push(`billboard(modelViewNormalMatrix);`)),l.push(`worldPosition = modelMatrix2 * localPosition;`),l.push(`worldPosition.xyz = worldPosition.xyz + offset;`),l.push(`vec4 viewPosition = modelViewMatrix * localPosition;`)):(l.push(`worldPosition = modelMatrix2 * localPosition;`),l.push(`worldPosition.xyz = worldPosition.xyz + offset;`),l.push(`vec4 viewPosition = viewMatrix2 * worldPosition; `)),i.normalsBuf&&l.push(`vec3 viewNormal = normalize((viewNormalMatrix2 * modelNormalMatrix2 * localNormal).xyz);`),l.push(`vec3 reflectedColor = vec3(0.0, 0.0, 0.0);`),l.push(`vec3 viewLightDir = vec3(0.0, 0.0, -1.0);`),l.push(`float lambertian = 1.0;`),i.normalsBuf)for(let e=0,t=r.lights.length;e<t;e++){let t=r.lights[e];if(t.type!==`ambient`){if(t.type===`dir`)t.space===`view`?l.push(`viewLightDir = normalize(lightDir`+e+`);`):l.push(`viewLightDir = normalize((viewMatrix2 * vec4(lightDir`+e+`, 0.0)).xyz);`);else if(t.type===`point`)t.space===`view`?l.push(`viewLightDir = -normalize(lightPos`+e+` - viewPosition.xyz);`):l.push(`viewLightDir = -normalize((viewMatrix2 * vec4(lightPos`+e+`, 0.0)).xyz);`);else if(t.type===`spot`)t.space===`view`?l.push(`viewLightDir = normalize(lightDir`+e+`);`):l.push(`viewLightDir = normalize((viewMatrix2 * vec4(lightDir`+e+`, 0.0)).xyz);`);else continue;l.push(`lambertian = max(dot(-viewNormal, viewLightDir), 0.0);`),l.push(`reflectedColor += lambertian * (lightColor`+e+`.rgb * lightColor`+e+`.a);`)}}return l.push(`vColor = vec4((lightAmbient.rgb * lightAmbient.a * materialColor.rgb) + materialEmissive.rgb + (reflectedColor * materialColor.rgb), materialColor.a) * colorize;`),s&&l.push(`vWorldPosition = worldPosition;`),i.primitiveName===`points`&&l.push(`gl_PointSize = pointSize;`),l.push(`vec4 clipPos = projMatrix * viewPosition;`),t.logarithmicDepthBufferEnabled&&(l.push(`vFragDepth = 1.0 + clipPos.w;`),l.push(`isPerspective = float (isPerspectiveMatrix(projMatrix));`)),l.push(`gl_Position = clipPos;`),l.push(`}`),l}function B1e(e){let t=e.scene,n=t._sectionPlanesState;e._material._state;let r=e._geometry._state,i=n.getNumAllocatedSectionPlanes()>0,a=t.gammaOutput,o=[];if(o.push(`#version 300 es`),o.push(`// Lambertian drawing fragment shader`),o.push(`#ifdef GL_FRAGMENT_PRECISION_HIGH`),o.push(`precision highp float;`),o.push(`precision highp int;`),o.push(`#else`),o.push(`precision mediump float;`),o.push(`precision mediump int;`),o.push(`#endif`),t.logarithmicDepthBufferEnabled&&(o.push(`in float isPerspective;`),o.push(`uniform float logDepthBufFC;`),o.push(`in float vFragDepth;`)),i){o.push(`in vec4 vWorldPosition;`),o.push(`uniform bool clippable;`);for(let e=0,t=n.getNumAllocatedSectionPlanes();e<t;e++)o.push(`uniform bool sectionPlaneActive`+e+`;`),o.push(`uniform vec3 sectionPlanePos`+e+`;`),o.push(`uniform vec3 sectionPlaneDir`+e+`;`)}if(o.push(`in vec4 vColor;`),a&&(o.push(`uniform float gammaFactor;`),o.push(` vec4 linearToGamma( in vec4 value, in float gammaFactor ) {`),o.push(` return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );`),o.push(`}`)),o.push(`out vec4 outColor;`),o.push(`void main(void) {`),i){o.push(`if (clippable) {`),o.push(` float dist = 0.0;`);for(let e=0,t=n.getNumAllocatedSectionPlanes();e<t;e++)o.push(`if (sectionPlaneActive`+e+`) {`),o.push(` dist += clamp(dot(-sectionPlaneDir`+e+`.xyz, vWorldPosition.xyz - sectionPlanePos`+e+`.xyz), 0.0, 1000.0);`),o.push(`}`);o.push(` if (dist > 0.0) { discard; }`),o.push(`}`)}return r.primitiveName===`points`&&(o.push(`vec2 cxy = 2.0 * gl_PointCoord - 1.0;`),o.push(`float r = dot(cxy, cxy);`),o.push(`if (r > 1.0) {`),o.push(` discard;`),o.push(`}`)),t.logarithmicDepthBufferEnabled&&o.push(`gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;`),a?o.push(`outColor = linearToGamma(vColor, gammaFactor);`):o.push(`outColor = vColor;`),o.push(`}`),o}function V1e(e){let t=e.scene;e._material;let n=e._state,r=t._sectionPlanesState,i=e._geometry._state,a=t._lightsState,o,s=n.billboard,c=n.background,l=n.stationary,u=R1e(e),d=zk(e),f=r.getNumAllocatedSectionPlanes()>0,p=Rk(e),m=!!i.compressGeometry,h=[];if(h.push(`#version 300 es`),h.push(`// Drawing vertex shader`),h.push(`in vec3 position;`),m&&h.push(`uniform mat4 positionsDecodeMatrix;`),h.push(`uniform mat4 modelMatrix;`),h.push(`uniform mat4 viewMatrix;`),h.push(`uniform mat4 projMatrix;`),h.push(`out vec3 vViewPosition;`),h.push(`uniform vec3 offset;`),h.push(`uniform vec3 scale;`),f&&h.push(`out vec4 vWorldPosition;`),t.logarithmicDepthBufferEnabled&&(h.push(`uniform float logDepthBufFC;`),h.push(`out float vFragDepth;`),h.push(`bool isPerspectiveMatrix(mat4 m) {`),h.push(` return (m[2][3] == - 1.0);`),h.push(`}`),h.push(`out float isPerspective;`)),a.lightMaps.length>0&&h.push(`out vec3 vWorldNormal;`),d){h.push(`in vec3 normal;`),h.push(`uniform mat4 modelNormalMatrix;`),h.push(`uniform mat4 viewNormalMatrix;`),h.push(`out vec3 vViewNormal;`);for(let e=0,t=a.lights.length;e<t;e++)o=a.lights[e],o.type!==`ambient`&&(o.type===`dir`&&h.push(`uniform vec3 lightDir`+e+`;`),o.type===`point`&&h.push(`uniform vec3 lightPos`+e+`;`),o.type===`spot`&&(h.push(`uniform vec3 lightPos`+e+`;`),h.push(`uniform vec3 lightDir`+e+`;`)),o.type===`dir`&&o.space===`view`||h.push(`out vec4 vViewLightReverseDirAndDist`+e+`;`));m&&(h.push(`vec3 octDecode(vec2 oct) {`),h.push(` vec3 v = vec3(oct.xy, 1.0 - abs(oct.x) - abs(oct.y));`),h.push(` if (v.z < 0.0) {`),h.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);`),h.push(` }`),h.push(` return normalize(v);`),h.push(`}`))}if(u&&(h.push(`in vec2 uv;`),h.push(`out vec2 vUV;`),m&&h.push(`uniform mat3 uvDecodeMatrix;`)),i.colors&&(h.push(`in vec4 color;`),h.push(`out vec4 vColor;`)),i.primitiveName===`points`&&h.push(`uniform float pointSize;`),(s===`spherical`||s===`cylindrical`)&&(h.push(`void billboard(inout mat4 mat) {`),h.push(` mat[0][0] = scale[0];`),h.push(` mat[0][1] = 0.0;`),h.push(` mat[0][2] = 0.0;`),s===`spherical`&&(h.push(` mat[1][0] = 0.0;`),h.push(` mat[1][1] = scale[1];`),h.push(` mat[1][2] = 0.0;`)),h.push(` mat[2][0] = 0.0;`),h.push(` mat[2][1] = 0.0;`),h.push(` mat[2][2] =1.0;`),h.push(`}`)),p){h.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 e=0,t=a.lights.length;e<t;e++)a.lights[e].castsShadow&&(h.push(`uniform mat4 shadowViewMatrix`+e+`;`),h.push(`uniform mat4 shadowProjMatrix`+e+`;`),h.push(`out vec4 vShadowPosFromLight`+e+`;`))}if(h.push(`void main(void) {`),h.push(`vec4 localPosition = vec4(position, 1.0); `),h.push(`vec4 worldPosition;`),m&&h.push(`localPosition = positionsDecodeMatrix * localPosition;`),d&&(m?h.push(`vec4 localNormal = vec4(octDecode(normal.xy), 0.0); `):h.push(`vec4 localNormal = vec4(normal, 0.0); `),h.push(`mat4 modelNormalMatrix2 = modelNormalMatrix;`),h.push(`mat4 viewNormalMatrix2 = viewNormalMatrix;`)),h.push(`mat4 viewMatrix2 = viewMatrix;`),h.push(`mat4 modelMatrix2 = modelMatrix;`),l?h.push(`viewMatrix2[3][0] = viewMatrix2[3][1] = viewMatrix2[3][2] = 0.0;`):c&&h.push(`viewMatrix2[3] = vec4(0.0, 0.0, 0.0 ,1.0);`),s===`spherical`||s===`cylindrical`?(h.push(`mat4 modelViewMatrix = viewMatrix2 * modelMatrix2;`),h.push(`billboard(modelMatrix2);`),h.push(`billboard(viewMatrix2);`),h.push(`billboard(modelViewMatrix);`),d&&(h.push(`mat4 modelViewNormalMatrix = viewNormalMatrix2 * modelNormalMatrix2;`),h.push(`billboard(modelNormalMatrix2);`),h.push(`billboard(viewNormalMatrix2);`),h.push(`billboard(modelViewNormalMatrix);`)),h.push(`worldPosition = modelMatrix2 * localPosition;`),h.push(`worldPosition.xyz = worldPosition.xyz + offset;`),h.push(`vec4 viewPosition = modelViewMatrix * localPosition;`)):(h.push(`worldPosition = modelMatrix2 * localPosition;`),h.push(`worldPosition.xyz = worldPosition.xyz + offset;`),h.push(`vec4 viewPosition = viewMatrix2 * worldPosition; `)),d){h.push(`vec3 worldNormal = (modelNormalMatrix2 * localNormal).xyz; `),a.lightMaps.length>0&&h.push(`vWorldNormal = worldNormal;`),h.push(`vViewNormal = normalize((viewNormalMatrix2 * vec4(worldNormal, 1.0)).xyz);`),h.push(`vec3 tmpVec3;`),h.push(`float lightDist;`);for(let e=0,t=a.lights.length;e<t;e++)o=a.lights[e],o.type!==`ambient`&&(o.type===`dir`&&o.space===`world`&&(h.push(`tmpVec3 = vec3(viewMatrix2 * vec4(lightDir`+e+`, 0.0) ).xyz;`),h.push(`vViewLightReverseDirAndDist`+e+` = vec4(-tmpVec3, 0.0);`)),o.type===`point`&&(o.space===`world`?(h.push(`tmpVec3 = (viewMatrix2 * vec4(lightPos`+e+`, 1.0)).xyz - viewPosition.xyz;`),h.push(`lightDist = abs(length(tmpVec3));`)):(h.push(`tmpVec3 = lightPos`+e+`.xyz - viewPosition.xyz;`),h.push(`lightDist = abs(length(tmpVec3));`)),h.push(`vViewLightReverseDirAndDist`+e+` = vec4(tmpVec3, lightDist);`)))}if(u&&(m?h.push(`vUV = (uvDecodeMatrix * vec3(uv, 1.0)).xy;`):h.push(`vUV = uv;`)),i.colors&&h.push(`vColor = color;`),i.primitiveName===`points`&&h.push(`gl_PointSize = pointSize;`),f&&h.push(`vWorldPosition = worldPosition;`),h.push(` vViewPosition = viewPosition.xyz;`),h.push(`vec4 clipPos = projMatrix * viewPosition;`),t.logarithmicDepthBufferEnabled&&(h.push(`vFragDepth = 1.0 + clipPos.w;`),h.push(`isPerspective = float (isPerspectiveMatrix(projMatrix));`)),c&&h.push(`clipPos.z = clipPos.w;`),h.push(`gl_Position = clipPos;`),p){h.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);`),h.push(`vec4 tempx; `);for(let e=0,t=a.lights.length;e<t;e++)a.lights[e].castsShadow&&h.push(`vShadowPosFromLight`+e+` = texUnitConverter * shadowProjMatrix`+e+` * (shadowViewMatrix`+e+` * worldPosition); `)}return h.push(`}`),h}function H1e(e){let t=e.scene;t.canvas.gl;let n=e._material,r=e._geometry._state,i=e.scene._sectionPlanesState,a=e.scene._lightsState,o=e._material._state,s=i.getNumAllocatedSectionPlanes()>0,c=zk(e),l=r.uvBuf,u=o.type===`PhongMaterial`,d=o.type===`MetallicMaterial`,f=o.type===`SpecularMaterial`,p=Rk(e);t.gammaInput;let m=t.gammaOutput,h=[];if(h.push(`#version 300 es`),h.push(`// Drawing fragment shader`),h.push(`#ifdef GL_FRAGMENT_PRECISION_HIGH`),h.push(`precision highp float;`),h.push(`precision highp int;`),h.push(`#else`),h.push(`precision mediump float;`),h.push(`precision mediump int;`),h.push(`#endif`),t.logarithmicDepthBufferEnabled&&(h.push(`in float isPerspective;`),h.push(`uniform float logDepthBufFC;`),h.push(`in float vFragDepth;`)),p&&(h.push(`float unpackDepth (vec4 color) {`),h.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));`),h.push(` return dot(color, bitShift);`),h.push(`}`)),h.push(`uniform float gammaFactor;`),h.push(`vec4 linearToLinear( in vec4 value ) {`),h.push(` return value;`),h.push(`}`),h.push(`vec4 sRGBToLinear( in vec4 value ) {`),h.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 );`),h.push(`}`),h.push(`vec4 gammaToLinear( in vec4 value) {`),h.push(` return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );`),h.push(`}`),m&&(h.push(`vec4 linearToGamma( in vec4 value, in float gammaFactor ) {`),h.push(` return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );`),h.push(`}`)),s){h.push(`in vec4 vWorldPosition;`),h.push(`uniform bool clippable;`);for(var g=0;g<i.getNumAllocatedSectionPlanes();g++)h.push(`uniform bool sectionPlaneActive`+g+`;`),h.push(`uniform vec3 sectionPlanePos`+g+`;`),h.push(`uniform vec3 sectionPlaneDir`+g+`;`)}if(c&&(a.lightMaps.length>0&&(h.push(`uniform samplerCube lightMap;`),h.push(`uniform mat4 viewNormalMatrix;`)),a.reflectionMaps.length>0&&h.push(`uniform samplerCube reflectionMap;`),(a.lightMaps.length>0||a.reflectionMaps.length>0)&&h.push(`uniform mat4 viewMatrix;`),h.push(`#define PI 3.14159265359`),h.push(`#define RECIPROCAL_PI 0.31830988618`),h.push(`#define RECIPROCAL_PI2 0.15915494`),h.push(`#define EPSILON 1e-6`),h.push(`#define saturate(a) clamp( a, 0.0, 1.0 )`),h.push(`vec3 inverseTransformDirection(in vec3 dir, in mat4 matrix) {`),h.push(` return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );`),h.push(`}`),h.push(`struct IncidentLight {`),h.push(` vec3 color;`),h.push(` vec3 direction;`),h.push(`};`),h.push(`struct ReflectedLight {`),h.push(` vec3 diffuse;`),h.push(` vec3 specular;`),h.push(`};`),h.push(`struct Geometry {`),h.push(` vec3 position;`),h.push(` vec3 viewNormal;`),h.push(` vec3 worldNormal;`),h.push(` vec3 viewEyeDir;`),h.push(`};`),h.push(`struct Material {`),h.push(` vec3 diffuseColor;`),h.push(` float specularRoughness;`),h.push(` vec3 specularColor;`),h.push(` float shine;`),h.push(`};`),u&&((a.lightMaps.length>0||a.reflectionMaps.length>0)&&(h.push(`void computePhongLightMapping(const in Geometry geometry, const in Material material, inout ReflectedLight reflectedLight) {`),a.lightMaps.length>0&&(h.push(` vec3 irradiance = `+Lk[a.lightMaps[0].encoding]+`(texture(lightMap, geometry.worldNormal)).rgb;`),h.push(` irradiance *= PI;`),h.push(` vec3 diffuseBRDFContrib = (RECIPROCAL_PI * material.diffuseColor);`),h.push(` reflectedLight.diffuse += irradiance * diffuseBRDFContrib;`)),a.reflectionMaps.length>0&&(h.push(` vec3 reflectVec = reflect(-geometry.viewEyeDir, geometry.viewNormal);`),h.push(` vec3 radiance = texture(reflectionMap, reflectVec).rgb * 0.2;`),h.push(` radiance *= PI;`),h.push(` reflectedLight.specular += radiance;`)),h.push(`}`)),h.push(`void computePhongLighting(const in IncidentLight directLight, const in Geometry geometry, const in Material material, inout ReflectedLight reflectedLight) {`),h.push(` float dotNL = saturate(dot(geometry.viewNormal, directLight.direction));`),h.push(` vec3 irradiance = dotNL * directLight.color * PI;`),h.push(` reflectedLight.diffuse += irradiance * (RECIPROCAL_PI * material.diffuseColor);`),h.push(` reflectedLight.specular += directLight.color * material.specularColor * pow(max(dot(reflect(-directLight.direction, -geometry.viewNormal), geometry.viewEyeDir), 0.0), material.shine);`),h.push(`}`)),(d||f)&&(h.push(`float GGXRoughnessToBlinnExponent(const in float ggxRoughness) {`),h.push(` float r = ggxRoughness + 0.0001;`),h.push(` return (2.0 / (r * r) - 2.0);`),h.push(`}`),h.push(`float getSpecularMIPLevel(const in float blinnShininessExponent, const in int maxMIPLevel) {`),h.push(` float maxMIPLevelScalar = float( maxMIPLevel );`),h.push(` float desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( ( blinnShininessExponent * blinnShininessExponent ) + 1.0 );`),h.push(` return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );`),h.push(`}`),a.reflectionMaps.length>0&&(h.push(`vec3 getLightProbeIndirectRadiance(const in vec3 reflectVec, const in float blinnShininessExponent, const in int maxMIPLevel) {`),h.push(` float mipLevel = 0.5 * getSpecularMIPLevel(blinnShininessExponent, maxMIPLevel);`),h.push(` vec3 envMapColor = `+Lk[a.reflectionMaps[0].encoding]+`(texture(reflectionMap, reflectVec, mipLevel)).rgb;`),h.push(` return envMapColor;`),h.push(`}`)),h.push(`vec3 F_Schlick(const in vec3 specularColor, const in float dotLH) {`),h.push(` float fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );`),h.push(` return ( 1.0 - specularColor ) * fresnel + specularColor;`),h.push(`}`),h.push(`float G_GGX_Smith(const in float alpha, const in float dotNL, const in float dotNV) {`),h.push(` float a2 = ( alpha * alpha );`),h.push(` float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * ( dotNL * dotNL ) );`),h.push(` float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * ( dotNV * dotNV ) );`),h.push(` return 1.0 / ( gl * gv );`),h.push(`}`),h.push(`float G_GGX_SmithCorrelated(const in float alpha, const in float dotNL, const in float dotNV) {`),h.push(` float a2 = ( alpha * alpha );`),h.push(` float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * ( dotNV * dotNV ) );`),h.push(` float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * ( dotNL * dotNL ) );`),h.push(` return 0.5 / max( gv + gl, EPSILON );`),h.push(`}`),h.push(`float D_GGX(const in float alpha, const in float dotNH) {`),h.push(` float a2 = ( alpha * alpha );`),h.push(` float denom = ( dotNH * dotNH) * ( a2 - 1.0 ) + 1.0;`),h.push(` return RECIPROCAL_PI * a2 / ( denom * denom);`),h.push(`}`),h.push(`vec3 BRDF_Specular_GGX(const in IncidentLight incidentLight, const in Geometry geometry, const in vec3 specularColor, const in float roughness) {`),h.push(` float alpha = ( roughness * roughness );`),h.push(` vec3 halfDir = normalize( incidentLight.direction + geometry.viewEyeDir );`),h.push(` float dotNL = saturate( dot( geometry.viewNormal, incidentLight.direction ) );`),h.push(` float dotNV = saturate( dot( geometry.viewNormal, geometry.viewEyeDir ) );`),h.push(` float dotNH = saturate( dot( geometry.viewNormal, halfDir ) );`),h.push(` float dotLH = saturate( dot( incidentLight.direction, halfDir ) );`),h.push(` vec3 F = F_Schlick( specularColor, dotLH );`),h.push(` float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );`),h.push(` float D = D_GGX( alpha, dotNH );`),h.push(` return F * (G * D);`),h.push(`}`),h.push(`vec3 BRDF_Specular_GGX_Environment(const in Geometry geometry, const in vec3 specularColor, const in float roughness) {`),h.push(` float dotNV = saturate(dot(geometry.viewNormal, geometry.viewEyeDir));`),h.push(` const vec4 c0 = vec4( -1, -0.0275, -0.572, 0.022);`),h.push(` const vec4 c1 = vec4( 1, 0.0425, 1.04, -0.04);`),h.push(` vec4 r = roughness * c0 + c1;`),h.push(` float a004 = min(r.x * r.x, exp2(-9.28 * dotNV)) * r.x + r.y;`),h.push(` vec2 AB = vec2(-1.04, 1.04) * a004 + r.zw;`),h.push(` return specularColor * AB.x + AB.y;`),h.push(`}`),(a.lightMaps.length>0||a.reflectionMaps.length>0)&&(h.push(`void computePBRLightMapping(const in Geometry geometry, const in Material material, inout ReflectedLight reflectedLight) {`),a.lightMaps.length>0&&(h.push(` vec3 irradiance = sRGBToLinear(texture(lightMap, geometry.worldNormal)).rgb;`),h.push(` irradiance *= PI;`),h.push(` vec3 diffuseBRDFContrib = (RECIPROCAL_PI * material.diffuseColor);`),h.push(` reflectedLight.diffuse += irradiance * diffuseBRDFContrib;`)),a.reflectionMaps.length>0&&(h.push(` vec3 reflectVec = reflect(-geometry.viewEyeDir, geometry.viewNormal);`),h.push(` reflectVec = inverseTransformDirection(reflectVec, viewMatrix);`),h.push(` float blinnExpFromRoughness = GGXRoughnessToBlinnExponent(material.specularRoughness);`),h.push(` vec3 radiance = getLightProbeIndirectRadiance(reflectVec, blinnExpFromRoughness, 8);`),h.push(` vec3 specularBRDFContrib = BRDF_Specular_GGX_Environment(geometry, material.specularColor, material.specularRoughness);`),h.push(` reflectedLight.specular += radiance * specularBRDFContrib;`)),h.push(`}`)),h.push(`void computePBRLighting(const in IncidentLight incidentLight, const in Geometry geometry, const in Material material, inout ReflectedLight reflectedLight) {`),h.push(` float dotNL = saturate(dot(geometry.viewNormal, incidentLight.direction));`),h.push(` vec3 irradiance = dotNL * incidentLight.color * PI;`),h.push(` reflectedLight.diffuse += irradiance * (RECIPROCAL_PI * material.diffuseColor);`),h.push(` reflectedLight.specular += irradiance * BRDF_Specular_GGX(incidentLight, geometry, material.specularColor, material.specularRoughness);`),h.push(`}`))),h.push(`in vec3 vViewPosition;`),r.colors&&h.push(`in vec4 vColor;`),l&&(c&&n._normalMap||n._ambientMap||n._baseColorMap||n._diffuseMap||n._emissiveMap||n._metallicMap||n._roughnessMap||n._metallicRoughnessMap||n._specularMap||n._glossinessMap||n._specularGlossinessMap||n._occlusionMap||n._alphaMap)&&h.push(`in vec2 vUV;`),c&&(a.lightMaps.length>0&&h.push(`in vec3 vWorldNormal;`),h.push(`in vec3 vViewNormal;`)),o.ambient&&h.push(`uniform vec3 materialAmbient;`),o.baseColor&&h.push(`uniform vec3 materialBaseColor;`),o.alpha!==void 0&&o.alpha!==null&&h.push(`uniform vec4 materialAlphaModeCutoff;`),o.emissive&&h.push(`uniform vec3 materialEmissive;`),o.diffuse&&h.push(`uniform vec3 materialDiffuse;`),o.glossiness!==void 0&&o.glossiness!==null&&h.push(`uniform float materialGlossiness;`),o.shininess!==void 0&&o.shininess!==null&&h.push(`uniform float materialShininess;`),o.specular&&h.push(`uniform vec3 materialSpecular;`),o.metallic!==void 0&&o.metallic!==null&&h.push(`uniform float materialMetallic;`),o.roughness!==void 0&&o.roughness!==null&&h.push(`uniform float materialRoughness;`),o.specularF0!==void 0&&o.specularF0!==null&&h.push(`uniform float materialSpecularF0;`),l&&n._ambientMap&&(h.push(`uniform sampler2D ambientMap;`),n._ambientMap._state.matrix&&h.push(`uniform mat4 ambientMapMatrix;`)),l&&n._baseColorMap&&(h.push(`uniform sampler2D baseColorMap;`),n._baseColorMap._state.matrix&&h.push(`uniform mat4 baseColorMapMatrix;`)),l&&n._diffuseMap&&(h.push(`uniform sampler2D diffuseMap;`),n._diffuseMap._state.matrix&&h.push(`uniform mat4 diffuseMapMatrix;`)),l&&n._emissiveMap&&(h.push(`uniform sampler2D emissiveMap;`),n._emissiveMap._state.matrix&&h.push(`uniform mat4 emissiveMapMatrix;`)),c&&l&&n._metallicMap&&(h.push(`uniform sampler2D metallicMap;`),n._metallicMap._state.matrix&&h.push(`uniform mat4 metallicMapMatrix;`)),c&&l&&n._roughnessMap&&(h.push(`uniform sampler2D roughnessMap;`),n._roughnessMap._state.matrix&&h.push(`uniform mat4 roughnessMapMatrix;`)),c&&l&&n._metallicRoughnessMap&&(h.push(`uniform sampler2D metallicRoughnessMap;`),n._metallicRoughnessMap._state.matrix&&h.push(`uniform mat4 metallicRoughnessMapMatrix;`)),c&&n._normalMap&&(h.push(`uniform sampler2D normalMap;`),n._normalMap._state.matrix&&h.push(`uniform mat4 normalMapMatrix;`),h.push(`vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {`),h.push(` vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );`),h.push(` vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );`),h.push(` vec2 st0 = dFdx( uv.st );`),h.push(` vec2 st1 = dFdy( uv.st );`),h.push(` vec3 S = normalize( q0 * st1.t - q1 * st0.t );`),h.push(` vec3 T = normalize( -q0 * st1.s + q1 * st0.s );`),h.push(` vec3 N = normalize( surf_norm );`),h.push(` vec3 mapN = texture( normalMap, uv ).xyz * 2.0 - 1.0;`),h.push(` mat3 tsn = mat3( S, T, N );`),h.push(` return normalize( tsn * mapN );`),h.push(`}`)),l&&n._occlusionMap&&(h.push(`uniform sampler2D occlusionMap;`),n._occlusionMap._state.matrix&&h.push(`uniform mat4 occlusionMapMatrix;`)),l&&n._alphaMap&&(h.push(`uniform sampler2D alphaMap;`),n._alphaMap._state.matrix&&h.push(`uniform mat4 alphaMapMatrix;`)),c&&l&&n._specularMap&&(h.push(`uniform sampler2D specularMap;`),n._specularMap._state.matrix&&h.push(`uniform mat4 specularMapMatrix;`)),c&&l&&n._glossinessMap&&(h.push(`uniform sampler2D glossinessMap;`),n._glossinessMap._state.matrix&&h.push(`uniform mat4 glossinessMapMatrix;`)),c&&l&&n._specularGlossinessMap&&(h.push(`uniform sampler2D materialSpecularGlossinessMap;`),n._specularGlossinessMap._state.matrix&&h.push(`uniform mat4 materialSpecularGlossinessMapMatrix;`)),c&&(n._diffuseFresnel||n._specularFresnel||n._alphaFresnel||n._emissiveFresnel||n._reflectivityFresnel)&&(h.push(`float fresnel(vec3 eyeDir, vec3 normal, float edgeBias, float centerBias, float power) {`),h.push(` float fr = abs(dot(eyeDir, normal));`),h.push(` float finalFr = clamp((fr - edgeBias) / (centerBias - edgeBias), 0.0, 1.0);`),h.push(` return pow(finalFr, power);`),h.push(`}`),n._diffuseFresnel&&(h.push(`uniform float diffuseFresnelCenterBias;`),h.push(`uniform float diffuseFresnelEdgeBias;`),h.push(`uniform float diffuseFresnelPower;`),h.push(`uniform vec3 diffuseFresnelCenterColor;`),h.push(`uniform vec3 diffuseFresnelEdgeColor;`)),n._specularFresnel&&(h.push(`uniform float specularFresnelCenterBias;`),h.push(`uniform float specularFresnelEdgeBias;`),h.push(`uniform float specularFresnelPower;`),h.push(`uniform vec3 specularFresnelCenterColor;`),h.push(`uniform vec3 specularFresnelEdgeColor;`)),n._alphaFresnel&&(h.push(`uniform float alphaFresnelCenterBias;`),h.push(`uniform float alphaFresnelEdgeBias;`),h.push(`uniform float alphaFresnelPower;`),h.push(`uniform vec3 alphaFresnelCenterColor;`),h.push(`uniform vec3 alphaFresnelEdgeColor;`)),n._reflectivityFresnel&&(h.push(`uniform float materialSpecularF0FresnelCenterBias;`),h.push(`uniform float materialSpecularF0FresnelEdgeBias;`),h.push(`uniform float materialSpecularF0FresnelPower;`),h.push(`uniform vec3 materialSpecularF0FresnelCenterColor;`),h.push(`uniform vec3 materialSpecularF0FresnelEdgeColor;`)),n._emissiveFresnel&&(h.push(`uniform float emissiveFresnelCenterBias;`),h.push(`uniform float emissiveFresnelEdgeBias;`),h.push(`uniform float emissiveFresnelPower;`),h.push(`uniform vec3 emissiveFresnelCenterColor;`),h.push(`uniform vec3 emissiveFresnelEdgeColor;`))),h.push(`uniform vec4 lightAmbient;`),c)for(let e=0,t=a.lights.length;e<t;e++){let t=a.lights[e];t.type!==`ambient`&&(h.push(`uniform vec4 lightColor`+e+`;`),t.type===`point`&&h.push(`uniform vec3 lightAttenuation`+e+`;`),t.type===`dir`&&t.space===`view`&&h.push(`uniform vec3 lightDir`+e+`;`),t.type===`point`&&t.space===`view`?h.push(`uniform vec3 lightPos`+e+`;`):h.push(`in vec4 vViewLightReverseDirAndDist`+e+`;`))}if(p)for(let e=0,t=a.lights.length;e<t;e++)a.lights[e].castsShadow&&(h.push(`in vec4 vShadowPosFromLight`+e+`;`),h.push(`uniform sampler2D shadowMap`+e+`;`));if(h.push(`uniform vec4 colorize;`),h.push(`out vec4 outColor;`),h.push(`void main(void) {`),s){h.push(`if (clippable) {`),h.push(` float dist = 0.0;`);for(var g=0;g<i.getNumAllocatedSectionPlanes();g++)h.push(`if (sectionPlaneActive`+g+`) {`),h.push(` dist += clamp(dot(-sectionPlaneDir`+g+`.xyz, vWorldPosition.xyz - sectionPlanePos`+g+`.xyz), 0.0, 1000.0);`),h.push(`}`);h.push(` if (dist > 0.0) { discard; }`),h.push(`}`)}if(r.primitiveName===`points`&&(h.push(`vec2 cxy = 2.0 * gl_PointCoord - 1.0;`),h.push(`float r = dot(cxy, cxy);`),h.push(`if (r > 1.0) {`),h.push(` discard;`),h.push(`}`)),h.push(`float occlusion = 1.0;`),o.ambient?h.push(`vec3 ambientColor = materialAmbient;`):h.push(`vec3 ambientColor = vec3(1.0, 1.0, 1.0);`),o.diffuse?h.push(`vec3 diffuseColor = materialDiffuse;`):o.baseColor?h.push(`vec3 diffuseColor = materialBaseColor;`):h.push(`vec3 diffuseColor = vec3(1.0, 1.0, 1.0);`),r.colors&&h.push(`diffuseColor *= vColor.rgb;`),o.emissive?h.push(`vec3 emissiveColor = materialEmissive;`):h.push(`vec3 emissiveColor = vec3(0.0, 0.0, 0.0);`),o.specular?h.push(`vec3 specular = materialSpecular;`):h.push(`vec3 specular = vec3(1.0, 1.0, 1.0);`),o.alpha===void 0?h.push(`float alpha = 1.0;`):h.push(`float alpha = materialAlphaModeCutoff[0];`),r.colors&&h.push(`alpha *= vColor.a;`),o.glossiness===void 0?h.push(`float glossiness = 1.0;`):h.push(`float glossiness = materialGlossiness;`),o.metallic===void 0?h.push(`float metallic = 1.0;`):h.push(`float metallic = materialMetallic;`),o.roughness===void 0?h.push(`float roughness = 1.0;`):h.push(`float roughness = materialRoughness;`),o.specularF0===void 0?h.push(`float specularF0 = 1.0;`):h.push(`float specularF0 = materialSpecularF0;`),l&&(c&&n._normalMap||n._ambientMap||n._baseColorMap||n._diffuseMap||n._occlusionMap||n._emissiveMap||n._metallicMap||n._roughnessMap||n._metallicRoughnessMap||n._specularMap||n._glossinessMap||n._specularGlossinessMap||n._alphaMap)&&(h.push(`vec4 texturePos = vec4(vUV.s, vUV.t, 1.0, 1.0);`),h.push(`vec2 textureCoord;`)),l&&n._ambientMap&&(n._ambientMap._state.matrix?h.push(`textureCoord = (ambientMapMatrix * texturePos).xy;`):h.push(`textureCoord = texturePos.xy;`),h.push(`vec4 ambientTexel = texture(ambientMap, textureCoord).rgb;`),h.push(`ambientTexel = `+Lk[n._ambientMap._state.encoding]+`(ambientTexel);`),h.push(`ambientColor *= ambientTexel.rgb;`)),l&&n._diffuseMap&&(n._diffuseMap._state.matrix?h.push(`textureCoord = (diffuseMapMatrix * texturePos).xy;`):h.push(`textureCoord = texturePos.xy;`),h.push(`vec4 diffuseTexel = texture(diffuseMap, textureCoord);`),h.push(`diffuseTexel = `+Lk[n._diffuseMap._state.encoding]+`(diffuseTexel);`),h.push(`diffuseColor *= diffuseTexel.rgb;`),h.push(`alpha *= diffuseTexel.a;`)),l&&n._baseColorMap&&(n._baseColorMap._state.matrix?h.push(`textureCoord = (baseColorMapMatrix * texturePos).xy;`):h.push(`textureCoord = texturePos.xy;`),h.push(`vec4 baseColorTexel = texture(baseColorMap, textureCoord);`),h.push(`baseColorTexel = `+Lk[n._baseColorMap._state.encoding]+`(baseColorTexel);`),h.push(`diffuseColor *= baseColorTexel.rgb;`),h.push(`alpha *= baseColorTexel.a;`)),l&&n._emissiveMap&&(n._emissiveMap._state.matrix?h.push(`textureCoord = (emissiveMapMatrix * texturePos).xy;`):h.push(`textureCoord = texturePos.xy;`),h.push(`vec4 emissiveTexel = texture(emissiveMap, textureCoord);`),h.push(`emissiveTexel = `+Lk[n._emissiveMap._state.encoding]+`(emissiveTexel);`),h.push(`emissiveColor = emissiveTexel.rgb;`)),l&&n._alphaMap&&(n._alphaMap._state.matrix?h.push(`textureCoord = (alphaMapMatrix * texturePos).xy;`):h.push(`textureCoord = texturePos.xy;`),h.push(`alpha *= texture(alphaMap, textureCoord).r;`)),l&&n._occlusionMap&&(n._occlusionMap._state.matrix?h.push(`textureCoord = (occlusionMapMatrix * texturePos).xy;`):h.push(`textureCoord = texturePos.xy;`),h.push(`occlusion *= texture(occlusionMap, textureCoord).r;`)),c&&(a.lights.length>0||a.lightMaps.length>0||a.reflectionMaps.length>0)){l&&n._normalMap?(n._normalMap._state.matrix?h.push(`textureCoord = (normalMapMatrix * texturePos).xy;`):h.push(`textureCoord = texturePos.xy;`),h.push(`vec3 viewNormal = perturbNormal2Arb( vViewPosition, normalize(vViewNormal), textureCoord );`)):h.push(`vec3 viewNormal = normalize(vViewNormal);`),l&&n._specularMap&&(n._specularMap._state.matrix?h.push(`textureCoord = (specularMapMatrix * texturePos).xy;`):h.push(`textureCoord = texturePos.xy;`),h.push(`specular *= texture(specularMap, textureCoord).rgb;`)),l&&n._glossinessMap&&(n._glossinessMap._state.matrix?h.push(`textureCoord = (glossinessMapMatrix * texturePos).xy;`):h.push(`textureCoord = texturePos.xy;`),h.push(`glossiness *= texture(glossinessMap, textureCoord).r;`)),l&&n._specularGlossinessMap&&(n._specularGlossinessMap._state.matrix?h.push(`textureCoord = (materialSpecularGlossinessMapMatrix * texturePos).xy;`):h.push(`textureCoord = texturePos.xy;`),h.push(`vec4 specGlossRGB = texture(materialSpecularGlossinessMap, textureCoord).rgba;`),h.push(`specular *= specGlossRGB.rgb;`),h.push(`glossiness *= specGlossRGB.a;`)),l&&n._metallicMap&&(n._metallicMap._state.matrix?h.push(`textureCoord = (metallicMapMatrix * texturePos).xy;`):h.push(`textureCoord = texturePos.xy;`),h.push(`metallic *= texture(metallicMap, textureCoord).r;`)),l&&n._roughnessMap&&(n._roughnessMap._state.matrix?h.push(`textureCoord = (roughnessMapMatrix * texturePos).xy;`):h.push(`textureCoord = texturePos.xy;`),h.push(`roughness *= texture(roughnessMap, textureCoord).r;`)),l&&n._metallicRoughnessMap&&(n._metallicRoughnessMap._state.matrix?h.push(`textureCoord = (metallicRoughnessMapMatrix * texturePos).xy;`):h.push(`textureCoord = texturePos.xy;`),h.push(`vec3 metalRoughRGB = texture(metallicRoughnessMap, textureCoord).rgb;`),h.push(`metallic *= metalRoughRGB.b;`),h.push(`roughness *= metalRoughRGB.g;`)),h.push(`vec3 viewEyeDir = normalize(-vViewPosition);`),n._diffuseFresnel&&(h.push(`float diffuseFresnel = fresnel(viewEyeDir, viewNormal, diffuseFresnelEdgeBias, diffuseFresnelCenterBias, diffuseFresnelPower);`),h.push(`diffuseColor *= mix(diffuseFresnelEdgeColor, diffuseFresnelCenterColor, diffuseFresnel);`)),n._specularFresnel&&(h.push(`float specularFresnel = fresnel(viewEyeDir, viewNormal, specularFresnelEdgeBias, specularFresnelCenterBias, specularFresnelPower);`),h.push(`specular *= mix(specularFresnelEdgeColor, specularFresnelCenterColor, specularFresnel);`)),n._alphaFresnel&&(h.push(`float alphaFresnel = fresnel(viewEyeDir, viewNormal, alphaFresnelEdgeBias, alphaFresnelCenterBias, alphaFresnelPower);`),h.push(`alpha *= mix(alphaFresnelEdgeColor.r, alphaFresnelCenterColor.r, alphaFresnel);`)),n._emissiveFresnel&&(h.push(`float emissiveFresnel = fresnel(viewEyeDir, viewNormal, emissiveFresnelEdgeBias, emissiveFresnelCenterBias, emissiveFresnelPower);`),h.push(`emissiveColor *= mix(emissiveFresnelEdgeColor, emissiveFresnelCenterColor, emissiveFresnel);`)),h.push(`if (materialAlphaModeCutoff[1] == 1.0 && alpha < materialAlphaModeCutoff[2]) {`),h.push(` discard;`),h.push(`}`),h.push(`IncidentLight light;`),h.push(`Material material;`),h.push(`Geometry geometry;`),h.push(`ReflectedLight reflectedLight = ReflectedLight(vec3(0.0,0.0,0.0), vec3(0.0,0.0,0.0));`),h.push(`vec3 viewLightDir;`),u&&(h.push(`material.diffuseColor = diffuseColor;`),h.push(`material.specularColor = specular;`),h.push(`material.shine = materialShininess;`)),f&&(h.push(`float oneMinusSpecularStrength = 1.0 - max(max(specular.r, specular.g ),specular.b);`),h.push(`material.diffuseColor = diffuseColor * oneMinusSpecularStrength;`),h.push(`material.specularRoughness = clamp( 1.0 - glossiness, 0.04, 1.0 );`),h.push(`material.specularColor = specular;`)),d&&(h.push(`float dielectricSpecular = 0.16 * specularF0 * specularF0;`),h.push(`material.diffuseColor = diffuseColor * (1.0 - dielectricSpecular) * (1.0 - metallic);`),h.push(`material.specularRoughness = clamp(roughness, 0.04, 1.0);`),h.push(`material.specularColor = mix(vec3(dielectricSpecular), diffuseColor, metallic);`)),h.push(`geometry.position = vViewPosition;`),a.lightMaps.length>0&&h.push(`geometry.worldNormal = normalize(vWorldNormal);`),h.push(`geometry.viewNormal = viewNormal;`),h.push(`geometry.viewEyeDir = viewEyeDir;`),u&&(a.lightMaps.length>0||a.reflectionMaps.length>0)&&h.push(`computePhongLightMapping(geometry, material, reflectedLight);`),(f||d)&&(a.lightMaps.length>0||a.reflectionMaps.length>0)&&h.push(`computePBRLightMapping(geometry, material, reflectedLight);`),h.push(`float shadow = 1.0;`),h.push(`float shadowAcneRemover = 0.007;`),h.push(`vec3 fragmentDepth;`),h.push(`float texelSize = 1.0 / 1024.0;`),h.push(`float amountInLight = 0.0;`),h.push(`vec3 shadowCoord;`),h.push(`vec4 rgbaDepth;`),h.push(`float depth;`);for(let e=0,t=a.lights.length;e<t;e++){let t=a.lights[e];t.type!==`ambient`&&(t.type===`dir`&&t.space===`view`?h.push(`viewLightDir = -normalize(lightDir`+e+`);`):t.type===`point`&&t.space===`view`?h.push(`viewLightDir = normalize(lightPos`+e+` - vViewPosition);`):h.push(`viewLightDir = normalize(vViewLightReverseDirAndDist`+e+`.xyz);`),p&&t.castsShadow?(h.push(`shadow = 0.0;`),h.push(`fragmentDepth = vShadowPosFromLight`+e+`.xyz;`),h.push(`fragmentDepth.z -= shadowAcneRemover;`),h.push(`for (int x = -3; x <= 3; x++) {`),h.push(` for (int y = -3; y <= 3; y++) {`),h.push(` float texelDepth = unpackDepth(texture(shadowMap`+e+`, fragmentDepth.xy + vec2(x, y) * texelSize));`),h.push(` if (fragmentDepth.z < texelDepth) {`),h.push(` shadow += 1.0;`),h.push(` }`),h.push(` }`),h.push(`}`),h.push(`shadow = shadow / 9.0;`),h.push(`light.color = lightColor`+e+`.rgb * (lightColor`+e+`.a * shadow);`)):h.push(`light.color = lightColor`+e+`.rgb * (lightColor`+e+`.a );`),h.push(`light.direction = viewLightDir;`),u&&h.push(`computePhongLighting(light, geometry, material, reflectedLight);`),(f||d)&&h.push(`computePBRLighting(light, geometry, material, reflectedLight);`))}u?h.push(`vec3 outgoingLight = (lightAmbient.rgb * lightAmbient.a * diffuseColor) + ((occlusion * (( reflectedLight.diffuse + reflectedLight.specular)))) + emissiveColor;`):h.push(`vec3 outgoingLight = (occlusion * (reflectedLight.diffuse)) + (occlusion * reflectedLight.specular) + emissiveColor;`)}else h.push(`ambientColor *= (lightAmbient.rgb * lightAmbient.a);`),h.push(`vec3 outgoingLight = emissiveColor + ambientColor;`);return h.push(`vec4 fragColor = vec4(outgoingLight, alpha) * colorize;`),m&&h.push(`fragColor = linearToGamma(fragColor, gammaFactor);`),h.push(`outColor = fragColor;`),t.logarithmicDepthBufferEnabled&&h.push(`gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;`),h.push(`}`),h}var Bk=class{constructor(e,t,n){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,n),e.compileShader(this.handle),this.compiled=e.getShaderParameter(this.handle,e.COMPILE_STATUS),!this.compiled&&!e.isContextLost()){let t=n.split(`
943
943
  `),r=[];for(let e=0;e<t.length;e++)r.push(e+1+`: `+t[e]+`
944
944
  `);this.errors=[],this.errors.push(``),this.errors.push(e.getShaderInfoLog(this.handle)),this.errors=this.errors.concat(r.join(``))}}destroy(){}},U1e=class{constructor(e,t){this.bindTexture=function(n,r){return n.bind(r)?(e.uniform1i(t,r),!0):!1}}},W1e=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))}},Vk=new ID({});function Hk(e){let t=[],n,r;for(let i=0,a=e.length;i<a;i++)n=e[i],r=n.indexOf(`/`),r>0&&n.charAt(r+1)===`/`&&(n=n.substring(0,r)),t.push(n);return t.join(`
@@ -2428,7 +2428,7 @@ void main() {
2428
2428
  `},zoomImageTransform(){return`
2429
2429
  scale(${this.zoomFactor})
2430
2430
  translate(-${this.zoomX}px, -${this.zoomY}px)
2431
- `}},methods:{onMouseMove({offsetX:e,offsetY:t}){this.zoomX=e,this.zoomY=t}}},jTt=[`src`],MTt=[`src`];function NTt(e,t,n,r,i,a){return z(),B(`div`,{class:`preview-2d`,onMouseenter:t[0]||=e=>i.hover=!0,onMouseleave:t[1]||=e=>i.hover=!1,onMousemove:t[2]||=(...e)=>a.onMouseMove&&a.onMouseMove(...e)},[H(`img`,{loading:`lazy`,src:a.imgUrl},null,8,jTt),qo(H(`div`,{class:`zoom`,style:N({transform:a.zoomTransform})},[H(`div`,{class:`zoomImage`,style:N({width:`${n.width}px`,height:`${n.height}px`,transform:a.zoomImageTransform})},[H(`img`,{loading:`lazy`,src:a.imgUrl},null,8,MTt)],4)],4),[[Wd,i.hover]])],32)}var PTt=q(ATt,[[`render`,NTt],[`__scopeId`,`data-v-b92f4cf9`]]),YZ=15,FTt={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(YZ*(1-e/this.width));t=Math.abs(t),t=Math.min(t,YZ),this.translation=(t-1)*this.viewportWidth}}},ITt=[`src`];function LTt(e,t,n,r,i,a){return z(),B(`div`,{class:`preview-3d`,onMousemove:t[0]||=(...e)=>a.onMouseMove&&a.onMouseMove(...e)},[H(`div`,{class:`viewport`,style:N({width:`${a.viewportWidth}px`,height:`${n.height}px`})},[H(`img`,{loading:`lazy`,src:n.previewUrl||n.defaultUrl,style:N({transform:`translateX(-${i.translation}px)`})},null,12,ITt)],4)],32)}var RTt={components:{Preview2D:PTt,Preview3D:q(FTt,[[`render`,LTt],[`__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 zTt(e,t,n,r,i,a){return z(),V(Pc(a.previewComponent),Vu({class:`bimdata-model-preview`,style:{width:`${n.width}px`,height:`${n.height}px`,backgroundColor:n.backgroundColor}},e.$props),null,16,[`style`])}var BTt=q(RTt,[[`render`,zTt]]),VTt={class:`placeholder`},HTt={class:`list-item`},UTt={class:`count`},WTt=q({__name:`StoreySelector`,props:{storeys:{type:Object,required:!0},storey:{type:Object,default:null}},emits:[`storey-selected`],setup(e,{emit:t}){let n=e,r=I(null);return rs([()=>n.storeys,()=>n.storey],([e,t])=>{(!t||e.some(e=>e.uuid===t.uuid)&&t.uuid!==r.value?.uuid)&&(r.value=t)},{immediate:!0}),(t,n)=>{let i=R(`BIMDataIconStorey`),a=R(`BIMDataTextbox`),o=R(`BIMDataIconPlan`),s=R(`BIMDataDropdownList`);return z(),V(s,{class:`storey-selector`,width:`100%`,list:e.storeys,elementKey:`uuid`,closeOnElementClick:!0,onElementClick:n[0]||=e=>t.$emit(`storey-selected`,e)},{header:L(()=>[U(i,{size:`xs`}),H(`span`,VTt,F(r.value?.name??t.$t(`MetaBuildingStructure.StoreySelector.placeholder`)),1)]),element:L(({element:e})=>[H(`div`,HTt,[U(a,{class:`text`,text:e.name},null,8,[`text`]),U(o,{size:`xs`}),H(`span`,UTt,F(e.plans.length),1)])]),_:1},8,[`list`])}}},[[`__scopeId`,`data-v-49c78195`]]),GTt={class:`photosphere-building`},KTt={class:`title`},qTt={class:`head`},JTt={class:`body`},YTt={class:`loading`},XZ=q({__name:`BIMDataPhotosphereBuilding`,props:{apiClient:{type:Object,required:!0},space:{type:Object,required:!0},project:{type:Object,required:!0},model:{type:Object,default:null},storey:{type:Object,default:null},plan:{type:Object,default:null},selectable:{type:Boolean,default:!1}},emits:[`storey-selected`,`plan-selected`],setup(e,{emit:t}){let n=e,r=t,i=I(!1),a=I([]),o=I(null),s=K(()=>o.value?.plans??[]),c=I(null);rs(()=>n.model,async e=>{if(e)try{i.value=!0,a.value=await n.apiClient.modelApi.getStoreys(n.space.id,e.id,n.project.id),a.value.some(({uuid:e})=>o.value?.uuid===e)||(o.value=a.value[0]??null)}finally{i.value=!1}else a.value=[],o.value=null},{immediate:!0}),rs(()=>n.storey,e=>{o.value=e},{immediate:!0}),rs(()=>n.plan,e=>{c.value=e?.plan?.id},{immediate:!0});let l=e=>(o.value=e,r(`storey-selected`,e)),u=e=>r(`plan-selected`,e);return(t,n)=>{let r=R(`BIMDataIconBuilding`),d=R(`BIMDataRadio`),f=R(`BIMDataFileIcon`),p=R(`BIMDataTextbox`),m=R(`BIMDataSpinner`);return z(),B(`div`,GTt,[H(`div`,KTt,[U(r,{size:`s`}),H(`span`,null,F(t.$t(`PhotosphereBuilding.title`)),1)]),H(`div`,qTt,[U(WTt,{storeys:a.value,storey:o.value,onStoreySelected:l},null,8,[`storeys`,`storey`])]),H(`div`,JTt,[(z(!0),B(bu,null,Rc(s.value,t=>(z(),B(`div`,{class:`list-item`,key:t.plan.id},[e.selectable?(z(),V(d,{key:0,value:t.plan.id,modelValue:c.value,"onUpdate:modelValue":[n[0]||=e=>c.value=e,e=>u(t)]},null,8,[`value`,`modelValue`,`onUpdate:modelValue`])):G(``,!0),U(f,{fileName:t.plan.document?.file_name??t.plan.name,size:14},null,8,[`fileName`]),U(p,{class:`text`,text:t.plan.name},null,8,[`text`])]))),128))]),U(kd,{name:`fade`},{default:L(()=>[qo(H(`div`,YTt,[U(m)],512),[[Wd,i.value]])]),_:1})])}}},[[`__scopeId`,`data-v-94317752`]]);function ZZ(e,t){return Array.isArray(e)?e=e.map(e=>ZZ(e,t)):(e.expandedRef=I(!0),e.parent=t,e.children=e.children?.map(t=>ZZ(t,e))??[]),e}function XTt(e,t,n){return[{id:1,text:e.name,component:`StructureRootNode`,children:t.map(e=>ZTt(e,n))}]}var ZTt=(e,t)=>({id:e.uuid,text:e.name,component:`StoreyNode`,children:e.plans?.map(t=>QTt(e,t))??[],storey:e}),QTt=(e,t)=>({id:t.plan.id,text:t.plan.name,component:`PlanNode`,storey:e,plan:t}),$Tt={class:`generic-tree-node`},eEt={class:`end`},QZ=q({__name:`GenericTreeNode`,props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},setup(e){return(t,n)=>{let r=R(`BIMDataTextbox`);return z(),B(`div`,$Tt,[Bc(t.$slots,`icon`,{},void 0,!0),U(r,{class:`text`,text:e.node.text},null,8,[`text`]),H(`div`,eEt,[Bc(t.$slots,`end`,{},void 0,!0)])])}}},[[`__scopeId`,`data-v-fab13549`]]),tEt={__name:`PlanNode`,props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},emits:[`delete-plan`],setup(e){let t=e,n=K(()=>t.node.storey),r=K(()=>t.node.plan);return(e,t)=>{let i=R(`BIMDataFileIcon`),a=R(`BIMDataIconDelete`),o=R(`BIMDataButton`);return z(),V(QZ,Br(Fu(e.$props)),{icon:L(()=>[U(i,{"file-name":r.value.plan.document?.file_name??r.value.plan.name,size:12},null,8,[`file-name`])]),end:L(()=>[U(o,{width:`24px`,height:`24px`,color:`high`,ghost:``,rounded:``,icon:``,onClick:t[0]||=t=>e.$emit(`delete-plan`,{storey:n.value,plan:r.value})},{default:L(()=>[U(a,{size:`xxs`})]),_:1})]),_:1},16)}}},nEt=q({__name:`StoreyNode`,props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},emits:[`add-plans`,`delete-storey`,`update-storey`],setup(e,{emit:t}){let n=e,r=t,i=[{key:1,text:`BuildingMaker.view.addFile`,icon:`plus`,action:()=>(a.value=!1,r(`add-plans`,n.node.storey))},{key:2,text:`BIMDataComponents.t.rename`,icon:`edit`,action:()=>(a.value=!1,r(`update-storey`,n.node.storey)),divider:!0},{key:3,text:`BIMDataComponents.t.delete`,icon:`delete`,color:`var(--color-high)`,action:()=>(a.value=!1,r(`delete-storey`,n.node.storey))}],a=I(!1);return(e,t)=>{let n=R(`BIMDataIconStorey`),r=R(`BIMDataIconEllipsis`),o=R(`BIMDataButton`),s=R(`BIMDataIcon`),c=R(`BIMDataMenu`);return z(),V(QZ,Vu({class:`storey-node`},e.$props),{icon:L(()=>[U(n,{size:`xxs`})]),end:L(()=>[U(o,{width:`24px`,height:`24px`,color:`granite`,ghost:``,rounded:``,icon:``,onClick:t[0]||=e=>a.value=!a.value},{default:L(()=>[U(r,{customSize:`24`})]),_:1}),U(kd,{name:`fade`},{default:L(()=>[qo(U(c,{class:`storey-node__menu`,menuItems:i,width:`180px`},{item:L(({item:t})=>[U(s,{name:t.icon,size:`xs`,margin:`0 12px 0 0`},null,8,[`name`]),H(`span`,null,F(e.$t(t.text)),1)]),_:1},512),[[Wd,a.value]])]),_:1})]),_:1},16)}}},[[`__scopeId`,`data-v-a66bc7dd`]]),rEt={__name:`StructureRootNode`,props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},emits:[`create-storey`],setup(e){return(e,t)=>{let n=R(`BIMDataIconBuilding`),r=R(`BIMDataIconPlus`),i=R(`BIMDataButton`);return z(),V(QZ,Br(Fu(e.$props)),{icon:L(()=>[U(n,{size:`xs`})]),end:L(()=>[U(i,{width:`23px`,height:`23px`,color:`primary`,fill:``,radius:``,icon:``,onClick:t[0]||=t=>e.$emit(`create-storey`)},{default:L(()=>[U(r,{size:`xxs`})]),_:1})]),_:1},16)}}},iEt={__name:`ZoneNode`,props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},setup(e){return(e,t)=>{let n=R(`BIMDataIconZone2`);return z(),V(QZ,Br(Fu(e.$props)),{icon:L(()=>[U(n,{size:`xxs`})]),_:1},16)}}},aEt={class:`building-view`},oEt={key:0,class:`content`},sEt={key:1,class:`content`},cEt={class:`building-view__tree`},lEt=q(Object.assign({components:{PlanNode:tEt,StoreyNode:nEt,StructureRootNode:rEt,ZoneNode:iEt}},{__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 n=e,r=Xo(`service`),i=Xo(`loading`),a=I(``),o=I(``),s=I(!1),c=I(!1),l=I([]),u=I(null),d=I([]),f=I([]),p=K(()=>ZZ(XTt(n.model,l.value,f.value))),m=async()=>{try{i.value=!0,l.value=await r.fetchStoreys(n.model)}finally{i.value=!1}},h=async()=>{try{i.value=!0,f.value=await r.fetchZones(n.model)}finally{i.value=!1}},g=async e=>{await r.createStorey(n.model,e),m()},_=async e=>{await r.updateStorey(n.model,e),m()},v=async e=>{await r.deleteStorey(n.model,e),m()},y=e=>{u.value=e,c.value=!0},b=()=>{u.value=null,c.value=!1},x=e=>{a.value=n.apiClient.config.configuration.basePath,o.value=n.apiClient.accessToken,u.value=e,s.value=!0},S=async()=>{let e=[],t=[];for(let{document:n,pdfPage:r}of d.value)r?t.push(r):e.push(n);let i=(await r.createPlanModels(e)).concat(t);await r.createStoreyPlans(n.model,u.value,i),m(),d.value=[],u.value=null,s.value=!1},C=async({storey:e,plan:t})=>{await r.deleteStoreyPlan(n.model,e,t),m()};return Sc(()=>{m(),h()}),(t,n)=>{let r=R(`BIMDataFileManager`),i=R(`BIMDataButton`),l=R(`BIMDataTree`);return z(),B(`div`,aEt,[U(kd,{name:`fade`,mode:`out-in`},{default:L(()=>[s.value&&a.value&&o.value&&u.value?(z(),B(`div`,oEt,[U(r,{class:`building-view__dms`,spaceId:e.space.id,projectId:e.project.id,apiUrl:a.value,archiveUrl:``,accessToken:o.value,locale:t.$i18n.locale,select:!0,pdfPageSelect:!0,multi:!0,headerButtons:!1,selectableFileTypes:Ua(pY),onSelectionChange:n[0]||=e=>d.value=e},null,8,[`spaceId`,`projectId`,`apiUrl`,`accessToken`,`locale`,`selectableFileTypes`]),U(i,{width:`100%`,color:`primary`,fill:``,radius:``,onClick:S},{default:L(()=>[W(F(t.$t(`BIMDataComponents.t.validate`)),1)]),_:1})])):(z(),B(`div`,sEt,[H(`div`,cEt,[U(l,{data:p.value},{node:L(({node:e,depth:t})=>[(z(),V(Pc(e.component),{node:e,depth:t,onCreateStorey:y,onUpdateStorey:y,onDeleteStorey:v,onAddPlans:x,onDeletePlan:C},null,40,[`node`,`depth`]))]),_:1},8,[`data`])]),U(i,{width:`100%`,color:`primary`,fill:``,radius:``,onClick:n[1]||=e=>t.$emit(`close`)},{default:L(()=>[W(F(t.$t(`BIMDataComponents.t.finish`)),1)]),_:1}),U(kd,{name:`fade`},{default:L(()=>[c.value?(z(),V(gY,{key:0,class:`building-view__form`,storey:u.value,onCreateStorey:g,onUpdateStorey:_,onClose:b},null,8,[`storey`])):G(``,!0)]),_:1})]))]),_:1})])}}}),[[`__scopeId`,`data-v-5bedb26f`]]),uEt={class:`bimdata-building-maker`},dEt=[`src`],fEt={class:`bimdata-building-maker__body`},pEt={class:`bimdata-building-maker__loader`},mEt=q({__name:`BIMDataPhotosphereBuildingMaker`,props:{apiClient:{type:Object,required:!0},space:{type:Object,required:!0},project:{type:Object,required:!0},model:{type:Object,default:null}},emits:[`metaBuilding-created`,`metaBuilding-updated`,`metaBuilding-deleted`],setup(e,{emit:t}){let n=e,r=t,i=Object.freeze({FORM:`form`,LIST:`list`,VIEW:`view`}),a=dY(n.apiClient,n.space,n.project),o=I(!1);Yo(`service`,a),Yo(`loading`,o);let s=I(i.LIST),c=I([]),l=I(null),u=async()=>{o.value=!0,c.value=await a.fetchPhotosphereBuildings(),o.value=!1},d=async e=>{await a.deleteMetaBuilding(e),u(),r(`metaBuilding-deleted`)},f=e=>{l.value=e??null,s.value=i.FORM},p=e=>{l.value=e,s.value=i.VIEW},m=async e=>{await u(),p(e),r(`metaBuilding-created`)},h=()=>{u(),s.value=i.LIST,r(`metaBuilding-updated`)},g=()=>{s.value=i.LIST};return rs(()=>n.model,e=>{e&&p(e)},{immediate:!0}),Sc(()=>u()),(t,n)=>{let r=R(`BIMDataIconArrow`),a=R(`BIMDataButton`),u=R(`BIMDataSpinner`);return z(),B(`div`,uEt,[H(`div`,{class:`bimdata-building-maker__header`,style:N({visibility:s.value===Ua(i).LIST?`hidden`:`visible`})},[U(a,{class:`bimdata-building-maker__header__btn-back`,ghost:``,radius:``,disabled:o.value.value,onClick:g},{default:L(()=>[U(r,{size:`xxs`,margin:`0 6px 0 0`}),H(`span`,null,F(t.$t(`BIMDataComponents.t.back`)),1)]),_:1},8,[`disabled`]),H(`img`,{src:Ua(uY)},null,8,dEt),H(`span`,null,F(t.$t(`PhotosphereBuilding.title`)),1)],4),H(`div`,fEt,[U(kd,{name:`fade`,mode:`out-in`},{default:L(()=>[s.value===Ua(i).FORM?(z(),V(mY,{key:0,type:Ua(fY).PHOTOSPHERE_BUILDING,metaBuilding:l.value,onMetaBuildingCreated:m,onMetaBuildingUpdated:h},null,8,[`type`,`metaBuilding`])):s.value===Ua(i).VIEW&&l.value?(z(),V(lEt,{key:1,apiClient:e.apiClient,space:e.space,project:e.project,model:l.value,onClose:g},null,8,[`apiClient`,`space`,`project`,`model`])):(z(),V(hY,{key:2,metaBuildings:c.value,onOpenMetaBuilding:p,onCreateMetaBuilding:f,onUpdateMetaBuilding:f,onDeleteMetaBuilding:d},null,8,[`metaBuildings`]))]),_:1})]),U(kd,{name:`fade`},{default:L(()=>[qo(H(`div`,pEt,[U(u)],512),[[Wd,o.value]])]),_:1})])}}},[[`__scopeId`,`data-v-235bd404`]]),hEt={class:`overlay`},gEt={class:`safe-zone__icon`},_Et={class:`safe-zone__title`},vEt={class:`safe-zone__text`},yEt={class:`safe-zone__actions`},bEt=q({__name:`BIMDataSafeZoneModal`,props:{width:{type:String,default:`350px`},iconName:{type:String,default:`warning`}},setup(e){return(t,n)=>{let r=R(`BIMDataIcon`);return z(),B(`div`,hEt,[H(`div`,{class:`safe-zone`,style:N({width:e.width})},[H(`div`,gEt,[U(r,{name:e.iconName,size:`s`,fill:``,color:`high`},null,8,[`name`])]),H(`h2`,_Et,[Bc(t.$slots,`title`,{},void 0,!0)]),H(`div`,vEt,[Bc(t.$slots,`text`,{},void 0,!0)]),H(`div`,yEt,[Bc(t.$slots,`actions`,{},void 0,!0)])],4)])}}},[[`__scopeId`,`data-v-01a25253`]]),xEt=s({BIMDataBuildingMaker:()=>_Y,BIMDataFileManager:()=>zwt,BIMDataGuidedTour:()=>aTt,BIMDataMetaBuildingStructure:()=>JZ,BIMDataModelPreview:()=>BTt,BIMDataPDFViewer:()=>NZ,BIMDataPhotosphereBuilding:()=>XZ,BIMDataPhotosphereBuildingMaker:()=>mEt,BIMDataSafeZoneModal:()=>bEt}),SEt={name:`buildingMaker`,component:{setup(){let{apiClient:e,cloudId:t,projectId:n}=Xo(`$viewer`).api;return()=>cd(_Y,{apiClient:e,space:{id:t},project:{id:n}})}},window:{name:`buildingMaker`,label:`Building Maker`,noModel:!0,icon:{imgUri:uY}}},CEt={components:{BIMDataNumericalInput:DD},setup(){let e=Xo(`$viewer`),t=Xo(`viewerPlan`),n=Xo(`root`),r=Xo(`close`),i=K(()=>n.editedBitmap?.plan),a=K(()=>n.editedBitmap?n.editedBitmap:{x:0,y:0,scale:0,angle:0,opacity:0}),o=wEt(a),{x:s,y:c,angle:l,scale:u}=o,d,f,p=new Map;rs(i,(e,t)=>{t&&p.set(t.key,d),e||p.clear(),d=p.get(e?.key)??null,f=null}),rs([s,c,l,u],()=>{i.value&&(d||=i.value.plan.transform,f={translate:[s.value,c.value],rotate:l.value,scale:u.value},t.planObjectRegistry.updatePlanObjectsTransform(i.value,{oldTransform:d,newTransform:f}),d=f)});let m=async()=>{try{n.loading=!0,await Promise.all(n.bitmaps.filter(e=>e.edited).map(async n=>{let{x:r,y:i,scale:a,angle:o,opacity:s,plan:c}=n,l={...c.plan.transform},u={translate:[r,i],rotate:o,scale:a,opacity:s};t.planObjectRegistry.updatePlanObjectsTransform(c,{oldTransform:u,newTransform:l}),c.plan.transform||(c.plan.transform={}),Object.assign(c.plan.transform,u),await e.state.updatePlan(c,l),n.edited=!1}))}catch(e){console.error(e)}finally{n.loading=!1,r()}};return{root:n,bitmap:a,...o,submit:m}}};function wEt(e){let t={};return Object.entries({x:e=>e,y:e=>e,scale:e=>e,angle:e=>e<0||e>360?(e%360+360)%360:e,opacity:e=>e<0?0:e>1?1:e}).forEach(([n,r])=>{t[n]=K({get:()=>e.value[n],set:t=>e.value[n]=r(t)})}),t}var TEt={class:`synchronization__page__edit`},EEt={class:`synchronization__page__edit__content`},DEt={class:`synchronization__page__edit__content__unit-group`},OEt={class:`synchronization__page__edit__content__unit-group__element`},kEt={class:`synchronization__page__edit__content__unit-group__element`},AEt={class:`synchronization__page__edit__content__unit-group__element`},jEt={class:`synchronization__page__edit__content__unit`},MEt={class:`synchronization__page__edit__content__unit`},NEt={class:`synchronization__page__edit__content__img`},PEt=[`src`],FEt={class:`synchronization__page__edit__validate`};function IEt(e,t,n,r,i,a){let o=R(`BIMDataNumericalInput`),s=R(`BIMDataSlider`),c=R(`BIMDataTextbox`),l=R(`BIMDataButton`);return z(),B(`div`,TEt,[H(`div`,EEt,[H(`section`,null,[H(`span`,null,F(e.$t(`synchronization.location`)),1),H(`div`,DEt,[H(`div`,OEt,[U(o,{modelValue:e.x,"onUpdate:modelValue":t[0]||=t=>e.x=t,label:`X`,container:e.$viewer.localContext.el},null,8,[`modelValue`,`container`])]),H(`div`,kEt,[U(o,{modelValue:e.y,"onUpdate:modelValue":t[1]||=t=>e.y=t,label:`Y`,container:e.$viewer.localContext.el},null,8,[`modelValue`,`container`])]),H(`div`,AEt,[U(o,{modelValue:e.scale,"onUpdate:modelValue":t[2]||=t=>e.scale=t,label:e.$t(`synchronization.scale`),step:.01,min:.01,container:e.$viewer.localContext.el},null,8,[`modelValue`,`label`,`container`])])])]),H(`section`,null,[H(`span`,null,F(e.$t(`synchronization.rotation`)),1),H(`div`,jEt,[U(o,{modelValue:e.angle,"onUpdate:modelValue":t[3]||=t=>e.angle=t,unit:`°`,centered:``},null,8,[`modelValue`]),U(s,{modelValue:e.angle,"onUpdate:modelValue":t[4]||=t=>e.angle=t,min:0,max:360},null,8,[`modelValue`])])]),H(`section`,null,[H(`span`,null,F(e.$t(`synchronization.alpha`)),1),H(`div`,MEt,[U(o,{modelValue:e.opacity,"onUpdate:modelValue":t[5]||=t=>e.opacity=t,centered:``},null,8,[`modelValue`]),U(s,{modelValue:e.opacity,"onUpdate:modelValue":t[6]||=t=>e.opacity=t,min:0,max:1,step:.01},null,8,[`modelValue`])])]),H(`section`,null,[H(`span`,null,F(e.$t(`synchronization.preview`)),1),H(`div`,NEt,[H(`img`,{src:r.bitmap.dataUrl,alt:`Background`},null,8,PEt),U(c,{text:r.bitmap.name,class:`synchronization__page__edit__content__img__name`},null,8,[`text`])])])]),H(`div`,FEt,[U(l,{width:`100%`,color:`primary`,fill:``,radius:``,onClick:r.submit},{default:L(()=>[W(F(r.bitmap&&r.bitmap.plan?e.$t(`global.save`):e.$t(`global.validate`)),1)]),_:1},8,[`onClick`])])])}var LEt={name:`BimdataSynchronization`,components:{edit:q(CEt,[[`render`,IEt],[`__scopeId`,`data-v-63e956d5`]])},setup(){let{localContext:e}=Xo(`$viewer`),t=Xo(`$plugin`),n=e.pluginComponentInstances.get(`plan`);if(!n)throw Error(`[Synchronization] plugin cannot work without viewerPlan plugin with 2d engine on.`);n=Fa(n),Yo(`viewerPlan`,n);let r=K(()=>e.loadedModels[0]);rs(r,e=>{!e||e.type!==`METABUILDING`?t.hide():t.show()},{immediate:!0}),rs(()=>t.shown,e=>{r.value?.type!==`METABUILDING`&&e&&t.hide()});let i=Ea({page:`edit`,loading:!1,modalDisplayed:!1,model:null,storeys:[],selectedStorey:null,plans:[],bitmaps:[],editedBitmap:null});Yo(`root`,i);let a=()=>{i.editedBitmap&&(i.bitmaps.map(e=>(e.edit(!1),e)).filter(e=>e.edited).forEach(e=>{let{x:t,y:r,scale:i,angle:a,plan:o}=e,s=o.plan.transform,c={translate:[t,r],rotate:a,scale:i};n.planObjectRegistry.updatePlanObjectsTransform(o,{oldTransform:c,newTransform:s}),e.reset()}),i.modalDisplayed=!1,n.storeyRightOffset=0,e.showUI(),document.removeEventListener(`keydown`,u),i.editedBitmap=null,i.bitmaps=[])},o=()=>{a(),t.close()};Yo(`close`,o);let s=()=>{i.bitmaps.some(e=>e.edited)?i.modalDisplayed=!0:o()},c=()=>{o()},l=e=>{i.editedBitmap=e},u=e=>{i.loading||e.key===`Escape`&&(e.preventDefault(),i.modalDisplayed?i.modalDisplayed=!1:o())},d=e.hub.on(`model-loaded`,({model:e})=>{i.model=e,i.storeys=e.storeys,i.plans=e.storeys.flatMap(e=>e.plans)},{getLastEvent:!0}),f=e.hub.on(`storey-selected`,({storey:e})=>{i.selectedStorey=e,(!e||e.plans.length<2)&&o()},{getLastEvent:!0});return Ec(()=>{e.hub.off(d),e.hub.off(f)}),rs(()=>i.editedBitmap,(e,t)=>{t?.edit(!1),e?.edit(!0)},{immediate:!0}),{viewerPlan:n,root:i,onBitmapClick:l,onCloseClick:s,onLeaveClick:c,onKeyDown:u,clean:a}},async onOpen(){this.$viewer.localContext.pluginComponentInstances.forEach(e=>{e!==this&&e.$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(e=>e.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(e=>!e.visible).forEach(e=>{this.$viewer.localContext.showPlan(e.plan),e.show()}),this.viewerPlan.$refs.storeySelector?.focus()},onClose(){this.clean()}},REt={class:`bimdata-synchronization`},zEt={class:`bimdata-synchronization__header`},BEt={class:`bimdata-synchronization__header__top`},VEt={class:`bimdata-synchronization__header__top__title`},HEt={class:`bimdata-synchronization__header__top__title__text`},UEt={class:`bimdata-synchronization__header__select__header`},WEt={class:`bimdata-info-length bimdata-synchronization__header__select__header__length`},GEt={class:`bimdata-synchronization__page`},KEt={key:1,class:`bimdata-synchronization__modal`},qEt={class:`bimdata-synchronization__modal__content`},JEt={class:`bimdata-synchronization__modal__content__symbols`},YEt={class:`bimdata-synchronization__modal__content__buttons`};function XEt(e,t,n,r,i,a){let o=R(`BIMDataLoading`),s=R(`BIMDataIconSynchro2D`),c=R(`BIMDataIconClose`),l=R(`BIMDataButton`),u=R(`BIMDataTextbox`),d=R(`BIMDataDropdownList`),f=R(`BIMDataIconWarning`);return z(),B(`div`,REt,[r.root.loading?(z(),V(o,{key:0})):G(``,!0),H(`div`,zEt,[H(`div`,BEt,[H(`div`,VEt,[U(s,{size:`xs`,fill:``,color:`primary`}),H(`span`,HEt,F(e.$t(`synchronization.title`)),1)]),U(l,{class:`bimdata-synchronization__header__top__close`,width:`25px`,height:`25px`,ghost:``,radius:``,icon:``,onClick:r.onCloseClick},{default:L(()=>[U(c,{size:`xs`,fill:``,color:`granite-light`})]),_:1},8,[`onClick`])]),H(`div`,null,[U(d,{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:L(()=>[H(`div`,UEt,[H(`div`,WEt,[H(`span`,null,F(r.root.bitmaps.length),1)]),H(`div`,null,[U(u,{width:`265px`,text:r.root.editedBitmap?.name},null,8,[`text`])])])]),element:L(({element:e})=>[H(`div`,{class:P([`bimdata-synchronization__header__select__element`,{"bimdata-synchronization__header__select__element--selected":e===r.root.editedBitmap}])},F(e.name),3)]),_:1},8,[`list`,`onElementClick`])])]),H(`div`,GEt,[(z(),V(dc,null,[(z(),V(Pc(r.root.page)))],1024))]),r.root.modalDisplayed?(z(),B(`div`,KEt,[H(`div`,qEt,[H(`div`,JEt,[U(f,{fill:``,color:`high`,size:`l`}),H(`div`,null,F(e.$t(`synchronization.warning`)),1)]),H(`div`,YEt,[U(l,{width:`45%`,color:`high`,fill:``,radius:``,onClick:r.onLeaveClick},{default:L(()=>[W(F(e.$t(`synchronization.leave`)),1)]),_:1},8,[`onClick`]),U(l,{width:`45%`,color:`default`,outline:``,radius:``,onClick:t[0]||=e=>r.root.modalDisplayed=!1},{default:L(()=>[W(F(e.$t(`synchronization.stay`)),1)]),_:1})])])])):G(``,!0)])}var ZEt={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ählen`,import_file:`Eine Datei importieren`,location:`Position`,scale:`Skala`,rotation:`Rotation`,alpha:`Undurchsichtigkeit`,preview:`Übersicht`,import:`Ein Element importieren`,from_ged:`Von der DMS des Projekts aus`,from_computer:`Von Ihrem Computer aus`,no_storey:`Um einen Hintergrund hinzuzufügen, wählen Sie bitte eine IFC und eine Etage aus.`,no_ifc:`Um einen Hintergrund hinzuzufügen, wählen Sie bitte eine IFC aus.`,warning:`Möchten Sie diese Seite wirklich verlassen? Sie enthält möglicherweise Informationen, die nicht bestätigt 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ón 2D`,title:`Sincronización 2D`,start:`Comenzar`,description:`Lorem ipsum dolor sit amet, consectetur adipiscing elit.`,select_storey:`Seleccionar una planta`,import_file:`Importar un fichero`,location:`Posición`,scale:`Escala`,rotation:`Rotación`,alpha:`Opacidad`,preview:`Vista rápida`,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:`¿Esta usted seguro de que quiere abandonar esta página? Puede haber informaciones no validadas.`,leave:`Sí, abandonar la página`,stay:`Cancelar, permanecer aquí`},fr:{tooltip:`Synchronisation 2D`,title:`Synchronisation 2D`,start:`Commencer`,description:`Lorem ipsum dolor sit amet, consectetur adipiscing elit.`,select_storey:`Sélectionner un étage`,import_file:`Importer un fichier`,location:`Position`,scale:`Echelle`,rotation:`Rotation`,alpha:`Opacité`,preview:`Aperçu`,import:`Importer un élément`,from_ged:`Depuis la GED du projet`,from_computer:`Depuis votre ordinateur`,no_storey:`Pour ajouter un fond, veuillez selectionner un IFC et un étage.`,no_ifc:`Pour ajouter un fond, veuillez selectionner un IFC.`,warning:`Êtes-vous sûr de vouloir quitter cette page ? Il y'a peut-être des informations non validées.`,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à`,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 è sicuri di voler lasciare questa pagina? È possibile che alcune informazioni non siano state ancora convalidate.`,leave:`Sì, uscire da questa pagina`,stay:`Annulla, rimanere a questa pagina`}},component:q(LEt,[[`render`,XEt],[`__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`}}},QEt={name:`anchor-synchronization`,i18n:{de:AD,en:jD,es:MD,fr:ND,it:PD},i18nTokenPrefix:`viewer2d-background`,addToWindows:[`2d`],component:kD,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`}}},$Et={},eDt={width:`17`,height:`18`,viewBox:`0 0 17 18`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`};function tDt(e,t){return z(),B(`svg`,eDt,[...t[0]||=[Lu(`<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 nDt=q($Et,[[`render`,tDt]]),rDt={class:`bimdata-anchor-synchronization__header`},iDt={class:`bimdata-anchor-synchronization__header__texts`},aDt={class:`bimdata-anchor-synchronization__header__texts__title`},oDt={class:`bimdata-anchor-synchronization__header__buttons`},sDt=q({__name:`AnchorSynchronizationHeader`,setup(e){let t=Xo(`$viewer`),n=Xo(`state`),r=Xo(`service`),i=K(()=>n.allAnchorsValidated),a=I(!1),o=null;t.globalContext.hub.once(`anchor-synchronization:open`,(e=null)=>{o=e},{getLastEvent:!0});let s=()=>{t.globalContext.layout=o},c=async()=>{a.value=!0,await r.saveAnchors(),t.globalContext.layout=o};return(e,t)=>{let n=R(`BIMDataButton`),r=R(`BIMDataSpinner`);return z(),B(`div`,rDt,[H(`div`,iDt,[U(nDt,{class:`m-x-6`}),H(`span`,aDt,F(e.$t(`anchor-synchronization-window.title`)),1)]),H(`div`,oDt,[U(n,{color:`high`,fill:``,radius:``,class:`m-x-6`,width:`120px`,onClick:s},{default:L(()=>[W(F(e.$t(`global.cancel`)),1)]),_:1}),U(n,{color:`primary`,fill:``,radius:``,class:`m-x-6`,width:`120px`,disabled:!i.value,onClick:c},{default:L(()=>[a.value?(z(),V(r,{key:0})):(z(),B(bu,{key:1},[W(F(e.$t(`global.done`)),1)],64))]),_:1},8,[`disabled`])])])}}},[[`__scopeId`,`data-v-a7ce6c34`]]),cDt={class:`anchor-content`},lDt={class:`anchor-label`},$Z={__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 n=e,r={x:n.isSecondAnchor?`70px`:`20px`,y:`90%`},i=K(()=>n.position?{x:n.position.x+`px`,y:n.position.y+`px`}:r),a=t,o=I(!1),s=I(null);function c(e){o.value=!0,s.value?.setPointerCapture(e.pointerId),e.preventDefault()}function l(e){if(!o.value)return;let t=n.position;if(!t){let{x:e,y:n}=s.value.getBoundingClientRect(),{x:r,y:i}=s.value.parentElement.getBoundingClientRect();t={x:e-r+15,y:n-i+51}}a(`change`,{x:t.x+e.movementX,y:t.y+e.movementY})}function u(e){o.value&&s.value&&s.value?.releasePointerCapture(e.pointerId),o.value=!1,a(`validate`)}return Ec(()=>{o.value=!1}),(t,n)=>(z(),B(`div`,{class:`bimdata-anchor-synchronization__anchor`,style:N({left:i.value.x,top:i.value.y,color:e.color,cursor:o.value?`none`:`grab`}),onPointerdown:c,onPointermove:l,onPointerup:u,ref_key:`anchorElement`,ref:s},[H(`div`,cDt,[n[0]||=H(`svg`,{width:`30`,height:`60`,viewBox:`0 0 30 60`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[H(`rect`,{x:`14`,y:`42`,width:`2`,height:`18`,fill:`currentColor`}),H(`rect`,{x:`24`,y:`50`,width:`2`,height:`18`,transform:`rotate(90 24 50)`,fill:`currentColor`}),H(`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),H(`div`,lDt,F(e.isSecondAnchor?2:1),1)])],36))}},eQ=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2}),tQ=(e,t)=>Math.hypot(t.x-e.x,t.y-e.y),nQ=(e,t)=>Math.atan2(t.y-e.y,t.x-e.x),uDt=(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 rQ(e){let{anchorA1Position:t,anchorA2Position:n,anchorB1Position:r,anchorB2Position:i,model:a,modelToSynchronize:o}=e;if(!a||!o)throw Error(`[BIMDataViewer - AnchorSynchronization] Models are mandatory to calculate transform.`);let{translate:s,rotate:c,scale:l}=o.transform??eE.IDENTITY,u=tQ(t,n)/tQ(r,i)*l,d=nQ(t,n),f=(nQ(r,i)-d)*(180/Math.PI)*-1,p=c+f,m=eQ(t,n),h=eQ(r,i),g=uDt({x:h.x-s[0],y:h.y-s[1]},f*Math.PI/180),_={x:g.x/l*u,y:g.y/l*u};return{scale:u,rotate:p,translate:[m.x-_.x,m.y-_.y,0]}}var dDt={class:`bimdata-viewer-ifc-2d`,ref:`canvasContainer`},fDt=q({__name:`ViewerIfc2D`,props:{model:{type:Object,default:null},storeyIndex:{type:Number,default:0}},emits:[`camera-update`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=Xo(`$viewer`),o=Xo(`state`),s=I(null),c=null,l=null,u=null,{promise:d,resolve:f,reject:p}=Promise.withResolvers(),m=()=>{l=VT({canvas:s.value}),l.styles.default.lineWidth=.01,l.settings.rotateSpeed=.05,l.settings.snapMargin=.04,l.settings.minScale=10,l.textureManager.textureMatrix.scale(.01,.01);let{camera:e}=l;e.on(`update`,()=>{i(`camera-update`,e)});let t={engine:l,viewer:l,$viewer:a};c=ZE(t),u=new jE(t)};Sc(()=>{try{m()}catch(e){p(e)}f()});let h=(e,t)=>{let n=e.storeys[t];if(!n)return;let r=n.objects.map(e=>String(e.id));l.scene.showObjects(r)},g=async e=>{await d,await c(e.map_file,e.id);let t=l.scene.objects.map(e=>e.id);if(l.scene.hideObjects(t),h(e,r.storeyIndex),e.recommanded_2d_angle!==void 0){let t=l.camera.rotation;l.camera.rotate(-t-e.recommanded_2d_angle)}l.camera.fitView()};rs(()=>r.model,async e=>{e&&await g(e)},{immediate:!0});let _=!1;return t({getWorldPosition(e){return l.camera.getPosition(e)},get canvas(){return s.value},async showPlan(e){if(_)return;let t=await u.showPlan(e),n=t.mask?.crop_path,r={opacity:.5,crop_path:n};t.tempMask=r,_=!0;let i={translate:[t.x,t.y],scale:t.scale,rotate:t.angle},{anchorA1Position:a,anchorA2Position:s,anchorB1Position:c,anchorB2Position:l}=Ya(o);rs([a,s,c,l],()=>{let e=rQ(o);n?.length>0&&(r.crop_path=iE(iE(n,i,{inverse:!0}),e)),t.x=e.translate[0],t.y=e.translate[1],t.scale=e.scale,t.angle=e.rotate},{immediate:!0})}}),(e,t)=>(z(),B(`div`,dDt,[H(`canvas`,{ref_key:`canvasElement`,ref:s,style:{width:`100%`,height:`100%`,position:`absolute`}},null,512)],512))}},[[`__scopeId`,`data-v-c0725497`]]),pDt={__name:`ViewerImage`,props:{model:{type:Object,default:null}},emits:[`camera-update`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=()=>{let{camera:e}=o.value.viewer;e.on(`update`,()=>{i(`camera-update`,e)})},o=I(null),{promise:s,resolve:c}=Promise.withResolvers();rs(()=>r.model,async e=>{await s,e&&(o.value.loadModels([e]),o.value.viewer.renderer.offset.dx===0&&o.value.viewer.renderer.offset.dy===0&&(o.value.viewer.renderer.offset={dx:-e.transform.translate[0],dy:-e.transform.translate[1]}))},{immediate:!0}),Sc(()=>{c()});let l=Ta({get loadedModels(){return r.model?[r.model]:[]},get selectedStorey(){return null}});return t({getWorldPosition(e){return o.value.engine.camera.getPosition(e)},get canvas(){return o.value.engine.canvas}}),(e,t)=>(z(),V(aY,{ref_key:`viewerPlan`,ref:o,stateContext:l,onMounted:a},null,8,[`stateContext`]))}},mDt={class:`bimdata-anchor-synchronization__viewer`},hDt={class:`viewer-container-A`},gDt={class:`viewer-container-B`},_Dt=q({__name:`AnchorSynchronizationViewer`,setup(e,{expose:t}){let n=I(null),r=I(null),i=Xo(`state`),a=(e,t)=>{t.preventDefault();let i=e===`A`?n.value:r.value;i&&xD(i.canvas)(t)},o=I(null),s=I(null),c=I(null),l=I(null),u={anchorA1Position:o,anchorA2Position:s,anchorB1Position:c,anchorB2Position:l},d=(e,t)=>{(e===`A`?[`anchorA1Position`,`anchorA2Position`].filter(e=>u[e].value!==null):[`anchorB1Position`,`anchorB2Position`].filter(e=>u[e].value!==null)).forEach(e=>{let n=i[e];u[e].value=t.getCanvasPosition(n)})},f=(e,t)=>{let a=e.startsWith(`A`)?n.value:r.value,o=`anchor${e}Position`;i[o]=a.getWorldPosition(t),u[o].value=t},p=za(null),m=I(0),h=za(null),g=rs(()=>i.allAnchorsValidated,e=>{if(!e)return;let t={plan:h.value,storey:{}};n.value.showPlan(t),g()}),_=e=>{if(!e)return null;let t=e.type;switch(t){case`IFC`:return fDt;case`PNG`:case`JPEG`:case`PDF`:case`PHOTOSPHERE`:return pDt;default:throw Error(`[BIMData AnchorSynchronizationViewer] Unsupported model type: ${t}`)}},v=async(e,t,n)=>{p.value=e;let r=e.storeys.findIndex(e=>e.uuid===t.uuid);if(r===-1)throw Error(`[BIMData AnchorSynchronizationViewer] Storey not found in main model.`);m.value=r,h.value=n},y=()=>{i.allAnchorsValidated||o.value&&s.value&&c.value&&l.value&&(i.allAnchorsValidated=!0)};return t({synchronize:v}),(e,t)=>(z(),B(`div`,mDt,[H(`div`,hDt,[(z(),V(Pc(_(p.value)??`div`),{model:p.value,ref_key:`viewerA`,ref:n,onCameraUpdate:t[0]||=e=>d(`A`,e),storeyIndex:m.value},null,40,[`model`,`storeyIndex`])),p.value?(z(),B(bu,{key:0},[U($Z,{onChange:t[1]||=e=>f(`A1`,e),onValidate:y,position:o.value,onWheel:t[2]||=e=>a(`A`,e)},null,8,[`position`]),U($Z,{onChange:t[3]||=e=>f(`A2`,e),onValidate:y,position:s.value,onWheel:t[4]||=e=>a(`A`,e),isSecondAnchor:!0},null,8,[`position`])],64)):G(``,!0)]),H(`div`,gDt,[(z(),V(Pc(_(h.value)??`div`),{model:h.value,ref_key:`viewerB`,ref:r,onCameraUpdate:t[5]||=e=>d(`B`,e)},null,40,[`model`])),h.value?(z(),B(bu,{key:0},[U($Z,{onChange:t[6]||=e=>f(`B1`,e),onValidate:y,position:c.value,onWheel:t[7]||=e=>a(`B`,e)},null,8,[`position`]),U($Z,{onChange:t[8]||=e=>f(`B2`,e),onValidate:y,position:l.value,onWheel:t[9]||=e=>a(`B`,e),isSecondAnchor:!0},null,8,[`position`])],64)):G(``,!0)])]))}},[[`__scopeId`,`data-v-3947e679`]]),vDt=class{state;$viewer;constructor(e,t){this.$viewer=e,this.state=t}async saveAnchors(){let{state:e}=this.$viewer,{model:t,storey:n,modelToSynchronize:r}=this.state;if(!t||!r||!n)throw Error(`[BIMDataViewer - AnchorSynchronization] Models and storey are mandatory to save anchors.`);let i=rQ(this.state),a=n.plans.find(e=>e.plan.id===r.id);try{if(a){let t={...r.transform};a.plan.transform=i,await e.updatePlan(a,t)}else await e.createPlan(t,n,r.document,i)}catch(e){throw console.error(`[BIMDataViewer - Anchor Synchronization Service] Failed to save anchors:`,e),e}}},yDt=class{model=null;storey=null;modelToSynchronize=null;anchorA1Position=null;anchorA2Position=null;anchorB1Position=null;anchorB2Position=null;allAnchorsValidated=!1;constructor(){return Ta(this)}},bDt={components:{AnchorSynchronizationHeader:sDt,AnchorSynchronizationViewer:_Dt},setup(){let e=I(null),t=new yDt;return Yo(`state`,t),Yo(`service`,new vDt(Xo(`$viewer`),t)),{viewer:e,synchronize:(n,r,i)=>(t.model=n,t.storey=r,t.modelToSynchronize=i,e.value.synchronize(n,r,i)),positioned:I(!1)}}},xDt={class:`bimdata-anchor-synchronization`};function SDt(e,t,n,r,i,a){let o=R(`AnchorSynchronizationHeader`),s=R(`AnchorSynchronizationViewer`);return z(),B(`div`,xDt,[U(o,{valid:r.positioned},null,8,[`valid`]),U(s,{class:`bimdata-anchor-synchronization__content__viewer`,ref:`viewer`,onPositioned:t[0]||=e=>r.positioned=!0})])}var CDt={name:`anchor-synchronization-window`,i18n:{en:{title:`Synchronization`},fr:{title:`Synchronisation`}},component:q(bDt,[[`render`,SDt],[`__scopeId`,`data-v-7f15ad3b`]]),window:{name:`anchor-synchronization`,header:!1,displayedInWindowSelector:!1,multiModel:!1}},wDt={name:`PointCloudViewer`,components:{Annotations:MK},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=kK},mounted(){let e=new OV({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 QV(e,{originatingSystem:`BIMDataViewer/v1.0`,authoringTool:`BIMData.io`}),this.distanceMeasurementsPlugin=new cH(e,{defaultAxisVisible:!1,container:this.$el,zIndex:0}),this.angleMeasurementsPlugin=new IV(e,{container:this.$el,zIndex:0}),this.tilesetLoaderPlugin=new OK(e,{sensitivity:this.sensitivity,debugMode:!1}),this.navCubeVisible&&(this.navCube=new IG(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(e=>!this.loadedModels.some(t=>t.id===e.id)));let{apiUrl:t,cloudId:n,projectId:r,accessToken:i}=this.$viewer.api;e.forEach(async(e,a)=>{try{this.$viewer.localContext.loadingProcessStart();let o=await(await fetch(`${t}/cloud/${n}/project/${r}/model/${e.id}/tileset?tile_format=xkt`,{headers:new Headers({Authorization:`Bearer ${i}`})})).json();o.name=String(e.id);let s=this.tilesetLoaderPlugin.load(o);this.tilesets.set(e,s);let c={model:e,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(t){console.error(`Error while loading Tileset `,e.id,`with error: `,t),this.loadedModels=this.loadedModels.filter(t=>t.id!==e.id)}finally{this.$viewer.localContext.loadingProcessEnd(),this.loading=!1}}),this.loadedModels.length>0&&this.navCube?.setVisible(!0)},unloadModels(e){let t=e.map(e=>this.tilesets.get(e)).filter(Boolean);e.forEach(e=>this.tilesets.delete(e)),t.forEach(e=>e.destroy()),this.loadedModels=this.loadedModels.filter(t=>!e.find(e=>e.id===t.id)),e.forEach(e=>{let t={model:e,plugin:this};this.$viewer.localContext.hub.emit(`pointcloud-model-unloaded`,t),this.$viewer.globalContext.hub.emit(`pointcloud-model-unloaded`,t)}),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(e=>e.id),e},async setViewpoint(e,{immediate:t=!1,duration:n=.3}={}){if(this.loading){this.viewpointPending=!0;let e=null;await new Promise(t=>{e=this.$watch(`loading`,e=>{e||t()},{immediate:!0})}),e(),this.viewpointPending=!1}await new Promise(e=>setTimeout(e,200)),this.bcfViewpointsPlugin.setViewpoint(e,{rayCast:!1,immediate:t,duration:n})},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`,t=>{let n=this.xeokit.scene.pick({pickSurface:!0,canvasPos:t});if(n){let[t,r,i]=n.worldPos;e({x:t,y:i,z:r,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}}},TDt={class:`bimdata-viewer-point-cloud`},EDt={ref:`header`,class:`bimdata-viewer-point-cloud__header`},DDt={ref:`bimdata-xeokit-navcube-canvas`,class:`bimdata-viewer-point-cloud__nav-cube`},ODt=[`id`];function kDt(e,t,n,r,i,a){let o=R(`NoModelWindowPlaceHolder`),s=R(`ModelsLoader`),c=R(`Annotations`);return z(),B(`div`,TDt,[i.loadedModels.length===0?(z(),V(o,{key:0})):G(``,!0),H(`div`,EDt,[i.settings.modelLoader===`disabled`?G(``,!0):qo((z(),V(s,{key:0,"window-positioning":!1,preview:``},null,512)),[[Wd,i.modelHeaderShown]])],512),H(`canvas`,{ref:`bimdata-xeokit-canvas`,class:`bimdata-viewer-point-cloud__viewer`,onWheel:t[0]||=Rf(()=>{},[`prevent`])},null,544),i.xeokitCreated?(z(),V(c,{key:1})):G(``,!0),qo(H(`canvas`,DDt,null,512),[[Wd,i.navCubeVisible]]),H(`div`,{id:i.spinnerCanvasId},null,8,ODt)])}var ADt={name:`pointCloud`,isViewer:!0,component:q(wDt,[[`render`,kDt],[`__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`}}},iQ=`viewer-point-cloud-parameters_parameters`,jDt={computed:{viewer(){let e=this.$viewer.localContext.pluginComponentInstances.get(`pointCloud`);if(e)return e;{let e=`'Viewer Point Cloud Parameters' plugin cannot work without Viewer Point Cloud plugin.`;throw console.error(e),Error(e)}},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(iQ)||`{}`;e=JSON.parse(t)}catch{localStorage.removeItem(iQ)}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(iQ,JSON.stringify(t))}}},MDt={class:`viewer-point-cloud-parameters`},NDt={class:`viewer-point-cloud-parameters_header`},PDt={class:`viewer-point-cloud-parameters_content`},FDt={class:`m-b-18`},IDt={class:`flex justify-between`},LDt={class:`viewer-point-cloud-parameters_content__value`},RDt={class:`flex justify-between`},zDt={class:`viewer-point-cloud-parameters_content__value`};function BDt(e,t,n,r,i,a){let o=R(`BIMDataIconParameters`),s=R(`BIMDataSlider`);return z(),B(`div`,MDt,[H(`div`,NDt,[U(o,{size:`xs`,margin:`0 12px 0 0`}),H(`span`,null,F(e.$t(`pointCloudParameters.title`)),1)]),H(`div`,PDt,[H(`div`,FDt,[H(`div`,IDt,[H(`span`,null,F(e.$t(`pointCloudParameters.sensitivity`)),1),H(`span`,LDt,F(a.sensitivity),1)]),U(s,{modelValue:a.sensitivity,"onUpdate:modelValue":t[0]||=e=>a.sensitivity=e,min:20,max:1e3},null,8,[`modelValue`])]),H(`div`,null,[H(`div`,RDt,[H(`span`,null,F(e.$t(`pointCloudParameters.fov`)),1),H(`span`,zDt,F(a.fov),1)]),U(s,{modelValue:a.fov,"onUpdate:modelValue":t[1]||=e=>a.fov=e,min:20,max:120},null,8,[`modelValue`])])])])}var VDt={name:`pointCloudParameters`,i18n:{en:{tooltip:`Parameters`,title:`Point Cloud Viewer settings`,sensitivity:`Sensitivity`,fov:`Field of view`},fr:{tooltip:`Paramètres`,title:`Paramètres du nuage de points`,sensitivity:`Sensibilité`,fov:`Angle de vision`}},addToWindows:[`pointCloud`],component:q(jDt,[[`render`,BDt],[`__scopeId`,`data-v-e97be8b2`]]),button:{tooltip:`pointCloudParameters.tooltip`,position:`right`,content:`simple`,icon:{component:`BIMDataIconParameters`,options:{size:`m`}}}},aQ=class{constructor(e,t,n=null,r=!0){this.name=e,this.icon=t,this.group=n,this.label=`drawing-tools.action.${e}`,this.lineStyleComponentDisplayed=r}onActivate(){throw Error(`Not implemented`)}onDeactivate(){throw Error(`Not implemented`)}},HDt={},UDt={width:`18`,height:`18`,viewBox:`0 0 22 22`,xmlns:`http://www.w3.org/2000/svg`};function WDt(e,t){return z(),B(`svg`,UDt,[...t[0]||=[H(`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 GDt=q(HDt,[[`render`,WDt]]),KDt=class{constructor(){this._listenersTarget=new Map}on(e,t,n=window,r={}){this._listenersTarget.has(n)||this._listenersTarget.set(n,new Map);let i=this._listenersTarget.get(n);i.has(e)||i.set(e,new Map);let a=t.bind(this);return r?.once&&(a=(...r)=>{t.call(this,...r),this.off(e,t,n)}),n.addEventListener(e,a,r),i.get(e).set(t,a),()=>{this.off(e,t,n)}}off(e,t,n=window){if(!this._listenersTarget.has(n))return;let r=this._listenersTarget.get(n);if(!r.has(e))return;let i=r.get(e).get(t);n.removeEventListener(e,i),r.get(e).delete(t),r.get(e).size===0&&r.delete(e),r.size===0&&this._listenersTarget.delete(n)}},qDt=`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`,JDt=`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`,YDt=`url("${qDt}") 0 20, auto`,XDt=`url("${JDt}") 1 23, auto`,oQ=class extends KDt{constructor(e,{pointerUpCursor:t=YDt,pointerDownCursor:n=XDt,element:r=e.canvas}={}){super(),this._engine2d=e,this.element=r,this.pointerUpCursor=t,this.pointerDownCursor=n,this._eventCache=[]}_getClientPosition(e){return{clientX:e.clientX,clientY:e.clientY}}_getPositions(e){let{clientX:t,clientY:n}=this._getClientPosition(e),{x:r,y:i}=this._engine2d.canvas.getBoundingClientRect();return this._engine2d.camera.getPosition({x:Math.max(t-r,0),y:Math.max(n-i,0)})}_getCanvasPosition(e){let{clientX:t,clientY:n}=this._getClientPosition(e),{x:r,y:i}=this.element.getBoundingClientRect();return{x:Math.max(t-r,0),y:Math.max(n-i,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,n=!e.isPrimary,r=this._eventCache.length>1;e.shiftKey||t||n||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()}},sQ=`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`,ZDt=class extends aQ{constructor({viewer:e},t){super(`pointer`,GDt,`pointers`,!1),this._pointerManager=new QDt(e,t)}onActivate(){this._pointerManager.enable()}onDeactivate(){this._pointerManager.disable()}},QDt=class extends oQ{constructor(e,t){super(e,{pointerUpCursor:sQ,pointerDownCursor:sQ,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:n}){if(!this._currentDrawing)return;let r=0,i=0;if(window.TouchEvent&&t instanceof TouchEvent){let e=t.touches[0];this.previousTouch&&(r=e.pageX-this.previousTouch.pageX,i=e.pageY-this.previousTouch.pageY),this.previousTouch=e}else{let{movementX:e,movementY:n}=t;r=e,i=n}let a={x:n.x-r,y:n.y-i},o=this._engine2d.camera.getPosition(a),s=e.x-o.x,c=e.y-o.y;this._currentDrawing.x+=s,this._currentDrawing.y+=c}},$Dt={},eOt={width:`14`,height:`16`,viewBox:`0 0 14 16`,xmlns:`http://www.w3.org/2000/svg`};function tOt(e,t){return z(),B(`svg`,eOt,[...t[0]||=[H(`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 nOt=q($Dt,[[`render`,tOt]]),rOt=`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`,iOt=`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`,aOt=`url("${rOt}") 7 23, auto`,oOt=`url("${iOt}") 7 18, auto`,sOt=class extends aQ{constructor({viewer:e}){super(`pan`,nOt,`pointers`,!1),this._pointerManager=new cOt(e)}onActivate(){this._pointerManager.enable()}onDeactivate(){this._pointerManager.disable()}},cOt=class extends oQ{constructor(e){super(e,{pointerUpCursor:aOt,pointerDownCursor:oOt}),this.previousTouch=null}onDrag({mouseEvent:e}){let t=0,n=0;if(window.TouchEvent&&e instanceof TouchEvent){let r=e.touches[0];this.previousTouch&&(t=r.pageX-this.previousTouch.pageX,n=r.pageY-this.previousTouch.pageY),this.previousTouch=r}else{let{movementX:r,movementY:i}=e;t=r,n=i}this._engine2d.camera.translate(-t*window.devicePixelRatio,-n*window.devicePixelRatio)}onMouseUp(){this.previousTouch=null}},cQ=class extends aQ{constructor(e,t,n,r,i,a=n){super(n,r,i),this._pointermanager=new lOt(e,t,a)}onActivate(){this._pointermanager.enable()}onDeactivate(){this._pointermanager.disable()}},lOt=class extends oQ{constructor(e,t,n){super(e),this._drawer=t,this._currentDrawing=null,this.shape=n}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)}},uOt={},dOt={width:`18`,height:`18`,viewBox:`0 0 22 22`,xmlns:`http://www.w3.org/2000/svg`};function fOt(e,t){return z(),B(`svg`,dOt,[...t[0]||=[H(`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 pOt=q(uOt,[[`render`,fOt]]),mOt=class extends cQ{constructor({viewer:e},t){super(e,t,`pen`,pOt,null,`freehand`)}},hOt={},gOt={width:`22`,height:`22`,viewBox:`0 0 22 23`,xmlns:`http://www.w3.org/2000/svg`};function _Ot(e,t){return z(),B(`svg`,gOt,[...t[0]||=[H(`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 vOt=q(hOt,[[`render`,_Ot]]),yOt=`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`,bOt=class extends aQ{constructor(e,t){super(`text`,vOt,null,!1),this._viewerPlanPlugin=e,this._drawer=t,this.canvas=e.engine.canvas;let n=I(!1);this.autoDeactivateCallback=null,this.connector={enabledRef:n,deactivateAction(){this.autoDeactivateCallback?.()}},this.onClick=n=>{this.autoDeactivateCallback();let{x:r,y:i}=e.viewer.camera.getPosition({x:n.offsetX,y:n.offsetY});t.makeDrawing(`text`,{x:r,y:i})}}onActivate(e){this.canvas.addEventListener(`click`,this.onClick),this._viewerPlanPlugin.$viewer.localContext.el.style.cursor=yOt,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}},xOt={},SOt={width:`16`,height:`16`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`};function COt(e,t){return z(),B(`svg`,SOt,[...t[0]||=[H(`path`,{"fill-rule":`evenodd`,"clip-rule":`evenodd`,d:`M0 0H16V16H0V0ZM2 2V14H14V2H2Z`},null,-1)]])}var wOt=q(xOt,[[`render`,COt]]),TOt=class extends cQ{constructor({viewer:e},t){super(e,t,`rectangle`,wOt,`shapes`)}},EOt={},DOt={width:`16`,height:`16`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`};function OOt(e,t){return z(),B(`svg`,DOt,[...t[0]||=[H(`path`,{"fill-rule":`evenodd`,"clip-rule":`evenodd`,d:`M16 1.37853L1.37853 16L0 14.6215L14.6215 0L16 1.37853Z`},null,-1)]])}var kOt=q(EOt,[[`render`,OOt]]),AOt=class extends cQ{constructor({viewer:e},t){super(e,t,`line`,kOt,`shapes`)}},jOt={},MOt={width:`17`,height:`17`,viewBox:`0 0 17 17`,xmlns:`http://www.w3.org/2000/svg`};function NOt(e,t){return z(),B(`svg`,MOt,[...t[0]||=[H(`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 POt=q(jOt,[[`render`,NOt]]),FOt=class extends cQ{constructor({viewer:e},t){super(e,t,`arrow`,POt,`shapes`)}},IOt={},LOt={width:`17`,height:`17`,viewBox:`0 0 17 17`,xmlns:`http://www.w3.org/2000/svg`};function ROt(e,t){return z(),B(`svg`,LOt,[...t[0]||=[H(`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 zOt=q(IOt,[[`render`,ROt]]),BOt=class extends cQ{constructor({viewer:e},t){super(e,t,`ellipse`,zOt,`shapes`)}},VOt={name:`EraserIcon`,props:{color:{type:String,default:`currentColor`}}},HOt=[`fill`];function UOt(e,t,n,r,i,a){return z(),B(`svg`,{width:`20`,height:`20`,viewBox:`0 0 22 22`,fill:n.color,xmlns:`http://www.w3.org/2000/svg`},[...t[0]||=[H(`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,HOt)}var WOt=q(VOt,[[`render`,UOt]]),GOt=`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`,KOt=`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`,qOt=`url("${GOt}") 7 23, auto`,JOt=`url("${KOt}") 7 18, auto`,YOt=class extends aQ{constructor({viewer:e},t){super(`eraser`,WOt,null,!1),this._pointerManager=new XOt(e,t)}onActivate(){this._pointerManager.enable()}onDeactivate(){this._pointerManager.disable()}},XOt=class extends oQ{constructor(e,t){super(e,{element:e.canvas.parentElement,pointerUpCursor:qOt,pointerDownCursor:JOt}),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)}},lQ=class{constructor(e){this.drawingType=e}parse(e){throw Error(`Not implemented`)}toString(e){throw Error(`Not implemented`)}},ZOt=class extends lQ{constructor(){super(`rectangle`)}toString(e){let{p1:t,p2:n,p3:r,p4:i,lineColor:a,lineWidth:o}=e;return`<path d="M ${t.x} ${t.y} L ${n.x} ${n.y} L ${r.x} ${r.y} L ${i.x} ${i.y} Z" stroke-width="${o}" stroke="#${a.toString(16).padStart(6,0)}"/>`}parse(e){let t=e.querySelector(`path`),[,n,r,,i,a,,o,s,,c,l]=t.getAttribute(`d`).split(` `),u=t.getAttribute(`stroke`)?.substring(1),d=t.getAttribute(`stroke-width`);return{p1:{x:parseFloat(n),y:parseFloat(r)},p2:{x:parseFloat(i),y:parseFloat(a)},p3:{x:parseFloat(o),y:parseFloat(s)},p4:{x:parseFloat(c),y:parseFloat(l)},lineColor:parseInt(u,16),lineWidth:parseFloat(d)}}},QOt=class extends lQ{constructor(){super(`line`)}toString(e){let{p1:t,p2:n,lineWidth:r,lineColor:i}=e;return`<line x1="${t.x}" y1="${t.y}" x2="${n.x}" y2="${n.y}" stroke-width="${r}" stroke="#${i.toString(16).padStart(6,0)}"/>`}parse(e){let t=e.querySelector(`line`),n=t.getAttribute(`x1`),r=t.getAttribute(`y1`),i=t.getAttribute(`x2`),a=t.getAttribute(`y2`),o=t.getAttribute(`stroke`)?.substring(1),s=t.getAttribute(`stroke-width`);return{p1:{x:parseFloat(n),y:parseFloat(r)},p2:{x:parseFloat(i),y:parseFloat(a)},lineWidth:parseFloat(s),lineColor:parseInt(o,16)}}},$Ot=class extends lQ{constructor(){super(`arrow`)}toString(e){let{p1:t,p2:n,lineWidth:r,lineColor:i}=e;return`<line x1="${t.x}" y1="${t.y}" x2="${n.x}" y2="${n.y}" stroke-width="${r}" stroke="#${i.toString(16).padStart(6,0)}"/>`}parse(e){let t=e.querySelector(`line`),n=t.getAttribute(`x1`),r=t.getAttribute(`y1`),i=t.getAttribute(`x2`),a=t.getAttribute(`y2`),o=t.getAttribute(`stroke`)?.substring(1),s=t.getAttribute(`stroke-width`);return{p1:{x:parseFloat(n),y:parseFloat(r)},p2:{x:parseFloat(i),y:parseFloat(a)},lineWidth:parseFloat(s),lineColor:parseInt(o,16)}}};function uQ(e){if(e.length===0)return``;let t=e[0],n=`M ${t.x} ${t.y}`;for(let t=0;t<e.length;t++){let r=e[t];n+=` C ${r.cpX1} ${r.cpY1} ${r.cpX2} ${r.cpY2} ${r.toX} ${r.toY}`}return n}function dQ(e){let t=e.split(` `),n=t.shift();if(n!==`M`)throw Error(`svgPathStringToCurves: invalid svg path string. Must start with M, got "${n}"`);let r=parseFloat(t.shift()),i=parseFloat(t.shift()),a=[];for(;t.shift()===`C`;){let e=parseFloat(t.shift()),n=parseFloat(t.shift()),o=parseFloat(t.shift()),s=parseFloat(t.shift()),c=parseFloat(t.shift()),l=parseFloat(t.shift());a.push({type:`curve`,x:r,y:i,cpX1:e,cpY1:n,cpX2:o,cpY2:s,toX:c,toY:l}),r=c,i=l}return a}var ekt=class extends lQ{constructor(){super(`ellipse`)}toString(e){let{curve1:t,curve2:n,curve3:r,curve4:i,lineColor:a,lineWidth:o}=e;return`<path d="${uQ([t,n,r,i])} Z" stroke-width="${o}" stroke="#${a.toString(16).padStart(6,0)}" />`}parse(e){let t=e.querySelector(`path`),n=dQ(t.getAttribute(`d`)),r=t.getAttribute(`stroke`)?.substring(1),i=t.getAttribute(`stroke-width`);return{curves:n,lineColor:parseInt(r,16),lineWidth:parseFloat(i)}}},tkt=class extends lQ{constructor(){super(`text`)}toString(e){let{x:t,y:n,rotation:r,scale:i,text:a,size:o,color:s}=e;return`<text x="${t}" y="${n}" tranform="rotate(${r}) scale(${i})" font-size="${o}px" ${s?`color="#${s}"`:``}>${a}</text>`}parse(e){let t=e.querySelector(`text`),n=t.getAttribute(`x`),r=t.getAttribute(`y`),i=t.getAttribute(`tranform`).match(/rotate\((.*)\)/)?.[1]??0,a=t.getAttribute(`tranform`).match(/scale\((.*)\)/)?.[1]??1,o=t.textContent===`null`?null:t.textContent,s=t.getAttribute(`font-size`).slice(0,-2),c=t.getAttribute(`color`);return{x:parseFloat(n),y:parseFloat(r),rotation:parseFloat(i),scale:parseFloat(a),text:o,size:parseFloat(s),color:c?c.slice(1):null}}},nkt=class extends lQ{constructor(){super(`freehand`)}toString(e){let{curves:t,lineWidth:n,lineColor:r}=e,i=`stroke-width="${n}" stroke="#${r.toString(16).padStart(6,0)}"`;return`<path d="${uQ(t)}" ${i}/>`}parse(e){let t=e.querySelector(`path`),n=dQ(t.getAttribute(`d`)),r=t.getAttribute(`stroke`)?.substring(1),i=t.getAttribute(`stroke-width`);return{curves:n,lineWidth:parseFloat(i),lineColor:parseInt(r,16)}}},rkt=class{constructor(){this.drawingSvgParsers=new Map,[new ZOt,new QOt,new $Ot,new ekt,new nkt,new tkt].map(e=>this.drawingSvgParsers.set(e.drawingType,e))}parse(e){try{let t=new DOMParser().parseFromString(e.content,`image/svg+xml`),n=t.querySelector(`svg`).getAttribute(`type`),r=+t.querySelector(`svg`).getAttribute(`data-bimdata-elevation`),i=this.drawingSvgParsers.get(n);if(!i)throw TypeError(`No drawing parser for type ${n}`);let a=i.parse(t);return a.apiId=e.id,a.type=n,a.z=r,a}catch(t){console.warn(`[Drawing Tools - Parser] Error parsing drawing ${e.id}, ignored.`,t)}}toString(e){let{type:t,z:n}=e,r=this.drawingSvgParsers.get(t);if(!r)throw TypeError(`No drawing parser for type ${t}`);return`<svg type="${t}" data-bimdata-elevation="${n}" xmlns="http://www.w3.org/2000/svg">${r.toString(e)}</svg>`}},ikt=class{constructor(e){this._api=e,this._parser=new rkt,this.queue=QE()}async getDrawingsData(e){let{cloudId:t,projectId:n}=this._api;return(await this._api.apiClient.modelApi.getDrawings(t,e,n)).map(e=>this._parser.parse(e)).filter(Boolean)}save(e,t){let n=this._parser.toString(e);if(!n)return;let{cloudId:r,projectId:i}=this._api,a={content:n},o;o=e.apiId?async()=>{try{await this._api.apiClient.modelApi.updateDrawing(r,e.apiId,t,i,a)}catch(t){console.error(`Cannot update drawing of type: "${e.type}"`,t)}}:async()=>{try{e.apiId=(await this._api.apiClient.modelApi.createDrawing(r,t,i,a)).id}catch(t){console.error(`Cannot create drawing of type: "${e.type}"`,t)}},this.queue.push(o)}async delete(e,t){if(!e.apiId)return;let{cloudId:n,projectId:r}=this._api;try{await this._api.apiClient.modelApi.deleteDrawing(n,e.apiId,t,r)}catch(t){console.error(`Cannot delete drawing of type: "${e.type}"`,t)}}},fQ=class{constructor(e){this.drawingTypes=e}pick(e,t){throw Error(`Not implemented`)}},akt=class extends fQ{constructor(e){super([`rectangle`,`ellipse`,`arrow`,`line`,`freehand`]),this._engine2d=e}pick(e,t){let{canvasPosition:n}=t,r=this._engine2d.picker.pick(n);if(r)return e.get(r.id)}},okt=class extends fQ{constructor(){super([`text`])}pick(e,t){let{mouseEvent:n}=t,r=n.target;return e.get(r.id)}},pQ=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.`)}},mQ=class{constructor(e){this.drawingTypes=e}create(e,t){throw Error(`Not implemented`)}},skt=`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`,ckt=`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`,lkt=4,ukt=40,hQ=4,dkt=2,fkt={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 n=Xo(`$viewer`).localContext.viewer.viewer.canvas,r=I(e.newMarker),i=I(e.initText),a=I(e.initSize),o=I(e.initColor);rs(i,e=>t(`text-update`,e)),rs(a,e=>t(`size-update`,e)),rs(o,e=>t(`color-update`,e));let s=I(null),c=()=>s.value?.focus(),l=I(null),u=I(null),d=I(null);async function f(){if(!r.value)return;await ko();let{width:e}=l.value.getBoundingClientRect();u.value=e+12,d.value=1,await ko();let{scrollHeight:t}=s.value;d.value=t+2}rs([()=>e.scale,r,i,a],f);let p=()=>{e.textToolEnabled&&(r.value=!0)},m=e=>{e.key===`Escape`&&(r.value=!1)};rs(r,async e=>{t(`edit-update`,e),e?(document.addEventListener(`keydown`,m),await ko(),c()):(document.removeEventListener(`keydown`,m),y.value=!1)});let h=K(()=>a.value/(dkt*window.devicePixelRatio)),g=()=>{a.value>lkt&&(a.value-=hQ),c()},_=()=>{a.value<ukt&&(a.value+=hQ),c()},v=I(null),y=I(!1),b=I(!1);return Sc(()=>{f(),c()}),{paletteSvg:skt,textCursor:ckt,textarea:s,textEl:l,colorElement:v,edit:r,text:i,textAreaWidth:u,textAreaHeight:d,size:h,sizeRef:a,color:o,colorSelectorDisplayed:y,colorSelectorTop:b,onTextClick:p,decrementSize:g,incrementSize:_,onTextColorClick:()=>{if(y.value=!y.value,y.value){let{y:e,height:t}=n.getBoundingClientRect(),{y:r}=v.value.getBoundingClientRect();b.value=r>e+t/2}},onTextColorUpdate:e=>{o.value=e,y.value=!1,c()},onDeleteClick:()=>{t(`delete-marker`),t(`delete-drawing`)}}}},pkt=[`id`],mkt={key:0},hkt={class:`bimdata-drawing-tools__text-marker__edit-content`,style:`transform: translate(-1px, -1px)`},gkt={class:`bimdata-drawing-tools__text-marker__edit-content__header`},_kt=[`src`];function vkt(e,t,n,r,i,a){let o=R(`BIMDataColorSelector`),s=R(`BIMDataIconDelete`),c=Fc(`click-away`);return z(),B(`div`,{class:`bimdata-drawing-tools__text-marker`,style:N(`font-size:${r.size}px; z-index: ${r.edit?1:0};`)},[H(`div`,{style:N(`cursor: ${n.textToolEnabled?r.textCursor:``}`)},[H(`div`,{ref:`textEl`,class:`bimdata-drawing-tools__text-marker__text`,style:N(`
2431
+ `}},methods:{onMouseMove({offsetX:e,offsetY:t}){this.zoomX=e,this.zoomY=t}}},jTt=[`src`],MTt=[`src`];function NTt(e,t,n,r,i,a){return z(),B(`div`,{class:`preview-2d`,onMouseenter:t[0]||=e=>i.hover=!0,onMouseleave:t[1]||=e=>i.hover=!1,onMousemove:t[2]||=(...e)=>a.onMouseMove&&a.onMouseMove(...e)},[H(`img`,{loading:`lazy`,src:a.imgUrl},null,8,jTt),qo(H(`div`,{class:`zoom`,style:N({transform:a.zoomTransform})},[H(`div`,{class:`zoomImage`,style:N({width:`${n.width}px`,height:`${n.height}px`,transform:a.zoomImageTransform})},[H(`img`,{loading:`lazy`,src:a.imgUrl},null,8,MTt)],4)],4),[[Wd,i.hover]])],32)}var PTt=q(ATt,[[`render`,NTt],[`__scopeId`,`data-v-b92f4cf9`]]),YZ=15,FTt={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(YZ*(1-e/this.width));t=Math.abs(t),t=Math.min(t,YZ),this.translation=(t-1)*this.viewportWidth}}},ITt=[`src`];function LTt(e,t,n,r,i,a){return z(),B(`div`,{class:`preview-3d`,onMousemove:t[0]||=(...e)=>a.onMouseMove&&a.onMouseMove(...e)},[H(`div`,{class:`viewport`,style:N({width:`${a.viewportWidth}px`,height:`${n.height}px`})},[H(`img`,{loading:`lazy`,src:n.previewUrl||n.defaultUrl,style:N({transform:`translateX(-${i.translation}px)`})},null,12,ITt)],4)],32)}var RTt={components:{Preview2D:PTt,Preview3D:q(FTt,[[`render`,LTt],[`__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 zTt(e,t,n,r,i,a){return z(),V(Pc(a.previewComponent),Vu({class:`bimdata-model-preview`,style:{width:`${n.width}px`,height:`${n.height}px`,backgroundColor:n.backgroundColor}},e.$props),null,16,[`style`])}var BTt=q(RTt,[[`render`,zTt]]),VTt={class:`placeholder`},HTt={class:`list-item`},UTt={class:`count`},WTt=q({__name:`StoreySelector`,props:{storeys:{type:Object,required:!0},storey:{type:Object,default:null}},emits:[`storey-selected`],setup(e,{emit:t}){let n=e,r=I(null);return rs([()=>n.storeys,()=>n.storey],([e,t])=>{(!t||e.some(e=>e.uuid===t.uuid)&&t.uuid!==r.value?.uuid)&&(r.value=t)},{immediate:!0}),(t,n)=>{let i=R(`BIMDataIconStorey`),a=R(`BIMDataTextbox`),o=R(`BIMDataIconPlan`),s=R(`BIMDataDropdownList`);return z(),V(s,{class:`storey-selector`,width:`100%`,list:e.storeys,elementKey:`uuid`,closeOnElementClick:!0,onElementClick:n[0]||=e=>t.$emit(`storey-selected`,e)},{header:L(()=>[U(i,{size:`xs`}),H(`span`,VTt,F(r.value?.name??t.$t(`MetaBuildingStructure.StoreySelector.placeholder`)),1)]),element:L(({element:e})=>[H(`div`,HTt,[U(a,{class:`text`,text:e.name},null,8,[`text`]),U(o,{size:`xs`}),H(`span`,UTt,F(e.plans.length),1)])]),_:1},8,[`list`])}}},[[`__scopeId`,`data-v-49c78195`]]),GTt={class:`photosphere-building`},KTt={class:`title`},qTt={class:`head`},JTt={class:`body`},YTt={class:`loading`},XZ=q({__name:`BIMDataPhotosphereBuilding`,props:{apiClient:{type:Object,required:!0},space:{type:Object,required:!0},project:{type:Object,required:!0},model:{type:Object,default:null},storey:{type:Object,default:null},plan:{type:Object,default:null},selectable:{type:Boolean,default:!1}},emits:[`storey-selected`,`plan-selected`],setup(e,{emit:t}){let n=e,r=t,i=I(!1),a=I([]),o=I(null),s=K(()=>o.value?.plans??[]),c=I(null);rs(()=>n.model,async e=>{if(e)try{i.value=!0,a.value=await n.apiClient.modelApi.getStoreys(n.space.id,e.id,n.project.id),a.value.some(({uuid:e})=>o.value?.uuid===e)||(o.value=a.value[0]??null)}finally{i.value=!1}else a.value=[],o.value=null},{immediate:!0}),rs(()=>n.storey,e=>{o.value=e},{immediate:!0}),rs(()=>n.plan,e=>{c.value=e?.plan?.id},{immediate:!0});let l=e=>(o.value=e,r(`storey-selected`,e)),u=e=>r(`plan-selected`,e);return(t,n)=>{let r=R(`BIMDataIconBuilding`),d=R(`BIMDataRadio`),f=R(`BIMDataFileIcon`),p=R(`BIMDataTextbox`),m=R(`BIMDataSpinner`);return z(),B(`div`,GTt,[H(`div`,KTt,[U(r,{size:`s`}),H(`span`,null,F(t.$t(`PhotosphereBuilding.title`)),1)]),H(`div`,qTt,[U(WTt,{storeys:a.value,storey:o.value,onStoreySelected:l},null,8,[`storeys`,`storey`])]),H(`div`,JTt,[(z(!0),B(bu,null,Rc(s.value,t=>(z(),B(`div`,{class:`list-item`,key:t.plan.id},[e.selectable?(z(),V(d,{key:0,value:t.plan.id,modelValue:c.value,"onUpdate:modelValue":[n[0]||=e=>c.value=e,e=>u(t)]},null,8,[`value`,`modelValue`,`onUpdate:modelValue`])):G(``,!0),U(f,{fileName:t.plan.document?.file_name??t.plan.name,size:14},null,8,[`fileName`]),U(p,{class:`text`,text:t.plan.name},null,8,[`text`])]))),128))]),U(kd,{name:`fade`},{default:L(()=>[qo(H(`div`,YTt,[U(m)],512),[[Wd,i.value]])]),_:1})])}}},[[`__scopeId`,`data-v-94317752`]]);function ZZ(e,t){return Array.isArray(e)?e=e.map(e=>ZZ(e,t)):(e.expandedRef=I(!0),e.parent=t,e.children=e.children?.map(t=>ZZ(t,e))??[]),e}function XTt(e,t,n){return[{id:1,text:e.name,component:`StructureRootNode`,children:t.map(e=>ZTt(e,n))}]}var ZTt=(e,t)=>({id:e.uuid,text:e.name,component:`StoreyNode`,children:e.plans?.map(t=>QTt(e,t))??[],storey:e}),QTt=(e,t)=>({id:t.plan.id,text:t.plan.name,component:`PlanNode`,storey:e,plan:t}),$Tt={class:`generic-tree-node`},eEt={class:`end`},QZ=q({__name:`GenericTreeNode`,props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},setup(e){return(t,n)=>{let r=R(`BIMDataTextbox`);return z(),B(`div`,$Tt,[Bc(t.$slots,`icon`,{},void 0,!0),U(r,{class:`text`,text:e.node.text},null,8,[`text`]),H(`div`,eEt,[Bc(t.$slots,`end`,{},void 0,!0)])])}}},[[`__scopeId`,`data-v-fab13549`]]),tEt={__name:`PlanNode`,props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},emits:[`delete-plan`],setup(e){let t=e,n=K(()=>t.node.storey),r=K(()=>t.node.plan);return(e,t)=>{let i=R(`BIMDataFileIcon`),a=R(`BIMDataIconDelete`),o=R(`BIMDataButton`);return z(),V(QZ,Br(Fu(e.$props)),{icon:L(()=>[U(i,{"file-name":r.value.plan.document?.file_name??r.value.plan.name,size:12},null,8,[`file-name`])]),end:L(()=>[U(o,{width:`24px`,height:`24px`,color:`high`,ghost:``,rounded:``,icon:``,onClick:t[0]||=t=>e.$emit(`delete-plan`,{storey:n.value,plan:r.value})},{default:L(()=>[U(a,{size:`xxs`})]),_:1})]),_:1},16)}}},nEt=q({__name:`StoreyNode`,props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},emits:[`add-plans`,`delete-storey`,`update-storey`],setup(e,{emit:t}){let n=e,r=t,i=[{key:1,text:`BuildingMaker.view.addFile`,icon:`plus`,action:()=>(a.value=!1,r(`add-plans`,n.node.storey))},{key:2,text:`BIMDataComponents.t.rename`,icon:`edit`,action:()=>(a.value=!1,r(`update-storey`,n.node.storey)),divider:!0},{key:3,text:`BIMDataComponents.t.delete`,icon:`delete`,color:`var(--color-high)`,action:()=>(a.value=!1,r(`delete-storey`,n.node.storey))}],a=I(!1);return(e,t)=>{let n=R(`BIMDataIconStorey`),r=R(`BIMDataIconEllipsis`),o=R(`BIMDataButton`),s=R(`BIMDataIcon`),c=R(`BIMDataMenu`);return z(),V(QZ,Vu({class:`storey-node`},e.$props),{icon:L(()=>[U(n,{size:`xxs`})]),end:L(()=>[U(o,{width:`24px`,height:`24px`,color:`granite`,ghost:``,rounded:``,icon:``,onClick:t[0]||=e=>a.value=!a.value},{default:L(()=>[U(r,{customSize:`24`})]),_:1}),U(kd,{name:`fade`},{default:L(()=>[qo(U(c,{class:`storey-node__menu`,menuItems:i,width:`180px`},{item:L(({item:t})=>[U(s,{name:t.icon,size:`xs`,margin:`0 12px 0 0`},null,8,[`name`]),H(`span`,null,F(e.$t(t.text)),1)]),_:1},512),[[Wd,a.value]])]),_:1})]),_:1},16)}}},[[`__scopeId`,`data-v-a66bc7dd`]]),rEt={__name:`StructureRootNode`,props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},emits:[`create-storey`],setup(e){return(e,t)=>{let n=R(`BIMDataIconBuilding`),r=R(`BIMDataIconPlus`),i=R(`BIMDataButton`);return z(),V(QZ,Br(Fu(e.$props)),{icon:L(()=>[U(n,{size:`xs`})]),end:L(()=>[U(i,{width:`23px`,height:`23px`,color:`primary`,fill:``,radius:``,icon:``,onClick:t[0]||=t=>e.$emit(`create-storey`)},{default:L(()=>[U(r,{size:`xxs`})]),_:1})]),_:1},16)}}},iEt={__name:`ZoneNode`,props:{node:{type:Object,required:!0},depth:{type:Number,required:!0}},setup(e){return(e,t)=>{let n=R(`BIMDataIconZone2`);return z(),V(QZ,Br(Fu(e.$props)),{icon:L(()=>[U(n,{size:`xxs`})]),_:1},16)}}},aEt={class:`building-view`},oEt={key:0,class:`content`},sEt={key:1,class:`content`},cEt={class:`building-view__tree`},lEt=q(Object.assign({components:{PlanNode:tEt,StoreyNode:nEt,StructureRootNode:rEt,ZoneNode:iEt}},{__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 n=e,r=Xo(`service`),i=Xo(`loading`),a=I(``),o=I(``),s=I(!1),c=I(!1),l=I([]),u=I(null),d=I([]),f=I([]),p=K(()=>ZZ(XTt(n.model,l.value,f.value))),m=async()=>{try{i.value=!0,l.value=await r.fetchStoreys(n.model)}finally{i.value=!1}},h=async()=>{try{i.value=!0,f.value=await r.fetchZones(n.model)}finally{i.value=!1}},g=async e=>{await r.createStorey(n.model,e),m()},_=async e=>{await r.updateStorey(n.model,e),m()},v=async e=>{await r.deleteStorey(n.model,e),m()},y=e=>{u.value=e,c.value=!0},b=()=>{u.value=null,c.value=!1},x=e=>{a.value=n.apiClient.config.configuration.basePath,o.value=n.apiClient.accessToken,u.value=e,s.value=!0},S=async()=>{let e=[],t=[];for(let{document:n,pdfPage:r}of d.value)r?t.push(r):e.push(n);let i=(await r.createPlanModels(e)).concat(t);await r.createStoreyPlans(n.model,u.value,i),m(),d.value=[],u.value=null,s.value=!1},C=async({storey:e,plan:t})=>{await r.deleteStoreyPlan(n.model,e,t),m()};return Sc(()=>{m(),h()}),(t,n)=>{let r=R(`BIMDataFileManager`),i=R(`BIMDataButton`),l=R(`BIMDataTree`);return z(),B(`div`,aEt,[U(kd,{name:`fade`,mode:`out-in`},{default:L(()=>[s.value&&a.value&&o.value&&u.value?(z(),B(`div`,oEt,[U(r,{class:`building-view__dms`,spaceId:e.space.id,projectId:e.project.id,apiUrl:a.value,archiveUrl:``,accessToken:o.value,locale:t.$i18n.locale,select:!0,pdfPageSelect:!0,multi:!0,headerButtons:!1,selectableFileTypes:Ua(pY),onSelectionChange:n[0]||=e=>d.value=e},null,8,[`spaceId`,`projectId`,`apiUrl`,`accessToken`,`locale`,`selectableFileTypes`]),U(i,{width:`100%`,color:`primary`,fill:``,radius:``,onClick:S},{default:L(()=>[W(F(t.$t(`BIMDataComponents.t.validate`)),1)]),_:1})])):(z(),B(`div`,sEt,[H(`div`,cEt,[U(l,{data:p.value},{node:L(({node:e,depth:t})=>[(z(),V(Pc(e.component),{node:e,depth:t,onCreateStorey:y,onUpdateStorey:y,onDeleteStorey:v,onAddPlans:x,onDeletePlan:C},null,40,[`node`,`depth`]))]),_:1},8,[`data`])]),U(i,{width:`100%`,color:`primary`,fill:``,radius:``,onClick:n[1]||=e=>t.$emit(`close`)},{default:L(()=>[W(F(t.$t(`BIMDataComponents.t.finish`)),1)]),_:1}),U(kd,{name:`fade`},{default:L(()=>[c.value?(z(),V(gY,{key:0,class:`building-view__form`,storey:u.value,onCreateStorey:g,onUpdateStorey:_,onClose:b},null,8,[`storey`])):G(``,!0)]),_:1})]))]),_:1})])}}}),[[`__scopeId`,`data-v-5bedb26f`]]),uEt={class:`bimdata-building-maker`},dEt=[`src`],fEt={class:`bimdata-building-maker__body`},pEt={class:`bimdata-building-maker__loader`},mEt=q({__name:`BIMDataPhotosphereBuildingMaker`,props:{apiClient:{type:Object,required:!0},space:{type:Object,required:!0},project:{type:Object,required:!0},model:{type:Object,default:null}},emits:[`metaBuilding-created`,`metaBuilding-updated`,`metaBuilding-deleted`],setup(e,{emit:t}){let n=e,r=t,i=Object.freeze({FORM:`form`,LIST:`list`,VIEW:`view`}),a=dY(n.apiClient,n.space,n.project),o=I(!1);Yo(`service`,a),Yo(`loading`,o);let s=I(i.LIST),c=I([]),l=I(null),u=async()=>{o.value=!0,c.value=await a.fetchPhotosphereBuildings(),o.value=!1},d=async e=>{await a.deleteMetaBuilding(e),u(),r(`metaBuilding-deleted`)},f=e=>{l.value=e??null,s.value=i.FORM},p=e=>{l.value=e,s.value=i.VIEW},m=async e=>{await u(),p(e),r(`metaBuilding-created`)},h=()=>{u(),s.value=i.LIST,r(`metaBuilding-updated`)},g=()=>{s.value=i.LIST};return rs(()=>n.model,e=>{e&&p(e)},{immediate:!0}),Sc(()=>u()),(t,n)=>{let r=R(`BIMDataIconArrow`),a=R(`BIMDataButton`),u=R(`BIMDataSpinner`);return z(),B(`div`,uEt,[H(`div`,{class:`bimdata-building-maker__header`,style:N({visibility:s.value===Ua(i).LIST?`hidden`:`visible`})},[U(a,{class:`bimdata-building-maker__header__btn-back`,ghost:``,radius:``,disabled:o.value.value,onClick:g},{default:L(()=>[U(r,{size:`xxs`,margin:`0 6px 0 0`}),H(`span`,null,F(t.$t(`BIMDataComponents.t.back`)),1)]),_:1},8,[`disabled`]),H(`img`,{src:Ua(uY)},null,8,dEt),H(`span`,null,F(t.$t(`PhotosphereBuilding.title`)),1)],4),H(`div`,fEt,[U(kd,{name:`fade`,mode:`out-in`},{default:L(()=>[s.value===Ua(i).FORM?(z(),V(mY,{key:0,type:Ua(fY).PHOTOSPHERE_BUILDING,metaBuilding:l.value,onMetaBuildingCreated:m,onMetaBuildingUpdated:h},null,8,[`type`,`metaBuilding`])):s.value===Ua(i).VIEW&&l.value?(z(),V(lEt,{key:1,apiClient:e.apiClient,space:e.space,project:e.project,model:l.value,onClose:g},null,8,[`apiClient`,`space`,`project`,`model`])):(z(),V(hY,{key:2,metaBuildings:c.value,onOpenMetaBuilding:p,onCreateMetaBuilding:f,onUpdateMetaBuilding:f,onDeleteMetaBuilding:d},null,8,[`metaBuildings`]))]),_:1})]),U(kd,{name:`fade`},{default:L(()=>[qo(H(`div`,pEt,[U(u)],512),[[Wd,o.value]])]),_:1})])}}},[[`__scopeId`,`data-v-235bd404`]]),hEt={class:`overlay`},gEt={class:`safe-zone__icon`},_Et={class:`safe-zone__title`},vEt={class:`safe-zone__text`},yEt={class:`safe-zone__actions`},bEt=q({__name:`BIMDataSafeZoneModal`,props:{width:{type:String,default:`350px`},iconName:{type:String,default:`warning`}},setup(e){return(t,n)=>{let r=R(`BIMDataIcon`);return z(),B(`div`,hEt,[H(`div`,{class:`safe-zone`,style:N({width:e.width})},[H(`div`,gEt,[U(r,{name:e.iconName,size:`s`,fill:``,color:`high`},null,8,[`name`])]),H(`h2`,_Et,[Bc(t.$slots,`title`,{},void 0,!0)]),H(`div`,vEt,[Bc(t.$slots,`text`,{},void 0,!0)]),H(`div`,yEt,[Bc(t.$slots,`actions`,{},void 0,!0)])],4)])}}},[[`__scopeId`,`data-v-01a25253`]]),xEt=s({BIMDataBuildingMaker:()=>_Y,BIMDataFileManager:()=>zwt,BIMDataGuidedTour:()=>aTt,BIMDataMetaBuildingStructure:()=>JZ,BIMDataModelPreview:()=>BTt,BIMDataPDFViewer:()=>NZ,BIMDataPhotosphereBuilding:()=>XZ,BIMDataPhotosphereBuildingMaker:()=>mEt,BIMDataSafeZoneModal:()=>bEt}),SEt={name:`buildingMaker`,component:{setup(){let{apiClient:e,cloudId:t,projectId:n}=Xo(`$viewer`).api;return()=>cd(_Y,{apiClient:e,space:{id:t},project:{id:n}})}},window:{name:`buildingMaker`,label:`Building Maker`,noModel:!0,icon:{imgUri:uY}}},CEt={components:{BIMDataNumericalInput:DD},setup(){let e=Xo(`$viewer`),t=Xo(`viewerPlan`),n=Xo(`root`),r=Xo(`close`),i=K(()=>n.editedBitmap?.plan),a=K(()=>n.editedBitmap?n.editedBitmap:{x:0,y:0,scale:0,angle:0,opacity:0}),o=wEt(a),{x:s,y:c,angle:l,scale:u}=o,d,f,p=new Map;rs(i,(e,t)=>{t&&p.set(t.key,d),e||p.clear(),d=p.get(e?.key)??null,f=null}),rs([s,c,l,u],()=>{i.value&&(d||=i.value.plan.transform,f={translate:[s.value,c.value],rotate:l.value,scale:u.value},t.planObjectRegistry.updatePlanObjectsTransform(i.value,{oldTransform:d,newTransform:f}),d=f)});let m=async()=>{try{n.loading=!0,await Promise.all(n.bitmaps.filter(e=>e.edited).map(async n=>{let{x:r,y:i,scale:a,angle:o,opacity:s,plan:c}=n,l={...c.plan.transform},u={translate:[r,i],rotate:o,scale:a,opacity:s};t.planObjectRegistry.updatePlanObjectsTransform(c,{oldTransform:u,newTransform:l}),c.plan.transform||(c.plan.transform={}),Object.assign(c.plan.transform,u),await e.state.updatePlan(c,l),n.edited=!1}))}catch(e){console.error(e)}finally{n.loading=!1,r()}};return{root:n,bitmap:a,...o,submit:m}}};function wEt(e){let t={};return Object.entries({x:e=>e,y:e=>e,scale:e=>e,angle:e=>e<0||e>360?(e%360+360)%360:e,opacity:e=>e<0?0:e>1?1:e}).forEach(([n,r])=>{t[n]=K({get:()=>e.value[n],set:t=>e.value[n]=r(t)})}),t}var TEt={class:`synchronization__page__edit`},EEt={class:`synchronization__page__edit__content`},DEt={class:`synchronization__page__edit__content__unit-group`},OEt={class:`synchronization__page__edit__content__unit-group__element`},kEt={class:`synchronization__page__edit__content__unit-group__element`},AEt={class:`synchronization__page__edit__content__unit-group__element`},jEt={class:`synchronization__page__edit__content__unit`},MEt={class:`synchronization__page__edit__content__unit`},NEt={class:`synchronization__page__edit__content__img`},PEt=[`src`],FEt={class:`synchronization__page__edit__validate`};function IEt(e,t,n,r,i,a){let o=R(`BIMDataNumericalInput`),s=R(`BIMDataSlider`),c=R(`BIMDataTextbox`),l=R(`BIMDataButton`);return z(),B(`div`,TEt,[H(`div`,EEt,[H(`section`,null,[H(`span`,null,F(e.$t(`synchronization.location`)),1),H(`div`,DEt,[H(`div`,OEt,[U(o,{modelValue:e.x,"onUpdate:modelValue":t[0]||=t=>e.x=t,label:`X`,container:e.$viewer.localContext.el},null,8,[`modelValue`,`container`])]),H(`div`,kEt,[U(o,{modelValue:e.y,"onUpdate:modelValue":t[1]||=t=>e.y=t,label:`Y`,container:e.$viewer.localContext.el},null,8,[`modelValue`,`container`])]),H(`div`,AEt,[U(o,{modelValue:e.scale,"onUpdate:modelValue":t[2]||=t=>e.scale=t,label:e.$t(`synchronization.scale`),step:.01,min:.01,container:e.$viewer.localContext.el},null,8,[`modelValue`,`label`,`container`])])])]),H(`section`,null,[H(`span`,null,F(e.$t(`synchronization.rotation`)),1),H(`div`,jEt,[U(o,{modelValue:e.angle,"onUpdate:modelValue":t[3]||=t=>e.angle=t,unit:`°`,centered:``},null,8,[`modelValue`]),U(s,{modelValue:e.angle,"onUpdate:modelValue":t[4]||=t=>e.angle=t,min:0,max:360},null,8,[`modelValue`])])]),H(`section`,null,[H(`span`,null,F(e.$t(`synchronization.alpha`)),1),H(`div`,MEt,[U(o,{modelValue:e.opacity,"onUpdate:modelValue":t[5]||=t=>e.opacity=t,centered:``},null,8,[`modelValue`]),U(s,{modelValue:e.opacity,"onUpdate:modelValue":t[6]||=t=>e.opacity=t,min:0,max:1,step:.01},null,8,[`modelValue`])])]),H(`section`,null,[H(`span`,null,F(e.$t(`synchronization.preview`)),1),H(`div`,NEt,[H(`img`,{src:r.bitmap.dataUrl,alt:`Background`},null,8,PEt),U(c,{text:r.bitmap.name,class:`synchronization__page__edit__content__img__name`},null,8,[`text`])])])]),H(`div`,FEt,[U(l,{width:`100%`,color:`primary`,fill:``,radius:``,onClick:r.submit},{default:L(()=>[W(F(r.bitmap&&r.bitmap.plan?e.$t(`global.save`):e.$t(`global.validate`)),1)]),_:1},8,[`onClick`])])])}var LEt={name:`BimdataSynchronization`,components:{edit:q(CEt,[[`render`,IEt],[`__scopeId`,`data-v-63e956d5`]])},setup(){let{localContext:e}=Xo(`$viewer`),t=Xo(`$plugin`),n=e.pluginComponentInstances.get(`plan`);if(!n)throw Error(`[Synchronization] plugin cannot work without viewerPlan plugin with 2d engine on.`);n=Fa(n),Yo(`viewerPlan`,n);let r=K(()=>e.loadedModels[0]);rs(r,e=>{!e||e.type!==`METABUILDING`?t.hide():t.show()},{immediate:!0}),rs(()=>t.shown,e=>{r.value?.type!==`METABUILDING`&&e&&t.hide()});let i=Ea({page:`edit`,loading:!1,modalDisplayed:!1,model:null,storeys:[],selectedStorey:null,plans:[],bitmaps:[],editedBitmap:null});Yo(`root`,i);let a=()=>{i.editedBitmap&&(i.bitmaps.map(e=>(e.edit(!1),e)).filter(e=>e.edited).forEach(e=>{let{x:t,y:r,scale:i,angle:a,plan:o}=e,s=o.plan.transform,c={translate:[t,r],rotate:a,scale:i};n.planObjectRegistry.updatePlanObjectsTransform(o,{oldTransform:c,newTransform:s}),e.reset()}),i.modalDisplayed=!1,n.storeyRightOffset=0,e.showUI(),document.removeEventListener(`keydown`,u),i.editedBitmap=null,i.bitmaps=[])},o=()=>{a(),t.close()};Yo(`close`,o);let s=()=>{i.bitmaps.some(e=>e.edited)?i.modalDisplayed=!0:o()},c=()=>{o()},l=e=>{i.editedBitmap=e},u=e=>{i.loading||e.key===`Escape`&&(e.preventDefault(),i.modalDisplayed?i.modalDisplayed=!1:o())},d=e.hub.on(`model-loaded`,({model:e})=>{i.model=e,i.storeys=e.storeys,i.plans=e.storeys.flatMap(e=>e.plans)},{getLastEvent:!0}),f=e.hub.on(`storey-selected`,({storey:e})=>{i.selectedStorey=e,(!e||e.plans.length<2)&&o()},{getLastEvent:!0});return Ec(()=>{e.hub.off(d),e.hub.off(f)}),rs(()=>i.editedBitmap,(e,t)=>{t?.edit(!1),e?.edit(!0)},{immediate:!0}),{viewerPlan:n,root:i,onBitmapClick:l,onCloseClick:s,onLeaveClick:c,onKeyDown:u,clean:a}},async onOpen(){this.$viewer.localContext.pluginComponentInstances.forEach(e=>{e!==this&&e.$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(e=>e.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(e=>!e.visible).forEach(e=>{this.$viewer.localContext.showPlan(e.plan),e.show()}),this.viewerPlan.$refs.storeySelector?.focus()},onClose(){this.clean()}},REt={class:`bimdata-synchronization`},zEt={class:`bimdata-synchronization__header`},BEt={class:`bimdata-synchronization__header__top`},VEt={class:`bimdata-synchronization__header__top__title`},HEt={class:`bimdata-synchronization__header__top__title__text`},UEt={class:`bimdata-synchronization__header__select__header`},WEt={class:`bimdata-info-length bimdata-synchronization__header__select__header__length`},GEt={class:`bimdata-synchronization__page`},KEt={key:1,class:`bimdata-synchronization__modal`},qEt={class:`bimdata-synchronization__modal__content`},JEt={class:`bimdata-synchronization__modal__content__symbols`},YEt={class:`bimdata-synchronization__modal__content__buttons`};function XEt(e,t,n,r,i,a){let o=R(`BIMDataLoading`),s=R(`BIMDataIconSynchro2D`),c=R(`BIMDataIconClose`),l=R(`BIMDataButton`),u=R(`BIMDataTextbox`),d=R(`BIMDataDropdownList`),f=R(`BIMDataIconWarning`);return z(),B(`div`,REt,[r.root.loading?(z(),V(o,{key:0})):G(``,!0),H(`div`,zEt,[H(`div`,BEt,[H(`div`,VEt,[U(s,{size:`xs`,fill:``,color:`primary`}),H(`span`,HEt,F(e.$t(`synchronization.title`)),1)]),U(l,{class:`bimdata-synchronization__header__top__close`,width:`25px`,height:`25px`,ghost:``,radius:``,icon:``,onClick:r.onCloseClick},{default:L(()=>[U(c,{size:`xs`,fill:``,color:`granite-light`})]),_:1},8,[`onClick`])]),H(`div`,null,[U(d,{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:L(()=>[H(`div`,UEt,[H(`div`,WEt,[H(`span`,null,F(r.root.bitmaps.length),1)]),H(`div`,null,[U(u,{width:`265px`,text:r.root.editedBitmap?.name},null,8,[`text`])])])]),element:L(({element:e})=>[H(`div`,{class:P([`bimdata-synchronization__header__select__element`,{"bimdata-synchronization__header__select__element--selected":e===r.root.editedBitmap}])},F(e.name),3)]),_:1},8,[`list`,`onElementClick`])])]),H(`div`,GEt,[(z(),V(dc,null,[(z(),V(Pc(r.root.page)))],1024))]),r.root.modalDisplayed?(z(),B(`div`,KEt,[H(`div`,qEt,[H(`div`,JEt,[U(f,{fill:``,color:`high`,size:`l`}),H(`div`,null,F(e.$t(`synchronization.warning`)),1)]),H(`div`,YEt,[U(l,{width:`45%`,color:`high`,fill:``,radius:``,onClick:r.onLeaveClick},{default:L(()=>[W(F(e.$t(`synchronization.leave`)),1)]),_:1},8,[`onClick`]),U(l,{width:`45%`,color:`default`,outline:``,radius:``,onClick:t[0]||=e=>r.root.modalDisplayed=!1},{default:L(()=>[W(F(e.$t(`synchronization.stay`)),1)]),_:1})])])])):G(``,!0)])}var ZEt={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ählen`,import_file:`Eine Datei importieren`,location:`Position`,scale:`Skala`,rotation:`Rotation`,alpha:`Undurchsichtigkeit`,preview:`Übersicht`,import:`Ein Element importieren`,from_ged:`Von der DMS des Projekts aus`,from_computer:`Von Ihrem Computer aus`,no_storey:`Um einen Hintergrund hinzuzufügen, wählen Sie bitte eine IFC und eine Etage aus.`,no_ifc:`Um einen Hintergrund hinzuzufügen, wählen Sie bitte eine IFC aus.`,warning:`Möchten Sie diese Seite wirklich verlassen? Sie enthält möglicherweise Informationen, die nicht bestätigt 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ón 2D`,title:`Sincronización 2D`,start:`Comenzar`,description:`Lorem ipsum dolor sit amet, consectetur adipiscing elit.`,select_storey:`Seleccionar una planta`,import_file:`Importar un fichero`,location:`Posición`,scale:`Escala`,rotation:`Rotación`,alpha:`Opacidad`,preview:`Vista rápida`,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:`¿Esta usted seguro de que quiere abandonar esta página? Puede haber informaciones no validadas.`,leave:`Sí, abandonar la página`,stay:`Cancelar, permanecer aquí`},fr:{tooltip:`Synchronisation 2D`,title:`Synchronisation 2D`,start:`Commencer`,description:`Lorem ipsum dolor sit amet, consectetur adipiscing elit.`,select_storey:`Sélectionner un étage`,import_file:`Importer un fichier`,location:`Position`,scale:`Echelle`,rotation:`Rotation`,alpha:`Opacité`,preview:`Aperçu`,import:`Importer un élément`,from_ged:`Depuis la GED du projet`,from_computer:`Depuis votre ordinateur`,no_storey:`Pour ajouter un fond, veuillez selectionner un IFC et un étage.`,no_ifc:`Pour ajouter un fond, veuillez selectionner un IFC avec au moins un étage.`,warning:`Êtes-vous sûr de vouloir quitter cette page ? Il y'a peut-être des informations non validées.`,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à`,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 è sicuri di voler lasciare questa pagina? È possibile che alcune informazioni non siano state ancora convalidate.`,leave:`Sì, uscire da questa pagina`,stay:`Annulla, rimanere a questa pagina`}},component:q(LEt,[[`render`,XEt],[`__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`}}},QEt={name:`anchor-synchronization`,i18n:{de:AD,en:jD,es:MD,fr:ND,it:PD},i18nTokenPrefix:`viewer2d-background`,addToWindows:[`2d`],component:kD,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`}}},$Et={},eDt={width:`17`,height:`18`,viewBox:`0 0 17 18`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`};function tDt(e,t){return z(),B(`svg`,eDt,[...t[0]||=[Lu(`<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 nDt=q($Et,[[`render`,tDt]]),rDt={class:`bimdata-anchor-synchronization__header`},iDt={class:`bimdata-anchor-synchronization__header__texts`},aDt={class:`bimdata-anchor-synchronization__header__texts__title`},oDt={class:`bimdata-anchor-synchronization__header__buttons`},sDt=q({__name:`AnchorSynchronizationHeader`,setup(e){let t=Xo(`$viewer`),n=Xo(`state`),r=Xo(`service`),i=K(()=>n.allAnchorsValidated),a=I(!1),o=null;t.globalContext.hub.once(`anchor-synchronization:open`,(e=null)=>{o=e},{getLastEvent:!0});let s=()=>{t.globalContext.layout=o},c=async()=>{a.value=!0,await r.saveAnchors(),t.globalContext.layout=o};return(e,t)=>{let n=R(`BIMDataButton`),r=R(`BIMDataSpinner`);return z(),B(`div`,rDt,[H(`div`,iDt,[U(nDt,{class:`m-x-6`}),H(`span`,aDt,F(e.$t(`anchor-synchronization-window.title`)),1)]),H(`div`,oDt,[U(n,{color:`high`,fill:``,radius:``,class:`m-x-6`,width:`120px`,onClick:s},{default:L(()=>[W(F(e.$t(`global.cancel`)),1)]),_:1}),U(n,{color:`primary`,fill:``,radius:``,class:`m-x-6`,width:`120px`,disabled:!i.value,onClick:c},{default:L(()=>[a.value?(z(),V(r,{key:0})):(z(),B(bu,{key:1},[W(F(e.$t(`global.done`)),1)],64))]),_:1},8,[`disabled`])])])}}},[[`__scopeId`,`data-v-a7ce6c34`]]),cDt={class:`anchor-content`},lDt={class:`anchor-label`},$Z={__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 n=e,r={x:n.isSecondAnchor?`70px`:`20px`,y:`90%`},i=K(()=>n.position?{x:n.position.x+`px`,y:n.position.y+`px`}:r),a=t,o=I(!1),s=I(null);function c(e){o.value=!0,s.value?.setPointerCapture(e.pointerId),e.preventDefault()}function l(e){if(!o.value)return;let t=n.position;if(!t){let{x:e,y:n}=s.value.getBoundingClientRect(),{x:r,y:i}=s.value.parentElement.getBoundingClientRect();t={x:e-r+15,y:n-i+51}}a(`change`,{x:t.x+e.movementX,y:t.y+e.movementY})}function u(e){o.value&&s.value&&s.value?.releasePointerCapture(e.pointerId),o.value=!1,a(`validate`)}return Ec(()=>{o.value=!1}),(t,n)=>(z(),B(`div`,{class:`bimdata-anchor-synchronization__anchor`,style:N({left:i.value.x,top:i.value.y,color:e.color,cursor:o.value?`none`:`grab`}),onPointerdown:c,onPointermove:l,onPointerup:u,ref_key:`anchorElement`,ref:s},[H(`div`,cDt,[n[0]||=H(`svg`,{width:`30`,height:`60`,viewBox:`0 0 30 60`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[H(`rect`,{x:`14`,y:`42`,width:`2`,height:`18`,fill:`currentColor`}),H(`rect`,{x:`24`,y:`50`,width:`2`,height:`18`,transform:`rotate(90 24 50)`,fill:`currentColor`}),H(`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),H(`div`,lDt,F(e.isSecondAnchor?2:1),1)])],36))}},eQ=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2}),tQ=(e,t)=>Math.hypot(t.x-e.x,t.y-e.y),nQ=(e,t)=>Math.atan2(t.y-e.y,t.x-e.x),uDt=(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 rQ(e){let{anchorA1Position:t,anchorA2Position:n,anchorB1Position:r,anchorB2Position:i,model:a,modelToSynchronize:o}=e;if(!a||!o)throw Error(`[BIMDataViewer - AnchorSynchronization] Models are mandatory to calculate transform.`);let{translate:s,rotate:c,scale:l}=o.transform??eE.IDENTITY,u=tQ(t,n)/tQ(r,i)*l,d=nQ(t,n),f=(nQ(r,i)-d)*(180/Math.PI)*-1,p=c+f,m=eQ(t,n),h=eQ(r,i),g=uDt({x:h.x-s[0],y:h.y-s[1]},f*Math.PI/180),_={x:g.x/l*u,y:g.y/l*u};return{scale:u,rotate:p,translate:[m.x-_.x,m.y-_.y,0]}}var dDt={class:`bimdata-viewer-ifc-2d`,ref:`canvasContainer`},fDt=q({__name:`ViewerIfc2D`,props:{model:{type:Object,default:null},storeyIndex:{type:Number,default:0}},emits:[`camera-update`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=Xo(`$viewer`),o=Xo(`state`),s=I(null),c=null,l=null,u=null,{promise:d,resolve:f,reject:p}=Promise.withResolvers(),m=()=>{l=VT({canvas:s.value}),l.styles.default.lineWidth=.01,l.settings.rotateSpeed=.05,l.settings.snapMargin=.04,l.settings.minScale=10,l.textureManager.textureMatrix.scale(.01,.01);let{camera:e}=l;e.on(`update`,()=>{i(`camera-update`,e)});let t={engine:l,viewer:l,$viewer:a};c=ZE(t),u=new jE(t)};Sc(()=>{try{m()}catch(e){p(e)}f()});let h=(e,t)=>{let n=e.storeys[t];if(!n)return;let r=n.objects.map(e=>String(e.id));l.scene.showObjects(r)},g=async e=>{await d,await c(e.map_file,e.id);let t=l.scene.objects.map(e=>e.id);if(l.scene.hideObjects(t),h(e,r.storeyIndex),e.recommanded_2d_angle!==void 0){let t=l.camera.rotation;l.camera.rotate(-t-e.recommanded_2d_angle)}l.camera.fitView()};rs(()=>r.model,async e=>{e&&await g(e)},{immediate:!0});let _=!1;return t({getWorldPosition(e){return l.camera.getPosition(e)},get canvas(){return s.value},async showPlan(e){if(_)return;let t=await u.showPlan(e),n=t.mask?.crop_path,r={opacity:.5,crop_path:n};t.tempMask=r,_=!0;let i={translate:[t.x,t.y],scale:t.scale,rotate:t.angle},{anchorA1Position:a,anchorA2Position:s,anchorB1Position:c,anchorB2Position:l}=Ya(o);rs([a,s,c,l],()=>{let e=rQ(o);n?.length>0&&(r.crop_path=iE(iE(n,i,{inverse:!0}),e)),t.x=e.translate[0],t.y=e.translate[1],t.scale=e.scale,t.angle=e.rotate},{immediate:!0})}}),(e,t)=>(z(),B(`div`,dDt,[H(`canvas`,{ref_key:`canvasElement`,ref:s,style:{width:`100%`,height:`100%`,position:`absolute`}},null,512)],512))}},[[`__scopeId`,`data-v-c0725497`]]),pDt={__name:`ViewerImage`,props:{model:{type:Object,default:null}},emits:[`camera-update`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=()=>{let{camera:e}=o.value.viewer;e.on(`update`,()=>{i(`camera-update`,e)})},o=I(null),{promise:s,resolve:c}=Promise.withResolvers();rs(()=>r.model,async e=>{await s,e&&(o.value.loadModels([e]),o.value.viewer.renderer.offset.dx===0&&o.value.viewer.renderer.offset.dy===0&&(o.value.viewer.renderer.offset={dx:-e.transform.translate[0],dy:-e.transform.translate[1]}))},{immediate:!0}),Sc(()=>{c()});let l=Ta({get loadedModels(){return r.model?[r.model]:[]},get selectedStorey(){return null}});return t({getWorldPosition(e){return o.value.engine.camera.getPosition(e)},get canvas(){return o.value.engine.canvas}}),(e,t)=>(z(),V(aY,{ref_key:`viewerPlan`,ref:o,stateContext:l,onMounted:a},null,8,[`stateContext`]))}},mDt={class:`bimdata-anchor-synchronization__viewer`},hDt={class:`viewer-container-A`},gDt={class:`viewer-container-B`},_Dt=q({__name:`AnchorSynchronizationViewer`,setup(e,{expose:t}){let n=I(null),r=I(null),i=Xo(`state`),a=(e,t)=>{t.preventDefault();let i=e===`A`?n.value:r.value;i&&xD(i.canvas)(t)},o=I(null),s=I(null),c=I(null),l=I(null),u={anchorA1Position:o,anchorA2Position:s,anchorB1Position:c,anchorB2Position:l},d=(e,t)=>{(e===`A`?[`anchorA1Position`,`anchorA2Position`].filter(e=>u[e].value!==null):[`anchorB1Position`,`anchorB2Position`].filter(e=>u[e].value!==null)).forEach(e=>{let n=i[e];u[e].value=t.getCanvasPosition(n)})},f=(e,t)=>{let a=e.startsWith(`A`)?n.value:r.value,o=`anchor${e}Position`;i[o]=a.getWorldPosition(t),u[o].value=t},p=za(null),m=I(0),h=za(null),g=rs(()=>i.allAnchorsValidated,e=>{if(!e)return;let t={plan:h.value,storey:{}};n.value.showPlan(t),g()}),_=e=>{if(!e)return null;let t=e.type;switch(t){case`IFC`:return fDt;case`PNG`:case`JPEG`:case`PDF`:case`PHOTOSPHERE`:return pDt;default:throw Error(`[BIMData AnchorSynchronizationViewer] Unsupported model type: ${t}`)}},v=async(e,t,n)=>{p.value=e;let r=e.storeys.findIndex(e=>e.uuid===t.uuid);if(r===-1)throw Error(`[BIMData AnchorSynchronizationViewer] Storey not found in main model.`);m.value=r,h.value=n},y=()=>{i.allAnchorsValidated||o.value&&s.value&&c.value&&l.value&&(i.allAnchorsValidated=!0)};return t({synchronize:v}),(e,t)=>(z(),B(`div`,mDt,[H(`div`,hDt,[(z(),V(Pc(_(p.value)??`div`),{model:p.value,ref_key:`viewerA`,ref:n,onCameraUpdate:t[0]||=e=>d(`A`,e),storeyIndex:m.value},null,40,[`model`,`storeyIndex`])),p.value?(z(),B(bu,{key:0},[U($Z,{onChange:t[1]||=e=>f(`A1`,e),onValidate:y,position:o.value,onWheel:t[2]||=e=>a(`A`,e)},null,8,[`position`]),U($Z,{onChange:t[3]||=e=>f(`A2`,e),onValidate:y,position:s.value,onWheel:t[4]||=e=>a(`A`,e),isSecondAnchor:!0},null,8,[`position`])],64)):G(``,!0)]),H(`div`,gDt,[(z(),V(Pc(_(h.value)??`div`),{model:h.value,ref_key:`viewerB`,ref:r,onCameraUpdate:t[5]||=e=>d(`B`,e)},null,40,[`model`])),h.value?(z(),B(bu,{key:0},[U($Z,{onChange:t[6]||=e=>f(`B1`,e),onValidate:y,position:c.value,onWheel:t[7]||=e=>a(`B`,e)},null,8,[`position`]),U($Z,{onChange:t[8]||=e=>f(`B2`,e),onValidate:y,position:l.value,onWheel:t[9]||=e=>a(`B`,e),isSecondAnchor:!0},null,8,[`position`])],64)):G(``,!0)])]))}},[[`__scopeId`,`data-v-3947e679`]]),vDt=class{state;$viewer;constructor(e,t){this.$viewer=e,this.state=t}async saveAnchors(){let{state:e}=this.$viewer,{model:t,storey:n,modelToSynchronize:r}=this.state;if(!t||!r||!n)throw Error(`[BIMDataViewer - AnchorSynchronization] Models and storey are mandatory to save anchors.`);let i=rQ(this.state),a=n.plans.find(e=>e.plan.id===r.id);try{if(a){let t={...r.transform};a.plan.transform=i,await e.updatePlan(a,t)}else await e.createPlan(t,n,r.document,i)}catch(e){throw console.error(`[BIMDataViewer - Anchor Synchronization Service] Failed to save anchors:`,e),e}}},yDt=class{model=null;storey=null;modelToSynchronize=null;anchorA1Position=null;anchorA2Position=null;anchorB1Position=null;anchorB2Position=null;allAnchorsValidated=!1;constructor(){return Ta(this)}},bDt={components:{AnchorSynchronizationHeader:sDt,AnchorSynchronizationViewer:_Dt},setup(){let e=I(null),t=new yDt;return Yo(`state`,t),Yo(`service`,new vDt(Xo(`$viewer`),t)),{viewer:e,synchronize:(n,r,i)=>(t.model=n,t.storey=r,t.modelToSynchronize=i,e.value.synchronize(n,r,i)),positioned:I(!1)}}},xDt={class:`bimdata-anchor-synchronization`};function SDt(e,t,n,r,i,a){let o=R(`AnchorSynchronizationHeader`),s=R(`AnchorSynchronizationViewer`);return z(),B(`div`,xDt,[U(o,{valid:r.positioned},null,8,[`valid`]),U(s,{class:`bimdata-anchor-synchronization__content__viewer`,ref:`viewer`,onPositioned:t[0]||=e=>r.positioned=!0})])}var CDt={name:`anchor-synchronization-window`,i18n:{en:{title:`Synchronization`},fr:{title:`Synchronisation`}},component:q(bDt,[[`render`,SDt],[`__scopeId`,`data-v-7f15ad3b`]]),window:{name:`anchor-synchronization`,header:!1,displayedInWindowSelector:!1,multiModel:!1}},wDt={name:`PointCloudViewer`,components:{Annotations:MK},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=kK},mounted(){let e=new OV({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 QV(e,{originatingSystem:`BIMDataViewer/v1.0`,authoringTool:`BIMData.io`}),this.distanceMeasurementsPlugin=new cH(e,{defaultAxisVisible:!1,container:this.$el,zIndex:0}),this.angleMeasurementsPlugin=new IV(e,{container:this.$el,zIndex:0}),this.tilesetLoaderPlugin=new OK(e,{sensitivity:this.sensitivity,debugMode:!1}),this.navCubeVisible&&(this.navCube=new IG(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(e=>!this.loadedModels.some(t=>t.id===e.id)));let{apiUrl:t,cloudId:n,projectId:r,accessToken:i}=this.$viewer.api;e.forEach(async(e,a)=>{try{this.$viewer.localContext.loadingProcessStart();let o=await(await fetch(`${t}/cloud/${n}/project/${r}/model/${e.id}/tileset?tile_format=xkt`,{headers:new Headers({Authorization:`Bearer ${i}`})})).json();o.name=String(e.id);let s=this.tilesetLoaderPlugin.load(o);this.tilesets.set(e,s);let c={model:e,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(t){console.error(`Error while loading Tileset `,e.id,`with error: `,t),this.loadedModels=this.loadedModels.filter(t=>t.id!==e.id)}finally{this.$viewer.localContext.loadingProcessEnd(),this.loading=!1}}),this.loadedModels.length>0&&this.navCube?.setVisible(!0)},unloadModels(e){let t=e.map(e=>this.tilesets.get(e)).filter(Boolean);e.forEach(e=>this.tilesets.delete(e)),t.forEach(e=>e.destroy()),this.loadedModels=this.loadedModels.filter(t=>!e.find(e=>e.id===t.id)),e.forEach(e=>{let t={model:e,plugin:this};this.$viewer.localContext.hub.emit(`pointcloud-model-unloaded`,t),this.$viewer.globalContext.hub.emit(`pointcloud-model-unloaded`,t)}),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(e=>e.id),e},async setViewpoint(e,{immediate:t=!1,duration:n=.3}={}){if(this.loading){this.viewpointPending=!0;let e=null;await new Promise(t=>{e=this.$watch(`loading`,e=>{e||t()},{immediate:!0})}),e(),this.viewpointPending=!1}await new Promise(e=>setTimeout(e,200)),this.bcfViewpointsPlugin.setViewpoint(e,{rayCast:!1,immediate:t,duration:n})},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`,t=>{let n=this.xeokit.scene.pick({pickSurface:!0,canvasPos:t});if(n){let[t,r,i]=n.worldPos;e({x:t,y:i,z:r,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}}},TDt={class:`bimdata-viewer-point-cloud`},EDt={ref:`header`,class:`bimdata-viewer-point-cloud__header`},DDt={ref:`bimdata-xeokit-navcube-canvas`,class:`bimdata-viewer-point-cloud__nav-cube`},ODt=[`id`];function kDt(e,t,n,r,i,a){let o=R(`NoModelWindowPlaceHolder`),s=R(`ModelsLoader`),c=R(`Annotations`);return z(),B(`div`,TDt,[i.loadedModels.length===0?(z(),V(o,{key:0})):G(``,!0),H(`div`,EDt,[i.settings.modelLoader===`disabled`?G(``,!0):qo((z(),V(s,{key:0,"window-positioning":!1,preview:``},null,512)),[[Wd,i.modelHeaderShown]])],512),H(`canvas`,{ref:`bimdata-xeokit-canvas`,class:`bimdata-viewer-point-cloud__viewer`,onWheel:t[0]||=Rf(()=>{},[`prevent`])},null,544),i.xeokitCreated?(z(),V(c,{key:1})):G(``,!0),qo(H(`canvas`,DDt,null,512),[[Wd,i.navCubeVisible]]),H(`div`,{id:i.spinnerCanvasId},null,8,ODt)])}var ADt={name:`pointCloud`,isViewer:!0,component:q(wDt,[[`render`,kDt],[`__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`}}},iQ=`viewer-point-cloud-parameters_parameters`,jDt={computed:{viewer(){let e=this.$viewer.localContext.pluginComponentInstances.get(`pointCloud`);if(e)return e;{let e=`'Viewer Point Cloud Parameters' plugin cannot work without Viewer Point Cloud plugin.`;throw console.error(e),Error(e)}},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(iQ)||`{}`;e=JSON.parse(t)}catch{localStorage.removeItem(iQ)}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(iQ,JSON.stringify(t))}}},MDt={class:`viewer-point-cloud-parameters`},NDt={class:`viewer-point-cloud-parameters_header`},PDt={class:`viewer-point-cloud-parameters_content`},FDt={class:`m-b-18`},IDt={class:`flex justify-between`},LDt={class:`viewer-point-cloud-parameters_content__value`},RDt={class:`flex justify-between`},zDt={class:`viewer-point-cloud-parameters_content__value`};function BDt(e,t,n,r,i,a){let o=R(`BIMDataIconParameters`),s=R(`BIMDataSlider`);return z(),B(`div`,MDt,[H(`div`,NDt,[U(o,{size:`xs`,margin:`0 12px 0 0`}),H(`span`,null,F(e.$t(`pointCloudParameters.title`)),1)]),H(`div`,PDt,[H(`div`,FDt,[H(`div`,IDt,[H(`span`,null,F(e.$t(`pointCloudParameters.sensitivity`)),1),H(`span`,LDt,F(a.sensitivity),1)]),U(s,{modelValue:a.sensitivity,"onUpdate:modelValue":t[0]||=e=>a.sensitivity=e,min:20,max:1e3},null,8,[`modelValue`])]),H(`div`,null,[H(`div`,RDt,[H(`span`,null,F(e.$t(`pointCloudParameters.fov`)),1),H(`span`,zDt,F(a.fov),1)]),U(s,{modelValue:a.fov,"onUpdate:modelValue":t[1]||=e=>a.fov=e,min:20,max:120},null,8,[`modelValue`])])])])}var VDt={name:`pointCloudParameters`,i18n:{en:{tooltip:`Parameters`,title:`Point Cloud Viewer settings`,sensitivity:`Sensitivity`,fov:`Field of view`},fr:{tooltip:`Paramètres`,title:`Paramètres du nuage de points`,sensitivity:`Sensibilité`,fov:`Angle de vision`}},addToWindows:[`pointCloud`],component:q(jDt,[[`render`,BDt],[`__scopeId`,`data-v-e97be8b2`]]),button:{tooltip:`pointCloudParameters.tooltip`,position:`right`,content:`simple`,icon:{component:`BIMDataIconParameters`,options:{size:`m`}}}},aQ=class{constructor(e,t,n=null,r=!0){this.name=e,this.icon=t,this.group=n,this.label=`drawing-tools.action.${e}`,this.lineStyleComponentDisplayed=r}onActivate(){throw Error(`Not implemented`)}onDeactivate(){throw Error(`Not implemented`)}},HDt={},UDt={width:`18`,height:`18`,viewBox:`0 0 22 22`,xmlns:`http://www.w3.org/2000/svg`};function WDt(e,t){return z(),B(`svg`,UDt,[...t[0]||=[H(`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 GDt=q(HDt,[[`render`,WDt]]),KDt=class{constructor(){this._listenersTarget=new Map}on(e,t,n=window,r={}){this._listenersTarget.has(n)||this._listenersTarget.set(n,new Map);let i=this._listenersTarget.get(n);i.has(e)||i.set(e,new Map);let a=t.bind(this);return r?.once&&(a=(...r)=>{t.call(this,...r),this.off(e,t,n)}),n.addEventListener(e,a,r),i.get(e).set(t,a),()=>{this.off(e,t,n)}}off(e,t,n=window){if(!this._listenersTarget.has(n))return;let r=this._listenersTarget.get(n);if(!r.has(e))return;let i=r.get(e).get(t);n.removeEventListener(e,i),r.get(e).delete(t),r.get(e).size===0&&r.delete(e),r.size===0&&this._listenersTarget.delete(n)}},qDt=`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`,JDt=`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`,YDt=`url("${qDt}") 0 20, auto`,XDt=`url("${JDt}") 1 23, auto`,oQ=class extends KDt{constructor(e,{pointerUpCursor:t=YDt,pointerDownCursor:n=XDt,element:r=e.canvas}={}){super(),this._engine2d=e,this.element=r,this.pointerUpCursor=t,this.pointerDownCursor=n,this._eventCache=[]}_getClientPosition(e){return{clientX:e.clientX,clientY:e.clientY}}_getPositions(e){let{clientX:t,clientY:n}=this._getClientPosition(e),{x:r,y:i}=this._engine2d.canvas.getBoundingClientRect();return this._engine2d.camera.getPosition({x:Math.max(t-r,0),y:Math.max(n-i,0)})}_getCanvasPosition(e){let{clientX:t,clientY:n}=this._getClientPosition(e),{x:r,y:i}=this.element.getBoundingClientRect();return{x:Math.max(t-r,0),y:Math.max(n-i,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,n=!e.isPrimary,r=this._eventCache.length>1;e.shiftKey||t||n||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()}},sQ=`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`,ZDt=class extends aQ{constructor({viewer:e},t){super(`pointer`,GDt,`pointers`,!1),this._pointerManager=new QDt(e,t)}onActivate(){this._pointerManager.enable()}onDeactivate(){this._pointerManager.disable()}},QDt=class extends oQ{constructor(e,t){super(e,{pointerUpCursor:sQ,pointerDownCursor:sQ,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:n}){if(!this._currentDrawing)return;let r=0,i=0;if(window.TouchEvent&&t instanceof TouchEvent){let e=t.touches[0];this.previousTouch&&(r=e.pageX-this.previousTouch.pageX,i=e.pageY-this.previousTouch.pageY),this.previousTouch=e}else{let{movementX:e,movementY:n}=t;r=e,i=n}let a={x:n.x-r,y:n.y-i},o=this._engine2d.camera.getPosition(a),s=e.x-o.x,c=e.y-o.y;this._currentDrawing.x+=s,this._currentDrawing.y+=c}},$Dt={},eOt={width:`14`,height:`16`,viewBox:`0 0 14 16`,xmlns:`http://www.w3.org/2000/svg`};function tOt(e,t){return z(),B(`svg`,eOt,[...t[0]||=[H(`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 nOt=q($Dt,[[`render`,tOt]]),rOt=`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`,iOt=`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`,aOt=`url("${rOt}") 7 23, auto`,oOt=`url("${iOt}") 7 18, auto`,sOt=class extends aQ{constructor({viewer:e}){super(`pan`,nOt,`pointers`,!1),this._pointerManager=new cOt(e)}onActivate(){this._pointerManager.enable()}onDeactivate(){this._pointerManager.disable()}},cOt=class extends oQ{constructor(e){super(e,{pointerUpCursor:aOt,pointerDownCursor:oOt}),this.previousTouch=null}onDrag({mouseEvent:e}){let t=0,n=0;if(window.TouchEvent&&e instanceof TouchEvent){let r=e.touches[0];this.previousTouch&&(t=r.pageX-this.previousTouch.pageX,n=r.pageY-this.previousTouch.pageY),this.previousTouch=r}else{let{movementX:r,movementY:i}=e;t=r,n=i}this._engine2d.camera.translate(-t*window.devicePixelRatio,-n*window.devicePixelRatio)}onMouseUp(){this.previousTouch=null}},cQ=class extends aQ{constructor(e,t,n,r,i,a=n){super(n,r,i),this._pointermanager=new lOt(e,t,a)}onActivate(){this._pointermanager.enable()}onDeactivate(){this._pointermanager.disable()}},lOt=class extends oQ{constructor(e,t,n){super(e),this._drawer=t,this._currentDrawing=null,this.shape=n}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)}},uOt={},dOt={width:`18`,height:`18`,viewBox:`0 0 22 22`,xmlns:`http://www.w3.org/2000/svg`};function fOt(e,t){return z(),B(`svg`,dOt,[...t[0]||=[H(`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 pOt=q(uOt,[[`render`,fOt]]),mOt=class extends cQ{constructor({viewer:e},t){super(e,t,`pen`,pOt,null,`freehand`)}},hOt={},gOt={width:`22`,height:`22`,viewBox:`0 0 22 23`,xmlns:`http://www.w3.org/2000/svg`};function _Ot(e,t){return z(),B(`svg`,gOt,[...t[0]||=[H(`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 vOt=q(hOt,[[`render`,_Ot]]),yOt=`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`,bOt=class extends aQ{constructor(e,t){super(`text`,vOt,null,!1),this._viewerPlanPlugin=e,this._drawer=t,this.canvas=e.engine.canvas;let n=I(!1);this.autoDeactivateCallback=null,this.connector={enabledRef:n,deactivateAction(){this.autoDeactivateCallback?.()}},this.onClick=n=>{this.autoDeactivateCallback();let{x:r,y:i}=e.viewer.camera.getPosition({x:n.offsetX,y:n.offsetY});t.makeDrawing(`text`,{x:r,y:i})}}onActivate(e){this.canvas.addEventListener(`click`,this.onClick),this._viewerPlanPlugin.$viewer.localContext.el.style.cursor=yOt,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}},xOt={},SOt={width:`16`,height:`16`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`};function COt(e,t){return z(),B(`svg`,SOt,[...t[0]||=[H(`path`,{"fill-rule":`evenodd`,"clip-rule":`evenodd`,d:`M0 0H16V16H0V0ZM2 2V14H14V2H2Z`},null,-1)]])}var wOt=q(xOt,[[`render`,COt]]),TOt=class extends cQ{constructor({viewer:e},t){super(e,t,`rectangle`,wOt,`shapes`)}},EOt={},DOt={width:`16`,height:`16`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`};function OOt(e,t){return z(),B(`svg`,DOt,[...t[0]||=[H(`path`,{"fill-rule":`evenodd`,"clip-rule":`evenodd`,d:`M16 1.37853L1.37853 16L0 14.6215L14.6215 0L16 1.37853Z`},null,-1)]])}var kOt=q(EOt,[[`render`,OOt]]),AOt=class extends cQ{constructor({viewer:e},t){super(e,t,`line`,kOt,`shapes`)}},jOt={},MOt={width:`17`,height:`17`,viewBox:`0 0 17 17`,xmlns:`http://www.w3.org/2000/svg`};function NOt(e,t){return z(),B(`svg`,MOt,[...t[0]||=[H(`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 POt=q(jOt,[[`render`,NOt]]),FOt=class extends cQ{constructor({viewer:e},t){super(e,t,`arrow`,POt,`shapes`)}},IOt={},LOt={width:`17`,height:`17`,viewBox:`0 0 17 17`,xmlns:`http://www.w3.org/2000/svg`};function ROt(e,t){return z(),B(`svg`,LOt,[...t[0]||=[H(`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 zOt=q(IOt,[[`render`,ROt]]),BOt=class extends cQ{constructor({viewer:e},t){super(e,t,`ellipse`,zOt,`shapes`)}},VOt={name:`EraserIcon`,props:{color:{type:String,default:`currentColor`}}},HOt=[`fill`];function UOt(e,t,n,r,i,a){return z(),B(`svg`,{width:`20`,height:`20`,viewBox:`0 0 22 22`,fill:n.color,xmlns:`http://www.w3.org/2000/svg`},[...t[0]||=[H(`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,HOt)}var WOt=q(VOt,[[`render`,UOt]]),GOt=`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`,KOt=`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`,qOt=`url("${GOt}") 7 23, auto`,JOt=`url("${KOt}") 7 18, auto`,YOt=class extends aQ{constructor({viewer:e},t){super(`eraser`,WOt,null,!1),this._pointerManager=new XOt(e,t)}onActivate(){this._pointerManager.enable()}onDeactivate(){this._pointerManager.disable()}},XOt=class extends oQ{constructor(e,t){super(e,{element:e.canvas.parentElement,pointerUpCursor:qOt,pointerDownCursor:JOt}),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)}},lQ=class{constructor(e){this.drawingType=e}parse(e){throw Error(`Not implemented`)}toString(e){throw Error(`Not implemented`)}},ZOt=class extends lQ{constructor(){super(`rectangle`)}toString(e){let{p1:t,p2:n,p3:r,p4:i,lineColor:a,lineWidth:o}=e;return`<path d="M ${t.x} ${t.y} L ${n.x} ${n.y} L ${r.x} ${r.y} L ${i.x} ${i.y} Z" stroke-width="${o}" stroke="#${a.toString(16).padStart(6,0)}"/>`}parse(e){let t=e.querySelector(`path`),[,n,r,,i,a,,o,s,,c,l]=t.getAttribute(`d`).split(` `),u=t.getAttribute(`stroke`)?.substring(1),d=t.getAttribute(`stroke-width`);return{p1:{x:parseFloat(n),y:parseFloat(r)},p2:{x:parseFloat(i),y:parseFloat(a)},p3:{x:parseFloat(o),y:parseFloat(s)},p4:{x:parseFloat(c),y:parseFloat(l)},lineColor:parseInt(u,16),lineWidth:parseFloat(d)}}},QOt=class extends lQ{constructor(){super(`line`)}toString(e){let{p1:t,p2:n,lineWidth:r,lineColor:i}=e;return`<line x1="${t.x}" y1="${t.y}" x2="${n.x}" y2="${n.y}" stroke-width="${r}" stroke="#${i.toString(16).padStart(6,0)}"/>`}parse(e){let t=e.querySelector(`line`),n=t.getAttribute(`x1`),r=t.getAttribute(`y1`),i=t.getAttribute(`x2`),a=t.getAttribute(`y2`),o=t.getAttribute(`stroke`)?.substring(1),s=t.getAttribute(`stroke-width`);return{p1:{x:parseFloat(n),y:parseFloat(r)},p2:{x:parseFloat(i),y:parseFloat(a)},lineWidth:parseFloat(s),lineColor:parseInt(o,16)}}},$Ot=class extends lQ{constructor(){super(`arrow`)}toString(e){let{p1:t,p2:n,lineWidth:r,lineColor:i}=e;return`<line x1="${t.x}" y1="${t.y}" x2="${n.x}" y2="${n.y}" stroke-width="${r}" stroke="#${i.toString(16).padStart(6,0)}"/>`}parse(e){let t=e.querySelector(`line`),n=t.getAttribute(`x1`),r=t.getAttribute(`y1`),i=t.getAttribute(`x2`),a=t.getAttribute(`y2`),o=t.getAttribute(`stroke`)?.substring(1),s=t.getAttribute(`stroke-width`);return{p1:{x:parseFloat(n),y:parseFloat(r)},p2:{x:parseFloat(i),y:parseFloat(a)},lineWidth:parseFloat(s),lineColor:parseInt(o,16)}}};function uQ(e){if(e.length===0)return``;let t=e[0],n=`M ${t.x} ${t.y}`;for(let t=0;t<e.length;t++){let r=e[t];n+=` C ${r.cpX1} ${r.cpY1} ${r.cpX2} ${r.cpY2} ${r.toX} ${r.toY}`}return n}function dQ(e){let t=e.split(` `),n=t.shift();if(n!==`M`)throw Error(`svgPathStringToCurves: invalid svg path string. Must start with M, got "${n}"`);let r=parseFloat(t.shift()),i=parseFloat(t.shift()),a=[];for(;t.shift()===`C`;){let e=parseFloat(t.shift()),n=parseFloat(t.shift()),o=parseFloat(t.shift()),s=parseFloat(t.shift()),c=parseFloat(t.shift()),l=parseFloat(t.shift());a.push({type:`curve`,x:r,y:i,cpX1:e,cpY1:n,cpX2:o,cpY2:s,toX:c,toY:l}),r=c,i=l}return a}var ekt=class extends lQ{constructor(){super(`ellipse`)}toString(e){let{curve1:t,curve2:n,curve3:r,curve4:i,lineColor:a,lineWidth:o}=e;return`<path d="${uQ([t,n,r,i])} Z" stroke-width="${o}" stroke="#${a.toString(16).padStart(6,0)}" />`}parse(e){let t=e.querySelector(`path`),n=dQ(t.getAttribute(`d`)),r=t.getAttribute(`stroke`)?.substring(1),i=t.getAttribute(`stroke-width`);return{curves:n,lineColor:parseInt(r,16),lineWidth:parseFloat(i)}}},tkt=class extends lQ{constructor(){super(`text`)}toString(e){let{x:t,y:n,rotation:r,scale:i,text:a,size:o,color:s}=e;return`<text x="${t}" y="${n}" tranform="rotate(${r}) scale(${i})" font-size="${o}px" ${s?`color="#${s}"`:``}>${a}</text>`}parse(e){let t=e.querySelector(`text`),n=t.getAttribute(`x`),r=t.getAttribute(`y`),i=t.getAttribute(`tranform`).match(/rotate\((.*)\)/)?.[1]??0,a=t.getAttribute(`tranform`).match(/scale\((.*)\)/)?.[1]??1,o=t.textContent===`null`?null:t.textContent,s=t.getAttribute(`font-size`).slice(0,-2),c=t.getAttribute(`color`);return{x:parseFloat(n),y:parseFloat(r),rotation:parseFloat(i),scale:parseFloat(a),text:o,size:parseFloat(s),color:c?c.slice(1):null}}},nkt=class extends lQ{constructor(){super(`freehand`)}toString(e){let{curves:t,lineWidth:n,lineColor:r}=e,i=`stroke-width="${n}" stroke="#${r.toString(16).padStart(6,0)}"`;return`<path d="${uQ(t)}" ${i}/>`}parse(e){let t=e.querySelector(`path`),n=dQ(t.getAttribute(`d`)),r=t.getAttribute(`stroke`)?.substring(1),i=t.getAttribute(`stroke-width`);return{curves:n,lineWidth:parseFloat(i),lineColor:parseInt(r,16)}}},rkt=class{constructor(){this.drawingSvgParsers=new Map,[new ZOt,new QOt,new $Ot,new ekt,new nkt,new tkt].map(e=>this.drawingSvgParsers.set(e.drawingType,e))}parse(e){try{let t=new DOMParser().parseFromString(e.content,`image/svg+xml`),n=t.querySelector(`svg`).getAttribute(`type`),r=+t.querySelector(`svg`).getAttribute(`data-bimdata-elevation`),i=this.drawingSvgParsers.get(n);if(!i)throw TypeError(`No drawing parser for type ${n}`);let a=i.parse(t);return a.apiId=e.id,a.type=n,a.z=r,a}catch(t){console.warn(`[Drawing Tools - Parser] Error parsing drawing ${e.id}, ignored.`,t)}}toString(e){let{type:t,z:n}=e,r=this.drawingSvgParsers.get(t);if(!r)throw TypeError(`No drawing parser for type ${t}`);return`<svg type="${t}" data-bimdata-elevation="${n}" xmlns="http://www.w3.org/2000/svg">${r.toString(e)}</svg>`}},ikt=class{constructor(e){this._api=e,this._parser=new rkt,this.queue=QE()}async getDrawingsData(e){let{cloudId:t,projectId:n}=this._api;return(await this._api.apiClient.modelApi.getDrawings(t,e,n)).map(e=>this._parser.parse(e)).filter(Boolean)}save(e,t){let n=this._parser.toString(e);if(!n)return;let{cloudId:r,projectId:i}=this._api,a={content:n},o;o=e.apiId?async()=>{try{await this._api.apiClient.modelApi.updateDrawing(r,e.apiId,t,i,a)}catch(t){console.error(`Cannot update drawing of type: "${e.type}"`,t)}}:async()=>{try{e.apiId=(await this._api.apiClient.modelApi.createDrawing(r,t,i,a)).id}catch(t){console.error(`Cannot create drawing of type: "${e.type}"`,t)}},this.queue.push(o)}async delete(e,t){if(!e.apiId)return;let{cloudId:n,projectId:r}=this._api;try{await this._api.apiClient.modelApi.deleteDrawing(n,e.apiId,t,r)}catch(t){console.error(`Cannot delete drawing of type: "${e.type}"`,t)}}},fQ=class{constructor(e){this.drawingTypes=e}pick(e,t){throw Error(`Not implemented`)}},akt=class extends fQ{constructor(e){super([`rectangle`,`ellipse`,`arrow`,`line`,`freehand`]),this._engine2d=e}pick(e,t){let{canvasPosition:n}=t,r=this._engine2d.picker.pick(n);if(r)return e.get(r.id)}},okt=class extends fQ{constructor(){super([`text`])}pick(e,t){let{mouseEvent:n}=t,r=n.target;return e.get(r.id)}},pQ=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.`)}},mQ=class{constructor(e){this.drawingTypes=e}create(e,t){throw Error(`Not implemented`)}},skt=`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`,ckt=`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`,lkt=4,ukt=40,hQ=4,dkt=2,fkt={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 n=Xo(`$viewer`).localContext.viewer.viewer.canvas,r=I(e.newMarker),i=I(e.initText),a=I(e.initSize),o=I(e.initColor);rs(i,e=>t(`text-update`,e)),rs(a,e=>t(`size-update`,e)),rs(o,e=>t(`color-update`,e));let s=I(null),c=()=>s.value?.focus(),l=I(null),u=I(null),d=I(null);async function f(){if(!r.value)return;await ko();let{width:e}=l.value.getBoundingClientRect();u.value=e+12,d.value=1,await ko();let{scrollHeight:t}=s.value;d.value=t+2}rs([()=>e.scale,r,i,a],f);let p=()=>{e.textToolEnabled&&(r.value=!0)},m=e=>{e.key===`Escape`&&(r.value=!1)};rs(r,async e=>{t(`edit-update`,e),e?(document.addEventListener(`keydown`,m),await ko(),c()):(document.removeEventListener(`keydown`,m),y.value=!1)});let h=K(()=>a.value/(dkt*window.devicePixelRatio)),g=()=>{a.value>lkt&&(a.value-=hQ),c()},_=()=>{a.value<ukt&&(a.value+=hQ),c()},v=I(null),y=I(!1),b=I(!1);return Sc(()=>{f(),c()}),{paletteSvg:skt,textCursor:ckt,textarea:s,textEl:l,colorElement:v,edit:r,text:i,textAreaWidth:u,textAreaHeight:d,size:h,sizeRef:a,color:o,colorSelectorDisplayed:y,colorSelectorTop:b,onTextClick:p,decrementSize:g,incrementSize:_,onTextColorClick:()=>{if(y.value=!y.value,y.value){let{y:e,height:t}=n.getBoundingClientRect(),{y:r}=v.value.getBoundingClientRect();b.value=r>e+t/2}},onTextColorUpdate:e=>{o.value=e,y.value=!1,c()},onDeleteClick:()=>{t(`delete-marker`),t(`delete-drawing`)}}}},pkt=[`id`],mkt={key:0},hkt={class:`bimdata-drawing-tools__text-marker__edit-content`,style:`transform: translate(-1px, -1px)`},gkt={class:`bimdata-drawing-tools__text-marker__edit-content__header`},_kt=[`src`];function vkt(e,t,n,r,i,a){let o=R(`BIMDataColorSelector`),s=R(`BIMDataIconDelete`),c=Fc(`click-away`);return z(),B(`div`,{class:`bimdata-drawing-tools__text-marker`,style:N(`font-size:${r.size}px; z-index: ${r.edit?1:0};`)},[H(`div`,{style:N(`cursor: ${n.textToolEnabled?r.textCursor:``}`)},[H(`div`,{ref:`textEl`,class:`bimdata-drawing-tools__text-marker__text`,style:N(`
2432
2432
  font-size:${r.size}px;
2433
2433
  transform-origin: top left;
2434
2434
  transform: scale(${n.scale});
@@ -6318,5 +6318,5 @@ void main() {
6318
6318
  --bimdata-local-context-width: ${r.width}px;
6319
6319
  --bimdata-local-context-center-width: ${r.centerWidth}px;
6320
6320
  --bimdata-local-context-resolution: ${r.resolution};
6321
- `),onMouseenter:t[0]||=(...e)=>r.onMouseEnter&&r.onMouseEnter(...e),onMouseleave:t[1]||=(...e)=>r.onMouseLeave&&r.onMouseLeave(...e)},[U(o,{ref:`modalManagerTemplateRef`},null,512),H(`div`,OGt,[r.windowPlugins.leftSidePanel?(z(),V(s,{key:0,plugin:r.windowPlugins.leftSidePanel},null,8,[`plugin`])):G(``,!0),H(`div`,kGt,[(z(!0),B(bu,null,Rc(r.windowPlugins.free,e=>(z(),V(c,{key:e.name,class:P({"window-container__content__center__viewer":e.isViewer}),plugin:e},null,8,[`class`,`plugin`]))),128)),U(l,{position:`left`,plugins:r.windowPlugins.leftButtonColumn},null,8,[`plugins`]),U(l,{position:`right`,plugins:r.windowPlugins.rightButtonColumn},null,8,[`plugins`])]),r.windowPlugins.rightSidePanel?(z(),V(s,{key:1,plugin:r.windowPlugins.rightSidePanel},null,8,[`plugin`])):G(``,!0)]),r.loading?(z(),B(`div`,AGt,[r.spinner&&r.spinner.component?(z(),V(Pc(r.spinner.component),Br(Vu({key:0},r.spinner.props)),null,16)):(z(),V(u,{key:1,size:`20px`,border:`3px`}))])):G(``,!0),r.layoutSettingsDisplayed?(z(),B(`div`,jGt,[U(d)])):G(``,!0)],36)}var NGt=q(DGt,[[`render`,MGt],[`__scopeId`,`data-v-485f288e`]]),PGt=class{constructor(e=!0){let t=wWt(Xh,null,{resizable:e});t.registerContent(`default`,NGt),this.settings=Ea({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?TWt(e):null}copy(e,t=!0){return EWt(this.areas.layout,e,t)}open({ratio:e,direction:t,insertAfter:n,windowName:r=null,windowState:i=null,localContextId:a=null}={}){let o=r?{options:{windowName:r,windowState:i}}:null;return a===null?this.areas.splitLayout(e,t,n,o):this.areas.split(a,e,t,n,o)}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 n=new Set(e.windowState?.modelIds),r=new Set(t.windowState?.modelIds);return n.size===r.size&&[...n].every(e=>r.has(e))}return e.windowName||t.windowName||e.direction!==t.direction||e.children.length!==t.children.length?!1:e.children.every((e,n)=>this.compare(e,t.children[n]))}},FGt={name:`@bimdata/viewer`,type:`module`,version:`2.17.0-beta.6`,description:`A customizable BIM viewer.`,keywords:[`bim`,`viewer`,`bimdata`,`ifc`,`bcf`],types:`./index.d.ts`,author:`BIMData.io`,homepage:`https://developers.bimdata.io/viewer/index.html`,repository:{url:`https://github.com/bimdata/viewer`},bugs:{email:`support@bimdata.io`},browserslist:[`last 2 chrome version`,`last 2 firefox version`],main:`dist/bimdata-viewer.esm.min.js`,module:`dist/bimdata-viewer.esm.min.js`,scripts:{dev:`vite -c build/vite.config.dev.js`,build:`node scripts/build.mjs`,"build:prod":`vite build -c build/vite.config.prod.js && esbuild dist/bimdata-viewer.esm.min.js --minify --outfile=dist/bimdata-viewer.esm.min.js --allow-overwrite`,"build:offline":`vite build -c build/vite.config.offline.js && esbuild dist/bimdata-viewer.offline.esm.min.js --minify --outfile=dist/bimdata-viewer.offline.esm.min.js --allow-overwrite`,"build:runtime":`vite build -c build/vite.config.runtime.js && esbuild dist/bimdata-viewer.runtime.esm.min.js --minify --outfile=dist/bimdata-viewer.runtime.esm.min.js --allow-overwrite`,"build:split":`vite build -c build/vite.config.split.js && esbuild dist/bimdata-viewer.split.esm.min.js --minify --outfile=dist/bimdata-viewer.split.esm.min.js --allow-overwrite`,"build:umd":`vite build -c build/vite.config.umd.js && esbuild dist/bimdata-viewer.umd.cjs --minify --outfile=dist/bimdata-viewer.umd.min.cjs`,"cy:run":`cypress run`,"cy:open":`cypress open`,prebuild:`rm -rf dist`,prepublishOnly:`npm run build`,"semantic-release":`semantic-release`,serve:`http-server -c-1 --silent`,test:`npm run test:unit & npm run build & npm run test:e2e`,"test:unit":`jest`,"test:e2e":`start-server-and-test 'npm run serve -- -p 8080' http://localhost:8080 cy:run`,"test:e2e-dev":`start-server-and-test 'npm run serve -- -p 8080' http://localhost:8080 cy:open`,version:`echo $npm_package_version`,ts:`tsc`},files:[`dist/*`,`types/*`,`CHANGELOG.md`,`README.md`,`package.json`,`package-lock.json`,`index.d.ts`],devDependencies:{"@babel/preset-env":`^7.29.0`,"@bimdata/2d-engine":`2.6.7`,"@bimdata/areas-next":`0.1.17`,"@bimdata/bcf-components":`6.7.7`,"@bimdata/components":`1.10.1`,"@bimdata/design-system":`2.3.0`,"@bimdata/engine-2d":`0.0.23`,"@bimdata/html-to-image":`1.11.16`,"@bimdata/typescript-fetch-api-client":`10.33.0`,"@eslint/eslintrc":`^3.3.4`,"@eslint/js":`^10.0.1`,"@photo-sphere-viewer/core":`^5.14.1`,"@rollup/plugin-alias":`^6.0.0`,"@rollup/plugin-babel":`^7.0.0`,"@rollup/plugin-commonjs":`^29.0.0`,"@rollup/plugin-image":`^3.0.3`,"@rollup/plugin-replace":`^6.0.3`,"@semantic-release/changelog":`^6.0.3`,"@semantic-release/commit-analyzer":`^13.0.1`,"@semantic-release/git":`^10.0.1`,"@semantic-release/github":`^12.0.6`,"@semantic-release/npm":`^13.1.5`,"@semantic-release/release-notes-generator":`^14.1.0`,"@vitejs/plugin-vue":`^6.0.4`,"@xeokit/xeokit-sdk":`git+https://git@github.com/Amoki/xeokit-sdk.git#b3227526bbbe8ac49c8c0c1d121363ca79781824`,"@zip.js/zip.js":`^2.8.21`,async:`^3.2.6`,autoprefixer:`^10.4.27`,"babel-core":`^7.0.0-bridge.0`,"babel-jest":`^30.2.0`,"conventional-changelog-eslint":`^6.0.0`,cypress:`^15.11.0`,esbuild:`^0.27.3`,eslint:`^10.0.2`,"eslint-config-prettier":`^10.1.8`,"eslint-plugin-cypress":`^6.1.0`,"eslint-plugin-jest":`^29.15.0`,"eslint-plugin-prettier":`^5.5.5`,"eslint-plugin-vue":`^10.8.0`,globals:`^17.4.0`,html2canvas:`^1.4.1`,"http-server":`^14.1.1`,jest:`^30.2.0`,"jest-environment-jsdom":`^30.2.0`,lodash:`^4.17.23`,"pdfjs-dist":`^5.5.207`,postcss:`^8.5.6`,prettier:`^3.8.1`,"sass-embedded":`^1.97.3`,"semantic-release":`^25.0.3`,"start-server-and-test":`^2.1.5`,vite:`^8.0.0`,"vite-plugin-css-injected-by-js":`^4.0.1`,vue:`^3.5.29`,"vue-eslint-parser":`^10.4.0`,"vue-i18n":`^11.2.8`}},IGt=1,LGt=class{math=dWe;constructor({plugins:e,api:t,ui:n,locale:r=`fr`}){this.instanceId=IGt++,this.pluginManager=new hVt(e),this.windowManager=new _Vt,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new AUt(t),this.globalContext=new Qre(this),this.state=UUt(this),this.shortcutManager=v(this.state),this.uiSettings=n||{},this.i18n=new Xre(r),this._contextMenu=null,this.layout=new PGt(this.uiSettings.resizable!==!1),this._darkTheme=I(n?.darkTheme??!1),this.localContext=null,window.$viewer=this}get darkTheme(){return this._darkTheme.value}set darkTheme(e){this._darkTheme.value=e}get version(){return FGt.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||d}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 RGt(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 zGt=Object.freeze({25:`GUEST`,50:`USER`,100:`ADMIN`}),q9=Object.freeze({READ:`read`,WRITE:`write`});function J9(e){let t={};return e.forEach(e=>{let[n,r]=e.split(`:`);t[n]?t[n].push(r):t[n]=[r]}),t}var BGt={token_scopes:[],usable_scopes:[],user_role:25};function Y9(e=BGt){let t=J9(e.token_scopes),n=J9(e.usable_scopes);return{...WE(e),tokenScopes:t,usableScopes:n,userRole:zGt[e.user_role],user:e.user?WE(e.user):null,hasBcfReadPermission:n.bcf?.includes(q9.READ)??!1,hasBcfWritePermission:n.bcf?.includes(q9.WRITE)??!1,hasModelReadPermission:n.model?.includes(q9.READ)??!1,hasModelWritePermission:n.model?.includes(q9.WRITE)??!1,hasDocReadPermission:n.document?.includes(q9.READ)??!1,hasDocWritePermission:n.document?.includes(q9.WRITE)??!1}}var VGt={de:{BcfComponents:{back:`Zurück`,BcfFilters:{filtersButton:`Filter`,filtersTitle:`Filter`,priorityLabel:`Priorität`,statusLabel:`Status`,stageLabel:`Phase`,assignedToLabel:`Zugewiesen an`,creatorsLabel:`Erstellt von`,tagsLabel:`Tags`,resetButton:`Zurücksetzen`,searchButton:`Suchen`,undefined:`Nicht definiert`,datePlaceholder:`Erstellungsdatum`},BcfSettings:{title:`BCF-Parameter`,text:`Erstellen, füllen und listen Sie die BCF-Einstellungen auf, die Sie für dieses Projekt haben möchten.`,validateButton:`Die BCF-Parameter anerkennen`},BcfStatistics:{emptyText:`Fügen Sie Fragen hinzu, um zugehörige Statistiken hier anzuzeigen.`,issues:`Probleme`,extension:{Priority:`Priorität`,PriorityNotDefined:`Keine Priorität`,PriorityTitle:`Prioritäten`,Status:`Status`,StatusNotDefined:`Kein Status`,StatusTitle:`Status`}},BcfTopicCard:{priority:`Priorität`,noPriority:`Keine`,assignedTo:`Zugewiesen an`,elements:`Elemente`,notSpecified:`Nicht definiert`,see:`Anzeigen`},BcfTopicCreationCard:{text:`Ein neues BCF-Thema erstellen`,createBcfSideTitle:`Ein Problem melden`},BcfTopicForm:{dragDropImageText:`Bitte wählen Sie eine Datei aus.`,addObjectButton:`Objekt`,addAnnotationButton:`Annotation`,annotationButtonTooltip:`Zu diesem Thema gibt es derzeit keine Ansichten.`,addPictureButton:`Fügen Sie ein Bild hinzu.`,titlePlaceholder:`Titel *`,titleErrorMessage:`Titel fehlt`,typeLabel:`Typ`,priorityLabel:`Priorität`,statusLabel:`Status`,stageLabel:`Phase`,assignedToLabel:`Zugewiesen an`,dueDateLabel:`Fälligkeitsdatum (TT.MM.JJJJ)`,descriptionLabel:`Beschreibung`,labelsLabel:`Tags`,createButton:`Bestätigen`,updateButton:`Änderungen übernehmen`,modalText:`Sie sind dabei, die Bearbeitung der Ausgabe {Name} zu beenden, aber es gibt noch ungespeicherte Änderungen.`,cancelButton:`Änderungen verwerfen`,continueButton:`Änderungen fortsetzen`,createTitle:`Ein Problem melden`,dragDropImageTextTablet:`Foto machen`,takeSnapshot:`Mach einen Schnappschuss`,importFile:`Eine Datei importieren`,searchPlaceholder:`Suchen`,emptySearch:`kein Ergebnis`,documentsLabel:`Dokumente`,documentsCount:`Dokumente – {count} ausgewählte Dokumente`,groupsLabel:`Berechtigungen`,groupsCount:`Berechtigungen – {count} ausgewählte Gruppen`,groupsText:`Wählen Sie die Benutzergruppen aus, die dieses Thema sehen und damit interagieren dürfen.`,validate:`Bestätigen`},BcfTopicOverview:{openViewer:`Im Viewer öffnen`,openViewerNoModels:`Es sind keine Vorlagen zur Ansicht bereit`,elements:`{count} Elemente`,noElements:`kein Element`,type:`Typ`,noTypeSpecified:`Kein Typ angegeben`,description:`Beschreibung`,noDescriptionProvided:`Keine Beschreibung angegeben`,assignedTo:`Zugeteilt an`,notAssigned:`Nicht zugewiesen`,dueDate:`Fälligkeitsdatum`,noDueDate:`Kein Fälligkeitsdatum`,informations:`Informationen`,status:`Status`,noStatusSpecified:`Kein Status angegeben`,stage:`Phase`,noStageProvided:`Keine Phase angegeben`,priority:`Priorität`,priorityNotDefined:`Nicht definiert`,tags:`Tags`,noTags:`Keine Tags`,commentButton:`Ein Kommentar veröffentlichen`,deleteText:`Sie löschen jetzt {Name}`,deleteBcfButton:`Dieses BCF löschen`,keepBcfButton:`Dieses BCF beibehalten`,author:`Autor`},BcfTopicsTable:{headers:{index:`#`,priority:`Priorität`,status:`Status`,title:`Titel`,creator:`Autor`,date:`Datum`}},BcfTopicActionsCell:{seeButton:`Anzeigen`},BcfTopicComments:{commentButton:`Ein Kommentar verfassen`,commentLabel:`Ein Kommentar verfassen`,commentText:`Kommentar`,cancelButton:`Abbrechen`,publishButton:`Veröffentlichen`,commentsText:`Kommentare`,deleteCommentText:`Diesen Kommentar löschen?`,deleteButton:`Löschen`,takeSnapshot:`Mach einen Schnappschuss`,edited:`bearbeitet`},BcfTopicPriorityCell:{noPriority:`Keine`},SettingCard:{addButton:`ein Element hinzufügen`,cancelButton:`Abbrechen`,validateButton:`Bestätigen`,deleteExtensionText:`Diesen Parameter löschen`,deleteButton:`Löschen`,title:{Priority:`Prioritäten`,Label:`Tags`,Status:`Status`,Type:`Typen`,Stage:`Phasen`},input:{Priority:`Eine neue Priorität hinzufügen`,Label:`Ein neues Etikett hinzufügen`,Status:`Einen neuen Status hinzufügen`,Type:`Einen neuen Typ hinzufügen`,Stage:`Eine neue Phase hinzufügen`},text:{Priority:`Liste der Prioritäten`,Label:`Liste von Tags`,Status:`Liste der Status`,Type:`Liste der Typen`,Stage:`Liste der Phasen`}}}},en:{BcfComponents:{back:`Back`,BcfFilters:{filtersButton:`Filters`,filtersTitle:`Filters`,priorityLabel:`Priority`,statusLabel:`Status`,stageLabel:`Stage`,assignedToLabel:`Assigned to`,creatorsLabel:`Created by`,tagsLabel:`Tags`,resetButton:`Reset`,searchButton:`Search`,undefined:`Not defined`,datePlaceholder:`Creation date`},BcfSettings:{title:`BCF Settings`,text:`Create, enter in, and list the BCF settings you would like to have for this project`,validateButton:`Validate BCF settings`},BcfStatistics:{emptyText:`Add BCF Topics to start to have some stats here.`,issues:`issues`,extension:{Priority:`Priority`,PriorityNotDefined:`No priority`,PriorityTitle:`Priorities`,Status:`Status`,StatusNotDefined:`No status`,StatusTitle:`Status`}},BcfTopicCard:{priority:`Priority`,noPriority:`None`,assignedTo:`Assigned to`,elements:`Elements`,notSpecified:`Not specified`,see:`See`},BcfTopicCreationCard:{text:`Create a new BCF topic`,createBcfSideTitle:`Report a problem`},BcfTopicForm:{dragDropImageText:`Please select a file`,addObjectButton:`Object`,addAnnotationButton:`Annotation`,annotationButtonTooltip:`This topic has no viewpoint`,addPictureButton:`Add a picture`,titlePlaceholder:`Title *`,titleErrorMessage:`Missing title`,typeLabel:`Type`,priorityLabel:`Priority`,statusLabel:`Status`,stageLabel:`Stage`,assignedToLabel:`Assigned to`,dueDateLabel:`Due date`,descriptionLabel:`Description`,labelsLabel:`Tags`,createButton:`Validate`,updateButton:`Modify this BCF`,modalText:`You are about to quit editing issue {name} but there are unsaved changes.`,cancelButton:`Discard changes`,continueButton:`Continue editing`,createTitle:`Report a problem`,dragDropImageTextTablet:`Take a picture`,takeSnapshot:`Take a snapshot`,importFile:`Import a file`,searchPlaceholder:`Search`,emptySearch:`No result`,documentsLabel:`Add a file`,documentsCount:`Files - {count} selected files`,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ón`},BcfSettings:{title:`Parámetros del BCF`,text:`Cree, rellene y enumere los parámetros del BCF que desea tener en este proyecto`,validateButton:`Validar los parámetros del BCF`},BcfStatistics:{emptyText:`Añada preguntas para ver las estadísticas asociadas aquí.`,issues:`problemas`,extension:{Priority:`Prioridad`,PriorityNotDefined:`Sin prioridad`,PriorityTitle:`Prioridades`,Status:`Estado`,StatusNotDefined:`Sin estado`,StatusTitle:`Estatutos`}},BcfTopicCard:{priority:`Prioridad`,noPriority:`Sin`,assignedTo:`Asignado a`,elements:`Elementos`,notSpecified:`No definido`,see:`Ver`},BcfTopicCreationCard:{text:`Crear un nuevo tema BCF`,createBcfSideTitle:`Informar de un problema`},BcfTopicForm:{dragDropImageText:`Seleccione un archivo`,addObjectButton:`Objeto`,addAnnotationButton:`Anotación`,annotationButtonTooltip:`Actualmente este tema no posee ningún punto de vista`,addPictureButton:`Añadir una imagen`,titlePlaceholder:`Título *`,titleErrorMessage:`Falta el título`,typeLabel:`Tipo`,priorityLabel:`Prioridad`,statusLabel:`Estado`,stageLabel:`Fase`,assignedToLabel:`Asignado a`,dueDateLabel:`Fecha de vencimiento (DD/MM/AAAA)`,descriptionLabel:`Descripción`,labelsLabel:`Etiquetas`,createButton:`Validar`,updateButton:`Modificar este BCF`,modalText:`Está a punto de salir de la edición del problema de {name} pero hay cambios sin guardar.`,cancelButton:`Cancelar los cambios`,continueButton:`Continuar con los cambios`,createTitle:`Informar de un problema`,dragDropImageTextTablet:`Tomar una fotografía`,takeSnapshot:`Tomar un snapshot`,importFile:`Importar un archivo`,searchPlaceholder:`Buscar`,emptySearch:`No hay resultados`},BcfTopicOverview:{openViewer:`Abrir en el visor`,openViewerNoModels:`No hay ningún modelo listo para la visualización`,elements:`{count} Elementos`,noElements:`Ningún elemento`,type:`Tipo`,noTypeSpecified:`No se especifica el tipo`,description:`Descripción`,noDescriptionProvided:`No hay descripción`,assignedTo:`Asignado a`,notAssigned:`No asignado`,dueDate:`Plazo`,noDueDate:`Sin fecha de vencimiento`,informations:`Información`,status:`Estado`,noStatusSpecified:`No se especifica el estado`,stage:`Fase`,noStageProvided:`No se indica ninguna fase`,priority:`Prioridad`,priorityNotDefined:`No definido`,tags:`Etiquetas`,noTags:`Sin etiquetas`,commentButton:`Publicar un comentario`,deleteText:`Estás a punto de borrar {name}`,deleteBcfButton:`Borrar este BCF`,keepBcfButton:`Mantenga este BCF`,author:`Autor`},BcfTopicsTable:{headers:{index:`#`,priority:`Prioridad`,status:`Estado`,title:`Título`,creator:`Autor`,date:`Fecha`}},BcfTopicActionsCell:{seeButton:`Ver`},BcfTopicComments:{commentButton:`Publicar un comentario`,commentLabel:`Publicar un comentario`,commentText:`Comentario`,cancelButton:`Cancelar`,publishButton:`Publicar`,commentsText:`comentarios`,deleteCommentText:`¿Borrar este comentario?`,deleteButton:`Borrar`,takeSnapshot:`Tomar un snapshot`},BcfTopicPriorityCell:{noPriority:`Sin`},SettingCard:{addButton:`añadir un elemento`,cancelButton:`Cancelar`,validateButton:`Validar`,deleteExtensionText:`Borrar esta configuración`,deleteButton:`Borrar`,title:{Priority:`Prioridades`,Label:`Etiquetas:`,Status:`Estatutos`,Type:`Tipos`,Stage:`Fases`},input:{Priority:`Añadir una nueva prioridad`,Label:`Añadir una nueva etiqueta`,Status:`Añadir un nuevo estado`,Type:`Añadir un nuevo tipo`,Stage:`Añadir una nueva fase`},text:{Priority:`Lista de prioridades`,Label:`Lista de etiquetas`,Status:`Lista de estatutos`,Type:`Lista de tipos`,Stage:`Lista de fases`}}}},fr:{BcfComponents:{back:`Retour`,BcfFilters:{filtersButton:`Filtres`,filtersTitle:`Filtres`,priorityLabel:`Priorité`,statusLabel:`Statut`,stageLabel:`Phase`,assignedToLabel:`Assigné à`,creatorsLabel:`Créé par`,tagsLabel:`Tags`,resetButton:`Réinitialiser`,searchButton:`Rechercher`,undefined:`Non défini`,datePlaceholder:`Date de création`},BcfSettings:{title:`Paramètres BCF`,text:`Créez, renseignez et listez les paramètres BCF que vous souhaitez avoir sur ce projet`,validateButton:`Valider les paramètres BCF`},BcfStatistics:{emptyText:`Ajoutez des questions pour voir les statistiques associées ici.`,issues:`problèmes`,extension:{Priority:`Priorité`,PriorityNotDefined:`Aucune priorité`,PriorityTitle:`Priorités`,Status:`Statut`,StatusNotDefined:`Aucun statut`,StatusTitle:`Statuts`}},BcfTopicCard:{priority:`Priorité`,noPriority:`Aucune`,assignedTo:`Assigné à`,elements:`{n} Élements`,notSpecified:`Non défini`,see:`Voir`},BcfTopicCreationCard:{text:`Créer un nouveau topic BCF`,createBcfSideTitle:`Signaler un problème`},BcfTopicForm:{dragDropImageText:`Veuillez sélectionner un fichier`,addObjectButton:`Objet`,addAnnotationButton:`Annotation`,annotationButtonTooltip:`Ce topic ne possède actuellement aucun point de vue`,addPictureButton:`Ajouter une image`,titlePlaceholder:`Titre *`,titleErrorMessage:`Titre manquant`,typeLabel:`Type`,priorityLabel:`Priorité`,statusLabel:`Statut`,stageLabel:`Phase`,assignedToLabel:`Assigné à`,dueDateLabel:`Date d'échéance`,descriptionLabel:`Description`,labelsLabel:`Tags`,createButton:`Valider`,updateButton:`Modifier ce BCF`,modalText:`Vous êtes sur le point de quitter l'édition de l'issue {name} mais il y'a des modifications non enregistrées.`,cancelButton:`Annuler les modifications`,continueButton:`Continuer les modifications`,createTitle:`Signaler un problème`,dragDropImageTextTablet:`Prendre une photo`,takeSnapshot:`Prendre un snapshot`,importFile:`Importer un fichier`,searchPlaceholder:`Rechercher`,emptySearch:`Pas de résultat`,documentsLabel:`Documents`,documentsCount:`Documents - {count} documents sélectionnés`,groupsLabel:`Permissions`,groupsCount:`Permissions - {count} groupes sélectionnés`,groupsText:`Sélectionner les groupes utilisateur qui peuvent voir ce topic et intéragir avec.`,validate:`Valider`},BcfTopicOverview:{openViewer:`Ouvrir dans le viewer`,openViewerNoModels:`Il n'y a aucun modèle prêt pour une visualisation`,elements:`{count} Élements`,noElements:`Aucun élément concerné`,type:`Type`,noTypeSpecified:`Pas de type spécifié`,description:`Description`,noDescriptionProvided:`Pas de description renseignée`,assignedTo:`Assigné à`,notAssigned:`Non assigné`,dueDate:`Échéance`,noDueDate:`Pas de date d'échéance`,informations:`Informations`,status:`Statut`,noStatusSpecified:`Pas de statut spécifié`,stage:`Phase`,noStageProvided:`Pas de phase renseignée`,priority:`Priorité`,priorityNotDefined:`Non défini`,tags:`Tags`,noTags:`Pas de tags`,commentButton:`Poster un commentaire`,deleteText:`Vous êtes sur le point de supprimer {name}`,deleteBcfButton:`Supprimer ce BCF`,keepBcfButton:`Conserver ce BCF`,author:`Auteur`},BcfTopicsTable:{headers:{index:`#`,priority:`Priorité`,status:`Statut`,title:`Titre`,creator:`Auteur`,date:`Date`}},BcfTopicActionsCell:{seeButton:`Voir`},BcfTopicComments:{commentButton:`Poster un commentaire`,commentLabel:`Poster un commentaire`,commentText:`Commentaire`,cancelButton:`Annuler`,publishButton:`Publier`,commentsText:`commentaires`,deleteCommentText:`Supprimer ce commentaire ?`,deleteButton:`Supprimer`,takeSnapshot:`Prendre un snapshot`,edited:`edité`},BcfTopicPriorityCell:{noPriority:`Aucune`},SettingCard:{addButton:`ajouter un élément`,cancelButton:`Annuler`,validateButton:`Valider`,deleteExtensionText:`Supprimmer ce paramètre`,deleteButton:`Supprimer`,title:{Priority:`Priorités`,Label:`Tags`,Status:`Statuts`,Type:`Types`,Stage:`Phases`},input:{Priority:`Ajouter une nouvelle priorité`,Label:`Ajouter un nouveau label`,Status:`Ajouter un nouveau statut`,Type:`Ajouter un nouveau type`,Stage:`Ajouter une nouvelle phase`},text:{Priority:`Liste des priorités`,Label:`Liste des tags`,Status:`Liste des statuts`,Type:`Liste des types`,Stage:`Liste des phases`}}}},it:{BcfComponents:{back:`Indietro`,BcfFilters:{filtersButton:`Filtri`,filtersTitle:`Filtri`,priorityLabel:`Priorità`,statusLabel:`Stato`,stageLabel:`Fase`,datePlaceholder:`Data di creazione`,assignedToLabel:`Assegnato a`,creatorsLabel:`Creato da`,tagsLabel:`Etichette`,resetButton:`Ripristina`,searchButton:`Cerca`,undefined:`Non definito`},BcfSettings:{title:`Parametri BCF`,text:`Creare, notificare e elencare i parametri BCF che si desidera avere su questo progetto`,validateButton:`Conferma i parametri BCF`},BcfStatistics:{emptyText:`Aggiungi delle domande per vedere le statistiche associate qui.`,issues:`problemi`,extension:{Priority:`Priorità`,PriorityNotDefined:`Nessuna priorità`,PriorityTitle:`Priorità`,Status:`Stato`,StatusNotDefined:`Nessuno stato`,StatusTitle:`Stati`}},BcfTopicCard:{priority:`Priorità`,noPriority:`Nessuno`,assignedTo:`Assegnato a`,elements:`Elementi`,noElements:`0 elementi`,notSpecified:`Non definito`,see:`Visualizza`},BcfTopicCreationCard:{text:`Crea un nuovo topic BCF`,createBcfSideTitle:`Segnala un problema`},BcfTopicForm:{dragDropImageText:`Selezionare un file`,addObjectButton:`Oggetto`,addAnnotationButton:`Annotazione`,annotationButtonTooltip:`Attualmente questo argomento non presenta alcun punto di vista`,addPictureButton:`Aggiungere un'immagine`,titlePlaceholder:`Titolo *`,titleErrorMessage:`Titolo mancante`,typeLabel:`Tipo`,priorityLabel:`Priorità`,statusLabel:`Stato`,stageLabel:`Fase`,assignedToLabel:`Assegnato a`,dueDateLabel:`Data di scadenza`,descriptionLabel:`Descrizione`,labelsLabel:`Tag`,createButton:`Conferma`,updateButton:`Modificare questo BCF`,modalText:`State per abbandonare la modifica di {name} ma ci sono modifiche non salvate.`,cancelButton:`Annullare le modifiche`,continueButton:`Continuare le modifiche`,createTitle:`Segnala un problema`},BcfTopicOverview:{openViewer:`Apri nel visualizzatore`,openViewerNoModels:`Non esistono modelli pronti per la visualizzazione`,elements:`{count} Elementi`,noElements:`Nessun elemento`,type:`Tipo`,noTypeSpecified:`Nessun tipo specificato`,description:`Descrizione`,noDescriptionProvided:`Nessuna descrizione inserita`,assignedTo:`Assegnato a`,notAssigned:`Non assegnato`,dueDate:`Scadenza`,noDueDate:`Nessuna data di scadenza`,informations:`Informazioni`,status:`Stato`,noStatusSpecified:`Nessuno stato specificato`,stage:`Fase`,noStageProvided:`Nessuna fase inserita`,priority:`Priorità`,priorityNotDefined:`Non definita`,tags:`Etichette`,noTags:`Nessuna etichetta`,commentButton:`Pubblica un commento`,deleteText:`Stai per eliminare {name}`,deleteBcfButton:`Elimina questo BCF`,keepBcfButton:`Conserva questo BCF`,author:`Autore`},BcfTopicsTable:{headers:{index:`#`,priority:`Priorità`,status:`Stato`,title:`Titolo`,creator:`Autore`,date:`Data`}},BcfTopicActionsCell:{seeButton:`Visualizza`},BcfTopicComments:{commentButton:`Pubblica un commento`,commentLabel:`Pubblica un commento`,commentText:`Commento`,cancelButton:`Annulla`,publishButton:`Pubblica`,commentsText:`commenti`,deleteCommentText:`Eliminare questo commento?`,deleteButton:`Elimina`},BcfTopicPriorityCell:{noPriority:`Nessuno`},SettingCard:{addButton:`aggiungi un elemento`,cancelButton:`Annulla`,validateButton:`Conferma`,deleteExtensionText:`Elimina questo parametro`,deleteButton:`Elimina`,title:{Priority:`Priorità`,Label:`Etichette`,Status:`Stati`,Type:`Tipi`,Stage:`Fasi`},input:{Priority:`Aggiungi una nuova priorità`,Label:`Aggiungi una nuova etichetta`,Status:`Aggiungi un nuovo stato`,Type:`Aggiungi un nuovo tipo`,Stage:`Aggiungi una nuova fase`},text:{Priority:`Elenco delle priorità`,Label:`Elenco delle etichette`,Status:`Elenco degli stati`,Type:`Elenco dei tipi`,Stage:`Elenco delle fasi`}}}}},HGt=({apiClient:e,fetchUsers:t,i18nPlugin:n}={})=>({install(r){e?Wg.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.`),n?Object.entries(VGt).forEach(([e,t])=>{n.global.mergeLocaleMessage(e,t)}):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(Kce).forEach(([e,t])=>{r.component(e,t)})}}),UGt={de:{BuildingMaker:{title:`Building Maker`,back:`Zurück`,list:{text:`Erstellen und bearbeiten Sie die Etagen und laden Sie anschließend Ihre PDFs herunter.`,createButton:`Neues Projekt`,updateButton:`Umbenennen`,deleteButton:`Löschen`},form:{text:`Erstellen und bearbeiten Sie die Etagen und laden Sie anschließend Ihre PDFs herunter.`,input:`Name des Gebäudes`,error:`Ungültiger Name`,createButton:`Erstellen`,updateButton:`Bestätigen`},view:{addStoreyButton:`Etage`,addPlanButton:`Grundriss`,closeButton:`Fertigstellen`,submitFilesButton:`Bestätigen`},storeyForm:{title:`Neue Etage`,input:`Name`,error:`Ungültiger Name`,cancelButton:`Abbrechen`,submitButton:`Bestätigen`}},FileManager:{creationFormTitle:`Ordner erstellen`,renameFormPlaceholder:`Datei- / Ordnernam`,nameInputPlaceholder:`Ordnername`,emptyFolder:`Dieser Ordner ist leer`,newFolderSuccess:`Neuer Ordner erstellt`,renameFolderSuccess:`Umbenannter Ordner`,deleteFolderSuccess:`Ordner gelöscht`,newFileSuccess:`Datei hinzugefügt`,renameFileSuccess:`Umbenannte Datei`,deleteFileSuccess:`Datei gelöscht`,nameInputErrorMessage:`Ungültiger name`,cancel:`Abbrechen`,submit:`Bestätigen`,buttonText:`Neuer Ordner`,addFileButtonText:`Datei laden`,rename:`Umbenennen`,view:`Sehen`,download:`Herunterladen`,delete:`Löschen`,deleteTitle:`Dateien löschen`,deleteDetail:`Sie sind im Begriff, die folgenden Dateien / Ordner endgültig zu löschen`}},en:{BIMDataComponents:{t:{back:`Back`,cancel:`Cancel`,create:`Create`,delete:`Delete`,download:`Download`,finish:`Finish`,rename:`Rename`,search:`Search`,see:`View`,storey:`Storey`,validate:`Validate`}},BuildingMaker:{title:`Building Maker`,list:{text:`Create and edit storeys, then download your PDFs.`,new:`New project`},form:{input:`Building name`,error:`Invalid`},view:{addStorey:`Add Storey`,addFile:`Add File`,addPlan:`Add Plan`},storeyForm:{title:`New storey`,input:`Name`,error:`Invalid name`}},FileManager:{creationFormTitle:`Create folder`,renameFormPlaceholder:`Folder/File name`,nameInputPlaceholder:`Folder name`,emptyFolder:`This folder is empty`,newFolderSuccess:`New folder created`,renameFolderSuccess:`Folder renamed`,deleteFolderSuccess:`Folder deleted`,newFileSuccess:`File added`,renameFileSuccess:`File renamed`,deleteFileSuccess:`File deleted`,nameInputErrorMessage:`Invalid name`,buttonText:`New folder`,addFileButtonText:`Upload a file`,deleteTitle:`Deleting Files`,deleteDetail:`You are about to permanently delete the following files / folders`,dmsRoot:`Root of the project's DMS`,pdfPageSelectorTitle:`Select a page`},MetaBuildingStructure:{title:`Meta-Building Structure`,tab:{structure:`Structure`,zones:`Zones`,equipments:`Equipments`},StoreySelector:{placeholder:`Select a storey`}},PhotosphereBuilding:{title:`Photosphere Building`}},es:{BuildingMaker:{title:`Building Maker`,back:`Vuelta`,list:{text:`Cree y edite los pisos después cargue los PDF.`,createButton:`Nuevo proyecto`,updateButton:`Renombrar`,deleteButton:`Suprimir`},form:{text:`Cree y edite los pisos después cargue los PDF.`,input:`Nombre del edificio`,error:`Nombre no válido`,createButton:`Crear`,updateButton:`Validar`},view:{addStoreyButton:`Piso`,addPlanButton:`Plano`,closeButton:`Terminar`,submitFilesButton:`Validar`},storeyForm:{title:`Nuevo piso`,input:`Nombre`,error:`Nombre no válido`,cancelButton:`Anular`,submitButton:`Validar`}},FileManager:{creationFormTitle:`Crear un archivo`,renameFormPlaceholder:`Nombre de archivo / carpeta`,nameInputPlaceholder:`Nombre de la carpeta`,emptyFolder:`Esta carpeta está vacía`,newFolderSuccess:`Nueva carpeta creada`,renameFolderSuccess:`Carpeta renombrada`,deleteFolderSuccess:`Carpeta eliminada`,newFileSuccess:`Archivo agregado`,renameFileSuccess:`Archivo renombrado`,deleteFileSuccess:`Archivo eliminado`,nameInputErrorMessage:`Nombre inválida`,cancel:`Cancelar`,submit:`Validar`,buttonText:`Carpeta nueva`,addFileButtonText:`Cargar un archivo`,rename:`Renombrar`,view:`Ver`,download:`Descargar`,delete:`Borrar`,deleteTitle:`Eliminar archivos`,deleteDetail:`Está a punto de eliminar permanentemente los siguientes archivos / carpetas`}},fr:{BIMDataComponents:{t:{back:`Retour`,cancel:`Annuler`,create:`Créer`,delete:`Supprimer`,download:`Télécharger`,finish:`Terminer`,rename:`Renommer`,search:`Rechercher`,see:`Voir`,storey:`Étage`,validate:`Valider`}},BuildingMaker:{title:`Building Maker`,list:{text:`Créez et éditez les étages puis téléchagez vos PDF.`,new:`Nouveau projet`},form:{input:`Nom du bâtiment`,error:`Nom invalide`},view:{addStorey:`Ajouter un Étage`,addFile:`Ajouter un fichier`,addPlan:`Ajouter un plan`},storeyForm:{title:`Nouvel étage`,input:`Nom`,error:`Nom invalide`}},FileManager:{creationFormTitle:`Créer un dossier`,renameFormPlaceholder:`Nom du fichier/dosier`,nameInputPlaceholder:`Nom du dossier`,emptyFolder:`Ce dossier est vide`,newFolderSuccess:`Nouveau dossier créé`,renameFolderSuccess:`Dossier renommé`,deleteFolderSuccess:`Dossier supprimé`,newFileSuccess:`Fichier ajouté`,renameFileSuccess:`Fichier renommé`,deleteFileSuccess:`Fichier supprimé`,nameInputErrorMessage:`Nom invalide`,buttonText:`Nouveau dossier`,addFileButtonText:`Charger un fichier`,deleteTitle:`Supression de fichiers`,deleteDetail:`Vous êtes sur le point de supprimer définitivement les fichiers/dossiers suivants`,dmsRoot:`Racine de la GED du projet`,pdfPageSelectorTitle:`Sélectionner une page`},MetaBuildingStructure:{title:`Structure Méta-Building`,tab:{structure:`Structure`,zones:`Zones`,equipments:`Équipements`},StoreySelector:{placeholder:`Sélectionner un étage`}},PhotosphereBuilding:{title:`Photosphère Building`}},it:{BuildingMaker:{title:`Building Maker`,back:`Reso`,list:{text:`Crea e modifica i piani e poi scarica i tuoi PDF.`,createButton:`Nuovo progetto`,updateButton:`Rinominare`,deleteButton:`Eliminare`},form:{text:`Crea e modifica i piani e poi scarica i tuoi PDF.`,input:`Nome della costruzione`,error:`Nome non corretto`,createButton:`Creare`,updateButton:`Convalidare`},view:{addStoreyButton:`Piano`,addPlanButton:`Mappa`,closeButton:`Finire`,submitFilesButton:`Convalidare`},storeyForm:{title:`Nuovo piano`,input:`Nome`,error:`Nome non corretto`,cancelButton:`Annullare`,submitButton:`Convalidare`}},FileManager:{creationFormTitle:`Crea una cartella`,renameFormPlaceholder:`Nome file/cartella`,nameInputPlaceholder:`Nome della cartella`,emptyFolder:`Questa cartella è vuota`,newFolderSuccess:`Nuova cartella creata`,renameFolderSuccess:`Cartella rinominata`,deleteFolderSuccess:`Cartella eliminata`,newFileSuccess:`File aggiunto`,renameFileSuccess:`File rinominato`,deleteFileSuccess:`File cancellato`,nameInputErrorMessage:`Nome non valido`,cancel:`Annulla`,submit:`Invia`,buttonText:`Nuova cartella`,addFileButtonText:`Carica un file`,rename:`Rinominare`,view:`Vedere`,download:`Scaricare`,delete:`Cancellare`,deleteTitle:`Eliminazione di file`,deleteDetail:`Stai per eliminare definitivamente i seguenti file/cartelle`}}},WGt=({i18nPlugin:e}={})=>({install(t){e?Object.entries(UGt).forEach(([t,n])=>{e.global.mergeLocaleMessage(t,n)}):console.warn(`[BIMData Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly.`),Object.entries(xEt).forEach(([e,n])=>{t.component(e,n)})}}),GGt={beforeMount(e,t){if(typeof t.value!=`function`)throw Error(`click away directive needs function, got ${typeof t.value}`);e.clickAwayHandler=n=>{(n.path||n.composedPath&&n.composedPath()).find(t=>t===e)||t.value()},window.addEventListener(`mousedown`,e.clickAwayHandler,!0)},unmounted(e){window.removeEventListener(`mousedown`,e.clickAwayHandler,!0),delete e.clickAwayHandler}},KGt=s({BIMDataClickAway:()=>K_,BIMDataClickInputAway:()=>GGt}),qGt=e=>({install(t){Object.entries(YFe).forEach(([n,r])=>{e&&e.excludedComponents&&e.excludedComponents.length>0&&e.excludedComponents.includes(n)||(!e||!e.includedComponents||e.includedComponents.includes(n))&&t.component(n,r)}),(!e||e.directives!==!1)&&Object.entries(KGt).forEach(([e,n])=>t.directive(e.split(`BIMData`)[1],n))}}),JGt={name:`LiWrapper`,render(){return cd(`li`,this.$slots.default())}};function YGt(e,t){var n=new Set([]);return e.forEach(e=>{t.has(e)||n.add(e)}),n}var X9=f(`id`),XGt=({contextMenu:e,objects:t=[],state:n=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:()=>n.selectObjects(t.filter(h(p(`visible`),m(`selected`))).map(X9)),predicate:()=>t.some(h(p(`visible`),m(`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:()=>n.deselectObjects(t.filter(p(`selected`)).map(X9)),predicate:()=>t.some(p(`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 e=t.filter(e=>e.visible&&e.type===this.selectedObject.type&&e.id!==this.selectedObject.id).map(X9);n.selectObjects(e)},selectedObject:null,predicate(){let e=t.filter(h(p(`visible`),p(`selected`)));return e.length===1&&e[0].type!==void 0?(this.selectedObject=e[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 e=new Set(t.filter(p(`selected`)).map(X9)),r=new Set(t.filter(p(`visible`)).map(X9));n.selectObjects(Array.from(YGt(r,e)),{exclusive:!0})},predicate:()=>t.some(h(m(`selected`),p(`visible`)))&&t.some(h(p(`selected`),p(`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:()=>n.showObjects(t.filter(m(`visible`)).map(X9)),predicate:()=>t.some(m(`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 e=this.objectsToHide.filter(p(`selected`));e.length>0&&n.deselectObjects(e.map(X9)),n.hideObjects(this.objectsToHide.map(X9))},predicate(){return this.objectsToHide=t.filter(h(p(`selected`),p(`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 e=t.filter(p(`visible`));e.some(p(`selected`))&&n.deselectObjects(e.filter(p(`selected`)).map(X9)),n.hideObjects(e.map(X9))},predicate:()=>t.some(p(`visible`))}].filter(e=>e.predicate()),ZGt={components:{LiWrapper:JGt},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 n=await t;this.asyncPredicates.has(t)&&(this.asyncPredicates.delete(t),this.asyncPredicateRunning=this.asyncPredicates.size>0,n===!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:n=null}){let r=new Map;return n&&this.$viewer.shortcutManager.getShortcuts(n).forEach(e=>r.set(e.name,e.key)),XGt({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(e=>e.sort((e,t)=>(e.position=e.position||0,t.position=t.position||0,e.position-t.position))),this.currentCommands=[...e.keys()].sort((e,t)=>e-t).map(t=>e.get(t)).flat()},isGroupIntersection(e){if(e===0)return!1;let t=this.currentCommands[e-1],n=this.currentCommands[e];return t.group<n.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}}},QGt={key:0,class:`separator`},$Gt={class:`menu-text`},eKt={key:1,class:`menu-picto`},tKt={key:0,class:`context-menu__spinner`};function nKt(e,t,n,r,i,a){let o=R(`BIMDataIconChevron`),s=R(`LiWrapper`),c=R(`BIMDataSpinner`),l=Fc(`click-away`);return i.displayed&&(i.currentCommands.length||i.asyncPredicateRunning)?qo((z(),B(`ul`,{key:0,class:`bimdata-list context-menu`,style:N(a.position)},[(z(!0),B(bu,null,Rc(i.currentCommands,(e,t)=>(z(),V(s,{key:e.label,class:`context-menu__element`,onClick:t=>a.executeCommand(e)},{default:L(()=>[a.isGroupIntersection(t)?(z(),B(`div`,QGt)):G(``,!0),H(`div`,$Gt,F(e.label),1),!e.component&&e.picto?(z(),B(`span`,eKt,F(e.picto),1)):e.component?(z(),V(o,{key:2,size:`xxs`,class:`fill-primary`})):G(``,!0)]),_:2},1032,[`onClick`]))),128)),i.asyncPredicateRunning?(z(),B(`li`,tKt,[U(c)])):G(``,!0)],4)),[[l,a.away]]):G(``,!0)}var rKt=q(ZGt,[[`render`,nKt],[`__scopeId`,`data-v-5b87d4a3`]]),iKt={name:`ViewerHeader`,inject:[`$viewer`],props:{visible:{type:Boolean,default:!0}},setup(){let e=Xo(`$viewer`),t=Ea(new Map);return{logo:e.uiSettings.bimdataLogo!==!1,version:e.uiSettings.version===!1?null:e.version,headerContent:t,headerRightContentComponents:K(()=>Array.from(t.values()).filter(e=>e.position===`right`).sort((e,t)=>e.order-t.order).map(e=>e.component)),headerLeftContentComponents:K(()=>Array.from(t.values()).filter(e=>e.position===`left`).sort((e,t)=>e.order-t.order).map(e=>e.component)),addContent:e=>{if(!e.name)throw TypeError(`[Viewer Header] Content must have a name`);if(t.has(e.name))throw Error(`[Viewer Header] Content with name ${e.name} already exists`);t.set(e.name,e)},removeContent:e=>t.has(e)?(t.delete(e),!0):!1}}},aKt={class:`viewer-header`},oKt={class:`viewer-header__content`},sKt={class:`viewer-header__content__left`},cKt={class:`viewer-header__content__right`},lKt={key:0,class:`m-l-6 flex items-center`},uKt={key:1,class:`viewer-header__version`};function dKt(e,t,n,r,i,a){let o=R(`BIMDataIllustration`);return qo((z(),B(`div`,aKt,[H(`div`,oKt,[H(`div`,sKt,[(z(!0),B(bu,null,Rc(r.headerLeftContentComponents,e=>(z(),V(Pc(e),{key:e.name}))),128))]),H(`div`,cKt,[(z(!0),B(bu,null,Rc(r.headerRightContentComponents,e=>(z(),V(Pc(e),{key:e.name}))),128))])]),r.logo||r.version?(z(),B(`div`,lKt,[r.logo?(z(),V(o,{key:0,name:`logo`,width:`30px`,height:`30px`})):G(``,!0),r.version?(z(),B(`div`,uKt,F(r.version),1)):G(``,!0)])):G(``,!0)],512)),[[Wd,n.visible]])}var fKt=q(iKt,[[`render`,dKt],[`__scopeId`,`data-v-5c9ea6b6`]]),pKt={emits:[`resize`],setup(e,{emit:t}){return{onResizerMousedown:e=>{e.preventDefault();let n=e.clientX,r=e=>{e.preventDefault();let r=e.clientX-n;n=e.clientX,t(`resize`,r)},i=e=>{e.preventDefault(),window.removeEventListener(`mousemove`,r),window.removeEventListener(`mouseup`,i)};window.addEventListener(`mousemove`,r),window.addEventListener(`mouseup`,i)}}}},mKt={class:`bimdata-separator`};function hKt(e,t,n,r,i,a){return z(),B(`div`,mKt,[t[1]||=H(`div`,{class:`bimdata-separator__line`},null,-1),H(`div`,{class:`bimdata-separator__resizer`,onMousedown:t[0]||=(...e)=>r.onResizerMousedown&&r.onResizerMousedown(...e)},null,32)])}var gKt={components:{Separator:q(pKt,[[`render`,hKt],[`__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=I(null),n=I(e.sidePanel.width??400);return rs(()=>e.sidePanel,()=>{Object.defineProperty(e.sidePanel,`width`,{get(){return n.value},set(e){if(typeof e!=`number`||e<=0){console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof e}`);return}n.value=e}}),Object.defineProperty(e.sidePanel,`componentInstance`,{get(){return t.value},enumerable:!0})},{immediate:!0}),{componentInstance:t,width:n,onResize:(e,t=1)=>{let r=n.value+e*t;n.value=Math.max(0,r)}}}},_Kt={class:`bimdata-global-side-panel__component`};function vKt(e,t,n,r,i,a){let o=R(`Separator`);return z(),B(`div`,{class:`bimdata-global-side-panel`,style:N(`width: ${r.width}px`)},[n.sidePanel.resizable&&n.position===`right`?(z(),V(o,{key:0,onResize:t[0]||=e=>r.onResize(e,-1)})):G(``,!0),H(`div`,_Kt,[(z(),V(Pc(n.sidePanel.component),{ref:`componentInstance`},null,512))]),n.sidePanel.resizable&&n.position===`left`?(z(),V(o,{key:1,onResize:t[1]||=e=>r.onResize(e)})):G(``,!0)],4)}var yKt={name:`BimdataViewer`,components:{ContextMenu:rKt,ViewerHeader:fKt,ModalManager:H9,GlobalSidePanel:q(gKt,[[`render`,vKt],[`__scopeId`,`data-v-82d0d4cb`]])},setup(){let e=Xo(`$viewer`),{globalContext:t,shortcutManager:n}=e;Ec(()=>{n&&n.destroy(),t.hub.clear()}),Sc(()=>{e.pluginManager.runPluginsScripts(e)});let r=K(()=>e.uiSettings.bimdataLogo!==!1&&(t.localContexts.length!==1||t.localContexts[0].window?.logoAndVersion)),i=K(()=>e.uiSettings.version!==!1&&(t.localContexts.length!==1||t.localContexts[0].window?.logoAndVersion)?e.version:null),a=K(()=>t.leftSidePanel),o=K(()=>t.rightSidePanel),s=K(()=>{let n=e.uiSettings.header!==!1,r=t.localContexts.length===1&&t.localContexts[0].window?.header===!1,i=!!(a.value||o.value);return n&&(!r||i)}),c=e.uiSettings.contextMenu!==!1,l=I(null);function u(e){c&&l.value.open(e)}function d(){e.shortcutManager.active=!0}function f(){e.shortcutManager.active=!1}return{Layout:e.layout.areas.component,onContextMenu:u,onMouseenter:d,onMouseleave:f,isHeaderVisible:s,viewerTemplateRef:t.templateRef,modalManagerTemplateRef:t.modalManagerTemplateRef,headerTemplateRef:t.headerTemplateRef,contextMenuTemplateRef:l,contextMenuEnabled:c,bimdataLogoOnSingleWindow:r,viewerVersionOnSingleWindow:i,version:e.version,loading:K(()=>t.loading),spinner:K(()=>t.spinner),leftSidePanel:a,rightSidePanel:o}}},bKt={key:1,class:`bimdata-context-loading-overlay`,style:{"z-index":`3`}},xKt={key:2,class:`viewer__logo`},SKt={key:1,class:`version m-t-6`};function CKt(e,t,n,r,i,a){let o=R(`ModalManager`),s=R(`ContextMenu`),c=R(`ViewerHeader`),l=R(`GlobalSidePanel`),u=R(`BIMDataSpinner`),d=R(`BIMDataIllustration`);return z(),B(`div`,{id:`bimdata-viewer`,ref:`viewerTemplateRef`,class:`bimdata-viewer bimdata-design-system bimdata-scrollbar`,onContextmenu:t[0]||=(...e)=>r.onContextMenu&&r.onContextMenu(...e),onMouseenter:t[1]||=(...e)=>r.onMouseenter&&r.onMouseenter(...e),onMouseleave:t[2]||=(...e)=>r.onMouseleave&&r.onMouseleave(...e)},[U(o,{ref:`modalManagerTemplateRef`},null,512),r.contextMenuEnabled?(z(),V(s,{key:0,ref:`contextMenuTemplateRef`},null,512)):G(``,!0),U(c,{ref:`headerTemplateRef`,visible:r.isHeaderVisible},null,8,[`visible`]),H(`div`,{class:`bimdata-viewer__content`,style:N(r.isHeaderVisible?`height: calc(100% - var(--bimdata-viewer-header-height, 40px))`:`height: 100%`)},[r.leftSidePanel?(z(),V(l,{key:0,"side-panel":r.leftSidePanel,position:`left`},null,8,[`side-panel`])):G(``,!0),(z(),V(Pc(r.Layout),{style:`height: 100%; flex-grow: 1;`})),r.rightSidePanel?(z(),V(l,{key:1,"side-panel":r.rightSidePanel,position:`right`},null,8,[`side-panel`])):G(``,!0)],4),r.loading?(z(),B(`div`,bKt,[r.spinner&&r.spinner.component?(z(),V(Pc(r.spinner.component),Br(Vu({key:0},r.spinner.props)),null,16)):(z(),V(u,{key:1,size:`40px`,border:`5px`}))])):G(``,!0),!r.isHeaderVisible&&(r.bimdataLogoOnSingleWindow||r.viewerVersionOnSingleWindow)?(z(),B(`div`,xKt,[r.bimdataLogoOnSingleWindow?(z(),V(d,{key:0,name:`logo`})):G(``,!0),r.viewerVersionOnSingleWindow?(z(),B(`div`,SKt,F(r.version),1)):G(``,!0)])):G(``,!0)],544)}var wKt=q(yKt,[[`render`,CKt],[`__scopeId`,`data-v-0c1c941a`]]),TKt=[`src`],EKt={class:`bimdata-models__header`},DKt={key:0,class:`bimdata-models__header__loader`},OKt={class:`bimdata-models__header__picto`},kKt={class:`bimdata-models__header__name`},AKt={key:0,class:`bimdata-models__header__name--empty`},jKt={key:1,class:`bimdata-models__header__name--empty`},MKt={key:3},NKt=[`onMousemove`,`onClick`],Z9=q({__name:`Models`,props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:`350px`}},setup(e){let t=e,n=Xo(`$viewer`),r=I(),i=I(0),a=I(0),o=I(),s=za([]),c=I(!1),l=K(()=>n.localContext.loadedModels),u=K(()=>n.localContext.loadedModelIds),d=K(()=>n.localContext.loadingModelIds),f=K(()=>n.localContext.multiModel),p=K(()=>(t.customFilter?s.value.filter(t.customFilter):s.value).map(e=>l.value.find(t=>t.document?.head_id!=null&&t.document.head_id===e.document.id)??e)),m=e=>u.value.includes(e),h=e=>d.value.includes(e),g=K(()=>{let{x:e,y:t}=o.value?.getBoundingClientRect()??{x:0,y:0};return`top:${a.value-t}px; left:${i.value-e}px;`}),_=e=>{!f.value&&m(e.id)||d.value.length>0||(n.localContext.loadedModelIds.includes(e.id)?n.localContext.unloadModels([e.id]):n.localContext.loadModels([e.id]))},v=e=>{switch(e){case`C`:return`success`;case`E`:return`failed`;case`P`:case`I`:return`sandglass`}},y=(e,t)=>{e?.viewer_360_file&&(i.value=t.clientX,a.value=t.clientY),r.value=e?.viewer_360_file},b=async e=>{c.value=!0;try{return(await n.api.apiClient.modelApi.getModels(n.api.cloudId,n.api.projectId,void 0,void 0,e)).filter(e=>n.state.models.some(e=>e.archived)||!e.archived).sort(GT(`updated_at`,!1))}catch(e){console.error(`[Models] Cannot get project models. Error: `,e)}finally{c.value=!1}return[]},x=e=>e.children?.some(e=>m(e.id))??!1;return b(n.localContext.modelTypes).then(e=>{s.value=e}),(t,n)=>{let i=R(`BIMDataSpinner`),a=R(`BIMDataIconModel3D`),s=R(`BIMDataTextbox`),b=R(`BIMDataCheckbox`),S=R(`BIMDataRadio`),C=R(`BIMDataIcon`),w=R(`BIMDataDropdownList`);return z(),B(`div`,{ref_key:`templateRef`,ref:o,class:P([`bimdata-models`,{"bimdata-models--window-positioning":e.windowPositioning}])},[r.value?(z(),B(`div`,{key:0,class:`bimdata-models__preview`,style:N(g.value)},[H(`img`,{src:r.value},null,8,TKt)],4)):G(``,!0),U(w,{style:N(`--bimdata-models-width: ${e.width};`),width:e.width,list:p.value,"element-key":`id`,"per-page":40,loading:c.value,class:`bimdata-models__list`,disabled:p.value.length===0,onElementClick:_},{header:L(({isOpen:e})=>[H(`div`,EKt,[c.value||d.value.length>0?(z(),B(`div`,DKt,[U(i)])):(z(),B(bu,{key:1},[H(`div`,OKt,[U(a)]),H(`div`,{class:P([`bimdata-models__header__number bimdata-info-length`,{"bimdata-models__header__number--empty":u.value.length===0}])},[H(`span`,null,F(u.value.length),1)],2),H(`div`,kKt,[p.value.length===0?(z(),B(`span`,AKt,F(t.$t(`model.no_model`)),1)):u.value.length===0?(z(),B(`span`,jKt,F(t.$t(`model.no_loaded_model`)),1)):u.value.length===1?(z(),V(s,{key:2,text:l.value[0].name,tooltip:!e},null,8,[`text`,`tooltip`])):u.value.length>1?(z(),B(`span`,MKt,F(t.$t(`model.selected_models`)),1)):G(``,!0)])],64))])]),element:L(({element:t,close:r})=>[H(`div`,{class:`bimdata-models__model`,onMousemove:n=>e.preview&&y(t,n),onMouseout:n[0]||=t=>e.preview&&y(),onClick:()=>{!f.value&&!m(t.id)&&r()}},[f.value?(z(),V(b,{key:0,"model-value":m(t.id)||x(t),disabled:t.status!==`C`||d.value.length>0},null,8,[`model-value`,`disabled`])):(z(),V(S,{key:1,"model-value":m(t.id)||x(t),disabled:t.status!==`C`||d.value.length>0},null,8,[`model-value`,`disabled`])),U(C,{margin:`0 calc(var(--spacing-unit) / 2)`,name:v(t.status),size:`xs`,class:P({"fill-success":t.status===`C`,"fill-high":t.status===`E`})},null,8,[`name`,`class`]),U(s,{class:P({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":t.status!==`C`||d.value.length>0}),text:t.name,width:`calc(100% -
6321
+ `),onMouseenter:t[0]||=(...e)=>r.onMouseEnter&&r.onMouseEnter(...e),onMouseleave:t[1]||=(...e)=>r.onMouseLeave&&r.onMouseLeave(...e)},[U(o,{ref:`modalManagerTemplateRef`},null,512),H(`div`,OGt,[r.windowPlugins.leftSidePanel?(z(),V(s,{key:0,plugin:r.windowPlugins.leftSidePanel},null,8,[`plugin`])):G(``,!0),H(`div`,kGt,[(z(!0),B(bu,null,Rc(r.windowPlugins.free,e=>(z(),V(c,{key:e.name,class:P({"window-container__content__center__viewer":e.isViewer}),plugin:e},null,8,[`class`,`plugin`]))),128)),U(l,{position:`left`,plugins:r.windowPlugins.leftButtonColumn},null,8,[`plugins`]),U(l,{position:`right`,plugins:r.windowPlugins.rightButtonColumn},null,8,[`plugins`])]),r.windowPlugins.rightSidePanel?(z(),V(s,{key:1,plugin:r.windowPlugins.rightSidePanel},null,8,[`plugin`])):G(``,!0)]),r.loading?(z(),B(`div`,AGt,[r.spinner&&r.spinner.component?(z(),V(Pc(r.spinner.component),Br(Vu({key:0},r.spinner.props)),null,16)):(z(),V(u,{key:1,size:`20px`,border:`3px`}))])):G(``,!0),r.layoutSettingsDisplayed?(z(),B(`div`,jGt,[U(d)])):G(``,!0)],36)}var NGt=q(DGt,[[`render`,MGt],[`__scopeId`,`data-v-485f288e`]]),PGt=class{constructor(e=!0){let t=wWt(Xh,null,{resizable:e});t.registerContent(`default`,NGt),this.settings=Ea({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?TWt(e):null}copy(e,t=!0){return EWt(this.areas.layout,e,t)}open({ratio:e,direction:t,insertAfter:n,windowName:r=null,windowState:i=null,localContextId:a=null}={}){let o=r?{options:{windowName:r,windowState:i}}:null;return a===null?this.areas.splitLayout(e,t,n,o):this.areas.split(a,e,t,n,o)}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 n=new Set(e.windowState?.modelIds),r=new Set(t.windowState?.modelIds);return n.size===r.size&&[...n].every(e=>r.has(e))}return e.windowName||t.windowName||e.direction!==t.direction||e.children.length!==t.children.length?!1:e.children.every((e,n)=>this.compare(e,t.children[n]))}},FGt={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`}},IGt=1,LGt=class{math=dWe;constructor({plugins:e,api:t,ui:n,locale:r=`fr`}){this.instanceId=IGt++,this.pluginManager=new hVt(e),this.windowManager=new _Vt,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new AUt(t),this.globalContext=new Qre(this),this.state=UUt(this),this.shortcutManager=v(this.state),this.uiSettings=n||{},this.i18n=new Xre(r),this._contextMenu=null,this.layout=new PGt(this.uiSettings.resizable!==!1),this._darkTheme=I(n?.darkTheme??!1),this.localContext=null,window.$viewer=this}get darkTheme(){return this._darkTheme.value}set darkTheme(e){this._darkTheme.value=e}get version(){return FGt.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||d}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 RGt(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 zGt=Object.freeze({25:`GUEST`,50:`USER`,100:`ADMIN`}),q9=Object.freeze({READ:`read`,WRITE:`write`});function J9(e){let t={};return e.forEach(e=>{let[n,r]=e.split(`:`);t[n]?t[n].push(r):t[n]=[r]}),t}var BGt={token_scopes:[],usable_scopes:[],user_role:25};function Y9(e=BGt){let t=J9(e.token_scopes),n=J9(e.usable_scopes);return{...WE(e),tokenScopes:t,usableScopes:n,userRole:zGt[e.user_role],user:e.user?WE(e.user):null,hasBcfReadPermission:n.bcf?.includes(q9.READ)??!1,hasBcfWritePermission:n.bcf?.includes(q9.WRITE)??!1,hasModelReadPermission:n.model?.includes(q9.READ)??!1,hasModelWritePermission:n.model?.includes(q9.WRITE)??!1,hasDocReadPermission:n.document?.includes(q9.READ)??!1,hasDocWritePermission:n.document?.includes(q9.WRITE)??!1}}var VGt={de:{BcfComponents:{back:`Zurück`,BcfFilters:{filtersButton:`Filter`,filtersTitle:`Filter`,priorityLabel:`Priorität`,statusLabel:`Status`,stageLabel:`Phase`,assignedToLabel:`Zugewiesen an`,creatorsLabel:`Erstellt von`,tagsLabel:`Tags`,resetButton:`Zurücksetzen`,searchButton:`Suchen`,undefined:`Nicht definiert`,datePlaceholder:`Erstellungsdatum`},BcfSettings:{title:`BCF-Parameter`,text:`Erstellen, füllen und listen Sie die BCF-Einstellungen auf, die Sie für dieses Projekt haben möchten.`,validateButton:`Die BCF-Parameter anerkennen`},BcfStatistics:{emptyText:`Fügen Sie Fragen hinzu, um zugehörige Statistiken hier anzuzeigen.`,issues:`Probleme`,extension:{Priority:`Priorität`,PriorityNotDefined:`Keine Priorität`,PriorityTitle:`Prioritäten`,Status:`Status`,StatusNotDefined:`Kein Status`,StatusTitle:`Status`}},BcfTopicCard:{priority:`Priorität`,noPriority:`Keine`,assignedTo:`Zugewiesen an`,elements:`Elemente`,notSpecified:`Nicht definiert`,see:`Anzeigen`},BcfTopicCreationCard:{text:`Ein neues BCF-Thema erstellen`,createBcfSideTitle:`Ein Problem melden`},BcfTopicForm:{dragDropImageText:`Bitte wählen Sie eine Datei aus.`,addObjectButton:`Objekt`,addAnnotationButton:`Annotation`,annotationButtonTooltip:`Zu diesem Thema gibt es derzeit keine Ansichten.`,addPictureButton:`Fügen Sie ein Bild hinzu.`,titlePlaceholder:`Titel *`,titleErrorMessage:`Titel fehlt`,typeLabel:`Typ`,priorityLabel:`Priorität`,statusLabel:`Status`,stageLabel:`Phase`,assignedToLabel:`Zugewiesen an`,dueDateLabel:`Fälligkeitsdatum (TT.MM.JJJJ)`,descriptionLabel:`Beschreibung`,labelsLabel:`Tags`,createButton:`Bestätigen`,updateButton:`Änderungen übernehmen`,modalText:`Sie sind dabei, die Bearbeitung der Ausgabe {Name} zu beenden, aber es gibt noch ungespeicherte Änderungen.`,cancelButton:`Änderungen verwerfen`,continueButton:`Änderungen fortsetzen`,createTitle:`Ein Problem melden`,dragDropImageTextTablet:`Foto machen`,takeSnapshot:`Mach einen Schnappschuss`,importFile:`Eine Datei importieren`,searchPlaceholder:`Suchen`,emptySearch:`kein Ergebnis`,documentsLabel:`Dokumente`,documentsCount:`Dokumente – {count} ausgewählte Dokumente`,groupsLabel:`Berechtigungen`,groupsCount:`Berechtigungen – {count} ausgewählte Gruppen`,groupsText:`Wählen Sie die Benutzergruppen aus, die dieses Thema sehen und damit interagieren dürfen.`,validate:`Bestätigen`},BcfTopicOverview:{openViewer:`Im Viewer öffnen`,openViewerNoModels:`Es sind keine Vorlagen zur Ansicht bereit`,elements:`{count} Elemente`,noElements:`kein Element`,type:`Typ`,noTypeSpecified:`Kein Typ angegeben`,description:`Beschreibung`,noDescriptionProvided:`Keine Beschreibung angegeben`,assignedTo:`Zugeteilt an`,notAssigned:`Nicht zugewiesen`,dueDate:`Fälligkeitsdatum`,noDueDate:`Kein Fälligkeitsdatum`,informations:`Informationen`,status:`Status`,noStatusSpecified:`Kein Status angegeben`,stage:`Phase`,noStageProvided:`Keine Phase angegeben`,priority:`Priorität`,priorityNotDefined:`Nicht definiert`,tags:`Tags`,noTags:`Keine Tags`,commentButton:`Ein Kommentar veröffentlichen`,deleteText:`Sie löschen jetzt {Name}`,deleteBcfButton:`Dieses BCF löschen`,keepBcfButton:`Dieses BCF beibehalten`,author:`Autor`},BcfTopicsTable:{headers:{index:`#`,priority:`Priorität`,status:`Status`,title:`Titel`,creator:`Autor`,date:`Datum`}},BcfTopicActionsCell:{seeButton:`Anzeigen`},BcfTopicComments:{commentButton:`Ein Kommentar verfassen`,commentLabel:`Ein Kommentar verfassen`,commentText:`Kommentar`,cancelButton:`Abbrechen`,publishButton:`Veröffentlichen`,commentsText:`Kommentare`,deleteCommentText:`Diesen Kommentar löschen?`,deleteButton:`Löschen`,takeSnapshot:`Mach einen Schnappschuss`,edited:`bearbeitet`},BcfTopicPriorityCell:{noPriority:`Keine`},SettingCard:{addButton:`ein Element hinzufügen`,cancelButton:`Abbrechen`,validateButton:`Bestätigen`,deleteExtensionText:`Diesen Parameter löschen`,deleteButton:`Löschen`,title:{Priority:`Prioritäten`,Label:`Tags`,Status:`Status`,Type:`Typen`,Stage:`Phasen`},input:{Priority:`Eine neue Priorität hinzufügen`,Label:`Ein neues Etikett hinzufügen`,Status:`Einen neuen Status hinzufügen`,Type:`Einen neuen Typ hinzufügen`,Stage:`Eine neue Phase hinzufügen`},text:{Priority:`Liste der Prioritäten`,Label:`Liste von Tags`,Status:`Liste der Status`,Type:`Liste der Typen`,Stage:`Liste der Phasen`}}}},en:{BcfComponents:{back:`Back`,BcfFilters:{filtersButton:`Filters`,filtersTitle:`Filters`,priorityLabel:`Priority`,statusLabel:`Status`,stageLabel:`Stage`,assignedToLabel:`Assigned to`,creatorsLabel:`Created by`,tagsLabel:`Tags`,resetButton:`Reset`,searchButton:`Search`,undefined:`Not defined`,datePlaceholder:`Creation date`},BcfSettings:{title:`BCF Settings`,text:`Create, enter in, and list the BCF settings you would like to have for this project`,validateButton:`Validate BCF settings`},BcfStatistics:{emptyText:`Add BCF Topics to start to have some stats here.`,issues:`issues`,extension:{Priority:`Priority`,PriorityNotDefined:`No priority`,PriorityTitle:`Priorities`,Status:`Status`,StatusNotDefined:`No status`,StatusTitle:`Status`}},BcfTopicCard:{priority:`Priority`,noPriority:`None`,assignedTo:`Assigned to`,elements:`Elements`,notSpecified:`Not specified`,see:`See`},BcfTopicCreationCard:{text:`Create a new BCF topic`,createBcfSideTitle:`Report a problem`},BcfTopicForm:{dragDropImageText:`Please select a file`,addObjectButton:`Object`,addAnnotationButton:`Annotation`,annotationButtonTooltip:`This topic has no viewpoint`,addPictureButton:`Add a picture`,titlePlaceholder:`Title *`,titleErrorMessage:`Missing title`,typeLabel:`Type`,priorityLabel:`Priority`,statusLabel:`Status`,stageLabel:`Stage`,assignedToLabel:`Assigned to`,dueDateLabel:`Due date`,descriptionLabel:`Description`,labelsLabel:`Tags`,createButton:`Validate`,updateButton:`Modify this BCF`,modalText:`You are about to quit editing issue {name} but there are unsaved changes.`,cancelButton:`Discard changes`,continueButton:`Continue editing`,createTitle:`Report a problem`,dragDropImageTextTablet:`Take a picture`,takeSnapshot:`Take a snapshot`,importFile:`Import a file`,searchPlaceholder:`Search`,emptySearch:`No result`,documentsLabel:`Add a file`,documentsCount:`Files - {count} selected files`,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ón`},BcfSettings:{title:`Parámetros del BCF`,text:`Cree, rellene y enumere los parámetros del BCF que desea tener en este proyecto`,validateButton:`Validar los parámetros del BCF`},BcfStatistics:{emptyText:`Añada preguntas para ver las estadísticas asociadas aquí.`,issues:`problemas`,extension:{Priority:`Prioridad`,PriorityNotDefined:`Sin prioridad`,PriorityTitle:`Prioridades`,Status:`Estado`,StatusNotDefined:`Sin estado`,StatusTitle:`Estatutos`}},BcfTopicCard:{priority:`Prioridad`,noPriority:`Sin`,assignedTo:`Asignado a`,elements:`Elementos`,notSpecified:`No definido`,see:`Ver`},BcfTopicCreationCard:{text:`Crear un nuevo tema BCF`,createBcfSideTitle:`Informar de un problema`},BcfTopicForm:{dragDropImageText:`Seleccione un archivo`,addObjectButton:`Objeto`,addAnnotationButton:`Anotación`,annotationButtonTooltip:`Actualmente este tema no posee ningún punto de vista`,addPictureButton:`Añadir una imagen`,titlePlaceholder:`Título *`,titleErrorMessage:`Falta el título`,typeLabel:`Tipo`,priorityLabel:`Prioridad`,statusLabel:`Estado`,stageLabel:`Fase`,assignedToLabel:`Asignado a`,dueDateLabel:`Fecha de vencimiento (DD/MM/AAAA)`,descriptionLabel:`Descripción`,labelsLabel:`Etiquetas`,createButton:`Validar`,updateButton:`Modificar este BCF`,modalText:`Está a punto de salir de la edición del problema de {name} pero hay cambios sin guardar.`,cancelButton:`Cancelar los cambios`,continueButton:`Continuar con los cambios`,createTitle:`Informar de un problema`,dragDropImageTextTablet:`Tomar una fotografía`,takeSnapshot:`Tomar un snapshot`,importFile:`Importar un archivo`,searchPlaceholder:`Buscar`,emptySearch:`No hay resultados`},BcfTopicOverview:{openViewer:`Abrir en el visor`,openViewerNoModels:`No hay ningún modelo listo para la visualización`,elements:`{count} Elementos`,noElements:`Ningún elemento`,type:`Tipo`,noTypeSpecified:`No se especifica el tipo`,description:`Descripción`,noDescriptionProvided:`No hay descripción`,assignedTo:`Asignado a`,notAssigned:`No asignado`,dueDate:`Plazo`,noDueDate:`Sin fecha de vencimiento`,informations:`Información`,status:`Estado`,noStatusSpecified:`No se especifica el estado`,stage:`Fase`,noStageProvided:`No se indica ninguna fase`,priority:`Prioridad`,priorityNotDefined:`No definido`,tags:`Etiquetas`,noTags:`Sin etiquetas`,commentButton:`Publicar un comentario`,deleteText:`Estás a punto de borrar {name}`,deleteBcfButton:`Borrar este BCF`,keepBcfButton:`Mantenga este BCF`,author:`Autor`},BcfTopicsTable:{headers:{index:`#`,priority:`Prioridad`,status:`Estado`,title:`Título`,creator:`Autor`,date:`Fecha`}},BcfTopicActionsCell:{seeButton:`Ver`},BcfTopicComments:{commentButton:`Publicar un comentario`,commentLabel:`Publicar un comentario`,commentText:`Comentario`,cancelButton:`Cancelar`,publishButton:`Publicar`,commentsText:`comentarios`,deleteCommentText:`¿Borrar este comentario?`,deleteButton:`Borrar`,takeSnapshot:`Tomar un snapshot`},BcfTopicPriorityCell:{noPriority:`Sin`},SettingCard:{addButton:`añadir un elemento`,cancelButton:`Cancelar`,validateButton:`Validar`,deleteExtensionText:`Borrar esta configuración`,deleteButton:`Borrar`,title:{Priority:`Prioridades`,Label:`Etiquetas:`,Status:`Estatutos`,Type:`Tipos`,Stage:`Fases`},input:{Priority:`Añadir una nueva prioridad`,Label:`Añadir una nueva etiqueta`,Status:`Añadir un nuevo estado`,Type:`Añadir un nuevo tipo`,Stage:`Añadir una nueva fase`},text:{Priority:`Lista de prioridades`,Label:`Lista de etiquetas`,Status:`Lista de estatutos`,Type:`Lista de tipos`,Stage:`Lista de fases`}}}},fr:{BcfComponents:{back:`Retour`,BcfFilters:{filtersButton:`Filtres`,filtersTitle:`Filtres`,priorityLabel:`Priorité`,statusLabel:`Statut`,stageLabel:`Phase`,assignedToLabel:`Assigné à`,creatorsLabel:`Créé par`,tagsLabel:`Tags`,resetButton:`Réinitialiser`,searchButton:`Rechercher`,undefined:`Non défini`,datePlaceholder:`Date de création`},BcfSettings:{title:`Paramètres BCF`,text:`Créez, renseignez et listez les paramètres BCF que vous souhaitez avoir sur ce projet`,validateButton:`Valider les paramètres BCF`},BcfStatistics:{emptyText:`Ajoutez des questions pour voir les statistiques associées ici.`,issues:`problèmes`,extension:{Priority:`Priorité`,PriorityNotDefined:`Aucune priorité`,PriorityTitle:`Priorités`,Status:`Statut`,StatusNotDefined:`Aucun statut`,StatusTitle:`Statuts`}},BcfTopicCard:{priority:`Priorité`,noPriority:`Aucune`,assignedTo:`Assigné à`,elements:`{n} Élements`,notSpecified:`Non défini`,see:`Voir`},BcfTopicCreationCard:{text:`Créer un nouveau topic BCF`,createBcfSideTitle:`Signaler un problème`},BcfTopicForm:{dragDropImageText:`Veuillez sélectionner un fichier`,addObjectButton:`Objet`,addAnnotationButton:`Annotation`,annotationButtonTooltip:`Ce topic ne possède actuellement aucun point de vue`,addPictureButton:`Ajouter une image`,titlePlaceholder:`Titre *`,titleErrorMessage:`Titre manquant`,typeLabel:`Type`,priorityLabel:`Priorité`,statusLabel:`Statut`,stageLabel:`Phase`,assignedToLabel:`Assigné à`,dueDateLabel:`Date d'échéance`,descriptionLabel:`Description`,labelsLabel:`Tags`,createButton:`Valider`,updateButton:`Modifier ce BCF`,modalText:`Vous êtes sur le point de quitter l'édition de l'issue {name} mais il y'a des modifications non enregistrées.`,cancelButton:`Annuler les modifications`,continueButton:`Continuer les modifications`,createTitle:`Signaler un problème`,dragDropImageTextTablet:`Prendre une photo`,takeSnapshot:`Prendre un snapshot`,importFile:`Importer un fichier`,searchPlaceholder:`Rechercher`,emptySearch:`Pas de résultat`,documentsLabel:`Documents`,documentsCount:`Documents - {count} documents sélectionnés`,groupsLabel:`Permissions`,groupsCount:`Permissions - {count} groupes sélectionnés`,groupsText:`Sélectionner les groupes utilisateur qui peuvent voir ce topic et intéragir avec.`,validate:`Valider`},BcfTopicOverview:{openViewer:`Ouvrir dans le viewer`,openViewerNoModels:`Il n'y a aucun modèle prêt pour une visualisation`,elements:`{count} Élements`,noElements:`Aucun élément concerné`,type:`Type`,noTypeSpecified:`Pas de type spécifié`,description:`Description`,noDescriptionProvided:`Pas de description renseignée`,assignedTo:`Assigné à`,notAssigned:`Non assigné`,dueDate:`Échéance`,noDueDate:`Pas de date d'échéance`,informations:`Informations`,status:`Statut`,noStatusSpecified:`Pas de statut spécifié`,stage:`Phase`,noStageProvided:`Pas de phase renseignée`,priority:`Priorité`,priorityNotDefined:`Non défini`,tags:`Tags`,noTags:`Pas de tags`,commentButton:`Poster un commentaire`,deleteText:`Vous êtes sur le point de supprimer {name}`,deleteBcfButton:`Supprimer ce BCF`,keepBcfButton:`Conserver ce BCF`,author:`Auteur`},BcfTopicsTable:{headers:{index:`#`,priority:`Priorité`,status:`Statut`,title:`Titre`,creator:`Auteur`,date:`Date`}},BcfTopicActionsCell:{seeButton:`Voir`},BcfTopicComments:{commentButton:`Poster un commentaire`,commentLabel:`Poster un commentaire`,commentText:`Commentaire`,cancelButton:`Annuler`,publishButton:`Publier`,commentsText:`commentaires`,deleteCommentText:`Supprimer ce commentaire ?`,deleteButton:`Supprimer`,takeSnapshot:`Prendre un snapshot`,edited:`edité`},BcfTopicPriorityCell:{noPriority:`Aucune`},SettingCard:{addButton:`ajouter un élément`,cancelButton:`Annuler`,validateButton:`Valider`,deleteExtensionText:`Supprimmer ce paramètre`,deleteButton:`Supprimer`,title:{Priority:`Priorités`,Label:`Tags`,Status:`Statuts`,Type:`Types`,Stage:`Phases`},input:{Priority:`Ajouter une nouvelle priorité`,Label:`Ajouter un nouveau label`,Status:`Ajouter un nouveau statut`,Type:`Ajouter un nouveau type`,Stage:`Ajouter une nouvelle phase`},text:{Priority:`Liste des priorités`,Label:`Liste des tags`,Status:`Liste des statuts`,Type:`Liste des types`,Stage:`Liste des phases`}}}},it:{BcfComponents:{back:`Indietro`,BcfFilters:{filtersButton:`Filtri`,filtersTitle:`Filtri`,priorityLabel:`Priorità`,statusLabel:`Stato`,stageLabel:`Fase`,datePlaceholder:`Data di creazione`,assignedToLabel:`Assegnato a`,creatorsLabel:`Creato da`,tagsLabel:`Etichette`,resetButton:`Ripristina`,searchButton:`Cerca`,undefined:`Non definito`},BcfSettings:{title:`Parametri BCF`,text:`Creare, notificare e elencare i parametri BCF che si desidera avere su questo progetto`,validateButton:`Conferma i parametri BCF`},BcfStatistics:{emptyText:`Aggiungi delle domande per vedere le statistiche associate qui.`,issues:`problemi`,extension:{Priority:`Priorità`,PriorityNotDefined:`Nessuna priorità`,PriorityTitle:`Priorità`,Status:`Stato`,StatusNotDefined:`Nessuno stato`,StatusTitle:`Stati`}},BcfTopicCard:{priority:`Priorità`,noPriority:`Nessuno`,assignedTo:`Assegnato a`,elements:`Elementi`,noElements:`0 elementi`,notSpecified:`Non definito`,see:`Visualizza`},BcfTopicCreationCard:{text:`Crea un nuovo topic BCF`,createBcfSideTitle:`Segnala un problema`},BcfTopicForm:{dragDropImageText:`Selezionare un file`,addObjectButton:`Oggetto`,addAnnotationButton:`Annotazione`,annotationButtonTooltip:`Attualmente questo argomento non presenta alcun punto di vista`,addPictureButton:`Aggiungere un'immagine`,titlePlaceholder:`Titolo *`,titleErrorMessage:`Titolo mancante`,typeLabel:`Tipo`,priorityLabel:`Priorità`,statusLabel:`Stato`,stageLabel:`Fase`,assignedToLabel:`Assegnato a`,dueDateLabel:`Data di scadenza`,descriptionLabel:`Descrizione`,labelsLabel:`Tag`,createButton:`Conferma`,updateButton:`Modificare questo BCF`,modalText:`State per abbandonare la modifica di {name} ma ci sono modifiche non salvate.`,cancelButton:`Annullare le modifiche`,continueButton:`Continuare le modifiche`,createTitle:`Segnala un problema`},BcfTopicOverview:{openViewer:`Apri nel visualizzatore`,openViewerNoModels:`Non esistono modelli pronti per la visualizzazione`,elements:`{count} Elementi`,noElements:`Nessun elemento`,type:`Tipo`,noTypeSpecified:`Nessun tipo specificato`,description:`Descrizione`,noDescriptionProvided:`Nessuna descrizione inserita`,assignedTo:`Assegnato a`,notAssigned:`Non assegnato`,dueDate:`Scadenza`,noDueDate:`Nessuna data di scadenza`,informations:`Informazioni`,status:`Stato`,noStatusSpecified:`Nessuno stato specificato`,stage:`Fase`,noStageProvided:`Nessuna fase inserita`,priority:`Priorità`,priorityNotDefined:`Non definita`,tags:`Etichette`,noTags:`Nessuna etichetta`,commentButton:`Pubblica un commento`,deleteText:`Stai per eliminare {name}`,deleteBcfButton:`Elimina questo BCF`,keepBcfButton:`Conserva questo BCF`,author:`Autore`},BcfTopicsTable:{headers:{index:`#`,priority:`Priorità`,status:`Stato`,title:`Titolo`,creator:`Autore`,date:`Data`}},BcfTopicActionsCell:{seeButton:`Visualizza`},BcfTopicComments:{commentButton:`Pubblica un commento`,commentLabel:`Pubblica un commento`,commentText:`Commento`,cancelButton:`Annulla`,publishButton:`Pubblica`,commentsText:`commenti`,deleteCommentText:`Eliminare questo commento?`,deleteButton:`Elimina`},BcfTopicPriorityCell:{noPriority:`Nessuno`},SettingCard:{addButton:`aggiungi un elemento`,cancelButton:`Annulla`,validateButton:`Conferma`,deleteExtensionText:`Elimina questo parametro`,deleteButton:`Elimina`,title:{Priority:`Priorità`,Label:`Etichette`,Status:`Stati`,Type:`Tipi`,Stage:`Fasi`},input:{Priority:`Aggiungi una nuova priorità`,Label:`Aggiungi una nuova etichetta`,Status:`Aggiungi un nuovo stato`,Type:`Aggiungi un nuovo tipo`,Stage:`Aggiungi una nuova fase`},text:{Priority:`Elenco delle priorità`,Label:`Elenco delle etichette`,Status:`Elenco degli stati`,Type:`Elenco dei tipi`,Stage:`Elenco delle fasi`}}}}},HGt=({apiClient:e,fetchUsers:t,i18nPlugin:n}={})=>({install(r){e?Wg.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.`),n?Object.entries(VGt).forEach(([e,t])=>{n.global.mergeLocaleMessage(e,t)}):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(Kce).forEach(([e,t])=>{r.component(e,t)})}}),UGt={de:{BuildingMaker:{title:`Building Maker`,back:`Zurück`,list:{text:`Erstellen und bearbeiten Sie die Etagen und laden Sie anschließend Ihre PDFs herunter.`,createButton:`Neues Projekt`,updateButton:`Umbenennen`,deleteButton:`Löschen`},form:{text:`Erstellen und bearbeiten Sie die Etagen und laden Sie anschließend Ihre PDFs herunter.`,input:`Name des Gebäudes`,error:`Ungültiger Name`,createButton:`Erstellen`,updateButton:`Bestätigen`},view:{addStoreyButton:`Etage`,addPlanButton:`Grundriss`,closeButton:`Fertigstellen`,submitFilesButton:`Bestätigen`},storeyForm:{title:`Neue Etage`,input:`Name`,error:`Ungültiger Name`,cancelButton:`Abbrechen`,submitButton:`Bestätigen`}},FileManager:{creationFormTitle:`Ordner erstellen`,renameFormPlaceholder:`Datei- / Ordnernam`,nameInputPlaceholder:`Ordnername`,emptyFolder:`Dieser Ordner ist leer`,newFolderSuccess:`Neuer Ordner erstellt`,renameFolderSuccess:`Umbenannter Ordner`,deleteFolderSuccess:`Ordner gelöscht`,newFileSuccess:`Datei hinzugefügt`,renameFileSuccess:`Umbenannte Datei`,deleteFileSuccess:`Datei gelöscht`,nameInputErrorMessage:`Ungültiger name`,cancel:`Abbrechen`,submit:`Bestätigen`,buttonText:`Neuer Ordner`,addFileButtonText:`Datei laden`,rename:`Umbenennen`,view:`Sehen`,download:`Herunterladen`,delete:`Löschen`,deleteTitle:`Dateien löschen`,deleteDetail:`Sie sind im Begriff, die folgenden Dateien / Ordner endgültig zu löschen`}},en:{BIMDataComponents:{t:{back:`Back`,cancel:`Cancel`,create:`Create`,delete:`Delete`,download:`Download`,finish:`Finish`,rename:`Rename`,search:`Search`,see:`View`,storey:`Storey`,validate:`Validate`}},BuildingMaker:{title:`Building Maker`,list:{text:`Create and edit storeys, then download your PDFs.`,new:`New project`},form:{input:`Building name`,error:`Invalid`},view:{addStorey:`Add Storey`,addFile:`Add File`,addPlan:`Add Plan`},storeyForm:{title:`New storey`,input:`Name`,error:`Invalid name`}},FileManager:{creationFormTitle:`Create folder`,renameFormPlaceholder:`Folder/File name`,nameInputPlaceholder:`Folder name`,emptyFolder:`This folder is empty`,newFolderSuccess:`New folder created`,renameFolderSuccess:`Folder renamed`,deleteFolderSuccess:`Folder deleted`,newFileSuccess:`File added`,renameFileSuccess:`File renamed`,deleteFileSuccess:`File deleted`,nameInputErrorMessage:`Invalid name`,buttonText:`New folder`,addFileButtonText:`Upload a file`,deleteTitle:`Deleting Files`,deleteDetail:`You are about to permanently delete the following files / folders`,dmsRoot:`Root of the project's DMS`,pdfPageSelectorTitle:`Select a page`},MetaBuildingStructure:{title:`Meta-Building Structure`,tab:{structure:`Structure`,zones:`Zones`,equipments:`Equipments`},StoreySelector:{placeholder:`Select a storey`}},PhotosphereBuilding:{title:`Photosphere Building`}},es:{BuildingMaker:{title:`Building Maker`,back:`Vuelta`,list:{text:`Cree y edite los pisos después cargue los PDF.`,createButton:`Nuevo proyecto`,updateButton:`Renombrar`,deleteButton:`Suprimir`},form:{text:`Cree y edite los pisos después cargue los PDF.`,input:`Nombre del edificio`,error:`Nombre no válido`,createButton:`Crear`,updateButton:`Validar`},view:{addStoreyButton:`Piso`,addPlanButton:`Plano`,closeButton:`Terminar`,submitFilesButton:`Validar`},storeyForm:{title:`Nuevo piso`,input:`Nombre`,error:`Nombre no válido`,cancelButton:`Anular`,submitButton:`Validar`}},FileManager:{creationFormTitle:`Crear un archivo`,renameFormPlaceholder:`Nombre de archivo / carpeta`,nameInputPlaceholder:`Nombre de la carpeta`,emptyFolder:`Esta carpeta está vacía`,newFolderSuccess:`Nueva carpeta creada`,renameFolderSuccess:`Carpeta renombrada`,deleteFolderSuccess:`Carpeta eliminada`,newFileSuccess:`Archivo agregado`,renameFileSuccess:`Archivo renombrado`,deleteFileSuccess:`Archivo eliminado`,nameInputErrorMessage:`Nombre inválida`,cancel:`Cancelar`,submit:`Validar`,buttonText:`Carpeta nueva`,addFileButtonText:`Cargar un archivo`,rename:`Renombrar`,view:`Ver`,download:`Descargar`,delete:`Borrar`,deleteTitle:`Eliminar archivos`,deleteDetail:`Está a punto de eliminar permanentemente los siguientes archivos / carpetas`}},fr:{BIMDataComponents:{t:{back:`Retour`,cancel:`Annuler`,create:`Créer`,delete:`Supprimer`,download:`Télécharger`,finish:`Terminer`,rename:`Renommer`,search:`Rechercher`,see:`Voir`,storey:`Étage`,validate:`Valider`}},BuildingMaker:{title:`Building Maker`,list:{text:`Créez et éditez les étages puis téléchagez vos PDF.`,new:`Nouveau projet`},form:{input:`Nom du bâtiment`,error:`Nom invalide`},view:{addStorey:`Ajouter un Étage`,addFile:`Ajouter un fichier`,addPlan:`Ajouter un plan`},storeyForm:{title:`Nouvel étage`,input:`Nom`,error:`Nom invalide`}},FileManager:{creationFormTitle:`Créer un dossier`,renameFormPlaceholder:`Nom du fichier/dosier`,nameInputPlaceholder:`Nom du dossier`,emptyFolder:`Ce dossier est vide`,newFolderSuccess:`Nouveau dossier créé`,renameFolderSuccess:`Dossier renommé`,deleteFolderSuccess:`Dossier supprimé`,newFileSuccess:`Fichier ajouté`,renameFileSuccess:`Fichier renommé`,deleteFileSuccess:`Fichier supprimé`,nameInputErrorMessage:`Nom invalide`,buttonText:`Nouveau dossier`,addFileButtonText:`Charger un fichier`,deleteTitle:`Supression de fichiers`,deleteDetail:`Vous êtes sur le point de supprimer définitivement les fichiers/dossiers suivants`,dmsRoot:`Racine de la GED du projet`,pdfPageSelectorTitle:`Sélectionner une page`},MetaBuildingStructure:{title:`Structure Méta-Building`,tab:{structure:`Structure`,zones:`Zones`,equipments:`Équipements`},StoreySelector:{placeholder:`Sélectionner un étage`}},PhotosphereBuilding:{title:`Photosphère Building`}},it:{BuildingMaker:{title:`Building Maker`,back:`Reso`,list:{text:`Crea e modifica i piani e poi scarica i tuoi PDF.`,createButton:`Nuovo progetto`,updateButton:`Rinominare`,deleteButton:`Eliminare`},form:{text:`Crea e modifica i piani e poi scarica i tuoi PDF.`,input:`Nome della costruzione`,error:`Nome non corretto`,createButton:`Creare`,updateButton:`Convalidare`},view:{addStoreyButton:`Piano`,addPlanButton:`Mappa`,closeButton:`Finire`,submitFilesButton:`Convalidare`},storeyForm:{title:`Nuovo piano`,input:`Nome`,error:`Nome non corretto`,cancelButton:`Annullare`,submitButton:`Convalidare`}},FileManager:{creationFormTitle:`Crea una cartella`,renameFormPlaceholder:`Nome file/cartella`,nameInputPlaceholder:`Nome della cartella`,emptyFolder:`Questa cartella è vuota`,newFolderSuccess:`Nuova cartella creata`,renameFolderSuccess:`Cartella rinominata`,deleteFolderSuccess:`Cartella eliminata`,newFileSuccess:`File aggiunto`,renameFileSuccess:`File rinominato`,deleteFileSuccess:`File cancellato`,nameInputErrorMessage:`Nome non valido`,cancel:`Annulla`,submit:`Invia`,buttonText:`Nuova cartella`,addFileButtonText:`Carica un file`,rename:`Rinominare`,view:`Vedere`,download:`Scaricare`,delete:`Cancellare`,deleteTitle:`Eliminazione di file`,deleteDetail:`Stai per eliminare definitivamente i seguenti file/cartelle`}}},WGt=({i18nPlugin:e}={})=>({install(t){e?Object.entries(UGt).forEach(([t,n])=>{e.global.mergeLocaleMessage(t,n)}):console.warn(`[BIMData Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly.`),Object.entries(xEt).forEach(([e,n])=>{t.component(e,n)})}}),GGt={beforeMount(e,t){if(typeof t.value!=`function`)throw Error(`click away directive needs function, got ${typeof t.value}`);e.clickAwayHandler=n=>{(n.path||n.composedPath&&n.composedPath()).find(t=>t===e)||t.value()},window.addEventListener(`mousedown`,e.clickAwayHandler,!0)},unmounted(e){window.removeEventListener(`mousedown`,e.clickAwayHandler,!0),delete e.clickAwayHandler}},KGt=s({BIMDataClickAway:()=>K_,BIMDataClickInputAway:()=>GGt}),qGt=e=>({install(t){Object.entries(YFe).forEach(([n,r])=>{e&&e.excludedComponents&&e.excludedComponents.length>0&&e.excludedComponents.includes(n)||(!e||!e.includedComponents||e.includedComponents.includes(n))&&t.component(n,r)}),(!e||e.directives!==!1)&&Object.entries(KGt).forEach(([e,n])=>t.directive(e.split(`BIMData`)[1],n))}}),JGt={name:`LiWrapper`,render(){return cd(`li`,this.$slots.default())}};function YGt(e,t){var n=new Set([]);return e.forEach(e=>{t.has(e)||n.add(e)}),n}var X9=f(`id`),XGt=({contextMenu:e,objects:t=[],state:n=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:()=>n.selectObjects(t.filter(h(p(`visible`),m(`selected`))).map(X9)),predicate:()=>t.some(h(p(`visible`),m(`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:()=>n.deselectObjects(t.filter(p(`selected`)).map(X9)),predicate:()=>t.some(p(`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 e=t.filter(e=>e.visible&&e.type===this.selectedObject.type&&e.id!==this.selectedObject.id).map(X9);n.selectObjects(e)},selectedObject:null,predicate(){let e=t.filter(h(p(`visible`),p(`selected`)));return e.length===1&&e[0].type!==void 0?(this.selectedObject=e[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 e=new Set(t.filter(p(`selected`)).map(X9)),r=new Set(t.filter(p(`visible`)).map(X9));n.selectObjects(Array.from(YGt(r,e)),{exclusive:!0})},predicate:()=>t.some(h(m(`selected`),p(`visible`)))&&t.some(h(p(`selected`),p(`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:()=>n.showObjects(t.filter(m(`visible`)).map(X9)),predicate:()=>t.some(m(`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 e=this.objectsToHide.filter(p(`selected`));e.length>0&&n.deselectObjects(e.map(X9)),n.hideObjects(this.objectsToHide.map(X9))},predicate(){return this.objectsToHide=t.filter(h(p(`selected`),p(`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 e=t.filter(p(`visible`));e.some(p(`selected`))&&n.deselectObjects(e.filter(p(`selected`)).map(X9)),n.hideObjects(e.map(X9))},predicate:()=>t.some(p(`visible`))}].filter(e=>e.predicate()),ZGt={components:{LiWrapper:JGt},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 n=await t;this.asyncPredicates.has(t)&&(this.asyncPredicates.delete(t),this.asyncPredicateRunning=this.asyncPredicates.size>0,n===!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:n=null}){let r=new Map;return n&&this.$viewer.shortcutManager.getShortcuts(n).forEach(e=>r.set(e.name,e.key)),XGt({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(e=>e.sort((e,t)=>(e.position=e.position||0,t.position=t.position||0,e.position-t.position))),this.currentCommands=[...e.keys()].sort((e,t)=>e-t).map(t=>e.get(t)).flat()},isGroupIntersection(e){if(e===0)return!1;let t=this.currentCommands[e-1],n=this.currentCommands[e];return t.group<n.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}}},QGt={key:0,class:`separator`},$Gt={class:`menu-text`},eKt={key:1,class:`menu-picto`},tKt={key:0,class:`context-menu__spinner`};function nKt(e,t,n,r,i,a){let o=R(`BIMDataIconChevron`),s=R(`LiWrapper`),c=R(`BIMDataSpinner`),l=Fc(`click-away`);return i.displayed&&(i.currentCommands.length||i.asyncPredicateRunning)?qo((z(),B(`ul`,{key:0,class:`bimdata-list context-menu`,style:N(a.position)},[(z(!0),B(bu,null,Rc(i.currentCommands,(e,t)=>(z(),V(s,{key:e.label,class:`context-menu__element`,onClick:t=>a.executeCommand(e)},{default:L(()=>[a.isGroupIntersection(t)?(z(),B(`div`,QGt)):G(``,!0),H(`div`,$Gt,F(e.label),1),!e.component&&e.picto?(z(),B(`span`,eKt,F(e.picto),1)):e.component?(z(),V(o,{key:2,size:`xxs`,class:`fill-primary`})):G(``,!0)]),_:2},1032,[`onClick`]))),128)),i.asyncPredicateRunning?(z(),B(`li`,tKt,[U(c)])):G(``,!0)],4)),[[l,a.away]]):G(``,!0)}var rKt=q(ZGt,[[`render`,nKt],[`__scopeId`,`data-v-5b87d4a3`]]),iKt={name:`ViewerHeader`,inject:[`$viewer`],props:{visible:{type:Boolean,default:!0}},setup(){let e=Xo(`$viewer`),t=Ea(new Map);return{logo:e.uiSettings.bimdataLogo!==!1,version:e.uiSettings.version===!1?null:e.version,headerContent:t,headerRightContentComponents:K(()=>Array.from(t.values()).filter(e=>e.position===`right`).sort((e,t)=>e.order-t.order).map(e=>e.component)),headerLeftContentComponents:K(()=>Array.from(t.values()).filter(e=>e.position===`left`).sort((e,t)=>e.order-t.order).map(e=>e.component)),addContent:e=>{if(!e.name)throw TypeError(`[Viewer Header] Content must have a name`);if(t.has(e.name))throw Error(`[Viewer Header] Content with name ${e.name} already exists`);t.set(e.name,e)},removeContent:e=>t.has(e)?(t.delete(e),!0):!1}}},aKt={class:`viewer-header`},oKt={class:`viewer-header__content`},sKt={class:`viewer-header__content__left`},cKt={class:`viewer-header__content__right`},lKt={key:0,class:`m-l-6 flex items-center`},uKt={key:1,class:`viewer-header__version`};function dKt(e,t,n,r,i,a){let o=R(`BIMDataIllustration`);return qo((z(),B(`div`,aKt,[H(`div`,oKt,[H(`div`,sKt,[(z(!0),B(bu,null,Rc(r.headerLeftContentComponents,e=>(z(),V(Pc(e),{key:e.name}))),128))]),H(`div`,cKt,[(z(!0),B(bu,null,Rc(r.headerRightContentComponents,e=>(z(),V(Pc(e),{key:e.name}))),128))])]),r.logo||r.version?(z(),B(`div`,lKt,[r.logo?(z(),V(o,{key:0,name:`logo`,width:`30px`,height:`30px`})):G(``,!0),r.version?(z(),B(`div`,uKt,F(r.version),1)):G(``,!0)])):G(``,!0)],512)),[[Wd,n.visible]])}var fKt=q(iKt,[[`render`,dKt],[`__scopeId`,`data-v-5c9ea6b6`]]),pKt={emits:[`resize`],setup(e,{emit:t}){return{onResizerMousedown:e=>{e.preventDefault();let n=e.clientX,r=e=>{e.preventDefault();let r=e.clientX-n;n=e.clientX,t(`resize`,r)},i=e=>{e.preventDefault(),window.removeEventListener(`mousemove`,r),window.removeEventListener(`mouseup`,i)};window.addEventListener(`mousemove`,r),window.addEventListener(`mouseup`,i)}}}},mKt={class:`bimdata-separator`};function hKt(e,t,n,r,i,a){return z(),B(`div`,mKt,[t[1]||=H(`div`,{class:`bimdata-separator__line`},null,-1),H(`div`,{class:`bimdata-separator__resizer`,onMousedown:t[0]||=(...e)=>r.onResizerMousedown&&r.onResizerMousedown(...e)},null,32)])}var gKt={components:{Separator:q(pKt,[[`render`,hKt],[`__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=I(null),n=I(e.sidePanel.width??400);return rs(()=>e.sidePanel,()=>{Object.defineProperty(e.sidePanel,`width`,{get(){return n.value},set(e){if(typeof e!=`number`||e<=0){console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof e}`);return}n.value=e}}),Object.defineProperty(e.sidePanel,`componentInstance`,{get(){return t.value},enumerable:!0})},{immediate:!0}),{componentInstance:t,width:n,onResize:(e,t=1)=>{let r=n.value+e*t;n.value=Math.max(0,r)}}}},_Kt={class:`bimdata-global-side-panel__component`};function vKt(e,t,n,r,i,a){let o=R(`Separator`);return z(),B(`div`,{class:`bimdata-global-side-panel`,style:N(`width: ${r.width}px`)},[n.sidePanel.resizable&&n.position===`right`?(z(),V(o,{key:0,onResize:t[0]||=e=>r.onResize(e,-1)})):G(``,!0),H(`div`,_Kt,[(z(),V(Pc(n.sidePanel.component),{ref:`componentInstance`},null,512))]),n.sidePanel.resizable&&n.position===`left`?(z(),V(o,{key:1,onResize:t[1]||=e=>r.onResize(e)})):G(``,!0)],4)}var yKt={name:`BimdataViewer`,components:{ContextMenu:rKt,ViewerHeader:fKt,ModalManager:H9,GlobalSidePanel:q(gKt,[[`render`,vKt],[`__scopeId`,`data-v-82d0d4cb`]])},setup(){let e=Xo(`$viewer`),{globalContext:t,shortcutManager:n}=e;Ec(()=>{n&&n.destroy(),t.hub.clear()}),Sc(()=>{e.pluginManager.runPluginsScripts(e)});let r=K(()=>e.uiSettings.bimdataLogo!==!1&&(t.localContexts.length!==1||t.localContexts[0].window?.logoAndVersion)),i=K(()=>e.uiSettings.version!==!1&&(t.localContexts.length!==1||t.localContexts[0].window?.logoAndVersion)?e.version:null),a=K(()=>t.leftSidePanel),o=K(()=>t.rightSidePanel),s=K(()=>{let n=e.uiSettings.header!==!1,r=t.localContexts.length===1&&t.localContexts[0].window?.header===!1,i=!!(a.value||o.value);return n&&(!r||i)}),c=e.uiSettings.contextMenu!==!1,l=I(null);function u(e){c&&l.value.open(e)}function d(){e.shortcutManager.active=!0}function f(){e.shortcutManager.active=!1}return{Layout:e.layout.areas.component,onContextMenu:u,onMouseenter:d,onMouseleave:f,isHeaderVisible:s,viewerTemplateRef:t.templateRef,modalManagerTemplateRef:t.modalManagerTemplateRef,headerTemplateRef:t.headerTemplateRef,contextMenuTemplateRef:l,contextMenuEnabled:c,bimdataLogoOnSingleWindow:r,viewerVersionOnSingleWindow:i,version:e.version,loading:K(()=>t.loading),spinner:K(()=>t.spinner),leftSidePanel:a,rightSidePanel:o}}},bKt={key:1,class:`bimdata-context-loading-overlay`,style:{"z-index":`3`}},xKt={key:2,class:`viewer__logo`},SKt={key:1,class:`version m-t-6`};function CKt(e,t,n,r,i,a){let o=R(`ModalManager`),s=R(`ContextMenu`),c=R(`ViewerHeader`),l=R(`GlobalSidePanel`),u=R(`BIMDataSpinner`),d=R(`BIMDataIllustration`);return z(),B(`div`,{id:`bimdata-viewer`,ref:`viewerTemplateRef`,class:`bimdata-viewer bimdata-design-system bimdata-scrollbar`,onContextmenu:t[0]||=(...e)=>r.onContextMenu&&r.onContextMenu(...e),onMouseenter:t[1]||=(...e)=>r.onMouseenter&&r.onMouseenter(...e),onMouseleave:t[2]||=(...e)=>r.onMouseleave&&r.onMouseleave(...e)},[U(o,{ref:`modalManagerTemplateRef`},null,512),r.contextMenuEnabled?(z(),V(s,{key:0,ref:`contextMenuTemplateRef`},null,512)):G(``,!0),U(c,{ref:`headerTemplateRef`,visible:r.isHeaderVisible},null,8,[`visible`]),H(`div`,{class:`bimdata-viewer__content`,style:N(r.isHeaderVisible?`height: calc(100% - var(--bimdata-viewer-header-height, 40px))`:`height: 100%`)},[r.leftSidePanel?(z(),V(l,{key:0,"side-panel":r.leftSidePanel,position:`left`},null,8,[`side-panel`])):G(``,!0),(z(),V(Pc(r.Layout),{style:`height: 100%; flex-grow: 1;`})),r.rightSidePanel?(z(),V(l,{key:1,"side-panel":r.rightSidePanel,position:`right`},null,8,[`side-panel`])):G(``,!0)],4),r.loading?(z(),B(`div`,bKt,[r.spinner&&r.spinner.component?(z(),V(Pc(r.spinner.component),Br(Vu({key:0},r.spinner.props)),null,16)):(z(),V(u,{key:1,size:`40px`,border:`5px`}))])):G(``,!0),!r.isHeaderVisible&&(r.bimdataLogoOnSingleWindow||r.viewerVersionOnSingleWindow)?(z(),B(`div`,xKt,[r.bimdataLogoOnSingleWindow?(z(),V(d,{key:0,name:`logo`})):G(``,!0),r.viewerVersionOnSingleWindow?(z(),B(`div`,SKt,F(r.version),1)):G(``,!0)])):G(``,!0)],544)}var wKt=q(yKt,[[`render`,CKt],[`__scopeId`,`data-v-0c1c941a`]]),TKt=[`src`],EKt={class:`bimdata-models__header`},DKt={key:0,class:`bimdata-models__header__loader`},OKt={class:`bimdata-models__header__picto`},kKt={class:`bimdata-models__header__name`},AKt={key:0,class:`bimdata-models__header__name--empty`},jKt={key:1,class:`bimdata-models__header__name--empty`},MKt={key:3},NKt=[`onMousemove`,`onClick`],Z9=q({__name:`Models`,props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:`350px`}},setup(e){let t=e,n=Xo(`$viewer`),r=I(),i=I(0),a=I(0),o=I(),s=za([]),c=I(!1),l=K(()=>n.localContext.loadedModels),u=K(()=>n.localContext.loadedModelIds),d=K(()=>n.localContext.loadingModelIds),f=K(()=>n.localContext.multiModel),p=K(()=>(t.customFilter?s.value.filter(t.customFilter):s.value).map(e=>l.value.find(t=>t.document?.head_id!=null&&t.document.head_id===e.document.id)??e)),m=e=>u.value.includes(e),h=e=>d.value.includes(e),g=K(()=>{let{x:e,y:t}=o.value?.getBoundingClientRect()??{x:0,y:0};return`top:${a.value-t}px; left:${i.value-e}px;`}),_=e=>{!f.value&&m(e.id)||d.value.length>0||(n.localContext.loadedModelIds.includes(e.id)?n.localContext.unloadModels([e.id]):n.localContext.loadModels([e.id]))},v=e=>{switch(e){case`C`:return`success`;case`E`:return`failed`;case`P`:case`I`:return`sandglass`}},y=(e,t)=>{e?.viewer_360_file&&(i.value=t.clientX,a.value=t.clientY),r.value=e?.viewer_360_file},b=async e=>{c.value=!0;try{return(await n.api.apiClient.modelApi.getModels(n.api.cloudId,n.api.projectId,void 0,void 0,e)).filter(e=>n.state.models.some(e=>e.archived)||!e.archived).sort(GT(`updated_at`,!1))}catch(e){console.error(`[Models] Cannot get project models. Error: `,e)}finally{c.value=!1}return[]},x=e=>e.children?.some(e=>m(e.id))??!1;return b(n.localContext.modelTypes).then(e=>{s.value=e}),(t,n)=>{let i=R(`BIMDataSpinner`),a=R(`BIMDataIconModel3D`),s=R(`BIMDataTextbox`),b=R(`BIMDataCheckbox`),S=R(`BIMDataRadio`),C=R(`BIMDataIcon`),w=R(`BIMDataDropdownList`);return z(),B(`div`,{ref_key:`templateRef`,ref:o,class:P([`bimdata-models`,{"bimdata-models--window-positioning":e.windowPositioning}])},[r.value?(z(),B(`div`,{key:0,class:`bimdata-models__preview`,style:N(g.value)},[H(`img`,{src:r.value},null,8,TKt)],4)):G(``,!0),U(w,{style:N(`--bimdata-models-width: ${e.width};`),width:e.width,list:p.value,"element-key":`id`,"per-page":40,loading:c.value,class:`bimdata-models__list`,disabled:p.value.length===0,onElementClick:_},{header:L(({isOpen:e})=>[H(`div`,EKt,[c.value||d.value.length>0?(z(),B(`div`,DKt,[U(i)])):(z(),B(bu,{key:1},[H(`div`,OKt,[U(a)]),H(`div`,{class:P([`bimdata-models__header__number bimdata-info-length`,{"bimdata-models__header__number--empty":u.value.length===0}])},[H(`span`,null,F(u.value.length),1)],2),H(`div`,kKt,[p.value.length===0?(z(),B(`span`,AKt,F(t.$t(`model.no_model`)),1)):u.value.length===0?(z(),B(`span`,jKt,F(t.$t(`model.no_loaded_model`)),1)):u.value.length===1?(z(),V(s,{key:2,text:l.value[0].name,tooltip:!e},null,8,[`text`,`tooltip`])):u.value.length>1?(z(),B(`span`,MKt,F(t.$t(`model.selected_models`)),1)):G(``,!0)])],64))])]),element:L(({element:t,close:r})=>[H(`div`,{class:`bimdata-models__model`,onMousemove:n=>e.preview&&y(t,n),onMouseout:n[0]||=t=>e.preview&&y(),onClick:()=>{!f.value&&!m(t.id)&&r()}},[f.value?(z(),V(b,{key:0,"model-value":m(t.id)||x(t),disabled:t.status!==`C`||d.value.length>0},null,8,[`model-value`,`disabled`])):(z(),V(S,{key:1,"model-value":m(t.id)||x(t),disabled:t.status!==`C`||d.value.length>0},null,8,[`model-value`,`disabled`])),U(C,{margin:`0 calc(var(--spacing-unit) / 2)`,name:v(t.status),size:`xs`,class:P({"fill-success":t.status===`C`,"fill-high":t.status===`E`})},null,8,[`name`,`class`]),U(s,{class:P({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":t.status!==`C`||d.value.length>0}),text:t.name,width:`calc(100% -
6322
6322
  ${f.value?13:23}px - 2 * 6px - 16px)`},null,8,[`class`,`text`,`width`]),t.document&&!t.document.is_head_version?(z(),V(C,{key:2,name:`versioning`,fill:``,color:`default`,size:`xs`,margin:`0 0 0 6px`})):G(``,!0)],40,NKt),h(t.id)?(z(),V(i,{key:0,class:`bimdata-models__model__spinner`})):G(``,!0)]),_:1},8,[`style`,`width`,`list`,`loading`,`disabled`])],2)}}},[[`__scopeId`,`data-v-34c2cf79`]]),PKt=`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`,FKt=[`src`],IKt={key:0,class:`bimdata-multi-model-loader__header-container`},LKt={key:0,class:`bimdata-multi-model-loader__header__loader`},RKt={class:`bimdata-multi-model-loader__header__picto`},zKt=[`src`],BKt={class:`bimdata-multi-model-loader__header__name`},VKt={key:0,class:`bimdata-multi-model-loader__header__name--empty`},HKt={key:1,class:`bimdata-multi-model-loader__header__name--empty`},UKt={key:3},WKt={key:1,class:`bimdata-multi-model-loader__main`},GKt=[`onMousemove`,`onClick`],KKt=q({__name:`BIMDataMultiModelLoader`,props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:`350px`}},setup(e){let t=e,n=Xo(`$viewer`),r=I(),i=I(0),a=I(0),o=I(),s=za([]),c=I(!1),l=I(!0),u=e=>{e.key===`Escape`?l.value=!0:e.key===`Enter`&&w()};rs(l,e=>{e?(window.removeEventListener(`keydown`,u),y.clear(),v.clear(),r.value=null):window.addEventListener(`keydown`,u)});let d=K(()=>n.localContext.loadedModels),f=K(()=>n.localContext.loadedModelIds),p=K(()=>n.localContext.loadingModelIds),m=K(()=>n.localContext.multiModel),h=K(()=>(t.customFilter?s.value.filter(t.customFilter):s.value).map(e=>d.value.find(t=>t.document?.head_id!=null&&t.document.head_id===e.document.id)??e)),g=e=>f.value.includes(e),_=e=>p.value.includes(e),v=Ea(new Set),y=Ea(new Set),b=e=>e.children?.some(e=>g(e.id))??!1,x=e=>(g(e.id)||b(e)||v.has(e))&&!y.has(e),S=K(()=>{let{x:e,y:t}=o.value.getBoundingClientRect();return`top:${a.value-t}px; left:${i.value-e}px;`}),C=e=>{e.status===`C`&&(!m.value&&g(e.id)||(g(e.id)?y.has(e)?y.delete(e):y.add(e):v.has(e)?v.delete(e):v.add(e)))},w=()=>{v.size>0&&n.localContext.loadModels(Array.from(v).map(e=>e.id)),y.size>0&&n.localContext.unloadModels(Array.from(y).map(e=>e.id)),l.value=!0},T=e=>{switch(e){case`C`:return`success`;case`E`:return`failed`;case`P`:case`I`:return`sandglass`}},E=e=>e.document&&!e.document.is_head_version,D=(e,n)=>{!t.preview||l.value||(e?.viewer_360_file&&(i.value=n.clientX,a.value=n.clientY),r.value=e?.viewer_360_file)};return(async e=>{c.value=!0;try{return(await n.api.apiClient.modelApi.getModels(n.api.cloudId,n.api.projectId,void 0,void 0,e)).filter(e=>n.state.models.some(e=>e.archived)||!e.archived).sort(GT(`updated_at`,!1))}catch(e){console.error(`[Models] Cannot get project models. Error: `,e)}finally{c.value=!1}return[]})(n.localContext.modelTypes).then(e=>{s.value=e}),(t,n)=>{let i=R(`BIMDataSpinner`),a=R(`BIMDataTextbox`),s=R(`BIMDataIconChevron`),u=R(`BIMDataButton`),g=R(`BIMDataIconFileIfcPolychrome`),b=R(`BIMDataCheckbox`),O=R(`BIMDataRadio`),k=R(`BIMDataIcon`),A=R(`BIMDataPaginatedList`),ee=Fc(`click-away`);return z(),B(`div`,{ref_key:`templateRef`,ref:o,class:P([`bimdata-multi-model-loader`,{"bimdata-multi-model-loader--window-positioning":e.windowPositioning}])},[r.value?(z(),B(`div`,{key:0,class:`bimdata-multi-model-loader__preview`,style:N(S.value)},[H(`img`,{src:r.value},null,8,FKt)],4)):G(``,!0),U(kd,{name:`fade`,mode:`out-in`},{default:L(()=>[l.value?(z(),B(`div`,IKt,[Bc(t.$slots,`left`,{},void 0,!0),H(`div`,{class:`bimdata-multi-model-loader__header`,onClick:n[0]||=e=>l.value=!1},[c.value||p.value.length>0?(z(),B(`div`,LKt,[U(i)])):(z(),B(bu,{key:1},[H(`div`,RKt,[H(`img`,{src:Ua(PKt),alt:`file icon`},null,8,zKt)]),H(`div`,{class:P([`bimdata-multi-model-loader__header__number bimdata-info-length`,{"bimdata-multi-model-loader__header__number--empty":f.value.length===0}])},[H(`span`,null,F(f.value.length),1)],2),H(`div`,BKt,[h.value.length===0?(z(),B(`span`,VKt,F(t.$t(`model.no_model`)),1)):f.value.length===0?(z(),B(`span`,HKt,F(t.$t(`model.no_loaded_model`)),1)):f.value.length===1?(z(),V(a,{key:2,text:d.value[0].name,tooltip:l.value,width:`233px`},null,8,[`text`,`tooltip`])):f.value.length>1?(z(),B(`span`,UKt,F(t.$t(`model.selected_models`)),1)):G(``,!0)]),U(u,{color:`default`,icon:``,radius:``,fill:``,width:`21px`,height:`21px`},{default:L(()=>[U(s,{size:`xxxs`})]),_:1})],64))]),Bc(t.$slots,`right`,{},void 0,!0)])):qo((z(),B(`div`,WKt,[U(A,{list:h.value,"per-page":10},{element:L(({element:e})=>[H(`div`,{class:P([`bimdata-multi-model-loader__main__model`,{"bimdata-multi-model-loader__main__model--disabled":e.status!==`C`}]),onMousemove:t=>D(e,t),onMouseout:n[1]||=e=>D(),onClick:t=>C(e)},[U(g,{fill:``,color:`default`,size:`xs`}),m.value?(z(),V(b,{key:0,"model-value":x(e),disabled:e.status!==`C`},null,8,[`model-value`,`disabled`])):(z(),V(O,{key:1,"model-value":x(e),disabled:e.status!==`C`},null,8,[`model-value`,`disabled`])),U(a,{class:P({"bimdata-multi-model-loader__main__model__name":!0,"bimdata-multi-model-loader__main__model__name--disabled":e.status!==`C`}),text:e.name,width:E(e)?`333px`:`363px`},null,8,[`class`,`text`,`width`]),E(e)?(z(),V(k,{key:2,name:`versioning`,fill:``,color:`default`,size:`xs`,margin:`0 0 0 6px`})):G(``,!0),_(e.id)?(z(),V(i,{key:3,class:`bimdata-multi-model-loader__main__model__spinner`})):(z(),V(k,{key:4,name:T(e.status),size:`xs`,class:P({"fill-success":e.status===`C`,"fill-high":e.status===`E`})},null,8,[`name`,`class`]))],42,GKt)]),_:1},8,[`list`]),U(u,{class:`bimdata-multi-model-loader__main__validate`,width:`93px`,color:`primary`,fill:``,radius:``,disabled:Ua(v).size===0&&Ua(y).size===0,onClick:w},{default:L(()=>[W(F(t.$t(`global.validate`)),1)]),_:1},8,[`disabled`])])),[[ee,()=>l.value=!0]])]),_:3})],2)}}},[[`__scopeId`,`data-v-44e6af66`]]),qKt={data(){return{shown:!1}},mounted(){setTimeout(()=>{this.shown=!0},500)}};function JKt(e,t,n,r,i,a){let o=R(`BIMDataIllustration`);return z(),B(`div`,{class:`bimdata__no-model`,style:N({"--no-model--opacity":i.shown?1:0})},[U(o,{name:`emptyViewer`,x:`90`,y:`90`}),H(`span`,null,F(e.$t(`model.select_model`)),1)],4)}var Q9=q(qKt,[[`render`,JKt],[`__scopeId`,`data-v-5ffd9bc0`]]);window.BIMDataViewerVue=Xh;var YKt=class{constructor(e={}){let{api:t={},ui:n}=e;this.uiCfg=n,t.apiUrl||=(console.info("[BIMData Viewer] INFO - Viewer config - `apiUrl` not set, use 'https://api.bimdata.io' by default."),`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 LGt(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:n}=this;await n.api.ready;try{let e=await n.api.apiClient.collaborationApi.checkProjectAccess(n.api.cloudId,n.api.projectId);n.api.permissions=Y9(e)}catch{n.api.permissions=Y9()}let r=this.api.accessToken,{i18n:i}=n;i.registerTranslations(n.pluginManager.pluginTranslations),n.layout.apply(t);let a=qf({i18n:i.i18nVuePlugin,data(){return{accessToken:r}},render(){return cd(wKt,{style:`height: 100%`})}}).use(i.i18nVuePlugin).use(qGt()).use(WGt({i18nPlugin:i.i18nVuePlugin})).use(HGt({apiClient:n.api.apiClient,i18nPlugin:i.i18nVuePlugin}));a.provide(`$viewer`,n),a.provide(`BIMDATA_DESIGN_SYSTEM_DARK_THEME`,K(()=>n.darkTheme)),a.component(`BIMDataModelLoader`,Z9),a.component(`BIMDataMultiModelLoader`,KKt),a.component(`BIMDataNoModelWindowPlaceHolder`,Q9),a.component(`BIMDataStoreySelector`,wD),a.component(`ModelsLoader`,Z9),a.component(`NoModelWindowPlaceHolder`,Q9);let o=e instanceof HTMLElement?e:document.querySelector(e);o&&(o.style.height=`100%`);let s=a.mount(e);return s.$viewer=n,RGt(s.$el,this.uiCfg?.style),typeof window<`u`&&(window.bimdataViewer=s),this.vueApp=a,s}destroy(){this.vueApp?.unmount()}setLocale(e){if(!Eg.includes(e))throw Error(`Viewer available locales are ${Eg.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)}},$9=(e={})=>new YKt(e);return window.makeBIMDataViewer=$9,$9});