mxdraw 0.1.21 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/MxModule/McEdGetPointWorldDrawObject/McEdGetPointWorldDrawObjectClass.js +1 -128
- package/dist/lib/MxModule/McEdGetPointWorldDrawObject/index.js +1 -5
- package/dist/lib/MxModule/McGePoint3d/McGePoint3d.js +1 -0
- package/dist/lib/MxModule/McGePoint3d/index.js +1 -0
- package/dist/lib/MxModule/McGePoint3dArray/McGePoint3dArray.js +1 -0
- package/dist/lib/MxModule/McGePoint3dArray/index.js +1 -0
- package/dist/lib/MxModule/McGeTool/McGeTool.js +1 -0
- package/dist/lib/MxModule/McGeTool/index.js +1 -0
- package/dist/lib/MxModule/McGiWorldDraw/McGiWorldDraw.js +1 -3
- package/dist/lib/MxModule/McGiWorldDraw/index.js +1 -2
- package/dist/lib/MxModule/McGiWorldDrawType/McGiWorldDrawType.js +1 -19
- package/dist/lib/MxModule/McGiWorldDrawType/index.js +1 -4
- package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/MrxDbgUiPrBaseReturn.js +1 -31
- package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/index.js +1 -5
- package/dist/lib/MxModule/MrxDbgUiPrPoint/MrxDbgUiPrPointClass.js +1 -159
- package/dist/lib/MxModule/MrxDbgUiPrPoint/index.js +1 -5
- package/dist/lib/MxModule/Mx3PointArc/Mx3PointArc.js +1 -0
- package/dist/lib/MxModule/Mx3PointArc/index.js +1 -0
- package/dist/lib/MxModule/MxDb2LineAngularDimension/MxDb2LineAngularDimension.js +1 -0
- package/dist/lib/MxModule/MxDb2LineAngularDimension/index.js +1 -0
- package/dist/lib/MxModule/MxDbAlignedDimension/MxDbAlignedDimension.js +1 -213
- package/dist/lib/MxModule/MxDbAlignedDimension/index.js +1 -5
- package/dist/lib/MxModule/MxDbAnyLine/MxDbAnyLine.js +1 -0
- package/dist/lib/MxModule/MxDbAnyLine/index.js +1 -0
- package/dist/lib/MxModule/MxDbArea/MxDbArea.js +1 -0
- package/dist/lib/MxModule/MxDbArea/index.js +1 -0
- package/dist/lib/MxModule/MxDbCoord/MxDbCoord.js +1 -0
- package/dist/lib/MxModule/MxDbCoord/index.js +1 -0
- package/dist/lib/MxModule/MxDbEntity/MxDbEntity.js +1 -258
- package/dist/lib/MxModule/MxDbEntity/index.js +1 -5
- package/dist/lib/MxModule/MxDbImage/MxDbImage.js +1 -160
- package/dist/lib/MxModule/MxDbImage/index.js +1 -5
- package/dist/lib/MxModule/MxDbLine/MxDbLine.js +1 -94
- package/dist/lib/MxModule/MxDbLine/index.js +1 -5
- package/dist/lib/MxModule/MxDbPolyline/MxDbPolyline.js +1 -97
- package/dist/lib/MxModule/MxDbPolyline/index.js +1 -5
- package/dist/lib/MxModule/MxDbRect/MxDbRect.js +1 -273
- package/dist/lib/MxModule/MxDbRect/index.js +1 -4
- package/dist/lib/MxModule/MxDbSVG/MxDbSVG.js +1 -419
- package/dist/lib/MxModule/MxDbSVG/index.js +1 -5
- package/dist/lib/MxModule/MxDbSVGText/MxDbSVGText.js +1 -21
- package/dist/lib/MxModule/MxDbSVGText/index.js +1 -5
- package/dist/lib/MxModule/MxDrawObject/MxDrawObject.js +1 -782
- package/dist/lib/MxModule/MxDrawObject/index.js +1 -5
- package/dist/lib/MxModule/MxFilters/MxFilters.js +1 -201
- package/dist/lib/MxModule/MxFilters/index.js +1 -4
- package/dist/lib/MxModule/MxFun/MxFun.js +1 -676
- package/dist/lib/MxModule/MxFun/index.js +1 -4
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.js +1 -283
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.mixin.js +1 -146
- package/dist/lib/MxModule/MxThreeJS/index.js +1 -7
- package/dist/lib/MxModule/MxType/MxType.js +1 -27
- package/dist/lib/MxModule/MxType/index.js +1 -4
- package/dist/lib/MxModule/Mxassembly/Mxassembly.js +1 -20
- package/dist/lib/MxModule/Mxassembly/index.js +1 -9
- package/dist/lib/MxModule/loadCoreCode/index.js +1 -5
- package/dist/lib/MxModule/loadCoreCode/loadCoreCode.js +1 -125
- package/dist/lib/MxModule/loadCoreCode/mxUiData.js +1 -312
- package/dist/lib/MxModule/loadCoreCode/mxcadassembly_es5.js +1 -1519
- package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +1 -7363
- package/dist/lib/MxModule/store/PubsubClass.js +1 -40
- package/dist/lib/MxModule/store/StoreClass.js +1 -73
- package/dist/lib/MxModule/store/index.js +1 -19
- package/dist/lib/MxModule/store/store.js +1 -25
- package/dist/lib/MxModule/useCanvasResizeListener/index.js +1 -5
- package/dist/lib/MxModule/useCanvasResizeListener/useCanvasResizeListener.js +1 -95
- package/dist/lib/doc.js +1 -38
- package/dist/lib/mxdraw.js +1 -67
- package/dist/lib/tools/algorithm/math.js +1 -16
- package/dist/lib/tools/algorithm/random.js +1 -13
- package/dist/lib/tools/dom/create.js +1 -47
- package/dist/lib/tools/dynamicImport/index.js +1 -243
- package/dist/lib/tools/formatting/index.js +1 -20
- package/dist/lib/tools/proxy/index.js +1 -17
- package/dist/lib/tools/three/index.js +1 -124
- package/dist/mxdraw.es5.js +1 -0
- package/dist/mxdraw.umd.js +1 -0
- package/dist/types/MxModule/McEdGetPointWorldDrawObject/McEdGetPointWorldDrawObjectClass.d.ts +9 -0
- package/dist/types/MxModule/McGePoint3d/McGePoint3d.d.ts +11 -0
- package/dist/types/MxModule/McGePoint3d/index.d.ts +3 -0
- package/dist/types/MxModule/McGePoint3dArray/McGePoint3dArray.d.ts +14 -0
- package/dist/types/MxModule/McGePoint3dArray/index.d.ts +3 -0
- package/dist/types/MxModule/McGeTool/McGeTool.d.ts +38 -0
- package/dist/types/MxModule/McGeTool/index.d.ts +4 -0
- package/dist/types/MxModule/MrxDbgUiPrPoint/MrxDbgUiPrPointClass.d.ts +18 -1
- package/dist/types/MxModule/Mx3PointArc/Mx3PointArc.d.ts +19 -0
- package/dist/types/MxModule/Mx3PointArc/index.d.ts +3 -0
- package/dist/types/MxModule/MxDb2LineAngularDimension/MxDb2LineAngularDimension.d.ts +22 -0
- package/dist/types/MxModule/MxDb2LineAngularDimension/index.d.ts +3 -0
- package/dist/types/MxModule/MxDbAnyLine/MxDbAnyLine.d.ts +18 -0
- package/dist/types/MxModule/MxDbAnyLine/index.d.ts +3 -0
- package/dist/types/MxModule/MxDbArea/MxDbArea.d.ts +17 -0
- package/dist/types/MxModule/MxDbArea/index.d.ts +3 -0
- package/dist/types/MxModule/MxDbCoord/MxDbCoord.d.ts +19 -0
- package/dist/types/MxModule/MxDbCoord/index.d.ts +3 -0
- package/dist/types/MxModule/MxDrawObject/MxDrawObject.d.ts +70 -1
- package/dist/types/MxModule/MxFun/MxFun.d.ts +95 -30
- package/dist/types/MxModule/Mxassembly/Mxassembly.d.ts +11 -2
- package/dist/types/MxModule/store/store.d.ts +2 -2
- package/dist/types/mxdraw.d.ts +17 -4
- package/dist/types/tools/three/index.d.ts +28 -1
- package/package.json +3 -2
- package/dist/lib/MxModule/McGeVector3d/McGeVector3d.js +0 -2
- package/dist/lib/MxModule/McGeVector3d/index.js +0 -3
- package/dist/lib/MxModule/MxThreeJS/SVGLoader.js +0 -1862
- package/dist/lib/types/McEdGetPointWorldDrawObject.js +0 -2
- package/dist/lib/types/MrxDbgUiPrPoint.js +0 -2
- package/dist/lib/types/MxCADObject.js +0 -2
- package/dist/lib/types/MxDrawObject.js +0 -2
- package/dist/lib/types/MxFun.js +0 -2
- package/dist/lib/types/Mxassembly.js +0 -2
- package/dist/types/MxModule/McGeVector3d/McGeVector3d.d.ts +0 -17
- package/dist/types/MxModule/McGeVector3d/index.d.ts +0 -3
- package/dist/types/MxModule/MxThreeJS/SVGLoader.d.ts +0 -22
- package/dist/types/types/McEdGetPointWorldDrawObject.d.ts +0 -9
- package/dist/types/types/MrxDbgUiPrPoint.d.ts +0 -23
- package/dist/types/types/MxCADObject.d.ts +0 -40
- package/dist/types/types/MxDrawObject.d.ts +0 -60
- package/dist/types/types/MxFun.d.ts +0 -47
- package/dist/types/types/Mxassembly.d.ts +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Mx={})}(this,function(exports){"use strict";var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function __awaiter(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}l((r=r.apply(e,t||[])).next())})}function __generator(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function __spreadArray(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function dynamicImport(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(n){switch(n.label){case 0:switch(e){case"jquery":return[3,1];case"element-resize-event-polyfill":return[3,3]}return[3,5];case 1:return[4,dynamicImportJquery()];case 2:return t=n.sent(),[3,5];case 3:return[4,dynamicImportResize()];case 4:return t=n.sent(),[3,5];case 5:return[2,t]}})})}function dynamicImportResize(){return __awaiter(this,void 0,void 0,function(){var e,t;return __generator(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Promise.resolve().then(function(){return elementResizeEventPolyfill_umd_min$2})];case 1:return(e=n.sent()).default?[2,e.default]:[2,e];case 2:return t=n.sent(),console.log("import动态导入:element-resize-event-polyfill失败!",t),[3,3];case 3:return[2]}})})}function dynamicImportJquery(){return __awaiter(this,void 0,void 0,function(){var e,t;return __generator(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Promise.resolve().then(function(){return jquery$1})];case 1:return(e=n.sent()).default?[2,e.default]:[2,e];case 2:return t=n.sent(),console.log("import动态导入:jquery失败!",t),[3,3];case 3:return[2]}})})}var _mapDynamicCreate=null;function intiDynamicCreateMxObject(){_mapDynamicCreate||((_mapDynamicCreate={}).MxDbArea=function(){return Promise.resolve().then(function(){return index$1})},_mapDynamicCreate.MxDbCoord=function(){return Promise.resolve().then(function(){return index$5})},_mapDynamicCreate.MxDb2LineAngularDimension=function(){return Promise.resolve().then(function(){return index$7})},_mapDynamicCreate.Mx3PointArc=function(){return Promise.resolve().then(function(){return index$6})},_mapDynamicCreate.MxDbAnyLine=function(){return Promise.resolve().then(function(){return index})})}function dynamicCreateMxObject(e){return __awaiter(this,void 0,void 0,function(){var t,n,r,i,a,o,s,l,c;return __generator(this,function(u){switch(u.label){case 0:switch(intiDynamicCreateMxObject(),e){case"MxDbSVG":return[3,1];case"MxDbImage":return[3,5];case"MxDbLine":return[3,9];case"MxDbRect":return[3,13];case"MxDbSVGText":return[3,17];case"MxDbPolyline":return[3,21];case"MxDbAlignedDimension":return[3,25]}return[3,29];case 1:return u.trys.push([1,3,,4]),[4,Promise.resolve().then(function(){return index$9})];case 2:return t=u.sent(),[3,4];case 3:return n=u.sent(),console.log("import:"+e+"error!",n),[3,4];case 4:return[3,29];case 5:return u.trys.push([5,7,,8]),[4,Promise.resolve().then(function(){return index$b})];case 6:return t=u.sent(),[3,8];case 7:return r=u.sent(),console.log("import:"+e+"error!",r),[3,8];case 8:return[3,29];case 9:return u.trys.push([9,11,,12]),[4,Promise.resolve().then(function(){return index$4})];case 10:return t=u.sent(),[3,12];case 11:return i=u.sent(),console.log("import:"+e+"error!",i),[3,12];case 12:return[3,29];case 13:return u.trys.push([13,15,,16]),[4,Promise.resolve().then(function(){return index$3})];case 14:return t=u.sent(),[3,16];case 15:return a=u.sent(),console.log("import:"+e+"error!",a),[3,16];case 16:return[3,29];case 17:return u.trys.push([17,19,,20]),[4,Promise.resolve().then(function(){return index$a})];case 18:return t=u.sent(),[3,20];case 19:return o=u.sent(),console.log("import:"+e+"error!",o),[3,20];case 20:return[3,29];case 21:return u.trys.push([21,23,,24]),[4,Promise.resolve().then(function(){return index$8})];case 22:return t=u.sent(),[3,24];case 23:return s=u.sent(),console.log("import:"+e+"error!",s),[3,24];case 24:return[3,29];case 25:return u.trys.push([25,27,,28]),[4,Promise.resolve().then(function(){return index$2})];case 26:return t=u.sent(),[3,28];case 27:return l=u.sent(),console.log("import:"+e+"error!",l),[3,28];case 28:return[3,29];case 29:if(t)return[3,33];if(!_mapDynamicCreate[e])return[3,33];u.label=30;case 30:return u.trys.push([30,32,,33]),[4,_mapDynamicCreate[e]()];case 31:return t=u.sent(),[3,33];case 32:return c=u.sent(),console.log("import:"+e+"error!",c),[3,33];case 33:return t?t.default?[2,t.default]:[2,t]:(console.log("mx dynmac load:"+e+" failed"),[2,null])}})})}var PubSub=function(){function e(){this.events={}}return e.prototype.on=function(e,t){return this.events.hasOwnProperty(e)||(this.events[e]=[]),this.events[e].push(t)},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return this.events.hasOwnProperty(e)?this.events[e].map(function(e){return e.apply(void 0,t)}):[]},e}(),Store=function(){function e(e){this.actions={},this.mutations={},this.state=e.state,this.status="resting",this.events=new PubSub,e.hasOwnProperty("actions")&&(this.actions=e.actions),e.hasOwnProperty("mutations")&&(this.mutations=e.mutations)}return e.prototype.dispatch=function(e,t){return"function"!=typeof this.actions[e]?(console.error('Action "'.concat(e," doesn't exist.")),!1):(console.groupCollapsed("ACTION: ".concat(e)),this.status="action",this.actions[e](this,t),console.groupEnd(),!0)},e.prototype.commit=function(e,t){if("function"!=typeof this.mutations[e])return console.log('Mutation "'.concat(e,"\" doesn't exist")),!1;this.status="mutation";var n=this.mutations[e](this.state,t);return this.state=Object.assign(this.state,n),!0},e}(),options={state:{MxFun:null,Mxassembly:null,isCreateDrawObj:!1},actions:{},mutations:{}},_loop_1=function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);options.mutations["set"+t]=function(t,n){t[e]=n}};for(var key in options.state)_loop_1(key);var store=new Store(options);function mxfun(){!function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[o]={exports:{}};t[o][0].call(u.exports,function(e){return i(t[o][1][e]||e)},u,u.exports,e,t,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){var r={};(0,e("./lib/utils/common").assign)(r,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=r},{"./lib/deflate":2,"./lib/inflate":3,"./lib/utils/common":4,"./lib/zlib/constants":7}],2:[function(e,t,n){var r=e("./zlib/deflate"),i=e("./utils/common"),a=e("./utils/strings"),o=e("./zlib/messages"),s=e("./zlib/zstream"),l=Object.prototype.toString,c=0,u=-1,h=0,p=8;function d(e){if(!(this instanceof d))return new d(e);this.options=i.assign({level:u,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:h,to:""},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==c)throw new Error(o[n]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){var f;if(f="string"==typeof t.dictionary?a.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(n=r.deflateSetDictionary(this.strm,f))!==c)throw new Error(o[n]);this._dict_set=!0}}function f(e,t){var n=new d(t);if(n.push(e,!0),n.err)throw n.msg||o[n.err];return n.result}d.prototype.push=function(e,t){var n,o,s=this.strm,u=this.options.chunkSize;if(this.ended)return!1;o=t===~~t?t:!0===t?4:0,"string"==typeof e?s.input=a.string2buf(e):"[object ArrayBuffer]"===l.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(u),s.next_out=0,s.avail_out=u),1!==(n=r.deflate(s,o))&&n!==c)return this.onEnd(n),!(this.ended=!0);0!==s.avail_out&&(0!==s.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(a.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((0<s.avail_in||0===s.avail_out)&&1!==n);return 4===o?(n=r.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===c):2!==o||(this.onEnd(c),!(s.avail_out=0))},d.prototype.onData=function(e){this.chunks.push(e)},d.prototype.onEnd=function(e){e===c&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Deflate=d,n.deflate=f,n.deflateRaw=function(e,t){return(t=t||{}).raw=!0,f(e,t)},n.gzip=function(e,t){return(t=t||{}).gzip=!0,f(e,t)}},{"./utils/common":4,"./utils/strings":5,"./zlib/deflate":9,"./zlib/messages":14,"./zlib/zstream":16}],3:[function(e,t,n){var r=e("./zlib/inflate"),i=e("./utils/common"),a=e("./utils/strings"),o=e("./zlib/constants"),s=e("./zlib/messages"),l=e("./zlib/zstream"),c=e("./zlib/gzheader"),u=Object.prototype.toString;function h(e){if(!(this instanceof h))return new h(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,t.windowBits);if(n!==o.Z_OK)throw new Error(s[n]);if(this.header=new c,r.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=a.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=r.inflateSetDictionary(this.strm,t.dictionary))!==o.Z_OK))throw new Error(s[n])}function p(e,t){var n=new h(t);if(n.push(e,!0),n.err)throw n.msg||s[n.err];return n.result}h.prototype.push=function(e,t){var n,s,l,c,h,p=this.strm,d=this.options.chunkSize,f=this.options.dictionary,m=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof e?p.input=a.binstring2buf(e):"[object ArrayBuffer]"===u.call(e)?p.input=new Uint8Array(e):p.input=e,p.next_in=0,p.avail_in=p.input.length;do{if(0===p.avail_out&&(p.output=new i.Buf8(d),p.next_out=0,p.avail_out=d),(n=r.inflate(p,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&f&&(n=r.inflateSetDictionary(this.strm,f)),n===o.Z_BUF_ERROR&&!0===m&&(n=o.Z_OK,m=!1),n!==o.Z_STREAM_END&&n!==o.Z_OK)return this.onEnd(n),!(this.ended=!0);p.next_out&&(0!==p.avail_out&&n!==o.Z_STREAM_END&&(0!==p.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(l=a.utf8border(p.output,p.next_out),c=p.next_out-l,h=a.buf2string(p.output,l),p.next_out=c,p.avail_out=d-c,c&&i.arraySet(p.output,p.output,l,c,0),this.onData(h)):this.onData(i.shrinkBuf(p.output,p.next_out)))),0===p.avail_in&&0===p.avail_out&&(m=!0)}while((0<p.avail_in||0===p.avail_out)&&n!==o.Z_STREAM_END);return n===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),!(p.avail_out=0))},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Inflate=h,n.inflate=p,n.inflateRaw=function(e,t){return(t=t||{}).raw=!0,p(e,t)},n.ungzip=p},{"./utils/common":4,"./utils/strings":5,"./zlib/constants":7,"./zlib/gzheader":10,"./zlib/inflate":12,"./zlib/messages":14,"./zlib/zstream":16}],4:[function(e,t,n){var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(e){for(var t,n,r=Array.prototype.slice.call(arguments,1);r.length;){var i=r.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var a in i)t=i,n=a,Object.prototype.hasOwnProperty.call(t,n)&&(e[a]=i[a])}}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),i);else for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){var t,n,r,i,a,o;for(t=r=0,n=e.length;t<n;t++)r+=e[t].length;for(o=new Uint8Array(r),t=i=0,n=e.length;t<n;t++)a=e[t],o.set(a,i),i+=a.length;return o}},a={arraySet:function(e,t,n,r,i){for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){return[].concat.apply([],e)}};n.setTyped=function(e){e?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,i)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,a))},n.setTyped(r)},{}],5:[function(e,t,n){var r=e("./common"),i=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){a=!1}for(var o=new r.Buf8(256),s=0;s<256;s++)o[s]=252<=s?6:248<=s?5:240<=s?4:224<=s?3:192<=s?2:1;function l(e,t){if(t<65534&&(e.subarray&&a||!e.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(e,t));for(var n="",o=0;o<t;o++)n+=String.fromCharCode(e[o]);return n}o[254]=o[254]=1,n.string2buf=function(e){var t,n,i,a,o,s=e.length,l=0;for(a=0;a<s;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<s&&56320==(64512&(i=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(i-56320),a++),l+=n<128?1:n<2048?2:n<65536?3:4;for(t=new r.Buf8(l),a=o=0;o<l;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<s&&56320==(64512&(i=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(i-56320),a++),n<128?t[o++]=n:(n<2048?t[o++]=192|n>>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t},n.buf2binstring=function(e){return l(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n<i;n++)t[n]=e.charCodeAt(n);return t},n.buf2string=function(e,t){var n,r,i,a,s=t||e.length,c=new Array(2*s);for(n=r=0;n<s;)if((i=e[n++])<128)c[r++]=i;else if(4<(a=o[i]))c[r++]=65533,n+=a-1;else{for(i&=2===a?31:3===a?15:7;1<a&&n<s;)i=i<<6|63&e[n++],a--;1<a?c[r++]=65533:i<65536?c[r++]=i:(i-=65536,c[r++]=55296|i>>10&1023,c[r++]=56320|1023&i)}return l(c,r)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return!(n<0)&&0!==n&&n+o[e[n]]>t?n:t}},{"./common":4}],6:[function(e,t,n){t.exports=function(e,t,n,r){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;0!==n;){for(n-=o=2e3<n?2e3:n;a=a+(i=i+t[r++]|0)|0,--o;);i%=65521,a%=65521}return i|a<<16|0}},{}],7:[function(e,t,n){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],8:[function(e,t,n){var r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var a=r,o=i+n;e^=-1;for(var s=i;s<o;s++)e=e>>>8^a[255&(e^t[s])];return-1^e}},{}],9:[function(e,t,n){var r,i=e("../utils/common"),a=e("./trees"),o=e("./adler32"),s=e("./crc32"),l=e("./messages"),c=0,u=4,h=0,p=-2,d=-1,f=4,m=2,g=8,v=9,y=286,x=30,_=19,b=2*y+1,w=15,M=3,S=258,T=S+M+1,E=42,C=113,A=1,L=2,D=3,P=4;function O(e,t){return e.msg=l[t],t}function R(e){return(e<<1)-(4<e?9:0)}function I(e){for(var t=e.length;0<=--t;)e[t]=0}function B(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function N(e,t){a._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,B(e.strm)}function k(e,t){e.pending_buf[e.pending++]=t}function F(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function G(e,t){var n,r,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-T?e.strstart-(e.w_size-T):0,c=e.window,u=e.w_mask,h=e.prev,p=e.strstart+S,d=c[a+o-1],f=c[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(n=t)+o]===f&&c[n+o-1]===d&&c[n]===c[a]&&c[++n]===c[a+1]){a+=2,n++;do{}while(c[++a]===c[++n]&&c[++a]===c[++n]&&c[++a]===c[++n]&&c[++a]===c[++n]&&c[++a]===c[++n]&&c[++a]===c[++n]&&c[++a]===c[++n]&&c[++a]===c[++n]&&a<p);if(r=S-(p-a),a=p-S,o<r){if(e.match_start=t,s<=(o=r))break;d=c[a+o-1],f=c[a+o]}}}while((t=h[t&u])>l&&0!=--i);return o<=e.lookahead?o:e.lookahead}function V(e){var t,n,r,a,l,c,u,h,p,d,f=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=f+(f-T)){for(i.arraySet(e.window,e.window,f,f,0),e.match_start-=f,e.strstart-=f,e.block_start-=f,t=n=e.hash_size;r=e.head[--t],e.head[t]=f<=r?r-f:0,--n;);for(t=n=f;r=e.prev[--t],e.prev[t]=f<=r?r-f:0,--n;);a+=f}if(0===e.strm.avail_in)break;if(c=e.strm,u=e.window,h=e.strstart+e.lookahead,d=void 0,(p=a)<(d=c.avail_in)&&(d=p),n=0===d?0:(c.avail_in-=d,i.arraySet(u,c.input,c.next_in,d,h),1===c.state.wrap?c.adler=o(c.adler,u,d,h):2===c.state.wrap&&(c.adler=s(c.adler,u,d,h)),c.next_in+=d,c.total_in+=d,d),e.lookahead+=n,e.lookahead+e.insert>=M)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+M-1])&e.hash_mask,e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<M)););}while(e.lookahead<T&&0!==e.strm.avail_in)}function z(e,t){for(var n,r;;){if(e.lookahead<T){if(V(e),e.lookahead<T&&t===c)return A;if(0===e.lookahead)break}if(n=0,e.lookahead>=M&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-T&&(e.match_length=G(e,n)),e.match_length>=M)if(r=a._tr_tally(e,e.strstart-e.match_start,e.match_length-M),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=M){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=e.strstart<M-1?e.strstart:M-1,t===u?(N(e,!0),0===e.strm.avail_out?D:P):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?A:L}function U(e,t){for(var n,r,i;;){if(e.lookahead<T){if(V(e),e.lookahead<T&&t===c)return A;if(0===e.lookahead)break}if(n=0,e.lookahead>=M&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=M-1,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-T&&(e.match_length=G(e,n),e.match_length<=5&&(1===e.strategy||e.match_length===M&&4096<e.strstart-e.match_start)&&(e.match_length=M-1)),e.prev_length>=M&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-M,r=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-M),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!=--e.prev_length;);if(e.match_available=0,e.match_length=M-1,e.strstart++,r&&(N(e,!1),0===e.strm.avail_out))return A}else if(e.match_available){if((r=a._tr_tally(e,0,e.window[e.strstart-1]))&&N(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return A}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=a._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<M-1?e.strstart:M-1,t===u?(N(e,!0),0===e.strm.avail_out?D:P):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?A:L}function j(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}function H(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=g,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*b),this.dyn_dtree=new i.Buf16(2*(2*x+1)),this.bl_tree=new i.Buf16(2*(2*_+1)),I(this.dyn_ltree),I(this.dyn_dtree),I(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(w+1),this.heap=new i.Buf16(2*y+1),I(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*y+1),I(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function W(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=m,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?E:C,e.adler=2===t.wrap?0:1,t.last_flush=c,a._tr_init(t),h):O(e,p)}function q(e){var t,n=W(e);return n===h&&((t=e.state).window_size=2*t.w_size,I(t.head),t.max_lazy_match=r[t.level].max_lazy,t.good_match=r[t.level].good_length,t.nice_match=r[t.level].nice_length,t.max_chain_length=r[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=M-1,t.match_available=0,t.ins_h=0),n}function J(e,t,n,r,a,o){if(!e)return p;var s=1;if(t===d&&(t=6),r<0?(s=0,r=-r):15<r&&(s=2,r-=16),a<1||v<a||n!==g||r<8||15<r||t<0||9<t||o<0||f<o)return O(e,p);8===r&&(r=9);var l=new H;return(e.state=l).strm=e,l.wrap=s,l.gzhead=null,l.w_bits=r,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=a+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+M-1)/M),l.window=new i.Buf8(2*l.w_size),l.head=new i.Buf16(l.hash_size),l.prev=new i.Buf16(l.w_size),l.lit_bufsize=1<<a+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new i.Buf8(l.pending_buf_size),l.d_buf=+l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=o,l.method=n,q(e)}r=[new j(0,0,0,0,function(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(V(e),0===e.lookahead&&t===c)return A;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,N(e,!1),0===e.strm.avail_out))return A;if(e.strstart-e.block_start>=e.w_size-T&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===u?(N(e,!0),0===e.strm.avail_out?D:P):(e.strstart>e.block_start&&(N(e,!1),e.strm.avail_out),A)}),new j(4,4,8,4,z),new j(4,5,16,8,z),new j(4,6,32,32,z),new j(4,4,16,16,U),new j(8,16,32,32,U),new j(8,16,128,128,U),new j(8,32,128,256,U),new j(32,128,258,1024,U),new j(32,258,258,4096,U)],n.deflateInit=function(e,t){return J(e,t,g,15,8,0)},n.deflateInit2=J,n.deflateReset=q,n.deflateResetKeep=W,n.deflateSetHeader=function(e,t){return e&&e.state&&2===e.state.wrap?(e.state.gzhead=t,h):p},n.deflate=function(e,t){var n,i,o,l;if(!e||!e.state||5<t||t<0)return e?O(e,p):p;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||666===i.status&&t!==u)return O(e,0===e.avail_out?-5:p);if(i.strm=e,n=i.last_flush,i.last_flush=t,i.status===E)if(2===i.wrap)e.adler=0,k(i,31),k(i,139),k(i,8),i.gzhead?(k(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),k(i,255&i.gzhead.time),k(i,i.gzhead.time>>8&255),k(i,i.gzhead.time>>16&255),k(i,i.gzhead.time>>24&255),k(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),k(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(k(i,255&i.gzhead.extra.length),k(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(k(i,0),k(i,0),k(i,0),k(i,0),k(i,0),k(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),k(i,3),i.status=C);else{var d=g+(i.w_bits-8<<4)<<8;d|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(d|=32),d+=31-d%31,i.status=C,F(i,d),0!==i.strstart&&(F(i,e.adler>>>16),F(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),B(e),o=i.pending,i.pending!==i.pending_buf_size));)k(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),B(e),o=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,k(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),0===l&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),B(e),o=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,k(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),0===l&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&B(e),i.pending+2<=i.pending_buf_size&&(k(i,255&e.adler),k(i,e.adler>>8&255),e.adler=0,i.status=C)):i.status=C),0!==i.pending){if(B(e),0===e.avail_out)return i.last_flush=-1,h}else if(0===e.avail_in&&R(t)<=R(n)&&t!==u)return O(e,-5);if(666===i.status&&0!==e.avail_in)return O(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==c&&666!==i.status){var f=2===i.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(V(e),0===e.lookahead)){if(t===c)return A;break}if(e.match_length=0,n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===u?(N(e,!0),0===e.strm.avail_out?D:P):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?A:L}(i,t):3===i.strategy?function(e,t){for(var n,r,i,o,s=e.window;;){if(e.lookahead<=S){if(V(e),e.lookahead<=S&&t===c)return A;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=M&&0<e.strstart&&(r=s[i=e.strstart-1])===s[++i]&&r===s[++i]&&r===s[++i]){o=e.strstart+S;do{}while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<o);e.match_length=S-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=M?(n=a._tr_tally(e,1,e.match_length-M),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===u?(N(e,!0),0===e.strm.avail_out?D:P):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?A:L}(i,t):r[i.level].func(i,t);if(f!==D&&f!==P||(i.status=666),f===A||f===D)return 0===e.avail_out&&(i.last_flush=-1),h;if(f===L&&(1===t?a._tr_align(i):5!==t&&(a._tr_stored_block(i,0,0,!1),3===t&&(I(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),B(e),0===e.avail_out))return i.last_flush=-1,h}return t!==u?h:i.wrap<=0?1:(2===i.wrap?(k(i,255&e.adler),k(i,e.adler>>8&255),k(i,e.adler>>16&255),k(i,e.adler>>24&255),k(i,255&e.total_in),k(i,e.total_in>>8&255),k(i,e.total_in>>16&255),k(i,e.total_in>>24&255)):(F(i,e.adler>>>16),F(i,65535&e.adler)),B(e),0<i.wrap&&(i.wrap=-i.wrap),0!==i.pending?h:1)},n.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==E&&69!==t&&73!==t&&91!==t&&103!==t&&t!==C&&666!==t?O(e,p):(e.state=null,t===C?O(e,-3):h):p},n.deflateSetDictionary=function(e,t){var n,r,a,s,l,c,u,d,f=t.length;if(!e||!e.state)return p;if(2===(s=(n=e.state).wrap)||1===s&&n.status!==E||n.lookahead)return p;for(1===s&&(e.adler=o(e.adler,t,f,0)),n.wrap=0,f>=n.w_size&&(0===s&&(I(n.head),n.strstart=0,n.block_start=0,n.insert=0),d=new i.Buf8(n.w_size),i.arraySet(d,t,f-n.w_size,n.w_size,0),t=d,f=n.w_size),l=e.avail_in,c=e.next_in,u=e.input,e.avail_in=f,e.next_in=0,e.input=t,V(n);n.lookahead>=M;){for(r=n.strstart,a=n.lookahead-(M-1);n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+M-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++,--a;);n.strstart=r,n.lookahead=M-1,V(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=M-1,n.match_available=0,e.next_in=c,e.input=u,e.avail_in=l,n.wrap=s,h},n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":4,"./adler32":6,"./crc32":8,"./messages":14,"./trees":15}],10:[function(e,t,n){t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],11:[function(e,t,n){t.exports=function(e,t){var n,r,i,a,o,s,l,c,u,h,p,d,f,m,g,v,y,x,_,b,w,M,S,T,E;n=e.state,r=e.next_in,T=e.input,i=r+(e.avail_in-5),a=e.next_out,E=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),l=n.dmax,c=n.wsize,u=n.whave,h=n.wnext,p=n.window,d=n.hold,f=n.bits,m=n.lencode,g=n.distcode,v=(1<<n.lenbits)-1,y=(1<<n.distbits)-1;e:do{f<15&&(d+=T[r++]<<f,f+=8,d+=T[r++]<<f,f+=8),x=m[d&v];t:for(;;){if(d>>>=_=x>>>24,f-=_,0==(_=x>>>16&255))E[a++]=65535&x;else{if(!(16&_)){if(0==(64&_)){x=m[(65535&x)+(d&(1<<_)-1)];continue t}if(32&_){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}b=65535&x,(_&=15)&&(f<_&&(d+=T[r++]<<f,f+=8),b+=d&(1<<_)-1,d>>>=_,f-=_),f<15&&(d+=T[r++]<<f,f+=8,d+=T[r++]<<f,f+=8),x=g[d&y];n:for(;;){if(d>>>=_=x>>>24,f-=_,!(16&(_=x>>>16&255))){if(0==(64&_)){x=g[(65535&x)+(d&(1<<_)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(w=65535&x,f<(_&=15)&&(d+=T[r++]<<f,(f+=8)<_&&(d+=T[r++]<<f,f+=8)),l<(w+=d&(1<<_)-1)){e.msg="invalid distance too far back",n.mode=30;break e}if(d>>>=_,f-=_,(_=a-o)<w){if(u<(_=w-_)&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(S=p,(M=0)===h){if(M+=c-_,_<b){for(b-=_;E[a++]=p[M++],--_;);M=a-w,S=E}}else if(h<_){if(M+=c+h-_,(_-=h)<b){for(b-=_;E[a++]=p[M++],--_;);if(M=0,h<b){for(b-=_=h;E[a++]=p[M++],--_;);M=a-w,S=E}}}else if(M+=h-_,_<b){for(b-=_;E[a++]=p[M++],--_;);M=a-w,S=E}for(;2<b;)E[a++]=S[M++],E[a++]=S[M++],E[a++]=S[M++],b-=3;b&&(E[a++]=S[M++],1<b&&(E[a++]=S[M++]))}else{for(M=a-w;E[a++]=E[M++],E[a++]=E[M++],E[a++]=E[M++],2<(b-=3););b&&(E[a++]=E[M++],1<b&&(E[a++]=E[M++]))}break}}break}}while(r<i&&a<s);r-=b=f>>3,d&=(1<<(f-=b<<3))-1,e.next_in=r,e.next_out=a,e.avail_in=r<i?i-r+5:5-(r-i),e.avail_out=a<s?s-a+257:257-(a-s),n.hold=d,n.bits=f}},{}],12:[function(e,t,n){var r=e("../utils/common"),i=e("./adler32"),a=e("./crc32"),o=e("./inffast"),s=e("./inftrees"),l=1,c=2,u=0,h=-2,p=1,d=852,f=592;function m(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=p,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(d),t.distcode=t.distdyn=new r.Buf32(f),t.sane=1,t.back=-1,u):h}function v(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,g(e)):h}function y(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?h:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,v(e))):h}function x(e,t){var n,i;return e?(i=new function(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0},(e.state=i).window=null,(n=y(e,t))!==u&&(e.state=null),n):h}var _,b,w=!0;function M(e){if(w){var t;for(_=new r.Buf32(512),b=new r.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(l,e.lens,0,288,_,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(c,e.lens,0,32,b,0,e.work,{bits:5}),w=!1}e.lencode=_,e.lenbits=9,e.distcode=b,e.distbits=5}function S(e,t,n,i){var a,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new r.Buf8(o.wsize)),i>=o.wsize?(r.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i<(a=o.wsize-o.wnext)&&(a=i),r.arraySet(o.window,t,n-i,a,o.wnext),(i-=a)?(r.arraySet(o.window,t,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=a))),0}n.inflateReset=v,n.inflateReset2=y,n.inflateResetKeep=g,n.inflateInit=function(e){return x(e,15)},n.inflateInit2=x,n.inflate=function(e,t){var n,d,f,g,v,y,x,_,b,w,T,E,C,A,L,D,P,O,R,I,B,N,k,F,G=0,V=new r.Buf8(4),z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return h;12===(n=e.state).mode&&(n.mode=13),v=e.next_out,f=e.output,x=e.avail_out,g=e.next_in,d=e.input,y=e.avail_in,_=n.hold,b=n.bits,w=y,T=x,N=u;e:for(;;)switch(n.mode){case p:if(0===n.wrap){n.mode=13;break}for(;b<16;){if(0===y)break e;y--,_+=d[g++]<<b,b+=8}if(2&n.wrap&&35615===_){V[n.check=0]=255&_,V[1]=_>>>8&255,n.check=a(n.check,V,2,0),b=_=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&_)<<8)+(_>>8))%31){e.msg="incorrect header check",n.mode=30;break}if(8!=(15&_)){e.msg="unknown compression method",n.mode=30;break}if(b-=4,B=8+(15&(_>>>=4)),0===n.wbits)n.wbits=B;else if(B>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<<B,e.adler=n.check=1,n.mode=512&_?10:12,b=_=0;break;case 2:for(;b<16;){if(0===y)break e;y--,_+=d[g++]<<b,b+=8}if(n.flags=_,8!=(255&n.flags)){e.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=_>>8&1),512&n.flags&&(V[0]=255&_,V[1]=_>>>8&255,n.check=a(n.check,V,2,0)),b=_=0,n.mode=3;case 3:for(;b<32;){if(0===y)break e;y--,_+=d[g++]<<b,b+=8}n.head&&(n.head.time=_),512&n.flags&&(V[0]=255&_,V[1]=_>>>8&255,V[2]=_>>>16&255,V[3]=_>>>24&255,n.check=a(n.check,V,4,0)),b=_=0,n.mode=4;case 4:for(;b<16;){if(0===y)break e;y--,_+=d[g++]<<b,b+=8}n.head&&(n.head.xflags=255&_,n.head.os=_>>8),512&n.flags&&(V[0]=255&_,V[1]=_>>>8&255,n.check=a(n.check,V,2,0)),b=_=0,n.mode=5;case 5:if(1024&n.flags){for(;b<16;){if(0===y)break e;y--,_+=d[g++]<<b,b+=8}n.length=_,n.head&&(n.head.extra_len=_),512&n.flags&&(V[0]=255&_,V[1]=_>>>8&255,n.check=a(n.check,V,2,0)),b=_=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(y<(E=n.length)&&(E=y),E&&(n.head&&(B=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,d,g,E,B)),512&n.flags&&(n.check=a(n.check,d,E,g)),y-=E,g+=E,n.length-=E),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===y)break e;for(E=0;B=d[g+E++],n.head&&B&&n.length<65536&&(n.head.name+=String.fromCharCode(B)),B&&E<y;);if(512&n.flags&&(n.check=a(n.check,d,E,g)),y-=E,g+=E,B)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===y)break e;for(E=0;B=d[g+E++],n.head&&B&&n.length<65536&&(n.head.comment+=String.fromCharCode(B)),B&&E<y;);if(512&n.flags&&(n.check=a(n.check,d,E,g)),y-=E,g+=E,B)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;b<16;){if(0===y)break e;y--,_+=d[g++]<<b,b+=8}if(_!==(65535&n.check)){e.msg="header crc mismatch",n.mode=30;break}b=_=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;b<32;){if(0===y)break e;y--,_+=d[g++]<<b,b+=8}e.adler=n.check=m(_),b=_=0,n.mode=11;case 11:if(0===n.havedict)return e.next_out=v,e.avail_out=x,e.next_in=g,e.avail_in=y,n.hold=_,n.bits=b,2;e.adler=n.check=1,n.mode=12;case 12:if(5===t||6===t)break e;case 13:if(n.last){_>>>=7&b,b-=7&b,n.mode=27;break}for(;b<3;){if(0===y)break e;y--,_+=d[g++]<<b,b+=8}switch(n.last=1&_,--b,3&(_>>>=1)){case 0:n.mode=14;break;case 1:if(M(n),n.mode=20,6!==t)break;_>>>=2,b-=2;break e;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}_>>>=2,b-=2;break;case 14:for(_>>>=7&b,b-=7&b;b<32;){if(0===y)break e;y--,_+=d[g++]<<b,b+=8}if((65535&_)!=(_>>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&_,b=_=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(E=n.length){if(y<E&&(E=y),x<E&&(E=x),0===E)break e;r.arraySet(f,d,g,E,v),y-=E,g+=E,x-=E,v+=E,n.length-=E;break}n.mode=12;break;case 17:for(;b<14;){if(0===y)break e;y--,_+=d[g++]<<b,b+=8}if(n.nlen=257+(31&_),_>>>=5,b-=5,n.ndist=1+(31&_),_>>>=5,b-=5,n.ncode=4+(15&_),_>>>=4,b-=4,286<n.nlen||30<n.ndist){e.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;b<3;){if(0===y)break e;y--,_+=d[g++]<<b,b+=8}n.lens[z[n.have++]]=7&_,_>>>=3,b-=3}for(;n.have<19;)n.lens[z[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,k={bits:n.lenbits},N=s(0,n.lens,0,19,n.lencode,0,n.work,k),n.lenbits=k.bits,N){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;D=(G=n.lencode[_&(1<<n.lenbits)-1])>>>16&255,P=65535&G,!((L=G>>>24)<=b);){if(0===y)break e;y--,_+=d[g++]<<b,b+=8}if(P<16)_>>>=L,b-=L,n.lens[n.have++]=P;else{if(16===P){for(F=L+2;b<F;){if(0===y)break e;y--,_+=d[g++]<<b,b+=8}if(_>>>=L,b-=L,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}B=n.lens[n.have-1],E=3+(3&_),_>>>=2,b-=2}else if(17===P){for(F=L+3;b<F;){if(0===y)break e;y--,_+=d[g++]<<b,b+=8}b-=L,B=0,E=3+(7&(_>>>=L)),_>>>=3,b-=3}else{for(F=L+7;b<F;){if(0===y)break e;y--,_+=d[g++]<<b,b+=8}b-=L,B=0,E=11+(127&(_>>>=L)),_>>>=7,b-=7}if(n.have+E>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;E--;)n.lens[n.have++]=B}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,k={bits:n.lenbits},N=s(l,n.lens,0,n.nlen,n.lencode,0,n.work,k),n.lenbits=k.bits,N){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,k={bits:n.distbits},N=s(c,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,k),n.distbits=k.bits,N){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(6<=y&&258<=x){e.next_out=v,e.avail_out=x,e.next_in=g,e.avail_in=y,n.hold=_,n.bits=b,o(e,T),v=e.next_out,f=e.output,x=e.avail_out,g=e.next_in,d=e.input,y=e.avail_in,_=n.hold,b=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;D=(G=n.lencode[_&(1<<n.lenbits)-1])>>>16&255,P=65535&G,!((L=G>>>24)<=b);){if(0===y)break e;y--,_+=d[g++]<<b,b+=8}if(D&&0==(240&D)){for(O=L,R=D,I=P;D=(G=n.lencode[I+((_&(1<<O+R)-1)>>O)])>>>16&255,P=65535&G,!(O+(L=G>>>24)<=b);){if(0===y)break e;y--,_+=d[g++]<<b,b+=8}_>>>=O,b-=O,n.back+=O}if(_>>>=L,b-=L,n.back+=L,n.length=P,0===D){n.mode=26;break}if(32&D){n.back=-1,n.mode=12;break}if(64&D){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&D,n.mode=22;case 22:if(n.extra){for(F=n.extra;b<F;){if(0===y)break e;y--,_+=d[g++]<<b,b+=8}n.length+=_&(1<<n.extra)-1,_>>>=n.extra,b-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;D=(G=n.distcode[_&(1<<n.distbits)-1])>>>16&255,P=65535&G,!((L=G>>>24)<=b);){if(0===y)break e;y--,_+=d[g++]<<b,b+=8}if(0==(240&D)){for(O=L,R=D,I=P;D=(G=n.distcode[I+((_&(1<<O+R)-1)>>O)])>>>16&255,P=65535&G,!(O+(L=G>>>24)<=b);){if(0===y)break e;y--,_+=d[g++]<<b,b+=8}_>>>=O,b-=O,n.back+=O}if(_>>>=L,b-=L,n.back+=L,64&D){e.msg="invalid distance code",n.mode=30;break}n.offset=P,n.extra=15&D,n.mode=24;case 24:if(n.extra){for(F=n.extra;b<F;){if(0===y)break e;y--,_+=d[g++]<<b,b+=8}n.offset+=_&(1<<n.extra)-1,_>>>=n.extra,b-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===x)break e;if(E=T-x,n.offset>E){if((E=n.offset-E)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}C=E>n.wnext?(E-=n.wnext,n.wsize-E):n.wnext-E,E>n.length&&(E=n.length),A=n.window}else A=f,C=v-n.offset,E=n.length;for(x<E&&(E=x),x-=E,n.length-=E;f[v++]=A[C++],--E;);0===n.length&&(n.mode=21);break;case 26:if(0===x)break e;f[v++]=n.length,x--,n.mode=21;break;case 27:if(n.wrap){for(;b<32;){if(0===y)break e;y--,_|=d[g++]<<b,b+=8}if(T-=x,e.total_out+=T,n.total+=T,T&&(e.adler=n.check=(n.flags?a:i)(n.check,f,T,v-T)),T=x,(n.flags?_:m(_))!==n.check){e.msg="incorrect data check",n.mode=30;break}b=_=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;b<32;){if(0===y)break e;y--,_+=d[g++]<<b,b+=8}if(_!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=30;break}b=_=0}n.mode=29;case 29:N=1;break e;case 30:N=-3;break e;case 31:return-4;case 32:default:return h}return e.next_out=v,e.avail_out=x,e.next_in=g,e.avail_in=y,n.hold=_,n.bits=b,(n.wsize||T!==e.avail_out&&n.mode<30&&(n.mode<27||4!==t))&&S(e,e.output,e.next_out,T-e.avail_out)?(n.mode=31,-4):(w-=e.avail_in,T-=e.avail_out,e.total_in+=w,e.total_out+=T,n.total+=T,n.wrap&&T&&(e.adler=n.check=(n.flags?a:i)(n.check,f,T,e.next_out-T)),e.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0==w&&0===T||4===t)&&N===u&&(N=-5),N)},n.inflateEnd=function(e){if(!e||!e.state)return h;var t=e.state;return t.window&&(t.window=null),e.state=null,u},n.inflateGetHeader=function(e,t){var n;return e&&e.state&&0!=(2&(n=e.state).wrap)?((n.head=t).done=!1,u):h},n.inflateSetDictionary=function(e,t){var n,r=t.length;return!e||!e.state||0!==(n=e.state).wrap&&11!==n.mode?h:11===n.mode&&i(1,t,r,0)!==n.check?-3:S(e,t,r,r)?(n.mode=31,-4):(n.havedict=1,u)},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":4,"./adler32":6,"./crc32":8,"./inffast":11,"./inftrees":13}],13:[function(e,t,n){var r=e("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,n,l,c,u,h,p){var d,f,m,g,v,y,x,_,b,w=p.bits,M=0,S=0,T=0,E=0,C=0,A=0,L=0,D=0,P=0,O=0,R=null,I=0,B=new r.Buf16(16),N=new r.Buf16(16),k=null,F=0;for(M=0;M<=15;M++)B[M]=0;for(S=0;S<l;S++)B[t[n+S]]++;for(C=w,E=15;1<=E&&0===B[E];E--);if(E<C&&(C=E),0===E)return c[u++]=20971520,c[u++]=20971520,p.bits=1,0;for(T=1;T<E&&0===B[T];T++);for(C<T&&(C=T),M=D=1;M<=15;M++)if(D<<=1,(D-=B[M])<0)return-1;if(0<D&&(0===e||1!==E))return-1;for(N[1]=0,M=1;M<15;M++)N[M+1]=N[M]+B[M];for(S=0;S<l;S++)0!==t[n+S]&&(h[N[t[n+S]]++]=S);if(y=0===e?(R=k=h,19):1===e?(R=i,I-=257,k=a,F-=257,256):(R=o,k=s,-1),M=T,v=u,L=S=O=0,m=-1,g=(P=1<<(A=C))-1,1===e&&852<P||2===e&&592<P)return 1;for(;;){for(x=M-L,b=h[S]<y?(_=0,h[S]):h[S]>y?(_=k[F+h[S]],R[I+h[S]]):(_=96,0),d=1<<M-L,T=f=1<<A;c[v+(O>>L)+(f-=d)]=x<<24|_<<16|b|0,0!==f;);for(d=1<<M-1;O&d;)d>>=1;if(0!==d?(O&=d-1,O+=d):O=0,S++,0==--B[M]){if(M===E)break;M=t[n+h[S]]}if(C<M&&(O&g)!==m){for(0===L&&(L=C),v+=T,D=1<<(A=M-L);A+L<E&&!((D-=B[A+L])<=0);)A++,D<<=1;if(P+=1<<A,1===e&&852<P||2===e&&592<P)return 1;c[m=O&g]=C<<24|A<<16|v-u|0}}return 0!==O&&(c[v+O]=M-L<<24|64<<16|0),p.bits=C,0}},{"../utils/common":4}],14:[function(e,t,n){t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],15:[function(e,t,n){var r=e("../utils/common");function i(e){for(var t=e.length;0<=--t;)e[t]=0}var a=0,o=256,s=o+1+29,l=30,c=19,u=2*s+1,h=15,p=16,d=256,f=16,m=17,g=18,v=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],y=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],x=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],_=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],b=new Array(2*(s+2));i(b);var w=new Array(2*l);i(w);var M=new Array(512);i(M);var S=new Array(256);i(S);var T=new Array(29);i(T);var E,C,A,L=new Array(l);function D(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function P(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function O(e){return e<256?M[e]:M[256+(e>>>7)]}function R(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function I(e,t,n){e.bi_valid>p-n?(e.bi_buf|=t<<e.bi_valid&65535,R(e,e.bi_buf),e.bi_buf=t>>p-e.bi_valid,e.bi_valid+=n-p):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function B(e,t,n){I(e,n[2*t],n[2*t+1])}function N(e,t){for(var n=0;n|=1&e,e>>>=1,n<<=1,0<--t;);return n>>>1}function k(e,t,n){var r,i,a=new Array(h+1),o=0;for(r=1;r<=h;r++)a[r]=o=o+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=N(a[s]++,s))}}function F(e){var t;for(t=0;t<s;t++)e.dyn_ltree[2*t]=0;for(t=0;t<l;t++)e.dyn_dtree[2*t]=0;for(t=0;t<c;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*d]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function G(e){8<e.bi_valid?R(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function V(e,t,n,r){var i=2*t,a=2*n;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]}function z(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&V(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!V(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function U(e,t,n){var r,i,a,s,l=0;if(0!==e.last_lit)for(;r=e.pending_buf[e.d_buf+2*l]<<8|e.pending_buf[e.d_buf+2*l+1],i=e.pending_buf[e.l_buf+l],l++,0===r?B(e,i,t):(B(e,(a=S[i])+o+1,t),0!==(s=v[a])&&I(e,i-=T[a],s),B(e,a=O(--r),n),0!==(s=y[a])&&I(e,r-=L[a],s)),l<e.last_lit;);B(e,d,t)}function j(e,t){var n,r,i,a=t.dyn_tree,o=t.stat_desc.static_tree,s=t.stat_desc.has_stree,l=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=u,n=0;n<l;n++)0!==a[2*n]?(e.heap[++e.heap_len]=c=n,e.depth[n]=0):a[2*n+1]=0;for(;e.heap_len<2;)a[2*(i=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=o[2*i+1]);for(t.max_code=c,n=e.heap_len>>1;1<=n;n--)z(e,a,n);for(i=l;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],z(e,a,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,a[2*i]=a[2*n]+a[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,a[2*n+1]=a[2*r+1]=i,e.heap[1]=i++,z(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,a,o,s,l=t.dyn_tree,c=t.max_code,p=t.stat_desc.static_tree,d=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,m=t.stat_desc.extra_base,g=t.stat_desc.max_length,v=0;for(a=0;a<=h;a++)e.bl_count[a]=0;for(l[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<u;n++)g<(a=l[2*l[2*(r=e.heap[n])+1]+1]+1)&&(a=g,v++),l[2*r+1]=a,c<r||(e.bl_count[a]++,o=0,m<=r&&(o=f[r-m]),s=l[2*r],e.opt_len+=s*(a+o),d&&(e.static_len+=s*(p[2*r+1]+o)));if(0!==v){do{for(a=g-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[g]--,v-=2}while(0<v);for(a=g;0!==a;a--)for(r=e.bl_count[a];0!==r;)c<(i=e.heap[--n])||(l[2*i+1]!==a&&(e.opt_len+=(a-l[2*i+1])*l[2*i],l[2*i+1]=a),r--)}}(e,t),k(a,c,e.bl_count)}function H(e,t,n){var r,i,a=-1,o=t[1],s=0,l=7,c=4;for(0===o&&(l=138,c=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=o,o=t[2*(r+1)+1],++s<l&&i===o||(s<c?e.bl_tree[2*i]+=s:0!==i?(i!==a&&e.bl_tree[2*i]++,e.bl_tree[2*f]++):s<=10?e.bl_tree[2*m]++:e.bl_tree[2*g]++,a=i,c=(s=0)===o?(l=138,3):i===o?(l=6,3):(l=7,4))}function W(e,t,n){var r,i,a=-1,o=t[1],s=0,l=7,c=4;for(0===o&&(l=138,c=3),r=0;r<=n;r++)if(i=o,o=t[2*(r+1)+1],!(++s<l&&i===o)){if(s<c)for(;B(e,i,e.bl_tree),0!=--s;);else 0!==i?(i!==a&&(B(e,i,e.bl_tree),s--),B(e,f,e.bl_tree),I(e,s-3,2)):s<=10?(B(e,m,e.bl_tree),I(e,s-3,3)):(B(e,g,e.bl_tree),I(e,s-11,7));a=i,c=(s=0)===o?(l=138,3):i===o?(l=6,3):(l=7,4)}}i(L);var q=!1;function J(e,t,n,i){var o,s,l;I(e,(a<<1)+(i?1:0),3),s=t,l=n,G(o=e),R(o,l),R(o,~l),r.arraySet(o.pending_buf,o.window,s,l,o.pending),o.pending+=l}n._tr_init=function(e){q||(function(){var e,t,n,r,i,a=new Array(h+1);for(r=n=0;r<28;r++)for(T[r]=n,e=0;e<1<<v[r];e++)S[n++]=r;for(S[n-1]=r,r=i=0;r<16;r++)for(L[r]=i,e=0;e<1<<y[r];e++)M[i++]=r;for(i>>=7;r<l;r++)for(L[r]=i<<7,e=0;e<1<<y[r]-7;e++)M[256+i++]=r;for(t=0;t<=h;t++)a[t]=0;for(e=0;e<=143;)b[2*e+1]=8,e++,a[8]++;for(;e<=255;)b[2*e+1]=9,e++,a[9]++;for(;e<=279;)b[2*e+1]=7,e++,a[7]++;for(;e<=287;)b[2*e+1]=8,e++,a[8]++;for(k(b,s+1,a),e=0;e<l;e++)w[2*e+1]=5,w[2*e]=N(e,5);E=new D(b,v,o+1,s,h),C=new D(w,y,0,l,h),A=new D(new Array(0),x,0,c,7)}(),q=!0),e.l_desc=new P(e.dyn_ltree,E),e.d_desc=new P(e.dyn_dtree,C),e.bl_desc=new P(e.bl_tree,A),e.bi_buf=0,e.bi_valid=0,F(e)},n._tr_stored_block=J,n._tr_flush_block=function(e,t,n,r){var i,a,s=0;0<e.level?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<o;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),j(e,e.l_desc),j(e,e.d_desc),s=function(e){var t;for(H(e,e.dyn_ltree,e.l_desc.max_code),H(e,e.dyn_dtree,e.d_desc.max_code),j(e,e.bl_desc),t=c-1;3<=t&&0===e.bl_tree[2*_[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=i&&(i=a)):i=a=n+5,n+4<=i&&-1!==t?J(e,t,n,r):4===e.strategy||a===i?(I(e,2+(r?1:0),3),U(e,b,w)):(I(e,4+(r?1:0),3),function(e,t,n,r){var i;for(I(e,t-257,5),I(e,n-1,5),I(e,r-4,4),i=0;i<r;i++)I(e,e.bl_tree[2*_[i]+1],3);W(e,e.dyn_ltree,t-1),W(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),U(e,e.dyn_ltree,e.dyn_dtree)),F(e),r&&G(e)},n._tr_tally=function(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(S[n]+o+1)]++,e.dyn_dtree[2*O(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){var t;I(e,2,3),B(e,d,b),16===(t=e).bi_valid?(R(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{"../utils/common":4}],16:[function(e,t,n){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],17:[function(e,t,n){var r=e("three");r.OrbitControls=function(e,t){var n,i,a,o,s;void 0===t&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.enabled=!0,this.target=new r.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:r.MOUSE.ROTATE,MIDDLE:r.MOUSE.DOLLY,RIGHT:r.MOUSE.PAN},this.touches={ONE:r.TOUCH.ROTATE,TWO:r.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return m.phi},this.getAzimuthalAngle=function(){return m.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,l.object.updateProjectionMatrix(),l.dispatchEvent(c),l.update(),d=p.NONE},this.update=(n=new r.Vector3,i=(new r.Quaternion).setFromUnitVectors(e.up,new r.Vector3(0,1,0)),a=i.clone().inverse(),o=new r.Vector3,s=new r.Quaternion,function(){var e=l.object.position;return n.copy(e).sub(l.target),n.applyQuaternion(i),m.setFromVector3(n),l.autoRotate&&d===p.NONE&&D(2*Math.PI/60/60*l.autoRotateSpeed),l.enableDamping?(m.theta+=g.theta*l.dampingFactor,m.phi+=g.phi*l.dampingFactor):(m.theta+=g.theta,m.phi+=g.phi),m.theta=Math.max(l.minAzimuthAngle,Math.min(l.maxAzimuthAngle,m.theta)),m.phi=Math.max(l.minPolarAngle,Math.min(l.maxPolarAngle,m.phi)),m.makeSafe(),m.radius*=v,m.radius=Math.max(l.minDistance,Math.min(l.maxDistance,m.radius)),!0===l.enableDamping?l.target.addScaledVector(y,l.dampingFactor):l.target.add(y),n.setFromSpherical(m),n.applyQuaternion(a),e.copy(l.target).add(n),l.object.lookAt(l.target),!0===l.enableDamping?(g.theta*=1-l.dampingFactor,g.phi*=1-l.dampingFactor,y.multiplyScalar(1-l.dampingFactor)):(g.set(0,0,0),y.set(0,0,0)),v=1,!(!(x||o.distanceToSquared(l.object.position)>f||8*(1-s.dot(l.object.quaternion))>f)||(l.dispatchEvent(c),o.copy(l.object.position),s.copy(l.object.quaternion),x=!1))}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",ne,!1),l.domElement.removeEventListener("mousedown",X,!1),l.domElement.removeEventListener("wheel",Z,!1),l.domElement.removeEventListener("touchstart",Q,!1),l.domElement.removeEventListener("touchend",te,!1),l.domElement.removeEventListener("touchmove",ee,!1),document.removeEventListener("mousemove",Y,!1),document.removeEventListener("mouseup",$,!1),l.domElement.removeEventListener("keydown",K,!1)};var l=this,c={type:"change"},u={type:"start"},h={type:"end"},p={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},d=p.NONE,f=1e-6,m=new r.Spherical,g=new r.Spherical,v=1,y=new r.Vector3,x=!1,_=new r.Vector2,b=new r.Vector2,w=new r.Vector2,M=new r.Vector2,S=new r.Vector2,T=new r.Vector2,E=new r.Vector2,C=new r.Vector2,A=new r.Vector2;function L(){return Math.pow(.95,l.zoomSpeed)}function D(e){g.theta-=e}function P(e){g.phi-=e}var O,R,I,B=(O=new r.Vector3,function(e,t){O.setFromMatrixColumn(t,0),O.multiplyScalar(-e),y.add(O)}),N=(R=new r.Vector3,function(e,t){!0===l.screenSpacePanning?R.setFromMatrixColumn(t,1):(R.setFromMatrixColumn(t,0),R.crossVectors(l.object.up,R)),R.multiplyScalar(e),y.add(R)}),k=(I=new r.Vector3,function(e,t){var n=l.domElement;if(l.object.isPerspectiveCamera){var r=l.object.position;I.copy(r).sub(l.target);var i=I.length();i*=Math.tan(l.object.fov/2*Math.PI/180),B(2*e*i/n.clientHeight,l.object.matrix),N(2*t*i/n.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(B(e*(l.object.right-l.object.left)/l.object.zoom/n.clientWidth,l.object.matrix),N(t*(l.object.top-l.object.bottom)/l.object.zoom/n.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)});function F(e){l.object.isPerspectiveCamera?v/=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function G(e){l.object.isPerspectiveCamera?v*=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function V(e){_.set(e.clientX,e.clientY)}function z(e){M.set(e.clientX,e.clientY)}function U(e){if(1==e.touches.length)_.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);_.set(t,n)}}function j(e){if(1==e.touches.length)M.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);M.set(t,n)}}function H(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);E.set(0,r)}function W(e){if(1==e.touches.length)b.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);b.set(t,n)}w.subVectors(b,_).multiplyScalar(l.rotateSpeed);var r=l.domElement;D(2*Math.PI*w.x/r.clientHeight),P(2*Math.PI*w.y/r.clientHeight),_.copy(b)}function q(e){if(1==e.touches.length)S.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);S.set(t,n)}T.subVectors(S,M).multiplyScalar(l.panSpeed),k(T.x,T.y),M.copy(S)}function J(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);C.set(0,r),A.set(0,Math.pow(C.y/E.y,l.zoomSpeed)),F(A.y),E.copy(C)}function X(e){if(!1!==l.enabled){switch(e.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),e.button){case 0:switch(l.mouseButtons.LEFT){case r.MOUSE.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===l.enablePan)return;z(e),d=p.PAN}else{if(!1===l.enableRotate)return;V(e),d=p.ROTATE}break;case r.MOUSE.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===l.enableRotate)return;V(e),d=p.ROTATE}else{if(!1===l.enablePan)return;z(e),d=p.PAN}break;default:d=p.NONE}break;case 1:switch(l.mouseButtons.MIDDLE){case r.MOUSE.DOLLY:if(!1===l.enableZoom)return;t=e,E.set(t.clientX,t.clientY),d=p.DOLLY;break;case r.MOUSE.PAN:if(!1===l.enablePan)return;z(e),d=p.PAN;break;default:d=p.NONE}break;case 2:switch(l.mouseButtons.RIGHT){case r.MOUSE.ROTATE:if(!1===l.enableRotate)return;V(e),d=p.ROTATE;break;case r.MOUSE.PAN:if(!1===l.enablePan)return;z(e),d=p.PAN;break;default:d=p.NONE}}var t;d!==p.NONE&&(document.addEventListener("mousemove",Y,!1),document.addEventListener("mouseup",$,!1),l.dispatchEvent(u))}}function Y(e){var t,n;if(!1!==l.enabled)switch(e.preventDefault(),d){case p.ROTATE:if(!1===l.enableRotate)return;!function(e){b.set(e.clientX,e.clientY),w.subVectors(b,_).multiplyScalar(l.rotateSpeed);var t=l.domElement;D(2*Math.PI*w.x/t.clientHeight),P(2*Math.PI*w.y/t.clientHeight),_.copy(b),l.update()}(e);break;case p.DOLLY:if(!1===l.enableZoom)return;n=e,C.set(n.clientX,n.clientY),A.subVectors(C,E),0<A.y?F(L()):A.y<0&&G(L()),E.copy(C),l.update();break;case p.PAN:if(!1===l.enablePan)return;t=e,S.set(t.clientX,t.clientY),T.subVectors(S,M).multiplyScalar(l.panSpeed),k(T.x,T.y),M.copy(S),l.update()}}function $(e){!1!==l.enabled&&(document.removeEventListener("mousemove",Y,!1),document.removeEventListener("mouseup",$,!1),l.dispatchEvent(h),d=p.NONE)}function Z(e){var t;!1===l.enabled||!1===l.enableZoom||d!==p.NONE&&d!==p.ROTATE||(e.preventDefault(),e.stopPropagation(),l.dispatchEvent(u),(t=e).deltaY<0?G(L()):0<t.deltaY&&F(L()),l.update(),l.dispatchEvent(h))}function K(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){var t=!1;switch(e.keyCode){case l.keys.UP:k(0,l.keyPanSpeed),t=!0;break;case l.keys.BOTTOM:k(0,-l.keyPanSpeed),t=!0;break;case l.keys.LEFT:k(l.keyPanSpeed,0),t=!0;break;case l.keys.RIGHT:k(-l.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),l.update())}(e)}function Q(e){if(!1!==l.enabled){switch(e.preventDefault(),e.touches.length){case 1:switch(l.touches.ONE){case r.TOUCH.ROTATE:if(!1===l.enableRotate)return;U(e),d=p.TOUCH_ROTATE;break;case r.TOUCH.PAN:if(!1===l.enablePan)return;j(e),d=p.TOUCH_PAN;break;default:d=p.NONE}break;case 2:switch(l.touches.TWO){case r.TOUCH.DOLLY_PAN:if(!1===l.enableZoom&&!1===l.enablePan)return;n=e,l.enableZoom&&H(n),l.enablePan&&j(n),d=p.TOUCH_DOLLY_PAN;break;case r.TOUCH.DOLLY_ROTATE:if(!1===l.enableZoom&&!1===l.enableRotate)return;t=e,l.enableZoom&&H(t),l.enableRotate&&U(t),d=p.TOUCH_DOLLY_ROTATE;break;default:d=p.NONE}break;default:d=p.NONE}var t,n;d!==p.NONE&&l.dispatchEvent(u)}}function ee(e){var t,n;if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),d){case p.TOUCH_ROTATE:if(!1===l.enableRotate)return;W(e),l.update();break;case p.TOUCH_PAN:if(!1===l.enablePan)return;q(e),l.update();break;case p.TOUCH_DOLLY_PAN:if(!1===l.enableZoom&&!1===l.enablePan)return;n=e,l.enableZoom&&J(n),l.enablePan&&q(n),l.update();break;case p.TOUCH_DOLLY_ROTATE:if(!1===l.enableZoom&&!1===l.enableRotate)return;t=e,l.enableZoom&&J(t),l.enableRotate&&W(t),l.update();break;default:d=p.NONE}}function te(e){!1!==l.enabled&&(l.dispatchEvent(h),d=p.NONE)}function ne(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",ne,!1),l.domElement.addEventListener("mousedown",X,!1),l.domElement.addEventListener("wheel",Z,!1),l.domElement.addEventListener("touchstart",Q,!1),l.domElement.addEventListener("touchend",te,!1),l.domElement.addEventListener("touchmove",ee,!1),l.domElement.addEventListener("keydown",K,!1),-1===l.domElement.tabIndex&&(l.domElement.tabIndex=0),this.update()},r.OrbitControls.prototype=Object.create(r.EventDispatcher.prototype),r.OrbitControls.prototype.constructor=r.OrbitControls,r.MapControls=function(e,t){r.OrbitControls.call(this,e,t),this.mouseButtons.LEFT=r.MOUSE.PAN,this.mouseButtons.RIGHT=r.MOUSE.ROTATE,this.touches.ONE=r.TOUCH.PAN,this.touches.TWO=r.TOUCH.DOLLY_ROTATE},r.MapControls.prototype=Object.create(r.EventDispatcher.prototype),r.MapControls.prototype.constructor=r.MapControls,void 0!==n&&(void 0!==t&&t.exports&&(n=t.exports={OrbitControls:r.OrbitControls,MapControls:r.MapControls}),n.OrbitControls=r.OrbitControls,n.MapControls=r.MapControls)},{three:19}],18:[function(e,t,n){(function(){var r,i,a,o=void 0!==e,s=this.THREE||o&&e("three");if(!s)throw new Error("MeshLine requires three.js");function l(){this.positions=[],this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this.geometry=new s.BufferGeometry,this.widthCallback=null,this.matrixWorld=new s.Matrix4}function c(e,t,n,r,i){var a;if(e=e.subarray||e.slice?e:e.buffer,n=n.subarray||n.slice?n:n.buffer,e=t?e.subarray?e.subarray(t,i&&t+i):e.slice(t,i&&t+i):e,n.set)n.set(e,r);else for(a=0;a<e.length;a++)n[a+r]=e[a];return n}function u(e){s.ShaderMaterial.call(this,{uniforms:Object.assign({},s.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new s.Color(16777215)},opacity:{value:1},resolution:{value:new s.Vector2(1,1)},sizeAttenuation:{value:1},near:{value:1},far:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new s.Vector2(1,1)}}),vertexShader:s.ShaderChunk.meshline_vert,fragmentShader:s.ShaderChunk.meshline_frag}),this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(e){this.uniforms.lineWidth.value=e}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(e){this.uniforms.useMap.value=e}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(e){this.uniforms.alphaMap.value=e}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(e){this.uniforms.useAlphaMap.value=e}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(e){this.uniforms.color.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(e){this.uniforms.sizeAttenuation.value=e}},near:{enumerable:!0,get:function(){return this.uniforms.near.value},set:function(e){this.uniforms.near.value=e}},far:{enumerable:!0,get:function(){return this.uniforms.far.value},set:function(e){this.uniforms.far.value=e}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(e){this.uniforms.dashArray.value=e,this.useDash=0!==e?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(e){this.uniforms.dashRatio.value=e}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(e){this.uniforms.useDash.value=e}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(e){this.uniforms.visibility.value=e}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(e){this.uniforms.alphaTest.value=e}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(e){this.uniforms.repeat.value.copy(e)}}}),this.setValues(e)}l.prototype.setMatrixWorld=function(e){this.matrixWorld=e},l.prototype.setGeometry=function(e,t){if(this.widthCallback=t,this.positions=[],this.counters=[],e instanceof s.Geometry)for(var n=0;n<e.vertices.length;n++){var r=e.vertices[n];t=n/e.vertices.length,this.positions.push(r.x,r.y,r.z),this.positions.push(r.x,r.y,r.z),this.counters.push(t),this.counters.push(t)}if(s.BufferGeometry,e instanceof Float32Array||e instanceof Array)for(n=0;n<e.length;n+=3)t=n/e.length,this.positions.push(e[n],e[n+1],e[n+2]),this.positions.push(e[n],e[n+1],e[n+2]),this.counters.push(t),this.counters.push(t);this.process()},l.prototype.raycast=(r=new s.Matrix4,i=new s.Ray,a=new s.Sphere,function(e,t){var n=e.linePrecision,o=n*n,l=this.geometry;if(null===l.boundingSphere&&l.computeBoundingSphere(),a.copy(l.boundingSphere),a.applyMatrix4(this.matrixWorld),!1!==e.ray.intersectSphere(a)){r.getInverse(this.matrixWorld),i.copy(e.ray).applyMatrix4(r);var c=new s.Vector3,u=new s.Vector3,h=new s.Vector3,p=new s.Vector3,d=this instanceof s.LineSegments?2:1;if(l instanceof s.BufferGeometry){var f=l.index,m=l.attributes;if(null!==f)for(var g=f.array,v=m.position.array,y=0,x=g.length-1;y<x;y+=d){var _=g[y],b=g[y+1];c.fromArray(v,3*_),u.fromArray(v,3*b),o<i.distanceSqToSegment(c,u,p,h)||(p.applyMatrix4(this.matrixWorld),(S=e.ray.origin.distanceTo(p))<e.near||S>e.far||t.push({distance:S,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this}))}else for(y=0,x=(v=m.position.array).length/3-1;y<x;y+=d)c.fromArray(v,3*y),u.fromArray(v,3*y+3),o<i.distanceSqToSegment(c,u,p,h)||(p.applyMatrix4(this.matrixWorld),(S=e.ray.origin.distanceTo(p))<e.near||S>e.far||t.push({distance:S,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this}))}else if(l instanceof s.Geometry){var w=l.vertices,M=w.length;for(y=0;y<M-1;y+=d){var S;o<i.distanceSqToSegment(w[y],w[y+1],p,h)||(p.applyMatrix4(this.matrixWorld),(S=e.ray.origin.distanceTo(p))<e.near||S>e.far||t.push({distance:S,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this}))}}}}),l.prototype.compareV3=function(e,t){var n=6*e,r=6*t;return this.positions[n]===this.positions[r]&&this.positions[1+n]===this.positions[1+r]&&this.positions[2+n]===this.positions[2+r]},l.prototype.copyV3=function(e){var t=6*e;return[this.positions[t],this.positions[1+t],this.positions[2+t]]},l.prototype.process=function(){var e,t,n=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];for(var r=0;r<n;r++)this.side.push(1),this.side.push(-1);for(r=0;r<n;r++)e=this.widthCallback?this.widthCallback(r/(n-1)):1,this.width.push(e),this.width.push(e);for(r=0;r<n;r++)this.uvs.push(r/(n-1),0),this.uvs.push(r/(n-1),1);for(t=this.compareV3(0,n-1)?this.copyV3(n-2):this.copyV3(0),this.previous.push(t[0],t[1],t[2]),this.previous.push(t[0],t[1],t[2]),r=0;r<n-1;r++)t=this.copyV3(r),this.previous.push(t[0],t[1],t[2]),this.previous.push(t[0],t[1],t[2]);for(r=1;r<n;r++)t=this.copyV3(r),this.next.push(t[0],t[1],t[2]),this.next.push(t[0],t[1],t[2]);for(t=this.compareV3(n-1,0)?this.copyV3(1):this.copyV3(n-1),this.next.push(t[0],t[1],t[2]),this.next.push(t[0],t[1],t[2]),r=0;r<n-1;r++){var i=2*r;this.indices_array.push(i,1+i,2+i),this.indices_array.push(2+i,1+i,3+i)}this.attributes?(this.attributes.position.copyArray(new Float32Array(this.positions)),this.attributes.position.needsUpdate=!0,this.attributes.previous.copyArray(new Float32Array(this.previous)),this.attributes.previous.needsUpdate=!0,this.attributes.next.copyArray(new Float32Array(this.next)),this.attributes.next.needsUpdate=!0,this.attributes.side.copyArray(new Float32Array(this.side)),this.attributes.side.needsUpdate=!0,this.attributes.width.copyArray(new Float32Array(this.width)),this.attributes.width.needsUpdate=!0,this.attributes.uv.copyArray(new Float32Array(this.uvs)),this.attributes.uv.needsUpdate=!0,this.attributes.index.copyArray(new Uint16Array(this.indices_array)),this.attributes.index.needsUpdate=!0):this.attributes={position:new s.BufferAttribute(new Float32Array(this.positions),3),previous:new s.BufferAttribute(new Float32Array(this.previous),3),next:new s.BufferAttribute(new Float32Array(this.next),3),side:new s.BufferAttribute(new Float32Array(this.side),1),width:new s.BufferAttribute(new Float32Array(this.width),1),uv:new s.BufferAttribute(new Float32Array(this.uvs),2),index:new s.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new s.BufferAttribute(new Float32Array(this.counters),1)},this.geometry.setAttribute("position",this.attributes.position),this.geometry.setAttribute("previous",this.attributes.previous),this.geometry.setAttribute("next",this.attributes.next),this.geometry.setAttribute("side",this.attributes.side),this.geometry.setAttribute("width",this.attributes.width),this.geometry.setAttribute("uv",this.attributes.uv),this.geometry.setAttribute("counters",this.attributes.counters),this.geometry.setIndex(this.attributes.index)},l.prototype.advance=function(e){var t=this.attributes.position.array,n=this.attributes.previous.array,r=this.attributes.next.array,i=t.length;c(t,0,n,0,i),c(t,6,t,0,i-6),t[i-6]=e.x,t[i-5]=e.y,t[i-4]=e.z,t[i-3]=e.x,t[i-2]=e.y,t[i-1]=e.z,c(t,6,r,0,i-6),r[i-6]=e.x,r[i-5]=e.y,r[i-4]=e.z,r[i-3]=e.x,r[i-2]=e.y,r[i-1]=e.z,this.attributes.position.needsUpdate=!0,this.attributes.previous.needsUpdate=!0,this.attributes.next.needsUpdate=!0},s.ShaderChunk.meshline_vert=["",s.ShaderChunk.logdepthbuf_pars_vertex,s.ShaderChunk.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;","\t vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;",""," vColor = vec4( color, opacity );"," vUV = uv;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );",""," float w = lineWidth * width;",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec4 normal = vec4( -dir.y, dir.x, 0., 1. );"," normal.xy *= .5 * w;"," normal *= projectionMatrix;"," if( sizeAttenuation == 0. ) {"," normal.xy *= finalPosition.w;"," normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;"," }",""," finalPosition.xy += normal.xy * side;",""," gl_Position = finalPosition;","",s.ShaderChunk.logdepthbuf_vertex,s.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",s.ShaderChunk.fog_vertex,"}"].join("\n"),s.ShaderChunk.meshline_frag=["",s.ShaderChunk.fog_pars_fragment,s.ShaderChunk.logdepthbuf_pars_fragment,"","uniform sampler2D map;","uniform sampler2D alphaMap;","uniform float useMap;","uniform float useAlphaMap;","uniform float useDash;","uniform float dashArray;","uniform float dashOffset;","uniform float dashRatio;","uniform float visibility;","uniform float alphaTest;","uniform vec2 repeat;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {","",s.ShaderChunk.logdepthbuf_fragment,""," vec4 c = vColor;"," if( useMap == 1. ) c *= texture2D( map, vUV * repeat );"," if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;"," if( c.a < alphaTest ) discard;"," if( useDash == 1. ){"," c.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));"," }"," gl_FragColor = c;"," gl_FragColor.a *= step(vCounters, visibility);","",s.ShaderChunk.fog_fragment,"}"].join("\n"),((u.prototype=Object.create(s.ShaderMaterial.prototype)).constructor=u).prototype.isMeshLineMaterial=!0,u.prototype.copy=function(e){return s.ShaderMaterial.prototype.copy.call(this,e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.near=e.near,this.far=e.far,this.dashArray.copy(e.dashArray),this.dashOffset.copy(e.dashOffset),this.dashRatio.copy(e.dashRatio),this.useDash=e.useDash,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this},void 0!==n?(void 0!==t&&t.exports&&(n=t.exports={MeshLine:l,MeshLineMaterial:u}),n.MeshLine=l,n.MeshLineMaterial=u):(this.MeshLine=l,this.MeshLineMaterial=u)}).call(this)},{three:19}],19:[function(e,t,n){var r,i;r=this,i=function(e){void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:0<e?1:+e}),"name"in Function.prototype==0&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t});var t=0,n=1,r=2,i=1,a=2,o=3,s=0,l=1,c=2,u=0,h=2,p=0,d=1,f=2,m=3,g=4,v=5,y=100,x=101,_=102,b=103,w=104,M=200,S=201,T=202,E=203,C=204,A=205,L=206,D=207,P=208,O=209,R=210,I=0,B=1,N=2,k=3,F=4,G=5,V=6,z=7,U=0,j=1,H=2,W=0,q=1,J=2,X=3,Y=4,$=5,Z=301,K=302,Q=303,ee=304,te=305,ne=306,re=307,ie=1e3,ae=1001,oe=1002,se=1003,le=1004,ce=1005,ue=1006,he=1007,pe=1008,de=1009,fe=1010,me=1011,ge=1012,ve=1013,ye=1014,xe=1015,_e=1016,be=1017,we=1018,Me=1019,Se=1020,Te=1021,Ee=1022,Ce=1023,Ae=1024,Le=1025,De=Ce,Pe=1026,Oe=1027,Re=1028,Ie=1029,Be=1030,Ne=1031,ke=1032,Fe=1033,Ge=33776,Ve=33777,ze=33778,Ue=33779,je=35840,He=35841,We=35842,qe=35843,Je=36196,Xe=37808,Ye=37809,$e=37810,Ze=37811,Ke=37812,Qe=37813,et=37814,tt=37815,nt=37816,rt=37817,it=37818,at=37819,ot=37820,st=37821,lt=2300,ct=2301,ut=2400,ht=2401,pt=2402,dt=3e3,ft=3001,mt=3007,gt=3002,vt=3003,yt=3004,xt=3005,_t=3006,bt=3200,wt=3201,Mt=0,St=1,Tt=7680,Et=519,Ct=35044,At=35048;function Lt(){}Object.assign(Lt.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var n=this._listeners[e];if(void 0!==n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=t.slice(0),r=0,i=n.length;r<i;r++)n[r].call(this,e)}}}});for(var Dt=[],Pt=0;Pt<256;Pt++)Dt[Pt]=(Pt<16?"0":"")+Pt.toString(16);var Ot,Rt={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(Dt[255&e]+Dt[e>>8&255]+Dt[e>>16&255]+Dt[e>>24&255]+"-"+Dt[255&t]+Dt[t>>8&255]+"-"+Dt[t>>16&15|64]+Dt[t>>24&255]+"-"+Dt[63&n|128]+Dt[n>>8&255]+"-"+Dt[n>>16&255]+Dt[n>>24&255]+Dt[255&r]+Dt[r>>8&255]+Dt[r>>16&255]+Dt[r>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:n<=e?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:n<=e?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*Rt.DEG2RAD},radToDeg:function(e){return e*Rt.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,r,i){var a=Math.cos,o=Math.sin,s=a(n/2),l=o(n/2),c=a((t+r)/2),u=o((t+r)/2),h=a((t-r)/2),p=o((t-r)/2),d=a((r-t)/2),f=o((r-t)/2);"XYX"===i?e.set(s*u,l*h,l*p,s*c):"YZY"===i?e.set(l*p,s*u,l*h,s*c):"ZXZ"===i?e.set(l*h,l*p,s*u,s*c):"XZX"===i?e.set(s*u,l*f,l*d,s*c):"YXY"===i?e.set(l*d,s*u,l*f,s*c):"ZYZ"===i?e.set(l*f,l*d,s*u,s*c):console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.")}};function It(e,t){this.x=e||0,this.y=t||0}function Bt(){this.elements=[1,0,0,0,1,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(It.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(It.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},cross:function(e){return this.x*e.y-this.y*e.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var e=Math.atan2(this.y,this.x);return e<0&&(e+=2*Math.PI),e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}}),Object.assign(Bt.prototype,{isMatrix3:!0,set:function(e,t,n,r,i,a,o,s,l){var c=this.elements;return c[0]=e,c[1]=r,c[2]=o,c[3]=t,c[4]=i,c[5]=s,c[6]=n,c[7]=a,c[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this},setFromMatrix4:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],l=n[1],c=n[4],u=n[7],h=n[2],p=n[5],d=n[8],f=r[0],m=r[3],g=r[6],v=r[1],y=r[4],x=r[7],_=r[2],b=r[5],w=r[8];return i[0]=a*f+o*v+s*_,i[3]=a*m+o*y+s*b,i[6]=a*g+o*x+s*w,i[1]=l*f+c*v+u*_,i[4]=l*m+c*y+u*b,i[7]=l*g+c*x+u*w,i[2]=h*f+p*v+d*_,i[5]=h*m+p*y+d*b,i[8]=h*g+p*x+d*w,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8];return t*a*c-t*o*l-n*i*c+n*o*s+r*i*l-r*a*s},getInverse:function(e,t){e&&e.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=e.elements,r=this.elements,i=n[0],a=n[1],o=n[2],s=n[3],l=n[4],c=n[5],u=n[6],h=n[7],p=n[8],d=p*l-c*h,f=c*u-p*s,m=h*s-l*u,g=i*d+a*f+o*m;if(0==g){var v="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(v);return console.warn(v),this.identity()}var y=1/g;return r[0]=d*y,r[1]=(o*h-p*a)*y,r[2]=(c*a-o*l)*y,r[3]=f*y,r[4]=(p*i-o*u)*y,r[5]=(o*s-c*i)*y,r[6]=m*y,r[7]=(a*u-h*i)*y,r[8]=(l*i-a*s)*y,this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},setUvTransform:function(e,t,n,r,i,a,o){var s=Math.cos(i),l=Math.sin(i);this.set(n*s,n*l,-n*(s*a+l*o)+a+e,-r*l,r*s,-r*(-l*a+s*o)+o+t,0,0,1)},scale:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this},rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],l=r[4],c=r[7];return r[0]=t*i+n*s,r[3]=t*a+n*l,r[6]=t*o+n*c,r[1]=-n*i+t*s,r[4]=-n*a+t*l,r[7]=-n*o+t*c,this},translate:function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<9;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}});var Nt={getDataURL:function(e){var t;if("undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)t=e;else{void 0===Ot&&(Ot=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Ot.width=e.width,Ot.height=e.height;var n=Ot.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Ot}return 2048<t.width||2048<t.height?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}},kt=0;function Ft(e,t,n,r,i,a,o,s,l,c){Object.defineProperty(this,"id",{value:kt++}),this.uuid=Rt.generateUUID(),this.name="",this.image=void 0!==e?e:Ft.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:Ft.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:ae,this.wrapT=void 0!==r?r:ae,this.magFilter=void 0!==i?i:ue,this.minFilter=void 0!==a?a:pe,this.anisotropy=void 0!==l?l:1,this.format=void 0!==o?o:Ce,this.internalFormat=null,this.type=void 0!==s?s:de,this.offset=new It(0,0),this.repeat=new It(1,1),this.center=new It(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Bt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==c?c:dt,this.version=0,this.onUpdate=null}function Gt(e,t,n,r){this.x=e||0,this.y=t||0,this.z=n||0,this.w=void 0!==r?r:1}function Vt(e,t,n){this.width=e,this.height=t,this.scissor=new Gt(0,0,e,t),this.scissorTest=!1,this.viewport=new Gt(0,0,e,t),n=n||{},this.texture=new Ft(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:ue,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function zt(e,t,n){Vt.call(this,e,t,n),this.samples=4}function Ut(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._w=void 0!==r?r:1}Ft.DEFAULT_IMAGE=void 0,Ft.DEFAULT_MAPPING=300,Ft.prototype=Object.assign(Object.create(Lt.prototype),{constructor:Ft,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=Rt.generateUUID()),!t&&void 0===e.images[r.uuid]){var i;if(Array.isArray(r)){i=[];for(var a=0,o=r.length;a<o;a++)i.push(Nt.getDataURL(r[a]))}else i=Nt.getDataURL(r);e.images[r.uuid]={uuid:r.uuid,url:i}}n.image=r.uuid}return t||(e.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||1<e.x)switch(this.wrapS){case ie:e.x=e.x-Math.floor(e.x);break;case ae:e.x=e.x<0?0:1;break;case oe:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||1<e.y)switch(this.wrapT){case ie:e.y=e.y-Math.floor(e.y);break;case ae:e.y=e.y<0?0:1;break;case oe:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(Ft.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.defineProperties(Gt.prototype,{width:{get:function(){return this.z},set:function(e){this.z=e}},height:{get:function(){return this.w},set:function(e){this.w=e}}}),Object.assign(Gt.prototype,{isVector4:!0,set:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,n,r,i,a=e.elements,o=a[0],s=a[4],l=a[8],c=a[1],u=a[5],h=a[9],p=a[2],d=a[6],f=a[10];if(Math.abs(s-c)<.01&&Math.abs(l-p)<.01&&Math.abs(h-d)<.01){if(Math.abs(s+c)<.1&&Math.abs(l+p)<.1&&Math.abs(h+d)<.1&&Math.abs(o+u+f-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var m=(o+1)/2,g=(u+1)/2,v=(f+1)/2,y=(s+c)/4,x=(l+p)/4,_=(h+d)/4;return g<m&&v<m?i=m<.01?(n=0,r=.707106781):(r=y/(n=Math.sqrt(m)),x/n):v<g?i=g<.01?(r=0,n=.707106781):(n=y/(r=Math.sqrt(g)),_/r):v<.01?(r=n=.707106781,i=0):(n=x/(i=Math.sqrt(v)),r=_/i),this.set(n,r,i,t),this}var b=Math.sqrt((d-h)*(d-h)+(l-p)*(l-p)+(c-s)*(c-s));return Math.abs(b)<.001&&(b=1),this.x=(d-h)/b,this.y=(l-p)/b,this.z=(c-s)/b,this.w=Math.acos((o+u+f-1)/2),this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),Vt.prototype=Object.assign(Object.create(Lt.prototype),{constructor:Vt,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),zt.prototype=Object.assign(Object.create(Vt.prototype),{constructor:zt,isWebGLMultisampleRenderTarget:!0,copy:function(e){return Vt.prototype.copy.call(this,e),this.samples=e.samples,this}}),Object.assign(Ut,{slerp:function(e,t,n,r){return n.copy(e).slerp(t,r)},slerpFlat:function(e,t,n,r,i,a,o){var s=n[r+0],l=n[r+1],c=n[r+2],u=n[r+3],h=i[a+0],p=i[a+1],d=i[a+2],f=i[a+3];if(u!==f||s!==h||l!==p||c!==d){var m=1-o,g=s*h+l*p+c*d+u*f,v=0<=g?1:-1,y=1-g*g;if(y>Number.EPSILON){var x=Math.sqrt(y),_=Math.atan2(x,g*v);m=Math.sin(m*_)/x,o=Math.sin(o*_)/x}var b=o*v;if(s=s*m+h*b,l=l*m+p*b,c=c*m+d*b,u=u*m+f*b,m===1-o){var w=1/Math.sqrt(s*s+l*l+c*c+u*u);s*=w,l*=w,c*=w,u*=w}}e[t]=s,e[t+1]=l,e[t+2]=c,e[t+3]=u}}),Object.defineProperties(Ut.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}}),Object.assign(Ut.prototype,{isQuaternion:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,r=e._y,i=e._z,a=e.order,o=Math.cos,s=Math.sin,l=o(n/2),c=o(r/2),u=o(i/2),h=s(n/2),p=s(r/2),d=s(i/2);return"XYZ"===a?(this._x=h*c*u+l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u-h*p*d):"YXZ"===a?(this._x=h*c*u+l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u+h*p*d):"ZXY"===a?(this._x=h*c*u-l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u-h*p*d):"ZYX"===a?(this._x=h*c*u-l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u+h*p*d):"YZX"===a?(this._x=h*c*u+l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u-h*p*d):"XZY"===a&&(this._x=h*c*u-l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u+h*p*d),!1!==t&&this._onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(e){var t,n=e.elements,r=n[0],i=n[4],a=n[8],o=n[1],s=n[5],l=n[9],c=n[2],u=n[6],h=n[10],p=r+s+h;return 0<p?(t=.5/Math.sqrt(p+1),this._w=.25/t,this._x=(u-l)*t,this._y=(a-c)*t,this._z=(o-i)*t):s<r&&h<r?(t=2*Math.sqrt(1+r-s-h),this._w=(u-l)/t,this._x=.25*t,this._y=(i+o)/t,this._z=(a+c)/t):h<s?(t=2*Math.sqrt(1+s-r-h),this._w=(a-c)/t,this._x=(i+o)/t,this._y=.25*t,this._z=(l+u)/t):(t=2*Math.sqrt(1+h-r-s),this._w=(o-i)/t,this._x=(a+c)/t,this._y=(l+u)/t,this._z=.25*t),this._onChangeCallback(),this},setFromUnitVectors:function(e,t){var n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x),this._w=n,this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs(Rt.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,t){var n=this.angleTo(e);if(0===n)return this;var r=Math.min(1,t/n);return this.slerp(e,r),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,l=t._z,c=t._w;return this._x=n*c+a*o+r*l-i*s,this._y=r*c+a*s+i*o-n*l,this._z=i*c+a*l+n*s-r*o,this._w=a*c-n*o-r*s-i*l,this._onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,a=this._w,o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),1<=o)return this._w=a,this._x=n,this._y=r,this._z=i,this;var s=1-o*o;if(s<=Number.EPSILON){var l=1-t;return this._w=l*a+t*this._w,this._x=l*n+t*this._x,this._y=l*r+t*this._y,this._z=l*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var c=Math.sqrt(s),u=Math.atan2(c,o),h=Math.sin((1-t)*u)/c,p=Math.sin(t*u)/c;return this._w=a*h+this._w*p,this._x=n*h+this._x*p,this._y=r*h+this._y*p,this._z=i*h+this._z*p,this._onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}});var jt=new Wt,Ht=new Ut;function Wt(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}Object.assign(Wt.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Ht.setFromEuler(e))},applyAxisAngle:function(e,t){return this.applyQuaternion(Ht.setFromAxisAngle(e,t))},applyMatrix3:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this},applyNormalMatrix:function(e){return this.applyMatrix3(e).normalize()},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this},applyQuaternion:function(e){var t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,l=s*t+a*r-o*n,c=s*n+o*t-i*r,u=s*r+i*n-a*t,h=-i*t-a*n-o*r;return this.x=l*s+h*-i+c*-o-u*-a,this.y=c*s+h*-a+u*-i-l*-o,this.z=u*s+h*-o+l*-a-c*-i,this},project:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},unproject:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)},transformDirection:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},cross:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this},projectOnVector:function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)},projectOnPlane:function(e){return jt.copy(this).projectOnVector(e),this.sub(jt)},reflect:function(e){return this.sub(jt.copy(e).multiplyScalar(2*this.dot(e)))},angleTo:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var n=this.dot(e)/t;return Math.acos(Rt.clamp(n,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},setFromSphericalCoords:function(e,t,n){var r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this},setFromCylindrical:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},setFromCylindricalCoords:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},setFromMatrix3Column:function(e,t){return this.fromArray(e.elements,3*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}});var qt=new Wt,Jt=new Qt,Xt=new Wt(0,0,0),Yt=new Wt(1,1,1),$t=new Wt,Zt=new Wt,Kt=new Wt;function Qt(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}Object.assign(Qt.prototype,{isMatrix4:!0,set:function(e,t,n,r,i,a,o,s,l,c,u,h,p,d,f,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=p,g[7]=d,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new Qt).fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this},copyPosition:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},extractBasis:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this},extractRotation:function(e){var t=this.elements,n=e.elements,r=1/qt.setFromMatrixColumn(e,0).length(),i=1/qt.setFromMatrixColumn(e,1).length(),a=1/qt.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),l=Math.sin(r),c=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){var h=a*c,p=a*u,d=o*c,f=o*u;t[0]=s*c,t[4]=-s*u,t[8]=l,t[1]=p+d*l,t[5]=h-f*l,t[9]=-o*s,t[2]=f-h*l,t[6]=d+p*l,t[10]=a*s}else if("YXZ"===e.order){var m=s*c,g=s*u,v=l*c,y=l*u;t[0]=m+y*o,t[4]=v*o-g,t[8]=a*l,t[1]=a*u,t[5]=a*c,t[9]=-o,t[2]=g*o-v,t[6]=y+m*o,t[10]=a*s}else if("ZXY"===e.order)m=s*c,g=s*u,v=l*c,y=l*u,t[0]=m-y*o,t[4]=-a*u,t[8]=v+g*o,t[1]=g+v*o,t[5]=a*c,t[9]=y-m*o,t[2]=-a*l,t[6]=o,t[10]=a*s;else if("ZYX"===e.order)h=a*c,p=a*u,d=o*c,f=o*u,t[0]=s*c,t[4]=d*l-p,t[8]=h*l+f,t[1]=s*u,t[5]=f*l+h,t[9]=p*l-d,t[2]=-l,t[6]=o*s,t[10]=a*s;else if("YZX"===e.order){var x=a*s,_=a*l,b=o*s,w=o*l;t[0]=s*c,t[4]=w-x*u,t[8]=b*u+_,t[1]=u,t[5]=a*c,t[9]=-o*c,t[2]=-l*c,t[6]=_*u+b,t[10]=x-w*u}else"XZY"===e.order&&(x=a*s,_=a*l,b=o*s,w=o*l,t[0]=s*c,t[4]=-u,t[8]=l*c,t[1]=x*u+w,t[5]=a*c,t[9]=_*u-b,t[2]=b*u-_,t[6]=o*c,t[10]=w*u+x);return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(e){return this.compose(Xt,e,Yt)},lookAt:function(e,t,n){var r=this.elements;return Kt.subVectors(e,t),0===Kt.lengthSq()&&(Kt.z=1),Kt.normalize(),$t.crossVectors(n,Kt),0===$t.lengthSq()&&(1===Math.abs(n.z)?Kt.x+=1e-4:Kt.z+=1e-4,Kt.normalize(),$t.crossVectors(n,Kt)),$t.normalize(),Zt.crossVectors(Kt,$t),r[0]=$t.x,r[4]=Zt.x,r[8]=Kt.x,r[1]=$t.y,r[5]=Zt.y,r[9]=Kt.y,r[2]=$t.z,r[6]=Zt.z,r[10]=Kt.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],l=n[12],c=n[1],u=n[5],h=n[9],p=n[13],d=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],_=n[15],b=r[0],w=r[4],M=r[8],S=r[12],T=r[1],E=r[5],C=r[9],A=r[13],L=r[2],D=r[6],P=r[10],O=r[14],R=r[3],I=r[7],B=r[11],N=r[15];return i[0]=a*b+o*T+s*L+l*R,i[4]=a*w+o*E+s*D+l*I,i[8]=a*M+o*C+s*P+l*B,i[12]=a*S+o*A+s*O+l*N,i[1]=c*b+u*T+h*L+p*R,i[5]=c*w+u*E+h*D+p*I,i[9]=c*M+u*C+h*P+p*B,i[13]=c*S+u*A+h*O+p*N,i[2]=d*b+f*T+m*L+g*R,i[6]=d*w+f*E+m*D+g*I,i[10]=d*M+f*C+m*P+g*B,i[14]=d*S+f*A+m*O+g*N,i[3]=v*b+y*T+x*L+_*R,i[7]=v*w+y*E+x*D+_*I,i[11]=v*M+y*C+x*P+_*B,i[15]=v*S+y*A+x*O+_*N,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},determinant:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],l=e[13],c=e[2],u=e[6],h=e[10],p=e[14];return e[3]*(i*s*u-r*l*u-i*o*h+n*l*h+r*o*p-n*s*p)+e[7]*(t*s*p-t*l*h+i*a*h-r*a*p+r*l*c-i*s*c)+e[11]*(t*l*u-t*o*p-i*a*u+n*a*p+i*o*c-n*l*c)+e[15]*(-r*o*c-t*s*u+t*o*h+r*a*u-n*a*h+n*s*c)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(e,t,n){var r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this},getInverse:function(e,t){var n=this.elements,r=e.elements,i=r[0],a=r[1],o=r[2],s=r[3],l=r[4],c=r[5],u=r[6],h=r[7],p=r[8],d=r[9],f=r[10],m=r[11],g=r[12],v=r[13],y=r[14],x=r[15],_=d*y*h-v*f*h+v*u*m-c*y*m-d*u*x+c*f*x,b=g*f*h-p*y*h-g*u*m+l*y*m+p*u*x-l*f*x,w=p*v*h-g*d*h+g*c*m-l*v*m-p*c*x+l*d*x,M=g*d*u-p*v*u-g*c*f+l*v*f+p*c*y-l*d*y,S=i*_+a*b+o*w+s*M;if(0==S){var T="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(T);return console.warn(T),this.identity()}var E=1/S;return n[0]=_*E,n[1]=(v*f*s-d*y*s-v*o*m+a*y*m+d*o*x-a*f*x)*E,n[2]=(c*y*s-v*u*s+v*o*h-a*y*h-c*o*x+a*u*x)*E,n[3]=(d*u*s-c*f*s-d*o*h+a*f*h+c*o*m-a*u*m)*E,n[4]=b*E,n[5]=(p*y*s-g*f*s+g*o*m-i*y*m-p*o*x+i*f*x)*E,n[6]=(g*u*s-l*y*s-g*o*h+i*y*h+l*o*x-i*u*x)*E,n[7]=(l*f*s-p*u*s+p*o*h-i*f*h-l*o*m+i*u*m)*E,n[8]=w*E,n[9]=(g*d*s-p*v*s-g*a*m+i*v*m+p*a*x-i*d*x)*E,n[10]=(l*v*s-g*c*s+g*a*h-i*v*h-l*a*x+i*c*x)*E,n[11]=(p*c*s-l*d*s-p*a*h+i*d*h+l*a*m-i*c*m)*E,n[12]=M*E,n[13]=(p*v*o-g*d*o+g*a*f-i*v*f-p*a*y+i*d*y)*E,n[14]=(g*c*o-l*v*o-g*a*u+i*v*u+l*a*y-i*c*y)*E,n[15]=(l*d*o-p*c*o+p*a*u-i*d*u-l*a*f+i*c*f)*E,this},scale:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))},makeTranslation:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,l=i*a,c=i*o;return this.set(l*a+n,l*o-r*s,l*s+r*o,0,l*o+r*s,c*o+n,c*s-r*a,0,l*s-r*o,c*s+r*a,i*s*s+n,0,0,0,0,1),this},makeScale:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,n){var r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,l=i+i,c=a+a,u=o+o,h=i*l,p=i*c,d=i*u,f=a*c,m=a*u,g=o*u,v=s*l,y=s*c,x=s*u,_=n.x,b=n.y,w=n.z;return r[0]=(1-(f+g))*_,r[1]=(p+x)*_,r[2]=(d-y)*_,r[3]=0,r[4]=(p-x)*b,r[5]=(1-(h+g))*b,r[6]=(m+v)*b,r[7]=0,r[8]=(d+y)*w,r[9]=(m-v)*w,r[10]=(1-(h+f))*w,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this},decompose:function(e,t,n){var r=this.elements,i=qt.set(r[0],r[1],r[2]).length(),a=qt.set(r[4],r[5],r[6]).length(),o=qt.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],Jt.copy(this);var s=1/i,l=1/a,c=1/o;return Jt.elements[0]*=s,Jt.elements[1]*=s,Jt.elements[2]*=s,Jt.elements[4]*=l,Jt.elements[5]*=l,Jt.elements[6]*=l,Jt.elements[8]*=c,Jt.elements[9]*=c,Jt.elements[10]*=c,t.setFromRotationMatrix(Jt),n.x=i,n.y=a,n.z=o,this},makePerspective:function(e,t,n,r,i,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*i/(t-e),l=2*i/(n-r),c=(t+e)/(t-e),u=(n+r)/(n-r),h=-(a+i)/(a-i),p=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=c,o[12]=0,o[1]=0,o[5]=l,o[9]=u,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=p,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(e,t,n,r,i,a){var o=this.elements,s=1/(t-e),l=1/(n-r),c=1/(a-i),u=(t+e)*s,h=(n+r)*l,p=(a+i)*c;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-u,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=-2*c,o[14]=-p,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}});var en=new Qt,tn=new Ut;function nn(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._order=r||nn.DefaultOrder}function rn(){this.mask=1}nn.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],nn.DefaultOrder="XYZ",Object.defineProperties(nn.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}}),Object.assign(nn.prototype,{isEuler:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var r=Rt.clamp,i=e.elements,a=i[0],o=i[4],s=i[8],l=i[1],c=i[5],u=i[9],h=i[2],p=i[6],d=i[10];return"XYZ"===(t=t||this._order)?(this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(p,c),this._z=0)):"YXZ"===t?(this._x=Math.asin(-r(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,a),this._z=0)):"ZXY"===t?(this._x=Math.asin(r(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,a))):"ZYX"===t?(this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(p,d),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-o,c))):"YZX"===t?(this._z=Math.asin(r(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,a)):(this._x=0,this._y=Math.atan2(s,d))):"XZY"===t?(this._z=Math.asin(-r(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-u,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,!1!==n&&this._onChangeCallback(),this},setFromQuaternion:function(e,t,n){return en.makeRotationFromQuaternion(e),this.setFromRotationMatrix(en,t,n)},setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(e){return tn.setFromEuler(this),this.setFromQuaternion(tn,e)},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new Wt(this._x,this._y,this._z)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}}),Object.assign(rn.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask|=1<<e|0},enableAll:function(){this.mask=-1},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},disableAll:function(){this.mask=0},test:function(e){return 0!=(this.mask&e.mask)}});var an=0,on=new Wt,sn=new Ut,ln=new Qt,cn=new Wt,un=new Wt,hn=new Wt,pn=new Ut,dn=new Wt(1,0,0),fn=new Wt(0,1,0),mn=new Wt(0,0,1),gn={type:"added"},vn={type:"removed"};function yn(){Object.defineProperty(this,"id",{value:an++}),this.uuid=Rt.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=yn.DefaultUp.clone();var e=new Wt,t=new nn,n=new Ut,r=new Wt(1,1,1);t._onChange(function(){n.setFromEuler(t,!1)}),n._onChange(function(){t.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Qt},normalMatrix:{value:new Bt}}),this.matrix=new Qt,this.matrixWorld=new Qt,this.matrixAutoUpdate=yn.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new rn,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function xn(){yn.call(this),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}yn.DefaultUp=new Wt(0,1,0),yn.DefaultMatrixAutoUpdate=!0,yn.prototype=Object.assign(Object.create(Lt.prototype),{constructor:yn,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(e,t){return sn.setFromAxisAngle(e,t),this.quaternion.multiply(sn),this},rotateOnWorldAxis:function(e,t){return sn.setFromAxisAngle(e,t),this.quaternion.premultiply(sn),this},rotateX:function(e){return this.rotateOnAxis(dn,e)},rotateY:function(e){return this.rotateOnAxis(fn,e)},rotateZ:function(e){return this.rotateOnAxis(mn,e)},translateOnAxis:function(e,t){return on.copy(e).applyQuaternion(this.quaternion),this.position.add(on.multiplyScalar(t)),this},translateX:function(e){return this.translateOnAxis(dn,e)},translateY:function(e){return this.translateOnAxis(fn,e)},translateZ:function(e){return this.translateOnAxis(mn,e)},localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(e){return e.applyMatrix4(ln.getInverse(this.matrixWorld))},lookAt:function(e,t,n){e.isVector3?cn.copy(e):cn.set(e,t,n);var r=this.parent;this.updateWorldMatrix(!0,!1),un.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ln.lookAt(un,cn,this.up):ln.lookAt(cn,un,this.up),this.quaternion.setFromRotationMatrix(ln),r&&(ln.extractRotation(r.matrixWorld),sn.setFromRotationMatrix(ln),this.quaternion.premultiply(sn.inverse()))},add:function(e){if(1<arguments.length){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",e):e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),(e.parent=this).children.push(e),e.dispatchEvent(gn)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this},remove:function(e){if(1<arguments.length){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var n=this.children.indexOf(e);return-1!==n&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(vn)),this},attach:function(e){return this.updateWorldMatrix(!0,!1),ln.getInverse(this.matrixWorld),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),ln.multiply(e.parent.matrixWorld)),e.applyMatrix4(ln),e.updateWorldMatrix(!1,!1),this.add(e),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var n=0,r=this.children.length;n<r;n++){var i=this.children[n].getObjectByProperty(e,t);if(void 0!==i)return i}},getWorldPosition:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),e=new Wt),this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),e=new Ut),this.updateMatrixWorld(!0),this.matrixWorld.decompose(un,e,hn),e},getWorldScale:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),e=new Wt),this.updateMatrixWorld(!0),this.matrixWorld.decompose(un,pn,e),e},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),e=new Wt),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()},raycast:function(){},traverse:function(e){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),e=!(this.matrixWorldNeedsUpdate=!1));for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)},updateWorldMatrix:function(e,t){var n=this.parent;if(!0===e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t)for(var r=this.children,i=0,a=r.length;i<a;i++)r[i].updateWorldMatrix(!1,!0)},toJSON:function(e){var t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};function i(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);var a=this.geometry.parameters;if(void 0!==a&&void 0!==a.shapes){var o=a.shapes;if(Array.isArray(o))for(var s=0,l=o.length;s<l;s++){var c=o[s];i(e.shapes,c)}else i(e.shapes,o)}}if(void 0!==this.material)if(Array.isArray(this.material)){var u=[];for(s=0,l=this.material.length;s<l;s++)u.push(i(e.materials,this.material[s]));r.material=u}else r.material=i(e.materials,this.material);if(0<this.children.length)for(r.children=[],s=0;s<this.children.length;s++)r.children.push(this.children[s].toJSON(e).object);if(t){var h=m(e.geometries),p=m(e.materials),d=m(e.textures),f=m(e.images);o=m(e.shapes),0<h.length&&(n.geometries=h),0<p.length&&(n.materials=p),0<d.length&&(n.textures=d),0<f.length&&(n.images=f),0<o.length&&(n.shapes=o)}return n.object=r,n;function m(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var n=0;n<e.children.length;n++){var r=e.children[n];this.add(r.clone())}return this}}),xn.prototype=Object.assign(Object.create(yn.prototype),{constructor:xn,isScene:!0,copy:function(e,t){return yn.prototype.copy.call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var t=yn.prototype.toJSON.call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.environment&&(t.object.environment=this.environment.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t},dispose:function(){this.dispatchEvent({type:"dispose"})}});var _n=[new Wt,new Wt,new Wt,new Wt,new Wt,new Wt,new Wt,new Wt],bn=new Wt,wn=new Rn,Mn=new Wt,Sn=new Wt,Tn=new Wt,En=new Wt,Cn=new Wt,An=new Wt,Ln=new Wt,Dn=new Wt,Pn=new Wt,On=new Wt;function Rn(e,t){this.min=void 0!==e?e:new Wt(1/0,1/0,1/0),this.max=void 0!==t?t:new Wt(-1/0,-1/0,-1/0)}function In(e,t,n,r,i){var a,o;for(a=0,o=e.length-3;a<=o;a+=3){On.fromArray(e,a);var s=i.x*Math.abs(On.x)+i.y*Math.abs(On.y)+i.z*Math.abs(On.z),l=t.dot(On),c=n.dot(On),u=r.dot(On);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>s)return!1}return!0}Object.assign(Rn.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,l=e.length;s<l;s+=3){var c=e[s],u=e[s+1],h=e[s+2];c<t&&(t=c),u<n&&(n=u),h<r&&(r=h),i<c&&(i=c),a<u&&(a=u),o<h&&(o=h)}return this.min.set(t,n,r),this.max.set(i,a,o),this},setFromBufferAttribute:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,l=e.count;s<l;s++){var c=e.getX(s),u=e.getY(s),h=e.getZ(s);c<t&&(t=c),u<n&&(n=u),h<r&&(r=h),i<c&&(i=c),a<u&&(a=u),o<h&&(o=h)}return this.min.set(t,n,r),this.max.set(i,a,o),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){var n=bn.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this},setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box3: .getCenter() target is now required"),e=new Wt),this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box3: .getSize() target is now required"),e=new Wt),this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:function(e){e.updateWorldMatrix(!1,!1);var t=e.geometry;void 0!==t&&(null===t.boundingBox&&t.computeBoundingBox(),wn.copy(t.boundingBox),wn.applyMatrix4(e.matrixWorld),this.expandByPoint(wn.min),this.expandByPoint(wn.max));for(var n=e.children,r=0,i=n.length;r<i;r++)this.expandByObject(n[r]);return this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new Wt),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)},intersectsSphere:function(e){return this.clampPoint(e.center,bn),bn.distanceToSquared(e.center)<=e.radius*e.radius},intersectsPlane:function(e){var t,n;return n=0<e.normal.x?(t=e.normal.x*this.min.x,e.normal.x*this.max.x):(t=e.normal.x*this.max.x,e.normal.x*this.min.x),0<e.normal.y?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),0<e.normal.z?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant},intersectsTriangle:function(e){if(this.isEmpty())return!1;this.getCenter(Ln),Dn.subVectors(this.max,Ln),Mn.subVectors(e.a,Ln),Sn.subVectors(e.b,Ln),Tn.subVectors(e.c,Ln),En.subVectors(Sn,Mn),Cn.subVectors(Tn,Sn),An.subVectors(Mn,Tn);var t=[0,-En.z,En.y,0,-Cn.z,Cn.y,0,-An.z,An.y,En.z,0,-En.x,Cn.z,0,-Cn.x,An.z,0,-An.x,-En.y,En.x,0,-Cn.y,Cn.x,0,-An.y,An.x,0];return!!In(t,Mn,Sn,Tn,Dn)&&!!In(t=[1,0,0,0,1,0,0,0,1],Mn,Sn,Tn,Dn)&&(Pn.crossVectors(En,Cn),In(t=[Pn.x,Pn.y,Pn.z],Mn,Sn,Tn,Dn))},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new Wt),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return bn.copy(e).clamp(this.min,this.max).sub(e).length()},getBoundingSphere:function(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(bn).length(),e},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(e){return this.isEmpty()||(_n[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),_n[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),_n[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),_n[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),_n[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),_n[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),_n[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),_n[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(_n)),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var Bn=new Rn;function Nn(e,t){this.center=void 0!==e?e:new Wt,this.radius=void 0!==t?t:0}Object.assign(Nn.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(e,t){var n=this.center;void 0!==t?n.copy(t):Bn.setFromPoints(e).getCenter(n);for(var r=0,i=0,a=e.length;i<a;i++)r=Math.max(r,n.distanceToSquared(e[i]));return this.radius=Math.sqrt(r),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,t){var n=this.center.distanceToSquared(e);return void 0===t&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),t=new Wt),t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t},getBoundingBox:function(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new Rn),e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}});var kn=new Wt,Fn=new Wt,Gn=new Wt,Vn=new Wt,zn=new Wt,Un=new Wt,jn=new Wt;function Hn(e,t){this.origin=void 0!==e?e:new Wt,this.direction=void 0!==t?t:new Wt(0,0,-1)}Object.assign(Hn.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new Wt),t.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(e){return this.origin.copy(this.at(e,kn)),this},closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new Wt),t.subVectors(e,this.origin);var n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(e){var t=kn.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(kn.copy(this.direction).multiplyScalar(t).add(this.origin),kn.distanceToSquared(e))},distanceSqToSegment:function(e,t,n,r){Fn.copy(e).add(t).multiplyScalar(.5),Gn.copy(t).sub(e).normalize(),Vn.copy(this.origin).sub(Fn);var i,a,o,s,l=.5*e.distanceTo(t),c=-this.direction.dot(Gn),u=Vn.dot(this.direction),h=-Vn.dot(Gn),p=Vn.lengthSq(),d=Math.abs(1-c*c);if(0<d)if(a=c*u-h,s=l*d,0<=(i=c*h-u))if(-s<=a)if(a<=s){var f=1/d;o=(i*=f)*(i+c*(a*=f)+2*u)+a*(c*i+a+2*h)+p}else a=l,o=-(i=Math.max(0,-(c*a+u)))*i+a*(a+2*h)+p;else a=-l,o=-(i=Math.max(0,-(c*a+u)))*i+a*(a+2*h)+p;else o=a<=-s?-(i=Math.max(0,-(-c*l+u)))*i+(a=0<i?-l:Math.min(Math.max(-l,-h),l))*(a+2*h)+p:a<=s?(i=0,(a=Math.min(Math.max(-l,-h),l))*(a+2*h)+p):-(i=Math.max(0,-(c*l+u)))*i+(a=0<i?l:Math.min(Math.max(-l,-h),l))*(a+2*h)+p;else a=0<c?-l:l,o=-(i=Math.max(0,-(c*a+u)))*i+a*(a+2*h)+p;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(Gn).multiplyScalar(a).add(Fn),o},intersectSphere:function(e,t){kn.subVectors(e.center,this.origin);var n=kn.dot(this.direction),r=kn.dot(kn)-n*n,i=e.radius*e.radius;if(i<r)return null;var a=Math.sqrt(i-r),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,t):this.at(o,t)},intersectsSphere:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return 0<=n?n:null},intersectPlane:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0},intersectBox:function(e,t){var n,r,i,a,o,s,l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return r=0<=l?(n=(e.min.x-h.x)*l,(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,(e.min.x-h.x)*l),(a=0<=c?(i=(e.min.y-h.y)*c,(e.max.y-h.y)*c):(i=(e.max.y-h.y)*c,(e.min.y-h.y)*c))<n||r<i?null:((n<i||n!=n)&&(n=i),(a<r||r!=r)&&(r=a),(s=0<=u?(o=(e.min.z-h.z)*u,(e.max.z-h.z)*u):(o=(e.max.z-h.z)*u,(e.min.z-h.z)*u))<n||r<o?null:((n<o||n!=n)&&(n=o),(s<r||r!=r)&&(r=s),r<0?null:this.at(0<=n?n:r,t)))},intersectsBox:function(e){return null!==this.intersectBox(e,kn)},intersectTriangle:function(e,t,n,r,i){zn.subVectors(t,e),Un.subVectors(n,e),jn.crossVectors(zn,Un);var a,o=this.direction.dot(jn);if(0<o){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}Vn.subVectors(this.origin,e);var s=a*this.direction.dot(Un.crossVectors(Vn,Un));if(s<0)return null;var l=a*this.direction.dot(zn.cross(Vn));if(l<0)return null;if(o<s+l)return null;var c=-a*Vn.dot(jn);return c<0?null:this.at(c/o,i)},applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}});var Wn=new Wt,qn=new Wt,Jn=new Bt;function Xn(e,t){this.normal=void 0!==e?e:new Wt(1,0,0),this.constant=void 0!==t?t:0}Object.assign(Xn.prototype,{isPlane:!0,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(e,t,n){var r=Wn.subVectors(n,t).cross(qn.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return void 0===t&&(console.warn("THREE.Plane: .projectPoint() target is now required"),t=new Wt),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(e,t){void 0===t&&(console.warn("THREE.Plane: .intersectLine() target is now required"),t=new Wt);var n=e.delta(Wn),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):void 0;var i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||1<i?void 0:t.copy(n).multiplyScalar(i).add(e.start)},intersectsLine:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&0<n||n<0&&0<t},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new Wt),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(e,t){var n=t||Jn.getNormalMatrix(e),r=this.coplanarPoint(Wn).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this},translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}});var Yn=new Wt,$n=new Wt,Zn=new Wt,Kn=new Wt,Qn=new Wt,er=new Wt,tr=new Wt,nr=new Wt,rr=new Wt,ir=new Wt;function ar(e,t,n){this.a=void 0!==e?e:new Wt,this.b=void 0!==t?t:new Wt,this.c=void 0!==n?n:new Wt}Object.assign(ar,{getNormal:function(e,t,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new Wt),r.subVectors(n,t),Yn.subVectors(e,t),r.cross(Yn);var i=r.lengthSq();return 0<i?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)},getBarycoord:function(e,t,n,r,i){Yn.subVectors(r,t),$n.subVectors(n,t),Zn.subVectors(e,t);var a=Yn.dot(Yn),o=Yn.dot($n),s=Yn.dot(Zn),l=$n.dot($n),c=$n.dot(Zn),u=a*l-o*o;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new Wt),0==u)return i.set(-2,-1,-1);var h=1/u,p=(l*s-o*c)*h,d=(a*c-o*s)*h;return i.set(1-p-d,d,p)},containsPoint:function(e,t,n,r){return ar.getBarycoord(e,t,n,r,Kn),0<=Kn.x&&0<=Kn.y&&Kn.x+Kn.y<=1},getUV:function(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,Kn),s.set(0,0),s.addScaledVector(i,Kn.x),s.addScaledVector(a,Kn.y),s.addScaledVector(o,Kn.z),s},isFrontFacing:function(e,t,n,r){return Yn.subVectors(n,t),$n.subVectors(e,t),Yn.cross($n).dot(r)<0}}),Object.assign(ar.prototype,{set:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},setFromPointsAndIndices:function(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},getArea:function(){return Yn.subVectors(this.c,this.b),$n.subVectors(this.a,this.b),.5*Yn.cross($n).length()},getMidpoint:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new Wt),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return ar.getNormal(this.a,this.b,this.c,e)},getPlane:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new Xn),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,t){return ar.getBarycoord(e,this.a,this.b,this.c,t)},getUV:function(e,t,n,r,i){return ar.getUV(e,this.a,this.b,this.c,t,n,r,i)},containsPoint:function(e){return ar.containsPoint(e,this.a,this.b,this.c)},isFrontFacing:function(e){return ar.isFrontFacing(this.a,this.b,this.c,e)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new Wt);var n,r,i=this.a,a=this.b,o=this.c;Qn.subVectors(a,i),er.subVectors(o,i),nr.subVectors(e,i);var s=Qn.dot(nr),l=er.dot(nr);if(s<=0&&l<=0)return t.copy(i);rr.subVectors(e,a);var c=Qn.dot(rr),u=er.dot(rr);if(0<=c&&u<=c)return t.copy(a);var h=s*u-c*l;if(h<=0&&0<=s&&c<=0)return n=s/(s-c),t.copy(i).addScaledVector(Qn,n);ir.subVectors(e,o);var p=Qn.dot(ir),d=er.dot(ir);if(0<=d&&p<=d)return t.copy(o);var f=p*l-s*d;if(f<=0&&0<=l&&d<=0)return r=l/(l-d),t.copy(i).addScaledVector(er,r);var m=c*d-p*u;if(m<=0&&0<=u-c&&0<=p-d)return tr.subVectors(o,a),r=(u-c)/(u-c+(p-d)),t.copy(a).addScaledVector(tr,r);var g=1/(m+f+h);return n=f*g,r=h*g,t.copy(i).addScaledVector(Qn,n).addScaledVector(er,r)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}});var or={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},sr={h:0,s:0,l:0},lr={h:0,s:0,l:0};function cr(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}function ur(e,t,n){return n<0&&(n+=1),1<n&&--n,n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function hr(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function pr(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}function dr(e,t,n,r,i,a){this.a=e,this.b=t,this.c=n,this.normal=r&&r.isVector3?r:new Wt,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new cr,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==a?a:0}Object.assign(cr.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,n){return this.r=e,this.g=t,this.b=n,this},setHSL:function(e,t,n){if(e=Rt.euclideanModulo(e,1),t=Rt.clamp(t,0,1),n=Rt.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=ur(i,r,e+1/3),this.g=ur(i,r,e),this.b=ur(i,r,e-1/3)}return this},setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var r,i=n[1],a=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,l=parseInt(r[3],10)/100;return t(r[5]),this.setHSL(o,s,l)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var c=n[1],u=c.length;if(3===u)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===u)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return e&&0<e.length?this.setColorName(e):this},setColorName:function(e){var t=or[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var n=0<t?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this},convertGammaToLinear:function(e){return this.copyGammaToLinear(this,e),this},convertLinearToGamma:function(e){return this.copyLinearToGamma(this,e),this},copySRGBToLinear:function(e){return this.r=hr(e.r),this.g=hr(e.g),this.b=hr(e.b),this},copyLinearToSRGB:function(e){return this.r=pr(e.r),this.g=pr(e.g),this.b=pr(e.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,n,r=this.r,i=this.g,a=this.b,o=Math.max(r,i,a),s=Math.min(r,i,a),l=(s+o)/2;if(s===o)n=t=0;else{var c=o-s;switch(n=l<=.5?c/(o+s):c/(2-o-s),o){case r:t=(i-a)/c+(i<a?6:0);break;case i:t=(a-r)/c+2;break;case a:t=(r-i)/c+4}t/=6}return e.h=t,e.s=n,e.l=l,e},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,n){return this.getHSL(sr),sr.h+=e,sr.s+=t,sr.l+=n,this.setHSL(sr.h,sr.s,sr.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},lerpHSL:function(e,t){this.getHSL(sr),e.getHSL(lr);var n=Rt.lerp(sr.h,lr.h,t),r=Rt.lerp(sr.s,lr.s,t),i=Rt.lerp(sr.l,lr.l,t);return this.setHSL(n,r,i),this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}}),cr.NAMES=or,Object.assign(dr.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,n=e.vertexNormals.length;t<n;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(t=0,n=e.vertexColors.length;t<n;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}});var fr=0;function mr(){Object.defineProperty(this,"id",{value:fr++}),this.uuid=Rt.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=d,this.side=s,this.flatShading=!1,this.vertexTangents=!1,this.vertexColors=u,this.opacity=1,this.transparent=!1,this.blendSrc=C,this.blendDst=A,this.blendEquation=y,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=k,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Et,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Tt,this.stencilZFail=Tt,this.stencilZPass=Tt,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function gr(e){mr.call(this),this.type="MeshBasicMaterial",this.color=new cr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=U,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.setValues(e)}mr.prototype=Object.assign(Object.create(Lt.prototype),{constructor:mr,isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n)if("shading"!==t){var r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(e){var t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,n.reflectivity=this.reflectivity,n.refractionRatio=this.refractionRatio,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==d&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),this.side!==s&&(n.side=this.side),this.vertexColors!==u&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),0<this.alphaTest&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),1<this.wireframeLinewidth&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){var i=r(e.textures),a=r(e.images);0<i.length&&(n.textures=i),0<a.length&&(n.images=a)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexTangents=e.vertexTangents,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,n=null;if(null!==t){var r=t.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(mr.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),((gr.prototype=Object.create(mr.prototype)).constructor=gr).prototype.isMeshBasicMaterial=!0,gr.prototype.copy=function(e){return mr.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this};var vr=new Wt;function yr(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=Ct,this.updateRange={offset:0,count:-1},this.version=0}function xr(e,t,n){yr.call(this,new Int8Array(e),t,n)}function _r(e,t,n){yr.call(this,new Uint8Array(e),t,n)}function br(e,t,n){yr.call(this,new Uint8ClampedArray(e),t,n)}function wr(e,t,n){yr.call(this,new Int16Array(e),t,n)}function Mr(e,t,n){yr.call(this,new Uint16Array(e),t,n)}function Sr(e,t,n){yr.call(this,new Int32Array(e),t,n)}function Tr(e,t,n){yr.call(this,new Uint32Array(e),t,n)}function Er(e,t,n){yr.call(this,new Float32Array(e),t,n)}function Cr(e,t,n){yr.call(this,new Float64Array(e),t,n)}function Ar(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function Lr(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,r=e.length;n<r;++n)e[n]>t&&(t=e[n]);return t}Object.defineProperty(yr.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(yr.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),a=new cr),t[n++]=a.r,t[n++]=a.g,t[n++]=a.b}return this},copyVector2sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),a=new It),t[n++]=a.x,t[n++]=a.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),a=new Wt),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),a=new Gt),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n++]=a.w}return this},applyMatrix3:function(e){for(var t=0,n=this.count;t<n;t++)vr.x=this.getX(t),vr.y=this.getY(t),vr.z=this.getZ(t),vr.applyMatrix3(e),this.setXYZ(t,vr.x,vr.y,vr.z);return this},applyMatrix4:function(e){for(var t=0,n=this.count;t<n;t++)vr.x=this.getX(t),vr.y=this.getY(t),vr.z=this.getZ(t),vr.applyMatrix4(e),this.setXYZ(t,vr.x,vr.y,vr.z);return this},applyNormalMatrix:function(e){for(var t=0,n=this.count;t<n;t++)vr.x=this.getX(t),vr.y=this.getY(t),vr.z=this.getZ(t),vr.applyNormalMatrix(e),this.setXYZ(t,vr.x,vr.y,vr.z);return this},transformDirection:function(e){for(var t=0,n=this.count;t<n;t++)vr.x=this.getX(t),vr.y=this.getY(t),vr.z=this.getZ(t),vr.transformDirection(e),this.setXYZ(t,vr.x,vr.y,vr.z);return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),(xr.prototype=Object.create(yr.prototype)).constructor=xr,(_r.prototype=Object.create(yr.prototype)).constructor=_r,(br.prototype=Object.create(yr.prototype)).constructor=br,(wr.prototype=Object.create(yr.prototype)).constructor=wr,(Mr.prototype=Object.create(yr.prototype)).constructor=Mr,(Sr.prototype=Object.create(yr.prototype)).constructor=Sr,(Tr.prototype=Object.create(yr.prototype)).constructor=Tr,(Er.prototype=Object.create(yr.prototype)).constructor=Er,(Cr.prototype=Object.create(yr.prototype)).constructor=Cr,Object.assign(Ar.prototype,{computeGroups:function(e){for(var t,n=[],r=void 0,i=e.faces,a=0;a<i.length;a++){var o=i[a];o.materialIndex!==r&&(r=o.materialIndex,void 0!==t&&(t.count=3*a-t.start,n.push(t)),t={start:3*a,materialIndex:r})}void 0!==t&&(t.count=3*a-t.start,n.push(t)),this.groups=n},fromGeometry:function(e){var t,n=e.faces,r=e.vertices,i=e.faceVertexUvs,a=i[0]&&0<i[0].length,o=i[1]&&0<i[1].length,s=e.morphTargets,l=s.length;if(0<l){t=[];for(var c=0;c<l;c++)t[c]={name:s[c].name,data:[]};this.morphTargets.position=t}var u,h=e.morphNormals,p=h.length;if(0<p){for(u=[],c=0;c<p;c++)u[c]={name:h[c].name,data:[]};this.morphTargets.normal=u}var d=e.skinIndices,f=e.skinWeights,m=d.length===r.length,g=f.length===r.length;for(0<r.length&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported."),c=0;c<n.length;c++){var v=n[c];this.vertices.push(r[v.a],r[v.b],r[v.c]);var y=v.vertexNormals;if(3===y.length)this.normals.push(y[0],y[1],y[2]);else{var x=v.normal;this.normals.push(x,x,x)}var _,b=v.vertexColors;if(3===b.length)this.colors.push(b[0],b[1],b[2]);else{var w=v.color;this.colors.push(w,w,w)}!0===a&&(void 0!==(_=i[0][c])?this.uvs.push(_[0],_[1],_[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",c),this.uvs.push(new It,new It,new It))),!0===o&&(void 0!==(_=i[1][c])?this.uvs2.push(_[0],_[1],_[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",c),this.uvs2.push(new It,new It,new It)));for(var M=0;M<l;M++){var S=s[M].vertices;t[M].data.push(S[v.a],S[v.b],S[v.c])}for(M=0;M<p;M++){var T=h[M].vertexNormals[c];u[M].data.push(T.a,T.b,T.c)}m&&this.skinIndices.push(d[v.a],d[v.b],d[v.c]),g&&this.skinWeights.push(f[v.a],f[v.b],f[v.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this}});var Dr=2147483647,Pr=new Qt,Or=new yn,Rr=new Wt,Ir=new Rn,Br=new Rn,Nr=new Wt;function kr(){Object.defineProperty(this,"id",{value:Dr+=2}),this.uuid=Rt.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}kr.prototype=Object.assign(Object.create(Lt.prototype),{constructor:kr,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(65535<Lr(e)?Tr:Mr)(e,1):this.index=e},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,n){this.groups.push({start:e,count:t,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var r=(new Bt).getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return Pr.makeRotationX(e),this.applyMatrix4(Pr),this},rotateY:function(e){return Pr.makeRotationY(e),this.applyMatrix4(Pr),this},rotateZ:function(e){return Pr.makeRotationZ(e),this.applyMatrix4(Pr),this},translate:function(e,t,n){return Pr.makeTranslation(e,t,n),this.applyMatrix4(Pr),this},scale:function(e,t,n){return Pr.makeScale(e,t,n),this.applyMatrix4(Pr),this},lookAt:function(e){return Or.lookAt(e),Or.updateMatrix(),this.applyMatrix4(Or.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Rr).negate(),this.translate(Rr.x,Rr.y,Rr.z),this},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new Er(3*t.vertices.length,3),r=new Er(3*t.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(t.vertices)),this.setAttribute("color",r.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var i=new Er(t.lineDistances.length,1);this.setAttribute("lineDistance",i.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];t.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new Er(t,3)),this},updateFromObject:function(e){var t,n=e.geometry;if(e.isMesh){var r=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(r=void 0,n.elementsNeedUpdate=!1),void 0===r)return this.fromGeometry(n);r.verticesNeedUpdate=n.verticesNeedUpdate,r.normalsNeedUpdate=n.normalsNeedUpdate,r.colorsNeedUpdate=n.colorsNeedUpdate,r.uvsNeedUpdate=n.uvsNeedUpdate,r.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=r}return!0===n.verticesNeedUpdate&&(void 0!==(t=this.attributes.position)&&(t.copyVector3sArray(n.vertices),t.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(t=this.attributes.normal)&&(t.copyVector3sArray(n.normals),t.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(t=this.attributes.color)&&(t.copyColorsArray(n.colors),t.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(t=this.attributes.uv)&&(t.copyVector2sArray(n.uvs),t.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(t=this.attributes.lineDistance)&&(t.copyArray(n.lineDistances),t.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(e.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new Ar).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.setAttribute("position",new yr(t,3).copyVector3sArray(e.vertices)),0<e.normals.length){var n=new Float32Array(3*e.normals.length);this.setAttribute("normal",new yr(n,3).copyVector3sArray(e.normals))}if(0<e.colors.length){var r=new Float32Array(3*e.colors.length);this.setAttribute("color",new yr(r,3).copyColorsArray(e.colors))}if(0<e.uvs.length){var i=new Float32Array(2*e.uvs.length);this.setAttribute("uv",new yr(i,2).copyVector2sArray(e.uvs))}if(0<e.uvs2.length){var a=new Float32Array(2*e.uvs2.length);this.setAttribute("uv2",new yr(a,2).copyVector2sArray(e.uvs2))}for(var o in this.groups=e.groups,e.morphTargets){for(var s=[],l=e.morphTargets[o],c=0,u=l.length;c<u;c++){var h=l[c],p=new Er(3*h.data.length,3);p.name=h.name,s.push(p.copyVector3sArray(h.data))}this.morphAttributes[o]=s}if(0<e.skinIndices.length){var d=new Er(4*e.skinIndices.length,4);this.setAttribute("skinIndex",d.copyVector4sArray(e.skinIndices))}if(0<e.skinWeights.length){var f=new Er(4*e.skinWeights.length,4);this.setAttribute("skinWeight",f.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Rn);var e=this.attributes.position,t=this.morphAttributes.position;if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(var n=0,r=t.length;n<r;n++){var i=t[n];Ir.setFromBufferAttribute(i),this.morphTargetsRelative?(Nr.addVectors(this.boundingBox.min,Ir.min),this.boundingBox.expandByPoint(Nr),Nr.addVectors(this.boundingBox.max,Ir.max),this.boundingBox.expandByPoint(Nr)):(this.boundingBox.expandByPoint(Ir.min),this.boundingBox.expandByPoint(Ir.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Nn);var e=this.attributes.position,t=this.morphAttributes.position;if(e){var n=this.boundingSphere.center;if(Ir.setFromBufferAttribute(e),t)for(var r=0,i=t.length;r<i;r++){var a=t[r];Br.setFromBufferAttribute(a),this.morphTargetsRelative?(Nr.addVectors(Ir.min,Br.min),Ir.expandByPoint(Nr),Nr.addVectors(Ir.max,Br.max),Ir.expandByPoint(Nr)):(Ir.expandByPoint(Br.min),Ir.expandByPoint(Br.max))}Ir.getCenter(n);var o=0;for(r=0,i=e.count;r<i;r++)Nr.fromBufferAttribute(e,r),o=Math.max(o,n.distanceToSquared(Nr));if(t)for(r=0,i=t.length;r<i;r++){a=t[r];for(var s=this.morphTargetsRelative,l=0,c=a.count;l<c;l++)Nr.fromBufferAttribute(a,l),s&&(Rr.fromBufferAttribute(e,l),Nr.add(Rr)),o=Math.max(o,n.distanceToSquared(Nr))}this.boundingSphere.radius=Math.sqrt(o),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,t=this.attributes;if(t.position){var n=t.position.array;if(void 0===t.normal)this.setAttribute("normal",new yr(new Float32Array(n.length),3));else for(var r=t.normal.array,i=0,a=r.length;i<a;i++)r[i]=0;var o,s,l,c=t.normal.array,u=new Wt,h=new Wt,p=new Wt,d=new Wt,f=new Wt;if(e){var m=e.array;for(i=0,a=e.count;i<a;i+=3)o=3*m[i+0],s=3*m[i+1],l=3*m[i+2],u.fromArray(n,o),h.fromArray(n,s),p.fromArray(n,l),d.subVectors(p,h),f.subVectors(u,h),d.cross(f),c[o]+=d.x,c[1+o]+=d.y,c[2+o]+=d.z,c[s]+=d.x,c[1+s]+=d.y,c[2+s]+=d.z,c[l]+=d.x,c[1+l]+=d.y,c[2+l]+=d.z}else for(i=0,a=n.length;i<a;i+=9)u.fromArray(n,i),h.fromArray(n,i+3),p.fromArray(n,i+6),d.subVectors(p,h),f.subVectors(u,h),d.cross(f),c[i]=d.x,c[i+1]=d.y,c[i+2]=d.z,c[i+3]=d.x,c[i+4]=d.y,c[i+5]=d.z,c[i+6]=d.x,c[i+7]=d.y,c[i+8]=d.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge:function(e,t){if(e&&e.isBufferGeometry){void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var r in n)if(void 0!==e.attributes[r])for(var i=n[r].array,a=e.attributes[r],o=a.array,s=a.itemSize*t,l=Math.min(o.length,i.length-s),c=0,u=s;c<l;c++,u++)i[u]=o[c];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)},normalizeNormals:function(){for(var e=this.attributes.normal,t=0,n=e.count;t<n;t++)Nr.x=e.getX(t),Nr.y=e.getY(t),Nr.z=e.getZ(t),Nr.normalize(),e.setXYZ(t,Nr.x,Nr.y,Nr.z)},toNonIndexed:function(){function e(e,t){for(var n=e.array,r=e.itemSize,i=new n.constructor(t.length*r),a=0,o=0,s=0,l=t.length;s<l;s++){a=t[s]*r;for(var c=0;c<r;c++)i[o++]=n[a++]}return new yr(i,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new kr,n=this.index.array,r=this.attributes;for(var i in r){var a=e(r[i],n);t.setAttribute(i,a)}var o=this.morphAttributes;for(i in o){for(var s=[],l=o[i],c=0,u=l.length;c<u;c++)a=e(l[c],n),s.push(a);t.morphAttributes[i]=s}t.morphTargetsRelative=this.morphTargetsRelative;for(var h=this.groups,p=(c=0,h.length);c<p;c++){var d=h[c];t.addGroup(d.start,d.count,d.materialIndex)}return t},toJSON:function(){var e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),0<Object.keys(this.userData).length&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var r=this.index;null!==r&&(e.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});var i=this.attributes;for(var n in i){var a=(p=i[n]).toJSON();""!==p.name&&(a.name=p.name),e.data.attributes[n]=a}var o={},s=!1;for(var n in this.morphAttributes){for(var l=this.morphAttributes[n],c=[],u=0,h=l.length;u<h;u++){var p;a=(p=l[u]).toJSON(),""!==p.name&&(a.name=p.name),c.push(a)}0<c.length&&(o[n]=c,s=!0)}s&&(e.data.morphAttributes=o,e.data.morphTargetsRelative=this.morphTargetsRelative);var d=this.groups;0<d.length&&(e.data.groups=JSON.parse(JSON.stringify(d)));var f=this.boundingSphere;return null!==f&&(e.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),e},clone:function(){return(new kr).copy(this)},copy:function(e){var t,n,r;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var i=e.index;null!==i&&this.setIndex(i.clone());var a=e.attributes;for(t in a){var o=a[t];this.setAttribute(t,o.clone())}var s=e.morphAttributes;for(t in s){var l=[],c=s[t];for(n=0,r=c.length;n<r;n++)l.push(c[n].clone());this.morphAttributes[t]=l}this.morphTargetsRelative=e.morphTargetsRelative;var u=e.groups;for(n=0,r=u.length;n<r;n++){var h=u[n];this.addGroup(h.start,h.count,h.materialIndex)}var p=e.boundingBox;null!==p&&(this.boundingBox=p.clone());var d=e.boundingSphere;return null!==d&&(this.boundingSphere=d.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Fr=new Qt,Gr=new Hn,Vr=new Nn,zr=new Wt,Ur=new Wt,jr=new Wt,Hr=new Wt,Wr=new Wt,qr=new Wt,Jr=new Wt,Xr=new Wt,Yr=new Wt,$r=new It,Zr=new It,Kr=new It,Qr=new Wt,ei=new Wt;function ti(e,t){yn.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new kr,this.material=void 0!==t?t:new gr,this.updateMorphTargets()}function ni(e,t,n,r,i,a,o,s){if(null===(t.side===l?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,t.side!==c,s)))return null;ei.copy(s),ei.applyMatrix4(e.matrixWorld);var u=n.ray.origin.distanceTo(ei);return u<n.near||u>n.far?null:{distance:u,point:ei.clone(),object:e}}function ri(e,t,n,r,i,a,o,s,l,c,u,h){zr.fromBufferAttribute(i,c),Ur.fromBufferAttribute(i,u),jr.fromBufferAttribute(i,h);var p=e.morphTargetInfluences;if(t.morphTargets&&a&&p){Jr.set(0,0,0),Xr.set(0,0,0),Yr.set(0,0,0);for(var d=0,f=a.length;d<f;d++){var m=p[d],g=a[d];0!==m&&(Hr.fromBufferAttribute(g,c),Wr.fromBufferAttribute(g,u),qr.fromBufferAttribute(g,h),o?(Jr.addScaledVector(Hr,m),Xr.addScaledVector(Wr,m),Yr.addScaledVector(qr,m)):(Jr.addScaledVector(Hr.sub(zr),m),Xr.addScaledVector(Wr.sub(Ur),m),Yr.addScaledVector(qr.sub(jr),m)))}zr.add(Jr),Ur.add(Xr),jr.add(Yr)}var v=ni(e,t,n,r,zr,Ur,jr,Qr);if(v){s&&($r.fromBufferAttribute(s,c),Zr.fromBufferAttribute(s,u),Kr.fromBufferAttribute(s,h),v.uv=ar.getUV(Qr,zr,Ur,jr,$r,Zr,Kr,new It)),l&&($r.fromBufferAttribute(l,c),Zr.fromBufferAttribute(l,u),Kr.fromBufferAttribute(l,h),v.uv2=ar.getUV(Qr,zr,Ur,jr,$r,Zr,Kr,new It));var y=new dr(c,u,h);ar.getNormal(zr,Ur,jr,y.normal),v.face=y}return v}ti.prototype=Object.assign(Object.create(yn.prototype),{constructor:ti,isMesh:!0,copy:function(e){return yn.prototype.copy.call(this,e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e,t,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,a=Object.keys(i);if(0<a.length){var o=i[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=r.morphTargets;void 0!==s&&0<s.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){var n,r=this.geometry,i=this.material,a=this.matrixWorld;if(void 0!==i&&(null===r.boundingSphere&&r.computeBoundingSphere(),Vr.copy(r.boundingSphere),Vr.applyMatrix4(a),!1!==e.ray.intersectsSphere(Vr)&&(Fr.getInverse(a),Gr.copy(e.ray).applyMatrix4(Fr),null===r.boundingBox||!1!==Gr.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var o,s,l,c,u,h,p,d,f,m=r.index,g=r.attributes.position,v=r.morphAttributes.position,y=r.morphTargetsRelative,x=r.attributes.uv,_=r.attributes.uv2,b=r.groups,w=r.drawRange;if(null!==m)if(Array.isArray(i))for(c=0,h=b.length;c<h;c++)for(f=i[(d=b[c]).materialIndex],u=Math.max(d.start,w.start),p=Math.min(d.start+d.count,w.start+w.count);u<p;u+=3)o=m.getX(u),s=m.getX(u+1),l=m.getX(u+2),(n=ri(this,f,e,Gr,g,v,y,x,_,o,s,l))&&(n.faceIndex=Math.floor(u/3),n.face.materialIndex=d.materialIndex,t.push(n));else for(c=Math.max(0,w.start),h=Math.min(m.count,w.start+w.count);c<h;c+=3)o=m.getX(c),s=m.getX(c+1),l=m.getX(c+2),(n=ri(this,i,e,Gr,g,v,y,x,_,o,s,l))&&(n.faceIndex=Math.floor(c/3),t.push(n));else if(void 0!==g)if(Array.isArray(i))for(c=0,h=b.length;c<h;c++)for(f=i[(d=b[c]).materialIndex],u=Math.max(d.start,w.start),p=Math.min(d.start+d.count,w.start+w.count);u<p;u+=3)(n=ri(this,f,e,Gr,g,v,y,x,_,o=u,s=u+1,l=u+2))&&(n.faceIndex=Math.floor(u/3),n.face.materialIndex=d.materialIndex,t.push(n));else for(c=Math.max(0,w.start),h=Math.min(g.count,w.start+w.count);c<h;c+=3)(n=ri(this,i,e,Gr,g,v,y,x,_,o=c,s=c+1,l=c+2))&&(n.faceIndex=Math.floor(c/3),t.push(n))}else if(r.isGeometry){var M,S,T,E,C=Array.isArray(i),A=r.vertices,L=r.faces,D=r.faceVertexUvs[0];0<D.length&&(E=D);for(var P=0,O=L.length;P<O;P++){var R=L[P],I=C?i[R.materialIndex]:i;if(void 0!==I&&(M=A[R.a],S=A[R.b],T=A[R.c],n=ni(this,I,e,Gr,M,S,T,Qr))){if(E&&E[P]){var B=E[P];$r.copy(B[0]),Zr.copy(B[1]),Kr.copy(B[2]),n.uv=ar.getUV(Qr,M,S,T,$r,Zr,Kr,new It)}n.face=R,n.faceIndex=P,t.push(n)}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var ii=0,ai=new Qt,oi=new yn,si=new Wt;function li(){Object.defineProperty(this,"id",{value:ii+=2}),this.uuid=Rt.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}li.prototype=Object.assign(Object.create(Lt.prototype),{constructor:li,isGeometry:!0,applyMatrix4:function(e){for(var t=(new Bt).getNormalMatrix(e),n=0,r=this.vertices.length;n<r;n++)this.vertices[n].applyMatrix4(e);for(n=0,r=this.faces.length;n<r;n++){var i=this.faces[n];i.normal.applyMatrix3(t).normalize();for(var a=0,o=i.vertexNormals.length;a<o;a++)i.vertexNormals[a].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(e){return ai.makeRotationX(e),this.applyMatrix4(ai),this},rotateY:function(e){return ai.makeRotationY(e),this.applyMatrix4(ai),this},rotateZ:function(e){return ai.makeRotationZ(e),this.applyMatrix4(ai),this},translate:function(e,t,n){return ai.makeTranslation(e,t,n),this.applyMatrix4(ai),this},scale:function(e,t,n){return ai.makeScale(e,t,n),this.applyMatrix4(ai),this},lookAt:function(e){return oi.lookAt(e),oi.updateMatrix(),this.applyMatrix4(oi.matrix),this},fromBufferGeometry:function(e){var t=this,n=null!==e.index?e.index.array:void 0,r=e.attributes;if(void 0===r.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var i=r.position.array,a=void 0!==r.normal?r.normal.array:void 0,o=void 0!==r.color?r.color.array:void 0,s=void 0!==r.uv?r.uv.array:void 0,l=void 0!==r.uv2?r.uv2.array:void 0;void 0!==l&&(this.faceVertexUvs[1]=[]);for(var c=0;c<i.length;c+=3)t.vertices.push((new Wt).fromArray(i,c)),void 0!==o&&t.colors.push((new cr).fromArray(o,c));function u(e,n,r,i){var c=void 0===o?[]:[t.colors[e].clone(),t.colors[n].clone(),t.colors[r].clone()],u=new dr(e,n,r,void 0===a?[]:[(new Wt).fromArray(a,3*e),(new Wt).fromArray(a,3*n),(new Wt).fromArray(a,3*r)],c,i);t.faces.push(u),void 0!==s&&t.faceVertexUvs[0].push([(new It).fromArray(s,2*e),(new It).fromArray(s,2*n),(new It).fromArray(s,2*r)]),void 0!==l&&t.faceVertexUvs[1].push([(new It).fromArray(l,2*e),(new It).fromArray(l,2*n),(new It).fromArray(l,2*r)])}var h=e.groups;if(0<h.length)for(c=0;c<h.length;c++)for(var p=h[c],d=p.start,f=d,m=d+p.count;f<m;f+=3)void 0!==n?u(n[f],n[f+1],n[f+2],p.materialIndex):u(f,f+1,f+2,p.materialIndex);else if(void 0!==n)for(c=0;c<n.length;c+=3)u(n[c],n[c+1],n[c+2]);else for(c=0;c<i.length/3;c+=3)u(c,c+1,c+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(si).negate(),this.translate(si.x,si.y,si.z),this},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=0===t?1:1/t,r=new Qt;return r.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix4(r),this},computeFaceNormals:function(){for(var e=new Wt,t=new Wt,n=0,r=this.faces.length;n<r;n++){var i=this.faces[n],a=this.vertices[i.a],o=this.vertices[i.b],s=this.vertices[i.c];e.subVectors(s,o),t.subVectors(a,o),e.cross(t),e.normalize(),i.normal.copy(e)}},computeVertexNormals:function(e){var t,n,r,i,a,o;for(void 0===e&&(e=!0),o=new Array(this.vertices.length),t=0,n=this.vertices.length;t<n;t++)o[t]=new Wt;if(e){var s,l,c,u=new Wt,h=new Wt;for(r=0,i=this.faces.length;r<i;r++)a=this.faces[r],s=this.vertices[a.a],l=this.vertices[a.b],c=this.vertices[a.c],u.subVectors(c,l),h.subVectors(s,l),u.cross(h),o[a.a].add(u),o[a.b].add(u),o[a.c].add(u)}else for(this.computeFaceNormals(),r=0,i=this.faces.length;r<i;r++)o[(a=this.faces[r]).a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(t=0,n=this.vertices.length;t<n;t++)o[t].normalize();for(r=0,i=this.faces.length;r<i;r++){var p=(a=this.faces[r]).vertexNormals;3===p.length?(p[0].copy(o[a.a]),p[1].copy(o[a.b]),p[2].copy(o[a.c])):(p[0]=o[a.a].clone(),p[1]=o[a.b].clone(),p[2]=o[a.c].clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,t,n;for(this.computeFaceNormals(),e=0,t=this.faces.length;e<t;e++){var r=(n=this.faces[e]).vertexNormals;3===r.length?(r[0].copy(n.normal),r[1].copy(n.normal),r[2].copy(n.normal)):(r[0]=n.normal.clone(),r[1]=n.normal.clone(),r[2]=n.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,n,r,i;for(n=0,r=this.faces.length;n<r;n++)for((i=this.faces[n]).__originalFaceNormal?i.__originalFaceNormal.copy(i.normal):i.__originalFaceNormal=i.normal.clone(),i.__originalVertexNormals||(i.__originalVertexNormals=[]),e=0,t=i.vertexNormals.length;e<t;e++)i.__originalVertexNormals[e]?i.__originalVertexNormals[e].copy(i.vertexNormals[e]):i.__originalVertexNormals[e]=i.vertexNormals[e].clone();var a=new li;for(a.faces=this.faces,e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var o=this.morphNormals[e].faceNormals,s=this.morphNormals[e].vertexNormals;for(n=0,r=this.faces.length;n<r;n++)l=new Wt,c={a:new Wt,b:new Wt,c:new Wt},o.push(l),s.push(c)}var l,c,u=this.morphNormals[e];for(a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals(),n=0,r=this.faces.length;n<r;n++)i=this.faces[n],l=u.faceNormals[n],c=u.vertexNormals[n],l.copy(i.normal),c.a.copy(i.vertexNormals[0]),c.b.copy(i.vertexNormals[1]),c.c.copy(i.vertexNormals[2])}for(n=0,r=this.faces.length;n<r;n++)(i=this.faces[n]).normal=i.__originalFaceNormal,i.vertexNormals=i.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Rn),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Nn),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(e&&e.isGeometry){var r,i=this.vertices.length,a=this.vertices,o=e.vertices,s=this.faces,l=e.faces,c=this.colors,u=e.colors;void 0===n&&(n=0),void 0!==t&&(r=(new Bt).getNormalMatrix(t));for(var h=0,p=o.length;h<p;h++){var d=o[h].clone();void 0!==t&&d.applyMatrix4(t),a.push(d)}for(h=0,p=u.length;h<p;h++)c.push(u[h].clone());for(h=0,p=l.length;h<p;h++){var f,m,g,v=l[h],y=v.vertexNormals,x=v.vertexColors;(f=new dr(v.a+i,v.b+i,v.c+i)).normal.copy(v.normal),void 0!==r&&f.normal.applyMatrix3(r).normalize();for(var _=0,b=y.length;_<b;_++)m=y[_].clone(),void 0!==r&&m.applyMatrix3(r).normalize(),f.vertexNormals.push(m);for(f.color.copy(v.color),_=0,b=x.length;_<b;_++)g=x[_],f.vertexColors.push(g.clone());f.materialIndex=v.materialIndex+n,s.push(f)}for(h=0,p=e.faceVertexUvs.length;h<p;h++){var w=e.faceVertexUvs[h];for(void 0===this.faceVertexUvs[h]&&(this.faceVertexUvs[h]=[]),_=0,b=w.length;_<b;_++){for(var M=w[_],S=[],T=0,E=M.length;T<E;T++)S.push(M[T].clone());this.faceVertexUvs[h].push(S)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e)},mergeMesh:function(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)},mergeVertices:function(){var e,t,n,r,i,a,o,s,l={},c=[],u=[],h=Math.pow(10,4);for(n=0,r=this.vertices.length;n<r;n++)e=this.vertices[n],void 0===l[t=Math.round(e.x*h)+"_"+Math.round(e.y*h)+"_"+Math.round(e.z*h)]?(l[t]=n,c.push(this.vertices[n]),u[n]=c.length-1):u[n]=u[l[t]];var p=[];for(n=0,r=this.faces.length;n<r;n++){(i=this.faces[n]).a=u[i.a],i.b=u[i.b],i.c=u[i.c],a=[i.a,i.b,i.c];for(var d=0;d<3;d++)if(a[d]===a[(d+1)%3]){p.push(n);break}}for(n=p.length-1;0<=n;n--){var f=p[n];for(this.faces.splice(f,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(f,1)}var m=this.vertices.length-c.length;return this.vertices=c,m},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var r=e[t];this.vertices.push(new Wt(r.x,r.y,r.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,n=0;n<t;n++)e[n]._id=n;e.sort(function(e,t){return e.materialIndex-t.materialIndex});var r,i,a=this.faceVertexUvs[0],o=this.faceVertexUvs[1];for(a&&a.length===t&&(r=[]),o&&o.length===t&&(i=[]),n=0;n<t;n++){var s=e[n]._id;r&&r.push(a[s]),i&&i.push(o[s])}r&&(this.faceVertexUvs[0]=r),i&&(this.faceVertexUvs[1]=i)},toJSON:function(){var e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}for(var r=[],i=0;i<this.vertices.length;i++){var a=this.vertices[i];r.push(a.x,a.y,a.z)}var o=[],s=[],l={},c=[],u={},h=[],p={};for(i=0;i<this.faces.length;i++){var d=this.faces[i],f=void 0!==this.faceVertexUvs[0][i],m=0<d.normal.length(),g=0<d.vertexNormals.length,v=1!==d.color.r||1!==d.color.g||1!==d.color.b,y=0<d.vertexColors.length,x=0;if(x=M(x=M(x=M(x=M(x=M(x=M(x=M(x=M(x,0,0),1,!0),2,!1),3,f),4,m),5,g),6,v),7,y),o.push(x),o.push(d.a,d.b,d.c),o.push(d.materialIndex),f){var _=this.faceVertexUvs[0][i];o.push(E(_[0]),E(_[1]),E(_[2]))}if(m&&o.push(S(d.normal)),g){var b=d.vertexNormals;o.push(S(b[0]),S(b[1]),S(b[2]))}if(v&&o.push(T(d.color)),y){var w=d.vertexColors;o.push(T(w[0]),T(w[1]),T(w[2]))}}function M(e,t,n){return n?e|1<<t:e&~(1<<t)}function S(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==l[t]||(l[t]=s.length/3,s.push(e.x,e.y,e.z)),l[t]}function T(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==u[t]||(u[t]=c.length,c.push(e.getHex())),u[t]}function E(e){var t=e.x.toString()+e.y.toString();return void 0!==p[t]||(p[t]=h.length/2,h.push(e.x,e.y)),p[t]}return e.data={},e.data.vertices=r,e.data.normals=s,0<c.length&&(e.data.colors=c),0<h.length&&(e.data.uvs=[h]),e.data.faces=o,e},clone:function(){return(new li).copy(this)},copy:function(e){var t,n,r,i,a,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var s=e.vertices;for(t=0,n=s.length;t<n;t++)this.vertices.push(s[t].clone());var l=e.colors;for(t=0,n=l.length;t<n;t++)this.colors.push(l[t].clone());var c=e.faces;for(t=0,n=c.length;t<n;t++)this.faces.push(c[t].clone());for(t=0,n=e.faceVertexUvs.length;t<n;t++){var u=e.faceVertexUvs[t];for(void 0===this.faceVertexUvs[t]&&(this.faceVertexUvs[t]=[]),r=0,i=u.length;r<i;r++){var h=u[r],p=[];for(a=0,o=h.length;a<o;a++){var d=h[a];p.push(d.clone())}this.faceVertexUvs[t].push(p)}}var f=e.morphTargets;for(t=0,n=f.length;t<n;t++){var m={};if(m.name=f[t].name,void 0!==f[t].vertices)for(m.vertices=[],r=0,i=f[t].vertices.length;r<i;r++)m.vertices.push(f[t].vertices[r].clone());if(void 0!==f[t].normals)for(m.normals=[],r=0,i=f[t].normals.length;r<i;r++)m.normals.push(f[t].normals[r].clone());this.morphTargets.push(m)}var g=e.morphNormals;for(t=0,n=g.length;t<n;t++){var v={};if(void 0!==g[t].vertexNormals)for(v.vertexNormals=[],r=0,i=g[t].vertexNormals.length;r<i;r++){var y=g[t].vertexNormals[r],x={};x.a=y.a.clone(),x.b=y.b.clone(),x.c=y.c.clone(),v.vertexNormals.push(x)}if(void 0!==g[t].faceNormals)for(v.faceNormals=[],r=0,i=g[t].faceNormals.length;r<i;r++)v.faceNormals.push(g[t].faceNormals[r].clone());this.morphNormals.push(v)}var _=e.skinWeights;for(t=0,n=_.length;t<n;t++)this.skinWeights.push(_[t].clone());var b=e.skinIndices;for(t=0,n=b.length;t<n;t++)this.skinIndices.push(b[t].clone());var w=e.lineDistances;for(t=0,n=w.length;t<n;t++)this.lineDistances.push(w[t]);var M=e.boundingBox;null!==M&&(this.boundingBox=M.clone());var S=e.boundingSphere;return null!==S&&(this.boundingSphere=S.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var ci=function(e){function t(t,n,r,i,a,o){e.call(this),this.type="BoxGeometry",this.parameters={width:t,height:n,depth:r,widthSegments:i,heightSegments:a,depthSegments:o},this.fromBufferGeometry(new ui(t,n,r,i,a,o)),this.mergeVertices()}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t}(li),ui=function(e){function t(t,n,r,i,a,o){e.call(this),this.type="BoxBufferGeometry",this.parameters={width:t,height:n,depth:r,widthSegments:i,heightSegments:a,depthSegments:o};var s=this;t=t||1,n=n||1,r=r||1,i=Math.floor(i)||1,a=Math.floor(a)||1;var l=[],c=[],u=[],h=[],p=0,d=0;function f(e,t,n,r,i,a,o,f,m,g,v){var y,x,_=a/m,b=o/g,w=a/2,M=o/2,S=f/2,T=m+1,E=g+1,C=0,A=0,L=new Wt;for(x=0;x<E;x++){var D=x*b-M;for(y=0;y<T;y++){var P=y*_-w;L[e]=P*r,L[t]=D*i,L[n]=S,c.push(L.x,L.y,L.z),L[e]=0,L[t]=0,L[n]=0<f?1:-1,u.push(L.x,L.y,L.z),h.push(y/m),h.push(1-x/g),C+=1}}for(x=0;x<g;x++)for(y=0;y<m;y++){var O=p+y+T*x,R=p+y+T*(x+1),I=p+(y+1)+T*(x+1),B=p+(y+1)+T*x;l.push(O,R,B),l.push(R,I,B),A+=6}s.addGroup(d,A,v),d+=A,p+=C}f("z","y","x",-1,-1,r,n,t,o=Math.floor(o)||1,a,0),f("z","y","x",1,-1,r,n,-t,o,a,1),f("x","z","y",1,1,t,r,n,i,o,2),f("x","z","y",1,-1,t,r,-n,i,o,3),f("x","y","z",1,-1,t,n,r,i,a,4),f("x","y","z",-1,-1,t,n,-r,i,a,5),this.setIndex(l),this.setAttribute("position",new Er(c,3)),this.setAttribute("normal",new Er(u,3)),this.setAttribute("uv",new Er(h,2))}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t}(kr);function hi(e){var t={};for(var n in e)for(var r in t[n]={},e[n]){var i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}return t}function pi(e){for(var t={},n=0;n<e.length;n++){var r=hi(e[n]);for(var i in r)t[i]=r[i]}return t}var di={clone:hi,merge:pi},fi="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",mi="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";function gi(e){mr.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=fi,this.fragmentShader=mi,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}function vi(){yn.call(this),this.type="Camera",this.matrixWorldInverse=new Qt,this.projectionMatrix=new Qt,this.projectionMatrixInverse=new Qt}function yi(e,t,n,r){vi.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function xi(e,t,n,r){yn.call(this),this.type="CubeCamera";var i=new yi(90,1,e,t);i.up.set(0,-1,0),i.lookAt(new Wt(1,0,0)),this.add(i);var a=new yi(90,1,e,t);a.up.set(0,-1,0),a.lookAt(new Wt(-1,0,0)),this.add(a);var o=new yi(90,1,e,t);o.up.set(0,0,1),o.lookAt(new Wt(0,1,0)),this.add(o);var s=new yi(90,1,e,t);s.up.set(0,0,-1),s.lookAt(new Wt(0,-1,0)),this.add(s);var l=new yi(90,1,e,t);l.up.set(0,-1,0),l.lookAt(new Wt(0,0,1)),this.add(l);var c=new yi(90,1,e,t);c.up.set(0,-1,0),c.lookAt(new Wt(0,0,-1)),this.add(c),r=r||{format:Ee,magFilter:ue,minFilter:ue},this.renderTarget=new _i(n,r),this.renderTarget.texture.name="CubeCamera",this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var n=e.getRenderTarget(),r=this.renderTarget,u=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0),e.render(t,i),e.setRenderTarget(r,1),e.render(t,a),e.setRenderTarget(r,2),e.render(t,o),e.setRenderTarget(r,3),e.render(t,s),e.setRenderTarget(r,4),e.render(t,l),r.texture.generateMipmaps=u,e.setRenderTarget(r,5),e.render(t,c),e.setRenderTarget(n)},this.clear=function(e,t,n,r){for(var i=e.getRenderTarget(),a=this.renderTarget,o=0;o<6;o++)e.setRenderTarget(a,o),e.clear(t,n,r);e.setRenderTarget(i)}}function _i(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),Vt.call(this,e,e,t)}function bi(e,t,n,r,i,a,o,s,l,c,u,h){Ft.call(this,null,a,o,s,l,c,r,i,u,h),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==l?l:se,this.minFilter=void 0!==c?c:se,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}((gi.prototype=Object.create(mr.prototype)).constructor=gi).prototype.isShaderMaterial=!0,gi.prototype.copy=function(e){return mr.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=hi(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},gi.prototype.toJSON=function(e){var t=mr.prototype.toJSON.call(this,e);for(var n in t.uniforms={},this.uniforms){var r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:"t",value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:"m4",value:r.toArray()}:t.uniforms[n]={value:r}}0<Object.keys(this.defines).length&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var i={};for(var a in this.extensions)!0===this.extensions[a]&&(i[a]=!0);return 0<Object.keys(i).length&&(t.extensions=i),t},vi.prototype=Object.assign(Object.create(yn.prototype),{constructor:vi,isCamera:!0,copy:function(e,t){return yn.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new Wt),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){yn.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(e,t){yn.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),yi.prototype=Object.assign(Object.create(vi.prototype),{constructor:yi,isPerspectiveCamera:!0,copy:function(e,t){return vi.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*Rt.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*Rt.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*Rt.RAD2DEG*Math.atan(Math.tan(.5*Rt.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,r,i,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*Rt.DEG2RAD*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;i+=a.offsetX*r/o,t-=a.offsetY*n/s,r*=a.width/o,n*=a.height/s}var l=this.filmOffset;0!==l&&(i+=e*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=yn.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}),(xi.prototype=Object.create(yn.prototype)).constructor=xi,((_i.prototype=Object.create(Vt.prototype)).constructor=_i).prototype.isWebGLCubeRenderTarget=!0,_i.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=t.format,this.texture.encoding=t.encoding;var n=new xn,r={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include <begin_vertex>","\t#include <project_vertex>","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#define RECIPROCAL_PI 0.31830988618","#define RECIPROCAL_PI2 0.15915494","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV;","\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;","\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},i=new gi({type:"CubemapFromEquirect",uniforms:hi(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:l,blending:p});i.uniforms.tEquirect.value=t;var a=new ti(new ui(5,5,5),i);n.add(a);var o=new xi(1,10,1);return o.renderTarget=this,o.renderTarget.texture.name="CubeCameraTexture",o.update(e,n),a.geometry.dispose(),a.material.dispose(),this},((bi.prototype=Object.create(Ft.prototype)).constructor=bi).prototype.isDataTexture=!0;var wi=new Nn,Mi=new Wt;function Si(e,t,n,r,i,a){this.planes=[void 0!==e?e:new Xn,void 0!==t?t:new Xn,void 0!==n?n:new Xn,void 0!==r?r:new Xn,void 0!==i?i:new Xn,void 0!==a?a:new Xn]}Object.assign(Si.prototype,{set:function(e,t,n,r,i,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this},setFromProjectionMatrix:function(e){var t=this.planes,n=e.elements,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],l=n[5],c=n[6],u=n[7],h=n[8],p=n[9],d=n[10],f=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return t[0].setComponents(o-r,u-s,f-h,y-m).normalize(),t[1].setComponents(o+r,u+s,f+h,y+m).normalize(),t[2].setComponents(o+i,u+l,f+p,y+g).normalize(),t[3].setComponents(o-i,u-l,f-p,y-g).normalize(),t[4].setComponents(o-a,u-c,f-d,y-v).normalize(),t[5].setComponents(o+a,u+c,f+d,y+v).normalize(),this},intersectsObject:function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),wi.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(wi)},intersectsSprite:function(e){return wi.center.set(0,0,0),wi.radius=.7071067811865476,wi.applyMatrix4(e.matrixWorld),this.intersectsSphere(wi)},intersectsSphere:function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++)if(t[i].distanceToPoint(n)<r)return!1;return!0},intersectsBox:function(e){for(var t=this.planes,n=0;n<6;n++){var r=t[n];if(Mi.x=0<r.normal.x?e.max.x:e.min.x,Mi.y=0<r.normal.y?e.max.y:e.min.y,Mi.z=0<r.normal.z?e.max.z:e.min.z,r.distanceToPoint(Mi)<0)return!1}return!0},containsPoint:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}});var Ti={common:{diffuse:{value:new cr(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Bt},uv2Transform:{value:new Bt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new It(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new cr(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new cr(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Bt}},sprite:{diffuse:{value:new cr(15658734)},opacity:{value:1},center:{value:new It(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Bt}}};function Ei(){var e=null,t=!1,n=null;function r(i,a){!1!==t&&(n(i,a),e.requestAnimationFrame(r))}return{start:function(){!0!==t&&null!==n&&(e.requestAnimationFrame(r),t=!0)},stop:function(){t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Ci(e,t,n,r){li.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new Ai(e,t,n,r)),this.mergeVertices()}function Ai(e,t,n,r){kr.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};var i,a,o=(e=e||1)/2,s=(t=t||1)/2,l=Math.floor(n)||1,c=Math.floor(r)||1,u=l+1,h=c+1,p=e/l,d=t/c,f=[],m=[],g=[],v=[];for(a=0;a<h;a++){var y=a*d-s;for(i=0;i<u;i++){var x=i*p-o;m.push(x,-y,0),g.push(0,0,1),v.push(i/l),v.push(1-a/c)}}for(a=0;a<c;a++)for(i=0;i<l;i++){var _=i+u*a,b=i+u*(a+1),w=i+1+u*(a+1),M=i+1+u*a;f.push(_,b,M),f.push(b,w,M)}this.setIndex(f),this.setAttribute("position",new Er(m,3)),this.setAttribute("normal",new Er(g,3)),this.setAttribute("uv",new Er(v,2))}(Ci.prototype=Object.create(li.prototype)).constructor=Ci,(Ai.prototype=Object.create(kr.prototype)).constructor=Ai;var Li={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\nfloat getFace(vec3 direction) {\n vec3 absDirection = abs(direction);\n float face = -1.0;\n if (absDirection.x > absDirection.z) {\n if (absDirection.x > absDirection.y)\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if (absDirection.z > absDirection.y)\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n}\nvec2 getUV(vec3 direction, float face) {\n vec2 uv;\n if (face == 0.0) {\n uv = vec2(-direction.z, direction.y) / abs(direction.x);\n } else if (face == 1.0) {\n uv = vec2(direction.x, -direction.z) / abs(direction.y);\n } else if (face == 2.0) {\n uv = direction.xy / abs(direction.z);\n } else if (face == 3.0) {\n uv = vec2(direction.z, direction.y) / abs(direction.x);\n } else if (face == 4.0) {\n uv = direction.xz / abs(direction.y);\n } else {\n uv = vec2(-direction.x, direction.y) / abs(direction.z);\n }\n return 0.5 * (uv + 1.0);\n}\nvec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {\n float face = getFace(direction);\n float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n mipInt = max(mipInt, cubeUV_minMipLevel);\n float faceSize = exp2(mipInt);\n float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n vec2 uv = getUV(direction, face) * (faceSize - 1.0);\n vec2 f = fract(uv);\n uv += 0.5 - f;\n if (face > 2.0) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n if(mipInt < cubeUV_maxMipLevel){\n uv.y += 2.0 * cubeUV_maxTileSize;\n }\n uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n uv *= texelSize;\n vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize;\n vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize;\n vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize;\n vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n return mix(tm, bm, f.y);\n}\n#define r0 1.0\n#define v0 0.339\n#define m0 -2.0\n#define r1 0.8\n#define v1 0.276\n#define m1 -1.0\n#define r4 0.4\n#define v4 0.046\n#define m4 2.0\n#define r5 0.305\n#define v5 0.016\n#define m5 3.0\n#define r6 0.21\n#define v6 0.0038\n#define m6 4.0\nfloat roughnessToMip(float roughness) {\n float mip = 0.0;\n if (roughness >= r1) {\n mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;\n } else if (roughness >= r4) {\n mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;\n } else if (roughness >= r5) {\n mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;\n } else if (roughness >= r6) {\n mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;\n } else {\n mip = -2.0 * log2(1.16 * roughness); }\n return mip;\n}\nvec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {\n float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n float mipF = fract(mip);\n float mipInt = floor(mip);\n vec3 color0 = bilinearCubeUV(envMap, sampleDir, mipInt);\n if (mipF == 0.0) {\n return vec4(color0, 1.0);\n } else {\n vec3 color1 = bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);\n return vec4(mix(color0, color1, mipF), 1.0);\n }\n}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\ttransformedNormal = mat3( instanceMatrix ) * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) { \n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = saturate( clearcoat );\tmaterial.clearcoatRoughness = max( clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( pointLight.shadow, directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( spotLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( directionalLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_normalmap_pars_fragment:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= all( bvec2( directionalLight.shadow, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= all( bvec2( spotLight.shadow, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= all( bvec2( pointLight.shadow, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",shadow_vert:"#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}"},Di={basic:{uniforms:pi([Ti.common,Ti.specularmap,Ti.envmap,Ti.aomap,Ti.lightmap,Ti.fog]),vertexShader:Li.meshbasic_vert,fragmentShader:Li.meshbasic_frag},lambert:{uniforms:pi([Ti.common,Ti.specularmap,Ti.envmap,Ti.aomap,Ti.lightmap,Ti.emissivemap,Ti.fog,Ti.lights,{emissive:{value:new cr(0)}}]),vertexShader:Li.meshlambert_vert,fragmentShader:Li.meshlambert_frag},phong:{uniforms:pi([Ti.common,Ti.specularmap,Ti.envmap,Ti.aomap,Ti.lightmap,Ti.emissivemap,Ti.bumpmap,Ti.normalmap,Ti.displacementmap,Ti.fog,Ti.lights,{emissive:{value:new cr(0)},specular:{value:new cr(1118481)},shininess:{value:30}}]),vertexShader:Li.meshphong_vert,fragmentShader:Li.meshphong_frag},standard:{uniforms:pi([Ti.common,Ti.envmap,Ti.aomap,Ti.lightmap,Ti.emissivemap,Ti.bumpmap,Ti.normalmap,Ti.displacementmap,Ti.roughnessmap,Ti.metalnessmap,Ti.fog,Ti.lights,{emissive:{value:new cr(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:Li.meshphysical_vert,fragmentShader:Li.meshphysical_frag},toon:{uniforms:pi([Ti.common,Ti.specularmap,Ti.aomap,Ti.lightmap,Ti.emissivemap,Ti.bumpmap,Ti.normalmap,Ti.displacementmap,Ti.gradientmap,Ti.fog,Ti.lights,{emissive:{value:new cr(0)},specular:{value:new cr(1118481)},shininess:{value:30}}]),vertexShader:Li.meshtoon_vert,fragmentShader:Li.meshtoon_frag},matcap:{uniforms:pi([Ti.common,Ti.bumpmap,Ti.normalmap,Ti.displacementmap,Ti.fog,{matcap:{value:null}}]),vertexShader:Li.meshmatcap_vert,fragmentShader:Li.meshmatcap_frag},points:{uniforms:pi([Ti.points,Ti.fog]),vertexShader:Li.points_vert,fragmentShader:Li.points_frag},dashed:{uniforms:pi([Ti.common,Ti.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Li.linedashed_vert,fragmentShader:Li.linedashed_frag},depth:{uniforms:pi([Ti.common,Ti.displacementmap]),vertexShader:Li.depth_vert,fragmentShader:Li.depth_frag},normal:{uniforms:pi([Ti.common,Ti.bumpmap,Ti.normalmap,Ti.displacementmap,{opacity:{value:1}}]),vertexShader:Li.normal_vert,fragmentShader:Li.normal_frag},sprite:{uniforms:pi([Ti.sprite,Ti.fog]),vertexShader:Li.sprite_vert,fragmentShader:Li.sprite_frag},background:{uniforms:{uvTransform:{value:new Bt},t2D:{value:null}},vertexShader:Li.background_vert,fragmentShader:Li.background_frag},cube:{uniforms:pi([Ti.envmap,{opacity:{value:1}}]),vertexShader:Li.cube_vert,fragmentShader:Li.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Li.equirect_vert,fragmentShader:Li.equirect_frag},distanceRGBA:{uniforms:pi([Ti.common,Ti.displacementmap,{referencePosition:{value:new Wt},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Li.distanceRGBA_vert,fragmentShader:Li.distanceRGBA_frag},shadow:{uniforms:pi([Ti.lights,Ti.fog,{color:{value:new cr(0)},opacity:{value:1}}]),vertexShader:Li.shadow_vert,fragmentShader:Li.shadow_frag}};function Pi(e,t,n,r){var i,a,o=new cr(0),c=0,u=null,h=0,p=null;function d(e,n){t.buffers.color.setClear(e.r,e.g,e.b,n,r)}return{getClearColor:function(){return o},setClearColor:function(e,t){o.set(e),d(o,c=void 0!==t?t:1)},getClearAlpha:function(){return c},setClearAlpha:function(e){d(o,c=e)},render:function(t,r,f,m){var g=r.background,v=e.xr,y=v.getSession&&v.getSession();if(y&&"additive"===y.environmentBlendMode&&(g=null),null===g?d(o,c):g&&g.isColor&&(d(g,1),m=!0),(e.autoClear||m)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),g&&(g.isCubeTexture||g.isWebGLCubeRenderTarget||g.mapping===ne)){void 0===a&&((a=new ti(new ui(1,1,1),new gi({type:"BackgroundCubeMaterial",uniforms:hi(Di.cube.uniforms),vertexShader:Di.cube.vertexShader,fragmentShader:Di.cube.fragmentShader,side:l,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(a));var x=g.isWebGLCubeRenderTarget?g.texture:g;a.material.uniforms.envMap.value=x,a.material.uniforms.flipEnvMap.value=x.isCubeTexture?-1:1,u===g&&h===x.version&&p===e.toneMapping||(a.material.needsUpdate=!0,u=g,h=x.version,p=e.toneMapping),t.unshift(a,a.geometry,a.material,0,0,null)}else g&&g.isTexture&&(void 0===i&&((i=new ti(new Ai(2,2),new gi({type:"BackgroundMaterial",uniforms:hi(Di.background.uniforms),vertexShader:Di.background.vertexShader,fragmentShader:Di.background.fragmentShader,side:s,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(i.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(i)),!0===(i.material.uniforms.t2D.value=g).matrixAutoUpdate&&g.updateMatrix(),i.material.uniforms.uvTransform.value.copy(g.matrix),u===g&&h===g.version&&p===e.toneMapping||(i.material.needsUpdate=!0,h=(u=g).version,p=e.toneMapping),t.unshift(i,i.geometry,i.material,0,0,null))}}}function Oi(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Ri(e,t,n,r,i,a,o,s,l,c){Ft.call(this,e=void 0!==e?e:[],t=void 0!==t?t:Z,n,r,i,a,o=void 0!==o?o:Ee,s,l,c),this.flipY=!1}function Ii(e,t,n,r){Ft.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:r||1},this.magFilter=se,this.minFilter=se,this.wrapR=ae,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function Bi(e,t,n,r){Ft.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:r||1},this.magFilter=se,this.minFilter=se,this.wrapR=ae,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}Di.physical={uniforms:pi([Di.standard.uniforms,{transparency:{value:0},clearcoat:{value:0},clearcoatRoughness:{value:0},sheen:{value:new cr(0)},clearcoatNormalScale:{value:new It(1,1)},clearcoatNormalMap:{value:null}}]),vertexShader:Li.meshphysical_vert,fragmentShader:Li.meshphysical_frag},((Ri.prototype=Object.create(Ft.prototype)).constructor=Ri).prototype.isCubeTexture=!0,Object.defineProperty(Ri.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}}),((Ii.prototype=Object.create(Ft.prototype)).constructor=Ii).prototype.isDataTexture2DArray=!0,((Bi.prototype=Object.create(Ft.prototype)).constructor=Bi).prototype.isDataTexture3D=!0;var Ni=new Ft,ki=new Ii,Fi=new Bi,Gi=new Ri,Vi=[],zi=[],Ui=new Float32Array(16),ji=new Float32Array(9),Hi=new Float32Array(4);function Wi(e,t,n){var r=e[0];if(r<=0||0<r)return e;var i=t*n,a=Vi[i];if(void 0===a&&(a=new Float32Array(i),Vi[i]=a),0!==t){r.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=n,e[o].toArray(a,s)}return a}function qi(e,t){if(e.length===t.length){for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return;return 1}}function Ji(e,t){for(var n=0,r=t.length;n<r;n++)e[n]=t[n]}function Xi(e,t){var n=zi[t];void 0===n&&(n=new Int32Array(t),zi[t]=n);for(var r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function Yi(e,t){var n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function $i(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(qi(n,t))return;e.uniform2fv(this.addr,t),Ji(n,t)}}function Zi(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(qi(n,t))return;e.uniform3fv(this.addr,t),Ji(n,t)}}function Ki(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(qi(n,t))return;e.uniform4fv(this.addr,t),Ji(n,t)}}function Qi(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(qi(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),Ji(n,t)}else{if(qi(n,r))return;Hi.set(r),e.uniformMatrix2fv(this.addr,!1,Hi),Ji(n,r)}}function ea(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(qi(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),Ji(n,t)}else{if(qi(n,r))return;ji.set(r),e.uniformMatrix3fv(this.addr,!1,ji),Ji(n,r)}}function ta(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(qi(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),Ji(n,t)}else{if(qi(n,r))return;Ui.set(r),e.uniformMatrix4fv(this.addr,!1,Ui),Ji(n,r)}}function na(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTexture2D(t||Ni,i)}function ra(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||ki,i)}function ia(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||Fi,i)}function aa(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTextureCube(t||Gi,i)}function oa(e,t){var n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function sa(e,t){var n=this.cache;qi(n,t)||(e.uniform2iv(this.addr,t),Ji(n,t))}function la(e,t){var n=this.cache;qi(n,t)||(e.uniform3iv(this.addr,t),Ji(n,t))}function ca(e,t){var n=this.cache;qi(n,t)||(e.uniform4iv(this.addr,t),Ji(n,t))}function ua(e,t){var n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function ha(e,t){e.uniform1fv(this.addr,t)}function pa(e,t){e.uniform1iv(this.addr,t)}function da(e,t){e.uniform2iv(this.addr,t)}function fa(e,t){e.uniform3iv(this.addr,t)}function ma(e,t){e.uniform4iv(this.addr,t)}function ga(e,t){var n=Wi(t,this.size,2);e.uniform2fv(this.addr,n)}function va(e,t){var n=Wi(t,this.size,3);e.uniform3fv(this.addr,n)}function ya(e,t){var n=Wi(t,this.size,4);e.uniform4fv(this.addr,n)}function xa(e,t){var n=Wi(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function _a(e,t){var n=Wi(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function ba(e,t){var n=Wi(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function wa(e,t,n){var r=t.length,i=Xi(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTexture2D(t[a]||Ni,i[a])}function Ma(e,t,n){var r=t.length,i=Xi(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTextureCube(t[a]||Gi,i[a])}function Sa(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=function(e){switch(t.type){case 5126:return Yi;case 35664:return $i;case 35665:return Zi;case 35666:return Ki;case 35674:return Qi;case 35675:return ea;case 35676:return ta;case 5124:case 35670:return oa;case 35667:case 35671:return sa;case 35668:case 35672:return la;case 35669:case 35673:return ca;case 5125:return ua;case 35678:case 36198:case 36298:case 36306:case 35682:return na;case 35679:case 36299:case 36307:return ia;case 35680:case 36300:case 36308:case 36293:return aa;case 36289:case 36303:case 36311:case 36292:return ra}}()}function Ta(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=function(e){switch(t.type){case 5126:return ha;case 35664:return ga;case 35665:return va;case 35666:return ya;case 35674:return xa;case 35675:return _a;case 35676:return ba;case 5124:case 35670:return pa;case 35667:case 35671:return da;case 35668:case 35672:return fa;case 35669:case 35673:return ma;case 35678:case 36198:case 36298:case 36306:case 35682:return wa;case 35680:case 36300:case 36308:case 36293:return Ma}}()}function Ea(e){this.id=e,this.seq=[],this.map={}}Ta.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),Ji(t,e)},Ea.prototype.setValue=function(e,t,n){for(var r=this.seq,i=0,a=r.length;i!==a;++i){var o=r[i];o.setValue(e,t[o.id],n)}};var Ca=/([\w\d_]+)(\])?(\[|\.)?/g;function Aa(e,t){e.seq.push(t),e.map[t.id]=t}function La(e,t,n){var r=e.name,i=r.length;for(Ca.lastIndex=0;;){var a=Ca.exec(r),o=Ca.lastIndex,s=a[1],l="]"===a[2],c=a[3];if(l&&(s|=0),void 0===c||"["===c&&o+2===i){Aa(n,new(void 0===c?Sa:Ta)(s,e,t));break}var u=n.map[s];void 0===u&&Aa(n,u=new Ea(s)),n=u}}function Da(e,t){this.seq=[],this.map={};for(var n=e.getProgramParameter(t,35718),r=0;r<n;++r){var i=e.getActiveUniform(t,r);La(i,e.getUniformLocation(t,i.name),this)}}function Pa(e,t,n){var r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}Da.prototype.setValue=function(e,t,n,r){var i=this.map[t];void 0!==i&&i.setValue(e,n,r)},Da.prototype.setOptional=function(e,t,n){var r=t[n];void 0!==r&&this.setValue(e,n,r)},Da.upload=function(e,t,n,r){for(var i=0,a=t.length;i!==a;++i){var o=t[i],s=n[o.id];!1!==s.needsUpdate&&o.setValue(e,s.value,r)}},Da.seqWithValue=function(e,t){for(var n=[],r=0,i=e.length;r!==i;++r){var a=e[r];a.id in t&&n.push(a)}return n};var Oa=0;function Ra(e){switch(e){case dt:return["Linear","( value )"];case ft:return["sRGB","( value )"];case gt:return["RGBE","( value )"];case yt:return["RGBM","( value, 7.0 )"];case xt:return["RGBM","( value, 16.0 )"];case _t:return["RGBD","( value, 256.0 )"];case mt:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case vt:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+e)}}function Ia(e,t,n){var r=e.getShaderParameter(t,35713),i=e.getShaderInfoLog(t).trim();return r&&""===i?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+i+function(e){for(var t=e.split("\n"),n=0;n<t.length;n++)t[n]=n+1+": "+t[n];return t.join("\n")}(e.getShaderSource(t))}function Ba(e,t){var n=Ra(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function Na(e){return""!==e}function ka(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function Fa(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var Ga=/^[ \t]*#include +<([\w\d./]+)>/gm;function Va(e){return e.replace(Ga,za)}function za(e,t){var n=Li[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Va(n)}var Ua=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;function ja(e){return e.replace(Ua,Ha)}function Ha(e,t,n,r){for(var i="",a=parseInt(t);a<parseInt(n);a++)i+=r.replace(/\[ i \]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return i}function Wa(e){var t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function qa(e,t,n){var r=[],s=n.isWebGL2,u=n.logarithmicDepthBuffer,h=n.floatVertexTextures,p=n.precision,d=n.maxVertexUniforms,f=n.vertexTextures,m={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},g=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","numMultiviewViews","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen"];function v(e){var t;return e?e.isTexture?t=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),t=e.texture.encoding):t=dt,t}this.getParameters=function(r,i,a,o,g,y,x){var _=o.fog,b=r.isMeshStandardMaterial?o.environment:null,w=r.envMap||b,M=m[r.type],S=x.isSkinnedMesh?function(e){var t=x.skeleton.bones;if(h)return 1024;var n=d,r=Math.floor((n-20)/4),i=Math.min(r,t.length);return i<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+i+"."),0):i}():0;null!==r.precision&&(p=n.getMaxPrecision(r.precision))!==r.precision&&console.warn("THREE.WebGLProgram.getParameters:",r.precision,"not supported, using",p,"instead.");var T=function(e,t){var n;if(M){var r=Di[M];n={name:e.type,uniforms:di.clone(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader}}else n={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};return n}(r);r.onBeforeCompile(T,e);var E=e.getRenderTarget(),C=E&&E.isWebGLMultiviewRenderTarget?E.numViews:0;return{isWebGL2:s,shaderID:M,shaderName:T.name,uniforms:T.uniforms,vertexShader:T.vertexShader,fragmentShader:T.fragmentShader,defines:r.defines,isRawShaderMaterial:r.isRawShaderMaterial,isShaderMaterial:r.isShaderMaterial,precision:p,instancing:!0===x.isInstancedMesh,supportsVertexTextures:f,numMultiviewViews:C,outputEncoding:null!==E?v(E.texture):e.outputEncoding,map:!!r.map,mapEncoding:v(r.map),matcap:!!r.matcap,matcapEncoding:v(r.matcap),envMap:!!w,envMapMode:w&&w.mapping,envMapEncoding:v(w),envMapCubeUV:!!w&&(w.mapping===ne||w.mapping===re),lightMap:!!r.lightMap,lightMapEncoding:v(r.lightMap),aoMap:!!r.aoMap,emissiveMap:!!r.emissiveMap,emissiveMapEncoding:v(r.emissiveMap),bumpMap:!!r.bumpMap,normalMap:!!r.normalMap,objectSpaceNormalMap:r.normalMapType===St,tangentSpaceNormalMap:r.normalMapType===Mt,clearcoatNormalMap:!!r.clearcoatNormalMap,displacementMap:!!r.displacementMap,roughnessMap:!!r.roughnessMap,metalnessMap:!!r.metalnessMap,specularMap:!!r.specularMap,alphaMap:!!r.alphaMap,gradientMap:!!r.gradientMap,sheen:!!r.sheen,combine:r.combine,vertexTangents:r.normalMap&&r.vertexTangents,vertexColors:r.vertexColors,vertexUvs:!!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatNormalMap||r.displacementMap),uvsVertexOnly:!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatNormalMap||!r.displacementMap),fog:!!_,useFog:r.fog,fogExp2:_&&_.isFogExp2,flatShading:r.flatShading,sizeAttenuation:r.sizeAttenuation,logarithmicDepthBuffer:u,skinning:r.skinning&&0<S,maxBones:S,useVertexTexture:h,morphTargets:r.morphTargets,morphNormals:r.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:i.directional.length,numPointLights:i.point.length,numSpotLights:i.spot.length,numRectAreaLights:i.rectArea.length,numHemiLights:i.hemi.length,numDirLightShadows:i.directionalShadowMap.length,numPointLightShadows:i.pointShadowMap.length,numSpotLightShadows:i.spotShadowMap.length,numClippingPlanes:g,numClipIntersection:y,dithering:r.dithering,shadowMapEnabled:e.shadowMap.enabled&&0<a.length,shadowMapType:e.shadowMap.type,toneMapping:r.toneMapped?e.toneMapping:W,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:r.premultipliedAlpha,alphaTest:r.alphaTest,doubleSided:r.side===c,flipSided:r.side===l,depthPacking:void 0!==r.depthPacking&&r.depthPacking,index0AttributeName:r.index0AttributeName,extensionDerivatives:r.extensions&&r.extensions.derivatives,extensionFragDepth:r.extensions&&r.extensions.frawbuffers,extensionDrawbuffers:r.extensions&&r.extensions.drawbuffers,extensionShaderTextureLOD:r.extensions&&r.extensions.shaderTextureLOD,rendererExtensionFragDepth:s||null!==t.get("EXT_frag_depth"),rendererExtensionDrawBuffers:s||null!==t.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||null!==t.get("EXT_shader_texture_lod"),onBeforeCompile:r.onBeforeCompile}},this.getProgramCacheKey=function(t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var r in t.defines)n.push(r),n.push(t.defines[r]);if(void 0===t.isRawShaderMaterial){for(var i=0;i<g.length;i++)n.push(t[g[i]]);n.push(e.outputEncoding),n.push(e.gammaFactor)}return n.push(t.onBeforeCompile.toString()),n.join()},this.acquireProgram=function(t,n){for(var s,l=0,c=r.length;l<c;l++){var u=r[l];if(u.cacheKey===n){++(s=u).usedTimes;break}}return void 0===s&&(s=new function(e,t,n){var r,s,l,c,u,h,p,d,f=e.getContext(),m=n.defines,g=n.vertexShader,v=n.fragmentShader,y=(s="SHADOWMAP_TYPE_BASIC",(r=n).shadowMapType===i?s="SHADOWMAP_TYPE_PCF":r.shadowMapType===a?s="SHADOWMAP_TYPE_PCF_SOFT":r.shadowMapType===o&&(s="SHADOWMAP_TYPE_VSM"),s),x=function(e){var t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case Z:case K:t="ENVMAP_TYPE_CUBE";break;case ne:case re:t="ENVMAP_TYPE_CUBE_UV";break;case Q:case ee:t="ENVMAP_TYPE_EQUIREC";break;case te:t="ENVMAP_TYPE_SPHERE"}return t}(n),_=function(e){var t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case K:case ee:t="ENVMAP_MODE_REFRACTION"}return t}(n),b=function(e){var t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case U:t="ENVMAP_BLENDING_MULTIPLY";break;case j:t="ENVMAP_BLENDING_MIX";break;case H:t="ENVMAP_BLENDING_ADD"}return t}(n),w=0<e.gammaFactor?e.gammaFactor:1,M=n.isWebGL2?"":[(l=n).extensionDerivatives||l.envMapCubeUV||l.bumpMap||l.tangentSpaceNormalMap||l.clearcoatNormalMap||l.flatShading||"physical"===l.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(l.extensionFragDepth||l.logarithmicDepthBuffer)&&l.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",l.extensionDrawBuffers&&l.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(l.extensionShaderTextureLOD||l.envMap)&&l.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Na).join("\n"),S=function(e){var t=[];for(var n in e){var r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(m),T=f.createProgram(),E=n.numMultiviewViews;if(n.isRawShaderMaterial?(0<(c=[S].filter(Na).join("\n")).length&&(c+="\n"),0<(u=[M,S].filter(Na).join("\n")).length&&(u+="\n")):(c=[Wa(n),"#define SHADER_NAME "+n.shaderName,S,n.instancing?"#define USE_INSTANCING":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+w,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+_:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+y:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Na).join("\n"),u=[M,Wa(n),"#define SHADER_NAME "+n.shaderName,S,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+w,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+x:"",n.envMap?"#define "+_:"",n.envMap?"#define "+b:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+y:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==W?"#define TONE_MAPPING":"",n.toneMapping!==W?Li.tonemapping_pars_fragment:"",n.toneMapping!==W?function(e,t){var n;switch(t){case q:n="Linear";break;case J:n="Reinhard";break;case X:n="Uncharted2";break;case Y:n="OptimizedCineon";break;case $:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 toneMapping( vec3 color ) { return "+n+"ToneMapping( color ); }"}(0,n.toneMapping):"",n.dithering?"#define DITHERING":"",n.outputEncoding||n.mapEncoding||n.matcapEncoding||n.envMapEncoding||n.emissiveMapEncoding||n.lightMapEncoding?Li.encodings_pars_fragment:"",n.mapEncoding?Ba("mapTexelToLinear",n.mapEncoding):"",n.matcapEncoding?Ba("matcapTexelToLinear",n.matcapEncoding):"",n.envMapEncoding?Ba("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMapEncoding?Ba("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMapEncoding?Ba("lightMapTexelToLinear",n.lightMapEncoding):"",n.outputEncoding?(h="linearToOutputTexel",p=n.outputEncoding,d=Ra(p),"vec4 "+h+"( vec4 value ) { return LinearTo"+d[0]+d[1]+"; }"):"",n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Na).join("\n")),g=Fa(g=ka(g=Va(g),n),n),v=Fa(v=ka(v=Va(v),n),n),g=ja(g),v=ja(v),n.isWebGL2&&!n.isRawShaderMaterial){var C=!1,A=/^\s*#version\s+300\s+es\s*\n/;n.isShaderMaterial&&null!==g.match(A)&&null!==v.match(A)&&(C=!0,g=g.replace(A,""),v=v.replace(A,"")),c=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+c,u=["#version 300 es\n","#define varying in",C?"":"out highp vec4 pc_fragColor;",C?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+u,0<E&&(c=(c=c.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","layout(num_views = "+E+") in;","#define VIEW_ID gl_ViewID_OVR"].join("\n"))).replace(["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;"].join("\n"),["uniform mat4 modelViewMatrices["+E+"];","uniform mat4 projectionMatrices["+E+"];","uniform mat4 viewMatrices["+E+"];","uniform mat3 normalMatrices["+E+"];","#define modelViewMatrix modelViewMatrices[VIEW_ID]","#define projectionMatrix projectionMatrices[VIEW_ID]","#define viewMatrix viewMatrices[VIEW_ID]","#define normalMatrix normalMatrices[VIEW_ID]"].join("\n")),u=(u=u.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","#define VIEW_ID gl_ViewID_OVR"].join("\n"))).replace("uniform mat4 viewMatrix;",["uniform mat4 viewMatrices["+E+"];","#define viewMatrix viewMatrices[VIEW_ID]"].join("\n")))}var L,D,P=u+v,O=Pa(f,35633,c+g),R=Pa(f,35632,P);if(f.attachShader(T,O),f.attachShader(T,R),void 0!==n.index0AttributeName?f.bindAttribLocation(T,0,n.index0AttributeName):!0===n.morphTargets&&f.bindAttribLocation(T,0,"position"),f.linkProgram(T),e.debug.checkShaderErrors){var I=f.getProgramInfoLog(T).trim(),B=f.getShaderInfoLog(O).trim(),N=f.getShaderInfoLog(R).trim(),k=!0,F=!0;if(!1===f.getProgramParameter(T,35714)){k=!1;var G=Ia(f,O,"vertex"),V=Ia(f,R,"fragment");console.error("THREE.WebGLProgram: shader error: ",f.getError(),"35715",f.getProgramParameter(T,35715),"gl.getProgramInfoLog",I,G,V)}else""!==I?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",I):""!==B&&""!==N||(F=!1);F&&(this.diagnostics={runnable:k,programLog:I,vertexShader:{log:B,prefix:c},fragmentShader:{log:N,prefix:u}})}return f.deleteShader(O),f.deleteShader(R),this.getUniforms=function(){return void 0===L&&(L=new Da(f,T)),L},this.getAttributes=function(){return void 0===D&&(D=function(e,t){for(var n={},r=e.getProgramParameter(t,35721),i=0;i<r;i++){var a=e.getActiveAttrib(t,i).name;n[a]=e.getAttribLocation(t,a)}return n}(f,T)),D},this.destroy=function(){f.deleteProgram(T),this.program=void 0},this.name=n.shaderName,this.id=Oa++,this.cacheKey=t,this.usedTimes=1,this.program=T,this.vertexShader=O,this.fragmentShader=R,this.numMultiviewViews=E,this}(e,n,t),r.push(s)),s},this.releaseProgram=function(e){if(0==--e.usedTimes){var t=r.indexOf(e);r[t]=r[r.length-1],r.pop(),e.destroy()}},this.programs=r}function Ja(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function Xa(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function Ya(){var e=[],t=0,n=[],r=[],i={id:-1};function a(n,r,a,o,s,l){var c=e[t];return void 0===c?(c={id:n.id,object:n,geometry:r,material:a,program:a.program||i,groupOrder:o,renderOrder:n.renderOrder,z:s,group:l},e[t]=c):(c.id=n.id,c.object=n,c.geometry=r,c.material=a,c.program=a.program||i,c.groupOrder=o,c.renderOrder=n.renderOrder,c.z=s,c.group=l),t++,c}return{opaque:n,transparent:r,init:function(){t=0,n.length=0,r.length=0},push:function(e,t,i,o,s,l){var c=a(e,t,i,o,s,l);(!0===i.transparent?r:n).push(c)},unshift:function(e,t,i,o,s,l){var c=a(e,t,i,o,s,l);(!0===i.transparent?r:n).unshift(c)},sort:function(e,t){1<n.length&&n.sort(e||Ja),1<r.length&&r.sort(t||Xa)}}}var $a=0;function Za(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function Ka(){for(var e=new function(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new Wt,color:new cr,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new It};break;case"SpotLight":n={position:new Wt,direction:new Wt,color:new cr,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new It};break;case"PointLight":n={position:new Wt,color:new cr,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new It,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new Wt,skyColor:new cr,groundColor:new cr};break;case"RectAreaLight":n={color:new cr,position:new Wt,halfWidth:new Wt,halfHeight:new Wt}}return e[t.id]=n}}},t={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},n=0;n<9;n++)t.probe.push(new Wt);var r=new Wt,i=new Qt,a=new Qt;return{setup:function(n,o,s){for(var l=0,c=0,u=0,h=0;h<9;h++)t.probe[h].set(0,0,0);var p=0,d=0,f=0,m=0,g=0,v=0,y=0,x=0,_=s.matrixWorldInverse;n.sort(Za),h=0;for(var b=n.length;h<b;h++){var w=n[h],M=w.color,S=w.intensity,T=w.distance,E=w.shadow&&w.shadow.map?w.shadow.map.texture:null;if(w.isAmbientLight)l+=M.r*S,c+=M.g*S,u+=M.b*S;else if(w.isLightProbe)for(var C=0;C<9;C++)t.probe[C].addScaledVector(w.sh.coefficients[C],S);else if(w.isDirectionalLight){if((L=e.get(w)).color.copy(w.color).multiplyScalar(w.intensity),L.direction.setFromMatrixPosition(w.matrixWorld),r.setFromMatrixPosition(w.target.matrixWorld),L.direction.sub(r),L.direction.transformDirection(_),L.shadow=w.castShadow,w.castShadow){var A=w.shadow;L.shadowBias=A.bias,L.shadowRadius=A.radius,L.shadowMapSize=A.mapSize,t.directionalShadowMap[p]=E,t.directionalShadowMatrix[p]=w.shadow.matrix,v++}t.directional[p]=L,p++}else if(w.isSpotLight)(L=e.get(w)).position.setFromMatrixPosition(w.matrixWorld),L.position.applyMatrix4(_),L.color.copy(M).multiplyScalar(S),L.distance=T,L.direction.setFromMatrixPosition(w.matrixWorld),r.setFromMatrixPosition(w.target.matrixWorld),L.direction.sub(r),L.direction.transformDirection(_),L.coneCos=Math.cos(w.angle),L.penumbraCos=Math.cos(w.angle*(1-w.penumbra)),L.decay=w.decay,L.shadow=w.castShadow,w.castShadow&&(A=w.shadow,L.shadowBias=A.bias,L.shadowRadius=A.radius,L.shadowMapSize=A.mapSize,t.spotShadowMap[f]=E,t.spotShadowMatrix[f]=w.shadow.matrix,x++),t.spot[f]=L,f++;else if(w.isRectAreaLight)(L=e.get(w)).color.copy(M).multiplyScalar(S),L.position.setFromMatrixPosition(w.matrixWorld),L.position.applyMatrix4(_),a.identity(),i.copy(w.matrixWorld),i.premultiply(_),a.extractRotation(i),L.halfWidth.set(.5*w.width,0,0),L.halfHeight.set(0,.5*w.height,0),L.halfWidth.applyMatrix4(a),L.halfHeight.applyMatrix4(a),t.rectArea[m]=L,m++;else if(w.isPointLight)(L=e.get(w)).position.setFromMatrixPosition(w.matrixWorld),L.position.applyMatrix4(_),L.color.copy(w.color).multiplyScalar(w.intensity),L.distance=w.distance,L.decay=w.decay,L.shadow=w.castShadow,w.castShadow&&(A=w.shadow,L.shadowBias=A.bias,L.shadowRadius=A.radius,L.shadowMapSize=A.mapSize,L.shadowCameraNear=A.camera.near,L.shadowCameraFar=A.camera.far,t.pointShadowMap[d]=E,t.pointShadowMatrix[d]=w.shadow.matrix,y++),t.point[d]=L,d++;else if(w.isHemisphereLight){var L;(L=e.get(w)).direction.setFromMatrixPosition(w.matrixWorld),L.direction.transformDirection(_),L.direction.normalize(),L.skyColor.copy(w.color).multiplyScalar(S),L.groundColor.copy(w.groundColor).multiplyScalar(S),t.hemi[g]=L,g++}}t.ambient[0]=l,t.ambient[1]=c,t.ambient[2]=u;var D=t.hash;D.directionalLength===p&&D.pointLength===d&&D.spotLength===f&&D.rectAreaLength===m&&D.hemiLength===g&&D.numDirectionalShadows===v&&D.numPointShadows===y&&D.numSpotShadows===x||(t.directional.length=p,t.spot.length=f,t.rectArea.length=m,t.point.length=d,t.hemi.length=g,t.directionalShadowMap.length=v,t.pointShadowMap.length=y,t.spotShadowMap.length=x,t.directionalShadowMatrix.length=v,t.pointShadowMatrix.length=y,t.spotShadowMatrix.length=x,D.directionalLength=p,D.pointLength=d,D.spotLength=f,D.rectAreaLength=m,D.hemiLength=g,D.numDirectionalShadows=v,D.numPointShadows=y,D.numSpotShadows=x,t.version=$a++)},state:t}}function Qa(){var e=new Ka,t=[],n=[];return{init:function(){t.length=0,n.length=0},state:{lightsArray:t,shadowsArray:n,lights:e},setupLights:function(r){e.setup(t,n,r)},pushLight:function(e){t.push(e)},pushShadow:function(e){n.push(e)}}}function eo(e){mr.call(this),this.type="MeshDepthMaterial",this.depthPacking=bt,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}function to(e){mr.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Wt,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}((eo.prototype=Object.create(mr.prototype)).constructor=eo).prototype.isMeshDepthMaterial=!0,eo.prototype.copy=function(e){return mr.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},((to.prototype=Object.create(mr.prototype)).constructor=to).prototype.isMeshDistanceMaterial=!0,to.prototype.copy=function(e){return mr.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this};var no="uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}",ro="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}";function io(e,t,n){var r=new Si,a=new It,u=new It,h=new Gt,d=[],f=[],m={},g={0:l,1:s,2:c},v=new gi({defines:{SAMPLE_RATE:.25,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new It},radius:{value:4}},vertexShader:ro,fragmentShader:no}),y=v.clone();y.defines.HORIZONAL_PASS=1;var x=new kr;x.setAttribute("position",new yr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var _=new ti(x,v),b=this;function w(n,r){var i=t.update(_);v.uniforms.shadow_pass.value=n.map.texture,v.uniforms.resolution.value=n.mapSize,v.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,i,v,_,null),y.uniforms.shadow_pass.value=n.mapPass.texture,y.uniforms.resolution.value=n.mapSize,y.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,i,y,_,null)}function M(e,t,n){var r=e<<0|t<<1|n<<2,i=d[r];return void 0===i&&(i=new eo({depthPacking:wt,morphTargets:e,skinning:t}),d[r]=i),i}function S(e,t,n){var r=e<<0|t<<1|n<<2,i=f[r];return void 0===i&&(i=new to({morphTargets:e,skinning:t}),f[r]=i),i}function T(t,n,r,i,a,s){var l=t.geometry,c=null,u=M,h=t.customDepthMaterial;if(!0===r.isPointLight&&(u=S,h=t.customDistanceMaterial),void 0===h){var p=!1;!0===n.morphTargets&&(!0===l.isBufferGeometry?p=l.morphAttributes&&l.morphAttributes.position&&0<l.morphAttributes.position.length:!0===l.isGeometry&&(p=l.morphTargets&&0<l.morphTargets.length));var d=!1;!0===t.isSkinnedMesh&&(!0===n.skinning?d=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),c=u(p,d,!0===t.isInstancedMesh)}else c=h;if(e.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var f=c.uuid,v=n.uuid,y=m[f];void 0===y&&(y={},m[f]=y);var x=y[v];void 0===x&&(x=c.clone(),y[v]=x),c=x}return c.visible=n.visible,c.wireframe=n.wireframe,c.side=s===o?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:g[n.side],c.clipShadows=n.clipShadows,c.clippingPlanes=n.clippingPlanes,c.clipIntersection=n.clipIntersection,c.wireframeLinewidth=n.wireframeLinewidth,c.linewidth=n.linewidth,!0===r.isPointLight&&!0===c.isMeshDistanceMaterial&&(c.referencePosition.setFromMatrixPosition(r.matrixWorld),c.nearDistance=i,c.farDistance=a),c}function E(n,i,a,s,l){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&l===o)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);var c=t.update(n),u=n.material;if(Array.isArray(u))for(var h=c.groups,p=0,d=h.length;p<d;p++){var f=h[p],m=u[f.materialIndex];if(m&&m.visible){var g=T(n,m,s,a.near,a.far,l);e.renderBufferDirect(a,null,c,g,n,f)}}else u.visible&&(g=T(n,u,s,a.near,a.far,l),e.renderBufferDirect(a,null,c,g,n,null))}for(var v=n.children,y=0,x=v.length;y<x;y++)E(v[y],i,a,s,l)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=i,this.render=function(t,i,s){if(!1!==b.enabled&&(!1!==b.autoUpdate||!1!==b.needsUpdate)&&0!==t.length){var l=e.getRenderTarget(),c=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),f=e.state;f.setBlending(p),f.buffers.color.setClear(1,1,1,1),f.buffers.depth.setTest(!0),f.setScissorTest(!1);for(var m=0,g=t.length;m<g;m++){var v=t[m],y=v.shadow;if(void 0!==y){a.copy(y.mapSize);var x=y.getFrameExtents();if(a.multiply(x),u.copy(y.mapSize),(a.x>n||a.y>n)&&(console.warn("THREE.WebGLShadowMap:",v,"has shadow exceeding max texture size, reducing"),a.x>n&&(u.x=Math.floor(n/x.x),a.x=u.x*x.x,y.mapSize.x=u.x),a.y>n&&(u.y=Math.floor(n/x.y),a.y=u.y*x.y,y.mapSize.y=u.y)),null===y.map&&!y.isPointLightShadow&&this.type===o){var _={minFilter:ue,magFilter:ue,format:Ce};y.map=new Vt(a.x,a.y,_),y.map.texture.name=v.name+".shadowMap",y.mapPass=new Vt(a.x,a.y,_),y.camera.updateProjectionMatrix()}null===y.map&&(_={minFilter:se,magFilter:se,format:Ce},y.map=new Vt(a.x,a.y,_),y.map.texture.name=v.name+".shadowMap",y.camera.updateProjectionMatrix()),e.setRenderTarget(y.map),e.clear();for(var M=y.getViewportCount(),S=0;S<M;S++){var T=y.getViewport(S);h.set(u.x*T.x,u.y*T.y,u.x*T.z,u.y*T.w),f.viewport(h),y.updateMatrices(v,S),r=y.getFrustum(),E(i,s,y.camera,v,this.type)}y.isPointLightShadow||this.type!==o||w(y,s)}else console.warn("THREE.WebGLShadowMap:",v,"has no shadow.")}b.needsUpdate=!1,e.setRenderTarget(l,c,d)}}}function ao(e,i,a){var o=a.isWebGL2,s=new function(){var t=!1,n=new Gt,r=null,i=new Gt(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,a,o,s){!0===s&&(t*=o,r*=o,a*=o),n.set(t,r,a,o),!1===i.equals(n)&&(e.clearColor(t,r,a,o),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},u=new function(){var t=!1,n=null,r=null,i=null;return{setTest:function(e){(e?xe:_e)(2929)},setMask:function(r){n===r||t||(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){if(t)switch(t){case I:e.depthFunc(512);break;case B:e.depthFunc(519);break;case N:e.depthFunc(513);break;case k:e.depthFunc(515);break;case F:e.depthFunc(514);break;case G:e.depthFunc(518);break;case V:e.depthFunc(516);break;case z:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,i=r=n=null}}},h=new function(){var t=!1,n=null,r=null,i=null,a=null,o=null,s=null,l=null,c=null;return{setTest:function(e){t||(e?xe:_e)(2960)},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,o){r===t&&i===n&&a===o||(e.stencilFunc(t,n,o),r=t,i=n,a=o)},setOp:function(t,n,r){o===t&&s===n&&l===r||(e.stencilOp(t,n,r),o=t,s=n,l=r)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,c=l=s=o=a=i=r=n=null}}},U=e.getParameter(34921),j=new Uint8Array(U),H=new Uint8Array(U),W=new Uint8Array(U),q={},J=null,X=null,Y=null,$=null,Z=null,K=null,Q=null,ee=null,te=null,ne=!1,re=null,ie=null,ae=null,oe=null,se=null,le=e.getParameter(35661),ce=!1,ue=0,he=e.getParameter(7938);-1!==he.indexOf("WebGL")?(ue=parseFloat(/^WebGL\ ([0-9])/.exec(he)[1]),ce=1<=ue):-1!==he.indexOf("OpenGL ES")&&(ue=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(he)[1]),ce=2<=ue);var pe=null,de={},fe=new Gt,me=new Gt;function ge(t,n,r){var i=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(var o=0;o<r;o++)e.texImage2D(n+o,0,6408,1,1,0,6408,5121,i);return a}var ve={};function ye(t,n){j[t]=1,0===H[t]&&(e.enableVertexAttribArray(t),H[t]=1),W[t]!==n&&((o?e:i.get("ANGLE_instanced_arrays"))[o?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](t,n),W[t]=n)}function xe(t){!0!==q[t]&&(e.enable(t),q[t]=!0)}function _e(t){!1!==q[t]&&(e.disable(t),q[t]=!1)}ve[3553]=ge(3553,3553,1),ve[34067]=ge(34067,34069,6),s.setClear(0,0,0,1),u.setClear(1),h.setClear(0),xe(2929),u.setFunc(k),Te(!1),Ee(n),xe(2884),Se(p);var be={};if(be[y]=32774,be[x]=32778,be[_]=32779,o)be[b]=32775,be[w]=32776;else{var we=i.get("EXT_blend_minmax");null!==we&&(be[b]=we.MIN_EXT,be[w]=we.MAX_EXT)}var Me={};function Se(t,n,r,i,a,o,s,l){if(t!==p){if(X||(xe(3042),X=!0),t===v)a=a||n,o=o||r,s=s||i,n===$&&a===Q||(e.blendEquationSeparate(be[n],be[a]),$=n,Q=a),r===Z&&i===K&&o===ee&&s===te||(e.blendFuncSeparate(Me[r],Me[i],Me[o],Me[s]),Z=r,K=i,ee=o,te=s),Y=t,ne=null;else if(t!==Y||l!==ne){if($===y&&Q===y||(e.blendEquation(32774),Q=$=y),l)switch(t){case d:e.blendFuncSeparate(1,771,1,771);break;case f:e.blendFunc(1,1);break;case m:e.blendFuncSeparate(0,0,769,771);break;case g:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case d:e.blendFuncSeparate(770,771,1,771);break;case f:e.blendFunc(770,1);break;case m:e.blendFunc(0,769);break;case g:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}te=ee=K=Z=null,Y=t,ne=l}}else X&&(_e(3042),X=!1)}function Te(t){re!==t&&(t?e.frontFace(2304):e.frontFace(2305),re=t)}function Ee(i){i!==t?(xe(2884),i!==ie&&(i===n?e.cullFace(1029):i===r?e.cullFace(1028):e.cullFace(1032))):_e(2884),ie=i}function Ce(t,n,r){t?(xe(32823),oe===n&&se===r||(e.polygonOffset(n,r),oe=n,se=r)):_e(32823)}function Ae(t){void 0===t&&(t=33984+le-1),pe!==t&&(e.activeTexture(t),pe=t)}return Me[M]=0,Me[S]=1,Me[T]=768,Me[C]=770,Me[R]=776,Me[P]=774,Me[L]=772,Me[E]=769,Me[A]=771,Me[O]=775,Me[D]=773,{buffers:{color:s,depth:u,stencil:h},initAttributes:function(){for(var e=0,t=j.length;e<t;e++)j[e]=0},enableAttribute:function(e){ye(e,0)},enableAttributeAndDivisor:ye,disableUnusedAttributes:function(){for(var t=0,n=H.length;t!==n;++t)H[t]!==j[t]&&(e.disableVertexAttribArray(t),H[t]=0)},enable:xe,disable:_e,useProgram:function(t){return J!==t&&(e.useProgram(t),J=t,!0)},setBlending:Se,setMaterial:function(e,t){(e.side===c?_e:xe)(2884);var n=e.side===l;t&&(n=!n),Te(n),e.blending===d&&!1===e.transparent?Se(p):Se(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),u.setFunc(e.depthFunc),u.setTest(e.depthTest),u.setMask(e.depthWrite),s.setMask(e.colorWrite);var r=e.stencilWrite;h.setTest(r),r&&(h.setMask(e.stencilWriteMask),h.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),h.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),Ce(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)},setFlipSided:Te,setCullFace:Ee,setLineWidth:function(t){t!==ae&&(ce&&e.lineWidth(t),ae=t)},setPolygonOffset:Ce,setScissorTest:function(e){(e?xe:_e)(3089)},activeTexture:Ae,bindTexture:function(t,n){null===pe&&Ae();var r=de[pe];void 0===r&&(r={type:void 0,texture:void 0},de[pe]=r),r.type===t&&r.texture===n||(e.bindTexture(t,n||ve[t]),r.type=t,r.texture=n)},unbindTexture:function(){var t=de[pe];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===fe.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),fe.copy(t))},viewport:function(t){!1===me.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),me.copy(t))},reset:function(){for(var t=0;t<H.length;t++)1===H[t]&&(e.disableVertexAttribArray(t),H[t]=0);q={},de={},ie=re=Y=J=pe=null,s.reset(),u.reset(),h.reset()}}}function oo(e,t,n){var r=n.isWebGL2;return{convert:function(e){var n;if(e===de)return 5121;if(e===be)return 32819;if(e===we)return 32820;if(e===Me)return 33635;if(e===fe)return 5120;if(e===me)return 5122;if(e===ge)return 5123;if(e===ve)return 5124;if(e===ye)return 5125;if(e===xe)return 5126;if(e===_e)return r?5131:null!==(n=t.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(e===Te)return 6406;if(e===Ee)return 6407;if(e===Ce)return 6408;if(e===Ae)return 6409;if(e===Le)return 6410;if(e===Pe)return 6402;if(e===Oe)return 34041;if(e===Re)return 6403;if(e===Ie)return 36244;if(e===Be)return 33319;if(e===Ne)return 33320;if(e===ke)return 36248;if(e===Fe)return 36249;if(e===Ge||e===Ve||e===ze||e===Ue){if(null===(n=t.get("WEBGL_compressed_texture_s3tc")))return null;if(e===Ge)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===Ve)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===ze)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===Ue)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e===je||e===He||e===We||e===qe){if(null===(n=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(e===je)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===He)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===We)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===qe)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}return e===Je?null!==(n=t.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null:e===Xe||e===Ye||e===$e||e===Ze||e===Ke||e===Qe||e===et||e===tt||e===nt||e===rt||e===it||e===at||e===ot||e===st?null!==(n=t.get("WEBGL_compressed_texture_astc"))?e:null:e===Se?r?34042:null!==(n=t.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function so(e,t,n,r){Vt.call(this,e,t,r),this.depthBuffer=!1,this.stencilBuffer=!1,this.numViews=n}function lo(e){yi.call(this),this.cameras=e||[]}function co(){yn.call(this),this.type="Group"}function uo(e,t){var n=this,r=null,i=null,a="local-floor",o=null,s=[],l=new Map,c=new yi;c.layers.enable(1),c.viewport=new Gt;var u=new yi;u.layers.enable(2),u.viewport=new Gt;var h=new lo([c,u]);h.layers.enable(1),h.layers.enable(2);var p=null,d=null;function f(e){var t=l.get(e.inputSource);t&&(t.targetRay&&t.targetRay.dispatchEvent({type:e.type}),t.grip&&t.grip.dispatchEvent({type:e.type}))}function m(){l.forEach(function(e,t){e.targetRay&&(e.targetRay.dispatchEvent({type:"disconnected",data:t}),e.targetRay.visible=!1),e.grip&&(e.grip.dispatchEvent({type:"disconnected",data:t}),e.grip.visible=!1)}),l.clear(),e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),w.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function g(e){i=e,w.setContext(r),w.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}function v(e){for(var t=r.inputSources,n=0;n<s.length;n++)l.set(t[n],s[n]);for(n=0;n<e.removed.length;n++){var i=e.removed[n];(a=l.get(i))&&(a.targetRay&&a.targetRay.dispatchEvent({type:"disconnected",data:i}),a.grip&&a.grip.dispatchEvent({type:"disconnected",data:i}),l.delete(i))}for(n=0;n<e.added.length;n++){var a;i=e.added[n],(a=l.get(i))&&(a.targetRay&&a.targetRay.dispatchEvent({type:"connected",data:i}),a.grip&&a.grip.dispatchEvent({type:"connected",data:i}))}}this.enabled=!1,this.isPresenting=!1,this.getController=function(e){var t=s[e];return void 0===t&&(t={},s[e]=t),void 0===t.targetRay&&(t.targetRay=new co,t.targetRay.matrixAutoUpdate=!1,t.targetRay.visible=!1),t.targetRay},this.getControllerGrip=function(e){var t=s[e];return void 0===t&&(t={},s[e]=t),void 0===t.grip&&(t.grip=new co,t.grip.matrixAutoUpdate=!1,t.grip.visible=!1),t.grip},this.setFramebufferScaleFactor=function(){},this.setReferenceSpaceType=function(e){a=e},this.getReferenceSpace=function(){return i},this.getSession=function(){return r},this.setSession=function(e){if(null!==(r=e)){r.addEventListener("select",f),r.addEventListener("selectstart",f),r.addEventListener("selectend",f),r.addEventListener("squeeze",f),r.addEventListener("squeezestart",f),r.addEventListener("squeezeend",f),r.addEventListener("end",m);var n=t.getContextAttributes(),i={antialias:n.antialias,alpha:n.alpha,depth:n.depth,stencil:n.stencil},o=new XRWebGLLayer(r,t,i);r.updateRenderState({baseLayer:o}),r.requestReferenceSpace(a).then(g),r.addEventListener("inputsourceschange",v)}};var y=new Wt,x=new Wt;function _(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.getInverse(e.matrixWorld)}this.getCamera=function(e){h.near=u.near=c.near=e.near,h.far=u.far=c.far=e.far,p===h.near&&d===h.far||(r.updateRenderState({depthNear:h.near,depthFar:h.far}),p=h.near,d=h.far);var t=e.parent,n=h.cameras;_(h,t);for(var i=0;i<n.length;i++)_(n[i],t);e.matrixWorld.copy(h.matrixWorld);for(var a=e.children,o=(i=0,a.length);i<o;i++)a[i].updateMatrixWorld(!0);return function(e,t,n){y.setFromMatrixPosition(t.matrixWorld),x.setFromMatrixPosition(n.matrixWorld);var r=y.distanceTo(x),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),l=(i[9]+1)/i[5],c=(i[9]-1)/i[5],u=(i[8]-1)/i[0],h=(a[8]+1)/a[0],p=o*u,d=o*h,f=r/(h-u),m=f*-u;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.getInverse(e.matrixWorld);var g=o+f,v=s+f,_=p-m,b=r-m+d,w=l*s/v*g,M=c*s/v*g;e.projectionMatrix.makePerspective(_,b,w,M,g,v)}(h,c,u),h};var b=null,w=new Ei;w.setAnimationLoop(function(t,n){if(null!==(o=n.getViewerPose(i))){var a=o.views,l=r.renderState.baseLayer;e.setFramebuffer(l.framebuffer);for(var c=0;c<a.length;c++){var u=a[c],p=l.getViewport(u),d=h.cameras[c];d.matrix.fromArray(u.transform.matrix),d.projectionMatrix.fromArray(u.projectionMatrix),d.viewport.set(p.x,p.y,p.width,p.height),0===c&&h.matrix.copy(d.matrix)}}var f=r.inputSources;for(c=0;c<s.length;c++){var m=s[c],g=f[c],v=null,y=null;g&&(m.targetRay&&null!==(v=n.getPose(g.targetRaySpace,i))&&(m.targetRay.matrix.fromArray(v.transform.matrix),m.targetRay.matrix.decompose(m.targetRay.position,m.targetRay.rotation,m.targetRay.scale)),m.grip&&g.gripSpace&&null!==(y=n.getPose(g.gripSpace,i))&&(m.grip.matrix.fromArray(y.transform.matrix),m.grip.matrix.decompose(m.grip.position,m.grip.rotation,m.grip.scale))),m.targetRay&&(m.targetRay.visible=null!==v),m.grip&&(m.grip.visible=null!==y)}b&&b(t,n)}),this.setAnimationLoop=function(e){b=e},this.dispose=function(){}}function ho(e){var t=void 0!==(e=e||{}).canvas?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==e.context?e.context:null,r=void 0!==e.alpha&&e.alpha,i=void 0===e.depth||e.depth,a=void 0===e.stencil||e.stencil,o=void 0!==e.antialias&&e.antialias,s=void 0===e.premultipliedAlpha||e.premultipliedAlpha,c=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,u=void 0!==e.powerPreference?e.powerPreference:"default",h=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat,p=null,d=null;this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=dt,this.physicallyCorrectLights=!1,this.toneMapping=q,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var f,m,g,v,y,x,_,b,w,M,S,T,E,C,A,L,D,P,O=this,R=!1,I=null,B=0,N=0,k=null,F=null,G=-1,V={geometry:null,program:null,wireframe:!1},z=null,U=null,j=new Gt,H=new Gt,W=null,J=t.width,X=t.height,Y=1,$=null,Z=null,K=new Gt(0,0,J,X),Q=new Gt(0,0,J,X),ee=!1,te=new Si,ne=new function(){var e=this,t=null,n=0,r=!1,i=!1,a=new Xn,o=new Bt,s={value:null,needsUpdate:!1};function l(){s.value!==t&&(s.value=t,s.needsUpdate=0<n),e.numPlanes=n,e.numIntersection=0}function c(t,n,r,i){var l=null!==t?t.length:0,c=null;if(0!==l){if(c=s.value,!0!==i||null===c){var u=r+4*l,h=n.matrixWorldInverse;o.getNormalMatrix(h),(null===c||c.length<u)&&(c=new Float32Array(u));for(var p=0,d=r;p!==l;++p,d+=4)a.copy(t[p]).applyMatrix4(h,o),a.normal.toArray(c,d),c[d+3]=a.constant}s.value=c,s.needsUpdate=!0}return e.numPlanes=l,c}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(e,i,a){var o=0!==e.length||i||0!==n||r;return r=i,t=c(e,a,0),n=e.length,o},this.beginShadows=function(){i=!0,c(null)},this.endShadows=function(){i=!1,l()},this.setState=function(e,a,o,u,h,p){if(!r||null===e||0===e.length||i&&!o)i?c(null):l();else{var d=i?0:n,f=4*d,m=h.clippingState||null;s.value=m,m=c(e,u,f,p);for(var g=0;g!==f;++g)m[g]=t[g];h.clippingState=m,this.numIntersection=a?this.numPlanes:0,this.numPlanes+=d}}},re=!1,fe=!1,me=new Qt,ve=new Wt;function be(){return null===k?Y:1}try{var we={alpha:r,depth:i,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:h,xrCompatible:!0};if(t.addEventListener("webglcontextlost",De,!1),t.addEventListener("webglcontextrestored",Re,!1),null===(f=n||t.getContext("webgl",we)||t.getContext("experimental-webgl",we)))throw null!==t.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===f.getShaderPrecisionFormat&&(f.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function Me(){m=new function(e){var t={};return{get:function(n){if(void 0!==t[n])return t[n];var r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return null===r&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),t[n]=r}}}(f),!1===(g=new function(e,t,n){var r;function i(t){if("highp"===t){if(0<e.getShaderPrecisionFormat(35633,36338).precision&&0<e.getShaderPrecisionFormat(35632,36338).precision)return"highp";t="mediump"}return"mediump"===t&&0<e.getShaderPrecisionFormat(35633,36337).precision&&0<e.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp"}var a="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,o=void 0!==n.precision?n.precision:"highp",s=i(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var l=!0===n.logarithmicDepthBuffer,c=e.getParameter(34930),u=e.getParameter(35660),h=e.getParameter(3379),p=e.getParameter(34076),d=e.getParameter(34921),f=e.getParameter(36347),m=e.getParameter(36348),g=e.getParameter(36349),v=0<u,y=a||!!t.get("OES_texture_float");return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==r)return r;var n=t.get("EXT_texture_filter_anisotropic");return r=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:h,maxCubemapSize:p,maxAttributes:d,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:a?e.getParameter(36183):0}}(f,m,e)).isWebGL2&&(m.get("WEBGL_depth_texture"),m.get("OES_texture_float"),m.get("OES_texture_half_float"),m.get("OES_texture_half_float_linear"),m.get("OES_standard_derivatives"),m.get("OES_element_index_uint"),m.get("ANGLE_instanced_arrays")),m.get("OES_texture_float_linear"),P=new oo(0,m,g),(v=new ao(f,m,g)).scissor(H.copy(Q).multiplyScalar(Y).floor()),v.viewport(j.copy(K).multiplyScalar(Y).floor()),y=new function(e){var t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(e,n,r){switch(r=r||1,t.calls++,n){case 4:t.triangles+=r*(e/3);break;case 1:t.lines+=r*(e/2);break;case 3:t.lines+=r*(e-1);break;case 2:t.lines+=r*e;break;case 0:t.points+=r*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}},x=new function(){var e=new WeakMap;return{get:function(t){var n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,r){e.get(t)[n]=r},dispose:function(){e=new WeakMap}}},_=new function(e,t,n,r,i,a,o){var s,l=i.isWebGL2,c=i.maxTextures,u=i.maxCubemapSize,h=i.maxTextureSize,p=i.maxSamples,d=new WeakMap,f=!1;try{f="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function m(e,t){return f?new OffscreenCanvas(e,t):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function g(e,t,n,r){var i=1;if((e.width>r||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){var a=t?Rt.floorPowerOfTwo:Math.floor,o=a(i*e.width),l=a(i*e.height);void 0===s&&(s=m(o,l));var c=n?m(o,l):s;return c.width=o,c.height=l,c.getContext("2d").drawImage(e,0,0,o,l),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+o+"x"+l+")."),c}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function v(e){return Rt.isPowerOfTwo(e.width)&&Rt.isPowerOfTwo(e.height)}function y(e,t){return e.generateMipmaps&&t&&e.minFilter!==se&&e.minFilter!==ue}function x(t,n,i,a){e.generateMipmap(t),r.get(n).__maxMipLevel=Math.log(Math.max(i,a))*Math.LOG2E}function _(n,r,i){if(!1===l)return r;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var a=r;return 6403===r&&(5126===i&&(a=33326),5131===i&&(a=33325),5121===i&&(a=33321)),6407===r&&(5126===i&&(a=34837),5131===i&&(a=34843),5121===i&&(a=32849)),6408===r&&(5126===i&&(a=34836),5131===i&&(a=34842),5121===i&&(a=32856)),33325===a||33326===a||34842===a||34836===a?t.get("EXT_color_buffer_float"):34843!==a&&34837!==a||console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),a}function b(e){return e===se||e===le||e===ce?9728:9729}function w(t){var n=t.target;n.removeEventListener("dispose",w),function(t){var n=r.get(t);void 0!==n.__webglInit&&(e.deleteTexture(n.__webglTexture),r.remove(t))}(n),n.isVideoTexture&&d.delete(n),o.memory.textures--}function M(t){var n=t.target;n.removeEventListener("dispose",M),function(t){var n=r.get(t),i=r.get(t.texture);if(t){if(void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(var a=0;a<6;a++)e.deleteFramebuffer(n.__webglFramebuffer[a]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[a]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer);if(t.isWebGLMultiviewRenderTarget){e.deleteTexture(n.__webglColorTexture),e.deleteTexture(n.__webglDepthStencilTexture),o.memory.textures-=2,a=0;for(var s=n.__webglViewFramebuffers.length;a<s;a++)e.deleteFramebuffer(n.__webglViewFramebuffers[a])}r.remove(t.texture),r.remove(t)}}(n),o.memory.textures--}var S=0;function T(e,t){var i,a,s=r.get(e);if(e.isVideoTexture&&(i=e,a=o.render.frame,d.get(i)!==a&&(d.set(i,a),i.update())),0<e.version&&s.__version!==e.version){var l=e.image;if(void 0===l)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==l.complete)return void O(s,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,s.__webglTexture)}function E(t,i){if(6===t.image.length){var o=r.get(t);if(0<t.version&&o.__version!==t.version){P(o,t),n.activeTexture(33984+i),n.bindTexture(34067,o.__webglTexture),e.pixelStorei(37440,t.flipY);for(var s=t&&(t.isCompressedTexture||t.image[0].isCompressedTexture),c=t.image[0]&&t.image[0].isDataTexture,h=[],p=0;p<6;p++)h[p]=s||c?c?t.image[p].image:t.image[p]:g(t.image[p],!1,!0,u);var d,f=h[0],m=v(f)||l,b=a.convert(t.format),w=a.convert(t.type),M=_(t.internalFormat,b,w);if(D(34067,t,m),s){for(p=0;p<6;p++){d=h[p].mipmaps;for(var S=0;S<d.length;S++){var T=d[S];t.format!==Ce&&t.format!==Ee?null!==b?n.compressedTexImage2D(34069+p,S,M,T.width,T.height,0,T.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+p,S,M,T.width,T.height,0,b,w,T.data)}}o.__maxMipLevel=d.length-1}else{for(d=t.mipmaps,p=0;p<6;p++)if(c)for(n.texImage2D(34069+p,0,M,h[p].width,h[p].height,0,b,w,h[p].data),S=0;S<d.length;S++){var E=(T=d[S]).image[p].image;n.texImage2D(34069+p,S+1,M,E.width,E.height,0,b,w,E.data)}else for(n.texImage2D(34069+p,0,M,b,w,h[p]),S=0;S<d.length;S++)T=d[S],n.texImage2D(34069+p,S+1,M,b,w,T.image[p]);o.__maxMipLevel=d.length}y(t,m)&&x(34067,t,f.width,f.height),o.__version=t.version,t.onUpdate&&t.onUpdate(t)}else n.activeTexture(33984+i),n.bindTexture(34067,o.__webglTexture)}}function C(e,t){n.activeTexture(33984+t),n.bindTexture(34067,r.get(e).__webglTexture)}var A={};A[ie]=10497,A[ae]=33071,A[oe]=33648;var L={};function D(n,a,o){o?(e.texParameteri(n,10242,A[a.wrapS]),e.texParameteri(n,10243,A[a.wrapT]),32879!==n&&35866!==n||e.texParameteri(n,32882,A[a.wrapR]),e.texParameteri(n,10240,L[a.magFilter]),e.texParameteri(n,10241,L[a.minFilter])):(e.texParameteri(n,10242,33071),e.texParameteri(n,10243,33071),32879!==n&&35866!==n||e.texParameteri(n,32882,33071),a.wrapS===ae&&a.wrapT===ae||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(n,10240,b(a.magFilter)),e.texParameteri(n,10241,b(a.minFilter)),a.minFilter!==se&&a.minFilter!==ue&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));var s=t.get("EXT_texture_filter_anisotropic");if(s){if(a.type===xe&&null===t.get("OES_texture_float_linear"))return;if(a.type===_e&&null===(l||t.get("OES_texture_half_float_linear")))return;(1<a.anisotropy||r.get(a).__currentAnisotropy)&&(e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy)}}function P(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",w),t.__webglTexture=e.createTexture(),o.memory.textures++)}function O(t,r,i){var o=3553;r.isDataTexture2DArray&&(o=35866),r.isDataTexture3D&&(o=32879),P(t,r),n.activeTexture(33984+i),n.bindTexture(o,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment);var s,c=(s=r,!l&&(s.wrapS!==ae||s.wrapT!==ae||s.minFilter!==se&&s.minFilter!==ue)&&!1===v(r.image)),u=g(r.image,c,!1,h),p=v(u)||l,d=a.convert(r.format),f=a.convert(r.type),m=_(r.internalFormat,d,f);D(o,r,p);var b,w=r.mipmaps;if(r.isDepthTexture){if(m=6402,r.type===xe){if(!1===l)throw new Error("Float Depth Texture only supported in WebGL2.0");m=36012}else l&&(m=33189);r.format===Pe&&6402===m&&r.type!==ge&&r.type!==ye&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=ge,f=a.convert(r.type)),r.format===Oe&&(m=34041,r.type!==Se&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=Se,f=a.convert(r.type))),n.texImage2D(3553,0,m,u.width,u.height,0,d,f,null)}else if(r.isDataTexture)if(0<w.length&&p){for(var M=0,S=w.length;M<S;M++)b=w[M],n.texImage2D(3553,M,m,b.width,b.height,0,d,f,b.data);r.generateMipmaps=!1,t.__maxMipLevel=w.length-1}else n.texImage2D(3553,0,m,u.width,u.height,0,d,f,u.data),t.__maxMipLevel=0;else if(r.isCompressedTexture){for(M=0,S=w.length;M<S;M++)b=w[M],r.format!==Ce&&r.format!==Ee?null!==d?n.compressedTexImage2D(3553,M,m,b.width,b.height,0,b.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,M,m,b.width,b.height,0,d,f,b.data);t.__maxMipLevel=w.length-1}else if(r.isDataTexture2DArray)n.texImage3D(35866,0,m,u.width,u.height,u.depth,0,d,f,u.data),t.__maxMipLevel=0;else if(r.isDataTexture3D)n.texImage3D(32879,0,m,u.width,u.height,u.depth,0,d,f,u.data),t.__maxMipLevel=0;else if(0<w.length&&p){for(M=0,S=w.length;M<S;M++)b=w[M],n.texImage2D(3553,M,m,d,f,b);r.generateMipmaps=!1,t.__maxMipLevel=w.length-1}else n.texImage2D(3553,0,m,d,f,u),t.__maxMipLevel=0;y(r,p)&&x(o,r,u.width,u.height),t.__version=r.version,r.onUpdate&&r.onUpdate(r)}function R(t,i,o,s){var l=a.convert(i.texture.format),c=a.convert(i.texture.type),u=_(i.texture.internalFormat,l,c);n.texImage2D(s,0,u,i.width,i.height,0,l,c,null),e.bindFramebuffer(36160,t),e.framebufferTexture2D(36160,o,s,r.get(i.texture).__webglTexture,0),e.bindFramebuffer(36160,null)}function I(t,n,r){if(e.bindRenderbuffer(36161,t),n.depthBuffer&&!n.stencilBuffer){if(r){var i=N(n);e.renderbufferStorageMultisample(36161,i,33189,n.width,n.height)}else e.renderbufferStorage(36161,33189,n.width,n.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(n.depthBuffer&&n.stencilBuffer)r?(i=N(n),e.renderbufferStorageMultisample(36161,i,35056,n.width,n.height)):e.renderbufferStorage(36161,34041,n.width,n.height),e.framebufferRenderbuffer(36160,33306,36161,t);else{var o=a.convert(n.texture.format),s=a.convert(n.texture.type),l=_(n.texture.internalFormat,o,s);r?(i=N(n),e.renderbufferStorageMultisample(36161,i,l,n.width,n.height)):e.renderbufferStorage(36161,l,n.width,n.height)}e.bindRenderbuffer(36161,null)}function B(t){var n=r.get(t),i=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,n){if(n&&n.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,t),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),T(n.depthTexture,0);var i=r.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===Pe)e.framebufferTexture2D(36160,36096,3553,i,0);else{if(n.depthTexture.format!==Oe)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(36160,33306,3553,i,0)}}(n.__webglFramebuffer,t)}else if(i){n.__webglDepthbuffer=[];for(var a=0;a<6;a++)e.bindFramebuffer(36160,n.__webglFramebuffer[a]),n.__webglDepthbuffer[a]=e.createRenderbuffer(),I(n.__webglDepthbuffer[a],t)}else e.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=e.createRenderbuffer(),I(n.__webglDepthbuffer,t);e.bindFramebuffer(36160,null)}function N(e){return l&&e.isWebGLMultisampleRenderTarget?Math.min(p,e.samples):0}L[se]=9728,L[le]=9984,L[ce]=9986,L[ue]=9729,L[he]=9985;var k=!(L[pe]=9987),F=!1;this.allocateTextureUnit=function(){var e=S;return c<=e&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+c),S+=1,e},this.resetTextureUnits=function(){S=0},this.setTexture2D=T,this.setTexture2DArray=function(e,t){var i=r.get(e);0<e.version&&i.__version!==e.version?O(i,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){var i=r.get(e);0<e.version&&i.__version!==e.version?O(i,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=E,this.setTextureCubeDynamic=C,this.setupRenderTarget=function(i){var s=r.get(i),c=r.get(i.texture);i.addEventListener("dispose",M),c.__webglTexture=e.createTexture(),o.memory.textures++;var u=!0===i.isWebGLCubeRenderTarget,h=!0===i.isWebGLMultisampleRenderTarget,p=!0===i.isWebGLMultiviewRenderTarget,d=v(i)||l;if(u){s.__webglFramebuffer=[];for(var f=0;f<6;f++)s.__webglFramebuffer[f]=e.createFramebuffer()}else if(s.__webglFramebuffer=e.createFramebuffer(),h)if(l){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,s.__webglColorRenderbuffer);var m=a.convert(i.texture.format),g=a.convert(i.texture.type),b=_(i.texture.internalFormat,m,g),w=N(i);e.renderbufferStorageMultisample(36161,w,b,i.width,i.height),e.bindFramebuffer(36160,s.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,s.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),i.depthBuffer&&(s.__webglDepthRenderbuffer=e.createRenderbuffer(),I(s.__webglDepthRenderbuffer,i,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");else if(p){var S=i.width,T=i.height,E=i.numViews;e.bindFramebuffer(36160,s.__webglFramebuffer);var C=t.get("OVR_multiview2");o.memory.textures+=2;var A=e.createTexture();e.bindTexture(35866,A),e.texParameteri(35866,10240,9728),e.texParameteri(35866,10241,9728),e.texImage3D(35866,0,32856,S,T,E,0,6408,5121,null),C.framebufferTextureMultiviewOVR(36160,36064,A,0,0,E);var L=e.createTexture();e.bindTexture(35866,L),e.texParameteri(35866,10240,9728),e.texParameteri(35866,10241,9728),e.texImage3D(35866,0,35056,S,T,E,0,34041,34042,null),C.framebufferTextureMultiviewOVR(36160,33306,L,0,0,E);var P=new Array(E);for(f=0;f<E;++f)P[f]=e.createFramebuffer(),e.bindFramebuffer(36160,P[f]),e.framebufferTextureLayer(36160,36064,A,0,f);s.__webglColorTexture=A,s.__webglDepthStencilTexture=L,s.__webglViewFramebuffers=P,e.bindFramebuffer(36160,null),e.bindTexture(35866,null)}if(u){for(n.bindTexture(34067,c.__webglTexture),D(34067,i.texture,d),f=0;f<6;f++)R(s.__webglFramebuffer[f],i,36064,34069+f);y(i.texture,d)&&x(34067,i.texture,i.width,i.height),n.bindTexture(34067,null)}else p||(n.bindTexture(3553,c.__webglTexture),D(3553,i.texture,d),R(s.__webglFramebuffer,i,36064,3553),y(i.texture,d)&&x(3553,i.texture,i.width,i.height),n.bindTexture(3553,null));i.depthBuffer&&B(i)},this.updateRenderTargetMipmap=function(e){var t=e.texture;if(y(t,v(e)||l)){var i=e.isWebGLCubeRenderTarget?34067:3553,a=r.get(t).__webglTexture;n.bindTexture(i,a),x(i,t,e.width,e.height),n.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(l){var n=r.get(t);e.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,n.__webglFramebuffer);var i=t.width,a=t.height,o=16384;t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024),e.blitFramebuffer(0,0,i,a,0,0,i,a,o,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===k&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),k=!0),e=e.texture),T(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===F&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),F=!0),e=e.texture),(e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?E:C)(e,t)}}(f,m,v,x,g,P,y),b=new function(e,t){var n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){t.isInterleavedBufferAttribute&&(t=t.data);var a,o,s,l,c,u=r.get(t);void 0===u?r.set(t,function(t,n){var r=t.array,i=t.usage,a=e.createBuffer();e.bindBuffer(n,a),e.bufferData(n,r,i),t.onUploadCallback();var o=5126;return r instanceof Float32Array?o=5126:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?o=5123:r instanceof Int16Array?o=5122:r instanceof Uint32Array?o=5125:r instanceof Int32Array?o=5124:r instanceof Int8Array?o=5120:r instanceof Uint8Array&&(o=5121),{buffer:a,type:o,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version}}(t,i)):u.version<t.version&&(a=u.buffer,s=i,l=(o=t).array,c=o.updateRange,e.bindBuffer(s,a),-1===c.count?e.bufferSubData(s,0,l):(n?e.bufferSubData(s,c.offset*l.BYTES_PER_ELEMENT,l,c.offset,c.count):e.bufferSubData(s,c.offset*l.BYTES_PER_ELEMENT,l.subarray(c.offset,c.offset+c.count)),c.count=-1),u.version=t.version)}}}(f,g),w=new function(e,t,n){var r=new WeakMap,i=new WeakMap;function a(e){var o=e.target,s=r.get(o);for(var l in null!==s.index&&t.remove(s.index),s.attributes)t.remove(s.attributes[l]);o.removeEventListener("dispose",a),r.delete(o);var c=i.get(s);c&&(t.remove(c),i.delete(s)),n.memory.geometries--}function o(e){var n=[],r=e.index,a=e.attributes.position,o=0;if(null!==r){var s=r.array;o=r.version;for(var l=0,c=s.length;l<c;l+=3){var u=s[l+0],h=s[l+1],p=s[l+2];n.push(u,h,h,p,p,u)}}else for(s=a.array,o=a.version,l=0,c=s.length/3-1;l<c;l+=3)u=l+0,h=l+1,p=l+2,n.push(u,h,h,p,p,u);var d=new(65535<Lr(n)?Tr:Mr)(n,1);d.version=o,t.update(d,34963);var f=i.get(e);f&&t.remove(f),i.set(e,d)}return{get:function(e,t){var i=r.get(t);return i||(t.addEventListener("dispose",a),t.isBufferGeometry?i=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new kr).setFromObject(e)),i=t._bufferGeometry),r.set(t,i),n.memory.geometries++,i)},update:function(e){var n=e.index,r=e.attributes;for(var i in null!==n&&t.update(n,34963),r)t.update(r[i],34962);var a=e.morphAttributes;for(var i in a)for(var o=a[i],s=0,l=o.length;s<l;s++)t.update(o[s],34962)},getWireframeAttribute:function(e){var t=i.get(e);if(t){var n=e.index;null!==n&&t.version<n.version&&o(e)}else o(e);return i.get(e)}}}(0,b,y),M=new function(e,t,n,r){var i={};return{update:function(e){var a=r.render.frame,o=e.geometry,s=t.get(e,o);return i[s.id]!==a&&(o.isGeometry&&s.updateFromObject(e),t.update(s),i[s.id]=a),e.isInstancedMesh&&n.update(e.instanceMatrix,34962),s},dispose:function(){i={}}}}(0,w,b,y),A=new function(e){var t={},n=new Float32Array(8);return{update:function(r,i,a,o){var s=r.morphTargetInfluences,l=void 0===s?0:s.length,c=t[i.id];if(void 0===c){c=[];for(var u=0;u<l;u++)c[u]=[u,0];t[i.id]=c}var h=a.morphTargets&&i.morphAttributes.position,p=a.morphNormals&&i.morphAttributes.normal;for(u=0;u<l;u++)0!==(f=c[u])[1]&&(h&&i.deleteAttribute("morphTarget"+u),p&&i.deleteAttribute("morphNormal"+u));for(u=0;u<l;u++)(f=c[u])[0]=u,f[1]=s[u];c.sort(Oi);var d=0;for(u=0;u<8;u++){var f;if(f=c[u]){var m=f[0],g=f[1];if(g){h&&i.setAttribute("morphTarget"+u,h[m]),p&&i.setAttribute("morphNormal"+u,p[m]),d+=n[u]=g;continue}}n[u]=0}var v=i.morphTargetsRelative?1:1-d;o.getUniforms().setValue(e,"morphTargetBaseInfluence",v),o.getUniforms().setValue(e,"morphTargetInfluences",n)}}}(f),S=new qa(O,m,g),T=new function(){var e=new WeakMap;function t(n){var r=n.target;r.removeEventListener("dispose",t),e.delete(r)}return{get:function(n,r){var i,a=e.get(n);return void 0===a?(i=new Ya,e.set(n,new WeakMap),e.get(n).set(r,i),n.addEventListener("dispose",t)):void 0===(i=a.get(r))&&(i=new Ya,a.set(r,i)),i},dispose:function(){e=new WeakMap}}},E=new function(){var e=new WeakMap;function t(n){var r=n.target;r.removeEventListener("dispose",t),e.delete(r)}return{get:function(n,r){var i;return!1===e.has(n)?(i=new Qa,e.set(n,new WeakMap),e.get(n).set(r,i),n.addEventListener("dispose",t)):!1===e.get(n).has(r)?(i=new Qa,e.get(n).set(r,i)):i=e.get(n).get(r),i},dispose:function(){e=new WeakMap}}},C=new Pi(O,v,M,s),L=new function(e,t,n,r){var i,a=r.isWebGL2;this.setMode=function(e){i=e},this.render=function(t,r){e.drawArrays(i,t,r),n.update(r,i)},this.renderInstances=function(r,o,s,l){if(0!==l){var c,u;if(a)c=e,u="drawArraysInstanced";else if(u="drawArraysInstancedANGLE",null===(c=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[u](i,o,s,l),n.update(s,i,l)}}}(f,m,y,g),D=new function(e,t,n,r){var i,a,o,s=r.isWebGL2;this.setMode=function(e){i=e},this.setIndex=function(e){a=e.type,o=e.bytesPerElement},this.render=function(t,r){e.drawElements(i,r,a,t*o),n.update(r,i)},this.renderInstances=function(r,l,c,u){if(0!==u){var h,p;if(s)h=e,p="drawElementsInstanced";else if(p="drawElementsInstancedANGLE",null===(h=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[p](i,c,a,l*o,u),n.update(c,i,u)}}}(f,m,y,g),y.programs=S.programs,O.capabilities=g,O.extensions=m,O.properties=x,O.renderLists=T,O.state=v,O.info=y}Me();var Te=new uo(O,f);this.xr=Te;var Ae=new function(e,t){var n,r,i,a,o,s,l,c=e.extensions,u=e.properties,h=0;function p(e){return e.isArrayCamera?e.cameras:(o[0]=e,o)}this.isAvailable=function(){if(void 0===l){var e=c.get("OVR_multiview2");if(l=null!==e&&!1===t.getContextAttributes().antialias){h=t.getParameter(e.MAX_VIEWS_OVR),n=new so(0,0,2),s=new It,a=[],i=[],o=[];for(var r=0;r<h;r++)a[r]=new Qt,i[r]=new Bt}}return l},this.attachCamera=function(t){!1!==function(e){if(void 0===e.isArrayCamera)return!0;var t=e.cameras;if(t.length>h)return!1;for(var n=1,r=t.length;n<r;n++)if(t[0].viewport.z!==t[n].viewport.z||t[0].viewport.w!==t[n].viewport.w)return!1;return!0}(t)&&(r=e.getRenderTarget(),function(t){if(r?s.set(r.width,r.height):e.getDrawingBufferSize(s),t.isArrayCamera){var i=t.cameras[0].viewport;n.setSize(i.z,i.w),n.setNumViews(t.cameras.length)}else n.setSize(s.x,s.y),n.setNumViews(2)}(t),e.setRenderTarget(n))},this.detachCamera=function(i){n===e.getRenderTarget()&&(e.setRenderTarget(r),function(e){var r=n,i=r.numViews,a=u.get(r).__webglViewFramebuffers,o=r.width,l=r.height;if(e.isArrayCamera)for(var c=0;c<i;c++){var h=e.cameras[c].viewport,p=h.x,d=h.y,f=p+h.z,m=d+h.w;t.bindFramebuffer(36008,a[c]),t.blitFramebuffer(0,0,o,l,p,d,f,m,16384,9728)}else t.bindFramebuffer(36008,a[0]),t.blitFramebuffer(0,0,o,l,0,0,s.x,s.y,16384,9728)}(i))},this.updateCameraProjectionMatricesUniform=function(e,n){for(var r=p(e),i=0;i<r.length;i++)a[i].copy(r[i].projectionMatrix);n.setValue(t,"projectionMatrices",a)},this.updateCameraViewMatricesUniform=function(e,n){for(var r=p(e),i=0;i<r.length;i++)a[i].copy(r[i].matrixWorldInverse);n.setValue(t,"viewMatrices",a)},this.updateObjectMatricesUniforms=function(e,n,r){for(var o=p(n),s=0;s<o.length;s++)a[s].multiplyMatrices(o[s].matrixWorldInverse,e.matrixWorld),i[s].getNormalMatrix(a[s]);r.setValue(t,"modelViewMatrices",a),r.setValue(t,"normalMatrices",i)}}(O,f),Le=new io(O,M,g.maxTextureSize);function De(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),R=!0}function Re(){console.log("THREE.WebGLRenderer: Context Restored."),R=!1,Me()}function Ie(e){var t,n=e.target;n.removeEventListener("dispose",Ie),Be(t=n),x.remove(t)}function Be(e){var t=x.get(e).program;(e.program=void 0)!==t&&S.releaseProgram(t)}this.shadowMap=Le,this.getContext=function(){return f},this.getContextAttributes=function(){return f.getContextAttributes()},this.forceContextLoss=function(){var e=m.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=m.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return Y},this.setPixelRatio=function(e){void 0!==e&&(Y=e,this.setSize(J,X,!1))},this.getSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),e=new It),e.set(J,X)},this.setSize=function(e,n,r){Te.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(J=e,X=n,t.width=Math.floor(e*Y),t.height=Math.floor(n*Y),!1!==r&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),e=new It),e.set(J*Y,X*Y).floor()},this.setDrawingBufferSize=function(e,n,r){J=e,X=n,Y=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),e=new Gt),e.copy(j)},this.getViewport=function(e){return e.copy(K)},this.setViewport=function(e,t,n,r){e.isVector4?K.set(e.x,e.y,e.z,e.w):K.set(e,t,n,r),v.viewport(j.copy(K).multiplyScalar(Y).floor())},this.getScissor=function(e){return e.copy(Q)},this.setScissor=function(e,t,n,r){e.isVector4?Q.set(e.x,e.y,e.z,e.w):Q.set(e,t,n,r),v.scissor(H.copy(Q).multiplyScalar(Y).floor())},this.getScissorTest=function(){return ee},this.setScissorTest=function(e){v.setScissorTest(ee=e)},this.setOpaqueSort=function(e){$=e},this.setTransparentSort=function(e){Z=e},this.getClearColor=function(){return C.getClearColor()},this.setClearColor=function(){C.setClearColor.apply(C,arguments)},this.getClearAlpha=function(){return C.getClearAlpha()},this.setClearAlpha=function(){C.setClearAlpha.apply(C,arguments)},this.clear=function(e,t,n){var r=0;void 0!==e&&!e||(r|=16384),void 0!==t&&!t||(r|=256),void 0!==n&&!n||(r|=1024),f.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",De,!1),t.removeEventListener("webglcontextrestored",Re,!1),T.dispose(),E.dispose(),x.dispose(),M.dispose(),Te.dispose(),Fe.stop()},this.renderBufferImmediate=function(e,t){v.initAttributes();var n=x.get(e);e.hasPositions&&!n.position&&(n.position=f.createBuffer()),e.hasNormals&&!n.normal&&(n.normal=f.createBuffer()),e.hasUvs&&!n.uv&&(n.uv=f.createBuffer()),e.hasColors&&!n.color&&(n.color=f.createBuffer());var r=t.getAttributes();e.hasPositions&&(f.bindBuffer(34962,n.position),f.bufferData(34962,e.positionArray,35048),v.enableAttribute(r.position),f.vertexAttribPointer(r.position,3,5126,!1,0,0)),e.hasNormals&&(f.bindBuffer(34962,n.normal),f.bufferData(34962,e.normalArray,35048),v.enableAttribute(r.normal),f.vertexAttribPointer(r.normal,3,5126,!1,0,0)),e.hasUvs&&(f.bindBuffer(34962,n.uv),f.bufferData(34962,e.uvArray,35048),v.enableAttribute(r.uv),f.vertexAttribPointer(r.uv,2,5126,!1,0,0)),e.hasColors&&(f.bindBuffer(34962,n.color),f.bufferData(34962,e.colorArray,35048),v.enableAttribute(r.color),f.vertexAttribPointer(r.color,3,5126,!1,0,0)),v.disableUnusedAttributes(),f.drawArrays(4,0,e.count),e.count=0};var Ne=new xn;this.renderBufferDirect=function(e,t,n,r,i,a){null===t&&(t=Ne);var o=i.isMesh&&i.matrixWorld.determinant()<0,s=Ue(e,t,r,i);v.setMaterial(r,o);var l=!1;V.geometry===n.id&&V.program===s.id&&V.wireframe===(!0===r.wireframe)||(V.geometry=n.id,V.program=s.id,V.wireframe=!0===r.wireframe,l=!0),(r.morphTargets||r.morphNormals)&&(A.update(i,n,r,s),l=!0);var c=n.index,u=n.attributes.position;if(null===c){if(void 0===u||0===u.count)return}else if(0===c.count)return;var h,p=1;!0===r.wireframe&&(c=w.getWireframeAttribute(n),p=2);var d=L;null!==c&&((h=b.get(c))?(d=D).setIndex(h):(console.log("mx attribute == null"),c=null)),l&&(function(e,t,n,r){if(!1!==g.isWebGL2||!e.isInstancedMesh&&!t.isInstancedBufferGeometry||null!==m.get("ANGLE_instanced_arrays")){v.initAttributes();var i=t.attributes,a=r.getAttributes(),o=n.defaultAttributeValues;for(var s in a){var l=a[s];if(0<=l){var c=i[s];if(void 0!==c){var u=c.normalized,h=c.itemSize;if(void 0===(M=b.get(c)))continue;var p=M.buffer,d=M.type,y=M.bytesPerElement;if(c.isInterleavedBufferAttribute){var x=c.data,_=x.stride,w=c.offset;x&&x.isInstancedInterleavedBuffer?(v.enableAttributeAndDivisor(l,x.meshPerAttribute),void 0===t.maxInstancedCount&&(t.maxInstancedCount=x.meshPerAttribute*x.count)):v.enableAttribute(l),f.bindBuffer(34962,p),f.vertexAttribPointer(l,h,d,u,_*y,w*y)}else c.isInstancedBufferAttribute?(v.enableAttributeAndDivisor(l,c.meshPerAttribute),void 0===t.maxInstancedCount&&(t.maxInstancedCount=c.meshPerAttribute*c.count)):v.enableAttribute(l),f.bindBuffer(34962,p),f.vertexAttribPointer(l,h,d,u,0,0)}else if("instanceMatrix"===s){var M;if(void 0===(M=b.get(e.instanceMatrix)))continue;p=M.buffer,d=M.type,v.enableAttributeAndDivisor(l+0,1),v.enableAttributeAndDivisor(l+1,1),v.enableAttributeAndDivisor(l+2,1),v.enableAttributeAndDivisor(l+3,1),f.bindBuffer(34962,p),f.vertexAttribPointer(l+0,4,d,!1,64,0),f.vertexAttribPointer(l+1,4,d,!1,64,16),f.vertexAttribPointer(l+2,4,d,!1,64,32),f.vertexAttribPointer(l+3,4,d,!1,64,48)}else if(void 0!==o){var S=o[s];if(void 0!==S)switch(S.length){case 2:f.vertexAttrib2fv(l,S);break;case 3:f.vertexAttrib3fv(l,S);break;case 4:f.vertexAttrib4fv(l,S);break;default:f.vertexAttrib1fv(l,S)}}}}v.disableUnusedAttributes()}}(i,n,r,s),null!==c&&f.bindBuffer(34963,h.buffer));var y=null!==c?c.count:u.count,x=n.drawRange.start*p,_=n.drawRange.count*p,M=null!==a?a.start*p:0,S=null!==a?a.count*p:1/0,T=Math.max(x,M),E=Math.min(y,x+_,M+S)-1,C=Math.max(0,E-T+1);if(0!==C){if(i.isMesh)!0===r.wireframe?(v.setLineWidth(r.wireframeLinewidth*be()),d.setMode(1)):d.setMode(4);else if(i.isLine){var P=r.linewidth;void 0===P&&(P=1),v.setLineWidth(P*be()),i.isLineSegments?d.setMode(1):i.isLineLoop?d.setMode(2):d.setMode(3)}else i.isPoints?d.setMode(0):i.isSprite&&d.setMode(4);i.isInstancedMesh?d.renderInstances(n,T,C,i.count):n.isInstancedBufferGeometry?d.renderInstances(n,T,C,n.maxInstancedCount):d.render(T,C)}},this.compile=function(e,t){(d=E.get(e,t)).init(),e.traverse(function(e){e.isLight&&(d.pushLight(e),e.castShadow&&d.pushShadow(e))}),d.setupLights(t);var n={};e.traverse(function(t){if(t.material)if(Array.isArray(t.material))for(var r=0;r<t.material.length;r++)t.material[r].uuid in n==0&&(ze(t.material[r],e,t),n[t.material[r].uuid]=!0);else t.material.uuid in n==0&&(ze(t.material,e,t),n[t.material.uuid]=!0)})};var ke=null,Fe=new Ei;function Ge(e,t,n,r){for(var i=0,a=e.length;i<a;i++){var o=e[i],s=o.object,l=o.geometry,c=void 0===r?o.material:r,u=o.group;if(n.isArrayCamera)if(U=n,Te.enabled&&Ae.isAvailable())Ve(s,t,n,l,c,u);else for(var h=n.cameras,p=0,f=h.length;p<f;p++){var m=h[p];s.layers.test(m.layers)&&(v.viewport(j.copy(m.viewport)),d.setupLights(m),Ve(s,t,m,l,c,u))}else U=null,Ve(s,t,n,l,c,u)}}function Ve(e,t,n,r,i,a){if(e.onBeforeRender(O,t,n,r,i,a),d=E.get(t,U||n),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){var o=Ue(n,t,i,e);v.setMaterial(i),V.geometry=null,V.program=null,V.wireframe=!1,s=o,e.render(function(e){O.renderBufferImmediate(e,s)})}else O.renderBufferDirect(n,t,r,i,e,a);var s;e.onAfterRender(O,t,n,r,i,a),d=E.get(t,U||n)}function ze(e,t,n){var r=x.get(e),i=d.state.lights,a=d.state.shadowsArray,o=i.state.version,s=S.getParameters(e,i.state,a,t,ne.numPlanes,ne.numIntersection,n),l=S.getProgramCacheKey(s),c=r.program,u=!0;if(void 0===c)e.addEventListener("dispose",Ie);else if(c.cacheKey!==l)Be(e);else if(r.lightsStateVersion!==o)r.lightsStateVersion=o,u=!1;else{if(void 0!==s.shaderID)return;u=!1}u&&(c=S.acquireProgram(s,l),r.program=c,r.uniforms=s.uniforms,r.environment=e.isMeshStandardMaterial?t.environment:null,r.outputEncoding=O.outputEncoding,e.program=c);var h=c.getAttributes();if(e.morphTargets)for(var p=e.numSupportedMorphTargets=0;p<O.maxMorphTargets;p++)0<=h["morphTarget"+p]&&e.numSupportedMorphTargets++;if(e.morphNormals)for(p=e.numSupportedMorphNormals=0;p<O.maxMorphNormals;p++)0<=h["morphNormal"+p]&&e.numSupportedMorphNormals++;var f,m=r.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(r.numClippingPlanes=ne.numPlanes,r.numIntersection=ne.numIntersection,m.clippingPlanes=ne.uniform),r.fog=t.fog,r.needsLights=(f=e).isMeshLambertMaterial||f.isMeshToonMaterial||f.isMeshPhongMaterial||f.isMeshStandardMaterial||f.isShadowMaterial||f.isShaderMaterial&&!0===f.lights,r.lightsStateVersion=o,r.needsLights&&(m.ambientLightColor.value=i.state.ambient,m.lightProbe.value=i.state.probe,m.directionalLights.value=i.state.directional,m.spotLights.value=i.state.spot,m.rectAreaLights.value=i.state.rectArea,m.pointLights.value=i.state.point,m.hemisphereLights.value=i.state.hemi,m.directionalShadowMap.value=i.state.directionalShadowMap,m.directionalShadowMatrix.value=i.state.directionalShadowMatrix,m.spotShadowMap.value=i.state.spotShadowMap,m.spotShadowMatrix.value=i.state.spotShadowMatrix,m.pointShadowMap.value=i.state.pointShadowMap,m.pointShadowMatrix.value=i.state.pointShadowMatrix);var g=r.program.getUniforms(),v=Da.seqWithValue(g.seq,m);r.uniformsList=v}function Ue(e,t,n,r){_.resetTextureUnits();var i=t.fog,a=n.isMeshStandardMaterial?t.environment:null,o=x.get(n),s=d.state.lights;if(re&&(fe||e!==z)){var c=e===z&&n.id===G;ne.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,e,o,c)}n.version===o.__version?(void 0===o.program||n.fog&&o.fog!==i||o.environment!==a||o.needsLights&&o.lightsStateVersion!==s.state.version||void 0!==o.numClippingPlanes&&(o.numClippingPlanes!==ne.numPlanes||o.numIntersection!==ne.numIntersection)||o.outputEncoding!==O.outputEncoding)&&ze(n,t,r):(x.update(n,"uniforms",n.uniforms),ze(n,t,r),o.__version=n.version);var u,h,p,m,y,b,w,M,S,T,E,C,A=!1,L=!1,D=!1,P=o.program,R=P.getUniforms(),I=o.uniforms;if(v.useProgram(P.program)&&(D=L=A=!0),n.id!==G&&(G=n.id,L=!0),A||z!==e){if(0<P.numMultiviewViews?Ae.updateCameraProjectionMatricesUniform(e,R):R.setValue(f,"projectionMatrix",e.projectionMatrix),g.logarithmicDepthBuffer&&R.setValue(f,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),z!==e&&(z=e,D=L=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){var B=R.map.cameraPosition;void 0!==B&&B.setValue(f,ve.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&R.setValue(f,"isOrthographic",!0===e.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&(0<P.numMultiviewViews?Ae.updateCameraViewMatricesUniform(e,R):R.setValue(f,"viewMatrix",e.matrixWorldInverse))}if(n.skinning){R.setOptional(f,r,"bindMatrix"),R.setOptional(f,r,"bindMatrixInverse");var N=r.skeleton;if(N){var k=N.bones;if(g.floatVertexTextures){if(void 0===N.boneTexture){var F=Math.sqrt(4*k.length);F=Rt.ceilPowerOfTwo(F),F=Math.max(F,4);var V=new Float32Array(F*F*4);V.set(N.boneMatrices);var U=new bi(V,F,F,Ce,xe);N.boneMatrices=V,N.boneTexture=U,N.boneTextureSize=F}R.setValue(f,"boneTexture",N.boneTexture,_),R.setValue(f,"boneTextureSize",N.boneTextureSize)}else R.setOptional(f,N,"boneMatrices")}}return!L&&o.receiveShadow===r.receiveShadow||(o.receiveShadow=r.receiveShadow,R.setValue(f,"receiveShadow",r.receiveShadow)),L&&(R.setValue(f,"toneMappingExposure",O.toneMappingExposure),R.setValue(f,"toneMappingWhitePoint",O.toneMappingWhitePoint),o.needsLights&&(C=D,(E=I).ambientLightColor.needsUpdate=C,E.lightProbe.needsUpdate=C,E.directionalLights.needsUpdate=C,E.pointLights.needsUpdate=C,E.spotLights.needsUpdate=C,E.rectAreaLights.needsUpdate=C,E.hemisphereLights.needsUpdate=C),i&&n.fog&&(T=i,(S=I).fogColor.value.copy(T.color),T.isFog?(S.fogNear.value=T.near,S.fogFar.value=T.far):T.isFogExp2&&(S.fogDensity.value=T.density)),n.isMeshBasicMaterial?je(I,n):n.isMeshLambertMaterial?(je(I,n),w=I,(M=n).emissiveMap&&(w.emissiveMap.value=M.emissiveMap)):n.isMeshToonMaterial?(je(I,n),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.gradientMap&&(e.gradientMap.value=t.gradientMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===l&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===l&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(I,n)):n.isMeshPhongMaterial?(je(I,n),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===l&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===l&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(I,n)):n.isMeshStandardMaterial?(je(I,n,a),(n.isMeshPhysicalMaterial?function(e,t,n){He(e,t,n),e.reflectivity.value=t.reflectivity,e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.sheen&&e.sheen.value.copy(t.sheen),t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,t.side===l&&e.clearcoatNormalScale.value.negate()),e.transparency.value=t.transparency}:He)(I,n,a)):n.isMeshMatcapMaterial?(je(I,n),function(e,t){t.matcap&&(e.matcap.value=t.matcap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===l&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===l&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(I,n)):n.isMeshDepthMaterial?(je(I,n),y=I,(b=n).displacementMap&&(y.displacementMap.value=b.displacementMap,y.displacementScale.value=b.displacementScale,y.displacementBias.value=b.displacementBias)):n.isMeshDistanceMaterial?(je(I,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(I,n)):n.isMeshNormalMaterial?(je(I,n),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===l&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===l&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(I,n)):n.isLineBasicMaterial?(m=n,(p=I).diffuse.value.copy(m.color),p.opacity.value=m.opacity,n.isLineDashedMaterial&&(h=n,(u=I).dashSize.value=h.dashSize,u.totalSize.value=h.dashSize+h.gapSize,u.scale.value=h.scale)):n.isPointsMaterial?function(e,t){var n;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*Y,e.scale.value=.5*X,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.map?n=t.map:t.alphaMap&&(n=t.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(I,n):n.isSpriteMaterial?function(e,t){var n;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.map?n=t.map:t.alphaMap&&(n=t.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(I,n):n.isShadowMaterial&&(I.color.value.copy(n.color),I.opacity.value=n.opacity),void 0!==I.ltc_1&&(I.ltc_1.value=Ti.LTC_1),void 0!==I.ltc_2&&(I.ltc_2.value=Ti.LTC_2),Da.upload(f,o.uniformsList,I,_),n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(Da.upload(f,o.uniformsList,I,_),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&R.setValue(f,"center",r.center),0<P.numMultiviewViews?Ae.updateObjectMatricesUniforms(r,e,R):(R.setValue(f,"modelViewMatrix",r.modelViewMatrix),R.setValue(f,"normalMatrix",r.normalMatrix)),R.setValue(f,"modelMatrix",r.matrixWorld),P}function je(e,t,n){e.opacity.value=t.opacity,t.color&&e.diffuse.value.copy(t.color),t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.specularMap&&(e.specularMap.value=t.specularMap);var r,i,a=t.envMap||n;a&&(e.envMap.value=a,e.flipEnvMap.value=a.isCubeTexture?-1:1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio,e.maxMipLevel.value=x.get(a).__maxMipLevel),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity),t.map?r=t.map:t.specularMap?r=t.specularMap:t.displacementMap?r=t.displacementMap:t.normalMap?r=t.normalMap:t.bumpMap?r=t.bumpMap:t.roughnessMap?r=t.roughnessMap:t.metalnessMap?r=t.metalnessMap:t.alphaMap?r=t.alphaMap:t.emissiveMap&&(r=t.emissiveMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix)),t.aoMap?i=t.aoMap:t.lightMap&&(i=t.lightMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uv2Transform.value.copy(i.matrix))}function He(e,t,n){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===l&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===l&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),(t.envMap||n)&&(e.envMapIntensity.value=t.envMapIntensity)}Fe.setAnimationLoop(function(e){Te.isPresenting||ke&&ke(e)}),"undefined"!=typeof window&&Fe.setContext(window),this.setAnimationLoop=function(e){ke=e,Te.setAnimationLoop(e),Fe.start()},this.render=function(e,t){var n,r;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),r=arguments[3]),t&&t.isCamera){if(!R){V.geometry=null,V.program=null,V.wireframe=!1,G=-1,!(z=null)===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),Te.enabled&&Te.isPresenting&&(t=Te.getCamera(t)),(d=E.get(e,t)).init(),e.onBeforeRender(O,e,t,n||k),me.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),te.setFromProjectionMatrix(me),fe=this.localClippingEnabled,re=ne.init(this.clippingPlanes,fe,t),(p=T.get(e,t)).init(),function e(t,n,r,i){if(!1!==t.visible){if(t.layers.test(n.layers))if(t.isGroup)r=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(n);else if(t.isLight)d.pushLight(t),t.castShadow&&d.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||te.intersectsSprite(t)){i&&ve.setFromMatrixPosition(t.matrixWorld).applyMatrix4(me);var a=M.update(t);(o=t.material).visible&&p.push(t,a,o,r,ve.z,null)}}else if(t.isImmediateRenderObject)i&&ve.setFromMatrixPosition(t.matrixWorld).applyMatrix4(me),p.push(t,null,t.material,r,ve.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.frame!==y.render.frame&&(t.skeleton.update(),t.skeleton.frame=y.render.frame),!t.frustumCulled||te.intersectsObject(t))){i&&ve.setFromMatrixPosition(t.matrixWorld).applyMatrix4(me);a=M.update(t);var o=t.material;if(Array.isArray(o))for(var s=a.groups,l=0,c=s.length;l<c;l++){var u=s[l],h=o[u.materialIndex];h&&h.visible&&p.push(t,a,h,r,ve.z,u)}else o.visible&&p.push(t,a,o,r,ve.z,null)}var f=t.children;for(l=0,c=f.length;l<c;l++)e(f[l],n,r,i)}}(e,t,0,O.sortObjects),!0===O.sortObjects&&p.sort($,Z),re&&ne.beginShadows();var i=d.state.shadowsArray;Le.render(i,e,t),d.setupLights(t),re&&ne.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),Te.enabled&&Ae.isAvailable()&&Ae.attachCamera(t),C.render(p,e,t,r);var a=p.opaque,o=p.transparent;if(e.overrideMaterial){var s=e.overrideMaterial;a.length&&Ge(a,e,t,s),o.length&&Ge(o,e,t,s)}else a.length&&Ge(a,e,t),o.length&&Ge(o,e,t);e.onAfterRender(O,e,t),null!==k&&(_.updateRenderTargetMipmap(k),_.updateMultisampleRenderTarget(k)),v.buffers.depth.setTest(!0),v.buffers.depth.setMask(!0),v.buffers.color.setMask(!0),v.setPolygonOffset(!1),Te.enabled&&Ae.isAvailable()&&Ae.detachCamera(t),d=p=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(e){I!==e&&null===k&&f.bindFramebuffer(36160,e),I=e},this.getActiveCubeFace=function(){return B},this.getActiveMipmapLevel=function(){return N},this.getRenderTarget=function(){return k},this.setRenderTarget=function(e,t,n){B=t,N=n,(k=e)&&void 0===x.get(e).__webglFramebuffer&&_.setupRenderTarget(e);var r=I,i=!1;if(e){var a=x.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=a[t||0],i=!0):r=e.isWebGLMultisampleRenderTarget?x.get(e).__webglMultisampledFramebuffer:a,j.copy(e.viewport),H.copy(e.scissor),W=e.scissorTest}else j.copy(K).multiplyScalar(Y).floor(),H.copy(Q).multiplyScalar(Y).floor(),W=ee;if(F!==r&&(f.bindFramebuffer(36160,r),F=r),v.viewport(j),v.scissor(H),v.setScissorTest(W),i){var o=x.get(e.texture);f.framebufferTexture2D(36160,36064,34069+(t||0),o.__webglTexture,n||0)}},this.readRenderTargetPixels=function(e,t,n,r,i,a,o){if(e&&e.isWebGLRenderTarget){var s=x.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){var l=!1;s!==F&&(f.bindFramebuffer(36160,s),l=!0);try{var c=e.texture,u=c.format,h=c.type;if(u!==Ce&&P.convert(u)!==f.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(h===de||P.convert(h)===f.getParameter(35738)||h===xe&&(g.isWebGL2||m.get("OES_texture_float")||m.get("WEBGL_color_buffer_float"))||h===_e&&(g.isWebGL2?m.get("EXT_color_buffer_float"):m.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===f.checkFramebufferStatus(36160)?0<=t&&t<=e.width-r&&0<=n&&n<=e.height-i&&f.readPixels(t,n,r,i,P.convert(u),P.convert(h),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{l&&f.bindFramebuffer(36160,F)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,n){void 0===n&&(n=0);var r=Math.pow(2,-n),i=Math.floor(t.image.width*r),a=Math.floor(t.image.height*r),o=P.convert(t.format);_.setTexture2D(t,0),f.copyTexImage2D(3553,n,o,e.x,e.y,i,a,0),v.unbindTexture()},this.copyTextureToTexture=function(e,t,n,r){var i=t.image.width,a=t.image.height,o=P.convert(n.format),s=P.convert(n.type);_.setTexture2D(n,0),t.isDataTexture?f.texSubImage2D(3553,r||0,e.x,e.y,i,a,o,s,t.image.data):f.texSubImage2D(3553,r||0,e.x,e.y,o,s,t.image),v.unbindTexture()},this.initTexture=function(e){_.setTexture2D(e,0),v.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function po(e,t){this.name="",this.color=new cr(e),this.density=void 0!==t?t:25e-5}function fo(e,t,n){this.name="",this.color=new cr(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}function mo(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=Ct,this.updateRange={offset:0,count:-1},this.version=0}so.prototype=Object.assign(Object.create(Vt.prototype),{constructor:so,isWebGLMultiviewRenderTarget:!0,copy:function(e){return Vt.prototype.copy.call(this,e),this.numViews=e.numViews,this},setNumViews:function(e){return this.numViews!==e&&(this.numViews=e,this.dispose()),this}}),lo.prototype=Object.assign(Object.create(yi.prototype),{constructor:lo,isArrayCamera:!0}),co.prototype=Object.assign(Object.create(yn.prototype),{constructor:co,isGroup:!0}),Object.assign(uo.prototype,Lt.prototype),Object.assign(po.prototype,{isFogExp2:!0,clone:function(){return new po(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(fo.prototype,{isFog:!0,clone:function(){return new fo(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(mo.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(mo.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(var r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(e){return this.onUploadCallback=e,this}});var go,vo=new Wt;function yo(e,t,n,r){this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===r}function xo(e){mr.call(this),this.type="SpriteMaterial",this.color=new cr(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}Object.defineProperties(yo.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(yo.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(e){for(var t=0,n=this.data.count;t<n;t++)vo.x=this.getX(t),vo.y=this.getY(t),vo.z=this.getZ(t),vo.applyMatrix4(e),this.setXYZ(t,vo.x,vo.y,vo.z);return this},setX:function(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this},setY:function(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this},setZ:function(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this},setW:function(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}}),((xo.prototype=Object.create(mr.prototype)).constructor=xo).prototype.isSpriteMaterial=!0,xo.prototype.copy=function(e){return mr.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this};var _o=new Wt,bo=new Wt,wo=new Wt,Mo=new It,So=new It,To=new Qt,Eo=new Wt,Co=new Wt,Ao=new Wt,Lo=new It,Do=new It,Po=new It;function Oo(e){if(yn.call(this),this.type="Sprite",void 0===go){go=new kr;var t=new mo(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);go.setIndex([0,1,2,0,2,3]),go.setAttribute("position",new yo(t,3,0,!1)),go.setAttribute("uv",new yo(t,2,3,!1))}this.geometry=go,this.material=void 0!==e?e:new xo,this.center=new It(.5,.5)}function Ro(e,t,n,r,i,a){Mo.subVectors(e,n).addScalar(.5).multiply(r),void 0!==i?(So.x=a*Mo.x-i*Mo.y,So.y=i*Mo.x+a*Mo.y):So.copy(Mo),e.copy(t),e.x+=So.x,e.y+=So.y,e.applyMatrix4(To)}Oo.prototype=Object.assign(Object.create(yn.prototype),{constructor:Oo,isSprite:!0,raycast:function(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),bo.setFromMatrixScale(this.matrixWorld),To.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),wo.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&bo.multiplyScalar(-wo.z);var n,r,i=this.material.rotation;0!==i&&(r=Math.cos(i),n=Math.sin(i));var a=this.center;Ro(Eo.set(-.5,-.5,0),wo,a,bo,n,r),Ro(Co.set(.5,-.5,0),wo,a,bo,n,r),Ro(Ao.set(.5,.5,0),wo,a,bo,n,r),Lo.set(0,0),Do.set(1,0),Po.set(1,1);var o=e.ray.intersectTriangle(Eo,Co,Ao,!1,_o);if(null!==o||(Ro(Co.set(-.5,.5,0),wo,a,bo,n,r),Do.set(0,1),null!==(o=e.ray.intersectTriangle(Eo,Ao,Co,!1,_o)))){var s=e.ray.origin.distanceTo(_o);s<e.near||s>e.far||t.push({distance:s,point:_o.clone(),uv:ar.getUV(_o,Eo,Co,Ao,Lo,Do,Po,new It),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return yn.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this}});var Io=new Wt,Bo=new Wt;function No(){yn.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function ko(e,t){e&&e.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),ti.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Qt,this.bindMatrixInverse=new Qt}No.prototype=Object.assign(Object.create(yn.prototype),{constructor:No,isLOD:!0,copy:function(e){yn.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,r=t.length;n<r;n++){var i=t[n];this.addLevel(i.object.clone(),i.distance)}return this.autoUpdate=e.autoUpdate,this},addLevel:function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var n=this.levels,r=0;r<n.length&&!(t<n[r].distance);r++);return n.splice(r,0,{distance:t,object:e}),this.add(e),this},getObjectForDistance:function(e){var t=this.levels;if(0<t.length){for(var n=1,r=t.length;n<r&&!(e<t[n].distance);n++);return t[n-1].object}return null},raycast:function(e,t){if(0<this.levels.length){Io.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(Io);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){var t=this.levels;if(1<t.length){Io.setFromMatrixPosition(e.matrixWorld),Bo.setFromMatrixPosition(this.matrixWorld);var n=Io.distanceTo(Bo);t[0].object.visible=!0;for(var r=1,i=t.length;r<i&&n>=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(;r<i;r++)t[r].object.visible=!1}},toJSON:function(e){var t=yn.prototype.toJSON.call(this,e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];for(var n=this.levels,r=0,i=n.length;r<i;r++){var a=n[r];t.object.levels.push({object:a.object.uuid,distance:a.distance})}return t}}),ko.prototype=Object.assign(Object.create(ti.prototype),{constructor:ko,isSkinnedMesh:!0,bind:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var e=new Gt,t=this.geometry.attributes.skinWeight,n=0,r=t.count;n<r;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(n);var i=1/e.manhattanLength();i!=1/0?e.multiplyScalar(i):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}},updateMatrixWorld:function(e){ti.prototype.updateMatrixWorld.call(this,e),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Fo=new Qt,Go=new Qt;function Vo(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new Qt)}}function zo(){yn.call(this),this.type="Bone"}Object.assign(Vo.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new Qt;this.bones[e]&&n.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(n)}},pose:function(){var e,t,n;for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&(e.parent&&e.parent.isBone?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},update:function(){for(var e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,i=0,a=e.length;i<a;i++){var o=e[i]?e[i].matrixWorld:Go;Fo.multiplyMatrices(o,t[i]),Fo.toArray(n,16*i)}void 0!==r&&(r.needsUpdate=!0)},clone:function(){return new Vo(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,n=this.bones.length;t<n;t++){var r=this.bones[t];if(r.name===e)return r}}}),zo.prototype=Object.assign(Object.create(yn.prototype),{constructor:zo,isBone:!0});var Uo=new Qt,jo=new Qt,Ho=[],Wo=new ti;function qo(e,t,n){ti.call(this,e,t),this.instanceMatrix=new yr(new Float32Array(16*n),16),this.count=n,this.frustumCulled=!1}function Jo(e){mr.call(this),this.type="LineBasicMaterial",this.color=new cr(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(e)}qo.prototype=Object.assign(Object.create(ti.prototype),{constructor:qo,isInstancedMesh:!0,getMatrixAt:function(e,t){t.fromArray(this.instanceMatrix.array,16*e)},raycast:function(e,t){var n=this.matrixWorld,r=this.count;if(Wo.geometry=this.geometry,Wo.material=this.material,void 0!==Wo.material)for(var i=0;i<r;i++)this.getMatrixAt(i,Uo),jo.multiplyMatrices(n,Uo),Wo.matrixWorld=jo,Wo.raycast(e,Ho),0<Ho.length&&(Ho[0].instanceId=i,Ho[0].object=this,t.push(Ho[0]),Ho.length=0)},setMatrixAt:function(e,t){t.toArray(this.instanceMatrix.array,16*e)},updateMorphTargets:function(){}}),((Jo.prototype=Object.create(mr.prototype)).constructor=Jo).prototype.isLineBasicMaterial=!0,Jo.prototype.copy=function(e){return mr.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this};var Xo=new Wt,Yo=new Wt,$o=new Qt,Zo=new Hn,Ko=new Nn;function Qo(e,t,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),yn.call(this),this.type="Line",this.geometry=void 0!==e?e:new kr,this.material=void 0!==t?t:new Jo}Qo.prototype=Object.assign(Object.create(yn.prototype),{constructor:Qo,isLine:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],r=1,i=t.count;r<i;r++)Xo.fromBufferAttribute(t,r-1),Yo.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=Xo.distanceTo(Yo);e.setAttribute("lineDistance",new Er(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices;for((n=e.lineDistances)[0]=0,r=1,i=a.length;r<i;r++)n[r]=n[r-1],n[r]+=a[r-1].distanceTo(a[r])}return this},raycast:function(e,t){var n=e.linePrecision,r=this.geometry,i=this.matrixWorld;if(null===r.boundingSphere&&r.computeBoundingSphere(),Ko.copy(r.boundingSphere),Ko.applyMatrix4(i),Ko.radius+=n,!1!==e.ray.intersectsSphere(Ko)){$o.getInverse(i),Zo.copy(e.ray).applyMatrix4($o);var a=n/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,s=new Wt,l=new Wt,c=new Wt,u=new Wt,h=this&&this.isLineSegments?2:1;if(r.isBufferGeometry){var p=r.index,d=r.attributes.position.array;if(null!==p)for(var f=p.array,m=0,g=f.length-1;m<g;m+=h){var v=f[m],y=f[m+1];s.fromArray(d,3*v),l.fromArray(d,3*y),o<Zo.distanceSqToSegment(s,l,u,c)||(u.applyMatrix4(this.matrixWorld),(b=e.ray.origin.distanceTo(u))<e.near||b>e.far||t.push({distance:b,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}))}else for(m=0,g=d.length/3-1;m<g;m+=h)s.fromArray(d,3*m),l.fromArray(d,3*m+3),o<Zo.distanceSqToSegment(s,l,u,c)||(u.applyMatrix4(this.matrixWorld),(b=e.ray.origin.distanceTo(u))<e.near||b>e.far||t.push({distance:b,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}))}else if(r.isGeometry){var x=r.vertices,_=x.length;for(m=0;m<_-1;m+=h){var b;o<Zo.distanceSqToSegment(x[m],x[m+1],u,c)||(u.applyMatrix4(this.matrixWorld),(b=e.ray.origin.distanceTo(u))<e.near||b>e.far||t.push({distance:b,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}))}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var es=new Wt,ts=new Wt;function ns(e,t){Qo.call(this,e,t),this.type="LineSegments"}function rs(e,t){Qo.call(this,e,t),this.type="LineLoop"}function is(e){mr.call(this),this.type="PointsMaterial",this.color=new cr(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}ns.prototype=Object.assign(Object.create(Qo.prototype),{constructor:ns,isLineSegments:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[],r=0,i=t.count;r<i;r+=2)es.fromBufferAttribute(t,r),ts.fromBufferAttribute(t,r+1),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+es.distanceTo(ts);e.setAttribute("lineDistance",new Er(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices;for(n=e.lineDistances,r=0,i=a.length;r<i;r+=2)es.copy(a[r]),ts.copy(a[r+1]),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+es.distanceTo(ts)}return this}}),rs.prototype=Object.assign(Object.create(Qo.prototype),{constructor:rs,isLineLoop:!0}),((is.prototype=Object.create(mr.prototype)).constructor=is).prototype.isPointsMaterial=!0,is.prototype.copy=function(e){return mr.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this};var as=new Qt,os=new Hn,ss=new Nn,ls=new Wt;function cs(e,t){yn.call(this),this.type="Points",this.geometry=void 0!==e?e:new kr,this.material=void 0!==t?t:new is,this.updateMorphTargets()}function us(e,t,n,r,i,a,o){var s=os.distanceSqToPoint(e);if(s<n){var l=new Wt;os.closestPointToPoint(e,l),l.applyMatrix4(r);var c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;a.push({distance:c,distanceToRay:Math.sqrt(s),point:l,index:t,face:null,object:o})}}function hs(e,t,n,r,i,a,o,s,l){Ft.call(this,e,t,n,r,i,a,o,s,l),this.format=void 0!==o?o:Ee,this.minFilter=void 0!==a?a:ue,this.magFilter=void 0!==i?i:ue,this.generateMipmaps=!1}function ps(e,t,n,r,i,a,o,s,l,c,u,h){Ft.call(this,null,a,o,s,l,c,r,i,u,h),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function ds(e,t,n,r,i,a,o,s,l){Ft.call(this,e,t,n,r,i,a,o,s,l),this.needsUpdate=!0}function fs(e,t,n,r,i,a,o,s,l,c){if((c=void 0!==c?c:Pe)!==Pe&&c!==Oe)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===Pe&&(n=ge),void 0===n&&c===Oe&&(n=Se),Ft.call(this,null,r,i,a,o,s,c,n,l),this.image={width:e,height:t},this.magFilter=void 0!==o?o:se,this.minFilter=void 0!==s?s:se,this.flipY=!1,this.generateMipmaps=!1}function ms(e){kr.call(this),this.type="WireframeGeometry";var t,n,r,i,a,o,s,l,c,u,h=[],p=[0,0],d={},f=["a","b","c"];if(e&&e.isGeometry){var m=e.faces;for(t=0,r=m.length;t<r;t++){var g=m[t];for(n=0;n<3;n++)s=g[f[n]],l=g[f[(n+1)%3]],p[0]=Math.min(s,l),p[1]=Math.max(s,l),void 0===d[c=p[0]+","+p[1]]&&(d[c]={index1:p[0],index2:p[1]})}for(c in d)o=d[c],u=e.vertices[o.index1],h.push(u.x,u.y,u.z),u=e.vertices[o.index2],h.push(u.x,u.y,u.z)}else if(e&&e.isBufferGeometry){var v,y,x,_,b,w;if(u=new Wt,null!==e.index){for(v=e.attributes.position,y=e.index,0===(x=e.groups).length&&(x=[{start:0,count:y.count,materialIndex:0}]),i=0,a=x.length;i<a;++i)for(r=(t=(_=x[i]).start)+_.count;t<r;t+=3)for(n=0;n<3;n++)s=y.getX(t+n),l=y.getX(t+(n+1)%3),p[0]=Math.min(s,l),p[1]=Math.max(s,l),void 0===d[c=p[0]+","+p[1]]&&(d[c]={index1:p[0],index2:p[1]});for(c in d)o=d[c],u.fromBufferAttribute(v,o.index1),h.push(u.x,u.y,u.z),u.fromBufferAttribute(v,o.index2),h.push(u.x,u.y,u.z)}else for(t=0,r=(v=e.attributes.position).count/3;t<r;t++)for(n=0;n<3;n++)b=3*t+n,u.fromBufferAttribute(v,b),h.push(u.x,u.y,u.z),w=3*t+(n+1)%3,u.fromBufferAttribute(v,w),h.push(u.x,u.y,u.z)}this.setAttribute("position",new Er(h,3))}function gs(e,t,n){li.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new vs(e,t,n)),this.mergeVertices()}function vs(e,t,n){kr.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};var r,i,a=[],o=[],s=[],l=[],c=new Wt,u=new Wt,h=new Wt,p=new Wt,d=new Wt;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var f=t+1;for(r=0;r<=n;r++){var m=r/n;for(i=0;i<=t;i++){var g=i/t;e(g,m,u),o.push(u.x,u.y,u.z),0<=g-1e-5?(e(g-1e-5,m,h),p.subVectors(u,h)):(e(1e-5+g,m,h),p.subVectors(h,u)),0<=m-1e-5?(e(g,m-1e-5,h),d.subVectors(u,h)):(e(g,1e-5+m,h),d.subVectors(h,u)),c.crossVectors(p,d).normalize(),s.push(c.x,c.y,c.z),l.push(g,m)}}for(r=0;r<n;r++)for(i=0;i<t;i++){var v=r*f+i,y=r*f+i+1,x=(r+1)*f+i+1,_=(r+1)*f+i;a.push(v,y,_),a.push(y,x,_)}this.setIndex(a),this.setAttribute("position",new Er(o,3)),this.setAttribute("normal",new Er(s,3)),this.setAttribute("uv",new Er(l,2))}function ys(e,t,n,r){li.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},this.fromBufferGeometry(new xs(e,t,n,r)),this.mergeVertices()}function xs(e,t,n,r){kr.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},n=n||1;var i=[],a=[];function o(e,t,n,r){var i,a,o=Math.pow(2,r),l=[];for(i=0;i<=o;i++){l[i]=[];var c=e.clone().lerp(n,i/o),u=t.clone().lerp(n,i/o),h=o-i;for(a=0;a<=h;a++)l[i][a]=0===a&&i===o?c:c.clone().lerp(u,a/h)}for(i=0;i<o;i++)for(a=0;a<2*(o-i)-1;a++){var p=Math.floor(a/2);a%2==0?(s(l[i][p+1]),s(l[i+1][p]),s(l[i][p])):(s(l[i][p+1]),s(l[i+1][p+1]),s(l[i+1][p]))}}function s(e){i.push(e.x,e.y,e.z)}function l(t,n){var r=3*t;n.x=e[0+r],n.y=e[1+r],n.z=e[2+r]}function c(e,t,n,r){r<0&&1===e.x&&(a[t]=e.x-1),0===n.x&&0===n.z&&(a[t]=r/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}!function(e){for(var n=new Wt,r=new Wt,i=new Wt,a=0;a<t.length;a+=3)l(t[a+0],n),l(t[a+1],r),l(t[a+2],i),o(n,r,i,e)}(r=r||0),function(e){for(var t=new Wt,n=0;n<i.length;n+=3)t.x=i[n+0],t.y=i[n+1],t.z=i[n+2],t.normalize().multiplyScalar(e),i[n+0]=t.x,i[n+1]=t.y,i[n+2]=t.z}(n),function(){for(var e=new Wt,t=0;t<i.length;t+=3){e.x=i[t+0],e.y=i[t+1],e.z=i[t+2];var n=u(e)/2/Math.PI+.5,r=(o=e,Math.atan2(-o.y,Math.sqrt(o.x*o.x+o.z*o.z))/Math.PI+.5);a.push(n,1-r)}var o;(function(){for(var e=new Wt,t=new Wt,n=new Wt,r=new Wt,o=new It,s=new It,l=new It,h=0,p=0;h<i.length;h+=9,p+=6){e.set(i[h+0],i[h+1],i[h+2]),t.set(i[h+3],i[h+4],i[h+5]),n.set(i[h+6],i[h+7],i[h+8]),o.set(a[p+0],a[p+1]),s.set(a[p+2],a[p+3]),l.set(a[p+4],a[p+5]),r.copy(e).add(t).add(n).divideScalar(3);var d=u(r);c(o,p+0,e,d),c(s,p+2,t,d),c(l,p+4,n,d)}})(),function(){for(var e=0;e<a.length;e+=6){var t=a[e+0],n=a[e+2],r=a[e+4],i=Math.max(t,n,r),o=Math.min(t,n,r);.9<i&&o<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),r<.2&&(a[e+4]+=1))}}()}(),this.setAttribute("position",new Er(i,3)),this.setAttribute("normal",new Er(i.slice(),3)),this.setAttribute("uv",new Er(a,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}function _s(e,t){li.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new bs(e,t)),this.mergeVertices()}function bs(e,t){xs.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function ws(e,t){li.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Ms(e,t)),this.mergeVertices()}function Ms(e,t){xs.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Ss(e,t){li.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Ts(e,t)),this.mergeVertices()}function Ts(e,t){var n=(1+Math.sqrt(5))/2;xs.call(this,[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Es(e,t){li.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Cs(e,t)),this.mergeVertices()}function Cs(e,t){var n=(1+Math.sqrt(5))/2,r=1/n;xs.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function As(e,t,n,r,i,a){li.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new Ls(e,t,n,r,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function Ls(e,t,n,r,i){kr.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},t=t||64,n=n||1,r=r||8,i=i||!1;var a=e.computeFrenetFrames(t,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;var o,s,l=new Wt,c=new Wt,u=new It,h=new Wt,p=[],d=[],f=[],m=[];function g(i){h=e.getPointAt(i/t,h);var o=a.normals[i],u=a.binormals[i];for(s=0;s<=r;s++){var f=s/r*Math.PI*2,m=Math.sin(f),g=-Math.cos(f);c.x=g*o.x+m*u.x,c.y=g*o.y+m*u.y,c.z=g*o.z+m*u.z,c.normalize(),d.push(c.x,c.y,c.z),l.x=h.x+n*c.x,l.y=h.y+n*c.y,l.z=h.z+n*c.z,p.push(l.x,l.y,l.z)}}!function(){for(o=0;o<t;o++)g(o);g(!1===i?t:0),function(){for(o=0;o<=t;o++)for(s=0;s<=r;s++)u.x=o/t,u.y=s/r,f.push(u.x,u.y)}(),function(){for(s=1;s<=t;s++)for(o=1;o<=r;o++){var e=(r+1)*(s-1)+(o-1),n=(r+1)*s+(o-1),i=(r+1)*s+o,a=(r+1)*(s-1)+o;m.push(e,n,a),m.push(n,i,a)}}()}(),this.setIndex(m),this.setAttribute("position",new Er(p,3)),this.setAttribute("normal",new Er(d,3)),this.setAttribute("uv",new Er(f,2))}function Ds(e,t,n,r,i,a,o){li.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Ps(e,t,n,r,i,a)),this.mergeVertices()}function Ps(e,t,n,r,i,a){kr.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},e=e||1,t=t||.4,n=Math.floor(n)||64,r=Math.floor(r)||8,i=i||2,a=a||3;var o,s,l=[],c=[],u=[],h=[],p=new Wt,d=new Wt,f=new Wt,m=new Wt,g=new Wt,v=new Wt,y=new Wt;for(o=0;o<=n;++o){var x=o/n*i*Math.PI*2;for(C(x,i,a,e,f),C(.01+x,i,a,e,m),v.subVectors(m,f),y.addVectors(m,f),g.crossVectors(v,y),y.crossVectors(g,v),g.normalize(),y.normalize(),s=0;s<=r;++s){var _=s/r*Math.PI*2,b=-t*Math.cos(_),w=t*Math.sin(_);p.x=f.x+(b*y.x+w*g.x),p.y=f.y+(b*y.y+w*g.y),p.z=f.z+(b*y.z+w*g.z),c.push(p.x,p.y,p.z),d.subVectors(p,f).normalize(),u.push(d.x,d.y,d.z),h.push(o/n),h.push(s/r)}}for(s=1;s<=n;s++)for(o=1;o<=r;o++){var M=(r+1)*(s-1)+(o-1),S=(r+1)*s+(o-1),T=(r+1)*s+o,E=(r+1)*(s-1)+o;l.push(M,S,E),l.push(S,T,E)}function C(e,t,n,r,i){var a=Math.cos(e),o=Math.sin(e),s=n/t*e,l=Math.cos(s);i.x=r*(2+l)*.5*a,i.y=r*(2+l)*o*.5,i.z=r*Math.sin(s)*.5}this.setIndex(l),this.setAttribute("position",new Er(c,3)),this.setAttribute("normal",new Er(u,3)),this.setAttribute("uv",new Er(h,2))}function Os(e,t,n,r,i){li.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},this.fromBufferGeometry(new Rs(e,t,n,r,i)),this.mergeVertices()}function Rs(e,t,n,r,i){kr.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},e=e||1,t=t||.4,n=Math.floor(n)||8,r=Math.floor(r)||6,i=i||2*Math.PI;var a,o,s=[],l=[],c=[],u=[],h=new Wt,p=new Wt,d=new Wt;for(a=0;a<=n;a++)for(o=0;o<=r;o++){var f=o/r*i,m=a/n*Math.PI*2;p.x=(e+t*Math.cos(m))*Math.cos(f),p.y=(e+t*Math.cos(m))*Math.sin(f),p.z=t*Math.sin(m),l.push(p.x,p.y,p.z),h.x=e*Math.cos(f),h.y=e*Math.sin(f),d.subVectors(p,h).normalize(),c.push(d.x,d.y,d.z),u.push(o/r),u.push(a/n)}for(a=1;a<=n;a++)for(o=1;o<=r;o++){var g=(r+1)*a+o-1,v=(r+1)*(a-1)+o-1,y=(r+1)*(a-1)+o,x=(r+1)*a+o;s.push(g,v,x),s.push(v,y,x)}this.setIndex(s),this.setAttribute("position",new Er(l,3)),this.setAttribute("normal",new Er(c,3)),this.setAttribute("uv",new Er(u,2))}cs.prototype=Object.assign(Object.create(yn.prototype),{constructor:cs,isPoints:!0,raycast:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),ss.copy(n.boundingSphere),ss.applyMatrix4(r),ss.radius+=i,!1!==e.ray.intersectsSphere(ss)){as.getInverse(r),os.copy(e.ray).applyMatrix4(as);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a;if(n.isBufferGeometry){var s=n.index,l=n.attributes.position.array;if(null!==s)for(var c=s.array,u=0,h=c.length;u<h;u++){var p=c[u];ls.fromArray(l,3*p),us(ls,p,o,r,e,t,this)}else{u=0;for(var d=l.length/3;u<d;u++)ls.fromArray(l,3*u),us(ls,u,o,r,e,t,this)}}else{var f=n.vertices;for(u=0,d=f.length;u<d;u++)us(f[u],u,o,r,e,t,this)}}},updateMorphTargets:function(){var e,t,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,a=Object.keys(i);if(0<a.length){var o=i[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=r.morphTargets;void 0!==s&&0<s.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),hs.prototype=Object.assign(Object.create(Ft.prototype),{constructor:hs,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),((ps.prototype=Object.create(Ft.prototype)).constructor=ps).prototype.isCompressedTexture=!0,((ds.prototype=Object.create(Ft.prototype)).constructor=ds).prototype.isCanvasTexture=!0,((fs.prototype=Object.create(Ft.prototype)).constructor=fs).prototype.isDepthTexture=!0,(ms.prototype=Object.create(kr.prototype)).constructor=ms,(gs.prototype=Object.create(li.prototype)).constructor=gs,(vs.prototype=Object.create(kr.prototype)).constructor=vs,(ys.prototype=Object.create(li.prototype)).constructor=ys,(xs.prototype=Object.create(kr.prototype)).constructor=xs,(_s.prototype=Object.create(li.prototype)).constructor=_s,(bs.prototype=Object.create(xs.prototype)).constructor=bs,(ws.prototype=Object.create(li.prototype)).constructor=ws,(Ms.prototype=Object.create(xs.prototype)).constructor=Ms,(Ss.prototype=Object.create(li.prototype)).constructor=Ss,(Ts.prototype=Object.create(xs.prototype)).constructor=Ts,(Es.prototype=Object.create(li.prototype)).constructor=Es,(Cs.prototype=Object.create(xs.prototype)).constructor=Cs,(As.prototype=Object.create(li.prototype)).constructor=As,((Ls.prototype=Object.create(kr.prototype)).constructor=Ls).prototype.toJSON=function(){var e=kr.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e},(Ds.prototype=Object.create(li.prototype)).constructor=Ds,(Ps.prototype=Object.create(kr.prototype)).constructor=Ps,(Os.prototype=Object.create(li.prototype)).constructor=Os,(Rs.prototype=Object.create(kr.prototype)).constructor=Rs;function Is(e,t,n,r,i){var a,o;if(i===0<function(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}(e,t,n,r))for(a=t;a<n;a+=r)o=Zs(a,e[a],e[a+1],o);else for(a=n-r;t<=a;a-=r)o=Zs(a,e[a],e[a+1],o);return o&&Js(o,o.next)&&(Ks(o),o=o.next),o}function Bs(e,t){if(!e)return e;t=t||e;var n,r=e;do{if(n=!1,r.steiner||!Js(r,r.next)&&0!==qs(r.prev,r,r.next))r=r.next;else{if(Ks(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function Ns(e,t,n,r,i,a,o){if(e){!o&&a&&function(e,t,n,r){for(var i=e;null===i.z&&(i.z=js(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,(i=i.next)!==e;);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,a,o,s,l,c=1;do{for(n=e,a=e=null,o=0;n;){for(o++,r=n,t=s=0;t<c&&(s++,r=r.nextZ);t++);for(l=c;0<s||0<l&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(n=(i=n).nextZ,s--):(r=(i=r).nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,c*=2}while(1<o)}(i)}(e,r,i,a);for(var s,l,c=e;e.prev!==e.next;)if(s=e.prev,l=e.next,a?Fs(e,r,i,a):ks(e))t.push(s.i/n),t.push(e.i/n),t.push(l.i/n),Ks(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?Ns(e=Gs(e,t,n),t,n,r,i,a,2):2===o&&Vs(e,t,n,r,i,a):Ns(Bs(e),t,n,r,i,a,1);break}}}function ks(e){var t=e.prev,n=e,r=e.next;if(!(0<=qs(t,n,r))){for(var i=e.next.next;i!==e.prev;){if(Ws(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&0<=qs(i.prev,i,i.next))return;i=i.next}return 1}}function Fs(e,t,n,r){var i=e.prev,a=e,o=e.next;if(!(0<=qs(i,a,o))){for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,l=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=js(s,l,t,n,r),p=js(c,u,t,n,r),d=e.prevZ,f=e.nextZ;d&&d.z>=h&&f&&f.z<=p;){if(d!==e.prev&&d!==e.next&&Ws(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&0<=qs(d.prev,d,d.next))return;if(d=d.prevZ,f!==e.prev&&f!==e.next&&Ws(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&0<=qs(f.prev,f,f.next))return;f=f.nextZ}for(;d&&d.z>=h;){if(d!==e.prev&&d!==e.next&&Ws(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&0<=qs(d.prev,d,d.next))return;d=d.prevZ}for(;f&&f.z<=p;){if(f!==e.prev&&f!==e.next&&Ws(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&0<=qs(f.prev,f,f.next))return;f=f.nextZ}return 1}}function Gs(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!Js(i,a)&&Xs(i,r,r.next,a)&&Ys(i,a)&&Ys(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),Ks(r),Ks(r.next),r=e=a),r=r.next}while(r!==e);return r}function Vs(e,t,n,r,i,a){var o,s,l=e;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&(s=c,(o=l).next.i!==s.i&&o.prev.i!==s.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Xs(n,n.next,e,t))return 1;n=n.next}while(n!==e)}(o,s)&&Ys(o,s)&&Ys(s,o)&&function(e,t){for(var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),(n=n.next)!==e;);return r}(o,s))){var u=$s(l,c);return l=Bs(l,l.next),u=Bs(u,u.next),Ns(l,t,n,r,i,a),void Ns(u,t,n,r,i,a)}c=c.next}l=l.next}while(l!==e)}function zs(e,t){return e.x-t.x}function Us(e,t){if(t=function(e,t){var n,r=t,i=e.x,a=e.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&o<s){if((o=s)===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===o)return n.prev;var l,c=n,u=n.x,h=n.y,p=1/0;for(r=n.next;r!==c;)i>=r.x&&r.x>=u&&i!==r.x&&Ws(a<h?i:o,a,u,h,a<h?o:i,a,r.x,r.y)&&((l=Math.abs(a-r.y)/(i-r.x))<p||l===p&&r.x>n.x)&&Ys(r,e)&&(n=r,p=l),r=r.next;return n}(e,t)){var n=$s(t,e);Bs(n,n.next)}}function js(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Hs(e){for(var t=e,n=e;(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),(t=t.next)!==e;);return n}function Ws(e,t,n,r,i,a,o,s){return 0<=(i-o)*(t-s)-(e-o)*(a-s)&&0<=(e-o)*(r-s)-(n-o)*(t-s)&&0<=(n-o)*(a-s)-(i-o)*(r-s)}function qs(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Js(e,t){return e.x===t.x&&e.y===t.y}function Xs(e,t,n,r){return Js(e,n)&&Js(t,r)||Js(e,r)&&Js(n,t)||0<qs(e,t,n)!=0<qs(e,t,r)&&0<qs(n,r,e)!=0<qs(n,r,t)}function Ys(e,t){return qs(e.prev,e,e.next)<0?0<=qs(e,t,e.next)&&0<=qs(e,e.prev,t):qs(e,t,e.prev)<0||qs(e,e.next,t)<0}function $s(e,t){var n=new Qs(e.i,e.x,e.y),r=new Qs(t.i,t.x,t.y),i=e.next,a=t.prev;return(e.next=t).prev=e,(n.next=i).prev=n,(r.next=n).prev=r,(a.next=r).prev=a,r}function Zs(e,t,n,r){var i=new Qs(e,t,n);return r?(i.next=r.next,(i.prev=r).next.prev=i,r.next=i):(i.prev=i).next=i,i}function Ks(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Qs(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var el={area:function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n},isClockWise:function(e){return el.area(e)<0},triangulateShape:function(e,t){var n=[],r=[],i=[];tl(e),nl(n,e);var a=e.length;t.forEach(tl);for(var o=0;o<t.length;o++)r.push(a),a+=t[o].length,nl(n,t[o]);var s=function(e,t,n){n=n||2;var r,i,a,o,s,l,c,u=t&&t.length,h=u?t[0]*n:e.length,p=Is(e,0,h,n,!0),d=[];if(!p||p.next===p.prev)return d;if(u&&(p=function(e,t,n,r){var i,a,o,s=[];for(i=0,a=t.length;i<a;i++)(o=Is(e,t[i]*r,i<a-1?t[i+1]*r:e.length,r,!1))===o.next&&(o.steiner=!0),s.push(Hs(o));for(s.sort(zs),i=0;i<s.length;i++)Us(s[i],n),n=Bs(n,n.next);return n}(e,t,p,n)),e.length>80*n){r=a=e[0],i=o=e[1];for(var f=n;f<h;f+=n)(s=e[f])<r&&(r=s),(l=e[f+1])<i&&(i=l),a<s&&(a=s),o<l&&(o=l);c=0!==(c=Math.max(a-r,o-i))?1/c:0}return Ns(p,d,n,r,i,c),d}(n,r);for(o=0;o<s.length;o+=3)i.push(s.slice(o,o+3));return i}};function tl(e){var t=e.length;2<t&&e[t-1].equals(e[0])&&e.pop()}function nl(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}function rl(e,t){li.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new il(e,t)),this.mergeVertices()}function il(e,t){kr.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:e,options:t};for(var n=this,r=[],i=[],a=0,o=(e=Array.isArray(e)?e:[e]).length;a<o;a++)s(e[a]);function s(e){var a=[],o=void 0!==t.curveSegments?t.curveSegments:12,s=void 0!==t.steps?t.steps:1,l=void 0!==t.depth?t.depth:100,c=void 0===t.bevelEnabled||t.bevelEnabled,u=void 0!==t.bevelThickness?t.bevelThickness:6,h=void 0!==t.bevelSize?t.bevelSize:u-2,p=void 0!==t.bevelOffset?t.bevelOffset:0,d=void 0!==t.bevelSegments?t.bevelSegments:3,f=t.extrudePath,m=void 0!==t.UVGenerator?t.UVGenerator:al;void 0!==t.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),l=t.amount);var g,v,y,x,_,b,w,M,S=!1;f&&(g=f.getSpacedPoints(s),c=!(S=!0),v=f.computeFrenetFrames(s,!1),y=new Wt,x=new Wt,_=new Wt),c||(p=h=u=d=0);var T=e.extractPoints(o),E=T.shape,C=T.holes;if(!el.isClockWise(E))for(E=E.reverse(),w=0,M=C.length;w<M;w++)b=C[w],el.isClockWise(b)&&(C[w]=b.reverse());var A=el.triangulateShape(E,C),L=E;for(w=0,M=C.length;w<M;w++)b=C[w],E=E.concat(b);function D(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}var P,O,R,I,B,N,k=E.length,F=A.length;function G(e,t,n){var r,i,a,o=e.x-t.x,s=e.y-t.y,l=n.x-e.x,c=n.y-e.y,u=o*o+s*s,h=o*c-s*l;if(Math.abs(h)>Number.EPSILON){var p=Math.sqrt(u),d=Math.sqrt(l*l+c*c),f=t.x-s/p,m=t.y+o/p,g=((n.x-c/d-f)*c-(n.y+l/d-m)*l)/(o*c-s*l),v=(r=f+o*g-e.x)*r+(i=m+s*g-e.y)*i;if(v<=2)return new It(r,i);a=Math.sqrt(v/2)}else{var y=!1;o>Number.EPSILON?l>Number.EPSILON&&(y=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(c)&&(y=!0),a=y?(r=-s,i=o,Math.sqrt(u)):(r=o,i=s,Math.sqrt(u/2))}return new It(r/a,i/a)}for(var V=[],z=0,U=L.length,j=U-1,H=z+1;z<U;z++,j++,H++)j===U&&(j=0),H===U&&(H=0),V[z]=G(L[z],L[j],L[H]);var W,q,J=[],X=V.concat();for(w=0,M=C.length;w<M;w++){for(b=C[w],W=[],z=0,j=(U=b.length)-1,H=z+1;z<U;z++,j++,H++)j===U&&(j=0),H===U&&(H=0),W[z]=G(b[z],b[j],b[H]);J.push(W),X=X.concat(W)}for(P=0;P<d;P++){for(R=P/d,I=u*Math.cos(R*Math.PI/2),O=h*Math.sin(R*Math.PI/2)+p,z=0,U=L.length;z<U;z++)$((B=D(L[z],V[z],O)).x,B.y,-I);for(w=0,M=C.length;w<M;w++)for(b=C[w],W=J[w],z=0,U=b.length;z<U;z++)$((B=D(b[z],W[z],O)).x,B.y,-I)}for(O=h+p,z=0;z<k;z++)B=c?D(E[z],X[z],O):E[z],S?(x.copy(v.normals[0]).multiplyScalar(B.x),y.copy(v.binormals[0]).multiplyScalar(B.y),_.copy(g[0]).add(x).add(y),$(_.x,_.y,_.z)):$(B.x,B.y,0);for(q=1;q<=s;q++)for(z=0;z<k;z++)B=c?D(E[z],X[z],O):E[z],S?(x.copy(v.normals[q]).multiplyScalar(B.x),y.copy(v.binormals[q]).multiplyScalar(B.y),_.copy(g[q]).add(x).add(y),$(_.x,_.y,_.z)):$(B.x,B.y,l/s*q);for(P=d-1;0<=P;P--){for(R=P/d,I=u*Math.cos(R*Math.PI/2),O=h*Math.sin(R*Math.PI/2)+p,z=0,U=L.length;z<U;z++)$((B=D(L[z],V[z],O)).x,B.y,l+I);for(w=0,M=C.length;w<M;w++)for(b=C[w],W=J[w],z=0,U=b.length;z<U;z++)B=D(b[z],W[z],O),S?$(B.x,B.y+g[s-1].y,g[s-1].x+I):$(B.x,B.y,l+I)}function Y(e,t){var n,r;for(z=e.length;0<=--z;){(r=(n=z)-1)<0&&(r=e.length-1);var i=0,a=s+2*d;for(i=0;i<a;i++){var o=k*i,l=k*(i+1);K(t+n+o,t+r+o,t+r+l,t+n+l)}}}function $(e,t,n){a.push(e),a.push(t),a.push(n)}function Z(e,t,i){Q(e),Q(t),Q(i);var a=r.length/3,o=m.generateTopUV(n,r,a-3,a-2,a-1);ee(o[0]),ee(o[1]),ee(o[2])}function K(e,t,i,a){Q(e),Q(t),Q(a),Q(t),Q(i),Q(a);var o=r.length/3,s=m.generateSideWallUV(n,r,o-6,o-3,o-2,o-1);ee(s[0]),ee(s[1]),ee(s[3]),ee(s[1]),ee(s[2]),ee(s[3])}function Q(e){r.push(a[3*e+0]),r.push(a[3*e+1]),r.push(a[3*e+2])}function ee(e){i.push(e.x),i.push(e.y)}!function(){var e=r.length/3;if(c){var t=0,i=k*t;for(z=0;z<F;z++)Z((N=A[z])[2]+i,N[1]+i,N[0]+i);for(i=k*(t=s+2*d),z=0;z<F;z++)Z((N=A[z])[0]+i,N[1]+i,N[2]+i)}else{for(z=0;z<F;z++)Z((N=A[z])[2],N[1],N[0]);for(z=0;z<F;z++)Z((N=A[z])[0]+k*s,N[1]+k*s,N[2]+k*s)}n.addGroup(e,r.length/3-e,0)}(),function(){var e=r.length/3,t=0;for(Y(L,t),t+=L.length,w=0,M=C.length;w<M;w++)Y(b=C[w],t),t+=b.length;n.addGroup(e,r.length/3-e,1)}()}this.setAttribute("position",new Er(r,3)),this.setAttribute("uv",new Er(i,2)),this.computeVertexNormals()}((rl.prototype=Object.create(li.prototype)).constructor=rl).prototype.toJSON=function(){var e=li.prototype.toJSON.call(this);return ol(this.parameters.shapes,this.parameters.options,e)},((il.prototype=Object.create(kr.prototype)).constructor=il).prototype.toJSON=function(){var e=kr.prototype.toJSON.call(this);return ol(this.parameters.shapes,this.parameters.options,e)};var al={generateTopUV:function(e,t,n,r,i){var a=t[3*n],o=t[3*n+1],s=t[3*r],l=t[3*r+1],c=t[3*i],u=t[3*i+1];return[new It(a,o),new It(s,l),new It(c,u)]},generateSideWallUV:function(e,t,n,r,i,a){var o=t[3*n],s=t[3*n+1],l=t[3*n+2],c=t[3*r],u=t[3*r+1],h=t[3*r+2],p=t[3*i],d=t[3*i+1],f=t[3*i+2],m=t[3*a],g=t[3*a+1],v=t[3*a+2];return Math.abs(s-u)<.01?[new It(o,1-l),new It(c,1-h),new It(p,1-f),new It(m,1-v)]:[new It(s,1-l),new It(u,1-h),new It(d,1-f),new It(g,1-v)]}};function ol(e,t,n){if(n.shapes=[],Array.isArray(e))for(var r=0,i=e.length;r<i;r++){var a=e[r];n.shapes.push(a.uuid)}else n.shapes.push(e.uuid);return void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON()),n}function sl(e,t){li.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new ll(e,t)),this.mergeVertices()}function ll(e,t){var n=(t=t||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new li;var r=n.generateShapes(e,t.size);t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),il.call(this,r,t),this.type="TextBufferGeometry"}function cl(e,t,n,r,i,a,o){li.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new ul(e,t,n,r,i,a,o)),this.mergeVertices()}function ul(e,t,n,r,i,a,o){kr.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},e=e||1,t=Math.max(3,Math.floor(t)||8),n=Math.max(2,Math.floor(n)||6),r=void 0!==r?r:0,i=void 0!==i?i:2*Math.PI,a=void 0!==a?a:0,o=void 0!==o?o:Math.PI;var s,l,c=Math.min(a+o,Math.PI),u=0,h=[],p=new Wt,d=new Wt,f=[],m=[],g=[],v=[];for(l=0;l<=n;l++){var y=[],x=l/n,_=0;for(0==l&&0==a?_=.5/t:l==n&&c==Math.PI&&(_=-.5/t),s=0;s<=t;s++){var b=s/t;p.x=-e*Math.cos(r+b*i)*Math.sin(a+x*o),p.y=e*Math.cos(a+x*o),p.z=e*Math.sin(r+b*i)*Math.sin(a+x*o),m.push(p.x,p.y,p.z),d.copy(p).normalize(),g.push(d.x,d.y,d.z),v.push(b+_,1-x),y.push(u++)}h.push(y)}for(l=0;l<n;l++)for(s=0;s<t;s++){var w=h[l][s+1],M=h[l][s],S=h[l+1][s],T=h[l+1][s+1];(0!==l||0<a)&&f.push(w,M,T),(l!==n-1||c<Math.PI)&&f.push(M,S,T)}this.setIndex(f),this.setAttribute("position",new Er(m,3)),this.setAttribute("normal",new Er(g,3)),this.setAttribute("uv",new Er(v,2))}function hl(e,t,n,r,i,a){li.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},this.fromBufferGeometry(new pl(e,t,n,r,i,a)),this.mergeVertices()}function pl(e,t,n,r,i,a){kr.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},e=e||.5,t=t||1,i=void 0!==i?i:0,a=void 0!==a?a:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var o,s,l,c=[],u=[],h=[],p=[],d=e,f=(t-e)/(r=void 0!==r?Math.max(1,r):1),m=new Wt,g=new It;for(s=0;s<=r;s++){for(l=0;l<=n;l++)o=i+l/n*a,m.x=d*Math.cos(o),m.y=d*Math.sin(o),u.push(m.x,m.y,m.z),h.push(0,0,1),g.x=(m.x/t+1)/2,g.y=(m.y/t+1)/2,p.push(g.x,g.y);d+=f}for(s=0;s<r;s++){var v=s*(n+1);for(l=0;l<n;l++){var y=o=l+v,x=o+n+1,_=o+n+2,b=o+1;c.push(y,x,b),c.push(x,_,b)}}this.setIndex(c),this.setAttribute("position",new Er(u,3)),this.setAttribute("normal",new Er(h,3)),this.setAttribute("uv",new Er(p,2))}function dl(e,t,n,r){li.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},this.fromBufferGeometry(new fl(e,t,n,r)),this.mergeVertices()}function fl(e,t,n,r){kr.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t)||12,n=n||0,r=r||2*Math.PI,r=Rt.clamp(r,0,2*Math.PI);var i,a,o,s=[],l=[],c=[],u=1/t,h=new Wt,p=new It;for(a=0;a<=t;a++){var d=n+a*u*r,f=Math.sin(d),m=Math.cos(d);for(o=0;o<=e.length-1;o++)h.x=e[o].x*f,h.y=e[o].y,h.z=e[o].x*m,l.push(h.x,h.y,h.z),p.x=a/t,p.y=o/(e.length-1),c.push(p.x,p.y)}for(a=0;a<t;a++)for(o=0;o<e.length-1;o++){var g=i=o+a*e.length,v=i+e.length,y=i+e.length+1,x=i+1;s.push(g,v,x),s.push(v,y,x)}if(this.setIndex(s),this.setAttribute("position",new Er(l,3)),this.setAttribute("uv",new Er(c,2)),this.computeVertexNormals(),r===2*Math.PI){var _=this.attributes.normal.array,b=new Wt,w=new Wt,M=new Wt;for(i=t*e.length*3,o=a=0;a<e.length;a++,o+=3)b.x=_[o+0],b.y=_[o+1],b.z=_[o+2],w.x=_[i+o+0],w.y=_[i+o+1],w.z=_[i+o+2],M.addVectors(b,w).normalize(),_[o+0]=_[i+o+0]=M.x,_[o+1]=_[i+o+1]=M.y,_[o+2]=_[i+o+2]=M.z}}function ml(e,t){li.call(this),this.type="ShapeGeometry","object"==typeof t&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new gl(e,t)),this.mergeVertices()}function gl(e,t){kr.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:t},t=t||12;var n=[],r=[],i=[],a=[],o=0,s=0;if(!1===Array.isArray(e))c(e);else for(var l=0;l<e.length;l++)c(e[l]),this.addGroup(o,s,l),o+=s,s=0;function c(e){var o,l,c,u=r.length/3,h=e.extractPoints(t),p=h.shape,d=h.holes;for(!1===el.isClockWise(p)&&(p=p.reverse()),o=0,l=d.length;o<l;o++)c=d[o],!0===el.isClockWise(c)&&(d[o]=c.reverse());var f=el.triangulateShape(p,d);for(o=0,l=d.length;o<l;o++)c=d[o],p=p.concat(c);for(o=0,l=p.length;o<l;o++){var m=p[o];r.push(m.x,m.y,0),i.push(0,0,1),a.push(m.x,m.y)}for(o=0,l=f.length;o<l;o++){var g=f[o],v=g[0]+u,y=g[1]+u,x=g[2]+u;n.push(v,y,x),s+=3}}this.setIndex(n),this.setAttribute("position",new Er(r,3)),this.setAttribute("normal",new Er(i,3)),this.setAttribute("uv",new Er(a,2))}function vl(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,r=e.length;n<r;n++){var i=e[n];t.shapes.push(i.uuid)}else t.shapes.push(e.uuid);return t}function yl(e,t){kr.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=void 0!==t?t:1;var n,r,i,a,o=[],s=Math.cos(Rt.DEG2RAD*t),l=[0,0],c={},u=["a","b","c"];e.isBufferGeometry?(a=new li).fromBufferGeometry(e):a=e.clone(),a.mergeVertices(),a.computeFaceNormals();for(var h=a.vertices,p=a.faces,d=0,f=p.length;d<f;d++)for(var m=p[d],g=0;g<3;g++)n=m[u[g]],r=m[u[(g+1)%3]],l[0]=Math.min(n,r),l[1]=Math.max(n,r),void 0===c[i=l[0]+","+l[1]]?c[i]={index1:l[0],index2:l[1],face1:d,face2:void 0}:c[i].face2=d;for(i in c){var v=c[i];if(void 0===v.face2||p[v.face1].normal.dot(p[v.face2].normal)<=s){var y=h[v.index1];o.push(y.x,y.y,y.z),y=h[v.index2],o.push(y.x,y.y,y.z)}}this.setAttribute("position",new Er(o,3))}function xl(e,t,n,r,i,a,o,s){li.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new _l(e,t,n,r,i,a,o,s)),this.mergeVertices()}function _l(e,t,n,r,i,a,o,s){kr.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s};var l=this;e=void 0!==e?e:1,t=void 0!==t?t:1,n=n||1,r=Math.floor(r)||8,i=Math.floor(i)||1,a=void 0!==a&&a,o=void 0!==o?o:0,s=void 0!==s?s:2*Math.PI;var c=[],u=[],h=[],p=[],d=0,f=[],m=n/2,g=0;function v(n){var i,a,f,v=new It,y=new Wt,x=0,_=!0===n?e:t,b=!0===n?1:-1;for(a=d,i=1;i<=r;i++)u.push(0,m*b,0),h.push(0,b,0),p.push(.5,.5),d++;for(f=d,i=0;i<=r;i++){var w=i/r*s+o,M=Math.cos(w),S=Math.sin(w);y.x=_*S,y.y=m*b,y.z=_*M,u.push(y.x,y.y,y.z),h.push(0,b,0),v.x=.5*M+.5,v.y=.5*S*b+.5,p.push(v.x,v.y),d++}for(i=0;i<r;i++){var T=a+i,E=f+i;!0===n?c.push(E,E+1,T):c.push(E+1,E,T),x+=3}l.addGroup(g,x,!0===n?1:2),g+=x}!function(){var a,v,y=new Wt,x=new Wt,_=0,b=(t-e)/n;for(v=0;v<=i;v++){var w=[],M=v/i,S=M*(t-e)+e;for(a=0;a<=r;a++){var T=a/r,E=T*s+o,C=Math.sin(E),A=Math.cos(E);x.x=S*C,x.y=-M*n+m,x.z=S*A,u.push(x.x,x.y,x.z),y.set(C,b,A).normalize(),h.push(y.x,y.y,y.z),p.push(T,1-M),w.push(d++)}f.push(w)}for(a=0;a<r;a++)for(v=0;v<i;v++){var L=f[v][a],D=f[v+1][a],P=f[v+1][a+1],O=f[v][a+1];c.push(L,D,O),c.push(D,P,O),_+=6}l.addGroup(g,_,0),g+=_}(),!1===a&&(0<e&&v(!0),0<t&&v(!1)),this.setIndex(c),this.setAttribute("position",new Er(u,3)),this.setAttribute("normal",new Er(h,3)),this.setAttribute("uv",new Er(p,2))}function bl(e,t,n,r,i,a,o){xl.call(this,0,e,t,n,r,i,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}function wl(e,t,n,r,i,a,o){_l.call(this,0,e,t,n,r,i,a,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}function Ml(e,t,n,r){li.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new Sl(e,t,n,r)),this.mergeVertices()}function Sl(e,t,n,r){kr.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},e=e||1,t=void 0!==t?Math.max(3,t):8,n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var i,a,o=[],s=[],l=[],c=[],u=new Wt,h=new It;for(s.push(0,0,0),l.push(0,0,1),c.push(.5,.5),a=0,i=3;a<=t;a++,i+=3){var p=n+a/t*r;u.x=e*Math.cos(p),u.y=e*Math.sin(p),s.push(u.x,u.y,u.z),l.push(0,0,1),h.x=(s[i]/e+1)/2,h.y=(s[i+1]/e+1)/2,c.push(h.x,h.y)}for(i=1;i<=t;i++)o.push(i,i+1,0);this.setIndex(o),this.setAttribute("position",new Er(s,3)),this.setAttribute("normal",new Er(l,3)),this.setAttribute("uv",new Er(c,2))}(sl.prototype=Object.create(li.prototype)).constructor=sl,(ll.prototype=Object.create(il.prototype)).constructor=ll,(cl.prototype=Object.create(li.prototype)).constructor=cl,(ul.prototype=Object.create(kr.prototype)).constructor=ul,(hl.prototype=Object.create(li.prototype)).constructor=hl,(pl.prototype=Object.create(kr.prototype)).constructor=pl,(dl.prototype=Object.create(li.prototype)).constructor=dl,(fl.prototype=Object.create(kr.prototype)).constructor=fl,((ml.prototype=Object.create(li.prototype)).constructor=ml).prototype.toJSON=function(){var e=li.prototype.toJSON.call(this);return vl(this.parameters.shapes,e)},((gl.prototype=Object.create(kr.prototype)).constructor=gl).prototype.toJSON=function(){var e=kr.prototype.toJSON.call(this);return vl(this.parameters.shapes,e)},(yl.prototype=Object.create(kr.prototype)).constructor=yl,(xl.prototype=Object.create(li.prototype)).constructor=xl,(_l.prototype=Object.create(kr.prototype)).constructor=_l,(bl.prototype=Object.create(xl.prototype)).constructor=bl,(wl.prototype=Object.create(_l.prototype)).constructor=wl,(Ml.prototype=Object.create(li.prototype)).constructor=Ml,(Sl.prototype=Object.create(kr.prototype)).constructor=Sl;var Tl=Object.freeze({__proto__:null,WireframeGeometry:ms,ParametricGeometry:gs,ParametricBufferGeometry:vs,TetrahedronGeometry:_s,TetrahedronBufferGeometry:bs,OctahedronGeometry:ws,OctahedronBufferGeometry:Ms,IcosahedronGeometry:Ss,IcosahedronBufferGeometry:Ts,DodecahedronGeometry:Es,DodecahedronBufferGeometry:Cs,PolyhedronGeometry:ys,PolyhedronBufferGeometry:xs,TubeGeometry:As,TubeBufferGeometry:Ls,TorusKnotGeometry:Ds,TorusKnotBufferGeometry:Ps,TorusGeometry:Os,TorusBufferGeometry:Rs,TextGeometry:sl,TextBufferGeometry:ll,SphereGeometry:cl,SphereBufferGeometry:ul,RingGeometry:hl,RingBufferGeometry:pl,PlaneGeometry:Ci,PlaneBufferGeometry:Ai,LatheGeometry:dl,LatheBufferGeometry:fl,ShapeGeometry:ml,ShapeBufferGeometry:gl,ExtrudeGeometry:rl,ExtrudeBufferGeometry:il,EdgesGeometry:yl,ConeGeometry:bl,ConeBufferGeometry:wl,CylinderGeometry:xl,CylinderBufferGeometry:_l,CircleGeometry:Ml,CircleBufferGeometry:Sl,BoxGeometry:ci,BoxBufferGeometry:ui});function El(e){mr.call(this),this.type="ShadowMaterial",this.color=new cr(0),this.transparent=!0,this.setValues(e)}function Cl(e){gi.call(this,e),this.type="RawShaderMaterial"}function Al(e){mr.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new cr(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new cr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Mt,this.normalScale=new It(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Ll(e){Al.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearcoat=0,this.clearcoatRoughness=0,this.sheen=null,this.clearcoatNormalScale=new It(1,1),this.clearcoatNormalMap=null,this.transparency=0,this.setValues(e)}function Dl(e){mr.call(this),this.type="MeshPhongMaterial",this.color=new cr(16777215),this.specular=new cr(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new cr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Mt,this.normalScale=new It(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=U,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Pl(e){mr.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new cr(16777215),this.specular=new cr(1118481),this.shininess=30,this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new cr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Mt,this.normalScale=new It(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Ol(e){mr.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Mt,this.normalScale=new It(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Rl(e){mr.call(this),this.type="MeshLambertMaterial",this.color=new cr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new cr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=U,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Il(e){mr.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new cr(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Mt,this.normalScale=new It(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Bl(e){Jo.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}((El.prototype=Object.create(mr.prototype)).constructor=El).prototype.isShadowMaterial=!0,El.prototype.copy=function(e){return mr.prototype.copy.call(this,e),this.color.copy(e.color),this},((Cl.prototype=Object.create(gi.prototype)).constructor=Cl).prototype.isRawShaderMaterial=!0,((Al.prototype=Object.create(mr.prototype)).constructor=Al).prototype.isMeshStandardMaterial=!0,Al.prototype.copy=function(e){return mr.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},((Ll.prototype=Object.create(Al.prototype)).constructor=Ll).prototype.isMeshPhysicalMaterial=!0,Ll.prototype.copy=function(e){return Al.prototype.copy.call(this,e),this.defines={STANDARD:"",PHYSICAL:""},this.reflectivity=e.reflectivity,this.clearcoat=e.clearcoat,this.clearcoatRoughness=e.clearcoatRoughness,e.sheen?this.sheen=(this.sheen||new cr).copy(e.sheen):this.sheen=null,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.transparency=e.transparency,this},((Dl.prototype=Object.create(mr.prototype)).constructor=Dl).prototype.isMeshPhongMaterial=!0,Dl.prototype.copy=function(e){return mr.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},((Pl.prototype=Object.create(mr.prototype)).constructor=Pl).prototype.isMeshToonMaterial=!0,Pl.prototype.copy=function(e){return mr.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},((Ol.prototype=Object.create(mr.prototype)).constructor=Ol).prototype.isMeshNormalMaterial=!0,Ol.prototype.copy=function(e){return mr.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},((Rl.prototype=Object.create(mr.prototype)).constructor=Rl).prototype.isMeshLambertMaterial=!0,Rl.prototype.copy=function(e){return mr.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},((Il.prototype=Object.create(mr.prototype)).constructor=Il).prototype.isMeshMatcapMaterial=!0,Il.prototype.copy=function(e){return mr.prototype.copy.call(this,e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},((Bl.prototype=Object.create(Jo.prototype)).constructor=Bl).prototype.isLineDashedMaterial=!0,Bl.prototype.copy=function(e){return Jo.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var Nl=Object.freeze({__proto__:null,ShadowMaterial:El,SpriteMaterial:xo,RawShaderMaterial:Cl,ShaderMaterial:gi,PointsMaterial:is,MeshPhysicalMaterial:Ll,MeshStandardMaterial:Al,MeshPhongMaterial:Dl,MeshToonMaterial:Pl,MeshNormalMaterial:Ol,MeshLambertMaterial:Rl,MeshDepthMaterial:eo,MeshDistanceMaterial:to,MeshBasicMaterial:gr,MeshMatcapMaterial:Il,LineDashedMaterial:Bl,LineBasicMaterial:Jo,Material:mr}),kl={arraySlice:function(e,t,n){return kl.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){for(var t=e.length,n=new Array(t),r=0;r!==t;++r)n[r]=r;return n.sort(function(t,n){return e[t]-e[n]}),n},sortedArray:function(e,t,n){for(var r=e.length,i=new e.constructor(r),a=0,o=0;o!==r;++a)for(var s=n[a]*t,l=0;l!==t;++l)i[o++]=e[s+l];return i},flattenJSON:function(e,t,n,r){for(var i=1,a=e[0];void 0!==a&&void 0===a[r];)a=e[i++];if(void 0!==a){var o=a[r];if(void 0!==o)if(Array.isArray(o))for(;void 0!==(o=a[r])&&(t.push(a.time),n.push.apply(n,o)),void 0!==(a=e[i++]););else if(void 0!==o.toArray)for(;void 0!==(o=a[r])&&(t.push(a.time),o.toArray(n,n.length)),void 0!==(a=e[i++]););else for(;void 0!==(o=a[r])&&(t.push(a.time),n.push(o)),void 0!==(a=e[i++]););}},subclip:function(e,t,n,r,i){i=i||30;var a=e.clone();a.name=t;for(var o=[],s=0;s<a.tracks.length;++s){for(var l=a.tracks[s],c=l.getValueSize(),u=[],h=[],p=0;p<l.times.length;++p){var d=l.times[p]*i;if(!(d<n||r<=d)){u.push(l.times[p]);for(var f=0;f<c;++f)h.push(l.values[p*c+f])}}0!==u.length&&(l.times=kl.convertArray(u,l.times.constructor),l.values=kl.convertArray(h,l.values.constructor),o.push(l))}a.tracks=o;var m=1/0;for(s=0;s<a.tracks.length;++s)m>a.tracks[s].times[0]&&(m=a.tracks[s].times[0]);for(s=0;s<a.tracks.length;++s)a.tracks[s].shift(-1*m);return a.resetDuration(),a}};function Fl(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n}function Gl(e,t,n,r){Fl.call(this,e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function Vl(e,t,n,r){Fl.call(this,e,t,n,r)}function zl(e,t,n,r){Fl.call(this,e,t,n,r)}function Ul(e,t,n,r){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=kl.convertArray(t,this.TimeBufferType),this.values=kl.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}function jl(e,t,n){Ul.call(this,e,t,n)}function Hl(e,t,n,r){Ul.call(this,e,t,n,r)}function Wl(e,t,n,r){Ul.call(this,e,t,n,r)}function ql(e,t,n,r){Fl.call(this,e,t,n,r)}function Jl(e,t,n,r){Ul.call(this,e,t,n,r)}function Xl(e,t,n,r){Ul.call(this,e,t,n,r)}function Yl(e,t,n,r){Ul.call(this,e,t,n,r)}function $l(e,t,n){this.name=e,this.tracks=n,this.duration=void 0!==t?t:-1,this.uuid=Rt.generateUUID(),this.duration<0&&this.resetDuration()}function Zl(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Wl;case"vector":case"vector2":case"vector3":case"vector4":return Yl;case"color":return Hl;case"quaternion":return Jl;case"bool":case"boolean":return jl;case"string":return Xl}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){var n=[],r=[];kl.flattenJSON(e.keys,n,r,"value"),e.times=n,e.values=r}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}Object.assign(Fl.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{var a;n:{r:if(!(e<r)){for(var o=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,i)}if(n===o)break;if(i=r,e<(r=t[++n]))break t}a=t.length;break n}if(i<=e)break e;var s=t[1];for(e<s&&(n=2,i=s),o=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(n===o)break;if(r=i,(i=t[--n-1])<=e)break t}a=n,n=0}for(;n<a;){var l=n+a>>>1;e<t[l]?a=l:n=1+l}if(r=t[n],void 0===(i=t[n-1]))return this._cachedIndex=0,this.beforeStart_(0,e,r);if(void 0===r)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,i,e)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r,a=0;a!==r;++a)t[a]=n[i+a];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(Fl.prototype,{beforeStart_:Fl.prototype.copySampleValue_,afterEnd_:Fl.prototype.copySampleValue_}),Gl.prototype=Object.assign(Object.create(Fl.prototype),{constructor:Gl,DefaultSettings_:{endingStart:ut,endingEnd:ut},intervalChanged_:function(e,t,n){var r=this.parameterPositions,i=e-2,a=e+1,o=r[i],s=r[a];if(void 0===o)switch(this.getSettings_().endingStart){case ht:i=e,o=2*t-n;break;case pt:o=t+r[i=r.length-2]-r[i+1];break;default:i=e,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case ht:a=e,s=2*n-t;break;case pt:s=n+r[a=1]-r[0];break;default:a=e-1,s=t}var l=.5*(n-t),c=this.valueSize;this._weightPrev=l/(t-o),this._weightNext=l/(s-n),this._offsetPrev=i*c,this._offsetNext=a*c},interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,c=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,p=this._weightNext,d=(n-t)/(r-t),f=d*d,m=f*d,g=-h*m+2*h*f-h*d,v=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*d+1,y=(-1-p)*m+(1.5+p)*f+.5*d,x=p*m-p*f,_=0;_!==o;++_)i[_]=g*a[c+_]+v*a[l+_]+y*a[s+_]+x*a[u+_];return i}}),Vl.prototype=Object.assign(Object.create(Fl.prototype),{constructor:Vl,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,c=(n-t)/(r-t),u=1-c,h=0;h!==o;++h)i[h]=a[l+h]*u+a[s+h]*c;return i}}),zl.prototype=Object.assign(Object.create(Fl.prototype),{constructor:zl,interpolate_:function(e){return this.copySampleValue_(e-1)}}),Object.assign(Ul,{toJSON:function(e){var t,n=e.constructor;if(void 0!==n.toJSON)t=n.toJSON(e);else{t={name:e.name,times:kl.convertArray(e.times,Array),values:kl.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t}}),Object.assign(Ul.prototype,{constructor:Ul,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:ct,InterpolantFactoryMethodDiscrete:function(e){return new zl(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new Vl(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new Gl(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case lt:t=this.InterpolantFactoryMethodDiscrete;break;case ct:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(void 0!==t)return this.createInterpolant=t,this;var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return lt;case this.InterpolantFactoryMethodLinear:return ct;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]*=e;return this},trim:function(e,t){for(var n=this.times,r=n.length,i=0,a=r-1;i!==r&&n[i]<e;)++i;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==i||a!==r){a<=i&&(i=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=kl.arraySlice(n,i,a),this.values=kl.arraySlice(this.values,i*o,a*o)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var a=null,o=0;o!==i;o++){var s=n[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),e=!1;break}if(null!==a&&s<a){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),e=!1;break}a=s}if(void 0!==r&&kl.isTypedArray(r)){o=0;for(var l=r.length;o!==l;++o){var c=r[o];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,c),e=!1;break}}}return e},optimize:function(){for(var e=kl.arraySlice(this.times),t=kl.arraySlice(this.values),n=this.getValueSize(),r=2302===this.getInterpolation(),i=1,a=e.length-1,o=1;o<a;++o){var s=!1,l=e[o];if(l!==e[o+1]&&(1!==o||l!==l[0]))if(r)s=!0;else for(var c=o*n,u=c-n,h=c+n,p=0;p!==n;++p){var d=t[c+p];if(d!==t[u+p]||d!==t[h+p]){s=!0;break}}if(s){if(o!==i){e[i]=e[o];var f=o*n,m=i*n;for(p=0;p!==n;++p)t[m+p]=t[f+p]}++i}}if(0<a){for(e[i]=e[a],f=a*n,m=i*n,p=0;p!==n;++p)t[m+p]=t[f+p];++i}return i!==e.length?(this.times=kl.arraySlice(e,0,i),this.values=kl.arraySlice(t,0,i*n)):(this.times=e,this.values=t),this},clone:function(){var e=kl.arraySlice(this.times,0),t=kl.arraySlice(this.values,0),n=new this.constructor(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}),jl.prototype=Object.assign(Object.create(Ul.prototype),{constructor:jl,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:lt,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Hl.prototype=Object.assign(Object.create(Ul.prototype),{constructor:Hl,ValueTypeName:"color"}),Wl.prototype=Object.assign(Object.create(Ul.prototype),{constructor:Wl,ValueTypeName:"number"}),ql.prototype=Object.assign(Object.create(Fl.prototype),{constructor:ql,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=(n-t)/(r-t),c=s+o;s!==c;s+=4)Ut.slerpFlat(i,0,a,s-o,a,s,l);return i}}),Jl.prototype=Object.assign(Object.create(Ul.prototype),{constructor:Jl,ValueTypeName:"quaternion",DefaultInterpolation:ct,InterpolantFactoryMethodLinear:function(e){return new ql(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),Xl.prototype=Object.assign(Object.create(Ul.prototype),{constructor:Xl,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:lt,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Yl.prototype=Object.assign(Object.create(Ul.prototype),{constructor:Yl,ValueTypeName:"vector"}),Object.assign($l,{parse:function(e){for(var t=[],n=e.tracks,r=1/(e.fps||1),i=0,a=n.length;i!==a;++i)t.push(Zl(n[i]).scale(r));return new $l(e.name,e.duration,t)},toJSON:function(e){for(var t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid},i=0,a=n.length;i!==a;++i)t.push(Ul.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){for(var i=t.length,a=[],o=0;o<i;o++){var s=[],l=[];s.push((o+i-1)%i,o,(o+1)%i),l.push(0,1,0);var c=kl.getKeyframeOrder(s);s=kl.sortedArray(s,1,c),l=kl.sortedArray(l,1,c),r||0!==s[0]||(s.push(i),l.push(l[0])),a.push(new Wl(".morphTargetInfluences["+t[o].name+"]",s,l).scale(1/n))}return new $l(e,-1,a)},findByName:function(e,t){var n=e;Array.isArray(e)||(n=e.geometry&&e.geometry.animations||e.animations);for(var r=0;r<n.length;r++)if(n[r].name===t)return n[r];return null},CreateClipsFromMorphTargetSequences:function(e,t,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,a=0,o=e.length;a<o;a++){var s=e[a],l=s.name.match(i);if(l&&1<l.length){var c=r[h=l[1]];c||(r[h]=c=[]),c.push(s)}}var u=[];for(var h in r)u.push($l.CreateFromMorphTargetSequence(h,r[h],t,n));return u},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,r,i){if(0!==n.length){var a=[],o=[];kl.flattenJSON(n,a,o,r),0!==a.length&&i.push(new e(t,a,o))}},r=[],i=e.name||"default",a=e.length||-1,o=e.fps||30,s=e.hierarchy||[],l=0;l<s.length;l++){var c=s[l].keys;if(c&&0!==c.length)if(c[0].morphTargets){for(var u={},h=0;h<c.length;h++)if(c[h].morphTargets)for(var p=0;p<c[h].morphTargets.length;p++)u[c[h].morphTargets[p]]=-1;for(var d in u){var f=[],m=[];for(p=0;p!==c[h].morphTargets.length;++p){var g=c[h];f.push(g.time),m.push(g.morphTarget===d?1:0)}r.push(new Wl(".morphTargetInfluence["+d+"]",f,m))}a=u.length*(o||1)}else{var v=".bones["+t[l].name+"]";n(Yl,v+".position",c,"pos",r),n(Jl,v+".quaternion",c,"rot",r),n(Yl,v+".scale",c,"scl",r)}}return 0===r.length?null:new $l(i,a,r)}}),Object.assign($l.prototype,{resetDuration:function(){for(var e=0,t=0,n=this.tracks.length;t!==n;++t){var r=this.tracks[t];e=Math.max(e,r.times[r.times.length-1])}return this.duration=e,this},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},validate:function(){for(var e=!0,t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this},clone:function(){for(var e=[],t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new $l(this.name,this.duration,e)}});var Kl={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function Ql(e,t,n){var r=this,i=!1,a=0,o=0,s=void 0,l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===i&&void 0!==r.onStart&&r.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,void 0!==r.onProgress&&r.onProgress(e,a,o),a===o&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){var t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(var t=0,n=l.length;t<n;t+=2){var r=l[t],i=l[t+1];if(r.global&&(r.lastIndex=0),r.test(e))return i}return null}}var ec=new Ql;function tc(e){this.manager=void 0!==e?e:ec,this.crossOrigin="anonymous",this.path="",this.resourcePath=""}Object.assign(tc.prototype,{load:function(){},parse:function(){},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this},setResourcePath:function(e){return this.resourcePath=e,this}});var nc={};function rc(e){tc.call(this,e)}function ic(e){tc.call(this,e)}function ac(e){tc.call(this,e)}function oc(e){tc.call(this,e)}function sc(e){tc.call(this,e)}function lc(e){tc.call(this,e)}function cc(e){tc.call(this,e)}function uc(){this.type="Curve",this.arcLengthDivisions=200}function hc(e,t,n,r,i,a,o,s){uc.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=n||1,this.yRadius=r||1,this.aStartAngle=i||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function pc(e,t,n,r,i,a){hc.call(this,e,t,n,n,r,i,a),this.type="ArcCurve"}function dc(){var e=0,t=0,n=0,r=0;function i(i,a,o,s){n=-3*(e=i)+3*a-2*(t=o)-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){var l=(t-e)/a-(n-e)/(a+o)+(n-t)/o,c=(n-t)/o-(r-t)/(o+s)+(r-n)/s;i(t,n,l*=o,c*=o)},calc:function(i){var a=i*i;return e+t*i+n*a+r*(a*i)}}}rc.prototype=Object.assign(Object.create(tc.prototype),{constructor:rc,load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Kl.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0),a;if(void 0===nc[e]){var o=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(o){var s=o[1],l=!!o[2],c=o[3];c=decodeURIComponent(c),l&&(c=atob(c));try{var u,h=(this.responseType||"").toLowerCase();switch(h){case"arraybuffer":case"blob":for(var p=new Uint8Array(c.length),d=0;d<c.length;d++)p[d]=c.charCodeAt(d);u="blob"===h?new Blob([p.buffer],{type:s}):p.buffer;break;case"document":var f=new DOMParser;u=f.parseFromString(c,s);break;case"json":u=JSON.parse(c);break;default:u=c}setTimeout(function(){t&&t(u),i.manager.itemEnd(e)},0)}catch(t){setTimeout(function(){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)},0)}}else{nc[e]=[],nc[e].push({onLoad:t,onProgress:n,onError:r});var m=new XMLHttpRequest;for(var g in m.open("GET",e,!0),m.addEventListener("load",function(t){var n=this.response,r=nc[e];if(delete nc[e],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Kl.add(e,n);for(var a=0,o=r.length;a<o;a++)(s=r[a]).onLoad&&s.onLoad(n);i.manager.itemEnd(e)}else{for(a=0,o=r.length;a<o;a++){var s;(s=r[a]).onError&&s.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}},!1),m.addEventListener("progress",function(t){for(var n=nc[e],r=0,i=n.length;r<i;r++){var a=n[r];a.onProgress&&a.onProgress(t)}},!1),m.addEventListener("error",function(t){var n=nc[e];delete nc[e];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)},!1),m.addEventListener("abort",function(t){var n=nc[e];delete nc[e];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)},!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(g,this.requestHeader[g]);m.send(null)}return i.manager.itemStart(e),m}nc[e].push({onLoad:t,onProgress:n,onError:r})},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}}),ic.prototype=Object.assign(Object.create(tc.prototype),{constructor:ic,load:function(e,t,n,r){var i=this,a=new rc(i.manager);a.setPath(i.path),a.load(e,function(e){t(i.parse(JSON.parse(e)))},n,r)},parse:function(e){for(var t=[],n=0;n<e.length;n++){var r=$l.parse(e[n]);t.push(r)}return t}}),ac.prototype=Object.assign(Object.create(tc.prototype),{constructor:ac,load:function(e,t,n,r){var i=this,a=[],o=new ps;o.image=a;var s=new rc(this.manager);function l(l){s.load(e[l],function(e){var n=i.parse(e,!0);a[l]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(c+=1)&&(1===n.mipmapCount&&(o.minFilter=ue),o.format=n.format,o.needsUpdate=!0,t&&t(o))},n,r)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(e))for(var c=0,u=0,h=e.length;u<h;++u)l(u);else s.load(e,function(e){var n=i.parse(e,!0);if(n.isCubemap)for(var r=n.mipmaps.length/n.mipmapCount,s=0;s<r;s++){a[s]={mipmaps:[]};for(var l=0;l<n.mipmapCount;l++)a[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+l]),a[s].format=n.format,a[s].width=n.width,a[s].height=n.height}else o.image.width=n.width,o.image.height=n.height,o.mipmaps=n.mipmaps;1===n.mipmapCount&&(o.minFilter=ue),o.format=n.format,o.needsUpdate=!0,t&&t(o)},n,r);return o}}),oc.prototype=Object.assign(Object.create(tc.prototype),{constructor:oc,load:function(e,t,n,r){var i=this,a=new bi,o=new rc(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(e,function(e){var n=i.parse(e);n&&(void 0!==n.image?a.image=n.image:void 0!==n.data&&(a.image.width=n.width,a.image.height=n.height,a.image.data=n.data),a.wrapS=void 0!==n.wrapS?n.wrapS:ae,a.wrapT=void 0!==n.wrapT?n.wrapT:ae,a.magFilter=void 0!==n.magFilter?n.magFilter:ue,a.minFilter=void 0!==n.minFilter?n.minFilter:ue,a.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(a.format=n.format),void 0!==n.type&&(a.type=n.type),void 0!==n.mipmaps&&(a.mipmaps=n.mipmaps,a.minFilter=pe),1===n.mipmapCount&&(a.minFilter=ue),a.needsUpdate=!0,t&&t(a,n))},n,r),a}}),sc.prototype=Object.assign(Object.create(tc.prototype),{constructor:sc,load:function(e,t,n,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Kl.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0),a;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1),Kl.add(e,this),t&&t(this),i.manager.itemEnd(e)}function l(t){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1),r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}return o.addEventListener("load",s,!1),o.addEventListener("error",l,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(e),o.src=e,o}}),lc.prototype=Object.assign(Object.create(tc.prototype),{constructor:lc,load:function(e,t,n,r){var i=new Ri,a=new sc(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(n){a.load(e[n],function(e){i.images[n]=e,6==++o&&(i.needsUpdate=!0,t&&t(i))},void 0,r)}for(var l=0;l<e.length;++l)s(l);return i}}),cc.prototype=Object.assign(Object.create(tc.prototype),{constructor:cc,load:function(e,t,n,r){var i=new Ft,a=new sc(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(n){i.image=n;var r=0<e.search(/\.jpe?g($|\?)/i)||0===e.search(/^data\:image\/jpeg/);i.format=r?Ee:Ce,i.needsUpdate=!0,void 0!==t&&t(i)},n,r),i}}),Object.assign(uc.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n,r=[],i=this.getPoint(0),a=0;for(r.push(0),n=1;n<=e;n++)a+=(t=this.getPoint(n/e)).distanceTo(i),r.push(a),i=t;return this.cacheArcLengths=r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,r=this.getLengths(),i=0,a=r.length;n=t||e*r[a-1];for(var o,s=0,l=a-1;s<=l;)if((o=r[i=Math.floor(s+(l-s)/2)]-n)<0)s=i+1;else{if(!(0<o)){l=i;break}l=i-1}if(r[i=l]===n)return i/(a-1);var c=r[i];return(i+(n-c)/(r[i+1]-c))/(a-1)},getTangent:function(e){var t=e-1e-4,n=e+1e-4;t<0&&(t=0),1<n&&(n=1);var r=this.getPoint(t);return this.getPoint(n).clone().sub(r).normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){var n,r,i,a=new Wt,o=[],s=[],l=[],c=new Wt,u=new Qt;for(n=0;n<=e;n++)r=n/e,o[n]=this.getTangentAt(r),o[n].normalize();s[0]=new Wt,l[0]=new Wt;var h=Number.MAX_VALUE,p=Math.abs(o[0].x),d=Math.abs(o[0].y),f=Math.abs(o[0].z);for(p<=h&&(h=p,a.set(1,0,0)),d<=h&&(h=d,a.set(0,1,0)),f<=h&&a.set(0,0,1),c.crossVectors(o[0],a).normalize(),s[0].crossVectors(o[0],c),l[0].crossVectors(o[0],s[0]),n=1;n<=e;n++)s[n]=s[n-1].clone(),l[n]=l[n-1].clone(),c.crossVectors(o[n-1],o[n]),c.length()>Number.EPSILON&&(c.normalize(),i=Math.acos(Rt.clamp(o[n-1].dot(o[n]),-1,1)),s[n].applyMatrix4(u.makeRotationAxis(c,i))),l[n].crossVectors(o[n],s[n]);if(!0===t)for(i=Math.acos(Rt.clamp(s[0].dot(s[e]),-1,1)),i/=e,0<o[0].dot(c.crossVectors(s[0],s[e]))&&(i=-i),n=1;n<=e;n++)s[n].applyMatrix4(u.makeRotationAxis(o[n],i*n)),l[n].crossVectors(o[n],s[n]);return{tangents:o,normals:s,binormals:l}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),((hc.prototype=Object.create(uc.prototype)).constructor=hc).prototype.isEllipseCurve=!0,hc.prototype.getPoint=function(e,t){for(var n=t||new It,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<Number.EPSILON;i<0;)i+=r;for(;r<i;)i-=r;i<Number.EPSILON&&(i=a?0:r),!0!==this.aClockwise||a||(i===r?i=-r:i-=r);var o=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(o),l=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){var c=Math.cos(this.aRotation),u=Math.sin(this.aRotation),h=s-this.aX,p=l-this.aY;s=h*c-p*u+this.aX,l=h*u+p*c+this.aY}return n.set(s,l)},hc.prototype.copy=function(e){return uc.prototype.copy.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},hc.prototype.toJSON=function(){var e=uc.prototype.toJSON.call(this);return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e},hc.prototype.fromJSON=function(e){return uc.prototype.fromJSON.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},((pc.prototype=Object.create(hc.prototype)).constructor=pc).prototype.isArcCurve=!0;var fc=new Wt,mc=new dc,gc=new dc,vc=new dc;function yc(e,t,n,r){uc.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=r||.5}function xc(e,t,n,r,i){var a=.5*(r-t),o=.5*(i-n),s=e*e;return(2*n-2*r+a+o)*(e*s)+(-3*n+3*r-2*a-o)*s+a*e+n}function _c(e,t,n,r){return(o=1-e)*o*t+2*(1-(a=e))*a*n+(i=e)*i*r;var i,a,o}function bc(e,t,n,r,i){return(c=1-e)*c*c*t+3*(l=1-(s=e))*l*s*n+3*(1-(o=e))*o*o*r+(a=e)*a*a*i;var a,o,s,l,c}function wc(e,t,n,r){uc.call(this),this.type="CubicBezierCurve",this.v0=e||new It,this.v1=t||new It,this.v2=n||new It,this.v3=r||new It}function Mc(e,t,n,r){uc.call(this),this.type="CubicBezierCurve3",this.v0=e||new Wt,this.v1=t||new Wt,this.v2=n||new Wt,this.v3=r||new Wt}function Sc(e,t){uc.call(this),this.type="LineCurve",this.v1=e||new It,this.v2=t||new It}function Tc(e,t){uc.call(this),this.type="LineCurve3",this.v1=e||new Wt,this.v2=t||new Wt}function Ec(e,t,n){uc.call(this),this.type="QuadraticBezierCurve",this.v0=e||new It,this.v1=t||new It,this.v2=n||new It}function Cc(e,t,n){uc.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new Wt,this.v1=t||new Wt,this.v2=n||new Wt}function Ac(e){uc.call(this),this.type="SplineCurve",this.points=e||[]}((yc.prototype=Object.create(uc.prototype)).constructor=yc).prototype.isCatmullRomCurve3=!0,yc.prototype.getPoint=function(e,t){var n,r,i,a,o=t||new Wt,s=this.points,l=s.length,c=(l-(this.closed?0:1))*e,u=Math.floor(c),h=c-u;if(this.closed?u+=0<u?0:(Math.floor(Math.abs(u)/l)+1)*l:0===h&&u===l-1&&(u=l-2,h=1),n=this.closed||0<u?s[(u-1)%l]:(fc.subVectors(s[0],s[1]).add(s[0]),fc),r=s[u%l],i=s[(u+1)%l],a=this.closed||u+2<l?s[(u+2)%l]:(fc.subVectors(s[l-1],s[l-2]).add(s[l-1]),fc),"centripetal"===this.curveType||"chordal"===this.curveType){var p="chordal"===this.curveType?.5:.25,d=Math.pow(n.distanceToSquared(r),p),f=Math.pow(r.distanceToSquared(i),p),m=Math.pow(i.distanceToSquared(a),p);f<1e-4&&(f=1),d<1e-4&&(d=f),m<1e-4&&(m=f),mc.initNonuniformCatmullRom(n.x,r.x,i.x,a.x,d,f,m),gc.initNonuniformCatmullRom(n.y,r.y,i.y,a.y,d,f,m),vc.initNonuniformCatmullRom(n.z,r.z,i.z,a.z,d,f,m)}else"catmullrom"===this.curveType&&(mc.initCatmullRom(n.x,r.x,i.x,a.x,this.tension),gc.initCatmullRom(n.y,r.y,i.y,a.y,this.tension),vc.initCatmullRom(n.z,r.z,i.z,a.z,this.tension));return o.set(mc.calc(h),gc.calc(h),vc.calc(h)),o},yc.prototype.copy=function(e){uc.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},yc.prototype.toJSON=function(){var e=uc.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},yc.prototype.fromJSON=function(e){uc.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new Wt).fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},((wc.prototype=Object.create(uc.prototype)).constructor=wc).prototype.isCubicBezierCurve=!0,wc.prototype.getPoint=function(e,t){var n=t||new It,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(bc(e,r.x,i.x,a.x,o.x),bc(e,r.y,i.y,a.y,o.y)),n},wc.prototype.copy=function(e){return uc.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},wc.prototype.toJSON=function(){var e=uc.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},wc.prototype.fromJSON=function(e){return uc.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},((Mc.prototype=Object.create(uc.prototype)).constructor=Mc).prototype.isCubicBezierCurve3=!0,Mc.prototype.getPoint=function(e,t){var n=t||new Wt,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(bc(e,r.x,i.x,a.x,o.x),bc(e,r.y,i.y,a.y,o.y),bc(e,r.z,i.z,a.z,o.z)),n},Mc.prototype.copy=function(e){return uc.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},Mc.prototype.toJSON=function(){var e=uc.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},Mc.prototype.fromJSON=function(e){return uc.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},((Sc.prototype=Object.create(uc.prototype)).constructor=Sc).prototype.isLineCurve=!0,Sc.prototype.getPoint=function(e,t){var n=t||new It;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Sc.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Sc.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},Sc.prototype.copy=function(e){return uc.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Sc.prototype.toJSON=function(){var e=uc.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Sc.prototype.fromJSON=function(e){return uc.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},((Tc.prototype=Object.create(uc.prototype)).constructor=Tc).prototype.isLineCurve3=!0,Tc.prototype.getPoint=function(e,t){var n=t||new Wt;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Tc.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Tc.prototype.copy=function(e){return uc.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Tc.prototype.toJSON=function(){var e=uc.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Tc.prototype.fromJSON=function(e){return uc.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},((Ec.prototype=Object.create(uc.prototype)).constructor=Ec).prototype.isQuadraticBezierCurve=!0,Ec.prototype.getPoint=function(e,t){var n=t||new It,r=this.v0,i=this.v1,a=this.v2;return n.set(_c(e,r.x,i.x,a.x),_c(e,r.y,i.y,a.y)),n},Ec.prototype.copy=function(e){return uc.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Ec.prototype.toJSON=function(){var e=uc.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Ec.prototype.fromJSON=function(e){return uc.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},((Cc.prototype=Object.create(uc.prototype)).constructor=Cc).prototype.isQuadraticBezierCurve3=!0,Cc.prototype.getPoint=function(e,t){var n=t||new Wt,r=this.v0,i=this.v1,a=this.v2;return n.set(_c(e,r.x,i.x,a.x),_c(e,r.y,i.y,a.y),_c(e,r.z,i.z,a.z)),n},Cc.prototype.copy=function(e){return uc.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Cc.prototype.toJSON=function(){var e=uc.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Cc.prototype.fromJSON=function(e){return uc.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},((Ac.prototype=Object.create(uc.prototype)).constructor=Ac).prototype.isSplineCurve=!0,Ac.prototype.getPoint=function(e,t){var n=t||new It,r=this.points,i=(r.length-1)*e,a=Math.floor(i),o=i-a,s=r[0===a?a:a-1],l=r[a],c=r[a>r.length-2?r.length-1:a+1],u=r[a>r.length-3?r.length-1:a+2];return n.set(xc(o,s.x,l.x,c.x,u.x),xc(o,s.y,l.y,c.y,u.y)),n},Ac.prototype.copy=function(e){uc.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this},Ac.prototype.toJSON=function(){var e=uc.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e},Ac.prototype.fromJSON=function(e){uc.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new It).fromArray(r))}return this};var Lc=Object.freeze({__proto__:null,ArcCurve:pc,CatmullRomCurve3:yc,CubicBezierCurve:wc,CubicBezierCurve3:Mc,EllipseCurve:hc,LineCurve:Sc,LineCurve3:Tc,QuadraticBezierCurve:Ec,QuadraticBezierCurve3:Cc,SplineCurve:Ac});function Dc(){uc.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Pc(e){Dc.call(this),this.type="Path",this.currentPoint=new It,e&&this.setFromPoints(e)}function Oc(e){Pc.call(this,e),this.uuid=Rt.generateUUID(),this.type="Shape",this.holes=[]}function Rc(e,t){yn.call(this),this.type="Light",this.color=new cr(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function Ic(e,t,n){Rc.call(this,e,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(yn.DefaultUp),this.updateMatrix(),this.groundColor=new cr(t)}function Bc(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new It(512,512),this.map=null,this.mapPass=null,this.matrix=new Qt,this._frustum=new Si,this._frameExtents=new It(1,1),this._viewportCount=1,this._viewports=[new Gt(0,0,1,1)]}function Nc(){Bc.call(this,new yi(50,1,.5,500))}function kc(e,t,n,r,i,a){Rc.call(this,e,t),this.type="SpotLight",this.position.copy(yn.DefaultUp),this.updateMatrix(),this.target=new yn,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==a?a:1,this.shadow=new Nc}function Fc(){Bc.call(this,new yi(90,1,.5,500)),this._frameExtents=new It(4,2),this._viewportCount=6,this._viewports=[new Gt(2,1,1,1),new Gt(0,1,1,1),new Gt(3,1,1,1),new Gt(1,1,1,1),new Gt(3,0,1,1),new Gt(1,0,1,1)],this._cubeDirections=[new Wt(1,0,0),new Wt(-1,0,0),new Wt(0,0,1),new Wt(0,0,-1),new Wt(0,1,0),new Wt(0,-1,0)],this._cubeUps=[new Wt(0,1,0),new Wt(0,1,0),new Wt(0,1,0),new Wt(0,1,0),new Wt(0,0,1),new Wt(0,0,-1)]}function Gc(e,t,n,r){Rc.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new Fc}function Vc(e,t,n,r,i,a){vi.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==e?e:-1,this.right=void 0!==t?t:1,this.top=void 0!==n?n:1,this.bottom=void 0!==r?r:-1,this.near=void 0!==i?i:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function zc(){Bc.call(this,new Vc(-5,5,5,-5,.5,500))}function Uc(e,t){Rc.call(this,e,t),this.type="DirectionalLight",this.position.copy(yn.DefaultUp),this.updateMatrix(),this.target=new yn,this.shadow=new zc}function jc(e,t){Rc.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function Hc(e,t,n,r){Rc.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}function Wc(e){tc.call(this,e),this.textures={}}Dc.prototype=Object.assign(Object.create(uc.prototype),{constructor:Dc,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Sc(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=t){var i=n[r]-t,a=this.curves[r],o=a.getLength(),s=0===o?0:1-i/o;return a.getPointAt(s)}r++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e},getSpacedPoints:function(e){void 0===e&&(e=40);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,n=[],r=0,i=this.curves;r<i.length;r++)for(var a=i[r],o=a&&a.isEllipseCurve?2*e:a&&(a.isLineCurve||a.isLineCurve3)?1:a&&a.isSplineCurve?e*a.points.length:e,s=a.getPoints(o),l=0;l<s.length;l++){var c=s[l];t&&t.equals(c)||(n.push(c),t=c)}return this.autoClose&&1<n.length&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){uc.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=uc.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var r=this.curves[t];e.curves.push(r.toJSON())}return e},fromJSON:function(e){uc.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push((new Lc[r.type]).fromJSON(r))}return this}}),Pc.prototype=Object.assign(Object.create(Dc.prototype),{constructor:Pc,setFromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this},moveTo:function(e,t){return this.currentPoint.set(e,t),this},lineTo:function(e,t){var n=new Sc(this.currentPoint.clone(),new It(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this},quadraticCurveTo:function(e,t,n,r){var i=new Ec(this.currentPoint.clone(),new It(e,t),new It(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this},bezierCurveTo:function(e,t,n,r,i,a){var o=new wc(this.currentPoint.clone(),new It(e,t),new It(n,r),new It(i,a));return this.curves.push(o),this.currentPoint.set(i,a),this},splineThru:function(e){var t=new Ac([this.currentPoint.clone()].concat(e));return this.curves.push(t),this.currentPoint.copy(e[e.length-1]),this},arc:function(e,t,n,r,i,a){var o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(e+o,t+s,n,r,i,a),this},absarc:function(e,t,n,r,i,a){return this.absellipse(e,t,n,n,r,i,a),this},ellipse:function(e,t,n,r,i,a,o,s){var l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+l,t+c,n,r,i,a,o,s),this},absellipse:function(e,t,n,r,i,a,o,s){var l=new hc(e,t,n,r,i,a,o,s);if(0<this.curves.length){var c=l.getPoint(0);c.equals(this.currentPoint)||this.lineTo(c.x,c.y)}this.curves.push(l);var u=l.getPoint(1);return this.currentPoint.copy(u),this},copy:function(e){return Dc.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=Dc.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return Dc.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),Oc.prototype=Object.assign(Object.create(Pc.prototype),{constructor:Oc,getPointsHoles:function(e){for(var t=[],n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t},extractPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},copy:function(e){Pc.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push(r.clone())}return this},toJSON:function(){var e=Pc.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var r=this.holes[t];e.holes.push(r.toJSON())}return e},fromJSON:function(e){Pc.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push((new Pc).fromJSON(r))}return this}}),Rc.prototype=Object.assign(Object.create(yn.prototype),{constructor:Rc,isLight:!0,copy:function(e){return yn.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=yn.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}),Ic.prototype=Object.assign(Object.create(Rc.prototype),{constructor:Ic,isHemisphereLight:!0,copy:function(e){return Rc.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(Bc.prototype,{_projScreenMatrix:new Qt,_lightPositionWorld:new Wt,_lookTarget:new Wt,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(e){var t=this.camera,n=this.matrix,r=this._projScreenMatrix,i=this._lookTarget,a=this._lightPositionWorld;a.setFromMatrixPosition(e.matrixWorld),t.position.copy(a),i.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(i),t.updateMatrixWorld(),r.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(r),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)},getViewport:function(e){return this._viewports[e]},getFrameExtents:function(){return this._frameExtents},copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}),Nc.prototype=Object.assign(Object.create(Bc.prototype),{constructor:Nc,isSpotLightShadow:!0,updateMatrices:function(e){var t=this.camera,n=2*Rt.RAD2DEG*e.angle,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;n===t.fov&&r===t.aspect&&i===t.far||(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),Bc.prototype.updateMatrices.call(this,e)}}),kc.prototype=Object.assign(Object.create(Rc.prototype),{constructor:kc,isSpotLight:!0,copy:function(e){return Rc.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Fc.prototype=Object.assign(Object.create(Bc.prototype),{constructor:Fc,isPointLightShadow:!0,updateMatrices:function(e,t){void 0===t&&(t=0);var n=this.camera,r=this.matrix,i=this._lightPositionWorld,a=this._lookTarget,o=this._projScreenMatrix;i.setFromMatrixPosition(e.matrixWorld),n.position.copy(i),a.copy(n.position),a.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(a),n.updateMatrixWorld(),r.makeTranslation(-i.x,-i.y,-i.z),o.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(o)}}),Gc.prototype=Object.assign(Object.create(Rc.prototype),{constructor:Gc,isPointLight:!0,copy:function(e){return Rc.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),Vc.prototype=Object.assign(Object.create(vi.prototype),{constructor:Vc,isOrthographicCamera:!0,copy:function(e,t){return vi.prototype.copy.call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this},setViewOffset:function(e,t,n,r,i,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(null!==this.view&&this.view.enabled){var l=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a=(i+=l*this.view.offsetX)+l*this.view.width,s=(o-=c*this.view.offsetY)-c*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=yn.prototype.toJSON.call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}),zc.prototype=Object.assign(Object.create(Bc.prototype),{constructor:zc,isDirectionalLightShadow:!0,updateMatrices:function(e){Bc.prototype.updateMatrices.call(this,e)}}),Uc.prototype=Object.assign(Object.create(Rc.prototype),{constructor:Uc,isDirectionalLight:!0,copy:function(e){return Rc.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),jc.prototype=Object.assign(Object.create(Rc.prototype),{constructor:jc,isAmbientLight:!0}),Hc.prototype=Object.assign(Object.create(Rc.prototype),{constructor:Hc,isRectAreaLight:!0,copy:function(e){return Rc.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=Rc.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}),Wc.prototype=Object.assign(Object.create(tc.prototype),{constructor:Wc,load:function(e,t,n,r){var i=this,a=new rc(i.manager);a.setPath(i.path),a.load(e,function(e){t(i.parse(JSON.parse(e)))},n,r)},parse:function(e){var t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}var r=new Nl[e.type];if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.sheen&&(r.sheen=(new cr).setHex(e.sheen)),void 0!==e.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&r.specular.setHex(e.specular),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearcoat&&(r.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(r.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.vertexColors&&(r.vertexColors=e.vertexColors),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.combine&&(r.combine=e.combine),void 0!==e.side&&(r.side=e.side),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(r.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(r.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(r.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(r.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(r.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(r.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(r.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(r.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),1!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.polygonOffset&&(r.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(r.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(r.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.skinning&&(r.skinning=e.skinning),void 0!==e.morphTargets&&(r.morphTargets=e.morphTargets),void 0!==e.morphNormals&&(r.morphNormals=e.morphNormals),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.toneMapped&&(r.toneMapped=e.toneMapped),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.uniforms)for(var i in e.uniforms){var a=e.uniforms[i];switch(r.uniforms[i]={},a.type){case"t":r.uniforms[i].value=n(a.value);break;case"c":r.uniforms[i].value=(new cr).setHex(a.value);break;case"v2":r.uniforms[i].value=(new It).fromArray(a.value);break;case"v3":r.uniforms[i].value=(new Wt).fromArray(a.value);break;case"v4":r.uniforms[i].value=(new Gt).fromArray(a.value);break;case"m3":r.uniforms[i].value=(new Bt).fromArray(a.value);case"m4":r.uniforms[i].value=(new Qt).fromArray(a.value);break;default:r.uniforms[i].value=a.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(var o in e.extensions)r.extensions[o]=e.extensions[o];if(void 0!==e.shading&&(r.flatShading=1===e.shading),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap),r.transparent=!0),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){var s=e.normalScale;!1===Array.isArray(s)&&(s=[s,s]),r.normalScale=(new It).fromArray(s)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new It).fromArray(e.clearcoatNormalScale)),r},setTextures:function(e){return this.textures=e,this}});var qc={decodeText:function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}},extractUrlBase:function(e){var t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)}};function Jc(){kr.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function Xc(e,t,n,r){"number"==typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),yr.call(this,e,t,n),this.meshPerAttribute=r||1}function Yc(e){tc.call(this,e)}Jc.prototype=Object.assign(Object.create(kr.prototype),{constructor:Jc,isInstancedBufferGeometry:!0,copy:function(e){return kr.prototype.copy.call(this,e),this.maxInstancedCount=e.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e=kr.prototype.toJSON.call(this);return e.maxInstancedCount=this.maxInstancedCount,e.isInstancedBufferGeometry=!0,e}}),Xc.prototype=Object.assign(Object.create(yr.prototype),{constructor:Xc,isInstancedBufferAttribute:!0,copy:function(e){return yr.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},toJSON:function(){var e=yr.prototype.toJSON.call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}),Yc.prototype=Object.assign(Object.create(tc.prototype),{constructor:Yc,load:function(e,t,n,r){var i=this,a=new rc(i.manager);a.setPath(i.path),a.load(e,function(e){t(i.parse(JSON.parse(e)))},n,r)},parse:function(e){var t=new(e.isInstancedBufferGeometry?Jc:kr),n=e.data.index;if(void 0!==n){var r=new $c[n.type](n.array);t.setIndex(new yr(r,1))}var i=e.data.attributes;for(var a in i){var o=i[a],s=(r=new $c[o.type](o.array),new(o.isInstancedBufferAttribute?Xc:yr)(r,o.itemSize,o.normalized));void 0!==o.name&&(s.name=o.name),t.setAttribute(a,s)}var l=e.data.morphAttributes;if(l)for(var a in l){for(var c=l[a],u=[],h=0,p=c.length;h<p;h++)o=c[h],s=new yr(r=new $c[o.type](o.array),o.itemSize,o.normalized),void 0!==o.name&&(s.name=o.name),u.push(s);t.morphAttributes[a]=u}e.data.morphTargetsRelative&&(t.morphTargetsRelative=!0);var d=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==d){h=0;for(var f=d.length;h!==f;++h){var m=d[h];t.addGroup(m.start,m.count,m.materialIndex)}}var g=e.data.boundingSphere;if(void 0!==g){var v=new Wt;void 0!==g.center&&v.fromArray(g.center),t.boundingSphere=new Nn(v,g.radius)}return e.name&&(t.name=e.name),e.userData&&(t.userData=e.userData),t}});var $c={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function Zc(e){tc.call(this,e)}Zc.prototype=Object.assign(Object.create(tc.prototype),{constructor:Zc,load:function(e,t,n,r){var i=this,a=""===this.path?qc.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;var o=new rc(i.manager);o.setPath(this.path),o.load(e,function(n){var a=null;try{a=JSON.parse(n)}catch(n){return void 0!==r&&r(n),void console.error("THREE:ObjectLoader: Can't parse "+e+".",n.message)}var o=a.metadata;void 0!==o&&void 0!==o.type&&"geometry"!==o.type.toLowerCase()?i.parse(a,t):console.error("THREE.ObjectLoader: Can't load "+e)},n,r)},parse:function(e,t){var n=this.parseShape(e.shapes),r=this.parseGeometries(e.geometries,n),i=this.parseImages(e.images,function(){void 0!==t&&t(s)}),a=this.parseTextures(e.textures,i),o=this.parseMaterials(e.materials,a),s=this.parseObject(e.object,r,o);return e.animations&&(s.animations=this.parseAnimations(e.animations)),void 0!==e.images&&0!==e.images.length||void 0!==t&&t(s),s},parseShape:function(e){var t={};if(void 0!==e)for(var n=0,r=e.length;n<r;n++){var i=(new Oc).fromJSON(e[n]);t[i.uuid]=i}return t},parseGeometries:function(e,t){var n={};if(void 0!==e)for(var r=new Yc,i=0,a=e.length;i<a;i++){var o,s=e[i];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new Tl[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new Tl[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new Tl[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new Tl[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":o=new Tl[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new Tl[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":o=new Tl[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new Tl[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new Tl[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new Tl[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":o=new Tl[s.type]((new Lc[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":o=new Tl[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new Tl[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var l=[],c=0,u=s.shapes.length;c<u;c++){var h=t[s.shapes[c]];l.push(h)}o=new Tl[s.type](l,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(l=[],c=0,u=s.shapes.length;c<u;c++)h=t[s.shapes[c]],l.push(h);var p=s.options.extrudePath;void 0!==p&&(s.options.extrudePath=(new Lc[p.type]).fromJSON(p)),o=new Tl[s.type](l,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":o=r.parse(s);break;case"Geometry":"THREE"in window&&"LegacyJSONLoader"in THREE?o=(new THREE.LegacyJSONLoader).parse(s,this.resourcePath).geometry:console.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),!0===o.isBufferGeometry&&void 0!==s.userData&&(o.userData=s.userData),n[s.uuid]=o}return n},parseMaterials:function(e,t){var n={},r={};if(void 0!==e){var i=new Wc;i.setTextures(t);for(var a=0,o=e.length;a<o;a++){var s=e[a];if("MultiMaterial"===s.type){for(var l=[],c=0;c<s.materials.length;c++){var u=s.materials[c];void 0===n[u.uuid]&&(n[u.uuid]=i.parse(u)),l.push(n[u.uuid])}r[s.uuid]=l}else void 0===n[s.uuid]&&(n[s.uuid]=i.parse(s)),r[s.uuid]=n[s.uuid]}}return r},parseAnimations:function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],i=$l.parse(r);void 0!==r.uuid&&(i.uuid=r.uuid),t.push(i)}return t},parseImages:function(e,t){var n=this,r={};function i(e){return n.manager.itemStart(e),a.load(e,function(){n.manager.itemEnd(e)},void 0,function(){n.manager.itemError(e),n.manager.itemEnd(e)})}if(void 0!==e&&0<e.length){var a=new sc(new Ql(t));a.setCrossOrigin(this.crossOrigin);for(var o=0,s=e.length;o<s;o++){var l=e[o],c=l.url;if(Array.isArray(c)){r[l.uuid]=[];for(var u=0,h=c.length;u<h;u++){var p=c[u],d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(p)?p:n.resourcePath+p;r[l.uuid].push(i(d))}}else d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l.url)?l.url:n.resourcePath+l.url,r[l.uuid]=i(d)}}return r},parseTextures:function(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var r={};if(void 0!==e)for(var i=0,a=e.length;i<a;i++){var o,s=e[i];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image),(o=new(Array.isArray(t[s.image])?Ri:Ft)(t[s.image])).needsUpdate=!0,o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),void 0!==s.mapping&&(o.mapping=n(s.mapping,Qc)),void 0!==s.offset&&o.offset.fromArray(s.offset),void 0!==s.repeat&&o.repeat.fromArray(s.repeat),void 0!==s.center&&o.center.fromArray(s.center),void 0!==s.rotation&&(o.rotation=s.rotation),void 0!==s.wrap&&(o.wrapS=n(s.wrap[0],eu),o.wrapT=n(s.wrap[1],eu)),void 0!==s.format&&(o.format=s.format),void 0!==s.type&&(o.type=s.type),void 0!==s.encoding&&(o.encoding=s.encoding),void 0!==s.minFilter&&(o.minFilter=n(s.minFilter,tu)),void 0!==s.magFilter&&(o.magFilter=n(s.magFilter,tu)),void 0!==s.anisotropy&&(o.anisotropy=s.anisotropy),void 0!==s.flipY&&(o.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(o.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(o.unpackAlignment=s.unpackAlignment),r[s.uuid]=o}return r},parseObject:function(e,t,n){var r;function i(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function a(e){if(void 0!==e){if(Array.isArray(e)){for(var t=[],r=0,i=e.length;r<i;r++){var a=e[r];void 0===n[a]&&console.warn("THREE.ObjectLoader: Undefined material",a),t.push(n[a])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}switch(e.type){case"Scene":r=new xn,void 0!==e.background&&Number.isInteger(e.background)&&(r.background=new cr(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?r.fog=new fo(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(r.fog=new po(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":r=new yi(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(r.focus=e.focus),void 0!==e.zoom&&(r.zoom=e.zoom),void 0!==e.filmGauge&&(r.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(r.filmOffset=e.filmOffset),void 0!==e.view&&(r.view=Object.assign({},e.view));break;case"OrthographicCamera":r=new Vc(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(r.zoom=e.zoom),void 0!==e.view&&(r.view=Object.assign({},e.view));break;case"AmbientLight":r=new jc(e.color,e.intensity);break;case"DirectionalLight":r=new Uc(e.color,e.intensity);break;case"PointLight":r=new Gc(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":r=new Hc(e.color,e.intensity,e.width,e.height);break;case"SpotLight":r=new kc(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":r=new Ic(e.color,e.groundColor,e.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var o=i(e.geometry),s=a(e.material);r=new(o.bones&&0<o.bones.length?ko:ti)(o,s);break;case"InstancedMesh":o=i(e.geometry),s=a(e.material);var l=e.count,c=e.instanceMatrix;(r=new qo(o,s,l)).instanceMatrix=new yr(new Float32Array(c.array),16);break;case"LOD":r=new No;break;case"Line":r=new Qo(i(e.geometry),a(e.material),e.mode);break;case"LineLoop":r=new rs(i(e.geometry),a(e.material));break;case"LineSegments":r=new ns(i(e.geometry),a(e.material));break;case"PointCloud":case"Points":r=new cs(i(e.geometry),a(e.material));break;case"Sprite":r=new Oo(a(e.material));break;case"Group":r=new co;break;default:r=new yn}if(r.uuid=e.uuid,void 0!==e.name&&(r.name=e.name),void 0!==e.matrix?(r.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(r.matrixAutoUpdate=e.matrixAutoUpdate),r.matrixAutoUpdate&&r.matrix.decompose(r.position,r.quaternion,r.scale)):(void 0!==e.position&&r.position.fromArray(e.position),void 0!==e.rotation&&r.rotation.fromArray(e.rotation),void 0!==e.quaternion&&r.quaternion.fromArray(e.quaternion),void 0!==e.scale&&r.scale.fromArray(e.scale)),void 0!==e.castShadow&&(r.castShadow=e.castShadow),void 0!==e.receiveShadow&&(r.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(r.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(r.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&r.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(r.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.frustumCulled&&(r.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(r.renderOrder=e.renderOrder),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.layers&&(r.layers.mask=e.layers),void 0!==e.children)for(var u=e.children,h=0;h<u.length;h++)r.add(this.parseObject(u[h],t,n));if("LOD"===e.type){void 0!==e.autoUpdate&&(r.autoUpdate=e.autoUpdate);for(var p=e.levels,d=0;d<p.length;d++){var f=p[d],m=r.getObjectByProperty("uuid",f.object);void 0!==m&&r.addLevel(m,f.distance)}}return r}});var Kc,Qc={UVMapping:300,CubeReflectionMapping:Z,CubeRefractionMapping:K,EquirectangularReflectionMapping:Q,EquirectangularRefractionMapping:ee,SphericalReflectionMapping:te,CubeUVReflectionMapping:ne,CubeUVRefractionMapping:re},eu={RepeatWrapping:ie,ClampToEdgeWrapping:ae,MirroredRepeatWrapping:oe},tu={NearestFilter:se,NearestMipmapNearestFilter:le,NearestMipmapLinearFilter:ce,LinearFilter:ue,LinearMipmapNearestFilter:he,LinearMipmapLinearFilter:pe};function nu(e){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),tc.call(this,e),this.options=void 0}function ru(){this.type="ShapePath",this.color=new cr,this.subPaths=[],this.currentPath=null}function iu(e){this.type="Font",this.data=e}function au(e,t,n,r,i){var a=i.glyphs[e]||i.glyphs["?"];if(a){var o,s,l,c,u,h,p,d,f=new ru;if(a.o)for(var m=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),g=0,v=m.length;g<v;)switch(m[g++]){case"m":o=m[g++]*t+n,s=m[g++]*t+r,f.moveTo(o,s);break;case"l":o=m[g++]*t+n,s=m[g++]*t+r,f.lineTo(o,s);break;case"q":l=m[g++]*t+n,c=m[g++]*t+r,u=m[g++]*t+n,h=m[g++]*t+r,f.quadraticCurveTo(u,h,l,c);break;case"b":l=m[g++]*t+n,c=m[g++]*t+r,u=m[g++]*t+n,h=m[g++]*t+r,p=m[g++]*t+n,d=m[g++]*t+r,f.bezierCurveTo(u,h,p,d,l,c)}return{offsetX:a.ha*t,path:f}}console.error('THREE.Font: character "'+e+'" does not exists in font family '+i.familyName+".")}function ou(e){tc.call(this,e)}nu.prototype=Object.assign(Object.create(tc.prototype),{constructor:nu,setOptions:function(e){return this.options=e,this},load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Kl.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0),a;fetch(e).then(function(e){return e.blob()}).then(function(e){return void 0===i.options?createImageBitmap(e):createImageBitmap(e,i.options)}).then(function(n){Kl.add(e,n),t&&t(n),i.manager.itemEnd(e)}).catch(function(t){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}),i.manager.itemStart(e)}}),Object.assign(ru.prototype,{moveTo:function(e,t){return this.currentPath=new Pc,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this},lineTo:function(e,t){return this.currentPath.lineTo(e,t),this},quadraticCurveTo:function(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this},bezierCurveTo:function(e,t,n,r,i,a){return this.currentPath.bezierCurveTo(e,t,n,r,i,a),this},splineThru:function(e){return this.currentPath.splineThru(e),this},toShapes:function(e,t){function n(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n],a=new Oc;a.curves=i.curves,t.push(a)}return t}function r(e,t){for(var n=t.length,r=!1,i=n-1,a=0;a<n;i=a++){var o=t[i],s=t[a],l=s.x-o.x,c=s.y-o.y;if(Math.abs(c)>Number.EPSILON){if(c<0&&(o=t[a],l=-l,s=t[i],c=-c),e.y<o.y||e.y>s.y)continue;if(e.y===o.y){if(e.x===o.x)return 1}else{var u=c*(e.x-o.x)-l*(e.y-o.y);if(0==u)return 1;if(u<0)continue;r=!r}}else{if(e.y!==o.y)continue;if(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x)return 1}}return r}var i=el.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===t)return n(a);var o,s,l,c=[];if(1===a.length)return s=a[0],(l=new Oc).curves=s.curves,c.push(l),c;var u=!i(a[0].getPoints());u=e?!u:u;var h,p,d=[],f=[],m=[],g=0;f[g]=void 0,m[g]=[];for(var v=0,y=a.length;v<y;v++)o=i(h=(s=a[v]).getPoints()),(o=e?!o:o)?(!u&&f[g]&&g++,f[g]={s:new Oc,p:h},f[g].s.curves=s.curves,u&&g++,m[g]=[]):m[g].push({h:s,p:h[0]});if(!f[0])return n(a);if(1<f.length){for(var x=!1,_=[],b=0,w=f.length;b<w;b++)d[b]=[];for(b=0,w=f.length;b<w;b++)for(var M=m[b],S=0;S<M.length;S++){for(var T=M[S],E=!0,C=0;C<f.length;C++)r(T.p,f[C].p)&&(b!==C&&_.push({froms:b,tos:C,hole:S}),E?(E=!1,d[C].push(T)):x=!0);E&&d[b].push(T)}0<_.length&&(x||(m=d))}v=0;for(var A=f.length;v<A;v++){l=f[v].s,c.push(l);for(var L=0,D=(p=m[v]).length;L<D;L++)l.holes.push(p[L].h)}return c}}),Object.assign(iu.prototype,{isFont:!0,generateShapes:function(e,t){void 0===t&&(t=100);for(var n=[],r=function(e,t,n){for(var r=Array.from?Array.from(e):String(e).split(""),i=t/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,o=[],s=0,l=0,c=0;c<r.length;c++){var u=r[c];if("\n"===u)s=0,l-=a;else{var h=au(u,i,s,l,n);s+=h.offsetX,o.push(h.path)}}return o}(e,t,this.data),i=0,a=r.length;i<a;i++)Array.prototype.push.apply(n,r[i].toShapes());return n}}),ou.prototype=Object.assign(Object.create(tc.prototype),{constructor:ou,load:function(e,t,n,r){var i=this,a=new rc(this.manager);a.setPath(this.path),a.load(e,function(e){var n;try{n=JSON.parse(e)}catch(r){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}var r=i.parse(n);t&&t(r)},n,r)},parse:function(e){return new iu(e)}});var su={getContext:function(){return void 0===Kc&&(Kc=new(window.AudioContext||window.webkitAudioContext)),Kc},setContext:function(e){Kc=e}};function lu(e){tc.call(this,e)}function cu(){this.coefficients=[];for(var e=0;e<9;e++)this.coefficients.push(new Wt)}function uu(e,t){Rc.call(this,void 0,t),this.sh=void 0!==e?e:new cu}function hu(e,t,n){uu.call(this,void 0,n);var r=(new cr).set(e),i=(new cr).set(t),a=new Wt(r.r,r.g,r.b),o=new Wt(i.r,i.g,i.b),s=Math.sqrt(Math.PI),l=s*Math.sqrt(.75);this.sh.coefficients[0].copy(a).add(o).multiplyScalar(s),this.sh.coefficients[1].copy(a).sub(o).multiplyScalar(l)}function pu(e,t){uu.call(this,void 0,t);var n=(new cr).set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}lu.prototype=Object.assign(Object.create(tc.prototype),{constructor:lu,load:function(e,t,n,r){var i=new rc(this.manager);i.setResponseType("arraybuffer"),i.setPath(this.path),i.load(e,function(e){var n=e.slice(0);su.getContext().decodeAudioData(n,function(e){t(e)})},n,r)}}),Object.assign(cu.prototype,{isSphericalHarmonics3:!0,set:function(e){for(var t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this},zero:function(){for(var e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this},getAt:function(e,t){var n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScale(a[1],.488603*r),t.addScale(a[2],.488603*i),t.addScale(a[3],.488603*n),t.addScale(a[4],n*r*1.092548),t.addScale(a[5],r*i*1.092548),t.addScale(a[6],.315392*(3*i*i-1)),t.addScale(a[7],n*i*1.092548),t.addScale(a[8],.546274*(n*n-r*r)),t},getIrradianceAt:function(e,t){var n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScale(a[1],1.023328*r),t.addScale(a[2],1.023328*i),t.addScale(a[3],1.023328*n),t.addScale(a[4],.858086*n*r),t.addScale(a[5],.858086*r*i),t.addScale(a[6],.743125*i*i-.247708),t.addScale(a[7],.858086*n*i),t.addScale(a[8],.429043*(n*n-r*r)),t},add:function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this},scale:function(e){for(var t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this},lerp:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this},equals:function(e){for(var t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0},copy:function(e){return this.set(e.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(e,t){void 0===t&&(t=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}}),Object.assign(cu,{getBasisAt:function(e,t){var n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}),uu.prototype=Object.assign(Object.create(Rc.prototype),{constructor:uu,isLightProbe:!0,copy:function(e){return Rc.prototype.copy.call(this,e),this.sh.copy(e.sh),this.intensity=e.intensity,this},toJSON:function(e){return Rc.prototype.toJSON.call(this,e)}}),hu.prototype=Object.assign(Object.create(uu.prototype),{constructor:hu,isHemisphereLightProbe:!0,copy:function(e){return uu.prototype.copy.call(this,e),this},toJSON:function(e){return uu.prototype.toJSON.call(this,e)}}),pu.prototype=Object.assign(Object.create(uu.prototype),{constructor:pu,isAmbientLightProbe:!0,copy:function(e){return uu.prototype.copy.call(this,e),this},toJSON:function(e){return uu.prototype.toJSON.call(this,e)}});var du=new Qt,fu=new Qt;function mu(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new yi,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new yi,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}function gu(e){this.autoStart=void 0===e||e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}Object.assign(mu.prototype,{update:function(e){var t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep;var n,r,i=e.projectionMatrix.clone(),a=t.eyeSep/2,o=a*t.near/t.focus,s=t.near*Math.tan(Rt.DEG2RAD*t.fov*.5)/t.zoom;fu.elements[12]=-a,du.elements[12]=a,n=-s*t.aspect+o,r=s*t.aspect+o,i.elements[0]=2*t.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraL.projectionMatrix.copy(i),n=-s*t.aspect-o,r=s*t.aspect-o,i.elements[0]=2*t.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraR.projectionMatrix.copy(i)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(fu),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(du)}}),Object.assign(gu.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=("undefined"==typeof performance?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}});var vu=new Wt,yu=new Ut,xu=new Wt,_u=new Wt;function bu(){yn.call(this),this.type="AudioListener",this.context=su.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new gu}function wu(e){yn.call(this),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this._startedAt=0,this._pausedAt=0,this.filters=[]}bu.prototype=Object.assign(Object.create(yn.prototype),{constructor:bu,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this},updateMatrixWorld:function(e){yn.prototype.updateMatrixWorld.call(this,e);var t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(vu,yu,xu),_u.set(0,0,-1).applyQuaternion(yu),t.positionX){var r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(vu.x,r),t.positionY.linearRampToValueAtTime(vu.y,r),t.positionZ.linearRampToValueAtTime(vu.z,r),t.forwardX.linearRampToValueAtTime(_u.x,r),t.forwardY.linearRampToValueAtTime(_u.y,r),t.forwardZ.linearRampToValueAtTime(_u.z,r),t.upX.linearRampToValueAtTime(n.x,r),t.upY.linearRampToValueAtTime(n.y,r),t.upZ.linearRampToValueAtTime(n.z,r)}else t.setPosition(vu.x,vu.y,vu.z),t.setOrientation(_u.x,_u.y,_u.z,n.x,n.y,n.z)}}),wu.prototype=Object.assign(Object.create(yn.prototype),{constructor:wu,getOutput:function(){return this.gain},setNodeSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},setMediaElementSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this},setMediaStreamSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this},setBuffer:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(e){if(void 0===e&&(e=0),!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+e;var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._pausedAt+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._pausedAt=(this.context.currentTime-this._startedAt)*this.playbackRate,this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this._pausedAt=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(0<this.filters.length){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(0<this.filters.length){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(e){return e=e||[],!0===this.isPlaying?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},setDetune:function(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate:function(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},setLoopStart:function(e){return this.loopStart=e,this},setLoopEnd:function(e){return this.loopEnd=e,this},getVolume:function(){return this.gain.gain.value},setVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}});var Mu=new Wt,Su=new Ut,Tu=new Wt,Eu=new Wt;function Cu(e){wu.call(this,e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function Au(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function Lu(e,t,n){this.binding=e,this.valueSize=n;var r,i=Float64Array;switch(t){case"quaternion":r=this._slerp;break;case"string":case"bool":i=Array,r=this._select;break;default:r=this._lerp}this.buffer=new i(4*n),this._mixBufferRegion=r,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}Cu.prototype=Object.assign(Object.create(wu.prototype),{constructor:Cu,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(e){return this.panner.refDistance=e,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(e){return this.panner.rolloffFactor=e,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(e){return this.panner.distanceModel=e,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(e){return this.panner.maxDistance=e,this},setDirectionalCone:function(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(e){if(yn.prototype.updateMatrixWorld.call(this,e),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(Mu,Su,Tu),Eu.set(0,0,1).applyQuaternion(Su);var t=this.panner;if(t.positionX){var n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Mu.x,n),t.positionY.linearRampToValueAtTime(Mu.y,n),t.positionZ.linearRampToValueAtTime(Mu.z,n),t.orientationX.linearRampToValueAtTime(Eu.x,n),t.orientationY.linearRampToValueAtTime(Eu.y,n),t.orientationZ.linearRampToValueAtTime(Eu.z,n)}else t.setPosition(Mu.x,Mu.y,Mu.z),t.setOrientation(Eu.x,Eu.y,Eu.z)}}}),Object.assign(Au.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),n=0;n<t.length;n++)e+=t[n];return e/t.length}}),Object.assign(Lu.prototype,{accumulate:function(e,t){var n=this.buffer,r=this.valueSize,i=e*r+r,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==r;++o)n[i+o]=n[o];a=t}else{var s=t/(a+=t);this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=a},apply:function(e){var t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,i<1){var o=3*t;this._mixBufferRegion(n,r,o,1-i,t)}for(var s=t,l=t+t;s!==l;++s)if(n[s]!==n[s+t]){a.setValue(n,r);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,r=3*n;e.getValue(t,r);for(var i=n,a=r;i!==a;++i)t[i]=t[r+i%n];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,t,n,r,i){if(.5<=r)for(var a=0;a!==i;++a)e[t+a]=e[n+a]},_slerp:function(e,t,n,r){Ut.slerpFlat(e,t,e,t,e,n,r)},_lerp:function(e,t,n,r,i){for(var a=1-r,o=0;o!==i;++o){var s=t+o;e[s]=e[s]*a+e[n+o]*r}}});var Du="\\[\\]\\.:\\/",Pu=new RegExp("["+Du+"]","g"),Ou="[^"+Du+"]",Ru="[^"+Du.replace("\\.","")+"]",Iu=/((?:WC+[\/:])*)/.source.replace("WC",Ou),Bu=/(WCOD+)?/.source.replace("WCOD",Ru),Nu=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Ou),ku=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Ou),Fu=new RegExp("^"+Iu+Bu+Nu+ku+"$"),Gu=["material","materials","bones"];function Vu(e,t,n){var r=n||zu.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function zu(e,t,n){this.path=t,this.parsedPath=n||zu.parseTrackName(t),this.node=zu.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function Uu(){this.uuid=Rt.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}function ju(e,t,n){this._mixer=e,this._clip=t,this._localRoot=n||null;for(var r=t.tracks,i=r.length,a=new Array(i),o={endingStart:ut,endingEnd:ut},s=0;s!==i;++s){var l=r[s].createInterpolant(null);(a[s]=l).settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(i),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function Hu(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Wu(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}function qu(e,t,n){mo.call(this,e,t),this.meshPerAttribute=n||1}function Ju(e,t,n,r){this.ray=new Hn(e,t),this.near=n||0,this.far=r||1/0,this.camera=null,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function Xu(e,t){return e.distance-t.distance}function Yu(e,t,n,r){if(!1!==e.visible&&(e.raycast(t,n),!0===r))for(var i=e.children,a=0,o=i.length;a<o;a++)Yu(i[a],t,n,!0)}function $u(e,t,n){return this.radius=void 0!==e?e:1,this.phi=void 0!==t?t:0,this.theta=void 0!==n?n:0,this}function Zu(e,t,n){return this.radius=void 0!==e?e:1,this.theta=void 0!==t?t:0,this.y=void 0!==n?n:0,this}Object.assign(Vu.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(zu,{Composite:Vu,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new zu.Composite(e,t,n):new zu(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(Pu,"")},parseTrackName:function(e){var t=Fu.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==Gu.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n},findNode:function(e,t){if(!t||""===t||"root"===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){var r=function(e){for(var n=0;n<e.length;n++){var i=e[n];if(i.name===t||i.uuid===t)return i;var a=r(i.children);if(a)return a}return null},i=r(e.children);if(i)return i}return null}}),Object.assign(zu.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)e[t++]=n[r]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.targetObject[this.propertyName]=e[t]},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,r=t.propertyName,i=t.propertyIndex;if(e||(e=zu.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,e){if(n){var a=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(var o=0;o<e.length;o++)if(e[o].name===a){a=o;break}break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==a){if(void 0===e[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[a]}}var s=e[r];if(void 0!==s){var l=this.Versioning.None;void 0!==(this.targetObject=e).needsUpdate?l=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(l=this.Versioning.MatrixWorldNeedsUpdate);var c=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(o=0;o<this.node.geometry.morphAttributes.position.length;o++)if(e.geometry.morphAttributes.position[o].name===i){i=o;break}}else{if(!e.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(o=0;o<this.node.geometry.morphTargets.length;o++)if(e.geometry.morphTargets[o].name===i){i=o;break}}}c=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(c=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(c=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][l]}else{var u=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+r+" but it wasn't found.",e)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(zu.prototype,{_getValue_unbound:zu.prototype.getValue,_setValue_unbound:zu.prototype.setValue}),Object.assign(Uu.prototype,{isAnimationObjectGroup:!0,add:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._paths,a=this._parsedPaths,o=this._bindings,s=o.length,l=void 0,c=0,u=arguments.length;c!==u;++c){var h=arguments[c],p=h.uuid,d=r[p];if(void 0===d){d=t++,r[p]=d,e.push(h);for(var f=0,m=s;f!==m;++f)o[f].push(new zu(h,i[f],a[f]))}else if(d<n){l=e[d];var g=--n,v=e[g];for(e[r[v.uuid]=d]=v,e[r[p]=g]=h,f=0,m=s;f!==m;++f){var y=o[f],x=y[g],_=y[d];y[d]=x,void 0===_&&(_=new zu(h,i[f],a[f])),y[g]=_}}else e[d]!==l&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var e=this._objects,t=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,i=r.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],l=s.uuid,c=n[l];if(void 0!==c&&t<=c){var u=t++,h=e[u];e[n[h.uuid]=c]=h,e[n[l]=u]=s;for(var p=0,d=i;p!==d;++p){var f=r[p],m=f[u],g=f[c];f[c]=m,f[u]=g}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._bindings,a=i.length,o=0,s=arguments.length;o!==s;++o){var l=arguments[o].uuid,c=r[l];if(void 0!==c)if(delete r[l],c<n){var u=--n,h=e[u],p=e[v=--t];e[r[h.uuid]=c]=h,e[r[p.uuid]=u]=p,e.pop();for(var d=0,f=a;d!==f;++d){var m=(y=i[d])[u],g=y[v];y[c]=m,y[u]=g,y.pop()}}else{var v;for(e[r[(p=e[v=--t]).uuid]=c]=p,e.pop(),d=0,f=a;d!==f;++d){var y;(y=i[d])[c]=y[v],y.pop()}}}this.nCachedObjects_=n},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(void 0!==r)return i[r];var a=this._paths,o=this._parsedPaths,s=this._objects,l=s.length,c=this.nCachedObjects_,u=new Array(l);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(u);for(var h=c,p=s.length;h!==p;++h){var d=s[h];u[h]=new zu(d,e,t)}return u},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){var r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];a[t[e[o]]=n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}}),Object.assign(ju.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(e){return this._startTime=e,this},setLoop:function(e,t){return this.loop=e,this.repetitions=t,this},setEffectiveWeight:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(e){return this._scheduleFading(e,0,1)},fadeOut:function(e){return this._scheduleFading(e,1,0)},crossFadeFrom:function(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){var r=this._clip.duration,i=e._clip.duration,a=i/r,o=r/i;e.warp(1,a,t),this.warp(o,1,t)}return this},crossFadeTo:function(e,t,n){return e.crossFadeFrom(this,t,n)},stopFading:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},setEffectiveTimeScale:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},syncWith:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},halt:function(e){return this.warp(this._effectiveTimeScale,0,e)},warp:function(e,t,n){var r=this._mixer,i=r.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,l=a.sampleValues;return s[0]=i,s[1]=i+n,l[0]=e/o,l[1]=t/o,this},stopWarping:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(e,t,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var a=(e-i)*n;if(a<0||0===n)return;this._startTime=null,t=n*a}t*=this._updateTimeScale(e);var o=this._updateTime(t),s=this._updateWeight(e);if(0<s)for(var l=this._interpolants,c=this._propertyBindings,u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(r,s)}else this._updateWeight(e)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;null!==n&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t},_updateTime:function(e){var t=this.time+e,n=this._clip.duration,r=this.loop,i=this._loopCount,a=2202===r;if(0===e)return-1!==i&&a&&1==(1&i)?n-t:t;if(2200===r){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n<=t)t=n;else{if(!(t<0)){this.time=t;break e}t=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(0<=e?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),n<=t||t<0){var o=Math.floor(t/n);t-=n*o,i+=Math.abs(o);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=0<e?n:0,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<e?1:-1});else{if(1==s){var l=e<0;this._setEndings(l,!l,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=t,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=t;if(a&&1==(1&i))return n-t}return t},_setEndings:function(e,t,n){var r=this._interpolantSettings;n?(r.endingStart=ht,r.endingEnd=ht):(r.endingStart=e?this.zeroSlopeAtStart?ht:ut:pt,r.endingEnd=t?this.zeroSlopeAtEnd?ht:ut:pt)},_scheduleFading:function(e,t,n){var r=this._mixer,i=r.time,a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}}),Hu.prototype=Object.assign(Object.create(Lt.prototype),{constructor:Hu,_bindAction:function(e,t){var n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,l=this._bindingsByRootAndName,c=l[s];void 0===c&&(c={},l[s]=c);for(var u=0;u!==i;++u){var h=r[u],p=h.name,d=c[p];if(void 0!==d)a[u]=d;else{if(void 0!==(d=a[u])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,p));continue}var f=t&&t._propertyBindings[u].binding.parsedPath;++(d=new Lu(zu.create(n,p,f),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(d,s,p),a[u]=d}o[u].resultBuffer=d.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}for(var i=e._propertyBindings,a=0,o=i.length;a!==o;++a){var s=i[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&t<this._nActiveActions},_addInactiveAction:function(e,t,n){var r=this._actions,i=this._actionsByClip,a=i[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=a;else{var o=a.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=r.length,r.push(e),a.actionByRoot[n]=e},_removeInactiveAction:function(e){var t=this._actions,n=t[t.length-1],r=e._cacheIndex;t[n._cacheIndex=r]=n,t.pop(),e._cacheIndex=null;var i=e._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,l=s[s.length-1],c=e._byClipCacheIndex;s[l._byClipCacheIndex=c]=l,s.pop(),e._byClipCacheIndex=null,delete o.actionByRoot[(e._localRoot||this._root).uuid],0===s.length&&delete a[i],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(e){var t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];t[e._cacheIndex=r]=e,t[i._cacheIndex=n]=i},_takeBackAction:function(e){var t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];t[e._cacheIndex=r]=e,t[i._cacheIndex=n]=i},_addInactiveBinding:function(e,t,n){var r=this._bindingsByRootAndName,i=r[t],a=this._bindings;void 0===i&&(i={},r[t]=i),(i[n]=e)._cacheIndex=a.length,a.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,a=this._bindingsByRootAndName,o=a[r],s=t[t.length-1],l=e._cacheIndex;t[s._cacheIndex=l]=s,t.pop(),delete o[i],0===Object.keys(o).length&&delete a[r]},_lendBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];t[e._cacheIndex=r]=e,t[i._cacheIndex=n]=i},_takeBackBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];t[e._cacheIndex=r]=e,t[i._cacheIndex=n]=i},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return void 0===n&&(e[(n=new Vl(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=t]=n),n},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];t[e.__cacheIndex=r]=e,t[i.__cacheIndex=n]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t){var n=t||this._root,r=n.uuid,i="string"==typeof e?$l.findByName(n,e):e,a=null!==i?i.uuid:e,o=this._actionsByClip[a],s=null;if(void 0!==o){var l=o.actionByRoot[r];if(void 0!==l)return l;s=o.knownActions[0],null===i&&(i=s._clip)}if(null===i)return null;var c=new ju(this,i,t);return this._bindAction(c,s),this._addInactiveAction(c,a,r),c},existingAction:function(e,t){var n=t||this._root,r=n.uuid,i="string"==typeof e?$l.findByName(n,e):e,a=i?i.uuid:e,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[r]||null},stopAllAction:function(){var e=this._actions,t=this._nActiveActions,n=this._bindings,r=this._nActiveBindings;this._nActiveActions=0;for(var i=this._nActiveBindings=0;i!==t;++i)e[i].reset();for(i=0;i!==r;++i)n[i].useCount=0;return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1,o=0;o!==n;++o)t[o]._update(r,e,i,a);var s=this._bindings,l=this._nActiveBindings;for(o=0;o!==l;++o)s[o].apply(a);return this},setTime:function(e){for(var t=this.time=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,n=e.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){for(var a=i.knownActions,o=0,s=a.length;o!==s;++o){var l=a[o];this._deactivateAction(l);var c=l._cacheIndex,u=t[t.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,t[u._cacheIndex=c]=u,t.pop(),this._removeInactiveBindingsForAction(l)}delete r[n]}},uncacheRoot:function(e){var t=e.uuid,n=this._actionsByClip;for(var r in n){var i=n[r].actionByRoot[t];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}var a=this._bindingsByRootAndName[t];if(void 0!==a)for(var o in a){var s=a[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(e,t){var n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),Wu.prototype.clone=function(){return new Wu(void 0===this.value.clone?this.value:this.value.clone())},qu.prototype=Object.assign(Object.create(mo.prototype),{constructor:qu,isInstancedInterleavedBuffer:!0,copy:function(e){return mo.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),Object.assign(Ju.prototype,{linePrecision:1,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,t,n){var r=n||[];return Yu(e,this,r,t),r.sort(Xu),r},intersectObjects:function(e,t,n){var r=n||[];if(!1===Array.isArray(e))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var i=0,a=e.length;i<a;i++)Yu(e[i],this,r,t);return r.sort(Xu),r}}),Object.assign($u.prototype,{set:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Rt.clamp(t/this.radius,-1,1))),this}}),Object.assign(Zu.prototype,{set:function(e,t,n){return this.radius=e,this.theta=t,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}});var Ku=new It;function Qu(e,t){this.min=void 0!==e?e:new It(1/0,1/0),this.max=void 0!==t?t:new It(-1/0,-1/0)}Object.assign(Qu.prototype,{set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){var n=Ku.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box2: .getCenter() target is now required"),e=new It),this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box2: .getSize() target is now required"),e=new It),this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new It),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new It),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return Ku.copy(e).clamp(this.min,this.max).sub(e).length()},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var eh=new Wt,th=new Wt;function nh(e,t){this.start=void 0!==e?e:new Wt,this.end=void 0!==t?t:new Wt}function rh(e){yn.call(this),this.material=e,this.render=function(){}}Object.assign(nh.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new Wt),e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new Wt),e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new Wt),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(e,t){eh.subVectors(e,this.start),th.subVectors(this.end,this.start);var n=th.dot(th),r=th.dot(eh)/n;return t&&(r=Rt.clamp(r,0,1)),r},closestPointToPoint:function(e,t,n){var r=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Wt),this.delta(n).multiplyScalar(r).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),((rh.prototype=Object.create(yn.prototype)).constructor=rh).prototype.isImmediateRenderObject=!0;var ih=new Wt;function ah(e,t){yn.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var n=new kr,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,a=1;i<32;i++,a++){var o=i/32*Math.PI*2,s=a/32*Math.PI*2;r.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1)}n.setAttribute("position",new Er(r,3));var l=new Jo({fog:!1});this.cone=new ns(n,l),this.add(this.cone),this.update()}((ah.prototype=Object.create(yn.prototype)).constructor=ah).prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},ah.prototype.update=function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),ih.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(ih),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var oh=new Wt,sh=new Qt,lh=new Qt;function ch(e){for(var t=function e(t){var n=[];t&&t.isBone&&n.push(t);for(var r=0;r<t.children.length;r++)n.push.apply(n,e(t.children[r]));return n}(e),n=new kr,r=[],i=[],a=new cr(0,0,1),o=new cr(0,1,0),s=0;s<t.length;s++){var l=t[s];l.parent&&l.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(a.r,a.g,a.b),i.push(o.r,o.g,o.b))}n.setAttribute("position",new Er(r,3)),n.setAttribute("color",new Er(i,3));var c=new Jo({vertexColors:h,depthTest:!1,depthWrite:!1,transparent:!0});ns.call(this,n,c),this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}function uh(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n;var r=new ul(t,4,2),i=new gr({wireframe:!0,fog:!1});ti.call(this,r,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}((ch.prototype=Object.create(ns.prototype)).constructor=ch).prototype.updateMatrixWorld=function(e){var t=this.bones,n=this.geometry,r=n.getAttribute("position");lh.getInverse(this.root.matrixWorld);for(var i=0,a=0;i<t.length;i++){var o=t[i];o.parent&&o.parent.isBone&&(sh.multiplyMatrices(lh,o.matrixWorld),oh.setFromMatrixPosition(sh),r.setXYZ(a,oh.x,oh.y,oh.z),sh.multiplyMatrices(lh,o.parent.matrixWorld),oh.setFromMatrixPosition(sh),r.setXYZ(a+1,oh.x,oh.y,oh.z),a+=2)}n.getAttribute("position").needsUpdate=!0,yn.prototype.updateMatrixWorld.call(this,e)},((uh.prototype=Object.create(ti.prototype)).constructor=uh).prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},uh.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};var hh=new Wt,ph=new cr,dh=new cr;function fh(e,t,n){yn.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new Ms(t);r.rotateY(.5*Math.PI),this.material=new gr({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=h);var i=r.getAttribute("position"),a=new Float32Array(3*i.count);r.setAttribute("color",new yr(a,3)),this.add(new ti(r,this.material)),this.update()}function mh(e,t,n,r){e=e||10,t=t||10,n=new cr(void 0!==n?n:4473924),r=new cr(void 0!==r?r:8947848);for(var i=t/2,a=e/t,o=e/2,s=[],l=[],c=0,u=0,p=-o;c<=t;c++,p+=a){s.push(-o,0,p,o,0,p),s.push(p,0,-o,p,0,o);var d=c===i?n:r;d.toArray(l,u),u+=3,d.toArray(l,u),u+=3,d.toArray(l,u),u+=3,d.toArray(l,u),u+=3}var f=new kr;f.setAttribute("position",new Er(s,3)),f.setAttribute("color",new Er(l,3));var m=new Jo({vertexColors:h});ns.call(this,f,m)}function gh(e,t,n,r,i,a){e=e||10,t=t||16,n=n||8,r=r||64,i=new cr(void 0!==i?i:4473924),a=new cr(void 0!==a?a:8947848);var o,s,l,c,u,p,d,f=[],m=[];for(c=0;c<=t;c++)l=c/t*(2*Math.PI),o=Math.sin(l)*e,s=Math.cos(l)*e,f.push(0,0,0),f.push(o,0,s),d=1&c?i:a,m.push(d.r,d.g,d.b),m.push(d.r,d.g,d.b);for(c=0;c<=n;c++)for(d=1&c?i:a,p=e-e/n*c,u=0;u<r;u++)l=u/r*(2*Math.PI),o=Math.sin(l)*p,s=Math.cos(l)*p,f.push(o,0,s),m.push(d.r,d.g,d.b),l=(u+1)/r*(2*Math.PI),o=Math.sin(l)*p,s=Math.cos(l)*p,f.push(o,0,s),m.push(d.r,d.g,d.b);var g=new kr;g.setAttribute("position",new Er(f,3)),g.setAttribute("color",new Er(m,3));var v=new Jo({vertexColors:h});ns.call(this,g,v)}((fh.prototype=Object.create(yn.prototype)).constructor=fh).prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},fh.prototype.update=function(){var e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var t=e.geometry.getAttribute("color");ph.copy(this.light.color),dh.copy(this.light.groundColor);for(var n=0,r=t.count;n<r;n++){var i=n<r/2?ph:dh;t.setXYZ(n,i.r,i.g,i.b)}t.needsUpdate=!0}e.lookAt(hh.setFromMatrixPosition(this.light.matrixWorld).negate())},mh.prototype=Object.assign(Object.create(ns.prototype),{constructor:mh,copy:function(e){return ns.prototype.copy.call(this,e),this.geometry.copy(e.geometry),this.material.copy(e.material),this},clone:function(){return(new this.constructor).copy(this)}}),(gh.prototype=Object.create(ns.prototype)).constructor=gh;var vh=new Wt,yh=new Wt,xh=new Wt;function _h(e,t,n){yn.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===t&&(t=1);var r=new kr;r.setAttribute("position",new Er([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var i=new Jo({fog:!1});this.lightPlane=new Qo(r,i),this.add(this.lightPlane),(r=new kr).setAttribute("position",new Er([0,0,0,0,0,1],3)),this.targetLine=new Qo(r,i),this.add(this.targetLine),this.update()}((_h.prototype=Object.create(yn.prototype)).constructor=_h).prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},_h.prototype.update=function(){vh.setFromMatrixPosition(this.light.matrixWorld),yh.setFromMatrixPosition(this.light.target.matrixWorld),xh.subVectors(yh,vh),this.lightPlane.lookAt(yh),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(yh),this.targetLine.scale.z=xh.length()};var bh=new Wt,wh=new vi;function Mh(e){var t=new kr,n=new Jo({color:16777215,vertexColors:1}),r=[],i=[],a={},o=new cr(16755200),s=new cr(16711680),l=new cr(43775),c=new cr(16777215),u=new cr(3355443);function h(e,t,n){p(e,n),p(t,n)}function p(e,t){r.push(0,0,0),i.push(t.r,t.g,t.b),void 0===a[e]&&(a[e]=[]),a[e].push(r.length/3-1)}h("n1","n2",o),h("n2","n4",o),h("n4","n3",o),h("n3","n1",o),h("f1","f2",o),h("f2","f4",o),h("f4","f3",o),h("f3","f1",o),h("n1","f1",o),h("n2","f2",o),h("n3","f3",o),h("n4","f4",o),h("p","n1",s),h("p","n2",s),h("p","n3",s),h("p","n4",s),h("u1","u2",l),h("u2","u3",l),h("u3","u1",l),h("c","t",c),h("p","c",u),h("cn1","cn2",u),h("cn3","cn4",u),h("cf1","cf2",u),h("cf3","cf4",u),t.setAttribute("position",new Er(r,3)),t.setAttribute("color",new Er(i,3)),ns.call(this,t,n),this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}function Sh(e,t,n,r,i,a,o){bh.set(i,a,o).unproject(r);var s=t[e];if(void 0!==s)for(var l=n.getAttribute("position"),c=0,u=s.length;c<u;c++)l.setXYZ(s[c],bh.x,bh.y,bh.z)}((Mh.prototype=Object.create(ns.prototype)).constructor=Mh).prototype.update=function(){var e=this.geometry,t=this.pointMap;wh.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Sh("c",t,e,wh,0,0,-1),Sh("t",t,e,wh,0,0,1),Sh("n1",t,e,wh,-1,-1,-1),Sh("n2",t,e,wh,1,-1,-1),Sh("n3",t,e,wh,-1,1,-1),Sh("n4",t,e,wh,1,1,-1),Sh("f1",t,e,wh,-1,-1,1),Sh("f2",t,e,wh,1,-1,1),Sh("f3",t,e,wh,-1,1,1),Sh("f4",t,e,wh,1,1,1),Sh("u1",t,e,wh,.7,1.1,-1),Sh("u2",t,e,wh,-.7,1.1,-1),Sh("u3",t,e,wh,0,2,-1),Sh("cf1",t,e,wh,-1,0,1),Sh("cf2",t,e,wh,1,0,1),Sh("cf3",t,e,wh,0,-1,1),Sh("cf4",t,e,wh,0,1,1),Sh("cn1",t,e,wh,-1,0,-1),Sh("cn2",t,e,wh,1,0,-1),Sh("cn3",t,e,wh,0,-1,-1),Sh("cn4",t,e,wh,0,1,-1),e.getAttribute("position").needsUpdate=!0};var Th=new Rn;function Eh(e,t){this.object=e,void 0===t&&(t=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new kr;i.setIndex(new yr(n,1)),i.setAttribute("position",new yr(r,3)),ns.call(this,i,new Jo({color:t})),this.matrixAutoUpdate=!1,this.update()}function Ch(e,t){this.type="Box3Helper",this.box=e,t=t||16776960;var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new kr;r.setIndex(new yr(n,1)),r.setAttribute("position",new Er([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),ns.call(this,r,new Jo({color:t})),this.geometry.computeBoundingSphere()}function Ah(e,t,n){this.type="PlaneHelper",this.plane=e,this.size=void 0===t?1:t;var r=void 0!==n?n:16776960,i=new kr;i.setAttribute("position",new Er([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),i.computeBoundingSphere(),Qo.call(this,i,new Jo({color:r}));var a=new kr;a.setAttribute("position",new Er([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),a.computeBoundingSphere(),this.add(new ti(a,new gr({color:r,opacity:.2,transparent:!0,depthWrite:!1})))}((Eh.prototype=Object.create(ns.prototype)).constructor=Eh).prototype.update=function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Th.setFromObject(this.object),!Th.isEmpty()){var t=Th.min,n=Th.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}},Eh.prototype.setFromObject=function(e){return this.object=e,this.update(),this},Eh.prototype.copy=function(e){return ns.prototype.copy.call(this,e),this.object=e.object,this},Eh.prototype.clone=function(){return(new this.constructor).copy(this)},((Ch.prototype=Object.create(ns.prototype)).constructor=Ch).prototype.updateMatrixWorld=function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),yn.prototype.updateMatrixWorld.call(this,e))},((Ah.prototype=Object.create(Qo.prototype)).constructor=Ah).prototype.updateMatrixWorld=function(e){var t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?l:s,this.lookAt(this.plane.normal),yn.prototype.updateMatrixWorld.call(this,e)};var Lh,Dh,Ph=new Wt;function Oh(e,t,n,r,i,a){yn.call(this),void 0===e&&(e=new Wt(0,0,1)),void 0===t&&(t=new Wt(0,0,0)),void 0===n&&(n=1),void 0===r&&(r=16776960),void 0===i&&(i=.2*n),void 0===a&&(a=.2*i),void 0===Lh&&((Lh=new kr).setAttribute("position",new Er([0,0,0,0,1,0],3)),(Dh=new _l(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new Qo(Lh,new Jo({color:r})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new ti(Dh,new gr({color:r})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,a)}function Rh(e){var t=[0,0,0,e=e||1,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new kr;n.setAttribute("position",new Er(t,3)),n.setAttribute("color",new Er([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var r=new Jo({vertexColors:h});ns.call(this,n,r)}((Oh.prototype=Object.create(yn.prototype)).constructor=Oh).prototype.setDirection=function(e){if(.99999<e.y)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Ph.set(e.z,0,-e.x).normalize();var t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Ph,t)}},Oh.prototype.setLength=function(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},Oh.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},Oh.prototype.copy=function(e){return yn.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},Oh.prototype.clone=function(){return(new this.constructor).copy(this)},(Rh.prototype=Object.create(ns.prototype)).constructor=Rh;var Ih=4,Bh=8,Nh=Math.pow(2,Bh),kh=[.125,.215,.35,.446,.526,.582],Fh=Bh-Ih+1+kh.length,Gh=20,Vh={};Vh[dt]=0,Vh[ft]=1,Vh[gt]=2,Vh[yt]=3,Vh[xt]=4,Vh[_t]=5,Vh[mt]=6;var zh,Uh,jh=new Vc,Hh=((Uh=new Cl({defines:{n:zh=Gh},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:new Float32Array(zh)},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:new Wt(0,1,0)},inputEncoding:{value:Vh[dt]},outputEncoding:{value:Vh[dt]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n\n\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t\n\n#define ENVMAP_TYPE_CUBE_UV\n#include <cube_uv_reflection_fragment>\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tfor (int i = 0; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfor (int dir = -1; dir < 2; dir += 2) {\n\t\t\tif (i == 0 && dir == 1)\n\t\t\t\tcontinue;\n\t\t\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\t\t\tif (all(equal(axis, vec3(0.0))))\n\t\t\t\taxis = cross(vec3(0.0, 1.0, 0.0), vOutputDirection);\n\t\t\taxis = normalize(axis);\n\t\t\tfloat theta = dTheta * float(dir * i);\n\t\t\tfloat cosTheta = cos(theta);\n\t\t\t// Rodrigues' axis-angle rotation\n\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross(axis, vOutputDirection) * sin(theta)\n\t\t\t\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\t\t\tgl_FragColor.rgb +=\n\t\t\t\t\tweights[i] * bilinearCubeUV(envMap, sampleDirection, mipInt);\n\t\t}\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t",blending:p,depthTest:!1,depthWrite:!1})).type="SphericalGaussianBlur",Uh),Wh=null,qh=null,Jh=function(){for(var e=[],t=[],n=[],r=Bh,i=0;i<Fh;i++){var a=Math.pow(2,r);t.push(a);var o=1/a;Bh-Ih<i?o=kh[i-Bh+Ih-1]:0==i&&(o=0),n.push(o);for(var s=1/(a-1),l=-s/2,c=1+s/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=new Float32Array(108),p=new Float32Array(72),d=new Float32Array(36),f=0;f<6;f++){var m=f%3*2/3-1,g=2<f?0:-1,v=[m,g,0,m+2/3,g,0,m+2/3,1+g,0,m,g,0,m+2/3,1+g,0,m,1+g,0];h.set(v,18*f),p.set(u,12*f);var y=[f,f,f,f,f,f];d.set(y,6*f)}var x=new kr;x.setAttribute("position",new yr(h,3)),x.setAttribute("uv",new yr(p,2)),x.setAttribute("faceIndex",new yr(d,1)),e.push(x),Ih<r&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}(),Xh=Jh._lodPlanes,Yh=Jh._sizeLods,$h=Jh._sigmas,Zh=null,Kh=null,Qh=null,ep=(1+Math.sqrt(5))/2,tp=1/ep,np=[new Wt(1,1,1),new Wt(-1,1,1),new Wt(1,1,-1),new Wt(-1,1,-1),new Wt(0,ep,tp),new Wt(0,ep,-tp),new Wt(tp,0,ep),new Wt(-tp,0,ep),new Wt(ep,tp,0),new Wt(-ep,tp,0)];function rp(e){Kh=e,op(Hh)}function ip(e){var t={magFilter:se,minFilter:se,generateMipmaps:!1,type:e?e.type:de,format:e?e.format:De,encoding:e?e.encoding:gt,depthBuffer:!1,stencilBuffer:!1},n=sp(t);return n.depthBuffer=!e,Zh=sp(t),n}function ap(e){Zh.dispose(),Kh.setRenderTarget(Qh),e.scissorTest=!1,e.setSize(e.width,e.height)}function op(e){var t=new xn;t.add(new ti(Xh[0],e)),Kh.compile(t,jh)}function sp(e){var t=new Vt(3*Nh,3*Nh,e);return t.texture.mapping=ne,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function lp(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function cp(e){var t=Kh.autoClear;Kh.autoClear=!1;for(var n=1;n<Fh;n++)up(e,n-1,n,Math.sqrt($h[n]*$h[n]-$h[n-1]*$h[n-1]),np[(n-1)%np.length]);Kh.autoClear=t}function up(e,t,n,r,i){hp(e,Zh,t,n,r,"latitudinal",i),hp(Zh,e,n,n,r,"longitudinal",i)}function hp(e,t,n,r,i,a,o){"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");var s=new xn;s.add(new ti(Xh[r],Hh));var l=Hh.uniforms,c=Yh[n]-1,u=isFinite(i)?Math.PI/(2*c):2*Math.PI/(2*Gh-1),h=i/u,p=isFinite(i)?1+Math.floor(3*h):Gh;Gh<p&&console.warn("sigmaRadians, "+i+", is too large and will clip, as it requested "+p+" samples when the maximum is set to "+Gh);for(var d=[],f=0,m=0;m<Gh;++m){var g=m/h,v=Math.exp(-g*g/2);d.push(v),0==m?f+=v:m<p&&(f+=2*v)}for(m=0;m<d.length;m++)d[m]=d[m]/f;l.envMap.value=e.texture,l.samples.value=p,l.weights.value=d,l.latitudinal.value="latitudinal"===a,o&&(l.poleAxis.value=o),l.dTheta.value=u,l.mipInt.value=Bh-n,l.inputEncoding.value=Vh[e.texture.encoding],l.outputEncoding.value=Vh[e.texture.encoding];var y=Yh[r];lp(t,g=3*Math.max(0,Nh-2*y),(0===r?0:2*Nh)+2*y*(Bh-Ih<r?r-Bh+Ih:0),3*y,2*y),Kh.setRenderTarget(t),Kh.render(s,jh)}function pp(){var e=new Cl({uniforms:{envMap:{value:null},texelSize:{value:new It(1,1)},inputEncoding:{value:Vh[dt]},outputEncoding:{value:Vh[dt]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform vec2 texelSize;\n\n\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t\n\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tvec3 outputDirection = normalize(vOutputDirection);\n\tvec2 uv;\n\tuv.y = asin(clamp(outputDirection.y, -1.0, 1.0)) * RECIPROCAL_PI + 0.5;\n\tuv.x = atan(outputDirection.z, outputDirection.x) * RECIPROCAL_PI2 + 0.5;\n\tvec2 f = fract(uv / texelSize - 0.5);\n\tuv -= f * texelSize;\n\tvec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x += texelSize.x;\n\tvec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.y += texelSize.y;\n\tvec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x -= texelSize.x;\n\tvec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tvec3 tm = mix(tl, tr, f.x);\n\tvec3 bm = mix(bl, br, f.x);\n\tgl_FragColor.rgb = mix(tm, bm, f.y);\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t",blending:p,depthTest:!1,depthWrite:!1});return e.type="EquirectangularToCubeUV",e}function dp(){var e=new Cl({uniforms:{envMap:{value:null},inputEncoding:{value:Vh[dt]},outputEncoding:{value:Vh[dt]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform samplerCube envMap;\n\n\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb = envMapTexelToLinear(textureCube(envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ))).rgb;\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t",blending:p,depthTest:!1,depthWrite:!1});return e.type="CubemapToCubeUV",e}function fp(e){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),yc.call(this,e),this.type="catmullrom",this.closed=!0}function mp(e){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),yc.call(this,e),this.type="catmullrom"}function gp(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),yc.call(this,e),this.type="catmullrom"}rp.prototype={constructor:rp,fromScene:function(e,t,n,r){void 0===t&&(t=0),void 0===n&&(n=.1),void 0===r&&(r=100),Qh=Kh.getRenderTarget();var i=ip();return function(e,t,n,r){var i=new yi(90,1,t,n),a=[1,1,1,1,-1,1],o=[1,1,-1,-1,-1,1],s=Kh.outputEncoding,l=Kh.toneMapping,c=Kh.toneMappingExposure,u=Kh.getClearColor(),h=Kh.getClearAlpha();Kh.toneMapping=q,Kh.toneMappingExposure=1,Kh.outputEncoding=dt,e.scale.z*=-1;var p=e.background;if(p&&p.isColor){p.convertSRGBToLinear();var d=Math.max(p.r,p.g,p.b),f=Math.min(Math.max(Math.ceil(Math.log2(d)),-128),127);p=p.multiplyScalar(Math.pow(2,-f));var m=(f+128)/255;Kh.setClearColor(p,m),e.background=null}for(var g=0;g<6;g++){var v=g%3;0==v?(i.up.set(0,a[g],0),i.lookAt(o[g],0,0)):1==v?(i.up.set(0,0,a[g]),i.lookAt(0,o[g],0)):(i.up.set(0,a[g],0),i.lookAt(0,0,o[g])),lp(r,v*Nh,2<g?Nh:0,Nh,Nh),Kh.setRenderTarget(r),Kh.render(e,i)}Kh.toneMapping=l,Kh.toneMappingExposure=c,Kh.outputEncoding=s,Kh.setClearColor(u,h),e.scale.z*=-1}(e,n,r,i),0<t&&up(i,0,0,t),cp(i),ap(i),i},fromEquirectangular:function(e){return e.magFilter=se,e.minFilter=se,e.generateMipmaps=!1,this.fromCubemap(e)},fromCubemap:function(e){Qh=Kh.getRenderTarget();var t=ip(e);return function(e,t){var n=new xn;e.isCubeTexture?null==qh&&(qh=dp()):null==Wh&&(Wh=pp());var r=e.isCubeTexture?qh:Wh;n.add(new ti(Xh[0],r));var i=r.uniforms;(i.envMap.value=e).isCubeTexture||i.texelSize.value.set(1/e.image.width,1/e.image.height),i.inputEncoding.value=Vh[e.encoding],i.outputEncoding.value=Vh[e.encoding],lp(t,0,0,3*Nh,2*Nh),Kh.setRenderTarget(t),Kh.render(n,jh)}(e,t),cp(t),ap(t),t},compileCubemapShader:function(){null==qh&&op(qh=dp())},compileEquirectangularShader:function(){null==Wh&&op(Wh=pp())},dispose:function(){Hh.dispose(),null!=qh&&qh.dispose(),null!=Wh&&Wh.dispose();for(var e=0;e<Xh.length;e++)Xh[e].dispose()}},uc.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(uc.prototype),(e.prototype.constructor=e).prototype.getPoint=t,e},Object.assign(Dc.prototype,{createPointsGeometry:function(e){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var t=new li,n=0,r=e.length;n<r;n++){var i=e[n];t.vertices.push(new Wt(i.x,i.y,i.z||0))}return t}}),Object.assign(Pc.prototype,{fromPoints:function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),fp.prototype=Object.create(yc.prototype),mp.prototype=Object.create(yc.prototype),gp.prototype=Object.create(yc.prototype),Object.assign(gp.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),mh.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},ch.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(tc.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),qc.extractUrlBase(e)}}),tc.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(Zc.prototype,{setTexturePath:function(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}),Object.assign(Qu.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(Rn.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Si.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},nh.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(Rt,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),Rt.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),Rt.ceilPowerOfTwo(e)}}),Object.assign(Bt.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(Qt.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new Wt).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,r,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,a)}}),Xn.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},Ut.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},Object.assign(Hn.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(ar.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(ar,{barycoordFromPoint:function(e,t,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),ar.getBarycoord(e,t,n,r,i)},normal:function(e,t,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),ar.getNormal(e,t,n,r)}}),Object.assign(Oc.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new rl(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new ml(this,e)}}),Object.assign(It.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Wt.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Gt.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(li.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.assign(yn.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(yn.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(ti.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(ti.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(No.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Vo.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),ko.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(uc.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),yi.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(Rc.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(yr.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===At},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(At)}}}),Object.assign(yr.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?At:Ct),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(kr.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addAttribute:function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new yr(t,arguments[2])))},addDrawCall:function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},applyMatrix:function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(kr.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(mo.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===At},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign(mo.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?At:Ct),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(il.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(Wu.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(mr.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new cr}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===e}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),Object.defineProperties(Dl.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(gi.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(ho.prototype,{clearTarget:function(e,t,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,r)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(ho.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?ft:dt}}}),Object.defineProperties(io.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(Vt.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(wu.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return(new lu).load(e,function(e){t.setBuffer(e)}),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),Au.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},xi.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)};var vp={merge:function(e,t,n){var r;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),t.isMesh&&(t.matrixAutoUpdate&&t.updateMatrix(),r=t.matrix,t=t.geometry),e.merge(t,r,n)},center:function(e){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),e.center()}};Nt.crossOrigin=void 0,Nt.loadTexture=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new cc;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},Nt.loadTextureCube=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new lc;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},Nt.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Nt.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var yp={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")}};"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"113"}})),e.ACESFilmicToneMapping=$,e.AddEquation=y,e.AddOperation=H,e.AdditiveBlending=f,e.AlphaFormat=Te,e.AlwaysDepth=B,e.AlwaysStencilFunc=Et,e.AmbientLight=jc,e.AmbientLightProbe=pu,e.AnimationClip=$l,e.AnimationLoader=ic,e.AnimationMixer=Hu,e.AnimationObjectGroup=Uu,e.AnimationUtils=kl,e.ArcCurve=pc,e.ArrayCamera=lo,e.ArrowHelper=Oh,e.Audio=wu,e.AudioAnalyser=Au,e.AudioContext=su,e.AudioListener=bu,e.AudioLoader=lu,e.AxesHelper=Rh,e.AxisHelper=function(e){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Rh(e)},e.BackSide=l,e.BasicDepthPacking=bt,e.BasicShadowMap=0,e.BinaryTextureLoader=function(e){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new oc(e)},e.Bone=zo,e.BooleanKeyframeTrack=jl,e.BoundingBoxHelper=function(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Eh(e,t)},e.Box2=Qu,e.Box3=Rn,e.Box3Helper=Ch,e.BoxBufferGeometry=ui,e.BoxGeometry=ci,e.BoxHelper=Eh,e.BufferAttribute=yr,e.BufferGeometry=kr,e.BufferGeometryLoader=Yc,e.ByteType=fe,e.Cache=Kl,e.Camera=vi,e.CameraHelper=Mh,e.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been removed")},e.CanvasTexture=ds,e.CatmullRomCurve3=yc,e.CineonToneMapping=Y,e.CircleBufferGeometry=Sl,e.CircleGeometry=Ml,e.ClampToEdgeWrapping=ae,e.Clock=gu,e.ClosedSplineCurve3=fp,e.Color=cr,e.ColorKeyframeTrack=Hl,e.CompressedTexture=ps,e.CompressedTextureLoader=ac,e.ConeBufferGeometry=wl,e.ConeGeometry=bl,e.CubeCamera=xi,e.CubeGeometry=ci,e.CubeReflectionMapping=Z,e.CubeRefractionMapping=K,e.CubeTexture=Ri,e.CubeTextureLoader=lc,e.CubeUVReflectionMapping=ne,e.CubeUVRefractionMapping=re,e.CubicBezierCurve=wc,e.CubicBezierCurve3=Mc,e.CubicInterpolant=Gl,e.CullFaceBack=n,e.CullFaceFront=r,e.CullFaceFrontBack=3,e.CullFaceNone=t,e.Curve=uc,e.CurvePath=Dc,e.CustomBlending=v,e.CylinderBufferGeometry=_l,e.CylinderGeometry=xl,e.Cylindrical=Zu,e.DataTexture=bi,e.DataTexture2DArray=Ii,e.DataTexture3D=Bi,e.DataTextureLoader=oc,e.DecrementStencilOp=7683,e.DecrementWrapStencilOp=34056,e.DefaultLoadingManager=ec,e.DepthFormat=Pe,e.DepthStencilFormat=Oe,e.DepthTexture=fs,e.DirectionalLight=Uc,e.DirectionalLightHelper=_h,e.DirectionalLightShadow=zc,e.DiscreteInterpolant=zl,e.DodecahedronBufferGeometry=Cs,e.DodecahedronGeometry=Es,e.DoubleSide=c,e.DstAlphaFactor=L,e.DstColorFactor=P,e.DynamicBufferAttribute=function(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new yr(e,t).setUsage(At)},e.DynamicCopyUsage=35050,e.DynamicDrawUsage=At,e.DynamicReadUsage=35049,e.EdgesGeometry=yl,e.EdgesHelper=function(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new ns(new yl(e.geometry),new Jo({color:void 0!==t?t:16777215}))},e.EllipseCurve=hc,e.EqualDepth=F,e.EqualStencilFunc=514,e.EquirectangularReflectionMapping=Q,e.EquirectangularRefractionMapping=ee,e.Euler=nn,e.EventDispatcher=Lt,e.ExtrudeBufferGeometry=il,e.ExtrudeGeometry=rl,e.Face3=dr,e.Face4=function(e,t,n,r,i,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new dr(e,t,n,i,a,o)},e.FaceColors=1,e.FileLoader=rc,e.FlatShading=1,e.Float32Attribute=function(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Er(e,t)},e.Float32BufferAttribute=Er,e.Float64Attribute=function(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Cr(e,t)},e.Float64BufferAttribute=Cr,e.FloatType=xe,e.Fog=fo,e.FogExp2=po,e.Font=iu,e.FontLoader=ou,e.FrontFaceDirectionCCW=1,e.FrontFaceDirectionCW=0,e.FrontSide=s,e.Frustum=Si,e.GammaEncoding=mt,e.Geometry=li,e.GeometryUtils=vp,e.GreaterDepth=V,e.GreaterEqualDepth=G,e.GreaterEqualStencilFunc=518,e.GreaterStencilFunc=516,e.GridHelper=mh,e.Group=co,e.HalfFloatType=_e,e.HemisphereLight=Ic,e.HemisphereLightHelper=fh,e.HemisphereLightProbe=hu,e.IcosahedronBufferGeometry=Ts,e.IcosahedronGeometry=Ss,e.ImageBitmapLoader=nu,e.ImageLoader=sc,e.ImageUtils=Nt,e.ImmediateRenderObject=rh,e.IncrementStencilOp=7682,e.IncrementWrapStencilOp=34055,e.InstancedBufferAttribute=Xc,e.InstancedBufferGeometry=Jc,e.InstancedInterleavedBuffer=qu,e.InstancedMesh=qo,e.Int16Attribute=function(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new wr(e,t)},e.Int16BufferAttribute=wr,e.Int32Attribute=function(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Sr(e,t)},e.Int32BufferAttribute=Sr,e.Int8Attribute=function(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new xr(e,t)},e.Int8BufferAttribute=xr,e.IntType=ve,e.InterleavedBuffer=mo,e.InterleavedBufferAttribute=yo,e.Interpolant=Fl,e.InterpolateDiscrete=lt,e.InterpolateLinear=ct,e.InterpolateSmooth=2302,e.InvertStencilOp=5386,e.JSONLoader=function(){console.error("THREE.JSONLoader has been removed.")},e.KeepStencilOp=Tt,e.KeyframeTrack=Ul,e.LOD=No,e.LatheBufferGeometry=fl,e.LatheGeometry=dl,e.Layers=rn,e.LensFlare=function(){console.error("THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js")},e.LessDepth=N,e.LessEqualDepth=k,e.LessEqualStencilFunc=515,e.LessStencilFunc=513,e.Light=Rc,e.LightProbe=uu,e.LightShadow=Bc,e.Line=Qo,e.Line3=nh,e.LineBasicMaterial=Jo,e.LineCurve=Sc,e.LineCurve3=Tc,e.LineDashedMaterial=Bl,e.LineLoop=rs,e.LinePieces=1,e.LineSegments=ns,e.LineStrip=0,e.LinearEncoding=dt,e.LinearFilter=ue,e.LinearInterpolant=Vl,e.LinearMipMapLinearFilter=1008,e.LinearMipMapNearestFilter=1007,e.LinearMipmapLinearFilter=pe,e.LinearMipmapNearestFilter=he,e.LinearToneMapping=q,e.Loader=tc,e.LoaderUtils=qc,e.LoadingManager=Ql,e.LogLuvEncoding=vt,e.LoopOnce=2200,e.LoopPingPong=2202,e.LoopRepeat=2201,e.LuminanceAlphaFormat=Le,e.LuminanceFormat=Ae,e.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},e.Material=mr,e.MaterialLoader=Wc,e.Math=Rt,e.MathUtils=Rt,e.Matrix3=Bt,e.Matrix4=Qt,e.MaxEquation=w,e.Mesh=ti,e.MeshBasicMaterial=gr,e.MeshDepthMaterial=eo,e.MeshDistanceMaterial=to,e.MeshFaceMaterial=function(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e},e.MeshLambertMaterial=Rl,e.MeshMatcapMaterial=Il,e.MeshNormalMaterial=Ol,e.MeshPhongMaterial=Dl,e.MeshPhysicalMaterial=Ll,e.MeshStandardMaterial=Al,e.MeshToonMaterial=Pl,e.MinEquation=b,e.MirroredRepeatWrapping=oe,e.MixOperation=j,e.MultiMaterial=function(e){return void 0===e&&(e=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,(e.materials=e).clone=function(){return e.slice()},e},e.MultiplyBlending=g,e.MultiplyOperation=U,e.NearestFilter=se,e.NearestMipMapLinearFilter=1005,e.NearestMipMapNearestFilter=1004,e.NearestMipmapLinearFilter=ce,e.NearestMipmapNearestFilter=le,e.NeverDepth=I,e.NeverStencilFunc=512,e.NoBlending=p,e.NoColors=u,e.NoToneMapping=W,e.NormalBlending=d,e.NotEqualDepth=z,e.NotEqualStencilFunc=517,e.NumberKeyframeTrack=Wl,e.Object3D=yn,e.ObjectLoader=Zc,e.ObjectSpaceNormalMap=St,e.OctahedronBufferGeometry=Ms,e.OctahedronGeometry=ws,e.OneFactor=S,e.OneMinusDstAlphaFactor=D,e.OneMinusDstColorFactor=O,e.OneMinusSrcAlphaFactor=A,e.OneMinusSrcColorFactor=E,e.OrthographicCamera=Vc,e.PCFShadowMap=i,e.PCFSoftShadowMap=a,e.PMREMGenerator=rp,e.ParametricBufferGeometry=vs,e.ParametricGeometry=gs,e.Particle=function(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Oo(e)},e.ParticleBasicMaterial=function(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new is(e)},e.ParticleSystem=function(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new cs(e,t)},e.ParticleSystemMaterial=function(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new is(e)},e.Path=Pc,e.PerspectiveCamera=yi,e.Plane=Xn,e.PlaneBufferGeometry=Ai,e.PlaneGeometry=Ci,e.PlaneHelper=Ah,e.PointCloud=function(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new cs(e,t)},e.PointCloudMaterial=function(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new is(e)},e.PointLight=Gc,e.PointLightHelper=uh,e.Points=cs,e.PointsMaterial=is,e.PolarGridHelper=gh,e.PolyhedronBufferGeometry=xs,e.PolyhedronGeometry=ys,e.PositionalAudio=Cu,e.PropertyBinding=zu,e.PropertyMixer=Lu,e.QuadraticBezierCurve=Ec,e.QuadraticBezierCurve3=Cc,e.Quaternion=Ut,e.QuaternionKeyframeTrack=Jl,e.QuaternionLinearInterpolant=ql,e.REVISION="113",e.RGBADepthPacking=wt,e.RGBAFormat=Ce,e.RGBAIntegerFormat=Fe,e.RGBA_ASTC_10x10_Format=at,e.RGBA_ASTC_10x5_Format=nt,e.RGBA_ASTC_10x6_Format=rt,e.RGBA_ASTC_10x8_Format=it,e.RGBA_ASTC_12x10_Format=ot,e.RGBA_ASTC_12x12_Format=st,e.RGBA_ASTC_4x4_Format=Xe,e.RGBA_ASTC_5x4_Format=Ye,e.RGBA_ASTC_5x5_Format=$e,e.RGBA_ASTC_6x5_Format=Ze,e.RGBA_ASTC_6x6_Format=Ke,e.RGBA_ASTC_8x5_Format=Qe,e.RGBA_ASTC_8x6_Format=et,e.RGBA_ASTC_8x8_Format=tt,e.RGBA_PVRTC_2BPPV1_Format=qe,e.RGBA_PVRTC_4BPPV1_Format=We,e.RGBA_S3TC_DXT1_Format=Ve,e.RGBA_S3TC_DXT3_Format=ze,e.RGBA_S3TC_DXT5_Format=Ue,e.RGBDEncoding=_t,e.RGBEEncoding=gt,e.RGBEFormat=De,e.RGBFormat=Ee,e.RGBIntegerFormat=ke,e.RGBM16Encoding=xt,e.RGBM7Encoding=yt,e.RGB_ETC1_Format=Je,e.RGB_PVRTC_2BPPV1_Format=He,e.RGB_PVRTC_4BPPV1_Format=je,e.RGB_S3TC_DXT1_Format=Ge,e.RGFormat=Be,e.RGIntegerFormat=Ne,e.RawShaderMaterial=Cl,e.Ray=Hn,e.Raycaster=Ju,e.RectAreaLight=Hc,e.RedFormat=Re,e.RedIntegerFormat=Ie,e.ReinhardToneMapping=J,e.RepeatWrapping=ie,e.ReplaceStencilOp=7681,e.ReverseSubtractEquation=_,e.RingBufferGeometry=pl,e.RingGeometry=hl,e.Scene=xn,e.SceneUtils=yp,e.ShaderChunk=Li,e.ShaderLib=Di,e.ShaderMaterial=gi,e.ShadowMaterial=El,e.Shape=Oc,e.ShapeBufferGeometry=gl,e.ShapeGeometry=ml,e.ShapePath=ru,e.ShapeUtils=el,e.ShortType=me,e.Skeleton=Vo,e.SkeletonHelper=ch,e.SkinnedMesh=ko,e.SmoothShading=2,e.Sphere=Nn,e.SphereBufferGeometry=ul,e.SphereGeometry=cl,e.Spherical=$u,e.SphericalHarmonics3=cu,e.SphericalReflectionMapping=te,e.Spline=gp,e.SplineCurve=Ac,e.SplineCurve3=mp,e.SpotLight=kc,e.SpotLightHelper=ah,e.SpotLightShadow=Nc,e.Sprite=Oo,e.SpriteMaterial=xo,e.SrcAlphaFactor=C,e.SrcAlphaSaturateFactor=R,e.SrcColorFactor=T,e.StaticCopyUsage=35046,e.StaticDrawUsage=Ct,e.StaticReadUsage=35045,e.StereoCamera=mu,e.StreamCopyUsage=35042,e.StreamDrawUsage=35040,e.StreamReadUsage=35041,e.StringKeyframeTrack=Xl,e.SubtractEquation=x,e.SubtractiveBlending=m,e.TOUCH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},e.TangentSpaceNormalMap=Mt,e.TetrahedronBufferGeometry=bs,e.TetrahedronGeometry=_s,e.TextBufferGeometry=ll,e.TextGeometry=sl,e.Texture=Ft,e.TextureLoader=cc,e.TorusBufferGeometry=Rs,e.TorusGeometry=Os,e.TorusKnotBufferGeometry=Ps,e.TorusKnotGeometry=Ds,e.Triangle=ar,e.TriangleFanDrawMode=2,e.TriangleStripDrawMode=1,e.TrianglesDrawMode=0,e.TubeBufferGeometry=Ls,e.TubeGeometry=As,e.UVMapping=300,e.Uint16Attribute=function(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Mr(e,t)},e.Uint16BufferAttribute=Mr,e.Uint32Attribute=function(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Tr(e,t)},e.Uint32BufferAttribute=Tr,e.Uint8Attribute=function(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new _r(e,t)},e.Uint8BufferAttribute=_r,e.Uint8ClampedAttribute=function(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new br(e,t)},e.Uint8ClampedBufferAttribute=br,e.Uncharted2ToneMapping=X,e.Uniform=Wu,e.UniformsLib=Ti,e.UniformsUtils=di,e.UnsignedByteType=de,e.UnsignedInt248Type=Se,e.UnsignedIntType=ye,e.UnsignedShort4444Type=be,e.UnsignedShort5551Type=we,e.UnsignedShort565Type=Me,e.UnsignedShortType=ge,e.VSMShadowMap=o,e.Vector2=It,e.Vector3=Wt,e.Vector4=Gt,e.VectorKeyframeTrack=Yl,e.Vertex=function(e,t,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new Wt(e,t,n)},e.VertexColors=h,e.VideoTexture=hs,e.WebGLCubeRenderTarget=_i,e.WebGLMultisampleRenderTarget=zt,e.WebGLRenderTarget=Vt,e.WebGLRenderTargetCube=function(e,t,n){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new _i(e,n)},e.WebGLRenderer=ho,e.WebGLUtils=oo,e.WireframeGeometry=ms,e.WireframeHelper=function(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new ns(new ms(e.geometry),new Jo({color:void 0!==t?t:16777215}))},e.WrapAroundEnding=pt,e.XHRLoader=function(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new rc(e)},e.ZeroCurvatureEnding=ut,e.ZeroFactor=M,e.ZeroSlopeEnding=ht,e.ZeroStencilOp=0,e.sRGBEncoding=ft,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof n&&void 0!==t?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i((r=r||self).THREE={})},{}],20:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.McEdJigOsnap=n.McEdImpJigGlobalData=n.MxOsnapDefine=void 0;var r,i,a,o,s,l,c,u,h,p,d,f=e("three"),m=e("./MxDrawObject"),g=e("./MxFun"),v=e("./MxJigCmdManager"),y=e("./MxTools"),x=e("./MxDrawData"),_=e("./MxWindowsEvent");(i=r=n.MxOsnapDefine||(n.MxOsnapDefine={}))[i.OsModeInvalid=0]="OsModeInvalid",i[i.OsModeEnd=1]="OsModeEnd",i[i.OsModeMid=2]="OsModeMid",i[i.OsModeCen=4]="OsModeCen",i[i.OsModeNode=8]="OsModeNode",i[i.OsModeQuad=16]="OsModeQuad",i[i.OsModeInt=32]="OsModeInt",i[i.OsModeIns=64]="OsModeIns",i[i.OsModePerp=128]="OsModePerp",i[i.OsModeTan=256]="OsModeTan",i[i.OsModeNear=512]="OsModeNear",i[i.OsModeApp=2048]="OsModeApp",i[i.OsModeExt=4096]="OsModeExt",i[i.OsModePar=8192]="OsModePar",i[i.OsModeOff=16384]="OsModeOff",i[i.OsModeAll=16383]="OsModeAll",o=a=n.McEdImpJigGlobalData||(n.McEdImpJigGlobalData={}),s=!1,l=new f.Vector3,c=new f.Vector3,u=0,p=h=!1,d=new Array,o.setPrvPoint=function(e){l=e,p=!0},o.isOsnapZValue=function(){return!1},o.setIsValidPrvpoint=function(e){p=e},o.isValidPrvpoint=function(){return p},o.getPrvPoint=function(){return l},o.setIsValidBasepoint=function(e){s=e},o.isValidBasepoint=function(){return s},o.setBasepoint=function(e){s=!0,c=e},o.getBasepoint=function(){return c},o.initStartCommand=function(){h=s=!1},o.setIsTmpDisableOsmode=function(e){h=e},o.isTmpDisableOsmode=function(){return h},o.intiStartDrag=function(e){u=e.sysVariable().getSysVarNumber("OSMODE")},o.isEnableOsmode=function(){return!(0==u||u&r.OsModeOff||h)},o.getOSmode=function(){return u},o.addDynDrawObject=function(e){d.push(e)},o.clearDisplay=function(e){for(var t=d.length,n=0;n<t;n++)g.MxFun.removeThreejsObject(d[n],e)};var b=(w.prototype.drawLine=function(e,t,n){var r=new f.Geometry,i=new f.LineBasicMaterial({color:this.m_iColor});r.vertices.push(new f.Vector3(e.x,e.y,e.z),new f.Vector3(t.x,t.y,t.z));var o=new f.Line(r,i);n.add(o),a.addDynDrawObject(o)},w.prototype.drawPolyline=function(e,t){for(var n=new f.Geometry,r=new f.LineBasicMaterial({color:this.m_iColor}),i=e.length,o=0;o<i;o++)n.vertices.push(new f.Vector3(e[o].x,e[o].y,e[o].z));var s=new f.Line(n,r);t.add(s),a.addDynDrawObject(s)},w.prototype.setWidth=function(e){this.m_dOsmodeWdith=e},w.prototype.GetDrawRect=function(){var e=.5*this.m_dOsmodeWdith,t={};return t.left=this.m_pt.x-e,t.right=this.m_pt.x+e,t.top=this.m_pt.y-e,t.bottom=this.m_pt.y+e,t},w.prototype.DrawNear=function(e){var t=this.GetDrawRect(),n=[new f.Vector3,new f.Vector3];n[0].x=t.left,n[0].y=t.top,n[1].x=t.right,n[1].y=t.top,this.drawLine(n[0],n[1],e),n[0].x=t.left,n[0].y=t.bottom,n[1].x=t.right,n[1].y=t.bottom,this.drawLine(n[0],n[1],e),n[0].x=t.right,n[0].y=t.top,n[1].x=t.left,n[1].y=t.bottom,this.drawLine(n[0],n[1],e),n[0].x=t.right,n[0].y=t.bottom,n[1].x=t.left,n[1].y=t.top,this.drawLine(n[0],n[1],e)},w.prototype.DrawEnd=function(e){var t=this.GetDrawRect(),n=[new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3];n[0].x=t.left,n[0].y=t.top,n[1].x=t.right,n[1].y=t.top,n[2].x=t.right,n[2].y=t.bottom,n[3].x=t.left,n[3].y=t.bottom,this.drawLine(n[0],n[1],e),this.drawLine(n[1],n[2],e),this.drawLine(n[2],n[3],e),this.drawLine(n[3],n[0],e)},w.prototype.DrawMid=function(e){var t=this.GetDrawRect(),n=1.2*(t.right-t.left),r=n/2/Math.sin(60*3.14159265/180),i=r*Math.sin(.5235987750000001),a=new f.Vector3(this.m_pt.x,this.m_pt.y,this.m_pt.z);a.y-=r;var o=new f.Vector3;o.x=this.m_pt.x+n/2,o.y=this.m_pt.y+i;var s=new f.Vector3;s.x=this.m_pt.x-n/2,s.y=this.m_pt.y+i;var l=[new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3];l[0].x=a.x,l[0].y=a.y,l[1].x=o.x,l[1].y=o.y,l[2].x=s.x,l[2].y=s.y,l[3].x=a.x,l[3].y=a.y,this.drawLine(l[0],l[1],e),this.drawLine(l[1],l[2],e),this.drawLine(l[2],l[3],e)},w.prototype.DrawPerp=function(e){var t=this.GetDrawRect(),n=[new f.Vector3,new f.Vector3,new f.Vector3];n[0].x=t.left,n[0].y=t.top,n[1].x=t.left,n[1].y=t.bottom,n[2].x=t.right,n[2].y=t.bottom,this.drawPolyline(n,e),n[0].x=t.left,n[0].y=this.m_pt.y,n[1].x=this.m_pt.x,n[1].y=this.m_pt.y,n[2].x=this.m_pt.x,n[2].y=t.bottom,this.drawPolyline(n,e)},w.prototype.DrawCircle=function(e,t,n){null==n&&(n=.5*this.m_dOsmodeWdith);for(var r=[],i=0,a=3.14159265/180;i<=360;i+=15){var o=n*Math.cos(i*a)+e.x,s=n*Math.sin(i*a)+e.y;r.push(new f.Vector3(o,s))}this.drawPolyline(r,t)},w.prototype.DrawInt=function(e){var t=this.GetDrawRect(),n=[new f.Vector3,new f.Vector3];n[0].x=t.right,n[0].y=t.top,n[1].x=t.left,n[1].y=t.bottom,this.drawLine(n[0],n[1],e),n[0].x=t.right,n[0].y=t.bottom,n[1].x=t.left,n[1].y=t.top,this.drawLine(n[0],n[1],e)},w.prototype.DrawCen=function(e){this.DrawInt(e),this.DrawCircle(this.m_pt,e)},w.prototype.DrawTan=function(e){this.DrawEnd(e)},w.prototype.DrawIns=function(e){var t=this.GetDrawRect(),n={},r=(t.right-t.left)/1.5;n.left=this.m_pt.x-r,n.right=this.m_pt.x+r,n.top=this.m_pt.y-r,n.bottom=this.m_pt.y+r;var i=this.m_pt.x,a=this.m_pt.y,o=[new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3];o[0].x=n.left,o[0].y=n.top,o[1].x=n.left,o[1].y=a+2,o[2].x=i,o[2].y=a+2,o[3].x=i,o[3].y=n.bottom,o[4].x=n.right,o[4].y=n.bottom,o[5].x=n.right,o[5].y=a-2,o[6].x=i,o[6].y=a-2,o[7].x=i,o[7].y=n.top,o[8].x=n.left,o[8].y=n.top,this.drawPolyline(o,e)},w.prototype.DrawNode=function(e){var t=this.GetDrawRect(),n={},r=(t.right-t.left)/1.5;n.left=this.m_pt.x-r,n.right=this.m_pt.x+r,n.top=this.m_pt.y-r,n.bottom=this.m_pt.y+r;var i=this.m_dOsmodeWdith/1.3;this.m_pt.x,this.m_pt.x,this.m_pt.y,this.m_pt.y;var a=[new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3];a[0].x=n.left,a[0].y=n.top,a[1].x=n.right,a[1].y=n.bottom,a[2].x=n.left,a[2].y=n.bottom,a[3].x=n.right,a[3].y=n.top,this.drawLine(a[0],a[1],e),this.drawLine(a[2],a[3],e),this.DrawCircle(this.m_pt,e,i)},w.prototype.upDisplay=function(e,t,n){this.m_pt=e,this.m_osmode=t,this.clearDisplay(n);var r=n.getMxObject().getTheTempDrawContainer(),i=.5*this.m_dOsmodeWdith;if(this.m_osmode!=v.MxJigCmdManager.OsnapMode.kOsModekValid)if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeNear)this.DrawNear(r);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeEnd)this.DrawEnd(r);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeMid)this.DrawMid(r);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModePerp)this.DrawPerp(r);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeInt)this.DrawInt(r);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeCen)this.DrawCen(r);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeTan)this.DrawTan(r);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeIns)this.DrawIns(r);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeNode)this.DrawNode(r);else{var a=new f.Vector3(e.x-i,e.y-i,0),o=new f.Vector3(e.x+i,e.y+i,0);this.drawLine(a,o,r);var s=new f.Vector3(e.x-i,e.y+i,0),l=new f.Vector3(e.x+i,e.y-i,0);this.drawLine(s,l,r)}},w.prototype.clearDisplay=function(e){var t=e.getMxObject().getScene();a.clearDisplay(t)},w);function w(){this.m_iColor=16711935,this.m_pt=new f.Vector3,this.m_osmode=v.MxJigCmdManager.OsnapMode.kOsModekValid,this.m_dOsmodeWdith=10}var M=(S.prototype.resetData=function(){this.m_osmode=v.MxJigCmdManager.OsnapMode.kOsModekValid,this.m_isValidPrvInputPoint=!1,this.m_lOSmode=0,this.m_vecOffset.set(0,0,0),this.m_isValid=!1,this.m_iLongprogressStatus=-1},S.prototype.notifyOsnapToServer=function(){var e=this,t={ptx:this.m_pt.x,pty:this.m_pt.y,osmode:this.m_lOSmode,isValidPrvInputPoint:this.m_isValidPrvInputPoint};this.m_isValidPrvInputPoint&&(t.prvPtx=this.m_prvInputPoint.x,t.prvPty=this.m_prvInputPoint.y);var n=this.m_mxJig.getMxObject();if(n.getRunMode()==m.MxRunMode.kBrowse){var r=this,i=_.MxWindowsEvent.getCurrentMousePostion();n.getObjectOsnap().getOsnapData(i,function(e,t){r.m_ptSnapPoint.x=e.x,r.m_ptSnapPoint.y=e.y,r.m_ptSnapPoint.z=0,r.m_ptSnapSrcPoint.x=r.m_pt.x,r.m_ptSnapSrcPoint.y=r.m_pt.y,r.m_ptSnapSrcPoint.z=0,r.m_osmode=t,r.m_draw.setWidth(n.screenCoordLong2Doc(x.MxDrawData.getCursorWidthPixels())),r.m_draw.upDisplay(new f.Vector3(e.x,e.y,0),t,r.m_mxJig)})}else{t.SearchRnge=n.screenCoordLong2Doc(x.MxDrawData.getCursorWidthPixels());var a=this;n.callCommand("MxCAD_NotifyOsnap",JSON.stringify(t),function(t){if(!("string"!=typeof t||t.length<1)&&a.m_isRuning){var r=JSON.parse(t);e.m_ptSnapPoint.x=r.ptsx,e.m_ptSnapPoint.y=r.ptsy,e.m_ptSnapPoint.z=r.ptsz,e.m_ptSnapSrcPoint.x=r.ptx,e.m_ptSnapSrcPoint.y=r.pty,e.m_ptSnapSrcPoint.z=0,e.m_osmode=r.osmode,a.m_draw.setWidth(n.screenCoordLong2Doc(x.MxDrawData.getCursorWidthPixels())),a.m_draw.upDisplay(new f.Vector3(r.ptsx,r.ptsy,r.ptsz),r.osmode,a.m_mxJig)}})}},S.prototype.startDrag=function(e,t){this.m_mxJig=t;var n,r,i=this.m_mxJig.getMxObject();function a(){n.notifyOsnapToServer()}return t.isDisableOsnap()?this.m_isEnable=!1:this.m_isEnable=!0===i.getInisetValue(m.IniSetName.kEnableOsnapFunction),this.m_isOffsetInputPostion=e,this.m_isRuning=!0,this.m_draw.setWidth(i.screenCoordLong2Doc(x.MxDrawData.getCursorWidthPixels())),this.resetData(),this.m_notifyOsnap_delayCall=(n=this,100,r=null,function(){clearTimeout(r),r=setTimeout(a,100)}),!0},S.prototype.endDrag=function(){return this.m_isRuning=!1,this.m_draw.clearDisplay(this.m_mxJig),!0},S.prototype.reCompteCurrentPoint=function(e){return e},S.prototype.isEnable=function(){return this.m_isEnable&&a.isEnableOsmode()},S.prototype.notifyOsnap=function(e,t){this.m_lOSmode=e,null==t?this.m_isValidPrvInputPoint=!1:(this.m_isValidPrvInputPoint=!0,this.m_prvInputPoint=t),this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModekValid&&this.m_draw.clearDisplay(this.m_mxJig),this.m_notifyOsnap_delayCall()},S.prototype.setPoint=function(e,t){if(this.isEnable()){null==e?(this.m_isValid=!1,this.m_osmode=v.MxJigCmdManager.OsnapMode.kOsModekValid):(-1==this.m_iLongprogressStatus||this.m_iLongprogressStatus,this.m_pt=e,this.m_inPoint=e,this.m_isValid=!0,(null==t||this.m_osmode!=v.MxJigCmdManager.OsnapMode.kOsModekValid&&y.MxTools.getXYPlanDistance(this.m_ptSnapSrcPoint,e)>t)&&(this.m_osmode=v.MxJigCmdManager.OsnapMode.kOsModekValid));var n=a.getOSmode(),r=a.getPrvPoint();this.notifyOsnap(n,a.isValidPrvpoint()?r:void 0)}},S.prototype.seInValidPoint=function(){this.setPoint(void 0)},S.prototype.getCurrentOSnapPoint=function(e){var t={};return this.isEnable()?(t.pt=e,t.osmode=this.m_osmode,this.m_osmode!=v.MxJigCmdManager.OsnapMode.kOsModekValid?(t.pt.x=this.m_ptSnapPoint.x,t.pt.y=this.m_ptSnapPoint.y,t.pt.z=this.m_ptSnapPoint.z,a.isOsnapZValue()||(e.z=0)):t.pt=e):(t.pt=e,t.osmode=v.MxJigCmdManager.OsnapMode.kOsModekValid),t},S.prototype.setLongprogressStatus=function(e){this.m_iLongprogressStatus=e},S.prototype.reComputeOffset=function(){},S);function S(e){this.m_inPoint=new f.Vector3,this.m_vecOffset=new f.Vector3,this.m_pt=new f.Vector3,this.m_isValid=!1,this.m_ptSnapPoint=new f.Vector3,this.m_ptSnapSrcPoint=new f.Vector3,this.m_osmode=v.MxJigCmdManager.OsnapMode.kOsModekValid,this.m_prvInputPoint=new f.Vector3,this.m_isValidPrvInputPoint=!1,this.m_lOSmode=0,this.m_iLongprogressStatus=-1,this.m_isOffsetInputPostion=!1,this.m_mxJig=null,this.m_notifyOsnap_delayCall=void 0,this.m_isRuning=!1,this.m_isEnable=!1,this.m_mxJig=e,this.m_draw=new b}n.McEdJigOsnap=M},{"./MxDrawData":40,"./MxDrawObject":41,"./MxFun":45,"./MxJigCmdManager":48,"./MxTools":59,"./MxWindowsEvent":66,three:19}],21:[function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.McGiWorldDrawSelect=n.McGiWorldDraw=n.McGiWorldDrawType=void 0;var a,o,s=e("three"),l=e("./MxThreeJS"),c=e("./MxManager"),u=e("three.meshline");(o=a=n.McGiWorldDrawType||(n.McGiWorldDrawType={}))[o.kWorldDraw=1]="kWorldDraw",o[o.kDynDragDraw=2]="kDynDragDraw",o[o.kSelectDraw=3]="kSelectDraw";var h=(p.prototype.getType=function(){return this.worldDrawType},p.prototype.setColor=function(e){this.iColor!=e&&(this.widthMaterial=null),this.iColor=e},p.prototype.setDash=function(e,t){this.dDashArray=e,this.dDashRatio=t},p.prototype.getDash=function(){return{dDashArray:this.dDashArray,dDashRatio:this.dDashRatio}},p.prototype.setDashLineDisplay=function(e){e?(this.dDashArray=.03,this.dDashRatio=.1,0==this.dLineWidth&&(this.dLineWidth=6,this.lineWidthIsPixels=!0)):(this.dDashArray=0,this.dDashRatio=0)},p.prototype.isDashLineDisplay=function(){return 0<this.dDashArray&&0<this.dDashRatio},p.prototype.getColor=function(){return this.iColor},p.prototype.setRenderOrder=function(e){this.iRenderOrder=e},p.prototype.getRenderOrder=function(){return this.iRenderOrder},p.prototype.setLineWidthIsPixels=function(e){this.lineWidthIsPixels!=e&&(this.widthMaterial=null),this.lineWidthIsPixels=e},p.prototype.getLineWidthIsPixels=function(){return this.lineWidthIsPixels},p.prototype.setLineWidth=function(e){this.dLineWidth!=e&&(this.widthMaterial=null),this.dLineWidth=e},p.prototype.getLineWidth=function(){return this.dLineWidth},p.prototype.drawEntity=function(e){e.renderOrder=this.iRenderOrder,this.aryEntity.push(e)},p.prototype.getEntitys=function(){return this.aryEntity},p.prototype.getMxObject=function(){return this.mxObj},p.prototype.createWidthMaterial=function(){null==this.widthMaterial&&(0<this.dDashArray&&0<this.dDashRatio?this.widthMaterial=new u.MeshLineMaterial({useMap:!1,color:this.iColor,opacity:1,resolution:new s.Vector2(this.mxObj.getViewWidth(),this.mxObj.getViewHeight()),sizeAttenuation:!this.lineWidthIsPixels,lineWidth:this.dLineWidth,transparent:!0,depthTest:!1,dashArray:this.dDashArray,dashRatio:this.dDashRatio}):this.widthMaterial=new u.MeshLineMaterial({useMap:!1,color:this.iColor,opacity:1,resolution:new s.Vector2(this.mxObj.getViewWidth(),this.mxObj.getViewHeight()),sizeAttenuation:!this.lineWidthIsPixels,lineWidth:this.dLineWidth,transparent:!0,depthTest:!1}))},p.prototype.drawLines=function(e){if(!(e.length<2))if(0!=this.dLineWidth){this.createWidthMaterial();var t=new s.Geometry;t.vertices=e;var n=new u.MeshLine;n.setGeometry(t);var r=new s.Mesh(n.geometry,this.widthMaterial);this.drawEntity(r),this.drawEntity(l.MxThreeJS.createLines(e.slice(0),this.iColor,0))}else this.drawEntity(l.MxThreeJS.createLines(e.slice(0),this.iColor,this.opacity))},p.prototype.drawSelectLine=function(e,t,n,r){e instanceof Object&&t instanceof Object?this.drawEntity(l.MxThreeJS.createLine(e,t,this.iColor,0)):"number"==typeof e&&"number"==typeof t&&this.drawEntity(l.MxThreeJS.createLine(new s.Vector3(e,t,0),new s.Vector3(n,r,0),this.iColor,0))},p.prototype.drawLine=function(e,t,n,r){var i,a;if(e instanceof Object&&t instanceof Object?(i=e,a=t):"number"==typeof e&&"number"==typeof t&&(i=new s.Vector3(e,t,0),a=new s.Vector3(n,r,0)),0!=this.dLineWidth){this.createWidthMaterial();var o=new Float32Array(6);o[0]=i.x,o[1]=i.y,o[2]=0,o[3]=a.x,o[4]=a.y,o[5]=0;var c=new u.MeshLine;c.setGeometry(o);var h=new s.Mesh(c.geometry,this.widthMaterial);h.renderOrder=this.iRenderOrder,this.drawEntity(h),this.drawSelectLine(i,a)}else this.drawEntity(l.MxThreeJS.createLine(i,a,this.iColor,this.opacity))},p.prototype.drawCircle=function(e,t){this.drawEntity(l.MxThreeJS.createCircle(e,t,this.iColor))},p.prototype.drawText=function(e,t,n,r){var i=l.MxThreeJS.creatTextSprite(e,r,t,n,this.iColor);return this.drawEntity(i),i},p.prototype.setupForEntity=function(e){this.iColor=e.getColor(),this.iRenderOrder=e.getRenderOrder(),this.opacity=e.opacity},p);function p(e,t){this.aryEntity=[],this.iColor=16777215,this.dLineWidth=0,this.lineWidthIsPixels=!0,this.iRenderOrder=c.MxData.iMxEntityRenderOrder,this.worldDrawType=1,this.widthMaterial=null,this.dDashArray=0,this.dDashRatio=0,this.opacity=1,this.mxObj=e,this.worldDrawType=t}n.McGiWorldDraw=h;var d,f=(i(m,d=h),m.prototype.setCurEntityId=function(e){this.curEntityId=e},m.prototype.drawEntity=function(e){},m.prototype.drawText=function(e,t,n,r){return null},m.prototype.drawSelectLine=function(e,t,n,r){},m.prototype.isValid=function(){return 0!=this.curEntityId||(console.log("this.curEntityId == 0"),!1)},m.prototype.drawLine=function(e,t,n,r){var i,a;this.isValid()&&(e instanceof Object&&t instanceof Object?(i=e,a=t):"number"==typeof e&&"number"==typeof t&&(i=new s.Vector3(e,t,0),a=new s.Vector3(n,r,0)),this.selectManager.addLineDisplay(this.curEntityId,i,a))},m.prototype.drawCircle=function(e,t){this.isValid()&&this.selectManager.addCircleDisplay(this.curEntityId,e,t)},m.prototype.drawLines=function(e){if(!(e.length<2))for(var t=e.length,n=0;n<t-1;n++)this.selectManager.addLineDisplay(this.curEntityId,e[n],e[n+1])},m);function m(e,t){var n=d.call(this,e,a.kSelectDraw)||this;return n.selectManager=t,n.curEntityId=0,n}n.McGiWorldDrawSelect=f},{"./MxManager":51,"./MxThreeJS":58,three:19,"three.meshline":18}],22:[function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MrxDbgUiPrBase=n.MrxDbgUiPrBase_Return=n.McEdGetPointWorldDrawObject=n.McEdGetPointWorldDraw=void 0;var a=e("./MxJig"),o=e("./MxJigCmdManager"),s=e("./MxThreeJS"),l=e("./MxUiVue"),c=e("./MxString"),u=e("./McGiWorldDraw"),h=(p.prototype.setMcEdJig=function(e){this.m_pJig=e},p.prototype.setColor=function(e){this.m_iColor=e},p.prototype.getColor=function(){return this.m_iColor},p.prototype.drawLine=function(e,t){this.m_pJig.drawEntity(s.MxThreeJS.createLine(e,t,this.m_iColor))},p.prototype.drawCircle=function(e,t){this.m_pJig.drawEntity(s.MxThreeJS.createCircle(e,t,this.m_iColor))},p.prototype.drawEntity=function(e){this.m_pJig.drawEntity(e)},p.prototype.drawText=function(e,t,n,r){var i=s.MxThreeJS.creatTextSprite(e,r,t,n,this.m_iColor);this.drawEntity(i)},p.prototype.drawCustomEntity=function(e){var t=new u.McGiWorldDraw(this.m_pJig.getMxObject(),u.McGiWorldDrawType.kDynDragDraw);t.setupForEntity(e),e.worldDraw(t);for(var n=t.getEntitys(),r=n.length,i=0;i<r;i++)this.drawEntity(n[i])},p);function p(){this.m_pJig=null,this.m_iColor=16777215}n.McEdGetPointWorldDraw=h;var d,f,m,g=(i(v,d=h),v.prototype.setDraw=function(e){this.m_callDraw=e},v.prototype.worldDraw=function(e){null!=this.m_callDraw&&this.m_callDraw(e,this)},v);function v(){var e=null!==d&&d.apply(this,arguments)||this;return e.m_callDraw=void 0,e}n.McEdGetPointWorldDrawObject=g,(m=f=n.MrxDbgUiPrBase_Return||(n.MrxDbgUiPrBase_Return={}))[m.kCancel=-2]="kCancel",m[m.kNone=-1]="kNone",m[m.kOk=0]="kOk",m[m.kKeyWord=1]="kKeyWord";var y,x=(i(_,y=a.McEdJigCommand),_.prototype.procInKeyword=function(e){e.status>=o.MxJigCmdManager.DragStatus.kKW1&&0<e.sKeyValue.length?this.m_keyWordPicked=e.sKeyValue.toUpperCase():this.m_keyWordPicked=""},_.prototype.getReturnStatus=function(e){switch(e){case o.MxJigCmdManager.DragStatus.kNoChange:return f.kNone;case o.MxJigCmdManager.DragStatus.kCancel:return f.kCancel;case o.MxJigCmdManager.DragStatus.kNull:return f.kNone;case o.MxJigCmdManager.DragStatus.kNormal:return f.kOk}return 1<=e?f.kKeyWord:f.kCancel},_.prototype.setInputToucheType=function(e){this.m_toucheType=e},_.prototype.getInputToucheType=function(){return this.m_toucheType},_.prototype.keyWords=function(){return this.m_keyWords},_.prototype.setKeyWords=function(e){this.m_keyWords=e},_.prototype.message=function(){return this.m_message},_.prototype.setMessage=function(e){this.m_message=e},_.prototype.keyWordPicked=function(){return this.m_keyWordPicked},_.prototype.isKeyWordPicked=function(e){return e=e.toUpperCase(),this.m_keyWordPicked==e},_.prototype.setUserDraw=function(e){e.setMcEdJig(this),this.m_pWorldDraw=e},_.prototype.printMessage=function(){var e=new c.MxString(this.m_message);e.TrimRight(":"),1<this.m_keyWords.length&&"["==this.m_keyWords[0]&&"]"==this.m_keyWords[this.m_keyWords.length-1]?l.MxUiVue.acutPrintf(e.m_val+" 或"+this.m_keyWords+":"):l.MxUiVue.acutPrintf(e.m_val+":")},_);function _(){var e=null!==y&&y.apply(this,arguments)||this;return e.m_keyWords="",e.m_message="",e.m_keyWordPicked="",e.m_pWorldDraw=null,e.m_toucheType=o.MxJigCmdManager.InType.kGetBegan,e}n.MrxDbgUiPrBase=x},{"./McGiWorldDraw":21,"./MxJig":47,"./MxJigCmdManager":48,"./MxString":56,"./MxThreeJS":58,"./MxUiVue":64}],23:[function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MrxDbgUiPrPoint=void 0;var a,o=e("three"),s=e("./MxJigCmdManager"),l=e("./MxFun"),c=e("./MrxDbgUiPrBase"),u=e("./MxUiVue"),h=e("./MxThreeJS"),p=(i(d,a=c.MrxDbgUiPrBase),d.prototype.value=function(){return new o.Vector3(this.m_value.x,this.m_value.y,0)},d.prototype.basePt=function(){return new o.Vector3(this.m_basePt.x,this.m_basePt.y,0)},d.prototype.setBasePt=function(e){null==this.m_basePt?this.m_basePt=new o.Vector3(e.x,e.y,0):(this.m_basePt.x=e.x,this.m_basePt.y=e.y)},d.prototype.setUseBasePt=function(e){this.m_useBasePt=e},d.prototype.initGo=function(){this.m_keyWordPicked="",this.m_retcall=null,this.m_retWhileCall=null,this.m_exitCall=null},d.prototype.go=function(e){this.initGo(),this.m_retcall=e,s.MxJigCmdManager.runCmd(this)},d.prototype.goWhile=function(e,t){this.initGo(),this.m_retWhileCall=e,t&&(this.m_exitCall=t),s.MxJigCmdManager.runCmd(this)},d.prototype.onExitCommand=function(){var e=this;u.MxUiVue.setCursorType(u.MxUiVue.CursorType.kNormal);var t=!1;null!=this.m_retcall&&(s.MxJigCmdManager.setRunCmdEvent(function(){a.prototype.onExitCommand.call(e,!1),t=!0}),this.m_retcall(this.getReturnStatus(this.m_resultDragStatus)),s.MxJigCmdManager.setRunCmdEvent(void 0)),!t&&s.MxJigCmdManager.isWaitCmdNull()&&u.MxUiVue.restoreCmdStatus(),t||a.prototype.onExitCommand.call(this,!0)},d.prototype.onStartCommand=function(){u.MxUiVue.setCursorType(u.MxUiVue.CursorType.kCross),this.printMessage(),s.MxJigCmdManager.setKeywordList(this.keyWords()),a.prototype.onStartCommand.call(this)},d.prototype.sampler=function(){var e=this.acquirePoint(this.m_toucheType);return this.procInKeyword(e),e.status==s.MxJigCmdManager.DragStatus.kNormal&&(null==this.m_value?this.m_value=new o.Vector3(e.pt.x,e.pt.y,0):(this.m_value.x=e.pt.x,this.m_value.y=e.pt.y)),e.status},d.prototype.done=function(e){if(null!=this.m_retcall)return this.m_resultDragStatus=e,this.m_exitCall&&this.m_exitCall(this.getReturnStatus(this.m_resultDragStatus)),s.MxJigCmdManager.DoneStatius.kExitCommand;if(null!=this.m_retWhileCall){if((this.m_resultDragStatus=e)==s.MxJigCmdManager.DragStatus.kCancel)return this.m_exitCall&&this.m_exitCall(this.getReturnStatus(this.m_resultDragStatus)),s.MxJigCmdManager.DoneStatius.kExitCommand;var t=!1;e==s.MxJigCmdManager.DragStatus.kNull&&(t=!0);var n=this.m_retWhileCall(this.getReturnStatus(this.m_resultDragStatus));return null!=n&&null!=n.exit&&(t=n.exit),t?(this.m_exitCall&&this.m_exitCall(this.getReturnStatus(this.m_resultDragStatus)),s.MxJigCmdManager.DoneStatius.kExitCommand):(s.MxJigCmdManager.setKeywordList(this.keyWords()),this.printMessage(),s.MxJigCmdManager.DoneStatius.kContinueCommand)}l.MxFun.Assert(0)},d.prototype.upDisplay=function(){this.m_value&&(this.m_pWorldDraw&&this.m_pWorldDraw.worldDraw(this.m_value),this.m_useBasePt&&this.m_basePt&&this.drawEntity(h.MxThreeJS.createLine(this.m_value,this.m_basePt,16777215)))},d);function d(){var e=null!==a&&a.apply(this,arguments)||this;return e.m_useBasePt=!1,e.m_basePt=null,e.m_value=null,e.m_retcall=null,e.m_retWhileCall=null,e.m_exitCall=null,e.m_resultDragStatus=s.MxJigCmdManager.DragStatus.kCancel,e}n.MrxDbgUiPrPoint=p},{"./MrxDbgUiPrBase":22,"./MxFun":45,"./MxJigCmdManager":48,"./MxThreeJS":58,"./MxUiVue":64,three:19}],24:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.ExternalReferenceManager=n.ExternalReferenceDatabase=n.Blocks=n.Block=n.Layer=n.BlockInstance=n.BlockRef=n.ClipPlans=n.ClipPlan=void 0;var r=e("three"),i=e("./MxShader"),a=e("./MxBrowseLayerData"),o=e("./MxManager"),s=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0};n.ClipPlan=s;var l=function(){this.id=1,this.clipPlanArray=new Array};n.ClipPlans=l;var c=function(){this.mat=new r.Matrix4,this.blkRecId=-1,this.blkOwnerId=0,this.layerId=-1,this.color=16777215,this.clipPlans=new l};n.BlockRef=c;var u=function(){this.mat=new r.Matrix4,this.color=new Array,this.topLayerColor=new Array,this.clipPlans=new l};n.BlockInstance=u;var h=(p.prototype.Show=function(e){for(var t=0,n=this._entitys.length;t<n;t++)this._entitys[t].visible=e},p.prototype.updataClipMaterial=function(e){for(var t=this._material_clip.length,n=.5*e.width,r=.5*e.height,i=0;i<t;i++)this._material_clip[i].uniforms.vieww.value=n,this._material_clip[i].uniforms.viewh.value=r},p.prototype.createThreejsObjForMesh_Clip=function(e,t,n){0!=e.size&&e.forEach(function(e){var a=e;if(0!=a.length){var s=[],l=[];s.push(a[0].clipPlans.clipPlanArray[0].x1,a[0].clipPlans.clipPlanArray[0].y1),l.push(a[0].clipPlans.clipPlanArray[0].x2,a[0].clipPlans.clipPlanArray[0].y2);for(var c=[],u=[],h=[],p=[],d=[],f=[],m=[],g=0;g<a.length;g++){var v=a[g];c=c.concat(v.mat.elements.slice(0,4)),u=u.concat(v.mat.elements.slice(4,8)),h=h.concat(v.mat.elements.slice(8,12)),p=p.concat(v.mat.elements.slice(12,16)),d.push(0),f=f.concat(a[g].color)}if(0<this._geometryMeshPositionsByBlock.length)for(g=0;g<a.length;g++)f=f.concat(a[g].color);if(0<this._geometryMeshPositionsByBlock_ZeroLayer.length)for(g=0;g<a.length;g++)m=m.concat(a[g].topLayerColor);var y=.5*n.width,x=.5*n.height,_=new r.RawShaderMaterial({uniforms:{clippt1:{value:s},clippt2:{value:l},vieww:{value:y},viewh:{value:x}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_CLIP,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0});this._material_clip.push(_);for(var b=0;b<this._geometryMeshPostion.length;b++)(M=new r.InstancedBufferGeometry).maxInstancedCount=a.length,M.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPostion[b],2)),M.setAttribute("color",new r.Float32BufferAttribute(this._geometryMeshColor[b],3)),M.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(c),4)),M.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(u),4)),M.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(h),4)),M.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(p),4)),M.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(d),1)),(S=new r.Mesh(M,_)).frustumCulled=!1,S.renderOrder=o.MxData.iCADMeshRenderOrder,t.add(S),this._entitys.push(S);for(b=0;b<this._geometryMeshPositionsByBlock.length;b++)(M=new r.InstancedBufferGeometry).maxInstancedCount=a.length,M.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPositionsByBlock[b],2)),M.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(f),3)),M.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(c),4)),M.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(u),4)),M.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(h),4)),M.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(p),4)),M.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(d),1)),(S=new r.Mesh(M,_)).frustumCulled=!1,S.renderOrder=o.MxData.iCADMeshRenderOrder,t.add(S),this._entitys.push(S);for(b=0;b<this._geometryMeshPositionsByBlock_ZeroLayer.length;b++)(M=new r.InstancedBufferGeometry).maxInstancedCount=a.length,M.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPositionsByBlock_ZeroLayer[b],2)),M.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(m),3)),M.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(c),4)),M.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(u),4)),M.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(h),4)),M.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(p),4)),M.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(d),1)),(S=new r.Mesh(M,_)).frustumCulled=!1,S.renderOrder=o.MxData.iCADMeshRenderOrder,t.add(S),this._entitys.push(S);var w=new r.RawShaderMaterial({uniforms:{color:{value:this._color},clippt1:{value:s},clippt2:{value:l},vieww:{value:y},viewh:{value:x}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_BYLAYER_CLIP,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0});for(this._material_clip.push(w),b=0;b<this._geometryMeshPositionsByLayer.length;b++){var M,S;(M=new r.InstancedBufferGeometry).maxInstancedCount=a.length,M.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPositionsByLayer[b],2)),M.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(c),4)),M.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(u),4)),M.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(h),4)),M.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(p),4)),M.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(d),1)),(S=new r.Mesh(M,w)).frustumCulled=!1,S.renderOrder=o.MxData.iCADMeshRenderOrder,t.add(S),this._entitys.push(S)}}},this)},p.prototype.createThreejsObjForCurve_Clip=function(e,t,n){0!=e.size&&e.forEach(function(e,a,s){var l=e;if(0!=l.length){var c=[],u=[];c.push(l[0].clipPlans.clipPlanArray[0].x1,l[0].clipPlans.clipPlanArray[0].y1),u.push(l[0].clipPlans.clipPlanArray[0].x2,l[0].clipPlans.clipPlanArray[0].y2);for(var h=[],p=[],d=[],f=[],m=[],g=[],v=[],y=0;y<l.length;y++){var x=l[y];h=h.concat(x.mat.elements.slice(0,4)),p=p.concat(x.mat.elements.slice(4,8)),d=d.concat(x.mat.elements.slice(8,12)),f=f.concat(x.mat.elements.slice(12,16)),m.push(0)}if(0<this._geometryCurvePositionsByBlock.length)for(y=0;y<l.length;y++)g=g.concat(l[y].color);if(0<this._geometryCurvePositionsByBlock_ZeroLayer.length)for(y=0;y<l.length;y++)v=v.concat(l[y].topLayerColor);var _=.5*n.width,b=.5*n.height,w=new r.RawShaderMaterial({uniforms:{clippt1:{value:c},clippt2:{value:u},vieww:{value:_},viewh:{value:b}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_CLIP,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0});this._material_clip.push(w);for(var M=0;M<this._geometryCurvePostion.length;M++)(T=new r.InstancedBufferGeometry).maxInstancedCount=l.length,T.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePostion[M],2)),T.setAttribute("color",new r.Float32BufferAttribute(this._geometryCurveColor[M],3)),T.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(h),4)),T.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(p),4)),T.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(d),4)),T.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(f),4)),T.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(m),1)),(E=new r.LineSegments(T,w)).frustumCulled=!1,E.renderOrder=o.MxData.iCADCurveRenderOrder,t.add(E),this._entitys.push(E);for(M=0;M<this._geometryCurvePositionsByBlock.length;M++)(T=new r.InstancedBufferGeometry).maxInstancedCount=l.length,T.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePositionsByBlock[M],2)),T.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(g),3)),T.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(h),4)),T.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(p),4)),T.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(d),4)),T.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(f),4)),T.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(m),1)),(E=new r.LineSegments(T,w)).frustumCulled=!1,E.renderOrder=o.MxData.iCADCurveRenderOrder,t.add(E),this._entitys.push(E);for(M=0;M<this._geometryCurvePositionsByBlock_ZeroLayer.length;M++)(T=new r.InstancedBufferGeometry).maxInstancedCount=l.length,T.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePositionsByBlock_ZeroLayer[M],2)),T.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(v),3)),T.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(h),4)),T.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(p),4)),T.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(d),4)),T.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(f),4)),T.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(m),1)),(E=new r.LineSegments(T,w)).frustumCulled=!1,E.renderOrder=o.MxData.iCADCurveRenderOrder,t.add(E),this._entitys.push(E);var S=new r.RawShaderMaterial({uniforms:{color:{value:this._color},clippt1:{value:c},clippt2:{value:u},vieww:{value:_},viewh:{value:b}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_BYLAYER_CLIP,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0});for(this._material_clip.push(S),M=0;M<this._geometryCurvePositionsByLayer.length;M++){var T,E;(T=new r.InstancedBufferGeometry).maxInstancedCount=l.length,T.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePositionsByLayer[M],2)),T.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(h),4)),T.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(p),4)),T.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(d),4)),T.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(f),4)),T.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(m),1)),(E=new r.LineSegments(T,S)).frustumCulled=!1,E.renderOrder=o.MxData.iCADCurveRenderOrder,t.add(E),this._entitys.push(E)}}},this)},p.prototype.createThreejsObjForCurve=function(e,t){if(0!=e.length){for(var n=[],a=[],s=[],l=[],c=[],u=[],h=[],p=0;p<e.length;p++){var d=e[p];n=n.concat(d.mat.elements.slice(0,4)),a=a.concat(d.mat.elements.slice(4,8)),s=s.concat(d.mat.elements.slice(8,12)),l=l.concat(d.mat.elements.slice(12,16)),c.push(0)}if(0<this._geometryCurvePositionsByBlock.length)for(p=0;p<e.length;p++)u=u.concat(e[p].color);if(0<this._geometryCurvePositionsByBlock_ZeroLayer.length)for(p=0;p<e.length;p++)h=h.concat(e[p].topLayerColor);for(var f=new r.RawShaderMaterial({vertexShader:i.MxShader.VSHADER_COLOR_POINT,fragmentShader:i.MxShader.FSHADER_COLOR_POINT,linewidth:1,transparent:!0}),m=0;m<this._geometryCurvePostion.length;m++)(v=new r.InstancedBufferGeometry).maxInstancedCount=e.length,v.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePostion[m],2)),v.setAttribute("color",new r.Float32BufferAttribute(this._geometryCurveColor[m],3)),v.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(c),1)),(y=new r.LineSegments(v,f)).frustumCulled=!1,y.renderOrder=o.MxData.iCADCurveRenderOrder,t.add(y),this._entitys.push(y);for(m=0;m<this._geometryCurvePositionsByBlock.length;m++)(v=new r.InstancedBufferGeometry).maxInstancedCount=e.length,v.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePositionsByBlock[m],2)),v.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(u),3)),v.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(c),1)),(y=new r.LineSegments(v,f)).frustumCulled=!1,y.renderOrder=o.MxData.iCADCurveRenderOrder,t.add(y),this._entitys.push(y);for(m=0;m<this._geometryCurvePositionsByBlock_ZeroLayer.length;m++)(v=new r.InstancedBufferGeometry).maxInstancedCount=e.length,v.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePositionsByBlock_ZeroLayer[m],2)),v.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(h),3)),v.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(c),1)),(y=new r.LineSegments(v,f)).frustumCulled=!1,y.renderOrder=o.MxData.iCADCurveRenderOrder,t.add(y),this._entitys.push(y);var g=new r.RawShaderMaterial({uniforms:{color:{value:this._color}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_BYLAYER,fragmentShader:i.MxShader.FSHADER_COLOR_POINT,linewidth:1,transparent:!0});for(m=0;m<this._geometryCurvePositionsByLayer.length;m++){var v,y;(v=new r.InstancedBufferGeometry).maxInstancedCount=e.length,v.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePositionsByLayer[m],2)),v.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(c),1)),(y=new r.LineSegments(v,g)).frustumCulled=!1,y.renderOrder=o.MxData.iCADCurveRenderOrder,t.add(y),this._entitys.push(y)}}},p.prototype.createThreejsObjForMesh=function(e,t){if(0!=e.length){for(var n=[],a=[],s=[],l=[],c=[],u=[],h=[],p=0;p<e.length;p++){var d=e[p];n=n.concat(d.mat.elements.slice(0,4)),a=a.concat(d.mat.elements.slice(4,8)),s=s.concat(d.mat.elements.slice(8,12)),l=l.concat(d.mat.elements.slice(12,16)),c.push(0),u=u.concat(e[p].color)}if(0<this._geometryMeshPositionsByBlock.length)for(p=0;p<e.length;p++)u=u.concat(e[p].color);if(0<this._geometryMeshPositionsByBlock_ZeroLayer.length)for(p=0;p<e.length;p++)h=h.concat(e[p].topLayerColor);for(var f=new r.RawShaderMaterial({vertexShader:i.MxShader.VSHADER_COLOR_POINT,fragmentShader:i.MxShader.FSHADER_COLOR_POINT,transparent:!0,side:r.DoubleSide}),m=0;m<this._geometryMeshPostion.length;m++)(v=new r.InstancedBufferGeometry).maxInstancedCount=e.length,v.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPostion[m],2)),v.setAttribute("color",new r.Float32BufferAttribute(this._geometryMeshColor[m],3)),v.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(c),1)),(y=new r.Mesh(v,f)).frustumCulled=!1,y.renderOrder=o.MxData.iCADMeshRenderOrder,t.add(y),this._entitys.push(y);for(m=0;m<this._geometryMeshPositionsByBlock.length;m++)(v=new r.InstancedBufferGeometry).maxInstancedCount=e.length,v.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPositionsByBlock[m],2)),v.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(u),3)),v.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(c),1)),(y=new r.Mesh(v,f)).frustumCulled=!1,y.renderOrder=o.MxData.iCADMeshRenderOrder,t.add(y),this._entitys.push(y);for(m=0;m<this._geometryMeshPositionsByBlock_ZeroLayer.length;m++)(v=new r.InstancedBufferGeometry).maxInstancedCount=e.length,v.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPositionsByBlock_ZeroLayer[m],2)),v.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(h),3)),v.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(c),1)),(y=new r.Mesh(v,f)).frustumCulled=!1,y.renderOrder=o.MxData.iCADMeshRenderOrder,t.add(y),this._entitys.push(y);var g=new r.RawShaderMaterial({uniforms:{color:{value:this._color}},vertexShader:i.MxShader.VSHADER_COLOR_POINT,fragmentShader:i.MxShader.FSHADER_COLOR_POINT,transparent:!0,side:r.DoubleSide});for(m=0;m<this._geometryMeshPositionsByLayer.length;m++){var v,y;(v=new r.InstancedBufferGeometry).maxInstancedCount=e.length,v.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPositionsByLayer[m],2)),v.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(c),1)),(y=new r.Mesh(v,g)).frustumCulled=!1,y.renderOrder=o.MxData.iCADMeshRenderOrder,t.add(y),this._entitys.push(y)}}},p.prototype.addGeometryCurve=function(e,t,n,r,i){0<e.length&&(this._geometryCurvePostion.push(e),this._geometryCurveColor.push(t)),0<n.length&&this._geometryCurvePositionsByBlock.push(n),0<r.length&&this._geometryCurvePositionsByLayer.push(r),0<i.length&&this._geometryCurvePositionsByBlock_ZeroLayer.push(i)},p.prototype.addGeometryMesh=function(e,t,n,r,i){0<e.length&&(this._geometryMeshPostion.push(e),this._geometryMeshColor.push(t)),0<n.length&&this._geometryMeshPositionsByBlock.push(n),0<r.length&&this._geometryMeshPositionsByLayer.push(r),0<i.length&&this._geometryMeshPositionsByBlock_ZeroLayer.push(i)},p.prototype.createThreejsObj=function(e,t,n,r,i){var a=n.getScene(),o=n.getCanvas();if(0!=e.length){if(null==this._color){var s=r.getColor(i);this._color=[],this._color.push((255&s)/255,(s>>8&255)/255,(s>>16&255)/255)}0==this._geometryCurvePostion.length&&0==this._geometryCurvePositionsByBlock.length&&0==this._geometryCurvePositionsByLayer.length&&0==this._geometryCurvePositionsByBlock_ZeroLayer.length||this.createThreejsObjForCurve(e,a),0==this._geometryMeshPostion.length&&0==this._geometryMeshPositionsByBlock.length&&0==this._geometryMeshPositionsByLayer.length&&0==this._geometryMeshPositionsByBlock_ZeroLayer.length||this.createThreejsObjForMesh(e,a)}0!=t.size&&(null==this._color&&(s=r.getColor(i),this._color=[],this._color.push((255&s)/255,(s>>8&255)/255,(s>>16&255)/255)),0==this._geometryCurvePostion.length&&0==this._geometryCurvePositionsByBlock.length&&0==this._geometryCurvePositionsByLayer.length&&0==this._geometryCurvePositionsByBlock_ZeroLayer.length||this.createThreejsObjForCurve_Clip(t,a,o),0==this._geometryMeshPostion.length&&0==this._geometryMeshPositionsByBlock.length&&0==this._geometryMeshPositionsByLayer.length&&0==this._geometryMeshPositionsByBlock_ZeroLayer.length||this.createThreejsObjForMesh_Clip(t,a,o)),this._geometryCurvePostion=[],this._geometryCurvePositionsByBlock=[],this._geometryCurvePositionsByLayer=[],this._geometryCurvePositionsByBlock_ZeroLayer=[],this._geometryCurveColor=[],this._geometryMeshPostion=[],this._geometryMeshPositionsByBlock=[],this._geometryMeshPositionsByLayer=[],this._geometryMeshPositionsByBlock_ZeroLayer=[],this._geometryMeshColor=[]},p);function p(e){this._blockRecId=0,this._geometryCurvePostion=new Array,this._geometryCurveColor=new Array,this._geometryMeshPostion=new Array,this._geometryMeshColor=new Array,this._geometryCurvePositionsByBlock=new Array,this._geometryMeshPositionsByBlock=new Array,this._geometryCurvePositionsByLayer=new Array,this._geometryMeshPositionsByLayer=new Array,this._geometryCurvePositionsByBlock_ZeroLayer=new Array,this._geometryMeshPositionsByBlock_ZeroLayer=new Array,this._entitys=new Array,this._color=void 0,this._material_clip=[],this._blockRecId=e}n.Layer=h;var d=(f.prototype.showLayer=function(e,t){var n=this._layerTogeometry.get(e);null!=n&&n.Show(t)},f.prototype.updataClipMaterial=function(e){var t=e.getCanvas();this._layerTogeometry.forEach(function(e,n,r){e.updataClipMaterial(t)})},f.prototype.getId=function(){return this._id},f.prototype.getBlkRef=function(){return this._blkRef},f.prototype.createThreejsObj=function(e,t){var n=this;this._layerTogeometry.forEach(function(r,i,a){r.createThreejsObj(n._instance,n._instance_clip,e,t,i)})},f.prototype.addGeometryCurve=function(e,t,n,r,i,a){var o=this._layerTogeometry.get(n);null==o&&(o=new h(this._id),this._layerTogeometry.set(n,o)),o.addGeometryCurve(e,t,r,i,a)},f.prototype.addGeometryMesh=function(e,t,n,r,i,a){var o=this._layerTogeometry.get(n);null==o&&(o=new h(this._id),this._layerTogeometry.set(n,o)),o.addGeometryMesh(e,t,r,i,a)},f.prototype.addInstance=function(e){if(0==e.clipPlans.clipPlanArray.length)this._instance.push(e);else{var t=this._instance_clip.get(e.clipPlans.id);null==t&&(t=[],this._instance_clip.set(e.clipPlans.id,t)),t.push(e)}},f.prototype.addBlkRef=function(e){this._blkRef.push(e)},f);function f(e){this._id=0,this._layerTogeometry=new Map,this._blkRef=[],this._instance=[],this._instance_clip=new Map,this._id=e}n.Block=d;var m=(g.prototype.crateBlock=function(e){var t=this._mapBlock.get(e);return null==t&&(t=new d(e),this._mapBlock.set(e,t)),t},g.prototype.getBlock=function(e){return this._mapBlock.get(e)},g.prototype.addBlockRef=function(e){this.crateBlock(e.blkOwnerId).addBlkRef(e)},g.prototype.showLayer=function(e,t){this._mapBlock.forEach(function(e,t){var n=e,r=t;return function(e,t,i){e.showLayer(n,r)}}.call(this,e,t))},g.prototype.createBlocks=function(e,t){if(!this._isCreate){this.crateBlock(0);for(var n=1,i=e.getInt32(12,!0),a=80,o=0;o<i;o++){var u=e.getInt32(a,!0);a+=4;var h=e.getInt32(a,!0);a+=4;var p=e.getInt32(a,!0);a+=4;var d=e.getInt32(a,!0);a+=4;for(var f=new Array,m=0;m<16;m++){var g=e.getFloat32(a,!0);a+=4,f.push(g)}var v=e.getInt32(a,!0);a+=4;var y=new l;y.id=n,n++,y.clipPlanArray=[];for(var x=0;x<v;x++){var _=e.getFloat32(a,!0);a+=4;var b=e.getFloat32(a,!0);a+=4;var w=e.getFloat32(a,!0);a+=4;var M=e.getFloat32(a,!0);a+=4;var S=new s;S.x1=_,S.y1=b,S.x2=w,S.y2=M,y.clipPlanArray.push(S)}var T=new c;T.mat=new r.Matrix4,T.mat.fromArray(f),T.blkRecId=p,T.blkOwnerId=u,T.layerId=h,T.color=d,T.clipPlans=y,this.crateBlock(p),this.addBlockRef(T)}this._isGetAllBlocks=!0,this._isCreate=!0}},g.prototype.updataClipMaterial=function(e){this._mapBlock.forEach(function(t,n,r){t.updataClipMaterial(e)})},g.prototype.createAllInstance=function(e){var t=this.getBlock(0);if(null==t)return!1;if(null==this._rootBlockRef)return!1;var n=new r.Matrix4,i=new Map,a=new l;return this.createAllInstanceCall(t,this._rootBlockRef,n,i,16777215,e,void 0,a),!0},g.prototype.createThreejsObj=function(e,t,n){null==this._mapNeedCreateThreejsObj.get(e.getId())&&this._mapNeedCreateThreejsObj.set(e.getId(),e),this._isCreateAllInstance||this._isGetAllBlocks&&n.isInitComplete()&&(this._isCreateAllInstance=this.createAllInstance(n)),this._isCreateAllInstance&&(this._mapNeedCreateThreejsObj.forEach(function(e,r,i){e.createThreejsObj(t,n)}),this._mapNeedCreateThreejsObj.clear())},g.prototype.createAllInstanceCall=function(e,t,n,i,a,o,s,l){if(1!=i[e.getId()]){i[e.getId()]=!0;var c=new u;if(c.mat=new r.Matrix4,c.mat.copy(n),c.mat.multiply(t.mat),0==t.clipPlans.clipPlanArray.length)c.clipPlans=l;else{c.clipPlans=t.clipPlans;for(var h=c.clipPlans.clipPlanArray.length,p=0;p<h;p++){var d=new r.Vector3(c.clipPlans.clipPlanArray[p].x1,c.clipPlans.clipPlanArray[p].y1,0),f=new r.Vector3(c.clipPlans.clipPlanArray[p].x2,c.clipPlans.clipPlanArray[p].y2,0);d.applyMatrix4(c.mat),f.applyMatrix4(c.mat),c.clipPlans.clipPlanArray[p].x1=d.x,c.clipPlans.clipPlanArray[p].y1=d.y,c.clipPlans.clipPlanArray[p].x2=f.x,c.clipPlans.clipPlanArray[p].y2=f.y}}null==s?c.topLayerColor.push(1,1,1):c.topLayerColor.push(s[0],s[1],s[2]);var m=t.color>>24&255;if(2==m)c.color.push((255&a)/255,(a>>8&255)/255,(a>>16&255)/255);else if(1==m){var g=o.getColor(t.layerId);c.color.push((255&g)/255,(g>>8&255)/255,(g>>16&255)/255),a=g}else c.color.push((255&t.color)/255,(t.color>>8&255)/255,(t.color>>16&255)/255),a=t.color;e.addInstance(c);for(var v=e.getBlkRef(),y=null==s,x=0;x<v.length;x++)if(0!=v[x].blkRecId){var _=this.getBlock(v[x].blkRecId);if(null==_)return;y&&(s=[],g=o.getColor(v[x].layerId),s.push((255&g)/255,(g>>8&255)/255,(g>>16&255)/255)),this.createAllInstanceCall(_,v[x],c.mat,i,a,o,s,c.clipPlans)}i[e.getId()]=!1}},g.prototype.initRootBlockRef=function(e){null==e&&((e=new c).mat=new r.Matrix4,e.blkRecId=0,e.blkOwnerId=-1,e.layerId=-1,e.color=16777215),this._rootBlockRef=e},g);function g(){this._mapBlock=new Map,this._mapNeedCreateThreejsObj=new Map,this._isCreate=!1,this._isGetAllBlocks=!1,this._isCreateAllInstance=!1,this._rootBlockRef=void 0}n.Blocks=m;var v=function(){this.blocks=new m,this.layers=new a.MxBrowseLayerData};n.ExternalReferenceDatabase=v;var y=(x.prototype.createTzDwgExternalReferences=function(e){this._mapId2ExternalDatabase.get(e)||this.getBlocks(e).initRootBlockRef()},x.prototype.createExternalReferences=function(e){for(var t=e.getInt32(12,!0),n=80,i=0;i<t;i++){for(var a=new Array,o=0;o<16;o++){var s=e.getFloat32(n,!0);n+=4,a.push(s)}var l=e.getInt32(n,!0);n+=4;var u=e.getInt32(n,!0);if(n+=4,e.getInt32(n,!0),n+=4,0!=l){var h=this.getBlocks(l),p=new c;p.mat=new r.Matrix4,p.mat.fromArray(a),p.blkRecId=0,p.blkOwnerId=-1,p.layerId=-1,p.color=u,h.initRootBlockRef(p)}else console.log("mx error iDatabaseIndex")}},x.prototype.getBlocks=function(e){if(0!=e){var t=this._mapId2ExternalDatabase.get(e);return null==t&&(t=new v,this._mapId2ExternalDatabase.set(e,t)),t.blocks}console.log("mx error iDatabaseIndex")},x.prototype.getLayers=function(e){if(0!=e){var t=this._mapId2ExternalDatabase.get(e);return null==t&&(t=new v,this._mapId2ExternalDatabase.set(e,t)),t.layers}console.log("mx error iDatabaseIndex")},x);function x(){this._mapId2ExternalDatabase=new Map}n.ExternalReferenceManager=y},{"./MxBrowseLayerData":25,"./MxManager":51,"./MxShader":55,three:19}],25:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxBrowseLayerData=void 0;var r=(i.prototype.add=function(e,t,n){this._layerColor[e]=t,this._nametoId[n]=e},i.prototype.setZeroLayerId=function(e){this._zeroLayerId=e},i.prototype.getZeroLayerId=function(){return this._zeroLayerId},i.prototype.getLayerIdForName=function(e){return null==this._nametoId[e]?0:this._nametoId[e]},i.prototype.getColor=function(e){return null==this._layerColor[e]?16777215:this._layerColor[e]},i.prototype.initComplete=function(){this._isSetInstanceComplete=!0},i.prototype.isInitComplete=function(){return this._isSetInstanceComplete},i);function i(){this._isSetInstanceComplete=!1,this._layerColor=new Map,this._nametoId=new Map,this._zeroLayerId=0}n.MxBrowseLayerData=r},{}],26:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADSyncDisplay=n.MxCADDisplayFun=n.MxCADDatabase=n.MxCADLayerTable=n.MxCADLayerTableRecord=n.MxCADDisplayBlockTable=n.MxCADDisplayBlockRecord=n.MxCADDisplayLayerTable=n.MxCADDisplayLayerRecord=n.MxCADDisplayMemorySections=n.MxCADDisplayMemorySection=n.MxCADDisplayMemorySectionType=n.MxCADDisplayBlockInstance=n.MxCADDisplayBlockRef=n.MxCADDisplayClipPlans=n.MxCADDisplayClipPlan=void 0;var r=e("three"),i=e("./MxFun"),a=e("./MxShader"),o=e("./MxCADNetData"),s=e("./MxManager");n.MxCADDisplayClipPlan=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0};var l=function(){this.id=1,this.clipPlanArray=new Array};n.MxCADDisplayClipPlans=l;var c,u,h=function(){this.mat=new r.Matrix4,this.blkRecId=-1,this.blkOwnerId=0,this.layerId=-1,this.color=0,this.clipPlans=new l};n.MxCADDisplayBlockRef=h,n.MxCADDisplayBlockInstance=function(){this.mat=new r.Matrix4,this.clipPlans=new l},(u=c=n.MxCADDisplayMemorySectionType||(n.MxCADDisplayMemorySectionType={}))[u.kLinesType=1]="kLinesType",u[u.kTriangleType=2]="kTriangleType";var p=function(){this.id=0,this.type=c.kLinesType,this.blockId=0,this.layerId=0,this.color=0,this.points=[]};n.MxCADDisplayMemorySection=p;var d=(f.prototype.add=function(e){this.datas.set(e.id,e)},f.prototype.get=function(e){return this.datas.get(e)},f.prototype.remove=function(e){this.datas.delete(e)},f.prototype.has=function(e){return this.datas.has(e)},f.prototype.clearAll=function(){this.datas=new Map},f);function f(){this.datas=new Map}n.MxCADDisplayMemorySections=d;var m=(g.prototype.addColorByLayerMaterial=function(e,t){this.mapColorByLayerMaterial.set(e,t)},g.prototype.upColorToByLayerMaterial=function(e){this.mapColorByLayerMaterial.forEach(function(t){t.uniformsNeedUpdate=!0,t.needsUpdate=!0,t.uniforms={color:{value:e}}})},g.prototype.getId=function(){return this.id},g.prototype.getBlockRecordId=function(){return this.blockRecId},g.prototype.createMemorySectionToEntityArray=function(e){var t=this.mapMemorySectionIdToEntity.get(e);return t||(t=new Array,this.mapMemorySectionIdToEntity.set(e,t),t)},g.prototype.show=function(e){this.mapMemorySectionIdToEntity.forEach(function(t){for(var n in t)t[n].visible=e})},g.prototype.addEntity=function(e,t){this.createMemorySectionToEntityArray(e).push(t)},g.prototype.deleteMemorySectionEntitys=function(e,t){var n=this.mapMemorySectionIdToEntity.get(e);if(!n)return!1;for(var r=n.length,a=0;a<r;a++)i.MxFun.removeThreejsObject(n[a],t);return this.mapMemorySectionIdToEntity.delete(e),this.mapColorByLayerMaterial.delete(e),!0},g.prototype.addClipMaterial=function(e){this.material_clip.push(e)},g.prototype.updataClipMaterial=function(e){for(var t=this.material_clip.length,n=.5*e.width,r=.5*e.height,i=0;i<t;i++)this.material_clip[i].uniforms.vieww.value=n,this.material_clip[i].uniforms.viewh.value=r},g);function g(e,t){this.id=0,this.blockRecId=0,this.mapMemorySectionIdToEntity=new Map,this.mapColorByLayerMaterial=new Map,this.material_clip=[],this.id=e,this.blockRecId=t}n.MxCADDisplayLayerRecord=m;var v=(y.prototype.createLayerRecord=function(e){var t=this.layers.get(e);return t||(t=new m(e,this.blockRecId),this.layers.set(e,t),t)},y.prototype.getLayerRecord=function(e){return this.layers.get(e)},y);function y(e){this.blockRecId=0,this.layers=new Map,this.blockRecId=e}n.MxCADDisplayLayerTable=v;var x=(_.prototype.getId=function(){return this.id},_.prototype.addBlkRef=function(e){this.blkRefs.set(e.id,e)},_.prototype.getAllBlkRef=function(){return this.blkRefs},_.prototype.addInstance=function(e){this.blkInstances.push(e)},_.prototype.deleteAllInstance=function(){this.blkInstances=new Array},_.prototype.deleteBlkRef=function(){this.blkRefs=new Map},_.prototype.getLayerTable=function(){return this.layerTable},_.prototype.getInstances=function(){return this.blkInstances},_.prototype.getInstances_class=function(){for(var e=[],t=new Map,n=this.blkInstances.length,r=0;r<n;r++){var i=this.blkInstances[r];if(0==i.clipPlans.clipPlanArray.length)e.push(i);else{var a=t.get(i.clipPlans.id);null==a&&(a=[],t.set(i.clipPlans.id,a)),a.push(i)}}var o={};return o.aryInstanceNoClip=e,o.mapInstanceClip=t,o},_);function _(e){this.id=0,this.blkRefs=new Map,this.blkInstances=new Array,this.id=e||0,this.layerTable=new v(this.id)}n.MxCADDisplayBlockRecord=x;var b=(w.prototype.crateBlockRecord=function(e){var t=this.blocks.get(e);return null==t&&(t=new x(e),this.blocks.set(e,t)),t},w.prototype.getBlockRecord=function(e){return this.blocks.get(e)},w.prototype.getAllBlockRecord=function(){return this.blocks},w.prototype.reInit=function(e){this.blocks=new Map,this.curSpaceBlockRecId=e||0,this.crateBlockRecord(this.curSpaceBlockRecId)},w);function w(){this.blocks=new Map,this.curSpaceBlockRecId=0}n.MxCADDisplayBlockTable=b;var M=function(){};n.MxCADLayerTableRecord=M;var S=(T.prototype.add=function(e,t,n,r){var i=new M;i.id=e,i.name=n,i.color=t,i.off=r,this.mapData.set(e,i)},T.prototype.getAllLayerData=function(){for(var e,t=new Array,n=this.mapData.values();!(e=n.next()).done;){var r=new M;r.color=e.value.color,r.name=e.value.name,r.off=e.value.off,r.id=e.value.id,t.push(r)}return t},T.prototype.setZeroLayerId=function(e){this.zeroLayerId=e},T.prototype.getZeroLayerId=function(){return this.zeroLayerId},T.prototype.getLayerIdForName=function(e){for(var t,n=this.mapData.values();!(t=n.next()).done;)if(t.value.name==e)return t.value.id;return 0},T.prototype.getColor=function(e){var t=this.mapData.get(e);return t?t.color:0},T.prototype.getRecord=function(e){return this.mapData.get(e)},T.prototype.isOff=function(e){var t=this.mapData.get(e);return!t||t.off},T.prototype.upDisplayForLayerData=function(e,t){for(var n,r=t,i=r.length,a=!1,o=function(t){var i=r[t],o=i.id;if(0==o)return"continue";var l=s.getRecord(o);if(!l)return"continue";var c=i.color.split(",");if(c.length<3)return"continue";var u=255&parseInt(c[0])|parseInt(c[1])<<8&65280|parseInt(c[2])<<16&16711680;if((16777215&l.color)==u)return"continue";l.color=4278190080&l.color|u,(n=[]).push((255&l.color)/255,(l.color>>8&255)/255,(l.color>>16&255)/255),e.getDisplayBlockTable().getAllBlockRecord().forEach(function(e){var t=e.getLayerTable().getLayerRecord(o);t&&t.upColorToByLayerMaterial(n)}),a=!0},s=this,l=0;l<i;l++)o(l);var c=function(t){var n=r[t],i=n.id;if(0==i)return"continue";var o=u.getRecord(i);return o&&o.off!=n.off?(o.off=n.off,e.getDisplayBlockTable().getAllBlockRecord().forEach(function(e){var t=e.getLayerTable().getLayerRecord(i);t&&t.show(!o.off)}),void(a=!0)):"continue"},u=this;for(l=0;l<i;l++)c(l);return a},T);function T(){this.mapData=new Map,this.zeroLayerId=0}n.MxCADLayerTable=S;var E,C,A=(L.prototype.initRootBlockRef=function(e){e?this.dpRootBlkRef=e:(this.dpRootBlkRef=new h,this.dpRootBlkRef.mat=new r.Matrix4,this.dpRootBlkRef.blkRecId=0,this.dpRootBlkRef.blkOwnerId=-1,this.dpRootBlkRef.layerId=-1,this.dpRootBlkRef.color=16777215,this.dpRootBlkRef.id=0)},L.prototype.reInit=function(){this.dpBlockTable=new b,this.layerTable=new S,this.memSections=new d,this.initRootBlockRef()},L.prototype.getMxObj=function(){return this.mxObj},L.prototype.getDisplayRootBlockRef=function(){return this.dpRootBlkRef},L.prototype.getDisplayBlockTable=function(){return this.dpBlockTable},L.prototype.getLayerTable=function(){return this.layerTable},L.prototype.getMemSections=function(){return this.memSections},L);function L(e){this.dpBlockTable=new b,this.dpRootBlkRef=null,this.layerTable=new S,this.memSections=new d,this.mxObj=null,this.mxObj=e,this.initRootBlockRef()}n.MxCADDatabase=A,(C=E=n.MxCADDisplayFun||(n.MxCADDisplayFun={})).showLayer=function(e,t,n){e.getDisplayBlockTable().getAllBlockRecord().forEach(function(e){var r=e.getLayerTable().getLayerRecord(t);r&&r.show(n)})},C.createThreejsObjForMemData_Clip=function(e,t,n,i,o,l){if(0==e.length)return!1;var u=[],h=[],p=e[0].clipPlans.clipPlanArray[0];u.push(p.x1,p.y1),h.push(p.x2,p.y2);for(var d=[],f=[],m=[],g=[],v=[],y=0;y<e.length;y++){var x=e[y];d=d.concat(x.mat.elements.slice(0,4)),f=f.concat(x.mat.elements.slice(4,8)),m=m.concat(x.mat.elements.slice(8,12)),g=g.concat(x.mat.elements.slice(12,16)),v.push(0)}var _=t.color,b=16777216==(4278190080&_);b&&(_=o);var w=[];w.push(255&_,(65280&_)>>8,(16711680&_)>>16);var M=this.mxObj.getCanvas(),S=.5*M.width,T=.5*M.height;if(t.type==c.kLinesType){var E=new r.RawShaderMaterial({uniforms:{color:{value:w},clippt1:{value:u},clippt2:{value:h},vieww:{value:S},viewh:{value:T}},vertexShader:a.MxShader.VSHADER_COLOR_POINT_CLIP_FORMXCAD,fragmentShader:a.MxShader.FSHADER_COLOR_POINT_CLIP_FORMXCAD,linewidth:1,transparent:!0});n.addClipMaterial(E),(A=new r.InstancedBufferGeometry).maxInstancedCount=e.length,A.setAttribute("position",new r.Float32BufferAttribute(t.points,2)),A.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(d),4)),A.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(f),4)),A.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(m),4)),A.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(g),4)),A.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(v),1));var C=new r.LineSegments(A,E);C.frustumCulled=!1,C.renderOrder=s.MxData.iCADCurveRenderOrder,i.add(C),n.addEntity(t.id,C),b&&n.addColorByLayerMaterial(t.id,E)}else if(t.type==c.kTriangleType){var A;E=new r.RawShaderMaterial({uniforms:{color:{value:w},clippt1:{value:u},clippt2:{value:h},vieww:{value:S},viewh:{value:T}},vertexShader:a.MxShader.VSHADER_COLOR_POINT_CLIP_FORMXCAD,fragmentShader:a.MxShader.FSHADER_COLOR_POINT_CLIP_FORMXCAD,transparent:!0,side:r.DoubleSide}),n.addClipMaterial(E),(A=new r.InstancedBufferGeometry).maxInstancedCount=e.length,A.setAttribute("position",new r.Float32BufferAttribute(t.points,2)),A.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(d),4)),A.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(f),4)),A.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(m),4)),A.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(g),4)),A.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(v),1));var L=new r.Mesh(A,E);L.frustumCulled=!1,L.renderOrder=s.MxData.iCADMeshRenderOrder,i.add(L),n.addEntity(t.id,L),b&&n.addColorByLayerMaterial(t.id,E)}},C.createThreejsObjForMemData=function(e,t,n,i,o,l){if(0==e.length)return!1;for(var u=[],h=[],p=[],d=[],f=[],m=0;m<e.length;m++){var g=e[m];u=u.concat(g.mat.elements.slice(0,4)),h=h.concat(g.mat.elements.slice(4,8)),p=p.concat(g.mat.elements.slice(8,12)),d=d.concat(g.mat.elements.slice(12,16)),f.push(0)}var v=t.color,y=16777216==(4278190080&v);y&&(v=o);var x=[];if(x.push((255&v)/255,(v>>8&255)/255,(v>>16&255)/255),t.type==c.kLinesType){var _=new r.RawShaderMaterial({uniforms:{color:{value:x}},vertexShader:a.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:a.MxShader.FSHADER_COLOR_POINT_FORMXCAD,linewidth:1,transparent:!0});(w=new r.InstancedBufferGeometry).maxInstancedCount=e.length,w.setAttribute("position",new r.Float32BufferAttribute(t.points,2)),w.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(u),4)),w.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(h),4)),w.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(p),4)),w.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(d),4)),w.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(f),1));var b=new r.LineSegments(w,_);b.frustumCulled=!1,b.renderOrder=s.MxData.iCADCurveRenderOrder,b.visible=!l,i.add(b),n.addEntity(t.id,b),y&&n.addColorByLayerMaterial(t.id,_)}else if(t.type==c.kTriangleType){var w;_=new r.RawShaderMaterial({uniforms:{color:{value:x}},vertexShader:a.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:a.MxShader.FSHADER_COLOR_POINT_FORMXCAD,transparent:!0,side:r.DoubleSide}),(w=new r.InstancedBufferGeometry).maxInstancedCount=e.length,w.setAttribute("position",new r.Float32BufferAttribute(t.points,2)),w.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(u),4)),w.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(h),4)),w.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(p),4)),w.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(d),4)),w.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(f),1));var M=new r.Mesh(w,_);M.frustumCulled=!1,M.renderOrder=s.MxData.iCADMeshRenderOrder,M.visible=!l,i.add(M),n.addEntity(t.id,M),y&&n.addColorByLayerMaterial(t.id,_)}};var D=(P.prototype.upDisplayFromChage_memData=function(e){var t=this.database.getDisplayBlockTable().getBlockRecord(e.blockId);if(null==t)return!1;var n=this.database.getLayerTable().getColor(e.layerId),r=this.database.getLayerTable().isOff(e.layerId),i=t.getLayerTable().createLayerRecord(e.layerId),a=this.mxObj.getScene(),o=t.getInstances_class();i.deleteMemorySectionEntitys(e.id,a);var s=o.aryInstanceNoClip,l=o.mapInstanceClip;0<s.length&&E.createThreejsObjForMemData(s,e,i,a,n,r);for(var c=l.values(),u=c.next();!u.done;){var h=u.value;E.createThreejsObjForMemData_Clip(h,e,i,a,n,r),u=c.next()}},P.prototype.upDisplayFromChage=function(e){for(var t=e.length,n=0;n<t;n++){var r=e[n];this.upDisplayFromChage_memData(r)}},P.prototype.OnMessageDisplayMemorySectionsFromChange=function(e){for(var t=this.database.getMemSections(),n=new o.MxCADNetData(e),r=n.getMxCADPointMemorySectionsHeadFromChange(),i=r.nOffset,a=[],s=0;s<r.datacount;s++){var l=n.getMxCADPointMemorySectionHeadFromChange(i);i=l.offset;var c=new p;c.layerId=l.layerId,c.blockId=l.blkId,c.id=l.memId,c.color=l.memColor,c.type=l.memType;var u=l.pointCount;if(!(u<1)){for(var h=[],d=0;d<u;d++){var f=e.getFloat32(i,!0);i+=4;var m=e.getFloat32(i,!0);i+=4,h.push(f,m)}c.points=h,t.add(c),a.push(c)}}this.upDisplayFromChage(a)},P.prototype.deleteMemorySectionAndEntity=function(e){var t=this.database.getMemSections(),n=t.get(e);if(!n)return!1;var r=this.database.getDisplayBlockTable().getBlockRecord(n.blockId);if(null==r)return t.remove(n.id),console.log("mx:blkrec null assert(0)"),!1;var i=r.getLayerTable().createLayerRecord(n.layerId),a=this.mxObj.getScene();return i.deleteMemorySectionEntitys(n.id,a),t.remove(n.id),!0},P.prototype.OnMessageDisplayNotUseMemorySectionsForChage=function(e){for(var t=new o.MxCADNetData(e).getMxCADNotUseMemorySectionsHeadForChage(),n=t.nCount,r=t.nOffset,i=0;i<n;i++){var a=e.getInt32(r,!0);r+=4,this.deleteMemorySectionAndEntity(a)}},P);function P(e){this.database=null,this.mxObj=null,this.database=e,this.mxObj=e.getMxObj()}n.MxCADSyncDisplay=D},{"./MxCADNetData":28,"./MxFun":45,"./MxManager":51,"./MxShader":55,three:19}],27:[function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADGripJig=n.MxCADGrip=n.MxCADGripData=void 0;var a=e("three"),o=e("./MxFun"),s=e("./MxThreeJS"),l=e("./MxJig"),c=e("./MxJigCmdManager"),u=e("./MxManager"),h=function(){this.threeObject=null};n.MxCADGripData=h;var p=(d.prototype.getParentObject=function(){return this.mxObj.getTheTempDrawContainer()},d.prototype.removeAllEntity=function(){var e=this.getParentObject();this.mapGrips.forEach(function(t,n,r){for(var i=t.length,a=0;a<i;a++){var s=t[a];o.MxFun.removeThreejsObject(s.threeObject,e)}}),this.mapGrips=new Map},d.prototype.deleteGripData=function(e){var t=this.getParentObject(),n=this.mapGrips.get(e);if(n)for(var r=n.length,i=0;i<r;i++){var a=n[i];o.MxFun.removeThreejsObject(a.threeObject,t)}this.mapGrips.delete(e)},d.prototype.deleteEntityData=function(e){this.mapEntityData.delete(e)},d.prototype.addGripData=function(e,t,n,r){var i=this.mapGrips.get(e);null==i&&(i=new Array,this.mapGrips.set(e,i));var o=new h;return o.iIndex=t,o.point=new a.Vector3(n,r,0),i.push(o),o},d.prototype.createGripDisplayObject=function(e){var t=this.getParentObject();e.geometry=new a.Geometry;var n=this.mxObj.screenCoordLong2Doc(8);e.geometry.vertices.push(new a.Vector3(e.point.x-n,e.point.y-n,0)),e.geometry.vertices.push(new a.Vector3(e.point.x-n,e.point.y+n,0)),e.geometry.vertices.push(new a.Vector3(e.point.x+n,e.point.y+n,0)),e.geometry.vertices.push(new a.Vector3(e.point.x+n,e.point.y-n,0)),e.geometry.faces.push(new a.Face3(0,1,2)),e.geometry.faces.push(new a.Face3(2,3,0)),e.geometry.computeFaceNormals(),e.geometry.computeVertexNormals();var r=new a.MeshBasicMaterial({color:255,transparent:!0,depthTest:!1,side:a.DoubleSide,opacity:.9}),i=new a.Mesh(e.geometry,r);i.renderOrder=u.MxData.iGripRenderOrder,t.add(i),e.threeObject=i},d.prototype.clearAll=function(){return this.mapEntityData=new Map,0!=this.mapGrips.size&&(this.removeAllEntity(),!0)},d.prototype.addEntityData=function(e,t){this.mapEntityData.set(e,t)},d.prototype.onIntelliSelect=function(e){for(var t=JSON.parse(e),n=t.vecEntityData.length,r=0;r<n;r++){var i=t.vecEntityData[r],a=i.lIdIndex;this.addEntityData(a,i.entity),this.deleteGripData(a);for(var o=i.vecGrip.length,s=0;s<o;s++){var l=i.vecGrip[s],c=this.addGripData(a,l.iIndex,l.ptx,l.pty);this.createGripDisplayObject(c)}}},d.prototype.onControlsChage=function(){if(0!=this.mapGrips.size){var e=this.mxObj.screenCoordLong2Doc(8);this.mapGrips.forEach(function(t,n,r){for(var i=t.length,a=0;a<i;a++){var o=t[a];4==o.geometry.vertices.length&&(o.geometry.vertices[0].x=o.point.x-e,o.geometry.vertices[0].y=o.point.y-e,o.geometry.vertices[1].x=o.point.x-e,o.geometry.vertices[1].y=o.point.y+e,o.geometry.vertices[2].x=o.point.x+e,o.geometry.vertices[2].y=o.point.y+e,o.geometry.vertices[3].x=o.point.x+e,o.geometry.vertices[3].y=o.point.y-e,o.geometry.computeFaceNormals(),o.geometry.computeVertexNormals(),o.geometry.verticesNeedUpdate=!0)}})}},d.prototype.hitTest=function(e){var t={grips:new Array,ids:new Array,pt:e},n=new a.Vector3(e.x,e.y,0),r=this.mxObj.screenCoordLong2Doc(8);return this.mapGrips.forEach(function(e,i){for(var a=e.length,o=0;o<a;o++){var s=e[o];if(s.point.distanceTo(n)<=r){t.grips.push(s),t.ids.push(i);break}}}),t},d.prototype.onMouseLBDown=function(e){var t=this.hitTest(e);return 0!=t.grips.length&&(o.MxFun.sendStringToExecute("Mx_GripEdit",t),!0)},d.prototype.gripEditImp=function(e){var t=e.grips,n=e.ids,r=e.pt,i=new m(r,t,n,this.mapEntityData);i.setDisableDynInput(!0),i.setDisableOsnap(!0),c.MxJigCmdManager.runCmd(i)},d);function d(e){this.mxObj=null,this.mapGrips=new Map,this.mapEntityData=new Map,this.mxObj=e}n.MxCADGrip=p;var f,m=(i(g,f=l.McEdJigCommand),g.prototype.sampler=function(){var e=c.MxJigCmdManager.InType.kGetBegan,t=this.acquirePoint(e);return t.status==c.MxJigCmdManager.DragStatus.kNormal&&(this.currPt=t.pt),t.status},g.prototype.getTypeName=function(){return"MxGripEdit"},g.prototype.done=function(e){if(e==c.MxJigCmdManager.DragStatus.kNormal){var t=[];t.push(this.currPt.x,this.currPt.y);for(var n=this.getMxObject(),r=n.getMxCAD().getGrip(),i=n.getMxCAD().getSelect(),a=this.grips.length,o=0;o<a;o++){var s=this.grips[o],l=this.ids[o];t.push(l,s.iIndex),r.deleteGripData(l),r.deleteEntityData(l),i.removeAllEntity()}n.callCommand("MxCAD_GridEdit",JSON.stringify(t),function(e){r.onIntelliSelect(e)})}return c.MxJigCmdManager.DoneStatius.kExitCommand},g.prototype.upDisplay_Line=function(e,t){var n=new a.Vector3(e.pt1x,e.pt1y,0),r=new a.Vector3(e.pt2x,e.pt2y,0);if(0==t.iIndex)n.x=this.currPt.x,n.y=this.currPt.y;else if(1==t.iIndex)r.x=this.currPt.x,r.y=this.currPt.y;else if(2==t.iIndex){var i=r.x+.5*(n.x-r.x),o=r.y+.5*(n.y-r.y),l=this.currPt.x-i,c=this.currPt.y-o;n.x+=l,n.y+=c,r.x+=l,r.y+=c}var u=s.MxThreeJS.createLine(n,r,16777215);this.drawEntity(u,31)},g.prototype.upDisplay=function(){for(var e=this.grips.length,t=0;t<e;t++){var n=this.grips[t],r=this.ids[t],i=this.mapEntityData.get(r);i&&"McDbLine"==i.name&&this.upDisplay_Line(i,n)}},g);function g(e,t,n,r){var i=f.call(this)||this;return i.pt=e,i.grips=t,i.ids=n,i.currPt=e,i.mapEntityData=r,i}n.MxCADGripJig=m},{"./MxFun":45,"./MxJig":47,"./MxJigCmdManager":48,"./MxManager":51,"./MxThreeJS":58,three:19}],28:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADNetData=void 0;var r=(i.prototype.getBlobHead=function(e){var t={};return t.type=this._dataView.getInt32(e,!0),e+=4,t.ver=this._dataView.getInt32(e,!0),e+=4,t.databaseIndex=this._dataView.getInt32(e,!0),e+=4,t.nOffset=e,t},i.prototype.getMxCADPointMemorySectionsHead=function(){var e=this.getBlobHead(0);return e.zeroLayerIdIndex=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.datacount=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.datasize=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.datasize!=e.nOffset&&console.log("mx: sectionshead size assert(0)"),e},i.prototype.getMxCADPointMemorySectionsHeadFromChange=function(){var e=this.getBlobHead(0);return e.zeroLayerIdIndex=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.datacount=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.datasize=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.datasize!=e.nOffset&&console.log("mx: sectionshead size assert(0)"),e},i.prototype.getMxCADPointMemorySectionHead=function(e){var t=this.getBlobHead(e);return e=t.nOffset,t.pointCount=this._dataView.getInt32(e,!0),e+=4,t.layerId=this._dataView.getInt32(e,!0),e+=4,t.blkId=this._dataView.getInt32(e,!0),e+=4,t.memColor=this._dataView.getInt32(e,!0),e+=4,t.memId=this._dataView.getInt32(e,!0),e+=4,t.memType=this._dataView.getInt32(e,!0),e+=4,t.offset=e,t},i.prototype.getMxCADPointMemorySectionHeadFromChange=function(e){var t=this.getBlobHead(e);return e=t.nOffset,t.pointCount=this._dataView.getInt32(e,!0),e+=4,t.layerId=this._dataView.getInt32(e,!0),e+=4,t.blkId=this._dataView.getInt32(e,!0),e+=4,t.memColor=this._dataView.getInt32(e,!0),e+=4,t.memId=this._dataView.getInt32(e,!0),e+=4,t.memType=this._dataView.getInt32(e,!0),e+=4,t.offset=e,t},i.prototype.getMxCADBlockRefsHead=function(){var e=this.getBlobHead(0);return e.nBlockRefCount=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.datasize=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.datasize!=e.nOffset&&console.log("mx: sectionshead size assert(0)"),e},i.prototype.getMxCADNotUseMemorySectionsHeadForChage=function(){var e=this.getBlobHead(0);return e.nCount=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.datasize=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.datasize!=e.nOffset&&console.log("mx: sectionshead size assert(0)"),e},i.prototype.getEntityDisplayDatasHead=function(){var e=this.getBlobHead(0);return e.nCount=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.datasize=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.datasize!=e.nOffset&&console.log("mx: sectionshead size assert(0)"),e},i.prototype.getEntityDisplayDataHead=function(e){var t=this.getBlobHead(e);return t.nCount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.type=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset-e&&console.log("mx: sectionshead size assert(0)"),t},i);function i(e){this._dataView=e}n.MxCADNetData=r},{}],29:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADObject=void 0;var r=e("./MxCADEditDisplay"),i=e("./MxCADOpenDisplay"),a=e("./MxCADSelect"),o=e("./MxCADGrip"),s=(l.prototype.reInit=function(){this.openDisplay.reInit(),this.databsae.reInit(),this.mxObj.reInit()},l.prototype.getSelect=function(){return this.select},l.prototype.getGrip=function(){return this.grip},l.prototype.newFile=function(){this.reInit(),this.openFile("")},l.prototype.undo=function(){this.mxObj.undo()},l.prototype.openFile=function(e,t){var n=this;this.reInit(),this._openFile=e,this.mxObj.callCommand("MxCAD_OpenFile",JSON.stringify({file:e}),function(e){n.mxObj.callCommand("MxCAD_SendDisplay"),"string"!=typeof e||e.length<1?t&&t({}):t&&t(JSON.parse(e))})},l.prototype.saveFile=function(e,t){this.mxObj.callCommand("MxCAD_SaveFile",JSON.stringify({file:e}),function(e){t(JSON.parse(e))})},l.prototype.getDisplayFromServer=function(){this.reInit(),this.mxObj.callCommand("MxCAD_SendDisplay")},l.prototype.getFileName=function(){return this._openFile},l.prototype.getDatabase=function(){return this.databsae},l.prototype.getOpenDisplay=function(){return this.openDisplay},l.prototype.getSyncDisplay=function(){return this.syncDisplay},l.prototype.getAllLayerData=function(){return this.databsae.getLayerTable().getAllLayerData()},l);function l(e){this._openFile="",this.mxObj=null,this.databsae=null,this.openDisplay=null,this.syncDisplay=null,this.select=null,this.grip=null,this.mxObj=e,this.databsae=new r.MxCADDatabase(e),this.openDisplay=new i.MxCADOpenDisplay(this.databsae),this.syncDisplay=new r.MxCADSyncDisplay(this.databsae),this.select=new a.MxCADSelect(e),this.grip=new o.MxCADGrip(e)}n.MxCADObject=s},{"./MxCADEditDisplay":26,"./MxCADGrip":27,"./MxCADOpenDisplay":30,"./MxCADSelect":31}],30:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADOpenDisplay=void 0;var r=e("three"),i=e("./MxCADNetData"),a=e("./MxCADEditDisplay"),o=(s.prototype.createAllInstanceCall=function(e,t,n,i,o){if(!i.get(e.getId())){i.set(e.getId(),!0);var s=new a.MxCADDisplayBlockInstance;if(s.mat=new r.Matrix4,s.mat.copy(n),s.idBlkRef=t.id,s.mat.multiply(t.mat),0==t.clipPlans.clipPlanArray.length)s.clipPlans=o;else{s.clipPlans=t.clipPlans;for(var l=s.clipPlans.clipPlanArray.length,c=0;c<l;c++){var u=new r.Vector3(s.clipPlans.clipPlanArray[c].x1,s.clipPlans.clipPlanArray[c].y1,0),h=new r.Vector3(s.clipPlans.clipPlanArray[c].x2,s.clipPlans.clipPlanArray[c].y2,0);u.applyMatrix4(s.mat),h.applyMatrix4(s.mat),s.clipPlans.clipPlanArray[c].x1=u.x,s.clipPlans.clipPlanArray[c].y1=u.y,s.clipPlans.clipPlanArray[c].x2=h.x,s.clipPlans.clipPlanArray[c].y2=h.y}}e.addInstance(s);for(var p=this.database.getDisplayBlockTable(),d=e.getAllBlkRef().values(),f=d.next();!f.done;){var m=f.value;if(0!=m.blkRecId){var g=p.getBlockRecord(m.blkRecId);null!=g&&(this.createAllInstanceCall(g,m,s.mat,i,s.clipPlans),f=d.next())}}i.set(e.getId(),!1)}},s.prototype.deleteAllInstance=function(){for(var e=this.database.getDisplayBlockTable().getAllBlockRecord().values(),t=e.next();!t.done;)t.value.deleteAllInstance(),t=e.next()},s.prototype.createAllInstance=function(){this.deleteAllInstance();var e=this.database.getDisplayBlockTable().getBlockRecord(0);if(null==e)return!1;var t=this.database.getDisplayRootBlockRef(),n=new r.Matrix4,i=new Map,o=new a.MxCADDisplayClipPlans;return this.createAllInstanceCall(e,t,n,i,o),this.isCreateInstance=!0},s.prototype.creteDisplayForMemData=function(e){var t=this.database.getDisplayBlockTable().getBlockRecord(e.blockId);if(null==t)return!1;var n=t.getLayerTable().createLayerRecord(e.layerId),r=this.database.getLayerTable().getColor(e.layerId),i=this.database.getLayerTable().isOff(e.layerId),o=this.mxObj.getScene(),s=t.getInstances_class(),l=s.aryInstanceNoClip,c=s.mapInstanceClip;0<l.length&&a.MxCADDisplayFun.createThreejsObjForMemData(l,e,n,o,r,i);for(var u=c.values(),h=u.next();!h.done;){var p=h.value;a.MxCADDisplayFun.createThreejsObjForMemData_Clip(p,e,n,o,r,i),h=u.next()}},s.prototype.creteDisplayForNewData=function(){if(this.isCreateInstance||this.isGetDisplayBlockRef&&this.isGetLayerTable&&this.createAllInstance(),this.isCreateInstance){for(var e=this.vecNewCreateDisplayData.length,t=0;t<e;t++){var n=this.vecNewCreateDisplayData[t];this.creteDisplayForMemData(n)}this.vecNewCreateDisplayData=[]}},s.prototype.reInit=function(){this.isGetDisplayBlockRef=!1,this.isCreateInstance=!1,this.isGetLayerTable=!1,this.vecNewCreateDisplayData=[]},s.prototype.getMxOb=function(){return this.mxObj},s.prototype.OnMessageLayerData=function(e){var t=this.database.getLayerTable(),n=JSON.parse(e);if(null!=n){var r=n.list;for(var i in r)t.add(r[i].id,r[i].colorvalue,r[i].name,1==r[i].off),1==r[i].zerolayer&&t.setZeroLayerId(r[i].id)}this.isGetLayerTable=!0,this.creteDisplayForNewData()},s.prototype.OnMessageDisplayBlockRef=function(e){var t=this.database.getDisplayBlockTable();t.reInit();for(var n=new i.MxCADNetData(e).getMxCADBlockRefsHead(),o=n.nBlockRefCount,s=n.nOffset,l=1,c=0;c<o;c++){var u=e.getInt32(s,!0);s+=4;var h=e.getInt32(s,!0);s+=4;var p=e.getInt32(s,!0);s+=4;var d=e.getInt32(s,!0);s+=4;var f=e.getInt32(s,!0);s+=4;for(var m=new Array,g=0;g<16;g++){var v=e.getFloat32(s,!0);s+=4,m.push(v)}var y=e.getInt32(s,!0);s+=4;var x=new a.MxCADDisplayClipPlans;x.id=l,l++,x.clipPlanArray=[];for(var _=0;_<y;_++){var b=e.getFloat32(s,!0);s+=4;var w=e.getFloat32(s,!0);s+=4;var M=e.getFloat32(s,!0);s+=4;var S=e.getFloat32(s,!0);s+=4;var T=new a.MxCADDisplayClipPlan;T.x1=b,T.y1=w,T.x2=M,T.y2=S,x.clipPlanArray.push(T)}var E=new a.MxCADDisplayBlockRef;E.mat=new r.Matrix4,E.mat.fromArray(m),E.blkRecId=d,E.blkOwnerId=h,E.layerId=p,E.color=f,E.clipPlans=x,E.id=u,t.crateBlockRecord(d);var C=t.getBlockRecord(E.blkOwnerId);C?C.addBlkRef(E):console.log("ownerBlkRec == null,assert(0)")}this.isGetDisplayBlockRef=!0,this.creteDisplayForNewData()},s.prototype.OnMessageDisplayMemorySections=function(e){for(var t=this.database.getMemSections(),n=new i.MxCADNetData(e),r=n.getMxCADPointMemorySectionsHead(),o=r.nOffset,s=0;s<r.datacount;s++){var l=n.getMxCADPointMemorySectionHead(o);o=l.offset;var c=new a.MxCADDisplayMemorySection;c.layerId=l.layerId,c.blockId=l.blkId,c.id=l.memId,c.color=l.memColor,c.type=l.memType;var u=l.pointCount;if(!(u<1)){for(var h=[],p=0;p<u;p++){var d=e.getFloat32(o,!0);o+=4;var f=e.getFloat32(o,!0);o+=4,h.push(d,f)}c.points=h,t.add(c),this.vecNewCreateDisplayData.push(c)}}this.creteDisplayForNewData()},s);function s(e){this.database=null,this.isGetDisplayBlockRef=!1,this.isCreateInstance=!1,this.isGetLayerTable=!1,this.vecNewCreateDisplayData=[],this.mxObj=null,this.database=e,this.mxObj=e.getMxObj()}n.MxCADOpenDisplay=o},{"./MxCADEditDisplay":26,"./MxCADNetData":28,three:19}],31:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADSelect=n.MxCADSelectDisplayEntityData=n.MxCADSelectDisplayEntityDataType=void 0;var r,i,a=e("three"),o=e("./MxFun"),s=e("three.meshline"),l=e("./MxCADNetData"),c=e("./MxManager");(i=r=n.MxCADSelectDisplayEntityDataType||(n.MxCADSelectDisplayEntityDataType={}))[i.kLinesType=1]="kLinesType",i[i.kTriangleType=2]="kTriangleType";var u=function(){this.type=r.kLinesType,this.points=[]};n.MxCADSelectDisplayEntityData=u;var h=(p.prototype.getParentObject=function(){return this.mxObj.getTheTempDrawContainer()},p.prototype.removeAllEntity=function(){for(var e=this.getParentObject(),t=this.aryThreeObject.length,n=0;n<t;n++)o.MxFun.removeThreejsObject(this.aryThreeObject[n],e);this.aryThreeObject=[]},p.prototype.clearAllSelect=function(){return this.mxObj.callCommand("MxCAD_ClearSelect"),0!=this.aryThreeObject.length&&(this.removeAllEntity(),!0)},p.prototype.OnMessageEntityDisplayDatas=function(e){for(var t=new l.MxCADNetData(e),n=t.getEntityDisplayDatasHead(),i=n.nOffset,o=[],h=0;h<n.nCount;h++){var p=t.getEntityDisplayDataHead(i);i=p.nOffset,(M=new u).type=p.type;var d=p.nCount;if(!(d<1)){for(var f=[],m=0;m<d;m+=2){var g=e.getFloat32(i,!0);i+=4;var v=e.getFloat32(i,!0);i+=4,f.push(g,v)}M.points=f,o.push(M)}}var y=this.mxObj.getViewWidth(),x=this.mxObj.getViewHeight();this.material.resolution=new a.Vector2(y,x);for(var _=o.length,b=this.getParentObject(),w=0;w<_;w++){var M;if((M=o[w]).type==r.kLinesType)for(var S=M.points.length,T=0;T+3<S;T+=4){var E=new Float32Array(6);E[0]=M.points[T],E[1]=M.points[T+1],E[2]=0,E[3]=M.points[T+2],E[4]=M.points[T+3],E[5]=0;var C=new s.MeshLine;C.setGeometry(E);var A=new a.Mesh(C.geometry,this.material);A.renderOrder=c.MxData.iSelectRenderOrder,b.add(A),this.aryThreeObject.push(A)}else if(M.type==r.kTriangleType){S=M.points.length;var L=new a.Geometry,D=0;for(T=0;T+5<S;T+=6){var P=new a.Vector3(M.points[T],M.points[T+1],0),O=new a.Vector3(M.points[T+2],M.points[T+3],0),R=new a.Vector3(M.points[T+4],M.points[T+5],0);L.vertices.push(P),L.vertices.push(O),L.vertices.push(R);var I=new a.Face3(D,D+1,D+2);L.faces.push(I),D+=3}var B=new a.Mesh(L,this.materialFill);B.renderOrder=c.MxData.iSelectRenderOrder,b.add(B),this.aryThreeObject.push(B)}}},p);function p(e){this.aryThreeObject=[],this.mxObj=null,this.material=new s.MeshLineMaterial({useMap:!1,color:new a.Color(2641557),opacity:1,resolution:new a.Vector2(500,500),sizeAttenuation:!1,lineWidth:10,transparent:!0,depthTest:!1}),this.materialFill=new a.MeshBasicMaterial({color:new a.Color(2641557),opacity:.8,side:a.DoubleSide,transparent:!0,depthTest:!1}),this.mxObj=e}n.MxCADSelect=h},{"./MxCADNetData":28,"./MxFun":45,"./MxManager":51,three:19,"three.meshline":18}],32:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxCadSketchLayers=n.MxCadSketchLayer=void 0;var r=(i.prototype.addEntity=function(e){this._setEntityId.add(e)},i.prototype.getId=function(){return this.id},i.prototype.setId=function(e){this.id=e},i.prototype.removeEntity=function(e){this._setEntityId.delete(e)},i.prototype.show=function(e){var t=this;this._setEntityId.forEach(function(n){var r=t._mxobj.getEntity(n);if(null!=r)for(var i=0,a=r.length;i<a;i++)r[i].visible=e})},i);function i(e){this._setEntityId=new Set,this.id=0,this._mxobj=null,this._mxobj=e}n.MxCadSketchLayer=r;var a=(o.prototype.getLayer=function(e,t){var n=this._mapId2Layers.get(e);return null==n&&((n=new r(this._mxobj)).setId(e),this._mapId2Layers.set(e,n)),n},o.prototype.addEntity=function(e,t){this.getLayer(t).addEntity(e)},o.prototype.removeEntity=function(e){this._mapId2Layers.forEach(function(t){t.removeEntity(e)})},o.prototype.removeAllEntity=function(){this._mapId2Layers.clear()},o);function o(e){this._mxobj=null,this._mapId2Layers=new Map,this._mxobj=e}n.MxCadSketchLayers=a},{}],33:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxCmdRunManager=void 0;var r,i,a,o,s,l,c,u=e("./MxFun"),h=e("./MxType"),p=e("./MxJigCmdManager"),d=e("./MxUiVue");r=n.MxCmdRunManager||(n.MxCmdRunManager={}),i={},a=new Array,o=0,s=!1,l="",c={},r.InitQuickCommand=function(e){for(var t=e.length,n=0;n<t;n++){var r=e[n];if(!(r.length<2)){var i=r[0];if(0!=i.length)for(var a=r.length,o=1;o<a;o++)0!=r[o].length&&(c[r[o].toUpperCase()]=i)}}},r.MoveUpKey=function(){return s?++o>=a.length&&(o=0):s=!0,!0},r.MoveDownKey=function(){return!!s&&(--o<0&&(o=a.length-1),!0)},r.GetListCommad=function(){return o<0||o>=a.length?"":a[o]},r.ClearPrvCmd=function(){l=""},r.GetPrvCmd=function(){return l},r.SetPrvCmd=function(e){l=e},r.runCmd=function(e,t,n){var r=t.toUpperCase(),f=i[r];if(null==f){var m=c[r];if(null!=m&&(f=i[m.toUpperCase()]),null==f)return d.MxUiVue.isNull()?console.log(u.MxFun.formatString('未知命令"{0}"',t)):d.MxUiVue.acutPrintf('未知命令"{0}"。\n命令:',t),!1}var g=a.indexOf(f.cmd);-1<g&&a.splice(g,1),s=!(o=0),a.push(f.cmd),l=f.cmd;var v=f.fun;if(0==(f.flag&h.MxType.CommandFlags.MCRX_CMD_TRANSPARENT)&&d.MxUiVue.acutPrintf("{0}\n",f.cmd),p.MxJigCmdManager.stopCmd(),e.undoMark(),"Mx_GripEdit"!=t&&"Mx_IntelliSel"!=t){var y=e.getMxCAD();if(y){var x=y.getSelect().clearAllSelect(),_=y.getGrip().clearAll();(x||_)&&e.updateDisplay()}}return v(n),p.MxJigCmdManager.isRunning()||d.MxUiVue.restoreCmdStatus(),e.updateDisplay(),!0},r.addCommand=function(e,t,n){null==n&&(n=h.MxType.CommandFlags.MCRX_CMD_MODAL);var r=e.toUpperCase();i[r]={fun:t,cmd:e,flag:n}}},{"./MxFun":45,"./MxJigCmdManager":48,"./MxType":60,"./MxUiVue":64}],34:[function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n=n||Promise)(function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(o,s)}l((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=0<(i=o.trys).length&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbDatabase=void 0;var a=e("three"),o=e("./MxFun"),s=e("./MxDbEntity"),l=e("./MxDbEntityGrip"),c=e("./MxDbEntitySelect"),u=e("./MxManager"),h=e("./MxType"),p=(d.prototype.getAllEntity=function(){return this.mapIdToEntity},d.prototype.upDirtyDisplay=function(){var e=!1;return this.mapIdToEntity.forEach(function(t){t.getDirtyDisplay()&&(t.upDisplay(),t.setDirtyDisplay(!1),e=!0)}),e},d.prototype.onViewChange=function(){var e=!1;return this.mapIdToEntity.forEach(function(t){t.onViewChange()&&(e=!0)}),e},d.prototype.saveJson=function(){var e={ver:1},t=new a.Vector3(0,0,0),n=new a.Vector3(this.mxObj.getViewWidth(),this.mxObj.getViewHeight(),0),r=this.mxObj.screenCoord2Doc(t.x,t.y,0),i=this.mxObj.screenCoord2Doc(n.x,n.y,0);e.view={ptView1:r,ptView2:i};var o=[];return this.mapIdToEntity.forEach(function(e){var t=e.getUserObject(),n={type:h.MxType.MxCloneType.kMxFileClone};t.dwgOut(n),n.TypeName=t.getTypeName(),o.push(n)}),e.entitys=o,JSON.stringify(e)},d.prototype.loadJson=function(e){return r(this,void 0,void 0,function(){var t,n,r,a,o,l,c,h;return i(this,function(i){switch(i.label){case 0:(t=JSON.parse(e)).view&&(n=t.view,this.mxObj.zoomW(n.ptView1,n.ptView2,!1)),r=t.entitys,a=r.length,o=0,i.label=1;case 1:return o<a?(l=r[o],[4,u.MxManager.getMxDbEntityClassHierarchy().createMxEntity(l.TypeName)]):[3,4];case 2:if(!(c=i.sent()))return[3,3];c.dwgIn(l),(h=new s.MxDbEntity).initUserObject(c),this.addEntity(h),i.label=3;case 3:return o++,[3,1];case 4:return[2,new Promise(function(e){e(!0)})]}})})},d.prototype.getMxObject=function(){return this.mxObj},d.prototype.getGripManager=function(){return this.gripManager},d.prototype.getSelectManager=function(){return this.selectManager},d.prototype.clearMxCurrentSelect=function(){var e=!1;return this.gripManager.removeAllGrips()&&(e=!0),this.selectManager.removeAllEntity()&&(e=!0),e},d.prototype.eraseAllEntity=function(){var e=this.getThreeJSParentObject();this.mapIdToEntity.forEach(function(t){t.clearDisplayImp(e)}),this.mapIdToEntity=new Map,this.clearMxCurrentSelect()},d.prototype.intiDoc2Wold=function(e){this.parentObject.matrix=e,this.parentObject.matrixAutoUpdate=!1},d.prototype.init=function(e){this.mxObj=e,this.scene=e.getScene(),o.MxFun.removeThreejsObject(this.parentObject,this.scene),this.parentObject=new a.Object3D,this.parentObject.renderOrder=u.MxData.iMxEntityRenderOrder,this.scene.add(this.parentObject)},d.prototype.getEntity=function(e){return this.mapIdToEntity.get(e)},d.prototype.setRenderOrder=function(e){var t=this.parentObject.renderOrder;return this.parentObject.renderOrder=e,t},d.prototype.eraseEntity=function(e){this.gripManager.deleteGripData(e),this.selectManager.deleteSelect(e),this.mapIdToEntity.delete(e)},d.prototype.addEntity=function(e){return this.mapIdToEntity.set(this.idCount,e),e.setMxDatabase(this),e.setObjectId(this.idCount),e.upDisplay(),this.idCount++},d.prototype.getThreeJSParentObject=function(){return this.parentObject},d.prototype.getIntersectObjects=function(e){var t=new a.Raycaster;t.linePrecision=this.mxObj.screenCoordLong2Doc(40);var n=this.mxObj.getCanvas(),r=n.clientWidth,i=n.clientHeight,o=new a.Vector2(e.x/r*2-1,-e.y/i*2+1);return t.setFromCamera(o,this.mxObj.getCamera()),t.intersectObjects(this.parentObject.children,!0)},d);function d(){this.mapIdToEntity=new Map,this.mxObj=null,this.scene=null,this.idCount=1,this.parentObject=null,this.gripManager=new l.MxDbEntityGrip(this),this.selectManager=new c.MxDbEntitySelect(this)}n.MxDbDatabase=p},{"./MxDbEntity":35,"./MxDbEntityGrip":36,"./MxDbEntitySelect":37,"./MxFun":45,"./MxManager":51,"./MxType":60,three:19}],35:[function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n=n||Promise)(function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(o,s)}l((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=0<(i=o.trys).length&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbEntity=n.MxDbEntityClassHierarchy=n.MxDbEntityUserObject=void 0;var a=e("three"),o=e("./McGiWorldDraw"),s=e("./MxManager"),l=e("./MxTools"),c=e("./MxType"),u=(h.prototype.getTypeName=function(){return""},h.prototype.getMxObject=function(){var e=this.getImp();return e?e.getMxObject():null},h.prototype.onViewChange=function(){return!1},h.prototype.getImp=function(){return this.MxDbEntityImp},h.prototype.upDisplay=function(){var e=this.getImp();return!!e&&e.upDisplay()},h.prototype.erase=function(){var e=this.getImp();return!!e&&e.erase()},h.prototype.setColor=function(e){this.iColor=e},h.prototype.getColor=function(){return this.iColor},h.prototype.setRenderOrder=function(e){this.iRenderOrder=e},h.prototype.getRenderOrder=function(){return this.iRenderOrder},h.prototype.dwgIn=function(e){return this.iColor=e.iColor,this.iRenderOrder=e.iRenderOrder,this.opacity=e.opacity,this.visible=e.visible,!0},h.prototype.dwgOut=function(e){return e.iColor=this.iColor,e.iRenderOrder=this.iRenderOrder,e.opacity=this.opacity,e.visible=this.visible,e},h.prototype.clone=function(e){var t=this.create(),n={type:e||c.MxType.MxCloneType.kClone};return this.dwgOut(n),t.dwgIn(n),t},h.prototype.init=function(){s.MxManager.getMxDbEntityClassHierarchy().init(this)},h.prototype.transformBy=function(e){},h.prototype.objectId=function(){var e=this.getImp();return e?e.objectId():0},h);function h(){this.iColor=16777215,this.iRenderOrder=s.MxData.iMxEntityRenderOrder,this.opacity=1,this.visible=!0}n.MxDbEntityUserObject=u;var p=(d.prototype.init=function(e){var t=e.getTypeName();this.mapType2Create.get(t)&&console.log("MxError:already has this class name "+t),this.mapType2Create.set(t,{type:0,createfun:e})},d.prototype.initDynamic=function(e){this.dynmaicCreate=e},d.prototype.createMxEntity=function(e){return r(this,void 0,void 0,function(){var t,n;return i(this,function(r){switch(r.label){case 0:return(t=this.mapType2Create.get(e))?[3,3]:this.dynmaicCreate?[4,this.dynmaicCreate(e)]:[3,2];case 1:return(n=r.sent())?(this.mapType2Create.set(e,{type:1,createfun:n}),[2,new Promise(function(e,t){e(new n)})]):(this.mapType2Create.set(e,{type:2,createfun:null}),[2,new Promise(function(e,t){e(null)})]);case 2:return[2,new Promise(function(e,t){e(null)})];case 3:return 0==t.type?[2,new Promise(function(e,n){e(t.createfun.create())})]:1==t.type?[2,new Promise(function(e,n){e(new t.createfun)})]:[2,new Promise(function(e,t){e(null)})]}})})},d);function d(){this.mapType2Create=new Map,this.dynmaicCreate=null}n.MxDbEntityClassHierarchy=p;var f=(m.prototype.setObjectId=function(e){this.id=e},m.prototype.setDirtyDisplay=function(e){this.isDirtyDisplay=e},m.prototype.getDirtyDisplay=function(){return this.isDirtyDisplay},m.prototype.setMxDatabase=function(e){this.mxDatabase=e},m.prototype.objectId=function(){return this.id},m.prototype.initUserObject=function(e){(this.userObject=e).MxDbEntityImp=this},m.prototype.upDisplay=function(){if(!this.mxDatabase)return!1;this.updateDisplayImp(this.mxDatabase.getThreeJSParentObject(),this.mxDatabase.getMxObject())},m.prototype.erase=function(){if(0==this.id)return!1;this.clearDisplayImp(this.mxDatabase.getThreeJSParentObject()),this.userObject=null,this.mxDatabase.eraseEntity(this.id),this.id=0,this.mxDatabase=null},m.prototype.clearDisplayImp=function(e){this.threeObjectGroup&&(this.threeObjectGroup.traverse(function(e){"Mesh"===e.type&&(e.geometry.dispose(),e.material.dispose())}),e.remove(this.threeObjectGroup)),this.threeObjectGroup=null},m.prototype.updateDisplayImp=function(e,t){if(this.clearDisplayImp(e),this.userObject){if(this.userObject.visible){this.threeObjectGroup=new a.Group;var n=new o.McGiWorldDraw(t,o.McGiWorldDrawType.kWorldDraw);n.setupForEntity(this.userObject),this.worldDraw(n);for(var r=n.getEntitys(),i=r.length,s=0;s<i;s++){var c=r[s];(c.MxDbEntity=this).threeObjectGroup.add(c)}e.add(this.threeObjectGroup)}}else l.MxTools.MxASSERT(!1,"this.userObject == null")},m.prototype.worldDraw=function(e){this.userObject.worldDraw(e)},m.prototype.getGripPoints=function(){return this.userObject.getGripPoints()},m.prototype.getUserObject=function(){return this.userObject},m.prototype.clone=function(e){var t=new m;return t.initUserObject(this.userObject.clone(e)),t},m.prototype.transformBy=function(e){this.userObject.transformBy(e)},m.prototype.setColor=function(e){this.userObject.setColor(e)},m.prototype.getColor=function(){return this.userObject.getColor()},m.prototype.getMxObject=function(){return this.mxDatabase?this.mxDatabase.getMxObject():null},m.prototype.onViewChange=function(){return!!this.userObject&&this.userObject.onViewChange()},m);function m(){this.threeObjectGroup=null,this.userObject=null,this.mxDatabase=null,this.isDirtyDisplay=!1,this.id=0}n.MxDbEntity=f},{"./McGiWorldDraw":21,"./MxManager":51,"./MxTools":59,"./MxType":60,three:19}],36:[function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbEntityGrip=n.MxDbEntityGripJig=n.MxDbEntityGripData=void 0;var a=e("three"),o=e("./MxFun"),s=e("./MxDrawData"),l=e("./MxJig"),c=e("./MxJigCmdManager"),u=e("./McGiWorldDraw"),h=e("./MxManager"),p=e("./MxType"),d=function(){this.threeObject=null};n.MxDbEntityGripData=d;var f,m=(i(g,f=l.McEdJigCommand),g.prototype.sampler=function(){var e=c.MxJigCmdManager.InType.kGetBegan,t=this.acquirePoint(e);return t.status==c.MxJigCmdManager.DragStatus.kNormal&&(this.currPt=t.pt),t.status},g.prototype.getTypeName=function(){return"MxGripEdit"},g.prototype.done=function(e){if(e==c.MxJigCmdManager.DragStatus.kNormal){var t=this.currPt.clone();t.sub(this.dragBasePt);for(var n=this.getMxObject(),r=n.getMxDatabase(),i=n.getMxDatabase().getGripManager(),a=this.grips.length,o=new Set,s=0;s<a;s++){var l=this.grips[s],u=this.ents[s];i.deleteGripData(u.objectId()),u.getUserObject().moveGripPointsAt(l.iIndex,t),i.addGripFromEntity(u),u.upDisplay(),o.add(u.objectId())}n.updateDisplay(),r.getSelectManager().upSelectDilsplay(o)}return c.MxJigCmdManager.DoneStatius.kExitCommand},g.prototype.upDisplay=function(){var e=this.currPt.clone();if(e.sub(this.dragBasePt),!(e.length()<.001))for(var t=this.getMxObject(),n=this.grips.length,r=0;r<n;r++){var i=this.grips[r],a=this.ents[r].clone(p.MxType.MxCloneType.kDragClone);a.getUserObject().moveGripPointsAt(i.iIndex,e);var o=new u.McGiWorldDraw(t,u.McGiWorldDrawType.kDynDragDraw);o.setupForEntity(a.getUserObject()),a.worldDraw(o);for(var s=o.getEntitys(),l=s.length,c=0;c<l;c++)this.drawEntity(s[c],31)}},g);function g(e,t,n){var r=f.call(this)||this;return r.dragBasePt=e,r.grips=t,r.ents=n,r.currPt=e,r}n.MxDbEntityGripJig=m;var v=(y.prototype.getAllSelect=function(){var e=[];return this.mapGrips.forEach(function(t,n){e.push(n)}),e},y.prototype.getParentObject=function(){return this.database.getMxObject().getTheTempDrawContainer()},y.prototype.removeAllGrips=function(){if(0==this.mapGrips.size)return!1;this.database.getMxObject();var e=this.getParentObject();return this.mapGrips.forEach(function(t,n,r){for(var i=t.length,a=0;a<i;a++){var s=t[a];o.MxFun.removeThreejsObject(s.threeObject,e)}}),this.mapGrips=new Map,!0},y.prototype.deleteGripData=function(e){var t=this.getParentObject(),n=this.mapGrips.get(e);if(n)for(var r=n.length,i=0;i<r;i++){var a=n[i];o.MxFun.removeThreejsObject(a.threeObject,t)}this.mapGrips.delete(e)},y.prototype.createGripDisplayObject=function(e){var t=this.database.getMxObject(),n=this.getParentObject();e.geometry=new a.Geometry;var r=t.screenCoordLong2Doc(8);e.geometry.vertices.push(new a.Vector3(e.point.x-r,e.point.y-r,0)),e.geometry.vertices.push(new a.Vector3(e.point.x-r,e.point.y+r,0)),e.geometry.vertices.push(new a.Vector3(e.point.x+r,e.point.y+r,0)),e.geometry.vertices.push(new a.Vector3(e.point.x+r,e.point.y-r,0)),e.geometry.faces.push(new a.Face3(0,1,2)),e.geometry.faces.push(new a.Face3(2,3,0)),e.geometry.computeFaceNormals(),e.geometry.computeVertexNormals();var i=new a.MeshBasicMaterial({color:255,transparent:!0,depthTest:!1,side:a.DoubleSide,opacity:.9}),o=new a.Mesh(e.geometry,i);o.renderOrder=h.MxData.iGripRenderOrder,n.add(o),e.threeObject=o},y.prototype.addGripData=function(e,t,n){var r=this.mapGrips.get(e);null==r&&(r=new Array,this.mapGrips.set(e,r));var i=new d;return i.iIndex=t,i.point=new a.Vector3(n.x,n.y,0),r.push(i),i},y.prototype.hitTest=function(e){var t=this,n={grips:new Array,ents:new Array,pt:e},r=new a.Vector3(e.x,e.y,0),i=this.database.getMxObject().screenCoordLong2Doc(8);return this.mapGrips.forEach(function(e,a){for(var o=e.length,s=0;s<o;s++){var l=e[s];if(l.point.distanceTo(r)<=i){n.grips.push(l),n.ents.push(t.database.getEntity(a));break}}}),n},y.prototype.onMouseLBDown=function(e){var t=this.hitTest(e);return 0!=t.grips.length&&(o.MxFun.sendStringToExecute("Mx_FrontEndWebpageGripEdit",t),!0)},y.prototype.gripEditImp=function(e){var t=e.grips,n=e.ents,r=e.pt,i=new m(r,t,n);i.setDisableDynInput(!0),i.setDisableOsnap(!0),c.MxJigCmdManager.runCmd(i)},y.prototype.doWindowsSelect=function(e,t){},y.prototype.addGripFromEntity=function(e){var t=e.getGripPoints(),n=e.objectId();this.deleteGripData(n);for(var r=0;r<t.length;r++){var i=this.addGripData(n,r,t[r]);this.createGripDisplayObject(i)}},y.prototype.addSelect=function(e){var t=this.database.getSelectManager(),n=!1;if(this.getAllSelect().forEach(function(t){t==e&&(n=!0)}),!n){var r=this.database.getMxObject(),i=r.getMxEntity(e);if(i){var a=new Set;a.add(e),this.addGripFromEntity(i),t.upSelectDilsplay(a),this.isCallingMxEntitySelectChange||(this.isCallingMxEntitySelectChange=!0,r.callEvent("MxEntitySelectChange",this.getAllSelect()),this.isCallingMxEntitySelectChange=!1)}}},y.prototype.doPointSelect=function(e){for(var t=this,n=!1,r=this.database.getSelectManager(),i=this.database.getMxObject(),a=r.isEmptySelect(),o=!1,l=function(){s.MxDrawData.m_isMultipleSelect||(c.removeAllGrips(),r.removeAllEntity());var a=c.database.getIntersectObjects(e);if(0==a.length)return i.updateDisplay(),"break";var l=new Set;return a.forEach(function(e){var n=e.object.MxDbEntity;if(n){var r=n.objectId();l.has(r)||(l.add(r),t.addGripFromEntity(n))}}),o=!0,r.upSelectDilsplay(l),i.updateDisplay(),n=!0,"break"},c=this;"break"!==l(););return!o&&a==r.isEmptySelect()||this.isCallingMxEntitySelectChange||(this.isCallingMxEntitySelectChange=!0,i.callEvent("MxEntitySelectChange",this.getAllSelect()),this.isCallingMxEntitySelectChange=!1),n},y);function y(e){this.database=null,this.mapGrips=new Map,this.isCallingMxEntitySelectChange=!1,this.database=e}n.MxDbEntityGrip=v},{"./McGiWorldDraw":21,"./MxDrawData":40,"./MxFun":45,"./MxJig":47,"./MxJigCmdManager":48,"./MxManager":51,"./MxType":60,three:19}],37:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbEntitySelect=void 0;var r=e("three"),i=e("./MxFun"),a=e("three.meshline"),o=e("./McGiWorldDraw"),s=e("./MxManager"),l=(c.prototype.setRenderOrder=function(e){this.iRenderOrder=e},c.prototype.getRenderOrder=function(){return this.iRenderOrder},c.prototype.setCanvasSize=function(e,t){this.canvasWidth==e&&this.canvasHeight==t||(this.canvasWidth=e,this.canvasHeight=t,this.material.resolution=new r.Vector2(this.canvasWidth,this.canvasHeight),this.material.needsUpdate=!0)},c.prototype.removeAllEntity=function(){var e=this.getParentObject();return 0!=this.mapIdToThreeObject.size&&(this.mapIdToThreeObject.forEach(function(t){for(var n=t.length,r=0;r<n;r++)i.MxFun.removeThreejsObject(t[r],e)}),this.mapIdToThreeObject.clear(),!0)},c.prototype.isEmptySelect=function(){return 0==this.mapIdToThreeObject.size},c.prototype.getParentObject=function(){return this.mxDatabase.getMxObject().getTheTempDrawContainer()},c.prototype.deleteSelect=function(e){var t=this.getParentObject(),n=this.mapIdToThreeObject.get(e);if(n){for(var r=n.length,a=0;a<r;a++)i.MxFun.removeThreejsObject(n[a],t);this.mapIdToThreeObject.delete(e)}},c.prototype.upSelectDilsplayFromId=function(e){var t=new Set;t.add(e),this.upSelectDilsplay(t)},c.prototype.upSelectDilsplay=function(e){var t=this,n=new o.McGiWorldDrawSelect(this.mxDatabase.getMxObject(),this);e.forEach(function(e){t.deleteSelect(e);var r=t.mxDatabase.getEntity(e);r&&(n.setCurEntityId(e),r.worldDraw(n))})},c.prototype.addCircleDisplay=function(e,t,n){var i=new r.CircleGeometry(n,64,3,2*Math.PI);if(i.vertices.shift(),0!=i.vertices.length){i.vertices.push(i.vertices[0]);var o=3*i.vertices.length;if(0!=o){for(var s=this.getParentObject(),l=new Float32Array(o),c=0,u=0;c+2<o;c+=3,u++)l[c]=i.vertices[u].x+t.x,l[c+1]=i.vertices[u].y+t.y,l[c+2]=t.z;var h=new a.MeshLine;h.setGeometry(l);var p=new r.Mesh(h.geometry,this.material);p.renderOrder=this.iRenderOrder,s.add(p);var d=this.mapIdToThreeObject.get(e);d||(d=new Array,this.mapIdToThreeObject.set(e,d)),d.push(p)}}},c.prototype.addLineDisplay=function(e,t,n){var i=this.getParentObject(),o=new Float32Array(6);o[0]=t.x,o[1]=t.y,o[2]=0,o[3]=n.x,o[4]=n.y,o[5]=0;var s=new a.MeshLine;s.setGeometry(o);var l=new r.Mesh(s.geometry,this.material);l.renderOrder=this.iRenderOrder,i.add(l);var c=this.mapIdToThreeObject.get(e);c||(c=new Array,this.mapIdToThreeObject.set(e,c)),c.push(l)},c);function c(e){this.mapIdToThreeObject=new Map,this.canvasWidth=800,this.canvasHeight=500,this.mxDatabase=null,this.material=new a.MeshLineMaterial({useMap:!1,color:new r.Color(2641557),opacity:.8,resolution:new r.Vector2(800,500),sizeAttenuation:!1,lineWidth:10,transparent:!0,depthTest:!1}),this.iRenderOrder=s.MxData.iSelectRenderOrder,this.mxDatabase=e}n.MxDbEntitySelect=l},{"./McGiWorldDraw":21,"./MxFun":45,"./MxManager":51,three:19,"three.meshline":18}],38:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbTextureManager=void 0;var r=e("three"),i=(a.prototype.loadImage=function(e,t){var n=this.mapImageUrlToMaterialTexture.get(e);if(n)t(n);else{var i=this;(new r.TextureLoader).load(e,function(n){var a=new r.MeshLambertMaterial({map:n,transparent:!0,side:r.DoubleSide});a.map&&(a.map.needsUpdate=!0),i.mapImageUrlToMaterialTexture.set(e,a),t&&t(a)},void 0,function(e){console.log(e),t&&t(null)})}},a);function a(){this.mapImageUrlToMaterialTexture=new Map}n.MxDbTextureManager=i},{three:19}],39:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawCommands=void 0;var r=e("./MxFun"),i=e("./MxType"),a=e("./MxIntelliSelect"),o=e("./MxJigCmdManager"),s=e("./MxWindowsEvent"),l=e("./MxDrawData");function c(e){if(null!=e&&null!=e.pt1){var t=new a.MxIntelliSelectJig(e.pt1,!1);t.setDisableDynInput(!0),t.setDisableOsnap(!0);var n=e.pt1,i=r.MxFun.getCurrentMx();t.doPointSelect(r.MxFun.getCurrentMx(),e.pt1,function(e){if(0!=JSON.parse(e).lCount){i.getMxCAD().getGrip().onIntelliSelect(e);var t=s.MxWindowsEvent.getCurrentMousePostion();if(i.screenCoord2Doc(t.x,t.y,0).distanceTo(n)<i.screenCoordLong2Doc(10)){var r=o.MxJigCmdManager.getCurCmd();r&&"MxIntelliSelect"==r.getTypeName()&&o.MxJigCmdManager.stopCmd()}}}),o.MxJigCmdManager.runCmd(t)}}function u(e){null!=e&&null!=e.grips&&null!=e.ids&&r.MxFun.getCurrentMx().getMxCAD().getGrip().gripEditImp(e)}function h(e){if(null!=e&&null!=e.pt){var t=r.MxFun.getCurrentMx(),n=e.pt;if(!t.getMxDatabase().getGripManager().doPointSelect(n)&&l.MxDrawData.m_isMultipleSelect){var i=t.screenCoord2Doc(n.x,n.y,0),s=new a.MxIntelliSelectJig(i,!0);s.setDisableDynInput(!0),s.setDisableOsnap(!0),o.MxJigCmdManager.runCmd(s)}}}function p(e){null!=e&&null!=e.grips&&null!=e.ents&&r.MxFun.getCurrentMx().getMxDatabase().getGripManager().gripEditImp(e)}(n.MxDrawCommands||(n.MxDrawCommands={})).registerCommand=function(){r.MxFun.addCommand("Mx_IntelliSel",c,i.MxType.CommandFlags.MCRX_CMD_TRANSPARENT),r.MxFun.addCommand("Mx_GripEdit",u,i.MxType.CommandFlags.MCRX_CMD_TRANSPARENT),r.MxFun.addCommand("Mx_FrontEndWebpageIntelliSel",h,i.MxType.CommandFlags.MCRX_CMD_TRANSPARENT),r.MxFun.addCommand("Mx_FrontEndWebpageGripEdit",p,i.MxType.CommandFlags.MCRX_CMD_TRANSPARENT)}},{"./MxDrawData":40,"./MxFun":45,"./MxIntelliSelect":46,"./MxJigCmdManager":48,"./MxType":60,"./MxWindowsEvent":66}],40:[function(e,t,n){var r,i,a;Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawData=n.IntelliSelectType=void 0,(i=r=n.IntelliSelectType||(n.IntelliSelectType={}))[i.kFrontEndWebpageModel=1]="kFrontEndWebpageModel",i[i.kBackgroundServicesModel=2]="kBackgroundServicesModel",(a=n.MxDrawData||(n.MxDrawData={})).m_isEnableIntelliSelect=!1,a.m_intelliSelectType=r.kBackgroundServicesModel,a.m_isMultipleSelect=!0,a.getCursorWidthPixels=function(){return 14},a.setIniset=function(e){void 0!==e.EnableIntelliSelect&&"boolean"==typeof e.EnableIntelliSelect&&(a.m_isEnableIntelliSelect=e.EnableIntelliSelect),void 0!==e.IntelliSelectType&&"number"==typeof e.IntelliSelectType&&(a.m_intelliSelectType=e.IntelliSelectType),void 0!==e.multipleSelect&&"boolean"==typeof e.multipleSelect&&(a.m_isMultipleSelect=e.multipleSelect)}},{}],41:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObject=n.IniSetName=n.MxRunMode=void 0;var r,i,a,o=e("three"),s=e("./MxFun"),l=e("./MxCadSketchLayer"),c=e("./MxBrowseLayerData"),u=e("./MxBrowseDisplay"),h=e("./MxNetData"),p=e("./MxNetData"),d=e("./MxSelect"),f=e("./MxManager"),m=e("./MxJigCmdManager"),g=e("./MxSystemVariable"),v=e("./MxCADObject"),y=e("./MxLocalFileLoad"),x=e("./MxDrawObjectOsnap"),_=e("./MxDbDatabase"),b=e("./MxDbEntity");(i=r=n.MxRunMode||(n.MxRunMode={}))[i.kBrowse=1]="kBrowse",i[i.kMxCAD=2]="kMxCAD",i[i.kMxCADBrowseApp=3]="kMxCADBrowseApp",(a=n.IniSetName||(n.IniSetName={})).kEnableOsnapFunction="EnableOsnapFunction";var w=(M.prototype.getMxDatabase=function(){return this.m_mxDatabase},M.prototype.updateCanvasSize=function(){this._onResizeFun&&this._onResizeFun()},M.prototype.addMxEntity=function(e){if(e.getImp())return e.objectId();var t=new b.MxDbEntity;return t.initUserObject(e),this.m_mxDatabase.addEntity(t)},M.prototype.getMxEntity=function(e){return this.m_mxDatabase.getEntity(e)},M.prototype.getMxEntityUserObject=function(e){var t=this.getMxEntity(e);return t?t.getUserObject():null},M.prototype.eraseAllMxEntity=function(){this.m_mxDatabase.eraseAllEntity()},M.prototype.eraseMxEntity=function(e){var t=this.m_mxDatabase.getEntity(e);return!!t&&t.erase()},M.prototype.getAllMxEntity=function(){var e=[];return this.m_mxDatabase.getAllEntity().forEach(function(t){t&&e.push(t.getUserObject())}),e},M.prototype.findMxEntityAtPoint=function(e,t){!t&&void 0!==t||(e=this.docCoord2Screen(e.x,e.y,0));var n=[],r=this.m_mxDatabase.getIntersectObjects(e);if(0==r.length)return n;var i=new Map;return r.forEach(function(e){var t=e.object.MxDbEntity;if(t){var n=t.objectId();i.has(n)||i.set(n,t.getUserObject())}}),i.forEach(function(e){n.push(e)}),n},M.prototype.getMxAllSelect=function(){return this.m_mxDatabase.getGripManager().getAllSelect()},M.prototype.addMxCurrentSelect=function(e){this.m_mxDatabase.getGripManager().addSelect(e)},M.prototype.clearMxCurrentSelect=function(){return this.m_mxDatabase.clearMxCurrentSelect()},M.prototype.addViewObject=function(e){this.secenView?this.threejsselectObjectsView.add(e):console.log("this.secenView is null")},M.prototype.removeViewObject=function(e){s.MxFun.removeThreejsObject(e,this.threejsselectObjectsView)},M.prototype.setOtherRefFile=function(e){this._tzDwgStaticFile=e},M.prototype.setRequestHeader=function(e){this._requestHeader=e},M.prototype.initZoomW=function(e,t){this._initZoomwCoordPt1=e.clone(),this._initZoomWCoordPt2=t.clone()},M.prototype.getMxCAD=function(){return this._mxCAD},M.prototype.setMouseRightRotate=function(e){this._mouseRightRotate=e,null!=this.controls&&(this.controls.mouseButtons.RIGHT=e?o.MOUSE.ROTATE:o.MOUSE.PAN)},M.prototype.setMouseMiddlePan=function(e){this._isMouseMiddlePan=e?1:0,null!=this.controls&&(e?(this.controls.mouseButtons.LEFT=-1,this.controls.mouseButtons.RIGHT=-1,this.controls.mouseButtons.MIDDLE=o.MOUSE.PAN):(this.controls.mouseButtons.LEFT=o.MOUSE.PAN,this._mouseRightRotate?this.controls.mouseButtons.RIGHT=o.MOUSE.ROTATE:this.controls.mouseButtons.RIGHT=o.MOUSE.PAN,this.controls.mouseButtons.MIDDLE=1))},M.prototype.resetThreeJSControls=function(){this.controls&&(this.controls.saveState(),this.controls.reset())},M.prototype.enableZoom=function(e){null!=this.controls&&(this.controls.enableZoom=e)},M.prototype.enablePan=function(e){null!=this.controls&&(this.controls.enablePan=e)},M.prototype.initRunMode=function(e){this._isCreate?console.log("iniRunMode failed,mxobject already created"):this._runMode=e},M.prototype.getRunMode=function(){return this._runMode},M.prototype.setStaticLocalLoad=function(e){this._isStaticLocalLoad=e},M.prototype.isStaticLocalLoad=function(){return this._isStaticLocalLoad},M.prototype.setStaticLocalLoadPath=function(e){this._staticLocalLoadPath=e},M.prototype.addEvent=function(e,t){this._event[e]=t},M.prototype.removeEvent=function(e){this._event[e]=void 0},M.prototype.getEvent=function(){return this._event},M.prototype.sysVariable=function(){return this.m_sysVariable},M.prototype.setIniset=function(e){this.m_iniSet=e},M.prototype.getInisetValue=function(e){return this.m_iniSet[e]},M.prototype.getViewColor=function(){return this._viewcolor},M.prototype.isWhiteViewColor=function(){return 16777215==this._viewcolor},M.prototype.initUserLoginData=function(e,t){this._userIdentitySign=e,this._userRandomToken=t},M.prototype.initRendererParam=function(e){this._rendererParam=e},M.prototype.automaticInversionColor=function(e){return 16777215!=this._viewcolor||16777215!=e?e:0},M.prototype.setViewColor=function(e){this._viewcolor=e,null!=this.scene&&(this.scene.background=new o.Color(e))},M.prototype.callInitCompleteEvent=function(){null!=this._event.loadComplete&&this._event.loadComplete()},M.prototype.callEvent=function(e,t){return null!=this._event[e]&&(this._event[e](t),!0)},M.prototype.userLoginResult=function(e){null!=this._event.userLoginResult&&this._event.userLoginResult(e)},M.prototype.serverReturn=function(e){var t=JSON.parse(e);null!=this._event.serverReturn&&this._event.serverReturn(t)},M.prototype.openFileResult=function(e){JSON.parse(e).linkServer||console.log("link mx serverobj error"),null!=this._event.openFileResult&&this._event.openFileResult(e)},M.prototype.xzSize=function(e){var t=this._devicePixelRatio;if(t-1<=1e-4&&-1e-4<=t-1)return e;for(var n=9999999,r=e,i=0,a=e;i<100;i++){if((s=(o=a*t)-Math.floor(o))<=.001)return a;s<n&&(n=s,r=a),a+=1}for(a=e;i<100;i++){var o,s;if((s=(o=a*t)-Math.floor(o))<=.001)return a;s<n&&(n=s,r=a),--a}return r},M.prototype.setSize=function(e,t){this._viewWidth=e,this._viewHeight=t,null!=this._userCanvas&&(this._userCanvas.width=e,this._userCanvas.height=t,this._userCanvas.style.width=e+"px",this._userCanvas.style.height=t+"px"),this.onResizeImp(),this.updateDisplay()},M.prototype.getCurrentColor=function(){return this._color},M.prototype.setCurrentColor=function(e){this._color=e},M.prototype.getSelect=function(){return this._select},M.prototype.call=function(e,t,n){this._net.getSend().CallServerJS(e,t,n)},M.prototype.zoomAll=function(){this._is2d&&this.call("getDatabaseBoundHelp",'{"isBackground":1}',function(e){if(0!=e.length){var t=JSON.parse(e);this.zoomW(new o.Vector3(t[0],t[1],0),new o.Vector3(t[2],t[3],0))}})},M.prototype.tempDisableSelect=function(e){this._select.tmpDisable=e},M.prototype.getViewCenterDocCoord=function(){return null!=this._userCanvas?this.screenCoord2Doc(.5*this._userCanvas.clientWidth,.5*this._userCanvas.clientHeight,0):this.screenCoord2Doc(.5*this._viewWidth,.5*this._viewHeight,0)},M.prototype.onLoad=function(){if(this._isStaticLocalLoad)this._net=new p.MxNet,this._net.init(this,!1),0<this._openFile.length&&(this._staticLocalNet=new y.MxLocalDwgFileLoad(this._net),this._staticLocalNet.load(encodeURIComponent(this._staticLocalLoadPath),encodeURIComponent(this._openFile)));else{this._net=new p.MxNet;var e=!0;if(this._runMode==r.kMxCAD?e=!0:(e=!s.MxFun.isStaticLoad(),this._is2d||(e=!0)),"wgh"==this._openFile.substring(this._openFile.lastIndexOf(".")+1).toLowerCase()&&(e=!1),0<this._staticLoadingOpenFiles.length&&(e=!1),this._net.init(this,e),!e&&(this._staticNet=new p.MxHFileLoad(this._net),this._staticNet.setRequestHeader(this._requestHeader),this._staticNet.load(this._openFile,this._staticLoadingOpenFiles),this._tzDwgStaticFile&&0<this._tzDwgStaticFile.length)){var t=new p.MxNet;t.init(this,!1),this._extRefManager.createTzDwgExternalReferences(99999),t.setCurrentDatabaseId(99999),this._staticLoadTzNet=new p.MxHFileLoad(t),this._staticLoadTzNet.setShowloading(!1),this._staticLoadTzNet.setRequestHeader(this._requestHeader),this._staticLoadTzNet.load(this._tzDwgStaticFile,[])}}},M.prototype.getStaticNet=function(){return this._staticNet},M.prototype.isStaticFileNet=function(){return!this._isStaticLocalLoad&&null!=this._staticNet},M.prototype.getStaticLocalNet=function(){return this._staticLocalNet},M.prototype.getStaticLoadTzNet=function(){return this._staticLoadTzNet},M.prototype.getViewWidth=function(){return null!=this._userCanvas?this._userCanvas.clientWidth:this._viewWidth},M.prototype.getViewHeight=function(){return null!=this._userCanvas?this._userCanvas.clientHeight:this._viewHeight},M.prototype.makeCurrent=function(){f.MxManager.setCurrentMx(this)},M.prototype.createCanvasImageData=function(e,t){var n=this,r=0,i=0,a=!1;t&&t.width&&t.height&&(r=this.getViewWidth(),i=this.getViewHeight(),a=!0,this.setSize(t.width,t.height)),this._callCreateCanvasImageData=function(t){a&&n.setSize(r,i),e(t)},this.updateDisplay()},M.prototype.getIntersectObjects=function(e){var t=new o.Raycaster;t.linePrecision=this.screenCoordLong2Doc(4);var n=this.getCanvas(),r=n.clientWidth,i=n.clientHeight;return e=new o.Vector2(e.x/r*2-1,-e.y/i*2+1),t.setFromCamera(e,this.camera),t.intersectObjects(this.threejsselectObjects.children,!0)},M.prototype.addObject=function(e){this.threejsselectObjects.add(e)},M.prototype.removeAllSelectObject=function(){for(;this.threejsselectObjects.children.length;)this.threejsselectObjects.remove(this.threejsselectObjects.children[0])},M.prototype.removeObject=function(e){this.threejsselectObjects.remove(e)},M.prototype.render=function(){this.secenView?(this.renderer.autoClear=!0,this.renderer.render(this.secenView,this.cameraView),this.renderer.autoClear=!1):this.renderer.autoClear=!0,this.renderer.render(this.scene,this.camera),null!=this._callCreateCanvasImageData&&(this._callCreateCanvasImageData(this.renderer.domElement.toDataURL("image/png")),this._callCreateCanvasImageData=void 0),this.callEvent("render",this.renderer)},M.prototype.updateDisplay=function(e){function t(){n.m_mxDatabase.upDirtyDisplay(),n._isAnimation?(n._isAnimationStarting=!0,requestAnimationFrame(this.needRander)):n._isWaiteCount=0,n.render()}void 0===e&&(e=!1);var n=this;!0!==e?this._isAnimationStarting||(this._isAnimation?requestAnimationFrame(t):((5<this._isWaiteCount||this._isWaiteCount<0)&&(this._isWaiteCount=0),this._isWaiteCount<=0&&requestAnimationFrame(t),this._isWaiteCount++)):t()},M.prototype.gotoLayout=function(e){"Modle"==e&&(e="");var t=this._openFile;for(var n in this._iniParam)"srcname"==(o=(a=this._iniParam[n])[0])&&(t=a[1]);var r={},i="";for(var n in this._iniParam){var a,o;if(null==r[o=(a=this._iniParam[n])[0]]){r[o]=!0;var l=a[1];if("file"==o){if(l=t,0<e.length){var c=l.substring(l.lastIndexOf(".")+1);l=l.substring(0,l.lastIndexOf("."))+"%23"+e+"%23."+c}}else if("srcname"==o)continue;0==i.length?i=o+"="+l+"&srcname="+t:i+="&"+o+"="+l}}var u=s.MxFun.getLocationPageUrl()+"?"+i;window.location.href=u},M.prototype.addInitParam=function(e,t){var n=new Array;n.push(e),n.push(t),this._iniParam.push(n)},M.prototype.openFile=function(e){if(!this._isCreate)return console.log("mx: openFile Fialed mxasser(_isCreate == false)"),!1;if(0==e.length)return!1;this.reInit(),this._devicePixelRatio=window.devicePixelRatio,e instanceof Array?(this._openFile=e[0],this._staticLoadingOpenFiles=e):this._openFile=e,this._openFileExtName=this._openFile.substring(this._openFile.lastIndexOf(".")+1),this._iniParam=[],this._initZoomwCoordPt1=null,this._initZoomWCoordPt2=null;var t=new Array;return t.push("file"),t.push(this._openFile),this._iniParam.push(t),this.onLoad(),!0},M.prototype.newFile=function(e,t,n,r){if(!this._isCreate)return console.log("mx: openFile Fialed mxasser(_isCreate == false)"),!1;var i,a;if(a=e instanceof Object&&t instanceof Object?(i=e,t):(i=new o.Vector3(e,t,0),new o.Vector3(n,r,0)),i.x>a.x){var l=i.x;i.x=a.x,a.x=l}if(i.y>a.y){var c=i.y;i.y=a.y,a.y=c}this.reInit(),this._devicePixelRatio=window.devicePixelRatio,this._openFile="",this._openFileExtName="dwg",this._iniParam=[],this._initZoomwCoordPt1=null,this._initZoomWCoordPt2=null;var u=new o.Matrix4;u.identity(),this.intiDoc2Wold(u),this.updateCameraDisplayRange(i,a,0),this.updateDisplay(!0);var h=s.MxFun.getUiObj();null!=h&&(h.SetLayoutData(this._allLayoutName),h.UpDisplayLayout())},M.prototype.create=function(e,t){if(this._callCreateCanvasImageData=void 0,this._devicePixelRatio=window.devicePixelRatio,t instanceof Array?(this._openFile=t[0],this._staticLoadingOpenFiles=t):this._openFile=t,this._iniParam=s.MxFun.getUrlParams(),this._openFileExtName=this._openFile.substring(this._openFile.lastIndexOf(".")+1),""!=this._openFile&&this._runMode!=r.kMxCAD&&this._runMode!=r.kMxCADBrowseApp){var n=new Array;n.push("file"),n.push(this._openFile),this._iniParam.push(n)}""!=this._userIdentitySign&&(this.addInitParam("userIdentitySign",this._userIdentitySign),this.addInitParam("userRandomToken",this._userRandomToken)),this.addInitParam("runMode",this._runMode==r.kMxCAD||this._runMode==r.kMxCADBrowseApp?"mxcad":"browse"),this._runMode==r.kMxCAD||this._runMode==r.kMxCADBrowseApp?("empty"==this._openFile&&(this._openFile=""),this._mxCAD=new v.MxCADObject(this)):this._mxCAD=null,this._userCanvas=e;var i=window.innerWidth,a=window.innerHeight;null!=e&&(i=e.clientWidth,a=e.clientHeight),this._viewWidth=i,this._viewHeight=a,this.m_mxDatabase.getSelectManager().setCanvasSize(i,a),this.onInitThreejs(),this.onCreate(),this.m_mxDatabase.init(this),this._parentDocObject=new o.Object3D,this.scene.add(this._parentDocObject),this.threejsselectObjects=new o.Object3D,this.scene.add(this.threejsselectObjects),this._objectsOsnap=new x.MxDrawObjectOsnap(this),this._is2d&&(this._runMode!=r.kMxCAD&&this._runMode!=r.kMxCADBrowseApp||(this.controls.mouseButtons.LEFT=-1,this.controls.mouseButtons.RIGHT=-1,this.controls.mouseButtons.MIDDLE=o.MOUSE.PAN)),this._select=new d.MxSelect(this,this.getCanvas()),this._select.enabled=s.MxFun.isEnableSelect(),this._select.init(),this._is2d||(this._select.enabled=!1),this._runMode!=r.kBrowse&&(this._select.enabled=!1),f.MxManager.add(this),f.MxManager.setCurrentMx(this);var l=this;if(this.controls.addEventListener("change",function(){m.MxJigCmdManager.OnThreeControlsChage(),l.callEvent("viewchange"),l.m_mxDatabase.onViewChange();var e=l.getMxCAD();e&&e.getGrip().onControlsChage(),l.updateDisplay()}),this.updateDisplay(),null==e){var c=function(){l._viewWidth=window.innerWidth,l._viewHeight=window.innerHeight,l.onResizeImp(),l.updateDisplay()};window.addEventListener("resize",c,!1),this._onResizeFun=c}else{var u=function(){if(l._viewWidth=l._userCanvas.clientWidth,l._viewHeight=l._userCanvas.clientHeight,null!=l._event.onResize){var e=l._event.onResize();null!=e&&(l._viewWidth=parseInt(e.width),l._viewHeight=parseInt(e.height))}l.onResizeImp(l._viewWidth,l._viewHeight),l.updateDisplay()};this._onResizeFun=u,null!=this._event.addResizeEvent?this._event.addResizeEvent(u,e):window.addEventListener("resize",u,!1),null!=this._event.onResize&&(u(),window.setTimeout(function(){u(),window.setTimeout(function(){u(),window.setTimeout(function(){u(),window.setTimeout(function(){u()},600)},200)},50)},20))}this.onLoad(),this._isCreate=!0},M.prototype.initResize=function(){if(null==this._userCanvas)this._viewWidth=window.innerWidth,this._viewHeight=window.innerHeight,this.onResizeImp();else{if(this._viewWidth=this._userCanvas.clientWidth,this._viewHeight=this._userCanvas.clientHeight,null!=this._event.onResize){var e=this._event.onResize();null!=e&&(this._viewWidth=e.width,this._viewHeight=e.height)}this.onResizeImp(this._viewWidth,this._viewHeight)}this.updateDisplay()},M.prototype.is2D=function(){return this._is2d},M.prototype.getOpenFile=function(){return this._openFile},M.prototype.getFileTitle=function(){var e=this._openFile;if("wgh"==this._openFile.substring(this._openFile.lastIndexOf(".")+1).toLowerCase()){var t=this._openFile.substring(0,this._openFile.indexOf(".mxb1.wgh")).split("/");"$"==(e=1==t.length?t[0]:t[t.length-1])[0]&&(e=e.substring(1))}return e},M.prototype.getIniParam=function(){return this._iniParam},M.prototype.getOpenFileExtName=function(){return this._openFileExtName},M.prototype.loadCodeToServer=function(e,t){this._net.getSend().CallLoadCodeToServer(e,t)},M.prototype.userLogin=function(e,t){this._net.getSend().UserLogin(e,t)},M.prototype.getUserCanvas=function(){return this._userCanvas},M.prototype.getCanvas=function(){return null!=this._userCanvas?this._userCanvas:this.renderer.domElement},M.prototype.getScene=function(){return this.scene},M.prototype.getCamera=function(){return this.camera},M.prototype.callCommand=function(e,t,n){void 0===t&&(t=""),this._net.getSend().DoCommand(e,t,n)},M.prototype.undoMark=function(){this._net.getSend().UndoMark()},M.prototype.loadCodeFileToServer=function(e,t,n){var r='{"path":"'+e+'","reload":'+(null!=n?"true":"false")+"}";this._net.getSend().DoCommand("Mx_LoadCodeFormServerFile",r,t)},M.prototype.deleteAll=function(){this.removeAllEntity(),this.callCommand("Mx_ClearAll"),this.updateDisplay()},M.prototype.undo=function(){this.callCommand("Mx_Undo")},M.prototype.save=function(){this.callCommand("Mx_Save")},M.prototype.initAllLayoutName=function(e){this._allLayoutName=e},M.prototype.getAllLayoutName=function(){return this._allLayoutName},M.prototype.updataClipMaterial=function(){this._blocks.updataClipMaterial(this)},M.prototype.getSketchLayers=function(){return this._sketchLayers},M.prototype.getExtRefManager=function(){return this._extRefManager},M.prototype.showLayer=function(e,t,n){"string"==typeof e&&(e=this._layers.getLayerIdForName(e)),n?this._sketchLayers.getLayer(e).show(t):this._blocks.showLayer(e,t),this.updateDisplay()},M.prototype.addLayerInfo=function(e,t,n){t=this.automaticInversionColor(16777215&t),this._layers.add(e,t,n)},M.prototype.setZeroLayerId=function(e){this._layers.setZeroLayerId(e)},M.prototype.addLayerInfoComplete=function(){this._layers.initComplete()},M.prototype.addEntity=function(e,t){var n=this._mapId2Entity.get(e);null==n&&(n=new Array,this._mapId2Entity.set(e,n)),n.push(t)},M.prototype.getEntity=function(e){return this._mapId2Entity.get(e)},M.prototype.clearThreejsScence=function(){this.scene.remove(),this.scene.dispose(),this.scene=new o.Scene,this.scene.background=new o.Color(this._viewcolor),s.MxFun.removeThreejsObject(this.threejsselectObjects,this.scene),this.threejsselectObjects=new o.Object3D,this.scene.add(this.threejsselectObjects),s.MxFun.removeThreejsObject(this._parentDocObject,this.scene),this._parentDocObject=new o.Object3D,this.scene.add(this._parentDocObject),this._objectsOsnap=new x.MxDrawObjectOsnap(this),this.m_mxDatabase.init(this),this.onInitScene()},M.prototype.reInit=function(){this.clearThreejsScence(),this._openFile="",this._openFileExtName="",this._select.removeAll(),this._is2d||(this._select.enabled=!1),this._mapId2Entity=new Map,this._setAdyDelete=new Map,this._sketchLayers=new l.MxCadSketchLayers(this),this._layers=new c.MxBrowseLayerData,this._blocks=new u.Blocks,this._extRefManager=new u.ExternalReferenceManager,this._doc2World=new o.Matrix4,this._word2doc=new o.Matrix4,this._allLayoutName=new Array,this._tzDwgStaticFile="",this._devicePixelRatio=window.devicePixelRatio,this._blocks.initRootBlockRef()},M.prototype.removeEntity=function(e){if(null==this._setAdyDelete[e]){this._setAdyDelete[e]=!0;var t=this._mapId2Entity.get(e);if(null!=t){for(var n in t)this.scene.remove(t[n]);this._sketchLayers.removeEntity(e),this._mapId2Entity.delete(e)}}},M.prototype.removeEntityFromServer=function(e){for(var t=e.getInt32(4,!0),n=0;n<t;n++){var r=e.getInt32(4*(n+20),!0);this.removeEntity(r)}},M.prototype.removeAllEntity=function(){var e=this;this._mapId2Entity.forEach(function(t,n,r){for(var i in t)e.scene.remove(t[i])}),this._mapId2Entity.clear(),this._sketchLayers.removeAllEntity()},M.prototype.mxWebAddEntity=function(e){this._setAdyDelete.clear();var t=this.mxWebAddEntity_3DChild(e);this.mxWebAddEntity_Curve(e,t),this._setAdyDelete.clear()},M.prototype.screenCoord2World=function(e,t,n){var r=this.getCanvas(),i=r.clientWidth,a=r.clientHeight;n=.5;var s=this.camera;s&&s.isOrthographicCamera&&(n=(s.near+s.far)/(s.near-s.far));var l=new o.Vector3(e/i*2-1,-t/a*2+1,n);return l.unproject(this.camera),l},M.prototype.worldCoord2Screen=function(e,t,n){var r=new o.Vector3(e,t,n).project(this.camera),i=this.getCanvas(),a=i.clientWidth/2,s=i.clientHeight/2,l=Math.round(r.x*a+a),c=Math.round(-r.y*s+s);return new o.Vector3(l,c,0)},M.prototype.worldCoordLong2Doc=function(e){var t=this.worldCoord2Doc(0,0,0),n=this.worldCoord2Doc(e,0,0);return t.distanceTo(n)},M.prototype.docCoordLong2World=function(e){var t=this.docCoord2World(0,0,0),n=this.docCoord2World(e,0,0);return t.distanceTo(n)},M.prototype.docCoord2World=function(e,t,n){var r=new o.Vector3(e,t,n);return r.applyMatrix4(this._doc2World),r},M.prototype.worldCoord2Doc=function(e,t,n){var r=new o.Vector3(e,t,n);return r.applyMatrix4(this._word2doc),r},M.prototype.screenCoord2Doc=function(e,t,n){var r=this.screenCoord2World(e,t,n);return this.worldCoord2Doc(r.x,r.y,0)},M.prototype.docCoord2Screen=function(e,t,n){var r=this.docCoord2World(e,t,n);return this.worldCoord2Screen(r.x,r.y,r.z)},M.prototype.screenCoordLong2Doc=function(e){var t=this.screenCoord2Doc(0,0,0),n=this.screenCoord2Doc(e,0,0);return t.distanceTo(n)},M.prototype.screenCoordLong2DocScale=function(){var e=this.screenCoord2Doc(0,0,0),t=this.screenCoord2Doc(1,0,0);return e.distanceTo(t)},M.prototype.docCoordLong2Screen=function(e){var t=this.docCoord2Screen(0,0,0),n=this.docCoord2Screen(e,0,0);return t.distanceTo(n)},M.prototype.screenCoordLong2World=function(e){var t=this.screenCoord2World(0,0,0),n=this.screenCoord2World(e,0,0);return t.distanceTo(n)},M.prototype.worldCoordLong2Screen=function(e){var t=this.worldCoord2Screen(0,0,0),n=this.worldCoord2Screen(e,0,0);return t.distanceTo(n)},M.prototype.intiDoc2Wold=function(e){e instanceof Array?this._doc2World.fromArray(e):this._doc2World=e,this._word2doc.getInverse(this._doc2World),this.m_mxDatabase.intiDoc2Wold(this._doc2World),this._parentDocObject.matrix=this._doc2World,this._parentDocObject.matrixAutoUpdate=!1,this.threejsselectObjects.matrix=this._doc2World,this.threejsselectObjects.matrixAutoUpdate=!1},M.prototype.getDrawContainer=function(){return this.threejsselectObjects},M.prototype.getTheTempDrawContainer=function(){return this._parentDocObject},M.prototype.enableSingleTouchPan=function(e){this.controls.enablePan=e},M.prototype.mxWebAddEntityFor2dPointMeshBuffers=function(e,t){var n=new h.MxNetData(e),r=n.getdPointMeshBuffersHead(),i=r.zeroLayerIdIndex,a=r.databaseIndex;-1!=t&&(a=t);for(var o=r.datasize,s=0;s<r.datacount;s++){var l=n.getdPointMeshBufferDataHead(o);o=l.offset;var c=l.layerId,u=c==i,p=l.blkId,d=l.pointCount;if(!(d<1)){for(var f=[],m=[],g=[],v=[],y=[],x=0;x<d;x++){var _=e.getFloat32(o,!0);o+=4;var b=e.getFloat32(o,!0);o+=4;var w=e.getFloat32(o,!0);o+=4;var M=e.getFloat32(o,!0);o+=4;var S=e.getFloat32(o,!0);o+=4;var T=e.getFloat32(o,!0);o+=4;var E=e.getInt32(o,!0);o+=4;var C=E>>24&255;2==C?(v.push(_,b),v.push(w,M),v.push(S,T)):1==C?0!=p&&u?(y.push(_,b),y.push(w,M),y.push(S,T)):(g.push(_,b),g.push(w,M),g.push(S,T)):(E=this.automaticInversionColor(16777215&E),f.push(_,b),f.push(w,M),f.push(S,T),m.push((255&E)/255,(E>>8&255)/255,(E>>16&255)/255),m.push((255&E)/255,(E>>8&255)/255,(E>>16&255)/255),m.push((255&E)/255,(E>>8&255)/255,(E>>16&255)/255))}var A=this._blocks,L=this._layers;0!=a&&(A=this._extRefManager.getBlocks(a),L=this._extRefManager.getLayers(a));var D=A.crateBlock(p);D.addGeometryMesh(f,m,c,v,g,y),A.createThreejsObj(D,this,L)}}},M.prototype.mxWebAddEntityFor2dPointCurveBuffers=function(e,t){var n=new h.MxNetData(e),r=n.getdPointCurveBuffersHead(),i=r.zeroLayerIdIndex,a=r.databaseIndex;-1!=t&&(a=t);for(var o=r.datasize,s=0;s<r.datacount;s++){var l=n.getdPointCurveBufferDataHead(o);o=l.offset;var c=l.layerId,u=c==i,p=l.blkId,d=l.pointCount;if(!(d<1)){for(var f=[],m=[],g=[],v=[],y=[],x=0;x<d;x++){var _=e.getFloat32(o,!0);o+=4;var b=e.getFloat32(o,!0);o+=4;var w=e.getFloat32(o,!0);o+=4;var M=e.getFloat32(o,!0);o+=4;var S=e.getInt32(o,!0);o+=4;var T=S>>24&255;2==T?(v.push(_,b),v.push(w,M)):1==T?0!=p&&u?(y.push(_,b),y.push(w,M)):(g.push(_,b),g.push(w,M)):(f.push(_,b),f.push(w,M),S=this.automaticInversionColor(16777215&S),m.push((255&S)/255,(S>>8&255)/255,(S>>16&255)/255),m.push((255&S)/255,(S>>8&255)/255,(S>>16&255)/255))}var E=this._blocks,C=this._layers;0!=a&&(E=this._extRefManager.getBlocks(a),C=this._extRefManager.getLayers(a));var A=E.crateBlock(p);A.addGeometryCurve(f,m,c,v,g,y),E.createThreejsObj(A,this,C)}}},M.prototype.mxWebAddEntityFor2dPointCurveBuffer=function(e,t){var n=new h.MxNetData(e);if(!n.getIsSketchEntity()){var r,i=n.getLayerId(),a=i==n.getZeroLayerId(),o=n.getBlockId();if(!((r=e.getInt32(20,!0)/20)<1)){for(var s=80,l=[],c=[],u=[],p=[],d=[],f=0;f<r;f++){var m=e.getFloat32(s,!0);s+=4;var g=e.getFloat32(s,!0);s+=4;var v=e.getFloat32(s,!0);s+=4;var y=e.getFloat32(s,!0);s+=4;var x=e.getInt32(s,!0);s+=4;var _=x>>24&255;2==_?(p.push(m,g),p.push(v,y)):1==_?0!=o&&a?(d.push(m,g),d.push(v,y)):(u.push(m,g),u.push(v,y)):(x=this.automaticInversionColor(16777215&x),l.push(m,g),l.push(v,y),c.push((255&x)/255,(x>>8&255)/255,(x>>16&255)/255),c.push((255&x)/255,(x>>8&255)/255,(x>>16&255)/255))}var b=n.getDatabaseIndex();-1!=t&&(b=t);var w=this._blocks,M=this._layers;0!=b&&(w=this._extRefManager.getBlocks(b),M=this._extRefManager.getLayers(b));var S=w.crateBlock(o);S.addGeometryCurve(l,c,i,p,u,d),w.createThreejsObj(S,this,M)}}},M.prototype.mxWebAddEntityFor2dPointMeshBuffer=function(e,t){var n=new h.MxNetData(e);if(!n.getIsSketchEntity()){var r,i=n.getLayerId(),a=n.getBlockId(),o=i==n.getZeroLayerId();if(!((r=e.getInt32(12,!0)/28)<1)){for(var s=80,l=[],c=[],u=[],p=[],d=[],f=0;f<r;f++){var m=e.getFloat32(s,!0);s+=4;var g=e.getFloat32(s,!0);s+=4;var v=e.getFloat32(s,!0);s+=4;var y=e.getFloat32(s,!0);s+=4;var x=e.getFloat32(s,!0);s+=4;var _=e.getFloat32(s,!0);s+=4;var b=e.getInt32(s,!0);s+=4;var w=b>>24&255;2==w?(p.push(m,g),p.push(v,y),p.push(x,_)):1==w?0!=a&&o?(d.push(m,g),d.push(v,y),d.push(x,_)):(u.push(m,g),u.push(v,y),u.push(x,_)):(l.push(m,g),l.push(v,y),l.push(x,_),b=this.automaticInversionColor(16777215&b),c.push((255&b)/255,(b>>8&255)/255,(b>>16&255)/255),c.push((255&b)/255,(b>>8&255)/255,(b>>16&255)/255),c.push((255&b)/255,(b>>8&255)/255,(b>>16&255)/255))}var M=n.getDatabaseIndex();-1!=t&&(M=t);var S=this._blocks,T=this._layers;0!=M&&(S=this._extRefManager.getBlocks(M),T=this._extRefManager.getLayers(M));var E=S.crateBlock(a);E.addGeometryMesh(l,c,i,p,u,d),S.createThreejsObj(E,this,T)}}},M.prototype.mxWebCreateAllBlocks=function(e,t){var n=new h.MxNetData(e).getDatabaseIndex();-1!=t&&(n=t);var r=this._blocks;0!=n&&(r=this._extRefManager.getBlocks(n)),r.createBlocks(e,this.scene)},M.prototype.mxWebEntitysData=function(e,t){-1==t&&this._objectsOsnap.mxWebEntitysData(e,t)},M.prototype.getObjectOsnap=function(){return this._objectsOsnap},M.prototype.saveMxEntityToJson=function(){return this.m_mxDatabase.saveJson()},M.prototype.loadMxEntityFromJson=function(e){return this.m_mxDatabase.loadJson(e)},M);function M(){this._is2d=!0,this._runMode=r.kBrowse,this._mxCAD=null,this._userCanvas=null,this._openFile="empty",this._staticLoadingOpenFiles=[],this._openFileExtName="",this._userIdentitySign="",this._rendererParam=void 0,this._userRandomToken="",this._isCreate=!1,this.m_iniSet={},this._net=null,this._staticNet=null,this._staticLoadTzNet=null,this._staticLocalNet=null,this._isStaticLocalLoad=!1,this._staticLocalLoadPath="",this._viewWidth=1,this._viewHeight=1,this.m_sysVariable=new g.MxSystemVariable,this._color="#FFFFFF",this._viewcolor=15790320,this._isAnimation=!1,this._isAnimationStarting=!1,this._isWaiteCount=0,this._callCreateCanvasImageData=void 0,this._event={},this.scene=null,this.camera=null,this.secenView=null,this.cameraView=null,this.renderer=null,this.controls=null,this.threejsselectObjectsView=null,this._mouseRightRotate=!0,this._isMouseMiddlePan=-1,this._mapId2Entity=new Map,this._setAdyDelete=new Map,this._sketchLayers=new l.MxCadSketchLayers(this),this._layers=new c.MxBrowseLayerData,this._blocks=new u.Blocks,this._extRefManager=new u.ExternalReferenceManager,this._doc2World=new o.Matrix4,this._word2doc=new o.Matrix4,this._allLayoutName=new Array,this._devicePixelRatio=1,this._tzDwgStaticFile="",this._requestHeader="",this._objectsOsnap=null,this._initZoomwCoordPt1=null,this._initZoomWCoordPt2=null,this.m_mxDatabase=null,this._parentDocObject=null,this.threejsselectObjects=null,this._onResizeFun=null,this._blocks.initRootBlockRef(),this.m_iniSet[a.kEnableOsnapFunction]=!1,this.m_sysVariable.init(this),this.m_mxDatabase=new _.MxDbDatabase}n.MxDrawObject=w},{"./MxBrowseDisplay":24,"./MxBrowseLayerData":25,"./MxCADObject":29,"./MxCadSketchLayer":32,"./MxDbDatabase":34,"./MxDbEntity":35,"./MxDrawObjectOsnap":44,"./MxFun":45,"./MxJigCmdManager":48,"./MxLocalFileLoad":50,"./MxManager":51,"./MxNetData":53,"./MxSelect":54,"./MxSystemVariable":57,three:19}],42:[function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObject2d=void 0;var a,o=e("three"),s=e("./MxFun"),l=e("./MxDrawObject"),c=e("three-orbitcontrols"),u=e("./MxNetData"),h=e("./MxMaterial"),p=(i(d,a=l.MxDrawObject),d.prototype.set3DDraw=function(e){this.is3DDraw=e},d.prototype.getOrthographicCamera=function(){return this.camera instanceof o.OrthographicCamera?this.camera:null},d.prototype.getFullDisplayRange=function(){return{minPt:this._minDisplayPoint,maxPt:this._maxDisplayPoint}},d.prototype.zoomW=function(e,t,n){if(null!=n&&n||(e=this.docCoord2World(e.x,e.y,0),t=this.docCoord2World(t.x,t.y,0)),e.x>t.x){var r=e.x;e.x=t.x,t.x=r}e.y>t.y&&(r=e.y,e.y=t.y,t.y=r);var i=this.getViewWidth(),a=this.getViewHeight(),s=Math.abs(e.x-t.x),l=Math.abs(e.y-t.y),c=this.getOrthographicCamera();if(s/l<i/a){var u=.5*l,h=i/a;c.left=-u*h,c.right=u*h,c.top=u,c.bottom=-u}else u=.5*s,h=a/i,c.left=-u,c.right=u,c.top=u*h,c.bottom=-u*h;var p=s,d=l,f=p;f<p&&(f=d),c.far<2*f&&(c.far=2*f);var m=e.x+.5*p,g=e.y+.5*d;c.zoom=1,c.position.set(m,g,.5*f),c.lookAt(new o.Vector3(m,g,0)),c.updateProjectionMatrix(),this.controls.target.x=m,this.controls.target.y=g,this.controls.target.z=0,this.controls.update()},d.prototype.zoomScale=function(e){var t=this.getOrthographicCamera();t.zoom=Math.max(this.controls.minZoom,Math.min(this.controls.maxZoom,t.zoom*e)),t.updateProjectionMatrix(),this.controls.update()},d.prototype.zoomCenter=function(e,t){var n=this.getOrthographicCamera(),r=this.docCoord2World(e,t,0);e=r.x,t=r.y,n.position.set(e,t,n.position.z),n.lookAt(new o.Vector3(e,t,0)),n.updateProjectionMatrix(),this.controls.target.x=e,this.controls.target.y=t,this.controls.target.z=0,this.controls.update()},d.prototype.calcCameraUp=function(e){var t=new o.Vector3(0,1,0),n=new o.Matrix4;return n.makeRotationZ(e),t.applyMatrix4(n),t},d.prototype.updateCameraDisplayRange=function(e,t,n){null!=this._initZoomwCoordPt1&&null!=this._initZoomWCoordPt2?(this._minDisplayPoint=this.docCoord2World(this._initZoomwCoordPt1.x,this._initZoomwCoordPt1.y,0),this._maxDisplayPoint=this.docCoord2World(this._initZoomWCoordPt2.x,this._initZoomWCoordPt2.y,0)):(this._minDisplayPoint=e,this._maxDisplayPoint=t),this.camera.up=this.calcCameraUp(n),this.cameraView.up=this.calcCameraUp(n),this.cameraView.updateProjectionMatrix(),this.zoomW(this._minDisplayPoint,this._maxDisplayPoint,!0)},d.prototype.zoomInitialStates=function(){null!=this._minDisplayPoint&&null!=this._maxDisplayPoint?this.zoomW(this._minDisplayPoint,this._maxDisplayPoint,!0):console.log("mx assert(0)")},d.prototype.onInitScene=function(){var e=this.getEvent(),t=0;if(null!=e.initScene&&(t=e.initScene(this.scene,this.controls,!0)),0==t){var n=new o.AmbientLight(3355443,1);this.scene.add(n);var r=new o.DirectionalLight(16777215,1);r.position.set(-2,2,3).normalize(),this.scene.add(r)}},d.prototype.updataCameraView=function(e,t){var n=e,r=t;this.cameraView.left=0,this.cameraView.right=n,this.cameraView.top=r,this.cameraView.bottom=0,this.cameraView.updateProjectionMatrix()},d.prototype.initViewScene=function(){if(!this.secenView){this.secenView=new o.Scene,this.secenView.background=new o.Color(this._viewcolor);var e=this.getViewWidth(),t=this.getViewHeight();e=this.xzSize(e),t=this.xzSize(t),this.cameraView=new o.OrthographicCamera(0,e,t,0,1,2e3),this.cameraView.position.set(0,0,2e3),this.cameraView.lookAt(new o.Vector3(0,0,0)),this.cameraView.updateProjectionMatrix();var n=new o.AmbientLight(3355443,1);this.secenView.add(n);var r=new o.DirectionalLight(16777215,1);r.position.set(-2,2,3).normalize(),this.secenView.add(r),this.threejsselectObjectsView=new o.Object3D,this.secenView.add(this.threejsselectObjectsView)}},d.prototype.onInitThreejs=function(){var e=this.getViewWidth(),t=this.getViewHeight(),n=(e=this.xzSize(e))/(t=this.xzSize(t))*50;this.initViewScene(),this.camera=new o.OrthographicCamera(n/-2,n/2,25,-25,1,1e3),this.camera.position.set(0,0,200),this.scene=new o.Scene;var r=this.getUserCanvas(),i=this._rendererParam;i=i||{},null==r?(i.antialias=!1,this.renderer=new o.WebGLRenderer(i),this.renderer.setClearColor(0,1),this.renderer.setPixelRatio(this._devicePixelRatio),this.renderer.setSize(e,t),document.body.appendChild(this.renderer.domElement)):(i.canvas=r,this.renderer=new o.WebGLRenderer(i),this.renderer.setClearColor(0,1),this.renderer.setPixelRatio(this._devicePixelRatio)),this.renderer.sortObjects=!0;var a=this.getUserCanvas();null==a&&(a=this.renderer.domElement),this.controls=new c.OrbitControls(this.camera,a),this.is3DDraw||(this.controls.enableZoom=!0),s.MxFun.isPC()?(this.controls.zoomSpeed=4,this.controls.mouseButtons.LEFT=o.MOUSE.PAN,this._mouseRightRotate?this.controls.mouseButtons.RIGHT=o.MOUSE.ROTATE:this.controls.mouseButtons.RIGHT=o.MOUSE.PAN,this.controls.screenSpacePanning=!0,-1!=this._isMouseMiddlePan&&this.setMouseMiddlePan(1==this._isMouseMiddlePan)):(this.controls.zoomSpeed=1.5,this.controls.touches.ONE=o.TOUCH.PAN,this.controls.screenSpacePanning=!0)},d.prototype.onCreate=function(){this._is2d=!0,this.onInitScene()},d.prototype.mxWebAddEntity_3DChild=function(e){var t=new u.MxNetData(e),n=t.getMesh();if(null==n.id)return n.size;var r=new o.Mesh(n.geometry,h.MxMaterial.GetBaseColorMaterial(n.nColorIndex));return this.removeEntity(n.id),this.scene.add(r),n.isSketchEntity&&(this.addEntity(n.id,r),this.getSketchLayers().addEntity(n.id,t.getLayerId())),n.size},d.prototype.mxWebAddEntity_Curve=function(e,t){var n=new u.MxNetData(e),r=n.getCurve(t);if(null!=r.id){var i=h.MxMaterial.GetCurveColorMaterial(r.colorIndex),a=new o.LineSegments(r.geometry,i);this.removeEntity(r.id),this.scene.add(a),r.isSketchEntity&&(this.addEntity(r.id,a),this.getSketchLayers().addEntity(r.id,n.getLayerId()))}},d.prototype.onResizeImp=function(e,t){var n=this.getViewWidth();null!=e&&(n=e);var r=this.getViewHeight();null!=t&&(r=t),n=this.xzSize(n),r=this.xzSize(r);var i=this.getOrthographicCamera();if(null==this._minDisplayPoint||null==this._maxDisplayPoint){var a=50,o=n/r;i.left=a*o/-2,i.right=a*o/2,i.top=a/2,i.bottom=a/-2,i.updateProjectionMatrix()}else{var s=Math.abs(this._minDisplayPoint.x-this._maxDisplayPoint.x),l=Math.abs(this._minDisplayPoint.y-this._maxDisplayPoint.y);s/l<n/r?(a=.5*l,o=n/r,i.left=-a*o,i.right=a*o,i.top=a,i.bottom=-a):(a=.5*s,o=r/n,i.left=-a,i.right=a,i.top=a*o,i.bottom=-a*o),i.updateProjectionMatrix()}this.renderer.setSize(n,r),this.updataClipMaterial(),this.updataCameraView(n,r),this.callEvent("viewsizechange",{width:n,height:r}),this.callEvent("viewchange"),this.m_mxDatabase.getSelectManager().setCanvasSize(n,r),this.m_mxDatabase.onViewChange()},d);function d(){var e=null!==a&&a.apply(this,arguments)||this;return e._minDisplayPoint=null,e._maxDisplayPoint=null,e.is3DDraw=s.MxFun.is3DDwg(),e}n.MxDrawObject2d=p},{"./MxDrawObject":41,"./MxFun":45,"./MxMaterial":52,"./MxNetData":53,three:19,"three-orbitcontrols":17}],43:[function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObject3d=void 0;var a,o=e("three"),s=e("./MxDrawObject"),l=e("three-orbitcontrols"),c=e("./MxNetData"),u=e("./MxMaterial"),h=e("./MxTools"),p=(i(d,a=s.MxDrawObject),d.prototype.mxWebAddEntity_Curve=function(e,t){var n,r=new c.MxNetData(e),i=0==e.getInt32(32,!0),a=r.getIsSketchEntity();if(!((n=i?e.getInt32(20,!0)/4/3:e.getInt32(20,!0)/4/2)<2)){for(var s=new o.Geometry,l=t,p=0;p<n;p++){var d=e.getFloat32(l,!0);l+=4;var f=e.getFloat32(l,!0);l+=4;var m=0;i&&(m=e.getFloat32(l,!0),l+=4),s.vertices.push(h.MxTools.AsThreeJsPoint(d,f,m))}var g=e.getInt32(28,!0),v=u.MxMaterial.GetCurveColorMaterial(g),y=new o.LineSegments(s,v),x=e.getInt32(4,!0);this.removeEntity(x),this.scene.add(y),a&&this.addEntity(x,y)}},d.prototype.mxWebAddEntity_3DChild=function(e){var t=new c.MxNetData(e),n=t.getId(),r=(t.getColorIndex(),0==t.getBufferType()),i=t.getIsSketchEntity();this.removeEntity(n);var a=new o.Mesh(new o.Geometry),s=this.mxWebUpdateEntity_3DChild(a,e,r);return this.scene.add(a),i&&this.addEntity(n,a),a.geometry.computeBoundingBox(),a.geometry.computeBoundingSphere(),s},d.prototype.mxWebUpdateEntity_3DChild=function(e,t,n){var r=new c.MxNetData(t),i=r.getVertexBufferSize(),a=r.getIndexBufferSize(),s=r.getColorIndex();if(0===i||0===a)return r.getDrawDataOffset();var l=r.getMateria(),p=void 0,d=!0,f=!1,m=!1;0!=l.length&&(null!=(p=JSON.parse(l)).computeFaceNonmal&&(d=p.computeFaceNonmal),null!=p.castShadow&&(f=p.castShadow),null!=p.receiveShadow&&(m=p.receiveShadow)),e.material=u.MxMaterial.createMaterial(p),null==e.material&&(e.material=u.MxMaterial.GetColorMaterial(s)),e.castShadow=f,e.receiveShadow=m;var g,v=r.getDrawDataOffset();g=n?i/4/8:i/4/2;var y=e.geometry;y.vertices=[],y.faces=[];for(var x=0;x<g;x++){var _=t.getFloat32(v+0,!0),b=t.getFloat32(v+4,!0),w=0,M=0,S=0,T=0,E=0,C=0;n?(w=t.getFloat32(v+8,!0),M=t.getFloat32(v+12,!0),S=t.getFloat32(v+16,!0),T=t.getFloat32(v+20,!0),E=t.getFloat32(v+24,!0),C=t.getFloat32(v+28,!0),v+=32):v+=8;var A=h.MxTools.AsThreeJsPoint(_,b,w);y.vertices.push(A),y.vertices[x].normal=h.MxTools.AsThreeJsPoint(M,S,T),y.vertices[x].uv=new o.Vector2(E,C)}var L=a/4;for(x=0;x<L;x+=3){var D=t.getInt32(v,!0);v+=4;var P=t.getInt32(v,!0);v+=4;var O=t.getInt32(v,!0);v+=4;var R=new o.Face3(D,P,O);d||R.vertexNormals.push(y.vertices[D].normal,y.vertices[P].normal,y.vertices[O].normal),y.faces.push(R),y.faceVertexUvs[0].push([y.vertices[D].uv,y.vertices[P].uv,y.vertices[O].uv])}return d&&y.computeFaceNormals(),v},d.prototype.updateUVs=function(e){e.faceVertexUvs[0]=[],e.faces.forEach(function(t){var n=["x","y","z"].sort(function(e,n){return Math.abs(t.normal[e])-Math.abs(t.normal[n])}),r=e.vertices[t.a],i=e.vertices[t.b],a=e.vertices[t.c],s=new o.Vector2(r[n[0]],r[n[1]]),l=new o.Vector2(i[n[0]],i[n[1]]),c=new o.Vector2(a[n[0]],a[n[1]]);e.faceVertexUvs[0].push([s,l,c])}),e.uvsNeedUpdate=!0},d.prototype.onInitThreejs=function(){var e=this.getViewWidth(),t=this.getViewHeight(),n=(e=this.xzSize(e))/(t=this.xzSize(t))*50;this.camera=new o.OrthographicCamera(n/-2,n/2,25,-25,1,1e3),this.camera.position.set(-200,200,200),this.scene=new o.Scene,this.scene.background=new o.Color(this._viewcolor);var r=this.getUserCanvas();null==r?(this.renderer=new o.WebGLRenderer({antialias:!0,alpha:!0}),this.renderer.setPixelRatio(this._devicePixelRatio),this.renderer.setSize(e,t),document.body.appendChild(this.renderer.domElement)):(this.renderer=new o.WebGLRenderer({canvas:r,antialias:!0,alpha:!0}),this.renderer.setPixelRatio(this._devicePixelRatio));var i=this.getUserCanvas();null==i&&(i=this.renderer.domElement),this.controls=new l.OrbitControls(this.camera,i)},d.prototype.onInitScene=function(){var e=this.getEvent(),t=0;if(null!=e.initScene&&(t=e.initScene(this.scene,this.controls,!1)),0==t){var n=new o.AmbientLight(2236962);n.integrity=1,this.scene.add(n);var r=new o.DirectionalLight(16777215,1);r.position.set(-2,2,3).normalize(),this.scene.add(r);var i=new o.GridHelper(2e3,100);i.position.y=-199,i.material.opacity=.25,i.material.transparent=!0,this.scene.add(i);var a=new o.AxesHelper(20);this.scene.add(a)}},d.prototype.onCreate=function(){this._is2d=!1;var e=this.getEvent();null!=e.initRenderer&&e.initRenderer(this.renderer),this.onInitScene()},d.prototype.getOrthographicCamera=function(){return this.camera instanceof o.OrthographicCamera?this.camera:null},d.prototype.onResizeImp=function(e,t){var n=this.getViewWidth();null!=e&&(n=e);var r=this.getViewHeight();null!=t&&(r=t),n=this.xzSize(n),r=this.xzSize(r);var i=this.getOrthographicCamera(),a=n/r;i.left=50*a/-2,i.right=50*a/2,i.top=25,i.bottom=-25,i.updateProjectionMatrix(),this.renderer.setSize(n,r)},d.prototype.updateCameraDisplayRange=function(e,t,n){},d.prototype.zoomInitialStates=function(){},d.prototype.zoomScale=function(e){},d.prototype.zoomW=function(e,t,n){},d.prototype.zoomCenter=function(e,t){},d.prototype.getFullDisplayRange=function(){return{}},d);function d(){var e=a.call(this)||this;return e._viewcolor=15790320,e}n.MxDrawObject3d=p},{"./MxDrawObject":41,"./MxMaterial":52,"./MxNetData":53,"./MxTools":59,three:19,"three-orbitcontrols":17}],44:[function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObjectOsnap=n.McDbLine=n.McDbCurve=n.McDbEntity=n.McDbType=void 0;var a,o,s=e("three"),l=e("./MxThreeJS"),c=e("./MxDrawData"),u=e("./MxJigCmdManager");(o=a=n.McDbType||(n.McDbType={}))[o.kInValid=0]="kInValid",o[o.kLine=1]="kLine";var h=(p.prototype.getType=function(){return this.m_type},p);function p(){this.m_type=a.kInValid}n.McDbEntity=h;var d,f=(i(m,d=h),m);function m(){return null!==d&&d.apply(this,arguments)||this}n.McDbCurve=f;var g,v=(i(y,g=f),y);function y(){var e=g.call(this)||this;return e.m_type=a.kLine,e}n.McDbLine=v;var x=(_.prototype.getBlobHead=function(e,t){var n={};return n.type=e.getInt32(t,!0),t+=4,n.ver=e.getInt32(t,!0),t+=4,n.databaseIndex=e.getInt32(t,!0),t+=4,n.nOffset=t,n},_.prototype.clearData=function(){this.threejsObjects=new s.Object3D},_.prototype.calculateDistance=function(e,t,n){var r=(new s.Vector3).subVectors(t,e),i=(new s.Vector3).subVectors(n,e),a=r.clone().normalize(),o=i.clone().normalize(),l=a.dot(o),c=(new s.Vector3).subVectors(n,t),u=(new s.Vector3).subVectors(e,t),h=c.clone().normalize(),p=u.clone().normalize();if(0<h.dot(p)&&0<l){var d=Math.sqrt(1-l*l),f=e.distanceTo(n),m=f*d,g=f*l,v=r.clone().normalize().multiplyScalar(g),y=e.clone().add(v),x=r.clone().normalize().multiplyScalar(200+g);return{pt1:e,pt2:t,pt:n,distance:m,targetPt:y,warningPt:e.clone().add(x)}}return null},_.prototype.getOsnapData=function(e,t){if(this.threejsObjects){var n=new s.Raycaster,r=c.MxDrawData.getCursorWidthPixels();n.linePrecision=this.mxObj.screenCoordLong2World(r);var i=this.mxObj.getCanvas(),o=i.clientWidth,l=i.clientHeight,h=this.mxObj.screenCoord2World(e.x,e.y);h.z=0,e=new s.Vector2(e.x/o*2-1,-e.y/l*2+1),n.setFromCamera(e,this.mxObj.getCamera());var p=n.intersectObjects(this.threejsObjects.children,!0),d=new Map;if(p.length)for(var f=0;f<p.length;f++){var m=p[f];if(m.object.userData&&m.object.userData.obj.getType()==a.kLine){var g=m.object.userData.obj,v=h.distanceTo(g.pt1);g.pt1.type=u.MxJigCmdManager.OsnapMode.kOsModeEnd,d.set(v,g.pt1);var y=h.distanceTo(g.pt2);if(g.pt2.type=u.MxJigCmdManager.OsnapMode.kOsModeEnd,d.set(y,g.pt2),!g.bulge||0==g.bulge){var x=this.calculateDistance(g.pt1,g.pt2,h);x&&(x.targetPt.type=u.MxJigCmdManager.OsnapMode.kOsModeNear,d.set(x.distance,x.targetPt))}}}if(d.size){var _=this.mxObj.screenCoordLong2World(r),b=Array.from(d);b.sort(function(e,t){return e[0]-t[0]}),b[0][0]<_&&t(b[0][1],b[0][1].type)}}},_.prototype.mxWebEntitysData=function(e,t){var n=this.getBlobHead(e,0);e.getInt32(n.nOffset,!0),n.nOffset+=4;var r=e.getInt32(n.nOffset,!0);n.nOffset+=4;var i=e.getInt32(n.nOffset,!0);if(n.nOffset+=4,1<i)console.log("mx:error mxfun.js version is old!");else{var a=e.getInt32(n.nOffset,!0);if(n.nOffset+=4,a==n.nOffset){this.threejsObjects=new s.Object3D;for(var o=0;o<r;o++){var c=e.getInt8(n.nOffset);n.nOffset+=1;var u=e.getInt32(n.nOffset,!0);if(n.nOffset+=4,1==c){var h=e.getFloat32(n.nOffset,!0);n.nOffset+=4;var p=e.getFloat32(n.nOffset,!0);n.nOffset+=4;var d=e.getFloat32(n.nOffset,!0);n.nOffset+=4;var f=e.getFloat32(n.nOffset,!0);n.nOffset+=4,(M=new v).pt1=new s.Vector3(h,p,0),M.pt2=new s.Vector3(d,f,0),(S=l.MxThreeJS.createLine(M.pt1,M.pt2,16777215)).userData.obj=M,this.threejsObjects.add(S)}else if(2==c){var m=e.getInt8(n.nOffset);n.nOffset+=1;var g=e.getInt32(n.nOffset,!0);n.nOffset+=4;for(var y=new s.Vector3,x=0,_=null,b=0;b<g;b++){var w=new s.Vector3;w.x=e.getFloat32(n.nOffset,!0),n.nOffset+=4,w.y=e.getFloat32(n.nOffset,!0),n.nOffset+=4;var M,S,T=e.getFloat32(n.nOffset,!0);n.nOffset+=4,0<b&&((M=new v).pt1=y.clone(),M.pt2=w.clone(),M.bulge=T,(S=l.MxThreeJS.createLine(M.pt1,M.pt2,16777215)).userData.obj=M,this.threejsObjects.add(S)),y=w,x=T,0==b&&(_=w)}m&&2<g&&((M=new v).pt1=_.clone(),M.pt2=y.clone(),M.bulge=x,(S=l.MxThreeJS.createLine(M.pt1,M.pt2,16777215)).userData.obj=M,this.threejsObjects.add(S))}else console.log("mx:error mxWebEntitysData type"),n.nOffset=n.nOffset-5+u}}else console.log("mx: mxWebEntitysData size assert(0)")}},_);function _(e){this.threejsObjects=null,this.mxObj=null,this.mxObj=e}n.MxDrawObjectOsnap=x},{"./MxDrawData":40,"./MxJigCmdManager":48,"./MxThreeJS":58,three:19}],45:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxFun=void 0;var r,i,a,o,s,l,c,u,h,p,d,f,m,g,v=e("three"),y=e("./MxManager"),x=e("./MxDrawObject2d"),_=e("./MxDrawObject3d"),b=e("./MxUiObjectMobile"),w=e("./MxUiObjectPC"),M=e("./MxJigCmdManager"),S=e("./MxJigGetLine"),T=e("./MxCmdRunManager"),E=e("./MxUiVue"),C=e("./MxThreeJS"),A=e("./MxWindowsEvent"),L=e("./MxTools"),D=e("./MxDrawCommands"),P=e("./MxDrawData"),O=e("./MxCADEditDisplay"),R=e("./MxLocalFileLoad"),I=e("./TempTest/MxTestJig"),B=e("./MxVersion");function N(e){e.cmd&&z(e.cmd)}function k(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),n=window.location.search.substr(1).match(t);return null!=n?decodeURIComponent(n[2]):""}function F(){return y.MxManager.currentMx()}function G(){return y.MxManager.currentMx()}function V(e,t){var n={};if(null!=e)if(e instanceof Array)n.is2d=!0;else{0==e.length&&(e="empty");var r=e.substring(e.lastIndexOf(".")+1).toLowerCase();if("dwg"!=r&&"dxf"!=r&&"dwf"!=r&&"mwg"!=r&&"wgh"!=r||(n.is2d=!0),1!=t&&null!=t&&"wgh"!=r){var i=void 0,a=e.split("/");"$"==(i=1==a.length?a[0]:a[a.length-1])[0]&&(i=i.substring(1));for(var o=void 0,s=0;s<a.length-1;s++)o=0==s?a[s]:o+"/"+a[s];e=o+"/$"+i+".mxb1.wgh"}}else e="empty";return n.sFileName=e,n}function z(e,t){var n=G();if(n)return T.MxCmdRunManager.runCmd(n,e,t)}function U(e){null!=e&&(e.init(),E.MxUiVue.init(e)),d||(console.log("MxDraw Version:"+B.MxBulid.getVersion()),d=!0,g=new R.MxLocalNodeJs,M.MxJigCmdManager.init(),A.MxWindowsEvent.registEvent(),y.MxManager.init(),D.MxDrawCommands.registerCommand(),window.mxConfig_isLoadTest&&I.MxTest.registerCommand(),m.sendStringToExecute=N)}r=n.MxFun||(n.MxFun={}),i=".",c=s=o=-1,p=null,d=!(h="ws://localhost:5090"),m={},g=f=u=l=a=void 0,r.getUiObj=function(){return p},r.getNodeJs=function(){return g},r.setMxServer=function(e){h=e},r.getMxServer=function(){return h},r.isPC=function(){return!/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)},r.getClientPlatform=function(){return navigator.platform},r.getClientInfo=function(){return{width:document.body.clientWidth,height:document.body.clientHeight}},r.curPath=function(){return i},r.setCurPath=function(e){i=e},r.getQueryString=k,r.getLocationPageUrl=function(){var e=window.location.href,t=e.lastIndexOf("?");return-1==t?e:e.substring(0,t)},r.getUrlParams=function(){var e=window.location.search,t=e.substr(1,e.length).split("&"),n=new Array;if(null!=t)for(var r=0;r<t.length;r++){var i=t[r].replace(/[=|^==]/,"&").split("&");if(1<i.length){var a=new Array;a.push(decodeURIComponent(i[0])),a.push(decodeURIComponent(i[1])),n.push(a)}}return n},r.call=function(e,t,n){null==t?t="{}":"string"==typeof t?0==t.length?t="{}":"["==t[0]&&"]"==t[t.length-1]||"{"==t[0]&&"}"==t[t.length-1]||(t='"'+(t=t.replace(/"/g,"'"))+'"'):t="object"==typeof t?JSON.stringify(t):"{}",y.MxManager.currentMx().call(e,t,n)},r.loadCodeToServer=function(e,t){y.MxManager.currentMx().loadCodeToServer(e,t)},r.getCurrentMx=F,r.getCurrentMxCAD=function(){var e=F();return e?e.getMxCAD():null},r.loadCodeFileToServer=function(e,t,n){y.MxManager.currentMx().loadCodeFileToServer(e,t,n)},r.isEnableSelect=function(){if(-1!=o)return 1==o;var e=k("select");return o=0,null!=e&&"y"==e.toLowerCase()&&(o=1),1==o},r.is3DDwg=function(){if(-1!=c)return 1==c;var e=k("3ddwg");return c=0,null!=e&&"y"==e.toLowerCase()&&(c=1),1==c},r.isStaticLoad=function(){if(-1!=s)return 1==s;var e=k("static");return s=0,null!=e&&"y"==e.toLowerCase()&&(s=1),1==s},r.enableSelect=function(e){o=e?1:0},r.enablStaticLoad=function(e){s=null==e||e?1:0},r.dwgDir=function(){return null!=l||null==(l=k("dwgdir"))&&(l=""),l},r.setDwgDir=function(e){l=e},r.getStaticServer=function(){return null!=u||null==(u=k("staticServer"))&&(u=""),u},r.setStaticServer=function(e){u=e},r.is2dParam=function(){if(null!=a)return a;var e=k("file");if(a=!1,null!=e){var t=e.substring(e.lastIndexOf(".")+1);"dwg"!=t.toLowerCase()&&"dxf"!=t.toLowerCase()&&"dwf"!=t.toLowerCase()&&"mwg"!=t.toLowerCase()||(a=!0)}return a},r.set2dParam=function(e){a=e},r.showLayer=function(e,t,n){var r=y.MxManager.currentMx().getMxCAD();if(!r)return y.MxManager.currentMx().showLayer(e,t,n);"number"==typeof e&&O.MxCADDisplayFun.showLayer(r.getDatabase(),e,t)},r.upDisplayForLayerData=function(e){var t=y.MxManager.currentMx().getMxCAD();return!!t&&t.getDatabase().getLayerTable().upDisplayForLayerData(t.getDatabase(),e)},r.screenCoord2World=function(e,t,n){return e instanceof Object?y.MxManager.currentMx().screenCoord2World(e.x,e.y,e.z):y.MxManager.currentMx().screenCoord2World(e,t,n)},r.worldCoord2Screen=function(e,t,n){return e instanceof Object?y.MxManager.currentMx().worldCoord2Screen(e.x,e.y,e.z):y.MxManager.currentMx().worldCoord2Screen(e,t,n)},r.docCoord2World=function(e,t,n){return e instanceof Object?y.MxManager.currentMx().docCoord2World(e.x,e.y,e.z):y.MxManager.currentMx().docCoord2World(e,t,n)},r.worldCoord2Doc=function(e,t,n){return e instanceof Object?y.MxManager.currentMx().worldCoord2Doc(e.x,e.y,e.z):y.MxManager.currentMx().worldCoord2Doc(e,t,n)},r.screenCoord2Doc=function(e,t,n){return e instanceof Object?y.MxManager.currentMx().screenCoord2Doc(e.x,e.y,e.z):y.MxManager.currentMx().screenCoord2Doc(e,t,n)},r.docCoord2Screen=function(e,t,n){return e instanceof Object?y.MxManager.currentMx().docCoord2Screen(e.x,e.y,e.z):y.MxManager.currentMx().docCoord2Screen(e,t,n)},r.zoomCenter=function(e,t){y.MxManager.currentMx().is2D()&&(y.MxManager.currentMx().zoomCenter(e,t),y.MxManager.currentMx().updateDisplay())},r.zoomW=function(e,t,n,r,i){y.MxManager.currentMx().is2D()&&(y.MxManager.currentMx().zoomW(new v.Vector3(e,t,0),new v.Vector3(n,r,0),i),y.MxManager.currentMx().updateDisplay())},r.zoomScale=function(e){y.MxManager.currentMx().is2D()&&(y.MxManager.currentMx().zoomScale(e),y.MxManager.currentMx().updateDisplay())},r.zoomAll=function(){y.MxManager.currentMx().is2D()&&(y.MxManager.currentMx().zoomAll(),y.MxManager.currentMx().updateDisplay())},r.deleteAll=function(){return y.MxManager.currentMx().deleteAll()},r.callCommand=function(e,t,n){y.MxManager.currentMx().callCommand(e,t,n)},r.getCurrentColor=function(){return y.MxManager.currentMx().getCurrentColor()},r.setCurrentColor=function(e){y.MxManager.currentMx().setCurrentColor(e)},r.undo=function(){y.MxManager.currentMx().undo()},r.save=function(){y.MxManager.currentMx().save()},r.showLoading=function(){null!=p&&p.ShowLoading()},r.hideLoading=function(){null!=p&&p.HideLoading()},r.showProp=function(e){null!=p&&p.ShowObjectProperty(e)},r.hideProp=function(){null!=p&&p.HideObjectProp()},r.getUiObject=function(){return p},r.getViewCenterDocCoord=function(){return y.MxManager.currentMx().is2D()?y.MxManager.currentMx().getViewCenterDocCoord():new v.Vector3(0,0,0)},r.screenCoordLong2Doc=function(e){return y.MxManager.currentMx().is2D()?y.MxManager.currentMx().screenCoordLong2Doc(e):e},r.docCoordLong2Screen=function(e){return y.MxManager.currentMx().is2D()?y.MxManager.currentMx().docCoordLong2Screen(e):e},r.worldCoordLong2Doc=function(e){return y.MxManager.currentMx().is2D()?y.MxManager.currentMx().worldCoordLong2Doc(e):e},r.docCoordLong2World=function(e){return y.MxManager.currentMx().is2D()?y.MxManager.currentMx().docCoordLong2World(e):e},r.screenCoordLong2World=function(e){return y.MxManager.currentMx().is2D()?y.MxManager.currentMx().screenCoordLong2World(e):e},r.worldCoordLong2Screen=function(e){return y.MxManager.currentMx().is2D()?y.MxManager.currentMx().worldCoordLong2Screen(e):e},r.addSelectEvent=function(e){y.MxManager.addSelectEvent(e)},r.clearSelectEvent=function(){y.MxManager.clearSelectEvent()},r.removeThreejsObject=function(e,t,n){e&&(e.traverse(function(e){(e instanceof v.Mesh||e instanceof v.Line||e instanceof v.LineLoop)&&(e.geometry.dispose(),n&&(e.material instanceof Array?e.material.forEach(function(e){e.dispose()}):e.material.dispose()))}),t.remove(e))},r.setOutServerDebugCall=function(e){y.MxManager.setOutDebugCall(e)},r.updateDisplay=function(){y.MxManager.updateDisplay()},r.getCurrentDraw=G,r.formatString=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r++)e=e.replace("{".concat(r,"}"),t[r]);return e},r.createMxUiObject=function(e){var t;return t=this.isPC()?new w.MxUiObjectPC:new b.MxUiObjectMobile,e(p=t),t.create(),t},r.openFile=function(e,t){null==t&&(t=!1);var n=V(e,t);return n.is2d&&(a=n.is2d),e=n.sFileName,y.MxManager.currentMx().openFile(e)},r.createMxObject=function(e,t,n,i,a,o){d||U(),"string"==typeof e&&(e=0==e.length?void 0:document.getElementById(e)),null==t&&(t=r.getQueryString("file"));var s=null!=i&&i,l=V(t,o);l.is2d&&(s=l.is2d),t=l.sFileName,1==a&&(t="");var c=null;return s?(c=new x.MxDrawObject2d).setViewColor(0):(c=new _.MxDrawObject3d).setViewColor(15790320),null!=n&&n(c),c.create(e,t),c},r.getMxObjectFormElement=function(e){return y.MxManager.getMxObject(e)},r.isRunningCommand=function(){return M.MxJigCmdManager.isRunning()},r.stopRunCommand=function(){return M.MxJigCmdManager.stopCmd()},r.runCommand=function(e){return M.MxJigCmdManager.runCmd(e)},r.getTHREE=function(){return v},r.getLine=function(e){var t=new S.MxJigGetLine;t.setRetCall(e),M.MxJigCmdManager.runCmd(t)},r.addCommand=function(e,t,n){T.MxCmdRunManager.addCommand(e,t,n)},r.sendStringToExecute=z,r.initUiDataObject=function(e){e.init(r),E.MxUiVue.init(e)},r.init=U,r.addWindowsEvent=function(e){A.MxWindowsEvent.addEvent(e)},r.getCurrentMousePostion=function(){return A.MxWindowsEvent.getCurrentMousePostion()},r.getMxThreeJS=function(){return C.MxThreeJS},r.getMxTools=function(){return L.MxTools},r.getMxCmdRunManager=function(){return T.MxCmdRunManager},r.getMxJigCmdManager=function(){return M.MxJigCmdManager},r.initQuickCommand=function(e){T.MxCmdRunManager.InitQuickCommand(e)},r.Assert=function(e){e||console.log("MxAssert error")},r.setIniset=function(e){P.MxDrawData.setIniset(e)},r.setPostMessageToParentFrameFunction=function(e){f=e},r.postMessageToParentFrame=function(e){return null!=f&&(f(e),!0)},r.onParentFrameMessage=function(e){null!=e&&null!=e.type&&m[e.type]&&m[e.type](e)},r.acutPrintf=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!E.MxUiVue.isNull()){for(var r=arguments,i=r[0],a=0;a<r.length-1;a++){var o=new RegExp("\\{"+a+"\\}","gm");i=i.replace(o,r[a+1])}E.MxUiVue.AcutPrintfNoFormat(i,!0)}},r.loadImageMaterial=function(e,t){y.MxManager.getMxDbTextureManager().loadImage(e,t)},r.loadSVG=function(e,t,n){y.MxManager.getMxDbSvgManager().loadSVG(e,t,n)},r.initMxDbEntityType=function(e){y.MxManager.getMxDbEntityClassHierarchy().init(e)},r.initDynamicCreate=function(e){y.MxManager.getMxDbEntityClassHierarchy().initDynamic(e)}},{"./MxCADEditDisplay":26,"./MxCmdRunManager":33,"./MxDrawCommands":39,"./MxDrawData":40,"./MxDrawObject2d":42,"./MxDrawObject3d":43,"./MxJigCmdManager":48,"./MxJigGetLine":49,"./MxLocalFileLoad":50,"./MxManager":51,"./MxThreeJS":58,"./MxTools":59,"./MxUiObjectMobile":62,"./MxUiObjectPC":63,"./MxUiVue":64,"./MxVersion":65,"./MxWindowsEvent":66,"./TempTest/MxTestJig":70,three:19}],46:[function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxIntelliSelectJig=void 0;var a,o=e("three"),s=e("./MxJig"),l=e("./MxJigCmdManager"),c=e("./MxThreeJS"),u=(i(h,a=s.McEdJigCommand),h.prototype.sampler=function(){var e=l.MxJigCmdManager.InType.kGetBegan,t=this.acquirePoint(e);return t.status==l.MxJigCmdManager.DragStatus.kNormal&&(this.m_pt2=t.pt),t.status},h.prototype.getTypeName=function(){return"MxIntelliSelect"},h.prototype.done=function(e){if(e==l.MxJigCmdManager.DragStatus.kNormal){var t=this.getMxObject();if(this.m_isFrontEndWebpage)t.getMxDatabase().getGripManager().doWindowsSelect(this.m_pt1,this.m_pt2);else{var n={x1:this.m_pt1.x,y1:this.m_pt1.y,x2:this.m_pt2.x,y2:this.m_pt2.y};t.callCommand("MxCAD_IntelliSelect",JSON.stringify(n),function(e){t.getMxCAD().getGrip().onIntelliSelect(e)})}}return l.MxJigCmdManager.DoneStatius.kExitCommand},h.prototype.doPointSelect=function(e,t,n){var r=e.screenCoordLong2Doc(16),i={x:t.x,y:t.y,tol:r};e.callCommand("MxCAD_IntelliSelect_Point",JSON.stringify(i),function(e){n(e)})},h.prototype.upDisplay=function(){var e=new o.Vector3(this.m_pt1.x,this.m_pt2.y,this.m_pt2.z),t=new o.Vector3(this.m_pt2.x,this.m_pt1.y,this.m_pt2.z),n=[];n.push(this.m_pt1),n.push(e),n.push(this.m_pt2),n.push(t),n.push(this.m_pt1);var r=null,i=65280;if(this.m_pt2.x>this.m_pt1.x)r=c.MxThreeJS.createLines(n,16777215),i=255;else{var a=this.getMxObject().screenCoordLong2Doc(3);r=c.MxThreeJS.createDashedLines(n,16777215,2*a,a)}var s=[];s.push(this.m_pt1),s.push(e),s.push(this.m_pt2),s.push(this.m_pt1),s.push(this.m_pt2),s.push(t);var l=c.MxThreeJS.createTriangle(s,i,.27);this.drawEntity(l,30),this.drawEntity(r,31)},h);function h(e,t){var n=a.call(this)||this;return n.m_pt1=e,n.m_pt2=e,n.m_isFrontEndWebpage=t,n}n.MxIntelliSelectJig=u},{"./MxJig":47,"./MxJigCmdManager":48,"./MxThreeJS":58,three:19}],47:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.McEdJigCommand=n.MxDynamicInput=void 0;var r=e("three"),i=e("./MxFun"),a=e("./MxJigCmdManager"),o=e("./MxManager"),s=e("./MxTools"),l=e("./MxUiVue"),c=e("./McEdJigOsnap"),u=e("./MxWindowsEvent"),h=(p.prototype.onKeyDonw=function(e){if(27==e)return this.m_isInputStatus?(this.m_isInputStatus=!1,l.MxUiVue.OnMxEvent({name:"dynInputReSet"}),1):0;if(32!=e&&13!=e)return this.m_isInputStatus=!0,0;if(this.m_isInputStatus&&l.MxUiVue.DynamicInput_isShow()&&l.MxUiVue.DynamicInput_getType()==a.MxJigCmdManager.DynamicInputType.kXYCoordInput){var t,n=l.MxUiVue.DynamicInput_getValue1(),r=l.MxUiVue.DynamicInput_getValue2(),o=l.MxUiVue.DynamicInput_getFocusValue();t=s.MxTools.IsNumerical(n)&&s.MxTools.IsNumerical(r)?i.MxFun.formatString("{0},{1}",n,r):o,l.MxUiVue.setCmdText(t)}return this.m_isInputStatus=!1,0},p.prototype.isInputStatus=function(){return this.m_isInputStatus},p.prototype.initDynInput=function(e){this.m_jig=e;var t=this.m_jig.getMxObject();l.MxUiVue.DynamicInput_setType(this.m_dynType),this.m_dynType==a.MxJigCmdManager.DynamicInputType.kAutoInput&&(null!=this._dynamicInputBasePoint||t.sysVariable().getSysVarNumber("GETPOINTSTATUS")&a.MxJigCmdManager.GETPOINTSTATUS.OsModeSValidLastPoint?l.MxUiVue.DynamicInput_setType(a.MxJigCmdManager.DynamicInputType.kDistanceInput):l.MxUiVue.DynamicInput_setType(a.MxJigCmdManager.DynamicInputType.kXYCoordInput))},p.prototype.setFocus=function(e){l.MxUiVue.OnMxEvent({name:"dynInputSetFocus",param:{isFocus:e}})},p.prototype.exitDynInput=function(){this._dynamicInputBasePoint=void 0,l.MxUiVue.DynamicInput_setShow(!1),l.MxUiVue.DynamicInput_upDisplay()},p.prototype.isShow=function(){return l.MxUiVue.DynamicInput_isShow()},p.prototype.upDynInput=function(){var e,t=this.m_jig.getMxObject();if(e=!this.m_jig.isDisableDynInput()&&t.sysVariable().getSysVarBool("DYNINPUT"),l.MxUiVue.DynamicInput_setShow(e),e){if(l.MxUiVue.DynamicInput_setTip(l.MxUiVue.getCmdTip()),a.MxJigCmdManager.getAcquireStatus()==a.MxJigCmdManager.AcquireStatus.kMove){var n=a.MxJigCmdManager.getAcquirePoint();if(l.MxUiVue.DynamicInput_setPos(i.MxFun.docCoord2Screen(n.x,n.y,n.z)),l.MxUiVue.DynamicInput_getType()==a.MxJigCmdManager.DynamicInputType.kXYCoordInput){var r=n;l.MxUiVue.DynamicInput_setValue1(r.x.toFixed(3)),l.MxUiVue.DynamicInput_setValue2(r.y.toFixed(3))}else l.MxUiVue.DynamicInput_getType(),a.MxJigCmdManager.DynamicInputType.kDistanceInput}l.MxUiVue.DynamicInput_upDisplay()}},p.prototype.setDynamicInputBasePoint=function(e){this._dynamicInputBasePoint=e},p.prototype.setDynamicInputType=function(e){this.m_dynType=e},p.prototype.getDynamicInputType=function(){return this.m_dynType},p);function p(e){this.m_dynType=a.MxJigCmdManager.DynamicInputType.kAutoInput,this._dynamicInputBasePoint=void 0,this.m_isInputStatus=!1,this.m_jig=e}n.MxDynamicInput=h;var d=(f.prototype.getTypeName=function(){return""},f.prototype.getSence=function(){return this._mxObject.getTheTempDrawContainer()},f.prototype.onExitCommand=function(e){e&&this.m_dynInput.exitDynInput(),this.m_osnap.endDrag()},f.prototype.getOsnap=function(){return this.m_osnap},f.prototype.isDisableDynInput=function(){return this.m_isDisableDynInput},f.prototype.setDisableDynInput=function(e){this.m_isDisableDynInput=e},f.prototype.setDisableOsnap=function(e){this.m_isDisableOsnap=e},f.prototype.isDisableOsnap=function(){return this.m_isDisableOsnap},f.prototype.onStartCommand=function(){this._isCancle=!1,this._isExit=!1,this.m_dynInput.initDynInput(this),c.McEdImpJigGlobalData.intiStartDrag(this._mxObject),this.m_osnap.startDrag(this.m_isOffsetInputPostion,this);var e=u.MxWindowsEvent.getCurrentMousePostion(),t=this._mxObject.screenCoord2Doc(e.x,e.y,0);this.m_osnap.setPoint(t),a.MxJigCmdManager.doMouseMoveImp(),this.m_dynInput.setFocus(!0)},f.prototype.getDynImput=function(){return this.m_dynInput},f.prototype.setMxObject=function(e){this._mxObject=e},f.prototype.getMxObject=function(){return this._mxObject},f.prototype.setColor=function(e){this._iColor=e},f.prototype.getColor=function(){return this._iColor},f.prototype.setDynamicInputType=function(e){this.m_dynInput.setDynamicInputType(e)},f.prototype.getDynamicInputType=function(){return this.m_dynInput.getDynamicInputType()},f.prototype.createTriangle=function(e,t,n){var i=new r.MeshBasicMaterial({color:this._iColor,side:r.DoubleSide}),a=new r.Geometry;a.vertices.push(e),a.vertices.push(t),a.vertices.push(n);var o=new r.Vector3(1,1,1),s=new r.Color(this._iColor),l=new r.Face3(0,1,2,o,s,0);return a.faces.push(l),a.computeFaceNormals(),a.computeVertexNormals(),new r.Mesh(a,i)},f.prototype.createPoint=function(e){var t=new r.Geometry;t.vertices.push(e);var n=new r.PointsMaterial({color:this._iColor,size:3});return new r.Points(t,n)},f.prototype.createLine=function(e,t){var n=new r.Geometry,i=new r.LineBasicMaterial({color:this._iColor});return n.vertices.push(e,t),new r.Line(n,i)},f.prototype.drawReserve=function(e){this.m_isReserveDrawStatus=!0,this.m_callReserveDrawAddEntity=e,this.upDisplay(),this.m_isReserveDrawStatus=!1,this.m_callReserveDrawAddEntity=null},f.prototype.drawEntity=function(e,t){if(null!=e)if(this.m_isReserveDrawStatus)e.renderOrder=null!=t?t:o.MxData.iDynJigRenderOrder,this._mxObject.addObject(e),this.m_callReserveDrawAddEntity&&this.m_callReserveDrawAddEntity(e);else{var n="MxDynDraw_"+this._DynNameId.toString();e.name=n,e.renderOrder=null!=t?t:o.MxData.iDynJigRenderOrder,null==this._aryDynDrawObjectNamesId&&(this._aryDynDrawObjectNamesId=new Array),this._aryDynDrawObjectNamesId.push(this._DynNameId),this._DynNameId++,this.getSence().add(e)}},f.prototype.floorPowerOfTwo=function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},f.prototype.makeTextSprite=function(e,t,n,a,o){var s,l=document.createElement("canvas"),c=l.getContext("2d"),u=i.MxFun.formatString("normal {0}px Arial","256");c.font=u;var h=c.measureText(e);s=2*this.floorPowerOfTwo(h.width),l.width=s,l.height=256,c.font=u,c.textAlign="center",c.textBaseline="middle";var p=i.MxFun.formatString("#{0}",o.toString(16));c.fillStyle=p,c.fillText(e,s/2,128);var d=new r.Texture(l);d.needsUpdate=!0;var f=new r.SpriteMaterial({map:d});f.transparent=!1,f.rotation=a;var m=new r.Sprite(f);return m.scale.set(s/256*n,n,1),m.position.set(t.x,t.y,0),m},f.prototype.drawText=function(e,t,n,r){var i=this.makeTextSprite(e,r,t,n,this._iColor);this.drawEntity(i)},f.prototype.drawPoints=function(e){for(var t=0;t<e.length;t++){var n=new r.Geometry;n.vertices.push(e[t]);var i=new r.PointsMaterial({color:this._iColor,size:3}),a=new r.Points(n,i);this.drawEntity(a)}},f.prototype.drawPoint=function(e){var t=new r.Geometry;t.vertices.push(e);var n=new r.PointsMaterial({color:this._iColor,size:3}),i=new r.Points(t,n);this.drawEntity(i)},f.prototype.drawPolyline=function(e){for(var t=new r.Geometry,n=0;n<e.length;n++)t.vertices.push(e[n]);var i=new r.LineBasicMaterial({color:this._iColor}),a=new r.Line(t,i);this.drawEntity(a)},f.prototype.drawSpline=function(e){},f.prototype.drawCircle=function(e,t){var n=new r.CircleGeometry(t,64,3,2*Math.PI),i=new r.LineBasicMaterial({color:this._iColor});n.vertices.shift();var a=new r.LineLoop(n,i);a.position.x=e.x,a.position.y=e.y,a.position.z=e.z,this.drawEntity(a)},f.prototype.drawArc=function(e,t,n,i){var a=new r.CircleGeometry(t,64,n,i),o=new r.LineBasicMaterial({color:this._iColor});a.vertices.shift();var s=new r.Line(a,o);s.position.x=e.x,s.position.y=e.y,s.position.z=e.z,this.drawEntity(s)},f.prototype.drawLine=function(e,t){var n=new r.Geometry,i=new r.LineBasicMaterial({color:this._iColor});n.vertices.push(e,t);var a=new r.Line(n,i);this.drawEntity(a)},f.prototype.removeDynDrawObject=function(){if(null!=this._aryDynDrawObjectNamesId){for(var e=0;e<this._aryDynDrawObjectNamesId.length;e++){var t="MxDynDraw_"+this._aryDynDrawObjectNamesId[e].toString(),n=this.getSence().getObjectByName(t);i.MxFun.removeThreejsObject(n,this.getSence())}this._aryDynDrawObjectNamesId=[]}},f.prototype.acquirePoint=function(e){var t=a.MxJigCmdManager.acquirePoint(e);return this._isExit=t.exit,t},f.prototype.notifyCancleExit=function(){this._isCancle=!0,this.removeDynDrawObject(),this.done(a.MxJigCmdManager.DragStatus.kCancel),this.onExitCommand(!0),a.MxJigCmdManager.commandRunComplete(this)},f.prototype.notifySampler=function(){var e=this.sampler();if(this.m_dynInput.upDynInput(),e==a.MxJigCmdManager.DragStatus.kNormal&&(this.removeDynDrawObject(),this.upDisplay()),this._isExit){var t=this.done(e);this._isCancle||(t==a.MxJigCmdManager.DoneStatius.kContinueCommand?(this._isExit=!1,a.MxJigCmdManager.doMouseMoveImp(),l.MxUiVue.OnMxEvent({name:"dynInputReSet"})):(this.removeDynDrawObject(),a.MxJigCmdManager.commandRunComplete(this),this.onExitCommand(!0)))}this._mxObject.updateDisplay()},f.prototype.getCurrentMouseButton=function(){return a.MxJigCmdManager.getCurrentMouseButton()},f.prototype.userInputControls=function(){return this._userInputContros},f.prototype.setUserInputControls=function(e){this._userInputContros=e},f);function f(){this._isExit=!1,this._aryDynDrawObjectNamesId=void 0,this._DynNameId=1,this._iColor=16777215,this._isCancle=!1,this.m_isDisableDynInput=!1,this.m_isDisableOsnap=!1,this.m_dynInput=new h(this),this.m_osnap=new c.McEdJigOsnap(this),this._userInputContros=a.MxJigCmdManager.UserInputControls.kNullResponseAccepted,this.m_isOffsetInputPostion=!1,this.m_isReserveDrawStatus=!1,this.m_callReserveDrawAddEntity=null,this._mxObject=null}n.McEdJigCommand=d},{"./McEdJigOsnap":20,"./MxFun":45,"./MxJigCmdManager":48,"./MxManager":51,"./MxTools":59,"./MxUiVue":64,"./MxWindowsEvent":66,three:19}],48:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxJigCmdManager=n.AcquireReturn=void 0;var r,i=e("three"),a=e("./MxFun"),o=e("./MxJig"),s=e("./MxManager"),l=e("./MrxDbgUiPrPoint"),c=e("./MrxDbgUiPrBase"),u=e("./MxUiVue"),h=e("./MxTools"),p=e("./MxString"),d=e("./MxWindowsEvent"),f=e("./MxDrawObject"),m=e("./McEdJigOsnap"),g=e("./MxDrawData"),v=function(){this.status=r.DragStatus.kNoChange,this.exit=!0,this.sKeyValue=""};n.AcquireReturn=v,function(e){var t,n,r,y,x,_,b,w,M,S,T,E,C,A,L,D,P,O;(n=t=e.UserInputControls||(e.UserInputControls={}))[n.kGovernedByOrthoMode=1]="kGovernedByOrthoMode",n[n.kNullResponseAccepted=2]="kNullResponseAccepted",n[n.kDontEchoCancelForCtrlC=4]="kDontEchoCancelForCtrlC",n[n.kDontUpdateLastPoint=8]="kDontUpdateLastPoint",n[n.kNoDwgLimitsChecking=16]="kNoDwgLimitsChecking",n[n.kNoZeroResponseAccepted=32]="kNoZeroResponseAccepted",n[n.kNoNegativeResponseAccepted=64]="kNoNegativeResponseAccepted",n[n.kAccept3dCoordinates=128]="kAccept3dCoordinates",n[n.kAcceptMouseUpAsPoint=256]="kAcceptMouseUpAsPoint",n[n.kAnyBlankTerminatesInput=512]="kAnyBlankTerminatesInput",n[n.kInitialBlankTerminatesInput=1024]="kInitialBlankTerminatesInput",n[n.kAcceptOtherInputString=2048]="kAcceptOtherInputString",n[n.kGovernedByUCSDetect=4096]="kGovernedByUCSDetect",n[n.kNoZDirectionOrtho=8192]="kNoZDirectionOrtho",n[n.kSpacesInAccepted=16384]="kSpacesInAccepted",(y=r=e.AcquireStatus||(e.AcquireStatus={}))[y.kNoChange=0]="kNoChange",y[y.kMove=1]="kMove",y[y.kBegan=2]="kBegan",y[y.kEnd=3]="kEnd",y[y.kMouseUp=4]="kMouseUp",y[y.kMouseDown=5]="kMouseDown",y[y.kCancle=6]="kCancle",(_=x=e.DragStatus||(e.DragStatus={}))[_.kNoChange=-6]="kNoChange",_[_.kCancel=-4]="kCancel",_[_.kOther=-3]="kOther",_[_.kNull=-1]="kNull",_[_.kNormal=0]="kNormal",_[_.kKW1=1]="kKW1",(b=e.DoneStatius||(e.DoneStatius={}))[b.kContinueCommand=0]="kContinueCommand",b[b.kExitCommand=1]="kExitCommand",(M=w=e.InType||(e.InType={}))[M.kGetBegan=1]="kGetBegan",M[M.kGetEnd=2]="kGetEnd",(T=S=e.MouseButton||(e.MouseButton={}))[T.kInvalid=-1]="kInvalid",T[T.kLeft=0]="kLeft",T[T.kMid=1]="kMid",T[T.kRight=2]="kRight",(C=E=e.COMMAND_IN||(e.COMMAND_IN={}))[C.COMMAND_IN_NO_ENTITY=0]="COMMAND_IN_NO_ENTITY",C[C.COMMAND_IN_EMTPY=1]="COMMAND_IN_EMTPY",C[C.COMMAND_IN_KEY=2]="COMMAND_IN_KEY",C[C.COMMAND_IN_STRING=3]="COMMAND_IN_STRING",C[C.COMMAND_IN_COORD=5]="COMMAND_IN_COORD",C[C.COMMAND_IN_DIST=6]="COMMAND_IN_DIST",C[C.COMMAND_IN_INVALID=7]="COMMAND_IN_INVALID",C[C.COMMAND_IN_INVALID_ZERO=8]="COMMAND_IN_INVALID_ZERO",C[C.COMMAND_IN_INVALID_NEG=9]="COMMAND_IN_INVALID_NEG",C[C.COMMAND_IN_INT=10]="COMMAND_IN_INT",(L=A=e.COMMAND_GET||(e.COMMAND_GET={}))[L.COMMAND_GET_STRING=1]="COMMAND_GET_STRING",L[L.COMMAND_GET_KEY=2]="COMMAND_GET_KEY",L[L.COMMAND_GET_DIST=4]="COMMAND_GET_DIST",L[L.COMMAND_GET_COORD=8]="COMMAND_GET_COORD",L[L.COMMAND_GET_INT=16]="COMMAND_GET_INT",(D=e.DynamicInputType||(e.DynamicInputType={}))[D.kNoInput=0]="kNoInput",D[D.kXYCoordInput=1]="kXYCoordInput",D[D.kDistanceInput=2]="kDistanceInput",D[D.kDynTip=3]="kDynTip",D[D.kAutoInput=4]="kAutoInput",D[D.kAngleInput=5]="kAngleInput",(P=e.GETPOINTSTATUS||(e.GETPOINTSTATUS={}))[P.OsModeSValidLastPoint=1]="OsModeSValidLastPoint",P[P.OsModeSTempDisable=2]="OsModeSTempDisable",P[P.OsModeOrthoTempDisable=4]="OsModeOrthoTempDisable",P[P.OsModeSInvalidLastMovePoint=8]="OsModeSInvalidLastMovePoint",P[P.OsModePoloarTempDisable=16]="OsModePoloarTempDisable",P[P.OsModeDynTraceTempDisable=32]="OsModeDynTraceTempDisable",P[P.OsModeGridSnapTempDisable=64]="OsModeGridSnapTempDisable",(O=e.OsnapMode||(e.OsnapMode={}))[O.kOsModekValid=0]="kOsModekValid",O[O.kOsModeEnd=1]="kOsModeEnd",O[O.kOsModeMid=2]="kOsModeMid",O[O.kOsModeCen=3]="kOsModeCen",O[O.kOsModeNode=4]="kOsModeNode",O[O.kOsModeQuad=5]="kOsModeQuad",O[O.kOsModeIns=7]="kOsModeIns",O[O.kOsModePerp=8]="kOsModePerp",O[O.kOsModeTan=9]="kOsModeTan",O[O.kOsModeNear=10]="kOsModeNear",O[O.kOsModeInt=11]="kOsModeInt";var R,I=void 0,B=void 0,N=!1,k=r.kNoChange,F=S.kInvalid,G=new i.Vector2(0,0),V=!1,z=void 0,U=!1,j=new Map,H=new Array,W=new p.MxString;function q(){null!=I&&I.notifySampler()}function J(e){var t=e.srcElement;if(t&&"CANVAS"==t.tagName){if(null==I)return;if(I.getDynImput().isInputStatus())return;G.x=e.offsetX,G.y=e.offsetY,Q(G)}}function X(e){if(e.button==S.kLeft){var t=e.srcElement;if(t&&"CANVAS"==t.tagName){if(null==I)return;if(I.getDynImput().isInputStatus())return;G.x=e.offsetX,G.y=e.offsetY,R=I.getMxObject().screenCoord2Doc(e.offsetX,e.offsetY,0),k=r.kMouseUp,F=e.button,q()}}}function Y(e){if(e.button==S.kLeft){null!=I&&I.getDynImput().isShow()&&I.getDynImput().setFocus(!0);var t=e.srcElement;if(t&&"CANVAS"==t.tagName){if(null==I)return;if(I.getDynImput().isInputStatus())return;G.x=e.offsetX,G.y=e.offsetY;var n=I.getMxObject().screenCoord2Doc(e.offsetX,e.offsetY,0),i=I.getOsnap(),a=i.getCurrentOSnapPoint(n);n=a.pt,a.osmode,m.McEdImpJigGlobalData.setPrvPoint(n),i.seInValidPoint(),R=n,k=r.kMouseDown,F=e.button,q()}}}function $(e){if(0!=e.touches.length){var t=e.touches[0].pageX,n=e.touches[0].pageY;R=a.MxFun.screenCoord2Doc(t,n,0),k=r.kBegan,q()}}function Z(e){if(0!=e.touches.length){var t=e.touches[0].pageX,n=e.touches[0].pageY;R=a.MxFun.screenCoord2Doc(t,n,0)}k=r.kEnd,q()}function K(e){if(0!=e.touches.length){var t=e.touches[0].pageX,n=e.touches[0].pageY;R=a.MxFun.screenCoord2Doc(t,n,0),k=r.kMove,q()}}function Q(t){U=!1,null==t&&(t=G);var n=I.getMxObject().screenCoord2Doc(t.x,t.y,0),i=I.getOsnap(),a=I.getMxObject().screenCoordLong2Doc(.5*g.MxDrawData.getCursorWidthPixels());i.setPoint(n,a),e.OsnapMode.kOsModekValid,R=n,k=r.kMove,q.call(this)}function ee(){N||(N=!0,a.MxFun.isPC()?(document.addEventListener("mouseup",X,!1),document.addEventListener("mousemove",J,!1),document.addEventListener("mousedown",Y,!1)):(document.addEventListener("touchstart",$,!1),document.addEventListener("touchend",Z,!1),document.addEventListener("touchmove",K,!1)))}function te(){N&&(N=!1,a.MxFun.isPC()?(document.removeEventListener("mouseup",X,!1),document.removeEventListener("mousemove",J,!1),document.removeEventListener("mousedown",Y,!1)):(document.removeEventListener("touchstart",$,!1),document.removeEventListener("touchend",Z,!1),document.removeEventListener("touchmove",K,!1)))}function ne(e){e.getRunMode()==f.MxRunMode.kBrowse&&e.enableSingleTouchPan(!1),e.tempDisableSelect(!0),e.updateDisplay()}function re(e){var t=new i.Vector3,n=!1,r=new p.MxString(e),a=r.AnalyzeString(",");if(a.length<2)for(;!r.IsEmpty()&&h.MxTools.IsNumerical(r);){var o=h.MxTools._tstof(r.m_val);if(h.MxTools.IsZero(o))break;break}else{var s=new p.MxString(a[0]),l=new p.MxString(a[1]),c=new p.MxString("0");2<a.length&&(c.m_val=a[2]),s.IsEmpty()||"@"!=s.Left(1)?h.MxTools.IsNumerical(s)&&h.MxTools.IsNumerical(l)&&h.MxTools.IsNumerical(c)?(n=!0,t.x=h.MxTools._tstof(s.m_val),t.y=h.MxTools._tstof(l.m_val),t.z=h.MxTools._tstof(c.m_val)):n=!1:(s.m_val=s.Right(s.GetLength()-1),h.MxTools.IsNumerical(s)&&h.MxTools.IsNumerical(l)&&h.MxTools.IsNumerical(c)||(n=!1))}return n?t:null}function ie(e,t){void 0===t&&(t=!1),u.MxUiVue.AcutPrintfNoFormat(e,t)}function ae(e,n){if(e==E.COMMAND_IN_INVALID){var r=u.MxUiVue.getCmdTip();return ie(n),ie(r),x.kNoChange}return e==E.COMMAND_IN_INVALID_ZERO?(r=u.MxUiVue.getCmdTip(),I.userInputControls()&t.kNoNegativeResponseAccepted?ie("\n 值必须为正 且非零。 \n"):ie("\n 值必不能为零。 \n"),ie(r),x.kOther):e!=E.COMMAND_IN_INVALID_NEG?x.kNoChange:(r=u.MxUiVue.getCmdTip(),I.userInputControls()&t.kNoZeroResponseAccepted?ie("\n 值必须为正 且非零。 \n"):ie("\n 值必不能为负。 \n"),ie(r),x.kOther)}function oe(e){var n={iRet:E.COMMAND_IN_NO_ENTITY,sValue:"",iKey:x.kNull,dDist:0,iVal:0,pt:null};if(!U)return n;var r=I.userInputControls(),i=u.MxUiVue.getCmdText();if(0==i.length)return r&t.kNullResponseAccepted?n.iRet=E.COMMAND_IN_EMTPY:n.iRet=E.COMMAND_IN_INVALID,n;if(e&A.COMMAND_GET_KEY&&0<j.size){var a=new p.MxString(i);a.MakeUpper(),a.TrimLeft(" "),a.TrimRight(" ");var o=j.get(a.m_val);if(null!=o)return n.iRet=E.COMMAND_IN_KEY,n.iKey=o,n.sValue=a.m_val,n}if(e&A.COMMAND_GET_DIST&&h.MxTools.IsNumerical(i))return n.dDist=h.MxTools._tstof(i),r&t.kNoZeroResponseAccepted&&h.MxTools.IsZero(n.dDist)?n.iRet=E.COMMAND_IN_INVALID_ZERO:r&t.kNoNegativeResponseAccepted&&n.dDist<0?n.iRet=E.COMMAND_IN_INVALID_NEG:(n.sValue=i,n.iRet=E.COMMAND_IN_DIST),n;if(e&A.COMMAND_GET_INT&&h.MxTools.IsNumerical(i))return n.iVal=h.MxTools._tstoi(i),r&t.kNoZeroResponseAccepted&&0==n.iiVal?n.iRet=E.COMMAND_IN_INVALID_ZERO:r&t.kNoNegativeResponseAccepted&&n.iiVal<0?n.iRet=E.COMMAND_IN_INVALID_NEG:(n.sValue=i,n.iRet=E.COMMAND_IN_INT),n;if(e&A.COMMAND_GET_COORD){var s=re(i);if(null!=s)return n.sValue=i,n.iRet=E.COMMAND_IN_COORD,n.pt=s,n}return e&A.COMMAND_GET_STRING?(n.sValue=i,n.iRet=E.COMMAND_IN_STRING):n.iRet=E.COMMAND_IN_INVALID,n}e.getInputKeyword=function(e){if(e<1)return"";for(var t,n=j.entries();!(t=n.next()).done;)if(t.value==e)return t.key;return""},e.GetKeyWordToString=function(){return H},e.keywordList=function(){return W.m_val},e.setKeywordList=function(e){if(W.m_val=e,j.clear(),H.length=0,!W.IsEmpty())if(W.TrimLeft(" "),W.TrimRight(" "),"["==W.m_val[0]&&"]"==W.m_val[W.m_val.length-1]){W.TrimLeft("["),W.TrimRight("]");for(var t=W.AnalyzeString("/"),n=1,r=0;r<t.length;r++){var i=(s=new p.MxString(t[r])).Find("(");if(-1!=i){var a=new p.MxString(s.Left(i)),o=new p.MxString(s.Right(s.GetLength()-i-1));o.TrimRight(")"),a.IsEmpty()||o.IsEmpty()||(o.MakeUpper(),j.set(o.m_val,n),n++,H.push(new h.MxPair(o.m_val,a.m_val)))}}}else for(t=W.AnalyzeString(" "),n=1,r=0;r<t.length;r++){var s;(s=new p.MxString(t[r])).IsEmpty()||(s.MakeUpper(),j.set(s.m_val,n),n++)}},e.getAcquirePoint=function(){return R},e.getAcquireStatus=function(){return k},e.doMouseMoveImp=Q,e.OnThreeControlsChage=function(){null==I||Q(G)},e.OnEnter=function(e){U=!0,k=r.kNoChange,q(),U=!1},e.Test=function(){U=!0},e.registEvent=ee,e.unRegistEvent=te,e.getCurrentMouseButton=function(){return F},e.isRunning=function(){return null!=I},e.getCurCmd=function(){return I},e.commandRunComplete=function(e){I!=e&&console.log("aseert:_curCmd == cmd");var t,n=s.MxManager.currentMx();null!=I&&(n=I.getMxObject()),null!=B?(ee(),I=B,B=void 0,F=S.kInvalid,I.onStartCommand(),ne(n)):(te(),I=void 0,(t=n).getRunMode()==f.MxRunMode.kBrowse&&t.enableSingleTouchPan(!0),t.tempDisableSelect(!1),t.updateDisplay())},e.isWaitCmdNull=function(){return null==B},e.stopCmd=function(){null!=I&&(V=!0,I.notifyCancleExit(),V=!1)},e.setRunCmdEvent=function(e){z=e},e.runCmd=function(e){if(!V){var t=s.MxManager.currentMx();e.setMxObject(t),G=d.MxWindowsEvent.getCurrentMousePostion(),z&&z(),null==I?(ee(),I=e,F=S.kInvalid,I.onStartCommand(),ne(t)):(B=e,V=!0,I.notifyCancleExit(),V=!1)}},e.GetAcqurePointFromStringTo=re,e.ProcCommandRetResult=ae,e.GetCommandLineContent=oe,e.acquirePoint=function(e){var t=new v;if(null==I)return t.status=x.kCancel,t;var n=oe(A.COMMAND_GET_COORD|A.COMMAND_GET_KEY);return n.iRet==E.COMMAND_IN_EMTPY?(t.status=x.kNull,t.exit=!0):n.iRet==E.COMMAND_IN_KEY?(t.status=n.iKey,t.exit=!0,t.sKeyValue=n.sValue):n.iRet==E.COMMAND_IN_COORD?(t.status=x.kNormal,t.pt=new i.Vector3(n.pt.x,n.pt.y,n.pt.z),t.exit=!0):(ae(n.iRet,"\n 需要点或选项关键字。 \n"),k==r.kMove?(t.status=x.kNormal,t.pt=R,t.exit=!1):k==r.kEnd?e&w.kGetEnd?(t.status=x.kNormal,t.pt=R,t.exit=!0):(t.status=x.kNormal,t.pt=R,t.exit=!1):k==r.kCancle?(t.status=x.kCancel,t.pt=R,t.exit=!0):k==r.kBegan?e&w.kGetBegan?(t.status=x.kNormal,t.pt=R,t.exit=!0):(t.status=x.kNormal,t.pt=R,t.exit=!1):k==r.kMouseDown?(t.status=x.kNormal,t.pt=R,t.exit=!0):(t.status=x.kNoChange,t.pt=void 0,t.exit=!1)),t},e.getMcEdJigCommandClass=function(){return o.McEdJigCommand},e.getMrxDbgUiPrPointClass=function(){return l.MrxDbgUiPrPoint},e.getMcEdGetPointWorldDrawClass=function(){return c.McEdGetPointWorldDraw},e.McEdGetPointWorldDrawObjectClass=function(){return c.McEdGetPointWorldDrawObject},e.init=function(){this._curCmd=void 0}}(r=n.MxJigCmdManager||(n.MxJigCmdManager={}))},{"./McEdJigOsnap":20,"./MrxDbgUiPrBase":22,"./MrxDbgUiPrPoint":23,"./MxDrawData":40,"./MxDrawObject":41,"./MxFun":45,"./MxJig":47,"./MxManager":51,"./MxString":56,"./MxTools":59,"./MxUiVue":64,"./MxWindowsEvent":66,three:19}],49:[function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxJigGetLine=void 0;var a,o=e("./MxJig"),s=e("./MxJigCmdManager"),l=e("./MxFun"),c=(i(u,a=o.McEdJigCommand),u.prototype.sampler=function(){var e=s.MxJigCmdManager.InType.kGetBegan;this._isGetPt1||(e=s.MxJigCmdManager.InType.kGetEnd);var t=this.acquirePoint(e);return t.status==s.MxJigCmdManager.DragStatus.kNormal&&(this._isGetPt1?this._pt1=t.pt:this._pt2=t.pt),t.status},u.prototype.setRetCall=function(e){this._retCall=e},u.prototype.done=function(e){if(this._isGetPt1)return this._isGetPt1=!1,s.MxJigCmdManager.DoneStatius.kContinueCommand;var t={};return t.pt1=l.MxFun.worldCoord2Doc(this._pt1.x,this._pt1.y,this._pt1.z),t.pt2=l.MxFun.worldCoord2Doc(this._pt2.x,this._pt2.y,this._pt2.z),this._retCall(t),s.MxJigCmdManager.DoneStatius.kExitCommand},u.prototype.upDisplay=function(){this._isGetPt1||null==this._pt1||null==this._pt2||this.drawLine(this._pt1,this._pt2)},u);function u(){var e=null!==a&&a.apply(this,arguments)||this;return e._isGetPt1=!0,e}n.MxJigGetLine=c},{"./MxFun":45,"./MxJig":47,"./MxJigCmdManager":48}],50:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxLocalDwgFileLoad=n.MxLocalFileLoad=n.MxLocalNodeJs=void 0;var r=e("./MxFun"),i=(a.prototype.init=function(e){this.loadFileCall=e.loadFileFun},a.prototype.loadFile=function(e,t,n,r,i){null!=this.loadFileCall?this.loadFileCall(e,t,n,r,i):i(void 0)},a);function a(){this.loadFileCall=null}n.MxLocalNodeJs=i;var o=(s.prototype.setPath=function(e){this.path=e},s.prototype.setBinary=function(e){this.isBinary=e},s.prototype.load=function(e,t,n,i){r.MxFun.getNodeJs().loadFile(this.path+e,this.isBinary,t,n,i)},s);function s(){this.path="",this.isBinary=!1}n.MxLocalFileLoad=o;var l=(c.prototype.setShowloading=function(e){this._isShowLoading=e},c.prototype.load=function(e,t){var n="$"+t+".mxb1.wgh";this._path=e,this._filename=t;var r=this;this.getFile(this._path,n,!1,function(e){"string"==typeof e?r.net.onStaticHeadMessage(e):console.log("mx error h1")},function(){console.log("mx get "+n+" faild")})},c.prototype.getDatas=function(){if(this._iGet>=this._dataNum)this._isShowLoading&&r.MxFun.hideLoading();else{var e=this._dataType[this._iGet];this._iGet++;var t=this,n=this._iGet+1,i="$"+this._filename+".mxb"+n+".wgh",a=0!=e;this.getFile(this._path,i,a,function(e){t.net.onStaticMessage(e),t.getDatas()},function(){t._dataNum=0,t._iGet=0,t._isShowLoading&&r.MxFun.hideLoading(),console.log("mx get "+i+" faild")})}},c.prototype.onRenderHead=function(e){var t=JSON.parse(e);this._dataType=t.type,this._dataNum=t.count,this._iGet=0,this._isShowLoading&&r.MxFun.showLoading(),this.getDatas()},c.prototype.getFile=function(e,t,n,r,i){var a=new o;a.setPath(e),a.setBinary(n),a.load(t,r,function(){},i)},c);function c(e){this.net=null,this._dataNum=0,this._iGet=0,this._dataType=[],this._path="",this._filename="",this._isShowLoading=!0,this.net=e}n.MxLocalDwgFileLoad=l},{"./MxFun":45}],51:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxManager=n.MxData=void 0;var r,i,a,o,s,l,c,u,h,p=e("./MxDbEntity"),d=e("./MxDbTextureManager"),f=e("./SVGLoader/MxSVGLoader");(r=n.MxData||(n.MxData={})).iCADMeshRenderOrder=10,r.iCADCurveRenderOrder=20,r.iSelectRenderOrder=5,r.iGripRenderOrder=110,r.iDynJigRenderOrder=120,r.iMxEntityRenderOrder=30,i=n.MxManager||(n.MxManager={}),a=[],o=null,s=[],l=void 0,c=new d.MxDbTextureManager,u=new f.MxSvgManager,h=new p.MxDbEntityClassHierarchy,i.add=function(e){a.push(e)},i.getMxDbEntityClassHierarchy=function(){return h},i.getMxDbTextureManager=function(){return c},i.getMxDbSvgManager=function(){return u},i.outDebugString=function(e){null==l?console.log(e):l(e)},i.setOutDebugCall=function(e){l=e},i.onLoad=function(){for(var e in a)a[e].onLoad()},i.updateDisplay=function(){for(var e in a)a[e].updateDisplay()},i.currentMx=function(){return o},i.setCurrentMx=function(e){o=e},i.initResize=function(){for(var e in a)a[e].initResize()},i.addSelectEvent=function(e){s.push(e)},i.clearSelectEvent=function(){s=[]},i.callSelectObject=function(e){for(var t in s)if(1==s[t](e))break},i.init=function(){},i.getMxObject=function(e){for(var t in a)if(a[t].getCanvas()===e)return a[t];return null}},{"./MxDbEntity":35,"./MxDbTextureManager":38,"./SVGLoader/MxSVGLoader":68}],52:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxMaterial=void 0;var r,i=e("three");(r=n.MxMaterial||(n.MxMaterial={})).shaderUniforms={crAmbient:{value:new i.Vector3(1,0,0)},crDiffuse:{value:new i.Vector3(1,0,0)},crSpecular:{value:new i.Vector3(1,0,0)}},r.m_arrSystemColors=new Array(0,16711680,16776960,65280,65535,255,16711935,16777215,8421504,12632256,16711680,16744319,13369344,13395558,10027008,10046540,8323072,8339263,4980736,4990502,16727808,16752511,13382400,13401958,10036736,10051404,8331008,8343359,4985600,4992806,16744192,16760703,13395456,13408614,10046464,10056268,8339200,8347455,4990464,4995366,16760576,16768895,13408512,13415014,10056192,10061132,8347392,8351551,4995328,4997670,16776960,16777087,13421568,13421670,10066176,10066252,8355584,8355647,5000192,5000230,12582656,14679935,10079232,11717734,7510272,8755532,6258432,7307071,3755008,4344870,8388352,12582783,6736896,10079334,5019904,7510348,4161280,6258495,2509824,3755046,4194048,10485631,3394560,8375398,2529536,6265164,2064128,5209919,1264640,3099686,65280,8388479,52224,6736998,39168,5019980,32512,4161343,19456,2509862,65343,8388511,52275,6737023,39206,5019999,32543,4161359,19475,2509871,65407,8388543,52326,6737049,39244,5020018,32575,4161375,19494,2509881,65471,8388575,52377,6737074,39282,5020037,32607,4161391,19513,2509890,65535,8388607,52428,6737100,39321,5020057,32639,4161407,19532,2509900,49151,8380415,39372,6730444,29337,5014937,24447,4157311,14668,2507340,32767,8372223,26316,6724044,19609,5010073,16255,4153215,9804,2505036,16383,8364031,13260,6717388,9881,5005209,8063,4149119,4940,2502476,255,8355839,204,6710988,153,5000345,127,4145023,76,2500172,4129023,10452991,3342540,8349388,2490521,6245529,2031743,5193599,1245260,3089996,8323327,12550143,6684876,10053324,4980889,7490713,4128895,6242175,2490444,3745356,12517631,14647295,10027212,11691724,7471257,8735897,6226047,7290751,3735628,4335180,16711935,16744447,13369548,13395660,10027161,10046617,8323199,8339327,4980812,4990540,16711871,16744415,13369497,13395634,10027122,10046597,8323167,8339311,4980793,4990530,16711807,16744383,13369446,13395609,10027084,10046578,8323135,8339295,4980774,4990521,16711743,16744351,13369395,13395583,10027046,10046559,8323103,8339279,4980755,4990511,3355443,5987163,8684676,11382189,14079702,16777215),r.m_arrDefUseMaterials=new Array(null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null),r.m_arrDefUseCurveMaterials=new Array(null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null),r.m_arrDefUseBasicMaterials=new Array(null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null),r.m_selectMaterial=new i.MeshPhongMaterial({color:255,opacity:.2,transparent:!0,side:i.DoubleSide}),r.m_mouseMoveMaterial=new i.MeshPhongMaterial({color:16776960,side:i.DoubleSide}),r.m_lockedMaterial=new i.MeshPhongMaterial({color:197379,side:i.DoubleSide}),r.m_samplePoints=new i.PointsMaterial({color:255,depthTest:!1,size:8}),r.m_samplePointsMouseMove=new i.PointsMaterial({color:16711680,depthTest:!1,size:12}),r.GetColorByIndex=function(e){return r.m_arrSystemColors[e]},r.GetColorMaterial=function(e){var t=r.m_arrDefUseMaterials[e];return null===t&&(t=new i.MeshLambertMaterial({color:r.m_arrSystemColors[e],side:i.DoubleSide}),r.m_arrDefUseMaterials[e]=t),t},r.GetBaseColorMaterial=function(e){var t=r.m_arrDefUseBasicMaterials[e];return null===t&&(t=new i.MeshBasicMaterial({color:r.m_arrSystemColors[e],side:i.DoubleSide}),r.m_arrDefUseMaterials[e]=t),t},r.GetCurveColorMaterial=function(e){var t=r.m_arrDefUseCurveMaterials[e];return null===t&&(t=new i.LineBasicMaterial({color:r.m_arrSystemColors[e],linewidth:1}),r.m_arrDefUseCurveMaterials[e]=t),t},r.GetSelectMaterial=function(){return r.m_selectMaterial},r.GetMouseMoveMaterial=function(){return r.m_mouseMoveMaterial},r.GetLockedMaterial=function(){return r.m_lockedMaterial},r.GetSamplePointsMaterial=function(){return r.m_samplePoints},r.GetSamplePointsMouseMoveMaterial=function(){return r.m_samplePointsMouseMove},r.createMaterial=function(e){var t=void 0;if(null==e)return t;function n(e,t){if(null!=t.map){var n=t.map,r=(new i.TextureLoader).load(n);r.wrapS=r.wrapT=i.RepeatWrapping,e.map=r,e.side=i.DoubleSide}}return 0!=e.transparent?e.transparent=!0:e.transparent=!1,"MeshPhongMaterial"==e.name?n(t=new i.MeshPhongMaterial(e),e):"MeshBasicMaterial"==e.name?n(t=new i.MeshBasicMaterial(e),e):"MeshDepthMaterial"==e.name?n(t=new i.MeshDepthMaterial(e),e):"MeshNormalMaterial"==e.name?n(t=new i.MeshNormalMaterial(e),e):"MeshLambertMaterial"==e.name?n(t=new i.MeshLambertMaterial(e),e):"MeshStandardMaterial"==e.name&&n(t=new i.MeshStandardMaterial(e),e),t}},{three:19}],53:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxHFileLoad=n.MxNet=n.MxNetBinMessageType=n.MxNetSend=n.MxNetMessage=n.MxNetMessageType=n.MxNetData=void 0;var r,i,a=e("three"),o=e("./MxFun"),s=e("pako"),l=e("./MxManager"),c=(u.prototype.getId=function(){return this._dataView.getInt32(4,!0)},u.prototype.getVersion_MwBlobHead=function(){return this._dataView.getInt32(60,!0)},u.prototype.getVersion_MwBlobHeadDynLen=function(){return this._dataView.getInt32(4,!0)},u.prototype.getdPointCurveBuffersHead=function(){var e={};return e.ver=this._dataView.getInt32(4,!0),e.databaseIndex=this._dataView.getInt32(8,!0),e.zeroLayerIdIndex=this._dataView.getInt32(16,!0),e.datacount=this._dataView.getInt32(20,!0),e.datasize=this._dataView.getInt32(24,!0),e},u.prototype.getdPointMeshBuffersHead=function(){var e={};return e.ver=this._dataView.getInt32(4,!0),e.databaseIndex=this._dataView.getInt32(8,!0),e.id=this._dataView.getInt32(12,!0),e.zeroLayerIdIndex=this._dataView.getInt32(16,!0),e.datacount=this._dataView.getInt32(20,!0),e.datasize=this._dataView.getInt32(24,!0),e},u.prototype.getdPointCurveBufferDataHead=function(e){e+=4,e+=4,e+=4;var t={};return t.pointCount=this._dataView.getInt32(e,!0),e+=4,t.layerId=this._dataView.getInt32(e,!0),e+=4,t.blkId=this._dataView.getInt32(e,!0),e+=4,t.offset=e,t},u.prototype.getdPointMeshBufferDataHead=function(e){e+=4,e+=4,e+=4;var t={};return t.pointCount=this._dataView.getInt32(e,!0),e+=4,t.layerId=this._dataView.getInt32(e,!0),e+=4,t.blkId=this._dataView.getInt32(e,!0),e+=4,t.offset=e,t},u.prototype.getDatabaseIndex=function(){return this._dataView.getInt32(8,!0)},u.prototype.getColorIndex=function(){return this._dataView.getInt32(24,!0)},u.prototype.getBufferType=function(){return this._dataView.getInt32(32,!0)},u.prototype.getIsSketchEntity=function(){return this._dataView.getInt32(40,!0)},u.prototype.getLayerId=function(){return this._dataView.getInt32(44,!0)},u.prototype.getBlockId=function(){return this._dataView.getInt32(48,!0)},u.prototype.getVertexBufferSize=function(){return this._dataView.getInt32(12,!0)},u.prototype.getIndexBufferSize=function(){return this._dataView.getInt32(16,!0)},u.prototype.getZeroLayerId=function(){return this._dataView.getInt32(52,!0)},u.prototype.getSelectMark=function(){return this._dataView.getInt32(56,!0)},u.prototype.getMateria=function(){var e=this._dataView.getInt32(36,!0);if(0==e)return"";for(var t=[],n=0;n<e;n++){var r=String.fromCharCode(this._dataView.getUint8(80+n));t.push(r)}return t.join("")},u.prototype.getDrawDataOffset=function(){return this._dataView.getInt32(36,!0)+80},u.prototype.getMesh=function(){var e=this._dataView.getInt32(4,!0),t=0==this._dataView.getInt32(32,!0),n={},r=this._dataView.getInt32(12,!0),i=this._dataView.getInt32(16,!0);if(0===r||0===i)return n.size=80,n;var o,s=new a.Geometry,l=80;o=t?r/4/8:r/4/2;for(var c=0;c<o;c++){var u=this._dataView.getFloat32(l+0,!0),h=this._dataView.getFloat32(l+4,!0),p=0;t?(p=this._dataView.getFloat32(l+8,!0),this._dataView.getFloat32(l+12,!0),this._dataView.getFloat32(l+16,!0),this._dataView.getFloat32(l+20,!0),this._dataView.getFloat32(l+24,!0),this._dataView.getFloat32(l+28,!0),l+=32):l+=8;var d=new a.Vector3(u,h,p);s.vertices.push(d)}var f=i/4;for(c=0;c<f;c+=3){var m=this._dataView.getInt32(l,!0);l+=4;var g=this._dataView.getInt32(l,!0);l+=4;var v=this._dataView.getInt32(l,!0);l+=4;var y=new a.Face3(m,g,v);s.faces.push(y)}var x=this.getIsSketchEntity();return n.size=l,n.geometry=s,n.id=e,n.isSketchEntity=x,n.nColorIndex=this._dataView.getInt32(24,!0),n},u.prototype.getCurve=function(e){var t,n=this._dataView.getInt32(32,!0),r=this.getIsSketchEntity(),i=0==n,o={};if((t=i?this._dataView.getInt32(20,!0)/4/3:this._dataView.getInt32(20,!0)/4/2)<2)return o;for(var s=new a.Geometry,l=e,c=0;c<t;c++){var u=this._dataView.getFloat32(l,!0);l+=4;var h=this._dataView.getFloat32(l,!0);l+=4;var p=0;i&&(p=this._dataView.getFloat32(l,!0),l+=4),s.vertices.push(new a.Vector3(u,h,p))}var d=this._dataView.getInt32(4,!0);return o.size=l,o.geometry=s,o.id=d,o.isSketchEntity=r,o.colorIndex=this._dataView.getInt32(28,!0),o},u);function u(e){this._dataView=e}n.MxNetData=c,(i=r=n.MxNetMessageType||(n.MxNetMessageType={})).kAddLayer="00000007",i.kClearLayer="00000008",i.kHideLayer="00000009",i.kShowLayer="00000010",i.kUpdateDisplayRange="00000011",i.kCallJsReturn="00000012",i.kLayerData="00000013",i.kSendDebugString="00000014",i.kShowLoading="00000015",i.kHideLoading="00000016",i.kSelectObject="00000017",i.kGlRenderHead="00000018",i.kUserLoginResult="00000019",i.kOpenFileResult="00000020",i.kServerReturn="00000021",i.kMxCADLayerData="00000056",i.kMxCADSystemVariable="00000057";var h=(p.prototype.setJsRetCall=function(e,t,n){this.serverJsRetCall[t+n]=e},p.prototype.Do=function(e){var t=this.net.getCurrentDatabaseId();if(-1==t){var n=e.substring(0,4);t=parseInt(n)}var r=e.substring(4,12),i=e.substring(12);null!=this.messageCall[r]&&this.messageCall[r](i,t)},p);function p(e,t){this.messageCall=new Map,this.serverJsRetCall=new Map,this.net=null,this.net=t;var n=this;this.messageCall[r.kUpdateDisplayRange]=function(t){if(!n.net.isTzDwgStaticFile()){t=t.replace(/\\/g,"\\\\");try{var r=JSON.parse(t);if(null!=r&&e.is2D()){e.intiDoc2Wold(r.DToWMat),e.updateCameraDisplayRange(new a.Vector3(+r.pt1[0],+r.pt1[1],+r.pt1[2]),new a.Vector3(+r.pt2[0],+r.pt2[1],+r.pt2[2]),+r.viewangle),e.initAllLayoutName(r.layout),e.updateDisplay(!0);var i=o.MxFun.getUiObj();null!=i&&(i.SetLayoutData(r.layout),i.UpDisplayLayout())}}catch(t){console.log("UpdateDisplayRange exception")}}},this.messageCall[r.kCallJsReturn]=function(e){if(0!=e.length){var t=JSON.parse(e);0==t.cmd.length&&(t.cmd="__mx_loadcode");var r=t.cmd+t.count;if(null!=n.serverJsRetCall[r]){var i=n.serverJsRetCall[r];delete n.serverJsRetCall[r],"string"==typeof t.ret&&(t.ret=t.ret.replace(/\'/g,'"')),i(t.ret)}}else console.log("assert(0),kCallJsReturn return empty")},this.messageCall[r.kSendDebugString]=function(e){l.MxManager.outDebugString(e)},this.messageCall[r.kUserLoginResult]=function(t){e.userLoginResult(t)},this.messageCall[r.kOpenFileResult]=function(t){e.openFileResult(t)},this.messageCall[r.kServerReturn]=function(t){e.serverReturn(t)},this.messageCall[r.kShowLoading]=function(e){n.net.isTzDwgStaticFile()||o.MxFun.showLoading()},this.messageCall[r.kHideLoading]=function(t){n.net.isTzDwgStaticFile()||(o.MxFun.hideLoading(),e.callInitCompleteEvent())},this.messageCall[r.kSelectObject]=function(e){var t=JSON.parse(e);l.MxManager.callSelectObject(parseInt(t.id))},this.messageCall[r.kGlRenderHead]=function(t){e.isStaticLocalLoad()?e.getStaticLocalNet().onRenderHead(t):(n.net.isTzDwgStaticFile()?e.getStaticLoadTzNet():e.getStaticNet()).onRenderHead(t)},this.messageCall[r.kMxCADLayerData]=function(t,n){e.getMxCAD().getOpenDisplay().OnMessageLayerData(t)},this.messageCall[r.kMxCADSystemVariable]=function(t,n){e.sysVariable().OnMessageMxCADSystemVariable(t)},this.messageCall[r.kLayerData]=function(t,n){if(0==n){if(e.addLayerInfoComplete(),null!=(s=JSON.parse(t))){if(!s.isSketch){var r=s.list;for(var i in r)e.addLayerInfo(r[i].id,r[i].colorvalue,r[i].name),1==r[i].zerolayer&&e.setZeroLayerId(r[i].id)}s.isSketch||e.callEvent("uiSetLayerData",s.list);var a=o.MxFun.getUiObj();null!=a&&(s.isSketch?a.SetSketchLayerData(s.list):a.SetLayerData(s.list),a.UpDisplayLayer())}}else{var s,l=e.getExtRefManager().getLayers(n);if(l.initComplete(),null!=(s=JSON.parse(t)))for(var i in r=s.list)l.add(r[i].id,r[i].colorvalue,r[i].name),1==r[i].zerolayer&&l.setZeroLayerId(r[i].id)}}}n.MxNetMessage=h;var d,f,m=(g.prototype.UndoMark=function(){null!=this._webSocket&&this._webSocket.send(this.SendType.kUndoMark+"")},g.prototype.DoCommand=function(e,t,n){null!=this._webSocket&&(null!=n?(this._callCount++,200<this._callCount&&(this._callCount=1),this._msg.setJsRetCall(n,e,this._callCount),null==t&&(t=""),this._webSocket.send(this.SendType.kCmdEx+","+e+","+this._callCount+","+t)):null==t?this._webSocket.send(this.SendType.kCmd+","+e):this._webSocket.send(this.SendType.kCmd+","+e+","+t))},g.prototype.OpenFile=function(e){null!=this._webSocket&&this._webSocket.send(this.SendType.kOpenFile+","+e)},g.prototype.UserLogin=function(e,t,n){if(null!=this._webSocket){var r={};r.IdentitySign=e,r.RandomToken=null==t?"":t,r.Init=null==n?"":n,this._webSocket.send(this.SendType.kUserLogin+","+JSON.stringify(r))}},g.prototype.Init=function(e){null!=this._webSocket&&this._webSocket.send(this.SendType.kInit+","+e)},g.prototype.CallServerJS=function(e,t,n){null!=this._webSocket&&(null==n?null==t||null==t||0==t.length?this._webSocket.send(this.SendType.kCallJS+',{"command":"'+e+'","param":"{}"}'):this._webSocket.send(this.SendType.kCallJS+',{"command":"'+e+'","param":'+t+"}"):(this._callCount++,200<this._callCount&&(this._callCount=1),this._msg.setJsRetCall(n,e,this._callCount),null==t||null==t||0==t.length?this._webSocket.send(this.SendType.kCallJS+',{"command":"'+e+'","param":"{}","count":"'+this._callCount+'"}'):this._webSocket.send(this.SendType.kCallJS+',{"command":"'+e+'","param":'+t+',"count":"'+this._callCount+'"}')))},g.prototype.CallLoadCodeToServer=function(e,t){null!=this._webSocket&&(this._msg.setJsRetCall(t,"__mx_loadcode",0),null!=e&&null!=e&&0!=e.length&&this._webSocket.send(this.SendType.kCallJS+","+e))},g.prototype.DeleteObject=function(e){null!=this._webSocket&&this._webSocket.send(this.SendType.kDelete+","+e)},g.prototype.SelectObject=function(e){null!=this._webSocket&&this._webSocket.send(this.SendType.kSelect+","+e)},g.prototype.QuitSelectObject=function(e){null!=this._webSocket&&this._webSocket.send(this.SendType.kQuitSelect+","+e)},g.prototype.SendDragDrawEntity=function(e){null!=this._webSocket&&this._webSocket.send(this.SendType.kAddDragDraw+","+e)},g.prototype.SendDragDrawRequest=function(){null!=this._webSocket&&(this.SendMousePickRay(),this._webSocket.send(this.SendType.kRequestDragDraw))},g.prototype.SendDragDrawDetermine=function(){null!=this._webSocket&&(this.SendMousePickRay(),this._webSocket.send(this.SendType.kDetermineDragDraw))},g.prototype.SendDragDrawCancel=function(){null!=this._webSocket&&this._webSocket.send(this.SendType.kCancelDragDraw)},g.prototype.SendMousePickRay=function(){this._webSocket},g);function g(e,t){this.SendType={},this._callCount=1,this._webSocket=e,this._msg=t,this.SendType.kCmd=0,this.SendType.kDelete=1,this.SendType.kSelect=2,this.SendType.kOpenFile=3,this.SendType.kGetDemoList=4,this.SendType.kCallJS=5,this.SendType.kAddDragDraw=6,this.SendType.kRequestDragDraw=7,this.SendType.kMousePickRay=8,this.SendType.kDetermineDragDraw=9,this.SendType.kCancelDragDraw=10,this.SendType.kQuitSelect=11,this.SendType.kInit=12,this.SendType.kCmdEx=13,this.SendType.kUserLogin=14,this.SendType.kUndoMark=15}n.MxNetSend=m,(f=d=n.MxNetBinMessageType||(n.MxNetBinMessageType={})).eEntitysData=14,f.kMxCADBlockRef=56,f.kMxCADMemorySections=57,f.kMxCADMemorySectionsFromChange=59,f.kMxCADNotUseMemorySectionsForChage=61,f.kMxCADEntityDisplayDatas=62;var v=(y.prototype.setCurrentDatabaseId=function(e){this._iCurrentDatabaseId=e},y.prototype.getMxDrawObject=function(){return this._mx},y.prototype.getCurrentDatabaseId=function(){return this._iCurrentDatabaseId},y.prototype.isTzDwgStaticFile=function(){return-1!=this._iCurrentDatabaseId},y.prototype.onBinMessage=function(e){var t=this._mx,n=s.inflate(e),r=new DataView(n.buffer),i=r.getInt32(0,!0);this._binMessageCall.has(i)?this._binMessageCall.get(i)(r,this._iCurrentDatabaseId):(-1==this._iCurrentDatabaseId&&(0==i?t.mxWebAddEntity(r):2==i?t.getSelect().mxWebAddEntity(r):6==i?t.removeEntityFromServer(r):11==i&&t.getExtRefManager().createExternalReferences(r)),12==i?t.mxWebAddEntityFor2dPointCurveBuffers(r,this._iCurrentDatabaseId):13==i?t.mxWebAddEntityFor2dPointMeshBuffers(r,this._iCurrentDatabaseId):8==i?t.mxWebAddEntityFor2dPointCurveBuffer(r,this._iCurrentDatabaseId):9==i?t.mxWebAddEntityFor2dPointMeshBuffer(r,this._iCurrentDatabaseId):10==i&&t.mxWebCreateAllBlocks(r,this._iCurrentDatabaseId))},y.prototype.socket_onMessageImp=function(e,t){if(void 0===t&&(t=!1),"string"==typeof e)this._msg.Do(e);else if(t)this.onBinMessage(e);else{var n=new FileReader;n.readAsArrayBuffer(e);var r=this;n.onload=function(e){r._mx.updateDisplay(),r.onBinMessage(n.result)}}this._mx.updateDisplay()},y.prototype.initBinMessage=function(){var e=this._mx;this._binMessageCall.set(d.kMxCADBlockRef,function(t,n){e.getMxCAD().getOpenDisplay().OnMessageDisplayBlockRef(t)}),this._binMessageCall.set(d.kMxCADMemorySections,function(t,n){e.getMxCAD().getOpenDisplay().OnMessageDisplayMemorySections(t)}),this._binMessageCall.set(d.kMxCADMemorySectionsFromChange,function(t,n){e.getMxCAD().getSyncDisplay().OnMessageDisplayMemorySectionsFromChange(t)}),this._binMessageCall.set(d.kMxCADNotUseMemorySectionsForChage,function(t,n){e.getMxCAD().getSyncDisplay().OnMessageDisplayNotUseMemorySectionsForChage(t)}),this._binMessageCall.set(d.kMxCADEntityDisplayDatas,function(t,n){e.getMxCAD().getSelect().OnMessageEntityDisplayDatas(t)}),this._binMessageCall.set(d.eEntitysData,function(t,n){e.mxWebEntitysData(t,n)})},y.prototype.init=function(e,t){var n=this;this._mx=e,this._msg=new h(e,this),this.initBinMessage(),t&&(this._webSocket=new WebSocket(o.MxFun.getMxServer()),this._webSocket.onopen=function(){var e=n._mx.getIniParam();if(0!=e.length){for(var t="{",r=e.length,i=0;i<r;i++)t=0==i?t+'"'+e[i][0]+'":"'+e[i][1]+'"':t+',"'+e[i][0]+'":"'+e[i][1]+'"';t+="}",n._send.Init(t)}},this._webSocket.onmessage=function(e){n.socket_onMessageImp(e.data)}),this._send=new m(this._webSocket,this._msg)},y.prototype.getOnMessage=function(){return this._msg},y.prototype.getSend=function(){return this._send},y.prototype.onStaticMessage=function(e){try{return this.socket_onMessageImp(e,!0),!0}catch(e){return console.log("mx file data error!"),console.log(e),!1}},y.prototype.onStaticHeadMessage=function(e){"string"==typeof e&&this._msg.Do(e)},y);function y(){this._webSocket=null,this._send=null,this._msg=null,this._mx=null,this._binMessageCall=new Map,this._iCurrentDatabaseId=-1}n.MxNet=v;var x=(_.prototype.setShowloading=function(e){this._isShowLoading=e},_.prototype.showLoading=function(){this._isShowLoading&&o.MxFun.showLoading()},_.prototype.hideLoading=function(){this._isShowLoading&&o.MxFun.hideLoading(),this.net.getMxDrawObject().callInitCompleteEvent()},_.prototype.setRequestHeader=function(e){this._requestHeader=e},_.prototype.load=function(e,t){var n=o.MxFun.curPath(),r=o.MxFun.dwgDir(),i=o.MxFun.getStaticServer(),a="/buf/";if("wgh"==e.substring(e.lastIndexOf(".")+1).toLowerCase()){a="/";var s=e.substring(0,e.indexOf(".mxb1.wgh")).split("/");"$"==(e=1==s.length?s[0]:(i=e.substring(0,e.lastIndexOf("/")),s[s.length-1]))[0]&&(e=e.substring(1))}var l="$"+(e=encodeURIComponent(e))+".mxb1.wgh";0!=i.length?n=i+a:0!=r.length?n=n+"/"+r+a:n+=a,this._path=n,this._filename=e,1<(this._staticLoadingOpenFiles=t).length&&(l=t[0],this._path=void 0);var c=this;this.getFile(this._path,l,function(e){"string"==typeof e?c.net.onStaticHeadMessage(e):console.log("mx error h1")},function(){console.log("mx get "+l+" faild")})},_.prototype.getData=function(){if(this._iGet>=this._dataNum)this.hideLoading();else{var e=this._dataType[this._iGet];this._iGet++;var t=this,n=this._iGet+1,r="$"+this._filename+".mxb"+n+".wgh";if(1<this._staticLoadingOpenFiles.length){if(this._iGet>=this._staticLoadingOpenFiles.length)return console.log("Mx staticLoadingOpenFiles error!"),void this.hideLoading();r=this._staticLoadingOpenFiles[this._iGet]}if(0==e)this.getFile(this._path,r,function(e){t.net.onStaticMessage(e)||(console.log(this._path),console.log(r)),t.getData()},function(){t._dataNum=0,t._iGet=0,t.hideLoading(),console.log("mx get "+r+" faild")});else{var i=new XMLHttpRequest,a=r;this._path&&(a=this._path+r),i.open("GET",a),0!=this._requestHeader.length&&i.setRequestHeader("usertoken",this._requestHeader),i.responseType="arraybuffer",i.onload=function(){t.net.onStaticMessage(i.response)||console.log(a),t.getData()},i.addEventListener("error",function(e){t._dataNum=0,t._iGet=0,t.hideLoading(),console.log("mx get "+r+" faild")},!1),i.send()}}},_.prototype.onRenderHead=function(e){var t=JSON.parse(e);this._dataType=t.type,this._dataNum=t.count,this._iGet=0,this.showLoading(),this.getData()},_.prototype.getFile=function(e,t,n,r){var i=new a.FileLoader(this.manager);i.setPath(e),0!=this._requestHeader.length&&(i.requestHeader={usertoken:this._requestHeader}),i.load(t,n,function(){},r)},_);function _(e,t){this.net=null,this.manager=null,this._dataNum=0,this._iGet=0,this._dataType=[],this._path="",this._filename="",this._staticLoadingOpenFiles=[],this._isShowLoading=!0,this._requestHeader="",this.net=e,this.manager=void 0!==t?t:a.DefaultLoadingManager}n.MxHFileLoad=x},{"./MxFun":45,"./MxManager":51,pako:1,three:19}],54:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxSelect=void 0;var r=e("three"),i=e("three.meshline"),a=e("./MxFun"),o=e("./MxNetData"),s=e("./MxMaterial"),l=(c.prototype.removeAll=function(){this._mapSelectMark2Entity=new Map},c.prototype.addEntity=function(e,t){var n=this._mapSelectMark2Entity.get(e);null==n&&(n=new Array,this._mapSelectMark2Entity.set(e,n)),n.push(t)},c.prototype.removeEntity=function(e){var t=new Map,n=function(e,t){var n=this.mx.getScene(),r=t;return function(t,i,o){if(null==e||i!=e)for(var s in t)a.MxFun.removeThreejsObject(t[s],n);else{var l=t.concat();r.set(e,l)}}}.call(this,e,t);this._mapSelectMark2Entity.forEach(n),this._mapSelectMark2Entity=t},c.prototype.init=function(){var e=this;e.domElement.addEventListener("mousedown",function(t){if(!1!==e.enabled&&!e.tmpDisable&&t.button==r.MOUSE.LEFT){var n=e.mx.screenCoord2Doc(t.clientX,t.clientY,0),i=e.mx.screenCoordLong2Doc(10),o=a.MxFun.formatString("[{0},{1},{2},{3}]",n.x.toString(),n.y.toString(),"0",i.toString());e.mx.callCommand("Mx_Select",o)}},!1)},c.prototype.mxWebAddEntity=function(e){var t=new o.MxNetData(e),n=t.getSelectMark();this.removeEntity(n);var r=this.mxWebAddEntity_3DChild(t);this.mxWebAddEntity_Curve(t,r)},c.prototype.mxWebAddEntity_3DChild=function(e){var t=e.getMesh();if(null==t.id)return t.size;var n=new r.Mesh(t.geometry,s.MxMaterial.GetBaseColorMaterial(1));this.mx.getScene().add(n);var i=e.getSelectMark();return this.addEntity(i,n),t.size},c.prototype.mxWebAddEntity_Curve=function(e,t){var n=e.getCurve(t);if(null!=n.id){var a=this.mx.getViewWidth(),o=this.mx.getViewHeight();this._material.resolution=new r.Vector2(a,o);for(var s=e.getSelectMark(),l=n.geometry,c=this.mx.getScene(),u=0;u+1<l.vertices.length;u+=2){var h=l.vertices[u],p=l.vertices[u+1],d=new Float32Array(6);d[0]=h.x,d[1]=h.y,d[2]=h.z,d[3]=p.x,d[4]=p.y,d[5]=p.z;var f=new i.MeshLine;f.setGeometry(d);var m=new r.Mesh(f.geometry,this._material);c.add(m),this.addEntity(s,m)}}},c);function c(e,t){this.enabled=!0,this.tmpDisable=!1,this.mx=void 0,this.domElement=void 0,this._mapSelectMark2Entity=new Map,this._material=new i.MeshLineMaterial({useMap:!1,color:new r.Color(16711680),opacity:.5,resolution:new r.Vector2(500,500),sizeAttenuation:!1,lineWidth:10,transparent:!0}),this.mx=e,this.domElement=void 0!==t?t:document}n.MxSelect=l},{"./MxFun":45,"./MxMaterial":52,"./MxNetData":53,three:19,"three.meshline":18}],55:[function(e,t,n){var r;Object.defineProperty(n,"__esModule",{value:!0}),n.MxShader=void 0,(r=n.MxShader||(n.MxShader={})).VSHADER_COLOR_POINT=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nattribute vec2 position; \nattribute vec3 color; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",r.VSHADER_COLOR_POINT_BYLAYER=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nuniform vec3 color; \nattribute vec2 position; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",r.FSHADER_COLOR_POINT=" precision highp float; \nvarying vec4 vColor; \nvoid main() { \ngl_FragColor = vColor; \n} \n",r.VSHADER_COLOR_POINT_CLIP=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nuniform vec2 clippt1; \nuniform vec2 clippt2; \nuniform float vieww; \nuniform float viewh; \nattribute vec2 position; \nattribute vec3 color; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvarying vec2 vCp1; \nvarying vec2 vCp2; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nvec4 pt1 = projectionMatrix * modelViewMatrix * vec4( clippt1.x,clippt1.y,0.0, 1.0 ); \nvec4 pt2 = projectionMatrix * modelViewMatrix * vec4( clippt2.x,clippt2.y,0.0, 1.0 ); \nvCp1 = vec2(pt1.x * vieww + vieww,pt1.y * viewh + viewh); \nvCp2 = vec2(pt2.x * vieww + vieww,pt2.y * viewh + viewh); \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",r.VSHADER_COLOR_POINT_BYLAYER_CLIP=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nuniform vec3 color; \nuniform vec2 clippt1; \nuniform vec2 clippt2; \nuniform float vieww; \nuniform float viewh; \nattribute vec2 position; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvarying vec2 vCp1; \nvarying vec2 vCp2; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nvec4 pt1 = projectionMatrix * modelViewMatrix * vec4( clippt1.x,clippt1.y,0.0, 1.0 ); \nvec4 pt2 = projectionMatrix * modelViewMatrix * vec4( clippt2.x,clippt2.y,0.0, 1.0 ); \nvCp1 = vec2(pt1.x * vieww + vieww,pt1.y * viewh + viewh); \nvCp2 = vec2(pt2.x * vieww + vieww,pt2.y * viewh + viewh); \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",r.FSHADER_COLOR_POINT_CLIP="precision highp float; \nvarying vec4 vColor; \nvarying vec2 vCp1; \nvarying vec2 vCp2; \nvoid main() { \nif(gl_FragCoord.x > vCp1.x && gl_FragCoord.x < vCp2.x && gl_FragCoord.y > vCp1.y && gl_FragCoord.y < vCp2.y) \ngl_FragColor = vColor; \nelse \ndiscard; \n} \n",r.VSHADER_COLOR_POINT_FORMXCAD=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nuniform vec3 color; \nattribute vec2 position; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",r.FSHADER_COLOR_POINT_FORMXCAD=" precision highp float; \nvarying vec4 vColor; \nvoid main() { \ngl_FragColor = vColor; \n} \n",r.VSHADER_COLOR_POINT_CLIP_FORMXCAD=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nuniform vec3 color; \nuniform vec2 clippt1; \nuniform vec2 clippt2; \nuniform float vieww; \nuniform float viewh; \nattribute vec2 position; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvarying vec2 vCp1; \nvarying vec2 vCp2; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nvec4 pt1 = projectionMatrix * modelViewMatrix * vec4( clippt1.x,clippt1.y,0.0, 1.0 ); \nvec4 pt2 = projectionMatrix * modelViewMatrix * vec4( clippt2.x,clippt2.y,0.0, 1.0 ); \nvCp1 = vec2(pt1.x * vieww + vieww,pt1.y * viewh + viewh); \nvCp2 = vec2(pt2.x * vieww + vieww,pt2.y * viewh + viewh); \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",r.FSHADER_COLOR_POINT_CLIP_FORMXCAD="precision highp float; \nvarying vec4 vColor; \nvarying vec2 vCp1; \nvarying vec2 vCp2; \nvoid main() { \nif(gl_FragCoord.x > vCp1.x && gl_FragCoord.x < vCp2.x && gl_FragCoord.y > vCp1.y && gl_FragCoord.y < vCp2.y) \ngl_FragColor = vColor; \nelse \ndiscard; \n} \n"},{}],56:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxString=void 0;var r=(i.prototype.Find=function(e){return this.m_val.indexOf(e)},i.prototype.Left=function(e){return this.m_val.substring(0,e)},i.prototype.Right=function(e){return this.m_val.substring(e+1,this.m_val.length)},i.prototype.TrimLeft=function(e){for(;0<this.m_val.length&&this.m_val[0]==e;)this.m_val=this.m_val.slice(1)},i.prototype.TrimRight=function(e){for(;0<this.m_val.length&&this.m_val[this.m_val.length-1]==e;)this.m_val=this.m_val.slice(0,-1)},i.prototype.AnalyzeString=function(e){return this.m_val.split(e)},i.prototype.IsEmpty=function(){return 0==this.m_val.length},i.prototype.MakeUpper=function(){this.m_val=this.m_val.toUpperCase()},i.prototype.MakeLower=function(){this.m_val=this.m_val.toLowerCase()},i.prototype.GetLength=function(){return this.m_val.length},i);function i(e){this.m_val="",null!=e&&(this.m_val=e)}n.MxString=r},{}],57:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxSystemVariable=void 0;var r=e("three"),i=e("./McEdJigOsnap"),a=(o.prototype.init=function(e){this.m_mxObj=e},o.prototype.getAllLinetypeName=function(){return this.m_vecLinetype},o.prototype.getSysVarBool=function(e){return null!=this.m_data[e]&&this.m_data[e]},o.prototype.setSysVarBool=function(e,t){this.m_data[e]=t},o.prototype.setSysVarPoint=function(e,t){this.m_data[e]=t},o.prototype.OnMessageMxCADSystemVariable=function(e){this.m_vecLinetype=[];var t=JSON.parse(e);if(null!=t){var n=t.vecLinetypeName;for(var r in n)this.m_vecLinetype.push(n[r]);this.m_data.CELTYPE=t.curLinetypeName,this.m_data.CLAYER=t.clayer,this.m_data.CECOLOR=t.cecolor,this.m_data.CECOLORINDEX=t.cecolorindex}this.m_mxObj.callEvent("loadSystmeVariableComplete")},o.prototype.getSysVarPoint=function(e){return null==this.m_data[e]?new r.Vector3(0,0,0):this.m_data[e]},o.prototype.setSysVarNumber=function(e,t){this.m_data[e]=t},o.prototype.getSysVarNumber=function(e){return null==this.m_data[e]?0:this.m_data[e]},o);function o(){this.m_data={},this.m_mxObj=null,this.m_vecLinetype=[],this.m_data.DYNINPUT=!0,this.m_data.GETPOINTSTATUS=0,this.m_data.CELTYPE="Continuous",this.m_data.CLAYER="0",this.m_data.CECOLOR=67108863,this.m_data.CECOLORINDEX=7,this.m_data.OSMODE=i.MxOsnapDefine.OsModeAll}n.MxSystemVariable=a},{"./McEdJigOsnap":20,three:19}],58:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxThreeJS=void 0;var r,i=e("three"),a=e("./MxFun");(r=n.MxThreeJS||(n.MxThreeJS={})).createLine=function(e,t,n,r){var a,o=new i.Geometry;return a=r&&1!=r||0==r?new i.LineBasicMaterial({color:n,transparent:!0,depthTest:!1,opacity:r}):new i.LineBasicMaterial({color:n,transparent:!0,depthTest:!1}),o.vertices.push(e,t),new i.Line(o,a)},r.createCircle=function(e,t,n){var r=new i.CircleGeometry(t,64,3,2*Math.PI),a=new i.LineBasicMaterial({color:n,transparent:!0,depthTest:!1});r.vertices.shift();var o=new i.LineLoop(r,a);return o.position.x=e.x,o.position.y=e.y,o.position.z=e.z,o},r.creatTextSprite=function(e,t,n,r,o){t.z||(t.z=0);var s,l,c=document.createElement("canvas"),u=c.getContext("2d"),h=a.MxFun.formatString("normal {0}px Arial","256");if(null==u)return null;u.font=h,s=2*(l=u.measureText(e).width,Math.pow(2,Math.floor(Math.log(l)/Math.LN2))),c.width=s,c.height=256,u.font=h,u.textAlign="center",u.textBaseline="middle";var p=a.MxFun.formatString("rgba({0}, {1}, {2}, 1.0)",(o>>16&255)+"",(o>>8&255)+"",(255&o)+"");u.fillStyle=p,u.fillText(e,s/2,128);var d=new i.Texture(c);d.needsUpdate=!0;var f=new i.SpriteMaterial({transparent:!0,depthTest:!1,map:d});f.rotation=r;var m=new i.Sprite(f);return m.scale.set(s/256*n,n,1),m.position.set(t.x,t.y,t.z),m},r.createTriangle=function(e,t,n){if(!(e.length<3)){for(var r=e.length,a=new i.Geometry,o=0;o+2<r;o+=3){a.vertices.push(e[o]),a.vertices.push(e[o+1]),a.vertices.push(e[o+2]);var s=new i.Face3(o,o+1,o+2);a.faces.push(s)}a.computeFaceNormals(),a.computeVertexNormals(),null==n&&(n=1);var l=new i.MeshBasicMaterial({color:t,transparent:!0,depthTest:!1,side:i.DoubleSide,opacity:n});return new i.Mesh(a,l)}},r.createLines=function(e,t,n){var r,a=new i.Geometry;return a.vertices=e,r=n&&1!=n||0==n?new i.LineBasicMaterial({color:t,transparent:!0,depthTest:!1,opacity:n}):new i.LineBasicMaterial({color:t,transparent:!0,depthTest:!1}),new i.Line(a,r)},r.createDashedLines=function(e,t,n,r){var a=new i.Geometry;a.vertices=e;var o=new i.Line(a,new i.LineDashedMaterial({color:t,dashSize:n,gapSize:r,transparent:!0,depthTest:!1}));return o.computeLineDistances(),o}},{"./MxFun":45,three:19}],59:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxPair=n.MxTools=void 0;var r,i=e("three");(r=n.MxTools||(n.MxTools={})).AsMxWebPoint=function(e,t,n){return new i.Vector3(-e,n,t)},r.AsMxWebPoint_pt=function(e){return new i.Vector3(-e.x,e.z,e.y)},r.AsThreeJsPoint=function(e,t,n){return new i.Vector3(-e,n,t)},r.stringTrimLeftSpace=function(e){return e.replace(/^\s*/g,"")},r.stringDeleteAllSpace=function(e){return e.replace(/\s*/g,"")},r.stringTrimLeftRightSpace=function(e){return e.replace(/^\s*|\s*$/g,"")},r.stringTrimRightSpace=function(e){return e.replace(/(\s*$)/g,"")},r.IsNumerical=function(e){if("string"==typeof e){var t=/^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/;return!(!/^\d+(\.\d+)?$/.test(e)&&!t.test(e))}var n=e.m_val;return t=/^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/,!(!/^\d+(\.\d+)?$/.test(n)&&!t.test(n))},r.formatString=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r++)e=e.replace("{".concat(r,"}"),t[r]);return e},r._tstof=function(e){return parseFloat(e)},r._tstoi=function(e){return parseInt(e)},r.IsZero=function(e){return-1e-7<e&&e<1e-7},r.MillimeterToPixels=function(e){return 10*e},r.getXYPlanDistance=function(e,t){var n=new i.Vector2(e.x,e.y),r=new i.Vector2(t.x,t.y);return n.distanceTo(r)},r.MxASSERT=function(e,t){e||console.log("MxASSERT(0):"+t)},n.MxPair=function(e,t){this.first=e,this.second=t}},{three:19}],60:[function(e,t,n){var r,i,a;Object.defineProperty(n,"__esModule",{value:!0}),n.MxType=void 0,(i=(r=n.MxType||(n.MxType={})).CommandFlags||(r.CommandFlags={}))[i.MCRX_CMD_MODAL=0]="MCRX_CMD_MODAL",i[i.MCRX_CMD_TRANSPARENT=1]="MCRX_CMD_TRANSPARENT",i[i.MCRX_CMD_NO_UNDO_MARKER=2]="MCRX_CMD_NO_UNDO_MARKER",i[i.MCRX_CMD_NOPRV=4]="MCRX_CMD_NOPRV",(a=r.MxCloneType||(r.MxCloneType={}))[a.kClone=1]="kClone",a[a.kDragClone=2]="kDragClone",a[a.kMxFileClone=3]="kMxFileClone"},{}],61:[function(require,module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.MxUiObject=exports.MxToolBarItem=exports.MxMenuItem=void 0;var MxFun_1=require("./MxFun"),MxMenuItem=function(){this.id=-1,this.text="",this.evalString="",this.parentId=-1};exports.MxMenuItem=MxMenuItem;var MxToolBarItem=function(){this.isMxCommand=!1,this.itemid=""};exports.MxToolBarItem=MxToolBarItem;var MxUiObject=function(){function MxUiObject(){this.vecMenuItem=new Array,this.vecToolBarItem=new Array,this.uiPath="./ui",this.idMenuItemCount=100,this.isShowTitle=!1,this.isShowStructTree=!1,this.isEnableLoading=!0,this.isShowLayer=!1,this.isShowTakeColor=!1,this.isShowLayout=!1,this.isEnableObjectProperty=!1,this.isShowToolbar=!1,this.isShowMainMenu=!1,this.sTitle=""}return MxUiObject.prototype.SetLayoutData=function(e){this.vecLayoutData=e},MxUiObject.prototype.CallMxCommand=function(e){MxFun_1.MxFun.callCommand(e,"")},MxUiObject.prototype.EvalJs=function(value){eval(value)},MxUiObject.prototype.SetLayerData=function(e){this.vecLayerData=e},MxUiObject.prototype.SetSketchLayerData=function(e){this.vecSketchLayerData=e},MxUiObject.prototype.init=function(){this.onInit()},MxUiObject.prototype.addMenuItem=function(e,t,n,r){void 0===t&&(t=""),void 0===n&&(n=-1),void 0===r&&(r=-1);var i=new MxMenuItem;i.text=e,i.evalString=t,-1==r&&(r=this.idMenuItemCount,this.idMenuItemCount++),i.id=r,i.parentId=n,this.vecMenuItem.push(i)},MxUiObject.prototype.addToolBarItem=function(e,t,n,r,i){void 0===t&&(t=""),void 0===n&&(n=""),void 0===r&&(r=!1),void 0===i&&(i="");var a=new MxToolBarItem;a.image=e,a.evalString=n,a.text=t,a.isMxCommand=r,a.itemid=i,this.vecToolBarItem.push(a)},MxUiObject.prototype.setPath=function(e){this.uiPath=e},MxUiObject.prototype.getPath=function(){return this.uiPath},MxUiObject.prototype.create=function(){this.onCreate()},MxUiObject.prototype.writeUICSS=function(){var e=this.uiPath;MxFun_1.MxFun.isPC()?(document.write("<link rel='stylesheet' href='"+e+"/css/mxbimpcm.css'>"),this.isShowMainMenu&&(document.write("<link rel='stylesheet' href='"+e+"/css/rightfacefonts2.css'>"),document.write("<link rel='stylesheet' href='"+e+"/css/rightmnu.css'>"),document.write("<script type='text/javascript' src='"+e+"/hc-mobile-nav.js'><\/script>"))):(document.write("<link rel='stylesheet' href='"+e+"/css/mxmobile.css'>"),this.isShowMainMenu&&(document.write("<link href='"+e+"/css/font-awesome.min.css' rel='stylesheet'>"),document.write("<link rel='stylesheet' href='"+e+"/css/rightfacefonts1.css'>"),document.write("<link rel='stylesheet' href='"+e+"/css/rightfacefonts2.css'>"),document.write("<link rel='stylesheet' href='"+e+"/css/rightmnu.css'>"),document.write("<script type='text/javascript' src='"+e+"/hc-mobile-nav.js'><\/script>")))},MxUiObject}();exports.MxUiObject=MxUiObject},{"./MxFun":45}],62:[function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxUiObjectMobile=void 0;var a,o=e("./MxUiObject"),s=e("./MxFun"),l=(i(c,a=o.MxUiObject),c.prototype.onCreate=function(){this.isShowTitle&&this.WriteTitle(),this.WriteStructTree(),this.isEnableLoading&&this.WriteLoading(),this.WriteLayer(),this.WriteTakeColor(),this.WriteLayout(),this.isEnableObjectProperty&&this.WriteObjectProperty(),this.isShowToolbar&&this.WriteToolbar()},c.prototype.onInit=function(){this.InitEvent()},c.prototype.ShowLoading=function(){this.isEnableLoading&&($(".Prompt").css("background","rgba(0, 0, 0, 0)"),$(".Prompt").fadeIn(100),$(".Prompt span").css("display","none"))},c.prototype.HideLoading=function(){this.isEnableLoading&&($(".Prompt").css("background","rgba(0, 0, 0, 0.8)"),$(".Prompt div").fadeOut(100),$(".Prompt span").fadeIn(200),setTimeout(function(){$(".Prompt").fadeOut(1e3)},1e3))},c.prototype.ShowObjectProperty=function(e){if(0!=e.length){var t;t="string"==typeof e?JSON.parse(e):e;var n="";for(var r in t){var i=t[r];for(var a in n+='<tbody class="bf-group undefined bf-collapse">',n+='<tr class="bf-group-title">',n+='<td colspan="2"><i class="bf-icon" style=" padding: 12px;"></i>'+i.name+"</td>",n+="</tr>",i.datas){var o=i.datas[a];n+="<tr class='bf-group-content'>",n+="<td class='bf-key'>"+o.name+"</td>",n+="<td class='bf-value'>"+o.value+"</td>",n+="</tr>"}n+="</tbody>"}document.getElementById("ComponentContent").innerHTML=n,$(".bf-group").click(function(){$(this).hasClass("bf-collapse")?$(this).removeClass("bf-collapse"):$(this).addClass("bf-collapse")})}},c.prototype.HideObjectProp=function(){},c.prototype.SwitchShowLayer=function(){var e=document.getElementById("LayerInterface");"none"==e.style.display?(e.style.display="block",e.style.left="80px",e.style.top="50px"):e.style.display="none"},c.prototype.SwitchShowStructTree=function(){},c.prototype.Chosecolor=function(){document.getElementById("color-picker").click()},c.prototype.ColorChange=function(e){document.getElementById("colorbox").style.backgroundColor=e,s.MxFun.setCurrentColor(e)},c.prototype.SwitchShowLayout=function(){var e=document.getElementById("LayerOutInterface");"none"==e.style.display?e.style.display="block":e.style.display="none"},c.prototype.WriteTitle=function(){var e=this.uiPath;document.write("<div class='bar1'>"),document.write("<img src='"+e+"/image/mxcad.png' style='height: 50%;position: absolute;top: 12px;left: 10px;'>"),document.write("<span class='barspan' style='position: absolute;left: 45px;'>"),document.write("</span>"),document.write("<div id='container'>"),this.isShowMainMenu&&(document.write("<header>"),document.write("<div class='wrapper cf'style='z-index: 999'>"),document.write("<nav id='main-nav' >"),document.write("</nav>"),document.write("<a class='toggle'>"),document.write("<span></span>"),document.write("</a>"),document.write("</div>"),document.write("</header>")),document.write("</div>"),document.write("</div>")},c.prototype.WriteToolbar=function(){document.write("<div id='MainMenuContent' class='bf-toolbar bf-toolbar-bottom'>"),document.write("</div>")},c.prototype.WriteLoading=function(){var e=this.uiPath;document.write("<div class='Prompt' style='width: 100px;height:30px;position:"),document.write("absolute;top: 60px;left: 50%;margin-left: -50px;color: #fff;text-align: center;'>"),document.write("<div style='text-align: center;'>"),document.write("<img src='"+e+"/image/loading.gif' alt='' style='width:30px;height:30px;float: left'>"),document.write("<p style='color:black;vertical-align: middle;float: left; margin-top: 5px;margin-left: 5px;'>加载中.....</p>"),document.write("</div>"),document.write("<span style='vertical-align: middle;display: none'>图纸加载完毕</span>"),document.write("</div>")},c.prototype.WriteLayer=function(){var e=this.uiPath;this.isShowLayer&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' title='ModelTree' style='position: absolute; top:111px;left: 0px;' onclick='uiObj.SwitchShowLayer()'>"),document.write("<div class='bf-button mxbim-bf-tree' title='图层'>"),document.write("<img src='"+e+"/image/layer.png.gif' alt='' style='width: 24px;'>"),document.write("</div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable' id='LayerInterface' title='图层'"),document.write("style='left: 0px;"),document.write("top: 0px;"),document.write("width: 100%;"),document.write("height: 100%;"),document.write("display: none;'>"),document.write("<div class='bf-close' onclick='uiObj.SwitchShowLayer()' style='text-align: center;'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' style='cursor: move; user-select: none;'>图层</div>"),document.write("<div>"),document.write("<div class='layer-title' style='width: 12.5%;'>可见</div>"),document.write("<div class='layer-title' style='width: 12.5%;'>颜色</div>"),document.write("<div class='layer-title' style='width: 62.5%'>名字</div>"),document.write("<div class='layer-title' style='width: 12.5%'>状态</div>"),document.write("</div>"),document.write("<div id='Layer-Info' style='margin-top: 26px;height: 79%;width: 100%; position: absolute;overflow-y: auto;'>"),document.write("</div>"),document.write("</div>")},c.prototype.WriteStructTree=function(){this.isShowStructTree&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='Fmj' title='ModelTree'"),document.write("style='position: absolute; top:60px;left: 0px;' onclick='uiObj.SwitchShowStructTree()'>"),document.write("<div class='bf-button mxbim-bf-tree' title='构件树'><i class='fa fa-sitemap' aria-hidden='true' style='font-size: 24px;'></i></div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable tree-panel' id='dv' title='目录树' style='left: 0px; top: 0px; width: 100%; height: 100%; display: none;'>"),document.write("<div class='bf-close' onclick='uiObj.SwitchShowStructTree()'><i class='fa fa-times fa-2x' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' style='cursor: move; user-select: none;'>目录树</div>"),document.write("<div class='bf-panel-body' style='padding-top: 57px;overflow-y: scroll;'>"),document.write("<div class='bf-panel-header'>"),document.write("<div class='bf-panel-header'>"),document.write("<div class='bf-tree-header' style='margin-top: -57px;'>"),document.write("<div class='bf-tabs bf-tabs-tree'>"),document.write("<ul class='bf-tabs-list'>"),document.write("<li class='bf-tabs-option my-option undefined active' id='component'>构件</li>"),document.write("<li class='bf-tabs-option my-option undefined' id='area'>空间</li>"),document.write("<li class='bf-tabs-option my-option undefined' id='drawing'>图纸</li>"),document.write("</ul>"),document.write("</div>"),document.write("</div>"),document.write("</div>"),document.write("</div>"),document.write("<div class='' style='margin-bottom: 100px;' id='DirectoryContent'>"),document.write("</div>"),document.write("</div>"),document.write("</div>")},c.prototype.WriteTakeColor=function(){var e=this.uiPath;this.isShowTakeColor&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='TakeColor'"),document.write("style='position: absolute;left: 0px; top: 162px;width: 45px; '>"),document.write("<div class='bf-button' onclick='uiObj.Chosecolor()' style='opacity: 1;width: 45px;'>"),document.write("<div style='position: relative;margin-left: 10px;margin-top: -5px;'>"),document.write("<img src='"+e+"/image/color.png' alt='' style='width: 40px;margin-left: -21px;'>"),document.write("</div>"),document.write("<div id='colorbox' style='width: 30px;height: 5px;background-color: #cccccc;margin-left: -3px;margin-top: -5px;'>"),document.write("</div>"),document.write("<div style='width: 18px;height: 40px;float: right;margin-top: -38px;margin-left: 14px;position: absolute;'>"),document.write("<img src='"+e+"/image/daojiao.png' alt='' style='width: 15px;margin-top: 10px;z-index: 999;position: relative'>"),document.write("<input id='color-picker' type='color' value='#c0c0c0' style='display: none' onchange='colorChange(value)'>"),document.write("</div>"),document.write("</div>"),document.write("</div>"))},c.prototype.WriteLayout=function(){var e=this.uiPath;this.isShowLayout&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='LayerOut'"),document.write("style='position: absolute;left: 0px; top: 213px; ' onclick='uiObj.SwitchShowLayout()'>"),document.write("<div class='bf-button'>"),document.write("<img src='"+e+"/image/layout.png' alt='' style='width: 24px;'>"),document.write("</div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable' id='LayerOutInterface'"),document.write("style='left: 0; top: 0; width: 100%;display:none'>"),document.write("<div class='bf-close' onclick='uiObj.SwitchShowLayout()'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' id='buju' style='cursor: move; user-select: none;'>布局</div>"),document.write("<div>"),document.write("</div>"),document.write("<div id=''>"),document.write("<div>"),document.write("<table class='bf-table'>"),document.write("<tbody class='bf-group'>"),document.write("<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>"),document.write("<td class='bf_layerout_td' style='width: 60px' >"),document.write("<div class='bf_layer_div layer_on'></div>"),document.write("</td>"),document.write("<td style='width: 238px' >"),document.write("<span style='color: white;cursor: pointer;'>LayerOut</span>"),document.write("</td>"),document.write("</tr>"),document.write("<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>"),document.write("<td class='bf_layerout_td' style='width: 60px' >"),document.write("<div class='bf_layer_div' ></div>"),document.write("</td>"),document.write("<td style='width: 238px' >"),document.write("<span style='color: white;cursor: pointer;'>LayerOut</span>"),document.write("</td>"),document.write("</tr>"),document.write("<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>"),document.write("<td class='bf_layerout_td' style='width: 60px' >"),document.write("<div class='bf_layer_div' ></div>"),document.write("</td>"),document.write("<td style='width: 238px' >"),document.write("<span style='color: white;cursor: pointer;'>LayerOut</span>"),document.write("</td>"),document.write("</tr>"),document.write("<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>"),document.write("<td class='bf_layerout_td' style='width: 60px' >"),document.write("<div class='bf_layer_div'></div>"),document.write("</td>"),document.write("<td style='width: 238px' >"),document.write("<span style='color: white;cursor: pointer;'>LayerOut</span>"),document.write("</td>"),document.write("</tr>"),document.write("</tbody>"),document.write("</table>"),document.write("</div>"),document.write("</div>"),document.write("</div>")},c.prototype.WriteObjectProperty=function(){document.write("<div class='bf-panel bf-has-title bf-sizable property-panel' id='fmj2' title='构件详情' style='left: 0px; top: 0px; width: 100%; height: 100%;display: none;'>"),document.write("<div class='bf-close' id='close2' style='top:4.0em;'><i class='fa fa-times fa-2x' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' style='cursor: move; user-select: none;'>构件详情</div>"),document.write("<div class='bf-panel-body' style='padding-top: 41px;'>"),document.write("<div class='bf-panel-container bf-scroll-bar' style='top:0;width: 100%;height: 100%;overflow-y: auto;position: relative;'>"),document.write("<table class='bf-table' id='ComponentContent'>"),document.write("</table>"),document.write("</div>"),document.write("</div>"),document.write("</div>")},c.prototype.UpDisplayLayout=function(){},c.prototype.UpDisplayLayer=function(){var e=this.uiPath,t=this.vecLayerData,n=this.vecSketchLayerData,r="";if(null!=n){var i=n;for(var a in i){r+="<div>";var o="hide.png";0==i[a].off&&(o="show.png");var s="unlock.png";r+="<table class='bf-table'>",r+="<tbody class='bf-group'>",r+="<tr class='bf-group-title'>",r+='<td><img class="layer-enable" sketch=1 id='+i[a].id+' src="'+e+"/image/"+o+'"/></td>',r+='<td><span class="layer-color" style="background-color:'+i[a].color+'"></span></td>',r+='<td><span class="layer-text">草图_'+i[a].name+"</span></td>",r+='<td><img class="layer-state" src="'+e+"/image/"+s+'"/></td>',r+="</tr>",r+="</tbody>",r+="</table>",r+="</div>"}}if(null!=t)for(var a in i=t)r+="<div>",o="hide.png",0==i[a].off&&(o="show.png"),s="lock.png",r+="<table class='bf-table'>",r+="<tbody class='bf-group'>",r+="<tr class='bf-group-title'>",r+='<td><img class="layer-enable" sketch=0 id='+i[a].id+' src="'+e+"/image/"+o+'"/></td>',r+='<td><span class="layer-color" style="background-color:'+i[a].color+'"></span></td>',r+='<td><span class="layer-text">'+i[a].name+"</span></td>",r+='<td><img class="layer-state" src="'+e+"/image/"+s+'"/></td>',r+="</tr>",r+="</tbody>",r+="</table>",r+="</div>";var l=document.getElementById("Layer-Info");null!=l&&(l.innerHTML=r)},c.prototype.WriteFooter=function(){document.write("<div class='footer' style='background: rgba(0, 0, 0, 0.7);min-width: auto;position: fixed;left: 0;bottom: 0;width: 100%;'>"),document.write("<div style='line-height: 40px;font-size: 12px;color: #999;padding: 0 10px;'>"),document.write("<p style='float: right;line-height: 15px;font-size: 12px;color: #999;display: block;'>"),document.write("<a style='color: #4a90e2;text-decoration: none;outline: none;' href='http://www.mxdraw.com/' target='_blank'>梦想CAD</a>旗下产品"),document.write("</p>"),document.write("<a style='color: #4a90e2;text-decoration: none;outline: none;' href='http://www.mxdraw.com' target='_blank'>MX3D</a> 蜀ICP备15011727号"),document.write("</div>"),document.write("</div>")},c.prototype.CreateToolBar=function(e){if(this.isShowToolbar){var t="";for(var n in e){var r=e[n],i="uiObj.CallMxCommand";r.isMxCommand||(i="uiObj.EvalJs"),0<r.itemid.length?t+='<div class="bf-button" onclick="'+i+"('"+e[n].evalString+'\')"><img class="mainimage-bf-butto" id="'+r.itemid+'" src="'+this.uiPath+"\\image\\"+r.image+'" title="'+e[n].text+'"></div>':t+='<div class="bf-button" onclick="'+i+"('"+e[n].evalString+'\')"><img class="mainimage-bf-butto" src="'+this.uiPath+"\\image\\"+r.image+'" title="'+e[n].text+'"></div>'}document.getElementById("MainMenuContent").innerHTML=t}},c.prototype.InitEvent=function(){var e=document.getElementById("LayerInterface");this.CreateToolBar(this.vecToolBarItem),e.style.display="none";var t=this.vecMenuItem;this.isShowMainMenu&&function(e){var n="";!function e(t,r){var i=function(e,t){var n=new Array;for(var r in t)t[r].parentId==e&&n.push(t[r]);return n}(t,r);if(0<i.length){for(var a in n+="<ul>",i)0!=i[a].evalString.length?(n+='<li><p class="li_option" ',n+="onclick=\"uiObj.EvalJs('"+i[a].evalString+"')\"",n+=">"+i[a].text+"</p>"):(n+="<li><a ",n+=">"+i[a].text+"</a>"),e(i[a].id,r),n+="</li>";n+="</br>",n+="</br>",n+="</br>",n+="</ul>"}}(-1,t),e("#main-nav").append(n);var r=e("#main-nav"),i=e(".toggle"),a={maxWidth:!1,customToggle:i,levelTitles:!0},o=null,s={};o&&o.remove(),i.off("click"),o=r.clone(),e.extend(s,{side:"right"}),o.hcMobileNav(e.extend({},a,s))}(jQuery);var n=window.location.href,r=n.length,i=n.indexOf("?"),a=n.substr(i,r).split("=")[1];$(".barspan").html(decodeURIComponent(a)),$("#close2").click(function(){$(this).parent("div").fadeOut(200)}),$(".bf-select-current").click(function(){$(this).hasClass("bf-open")?$(this).removeClass("bf-open"):$(this).addClass("bf-open")}),$(".my-option").click(function(){var e=$(this);$(".my-option").each(function(){$(this).removeClass("active")}),e.addClass("active")}),$(".bf-select-option").click(function(){$(this).parent("ul").prev("span").html($(this).text()),$(this).parent("ul").prev("span").removeClass("bf-open")}),$(document).on("click",".layer-enable",function(){var e=s.MxFun.getUiObj().getPath(),t=parseInt($(this).attr("id")),n=parseInt($(this).attr("sketch")),r=!0;$(this).attr("src")==e+"/image/show.png"?($(this).attr("src",e+"/image/hide.png"),r=!1):$(this).attr("src",e+"/image/show.png"),s.MxFun.showLayer(t,r,1==n)})},c.prototype.Fullscreen=function(){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen&&e.webkitRequestFullScreen(),document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),this.IsFullStatus()?($("img[title='取消全屏']").attr("src",this.uiPath+"/image\\fullscreen1.gif"),$("img[title='取消全屏']").attr("title","全屏")):($("img[title='全屏']").attr("src",this.uiPath+"/image\\escscreen1.gif"),$("img[title='全屏']").attr("title","取消全屏"))},c.prototype.IsFullStatus=function(){return null!=(document.fullscreenEnabled||document.mozFullscreenElement||document.webkitFullscreenElement)},c);function c(){return null!==a&&a.apply(this,arguments)||this}n.MxUiObjectMobile=l},{"./MxFun":45,"./MxUiObject":61}],63:[function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxUiObjectPC=void 0;var a,o=e("./MxUiObject"),s=e("./MxFun"),l=(i(c,a=o.MxUiObject),c.prototype.onCreate=function(){this.isShowTitle&&this.WriteTitle(),this.WriteStructTree(),this.isEnableLoading&&this.WriteLoading(),this.WriteLayer(),this.WriteTakeColor(),this.WriteLayout(),this.isEnableObjectProperty&&this.WriteObjectProperty(),this.isShowToolbar&&this.WriteToolbar()},c.prototype.onInit=function(){this.InitEvent()},c.prototype.WriteTitle=function(){var e=this.uiPath;document.write("<div id='all'>"),document.write(" <div class='bar1'>"),document.write(" <img src="+e+"/image/mxcad.png style='height: 50%;position: absolute;top: 12px;left: 10px;'>"),document.write(" <span class='barspan' style='position: absolute;left: 45px;'>"),document.write(" </span>"),document.write(" <div id='container'>"),this.isShowMainMenu&&(document.write(" <header>"),document.write(" <div class='wrapper cf'style='z-index: 999'>"),document.write(" <nav id='main-nav' >"),document.write(" </nav>"),document.write(" <a class='toggle'>"),document.write(" <span></span>"),document.write(" </a>"),document.write(" </div>"),document.write(" </header>")),document.write(" </div>"),document.write(" </div>")},c.prototype.WriteStructTree=function(){this.isShowStructTree&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='ModelTreeThumbnail' title='目录树'"),document.write("style='position: absolute;left: 10px; top: 97px; ' onclick='uiObj.SwitchShowStructTree()'>"),document.write("<div class='bf-button mxbim-bf-tree' title='目录树'><i class='fa fa-sitemap' aria-hidden='true'></i></div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable' id='ModelTreeInterface' title='目录树'"),document.write("style='left:0px; top: 0px; width: 300px; height: 416px;display: none'>"),document.write(" <div class='bf-close' onclick='uiObj.SwitchShowStructTree()'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' style='cursor: move; user-select: none;' id='mulushu'>目录树</div>"),document.write("<div class='bf-panel-body' style='padding-top: 36px;'>"),document.write("<div class='bf-panel-header'>"),document.write("<div class='bf-tree-header' style='margin-top: -36px;'>"),document.write("<div class='bf-select bf-select-tree'>"),document.write("<span class='bf-select-current'>构件</span>"),document.write("<ul class='bf-select-list'>"),document.write("<li class='bf-select-option' id='type'>构件</li>"),document.write("<li class='bf-select-option' id='file'>文件</li>"),document.write("<li class='bf-select-option' id='area'>空间</li>"),document.write("<li class='bf-select-option' id='drawing'>图纸</li>"),document.write("</ul>"),document.write("</div>"),document.write("</div>"),document.write("</div>"),document.write("<div id='DirectoryContent' class='bf-panel-container TreeInfo'>"),document.write("</div>"),document.write("</div>"),document.write("</div>")},c.prototype.WriteLoading=function(){var e=this.uiPath;document.write("<div class='Prompt'>"),document.write("<div style='text-align: center;'>"),document.write("<img src='"+e+"/image/loading.gif' alt='' style='width:30px;height:30px;float: left'>"),document.write("<p style='color:black;vertical-align: middle;float: left; margin-top: 5px;margin-left: 5px;'>加载中.....</p>"),document.write("</div>"),document.write("<span style='display: none'>提示:打开图纸完成</span>"),document.write("</div>")},c.prototype.WriteLayer=function(){var e=this.uiPath;this.isShowLayer&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='LayerThumbnail' title='图层'"),document.write("style='position: absolute;left: 10px; top: 45px; ' onclick='uiObj.SwitchShowLayer()'>"),document.write("<div class='bf-button'>"),document.write("<img src='"+e+"/image/layer.png.gif' alt='' style='width: 32px;'>"),document.write("</div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable' id='LayerInterface'"),document.write("style='left: 10px; top: 50px; width: 300px; height: 416px;display: none'>"),document.write("<div class='bf-close' onclick='uiObj.SwitchShowLayer(false)'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' id='tuceng' style='cursor: move; user-select: none;'>图层</div>"),document.write("<div>"),document.write("<div class='layer-title' style='width: 50px;font-size: 14px'>可见</div>"),document.write("<div class='layer-title' style='width: 50px;font-size: 14px'>颜色</div>"),document.write("<div class='layer-title' style='width: 148px;font-size: 14px'>名字</div>"),document.write("<div class='layer-title' style='width: 50px;font-size: 14px'>状态</div>"),document.write("</div>"),document.write("<div id='Layer-Info' style='margin-top: 25px;height: 349px;position: absolute;overflow-y: auto;'>"),document.write("</div>"),document.write("</div>")},c.prototype.WriteTakeColor=function(){var e=this.uiPath;this.isShowTakeColor&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='TakeColor' title='选择颜色'"),document.write("style='position: absolute;left: 10px; top: 149px; '>"),document.write("<div class='bf-button' onclick='uiObj.Chosecolor()' style='opacity: 1;'>"),document.write("<img src='"+e+"/image/color.png' alt='' style='width: 40px;margin-left: -10px;'>"),document.write("<div id='colorbox' style='width: 35px;height: 5px;background-color: #cccccc;margin-left: -3px'>"),document.write("</div>"),document.write("<div style='width: 18px;height: 40px;float: right;margin-top: -42px;margin-left: 14px;'>"),document.write("<img src='"+e+"/image/daojiao.png' alt='' style='width: 15px;margin-top: 10px;z-index: 999;position: relative'>"),document.write("<input id='color-picker' type='color' value='#c0c0c0' style='display: none' onchange='uiObj.ColorChange(value)'>"),document.write("</div>"),document.write("</div>"),document.write("</div>"))},c.prototype.WriteLayout=function(){var e=this.uiPath;this.isShowLayout&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='LayerOut' title='布局'"),document.write("style='position: absolute;left: 10px; top: 97px; ' onclick='uiObj.SwitchShowLayout()'>"),document.write("<div class='bf-button'>"),document.write("<img src='"+e+"/image/layout.png' alt='' style='width: 32px;'>"),document.write("</div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable' id='LayerOutInterface'"),document.write("style='left: 10px; top: 50px; width: 300px;display:none'>"),document.write("<div class='bf-close' onclick='uiObj.SwitchShowLayout()'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' id='buju' style='cursor: move; user-select: none;'>布局</div>"),document.write("<div>"),document.write("</div>"),document.write("<div id='layout-Info'>"),document.write("</div>"),document.write("</div>")},c.prototype.WriteObjectProperty=function(){document.write("<div class='bf-panel bf-has-title bf-sizable' id='StrcutInfoBase' title='属性'"),document.write("style='right: 10px; top: 45px; width: 300px; height: 416px;display: none'>"),document.write("<div class='bf-close' id='close2'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' style='cursor: move; user-select: none;'>属性</div>"),document.write("<div id='ComponentContent' class='bf-panel-body StructInfo'></div>"),document.write("<div class='bf-resize'></div>"),document.write("</div>")},c.prototype.WriteToolbar=function(){document.write("<div id='MainMenuContent' class='bf-toolbar bf-toolbar-bottom' style='position: fixed'></div>")},c.prototype.CreateToolBar=function(e){if(this.isShowToolbar){var t="";for(var n in e){var r=e[n],i="uiObj.CallMxCommand";r.isMxCommand||(i="uiObj.EvalJs"),0<r.itemid.length?t+='<div class="bf-button" onclick="'+i+"('"+e[n].evalString+'\')"><img class="mainimage-bf-butto" id="'+r.itemid+'" src="'+this.uiPath+"\\image\\"+r.image+'" title="'+e[n].text+'"></div>':t+='<div class="bf-button" onclick="'+i+"('"+e[n].evalString+'\')"><img class="mainimage-bf-butto" src="'+this.uiPath+"\\image\\"+r.image+'" title="'+e[n].text+'"></div>'}document.getElementById("MainMenuContent").innerHTML=t}},c.prototype.UpDisplayLayer=function(){var e=this.uiPath,t=this.vecLayerData,n=this.vecSketchLayerData,r="";if(null!=n){var i=n;for(var a in i){r+="<div>";var o="hide.png";0==i[a].off&&(o="show.png");var s="unlock.png";r+="<table class='bf-table'>",r+="<tbody class='bf-group'>",r+="<tr class='bf-group-title'>",r+='<td><img class="layer-enable" sketch=1 id='+i[a].id+' src="'+e+"/image/"+o+'"/></td>',r+='<td><span class="layer-color" style="background-color:'+i[a].color+'"></span></td>',r+='<td><span class="layer-text">草图_'+i[a].name+"</span></td>",r+='<td><img class="layer-state" src="'+e+"/image/"+s+'"/></td>',r+="</tr>",r+="</tbody>",r+="</table>",r+="</div>"}}if(null!=t)for(var a in i=t)r+="<div>",o="hide.png",0==i[a].off&&(o="show.png"),s="lock.png",r+="<table class='bf-table'>",r+="<tbody class='bf-group'>",r+="<tr class='bf-group-title'>",r+='<td><img class="layer-enable" sketch=0 id='+i[a].id+' src="'+e+"/image/"+o+'"/></td>',r+='<td><span class="layer-color" style="background-color:'+i[a].color+'"></span></td>',r+='<td><span class="layer-text">'+i[a].name+"</span></td>",r+='<td><img class="layer-state" src="'+e+"/image/"+s+'"/></td>',r+="</tr>",r+="</tbody>",r+="</table>",r+="</div>";var l=document.getElementById("Layer-Info");null!=l&&(l.innerHTML=r)},c.prototype.UpDisplayLayout=function(){var e=this.vecLayoutData,t="";if(t+="<div>",t+="<table class='bf-table'>",t+="<tbody class='bf-group'>",t+="<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>",t+="<td class='bf_layerout_td' style='width: 60px' >",t+="<div class='bf_layer_div layer_on'></div>",t+="</td>",t+="<td style='width: 238px' >",t+="<span class='layout-name' name='Model' style='color: white;cursor: pointer;'>Model</span>",t+="</td>",t+="</tr>",null!=e){var n=e;for(var r in n)t+="<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>",t+="<td class='bf_layerout_td' style='width: 60px' >",t+="<div class='bf_layer_div layer_on'></div>",t+="</td>",t+="<td style='width: 238px' >",t+="<span class='layout-name' name='"+n[r]+"' style='color: white;cursor: pointer;'>"+n[r]+"</span>",t+="</td>",t+="</tr>"}t+="</tbody>",t+="</table>",t+="</div>";var i=document.getElementById("layout-Info");null!=i&&(i.innerHTML=t)},c.prototype.InitEvent=function(){var e=document.getElementById("ModelTreeInterface"),t=document.getElementById("LayerInterface"),n=document.getElementById("LayerOutInterface"),r=document.getElementById("tuceng"),i=document.getElementById("mulushu"),a=document.getElementById("buju"),o=0,l=0,c=0,u=0,h=!1;i.onmousedown=function(t){o=t.clientX,l=t.clientY,c=e.offsetLeft,u=e.offsetTop,h=!0,e.style.cursor="move"},r.onmousedown=function(e){o=e.clientX,l=e.clientY,c=t.offsetLeft,u=t.offsetTop,h=!0,t.style.cursor="move"},a.onmousedown=function(e){o=e.clientX,l=e.clientY,c=n.offsetLeft,u=n.offsetTop,h=!0,n.style.cursor="move"},window.onmousemove=function(r){if(0!=h){var i=r.clientX,a=r.clientY,s=i-(o-c),p=a-(l-u);e.style.left=s+"px",e.style.top=p+"px",t.style.left=s+"px",t.style.top=p+"px",n.style.left=s+"px",n.style.top=p+"px"}},i.onmouseup=function(){h=!1,e.style.cursor="default"},r.onmouseup=function(){h=!1,t.style.cursor="default"},a.onmouseup=function(){h=!1,n.style.cursor="default"},$("#close2").click(function(){$(this).parent("div").fadeOut(200)}),$("#menu4").click(function(){$("#StrcutInfoBase").hasClass("hide")?($("#StrcutInfoBase").fadeIn(200),$("#StrcutInfoBase").removeClass("hide")):($("#StrcutInfoBase").fadeOut(200),$("#StrcutInfoBase").addClass("hide"))}),$(".bf-select-current").click(function(){$(this).hasClass("bf-open")?$(this).removeClass("bf-open"):$(this).addClass("bf-open")}),$(".bf-select-option").click(function(){$(this).parent("ul").prev("span").html($(this).text()),$(this).parent("ul").prev("span").removeClass("bf-open")});var p=$("#StrcutInfoBase");p.bind("mousedown",function(e){var t=$(this)[0].offsetLeft,n=$(this)[0].offsetTop,r=e.pageX,i=e.pageY;$(document).bind("mousemove",function(e){var a=e.pageX-r,o=e.pageY-i,s=t+a+"px",l=n+o+"px";p.css({top:l,left:s})})}),$(document).bind("mouseup",function(){$(this).unbind("mousemove")}),this.CreateToolBar(this.vecToolBarItem);var d=this.vecMenuItem;if(this.isShowMainMenu&&function(e){var t="";!function e(n,r){var i=function(e,t){var n=new Array;for(var r in t)t[r].parentId==e&&n.push(t[r]);return n}(n,r);if(0<i.length){for(var a in t+="<ul>",i)0!=i[a].evalString.length?(t+='<li><p class="li_option" ',t+="onclick=\"uiObj.EvalJs('"+i[a].evalString+"')\"",t+=">"+i[a].text+"</p>"):(t+="<li><a ",t+=">"+i[a].text+"</a>"),e(i[a].id,r),t+="</li>";t+="</br>",t+="</br>",t+="</br>",t+="</ul>"}}(-1,d),e("#main-nav").append(t);var n=e("#main-nav"),r=e(".toggle"),i={maxWidth:!1,customToggle:r,levelTitles:!0},a=null,o={};a&&a.remove(),r.off("click"),a=n.clone(),e.extend(o,{side:"right"}),a.hcMobileNav(e.extend({},i,o))}(jQuery),$(".li_option").click(function(){var e=$(this);$(".li_option").each(function(){$(this).removeClass("active")}),e.addClass("active")}),""==this.sTitle){var f=window.location.href,m=f.length,g=f.indexOf("?"),v=f.substr(g,m).split("=")[1];null!=v&&(this.sTitle=v)}$(".barspan").html(decodeURIComponent(this.sTitle)),$(document).on("click",".layer-enable",function(){var e=s.MxFun.getUiObj().getPath(),t=parseInt($(this).attr("id")),n=parseInt($(this).attr("sketch")),r=!0;$(this).attr("src")==e+"/image/show.png"?($(this).attr("src",e+"/image/hide.png"),r=!1):$(this).attr("src",e+"/image/show.png"),s.MxFun.showLayer(t,r,1==n)}),$(document).on("click",".layout-name",function(){var e=$(this).attr("name");"Model"==e&&(e=""),s.MxFun.getCurrentDraw().gotoLayout(e)})},c.prototype.WriteFooter=function(){document.write("<div class='footer' style='background: rgba(0, 0, 0, 0.7);position: fixed;left: 0;bottom: 0;width: 100%;'>"),document.write(" <div style='line-height: 40px;font-size: 12px;color: #999;padding: 0 10px;'>"),document.write(" <p style='float: right;line-height: 15px;font-size: 12px;color: #999;display: block;'>"),document.write(" <a style='color: #4a90e2;text-decoration: none;outline: none;' href='http://www.mxdraw.com/' target='_blank'>MxDraw </a>旗下产品"),document.write(" </p>"),document.write(" <a style='color: #4a90e2;text-decoration: none;outline: none;' href='http://www.mxdraw.com' target='_blank'>MX3D </a> 蜀ICP备15011727号"),document.write(" </div>"),document.write(" </div>")},c.prototype.ShowLoading=function(){this.isEnableLoading&&($(".Prompt").css("background","rgba(0, 0, 0, 0)"),$(".Prompt").fadeIn(100),$(".Prompt span").css("display","none"))},c.prototype.HideLoading=function(){this.isEnableLoading&&($(".Prompt").css("background","rgba(0, 0, 0, 0.8)"),$(".Prompt div").fadeOut(100),$(".Prompt span").fadeIn(200),setTimeout(function(){$(".Prompt").fadeOut(1e3)},1e3))},c.prototype.ShowObjectProperty=function(e){if(0!=e.length){var t;t="string"==typeof e?JSON.parse(e):e;var n="";for(var r in t){var i=t[r];for(var a in n+="<table class='bf-table'>",n+="<tbody class='bf-group'>",n+="<tr class='bf-group-title'>",n+="<td colspan='2'><i class='bf-icon'></i>"+i.name+"</td>",n+="</tr>",i.datas){var o=i.datas[a];n+="<tr class='bf-group-content'>",n+="<td class='bf-key'>"+o.name+"</td>",n+="<td class='bf-value'>"+o.value+"</td>",n+="</tr>"}n+="</tbody>",n+="</table>"}document.getElementById("ComponentContent").innerHTML=n,$(".bf-group").click(function(){$(this).hasClass("bf-collapse")?$(this).removeClass("bf-collapse"):$(this).addClass("bf-collapse")}),$("#StrcutInfoBase").fadeIn(200),$("#StrcutInfoBase").removeClass("hide")}},c.prototype.HideObjectProp=function(){$("#StrcutInfoBase").hasClass("hide")||($("#StrcutInfoBase").fadeOut(200),$("#StrcutInfoBase").addClass("hide"))},c.prototype.SwitchShowLayer=function(){var e=document.getElementById("ModelTreeInterface"),t=document.getElementById("ModelTreeThumbnail"),n=document.getElementById("LayerThumbnail"),r=document.getElementById("LayerInterface"),i=document.getElementById("LayerOut"),a=document.getElementById("LayerOutInterface");e.style.display="none",(a.style.display="none")==r.style.display?(n.style.display="block",r.style.display="block",r.style.left="80px",r.style.top="50px",null!=t&&(t.style.display="block"),null!=i&&(i.style.display="block"),e.style.display="none",a.style.display="none"):(r.style.display="none",null!=t&&(t.style.display="block"),n.style.display="block",null!=i&&(i.style.display="block"))},c.prototype.SwitchShowStructTree=function(){var e=document.getElementById("ModelTreeInterface"),t=document.getElementById("ModelTreeThumbnail"),n=document.getElementById("LayerThumbnail"),r=document.getElementById("LayerInterface"),i=document.getElementById("LayerOut"),a=document.getElementById("LayerOutInterface");r.style.display="none",(a.style.display="none")==e.style.display?(null!=t&&(t.style.display="block"),e.style.display="block",e.style.left="80px",e.style.top="50px",n.style.display="block",null!=i&&(i.style.display="block"),r.style.display="none",a.style.display="none"):(e.style.display="none",null!=t&&(t.style.display="block"),n.style.display="block",null!=i&&(i.style.display="block"))},c.prototype.Chosecolor=function(){document.getElementById("color-picker").click()},c.prototype.ColorChange=function(e){document.getElementById("colorbox").style.backgroundColor=e,s.MxFun.setCurrentColor(e)},c.prototype.SwitchShowLayout=function(){var e=document.getElementById("ModelTreeInterface"),t=document.getElementById("ModelTreeThumbnail"),n=document.getElementById("LayerThumbnail"),r=document.getElementById("LayerInterface"),i=document.getElementById("LayerOut"),a=document.getElementById("LayerOutInterface");e.style.display="none",(r.style.display="none")==a.style.display?(i.style.display="block",a.style.display="block",a.style.left="80px",a.style.top="120px",null!=t&&(t.style.display="block"),n.style.display="block",e.style.display="none",r.style.display="none"):(a.style.display="none",null!=t&&(t.style.display="block"),n.style.display="block",i.style.display="block")},c.prototype.Fullscreen=function(){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen&&e.webkitRequestFullScreen(),document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),this.IsFullStatus()?($("img[title='取消全屏']").attr("src",this.uiPath+"/image\\fullscreen1.gif"),$("img[title='取消全屏']").attr("title","全屏")):($("img[title='全屏']").attr("src",this.uiPath+"/image\\escscreen1.gif"),$("img[title='全屏']").attr("title","取消全屏"))},c.prototype.IsFullStatus=function(){return null!=(document.fullscreenEnabled||document.mozFullscreenElement||document.webkitFullscreenElement)},c);function c(){return null!==a&&a.apply(this,arguments)||this}n.MxUiObjectPC=l},{"./MxFun":45,"./MxUiObject":61}],64:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxUiVue=void 0;var r,i,a,o=e("./MxFun"),s=e("./MxJigCmdManager"),l=e("./MxTools"),c=e("./MxCmdRunManager");function u(e){if(32==e||13==e)if(s.MxJigCmdManager.isRunning())s.MxJigCmdManager.OnEnter(e);else{var t=f(),n="";n=0==t.length?c.MxCmdRunManager.GetPrvCmd():t,m(""),n=l.MxTools.stringTrimLeftSpace(n),o.MxFun.sendStringToExecute(n)}else if(27==e)s.MxJigCmdManager.isRunning()?s.MxJigCmdManager.stopCmd():p(" *取消*\n命令:");else if(38==e)s.MxJigCmdManager.isRunning()||(c.MxCmdRunManager.MoveUpKey(),0!=(r=c.MxCmdRunManager.GetListCommad()).length&&(m(r),d()));else if(40==e){var r;s.MxJigCmdManager.isRunning()||(c.MxCmdRunManager.MoveDownKey(),0!=(r=c.MxCmdRunManager.GetListCommad()).length&&(m(r),d()))}}function h(e,t){void 0===t&&(t=!0);var n=e.length;if(!(n<1)){for(var r=a.getCmdLine(),i=r.getCmdTip(),o=r.getCmdText(),s=e.indexOf("\n"),l=0,c=!0;-1!=s&&(c?(r.addCmdDisplay("\n"+i+o+e.substring(l,s-l)),o=i="",c=!1):r.addCmdDisplay("\n"+e.substring(l,s-l)),(l=s+1)<n);)s=e.indexOf("\n",l);if(c){var u=e.substring(l,n-l),h=u.indexOf("\r"),p=u.length;i=-1==h?i+o+u:h+1<p?u.substring(h+1,p-h-1):""}else l<n&&(i=e.substring(l,n));o="",t&&(i+=" "),r.setCmdTip(i),r.setCmdText(o),r.upDisplay()}}function p(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(null!=a){for(var r=arguments,i=r[0],o=0;o<r.length-1;o++){var s=new RegExp("\\{"+o+"\\}","gm");i=i.replace(s,r[o+1])}h(i,!0)}}function d(){null!=a&&a.getCmdLine().upDisplay()}function f(){if(null==a)return"";var e=a.getCmdLine();return l.MxTools.stringTrimLeftRightSpace(e.getCmdText())}function m(e){if(null!=a)return a.getCmdLine().setCmdText(e)}function g(e){var t=s.MxJigCmdManager.getCurCmd();null!=t&&(t.getDynImput().onKeyDonw(e)||u(e))}r=n.MxUiVue||(n.MxUiVue={}),a=void 0,(i=r.CursorType||(r.CursorType={}))[i.kNormal=0]="kNormal",i[i.kRect=1]="kRect",i[i.kCross=2]="kCross",r.isNull=function(){return null==a},r.init=function(e){(a=e).mountKeydownEvent(u),a.getDynamicInput().mountKeydownEvent(g)},r.setTipCoord=function(e){null!=a&&a.setTipCoord(e)},r.setCursorType=function(e){null!=a&&a.setCursorType(e)},r.AcutPrintfNoFormat=h,r.acutPrintf=p,r.cmdLineUpDisplay=d,r.getCmdText=f,r.setCmdText=m,r.getCmdDisplay=function(){return null==a?"":a.getCmdLine().getCmdDisplay()},r.setCmdDisplay=function(e){if(null!=a)return a.getCmdLine().setCmdDisplay(e)},r.getCmdTip=function(){return null==a?"":a.getCmdLine().getCmdTip()},r.setCmdTip=function(e){if(null!=a)return a.getCmdLine().setCmdTip(e)},r.restoreCmdStatus=function(){if(null!=a){var e=a.getCmdLine();" "==e.getCmdTip()&&0==e.getCmdText().length?(e.setCmdTip(""),p("{0}:","命令")):p("\n{0}:","命令")}},r.DynamicInput_upDisplay=function(){null!=a&&r.OnMxEvent({name:"dynInputUpDisplay"})},r.DynamicInput_setType=function(e){null!=a&&a.getDynamicInput().setType(e)},r.DynamicInput_getType=function(){return null==a?s.MxJigCmdManager.DynamicInputType.kNoInput:a.getDynamicInput().getType()},r.DynamicInput_setPos=function(e){null!=a&&a.getDynamicInput().setPos([e.x,e.y])},r.DynamicInput_setTip=function(e){null!=a&&a.getDynamicInput().setTip(e)},r.DynamicInput_setValue1=function(e){null!=a&&a.getDynamicInput().setValue1(e)},r.DynamicInput_getValue1=function(){return null==a?"":a.getDynamicInput().getValue1()},r.DynamicInput_setValue1Pos=function(e){null!=a&&a.getDynamicInput().setValue1Pos([e.x,e.y])},r.DynamicInput_setValue2=function(e){null!=a&&a.getDynamicInput().setValue2(e)},r.DynamicInput_getValue2=function(){return null==a?"":a.getDynamicInput().getValue2()},r.DynamicInput_getFocusValue=function(){return null==a?"":a.getDynamicInput().getFocusValue()},r.DynamicInput_setValue2Pos=function(e){null!=a&&a.getDynamicInput().setValue2Pos([e.x,e.y])},r.DynamicInput_setShow=function(e){null!=a&&a.getDynamicInput().setShow(e)},r.DynamicInput_isShow=function(){return null!=a&&a.getDynamicInput().isShow()},r.OnMxEvent=function(e){if(null==a)return!1;a.OnMxEvent(e)}},{"./MxCmdRunManager":33,"./MxFun":45,"./MxJigCmdManager":48,"./MxTools":59}],65:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxBulid=void 0,window.MxDrawVersion="1.0(2022-05-05 09:11)",(n.MxBulid||(n.MxBulid={})).getVersion=function(){return window.MxDrawVersion?window.MxDrawVersion:"inalid version"}},{}],66:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxWindowsEvent=void 0;var r,i,a,o,s=e("./MxFun"),l=e("./MxManager"),c=e("./MxJigCmdManager"),u=e("three"),h=e("./MxUiVue"),p=e("./MxDrawData");function d(e,t){for(var n=0,r=o.length;n<r;n++){var i=o[n](e,t);if(0!=i)return i}}function f(e){if(a.x=e.offsetX,a.y=e.offsetY,!d("mousemove",e)&&!h.MxUiVue.isNull()){var t=e.srcElement;if(t&&"CANVAS"==t.tagName){var n=l.MxManager.getMxObject(t);if(null==n)return;var r=n.screenCoord2Doc(e.offsetX,e.offsetY,0);h.MxUiVue.setTipCoord(s.MxFun.formatString("{0},{1},0.000",r.x.toFixed(3),r.y.toFixed(3)))}}}function m(e){d("mouseup",e)}function g(e){if(a.x=e.offsetX,a.y=e.offsetY,!d("mousedown",e))if(e.button==c.MxJigCmdManager.MouseButton.kRight&&c.MxJigCmdManager.isRunning())c.MxJigCmdManager.stopCmd();else if(p.MxDrawData.m_isEnableIntelliSelect&&e.button==c.MxJigCmdManager.MouseButton.kLeft&&!c.MxJigCmdManager.isRunning()){var t=e.srcElement;if(t&&"CANVAS"==t.tagName){var n=l.MxManager.getMxObject(t);if(null==n)return;var r=n.screenCoord2Doc(e.offsetX,e.offsetY,0);if(p.MxDrawData.m_intelliSelectType==p.IntelliSelectType.kBackgroundServicesModel){var i=n.getMxCAD();if(!i)return;var o=!0;i&&i.getGrip().onMouseLBDown(r)&&(o=!1),o&&s.MxFun.sendStringToExecute("Mx_IntelliSel",{pt1:r})}else if(!n.getMxDatabase().getGripManager().onMouseLBDown(r)){var h=new u.Vector3(e.offsetX,e.offsetY,0);s.MxFun.sendStringToExecute("Mx_FrontEndWebpageIntelliSel",{pt:h})}}}}function v(e){var t=e||window.event||arguments.callee.caller.arguments[0];if(t&&27==t.keyCode)if(p.MxDrawData.m_isEnableIntelliSelect&&!c.MxJigCmdManager.isRunning()){var n=!1,r=s.MxFun.getCurrentMx(),i=r.getMxCAD();if(i){var a=i.getSelect().clearAllSelect(),o=i.getGrip().clearAll();(a||o)&&(n=!0)}r.getMxDatabase().getGripManager().removeAllGrips()&&(n=!0),r.getMxDatabase().getSelectManager().removeAllEntity()&&(n=!0),n&&r.updateDisplay()}else c.MxJigCmdManager.isRunning()&&c.MxJigCmdManager.stopCmd()}r=n.MxWindowsEvent||(n.MxWindowsEvent={}),i=!1,a=new u.Vector2(0,0),o=new Array,r.addEvent=function(e){o.push(e)},r.getCurrentMousePostion=function(){return a},r.registEvent=function(){i||(i=!0,s.MxFun.isPC()&&(document.addEventListener("mousemove",f,!1),document.addEventListener("mouseup",m,!1),document.addEventListener("mousedown",g,!1),document.onkeydown=v))}},{"./MxDrawData":40,"./MxFun":45,"./MxJigCmdManager":48,"./MxManager":51,"./MxUiVue":64,three:19}],67:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var r=e("./MxFun");function i(){}(i.CreateMx=function(){r.MxFun.init(),"undefined"!=typeof MxMain&&0==MxMain(e)||r.MxFun.createMxObject();var t=r.MxFun.getUiObject();null!=t&&(t.sTitle=r.MxFun.getCurrentDraw().getFileTitle(),setTimeout(function(){t.init()},400))},i.Main=function(){if("undefined"!=typeof MxUiMain){MxUiMain(e);var t=r.MxFun.getUiObject();null!=t&&t.writeUICSS()}"undefined"==typeof MxDocumentReady?$(document).ready(function(){i.CreateMx()}):MxDocumentReady(e,i.CreateMx)},i).Main()},{"./MxFun":45}],68:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxSvgManager=void 0;var r=e("three"),i=e("./SVGLoader"),a=(o.prototype.loadSVGImp=function(e,t,n){(new i.SVGLoader).load(e,function(e){for(var a=[],o=e.paths,s=new r.Group,l=0;l<o.length;l++){var c=o[l],u=c.userData.style.fill;if(void 0!==u&&"none"!==u){for(var h=new r.MeshBasicMaterial({color:t||(new r.Color).setStyle(u),opacity:c.userData.style.fillOpacity,transparent:c.userData.style.fillOpacity<1,side:r.DoubleSide,depthWrite:!1,wireframe:!1}),p=i.SVGLoader.createShapes(c),d=0;d<p.length;d++){var f=p[d],m=new r.ShapeBufferGeometry(f),g=new r.Mesh(m,h);s.add(g)}a.push(h)}c.userData.style.stroke}n&&n(s,a)},void 0,function(){n&&n(null,null)})},o.prototype.loadSVG=function(e,t,n){var i=this,a=this.mapSvgUrlToData.get(e);a?n&&(null==a?n(null,null):n(a.svg.clone(),a.aryMeterial)):this.loadSVGImp(e,t,function(t,a){if(t&&a){var o=new function(){this.svg=new r.Group,this.aryMeterial=[]};o.svg=t,o.aryMeterial=a,i.mapSvgUrlToData.set(e,o),n&&n(o.svg.clone(),o.aryMeterial)}else i.mapSvgUrlToData.set(e,null),n&&n(null,null)})},o);function o(){this.mapSvgUrlToData=new Map}var s=(l.prototype.loadSVG=function(e,t,n){n&&this.mxThreeJsBuffer.loadSVG(e,t,n)},l);function l(){this.mxThreeJsBuffer=new a}n.MxSvgManager=s},{"./SVGLoader":69,three:19}],69:[function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.SVGLoader=void 0;var a,o=e("three"),s=(i(l,a=o.Loader),l.prototype.load=function(e,t,n,r){var i=this,a=new o.FileLoader(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,function(n){try{t(i.parse(n))}catch(n){r?r(n):console.error(n),i.manager.itemError(e)}},n,r)},l.prototype.parse=function(e){var t=this;function n(e,t,n,i,a,o,s,l){if(0!=t&&0!=n){i=i*Math.PI/180,t=Math.abs(t),n=Math.abs(n);var c=(s.x-l.x)/2,u=(s.y-l.y)/2,h=Math.cos(i)*c+Math.sin(i)*u,p=-Math.sin(i)*c+Math.cos(i)*u,d=t*t,f=n*n,m=h*h,g=p*p,v=m/d+g/f;if(1<v){var y=Math.sqrt(v);d=(t*=y)*t,f=(n*=y)*n}var x=d*g+f*m,_=(d*f-x)/x,b=Math.sqrt(Math.max(0,_));a===o&&(b=-b);var w=b*t*p/n,M=-b*n*h/t,S=Math.cos(i)*w-Math.sin(i)*M+(s.x+l.x)/2,T=Math.sin(i)*w+Math.cos(i)*M+(s.y+l.y)/2,E=r(1,0,(h-w)/t,(p-M)/n),C=r((h-w)/t,(p-M)/n,(-h-w)/t,(-p-M)/n)%(2*Math.PI);e.currentPath.absellipse(S,T,t,n,E,E+C,0===o,i)}else e.lineTo(l.x,l.y)}function r(e,t,n,r){var i=e*n+t*r,a=Math.sqrt(e*e+t*t)*Math.sqrt(n*n+r*r),o=Math.acos(Math.max(-1,Math.min(1,i/a)));return e*r-t*n<0&&(o=-o),o}function i(e,t){t=Object.assign({},t);var n={};if(e.hasAttribute("class"))for(var r=e.getAttribute("class").split(/\s/).filter(Boolean).map(function(e){return e.trim()}),i=0;i<r.length;i++)n=Object.assign(n,p["."+r[i]]);function a(r,i,a){void 0===a&&(a=function(e){return e.startsWith("url")&&console.warn("SVGLoader: url access in attributes is not implemented."),e}),e.hasAttribute(r)&&(t[i]=a(e.getAttribute(r))),n[r]&&(t[i]=a(n[r])),e.style&&""!==e.style[r]&&(t[i]=a(e.style[r]))}function o(e){return Math.max(0,Math.min(1,u(e)))}function s(e){return Math.max(0,u(e))}return e.hasAttribute("id")&&(n=Object.assign(n,p["#"+e.getAttribute("id")])),a("fill","fill"),a("fill-opacity","fillOpacity",o),a("fill-rule","fillRule"),a("opacity","opacity",o),a("stroke","stroke"),a("stroke-opacity","strokeOpacity",o),a("stroke-width","strokeWidth",s),a("stroke-linejoin","strokeLineJoin"),a("stroke-linecap","strokeLineCap"),a("stroke-miterlimit","strokeMiterLimit",s),a("visibility","visibility"),t}function a(e,t){return e-(t-e)}function s(e,t,n){if("string"!=typeof e)throw new TypeError("Invalid input: "+typeof e);var r,i={SEPARATOR:/[ \t\r\n\,.\-+]/,WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/},a=0,o=!0,s="",l="",c=[];function u(e,t,n){var r=new SyntaxError('Unexpected character "'+e+'" at index '+t+".");throw r.partial=n,r}function h(){""!==s&&(""===l?c.push(Number(s)):c.push(Number(s)*Math.pow(10,Number(l)))),l=s=""}for(var p=e.length,d=0;d<p;d++)if(r=e[d],Array.isArray(t)&&t.includes(c.length%n)&&i.FLAGS.test(r))a=1,s=r,h();else{if(0===a){if(i.WHITESPACE.test(r))continue;if(i.DIGIT.test(r)||i.SIGN.test(r)){a=1,s=r;continue}if(i.POINT.test(r)){a=2,s=r;continue}i.COMMA.test(r)&&(o&&u(r,d,c),o=!0)}if(1===a){if(i.DIGIT.test(r)){s+=r;continue}if(i.POINT.test(r)){s+=r,a=2;continue}if(i.EXP.test(r)){a=3;continue}i.SIGN.test(r)&&1===s.length&&i.SIGN.test(s[0])&&u(r,d,c)}if(2===a){if(i.DIGIT.test(r)){s+=r;continue}if(i.EXP.test(r)){a=3;continue}i.POINT.test(r)&&"."===s[s.length-1]&&u(r,d,c)}if(3===a){if(i.DIGIT.test(r)){l+=r;continue}if(i.SIGN.test(r)){if(""===l){l+=r;continue}1===l.length&&i.SIGN.test(l)&&u(r,d,c)}}i.WHITESPACE.test(r)?(h(),a=0,o=!1):i.COMMA.test(r)?(h(),o=!(a=0)):i.SIGN.test(r)?(h(),a=1,s=r):i.POINT.test(r)?(h(),a=2,s=r):u(r,d,c)}return h(),c}var l=["mm","cm","in","pt","pc","px"],c={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:12,pc:1,px:-1},px:{px:1}};function u(e){var n="px";if("string"==typeof e||e instanceof String)for(var r=0,i=l.length;r<i;r++){var a=l[r];if(e.endsWith(a)){n=a,e=e.substring(0,e.length-a.length);break}}var o=void 0;return"px"===n&&"px"!==t.defaultUnit?o=c.in[t.defaultUnit]/t.defaultDPI:(o=c[n][t.defaultUnit])<0&&(o=c[n].in*t.defaultDPI),o*parseFloat(e)}var h=[],p={},d=[],f=new o.Matrix3,m=new o.Matrix3,g=new o.Matrix3,v=new o.Matrix3,y=new o.Vector2,x=new o.Vector3,_=new o.Matrix3,b=(new DOMParser).parseFromString(e,"image/svg+xml");return function e(t,r){if(1===t.nodeType){var l,c,b,w,M,S,T,E,C,A,L,D,P=function(e){if(!(e.hasAttribute("transform")||"use"===e.nodeName&&(e.hasAttribute("x")||e.hasAttribute("y"))))return null;var t=function(e){var t=new o.Matrix3,n=f;if("use"===e.nodeName&&(e.hasAttribute("x")||e.hasAttribute("y"))){var r=u(e.getAttribute("x")),i=u(e.getAttribute("y"));t.translate(r,i)}if(e.hasAttribute("transform"))for(var a=e.getAttribute("transform").split(")"),l=a.length-1;0<=l;l--){var c=a[l].trim();if(""!==c){var h=c.indexOf("("),p=c.length;if(0<h&&h<p){var d=c.substr(0,h),y=s(c.substr(h+1,p-h-1));switch(n.identity(),d){case"translate":1<=y.length&&(i=r=y[0],2<=y.length&&(i=y[1]),n.translate(r,i));break;case"rotate":if(1<=y.length){var x,_=0,b=0;x=-y[0]*Math.PI/180,3<=y.length&&(_=y[1],b=y[2]),m.identity().translate(-_,-b),g.identity().rotate(x),v.multiplyMatrices(g,m),m.identity().translate(_,b),n.multiplyMatrices(m,v)}break;case"scale":if(1<=y.length){var w=y[0],M=w;2<=y.length&&(M=y[1]),n.scale(w,M)}break;case"skewX":1===y.length&&n.set(1,Math.tan(y[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":1===y.length&&n.set(1,0,0,Math.tan(y[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":6===y.length&&n.set(y[0],y[2],y[4],y[1],y[3],y[5],0,0,1)}}t.premultiply(n)}}return t}(e);return 0<d.length&&t.premultiply(d[d.length-1]),_.copy(t),d.push(t),t}(t),O=!0,R=null;switch(t.nodeName){case"svg":break;case"style":!function(e){if(e.sheet&&e.sheet.cssRules&&e.sheet.cssRules.length)for(var t=0;t<e.sheet.cssRules.length;t++){var n=e.sheet.cssRules[t];if(1===n.type)for(var r=n.selectorText.split(/,/gm).filter(Boolean).map(function(e){return e.trim()}),i=0;i<r.length;i++)p[r[i]]=Object.assign(p[r[i]]||{},n.style)}}(t);break;case"g":r=i(t,r);break;case"path":r=i(t,r),t.hasAttribute("d")&&(R=function(e){for(var t=new o.ShapePath,r=new o.Vector2,i=new o.Vector2,l=new o.Vector2,c=!0,u=!1,h=e.getAttribute("d").match(/[a-df-z][^a-df-z]*/gi),p=0,d=h.length;p<d;p++){var f=h[p],m=f.charAt(0),g=f.substr(1).trim();!0===c&&(c=!(u=!0));var v=void 0;switch(m){case"M":for(var y=0,x=(v=s(g)).length;y<x;y+=2)r.x=v[y+0],r.y=v[y+1],i.x=r.x,i.y=r.y,0===y?t.moveTo(r.x,r.y):t.lineTo(r.x,r.y),0===y&&l.copy(r);break;case"H":for(y=0,x=(v=s(g)).length;y<x;y++)r.x=v[y],i.x=r.x,i.y=r.y,t.lineTo(r.x,r.y),0===y&&!0===u&&l.copy(r);break;case"V":for(y=0,x=(v=s(g)).length;y<x;y++)r.y=v[y],i.x=r.x,i.y=r.y,t.lineTo(r.x,r.y),0===y&&!0===u&&l.copy(r);break;case"L":for(y=0,x=(v=s(g)).length;y<x;y+=2)r.x=v[y+0],r.y=v[y+1],i.x=r.x,i.y=r.y,t.lineTo(r.x,r.y),0===y&&!0===u&&l.copy(r);break;case"C":for(y=0,x=(v=s(g)).length;y<x;y+=6)t.bezierCurveTo(v[y+0],v[y+1],v[y+2],v[y+3],v[y+4],v[y+5]),i.x=v[y+2],i.y=v[y+3],r.x=v[y+4],r.y=v[y+5],0===y&&!0===u&&l.copy(r);break;case"S":for(y=0,x=(v=s(g)).length;y<x;y+=4)t.bezierCurveTo(a(r.x,i.x),a(r.y,i.y),v[y+0],v[y+1],v[y+2],v[y+3]),i.x=v[y+0],i.y=v[y+1],r.x=v[y+2],r.y=v[y+3],0===y&&!0===u&&l.copy(r);break;case"Q":for(y=0,x=(v=s(g)).length;y<x;y+=4)t.quadraticCurveTo(v[y+0],v[y+1],v[y+2],v[y+3]),i.x=v[y+0],i.y=v[y+1],r.x=v[y+2],r.y=v[y+3],0===y&&!0===u&&l.copy(r);break;case"T":for(y=0,x=(v=s(g)).length;y<x;y+=2){var _=a(r.x,i.x),b=a(r.y,i.y);t.quadraticCurveTo(_,b,v[y+0],v[y+1]),i.x=_,i.y=b,r.x=v[y+0],r.y=v[y+1],0===y&&!0===u&&l.copy(r)}break;case"A":for(y=0,x=(v=s(g,[3,4],7)).length;y<x;y+=7)if(v[y+5]!=r.x||v[y+6]!=r.y){var w=r.clone();r.x=v[y+5],r.y=v[y+6],i.x=r.x,i.y=r.y,n(t,v[y],v[y+1],v[y+2],v[y+3],v[y+4],w,r),0===y&&!0===u&&l.copy(r)}break;case"m":for(y=0,x=(v=s(g)).length;y<x;y+=2)r.x+=v[y+0],r.y+=v[y+1],i.x=r.x,i.y=r.y,0===y?t.moveTo(r.x,r.y):t.lineTo(r.x,r.y),0===y&&l.copy(r);break;case"h":for(y=0,x=(v=s(g)).length;y<x;y++)r.x+=v[y],i.x=r.x,i.y=r.y,t.lineTo(r.x,r.y),0===y&&!0===u&&l.copy(r);break;case"v":for(y=0,x=(v=s(g)).length;y<x;y++)r.y+=v[y],i.x=r.x,i.y=r.y,t.lineTo(r.x,r.y),0===y&&!0===u&&l.copy(r);break;case"l":for(y=0,x=(v=s(g)).length;y<x;y+=2)r.x+=v[y+0],r.y+=v[y+1],i.x=r.x,i.y=r.y,t.lineTo(r.x,r.y),0===y&&!0===u&&l.copy(r);break;case"c":for(y=0,x=(v=s(g)).length;y<x;y+=6)t.bezierCurveTo(r.x+v[y+0],r.y+v[y+1],r.x+v[y+2],r.y+v[y+3],r.x+v[y+4],r.y+v[y+5]),i.x=r.x+v[y+2],i.y=r.y+v[y+3],r.x+=v[y+4],r.y+=v[y+5],0===y&&!0===u&&l.copy(r);break;case"s":for(y=0,x=(v=s(g)).length;y<x;y+=4)t.bezierCurveTo(a(r.x,i.x),a(r.y,i.y),r.x+v[y+0],r.y+v[y+1],r.x+v[y+2],r.y+v[y+3]),i.x=r.x+v[y+0],i.y=r.y+v[y+1],r.x+=v[y+2],r.y+=v[y+3],0===y&&!0===u&&l.copy(r);break;case"q":for(y=0,x=(v=s(g)).length;y<x;y+=4)t.quadraticCurveTo(r.x+v[y+0],r.y+v[y+1],r.x+v[y+2],r.y+v[y+3]),i.x=r.x+v[y+0],i.y=r.y+v[y+1],r.x+=v[y+2],r.y+=v[y+3],0===y&&!0===u&&l.copy(r);break;case"t":for(y=0,x=(v=s(g)).length;y<x;y+=2)_=a(r.x,i.x),b=a(r.y,i.y),t.quadraticCurveTo(_,b,r.x+v[y+0],r.y+v[y+1]),i.x=_,i.y=b,r.x=r.x+v[y+0],r.y=r.y+v[y+1],0===y&&!0===u&&l.copy(r);break;case"a":for(y=0,x=(v=s(g,[3,4],7)).length;y<x;y+=7)0==v[y+5]&&0==v[y+6]||(w=r.clone(),r.x+=v[y+5],r.y+=v[y+6],i.x=r.x,i.y=r.y,n(t,v[y],v[y+1],v[y+2],v[y+3],v[y+4],w,r),0===y&&!0===u&&l.copy(r));break;case"Z":case"z":t.currentPath.autoClose=!0,0<t.currentPath.curves.length&&(r.copy(l),t.currentPath.currentPoint.copy(r),c=!0);break;default:console.warn(f)}u=!1}return t}(t));break;case"rect":r=i(t,r),R=function(e){var t=u(e.getAttribute("x")||0),n=u(e.getAttribute("y")||0),r=u(e.getAttribute("rx")||e.getAttribute("ry")||0),i=u(e.getAttribute("ry")||e.getAttribute("rx")||0),a=u(e.getAttribute("width")),s=u(e.getAttribute("height")),l=.448084975506,c=new o.ShapePath;return c.moveTo(t+r,n),c.lineTo(t+a-r,n),0===r&&0===i||c.bezierCurveTo(t+a-r*l,n,t+a,n+i*l,t+a,n+i),c.lineTo(t+a,n+s-i),0===r&&0===i||c.bezierCurveTo(t+a,n+s-i*l,t+a-r*l,n+s,t+a-r,n+s),c.lineTo(t+r,n+s),0===r&&0===i||c.bezierCurveTo(t+r*l,n+s,t,n+s-i*l,t,n+s-i),c.lineTo(t,n+i),0===r&&0===i||c.bezierCurveTo(t,n+i*l,t+r*l,n,t+r,n),c}(t);break;case"polygon":r=i(t,r),A=t,L=new o.ShapePath,D=0,A.getAttribute("points").replace(/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,function(e,t,n){var r=u(t),i=u(n);0===D?L.moveTo(r,i):L.lineTo(r,i),D++}),L.currentPath.autoClose=!0,R=L;break;case"polyline":r=i(t,r),T=t,E=new o.ShapePath,C=0,T.getAttribute("points").replace(/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,function(e,t,n){var r=u(t),i=u(n);0===C?E.moveTo(r,i):E.lineTo(r,i),C++}),E.currentPath.autoClose=!1,R=E;break;case"circle":r=i(t,r),R=function(e){var t=u(e.getAttribute("cx")||0),n=u(e.getAttribute("cy")||0),r=u(e.getAttribute("r")||0),i=new o.Path;i.absarc(t,n,r,0,2*Math.PI,!1);var a=new o.ShapePath;return a.subPaths.push(i),a}(t);break;case"ellipse":r=i(t,r),R=function(e){var t=u(e.getAttribute("cx")||0),n=u(e.getAttribute("cy")||0),r=u(e.getAttribute("rx")||0),i=u(e.getAttribute("ry")||0),a=new o.Path;a.absellipse(t,n,r,i,0,2*Math.PI,void 0,void 0);var s=new o.ShapePath;return s.subPaths.push(a),s}(t);break;case"line":r=i(t,r),c=u((l=t).getAttribute("x1")||0),b=u(l.getAttribute("y1")||0),w=u(l.getAttribute("x2")||0),M=u(l.getAttribute("y2")||0),(S=new o.ShapePath).moveTo(c,b),S.lineTo(w,M),S.currentPath.autoClose=!1,R=S;break;case"defs":O=!1;break;case"use":r=i(t,r);var I=t.href.baseVal.substring(1),B=t.viewportElement.getElementById(I);B?e(B,r):console.warn("SVGLoader: 'use node' references non-existent node id: "+I)}if(R&&(void 0!==r.fill&&"none"!==r.fill&&R.color.setStyle(r.fill),function(e,t){function n(e){x.set(e.x,e.y,1).applyMatrix3(t),e.set(x.x,x.y)}for(var r=function(e){return 0!==e.elements[1]||0!==e.elements[3]}(t),i=e.subPaths,a=0,o=i.length;a<o;a++)for(var s=i[a].curves,l=0;l<s.length;l++){var c=s[l];c.isLineCurve?(n(c.v1),n(c.v2)):c.isCubicBezierCurve?(n(c.v0),n(c.v1),n(c.v2),n(c.v3)):c.isQuadraticBezierCurve?(n(c.v0),n(c.v1),n(c.v2)):c.isEllipseCurve&&(r&&console.warn("SVGLoader: Elliptic arc or ellipse rotation or skewing is not implemented."),y.set(c.aX,c.aY),n(y),c.aX=y.x,c.aY=y.y,c.xRadius*=(h=t.elements,Math.sqrt(h[0]*h[0]+h[1]*h[1])),c.yRadius*=(u=t.elements,Math.sqrt(u[3]*u[3]+u[4]*u[4])))}var u,h}(R,_),h.push(R),R.userData={node:t,style:r}),O)for(var N=t.childNodes,k=0;k<N.length;k++)e(N[k],r);P&&(d.pop(),0<d.length?_.copy(d[d.length-1]):_.identity())}}(b.documentElement,{fill:"#000",fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4}),{paths:h,xml:b.documentElement}},l.createShapes=function(e){var t=999999999,n={ORIGIN:0,DESTINATION:1,BETWEEN:2,LEFT:3,RIGHT:4,BEHIND:5,BEYOND:6},r={loc:n.ORIGIN,t:0};function i(e,t,i,o){var s=e.x,l=t.x,c=i.x,u=o.x,h=e.y,p=t.y,d=i.y,f=o.y,m=(u-c)*(h-d)-(f-d)*(s-c),g=(f-d)*(l-s)-(u-c)*(p-h),v=m/g,y=((l-s)*(h-d)-(p-h)*(s-c))/g;if(0==g&&0!=m||v<=0||1<=v||y<0||1<y)return null;if(0==m&&0==g){for(var x=0;x<2;x++){if(a(0===x?i:o,e,t),r.loc==n.ORIGIN)return{x:(_=0===x?i:o).x,y:_.y,t:r.t};if(r.loc==n.BETWEEN)return{x:+(s+r.t*(l-s)).toPrecision(10),y:+(h+r.t*(p-h)).toPrecision(10),t:r.t}}return null}for(x=0;x<2;x++){var _;if(a(0===x?i:o,e,t),r.loc==n.ORIGIN)return{x:(_=0===x?i:o).x,y:_.y,t:r.t}}return{x:+(s+v*(l-s)).toPrecision(10),y:+(h+v*(p-h)).toPrecision(10),t:v}}function a(e,t,i){var a,o=i.x-t.x,s=i.y-t.y,l=e.x-t.x,c=e.y-t.y,u=o*c-l*s;return e.x===t.x&&e.y===t.y?(r.loc=n.ORIGIN,r.t=0):e.x===i.x&&e.y===i.y?(r.loc=n.DESTINATION,r.t=1,0):void(u<-Number.EPSILON?r.loc=n.LEFT:u>Number.EPSILON?r.loc=n.RIGHT:o*l<0||s*c<0?r.loc=n.BEHIND:Math.sqrt(o*o+s*s)<Math.sqrt(l*l+c*c)?r.loc=n.BEYOND:(a=0!=o?l/o:c/s,r.loc=n.BETWEEN,r.t=a))}function s(e,t,n){var r=new o.Vector2;t.getCenter(r);var a=[];return n.forEach(function(t){t.boundingBox.containsPoint(r)&&function(e,t){for(var n=[],r=[],a=1;a<e.length;a++)for(var s=e[a-1],l=e[a],c=function(e){var a=t[e-1],c=t[e],u=i(s,l,a,c);null!==u&&void 0===n.find(function(e){return e.t<=u.t+Number.EPSILON&&e.t>=u.t-Number.EPSILON})&&(n.push(u),r.push(new o.Vector2(u.x,u.y)))},u=1;u<t.length;u++)c(u);return r}(e,t.points).forEach(function(e){a.push({identifier:t.identifier,isCW:t.isCW,point:e})})}),a.sort(function(e,t){return e.point.x-t.point.x}),a}var l=0,c=t,u=-t,h=e.subPaths.map(function(e){for(var n=e.getPoints(),r=-t,i=t,a=-t,s=t,h=0;h<n.length;h++){var p=n[h];p.y>r&&(r=p.y),p.y<i&&(i=p.y),p.x>a&&(a=p.x),p.x<s&&(s=p.x)}return u<=a&&(u=a+1),s<=c&&(c=s-1),{curves:e.curves,points:n,isCW:o.ShapeUtils.isClockWise(n),identifier:l++,boundingBox:new o.Box2(new o.Vector2(s,i),new o.Vector2(a,r))}}),p=(h=h.filter(function(e){return 1<e.points.length})).map(function(t){return function(e,t,n,r,i){null!=i&&""!==i||(i="nonzero");var a=new o.Vector2;e.boundingBox.getCenter(a);var l=s([new o.Vector2(n,a.y),new o.Vector2(r,a.y)],e.boundingBox,t);l.sort(function(e,t){return e.point.x-t.point.x});var c=[],u=[];l.forEach(function(t){t.identifier===e.identifier?c.push(t):u.push(t)});for(var h=c[0].point.x,p=[],d=0;d<u.length&&u[d].point.x<h;)0<p.length&&p[p.length-1]===u[d].identifier?p.pop():p.push(u[d].identifier),d++;if(p.push(e.identifier),"evenodd"===i){var f=p.length%2==0,m=p[p.length-2];return{identifier:e.identifier,isHole:f,for:m}}if("nonzero"===i){f=!0;for(var g=m=null,v=0;v<p.length;v++){var y=p[v];f?(g=t[y].isCW,f=!1,m=y):g!==t[y].isCW&&(g=t[y].isCW,f=!0)}return{identifier:e.identifier,isHole:f,for:m}}console.warn('fill-rule: "'+i+'" is currently not implemented.')}(t,h,c,u,e.userData.style.fillRule)}),d=[];return h.forEach(function(e){if(!p[e.identifier].isHole){var t=new o.Shape;t.curves=e.curves,p.filter(function(t){return t.isHole&&t.for===e.identifier}).forEach(function(e){var n=h[e.identifier],r=new o.Path;r.curves=n.curves,t.holes.push(r)}),d.push(t)}}),d},l.getStrokeStyle=function(e,t,n,r,i){return{strokeColor:t=void 0!==t?t:"#000",strokeWidth:e=void 0!==e?e:1,strokeLineJoin:n=void 0!==n?n:"miter",strokeLineCap:r=void 0!==r?r:"butt",strokeMiterLimit:i=void 0!==i?i:4}},l.pointsToStroke=function(e,t,n,r){var i=[],a=[],s=[];if(0===l.pointsToStrokeWithBuffers(e,t,n,r,i,a,s))return null;var c=new o.BufferGeometry;return c.setAttribute("position",new o.Float32BufferAttribute(i,3)),c.setAttribute("normal",new o.Float32BufferAttribute(a,3)),c.setAttribute("uv",new o.Float32BufferAttribute(s,2)),c},l.pointsToStrokeWithBuffers=function(e,t,n,r,i,a,s,l){var c=new o.Vector2,u=new o.Vector2,h=new o.Vector2,p=new o.Vector2,d=new o.Vector2,f=new o.Vector2,m=new o.Vector2,g=new o.Vector2,v=new o.Vector2,y=new o.Vector2,x=new o.Vector2,_=new o.Vector2,b=new o.Vector2,w=new o.Vector2,M=new o.Vector2,S=new o.Vector2,T=new o.Vector2;n=void 0!==n?n:12,r=void 0!==r?r:.001,l=void 0!==l?l:0;var E=(e=function(e){for(var t=!1,n=1,i=e.length-1;n<i;n++)if(e[n].distanceTo(e[n+1])<r){t=!0;break}if(!t)return e;var a=[];for(a.push(e[0]),n=1,i=e.length-1;n<i;n++)e[n].distanceTo(e[n+1])>=r&&a.push(e[n]);return a.push(e[e.length-1]),a}(e)).length;if(E<2)return 0;var C,A,L,D,P,O,R=e[0].equals(e[E-1]),I=e[0],B=t.strokeWidth/2,N=1/(E-1),k=0,F=!1,G=0,V=3*l,z=2*l;K(e[0],e[1],c).multiplyScalar(B),g.copy(e[0]).sub(c),v.copy(e[0]).add(c),y.copy(g),x.copy(v);for(var U=1;U<E;U++){C=e[U],A=U===E-1?R?e[1]:void 0:e[U+1];var j=c;if(K(I,C,j),h.copy(j).multiplyScalar(B),_.copy(C).sub(h),b.copy(C).add(h),L=k+N,D=!1,void 0!==A){K(C,A,u),h.copy(u).multiplyScalar(B),w.copy(C).sub(h),M.copy(C).add(h),P=!0,h.subVectors(A,I),j.dot(h)<0&&(P=!1),1===U&&(F=P),h.subVectors(A,C),h.normalize();var H=Math.abs(j.dot(h));if(0!==H){var W=B/H;h.multiplyScalar(-W),p.subVectors(C,I),d.copy(p).setLength(W).add(h),S.copy(d).negate();var q=d.length(),J=p.length();p.divideScalar(J),f.subVectors(A,C);var X=f.length();switch(f.divideScalar(X),p.dot(S)<J&&f.dot(S)<X&&(D=!0),T.copy(d).add(C),S.add(C),O=!1,D?P?(M.copy(S),b.copy(S)):(w.copy(S),_.copy(S)):te(),t.strokeLineJoin){case"bevel":ne(P,D,L);break;case"round":re(P,D),P?ee(C,_,w,L,0):ee(C,M,b,L,1);break;case"miter":case"miter-clip":default:var Y=B*t.strokeMiterLimit/q;if(Y<1){if("miter-clip"!==t.strokeLineJoin){ne(P,D,L);break}re(P,D),P?(f.subVectors(T,_).multiplyScalar(Y).add(_),m.subVectors(T,w).multiplyScalar(Y).add(w),Q(_,L,0),Q(f,L,0),Q(C,L,.5),Q(C,L,.5),Q(f,L,0),Q(m,L,0),Q(C,L,.5),Q(m,L,0),Q(w,L,0)):(f.subVectors(T,b).multiplyScalar(Y).add(b),m.subVectors(T,M).multiplyScalar(Y).add(M),Q(b,L,1),Q(f,L,1),Q(C,L,.5),Q(C,L,.5),Q(f,L,1),Q(m,L,1),Q(C,L,.5),Q(m,L,1),Q(M,L,1))}else D?(P?(Q(v,k,1),Q(g,k,0),Q(T,L,0),Q(v,k,1),Q(T,L,0),Q(S,L,1)):(Q(v,k,1),Q(g,k,0),Q(T,L,1),Q(g,k,0),Q(S,L,0),Q(T,L,1)),P?w.copy(T):M.copy(T)):P?(Q(_,L,0),Q(T,L,0),Q(C,L,.5),Q(C,L,.5),Q(T,L,0),Q(w,L,0)):(Q(b,L,1),Q(T,L,1),Q(C,L,.5),Q(C,L,.5),Q(T,L,1),Q(M,L,1)),O=!0}}else te()}else te();R||U!==E-1||ie(e[0],y,x,P,!0,k),k=L,I=C,g.copy(w),v.copy(M)}if(R){if(D&&i){var $=T,Z=S;F!==P&&($=S,Z=T),P?(O||F)&&(Z.toArray(i,0),Z.toArray(i,9),O&&$.toArray(i,3)):!O&&F||(Z.toArray(i,3),Z.toArray(i,9),O&&$.toArray(i,0))}}else ie(C,_,b,P,!1,L);return G;function K(e,t,n){return n.subVectors(t,e),n.set(-n.y,n.x).normalize()}function Q(e,t,n){i&&(i[V]=e.x,i[V+1]=e.y,i[V+2]=0,a&&(a[V]=0,a[V+1]=0,a[V+2]=1),V+=3,s&&(s[z]=t,s[z+1]=n,z+=2)),G+=3}function ee(e,t,r,i,a){c.copy(t).sub(e).normalize(),u.copy(r).sub(e).normalize();var o=Math.PI,s=c.dot(u);Math.abs(s)<1&&(o=Math.abs(Math.acos(s))),o/=n,h.copy(t);for(var l=0,d=n-1;l<d;l++)p.copy(h).rotateAround(e,o),Q(h,i,a),Q(p,i,a),Q(e,i,.5),h.copy(p);Q(p,i,a),Q(r,i,a),Q(e,i,.5)}function te(){Q(v,k,1),Q(g,k,0),Q(_,L,0),Q(v,k,1),Q(_,L,1),Q(b,L,0)}function ne(e,t,n){t?(e?(Q(v,k,1),Q(g,k,0),Q(_,L,0),Q(v,k,1),Q(_,L,0),Q(S,L,1),Q(_,n,0),Q(w,n,0)):(Q(v,k,1),Q(g,k,0),Q(b,L,1),Q(g,k,0),Q(S,L,0),Q(b,L,1),Q(b,n,1),Q(M,n,0)),Q(S,n,.5)):(e?(Q(_,n,0),Q(w,n,0)):(Q(b,n,1),Q(M,n,0)),Q(C,n,.5))}function re(e,t){t&&(e?(Q(v,k,1),Q(g,k,0),Q(_,L,0),Q(v,k,1),Q(_,L,0),Q(S,L,1),Q(_,k,0),Q(C,L,.5),Q(S,L,1),Q(C,L,.5),Q(w,k,0),Q(S,L,1)):(Q(v,k,1),Q(g,k,0),Q(b,L,1),Q(g,k,0),Q(S,L,0),Q(b,L,1),Q(b,k,1),Q(S,L,0),Q(C,L,.5),Q(C,L,.5),Q(S,L,0),Q(M,k,1)))}function ie(e,n,r,a,o,s){switch(t.strokeLineCap){case"round":o?ee(e,r,n,s,.5):ee(e,n,r,s,.5);break;case"square":if(o)c.subVectors(n,e),u.set(c.y,-c.x),h.addVectors(c,u).add(e),p.subVectors(u,c).add(e),a?(h.toArray(i,3),p.toArray(i,0),p.toArray(i,9)):(h.toArray(i,3),h.toArray(i,9),p.toArray(i,0));else{c.subVectors(r,e),u.set(c.y,-c.x),h.addVectors(c,u).add(e),p.subVectors(u,c).add(e);var l=i.length;a?(h.toArray(i,l-3),p.toArray(i,l-6)):(h.toArray(i,l-6),p.toArray(i,l-3)),p.toArray(i,l-12)}}}},l);function l(e){var t=a.call(this,e)||this;return t.defaultDPI=90,t.defaultUnit="px",t}n.SVGLoader=s},{three:19}],70:[function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxTest=void 0;var a,o,s,l=e("../MrxDbgUiPrBase"),c=e("../MrxDbgUiPrPoint"),u=e("../MxThreeJS"),h=e("three"),p=e("../MxFun"),d=e("../MxDbEntity"),f=(i(m,a=d.MxDbEntityUserObject),m.prototype.worldDraw=function(e){e.drawCircle(this.pt,this.r);var t=new h.Vector3(this.pt.x-this.r,this.pt.y-this.r,0),n=new h.Vector3(this.pt.x+this.r,this.pt.y+this.r,0),r=new h.Vector3(t.x,n.y),i=new h.Vector3(n.x,t.y);e.drawLine(t,r),e.drawLine(r,n),e.drawLine(n,i),e.drawLine(i,t),e.drawText("Test",e.getMxObject().screenCoordLong2Doc(50),0,t)},m.prototype.setPoint=function(e){this.pt=e},m.prototype.setR=function(e){this.r=e},m.prototype.getTypeName=function(){return"MxDbTest"},m.prototype.getGripPoints=function(){var e=[];return e.push(this.pt),e},m.prototype.moveGripPointsAt=function(e,t){return 0==e&&this.pt.add(t),!0},m.prototype.dwgIn=function(e){return a.prototype.dwgIn.call(this,e),this.pt.copy(e.pt),this.r=e.r,!0},m.prototype.dwgOut=function(e){return a.prototype.dwgOut.call(this,e),e.pt=this.pt,e.r=this.r,e},m.prototype.create=function(){return new m},m);function m(){var e=null!==a&&a.apply(this,arguments)||this;return e.pt=new h.Vector3,e.r=100,e}function g(e){var t=new c.MrxDbgUiPrPoint;t.setMessage("\n指定第一点:"),t.go(function(e){if(0==e){var n=t.value(),r=new h.Vector3;r.x=n.x,r.y=n.y;var i=new l.McEdGetPointWorldDrawObject;i.setDraw(function(e,t){t.setColor(255),t.drawLine(e,r)}),t.setUserDraw(i),t.setMessage("\n指定下一点:"),t.go(function(e){if(0==e){var r=t.value(),i=p.MxFun.getCurrentDraw(),a=u.MxThreeJS.createLine(n,r,16777215);i.addObject(a)}})}})}function v(){var e=new c.MrxDbgUiPrPoint;e.setMessage("\n指定第一点:"),e.go(function(t){if(0==t){var n=p.MxFun.getCurrentDraw(),r=new f;r.setColor(16711680),r.setPoint(e.value()),r.setR(n.screenCoordLong2Doc(100)),n.addMxEntity(r),n.addMxCurrentSelect(r.objectId())}})}function y(){var e=p.MxFun.getCurrentDraw();0==s.length?(s=e.saveMxEntityToJson(),console.log(s)):(e.eraseAllMxEntity(),e.loadMxEntityFromJson(s))}function x(){p.MxFun.getCurrentDraw().openFile("test5.dwg")}o=n.MxTest||(n.MxTest={}),s="",o.registerCommand=function(){console.log("regist mx test"),(new f).init(),p.MxFun.addCommand("MxTest_GetPoint",g),p.MxFun.addCommand("MxTest_DrawCustomEntity",v),p.MxFun.addCommand("MxTest_SaveMxDbEntityToJson",y),p.MxFun.addCommand("MxTest_OpenFile",x),p.MxFun.addWindowsEvent(function(e,t){if("mouseup"==e){if(p.MxFun.isRunningCommand())return 0;if(0!=t.button)return 0;var n=t.srcElement;if(n&&"CANVAS"==n.tagName){var r=p.MxFun.getCurrentDraw(),i=new h.Vector3(t.offsetX,t.offsetY,0);r.findMxEntityAtPoint(i,!1).length&&t.preventDefault()}return 0}})}},{"../MrxDbgUiPrBase":22,"../MrxDbgUiPrPoint":23,"../MxDbEntity":35,"../MxFun":45,"../MxThreeJS":58,three:19}]},{},[67])}function mxcadassemblyinit(){var e,t=(e="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,"undefined"!=typeof __filename&&(e=e||__filename),function(t){var n,r,i;t=t||{},n||(n=void 0!==t?t:{}),n.ready=new Promise(function(e,t){r=e,i=t});var a,o,s,l,c,u,h=Object.assign({},n),p="object"==typeof window,d="function"==typeof importScripts,f="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m="";f?(m=d?xxxxx("path").dirname(m)+"/":__dirname+"/",u=(()=>{c||(l=xxxxx("fs"),c=xxxxx("path"))}),a=function(e,t){var n=W(e);return n?t?n:n.toString():(u(),e=c.normalize(e),l.readFileSync(e,t?void 0:"utf8"))},s=(e=>((e=a(e,!0)).buffer||(e=new Uint8Array(e)),e)),o=((e,t,n)=>{var r=W(e);r&&t(r),u(),e=c.normalize(e),l.readFile(e,function(e,r){e?n(e):t(r.buffer)})}),1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(e){throw e}),process.on("unhandledRejection",function(e){throw e}),n.inspect=function(){return"[Emscripten Module object]"}):(p||d)&&(d?m=self.location.href:"undefined"!=typeof document&&document.currentScript&&(m=document.currentScript.src),e&&(m=e),m=0!==m.indexOf("blob:")?m.substr(0,m.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=(e=>{try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText}catch(i){if(e=W(e)){t=[];for(var n=0;n<e.length;n++){var r=e[n];255<r&&(r&=255),t.push(String.fromCharCode(r))}return t.join("")}throw i}}),d&&(s=(e=>{try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}catch(t){if(e=W(e))return e;throw t}})),o=((e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=(()=>{if(200==r.status||0==r.status&&r.response)t(r.response);else{var i=W(e);i?t(i.buffer):n()}}),r.onerror=n,r.send(null)})),n.print||console.log.bind(console);var g,v=n.printErr||console.warn.bind(console);function y(){this.exports=function(e){for(var t,n=new Uint8Array(123),r=25;r>=0;--r)n[48+r]=52+r,n[65+r]=r,n[97+r]=26+r;function i(e,t,r){for(var i,a,o=0,s=t,l=r.length,c=t+(3*l>>2)-("="==r[l-2])-("="==r[l-1]);o<l;o+=4)i=n[r.charCodeAt(o+1)],a=n[r.charCodeAt(o+2)],e[s++]=n[r.charCodeAt(o)]<<2|i>>4,s<c&&(e[s++]=i<<4|a>>2),s<c&&(e[s++]=a<<6|n[r.charCodeAt(o+3)])}return n[43]=62,n[47]=63,function(e){var n=e.a.buffer,r=new Int8Array(n),a=new Int16Array(n),o=new Int32Array(n),s=new Uint8Array(n),l=new Uint32Array(n),c=new Float64Array(n),u=Math.imul,h=e.abort,p=e.b,d=e.c,f=e.d,m=e.e,g=e.f,v=5245008;function y(e){var t,n=0,r=0,i=0,a=0,c=0,u=0,h=0,p=0,d=0,f=0;v=t=v-16|0;e:{t:{n:{r:{i:{a:{o:{s:{l:{c:{u:{if((e|=0)>>>0<=244){if(3&(n=(a=o[404])>>>(r=(u=e>>>0<11?16:e+11&-8)>>>3|0)|0)){e=(c=o[1664+(n=(i=r+(1&(-1^n))|0)<<3)>>2])+8|0,(0|(r=o[c+8>>2]))!=(0|(n=n+1656|0))?(o[r+12>>2]=n,o[n+8>>2]=r):o[404]=L(i)&a,n=i<<3,o[c+4>>2]=3|n,o[4+(n=n+c|0)>>2]=1|o[n+4>>2];break e}if((f=o[406])>>>0>=u>>>0)break u;if(n){r=e=(n=(0-(e=(0-(e=2<<r)|e)&n<<r)&e)-1|0)>>>12&16,r|=e=(n=n>>>e|0)>>>5&8,r|=e=(n=n>>>e|0)>>>2&4,d=o[1664+(e=(r=((r|=e=(n=n>>>e|0)>>>1&2)|(e=(n=n>>>e|0)>>>1&1))+(n>>>e|0)|0)<<3)>>2],(0|(n=o[d+8>>2]))!=(0|(e=e+1656|0))?(o[n+12>>2]=e,o[e+8>>2]=n):(a=L(r)&a,o[404]=a),e=d+8|0,o[d+4>>2]=3|u,c=(n=r<<3)-u|0,o[4+(i=u+d|0)>>2]=1|c,o[n+d>>2]=c,f&&(r=1656+((n=f>>>3|0)<<3)|0,d=o[409],(n=1<<n)&a?n=o[r+8>>2]:(o[404]=n|a,n=r),o[r+8>>2]=d,o[n+12>>2]=d,o[d+12>>2]=r,o[d+8>>2]=n),o[409]=i,o[406]=c;break e}if(!(h=o[405]))break u;for(r=e=(n=(0-h&h)-1|0)>>>12&16,r|=e=(n=n>>>e|0)>>>5&8,r|=e=(n=n>>>e|0)>>>2&4,n=o[1920+(((r|=e=(n=n>>>e|0)>>>1&2)|(e=(n=n>>>e|0)>>>1&1))+(n>>>e|0)<<2)>>2],i=(-8&o[n+4>>2])-u|0,r=n;(e=o[r+16>>2])||(e=o[r+20>>2]);)i=(c=(r=(-8&o[e+4>>2])-u|0)>>>0<i>>>0)?r:i,n=c?e:n,r=e;if(p=o[n+24>>2],(0|(c=o[n+12>>2]))!=(0|n)){e=o[n+8>>2],o[e+12>>2]=c,o[c+8>>2]=e;break t}if(!(e=o[(r=n+20|0)>>2])){if(!(e=o[n+16>>2]))break c;r=n+16|0}for(;d=r,c=e,(e=o[(r=e+20|0)>>2])||(r=c+16|0,e=o[c+16>>2]););o[d>>2]=0;break t}if(u=-1,!(e>>>0>4294967231)&&(u=-8&(e=e+11|0),p=o[405])){i=0-u|0,a=0,u>>>0<256||(a=31,u>>>0>16777215||(e=e>>>8|0,e<<=d=e+1048320>>>16&8,a=28+((e=((e<<=r=e+520192>>>16&4)<<(n=e+245760>>>16&2)>>>15|0)-(n|r|d)|0)<<1|u>>>e+21&1)|0)),r=o[1920+(a<<2)>>2];h:{p:{if(r)for(e=0,n=u<<(31==(0|a)?0:25-(a>>>1|0)|0);;){if(!((d=(h=-8&o[r+4>>2])-u|0)>>>0>=i>>>0)&&(i=d,c=r,(0|u)==(0|h))){i=0,e=r;break p}if(d=o[r+20>>2],r=o[16+((n>>>29&4)+r|0)>>2],e=d?(0|d)==(0|r)?e:d:e,n<<=1,!r)break}else e=0;if(!(e|c)){if(c=0,!(e=(0-(e=2<<a)|e)&p))break u;r=e=(n=(e&0-e)-1|0)>>>12&16,r|=e=(n=n>>>e|0)>>>5&8,r|=e=(n=n>>>e|0)>>>2&4,e=o[1920+(((r|=e=(n=n>>>e|0)>>>1&2)|(e=(n=n>>>e|0)>>>1&1))+(n>>>e|0)<<2)>>2]}if(!e)break h}for(;i=(r=(n=(-8&o[e+4>>2])-u|0)>>>0<i>>>0)?n:i,c=r?e:c,e=(n=o[e+16>>2])||o[e+20>>2];);}if(!(!c|o[406]-u>>>0<=i>>>0)){if(a=o[c+24>>2],(0|c)!=(0|(n=o[c+12>>2]))){e=o[c+8>>2],o[e+12>>2]=n,o[n+8>>2]=e;break n}if(!(e=o[(r=c+20|0)>>2])){if(!(e=o[c+16>>2]))break l;r=c+16|0}for(;d=r,n=e,(e=o[(r=e+20|0)>>2])||(r=n+16|0,e=o[n+16>>2]););o[d>>2]=0;break n}}}if((r=o[406])>>>0>=u>>>0){i=o[409],(n=r-u|0)>>>0>=16?(o[406]=n,e=i+u|0,o[409]=e,o[e+4>>2]=1|n,o[r+i>>2]=n,o[i+4>>2]=3|u):(o[409]=0,o[406]=0,o[i+4>>2]=3|r,o[4+(e=r+i|0)>>2]=1|o[e+4>>2]),e=i+8|0;break e}if((p=o[407])>>>0>u>>>0){n=p-u|0,o[407]=n,e=(r=o[410])+u|0,o[410]=e,o[e+4>>2]=1|n,o[r+4>>2]=3|u,e=r+8|0;break e}if(e=0,h=u+47|0,o[522]?r=o[524]:(o[525]=-1,o[526]=-1,o[523]=4096,o[524]=4096,o[522]=t+12&-16^1431655768,o[527]=0,o[515]=0,r=4096),(r=(d=h+r|0)&(c=0-r|0))>>>0<=u>>>0)break e;if((i=o[514])&&(a=(n=o[512])+r|0)>>>0>i>>>0|n>>>0>=a>>>0)break e;if(4&s[2060])break a;u:{h:{if(i=o[410])for(e=2064;;){if((n=o[e>>2])>>>0<=i>>>0&i>>>0<n+o[e+4>>2]>>>0)break h;if(!(e=o[e+8>>2]))break}if(-1==(0|(n=E(0))))break o;if(a=r,(e=(i=o[523])-1|0)&n&&(a=(r-n|0)+(e+n&0-i)|0),a>>>0<=u>>>0|a>>>0>2147483646)break o;if((i=o[514])&&i>>>0<(c=(e=o[512])+a|0)>>>0|e>>>0>=c>>>0)break o;if((0|n)!=(0|(e=E(a))))break u;break i}if((a=c&d-p)>>>0>2147483646)break o;if((0|(n=E(a)))==(o[e>>2]+o[e+4>>2]|0))break s;e=n}if(!(-1==(0|e)|u+48>>>0<=a>>>0)){if((n=(n=o[524])+(h-a|0)&0-n)>>>0>2147483646){n=e;break i}if(-1!=(0|E(n))){a=n+a|0,n=e;break i}E(0-a|0);break o}if(n=e,-1!=(0|e))break i;break o}c=0;break t}n=0;break n}if(-1!=(0|n))break i}o[515]=4|o[515]}if(r>>>0>2147483646)break r;if(-1==(0|(n=E(r)))|-1==(0|(e=E(0)))|e>>>0<=n>>>0)break r;if((a=e-n|0)>>>0<=u+40>>>0)break r}e=o[512]+a|0,o[512]=e,e>>>0>l[513]&&(o[513]=e);i:{a:{o:{if(h=o[410]){for(e=2064;;){if(((i=o[e>>2])+(r=o[e+4>>2])|0)==(0|n))break o;if(!(e=o[e+8>>2]))break}break a}for((e=o[408])>>>0<=n>>>0&&e||(o[408]=n),e=0,o[517]=a,o[516]=n,o[412]=-1,o[413]=o[522],o[519]=0;r=1656+(i=e<<3)|0,o[i+1664>>2]=r,o[i+1668>>2]=r,32!=(0|(e=e+1|0)););r=(i=a-40|0)-(e=n+8&7?-8-n&7:0)|0,o[407]=r,e=e+n|0,o[410]=e,o[e+4>>2]=1|r,o[4+(n+i|0)>>2]=40,o[411]=o[526];break i}if(!(8&s[e+12|0]|i>>>0>h>>>0|n>>>0<=h>>>0)){o[e+4>>2]=r+a,r=(e=h+8&7?-8-h&7:0)+h|0,o[410]=r,e=(n=o[407]+a|0)-e|0,o[407]=e,o[r+4>>2]=1|e,o[4+(n+h|0)>>2]=40,o[411]=o[526];break i}}l[408]>n>>>0&&(o[408]=n),r=n+a|0,e=2064;a:{o:{s:{l:{c:{u:{for(;;){if((0|r)!=o[e>>2]){if(e=o[e+8>>2])continue;break u}break}if(!(8&s[e+12|0]))break c}for(e=2064;;){if((r=o[e>>2])>>>0<=h>>>0&&(c=r+o[e+4>>2]|0)>>>0>h>>>0)break l;e=o[e+8>>2]}}if(o[e>>2]=n,o[e+4>>2]=o[e+4>>2]+a,o[4+(d=(n+8&7?-8-n&7:0)+n|0)>>2]=3|u,u=(a=r+(r+8&7?-8-r&7:0)|0)-(p=u+d|0)|0,(0|a)==(0|h)){o[410]=p,e=o[407]+u|0,o[407]=e,o[p+4>>2]=1|e;break o}if(o[409]==(0|a)){o[409]=p,e=o[406]+u|0,o[406]=e,o[p+4>>2]=1|e,o[e+p>>2]=e;break o}if(1==(3&(e=o[a+4>>2]))){c=-8&e;c:if(e>>>0<=255){if(r=o[a+8>>2],e=e>>>3|0,(0|(n=o[a+12>>2]))==(0|r)){o[404]=o[404]&L(e);break c}o[r+12>>2]=n,o[n+8>>2]=r}else{if(h=o[a+24>>2],(0|a)==(0|(n=o[a+12>>2])))if((i=o[(e=a+20|0)>>2])||(i=o[(e=a+16|0)>>2])){for(;r=e,(i=o[(e=(n=i)+20|0)>>2])||(e=n+16|0,i=o[n+16>>2]););o[r>>2]=0}else n=0;else e=o[a+8>>2],o[e+12>>2]=n,o[n+8>>2]=e;if(h){r=o[a+28>>2];u:{if(o[(e=1920+(r<<2)|0)>>2]==(0|a)){if(o[e>>2]=n,n)break u;o[405]=o[405]&L(r);break c}if(o[h+(o[h+16>>2]==(0|a)?16:20)>>2]=n,!n)break c}o[n+24>>2]=h,(e=o[a+16>>2])&&(o[n+16>>2]=e,o[e+24>>2]=n),(e=o[a+20>>2])&&(o[n+20>>2]=e,o[e+24>>2]=n)}}u=c+u|0,a=a+c|0}if(o[a+4>>2]=-2&o[a+4>>2],o[p+4>>2]=1|u,o[u+p>>2]=u,u>>>0<=255){n=1656+((e=u>>>3|0)<<3)|0,(r=o[404])&(e=1<<e)?e=o[n+8>>2]:(o[404]=e|r,e=n),o[n+8>>2]=p,o[e+12>>2]=p,o[p+12>>2]=n,o[p+8>>2]=e;break o}if(e=31,u>>>0<=16777215&&(e=u>>>8|0,e<<=i=e+1048320>>>16&8,e=28+((e=((e<<=r=e+520192>>>16&4)<<(n=e+245760>>>16&2)>>>15|0)-(n|r|i)|0)<<1|u>>>e+21&1)|0),o[p+28>>2]=e,o[p+16>>2]=0,o[p+20>>2]=0,i=1920+(e<<2)|0,(r=o[405])&(n=1<<e)){for(e=u<<(31==(0|e)?0:25-(e>>>1|0)|0),n=o[i>>2];;){if(r=n,(-8&o[n+4>>2])==(0|u))break s;if(n=e>>>29|0,e<<=1,!(n=o[16+(i=r+(4&n)|0)>>2]))break}o[i+16>>2]=p,o[p+24>>2]=r}else o[405]=n|r,o[i>>2]=p,o[p+24>>2]=i;o[p+12>>2]=p,o[p+8>>2]=p;break o}for(r=(i=a-40|0)-(e=n+8&7?-8-n&7:0)|0,o[407]=r,e=e+n|0,o[410]=e,o[e+4>>2]=1|r,o[4+(n+i|0)>>2]=40,o[411]=o[526],o[(r=(e=(c+(c-39&7?39-c&7:0)|0)-47|0)>>>0<h+16>>>0?h:e)+4>>2]=27,e=o[519],o[r+16>>2]=o[518],o[r+20>>2]=e,e=o[517],o[r+8>>2]=o[516],o[r+12>>2]=e,o[518]=r+8,o[517]=a,o[516]=n,o[519]=0,e=r+24|0;o[e+4>>2]=7,n=e+8|0,e=e+4|0,n>>>0<c>>>0;);if((0|r)==(0|h))break i;if(o[r+4>>2]=-2&o[r+4>>2],c=r-h|0,o[h+4>>2]=1|c,o[r>>2]=c,c>>>0<=255){n=1656+((e=c>>>3|0)<<3)|0,(r=o[404])&(e=1<<e)?e=o[n+8>>2]:(o[404]=e|r,e=n),o[n+8>>2]=h,o[e+12>>2]=h,o[h+12>>2]=n,o[h+8>>2]=e;break i}if(e=31,o[h+16>>2]=0,o[h+20>>2]=0,c>>>0<=16777215&&(e=c>>>8|0,e<<=i=e+1048320>>>16&8,e=28+((e=((e<<=r=e+520192>>>16&4)<<(n=e+245760>>>16&2)>>>15|0)-(n|r|i)|0)<<1|c>>>e+21&1)|0),o[h+28>>2]=e,i=1920+(e<<2)|0,(r=o[405])&(n=1<<e)){for(e=c<<(31==(0|e)?0:25-(e>>>1|0)|0),n=o[i>>2];;){if(r=n,(0|c)==(-8&o[n+4>>2]))break a;if(n=e>>>29|0,e<<=1,!(n=o[16+(i=r+(4&n)|0)>>2]))break}o[i+16>>2]=h,o[h+24>>2]=r}else o[405]=n|r,o[i>>2]=h,o[h+24>>2]=i;o[h+12>>2]=h,o[h+8>>2]=h;break i}e=o[r+8>>2],o[e+12>>2]=p,o[r+8>>2]=p,o[p+24>>2]=0,o[p+12>>2]=r,o[p+8>>2]=e}e=d+8|0;break e}e=o[r+8>>2],o[e+12>>2]=h,o[r+8>>2]=h,o[h+24>>2]=0,o[h+12>>2]=r,o[h+8>>2]=e}if(!((e=o[407])>>>0<=u>>>0)){n=e-u|0,o[407]=n,e=(r=o[410])+u|0,o[410]=e,o[e+4>>2]=1|n,o[r+4>>2]=3|u,e=r+8|0;break e}}o[403]=48,e=0;break e}n:if(a){r=o[c+28>>2];r:{if(o[(e=1920+(r<<2)|0)>>2]==(0|c)){if(o[e>>2]=n,n)break r;p=L(r)&p,o[405]=p;break n}if(o[a+(o[a+16>>2]==(0|c)?16:20)>>2]=n,!n)break n}o[n+24>>2]=a,(e=o[c+16>>2])&&(o[n+16>>2]=e,o[e+24>>2]=n),(e=o[c+20>>2])&&(o[n+20>>2]=e,o[e+24>>2]=n)}n:if(i>>>0<=15)e=i+u|0,o[c+4>>2]=3|e,o[4+(e=e+c|0)>>2]=1|o[e+4>>2];else if(o[c+4>>2]=3|u,o[4+(a=c+u|0)>>2]=1|i,o[a+i>>2]=i,i>>>0<=255)n=1656+((e=i>>>3|0)<<3)|0,(r=o[404])&(e=1<<e)?e=o[n+8>>2]:(o[404]=e|r,e=n),o[n+8>>2]=a,o[e+12>>2]=a,o[a+12>>2]=n,o[a+8>>2]=e;else{e=31,i>>>0<=16777215&&(e=i>>>8|0,e<<=d=e+1048320>>>16&8,e=28+((e=((e<<=r=e+520192>>>16&4)<<(n=e+245760>>>16&2)>>>15|0)-(n|r|d)|0)<<1|i>>>e+21&1)|0),o[a+28>>2]=e,o[a+16>>2]=0,o[a+20>>2]=0,n=1920+(e<<2)|0;r:{if((r=1<<e)&p){for(e=i<<(31==(0|e)?0:25-(e>>>1|0)|0),r=o[n>>2];;){if((-8&o[(n=r)+4>>2])==(0|i))break r;if(r=e>>>29|0,e<<=1,!(r=o[16+(d=(4&r)+n|0)>>2]))break}o[d+16>>2]=a}else o[405]=r|p,o[n>>2]=a;o[a+24>>2]=n,o[a+12>>2]=a,o[a+8>>2]=a;break n}e=o[n+8>>2],o[e+12>>2]=a,o[n+8>>2]=a,o[a+24>>2]=0,o[a+12>>2]=n,o[a+8>>2]=e}e=c+8|0;break e}t:if(p){r=o[n+28>>2];n:{if(o[(e=1920+(r<<2)|0)>>2]==(0|n)){if(o[e>>2]=c,c)break n;o[405]=L(r)&h;break t}if(o[p+(o[p+16>>2]==(0|n)?16:20)>>2]=c,!c)break t}o[c+24>>2]=p,(e=o[n+16>>2])&&(o[c+16>>2]=e,o[e+24>>2]=c),(e=o[n+20>>2])&&(o[c+20>>2]=e,o[e+24>>2]=c)}i>>>0<=15?(e=i+u|0,o[n+4>>2]=3|e,o[4+(e=e+n|0)>>2]=1|o[e+4>>2]):(o[n+4>>2]=3|u,o[4+(c=n+u|0)>>2]=1|i,o[i+c>>2]=i,f&&(r=1656+((e=f>>>3|0)<<3)|0,d=o[409],(e=1<<e)&a?e=o[r+8>>2]:(o[404]=e|a,e=r),o[r+8>>2]=d,o[e+12>>2]=d,o[d+12>>2]=r,o[d+8>>2]=e),o[409]=c,o[406]=i),e=n+8|0}return v=t+16|0,0|e}function x(e){var t=0,n=0,r=0,i=0,a=0,s=0,c=0;e:if(e){a=(r=e-8|0)+(e=-8&(t=o[e-4>>2]))|0;t:if(!(1&t)){if(!(3&t))break e;if((r=r-(t=o[r>>2])|0)>>>0<l[408])break e;if(e=e+t|0,o[409]==(0|r)){if(3==(3&(t=o[a+4>>2])))return o[406]=e,o[a+4>>2]=-2&t,o[r+4>>2]=1|e,void(o[e+r>>2]=e)}else{if(t>>>0<=255){if(i=o[r+8>>2],t=t>>>3|0,(0|(n=o[r+12>>2]))==(0|i)){o[404]=o[404]&L(t);break t}o[i+12>>2]=n,o[n+8>>2]=i;break t}if(c=o[r+24>>2],(0|r)==(0|(t=o[r+12>>2])))if((n=o[(i=r+20|0)>>2])||(n=o[(i=r+16|0)>>2])){for(;s=i,(n=o[(i=(t=n)+20|0)>>2])||(i=t+16|0,n=o[t+16>>2]););o[s>>2]=0}else t=0;else n=o[r+8>>2],o[n+12>>2]=t,o[t+8>>2]=n;if(!c)break t;i=o[r+28>>2];n:{if(o[(n=1920+(i<<2)|0)>>2]==(0|r)){if(o[n>>2]=t,t)break n;o[405]=o[405]&L(i);break t}if(o[c+(o[c+16>>2]==(0|r)?16:20)>>2]=t,!t)break t}if(o[t+24>>2]=c,(n=o[r+16>>2])&&(o[t+16>>2]=n,o[n+24>>2]=t),!(n=o[r+20>>2]))break t;o[t+20>>2]=n,o[n+24>>2]=t}}if(!(r>>>0>=a>>>0)&&1&(t=o[a+4>>2])){t:{if(!(2&t)){if(o[410]==(0|a)){if(o[410]=r,e=o[407]+e|0,o[407]=e,o[r+4>>2]=1|e,o[409]!=(0|r))break e;return o[406]=0,void(o[409]=0)}if(o[409]==(0|a))return o[409]=r,e=o[406]+e|0,o[406]=e,o[r+4>>2]=1|e,void(o[e+r>>2]=e);e=(-8&t)+e|0;n:if(t>>>0<=255){if(i=o[a+8>>2],t=t>>>3|0,(0|(n=o[a+12>>2]))==(0|i)){o[404]=o[404]&L(t);break n}o[i+12>>2]=n,o[n+8>>2]=i}else{if(c=o[a+24>>2],(0|a)==(0|(t=o[a+12>>2])))if((n=o[(i=a+20|0)>>2])||(n=o[(i=a+16|0)>>2])){for(;s=i,(n=o[(i=(t=n)+20|0)>>2])||(i=t+16|0,n=o[t+16>>2]););o[s>>2]=0}else t=0;else n=o[a+8>>2],o[n+12>>2]=t,o[t+8>>2]=n;if(c){i=o[a+28>>2];r:{if(o[(n=1920+(i<<2)|0)>>2]==(0|a)){if(o[n>>2]=t,t)break r;o[405]=o[405]&L(i);break n}if(o[c+(o[c+16>>2]==(0|a)?16:20)>>2]=t,!t)break n}o[t+24>>2]=c,(n=o[a+16>>2])&&(o[t+16>>2]=n,o[n+24>>2]=t),(n=o[a+20>>2])&&(o[t+20>>2]=n,o[n+24>>2]=t)}}if(o[r+4>>2]=1|e,o[e+r>>2]=e,o[409]!=(0|r))break t;return void(o[406]=e)}o[a+4>>2]=-2&t,o[r+4>>2]=1|e,o[e+r>>2]=e}if(e>>>0<=255)return t=1656+((e=e>>>3|0)<<3)|0,(n=o[404])&(e=1<<e)?e=o[t+8>>2]:(o[404]=e|n,e=t),o[t+8>>2]=r,o[e+12>>2]=r,o[r+12>>2]=t,void(o[r+8>>2]=e);i=31,o[r+16>>2]=0,o[r+20>>2]=0,e>>>0<=16777215&&(t=e>>>8|0,t<<=s=t+1048320>>>16&8,i=28+((t=((t<<=i=t+520192>>>16&4)<<(n=t+245760>>>16&2)>>>15|0)-(n|i|s)|0)<<1|e>>>t+21&1)|0),o[r+28>>2]=i,s=1920+(i<<2)|0;t:{n:{if((n=o[405])&(t=1<<i)){for(i=e<<(31==(0|i)?0:25-(i>>>1|0)|0),t=o[s>>2];;){if(n=t,(-8&o[t+4>>2])==(0|e))break n;if(t=i>>>29|0,i<<=1,!(t=o[16+(s=n+(4&t)|0)>>2]))break}o[s+16>>2]=r,o[r+24>>2]=n}else o[405]=t|n,o[s>>2]=r,o[r+24>>2]=s;o[r+12>>2]=r,o[r+8>>2]=r;break t}e=o[n+8>>2],o[e+12>>2]=r,o[n+8>>2]=r,o[r+24>>2]=0,o[r+12>>2]=n,o[r+8>>2]=e}e=o[412]-1|0,o[412]=e||-1}}}function _(e,t,n){var i,a=0,l=0;if(n>>>0>=512)return f(0|e,0|t,0|n),e;i=e+n|0;e:if(3&(e^t))if(i>>>0<4)n=e;else if((a=i-4|0)>>>0<e>>>0)n=e;else for(n=e;r[0|n]=s[0|t],r[n+1|0]=s[t+1|0],r[n+2|0]=s[t+2|0],r[n+3|0]=s[t+3|0],t=t+4|0,a>>>0>=(n=n+4|0)>>>0;);else{t:if(3&e)if(n)for(n=e;;){if(r[0|n]=s[0|t],t=t+1|0,!(3&(n=n+1|0)))break t;if(!(n>>>0<i>>>0))break}else n=e;else n=e;if(!((a=-4&i)>>>0<64||(l=a+-64|0)>>>0<n>>>0))for(;o[n>>2]=o[t>>2],o[n+4>>2]=o[t+4>>2],o[n+8>>2]=o[t+8>>2],o[n+12>>2]=o[t+12>>2],o[n+16>>2]=o[t+16>>2],o[n+20>>2]=o[t+20>>2],o[n+24>>2]=o[t+24>>2],o[n+28>>2]=o[t+28>>2],o[n+32>>2]=o[t+32>>2],o[n+36>>2]=o[t+36>>2],o[n+40>>2]=o[t+40>>2],o[n+44>>2]=o[t+44>>2],o[n+48>>2]=o[t+48>>2],o[n+52>>2]=o[t+52>>2],o[n+56>>2]=o[t+56>>2],o[n+60>>2]=o[t+60>>2],t=t- -64|0,l>>>0>=(n=n- -64|0)>>>0;);if(n>>>0>=a>>>0)break e;for(;o[n>>2]=o[t>>2],t=t+4|0,a>>>0>(n=n+4|0)>>>0;);}if(n>>>0<i>>>0)for(;r[0|n]=s[0|t],t=t+1|0,(0|i)!=(0|(n=n+1|0)););return e}function b(e,t){var n=0;if(t&&(r[0|e]=0,r[(n=e+t|0)-1|0]=0,!(t>>>0<3||(r[e+2|0]=0,r[e+1|0]=0,r[n-3|0]=0,r[n-2|0]=0,t>>>0<7||(r[e+3|0]=0,r[n-4|0]=0,t>>>0<9||(o[(e=(n=0-e&3)+e|0)>>2]=0,o[(t=(n=t-n&-4)+e|0)-4>>2]=0,n>>>0<9||(o[e+8>>2]=0,o[e+4>>2]=0,o[t-8>>2]=0,o[t-12>>2]=0,n>>>0<25||(o[e+24>>2]=0,o[e+20>>2]=0,o[e+16>>2]=0,o[e+12>>2]=0,o[t-16>>2]=0,o[t-20>>2]=0,o[t-24>>2]=0,o[t-28>>2]=0,(t=(t=n)-(n=4&e|24)|0)>>>0<32))))))))for(e=e+n|0;o[e+24>>2]=0,o[e+28>>2]=0,o[e+16>>2]=0,o[e+20>>2]=0,o[e+8>>2]=0,o[e+12>>2]=0,o[e>>2]=0,o[e+4>>2]=0,e=e+32|0,(t=t-32|0)>>>0>31;);}function w(e){var t,n=0,r=0,i=0;t=0|g(8),o[t>>2]=1348,o[t>>2]=1392;e:{t:{if(3&(n=e))for(;;){if(!s[0|n])break t;if(!(3&(n=n+1|0)))break}for(;r=n,n=n+4|0,!((-1^(i=o[r>>2]))&i-16843009&-2139062144););if(n=r-e|0,!(255&i))break e;for(;i=s[r+1|0],r=n=r+1|0,i;);}n=n-e|0}r=C(n+13|0),o[r+8>>2]=0,o[r+4>>2]=n,o[r>>2]=n,o[t+4>>2]=_(r+12|0,e,n+1|0),o[t>>2]=1440,m(0|t,1472,1),h()}function M(e,t,n,i){r[e+53|0]=1;e:if(o[e+4>>2]==(0|n)){r[e+52|0]=1,n=o[e+16>>2];t:{if(!n){if(o[e+36>>2]=1,o[e+24>>2]=i,o[e+16>>2]=t,1!=(0|i))break e;if(1==o[e+48>>2])break t;break e}if((0|t)==(0|n)){if(2==(0|(n=o[e+24>>2]))&&(o[e+24>>2]=i,n=i),1!=o[e+48>>2])break e;if(1==(0|n))break t;break e}o[e+36>>2]=o[e+36>>2]+1}r[e+54|0]=1}}function S(e,t,n){var r=0;if(!n)return o[e+4>>2]==o[t+4>>2];if((0|e)==(0|t))return 1;r=o[e+4>>2],e=s[0|r],n=o[t+4>>2],t=s[0|n];e:if(!(!e|(0|t)!=(0|e)))for(;;){if(t=s[n+1|0],!(e=s[r+1|0]))break e;if(n=n+1|0,r=r+1|0,(0|e)!=(0|t))break}return(0|e)==(0|t)}function T(e,t,n){var i;if(!(i=o[e+16>>2]))return o[e+36>>2]=1,o[e+24>>2]=n,void(o[e+16>>2]=t);e:{if((0|t)==(0|i)){if(2!=o[e+24>>2])break e;return void(o[e+24>>2]=n)}r[e+54|0]=1,o[e+24>>2]=2,o[e+36>>2]=o[e+36>>2]+1}}function E(e){var t,r;return(e=(t=o[377])+(r=e+3&-4)|0)>>>0<=t>>>0&&r||e>>>0>(n.byteLength/65536|0)<<16>>>0&&!(0|p(0|e))?(o[403]=48,-1):(o[377]=e,t)}function C(e){var t=0;e=e||1;e:{for(;;){if(t=y(e))break e;if(!(t=o[528]))break;N[0|t]()}d(),h()}return t}function A(e){var t,n;return o[(e|=0)>>2]=1392,t=o[e+4>>2]-12|0,n=o[t+8>>2]-1|0,o[t+8>>2]=n,(0|n)<0&&x(t),0|e}function L(e){var t;return(-1>>>(t=31&e)&-2)<<t|(-1<<(e=0-e&31)&-2)>>>e}function D(e){(e|=0)&&x(e)}function P(e){A(e|=0),x(e)}function O(e){return 0|(e|=0)}function R(e){x(e|=0)}function I(e){}i(t=s,1024,"dmVjdG9yAHN0ZDo6ZXhjZXB0aW9uAGFsbG9jYXRvcjxUPjo6YWxsb2NhdGUoc2l6ZV90IG4pICduJyBleGNlZWRzIG1heGltdW0gc3VwcG9ydGVkIHNpemUATjEwX19jeHhhYml2MTE2X19zaGltX3R5cGVfaW5mb0UAAOgEAABaBAAA3AUAAE4xMF9fY3h4YWJpdjExN19fY2xhc3NfdHlwZV9pbmZvRQAAAOgEAACIBAAAfAQAAAAAAACsBAAAAgAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAAAAAAMAUAAAIAAAAKAAAABAAAAAUAAAAGAAAACwAAAAwAAAANAAAATjEwX19jeHhhYml2MTIwX19zaV9jbGFzc190eXBlX2luZm9FAAAAAOgEAAAIBQAArAQAAAAAAABgBQAADgAAAA8AAAAQAAAAU3Q5ZXhjZXB0aW9uAAAAAMAEAABQBQAAAAAAAIwFAAABAAAAEQAAABIAAABTdDExbG9naWNfZXJyb3IA6AQAAHwFAABgBQAAAAAAAMAFAAABAAAAEwAAABIAAABTdDEybGVuZ3RoX2Vycm9yAAAAAOgEAACsBQAAjAUAAFN0OXR5cGVfaW5mbwAAAADABAAAzAU="),i(t,1508,"UAhQ");var B,N=((B=[null,A,O,R,I,I,function(e,t,n){n|=0;var r,i=0,a=0,s=0,l=0;if(v=r=v+-64|0,i=1,!S(e|=0,t|=0,0)&&(i=0,t)){v=i=v+-64|0,a=o[t>>2],s=o[a-4>>2],l=o[a-8>>2],o[i+20>>2]=0,o[i+16>>2]=1148,o[i+12>>2]=t,o[i+8>>2]=1196,a=0,b(i+24|0,39),t=t+l|0;e:if(S(s,1196,0))o[i+56>>2]=1,N[o[o[s>>2]+20>>2]](s,i+8|0,t,t,1,0),a=1==o[i+32>>2]?t:0;else{N[o[o[s>>2]+24>>2]](s,i+8|0,t,1,0);t:switch(o[i+44>>2]){case 0:a=1==o[i+48>>2]&&1==o[i+36>>2]&&1==o[i+40>>2]?o[i+28>>2]:0;break e;case 1:break t;default:break e}1!=o[i+32>>2]&&o[i+48>>2]|1!=o[i+36>>2]|1!=o[i+40>>2]||(a=o[i+24>>2])}v=i- -64|0,i=0,a&&(b(4|(t=r+8|0),52),o[r+56>>2]=1,o[r+20>>2]=-1,o[r+16>>2]=e,o[r+8>>2]=a,N[o[o[a>>2]+28>>2]](a,t,o[n>>2],1),1==(0|(e=o[r+32>>2]))&&(o[n>>2]=o[r+24>>2]),i=1==(0|e))}return v=r- -64|0,0|i},function(e,t,n,r,i,a){n|=0,r|=0,i|=0,a|=0,S(e|=0,o[8+(t|=0)>>2],a)&&M(t,n,r,i)},function(e,t,n,i,a){if(n|=0,i|=0,a|=0,S(e|=0,o[8+(t|=0)>>2],a))1==o[t+28>>2]|o[t+4>>2]!=(0|n)||(o[t+28>>2]=i);else e:if(S(e,o[t>>2],a)){if(!(o[t+16>>2]!=(0|n)&o[t+20>>2]!=(0|n))){if(1!=(0|i))break e;return void(o[t+32>>2]=1)}o[t+20>>2]=n,o[t+32>>2]=i,o[t+40>>2]=o[t+40>>2]+1,1!=o[t+36>>2]|2!=o[t+24>>2]||(r[t+54|0]=1),o[t+44>>2]=4}},function(e,t,n,r){n|=0,r|=0,S(e|=0,o[8+(t|=0)>>2],0)&&T(t,n,r)},R,function(e,t,n,r,i,a){n|=0,r|=0,i|=0,a|=0,S(e|=0,o[8+(t|=0)>>2],a)?M(t,n,r,i):(e=o[e+8>>2],N[o[o[e>>2]+20>>2]](e,t,n,r,i,a))},function(e,t,n,i,l){if(n|=0,i|=0,l|=0,S(e|=0,o[8+(t|=0)>>2],l))1==o[t+28>>2]|o[t+4>>2]!=(0|n)||(o[t+28>>2]=i);else e:{if(S(e,o[t>>2],l)){if(!(o[t+16>>2]!=(0|n)&o[t+20>>2]!=(0|n))){if(1!=(0|i))break e;return void(o[t+32>>2]=1)}o[t+32>>2]=i;t:if(4!=o[t+44>>2]){if(a[t+52>>1]=0,e=o[e+8>>2],N[o[o[e>>2]+20>>2]](e,t,n,n,1,l),s[t+53|0]){if(o[t+44>>2]=3,!s[t+52|0])break t;break e}o[t+44>>2]=4}if(o[t+20>>2]=n,o[t+40>>2]=o[t+40>>2]+1,1!=o[t+36>>2]|2!=o[t+24>>2])break e;return void(r[t+54|0]=1)}e=o[e+8>>2],N[o[o[e>>2]+24>>2]](e,t,n,i,l)}},function(e,t,n,r){n|=0,r|=0,S(e|=0,o[8+(t|=0)>>2],0)?T(t,n,r):(e=o[e+8>>2],N[o[o[e>>2]+28>>2]](e,t,n,r))},O,R,function(e){return 1031},P,function(e){return o[4+(e|=0)>>2]},P]).grow=function(e){var t=this.length;return this.length=this.length+e,t},B.set=function(e,t){this[e]=t},B.get=function(e){return this[e]},B);return{g:function(){},h:D,i:function(){var e;return e=C(24),o[e>>2]=0,o[e+4>>2]=0,o[e+16>>2]=0,o[e+20>>2]=0,o[e+8>>2]=0,o[e+12>>2]=0,0|e},j:function(e,t,n){var r;return e=+e,t=+t,n=+n,r=C(24),c[r+16>>3]=n,c[r+8>>3]=t,c[r>>3]=e,0|r},k:function(e,t){t|=0,c[(e|=0)>>3]=c[e>>3]+c[t>>3],c[e+8>>3]=c[e+8>>3]+c[t+8>>3],c[e+16>>3]=c[e+16>>3]+c[t+16>>3]},l:function(e,t){t|=0,c[(e|=0)>>3]=c[e>>3]-c[t>>3],c[e+8>>3]=c[e+8>>3]-c[t+8>>3],c[e+16>>3]=c[e+16>>3]-c[t+16>>3]},m:function(e){return+c[(e|=0)>>3]},n:function(e,t){t=+t,c[(e|=0)>>3]=t},o:function(e){return+c[8+(e|=0)>>3]},p:function(e,t){t=+t,c[8+(e|=0)>>3]=t},q:function(e){return+c[16+(e|=0)>>3]},r:function(e,t){t=+t,c[16+(e|=0)>>3]=t},s:D,t:function(){var e;return e=C(12),o[e+8>>2]=0,o[e>>2]=0,o[e+4>>2]=0,0|e},u:function(e,t){t|=0;var n=0,r=0,i=0,a=0,s=0,l=0;e:if((0|(n=o[4+(e|=0)>>2]))==o[e+8>>2]){t:{if((i=1+(n=(0|(l=n-(r=o[e>>2])|0))/24|0)|0)>>>0<178956971){if(a=n<<1,i=n>>>0<89478485?i>>>0<a>>>0?a:i:178956970){if(i>>>0>=178956971)break t;a=C(u(i,24))}else a=0;n=a+u(n,24)|0,s=o[t+4>>2],o[n>>2]=o[t>>2],o[n+4>>2]=s,s=o[t+20>>2],o[n+16>>2]=o[t+16>>2],o[n+20>>2]=s,s=o[t+12>>2],o[n+8>>2]=o[t+8>>2],o[n+12>>2]=s,t=n+u((0|l)/-24|0,24)|0,(0|l)>0&&_(t,r,l),o[e+8>>2]=a+u(i,24),o[e+4>>2]=n+24,o[e>>2]=t,r&&x(r);break e}w(1024),h()}w(1046),h()}else r=o[t+4>>2],o[n>>2]=o[t>>2],o[n+4>>2]=r,r=o[t+20>>2],o[n+16>>2]=o[t+16>>2],o[n+20>>2]=r,r=o[t+12>>2],o[n+8>>2]=o[t+8>>2],o[n+12>>2]=r,o[e+4>>2]=n+24},v:function(e){var t=0;(e|=0)&&((t=o[e>>2])&&(o[e+4>>2]=t,x(t)),x(e))},w:function(){return 0|C(1)},x:function(e,t){e|=0;var n=0,r=0,i=0,a=0,s=0,l=0,h=0,p=0,d=0,f=0,m=0,g=0;if(e=o[(t|=0)>>2],(r=(0|(i=o[t+4>>2]-e|0))/24|0)>>>0>=2){if(!(i-24>>>0<24)){if(n=c[e+8>>3],t=1,m=1&(r=r-1|0),s=c[e>>3],i-48>>>0<24)l=n;else for(g=-2&r,r=0,h=s,p=n;i=e+u(t,24)|0,a=.5*((s=c[i+24>>3])-(d=c[i>>3]))*((f=c[i+8>>3]-n)+((l=c[i+32>>3])-n))+(.5*(d-h)*(p-n+f)+a),t=t+2|0,h=s,p=l,(0|g)!=(0|(r=r+2|0)););m&&(e=e+u(t,24)|0,a=.5*(c[e>>3]-s)*(l-n+(c[e+8>>3]-n))+a)}n=a<0?-a:a}else n=0;return+n},y:function(e,t,n){e|=0,t|=0;var r,i=0,a=0,s=0,l=0,h=0,p=0,d=0;if((r=((e=o[4+(n|=0)>>2])-(n=o[n>>2])|0)/24|0)>>>0>=3)for(e=r-1|0,i=c[t+8>>3],d=c[t>>3],t=0;l=n+u(e,24)|0,s=c[l+8>>3],e=t,t=n+u(t,24)|0,!(i<s&(a=c[t+8>>3])<=i)&(!(i>=s)|!(i<a))||d-(h=c[t>>3])<(i-a)*(c[l>>3]-h)/(s-a)&&(p^=1),(0|r)!=(0|(t=e+1|0)););return 1&p},z:D,A:N,B:y}}(e)}(q)}Object.assign(n,h),h=null,n.wasmBinary&&(g=n.wasmBinary),n.noExitRuntime;var x=Error,_={};g=[],"object"!=typeof _&&N("no native wasm support detected");var b,w,M,S,T,E=!1,C=n.INITIAL_MEMORY||16777216;(b=n.wasmMemory?n.wasmMemory:new function(){this.buffer=new ArrayBuffer(C/65536*65536)})&&(w=b.buffer),C=w.byteLength;var A=w;w=A,n.HEAP8=M=new Int8Array(A),n.HEAP16=new Int16Array(A),n.HEAP32=T=new Int32Array(A),n.HEAPU8=S=new Uint8Array(A),n.HEAPU16=new Uint16Array(A),n.HEAPU32=new Uint32Array(A),n.HEAPF32=new Float32Array(A),n.HEAPF64=new Float64Array(A);var L,D=[],P=[],O=[];function R(){var e=n.preRun.shift();D.unshift(e)}var I=0,B=null;function N(e){throw n.onAbort&&n.onAbort(e),v(e="Aborted("+e+")"),E=!0,e=new x(e+". Build with -s ASSERTIONS=1 for more info."),i(e),e}n.preloadedImages={},n.preloadedAudios={};var k,F="data:application/octet-stream;base64,";if(!(k="mxcadassembly_min.wasm").startsWith(F)){var G=k;k=n.locateFile?n.locateFile(G,m):m+G}function V(){var e=k;try{if(e==k&&g)return new Uint8Array(g);var t=W(e);if(t)return t;if(s)return s(e);throw"both async and sync fetching of the wasm failed"}catch(e){N(e)}}function z(e){for(;0<e.length;){var t=e.shift();if("function"==typeof t)t(n);else{var r=t.U;"number"==typeof r?void 0===t.G?j(r)():j(r)(t.G):r(void 0===t.G?null:t.G)}}}var U=[];function j(e){var t=U[e];return t||(e>=U.length&&(U.length=e+1),U[e]=t=L.get(e)),t}var H="function"==typeof atob?atob:function(e){var t="",n=0;e=e.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(e.charAt(n++)),i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(e.charAt(n++)),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(e.charAt(n++)),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(e.charAt(n++));r=r<<2|i>>4,i=(15&i)<<4|a>>2;var s=(3&a)<<6|o;t+=String.fromCharCode(r),64!==a&&(t+=String.fromCharCode(i)),64!==o&&(t+=String.fromCharCode(s))}while(n<e.length);return t};function W(e){if(e.startsWith(F)){if(e=e.slice(F.length),"boolean"==typeof f&&f){var t=Buffer.from(e,"base64");t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}else try{var n=H(e),r=new Uint8Array(n.length);for(e=0;e<n.length;++e)r[e]=n.charCodeAt(e);t=r}catch(e){throw Error("Converting base64 string to bytes failed.")}return t}}var q={f:function(e){return de(e+16)+16},e:function(e,t,n){throw new function(e){this.C=e-16,this.P=function(e){T[this.C+4>>2]=e},this.M=function(e){T[this.C+8>>2]=e},this.N=function(){T[this.C>>2]=0},this.L=function(){M[this.C+12>>0]=0},this.O=function(){M[this.C+13>>0]=0},this.K=function(e,t){this.P(e),this.M(t),this.N(),this.L(),this.O()}}(e).K(t,n),e},c:function(){N("")},d:function(e,t,n){S.copyWithin(e,t,t+n)},b:function(){N("OOM")},a:b};!function(){function e(e){n.asm=e.exports,L=n.asm.A,P.unshift(n.asm.g),I--,n.monitorRunDependencies&&n.monitorRunDependencies(I),0==I&&B&&(e=B,B=null,e())}function t(t){e(t.instance)}function r(e){return function(){if(!g&&(p||d)){if("function"==typeof fetch&&!k.startsWith("file://"))return fetch(k,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+k+"'";return e.arrayBuffer()}).catch(function(){return V()});if(o)return new Promise(function(e,t){o(k,function(t){e(new Uint8Array(t))},t)})}return Promise.resolve().then(function(){return V()})}().then(function(){return{then:function(e){e({instance:new y})}}}).then(function(e){return e}).then(e,function(e){v("failed to asynchronously prepare wasm: "+e),N(e)})}var a={a:q};if(I++,n.monitorRunDependencies&&n.monitorRunDependencies(I),n.instantiateWasm)try{return n.instantiateWasm(a,e)}catch(e){return v("Module.instantiateWasm callback failed with error: "+e),!1}(g||"function"!=typeof _.instantiateStreaming||k.startsWith(F)||k.startsWith("file://")||"function"!=typeof fetch?r(t):fetch(k,{credentials:"same-origin"}).then(function(e){return _.instantiateStreaming(e,a).then(t,function(e){return v("wasm streaming compile failed: "+e),v("falling back to ArrayBuffer instantiation"),r(t)})})).catch(i)}(),n.___wasm_call_ctors=function(){return(n.___wasm_call_ctors=n.asm.g).apply(null,arguments)};var J,X=n._emscripten_bind_VoidPtr___destroy___0=function(){return(X=n._emscripten_bind_VoidPtr___destroy___0=n.asm.h).apply(null,arguments)},Y=n._emscripten_bind_McGePoint3d_McGePoint3d_0=function(){return(Y=n._emscripten_bind_McGePoint3d_McGePoint3d_0=n.asm.i).apply(null,arguments)},$=n._emscripten_bind_McGePoint3d_McGePoint3d_3=function(){return($=n._emscripten_bind_McGePoint3d_McGePoint3d_3=n.asm.j).apply(null,arguments)},Z=n._emscripten_bind_McGePoint3d_op_add_1=function(){return(Z=n._emscripten_bind_McGePoint3d_op_add_1=n.asm.k).apply(null,arguments)},K=n._emscripten_bind_McGePoint3d_op_sub_1=function(){return(K=n._emscripten_bind_McGePoint3d_op_sub_1=n.asm.l).apply(null,arguments)},Q=n._emscripten_bind_McGePoint3d_get_x_0=function(){return(Q=n._emscripten_bind_McGePoint3d_get_x_0=n.asm.m).apply(null,arguments)},ee=n._emscripten_bind_McGePoint3d_set_x_1=function(){return(ee=n._emscripten_bind_McGePoint3d_set_x_1=n.asm.n).apply(null,arguments)},te=n._emscripten_bind_McGePoint3d_get_y_0=function(){return(te=n._emscripten_bind_McGePoint3d_get_y_0=n.asm.o).apply(null,arguments)},ne=n._emscripten_bind_McGePoint3d_set_y_1=function(){return(ne=n._emscripten_bind_McGePoint3d_set_y_1=n.asm.p).apply(null,arguments)},re=n._emscripten_bind_McGePoint3d_get_z_0=function(){return(re=n._emscripten_bind_McGePoint3d_get_z_0=n.asm.q).apply(null,arguments)},ie=n._emscripten_bind_McGePoint3d_set_z_1=function(){return(ie=n._emscripten_bind_McGePoint3d_set_z_1=n.asm.r).apply(null,arguments)},ae=n._emscripten_bind_McGePoint3d___destroy___0=function(){return(ae=n._emscripten_bind_McGePoint3d___destroy___0=n.asm.s).apply(null,arguments)},oe=n._emscripten_bind_McGePoint3dArray_McGePoint3dArray_0=function(){return(oe=n._emscripten_bind_McGePoint3dArray_McGePoint3dArray_0=n.asm.t).apply(null,arguments)},se=n._emscripten_bind_McGePoint3dArray_append_1=function(){return(se=n._emscripten_bind_McGePoint3dArray_append_1=n.asm.u).apply(null,arguments)},le=n._emscripten_bind_McGePoint3dArray___destroy___0=function(){return(le=n._emscripten_bind_McGePoint3dArray___destroy___0=n.asm.v).apply(null,arguments)},ce=n._emscripten_bind_McGeTool_McGeTool_0=function(){return(ce=n._emscripten_bind_McGeTool_McGeTool_0=n.asm.w).apply(null,arguments)},ue=n._emscripten_bind_McGeTool_calcArea_1=function(){return(ue=n._emscripten_bind_McGeTool_calcArea_1=n.asm.x).apply(null,arguments)},he=n._emscripten_bind_McGeTool_pointInPolyline_2=function(){return(he=n._emscripten_bind_McGeTool_pointInPolyline_2=n.asm.y).apply(null,arguments)},pe=n._emscripten_bind_McGeTool___destroy___0=function(){return(pe=n._emscripten_bind_McGeTool___destroy___0=n.asm.z).apply(null,arguments)},de=n._malloc=function(){return(de=n._malloc=n.asm.B).apply(null,arguments)};function fe(){function e(){if(!J&&(J=!0,n.calledRun=!0,!E)){if(z(P),r(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;){var e=n.postRun.shift();O.unshift(e)}z(O)}}if(!(0<I)){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)R();z(D),0<I||(n.setStatus?(n.setStatus("Running..."),setTimeout(function(){setTimeout(function(){n.setStatus("")},1),e()},1)):e())}}if(B=function e(){J||fe(),J||(B=e)},n.run=fe,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);0<n.preInit.length;)n.preInit.pop()();function me(){}function ge(e){return(e||me).F}function ve(e,t){var n=ge(t),r=n[e];return r||((r=Object.create((t||me).prototype)).C=e,n[e]=r)}function ye(){throw"cannot construct a VoidPtr, no constructor in IDL"}function xe(e,t,n){e&&"object"==typeof e&&(e=e.C),t&&"object"==typeof t&&(t=t.C),n&&"object"==typeof n&&(n=n.C),this.C=void 0===e?Y():void 0===t?_emscripten_bind_McGePoint3d_McGePoint3d_1(e):void 0===n?_emscripten_bind_McGePoint3d_McGePoint3d_2(e,t):$(e,t,n),ge(xe)[this.C]=this}function _e(){this.C=oe(),ge(_e)[this.C]=this}function be(){this.C=ce(),ge(be)[this.C]=this}return fe(),me.prototype=Object.create(me.prototype),me.prototype.constructor=me,me.prototype.D=me,me.F={},n.WrapperObject=me,n.getCache=ge,n.wrapPointer=ve,n.castObject=function(e,t){return ve(e.C,t)},n.NULL=ve(0),n.destroy=function(e){if(!e.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";e.__destroy__(),delete ge(e.D)[e.C]},n.compare=function(e,t){return e.C===t.C},n.getPointer=function(e){return e.C},n.getClass=function(e){return e.D},ye.prototype=Object.create(me.prototype),ye.prototype.constructor=ye,ye.prototype.D=ye,ye.F={},n.VoidPtr=ye,ye.prototype.__destroy__=function(){X(this.C)},xe.prototype=Object.create(me.prototype),xe.prototype.constructor=xe,xe.prototype.D=xe,xe.F={},n.McGePoint3d=xe,xe.prototype.op_add=function(e){var t=this.C;e&&"object"==typeof e&&(e=e.C),Z(t,e)},xe.prototype.op_sub=function(e){var t=this.C;e&&"object"==typeof e&&(e=e.C),K(t,e)},xe.prototype.get_x=xe.prototype.H=function(){return Q(this.C)},xe.prototype.set_x=xe.prototype.R=function(e){var t=this.C;e&&"object"==typeof e&&(e=e.C),ee(t,e)},Object.defineProperty(xe.prototype,"x",{get:xe.prototype.H,set:xe.prototype.R}),xe.prototype.get_y=xe.prototype.I=function(){return te(this.C)},xe.prototype.set_y=xe.prototype.S=function(e){var t=this.C;e&&"object"==typeof e&&(e=e.C),ne(t,e)},Object.defineProperty(xe.prototype,"y",{get:xe.prototype.I,set:xe.prototype.S}),xe.prototype.get_z=xe.prototype.J=function(){return re(this.C)},xe.prototype.set_z=xe.prototype.T=function(e){var t=this.C;e&&"object"==typeof e&&(e=e.C),ie(t,e)},Object.defineProperty(xe.prototype,"z",{get:xe.prototype.J,set:xe.prototype.T}),xe.prototype.__destroy__=function(){ae(this.C)},_e.prototype=Object.create(me.prototype),_e.prototype.constructor=_e,_e.prototype.D=_e,_e.F={},n.McGePoint3dArray=_e,_e.prototype.append=_e.prototype.append=function(e){var t=this.C;e&&"object"==typeof e&&(e=e.C),se(t,e)},_e.prototype.__destroy__=function(){le(this.C)},be.prototype=Object.create(me.prototype),be.prototype.constructor=be,be.prototype.D=be,be.F={},n.McGeTool=be,be.prototype.calcArea=function(e){var t=this.C;return e&&"object"==typeof e&&(e=e.C),ue(t,e)},be.prototype.pointInPolyline=function(e,t){var n=this.C;return e&&"object"==typeof e&&(e=e.C),t&&"object"==typeof t&&(t=t.C),!!he(n,e,t)},be.prototype.__destroy__=function(){pe(this.C)},t.ready});return"object"==typeof exports&&"object"==typeof module?module.exports=t:"function"==typeof define&&define.amd?define([],function(){return t}):"object"==typeof exports&&(exports.mxcadassembly=t),t()}function rxInitMxEntity(){var e;null===(e=store.state.MxFun)||void 0===e||e.initDynamicCreate(dynamicCreateMxObject)}function loadCoreCode(){return __awaiter(this,void 0,void 0,function(){var e=this;return __generator(this,function(t){return[2,new Promise(function(t,n){return __awaiter(e,void 0,void 0,function(){var e,r,i;return __generator(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),store.state.MxFun?(console.error("内部已调用loadCoreCode, 无需重复调用!"),[2,n({code:"error",msg:"内部已调用loadCoreCode, 无需重复调用"})]):(e=window,r=window,[4,dynamicImport("jquery")]);case 1:return e.$=r.jQuery=a.sent(),window.MxDocumentReady=void 0,window.MxUiMain=function(e){var t=e("./MxFun").MxFun;store.commit("setMxFun",t),store.events.emit("MxUiMain",e),window.MxUiMain=void 0},window.MxMain=function(e){return store.events.emit("MxMain",e),window.MxMain=void 0,rxInitMxEntity(),t(),0},mxcadassemblyinit().then(function(e){store.commit("setMxassembly",e)}),mxfun(),[3,3];case 2:return i=a.sent(),n({code:"error",msg:i}),[3,3];case 3:return[2]}})})})]})})}function createReandomId(e){return void 0===e&&(e=10),new Number(Math.random().toString().substr(3,e)+Date.now()).toString(36)}function createCanvas(e){void 0===e&&(e="mx-canvas");var t=document.getElementById(e)||document.createElement("canvas");return t.id=e,t}function createCanvasParent(e){var t;return void 0===e&&(e=createCanvas()),e||(e=createCanvas()),e.parentNode?t=e.parentNode:(t=document.createElement("div")).appendChild(e),t}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:e>0?1:+e}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(void 0!==r&&null!==r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t});var REVISION="113",CullFaceNone=0,CullFaceBack=1,CullFaceFront=2,PCFShadowMap=1,PCFSoftShadowMap=2,VSMShadowMap=3,FrontSide=0,BackSide=1,DoubleSide=2,FlatShading=1,NoColors=0,FaceColors=1,VertexColors=2,NoBlending=0,NormalBlending=1,AdditiveBlending=2,SubtractiveBlending=3,MultiplyBlending=4,CustomBlending=5,AddEquation=100,SubtractEquation=101,ReverseSubtractEquation=102,MinEquation=103,MaxEquation=104,ZeroFactor=200,OneFactor=201,SrcColorFactor=202,OneMinusSrcColorFactor=203,SrcAlphaFactor=204,OneMinusSrcAlphaFactor=205,DstAlphaFactor=206,OneMinusDstAlphaFactor=207,DstColorFactor=208,OneMinusDstColorFactor=209,SrcAlphaSaturateFactor=210,NeverDepth=0,AlwaysDepth=1,LessDepth=2,LessEqualDepth=3,EqualDepth=4,GreaterEqualDepth=5,GreaterDepth=6,NotEqualDepth=7,MultiplyOperation=0,MixOperation=1,AddOperation=2,NoToneMapping=0,LinearToneMapping=1,ReinhardToneMapping=2,Uncharted2ToneMapping=3,CineonToneMapping=4,ACESFilmicToneMapping=5,UVMapping=300,CubeReflectionMapping=301,CubeRefractionMapping=302,EquirectangularReflectionMapping=303,EquirectangularRefractionMapping=304,SphericalReflectionMapping=305,CubeUVReflectionMapping=306,CubeUVRefractionMapping=307,RepeatWrapping=1e3,ClampToEdgeWrapping=1001,MirroredRepeatWrapping=1002,NearestFilter=1003,NearestMipmapNearestFilter=1004,NearestMipmapLinearFilter=1005,LinearFilter=1006,LinearMipmapNearestFilter=1007,LinearMipmapLinearFilter=1008,UnsignedByteType=1009,ByteType=1010,ShortType=1011,UnsignedShortType=1012,IntType=1013,UnsignedIntType=1014,FloatType=1015,HalfFloatType=1016,UnsignedShort4444Type=1017,UnsignedShort5551Type=1018,UnsignedShort565Type=1019,UnsignedInt248Type=1020,AlphaFormat=1021,RGBFormat=1022,RGBAFormat=1023,LuminanceFormat=1024,LuminanceAlphaFormat=1025,DepthFormat=1026,DepthStencilFormat=1027,RedFormat=1028,RedIntegerFormat=1029,RGFormat=1030,RGIntegerFormat=1031,RGBIntegerFormat=1032,RGBAIntegerFormat=1033,RGB_S3TC_DXT1_Format=33776,RGBA_S3TC_DXT1_Format=33777,RGBA_S3TC_DXT3_Format=33778,RGBA_S3TC_DXT5_Format=33779,RGB_PVRTC_4BPPV1_Format=35840,RGB_PVRTC_2BPPV1_Format=35841,RGBA_PVRTC_4BPPV1_Format=35842,RGBA_PVRTC_2BPPV1_Format=35843,RGB_ETC1_Format=36196,RGBA_ASTC_4x4_Format=37808,RGBA_ASTC_5x4_Format=37809,RGBA_ASTC_5x5_Format=37810,RGBA_ASTC_6x5_Format=37811,RGBA_ASTC_6x6_Format=37812,RGBA_ASTC_8x5_Format=37813,RGBA_ASTC_8x6_Format=37814,RGBA_ASTC_8x8_Format=37815,RGBA_ASTC_10x5_Format=37816,RGBA_ASTC_10x6_Format=37817,RGBA_ASTC_10x8_Format=37818,RGBA_ASTC_10x10_Format=37819,RGBA_ASTC_12x10_Format=37820,RGBA_ASTC_12x12_Format=37821,LoopOnce=2200,LoopRepeat=2201,LoopPingPong=2202,InterpolateDiscrete=2300,InterpolateLinear=2301,InterpolateSmooth=2302,ZeroCurvatureEnding=2400,ZeroSlopeEnding=2401,WrapAroundEnding=2402,TrianglesDrawMode=0,LinearEncoding=3e3,sRGBEncoding=3001,GammaEncoding=3007,RGBEEncoding=3002,LogLuvEncoding=3003,RGBM7Encoding=3004,RGBM16Encoding=3005,RGBDEncoding=3006,BasicDepthPacking=3200,RGBADepthPacking=3201,TangentSpaceNormalMap=0,ObjectSpaceNormalMap=1,KeepStencilOp=7680,AlwaysStencilFunc=519,StaticDrawUsage=35044,DynamicDrawUsage=35048;function EventDispatcher(){}Object.assign(EventDispatcher.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var n=this._listeners[e];if(void 0!==n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=t.slice(0),r=0,i=n.length;r<i;r++)n[r].call(this,e)}}}});for(var _lut=[],i=0;i<256;i++)_lut[i]=(i<16?"0":"")+i.toString(16);var MathUtils={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(_lut[255&e]+_lut[e>>8&255]+_lut[e>>16&255]+_lut[e>>24&255]+"-"+_lut[255&t]+_lut[t>>8&255]+"-"+_lut[t>>16&15|64]+_lut[t>>24&255]+"-"+_lut[63&n|128]+_lut[n>>8&255]+"-"+_lut[n>>16&255]+_lut[n>>24&255]+_lut[255&r]+_lut[r>>8&255]+_lut[r>>16&255]+_lut[r>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*MathUtils.DEG2RAD},radToDeg:function(e){return e*MathUtils.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,r,i){var a=Math.cos,o=Math.sin,s=a(n/2),l=o(n/2),c=a((t+r)/2),u=o((t+r)/2),h=a((t-r)/2),p=o((t-r)/2),d=a((r-t)/2),f=o((r-t)/2);"XYX"===i?e.set(s*u,l*h,l*p,s*c):"YZY"===i?e.set(l*p,s*u,l*h,s*c):"ZXZ"===i?e.set(l*h,l*p,s*u,s*c):"XZX"===i?e.set(s*u,l*f,l*d,s*c):"YXY"===i?e.set(l*d,s*u,l*f,s*c):"ZYZ"===i?e.set(l*f,l*d,s*u,s*c):console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.")}},_canvas;function Vector2(e,t){this.x=e||0,this.y=t||0}function Matrix3(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(Vector2.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(Vector2.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},cross:function(e){return this.x*e.y-this.y*e.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var e=Math.atan2(this.y,this.x);return e<0&&(e+=2*Math.PI),e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}}),Object.assign(Matrix3.prototype,{isMatrix3:!0,set:function(e,t,n,r,i,a,o,s,l){var c=this.elements;return c[0]=e,c[1]=r,c[2]=o,c[3]=t,c[4]=i,c[5]=s,c[6]=n,c[7]=a,c[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this},setFromMatrix4:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],l=n[1],c=n[4],u=n[7],h=n[2],p=n[5],d=n[8],f=r[0],m=r[3],g=r[6],v=r[1],y=r[4],x=r[7],_=r[2],b=r[5],w=r[8];return i[0]=a*f+o*v+s*_,i[3]=a*m+o*y+s*b,i[6]=a*g+o*x+s*w,i[1]=l*f+c*v+u*_,i[4]=l*m+c*y+u*b,i[7]=l*g+c*x+u*w,i[2]=h*f+p*v+d*_,i[5]=h*m+p*y+d*b,i[8]=h*g+p*x+d*w,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8];return t*a*c-t*o*l-n*i*c+n*o*s+r*i*l-r*a*s},getInverse:function(e,t){e&&e.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=e.elements,r=this.elements,i=n[0],a=n[1],o=n[2],s=n[3],l=n[4],c=n[5],u=n[6],h=n[7],p=n[8],d=p*l-c*h,f=c*u-p*s,m=h*s-l*u,g=i*d+a*f+o*m;if(0===g){var v="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(v);return console.warn(v),this.identity()}var y=1/g;return r[0]=d*y,r[1]=(o*h-p*a)*y,r[2]=(c*a-o*l)*y,r[3]=f*y,r[4]=(p*i-o*u)*y,r[5]=(o*s-c*i)*y,r[6]=m*y,r[7]=(a*u-h*i)*y,r[8]=(l*i-a*s)*y,this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},setUvTransform:function(e,t,n,r,i,a,o){var s=Math.cos(i),l=Math.sin(i);this.set(n*s,n*l,-n*(s*a+l*o)+a+e,-r*l,r*s,-r*(-l*a+s*o)+o+t,0,0,1)},scale:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this},rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],l=r[4],c=r[7];return r[0]=t*i+n*s,r[3]=t*a+n*l,r[6]=t*o+n*c,r[1]=-n*i+t*s,r[4]=-n*a+t*l,r[7]=-n*o+t*c,this},translate:function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<9;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}});var ImageUtils={getDataURL:function(e){var t;if("undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)t=e;else{void 0===_canvas&&(_canvas=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),_canvas.width=e.width,_canvas.height=e.height;var n=_canvas.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=_canvas}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}},textureId=0;function Texture(e,t,n,r,i,a,o,s,l,c){Object.defineProperty(this,"id",{value:textureId++}),this.uuid=MathUtils.generateUUID(),this.name="",this.image=void 0!==e?e:Texture.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:Texture.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:ClampToEdgeWrapping,this.wrapT=void 0!==r?r:ClampToEdgeWrapping,this.magFilter=void 0!==i?i:LinearFilter,this.minFilter=void 0!==a?a:LinearMipmapLinearFilter,this.anisotropy=void 0!==l?l:1,this.format=void 0!==o?o:RGBAFormat,this.internalFormat=null,this.type=void 0!==s?s:UnsignedByteType,this.offset=new Vector2(0,0),this.repeat=new Vector2(1,1),this.center=new Vector2(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Matrix3,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==c?c:LinearEncoding,this.version=0,this.onUpdate=null}function Vector4(e,t,n,r){this.x=e||0,this.y=t||0,this.z=n||0,this.w=void 0!==r?r:1}function WebGLRenderTarget(e,t,n){this.width=e,this.height=t,this.scissor=new Vector4(0,0,e,t),this.scissorTest=!1,this.viewport=new Vector4(0,0,e,t),n=n||{},this.texture=new Texture(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:LinearFilter,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function WebGLMultisampleRenderTarget(e,t,n){WebGLRenderTarget.call(this,e,t,n),this.samples=4}function Quaternion(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._w=void 0!==r?r:1}Texture.DEFAULT_IMAGE=void 0,Texture.DEFAULT_MAPPING=UVMapping,Texture.prototype=Object.assign(Object.create(EventDispatcher.prototype),{constructor:Texture,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=MathUtils.generateUUID()),!t&&void 0===e.images[r.uuid]){var i;if(Array.isArray(r)){i=[];for(var a=0,o=r.length;a<o;a++)i.push(ImageUtils.getDataURL(r[a]))}else i=ImageUtils.getDataURL(r);e.images[r.uuid]={uuid:r.uuid,url:i}}n.image=r.uuid}return t||(e.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(this.mapping!==UVMapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case RepeatWrapping:e.x=e.x-Math.floor(e.x);break;case ClampToEdgeWrapping:e.x=e.x<0?0:1;break;case MirroredRepeatWrapping:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case RepeatWrapping:e.y=e.y-Math.floor(e.y);break;case ClampToEdgeWrapping:e.y=e.y<0?0:1;break;case MirroredRepeatWrapping:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(Texture.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.defineProperties(Vector4.prototype,{width:{get:function(){return this.z},set:function(e){this.z=e}},height:{get:function(){return this.w},set:function(e){this.w=e}}}),Object.assign(Vector4.prototype,{isVector4:!0,set:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,n,r,i,a=e.elements,o=a[0],s=a[4],l=a[8],c=a[1],u=a[5],h=a[9],p=a[2],d=a[6],f=a[10];if(Math.abs(s-c)<.01&&Math.abs(l-p)<.01&&Math.abs(h-d)<.01){if(Math.abs(s+c)<.1&&Math.abs(l+p)<.1&&Math.abs(h+d)<.1&&Math.abs(o+u+f-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var m=(o+1)/2,g=(u+1)/2,v=(f+1)/2,y=(s+c)/4,x=(l+p)/4,_=(h+d)/4;return m>g&&m>v?m<.01?(n=0,r=.707106781,i=.707106781):(r=y/(n=Math.sqrt(m)),i=x/n):g>v?g<.01?(n=.707106781,r=0,i=.707106781):(n=y/(r=Math.sqrt(g)),i=_/r):v<.01?(n=.707106781,r=.707106781,i=0):(n=x/(i=Math.sqrt(v)),r=_/i),this.set(n,r,i,t),this}var b=Math.sqrt((d-h)*(d-h)+(l-p)*(l-p)+(c-s)*(c-s));return Math.abs(b)<.001&&(b=1),this.x=(d-h)/b,this.y=(l-p)/b,this.z=(c-s)/b,this.w=Math.acos((o+u+f-1)/2),this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),WebGLRenderTarget.prototype=Object.assign(Object.create(EventDispatcher.prototype),{constructor:WebGLRenderTarget,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),WebGLMultisampleRenderTarget.prototype=Object.assign(Object.create(WebGLRenderTarget.prototype),{constructor:WebGLMultisampleRenderTarget,isWebGLMultisampleRenderTarget:!0,copy:function(e){return WebGLRenderTarget.prototype.copy.call(this,e),this.samples=e.samples,this}}),Object.assign(Quaternion,{slerp:function(e,t,n,r){return n.copy(e).slerp(t,r)},slerpFlat:function(e,t,n,r,i,a,o){var s=n[r+0],l=n[r+1],c=n[r+2],u=n[r+3],h=i[a+0],p=i[a+1],d=i[a+2],f=i[a+3];if(u!==f||s!==h||l!==p||c!==d){var m=1-o,g=s*h+l*p+c*d+u*f,v=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var x=Math.sqrt(y),_=Math.atan2(x,g*v);m=Math.sin(m*_)/x,o=Math.sin(o*_)/x}var b=o*v;if(s=s*m+h*b,l=l*m+p*b,c=c*m+d*b,u=u*m+f*b,m===1-o){var w=1/Math.sqrt(s*s+l*l+c*c+u*u);s*=w,l*=w,c*=w,u*=w}}e[t]=s,e[t+1]=l,e[t+2]=c,e[t+3]=u}}),Object.defineProperties(Quaternion.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}}),Object.assign(Quaternion.prototype,{isQuaternion:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,r=e._y,i=e._z,a=e.order,o=Math.cos,s=Math.sin,l=o(n/2),c=o(r/2),u=o(i/2),h=s(n/2),p=s(r/2),d=s(i/2);return"XYZ"===a?(this._x=h*c*u+l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u-h*p*d):"YXZ"===a?(this._x=h*c*u+l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u+h*p*d):"ZXY"===a?(this._x=h*c*u-l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u-h*p*d):"ZYX"===a?(this._x=h*c*u-l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u+h*p*d):"YZX"===a?(this._x=h*c*u+l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u-h*p*d):"XZY"===a&&(this._x=h*c*u-l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u+h*p*d),!1!==t&&this._onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(e){var t,n=e.elements,r=n[0],i=n[4],a=n[8],o=n[1],s=n[5],l=n[9],c=n[2],u=n[6],h=n[10],p=r+s+h;return p>0?(t=.5/Math.sqrt(p+1),this._w=.25/t,this._x=(u-l)*t,this._y=(a-c)*t,this._z=(o-i)*t):r>s&&r>h?(t=2*Math.sqrt(1+r-s-h),this._w=(u-l)/t,this._x=.25*t,this._y=(i+o)/t,this._z=(a+c)/t):s>h?(t=2*Math.sqrt(1+s-r-h),this._w=(a-c)/t,this._x=(i+o)/t,this._y=.25*t,this._z=(l+u)/t):(t=2*Math.sqrt(1+h-r-s),this._w=(o-i)/t,this._x=(a+c)/t,this._y=(l+u)/t,this._z=.25*t),this._onChangeCallback(),this},setFromUnitVectors:function(e,t){var n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs(MathUtils.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,t){var n=this.angleTo(e);if(0===n)return this;var r=Math.min(1,t/n);return this.slerp(e,r),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,l=t._z,c=t._w;return this._x=n*c+a*o+r*l-i*s,this._y=r*c+a*s+i*o-n*l,this._z=i*c+a*l+n*s-r*o,this._w=a*c-n*o-r*s-i*l,this._onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,a=this._w,o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;var s=1-o*o;if(s<=Number.EPSILON){var l=1-t;return this._w=l*a+t*this._w,this._x=l*n+t*this._x,this._y=l*r+t*this._y,this._z=l*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var c=Math.sqrt(s),u=Math.atan2(c,o),h=Math.sin((1-t)*u)/c,p=Math.sin(t*u)/c;return this._w=a*h+this._w*p,this._x=n*h+this._x*p,this._y=r*h+this._y*p,this._z=i*h+this._z*p,this._onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}});var _vector=new Vector3,_quaternion=new Quaternion;function Vector3(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}Object.assign(Vector3.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(_quaternion.setFromEuler(e))},applyAxisAngle:function(e,t){return this.applyQuaternion(_quaternion.setFromAxisAngle(e,t))},applyMatrix3:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this},applyNormalMatrix:function(e){return this.applyMatrix3(e).normalize()},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this},applyQuaternion:function(e){var t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,l=s*t+a*r-o*n,c=s*n+o*t-i*r,u=s*r+i*n-a*t,h=-i*t-a*n-o*r;return this.x=l*s+h*-i+c*-o-u*-a,this.y=c*s+h*-a+u*-i-l*-o,this.z=u*s+h*-o+l*-a-c*-i,this},project:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},unproject:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)},transformDirection:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},cross:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this},projectOnVector:function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)},projectOnPlane:function(e){return _vector.copy(this).projectOnVector(e),this.sub(_vector)},reflect:function(e){return this.sub(_vector.copy(e).multiplyScalar(2*this.dot(e)))},angleTo:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var n=this.dot(e)/t;return Math.acos(MathUtils.clamp(n,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},setFromSphericalCoords:function(e,t,n){var r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this},setFromCylindrical:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},setFromCylindricalCoords:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},setFromMatrix3Column:function(e,t){return this.fromArray(e.elements,3*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}});var _v1=new Vector3,_m1=new Matrix4,_zero=new Vector3(0,0,0),_one=new Vector3(1,1,1),_x=new Vector3,_y=new Vector3,_z=new Vector3;function Matrix4(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}Object.assign(Matrix4.prototype,{isMatrix4:!0,set:function(e,t,n,r,i,a,o,s,l,c,u,h,p,d,f,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=p,g[7]=d,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new Matrix4).fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this},copyPosition:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},extractBasis:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this},extractRotation:function(e){var t=this.elements,n=e.elements,r=1/_v1.setFromMatrixColumn(e,0).length(),i=1/_v1.setFromMatrixColumn(e,1).length(),a=1/_v1.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),l=Math.sin(r),c=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){var h=a*c,p=a*u,d=o*c,f=o*u;t[0]=s*c,t[4]=-s*u,t[8]=l,t[1]=p+d*l,t[5]=h-f*l,t[9]=-o*s,t[2]=f-h*l,t[6]=d+p*l,t[10]=a*s}else if("YXZ"===e.order){var m=s*c,g=s*u,v=l*c,y=l*u;t[0]=m+y*o,t[4]=v*o-g,t[8]=a*l,t[1]=a*u,t[5]=a*c,t[9]=-o,t[2]=g*o-v,t[6]=y+m*o,t[10]=a*s}else if("ZXY"===e.order){m=s*c,g=s*u,v=l*c,y=l*u;t[0]=m-y*o,t[4]=-a*u,t[8]=v+g*o,t[1]=g+v*o,t[5]=a*c,t[9]=y-m*o,t[2]=-a*l,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){h=a*c,p=a*u,d=o*c,f=o*u;t[0]=s*c,t[4]=d*l-p,t[8]=h*l+f,t[1]=s*u,t[5]=f*l+h,t[9]=p*l-d,t[2]=-l,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){var x=a*s,_=a*l,b=o*s,w=o*l;t[0]=s*c,t[4]=w-x*u,t[8]=b*u+_,t[1]=u,t[5]=a*c,t[9]=-o*c,t[2]=-l*c,t[6]=_*u+b,t[10]=x-w*u}else if("XZY"===e.order){x=a*s,_=a*l,b=o*s,w=o*l;t[0]=s*c,t[4]=-u,t[8]=l*c,t[1]=x*u+w,t[5]=a*c,t[9]=_*u-b,t[2]=b*u-_,t[6]=o*c,t[10]=w*u+x}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(e){return this.compose(_zero,e,_one)},lookAt:function(e,t,n){var r=this.elements;return _z.subVectors(e,t),0===_z.lengthSq()&&(_z.z=1),_z.normalize(),_x.crossVectors(n,_z),0===_x.lengthSq()&&(1===Math.abs(n.z)?_z.x+=1e-4:_z.z+=1e-4,_z.normalize(),_x.crossVectors(n,_z)),_x.normalize(),_y.crossVectors(_z,_x),r[0]=_x.x,r[4]=_y.x,r[8]=_z.x,r[1]=_x.y,r[5]=_y.y,r[9]=_z.y,r[2]=_x.z,r[6]=_y.z,r[10]=_z.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],l=n[12],c=n[1],u=n[5],h=n[9],p=n[13],d=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],_=n[15],b=r[0],w=r[4],M=r[8],S=r[12],T=r[1],E=r[5],C=r[9],A=r[13],L=r[2],D=r[6],P=r[10],O=r[14],R=r[3],I=r[7],B=r[11],N=r[15];return i[0]=a*b+o*T+s*L+l*R,i[4]=a*w+o*E+s*D+l*I,i[8]=a*M+o*C+s*P+l*B,i[12]=a*S+o*A+s*O+l*N,i[1]=c*b+u*T+h*L+p*R,i[5]=c*w+u*E+h*D+p*I,i[9]=c*M+u*C+h*P+p*B,i[13]=c*S+u*A+h*O+p*N,i[2]=d*b+f*T+m*L+g*R,i[6]=d*w+f*E+m*D+g*I,i[10]=d*M+f*C+m*P+g*B,i[14]=d*S+f*A+m*O+g*N,i[3]=v*b+y*T+x*L+_*R,i[7]=v*w+y*E+x*D+_*I,i[11]=v*M+y*C+x*P+_*B,i[15]=v*S+y*A+x*O+_*N,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},determinant:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],l=e[13],c=e[2],u=e[6],h=e[10],p=e[14];return e[3]*(+i*s*u-r*l*u-i*o*h+n*l*h+r*o*p-n*s*p)+e[7]*(+t*s*p-t*l*h+i*a*h-r*a*p+r*l*c-i*s*c)+e[11]*(+t*l*u-t*o*p-i*a*u+n*a*p+i*o*c-n*l*c)+e[15]*(-r*o*c-t*s*u+t*o*h+r*a*u-n*a*h+n*s*c)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(e,t,n){var r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this},getInverse:function(e,t){var n=this.elements,r=e.elements,i=r[0],a=r[1],o=r[2],s=r[3],l=r[4],c=r[5],u=r[6],h=r[7],p=r[8],d=r[9],f=r[10],m=r[11],g=r[12],v=r[13],y=r[14],x=r[15],_=d*y*h-v*f*h+v*u*m-c*y*m-d*u*x+c*f*x,b=g*f*h-p*y*h-g*u*m+l*y*m+p*u*x-l*f*x,w=p*v*h-g*d*h+g*c*m-l*v*m-p*c*x+l*d*x,M=g*d*u-p*v*u-g*c*f+l*v*f+p*c*y-l*d*y,S=i*_+a*b+o*w+s*M;if(0===S){var T="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(T);return console.warn(T),this.identity()}var E=1/S;return n[0]=_*E,n[1]=(v*f*s-d*y*s-v*o*m+a*y*m+d*o*x-a*f*x)*E,n[2]=(c*y*s-v*u*s+v*o*h-a*y*h-c*o*x+a*u*x)*E,n[3]=(d*u*s-c*f*s-d*o*h+a*f*h+c*o*m-a*u*m)*E,n[4]=b*E,n[5]=(p*y*s-g*f*s+g*o*m-i*y*m-p*o*x+i*f*x)*E,n[6]=(g*u*s-l*y*s-g*o*h+i*y*h+l*o*x-i*u*x)*E,n[7]=(l*f*s-p*u*s+p*o*h-i*f*h-l*o*m+i*u*m)*E,n[8]=w*E,n[9]=(g*d*s-p*v*s-g*a*m+i*v*m+p*a*x-i*d*x)*E,n[10]=(l*v*s-g*c*s+g*a*h-i*v*h-l*a*x+i*c*x)*E,n[11]=(p*c*s-l*d*s-p*a*h+i*d*h+l*a*m-i*c*m)*E,n[12]=M*E,n[13]=(p*v*o-g*d*o+g*a*f-i*v*f-p*a*y+i*d*y)*E,n[14]=(g*c*o-l*v*o-g*a*u+i*v*u+l*a*y-i*c*y)*E,n[15]=(l*d*o-p*c*o+p*a*u-i*d*u-l*a*f+i*c*f)*E,this},scale:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))},makeTranslation:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,l=i*a,c=i*o;return this.set(l*a+n,l*o-r*s,l*s+r*o,0,l*o+r*s,c*o+n,c*s-r*a,0,l*s-r*o,c*s+r*a,i*s*s+n,0,0,0,0,1),this},makeScale:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,n){var r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,l=i+i,c=a+a,u=o+o,h=i*l,p=i*c,d=i*u,f=a*c,m=a*u,g=o*u,v=s*l,y=s*c,x=s*u,_=n.x,b=n.y,w=n.z;return r[0]=(1-(f+g))*_,r[1]=(p+x)*_,r[2]=(d-y)*_,r[3]=0,r[4]=(p-x)*b,r[5]=(1-(h+g))*b,r[6]=(m+v)*b,r[7]=0,r[8]=(d+y)*w,r[9]=(m-v)*w,r[10]=(1-(h+f))*w,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this},decompose:function(e,t,n){var r=this.elements,i=_v1.set(r[0],r[1],r[2]).length(),a=_v1.set(r[4],r[5],r[6]).length(),o=_v1.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],_m1.copy(this);var s=1/i,l=1/a,c=1/o;return _m1.elements[0]*=s,_m1.elements[1]*=s,_m1.elements[2]*=s,_m1.elements[4]*=l,_m1.elements[5]*=l,_m1.elements[6]*=l,_m1.elements[8]*=c,_m1.elements[9]*=c,_m1.elements[10]*=c,t.setFromRotationMatrix(_m1),n.x=i,n.y=a,n.z=o,this},makePerspective:function(e,t,n,r,i,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*i/(t-e),l=2*i/(n-r),c=(t+e)/(t-e),u=(n+r)/(n-r),h=-(a+i)/(a-i),p=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=c,o[12]=0,o[1]=0,o[5]=l,o[9]=u,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=p,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(e,t,n,r,i,a){var o=this.elements,s=1/(t-e),l=1/(n-r),c=1/(a-i),u=(t+e)*s,h=(n+r)*l,p=(a+i)*c;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-u,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=-2*c,o[14]=-p,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}});var _matrix=new Matrix4,_quaternion$1=new Quaternion;function Euler(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._order=r||Euler.DefaultOrder}function Layers(){this.mask=1}Euler.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],Euler.DefaultOrder="XYZ",Object.defineProperties(Euler.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}}),Object.assign(Euler.prototype,{isEuler:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var r=MathUtils.clamp,i=e.elements,a=i[0],o=i[4],s=i[8],l=i[1],c=i[5],u=i[9],h=i[2],p=i[6],d=i[10];return"XYZ"===(t=t||this._order)?(this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(p,c),this._z=0)):"YXZ"===t?(this._x=Math.asin(-r(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,a),this._z=0)):"ZXY"===t?(this._x=Math.asin(r(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,a))):"ZYX"===t?(this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(p,d),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-o,c))):"YZX"===t?(this._z=Math.asin(r(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,a)):(this._x=0,this._y=Math.atan2(s,d))):"XZY"===t?(this._z=Math.asin(-r(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-u,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,!1!==n&&this._onChangeCallback(),this},setFromQuaternion:function(e,t,n){return _matrix.makeRotationFromQuaternion(e),this.setFromRotationMatrix(_matrix,t,n)},setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(e){return _quaternion$1.setFromEuler(this),this.setFromQuaternion(_quaternion$1,e)},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new Vector3(this._x,this._y,this._z)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}}),Object.assign(Layers.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask|=1<<e|0},enableAll:function(){this.mask=-1},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},disableAll:function(){this.mask=0},test:function(e){return 0!=(this.mask&e.mask)}});var _object3DId=0,_v1$1=new Vector3,_q1=new Quaternion,_m1$1=new Matrix4,_target=new Vector3,_position=new Vector3,_scale=new Vector3,_quaternion$2=new Quaternion,_xAxis=new Vector3(1,0,0),_yAxis=new Vector3(0,1,0),_zAxis=new Vector3(0,0,1),_addedEvent={type:"added"},_removedEvent={type:"removed"};function Object3D(){Object.defineProperty(this,"id",{value:_object3DId++}),this.uuid=MathUtils.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Object3D.DefaultUp.clone();var e=new Vector3,t=new Euler,n=new Quaternion,r=new Vector3(1,1,1);t._onChange(function(){n.setFromEuler(t,!1)}),n._onChange(function(){t.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Matrix4},normalMatrix:{value:new Matrix3}}),this.matrix=new Matrix4,this.matrixWorld=new Matrix4,this.matrixAutoUpdate=Object3D.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Layers,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function Scene(){Object3D.call(this),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Object3D.DefaultUp=new Vector3(0,1,0),Object3D.DefaultMatrixAutoUpdate=!0,Object3D.prototype=Object.assign(Object.create(EventDispatcher.prototype),{constructor:Object3D,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(e,t){return _q1.setFromAxisAngle(e,t),this.quaternion.multiply(_q1),this},rotateOnWorldAxis:function(e,t){return _q1.setFromAxisAngle(e,t),this.quaternion.premultiply(_q1),this},rotateX:function(e){return this.rotateOnAxis(_xAxis,e)},rotateY:function(e){return this.rotateOnAxis(_yAxis,e)},rotateZ:function(e){return this.rotateOnAxis(_zAxis,e)},translateOnAxis:function(e,t){return _v1$1.copy(e).applyQuaternion(this.quaternion),this.position.add(_v1$1.multiplyScalar(t)),this},translateX:function(e){return this.translateOnAxis(_xAxis,e)},translateY:function(e){return this.translateOnAxis(_yAxis,e)},translateZ:function(e){return this.translateOnAxis(_zAxis,e)},localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(e){return e.applyMatrix4(_m1$1.getInverse(this.matrixWorld))},lookAt:function(e,t,n){e.isVector3?_target.copy(e):_target.set(e,t,n);var r=this.parent;this.updateWorldMatrix(!0,!1),_position.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?_m1$1.lookAt(_position,_target,this.up):_m1$1.lookAt(_target,_position,this.up),this.quaternion.setFromRotationMatrix(_m1$1),r&&(_m1$1.extractRotation(r.matrixWorld),_q1.setFromRotationMatrix(_m1$1),this.quaternion.premultiply(_q1.inverse()))},add:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(_addedEvent)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var n=this.children.indexOf(e);return-1!==n&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(_removedEvent)),this},attach:function(e){return this.updateWorldMatrix(!0,!1),_m1$1.getInverse(this.matrixWorld),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),_m1$1.multiply(e.parent.matrixWorld)),e.applyMatrix4(_m1$1),e.updateWorldMatrix(!1,!1),this.add(e),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var n=0,r=this.children.length;n<r;n++){var i=this.children[n].getObjectByProperty(e,t);if(void 0!==i)return i}},getWorldPosition:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),e=new Vector3),this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),e=new Quaternion),this.updateMatrixWorld(!0),this.matrixWorld.decompose(_position,e,_scale),e},getWorldScale:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),e=new Vector3),this.updateMatrixWorld(!0),this.matrixWorld.decompose(_position,_quaternion$2,e),e},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),e=new Vector3),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()},raycast:function(){},traverse:function(e){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)},updateWorldMatrix:function(e,t){var n=this.parent;if(!0===e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t)for(var r=this.children,i=0,a=r.length;i<a;i++)r[i].updateWorldMatrix(!1,!0)},toJSON:function(e){var t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};function i(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);var a=this.geometry.parameters;if(void 0!==a&&void 0!==a.shapes){var o=a.shapes;if(Array.isArray(o))for(var s=0,l=o.length;s<l;s++){var c=o[s];i(e.shapes,c)}else i(e.shapes,o)}}if(void 0!==this.material)if(Array.isArray(this.material)){var u=[];for(s=0,l=this.material.length;s<l;s++)u.push(i(e.materials,this.material[s]));r.material=u}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(s=0;s<this.children.length;s++)r.children.push(this.children[s].toJSON(e).object)}if(t){var h=m(e.geometries),p=m(e.materials),d=m(e.textures),f=m(e.images);o=m(e.shapes);h.length>0&&(n.geometries=h),p.length>0&&(n.materials=p),d.length>0&&(n.textures=d),f.length>0&&(n.images=f),o.length>0&&(n.shapes=o)}return n.object=r,n;function m(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var n=0;n<e.children.length;n++){var r=e.children[n];this.add(r.clone())}return this}}),Scene.prototype=Object.assign(Object.create(Object3D.prototype),{constructor:Scene,isScene:!0,copy:function(e,t){return Object3D.prototype.copy.call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var t=Object3D.prototype.toJSON.call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.environment&&(t.object.environment=this.environment.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t},dispose:function(){this.dispatchEvent({type:"dispose"})}});var _points=[new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3],_vector$1=new Vector3,_box=new Box3,_v0=new Vector3,_v1$2=new Vector3,_v2=new Vector3,_f0=new Vector3,_f1=new Vector3,_f2=new Vector3,_center=new Vector3,_extents=new Vector3,_triangleNormal=new Vector3,_testAxis=new Vector3;function Box3(e,t){this.min=void 0!==e?e:new Vector3(1/0,1/0,1/0),this.max=void 0!==t?t:new Vector3(-1/0,-1/0,-1/0)}function satForAxes(e,t,n,r,i){var a,o;for(a=0,o=e.length-3;a<=o;a+=3){_testAxis.fromArray(e,a);var s=i.x*Math.abs(_testAxis.x)+i.y*Math.abs(_testAxis.y)+i.z*Math.abs(_testAxis.z),l=t.dot(_testAxis),c=n.dot(_testAxis),u=r.dot(_testAxis);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>s)return!1}return!0}Object.assign(Box3.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,l=e.length;s<l;s+=3){var c=e[s],u=e[s+1],h=e[s+2];c<t&&(t=c),u<n&&(n=u),h<r&&(r=h),c>i&&(i=c),u>a&&(a=u),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(i,a,o),this},setFromBufferAttribute:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,l=e.count;s<l;s++){var c=e.getX(s),u=e.getY(s),h=e.getZ(s);c<t&&(t=c),u<n&&(n=u),h<r&&(r=h),c>i&&(i=c),u>a&&(a=u),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(i,a,o),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){var n=_vector$1.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this},setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box3: .getCenter() target is now required"),e=new Vector3),this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box3: .getSize() target is now required"),e=new Vector3),this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:function(e){e.updateWorldMatrix(!1,!1);var t=e.geometry;void 0!==t&&(null===t.boundingBox&&t.computeBoundingBox(),_box.copy(t.boundingBox),_box.applyMatrix4(e.matrixWorld),this.expandByPoint(_box.min),this.expandByPoint(_box.max));for(var n=e.children,r=0,i=n.length;r<i;r++)this.expandByObject(n[r]);return this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new Vector3),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)},intersectsSphere:function(e){return this.clampPoint(e.center,_vector$1),_vector$1.distanceToSquared(e.center)<=e.radius*e.radius},intersectsPlane:function(e){var t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant},intersectsTriangle:function(e){if(this.isEmpty())return!1;this.getCenter(_center),_extents.subVectors(this.max,_center),_v0.subVectors(e.a,_center),_v1$2.subVectors(e.b,_center),_v2.subVectors(e.c,_center),_f0.subVectors(_v1$2,_v0),_f1.subVectors(_v2,_v1$2),_f2.subVectors(_v0,_v2);var t=[0,-_f0.z,_f0.y,0,-_f1.z,_f1.y,0,-_f2.z,_f2.y,_f0.z,0,-_f0.x,_f1.z,0,-_f1.x,_f2.z,0,-_f2.x,-_f0.y,_f0.x,0,-_f1.y,_f1.x,0,-_f2.y,_f2.x,0];return!!satForAxes(t,_v0,_v1$2,_v2,_extents)&&(!!satForAxes(t=[1,0,0,0,1,0,0,0,1],_v0,_v1$2,_v2,_extents)&&(_triangleNormal.crossVectors(_f0,_f1),satForAxes(t=[_triangleNormal.x,_triangleNormal.y,_triangleNormal.z],_v0,_v1$2,_v2,_extents)))},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new Vector3),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return _vector$1.copy(e).clamp(this.min,this.max).sub(e).length()},getBoundingSphere:function(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(_vector$1).length(),e},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(e){return this.isEmpty()?this:(_points[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),_points[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),_points[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),_points[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),_points[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),_points[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),_points[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),_points[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(_points),this)},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var _box$1=new Box3;function Sphere(e,t){this.center=void 0!==e?e:new Vector3,this.radius=void 0!==t?t:0}Object.assign(Sphere.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(e,t){var n=this.center;void 0!==t?n.copy(t):_box$1.setFromPoints(e).getCenter(n);for(var r=0,i=0,a=e.length;i<a;i++)r=Math.max(r,n.distanceToSquared(e[i]));return this.radius=Math.sqrt(r),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,t){var n=this.center.distanceToSquared(e);return void 0===t&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),t=new Vector3),t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t},getBoundingBox:function(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new Box3),e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}});var _vector$2=new Vector3,_segCenter=new Vector3,_segDir=new Vector3,_diff=new Vector3,_edge1=new Vector3,_edge2=new Vector3,_normal=new Vector3;function Ray(e,t){this.origin=void 0!==e?e:new Vector3,this.direction=void 0!==t?t:new Vector3(0,0,-1)}Object.assign(Ray.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new Vector3),t.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(e){return this.origin.copy(this.at(e,_vector$2)),this},closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new Vector3),t.subVectors(e,this.origin);var n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(e){var t=_vector$2.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(_vector$2.copy(this.direction).multiplyScalar(t).add(this.origin),_vector$2.distanceToSquared(e))},distanceSqToSegment:function(e,t,n,r){_segCenter.copy(e).add(t).multiplyScalar(.5),_segDir.copy(t).sub(e).normalize(),_diff.copy(this.origin).sub(_segCenter);var i,a,o,s,l=.5*e.distanceTo(t),c=-this.direction.dot(_segDir),u=_diff.dot(this.direction),h=-_diff.dot(_segDir),p=_diff.lengthSq(),d=Math.abs(1-c*c);if(d>0)if(a=c*u-h,s=l*d,(i=c*h-u)>=0)if(a>=-s)if(a<=s){var f=1/d;o=(i*=f)*(i+c*(a*=f)+2*u)+a*(c*i+a+2*h)+p}else a=l,o=-(i=Math.max(0,-(c*a+u)))*i+a*(a+2*h)+p;else a=-l,o=-(i=Math.max(0,-(c*a+u)))*i+a*(a+2*h)+p;else a<=-s?o=-(i=Math.max(0,-(-c*l+u)))*i+(a=i>0?-l:Math.min(Math.max(-l,-h),l))*(a+2*h)+p:a<=s?(i=0,o=(a=Math.min(Math.max(-l,-h),l))*(a+2*h)+p):o=-(i=Math.max(0,-(c*l+u)))*i+(a=i>0?l:Math.min(Math.max(-l,-h),l))*(a+2*h)+p;else a=c>0?-l:l,o=-(i=Math.max(0,-(c*a+u)))*i+a*(a+2*h)+p;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(_segDir).multiplyScalar(a).add(_segCenter),o},intersectSphere:function(e,t){_vector$2.subVectors(e.center,this.origin);var n=_vector$2.dot(this.direction),r=_vector$2.dot(_vector$2)-n*n,i=e.radius*e.radius;if(r>i)return null;var a=Math.sqrt(i-r),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,t):this.at(o,t)},intersectsSphere:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null},intersectPlane:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0},intersectBox:function(e,t){var n,r,i,a,o,s,l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(n=(e.min.x-h.x)*l,r=(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,r=(e.min.x-h.x)*l),c>=0?(i=(e.min.y-h.y)*c,a=(e.max.y-h.y)*c):(i=(e.max.y-h.y)*c,a=(e.min.y-h.y)*c),n>a||i>r?null:((i>n||n!=n)&&(n=i),(a<r||r!=r)&&(r=a),u>=0?(o=(e.min.z-h.z)*u,s=(e.max.z-h.z)*u):(o=(e.max.z-h.z)*u,s=(e.min.z-h.z)*u),n>s||o>r?null:((o>n||n!=n)&&(n=o),(s<r||r!=r)&&(r=s),r<0?null:this.at(n>=0?n:r,t)))},intersectsBox:function(e){return null!==this.intersectBox(e,_vector$2)},intersectTriangle:function(e,t,n,r,i){_edge1.subVectors(t,e),_edge2.subVectors(n,e),_normal.crossVectors(_edge1,_edge2);var a,o=this.direction.dot(_normal);if(o>0){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}_diff.subVectors(this.origin,e);var s=a*this.direction.dot(_edge2.crossVectors(_diff,_edge2));if(s<0)return null;var l=a*this.direction.dot(_edge1.cross(_diff));if(l<0)return null;if(s+l>o)return null;var c=-a*_diff.dot(_normal);return c<0?null:this.at(c/o,i)},applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}});var _vector1=new Vector3,_vector2=new Vector3,_normalMatrix=new Matrix3;function Plane(e,t){this.normal=void 0!==e?e:new Vector3(1,0,0),this.constant=void 0!==t?t:0}Object.assign(Plane.prototype,{isPlane:!0,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(e,t,n){var r=_vector1.subVectors(n,t).cross(_vector2.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return void 0===t&&(console.warn("THREE.Plane: .projectPoint() target is now required"),t=new Vector3),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(e,t){void 0===t&&(console.warn("THREE.Plane: .intersectLine() target is now required"),t=new Vector3);var n=e.delta(_vector1),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):void 0;var i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?void 0:t.copy(n).multiplyScalar(i).add(e.start)},intersectsLine:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new Vector3),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(e,t){var n=t||_normalMatrix.getNormalMatrix(e),r=this.coplanarPoint(_vector1).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this},translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}});var _v0$1=new Vector3,_v1$3=new Vector3,_v2$1=new Vector3,_v3=new Vector3,_vab=new Vector3,_vac=new Vector3,_vbc=new Vector3,_vap=new Vector3,_vbp=new Vector3,_vcp=new Vector3;function Triangle(e,t,n){this.a=void 0!==e?e:new Vector3,this.b=void 0!==t?t:new Vector3,this.c=void 0!==n?n:new Vector3}Object.assign(Triangle,{getNormal:function(e,t,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new Vector3),r.subVectors(n,t),_v0$1.subVectors(e,t),r.cross(_v0$1);var i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)},getBarycoord:function(e,t,n,r,i){_v0$1.subVectors(r,t),_v1$3.subVectors(n,t),_v2$1.subVectors(e,t);var a=_v0$1.dot(_v0$1),o=_v0$1.dot(_v1$3),s=_v0$1.dot(_v2$1),l=_v1$3.dot(_v1$3),c=_v1$3.dot(_v2$1),u=a*l-o*o;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new Vector3),0===u)return i.set(-2,-1,-1);var h=1/u,p=(l*s-o*c)*h,d=(a*c-o*s)*h;return i.set(1-p-d,d,p)},containsPoint:function(e,t,n,r){return Triangle.getBarycoord(e,t,n,r,_v3),_v3.x>=0&&_v3.y>=0&&_v3.x+_v3.y<=1},getUV:function(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,_v3),s.set(0,0),s.addScaledVector(i,_v3.x),s.addScaledVector(a,_v3.y),s.addScaledVector(o,_v3.z),s},isFrontFacing:function(e,t,n,r){return _v0$1.subVectors(n,t),_v1$3.subVectors(e,t),_v0$1.cross(_v1$3).dot(r)<0}}),Object.assign(Triangle.prototype,{set:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},setFromPointsAndIndices:function(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},getArea:function(){return _v0$1.subVectors(this.c,this.b),_v1$3.subVectors(this.a,this.b),.5*_v0$1.cross(_v1$3).length()},getMidpoint:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new Vector3),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return Triangle.getNormal(this.a,this.b,this.c,e)},getPlane:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new Plane),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,t){return Triangle.getBarycoord(e,this.a,this.b,this.c,t)},getUV:function(e,t,n,r,i){return Triangle.getUV(e,this.a,this.b,this.c,t,n,r,i)},containsPoint:function(e){return Triangle.containsPoint(e,this.a,this.b,this.c)},isFrontFacing:function(e){return Triangle.isFrontFacing(this.a,this.b,this.c,e)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new Vector3);var n,r,i=this.a,a=this.b,o=this.c;_vab.subVectors(a,i),_vac.subVectors(o,i),_vap.subVectors(e,i);var s=_vab.dot(_vap),l=_vac.dot(_vap);if(s<=0&&l<=0)return t.copy(i);_vbp.subVectors(e,a);var c=_vab.dot(_vbp),u=_vac.dot(_vbp);if(c>=0&&u<=c)return t.copy(a);var h=s*u-c*l;if(h<=0&&s>=0&&c<=0)return n=s/(s-c),t.copy(i).addScaledVector(_vab,n);_vcp.subVectors(e,o);var p=_vab.dot(_vcp),d=_vac.dot(_vcp);if(d>=0&&p<=d)return t.copy(o);var f=p*l-s*d;if(f<=0&&l>=0&&d<=0)return r=l/(l-d),t.copy(i).addScaledVector(_vac,r);var m=c*d-p*u;if(m<=0&&u-c>=0&&p-d>=0)return _vbc.subVectors(o,a),r=(u-c)/(u-c+(p-d)),t.copy(a).addScaledVector(_vbc,r);var g=1/(m+f+h);return n=f*g,r=h*g,t.copy(i).addScaledVector(_vab,n).addScaledVector(_vac,r)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}});var _colorKeywords={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},_hslA={h:0,s:0,l:0},_hslB={h:0,s:0,l:0};function Color(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}function hue2rgb(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function SRGBToLinear(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function LinearToSRGB(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}function Face3(e,t,n,r,i,a){this.a=e,this.b=t,this.c=n,this.normal=r&&r.isVector3?r:new Vector3,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new Color,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==a?a:0}Object.assign(Color.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,n){return this.r=e,this.g=t,this.b=n,this},setHSL:function(e,t,n){if(e=MathUtils.euclideanModulo(e,1),t=MathUtils.clamp(t,0,1),n=MathUtils.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=hue2rgb(i,r,e+1/3),this.g=hue2rgb(i,r,e),this.b=hue2rgb(i,r,e-1/3)}return this},setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var r,i=n[1],a=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,l=parseInt(r[3],10)/100;return t(r[5]),this.setHSL(o,s,l)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var c=n[1],u=c.length;if(3===u)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===u)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this},setColorName:function(e){var t=_colorKeywords[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this},convertGammaToLinear:function(e){return this.copyGammaToLinear(this,e),this},convertLinearToGamma:function(e){return this.copyLinearToGamma(this,e),this},copySRGBToLinear:function(e){return this.r=SRGBToLinear(e.r),this.g=SRGBToLinear(e.g),this.b=SRGBToLinear(e.b),this},copyLinearToSRGB:function(e){return this.r=LinearToSRGB(e.r),this.g=LinearToSRGB(e.g),this.b=LinearToSRGB(e.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,n,r=this.r,i=this.g,a=this.b,o=Math.max(r,i,a),s=Math.min(r,i,a),l=(s+o)/2;if(s===o)t=0,n=0;else{var c=o-s;switch(n=l<=.5?c/(o+s):c/(2-o-s),o){case r:t=(i-a)/c+(i<a?6:0);break;case i:t=(a-r)/c+2;break;case a:t=(r-i)/c+4}t/=6}return e.h=t,e.s=n,e.l=l,e},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,n){return this.getHSL(_hslA),_hslA.h+=e,_hslA.s+=t,_hslA.l+=n,this.setHSL(_hslA.h,_hslA.s,_hslA.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},lerpHSL:function(e,t){this.getHSL(_hslA),e.getHSL(_hslB);var n=MathUtils.lerp(_hslA.h,_hslB.h,t),r=MathUtils.lerp(_hslA.s,_hslB.s,t),i=MathUtils.lerp(_hslA.l,_hslB.l,t);return this.setHSL(n,r,i),this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}}),Color.NAMES=_colorKeywords,Object.assign(Face3.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,n=e.vertexNormals.length;t<n;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(t=0,n=e.vertexColors.length;t<n;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}});var materialId=0;function Material(){Object.defineProperty(this,"id",{value:materialId++}),this.uuid=MathUtils.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=NormalBlending,this.side=FrontSide,this.flatShading=!1,this.vertexTangents=!1,this.vertexColors=NoColors,this.opacity=1,this.transparent=!1,this.blendSrc=SrcAlphaFactor,this.blendDst=OneMinusSrcAlphaFactor,this.blendEquation=AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=LessEqualDepth,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=AlwaysStencilFunc,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=KeepStencilOp,this.stencilZFail=KeepStencilOp,this.stencilZPass=KeepStencilOp,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function MeshBasicMaterial(e){Material.call(this),this.type="MeshBasicMaterial",this.color=new Color(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.setValues(e)}Material.prototype=Object.assign(Object.create(EventDispatcher.prototype),{constructor:Material,isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n)if("shading"!==t){var r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===FlatShading;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(e){var t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,n.reflectivity=this.reflectivity,n.refractionRatio=this.refractionRatio,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==NormalBlending&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),this.side!==FrontSide&&(n.side=this.side),this.vertexColors!==NoColors&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){var i=r(e.textures),a=r(e.images);i.length>0&&(n.textures=i),a.length>0&&(n.images=a)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexTangents=e.vertexTangents,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,n=null;if(null!==t){var r=t.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Material.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),MeshBasicMaterial.prototype=Object.create(Material.prototype),MeshBasicMaterial.prototype.constructor=MeshBasicMaterial,MeshBasicMaterial.prototype.isMeshBasicMaterial=!0,MeshBasicMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this};var _vector$3=new Vector3;function BufferAttribute(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=StaticDrawUsage,this.updateRange={offset:0,count:-1},this.version=0}function Int8BufferAttribute(e,t,n){BufferAttribute.call(this,new Int8Array(e),t,n)}function Uint8BufferAttribute(e,t,n){BufferAttribute.call(this,new Uint8Array(e),t,n)}function Uint8ClampedBufferAttribute(e,t,n){BufferAttribute.call(this,new Uint8ClampedArray(e),t,n)}function Int16BufferAttribute(e,t,n){BufferAttribute.call(this,new Int16Array(e),t,n)}function Uint16BufferAttribute(e,t,n){BufferAttribute.call(this,new Uint16Array(e),t,n)}function Int32BufferAttribute(e,t,n){BufferAttribute.call(this,new Int32Array(e),t,n)}function Uint32BufferAttribute(e,t,n){BufferAttribute.call(this,new Uint32Array(e),t,n)}function Float32BufferAttribute(e,t,n){BufferAttribute.call(this,new Float32Array(e),t,n)}function Float64BufferAttribute(e,t,n){BufferAttribute.call(this,new Float64Array(e),t,n)}function DirectGeometry(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function arrayMax(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,r=e.length;n<r;++n)e[n]>t&&(t=e[n]);return t}Object.defineProperty(BufferAttribute.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(BufferAttribute.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),a=new Color),t[n++]=a.r,t[n++]=a.g,t[n++]=a.b}return this},copyVector2sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),a=new Vector2),t[n++]=a.x,t[n++]=a.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),a=new Vector3),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),a=new Vector4),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n++]=a.w}return this},applyMatrix3:function(e){for(var t=0,n=this.count;t<n;t++)_vector$3.x=this.getX(t),_vector$3.y=this.getY(t),_vector$3.z=this.getZ(t),_vector$3.applyMatrix3(e),this.setXYZ(t,_vector$3.x,_vector$3.y,_vector$3.z);return this},applyMatrix4:function(e){for(var t=0,n=this.count;t<n;t++)_vector$3.x=this.getX(t),_vector$3.y=this.getY(t),_vector$3.z=this.getZ(t),_vector$3.applyMatrix4(e),this.setXYZ(t,_vector$3.x,_vector$3.y,_vector$3.z);return this},applyNormalMatrix:function(e){for(var t=0,n=this.count;t<n;t++)_vector$3.x=this.getX(t),_vector$3.y=this.getY(t),_vector$3.z=this.getZ(t),_vector$3.applyNormalMatrix(e),this.setXYZ(t,_vector$3.x,_vector$3.y,_vector$3.z);return this},transformDirection:function(e){for(var t=0,n=this.count;t<n;t++)_vector$3.x=this.getX(t),_vector$3.y=this.getY(t),_vector$3.z=this.getZ(t),_vector$3.transformDirection(e),this.setXYZ(t,_vector$3.x,_vector$3.y,_vector$3.z);return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),Int8BufferAttribute.prototype=Object.create(BufferAttribute.prototype),Int8BufferAttribute.prototype.constructor=Int8BufferAttribute,Uint8BufferAttribute.prototype=Object.create(BufferAttribute.prototype),Uint8BufferAttribute.prototype.constructor=Uint8BufferAttribute,Uint8ClampedBufferAttribute.prototype=Object.create(BufferAttribute.prototype),Uint8ClampedBufferAttribute.prototype.constructor=Uint8ClampedBufferAttribute,Int16BufferAttribute.prototype=Object.create(BufferAttribute.prototype),Int16BufferAttribute.prototype.constructor=Int16BufferAttribute,Uint16BufferAttribute.prototype=Object.create(BufferAttribute.prototype),Uint16BufferAttribute.prototype.constructor=Uint16BufferAttribute,Int32BufferAttribute.prototype=Object.create(BufferAttribute.prototype),Int32BufferAttribute.prototype.constructor=Int32BufferAttribute,Uint32BufferAttribute.prototype=Object.create(BufferAttribute.prototype),Uint32BufferAttribute.prototype.constructor=Uint32BufferAttribute,Float32BufferAttribute.prototype=Object.create(BufferAttribute.prototype),Float32BufferAttribute.prototype.constructor=Float32BufferAttribute,Float64BufferAttribute.prototype=Object.create(BufferAttribute.prototype),Float64BufferAttribute.prototype.constructor=Float64BufferAttribute,Object.assign(DirectGeometry.prototype,{computeGroups:function(e){for(var t,n=[],r=void 0,i=e.faces,a=0;a<i.length;a++){var o=i[a];o.materialIndex!==r&&(r=o.materialIndex,void 0!==t&&(t.count=3*a-t.start,n.push(t)),t={start:3*a,materialIndex:r})}void 0!==t&&(t.count=3*a-t.start,n.push(t)),this.groups=n},fromGeometry:function(e){var t,n=e.faces,r=e.vertices,i=e.faceVertexUvs,a=i[0]&&i[0].length>0,o=i[1]&&i[1].length>0,s=e.morphTargets,l=s.length;if(l>0){t=[];for(var c=0;c<l;c++)t[c]={name:s[c].name,data:[]};this.morphTargets.position=t}var u,h=e.morphNormals,p=h.length;if(p>0){u=[];for(c=0;c<p;c++)u[c]={name:h[c].name,data:[]};this.morphTargets.normal=u}var d=e.skinIndices,f=e.skinWeights,m=d.length===r.length,g=f.length===r.length;r.length>0&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(c=0;c<n.length;c++){var v=n[c];this.vertices.push(r[v.a],r[v.b],r[v.c]);var y=v.vertexNormals;if(3===y.length)this.normals.push(y[0],y[1],y[2]);else{var x=v.normal;this.normals.push(x,x,x)}var _,b=v.vertexColors;if(3===b.length)this.colors.push(b[0],b[1],b[2]);else{var w=v.color;this.colors.push(w,w,w)}if(!0===a)void 0!==(_=i[0][c])?this.uvs.push(_[0],_[1],_[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",c),this.uvs.push(new Vector2,new Vector2,new Vector2));if(!0===o)void 0!==(_=i[1][c])?this.uvs2.push(_[0],_[1],_[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",c),this.uvs2.push(new Vector2,new Vector2,new Vector2));for(var M=0;M<l;M++){var S=s[M].vertices;t[M].data.push(S[v.a],S[v.b],S[v.c])}for(M=0;M<p;M++){var T=h[M].vertexNormals[c];u[M].data.push(T.a,T.b,T.c)}m&&this.skinIndices.push(d[v.a],d[v.b],d[v.c]),g&&this.skinWeights.push(f[v.a],f[v.b],f[v.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this}});var _bufferGeometryId=1,_m1$2=new Matrix4,_obj=new Object3D,_offset=new Vector3,_box$2=new Box3,_boxMorphTargets=new Box3,_vector$4=new Vector3;function BufferGeometry(){Object.defineProperty(this,"id",{value:_bufferGeometryId+=2}),this.uuid=MathUtils.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}BufferGeometry.prototype=Object.assign(Object.create(EventDispatcher.prototype),{constructor:BufferGeometry,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(arrayMax(e)>65535?Uint32BufferAttribute:Uint16BufferAttribute)(e,1):this.index=e},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,n){this.groups.push({start:e,count:t,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var r=(new Matrix3).getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return _m1$2.makeRotationX(e),this.applyMatrix4(_m1$2),this},rotateY:function(e){return _m1$2.makeRotationY(e),this.applyMatrix4(_m1$2),this},rotateZ:function(e){return _m1$2.makeRotationZ(e),this.applyMatrix4(_m1$2),this},translate:function(e,t,n){return _m1$2.makeTranslation(e,t,n),this.applyMatrix4(_m1$2),this},scale:function(e,t,n){return _m1$2.makeScale(e,t,n),this.applyMatrix4(_m1$2),this},lookAt:function(e){return _obj.lookAt(e),_obj.updateMatrix(),this.applyMatrix4(_obj.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(_offset).negate(),this.translate(_offset.x,_offset.y,_offset.z),this},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new Float32BufferAttribute(3*t.vertices.length,3),r=new Float32BufferAttribute(3*t.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(t.vertices)),this.setAttribute("color",r.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var i=new Float32BufferAttribute(t.lineDistances.length,1);this.setAttribute("lineDistance",i.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];t.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new Float32BufferAttribute(t,3)),this},updateFromObject:function(e){var t,n=e.geometry;if(e.isMesh){var r=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(r=void 0,n.elementsNeedUpdate=!1),void 0===r)return this.fromGeometry(n);r.verticesNeedUpdate=n.verticesNeedUpdate,r.normalsNeedUpdate=n.normalsNeedUpdate,r.colorsNeedUpdate=n.colorsNeedUpdate,r.uvsNeedUpdate=n.uvsNeedUpdate,r.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=r}return!0===n.verticesNeedUpdate&&(void 0!==(t=this.attributes.position)&&(t.copyVector3sArray(n.vertices),t.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(t=this.attributes.normal)&&(t.copyVector3sArray(n.normals),t.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(t=this.attributes.color)&&(t.copyColorsArray(n.colors),t.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(t=this.attributes.uv)&&(t.copyVector2sArray(n.uvs),t.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(t=this.attributes.lineDistance)&&(t.copyArray(n.lineDistances),t.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(e.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new DirectGeometry).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.setAttribute("position",new BufferAttribute(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var n=new Float32Array(3*e.normals.length);this.setAttribute("normal",new BufferAttribute(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var r=new Float32Array(3*e.colors.length);this.setAttribute("color",new BufferAttribute(r,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var i=new Float32Array(2*e.uvs.length);this.setAttribute("uv",new BufferAttribute(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var a=new Float32Array(2*e.uvs2.length);this.setAttribute("uv2",new BufferAttribute(a,2).copyVector2sArray(e.uvs2))}for(var o in this.groups=e.groups,e.morphTargets){for(var s=[],l=e.morphTargets[o],c=0,u=l.length;c<u;c++){var h=l[c],p=new Float32BufferAttribute(3*h.data.length,3);p.name=h.name,s.push(p.copyVector3sArray(h.data))}this.morphAttributes[o]=s}if(e.skinIndices.length>0){var d=new Float32BufferAttribute(4*e.skinIndices.length,4);this.setAttribute("skinIndex",d.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var f=new Float32BufferAttribute(4*e.skinWeights.length,4);this.setAttribute("skinWeight",f.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Box3);var e=this.attributes.position,t=this.morphAttributes.position;if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(var n=0,r=t.length;n<r;n++){var i=t[n];_box$2.setFromBufferAttribute(i),this.morphTargetsRelative?(_vector$4.addVectors(this.boundingBox.min,_box$2.min),this.boundingBox.expandByPoint(_vector$4),_vector$4.addVectors(this.boundingBox.max,_box$2.max),this.boundingBox.expandByPoint(_vector$4)):(this.boundingBox.expandByPoint(_box$2.min),this.boundingBox.expandByPoint(_box$2.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Sphere);var e=this.attributes.position,t=this.morphAttributes.position;if(e){var n=this.boundingSphere.center;if(_box$2.setFromBufferAttribute(e),t)for(var r=0,i=t.length;r<i;r++){var a=t[r];_boxMorphTargets.setFromBufferAttribute(a),this.morphTargetsRelative?(_vector$4.addVectors(_box$2.min,_boxMorphTargets.min),_box$2.expandByPoint(_vector$4),_vector$4.addVectors(_box$2.max,_boxMorphTargets.max),_box$2.expandByPoint(_vector$4)):(_box$2.expandByPoint(_boxMorphTargets.min),_box$2.expandByPoint(_boxMorphTargets.max))}_box$2.getCenter(n);var o=0;for(r=0,i=e.count;r<i;r++)_vector$4.fromBufferAttribute(e,r),o=Math.max(o,n.distanceToSquared(_vector$4));if(t)for(r=0,i=t.length;r<i;r++){a=t[r];for(var s=this.morphTargetsRelative,l=0,c=a.count;l<c;l++)_vector$4.fromBufferAttribute(a,l),s&&(_offset.fromBufferAttribute(e,l),_vector$4.add(_offset)),o=Math.max(o,n.distanceToSquared(_vector$4))}this.boundingSphere.radius=Math.sqrt(o),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,t=this.attributes;if(t.position){var n=t.position.array;if(void 0===t.normal)this.setAttribute("normal",new BufferAttribute(new Float32Array(n.length),3));else for(var r=t.normal.array,i=0,a=r.length;i<a;i++)r[i]=0;var o,s,l,c=t.normal.array,u=new Vector3,h=new Vector3,p=new Vector3,d=new Vector3,f=new Vector3;if(e){var m=e.array;for(i=0,a=e.count;i<a;i+=3)o=3*m[i+0],s=3*m[i+1],l=3*m[i+2],u.fromArray(n,o),h.fromArray(n,s),p.fromArray(n,l),d.subVectors(p,h),f.subVectors(u,h),d.cross(f),c[o]+=d.x,c[o+1]+=d.y,c[o+2]+=d.z,c[s]+=d.x,c[s+1]+=d.y,c[s+2]+=d.z,c[l]+=d.x,c[l+1]+=d.y,c[l+2]+=d.z}else for(i=0,a=n.length;i<a;i+=9)u.fromArray(n,i),h.fromArray(n,i+3),p.fromArray(n,i+6),d.subVectors(p,h),f.subVectors(u,h),d.cross(f),c[i]=d.x,c[i+1]=d.y,c[i+2]=d.z,c[i+3]=d.x,c[i+4]=d.y,c[i+5]=d.z,c[i+6]=d.x,c[i+7]=d.y,c[i+8]=d.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge:function(e,t){if(e&&e.isBufferGeometry){void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var r in n)if(void 0!==e.attributes[r])for(var i=n[r].array,a=e.attributes[r],o=a.array,s=a.itemSize*t,l=Math.min(o.length,i.length-s),c=0,u=s;c<l;c++,u++)i[u]=o[c];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)},normalizeNormals:function(){for(var e=this.attributes.normal,t=0,n=e.count;t<n;t++)_vector$4.x=e.getX(t),_vector$4.y=e.getY(t),_vector$4.z=e.getZ(t),_vector$4.normalize(),e.setXYZ(t,_vector$4.x,_vector$4.y,_vector$4.z)},toNonIndexed:function(){function e(e,t){for(var n=e.array,r=e.itemSize,i=new n.constructor(t.length*r),a=0,o=0,s=0,l=t.length;s<l;s++){a=t[s]*r;for(var c=0;c<r;c++)i[o++]=n[a++]}return new BufferAttribute(i,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new BufferGeometry,n=this.index.array,r=this.attributes;for(var i in r){var a=e(r[i],n);t.setAttribute(i,a)}var o=this.morphAttributes;for(i in o){for(var s=[],l=o[i],c=0,u=l.length;c<u;c++){a=e(l[c],n);s.push(a)}t.morphAttributes[i]=s}t.morphTargetsRelative=this.morphTargetsRelative;for(var h=this.groups,p=(c=0,h.length);c<p;c++){var d=h[c];t.addGroup(d.start,d.count,d.materialIndex)}return t},toJSON:function(){var e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var r=this.index;null!==r&&(e.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});var i=this.attributes;for(var n in i){var a=(p=i[n]).toJSON();""!==p.name&&(a.name=p.name),e.data.attributes[n]=a}var o={},s=!1;for(var n in this.morphAttributes){for(var l=this.morphAttributes[n],c=[],u=0,h=l.length;u<h;u++){var p;a=(p=l[u]).toJSON();""!==p.name&&(a.name=p.name),c.push(a)}c.length>0&&(o[n]=c,s=!0)}s&&(e.data.morphAttributes=o,e.data.morphTargetsRelative=this.morphTargetsRelative);var d=this.groups;d.length>0&&(e.data.groups=JSON.parse(JSON.stringify(d)));var f=this.boundingSphere;return null!==f&&(e.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),e},clone:function(){return(new BufferGeometry).copy(this)},copy:function(e){var t,n,r;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var i=e.index;null!==i&&this.setIndex(i.clone());var a=e.attributes;for(t in a){var o=a[t];this.setAttribute(t,o.clone())}var s=e.morphAttributes;for(t in s){var l=[],c=s[t];for(n=0,r=c.length;n<r;n++)l.push(c[n].clone());this.morphAttributes[t]=l}this.morphTargetsRelative=e.morphTargetsRelative;var u=e.groups;for(n=0,r=u.length;n<r;n++){var h=u[n];this.addGroup(h.start,h.count,h.materialIndex)}var p=e.boundingBox;null!==p&&(this.boundingBox=p.clone());var d=e.boundingSphere;return null!==d&&(this.boundingSphere=d.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var _inverseMatrix=new Matrix4,_ray=new Ray,_sphere=new Sphere,_vA=new Vector3,_vB=new Vector3,_vC=new Vector3,_tempA=new Vector3,_tempB=new Vector3,_tempC=new Vector3,_morphA=new Vector3,_morphB=new Vector3,_morphC=new Vector3,_uvA=new Vector2,_uvB=new Vector2,_uvC=new Vector2,_intersectionPoint=new Vector3,_intersectionPointWorld=new Vector3;function Mesh(e,t){Object3D.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new BufferGeometry,this.material=void 0!==t?t:new MeshBasicMaterial,this.updateMorphTargets()}function checkIntersection(e,t,n,r,i,a,o,s){if(null===(t.side===BackSide?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,t.side!==DoubleSide,s)))return null;_intersectionPointWorld.copy(s),_intersectionPointWorld.applyMatrix4(e.matrixWorld);var l=n.ray.origin.distanceTo(_intersectionPointWorld);return l<n.near||l>n.far?null:{distance:l,point:_intersectionPointWorld.clone(),object:e}}function checkBufferGeometryIntersection(e,t,n,r,i,a,o,s,l,c,u,h){_vA.fromBufferAttribute(i,c),_vB.fromBufferAttribute(i,u),_vC.fromBufferAttribute(i,h);var p=e.morphTargetInfluences;if(t.morphTargets&&a&&p){_morphA.set(0,0,0),_morphB.set(0,0,0),_morphC.set(0,0,0);for(var d=0,f=a.length;d<f;d++){var m=p[d],g=a[d];0!==m&&(_tempA.fromBufferAttribute(g,c),_tempB.fromBufferAttribute(g,u),_tempC.fromBufferAttribute(g,h),o?(_morphA.addScaledVector(_tempA,m),_morphB.addScaledVector(_tempB,m),_morphC.addScaledVector(_tempC,m)):(_morphA.addScaledVector(_tempA.sub(_vA),m),_morphB.addScaledVector(_tempB.sub(_vB),m),_morphC.addScaledVector(_tempC.sub(_vC),m)))}_vA.add(_morphA),_vB.add(_morphB),_vC.add(_morphC)}var v=checkIntersection(e,t,n,r,_vA,_vB,_vC,_intersectionPoint);if(v){s&&(_uvA.fromBufferAttribute(s,c),_uvB.fromBufferAttribute(s,u),_uvC.fromBufferAttribute(s,h),v.uv=Triangle.getUV(_intersectionPoint,_vA,_vB,_vC,_uvA,_uvB,_uvC,new Vector2)),l&&(_uvA.fromBufferAttribute(l,c),_uvB.fromBufferAttribute(l,u),_uvC.fromBufferAttribute(l,h),v.uv2=Triangle.getUV(_intersectionPoint,_vA,_vB,_vC,_uvA,_uvB,_uvC,new Vector2));var y=new Face3(c,u,h);Triangle.getNormal(_vA,_vB,_vC,y.normal),v.face=y}return v}Mesh.prototype=Object.assign(Object.create(Object3D.prototype),{constructor:Mesh,isMesh:!0,copy:function(e){return Object3D.prototype.copy.call(this,e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e,t,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,a=Object.keys(i);if(a.length>0){var o=i[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=r.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){var n,r=this.geometry,i=this.material,a=this.matrixWorld;if(void 0!==i&&(null===r.boundingSphere&&r.computeBoundingSphere(),_sphere.copy(r.boundingSphere),_sphere.applyMatrix4(a),!1!==e.ray.intersectsSphere(_sphere)&&(_inverseMatrix.getInverse(a),_ray.copy(e.ray).applyMatrix4(_inverseMatrix),null===r.boundingBox||!1!==_ray.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var o,s,l,c,u,h,p,d,f,m=r.index,g=r.attributes.position,v=r.morphAttributes.position,y=r.morphTargetsRelative,x=r.attributes.uv,_=r.attributes.uv2,b=r.groups,w=r.drawRange;if(null!==m)if(Array.isArray(i))for(c=0,h=b.length;c<h;c++)for(f=i[(d=b[c]).materialIndex],u=Math.max(d.start,w.start),p=Math.min(d.start+d.count,w.start+w.count);u<p;u+=3)o=m.getX(u),s=m.getX(u+1),l=m.getX(u+2),(n=checkBufferGeometryIntersection(this,f,e,_ray,g,v,y,x,_,o,s,l))&&(n.faceIndex=Math.floor(u/3),n.face.materialIndex=d.materialIndex,t.push(n));else for(c=Math.max(0,w.start),h=Math.min(m.count,w.start+w.count);c<h;c+=3)o=m.getX(c),s=m.getX(c+1),l=m.getX(c+2),(n=checkBufferGeometryIntersection(this,i,e,_ray,g,v,y,x,_,o,s,l))&&(n.faceIndex=Math.floor(c/3),t.push(n));else if(void 0!==g)if(Array.isArray(i))for(c=0,h=b.length;c<h;c++)for(f=i[(d=b[c]).materialIndex],u=Math.max(d.start,w.start),p=Math.min(d.start+d.count,w.start+w.count);u<p;u+=3)(n=checkBufferGeometryIntersection(this,f,e,_ray,g,v,y,x,_,o=u,s=u+1,l=u+2))&&(n.faceIndex=Math.floor(u/3),n.face.materialIndex=d.materialIndex,t.push(n));else for(c=Math.max(0,w.start),h=Math.min(g.count,w.start+w.count);c<h;c+=3)(n=checkBufferGeometryIntersection(this,i,e,_ray,g,v,y,x,_,o=c,s=c+1,l=c+2))&&(n.faceIndex=Math.floor(c/3),t.push(n))}else if(r.isGeometry){var M,S,T,E,C=Array.isArray(i),A=r.vertices,L=r.faces,D=r.faceVertexUvs[0];D.length>0&&(E=D);for(var P=0,O=L.length;P<O;P++){var R=L[P],I=C?i[R.materialIndex]:i;if(void 0!==I&&(M=A[R.a],S=A[R.b],T=A[R.c],n=checkIntersection(this,I,e,_ray,M,S,T,_intersectionPoint))){if(E&&E[P]){var B=E[P];_uvA.copy(B[0]),_uvB.copy(B[1]),_uvC.copy(B[2]),n.uv=Triangle.getUV(_intersectionPoint,M,S,T,_uvA,_uvB,_uvC,new Vector2)}n.face=R,n.faceIndex=P,t.push(n)}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var _geometryId=0,_m1$3=new Matrix4,_obj$1=new Object3D,_offset$1=new Vector3;function Geometry(){Object.defineProperty(this,"id",{value:_geometryId+=2}),this.uuid=MathUtils.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}Geometry.prototype=Object.assign(Object.create(EventDispatcher.prototype),{constructor:Geometry,isGeometry:!0,applyMatrix4:function(e){for(var t=(new Matrix3).getNormalMatrix(e),n=0,r=this.vertices.length;n<r;n++){this.vertices[n].applyMatrix4(e)}for(n=0,r=this.faces.length;n<r;n++){var i=this.faces[n];i.normal.applyMatrix3(t).normalize();for(var a=0,o=i.vertexNormals.length;a<o;a++)i.vertexNormals[a].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(e){return _m1$3.makeRotationX(e),this.applyMatrix4(_m1$3),this},rotateY:function(e){return _m1$3.makeRotationY(e),this.applyMatrix4(_m1$3),this},rotateZ:function(e){return _m1$3.makeRotationZ(e),this.applyMatrix4(_m1$3),this},translate:function(e,t,n){return _m1$3.makeTranslation(e,t,n),this.applyMatrix4(_m1$3),this},scale:function(e,t,n){return _m1$3.makeScale(e,t,n),this.applyMatrix4(_m1$3),this},lookAt:function(e){return _obj$1.lookAt(e),_obj$1.updateMatrix(),this.applyMatrix4(_obj$1.matrix),this},fromBufferGeometry:function(e){var t=this,n=null!==e.index?e.index.array:void 0,r=e.attributes;if(void 0===r.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var i=r.position.array,a=void 0!==r.normal?r.normal.array:void 0,o=void 0!==r.color?r.color.array:void 0,s=void 0!==r.uv?r.uv.array:void 0,l=void 0!==r.uv2?r.uv2.array:void 0;void 0!==l&&(this.faceVertexUvs[1]=[]);for(var c=0;c<i.length;c+=3)t.vertices.push((new Vector3).fromArray(i,c)),void 0!==o&&t.colors.push((new Color).fromArray(o,c));function u(e,n,r,i){var c=void 0===o?[]:[t.colors[e].clone(),t.colors[n].clone(),t.colors[r].clone()],u=new Face3(e,n,r,void 0===a?[]:[(new Vector3).fromArray(a,3*e),(new Vector3).fromArray(a,3*n),(new Vector3).fromArray(a,3*r)],c,i);t.faces.push(u),void 0!==s&&t.faceVertexUvs[0].push([(new Vector2).fromArray(s,2*e),(new Vector2).fromArray(s,2*n),(new Vector2).fromArray(s,2*r)]),void 0!==l&&t.faceVertexUvs[1].push([(new Vector2).fromArray(l,2*e),(new Vector2).fromArray(l,2*n),(new Vector2).fromArray(l,2*r)])}var h=e.groups;if(h.length>0)for(c=0;c<h.length;c++)for(var p=h[c],d=p.start,f=d,m=d+p.count;f<m;f+=3)void 0!==n?u(n[f],n[f+1],n[f+2],p.materialIndex):u(f,f+1,f+2,p.materialIndex);else if(void 0!==n)for(c=0;c<n.length;c+=3)u(n[c],n[c+1],n[c+2]);else for(c=0;c<i.length/3;c+=3)u(c,c+1,c+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(_offset$1).negate(),this.translate(_offset$1.x,_offset$1.y,_offset$1.z),this},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=0===t?1:1/t,r=new Matrix4;return r.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix4(r),this},computeFaceNormals:function(){for(var e=new Vector3,t=new Vector3,n=0,r=this.faces.length;n<r;n++){var i=this.faces[n],a=this.vertices[i.a],o=this.vertices[i.b],s=this.vertices[i.c];e.subVectors(s,o),t.subVectors(a,o),e.cross(t),e.normalize(),i.normal.copy(e)}},computeVertexNormals:function(e){var t,n,r,i,a,o;for(void 0===e&&(e=!0),o=new Array(this.vertices.length),t=0,n=this.vertices.length;t<n;t++)o[t]=new Vector3;if(e){var s,l,c,u=new Vector3,h=new Vector3;for(r=0,i=this.faces.length;r<i;r++)a=this.faces[r],s=this.vertices[a.a],l=this.vertices[a.b],c=this.vertices[a.c],u.subVectors(c,l),h.subVectors(s,l),u.cross(h),o[a.a].add(u),o[a.b].add(u),o[a.c].add(u)}else for(this.computeFaceNormals(),r=0,i=this.faces.length;r<i;r++)o[(a=this.faces[r]).a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(t=0,n=this.vertices.length;t<n;t++)o[t].normalize();for(r=0,i=this.faces.length;r<i;r++){var p=(a=this.faces[r]).vertexNormals;3===p.length?(p[0].copy(o[a.a]),p[1].copy(o[a.b]),p[2].copy(o[a.c])):(p[0]=o[a.a].clone(),p[1]=o[a.b].clone(),p[2]=o[a.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,t,n;for(this.computeFaceNormals(),e=0,t=this.faces.length;e<t;e++){var r=(n=this.faces[e]).vertexNormals;3===r.length?(r[0].copy(n.normal),r[1].copy(n.normal),r[2].copy(n.normal)):(r[0]=n.normal.clone(),r[1]=n.normal.clone(),r[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,n,r,i;for(n=0,r=this.faces.length;n<r;n++)for((i=this.faces[n]).__originalFaceNormal?i.__originalFaceNormal.copy(i.normal):i.__originalFaceNormal=i.normal.clone(),i.__originalVertexNormals||(i.__originalVertexNormals=[]),e=0,t=i.vertexNormals.length;e<t;e++)i.__originalVertexNormals[e]?i.__originalVertexNormals[e].copy(i.vertexNormals[e]):i.__originalVertexNormals[e]=i.vertexNormals[e].clone();var a=new Geometry;for(a.faces=this.faces,e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var o=this.morphNormals[e].faceNormals,s=this.morphNormals[e].vertexNormals;for(n=0,r=this.faces.length;n<r;n++)l=new Vector3,c={a:new Vector3,b:new Vector3,c:new Vector3},o.push(l),s.push(c)}var l,c,u=this.morphNormals[e];for(a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals(),n=0,r=this.faces.length;n<r;n++)i=this.faces[n],l=u.faceNormals[n],c=u.vertexNormals[n],l.copy(i.normal),c.a.copy(i.vertexNormals[0]),c.b.copy(i.vertexNormals[1]),c.c.copy(i.vertexNormals[2])}for(n=0,r=this.faces.length;n<r;n++)(i=this.faces[n]).normal=i.__originalFaceNormal,i.vertexNormals=i.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Sphere),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(e&&e.isGeometry){var r,i=this.vertices.length,a=this.vertices,o=e.vertices,s=this.faces,l=e.faces,c=this.colors,u=e.colors;void 0===n&&(n=0),void 0!==t&&(r=(new Matrix3).getNormalMatrix(t));for(var h=0,p=o.length;h<p;h++){var d=o[h].clone();void 0!==t&&d.applyMatrix4(t),a.push(d)}for(h=0,p=u.length;h<p;h++)c.push(u[h].clone());for(h=0,p=l.length;h<p;h++){var f,m,g,v=l[h],y=v.vertexNormals,x=v.vertexColors;(f=new Face3(v.a+i,v.b+i,v.c+i)).normal.copy(v.normal),void 0!==r&&f.normal.applyMatrix3(r).normalize();for(var _=0,b=y.length;_<b;_++)m=y[_].clone(),void 0!==r&&m.applyMatrix3(r).normalize(),f.vertexNormals.push(m);f.color.copy(v.color);for(_=0,b=x.length;_<b;_++)g=x[_],f.vertexColors.push(g.clone());f.materialIndex=v.materialIndex+n,s.push(f)}for(h=0,p=e.faceVertexUvs.length;h<p;h++){var w=e.faceVertexUvs[h];void 0===this.faceVertexUvs[h]&&(this.faceVertexUvs[h]=[]);for(_=0,b=w.length;_<b;_++){for(var M=w[_],S=[],T=0,E=M.length;T<E;T++)S.push(M[T].clone());this.faceVertexUvs[h].push(S)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e)},mergeMesh:function(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)},mergeVertices:function(){var e,t,n,r,i,a,o,s,l={},c=[],u=[],h=Math.pow(10,4);for(n=0,r=this.vertices.length;n<r;n++)e=this.vertices[n],void 0===l[t=Math.round(e.x*h)+"_"+Math.round(e.y*h)+"_"+Math.round(e.z*h)]?(l[t]=n,c.push(this.vertices[n]),u[n]=c.length-1):u[n]=u[l[t]];var p=[];for(n=0,r=this.faces.length;n<r;n++){(i=this.faces[n]).a=u[i.a],i.b=u[i.b],i.c=u[i.c],a=[i.a,i.b,i.c];for(var d=0;d<3;d++)if(a[d]===a[(d+1)%3]){p.push(n);break}}for(n=p.length-1;n>=0;n--){var f=p[n];for(this.faces.splice(f,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(f,1)}var m=this.vertices.length-c.length;return this.vertices=c,m},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var r=e[t];this.vertices.push(new Vector3(r.x,r.y,r.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,n=0;n<t;n++)e[n]._id=n;e.sort(function(e,t){return e.materialIndex-t.materialIndex});var r,i,a=this.faceVertexUvs[0],o=this.faceVertexUvs[1];a&&a.length===t&&(r=[]),o&&o.length===t&&(i=[]);for(n=0;n<t;n++){var s=e[n]._id;r&&r.push(a[s]),i&&i.push(o[s])}r&&(this.faceVertexUvs[0]=r),i&&(this.faceVertexUvs[1]=i)},toJSON:function(){var e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}for(var r=[],i=0;i<this.vertices.length;i++){var a=this.vertices[i];r.push(a.x,a.y,a.z)}var o=[],s=[],l={},c=[],u={},h=[],p={};for(i=0;i<this.faces.length;i++){var d=this.faces[i],f=void 0!==this.faceVertexUvs[0][i],m=d.normal.length()>0,g=d.vertexNormals.length>0,v=1!==d.color.r||1!==d.color.g||1!==d.color.b,y=d.vertexColors.length>0,x=0;if(x=M(x=M(x=M(x=M(x=M(x=M(x=M(x=M(x,0,0),1,!0),2,!1),3,f),4,m),5,g),6,v),7,y),o.push(x),o.push(d.a,d.b,d.c),o.push(d.materialIndex),f){var _=this.faceVertexUvs[0][i];o.push(E(_[0]),E(_[1]),E(_[2]))}if(m&&o.push(S(d.normal)),g){var b=d.vertexNormals;o.push(S(b[0]),S(b[1]),S(b[2]))}if(v&&o.push(T(d.color)),y){var w=d.vertexColors;o.push(T(w[0]),T(w[1]),T(w[2]))}}function M(e,t,n){return n?e|1<<t:e&~(1<<t)}function S(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==l[t]?l[t]:(l[t]=s.length/3,s.push(e.x,e.y,e.z),l[t])}function T(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==u[t]?u[t]:(u[t]=c.length,c.push(e.getHex()),u[t])}function E(e){var t=e.x.toString()+e.y.toString();return void 0!==p[t]?p[t]:(p[t]=h.length/2,h.push(e.x,e.y),p[t])}return e.data={},e.data.vertices=r,e.data.normals=s,c.length>0&&(e.data.colors=c),h.length>0&&(e.data.uvs=[h]),e.data.faces=o,e},clone:function(){return(new Geometry).copy(this)},copy:function(e){var t,n,r,i,a,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var s=e.vertices;for(t=0,n=s.length;t<n;t++)this.vertices.push(s[t].clone());var l=e.colors;for(t=0,n=l.length;t<n;t++)this.colors.push(l[t].clone());var c=e.faces;for(t=0,n=c.length;t<n;t++)this.faces.push(c[t].clone());for(t=0,n=e.faceVertexUvs.length;t<n;t++){var u=e.faceVertexUvs[t];for(void 0===this.faceVertexUvs[t]&&(this.faceVertexUvs[t]=[]),r=0,i=u.length;r<i;r++){var h=u[r],p=[];for(a=0,o=h.length;a<o;a++){var d=h[a];p.push(d.clone())}this.faceVertexUvs[t].push(p)}}var f=e.morphTargets;for(t=0,n=f.length;t<n;t++){var m={};if(m.name=f[t].name,void 0!==f[t].vertices)for(m.vertices=[],r=0,i=f[t].vertices.length;r<i;r++)m.vertices.push(f[t].vertices[r].clone());if(void 0!==f[t].normals)for(m.normals=[],r=0,i=f[t].normals.length;r<i;r++)m.normals.push(f[t].normals[r].clone());this.morphTargets.push(m)}var g=e.morphNormals;for(t=0,n=g.length;t<n;t++){var v={};if(void 0!==g[t].vertexNormals)for(v.vertexNormals=[],r=0,i=g[t].vertexNormals.length;r<i;r++){var y=g[t].vertexNormals[r],x={};x.a=y.a.clone(),x.b=y.b.clone(),x.c=y.c.clone(),v.vertexNormals.push(x)}if(void 0!==g[t].faceNormals)for(v.faceNormals=[],r=0,i=g[t].faceNormals.length;r<i;r++)v.faceNormals.push(g[t].faceNormals[r].clone());this.morphNormals.push(v)}var _=e.skinWeights;for(t=0,n=_.length;t<n;t++)this.skinWeights.push(_[t].clone());var b=e.skinIndices;for(t=0,n=b.length;t<n;t++)this.skinIndices.push(b[t].clone());var w=e.lineDistances;for(t=0,n=w.length;t<n;t++)this.lineDistances.push(w[t]);var M=e.boundingBox;null!==M&&(this.boundingBox=M.clone());var S=e.boundingSphere;return null!==S&&(this.boundingSphere=S.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});class BoxGeometry extends Geometry{constructor(e,t,n,r,i,a){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a},this.fromBufferGeometry(new BoxBufferGeometry(e,t,n,r,i,a)),this.mergeVertices()}}class BoxBufferGeometry extends BufferGeometry{constructor(e,t,n,r,i,a){super(),this.type="BoxBufferGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};var o=this;e=e||1,t=t||1,n=n||1,r=Math.floor(r)||1,i=Math.floor(i)||1;var s=[],l=[],c=[],u=[],h=0,p=0;function d(e,t,n,r,i,a,d,f,m,g,v){var y,x,_=a/m,b=d/g,w=a/2,M=d/2,S=f/2,T=m+1,E=g+1,C=0,A=0,L=new Vector3;for(x=0;x<E;x++){var D=x*b-M;for(y=0;y<T;y++){var P=y*_-w;L[e]=P*r,L[t]=D*i,L[n]=S,l.push(L.x,L.y,L.z),L[e]=0,L[t]=0,L[n]=f>0?1:-1,c.push(L.x,L.y,L.z),u.push(y/m),u.push(1-x/g),C+=1}}for(x=0;x<g;x++)for(y=0;y<m;y++){var O=h+y+T*x,R=h+y+T*(x+1),I=h+(y+1)+T*(x+1),B=h+(y+1)+T*x;s.push(O,R,B),s.push(R,I,B),A+=6}o.addGroup(p,A,v),p+=A,h+=C}d("z","y","x",-1,-1,n,t,e,a=Math.floor(a)||1,i,0),d("z","y","x",1,-1,n,t,-e,a,i,1),d("x","z","y",1,1,e,n,t,r,a,2),d("x","z","y",1,-1,e,n,-t,r,a,3),d("x","y","z",1,-1,e,t,n,r,i,4),d("x","y","z",-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute("position",new Float32BufferAttribute(l,3)),this.setAttribute("normal",new Float32BufferAttribute(c,3)),this.setAttribute("uv",new Float32BufferAttribute(u,2))}}function cloneUniforms(e){var t={};for(var n in e)for(var r in t[n]={},e[n]){var i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}return t}function mergeUniforms(e){for(var t={},n=0;n<e.length;n++){var r=cloneUniforms(e[n]);for(var i in r)t[i]=r[i]}return t}var UniformsUtils={clone:cloneUniforms,merge:mergeUniforms},default_vertex="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",default_fragment="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";function ShaderMaterial(e){Material.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=default_vertex,this.fragmentShader=default_fragment,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}function Camera(){Object3D.call(this),this.type="Camera",this.matrixWorldInverse=new Matrix4,this.projectionMatrix=new Matrix4,this.projectionMatrixInverse=new Matrix4}function PerspectiveCamera(e,t,n,r){Camera.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}ShaderMaterial.prototype=Object.create(Material.prototype),ShaderMaterial.prototype.constructor=ShaderMaterial,ShaderMaterial.prototype.isShaderMaterial=!0,ShaderMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=cloneUniforms(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},ShaderMaterial.prototype.toJSON=function(e){var t=Material.prototype.toJSON.call(this,e);for(var n in t.uniforms={},this.uniforms){var r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:"t",value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:"m4",value:r.toArray()}:t.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var i={};for(var a in this.extensions)!0===this.extensions[a]&&(i[a]=!0);return Object.keys(i).length>0&&(t.extensions=i),t},Camera.prototype=Object.assign(Object.create(Object3D.prototype),{constructor:Camera,isCamera:!0,copy:function(e,t){return Object3D.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new Vector3),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){Object3D.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(e,t){Object3D.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),PerspectiveCamera.prototype=Object.assign(Object.create(Camera.prototype),{constructor:PerspectiveCamera,isPerspectiveCamera:!0,copy:function(e,t){return Camera.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*MathUtils.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*MathUtils.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*MathUtils.RAD2DEG*Math.atan(Math.tan(.5*MathUtils.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,r,i,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*MathUtils.DEG2RAD*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;i+=a.offsetX*r/o,t-=a.offsetY*n/s,r*=a.width/o,n*=a.height/s}var l=this.filmOffset;0!==l&&(i+=e*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=Object3D.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}});var fov=90,aspect=1;function CubeCamera(e,t,n,r){Object3D.call(this),this.type="CubeCamera";var i=new PerspectiveCamera(fov,aspect,e,t);i.up.set(0,-1,0),i.lookAt(new Vector3(1,0,0)),this.add(i);var a=new PerspectiveCamera(fov,aspect,e,t);a.up.set(0,-1,0),a.lookAt(new Vector3(-1,0,0)),this.add(a);var o=new PerspectiveCamera(fov,aspect,e,t);o.up.set(0,0,1),o.lookAt(new Vector3(0,1,0)),this.add(o);var s=new PerspectiveCamera(fov,aspect,e,t);s.up.set(0,0,-1),s.lookAt(new Vector3(0,-1,0)),this.add(s);var l=new PerspectiveCamera(fov,aspect,e,t);l.up.set(0,-1,0),l.lookAt(new Vector3(0,0,1)),this.add(l);var c=new PerspectiveCamera(fov,aspect,e,t);c.up.set(0,-1,0),c.lookAt(new Vector3(0,0,-1)),this.add(c),r=r||{format:RGBFormat,magFilter:LinearFilter,minFilter:LinearFilter},this.renderTarget=new WebGLCubeRenderTarget(n,r),this.renderTarget.texture.name="CubeCamera",this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var n=e.getRenderTarget(),r=this.renderTarget,u=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0),e.render(t,i),e.setRenderTarget(r,1),e.render(t,a),e.setRenderTarget(r,2),e.render(t,o),e.setRenderTarget(r,3),e.render(t,s),e.setRenderTarget(r,4),e.render(t,l),r.texture.generateMipmaps=u,e.setRenderTarget(r,5),e.render(t,c),e.setRenderTarget(n)},this.clear=function(e,t,n,r){for(var i=e.getRenderTarget(),a=this.renderTarget,o=0;o<6;o++)e.setRenderTarget(a,o),e.clear(t,n,r);e.setRenderTarget(i)}}function WebGLCubeRenderTarget(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),WebGLRenderTarget.call(this,e,e,t)}function DataTexture(e,t,n,r,i,a,o,s,l,c,u,h){Texture.call(this,null,a,o,s,l,c,r,i,u,h),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==l?l:NearestFilter,this.minFilter=void 0!==c?c:NearestFilter,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}CubeCamera.prototype=Object.create(Object3D.prototype),CubeCamera.prototype.constructor=CubeCamera,WebGLCubeRenderTarget.prototype=Object.create(WebGLRenderTarget.prototype),WebGLCubeRenderTarget.prototype.constructor=WebGLCubeRenderTarget,WebGLCubeRenderTarget.prototype.isWebGLCubeRenderTarget=!0,WebGLCubeRenderTarget.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=t.format,this.texture.encoding=t.encoding;var n=new Scene,r={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include <begin_vertex>","\t#include <project_vertex>","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#define RECIPROCAL_PI 0.31830988618","#define RECIPROCAL_PI2 0.15915494","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV;","\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;","\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},i=new ShaderMaterial({type:"CubemapFromEquirect",uniforms:cloneUniforms(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:BackSide,blending:NoBlending});i.uniforms.tEquirect.value=t;var a=new Mesh(new BoxBufferGeometry(5,5,5),i);n.add(a);var o=new CubeCamera(1,10,1);return o.renderTarget=this,o.renderTarget.texture.name="CubeCameraTexture",o.update(e,n),a.geometry.dispose(),a.material.dispose(),this},DataTexture.prototype=Object.create(Texture.prototype),DataTexture.prototype.constructor=DataTexture,DataTexture.prototype.isDataTexture=!0;var _sphere$1=new Sphere,_vector$5=new Vector3;function Frustum(e,t,n,r,i,a){this.planes=[void 0!==e?e:new Plane,void 0!==t?t:new Plane,void 0!==n?n:new Plane,void 0!==r?r:new Plane,void 0!==i?i:new Plane,void 0!==a?a:new Plane]}Object.assign(Frustum.prototype,{set:function(e,t,n,r,i,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this},setFromProjectionMatrix:function(e){var t=this.planes,n=e.elements,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],l=n[5],c=n[6],u=n[7],h=n[8],p=n[9],d=n[10],f=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return t[0].setComponents(o-r,u-s,f-h,y-m).normalize(),t[1].setComponents(o+r,u+s,f+h,y+m).normalize(),t[2].setComponents(o+i,u+l,f+p,y+g).normalize(),t[3].setComponents(o-i,u-l,f-p,y-g).normalize(),t[4].setComponents(o-a,u-c,f-d,y-v).normalize(),t[5].setComponents(o+a,u+c,f+d,y+v).normalize(),this},intersectsObject:function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),_sphere$1.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(_sphere$1)},intersectsSprite:function(e){return _sphere$1.center.set(0,0,0),_sphere$1.radius=.7071067811865476,_sphere$1.applyMatrix4(e.matrixWorld),this.intersectsSphere(_sphere$1)},intersectsSphere:function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++){if(t[i].distanceToPoint(n)<r)return!1}return!0},intersectsBox:function(e){for(var t=this.planes,n=0;n<6;n++){var r=t[n];if(_vector$5.x=r.normal.x>0?e.max.x:e.min.x,_vector$5.y=r.normal.y>0?e.max.y:e.min.y,_vector$5.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(_vector$5)<0)return!1}return!0},containsPoint:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}});var UniformsLib={common:{diffuse:{value:new Color(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Matrix3},uv2Transform:{value:new Matrix3},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Vector2(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Color(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new Color(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Matrix3}},sprite:{diffuse:{value:new Color(15658734)},opacity:{value:1},center:{value:new Vector2(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Matrix3}}};function WebGLAnimation(){var e=null,t=!1,n=null;function r(i,a){!1!==t&&(n(i,a),e.requestAnimationFrame(r))}return{start:function(){!0!==t&&null!==n&&(e.requestAnimationFrame(r),t=!0)},stop:function(){t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function WebGLAttributes(e,t){var n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){t.isInterleavedBufferAttribute&&(t=t.data);var a=r.get(t);void 0===a?r.set(t,function(t,n){var r=t.array,i=t.usage,a=e.createBuffer();e.bindBuffer(n,a),e.bufferData(n,r,i),t.onUploadCallback();var o=5126;return r instanceof Float32Array?o=5126:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?o=5123:r instanceof Int16Array?o=5122:r instanceof Uint32Array?o=5125:r instanceof Int32Array?o=5124:r instanceof Int8Array?o=5120:r instanceof Uint8Array&&(o=5121),{buffer:a,type:o,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version}}(t,i)):a.version<t.version&&(function(t,r,i){var a=r.array,o=r.updateRange;e.bindBuffer(i,t),-1===o.count?e.bufferSubData(i,0,a):(n?e.bufferSubData(i,o.offset*a.BYTES_PER_ELEMENT,a,o.offset,o.count):e.bufferSubData(i,o.offset*a.BYTES_PER_ELEMENT,a.subarray(o.offset,o.offset+o.count)),o.count=-1)}(a.buffer,t,i),a.version=t.version)}}}function PlaneGeometry(e,t,n,r){Geometry.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new PlaneBufferGeometry(e,t,n,r)),this.mergeVertices()}function PlaneBufferGeometry(e,t,n,r){BufferGeometry.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};var i,a,o=(e=e||1)/2,s=(t=t||1)/2,l=Math.floor(n)||1,c=Math.floor(r)||1,u=l+1,h=c+1,p=e/l,d=t/c,f=[],m=[],g=[],v=[];for(a=0;a<h;a++){var y=a*d-s;for(i=0;i<u;i++){var x=i*p-o;m.push(x,-y,0),g.push(0,0,1),v.push(i/l),v.push(1-a/c)}}for(a=0;a<c;a++)for(i=0;i<l;i++){var _=i+u*a,b=i+u*(a+1),w=i+1+u*(a+1),M=i+1+u*a;f.push(_,b,M),f.push(b,w,M)}this.setIndex(f),this.setAttribute("position",new Float32BufferAttribute(m,3)),this.setAttribute("normal",new Float32BufferAttribute(g,3)),this.setAttribute("uv",new Float32BufferAttribute(v,2))}PlaneGeometry.prototype=Object.create(Geometry.prototype),PlaneGeometry.prototype.constructor=PlaneGeometry,PlaneBufferGeometry.prototype=Object.create(BufferGeometry.prototype),PlaneBufferGeometry.prototype.constructor=PlaneBufferGeometry;var alphamap_fragment="#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment="#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment="#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment="#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",aomap_pars_fragment="#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex="vec3 transformed = vec3( position );",beginnormal_vertex="vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs="vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment="#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment="#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment="#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex="#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",clipping_planes_vertex="#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",color_fragment="#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex="#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common="#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}",cube_uv_reflection_fragment="#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\nfloat getFace(vec3 direction) {\n vec3 absDirection = abs(direction);\n float face = -1.0;\n if (absDirection.x > absDirection.z) {\n if (absDirection.x > absDirection.y)\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if (absDirection.z > absDirection.y)\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n}\nvec2 getUV(vec3 direction, float face) {\n vec2 uv;\n if (face == 0.0) {\n uv = vec2(-direction.z, direction.y) / abs(direction.x);\n } else if (face == 1.0) {\n uv = vec2(direction.x, -direction.z) / abs(direction.y);\n } else if (face == 2.0) {\n uv = direction.xy / abs(direction.z);\n } else if (face == 3.0) {\n uv = vec2(direction.z, direction.y) / abs(direction.x);\n } else if (face == 4.0) {\n uv = direction.xz / abs(direction.y);\n } else {\n uv = vec2(-direction.x, direction.y) / abs(direction.z);\n }\n return 0.5 * (uv + 1.0);\n}\nvec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {\n float face = getFace(direction);\n float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n mipInt = max(mipInt, cubeUV_minMipLevel);\n float faceSize = exp2(mipInt);\n float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n vec2 uv = getUV(direction, face) * (faceSize - 1.0);\n vec2 f = fract(uv);\n uv += 0.5 - f;\n if (face > 2.0) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n if(mipInt < cubeUV_maxMipLevel){\n uv.y += 2.0 * cubeUV_maxTileSize;\n }\n uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n uv *= texelSize;\n vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize;\n vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize;\n vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize;\n vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n return mix(tm, bm, f.y);\n}\n#define r0 1.0\n#define v0 0.339\n#define m0 -2.0\n#define r1 0.8\n#define v1 0.276\n#define m1 -1.0\n#define r4 0.4\n#define v4 0.046\n#define m4 2.0\n#define r5 0.305\n#define v5 0.016\n#define m5 3.0\n#define r6 0.21\n#define v6 0.0038\n#define m6 4.0\nfloat roughnessToMip(float roughness) {\n float mip = 0.0;\n if (roughness >= r1) {\n mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;\n } else if (roughness >= r4) {\n mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;\n } else if (roughness >= r5) {\n mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;\n } else if (roughness >= r6) {\n mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;\n } else {\n mip = -2.0 * log2(1.16 * roughness); }\n return mip;\n}\nvec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {\n float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n float mipF = fract(mip);\n float mipInt = floor(mip);\n vec3 color0 = bilinearCubeUV(envMap, sampleDir, mipInt);\n if (mipF == 0.0) {\n return vec4(color0, 1.0);\n } else {\n vec3 color1 = bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);\n return vec4(mix(color0, color1, mipF), 1.0);\n }\n}\n#endif",defaultnormal_vertex="vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\ttransformedNormal = mat3( instanceMatrix ) * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex="#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex="#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment="#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment="#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment="gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment="\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment="#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment="#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment="#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_vertex="#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) { \n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex="#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex="#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment="#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment="#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment="#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment="#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment="#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex="vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif",lights_pars_begin="uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",envmap_physical_pars_fragment="#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",lights_toon_fragment="ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_toon_pars_fragment="varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment="varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment="PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = saturate( clearcoat );\tmaterial.clearcoatRoughness = max( clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment="struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin="\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( pointLight.shadow, directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( spotLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( directionalLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps="#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end="#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment="#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment="#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment="#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment="#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment="#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex="#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex="#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex="#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin="#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps="#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment="#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin="#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps="#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_normalmap_pars_fragment="#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing="vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment="#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex="vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment="#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment="#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment="#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif",shadowmask_pars_fragment="float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= all( bvec2( directionalLight.shadow, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= all( bvec2( spotLight.shadow, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= all( bvec2( pointLight.shadow, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex="#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex="#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex="#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex="#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment="float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment="#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment="#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment="#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",uv_pars_fragment="#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex="#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex="#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex="#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag="uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",background_vert="varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag="#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",depth_frag="#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}",depth_vert="#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}",distanceRGBA_frag="#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert="#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag="uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",equirect_vert="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",linedashed_frag="uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",linedashed_vert="uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag="uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert="#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag="uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert="#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshmatcap_frag="#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshmatcap_vert="#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag="#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert="#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag="#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphong_vert="#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphysical_frag="#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert="#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",normal_frag="#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert="#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",points_vert="uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",shadow_frag="uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",shadow_vert="#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",sprite_frag="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert="uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",ShaderChunk={alphamap_fragment:alphamap_fragment,alphamap_pars_fragment:alphamap_pars_fragment,alphatest_fragment:alphatest_fragment,aomap_fragment:aomap_fragment,aomap_pars_fragment:aomap_pars_fragment,begin_vertex:begin_vertex,beginnormal_vertex:beginnormal_vertex,bsdfs:bsdfs,bumpmap_pars_fragment:bumpmap_pars_fragment,clipping_planes_fragment:clipping_planes_fragment,clipping_planes_pars_fragment:clipping_planes_pars_fragment,clipping_planes_pars_vertex:clipping_planes_pars_vertex,clipping_planes_vertex:clipping_planes_vertex,color_fragment:color_fragment,color_pars_fragment:color_pars_fragment,color_pars_vertex:color_pars_vertex,color_vertex:color_vertex,common:common,cube_uv_reflection_fragment:cube_uv_reflection_fragment,defaultnormal_vertex:defaultnormal_vertex,displacementmap_pars_vertex:displacementmap_pars_vertex,displacementmap_vertex:displacementmap_vertex,emissivemap_fragment:emissivemap_fragment,emissivemap_pars_fragment:emissivemap_pars_fragment,encodings_fragment:encodings_fragment,encodings_pars_fragment:encodings_pars_fragment,envmap_fragment:envmap_fragment,envmap_common_pars_fragment:envmap_common_pars_fragment,envmap_pars_fragment:envmap_pars_fragment,envmap_pars_vertex:envmap_pars_vertex,envmap_physical_pars_fragment:envmap_physical_pars_fragment,envmap_vertex:envmap_vertex,fog_vertex:fog_vertex,fog_pars_vertex:fog_pars_vertex,fog_fragment:fog_fragment,fog_pars_fragment:fog_pars_fragment,gradientmap_pars_fragment:gradientmap_pars_fragment,lightmap_fragment:lightmap_fragment,lightmap_pars_fragment:lightmap_pars_fragment,lights_lambert_vertex:lights_lambert_vertex,lights_pars_begin:lights_pars_begin,lights_toon_fragment:lights_toon_fragment,lights_toon_pars_fragment:lights_toon_pars_fragment,lights_phong_fragment:lights_phong_fragment,lights_phong_pars_fragment:lights_phong_pars_fragment,lights_physical_fragment:lights_physical_fragment,lights_physical_pars_fragment:lights_physical_pars_fragment,lights_fragment_begin:lights_fragment_begin,lights_fragment_maps:lights_fragment_maps,lights_fragment_end:lights_fragment_end,logdepthbuf_fragment:logdepthbuf_fragment,logdepthbuf_pars_fragment:logdepthbuf_pars_fragment,logdepthbuf_pars_vertex:logdepthbuf_pars_vertex,logdepthbuf_vertex:logdepthbuf_vertex,map_fragment:map_fragment,map_pars_fragment:map_pars_fragment,map_particle_fragment:map_particle_fragment,map_particle_pars_fragment:map_particle_pars_fragment,metalnessmap_fragment:metalnessmap_fragment,metalnessmap_pars_fragment:metalnessmap_pars_fragment,morphnormal_vertex:morphnormal_vertex,morphtarget_pars_vertex:morphtarget_pars_vertex,morphtarget_vertex:morphtarget_vertex,normal_fragment_begin:normal_fragment_begin,normal_fragment_maps:normal_fragment_maps,normalmap_pars_fragment:normalmap_pars_fragment,clearcoat_normal_fragment_begin:clearcoat_normal_fragment_begin,clearcoat_normal_fragment_maps:clearcoat_normal_fragment_maps,clearcoat_normalmap_pars_fragment:clearcoat_normalmap_pars_fragment,packing:packing,premultiplied_alpha_fragment:premultiplied_alpha_fragment,project_vertex:project_vertex,dithering_fragment:dithering_fragment,dithering_pars_fragment:dithering_pars_fragment,roughnessmap_fragment:roughnessmap_fragment,roughnessmap_pars_fragment:roughnessmap_pars_fragment,shadowmap_pars_fragment:shadowmap_pars_fragment,shadowmap_pars_vertex:shadowmap_pars_vertex,shadowmap_vertex:shadowmap_vertex,shadowmask_pars_fragment:shadowmask_pars_fragment,skinbase_vertex:skinbase_vertex,skinning_pars_vertex:skinning_pars_vertex,skinning_vertex:skinning_vertex,skinnormal_vertex:skinnormal_vertex,specularmap_fragment:specularmap_fragment,specularmap_pars_fragment:specularmap_pars_fragment,tonemapping_fragment:tonemapping_fragment,tonemapping_pars_fragment:tonemapping_pars_fragment,uv_pars_fragment:uv_pars_fragment,uv_pars_vertex:uv_pars_vertex,uv_vertex:uv_vertex,uv2_pars_fragment:uv2_pars_fragment,uv2_pars_vertex:uv2_pars_vertex,uv2_vertex:uv2_vertex,worldpos_vertex:worldpos_vertex,background_frag:background_frag,background_vert:background_vert,cube_frag:cube_frag,cube_vert:cube_vert,depth_frag:depth_frag,depth_vert:depth_vert,distanceRGBA_frag:distanceRGBA_frag,distanceRGBA_vert:distanceRGBA_vert,equirect_frag:equirect_frag,equirect_vert:equirect_vert,linedashed_frag:linedashed_frag,linedashed_vert:linedashed_vert,meshbasic_frag:meshbasic_frag,meshbasic_vert:meshbasic_vert,meshlambert_frag:meshlambert_frag,meshlambert_vert:meshlambert_vert,meshmatcap_frag:meshmatcap_frag,meshmatcap_vert:meshmatcap_vert,meshtoon_frag:meshtoon_frag,meshtoon_vert:meshtoon_vert,meshphong_frag:meshphong_frag,meshphong_vert:meshphong_vert,meshphysical_frag:meshphysical_frag,meshphysical_vert:meshphysical_vert,normal_frag:normal_frag,normal_vert:normal_vert,points_frag:points_frag,points_vert:points_vert,shadow_frag:shadow_frag,shadow_vert:shadow_vert,sprite_frag:sprite_frag,sprite_vert:sprite_vert},ShaderLib={basic:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.fog]),vertexShader:ShaderChunk.meshbasic_vert,fragmentShader:ShaderChunk.meshbasic_frag},lambert:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color(0)}}]),vertexShader:ShaderChunk.meshlambert_vert,fragmentShader:ShaderChunk.meshlambert_frag},phong:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color(0)},specular:{value:new Color(1118481)},shininess:{value:30}}]),vertexShader:ShaderChunk.meshphong_vert,fragmentShader:ShaderChunk.meshphong_frag},standard:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.roughnessmap,UniformsLib.metalnessmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:ShaderChunk.meshphysical_vert,fragmentShader:ShaderChunk.meshphysical_frag},toon:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.gradientmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color(0)},specular:{value:new Color(1118481)},shininess:{value:30}}]),vertexShader:ShaderChunk.meshtoon_vert,fragmentShader:ShaderChunk.meshtoon_frag},matcap:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,{matcap:{value:null}}]),vertexShader:ShaderChunk.meshmatcap_vert,fragmentShader:ShaderChunk.meshmatcap_frag},points:{uniforms:mergeUniforms([UniformsLib.points,UniformsLib.fog]),vertexShader:ShaderChunk.points_vert,fragmentShader:ShaderChunk.points_frag},dashed:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ShaderChunk.linedashed_vert,fragmentShader:ShaderChunk.linedashed_frag},depth:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.displacementmap]),vertexShader:ShaderChunk.depth_vert,fragmentShader:ShaderChunk.depth_frag},normal:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,{opacity:{value:1}}]),vertexShader:ShaderChunk.normal_vert,fragmentShader:ShaderChunk.normal_frag},sprite:{uniforms:mergeUniforms([UniformsLib.sprite,UniformsLib.fog]),vertexShader:ShaderChunk.sprite_vert,fragmentShader:ShaderChunk.sprite_frag},background:{uniforms:{uvTransform:{value:new Matrix3},t2D:{value:null}},vertexShader:ShaderChunk.background_vert,fragmentShader:ShaderChunk.background_frag},cube:{uniforms:mergeUniforms([UniformsLib.envmap,{opacity:{value:1}}]),vertexShader:ShaderChunk.cube_vert,fragmentShader:ShaderChunk.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ShaderChunk.equirect_vert,fragmentShader:ShaderChunk.equirect_frag},distanceRGBA:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.displacementmap,{referencePosition:{value:new Vector3},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ShaderChunk.distanceRGBA_vert,fragmentShader:ShaderChunk.distanceRGBA_frag},shadow:{uniforms:mergeUniforms([UniformsLib.lights,UniformsLib.fog,{color:{value:new Color(0)},opacity:{value:1}}]),vertexShader:ShaderChunk.shadow_vert,fragmentShader:ShaderChunk.shadow_frag}};function WebGLBackground(e,t,n,r){var i,a,o=new Color(0),s=0,l=null,c=0,u=null;function h(e,n){t.buffers.color.setClear(e.r,e.g,e.b,n,r)}return{getClearColor:function(){return o},setClearColor:function(e,t){o.set(e),h(o,s=void 0!==t?t:1)},getClearAlpha:function(){return s},setClearAlpha:function(e){h(o,s=e)},render:function(t,r,p,d){var f=r.background,m=e.xr,g=m.getSession&&m.getSession();if(g&&"additive"===g.environmentBlendMode&&(f=null),null===f?h(o,s):f&&f.isColor&&(h(f,1),d=!0),(e.autoClear||d)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),f&&(f.isCubeTexture||f.isWebGLCubeRenderTarget||f.mapping===CubeUVReflectionMapping)){void 0===a&&((a=new Mesh(new BoxBufferGeometry(1,1,1),new ShaderMaterial({type:"BackgroundCubeMaterial",uniforms:cloneUniforms(ShaderLib.cube.uniforms),vertexShader:ShaderLib.cube.vertexShader,fragmentShader:ShaderLib.cube.fragmentShader,side:BackSide,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(a));var v=f.isWebGLCubeRenderTarget?f.texture:f;a.material.uniforms.envMap.value=v,a.material.uniforms.flipEnvMap.value=v.isCubeTexture?-1:1,l===f&&c===v.version&&u===e.toneMapping||(a.material.needsUpdate=!0,l=f,c=v.version,u=e.toneMapping),t.unshift(a,a.geometry,a.material,0,0,null)}else f&&f.isTexture&&(void 0===i&&((i=new Mesh(new PlaneBufferGeometry(2,2),new ShaderMaterial({type:"BackgroundMaterial",uniforms:cloneUniforms(ShaderLib.background.uniforms),vertexShader:ShaderLib.background.vertexShader,fragmentShader:ShaderLib.background.fragmentShader,side:FrontSide,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(i.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(i)),i.material.uniforms.t2D.value=f,!0===f.matrixAutoUpdate&&f.updateMatrix(),i.material.uniforms.uvTransform.value.copy(f.matrix),l===f&&c===f.version&&u===e.toneMapping||(i.material.needsUpdate=!0,l=f,c=f.version,u=e.toneMapping),t.unshift(i,i.geometry,i.material,0,0,null))}}}function WebGLBufferRenderer(e,t,n,r){var i,a=r.isWebGL2;this.setMode=function(e){i=e},this.render=function(t,r){e.drawArrays(i,t,r),n.update(r,i)},this.renderInstances=function(r,o,s,l){if(0!==l){var c,u;if(a)c=e,u="drawArraysInstanced";else if(u="drawArraysInstancedANGLE",null===(c=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[u](i,o,s,l),n.update(s,i,l)}}}function WebGLCapabilities(e,t,n){var r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var a="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,o=void 0!==n.precision?n.precision:"highp",s=i(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var l=!0===n.logarithmicDepthBuffer,c=e.getParameter(34930),u=e.getParameter(35660),h=e.getParameter(3379),p=e.getParameter(34076),d=e.getParameter(34921),f=e.getParameter(36347),m=e.getParameter(36348),g=e.getParameter(36349),v=u>0,y=a||!!t.get("OES_texture_float");return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==r)return r;var n=t.get("EXT_texture_filter_anisotropic");return r=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:h,maxCubemapSize:p,maxAttributes:d,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:a?e.getParameter(36183):0}}function WebGLClipping(){var e=this,t=null,n=0,r=!1,i=!1,a=new Plane,o=new Matrix3,s={value:null,needsUpdate:!1};function l(){s.value!==t&&(s.value=t,s.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function c(t,n,r,i){var l=null!==t?t.length:0,c=null;if(0!==l){if(c=s.value,!0!==i||null===c){var u=r+4*l,h=n.matrixWorldInverse;o.getNormalMatrix(h),(null===c||c.length<u)&&(c=new Float32Array(u));for(var p=0,d=r;p!==l;++p,d+=4)a.copy(t[p]).applyMatrix4(h,o),a.normal.toArray(c,d),c[d+3]=a.constant}s.value=c,s.needsUpdate=!0}return e.numPlanes=l,c}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(e,i,a){var o=0!==e.length||i||0!==n||r;return r=i,t=c(e,a,0),n=e.length,o},this.beginShadows=function(){i=!0,c(null)},this.endShadows=function(){i=!1,l()},this.setState=function(e,a,o,u,h,p){if(!r||null===e||0===e.length||i&&!o)i?c(null):l();else{var d=i?0:n,f=4*d,m=h.clippingState||null;s.value=m,m=c(e,u,f,p);for(var g=0;g!==f;++g)m[g]=t[g];h.clippingState=m,this.numIntersection=a?this.numPlanes:0,this.numPlanes+=d}}}function WebGLExtensions(e){var t={};return{get:function(n){if(void 0!==t[n])return t[n];var r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return null===r&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),t[n]=r,r}}}function WebGLGeometries(e,t,n){var r=new WeakMap,i=new WeakMap;function a(e){var o=e.target,s=r.get(o);for(var l in null!==s.index&&t.remove(s.index),s.attributes)t.remove(s.attributes[l]);o.removeEventListener("dispose",a),r.delete(o);var c=i.get(s);c&&(t.remove(c),i.delete(s)),n.memory.geometries--}function o(e){var n=[],r=e.index,a=e.attributes.position,o=0;if(null!==r){var s=r.array;o=r.version;for(var l=0,c=s.length;l<c;l+=3){var u=s[l+0],h=s[l+1],p=s[l+2];n.push(u,h,h,p,p,u)}}else{s=a.array;o=a.version;for(l=0,c=s.length/3-1;l<c;l+=3){u=l+0,h=l+1,p=l+2;n.push(u,h,h,p,p,u)}}var d=new(arrayMax(n)>65535?Uint32BufferAttribute:Uint16BufferAttribute)(n,1);d.version=o,t.update(d,34963);var f=i.get(e);f&&t.remove(f),i.set(e,d)}return{get:function(e,t){var i=r.get(t);return i||(t.addEventListener("dispose",a),t.isBufferGeometry?i=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new BufferGeometry).setFromObject(e)),i=t._bufferGeometry),r.set(t,i),n.memory.geometries++,i)},update:function(e){var n=e.index,r=e.attributes;for(var i in null!==n&&t.update(n,34963),r)t.update(r[i],34962);var a=e.morphAttributes;for(var i in a)for(var o=a[i],s=0,l=o.length;s<l;s++)t.update(o[s],34962)},getWireframeAttribute:function(e){var t=i.get(e);if(t){var n=e.index;null!==n&&t.version<n.version&&o(e)}else o(e);return i.get(e)}}}function WebGLIndexedBufferRenderer(e,t,n,r){var i,a,o,s=r.isWebGL2;this.setMode=function(e){i=e},this.setIndex=function(e){a=e.type,o=e.bytesPerElement},this.render=function(t,r){e.drawElements(i,r,a,t*o),n.update(r,i)},this.renderInstances=function(r,l,c,u){if(0!==u){var h,p;if(s)h=e,p="drawElementsInstanced";else if(p="drawElementsInstancedANGLE",null===(h=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[p](i,c,a,l*o,u),n.update(c,i,u)}}}function WebGLInfo(e){var t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(e,n,r){switch(r=r||1,t.calls++,n){case 4:t.triangles+=r*(e/3);break;case 1:t.lines+=r*(e/2);break;case 3:t.lines+=r*(e-1);break;case 2:t.lines+=r*e;break;case 0:t.points+=r*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function absNumericalSort(e,t){return Math.abs(t[1])-Math.abs(e[1])}function WebGLMorphtargets(e){var t={},n=new Float32Array(8);return{update:function(r,i,a,o){var s=r.morphTargetInfluences,l=void 0===s?0:s.length,c=t[i.id];if(void 0===c){c=[];for(var u=0;u<l;u++)c[u]=[u,0];t[i.id]=c}var h=a.morphTargets&&i.morphAttributes.position,p=a.morphNormals&&i.morphAttributes.normal;for(u=0;u<l;u++)0!==(f=c[u])[1]&&(h&&i.deleteAttribute("morphTarget"+u),p&&i.deleteAttribute("morphNormal"+u));for(u=0;u<l;u++)(f=c[u])[0]=u,f[1]=s[u];c.sort(absNumericalSort);var d=0;for(u=0;u<8;u++){var f;if(f=c[u]){var m=f[0],g=f[1];if(g){h&&i.setAttribute("morphTarget"+u,h[m]),p&&i.setAttribute("morphNormal"+u,p[m]),n[u]=g,d+=g;continue}}n[u]=0}var v=i.morphTargetsRelative?1:1-d;o.getUniforms().setValue(e,"morphTargetBaseInfluence",v),o.getUniforms().setValue(e,"morphTargetInfluences",n)}}}function WebGLObjects(e,t,n,r){var i={};return{update:function(e){var a=r.render.frame,o=e.geometry,s=t.get(e,o);return i[s.id]!==a&&(o.isGeometry&&s.updateFromObject(e),t.update(s),i[s.id]=a),e.isInstancedMesh&&n.update(e.instanceMatrix,34962),s},dispose:function(){i={}}}}function CubeTexture(e,t,n,r,i,a,o,s,l,c){e=void 0!==e?e:[],t=void 0!==t?t:CubeReflectionMapping,o=void 0!==o?o:RGBFormat,Texture.call(this,e,t,n,r,i,a,o,s,l,c),this.flipY=!1}function DataTexture2DArray(e,t,n,r){Texture.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:r||1},this.magFilter=NearestFilter,this.minFilter=NearestFilter,this.wrapR=ClampToEdgeWrapping,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function DataTexture3D(e,t,n,r){Texture.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:r||1},this.magFilter=NearestFilter,this.minFilter=NearestFilter,this.wrapR=ClampToEdgeWrapping,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}ShaderLib.physical={uniforms:mergeUniforms([ShaderLib.standard.uniforms,{transparency:{value:0},clearcoat:{value:0},clearcoatRoughness:{value:0},sheen:{value:new Color(0)},clearcoatNormalScale:{value:new Vector2(1,1)},clearcoatNormalMap:{value:null}}]),vertexShader:ShaderChunk.meshphysical_vert,fragmentShader:ShaderChunk.meshphysical_frag},CubeTexture.prototype=Object.create(Texture.prototype),CubeTexture.prototype.constructor=CubeTexture,CubeTexture.prototype.isCubeTexture=!0,Object.defineProperty(CubeTexture.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}}),DataTexture2DArray.prototype=Object.create(Texture.prototype),DataTexture2DArray.prototype.constructor=DataTexture2DArray,DataTexture2DArray.prototype.isDataTexture2DArray=!0,DataTexture3D.prototype=Object.create(Texture.prototype),DataTexture3D.prototype.constructor=DataTexture3D,DataTexture3D.prototype.isDataTexture3D=!0;var emptyTexture=new Texture,emptyTexture2dArray=new DataTexture2DArray,emptyTexture3d=new DataTexture3D,emptyCubeTexture=new CubeTexture,arrayCacheF32=[],arrayCacheI32=[],mat4array=new Float32Array(16),mat3array=new Float32Array(9),mat2array=new Float32Array(4);function flatten(e,t,n){var r=e[0];if(r<=0||r>0)return e;var i=t*n,a=arrayCacheF32[i];if(void 0===a&&(a=new Float32Array(i),arrayCacheF32[i]=a),0!==t){r.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=n,e[o].toArray(a,s)}return a}function arraysEqual(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function copyArray(e,t){for(var n=0,r=t.length;n<r;n++)e[n]=t[n]}function allocTexUnits(e,t){var n=arrayCacheI32[t];void 0===n&&(n=new Int32Array(t),arrayCacheI32[t]=n);for(var r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function setValueV1f(e,t){var n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function setValueV2f(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(arraysEqual(n,t))return;e.uniform2fv(this.addr,t),copyArray(n,t)}}function setValueV3f(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(arraysEqual(n,t))return;e.uniform3fv(this.addr,t),copyArray(n,t)}}function setValueV4f(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(arraysEqual(n,t))return;e.uniform4fv(this.addr,t),copyArray(n,t)}}function setValueM2(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(arraysEqual(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),copyArray(n,t)}else{if(arraysEqual(n,r))return;mat2array.set(r),e.uniformMatrix2fv(this.addr,!1,mat2array),copyArray(n,r)}}function setValueM3(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(arraysEqual(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),copyArray(n,t)}else{if(arraysEqual(n,r))return;mat3array.set(r),e.uniformMatrix3fv(this.addr,!1,mat3array),copyArray(n,r)}}function setValueM4(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(arraysEqual(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),copyArray(n,t)}else{if(arraysEqual(n,r))return;mat4array.set(r),e.uniformMatrix4fv(this.addr,!1,mat4array),copyArray(n,r)}}function setValueT1(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTexture2D(t||emptyTexture,i)}function setValueT2DArray1(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||emptyTexture2dArray,i)}function setValueT3D1(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||emptyTexture3d,i)}function setValueT6(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTextureCube(t||emptyCubeTexture,i)}function setValueV1i(e,t){var n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function setValueV2i(e,t){var n=this.cache;arraysEqual(n,t)||(e.uniform2iv(this.addr,t),copyArray(n,t))}function setValueV3i(e,t){var n=this.cache;arraysEqual(n,t)||(e.uniform3iv(this.addr,t),copyArray(n,t))}function setValueV4i(e,t){var n=this.cache;arraysEqual(n,t)||(e.uniform4iv(this.addr,t),copyArray(n,t))}function setValueV1ui(e,t){var n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function getSingularSetter(e){switch(e){case 5126:return setValueV1f;case 35664:return setValueV2f;case 35665:return setValueV3f;case 35666:return setValueV4f;case 35674:return setValueM2;case 35675:return setValueM3;case 35676:return setValueM4;case 5124:case 35670:return setValueV1i;case 35667:case 35671:return setValueV2i;case 35668:case 35672:return setValueV3i;case 35669:case 35673:return setValueV4i;case 5125:return setValueV1ui;case 35678:case 36198:case 36298:case 36306:case 35682:return setValueT1;case 35679:case 36299:case 36307:return setValueT3D1;case 35680:case 36300:case 36308:case 36293:return setValueT6;case 36289:case 36303:case 36311:case 36292:return setValueT2DArray1}}function setValueV1fArray(e,t){e.uniform1fv(this.addr,t)}function setValueV1iArray(e,t){e.uniform1iv(this.addr,t)}function setValueV2iArray(e,t){e.uniform2iv(this.addr,t)}function setValueV3iArray(e,t){e.uniform3iv(this.addr,t)}function setValueV4iArray(e,t){e.uniform4iv(this.addr,t)}function setValueV2fArray(e,t){var n=flatten(t,this.size,2);e.uniform2fv(this.addr,n)}function setValueV3fArray(e,t){var n=flatten(t,this.size,3);e.uniform3fv(this.addr,n)}function setValueV4fArray(e,t){var n=flatten(t,this.size,4);e.uniform4fv(this.addr,n)}function setValueM2Array(e,t){var n=flatten(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function setValueM3Array(e,t){var n=flatten(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function setValueM4Array(e,t){var n=flatten(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function setValueT1Array(e,t,n){var r=t.length,i=allocTexUnits(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTexture2D(t[a]||emptyTexture,i[a])}function setValueT6Array(e,t,n){var r=t.length,i=allocTexUnits(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTextureCube(t[a]||emptyCubeTexture,i[a])}function getPureArraySetter(e){switch(e){case 5126:return setValueV1fArray;case 35664:return setValueV2fArray;case 35665:return setValueV3fArray;case 35666:return setValueV4fArray;case 35674:return setValueM2Array;case 35675:return setValueM3Array;case 35676:return setValueM4Array;case 5124:case 35670:return setValueV1iArray;case 35667:case 35671:return setValueV2iArray;case 35668:case 35672:return setValueV3iArray;case 35669:case 35673:return setValueV4iArray;case 35678:case 36198:case 36298:case 36306:case 35682:return setValueT1Array;case 35680:case 36300:case 36308:case 36293:return setValueT6Array}}function SingleUniform(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=getSingularSetter(t.type)}function PureArrayUniform(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=getPureArraySetter(t.type)}function StructuredUniform(e){this.id=e,this.seq=[],this.map={}}PureArrayUniform.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),copyArray(t,e)},StructuredUniform.prototype.setValue=function(e,t,n){for(var r=this.seq,i=0,a=r.length;i!==a;++i){var o=r[i];o.setValue(e,t[o.id],n)}};var RePathPart=/([\w\d_]+)(\])?(\[|\.)?/g;function addUniform(e,t){e.seq.push(t),e.map[t.id]=t}function parseUniform(e,t,n){var r=e.name,i=r.length;for(RePathPart.lastIndex=0;;){var a=RePathPart.exec(r),o=RePathPart.lastIndex,s=a[1],l="]"===a[2],c=a[3];if(l&&(s|=0),void 0===c||"["===c&&o+2===i){addUniform(n,void 0===c?new SingleUniform(s,e,t):new PureArrayUniform(s,e,t));break}var u=n.map[s];void 0===u&&addUniform(n,u=new StructuredUniform(s)),n=u}}function WebGLUniforms(e,t){this.seq=[],this.map={};for(var n=e.getProgramParameter(t,35718),r=0;r<n;++r){var i=e.getActiveUniform(t,r);parseUniform(i,e.getUniformLocation(t,i.name),this)}}function WebGLShader(e,t,n){var r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}WebGLUniforms.prototype.setValue=function(e,t,n,r){var i=this.map[t];void 0!==i&&i.setValue(e,n,r)},WebGLUniforms.prototype.setOptional=function(e,t,n){var r=t[n];void 0!==r&&this.setValue(e,n,r)},WebGLUniforms.upload=function(e,t,n,r){for(var i=0,a=t.length;i!==a;++i){var o=t[i],s=n[o.id];!1!==s.needsUpdate&&o.setValue(e,s.value,r)}},WebGLUniforms.seqWithValue=function(e,t){for(var n=[],r=0,i=e.length;r!==i;++r){var a=e[r];a.id in t&&n.push(a)}return n};var programIdCount=0;function addLineNumbers(e){for(var t=e.split("\n"),n=0;n<t.length;n++)t[n]=n+1+": "+t[n];return t.join("\n")}function getEncodingComponents(e){switch(e){case LinearEncoding:return["Linear","( value )"];case sRGBEncoding:return["sRGB","( value )"];case RGBEEncoding:return["RGBE","( value )"];case RGBM7Encoding:return["RGBM","( value, 7.0 )"];case RGBM16Encoding:return["RGBM","( value, 16.0 )"];case RGBDEncoding:return["RGBD","( value, 256.0 )"];case GammaEncoding:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case LogLuvEncoding:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+e)}}function getShaderErrors(e,t,n){var r=e.getShaderParameter(t,35713),i=e.getShaderInfoLog(t).trim();return r&&""===i?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+i+addLineNumbers(e.getShaderSource(t))}function getTexelDecodingFunction(e,t){var n=getEncodingComponents(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function getTexelEncodingFunction(e,t){var n=getEncodingComponents(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function getToneMappingFunction(e,t){var n;switch(t){case LinearToneMapping:n="Linear";break;case ReinhardToneMapping:n="Reinhard";break;case Uncharted2ToneMapping:n="Uncharted2";break;case CineonToneMapping:n="OptimizedCineon";break;case ACESFilmicToneMapping:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function generateExtensions(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(filterEmptyLine).join("\n")}function generateDefines(e){var t=[];for(var n in e){var r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}function fetchAttributeLocations(e,t){for(var n={},r=e.getProgramParameter(t,35721),i=0;i<r;i++){var a=e.getActiveAttrib(t,i).name;n[a]=e.getAttribLocation(t,a)}return n}function filterEmptyLine(e){return""!==e}function replaceLightNums(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function replaceClippingPlaneNums(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var includePattern=/^[ \t]*#include +<([\w\d./]+)>/gm;function resolveIncludes(e){return e.replace(includePattern,includeReplacer)}function includeReplacer(e,t){var n=ShaderChunk[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return resolveIncludes(n)}var loopPattern=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;function unrollLoops(e){return e.replace(loopPattern,loopReplacer)}function loopReplacer(e,t,n,r){for(var i="",a=parseInt(t);a<parseInt(n);a++)i+=r.replace(/\[ i \]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return i}function generatePrecision(e){var t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function generateShadowMapTypeDefine(e){var t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===PCFShadowMap?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===PCFSoftShadowMap?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===VSMShadowMap&&(t="SHADOWMAP_TYPE_VSM"),t}function generateEnvMapTypeDefine(e){var t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case CubeReflectionMapping:case CubeRefractionMapping:t="ENVMAP_TYPE_CUBE";break;case CubeUVReflectionMapping:case CubeUVRefractionMapping:t="ENVMAP_TYPE_CUBE_UV";break;case EquirectangularReflectionMapping:case EquirectangularRefractionMapping:t="ENVMAP_TYPE_EQUIREC";break;case SphericalReflectionMapping:t="ENVMAP_TYPE_SPHERE"}return t}function generateEnvMapModeDefine(e){var t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case CubeRefractionMapping:case EquirectangularRefractionMapping:t="ENVMAP_MODE_REFRACTION"}return t}function generateEnvMapBlendingDefine(e){var t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case MultiplyOperation:t="ENVMAP_BLENDING_MULTIPLY";break;case MixOperation:t="ENVMAP_BLENDING_MIX";break;case AddOperation:t="ENVMAP_BLENDING_ADD"}return t}function WebGLProgram(e,t,n){var r,i,a=e.getContext(),o=n.defines,s=n.vertexShader,l=n.fragmentShader,c=generateShadowMapTypeDefine(n),u=generateEnvMapTypeDefine(n),h=generateEnvMapModeDefine(n),p=generateEnvMapBlendingDefine(n),d=e.gammaFactor>0?e.gammaFactor:1,f=n.isWebGL2?"":generateExtensions(n),m=generateDefines(o),g=a.createProgram(),v=n.numMultiviewViews;if(n.isRawShaderMaterial?((r=[m].filter(filterEmptyLine).join("\n")).length>0&&(r+="\n"),(i=[f,m].filter(filterEmptyLine).join("\n")).length>0&&(i+="\n")):(r=[generatePrecision(n),"#define SHADER_NAME "+n.shaderName,m,n.instancing?"#define USE_INSTANCING":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(filterEmptyLine).join("\n"),i=[f,generatePrecision(n),"#define SHADER_NAME "+n.shaderName,m,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.envMap?"#define "+h:"",n.envMap?"#define "+p:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==NoToneMapping?"#define TONE_MAPPING":"",n.toneMapping!==NoToneMapping?ShaderChunk.tonemapping_pars_fragment:"",n.toneMapping!==NoToneMapping?getToneMappingFunction("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.outputEncoding||n.mapEncoding||n.matcapEncoding||n.envMapEncoding||n.emissiveMapEncoding||n.lightMapEncoding?ShaderChunk.encodings_pars_fragment:"",n.mapEncoding?getTexelDecodingFunction("mapTexelToLinear",n.mapEncoding):"",n.matcapEncoding?getTexelDecodingFunction("matcapTexelToLinear",n.matcapEncoding):"",n.envMapEncoding?getTexelDecodingFunction("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMapEncoding?getTexelDecodingFunction("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMapEncoding?getTexelDecodingFunction("lightMapTexelToLinear",n.lightMapEncoding):"",n.outputEncoding?getTexelEncodingFunction("linearToOutputTexel",n.outputEncoding):"",n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(filterEmptyLine).join("\n")),s=replaceClippingPlaneNums(s=replaceLightNums(s=resolveIncludes(s),n),n),l=replaceClippingPlaneNums(l=replaceLightNums(l=resolveIncludes(l),n),n),s=unrollLoops(s),l=unrollLoops(l),n.isWebGL2&&!n.isRawShaderMaterial){var y=!1,x=/^\s*#version\s+300\s+es\s*\n/;n.isShaderMaterial&&null!==s.match(x)&&null!==l.match(x)&&(y=!0,s=s.replace(x,""),l=l.replace(x,"")),r=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+r,i=["#version 300 es\n","#define varying in",y?"":"out highp vec4 pc_fragColor;",y?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+i,v>0&&(r=(r=r.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","layout(num_views = "+v+") in;","#define VIEW_ID gl_ViewID_OVR"].join("\n"))).replace(["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;"].join("\n"),["uniform mat4 modelViewMatrices["+v+"];","uniform mat4 projectionMatrices["+v+"];","uniform mat4 viewMatrices["+v+"];","uniform mat3 normalMatrices["+v+"];","#define modelViewMatrix modelViewMatrices[VIEW_ID]","#define projectionMatrix projectionMatrices[VIEW_ID]","#define viewMatrix viewMatrices[VIEW_ID]","#define normalMatrix normalMatrices[VIEW_ID]"].join("\n")),i=(i=i.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","#define VIEW_ID gl_ViewID_OVR"].join("\n"))).replace("uniform mat4 viewMatrix;",["uniform mat4 viewMatrices["+v+"];","#define viewMatrix viewMatrices[VIEW_ID]"].join("\n")))}var _,b,w=i+l,M=WebGLShader(a,35633,r+s),S=WebGLShader(a,35632,w);if(a.attachShader(g,M),a.attachShader(g,S),void 0!==n.index0AttributeName?a.bindAttribLocation(g,0,n.index0AttributeName):!0===n.morphTargets&&a.bindAttribLocation(g,0,"position"),a.linkProgram(g),e.debug.checkShaderErrors){var T=a.getProgramInfoLog(g).trim(),E=a.getShaderInfoLog(M).trim(),C=a.getShaderInfoLog(S).trim(),A=!0,L=!0;if(!1===a.getProgramParameter(g,35714)){A=!1;var D=getShaderErrors(a,M,"vertex"),P=getShaderErrors(a,S,"fragment");console.error("THREE.WebGLProgram: shader error: ",a.getError(),"35715",a.getProgramParameter(g,35715),"gl.getProgramInfoLog",T,D,P)}else""!==T?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",T):""!==E&&""!==C||(L=!1);L&&(this.diagnostics={runnable:A,programLog:T,vertexShader:{log:E,prefix:r},fragmentShader:{log:C,prefix:i}})}return a.deleteShader(M),a.deleteShader(S),this.getUniforms=function(){return void 0===_&&(_=new WebGLUniforms(a,g)),_},this.getAttributes=function(){return void 0===b&&(b=fetchAttributeLocations(a,g)),b},this.destroy=function(){a.deleteProgram(g),this.program=void 0},this.name=n.shaderName,this.id=programIdCount++,this.cacheKey=t,this.usedTimes=1,this.program=g,this.vertexShader=M,this.fragmentShader=S,this.numMultiviewViews=v,this}function WebGLPrograms(e,t,n){var r=[],i=n.isWebGL2,a=n.logarithmicDepthBuffer,o=n.floatVertexTextures,s=n.precision,l=n.maxVertexUniforms,c=n.vertexTextures,u={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},h=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","numMultiviewViews","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen"];function p(e){var t;return e?e.isTexture?t=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),t=e.texture.encoding):t=LinearEncoding,t}this.getParameters=function(r,h,d,f,m,g,v){var y=f.fog,x=r.isMeshStandardMaterial?f.environment:null,_=r.envMap||x,b=u[r.type],w=v.isSkinnedMesh?function(e){var t=e.skeleton.bones;if(o)return 1024;var n=l,r=Math.floor((n-20)/4),i=Math.min(r,t.length);return i<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+i+"."),0):i}(v):0;null!==r.precision&&(s=n.getMaxPrecision(r.precision))!==r.precision&&console.warn("THREE.WebGLProgram.getParameters:",r.precision,"not supported, using",s,"instead.");var M=function(e,t){var n;if(t){var r=ShaderLib[t];n={name:e.type,uniforms:UniformsUtils.clone(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader}}else n={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};return n}(r,b);r.onBeforeCompile(M,e);var S=e.getRenderTarget(),T=S&&S.isWebGLMultiviewRenderTarget?S.numViews:0;return{isWebGL2:i,shaderID:b,shaderName:M.name,uniforms:M.uniforms,vertexShader:M.vertexShader,fragmentShader:M.fragmentShader,defines:r.defines,isRawShaderMaterial:r.isRawShaderMaterial,isShaderMaterial:r.isShaderMaterial,precision:s,instancing:!0===v.isInstancedMesh,supportsVertexTextures:c,numMultiviewViews:T,outputEncoding:null!==S?p(S.texture):e.outputEncoding,map:!!r.map,mapEncoding:p(r.map),matcap:!!r.matcap,matcapEncoding:p(r.matcap),envMap:!!_,envMapMode:_&&_.mapping,envMapEncoding:p(_),envMapCubeUV:!!_&&(_.mapping===CubeUVReflectionMapping||_.mapping===CubeUVRefractionMapping),lightMap:!!r.lightMap,lightMapEncoding:p(r.lightMap),aoMap:!!r.aoMap,emissiveMap:!!r.emissiveMap,emissiveMapEncoding:p(r.emissiveMap),bumpMap:!!r.bumpMap,normalMap:!!r.normalMap,objectSpaceNormalMap:r.normalMapType===ObjectSpaceNormalMap,tangentSpaceNormalMap:r.normalMapType===TangentSpaceNormalMap,clearcoatNormalMap:!!r.clearcoatNormalMap,displacementMap:!!r.displacementMap,roughnessMap:!!r.roughnessMap,metalnessMap:!!r.metalnessMap,specularMap:!!r.specularMap,alphaMap:!!r.alphaMap,gradientMap:!!r.gradientMap,sheen:!!r.sheen,combine:r.combine,vertexTangents:r.normalMap&&r.vertexTangents,vertexColors:r.vertexColors,vertexUvs:!!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatNormalMap||r.displacementMap),uvsVertexOnly:!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatNormalMap||!r.displacementMap),fog:!!y,useFog:r.fog,fogExp2:y&&y.isFogExp2,flatShading:r.flatShading,sizeAttenuation:r.sizeAttenuation,logarithmicDepthBuffer:a,skinning:r.skinning&&w>0,maxBones:w,useVertexTexture:o,morphTargets:r.morphTargets,morphNormals:r.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:h.directional.length,numPointLights:h.point.length,numSpotLights:h.spot.length,numRectAreaLights:h.rectArea.length,numHemiLights:h.hemi.length,numDirLightShadows:h.directionalShadowMap.length,numPointLightShadows:h.pointShadowMap.length,numSpotLightShadows:h.spotShadowMap.length,numClippingPlanes:m,numClipIntersection:g,dithering:r.dithering,shadowMapEnabled:e.shadowMap.enabled&&d.length>0,shadowMapType:e.shadowMap.type,toneMapping:r.toneMapped?e.toneMapping:NoToneMapping,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:r.premultipliedAlpha,alphaTest:r.alphaTest,doubleSided:r.side===DoubleSide,flipSided:r.side===BackSide,depthPacking:void 0!==r.depthPacking&&r.depthPacking,index0AttributeName:r.index0AttributeName,extensionDerivatives:r.extensions&&r.extensions.derivatives,extensionFragDepth:r.extensions&&r.extensions.frawbuffers,extensionDrawbuffers:r.extensions&&r.extensions.drawbuffers,extensionShaderTextureLOD:r.extensions&&r.extensions.shaderTextureLOD,rendererExtensionFragDepth:i||null!==t.get("EXT_frag_depth"),rendererExtensionDrawBuffers:i||null!==t.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:i||null!==t.get("EXT_shader_texture_lod"),onBeforeCompile:r.onBeforeCompile}},this.getProgramCacheKey=function(t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var r in t.defines)n.push(r),n.push(t.defines[r]);if(void 0===t.isRawShaderMaterial){for(var i=0;i<h.length;i++)n.push(t[h[i]]);n.push(e.outputEncoding),n.push(e.gammaFactor)}return n.push(t.onBeforeCompile.toString()),n.join()},this.acquireProgram=function(t,n){for(var i,a=0,o=r.length;a<o;a++){var s=r[a];if(s.cacheKey===n){++(i=s).usedTimes;break}}return void 0===i&&(i=new WebGLProgram(e,n,t),r.push(i)),i},this.releaseProgram=function(e){if(0==--e.usedTimes){var t=r.indexOf(e);r[t]=r[r.length-1],r.pop(),e.destroy()}},this.programs=r}function WebGLProperties(){var e=new WeakMap;return{get:function(t){var n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,r){e.get(t)[n]=r},dispose:function(){e=new WeakMap}}}function painterSortStable(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function reversePainterSortStable(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function WebGLRenderList(){var e=[],t=0,n=[],r=[],i={id:-1};function a(n,r,a,o,s,l){var c=e[t];return void 0===c?(c={id:n.id,object:n,geometry:r,material:a,program:a.program||i,groupOrder:o,renderOrder:n.renderOrder,z:s,group:l},e[t]=c):(c.id=n.id,c.object=n,c.geometry=r,c.material=a,c.program=a.program||i,c.groupOrder=o,c.renderOrder=n.renderOrder,c.z=s,c.group=l),t++,c}return{opaque:n,transparent:r,init:function(){t=0,n.length=0,r.length=0},push:function(e,t,i,o,s,l){var c=a(e,t,i,o,s,l);(!0===i.transparent?r:n).push(c)},unshift:function(e,t,i,o,s,l){var c=a(e,t,i,o,s,l);(!0===i.transparent?r:n).unshift(c)},sort:function(e,t){n.length>1&&n.sort(e||painterSortStable),r.length>1&&r.sort(t||reversePainterSortStable)}}}function WebGLRenderLists(){var e=new WeakMap;function t(n){var r=n.target;r.removeEventListener("dispose",t),e.delete(r)}return{get:function(n,r){var i,a=e.get(n);return void 0===a?(i=new WebGLRenderList,e.set(n,new WeakMap),e.get(n).set(r,i),n.addEventListener("dispose",t)):void 0===(i=a.get(r))&&(i=new WebGLRenderList,a.set(r,i)),i},dispose:function(){e=new WeakMap}}}function UniformsCache(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new Vector3,color:new Color,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Vector2};break;case"SpotLight":n={position:new Vector3,direction:new Vector3,color:new Color,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Vector2};break;case"PointLight":n={position:new Vector3,color:new Color,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Vector2,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new Vector3,skyColor:new Color,groundColor:new Color};break;case"RectAreaLight":n={color:new Color,position:new Vector3,halfWidth:new Vector3,halfHeight:new Vector3}}return e[t.id]=n,n}}}var nextVersion=0;function shadowCastingLightsFirst(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function WebGLLights(){for(var e=new UniformsCache,t={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},n=0;n<9;n++)t.probe.push(new Vector3);var r=new Vector3,i=new Matrix4,a=new Matrix4;return{setup:function(n,o,s){for(var l=0,c=0,u=0,h=0;h<9;h++)t.probe[h].set(0,0,0);var p=0,d=0,f=0,m=0,g=0,v=0,y=0,x=0,_=s.matrixWorldInverse;n.sort(shadowCastingLightsFirst),h=0;for(var b=n.length;h<b;h++){var w=n[h],M=w.color,S=w.intensity,T=w.distance,E=w.shadow&&w.shadow.map?w.shadow.map.texture:null;if(w.isAmbientLight)l+=M.r*S,c+=M.g*S,u+=M.b*S;else if(w.isLightProbe)for(var C=0;C<9;C++)t.probe[C].addScaledVector(w.sh.coefficients[C],S);else if(w.isDirectionalLight){if((L=e.get(w)).color.copy(w.color).multiplyScalar(w.intensity),L.direction.setFromMatrixPosition(w.matrixWorld),r.setFromMatrixPosition(w.target.matrixWorld),L.direction.sub(r),L.direction.transformDirection(_),L.shadow=w.castShadow,w.castShadow){var A=w.shadow;L.shadowBias=A.bias,L.shadowRadius=A.radius,L.shadowMapSize=A.mapSize,t.directionalShadowMap[p]=E,t.directionalShadowMatrix[p]=w.shadow.matrix,v++}t.directional[p]=L,p++}else if(w.isSpotLight)(L=e.get(w)).position.setFromMatrixPosition(w.matrixWorld),L.position.applyMatrix4(_),L.color.copy(M).multiplyScalar(S),L.distance=T,L.direction.setFromMatrixPosition(w.matrixWorld),r.setFromMatrixPosition(w.target.matrixWorld),L.direction.sub(r),L.direction.transformDirection(_),L.coneCos=Math.cos(w.angle),L.penumbraCos=Math.cos(w.angle*(1-w.penumbra)),L.decay=w.decay,L.shadow=w.castShadow,w.castShadow&&(A=w.shadow,L.shadowBias=A.bias,L.shadowRadius=A.radius,L.shadowMapSize=A.mapSize,t.spotShadowMap[f]=E,t.spotShadowMatrix[f]=w.shadow.matrix,x++),t.spot[f]=L,f++;else if(w.isRectAreaLight)(L=e.get(w)).color.copy(M).multiplyScalar(S),L.position.setFromMatrixPosition(w.matrixWorld),L.position.applyMatrix4(_),a.identity(),i.copy(w.matrixWorld),i.premultiply(_),a.extractRotation(i),L.halfWidth.set(.5*w.width,0,0),L.halfHeight.set(0,.5*w.height,0),L.halfWidth.applyMatrix4(a),L.halfHeight.applyMatrix4(a),t.rectArea[m]=L,m++;else if(w.isPointLight)(L=e.get(w)).position.setFromMatrixPosition(w.matrixWorld),L.position.applyMatrix4(_),L.color.copy(w.color).multiplyScalar(w.intensity),L.distance=w.distance,L.decay=w.decay,L.shadow=w.castShadow,w.castShadow&&(A=w.shadow,L.shadowBias=A.bias,L.shadowRadius=A.radius,L.shadowMapSize=A.mapSize,L.shadowCameraNear=A.camera.near,L.shadowCameraFar=A.camera.far,t.pointShadowMap[d]=E,t.pointShadowMatrix[d]=w.shadow.matrix,y++),t.point[d]=L,d++;else if(w.isHemisphereLight){var L;(L=e.get(w)).direction.setFromMatrixPosition(w.matrixWorld),L.direction.transformDirection(_),L.direction.normalize(),L.skyColor.copy(w.color).multiplyScalar(S),L.groundColor.copy(w.groundColor).multiplyScalar(S),t.hemi[g]=L,g++}}t.ambient[0]=l,t.ambient[1]=c,t.ambient[2]=u;var D=t.hash;D.directionalLength===p&&D.pointLength===d&&D.spotLength===f&&D.rectAreaLength===m&&D.hemiLength===g&&D.numDirectionalShadows===v&&D.numPointShadows===y&&D.numSpotShadows===x||(t.directional.length=p,t.spot.length=f,t.rectArea.length=m,t.point.length=d,t.hemi.length=g,t.directionalShadowMap.length=v,t.pointShadowMap.length=y,t.spotShadowMap.length=x,t.directionalShadowMatrix.length=v,t.pointShadowMatrix.length=y,t.spotShadowMatrix.length=x,D.directionalLength=p,D.pointLength=d,D.spotLength=f,D.rectAreaLength=m,D.hemiLength=g,D.numDirectionalShadows=v,D.numPointShadows=y,D.numSpotShadows=x,t.version=nextVersion++)},state:t}}function WebGLRenderState(){var e=new WebGLLights,t=[],n=[];return{init:function(){t.length=0,n.length=0},state:{lightsArray:t,shadowsArray:n,lights:e},setupLights:function(r){e.setup(t,n,r)},pushLight:function(e){t.push(e)},pushShadow:function(e){n.push(e)}}}function WebGLRenderStates(){var e=new WeakMap;function t(n){var r=n.target;r.removeEventListener("dispose",t),e.delete(r)}return{get:function(n,r){var i;return!1===e.has(n)?(i=new WebGLRenderState,e.set(n,new WeakMap),e.get(n).set(r,i),n.addEventListener("dispose",t)):!1===e.get(n).has(r)?(i=new WebGLRenderState,e.get(n).set(r,i)):i=e.get(n).get(r),i},dispose:function(){e=new WeakMap}}}function MeshDepthMaterial(e){Material.call(this),this.type="MeshDepthMaterial",this.depthPacking=BasicDepthPacking,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}function MeshDistanceMaterial(e){Material.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Vector3,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}MeshDepthMaterial.prototype=Object.create(Material.prototype),MeshDepthMaterial.prototype.constructor=MeshDepthMaterial,MeshDepthMaterial.prototype.isMeshDepthMaterial=!0,MeshDepthMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},MeshDistanceMaterial.prototype=Object.create(Material.prototype),MeshDistanceMaterial.prototype.constructor=MeshDistanceMaterial,MeshDistanceMaterial.prototype.isMeshDistanceMaterial=!0,MeshDistanceMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this};var vsm_frag="uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}",vsm_vert="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}";function WebGLShadowMap(e,t,n){var r=new Frustum,i=new Vector2,a=new Vector2,o=new Vector4,s=[],l=[],c={},u={0:BackSide,1:FrontSide,2:DoubleSide},h=new ShaderMaterial({defines:{SAMPLE_RATE:.25,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Vector2},radius:{value:4}},vertexShader:vsm_vert,fragmentShader:vsm_frag}),p=h.clone();p.defines.HORIZONAL_PASS=1;var d=new BufferGeometry;d.setAttribute("position",new BufferAttribute(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var f=new Mesh(d,h),m=this;function g(n,r){var i=t.update(f);h.uniforms.shadow_pass.value=n.map.texture,h.uniforms.resolution.value=n.mapSize,h.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,i,h,f,null),p.uniforms.shadow_pass.value=n.mapPass.texture,p.uniforms.resolution.value=n.mapSize,p.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,i,p,f,null)}function v(e,t,n){var r=e<<0|t<<1|n<<2,i=s[r];return void 0===i&&(i=new MeshDepthMaterial({depthPacking:RGBADepthPacking,morphTargets:e,skinning:t}),s[r]=i),i}function y(e,t,n){var r=e<<0|t<<1|n<<2,i=l[r];return void 0===i&&(i=new MeshDistanceMaterial({morphTargets:e,skinning:t}),l[r]=i),i}function x(t,n,r,i,a,o){var s=t.geometry,l=null,h=v,p=t.customDepthMaterial;if(!0===r.isPointLight&&(h=y,p=t.customDistanceMaterial),void 0===p){var d=!1;!0===n.morphTargets&&(!0===s.isBufferGeometry?d=s.morphAttributes&&s.morphAttributes.position&&s.morphAttributes.position.length>0:!0===s.isGeometry&&(d=s.morphTargets&&s.morphTargets.length>0));var f=!1;!0===t.isSkinnedMesh&&(!0===n.skinning?f=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),l=h(d,f,!0===t.isInstancedMesh)}else l=p;if(e.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var m=l.uuid,g=n.uuid,x=c[m];void 0===x&&(x={},c[m]=x);var _=x[g];void 0===_&&(_=l.clone(),x[g]=_),l=_}return l.visible=n.visible,l.wireframe=n.wireframe,l.side=o===VSMShadowMap?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:u[n.side],l.clipShadows=n.clipShadows,l.clippingPlanes=n.clippingPlanes,l.clipIntersection=n.clipIntersection,l.wireframeLinewidth=n.wireframeLinewidth,l.linewidth=n.linewidth,!0===r.isPointLight&&!0===l.isMeshDistanceMaterial&&(l.referencePosition.setFromMatrixPosition(r.matrixWorld),l.nearDistance=i,l.farDistance=a),l}function _(n,i,a,o,s){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===VSMShadowMap)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);var l=t.update(n),c=n.material;if(Array.isArray(c))for(var u=l.groups,h=0,p=u.length;h<p;h++){var d=u[h],f=c[d.materialIndex];if(f&&f.visible){var m=x(n,f,o,a.near,a.far,s);e.renderBufferDirect(a,null,l,m,n,d)}}else if(c.visible){m=x(n,c,o,a.near,a.far,s);e.renderBufferDirect(a,null,l,m,n,null)}}for(var g=n.children,v=0,y=g.length;v<y;v++)_(g[v],i,a,o,s)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=PCFShadowMap,this.render=function(t,s,l){if(!1!==m.enabled&&(!1!==m.autoUpdate||!1!==m.needsUpdate)&&0!==t.length){var c=e.getRenderTarget(),u=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),p=e.state;p.setBlending(NoBlending),p.buffers.color.setClear(1,1,1,1),p.buffers.depth.setTest(!0),p.setScissorTest(!1);for(var d=0,f=t.length;d<f;d++){var v=t[d],y=v.shadow;if(void 0!==y){i.copy(y.mapSize);var x=y.getFrameExtents();if(i.multiply(x),a.copy(y.mapSize),(i.x>n||i.y>n)&&(console.warn("THREE.WebGLShadowMap:",v,"has shadow exceeding max texture size, reducing"),i.x>n&&(a.x=Math.floor(n/x.x),i.x=a.x*x.x,y.mapSize.x=a.x),i.y>n&&(a.y=Math.floor(n/x.y),i.y=a.y*x.y,y.mapSize.y=a.y)),null===y.map&&!y.isPointLightShadow&&this.type===VSMShadowMap){var b={minFilter:LinearFilter,magFilter:LinearFilter,format:RGBAFormat};y.map=new WebGLRenderTarget(i.x,i.y,b),y.map.texture.name=v.name+".shadowMap",y.mapPass=new WebGLRenderTarget(i.x,i.y,b),y.camera.updateProjectionMatrix()}if(null===y.map){b={minFilter:NearestFilter,magFilter:NearestFilter,format:RGBAFormat};y.map=new WebGLRenderTarget(i.x,i.y,b),y.map.texture.name=v.name+".shadowMap",y.camera.updateProjectionMatrix()}e.setRenderTarget(y.map),e.clear();for(var w=y.getViewportCount(),M=0;M<w;M++){var S=y.getViewport(M);o.set(a.x*S.x,a.y*S.y,a.x*S.z,a.y*S.w),p.viewport(o),y.updateMatrices(v,M),r=y.getFrustum(),_(s,l,y.camera,v,this.type)}y.isPointLightShadow||this.type!==VSMShadowMap||g(y,l)}else console.warn("THREE.WebGLShadowMap:",v,"has no shadow.")}m.needsUpdate=!1,e.setRenderTarget(c,u,h)}}}function WebGLState(e,t,n){var r=n.isWebGL2;var i=new function(){var t=!1,n=new Vector4,r=null,i=new Vector4(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,a,o,s){!0===s&&(t*=o,r*=o,a*=o),n.set(t,r,a,o),!1===i.equals(n)&&(e.clearColor(t,r,a,o),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},a=new function(){var t=!1,n=null,r=null,i=null;return{setTest:function(e){e?F(2929):G(2929)},setMask:function(r){n===r||t||(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){if(t)switch(t){case NeverDepth:e.depthFunc(512);break;case AlwaysDepth:e.depthFunc(519);break;case LessDepth:e.depthFunc(513);break;case LessEqualDepth:e.depthFunc(515);break;case EqualDepth:e.depthFunc(514);break;case GreaterEqualDepth:e.depthFunc(518);break;case GreaterDepth:e.depthFunc(516);break;case NotEqualDepth:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,n=null,r=null,i=null}}},o=new function(){var t=!1,n=null,r=null,i=null,a=null,o=null,s=null,l=null,c=null;return{setTest:function(e){t||(e?F(2960):G(2960))},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,o){r===t&&i===n&&a===o||(e.stencilFunc(t,n,o),r=t,i=n,a=o)},setOp:function(t,n,r){o===t&&s===n&&l===r||(e.stencilOp(t,n,r),o=t,s=n,l=r)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,n=null,r=null,i=null,a=null,o=null,s=null,l=null,c=null}}},s=e.getParameter(34921),l=new Uint8Array(s),c=new Uint8Array(s),u=new Uint8Array(s),h={},p=null,d=null,f=null,m=null,g=null,v=null,y=null,x=null,_=null,b=!1,w=null,M=null,S=null,T=null,E=null,C=e.getParameter(35661),A=!1,L=0,D=e.getParameter(7938);-1!==D.indexOf("WebGL")?(L=parseFloat(/^WebGL\ ([0-9])/.exec(D)[1]),A=L>=1):-1!==D.indexOf("OpenGL ES")&&(L=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(D)[1]),A=L>=2);var P=null,O={},R=new Vector4,I=new Vector4;function B(t,n,r){var i=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(var o=0;o<r;o++)e.texImage2D(n+o,0,6408,1,1,0,6408,5121,i);return a}var N={};function k(n,i){(l[n]=1,0===c[n]&&(e.enableVertexAttribArray(n),c[n]=1),u[n]!==i)&&((r?e:t.get("ANGLE_instanced_arrays"))[r?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),u[n]=i)}function F(t){!0!==h[t]&&(e.enable(t),h[t]=!0)}function G(t){!1!==h[t]&&(e.disable(t),h[t]=!1)}N[3553]=B(3553,3553,1),N[34067]=B(34067,34069,6),i.setClear(0,0,0,1),a.setClear(1),o.setClear(0),F(2929),a.setFunc(LessEqualDepth),H(!1),W(CullFaceBack),F(2884),j(NoBlending);var V={[AddEquation]:32774,[SubtractEquation]:32778,[ReverseSubtractEquation]:32779};if(r)V[MinEquation]=32775,V[MaxEquation]=32776;else{var z=t.get("EXT_blend_minmax");null!==z&&(V[MinEquation]=z.MIN_EXT,V[MaxEquation]=z.MAX_EXT)}var U={[ZeroFactor]:0,[OneFactor]:1,[SrcColorFactor]:768,[SrcAlphaFactor]:770,[SrcAlphaSaturateFactor]:776,[DstColorFactor]:774,[DstAlphaFactor]:772,[OneMinusSrcColorFactor]:769,[OneMinusSrcAlphaFactor]:771,[OneMinusDstColorFactor]:775,[OneMinusDstAlphaFactor]:773};function j(t,n,r,i,a,o,s,l){if(t!==NoBlending){if(d||(F(3042),d=!0),t===CustomBlending)a=a||n,o=o||r,s=s||i,n===m&&a===y||(e.blendEquationSeparate(V[n],V[a]),m=n,y=a),r===g&&i===v&&o===x&&s===_||(e.blendFuncSeparate(U[r],U[i],U[o],U[s]),g=r,v=i,x=o,_=s),f=t,b=null;else if(t!==f||l!==b){if(m===AddEquation&&y===AddEquation||(e.blendEquation(32774),m=AddEquation,y=AddEquation),l)switch(t){case NormalBlending:e.blendFuncSeparate(1,771,1,771);break;case AdditiveBlending:e.blendFunc(1,1);break;case SubtractiveBlending:e.blendFuncSeparate(0,0,769,771);break;case MultiplyBlending:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case NormalBlending:e.blendFuncSeparate(770,771,1,771);break;case AdditiveBlending:e.blendFunc(770,1);break;case SubtractiveBlending:e.blendFunc(0,769);break;case MultiplyBlending:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}g=null,v=null,x=null,_=null,f=t,b=l}}else d&&(G(3042),d=!1)}function H(t){w!==t&&(t?e.frontFace(2304):e.frontFace(2305),w=t)}function W(t){t!==CullFaceNone?(F(2884),t!==M&&(t===CullFaceBack?e.cullFace(1029):t===CullFaceFront?e.cullFace(1028):e.cullFace(1032))):G(2884),M=t}function q(t,n,r){t?(F(32823),T===n&&E===r||(e.polygonOffset(n,r),T=n,E=r)):G(32823)}function J(t){void 0===t&&(t=33984+C-1),P!==t&&(e.activeTexture(t),P=t)}return{buffers:{color:i,depth:a,stencil:o},initAttributes:function(){for(var e=0,t=l.length;e<t;e++)l[e]=0},enableAttribute:function(e){k(e,0)},enableAttributeAndDivisor:k,disableUnusedAttributes:function(){for(var t=0,n=c.length;t!==n;++t)c[t]!==l[t]&&(e.disableVertexAttribArray(t),c[t]=0)},enable:F,disable:G,useProgram:function(t){return p!==t&&(e.useProgram(t),p=t,!0)},setBlending:j,setMaterial:function(e,t){e.side===DoubleSide?G(2884):F(2884);var n=e.side===BackSide;t&&(n=!n),H(n),e.blending===NormalBlending&&!1===e.transparent?j(NoBlending):j(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),a.setFunc(e.depthFunc),a.setTest(e.depthTest),a.setMask(e.depthWrite),i.setMask(e.colorWrite);var r=e.stencilWrite;o.setTest(r),r&&(o.setMask(e.stencilWriteMask),o.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),o.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),q(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)},setFlipSided:H,setCullFace:W,setLineWidth:function(t){t!==S&&(A&&e.lineWidth(t),S=t)},setPolygonOffset:q,setScissorTest:function(e){e?F(3089):G(3089)},activeTexture:J,bindTexture:function(t,n){null===P&&J();var r=O[P];void 0===r&&(r={type:void 0,texture:void 0},O[P]=r),r.type===t&&r.texture===n||(e.bindTexture(t,n||N[t]),r.type=t,r.texture=n)},unbindTexture:function(){var t=O[P];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===R.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),R.copy(t))},viewport:function(t){!1===I.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),I.copy(t))},reset:function(){for(var t=0;t<c.length;t++)1===c[t]&&(e.disableVertexAttribArray(t),c[t]=0);h={},P=null,O={},p=null,f=null,w=null,M=null,i.reset(),a.reset(),o.reset()}}}function WebGLTextures(e,t,n,r,i,a,o){var s,l=i.isWebGL2,c=i.maxTextures,u=i.maxCubemapSize,h=i.maxTextureSize,p=i.maxSamples,d=new WeakMap,f=!1;try{f="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function m(e,t){return f?new OffscreenCanvas(e,t):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function g(e,t,n,r){var i=1;if((e.width>r||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){var a=t?MathUtils.floorPowerOfTwo:Math.floor,o=a(i*e.width),l=a(i*e.height);void 0===s&&(s=m(o,l));var c=n?m(o,l):s;return c.width=o,c.height=l,c.getContext("2d").drawImage(e,0,0,o,l),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+o+"x"+l+")."),c}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function v(e){return MathUtils.isPowerOfTwo(e.width)&&MathUtils.isPowerOfTwo(e.height)}function y(e,t){return e.generateMipmaps&&t&&e.minFilter!==NearestFilter&&e.minFilter!==LinearFilter}function x(t,n,i,a){e.generateMipmap(t),r.get(n).__maxMipLevel=Math.log(Math.max(i,a))*Math.LOG2E}function _(n,r,i){if(!1===l)return r;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var a=r;return 6403===r&&(5126===i&&(a=33326),5131===i&&(a=33325),5121===i&&(a=33321)),6407===r&&(5126===i&&(a=34837),5131===i&&(a=34843),5121===i&&(a=32849)),6408===r&&(5126===i&&(a=34836),5131===i&&(a=34842),5121===i&&(a=32856)),33325===a||33326===a||34842===a||34836===a?t.get("EXT_color_buffer_float"):34843!==a&&34837!==a||console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),a}function b(e){return e===NearestFilter||e===NearestMipmapNearestFilter||e===NearestMipmapLinearFilter?9728:9729}function w(t){var n=t.target;n.removeEventListener("dispose",w),function(t){var n=r.get(t);if(void 0===n.__webglInit)return;e.deleteTexture(n.__webglTexture),r.remove(t)}(n),n.isVideoTexture&&d.delete(n),o.memory.textures--}function M(t){var n=t.target;n.removeEventListener("dispose",M),function(t){var n=r.get(t),i=r.get(t.texture);if(!t)return;void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(var a=0;a<6;a++)e.deleteFramebuffer(n.__webglFramebuffer[a]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[a]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer);if(t.isWebGLMultiviewRenderTarget){e.deleteTexture(n.__webglColorTexture),e.deleteTexture(n.__webglDepthStencilTexture),o.memory.textures-=2;for(var a=0,s=n.__webglViewFramebuffers.length;a<s;a++)e.deleteFramebuffer(n.__webglViewFramebuffers[a])}r.remove(t.texture),r.remove(t)}(n),o.memory.textures--}var S=0;function T(e,t){var i=r.get(e);if(e.isVideoTexture&&function(e){var t=o.render.frame;d.get(e)!==t&&(d.set(e,t),e.update())}(e),e.version>0&&i.__version!==e.version){var a=e.image;if(void 0===a)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==a.complete)return void O(i,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,i.__webglTexture)}function E(t,i){if(6===t.image.length){var o=r.get(t);if(t.version>0&&o.__version!==t.version){P(o,t),n.activeTexture(33984+i),n.bindTexture(34067,o.__webglTexture),e.pixelStorei(37440,t.flipY);for(var s=t&&(t.isCompressedTexture||t.image[0].isCompressedTexture),c=t.image[0]&&t.image[0].isDataTexture,h=[],p=0;p<6;p++)h[p]=s||c?c?t.image[p].image:t.image[p]:g(t.image[p],!1,!0,u);var d,f=h[0],m=v(f)||l,b=a.convert(t.format),w=a.convert(t.type),M=_(t.internalFormat,b,w);if(D(34067,t,m),s){for(p=0;p<6;p++){d=h[p].mipmaps;for(var S=0;S<d.length;S++){var T=d[S];t.format!==RGBAFormat&&t.format!==RGBFormat?null!==b?n.compressedTexImage2D(34069+p,S,M,T.width,T.height,0,T.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+p,S,M,T.width,T.height,0,b,w,T.data)}}o.__maxMipLevel=d.length-1}else{d=t.mipmaps;for(p=0;p<6;p++)if(c){n.texImage2D(34069+p,0,M,h[p].width,h[p].height,0,b,w,h[p].data);for(S=0;S<d.length;S++){var E=(T=d[S]).image[p].image;n.texImage2D(34069+p,S+1,M,E.width,E.height,0,b,w,E.data)}}else{n.texImage2D(34069+p,0,M,b,w,h[p]);for(S=0;S<d.length;S++){T=d[S];n.texImage2D(34069+p,S+1,M,b,w,T.image[p])}}o.__maxMipLevel=d.length}y(t,m)&&x(34067,t,f.width,f.height),o.__version=t.version,t.onUpdate&&t.onUpdate(t)}else n.activeTexture(33984+i),n.bindTexture(34067,o.__webglTexture)}}function C(e,t){n.activeTexture(33984+t),n.bindTexture(34067,r.get(e).__webglTexture)}var A={[RepeatWrapping]:10497,[ClampToEdgeWrapping]:33071,[MirroredRepeatWrapping]:33648},L={[NearestFilter]:9728,[NearestMipmapNearestFilter]:9984,[NearestMipmapLinearFilter]:9986,[LinearFilter]:9729,[LinearMipmapNearestFilter]:9985,[LinearMipmapLinearFilter]:9987};function D(n,a,o){o?(e.texParameteri(n,10242,A[a.wrapS]),e.texParameteri(n,10243,A[a.wrapT]),32879!==n&&35866!==n||e.texParameteri(n,32882,A[a.wrapR]),e.texParameteri(n,10240,L[a.magFilter]),e.texParameteri(n,10241,L[a.minFilter])):(e.texParameteri(n,10242,33071),e.texParameteri(n,10243,33071),32879!==n&&35866!==n||e.texParameteri(n,32882,33071),a.wrapS===ClampToEdgeWrapping&&a.wrapT===ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(n,10240,b(a.magFilter)),e.texParameteri(n,10241,b(a.minFilter)),a.minFilter!==NearestFilter&&a.minFilter!==LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));var s=t.get("EXT_texture_filter_anisotropic");if(s){if(a.type===FloatType&&null===t.get("OES_texture_float_linear"))return;if(a.type===HalfFloatType&&null===(l||t.get("OES_texture_half_float_linear")))return;(a.anisotropy>1||r.get(a).__currentAnisotropy)&&(e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy)}}function P(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",w),t.__webglTexture=e.createTexture(),o.memory.textures++)}function O(t,r,i){var o=3553;r.isDataTexture2DArray&&(o=35866),r.isDataTexture3D&&(o=32879),P(t,r),n.activeTexture(33984+i),n.bindTexture(o,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment);var s=function(e){return!l&&(e.wrapS!==ClampToEdgeWrapping||e.wrapT!==ClampToEdgeWrapping||e.minFilter!==NearestFilter&&e.minFilter!==LinearFilter)}(r)&&!1===v(r.image),c=g(r.image,s,!1,h),u=v(c)||l,p=a.convert(r.format),d=a.convert(r.type),f=_(r.internalFormat,p,d);D(o,r,u);var m,b=r.mipmaps;if(r.isDepthTexture){if(f=6402,r.type===FloatType){if(!1===l)throw new Error("Float Depth Texture only supported in WebGL2.0");f=36012}else l&&(f=33189);r.format===DepthFormat&&6402===f&&r.type!==UnsignedShortType&&r.type!==UnsignedIntType&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=UnsignedShortType,d=a.convert(r.type)),r.format===DepthStencilFormat&&(f=34041,r.type!==UnsignedInt248Type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=UnsignedInt248Type,d=a.convert(r.type))),n.texImage2D(3553,0,f,c.width,c.height,0,p,d,null)}else if(r.isDataTexture)if(b.length>0&&u){for(var w=0,M=b.length;w<M;w++)m=b[w],n.texImage2D(3553,w,f,m.width,m.height,0,p,d,m.data);r.generateMipmaps=!1,t.__maxMipLevel=b.length-1}else n.texImage2D(3553,0,f,c.width,c.height,0,p,d,c.data),t.__maxMipLevel=0;else if(r.isCompressedTexture){for(w=0,M=b.length;w<M;w++)m=b[w],r.format!==RGBAFormat&&r.format!==RGBFormat?null!==p?n.compressedTexImage2D(3553,w,f,m.width,m.height,0,m.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,w,f,m.width,m.height,0,p,d,m.data);t.__maxMipLevel=b.length-1}else if(r.isDataTexture2DArray)n.texImage3D(35866,0,f,c.width,c.height,c.depth,0,p,d,c.data),t.__maxMipLevel=0;else if(r.isDataTexture3D)n.texImage3D(32879,0,f,c.width,c.height,c.depth,0,p,d,c.data),t.__maxMipLevel=0;else if(b.length>0&&u){for(w=0,M=b.length;w<M;w++)m=b[w],n.texImage2D(3553,w,f,p,d,m);r.generateMipmaps=!1,t.__maxMipLevel=b.length-1}else n.texImage2D(3553,0,f,p,d,c),t.__maxMipLevel=0;y(r,u)&&x(o,r,c.width,c.height),t.__version=r.version,r.onUpdate&&r.onUpdate(r)}function R(t,i,o,s){var l=a.convert(i.texture.format),c=a.convert(i.texture.type),u=_(i.texture.internalFormat,l,c);n.texImage2D(s,0,u,i.width,i.height,0,l,c,null),e.bindFramebuffer(36160,t),e.framebufferTexture2D(36160,o,s,r.get(i.texture).__webglTexture,0),e.bindFramebuffer(36160,null)}function I(t,n,r){if(e.bindRenderbuffer(36161,t),n.depthBuffer&&!n.stencilBuffer){if(r){var i=N(n);e.renderbufferStorageMultisample(36161,i,33189,n.width,n.height)}else e.renderbufferStorage(36161,33189,n.width,n.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(n.depthBuffer&&n.stencilBuffer){if(r){i=N(n);e.renderbufferStorageMultisample(36161,i,35056,n.width,n.height)}else e.renderbufferStorage(36161,34041,n.width,n.height);e.framebufferRenderbuffer(36160,33306,36161,t)}else{var o=a.convert(n.texture.format),s=a.convert(n.texture.type),l=_(n.texture.internalFormat,o,s);if(r){i=N(n);e.renderbufferStorageMultisample(36161,i,l,n.width,n.height)}else e.renderbufferStorage(36161,l,n.width,n.height)}e.bindRenderbuffer(36161,null)}function B(t){var n=r.get(t),i=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,n){if(n&&n.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,t),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),T(n.depthTexture,0);var i=r.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===DepthFormat)e.framebufferTexture2D(36160,36096,3553,i,0);else{if(n.depthTexture.format!==DepthStencilFormat)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(36160,33306,3553,i,0)}}(n.__webglFramebuffer,t)}else if(i){n.__webglDepthbuffer=[];for(var a=0;a<6;a++)e.bindFramebuffer(36160,n.__webglFramebuffer[a]),n.__webglDepthbuffer[a]=e.createRenderbuffer(),I(n.__webglDepthbuffer[a],t)}else e.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=e.createRenderbuffer(),I(n.__webglDepthbuffer,t);e.bindFramebuffer(36160,null)}function N(e){return l&&e.isWebGLMultisampleRenderTarget?Math.min(p,e.samples):0}var k=!1,F=!1;this.allocateTextureUnit=function(){var e=S;return e>=c&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+c),S+=1,e},this.resetTextureUnits=function(){S=0},this.setTexture2D=T,this.setTexture2DArray=function(e,t){var i=r.get(e);e.version>0&&i.__version!==e.version?O(i,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){var i=r.get(e);e.version>0&&i.__version!==e.version?O(i,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=E,this.setTextureCubeDynamic=C,this.setupRenderTarget=function(i){var s=r.get(i),c=r.get(i.texture);i.addEventListener("dispose",M),c.__webglTexture=e.createTexture(),o.memory.textures++;var u=!0===i.isWebGLCubeRenderTarget,h=!0===i.isWebGLMultisampleRenderTarget,p=!0===i.isWebGLMultiviewRenderTarget,d=v(i)||l;if(u){s.__webglFramebuffer=[];for(var f=0;f<6;f++)s.__webglFramebuffer[f]=e.createFramebuffer()}else if(s.__webglFramebuffer=e.createFramebuffer(),h)if(l){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,s.__webglColorRenderbuffer);var m=a.convert(i.texture.format),g=a.convert(i.texture.type),b=_(i.texture.internalFormat,m,g),w=N(i);e.renderbufferStorageMultisample(36161,w,b,i.width,i.height),e.bindFramebuffer(36160,s.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,s.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),i.depthBuffer&&(s.__webglDepthRenderbuffer=e.createRenderbuffer(),I(s.__webglDepthRenderbuffer,i,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");else if(p){var S=i.width,T=i.height,E=i.numViews;e.bindFramebuffer(36160,s.__webglFramebuffer);var C=t.get("OVR_multiview2");o.memory.textures+=2;var A=e.createTexture();e.bindTexture(35866,A),e.texParameteri(35866,10240,9728),e.texParameteri(35866,10241,9728),e.texImage3D(35866,0,32856,S,T,E,0,6408,5121,null),C.framebufferTextureMultiviewOVR(36160,36064,A,0,0,E);var L=e.createTexture();e.bindTexture(35866,L),e.texParameteri(35866,10240,9728),e.texParameteri(35866,10241,9728),e.texImage3D(35866,0,35056,S,T,E,0,34041,34042,null),C.framebufferTextureMultiviewOVR(36160,33306,L,0,0,E);var P=new Array(E);for(f=0;f<E;++f)P[f]=e.createFramebuffer(),e.bindFramebuffer(36160,P[f]),e.framebufferTextureLayer(36160,36064,A,0,f);s.__webglColorTexture=A,s.__webglDepthStencilTexture=L,s.__webglViewFramebuffers=P,e.bindFramebuffer(36160,null),e.bindTexture(35866,null)}if(u){for(n.bindTexture(34067,c.__webglTexture),D(34067,i.texture,d),f=0;f<6;f++)R(s.__webglFramebuffer[f],i,36064,34069+f);y(i.texture,d)&&x(34067,i.texture,i.width,i.height),n.bindTexture(34067,null)}else p||(n.bindTexture(3553,c.__webglTexture),D(3553,i.texture,d),R(s.__webglFramebuffer,i,36064,3553),y(i.texture,d)&&x(3553,i.texture,i.width,i.height),n.bindTexture(3553,null));i.depthBuffer&&B(i)},this.updateRenderTargetMipmap=function(e){var t=e.texture;if(y(t,v(e)||l)){var i=e.isWebGLCubeRenderTarget?34067:3553,a=r.get(t).__webglTexture;n.bindTexture(i,a),x(i,t,e.width,e.height),n.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(l){var n=r.get(t);e.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,n.__webglFramebuffer);var i=t.width,a=t.height,o=16384;t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024),e.blitFramebuffer(0,0,i,a,0,0,i,a,o,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===k&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),k=!0),e=e.texture),T(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===F&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),F=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?E(e,t):C(e,t)}}function WebGLUtils(e,t,n){var r=n.isWebGL2;return{convert:function(e){var n;if(e===UnsignedByteType)return 5121;if(e===UnsignedShort4444Type)return 32819;if(e===UnsignedShort5551Type)return 32820;if(e===UnsignedShort565Type)return 33635;if(e===ByteType)return 5120;if(e===ShortType)return 5122;if(e===UnsignedShortType)return 5123;if(e===IntType)return 5124;if(e===UnsignedIntType)return 5125;if(e===FloatType)return 5126;if(e===HalfFloatType)return r?5131:null!==(n=t.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(e===AlphaFormat)return 6406;if(e===RGBFormat)return 6407;if(e===RGBAFormat)return 6408;if(e===LuminanceFormat)return 6409;if(e===LuminanceAlphaFormat)return 6410;if(e===DepthFormat)return 6402;if(e===DepthStencilFormat)return 34041;if(e===RedFormat)return 6403;if(e===RedIntegerFormat)return 36244;if(e===RGFormat)return 33319;if(e===RGIntegerFormat)return 33320;if(e===RGBIntegerFormat)return 36248;if(e===RGBAIntegerFormat)return 36249;if(e===RGB_S3TC_DXT1_Format||e===RGBA_S3TC_DXT1_Format||e===RGBA_S3TC_DXT3_Format||e===RGBA_S3TC_DXT5_Format){if(null===(n=t.get("WEBGL_compressed_texture_s3tc")))return null;if(e===RGB_S3TC_DXT1_Format)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===RGBA_S3TC_DXT1_Format)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===RGBA_S3TC_DXT3_Format)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===RGBA_S3TC_DXT5_Format)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e===RGB_PVRTC_4BPPV1_Format||e===RGB_PVRTC_2BPPV1_Format||e===RGBA_PVRTC_4BPPV1_Format||e===RGBA_PVRTC_2BPPV1_Format){if(null===(n=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(e===RGB_PVRTC_4BPPV1_Format)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===RGB_PVRTC_2BPPV1_Format)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===RGBA_PVRTC_4BPPV1_Format)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===RGBA_PVRTC_2BPPV1_Format)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}return e===RGB_ETC1_Format?null!==(n=t.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null:e===RGBA_ASTC_4x4_Format||e===RGBA_ASTC_5x4_Format||e===RGBA_ASTC_5x5_Format||e===RGBA_ASTC_6x5_Format||e===RGBA_ASTC_6x6_Format||e===RGBA_ASTC_8x5_Format||e===RGBA_ASTC_8x6_Format||e===RGBA_ASTC_8x8_Format||e===RGBA_ASTC_10x5_Format||e===RGBA_ASTC_10x6_Format||e===RGBA_ASTC_10x8_Format||e===RGBA_ASTC_10x10_Format||e===RGBA_ASTC_12x10_Format||e===RGBA_ASTC_12x12_Format?null!==(n=t.get("WEBGL_compressed_texture_astc"))?e:null:e===UnsignedInt248Type?r?34042:null!==(n=t.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function WebGLMultiviewRenderTarget(e,t,n,r){WebGLRenderTarget.call(this,e,t,r),this.depthBuffer=!1,this.stencilBuffer=!1,this.numViews=n}function WebGLMultiview(e,t){var n,r,i,a,o,s,l,c=2,u=e.extensions,h=e.properties,p=0;function d(e){return e.isArrayCamera?e.cameras:(o[0]=e,o)}this.isAvailable=function(){if(void 0===l){var e=u.get("OVR_multiview2");if(l=null!==e&&!1===t.getContextAttributes().antialias){p=t.getParameter(e.MAX_VIEWS_OVR),n=new WebGLMultiviewRenderTarget(0,0,c),s=new Vector2,a=[],i=[],o=[];for(var r=0;r<p;r++)a[r]=new Matrix4,i[r]=new Matrix3}}return l},this.attachCamera=function(t){!1!==function(e){if(void 0===e.isArrayCamera)return!0;var t=e.cameras;if(t.length>p)return!1;for(var n=1,r=t.length;n<r;n++)if(t[0].viewport.z!==t[n].viewport.z||t[0].viewport.w!==t[n].viewport.w)return!1;return!0}(t)&&(r=e.getRenderTarget(),function(t){if(r?s.set(r.width,r.height):e.getDrawingBufferSize(s),t.isArrayCamera){var i=t.cameras[0].viewport;n.setSize(i.z,i.w),n.setNumViews(t.cameras.length)}else n.setSize(s.x,s.y),n.setNumViews(c)}(t),e.setRenderTarget(n))},this.detachCamera=function(i){n===e.getRenderTarget()&&(e.setRenderTarget(r),function(e){var r=n,i=r.numViews,a=h.get(r).__webglViewFramebuffers,o=r.width,l=r.height;if(e.isArrayCamera)for(var c=0;c<i;c++){var u=e.cameras[c].viewport,p=u.x,d=u.y,f=p+u.z,m=d+u.w;t.bindFramebuffer(36008,a[c]),t.blitFramebuffer(0,0,o,l,p,d,f,m,16384,9728)}else t.bindFramebuffer(36008,a[0]),t.blitFramebuffer(0,0,o,l,0,0,s.x,s.y,16384,9728)}(i))},this.updateCameraProjectionMatricesUniform=function(e,n){for(var r=d(e),i=0;i<r.length;i++)a[i].copy(r[i].projectionMatrix);n.setValue(t,"projectionMatrices",a)},this.updateCameraViewMatricesUniform=function(e,n){for(var r=d(e),i=0;i<r.length;i++)a[i].copy(r[i].matrixWorldInverse);n.setValue(t,"viewMatrices",a)},this.updateObjectMatricesUniforms=function(e,n,r){for(var o=d(n),s=0;s<o.length;s++)a[s].multiplyMatrices(o[s].matrixWorldInverse,e.matrixWorld),i[s].getNormalMatrix(a[s]);r.setValue(t,"modelViewMatrices",a),r.setValue(t,"normalMatrices",i)}}function ArrayCamera(e){PerspectiveCamera.call(this),this.cameras=e||[]}function Group(){Object3D.call(this),this.type="Group"}function WebXRManager(e,t){var n=this,r=null,i=null,a="local-floor",o=null,s=[],l=new Map,c=new PerspectiveCamera;c.layers.enable(1),c.viewport=new Vector4;var u=new PerspectiveCamera;u.layers.enable(2),u.viewport=new Vector4;var h=new ArrayCamera([c,u]);h.layers.enable(1),h.layers.enable(2);var p=null,d=null;function f(e){var t=l.get(e.inputSource);t&&(t.targetRay&&t.targetRay.dispatchEvent({type:e.type}),t.grip&&t.grip.dispatchEvent({type:e.type}))}function m(){l.forEach(function(e,t){e.targetRay&&(e.targetRay.dispatchEvent({type:"disconnected",data:t}),e.targetRay.visible=!1),e.grip&&(e.grip.dispatchEvent({type:"disconnected",data:t}),e.grip.visible=!1)}),l.clear(),e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),w.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function g(e){i=e,w.setContext(r),w.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}function v(e){for(var t=r.inputSources,n=0;n<s.length;n++)l.set(t[n],s[n]);for(n=0;n<e.removed.length;n++){var i=e.removed[n];(a=l.get(i))&&(a.targetRay&&a.targetRay.dispatchEvent({type:"disconnected",data:i}),a.grip&&a.grip.dispatchEvent({type:"disconnected",data:i}),l.delete(i))}for(n=0;n<e.added.length;n++){var a;i=e.added[n];(a=l.get(i))&&(a.targetRay&&a.targetRay.dispatchEvent({type:"connected",data:i}),a.grip&&a.grip.dispatchEvent({type:"connected",data:i}))}}this.enabled=!1,this.isPresenting=!1,this.getController=function(e){var t=s[e];return void 0===t&&(t={},s[e]=t),void 0===t.targetRay&&(t.targetRay=new Group,t.targetRay.matrixAutoUpdate=!1,t.targetRay.visible=!1),t.targetRay},this.getControllerGrip=function(e){var t=s[e];return void 0===t&&(t={},s[e]=t),void 0===t.grip&&(t.grip=new Group,t.grip.matrixAutoUpdate=!1,t.grip.visible=!1),t.grip},this.setFramebufferScaleFactor=function(){},this.setReferenceSpaceType=function(e){a=e},this.getReferenceSpace=function(){return i},this.getSession=function(){return r},this.setSession=function(e){if(null!==(r=e)){r.addEventListener("select",f),r.addEventListener("selectstart",f),r.addEventListener("selectend",f),r.addEventListener("squeeze",f),r.addEventListener("squeezestart",f),r.addEventListener("squeezeend",f),r.addEventListener("end",m);var n=t.getContextAttributes(),i={antialias:n.antialias,alpha:n.alpha,depth:n.depth,stencil:n.stencil},o=new XRWebGLLayer(r,t,i);r.updateRenderState({baseLayer:o}),r.requestReferenceSpace(a).then(g),r.addEventListener("inputsourceschange",v)}};var y=new Vector3,x=new Vector3;function _(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.getInverse(e.matrixWorld)}this.getCamera=function(e){h.near=u.near=c.near=e.near,h.far=u.far=c.far=e.far,p===h.near&&d===h.far||(r.updateRenderState({depthNear:h.near,depthFar:h.far}),p=h.near,d=h.far);var t=e.parent,n=h.cameras;_(h,t);for(var i=0;i<n.length;i++)_(n[i],t);e.matrixWorld.copy(h.matrixWorld);for(var a=e.children,o=(i=0,a.length);i<o;i++)a[i].updateMatrixWorld(!0);return function(e,t,n){y.setFromMatrixPosition(t.matrixWorld),x.setFromMatrixPosition(n.matrixWorld);var r=y.distanceTo(x),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),l=(i[9]+1)/i[5],c=(i[9]-1)/i[5],u=(i[8]-1)/i[0],h=(a[8]+1)/a[0],p=o*u,d=o*h,f=r/(-u+h),m=f*-u;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.getInverse(e.matrixWorld);var g=o+f,v=s+f,_=p-m,b=d+(r-m),w=l*s/v*g,M=c*s/v*g;e.projectionMatrix.makePerspective(_,b,w,M,g,v)}(h,c,u),h};var b=null;var w=new WebGLAnimation;w.setAnimationLoop(function(t,n){if(null!==(o=n.getViewerPose(i))){var a=o.views,l=r.renderState.baseLayer;e.setFramebuffer(l.framebuffer);for(var c=0;c<a.length;c++){var u=a[c],p=l.getViewport(u),d=h.cameras[c];d.matrix.fromArray(u.transform.matrix),d.projectionMatrix.fromArray(u.projectionMatrix),d.viewport.set(p.x,p.y,p.width,p.height),0===c&&h.matrix.copy(d.matrix)}}var f=r.inputSources;for(c=0;c<s.length;c++){var m=s[c],g=f[c],v=null,y=null;g&&(m.targetRay&&null!==(v=n.getPose(g.targetRaySpace,i))&&(m.targetRay.matrix.fromArray(v.transform.matrix),m.targetRay.matrix.decompose(m.targetRay.position,m.targetRay.rotation,m.targetRay.scale)),m.grip&&g.gripSpace&&null!==(y=n.getPose(g.gripSpace,i))&&(m.grip.matrix.fromArray(y.transform.matrix),m.grip.matrix.decompose(m.grip.position,m.grip.rotation,m.grip.scale))),m.targetRay&&(m.targetRay.visible=null!==v),m.grip&&(m.grip.visible=null!==y)}b&&b(t,n)}),this.setAnimationLoop=function(e){b=e},this.dispose=function(){}}function WebGLRenderer(e){var t=void 0!==(e=e||{}).canvas?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==e.context?e.context:null,r=void 0!==e.alpha&&e.alpha,i=void 0===e.depth||e.depth,a=void 0===e.stencil||e.stencil,o=void 0!==e.antialias&&e.antialias,s=void 0===e.premultipliedAlpha||e.premultipliedAlpha,l=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,c=void 0!==e.powerPreference?e.powerPreference:"default",u=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat,h=null,p=null;this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=LinearEncoding,this.physicallyCorrectLights=!1,this.toneMapping=LinearToneMapping,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var d,f,m,g,v,y,x,_,b,w,M,S,T,E,C,A,L,D,P=this,O=!1,R=null,I=0,B=0,N=null,k=null,F=-1,G={geometry:null,program:null,wireframe:!1},V=null,z=null,U=new Vector4,j=new Vector4,H=null,W=t.width,q=t.height,J=1,X=null,Y=null,$=new Vector4(0,0,W,q),Z=new Vector4(0,0,W,q),K=!1,Q=new Frustum,ee=new WebGLClipping,te=!1,ne=!1,re=new Matrix4,ie=new Vector3;function ae(){return null===N?J:1}try{var oe={alpha:r,depth:i,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:u,xrCompatible:!0};if(t.addEventListener("webglcontextlost",he,!1),t.addEventListener("webglcontextrestored",pe,!1),null===(d=n||t.getContext("webgl",oe)||t.getContext("experimental-webgl",oe)))throw null!==t.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===d.getShaderPrecisionFormat&&(d.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function se(){f=new WebGLExtensions(d),!1===(m=new WebGLCapabilities(d,f,e)).isWebGL2&&(f.get("WEBGL_depth_texture"),f.get("OES_texture_float"),f.get("OES_texture_half_float"),f.get("OES_texture_half_float_linear"),f.get("OES_standard_derivatives"),f.get("OES_element_index_uint"),f.get("ANGLE_instanced_arrays")),f.get("OES_texture_float_linear"),D=new WebGLUtils(d,f,m),(g=new WebGLState(d,f,m)).scissor(j.copy(Z).multiplyScalar(J).floor()),g.viewport(U.copy($).multiplyScalar(J).floor()),v=new WebGLInfo(d),y=new WebGLProperties,x=new WebGLTextures(d,f,g,y,m,D,v),_=new WebGLAttributes(d,m),b=new WebGLGeometries(d,_,v),w=new WebGLObjects(d,b,_,v),C=new WebGLMorphtargets(d),M=new WebGLPrograms(P,f,m),S=new WebGLRenderLists,T=new WebGLRenderStates,E=new WebGLBackground(P,g,w,s),A=new WebGLBufferRenderer(d,f,v,m),L=new WebGLIndexedBufferRenderer(d,f,v,m),v.programs=M.programs,P.capabilities=m,P.extensions=f,P.properties=y,P.renderLists=S,P.state=g,P.info=v}se();var le=new WebXRManager(P,d);this.xr=le;var ce=new WebGLMultiview(P,d),ue=new WebGLShadowMap(P,w,m.maxTextureSize);function he(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),O=!0}function pe(){console.log("THREE.WebGLRenderer: Context Restored."),O=!1,se()}function de(e){var t=e.target;t.removeEventListener("dispose",de),function(e){fe(e),y.remove(e)}(t)}function fe(e){var t=y.get(e).program;e.program=void 0,void 0!==t&&M.releaseProgram(t)}this.shadowMap=ue,this.getContext=function(){return d},this.getContextAttributes=function(){return d.getContextAttributes()},this.forceContextLoss=function(){var e=f.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=f.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return J},this.setPixelRatio=function(e){void 0!==e&&(J=e,this.setSize(W,q,!1))},this.getSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),e=new Vector2),e.set(W,q)},this.setSize=function(e,n,r){le.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(W=e,q=n,t.width=Math.floor(e*J),t.height=Math.floor(n*J),!1!==r&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),e=new Vector2),e.set(W*J,q*J).floor()},this.setDrawingBufferSize=function(e,n,r){W=e,q=n,J=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),e=new Vector4),e.copy(U)},this.getViewport=function(e){return e.copy($)},this.setViewport=function(e,t,n,r){e.isVector4?$.set(e.x,e.y,e.z,e.w):$.set(e,t,n,r),g.viewport(U.copy($).multiplyScalar(J).floor())},this.getScissor=function(e){return e.copy(Z)},this.setScissor=function(e,t,n,r){e.isVector4?Z.set(e.x,e.y,e.z,e.w):Z.set(e,t,n,r),g.scissor(j.copy(Z).multiplyScalar(J).floor())},this.getScissorTest=function(){return K},this.setScissorTest=function(e){g.setScissorTest(K=e)},this.setOpaqueSort=function(e){X=e},this.setTransparentSort=function(e){Y=e},this.getClearColor=function(){return E.getClearColor()},this.setClearColor=function(){E.setClearColor.apply(E,arguments)},this.getClearAlpha=function(){return E.getClearAlpha()},this.setClearAlpha=function(){E.setClearAlpha.apply(E,arguments)},this.clear=function(e,t,n){var r=0;(void 0===e||e)&&(r|=16384),(void 0===t||t)&&(r|=256),(void 0===n||n)&&(r|=1024),d.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",he,!1),t.removeEventListener("webglcontextrestored",pe,!1),S.dispose(),T.dispose(),y.dispose(),w.dispose(),le.dispose(),ve.stop()},this.renderBufferImmediate=function(e,t){g.initAttributes();var n=y.get(e);e.hasPositions&&!n.position&&(n.position=d.createBuffer()),e.hasNormals&&!n.normal&&(n.normal=d.createBuffer()),e.hasUvs&&!n.uv&&(n.uv=d.createBuffer()),e.hasColors&&!n.color&&(n.color=d.createBuffer());var r=t.getAttributes();e.hasPositions&&(d.bindBuffer(34962,n.position),d.bufferData(34962,e.positionArray,35048),g.enableAttribute(r.position),d.vertexAttribPointer(r.position,3,5126,!1,0,0)),e.hasNormals&&(d.bindBuffer(34962,n.normal),d.bufferData(34962,e.normalArray,35048),g.enableAttribute(r.normal),d.vertexAttribPointer(r.normal,3,5126,!1,0,0)),e.hasUvs&&(d.bindBuffer(34962,n.uv),d.bufferData(34962,e.uvArray,35048),g.enableAttribute(r.uv),d.vertexAttribPointer(r.uv,2,5126,!1,0,0)),e.hasColors&&(d.bindBuffer(34962,n.color),d.bufferData(34962,e.colorArray,35048),g.enableAttribute(r.color),d.vertexAttribPointer(r.color,3,5126,!1,0,0)),g.disableUnusedAttributes(),d.drawArrays(4,0,e.count),e.count=0};var me=new Scene;this.renderBufferDirect=function(e,t,n,r,i,a){null===t&&(t=me);var o=i.isMesh&&i.matrixWorld.determinant()<0,s=be(e,t,r,i);g.setMaterial(r,o);var l=!1;G.geometry===n.id&&G.program===s.id&&G.wireframe===(!0===r.wireframe)||(G.geometry=n.id,G.program=s.id,G.wireframe=!0===r.wireframe,l=!0),(r.morphTargets||r.morphNormals)&&(C.update(i,n,r,s),l=!0);var c=n.index,u=n.attributes.position;if(null===c){if(void 0===u||0===u.count)return}else if(0===c.count)return;var h,p=1;!0===r.wireframe&&(c=b.getWireframeAttribute(n),p=2);var v=A;null!==c&&(h=_.get(c),(v=L).setIndex(h)),l&&(!function(e,t,n,r){if(!1===m.isWebGL2&&(e.isInstancedMesh||t.isInstancedBufferGeometry)&&null===f.get("ANGLE_instanced_arrays"))return;g.initAttributes();var i=t.attributes,a=r.getAttributes(),o=n.defaultAttributeValues;for(var s in a){var l=a[s];if(l>=0){var c=i[s];if(void 0!==c){var u=c.normalized,h=c.itemSize,p=_.get(c);if(void 0===p)continue;var v=p.buffer,y=p.type,x=p.bytesPerElement;if(c.isInterleavedBufferAttribute){var b=c.data,w=b.stride,M=c.offset;b&&b.isInstancedInterleavedBuffer?(g.enableAttributeAndDivisor(l,b.meshPerAttribute),void 0===t.maxInstancedCount&&(t.maxInstancedCount=b.meshPerAttribute*b.count)):g.enableAttribute(l),d.bindBuffer(34962,v),d.vertexAttribPointer(l,h,y,u,w*x,M*x)}else c.isInstancedBufferAttribute?(g.enableAttributeAndDivisor(l,c.meshPerAttribute),void 0===t.maxInstancedCount&&(t.maxInstancedCount=c.meshPerAttribute*c.count)):g.enableAttribute(l),d.bindBuffer(34962,v),d.vertexAttribPointer(l,h,y,u,0,0)}else if("instanceMatrix"===s){var p=_.get(e.instanceMatrix);if(void 0===p)continue;var v=p.buffer,y=p.type;g.enableAttributeAndDivisor(l+0,1),g.enableAttributeAndDivisor(l+1,1),g.enableAttributeAndDivisor(l+2,1),g.enableAttributeAndDivisor(l+3,1),d.bindBuffer(34962,v),d.vertexAttribPointer(l+0,4,y,!1,64,0),d.vertexAttribPointer(l+1,4,y,!1,64,16),d.vertexAttribPointer(l+2,4,y,!1,64,32),d.vertexAttribPointer(l+3,4,y,!1,64,48)}else if(void 0!==o){var S=o[s];if(void 0!==S)switch(S.length){case 2:d.vertexAttrib2fv(l,S);break;case 3:d.vertexAttrib3fv(l,S);break;case 4:d.vertexAttrib4fv(l,S);break;default:d.vertexAttrib1fv(l,S)}}}}g.disableUnusedAttributes()}(i,n,r,s),null!==c&&d.bindBuffer(34963,h.buffer));var y=null!==c?c.count:u.count,x=n.drawRange.start*p,w=n.drawRange.count*p,M=null!==a?a.start*p:0,S=null!==a?a.count*p:1/0,T=Math.max(x,M),E=Math.min(y,x+w,M+S)-1,D=Math.max(0,E-T+1);if(0!==D){if(i.isMesh)!0===r.wireframe?(g.setLineWidth(r.wireframeLinewidth*ae()),v.setMode(1)):v.setMode(4);else if(i.isLine){var P=r.linewidth;void 0===P&&(P=1),g.setLineWidth(P*ae()),i.isLineSegments?v.setMode(1):i.isLineLoop?v.setMode(2):v.setMode(3)}else i.isPoints?v.setMode(0):i.isSprite&&v.setMode(4);i.isInstancedMesh?v.renderInstances(n,T,D,i.count):n.isInstancedBufferGeometry?v.renderInstances(n,T,D,n.maxInstancedCount):v.render(T,D)}},this.compile=function(e,t){(p=T.get(e,t)).init(),e.traverse(function(e){e.isLight&&(p.pushLight(e),e.castShadow&&p.pushShadow(e))}),p.setupLights(t);var n={};e.traverse(function(t){if(t.material)if(Array.isArray(t.material))for(var r=0;r<t.material.length;r++)t.material[r].uuid in n==!1&&(_e(t.material[r],e,t),n[t.material[r].uuid]=!0);else t.material.uuid in n==!1&&(_e(t.material,e,t),n[t.material.uuid]=!0)})};var ge=null;var ve=new WebGLAnimation;function ye(e,t,n,r){for(var i=0,a=e.length;i<a;i++){var o=e[i],s=o.object,l=o.geometry,c=void 0===r?o.material:r,u=o.group;if(n.isArrayCamera)if(z=n,le.enabled&&ce.isAvailable())xe(s,t,n,l,c,u);else for(var h=n.cameras,d=0,f=h.length;d<f;d++){var m=h[d];s.layers.test(m.layers)&&(g.viewport(U.copy(m.viewport)),p.setupLights(m),xe(s,t,m,l,c,u))}else z=null,xe(s,t,n,l,c,u)}}function xe(e,t,n,r,i,a){if(e.onBeforeRender(P,t,n,r,i,a),p=T.get(t,z||n),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){var o=be(n,t,i,e);g.setMaterial(i),G.geometry=null,G.program=null,G.wireframe=!1,function(e,t){e.render(function(e){P.renderBufferImmediate(e,t)})}(e,o)}else P.renderBufferDirect(n,t,r,i,e,a);e.onAfterRender(P,t,n,r,i,a),p=T.get(t,z||n)}function _e(e,t,n){var r=y.get(e),i=p.state.lights,a=p.state.shadowsArray,o=i.state.version,s=M.getParameters(e,i.state,a,t,ee.numPlanes,ee.numIntersection,n),l=M.getProgramCacheKey(s),c=r.program,u=!0;if(void 0===c)e.addEventListener("dispose",de);else if(c.cacheKey!==l)fe(e);else if(r.lightsStateVersion!==o)r.lightsStateVersion=o,u=!1;else{if(void 0!==s.shaderID)return;u=!1}u&&(c=M.acquireProgram(s,l),r.program=c,r.uniforms=s.uniforms,r.environment=e.isMeshStandardMaterial?t.environment:null,r.outputEncoding=P.outputEncoding,e.program=c);var h=c.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var d=0;d<P.maxMorphTargets;d++)h["morphTarget"+d]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;for(d=0;d<P.maxMorphNormals;d++)h["morphNormal"+d]>=0&&e.numSupportedMorphNormals++}var f=r.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(r.numClippingPlanes=ee.numPlanes,r.numIntersection=ee.numIntersection,f.clippingPlanes=ee.uniform),r.fog=t.fog,r.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),r.lightsStateVersion=o,r.needsLights&&(f.ambientLightColor.value=i.state.ambient,f.lightProbe.value=i.state.probe,f.directionalLights.value=i.state.directional,f.spotLights.value=i.state.spot,f.rectAreaLights.value=i.state.rectArea,f.pointLights.value=i.state.point,f.hemisphereLights.value=i.state.hemi,f.directionalShadowMap.value=i.state.directionalShadowMap,f.directionalShadowMatrix.value=i.state.directionalShadowMatrix,f.spotShadowMap.value=i.state.spotShadowMap,f.spotShadowMatrix.value=i.state.spotShadowMatrix,f.pointShadowMap.value=i.state.pointShadowMap,f.pointShadowMatrix.value=i.state.pointShadowMatrix);var m=r.program.getUniforms(),g=WebGLUniforms.seqWithValue(m.seq,f);r.uniformsList=g}function be(e,t,n,r){x.resetTextureUnits();var i=t.fog,a=n.isMeshStandardMaterial?t.environment:null,o=y.get(n),s=p.state.lights;if(te&&(ne||e!==V)){var l=e===V&&n.id===F;ee.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,e,o,l)}n.version===o.__version?void 0===o.program?_e(n,t,r):n.fog&&o.fog!==i?_e(n,t,r):o.environment!==a?_e(n,t,r):o.needsLights&&o.lightsStateVersion!==s.state.version?_e(n,t,r):void 0===o.numClippingPlanes||o.numClippingPlanes===ee.numPlanes&&o.numIntersection===ee.numIntersection?o.outputEncoding!==P.outputEncoding&&_e(n,t,r):_e(n,t,r):(_e(n,t,r),o.__version=n.version);var c,u,h=!1,f=!1,v=!1,_=o.program,b=_.getUniforms(),w=o.uniforms;if(g.useProgram(_.program)&&(h=!0,f=!0,v=!0),n.id!==F&&(F=n.id,f=!0),h||V!==e){if(_.numMultiviewViews>0?ce.updateCameraProjectionMatricesUniform(e,b):b.setValue(d,"projectionMatrix",e.projectionMatrix),m.logarithmicDepthBuffer&&b.setValue(d,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),V!==e&&(V=e,f=!0,v=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){var M=b.map.cameraPosition;void 0!==M&&M.setValue(d,ie.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&b.setValue(d,"isOrthographic",!0===e.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&(_.numMultiviewViews>0?ce.updateCameraViewMatricesUniform(e,b):b.setValue(d,"viewMatrix",e.matrixWorldInverse))}if(n.skinning){b.setOptional(d,r,"bindMatrix"),b.setOptional(d,r,"bindMatrixInverse");var S=r.skeleton;if(S){var T=S.bones;if(m.floatVertexTextures){if(void 0===S.boneTexture){var E=Math.sqrt(4*T.length);E=MathUtils.ceilPowerOfTwo(E),E=Math.max(E,4);var C=new Float32Array(E*E*4);C.set(S.boneMatrices);var A=new DataTexture(C,E,E,RGBAFormat,FloatType);S.boneMatrices=C,S.boneTexture=A,S.boneTextureSize=E}b.setValue(d,"boneTexture",S.boneTexture,x),b.setValue(d,"boneTextureSize",S.boneTextureSize)}else b.setOptional(d,S,"boneMatrices")}}return(f||o.receiveShadow!==r.receiveShadow)&&(o.receiveShadow=r.receiveShadow,b.setValue(d,"receiveShadow",r.receiveShadow)),f&&(b.setValue(d,"toneMappingExposure",P.toneMappingExposure),b.setValue(d,"toneMappingWhitePoint",P.toneMappingWhitePoint),o.needsLights&&(u=v,(c=w).ambientLightColor.needsUpdate=u,c.lightProbe.needsUpdate=u,c.directionalLights.needsUpdate=u,c.pointLights.needsUpdate=u,c.spotLights.needsUpdate=u,c.rectAreaLights.needsUpdate=u,c.hemisphereLights.needsUpdate=u),i&&n.fog&&function(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)}(w,i),n.isMeshBasicMaterial?we(w,n):n.isMeshLambertMaterial?(we(w,n),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(w,n)):n.isMeshToonMaterial?(we(w,n),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.gradientMap&&(e.gradientMap.value=t.gradientMap);t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===BackSide&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===BackSide&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(w,n)):n.isMeshPhongMaterial?(we(w,n),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===BackSide&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===BackSide&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(w,n)):n.isMeshStandardMaterial?(we(w,n,a),n.isMeshPhysicalMaterial?function(e,t,n){Me(e,t,n),e.reflectivity.value=t.reflectivity,e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.sheen&&e.sheen.value.copy(t.sheen);t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,t.side===BackSide&&e.clearcoatNormalScale.value.negate());e.transparency.value=t.transparency}(w,n,a):Me(w,n,a)):n.isMeshMatcapMaterial?(we(w,n),function(e,t){t.matcap&&(e.matcap.value=t.matcap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===BackSide&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===BackSide&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(w,n)):n.isMeshDepthMaterial?(we(w,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(w,n)):n.isMeshDistanceMaterial?(we(w,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias);e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(w,n)):n.isMeshNormalMaterial?(we(w,n),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===BackSide&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===BackSide&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(w,n)):n.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(w,n),n.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(w,n)):n.isPointsMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*J,e.scale.value=.5*q,t.map&&(e.map.value=t.map);t.alphaMap&&(e.alphaMap.value=t.alphaMap);var n;t.map?n=t.map:t.alphaMap&&(n=t.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(w,n):n.isSpriteMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map);t.alphaMap&&(e.alphaMap.value=t.alphaMap);var n;t.map?n=t.map:t.alphaMap&&(n=t.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(w,n):n.isShadowMaterial&&(w.color.value.copy(n.color),w.opacity.value=n.opacity),void 0!==w.ltc_1&&(w.ltc_1.value=UniformsLib.LTC_1),void 0!==w.ltc_2&&(w.ltc_2.value=UniformsLib.LTC_2),WebGLUniforms.upload(d,o.uniformsList,w,x),n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(WebGLUniforms.upload(d,o.uniformsList,w,x),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&b.setValue(d,"center",r.center),_.numMultiviewViews>0?ce.updateObjectMatricesUniforms(r,e,b):(b.setValue(d,"modelViewMatrix",r.modelViewMatrix),b.setValue(d,"normalMatrix",r.normalMatrix)),b.setValue(d,"modelMatrix",r.matrixWorld),_}function we(e,t,n){e.opacity.value=t.opacity,t.color&&e.diffuse.value.copy(t.color),t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.specularMap&&(e.specularMap.value=t.specularMap);var r,i,a=t.envMap||n;a&&(e.envMap.value=a,e.flipEnvMap.value=a.isCubeTexture?-1:1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio,e.maxMipLevel.value=y.get(a).__maxMipLevel),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity),t.map?r=t.map:t.specularMap?r=t.specularMap:t.displacementMap?r=t.displacementMap:t.normalMap?r=t.normalMap:t.bumpMap?r=t.bumpMap:t.roughnessMap?r=t.roughnessMap:t.metalnessMap?r=t.metalnessMap:t.alphaMap?r=t.alphaMap:t.emissiveMap&&(r=t.emissiveMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix)),t.aoMap?i=t.aoMap:t.lightMap&&(i=t.lightMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uv2Transform.value.copy(i.matrix))}function Me(e,t,n){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===BackSide&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===BackSide&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),(t.envMap||n)&&(e.envMapIntensity.value=t.envMapIntensity)}ve.setAnimationLoop(function(e){le.isPresenting||ge&&ge(e)}),"undefined"!=typeof window&&ve.setContext(window),this.setAnimationLoop=function(e){ge=e,le.setAnimationLoop(e),ve.start()},this.render=function(e,t){var n,r;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),r=arguments[3]),t&&t.isCamera){if(!O){G.geometry=null,G.program=null,G.wireframe=!1,F=-1,V=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),le.enabled&&le.isPresenting&&(t=le.getCamera(t)),(p=T.get(e,t)).init(),e.onBeforeRender(P,e,t,n||N),re.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Q.setFromProjectionMatrix(re),ne=this.localClippingEnabled,te=ee.init(this.clippingPlanes,ne,t),(h=S.get(e,t)).init(),function e(t,n,r,i){if(!1===t.visible)return;var a=t.layers.test(n.layers);if(a)if(t.isGroup)r=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(n);else if(t.isLight)p.pushLight(t),t.castShadow&&p.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||Q.intersectsSprite(t)){i&&ie.setFromMatrixPosition(t.matrixWorld).applyMatrix4(re);var o=w.update(t),s=t.material;s.visible&&h.push(t,o,s,r,ie.z,null)}}else if(t.isImmediateRenderObject)i&&ie.setFromMatrixPosition(t.matrixWorld).applyMatrix4(re),h.push(t,null,t.material,r,ie.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.frame!==v.render.frame&&(t.skeleton.update(),t.skeleton.frame=v.render.frame),!t.frustumCulled||Q.intersectsObject(t))){i&&ie.setFromMatrixPosition(t.matrixWorld).applyMatrix4(re);var o=w.update(t),s=t.material;if(Array.isArray(s))for(var l=o.groups,c=0,u=l.length;c<u;c++){var d=l[c],f=s[d.materialIndex];f&&f.visible&&h.push(t,o,f,r,ie.z,d)}else s.visible&&h.push(t,o,s,r,ie.z,null)}var m=t.children;for(var c=0,u=m.length;c<u;c++)e(m[c],n,r,i)}(e,t,0,P.sortObjects),!0===P.sortObjects&&h.sort(X,Y),te&&ee.beginShadows();var i=p.state.shadowsArray;ue.render(i,e,t),p.setupLights(t),te&&ee.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),le.enabled&&ce.isAvailable()&&ce.attachCamera(t),E.render(h,e,t,r);var a=h.opaque,o=h.transparent;if(e.overrideMaterial){var s=e.overrideMaterial;a.length&&ye(a,e,t,s),o.length&&ye(o,e,t,s)}else a.length&&ye(a,e,t),o.length&&ye(o,e,t);e.onAfterRender(P,e,t),null!==N&&(x.updateRenderTargetMipmap(N),x.updateMultisampleRenderTarget(N)),g.buffers.depth.setTest(!0),g.buffers.depth.setMask(!0),g.buffers.color.setMask(!0),g.setPolygonOffset(!1),le.enabled&&ce.isAvailable()&&ce.detachCamera(t),h=null,p=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(e){R!==e&&null===N&&d.bindFramebuffer(36160,e),R=e},this.getActiveCubeFace=function(){return I},this.getActiveMipmapLevel=function(){return B},this.getRenderTarget=function(){return N},this.setRenderTarget=function(e,t,n){N=e,I=t,B=n,e&&void 0===y.get(e).__webglFramebuffer&&x.setupRenderTarget(e);var r=R,i=!1;if(e){var a=y.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=a[t||0],i=!0):r=e.isWebGLMultisampleRenderTarget?y.get(e).__webglMultisampledFramebuffer:a,U.copy(e.viewport),j.copy(e.scissor),H=e.scissorTest}else U.copy($).multiplyScalar(J).floor(),j.copy(Z).multiplyScalar(J).floor(),H=K;if(k!==r&&(d.bindFramebuffer(36160,r),k=r),g.viewport(U),g.scissor(j),g.setScissorTest(H),i){var o=y.get(e.texture);d.framebufferTexture2D(36160,36064,34069+(t||0),o.__webglTexture,n||0)}},this.readRenderTargetPixels=function(e,t,n,r,i,a,o){if(e&&e.isWebGLRenderTarget){var s=y.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){var l=!1;s!==k&&(d.bindFramebuffer(36160,s),l=!0);try{var c=e.texture,u=c.format,h=c.type;if(u!==RGBAFormat&&D.convert(u)!==d.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(h===UnsignedByteType||D.convert(h)===d.getParameter(35738)||h===FloatType&&(m.isWebGL2||f.get("OES_texture_float")||f.get("WEBGL_color_buffer_float"))||h===HalfFloatType&&(m.isWebGL2?f.get("EXT_color_buffer_float"):f.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===d.checkFramebufferStatus(36160)?t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&d.readPixels(t,n,r,i,D.convert(u),D.convert(h),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{l&&d.bindFramebuffer(36160,k)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,n){void 0===n&&(n=0);var r=Math.pow(2,-n),i=Math.floor(t.image.width*r),a=Math.floor(t.image.height*r),o=D.convert(t.format);x.setTexture2D(t,0),d.copyTexImage2D(3553,n,o,e.x,e.y,i,a,0),g.unbindTexture()},this.copyTextureToTexture=function(e,t,n,r){var i=t.image.width,a=t.image.height,o=D.convert(n.format),s=D.convert(n.type);x.setTexture2D(n,0),t.isDataTexture?d.texSubImage2D(3553,r||0,e.x,e.y,i,a,o,s,t.image.data):d.texSubImage2D(3553,r||0,e.x,e.y,o,s,t.image),g.unbindTexture()},this.initTexture=function(e){x.setTexture2D(e,0),g.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function FogExp2(e,t){this.name="",this.color=new Color(e),this.density=void 0!==t?t:25e-5}function Fog(e,t,n){this.name="",this.color=new Color(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}function InterleavedBuffer(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=StaticDrawUsage,this.updateRange={offset:0,count:-1},this.version=0}WebGLMultiviewRenderTarget.prototype=Object.assign(Object.create(WebGLRenderTarget.prototype),{constructor:WebGLMultiviewRenderTarget,isWebGLMultiviewRenderTarget:!0,copy:function(e){return WebGLRenderTarget.prototype.copy.call(this,e),this.numViews=e.numViews,this},setNumViews:function(e){return this.numViews!==e&&(this.numViews=e,this.dispose()),this}}),ArrayCamera.prototype=Object.assign(Object.create(PerspectiveCamera.prototype),{constructor:ArrayCamera,isArrayCamera:!0}),Group.prototype=Object.assign(Object.create(Object3D.prototype),{constructor:Group,isGroup:!0}),Object.assign(WebXRManager.prototype,EventDispatcher.prototype),Object.assign(FogExp2.prototype,{isFogExp2:!0,clone:function(){return new FogExp2(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(Fog.prototype,{isFog:!0,clone:function(){return new Fog(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(InterleavedBuffer.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(InterleavedBuffer.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(var r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(e){return this.onUploadCallback=e,this}});var _vector$6=new Vector3,_geometry;function InterleavedBufferAttribute(e,t,n,r){this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===r}function SpriteMaterial(e){Material.call(this),this.type="SpriteMaterial",this.color=new Color(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}Object.defineProperties(InterleavedBufferAttribute.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(InterleavedBufferAttribute.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(e){for(var t=0,n=this.data.count;t<n;t++)_vector$6.x=this.getX(t),_vector$6.y=this.getY(t),_vector$6.z=this.getZ(t),_vector$6.applyMatrix4(e),this.setXYZ(t,_vector$6.x,_vector$6.y,_vector$6.z);return this},setX:function(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this},setY:function(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this},setZ:function(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this},setW:function(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}}),SpriteMaterial.prototype=Object.create(Material.prototype),SpriteMaterial.prototype.constructor=SpriteMaterial,SpriteMaterial.prototype.isSpriteMaterial=!0,SpriteMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this};var _intersectPoint=new Vector3,_worldScale=new Vector3,_mvPosition=new Vector3,_alignedPosition=new Vector2,_rotatedPosition=new Vector2,_viewWorldMatrix=new Matrix4,_vA$1=new Vector3,_vB$1=new Vector3,_vC$1=new Vector3,_uvA$1=new Vector2,_uvB$1=new Vector2,_uvC$1=new Vector2;function Sprite(e){if(Object3D.call(this),this.type="Sprite",void 0===_geometry){_geometry=new BufferGeometry;var t=new InterleavedBuffer(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);_geometry.setIndex([0,1,2,0,2,3]),_geometry.setAttribute("position",new InterleavedBufferAttribute(t,3,0,!1)),_geometry.setAttribute("uv",new InterleavedBufferAttribute(t,2,3,!1))}this.geometry=_geometry,this.material=void 0!==e?e:new SpriteMaterial,this.center=new Vector2(.5,.5)}function transformVertex(e,t,n,r,i,a){_alignedPosition.subVectors(e,n).addScalar(.5).multiply(r),void 0!==i?(_rotatedPosition.x=a*_alignedPosition.x-i*_alignedPosition.y,_rotatedPosition.y=i*_alignedPosition.x+a*_alignedPosition.y):_rotatedPosition.copy(_alignedPosition),e.copy(t),e.x+=_rotatedPosition.x,e.y+=_rotatedPosition.y,e.applyMatrix4(_viewWorldMatrix)}Sprite.prototype=Object.assign(Object.create(Object3D.prototype),{constructor:Sprite,isSprite:!0,raycast:function(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),_worldScale.setFromMatrixScale(this.matrixWorld),_viewWorldMatrix.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),_mvPosition.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&_worldScale.multiplyScalar(-_mvPosition.z);var n,r,i=this.material.rotation;0!==i&&(r=Math.cos(i),n=Math.sin(i));var a=this.center;transformVertex(_vA$1.set(-.5,-.5,0),_mvPosition,a,_worldScale,n,r),transformVertex(_vB$1.set(.5,-.5,0),_mvPosition,a,_worldScale,n,r),transformVertex(_vC$1.set(.5,.5,0),_mvPosition,a,_worldScale,n,r),_uvA$1.set(0,0),_uvB$1.set(1,0),_uvC$1.set(1,1);var o=e.ray.intersectTriangle(_vA$1,_vB$1,_vC$1,!1,_intersectPoint);if(null!==o||(transformVertex(_vB$1.set(-.5,.5,0),_mvPosition,a,_worldScale,n,r),_uvB$1.set(0,1),null!==(o=e.ray.intersectTriangle(_vA$1,_vC$1,_vB$1,!1,_intersectPoint)))){var s=e.ray.origin.distanceTo(_intersectPoint);s<e.near||s>e.far||t.push({distance:s,point:_intersectPoint.clone(),uv:Triangle.getUV(_intersectPoint,_vA$1,_vB$1,_vC$1,_uvA$1,_uvB$1,_uvC$1,new Vector2),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return Object3D.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this}});var _v1$4=new Vector3,_v2$2=new Vector3;function LOD(){Object3D.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function SkinnedMesh(e,t){e&&e.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),Mesh.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Matrix4,this.bindMatrixInverse=new Matrix4}LOD.prototype=Object.assign(Object.create(Object3D.prototype),{constructor:LOD,isLOD:!0,copy:function(e){Object3D.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,r=t.length;n<r;n++){var i=t[n];this.addLevel(i.object.clone(),i.distance)}return this.autoUpdate=e.autoUpdate,this},addLevel:function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var n=this.levels,r=0;r<n.length&&!(t<n[r].distance);r++);return n.splice(r,0,{distance:t,object:e}),this.add(e),this},getObjectForDistance:function(e){var t=this.levels;if(t.length>0){for(var n=1,r=t.length;n<r&&!(e<t[n].distance);n++);return t[n-1].object}return null},raycast:function(e,t){if(this.levels.length>0){_v1$4.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(_v1$4);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){var t=this.levels;if(t.length>1){_v1$4.setFromMatrixPosition(e.matrixWorld),_v2$2.setFromMatrixPosition(this.matrixWorld);var n=_v1$4.distanceTo(_v2$2);t[0].object.visible=!0;for(var r=1,i=t.length;r<i&&n>=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(;r<i;r++)t[r].object.visible=!1}},toJSON:function(e){var t=Object3D.prototype.toJSON.call(this,e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];for(var n=this.levels,r=0,i=n.length;r<i;r++){var a=n[r];t.object.levels.push({object:a.object.uuid,distance:a.distance})}return t}}),SkinnedMesh.prototype=Object.assign(Object.create(Mesh.prototype),{constructor:SkinnedMesh,isSkinnedMesh:!0,bind:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var e=new Vector4,t=this.geometry.attributes.skinWeight,n=0,r=t.count;n<r;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(n);var i=1/e.manhattanLength();i!==1/0?e.multiplyScalar(i):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}},updateMatrixWorld:function(e){Mesh.prototype.updateMatrixWorld.call(this,e),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var _offsetMatrix=new Matrix4,_identityMatrix=new Matrix4;function Skeleton(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new Matrix4)}}function Bone(){Object3D.call(this),this.type="Bone"}Object.assign(Skeleton.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new Matrix4;this.bones[e]&&n.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(n)}},pose:function(){var e,t,n;for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&(e.parent&&e.parent.isBone?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},update:function(){for(var e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,i=0,a=e.length;i<a;i++){var o=e[i]?e[i].matrixWorld:_identityMatrix;_offsetMatrix.multiplyMatrices(o,t[i]),_offsetMatrix.toArray(n,16*i)}void 0!==r&&(r.needsUpdate=!0)},clone:function(){return new Skeleton(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,n=this.bones.length;t<n;t++){var r=this.bones[t];if(r.name===e)return r}}}),Bone.prototype=Object.assign(Object.create(Object3D.prototype),{constructor:Bone,isBone:!0});var _instanceLocalMatrix=new Matrix4,_instanceWorldMatrix=new Matrix4,_instanceIntersects=[],_mesh=new Mesh;function InstancedMesh(e,t,n){Mesh.call(this,e,t),this.instanceMatrix=new BufferAttribute(new Float32Array(16*n),16),this.count=n,this.frustumCulled=!1}function LineBasicMaterial(e){Material.call(this),this.type="LineBasicMaterial",this.color=new Color(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(e)}InstancedMesh.prototype=Object.assign(Object.create(Mesh.prototype),{constructor:InstancedMesh,isInstancedMesh:!0,getMatrixAt:function(e,t){t.fromArray(this.instanceMatrix.array,16*e)},raycast:function(e,t){var n=this.matrixWorld,r=this.count;if(_mesh.geometry=this.geometry,_mesh.material=this.material,void 0!==_mesh.material)for(var i=0;i<r;i++)this.getMatrixAt(i,_instanceLocalMatrix),_instanceWorldMatrix.multiplyMatrices(n,_instanceLocalMatrix),_mesh.matrixWorld=_instanceWorldMatrix,_mesh.raycast(e,_instanceIntersects),_instanceIntersects.length>0&&(_instanceIntersects[0].instanceId=i,_instanceIntersects[0].object=this,t.push(_instanceIntersects[0]),_instanceIntersects.length=0)},setMatrixAt:function(e,t){t.toArray(this.instanceMatrix.array,16*e)},updateMorphTargets:function(){}}),LineBasicMaterial.prototype=Object.create(Material.prototype),LineBasicMaterial.prototype.constructor=LineBasicMaterial,LineBasicMaterial.prototype.isLineBasicMaterial=!0,LineBasicMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this};var _start=new Vector3,_end=new Vector3,_inverseMatrix$1=new Matrix4,_ray$1=new Ray,_sphere$2=new Sphere;function Line(e,t,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),Object3D.call(this),this.type="Line",this.geometry=void 0!==e?e:new BufferGeometry,this.material=void 0!==t?t:new LineBasicMaterial}Line.prototype=Object.assign(Object.create(Object3D.prototype),{constructor:Line,isLine:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],r=1,i=t.count;r<i;r++)_start.fromBufferAttribute(t,r-1),_end.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=_start.distanceTo(_end);e.setAttribute("lineDistance",new Float32BufferAttribute(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices;(n=e.lineDistances)[0]=0;for(r=1,i=a.length;r<i;r++)n[r]=n[r-1],n[r]+=a[r-1].distanceTo(a[r])}return this},raycast:function(e,t){var n=e.linePrecision,r=this.geometry,i=this.matrixWorld;if(null===r.boundingSphere&&r.computeBoundingSphere(),_sphere$2.copy(r.boundingSphere),_sphere$2.applyMatrix4(i),_sphere$2.radius+=n,!1!==e.ray.intersectsSphere(_sphere$2)){_inverseMatrix$1.getInverse(i),_ray$1.copy(e.ray).applyMatrix4(_inverseMatrix$1);var a=n/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,s=new Vector3,l=new Vector3,c=new Vector3,u=new Vector3,h=this&&this.isLineSegments?2:1;if(r.isBufferGeometry){var p=r.index,d=r.attributes.position.array;if(null!==p)for(var f=p.array,m=0,g=f.length-1;m<g;m+=h){var v=f[m],y=f[m+1];if(s.fromArray(d,3*v),l.fromArray(d,3*y),!(_ray$1.distanceSqToSegment(s,l,u,c)>o))u.applyMatrix4(this.matrixWorld),(b=e.ray.origin.distanceTo(u))<e.near||b>e.far||t.push({distance:b,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}else for(m=0,g=d.length/3-1;m<g;m+=h){if(s.fromArray(d,3*m),l.fromArray(d,3*m+3),!(_ray$1.distanceSqToSegment(s,l,u,c)>o))u.applyMatrix4(this.matrixWorld),(b=e.ray.origin.distanceTo(u))<e.near||b>e.far||t.push({distance:b,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}else if(r.isGeometry){var x=r.vertices,_=x.length;for(m=0;m<_-1;m+=h){var b;if(!(_ray$1.distanceSqToSegment(x[m],x[m+1],u,c)>o))u.applyMatrix4(this.matrixWorld),(b=e.ray.origin.distanceTo(u))<e.near||b>e.far||t.push({distance:b,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var _start$1=new Vector3,_end$1=new Vector3;function LineSegments(e,t){Line.call(this,e,t),this.type="LineSegments"}function LineLoop(e,t){Line.call(this,e,t),this.type="LineLoop"}function PointsMaterial(e){Material.call(this),this.type="PointsMaterial",this.color=new Color(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}LineSegments.prototype=Object.assign(Object.create(Line.prototype),{constructor:LineSegments,isLineSegments:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[],r=0,i=t.count;r<i;r+=2)_start$1.fromBufferAttribute(t,r),_end$1.fromBufferAttribute(t,r+1),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+_start$1.distanceTo(_end$1);e.setAttribute("lineDistance",new Float32BufferAttribute(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices;for(n=e.lineDistances,r=0,i=a.length;r<i;r+=2)_start$1.copy(a[r]),_end$1.copy(a[r+1]),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+_start$1.distanceTo(_end$1)}return this}}),LineLoop.prototype=Object.assign(Object.create(Line.prototype),{constructor:LineLoop,isLineLoop:!0}),PointsMaterial.prototype=Object.create(Material.prototype),PointsMaterial.prototype.constructor=PointsMaterial,PointsMaterial.prototype.isPointsMaterial=!0,PointsMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this};var _inverseMatrix$2=new Matrix4,_ray$2=new Ray,_sphere$3=new Sphere,_position$1=new Vector3;function Points(e,t){Object3D.call(this),this.type="Points",this.geometry=void 0!==e?e:new BufferGeometry,this.material=void 0!==t?t:new PointsMaterial,this.updateMorphTargets()}function testPoint(e,t,n,r,i,a,o){var s=_ray$2.distanceSqToPoint(e);if(s<n){var l=new Vector3;_ray$2.closestPointToPoint(e,l),l.applyMatrix4(r);var c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;a.push({distance:c,distanceToRay:Math.sqrt(s),point:l,index:t,face:null,object:o})}}function VideoTexture(e,t,n,r,i,a,o,s,l){Texture.call(this,e,t,n,r,i,a,o,s,l),this.format=void 0!==o?o:RGBFormat,this.minFilter=void 0!==a?a:LinearFilter,this.magFilter=void 0!==i?i:LinearFilter,this.generateMipmaps=!1}function CompressedTexture(e,t,n,r,i,a,o,s,l,c,u,h){Texture.call(this,null,a,o,s,l,c,r,i,u,h),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function CanvasTexture(e,t,n,r,i,a,o,s,l){Texture.call(this,e,t,n,r,i,a,o,s,l),this.needsUpdate=!0}function DepthTexture(e,t,n,r,i,a,o,s,l,c){if((c=void 0!==c?c:DepthFormat)!==DepthFormat&&c!==DepthStencilFormat)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===DepthFormat&&(n=UnsignedShortType),void 0===n&&c===DepthStencilFormat&&(n=UnsignedInt248Type),Texture.call(this,null,r,i,a,o,s,c,n,l),this.image={width:e,height:t},this.magFilter=void 0!==o?o:NearestFilter,this.minFilter=void 0!==s?s:NearestFilter,this.flipY=!1,this.generateMipmaps=!1}function WireframeGeometry(e){BufferGeometry.call(this),this.type="WireframeGeometry";var t,n,r,i,a,o,s,l,c,u,h=[],p=[0,0],d={},f=["a","b","c"];if(e&&e.isGeometry){var m=e.faces;for(t=0,r=m.length;t<r;t++){var g=m[t];for(n=0;n<3;n++)s=g[f[n]],l=g[f[(n+1)%3]],p[0]=Math.min(s,l),p[1]=Math.max(s,l),void 0===d[c=p[0]+","+p[1]]&&(d[c]={index1:p[0],index2:p[1]})}for(c in d)o=d[c],u=e.vertices[o.index1],h.push(u.x,u.y,u.z),u=e.vertices[o.index2],h.push(u.x,u.y,u.z)}else if(e&&e.isBufferGeometry){var v,y,x,_,b,w,M;if(u=new Vector3,null!==e.index){for(v=e.attributes.position,y=e.index,0===(x=e.groups).length&&(x=[{start:0,count:y.count,materialIndex:0}]),i=0,a=x.length;i<a;++i)for(t=b=(_=x[i]).start,r=b+_.count;t<r;t+=3)for(n=0;n<3;n++)s=y.getX(t+n),l=y.getX(t+(n+1)%3),p[0]=Math.min(s,l),p[1]=Math.max(s,l),void 0===d[c=p[0]+","+p[1]]&&(d[c]={index1:p[0],index2:p[1]});for(c in d)o=d[c],u.fromBufferAttribute(v,o.index1),h.push(u.x,u.y,u.z),u.fromBufferAttribute(v,o.index2),h.push(u.x,u.y,u.z)}else for(t=0,r=(v=e.attributes.position).count/3;t<r;t++)for(n=0;n<3;n++)w=3*t+n,u.fromBufferAttribute(v,w),h.push(u.x,u.y,u.z),M=3*t+(n+1)%3,u.fromBufferAttribute(v,M),h.push(u.x,u.y,u.z)}this.setAttribute("position",new Float32BufferAttribute(h,3))}function ParametricGeometry(e,t,n){Geometry.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new ParametricBufferGeometry(e,t,n)),this.mergeVertices()}function ParametricBufferGeometry(e,t,n){BufferGeometry.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};var r,i,a=[],o=[],s=[],l=[],c=new Vector3,u=new Vector3,h=new Vector3,p=new Vector3,d=new Vector3;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var f=t+1;for(r=0;r<=n;r++){var m=r/n;for(i=0;i<=t;i++){var g=i/t;e(g,m,u),o.push(u.x,u.y,u.z),g-1e-5>=0?(e(g-1e-5,m,h),p.subVectors(u,h)):(e(g+1e-5,m,h),p.subVectors(h,u)),m-1e-5>=0?(e(g,m-1e-5,h),d.subVectors(u,h)):(e(g,m+1e-5,h),d.subVectors(h,u)),c.crossVectors(p,d).normalize(),s.push(c.x,c.y,c.z),l.push(g,m)}}for(r=0;r<n;r++)for(i=0;i<t;i++){var v=r*f+i,y=r*f+i+1,x=(r+1)*f+i+1,_=(r+1)*f+i;a.push(v,y,_),a.push(y,x,_)}this.setIndex(a),this.setAttribute("position",new Float32BufferAttribute(o,3)),this.setAttribute("normal",new Float32BufferAttribute(s,3)),this.setAttribute("uv",new Float32BufferAttribute(l,2))}function PolyhedronGeometry(e,t,n,r){Geometry.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},this.fromBufferGeometry(new PolyhedronBufferGeometry(e,t,n,r)),this.mergeVertices()}function PolyhedronBufferGeometry(e,t,n,r){BufferGeometry.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},n=n||1;var i=[],a=[];function o(e,t,n,r){var i,a,o=Math.pow(2,r),l=[];for(i=0;i<=o;i++){l[i]=[];var c=e.clone().lerp(n,i/o),u=t.clone().lerp(n,i/o),h=o-i;for(a=0;a<=h;a++)l[i][a]=0===a&&i===o?c:c.clone().lerp(u,a/h)}for(i=0;i<o;i++)for(a=0;a<2*(o-i)-1;a++){var p=Math.floor(a/2);a%2==0?(s(l[i][p+1]),s(l[i+1][p]),s(l[i][p])):(s(l[i][p+1]),s(l[i+1][p+1]),s(l[i+1][p]))}}function s(e){i.push(e.x,e.y,e.z)}function l(t,n){var r=3*t;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function c(e,t,n,r){r<0&&1===e.x&&(a[t]=e.x-1),0===n.x&&0===n.z&&(a[t]=r/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}!function(e){for(var n=new Vector3,r=new Vector3,i=new Vector3,a=0;a<t.length;a+=3)l(t[a+0],n),l(t[a+1],r),l(t[a+2],i),o(n,r,i,e)}(r=r||0),function(e){for(var t=new Vector3,n=0;n<i.length;n+=3)t.x=i[n+0],t.y=i[n+1],t.z=i[n+2],t.normalize().multiplyScalar(e),i[n+0]=t.x,i[n+1]=t.y,i[n+2]=t.z}(n),function(){for(var e=new Vector3,t=0;t<i.length;t+=3){e.x=i[t+0],e.y=i[t+1],e.z=i[t+2];var n=u(e)/2/Math.PI+.5,r=(o=e,Math.atan2(-o.y,Math.sqrt(o.x*o.x+o.z*o.z))/Math.PI+.5);a.push(n,1-r)}var o;(function(){for(var e=new Vector3,t=new Vector3,n=new Vector3,r=new Vector3,o=new Vector2,s=new Vector2,l=new Vector2,h=0,p=0;h<i.length;h+=9,p+=6){e.set(i[h+0],i[h+1],i[h+2]),t.set(i[h+3],i[h+4],i[h+5]),n.set(i[h+6],i[h+7],i[h+8]),o.set(a[p+0],a[p+1]),s.set(a[p+2],a[p+3]),l.set(a[p+4],a[p+5]),r.copy(e).add(t).add(n).divideScalar(3);var d=u(r);c(o,p+0,e,d),c(s,p+2,t,d),c(l,p+4,n,d)}})(),function(){for(var e=0;e<a.length;e+=6){var t=a[e+0],n=a[e+2],r=a[e+4],i=Math.max(t,n,r),o=Math.min(t,n,r);i>.9&&o<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),r<.2&&(a[e+4]+=1))}}()}(),this.setAttribute("position",new Float32BufferAttribute(i,3)),this.setAttribute("normal",new Float32BufferAttribute(i.slice(),3)),this.setAttribute("uv",new Float32BufferAttribute(a,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}function TetrahedronGeometry(e,t){Geometry.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new TetrahedronBufferGeometry(e,t)),this.mergeVertices()}function TetrahedronBufferGeometry(e,t){PolyhedronBufferGeometry.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function OctahedronGeometry(e,t){Geometry.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new OctahedronBufferGeometry(e,t)),this.mergeVertices()}function OctahedronBufferGeometry(e,t){PolyhedronBufferGeometry.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function IcosahedronGeometry(e,t){Geometry.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new IcosahedronBufferGeometry(e,t)),this.mergeVertices()}function IcosahedronBufferGeometry(e,t){var n=(1+Math.sqrt(5))/2,r=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];PolyhedronBufferGeometry.call(this,r,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function DodecahedronGeometry(e,t){Geometry.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new DodecahedronBufferGeometry(e,t)),this.mergeVertices()}function DodecahedronBufferGeometry(e,t){var n=(1+Math.sqrt(5))/2,r=1/n,i=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r];PolyhedronBufferGeometry.call(this,i,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function TubeGeometry(e,t,n,r,i,a){Geometry.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new TubeBufferGeometry(e,t,n,r,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function TubeBufferGeometry(e,t,n,r,i){BufferGeometry.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},t=t||64,n=n||1,r=r||8,i=i||!1;var a=e.computeFrenetFrames(t,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;var o,s,l=new Vector3,c=new Vector3,u=new Vector2,h=new Vector3,p=[],d=[],f=[],m=[];function g(i){h=e.getPointAt(i/t,h);var o=a.normals[i],u=a.binormals[i];for(s=0;s<=r;s++){var f=s/r*Math.PI*2,m=Math.sin(f),g=-Math.cos(f);c.x=g*o.x+m*u.x,c.y=g*o.y+m*u.y,c.z=g*o.z+m*u.z,c.normalize(),d.push(c.x,c.y,c.z),l.x=h.x+n*c.x,l.y=h.y+n*c.y,l.z=h.z+n*c.z,p.push(l.x,l.y,l.z)}}!function(){for(o=0;o<t;o++)g(o);g(!1===i?t:0),function(){for(o=0;o<=t;o++)for(s=0;s<=r;s++)u.x=o/t,u.y=s/r,f.push(u.x,u.y)}(),function(){for(s=1;s<=t;s++)for(o=1;o<=r;o++){var e=(r+1)*(s-1)+(o-1),n=(r+1)*s+(o-1),i=(r+1)*s+o,a=(r+1)*(s-1)+o;m.push(e,n,a),m.push(n,i,a)}}()}(),this.setIndex(m),this.setAttribute("position",new Float32BufferAttribute(p,3)),this.setAttribute("normal",new Float32BufferAttribute(d,3)),this.setAttribute("uv",new Float32BufferAttribute(f,2))}function TorusKnotGeometry(e,t,n,r,i,a,o){Geometry.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new TorusKnotBufferGeometry(e,t,n,r,i,a)),this.mergeVertices()}function TorusKnotBufferGeometry(e,t,n,r,i,a){BufferGeometry.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},e=e||1,t=t||.4,n=Math.floor(n)||64,r=Math.floor(r)||8,i=i||2,a=a||3;var o,s,l=[],c=[],u=[],h=[],p=new Vector3,d=new Vector3,f=new Vector3,m=new Vector3,g=new Vector3,v=new Vector3,y=new Vector3;for(o=0;o<=n;++o){var x=o/n*i*Math.PI*2;for(C(x,i,a,e,f),C(x+.01,i,a,e,m),v.subVectors(m,f),y.addVectors(m,f),g.crossVectors(v,y),y.crossVectors(g,v),g.normalize(),y.normalize(),s=0;s<=r;++s){var _=s/r*Math.PI*2,b=-t*Math.cos(_),w=t*Math.sin(_);p.x=f.x+(b*y.x+w*g.x),p.y=f.y+(b*y.y+w*g.y),p.z=f.z+(b*y.z+w*g.z),c.push(p.x,p.y,p.z),d.subVectors(p,f).normalize(),u.push(d.x,d.y,d.z),h.push(o/n),h.push(s/r)}}for(s=1;s<=n;s++)for(o=1;o<=r;o++){var M=(r+1)*(s-1)+(o-1),S=(r+1)*s+(o-1),T=(r+1)*s+o,E=(r+1)*(s-1)+o;l.push(M,S,E),l.push(S,T,E)}function C(e,t,n,r,i){var a=Math.cos(e),o=Math.sin(e),s=n/t*e,l=Math.cos(s);i.x=r*(2+l)*.5*a,i.y=r*(2+l)*o*.5,i.z=r*Math.sin(s)*.5}this.setIndex(l),this.setAttribute("position",new Float32BufferAttribute(c,3)),this.setAttribute("normal",new Float32BufferAttribute(u,3)),this.setAttribute("uv",new Float32BufferAttribute(h,2))}function TorusGeometry(e,t,n,r,i){Geometry.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},this.fromBufferGeometry(new TorusBufferGeometry(e,t,n,r,i)),this.mergeVertices()}function TorusBufferGeometry(e,t,n,r,i){BufferGeometry.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},e=e||1,t=t||.4,n=Math.floor(n)||8,r=Math.floor(r)||6,i=i||2*Math.PI;var a,o,s=[],l=[],c=[],u=[],h=new Vector3,p=new Vector3,d=new Vector3;for(a=0;a<=n;a++)for(o=0;o<=r;o++){var f=o/r*i,m=a/n*Math.PI*2;p.x=(e+t*Math.cos(m))*Math.cos(f),p.y=(e+t*Math.cos(m))*Math.sin(f),p.z=t*Math.sin(m),l.push(p.x,p.y,p.z),h.x=e*Math.cos(f),h.y=e*Math.sin(f),d.subVectors(p,h).normalize(),c.push(d.x,d.y,d.z),u.push(o/r),u.push(a/n)}for(a=1;a<=n;a++)for(o=1;o<=r;o++){var g=(r+1)*a+o-1,v=(r+1)*(a-1)+o-1,y=(r+1)*(a-1)+o,x=(r+1)*a+o;s.push(g,v,x),s.push(v,y,x)}this.setIndex(s),this.setAttribute("position",new Float32BufferAttribute(l,3)),this.setAttribute("normal",new Float32BufferAttribute(c,3)),this.setAttribute("uv",new Float32BufferAttribute(u,2))}Points.prototype=Object.assign(Object.create(Object3D.prototype),{constructor:Points,isPoints:!0,raycast:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),_sphere$3.copy(n.boundingSphere),_sphere$3.applyMatrix4(r),_sphere$3.radius+=i,!1!==e.ray.intersectsSphere(_sphere$3)){_inverseMatrix$2.getInverse(r),_ray$2.copy(e.ray).applyMatrix4(_inverseMatrix$2);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a;if(n.isBufferGeometry){var s=n.index,l=n.attributes.position.array;if(null!==s)for(var c=s.array,u=0,h=c.length;u<h;u++){var p=c[u];_position$1.fromArray(l,3*p),testPoint(_position$1,p,o,r,e,t,this)}else{u=0;for(var d=l.length/3;u<d;u++)_position$1.fromArray(l,3*u),testPoint(_position$1,u,o,r,e,t,this)}}else{var f=n.vertices;for(u=0,d=f.length;u<d;u++)testPoint(f[u],u,o,r,e,t,this)}}},updateMorphTargets:function(){var e,t,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,a=Object.keys(i);if(a.length>0){var o=i[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=r.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),VideoTexture.prototype=Object.assign(Object.create(Texture.prototype),{constructor:VideoTexture,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),CompressedTexture.prototype=Object.create(Texture.prototype),CompressedTexture.prototype.constructor=CompressedTexture,CompressedTexture.prototype.isCompressedTexture=!0,CanvasTexture.prototype=Object.create(Texture.prototype),CanvasTexture.prototype.constructor=CanvasTexture,CanvasTexture.prototype.isCanvasTexture=!0,DepthTexture.prototype=Object.create(Texture.prototype),DepthTexture.prototype.constructor=DepthTexture,DepthTexture.prototype.isDepthTexture=!0,WireframeGeometry.prototype=Object.create(BufferGeometry.prototype),WireframeGeometry.prototype.constructor=WireframeGeometry,ParametricGeometry.prototype=Object.create(Geometry.prototype),ParametricGeometry.prototype.constructor=ParametricGeometry,ParametricBufferGeometry.prototype=Object.create(BufferGeometry.prototype),ParametricBufferGeometry.prototype.constructor=ParametricBufferGeometry,PolyhedronGeometry.prototype=Object.create(Geometry.prototype),PolyhedronGeometry.prototype.constructor=PolyhedronGeometry,PolyhedronBufferGeometry.prototype=Object.create(BufferGeometry.prototype),PolyhedronBufferGeometry.prototype.constructor=PolyhedronBufferGeometry,TetrahedronGeometry.prototype=Object.create(Geometry.prototype),TetrahedronGeometry.prototype.constructor=TetrahedronGeometry,TetrahedronBufferGeometry.prototype=Object.create(PolyhedronBufferGeometry.prototype),TetrahedronBufferGeometry.prototype.constructor=TetrahedronBufferGeometry,OctahedronGeometry.prototype=Object.create(Geometry.prototype),OctahedronGeometry.prototype.constructor=OctahedronGeometry,OctahedronBufferGeometry.prototype=Object.create(PolyhedronBufferGeometry.prototype),OctahedronBufferGeometry.prototype.constructor=OctahedronBufferGeometry,IcosahedronGeometry.prototype=Object.create(Geometry.prototype),IcosahedronGeometry.prototype.constructor=IcosahedronGeometry,IcosahedronBufferGeometry.prototype=Object.create(PolyhedronBufferGeometry.prototype),IcosahedronBufferGeometry.prototype.constructor=IcosahedronBufferGeometry,DodecahedronGeometry.prototype=Object.create(Geometry.prototype),DodecahedronGeometry.prototype.constructor=DodecahedronGeometry,DodecahedronBufferGeometry.prototype=Object.create(PolyhedronBufferGeometry.prototype),DodecahedronBufferGeometry.prototype.constructor=DodecahedronBufferGeometry,TubeGeometry.prototype=Object.create(Geometry.prototype),TubeGeometry.prototype.constructor=TubeGeometry,TubeBufferGeometry.prototype=Object.create(BufferGeometry.prototype),TubeBufferGeometry.prototype.constructor=TubeBufferGeometry,TubeBufferGeometry.prototype.toJSON=function(){var e=BufferGeometry.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e},TorusKnotGeometry.prototype=Object.create(Geometry.prototype),TorusKnotGeometry.prototype.constructor=TorusKnotGeometry,TorusKnotBufferGeometry.prototype=Object.create(BufferGeometry.prototype),TorusKnotBufferGeometry.prototype.constructor=TorusKnotBufferGeometry,TorusGeometry.prototype=Object.create(Geometry.prototype),TorusGeometry.prototype.constructor=TorusGeometry,TorusBufferGeometry.prototype=Object.create(BufferGeometry.prototype),TorusBufferGeometry.prototype.constructor=TorusBufferGeometry;var Earcut={triangulate:function(e,t,n){n=n||2;var r,i,a,o,s,l,c,u=t&&t.length,h=u?t[0]*n:e.length,p=linkedList(e,0,h,n,!0),d=[];if(!p||p.next===p.prev)return d;if(u&&(p=eliminateHoles(e,t,p,n)),e.length>80*n){r=a=e[0],i=o=e[1];for(var f=n;f<h;f+=n)s=e[f],l=e[f+1],s<r&&(r=s),l<i&&(i=l),s>a&&(a=s),l>o&&(o=l);c=0!==(c=Math.max(a-r,o-i))?1/c:0}return earcutLinked(p,d,n,r,i,c),d}};function linkedList(e,t,n,r,i){var a,o;if(i===signedArea(e,t,n,r)>0)for(a=t;a<n;a+=r)o=insertNode(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=insertNode(a,e[a],e[a+1],o);return o&&equals(o,o.next)&&(removeNode(o),o=o.next),o}function filterPoints(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!equals(r,r.next)&&0!==area(r.prev,r,r.next))r=r.next;else{if(removeNode(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function earcutLinked(e,t,n,r,i,a,o){if(e){!o&&a&&indexCurve(e,r,i,a);for(var s,l,c=e;e.prev!==e.next;)if(s=e.prev,l=e.next,a?isEarHashed(e,r,i,a):isEar(e))t.push(s.i/n),t.push(e.i/n),t.push(l.i/n),removeNode(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?earcutLinked(e=cureLocalIntersections(e,t,n),t,n,r,i,a,2):2===o&&splitEarcut(e,t,n,r,i,a):earcutLinked(filterPoints(e),t,n,r,i,a,1);break}}}function isEar(e){var t=e.prev,n=e,r=e.next;if(area(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(pointInTriangle(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&area(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function isEarHashed(e,t,n,r){var i=e.prev,a=e,o=e.next;if(area(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,l=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=zOrder(s,l,t,n,r),p=zOrder(c,u,t,n,r),d=e.prevZ,f=e.nextZ;d&&d.z>=h&&f&&f.z<=p;){if(d!==e.prev&&d!==e.next&&pointInTriangle(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&area(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,f!==e.prev&&f!==e.next&&pointInTriangle(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&area(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;d&&d.z>=h;){if(d!==e.prev&&d!==e.next&&pointInTriangle(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&area(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;f&&f.z<=p;){if(f!==e.prev&&f!==e.next&&pointInTriangle(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&area(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function cureLocalIntersections(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!equals(i,a)&&intersects(i,r,r.next,a)&&locallyInside(i,a)&&locallyInside(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),removeNode(r),removeNode(r.next),r=e=a),r=r.next}while(r!==e);return r}function splitEarcut(e,t,n,r,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&isValidDiagonal(o,s)){var l=splitPolygon(o,s);return o=filterPoints(o,o.next),l=filterPoints(l,l.next),earcutLinked(o,t,n,r,i,a),void earcutLinked(l,t,n,r,i,a)}s=s.next}o=o.next}while(o!==e)}function eliminateHoles(e,t,n,r){var i,a,o,s=[];for(i=0,a=t.length;i<a;i++)(o=linkedList(e,t[i]*r,i<a-1?t[i+1]*r:e.length,r,!1))===o.next&&(o.steiner=!0),s.push(getLeftmost(o));for(s.sort(compareX),i=0;i<s.length;i++)eliminateHole(s[i],n),n=filterPoints(n,n.next);return n}function compareX(e,t){return e.x-t.x}function eliminateHole(e,t){if(t=findHoleBridge(e,t)){var n=splitPolygon(t,e);filterPoints(n,n.next)}}function findHoleBridge(e,t){var n,r=t,i=e.x,a=e.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>o){if(o=s,s===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===o)return n.prev;var l,c=n,u=n.x,h=n.y,p=1/0;for(r=n.next;r!==c;)i>=r.x&&r.x>=u&&i!==r.x&&pointInTriangle(a<h?i:o,a,u,h,a<h?o:i,a,r.x,r.y)&&((l=Math.abs(a-r.y)/(i-r.x))<p||l===p&&r.x>n.x)&&locallyInside(r,e)&&(n=r,p=l),r=r.next;return n}function indexCurve(e,t,n,r){var i=e;do{null===i.z&&(i.z=zOrder(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,sortLinked(i)}function sortLinked(e){var t,n,r,i,a,o,s,l,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t<c&&(s++,r=r.nextZ);t++);for(l=c;s>0||l>0&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,c*=2}while(o>1);return e}function zOrder(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function getLeftmost(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function pointInTriangle(e,t,n,r,i,a,o,s){return(i-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(r-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}function isValidDiagonal(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!intersectsPolygon(e,t)&&locallyInside(e,t)&&locallyInside(t,e)&&middleInside(e,t)}function area(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function equals(e,t){return e.x===t.x&&e.y===t.y}function intersects(e,t,n,r){return!!(equals(e,n)&&equals(t,r)||equals(e,r)&&equals(n,t))||area(e,t,n)>0!=area(e,t,r)>0&&area(n,r,e)>0!=area(n,r,t)>0}function intersectsPolygon(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&intersects(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function locallyInside(e,t){return area(e.prev,e,e.next)<0?area(e,t,e.next)>=0&&area(e,e.prev,t)>=0:area(e,t,e.prev)<0||area(e,e.next,t)<0}function middleInside(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}function splitPolygon(e,t){var n=new Node(e.i,e.x,e.y),r=new Node(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function insertNode(e,t,n,r){var i=new Node(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function removeNode(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Node(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function signedArea(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}var ShapeUtils={area:function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n},isClockWise:function(e){return ShapeUtils.area(e)<0},triangulateShape:function(e,t){var n=[],r=[],i=[];removeDupEndPts(e),addContour(n,e);var a=e.length;t.forEach(removeDupEndPts);for(var o=0;o<t.length;o++)r.push(a),a+=t[o].length,addContour(n,t[o]);var s=Earcut.triangulate(n,r);for(o=0;o<s.length;o+=3)i.push(s.slice(o,o+3));return i}};function removeDupEndPts(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function addContour(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}function ExtrudeGeometry(e,t){Geometry.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new ExtrudeBufferGeometry(e,t)),this.mergeVertices()}function ExtrudeBufferGeometry(e,t){BufferGeometry.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:e,options:t};for(var n=this,r=[],i=[],a=0,o=(e=Array.isArray(e)?e:[e]).length;a<o;a++){s(e[a])}function s(e){var a=[],o=void 0!==t.curveSegments?t.curveSegments:12,s=void 0!==t.steps?t.steps:1,l=void 0!==t.depth?t.depth:100,c=void 0===t.bevelEnabled||t.bevelEnabled,u=void 0!==t.bevelThickness?t.bevelThickness:6,h=void 0!==t.bevelSize?t.bevelSize:u-2,p=void 0!==t.bevelOffset?t.bevelOffset:0,d=void 0!==t.bevelSegments?t.bevelSegments:3,f=t.extrudePath,m=void 0!==t.UVGenerator?t.UVGenerator:WorldUVGenerator;void 0!==t.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),l=t.amount);var g,v,y,x,_,b,w,M,S=!1;f&&(g=f.getSpacedPoints(s),S=!0,c=!1,v=f.computeFrenetFrames(s,!1),y=new Vector3,x=new Vector3,_=new Vector3),c||(d=0,u=0,h=0,p=0);var T=e.extractPoints(o),E=T.shape,C=T.holes;if(!ShapeUtils.isClockWise(E))for(E=E.reverse(),w=0,M=C.length;w<M;w++)b=C[w],ShapeUtils.isClockWise(b)&&(C[w]=b.reverse());var A=ShapeUtils.triangulateShape(E,C),L=E;for(w=0,M=C.length;w<M;w++)b=C[w],E=E.concat(b);function D(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}var P,O,R,I,B,N,k=E.length,F=A.length;function G(e,t,n){var r,i,a,o=e.x-t.x,s=e.y-t.y,l=n.x-e.x,c=n.y-e.y,u=o*o+s*s,h=o*c-s*l;if(Math.abs(h)>Number.EPSILON){var p=Math.sqrt(u),d=Math.sqrt(l*l+c*c),f=t.x-s/p,m=t.y+o/p,g=((n.x-c/d-f)*c-(n.y+l/d-m)*l)/(o*c-s*l),v=(r=f+o*g-e.x)*r+(i=m+s*g-e.y)*i;if(v<=2)return new Vector2(r,i);a=Math.sqrt(v/2)}else{var y=!1;o>Number.EPSILON?l>Number.EPSILON&&(y=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(c)&&(y=!0),y?(r=-s,i=o,a=Math.sqrt(u)):(r=o,i=s,a=Math.sqrt(u/2))}return new Vector2(r/a,i/a)}for(var V=[],z=0,U=L.length,j=U-1,H=z+1;z<U;z++,j++,H++)j===U&&(j=0),H===U&&(H=0),V[z]=G(L[z],L[j],L[H]);var W,q,J=[],X=V.concat();for(w=0,M=C.length;w<M;w++){for(b=C[w],W=[],z=0,j=(U=b.length)-1,H=z+1;z<U;z++,j++,H++)j===U&&(j=0),H===U&&(H=0),W[z]=G(b[z],b[j],b[H]);J.push(W),X=X.concat(W)}for(P=0;P<d;P++){for(R=P/d,I=u*Math.cos(R*Math.PI/2),O=h*Math.sin(R*Math.PI/2)+p,z=0,U=L.length;z<U;z++)$((B=D(L[z],V[z],O)).x,B.y,-I);for(w=0,M=C.length;w<M;w++)for(b=C[w],W=J[w],z=0,U=b.length;z<U;z++)$((B=D(b[z],W[z],O)).x,B.y,-I)}for(O=h+p,z=0;z<k;z++)B=c?D(E[z],X[z],O):E[z],S?(x.copy(v.normals[0]).multiplyScalar(B.x),y.copy(v.binormals[0]).multiplyScalar(B.y),_.copy(g[0]).add(x).add(y),$(_.x,_.y,_.z)):$(B.x,B.y,0);for(q=1;q<=s;q++)for(z=0;z<k;z++)B=c?D(E[z],X[z],O):E[z],S?(x.copy(v.normals[q]).multiplyScalar(B.x),y.copy(v.binormals[q]).multiplyScalar(B.y),_.copy(g[q]).add(x).add(y),$(_.x,_.y,_.z)):$(B.x,B.y,l/s*q);for(P=d-1;P>=0;P--){for(R=P/d,I=u*Math.cos(R*Math.PI/2),O=h*Math.sin(R*Math.PI/2)+p,z=0,U=L.length;z<U;z++)$((B=D(L[z],V[z],O)).x,B.y,l+I);for(w=0,M=C.length;w<M;w++)for(b=C[w],W=J[w],z=0,U=b.length;z<U;z++)B=D(b[z],W[z],O),S?$(B.x,B.y+g[s-1].y,g[s-1].x+I):$(B.x,B.y,l+I)}function Y(e,t){var n,r;for(z=e.length;--z>=0;){n=z,(r=z-1)<0&&(r=e.length-1);var i=0,a=s+2*d;for(i=0;i<a;i++){var o=k*i,l=k*(i+1);K(t+n+o,t+r+o,t+r+l,t+n+l)}}}function $(e,t,n){a.push(e),a.push(t),a.push(n)}function Z(e,t,i){Q(e),Q(t),Q(i);var a=r.length/3,o=m.generateTopUV(n,r,a-3,a-2,a-1);ee(o[0]),ee(o[1]),ee(o[2])}function K(e,t,i,a){Q(e),Q(t),Q(a),Q(t),Q(i),Q(a);var o=r.length/3,s=m.generateSideWallUV(n,r,o-6,o-3,o-2,o-1);ee(s[0]),ee(s[1]),ee(s[3]),ee(s[1]),ee(s[2]),ee(s[3])}function Q(e){r.push(a[3*e+0]),r.push(a[3*e+1]),r.push(a[3*e+2])}function ee(e){i.push(e.x),i.push(e.y)}!function(){var e=r.length/3;if(c){var t=0,i=k*t;for(z=0;z<F;z++)Z((N=A[z])[2]+i,N[1]+i,N[0]+i);for(i=k*(t=s+2*d),z=0;z<F;z++)Z((N=A[z])[0]+i,N[1]+i,N[2]+i)}else{for(z=0;z<F;z++)Z((N=A[z])[2],N[1],N[0]);for(z=0;z<F;z++)Z((N=A[z])[0]+k*s,N[1]+k*s,N[2]+k*s)}n.addGroup(e,r.length/3-e,0)}(),function(){var e=r.length/3,t=0;for(Y(L,t),t+=L.length,w=0,M=C.length;w<M;w++)Y(b=C[w],t),t+=b.length;n.addGroup(e,r.length/3-e,1)}()}this.setAttribute("position",new Float32BufferAttribute(r,3)),this.setAttribute("uv",new Float32BufferAttribute(i,2)),this.computeVertexNormals()}ExtrudeGeometry.prototype=Object.create(Geometry.prototype),ExtrudeGeometry.prototype.constructor=ExtrudeGeometry,ExtrudeGeometry.prototype.toJSON=function(){var e=Geometry.prototype.toJSON.call(this);return toJSON(this.parameters.shapes,this.parameters.options,e)},ExtrudeBufferGeometry.prototype=Object.create(BufferGeometry.prototype),ExtrudeBufferGeometry.prototype.constructor=ExtrudeBufferGeometry,ExtrudeBufferGeometry.prototype.toJSON=function(){var e=BufferGeometry.prototype.toJSON.call(this);return toJSON(this.parameters.shapes,this.parameters.options,e)};var WorldUVGenerator={generateTopUV:function(e,t,n,r,i){var a=t[3*n],o=t[3*n+1],s=t[3*r],l=t[3*r+1],c=t[3*i],u=t[3*i+1];return[new Vector2(a,o),new Vector2(s,l),new Vector2(c,u)]},generateSideWallUV:function(e,t,n,r,i,a){var o=t[3*n],s=t[3*n+1],l=t[3*n+2],c=t[3*r],u=t[3*r+1],h=t[3*r+2],p=t[3*i],d=t[3*i+1],f=t[3*i+2],m=t[3*a],g=t[3*a+1],v=t[3*a+2];return Math.abs(s-u)<.01?[new Vector2(o,1-l),new Vector2(c,1-h),new Vector2(p,1-f),new Vector2(m,1-v)]:[new Vector2(s,1-l),new Vector2(u,1-h),new Vector2(d,1-f),new Vector2(g,1-v)]}};function toJSON(e,t,n){if(n.shapes=[],Array.isArray(e))for(var r=0,i=e.length;r<i;r++){var a=e[r];n.shapes.push(a.uuid)}else n.shapes.push(e.uuid);return void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON()),n}function TextGeometry(e,t){Geometry.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new TextBufferGeometry(e,t)),this.mergeVertices()}function TextBufferGeometry(e,t){var n=(t=t||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Geometry;var r=n.generateShapes(e,t.size);t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),ExtrudeBufferGeometry.call(this,r,t),this.type="TextBufferGeometry"}function SphereGeometry(e,t,n,r,i,a,o){Geometry.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new SphereBufferGeometry(e,t,n,r,i,a,o)),this.mergeVertices()}function SphereBufferGeometry(e,t,n,r,i,a,o){BufferGeometry.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},e=e||1,t=Math.max(3,Math.floor(t)||8),n=Math.max(2,Math.floor(n)||6),r=void 0!==r?r:0,i=void 0!==i?i:2*Math.PI,a=void 0!==a?a:0,o=void 0!==o?o:Math.PI;var s,l,c=Math.min(a+o,Math.PI),u=0,h=[],p=new Vector3,d=new Vector3,f=[],m=[],g=[],v=[];for(l=0;l<=n;l++){var y=[],x=l/n,_=0;for(0==l&&0==a?_=.5/t:l==n&&c==Math.PI&&(_=-.5/t),s=0;s<=t;s++){var b=s/t;p.x=-e*Math.cos(r+b*i)*Math.sin(a+x*o),p.y=e*Math.cos(a+x*o),p.z=e*Math.sin(r+b*i)*Math.sin(a+x*o),m.push(p.x,p.y,p.z),d.copy(p).normalize(),g.push(d.x,d.y,d.z),v.push(b+_,1-x),y.push(u++)}h.push(y)}for(l=0;l<n;l++)for(s=0;s<t;s++){var w=h[l][s+1],M=h[l][s],S=h[l+1][s],T=h[l+1][s+1];(0!==l||a>0)&&f.push(w,M,T),(l!==n-1||c<Math.PI)&&f.push(M,S,T)}this.setIndex(f),this.setAttribute("position",new Float32BufferAttribute(m,3)),this.setAttribute("normal",new Float32BufferAttribute(g,3)),this.setAttribute("uv",new Float32BufferAttribute(v,2))}function RingGeometry(e,t,n,r,i,a){Geometry.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},this.fromBufferGeometry(new RingBufferGeometry(e,t,n,r,i,a)),this.mergeVertices()}function RingBufferGeometry(e,t,n,r,i,a){BufferGeometry.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},e=e||.5,t=t||1,i=void 0!==i?i:0,a=void 0!==a?a:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var o,s,l,c=[],u=[],h=[],p=[],d=e,f=(t-e)/(r=void 0!==r?Math.max(1,r):1),m=new Vector3,g=new Vector2;for(s=0;s<=r;s++){for(l=0;l<=n;l++)o=i+l/n*a,m.x=d*Math.cos(o),m.y=d*Math.sin(o),u.push(m.x,m.y,m.z),h.push(0,0,1),g.x=(m.x/t+1)/2,g.y=(m.y/t+1)/2,p.push(g.x,g.y);d+=f}for(s=0;s<r;s++){var v=s*(n+1);for(l=0;l<n;l++){var y=o=l+v,x=o+n+1,_=o+n+2,b=o+1;c.push(y,x,b),c.push(x,_,b)}}this.setIndex(c),this.setAttribute("position",new Float32BufferAttribute(u,3)),this.setAttribute("normal",new Float32BufferAttribute(h,3)),this.setAttribute("uv",new Float32BufferAttribute(p,2))}function LatheGeometry(e,t,n,r){Geometry.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},this.fromBufferGeometry(new LatheBufferGeometry(e,t,n,r)),this.mergeVertices()}function LatheBufferGeometry(e,t,n,r){BufferGeometry.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t)||12,n=n||0,r=r||2*Math.PI,r=MathUtils.clamp(r,0,2*Math.PI);var i,a,o,s=[],l=[],c=[],u=1/t,h=new Vector3,p=new Vector2;for(a=0;a<=t;a++){var d=n+a*u*r,f=Math.sin(d),m=Math.cos(d);for(o=0;o<=e.length-1;o++)h.x=e[o].x*f,h.y=e[o].y,h.z=e[o].x*m,l.push(h.x,h.y,h.z),p.x=a/t,p.y=o/(e.length-1),c.push(p.x,p.y)}for(a=0;a<t;a++)for(o=0;o<e.length-1;o++){var g=i=o+a*e.length,v=i+e.length,y=i+e.length+1,x=i+1;s.push(g,v,x),s.push(v,y,x)}if(this.setIndex(s),this.setAttribute("position",new Float32BufferAttribute(l,3)),this.setAttribute("uv",new Float32BufferAttribute(c,2)),this.computeVertexNormals(),r===2*Math.PI){var _=this.attributes.normal.array,b=new Vector3,w=new Vector3,M=new Vector3;for(i=t*e.length*3,a=0,o=0;a<e.length;a++,o+=3)b.x=_[o+0],b.y=_[o+1],b.z=_[o+2],w.x=_[i+o+0],w.y=_[i+o+1],w.z=_[i+o+2],M.addVectors(b,w).normalize(),_[o+0]=_[i+o+0]=M.x,_[o+1]=_[i+o+1]=M.y,_[o+2]=_[i+o+2]=M.z}}function ShapeGeometry(e,t){Geometry.call(this),this.type="ShapeGeometry","object"==typeof t&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new ShapeBufferGeometry(e,t)),this.mergeVertices()}function ShapeBufferGeometry(e,t){BufferGeometry.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:t},t=t||12;var n=[],r=[],i=[],a=[],o=0,s=0;if(!1===Array.isArray(e))c(e);else for(var l=0;l<e.length;l++)c(e[l]),this.addGroup(o,s,l),o+=s,s=0;function c(e){var o,l,c,u=r.length/3,h=e.extractPoints(t),p=h.shape,d=h.holes;for(!1===ShapeUtils.isClockWise(p)&&(p=p.reverse()),o=0,l=d.length;o<l;o++)c=d[o],!0===ShapeUtils.isClockWise(c)&&(d[o]=c.reverse());var f=ShapeUtils.triangulateShape(p,d);for(o=0,l=d.length;o<l;o++)c=d[o],p=p.concat(c);for(o=0,l=p.length;o<l;o++){var m=p[o];r.push(m.x,m.y,0),i.push(0,0,1),a.push(m.x,m.y)}for(o=0,l=f.length;o<l;o++){var g=f[o],v=g[0]+u,y=g[1]+u,x=g[2]+u;n.push(v,y,x),s+=3}}this.setIndex(n),this.setAttribute("position",new Float32BufferAttribute(r,3)),this.setAttribute("normal",new Float32BufferAttribute(i,3)),this.setAttribute("uv",new Float32BufferAttribute(a,2))}function toJSON$1(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,r=e.length;n<r;n++){var i=e[n];t.shapes.push(i.uuid)}else t.shapes.push(e.uuid);return t}function EdgesGeometry(e,t){BufferGeometry.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=void 0!==t?t:1;var n,r,i,a,o=[],s=Math.cos(MathUtils.DEG2RAD*t),l=[0,0],c={},u=["a","b","c"];e.isBufferGeometry?(a=new Geometry).fromBufferGeometry(e):a=e.clone(),a.mergeVertices(),a.computeFaceNormals();for(var h=a.vertices,p=a.faces,d=0,f=p.length;d<f;d++)for(var m=p[d],g=0;g<3;g++)n=m[u[g]],r=m[u[(g+1)%3]],l[0]=Math.min(n,r),l[1]=Math.max(n,r),void 0===c[i=l[0]+","+l[1]]?c[i]={index1:l[0],index2:l[1],face1:d,face2:void 0}:c[i].face2=d;for(i in c){var v=c[i];if(void 0===v.face2||p[v.face1].normal.dot(p[v.face2].normal)<=s){var y=h[v.index1];o.push(y.x,y.y,y.z),y=h[v.index2],o.push(y.x,y.y,y.z)}}this.setAttribute("position",new Float32BufferAttribute(o,3))}function CylinderGeometry(e,t,n,r,i,a,o,s){Geometry.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new CylinderBufferGeometry(e,t,n,r,i,a,o,s)),this.mergeVertices()}function CylinderBufferGeometry(e,t,n,r,i,a,o,s){BufferGeometry.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s};var l=this;e=void 0!==e?e:1,t=void 0!==t?t:1,n=n||1,r=Math.floor(r)||8,i=Math.floor(i)||1,a=void 0!==a&&a,o=void 0!==o?o:0,s=void 0!==s?s:2*Math.PI;var c=[],u=[],h=[],p=[],d=0,f=[],m=n/2,g=0;function v(n){var i,a,f,v=new Vector2,y=new Vector3,x=0,_=!0===n?e:t,b=!0===n?1:-1;for(a=d,i=1;i<=r;i++)u.push(0,m*b,0),h.push(0,b,0),p.push(.5,.5),d++;for(f=d,i=0;i<=r;i++){var w=i/r*s+o,M=Math.cos(w),S=Math.sin(w);y.x=_*S,y.y=m*b,y.z=_*M,u.push(y.x,y.y,y.z),h.push(0,b,0),v.x=.5*M+.5,v.y=.5*S*b+.5,p.push(v.x,v.y),d++}for(i=0;i<r;i++){var T=a+i,E=f+i;!0===n?c.push(E,E+1,T):c.push(E+1,E,T),x+=3}l.addGroup(g,x,!0===n?1:2),g+=x}!function(){var a,v,y=new Vector3,x=new Vector3,_=0,b=(t-e)/n;for(v=0;v<=i;v++){var w=[],M=v/i,S=M*(t-e)+e;for(a=0;a<=r;a++){var T=a/r,E=T*s+o,C=Math.sin(E),A=Math.cos(E);x.x=S*C,x.y=-M*n+m,x.z=S*A,u.push(x.x,x.y,x.z),y.set(C,b,A).normalize(),h.push(y.x,y.y,y.z),p.push(T,1-M),w.push(d++)}f.push(w)}for(a=0;a<r;a++)for(v=0;v<i;v++){var L=f[v][a],D=f[v+1][a],P=f[v+1][a+1],O=f[v][a+1];c.push(L,D,O),c.push(D,P,O),_+=6}l.addGroup(g,_,0),g+=_}(),!1===a&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new Float32BufferAttribute(u,3)),this.setAttribute("normal",new Float32BufferAttribute(h,3)),this.setAttribute("uv",new Float32BufferAttribute(p,2))}function ConeGeometry(e,t,n,r,i,a,o){CylinderGeometry.call(this,0,e,t,n,r,i,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}function ConeBufferGeometry(e,t,n,r,i,a,o){CylinderBufferGeometry.call(this,0,e,t,n,r,i,a,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}function CircleGeometry(e,t,n,r){Geometry.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new CircleBufferGeometry(e,t,n,r)),this.mergeVertices()}function CircleBufferGeometry(e,t,n,r){BufferGeometry.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},e=e||1,t=void 0!==t?Math.max(3,t):8,n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var i,a,o=[],s=[],l=[],c=[],u=new Vector3,h=new Vector2;for(s.push(0,0,0),l.push(0,0,1),c.push(.5,.5),a=0,i=3;a<=t;a++,i+=3){var p=n+a/t*r;u.x=e*Math.cos(p),u.y=e*Math.sin(p),s.push(u.x,u.y,u.z),l.push(0,0,1),h.x=(s[i]/e+1)/2,h.y=(s[i+1]/e+1)/2,c.push(h.x,h.y)}for(i=1;i<=t;i++)o.push(i,i+1,0);this.setIndex(o),this.setAttribute("position",new Float32BufferAttribute(s,3)),this.setAttribute("normal",new Float32BufferAttribute(l,3)),this.setAttribute("uv",new Float32BufferAttribute(c,2))}TextGeometry.prototype=Object.create(Geometry.prototype),TextGeometry.prototype.constructor=TextGeometry,TextBufferGeometry.prototype=Object.create(ExtrudeBufferGeometry.prototype),TextBufferGeometry.prototype.constructor=TextBufferGeometry,SphereGeometry.prototype=Object.create(Geometry.prototype),SphereGeometry.prototype.constructor=SphereGeometry,SphereBufferGeometry.prototype=Object.create(BufferGeometry.prototype),SphereBufferGeometry.prototype.constructor=SphereBufferGeometry,RingGeometry.prototype=Object.create(Geometry.prototype),RingGeometry.prototype.constructor=RingGeometry,RingBufferGeometry.prototype=Object.create(BufferGeometry.prototype),RingBufferGeometry.prototype.constructor=RingBufferGeometry,LatheGeometry.prototype=Object.create(Geometry.prototype),LatheGeometry.prototype.constructor=LatheGeometry,LatheBufferGeometry.prototype=Object.create(BufferGeometry.prototype),LatheBufferGeometry.prototype.constructor=LatheBufferGeometry,ShapeGeometry.prototype=Object.create(Geometry.prototype),ShapeGeometry.prototype.constructor=ShapeGeometry,ShapeGeometry.prototype.toJSON=function(){var e=Geometry.prototype.toJSON.call(this);return toJSON$1(this.parameters.shapes,e)},ShapeBufferGeometry.prototype=Object.create(BufferGeometry.prototype),ShapeBufferGeometry.prototype.constructor=ShapeBufferGeometry,ShapeBufferGeometry.prototype.toJSON=function(){var e=BufferGeometry.prototype.toJSON.call(this);return toJSON$1(this.parameters.shapes,e)},EdgesGeometry.prototype=Object.create(BufferGeometry.prototype),EdgesGeometry.prototype.constructor=EdgesGeometry,CylinderGeometry.prototype=Object.create(Geometry.prototype),CylinderGeometry.prototype.constructor=CylinderGeometry,CylinderBufferGeometry.prototype=Object.create(BufferGeometry.prototype),CylinderBufferGeometry.prototype.constructor=CylinderBufferGeometry,ConeGeometry.prototype=Object.create(CylinderGeometry.prototype),ConeGeometry.prototype.constructor=ConeGeometry,ConeBufferGeometry.prototype=Object.create(CylinderBufferGeometry.prototype),ConeBufferGeometry.prototype.constructor=ConeBufferGeometry,CircleGeometry.prototype=Object.create(Geometry.prototype),CircleGeometry.prototype.constructor=CircleGeometry,CircleBufferGeometry.prototype=Object.create(BufferGeometry.prototype),CircleBufferGeometry.prototype.constructor=CircleBufferGeometry;var Geometries=Object.freeze({__proto__:null,WireframeGeometry:WireframeGeometry,ParametricGeometry:ParametricGeometry,ParametricBufferGeometry:ParametricBufferGeometry,TetrahedronGeometry:TetrahedronGeometry,TetrahedronBufferGeometry:TetrahedronBufferGeometry,OctahedronGeometry:OctahedronGeometry,OctahedronBufferGeometry:OctahedronBufferGeometry,IcosahedronGeometry:IcosahedronGeometry,IcosahedronBufferGeometry:IcosahedronBufferGeometry,DodecahedronGeometry:DodecahedronGeometry,DodecahedronBufferGeometry:DodecahedronBufferGeometry,PolyhedronGeometry:PolyhedronGeometry,PolyhedronBufferGeometry:PolyhedronBufferGeometry,TubeGeometry:TubeGeometry,TubeBufferGeometry:TubeBufferGeometry,TorusKnotGeometry:TorusKnotGeometry,TorusKnotBufferGeometry:TorusKnotBufferGeometry,TorusGeometry:TorusGeometry,TorusBufferGeometry:TorusBufferGeometry,TextGeometry:TextGeometry,TextBufferGeometry:TextBufferGeometry,SphereGeometry:SphereGeometry,SphereBufferGeometry:SphereBufferGeometry,RingGeometry:RingGeometry,RingBufferGeometry:RingBufferGeometry,PlaneGeometry:PlaneGeometry,PlaneBufferGeometry:PlaneBufferGeometry,LatheGeometry:LatheGeometry,LatheBufferGeometry:LatheBufferGeometry,ShapeGeometry:ShapeGeometry,ShapeBufferGeometry:ShapeBufferGeometry,ExtrudeGeometry:ExtrudeGeometry,ExtrudeBufferGeometry:ExtrudeBufferGeometry,EdgesGeometry:EdgesGeometry,ConeGeometry:ConeGeometry,ConeBufferGeometry:ConeBufferGeometry,CylinderGeometry:CylinderGeometry,CylinderBufferGeometry:CylinderBufferGeometry,CircleGeometry:CircleGeometry,CircleBufferGeometry:CircleBufferGeometry,BoxGeometry:BoxGeometry,BoxBufferGeometry:BoxBufferGeometry});function ShadowMaterial(e){Material.call(this),this.type="ShadowMaterial",this.color=new Color(0),this.transparent=!0,this.setValues(e)}function RawShaderMaterial(e){ShaderMaterial.call(this,e),this.type="RawShaderMaterial"}function MeshStandardMaterial(e){Material.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Color(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function MeshPhysicalMaterial(e){MeshStandardMaterial.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearcoat=0,this.clearcoatRoughness=0,this.sheen=null,this.clearcoatNormalScale=new Vector2(1,1),this.clearcoatNormalMap=null,this.transparency=0,this.setValues(e)}function MeshPhongMaterial(e){Material.call(this),this.type="MeshPhongMaterial",this.color=new Color(16777215),this.specular=new Color(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function MeshToonMaterial(e){Material.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Color(16777215),this.specular=new Color(1118481),this.shininess=30,this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function MeshNormalMaterial(e){Material.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function MeshLambertMaterial(e){Material.call(this),this.type="MeshLambertMaterial",this.color=new Color(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function MeshMatcapMaterial(e){Material.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Color(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function LineDashedMaterial(e){LineBasicMaterial.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}ShadowMaterial.prototype=Object.create(Material.prototype),ShadowMaterial.prototype.constructor=ShadowMaterial,ShadowMaterial.prototype.isShadowMaterial=!0,ShadowMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.color.copy(e.color),this},RawShaderMaterial.prototype=Object.create(ShaderMaterial.prototype),RawShaderMaterial.prototype.constructor=RawShaderMaterial,RawShaderMaterial.prototype.isRawShaderMaterial=!0,MeshStandardMaterial.prototype=Object.create(Material.prototype),MeshStandardMaterial.prototype.constructor=MeshStandardMaterial,MeshStandardMaterial.prototype.isMeshStandardMaterial=!0,MeshStandardMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},MeshPhysicalMaterial.prototype=Object.create(MeshStandardMaterial.prototype),MeshPhysicalMaterial.prototype.constructor=MeshPhysicalMaterial,MeshPhysicalMaterial.prototype.isMeshPhysicalMaterial=!0,MeshPhysicalMaterial.prototype.copy=function(e){return MeshStandardMaterial.prototype.copy.call(this,e),this.defines={STANDARD:"",PHYSICAL:""},this.reflectivity=e.reflectivity,this.clearcoat=e.clearcoat,this.clearcoatRoughness=e.clearcoatRoughness,e.sheen?this.sheen=(this.sheen||new Color).copy(e.sheen):this.sheen=null,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.transparency=e.transparency,this},MeshPhongMaterial.prototype=Object.create(Material.prototype),MeshPhongMaterial.prototype.constructor=MeshPhongMaterial,MeshPhongMaterial.prototype.isMeshPhongMaterial=!0,MeshPhongMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},MeshToonMaterial.prototype=Object.create(Material.prototype),MeshToonMaterial.prototype.constructor=MeshToonMaterial,MeshToonMaterial.prototype.isMeshToonMaterial=!0,MeshToonMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},MeshNormalMaterial.prototype=Object.create(Material.prototype),MeshNormalMaterial.prototype.constructor=MeshNormalMaterial,MeshNormalMaterial.prototype.isMeshNormalMaterial=!0,MeshNormalMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},MeshLambertMaterial.prototype=Object.create(Material.prototype),MeshLambertMaterial.prototype.constructor=MeshLambertMaterial,MeshLambertMaterial.prototype.isMeshLambertMaterial=!0,MeshLambertMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},MeshMatcapMaterial.prototype=Object.create(Material.prototype),MeshMatcapMaterial.prototype.constructor=MeshMatcapMaterial,MeshMatcapMaterial.prototype.isMeshMatcapMaterial=!0,MeshMatcapMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},LineDashedMaterial.prototype=Object.create(LineBasicMaterial.prototype),LineDashedMaterial.prototype.constructor=LineDashedMaterial,LineDashedMaterial.prototype.isLineDashedMaterial=!0,LineDashedMaterial.prototype.copy=function(e){return LineBasicMaterial.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var Materials=Object.freeze({__proto__:null,ShadowMaterial:ShadowMaterial,SpriteMaterial:SpriteMaterial,RawShaderMaterial:RawShaderMaterial,ShaderMaterial:ShaderMaterial,PointsMaterial:PointsMaterial,MeshPhysicalMaterial:MeshPhysicalMaterial,MeshStandardMaterial:MeshStandardMaterial,MeshPhongMaterial:MeshPhongMaterial,MeshToonMaterial:MeshToonMaterial,MeshNormalMaterial:MeshNormalMaterial,MeshLambertMaterial:MeshLambertMaterial,MeshDepthMaterial:MeshDepthMaterial,MeshDistanceMaterial:MeshDistanceMaterial,MeshBasicMaterial:MeshBasicMaterial,MeshMatcapMaterial:MeshMatcapMaterial,LineDashedMaterial:LineDashedMaterial,LineBasicMaterial:LineBasicMaterial,Material:Material}),AnimationUtils={arraySlice:function(e,t,n){return AnimationUtils.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){for(var t=e.length,n=new Array(t),r=0;r!==t;++r)n[r]=r;return n.sort(function(t,n){return e[t]-e[n]}),n},sortedArray:function(e,t,n){for(var r=e.length,i=new e.constructor(r),a=0,o=0;o!==r;++a)for(var s=n[a]*t,l=0;l!==t;++l)i[o++]=e[s+l];return i},flattenJSON:function(e,t,n,r){for(var i=1,a=e[0];void 0!==a&&void 0===a[r];)a=e[i++];if(void 0!==a){var o=a[r];if(void 0!==o)if(Array.isArray(o))do{void 0!==(o=a[r])&&(t.push(a.time),n.push.apply(n,o)),a=e[i++]}while(void 0!==a);else if(void 0!==o.toArray)do{void 0!==(o=a[r])&&(t.push(a.time),o.toArray(n,n.length)),a=e[i++]}while(void 0!==a);else do{void 0!==(o=a[r])&&(t.push(a.time),n.push(o)),a=e[i++]}while(void 0!==a)}},subclip:function(e,t,n,r,i){i=i||30;var a=e.clone();a.name=t;for(var o=[],s=0;s<a.tracks.length;++s){for(var l=a.tracks[s],c=l.getValueSize(),u=[],h=[],p=0;p<l.times.length;++p){var d=l.times[p]*i;if(!(d<n||d>=r)){u.push(l.times[p]);for(var f=0;f<c;++f)h.push(l.values[p*c+f])}}0!==u.length&&(l.times=AnimationUtils.convertArray(u,l.times.constructor),l.values=AnimationUtils.convertArray(h,l.values.constructor),o.push(l))}a.tracks=o;var m=1/0;for(s=0;s<a.tracks.length;++s)m>a.tracks[s].times[0]&&(m=a.tracks[s].times[0]);for(s=0;s<a.tracks.length;++s)a.tracks[s].shift(-1*m);return a.resetDuration(),a}};function Interpolant(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n}function CubicInterpolant(e,t,n,r){Interpolant.call(this,e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function LinearInterpolant(e,t,n,r){Interpolant.call(this,e,t,n,r)}function DiscreteInterpolant(e,t,n,r){Interpolant.call(this,e,t,n,r)}function KeyframeTrack(e,t,n,r){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=AnimationUtils.convertArray(t,this.TimeBufferType),this.values=AnimationUtils.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}function BooleanKeyframeTrack(e,t,n){KeyframeTrack.call(this,e,t,n)}function ColorKeyframeTrack(e,t,n,r){KeyframeTrack.call(this,e,t,n,r)}function NumberKeyframeTrack(e,t,n,r){KeyframeTrack.call(this,e,t,n,r)}function QuaternionLinearInterpolant(e,t,n,r){Interpolant.call(this,e,t,n,r)}function QuaternionKeyframeTrack(e,t,n,r){KeyframeTrack.call(this,e,t,n,r)}function StringKeyframeTrack(e,t,n,r){KeyframeTrack.call(this,e,t,n,r)}function VectorKeyframeTrack(e,t,n,r){KeyframeTrack.call(this,e,t,n,r)}function AnimationClip(e,t,n){this.name=e,this.tracks=n,this.duration=void 0!==t?t:-1,this.uuid=MathUtils.generateUUID(),this.duration<0&&this.resetDuration()}function getTrackTypeForValueTypeName(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return NumberKeyframeTrack;case"vector":case"vector2":case"vector3":case"vector4":return VectorKeyframeTrack;case"color":return ColorKeyframeTrack;case"quaternion":return QuaternionKeyframeTrack;case"bool":case"boolean":return BooleanKeyframeTrack;case"string":return StringKeyframeTrack}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}function parseKeyframeTrack(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var t=getTrackTypeForValueTypeName(e.type);if(void 0===e.times){var n=[],r=[];AnimationUtils.flattenJSON(e.keys,n,r,"value"),e.times=n,e.values=r}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}Object.assign(Interpolant.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{var a;n:{r:if(!(e<r)){for(var o=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,i)}if(n===o)break;if(i=r,e<(r=t[++n]))break t}a=t.length;break n}if(e>=i)break e;var s=t[1];e<s&&(n=2,i=s);for(o=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(n===o)break;if(r=i,e>=(i=t[--n-1]))break t}a=n,n=0}for(;n<a;){var l=n+a>>>1;e<t[l]?a=l:n=l+1}if(r=t[n],void 0===(i=t[n-1]))return this._cachedIndex=0,this.beforeStart_(0,e,r);if(void 0===r)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,i,e)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r,a=0;a!==r;++a)t[a]=n[i+a];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(Interpolant.prototype,{beforeStart_:Interpolant.prototype.copySampleValue_,afterEnd_:Interpolant.prototype.copySampleValue_}),CubicInterpolant.prototype=Object.assign(Object.create(Interpolant.prototype),{constructor:CubicInterpolant,DefaultSettings_:{endingStart:ZeroCurvatureEnding,endingEnd:ZeroCurvatureEnding},intervalChanged_:function(e,t,n){var r=this.parameterPositions,i=e-2,a=e+1,o=r[i],s=r[a];if(void 0===o)switch(this.getSettings_().endingStart){case ZeroSlopeEnding:i=e,o=2*t-n;break;case WrapAroundEnding:o=t+r[i=r.length-2]-r[i+1];break;default:i=e,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case ZeroSlopeEnding:a=e,s=2*n-t;break;case WrapAroundEnding:a=1,s=n+r[1]-r[0];break;default:a=e-1,s=t}var l=.5*(n-t),c=this.valueSize;this._weightPrev=l/(t-o),this._weightNext=l/(s-n),this._offsetPrev=i*c,this._offsetNext=a*c},interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,c=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,p=this._weightNext,d=(n-t)/(r-t),f=d*d,m=f*d,g=-h*m+2*h*f-h*d,v=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*d+1,y=(-1-p)*m+(1.5+p)*f+.5*d,x=p*m-p*f,_=0;_!==o;++_)i[_]=g*a[c+_]+v*a[l+_]+y*a[s+_]+x*a[u+_];return i}}),LinearInterpolant.prototype=Object.assign(Object.create(Interpolant.prototype),{constructor:LinearInterpolant,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,c=(n-t)/(r-t),u=1-c,h=0;h!==o;++h)i[h]=a[l+h]*u+a[s+h]*c;return i}}),DiscreteInterpolant.prototype=Object.assign(Object.create(Interpolant.prototype),{constructor:DiscreteInterpolant,interpolate_:function(e){return this.copySampleValue_(e-1)}}),Object.assign(KeyframeTrack,{toJSON:function(e){var t,n=e.constructor;if(void 0!==n.toJSON)t=n.toJSON(e);else{t={name:e.name,times:AnimationUtils.convertArray(e.times,Array),values:AnimationUtils.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t}}),Object.assign(KeyframeTrack.prototype,{constructor:KeyframeTrack,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:InterpolateLinear,InterpolantFactoryMethodDiscrete:function(e){return new DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new LinearInterpolant(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new CubicInterpolant(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case InterpolateDiscrete:t=this.InterpolantFactoryMethodDiscrete;break;case InterpolateLinear:t=this.InterpolantFactoryMethodLinear;break;case InterpolateSmooth:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return InterpolateDiscrete;case this.InterpolantFactoryMethodLinear:return InterpolateLinear;case this.InterpolantFactoryMethodSmooth:return InterpolateSmooth}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]*=e;return this},trim:function(e,t){for(var n=this.times,r=n.length,i=0,a=r-1;i!==r&&n[i]<e;)++i;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==i||a!==r){i>=a&&(i=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=AnimationUtils.arraySlice(n,i,a),this.values=AnimationUtils.arraySlice(this.values,i*o,a*o)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var a=null,o=0;o!==i;o++){var s=n[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),e=!1;break}if(null!==a&&a>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),e=!1;break}a=s}if(void 0!==r&&AnimationUtils.isTypedArray(r)){o=0;for(var l=r.length;o!==l;++o){var c=r[o];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,c),e=!1;break}}}return e},optimize:function(){for(var e=AnimationUtils.arraySlice(this.times),t=AnimationUtils.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===InterpolateSmooth,i=1,a=e.length-1,o=1;o<a;++o){var s=!1,l=e[o];if(l!==e[o+1]&&(1!==o||l!==l[0]))if(r)s=!0;else for(var c=o*n,u=c-n,h=c+n,p=0;p!==n;++p){var d=t[c+p];if(d!==t[u+p]||d!==t[h+p]){s=!0;break}}if(s){if(o!==i){e[i]=e[o];var f=o*n,m=i*n;for(p=0;p!==n;++p)t[m+p]=t[f+p]}++i}}if(a>0){e[i]=e[a];for(f=a*n,m=i*n,p=0;p!==n;++p)t[m+p]=t[f+p];++i}return i!==e.length?(this.times=AnimationUtils.arraySlice(e,0,i),this.values=AnimationUtils.arraySlice(t,0,i*n)):(this.times=e,this.values=t),this},clone:function(){var e=AnimationUtils.arraySlice(this.times,0),t=AnimationUtils.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}),BooleanKeyframeTrack.prototype=Object.assign(Object.create(KeyframeTrack.prototype),{constructor:BooleanKeyframeTrack,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:InterpolateDiscrete,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),ColorKeyframeTrack.prototype=Object.assign(Object.create(KeyframeTrack.prototype),{constructor:ColorKeyframeTrack,ValueTypeName:"color"}),NumberKeyframeTrack.prototype=Object.assign(Object.create(KeyframeTrack.prototype),{constructor:NumberKeyframeTrack,ValueTypeName:"number"}),QuaternionLinearInterpolant.prototype=Object.assign(Object.create(Interpolant.prototype),{constructor:QuaternionLinearInterpolant,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=(n-t)/(r-t),c=s+o;s!==c;s+=4)Quaternion.slerpFlat(i,0,a,s-o,a,s,l);return i}}),QuaternionKeyframeTrack.prototype=Object.assign(Object.create(KeyframeTrack.prototype),{constructor:QuaternionKeyframeTrack,ValueTypeName:"quaternion",DefaultInterpolation:InterpolateLinear,InterpolantFactoryMethodLinear:function(e){return new QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),StringKeyframeTrack.prototype=Object.assign(Object.create(KeyframeTrack.prototype),{constructor:StringKeyframeTrack,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:InterpolateDiscrete,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),VectorKeyframeTrack.prototype=Object.assign(Object.create(KeyframeTrack.prototype),{constructor:VectorKeyframeTrack,ValueTypeName:"vector"}),Object.assign(AnimationClip,{parse:function(e){for(var t=[],n=e.tracks,r=1/(e.fps||1),i=0,a=n.length;i!==a;++i)t.push(parseKeyframeTrack(n[i]).scale(r));return new AnimationClip(e.name,e.duration,t)},toJSON:function(e){for(var t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid},i=0,a=n.length;i!==a;++i)t.push(KeyframeTrack.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){for(var i=t.length,a=[],o=0;o<i;o++){var s=[],l=[];s.push((o+i-1)%i,o,(o+1)%i),l.push(0,1,0);var c=AnimationUtils.getKeyframeOrder(s);s=AnimationUtils.sortedArray(s,1,c),l=AnimationUtils.sortedArray(l,1,c),r||0!==s[0]||(s.push(i),l.push(l[0])),a.push(new NumberKeyframeTrack(".morphTargetInfluences["+t[o].name+"]",s,l).scale(1/n))}return new AnimationClip(e,-1,a)},findByName:function(e,t){var n=e;if(!Array.isArray(e)){var r=e;n=r.geometry&&r.geometry.animations||r.animations}for(var i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null},CreateClipsFromMorphTargetSequences:function(e,t,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,a=0,o=e.length;a<o;a++){var s=e[a],l=s.name.match(i);if(l&&l.length>1){var c=r[h=l[1]];c||(r[h]=c=[]),c.push(s)}}var u=[];for(var h in r)u.push(AnimationClip.CreateFromMorphTargetSequence(h,r[h],t,n));return u},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,r,i){if(0!==n.length){var a=[],o=[];AnimationUtils.flattenJSON(n,a,o,r),0!==a.length&&i.push(new e(t,a,o))}},r=[],i=e.name||"default",a=e.length||-1,o=e.fps||30,s=e.hierarchy||[],l=0;l<s.length;l++){var c=s[l].keys;if(c&&0!==c.length)if(c[0].morphTargets){for(var u={},h=0;h<c.length;h++)if(c[h].morphTargets)for(var p=0;p<c[h].morphTargets.length;p++)u[c[h].morphTargets[p]]=-1;for(var d in u){var f=[],m=[];for(p=0;p!==c[h].morphTargets.length;++p){var g=c[h];f.push(g.time),m.push(g.morphTarget===d?1:0)}r.push(new NumberKeyframeTrack(".morphTargetInfluence["+d+"]",f,m))}a=u.length*(o||1)}else{var v=".bones["+t[l].name+"]";n(VectorKeyframeTrack,v+".position",c,"pos",r),n(QuaternionKeyframeTrack,v+".quaternion",c,"rot",r),n(VectorKeyframeTrack,v+".scale",c,"scl",r)}}return 0===r.length?null:new AnimationClip(i,a,r)}}),Object.assign(AnimationClip.prototype,{resetDuration:function(){for(var e=0,t=0,n=this.tracks.length;t!==n;++t){var r=this.tracks[t];e=Math.max(e,r.times[r.times.length-1])}return this.duration=e,this},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},validate:function(){for(var e=!0,t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this},clone:function(){for(var e=[],t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new AnimationClip(this.name,this.duration,e)}});var Cache={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function LoadingManager(e,t,n){var r=this,i=!1,a=0,o=0,s=void 0,l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===i&&void 0!==r.onStart&&r.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,void 0!==r.onProgress&&r.onProgress(e,a,o),a===o&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){var t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(var t=0,n=l.length;t<n;t+=2){var r=l[t],i=l[t+1];if(r.global&&(r.lastIndex=0),r.test(e))return i}return null}}var DefaultLoadingManager=new LoadingManager;function Loader(e){this.manager=void 0!==e?e:DefaultLoadingManager,this.crossOrigin="anonymous",this.path="",this.resourcePath=""}Object.assign(Loader.prototype,{load:function(){},parse:function(){},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this},setResourcePath:function(e){return this.resourcePath=e,this}});var loading={};function FileLoader(e){Loader.call(this,e)}function AnimationLoader(e){Loader.call(this,e)}function CompressedTextureLoader(e){Loader.call(this,e)}function DataTextureLoader(e){Loader.call(this,e)}function ImageLoader(e){Loader.call(this,e)}function CubeTextureLoader(e){Loader.call(this,e)}function TextureLoader(e){Loader.call(this,e)}function Curve(){this.type="Curve",this.arcLengthDivisions=200}function EllipseCurve(e,t,n,r,i,a,o,s){Curve.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=n||1,this.yRadius=r||1,this.aStartAngle=i||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function ArcCurve(e,t,n,r,i,a){EllipseCurve.call(this,e,t,n,n,r,i,a),this.type="ArcCurve"}function CubicPoly(){var e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){var l=(t-e)/a-(n-e)/(a+o)+(n-t)/o,c=(n-t)/o-(r-t)/(o+s)+(r-n)/s;i(t,n,l*=o,c*=o)},calc:function(i){var a=i*i;return e+t*i+n*a+r*(a*i)}}}FileLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:FileLoader,load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Cache.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0),a;if(void 0===loading[e]){var o=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(o){var s=o[1],l=!!o[2],c=o[3];c=decodeURIComponent(c),l&&(c=atob(c));try{var u,h=(this.responseType||"").toLowerCase();switch(h){case"arraybuffer":case"blob":for(var p=new Uint8Array(c.length),d=0;d<c.length;d++)p[d]=c.charCodeAt(d);u="blob"===h?new Blob([p.buffer],{type:s}):p.buffer;break;case"document":var f=new DOMParser;u=f.parseFromString(c,s);break;case"json":u=JSON.parse(c);break;default:u=c}setTimeout(function(){t&&t(u),i.manager.itemEnd(e)},0)}catch(t){setTimeout(function(){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)},0)}}else{loading[e]=[],loading[e].push({onLoad:t,onProgress:n,onError:r});var m=new XMLHttpRequest;for(var g in m.open("GET",e,!0),m.addEventListener("load",function(t){var n=this.response,r=loading[e];if(delete loading[e],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Cache.add(e,n);for(var a=0,o=r.length;a<o;a++){(s=r[a]).onLoad&&s.onLoad(n)}i.manager.itemEnd(e)}else{for(a=0,o=r.length;a<o;a++){var s;(s=r[a]).onError&&s.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}},!1),m.addEventListener("progress",function(t){for(var n=loading[e],r=0,i=n.length;r<i;r++){var a=n[r];a.onProgress&&a.onProgress(t)}},!1),m.addEventListener("error",function(t){var n=loading[e];delete loading[e];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)},!1),m.addEventListener("abort",function(t){var n=loading[e];delete loading[e];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)},!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(g,this.requestHeader[g]);m.send(null)}return i.manager.itemStart(e),m}loading[e].push({onLoad:t,onProgress:n,onError:r})},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}}),AnimationLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:AnimationLoader,load:function(e,t,n,r){var i=this,a=new FileLoader(i.manager);a.setPath(i.path),a.load(e,function(e){t(i.parse(JSON.parse(e)))},n,r)},parse:function(e){for(var t=[],n=0;n<e.length;n++){var r=AnimationClip.parse(e[n]);t.push(r)}return t}}),CompressedTextureLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:CompressedTextureLoader,load:function(e,t,n,r){var i=this,a=[],o=new CompressedTexture;o.image=a;var s=new FileLoader(this.manager);function l(l){s.load(e[l],function(e){var n=i.parse(e,!0);a[l]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(c+=1)&&(1===n.mipmapCount&&(o.minFilter=LinearFilter),o.format=n.format,o.needsUpdate=!0,t&&t(o))},n,r)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(e))for(var c=0,u=0,h=e.length;u<h;++u)l(u);else s.load(e,function(e){var n=i.parse(e,!0);if(n.isCubemap)for(var r=n.mipmaps.length/n.mipmapCount,s=0;s<r;s++){a[s]={mipmaps:[]};for(var l=0;l<n.mipmapCount;l++)a[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+l]),a[s].format=n.format,a[s].width=n.width,a[s].height=n.height}else o.image.width=n.width,o.image.height=n.height,o.mipmaps=n.mipmaps;1===n.mipmapCount&&(o.minFilter=LinearFilter),o.format=n.format,o.needsUpdate=!0,t&&t(o)},n,r);return o}}),DataTextureLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:DataTextureLoader,load:function(e,t,n,r){var i=this,a=new DataTexture,o=new FileLoader(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(e,function(e){var n=i.parse(e);n&&(void 0!==n.image?a.image=n.image:void 0!==n.data&&(a.image.width=n.width,a.image.height=n.height,a.image.data=n.data),a.wrapS=void 0!==n.wrapS?n.wrapS:ClampToEdgeWrapping,a.wrapT=void 0!==n.wrapT?n.wrapT:ClampToEdgeWrapping,a.magFilter=void 0!==n.magFilter?n.magFilter:LinearFilter,a.minFilter=void 0!==n.minFilter?n.minFilter:LinearFilter,a.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(a.format=n.format),void 0!==n.type&&(a.type=n.type),void 0!==n.mipmaps&&(a.mipmaps=n.mipmaps,a.minFilter=LinearMipmapLinearFilter),1===n.mipmapCount&&(a.minFilter=LinearFilter),a.needsUpdate=!0,t&&t(a,n))},n,r),a}}),ImageLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:ImageLoader,load:function(e,t,n,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Cache.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0),a;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1),Cache.add(e,this),t&&t(this),i.manager.itemEnd(e)}function l(t){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1),r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}return o.addEventListener("load",s,!1),o.addEventListener("error",l,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(e),o.src=e,o}}),CubeTextureLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:CubeTextureLoader,load:function(e,t,n,r){var i=new CubeTexture,a=new ImageLoader(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(n){a.load(e[n],function(e){i.images[n]=e,6===++o&&(i.needsUpdate=!0,t&&t(i))},void 0,r)}for(var l=0;l<e.length;++l)s(l);return i}}),TextureLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:TextureLoader,load:function(e,t,n,r){var i=new Texture,a=new ImageLoader(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(n){i.image=n;var r=e.search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/);i.format=r?RGBFormat:RGBAFormat,i.needsUpdate=!0,void 0!==t&&t(i)},n,r),i}}),Object.assign(Curve.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n,r=[],i=this.getPoint(0),a=0;for(r.push(0),n=1;n<=e;n++)a+=(t=this.getPoint(n/e)).distanceTo(i),r.push(a),i=t;return this.cacheArcLengths=r,r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,r=this.getLengths(),i=0,a=r.length;n=t||e*r[a-1];for(var o,s=0,l=a-1;s<=l;)if((o=r[i=Math.floor(s+(l-s)/2)]-n)<0)s=i+1;else{if(!(o>0)){l=i;break}l=i-1}if(r[i=l]===n)return i/(a-1);var c=r[i];return(i+(n-c)/(r[i+1]-c))/(a-1)},getTangent:function(e){var t=e-1e-4,n=e+1e-4;t<0&&(t=0),n>1&&(n=1);var r=this.getPoint(t);return this.getPoint(n).clone().sub(r).normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){var n,r,i,a=new Vector3,o=[],s=[],l=[],c=new Vector3,u=new Matrix4;for(n=0;n<=e;n++)r=n/e,o[n]=this.getTangentAt(r),o[n].normalize();s[0]=new Vector3,l[0]=new Vector3;var h=Number.MAX_VALUE,p=Math.abs(o[0].x),d=Math.abs(o[0].y),f=Math.abs(o[0].z);for(p<=h&&(h=p,a.set(1,0,0)),d<=h&&(h=d,a.set(0,1,0)),f<=h&&a.set(0,0,1),c.crossVectors(o[0],a).normalize(),s[0].crossVectors(o[0],c),l[0].crossVectors(o[0],s[0]),n=1;n<=e;n++)s[n]=s[n-1].clone(),l[n]=l[n-1].clone(),c.crossVectors(o[n-1],o[n]),c.length()>Number.EPSILON&&(c.normalize(),i=Math.acos(MathUtils.clamp(o[n-1].dot(o[n]),-1,1)),s[n].applyMatrix4(u.makeRotationAxis(c,i))),l[n].crossVectors(o[n],s[n]);if(!0===t)for(i=Math.acos(MathUtils.clamp(s[0].dot(s[e]),-1,1)),i/=e,o[0].dot(c.crossVectors(s[0],s[e]))>0&&(i=-i),n=1;n<=e;n++)s[n].applyMatrix4(u.makeRotationAxis(o[n],i*n)),l[n].crossVectors(o[n],s[n]);return{tangents:o,normals:s,binormals:l}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),EllipseCurve.prototype=Object.create(Curve.prototype),EllipseCurve.prototype.constructor=EllipseCurve,EllipseCurve.prototype.isEllipseCurve=!0,EllipseCurve.prototype.getPoint=function(e,t){for(var n=t||new Vector2,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<Number.EPSILON;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=a?0:r),!0!==this.aClockwise||a||(i===r?i=-r:i-=r);var o=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(o),l=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){var c=Math.cos(this.aRotation),u=Math.sin(this.aRotation),h=s-this.aX,p=l-this.aY;s=h*c-p*u+this.aX,l=h*u+p*c+this.aY}return n.set(s,l)},EllipseCurve.prototype.copy=function(e){return Curve.prototype.copy.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},EllipseCurve.prototype.toJSON=function(){var e=Curve.prototype.toJSON.call(this);return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e},EllipseCurve.prototype.fromJSON=function(e){return Curve.prototype.fromJSON.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},ArcCurve.prototype=Object.create(EllipseCurve.prototype),ArcCurve.prototype.constructor=ArcCurve,ArcCurve.prototype.isArcCurve=!0;var tmp=new Vector3,px=new CubicPoly,py=new CubicPoly,pz=new CubicPoly;function CatmullRomCurve3(e,t,n,r){Curve.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=r||.5}function CatmullRom(e,t,n,r,i){var a=.5*(r-t),o=.5*(i-n),s=e*e;return(2*n-2*r+a+o)*(e*s)+(-3*n+3*r-2*a-o)*s+a*e+n}function QuadraticBezierP0(e,t){var n=1-e;return n*n*t}function QuadraticBezierP1(e,t){return 2*(1-e)*e*t}function QuadraticBezierP2(e,t){return e*e*t}function QuadraticBezier(e,t,n,r){return QuadraticBezierP0(e,t)+QuadraticBezierP1(e,n)+QuadraticBezierP2(e,r)}function CubicBezierP0(e,t){var n=1-e;return n*n*n*t}function CubicBezierP1(e,t){var n=1-e;return 3*n*n*e*t}function CubicBezierP2(e,t){return 3*(1-e)*e*e*t}function CubicBezierP3(e,t){return e*e*e*t}function CubicBezier(e,t,n,r,i){return CubicBezierP0(e,t)+CubicBezierP1(e,n)+CubicBezierP2(e,r)+CubicBezierP3(e,i)}function CubicBezierCurve(e,t,n,r){Curve.call(this),this.type="CubicBezierCurve",this.v0=e||new Vector2,this.v1=t||new Vector2,this.v2=n||new Vector2,this.v3=r||new Vector2}function CubicBezierCurve3(e,t,n,r){Curve.call(this),this.type="CubicBezierCurve3",this.v0=e||new Vector3,this.v1=t||new Vector3,this.v2=n||new Vector3,this.v3=r||new Vector3}function LineCurve(e,t){Curve.call(this),this.type="LineCurve",this.v1=e||new Vector2,this.v2=t||new Vector2}function LineCurve3(e,t){Curve.call(this),this.type="LineCurve3",this.v1=e||new Vector3,this.v2=t||new Vector3}function QuadraticBezierCurve(e,t,n){Curve.call(this),this.type="QuadraticBezierCurve",this.v0=e||new Vector2,this.v1=t||new Vector2,this.v2=n||new Vector2}function QuadraticBezierCurve3(e,t,n){Curve.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new Vector3,this.v1=t||new Vector3,this.v2=n||new Vector3}function SplineCurve(e){Curve.call(this),this.type="SplineCurve",this.points=e||[]}CatmullRomCurve3.prototype=Object.create(Curve.prototype),CatmullRomCurve3.prototype.constructor=CatmullRomCurve3,CatmullRomCurve3.prototype.isCatmullRomCurve3=!0,CatmullRomCurve3.prototype.getPoint=function(e,t){var n,r,i,a,o=t||new Vector3,s=this.points,l=s.length,c=(l-(this.closed?0:1))*e,u=Math.floor(c),h=c-u;if(this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/l)+1)*l:0===h&&u===l-1&&(u=l-2,h=1),this.closed||u>0?n=s[(u-1)%l]:(tmp.subVectors(s[0],s[1]).add(s[0]),n=tmp),r=s[u%l],i=s[(u+1)%l],this.closed||u+2<l?a=s[(u+2)%l]:(tmp.subVectors(s[l-1],s[l-2]).add(s[l-1]),a=tmp),"centripetal"===this.curveType||"chordal"===this.curveType){var p="chordal"===this.curveType?.5:.25,d=Math.pow(n.distanceToSquared(r),p),f=Math.pow(r.distanceToSquared(i),p),m=Math.pow(i.distanceToSquared(a),p);f<1e-4&&(f=1),d<1e-4&&(d=f),m<1e-4&&(m=f),px.initNonuniformCatmullRom(n.x,r.x,i.x,a.x,d,f,m),py.initNonuniformCatmullRom(n.y,r.y,i.y,a.y,d,f,m),pz.initNonuniformCatmullRom(n.z,r.z,i.z,a.z,d,f,m)}else"catmullrom"===this.curveType&&(px.initCatmullRom(n.x,r.x,i.x,a.x,this.tension),py.initCatmullRom(n.y,r.y,i.y,a.y,this.tension),pz.initCatmullRom(n.z,r.z,i.z,a.z,this.tension));return o.set(px.calc(h),py.calc(h),pz.calc(h)),o},CatmullRomCurve3.prototype.copy=function(e){Curve.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},CatmullRomCurve3.prototype.toJSON=function(){var e=Curve.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},CatmullRomCurve3.prototype.fromJSON=function(e){Curve.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new Vector3).fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},CubicBezierCurve.prototype=Object.create(Curve.prototype),CubicBezierCurve.prototype.constructor=CubicBezierCurve,CubicBezierCurve.prototype.isCubicBezierCurve=!0,CubicBezierCurve.prototype.getPoint=function(e,t){var n=t||new Vector2,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(CubicBezier(e,r.x,i.x,a.x,o.x),CubicBezier(e,r.y,i.y,a.y,o.y)),n},CubicBezierCurve.prototype.copy=function(e){return Curve.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},CubicBezierCurve.prototype.toJSON=function(){var e=Curve.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},CubicBezierCurve.prototype.fromJSON=function(e){return Curve.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},CubicBezierCurve3.prototype=Object.create(Curve.prototype),CubicBezierCurve3.prototype.constructor=CubicBezierCurve3,CubicBezierCurve3.prototype.isCubicBezierCurve3=!0,CubicBezierCurve3.prototype.getPoint=function(e,t){var n=t||new Vector3,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(CubicBezier(e,r.x,i.x,a.x,o.x),CubicBezier(e,r.y,i.y,a.y,o.y),CubicBezier(e,r.z,i.z,a.z,o.z)),n},CubicBezierCurve3.prototype.copy=function(e){return Curve.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},CubicBezierCurve3.prototype.toJSON=function(){var e=Curve.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},CubicBezierCurve3.prototype.fromJSON=function(e){return Curve.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},LineCurve.prototype=Object.create(Curve.prototype),LineCurve.prototype.constructor=LineCurve,LineCurve.prototype.isLineCurve=!0,LineCurve.prototype.getPoint=function(e,t){var n=t||new Vector2;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},LineCurve.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},LineCurve.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},LineCurve.prototype.copy=function(e){return Curve.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},LineCurve.prototype.toJSON=function(){var e=Curve.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},LineCurve.prototype.fromJSON=function(e){return Curve.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},LineCurve3.prototype=Object.create(Curve.prototype),LineCurve3.prototype.constructor=LineCurve3,LineCurve3.prototype.isLineCurve3=!0,LineCurve3.prototype.getPoint=function(e,t){var n=t||new Vector3;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},LineCurve3.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},LineCurve3.prototype.copy=function(e){return Curve.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},LineCurve3.prototype.toJSON=function(){var e=Curve.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},LineCurve3.prototype.fromJSON=function(e){return Curve.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},QuadraticBezierCurve.prototype=Object.create(Curve.prototype),QuadraticBezierCurve.prototype.constructor=QuadraticBezierCurve,QuadraticBezierCurve.prototype.isQuadraticBezierCurve=!0,QuadraticBezierCurve.prototype.getPoint=function(e,t){var n=t||new Vector2,r=this.v0,i=this.v1,a=this.v2;return n.set(QuadraticBezier(e,r.x,i.x,a.x),QuadraticBezier(e,r.y,i.y,a.y)),n},QuadraticBezierCurve.prototype.copy=function(e){return Curve.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},QuadraticBezierCurve.prototype.toJSON=function(){var e=Curve.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},QuadraticBezierCurve.prototype.fromJSON=function(e){return Curve.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},QuadraticBezierCurve3.prototype=Object.create(Curve.prototype),QuadraticBezierCurve3.prototype.constructor=QuadraticBezierCurve3,QuadraticBezierCurve3.prototype.isQuadraticBezierCurve3=!0,QuadraticBezierCurve3.prototype.getPoint=function(e,t){var n=t||new Vector3,r=this.v0,i=this.v1,a=this.v2;return n.set(QuadraticBezier(e,r.x,i.x,a.x),QuadraticBezier(e,r.y,i.y,a.y),QuadraticBezier(e,r.z,i.z,a.z)),n},QuadraticBezierCurve3.prototype.copy=function(e){return Curve.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},QuadraticBezierCurve3.prototype.toJSON=function(){var e=Curve.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},QuadraticBezierCurve3.prototype.fromJSON=function(e){return Curve.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},SplineCurve.prototype=Object.create(Curve.prototype),SplineCurve.prototype.constructor=SplineCurve,SplineCurve.prototype.isSplineCurve=!0,SplineCurve.prototype.getPoint=function(e,t){var n=t||new Vector2,r=this.points,i=(r.length-1)*e,a=Math.floor(i),o=i-a,s=r[0===a?a:a-1],l=r[a],c=r[a>r.length-2?r.length-1:a+1],u=r[a>r.length-3?r.length-1:a+2];return n.set(CatmullRom(o,s.x,l.x,c.x,u.x),CatmullRom(o,s.y,l.y,c.y,u.y)),n},SplineCurve.prototype.copy=function(e){Curve.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this},SplineCurve.prototype.toJSON=function(){var e=Curve.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e},SplineCurve.prototype.fromJSON=function(e){Curve.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new Vector2).fromArray(r))}return this};var Curves=Object.freeze({__proto__:null,ArcCurve:ArcCurve,CatmullRomCurve3:CatmullRomCurve3,CubicBezierCurve:CubicBezierCurve,CubicBezierCurve3:CubicBezierCurve3,EllipseCurve:EllipseCurve,LineCurve:LineCurve,LineCurve3:LineCurve3,QuadraticBezierCurve:QuadraticBezierCurve,QuadraticBezierCurve3:QuadraticBezierCurve3,SplineCurve:SplineCurve});function CurvePath(){Curve.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Path(e){CurvePath.call(this),this.type="Path",this.currentPoint=new Vector2,e&&this.setFromPoints(e)}function Shape(e){Path.call(this,e),this.uuid=MathUtils.generateUUID(),this.type="Shape",this.holes=[]}function Light(e,t){Object3D.call(this),this.type="Light",this.color=new Color(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function HemisphereLight(e,t,n){Light.call(this,e,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(Object3D.DefaultUp),this.updateMatrix(),this.groundColor=new Color(t)}function LightShadow(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new Vector2(512,512),this.map=null,this.mapPass=null,this.matrix=new Matrix4,this._frustum=new Frustum,this._frameExtents=new Vector2(1,1),this._viewportCount=1,this._viewports=[new Vector4(0,0,1,1)]}function SpotLightShadow(){LightShadow.call(this,new PerspectiveCamera(50,1,.5,500))}function SpotLight(e,t,n,r,i,a){Light.call(this,e,t),this.type="SpotLight",this.position.copy(Object3D.DefaultUp),this.updateMatrix(),this.target=new Object3D,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==a?a:1,this.shadow=new SpotLightShadow}function PointLightShadow(){LightShadow.call(this,new PerspectiveCamera(90,1,.5,500)),this._frameExtents=new Vector2(4,2),this._viewportCount=6,this._viewports=[new Vector4(2,1,1,1),new Vector4(0,1,1,1),new Vector4(3,1,1,1),new Vector4(1,1,1,1),new Vector4(3,0,1,1),new Vector4(1,0,1,1)],this._cubeDirections=[new Vector3(1,0,0),new Vector3(-1,0,0),new Vector3(0,0,1),new Vector3(0,0,-1),new Vector3(0,1,0),new Vector3(0,-1,0)],this._cubeUps=[new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,0,1),new Vector3(0,0,-1)]}function PointLight(e,t,n,r){Light.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new PointLightShadow}function OrthographicCamera(e,t,n,r,i,a){Camera.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==e?e:-1,this.right=void 0!==t?t:1,this.top=void 0!==n?n:1,this.bottom=void 0!==r?r:-1,this.near=void 0!==i?i:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function DirectionalLightShadow(){LightShadow.call(this,new OrthographicCamera(-5,5,5,-5,.5,500))}function DirectionalLight(e,t){Light.call(this,e,t),this.type="DirectionalLight",this.position.copy(Object3D.DefaultUp),this.updateMatrix(),this.target=new Object3D,this.shadow=new DirectionalLightShadow}function AmbientLight(e,t){Light.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function RectAreaLight(e,t,n,r){Light.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}function MaterialLoader(e){Loader.call(this,e),this.textures={}}CurvePath.prototype=Object.assign(Object.create(Curve.prototype),{constructor:CurvePath,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new LineCurve(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=t){var i=n[r]-t,a=this.curves[r],o=a.getLength(),s=0===o?0:1-i/o;return a.getPointAt(s)}r++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e},getSpacedPoints:function(e){void 0===e&&(e=40);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,n=[],r=0,i=this.curves;r<i.length;r++)for(var a=i[r],o=a&&a.isEllipseCurve?2*e:a&&(a.isLineCurve||a.isLineCurve3)?1:a&&a.isSplineCurve?e*a.points.length:e,s=a.getPoints(o),l=0;l<s.length;l++){var c=s[l];t&&t.equals(c)||(n.push(c),t=c)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){Curve.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=Curve.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var r=this.curves[t];e.curves.push(r.toJSON())}return e},fromJSON:function(e){Curve.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push((new Curves[r.type]).fromJSON(r))}return this}}),Path.prototype=Object.assign(Object.create(CurvePath.prototype),{constructor:Path,setFromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this},moveTo:function(e,t){return this.currentPoint.set(e,t),this},lineTo:function(e,t){var n=new LineCurve(this.currentPoint.clone(),new Vector2(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this},quadraticCurveTo:function(e,t,n,r){var i=new QuadraticBezierCurve(this.currentPoint.clone(),new Vector2(e,t),new Vector2(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this},bezierCurveTo:function(e,t,n,r,i,a){var o=new CubicBezierCurve(this.currentPoint.clone(),new Vector2(e,t),new Vector2(n,r),new Vector2(i,a));return this.curves.push(o),this.currentPoint.set(i,a),this},splineThru:function(e){var t=new SplineCurve([this.currentPoint.clone()].concat(e));return this.curves.push(t),this.currentPoint.copy(e[e.length-1]),this},arc:function(e,t,n,r,i,a){var o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(e+o,t+s,n,r,i,a),this},absarc:function(e,t,n,r,i,a){return this.absellipse(e,t,n,n,r,i,a),this},ellipse:function(e,t,n,r,i,a,o,s){var l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+l,t+c,n,r,i,a,o,s),this},absellipse:function(e,t,n,r,i,a,o,s){var l=new EllipseCurve(e,t,n,r,i,a,o,s);if(this.curves.length>0){var c=l.getPoint(0);c.equals(this.currentPoint)||this.lineTo(c.x,c.y)}this.curves.push(l);var u=l.getPoint(1);return this.currentPoint.copy(u),this},copy:function(e){return CurvePath.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=CurvePath.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return CurvePath.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),Shape.prototype=Object.assign(Object.create(Path.prototype),{constructor:Shape,getPointsHoles:function(e){for(var t=[],n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t},extractPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},copy:function(e){Path.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push(r.clone())}return this},toJSON:function(){var e=Path.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var r=this.holes[t];e.holes.push(r.toJSON())}return e},fromJSON:function(e){Path.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push((new Path).fromJSON(r))}return this}}),Light.prototype=Object.assign(Object.create(Object3D.prototype),{constructor:Light,isLight:!0,copy:function(e){return Object3D.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=Object3D.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}),HemisphereLight.prototype=Object.assign(Object.create(Light.prototype),{constructor:HemisphereLight,isHemisphereLight:!0,copy:function(e){return Light.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(LightShadow.prototype,{_projScreenMatrix:new Matrix4,_lightPositionWorld:new Vector3,_lookTarget:new Vector3,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(e){var t=this.camera,n=this.matrix,r=this._projScreenMatrix,i=this._lookTarget,a=this._lightPositionWorld;a.setFromMatrixPosition(e.matrixWorld),t.position.copy(a),i.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(i),t.updateMatrixWorld(),r.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(r),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)},getViewport:function(e){return this._viewports[e]},getFrameExtents:function(){return this._frameExtents},copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}),SpotLightShadow.prototype=Object.assign(Object.create(LightShadow.prototype),{constructor:SpotLightShadow,isSpotLightShadow:!0,updateMatrices:function(e){var t=this.camera,n=2*MathUtils.RAD2DEG*e.angle,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;n===t.fov&&r===t.aspect&&i===t.far||(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),LightShadow.prototype.updateMatrices.call(this,e)}}),SpotLight.prototype=Object.assign(Object.create(Light.prototype),{constructor:SpotLight,isSpotLight:!0,copy:function(e){return Light.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),PointLightShadow.prototype=Object.assign(Object.create(LightShadow.prototype),{constructor:PointLightShadow,isPointLightShadow:!0,updateMatrices:function(e,t){void 0===t&&(t=0);var n=this.camera,r=this.matrix,i=this._lightPositionWorld,a=this._lookTarget,o=this._projScreenMatrix;i.setFromMatrixPosition(e.matrixWorld),n.position.copy(i),a.copy(n.position),a.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(a),n.updateMatrixWorld(),r.makeTranslation(-i.x,-i.y,-i.z),o.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(o)}}),PointLight.prototype=Object.assign(Object.create(Light.prototype),{constructor:PointLight,isPointLight:!0,copy:function(e){return Light.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),OrthographicCamera.prototype=Object.assign(Object.create(Camera.prototype),{constructor:OrthographicCamera,isOrthographicCamera:!0,copy:function(e,t){return Camera.prototype.copy.call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this},setViewOffset:function(e,t,n,r,i,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(null!==this.view&&this.view.enabled){var l=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a=(i+=l*this.view.offsetX)+l*this.view.width,s=(o-=c*this.view.offsetY)-c*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=Object3D.prototype.toJSON.call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}),DirectionalLightShadow.prototype=Object.assign(Object.create(LightShadow.prototype),{constructor:DirectionalLightShadow,isDirectionalLightShadow:!0,updateMatrices:function(e){LightShadow.prototype.updateMatrices.call(this,e)}}),DirectionalLight.prototype=Object.assign(Object.create(Light.prototype),{constructor:DirectionalLight,isDirectionalLight:!0,copy:function(e){return Light.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),AmbientLight.prototype=Object.assign(Object.create(Light.prototype),{constructor:AmbientLight,isAmbientLight:!0}),RectAreaLight.prototype=Object.assign(Object.create(Light.prototype),{constructor:RectAreaLight,isRectAreaLight:!0,copy:function(e){return Light.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=Light.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}),MaterialLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:MaterialLoader,load:function(e,t,n,r){var i=this,a=new FileLoader(i.manager);a.setPath(i.path),a.load(e,function(e){t(i.parse(JSON.parse(e)))},n,r)},parse:function(e){var t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}var r=new Materials[e.type];if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.sheen&&(r.sheen=(new Color).setHex(e.sheen)),void 0!==e.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&r.specular.setHex(e.specular),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearcoat&&(r.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(r.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.vertexColors&&(r.vertexColors=e.vertexColors),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.combine&&(r.combine=e.combine),void 0!==e.side&&(r.side=e.side),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(r.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(r.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(r.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(r.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(r.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(r.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(r.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(r.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),1!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.polygonOffset&&(r.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(r.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(r.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.skinning&&(r.skinning=e.skinning),void 0!==e.morphTargets&&(r.morphTargets=e.morphTargets),void 0!==e.morphNormals&&(r.morphNormals=e.morphNormals),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.toneMapped&&(r.toneMapped=e.toneMapped),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.uniforms)for(var i in e.uniforms){var a=e.uniforms[i];switch(r.uniforms[i]={},a.type){case"t":r.uniforms[i].value=n(a.value);break;case"c":r.uniforms[i].value=(new Color).setHex(a.value);break;case"v2":r.uniforms[i].value=(new Vector2).fromArray(a.value);break;case"v3":r.uniforms[i].value=(new Vector3).fromArray(a.value);break;case"v4":r.uniforms[i].value=(new Vector4).fromArray(a.value);break;case"m3":r.uniforms[i].value=(new Matrix3).fromArray(a.value);case"m4":r.uniforms[i].value=(new Matrix4).fromArray(a.value);break;default:r.uniforms[i].value=a.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(var o in e.extensions)r.extensions[o]=e.extensions[o];if(void 0!==e.shading&&(r.flatShading=1===e.shading),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap),r.transparent=!0),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){var s=e.normalScale;!1===Array.isArray(s)&&(s=[s,s]),r.normalScale=(new Vector2).fromArray(s)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new Vector2).fromArray(e.clearcoatNormalScale)),r},setTextures:function(e){return this.textures=e,this}});var LoaderUtils={decodeText:function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}},extractUrlBase:function(e){var t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)}};function InstancedBufferGeometry(){BufferGeometry.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function InstancedBufferAttribute(e,t,n,r){"number"==typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),BufferAttribute.call(this,e,t,n),this.meshPerAttribute=r||1}function BufferGeometryLoader(e){Loader.call(this,e)}InstancedBufferGeometry.prototype=Object.assign(Object.create(BufferGeometry.prototype),{constructor:InstancedBufferGeometry,isInstancedBufferGeometry:!0,copy:function(e){return BufferGeometry.prototype.copy.call(this,e),this.maxInstancedCount=e.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e=BufferGeometry.prototype.toJSON.call(this);return e.maxInstancedCount=this.maxInstancedCount,e.isInstancedBufferGeometry=!0,e}}),InstancedBufferAttribute.prototype=Object.assign(Object.create(BufferAttribute.prototype),{constructor:InstancedBufferAttribute,isInstancedBufferAttribute:!0,copy:function(e){return BufferAttribute.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},toJSON:function(){var e=BufferAttribute.prototype.toJSON.call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}),BufferGeometryLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:BufferGeometryLoader,load:function(e,t,n,r){var i=this,a=new FileLoader(i.manager);a.setPath(i.path),a.load(e,function(e){t(i.parse(JSON.parse(e)))},n,r)},parse:function(e){var t=e.isInstancedBufferGeometry?new InstancedBufferGeometry:new BufferGeometry,n=e.data.index;if(void 0!==n){var r=new TYPED_ARRAYS[n.type](n.array);t.setIndex(new BufferAttribute(r,1))}var i=e.data.attributes;for(var a in i){var o=i[a],s=(r=new TYPED_ARRAYS[o.type](o.array),new(o.isInstancedBufferAttribute?InstancedBufferAttribute:BufferAttribute)(r,o.itemSize,o.normalized));void 0!==o.name&&(s.name=o.name),t.setAttribute(a,s)}var l=e.data.morphAttributes;if(l)for(var a in l){for(var c=l[a],u=[],h=0,p=c.length;h<p;h++){o=c[h],s=new BufferAttribute(r=new TYPED_ARRAYS[o.type](o.array),o.itemSize,o.normalized);void 0!==o.name&&(s.name=o.name),u.push(s)}t.morphAttributes[a]=u}e.data.morphTargetsRelative&&(t.morphTargetsRelative=!0);var d=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==d){h=0;for(var f=d.length;h!==f;++h){var m=d[h];t.addGroup(m.start,m.count,m.materialIndex)}}var g=e.data.boundingSphere;if(void 0!==g){var v=new Vector3;void 0!==g.center&&v.fromArray(g.center),t.boundingSphere=new Sphere(v,g.radius)}return e.name&&(t.name=e.name),e.userData&&(t.userData=e.userData),t}});var TYPED_ARRAYS={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function ObjectLoader(e){Loader.call(this,e)}ObjectLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:ObjectLoader,load:function(e,t,n,r){var i=this,a=""===this.path?LoaderUtils.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;var o=new FileLoader(i.manager);o.setPath(this.path),o.load(e,function(n){var a=null;try{a=JSON.parse(n)}catch(t){return void 0!==r&&r(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}var o=a.metadata;void 0!==o&&void 0!==o.type&&"geometry"!==o.type.toLowerCase()?i.parse(a,t):console.error("THREE.ObjectLoader: Can't load "+e)},n,r)},parse:function(e,t){var n=this.parseShape(e.shapes),r=this.parseGeometries(e.geometries,n),i=this.parseImages(e.images,function(){void 0!==t&&t(s)}),a=this.parseTextures(e.textures,i),o=this.parseMaterials(e.materials,a),s=this.parseObject(e.object,r,o);return e.animations&&(s.animations=this.parseAnimations(e.animations)),void 0!==e.images&&0!==e.images.length||void 0!==t&&t(s),s},parseShape:function(e){var t={};if(void 0!==e)for(var n=0,r=e.length;n<r;n++){var i=(new Shape).fromJSON(e[n]);t[i.uuid]=i}return t},parseGeometries:function(e,t){var n={};if(void 0!==e)for(var r=new BufferGeometryLoader,i=0,a=e.length;i<a;i++){var o,s=e[i];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new Geometries[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new Geometries[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new Geometries[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new Geometries[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":o=new Geometries[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new Geometries[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":o=new Geometries[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new Geometries[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new Geometries[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new Geometries[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":o=new Geometries[s.type]((new Curves[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":o=new Geometries[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new Geometries[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var l=[],c=0,u=s.shapes.length;c<u;c++){var h=t[s.shapes[c]];l.push(h)}o=new Geometries[s.type](l,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(l=[],c=0,u=s.shapes.length;c<u;c++){h=t[s.shapes[c]];l.push(h)}var p=s.options.extrudePath;void 0!==p&&(s.options.extrudePath=(new Curves[p.type]).fromJSON(p)),o=new Geometries[s.type](l,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":o=r.parse(s);break;case"Geometry":if("THREE"in window&&"LegacyJSONLoader"in THREE)o=(new THREE.LegacyJSONLoader).parse(s,this.resourcePath).geometry;else console.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),!0===o.isBufferGeometry&&void 0!==s.userData&&(o.userData=s.userData),n[s.uuid]=o}return n},parseMaterials:function(e,t){var n={},r={};if(void 0!==e){var i=new MaterialLoader;i.setTextures(t);for(var a=0,o=e.length;a<o;a++){var s=e[a];if("MultiMaterial"===s.type){for(var l=[],c=0;c<s.materials.length;c++){var u=s.materials[c];void 0===n[u.uuid]&&(n[u.uuid]=i.parse(u)),l.push(n[u.uuid])}r[s.uuid]=l}else void 0===n[s.uuid]&&(n[s.uuid]=i.parse(s)),r[s.uuid]=n[s.uuid]}}return r},parseAnimations:function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],i=AnimationClip.parse(r);void 0!==r.uuid&&(i.uuid=r.uuid),t.push(i)}return t},parseImages:function(e,t){var n=this,r={};function i(e){return n.manager.itemStart(e),a.load(e,function(){n.manager.itemEnd(e)},void 0,function(){n.manager.itemError(e),n.manager.itemEnd(e)})}if(void 0!==e&&e.length>0){var a=new ImageLoader(new LoadingManager(t));a.setCrossOrigin(this.crossOrigin);for(var o=0,s=e.length;o<s;o++){var l=e[o],c=l.url;if(Array.isArray(c)){r[l.uuid]=[];for(var u=0,h=c.length;u<h;u++){var p=c[u],d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(p)?p:n.resourcePath+p;r[l.uuid].push(i(d))}}else{d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l.url)?l.url:n.resourcePath+l.url;r[l.uuid]=i(d)}}}return r},parseTextures:function(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var r={};if(void 0!==e)for(var i=0,a=e.length;i<a;i++){var o,s=e[i];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image),(o=Array.isArray(t[s.image])?new CubeTexture(t[s.image]):new Texture(t[s.image])).needsUpdate=!0,o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),void 0!==s.mapping&&(o.mapping=n(s.mapping,TEXTURE_MAPPING)),void 0!==s.offset&&o.offset.fromArray(s.offset),void 0!==s.repeat&&o.repeat.fromArray(s.repeat),void 0!==s.center&&o.center.fromArray(s.center),void 0!==s.rotation&&(o.rotation=s.rotation),void 0!==s.wrap&&(o.wrapS=n(s.wrap[0],TEXTURE_WRAPPING),o.wrapT=n(s.wrap[1],TEXTURE_WRAPPING)),void 0!==s.format&&(o.format=s.format),void 0!==s.type&&(o.type=s.type),void 0!==s.encoding&&(o.encoding=s.encoding),void 0!==s.minFilter&&(o.minFilter=n(s.minFilter,TEXTURE_FILTER)),void 0!==s.magFilter&&(o.magFilter=n(s.magFilter,TEXTURE_FILTER)),void 0!==s.anisotropy&&(o.anisotropy=s.anisotropy),void 0!==s.flipY&&(o.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(o.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(o.unpackAlignment=s.unpackAlignment),r[s.uuid]=o}return r},parseObject:function(e,t,n){var r;function i(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function a(e){if(void 0!==e){if(Array.isArray(e)){for(var t=[],r=0,i=e.length;r<i;r++){var a=e[r];void 0===n[a]&&console.warn("THREE.ObjectLoader: Undefined material",a),t.push(n[a])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}switch(e.type){case"Scene":r=new Scene,void 0!==e.background&&Number.isInteger(e.background)&&(r.background=new Color(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?r.fog=new Fog(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(r.fog=new FogExp2(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":r=new PerspectiveCamera(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(r.focus=e.focus),void 0!==e.zoom&&(r.zoom=e.zoom),void 0!==e.filmGauge&&(r.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(r.filmOffset=e.filmOffset),void 0!==e.view&&(r.view=Object.assign({},e.view));break;case"OrthographicCamera":r=new OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(r.zoom=e.zoom),void 0!==e.view&&(r.view=Object.assign({},e.view));break;case"AmbientLight":r=new AmbientLight(e.color,e.intensity);break;case"DirectionalLight":r=new DirectionalLight(e.color,e.intensity);break;case"PointLight":r=new PointLight(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":r=new RectAreaLight(e.color,e.intensity,e.width,e.height);break;case"SpotLight":r=new SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":r=new HemisphereLight(e.color,e.groundColor,e.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var o=i(e.geometry),s=a(e.material);r=o.bones&&o.bones.length>0?new SkinnedMesh(o,s):new Mesh(o,s);break;case"InstancedMesh":o=i(e.geometry),s=a(e.material);var l=e.count,c=e.instanceMatrix;(r=new InstancedMesh(o,s,l)).instanceMatrix=new BufferAttribute(new Float32Array(c.array),16);break;case"LOD":r=new LOD;break;case"Line":r=new Line(i(e.geometry),a(e.material),e.mode);break;case"LineLoop":r=new LineLoop(i(e.geometry),a(e.material));break;case"LineSegments":r=new LineSegments(i(e.geometry),a(e.material));break;case"PointCloud":case"Points":r=new Points(i(e.geometry),a(e.material));break;case"Sprite":r=new Sprite(a(e.material));break;case"Group":r=new Group;break;default:r=new Object3D}if(r.uuid=e.uuid,void 0!==e.name&&(r.name=e.name),void 0!==e.matrix?(r.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(r.matrixAutoUpdate=e.matrixAutoUpdate),r.matrixAutoUpdate&&r.matrix.decompose(r.position,r.quaternion,r.scale)):(void 0!==e.position&&r.position.fromArray(e.position),void 0!==e.rotation&&r.rotation.fromArray(e.rotation),void 0!==e.quaternion&&r.quaternion.fromArray(e.quaternion),void 0!==e.scale&&r.scale.fromArray(e.scale)),void 0!==e.castShadow&&(r.castShadow=e.castShadow),void 0!==e.receiveShadow&&(r.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(r.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(r.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&r.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(r.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.frustumCulled&&(r.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(r.renderOrder=e.renderOrder),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.layers&&(r.layers.mask=e.layers),void 0!==e.children)for(var u=e.children,h=0;h<u.length;h++)r.add(this.parseObject(u[h],t,n));if("LOD"===e.type){void 0!==e.autoUpdate&&(r.autoUpdate=e.autoUpdate);for(var p=e.levels,d=0;d<p.length;d++){var f=p[d],m=r.getObjectByProperty("uuid",f.object);void 0!==m&&r.addLevel(m,f.distance)}}return r}});var TEXTURE_MAPPING={UVMapping:UVMapping,CubeReflectionMapping:CubeReflectionMapping,CubeRefractionMapping:CubeRefractionMapping,EquirectangularReflectionMapping:EquirectangularReflectionMapping,EquirectangularRefractionMapping:EquirectangularRefractionMapping,SphericalReflectionMapping:SphericalReflectionMapping,CubeUVReflectionMapping:CubeUVReflectionMapping,CubeUVRefractionMapping:CubeUVRefractionMapping},TEXTURE_WRAPPING={RepeatWrapping:RepeatWrapping,ClampToEdgeWrapping:ClampToEdgeWrapping,MirroredRepeatWrapping:MirroredRepeatWrapping},TEXTURE_FILTER={NearestFilter:NearestFilter,NearestMipmapNearestFilter:NearestMipmapNearestFilter,NearestMipmapLinearFilter:NearestMipmapLinearFilter,LinearFilter:LinearFilter,LinearMipmapNearestFilter:LinearMipmapNearestFilter,LinearMipmapLinearFilter:LinearMipmapLinearFilter},_context;function ImageBitmapLoader(e){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),Loader.call(this,e),this.options=void 0}function ShapePath(){this.type="ShapePath",this.color=new Color,this.subPaths=[],this.currentPath=null}function Font(e){this.type="Font",this.data=e}function createPaths(e,t,n){for(var r=Array.from?Array.from(e):String(e).split(""),i=t/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,o=[],s=0,l=0,c=0;c<r.length;c++){var u=r[c];if("\n"===u)s=0,l-=a;else{var h=createPath(u,i,s,l,n);s+=h.offsetX,o.push(h.path)}}return o}function createPath(e,t,n,r,i){var a=i.glyphs[e]||i.glyphs["?"];if(a){var o,s,l,c,u,h,p,d,f=new ShapePath;if(a.o)for(var m=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),g=0,v=m.length;g<v;){switch(m[g++]){case"m":o=m[g++]*t+n,s=m[g++]*t+r,f.moveTo(o,s);break;case"l":o=m[g++]*t+n,s=m[g++]*t+r,f.lineTo(o,s);break;case"q":l=m[g++]*t+n,c=m[g++]*t+r,u=m[g++]*t+n,h=m[g++]*t+r,f.quadraticCurveTo(u,h,l,c);break;case"b":l=m[g++]*t+n,c=m[g++]*t+r,u=m[g++]*t+n,h=m[g++]*t+r,p=m[g++]*t+n,d=m[g++]*t+r,f.bezierCurveTo(u,h,p,d,l,c)}}return{offsetX:a.ha*t,path:f}}console.error('THREE.Font: character "'+e+'" does not exists in font family '+i.familyName+".")}function FontLoader(e){Loader.call(this,e)}ImageBitmapLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:ImageBitmapLoader,setOptions:function(e){return this.options=e,this},load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Cache.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0),a;fetch(e).then(function(e){return e.blob()}).then(function(e){return void 0===i.options?createImageBitmap(e):createImageBitmap(e,i.options)}).then(function(n){Cache.add(e,n),t&&t(n),i.manager.itemEnd(e)}).catch(function(t){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}),i.manager.itemStart(e)}}),Object.assign(ShapePath.prototype,{moveTo:function(e,t){return this.currentPath=new Path,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this},lineTo:function(e,t){return this.currentPath.lineTo(e,t),this},quadraticCurveTo:function(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this},bezierCurveTo:function(e,t,n,r,i,a){return this.currentPath.bezierCurveTo(e,t,n,r,i,a),this},splineThru:function(e){return this.currentPath.splineThru(e),this},toShapes:function(e,t){function n(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n],a=new Shape;a.curves=i.curves,t.push(a)}return t}function r(e,t){for(var n=t.length,r=!1,i=n-1,a=0;a<n;i=a++){var o=t[i],s=t[a],l=s.x-o.x,c=s.y-o.y;if(Math.abs(c)>Number.EPSILON){if(c<0&&(o=t[a],l=-l,s=t[i],c=-c),e.y<o.y||e.y>s.y)continue;if(e.y===o.y){if(e.x===o.x)return!0}else{var u=c*(e.x-o.x)-l*(e.y-o.y);if(0===u)return!0;if(u<0)continue;r=!r}}else{if(e.y!==o.y)continue;if(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x)return!0}}return r}var i=ShapeUtils.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===t)return n(a);var o,s,l,c=[];if(1===a.length)return s=a[0],(l=new Shape).curves=s.curves,c.push(l),c;var u=!i(a[0].getPoints());u=e?!u:u;var h,p,d=[],f=[],m=[],g=0;f[g]=void 0,m[g]=[];for(var v=0,y=a.length;v<y;v++)o=i(h=(s=a[v]).getPoints()),(o=e?!o:o)?(!u&&f[g]&&g++,f[g]={s:new Shape,p:h},f[g].s.curves=s.curves,u&&g++,m[g]=[]):m[g].push({h:s,p:h[0]});if(!f[0])return n(a);if(f.length>1){for(var x=!1,_=[],b=0,w=f.length;b<w;b++)d[b]=[];for(b=0,w=f.length;b<w;b++)for(var M=m[b],S=0;S<M.length;S++){for(var T=M[S],E=!0,C=0;C<f.length;C++)r(T.p,f[C].p)&&(b!==C&&_.push({froms:b,tos:C,hole:S}),E?(E=!1,d[C].push(T)):x=!0);E&&d[b].push(T)}_.length>0&&(x||(m=d))}v=0;for(var A=f.length;v<A;v++){l=f[v].s,c.push(l);for(var L=0,D=(p=m[v]).length;L<D;L++)l.holes.push(p[L].h)}return c}}),Object.assign(Font.prototype,{isFont:!0,generateShapes:function(e,t){void 0===t&&(t=100);for(var n=[],r=createPaths(e,t,this.data),i=0,a=r.length;i<a;i++)Array.prototype.push.apply(n,r[i].toShapes());return n}}),FontLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:FontLoader,load:function(e,t,n,r){var i=this,a=new FileLoader(this.manager);a.setPath(this.path),a.load(e,function(e){var n;try{n=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}var r=i.parse(n);t&&t(r)},n,r)},parse:function(e){return new Font(e)}});var AudioContext={getContext:function(){return void 0===_context&&(_context=new(window.AudioContext||window.webkitAudioContext)),_context},setContext:function(e){_context=e}};function AudioLoader(e){Loader.call(this,e)}function SphericalHarmonics3(){this.coefficients=[];for(var e=0;e<9;e++)this.coefficients.push(new Vector3)}function LightProbe(e,t){Light.call(this,void 0,t),this.sh=void 0!==e?e:new SphericalHarmonics3}function HemisphereLightProbe(e,t,n){LightProbe.call(this,void 0,n);var r=(new Color).set(e),i=(new Color).set(t),a=new Vector3(r.r,r.g,r.b),o=new Vector3(i.r,i.g,i.b),s=Math.sqrt(Math.PI),l=s*Math.sqrt(.75);this.sh.coefficients[0].copy(a).add(o).multiplyScalar(s),this.sh.coefficients[1].copy(a).sub(o).multiplyScalar(l)}function AmbientLightProbe(e,t){LightProbe.call(this,void 0,t);var n=(new Color).set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}AudioLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:AudioLoader,load:function(e,t,n,r){var i=new FileLoader(this.manager);i.setResponseType("arraybuffer"),i.setPath(this.path),i.load(e,function(e){var n=e.slice(0);AudioContext.getContext().decodeAudioData(n,function(e){t(e)})},n,r)}}),Object.assign(SphericalHarmonics3.prototype,{isSphericalHarmonics3:!0,set:function(e){for(var t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this},zero:function(){for(var e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this},getAt:function(e,t){var n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScale(a[1],.488603*r),t.addScale(a[2],.488603*i),t.addScale(a[3],.488603*n),t.addScale(a[4],n*r*1.092548),t.addScale(a[5],r*i*1.092548),t.addScale(a[6],.315392*(3*i*i-1)),t.addScale(a[7],n*i*1.092548),t.addScale(a[8],.546274*(n*n-r*r)),t},getIrradianceAt:function(e,t){var n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScale(a[1],1.023328*r),t.addScale(a[2],1.023328*i),t.addScale(a[3],1.023328*n),t.addScale(a[4],.858086*n*r),t.addScale(a[5],.858086*r*i),t.addScale(a[6],.743125*i*i-.247708),t.addScale(a[7],.858086*n*i),t.addScale(a[8],.429043*(n*n-r*r)),t},add:function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this},scale:function(e){for(var t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this},lerp:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this},equals:function(e){for(var t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0},copy:function(e){return this.set(e.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(e,t){void 0===t&&(t=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}}),Object.assign(SphericalHarmonics3,{getBasisAt:function(e,t){var n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}),LightProbe.prototype=Object.assign(Object.create(Light.prototype),{constructor:LightProbe,isLightProbe:!0,copy:function(e){return Light.prototype.copy.call(this,e),this.sh.copy(e.sh),this.intensity=e.intensity,this},toJSON:function(e){return Light.prototype.toJSON.call(this,e)}}),HemisphereLightProbe.prototype=Object.assign(Object.create(LightProbe.prototype),{constructor:HemisphereLightProbe,isHemisphereLightProbe:!0,copy:function(e){return LightProbe.prototype.copy.call(this,e),this},toJSON:function(e){return LightProbe.prototype.toJSON.call(this,e)}}),AmbientLightProbe.prototype=Object.assign(Object.create(LightProbe.prototype),{constructor:AmbientLightProbe,isAmbientLightProbe:!0,copy:function(e){return LightProbe.prototype.copy.call(this,e),this},toJSON:function(e){return LightProbe.prototype.toJSON.call(this,e)}});var _eyeRight=new Matrix4,_eyeLeft=new Matrix4;function StereoCamera(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}function Clock(e){this.autoStart=void 0===e||e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}Object.assign(StereoCamera.prototype,{update:function(e){var t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep;var n,r,i=e.projectionMatrix.clone(),a=t.eyeSep/2,o=a*t.near/t.focus,s=t.near*Math.tan(MathUtils.DEG2RAD*t.fov*.5)/t.zoom;_eyeLeft.elements[12]=-a,_eyeRight.elements[12]=a,n=-s*t.aspect+o,r=s*t.aspect+o,i.elements[0]=2*t.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraL.projectionMatrix.copy(i),n=-s*t.aspect-o,r=s*t.aspect-o,i.elements[0]=2*t.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraR.projectionMatrix.copy(i)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(_eyeLeft),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(_eyeRight)}}),Object.assign(Clock.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=("undefined"==typeof performance?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}});var _position$2=new Vector3,_quaternion$3=new Quaternion,_scale$1=new Vector3,_orientation=new Vector3;function AudioListener(){Object3D.call(this),this.type="AudioListener",this.context=AudioContext.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Clock}function Audio(e){Object3D.call(this),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this._startedAt=0,this._pausedAt=0,this.filters=[]}AudioListener.prototype=Object.assign(Object.create(Object3D.prototype),{constructor:AudioListener,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this},updateMatrixWorld:function(e){Object3D.prototype.updateMatrixWorld.call(this,e);var t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(_position$2,_quaternion$3,_scale$1),_orientation.set(0,0,-1).applyQuaternion(_quaternion$3),t.positionX){var r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(_position$2.x,r),t.positionY.linearRampToValueAtTime(_position$2.y,r),t.positionZ.linearRampToValueAtTime(_position$2.z,r),t.forwardX.linearRampToValueAtTime(_orientation.x,r),t.forwardY.linearRampToValueAtTime(_orientation.y,r),t.forwardZ.linearRampToValueAtTime(_orientation.z,r),t.upX.linearRampToValueAtTime(n.x,r),t.upY.linearRampToValueAtTime(n.y,r),t.upZ.linearRampToValueAtTime(n.z,r)}else t.setPosition(_position$2.x,_position$2.y,_position$2.z),t.setOrientation(_orientation.x,_orientation.y,_orientation.z,n.x,n.y,n.z)}}),Audio.prototype=Object.assign(Object.create(Object3D.prototype),{constructor:Audio,getOutput:function(){return this.gain},setNodeSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},setMediaElementSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this},setMediaStreamSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this},setBuffer:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(e){if(void 0===e&&(e=0),!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+e;var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._pausedAt+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._pausedAt=(this.context.currentTime-this._startedAt)*this.playbackRate,this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this._pausedAt=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(e){return e||(e=[]),!0===this.isPlaying?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},setDetune:function(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate:function(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},setLoopStart:function(e){return this.loopStart=e,this},setLoopEnd:function(e){return this.loopEnd=e,this},getVolume:function(){return this.gain.gain.value},setVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}});var _position$3=new Vector3,_quaternion$4=new Quaternion,_scale$2=new Vector3,_orientation$1=new Vector3;function PositionalAudio(e){Audio.call(this,e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function AudioAnalyser(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function PropertyMixer(e,t,n){this.binding=e,this.valueSize=n;var r,i=Float64Array;switch(t){case"quaternion":r=this._slerp;break;case"string":case"bool":i=Array,r=this._select;break;default:r=this._lerp}this.buffer=new i(4*n),this._mixBufferRegion=r,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}PositionalAudio.prototype=Object.assign(Object.create(Audio.prototype),{constructor:PositionalAudio,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(e){return this.panner.refDistance=e,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(e){return this.panner.rolloffFactor=e,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(e){return this.panner.distanceModel=e,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(e){return this.panner.maxDistance=e,this},setDirectionalCone:function(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(e){if(Object3D.prototype.updateMatrixWorld.call(this,e),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(_position$3,_quaternion$4,_scale$2),_orientation$1.set(0,0,1).applyQuaternion(_quaternion$4);var t=this.panner;if(t.positionX){var n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(_position$3.x,n),t.positionY.linearRampToValueAtTime(_position$3.y,n),t.positionZ.linearRampToValueAtTime(_position$3.z,n),t.orientationX.linearRampToValueAtTime(_orientation$1.x,n),t.orientationY.linearRampToValueAtTime(_orientation$1.y,n),t.orientationZ.linearRampToValueAtTime(_orientation$1.z,n)}else t.setPosition(_position$3.x,_position$3.y,_position$3.z),t.setOrientation(_orientation$1.x,_orientation$1.y,_orientation$1.z)}}}),Object.assign(AudioAnalyser.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),n=0;n<t.length;n++)e+=t[n];return e/t.length}}),Object.assign(PropertyMixer.prototype,{accumulate:function(e,t){var n=this.buffer,r=this.valueSize,i=e*r+r,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==r;++o)n[i+o]=n[o];a=t}else{var s=t/(a+=t);this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=a},apply:function(e){var t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,i<1){var o=3*t;this._mixBufferRegion(n,r,o,1-i,t)}for(var s=t,l=t+t;s!==l;++s)if(n[s]!==n[s+t]){a.setValue(n,r);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,r=3*n;e.getValue(t,r);for(var i=n,a=r;i!==a;++i)t[i]=t[r+i%n];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,t,n,r,i){if(r>=.5)for(var a=0;a!==i;++a)e[t+a]=e[n+a]},_slerp:function(e,t,n,r){Quaternion.slerpFlat(e,t,e,t,e,n,r)},_lerp:function(e,t,n,r,i){for(var a=1-r,o=0;o!==i;++o){var s=t+o;e[s]=e[s]*a+e[n+o]*r}}});var _RESERVED_CHARS_RE="\\[\\]\\.:\\/",_reservedRe=new RegExp("["+_RESERVED_CHARS_RE+"]","g"),_wordChar="[^"+_RESERVED_CHARS_RE+"]",_wordCharOrDot="[^"+_RESERVED_CHARS_RE.replace("\\.","")+"]",_directoryRe=/((?:WC+[\/:])*)/.source.replace("WC",_wordChar),_nodeRe=/(WCOD+)?/.source.replace("WCOD",_wordCharOrDot),_objectRe=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",_wordChar),_propertyRe=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",_wordChar),_trackRe=new RegExp("^"+_directoryRe+_nodeRe+_objectRe+_propertyRe+"$"),_supportedObjectNames=["material","materials","bones"];function Composite(e,t,n){var r=n||PropertyBinding.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function PropertyBinding(e,t,n){this.path=t,this.parsedPath=n||PropertyBinding.parseTrackName(t),this.node=PropertyBinding.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function AnimationObjectGroup(){this.uuid=MathUtils.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}function AnimationAction(e,t,n){this._mixer=e,this._clip=t,this._localRoot=n||null;for(var r=t.tracks,i=r.length,a=new Array(i),o={endingStart:ZeroCurvatureEnding,endingEnd:ZeroCurvatureEnding},s=0;s!==i;++s){var l=r[s].createInterpolant(null);a[s]=l,l.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(i),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=LoopRepeat,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function AnimationMixer(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Uniform(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}function InstancedInterleavedBuffer(e,t,n){InterleavedBuffer.call(this,e,t),this.meshPerAttribute=n||1}function Raycaster(e,t,n,r){this.ray=new Ray(e,t),this.near=n||0,this.far=r||1/0,this.camera=null,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function ascSort(e,t){return e.distance-t.distance}function intersectObject(e,t,n,r){if(!1!==e.visible&&(e.raycast(t,n),!0===r))for(var i=e.children,a=0,o=i.length;a<o;a++)intersectObject(i[a],t,n,!0)}function Spherical(e,t,n){return this.radius=void 0!==e?e:1,this.phi=void 0!==t?t:0,this.theta=void 0!==n?n:0,this}function Cylindrical(e,t,n){return this.radius=void 0!==e?e:1,this.theta=void 0!==t?t:0,this.y=void 0!==n?n:0,this}Object.assign(Composite.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(PropertyBinding,{Composite:Composite,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new PropertyBinding.Composite(e,t,n):new PropertyBinding(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(_reservedRe,"")},parseTrackName:function(e){var t=_trackRe.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==_supportedObjectNames.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n},findNode:function(e,t){if(!t||""===t||"root"===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){var r=function(e){for(var n=0;n<e.length;n++){var i=e[n];if(i.name===t||i.uuid===t)return i;var a=r(i.children);if(a)return a}return null},i=r(e.children);if(i)return i}return null}}),Object.assign(PropertyBinding.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)e[t++]=n[r]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.targetObject[this.propertyName]=e[t]},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,r=t.propertyName,i=t.propertyIndex;if(e||(e=PropertyBinding.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,e){if(n){var a=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(var o=0;o<e.length;o++)if(e[o].name===a){a=o;break}break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==a){if(void 0===e[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[a]}}var s=e[r];if(void 0!==s){var l=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?l=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(l=this.Versioning.MatrixWorldNeedsUpdate);var c=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(o=0;o<this.node.geometry.morphAttributes.position.length;o++)if(e.geometry.morphAttributes.position[o].name===i){i=o;break}}else{if(!e.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(o=0;o<this.node.geometry.morphTargets.length;o++)if(e.geometry.morphTargets[o].name===i){i=o;break}}}c=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(c=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(c=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][l]}else{var u=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+r+" but it wasn't found.",e)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(PropertyBinding.prototype,{_getValue_unbound:PropertyBinding.prototype.getValue,_setValue_unbound:PropertyBinding.prototype.setValue}),Object.assign(AnimationObjectGroup.prototype,{isAnimationObjectGroup:!0,add:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._paths,a=this._parsedPaths,o=this._bindings,s=o.length,l=void 0,c=0,u=arguments.length;c!==u;++c){var h=arguments[c],p=h.uuid,d=r[p];if(void 0===d){d=t++,r[p]=d,e.push(h);for(var f=0,m=s;f!==m;++f)o[f].push(new PropertyBinding(h,i[f],a[f]))}else if(d<n){l=e[d];var g=--n,v=e[g];r[v.uuid]=d,e[d]=v,r[p]=g,e[g]=h;for(f=0,m=s;f!==m;++f){var y=o[f],x=y[g],_=y[d];y[d]=x,void 0===_&&(_=new PropertyBinding(h,i[f],a[f])),y[g]=_}}else e[d]!==l&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var e=this._objects,t=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,i=r.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],l=s.uuid,c=n[l];if(void 0!==c&&c>=t){var u=t++,h=e[u];n[h.uuid]=c,e[c]=h,n[l]=u,e[u]=s;for(var p=0,d=i;p!==d;++p){var f=r[p],m=f[u],g=f[c];f[c]=m,f[u]=g}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._bindings,a=i.length,o=0,s=arguments.length;o!==s;++o){var l=arguments[o].uuid,c=r[l];if(void 0!==c)if(delete r[l],c<n){var u=--n,h=e[u],p=e[v=--t];r[h.uuid]=c,e[c]=h,r[p.uuid]=u,e[u]=p,e.pop();for(var d=0,f=a;d!==f;++d){var m=(y=i[d])[u],g=y[v];y[c]=m,y[u]=g,y.pop()}}else{var v;r[(p=e[v=--t]).uuid]=c,e[c]=p,e.pop();for(d=0,f=a;d!==f;++d){var y;(y=i[d])[c]=y[v],y.pop()}}}this.nCachedObjects_=n},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(void 0!==r)return i[r];var a=this._paths,o=this._parsedPaths,s=this._objects,l=s.length,c=this.nCachedObjects_,u=new Array(l);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(u);for(var h=c,p=s.length;h!==p;++h){var d=s[h];u[h]=new PropertyBinding(d,e,t)}return u},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){var r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];t[e[o]]=n,a[n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}}),Object.assign(AnimationAction.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(e){return this._startTime=e,this},setLoop:function(e,t){return this.loop=e,this.repetitions=t,this},setEffectiveWeight:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(e){return this._scheduleFading(e,0,1)},fadeOut:function(e){return this._scheduleFading(e,1,0)},crossFadeFrom:function(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){var r=this._clip.duration,i=e._clip.duration,a=i/r,o=r/i;e.warp(1,a,t),this.warp(o,1,t)}return this},crossFadeTo:function(e,t,n){return e.crossFadeFrom(this,t,n)},stopFading:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},setEffectiveTimeScale:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},syncWith:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},halt:function(e){return this.warp(this._effectiveTimeScale,0,e)},warp:function(e,t,n){var r=this._mixer,i=r.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,l=a.sampleValues;return s[0]=i,s[1]=i+n,l[0]=e/o,l[1]=t/o,this},stopWarping:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(e,t,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var a=(e-i)*n;if(a<0||0===n)return;this._startTime=null,t=n*a}t*=this._updateTimeScale(e);var o=this._updateTime(t),s=this._updateWeight(e);if(s>0)for(var l=this._interpolants,c=this._propertyBindings,u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(r,s)}else this._updateWeight(e)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e,n=this._clip.duration,r=this.loop,i=this._loopCount,a=r===LoopPingPong;if(0===e)return-1===i?t:a&&1==(1&i)?n-t:t;if(r===LoopOnce){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(t>=n)t=n;else{if(!(t<0)){this.time=t;break e}t=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),t>=n||t<0){var o=Math.floor(t/n);t-=n*o,i+=Math.abs(o);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=e>0?n:0,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var l=e<0;this._setEndings(l,!l,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=t,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=t;if(a&&1==(1&i))return n-t}return t},_setEndings:function(e,t,n){var r=this._interpolantSettings;n?(r.endingStart=ZeroSlopeEnding,r.endingEnd=ZeroSlopeEnding):(r.endingStart=e?this.zeroSlopeAtStart?ZeroSlopeEnding:ZeroCurvatureEnding:WrapAroundEnding,r.endingEnd=t?this.zeroSlopeAtEnd?ZeroSlopeEnding:ZeroCurvatureEnding:WrapAroundEnding)},_scheduleFading:function(e,t,n){var r=this._mixer,i=r.time,a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}}),AnimationMixer.prototype=Object.assign(Object.create(EventDispatcher.prototype),{constructor:AnimationMixer,_bindAction:function(e,t){var n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,l=this._bindingsByRootAndName,c=l[s];void 0===c&&(c={},l[s]=c);for(var u=0;u!==i;++u){var h=r[u],p=h.name,d=c[p];if(void 0!==d)a[u]=d;else{if(void 0!==(d=a[u])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,p));continue}var f=t&&t._propertyBindings[u].binding.parsedPath;++(d=new PropertyMixer(PropertyBinding.create(n,p,f),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(d,s,p),a[u]=d}o[u].resultBuffer=d.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}for(var i=e._propertyBindings,a=0,o=i.length;a!==o;++a){var s=i[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&t<this._nActiveActions},_addInactiveAction:function(e,t,n){var r=this._actions,i=this._actionsByClip,a=i[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=a;else{var o=a.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=r.length,r.push(e),a.actionByRoot[n]=e},_removeInactiveAction:function(e){var t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;var i=e._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,l=s[s.length-1],c=e._byClipCacheIndex;l._byClipCacheIndex=c,s[c]=l,s.pop(),e._byClipCacheIndex=null,delete o.actionByRoot[(e._localRoot||this._root).uuid],0===s.length&&delete a[i],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(e){var t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackAction:function(e){var t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_addInactiveBinding:function(e,t,n){var r=this._bindingsByRootAndName,i=r[t],a=this._bindings;void 0===i&&(i={},r[t]=i),i[n]=e,e._cacheIndex=a.length,a.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,a=this._bindingsByRootAndName,o=a[r],s=t[t.length-1],l=e._cacheIndex;s._cacheIndex=l,t[l]=s,t.pop(),delete o[i],0===Object.keys(o).length&&delete a[r]},_lendBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return void 0===n&&((n=new LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=t,e[t]=n),n},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];e.__cacheIndex=r,t[r]=e,i.__cacheIndex=n,t[n]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t){var n=t||this._root,r=n.uuid,i="string"==typeof e?AnimationClip.findByName(n,e):e,a=null!==i?i.uuid:e,o=this._actionsByClip[a],s=null;if(void 0!==o){var l=o.actionByRoot[r];if(void 0!==l)return l;s=o.knownActions[0],null===i&&(i=s._clip)}if(null===i)return null;var c=new AnimationAction(this,i,t);return this._bindAction(c,s),this._addInactiveAction(c,a,r),c},existingAction:function(e,t){var n=t||this._root,r=n.uuid,i="string"==typeof e?AnimationClip.findByName(n,e):e,a=i?i.uuid:e,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[r]||null},stopAllAction:function(){var e=this._actions,t=this._nActiveActions,n=this._bindings,r=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var i=0;i!==t;++i)e[i].reset();for(i=0;i!==r;++i)n[i].useCount=0;return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1,o=0;o!==n;++o){t[o]._update(r,e,i,a)}var s=this._bindings,l=this._nActiveBindings;for(o=0;o!==l;++o)s[o].apply(a);return this},setTime:function(e){this.time=0;for(var t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,n=e.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){for(var a=i.knownActions,o=0,s=a.length;o!==s;++o){var l=a[o];this._deactivateAction(l);var c=l._cacheIndex,u=t[t.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,u._cacheIndex=c,t[c]=u,t.pop(),this._removeInactiveBindingsForAction(l)}delete r[n]}},uncacheRoot:function(e){var t=e.uuid,n=this._actionsByClip;for(var r in n){var i=n[r].actionByRoot[t];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}var a=this._bindingsByRootAndName[t];if(void 0!==a)for(var o in a){var s=a[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(e,t){var n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),Uniform.prototype.clone=function(){return new Uniform(void 0===this.value.clone?this.value:this.value.clone())},InstancedInterleavedBuffer.prototype=Object.assign(Object.create(InterleavedBuffer.prototype),{constructor:InstancedInterleavedBuffer,isInstancedInterleavedBuffer:!0,copy:function(e){return InterleavedBuffer.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),Object.assign(Raycaster.prototype,{linePrecision:1,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,t,n){var r=n||[];return intersectObject(e,this,r,t),r.sort(ascSort),r},intersectObjects:function(e,t,n){var r=n||[];if(!1===Array.isArray(e))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var i=0,a=e.length;i<a;i++)intersectObject(e[i],this,r,t);return r.sort(ascSort),r}}),Object.assign(Spherical.prototype,{set:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(MathUtils.clamp(t/this.radius,-1,1))),this}}),Object.assign(Cylindrical.prototype,{set:function(e,t,n){return this.radius=e,this.theta=t,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}});var _vector$7=new Vector2;function Box2(e,t){this.min=void 0!==e?e:new Vector2(1/0,1/0),this.max=void 0!==t?t:new Vector2(-1/0,-1/0)}Object.assign(Box2.prototype,{set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){var n=_vector$7.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box2: .getCenter() target is now required"),e=new Vector2),this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box2: .getSize() target is now required"),e=new Vector2),this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new Vector2),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new Vector2),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return _vector$7.copy(e).clamp(this.min,this.max).sub(e).length()},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var _startP=new Vector3,_startEnd=new Vector3;function Line3(e,t){this.start=void 0!==e?e:new Vector3,this.end=void 0!==t?t:new Vector3}function ImmediateRenderObject(e){Object3D.call(this),this.material=e,this.render=function(){}}Object.assign(Line3.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new Vector3),e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new Vector3),e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new Vector3),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(e,t){_startP.subVectors(e,this.start),_startEnd.subVectors(this.end,this.start);var n=_startEnd.dot(_startEnd),r=_startEnd.dot(_startP)/n;return t&&(r=MathUtils.clamp(r,0,1)),r},closestPointToPoint:function(e,t,n){var r=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Vector3),this.delta(n).multiplyScalar(r).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),ImmediateRenderObject.prototype=Object.create(Object3D.prototype),ImmediateRenderObject.prototype.constructor=ImmediateRenderObject,ImmediateRenderObject.prototype.isImmediateRenderObject=!0;var _vector$8=new Vector3;function SpotLightHelper(e,t){Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var n=new BufferGeometry,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,a=1;i<32;i++,a++){var o=i/32*Math.PI*2,s=a/32*Math.PI*2;r.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1)}n.setAttribute("position",new Float32BufferAttribute(r,3));var l=new LineBasicMaterial({fog:!1});this.cone=new LineSegments(n,l),this.add(this.cone),this.update()}SpotLightHelper.prototype=Object.create(Object3D.prototype),SpotLightHelper.prototype.constructor=SpotLightHelper,SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},SpotLightHelper.prototype.update=function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),_vector$8.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(_vector$8),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var _vector$9=new Vector3,_boneMatrix=new Matrix4,_matrixWorldInv=new Matrix4;function getBoneList(e){var t=[];e&&e.isBone&&t.push(e);for(var n=0;n<e.children.length;n++)t.push.apply(t,getBoneList(e.children[n]));return t}function SkeletonHelper(e){for(var t=getBoneList(e),n=new BufferGeometry,r=[],i=[],a=new Color(0,0,1),o=new Color(0,1,0),s=0;s<t.length;s++){var l=t[s];l.parent&&l.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(a.r,a.g,a.b),i.push(o.r,o.g,o.b))}n.setAttribute("position",new Float32BufferAttribute(r,3)),n.setAttribute("color",new Float32BufferAttribute(i,3));var c=new LineBasicMaterial({vertexColors:VertexColors,depthTest:!1,depthWrite:!1,transparent:!0});LineSegments.call(this,n,c),this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}function PointLightHelper(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n;var r=new SphereBufferGeometry(t,4,2),i=new MeshBasicMaterial({wireframe:!0,fog:!1});Mesh.call(this,r,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}SkeletonHelper.prototype=Object.create(LineSegments.prototype),SkeletonHelper.prototype.constructor=SkeletonHelper,SkeletonHelper.prototype.updateMatrixWorld=function(e){var t=this.bones,n=this.geometry,r=n.getAttribute("position");_matrixWorldInv.getInverse(this.root.matrixWorld);for(var i=0,a=0;i<t.length;i++){var o=t[i];o.parent&&o.parent.isBone&&(_boneMatrix.multiplyMatrices(_matrixWorldInv,o.matrixWorld),_vector$9.setFromMatrixPosition(_boneMatrix),r.setXYZ(a,_vector$9.x,_vector$9.y,_vector$9.z),_boneMatrix.multiplyMatrices(_matrixWorldInv,o.parent.matrixWorld),_vector$9.setFromMatrixPosition(_boneMatrix),r.setXYZ(a+1,_vector$9.x,_vector$9.y,_vector$9.z),a+=2)}n.getAttribute("position").needsUpdate=!0,Object3D.prototype.updateMatrixWorld.call(this,e)},PointLightHelper.prototype=Object.create(Mesh.prototype),PointLightHelper.prototype.constructor=PointLightHelper,PointLightHelper.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},PointLightHelper.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};var _vector$a=new Vector3,_color1=new Color,_color2=new Color;function HemisphereLightHelper(e,t,n){Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new OctahedronBufferGeometry(t);r.rotateY(.5*Math.PI),this.material=new MeshBasicMaterial({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=VertexColors);var i=r.getAttribute("position"),a=new Float32Array(3*i.count);r.setAttribute("color",new BufferAttribute(a,3)),this.add(new Mesh(r,this.material)),this.update()}function GridHelper(e,t,n,r){e=e||10,t=t||10,n=new Color(void 0!==n?n:4473924),r=new Color(void 0!==r?r:8947848);for(var i=t/2,a=e/t,o=e/2,s=[],l=[],c=0,u=0,h=-o;c<=t;c++,h+=a){s.push(-o,0,h,o,0,h),s.push(h,0,-o,h,0,o);var p=c===i?n:r;p.toArray(l,u),u+=3,p.toArray(l,u),u+=3,p.toArray(l,u),u+=3,p.toArray(l,u),u+=3}var d=new BufferGeometry;d.setAttribute("position",new Float32BufferAttribute(s,3)),d.setAttribute("color",new Float32BufferAttribute(l,3));var f=new LineBasicMaterial({vertexColors:VertexColors});LineSegments.call(this,d,f)}function PolarGridHelper(e,t,n,r,i,a){e=e||10,t=t||16,n=n||8,r=r||64,i=new Color(void 0!==i?i:4473924),a=new Color(void 0!==a?a:8947848);var o,s,l,c,u,h,p,d=[],f=[];for(c=0;c<=t;c++)l=c/t*(2*Math.PI),o=Math.sin(l)*e,s=Math.cos(l)*e,d.push(0,0,0),d.push(o,0,s),p=1&c?i:a,f.push(p.r,p.g,p.b),f.push(p.r,p.g,p.b);for(c=0;c<=n;c++)for(p=1&c?i:a,h=e-e/n*c,u=0;u<r;u++)l=u/r*(2*Math.PI),o=Math.sin(l)*h,s=Math.cos(l)*h,d.push(o,0,s),f.push(p.r,p.g,p.b),l=(u+1)/r*(2*Math.PI),o=Math.sin(l)*h,s=Math.cos(l)*h,d.push(o,0,s),f.push(p.r,p.g,p.b);var m=new BufferGeometry;m.setAttribute("position",new Float32BufferAttribute(d,3)),m.setAttribute("color",new Float32BufferAttribute(f,3));var g=new LineBasicMaterial({vertexColors:VertexColors});LineSegments.call(this,m,g)}HemisphereLightHelper.prototype=Object.create(Object3D.prototype),HemisphereLightHelper.prototype.constructor=HemisphereLightHelper,HemisphereLightHelper.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},HemisphereLightHelper.prototype.update=function(){var e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var t=e.geometry.getAttribute("color");_color1.copy(this.light.color),_color2.copy(this.light.groundColor);for(var n=0,r=t.count;n<r;n++){var i=n<r/2?_color1:_color2;t.setXYZ(n,i.r,i.g,i.b)}t.needsUpdate=!0}e.lookAt(_vector$a.setFromMatrixPosition(this.light.matrixWorld).negate())},GridHelper.prototype=Object.assign(Object.create(LineSegments.prototype),{constructor:GridHelper,copy:function(e){return LineSegments.prototype.copy.call(this,e),this.geometry.copy(e.geometry),this.material.copy(e.material),this},clone:function(){return(new this.constructor).copy(this)}}),PolarGridHelper.prototype=Object.create(LineSegments.prototype),PolarGridHelper.prototype.constructor=PolarGridHelper;var _v1$5=new Vector3,_v2$3=new Vector3,_v3$1=new Vector3;function DirectionalLightHelper(e,t,n){Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===t&&(t=1);var r=new BufferGeometry;r.setAttribute("position",new Float32BufferAttribute([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var i=new LineBasicMaterial({fog:!1});this.lightPlane=new Line(r,i),this.add(this.lightPlane),(r=new BufferGeometry).setAttribute("position",new Float32BufferAttribute([0,0,0,0,0,1],3)),this.targetLine=new Line(r,i),this.add(this.targetLine),this.update()}DirectionalLightHelper.prototype=Object.create(Object3D.prototype),DirectionalLightHelper.prototype.constructor=DirectionalLightHelper,DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},DirectionalLightHelper.prototype.update=function(){_v1$5.setFromMatrixPosition(this.light.matrixWorld),_v2$3.setFromMatrixPosition(this.light.target.matrixWorld),_v3$1.subVectors(_v2$3,_v1$5),this.lightPlane.lookAt(_v2$3),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(_v2$3),this.targetLine.scale.z=_v3$1.length()};var _vector$b=new Vector3,_camera=new Camera;function CameraHelper(e){var t=new BufferGeometry,n=new LineBasicMaterial({color:16777215,vertexColors:FaceColors}),r=[],i=[],a={},o=new Color(16755200),s=new Color(16711680),l=new Color(43775),c=new Color(16777215),u=new Color(3355443);function h(e,t,n){p(e,n),p(t,n)}function p(e,t){r.push(0,0,0),i.push(t.r,t.g,t.b),void 0===a[e]&&(a[e]=[]),a[e].push(r.length/3-1)}h("n1","n2",o),h("n2","n4",o),h("n4","n3",o),h("n3","n1",o),h("f1","f2",o),h("f2","f4",o),h("f4","f3",o),h("f3","f1",o),h("n1","f1",o),h("n2","f2",o),h("n3","f3",o),h("n4","f4",o),h("p","n1",s),h("p","n2",s),h("p","n3",s),h("p","n4",s),h("u1","u2",l),h("u2","u3",l),h("u3","u1",l),h("c","t",c),h("p","c",u),h("cn1","cn2",u),h("cn3","cn4",u),h("cf1","cf2",u),h("cf3","cf4",u),t.setAttribute("position",new Float32BufferAttribute(r,3)),t.setAttribute("color",new Float32BufferAttribute(i,3)),LineSegments.call(this,t,n),this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}function setPoint(e,t,n,r,i,a,o){_vector$b.set(i,a,o).unproject(r);var s=t[e];if(void 0!==s)for(var l=n.getAttribute("position"),c=0,u=s.length;c<u;c++)l.setXYZ(s[c],_vector$b.x,_vector$b.y,_vector$b.z)}CameraHelper.prototype=Object.create(LineSegments.prototype),CameraHelper.prototype.constructor=CameraHelper,CameraHelper.prototype.update=function(){var e=this.geometry,t=this.pointMap;_camera.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),setPoint("c",t,e,_camera,0,0,-1),setPoint("t",t,e,_camera,0,0,1),setPoint("n1",t,e,_camera,-1,-1,-1),setPoint("n2",t,e,_camera,1,-1,-1),setPoint("n3",t,e,_camera,-1,1,-1),setPoint("n4",t,e,_camera,1,1,-1),setPoint("f1",t,e,_camera,-1,-1,1),setPoint("f2",t,e,_camera,1,-1,1),setPoint("f3",t,e,_camera,-1,1,1),setPoint("f4",t,e,_camera,1,1,1),setPoint("u1",t,e,_camera,.7,1.1,-1),setPoint("u2",t,e,_camera,-.7,1.1,-1),setPoint("u3",t,e,_camera,0,2,-1),setPoint("cf1",t,e,_camera,-1,0,1),setPoint("cf2",t,e,_camera,1,0,1),setPoint("cf3",t,e,_camera,0,-1,1),setPoint("cf4",t,e,_camera,0,1,1),setPoint("cn1",t,e,_camera,-1,0,-1),setPoint("cn2",t,e,_camera,1,0,-1),setPoint("cn3",t,e,_camera,0,-1,-1),setPoint("cn4",t,e,_camera,0,1,-1),e.getAttribute("position").needsUpdate=!0};var _box$3=new Box3;function BoxHelper(e,t){this.object=e,void 0===t&&(t=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new BufferGeometry;i.setIndex(new BufferAttribute(n,1)),i.setAttribute("position",new BufferAttribute(r,3)),LineSegments.call(this,i,new LineBasicMaterial({color:t})),this.matrixAutoUpdate=!1,this.update()}function Box3Helper(e,t){this.type="Box3Helper",this.box=e,t=t||16776960;var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new BufferGeometry;r.setIndex(new BufferAttribute(n,1)),r.setAttribute("position",new Float32BufferAttribute([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),LineSegments.call(this,r,new LineBasicMaterial({color:t})),this.geometry.computeBoundingSphere()}function PlaneHelper(e,t,n){this.type="PlaneHelper",this.plane=e,this.size=void 0===t?1:t;var r=void 0!==n?n:16776960,i=new BufferGeometry;i.setAttribute("position",new Float32BufferAttribute([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),i.computeBoundingSphere(),Line.call(this,i,new LineBasicMaterial({color:r}));var a=new BufferGeometry;a.setAttribute("position",new Float32BufferAttribute([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),a.computeBoundingSphere(),this.add(new Mesh(a,new MeshBasicMaterial({color:r,opacity:.2,transparent:!0,depthWrite:!1})))}BoxHelper.prototype=Object.create(LineSegments.prototype),BoxHelper.prototype.constructor=BoxHelper,BoxHelper.prototype.update=function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&_box$3.setFromObject(this.object),!_box$3.isEmpty()){var t=_box$3.min,n=_box$3.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}},BoxHelper.prototype.setFromObject=function(e){return this.object=e,this.update(),this},BoxHelper.prototype.copy=function(e){return LineSegments.prototype.copy.call(this,e),this.object=e.object,this},BoxHelper.prototype.clone=function(){return(new this.constructor).copy(this)},Box3Helper.prototype=Object.create(LineSegments.prototype),Box3Helper.prototype.constructor=Box3Helper,Box3Helper.prototype.updateMatrixWorld=function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),Object3D.prototype.updateMatrixWorld.call(this,e))},PlaneHelper.prototype=Object.create(Line.prototype),PlaneHelper.prototype.constructor=PlaneHelper,PlaneHelper.prototype.updateMatrixWorld=function(e){var t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?BackSide:FrontSide,this.lookAt(this.plane.normal),Object3D.prototype.updateMatrixWorld.call(this,e)};var _axis=new Vector3,_lineGeometry,_coneGeometry;function ArrowHelper(e,t,n,r,i,a){Object3D.call(this),void 0===e&&(e=new Vector3(0,0,1)),void 0===t&&(t=new Vector3(0,0,0)),void 0===n&&(n=1),void 0===r&&(r=16776960),void 0===i&&(i=.2*n),void 0===a&&(a=.2*i),void 0===_lineGeometry&&((_lineGeometry=new BufferGeometry).setAttribute("position",new Float32BufferAttribute([0,0,0,0,1,0],3)),(_coneGeometry=new CylinderBufferGeometry(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new Line(_lineGeometry,new LineBasicMaterial({color:r})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Mesh(_coneGeometry,new MeshBasicMaterial({color:r})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,a)}function AxesHelper(e){var t=[0,0,0,e=e||1,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new BufferGeometry;n.setAttribute("position",new Float32BufferAttribute(t,3)),n.setAttribute("color",new Float32BufferAttribute([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var r=new LineBasicMaterial({vertexColors:VertexColors});LineSegments.call(this,n,r)}ArrowHelper.prototype=Object.create(Object3D.prototype),ArrowHelper.prototype.constructor=ArrowHelper,ArrowHelper.prototype.setDirection=function(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{_axis.set(e.z,0,-e.x).normalize();var t=Math.acos(e.y);this.quaternion.setFromAxisAngle(_axis,t)}},ArrowHelper.prototype.setLength=function(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},ArrowHelper.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},ArrowHelper.prototype.copy=function(e){return Object3D.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},ArrowHelper.prototype.clone=function(){return(new this.constructor).copy(this)},AxesHelper.prototype=Object.create(LineSegments.prototype),AxesHelper.prototype.constructor=AxesHelper;var LOD_MIN=4,LOD_MAX=8,EXTRA_LOD_SIGMA=[.125,.215,.35,.446,.526,.582],TOTAL_LODS=LOD_MAX-LOD_MIN+1+EXTRA_LOD_SIGMA.length,MAX_SAMPLES=20,ENCODINGS={[LinearEncoding]:0,[sRGBEncoding]:1,[RGBEEncoding]:2,[RGBM7Encoding]:3,[RGBM16Encoding]:4,[RGBDEncoding]:5,[GammaEncoding]:6};new OrthographicCamera,_getBlurShader(MAX_SAMPLES),_createPlanes();var PHI=(1+Math.sqrt(5))/2,INV_PHI=1/PHI;function _createPlanes(){for(var e=[],t=[],n=[],r=LOD_MAX,i=0;i<TOTAL_LODS;i++){var a=Math.pow(2,r);t.push(a);var o=1/a;i>LOD_MAX-LOD_MIN?o=EXTRA_LOD_SIGMA[i-LOD_MAX+LOD_MIN-1]:0==i&&(o=0),n.push(o);for(var s=1/(a-1),l=-s/2,c=1+s/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=new Float32Array(108),p=new Float32Array(72),d=new Float32Array(36),f=0;f<6;f++){var m=f%3*2/3-1,g=f>2?0:-1,v=[m,g,0,m+2/3,g,0,m+2/3,g+1,0,m,g,0,m+2/3,g+1,0,m,g+1,0];h.set(v,18*f),p.set(u,12*f);var y=[f,f,f,f,f,f];d.set(y,6*f)}var x=new BufferGeometry;x.setAttribute("position",new BufferAttribute(h,3)),x.setAttribute("uv",new BufferAttribute(p,2)),x.setAttribute("faceIndex",new BufferAttribute(d,1)),e.push(x),r>LOD_MIN&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}function _getBlurShader(e){var t=new RawShaderMaterial({defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:new Float32Array(e)},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:new Vector3(0,1,0)},inputEncoding:{value:ENCODINGS[LinearEncoding]},outputEncoding:{value:ENCODINGS[LinearEncoding]}},vertexShader:_getCommonVertexShader(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n\n${_getEncodings()}\n\n#define ENVMAP_TYPE_CUBE_UV\n#include <cube_uv_reflection_fragment>\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tfor (int i = 0; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfor (int dir = -1; dir < 2; dir += 2) {\n\t\t\tif (i == 0 && dir == 1)\n\t\t\t\tcontinue;\n\t\t\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\t\t\tif (all(equal(axis, vec3(0.0))))\n\t\t\t\taxis = cross(vec3(0.0, 1.0, 0.0), vOutputDirection);\n\t\t\taxis = normalize(axis);\n\t\t\tfloat theta = dTheta * float(dir * i);\n\t\t\tfloat cosTheta = cos(theta);\n\t\t\t// Rodrigues' axis-angle rotation\n\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross(axis, vOutputDirection) * sin(theta)\n\t\t\t\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\t\t\tgl_FragColor.rgb +=\n\t\t\t\t\tweights[i] * bilinearCubeUV(envMap, sampleDirection, mipInt);\n\t\t}\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t`,blending:NoBlending,depthTest:!1,depthWrite:!1});return t.type="SphericalGaussianBlur",t}function _getCommonVertexShader(){return"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t"}function _getEncodings(){return"\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t"}function Spline(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),CatmullRomCurve3.call(this,e),this.type="catmullrom"}function setGeometrPostion(e,t){for(var n=0;n<e.vertices.length;n++)e.vertices[n].x+=t.x,e.vertices[n].y+=t.y,e.vertices[n].z+=t.z}function repairGeometryFaceVertexUvs(e){e.computeBoundingBox();var t=e.boundingBox.min,n=e.boundingBox.max,r=new Vector2(0-t.x,0-t.y),i=new Vector2(n.x-t.x,n.y-t.y);e.faceVertexUvs[0]=[];for(var a=e.faces,o=0;o<a.length;o++){var s=a[o],l=e.vertices[s.a],c=e.vertices[s.b],u=e.vertices[s.c];e.faceVertexUvs[0].push([new Vector2((l.x+r.x)/i.x,(l.y+r.y)/i.y),new Vector2((c.x+r.x)/i.x,(c.y+r.y)/i.y),new Vector2((u.x+r.x)/i.x,(u.y+r.y)/i.y)])}return e.uvsNeedUpdate=!0,e}function getToGenerateRoundedCorners(e,t,n){if(void 0===n&&(n=!0),t.length>0){var r=new CurvePath;n||e.push(e[0]);for(var i=0;i<e.length-1;i++){var a=t[i]||0;if(0!==i||n){var o=!n||e[i-1]?e[i-1].clone().sub(e[i]):e[e.length-1].clone().sub(e[0]);o.normalize();var s=!n||e[i+1]?e[i+1].clone().sub(e[i]):e[1].clone().sub(e[0]);s.normalize(),e[i].clone().add(o.clone().multiplyScalar(a));var l=new QuadraticBezierCurve3(e[i].clone().add(o.clone().multiplyScalar(a)),e[i].clone(),e[i].clone().add(s.clone().multiplyScalar(a)));if(i===e.length-2){var c=e[i].clone();c.add(s.clone().multiplyScalar(a));var u=e[i+1].clone();n?u.add(s.clone().multiplyScalar(-a)):u.add(s.clone());d=new LineCurve3(c,u);r.curves.push(l,d)}else r.curves.push(l);0===i&&e.push(e[0])}else{var h=e[0].clone().sub(e[1]);h.normalize();var p=e[1].clone();p.add(h.clone().multiplyScalar(a));var d=new LineCurve3(e[0],p);r.curves.push(d)}}return r.getPoints(50)}return e}function computeRectPoints(e,t){return[e,e.clone().set(t.x,e.y,t.z),t,t.clone().set(e.x,t.y,e.z)]}function calculateArcOrigin(e,t,n){var r=e.x,i=t.x,a=n.x,o=e.y,s=t.y,l=n.y,c=r-i,u=o-s,h=r-a,p=o-l,d=(r*r-i*i+(o*o-s*s))/2,f=(r*r-a*a+(o*o-l*l))/2,m=u*h-c*p;return new Vector3(-(p*d-u*f)/m,-(c*f-h*d)/m,0)}function calculateRadiusArc(e,t){var n=e.x,r=e.y,i=t.x,a=t.y;return Math.sqrt((n-i)*(n-i)+(r-a)*(r-a))}function calculateArcAngle(e,t,n){var r,i,a,o=e.x,s=t.x;return r=(e.y-t.y)/n,(i=(o-s)/n)>=.99999&&(i=.99999),i<=-.99999&&(i=-.99999),a=(a=Math.acos(i))/Math.PI*180,r<-.05&&(a=360-a),{sin:r,cos:i,angle:a}}function judgementArcRenderDirection(e,t,n){var r;return r=e<n?n-e:n-e+360,(e<t?t-e:t-e+360)>r}function createThreePointArc(e,t,n,r,i,a){void 0===r&&(r=!1),void 0===i&&(i=!1),void 0===a&&(a=new Color("#ff0000"));var o,s,l=calculateArcOrigin(e,t,n),c=l.x,u=l.y,h=calculateRadiusArc(e,l),p=calculateArcAngle(e,l,h),d=calculateArcAngle(t,l,h),f=calculateArcAngle(n,l,h),m=p.angle,g=d.angle,v=f.angle,y=judgementArcRenderDirection(m,g,v);i&&(y=!0),r?(s=new ArcCurve(c,u,h,MathUtils.degToRad(m),MathUtils.degToRad(g),!y),o=y?g>m?MathUtils.radToDeg(s.aEndAngle-s.aStartAngle):360-Math.abs(MathUtils.radToDeg(s.aEndAngle-s.aStartAngle)):m>g?Math.abs(MathUtils.radToDeg(s.aEndAngle-s.aStartAngle)):360-MathUtils.radToDeg(s.aEndAngle-s.aStartAngle)):(s=new ArcCurve(c,u,h,MathUtils.degToRad(m),MathUtils.degToRad(v),y),o=y?v>m?360-MathUtils.radToDeg(s.aEndAngle-s.aStartAngle):Math.abs(MathUtils.radToDeg(s.aEndAngle-s.aStartAngle)):m>v?360+MathUtils.radToDeg(s.aEndAngle-s.aStartAngle):MathUtils.radToDeg(s.aEndAngle-s.aStartAngle));var x=o*Math.PI*h/180;return{arc:new Line((new BufferGeometry).setFromPoints(s.getPoints(50)),new LineBasicMaterial({color:a})),radius:h,angle:o,arcLength:x}}function createAnyLine(e){var t=new CatmullRomCurve3(e,!1,"chordal");e=t.getPoints(50);for(var n=new BufferGeometry,r=Math.round(12*e.length),i=new Vector3,a=[],o=[],s=new Color("#ff0000"),l=0,c=r;l<c;l++){var u=l/c;i=t.getPoint(u),a.push(i.x,i.y,i.z),o.push(s.r,s.g,s.b)}n.setAttribute("position",new Float32BufferAttribute(a,3)),n.setAttribute("color",new Float32BufferAttribute(o,3));var h=new Line(n,new LineBasicMaterial({vertexColors:VertexColors,linewidth:10}));return h.computeLineDistances(),h}function mixin(e){e.createImage=function(e,t,n,r,i){(new TextureLoader).load(r,function(r){var a=new PlaneGeometry(t,n),o=new MeshLambertMaterial({map:r,transparent:!0,side:DoubleSide});o.map&&(o.map.needsUpdate=!0),setGeometrPostion(a,e);var s=new Mesh(a,o);s.material.depthTest=!1,i&&i(s)},void 0,function(e){console.log(e),i&&i(null)})}}new Vector3(1,1,1),new Vector3(-1,1,1),new Vector3(1,1,-1),new Vector3(-1,1,-1),new Vector3(0,PHI,INV_PHI),new Vector3(0,PHI,-INV_PHI),new Vector3(INV_PHI,0,PHI),new Vector3(-INV_PHI,0,PHI),new Vector3(PHI,INV_PHI,0),new Vector3(-PHI,INV_PHI,0),Curve.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Curve.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(CurvePath.prototype,{createPointsGeometry:function(e){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var t=new Geometry,n=0,r=e.length;n<r;n++){var i=e[n];t.vertices.push(new Vector3(i.x,i.y,i.z||0))}return t}}),Object.assign(Path.prototype,{fromPoints:function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),Spline.prototype=Object.create(CatmullRomCurve3.prototype),Object.assign(Spline.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),GridHelper.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},SkeletonHelper.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(Loader.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),LoaderUtils.extractUrlBase(e)}}),Loader.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(ObjectLoader.prototype,{setTexturePath:function(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}),Object.assign(Box2.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(Box3.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Frustum.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},Line3.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(MathUtils,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),MathUtils.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),MathUtils.ceilPowerOfTwo(e)}}),Object.assign(Matrix3.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(Matrix4.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new Vector3).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,r,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,a)}}),Plane.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},Quaternion.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},Object.assign(Ray.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(Triangle.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(Triangle,{barycoordFromPoint:function(e,t,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Triangle.getBarycoord(e,t,n,r,i)},normal:function(e,t,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Triangle.getNormal(e,t,n,r)}}),Object.assign(Shape.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new ExtrudeGeometry(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new ShapeGeometry(this,e)}}),Object.assign(Vector2.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Vector3.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Vector4.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Geometry.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.assign(Object3D.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(Object3D.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(Mesh.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(Mesh.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),TrianglesDrawMode},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(LOD.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Skeleton.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),SkinnedMesh.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Curve.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),PerspectiveCamera.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(Light.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(BufferAttribute.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===DynamicDrawUsage},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(DynamicDrawUsage)}}}),Object.assign(BufferAttribute.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?DynamicDrawUsage:StaticDrawUsage),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(BufferGeometry.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addAttribute:function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new BufferAttribute(arguments[1],arguments[2])))},addDrawCall:function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},applyMatrix:function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(BufferGeometry.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(InterleavedBuffer.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===DynamicDrawUsage},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign(InterleavedBuffer.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?DynamicDrawUsage:StaticDrawUsage),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(ExtrudeBufferGeometry.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(Uniform.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(Material.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Color}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=e===FlatShading}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),Object.defineProperties(MeshPhongMaterial.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(ShaderMaterial.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(WebGLRenderer.prototype,{clearTarget:function(e,t,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,r)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(WebGLRenderer.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?sRGBEncoding:LinearEncoding}}}),Object.defineProperties(WebGLShadowMap.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(WebGLRenderTarget.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(Audio.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return(new AudioLoader).load(e,function(e){t.setBuffer(e)}),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),AudioAnalyser.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},CubeCamera.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)},ImageUtils.crossOrigin=void 0,ImageUtils.loadTexture=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new TextureLoader;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},ImageUtils.loadTextureCube=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new CubeTextureLoader;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},ImageUtils.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},ImageUtils.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:REVISION}}));var MxThreeJS$1=function(){function e(){}return e.prototype.createLine=function(e,t,n){var r=new Geometry,i=new LineBasicMaterial({color:n});return r.vertices.push(e,t),new Line(r,i)},e.prototype.createCircle=function(e,t,n){var r=new CircleGeometry(t,64,3,2*Math.PI),i=new LineBasicMaterial({color:n});r.vertices.shift();var a=new LineLoop(r,i);return a.position.x=e.x,a.position.y=e.y,a.position.z=e.z,a},e.prototype.createPoint=function(e,t){var n=new Geometry;return n.vertices.push(e),new Points(n,new PointsMaterial({color:t,size:3}))},e.prototype.creatTextSprite=function(e,t,n,r,i){return store.state.MxFun.getMxThreeJS().creatTextSprite(e,t,n,r,i)},e.prototype.createTriangle=function(e,t,n){if(void 0===n&&(n=1),e.length<3)return null;for(var r=e.length,i=new Geometry,a=0;a+2<r;a+=3){i.vertices.push(e[a]),i.vertices.push(e[a+1]),i.vertices.push(e[a+2]);var o=new Face3(a,a+1,a+2);i.faces.push(o)}return i.computeFaceNormals(),i.computeVertexNormals(),new Mesh(i,new MeshBasicMaterial({color:t,transparent:!0,depthTest:!1,side:DoubleSide,opacity:n}))},e.prototype.createLines=function(e,t){var n=new Geometry;return n.vertices=e,new Line(n,new LineBasicMaterial({color:t}))},e.prototype.createDashedLines=function(e,t,n,r){var i=new Geometry;i.vertices=e;var a=new Line(i,new LineDashedMaterial({color:t,dashSize:n,gapSize:r}));return a.computeLineDistances(),a},e.prototype.createImage=function(e,t,n,r,i){},e.prototype.loadSVG=function(e,t,n){return n?(store.state.MxFun.loadSVG(e,t,n),new Promise(function(e){e(null)})):new Promise(function(n){store.state.MxFun.loadSVG(e,t,function(e){n(e)})})},e}(),MxThreeJS=new MxThreeJS$1;mixin(MxThreeJS);var MxDrawObject=function(){function e(e){this._mxdrawObj=e}return e.prototype.getScene=function(){return this._mxdrawObj.getScene()},e.prototype.getCamera=function(){return this._mxdrawObj.getCamera()},e.prototype.getRenderer=function(){return this._mxdrawObj.renderer},e.prototype.setMouseRightRotate=function(e){return void 0===e&&(e=!0),this._mxdrawObj.setMouseRightRotate(e)},e.prototype.getFullDisplayRange=function(){return this._mxdrawObj.getFullDisplayRange()},e.prototype.getCanvas=function(){return this._mxdrawObj.getCanvas()},e.prototype.updateDisplay=function(){return this._mxdrawObj.updateDisplay()},e.prototype.createCanvasImageData=function(e,t){return this._mxdrawObj.createCanvasImageData(e,t)},e.prototype.setViewColor=function(e){return this._mxdrawObj.setViewColor(e)},e.prototype.setSize=function(e,t){return this._mxdrawObj.setSize(e,t)},e.prototype.getIntersectObjects=function(e){return this._mxdrawObj.getIntersectObjects(e)},e.prototype.addObject=function(e,t){return void 0===t&&(t=!0),this._mxdrawObj.addObject(e,t)},e.prototype.addViewObject=function(e){return this._mxdrawObj.addViewObject(e)},e.prototype.getViewWidth=function(){return this._mxdrawObj.getViewWidth()},e.prototype.getViewHeight=function(){return this._mxdrawObj.getViewHeight()},e.prototype.removeObject=function(e,t){return void 0===t&&(t=!0),this._mxdrawObj.removeObject(e,t)},e.prototype.zoomInitialStates=function(){return this._mxdrawObj.zoomInitialStates()},e.prototype.zoomScale=function(e){return this._mxdrawObj.zoomScale(e)},e.prototype.zoomW=function(e,t,n){return this._mxdrawObj.zoomW(e,t,n)},e.prototype.zoomCenter=function(e,t){return this._mxdrawObj.zoomCenter(e,t)},e.prototype.initZoomW=function(e,t){return this._mxdrawObj.initZoomW(e,t)},e.prototype.addEvent=function(e,t){return this._mxdrawObj.addEvent(e,t)},e.prototype.setIniset=function(e){return this._mxdrawObj.setIniset(e)},e.prototype.screenCoord2World=function(e,t,n){return this._mxdrawObj.screenCoord2World(e,t,n)},e.prototype.worldCoord2Screen=function(e,t,n){return this._mxdrawObj.worldCoord2Screen(e,t,n)},e.prototype.screenCoord2Doc=function(e,t){return this._mxdrawObj.screenCoord2Doc(e,t,0)},e.prototype.worldCoordLong2Doc=function(e){return this._mxdrawObj.worldCoordLong2Doc(e)},e.prototype.docCoordLong2World=function(e){return this._mxdrawObj.docCoordLong2World(e)},e.prototype.docCoord2World=function(e,t,n){return this._mxdrawObj.docCoord2World(e,t,n)},e.prototype.docCoord2World2=function(e){return this._mxdrawObj.docCoord2World(e.x,e.y,e.z)},e.prototype.worldCoord2Doc=function(e,t,n){return this._mxdrawObj.worldCoord2Doc(e,t,n)},e.prototype.worldCoord2Doc2=function(e){return this._mxdrawObj.worldCoord2Doc(e.x,e.y,e.z)},e.prototype.docCoord2Screen=function(e,t){return this._mxdrawObj.docCoord2Screen(e,t,0)},e.prototype.screenCoordLong2Doc=function(e){return this._mxdrawObj.screenCoordLong2Doc(e)},e.prototype.docCoordLong2Screen=function(e){return this._mxdrawObj.docCoordLong2Screen(e)},e.prototype.screenCoordLong2World=function(e){return this._mxdrawObj.screenCoordLong2World(e)},e.prototype.worldCoordLong2Screen=function(e){return this._mxdrawObj.worldCoordLong2Screen(e)},e.prototype.initRendererParam=function(e){return this._mxdrawObj.initRendererParam(e)},e.prototype.addMxEntity=function(e){return this._mxdrawObj.addMxEntity(e)},e.prototype.getMxCurrentSelect=function(){return this._mxdrawObj.getMxAllSelect()},e.prototype.addMxCurrentSelect=function(e){return this._mxdrawObj.addMxCurrentSelect(e)},e.prototype.clearMxCurrentSelect=function(){return this._mxdrawObj.clearMxCurrentSelect()},e.prototype.getMxEntity=function(e){return this._mxdrawObj.getMxEntityUserObject(e)},e.prototype.findMxEntityAtPoint=function(e){return this._mxdrawObj.findMxEntityAtPoint(e)},e.prototype.getAllMxEntity=function(){return this._mxdrawObj.getAllMxEntity()},e.prototype.setMouseMiddlePan=function(e){return this._mxdrawObj.setMouseMiddlePan(e)},e.prototype.resetThreeJSControls=function(){return this._mxdrawObj.resetThreeJSControls()},e.prototype.enableZoom=function(e){return this._mxdrawObj.enableZoom(e)},e.prototype.enablePan=function(e){return this._mxdrawObj.enablePan(e)},e.prototype.eraseMxEntity=function(e){return this._mxdrawObj.eraseMxEntity(e)},e.prototype.removeViewObject=function(e){this._mxdrawObj.removeViewObject(e)},e.prototype.saveMxEntityToJson=function(){return this._mxdrawObj.saveMxEntityToJson()},e.prototype.loadMxEntityFromJson=function(e,t){return void 0===t&&(t=null),__awaiter(this,void 0,void 0,function(){var n,r;return __generator(this,function(i){switch(i.label){case 0:if(!t)return[3,4];n=t.length,r=0,i.label=1;case 1:return r<n?[4,MxThreeJS.loadSVG(t[r])]:[3,4];case 2:i.sent(),i.label=3;case 3:return r++,[3,1];case 4:return[2,this._mxdrawObj.loadMxEntityFromJson(e)]}})})},e.prototype.eraseAllMxEntity=function(){return this._mxdrawObj.eraseAllMxEntity()},e.prototype.makeCurrent=function(){this._mxdrawObj.makeCurrent()},e.prototype.getViewCenterDocCoord=function(){return this._mxdrawObj.getViewCenterDocCoord()},e.prototype.updateCanvasSize=function(){this._mxdrawObj.updateCanvasSize()},e.prototype.newFile=function(e,t,n,r){return this._mxdrawObj.newFile(e,t,n,r)},e}(),commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}function useCanvasResizeListener(e,t,n,r,i){return void 0===n&&(n=100),void 0===r&&(r=!0),__awaiter(this,void 0,void 0,function(){var a;return __generator(this,function(o){switch(o.label){case 0:return store.state.MxFun?e?(a=e).isLoadCanvasResizeListene?[3,2]:(a.isLoadCanvasResizeListene=!0,[4,dynamicImport("element-resize-event-polyfill")]):(console.error("请确保mxdrawObj参数 是通过调用MxFun.createMxObject的callback回调函数拿到的mxDraw对象"),[2]):(console.error("请先调用loadCoreCode方法! "),[2]);case 1:o.sent(),e.addEvent("addResizeEvent",function(e){createCanvasParent(t).addEventListener?createCanvasParent(t).addEventListener("resize",(void 0)(function(t){i&&i(t),r&&e(t)},n),!1):console.log("mx: parentdiv[addEventListener] invalid")}),o.label=2;case 2:return[2]}})})}createCommonjsModule(function(e,t){(function(){var n,r=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",o="Invalid `variable` option passed into `_.template`",s="__lodash_hash_undefined__",l=500,c="__lodash_placeholder__",u=1,h=2,p=4,d=1,f=2,m=1,g=2,v=4,y=8,x=16,_=32,b=64,w=128,M=256,S=512,T=30,E="...",C=800,A=16,L=1,D=2,P=1/0,O=9007199254740991,R=1.7976931348623157e308,I=NaN,B=4294967295,N=B-1,k=B>>>1,F=[["ary",w],["bind",m],["bindKey",g],["curry",y],["curryRight",x],["flip",S],["partial",_],["partialRight",b],["rearg",M]],G="[object Arguments]",V="[object Array]",z="[object AsyncFunction]",U="[object Boolean]",j="[object Date]",H="[object DOMException]",W="[object Error]",q="[object Function]",J="[object GeneratorFunction]",X="[object Map]",Y="[object Number]",$="[object Null]",Z="[object Object]",K="[object Proxy]",Q="[object RegExp]",ee="[object Set]",te="[object String]",ne="[object Symbol]",re="[object Undefined]",ie="[object WeakMap]",ae="[object WeakSet]",oe="[object ArrayBuffer]",se="[object DataView]",le="[object Float32Array]",ce="[object Float64Array]",ue="[object Int8Array]",he="[object Int16Array]",pe="[object Int32Array]",de="[object Uint8Array]",fe="[object Uint8ClampedArray]",me="[object Uint16Array]",ge="[object Uint32Array]",ve=/\b__p \+= '';/g,ye=/\b(__p \+=) '' \+/g,xe=/(__e\(.*?\)|\b__t\)) \+\n'';/g,_e=/&(?:amp|lt|gt|quot|#39);/g,be=/[&<>"']/g,we=RegExp(_e.source),Me=RegExp(be.source),Se=/<%-([\s\S]+?)%>/g,Te=/<%([\s\S]+?)%>/g,Ee=/<%=([\s\S]+?)%>/g,Ce=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ae=/^\w*$/,Le=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,De=/[\\^$.*+?()[\]{}|]/g,Pe=RegExp(De.source),Oe=/^\s+/,Re=/\s/,Ie=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Be=/\{\n\/\* \[wrapped with (.+)\] \*/,Ne=/,? & /,ke=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Fe=/[()=,{}\[\]\/\s]/,Ge=/\\(\\)?/g,Ve=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ze=/\w*$/,Ue=/^[-+]0x[0-9a-f]+$/i,je=/^0b[01]+$/i,He=/^\[object .+?Constructor\]$/,We=/^0o[0-7]+$/i,qe=/^(?:0|[1-9]\d*)$/,Je=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Xe=/($^)/,Ye=/['\n\r\u2028\u2029\\]/g,$e="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ze="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ke="[\\ud800-\\udfff]",Qe="["+Ze+"]",et="["+$e+"]",tt="\\d+",nt="[\\u2700-\\u27bf]",rt="[a-z\\xdf-\\xf6\\xf8-\\xff]",it="[^\\ud800-\\udfff"+Ze+tt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",at="\\ud83c[\\udffb-\\udfff]",ot="[^\\ud800-\\udfff]",st="(?:\\ud83c[\\udde6-\\uddff]){2}",lt="[\\ud800-\\udbff][\\udc00-\\udfff]",ct="[A-Z\\xc0-\\xd6\\xd8-\\xde]",ut="(?:"+rt+"|"+it+")",ht="(?:"+ct+"|"+it+")",pt="(?:"+et+"|"+at+")"+"?",dt="[\\ufe0e\\ufe0f]?"+pt+("(?:\\u200d(?:"+[ot,st,lt].join("|")+")[\\ufe0e\\ufe0f]?"+pt+")*"),ft="(?:"+[nt,st,lt].join("|")+")"+dt,mt="(?:"+[ot+et+"?",et,st,lt,Ke].join("|")+")",gt=RegExp("['’]","g"),vt=RegExp(et,"g"),yt=RegExp(at+"(?="+at+")|"+mt+dt,"g"),xt=RegExp([ct+"?"+rt+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[Qe,ct,"$"].join("|")+")",ht+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[Qe,ct+ut,"$"].join("|")+")",ct+"?"+ut+"+(?:['’](?:d|ll|m|re|s|t|ve))?",ct+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",tt,ft].join("|"),"g"),_t=RegExp("[\\u200d\\ud800-\\udfff"+$e+"\\ufe0e\\ufe0f]"),bt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,wt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Mt=-1,St={};St[le]=St[ce]=St[ue]=St[he]=St[pe]=St[de]=St[fe]=St[me]=St[ge]=!0,St[G]=St[V]=St[oe]=St[U]=St[se]=St[j]=St[W]=St[q]=St[X]=St[Y]=St[Z]=St[Q]=St[ee]=St[te]=St[ie]=!1;var Tt={};Tt[G]=Tt[V]=Tt[oe]=Tt[se]=Tt[U]=Tt[j]=Tt[le]=Tt[ce]=Tt[ue]=Tt[he]=Tt[pe]=Tt[X]=Tt[Y]=Tt[Z]=Tt[Q]=Tt[ee]=Tt[te]=Tt[ne]=Tt[de]=Tt[fe]=Tt[me]=Tt[ge]=!0,Tt[W]=Tt[q]=Tt[ie]=!1;var Et={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ct=parseFloat,At=parseInt,Lt="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,Dt="object"==typeof self&&self&&self.Object===Object&&self,Pt=Lt||Dt||Function("return this")(),Ot=t&&!t.nodeType&&t,Rt=Ot&&e&&!e.nodeType&&e,It=Rt&&Rt.exports===Ot,Bt=It&&Lt.process,Nt=function(){try{var e=Rt&&Rt.require&&Rt.require("util").types;return e||Bt&&Bt.binding&&Bt.binding("util")}catch(e){}}(),kt=Nt&&Nt.isArrayBuffer,Ft=Nt&&Nt.isDate,Gt=Nt&&Nt.isMap,Vt=Nt&&Nt.isRegExp,zt=Nt&&Nt.isSet,Ut=Nt&&Nt.isTypedArray;function jt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Ht(e,t,n,r){for(var i=-1,a=null==e?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}function Wt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function qt(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Jt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Xt(e,t){for(var n=-1,r=null==e?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function Yt(e,t){return!!(null==e?0:e.length)&&on(e,t,0)>-1}function $t(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Zt(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Kt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Qt(e,t,n,r){var i=-1,a=null==e?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function en(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function tn(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var nn=un("length");function rn(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function an(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function on(e,t,n){return t==t?function(e,t,n){var r=n-1,i=e.length;for(;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):an(e,ln,n)}function sn(e,t,n,r){for(var i=n-1,a=e.length;++i<a;)if(r(e[i],t))return i;return-1}function ln(e){return e!=e}function cn(e,t){var n=null==e?0:e.length;return n?dn(e,t)/n:I}function un(e){return function(t){return null==t?n:t[e]}}function hn(e){return function(t){return null==e?n:e[t]}}function pn(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}function dn(e,t){for(var r,i=-1,a=e.length;++i<a;){var o=t(e[i]);o!==n&&(r=r===n?o:r+o)}return r}function fn(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function mn(e){return e?e.slice(0,On(e)+1).replace(Oe,""):e}function gn(e){return function(t){return e(t)}}function vn(e,t){return Zt(t,function(t){return e[t]})}function yn(e,t){return e.has(t)}function xn(e,t){for(var n=-1,r=e.length;++n<r&&on(t,e[n],0)>-1;);return n}function _n(e,t){for(var n=e.length;n--&&on(t,e[n],0)>-1;);return n}var bn=hn({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),wn=hn({"&":"&","<":"<",">":">",'"':""","'":"'"});function Mn(e){return"\\"+Et[e]}function Sn(e){return _t.test(e)}function Tn(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function En(e,t){return function(n){return e(t(n))}}function Cn(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var o=e[n];o!==t&&o!==c||(e[n]=c,a[i++]=n)}return a}function An(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Ln(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function Dn(e){return Sn(e)?function(e){var t=yt.lastIndex=0;for(;yt.test(e);)++t;return t}(e):nn(e)}function Pn(e){return Sn(e)?function(e){return e.match(yt)||[]}(e):function(e){return e.split("")}(e)}function On(e){for(var t=e.length;t--&&Re.test(e.charAt(t)););return t}var Rn=hn({"&":"&","<":"<",">":">",""":'"',"'":"'"});var In=function e(t){var Re,$e=(t=null==t?Pt:In.defaults(Pt.Object(),t,In.pick(Pt,wt))).Array,Ze=t.Date,Ke=t.Error,Qe=t.Function,et=t.Math,tt=t.Object,nt=t.RegExp,rt=t.String,it=t.TypeError,at=$e.prototype,ot=Qe.prototype,st=tt.prototype,lt=t["__core-js_shared__"],ct=ot.toString,ut=st.hasOwnProperty,ht=0,pt=(Re=/[^.]+$/.exec(lt&<.keys&<.keys.IE_PROTO||""))?"Symbol(src)_1."+Re:"",dt=st.toString,ft=ct.call(tt),mt=Pt._,yt=nt("^"+ct.call(ut).replace(De,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_t=It?t.Buffer:n,Et=t.Symbol,Lt=t.Uint8Array,Dt=_t?_t.allocUnsafe:n,Ot=En(tt.getPrototypeOf,tt),Rt=tt.create,Bt=st.propertyIsEnumerable,Nt=at.splice,nn=Et?Et.isConcatSpreadable:n,hn=Et?Et.iterator:n,Bn=Et?Et.toStringTag:n,Nn=function(){try{var e=Va(tt,"defineProperty");return e({},"",{}),e}catch(e){}}(),kn=t.clearTimeout!==Pt.clearTimeout&&t.clearTimeout,Fn=Ze&&Ze.now!==Pt.Date.now&&Ze.now,Gn=t.setTimeout!==Pt.setTimeout&&t.setTimeout,Vn=et.ceil,zn=et.floor,Un=tt.getOwnPropertySymbols,jn=_t?_t.isBuffer:n,Hn=t.isFinite,Wn=at.join,qn=En(tt.keys,tt),Jn=et.max,Xn=et.min,Yn=Ze.now,$n=t.parseInt,Zn=et.random,Kn=at.reverse,Qn=Va(t,"DataView"),er=Va(t,"Map"),tr=Va(t,"Promise"),nr=Va(t,"Set"),rr=Va(t,"WeakMap"),ir=Va(tt,"create"),ar=rr&&new rr,or={},sr=po(Qn),lr=po(er),cr=po(tr),ur=po(nr),hr=po(rr),pr=Et?Et.prototype:n,dr=pr?pr.valueOf:n,fr=pr?pr.toString:n;function mr(e){if(Ds(e)&&!xs(e)&&!(e instanceof xr)){if(e instanceof yr)return e;if(ut.call(e,"__wrapped__"))return fo(e)}return new yr(e)}var gr=function(){function e(){}return function(t){if(!Ls(t))return{};if(Rt)return Rt(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function vr(){}function yr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function xr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=B,this.__views__=[]}function _r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function br(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function wr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Mr(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new wr;++t<n;)this.add(e[t])}function Sr(e){var t=this.__data__=new br(e);this.size=t.size}function Tr(e,t){var n=xs(e),r=!n&&ys(e),i=!n&&!r&&Ms(e),a=!n&&!r&&!i&&Fs(e),o=n||r||i||a,s=o?fn(e.length,rt):[],l=s.length;for(var c in e)!t&&!ut.call(e,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Ja(c,l))||s.push(c);return s}function Er(e){var t=e.length;return t?e[Mi(0,t-1)]:n}function Cr(e,t){return co(ia(e),Nr(t,0,e.length))}function Ar(e){return co(ia(e))}function Lr(e,t,r){(r===n||ms(e[t],r))&&(r!==n||t in e)||Ir(e,t,r)}function Dr(e,t,r){var i=e[t];ut.call(e,t)&&ms(i,r)&&(r!==n||t in e)||Ir(e,t,r)}function Pr(e,t){for(var n=e.length;n--;)if(ms(e[n][0],t))return n;return-1}function Or(e,t,n,r){return zr(e,function(e,i,a){t(r,e,n(e),a)}),r}function Rr(e,t){return e&&aa(t,ol(t),e)}function Ir(e,t,n){"__proto__"==t&&Nn?Nn(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Br(e,t){for(var r=-1,i=t.length,a=$e(i),o=null==e;++r<i;)a[r]=o?n:tl(e,t[r]);return a}function Nr(e,t,r){return e==e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function kr(e,t,r,i,a,o){var s,l=t&u,c=t&h,d=t&p;if(r&&(s=a?r(e,i,a,o):r(e)),s!==n)return s;if(!Ls(e))return e;var f=xs(e);if(f){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ut.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!l)return ia(e,s)}else{var m=ja(e),g=m==q||m==J;if(Ms(e))return Ki(e,l);if(m==Z||m==G||g&&!a){if(s=c||g?{}:Wa(e),!l)return c?function(e,t){return aa(e,Ua(e),t)}(e,function(e,t){return e&&aa(t,sl(t),e)}(s,e)):function(e,t){return aa(e,za(e),t)}(e,Rr(s,e))}else{if(!Tt[m])return a?e:{};s=function(e,t,n){var r,i,a,o=e.constructor;switch(t){case oe:return Qi(e);case U:case j:return new o(+e);case se:return function(e,t){var n=t?Qi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case le:case ce:case ue:case he:case pe:case de:case fe:case me:case ge:return ea(e,n);case X:return new o;case Y:case te:return new o(e);case Q:return(a=new(i=e).constructor(i.source,ze.exec(i))).lastIndex=i.lastIndex,a;case ee:return new o;case ne:return r=e,dr?tt(dr.call(r)):{}}}(e,m,l)}}o||(o=new Sr);var v=o.get(e);if(v)return v;o.set(e,s),Bs(e)?e.forEach(function(n){s.add(kr(n,t,r,n,e,o))}):Ps(e)&&e.forEach(function(n,i){s.set(i,kr(n,t,r,i,e,o))});var y=f?n:(d?c?Ra:Oa:c?sl:ol)(e);return Wt(y||e,function(n,i){y&&(n=e[i=n]),Dr(s,i,kr(n,t,r,i,e,o))}),s}function Fr(e,t,r){var i=r.length;if(null==e)return!i;for(e=tt(e);i--;){var a=r[i],o=t[a],s=e[a];if(s===n&&!(a in e)||!o(s))return!1}return!0}function Gr(e,t,r){if("function"!=typeof e)throw new it(a);return ao(function(){e.apply(n,r)},t)}function Vr(e,t,n,i){var a=-1,o=Yt,s=!0,l=e.length,c=[],u=t.length;if(!l)return c;n&&(t=Zt(t,gn(n))),i?(o=$t,s=!1):t.length>=r&&(o=yn,s=!1,t=new Mr(t));e:for(;++a<l;){var h=e[a],p=null==n?h:n(h);if(h=i||0!==h?h:0,s&&p==p){for(var d=u;d--;)if(t[d]===p)continue e;c.push(h)}else o(t,p,i)||c.push(h)}return c}mr.templateSettings={escape:Se,evaluate:Te,interpolate:Ee,variable:"",imports:{_:mr}},mr.prototype=vr.prototype,mr.prototype.constructor=mr,yr.prototype=gr(vr.prototype),yr.prototype.constructor=yr,xr.prototype=gr(vr.prototype),xr.prototype.constructor=xr,_r.prototype.clear=function(){this.__data__=ir?ir(null):{},this.size=0},_r.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},_r.prototype.get=function(e){var t=this.__data__;if(ir){var r=t[e];return r===s?n:r}return ut.call(t,e)?t[e]:n},_r.prototype.has=function(e){var t=this.__data__;return ir?t[e]!==n:ut.call(t,e)},_r.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ir&&t===n?s:t,this},br.prototype.clear=function(){this.__data__=[],this.size=0},br.prototype.delete=function(e){var t=this.__data__,n=Pr(t,e);return!(n<0||(n==t.length-1?t.pop():Nt.call(t,n,1),--this.size,0))},br.prototype.get=function(e){var t=this.__data__,r=Pr(t,e);return r<0?n:t[r][1]},br.prototype.has=function(e){return Pr(this.__data__,e)>-1},br.prototype.set=function(e,t){var n=this.__data__,r=Pr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},wr.prototype.clear=function(){this.size=0,this.__data__={hash:new _r,map:new(er||br),string:new _r}},wr.prototype.delete=function(e){var t=Fa(this,e).delete(e);return this.size-=t?1:0,t},wr.prototype.get=function(e){return Fa(this,e).get(e)},wr.prototype.has=function(e){return Fa(this,e).has(e)},wr.prototype.set=function(e,t){var n=Fa(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Mr.prototype.add=Mr.prototype.push=function(e){return this.__data__.set(e,s),this},Mr.prototype.has=function(e){return this.__data__.has(e)},Sr.prototype.clear=function(){this.__data__=new br,this.size=0},Sr.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Sr.prototype.get=function(e){return this.__data__.get(e)},Sr.prototype.has=function(e){return this.__data__.has(e)},Sr.prototype.set=function(e,t){var n=this.__data__;if(n instanceof br){var i=n.__data__;if(!er||i.length<r-1)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new wr(i)}return n.set(e,t),this.size=n.size,this};var zr=la(Yr),Ur=la($r,!0);function jr(e,t){var n=!0;return zr(e,function(e,r,i){return n=!!t(e,r,i)}),n}function Hr(e,t,r){for(var i=-1,a=e.length;++i<a;){var o=e[i],s=t(o);if(null!=s&&(l===n?s==s&&!ks(s):r(s,l)))var l=s,c=o}return c}function Wr(e,t){var n=[];return zr(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function qr(e,t,n,r,i){var a=-1,o=e.length;for(n||(n=qa),i||(i=[]);++a<o;){var s=e[a];t>0&&n(s)?t>1?qr(s,t-1,n,r,i):Kt(i,s):r||(i[i.length]=s)}return i}var Jr=ca(),Xr=ca(!0);function Yr(e,t){return e&&Jr(e,t,ol)}function $r(e,t){return e&&Xr(e,t,ol)}function Zr(e,t){return Xt(t,function(t){return Es(e[t])})}function Kr(e,t){for(var r=0,i=(t=Xi(t,e)).length;null!=e&&r<i;)e=e[ho(t[r++])];return r&&r==i?e:n}function Qr(e,t,n){var r=t(e);return xs(e)?r:Kt(r,n(e))}function ei(e){return null==e?e===n?re:$:Bn&&Bn in tt(e)?function(e){var t=ut.call(e,Bn),r=e[Bn];try{e[Bn]=n;var i=!0}catch(e){}var a=dt.call(e);return i&&(t?e[Bn]=r:delete e[Bn]),a}(e):function(e){return dt.call(e)}(e)}function ti(e,t){return e>t}function ni(e,t){return null!=e&&ut.call(e,t)}function ri(e,t){return null!=e&&t in tt(e)}function ii(e,t,r){for(var i=r?$t:Yt,a=e[0].length,o=e.length,s=o,l=$e(o),c=1/0,u=[];s--;){var h=e[s];s&&t&&(h=Zt(h,gn(t))),c=Xn(h.length,c),l[s]=!r&&(t||a>=120&&h.length>=120)?new Mr(s&&h):n}h=e[0];var p=-1,d=l[0];e:for(;++p<a&&u.length<c;){var f=h[p],m=t?t(f):f;if(f=r||0!==f?f:0,!(d?yn(d,m):i(u,m,r))){for(s=o;--s;){var g=l[s];if(!(g?yn(g,m):i(e[s],m,r)))continue e}d&&d.push(m),u.push(f)}}return u}function ai(e,t,r){var i=null==(e=no(e,t=Xi(t,e)))?e:e[ho(To(t))];return null==i?n:jt(i,e,r)}function oi(e){return Ds(e)&&ei(e)==G}function si(e,t,r,i,a){return e===t||(null==e||null==t||!Ds(e)&&!Ds(t)?e!=e&&t!=t:function(e,t,r,i,a,o){var s=xs(e),l=xs(t),c=s?V:ja(e),u=l?V:ja(t),h=(c=c==G?Z:c)==Z,p=(u=u==G?Z:u)==Z,m=c==u;if(m&&Ms(e)){if(!Ms(t))return!1;s=!0,h=!1}if(m&&!h)return o||(o=new Sr),s||Fs(e)?Da(e,t,r,i,a,o):function(e,t,n,r,i,a,o){switch(n){case se:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case oe:return!(e.byteLength!=t.byteLength||!a(new Lt(e),new Lt(t)));case U:case j:case Y:return ms(+e,+t);case W:return e.name==t.name&&e.message==t.message;case Q:case te:return e==t+"";case X:var s=Tn;case ee:var l=r&d;if(s||(s=An),e.size!=t.size&&!l)return!1;var c=o.get(e);if(c)return c==t;r|=f,o.set(e,t);var u=Da(s(e),s(t),r,i,a,o);return o.delete(e),u;case ne:if(dr)return dr.call(e)==dr.call(t)}return!1}(e,t,c,r,i,a,o);if(!(r&d)){var g=h&&ut.call(e,"__wrapped__"),v=p&&ut.call(t,"__wrapped__");if(g||v){var y=g?e.value():e,x=v?t.value():t;return o||(o=new Sr),a(y,x,r,i,o)}}return!!m&&(o||(o=new Sr),function(e,t,r,i,a,o){var s=r&d,l=Oa(e),c=l.length,u=Oa(t).length;if(c!=u&&!s)return!1;for(var h=c;h--;){var p=l[h];if(!(s?p in t:ut.call(t,p)))return!1}var f=o.get(e),m=o.get(t);if(f&&m)return f==t&&m==e;var g=!0;o.set(e,t),o.set(t,e);for(var v=s;++h<c;){p=l[h];var y=e[p],x=t[p];if(i)var _=s?i(x,y,p,t,e,o):i(y,x,p,e,t,o);if(!(_===n?y===x||a(y,x,r,i,o):_)){g=!1;break}v||(v="constructor"==p)}if(g&&!v){var b=e.constructor,w=t.constructor;b!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(g=!1)}return o.delete(e),o.delete(t),g}(e,t,r,i,a,o))}(e,t,r,i,si,a))}function li(e,t,r,i){var a=r.length,o=a,s=!i;if(null==e)return!o;for(e=tt(e);a--;){var l=r[a];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++a<o;){var c=(l=r[a])[0],u=e[c],h=l[1];if(s&&l[2]){if(u===n&&!(c in e))return!1}else{var p=new Sr;if(i)var m=i(u,h,c,e,t,p);if(!(m===n?si(h,u,d|f,i,p):m))return!1}}return!0}function ci(e){return!(!Ls(e)||pt&&pt in e)&&(Es(e)?yt:He).test(po(e))}function ui(e){return"function"==typeof e?e:null==e?Ol:"object"==typeof e?xs(e)?gi(e[0],e[1]):mi(e):zl(e)}function hi(e){if(!Ka(e))return qn(e);var t=[];for(var n in tt(e))ut.call(e,n)&&"constructor"!=n&&t.push(n);return t}function pi(e){if(!Ls(e))return function(e){var t=[];if(null!=e)for(var n in tt(e))t.push(n);return t}(e);var t=Ka(e),n=[];for(var r in e)("constructor"!=r||!t&&ut.call(e,r))&&n.push(r);return n}function di(e,t){return e<t}function fi(e,t){var n=-1,r=bs(e)?$e(e.length):[];return zr(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function mi(e){var t=Ga(e);return 1==t.length&&t[0][2]?eo(t[0][0],t[0][1]):function(n){return n===e||li(n,e,t)}}function gi(e,t){return Ya(e)&&Qa(t)?eo(ho(e),t):function(r){var i=tl(r,e);return i===n&&i===t?nl(r,e):si(t,i,d|f)}}function vi(e,t,r,i,a){e!==t&&Jr(t,function(o,s){if(a||(a=new Sr),Ls(o))!function(e,t,r,i,a,o,s){var l=ro(e,r),c=ro(t,r),u=s.get(c);if(u)Lr(e,r,u);else{var h=o?o(l,c,r+"",e,t,s):n,p=h===n;if(p){var d=xs(c),f=!d&&Ms(c),m=!d&&!f&&Fs(c);h=c,d||f||m?xs(l)?h=l:ws(l)?h=ia(l):f?(p=!1,h=Ki(c,!0)):m?(p=!1,h=ea(c,!0)):h=[]:Rs(c)||ys(c)?(h=l,ys(l)?h=qs(l):Ls(l)&&!Es(l)||(h=Wa(c))):p=!1}p&&(s.set(c,h),a(h,c,i,o,s),s.delete(c)),Lr(e,r,h)}}(e,t,s,r,vi,i,a);else{var l=i?i(ro(e,s),o,s+"",e,t,a):n;l===n&&(l=o),Lr(e,s,l)}},sl)}function yi(e,t){var r=e.length;if(r)return Ja(t+=t<0?r:0,r)?e[t]:n}function xi(e,t,n){var r=-1;return t=Zt(t=t.length?Zt(t,function(e){return xs(e)?function(t){return Kr(t,1===e.length?e[0]:e)}:e}):[Ol],gn(ka())),function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(fi(e,function(e,n,i){return{criteria:Zt(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var l=ta(i[r],a[r]);if(l){if(r>=s)return l;var c=n[r];return l*("desc"==c?-1:1)}}return e.index-t.index}(e,t,n)})}function _i(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=Kr(e,o);n(s,o)&&Ai(a,Xi(o,e),s)}return a}function bi(e,t,n,r){var i=r?sn:on,a=-1,o=t.length,s=e;for(e===t&&(t=ia(t)),n&&(s=Zt(e,gn(n)));++a<o;)for(var l=0,c=t[a],u=n?n(c):c;(l=i(s,u,l,r))>-1;)s!==e&&Nt.call(s,l,1),Nt.call(e,l,1);return e}function wi(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==a){var a=i;Ja(i)?Nt.call(e,i,1):Vi(e,i)}}return e}function Mi(e,t){return e+zn(Zn()*(t-e+1))}function Si(e,t){var n="";if(!e||t<1||t>O)return n;do{t%2&&(n+=e),(t=zn(t/2))&&(e+=e)}while(t);return n}function Ti(e,t){return oo(to(e,t,Ol),e+"")}function Ei(e){return Er(ml(e))}function Ci(e,t){var n=ml(e);return co(n,Nr(t,0,n.length))}function Ai(e,t,r,i){if(!Ls(e))return e;for(var a=-1,o=(t=Xi(t,e)).length,s=o-1,l=e;null!=l&&++a<o;){var c=ho(t[a]),u=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(a!=s){var h=l[c];(u=i?i(h,c,l):n)===n&&(u=Ls(h)?h:Ja(t[a+1])?[]:{})}Dr(l,c,u),l=l[c]}return e}var Li=ar?function(e,t){return ar.set(e,t),e}:Ol,Di=Nn?function(e,t){return Nn(e,"toString",{configurable:!0,enumerable:!1,value:Ll(t),writable:!0})}:Ol;function Pi(e){return co(ml(e))}function Oi(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=$e(i);++r<i;)a[r]=e[r+t];return a}function Ri(e,t){var n;return zr(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}function Ii(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=k){for(;r<i;){var a=r+i>>>1,o=e[a];null!==o&&!ks(o)&&(n?o<=t:o<t)?r=a+1:i=a}return i}return Bi(e,t,Ol,n)}function Bi(e,t,r,i){var a=0,o=null==e?0:e.length;if(0===o)return 0;for(var s=(t=r(t))!=t,l=null===t,c=ks(t),u=t===n;a<o;){var h=zn((a+o)/2),p=r(e[h]),d=p!==n,f=null===p,m=p==p,g=ks(p);if(s)var v=i||m;else v=u?m&&(i||d):l?m&&d&&(i||!f):c?m&&d&&!f&&(i||!g):!f&&!g&&(i?p<=t:p<t);v?a=h+1:o=h}return Xn(o,N)}function Ni(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var o=e[n],s=t?t(o):o;if(!n||!ms(s,l)){var l=s;a[i++]=0===o?0:o}}return a}function ki(e){return"number"==typeof e?e:ks(e)?I:+e}function Fi(e){if("string"==typeof e)return e;if(xs(e))return Zt(e,Fi)+"";if(ks(e))return fr?fr.call(e):"";var t=e+"";return"0"==t&&1/e==-P?"-0":t}function Gi(e,t,n){var i=-1,a=Yt,o=e.length,s=!0,l=[],c=l;if(n)s=!1,a=$t;else if(o>=r){var u=t?null:Sa(e);if(u)return An(u);s=!1,a=yn,c=new Mr}else c=t?[]:l;e:for(;++i<o;){var h=e[i],p=t?t(h):h;if(h=n||0!==h?h:0,s&&p==p){for(var d=c.length;d--;)if(c[d]===p)continue e;t&&c.push(p),l.push(h)}else a(c,p,n)||(c!==l&&c.push(p),l.push(h))}return l}function Vi(e,t){return null==(e=no(e,t=Xi(t,e)))||delete e[ho(To(t))]}function zi(e,t,n,r){return Ai(e,t,n(Kr(e,t)),r)}function Ui(e,t,n,r){for(var i=e.length,a=r?i:-1;(r?a--:++a<i)&&t(e[a],a,e););return n?Oi(e,r?0:a,r?a+1:i):Oi(e,r?a+1:0,r?i:a)}function ji(e,t){var n=e;return n instanceof xr&&(n=n.value()),Qt(t,function(e,t){return t.func.apply(t.thisArg,Kt([e],t.args))},n)}function Hi(e,t,n){var r=e.length;if(r<2)return r?Gi(e[0]):[];for(var i=-1,a=$e(r);++i<r;)for(var o=e[i],s=-1;++s<r;)s!=i&&(a[i]=Vr(a[i]||o,e[s],t,n));return Gi(qr(a,1),t,n)}function Wi(e,t,r){for(var i=-1,a=e.length,o=t.length,s={};++i<a;){var l=i<o?t[i]:n;r(s,e[i],l)}return s}function qi(e){return ws(e)?e:[]}function Ji(e){return"function"==typeof e?e:Ol}function Xi(e,t){return xs(e)?e:Ya(e,t)?[e]:uo(Js(e))}var Yi=Ti;function $i(e,t,r){var i=e.length;return r=r===n?i:r,!t&&r>=i?e:Oi(e,t,r)}var Zi=kn||function(e){return Pt.clearTimeout(e)};function Ki(e,t){if(t)return e.slice();var n=e.length,r=Dt?Dt(n):new e.constructor(n);return e.copy(r),r}function Qi(e){var t=new e.constructor(e.byteLength);return new Lt(t).set(new Lt(e)),t}function ea(e,t){var n=t?Qi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function ta(e,t){if(e!==t){var r=e!==n,i=null===e,a=e==e,o=ks(e),s=t!==n,l=null===t,c=t==t,u=ks(t);if(!l&&!u&&!o&&e>t||o&&s&&c&&!l&&!u||i&&s&&c||!r&&c||!a)return 1;if(!i&&!o&&!u&&e<t||u&&r&&a&&!i&&!o||l&&r&&a||!s&&a||!c)return-1}return 0}function na(e,t,n,r){for(var i=-1,a=e.length,o=n.length,s=-1,l=t.length,c=Jn(a-o,0),u=$e(l+c),h=!r;++s<l;)u[s]=t[s];for(;++i<o;)(h||i<a)&&(u[n[i]]=e[i]);for(;c--;)u[s++]=e[i++];return u}function ra(e,t,n,r){for(var i=-1,a=e.length,o=-1,s=n.length,l=-1,c=t.length,u=Jn(a-s,0),h=$e(u+c),p=!r;++i<u;)h[i]=e[i];for(var d=i;++l<c;)h[d+l]=t[l];for(;++o<s;)(p||i<a)&&(h[d+n[o]]=e[i++]);return h}function ia(e,t){var n=-1,r=e.length;for(t||(t=$e(r));++n<r;)t[n]=e[n];return t}function aa(e,t,r,i){var a=!r;r||(r={});for(var o=-1,s=t.length;++o<s;){var l=t[o],c=i?i(r[l],e[l],l,r,e):n;c===n&&(c=e[l]),a?Ir(r,l,c):Dr(r,l,c)}return r}function oa(e,t){return function(n,r){var i=xs(n)?Ht:Or,a=t?t():{};return i(n,e,ka(r,2),a)}}function sa(e){return Ti(function(t,r){var i=-1,a=r.length,o=a>1?r[a-1]:n,s=a>2?r[2]:n;for(o=e.length>3&&"function"==typeof o?(a--,o):n,s&&Xa(r[0],r[1],s)&&(o=a<3?n:o,a=1),t=tt(t);++i<a;){var l=r[i];l&&e(t,l,i,o)}return t})}function la(e,t){return function(n,r){if(null==n)return n;if(!bs(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=tt(n);(t?a--:++a<i)&&!1!==r(o[a],a,o););return n}}function ca(e){return function(t,n,r){for(var i=-1,a=tt(t),o=r(t),s=o.length;s--;){var l=o[e?s:++i];if(!1===n(a[l],l,a))break}return t}}function ua(e){return function(t){var r=Sn(t=Js(t))?Pn(t):n,i=r?r[0]:t.charAt(0),a=r?$i(r,1).join(""):t.slice(1);return i[e]()+a}}function ha(e){return function(t){return Qt(El(yl(t).replace(gt,"")),e,"")}}function pa(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=gr(e.prototype),r=e.apply(n,t);return Ls(r)?r:n}}function da(e){return function(t,r,i){var a=tt(t);if(!bs(t)){var o=ka(r,3);t=ol(t),r=function(e){return o(a[e],e,a)}}var s=e(t,r,i);return s>-1?a[o?t[s]:s]:n}}function fa(e){return Pa(function(t){var r=t.length,i=r,o=yr.prototype.thru;for(e&&t.reverse();i--;){var s=t[i];if("function"!=typeof s)throw new it(a);if(o&&!l&&"wrapper"==Ba(s))var l=new yr([],!0)}for(i=l?i:r;++i<r;){var c=Ba(s=t[i]),u="wrapper"==c?Ia(s):n;l=u&&$a(u[0])&&u[1]==(w|y|_|M)&&!u[4].length&&1==u[9]?l[Ba(u[0])].apply(l,u[3]):1==s.length&&$a(s)?l[c]():l.thru(s)}return function(){var e=arguments,n=e[0];if(l&&1==e.length&&xs(n))return l.plant(n).value();for(var i=0,a=r?t[i].apply(this,e):n;++i<r;)a=t[i].call(this,a);return a}})}function ma(e,t,r,i,a,o,s,l,c,u){var h=t&w,p=t&m,d=t&g,f=t&(y|x),v=t&S,_=d?n:pa(e);return function m(){for(var g=arguments.length,y=$e(g),x=g;x--;)y[x]=arguments[x];if(f)var b=Na(m),w=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(y,b);if(i&&(y=na(y,i,a,f)),o&&(y=ra(y,o,s,f)),g-=w,f&&g<u){var M=Cn(y,b);return wa(e,t,ma,m.placeholder,r,y,M,l,c,u-g)}var S=p?r:this,T=d?S[e]:e;return g=y.length,l?y=function(e,t){for(var r=e.length,i=Xn(t.length,r),a=ia(e);i--;){var o=t[i];e[i]=Ja(o,r)?a[o]:n}return e}(y,l):v&&g>1&&y.reverse(),h&&c<g&&(y.length=c),this&&this!==Pt&&this instanceof m&&(T=_||pa(T)),T.apply(S,y)}}function ga(e,t){return function(n,r){return function(e,t,n,r){return Yr(e,function(e,i,a){t(r,n(e),i,a)}),r}(n,e,t(r),{})}}function va(e,t){return function(r,i){var a;if(r===n&&i===n)return t;if(r!==n&&(a=r),i!==n){if(a===n)return i;"string"==typeof r||"string"==typeof i?(r=Fi(r),i=Fi(i)):(r=ki(r),i=ki(i)),a=e(r,i)}return a}}function ya(e){return Pa(function(t){return t=Zt(t,gn(ka())),Ti(function(n){var r=this;return e(t,function(e){return jt(e,r,n)})})})}function xa(e,t){var r=(t=t===n?" ":Fi(t)).length;if(r<2)return r?Si(t,e):t;var i=Si(t,Vn(e/Dn(t)));return Sn(t)?$i(Pn(i),0,e).join(""):i.slice(0,e)}function _a(e){return function(t,r,i){return i&&"number"!=typeof i&&Xa(t,r,i)&&(r=i=n),t=Us(t),r===n?(r=t,t=0):r=Us(r),function(e,t,n,r){for(var i=-1,a=Jn(Vn((t-e)/(n||1)),0),o=$e(a);a--;)o[r?a:++i]=e,e+=n;return o}(t,r,i=i===n?t<r?1:-1:Us(i),e)}}function ba(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=Ws(t),n=Ws(n)),e(t,n)}}function wa(e,t,r,i,a,o,s,l,c,u){var h=t&y;t|=h?_:b,(t&=~(h?b:_))&v||(t&=~(m|g));var p=[e,t,a,h?o:n,h?s:n,h?n:o,h?n:s,l,c,u],d=r.apply(n,p);return $a(e)&&io(d,p),d.placeholder=i,so(d,e,t)}function Ma(e){var t=et[e];return function(e,n){if(e=Ws(e),(n=null==n?0:Xn(js(n),292))&&Hn(e)){var r=(Js(e)+"e").split("e");return+((r=(Js(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Sa=nr&&1/An(new nr([,-0]))[1]==P?function(e){return new nr(e)}:kl;function Ta(e){return function(t){var n=ja(t);return n==X?Tn(t):n==ee?Ln(t):function(e,t){return Zt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Ea(e,t,r,i,o,s,l,u){var h=t&g;if(!h&&"function"!=typeof e)throw new it(a);var p=i?i.length:0;if(p||(t&=~(_|b),i=o=n),l=l===n?l:Jn(js(l),0),u=u===n?u:js(u),p-=o?o.length:0,t&b){var d=i,f=o;i=o=n}var S=h?n:Ia(e),T=[e,t,r,i,o,d,f,s,l,u];if(S&&function(e,t){var n=e[1],r=t[1],i=n|r,a=i<(m|g|w),o=r==w&&n==y||r==w&&n==M&&e[7].length<=t[8]||r==(w|M)&&t[7].length<=t[8]&&n==y;if(!a&&!o)return e;r&m&&(e[2]=t[2],i|=n&m?0:v);var s=t[3];if(s){var l=e[3];e[3]=l?na(l,s,t[4]):s,e[4]=l?Cn(e[3],c):t[4]}(s=t[5])&&(l=e[5],e[5]=l?ra(l,s,t[6]):s,e[6]=l?Cn(e[5],c):t[6]),(s=t[7])&&(e[7]=s),r&w&&(e[8]=null==e[8]?t[8]:Xn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(T,S),e=T[0],t=T[1],r=T[2],i=T[3],o=T[4],!(u=T[9]=T[9]===n?h?0:e.length:Jn(T[9]-p,0))&&t&(y|x)&&(t&=~(y|x)),t&&t!=m)E=t==y||t==x?function(e,t,r){var i=pa(e);return function a(){for(var o=arguments.length,s=$e(o),l=o,c=Na(a);l--;)s[l]=arguments[l];var u=o<3&&s[0]!==c&&s[o-1]!==c?[]:Cn(s,c);return(o-=u.length)<r?wa(e,t,ma,a.placeholder,n,s,u,n,n,r-o):jt(this&&this!==Pt&&this instanceof a?i:e,this,s)}}(e,t,u):t!=_&&t!=(m|_)||o.length?ma.apply(n,T):function(e,t,n,r){var i=t&m,a=pa(e);return function t(){for(var o=-1,s=arguments.length,l=-1,c=r.length,u=$e(c+s),h=this&&this!==Pt&&this instanceof t?a:e;++l<c;)u[l]=r[l];for(;s--;)u[l++]=arguments[++o];return jt(h,i?n:this,u)}}(e,t,r,i);else var E=function(e,t,n){var r=t&m,i=pa(e);return function t(){return(this&&this!==Pt&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,r);return so((S?Li:io)(E,T),e,t)}function Ca(e,t,r,i){return e===n||ms(e,st[r])&&!ut.call(i,r)?t:e}function Aa(e,t,r,i,a,o){return Ls(e)&&Ls(t)&&(o.set(t,e),vi(e,t,n,Aa,o),o.delete(t)),e}function La(e){return Rs(e)?n:e}function Da(e,t,r,i,a,o){var s=r&d,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var u=o.get(e),h=o.get(t);if(u&&h)return u==t&&h==e;var p=-1,m=!0,g=r&f?new Mr:n;for(o.set(e,t),o.set(t,e);++p<l;){var v=e[p],y=t[p];if(i)var x=s?i(y,v,p,t,e,o):i(v,y,p,e,t,o);if(x!==n){if(x)continue;m=!1;break}if(g){if(!tn(t,function(e,t){if(!yn(g,t)&&(v===e||a(v,e,r,i,o)))return g.push(t)})){m=!1;break}}else if(v!==y&&!a(v,y,r,i,o)){m=!1;break}}return o.delete(e),o.delete(t),m}function Pa(e){return oo(to(e,n,_o),e+"")}function Oa(e){return Qr(e,ol,za)}function Ra(e){return Qr(e,sl,Ua)}var Ia=ar?function(e){return ar.get(e)}:kl;function Ba(e){for(var t=e.name+"",n=or[t],r=ut.call(or,t)?n.length:0;r--;){var i=n[r],a=i.func;if(null==a||a==e)return i.name}return t}function Na(e){return(ut.call(mr,"placeholder")?mr:e).placeholder}function ka(){var e=mr.iteratee||Rl;return e=e===Rl?ui:e,arguments.length?e(arguments[0],arguments[1]):e}function Fa(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function Ga(e){for(var t=ol(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Qa(i)]}return t}function Va(e,t){var r=function(e,t){return null==e?n:e[t]}(e,t);return ci(r)?r:n}var za=Un?function(e){return null==e?[]:(e=tt(e),Xt(Un(e),function(t){return Bt.call(e,t)}))}:Hl,Ua=Un?function(e){for(var t=[];e;)Kt(t,za(e)),e=Ot(e);return t}:Hl,ja=ei;function Ha(e,t,n){for(var r=-1,i=(t=Xi(t,e)).length,a=!1;++r<i;){var o=ho(t[r]);if(!(a=null!=e&&n(e,o)))break;e=e[o]}return a||++r!=i?a:!!(i=null==e?0:e.length)&&As(i)&&Ja(o,i)&&(xs(e)||ys(e))}function Wa(e){return"function"!=typeof e.constructor||Ka(e)?{}:gr(Ot(e))}function qa(e){return xs(e)||ys(e)||!!(nn&&e&&e[nn])}function Ja(e,t){var n=typeof e;return!!(t=null==t?O:t)&&("number"==n||"symbol"!=n&&qe.test(e))&&e>-1&&e%1==0&&e<t}function Xa(e,t,n){if(!Ls(n))return!1;var r=typeof t;return!!("number"==r?bs(n)&&Ja(t,n.length):"string"==r&&t in n)&&ms(n[t],e)}function Ya(e,t){if(xs(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ks(e))||Ae.test(e)||!Ce.test(e)||null!=t&&e in tt(t)}function $a(e){var t=Ba(e),n=mr[t];if("function"!=typeof n||!(t in xr.prototype))return!1;if(e===n)return!0;var r=Ia(n);return!!r&&e===r[0]}(Qn&&ja(new Qn(new ArrayBuffer(1)))!=se||er&&ja(new er)!=X||tr&&"[object Promise]"!=ja(tr.resolve())||nr&&ja(new nr)!=ee||rr&&ja(new rr)!=ie)&&(ja=function(e){var t=ei(e),r=t==Z?e.constructor:n,i=r?po(r):"";if(i)switch(i){case sr:return se;case lr:return X;case cr:return"[object Promise]";case ur:return ee;case hr:return ie}return t});var Za=lt?Es:Wl;function Ka(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||st)}function Qa(e){return e==e&&!Ls(e)}function eo(e,t){return function(r){return null!=r&&r[e]===t&&(t!==n||e in tt(r))}}function to(e,t,r){return t=Jn(t===n?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=Jn(n.length-t,0),o=$e(a);++i<a;)o[i]=n[t+i];i=-1;for(var s=$e(t+1);++i<t;)s[i]=n[i];return s[t]=r(o),jt(e,this,s)}}function no(e,t){return t.length<2?e:Kr(e,Oi(t,0,-1))}function ro(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var io=lo(Li),ao=Gn||function(e,t){return Pt.setTimeout(e,t)},oo=lo(Di);function so(e,t,n){var r=t+"";return oo(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(Ie,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Wt(F,function(n){var r="_."+n[0];t&n[1]&&!Yt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(Be);return t?t[1].split(Ne):[]}(r),n)))}function lo(e){var t=0,r=0;return function(){var i=Yn(),a=A-(i-r);if(r=i,a>0){if(++t>=C)return arguments[0]}else t=0;return e.apply(n,arguments)}}function co(e,t){var r=-1,i=e.length,a=i-1;for(t=t===n?i:t;++r<t;){var o=Mi(r,a),s=e[o];e[o]=e[r],e[r]=s}return e.length=t,e}var uo=function(e){var t=cs(e,function(e){return n.size===l&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Le,function(e,n,r,i){t.push(r?i.replace(Ge,"$1"):n||e)}),t});function ho(e){if("string"==typeof e||ks(e))return e;var t=e+"";return"0"==t&&1/e==-P?"-0":t}function po(e){if(null!=e){try{return ct.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function fo(e){if(e instanceof xr)return e.clone();var t=new yr(e.__wrapped__,e.__chain__);return t.__actions__=ia(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var mo=Ti(function(e,t){return ws(e)?Vr(e,qr(t,1,ws,!0)):[]}),go=Ti(function(e,t){var r=To(t);return ws(r)&&(r=n),ws(e)?Vr(e,qr(t,1,ws,!0),ka(r,2)):[]}),vo=Ti(function(e,t){var r=To(t);return ws(r)&&(r=n),ws(e)?Vr(e,qr(t,1,ws,!0),n,r):[]});function yo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:js(n);return i<0&&(i=Jn(r+i,0)),an(e,ka(t,3),i)}function xo(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var a=i-1;return r!==n&&(a=js(r),a=r<0?Jn(i+a,0):Xn(a,i-1)),an(e,ka(t,3),a,!0)}function _o(e){return null!=e&&e.length?qr(e,1):[]}function bo(e){return e&&e.length?e[0]:n}var wo=Ti(function(e){var t=Zt(e,qi);return t.length&&t[0]===e[0]?ii(t):[]}),Mo=Ti(function(e){var t=To(e),r=Zt(e,qi);return t===To(r)?t=n:r.pop(),r.length&&r[0]===e[0]?ii(r,ka(t,2)):[]}),So=Ti(function(e){var t=To(e),r=Zt(e,qi);return(t="function"==typeof t?t:n)&&r.pop(),r.length&&r[0]===e[0]?ii(r,n,t):[]});function To(e){var t=null==e?0:e.length;return t?e[t-1]:n}var Eo=Ti(Co);function Co(e,t){return e&&e.length&&t&&t.length?bi(e,t):e}var Ao=Pa(function(e,t){var n=null==e?0:e.length,r=Br(e,t);return wi(e,Zt(t,function(e){return Ja(e,n)?+e:e}).sort(ta)),r});function Lo(e){return null==e?e:Kn.call(e)}var Do=Ti(function(e){return Gi(qr(e,1,ws,!0))}),Po=Ti(function(e){var t=To(e);return ws(t)&&(t=n),Gi(qr(e,1,ws,!0),ka(t,2))}),Oo=Ti(function(e){var t=To(e);return t="function"==typeof t?t:n,Gi(qr(e,1,ws,!0),n,t)});function Ro(e){if(!e||!e.length)return[];var t=0;return e=Xt(e,function(e){if(ws(e))return t=Jn(e.length,t),!0}),fn(t,function(t){return Zt(e,un(t))})}function Io(e,t){if(!e||!e.length)return[];var r=Ro(e);return null==t?r:Zt(r,function(e){return jt(t,n,e)})}var Bo=Ti(function(e,t){return ws(e)?Vr(e,t):[]}),No=Ti(function(e){return Hi(Xt(e,ws))}),ko=Ti(function(e){var t=To(e);return ws(t)&&(t=n),Hi(Xt(e,ws),ka(t,2))}),Fo=Ti(function(e){var t=To(e);return t="function"==typeof t?t:n,Hi(Xt(e,ws),n,t)}),Go=Ti(Ro);var Vo=Ti(function(e){var t=e.length,r=t>1?e[t-1]:n;return Io(e,r="function"==typeof r?(e.pop(),r):n)});function zo(e){var t=mr(e);return t.__chain__=!0,t}function Uo(e,t){return t(e)}var jo=Pa(function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,a=function(t){return Br(t,e)};return!(t>1||this.__actions__.length)&&i instanceof xr&&Ja(r)?((i=i.slice(r,+r+(t?1:0))).__actions__.push({func:Uo,args:[a],thisArg:n}),new yr(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e})):this.thru(a)});var Ho=oa(function(e,t,n){ut.call(e,n)?++e[n]:Ir(e,n,1)});var Wo=da(yo),qo=da(xo);function Jo(e,t){return(xs(e)?Wt:zr)(e,ka(t,3))}function Xo(e,t){return(xs(e)?qt:Ur)(e,ka(t,3))}var Yo=oa(function(e,t,n){ut.call(e,n)?e[n].push(t):Ir(e,n,[t])});var $o=Ti(function(e,t,n){var r=-1,i="function"==typeof t,a=bs(e)?$e(e.length):[];return zr(e,function(e){a[++r]=i?jt(t,e,n):ai(e,t,n)}),a}),Zo=oa(function(e,t,n){Ir(e,n,t)});function Ko(e,t){return(xs(e)?Zt:fi)(e,ka(t,3))}var Qo=oa(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});var es=Ti(function(e,t){if(null==e)return[];var n=t.length;return n>1&&Xa(e,t[0],t[1])?t=[]:n>2&&Xa(t[0],t[1],t[2])&&(t=[t[0]]),xi(e,qr(t,1),[])}),ts=Fn||function(){return Pt.Date.now()};function ns(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Ea(e,w,n,n,n,n,t)}function rs(e,t){var r;if("function"!=typeof t)throw new it(a);return e=js(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var is=Ti(function(e,t,n){var r=m;if(n.length){var i=Cn(n,Na(is));r|=_}return Ea(e,r,t,n,i)}),as=Ti(function(e,t,n){var r=m|g;if(n.length){var i=Cn(n,Na(as));r|=_}return Ea(t,r,e,n,i)});function os(e,t,r){var i,o,s,l,c,u,h=0,p=!1,d=!1,f=!0;if("function"!=typeof e)throw new it(a);function m(t){var r=i,a=o;return i=o=n,h=t,l=e.apply(a,r)}function g(e){var r=e-u;return u===n||r>=t||r<0||d&&e-h>=s}function v(){var e=ts();if(g(e))return y(e);c=ao(v,function(e){var n=t-(e-u);return d?Xn(n,s-(e-h)):n}(e))}function y(e){return c=n,f&&i?m(e):(i=o=n,l)}function x(){var e=ts(),r=g(e);if(i=arguments,o=this,u=e,r){if(c===n)return function(e){return h=e,c=ao(v,t),p?m(e):l}(u);if(d)return Zi(c),c=ao(v,t),m(u)}return c===n&&(c=ao(v,t)),l}return t=Ws(t)||0,Ls(r)&&(p=!!r.leading,s=(d="maxWait"in r)?Jn(Ws(r.maxWait)||0,t):s,f="trailing"in r?!!r.trailing:f),x.cancel=function(){c!==n&&Zi(c),h=0,i=u=o=c=n},x.flush=function(){return c===n?l:y(ts())},x}var ss=Ti(function(e,t){return Gr(e,1,t)}),ls=Ti(function(e,t,n){return Gr(e,Ws(t)||0,n)});function cs(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new it(a);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(cs.Cache||wr),n}function us(e){if("function"!=typeof e)throw new it(a);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}cs.Cache=wr;var hs=Yi(function(e,t){var n=(t=1==t.length&&xs(t[0])?Zt(t[0],gn(ka())):Zt(qr(t,1),gn(ka()))).length;return Ti(function(r){for(var i=-1,a=Xn(r.length,n);++i<a;)r[i]=t[i].call(this,r[i]);return jt(e,this,r)})}),ps=Ti(function(e,t){var r=Cn(t,Na(ps));return Ea(e,_,n,t,r)}),ds=Ti(function(e,t){var r=Cn(t,Na(ds));return Ea(e,b,n,t,r)}),fs=Pa(function(e,t){return Ea(e,M,n,n,n,t)});function ms(e,t){return e===t||e!=e&&t!=t}var gs=ba(ti),vs=ba(function(e,t){return e>=t}),ys=oi(function(){return arguments}())?oi:function(e){return Ds(e)&&ut.call(e,"callee")&&!Bt.call(e,"callee")},xs=$e.isArray,_s=kt?gn(kt):function(e){return Ds(e)&&ei(e)==oe};function bs(e){return null!=e&&As(e.length)&&!Es(e)}function ws(e){return Ds(e)&&bs(e)}var Ms=jn||Wl,Ss=Ft?gn(Ft):function(e){return Ds(e)&&ei(e)==j};function Ts(e){if(!Ds(e))return!1;var t=ei(e);return t==W||t==H||"string"==typeof e.message&&"string"==typeof e.name&&!Rs(e)}function Es(e){if(!Ls(e))return!1;var t=ei(e);return t==q||t==J||t==z||t==K}function Cs(e){return"number"==typeof e&&e==js(e)}function As(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=O}function Ls(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ds(e){return null!=e&&"object"==typeof e}var Ps=Gt?gn(Gt):function(e){return Ds(e)&&ja(e)==X};function Os(e){return"number"==typeof e||Ds(e)&&ei(e)==Y}function Rs(e){if(!Ds(e)||ei(e)!=Z)return!1;var t=Ot(e);if(null===t)return!0;var n=ut.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ct.call(n)==ft}var Is=Vt?gn(Vt):function(e){return Ds(e)&&ei(e)==Q};var Bs=zt?gn(zt):function(e){return Ds(e)&&ja(e)==ee};function Ns(e){return"string"==typeof e||!xs(e)&&Ds(e)&&ei(e)==te}function ks(e){return"symbol"==typeof e||Ds(e)&&ei(e)==ne}var Fs=Ut?gn(Ut):function(e){return Ds(e)&&As(e.length)&&!!St[ei(e)]};var Gs=ba(di),Vs=ba(function(e,t){return e<=t});function zs(e){if(!e)return[];if(bs(e))return Ns(e)?Pn(e):ia(e);if(hn&&e[hn])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[hn]());var t=ja(e);return(t==X?Tn:t==ee?An:ml)(e)}function Us(e){return e?(e=Ws(e))===P||e===-P?(e<0?-1:1)*R:e==e?e:0:0===e?e:0}function js(e){var t=Us(e),n=t%1;return t==t?n?t-n:t:0}function Hs(e){return e?Nr(js(e),0,B):0}function Ws(e){if("number"==typeof e)return e;if(ks(e))return I;if(Ls(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ls(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=mn(e);var n=je.test(e);return n||We.test(e)?At(e.slice(2),n?2:8):Ue.test(e)?I:+e}function qs(e){return aa(e,sl(e))}function Js(e){return null==e?"":Fi(e)}var Xs=sa(function(e,t){if(Ka(t)||bs(t))aa(t,ol(t),e);else for(var n in t)ut.call(t,n)&&Dr(e,n,t[n])}),Ys=sa(function(e,t){aa(t,sl(t),e)}),$s=sa(function(e,t,n,r){aa(t,sl(t),e,r)}),Zs=sa(function(e,t,n,r){aa(t,ol(t),e,r)}),Ks=Pa(Br);var Qs=Ti(function(e,t){e=tt(e);var r=-1,i=t.length,a=i>2?t[2]:n;for(a&&Xa(t[0],t[1],a)&&(i=1);++r<i;)for(var o=t[r],s=sl(o),l=-1,c=s.length;++l<c;){var u=s[l],h=e[u];(h===n||ms(h,st[u])&&!ut.call(e,u))&&(e[u]=o[u])}return e}),el=Ti(function(e){return e.push(n,Aa),jt(cl,n,e)});function tl(e,t,r){var i=null==e?n:Kr(e,t);return i===n?r:i}function nl(e,t){return null!=e&&Ha(e,t,ri)}var rl=ga(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=dt.call(t)),e[t]=n},Ll(Ol)),il=ga(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=dt.call(t)),ut.call(e,t)?e[t].push(n):e[t]=[n]},ka),al=Ti(ai);function ol(e){return bs(e)?Tr(e):hi(e)}function sl(e){return bs(e)?Tr(e,!0):pi(e)}var ll=sa(function(e,t,n){vi(e,t,n)}),cl=sa(function(e,t,n,r){vi(e,t,n,r)}),ul=Pa(function(e,t){var n={};if(null==e)return n;var r=!1;t=Zt(t,function(t){return t=Xi(t,e),r||(r=t.length>1),t}),aa(e,Ra(e),n),r&&(n=kr(n,u|h|p,La));for(var i=t.length;i--;)Vi(n,t[i]);return n});var hl=Pa(function(e,t){return null==e?{}:function(e,t){return _i(e,t,function(t,n){return nl(e,n)})}(e,t)});function pl(e,t){if(null==e)return{};var n=Zt(Ra(e),function(e){return[e]});return t=ka(t),_i(e,n,function(e,n){return t(e,n[0])})}var dl=Ta(ol),fl=Ta(sl);function ml(e){return null==e?[]:vn(e,ol(e))}var gl=ha(function(e,t,n){return t=t.toLowerCase(),e+(n?vl(t):t)});function vl(e){return Tl(Js(e).toLowerCase())}function yl(e){return(e=Js(e))&&e.replace(Je,bn).replace(vt,"")}var xl=ha(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),_l=ha(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),bl=ua("toLowerCase");var wl=ha(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()});var Ml=ha(function(e,t,n){return e+(n?" ":"")+Tl(t)});var Sl=ha(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Tl=ua("toUpperCase");function El(e,t,r){return e=Js(e),(t=r?n:t)===n?function(e){return bt.test(e)}(e)?function(e){return e.match(xt)||[]}(e):function(e){return e.match(ke)||[]}(e):e.match(t)||[]}var Cl=Ti(function(e,t){try{return jt(e,n,t)}catch(e){return Ts(e)?e:new Ke(e)}}),Al=Pa(function(e,t){return Wt(t,function(t){t=ho(t),Ir(e,t,is(e[t],e))}),e});function Ll(e){return function(){return e}}var Dl=fa(),Pl=fa(!0);function Ol(e){return e}function Rl(e){return ui("function"==typeof e?e:kr(e,u))}var Il=Ti(function(e,t){return function(n){return ai(n,e,t)}}),Bl=Ti(function(e,t){return function(n){return ai(e,n,t)}});function Nl(e,t,n){var r=ol(t),i=Zr(t,r);null!=n||Ls(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=Zr(t,ol(t)));var a=!(Ls(n)&&"chain"in n&&!n.chain),o=Es(e);return Wt(i,function(n){var r=t[n];e[n]=r,o&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__);return(n.__actions__=ia(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Kt([this.value()],arguments))})}),e}function kl(){}var Fl=ya(Zt),Gl=ya(Jt),Vl=ya(tn);function zl(e){return Ya(e)?un(ho(e)):function(e){return function(t){return Kr(t,e)}}(e)}var Ul=_a(),jl=_a(!0);function Hl(){return[]}function Wl(){return!1}var ql=va(function(e,t){return e+t},0),Jl=Ma("ceil"),Xl=va(function(e,t){return e/t},1),Yl=Ma("floor");var $l,Zl=va(function(e,t){return e*t},1),Kl=Ma("round"),Ql=va(function(e,t){return e-t},0);return mr.after=function(e,t){if("function"!=typeof t)throw new it(a);return e=js(e),function(){if(--e<1)return t.apply(this,arguments)}},mr.ary=ns,mr.assign=Xs,mr.assignIn=Ys,mr.assignInWith=$s,mr.assignWith=Zs,mr.at=Ks,mr.before=rs,mr.bind=is,mr.bindAll=Al,mr.bindKey=as,mr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return xs(e)?e:[e]},mr.chain=zo,mr.chunk=function(e,t,r){t=(r?Xa(e,t,r):t===n)?1:Jn(js(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,o=0,s=$e(Vn(i/t));a<i;)s[o++]=Oi(e,a,a+=t);return s},mr.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var a=e[t];a&&(i[r++]=a)}return i},mr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=$e(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Kt(xs(n)?ia(n):[n],qr(t,1))},mr.cond=function(e){var t=null==e?0:e.length,n=ka();return e=t?Zt(e,function(e){if("function"!=typeof e[1])throw new it(a);return[n(e[0]),e[1]]}):[],Ti(function(n){for(var r=-1;++r<t;){var i=e[r];if(jt(i[0],this,n))return jt(i[1],this,n)}})},mr.conforms=function(e){return function(e){var t=ol(e);return function(n){return Fr(n,e,t)}}(kr(e,u))},mr.constant=Ll,mr.countBy=Ho,mr.create=function(e,t){var n=gr(e);return null==t?n:Rr(n,t)},mr.curry=function e(t,r,i){var a=Ea(t,y,n,n,n,n,n,r=i?n:r);return a.placeholder=e.placeholder,a},mr.curryRight=function e(t,r,i){var a=Ea(t,x,n,n,n,n,n,r=i?n:r);return a.placeholder=e.placeholder,a},mr.debounce=os,mr.defaults=Qs,mr.defaultsDeep=el,mr.defer=ss,mr.delay=ls,mr.difference=mo,mr.differenceBy=go,mr.differenceWith=vo,mr.drop=function(e,t,r){var i=null==e?0:e.length;return i?Oi(e,(t=r||t===n?1:js(t))<0?0:t,i):[]},mr.dropRight=function(e,t,r){var i=null==e?0:e.length;return i?Oi(e,0,(t=i-(t=r||t===n?1:js(t)))<0?0:t):[]},mr.dropRightWhile=function(e,t){return e&&e.length?Ui(e,ka(t,3),!0,!0):[]},mr.dropWhile=function(e,t){return e&&e.length?Ui(e,ka(t,3),!0):[]},mr.fill=function(e,t,r,i){var a=null==e?0:e.length;return a?(r&&"number"!=typeof r&&Xa(e,t,r)&&(r=0,i=a),function(e,t,r,i){var a=e.length;for((r=js(r))<0&&(r=-r>a?0:a+r),(i=i===n||i>a?a:js(i))<0&&(i+=a),i=r>i?0:Hs(i);r<i;)e[r++]=t;return e}(e,t,r,i)):[]},mr.filter=function(e,t){return(xs(e)?Xt:Wr)(e,ka(t,3))},mr.flatMap=function(e,t){return qr(Ko(e,t),1)},mr.flatMapDeep=function(e,t){return qr(Ko(e,t),P)},mr.flatMapDepth=function(e,t,r){return r=r===n?1:js(r),qr(Ko(e,t),r)},mr.flatten=_o,mr.flattenDeep=function(e){return null!=e&&e.length?qr(e,P):[]},mr.flattenDepth=function(e,t){return null!=e&&e.length?qr(e,t=t===n?1:js(t)):[]},mr.flip=function(e){return Ea(e,S)},mr.flow=Dl,mr.flowRight=Pl,mr.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},mr.functions=function(e){return null==e?[]:Zr(e,ol(e))},mr.functionsIn=function(e){return null==e?[]:Zr(e,sl(e))},mr.groupBy=Yo,mr.initial=function(e){return null!=e&&e.length?Oi(e,0,-1):[]},mr.intersection=wo,mr.intersectionBy=Mo,mr.intersectionWith=So,mr.invert=rl,mr.invertBy=il,mr.invokeMap=$o,mr.iteratee=Rl,mr.keyBy=Zo,mr.keys=ol,mr.keysIn=sl,mr.map=Ko,mr.mapKeys=function(e,t){var n={};return t=ka(t,3),Yr(e,function(e,r,i){Ir(n,t(e,r,i),e)}),n},mr.mapValues=function(e,t){var n={};return t=ka(t,3),Yr(e,function(e,r,i){Ir(n,r,t(e,r,i))}),n},mr.matches=function(e){return mi(kr(e,u))},mr.matchesProperty=function(e,t){return gi(e,kr(t,u))},mr.memoize=cs,mr.merge=ll,mr.mergeWith=cl,mr.method=Il,mr.methodOf=Bl,mr.mixin=Nl,mr.negate=us,mr.nthArg=function(e){return e=js(e),Ti(function(t){return yi(t,e)})},mr.omit=ul,mr.omitBy=function(e,t){return pl(e,us(ka(t)))},mr.once=function(e){return rs(2,e)},mr.orderBy=function(e,t,r,i){return null==e?[]:(xs(t)||(t=null==t?[]:[t]),xs(r=i?n:r)||(r=null==r?[]:[r]),xi(e,t,r))},mr.over=Fl,mr.overArgs=hs,mr.overEvery=Gl,mr.overSome=Vl,mr.partial=ps,mr.partialRight=ds,mr.partition=Qo,mr.pick=hl,mr.pickBy=pl,mr.property=zl,mr.propertyOf=function(e){return function(t){return null==e?n:Kr(e,t)}},mr.pull=Eo,mr.pullAll=Co,mr.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?bi(e,t,ka(n,2)):e},mr.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?bi(e,t,n,r):e},mr.pullAt=Ao,mr.range=Ul,mr.rangeRight=jl,mr.rearg=fs,mr.reject=function(e,t){return(xs(e)?Xt:Wr)(e,us(ka(t,3)))},mr.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],a=e.length;for(t=ka(t,3);++r<a;){var o=e[r];t(o,r,e)&&(n.push(o),i.push(r))}return wi(e,i),n},mr.rest=function(e,t){if("function"!=typeof e)throw new it(a);return Ti(e,t=t===n?t:js(t))},mr.reverse=Lo,mr.sampleSize=function(e,t,r){return t=(r?Xa(e,t,r):t===n)?1:js(t),(xs(e)?Cr:Ci)(e,t)},mr.set=function(e,t,n){return null==e?e:Ai(e,t,n)},mr.setWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:Ai(e,t,r,i)},mr.shuffle=function(e){return(xs(e)?Ar:Pi)(e)},mr.slice=function(e,t,r){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&Xa(e,t,r)?(t=0,r=i):(t=null==t?0:js(t),r=r===n?i:js(r)),Oi(e,t,r)):[]},mr.sortBy=es,mr.sortedUniq=function(e){return e&&e.length?Ni(e):[]},mr.sortedUniqBy=function(e,t){return e&&e.length?Ni(e,ka(t,2)):[]},mr.split=function(e,t,r){return r&&"number"!=typeof r&&Xa(e,t,r)&&(t=r=n),(r=r===n?B:r>>>0)?(e=Js(e))&&("string"==typeof t||null!=t&&!Is(t))&&!(t=Fi(t))&&Sn(e)?$i(Pn(e),0,r):e.split(t,r):[]},mr.spread=function(e,t){if("function"!=typeof e)throw new it(a);return t=null==t?0:Jn(js(t),0),Ti(function(n){var r=n[t],i=$i(n,0,t);return r&&Kt(i,r),jt(e,this,i)})},mr.tail=function(e){var t=null==e?0:e.length;return t?Oi(e,1,t):[]},mr.take=function(e,t,r){return e&&e.length?Oi(e,0,(t=r||t===n?1:js(t))<0?0:t):[]},mr.takeRight=function(e,t,r){var i=null==e?0:e.length;return i?Oi(e,(t=i-(t=r||t===n?1:js(t)))<0?0:t,i):[]},mr.takeRightWhile=function(e,t){return e&&e.length?Ui(e,ka(t,3),!1,!0):[]},mr.takeWhile=function(e,t){return e&&e.length?Ui(e,ka(t,3)):[]},mr.tap=function(e,t){return t(e),e},mr.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new it(a);return Ls(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),os(e,t,{leading:r,maxWait:t,trailing:i})},mr.thru=Uo,mr.toArray=zs,mr.toPairs=dl,mr.toPairsIn=fl,mr.toPath=function(e){return xs(e)?Zt(e,ho):ks(e)?[e]:ia(uo(Js(e)))},mr.toPlainObject=qs,mr.transform=function(e,t,n){var r=xs(e),i=r||Ms(e)||Fs(e);if(t=ka(t,4),null==n){var a=e&&e.constructor;n=i?r?new a:[]:Ls(e)&&Es(a)?gr(Ot(e)):{}}return(i?Wt:Yr)(e,function(e,r,i){return t(n,e,r,i)}),n},mr.unary=function(e){return ns(e,1)},mr.union=Do,mr.unionBy=Po,mr.unionWith=Oo,mr.uniq=function(e){return e&&e.length?Gi(e):[]},mr.uniqBy=function(e,t){return e&&e.length?Gi(e,ka(t,2)):[]},mr.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?Gi(e,n,t):[]},mr.unset=function(e,t){return null==e||Vi(e,t)},mr.unzip=Ro,mr.unzipWith=Io,mr.update=function(e,t,n){return null==e?e:zi(e,t,Ji(n))},mr.updateWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:zi(e,t,Ji(r),i)},mr.values=ml,mr.valuesIn=function(e){return null==e?[]:vn(e,sl(e))},mr.without=Bo,mr.words=El,mr.wrap=function(e,t){return ps(Ji(t),e)},mr.xor=No,mr.xorBy=ko,mr.xorWith=Fo,mr.zip=Go,mr.zipObject=function(e,t){return Wi(e||[],t||[],Dr)},mr.zipObjectDeep=function(e,t){return Wi(e||[],t||[],Ai)},mr.zipWith=Vo,mr.entries=dl,mr.entriesIn=fl,mr.extend=Ys,mr.extendWith=$s,Nl(mr,mr),mr.add=ql,mr.attempt=Cl,mr.camelCase=gl,mr.capitalize=vl,mr.ceil=Jl,mr.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=Ws(r))==r?r:0),t!==n&&(t=(t=Ws(t))==t?t:0),Nr(Ws(e),t,r)},mr.clone=function(e){return kr(e,p)},mr.cloneDeep=function(e){return kr(e,u|p)},mr.cloneDeepWith=function(e,t){return kr(e,u|p,t="function"==typeof t?t:n)},mr.cloneWith=function(e,t){return kr(e,p,t="function"==typeof t?t:n)},mr.conformsTo=function(e,t){return null==t||Fr(e,t,ol(t))},mr.deburr=yl,mr.defaultTo=function(e,t){return null==e||e!=e?t:e},mr.divide=Xl,mr.endsWith=function(e,t,r){e=Js(e),t=Fi(t);var i=e.length,a=r=r===n?i:Nr(js(r),0,i);return(r-=t.length)>=0&&e.slice(r,a)==t},mr.eq=ms,mr.escape=function(e){return(e=Js(e))&&Me.test(e)?e.replace(be,wn):e},mr.escapeRegExp=function(e){return(e=Js(e))&&Pe.test(e)?e.replace(De,"\\$&"):e},mr.every=function(e,t,r){var i=xs(e)?Jt:jr;return r&&Xa(e,t,r)&&(t=n),i(e,ka(t,3))},mr.find=Wo,mr.findIndex=yo,mr.findKey=function(e,t){return rn(e,ka(t,3),Yr)},mr.findLast=qo,mr.findLastIndex=xo,mr.findLastKey=function(e,t){return rn(e,ka(t,3),$r)},mr.floor=Yl,mr.forEach=Jo,mr.forEachRight=Xo,mr.forIn=function(e,t){return null==e?e:Jr(e,ka(t,3),sl)},mr.forInRight=function(e,t){return null==e?e:Xr(e,ka(t,3),sl)},mr.forOwn=function(e,t){return e&&Yr(e,ka(t,3))},mr.forOwnRight=function(e,t){return e&&$r(e,ka(t,3))},mr.get=tl,mr.gt=gs,mr.gte=vs,mr.has=function(e,t){return null!=e&&Ha(e,t,ni)},mr.hasIn=nl,mr.head=bo,mr.identity=Ol,mr.includes=function(e,t,n,r){e=bs(e)?e:ml(e),n=n&&!r?js(n):0;var i=e.length;return n<0&&(n=Jn(i+n,0)),Ns(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&on(e,t,n)>-1},mr.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:js(n);return i<0&&(i=Jn(r+i,0)),on(e,t,i)},mr.inRange=function(e,t,r){return t=Us(t),r===n?(r=t,t=0):r=Us(r),function(e,t,n){return e>=Xn(t,n)&&e<Jn(t,n)}(e=Ws(e),t,r)},mr.invoke=al,mr.isArguments=ys,mr.isArray=xs,mr.isArrayBuffer=_s,mr.isArrayLike=bs,mr.isArrayLikeObject=ws,mr.isBoolean=function(e){return!0===e||!1===e||Ds(e)&&ei(e)==U},mr.isBuffer=Ms,mr.isDate=Ss,mr.isElement=function(e){return Ds(e)&&1===e.nodeType&&!Rs(e)},mr.isEmpty=function(e){if(null==e)return!0;if(bs(e)&&(xs(e)||"string"==typeof e||"function"==typeof e.splice||Ms(e)||Fs(e)||ys(e)))return!e.length;var t=ja(e);if(t==X||t==ee)return!e.size;if(Ka(e))return!hi(e).length;for(var n in e)if(ut.call(e,n))return!1;return!0},mr.isEqual=function(e,t){return si(e,t)},mr.isEqualWith=function(e,t,r){var i=(r="function"==typeof r?r:n)?r(e,t):n;return i===n?si(e,t,n,r):!!i},mr.isError=Ts,mr.isFinite=function(e){return"number"==typeof e&&Hn(e)},mr.isFunction=Es,mr.isInteger=Cs,mr.isLength=As,mr.isMap=Ps,mr.isMatch=function(e,t){return e===t||li(e,t,Ga(t))},mr.isMatchWith=function(e,t,r){return r="function"==typeof r?r:n,li(e,t,Ga(t),r)},mr.isNaN=function(e){return Os(e)&&e!=+e},mr.isNative=function(e){if(Za(e))throw new Ke(i);return ci(e)},mr.isNil=function(e){return null==e},mr.isNull=function(e){return null===e},mr.isNumber=Os,mr.isObject=Ls,mr.isObjectLike=Ds,mr.isPlainObject=Rs,mr.isRegExp=Is,mr.isSafeInteger=function(e){return Cs(e)&&e>=-O&&e<=O},mr.isSet=Bs,mr.isString=Ns,mr.isSymbol=ks,mr.isTypedArray=Fs,mr.isUndefined=function(e){return e===n},mr.isWeakMap=function(e){return Ds(e)&&ja(e)==ie},mr.isWeakSet=function(e){return Ds(e)&&ei(e)==ae},mr.join=function(e,t){return null==e?"":Wn.call(e,t)},mr.kebabCase=xl,mr.last=To,mr.lastIndexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var a=i;return r!==n&&(a=(a=js(r))<0?Jn(i+a,0):Xn(a,i-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,a):an(e,ln,a,!0)},mr.lowerCase=_l,mr.lowerFirst=bl,mr.lt=Gs,mr.lte=Vs,mr.max=function(e){return e&&e.length?Hr(e,Ol,ti):n},mr.maxBy=function(e,t){return e&&e.length?Hr(e,ka(t,2),ti):n},mr.mean=function(e){return cn(e,Ol)},mr.meanBy=function(e,t){return cn(e,ka(t,2))},mr.min=function(e){return e&&e.length?Hr(e,Ol,di):n},mr.minBy=function(e,t){return e&&e.length?Hr(e,ka(t,2),di):n},mr.stubArray=Hl,mr.stubFalse=Wl,mr.stubObject=function(){return{}},mr.stubString=function(){return""},mr.stubTrue=function(){return!0},mr.multiply=Zl,mr.nth=function(e,t){return e&&e.length?yi(e,js(t)):n},mr.noConflict=function(){return Pt._===this&&(Pt._=mt),this},mr.noop=kl,mr.now=ts,mr.pad=function(e,t,n){e=Js(e);var r=(t=js(t))?Dn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return xa(zn(i),n)+e+xa(Vn(i),n)},mr.padEnd=function(e,t,n){e=Js(e);var r=(t=js(t))?Dn(e):0;return t&&r<t?e+xa(t-r,n):e},mr.padStart=function(e,t,n){e=Js(e);var r=(t=js(t))?Dn(e):0;return t&&r<t?xa(t-r,n)+e:e},mr.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),$n(Js(e).replace(Oe,""),t||0)},mr.random=function(e,t,r){if(r&&"boolean"!=typeof r&&Xa(e,t,r)&&(t=r=n),r===n&&("boolean"==typeof t?(r=t,t=n):"boolean"==typeof e&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=Us(e),t===n?(t=e,e=0):t=Us(t)),e>t){var i=e;e=t,t=i}if(r||e%1||t%1){var a=Zn();return Xn(e+a*(t-e+Ct("1e-"+((a+"").length-1))),t)}return Mi(e,t)},mr.reduce=function(e,t,n){var r=xs(e)?Qt:pn,i=arguments.length<3;return r(e,ka(t,4),n,i,zr)},mr.reduceRight=function(e,t,n){var r=xs(e)?en:pn,i=arguments.length<3;return r(e,ka(t,4),n,i,Ur)},mr.repeat=function(e,t,r){return t=(r?Xa(e,t,r):t===n)?1:js(t),Si(Js(e),t)},mr.replace=function(){var e=arguments,t=Js(e[0]);return e.length<3?t:t.replace(e[1],e[2])},mr.result=function(e,t,r){var i=-1,a=(t=Xi(t,e)).length;for(a||(a=1,e=n);++i<a;){var o=null==e?n:e[ho(t[i])];o===n&&(i=a,o=r),e=Es(o)?o.call(e):o}return e},mr.round=Kl,mr.runInContext=e,mr.sample=function(e){return(xs(e)?Er:Ei)(e)},mr.size=function(e){if(null==e)return 0;if(bs(e))return Ns(e)?Dn(e):e.length;var t=ja(e);return t==X||t==ee?e.size:hi(e).length},mr.snakeCase=wl,mr.some=function(e,t,r){var i=xs(e)?tn:Ri;return r&&Xa(e,t,r)&&(t=n),i(e,ka(t,3))},mr.sortedIndex=function(e,t){return Ii(e,t)},mr.sortedIndexBy=function(e,t,n){return Bi(e,t,ka(n,2))},mr.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=Ii(e,t);if(r<n&&ms(e[r],t))return r}return-1},mr.sortedLastIndex=function(e,t){return Ii(e,t,!0)},mr.sortedLastIndexBy=function(e,t,n){return Bi(e,t,ka(n,2),!0)},mr.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Ii(e,t,!0)-1;if(ms(e[n],t))return n}return-1},mr.startCase=Ml,mr.startsWith=function(e,t,n){return e=Js(e),n=null==n?0:Nr(js(n),0,e.length),t=Fi(t),e.slice(n,n+t.length)==t},mr.subtract=Ql,mr.sum=function(e){return e&&e.length?dn(e,Ol):0},mr.sumBy=function(e,t){return e&&e.length?dn(e,ka(t,2)):0},mr.template=function(e,t,r){var i=mr.templateSettings;r&&Xa(e,t,r)&&(t=n),e=Js(e),t=$s({},t,i,Ca);var a,s,l=$s({},t.imports,i.imports,Ca),c=ol(l),u=vn(l,c),h=0,p=t.interpolate||Xe,d="__p += '",f=nt((t.escape||Xe).source+"|"+p.source+"|"+(p===Ee?Ve:Xe).source+"|"+(t.evaluate||Xe).source+"|$","g"),m="//# sourceURL="+(ut.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Mt+"]")+"\n";e.replace(f,function(t,n,r,i,o,l){return r||(r=i),d+=e.slice(h,l).replace(Ye,Mn),n&&(a=!0,d+="' +\n__e("+n+") +\n'"),o&&(s=!0,d+="';\n"+o+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),h=l+t.length,t}),d+="';\n";var g=ut.call(t,"variable")&&t.variable;if(g){if(Fe.test(g))throw new Ke(o)}else d="with (obj) {\n"+d+"\n}\n";d=(s?d.replace(ve,""):d).replace(ye,"$1").replace(xe,"$1;"),d="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var v=Cl(function(){return Qe(c,m+"return "+d).apply(n,u)});if(v.source=d,Ts(v))throw v;return v},mr.times=function(e,t){if((e=js(e))<1||e>O)return[];var n=B,r=Xn(e,B);t=ka(t),e-=B;for(var i=fn(r,t);++n<e;)t(n);return i},mr.toFinite=Us,mr.toInteger=js,mr.toLength=Hs,mr.toLower=function(e){return Js(e).toLowerCase()},mr.toNumber=Ws,mr.toSafeInteger=function(e){return e?Nr(js(e),-O,O):0===e?e:0},mr.toString=Js,mr.toUpper=function(e){return Js(e).toUpperCase()},mr.trim=function(e,t,r){if((e=Js(e))&&(r||t===n))return mn(e);if(!e||!(t=Fi(t)))return e;var i=Pn(e),a=Pn(t);return $i(i,xn(i,a),_n(i,a)+1).join("")},mr.trimEnd=function(e,t,r){if((e=Js(e))&&(r||t===n))return e.slice(0,On(e)+1);if(!e||!(t=Fi(t)))return e;var i=Pn(e);return $i(i,0,_n(i,Pn(t))+1).join("")},mr.trimStart=function(e,t,r){if((e=Js(e))&&(r||t===n))return e.replace(Oe,"");if(!e||!(t=Fi(t)))return e;var i=Pn(e);return $i(i,xn(i,Pn(t))).join("")},mr.truncate=function(e,t){var r=T,i=E;if(Ls(t)){var a="separator"in t?t.separator:a;r="length"in t?js(t.length):r,i="omission"in t?Fi(t.omission):i}var o=(e=Js(e)).length;if(Sn(e)){var s=Pn(e);o=s.length}if(r>=o)return e;var l=r-Dn(i);if(l<1)return i;var c=s?$i(s,0,l).join(""):e.slice(0,l);if(a===n)return c+i;if(s&&(l+=c.length-l),Is(a)){if(e.slice(l).search(a)){var u,h=c;for(a.global||(a=nt(a.source,Js(ze.exec(a))+"g")),a.lastIndex=0;u=a.exec(h);)var p=u.index;c=c.slice(0,p===n?l:p)}}else if(e.indexOf(Fi(a),l)!=l){var d=c.lastIndexOf(a);d>-1&&(c=c.slice(0,d))}return c+i},mr.unescape=function(e){return(e=Js(e))&&we.test(e)?e.replace(_e,Rn):e},mr.uniqueId=function(e){var t=++ht;return Js(e)+t},mr.upperCase=Sl,mr.upperFirst=Tl,mr.each=Jo,mr.eachRight=Xo,mr.first=bo,Nl(mr,($l={},Yr(mr,function(e,t){ut.call(mr.prototype,t)||($l[t]=e)}),$l),{chain:!1}),mr.VERSION="4.17.21",Wt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){mr[e].placeholder=mr}),Wt(["drop","take"],function(e,t){xr.prototype[e]=function(r){r=r===n?1:Jn(js(r),0);var i=this.__filtered__&&!t?new xr(this):this.clone();return i.__filtered__?i.__takeCount__=Xn(r,i.__takeCount__):i.__views__.push({size:Xn(r,B),type:e+(i.__dir__<0?"Right":"")}),i},xr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),Wt(["filter","map","takeWhile"],function(e,t){var n=t+1,r=n==L||3==n;xr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:ka(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),Wt(["head","last"],function(e,t){var n="take"+(t?"Right":"");xr.prototype[e]=function(){return this[n](1).value()[0]}}),Wt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");xr.prototype[e]=function(){return this.__filtered__?new xr(this):this[n](1)}}),xr.prototype.compact=function(){return this.filter(Ol)},xr.prototype.find=function(e){return this.filter(e).head()},xr.prototype.findLast=function(e){return this.reverse().find(e)},xr.prototype.invokeMap=Ti(function(e,t){return"function"==typeof e?new xr(this):this.map(function(n){return ai(n,e,t)})}),xr.prototype.reject=function(e){return this.filter(us(ka(e)))},xr.prototype.slice=function(e,t){e=js(e);var r=this;return r.__filtered__&&(e>0||t<0)?new xr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=js(t))<0?r.dropRight(-t):r.take(t-e)),r)},xr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},xr.prototype.toArray=function(){return this.take(B)},Yr(xr.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),a=mr[i?"take"+("last"==t?"Right":""):t],o=i||/^find/.test(t);a&&(mr.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,l=t instanceof xr,c=s[0],u=l||xs(t),h=function(e){var t=a.apply(mr,Kt([e],s));return i&&p?t[0]:t};u&&r&&"function"==typeof c&&1!=c.length&&(l=u=!1);var p=this.__chain__,d=!!this.__actions__.length,f=o&&!p,m=l&&!d;if(!o&&u){t=m?t:new xr(this);var g=e.apply(t,s);return g.__actions__.push({func:Uo,args:[h],thisArg:n}),new yr(g,p)}return f&&m?e.apply(this,s):(g=this.thru(h),f?i?g.value()[0]:g.value():g)})}),Wt(["pop","push","shift","sort","splice","unshift"],function(e){var t=at[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);mr.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(xs(i)?i:[],e)}return this[n](function(n){return t.apply(xs(n)?n:[],e)})}}),Yr(xr.prototype,function(e,t){var n=mr[t];if(n){var r=n.name+"";ut.call(or,r)||(or[r]=[]),or[r].push({name:t,func:n})}}),or[ma(n,g).name]=[{name:"wrapper",func:n}],xr.prototype.clone=function(){var e=new xr(this.__wrapped__);return e.__actions__=ia(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=ia(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=ia(this.__views__),e},xr.prototype.reverse=function(){if(this.__filtered__){var e=new xr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},xr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=xs(e),r=t<0,i=n?e.length:0,a=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var a=n[r],o=a.size;switch(a.type){case"drop":e+=o;break;case"dropRight":t-=o;break;case"take":t=Xn(t,e+o);break;case"takeRight":e=Jn(e,t-o)}}return{start:e,end:t}}(0,i,this.__views__),o=a.start,s=a.end,l=s-o,c=r?s:o-1,u=this.__iteratees__,h=u.length,p=0,d=Xn(l,this.__takeCount__);if(!n||!r&&i==l&&d==l)return ji(e,this.__actions__);var f=[];e:for(;l--&&p<d;){for(var m=-1,g=e[c+=t];++m<h;){var v=u[m],y=v.iteratee,x=v.type,_=y(g);if(x==D)g=_;else if(!_){if(x==L)continue e;break e}}f[p++]=g}return f},mr.prototype.at=jo,mr.prototype.chain=function(){return zo(this)},mr.prototype.commit=function(){return new yr(this.value(),this.__chain__)},mr.prototype.next=function(){this.__values__===n&&(this.__values__=zs(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},mr.prototype.plant=function(e){for(var t,r=this;r instanceof vr;){var i=fo(r);i.__index__=0,i.__values__=n,t?a.__wrapped__=i:t=i;var a=i;r=r.__wrapped__}return a.__wrapped__=e,t},mr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof xr){var t=e;return this.__actions__.length&&(t=new xr(this)),(t=t.reverse()).__actions__.push({func:Uo,args:[Lo],thisArg:n}),new yr(t,this.__chain__)}return this.thru(Lo)},mr.prototype.toJSON=mr.prototype.valueOf=mr.prototype.value=function(){return ji(this.__wrapped__,this.__actions__)},mr.prototype.first=mr.prototype.head,hn&&(mr.prototype[hn]=function(){return this}),mr}();Rt?((Rt.exports=In)._=In,Ot._=In):Pt._=In}).call(commonjsGlobal)});var McEdGetPointWorldDrawObject=function(){function e(){var e,t=this;this._McEdGetPointWorldDraw=new(null===(e=store.state.MxFun)||void 0===e?void 0:e.getMxJigCmdManager().McEdGetPointWorldDrawObjectClass()),this._get=function(){return t._McEdGetPointWorldDraw}}return e.prototype.drawCircle=function(e,t){return this._McEdGetPointWorldDraw.drawCircle(e,t)},e.prototype.drawLine=function(e,t){return this._McEdGetPointWorldDraw.drawLine(e,t)},e.prototype.drawEntity=function(e){return this._McEdGetPointWorldDraw.drawEntity(e)},e.prototype.drawText=function(e,t,n,r){return this._McEdGetPointWorldDraw.drawText(e,t,n,r)},e.prototype.setDraw=function(e){return this._McEdGetPointWorldDraw.setDraw(e)},e.prototype.setColor=function(e){return this._McEdGetPointWorldDraw.setColor(e)},e.prototype.getColor=function(){return this._McEdGetPointWorldDraw.getColor()},e.prototype.drawCustomEntity=function(e){return this._McEdGetPointWorldDraw.drawCustomEntity(e)},e}(),_MrxDbgUiPrPoint,MrxDbgUiPrPoint=function(){function e(){var e;_MrxDbgUiPrPoint=new(null===(e=store.state.MxFun)||void 0===e?void 0:e.getMxJigCmdManager().getMrxDbgUiPrPointClass())}return e.prototype.keyWords=function(){return _MrxDbgUiPrPoint.keyWords()},e.prototype.setKeyWords=function(e){return _MrxDbgUiPrPoint.setKeyWords(e)},e.prototype.message=function(){return _MrxDbgUiPrPoint.message()},e.prototype.setMessage=function(e){return _MrxDbgUiPrPoint.setMessage(e)},e.prototype.keyWordPicked=function(){return _MrxDbgUiPrPoint.keyWordPicked()},e.prototype.isKeyWordPicked=function(e){return _MrxDbgUiPrPoint.isKeyWordPicked(e)},e.prototype.setUserDraw=function(e){if("function"!=typeof e)return _MrxDbgUiPrPoint.setUserDraw(e._get?e._get():e);var t=new McEdGetPointWorldDrawObject;t.setDraw(e),_MrxDbgUiPrPoint.setUserDraw(t._get())},e.prototype.value=function(){return _MrxDbgUiPrPoint.value()},e.prototype.valueDocCoord=function(){return _MrxDbgUiPrPoint.valueDocCoord()},e.prototype.basePt=function(){return _MrxDbgUiPrPoint.basePt()},e.prototype.setBasePt=function(e){return _MrxDbgUiPrPoint.setBasePt(e)},e.prototype.setUseBasePt=function(e){return _MrxDbgUiPrPoint.setUseBasePt(e)},e.prototype.go=function(e){return e?(_MrxDbgUiPrPoint.go(e),new Promise(function(e,t){e(null)})):new Promise(function(e,t){_MrxDbgUiPrPoint.go(function(t){e(0!=t?null:_MrxDbgUiPrPoint.value())})})},e.prototype.goWhile=function(e,t){return _MrxDbgUiPrPoint.goWhile(e,t)},e.prototype.drawReserve=function(e){return _MrxDbgUiPrPoint.drawReserve(e)},e}(),MxVueComandLine=function(){function e(){var e=this;this.msCmdText="",this.msCmdDisplay="",this.msCmdTip="",this.mUpDisplayFun=void 0,this.mxFunObject=void 0,this.mountUpDisplayFun=function(t){e.mUpDisplayFun=t},this.setCmdText=function(t){e.msCmdText=t},this.getCmdText=function(){return e.msCmdText},this.getCmdDisplay=function(){return e.msCmdDisplay},this.setCmdDisplay=function(t){e.msCmdDisplay=t},this.addCmdDisplay=function(t){e.msCmdDisplay.length>1024?(e.msCmdDisplay=e.msCmdDisplay.substring(e.msCmdDisplay.length-1024,e.msCmdDisplay.length),e.msCmdDisplay=e.msCmdDisplay+t):e.msCmdDisplay=e.msCmdDisplay+t},this.setCmdTip=function(t){e.msCmdTip=t},this.getCmdTip=function(){return e.msCmdTip}}return e.prototype.upDisplay=function(){var e=this.msCmdTip,t=this.msCmdDisplay,n=this.msCmdText;void 0!=this.mUpDisplayFun&&this.mUpDisplayFun({msCmdTip:e,msCmdDisplay:t,msCmdText:n})},e}(),MxInputType={kNoInput:0,kXYCoordInput:1,kDistanceInput:2,kDynTip:3},MxInputPostionType={kRelative:0,kAbsolutely:1},MxDynamicInput=function(){return function(){var e=this;this.mType=MxInputType.kNoInput,this.mPos=[0,0],this.mTip="",this.mValue1="",this.mValue1Pos=[0,0],this.mValue2="",this.mValue2Pos=[0,0],this.misShow=!1,this.mOnKeydownEvent=void 0,this.mFocusValue="",this.setFocusValue=function(t){e.mFocusValue=t},this.getFocusValue=function(){return e.mFocusValue},this.mountKeydownEvent=function(t){e.mOnKeydownEvent=t},this.onKeydown=function(t){void 0!=e.mOnKeydownEvent&&e.mOnKeydownEvent(t)},this.setType=function(t){e.mType=t},this.getType=function(){return e.mType},this.isShow=function(){return e.misShow},this.setPos=function(t){e.mPos=t},this.setTip=function(t){e.mTip=t},this.setValue1=function(t){e.mValue1=t},this.getValue1=function(){return e.mValue1},this.setValue1Pos=function(t){e.mValue1Pos=t},this.setValue2=function(t){e.mValue2=t},this.getValue2=function(){return e.mValue2},this.setValue2Pos=function(t){e.mValue2Pos=t},this.setShow=function(t){e.misShow=t},this.getData=function(){if(e.misShow){var t={list:[{value:"",readonly:!0},{value:"",readonly:!1},{value:"",readonly:!1}],pos:e.mPos,postype:MxInputPostionType.kRelative};if(e.mType!=MxInputType.kNoInput)return e.mType==MxInputType.kXYCoordInput?(t.list[0].show=!0,t.list[0].value=e.mTip,t.list[0].readonly=!0,t.list[1].show=!0,t.list[1].value=e.mValue1,t.list[1].readonly=!1,t.list[2].show=!0,t.list[2].value=e.mValue2,t.list[2].readonly=!1):e.mType==MxInputType.kDistanceInput?(t.list[0].show=!0,t.list[0].value=e.mTip,t.list[0].readonly=!0,t.list[1].show=!0,t.list[1].value=e.mValue1,t.list[1].readonly=!1,t.list[1].pos=e.mValue1Pos,t.list[2].show=!0,t.list[2].value=e.mValue2,t.list[2].readonly=!0,t.list[2].pos=e.mValue2Pos,t.postype=MxInputPostionType.kAbsolutely):e.mType==MxInputType.kDynTip?(t.list[0].show=!0,t.list[0].value=e.mTip,t.list[0].readonly=!0,t.list[1].show=!1,t.list[2].show=!1):t=void 0,t}}}}(),CursorType={kNormal:"cursor3",kRect:"cursor1",kCross:"cursor2"},MxVueInterface=function(){return function(){var e=this;this.mSetCoordFun=void 0,this.mUpdateCursorFun=void 0,this.mOnKeydownEvent=void 0,this.mCursorType=CursorType.kNormal,this.mComandLine=new MxVueComandLine,this.mdynamicInput=new MxDynamicInput,this.mMxEvents={},this.mountSetCoordFun=function(t){e.mSetCoordFun=t},this.mountUpdateCursorFun=function(t){e.mUpdateCursorFun=t},this.mountKeydownEvent=function(t){e.mOnKeydownEvent=t},this.onKeydown=function(t){void 0!=e.mOnKeydownEvent&&e.mOnKeydownEvent(t)},this.setTipCoord=function(t){void 0!=e.mSetCoordFun&&e.mSetCoordFun(t)},this.getCursorType=function(){return e.mCursorType},this.setCursorType=function(t){if("number"==typeof t)switch(t){case 0:e.mCursorType=CursorType.kNormal;break;case 1:e.mCursorType=CursorType.kRect;break;case 2:e.mCursorType=CursorType.kCross}else e.mCursorType=t;void 0!=e.mUpdateCursorFun&&e.mUpdateCursorFun()},this.getTitle=function(){return e.mTitle},this.getTopButtonBarData=function(){return e.mTopButtonBarData},this.getMenuBarData=function(){return e.mMenuBarData},this.getRighButtonBarData=function(){return e.mRighButtonBarData},this.getLeftButtonBarData=function(){return e.mLeftButtonBarData},this.getTitleButtonBarData=function(){return e.mTitleButtonBarData},this.getLayerComboxData=function(){return e.mLayerComboxData},this.getColorComboxData=function(){return e.mColorComboxData},this.getLinetypeComboxData=function(){return e.mLinetypeComboxData},this.getFooterData=function(){return e.mFooterData},this.sendStringToExecute=function(t){e.mxFunObject.sendStringToExecute(t)},this.getCmdLine=function(){return e.mComandLine},this.getDynamicInput=function(){return e.mdynamicInput},this.init=function(t){e.mxFunObject=t},this.OnMxEvent=function(t){var n=t.name;if(void 0!=n){var r=e.mMxEvents[n];void 0!=r&&r(t.param)}},this.mountMxEvent=function(t,n){e.mMxEvents[t]=n}}}(),mxUiData=new MxVueInterface,MxFun$1=function(){function e(){}return e.prototype.createMxObject=function(e){var t=e.canvasId,n=void 0===t?createReandomId():t,r=e.cadFile,i=void 0===r?"":r,a=e.callback,o=e.isNewFile,s=void 0!==o&&o,l=e.useWebsocket,c=void 0!==l&&l,u=e.isAutoResize,h=void 0===u||u;this.initUiDataObject(mxUiData);var p=createCanvas(n),d=createCanvasParent(p);d.parentNode&&11!=d.parentNode.nodeType||document.body.appendChild(d),!c&&s&&(s=!1),store.state.MxFun.createMxObject(n,i,function(e){var t=new MxDrawObject(e);e.setMouseRightRotate(!1),e.setIniset({EnableOsnapFunction:!0}),e.addEvent("onResize",function(){return d.tabindex=3,{width:d.clientWidth,height:d.clientHeight}}),h&&useCanvasResizeListener(t,p),a&&a(t,{canvas:p,canvasParent:d})},void 0,s,c)},e.prototype.setMxServer=function(e){void 0===e&&(e="ws://localhost:5090"),store.state.MxFun.setMxServer(e)},e.prototype.enablStaticLoad=function(e){store.state.MxFun.enablStaticLoad(e)},e.prototype.setStaticServer=function(e){store.state.MxFun.setStaticServer(e)},e.prototype.addCommand=function(e,t){store.state.MxFun.addCommand(e,t)},e.prototype.sendStringToExecute=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return(t=store.state.MxFun).sendStringToExecute.apply(t,__spreadArray([e],n,!1))},e.prototype.call=function(e,t,n){return store.state.MxFun.call(e,t,n)},e.prototype.getCurrentDraw=function(){return new MxDrawObject(store.state.MxFun.getCurrentDraw())},e.prototype.screenCoordLong2World=function(e){return store.state.MxFun.screenCoordLong2World(e)},e.prototype.screenCoordLong2Doc=function(e){return store.state.MxFun.screenCoordLong2Doc(e)},e.prototype.docCoordLong2Screen=function(e){return store.state.MxFun.docCoordLong2Screen(e)},e.prototype.worldCoordLong2Doc=function(e){return store.state.MxFun.worldCoordLong2Doc(e)},e.prototype.docCoordLong2World=function(e){return store.state.MxFun.docCoordLong2World(e)},e.prototype.screenCoord2World=function(e,t,n){return store.state.MxFun.screenCoord2World(e,t,n)},e.prototype.worldCoord2Screen=function(e,t,n){return store.state.MxFun.worldCoord2Screen(e,t,n)},e.prototype.docCoord2World=function(e,t,n){return store.state.MxFun.docCoord2World(e,t,n)},e.prototype.worldCoord2Doc=function(e,t,n){return store.state.MxFun.worldCoord2Doc(e,t,n)},e.prototype.screenCoord2Doc=function(e,t){return store.state.MxFun.screenCoord2Doc(e,t,0)},e.prototype.docCoord2Screen=function(e,t){return store.state.MxFun.docCoord2Screen(e,t,0)},e.prototype.updateDisplay=function(){return store.state.MxFun.updateDisplay()},e.prototype.addWindowsEvent=function(e){return store.state.MxFun.addWindowsEvent(e)},e.prototype.isRunningCommand=function(){return store.state.MxFun.isRunningCommand()},e.prototype.zoomW=function(e,t,n,r,i){return store.state.MxFun.zoomW(e,t,n,r,i)},e.prototype.showLayer=function(e,t,n){return store.state.MxFun.showLayer(e,t,n)},e.prototype.getCurrentMxCAD=function(){return store.state.MxFun.getCurrentMxCAD()},e.prototype.getQueryString=function(e){return store.state.MxFun.getQueryString(e)},e.prototype.setIniset=function(e){return store.state.MxFun.setIniset(e)},e.prototype.upDisplayForLayerData=function(e){return store.state.MxFun.upDisplayForLayerData(e)},e.prototype.initUiDataObject=function(e){return store.state.MxFun.initUiDataObject(e)},e.prototype.testMX=function(e){return 11},e.prototype.loadImageMaterial=function(e,t){return t?(store.state.MxFun.loadImageMaterial(e,t),new Promise(function(e,t){e(null)})):new Promise(function(t,n){store.state.MxFun.loadImageMaterial(e,function(e){t(e||null)})})},e.prototype.openFile=function(e,t){return void 0===t&&(t=!1),store.state.MxFun.openFile(e,t)},e.prototype.addToCurrentSpace=function(e){return this.getCurrentDraw().addMxEntity(e)},e.prototype.selectEnt=function(e,t){var n=this;return void 0===t&&(t=null),new Promise(function(r,i){var a=new MrxDbgUiPrPoint;a.setMessage(e),a.go(function(e){if(0==e){for(var i=a.value(),o=n.getCurrentDraw().findMxEntityAtPoint(i),s=0;0!=o.length;){for(var l=o.length,c=0;c<l;c++){var u=o[c];if(!t||!t.type||t.type==u.getTypeName()){s=u.objectId();break}}break}r(s)}else r(0)})})},e.prototype.listenForCommandLineInput=function(e){mxUiData.getCmdLine().mountUpDisplayFun(e)},e.prototype.setCommandLineInputData=function(e,t){mxUiData.getCmdLine().setCmdText(e),mxUiData.onKeydown(t)},e.prototype.listenForCoordTip=function(e){mxUiData.mountSetCoordFun(e)},e.prototype.getMxFunTHREE=function(){return store.state.MxFun.getTHREE()},e.prototype.getMxFunThreeTool=function(){return store.state.MxFun.getMxThreeJS()},e}(),MxFun=new MxFun$1,MrxDbgUiPrBaseReturn;!function(e){e[e.kCancel=-2]="kCancel",e[e.kNone=-1]="kNone",e[e.kOk=0]="kOk",e[e.kKeyWord=1]="kKeyWord"}(MrxDbgUiPrBaseReturn||(MrxDbgUiPrBaseReturn={}));var MrxDbgUiPrBaseReturn$1=MrxDbgUiPrBaseReturn,MxCloneType,MxCloneType2;!function(e){e[e.kClone=1]="kClone",e[e.kDragClone=2]="kDragClone"}(MxCloneType||(MxCloneType={})),function(e){e[e.kClone=1]="kClone",e[e.kDragClone=2]="kDragClone"}(MxCloneType2||(MxCloneType2={}));var MxType={MxCloneType:MxCloneType,MxCloneType2:MxCloneType2},MxDbEntity=function(){function e(){this.color=16777215,this.renderOrder=30,this.opacity=1,this.visible=!0,this.userData={}}return e.prototype.transformBy=function(e){},e.prototype.getImp=function(){return this.MxDbEntityImp},e.prototype.setNeedUpdateDisplay=function(e){var t=this.getImp();return!!t&&(e?t.upDisplay():t.setDirtyDisplay(!0),!0)},e.prototype.getMxObject=function(){var e=this.getImp();return e?e.getMxObject():null},e.prototype.onViewChange=function(){return!1},e.prototype.objectId=function(){var e=this.getImp();return e?e.objectId():0},e.prototype.erase=function(){var e=this.getImp();return!!e&&e.erase()},e.prototype.setColor=function(e){this.color=e},e.prototype.getColor=function(){return this.color},e.prototype.clone=function(e){var t=this.create(),n={type:e||MxType.MxCloneType.kClone};return this.dwgOut(n),t.dwgIn(n),t},e.prototype.onDwgIn=function(e){this.color=e.color,this.renderOrder=e.renderOrder,this.opacity=e.opacity,this.visible=e.visible,e.userData?this.userData=JSON.parse(JSON.stringify(e.userData)):this.userData={}},e.prototype.onDwgOut=function(e){e.color=this.color,e.renderOrder=this.renderOrder,e.opacity=this.opacity,e.visible=this.visible,Object.keys(this.userData).length>0&&(e.userData=this.userData)},e.prototype.rxInit=function(){store.state.MxFun.initMxDbEntityType(this)},e.prototype.setRenderOrder=function(e){this.renderOrder=e},e.prototype.getRenderOrder=function(){return this.renderOrder},e}(),MxDbImage=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.pt1=new Vector3,t.pt2=new Vector3,t.imagePath="",t.isLoadMaterialFromPath=!0,t.material=null,t}return __extends(t,e),t.prototype.getTypeName=function(){return"MxDbImage"},t.prototype.worldDraw=function(e){var t=this,n=new Vector3(this.pt1.x,this.pt2.y),r=new Vector3(this.pt2.x,this.pt1.y);if(1==e.getType()){if(e.drawSelectLine(this.pt1,n),e.drawSelectLine(n,this.pt2),e.drawSelectLine(this.pt2,r),e.drawSelectLine(r,this.pt1),this.material){for(var i=Math.abs(this.pt1.x-this.pt2.x),a=Math.abs(this.pt1.y-this.pt2.y),o=new PlaneGeometry(i,a),s=Math.min(this.pt1.x,this.pt2.x),l=Math.min(this.pt1.y,this.pt2.y),c=0;c<o.vertices.length;c++)o.vertices[c].x+=s+.5*i,o.vertices[c].y+=l+.5*a,o.vertices[c].z=0;var u=new Mesh(o,this.material);u.material.depthTest=!1,e.drawEntity(u)}else if(this.imagePath.length>0&&this.isLoadMaterialFromPath){var h=this,p=e.getMxObject();MxFun.loadImageMaterial(this.imagePath,function(e){t.isLoadMaterialFromPath=!1,e&&(h.setMaterial(e),h.setNeedUpdateDisplay(),p.updateDisplay())})}}else e.drawLine(this.pt1,n),e.drawLine(n,this.pt2),e.drawLine(this.pt2,r),e.drawLine(r,this.pt1)},t.prototype.setImagePath=function(e){this.imagePath=e,this.isLoadMaterialFromPath=!0,this.material=null},t.prototype.getImagePath=function(){return this.imagePath},t.prototype.setMaterial=function(e){this.material=e},t.prototype.setPoint1=function(e){this.pt1=e},t.prototype.getPoint1=function(){return this.pt1},t.prototype.setPoint2=function(e){this.pt2=e},t.prototype.getPoint2=function(){return this.pt2},t.prototype.getGripPoints=function(){var e=[];e.push(this.pt1),e.push(this.pt2);var t=new Vector3(this.pt1.x+.5*(this.pt2.x-this.pt1.x),this.pt1.y+.5*(this.pt2.y-this.pt1.y));return e.push(t),e},t.prototype.moveGripPointsAt=function(e,t){return 0==e?this.pt1.add(t):1==e?this.pt2.add(t):2==e&&(this.pt1.add(t),this.pt2.add(t)),!0},t.prototype.dwgIn=function(e){return this.onDwgIn(e),this.pt1.copy(e.pt1),this.pt2.copy(e.pt2),this.imagePath=e.imagePath.substr(0),this.isLoadMaterialFromPath=!0,!0},t.prototype.dwgOut=function(e){return this.onDwgOut(e),e.pt1=this.pt1,e.pt2=this.pt2,e.imagePath=this.imagePath,e},t.prototype.create=function(){return new t},t}(MxDbEntity),index$b=Object.freeze({__proto__:null,default:MxDbImage}),MxDbSVGText=function(){return function(){this.txtPos=new Vector3,this.txt="",this.txtHeight=1,this.color=void 0,this._txtObject=null,this._txtAspectRatio=-1}}(),index$a=Object.freeze({__proto__:null,default:MxDbSVGText}),MxDbSVG=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.svgPos=new Vector3,t.svg=null,t.svgPath="",t.svgSize=new Vector2(50,50),t.svgAlignmentRatio=new Vector2(0,0),t.svgRotate=0,t.svgReverse=!1,t.svgMargin=new Vector2(0,0),t.isSvgDirtyLocation=!1,t.isLoadFromPath=!0,t.aryText=[],t.svgBoxSize=null,t.fixedSize=!1,t.useSvgColor=!1,t}return __extends(t,e),t.prototype.calcVewSize=function(e){var t=this.svgSize.x,n=this.svgSize.y;return n<=0&&(n=this.svgBoxSize?this.svgBoxSize.y/this.svgBoxSize.x*t:t),this.fixedSize&&(t=e.screenCoordLong2Doc(t),n=e.screenCoordLong2Doc(n)),[t,n]},t.prototype.worldDraw=function(e){var t=this,n=e.getMxObject();this.calcSvgPosition(n);var r=this.calcVewSize(n),i=r[0],a=r[1],o=new Matrix4;this.svgReverse&&o.makeScale(1,-1,1);var s=new Matrix4;s.makeRotationZ(this.svgRotate);var l=new Matrix4,c=new Vector3(this.svgPos.x-i*this.svgAlignmentRatio.x,this.svgPos.y-a*this.svgAlignmentRatio.y,0);l.makeTranslation(c.x,c.y,c.z),s.multiply(o),s.premultiply(l);var u=new Vector3(0,0,0),h=new Vector3(i,0,0),p=new Vector3(i,a,0),d=new Vector3(0,a,0);if(u.applyMatrix4(s),h.applyMatrix4(s),p.applyMatrix4(s),d.applyMatrix4(s),1==e.getType()){if(this.aryText.forEach(function(r){if(r.txt.length>0){var i=new Vector3(r.txtPos.x,r.txtPos.y,0);t.fixedSize&&(r.txtPos.x>0?i.x=t.svgPos.x+n.screenCoordLong2Doc(r.txtPos.x):i.x=t.svgPos.x-n.screenCoordLong2Doc(r.txtPos.x),r.txtPos.y>0?i.y=t.svgPos.y+n.screenCoordLong2Doc(r.txtPos.y):i.y=t.svgPos.y-n.screenCoordLong2Doc(r.txtPos.y));var a=void 0;r.color&&(a=e.getColor(),e.setColor(r.color));var o=r.txtHeight;t.fixedSize&&(o=n.screenCoordLong2Doc(r.txtHeight)),r._txtObject=e.drawText(r.txt,o,0,i),r._txtAspectRatio=-1,a&&e.setColor(a)}}),this.svg)e.drawEntity(this.svg);else if(this.svgPath.length>0&&this.isLoadFromPath){var f=this,m=e.getMxObject();MxThreeJS.loadSVG(this.svgPath,void 0,function(t){if(t){var r=(new Box3).setFromObject(t);f.svgBoxSize||(f.svgBoxSize=new Vector3),f.svgBoxSize.x=r.max.x-r.min.x,f.svgBoxSize.y=r.max.y-r.min.y;var i=f.calcVewSize(n),a=i[0],o=i[1];t.scale.x=a/f.svgBoxSize.x,t.scale.y=o/f.svgBoxSize.y,t.scale.z=t.scale.x,f.svgReverse&&(t.scale.y*=-1),t.rotateZ(f.svgRotate),f.isSvgDirtyLocation=!0;var s=new Color(e.getColor());t.traverse(function(e){e.material&&(e.material=e.material.clone(),e.material.transparent=!0,f.useSvgColor||(e.material.color=s))}),f.svg=t,f.setNeedUpdateDisplay(),m.updateDisplay()}f.isLoadFromPath=!1})}e.drawSelectLine(u,p),e.drawSelectLine(h,d)}else e.drawLine(u,h),e.drawLine(h,p),e.drawLine(p,d),e.drawLine(d,u)},t.prototype.setSvgPath=function(e,t){return void 0===t&&(t=!1),__awaiter(this,void 0,void 0,function(){return __generator(this,function(n){switch(n.label){case 0:return this.svgPath=e,this.svg=null,this.isLoadFromPath=!0,this.svgBoxSize=null,t?[4,MxThreeJS.loadSVG(e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},t.prototype.getSvgPath=function(){return this.svgPath},t.prototype.setSvgPostion=function(e){this.svgPos=e.clone(),this.isSvgDirtyLocation=!0},t.prototype.getSvgPostion=function(){return this.svgPos},t.prototype.setSvgSize=function(e){this.svgSize=e,this.isSvgDirtyLocation=!0},t.prototype.getSvgSize=function(){return this.svgSize},t.prototype.setSvgAlignmentRatio=function(e){this.svgAlignmentRatio=e,this.isSvgDirtyLocation=!0},t.prototype.getSvgAlignmentRatio=function(){return this.svgAlignmentRatio},t.prototype.getText=function(e){return e<this.aryText.length?this.aryText[e]:null},t.prototype.addText=function(e){this.aryText.push(e)},t.prototype.getGripPoints=function(){var e=[];return e.push(this.svgPos),e},t.prototype.moveGripPointsAt=function(e,t){return 0==e&&(this.svgPos.add(t),this.fixedSize||this.aryText.forEach(function(e){e.txtPos.add(t)})),this.isSvgDirtyLocation=!0,!0},t.prototype.calcSvgPosition=function(e){if(this.svg&&this.isSvgDirtyLocation){this.isSvgDirtyLocation=!1;var t=this.calcVewSize(e),n=t[0],r=t[1];this.svg.position.x=this.svgPos.x-n*this.svgAlignmentRatio.x-this.svgMargin.x*n,this.svg.position.y=this.svgPos.y-r*this.svgAlignmentRatio.y-this.svgMargin.y*r}},t.prototype.dwgIn=function(e){var t=this;this.onDwgIn(e),this.fixedSize=e.fixedSize,this.fixedSize?this.svg=null:e.type==MxType.MxCloneType.kClone&&e.svg&&(this.svg=e.svg.clone()),this.svgPos.copy(e.svgPos),this.svgPath=e.svgPath.substr(0),this.svgSize.copy(e.svgSize),this.svgAlignmentRatio.copy(e.svgAlignmentRatio),this.isSvgDirtyLocation=!0,this.svg||(this.isLoadFromPath=!0),this.svgBoxSize=null;var n=e.txts;return this.aryText=[],n.forEach(function(e){var n=new MxDbSVGText;n.txt=e.txt,n.txtHeight=e.txtHeight,n.txtPos.copy(e.txtPos),t.aryText.push(n)}),this.svgRotate=e.svgRotate,this.useSvgColor=e.useSvgColor,this.svgReverse=e.svgReverse,this.svgMargin=e.svgMargin,!0},t.prototype.dwgOut=function(e){return this.onDwgOut(e),e.type==MxType.MxCloneType.kClone&&(e.svg=this.svg),e.svgPath=this.svgPath,e.svgPos=this.svgPos,e.svgSize=this.svgSize,e.svgAlignmentRatio=this.svgAlignmentRatio,e.txts=this.aryText,e.fixedSize=this.fixedSize,e.svgRotate=this.svgRotate,e.useSvgColor=this.useSvgColor,e.svgReverse=this.svgReverse,e.svgMargin=this.svgMargin,e},t.prototype.create=function(){return new t},t.prototype.transformBy=function(e){this.svgPos.applyMatrix4(e),this.isSvgDirtyLocation=!0,this.fixedSize||this.aryText.forEach(function(t){t.txtPos.applyMatrix4(e)})},t.prototype.getTypeName=function(){return"MxDbSVG"},t.prototype.setColor=function(t){if(e.prototype.setColor.call(this,t),this.svg){var n=new Color(this.color);this.svg.traverse(function(e){e.material&&(e.material.color=n)})}},t.prototype.onViewChange=function(){if(!this.fixedSize)return!1;var e=this.getMxObject();if(null==e)return!1;if(this.svg){if(!this.svgBoxSize){this.svgBoxSize=new Vector3;var t=(new Box3).setFromObject(this.svg);this.svgBoxSize.x=t.max.x-t.min.x,this.svgBoxSize.y=t.max.y-t.min.y}var n=this.calcVewSize(e),r=n[0],i=n[1];this.svg.scale.x=r/this.svgBoxSize.x,this.svg.scale.y=i/this.svgBoxSize.y,this.svg.scale.z=this.svg.scale.x,this.svgReverse&&(this.svg.scale.y*=-1),this.isSvgDirtyLocation=!0,this.calcSvgPosition(e)}var a=this;return this.aryText.forEach(function(t){if(t._txtObject&&e){var n=e.screenCoordLong2Doc(t.txtHeight);n>1e-5&&(t._txtAspectRatio<=0&&(t._txtAspectRatio=t._txtObject.scale.x/t._txtObject.scale.y),t._txtObject.scale.set(t._txtAspectRatio*n,n,1),t.txtPos.x>0?t._txtObject.position.x=a.svgPos.x+e.screenCoordLong2Doc(t.txtPos.x):t._txtObject.position.x=a.svgPos.x-e.screenCoordLong2Doc(t.txtPos.x),t.txtPos.y>0?t._txtObject.position.y=a.svgPos.y+e.screenCoordLong2Doc(t.txtPos.y):t._txtObject.position.y=a.svgPos.y-e.screenCoordLong2Doc(t.txtPos.y),t._txtObject.updateMatrix())}}),!0},t}(MxDbEntity),index$9=Object.freeze({__proto__:null,default:MxDbSVG}),MxDbPolyline=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.points=[],t}return __extends(t,e),t.prototype.getTypeName=function(){return"MxDbPolyline"},t.prototype.worldDraw=function(e){this.points.length<2||e.drawLines(this.points)},t.prototype.getGripPoints=function(){return this.points},t.prototype.moveGripPointsAt=function(e,t){return!(e>=this.points.length)&&(this.points[e].add(t),!0)},t.prototype.create=function(){return new t},t.prototype.dwgIn=function(e){var t=this;this.onDwgIn(e);var n=e.points;return this.points=[],n.forEach(function(e){t.points.push(new Vector3(e.x,e.y,e.z))}),!0},t.prototype.dwgOut=function(e){return this.onDwgOut(e),e.points=this.points,e},t.prototype.addVertexAt=function(e){this.points.push(e)},t.prototype.numVerts=function(){return this.points.length},t.prototype.getPointAt=function(e){return e<this.points.length?this.points[e]:null},t.prototype.setPointAt=function(e,t){return e<this.points.length&&(this.points[e]=t,!0)},t}(MxDbEntity),index$8=Object.freeze({__proto__:null,default:MxDbPolyline}),McGiWorldDrawType;!function(e){e[e.kWorldDraw=1]="kWorldDraw",e[e.kDynDragDraw=2]="kDynDragDraw",e[e.kSelectDraw=3]="kSelectDraw"}(McGiWorldDrawType||(McGiWorldDrawType={}));var McGiWorldDrawType$1=McGiWorldDrawType,MxDb2LineAngularDimension=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.point1=new Vector3,t.point2=new Vector3,t.point3=new Vector3,t}return __extends(t,e),t.prototype.calculateLineAngle=function(e,t,n){var r=2*Math.PI/360;return{startAngle:180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI*r,endAngle:180*Math.atan2(n.y-e.y,n.x-e.x)/Math.PI*r}},t.prototype.worldDraw=function(e){if(e.getType()==McGiWorldDrawType$1.kWorldDraw||e.getType()==McGiWorldDrawType$1.kDynDragDraw){var t=e.getColor(),n=e.getMxObject(),r=MxThreeJS.createLine(this.point1,this.point2,t);e.drawEntity(r);var i=MxThreeJS.createLine(this.point2,this.point3,t);e.drawEntity(i);var a=this.calculateLineAngle(this.point2,this.point1,this.point3),o=a.startAngle,s=a.endAngle,l=this.point2.distanceTo(this.point1),c=this.point2.distanceTo(this.point3),u=(l>c?c:l)/4,h=MathUtils.radToDeg(o-s);h<0&&(h+=360);var p=n.screenCoordLong2Doc(50),d=new ArcCurve(this.point2.x,this.point2.y,u,o,s,!0),f=new Line((new BufferGeometry).setFromPoints(d.getPoints(50)),new LineBasicMaterial({color:"#ff0000"}));e.drawEntity(f);var m=d.getPoint(.5),g=new Vector3(m.x,m.y,0),v=g.sub(this.point2),y=v.length()+.5*p;v.normalize().multiplyScalar(y),g=this.point2.clone().add(v);var x=MxThreeJS.creatTextSprite(h.toFixed(3)+"°",g,.5*p,0,t);null!=x&&e.drawEntity(x)}else e.drawLine(this.point1,this.point2),e.drawLine(this.point3,this.point2)},t.prototype.getGripPoints=function(){return[this.point1,this.point2,this.point3]},t.prototype.moveGripPointsAt=function(e,t){return 0===e?this.point1.add(t):1===e?this.point2.add(t):2===e&&this.point3.add(t),!0},t.prototype.dwgIn=function(e){return this.onDwgIn(e),this.point1.copy(e.point1),this.point2.copy(e.point2),this.point3.copy(e.point3),e},t.prototype.dwgOut=function(e){return this.onDwgOut(e),e.point1=this.point1,e.point2=this.point2,e.point3=this.point3,e},t.prototype.create=function(){return new t},t.prototype.transformBy=function(e){this.point1.applyMatrix4(e),this.point2.applyMatrix4(e)},t.prototype.getTypeName=function(){return"MxDb2LineAngularDimension"},t}(MxDbEntity),index$7=Object.freeze({__proto__:null,default:MxDb2LineAngularDimension}),Mx3PointArc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.point1=new Vector3,t.point2=new Vector3,t.point3=new Vector3,t}return __extends(t,e),t.prototype.getTypeName=function(){return"Mx3PointArc"},t.prototype.create=function(){return new t},t.prototype.worldDraw=function(e){var t=createThreePointArc(this.point1,this.point2,this.point3,!0).arc;e.drawEntity(t)},t.prototype.getGripPoints=function(){return[this.point1,this.point2,this.point3]},t.prototype.moveGripPointsAt=function(e,t){return 0===e?this.point1.add(t):1===e?this.point2.add(t):2===e&&this.point3.add(t),!0},t.prototype.dwgIn=function(e){return this.onDwgIn(e),this.point1.copy(e.point1),this.point2.copy(e.point2),this.point3.copy(e.point3),e},t.prototype.dwgOut=function(e){return this.onDwgOut(e),e.point1=this.point1,e.point2=this.point2,e.point3=this.point3,e},t}(MxDbEntity),index$6=Object.freeze({__proto__:null,default:Mx3PointArc}),MxDbCoord=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.point1=new Vector3,t.point2=new Vector3,t}return __extends(t,e),t.prototype.worldDraw=function(e){var t=e.getMxObject();e.drawLine(this.point1,this.point2);var n=this.point2.clone(),r=t.screenCoordLong2Doc(20),i=6*r;n.x=n.x+i,e.drawLine(this.point2,n);var a=new Vector3,o=new Vector3,s=this.point1.x.toFixed(3),l=this.point1.y.toFixed(3);a.x=this.point2.x+.3*r+.5*i,a.y=this.point2.y+.1*r+.5*r,e.drawText(s,r,0,a),o.x=this.point2.x+.3*r+.5*i,o.y=this.point2.y-.1*r-.5*r,e.drawText(l,r,0,o)},t.prototype.getGripPoints=function(){var e=[];return e.push(this.point1),e.push(this.point2),e},t.prototype.moveGripPointsAt=function(e,t){return 0==e?this.point1.add(t):1==e&&this.point2.add(t),!0},t.prototype.dwgIn=function(e){return this.onDwgIn(e),this.point1.copy(e.point1),this.point2.copy(e.point2),!0},t.prototype.dwgOut=function(e){return this.onDwgOut(e),e.point1=this.point1,e.point2=this.point2,e},t.prototype.create=function(){return new t},t.prototype.transformBy=function(e){this.point1.applyMatrix4(e),this.point2.applyMatrix4(e)},t.prototype.getTypeName=function(){return"MxDbCoord"},t}(MxDbEntity),index$5=Object.freeze({__proto__:null,default:MxDbCoord}),MxDbLine=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.pt1=new Vector3,t.pt2=new Vector3,t}return __extends(t,e),t.prototype.getTypeName=function(){return"MxDbLine"},t.prototype.worldDraw=function(e){e.drawLine(this.pt1,this.pt2)},t.prototype.setPoint1=function(e){this.pt1=e},t.prototype.getPoint1=function(){return this.pt1},t.prototype.setPoint2=function(e){this.pt2=e},t.prototype.getPoint2=function(){return this.pt2},t.prototype.getGripPoints=function(){var e=[];e.push(this.pt1),e.push(this.pt2);var t=new Vector3(this.pt1.x+.5*(this.pt2.x-this.pt1.x),this.pt1.y+.5*(this.pt2.y-this.pt1.y),0);return e.push(t),e},t.prototype.moveGripPointsAt=function(e,t){return 0==e?this.pt1.add(t):1==e?this.pt2.add(t):2==e&&(this.pt1.add(t),this.pt2.add(t)),!0},t.prototype.dwgIn=function(e){return this.onDwgIn(e),this.pt1.copy(e.pt1),this.pt2.copy(e.pt2),!0},t.prototype.dwgOut=function(e){return this.onDwgOut(e),e.pt1=this.pt1,e.pt2=this.pt2,e},t.prototype.create=function(){return new t},t}(MxDbEntity),index$4=Object.freeze({__proto__:null,default:MxDbLine}),MxDbRect=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.cornerRadius=[],t.pt1=new Vector3,t.pt2=new Vector3,t.isSolidColorFill=!1,t.isLoadMaterialFromPath=!0,t.material=null,t}return __extends(t,e),t.prototype.worldDraw=function(e){var t=this,n=computeRectPoints(this.pt1,this.pt2);if(this.cornerRadius.length>0&&(n=getToGenerateRoundedCorners(n,this.cornerRadius)),e.getType()!=McGiWorldDrawType$1.kWorldDraw)return n.push(n[0]),void e.drawLines(n);var r={transparent:!0,depthTest:!1,opacity:this.opacity,visible:this.visible};if(this.isSolidColorFill){var i=void 0,a=new Mesh(i=new ShapeGeometry(new Shape(n=n.map(function(e){return new Vector2(e.x,e.y)}))),o=new MeshBasicMaterial(__assign({color:this.filter?this.filter._getFilterColor(this.color,this.opacity):new Color(this.color)},r)));e.drawEntity(a)}else if(this.fillImageSrc){if(this.material){n=n.map(function(e){return new Vector2(e.x,e.y)});var o=this.material;if(i=repairGeometryFaceVertexUvs(i=new ShapeGeometry(new Shape(n))),this.filter){var s=o.map;this.fillImageParam&&(this.fillImageParam.center&&(s.center=this.fillImageParam.center),this.fillImageParam.offset&&(s.offset=this.fillImageParam.offset),this.fillImageParam.repeat&&(s.repeat=this.fillImageParam.repeat),this.fillImageParam.rotation&&(s.rotation=this.fillImageParam.rotation));var l=this.filter._getFilterShaderData(s);o=new ShaderMaterial(__assign(__assign({},l),r))}o.depthTest=!1,o.transparent=!0,o.opacity=this.opacity,o.visible=this.visible;a=new Mesh(i,o);e.drawEntity(a)}else if(this.fillImageSrc.length>0&&this.isLoadMaterialFromPath){var c=this;MxFun.loadImageMaterial(this.fillImageSrc,function(e){t.isLoadMaterialFromPath=!1,e&&(c.material=e,c.setNeedUpdateDisplay(),MxFun.updateDisplay())})}}else{var u=new LineLoop(i=(new BufferGeometry).setFromPoints(n),o=new LineBasicMaterial(__assign({color:this.getColor()},r)));e.drawEntity(u)}},t.prototype.getGripPoints=function(){var e=[];e.push(this.pt1);var t=new Line3(this.pt1,this.pt2),n=new Vector3;return t.getCenter(n),e.push(n),e.push(this.pt2),e},t.prototype.moveGripPointsAt=function(e,t){return 0==e?this.pt1.add(t):1==e?(this.pt1.add(t),this.pt2.add(t)):2==e&&this.pt2.add(t),!0},t.prototype.dwgIn=function(e){return this.onDwgIn(e),this.pt1.copy(e.pt1),this.pt2.copy(e.pt2),this.isSolidColorFill=e.isSolidColorFill,this.fillImageSrc=e.fillImageSrc,this.fillImageParam=e.fillImageParam,this.cornerRadius=e.cornerRadius,this.filter=e.filter,this.isLoadMaterialFromPath=!0,this.material=null,!0},t.prototype.dwgOut=function(e){return this.onDwgOut(e),e.pt1=this.pt1,e.pt2=this.pt2,e.isSolidColorFill=this.isSolidColorFill,e.fillImageSrc=this.fillImageSrc,e.fillImageParam=this.fillImageParam,e.cornerRadius=this.cornerRadius,e.filter=this.filter,e},t.prototype.create=function(){return new t},t.prototype.transformBy=function(e){this.pt1.applyMatrix4(e),this.pt2.applyMatrix4(e)},t.prototype.setRadius=function(e,t){void 0===t&&(t=!0),e instanceof Array?this.cornerRadius=e.map(function(e){return t?MxFun.screenCoordLong2Doc(e):e}):this.cornerRadius=e>0?t?[MxFun.screenCoordLong2Doc(e),MxFun.screenCoordLong2Doc(e),MxFun.screenCoordLong2Doc(e),MxFun.screenCoordLong2Doc(e)]:[e,e,e,e]:[]},t.prototype.getTypeName=function(){return"MxDbRect"},t.prototype.getFilter=function(){return this.filter},t.prototype.setFilter=function(e){this.filter=e,this.isLoadMaterialFromPath=!0,this.material=null},t.prototype.setFillImagePath=function(e){this.fillImageSrc=e,this.isLoadMaterialFromPath=!0,this.material=null,this.fillImageSrc&&(this.isSolidColorFill=!1)},t.prototype.getFillImagePath=function(){return this.fillImageSrc},t}(MxDbEntity),index$3=Object.freeze({__proto__:null,default:MxDbRect}),MxDbAlignedDimension=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.pt1=new Vector3,t.pt2=new Vector3,t}return __extends(t,e),t.prototype.getTypeName=function(){return"MxDbAlignedDimension"},t.prototype.getDirection=function(e,t,n){var r=new Vector3(e.x,e.y,0),i=new Vector3(1,0,0),a=e.angleTo(i),o=-1;(a<7*Math.PI/18||a>10*Math.PI/18)&&t.x>n.x&&(o=1);var s=new Matrix4;return s.makeRotationZ(Math.PI/2*o),r.applyMatrix4(s),r},t.prototype.worldDraw=function(e){if(e.getType()==McGiWorldDrawType$1.kWorldDraw||e.getType()==McGiWorldDrawType$1.kDynDragDraw){var t,n,r,i,a,o,s,l=this.pt1,c=this.pt2,u=new Vector3(l.x-c.x,l.y-c.y,0),h=this.getDirection(u,l,c),p=u.length(),d=new Matrix4;d.makeScale(.01,.01,.01),(y=new Vector3(h.x,h.y,0)).applyMatrix4(d);var f=new Vector3(l.x+y.x,l.y+y.y,0),m=new Vector3(c.x+y.x,c.y+y.y,0),g=16777215;o=MxThreeJS.createPoint(l,g),s=MxThreeJS.createPoint(c,g),d.identity(),d.makeScale(.2,.2,0),new Vector3(h.x,h.y,0).applyMatrix4(d),d.identity(),d.makeScale(.02,.02,0);var v=new Vector3(h.x,h.y,0);v.applyMatrix4(d),e.drawLine(f,m),t=MxThreeJS.createLine(new Vector3(f.x+2*v.x,f.y+2*v.y,0),new Vector3(l.x+v.x,l.y+v.y,0),g),n=MxThreeJS.createLine(new Vector3(m.x+2*v.x,m.y+2*v.y,0),new Vector3(c.x+v.x,c.y+v.y,0),g);var y,x=new Vector3(1,0,0),_=u.angleTo(x);(y=new Vector3(h.x,h.y,0)).normalize();var b=l.distanceTo(c);u.y<0?_=_<Math.PI/2?2*Math.PI-_:Math.PI-_:_>Math.PI/2&&(_=Math.PI+_),null!=(r=MxThreeJS.creatTextSprite(p.toFixed(3),new Vector3(m.x+u.x/2+y.x*b/30,m.y+u.y/2+y.y*b/30,0),.07*b,_,g))&&e.drawEntity(r),d.identity(),d.makeScale(.08,.08,.08);var w=new Matrix4;w.makeRotationZ(17*Math.PI/18);var M=new Vector3(u.x,u.y,0);M.applyMatrix4(d),M.applyMatrix4(w),w.identity(),w.makeRotationZ(17*-Math.PI/18);var S=new Vector3(u.x,u.y,0);S.applyMatrix4(d),S.applyMatrix4(w);var T=new Array;T.push(new Vector3(f.x,f.y,0),new Vector3(f.x+M.x,f.y+M.y,0),new Vector3(f.x+S.x,f.y+S.y,0)),i=MxThreeJS.createTriangle(T,g),w.identity(),w.makeRotationZ(Math.PI/18),(M=new Vector3(u.x,u.y,0)).applyMatrix4(d),M.applyMatrix4(w),w.identity(),w.makeRotationZ(-Math.PI/18),(S=new Vector3(u.x,u.y,0)).applyMatrix4(d),S.applyMatrix4(w);var E=new Array;E.push(new Vector3(m.x,m.y,0),new Vector3(m.x+M.x,m.y+M.y,0),new Vector3(m.x+S.x,m.y+S.y,0)),a=MxThreeJS.createTriangle(E,g),e.drawEntity(t),e.drawEntity(n),i&&e.drawEntity(i),a&&e.drawEntity(a),e.drawEntity(o),e.drawEntity(s)}else e.drawLine(this.pt1,this.pt2)},t.prototype.setPoint1=function(e){this.pt1=e},t.prototype.setPoint2=function(e){this.pt2=e},t.prototype.getGripPoints=function(){var e=[];return e.push(this.pt1),e.push(this.pt2),e},t.prototype.moveGripPointsAt=function(e,t){return 0==e?this.pt1.add(t):(e=1)&&this.pt2.add(t),!0},t.prototype.dwgIn=function(e){return this.onDwgIn(e),this.pt1.copy(e.pt1),this.pt2.copy(e.pt2),!0},t.prototype.dwgOut=function(e){return this.onDwgOut(e),e.pt1=this.pt1,e.pt2=this.pt2,e},t.prototype.create=function(){return new t},t}(MxDbEntity),index$2=Object.freeze({__proto__:null,default:MxDbAlignedDimension}),MxFilters=function(){function e(){this.uniformObj={},this.filtersStr="",this.filtersTypes="",this.VSHADER_SOURCE="\n varying vec2 v_Uv; \n void main () {\n v_Uv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }\n ",this.FSHADER_SOURCE="\n varying vec2 v_Uv;\n uniform sampler2D e_Texture;\n uniform mat4 colorMatrix;\n ".concat(this.filtersStr,"\n void main () {\n vec4 color = texture2D( e_Texture, v_Uv );\n color = color * colorMatrix;\n ").concat(this.filtersTypes,"\n gl_FragColor = color;\n }"),this._matrix=new Matrix4}return e.prototype.channel=function(e){var t=e.r,n=void 0===t?1:t,r=e.g,i=void 0===r?1:r,a=e.b,o=void 0===a?1:a;return this._matrix=(new Matrix4).set(n,0,0,0,0,i,0,0,0,0,o,0,0,0,0,1).multiply(this._matrix),this},e.prototype.brightness=function(e){return this._matrix=(new Matrix4).set(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1).multiply(this._matrix),this},e.prototype.saturate=function(e){var t=.2126*(1-e),n=.7152*(1-e),r=.0722*(1-e);return this._matrix=(new Matrix4).set(t+e,n,r,0,t,n+e,r,0,t,n,r+e,0,0,0,0,1).multiply(this._matrix),this},e.prototype.contrast=function(e){var t=.5*(1-e);return this._matrix=(new Matrix4).set(e,0,0,0,0,e,0,0,0,0,e,0,t,t,t,1).multiply(this._matrix),this},e.prototype.opacity=function(e){return this._matrix=(new Matrix4).set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,e).multiply(this._matrix),this},e.prototype.invert=function(e){var t=1-2*e;return this._matrix=(new Matrix4).set(t,0,0,0,0,t,0,0,0,0,t,0,e,e,e,1).multiply(this._matrix),this},e.prototype.grayscale=function(e){void 0===e&&(e=1);var t=.2126*e,n=.7152*e,r=.0722*e;return this._matrix=(new Matrix4).set(t+1-e,n,r,0,t,n+1-e,r,0,t,n,r+1-e,0,0,0,0,1).multiply(this._matrix),this},e.prototype.sepia=function(e){return void 0===e&&(e=1),this._matrix=(new Matrix4).set(1-.607*e,.769*e,.189*e,0,.349*e,1-.314*e,.168*e,0,.272*e,.534*e,1-.869*e,0,0,0,0,1).multiply(this._matrix),this},e.prototype.hueRotate=function(e){var t=e/180*Math.PI,n=Math.cos(t),r=Math.sin(t);return this._matrix=(new Matrix4).set(.2126+.7874*n+-.2126*r,.7152+-.7152*n+-.7152*r,.0722+-.0722*n+.9278*r,0,.2126+-.2126*n+.143*r,.7152+n*(1-.7152)+.14*r,.0722+-.0722*n+-.283*r,0,.2126+-.2126*n+-.7874*r,.7152+-.7152*n+.7152*r,.0722+.9278*n+.0722*r,0,0,0,0,1).multiply(this._matrix),this},e.prototype.convolution=function(e,t,n){return void 0===t&&(t=1/9),void 0===n&&(n=521),this.uniformObj=__assign(__assign({},this.uniformObj),{cKernel:{value:e.toArray()},stStep:{value:t},scaleFactor:{value:n}}),this.filtersTypes.indexOf("convolutionTextureColor")<0&&(this.filtersStr+="\n uniform float cKernel[9];\n uniform float stStep;\n uniform float scaleFactor;\n vec4 convolutionTextureColor(vec4 color) {\n vec2 offsets[9];\n offsets[0] = vec2(-1.0,-1.0);\n offsets[1] = vec2(0.0,-1.0);\n offsets[2] = vec2(1.0,-1.0);\n offsets[3] = vec2(-1.0,0.0);\n offsets[4] = vec2(0.0,0.0);\n offsets[5] = vec2(1.0,0.0);\n offsets[6] = vec2(-1.0,1.0);\n offsets[7] = vec2(0.0,1.0);\n offsets[8] = vec2(1.0,1.0);\n \n vec4 sum = color;\n for(int i = 0; i < 9; i++) {\n sum = sum + cKernel[i] * scaleFactor * texture2D(e_Texture, v_Uv + offsets[i] / stStep);\n };\n return sum;\n }",this.filtersTypes+="color = convolutionTextureColor(color);\n"),this},e.prototype.reset=function(){return this.uniformObj={},this.filtersStr="",this.filtersTypes="",this._matrix=new Matrix4,this},e.prototype._getFilterShaderData=function(e){return{uniforms:__assign({e_Texture:{value:e},colorMatrix:{value:this._matrix}},this.uniformObj),vertexShader:this.VSHADER_SOURCE,fragmentShader:this.FSHADER_SOURCE}},e.prototype._getFilterColor=function(e,t){void 0===e&&(e="#000000"),void 0===t&&(t=1);var n=(e=new Color(e)).r,r=e.g,i=e.b,a=this._matrix.toArray();a[12],a[13],a[14],a[15];var o=a[0]*n+a[1]*n+a[2]*n+a[3]*t,s=a[4]*r+a[5]*r+a[6]*r+a[7]*t,l=a[8]*i+a[9]*i+a[10]*i+a[11]*t;return e.setRGB(o,s,l),e},e}(),Mxassembly$1=function(){function e(){this.mxassembly=null}return e.prototype.initImp=function(){this.mxassembly||store.state.Mxassembly&&(this.mxassembly=store.state.Mxassembly)},e.prototype.NewMcGePoint3d=function(e,t,n){this.initImp();var r=new this.mxassembly.McGePoint3d;return e&&(r.x=e),t&&(r.y=t),n&&(r.z=n),r},e.prototype.NewMcGePoint3dArray=function(e){var t=this;this.initImp();var n=new this.mxassembly.McGePoint3dArray;return e&&e.forEach(function(e){var r=t.NewMcGePoint3d();r.x=e.x,r.y=e.y,r.z=e.z,n.append(r)}),n},e}(),Mxassembly=new Mxassembly$1,McGeTool$1=function(){function e(){this.mxgeTool=null}return e.prototype.initImp=function(){this.mxgeTool||store.state.Mxassembly&&(this.mxgeTool=new store.state.Mxassembly.McGeTool)},e.prototype.calcArea=function(e){if(this.initImp(),e instanceof Array){var t=Mxassembly.NewMcGePoint3dArray(e);return this.mxgeTool.calcArea(t)}return this.mxgeTool.calcArea(e)},e.prototype.pointInPolyline=function(e,t){this.initImp();var n=t;t instanceof Array&&(n=Mxassembly.NewMcGePoint3dArray(t));var r=Mxassembly.NewMcGePoint3d(e.x,e.y,e.z);return this.mxgeTool.pointInPolyline(r,n)},e}(),McGeTool=new McGeTool$1,MxDbArea=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.points=[],t}return __extends(t,e),t.prototype.getTypeName=function(){return"MxDbArea"},t.prototype.create=function(){return new t},t.prototype.worldDraw=function(e){if(this.points.length<3)2==this.points.length&&e.drawLine(this.points[0],this.points[1]);else{for(var t=this.points[0],n=t.clone(),r=t.clone(),i=this.points.length,a=1;a<i;a++){var o=this.points[a];n.x>o.x&&(n.x=o.x),n.y>o.y&&(n.y=o.y),r.x<o.x&&(r.x=o.x),r.y<o.y&&(r.y=o.y),e.drawLine(t,o),t=o}e.drawLine(t,this.points[0]);var s=McGeTool.calcArea(this.points),l=new Vector3(n.x+.5*(r.x-n.x),n.y+.5*(r.y-n.y)),c=MxFun.screenCoordLong2Doc(20),u=MxThreeJS.creatTextSprite(s.toFixed(2),l,c,0,16777215);null!=u&&e.drawEntity(u)}},t.prototype.getGripPoints=function(){return this.points},t.prototype.moveGripPointsAt=function(e,t){return!(e>=this.points.length)&&(this.points[e].add(t),!0)},t.prototype.dwgIn=function(e){var t=this;this.onDwgIn(e);var n=e.points;return this.points=[],n.forEach(function(e){t.points.push(new Vector3(e.x,e.y,e.z))}),!0},t.prototype.dwgOut=function(e){return this.onDwgOut(e),e.points=this.points,e},t.prototype.addPoint=function(e){this.points.push(e.clone())},t.prototype.getPoints=function(){return this.points},t.prototype.clearPoint=function(){this.points=[]},t}(MxDbEntity),index$1=Object.freeze({__proto__:null,default:MxDbArea}),MxDbAnyLine=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.points=[],t}return __extends(t,e),t.prototype.getTypeName=function(){return"MxDbAnyLine"},t.prototype.create=function(){return new t},t.prototype.worldDraw=function(e){var t=e.getMxObject(),n=createAnyLine(this.points);n.geometry.computeBoundingBox();var r=new Vector3;if(n.geometry.boundingBox.getCenter(r),e.drawEntity(n),e.getType()===McGiWorldDrawType$1.kSelectDraw){var i=new Vector3;n.geometry.boundingBox.getSize(i),i.addScalar(t.screenCoordLong2Doc(20));var a=i.x/2,o=i.y/2,s={x:r.x-a,y:r.y-o},l={x:r.x+a,y:r.y-o},c={x:r.x+a,y:r.y+o},u={x:r.x-a,y:r.y+o};e.drawLine(s.x,s.y,l.x,l.y),e.drawLine(l.x,l.y,c.x,c.y),e.drawLine(c.x,c.y,u.x,u.y),e.drawLine(u.x,u.y,s.x,s.y)}},t.prototype.getCenter=function(){var e=new Geometry;e.vertices=this.points;var t=new Vector3;return e.computeBoundingBox(),e.boundingBox.getCenter(t),t},t.prototype.getGripPoints=function(){return[this.getCenter()]},t.prototype.moveGripPointsAt=function(e,t){return this.points.forEach(function(e){e.add(t)}),!0},t.prototype.dwgIn=function(e){var t=this;this.onDwgIn(e);var n=e.points;return this.points=[],n.forEach(function(e){t.points.push(new Vector3(e.x,e.y,e.z))}),!0},t.prototype.dwgOut=function(e){return this.onDwgOut(e),e.points=this.points,e},t}(MxDbEntity),index=Object.freeze({__proto__:null,default:MxDbAnyLine}),mxdraw={MxFun:MxFun,Mxassembly:Mxassembly,McGeTool:McGeTool,MxThreeJS:MxThreeJS,McEdGetPointWorldDrawObject:McEdGetPointWorldDrawObject,MrxDbgUiPrPoint:MrxDbgUiPrPoint,MxDbEntity:MxDbEntity,MxFilters:MxFilters,MxDbImage:MxDbImage,MxDbLine:MxDbLine,MxDbSVG:MxDbSVG,MxDbSVGText:MxDbSVGText,MxDbPolyline:MxDbPolyline,Mx3PointArc:Mx3PointArc,MxDbCoord:MxDbCoord,MxDb2LineAngularDimension:MxDb2LineAngularDimension,MxDbRect:MxDbRect,MxDbAlignedDimension:MxDbAlignedDimension,useCanvasResizeListener:useCanvasResizeListener,loadCoreCode:loadCoreCode,store:store,MrxDbgUiPrBaseReturn:MrxDbgUiPrBaseReturn$1,McGiWorldDrawType:McGiWorldDrawType$1,MxDbArea:MxDbArea,MxDbAnyLine:MxDbAnyLine},elementResizeEventPolyfill_umd_min=createCommonjsModule(function(e,t){"undefined"!=typeof self&&self,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fae3")}({"6dd8":function(e,t,n){(function(e){var n=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n++){var i=r[n];e.call(t,i[1],i[0])}},t}()}(),r="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,i=void 0!==e&&e.Math===Math?e:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),a="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(i):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)},o=2,s=20,l=["top","right","bottom","left","width","height","size","weight"],c="undefined"!=typeof MutationObserver,u=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,i=0;function s(){n&&(n=!1,e()),r&&c()}function l(){a(s)}function c(){var e=Date.now();if(n){if(e-i<o)return;r=!0}else n=!0,r=!1,setTimeout(l,t);i=e}return c}(this.refresh.bind(this),s)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),e.length>0},e.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),c?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t,r=l.some(function(e){return!!~n.indexOf(e)});r&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),h=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},p=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||i},d=x(0,0,0,0);function f(e){return parseFloat(e)||0}function m(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(t,n){var r=e["border-"+n+"-width"];return t+f(r)},0)}function g(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return d;var r=p(e).getComputedStyle(e),i=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var i=r[n],a=e["padding-"+i];t[i]=f(a)}return t}(r),a=i.left+i.right,o=i.top+i.bottom,s=f(r.width),l=f(r.height);if("border-box"===r.boxSizing&&(Math.round(s+a)!==t&&(s-=m(r,"left","right")+a),Math.round(l+o)!==n&&(l-=m(r,"top","bottom")+o)),!function(e){return e===p(e).document.documentElement}(e)){var c=Math.round(s+a)-t,u=Math.round(l+o)-n;1!==Math.abs(c)&&(s-=c),1!==Math.abs(u)&&(l-=u)}return x(i.left,i.top,s,l)}var v="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof p(e).SVGGraphicsElement}:function(e){return e instanceof p(e).SVGElement&&"function"==typeof e.getBBox};function y(e){return r?v(e)?function(e){var t=e.getBBox();return x(0,0,t.width,t.height)}(e):g(e):d}function x(e,t,n,r){return{x:e,y:t,width:n,height:r}}var _=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=x(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=y(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),b=function(e,t){var n=function(e){var t=e.x,n=e.y,r=e.width,i=e.height,a="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,o=Object.create(a.prototype);return h(o,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),o}(t);h(this,{target:e,contentRect:n})},w=function(){function e(e,t,r){if(this.activeObservations_=[],this.observations_=new n,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=r}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof p(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new _(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof p(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new b(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),M="undefined"!=typeof WeakMap?new WeakMap:new n,S=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=u.getInstance(),r=new w(t,n,this);M.set(this,r)};["observe","unobserve","disconnect"].forEach(function(e){S.prototype[e]=function(){var t;return(t=M.get(this))[e].apply(t,arguments)}});var T=void 0!==i.ResizeObserver?i.ResizeObserver:S;t.a=T}).call(this,n("c8ba"))},c8ba:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},f6fd:function(e,t){!function(e){var t="currentScript",n=e.getElementsByTagName("script");t in e||Object.defineProperty(e,t,{get:function(){try{throw new Error}catch(r){var e,t=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(r.stack)||[!1])[1];for(e in n)if(n[e].src==t||"interactive"==n[e].readyState)return n[e];return null}}})}(document)},fae3:function(e,t,n){var r;n.r(t),n.d(t,"EventListenerWrapper",function(){return s}),"undefined"!=typeof window&&(n("f6fd"),(r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(n.p=r[1]));var i=n("6dd8");const a=EventTarget.prototype.addEventListener,o=function(e){const t=document.createEvent("HTMLEvents");return t.initEvent(e),t},s=function(e){"resize"===e&&c(this),a.apply(this,arguments)};function l(e){const t=l.observer=l.observer||new i.a(e);return t.initialized=!0,t}function c(e){const t=l(e=>{if(t.initialized)t.initialized=!1;else for(let t of e){const e=o("resize");t.target.dispatchEvent(e),t&&t.target&&"function"==typeof t.target.onresize&&t.target.onresize(e)}});t.observe(e)}HTMLElement.prototype.addEventListener=s,Reflect.defineProperty(HTMLElement.prototype,"onresize",{set(e){this._onresize=e,"function"==typeof e&&c(this)},get(){return this._onresize||null}})}})}),elementResizeEventPolyfill_umd_min$1=unwrapExports(elementResizeEventPolyfill_umd_min),elementResizeEventPolyfill_umd_min$2=Object.freeze({__proto__:null,default:elementResizeEventPolyfill_umd_min$1,__moduleExports:elementResizeEventPolyfill_umd_min}),jquery=createCommonjsModule(function(e){var t,n;t="undefined"!=typeof window?window:commonjsGlobal,n=function(e,t){var n=[],r=Object.getPrototypeOf,i=n.slice,a=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},o=n.push,s=n.indexOf,l={},c=l.toString,u=l.hasOwnProperty,h=u.toString,p=h.call(Object),d={},f=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},m=function(e){return null!=e&&e===e.window},g=e.document,v={type:!0,src:!0,nonce:!0,noModule:!0};function y(e,t,n){var r,i,a=(n=n||g).createElement("script");if(a.text=e,t)for(r in v)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&a.setAttribute(r,i);n.head.appendChild(a).parentNode.removeChild(a)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var _=function(e,t){return new _.fn.init(e,t)};function b(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!f(e)&&!m(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}_.fn=_.prototype={jquery:"3.6.0",constructor:_,length:0,toArray:function(){return i.call(this)},get:function(e){return null==e?i.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=_.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return _.each(this,e)},map:function(e){return this.pushStack(_.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(_.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(_.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:o,sort:n.sort,splice:n.splice},_.extend=_.fn.extend=function(){var e,t,n,r,i,a,o=arguments[0]||{},s=1,l=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[s]||{},s++),"object"==typeof o||f(o)||(o={}),s===l&&(o=this,s--);s<l;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&o!==r&&(c&&r&&(_.isPlainObject(r)||(i=Array.isArray(r)))?(n=o[t],a=i&&!Array.isArray(n)?[]:i||_.isPlainObject(n)?n:{},i=!1,o[t]=_.extend(c,a,r)):void 0!==r&&(o[t]=r));return o},_.extend({expando:"jQuery"+("3.6.0"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==c.call(e))&&(!(t=r(e))||"function"==typeof(n=u.call(t,"constructor")&&t.constructor)&&h.call(n)===p)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){y(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(b(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(b(Object(e))?_.merge(n,"string"==typeof e?[e]:e):o.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:s.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,a=e.length,o=!n;i<a;i++)!t(e[i],i)!==o&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,s=[];if(b(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&s.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&s.push(i);return a(s)},guid:1,support:d}),"function"==typeof Symbol&&(_.fn[Symbol.iterator]=n[Symbol.iterator]),_.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});var w=function(e){var t,n,r,i,a,o,s,l,c,u,h,p,d,f,m,g,v,y,x,_="sizzle"+1*new Date,b=e.document,w=0,M=0,S=le(),T=le(),E=le(),C=le(),A=function(e,t){return e===t&&(h=!0),0},L={}.hasOwnProperty,D=[],P=D.pop,O=D.push,R=D.push,I=D.slice,B=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},N="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",k="[\\x20\\t\\r\\n\\f]",F="(?:\\\\[\\da-fA-F]{1,6}"+k+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",G="\\["+k+"*("+F+")(?:"+k+"*([*^$|!~]?=)"+k+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+k+"*\\]",V=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+G+")*)|.*)\\)|)",z=new RegExp(k+"+","g"),U=new RegExp("^"+k+"+|((?:^|[^\\\\])(?:\\\\.)*)"+k+"+$","g"),j=new RegExp("^"+k+"*,"+k+"*"),H=new RegExp("^"+k+"*([>+~]|"+k+")"+k+"*"),W=new RegExp(k+"|>"),q=new RegExp(V),J=new RegExp("^"+F+"$"),X={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+G),PSEUDO:new RegExp("^"+V),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+k+"*(even|odd|(([+-]|)(\\d*)n|)"+k+"*(?:([+-]|)"+k+"*(\\d+)|))"+k+"*\\)|)","i"),bool:new RegExp("^(?:"+N+")$","i"),needsContext:new RegExp("^"+k+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+k+"*((?:-\\d)?\\d*)"+k+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,$=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+k+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ae=function(){p()},oe=_e(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{R.apply(D=I.call(b.childNodes),b.childNodes),D[b.childNodes.length].nodeType}catch(e){R={apply:D.length?function(e,t){O.apply(e,I.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function se(e,t,r,i){var a,s,c,u,h,f,v,y=t&&t.ownerDocument,b=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==b&&9!==b&&11!==b)return r;if(!i&&(p(t),t=t||d,m)){if(11!==b&&(h=Q.exec(e)))if(a=h[1]){if(9===b){if(!(c=t.getElementById(a)))return r;if(c.id===a)return r.push(c),r}else if(y&&(c=y.getElementById(a))&&x(t,c)&&c.id===a)return r.push(c),r}else{if(h[2])return R.apply(r,t.getElementsByTagName(e)),r;if((a=h[3])&&n.getElementsByClassName&&t.getElementsByClassName)return R.apply(r,t.getElementsByClassName(a)),r}if(n.qsa&&!C[e+" "]&&(!g||!g.test(e))&&(1!==b||"object"!==t.nodeName.toLowerCase())){if(v=e,y=t,1===b&&(W.test(e)||H.test(e))){for((y=ee.test(e)&&ve(t.parentNode)||t)===t&&n.scope||((u=t.getAttribute("id"))?u=u.replace(re,ie):t.setAttribute("id",u=_)),s=(f=o(e)).length;s--;)f[s]=(u?"#"+u:":scope")+" "+xe(f[s]);v=f.join(",")}try{return R.apply(r,y.querySelectorAll(v)),r}catch(t){C(e,!0)}finally{u===_&&t.removeAttribute("id")}}}return l(e.replace(U,"$1"),t,r,i)}function le(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function ce(e){return e[_]=!0,e}function ue(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function he(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function de(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function fe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&oe(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ge(e){return ce(function(t){return t=+t,ce(function(n,r){for(var i,a=e([],n.length,t),o=a.length;o--;)n[i=a[o]]&&(n[i]=!(r[i]=n[i]))})})}function ve(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=se.support={},a=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},p=se.setDocument=function(e){var t,i,o=e?e.ownerDocument||e:b;return o!=d&&9===o.nodeType&&o.documentElement?(f=(d=o).documentElement,m=!a(d),b!=d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",ae,!1):i.attachEvent&&i.attachEvent("onunload",ae)),n.scope=ue(function(e){return f.appendChild(e).appendChild(d.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=K.test(d.getElementsByClassName),n.getById=ue(function(e){return f.appendChild(e).id=_,!d.getElementsByName||!d.getElementsByName(_).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,r,i,a=t.getElementById(e);if(a){if((n=a.getAttributeNode("id"))&&n.value===e)return[a];for(i=t.getElementsByName(e),r=0;a=i[r++];)if((n=a.getAttributeNode("id"))&&n.value===e)return[a]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,a=t.getElementsByTagName(e);if("*"===e){for(;n=a[i++];)1===n.nodeType&&r.push(n);return r}return a},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},v=[],g=[],(n.qsa=K.test(d.querySelectorAll))&&(ue(function(e){var t;f.appendChild(e).innerHTML="<a id='"+_+"'></a><select id='"+_+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+k+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+k+"*(?:value|"+N+")"),e.querySelectorAll("[id~="+_+"-]").length||g.push("~="),(t=d.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||g.push("\\["+k+"*name"+k+"*="+k+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+_+"+*").length||g.push(".#.+[+~]"),e.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")}),ue(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+k+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),f.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(n.matchesSelector=K.test(y=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),v.push("!=",V)}),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),t=K.test(f.compareDocumentPosition),x=t||K.test(f.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},A=t?function(e,t){if(e===t)return h=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==d||e.ownerDocument==b&&x(b,e)?-1:t==d||t.ownerDocument==b&&x(b,t)?1:u?B(u,e)-B(u,t):0:4&r?-1:1)}:function(e,t){if(e===t)return h=!0,0;var n,r=0,i=e.parentNode,a=t.parentNode,o=[e],s=[t];if(!i||!a)return e==d?-1:t==d?1:i?-1:a?1:u?B(u,e)-B(u,t):0;if(i===a)return pe(e,t);for(n=e;n=n.parentNode;)o.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;o[r]===s[r];)r++;return r?pe(o[r],s[r]):o[r]==b?-1:s[r]==b?1:0},d):d},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(p(e),n.matchesSelector&&m&&!C[t+" "]&&(!v||!v.test(t))&&(!g||!g.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){C(t,!0)}return se(t,d,null,[e]).length>0},se.contains=function(e,t){return(e.ownerDocument||e)!=d&&p(e),x(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=d&&p(e);var i=r.attrHandle[t.toLowerCase()],a=i&&L.call(r.attrHandle,t.toLowerCase())?i(e,t,!m):void 0;return void 0!==a?a:n.attributes||!m?e.getAttribute(t):(a=e.getAttributeNode(t))&&a.specified?a.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,r=[],i=0,a=0;if(h=!n.detectDuplicates,u=!n.sortStable&&e.slice(0),e.sort(A),h){for(;t=e[a++];)t===e[a]&&(i=r.push(a));for(;i--;)e.splice(r[i],1)}return u=null,e},i=se.getText=function(e){var t,n="",r=0,a=e.nodeType;if(a){if(1===a||9===a||11===a){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===a||4===a)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=se.selectors={cacheLength:50,createPseudo:ce,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return X.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&q.test(n)&&(t=o(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=S[e+" "];return t||(t=new RegExp("(^|"+k+")"+e+"("+k+"|$)"))&&S(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=se.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(z," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var a="nth"!==e.slice(0,3),o="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,h,p,d,f,m=a!==o?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s,x=!1;if(g){if(a){for(;m;){for(p=t;p=p[m];)if(s?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;f=m="only"===e&&!f&&"nextSibling"}return!0}if(f=[o?g.firstChild:g.lastChild],o&&y){for(x=(d=(c=(u=(h=(p=g)[_]||(p[_]={}))[p.uniqueID]||(h[p.uniqueID]={}))[e]||[])[0]===w&&c[1])&&c[2],p=d&&g.childNodes[d];p=++d&&p&&p[m]||(x=d=0)||f.pop();)if(1===p.nodeType&&++x&&p===t){u[e]=[w,d,x];break}}else if(y&&(x=d=(c=(u=(h=(p=t)[_]||(p[_]={}))[p.uniqueID]||(h[p.uniqueID]={}))[e]||[])[0]===w&&c[1]),!1===x)for(;(p=++d&&p&&p[m]||(x=d=0)||f.pop())&&((s?p.nodeName.toLowerCase()!==v:1!==p.nodeType)||!++x||(y&&((u=(h=p[_]||(p[_]={}))[p.uniqueID]||(h[p.uniqueID]={}))[e]=[w,x]),p!==t)););return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return i[_]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ce(function(e,n){for(var r,a=i(e,t),o=a.length;o--;)e[r=B(e,a[o])]=!(n[r]=a[o])}):function(e){return i(e,0,n)}):i}},pseudos:{not:ce(function(e){var t=[],n=[],r=s(e.replace(U,"$1"));return r[_]?ce(function(e,t,n,i){for(var a,o=r(e,null,i,[]),s=e.length;s--;)(a=o[s])&&(e[s]=!(t[s]=a))}):function(e,i,a){return t[0]=e,r(t,null,a,n),t[0]=null,!n.pop()}}),has:ce(function(e){return function(t){return se(e,t).length>0}}),contains:ce(function(e){return e=e.replace(te,ne),function(t){return(t.textContent||i(t)).indexOf(e)>-1}}),lang:ce(function(e){return J.test(e||"")||se.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return $.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ge(function(){return[0]}),last:ge(function(e,t){return[t-1]}),eq:ge(function(e,t,n){return[n<0?n+t:n]}),even:ge(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ge(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ge(function(e,t,n){for(var r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e}),gt:ge(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=de(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=fe(t);function ye(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function _e(e,t,n){var r=t.dir,i=t.next,a=i||r,o=n&&"parentNode"===a,s=M++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||o)return e(t,n,i);return!1}:function(t,n,l){var c,u,h,p=[w,s];if(l){for(;t=t[r];)if((1===t.nodeType||o)&&e(t,n,l))return!0}else for(;t=t[r];)if(1===t.nodeType||o)if(u=(h=t[_]||(t[_]={}))[t.uniqueID]||(h[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((c=u[a])&&c[0]===w&&c[1]===s)return p[2]=c[2];if(u[a]=p,p[2]=e(t,n,l))return!0}return!1}}function be(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function we(e,t,n,r,i){for(var a,o=[],s=0,l=e.length,c=null!=t;s<l;s++)(a=e[s])&&(n&&!n(a,r,i)||(o.push(a),c&&t.push(s)));return o}function Me(e,t,n,r,i,a){return r&&!r[_]&&(r=Me(r)),i&&!i[_]&&(i=Me(i,a)),ce(function(a,o,s,l){var c,u,h,p=[],d=[],f=o.length,m=a||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(t||"*",s.nodeType?[s]:s,[]),g=!e||!a&&t?m:we(m,p,e,s,l),v=n?i||(a?e:f||r)?[]:o:g;if(n&&n(g,v,s,l),r)for(c=we(v,d),r(c,[],s,l),u=c.length;u--;)(h=c[u])&&(v[d[u]]=!(g[d[u]]=h));if(a){if(i||e){if(i){for(c=[],u=v.length;u--;)(h=v[u])&&c.push(g[u]=h);i(null,v=[],c,l)}for(u=v.length;u--;)(h=v[u])&&(c=i?B(a,h):p[u])>-1&&(a[c]=!(o[c]=h))}}else v=we(v===o?v.splice(f,v.length):v),i?i(null,o,v,l):R.apply(o,v)})}function Se(e){for(var t,n,i,a=e.length,o=r.relative[e[0].type],s=o||r.relative[" "],l=o?1:0,u=_e(function(e){return e===t},s,!0),h=_e(function(e){return B(t,e)>-1},s,!0),p=[function(e,n,r){var i=!o&&(r||n!==c)||((t=n).nodeType?u(e,n,r):h(e,n,r));return t=null,i}];l<a;l++)if(n=r.relative[e[l].type])p=[_e(be(p),n)];else{if((n=r.filter[e[l].type].apply(null,e[l].matches))[_]){for(i=++l;i<a&&!r.relative[e[i].type];i++);return Me(l>1&&be(p),l>1&&xe(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(U,"$1"),n,l<i&&Se(e.slice(l,i)),i<a&&Se(e=e.slice(i)),i<a&&xe(e))}p.push(n)}return be(p)}return ye.prototype=r.filters=r.pseudos,r.setFilters=new ye,o=se.tokenize=function(e,t){var n,i,a,o,s,l,c,u=T[e+" "];if(u)return t?0:u.slice(0);for(s=e,l=[],c=r.preFilter;s;){for(o in n&&!(i=j.exec(s))||(i&&(s=s.slice(i[0].length)||s),l.push(a=[])),n=!1,(i=H.exec(s))&&(n=i.shift(),a.push({value:n,type:i[0].replace(U," ")}),s=s.slice(n.length)),r.filter)!(i=X[o].exec(s))||c[o]&&!(i=c[o](i))||(n=i.shift(),a.push({value:n,type:o,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?se.error(e):T(e,l).slice(0)},s=se.compile=function(e,t){var n,i=[],a=[],s=E[e+" "];if(!s){for(t||(t=o(e)),n=t.length;n--;)(s=Se(t[n]))[_]?i.push(s):a.push(s);(s=E(e,function(e,t){var n=t.length>0,i=e.length>0,a=function(a,o,s,l,u){var h,f,g,v=0,y="0",x=a&&[],_=[],b=c,M=a||i&&r.find.TAG("*",u),S=w+=null==b?1:Math.random()||.1,T=M.length;for(u&&(c=o==d||o||u);y!==T&&null!=(h=M[y]);y++){if(i&&h){for(f=0,o||h.ownerDocument==d||(p(h),s=!m);g=e[f++];)if(g(h,o||d,s)){l.push(h);break}u&&(w=S)}n&&((h=!g&&h)&&v--,a&&x.push(h))}if(v+=y,n&&y!==v){for(f=0;g=t[f++];)g(x,_,o,s);if(a){if(v>0)for(;y--;)x[y]||_[y]||(_[y]=P.call(l));_=we(_)}R.apply(l,_),u&&!a&&_.length>0&&v+t.length>1&&se.uniqueSort(l)}return u&&(w=S,c=b),x};return n?ce(a):a}(a,i))).selector=e}return s},l=se.select=function(e,t,n,i){var a,l,c,u,h,p="function"==typeof e&&e,d=!i&&o(e=p.selector||e);if(n=n||[],1===d.length){if((l=d[0]=d[0].slice(0)).length>2&&"ID"===(c=l[0]).type&&9===t.nodeType&&m&&r.relative[l[1].type]){if(!(t=(r.find.ID(c.matches[0].replace(te,ne),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(a=X.needsContext.test(e)?0:l.length;a--&&(c=l[a],!r.relative[u=c.type]);)if((h=r.find[u])&&(i=h(c.matches[0].replace(te,ne),ee.test(l[0].type)&&ve(t.parentNode)||t))){if(l.splice(a,1),!(e=i.length&&xe(l)))return R.apply(n,i),n;break}}return(p||s(e,d))(i,t,!m,n,!t||ee.test(e)&&ve(t.parentNode)||t),n},n.sortStable=_.split("").sort(A).join("")===_,n.detectDuplicates=!!h,p(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ue(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||he("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||he("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||he(N,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(e);_.find=w,_.expr=w.selectors,_.expr[":"]=_.expr.pseudos,_.uniqueSort=_.unique=w.uniqueSort,_.text=w.getText,_.isXMLDoc=w.isXML,_.contains=w.contains,_.escapeSelector=w.escape;var M=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&_(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},T=_.expr.match.needsContext;function E(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function A(e,t,n){return f(t)?_.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?_.grep(e,function(e){return e===t!==n}):"string"!=typeof t?_.grep(e,function(e){return s.call(t,e)>-1!==n}):_.filter(t,e,n)}_.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?_.find.matchesSelector(r,e)?[r]:[]:_.find.matches(e,_.grep(t,function(e){return 1===e.nodeType}))},_.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(_(e).filter(function(){for(t=0;t<r;t++)if(_.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)_.find(e,i[t],n);return r>1?_.uniqueSort(n):n},filter:function(e){return this.pushStack(A(this,e||[],!1))},not:function(e){return this.pushStack(A(this,e||[],!0))},is:function(e){return!!A(this,"string"==typeof e&&T.test(e)?_(e):e||[],!1).length}});var L,D=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(_.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||L,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:D.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof _?t[0]:t,_.merge(this,_.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:g,!0)),C.test(r[1])&&_.isPlainObject(t))for(r in t)f(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=g.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):f(e)?void 0!==n.ready?n.ready(e):e(_):_.makeArray(e,this)}).prototype=_.fn,L=_(g);var P=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function R(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}_.fn.extend({has:function(e){var t=_(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(_.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,a=[],o="string"!=typeof e&&_(e);if(!T.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:1===n.nodeType&&_.find.matchesSelector(n,e))){a.push(n);break}return this.pushStack(a.length>1?_.uniqueSort(a):a)},index:function(e){return e?"string"==typeof e?s.call(_(e),this[0]):s.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(_.uniqueSort(_.merge(this.get(),_(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),_.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return M(e,"parentNode")},parentsUntil:function(e,t,n){return M(e,"parentNode",n)},next:function(e){return R(e,"nextSibling")},prev:function(e){return R(e,"previousSibling")},nextAll:function(e){return M(e,"nextSibling")},prevAll:function(e){return M(e,"previousSibling")},nextUntil:function(e,t,n){return M(e,"nextSibling",n)},prevUntil:function(e,t,n){return M(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(E(e,"template")&&(e=e.content||e),_.merge([],e.childNodes))}},function(e,t){_.fn[e]=function(n,r){var i=_.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=_.filter(r,i)),this.length>1&&(O[e]||_.uniqueSort(i),P.test(e)&&i.reverse()),this.pushStack(i)}});var I=/[^\x20\t\r\n\f]+/g;function B(e){return e}function N(e){throw e}function k(e,t,n,r){var i;try{e&&f(i=e.promise)?i.call(e).done(t).fail(n):e&&f(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}_.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return _.each(e.match(I)||[],function(e,n){t[n]=!0}),t}(e):_.extend({},e);var t,n,r,i,a=[],o=[],s=-1,l=function(){for(i=i||e.once,r=t=!0;o.length;s=-1)for(n=o.shift();++s<a.length;)!1===a[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=a.length,n=!1);e.memory||(n=!1),t=!1,i&&(a=n?[]:"")},c={add:function(){return a&&(n&&!t&&(s=a.length-1,o.push(n)),function t(n){_.each(n,function(n,r){f(r)?e.unique&&c.has(r)||a.push(r):r&&r.length&&"string"!==x(r)&&t(r)})}(arguments),n&&!t&&l()),this},remove:function(){return _.each(arguments,function(e,t){for(var n;(n=_.inArray(t,a,n))>-1;)a.splice(n,1),n<=s&&s--}),this},has:function(e){return e?_.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return i=o=[],a=n="",this},disabled:function(){return!a},lock:function(){return i=o=[],n||t||(a=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],o.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},_.extend({Deferred:function(t){var n=[["notify","progress",_.Callbacks("memory"),_.Callbacks("memory"),2],["resolve","done",_.Callbacks("once memory"),_.Callbacks("once memory"),0,"resolved"],["reject","fail",_.Callbacks("once memory"),_.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return a.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return _.Deferred(function(t){_.each(n,function(n,r){var i=f(e[r[4]])&&e[r[4]];a[r[1]](function(){var e=i&&i.apply(this,arguments);e&&f(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){var a=0;function o(t,n,r,i){return function(){var s=this,l=arguments,c=function(){var e,c;if(!(t<a)){if((e=r.apply(s,l))===n.promise())throw new TypeError("Thenable self-resolution");c=e&&("object"==typeof e||"function"==typeof e)&&e.then,f(c)?i?c.call(e,o(a,n,B,i),o(a,n,N,i)):(a++,c.call(e,o(a,n,B,i),o(a,n,N,i),o(a,n,B,n.notifyWith))):(r!==B&&(s=void 0,l=[e]),(i||n.resolveWith)(s,l))}},u=i?c:function(){try{c()}catch(e){_.Deferred.exceptionHook&&_.Deferred.exceptionHook(e,u.stackTrace),t+1>=a&&(r!==N&&(s=void 0,l=[e]),n.rejectWith(s,l))}};t?u():(_.Deferred.getStackHook&&(u.stackTrace=_.Deferred.getStackHook()),e.setTimeout(u))}}return _.Deferred(function(e){n[0][3].add(o(0,e,f(i)?i:B,e.notifyWith)),n[1][3].add(o(0,e,f(t)?t:B)),n[2][3].add(o(0,e,f(r)?r:N))}).promise()},promise:function(e){return null!=e?_.extend(e,i):i}},a={};return _.each(n,function(e,t){var o=t[2],s=t[5];i[t[1]]=o.add,s&&o.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),o.add(t[3].fire),a[t[0]]=function(){return a[t[0]+"With"](this===a?void 0:this,arguments),this},a[t[0]+"With"]=o.fireWith}),i.promise(a),t&&t.call(a,a),a},when:function(e){var t=arguments.length,n=t,r=Array(n),a=i.call(arguments),o=_.Deferred(),s=function(e){return function(n){r[e]=this,a[e]=arguments.length>1?i.call(arguments):n,--t||o.resolveWith(r,a)}};if(t<=1&&(k(e,o.done(s(n)).resolve,o.reject,!t),"pending"===o.state()||f(a[n]&&a[n].then)))return o.then();for(;n--;)k(a[n],s(n),o.reject);return o.promise()}});var F=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;_.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&F.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},_.readyException=function(t){e.setTimeout(function(){throw t})};var G=_.Deferred();function V(){g.removeEventListener("DOMContentLoaded",V),e.removeEventListener("load",V),_.ready()}_.fn.ready=function(e){return G.then(e).catch(function(e){_.readyException(e)}),this},_.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--_.readyWait:_.isReady)||(_.isReady=!0,!0!==e&&--_.readyWait>0||G.resolveWith(g,[_]))}}),_.ready.then=G.then,"complete"===g.readyState||"loading"!==g.readyState&&!g.documentElement.doScroll?e.setTimeout(_.ready):(g.addEventListener("DOMContentLoaded",V),e.addEventListener("load",V));var z=function(e,t,n,r,i,a,o){var s=0,l=e.length,c=null==n;if("object"===x(n))for(s in i=!0,n)z(e,t,s,n[s],!0,a,o);else if(void 0!==r&&(i=!0,f(r)||(o=!0),c&&(o?(t.call(e,r),t=null):(c=t,t=function(e,t,n){return c.call(_(e),n)})),t))for(;s<l;s++)t(e[s],n,o?r:r.call(e[s],s,t(e[s],n)));return i?e:c?t.call(e):l?t(e[0],n):a},U=/^-ms-/,j=/-([a-z])/g;function H(e,t){return t.toUpperCase()}function W(e){return e.replace(U,"ms-").replace(j,H)}var q=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function J(){this.expando=_.expando+J.uid++}J.uid=1,J.prototype={cache:function(e){var t=e[this.expando];return t||(t={},q(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[W(t)]=n;else for(r in t)i[W(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][W(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(W):(t=W(t))in r?[t]:t.match(I)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||_.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!_.isEmptyObject(t)}};var X=new J,Y=new J,$=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function K(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(Z,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:$.test(e)?JSON.parse(e):e)}(n)}catch(e){}Y.set(e,t,n)}else n=void 0;return n}_.extend({hasData:function(e){return Y.hasData(e)||X.hasData(e)},data:function(e,t,n){return Y.access(e,t,n)},removeData:function(e,t){Y.remove(e,t)},_data:function(e,t,n){return X.access(e,t,n)},_removeData:function(e,t){X.remove(e,t)}}),_.fn.extend({data:function(e,t){var n,r,i,a=this[0],o=a&&a.attributes;if(void 0===e){if(this.length&&(i=Y.get(a),1===a.nodeType&&!X.get(a,"hasDataAttrs"))){for(n=o.length;n--;)o[n]&&0===(r=o[n].name).indexOf("data-")&&(r=W(r.slice(5)),K(a,r,i[r]));X.set(a,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){Y.set(this,e)}):z(this,function(t){var n;if(a&&void 0===t)return void 0!==(n=Y.get(a,e))?n:void 0!==(n=K(a,e))?n:void 0;this.each(function(){Y.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){Y.remove(this,e)})}}),_.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=X.get(e,t),n&&(!r||Array.isArray(n)?r=X.access(e,t,_.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=_.queue(e,t),r=n.length,i=n.shift(),a=_._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete a.stop,i.call(e,function(){_.dequeue(e,t)},a)),!r&&a&&a.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return X.get(e,n)||X.access(e,n,{empty:_.Callbacks("once memory").add(function(){X.remove(e,[t+"queue",n])})})}}),_.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?_.queue(this[0],e):void 0===t?this:this.each(function(){var n=_.queue(this,e,t);_._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&_.dequeue(this,e)})},dequeue:function(e){return this.each(function(){_.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=_.Deferred(),a=this,o=this.length,s=function(){--r||i.resolveWith(a,[a])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";o--;)(n=X.get(a[o],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ee=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),te=["Top","Right","Bottom","Left"],ne=g.documentElement,re=function(e){return _.contains(e.ownerDocument,e)},ie={composed:!0};ne.getRootNode&&(re=function(e){return _.contains(e.ownerDocument,e)||e.getRootNode(ie)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&re(e)&&"none"===_.css(e,"display")};function oe(e,t,n,r){var i,a,o=20,s=r?function(){return r.cur()}:function(){return _.css(e,t,"")},l=s(),c=n&&n[3]||(_.cssNumber[t]?"":"px"),u=e.nodeType&&(_.cssNumber[t]||"px"!==c&&+l)&&ee.exec(_.css(e,t));if(u&&u[3]!==c){for(l/=2,c=c||u[3],u=+l||1;o--;)_.style(e,t,u+c),(1-a)*(1-(a=s()/l||.5))<=0&&(o=0),u/=a;u*=2,_.style(e,t,u+c),n=n||[]}return n&&(u=+u||+l||0,i=n[1]?u+(n[1]+1)*n[2]:+n[2],r&&(r.unit=c,r.start=u,r.end=i)),i}var se={};function le(e){var t,n=e.ownerDocument,r=e.nodeName,i=se[r];return i||(t=n.body.appendChild(n.createElement(r)),i=_.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),se[r]=i,i)}function ce(e,t){for(var n,r,i=[],a=0,o=e.length;a<o;a++)(r=e[a]).style&&(n=r.style.display,t?("none"===n&&(i[a]=X.get(r,"display")||null,i[a]||(r.style.display="")),""===r.style.display&&ae(r)&&(i[a]=le(r))):"none"!==n&&(i[a]="none",X.set(r,"display",n)));for(a=0;a<o;a++)null!=i[a]&&(e[a].style.display=i[a]);return e}_.fn.extend({show:function(){return ce(this,!0)},hide:function(){return ce(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?_(this).show():_(this).hide()})}});var ue,he,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,fe=/^$|^module$|\/(?:java|ecma)script/i;ue=g.createDocumentFragment().appendChild(g.createElement("div")),(he=g.createElement("input")).setAttribute("type","radio"),he.setAttribute("checked","checked"),he.setAttribute("name","t"),ue.appendChild(he),d.checkClone=ue.cloneNode(!0).cloneNode(!0).lastChild.checked,ue.innerHTML="<textarea>x</textarea>",d.noCloneChecked=!!ue.cloneNode(!0).lastChild.defaultValue,ue.innerHTML="<option></option>",d.option=!!ue.lastChild;var me={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ge(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&E(e,t)?_.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n<r;n++)X.set(e[n],"globalEval",!t||X.get(t[n],"globalEval"))}me.tbody=me.tfoot=me.colgroup=me.caption=me.thead,me.th=me.td,d.option||(me.optgroup=me.option=[1,"<select multiple='multiple'>","</select>"]);var ye=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var a,o,s,l,c,u,h=t.createDocumentFragment(),p=[],d=0,f=e.length;d<f;d++)if((a=e[d])||0===a)if("object"===x(a))_.merge(p,a.nodeType?[a]:a);else if(ye.test(a)){for(o=o||h.appendChild(t.createElement("div")),s=(de.exec(a)||["",""])[1].toLowerCase(),l=me[s]||me._default,o.innerHTML=l[1]+_.htmlPrefilter(a)+l[2],u=l[0];u--;)o=o.lastChild;_.merge(p,o.childNodes),(o=h.firstChild).textContent=""}else p.push(t.createTextNode(a));for(h.textContent="",d=0;a=p[d++];)if(r&&_.inArray(a,r)>-1)i&&i.push(a);else if(c=re(a),o=ge(h.appendChild(a),"script"),c&&ve(o),n)for(u=0;a=o[u++];)fe.test(a.type||"")&&n.push(a);return h}var _e=/^([^.]*)(?:\.(.+)|)/;function be(){return!0}function we(){return!1}function Me(e,t){return e===function(){try{return g.activeElement}catch(e){}}()==("focus"===t)}function Se(e,t,n,r,i,a){var o,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Se(e,s,n,r,t[s],a);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=we;else if(!i)return e;return 1===a&&(o=i,(i=function(e){return _().off(e),o.apply(this,arguments)}).guid=o.guid||(o.guid=_.guid++)),e.each(function(){_.event.add(this,t,i,r,n)})}function Te(e,t,n){n?(X.set(e,t,!1),_.event.add(e,t,{namespace:!1,handler:function(e){var r,a,o=X.get(this,t);if(1&e.isTrigger&&this[t]){if(o.length)(_.event.special[t]||{}).delegateType&&e.stopPropagation();else if(o=i.call(arguments),X.set(this,t,o),r=n(this,t),this[t](),o!==(a=X.get(this,t))||r?X.set(this,t,!1):a={},o!==a)return e.stopImmediatePropagation(),e.preventDefault(),a&&a.value}else o.length&&(X.set(this,t,{value:_.event.trigger(_.extend(o[0],_.Event.prototype),o.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===X.get(e,t)&&_.event.add(e,t,be)}_.event={global:{},add:function(e,t,n,r,i){var a,o,s,l,c,u,h,p,d,f,m,g=X.get(e);if(q(e))for(n.handler&&(n=(a=n).handler,i=a.selector),i&&_.find.matchesSelector(ne,i),n.guid||(n.guid=_.guid++),(l=g.events)||(l=g.events=Object.create(null)),(o=g.handle)||(o=g.handle=function(t){return void 0!==_&&_.event.triggered!==t.type?_.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(I)||[""]).length;c--;)d=m=(s=_e.exec(t[c])||[])[1],f=(s[2]||"").split(".").sort(),d&&(h=_.event.special[d]||{},d=(i?h.delegateType:h.bindType)||d,h=_.event.special[d]||{},u=_.extend({type:d,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&_.expr.match.needsContext.test(i),namespace:f.join(".")},a),(p=l[d])||((p=l[d]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(e,r,f,o)||e.addEventListener&&e.addEventListener(d,o)),h.add&&(h.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,u):p.push(u),_.event.global[d]=!0)},remove:function(e,t,n,r,i){var a,o,s,l,c,u,h,p,d,f,m,g=X.hasData(e)&&X.get(e);if(g&&(l=g.events)){for(c=(t=(t||"").match(I)||[""]).length;c--;)if(d=m=(s=_e.exec(t[c])||[])[1],f=(s[2]||"").split(".").sort(),d){for(h=_.event.special[d]||{},p=l[d=(r?h.delegateType:h.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=a=p.length;a--;)u=p[a],!i&&m!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(p.splice(a,1),u.selector&&p.delegateCount--,h.remove&&h.remove.call(e,u));o&&!p.length&&(h.teardown&&!1!==h.teardown.call(e,f,g.handle)||_.removeEvent(e,d,g.handle),delete l[d])}else for(d in l)_.event.remove(e,d+t[c],n,r,!0);_.isEmptyObject(l)&&X.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,a,o,s=new Array(arguments.length),l=_.event.fix(e),c=(X.get(this,"events")||Object.create(null))[l.type]||[],u=_.event.special[l.type]||{};for(s[0]=l,t=1;t<arguments.length;t++)s[t]=arguments[t];if(l.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,l)){for(o=_.event.handlers.call(this,l,c),t=0;(i=o[t++])&&!l.isPropagationStopped();)for(l.currentTarget=i.elem,n=0;(a=i.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==a.namespace&&!l.rnamespace.test(a.namespace)||(l.handleObj=a,l.data=a.data,void 0!==(r=((_.event.special[a.origType]||{}).handle||a.handler).apply(i.elem,s))&&!1===(l.result=r)&&(l.preventDefault(),l.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,l),l.result}},handlers:function(e,t){var n,r,i,a,o,s=[],l=t.delegateCount,c=e.target;if(l&&c.nodeType&&!("click"===e.type&&e.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(a=[],o={},n=0;n<l;n++)void 0===o[i=(r=t[n]).selector+" "]&&(o[i]=r.needsContext?_(i,this).index(c)>-1:_.find(i,this,null,[c]).length),o[i]&&a.push(r);a.length&&s.push({elem:c,handlers:a})}return c=this,l<t.length&&s.push({elem:c,handlers:t.slice(l)}),s},addProp:function(e,t){Object.defineProperty(_.Event.prototype,e,{enumerable:!0,configurable:!0,get:f(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[_.expando]?e:new _.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&E(t,"input")&&Te(t,"click",be),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&E(t,"input")&&Te(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&E(t,"input")&&X.get(t,"click")||E(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},_.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},_.Event=function(e,t){if(!(this instanceof _.Event))return new _.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?be:we,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&_.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[_.expando]=!0},_.Event.prototype={constructor:_.Event,isDefaultPrevented:we,isPropagationStopped:we,isImmediatePropagationStopped:we,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=be,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=be,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=be,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},_.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},_.event.addProp),_.each({focus:"focusin",blur:"focusout"},function(e,t){_.event.special[e]={setup:function(){return Te(this,e,Me),!1},trigger:function(){return Te(this,e),!0},_default:function(){return!0},delegateType:t}}),_.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){_.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,i=e.handleObj;return r&&(r===this||_.contains(this,r))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}}),_.fn.extend({on:function(e,t,n,r){return Se(this,e,t,n,r)},one:function(e,t,n,r){return Se(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,_(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=we),this.each(function(){_.event.remove(this,e,n,t)})}});var Ee=/<script|<style|<link/i,Ce=/checked\s*(?:[^=]|=\s*.checked.)/i,Ae=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Le(e,t){return E(e,"table")&&E(11!==t.nodeType?t:t.firstChild,"tr")&&_(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Pe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,a,o,s;if(1===t.nodeType){if(X.hasData(e)&&(s=X.get(e).events))for(i in X.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)_.event.add(t,i,s[i][n]);Y.hasData(e)&&(a=Y.access(e),o=_.extend({},a),Y.set(t,o))}}function Re(e,t,n,r){t=a(t);var i,o,s,l,c,u,h=0,p=e.length,m=p-1,g=t[0],v=f(g);if(v||p>1&&"string"==typeof g&&!d.checkClone&&Ce.test(g))return e.each(function(i){var a=e.eq(i);v&&(t[0]=g.call(this,i,a.html())),Re(a,t,n,r)});if(p&&(o=(i=xe(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(l=(s=_.map(ge(i,"script"),De)).length;h<p;h++)c=i,h!==m&&(c=_.clone(c,!0,!0),l&&_.merge(s,ge(c,"script"))),n.call(e[h],c,h);if(l)for(u=s[s.length-1].ownerDocument,_.map(s,Pe),h=0;h<l;h++)c=s[h],fe.test(c.type||"")&&!X.access(c,"globalEval")&&_.contains(u,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?_._evalUrl&&!c.noModule&&_._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},u):y(c.textContent.replace(Ae,""),c,u))}return e}function Ie(e,t,n){for(var r,i=t?_.filter(t,e):e,a=0;null!=(r=i[a]);a++)n||1!==r.nodeType||_.cleanData(ge(r)),r.parentNode&&(n&&re(r)&&ve(ge(r,"script")),r.parentNode.removeChild(r));return e}_.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,a,o,s,l,c,u=e.cloneNode(!0),h=re(e);if(!(d.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||_.isXMLDoc(e)))for(o=ge(u),r=0,i=(a=ge(e)).length;r<i;r++)s=a[r],l=o[r],void 0,"input"===(c=l.nodeName.toLowerCase())&&pe.test(s.type)?l.checked=s.checked:"input"!==c&&"textarea"!==c||(l.defaultValue=s.defaultValue);if(t)if(n)for(a=a||ge(e),o=o||ge(u),r=0,i=a.length;r<i;r++)Oe(a[r],o[r]);else Oe(e,u);return(o=ge(u,"script")).length>0&&ve(o,!h&&ge(e,"script")),u},cleanData:function(e){for(var t,n,r,i=_.event.special,a=0;void 0!==(n=e[a]);a++)if(q(n)){if(t=n[X.expando]){if(t.events)for(r in t.events)i[r]?_.event.remove(n,r):_.removeEvent(n,r,t.handle);n[X.expando]=void 0}n[Y.expando]&&(n[Y.expando]=void 0)}}}),_.fn.extend({detach:function(e){return Ie(this,e,!0)},remove:function(e){return Ie(this,e)},text:function(e){return z(this,function(e){return void 0===e?_.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Le(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Le(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(_.cleanData(ge(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return _.clone(this,e,t)})},html:function(e){return z(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ee.test(e)&&!me[(de.exec(e)||["",""])[1].toLowerCase()]){e=_.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(_.cleanData(ge(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Re(this,arguments,function(t){var n=this.parentNode;_.inArray(this,e)<0&&(_.cleanData(ge(this)),n&&n.replaceChild(t,this))},e)}}),_.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){_.fn[e]=function(e){for(var n,r=[],i=_(e),a=i.length-1,s=0;s<=a;s++)n=s===a?this:this.clone(!0),_(i[s])[t](n),o.apply(r,n.get());return this.pushStack(r)}});var Be=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),Ne=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},ke=function(e,t,n){var r,i,a={};for(i in t)a[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=a[i];return r},Fe=new RegExp(te.join("|"),"i");function Ge(e,t,n){var r,i,a,o,s=e.style;return(n=n||Ne(e))&&(""!==(o=n.getPropertyValue(t)||n[t])||re(e)||(o=_.style(e,t)),!d.pixelBoxStyles()&&Be.test(o)&&Fe.test(t)&&(r=s.width,i=s.minWidth,a=s.maxWidth,s.minWidth=s.maxWidth=s.width=o,o=n.width,s.width=r,s.minWidth=i,s.maxWidth=a)),void 0!==o?o+"":o}function Ve(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(u){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ne.appendChild(c).appendChild(u);var t=e.getComputedStyle(u);r="1%"!==t.top,l=12===n(t.marginLeft),u.style.right="60%",o=36===n(t.right),i=36===n(t.width),u.style.position="absolute",a=12===n(u.offsetWidth/3),ne.removeChild(c),u=null}}function n(e){return Math.round(parseFloat(e))}var r,i,a,o,s,l,c=g.createElement("div"),u=g.createElement("div");u.style&&(u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",d.clearCloneStyle="content-box"===u.style.backgroundClip,_.extend(d,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),o},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),a},reliableTrDimensions:function(){var t,n,r,i;return null==s&&(t=g.createElement("table"),n=g.createElement("tr"),r=g.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",r.style.height="9px",r.style.display="block",ne.appendChild(t).appendChild(n).appendChild(r),i=e.getComputedStyle(n),s=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===n.offsetHeight,ne.removeChild(t)),s}}))}();var ze=["Webkit","Moz","ms"],Ue=g.createElement("div").style,je={};function He(e){var t=_.cssProps[e]||je[e];return t||(e in Ue?e:je[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=ze.length;n--;)if((e=ze[n]+t)in Ue)return e}(e)||e)}var We=/^(none|table(?!-c[ea]).+)/,qe=/^--/,Je={position:"absolute",visibility:"hidden",display:"block"},Xe={letterSpacing:"0",fontWeight:"400"};function Ye(e,t,n){var r=ee.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function $e(e,t,n,r,i,a){var o="width"===t?1:0,s=0,l=0;if(n===(r?"border":"content"))return 0;for(;o<4;o+=2)"margin"===n&&(l+=_.css(e,n+te[o],!0,i)),r?("content"===n&&(l-=_.css(e,"padding"+te[o],!0,i)),"margin"!==n&&(l-=_.css(e,"border"+te[o]+"Width",!0,i))):(l+=_.css(e,"padding"+te[o],!0,i),"padding"!==n?l+=_.css(e,"border"+te[o]+"Width",!0,i):s+=_.css(e,"border"+te[o]+"Width",!0,i));return!r&&a>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-a-l-s-.5))||0),l}function Ze(e,t,n){var r=Ne(e),i=(!d.boxSizingReliable()||n)&&"border-box"===_.css(e,"boxSizing",!1,r),a=i,o=Ge(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Be.test(o)){if(!n)return o;o="auto"}return(!d.boxSizingReliable()&&i||!d.reliableTrDimensions()&&E(e,"tr")||"auto"===o||!parseFloat(o)&&"inline"===_.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===_.css(e,"boxSizing",!1,r),(a=s in e)&&(o=e[s])),(o=parseFloat(o)||0)+$e(e,t,n||(i?"border":"content"),a,r,o)+"px"}function Ke(e,t,n,r,i){return new Ke.prototype.init(e,t,n,r,i)}_.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ge(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,a,o,s=W(t),l=qe.test(t),c=e.style;if(l||(t=He(s)),o=_.cssHooks[t]||_.cssHooks[s],void 0===n)return o&&"get"in o&&void 0!==(i=o.get(e,!1,r))?i:c[t];"string"===(a=typeof n)&&(i=ee.exec(n))&&i[1]&&(n=oe(e,t,i),a="number"),null!=n&&n==n&&("number"!==a||l||(n+=i&&i[3]||(_.cssNumber[s]?"":"px")),d.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),o&&"set"in o&&void 0===(n=o.set(e,n,r))||(l?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,r){var i,a,o,s=W(t);return qe.test(t)||(t=He(s)),(o=_.cssHooks[t]||_.cssHooks[s])&&"get"in o&&(i=o.get(e,!0,n)),void 0===i&&(i=Ge(e,t,r)),"normal"===i&&t in Xe&&(i=Xe[t]),""===n||n?(a=parseFloat(i),!0===n||isFinite(a)?a||0:i):i}}),_.each(["height","width"],function(e,t){_.cssHooks[t]={get:function(e,n,r){if(n)return!We.test(_.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Ze(e,t,r):ke(e,Je,function(){return Ze(e,t,r)})},set:function(e,n,r){var i,a=Ne(e),o=!d.scrollboxSize()&&"absolute"===a.position,s=(o||r)&&"border-box"===_.css(e,"boxSizing",!1,a),l=r?$e(e,t,r,s,a):0;return s&&o&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(a[t])-$e(e,t,"border",!1,a)-.5)),l&&(i=ee.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=_.css(e,t)),Ye(0,n,l)}}}),_.cssHooks.marginLeft=Ve(d.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Ge(e,"marginLeft"))||e.getBoundingClientRect().left-ke(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),_.each({margin:"",padding:"",border:"Width"},function(e,t){_.cssHooks[e+t]={expand:function(n){for(var r=0,i={},a="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+te[r]+t]=a[r]||a[r-2]||a[0];return i}},"margin"!==e&&(_.cssHooks[e+t].set=Ye)}),_.fn.extend({css:function(e,t){return z(this,function(e,t,n){var r,i,a={},o=0;if(Array.isArray(t)){for(r=Ne(e),i=t.length;o<i;o++)a[t[o]]=_.css(e,t[o],!1,r);return a}return void 0!==n?_.style(e,t,n):_.css(e,t)},e,t,arguments.length>1)}}),_.Tween=Ke,Ke.prototype={constructor:Ke,init:function(e,t,n,r,i,a){this.elem=e,this.prop=n,this.easing=i||_.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=a||(_.cssNumber[n]?"":"px")},cur:function(){var e=Ke.propHooks[this.prop];return e&&e.get?e.get(this):Ke.propHooks._default.get(this)},run:function(e){var t,n=Ke.propHooks[this.prop];return this.options.duration?this.pos=t=_.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Ke.propHooks._default.set(this),this}},Ke.prototype.init.prototype=Ke.prototype,Ke.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=_.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){_.fx.step[e.prop]?_.fx.step[e.prop](e):1!==e.elem.nodeType||!_.cssHooks[e.prop]&&null==e.elem.style[He(e.prop)]?e.elem[e.prop]=e.now:_.style(e.elem,e.prop,e.now+e.unit)}}},Ke.propHooks.scrollTop=Ke.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},_.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},_.fx=Ke.prototype.init,_.fx.step={};var Qe,et,tt=/^(?:toggle|show|hide)$/,nt=/queueHooks$/;function rt(){et&&(!1===g.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(rt):e.setTimeout(rt,_.fx.interval),_.fx.tick())}function it(){return e.setTimeout(function(){Qe=void 0}),Qe=Date.now()}function at(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=te[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ot(e,t,n){for(var r,i=(st.tweeners[t]||[]).concat(st.tweeners["*"]),a=0,o=i.length;a<o;a++)if(r=i[a].call(n,t,e))return r}function st(e,t,n){var r,i,a=0,o=st.prefilters.length,s=_.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;for(var t=Qe||it(),n=Math.max(0,c.startTime+c.duration-t),r=1-(n/c.duration||0),a=0,o=c.tweens.length;a<o;a++)c.tweens[a].run(r);return s.notifyWith(e,[c,r,n]),r<1&&o?n:(o||s.notifyWith(e,[c,1,0]),s.resolveWith(e,[c]),!1)},c=s.promise({elem:e,props:_.extend({},t),opts:_.extend(!0,{specialEasing:{},easing:_.easing._default},n),originalProperties:t,originalOptions:n,startTime:Qe||it(),duration:n.duration,tweens:[],createTween:function(t,n){var r=_.Tween(e,c.opts,t,n,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(r),r},stop:function(t){var n=0,r=t?c.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)c.tweens[n].run(1);return t?(s.notifyWith(e,[c,1,0]),s.resolveWith(e,[c,t])):s.rejectWith(e,[c,t]),this}}),u=c.props;for(!function(e,t){var n,r,i,a,o;for(n in e)if(i=t[r=W(n)],a=e[n],Array.isArray(a)&&(i=a[1],a=e[n]=a[0]),n!==r&&(e[r]=a,delete e[n]),(o=_.cssHooks[r])&&"expand"in o)for(n in a=o.expand(a),delete e[r],a)n in e||(e[n]=a[n],t[n]=i);else t[r]=i}(u,c.opts.specialEasing);a<o;a++)if(r=st.prefilters[a].call(c,e,u,c.opts))return f(r.stop)&&(_._queueHooks(c.elem,c.opts.queue).stop=r.stop.bind(r)),r;return _.map(u,ot,c),f(c.opts.start)&&c.opts.start.call(e,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),_.fx.timer(_.extend(l,{elem:e,anim:c,queue:c.opts.queue})),c}_.Animation=_.extend(st,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return oe(n.elem,e,ee.exec(t),n),n}]},tweener:function(e,t){f(e)?(t=e,e=["*"]):e=e.match(I);for(var n,r=0,i=e.length;r<i;r++)n=e[r],st.tweeners[n]=st.tweeners[n]||[],st.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,a,o,s,l,c,u,h="width"in t||"height"in t,p=this,d={},f=e.style,m=e.nodeType&&ae(e),g=X.get(e,"fxshow");for(r in n.queue||(null==(o=_._queueHooks(e,"fx")).unqueued&&(o.unqueued=0,s=o.empty.fire,o.empty.fire=function(){o.unqueued||s()}),o.unqueued++,p.always(function(){p.always(function(){o.unqueued--,_.queue(e,"fx").length||o.empty.fire()})})),t)if(i=t[r],tt.test(i)){if(delete t[r],a=a||"toggle"===i,i===(m?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;m=!0}d[r]=g&&g[r]||_.style(e,r)}if((l=!_.isEmptyObject(t))||!_.isEmptyObject(d))for(r in h&&1===e.nodeType&&(n.overflow=[f.overflow,f.overflowX,f.overflowY],null==(c=g&&g.display)&&(c=X.get(e,"display")),"none"===(u=_.css(e,"display"))&&(c?u=c:(ce([e],!0),c=e.style.display||c,u=_.css(e,"display"),ce([e]))),("inline"===u||"inline-block"===u&&null!=c)&&"none"===_.css(e,"float")&&(l||(p.done(function(){f.display=c}),null==c&&(u=f.display,c="none"===u?"":u)),f.display="inline-block")),n.overflow&&(f.overflow="hidden",p.always(function(){f.overflow=n.overflow[0],f.overflowX=n.overflow[1],f.overflowY=n.overflow[2]})),l=!1,d)l||(g?"hidden"in g&&(m=g.hidden):g=X.access(e,"fxshow",{display:c}),a&&(g.hidden=!m),m&&ce([e],!0),p.done(function(){for(r in m||ce([e]),X.remove(e,"fxshow"),d)_.style(e,r,d[r])})),l=ot(m?g[r]:0,r,p),r in g||(g[r]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?st.prefilters.unshift(e):st.prefilters.push(e)}}),_.speed=function(e,t,n){var r=e&&"object"==typeof e?_.extend({},e):{complete:n||!n&&t||f(e)&&e,duration:e,easing:n&&t||t&&!f(t)&&t};return _.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in _.fx.speeds?r.duration=_.fx.speeds[r.duration]:r.duration=_.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){f(r.old)&&r.old.call(this),r.queue&&_.dequeue(this,r.queue)},r},_.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=_.isEmptyObject(e),a=_.speed(t,n,r),o=function(){var t=st(this,_.extend({},e),a);(i||X.get(this,"finish"))&&t.stop(!0)};return o.finish=o,i||!1===a.queue?this.each(o):this.queue(a.queue,o)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",a=_.timers,o=X.get(this);if(i)o[i]&&o[i].stop&&r(o[i]);else for(i in o)o[i]&&o[i].stop&&nt.test(i)&&r(o[i]);for(i=a.length;i--;)a[i].elem!==this||null!=e&&a[i].queue!==e||(a[i].anim.stop(n),t=!1,a.splice(i,1));!t&&n||_.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=X.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],a=_.timers,o=r?r.length:0;for(n.finish=!0,_.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=a.length;t--;)a[t].elem===this&&a[t].queue===e&&(a[t].anim.stop(!0),a.splice(t,1));for(t=0;t<o;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),_.each(["toggle","show","hide"],function(e,t){var n=_.fn[t];_.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(at(t,!0),e,r,i)}}),_.each({slideDown:at("show"),slideUp:at("hide"),slideToggle:at("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){_.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),_.timers=[],_.fx.tick=function(){var e,t=0,n=_.timers;for(Qe=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||_.fx.stop(),Qe=void 0},_.fx.timer=function(e){_.timers.push(e),_.fx.start()},_.fx.interval=13,_.fx.start=function(){et||(et=!0,rt())},_.fx.stop=function(){et=null},_.fx.speeds={slow:600,fast:200,_default:400},_.fn.delay=function(t,n){return t=_.fx&&_.fx.speeds[t]||t,n=n||"fx",this.queue(n,function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}})},function(){var e=g.createElement("input"),t=g.createElement("select").appendChild(g.createElement("option"));e.type="checkbox",d.checkOn=""!==e.value,d.optSelected=t.selected,(e=g.createElement("input")).value="t",e.type="radio",d.radioValue="t"===e.value}();var lt,ct=_.expr.attrHandle;_.fn.extend({attr:function(e,t){return z(this,_.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){_.removeAttr(this,e)})}}),_.extend({attr:function(e,t,n){var r,i,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return void 0===e.getAttribute?_.prop(e,t,n):(1===a&&_.isXMLDoc(e)||(i=_.attrHooks[t.toLowerCase()]||(_.expr.match.bool.test(t)?lt:void 0)),void 0!==n?null===n?void _.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=_.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!d.radioValue&&"radio"===t&&E(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(I);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),lt={set:function(e,t,n){return!1===t?_.removeAttr(e,n):e.setAttribute(n,n),n}},_.each(_.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ct[t]||_.find.attr;ct[t]=function(e,t,r){var i,a,o=t.toLowerCase();return r||(a=ct[o],ct[o]=i,i=null!=n(e,t,r)?o:null,ct[o]=a),i}});var ut=/^(?:input|select|textarea|button)$/i,ht=/^(?:a|area)$/i;function pt(e){return(e.match(I)||[]).join(" ")}function dt(e){return e.getAttribute&&e.getAttribute("class")||""}function ft(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(I)||[]}_.fn.extend({prop:function(e,t){return z(this,_.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[_.propFix[e]||e]})}}),_.extend({prop:function(e,t,n){var r,i,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return 1===a&&_.isXMLDoc(e)||(t=_.propFix[t]||t,i=_.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=_.find.attr(e,"tabindex");return t?parseInt(t,10):ut.test(e.nodeName)||ht.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),d.optSelected||(_.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),_.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){_.propFix[this.toLowerCase()]=this}),_.fn.extend({addClass:function(e){var t,n,r,i,a,o,s,l=0;if(f(e))return this.each(function(t){_(this).addClass(e.call(this,t,dt(this)))});if((t=ft(e)).length)for(;n=this[l++];)if(i=dt(n),r=1===n.nodeType&&" "+pt(i)+" "){for(o=0;a=t[o++];)r.indexOf(" "+a+" ")<0&&(r+=a+" ");i!==(s=pt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,a,o,s,l=0;if(f(e))return this.each(function(t){_(this).removeClass(e.call(this,t,dt(this)))});if(!arguments.length)return this.attr("class","");if((t=ft(e)).length)for(;n=this[l++];)if(i=dt(n),r=1===n.nodeType&&" "+pt(i)+" "){for(o=0;a=t[o++];)for(;r.indexOf(" "+a+" ")>-1;)r=r.replace(" "+a+" "," ");i!==(s=pt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):f(e)?this.each(function(n){_(this).toggleClass(e.call(this,n,dt(this),t),t)}):this.each(function(){var t,i,a,o;if(r)for(i=0,a=_(this),o=ft(e);t=o[i++];)a.hasClass(t)?a.removeClass(t):a.addClass(t);else void 0!==e&&"boolean"!==n||((t=dt(this))&&X.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":X.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+pt(dt(n))+" ").indexOf(t)>-1)return!0;return!1}});var mt=/\r/g;_.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=f(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,_(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=_.map(i,function(e){return null==e?"":e+""})),(t=_.valHooks[this.type]||_.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=_.valHooks[i.type]||_.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(mt,""):null==n?"":n:void 0}}),_.extend({valHooks:{option:{get:function(e){var t=_.find.attr(e,"value");return null!=t?t:pt(_.text(e))}},select:{get:function(e){var t,n,r,i=e.options,a=e.selectedIndex,o="select-one"===e.type,s=o?null:[],l=o?a+1:i.length;for(r=a<0?l:o?a:0;r<l;r++)if(((n=i[r]).selected||r===a)&&!n.disabled&&(!n.parentNode.disabled||!E(n.parentNode,"optgroup"))){if(t=_(n).val(),o)return t;s.push(t)}return s},set:function(e,t){for(var n,r,i=e.options,a=_.makeArray(t),o=i.length;o--;)((r=i[o]).selected=_.inArray(_.valHooks.option.get(r),a)>-1)&&(n=!0);return n||(e.selectedIndex=-1),a}}}}),_.each(["radio","checkbox"],function(){_.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=_.inArray(_(e).val(),t)>-1}},d.checkOn||(_.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),d.focusin="onfocusin"in e;var gt=/^(?:focusinfocus|focusoutblur)$/,vt=function(e){e.stopPropagation()};_.extend(_.event,{trigger:function(t,n,r,i){var a,o,s,l,c,h,p,d,v=[r||g],y=u.call(t,"type")?t.type:t,x=u.call(t,"namespace")?t.namespace.split("."):[];if(o=d=s=r=r||g,3!==r.nodeType&&8!==r.nodeType&&!gt.test(y+_.event.triggered)&&(y.indexOf(".")>-1&&(y=(x=y.split(".")).shift(),x.sort()),c=y.indexOf(":")<0&&"on"+y,(t=t[_.expando]?t:new _.Event(y,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:_.makeArray(n,[t]),p=_.event.special[y]||{},i||!p.trigger||!1!==p.trigger.apply(r,n))){if(!i&&!p.noBubble&&!m(r)){for(l=p.delegateType||y,gt.test(l+y)||(o=o.parentNode);o;o=o.parentNode)v.push(o),s=o;s===(r.ownerDocument||g)&&v.push(s.defaultView||s.parentWindow||e)}for(a=0;(o=v[a++])&&!t.isPropagationStopped();)d=o,t.type=a>1?l:p.bindType||y,(h=(X.get(o,"events")||Object.create(null))[t.type]&&X.get(o,"handle"))&&h.apply(o,n),(h=c&&o[c])&&h.apply&&q(o)&&(t.result=h.apply(o,n),!1===t.result&&t.preventDefault());return t.type=y,i||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(v.pop(),n)||!q(r)||c&&f(r[y])&&!m(r)&&((s=r[c])&&(r[c]=null),_.event.triggered=y,t.isPropagationStopped()&&d.addEventListener(y,vt),r[y](),t.isPropagationStopped()&&d.removeEventListener(y,vt),_.event.triggered=void 0,s&&(r[c]=s)),t.result}},simulate:function(e,t,n){var r=_.extend(new _.Event,n,{type:e,isSimulated:!0});_.event.trigger(r,null,t)}}),_.fn.extend({trigger:function(e,t){return this.each(function(){_.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return _.event.trigger(e,t,n,!0)}}),d.focusin||_.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){_.event.simulate(t,e.target,_.event.fix(e))};_.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=X.access(r,t);i||r.addEventListener(e,n,!0),X.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=X.access(r,t)-1;i?X.access(r,t,i):(r.removeEventListener(e,n,!0),X.remove(r,t))}}});var yt=e.location,xt={guid:Date.now()},_t=/\?/;_.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){}return r=n&&n.getElementsByTagName("parsererror")[0],n&&!r||_.error("Invalid XML: "+(r?_.map(r.childNodes,function(e){return e.textContent}).join("\n"):t)),n};var bt=/\[\]$/,wt=/\r?\n/g,Mt=/^(?:submit|button|image|reset|file)$/i,St=/^(?:input|select|textarea|keygen)/i;function Tt(e,t,n,r){var i;if(Array.isArray(t))_.each(t,function(t,i){n||bt.test(e)?r(e,i):Tt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==x(t))r(e,t);else for(i in t)Tt(e+"["+i+"]",t[i],n,r)}_.param=function(e,t){var n,r=[],i=function(e,t){var n=f(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!_.isPlainObject(e))_.each(e,function(){i(this.name,this.value)});else for(n in e)Tt(n,e[n],t,i);return r.join("&")},_.fn.extend({serialize:function(){return _.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=_.prop(this,"elements");return e?_.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!_(this).is(":disabled")&&St.test(this.nodeName)&&!Mt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=_(this).val();return null==n?null:Array.isArray(n)?_.map(n,function(e){return{name:t.name,value:e.replace(wt,"\r\n")}}):{name:t.name,value:n.replace(wt,"\r\n")}}).get()}});var Et=/%20/g,Ct=/#.*$/,At=/([?&])_=[^&]*/,Lt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Dt=/^(?:GET|HEAD)$/,Pt=/^\/\//,Ot={},Rt={},It="*/".concat("*"),Bt=g.createElement("a");function Nt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,a=t.toLowerCase().match(I)||[];if(f(n))for(;r=a[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function kt(e,t,n,r){var i={},a=e===Rt;function o(s){var l;return i[s]=!0,_.each(e[s]||[],function(e,s){var c=s(t,n,r);return"string"!=typeof c||a||i[c]?a?!(l=c):void 0:(t.dataTypes.unshift(c),o(c),!1)}),l}return o(t.dataTypes[0])||!i["*"]&&o("*")}function Ft(e,t){var n,r,i=_.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&_.extend(!0,e,r),e}Bt.href=yt.href,_.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(yt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":It,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":_.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ft(Ft(e,_.ajaxSettings),t):Ft(_.ajaxSettings,e)},ajaxPrefilter:Nt(Ot),ajaxTransport:Nt(Rt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var r,i,a,o,s,l,c,u,h,p,d=_.ajaxSetup({},n),f=d.context||d,m=d.context&&(f.nodeType||f.jquery)?_(f):_.event,v=_.Deferred(),y=_.Callbacks("once memory"),x=d.statusCode||{},b={},w={},M="canceled",S={readyState:0,getResponseHeader:function(e){var t;if(c){if(!o)for(o={};t=Lt.exec(a);)o[t[1].toLowerCase()+" "]=(o[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=o[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)S.always(e[S.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||M;return r&&r.abort(t),T(0,t),this}};if(v.promise(S),d.url=((t||d.url||yt.href)+"").replace(Pt,yt.protocol+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=(d.dataType||"*").toLowerCase().match(I)||[""],null==d.crossDomain){l=g.createElement("a");try{l.href=d.url,l.href=l.href,d.crossDomain=Bt.protocol+"//"+Bt.host!=l.protocol+"//"+l.host}catch(e){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=_.param(d.data,d.traditional)),kt(Ot,d,n,S),c)return S;for(h in(u=_.event&&d.global)&&0==_.active++&&_.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Dt.test(d.type),i=d.url.replace(Ct,""),d.hasContent?d.data&&d.processData&&0===(d.contentType||"").indexOf("application/x-www-form-urlencoded")&&(d.data=d.data.replace(Et,"+")):(p=d.url.slice(i.length),d.data&&(d.processData||"string"==typeof d.data)&&(i+=(_t.test(i)?"&":"?")+d.data,delete d.data),!1===d.cache&&(i=i.replace(At,"$1"),p=(_t.test(i)?"&":"?")+"_="+xt.guid+++p),d.url=i+p),d.ifModified&&(_.lastModified[i]&&S.setRequestHeader("If-Modified-Since",_.lastModified[i]),_.etag[i]&&S.setRequestHeader("If-None-Match",_.etag[i])),(d.data&&d.hasContent&&!1!==d.contentType||n.contentType)&&S.setRequestHeader("Content-Type",d.contentType),S.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+It+"; q=0.01":""):d.accepts["*"]),d.headers)S.setRequestHeader(h,d.headers[h]);if(d.beforeSend&&(!1===d.beforeSend.call(f,S,d)||c))return S.abort();if(M="abort",y.add(d.complete),S.done(d.success),S.fail(d.error),r=kt(Rt,d,n,S)){if(S.readyState=1,u&&m.trigger("ajaxSend",[S,d]),c)return S;d.async&&d.timeout>0&&(s=e.setTimeout(function(){S.abort("timeout")},d.timeout));try{c=!1,r.send(b,T)}catch(e){if(c)throw e;T(-1,e)}}else T(-1,"No Transport");function T(t,n,o,l){var h,p,g,b,w,M=n;c||(c=!0,s&&e.clearTimeout(s),r=void 0,a=l||"",S.readyState=t>0?4:0,h=t>=200&&t<300||304===t,o&&(b=function(e,t,n){for(var r,i,a,o,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){l.unshift(i);break}if(l[0]in n)a=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){a=i;break}o||(o=i)}a=a||o}if(a)return a!==l[0]&&l.unshift(a),n[a]}(d,S,o)),!h&&_.inArray("script",d.dataTypes)>-1&&_.inArray("json",d.dataTypes)<0&&(d.converters["text script"]=function(){}),b=function(e,t,n,r){var i,a,o,s,l,c={},u=e.dataTypes.slice();if(u[1])for(o in e.converters)c[o.toLowerCase()]=e.converters[o];for(a=u.shift();a;)if(e.responseFields[a]&&(n[e.responseFields[a]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=a,a=u.shift())if("*"===a)a=l;else if("*"!==l&&l!==a){if(!(o=c[l+" "+a]||c["* "+a]))for(i in c)if((s=i.split(" "))[1]===a&&(o=c[l+" "+s[0]]||c["* "+s[0]])){!0===o?o=c[i]:!0!==c[i]&&(a=s[0],u.unshift(s[1]));break}if(!0!==o)if(o&&e.throws)t=o(t);else try{t=o(t)}catch(e){return{state:"parsererror",error:o?e:"No conversion from "+l+" to "+a}}}return{state:"success",data:t}}(d,b,S,h),h?(d.ifModified&&((w=S.getResponseHeader("Last-Modified"))&&(_.lastModified[i]=w),(w=S.getResponseHeader("etag"))&&(_.etag[i]=w)),204===t||"HEAD"===d.type?M="nocontent":304===t?M="notmodified":(M=b.state,p=b.data,h=!(g=b.error))):(g=M,!t&&M||(M="error",t<0&&(t=0))),S.status=t,S.statusText=(n||M)+"",h?v.resolveWith(f,[p,M,S]):v.rejectWith(f,[S,M,g]),S.statusCode(x),x=void 0,u&&m.trigger(h?"ajaxSuccess":"ajaxError",[S,d,h?p:g]),y.fireWith(f,[S,M]),u&&(m.trigger("ajaxComplete",[S,d]),--_.active||_.event.trigger("ajaxStop")))}return S},getJSON:function(e,t,n){return _.get(e,t,n,"json")},getScript:function(e,t){return _.get(e,void 0,t,"script")}}),_.each(["get","post"],function(e,t){_[t]=function(e,n,r,i){return f(n)&&(i=i||r,r=n,n=void 0),_.ajax(_.extend({url:e,type:t,dataType:i,data:n,success:r},_.isPlainObject(e)&&e))}}),_.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),_._evalUrl=function(e,t,n){return _.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){_.globalEval(e,t,n)}})},_.fn.extend({wrapAll:function(e){var t;return this[0]&&(f(e)&&(e=e.call(this[0])),t=_(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return f(e)?this.each(function(t){_(this).wrapInner(e.call(this,t))}):this.each(function(){var t=_(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=f(e);return this.each(function(n){_(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){_(this).replaceWith(this.childNodes)}),this}}),_.expr.pseudos.hidden=function(e){return!_.expr.pseudos.visible(e)},_.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},_.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Gt={0:200,1223:204},Vt=_.ajaxSettings.xhr();d.cors=!!Vt&&"withCredentials"in Vt,d.ajax=Vt=!!Vt,_.ajaxTransport(function(t){var n,r;if(d.cors||Vt&&!t.crossDomain)return{send:function(i,a){var o,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)s[o]=t.xhrFields[o];for(o in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(o,i[o]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?a(0,"error"):a(s.status,s.statusText):a(Gt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),_.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),_.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return _.globalEval(e),e}}}),_.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),_.ajaxTransport("script",function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=_("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),g.head.appendChild(t[0])},abort:function(){n&&n()}}});var zt,Ut=[],jt=/(=)\?(?=&|$)|\?\?/;_.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Ut.pop()||_.expando+"_"+xt.guid++;return this[e]=!0,e}}),_.ajaxPrefilter("json jsonp",function(t,n,r){var i,a,o,s=!1!==t.jsonp&&(jt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&jt.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=f(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(jt,"$1"+i):!1!==t.jsonp&&(t.url+=(_t.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return o||_.error(i+" was not called"),o[0]},t.dataTypes[0]="json",a=e[i],e[i]=function(){o=arguments},r.always(function(){void 0===a?_(e).removeProp(i):e[i]=a,t[i]&&(t.jsonpCallback=n.jsonpCallback,Ut.push(i)),o&&f(a)&&a(o[0]),o=a=void 0}),"script"}),d.createHTMLDocument=((zt=g.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===zt.childNodes.length),_.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(d.createHTMLDocument?((r=(t=g.implementation.createHTMLDocument("")).createElement("base")).href=g.location.href,t.head.appendChild(r)):t=g),i=C.exec(e),a=!n&&[],i?[t.createElement(i[1])]:(i=xe([e],t,a),a&&a.length&&_(a).remove(),_.merge([],i.childNodes)));var r,i,a},_.fn.load=function(e,t,n){var r,i,a,o=this,s=e.indexOf(" ");return s>-1&&(r=pt(e.slice(s)),e=e.slice(0,s)),f(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),o.length>0&&_.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){a=arguments,o.html(r?_("<div>").append(_.parseHTML(e)).find(r):e)}).always(n&&function(e,t){o.each(function(){n.apply(this,a||[e.responseText,t,e])})}),this},_.expr.pseudos.animated=function(e){return _.grep(_.timers,function(t){return e===t.elem}).length},_.offset={setOffset:function(e,t,n){var r,i,a,o,s,l,c=_.css(e,"position"),u=_(e),h={};"static"===c&&(e.style.position="relative"),s=u.offset(),a=_.css(e,"top"),l=_.css(e,"left"),("absolute"===c||"fixed"===c)&&(a+l).indexOf("auto")>-1?(o=(r=u.position()).top,i=r.left):(o=parseFloat(a)||0,i=parseFloat(l)||0),f(t)&&(t=t.call(e,n,_.extend({},s))),null!=t.top&&(h.top=t.top-s.top+o),null!=t.left&&(h.left=t.left-s.left+i),"using"in t?t.using.call(e,h):u.css(h)}},_.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){_.offset.setOffset(this,e,t)});var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===_.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===_.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=_(e).offset()).top+=_.css(e,"borderTopWidth",!0),i.left+=_.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-_.css(r,"marginTop",!0),left:t.left-i.left-_.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===_.css(e,"position");)e=e.offsetParent;return e||ne})}}),_.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;_.fn[e]=function(r){return z(this,function(e,r,i){var a;if(m(e)?a=e:9===e.nodeType&&(a=e.defaultView),void 0===i)return a?a[t]:e[r];a?a.scrollTo(n?a.pageXOffset:i,n?i:a.pageYOffset):e[r]=i},e,r,arguments.length)}}),_.each(["top","left"],function(e,t){_.cssHooks[t]=Ve(d.pixelPosition,function(e,n){if(n)return n=Ge(e,t),Be.test(n)?_(e).position()[t]+"px":n})}),_.each({Height:"height",Width:"width"},function(e,t){_.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){_.fn[r]=function(i,a){var o=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===a?"margin":"border");return z(this,function(t,n,i){var a;return m(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(a=t.documentElement,Math.max(t.body["scroll"+e],a["scroll"+e],t.body["offset"+e],a["offset"+e],a["client"+e])):void 0===i?_.css(t,n,s):_.style(t,n,i,s)},t,o?i:void 0,o)}})}),_.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){_.fn[t]=function(e){return this.on(t,e)}}),_.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),_.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){_.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}});var Ht=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;_.proxy=function(e,t){var n,r,a;if("string"==typeof t&&(n=e[t],t=e,e=n),f(e))return r=i.call(arguments,2),(a=function(){return e.apply(t||this,r.concat(i.call(arguments)))}).guid=e.guid=e.guid||_.guid++,a},_.holdReady=function(e){e?_.readyWait++:_.ready(!0)},_.isArray=Array.isArray,_.parseJSON=JSON.parse,_.nodeName=E,_.isFunction=f,_.isWindow=m,_.camelCase=W,_.type=x,_.now=Date.now,_.isNumeric=function(e){var t=_.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},_.trim=function(e){return null==e?"":(e+"").replace(Ht,"")};var Wt=e.jQuery,qt=e.$;return _.noConflict=function(t){return e.$===_&&(e.$=qt),t&&e.jQuery===_&&(e.jQuery=Wt),_},void 0===t&&(e.jQuery=e.$=_),_},e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}}),jquery$1=Object.freeze({__proto__:null,default:jquery,__moduleExports:jquery});exports.McEdGetPointWorldDrawObject=McEdGetPointWorldDrawObject,exports.McGeTool=McGeTool,exports.McGiWorldDrawType=McGiWorldDrawType$1,exports.MrxDbgUiPrBaseReturn=MrxDbgUiPrBaseReturn$1,exports.MrxDbgUiPrPoint=MrxDbgUiPrPoint,exports.Mx3PointArc=Mx3PointArc,exports.MxDb2LineAngularDimension=MxDb2LineAngularDimension,exports.MxDbAlignedDimension=MxDbAlignedDimension,exports.MxDbAnyLine=MxDbAnyLine,exports.MxDbArea=MxDbArea,exports.MxDbCoord=MxDbCoord,exports.MxDbEntity=MxDbEntity,exports.MxDbImage=MxDbImage,exports.MxDbLine=MxDbLine,exports.MxDbPolyline=MxDbPolyline,exports.MxDbRect=MxDbRect,exports.MxDbSVG=MxDbSVG,exports.MxDbSVGText=MxDbSVGText,exports.MxFilters=MxFilters,exports.MxFun=MxFun,exports.MxThreeJS=MxThreeJS,exports.MxType=MxType,exports.Mxassembly=Mxassembly,exports.default=mxdraw,exports.loadCoreCode=loadCoreCode,exports.store=store,exports.useCanvasResizeListener=useCanvasResizeListener,Object.defineProperty(exports,"__esModule",{value:!0})});
|