/*! * LMV v7.99.1 * * Copyright 2024 Autodesk, Inc. * All rights reserved. * * This computer source code and related instructions and comments are the * unpublished confidential and proprietary information of Autodesk, Inc. * and are protected under Federal copyright and state trade secret law. * They may not be disclosed to, copied or used by any third party without * the prior written consent of Autodesk, Inc. * * Autodesk Viewer SDK Usage Limitations: * * The Autodesk Viewer SDK JavaScript must be delivered from an * Autodesk-hosted URL. */(()=>{var t={3412:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});var i=n(1354),o=n.n(i),a=n(6314),s=n.n(a)()(o());s.push([t.id,".sectionPanel{line-height:14px;text-align:left;z-index:10}.section-horizontal-divider{height:1px;border-top:1px solid rgba(200,200,200,.8)}.section-submenu-select{display:block;position:relative;width:calc(100% - 40px);padding:10px 20px 0px 20px;opacity:.3}.section-panel:hover .section-submenu-select{opacity:.8}.section-submenu-selectlabel{position:relative;display:inline-block;padding-right:20px;padding-bottom:4px}.section-restart{margin:10px 20px 15px 20px;padding:6px 10px 6px 10px;width:calc(100% - 55px);cursor:pointer}.docking-panel:hover .section-restart{background-color:rgba(255,255,255,.12)}.docking-panel .section-restart:hover{background-color:rgba(166,194,255,.7);-webkit-transition:all .2s ease;-moz-transition:all .2s ease;-ms-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease}","",{version:3,sources:["webpack://./extensions/Section/Section.css"],names:[],mappings:"AAAA,cAAc,gBAAgB,CAAC,eAAe,CAAC,UAAU,CAAC,4BAA4B,UAAU,CAAC,yCAAyC,CAAC,wBAAwB,aAAa,CAAC,iBAAiB,CAAC,uBAAuB,CAAC,0BAA0B,CAAC,UAAU,CAAC,6CAA6C,UAAU,CAAC,6BAA6B,iBAAiB,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,iBAAiB,0BAA0B,CAAC,yBAAyB,CAAC,uBAAuB,CAAC,cAAc,CAAC,sCAAsC,sCAAsC,CAAC,sCAAsC,qCAAqC,CAAC,+BAA+B,CAAC,4BAA4B,CAAC,2BAA2B,CAAC,0BAA0B,CAAC,uBAAuB",sourcesContent:[".sectionPanel{line-height:14px;text-align:left;z-index:10}.section-horizontal-divider{height:1px;border-top:1px solid rgba(200,200,200,.8)}.section-submenu-select{display:block;position:relative;width:calc(100% - 40px);padding:10px 20px 0px 20px;opacity:.3}.section-panel:hover .section-submenu-select{opacity:.8}.section-submenu-selectlabel{position:relative;display:inline-block;padding-right:20px;padding-bottom:4px}.section-restart{margin:10px 20px 15px 20px;padding:6px 10px 6px 10px;width:calc(100% - 55px);cursor:pointer}.docking-panel:hover .section-restart{background-color:rgba(255,255,255,.12)}.docking-panel .section-restart:hover{background-color:rgba(166,194,255,.7);-webkit-transition:all .2s ease;-moz-transition:all .2s ease;-ms-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease}"],sourceRoot:""}]);const r=s},6314:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,o,a){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(i)for(var r=0;r0?" ".concat(h[5]):""," {").concat(h[1],"}")),h[5]=a),n&&(h[2]?(h[1]="@media ".concat(h[2]," {").concat(h[1],"}"),h[2]=n):h[2]=n),o&&(h[4]?(h[1]="@supports (".concat(h[4],") {").concat(h[1],"}"),h[4]=o):h[4]="".concat(o)),e.push(h))}},e}},1354:t=>{"use strict";t.exports=function(t){var e=t[1],n=t[3];if(!n)return e;if("function"==typeof btoa){var i=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(i),a="/*# ".concat(o," */");return[e].concat([a]).join("\n")}return[e].join("\n")}},1873:(t,e,n)=>{var i=n(9325).Symbol;t.exports=i},2552:(t,e,n)=>{var i=n(1873),o=n(659),a=n(9350),s=i?i.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?o(t):a(t)}},4128:(t,e,n)=>{var i=n(1800),o=/^\s+/;t.exports=function(t){return t?t.slice(0,i(t)+1).replace(o,""):t}},4840:(t,e,n)=>{var i="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=i},659:(t,e,n)=>{var i=n(1873),o=Object.prototype,a=o.hasOwnProperty,s=o.toString,r=i?i.toStringTag:void 0;t.exports=function(t){var e=a.call(t,r),n=t[r];try{t[r]=void 0;var i=!0}catch(t){}var o=s.call(t);return i&&(e?t[r]=n:delete t[r]),o}},9350:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},9325:(t,e,n)=>{var i=n(4840),o="object"==typeof self&&self&&self.Object===Object&&self,a=i||o||Function("return this")();t.exports=a},1800:t=>{var e=/\s/;t.exports=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}},8221:(t,e,n)=>{var i=n(3805),o=n(124),a=n(9374),s=Math.max,r=Math.min;t.exports=function(t,e,n){var c,l,h,u,p,E,d=0,m=!1,f=!1,v=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function T(e){var n=c,i=l;return c=l=void 0,d=e,u=t.apply(i,n)}function w(t){var n=t-E;return void 0===E||n>=e||n<0||f&&t-d>=h}function y(){var t=o();if(w(t))return g(t);p=setTimeout(y,function(t){var n=e-(t-E);return f?r(n,h-(t-d)):n}(t))}function g(t){return p=void 0,v&&c?T(t):(c=l=void 0,u)}function R(){var t=o(),n=w(t);if(c=arguments,l=this,E=t,n){if(void 0===p)return function(t){return d=t,p=setTimeout(y,e),m?T(t):u}(E);if(f)return clearTimeout(p),p=setTimeout(y,e),T(E)}return void 0===p&&(p=setTimeout(y,e)),u}return e=a(e)||0,i(n)&&(m=!!n.leading,h=(f="maxWait"in n)?s(a(n.maxWait)||0,e):h,v="trailing"in n?!!n.trailing:v),R.cancel=function(){void 0!==p&&clearTimeout(p),d=0,c=E=l=p=void 0},R.flush=function(){return void 0===p?u:g(o())},R}},3805:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},346:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},4394:(t,e,n)=>{var i=n(2552),o=n(346);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==i(t)}},124:(t,e,n)=>{var i=n(9325);t.exports=function(){return i.Date.now()}},9374:(t,e,n)=>{var i=n(4128),o=n(3805),a=n(4394),s=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(a(t))return NaN;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=i(t);var n=r.test(t);return n||c.test(t)?l(t.slice(2),n?2:8):s.test(t)?NaN:+t}},5072:t=>{"use strict";var e=[];function n(t){for(var n=-1,i=0;i{"use strict";var e={};t.exports=function(t,n){var i=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},540:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},5056:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},7825:t=>{"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,o&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleTagTransform(i,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},1113:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}}},e={};function n(i){var o=e[i];if(void 0!==o)return o.exports;var a=e[i]={id:i,exports:{}};return t[i](a,a.exports,n),a.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nc=void 0;var i={};(()=>{"use strict";n.r(i),n.d(i,{SectionExtension:()=>x});const t=n(8221);var e=null,o=Autodesk.Viewing.Private,a=function(n,i){var a,s,r=n.impl,c=["section"],l=!1,h=!1,u=!1,p=!0,E=i.tintColor,d=i.tintIntensity,m=isNaN(i.gizmoOffsetRight)?200:i.gizmoOffsetRight,f=isNaN(i.gizmoOffsetLeft)?80:i.gizmoOffsetLeft,v=isNaN(i.gizmoOffsetTop)?80:i.gizmoOffsetTop,T=isNaN(i.gizmoOffsetBottom)?80:i.gizmoOffsetBottom,w=new THREE.Vector3,y=new THREE.Vector3,g=[],R=[],x=[],M="",H="gizmo",b=null,A=!1,P=!0,S=[0,1,1,3,3,2,2,0],C=2653930,V=!0;let B,k,z,I,O=new THREE.Vector3;function X(t){B=t,k=B.clone().invert(),z=(new THREE.Matrix3).getNormalMatrix(B),I=(new THREE.Matrix3).getNormalMatrix(k)}function Y(){var t,e;let n=new THREE.Matrix4;const i=null===(t=r.get3DModels()[0])||void 0===t?void 0:t.getData();if(i&&null!==(e=i.loadOptions)&&void 0!==e&&e.applyRefPoint&&i.refPointTransform){const t=i.refPointTransform,e=new THREE.Vector3,o=new THREE.Quaternion,a=new THREE.Vector3;t.decompose(e,o,a),n.makeRotationFromQuaternion(o)}return n}X(Y());const G=t(((t,e,n)=>{o.analytics.track("viewer.section",{from:t,type:e,action:n})}),2e3);function _(){r.invalidate(!1,!1,!0)}function L(){j(),a&&a.update(),s&&s.update()}function j(){if(!a||!a.object)return;let t=function(t){const e=r.worldToClient(t),n=r.getCanvasBoundingClientRect();let i=(new THREE.Vector3).copy(e);return e.xn.width-m&&(i.x=n.width-m),e.yn.height-T&&(i.y=n.height-T),i.x!==e.x||i.y!==e.y?i:void 0}(a.position);if(t){const e=THREE.TransformControls.intersectObjects(t.x,t.y,[a.object],r.camera,!1);e&&(a.object.getWorldPosition(w),y.copy(e.point).sub(w),a.setGizmoOffset(y))}}function N(){l&&1===R.length&&(J(!0),L(),F((new THREE.Plane).setComponents(R[0].x,R[0].y,R[0].z,R[0].w)))}function Z(t){let{objectsMoved:e}=t;e&&N()}!function(){class t extends THREE.MeshBasicMaterial{constructor(t){super(),this.depthTest=!1,this.depthWrite=!1,this.side=THREE.FrontSide,this.transparent=!0,this.setValues(t),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(t){t?(this.color.setRGB(1,230/255,3/255),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}}}class e extends THREE.LineBasicMaterial{constructor(t){super(),this.depthTest=!1,this.depthWrite=!1,this.transparent=!0,this.linewidth=1,this.setValues(t),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(t){t?(this.color.setRGB(1,230/255,3/255),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}}}var n=function(t,e,n){const i=[];n=n||1;for(var o=0;o<=64*n;++o)"x"==e&&i.push(new THREE.Vector3(0,Math.cos(o/32*Math.PI),Math.sin(o/32*Math.PI)).multiplyScalar(t)),"y"==e&&i.push(new THREE.Vector3(Math.cos(o/32*Math.PI),0,Math.sin(o/32*Math.PI)).multiplyScalar(t)),"z"==e&&i.push(new THREE.Vector3(Math.sin(o/32*Math.PI),Math.cos(o/32*Math.PI),0).multiplyScalar(t));return(new THREE.BufferGeometry).setFromPoints(i)},i=function(t,e,n,i,o,a){return new THREE.CylinderBufferGeometry(t,e,n,i,o,a).applyMatrix4((new THREE.Matrix4).makeTranslation(0,.5,0))},o=function(t){const e=[];return"X"===t?e.push(new THREE.Vector3(0,0,0),new THREE.Vector3(1,0,0)):"Y"===t?e.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1,0)):"Z"===t&&e.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,0,1)),(new THREE.BufferGeometry).setFromPoints(e)};class a extends THREE.Object3D{constructor(t){super();var e=this;this.init=function(){this.handles=new THREE.Object3D,this.pickers=new THREE.Object3D,this.planes=new THREE.Object3D,this.highlights=new THREE.Object3D,this.hemiPicker=new THREE.Object3D,this.subPickers=new THREE.Object3D,this.add(this.handles),this.add(this.pickers),this.add(this.planes),this.add(this.highlights),this.add(this.hemiPicker),this.add(this.subPickers);var t=new THREE.PlaneBufferGeometry(50,50,2,2),e=new THREE.MeshBasicMaterial({wireframe:!0});e.side=THREE.DoubleSide;var n={XY:new THREE.Mesh(t,e),YZ:new THREE.Mesh(t,e),XZ:new THREE.Mesh(t,e),XYZE:new THREE.Mesh(t,e)};for(var i in this.activePlane=n.XYZE,n.YZ.rotation.set(0,Math.PI/2,0),n.XZ.rotation.set(-Math.PI/2,0,0),n)n[i].name=i,this.planes.add(n[i]),this.planes[i]=n[i],n[i].visible=!1;this.setupGizmos(),this.activeMode="",this.traverse((function(t){if(t instanceof THREE.Mesh){t.updateMatrix();const e=t.geometry.clone();e.applyMatrix4(t.matrix),t.geometry=e,t.position.set(0,0,0),t.rotation.set(0,0,0),t.scale.set(1,1,1)}}))},this.hide=function(){this.traverse((function(t){t.visible=!1}))},this.show=function(){this.traverse((function(t){t.visible=!0,t.parent!=e.pickers&&t.parent!=e.hemiPicker||(t.visible=!1),t.parent==e.planes&&(t.visible=!1)})),this.activePlane.visible=!1},this.highlight=function(t){this.traverse((function(e){e.material&&e.material.highlight&&(e.name==t?e.material.highlight(!0):e.material.highlight(!1))}))},this.setupGizmos=function(){var e=function(t,e){for(var n in t)for(var i=t[n].length;i--;){var o=t[n][i][0],a=t[n][i][1],s=t[n][i][2],r=t[n][i][3];o.name=n,a&&o.position.set(a[0],a[1],a[2]),s&&o.rotation.set(s[0],s[1],s[2]),r&&(o.visble=r),e.add(o)}};if(this.setHandlePickerGizmos(),t)for(var n=Object.keys(this.handleGizmos),i=0;iMath.abs(e.z)&&(this.activePlane=this.planes.XZ)),"Y"==t&&(this.activePlane=this.planes.XY,!n&&Math.abs(e.x)>Math.abs(e.z)&&(this.activePlane=this.planes.YZ)),"Z"==t&&(this.activePlane=this.planes.XZ,!n&&Math.abs(e.x)>Math.abs(e.y)&&(this.activePlane=this.planes.YZ)),"XYZ"==t&&(this.activePlane=this.planes.XYZE),"XY"==t&&(this.activePlane=this.planes.XY),"YZ"==t&&(this.activePlane=this.planes.YZ),"XZ"==t&&(this.activePlane=this.planes.XZ),this.hide(),this.show()},this.init()}},THREE.TransformGizmoRotate=class extends a{constructor(i){super(i),this.setHandlePickerGizmos=function(){this.handleGizmos={RX:[[new THREE.Line(n(1,"x",.5),new e({color:16711680}))]],RY:[[new THREE.Line(n(1,"y",.5),new e({color:65280}))]],RZ:[[new THREE.Line(n(1,"z",.5),new e({color:255}))]],RE:[[new THREE.Line(n(1.25,"z",1),new e({color:65535}))]],RXYZE:[[new THREE.Line(n(1,"z",1),new e({color:16711935}))]]},this.pickerGizmos={RX:[[new THREE.Mesh(new THREE.TorusBufferGeometry(1,.12,4,12,Math.PI),new t({color:16711680,opacity:.25})),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],RY:[[new THREE.Mesh(new THREE.TorusBufferGeometry(1,.12,4,12,Math.PI),new t({color:65280,opacity:.25})),[0,0,0],[Math.PI/2,0,0]]],RZ:[[new THREE.Mesh(new THREE.TorusBufferGeometry(1,.12,4,12,Math.PI),new t({color:255,opacity:.25})),[0,0,0],[0,0,-Math.PI/2]]],RE:[[new THREE.Mesh(new THREE.TorusBufferGeometry(1.25,.12,2,24),new t({color:65535,opacity:.25}))]],RXYZE:[[new THREE.Mesh(new THREE.TorusBufferGeometry(1,.12,2,24),new t({color:16711935,opacity:.25}))]]}},this.setActivePlane=function(t){"RE"==t&&(this.activePlane=this.planes.XYZE),"RX"==t&&(this.activePlane=this.planes.YZ),"RY"==t&&(this.activePlane=this.planes.XZ),"RZ"==t&&(this.activePlane=this.planes.XY),this.hide(),this.show()},this.update=function(t,e){THREE.TransformGizmo.prototype.update.apply(this,arguments);var n=new THREE.Matrix4,i=new THREE.Euler(0,0,1),o=new THREE.Quaternion,a=new THREE.Vector3(1,0,0),s=new THREE.Vector3(0,1,0),r=new THREE.Vector3(0,0,1),c=new THREE.Quaternion,l=new THREE.Quaternion,h=new THREE.Quaternion,u=e.clone();i.copy(this.planes.XY.rotation),o.setFromEuler(i),n.makeRotationFromQuaternion(o).invert(),u.applyMatrix4(n),this.traverse((function(t){o.setFromEuler(i),"RX"==t.name&&(c.setFromAxisAngle(a,Math.atan2(-u.y,u.z)),o.multiplyQuaternions(o,c),t.quaternion.copy(o)),"RY"==t.name&&(l.setFromAxisAngle(s,Math.atan2(u.x,u.z)),o.multiplyQuaternions(o,l),t.quaternion.copy(o)),"RZ"==t.name&&(h.setFromAxisAngle(r,Math.atan2(u.y,u.x)),o.multiplyQuaternions(o,h),t.quaternion.copy(o))}))},this.init()}},THREE.TransformGizmoTranslateRotate=class extends a{constructor(e){super(e);var n=this;this.setHandlePickerGizmos=function(){var e=i(0,.05,.2,12,1,!1),n=.15;this.handleGizmos={Z:[[new THREE.Mesh(e,new t({color:16777215})),[0,0,.25],[Math.PI/2,0,0]],[new THREE.Mesh(new THREE.CylinderBufferGeometry(.015,.015,.6,4,1,!1),new t({color:16777215})),[0,0,.5],[Math.PI/2,0,0]]],RX:[[new THREE.Mesh(new THREE.TorusBufferGeometry(1,.015,12,60,.3*Math.PI),new t({color:16711680})),[0,0,0],[n*Math.PI,-Math.PI/2,0]],[new THREE.Mesh(new THREE.CylinderBufferGeometry(.05,.05,.015,60,1,!1),new t({color:16711680})),[0,0,1],[Math.PI/2,0,0]]],RY:[[new THREE.Mesh(new THREE.TorusBufferGeometry(1,.015,12,60,.3*Math.PI),new t({color:255})),[0,0,0],[Math.PI/2,0,.35*Math.PI]],[new THREE.Mesh(new THREE.CylinderBufferGeometry(.05,.05,.01,60,1,!1),new t({color:255})),[0,0,1]]]},this.pickerGizmos={Z:[[new THREE.Mesh(new THREE.CylinderBufferGeometry(.12,.12,.65,4,1,!1),new t({color:255,opacity:.25})),[0,0,.5],[Math.PI/2,0,0]]],RX:[[new THREE.Mesh(new THREE.TorusBufferGeometry(1,.12,4,12,.3*Math.PI),new t({color:16711680,opacity:.25})),[0,0,0],[n*Math.PI,-Math.PI/2,0]]],RY:[[new THREE.Mesh(new THREE.TorusBufferGeometry(1,.12,4,12,.3*Math.PI),new t({color:255,opacity:.25})),[0,0,0],[Math.PI/2,0,.35*Math.PI]]]},this.subPickerGizmos={Z:[[new THREE.Mesh(new THREE.CylinderBufferGeometry(.12,.12,.65,4,1,!1),new t({color:255,opacity:.25})),[0,0,.5],[Math.PI/2,0,0]]]},this.highlightGizmos={Z:[],RX:[[new THREE.Mesh(new THREE.TorusBufferGeometry(1,.02,12,60,2*Math.PI),new t({color:16711680,opacity:1})),[0,0,0],[0,-Math.PI/2,-Math.PI/2],!1]],RY:[[new THREE.Mesh(new THREE.TorusBufferGeometry(1,.02,12,60,2*Math.PI),new t({color:255,opacity:1})),[0,0,0],[Math.PI/2,0,0],!1]]},this.hemiPickerGizmos={XYZ:[[new THREE.Mesh(new THREE.SphereBufferGeometry(1.2,8,8,0,Math.PI),new t({color:255})),null,null,!1]]}},this.setActivePlane=function(t,e,n){if("translate"==this.activeMode){var i=new THREE.Matrix4;e.applyMatrix4(i.extractRotation(this.planes.XY.matrixWorld).invert()),"X"==t&&(this.activePlane=this.planes.XY,!n&&Math.abs(e.y)>Math.abs(e.z)&&(this.activePlane=this.planes.XZ)),"Y"==t&&(this.activePlane=this.planes.XY,!n&&Math.abs(e.x)>Math.abs(e.z)&&(this.activePlane=this.planes.YZ)),"Z"==t&&(this.activePlane=this.planes.XZ,!n&&Math.abs(e.x)>Math.abs(e.y)&&(this.activePlane=this.planes.YZ))}else"rotate"==this.activeMode&&("RX"==t&&(this.activePlane=this.planes.YZ),"RY"==t&&(this.activePlane=this.planes.XZ),"RZ"==t&&(this.activePlane=this.planes.XY));this.hide(),this.show()},this.update=function(t,e){if("translate"==this.activeMode)THREE.TransformGizmo.prototype.update.apply(this,arguments);else if("rotate"==this.activeMode){THREE.TransformGizmo.prototype.update.apply(this,arguments);var n=new THREE.Matrix4,i=new THREE.Euler(0,0,1),o=new THREE.Quaternion,a=new THREE.Vector3(1,0,0),s=new THREE.Vector3(0,1,0),r=new THREE.Vector3(0,0,1),c=new THREE.Quaternion,l=new THREE.Quaternion,h=new THREE.Quaternion,u=e.clone();i.copy(this.planes.XY.rotation),o.setFromEuler(i),n.makeRotationFromQuaternion(o).invert(),u.applyMatrix4(n),this.traverse((function(t){o.setFromEuler(i),"RX"==t.name&&(c.setFromAxisAngle(a,Math.atan2(-u.y,u.z)),o.multiplyQuaternions(o,c),t.quaternion.copy(o)),"RY"==t.name&&(l.setFromAxisAngle(s,Math.atan2(u.x,u.z)),o.multiplyQuaternions(o,l),t.quaternion.copy(o)),"RZ"==t.name&&(h.setFromAxisAngle(r,Math.atan2(u.y,u.x)),o.multiplyQuaternions(o,h),t.quaternion.copy(o))}))}},this.show=function(){this.traverse((function(t){(null==n.parent||n.parent.useAllPickers||t.parent!=n.handles)&&(t.visible=!0),t.material&&(t.material.opacity=t.material.oldOpacity),t.parent!=n.pickers&&t.parent!=n.hemiPicker&&t.parent!=n.subPickers||(t.visible=!1),t.parent!=n.planes&&t.parent!=n.highlights||(t.visible=!1)})),this.activePlane.visible=!1},this.highlight=function(t){this.traverse((function(e){e.material&&e.material.highlight&&(e.name==t?(e.parent!=n.highlights&&e.parent!=n.handles||(e.visible=!0),e.material.highlight(!0)):(e.material.highlight(!1),e.material.opacity=.1))}))},this.init()}},THREE.TransformGizmoScale=class extends a{constructor(n){super(n),this.setHandlePickerGizmos=function(){var n=i(.125,.125,.125),a=o("X"),s=o("Y"),r=o("Z");this.handleGizmos={X:[[new THREE.Mesh(n,new t({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new THREE.Line(a,new e({color:16711680}))]],Y:[[new THREE.Mesh(n,new t({color:65280})),[0,.5,0]],[new THREE.Line(s,new e({color:65280}))]],Z:[[new THREE.Mesh(n,new t({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new THREE.Line(r,new e({color:255}))]],XYZ:[[new THREE.Mesh(new THREE.BoxBufferGeometry(.125,.125,.125),new t({color:16777215,opacity:.25}))]]},this.pickerGizmos={X:[[new THREE.Mesh(new THREE.CylinderBufferGeometry(.2,0,1,4,1,!1),new t({color:16711680,opacity:.25})),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new THREE.Mesh(new THREE.CylinderBufferGeometry(.2,0,1,4,1,!1),new t({color:65280,opacity:.25})),[0,.6,0]]],Z:[[new THREE.Mesh(new THREE.CylinderBufferGeometry(.2,0,1,4,1,!1),new t({color:255,opacity:.25})),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new THREE.Mesh(new THREE.BoxBufferGeometry(.4,.4,.4),new t({color:16777215,opacity:.25}))]]}},this.setActivePlane=function(t,e,n){var i=new THREE.Matrix4;e.applyMatrix4(i.extractRotation(this.planes.XY.matrixWorld).invert()),"X"==t&&(this.activePlane=this.planes.XY,!n&&Math.abs(e.y)>Math.abs(e.z)&&(this.activePlane=this.planes.XZ)),"Y"==t&&(this.activePlane=this.planes.XY,!n&&Math.abs(e.x)>Math.abs(e.z)&&(this.activePlane=this.planes.YZ)),"Z"==t&&(this.activePlane=this.planes.XZ,!n&&Math.abs(e.x)>Math.abs(e.y)&&(this.activePlane=this.planes.YZ)),"XYZ"==t&&(this.activePlane=this.planes.XYZE),this.hide(),this.show()},this.init()}};const s=new THREE.Vector3,r=new THREE.Vector3,c=new THREE.Raycaster;class l extends THREE.Object3D{constructor(t,e,n,i){switch(super(),e=void 0!==e?e:document,this.gizmo={},n){case"translate":this.gizmo[n]=new THREE.TransformGizmoTranslate(i);break;case"rotate":this.gizmo[n]=new THREE.TransformGizmoRotate(i);break;case"transrotate":this.gizmo[n]=new THREE.TransformGizmoTranslateRotate(i);break;case"scale":this.gizmo[n]=new THREE.TransformGizmoScale(i)}if(this.add(this.gizmo[n]),this.gizmo[n].hide(),this.object=void 0,this.snap=null,this.snapDelta=0,this.space="world",this.size=1,this.axis=null,this.useAllPickers=!0,this.unitX=new THREE.Vector3(1,0,0),this.unitY=new THREE.Vector3(0,1,0),this.unitZ=new THREE.Vector3(0,0,1),this.normal=new THREE.Vector3(0,0,1),"transrotate"===n){var o,a=[new THREE.Vector3(0,0,0),new THREE.Vector3(0,0,1)],s=(new THREE.BufferGeometry).setFromPoints(a),r=new THREE.LineBasicMaterial({color:0,linewidth:2,depthTest:!1});this.startLine=new THREE.Line(s,r),a=[new THREE.Vector3(0,0,0),new THREE.Vector3(0,0,1)],s=(new THREE.BufferGeometry).setFromPoints(a),r=new THREE.LineBasicMaterial({color:16770563,linewidth:2,depthTest:!1}),this.endLine=new THREE.Line(s,r),a=[new THREE.Vector3(0,-1,0),new THREE.Vector3(0,1,0)],s=(new THREE.BufferGeometry).setFromPoints(a),r=new THREE.LineDashedMaterial({color:0,linewidth:1,depthTest:!1}),this.centerLine=new THREE.Line(s,r),(o=THREE.ImageUtils.loadTexture(Autodesk.Viewing.Private.getResourceUrl("res/textures/centerMarker_X.png"))).magFilter=o.minFilter=THREE.NearestFilter,s=new THREE.CircleBufferGeometry(.1,32),r=new THREE.MeshBasicMaterial({opacity:1,side:THREE.DoubleSide,transparent:!0,map:o}),this.centerMark=new THREE.Mesh(s,r),this.centerMark.rotation.set(Math.PI/2,0,0),this.ticks={},(o=THREE.ImageUtils.loadTexture(Autodesk.Viewing.Private.getResourceUrl("res/textures/cardinalPoint.png"))).magFilter=o.minFilter=THREE.NearestFilter,r=new THREE.MeshBasicMaterial({depthTest:!1,opacity:1,transparent:!0,side:THREE.DoubleSide,map:o});var c=.25;this.ticks.RX=new THREE.Object3D,s=new THREE.PlaneBufferGeometry(.12,c);var l=new THREE.Mesh(s,r);l.position.set(0,0,-1.275),l.rotation.set(Math.PI/2,Math.PI/2,0),this.ticks.RX.add(l),(l=l.clone()).position.set(0,1.275,0),l.rotation.set(0,Math.PI/2,0),this.ticks.RX.add(l),(l=l.clone()).position.set(0,0,1.275),l.rotation.set(0,Math.PI/2,Math.PI/2),this.ticks.RX.add(l),(l=l.clone()).position.set(0,-1.275,0),l.rotation.set(0,Math.PI/2,0),this.ticks.RX.add(l),this.ticks.RY=new THREE.Object3D,(l=l.clone()).position.set(0,0,-1.275),l.rotation.set(Math.PI/2,0,0),this.ticks.RY.add(l),(l=l.clone()).position.set(-1.275,0,0),l.rotation.set(Math.PI/2,0,Math.PI/2),this.ticks.RY.add(l),(l=l.clone()).position.set(0,0,1.275),l.rotation.set(Math.PI/2,0,0),this.ticks.RY.add(l),(l=l.clone()).position.set(1.275,0,0),l.rotation.set(Math.PI/2,0,Math.PI/2),this.ticks.RY.add(l)}var h=this,u=!1,p=n,E={type:"change"},d={type:"mouseDown"},m={type:"mouseUp",mode:p},f={type:"objectChange"},v=new THREE.Vector3,T=new THREE.Vector3,w=new THREE.Vector3,y=new THREE.Vector3,g=1;this.clientScale=1;var R=new THREE.Matrix4,x=new THREE.Vector3,M=new THREE.Matrix4,H=new THREE.Vector3,b=new THREE.Quaternion,A=new THREE.Vector3,P=new THREE.Vector3,S=new THREE.Vector3,C=new THREE.Quaternion,V=new THREE.Quaternion,B=new THREE.Quaternion,k=new THREE.Quaternion,z=new THREE.Quaternion,I=new THREE.Vector3,O=new THREE.Vector3,X=new THREE.Matrix4,Y=new THREE.Matrix4,G=new THREE.Vector3,_=new THREE.Vector3,L=new THREE.Euler,j=new THREE.Matrix4,N=new THREE.Vector3;function Z(e,n){return THREE.TransformControls.intersectObjects(e.canvasX,e.canvasY,n,t,!0)}new THREE.Euler,this.attach=function(t){h.object=t,this.gizmo[p].show(),h.update(),h.updateUnitVectors()},this.detach=function(t){h.object=void 0,this.axis=null,this.gizmo[p].hide()},this.setMode=function(t){"scale"==(p=t||p)&&(h.space="local"),this.gizmo[p].show(),this.update(),h.dispatchEvent(E)},this.getPicker=function(){return h.gizmo[p].hemiPicker.children},this.setPosition=function(t){this.object.position.copy(t),this.update()},this.setNormal=function(t){b.setFromUnitVectors(this.normal,t),this.unitX.applyQuaternion(b),this.unitY.applyQuaternion(b),this.unitZ.applyQuaternion(b),this.normal.copy(t),this.object&&this.object.quaternion.multiply(b),this.update()},this.setRotation=function(t){this.object&&(this.object.quaternion.setFromRotationMatrix(t),this.update(),this.updateUnitVectors())},this.setSnap=function(t,e){h.snap=t,h.snapDelta=e},this.setSize=function(t){h.size=t,this.update(),h.dispatchEvent(E)},this.setSpace=function(t){h.space=t,this.update(),h.dispatchEvent(E)},this.update=function(n){if(void 0!==h.object){var i;if(h.object.updateMatrixWorld(),_.setFromMatrixPosition(h.object.matrixWorld),L.setFromRotationMatrix(M.extractRotation(h.object.matrixWorld)),t.updateMatrixWorld(),N.setFromMatrixPosition(t.matrixWorld),this.position.copy(_),this.gizmoOffset&&this.position.add(this.gizmoOffset),this.updateMatrixWorld(),this.quaternion.setFromEuler(L),this.normal.set(0,0,1),this.normal.applyEuler(L),t.isPerspective){var o=this.position.distanceTo(N);i=2*Math.tan(t.fov*Math.PI/360)*o}else i=t.top-t.bottom;var a=e.getBoundingClientRect();g=100*this.clientScale*i/a.height,this.scale.set(g,g,g),n&&this.gizmo[p].highlight(h.axis)}},this.setGizmoOffset=function(t){this.gizmoOffset=t||new THREE.Vector3(0,0,0),this.update()},this.updateUnitVectors=function(){this.unitX.set(1,0,0),this.unitY.set(0,1,0),this.unitZ.set(0,0,1),this.unitX.applyEuler(L),this.unitY.applyEuler(L),this.unitZ.applyEuler(L)},this.showRotationGizmos=function(t){for(var e=this.gizmo[p].handles.children,n=0;n!t.getDoNotCut())),m=[];const f=new THREE.Matrix4;D.start(p,(function(c,p,v,T){var w=v.getFragmentList();if(w.isFragVisible(c)&&(w.getWorldBounds(c,u),e.xBoxPlane(t,u))){const n=w.getGeometry(c),i=w.getMaterial(c);n&&!n.is2d&&!n.isLines&&i.cutplanes&&(h=i,w.getWorldMatrix(c,f),e.xMeshPlane(t,{geometry:n,matrixWorld:f,fragId:c},m))}if(T){if(m.length){var y=new THREE.Box3;e.convertToPlaneCoords(a,m,y);var g=new o.VertexBufferBuilder(!1,8*m.length),R=function(t){return t&&t.color||new THREE.Color(16777215)}(h),x=0|.25*R.r*255.5,M=0|.25*R.g*255.5,H=4278190080|(0|.25*R.b*255.5)<<16|M<<8|x,b=new e.EdgeSet(m,y,1e-6*y.getSize(new THREE.Vector3).length());b.snapEdges(),b.sanitizeEdges(),b.stitchContours();var A=b.triangulate({skipOpenContour:!0});if(A){for(let t=0;t{r.invalidate(!0,!0)}))}var W="Autodesk.Viewing.Extension.Section.SectionTool";r.setCutPlaneSetFor2DRendering(W);var U=[];function Q(t){function e(e){e&&e.traverse((function(e){e instanceof THREE.Mesh&&e.material&&(t?r.matman().adjustMaterialMRTSetting(e.material):e.material.needsUpdate=!0)}))}e(r.scene.getObjectByName("section3D")),e(r.sceneAfter.getObjectByName("section2D"))}function q(t,n){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;var o,a=(new THREE.Quaternion).setFromUnitVectors(new THREE.Vector3(0,0,1),t.normal);o=new THREE.PlaneBufferGeometry(i,i);var s=new THREE.MeshBasicMaterial({opacity:0,color:C,side:THREE.DoubleSide,depthTest:!1,depthWrite:!1,transparent:!0}),c=new e(o,s,t);const l=t.projectPoint(n,new THREE.Vector3);c.position.copy(l),c.quaternion.multiply(a);var h=r.currentLightPreset();h=Math.max(0,h);var u=Autodesk.Viewing.Private.LightPresets[h].bgColorGradient,p="rgb("+(255-u[0])+","+(255-u[1])+","+(255-u[2])+")",E=new THREE.LineBasicMaterial({color:p,linewidth:1,depthTest:!1,depthWrite:!1,transparent:!0}),d=c.geometry.getAttribute("position");const m=[];for(var f=0;f0){var i=n.matrixWorld.clone().invert();const t=new THREE.Vector3;e=n.geometry.getAttribute("position");for(let a=0;a0&&void 0!==arguments[0])||arguments[0];K((function(t){t instanceof e&&t.update()})),1===R.length&&F((new THREE.Plane).setComponents(R[0].x,R[0].y,R[0].z,R[0].w)),r.setCutPlaneSet(W,R,t)}function tt(t){for(var e=0;e0&&(1===R.length&&F((new THREE.Plane).setComponents(R[0].x,R[0].y,R[0].z,R[0].w)),r.setCutPlaneSet(W,R)),tt(t)}function nt(t,e){t.attach(e),t.setPosition(e.position),t.visible=!0}function it(t){if(!a||!t)return!1;var e=function(t){var e=new THREE.Vector3,n=t.geometry;return n.computeBoundingBox(),e.x=(n.boundingBox.max.x+n.boundingBox.min.x)/2,e.y=(n.boundingBox.max.y+n.boundingBox.min.y)/2,e.z=(n.boundingBox.max.z+n.boundingBox.min.z)/2,t.localToWorld(e),e}(t).sub(t.getWorldPosition(new THREE.Vector3));return a.setGizmoOffset(e),!0}function ot(t,e){let n=function(t,e){return[new THREE.Vector3(t.min.x,t.min.y,t.min.z).applyMatrix4(e),new THREE.Vector3(t.min.x,t.min.y,t.max.z).applyMatrix4(e),new THREE.Vector3(t.min.x,t.max.y,t.min.z).applyMatrix4(e),new THREE.Vector3(t.min.x,t.max.y,t.max.z).applyMatrix4(e),new THREE.Vector3(t.max.x,t.min.y,t.min.z).applyMatrix4(e),new THREE.Vector3(t.max.x,t.min.y,t.max.z).applyMatrix4(e),new THREE.Vector3(t.max.x,t.max.y,t.min.z).applyMatrix4(e),new THREE.Vector3(t.max.x,t.max.y,t.max.z).applyMatrix4(e)]}(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:new THREE.Matrix4),i=Number.MIN_VALUE;for(let t=0;ti&&(i=o)}return i}this.setPlaneLocal=function(t){let e=t.clone().applyMatrix3(z).normalize();this.setPlane(e,void 0,!0,!0)},this.setPlane=function(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];var o=r.getVisibleBounds(),s=o.getCenter(new THREE.Vector3),c=new THREE.Group;c.applyMatrix4(B),c.updateMatrixWorld(),e||(e=this.getSectionDistance(t)),i&&function(t){return r.api.navigation.getEyeVector().dot(t)>0}(t)&&(t.negate(),e=-e),e=void 0!==e?e:-1*s.dot(t);var h=q(new THREE.Plane(t.clone().applyMatrix3(I).normalize(),e),s.clone().applyMatrix4(k),2*o.getBoundingSphere(new THREE.Sphere).radius);c.add(h),h.update(),R.push(h.planeVec),g.push(c),r.addOverlay(H,c),a&&(nt(a,h),h.material.opacity=0,it(h),a.showRotationGizmos(!0),x=a.getPicker()),$(n),l&&L()};var at,st,rt,ct,lt=(at=new THREE.Matrix3,st=new THREE.Vector3,rt=new THREE.Vector3,ct=new THREE.Vector3,function(t,e,n,i){at.set(t.normal.x,t.normal.y,t.normal.z,e.normal.x,e.normal.y,e.normal.z,n.normal.x,n.normal.y,n.normal.z);var o=at.determinant();return 0===o?null:(st.crossVectors(e.normal,n.normal).multiplyScalar(-t.constant),rt.crossVectors(n.normal,t.normal).multiplyScalar(-e.constant),ct.crossVectors(t.normal,e.normal).multiplyScalar(-n.constant),(i||new THREE.Vector3).copy(st).add(rt).add(ct).divideScalar(o))}),ht=function(t,e,n){return THREE.TransformControls.intersectObjects(t.canvasX,t.canvasY,e,r.camera,n)};function ut(){var t=r.scene.getObjectByName("section3D");t&&r.scene.remove(t);var e=r.sceneAfter.getObjectByName("section2D");e&&r.sceneAfter.remove(e)}this.isActive=function(){return l},this.getSectionDistance=function(t){var e=r.api.navigation.getEyeVector(),n=r.rayIntersect(new THREE.Ray(r.camera.position,e));return n&&n.intersectPoint&&-1*n.intersectPoint.dot(t)},this.setViewerSection=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];var e;this.clearSection(t);var n=r.getCutPlaneSet("__set_view");if(1===n.length){a.clientScale=1;var i=n[0];e=new THREE.Vector3(i.x,i.y,i.z);var o=i.w;this.setPlane(e,o,t),M="SET_VIEW_PLANE",r.setCutPlaneSet("__set_view",void 0,t)}},this.setSection=function(t){var e;this.clearSection(),a.clientScale=1;var n=r.getCutPlaneSet("__set_view");switch(1===n.length&&"BOX"!==t&&"OBJ_SET_VIEW_PLANE"!==t&&(t="SET_VIEW_PLANE"),t){case"X":e=new THREE.Vector3(1,0,0),this.setPlaneLocal(e);break;case"Y":e=new THREE.Vector3(0,1,0),this.setPlaneLocal(e);break;case"Z":e=new THREE.Vector3(0,0,1),this.setPlaneLocal(e);break;case"OBJ_SET_VIEW_PLANE":case"SET_VIEW_PLANE":var i=n[0];e=new THREE.Vector3(i.x,i.y,i.z),this.setPlane(e,i.w);break;case"OBJ_BOX":case"BOX":!function(t){var e,n,i=[new THREE.Vector3(1,0,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,0,1),new THREE.Vector3(-1,0,0),new THREE.Vector3(0,-1,0),new THREE.Vector3(0,0,-1)],o=[[[1,2],[1,5],[2,4],[4,5]],[[3,5],[0,5],[2,3],[0,2]],[[1,3],[0,1],[3,4],[0,4]],[[1,5],[1,2],[4,5],[2,4]],[[2,3],[0,2],[3,5],[0,5]],[[0,1],[3,1],[0,4],[3,4]]],c=new THREE.Group,l=r.getVisibleBounds(),h=new THREE.Box3(l.min,l.getCenter(new THREE.Vector3)),u=h.getCenter(new THREE.Vector3),p=[],E=[],d=!1;if(t&&6===t.length){for(let e=0;e0&&void 0!==arguments[0])||arguments[0];for(a&&a.detach(),s&&s.detach();R.length>0;)R.pop();for(;g.length>0;){var e=g.pop();r.removeOverlay(H,e)}D.start(null),ut(),r.setCutPlaneSet(W,null,t)},this.isPlaneOn=function(){return p},this.showPlane=function(t){tt(t)},this.attachControl=function(t){a&&s&&(t?(nt(a,g[0].children[0]),a.highlight(),"BOX"===M&&nt(s,g[0])):(a.detach(),s.detach()))},this.resetSection=function(){this.setSection(M)},this.getNames=function(){return c},this.getName=function(){return c[0]},this.register=function(){},this.deregister=function(){this.clearSection(),A&&(r.removeOverlay(H,a),a.removeEventListener("change",_),a=null,r.removeOverlay(H,s),s.removeEventListener("change",_),s.removeEventListener("change",j),s=null,r.removeOverlayScene(H),n.removeEventListener(Autodesk.Viewing.CAMERA_CHANGE_EVENT,L),n.removeEventListener(Autodesk.Viewing.ISOLATE_EVENT,N),n.removeEventListener(Autodesk.Viewing.HIDE_EVENT,N),n.removeEventListener(Autodesk.Viewing.SHOW_EVENT,N),n.removeEventListener(Autodesk.Viewing.MODEL_TRANSFORM_CHANGED_EVENT,N),n.removeEventListener(Autodesk.Viewing.FRAGMENTS_LOADED_EVENT,N),n.removeEventListener(Autodesk.Viewing.FRAGMENTS_UNLOADED_EVENT,N),n.removeEventListener(Autodesk.Viewing.SCENE_UPDATED_EVENT,Z),A=!1)},this.getPriority=function(){return 70},this.activate=function(){X(Y()),function(){if(A)return r.addOverlay(H,a),void r.addOverlay(H,s);(a=new THREE.TransformControls(r.camera,r.canvas,"transrotate")).addEventListener("change",_),a.setSnap(Math.PI/2,Math.PI/36),(s=new THREE.TransformControls(r.camera,r.canvas,"translate")).addEventListener("change",_),s.addEventListener("change",j),void 0===r.overlayScenes[H]&&r.createOverlayScene(H),r.addOverlay(H,a),r.addOverlay(H,s),n.addEventListener(Autodesk.Viewing.CAMERA_CHANGE_EVENT,L),n.addEventListener(Autodesk.Viewing.ISOLATE_EVENT,N),n.addEventListener(Autodesk.Viewing.HIDE_EVENT,N),n.addEventListener(Autodesk.Viewing.SHOW_EVENT,N),n.addEventListener(Autodesk.Viewing.MODEL_TRANSFORM_CHANGED_EVENT,N),n.addEventListener(Autodesk.Viewing.FRAGMENTS_LOADED_EVENT,N),n.addEventListener(Autodesk.Viewing.FRAGMENTS_UNLOADED_EVENT,N),n.addEventListener(Autodesk.Viewing.SCENE_UPDATED_EVENT,Z),A=!0}(),l=!0,h=!1,P=!0,R=R||[],et(!0)},this.deactivate=function(){if(l=!1,h=!1,this.keepCutPlanesOnDeactivate){r.removeOverlay(H,a),r.removeOverlay(H,s);for(let t=0;t1?.25:0,(null===(i=g[0])||void 0===i?void 0:i.children.length)>1&&t!==n.object&&it(n.object),_(),j()}return!1},this.handleDoubleClick=function(){return!1},this.handleSingleTap=function(t){return this.handleSingleClick(t,0)},this.handleDoubleTap=function(){return!1},this.handleKeyDown=function(){return!1},this.handleKeyUp=function(){return!1},this.handleWheelInput=function(){return!1},this.handleButtonDown=function(t){return h=!0,!!s.onPointerDown(t)||a.onPointerDown(t)},this.handleButtonUp=function(t){return h=!1,u&&(u=!1,this.recomputePivot()),!!s.onPointerUp(t)||a.onPointerUp(t)},this.handleMouseMove=function(t){if(h){if(s.onPointerMove(t))return u=!0,$(),a.update(),G("Canvas","Box","translate"),!0;if(a.onPointerMove(t)){if(u=!0,$(),J(),M.includes("BOX"))G("Canvas","Box","transform");else{const t=-1!=a.axis.search("R")?"rotate":"translate";G("Canvas","Plane",t)}return!0}}if(s.visible=void 0!==s.object,"touch"!==t.pointerType){var e,n=t,i=ht(n,null===(e=g[0])||void 0===e?void 0:e.children);i&&(P=!1);var o=!!(P||i||ht(n,x,!0));a.visible=o,s.visible=s.visible&&o,tt(o)}return!!s.onPointerHover(t)||a.onPointerHover(t)},this.handleGesture=function(t){switch(t.type){case"dragstart":return b="drag",this.handleButtonDown(t,0);case"dragmove":return"drag"===b&&this.handleMouseMove(t);case"dragend":return"drag"===b&&(b=null,this.handleButtonUp(t,0))}return!1},this.handleBlur=function(){return!1},this.handleResize=function(){},this.handlePressHold=function(){return!1},this.recomputePivot=function(){var t=this.getSectionBoxValues(!0);if(t){var e=t.sectionBox;r.api.navigation.setPivotPoint(new THREE.Vector3(e[0]+.5*(e[3]-e[0]),e[1]+.5*(e[4]-e[1]),e[2]+.5*(e[5]-e[2])))}},this.getSectionBoxValues=function(t){var e=g[0];if(!e)return null;var n=e.children;if(n.length<6)return null;var i=n[0].position.x,o=n[1].position.y,a=n[2].position.z,s=n[3].position.x,c=n[4].position.y,l=n[5].position.z,h={x:0,y:0,z:0};return t||(h=r.model.getData().globalOffset||h),{sectionBox:[Math.min(s,i)+h.x,Math.min(o,c)+h.y,Math.min(a,l)+h.z,Math.max(s,i)+h.x,Math.max(o,c)+h.y,Math.max(a,l)+h.z],sectionBoxTransform:(new THREE.Matrix4).identity().toArray()}},this.getSectionPlaneValues=function(t){var e=g[0];if(!e)return null;var n=e.children;if(1!==n.length)return null;var i={x:0,y:0,z:0};t||(i=r.model.getData().globalOffset||i);var o=n[0].plane,a=o.constant-THREE.Vector3.prototype.dot.call(i,o.normal);return{sectionPlane:[o.normal.x,o.normal.y,o.normal.z,a]}},this.getSectionPlaneSet=function(){return r.getCutPlaneSet(W)},this.getSectionPlanes=function(){const t=r.getCutPlaneSet("__set_view");return t.length>0?t:r.getCutPlaneSet(W)},this.notifyCutplanesChanged=function(){var t=U.length;U.length=0;for(var e=r.getCutPlaneSets(),n=0;n2&&void 0!==arguments[2])||arguments[2];if(!t||!e)return!1;const s="OBJ_SET_VIEW_PLANE",c=-1*e.dot(t),l=new THREE.Plane(t,c);M=s;const h=[new THREE.Vector4(l.normal.x,l.normal.y,l.normal.z,l.constant)];r.setCutPlaneSet("__set_view",h),this.setSection(s),null===(n=a)||void 0===n||n.showRotationGizmos(o);const u=e.clone().sub(g[0].children[0].getWorldPosition(O));return null===(i=a)||void 0===i||i.setGizmoOffset(u),!0}};var s=n(5072),r=n.n(s),c=n(7825),l=n.n(c),h=n(7659),u=n.n(h),p=n(5056),E=n.n(p),d=n(540),m=n.n(d),f=n(1113),v=n.n(f),T=n(3412),w={};w.styleTagTransform=v(),w.setAttributes=E(),w.insert=u().bind(null,"head"),w.domAPI=l(),w.insertStyleElement=m();r()(T.A,w);T.A&&T.A.locals&&T.A.locals;const y=Autodesk.Viewing.Private,g=Autodesk.Viewing.UI,R=y.analytics;var x=function(t,e){Autodesk.Viewing.Extension.call(this,t,e),this.viewer=t,this.name="section",this.modes=["x","y","z","box"],this.buttons={},this.onViewerSetView=this.onViewerSetView.bind(this),this._onCutPlanesChanged=this._onCutPlanesChanged.bind(this),this._onShowAll=this._onShowAll.bind(this)};x.prototype=Object.create(Autodesk.Viewing.Extension.prototype),x.prototype.constructor=x;var M=x.prototype;M.load=function(){var t=this,e=this.viewer;this.tool=new a(e,{tintColor:{r:1,g:1,b:0},tintIntensity:.2}),e.toolController.registerTool(this.tool,this.setActive.bind(this)),this.sectionStyle=null,this.supportedStyles=["X","Y","Z","BOX"],this.displaySectionHatches=this.displaySectionHatches.bind(this),this.viewer.prefs.addListeners(y.Prefs3D.DISPLAY_SECTION_HATCHES,this.displaySectionHatches),e.addEventListener(Autodesk.Viewing.SET_VIEW_EVENT,this.onViewerSetView),e.addEventListener(Autodesk.Viewing.CUTPLANES_CHANGE_EVENT,this._onCutPlanesChanged),e.addEventListener(Autodesk.Viewing.SHOW_ALL_EVENT,this._onShowAll),e.addEventListener(Autodesk.Viewing.RENDER_OPTION_CHANGED_EVENT,t.tool.notifyRenderOptionChanged),this.HOTKEYS_ID="Autodesk.Section.Hotkeys";var n=[{keycodes:[Autodesk.Viewing.KeyCode.ESCAPE],onRelease:function(){if(0===t.viewer.getAggregateSelection().length)return t.deactivate()}}];return e.getHotkeyManager().pushHotkeys(this.HOTKEYS_ID,n),this.viewer.registerContextMenuCallback("Autodesk.Section",((t,e)=>{!function(t,e,n){var i;if(!n.hasSelected)return;const o=t.viewer,a=o.getAggregateSelection();if(1===a.length&&a[0].model.is2d())return;const s=o.impl.selector.getSelectionBounds(),r={title:"Section",target:[]};r.target.push({title:"Section Box",target:()=>{t.setSectionBox(s),R.track("viewer.section",{from:"Contextual",type:"Box",action:"Enable"})}});const c=a.map((t=>t.selection)).flat(),l=new Array,h=o.model.getInstanceTree();if(!h)return;c.forEach((t=>{h.enumNodeChildren(t,(t=>{0===h.getChildCount(t)&&l.push(t)}),!0)}));const u=a.map((t=>t.model.id)),p=o.impl.hitTest(n.canvasX,n.canvasY,!1,l,u);if(null!=p&&null!==(i=p.face)&&void 0!==i&&i.normal&&p.model&&-1!==l.indexOf(p.dbId)){var E;const e=new THREE.Matrix4;null===(E=p.model.getFragmentList())||void 0===E||E.getWorldMatrix(p.fragId,e);const n=(new THREE.Matrix3).getNormalMatrix(e),i=p.face.normal.clone().applyMatrix3(n).normalize();r.target.push({title:"Section Plane",target:()=>{t.setSectionPlane(i,p.point,!1),R.track("viewer.section",{from:"Contextual",type:"Plane",action:"Enable"})}})}e.push(r)}(this,t,e)})),this.viewer.loadExtension("Autodesk.CompGeom")},M.unload=function(){var t=this.viewer;return t.unregisterContextMenuCallback("Autodesk.Section"),t.getHotkeyManager().popHotkeys(this.HOTKEYS_ID),this.destroyUI(),t.removeEventListener(Autodesk.Viewing.SET_VIEW_EVENT,this.onViewerSetView),t.removeEventListener(Autodesk.Viewing.CUTPLANES_CHANGE_EVENT,this._onCutPlanesChanged),t.removeEventListener(Autodesk.Viewing.SHOW_ALL_EVENT,this._onShowAll),t.removeEventListener(Autodesk.Viewing.RENDER_OPTION_CHANGED_EVENT,this.tool.notifyRenderOptionChanged),this.viewer.prefs.removeListeners(y.Prefs3D.DISPLAY_SECTION_HATCHES,this.displaySectionHatches),t.toolController.deregisterTool(this.tool),this.tool=null,!0},M.toggle=function(){if(this.isActive())this.enableSectionTool(!1);else{var t=this.sectionStyle||"X";this.setSectionStyle(t,!0)}return this.isActive()},M.getSectionStyle=function(){return this.sectionStyle},M.setSectionStyle=function(t,e){if(-1===this.supportedStyles.indexOf(t))return!1;var n=this.isActive(),i=this.sectionStyle!==t||!e;return this.sectionStyle=t,n&&i?this.tool.setSection(t):n||(this.enableSectionTool(!0),i?this.tool.setSection(t):this.tool.attachControl(!0)),!0},M.setSectionFromPlane=function(t){if(this.deactivate(),t)this.tool.setSectionFromPlane(t),this.tool.attachControl(!1),this.isActive()||this.tool.showPlane(!1);else{this.tool.clearSection();var e=this.viewer.toolController.setIsLocked(!1);this.enableSectionTool(!1),this.viewer.toolController.setIsLocked(e)}},M.getSectionPlanes=function(){return this.tool.getSectionPlanes()},M.enableSectionTool=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var n=this.viewer.toolController,i=this.tool.isActive();if(t&&!i)return n.activateTool("section"),this.sectionToolButton&&this.sectionToolButton.setState(Autodesk.Viewing.UI.Button.State.ACTIVE),!0;if(!t&&i){const t=this.tool.keepCutPlanesOnDeactivate;return this.tool.keepCutPlanesOnDeactivate=e,n.deactivateTool("section"),this.tool.keepCutPlanesOnDeactivate=t,this.sectionToolButton&&this.sectionToolButton.setState(Autodesk.Viewing.UI.Button.State.INACTIVE),!0}return t&&n.activateToolModality("section"),!1},M.getViewValues=function(t){var e=this.tool.getSectionBoxValues(t);if(e)return e;var n=this.tool.getSectionPlaneValues(t);return n||null},M.getState=function(t){const e=this.viewer.getFirstModel();if(e&&!e.is2d()){t.cutplanes=t.cutplanes||[];for(var n=this.tool.getSectionPlaneSet(),i=0;i=n&&e>=i?"x":n>e&&n>=i?"y":"z"},M.onViewerSetView=function(){this.deactivate()},M.onToolbarCreated=function(t){this.sectionToolButton=new g.ComboButton("toolbar-sectionTool"),this.sectionToolButton.setToolTip("Section analysis"),this.sectionToolButton.setIcon("adsk-icon-section-analysis"),this.createSubmenu(this.sectionToolButton);var e=t.getControl(Autodesk.Viewing.TOOLBAR.MODELTOOLSID);if(e){var n=e.getControl("toolbar-resetTool");n?e.addControl(this.sectionToolButton,{index:e.indexOf(n.getId())}):e.addControl(this.sectionToolButton,{index:0})}},M.createSubmenu=function(t){var e=this,n=this.viewer;function i(t,n){return e.buttons[n]=t,function(){var i=t.getState(),o=function(){t instanceof g.ComboButton==!1?e.activate(n):(e.enableSectionTool(!0),e.tool.attachControl(!0))};const a=-1!==n.toLowerCase().indexOf("box")?"Box":"Plane";i===g.Button.State.INACTIVE?(t.setState(g.Button.State.ACTIVE),Autodesk.Viewing.isMobileDevice()?setTimeout(o,1):o(),R.track("viewer.section",{from:"Toolbar",type:a,action:"Enable"})):i===g.Button.State.ACTIVE&&(t.setState(g.Button.State.INACTIVE),e.deactivate(),R.track("viewer.section",{from:"Toolbar",type:a,action:"Disable"})),e.sectionStyle=n.toUpperCase()}}function o(){var t,i=(t=new THREE.Vector3,function(e,n,i){return t.subVectors(e,n),t.lengthSq(){this.tool.updateCapMeshes((new THREE.Plane).setComponents(t.x,t.y,t.z,t.w))}))}},Autodesk.Viewing.theExtensionManager.registerExtension("Autodesk.Section",x)})(),Autodesk.Extensions.Section=i})(); //# sourceMappingURL=Section.min.js.map