!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["Viewing.Extension.Transform"]=e():t["Viewing.Extension.Transform"]=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i=n(14),o=r(i),a=n(11),s=r(a),c=n(12),u=r(c),l=n(17),h=r(l),f=n(16),p=r(f),d=n(213),v=r(d),y=n(212),m=r(y),E=n(104),g=r(E),w=n(102),x=r(w),T=function(t){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,s.default)(this,e);var r=(0,h.default)(this,(e.__proto__||(0,o.default)(e)).call(this,t,n));return r.translateTool=new v.default(t),r._viewer.toolController.registerTool(r.translateTool),r.rotateTool=new m.default(t),r._viewer.toolController.registerTool(r.rotateTool),r}return(0,p.default)(e,t),(0,u.default)(e,[{key:"load",value:function(){var t=this;if(this._txControl=x.default.createButton("toolbar-translate","fa fa-arrows-alt","Translate Tool",function(){var e=t.translateTool.getName(),n=t.rotateTool.getName();t.translateTool.active?(t._viewer.toolController.deactivateTool(e),t._txControl.container.classList.remove("active"),t._comboCtrl.container.classList.remove("active")):(t._viewer.toolController.activateTool(e),t._txControl.container.classList.add("active"),t._viewer.toolController.deactivateTool(n),t._rxControl.container.classList.remove("active"),t._comboCtrl.container.classList.add("active"))}),this._rxControl=x.default.createButton("toolbar-rotate","fa fa-refresh","Rotate Tool",function(){var e=t.translateTool.getName(),n=t.rotateTool.getName();t.rotateTool.active?(t._viewer.toolController.deactivateTool(n),t._rxControl.container.classList.remove("active"),t._comboCtrl.container.classList.remove("active")):(t._viewer.toolController.activateTool(n),t._rxControl.container.classList.add("active"),t._viewer.toolController.deactivateTool(e),t._txControl.container.classList.remove("active"),t._comboCtrl.container.classList.add("active"))}),this.parentControl=this._options.parentControl,!this.parentControl){var e=this._viewer.getToolbar(!0);this.parentControl=new Autodesk.Viewing.UI.ControlGroup("transform"),e.addControl(this.parentControl)}this._comboCtrl=new Autodesk.Viewing.UI.ComboButton("transform-combo"),this._comboCtrl.setToolTip("Transform Tools"),this._comboCtrl.icon.style.fontSize="24px",this._comboCtrl.icon.style.transform="rotateY(180Deg)",this._comboCtrl.icon.className="glyphicon glyphicon-wrench",this._comboCtrl.addControl(this._txControl),this._comboCtrl.addControl(this._rxControl);var n=this._comboCtrl.onClick;return this._comboCtrl.onClick=function(e){if(t._comboCtrl.container.classList.contains("active")){t._txControl.container.classList.remove("active"),t._rxControl.container.classList.remove("active"),t._comboCtrl.container.classList.remove("active");var r=t.translateTool.getName(),i=t.rotateTool.getName();t._viewer.toolController.deactivateTool(r),t._viewer.toolController.deactivateTool(i)}else n()},this.parentControl.addControl(this._comboCtrl),console.log("Viewing.Extension.Transform loaded"),!0}},{key:"unload",value:function(){this.parentControl.removeControl(this._comboCtrl),this._viewer.toolController.deactivateTool(this.translateTool.getName()),this._viewer.toolController.deactivateTool(this.rotateTool.getName()),console.log("Viewing.Extension.Transform unloaded")}}],[{key:"ExtensionId",get:function(){return"Viewing.Extension.Transform"}}]),e}(g.default);Autodesk.Viewing.theExtensionManager.registerExtension(T.ExtensionId,T)},function(t,e){var n=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(34)("wks"),i=n(23),o=n(2).Symbol,a="function"==typeof o,s=t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))};s.store=r},function(t,e,n){var r=n(7),i=n(46),o=n(36),a=Object.defineProperty;e.f=n(6)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(2),i=n(1),o=n(18),a=n(10),s="prototype",c=function(t,e,n){var u,l,h,f=t&c.F,p=t&c.G,d=t&c.S,v=t&c.P,y=t&c.B,m=t&c.W,E=p?i:i[e]||(i[e]={}),g=E[s],w=p?r:d?r[e]:(r[e]||{})[s];p&&(n=e);for(u in n)l=!f&&w&&void 0!==w[u],l&&u in E||(h=l?w[u]:n[u],E[u]=p&&"function"!=typeof w[u]?n[u]:y&&l?o(h,r):m&&w[u]==h?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e[s]=t[s],e}(h):v&&"function"==typeof h?o(Function.call,h):h,v&&((E.virtual||(E.virtual={}))[u]=h,t&c.R&&g&&!g[u]&&a(g,u,h)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e,n){t.exports=!n(15)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(13);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var r=n(49),i=n(32);t.exports=function(t){return r(i(t))}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(4),i=n(20);t.exports=n(6)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=n(80),o=r(i);e.default=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,o.default)(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}()},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){t.exports={default:n(85),__esModule:!0}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=n(81),o=r(i),a=n(57),s=r(a),c=n(37),u=r(c);e.default=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof e?"undefined":(0,u.default)(e)));t.prototype=(0,s.default)(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(o.default?(0,o.default)(t,e):t.__proto__=e)}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=n(37),o=r(i);e.default=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==("undefined"==typeof e?"undefined":(0,o.default)(e))&&"function"!=typeof e?t:e}},function(t,e,n){var r=n(38);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var r=n(47),i=n(31);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){t.exports={}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){var r=n(4).f,i=n(9),o=n(3)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e){t.exports=!0},,function(t,e,n){var r=n(32);t.exports=function(t){return Object(r(t))}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var r=n(34)("keys"),i=n(23);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on  "+t);return t}},function(t,e,n){var r=n(7),i=n(63),o=n(31),a=n(29)("IE_PROTO"),s=function(){},c="prototype",u=function(){var t,e=n(35)("iframe"),r=o.length,i="<",a=">";for(e.style.display="none",n(48).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(i+"script"+a+"document.F=Object"+i+"/script"+a),t.close(),u=t.F;r--;)delete u[c][o[r]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(s[c]=r(t),n=new s,s[c]=null,n[a]=t):n=u(),void 0===e?n:i(n,e)}},function(t,e,n){var r=n(2),i="__core-js_shared__",o=r[i]||(r[i]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e,n){var r=n(13),i=n(2).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,n){var r=n(13);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=n(83),o=r(i),a=n(82),s=r(a),c="function"==typeof s.default&&"symbol"==typeof o.default?function(t){return typeof t}:function(t){return t&&"function"==typeof s.default&&t.constructor===s.default&&t!==s.default.prototype?"symbol":typeof t};e.default="function"==typeof s.default&&"symbol"===c(o.default)?function(t){return"undefined"==typeof t?"undefined":c(t)}:function(t){return t&&"function"==typeof s.default&&t.constructor===s.default&&t!==s.default.prototype?"symbol":"undefined"==typeof t?"undefined":c(t)}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var r=n(2),i=n(1),o=n(25),a=n(40),s=n(4).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:a.f(t)})}},function(t,e,n){e.f=n(3)},function(t,e,n){var r=n(30),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(101),o=r(i);o.default.Composer=i.EventsEmitterComposer,e.default=o.default},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){"use strict";var r=n(78)(!0);n(50)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){var r=n(28),i=n(20),o=n(8),a=n(36),s=n(9),c=n(46),u=Object.getOwnPropertyDescriptor;e.f=n(6)?u:function(t,e){if(t=o(t),e=a(e,!0),c)try{return u(t,e)}catch(t){}if(s(t,e))return i(!r.f.call(t,e),t[e])}},function(t,e,n){t.exports=!n(6)&&!n(15)(function(){return 7!=Object.defineProperty(n(35)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(9),i=n(8),o=n(62)(!1),a=n(29)("IE_PROTO");t.exports=function(t,e){var n,s=i(t),c=0,u=[];for(n in s)n!=a&&r(s,n)&&u.push(n);for(;e.length>c;)r(s,n=e[c++])&&(~o(u,n)||u.push(n));return u}},function(t,e,n){t.exports=n(2).document&&document.documentElement},function(t,e,n){var r=n(22);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){"use strict";var r=n(25),i=n(5),o=n(52),a=n(10),s=n(9),c=n(21),u=n(76),l=n(24),h=n(51),f=n(3)("iterator"),p=!([].keys&&"next"in[].keys()),d="@@iterator",v="keys",y="values",m=function(){return this};t.exports=function(t,e,n,E,g,w,x){u(n,e,E);var T,R,M,b=function(t){if(!p&&t in z)return z[t];switch(t){case v:return function(){return new n(this,t)};case y:return function(){return new n(this,t)}}return function(){return new n(this,t)}},_=e+" Iterator",H=g==y,P=!1,z=t.prototype,k=z[f]||z[d]||g&&z[g],C=k||b(g),G=g?H?b("entries"):C:void 0,A="Array"==e?z.entries||k:k;if(A&&(M=h(A.call(new t)),M!==Object.prototype&&(l(M,_,!0),r||s(M,f)||a(M,f,m))),H&&k&&k.name!==y&&(P=!0,C=function(){return k.call(this)}),r&&!x||!p&&!P&&z[f]||a(z,f,C),c[e]=C,c[_]=m,g)if(T={values:H?C:b(y),keys:w?C:b(v),entries:G},x)for(R in T)R in z||o(z,R,T[R]);else i(i.P+i.F*(p||P),e,T);return T}},function(t,e,n){var r=n(9),i=n(27),o=n(29)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},function(t,e,n){t.exports=n(10)},function(t,e,n){var r=n(47),i=n(31).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},function(t,e,n){n(79);for(var r=n(2),i=n(10),o=n(21),a=n(3)("toStringTag"),s=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],c=0;c<5;c++){var u=s[c],l=r[u],h=l&&l.prototype;h&&!h[a]&&i(h,a,u),o[u]=o.Array}},,,function(t,e,n){t.exports={default:n(61),__esModule:!0}},function(t,e){},function(t,e,n){t.exports={default:n(107),__esModule:!0}},function(t,e,n){var r=n(5),i=n(1),o=n(15);t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],a={};a[t]=e(n),r(r.S+r.F*o(function(){n(1)}),"Object",a)}},function(t,e,n){n(66);var r=n(1).Object;t.exports=function(t,e){return r.create(t,e)}},function(t,e,n){var r=n(8),i=n(41),o=n(64);t.exports=function(t){return function(e,n,a){var s,c=r(e),u=i(c.length),l=o(a,u);if(t&&n!=n){for(;u>l;)if(s=c[l++],s!=s)return!0}else for(;u>l;l++)if((t||l in c)&&c[l]===n)return t||l||0;return!t&&-1}}},function(t,e,n){var r=n(4),i=n(7),o=n(19);t.exports=n(6)?Object.defineProperties:function(t,e){i(t);for(var n,a=o(e),s=a.length,c=0;s>c;)r.f(t,n=a[c++],e[n]);return t}},function(t,e,n){var r=n(30),i=Math.max,o=Math.min;t.exports=function(t,e){return t=r(t),t<0?i(t+e,0):o(t,e)}},function(t,e,n){var r=n(67),i=n(3)("iterator"),o=n(21);t.exports=n(1).getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,e,n){var r=n(5);r(r.S,"Object",{create:n(33)})},function(t,e,n){var r=n(22),i=n(3)("toStringTag"),o="Arguments"==r(function(){return arguments}()),a=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=a(e=Object(t),i))?n:o?r(e):"Object"==(s=r(e))&&"function"==typeof e.callee?"Arguments":s}},function(t,e,n){var r,i,o,a=n(18),s=n(110),c=n(48),u=n(35),l=n(2),h=l.process,f=l.setImmediate,p=l.clearImmediate,d=l.MessageChannel,v=0,y={},m="onreadystatechange",E=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},g=function(t){E.call(t.data)};f&&p||(f=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return y[++v]=function(){s("function"==typeof t?t:Function(t),e)},r(v),v},p=function(t){delete y[t]},"process"==n(22)(h)?r=function(t){h.nextTick(a(E,t,1))}:d?(i=new d,o=i.port2,i.port1.onmessage=g,r=a(o.postMessage,o,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(t){l.postMessage(t+"","*")},l.addEventListener("message",g,!1)):r=m in u("script")?function(t){c.appendChild(u("script"))[m]=function(){c.removeChild(this),E.call(t)}}:function(t){setTimeout(a(E,t,1),0)}),t.exports={set:f,clear:p}},function(t,e,n){var r=n(21),i=n(3)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},function(t,e,n){var r=n(7);t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&r(o.call(t)),e}}},function(t,e,n){var r=n(3)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},t(o)}catch(t){}return n}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=n(59),o=r(i);e.default=function(t){return function(){var e=t.apply(this,arguments);return new o.default(function(t,n){function r(i,a){try{var s=e[i](a),c=s.value}catch(t){return void n(t)}return s.done?void t(c):o.default.resolve(c).then(function(t){r("next",t)},function(t){r("throw",t)})}return r("next")})}}},function(t,e,n){t.exports=n(118)},function(t,e,n){t.exports={default:n(106),__esModule:!0}},function(t,e){t.exports=function(){}},function(t,e,n){"use strict";var r=n(33),i=n(20),o=n(24),a={};n(10)(a,n(3)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(a,{next:i(1,n)}),o(t,e+" Iterator")}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){var r=n(30),i=n(32);t.exports=function(t){return function(e,n){var o,a,s=String(i(e)),c=r(n),u=s.length;return c<0||c>=u?t?"":void 0:(o=s.charCodeAt(c),o<55296||o>56319||c+1===u||(a=s.charCodeAt(c+1))<56320||a>57343?t?s.charAt(c):o:t?s.slice(c,c+2):(o-55296<<10)+(a-56320)+65536)}}},function(t,e,n){"use strict";var r=n(75),i=n(77),o=n(21),a=n(8);t.exports=n(50)(Array,"Array",function(t,e){this._t=a(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):"keys"==e?i(0,n):"values"==e?i(0,t[n]):i(0,[n,t[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e,n){t.exports={default:n(84),__esModule:!0}},function(t,e,n){t.exports={default:n(86),__esModule:!0}},function(t,e,n){t.exports={default:n(87),__esModule:!0}},function(t,e,n){t.exports={default:n(88),__esModule:!0}},function(t,e,n){n(95);var r=n(1).Object;t.exports=function(t,e,n){return r.defineProperty(t,e,n)}},function(t,e,n){n(96),t.exports=n(1).Object.getPrototypeOf},function(t,e,n){n(97),t.exports=n(1).Object.setPrototypeOf},function(t,e,n){n(98),n(58),n(99),n(100),t.exports=n(1).Symbol},function(t,e,n){n(44),n(54),t.exports=n(40).f("iterator")},function(t,e,n){var r=n(19),i=n(43),o=n(28);t.exports=function(t){var e=r(t),n=i.f;if(n)for(var a,s=n(t),c=o.f,u=0;s.length>u;)c.call(t,a=s[u++])&&e.push(a);return e}},function(t,e,n){var r=n(22);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){var r=n(19),i=n(8);t.exports=function(t,e){for(var n,o=i(t),a=r(o),s=a.length,c=0;s>c;)if(o[n=a[c++]]===e)return n}},function(t,e,n){var r=n(23)("meta"),i=n(13),o=n(9),a=n(4).f,s=0,c=Object.isExtensible||function(){return!0},u=!n(15)(function(){return c(Object.preventExtensions({}))}),l=function(t){a(t,r,{value:{i:"O"+ ++s,w:{}}})},h=function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!c(t))return"F";if(!e)return"E";l(t)}return t[r].i},f=function(t,e){if(!o(t,r)){if(!c(t))return!0;if(!e)return!1;l(t)}return t[r].w},p=function(t){return u&&d.NEED&&c(t)&&!o(t,r)&&l(t),t},d=t.exports={KEY:r,NEED:!1,fastKey:h,getWeak:f,onFreeze:p}},function(t,e,n){var r=n(8),i=n(53).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(t){try{return i(t)}catch(t){return a.slice()}};t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?s(t):i(r(t))}},function(t,e,n){var r=n(13),i=n(7),o=function(t,e){if(i(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{r=n(18)(Function.call,n(45).f(Object.prototype,"__proto__").set,2),r(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return o(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:o}},function(t,e,n){var r=n(5);r(r.S+r.F*!n(6),"Object",{defineProperty:n(4).f})},function(t,e,n){var r=n(27),i=n(51);n(60)("getPrototypeOf",function(){return function(t){return i(r(t))}})},function(t,e,n){var r=n(5);r(r.S,"Object",{setPrototypeOf:n(94).set})},function(t,e,n){"use strict";var r=n(2),i=n(9),o=n(6),a=n(5),s=n(52),c=n(92).KEY,u=n(15),l=n(34),h=n(24),f=n(23),p=n(3),d=n(40),v=n(39),y=n(91),m=n(89),E=n(90),g=n(7),w=n(8),x=n(36),T=n(20),R=n(33),M=n(93),b=n(45),_=n(4),H=n(19),P=b.f,z=_.f,k=M.f,C=r.Symbol,G=r.JSON,A=G&&G.stringify,I="prototype",j=p("_hidden"),O=p("toPrimitive"),S={}.propertyIsEnumerable,V=l("symbol-registry"),L=l("symbols"),Y=l("op-symbols"),F=Object[I],X="function"==typeof C,N=r.QObject,Z=!N||!N[I]||!N[I].findChild,D=o&&u(function(){return 7!=R(z({},"a",{get:function(){return z(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=P(F,e);r&&delete F[e],z(t,e,n),r&&t!==F&&z(F,e,r)}:z,B=function(t){var e=L[t]=R(C[I]);return e._k=t,e},U=X&&"symbol"==typeof C.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof C},W=function(t,e,n){return t===F&&W(Y,e,n),g(t),e=x(e,!0),g(n),i(L,e)?(n.enumerable?(i(t,j)&&t[j][e]&&(t[j][e]=!1),n=R(n,{enumerable:T(0,!1)})):(i(t,j)||z(t,j,T(1,{})),t[j][e]=!0),D(t,e,n)):z(t,e,n)},Q=function(t,e){g(t);for(var n,r=m(e=w(e)),i=0,o=r.length;o>i;)W(t,n=r[i++],e[n]);return t},q=function(t,e){return void 0===e?R(t):Q(R(t),e)},K=function(t){var e=S.call(this,t=x(t,!0));return!(this===F&&i(L,t)&&!i(Y,t))&&(!(e||!i(this,t)||!i(L,t)||i(this,j)&&this[j][t])||e)},J=function(t,e){if(t=w(t),e=x(e,!0),t!==F||!i(L,e)||i(Y,e)){var n=P(t,e);return!n||!i(L,e)||i(t,j)&&t[j][e]||(n.enumerable=!0),n}},$=function(t){for(var e,n=k(w(t)),r=[],o=0;n.length>o;)i(L,e=n[o++])||e==j||e==c||r.push(e);return r},tt=function(t){for(var e,n=t===F,r=k(n?Y:w(t)),o=[],a=0;r.length>a;)!i(L,e=r[a++])||n&&!i(F,e)||o.push(L[e]);return o};X||(C=function(){if(this instanceof C)throw TypeError("Symbol is not a constructor!");var t=f(arguments.length>0?arguments[0]:void 0),e=function(n){this===F&&e.call(Y,n),i(this,j)&&i(this[j],t)&&(this[j][t]=!1),D(this,t,T(1,n))};return o&&Z&&D(F,t,{configurable:!0,set:e}),B(t)},s(C[I],"toString",function(){return this._k}),b.f=J,_.f=W,n(53).f=M.f=$,n(28).f=K,n(43).f=tt,o&&!n(25)&&s(F,"propertyIsEnumerable",K,!0),d.f=function(t){return B(p(t))}),a(a.G+a.W+a.F*!X,{Symbol:C});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),nt=0;et.length>nt;)p(et[nt++]);for(var et=H(p.store),nt=0;et.length>nt;)v(et[nt++]);a(a.S+a.F*!X,"Symbol",{for:function(t){return i(V,t+="")?V[t]:V[t]=C(t)},keyFor:function(t){if(U(t))return y(V,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){Z=!0},useSimple:function(){Z=!1}}),a(a.S+a.F*!X,"Object",{create:q,defineProperty:W,defineProperties:Q,getOwnPropertyDescriptor:J,getOwnPropertyNames:$,getOwnPropertySymbols:tt}),G&&a(a.S+a.F*(!X||u(function(){var t=C();return"[null]"!=A([t])||"{}"!=A({a:t})||"{}"!=A(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!U(t)){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);return e=r[1],"function"==typeof e&&(n=e),!n&&E(e)||(e=function(t,e){if(n&&(e=n.call(this,t,e)),!U(e))return e}),r[1]=e,A.apply(G,r)}}}),C[I][O]||n(10)(C[I],O,C[I].valueOf),h(C,"Symbol"),h(Math,"Math",!0),h(r.JSON,"JSON",!0)},function(t,e,n){n(39)("asyncIterator")},function(t,e,n){n(39)("observable")},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.EventsEmitterComposer=void 0;var i=n(14),o=r(i),a=n(17),s=r(a),c=n(16),u=r(c),l=n(11),h=r(l),f=n(12),p=r(f),d=function(){function t(){(0,h.default)(this,t),this._events={}}return(0,p.default)(t,[{key:"on",value:function(t,e){var n=this;return t.split(" ").forEach(function(t){n._events[t]=n._events[t]||[],n._events[t].push(e)}),this}},{key:"off",value:function(t,e){var n=this;return void 0==t?void(this._events={}):(t.split(" ").forEach(function(t){t in n._events!=!1&&(e?n._events[t].splice(n._events[t].indexOf(e),1):n._events[t]=[])}),this)}},{key:"emit",value:function(t){if(void 0!==this._events[t])for(var e=this._events[t].slice(),n=0;n<e.length;++n){var r=e[n].apply(this,Array.prototype.slice.call(arguments,1));if(void 0!==r)return r}}},{key:"guid",value:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"xxxxxxxxxxxx",n=(new Date).getTime(),t=e.replace(/[xy]/g,function(t){var e=(n+16*Math.random())%16|0;return n=Math.floor(n/16),("x"==t?e:7&e|8).toString(16)});return t}}]),t}();e.default=d;e.EventsEmitterComposer=function(t){return function(t){function e(t,n,r,i,a){(0,h.default)(this,e);var c=(0,s.default)(this,(e.__proto__||(0,o.default)(e)).call(this,t,n,r,i,a));return c._events={},c}return(0,u.default)(e,t),(0,p.default)(e,[{key:"on",value:function(t,e){var n=this;return t.split(" ").forEach(function(t){n._events[t]=n._events[t]||[],n._events[t].push(e)}),this}},{key:"off",value:function(t,e){var n=this;return void 0==t?void(this._events={}):(t.split(" ").forEach(function(t){t in n._events!=!1&&(e?n._events[t].splice(n._events[t].indexOf(e),1):n._events[t]=[])}),this)}},{key:"emit",value:function(t){if(void 0!==this._events[t])for(var e=this._events[t].slice(),n=0;n<e.length;++n){var r=e[n].apply(this,Array.prototype.slice.call(arguments,1));if(void 0!==r)return r}}},{key:"guid",value:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"xxxxxxxxxxxx",n=(new Date).getTime(),t=e.replace(/[xy]/g,function(t){var e=(n+16*Math.random())%16|0;return n=Math.floor(n/16),("x"==t?e:7&e|8).toString(16)});return t}}]),e}(t)}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(120),o=r(i);e.default=o.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(14),o=r(i),a=n(11),s=r(a),c=n(12),u=r(c),l=n(17),h=r(l),f=n(16),p=r(f),d=n(42),v=r(d),y=function(t){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,s.default)(this,e);var r=(0,h.default)(this,(e.__proto__||(0,o.default)(e)).call(this,t,n));return r._viewer=t,r._options=n,r._events={},r}return(0,p.default)(e,t),(0,u.default)(e,[{key:"load",value:function(){return!0}},{key:"unload",value:function(){return!0}}],[{key:"guid",value:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"xxxxxxxxxx",n=(new Date).getTime(),t=e.replace(/[xy]/g,function(t){var e=(n+16*Math.random())%16|0;return n=Math.floor(n/16),("x"==t?e:7&e|8).toString(16)});return t}},{key:"ExtensionId",get:function(){return"Viewing.Extension.Base"}}]),e}(v.default.Composer(Autodesk.Viewing.Extension));e.default=y},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(103),o=r(i);e.default=o.default},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(t){if(l===setTimeout)return setTimeout(t,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function o(t){if(h===clearTimeout)return clearTimeout(t);if((h===r||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(t);try{return h(t)}catch(e){try{return h.call(null,t)}catch(e){return h.call(this,t)}}}function a(){v&&p&&(v=!1,p.length?d=p.concat(d):y=-1,d.length&&s())}function s(){if(!v){var t=i(a);v=!0;for(var e=d.length;e;){for(p=d,d=[];++y<e;)p&&p[y].run();y=-1,e=d.length}p=null,v=!1,o(t)}}function c(t,e){this.fun=t,this.array=e}function u(){}var l,h,f=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(t){l=n}try{h="function"==typeof clearTimeout?clearTimeout:r}catch(t){h=r}}();var p,d=[],v=!1,y=-1;f.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];d.push(new c(t,e)),1!==d.length||v||i(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=u,f.addListener=u,f.once=u,f.off=u,f.removeListener=u,f.removeAllListeners=u,f.emit=u,f.binding=function(t){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(t){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(t,e,n){n(116),t.exports=n(1).Object.assign},function(t,e,n){n(58),n(44),n(54),n(117),t.exports=n(1).Promise},function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var r=n(18),i=n(70),o=n(69),a=n(7),s=n(41),c=n(65),u={},l={},e=t.exports=function(t,e,n,h,f){var p,d,v,y,m=f?function(){return t}:c(t),E=r(n,h,e?2:1),g=0;if("function"!=typeof m)throw TypeError(t+" is not iterable!");if(o(m)){for(p=s(t.length);p>g;g++)if(y=e?E(a(d=t[g])[0],d[1]):E(t[g]),y===u||y===l)return y}else for(v=m.call(t);!(d=v.next()).done;)if(y=i(v,E,d.value,e),y===u||y===l)return y};e.BREAK=u,e.RETURN=l},function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var r=n(2),i=n(68).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,c="process"==n(22)(a);t.exports=function(){var t,e,n,u=function(){var r,i;for(c&&(r=a.domain)&&r.exit();t;){i=t.fn,t=t.next;try{i()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(c)n=function(){a.nextTick(u)};else if(o){var l=!0,h=document.createTextNode("");new o(u).observe(h,{characterData:!0}),n=function(){h.data=l=!l}}else if(s&&s.resolve){var f=s.resolve();n=function(){f.then(u)}}else n=function(){i.call(r,u)};return function(r){var i={fn:r,next:void 0};e&&(e.next=i),t||(t=i,n()),e=i}}},function(t,e,n){"use strict";var r=n(19),i=n(43),o=n(28),a=n(27),s=n(49),c=Object.assign;t.exports=!c||n(15)(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=c({},t)[n]||Object.keys(c({},e)).join("")!=r})?function(t,e){for(var n=a(t),c=arguments.length,u=1,l=i.f,h=o.f;c>u;)for(var f,p=s(arguments[u++]),d=l?r(p).concat(l(p)):r(p),v=d.length,y=0;v>y;)h.call(p,f=d[y++])&&(n[f]=p[f]);return n}:c},function(t,e,n){var r=n(10);t.exports=function(t,e,n){for(var i in e)n&&t[i]?t[i]=e[i]:r(t,i,e[i]);return t}},function(t,e,n){"use strict";var r=n(2),i=n(1),o=n(4),a=n(6),s=n(3)("species");t.exports=function(t){var e="function"==typeof i[t]?i[t]:r[t];a&&e&&!e[s]&&o.f(e,s,{configurable:!0,get:function(){return this}})}},function(t,e,n){var r=n(7),i=n(38),o=n(3)("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||void 0==(n=r(a)[o])?e:i(n)}},function(t,e,n){var r=n(5);r(r.S+r.F,"Object",{assign:n(112)})},function(t,e,n){"use strict";var r,i,o,a=n(25),s=n(2),c=n(18),u=n(67),l=n(5),h=n(13),f=n(38),p=n(108),d=n(109),v=n(115),y=n(68).set,m=n(111)(),E="Promise",g=s.TypeError,w=s.process,x=s[E],w=s.process,T="process"==u(w),R=function(){},M=!!function(){try{var t=x.resolve(1),e=(t.constructor={})[n(3)("species")]=function(t){t(R,R)};return(T||"function"==typeof PromiseRejectionEvent)&&t.then(R)instanceof e}catch(t){}}(),b=function(t,e){return t===e||t===x&&e===o},_=function(t){var e;return!(!h(t)||"function"!=typeof(e=t.then))&&e;
},H=function(t){return b(x,t)?new P(t):new i(t)},P=i=function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw g("Bad Promise constructor");e=t,n=r}),this.resolve=f(e),this.reject=f(n)},z=function(t){try{t()}catch(t){return{error:t}}},k=function(t,e){if(!t._n){t._n=!0;var n=t._c;m(function(){for(var r=t._v,i=1==t._s,o=0,a=function(e){var n,o,a=i?e.ok:e.fail,s=e.resolve,c=e.reject,u=e.domain;try{a?(i||(2==t._h&&A(t),t._h=1),a===!0?n=r:(u&&u.enter(),n=a(r),u&&u.exit()),n===e.promise?c(g("Promise-chain cycle")):(o=_(n))?o.call(n,s,c):s(n)):c(r)}catch(t){c(t)}};n.length>o;)a(n[o++]);t._c=[],t._n=!1,e&&!t._h&&C(t)})}},C=function(t){y.call(s,function(){var e,n,r,i=t._v;if(G(t)&&(e=z(function(){T?w.emit("unhandledRejection",i,t):(n=s.onunhandledrejection)?n({promise:t,reason:i}):(r=s.console)&&r.error&&r.error("Unhandled promise rejection",i)}),t._h=T||G(t)?2:1),t._a=void 0,e)throw e.error})},G=function(t){if(1==t._h)return!1;for(var e,n=t._a||t._c,r=0;n.length>r;)if(e=n[r++],e.fail||!G(e.promise))return!1;return!0},A=function(t){y.call(s,function(){var e;T?w.emit("rejectionHandled",t):(e=s.onrejectionhandled)&&e({promise:t,reason:t._v})})},I=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),k(e,!0))},j=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw g("Promise can't be resolved itself");(e=_(t))?m(function(){var r={_w:n,_d:!1};try{e.call(t,c(j,r,1),c(I,r,1))}catch(t){I.call(r,t)}}):(n._v=t,n._s=1,k(n,!1))}catch(t){I.call({_w:n,_d:!1},t)}}};M||(x=function(t){p(this,x,E,"_h"),f(t),r.call(this);try{t(c(j,this,1),c(I,this,1))}catch(t){I.call(this,t)}},r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n(113)(x.prototype,{then:function(t,e){var n=H(v(this,x));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=T?w.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&k(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),P=function(){var t=new r;this.promise=t,this.resolve=c(j,t,1),this.reject=c(I,t,1)}),l(l.G+l.W+l.F*!M,{Promise:x}),n(24)(x,E),n(114)(E),o=n(1)[E],l(l.S+l.F*!M,E,{reject:function(t){var e=H(this),n=e.reject;return n(t),e.promise}}),l(l.S+l.F*(a||!M),E,{resolve:function(t){if(t instanceof x&&b(t.constructor,this))return t;var e=H(this),n=e.resolve;return n(t),e.promise}}),l(l.S+l.F*!(M&&n(71)(function(t){x.all(t).catch(R)})),E,{all:function(t){var e=this,n=H(e),r=n.resolve,i=n.reject,o=z(function(){var n=[],o=0,a=1;d(t,!1,function(t){var s=o++,c=!1;n.push(void 0),a++,e.resolve(t).then(function(t){c||(c=!0,n[s]=t,--a||r(n))},i)}),--a||r(n)});return o&&i(o.error),n.promise},race:function(t){var e=this,n=H(e),r=n.reject,i=z(function(){d(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return i&&r(i.error),n.promise}})},function(t,e,n){(function(e){var r="object"==typeof e?e:"object"==typeof window?window:"object"==typeof self?self:this,i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,o=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n(119),i)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}}).call(e,function(){return this}())},function(t,e,n){(function(e,n){!function(e){"use strict";function r(t,e,n,r){var i=e&&e.prototype instanceof o?e:o,a=Object.create(i.prototype),s=new d(r||[]);return a._invoke=l(t,n,s),a}function i(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function o(){}function a(){}function s(){}function c(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function u(t){function e(n,r,o,a){var s=i(t[n],t,r);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&g.call(u,"__await")?Promise.resolve(u.__await).then(function(t){e("next",t,o,a)},function(t){e("throw",t,o,a)}):Promise.resolve(u).then(function(t){c.value=t,o(c)},a)}a(s.arg)}function r(t,n){function r(){return new Promise(function(r,i){e(t,n,r,i)})}return o=o?o.then(r,r):r()}"object"==typeof n&&n.domain&&(e=n.domain.bind(e));var o;this._invoke=r}function l(t,e,n){var r=b;return function(o,a){if(r===H)throw new Error("Generator is already running");if(r===P){if("throw"===o)throw a;return y()}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var c=h(s,n);if(c){if(c===z)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===b)throw r=P,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=H;var u=i(t,e,n);if("normal"===u.type){if(r=n.done?P:_,u.arg===z)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=P,n.method="throw",n.arg=u.arg)}}}function h(t,e){var n=t.iterator[e.method];if(n===m){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=m,h(t,e),"throw"===e.method))return z;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return z}var r=i(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,z;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=m),e.delegate=null,z):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,z)}function f(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function p(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function d(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(f,this),this.reset(!0)}function v(t){if(t){var e=t[x];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(g.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=m,e.done=!0,e};return r.next=r}}return{next:y}}function y(){return{value:m,done:!0}}var m,E=Object.prototype,g=E.hasOwnProperty,w="function"==typeof Symbol?Symbol:{},x=w.iterator||"@@iterator",T=w.toStringTag||"@@toStringTag",R="object"==typeof t,M=e.regeneratorRuntime;if(M)return void(R&&(t.exports=M));M=e.regeneratorRuntime=R?t.exports:{},M.wrap=r;var b="suspendedStart",_="suspendedYield",H="executing",P="completed",z={},k={};k[x]=function(){return this};var C=Object.getPrototypeOf,G=C&&C(C(v([])));G&&G!==E&&g.call(G,x)&&(k=G);var A=s.prototype=o.prototype=Object.create(k);a.prototype=A.constructor=s,s.constructor=a,s[T]=a.displayName="GeneratorFunction",M.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===a||"GeneratorFunction"===(e.displayName||e.name))},M.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,T in t||(t[T]="GeneratorFunction")),t.prototype=Object.create(A),t},M.awrap=function(t){return{__await:t}},c(u.prototype),M.AsyncIterator=u,M.async=function(t,e,n,i){var o=new u(r(t,e,n,i));return M.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},c(A),A[T]="Generator",A.toString=function(){return"[object Generator]"},M.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},M.values=v,d.prototype={constructor:d,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=m,this.done=!1,this.delegate=null,this.method="next",this.arg=m,this.tryEntries.forEach(p),!t)for(var e in this)"t"===e.charAt(0)&&g.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=m)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){function e(e,r){return o.type="throw",o.arg=t,n.next=e,r&&(n.method="next",n.arg=m),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var a=g.call(i,"catchLoc"),s=g.call(i,"finallyLoc");if(a&&s){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&g.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,z):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),z},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),p(n),z}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;p(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:v(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=m),z}}}("object"==typeof e?e:"object"==typeof window?window:"object"==typeof self?self:this)}).call(e,function(){return this}(),n(105))},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(74),o=r(i),a=n(37),s=r(a),c=n(73),u=r(c),l=n(72),h=r(l),f=n(59),p=r(f),d=n(122),v=r(d),y=n(11),m=r(y),E=n(12),g=r(E),w=function(){function t(){(0,m.default)(this,t)}return(0,g.default)(t,null,[{key:"guid",value:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"xxxxxxxxxxxx",n=(new Date).getTime(),t=e.replace(/[xy]/g,function(t){var e=(n+16*Math.random())%16|0;return n=Math.floor(n/16),("x"==t?e:7&e|8).toString(16)});return t}},{key:"getDefaultViewablePath",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["3d","2d"],n=t.getRootItem(),r=[].concat((0,v.default)(e)),i=[];return r.forEach(function(t){i=[].concat((0,v.default)(i),(0,v.default)(Autodesk.Viewing.Document.getSubItemsWithProperties(n,{type:"geometry",role:t},!0)))}),i.length?t.getViewablePath(i[0]):null}},{key:"createButton",value:function(t,e,n,r){var i=new Autodesk.Viewing.UI.Button(t);return i.icon.style.fontSize="24px",i.icon.className=e,i.setToolTip(n),i.onClick=r,i}},{key:"createControlGroup",value:function(t,e){var n=t.getToolbar(!0);if(n){var r=new Autodesk.Viewing.UI.ControlGroup(e);return n.addControl(r),r}}},{key:"getLeafNodes",value:function(t,e){return new p.default(function(n,r){try{var i=t.getData().instanceTree;e=e||i.getRootId();for(var o=Array.isArray(e)?e:[e],a=[],s=function t(e){var n=0;i.enumNodeChildren(e,function(e){t(e),++n}),0==n&&a.push(e)},c=0;c<o.length;++c)s(o[c]);return n(a)}catch(t){return r(t)}})}},{key:"getFragIds",value:function(e,n){var r=this;return new p.default(function(){var i=(0,h.default)(u.default.mark(function i(o,a){var c,l;return u.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.delegateYield(u.default.mark(function i(){var a,s,l,h;return u.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return a=Array.isArray(n)?n:[n],s=e.getData().instanceTree,r.next=4,t.getLeafNodes(e,a);case 4:for(l=r.sent,h=[],c=0;c<l.length;++c)s.enumNodeFragments(l[c],function(t){h.push(t)});return r.abrupt("return",{v:o(h)});case 8:case"end":return r.stop()}},i,r)})(),"t0",2);case 2:if(l=i.t0,"object"!==("undefined"==typeof l?"undefined":(0,s.default)(l))){i.next=5;break}return i.abrupt("return",l.v);case 5:i.next=10;break;case 7:return i.prev=7,i.t1=i.catch(0),i.abrupt("return",a(i.t1));case 10:case"end":return i.stop()}},i,r,[[0,7]])}));return function(t,e){return i.apply(this,arguments)}}())}},{key:"getWorldBoundingBox",value:function(e,n){var r=this;return new p.default(function(){var i=(0,h.default)(u.default.mark(function i(o,a){var s,c,l,h;return u.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,t.getFragIds(e,n);case 3:if(s=r.sent,s.length){r.next=6;break}return r.abrupt("return",a("No geometry, invalid dbId?"));case 6:return c=e.getFragmentList(),l=new THREE.Box3,h=new THREE.Box3,s.forEach(function(t){c.getWorldBounds(t,l),h.union(l)}),r.abrupt("return",o(h));case 13:return r.prev=13,r.t0=r.catch(0),r.abrupt("return",a(r.t0));case 16:case"end":return r.stop()}},i,r,[[0,13]])}));return function(t,e){return i.apply(this,arguments)}}())}},{key:"getProperties",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return new p.default(function(i,o){try{if(r){var a=r.map(function(r){return t.getProperty(e,n,r,"Not Available")});p.default.all(a).then(function(t){i(t)})}else e.getProperties(n,function(t){return t.properties?i(t.properties):o("No Properties")})}catch(t){return console.log(t),o(t)}})}},{key:"getProperty",value:function(t,e,n,r){return new p.default(function(i,o){try{t.getProperties(e,function(t){if(t.properties){if(t.properties.forEach(function(t){"function"==typeof n?n(t.displayName)&&i(t):n===t.displayName&&i(t)}),r)return i({displayValue:r,displayName:n});o(new Error("Not Found"))}else o(new Error("Error getting properties"))})}catch(t){return o(t)}})}},{key:"getPropertyList",value:function(e,n){var r=this;return new p.default(function(){var i=(0,h.default)(u.default.mark(function i(o,a){var s,c,l;return u.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,s=n.map(function(n){return t.getProperties(e,n)}),r.next=4,p.default.all(s);case 4:return c=r.sent,l=[],c.forEach(function(t){t.forEach(function(t){l.indexOf(t.displayName)<0&&l.push(t.displayName)})}),r.abrupt("return",o(l.sort()));case 10:return r.prev=10,r.t0=r.catch(0),r.abrupt("return",a(r.t0));case 13:case"end":return r.stop()}},i,r,[[0,10]])}));return function(t,e){return i.apply(this,arguments)}}())}},{key:"getBulkPropertiesAsync",value:function(t,e,n){return new p.default(function(r,i){t.getBulkProperties(e,n,function(t){r(t)},function(t){i(t)})})}},{key:"mapComponentsByProp",value:function(e,n,r,i){var a=this;return new p.default(function(){var i=(0,h.default)(u.default.mark(function i(s,c){var l,h,f;return u.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,t.getBulkPropertiesAsync(e,r,[n]);case 3:return l=i.sent,h=l.map(function(t){return(0,o.default)({},t.properties[0],{dbId:t.dbId})}),f={},h.forEach(function(t){var e=t.displayValue;"string"==typeof e&&(e=e.split(":")[0]),f[e]||(f[e]=[]),f[e].push(t.dbId)}),i.abrupt("return",s(f));case 10:return i.prev=10,i.t0=i.catch(0),i.abrupt("return",c(i.t0));case 13:case"end":return i.stop()}},i,a,[[0,10]])}));return function(t,e){return i.apply(this,arguments)}}())}},{key:"runTaskOnDataTree",value:function(t,e){var n=[],r=function t(r){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;r.children&&r.children.forEach(function(e){t(e,r)});var o=e(r,i);n.push(o)};return r(t),p.default.all(n)}},{key:"drawBox",value:function(t,e,n){function r(e,n){for(var r=[],i=0;i<e.length;i+=2){var o=e[i],a=e[i+1],s=new THREE.Geometry;s.vertices.push(new THREE.Vector3(o.x,o.y,o.z)),s.vertices.push(new THREE.Vector3(a.x,a.y,a.z)),s.computeLineDistances();var c=new THREE.Line(s,n);t.impl.scene.add(c),r.push(c)}return r}var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=i;o||(o=new THREE.LineBasicMaterial({color:16776960,linewidth:2}),t.impl.matman().addMaterial("ADN-Material-Line",o,!0));var a=r([{x:e.x,y:e.y,z:e.z},{x:n.x,y:e.y,z:e.z},{x:n.x,y:e.y,z:e.z},{x:n.x,y:e.y,z:n.z},{x:n.x,y:e.y,z:n.z},{x:e.x,y:e.y,z:n.z},{x:e.x,y:e.y,z:n.z},{x:e.x,y:e.y,z:e.z},{x:e.x,y:n.y,z:n.z},{x:n.x,y:n.y,z:n.z},{x:n.x,y:n.y,z:n.z},{x:n.x,y:n.y,z:e.z},{x:n.x,y:n.y,z:e.z},{x:e.x,y:n.y,z:e.z},{x:e.x,y:n.y,z:e.z},{x:e.x,y:n.y,z:n.z},{x:e.x,y:e.y,z:e.z},{x:e.x,y:n.y,z:e.z},{x:n.x,y:e.y,z:e.z},{x:n.x,y:n.y,z:e.z},{x:n.x,y:e.y,z:n.z},{x:n.x,y:n.y,z:n.z},{x:e.x,y:e.y,z:n.z},{x:e.x,y:n.y,z:n.z}],o);return t.impl.sceneUpdated(!0),a}},{key:"setMaterial",value:function(){function e(t,e,r){return n.apply(this,arguments)}var n=(0,h.default)(u.default.mark(function e(n,r,i){var o,a;return u.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getFragIds(n,r);case 2:o=e.sent,a=n.getFragmentList(),o.forEach(function(t){a.setMaterial(t,i)});case 5:case"end":return e.stop()}},e,this)}));return e}()},{key:"buildModelTree",value:function(t){function e(t){r.enumNodeChildren(t.dbId,function(i){var o=null;n?o=n(i):(t.children=t.children||[],o={dbId:i,name:r.getNodeName(i)},t.children.push(o)),e(o)})}var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=t.getData().instanceTree,i=r.getRootId(),o={dbId:i,name:r.getNodeName(i)};return e(o),o}},{key:"executeTaskOnModelTree",value:function(t,e){function n(o){i.enumNodeChildren(o,function(i){r.push(e(t,i)),n(i)})}var r=[],i=t.getData().instanceTree,o=i.getRootId();return n(o),r}},{key:"isolateFull",value:function(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return new p.default(function(){var o=(0,h.default)(u.default.mark(function o(a,s){var c,l,h,f;return u.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,r=r||e.model,e.isolate(i),c=Array.isArray(i)?i:[i],n.next=6,t.getLeafNodes(r,c);case 6:return l=n.sent,n.next=9,t.getLeafNodes(r);case 9:return h=n.sent,f=h.map(function(t){return new p.default(function(n){var r=!l.length||l.indexOf(t)>-1;e.impl.visibilityManager.setNodeOff(t,!r),n()})}),n.abrupt("return",p.default.all(f));case 14:return n.prev=14,n.t0=n.catch(0),n.abrupt("return",s(n.t0));case 17:case"end":return n.stop()}},o,n,[[0,14]])}));return function(t,e){return o.apply(this,arguments)}}())}},{key:"mobile",get:function(){return{getUserAgent:function(){return navigator.userAgent},isAndroid:function(){return this.getUserAgent().match(/Android/i)},isBlackBerry:function(){return this.getUserAgent().match(/BlackBerry/i)},isIOS:function(){return this.getUserAgent().match(/iPhone|iPad|iPod/i)},isOpera:function(){return this.getUserAgent().match(/Opera Mini/i)},isWindows:function(){return this.isWindowsDesktop()||this.isWindowsMobile()},isWindowsMobile:function(){return this.getUserAgent().match(/IEMobile/i)},isWindowsDesktop:function(){return this.getUserAgent().match(/WPDesktop/i)},isAny:function(){return this.isAndroid()||this.isBlackBerry()||this.isIOS()||this.isWindowsMobile()}}}}]),t}();e.default=w},function(t,e,n){t.exports={default:n(123),__esModule:!0}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=n(121),o=r(i);e.default=function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return(0,o.default)(t)}},function(t,e,n){n(44),n(125),t.exports=n(1).Array.from},function(t,e,n){"use strict";var r=n(4),i=n(20);t.exports=function(t,e,n){e in t?r.f(t,e,i(0,n)):t[e]=n}},function(t,e,n){"use strict";var r=n(18),i=n(5),o=n(27),a=n(70),s=n(69),c=n(41),u=n(124),l=n(65);i(i.S+i.F*!n(71)(function(t){Array.from(t)}),"Array",{from:function(t){var e,n,i,h,f=o(t),p="function"==typeof this?this:Array,d=arguments.length,v=d>1?arguments[1]:void 0,y=void 0!==v,m=0,E=l(f);if(y&&(v=r(v,d>2?arguments[2]:void 0,2)),void 0==E||p==Array&&s(E))for(e=c(f.length),n=new p(e);e>m;m++)u(n,m,y?v(f[m],m):f[m]);else for(h=E.call(f),n=new p;!(i=h.next()).done;m++)u(n,m,y?a(h,v,[i.value,m],!0):i.value);return n.length=m,n}})},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){t.exports={default:n(161),__esModule:!0}},,,,function(t,e,n){n(164),t.exports=n(1).Math.sign},function(t,e){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},,function(t,e,n){var r=n(5);r(r.S,"Math",{sign:n(162)})},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i=n(57),o=r(i);!function(){var t=function(t){THREE.MeshBasicMaterial.call(this),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)}};t.prototype=(0,o.default)(THREE.MeshBasicMaterial.prototype);var e=function(t){THREE.LineBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.transparent=!0,this.linewidth=3,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)}};e.prototype=(0,o.default)(THREE.LineBasicMaterial.prototype),void 0===THREE.PolyhedronGeometry&&(THREE.PolyhedronGeometry=function(t,e,n,r){function i(t){var e=t.normalize().clone();e.index=l.vertices.push(e)-1;var n=s(t)/2/Math.PI+.5,r=c(t)/Math.PI+.5;return e.uv=new THREE.Vector2(n,1-r),e}function o(t,e,n){var r=new THREE.Face3(t.index,e.index,n.index,[t.clone(),e.clone(),n.clone()]);l.faces.push(r),g.copy(t).add(e).add(n).divideScalar(3);var i=s(g);l.faceVertexUvs[0].push([u(t.uv,t,i),u(e.uv,e,i),u(n.uv,n,i)])}function a(t,e){for(var n=Math.pow(2,e),r=(Math.pow(4,e),i(l.vertices[t.a])),a=i(l.vertices[t.b]),s=i(l.vertices[t.c]),c=[],u=0;u<=n;u++){c[u]=[];for(var h=i(r.clone().lerp(s,u/n)),f=i(a.clone().lerp(s,u/n)),p=n-u,d=0;d<=p;d++)0==d&&u==n?c[u][d]=h:c[u][d]=i(h.clone().lerp(f,d/p))}for(var u=0;u<n;u++)for(var d=0;d<2*(n-u)-1;d++){var v=Math.floor(d/2);d%2==0?o(c[u][v+1],c[u+1][v],c[u][v]):o(c[u][v+1],c[u+1][v+1],c[u+1][v])}}function s(t){return Math.atan2(t.z,-t.x)}function c(t){return Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))}function u(t,e,n){return n<0&&1===t.x&&(t=new THREE.Vector2(t.x-1,t.y)),0===e.x&&0===e.z&&(t=new THREE.Vector2(n/2/Math.PI+.5,t.y)),t.clone()}THREE.Geometry.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:r},n=n||1,r=r||0;for(var l=this,h=0,f=t.length;h<f;h+=3)i(new THREE.Vector3(t[h],t[h+1],t[h+2]));for(var p=this.vertices,d=[],h=0,v=0,f=e.length;h<f;h+=3,v++){var y=p[e[h]],m=p[e[h+1]],E=p[e[h+2]];d[v]=new THREE.Face3(y.index,m.index,E.index,[y.clone(),m.clone(),E.clone()])}for(var g=new THREE.Vector3,h=0,f=d.length;h<f;h++)a(d[h],r);for(var h=0,f=this.faceVertexUvs[0].length;h<f;h++){var w=this.faceVertexUvs[0][h],x=w[0].x,T=w[1].x,R=w[2].x,M=Math.max(x,Math.max(T,R)),b=Math.min(x,Math.min(T,R));M>.9&&b<.1&&(x<.2&&(w[0].x+=1),T<.2&&(w[1].x+=1),R<.2&&(w[2].x+=1))}for(var h=0,f=this.vertices.length;h<f;h++)this.vertices[h].multiplyScalar(n);this.mergeVertices(),this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,n)},THREE.PolyhedronGeometry.prototype=(0,o.default)(THREE.Geometry.prototype)),void 0===THREE.OctahedronGeometry&&(THREE.OctahedronGeometry=function(t,e){this.parameters={radius:t,detail:e};var n=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];THREE.PolyhedronGeometry.call(this,n,r,t,e),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e}},THREE.OctahedronGeometry.prototype=(0,o.default)(THREE.Geometry.prototype)),void 0===THREE.TorusGeometry&&(THREE.TorusGeometry=function(t,e,n,r,i){THREE.Geometry.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:r,arc:i},t=t||100,e=e||40,n=n||8,r=r||6,i=i||2*Math.PI;for(var o=new THREE.Vector3,a=[],s=[],c=0;c<=n;c++)for(var u=0;u<=r;u++){var l=u/r*i,h=c/n*Math.PI*2;o.x=t*Math.cos(l),o.y=t*Math.sin(l);var f=new THREE.Vector3;f.x=(t+e*Math.cos(h))*Math.cos(l),f.y=(t+e*Math.cos(h))*Math.sin(l),f.z=e*Math.sin(h),this.vertices.push(f),a.push(new THREE.Vector2(u/r,c/n)),s.push(f.clone().sub(o).normalize())}for(var c=1;c<=n;c++)for(var u=1;u<=r;u++){var p=(r+1)*c+u-1,d=(r+1)*(c-1)+u-1,v=(r+1)*(c-1)+u,y=(r+1)*c+u,m=new THREE.Face3(p,d,y,[s[p].clone(),s[d].clone(),s[y].clone()]);this.faces.push(m),this.faceVertexUvs[0].push([a[p].clone(),a[d].clone(),a[y].clone()]),m=new THREE.Face3(d,v,y,[s[d].clone(),s[v].clone(),s[y].clone()]),this.faces.push(m),this.faceVertexUvs[0].push([a[d].clone(),a[v].clone(),a[y].clone()])}this.computeFaceNormals()},THREE.TorusGeometry.prototype=(0,o.default)(THREE.Geometry.prototype));var n=function(t,e,n){var r=new THREE.Geometry;n=n?n:1;for(var i=0;i<=64*n;++i)"x"==e&&r.vertices.push(new THREE.Vector3(0,Math.cos(i/32*Math.PI),Math.sin(i/32*Math.PI)).multiplyScalar(t)),"y"==e&&r.vertices.push(new THREE.Vector3(Math.cos(i/32*Math.PI),0,Math.sin(i/32*Math.PI)).multiplyScalar(t)),"z"==e&&r.vertices.push(new THREE.Vector3(Math.sin(i/32*Math.PI),Math.cos(i/32*Math.PI),0).multiplyScalar(t));return r},r=function(t,e,n,r,i,o){var a=new THREE.Geometry,s=new THREE.Mesh(new THREE.CylinderGeometry(t,e,n,r,i,o));return s.position.y=.5,s.updateMatrix(),a.merge(s.geometry,s.matrix),a},i=function(t){var e=new THREE.Geometry;return"X"===t?e.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(1,0,0)):"Y"===t?e.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1,0)):"Z"===t&&e.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,0,1)),e};THREE.TransformGizmo=function(){var t=this,e=!1,n=!1;this.init=function(){THREE.Object3D.call(this),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)};this.activePlane=n.XYZE,n.YZ.rotation.set(0,Math.PI/2,0),n.XZ.rotation.set(-Math.PI/2,0,0);for(var r in n)n[r].name=r,this.planes.add(n[r]),this.planes[r]=n[r],n[r].visible=!1;this.setupGizmos(),this.activeMode="",this.traverse(function(t){if(t instanceof THREE.Mesh){t.updateMatrix();var e=new THREE.Geometry;t.geometry instanceof THREE.BufferGeometry&&(t.geometry=(new THREE.Geometry).fromBufferGeometry(t.geometry)),e.merge(t.geometry,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(n){n.visible=!0,n.parent!=t.pickers&&n.parent!=t.hemiPicker||(n.visible=e),n.parent==t.planes&&(n.visible=!1)}),this.activePlane.visible=n},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 t=function(t,e){for(var n in t)for(var r=t[n].length;r--;){var i=t[n][r][0],o=t[n][r][1],a=t[n][r][2],s=t[n][r][3];i.name=n,o&&i.position.set(o[0],o[1],o[2]),a&&i.rotation.set(a[0],a[1],a[2]),s&&(i.visble=s),e.add(i)}};this.setHandlePickerGizmos(),t(this.handleGizmos,this.handles),t(this.pickerGizmos,this.pickers),t(this.highlightGizmos,this.highlights),t(this.hemiPickerGizmos,this.hemiPicker),t(this.subPickerGizmos,this.subPickers),this.hide(),this.show()}},THREE.TransformGizmo.prototype=(0,o.default)(THREE.Object3D.prototype),THREE.TransformGizmo.prototype.update=function(t,e){var n=new THREE.Vector3(0,0,0),r=new THREE.Vector3(0,1,0),i=new THREE.Matrix4;this.traverse(function(o){o.name&&(o.name.search("E")!=-1?o.quaternion.setFromRotationMatrix(i.lookAt(e,n,r)):o.name.search("X")==-1&&o.name.search("Y")==-1&&o.name.search("Z")==-1||o.quaternion.setFromEuler(t))})},THREE.TransformGizmoTranslate=function(){THREE.TransformGizmo.call(this),this.setHandlePickerGizmos=function(){var n=r(0,.05,.2,12,1,!1),o=i("X"),a=i("Y"),s=i("Z");this.handleGizmos={X:[[new THREE.Mesh(n,new t({color:15805484})),[.5,0,0],[0,0,-Math.PI/2]],[new THREE.Line(o,new e({color:15805484}))]],Y:[[new THREE.Mesh(n,new t({color:768011})),[0,.5,0]],[new THREE.Line(a,new e({color:768011}))]],Z:[[new THREE.Mesh(n,new t({color:2895089})),[0,0,.5],[Math.PI/2,0,0]],[new THREE.Line(s,new e({color:2895089}))]],XYZ:[[new THREE.Mesh(new THREE.OctahedronGeometry(.1,0),new t({color:16777215,opacity:.25})),[0,0,0],[0,0,0]]],XY:[[new THREE.Mesh(new THREE.PlaneBufferGeometry(.29,.29),new t({color:16776960,opacity:.25})),[.15,.15,0]]],YZ:[[new THREE.Mesh(new THREE.PlaneBufferGeometry(.29,.29),new t({color:65535,opacity:.25})),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new THREE.Mesh(new THREE.PlaneBufferGeometry(.29,.29),new t({color:16711935,opacity:.25})),[.15,0,.15],[-Math.PI/2,0,0]]]},this.pickerGizmos={X:[[new THREE.Mesh(new THREE.CylinderGeometry(.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.CylinderGeometry(.2,0,1,4,1,!1),new t({color:65280,opacity:.25})),[0,.6,0]]],Z:[[new THREE.Mesh(new THREE.CylinderGeometry(.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.OctahedronGeometry(.2,0),new t({color:16777215,opacity:.25}))]],XY:[[new THREE.Mesh(new THREE.PlaneBufferGeometry(.4,.4),new t({color:16776960,opacity:.25})),[.2,.2,0]]],YZ:[[new THREE.Mesh(new THREE.PlaneBufferGeometry(.4,.4),new t({color:65535,opacity:.25})),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new THREE.Mesh(new THREE.PlaneBufferGeometry(.4,.4),new t({color:16711935,opacity:.25})),[.2,0,.2],[-Math.PI/2,0,0]]]},this.hemiPickerGizmos={XYZ:[[new THREE.Mesh(new THREE.BoxGeometry(1.2,1.2,1.2),new t({color:255})),[.5,.5,.5],null,!1]]}},this.setActivePlane=function(t,e){var n=new THREE.Matrix4;e.applyMatrix4(n.getInverse(n.extractRotation(this.planes.XY.matrixWorld))),"X"==t&&(this.activePlane=this.planes.XY,Math.abs(e.y)>Math.abs(e.z)&&(this.activePlane=this.planes.XZ)),"Y"==t&&(this.activePlane=this.planes.XY,Math.abs(e.x)>Math.abs(e.z)&&(this.activePlane=this.planes.YZ)),"Z"==t&&(this.activePlane=this.planes.XZ,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.TransformGizmoTranslate.prototype=(0,o.default)(THREE.TransformGizmo.prototype),THREE.TransformGizmoRotate=function(){THREE.TransformGizmo.call(this),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.TorusGeometry(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.TorusGeometry(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.TorusGeometry(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.TorusGeometry(1.25,.12,2,24),new t({color:65535,opacity:.25}))]],RXYZE:[[new THREE.Mesh(new THREE.TorusGeometry(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,r=new THREE.Euler(0,0,1),i=new THREE.Quaternion,o=new THREE.Vector3(1,0,0),a=new THREE.Vector3(0,1,0),s=new THREE.Vector3(0,0,1),c=new THREE.Quaternion,u=new THREE.Quaternion,l=new THREE.Quaternion,h=e.clone();r.copy(this.planes.XY.rotation),i.setFromEuler(r),n.makeRotationFromQuaternion(i).getInverse(n),h.applyMatrix4(n),this.traverse(function(t){i.setFromEuler(r),"RX"==t.name&&(c.setFromAxisAngle(o,Math.atan2(-h.y,h.z)),i.multiplyQuaternions(i,c),t.quaternion.copy(i)),"RY"==t.name&&(u.setFromAxisAngle(a,Math.atan2(h.x,h.z)),i.multiplyQuaternions(i,u),t.quaternion.copy(i)),"RZ"==t.name&&(l.setFromAxisAngle(s,Math.atan2(h.y,h.x)),i.multiplyQuaternions(i,l),t.quaternion.copy(i))})},this.init()},THREE.TransformGizmoRotate.prototype=(0,o.default)(THREE.TransformGizmo.prototype),THREE.TransformGizmoTranslateRotate=function(){THREE.TransformGizmo.call(this);var e=this;this.setHandlePickerGizmos=function(){var e=r(0,.05,.2,12,1,!1),n=new THREE.Geometry;n.vertices.push(new THREE.Vector3(0,0,-.1),new THREE.Vector3(0,0,.1),new THREE.Vector3(-.1,0,0),new THREE.Vector3(.1,0,0));var i=.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.CylinderGeometry(.015,.015,.6,4,1,!1),new t({color:16777215})),[0,0,.5],[Math.PI/2,0,0]]],RX:[[new THREE.Mesh(new THREE.TorusGeometry(1,.015,12,60,2*i*Math.PI),new t({color:16711680})),[0,0,0],[i*Math.PI,-Math.PI/2,0]],[new THREE.Mesh(new THREE.CylinderGeometry(.05,.05,.015,60,1,!1),new t({color:16711680})),[0,0,1],[Math.PI/2,0,0]]],RY:[[new THREE.Mesh(new THREE.TorusGeometry(1,.015,12,60,2*i*Math.PI),new t({color:255})),[0,0,0],[Math.PI/2,0,(.5-i)*Math.PI]],[new THREE.Mesh(new THREE.CylinderGeometry(.05,.05,.01,60,1,!1),new t({color:255})),[0,0,1]]]},this.pickerGizmos={Z:[[new THREE.Mesh(new THREE.CylinderGeometry(.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.TorusGeometry(1,.12,4,12,2*i*Math.PI),new t({color:16711680,opacity:.25})),[0,0,0],[i*Math.PI,-Math.PI/2,0]]],RY:[[new THREE.Mesh(new THREE.TorusGeometry(1,.12,4,12,2*i*Math.PI),new t({color:255,opacity:.25})),[0,0,0],[Math.PI/2,0,(.5-i)*Math.PI]]]},this.subPickerGizmos={Z:[[new THREE.Mesh(new THREE.CylinderGeometry(.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.TorusGeometry(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.TorusGeometry(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.SphereGeometry(1.2,8,8,0,Math.PI),new t({color:255})),null,null,!1]]}},this.setActivePlane=function(t,e){if("translate"==this.activeMode){var n=new THREE.Matrix4;e.applyMatrix4(n.getInverse(n.extractRotation(this.planes.XY.matrixWorld))),"X"==t&&(this.activePlane=this.planes.XY,Math.abs(e.y)>Math.abs(e.z)&&(this.activePlane=this.planes.XZ)),"Y"==t&&(this.activePlane=this.planes.XY,Math.abs(e.x)>Math.abs(e.z)&&(this.activePlane=this.planes.YZ)),"Z"==t&&(this.activePlane=this.planes.XZ,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,r=new THREE.Euler(0,0,1),i=new THREE.Quaternion,o=new THREE.Vector3(1,0,0),a=new THREE.Vector3(0,1,0),s=new THREE.Vector3(0,0,1),c=new THREE.Quaternion,u=new THREE.Quaternion,l=new THREE.Quaternion,h=e.clone();r.copy(this.planes.XY.rotation),i.setFromEuler(r),n.makeRotationFromQuaternion(i).getInverse(n),h.applyMatrix4(n),this.traverse(function(t){i.setFromEuler(r),"RX"==t.name&&(c.setFromAxisAngle(o,Math.atan2(-h.y,h.z)),i.multiplyQuaternions(i,c),t.quaternion.copy(i)),"RY"==t.name&&(u.setFromAxisAngle(a,Math.atan2(h.x,h.z)),i.multiplyQuaternions(i,u),t.quaternion.copy(i)),"RZ"==t.name&&(l.setFromAxisAngle(s,Math.atan2(h.y,h.x)),i.multiplyQuaternions(i,l),t.quaternion.copy(i))})}},this.show=function(){this.traverse(function(t){(null==e.parent||e.parent.useAllPickers||t.parent!=e.handles)&&(t.visible=!0),t.material&&(t.material.opacity=t.material.oldOpacity),t.parent!=e.pickers&&t.parent!=e.hemiPicker&&t.parent!=e.subPickers||(t.visible=!1),t.parent!=e.planes&&t.parent!=e.highlights||(t.visible=!1)}),this.activePlane.visible=!1},this.highlight=function(t){this.traverse(function(n){n.material&&n.material.highlight&&(n.name==t?(n.parent!=e.highlights&&n.parent!=e.handles||(n.visible=!0),n.material.highlight(!0)):(n.material.highlight(!1),n.material.opacity=.1))})},this.init()},THREE.TransformGizmoTranslateRotate.prototype=(0,o.default)(THREE.TransformGizmo.prototype),THREE.TransformGizmoScale=function(){THREE.TransformGizmo.call(this),this.setHandlePickerGizmos=function(){var n=r(.125,.125,.125),o=i("X"),a=i("Y"),s=i("Z");this.handleGizmos={X:[[new THREE.Mesh(n,new t({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new THREE.Line(o,new e({color:16711680}))]],Y:[[new THREE.Mesh(n,new t({color:65280})),[0,.5,0]],[new THREE.Line(a,new e({color:65280}))]],Z:[[new THREE.Mesh(n,new t({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new THREE.Line(s,new e({color:255}))]],XYZ:[[new THREE.Mesh(new THREE.BoxGeometry(.125,.125,.125),new t({color:16777215,opacity:.25}))]]},this.pickerGizmos={X:[[new THREE.Mesh(new THREE.CylinderGeometry(.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.CylinderGeometry(.2,0,1,4,1,!1),new t({color:65280,opacity:.25})),[0,.6,0]]],Z:[[new THREE.Mesh(new THREE.CylinderGeometry(.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.BoxGeometry(.4,.4,.4),new t({color:16777215,opacity:.25}))]]}},this.setActivePlane=function(t,e){var n=new THREE.Matrix4;e.applyMatrix4(n.getInverse(n.extractRotation(this.planes.XY.matrixWorld))),"X"==t&&(this.activePlane=this.planes.XY,Math.abs(e.y)>Math.abs(e.z)&&(this.activePlane=this.planes.XZ)),"Y"==t&&(this.activePlane=this.planes.XY,Math.abs(e.x)>Math.abs(e.z)&&(this.activePlane=this.planes.YZ)),"Z"==t&&(this.activePlane=this.planes.XZ,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()},THREE.TransformGizmoScale.prototype=(0,o.default)(THREE.TransformGizmo.prototype),THREE.TransformControls=function(t,e,n){function r(n,r){var i=e.getBoundingClientRect(),o=(n.clientX-i.left)/i.width*2-1,a=2*-((n.clientY-i.top)/i.height)+1;t.isPerspective?(g.set(o,a,.5),g.unproject(t),E.set(t.position,g.sub(t.position).normalize())):(g.set(o,a,-1),g.unproject(t),w.set(0,0,-1),E.set(g,w.transformDirection(t.matrixWorld)));var s=E.intersectObjects(r,!0);return!!s[0]&&s[0]}switch(THREE.Object3D.call(this),e=void 0!==e?e:document,this.gizmo={},n){case"translate":this.gizmo[n]=new THREE.TransformGizmoTranslate;break;case"rotate":this.gizmo[n]=new THREE.TransformGizmoRotate;break;case"transrotate":this.gizmo[n]=new THREE.TransformGizmoTranslateRotate;break;case"scale":this.gizmo[n]=new THREE.TransformGizmoScale}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 i=new THREE.Geometry;i.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,0,1));var o=new THREE.LineBasicMaterial({color:0,linewidth:2,depthTest:!1});this.startLine=new THREE.Line(i,o);var i=new THREE.Geometry,o=new THREE.LineBasicMaterial({color:16770563,linewidth:2,depthTest:!1});i.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,0,1)),this.endLine=new THREE.Line(i,o);var i=new THREE.Geometry,o=new THREE.LineDashedMaterial({color:0,linewidth:1,depthTest:!1});i.vertices.push(new THREE.Vector3(0,-1,0),new THREE.Vector3(0,1,0)),this.centerLine=new THREE.Line(i,o);var a=THREE.ImageUtils.loadTexture(Autodesk.Viewing.Private.getResourceUrl("res/textures/centerMarker_X.png"));a.magFilter=a.minFilter=THREE.NearestFilter;var i=new THREE.CircleGeometry(.1,32),o=new THREE.MeshBasicMaterial({opacity:1,side:THREE.DoubleSide,transparent:!0,map:a});this.centerMark=new THREE.Mesh(i,o),this.centerMark.rotation.set(Math.PI/2,0,0),this.ticks={};var a=THREE.ImageUtils.loadTexture(Autodesk.Viewing.Private.getResourceUrl("res/textures/cardinalPoint.png"));a.magFilter=a.minFilter=THREE.NearestFilter;var o=new THREE.MeshBasicMaterial({depthTest:!1,opacity:1,transparent:!0,side:THREE.DoubleSide,map:a}),s=.12,c=.25,u=1.15;this.ticks.RX=new THREE.Object3D;var i=new THREE.PlaneBufferGeometry(s,c),l=new THREE.Mesh(i,o);l.position.set(0,0,-u-c/2),l.rotation.set(Math.PI/2,Math.PI/2,0),this.ticks.RX.add(l),l=l.clone(),l.position.set(0,u+c/2,0),l.rotation.set(0,Math.PI/2,0),this.ticks.RX.add(l),l=l.clone(),l.position.set(0,0,u+c/2),l.rotation.set(0,Math.PI/2,Math.PI/2),this.ticks.RX.add(l),l=l.clone(),l.position.set(0,-u-c/2,0),l.rotation.set(0,Math.PI/2,0),this.ticks.RX.add(l),this.ticks.RY=new THREE.Object3D,l=l.clone(),l.position.set(0,0,-u-c/2),l.rotation.set(Math.PI/2,0,0),this.ticks.RY.add(l),l=l.clone(),l.position.set(-u-c/2,0,0),l.rotation.set(Math.PI/2,0,Math.PI/2),this.ticks.RY.add(l),l=l.clone(),l.position.set(0,0,u+c/2),l.rotation.set(Math.PI/2,0,0),this.ticks.RY.add(l),l=l.clone(),l.position.set(u+c/2,0,0),l.rotation.set(Math.PI/2,0,Math.PI/2),this.ticks.RY.add(l)}var h=this,f=!1,p=n,d={type:"change"},v={type:"mouseDown"},y={type:"mouseUp",mode:p},m={type:"objectChange"},E=new THREE.Raycaster,g=new THREE.Vector3,w=new THREE.Vector3,x=new THREE.Vector3,T=new THREE.Vector3,R=new THREE.Vector3,M=new THREE.Vector3,b=1,_=new THREE.Matrix4,H=new THREE.Vector3,P=new THREE.Matrix4,z=new THREE.Vector3,k=new THREE.Quaternion,C=new THREE.Vector3,G=new THREE.Vector3,A=new THREE.Vector3,I=new THREE.Quaternion,j=new THREE.Quaternion,O=new THREE.Quaternion,S=new THREE.Quaternion,V=new THREE.Quaternion,L=new THREE.Vector3,Y=new THREE.Vector3,F=new THREE.Matrix4,X=new THREE.Matrix4,N=new THREE.Vector3,Z=new THREE.Vector3,D=new THREE.Euler,B=new THREE.Matrix4,U=new THREE.Vector3;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){p=t?t:p,"scale"==p&&(h.space="local"),this.gizmo[p].show(),this.update(),h.dispatchEvent(d)},this.getPicker=function(){return h.gizmo[p].hemiPicker.children},this.setPosition=function(t){this.object.position.copy(t),this.update()},this.setNormal=function(t){k.setFromUnitVectors(this.normal,t),this.unitX.applyQuaternion(k),this.unitY.applyQuaternion(k),this.unitZ.applyQuaternion(k),this.normal.copy(t),this.object&&this.object.quaternion.multiply(k),this.update()},this.setSnap=function(t,e){h.snap=t,h.snapDelta=e},this.setSize=function(t){h.size=t,this.update(),h.dispatchEvent(d)},this.setSpace=function(t){h.space=t,this.update(),h.dispatchEvent(d)},this.update=function(n){if(void 0!==h.object){h.object.updateMatrixWorld(),Z.setFromMatrixPosition(h.object.matrixWorld),D.setFromRotationMatrix(P.extractRotation(h.object.matrixWorld)),t.updateMatrixWorld(),U.setFromMatrixPosition(t.matrixWorld),this.position.copy(Z),this.quaternion.setFromEuler(D),this.normal.set(0,0,1),this.normal.applyEuler(D);var r=Z.distanceTo(U),i=t.isPerspective?2*Math.tan(t.fov*Math.PI/360)*r:r,o=e.getBoundingClientRect();b=100*i/o.height,this.scale.set(b,b,b),n&&this.gizmo[p].highlight(h.axis)}},this.updateUnitVectors=function(){this.unitX.set(1,0,0),this.unitY.set(0,1,0),this.unitZ.set(0,0,1),this.unitX.applyEuler(D),this.unitY.applyEuler(D),this.unitZ.applyEuler(D)},this.showRotationGizmos=function(t){for(var e=this.gizmo[p].handles.children,n=0;n<e.length;n++){var r=e[n];r.visible=!0,r.name.search("R")!==-1&&(r.visible=t)}this.useAllPickers=t},this.highlight=function(){this.gizmo[p].highlight(this.axis||"Z")},this.onPointerHover=function(t){if(void 0===h.object||f===!0)return!1;var e=t.pointers?t.pointers[0]:t,n=r(e,h.useAllPickers?h.gizmo[p].pickers.children:h.gizmo[p].subPickers.children),i=null,o="";return n&&(i=n.object.name,o=i.search("R")!=-1?"rotate":"translate"),h.axis!==i&&(h.axis=i,h.gizmo[p].activeMode=o,h.update(!0),h.dispatchEvent(d)),null===h.axis&&h.gizmo[p].show(),!!n},this.onPointerDown=function(e){if(void 0===h.object||f===!0)return!1;var n=e.pointers?e.pointers[0]:e;if("touch"===e.pointerType){var i=r(n,h.useAllPickers?h.gizmo[p].pickers.children:h.gizmo[p].subPickers.children),o=null,a="";i&&(o=i.object.name,a=o.search("R")!=-1?"rotate":"translate"),h.axis!==o&&(h.axis=o,h.gizmo[p].activeMode=a)}var i=null;if((0===n.button||void 0===n.button)&&(i=r(n,h.useAllPickers?h.gizmo[p].pickers.children:h.gizmo[p].subPickers.children))){h.dispatchEvent(v),h.axis=i.object.name,h.update(),H.copy(t.position).sub(Z).normalize(),h.gizmo[p].setActivePlane(h.axis,H);var s=r(n,[h.gizmo[p].activePlane]);if(s&&T.copy(s.point),L.copy(h.object.position),Y.copy(h.object.scale),F.extractRotation(h.object.matrix),B.extractRotation(h.object.matrixWorld),h.object.parent?(X.extractRotation(h.object.parent.matrixWorld),N.setFromMatrixScale(P.getInverse(h.object.parent.matrixWorld))):(X.extractRotation(h.object.matrixWorld),N.setFromMatrixScale(P.getInverse(h.object.matrixWorld))),"transrotate"===p&&"rotate"===h.gizmo[p].activeMode){h.startLine.geometry.vertices[0].set(0,0,0).applyMatrix4(h.matrixWorld),h.startLine.geometry.vertices[1].set(0,0,1).applyMatrix4(h.matrixWorld),h.startLine.geometry.verticesNeedUpdate=!0,h.parent.add(h.startLine);var c=h.object.geometry.getAttribute("position"),u=(new THREE.Vector3).fromAttribute(c,0).applyMatrix4(h.object.matrixWorld),l=(new THREE.Vector3).fromAttribute(c,1).applyMatrix4(h.object.matrixWorld),d=(new THREE.Vector3).fromAttribute(c,2).applyMatrix4(h.object.matrixWorld),y=(new THREE.Vector3).fromAttribute(c,3).applyMatrix4(h.object.matrixWorld);if("RX"===h.axis){u.lerp(d,.5),l.lerp(y,.5);var m=u.distanceTo(l);h.centerLine.material.dashSize=m/15,h.centerLine.material.gapSize=m/30,h.centerLine.geometry.vertices[0].copy(u),h.centerLine.geometry.vertices[1].copy(l)}else{u.lerp(l,.5),d.lerp(y,.5);var m=u.distanceTo(d);h.centerLine.material.dashSize=m/15,h.centerLine.material.gapSize=m/30,h.centerLine.geometry.vertices[0].copy(u),h.centerLine.geometry.vertices[1].copy(d)}h.centerLine.geometry.computeLineDistances(),h.centerLine.geometry.verticesNeedUpdate=!0,h.parent.add(h.centerLine),h.ticks[h.axis].position.copy(h.position),h.ticks[h.axis].quaternion.copy(h.quaternion),h.ticks[h.axis].scale.copy(h.scale),h.parent.add(h.ticks[h.axis])}}return f=!0,!!i},this.onPointerMove=function(t){if(void 0===h.object||null===h.axis||f===!1)return!1;var e=t.pointers?t.pointers[0]:t,n=r(e,[h.gizmo[p].activePlane]);n&&x.copy(n.point);var i=h.gizmo[p].activeMode;if("translate"==i)x.sub(T),x.multiply(N),"local"==h.space&&(x.applyMatrix4(P.getInverse(B)),C.copy(this.unitX),G.copy(this.unitY),A.copy(this.unitZ),z.set(0,0,0),h.axis.search("X")!=-1&&(C.multiplyScalar(x.dot(this.unitX)),z.add(C)),h.axis.search("Y")!=-1&&(G.multiplyScalar(x.dot(this.unitY)),z.add(G)),h.axis.search("Z")!=-1&&(A.multiplyScalar(x.dot(this.unitZ)),z.add(A)),x.copy(z),x.applyMatrix4(F),h.object.position.copy(L),h.object.position.add(x)),"world"!=h.space&&h.axis.search("XYZ")==-1||(C.copy(this.unitX),G.copy(this.unitY),A.copy(this.unitZ),z.set(0,0,0),h.axis.search("X")!=-1&&(C.multiplyScalar(x.dot(this.unitX)),z.add(C)),h.axis.search("Y")!=-1&&(G.multiplyScalar(x.dot(this.unitY)),z.add(G)),h.axis.search("Z")!=-1&&(A.multiplyScalar(x.dot(this.unitZ)),z.add(A)),x.copy(z),x.applyMatrix4(P.getInverse(X)),h.object.position.copy(L),h.object.position.add(x));else if("scale"==i)x.sub(T),x.multiply(N),"local"==h.space&&("XYZ"==h.axis?(b=1+x.y/50,h.object.scale.x=Y.x*b,h.object.scale.y=Y.y*b,h.object.scale.z=Y.z*b):(x.applyMatrix4(P.getInverse(B)),"X"==h.axis&&(h.object.scale.x=Y.x*(1+x.x/50)),"Y"==h.axis&&(h.object.scale.y=Y.y*(1+x.y/50)),"Z"==h.axis&&(h.object.scale.z=Y.z*(1+x.z/50))));else if("rotate"==i){if(x.sub(Z),x.multiply(N),z.copy(T).sub(Z),z.multiply(N),"RE"==h.axis){x.applyMatrix4(P.getInverse(_)),z.applyMatrix4(P.getInverse(_)),R.set(Math.atan2(x.z,x.y),Math.atan2(x.x,x.z),Math.atan2(x.y,x.x)),M.set(Math.atan2(z.z,z.y),Math.atan2(z.x,z.z),Math.atan2(z.y,z.x)),k.setFromRotationMatrix(P.getInverse(X));var o=R.z-M.z;if(null!==h.snap){var a=Math.round(o/h.snap)*h.snap;Math.abs(a-o)<h.snapDelta&&(o=a)}V.setFromAxisAngle(H,o),I.setFromRotationMatrix(B),k.multiplyQuaternions(k,V),k.multiplyQuaternions(k,I),h.object.quaternion.copy(k)}else if("RXYZE"==h.axis){var s=x.clone().cross(z).normalize();k.setFromRotationMatrix(P.getInverse(X));var c=-x.clone().angleTo(z);if(null!==h.snap){var a=Math.round(c/h.snap)*h.snap;Math.abs(a-c)<h.snapDelta&&(c=a)}j.setFromAxisAngle(s,c),I.setFromRotationMatrix(B),k.multiplyQuaternions(k,j),k.multiplyQuaternions(k,I),h.object.quaternion.copy(k)}else if("local"==h.space){x.applyMatrix4(P.getInverse(B)),z.applyMatrix4(P.getInverse(B));var u=x.dot(this.unitX),l=x.dot(this.unitY),v=x.dot(this.unitZ),y=z.dot(this.unitX),E=z.dot(this.unitY),g=z.dot(this.unitZ);R.set(Math.atan2(v,l),Math.atan2(u,v),Math.atan2(l,u)),M.set(Math.atan2(g,E),Math.atan2(y,g),Math.atan2(E,y));var w=R.x-M.x,D=R.y-M.y,o=R.z-M.z;if(null!==h.snap){if(h.axis.search("X")!=-1){var a=Math.round(w/h.snap)*h.snap;Math.abs(a-w)<h.snapDelta&&(w=a)}if(h.axis.search("Y")!=-1){var a=Math.round(D/h.snap)*h.snap;Math.abs(a-D)<h.snapDelta&&(D=a)}if(h.axis.search("Z")!=-1){var a=Math.round(o/h.snap)*h.snap;Math.abs(a-o)<h.snapDelta&&(o=a)}}j.setFromAxisAngle(this.unitX,w),O.setFromAxisAngle(this.unitY,D),S.setFromAxisAngle(this.unitZ,o),I.setFromRotationMatrix(F),"RX"==h.axis&&I.multiplyQuaternions(I,j),"RY"==h.axis&&I.multiplyQuaternions(I,O),"RZ"==h.axis&&I.multiplyQuaternions(I,S),h.object.quaternion.copy(I)}else if("world"==h.space){var u=x.dot(this.unitX),l=x.dot(this.unitY),v=x.dot(this.unitZ),y=z.dot(this.unitX),E=z.dot(this.unitY),g=z.dot(this.unitZ);R.set(Math.atan2(v,l),Math.atan2(u,v),Math.atan2(l,u)),M.set(Math.atan2(g,E),Math.atan2(y,g),Math.atan2(E,y)),k.setFromRotationMatrix(P.getInverse(X));var w=R.x-M.x,D=R.y-M.y,o=R.z-M.z;if(null!==h.snap){if(h.axis.search("X")!=-1){var a=Math.round(w/h.snap)*h.snap;Math.abs(a-w)<h.snapDelta&&(w=a)}if(h.axis.search("Y")!=-1){var a=Math.round(D/h.snap)*h.snap;Math.abs(a-D)<h.snapDelta&&(D=a)}if(h.axis.search("Z")!=-1){var a=Math.round(o/h.snap)*h.snap;Math.abs(a-o)<h.snapDelta&&(o=a)}}j.setFromAxisAngle(this.unitX,w),O.setFromAxisAngle(this.unitY,D),S.setFromAxisAngle(this.unitZ,o),I.setFromRotationMatrix(B),"RX"==h.axis&&k.multiplyQuaternions(k,j),"RY"==h.axis&&k.multiplyQuaternions(k,O),"RZ"==h.axis&&k.multiplyQuaternions(k,S),k.multiplyQuaternions(k,I),h.object.quaternion.copy(k)}"transrotate"===p&&(h.add(h.endLine),h.add(h.centerMark))}return h.object.matrixAutoUpdate=!0,h.update(!0),h.dispatchEvent(d),h.dispatchEvent(m),!!n},this.onPointerUp=function(t){return f&&null!==h.axis&&(y.mode=p,h.dispatchEvent(y)),f=!1,this.gizmo[p].show(),this.updateUnitVectors(),"transrotate"===p&&"rotate"===this.gizmo[p].activeMode&&(this.remove(this.endLine),this.remove(this.centerMark),this.parent.remove(this.centerLine),this.parent.remove(this.startLine),this.parent.remove(this.ticks[this.axis])),!1}},THREE.TransformControls.prototype=(0,o.default)(THREE.Object3D.prototype)}()},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(157),o=r(i),a=n(14),s=r(a),c=n(11),u=r(c),l=n(12),h=r(l),f=n(17),p=r(f),d=n(16),v=r(d),y=n(42),m=r(y),E=function(t){function e(t){(0,u.default)(this,e);var n=(0,p.default)(this,(e.__proto__||(0,s.default)(e)).call(this));return n.keys={},n.active=!1,n.viewer=t,n.fullTransform=!1,n.viewer.toolController.registerTool(n),n.onAggregateSelectionChangedHandler=function(t){n.onAggregateSelectionChanged(t)},n}return(0,v.default)(e,t),(0,h.default)(e,[{key:"enable",value:function(t){var e=this.getName();t?this.viewer.toolController.activateTool(e):this.viewer.toolController.deactivateTool(e)}},{key:"getNames",value:function(){return["Viewing.Rotate.Tool"]}},{key:"getName",value:function(){return"Viewing.Rotate.Tool"}},{key:"activate",value:function(){this.active||(this.active=!0,this.viewer.addEventListener(Autodesk.Viewing.AGGREGATE_SELECTION_CHANGED_EVENT,this.onAggregateSelectionChangedHandler))}},{key:"deactivate",value:function(){this.active&&(this.active=!1,this.rotateControl&&(this.rotateControl.remove(),this.rotateControl=null),this.viewer.removeEventListener(Autodesk.Viewing.AGGREGATE_SELECTION_CHANGED_EVENT,this.onAggregateSelectionChangedHandler))}},{key:"onAggregateSelectionChanged",value:function(t){if(this.rotateControl&&this.rotateControl.engaged)return this.rotateControl.engaged=!1,void this.viewer.select(this.selection.dbIdArray);if(t.selections&&t.selections.length){var e=t.selections[0];if(this.selection=e,this.emit("transform.modelSelected",this.selection),this.fullTransform){this.selection.fragIdsArray=[];for(var n=e.model.getFragmentList().fragments.fragId2dbId.length,r=0;r<n;++r)this.selection.fragIdsArray.push(r);this.selection.dbIdArray=[];var i=e.model.getData().instanceTree,o=i.getRootId();this.selection.dbIdArray.push(o)}this.drawControl(),this.viewer.fitToView(this.selection.dbIdArray)}else this.clearSelection()}},{key:"clearSelection",value:function(){this.selection=null,this.rotateControl&&(this.rotateControl.remove(),this.rotateControl=null,this.viewer.impl.sceneUpdated(!0))}},{key:"drawControl",value:function(){var t=this,e=this.geWorldBoundingBox(this.selection.fragIdsArray,this.selection.model.getFragmentList());this.center=new THREE.Vector3((e.min.x+e.max.x)/2,(e.min.y+e.max.y)/2,(e.min.z+e.max.z)/2);var n=.8*Math.max(e.max.x-e.min.x,e.max.y-e.min.y,e.max.z-e.min.z);this.rotateControl&&this.rotateControl.remove(),this.rotateControl=new g(this.viewer,this.center,n),this.rotateControl.on("transform.rotate",function(e){t.rotateFragments(t.selection.model,t.selection.fragIdsArray,e.axis,e.angle,t.center),t.viewer.impl.sceneUpdated(!0)})}},{key:"handleButtonDown",value:function(t,e){return!(!this.rotateControl||!this.rotateControl.onPointerDown(t))||!(0!==e||!this.keys.Control)&&(this.isDragging=!0,this.mousePos={x:t.clientX,y:t.clientY},!0)}},{key:"handleButtonUp",value:function(t,e){return this.rotateControl&&this.rotateControl.onPointerUp(t),0===e&&(this.isDragging=!1),!1}},{key:"handleMouseMove",value:function(t){if(this.rotateControl&&this.rotateControl.onPointerHover(t),this.isDragging){if(this.selection){var e={x:this.mousePos.x-t.clientX,y:t.clientY-this.mousePos.y};this.mousePos={x:t.clientX,y:t.clientY};var n=Math.sqrt(e.x*e.x+e.y*e.y),r=new THREE.Vector3,i=new THREE.Vector3,o=new THREE.Vector3,a=new THREE.Vector3,s=this.viewer.getCamera(),c=new THREE.Vector3,u=new THREE.Vector3;u.copy(s.position).sub(s.target),o.copy(u).normalize(),a.copy(s.up).normalize(),r.crossVectors(a,o).normalize(),a.setLength(e.y),r.setLength(e.x),i.copy(a.add(r)),c.crossVectors(i,u).normalize(),this.rotateFragments(this.selection.model,this.selection.fragIdsArray,c,n*Math.PI/180,this.center),this.viewer.impl.sceneUpdated(!0)}return!0}return!1}},{key:"handleKeyDown",value:function(t,e){return this.keys[t.key]=!0,!1}},{key:"handleKeyUp",value:function(t,e){return this.keys[t.key]=!1,!1}},{key:"rotateFragments",value:function(t,e,n,r,i){var o=this,a=new THREE.Quaternion;a.setFromAxisAngle(n,r),e.forEach(function(e,n){var r=o.viewer.impl.getFragmentProxy(t,e);r.getAnimTransform();var s=new THREE.Vector3(r.position.x-i.x,r.position.y-i.y,r.position.z-i.z);if(s.applyQuaternion(a),s.add(i),r.position=s,r.quaternion.multiplyQuaternions(a,r.quaternion),0===n){var c=new THREE.Euler;c.setFromQuaternion(r.quaternion,0),o.emit("transform.rotate",{rotation:c,model:t})}r.updateAnimTransform()})}},{key:"geWorldBoundingBox",value:function(t,e){var n=new THREE.Box3,r=new THREE.Box3;return t.forEach(function(t){e.getWorldBounds(t,n),r.union(n)}),r}}]),e}(m.default);e.default=E;var g=function(t){function e(t,n,r){(0,u.default)(this,e);var i=(0,p.default)(this,(e.__proto__||(0,s.default)(e)).call(this));i.engaged=!1,i.overlayScene="rotateControlScene",i.domElement=t.impl.canvas,i.camera=t.impl.camera,i.viewer=t,i.center=n,i.size=r,i.gizmos=[],i.viewer.impl.createOverlayScene(i.overlayScene),i.createAxis(n,new THREE.Vector3(1,0,0),.85*r,16711680),i.createAxis(n,new THREE.Vector3(0,1,0),.85*r,65280),i.createAxis(n,new THREE.Vector3(0,0,1),.85*r,255),i.camera.worldup.y?(i.gizmos.push(i.createGizmo(n,new THREE.Euler(0,Math.PI/2,0),.0045*r,.8*r,16711680,Math.PI,new THREE.Vector3(1,0,0))),i.gizmos.push(i.createGizmo(n,new THREE.Euler(Math.PI/2,0,0),.0045*r,.8*r,65280,2*Math.PI,new THREE.Vector3(0,1,0))),i.gizmos.push(i.createGizmo(n,new THREE.Euler(0,0,0),.0045*r,.8*r,255,Math.PI,new THREE.Vector3(0,0,1)))):(i.gizmos.push(i.createGizmo(n,new THREE.Euler(Math.PI/2,Math.PI/2,0),.0045*r,.8*r,16711680,Math.PI,new THREE.Vector3(1,0,0))),i.gizmos.push(i.createGizmo(n,new THREE.Euler(Math.PI/2,0,0),.0045*r,.8*r,65280,Math.PI,new THREE.Vector3(0,1,0))),i.gizmos.push(i.createGizmo(n,new THREE.Euler(0,0,0),.0045*r,.8*r,255,2*Math.PI,new THREE.Vector3(0,0,1)))),i.picker=i.createSphere(.02*r);var o=new THREE.LineBasicMaterial({color:16776960,linewidth:1,depthTest:!1,depthWrite:!1,transparent:!0});return i.angleLine=i.createLine(i.center,i.center,o),t.impl.sceneUpdated(!0),i}return(0,v.default)(e,t),(0,h.default)(e,[{key:"createLine",value:function(t,e,n){var r=new THREE.Geometry;r.vertices.push(new THREE.Vector3(t.x,t.y,t.z)),r.vertices.push(new THREE.Vector3(e.x,e.y,e.z));var i=new THREE.Line(r,n);return this.viewer.impl.addOverlay(this.overlayScene,i),i}},{key:"createCone",value:function(t,e,n,r){e.normalize();var i={x:t.x+e.x*n,y:t.y+e.y*n,z:t.z+e.z*n},o=new THREE.Matrix4;o.lookAt(t,i,(new THREE.Object3D).up);var a=new THREE.Matrix4;a.set(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1),o.multiply(a);var s=new THREE.CylinderGeometry(0,.2*n,n,128,1),c=new THREE.Mesh(s,r);return c.applyMatrix(o),c.position.x=t.x+e.x*n/2,c.position.y=t.y+e.y*n/2,c.position.z=t.z+e.z*n/2,this.viewer.impl.addOverlay(this.overlayScene,c),c}},{key:"createAxis",value:function(t,e,n,r){var i={x:t.x+e.x*n,y:t.y+e.y*n,z:t.z+e.z*n},o=new THREE.LineBasicMaterial({color:r,linewidth:3,depthTest:!1,depthWrite:!1,transparent:!0});this.createLine(t,i,o),this.createCone(i,e,.1*n,o)}},{key:"createGizmo",value:function(t,e,n,r,i,o,a){var s=new w({color:i}),c=new w({color:i}),u=new THREE.Mesh(new THREE.TorusGeometry(r,n,64,64,o),s),l=new THREE.Mesh(new THREE.TorusGeometry(r,n,64,64,2*Math.PI),c);l.material.highlight(!0);var h=new THREE.Matrix4,f=new THREE.Quaternion;f.setFromEuler(e);var p=new THREE.Vector3(1,1,1);h.compose(t,f,p),u.applyMatrix(h),l.applyMatrix(h);var d=this.createBox(100*this.size,100*this.size,.01);return d.applyMatrix(h),l.visible=!1,this.viewer.impl.addOverlay(this.overlayScene,u),this.viewer.impl.addOverlay(this.overlayScene,l),u.subGizmo=l,u.plane=d,u.axis=a,u}},{key:"createBox",value:function(t,e,n){var r=new w({color:0}),i=new THREE.BoxGeometry(t,e,n),o=new THREE.Mesh(i,r);return o.visible=!1,this.viewer.impl.addOverlay(this.overlayScene,o),o}},{key:"createSphere",value:function(t){var e=new w({color:16776960}),n=new THREE.SphereGeometry(t,32,32),r=new THREE.Mesh(n,e);return r.visible=!1,this.viewer.impl.addOverlay(this.overlayScene,r),r}},{key:"pointerToRaycaster",value:function(t){var e=new THREE.Vector3,n=new THREE.Vector3,r=new THREE.Raycaster,i=this.domElement.getBoundingClientRect(),o=(t.clientX-i.left)/i.width*2-1,a=2*-((t.clientY-i.top)/i.height)+1;return this.camera.isPerspective?(e.set(o,a,.5),e.unproject(this.camera),r.set(this.camera.position,e.sub(this.camera.position).normalize())):(e.set(o,a,-1),e.unproject(this.camera),n.set(0,0,-1),r.set(e,n.transformDirection(this.camera.matrixWorld))),r}},{key:"onPointerDown",value:function(t){var e=t.pointers?t.pointers[0]:t;if(0===e.button){var n=this.pointerToRaycaster(e),r=n.intersectObjects(this.gizmos,!0);r.length?(this.gizmos.forEach(function(t){t.visible=!1}),this.selectedGizmo=r[0].object,this.selectedGizmo.subGizmo.visible=!0,this.picker.position.copy(r[0].point),this.angleLine.geometry.vertices[1].copy(r[0].point),this.lastDir=r[0].point.sub(this.center).normalize(),this.angleLine.geometry.verticesNeedUpdate=!0,this.angleLine.visible=!0,this.picker.visible=!0):this.picker.visible=!1,this.engaged=this.picker.visible,this.viewer.impl.sceneUpdated(!0)}return this.picker.visible}},{key:"onPointerHover",value:function(t){var e=t.pointers?t.pointers[0]:t;if(this.engaged){var n=this.pointerToRaycaster(e),r=n.intersectObjects([this.selectedGizmo.plane],!0);if(r.length){var i=r[0].point,a=i.sub(this.center).normalize(),s=new THREE.Vector3;s.crossVectors(this.lastDir,a);var c=(0,o.default)(s.dot(this.selectedGizmo.axis));this.emit("transform.rotate",{angle:c*a.angleTo(this.lastDir),axis:this.selectedGizmo.axis}),this.lastDir=a;var u=new THREE.Vector3(this.center.x+a.x*this.size*.8,this.center.y+a.y*this.size*.8,this.center.z+a.z*this.size*.8);this.picker.position.copy(u),this.angleLine.geometry.vertices[1].copy(u)}this.angleLine.visible=!0,this.angleLine.geometry.verticesNeedUpdate=!0}else{this.angleLine.visible=!1;var n=this.pointerToRaycaster(e),r=n.intersectObjects(this.gizmos,!0);r.length?(this.picker.position.set(r[0].point.x,r[0].point.y,r[0].point.z),this.picker.visible=!0):this.picker.visible=!1}this.viewer.impl.sceneUpdated(!0)}},{key:"onPointerUp",value:function(t){var e=this;this.angleLine.visible=!1,this.picker.visible=!1,this.gizmos.forEach(function(t){t.visible=!0,t.subGizmo.visible=!1}),this.viewer.impl.sceneUpdated(!0),setTimeout(function(){e.engaged=!1},100)}},{key:"normalize",value:function(t){var e=this.viewer.navigation.getScreenViewport(),n={x:(t.x-e.left)/e.width,y:(t.y-e.top)/e.height};return n}},{key:"projectOntoPlane",value:function(t,e){var n=e.dot(t);return new THREE.Vector3(t.x-n*e.x,t.y-n*e.y,t.z-n*e.z)}},{key:"remove",value:function(){this.viewer.impl.removeOverlayScene(this.overlayScene)}}]),e}(m.default),w=function(t){function e(t){(0,u.default)(this,e);var n=(0,p.default)(this,(e.__proto__||(0,s.default)(e)).call(this));return n.setValues(t),n.colorInit=n.color.clone(),n.opacityInit=n.opacity,n.side=THREE.FrontSide,n.depthWrite=!1,n.transparent=!0,n.depthTest=!1,n}return(0,v.default)(e,t),(0,h.default)(e,[{key:"highlight",value:function(t){t?(this.color.setRGB(1,230/255,3/255),this.opacity=1):(this.color.copy(this.colorInit),this.opacity=this.opacityInit)}}]),e}(THREE.MeshBasicMaterial)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(14),o=r(i),a=n(11),s=r(a),c=n(12),u=r(c),l=n(17),h=r(l),f=n(16),p=r(f),d=n(42),v=r(d);n(211);var y=function(t){function e(t){(0,s.default)(this,e);var n=(0,h.default)(this,(e.__proto__||(0,o.default)(e)).call(this));return n.active=!1,n._viewer=t,n._hitPoint=null,n._isDragging=!1,n.fullTransform=!1,n._transformMesh=null,n._transformControlTx=null,n._selectedFragProxyMap={},n.onTxChange=n.onTxChange.bind(n),n.onAggregateSelectionChanged=n.onAggregateSelectionChanged.bind(n),n.onCameraChanged=n.onCameraChanged.bind(n),
n}return(0,p.default)(e,t),(0,u.default)(e,[{key:"getNames",value:function(){return["Viewing.Transform.Tool"]}},{key:"getName",value:function(){return"Viewing.Transform.Tool"}},{key:"createTransformMesh",value:function(){var t=new THREE.MeshPhongMaterial({color:16711680});this._viewer.impl.matman().addMaterial("transform-tool-material",t,!0);var e=new THREE.Mesh(new THREE.SphereGeometry(1e-4,5),t);return e.position.set(0,0,0),e}},{key:"onTxChange",value:function(){if(this._isDragging&&this._transformControlTx.visible){var t=new THREE.Vector3(this._transformMesh.position.x-this._selection.model.offset.x,this._transformMesh.position.y-this._selection.model.offset.y,this._transformMesh.position.z-this._selection.model.offset.z);for(var e in this._selectedFragProxyMap){var n=this._selectedFragProxyMap[e],r=new THREE.Vector3(this._transformMesh.position.x-n.offset.x,this._transformMesh.position.y-n.offset.y,this._transformMesh.position.z-n.offset.z);n.position=r,n.updateAnimTransform()}this.emit("transform.translate",{model:this._selection.model,translation:t})}this._viewer.impl.sceneUpdated(!0)}},{key:"onCameraChanged",value:function(){this._transformControlTx&&this._transformControlTx.update()}},{key:"onAggregateSelectionChanged",value:function(t){if(t.selections&&t.selections.length){if(this._selection=t.selections[0],this.fullTransform){this._selection.fragIdsArray=[];for(var e=this._selection.model.getFragmentList().fragments.fragId2dbId.length,n=0;n<e;++n)this._selection.fragIdsArray.push(n);this._selection.dbIdArray=[];var r=this._selection.model.getData().instanceTree,i=r.getRootId();this._selection.dbIdArray.push(i)}this.emit("transform.modelSelected",this._selection),this.initializeSelection(this._hitPoint)}else this.clearSelection()}},{key:"initializeSelection",value:function(t){var e=this;this._selectedFragProxyMap={};var n=this._selection.model.transform||{translation:{x:0,y:0,z:0}};this._selection.model.offset={x:t.x-n.translation.x,y:t.y-n.translation.y,z:t.z-n.translation.z},this._transformControlTx.visible=!0,this._transformControlTx.setPosition(t),this._transformControlTx.addEventListener("change",this.onTxChange),this._viewer.addEventListener(Autodesk.Viewing.CAMERA_CHANGE_EVENT,this.onCameraChanged),this._selection.fragIdsArray.forEach(function(n){var r=e._viewer.impl.getFragmentProxy(e._selection.model,n);r.getAnimTransform(),r.offset={x:t.x-r.position.x,y:t.y-r.position.y,z:t.z-r.position.z},e._selectedFragProxyMap[n]=r})}},{key:"clearSelection",value:function(){this.active&&(this._selection=null,this._selectedFragProxyMap={},this._transformControlTx.visible=!1,this._transformControlTx.removeEventListener("change",this.onTxChange),this._viewer.removeEventListener(Autodesk.Viewing.CAMERA_CHANGE_EVENT,this.onCameraChanged),this._viewer.impl.sceneUpdated(!0))}},{key:"normalize",value:function(t){var e=this._viewer.navigation.getScreenViewport(),n={x:(t.x-e.left)/e.width,y:(t.y-e.top)/e.height};return n}},{key:"getHitPoint",value:function(t){var e={x:t.clientX,y:t.clientY},n=this.normalize(e),r=this._viewer.utilities.getHitPoint(n.x,n.y);return r}},{key:"activate",value:function(){if(!this.active){this.active=!0,this._viewer.select([]);var t=this._viewer.model.getBoundingBox();this._viewer.impl.createOverlayScene("TransformToolOverlay"),this._transformControlTx=new THREE.TransformControls(this._viewer.impl.camera,this._viewer.impl.canvas,"translate"),this._transformControlTx.setSize(5*t.getBoundingSphere().radius),this._transformControlTx.visible=!1,this._viewer.impl.addOverlay("TransformToolOverlay",this._transformControlTx),this._transformMesh=this.createTransformMesh(),this._transformControlTx.attach(this._transformMesh),this._viewer.addEventListener(Autodesk.Viewing.AGGREGATE_SELECTION_CHANGED_EVENT,this.onAggregateSelectionChanged)}}},{key:"deactivate",value:function(){this.active&&(this.active=!1,this._viewer.impl.removeOverlay("TransformToolOverlay",this._transformControlTx),this._transformControlTx.removeEventListener("change",this.onTxChange),this._viewer.impl.removeOverlayScene("TransformToolOverlay"),this._viewer.removeEventListener(Autodesk.Viewing.CAMERA_CHANGE_EVENT,this.onCameraChanged),this._viewer.removeEventListener(Autodesk.Viewing.AGGREGATE_SELECTION_CHANGED_EVENT,this.onAggregateSelectionChanged))}},{key:"handleButtonDown",value:function(t,e){return this._hitPoint=this.getHitPoint(t),this._isDragging=!0,!!this._transformControlTx.onPointerDown(t)}},{key:"handleButtonUp",value:function(t,e){return this._isDragging=!1,!!this._transformControlTx.onPointerUp(t)}},{key:"handleMouseMove",value:function(t){return this._isDragging?!!this._transformControlTx.onPointerMove(t):!!this._transformControlTx.onPointerHover(t)}}]),e}(v.default);e.default=y}])});