mxdraw 0.1.163 → 0.1.165
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/README.md +3 -0
- package/dist/{lib/MxModule.d.ts → mxdraw.d.ts} +4 -1
- package/dist/mxdraw.esm.js +1 -1
- package/dist/mxdraw.umd.js +1 -1
- package/package.json +5 -5
- package/dist/lib/MxModule/Layer/index.d.ts +0 -36
- package/dist/lib/MxModule/Layer/index.js +0 -1
- package/dist/lib/MxModule/Layer/index.js.map +0 -1
- package/dist/lib/MxModule/McEdGetPointWorldDrawObject/index.d.ts +0 -130
- package/dist/lib/MxModule/McEdGetPointWorldDrawObject/index.js +0 -1
- package/dist/lib/MxModule/McEdGetPointWorldDrawObject/index.js.map +0 -1
- package/dist/lib/MxModule/McGePoint3d/index.d.ts +0 -11
- package/dist/lib/MxModule/McGePoint3d/index.js +0 -1
- package/dist/lib/MxModule/McGePoint3d/index.js.map +0 -1
- package/dist/lib/MxModule/McGePoint3dArray/index.d.ts +0 -14
- package/dist/lib/MxModule/McGePoint3dArray/index.js +0 -1
- package/dist/lib/MxModule/McGePoint3dArray/index.js.map +0 -1
- package/dist/lib/MxModule/McGeTool/index.d.ts +0 -41
- package/dist/lib/MxModule/McGeTool/index.js +0 -1
- package/dist/lib/MxModule/McGeTool/index.js.map +0 -1
- package/dist/lib/MxModule/McGiWorldDraw/index.d.ts +0 -297
- package/dist/lib/MxModule/McGiWorldDraw/index.js +0 -1
- package/dist/lib/MxModule/McGiWorldDraw/index.js.map +0 -1
- package/dist/lib/MxModule/McGiWorldDrawType/__tests__/McGiWorldDrawType.test.d.ts +0 -1
- package/dist/lib/MxModule/McGiWorldDrawType/__tests__/McGiWorldDrawType.test.js +0 -1
- package/dist/lib/MxModule/McGiWorldDrawType/__tests__/McGiWorldDrawType.test.js.map +0 -1
- package/dist/lib/MxModule/McGiWorldDrawType/index.d.ts +0 -16
- package/dist/lib/MxModule/McGiWorldDrawType/index.js +0 -1
- package/dist/lib/MxModule/McGiWorldDrawType/index.js.map +0 -1
- package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/index.d.ts +0 -28
- package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/index.js +0 -1
- package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/index.js.map +0 -1
- package/dist/lib/MxModule/MrxDbgUiPrPoint/index.d.ts +0 -145
- package/dist/lib/MxModule/MrxDbgUiPrPoint/index.js +0 -1
- package/dist/lib/MxModule/MrxDbgUiPrPoint/index.js.map +0 -1
- package/dist/lib/MxModule/MrxDbgUtils/index.d.ts +0 -30
- package/dist/lib/MxModule/MrxDbgUtils/index.js +0 -1
- package/dist/lib/MxModule/MrxDbgUtils/index.js.map +0 -1
- package/dist/lib/MxModule/Mx3PointArc/draw.d.ts +0 -1
- package/dist/lib/MxModule/Mx3PointArc/draw.js +0 -1
- package/dist/lib/MxModule/Mx3PointArc/draw.js.map +0 -1
- package/dist/lib/MxModule/Mx3PointArc/index.d.ts +0 -28
- package/dist/lib/MxModule/Mx3PointArc/index.js +0 -1
- package/dist/lib/MxModule/Mx3PointArc/index.js.map +0 -1
- package/dist/lib/MxModule/MxCADObject/index.d.ts +0 -63
- package/dist/lib/MxModule/MxCADObject/index.js +0 -1
- package/dist/lib/MxModule/MxCADObject/index.js.map +0 -1
- package/dist/lib/MxModule/MxDb2LineAngularDimension/draw.d.ts +0 -2
- package/dist/lib/MxModule/MxDb2LineAngularDimension/draw.js +0 -1
- package/dist/lib/MxModule/MxDb2LineAngularDimension/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDb2LineAngularDimension/index.d.ts +0 -63
- package/dist/lib/MxModule/MxDb2LineAngularDimension/index.js +0 -1
- package/dist/lib/MxModule/MxDb2LineAngularDimension/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbAlignedDimension/draw.d.ts +0 -2
- package/dist/lib/MxModule/MxDbAlignedDimension/draw.js +0 -1
- package/dist/lib/MxModule/MxDbAlignedDimension/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbAlignedDimension/index.d.ts +0 -67
- package/dist/lib/MxModule/MxDbAlignedDimension/index.js +0 -1
- package/dist/lib/MxModule/MxDbAlignedDimension/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbAnyLine/draw.d.ts +0 -1
- package/dist/lib/MxModule/MxDbAnyLine/draw.js +0 -1
- package/dist/lib/MxModule/MxDbAnyLine/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbAnyLine/index.d.ts +0 -28
- package/dist/lib/MxModule/MxDbAnyLine/index.js +0 -1
- package/dist/lib/MxModule/MxDbAnyLine/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbArcShape/index.d.ts +0 -15
- package/dist/lib/MxModule/MxDbArcShape/index.js +0 -1
- package/dist/lib/MxModule/MxDbArcShape/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbArcShapeDraw/draw.d.ts +0 -1
- package/dist/lib/MxModule/MxDbArcShapeDraw/draw.js +0 -1
- package/dist/lib/MxModule/MxDbArcShapeDraw/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbArcShapeDraw/index.d.ts +0 -17
- package/dist/lib/MxModule/MxDbArcShapeDraw/index.js +0 -1
- package/dist/lib/MxModule/MxDbArcShapeDraw/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbArea/draw.d.ts +0 -1
- package/dist/lib/MxModule/MxDbArea/draw.js +0 -1
- package/dist/lib/MxModule/MxDbArea/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbArea/index.d.ts +0 -41
- package/dist/lib/MxModule/MxDbArea/index.js +0 -1
- package/dist/lib/MxModule/MxDbArea/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbArrow/draw.d.ts +0 -2
- package/dist/lib/MxModule/MxDbArrow/draw.js +0 -1
- package/dist/lib/MxModule/MxDbArrow/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbArrow/index.d.ts +0 -24
- package/dist/lib/MxModule/MxDbArrow/index.js +0 -1
- package/dist/lib/MxModule/MxDbArrow/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbCircleArc/draw.d.ts +0 -1
- package/dist/lib/MxModule/MxDbCircleArc/draw.js +0 -1
- package/dist/lib/MxModule/MxDbCircleArc/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbCircleArc/index.d.ts +0 -21
- package/dist/lib/MxModule/MxDbCircleArc/index.js +0 -1
- package/dist/lib/MxModule/MxDbCircleArc/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbCircleShape/index.d.ts +0 -11
- package/dist/lib/MxModule/MxDbCircleShape/index.js +0 -1
- package/dist/lib/MxModule/MxDbCircleShape/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbCloudLine/draw.d.ts +0 -1
- package/dist/lib/MxModule/MxDbCloudLine/draw.js +0 -1
- package/dist/lib/MxModule/MxDbCloudLine/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbCloudLine/index.d.ts +0 -52
- package/dist/lib/MxModule/MxDbCloudLine/index.js +0 -1
- package/dist/lib/MxModule/MxDbCloudLine/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbCoord/draw.d.ts +0 -1
- package/dist/lib/MxModule/MxDbCoord/draw.js +0 -1
- package/dist/lib/MxModule/MxDbCoord/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbCoord/index.d.ts +0 -23
- package/dist/lib/MxModule/MxDbCoord/index.js +0 -1
- package/dist/lib/MxModule/MxDbCoord/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbDatabase/index.d.ts +0 -84
- package/dist/lib/MxModule/MxDbDatabase/index.js +0 -1
- package/dist/lib/MxModule/MxDbDatabase/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbEllipse/draw.d.ts +0 -1
- package/dist/lib/MxModule/MxDbEllipse/draw.js +0 -1
- package/dist/lib/MxModule/MxDbEllipse/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbEllipse/index.d.ts +0 -23
- package/dist/lib/MxModule/MxDbEllipse/index.js +0 -1
- package/dist/lib/MxModule/MxDbEllipse/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbEllipseArc/draw.d.ts +0 -1
- package/dist/lib/MxModule/MxDbEllipseArc/draw.js +0 -1
- package/dist/lib/MxModule/MxDbEllipseArc/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbEllipseArc/index.d.ts +0 -22
- package/dist/lib/MxModule/MxDbEllipseArc/index.js +0 -1
- package/dist/lib/MxModule/MxDbEllipseArc/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbEllipseShape/index.d.ts +0 -49
- package/dist/lib/MxModule/MxDbEllipseShape/index.js +0 -1
- package/dist/lib/MxModule/MxDbEllipseShape/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbEntity/Events.d.ts +0 -14
- package/dist/lib/MxModule/MxDbEntity/Events.js +0 -1
- package/dist/lib/MxModule/MxDbEntity/Events.js.map +0 -1
- package/dist/lib/MxModule/MxDbEntity/Node.d.ts +0 -92
- package/dist/lib/MxModule/MxDbEntity/Node.js +0 -1
- package/dist/lib/MxModule/MxDbEntity/Node.js.map +0 -1
- package/dist/lib/MxModule/MxDbEntity/index.d.ts +0 -381
- package/dist/lib/MxModule/MxDbEntity/index.js +0 -1
- package/dist/lib/MxModule/MxDbEntity/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbGradientLine/index.d.ts +0 -63
- package/dist/lib/MxModule/MxDbGradientLine/index.js +0 -1
- package/dist/lib/MxModule/MxDbGradientLine/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbGroup/index.d.ts +0 -13
- package/dist/lib/MxModule/MxDbGroup/index.js +0 -1
- package/dist/lib/MxModule/MxDbGroup/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbHatch/index.d.ts +0 -17
- package/dist/lib/MxModule/MxDbHatch/index.js +0 -1
- package/dist/lib/MxModule/MxDbHatch/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbImage/draw.d.ts +0 -1
- package/dist/lib/MxModule/MxDbImage/draw.js +0 -1
- package/dist/lib/MxModule/MxDbImage/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbImage/index.d.ts +0 -57
- package/dist/lib/MxModule/MxDbImage/index.js +0 -1
- package/dist/lib/MxModule/MxDbImage/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbLayerTableRecord/index.d.ts +0 -10
- package/dist/lib/MxModule/MxDbLayerTableRecord/index.js +0 -1
- package/dist/lib/MxModule/MxDbLayerTableRecord/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbLeadComment/draw.d.ts +0 -1
- package/dist/lib/MxModule/MxDbLeadComment/draw.js +0 -1
- package/dist/lib/MxModule/MxDbLeadComment/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbLeadComment/index.d.ts +0 -30
- package/dist/lib/MxModule/MxDbLeadComment/index.js +0 -1
- package/dist/lib/MxModule/MxDbLeadComment/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbLeadTag/draw.d.ts +0 -1
- package/dist/lib/MxModule/MxDbLeadTag/draw.js +0 -1
- package/dist/lib/MxModule/MxDbLeadTag/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbLeadTag/index.d.ts +0 -23
- package/dist/lib/MxModule/MxDbLeadTag/index.js +0 -1
- package/dist/lib/MxModule/MxDbLeadTag/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbLine/draw.d.ts +0 -2
- package/dist/lib/MxModule/MxDbLine/draw.js +0 -1
- package/dist/lib/MxModule/MxDbLine/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbLine/index.d.ts +0 -34
- package/dist/lib/MxModule/MxDbLine/index.js +0 -1
- package/dist/lib/MxModule/MxDbLine/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbLineShape/index.d.ts +0 -22
- package/dist/lib/MxModule/MxDbLineShape/index.js +0 -1
- package/dist/lib/MxModule/MxDbLineShape/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbPolyline/draw.d.ts +0 -1
- package/dist/lib/MxModule/MxDbPolyline/draw.js +0 -1
- package/dist/lib/MxModule/MxDbPolyline/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbPolyline/index.d.ts +0 -30
- package/dist/lib/MxModule/MxDbPolyline/index.js +0 -1
- package/dist/lib/MxModule/MxDbPolyline/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbRect/draw.d.ts +0 -1
- package/dist/lib/MxModule/MxDbRect/draw.js +0 -1
- package/dist/lib/MxModule/MxDbRect/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbRect/index.d.ts +0 -62
- package/dist/lib/MxModule/MxDbRect/index.js +0 -1
- package/dist/lib/MxModule/MxDbRect/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbRectBoxLeadComment/draw.d.ts +0 -1
- package/dist/lib/MxModule/MxDbRectBoxLeadComment/draw.js +0 -1
- package/dist/lib/MxModule/MxDbRectBoxLeadComment/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbRectBoxLeadComment/index.d.ts +0 -35
- package/dist/lib/MxModule/MxDbRectBoxLeadComment/index.js +0 -1
- package/dist/lib/MxModule/MxDbRectBoxLeadComment/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbRegularPolygon/draw.d.ts +0 -1
- package/dist/lib/MxModule/MxDbRegularPolygon/draw.js +0 -1
- package/dist/lib/MxModule/MxDbRegularPolygon/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbRegularPolygon/index.d.ts +0 -22
- package/dist/lib/MxModule/MxDbRegularPolygon/index.js +0 -1
- package/dist/lib/MxModule/MxDbRegularPolygon/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbRegularPolygonShape/index.d.ts +0 -19
- package/dist/lib/MxModule/MxDbRegularPolygonShape/index.js +0 -1
- package/dist/lib/MxModule/MxDbRegularPolygonShape/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbRingShape/draw.d.ts +0 -1
- package/dist/lib/MxModule/MxDbRingShape/draw.js +0 -1
- package/dist/lib/MxModule/MxDbRingShape/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbRingShape/index.d.ts +0 -20
- package/dist/lib/MxModule/MxDbRingShape/index.js +0 -1
- package/dist/lib/MxModule/MxDbRingShape/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbSVG/draw.d.ts +0 -1
- package/dist/lib/MxModule/MxDbSVG/draw.js +0 -1
- package/dist/lib/MxModule/MxDbSVG/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbSVG/index.d.ts +0 -108
- package/dist/lib/MxModule/MxDbSVG/index.js +0 -1
- package/dist/lib/MxModule/MxDbSVG/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbSVGText/index.d.ts +0 -30
- package/dist/lib/MxModule/MxDbSVGText/index.js +0 -1
- package/dist/lib/MxModule/MxDbSVGText/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbShape/index.d.ts +0 -94
- package/dist/lib/MxModule/MxDbShape/index.js +0 -1
- package/dist/lib/MxModule/MxDbShape/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbSplineCurve/draw.d.ts +0 -1
- package/dist/lib/MxModule/MxDbSplineCurve/draw.js +0 -1
- package/dist/lib/MxModule/MxDbSplineCurve/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbSplineCurve/index.d.ts +0 -22
- package/dist/lib/MxModule/MxDbSplineCurve/index.js +0 -1
- package/dist/lib/MxModule/MxDbSplineCurve/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbStarShape/draw.d.ts +0 -1
- package/dist/lib/MxModule/MxDbStarShape/draw.js +0 -1
- package/dist/lib/MxModule/MxDbStarShape/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbStarShape/index.d.ts +0 -29
- package/dist/lib/MxModule/MxDbStarShape/index.js +0 -1
- package/dist/lib/MxModule/MxDbStarShape/index.js.map +0 -1
- package/dist/lib/MxModule/MxDbText/MxDbText.d.ts +0 -146
- package/dist/lib/MxModule/MxDbText/MxDbText.js +0 -1
- package/dist/lib/MxModule/MxDbText/MxDbText.js.map +0 -1
- package/dist/lib/MxModule/MxDbText/MxDbText_old.d.ts +0 -23
- package/dist/lib/MxModule/MxDbText/MxDbText_old.js +0 -1
- package/dist/lib/MxModule/MxDbText/MxDbText_old.js.map +0 -1
- package/dist/lib/MxModule/MxDbText/SpriteText.d.ts +0 -62
- package/dist/lib/MxModule/MxDbText/SpriteText.js +0 -1
- package/dist/lib/MxModule/MxDbText/SpriteText.js.map +0 -1
- package/dist/lib/MxModule/MxDbText/draw.d.ts +0 -1
- package/dist/lib/MxModule/MxDbText/draw.js +0 -1
- package/dist/lib/MxModule/MxDbText/draw.js.map +0 -1
- package/dist/lib/MxModule/MxDbText/index.d.ts +0 -2
- package/dist/lib/MxModule/MxDbText/index.js +0 -1
- package/dist/lib/MxModule/MxDbText/index.js.map +0 -1
- package/dist/lib/MxModule/MxDrawObject/index.d.ts +0 -929
- package/dist/lib/MxModule/MxDrawObject/index.js +0 -1
- package/dist/lib/MxModule/MxDrawObject/index.js.map +0 -1
- package/dist/lib/MxModule/MxFilters/__tests__/index.test.d.ts +0 -1
- package/dist/lib/MxModule/MxFilters/__tests__/index.test.js +0 -1
- package/dist/lib/MxModule/MxFilters/__tests__/index.test.js.map +0 -1
- package/dist/lib/MxModule/MxFilters/index.d.ts +0 -96
- package/dist/lib/MxModule/MxFilters/index.js +0 -1
- package/dist/lib/MxModule/MxFilters/index.js.map +0 -1
- package/dist/lib/MxModule/MxFun/createMxObject.d.ts +0 -40
- package/dist/lib/MxModule/MxFun/createMxObject.js +0 -1
- package/dist/lib/MxModule/MxFun/createMxObject.js.map +0 -1
- package/dist/lib/MxModule/MxFun/index.d.ts +0 -186
- package/dist/lib/MxModule/MxFun/index.js +0 -1
- package/dist/lib/MxModule/MxFun/index.js.map +0 -1
- package/dist/lib/MxModule/MxFun/initEvents.d.ts +0 -2
- package/dist/lib/MxModule/MxFun/initEvents.js +0 -1
- package/dist/lib/MxModule/MxFun/initEvents.js.map +0 -1
- package/dist/lib/MxModule/MxFun/types.d.ts +0 -416
- package/dist/lib/MxModule/MxFun/types.js +0 -1
- package/dist/lib/MxModule/MxFun/types.js.map +0 -1
- package/dist/lib/MxModule/MxPaintBrush/index.d.ts +0 -45
- package/dist/lib/MxModule/MxPaintBrush/index.js +0 -1
- package/dist/lib/MxModule/MxPaintBrush/index.js.map +0 -1
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.d.ts +0 -195
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.js +0 -1
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.js.map +0 -1
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.mixin.d.ts +0 -2
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.mixin.js +0 -1
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.mixin.js.map +0 -1
- package/dist/lib/MxModule/MxThreeJS/__tests__/MxThreeJS.test.d.ts +0 -1
- package/dist/lib/MxModule/MxThreeJS/__tests__/MxThreeJS.test.js +0 -1
- package/dist/lib/MxModule/MxThreeJS/__tests__/MxThreeJS.test.js.map +0 -1
- package/dist/lib/MxModule/MxThreeJS/index.d.ts +0 -3
- package/dist/lib/MxModule/MxThreeJS/index.js +0 -1
- package/dist/lib/MxModule/MxThreeJS/index.js.map +0 -1
- package/dist/lib/MxModule/MxType/MxType.d.ts +0 -40
- package/dist/lib/MxModule/MxType/MxType.js +0 -1
- package/dist/lib/MxModule/MxType/MxType.js.map +0 -1
- package/dist/lib/MxModule/MxType/index.d.ts +0 -3
- package/dist/lib/MxModule/MxType/index.js +0 -1
- package/dist/lib/MxModule/MxType/index.js.map +0 -1
- package/dist/lib/MxModule/Mxassembly/index.d.ts +0 -22
- package/dist/lib/MxModule/Mxassembly/index.js +0 -1
- package/dist/lib/MxModule/Mxassembly/index.js.map +0 -1
- package/dist/lib/MxModule/loadCoreCode/__tests__/index.test.d.ts +0 -1
- package/dist/lib/MxModule/loadCoreCode/__tests__/index.test.js +0 -1
- package/dist/lib/MxModule/loadCoreCode/__tests__/index.test.js.map +0 -1
- package/dist/lib/MxModule/loadCoreCode/__tests__/loadMxcadAssembly.test.d.ts +0 -0
- package/dist/lib/MxModule/loadCoreCode/__tests__/loadMxcadAssembly.test.js +0 -1
- package/dist/lib/MxModule/loadCoreCode/__tests__/loadMxcadAssembly.test.js.map +0 -1
- package/dist/lib/MxModule/loadCoreCode/__tests__/mxUiData.test.d.ts +0 -1
- package/dist/lib/MxModule/loadCoreCode/__tests__/mxUiData.test.js +0 -1
- package/dist/lib/MxModule/loadCoreCode/__tests__/mxUiData.test.js.map +0 -1
- package/dist/lib/MxModule/loadCoreCode/index-old.d.ts +0 -9
- package/dist/lib/MxModule/loadCoreCode/index-old.js +0 -1
- package/dist/lib/MxModule/loadCoreCode/index-old.js.map +0 -1
- package/dist/lib/MxModule/loadCoreCode/index.d.ts +0 -10
- package/dist/lib/MxModule/loadCoreCode/index.js +0 -1
- package/dist/lib/MxModule/loadCoreCode/index.js.map +0 -1
- package/dist/lib/MxModule/loadCoreCode/loadMxcadAssembly.d.ts +0 -1
- package/dist/lib/MxModule/loadCoreCode/loadMxcadAssembly.js +0 -1
- package/dist/lib/MxModule/loadCoreCode/loadMxcadAssembly.js.map +0 -1
- package/dist/lib/MxModule/loadCoreCode/mxUiData.d.ts +0 -129
- package/dist/lib/MxModule/loadCoreCode/mxUiData.js +0 -1
- package/dist/lib/MxModule/loadCoreCode/mxUiData.js.map +0 -1
- package/dist/lib/MxModule/loadCoreCode/mxcadassembly_es5.d.ts +0 -1
- package/dist/lib/MxModule/loadCoreCode/mxcadassembly_es5.js +0 -1
- package/dist/lib/MxModule/loadCoreCode/mxcadassembly_es5.js.map +0 -1
- package/dist/lib/MxModule/loadCoreCode/mxfun.es5.d.ts +0 -1
- package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +0 -1
- package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js.map +0 -1
- package/dist/lib/MxModule/store/Pubsub.d.ts +0 -27
- package/dist/lib/MxModule/store/Pubsub.js +0 -1
- package/dist/lib/MxModule/store/Pubsub.js.map +0 -1
- package/dist/lib/MxModule/store/Store.d.ts +0 -42
- package/dist/lib/MxModule/store/Store.js +0 -1
- package/dist/lib/MxModule/store/Store.js.map +0 -1
- package/dist/lib/MxModule/store/__tests__/index.test.d.ts +0 -1
- package/dist/lib/MxModule/store/__tests__/index.test.js +0 -1
- package/dist/lib/MxModule/store/__tests__/index.test.js.map +0 -1
- package/dist/lib/MxModule/store/index.d.ts +0 -10
- package/dist/lib/MxModule/store/index.js +0 -1
- package/dist/lib/MxModule/store/index.js.map +0 -1
- package/dist/lib/MxModule/useCanvasResizeListener/index.d.ts +0 -12
- package/dist/lib/MxModule/useCanvasResizeListener/index.js +0 -1
- package/dist/lib/MxModule/useCanvasResizeListener/index.js.map +0 -1
- package/dist/lib/doc.d.ts +0 -63
- package/dist/lib/doc.js +0 -1
- package/dist/lib/doc.js.map +0 -1
- package/dist/lib/index.d.ts +0 -10
- package/dist/lib/index.js +0 -1
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/mxdraw.d.ts +0 -57
- package/dist/lib/mxdraw.js +0 -1
- package/dist/lib/mxdraw.js.map +0 -1
- package/dist/lib/test/jest-setup.d.ts +0 -1
- package/dist/lib/test/jest-setup.js +0 -1
- package/dist/lib/test/jest-setup.js.map +0 -1
- package/dist/lib/tools/algorithm/__tests__/math.test.d.ts +0 -1
- package/dist/lib/tools/algorithm/__tests__/math.test.js +0 -1
- package/dist/lib/tools/algorithm/__tests__/math.test.js.map +0 -1
- package/dist/lib/tools/algorithm/__tests__/random.test.d.ts +0 -1
- package/dist/lib/tools/algorithm/__tests__/random.test.js +0 -1
- package/dist/lib/tools/algorithm/__tests__/random.test.js.map +0 -1
- package/dist/lib/tools/algorithm/math.d.ts +0 -10
- package/dist/lib/tools/algorithm/math.js +0 -1
- package/dist/lib/tools/algorithm/math.js.map +0 -1
- package/dist/lib/tools/algorithm/random.d.ts +0 -6
- package/dist/lib/tools/algorithm/random.js +0 -1
- package/dist/lib/tools/algorithm/random.js.map +0 -1
- package/dist/lib/tools/dom/__tests__/create.test.d.ts +0 -1
- package/dist/lib/tools/dom/__tests__/create.test.js +0 -1
- package/dist/lib/tools/dom/__tests__/create.test.js.map +0 -1
- package/dist/lib/tools/dom/create.d.ts +0 -22
- package/dist/lib/tools/dom/create.js +0 -1
- package/dist/lib/tools/dom/create.js.map +0 -1
- package/dist/lib/tools/dynamicImport/index.d.ts +0 -2
- package/dist/lib/tools/dynamicImport/index.js +0 -1
- package/dist/lib/tools/dynamicImport/index.js.map +0 -1
- package/dist/lib/tools/formatting/__tests__/index.test.d.ts +0 -1
- package/dist/lib/tools/formatting/__tests__/index.test.js +0 -1
- package/dist/lib/tools/formatting/__tests__/index.test.js.map +0 -1
- package/dist/lib/tools/formatting/index.d.ts +0 -7
- package/dist/lib/tools/formatting/index.js +0 -1
- package/dist/lib/tools/formatting/index.js.map +0 -1
- package/dist/lib/tools/proxy/__tests__/index.test.d.ts +0 -1
- package/dist/lib/tools/proxy/__tests__/index.test.js +0 -1
- package/dist/lib/tools/proxy/__tests__/index.test.js.map +0 -1
- package/dist/lib/tools/proxy/index.d.ts +0 -9
- package/dist/lib/tools/proxy/index.js +0 -1
- package/dist/lib/tools/proxy/index.js.map +0 -1
- package/dist/lib/tools/registerMxDbEntity/index.d.ts +0 -9
- package/dist/lib/tools/registerMxDbEntity/index.js +0 -1
- package/dist/lib/tools/registerMxDbEntity/index.js.map +0 -1
- package/dist/lib/tools/three/__tests__/index.test.d.ts +0 -1
- package/dist/lib/tools/three/__tests__/index.test.js +0 -1
- package/dist/lib/tools/three/__tests__/index.test.js.map +0 -1
- package/dist/lib/tools/three/index.d.ts +0 -102
- package/dist/lib/tools/three/index.js +0 -1
- package/dist/lib/tools/three/index.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function mxfun(){!function t(e,n,i){function r(o,s){if(!n[o]){if(!e[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:{}};e[o][0].call(u.exports,function(t){return r(e[o][1][t]||t)},u,u.exports,t,e,n,i)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<i.length;o++)r(i[o]);return r}({1:[function(t,e,n){"use strict";var i={};(0,t("./lib/utils/common").assign)(i,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=i},{"./lib/deflate":2,"./lib/inflate":3,"./lib/utils/common":4,"./lib/zlib/constants":7}],2:[function(t,e,n){"use strict";var i=t("./zlib/deflate"),r=t("./utils/common"),a=t("./utils/strings"),o=t("./zlib/messages"),s=t("./zlib/zstream"),l=Object.prototype.toString,c=0,u=-1,h=0,p=8;function d(t){if(!(this instanceof d))return new d(t);this.options=r.assign({level:u,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:h,to:""},t||{});var e=this.options;e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=i.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==c)throw new Error(o[n]);if(e.header&&i.deflateSetHeader(this.strm,e.header),e.dictionary){var f;if(f="string"==typeof e.dictionary?a.string2buf(e.dictionary):"[object ArrayBuffer]"===l.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(n=i.deflateSetDictionary(this.strm,f))!==c)throw new Error(o[n]);this._dict_set=!0}}function f(t,e){var n=new d(e);if(n.push(t,!0),n.err)throw n.msg||o[n.err];return n.result}d.prototype.push=function(t,e){var n,o,s=this.strm,u=this.options.chunkSize;if(this.ended)return!1;o=e===~~e?e:!0===e?4:0,"string"==typeof t?s.input=a.string2buf(t):"[object ArrayBuffer]"===l.call(t)?s.input=new Uint8Array(t):s.input=t,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new r.Buf8(u),s.next_out=0,s.avail_out=u),1!==(n=i.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(r.shrinkBuf(s.output,s.next_out))):this.onData(r.shrinkBuf(s.output,s.next_out)))}while((0<s.avail_in||0===s.avail_out)&&1!==n);return 4===o?(n=i.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===c):2!==o||(this.onEnd(c),!(s.avail_out=0))},d.prototype.onData=function(t){this.chunks.push(t)},d.prototype.onEnd=function(t){t===c&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Deflate=d,n.deflate=f,n.deflateRaw=function(t,e){return(e=e||{}).raw=!0,f(t,e)},n.gzip=function(t,e){return(e=e||{}).gzip=!0,f(t,e)}},{"./utils/common":4,"./utils/strings":5,"./zlib/deflate":9,"./zlib/messages":14,"./zlib/zstream":16}],3:[function(t,e,n){"use strict";var i=t("./zlib/inflate"),r=t("./utils/common"),a=t("./utils/strings"),o=t("./zlib/constants"),s=t("./zlib/messages"),l=t("./zlib/zstream"),c=t("./zlib/gzheader"),u=Object.prototype.toString;function h(t){if(!(this instanceof h))return new h(t);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&0<=e.windowBits&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(0<=e.windowBits&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),15<e.windowBits&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var n=i.inflateInit2(this.strm,e.windowBits);if(n!==o.Z_OK)throw new Error(s[n]);if(this.header=new c,i.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=a.string2buf(e.dictionary):"[object ArrayBuffer]"===u.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=i.inflateSetDictionary(this.strm,e.dictionary))!==o.Z_OK))throw new Error(s[n])}function p(t,e){var n=new h(e);if(n.push(t,!0),n.err)throw n.msg||s[n.err];return n.result}h.prototype.push=function(t,e){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=e===~~e?e:!0===e?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof t?p.input=a.binstring2buf(t):"[object ArrayBuffer]"===u.call(t)?p.input=new Uint8Array(t):p.input=t,p.next_in=0,p.avail_in=p.input.length;do{if(0===p.avail_out&&(p.output=new r.Buf8(d),p.next_out=0,p.avail_out=d),(n=i.inflate(p,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&f&&(n=i.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&&r.arraySet(p.output,p.output,l,c,0),this.onData(h)):this.onData(r.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=i.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(t){this.chunks.push(t)},h.prototype.onEnd=function(t){t===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Inflate=h,n.inflate=p,n.inflateRaw=function(t,e){return(e=e||{}).raw=!0,p(t,e)},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(t,e,n){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(t){for(var e,n,i=Array.prototype.slice.call(arguments,1);i.length;){var r=i.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var a in r)e=r,n=a,Object.prototype.hasOwnProperty.call(e,n)&&(t[a]=r[a])}}return t},n.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var r={arraySet:function(t,e,n,i,r){if(e.subarray&&t.subarray)t.set(e.subarray(n,n+i),r);else for(var a=0;a<i;a++)t[r+a]=e[n+a]},flattenChunks:function(t){var e,n,i,r,a,o;for(e=i=0,n=t.length;e<n;e++)i+=t[e].length;for(o=new Uint8Array(i),e=r=0,n=t.length;e<n;e++)a=t[e],o.set(a,r),r+=a.length;return o}},a={arraySet:function(t,e,n,i,r){for(var a=0;a<i;a++)t[r+a]=e[n+a]},flattenChunks:function(t){return[].concat.apply([],t)}};n.setTyped=function(t){t?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,r)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,a))},n.setTyped(i)},{}],5:[function(t,e,n){"use strict";var i=t("./common"),r=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(t){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){a=!1}for(var o=new i.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(t,e){if(e<65534&&(t.subarray&&a||!t.subarray&&r))return String.fromCharCode.apply(null,i.shrinkBuf(t,e));for(var n="",o=0;o<e;o++)n+=String.fromCharCode(t[o]);return n}o[254]=o[254]=1,n.string2buf=function(t){var e,n,r,a,o,s=t.length,l=0;for(a=0;a<s;a++)55296==(64512&(n=t.charCodeAt(a)))&&a+1<s&&56320==(64512&(r=t.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(r-56320),a++),l+=n<128?1:n<2048?2:n<65536?3:4;for(e=new i.Buf8(l),a=o=0;o<l;a++)55296==(64512&(n=t.charCodeAt(a)))&&a+1<s&&56320==(64512&(r=t.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(r-56320),a++),n<128?e[o++]=n:(n<2048?e[o++]=192|n>>>6:(n<65536?e[o++]=224|n>>>12:(e[o++]=240|n>>>18,e[o++]=128|n>>>12&63),e[o++]=128|n>>>6&63),e[o++]=128|63&n);return e},n.buf2binstring=function(t){return l(t,t.length)},n.binstring2buf=function(t){for(var e=new i.Buf8(t.length),n=0,r=e.length;n<r;n++)e[n]=t.charCodeAt(n);return e},n.buf2string=function(t,e){var n,i,r,a,s=e||t.length,c=new Array(2*s);for(n=i=0;n<s;)if((r=t[n++])<128)c[i++]=r;else if(4<(a=o[r]))c[i++]=65533,n+=a-1;else{for(r&=2===a?31:3===a?15:7;1<a&&n<s;)r=r<<6|63&t[n++],a--;1<a?c[i++]=65533:r<65536?c[i++]=r:(r-=65536,c[i++]=55296|r>>10&1023,c[i++]=56320|1023&r)}return l(c,i)},n.utf8border=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;0<=n&&128==(192&t[n]);)n--;return!(n<0)&&0!==n&&n+o[t[n]]>e?n:e}},{"./common":4}],6:[function(t,e,n){"use strict";e.exports=function(t,e,n,i){for(var r=65535&t|0,a=t>>>16&65535|0,o=0;0!==n;){for(n-=o=2e3<n?2e3:n;a=a+(r=r+e[i++]|0)|0,--o;);r%=65521,a%=65521}return r|a<<16|0}},{}],7:[function(t,e,n){"use strict";e.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(t,e,n){"use strict";var i=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();e.exports=function(t,e,n,r){var a=i,o=r+n;t^=-1;for(var s=r;s<o;s++)t=t>>>8^a[255&(t^e[s])];return-1^t}},{}],9:[function(t,e,n){"use strict";var i,r=t("../utils/common"),a=t("./trees"),o=t("./adler32"),s=t("./crc32"),l=t("./messages"),c=0,u=4,h=0,p=-2,d=-1,f=4,m=2,g=8,v=9,y=286,x=30,b=19,w=2*y+1,M=15,_=3,S=258,C=S+_+1,T=42,E=113,D=1,A=2,O=3,L=4;function I(t,e){return t.msg=l[e],e}function P(t){return(t<<1)-(4<t?9:0)}function R(t){for(var e=t.length;0<=--e;)t[e]=0}function k(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(r.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function N(t,e){a._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,k(t.strm)}function B(t,e){t.pending_buf[t.pending++]=e}function F(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function j(t,e){var n,i,r=t.max_chain_length,a=t.strstart,o=t.prev_length,s=t.nice_match,l=t.strstart>t.w_size-C?t.strstart-(t.w_size-C):0,c=t.window,u=t.w_mask,h=t.prev,p=t.strstart+S,d=c[a+o-1],f=c[a+o];t.prev_length>=t.good_match&&(r>>=2),s>t.lookahead&&(s=t.lookahead);do{if(c[(n=e)+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(i=S-(p-a),a=p-S,o<i){if(t.match_start=e,s<=(o=i))break;d=c[a+o-1],f=c[a+o]}}}while((e=h[e&u])>l&&0!=--r);return o<=t.lookahead?o:t.lookahead}function V(t){var e,n,i,a,l,c,u,h,p,d,f=t.w_size;do{if(a=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-C)){for(r.arraySet(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=n=t.hash_size;i=t.head[--e],t.head[e]=f<=i?i-f:0,--n;);for(e=n=f;i=t.prev[--e],t.prev[e]=f<=i?i-f:0,--n;);a+=f}if(0===t.strm.avail_in)break;if(c=t.strm,u=t.window,h=t.strstart+t.lookahead,d=void 0,(p=a)<(d=c.avail_in)&&(d=p),n=0===d?0:(c.avail_in-=d,r.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),t.lookahead+=n,t.lookahead+t.insert>=_)for(l=t.strstart-t.insert,t.ins_h=t.window[l],t.ins_h=(t.ins_h<<t.hash_shift^t.window[l+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[l+_-1])&t.hash_mask,t.prev[l&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=l,l++,t.insert--,!(t.lookahead+t.insert<_)););}while(t.lookahead<C&&0!==t.strm.avail_in)}function z(t,e){for(var n,i;;){if(t.lookahead<C){if(V(t),t.lookahead<C&&e===c)return D;if(0===t.lookahead)break}if(n=0,t.lookahead>=_&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+_-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-C&&(t.match_length=j(t,n)),t.match_length>=_)if(i=a._tr_tally(t,t.strstart-t.match_start,t.match_length-_),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=_){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+_-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,0!=--t.match_length;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else i=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(N(t,!1),0===t.strm.avail_out))return D}return t.insert=t.strstart<_-1?t.strstart:_-1,e===u?(N(t,!0),0===t.strm.avail_out?O:L):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?D:A}function G(t,e){for(var n,i,r;;){if(t.lookahead<C){if(V(t),t.lookahead<C&&e===c)return D;if(0===t.lookahead)break}if(n=0,t.lookahead>=_&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+_-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=_-1,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-C&&(t.match_length=j(t,n),t.match_length<=5&&(1===t.strategy||t.match_length===_&&4096<t.strstart-t.match_start)&&(t.match_length=_-1)),t.prev_length>=_&&t.match_length<=t.prev_length){for(r=t.strstart+t.lookahead-_,i=a._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-_),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=r&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+_-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!=--t.prev_length;);if(t.match_available=0,t.match_length=_-1,t.strstart++,i&&(N(t,!1),0===t.strm.avail_out))return D}else if(t.match_available){if((i=a._tr_tally(t,0,t.window[t.strstart-1]))&&N(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return D}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=a._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<_-1?t.strstart:_-1,e===u?(N(t,!0),0===t.strm.avail_out?O:L):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?D:A}function U(t,e,n,i,r){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=i,this.func=r}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 r.Buf16(2*w),this.dyn_dtree=new r.Buf16(2*(2*x+1)),this.bl_tree=new r.Buf16(2*(2*b+1)),R(this.dyn_ltree),R(this.dyn_dtree),R(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(M+1),this.heap=new r.Buf16(2*y+1),R(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(2*y+1),R(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(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=m,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?T:E,t.adler=2===e.wrap?0:1,e.last_flush=c,a._tr_init(e),h):I(t,p)}function J(t){var e,n=W(t);return n===h&&((e=t.state).window_size=2*e.w_size,R(e.head),e.max_lazy_match=i[e.level].max_lazy,e.good_match=i[e.level].good_length,e.nice_match=i[e.level].nice_length,e.max_chain_length=i[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=_-1,e.match_available=0,e.ins_h=0),n}function q(t,e,n,i,a,o){if(!t)return p;var s=1;if(e===d&&(e=6),i<0?(s=0,i=-i):15<i&&(s=2,i-=16),a<1||v<a||n!==g||i<8||15<i||e<0||9<e||o<0||f<o)return I(t,p);8===i&&(i=9);var l=new H;return(t.state=l).strm=t,l.wrap=s,l.gzhead=null,l.w_bits=i,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+_-1)/_),l.window=new r.Buf8(2*l.w_size),l.head=new r.Buf16(l.hash_size),l.prev=new r.Buf16(l.w_size),l.lit_bufsize=1<<a+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new r.Buf8(l.pending_buf_size),l.d_buf=+l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=e,l.strategy=o,l.method=n,J(t)}i=[new U(0,0,0,0,function(t,e){var n=65535;for(n>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(V(t),0===t.lookahead&&e===c)return D;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+n;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,N(t,!1),0===t.strm.avail_out))return D;if(t.strstart-t.block_start>=t.w_size-C&&(N(t,!1),0===t.strm.avail_out))return D}return t.insert=0,e===u?(N(t,!0),0===t.strm.avail_out?O:L):(t.strstart>t.block_start&&(N(t,!1),t.strm.avail_out),D)}),new U(4,4,8,4,z),new U(4,5,16,8,z),new U(4,6,32,32,z),new U(4,4,16,16,G),new U(8,16,32,32,G),new U(8,16,128,128,G),new U(8,32,128,256,G),new U(32,128,258,1024,G),new U(32,258,258,4096,G)],n.deflateInit=function(t,e){return q(t,e,g,15,8,0)},n.deflateInit2=q,n.deflateReset=J,n.deflateResetKeep=W,n.deflateSetHeader=function(t,e){return t&&t.state&&2===t.state.wrap?(t.state.gzhead=e,h):p},n.deflate=function(t,e){var n,r,o,l;if(!t||!t.state||5<e||e<0)return t?I(t,p):p;if(r=t.state,!t.output||!t.input&&0!==t.avail_in||666===r.status&&e!==u)return I(t,0===t.avail_out?-5:p);if(r.strm=t,n=r.last_flush,r.last_flush=e,r.status===T)if(2===r.wrap)t.adler=0,B(r,31),B(r,139),B(r,8),r.gzhead?(B(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),B(r,255&r.gzhead.time),B(r,r.gzhead.time>>8&255),B(r,r.gzhead.time>>16&255),B(r,r.gzhead.time>>24&255),B(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),B(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(B(r,255&r.gzhead.extra.length),B(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=s(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(B(r,0),B(r,0),B(r,0),B(r,0),B(r,0),B(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),B(r,3),r.status=E);else{var d=g+(r.w_bits-8<<4)<<8;d|=(2<=r.strategy||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(d|=32),d+=31-d%31,r.status=E,F(r,d),0!==r.strstart&&(F(r,t.adler>>>16),F(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(o=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>o&&(t.adler=s(t.adler,r.pending_buf,r.pending-o,o)),k(t),o=r.pending,r.pending!==r.pending_buf_size));)B(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>o&&(t.adler=s(t.adler,r.pending_buf,r.pending-o,o)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(t.adler=s(t.adler,r.pending_buf,r.pending-o,o)),k(t),o=r.pending,r.pending===r.pending_buf_size)){l=1;break}l=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,B(r,l)}while(0!==l);r.gzhead.hcrc&&r.pending>o&&(t.adler=s(t.adler,r.pending_buf,r.pending-o,o)),0===l&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(t.adler=s(t.adler,r.pending_buf,r.pending-o,o)),k(t),o=r.pending,r.pending===r.pending_buf_size)){l=1;break}l=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,B(r,l)}while(0!==l);r.gzhead.hcrc&&r.pending>o&&(t.adler=s(t.adler,r.pending_buf,r.pending-o,o)),0===l&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&k(t),r.pending+2<=r.pending_buf_size&&(B(r,255&t.adler),B(r,t.adler>>8&255),t.adler=0,r.status=E)):r.status=E),0!==r.pending){if(k(t),0===t.avail_out)return r.last_flush=-1,h}else if(0===t.avail_in&&P(e)<=P(n)&&e!==u)return I(t,-5);if(666===r.status&&0!==t.avail_in)return I(t,-5);if(0!==t.avail_in||0!==r.lookahead||e!==c&&666!==r.status){var f=2===r.strategy?function(t,e){for(var n;;){if(0===t.lookahead&&(V(t),0===t.lookahead)){if(e===c)return D;break}if(t.match_length=0,n=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(N(t,!1),0===t.strm.avail_out))return D}return t.insert=0,e===u?(N(t,!0),0===t.strm.avail_out?O:L):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?D:A}(r,e):3===r.strategy?function(t,e){for(var n,i,r,o,s=t.window;;){if(t.lookahead<=S){if(V(t),t.lookahead<=S&&e===c)return D;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=_&&0<t.strstart&&(i=s[r=t.strstart-1])===s[++r]&&i===s[++r]&&i===s[++r]){o=t.strstart+S;do{}while(i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&r<o);t.match_length=S-(o-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=_?(n=a._tr_tally(t,1,t.match_length-_),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(N(t,!1),0===t.strm.avail_out))return D}return t.insert=0,e===u?(N(t,!0),0===t.strm.avail_out?O:L):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?D:A}(r,e):i[r.level].func(r,e);if(f!==O&&f!==L||(r.status=666),f===D||f===O)return 0===t.avail_out&&(r.last_flush=-1),h;if(f===A&&(1===e?a._tr_align(r):5!==e&&(a._tr_stored_block(r,0,0,!1),3===e&&(R(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),k(t),0===t.avail_out))return r.last_flush=-1,h}return e!==u?h:r.wrap<=0?1:(2===r.wrap?(B(r,255&t.adler),B(r,t.adler>>8&255),B(r,t.adler>>16&255),B(r,t.adler>>24&255),B(r,255&t.total_in),B(r,t.total_in>>8&255),B(r,t.total_in>>16&255),B(r,t.total_in>>24&255)):(F(r,t.adler>>>16),F(r,65535&t.adler)),k(t),0<r.wrap&&(r.wrap=-r.wrap),0!==r.pending?h:1)},n.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==T&&69!==e&&73!==e&&91!==e&&103!==e&&e!==E&&666!==e?I(t,p):(t.state=null,e===E?I(t,-3):h):p},n.deflateSetDictionary=function(t,e){var n,i,a,s,l,c,u,d,f=e.length;if(!t||!t.state)return p;if(2===(s=(n=t.state).wrap)||1===s&&n.status!==T||n.lookahead)return p;for(1===s&&(t.adler=o(t.adler,e,f,0)),n.wrap=0,f>=n.w_size&&(0===s&&(R(n.head),n.strstart=0,n.block_start=0,n.insert=0),d=new r.Buf8(n.w_size),r.arraySet(d,e,f-n.w_size,n.w_size,0),e=d,f=n.w_size),l=t.avail_in,c=t.next_in,u=t.input,t.avail_in=f,t.next_in=0,t.input=e,V(n);n.lookahead>=_;){for(i=n.strstart,a=n.lookahead-(_-1);n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+_-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++,--a;);n.strstart=i,n.lookahead=_-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=_-1,n.match_available=0,t.next_in=c,t.input=u,t.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(t,e,n){"use strict";e.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(t,e,n){"use strict";e.exports=function(t,e){var n,i,r,a,o,s,l,c,u,h,p,d,f,m,g,v,y,x,b,w,M,_,S,C,T;n=t.state,i=t.next_in,C=t.input,r=i+(t.avail_in-5),a=t.next_out,T=t.output,o=a-(e-t.avail_out),s=a+(t.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;t:do{f<15&&(d+=C[i++]<<f,f+=8,d+=C[i++]<<f,f+=8),x=m[d&v];e:for(;;){if(d>>>=b=x>>>24,f-=b,0==(b=x>>>16&255))T[a++]=65535&x;else{if(!(16&b)){if(0==(64&b)){x=m[(65535&x)+(d&(1<<b)-1)];continue e}if(32&b){n.mode=12;break t}t.msg="invalid literal/length code",n.mode=30;break t}w=65535&x,(b&=15)&&(f<b&&(d+=C[i++]<<f,f+=8),w+=d&(1<<b)-1,d>>>=b,f-=b),f<15&&(d+=C[i++]<<f,f+=8,d+=C[i++]<<f,f+=8),x=g[d&y];n:for(;;){if(d>>>=b=x>>>24,f-=b,!(16&(b=x>>>16&255))){if(0==(64&b)){x=g[(65535&x)+(d&(1<<b)-1)];continue n}t.msg="invalid distance code",n.mode=30;break t}if(M=65535&x,f<(b&=15)&&(d+=C[i++]<<f,(f+=8)<b&&(d+=C[i++]<<f,f+=8)),l<(M+=d&(1<<b)-1)){t.msg="invalid distance too far back",n.mode=30;break t}if(d>>>=b,f-=b,(b=a-o)<M){if(u<(b=M-b)&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if(S=p,(_=0)===h){if(_+=c-b,b<w){for(w-=b;T[a++]=p[_++],--b;);_=a-M,S=T}}else if(h<b){if(_+=c+h-b,(b-=h)<w){for(w-=b;T[a++]=p[_++],--b;);if(_=0,h<w){for(w-=b=h;T[a++]=p[_++],--b;);_=a-M,S=T}}}else if(_+=h-b,b<w){for(w-=b;T[a++]=p[_++],--b;);_=a-M,S=T}for(;2<w;)T[a++]=S[_++],T[a++]=S[_++],T[a++]=S[_++],w-=3;w&&(T[a++]=S[_++],1<w&&(T[a++]=S[_++]))}else{for(_=a-M;T[a++]=T[_++],T[a++]=T[_++],T[a++]=T[_++],2<(w-=3););w&&(T[a++]=T[_++],1<w&&(T[a++]=T[_++]))}break}}break}}while(i<r&&a<s);i-=w=f>>3,d&=(1<<(f-=w<<3))-1,t.next_in=i,t.next_out=a,t.avail_in=i<r?r-i+5:5-(i-r),t.avail_out=a<s?s-a+257:257-(a-s),n.hold=d,n.bits=f}},{}],12:[function(t,e,n){"use strict";var i=t("../utils/common"),r=t("./adler32"),a=t("./crc32"),o=t("./inffast"),s=t("./inftrees"),l=1,c=2,u=0,h=-2,p=1,d=852,f=592;function m(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function g(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=p,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new i.Buf32(d),e.distcode=e.distdyn=new i.Buf32(f),e.sane=1,e.back=-1,u):h}function v(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,g(t)):h}function y(t,e){var n,i;return t&&t.state?(i=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15<e)?h:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=n,i.wbits=e,v(t))):h}function x(t,e){var n,r;return t?(r=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 i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0},(t.state=r).window=null,(n=y(t,e))!==u&&(t.state=null),n):h}var b,w,M=!0;function _(t){if(M){var e;for(b=new i.Buf32(512),w=new i.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(s(l,t.lens,0,288,b,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;s(c,t.lens,0,32,w,0,t.work,{bits:5}),M=!1}t.lencode=b,t.lenbits=9,t.distcode=w,t.distbits=5}function S(t,e,n,r){var a,o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new i.Buf8(o.wsize)),r>=o.wsize?(i.arraySet(o.window,e,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(r<(a=o.wsize-o.wnext)&&(a=r),i.arraySet(o.window,e,n-r,a,o.wnext),(r-=a)?(i.arraySet(o.window,e,n-r,r,0),o.wnext=r,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(t){return x(t,15)},n.inflateInit2=x,n.inflate=function(t,e){var n,d,f,g,v,y,x,b,w,M,C,T,E,D,A,O,L,I,P,R,k,N,B,F,j=0,V=new i.Buf8(4),z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return h;12===(n=t.state).mode&&(n.mode=13),v=t.next_out,f=t.output,x=t.avail_out,g=t.next_in,d=t.input,y=t.avail_in,b=n.hold,w=n.bits,M=y,C=x,N=u;t:for(;;)switch(n.mode){case p:if(0===n.wrap){n.mode=13;break}for(;w<16;){if(0===y)break t;y--,b+=d[g++]<<w,w+=8}if(2&n.wrap&&35615===b){V[n.check=0]=255&b,V[1]=b>>>8&255,n.check=a(n.check,V,2,0),w=b=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&b)<<8)+(b>>8))%31){t.msg="incorrect header check",n.mode=30;break}if(8!=(15&b)){t.msg="unknown compression method",n.mode=30;break}if(w-=4,k=8+(15&(b>>>=4)),0===n.wbits)n.wbits=k;else if(k>n.wbits){t.msg="invalid window size",n.mode=30;break}n.dmax=1<<k,t.adler=n.check=1,n.mode=512&b?10:12,w=b=0;break;case 2:for(;w<16;){if(0===y)break t;y--,b+=d[g++]<<w,w+=8}if(n.flags=b,8!=(255&n.flags)){t.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=b>>8&1),512&n.flags&&(V[0]=255&b,V[1]=b>>>8&255,n.check=a(n.check,V,2,0)),w=b=0,n.mode=3;case 3:for(;w<32;){if(0===y)break t;y--,b+=d[g++]<<w,w+=8}n.head&&(n.head.time=b),512&n.flags&&(V[0]=255&b,V[1]=b>>>8&255,V[2]=b>>>16&255,V[3]=b>>>24&255,n.check=a(n.check,V,4,0)),w=b=0,n.mode=4;case 4:for(;w<16;){if(0===y)break t;y--,b+=d[g++]<<w,w+=8}n.head&&(n.head.xflags=255&b,n.head.os=b>>8),512&n.flags&&(V[0]=255&b,V[1]=b>>>8&255,n.check=a(n.check,V,2,0)),w=b=0,n.mode=5;case 5:if(1024&n.flags){for(;w<16;){if(0===y)break t;y--,b+=d[g++]<<w,w+=8}n.length=b,n.head&&(n.head.extra_len=b),512&n.flags&&(V[0]=255&b,V[1]=b>>>8&255,n.check=a(n.check,V,2,0)),w=b=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(y<(T=n.length)&&(T=y),T&&(n.head&&(k=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),i.arraySet(n.head.extra,d,g,T,k)),512&n.flags&&(n.check=a(n.check,d,T,g)),y-=T,g+=T,n.length-=T),n.length))break t;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===y)break t;for(T=0;k=d[g+T++],n.head&&k&&n.length<65536&&(n.head.name+=String.fromCharCode(k)),k&&T<y;);if(512&n.flags&&(n.check=a(n.check,d,T,g)),y-=T,g+=T,k)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===y)break t;for(T=0;k=d[g+T++],n.head&&k&&n.length<65536&&(n.head.comment+=String.fromCharCode(k)),k&&T<y;);if(512&n.flags&&(n.check=a(n.check,d,T,g)),y-=T,g+=T,k)break t}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;w<16;){if(0===y)break t;y--,b+=d[g++]<<w,w+=8}if(b!==(65535&n.check)){t.msg="header crc mismatch",n.mode=30;break}w=b=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=12;break;case 10:for(;w<32;){if(0===y)break t;y--,b+=d[g++]<<w,w+=8}t.adler=n.check=m(b),w=b=0,n.mode=11;case 11:if(0===n.havedict)return t.next_out=v,t.avail_out=x,t.next_in=g,t.avail_in=y,n.hold=b,n.bits=w,2;t.adler=n.check=1,n.mode=12;case 12:if(5===e||6===e)break t;case 13:if(n.last){b>>>=7&w,w-=7&w,n.mode=27;break}for(;w<3;){if(0===y)break t;y--,b+=d[g++]<<w,w+=8}switch(n.last=1&b,--w,3&(b>>>=1)){case 0:n.mode=14;break;case 1:if(_(n),n.mode=20,6!==e)break;b>>>=2,w-=2;break t;case 2:n.mode=17;break;case 3:t.msg="invalid block type",n.mode=30}b>>>=2,w-=2;break;case 14:for(b>>>=7&w,w-=7&w;w<32;){if(0===y)break t;y--,b+=d[g++]<<w,w+=8}if((65535&b)!=(b>>>16^65535)){t.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&b,w=b=0,n.mode=15,6===e)break t;case 15:n.mode=16;case 16:if(T=n.length){if(y<T&&(T=y),x<T&&(T=x),0===T)break t;i.arraySet(f,d,g,T,v),y-=T,g+=T,x-=T,v+=T,n.length-=T;break}n.mode=12;break;case 17:for(;w<14;){if(0===y)break t;y--,b+=d[g++]<<w,w+=8}if(n.nlen=257+(31&b),b>>>=5,w-=5,n.ndist=1+(31&b),b>>>=5,w-=5,n.ncode=4+(15&b),b>>>=4,w-=4,286<n.nlen||30<n.ndist){t.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(;w<3;){if(0===y)break t;y--,b+=d[g++]<<w,w+=8}n.lens[z[n.have++]]=7&b,b>>>=3,w-=3}for(;n.have<19;)n.lens[z[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,B={bits:n.lenbits},N=s(0,n.lens,0,19,n.lencode,0,n.work,B),n.lenbits=B.bits,N){t.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(;O=(j=n.lencode[b&(1<<n.lenbits)-1])>>>16&255,L=65535&j,!((A=j>>>24)<=w);){if(0===y)break t;y--,b+=d[g++]<<w,w+=8}if(L<16)b>>>=A,w-=A,n.lens[n.have++]=L;else{if(16===L){for(F=A+2;w<F;){if(0===y)break t;y--,b+=d[g++]<<w,w+=8}if(b>>>=A,w-=A,0===n.have){t.msg="invalid bit length repeat",n.mode=30;break}k=n.lens[n.have-1],T=3+(3&b),b>>>=2,w-=2}else if(17===L){for(F=A+3;w<F;){if(0===y)break t;y--,b+=d[g++]<<w,w+=8}w-=A,k=0,T=3+(7&(b>>>=A)),b>>>=3,w-=3}else{for(F=A+7;w<F;){if(0===y)break t;y--,b+=d[g++]<<w,w+=8}w-=A,k=0,T=11+(127&(b>>>=A)),b>>>=7,w-=7}if(n.have+T>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=30;break}for(;T--;)n.lens[n.have++]=k}}if(30===n.mode)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,B={bits:n.lenbits},N=s(l,n.lens,0,n.nlen,n.lencode,0,n.work,B),n.lenbits=B.bits,N){t.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,B={bits:n.distbits},N=s(c,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,B),n.distbits=B.bits,N){t.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===e)break t;case 20:n.mode=21;case 21:if(6<=y&&258<=x){t.next_out=v,t.avail_out=x,t.next_in=g,t.avail_in=y,n.hold=b,n.bits=w,o(t,C),v=t.next_out,f=t.output,x=t.avail_out,g=t.next_in,d=t.input,y=t.avail_in,b=n.hold,w=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;O=(j=n.lencode[b&(1<<n.lenbits)-1])>>>16&255,L=65535&j,!((A=j>>>24)<=w);){if(0===y)break t;y--,b+=d[g++]<<w,w+=8}if(O&&0==(240&O)){for(I=A,P=O,R=L;O=(j=n.lencode[R+((b&(1<<I+P)-1)>>I)])>>>16&255,L=65535&j,!(I+(A=j>>>24)<=w);){if(0===y)break t;y--,b+=d[g++]<<w,w+=8}b>>>=I,w-=I,n.back+=I}if(b>>>=A,w-=A,n.back+=A,n.length=L,0===O){n.mode=26;break}if(32&O){n.back=-1,n.mode=12;break}if(64&O){t.msg="invalid literal/length code",n.mode=30;break}n.extra=15&O,n.mode=22;case 22:if(n.extra){for(F=n.extra;w<F;){if(0===y)break t;y--,b+=d[g++]<<w,w+=8}n.length+=b&(1<<n.extra)-1,b>>>=n.extra,w-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;O=(j=n.distcode[b&(1<<n.distbits)-1])>>>16&255,L=65535&j,!((A=j>>>24)<=w);){if(0===y)break t;y--,b+=d[g++]<<w,w+=8}if(0==(240&O)){for(I=A,P=O,R=L;O=(j=n.distcode[R+((b&(1<<I+P)-1)>>I)])>>>16&255,L=65535&j,!(I+(A=j>>>24)<=w);){if(0===y)break t;y--,b+=d[g++]<<w,w+=8}b>>>=I,w-=I,n.back+=I}if(b>>>=A,w-=A,n.back+=A,64&O){t.msg="invalid distance code",n.mode=30;break}n.offset=L,n.extra=15&O,n.mode=24;case 24:if(n.extra){for(F=n.extra;w<F;){if(0===y)break t;y--,b+=d[g++]<<w,w+=8}n.offset+=b&(1<<n.extra)-1,b>>>=n.extra,w-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===x)break t;if(T=C-x,n.offset>T){if((T=n.offset-T)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=30;break}E=T>n.wnext?(T-=n.wnext,n.wsize-T):n.wnext-T,T>n.length&&(T=n.length),D=n.window}else D=f,E=v-n.offset,T=n.length;for(x<T&&(T=x),x-=T,n.length-=T;f[v++]=D[E++],--T;);0===n.length&&(n.mode=21);break;case 26:if(0===x)break t;f[v++]=n.length,x--,n.mode=21;break;case 27:if(n.wrap){for(;w<32;){if(0===y)break t;y--,b|=d[g++]<<w,w+=8}if(C-=x,t.total_out+=C,n.total+=C,C&&(t.adler=n.check=(n.flags?a:r)(n.check,f,C,v-C)),C=x,(n.flags?b:m(b))!==n.check){t.msg="incorrect data check",n.mode=30;break}w=b=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;w<32;){if(0===y)break t;y--,b+=d[g++]<<w,w+=8}if(b!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=30;break}w=b=0}n.mode=29;case 29:N=1;break t;case 30:N=-3;break t;case 31:return-4;case 32:default:return h}return t.next_out=v,t.avail_out=x,t.next_in=g,t.avail_in=y,n.hold=b,n.bits=w,(n.wsize||C!==t.avail_out&&n.mode<30&&(n.mode<27||4!==e))&&S(t,t.output,t.next_out,C-t.avail_out)?(n.mode=31,-4):(M-=t.avail_in,C-=t.avail_out,t.total_in+=M,t.total_out+=C,n.total+=C,n.wrap&&C&&(t.adler=n.check=(n.flags?a:r)(n.check,f,C,t.next_out-C)),t.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0==M&&0===C||4===e)&&N===u&&(N=-5),N)},n.inflateEnd=function(t){if(!t||!t.state)return h;var e=t.state;return e.window&&(e.window=null),t.state=null,u},n.inflateGetHeader=function(t,e){var n;return t&&t.state&&0!=(2&(n=t.state).wrap)?((n.head=e).done=!1,u):h},n.inflateSetDictionary=function(t,e){var n,i=e.length;return!t||!t.state||0!==(n=t.state).wrap&&11!==n.mode?h:11===n.mode&&r(1,e,i,0)!==n.check?-3:S(t,e,i,i)?(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(t,e,n){"use strict";var i=t("../utils/common"),r=[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];e.exports=function(t,e,n,l,c,u,h,p){var d,f,m,g,v,y,x,b,w,M=p.bits,_=0,S=0,C=0,T=0,E=0,D=0,A=0,O=0,L=0,I=0,P=null,R=0,k=new i.Buf16(16),N=new i.Buf16(16),B=null,F=0;for(_=0;_<=15;_++)k[_]=0;for(S=0;S<l;S++)k[e[n+S]]++;for(E=M,T=15;1<=T&&0===k[T];T--);if(T<E&&(E=T),0===T)return c[u++]=20971520,c[u++]=20971520,p.bits=1,0;for(C=1;C<T&&0===k[C];C++);for(E<C&&(E=C),_=O=1;_<=15;_++)if(O<<=1,(O-=k[_])<0)return-1;if(0<O&&(0===t||1!==T))return-1;for(N[1]=0,_=1;_<15;_++)N[_+1]=N[_]+k[_];for(S=0;S<l;S++)0!==e[n+S]&&(h[N[e[n+S]]++]=S);if(y=0===t?(P=B=h,19):1===t?(P=r,R-=257,B=a,F-=257,256):(P=o,B=s,-1),_=C,v=u,A=S=I=0,m=-1,g=(L=1<<(D=E))-1,1===t&&852<L||2===t&&592<L)return 1;for(;;){for(x=_-A,w=h[S]<y?(b=0,h[S]):h[S]>y?(b=B[F+h[S]],P[R+h[S]]):(b=96,0),d=1<<_-A,C=f=1<<D;c[v+(I>>A)+(f-=d)]=x<<24|b<<16|w|0,0!==f;);for(d=1<<_-1;I&d;)d>>=1;if(0!==d?(I&=d-1,I+=d):I=0,S++,0==--k[_]){if(_===T)break;_=e[n+h[S]]}if(E<_&&(I&g)!==m){for(0===A&&(A=E),v+=C,O=1<<(D=_-A);D+A<T&&!((O-=k[D+A])<=0);)D++,O<<=1;if(L+=1<<D,1===t&&852<L||2===t&&592<L)return 1;c[m=I&g]=E<<24|D<<16|v-u|0}}return 0!==I&&(c[v+I]=_-A<<24|64<<16|0),p.bits=E,0}},{"../utils/common":4}],14:[function(t,e,n){"use strict";e.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(t,e,n){"use strict";var i=t("../utils/common");function r(t){for(var e=t.length;0<=--e;)t[e]=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],b=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],w=new Array(2*(s+2));r(w);var M=new Array(2*l);r(M);var _=new Array(512);r(_);var S=new Array(256);r(S);var C=new Array(29);r(C);var T,E,D,A=new Array(l);function O(t,e,n,i,r){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=t&&t.length}function L(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function I(t){return t<256?_[t]:_[256+(t>>>7)]}function P(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function R(t,e,n){t.bi_valid>p-n?(t.bi_buf|=e<<t.bi_valid&65535,P(t,t.bi_buf),t.bi_buf=e>>p-t.bi_valid,t.bi_valid+=n-p):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)}function k(t,e,n){R(t,n[2*e],n[2*e+1])}function N(t,e){for(var n=0;n|=1&t,t>>>=1,n<<=1,0<--e;);return n>>>1}function B(t,e,n){var i,r,a=new Array(h+1),o=0;for(i=1;i<=h;i++)a[i]=o=o+n[i-1]<<1;for(r=0;r<=e;r++){var s=t[2*r+1];0!==s&&(t[2*r]=N(a[s]++,s))}}function F(t){var e;for(e=0;e<s;e++)t.dyn_ltree[2*e]=0;for(e=0;e<l;e++)t.dyn_dtree[2*e]=0;for(e=0;e<c;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*d]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function j(t){8<t.bi_valid?P(t,t.bi_buf):0<t.bi_valid&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function V(t,e,n,i){var r=2*e,a=2*n;return t[r]<t[a]||t[r]===t[a]&&i[e]<=i[n]}function z(t,e,n){for(var i=t.heap[n],r=n<<1;r<=t.heap_len&&(r<t.heap_len&&V(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!V(e,i,t.heap[r],t.depth));)t.heap[n]=t.heap[r],n=r,r<<=1;t.heap[n]=i}function G(t,e,n){var i,r,a,s,l=0;if(0!==t.last_lit)for(;i=t.pending_buf[t.d_buf+2*l]<<8|t.pending_buf[t.d_buf+2*l+1],r=t.pending_buf[t.l_buf+l],l++,0===i?k(t,r,e):(k(t,(a=S[r])+o+1,e),0!==(s=v[a])&&R(t,r-=C[a],s),k(t,a=I(--i),n),0!==(s=y[a])&&R(t,i-=A[a],s)),l<t.last_lit;);k(t,d,e)}function U(t,e){var n,i,r,a=e.dyn_tree,o=e.stat_desc.static_tree,s=e.stat_desc.has_stree,l=e.stat_desc.elems,c=-1;for(t.heap_len=0,t.heap_max=u,n=0;n<l;n++)0!==a[2*n]?(t.heap[++t.heap_len]=c=n,t.depth[n]=0):a[2*n+1]=0;for(;t.heap_len<2;)a[2*(r=t.heap[++t.heap_len]=c<2?++c:0)]=1,t.depth[r]=0,t.opt_len--,s&&(t.static_len-=o[2*r+1]);for(e.max_code=c,n=t.heap_len>>1;1<=n;n--)z(t,a,n);for(r=l;n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],z(t,a,1),i=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=i,a[2*r]=a[2*n]+a[2*i],t.depth[r]=(t.depth[n]>=t.depth[i]?t.depth[n]:t.depth[i])+1,a[2*n+1]=a[2*i+1]=r,t.heap[1]=r++,z(t,a,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var n,i,r,a,o,s,l=e.dyn_tree,c=e.max_code,p=e.stat_desc.static_tree,d=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,m=e.stat_desc.extra_base,g=e.stat_desc.max_length,v=0;for(a=0;a<=h;a++)t.bl_count[a]=0;for(l[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;n<u;n++)g<(a=l[2*l[2*(i=t.heap[n])+1]+1]+1)&&(a=g,v++),l[2*i+1]=a,c<i||(t.bl_count[a]++,o=0,m<=i&&(o=f[i-m]),s=l[2*i],t.opt_len+=s*(a+o),d&&(t.static_len+=s*(p[2*i+1]+o)));if(0!==v){do{for(a=g-1;0===t.bl_count[a];)a--;t.bl_count[a]--,t.bl_count[a+1]+=2,t.bl_count[g]--,v-=2}while(0<v);for(a=g;0!==a;a--)for(i=t.bl_count[a];0!==i;)c<(r=t.heap[--n])||(l[2*r+1]!==a&&(t.opt_len+=(a-l[2*r+1])*l[2*r],l[2*r+1]=a),i--)}}(t,e),B(a,c,t.bl_count)}function H(t,e,n){var i,r,a=-1,o=e[1],s=0,l=7,c=4;for(0===o&&(l=138,c=3),e[2*(n+1)+1]=65535,i=0;i<=n;i++)r=o,o=e[2*(i+1)+1],++s<l&&r===o||(s<c?t.bl_tree[2*r]+=s:0!==r?(r!==a&&t.bl_tree[2*r]++,t.bl_tree[2*f]++):s<=10?t.bl_tree[2*m]++:t.bl_tree[2*g]++,a=r,c=(s=0)===o?(l=138,3):r===o?(l=6,3):(l=7,4))}function W(t,e,n){var i,r,a=-1,o=e[1],s=0,l=7,c=4;for(0===o&&(l=138,c=3),i=0;i<=n;i++)if(r=o,o=e[2*(i+1)+1],!(++s<l&&r===o)){if(s<c)for(;k(t,r,t.bl_tree),0!=--s;);else 0!==r?(r!==a&&(k(t,r,t.bl_tree),s--),k(t,f,t.bl_tree),R(t,s-3,2)):s<=10?(k(t,m,t.bl_tree),R(t,s-3,3)):(k(t,g,t.bl_tree),R(t,s-11,7));a=r,c=(s=0)===o?(l=138,3):r===o?(l=6,3):(l=7,4)}}r(A);var J=!1;function q(t,e,n,r){var o,s,l;R(t,(a<<1)+(r?1:0),3),s=e,l=n,j(o=t),P(o,l),P(o,~l),i.arraySet(o.pending_buf,o.window,s,l,o.pending),o.pending+=l}n._tr_init=function(t){J||(function(){var t,e,n,i,r,a=new Array(h+1);for(i=n=0;i<28;i++)for(C[i]=n,t=0;t<1<<v[i];t++)S[n++]=i;for(S[n-1]=i,i=r=0;i<16;i++)for(A[i]=r,t=0;t<1<<y[i];t++)_[r++]=i;for(r>>=7;i<l;i++)for(A[i]=r<<7,t=0;t<1<<y[i]-7;t++)_[256+r++]=i;for(e=0;e<=h;e++)a[e]=0;for(t=0;t<=143;)w[2*t+1]=8,t++,a[8]++;for(;t<=255;)w[2*t+1]=9,t++,a[9]++;for(;t<=279;)w[2*t+1]=7,t++,a[7]++;for(;t<=287;)w[2*t+1]=8,t++,a[8]++;for(B(w,s+1,a),t=0;t<l;t++)M[2*t+1]=5,M[2*t]=N(t,5);T=new O(w,v,o+1,s,h),E=new O(M,y,0,l,h),D=new O(new Array(0),x,0,c,7)}(),J=!0),t.l_desc=new L(t.dyn_ltree,T),t.d_desc=new L(t.dyn_dtree,E),t.bl_desc=new L(t.bl_tree,D),t.bi_buf=0,t.bi_valid=0,F(t)},n._tr_stored_block=q,n._tr_flush_block=function(t,e,n,i){var r,a,s=0;0<t.level?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<o;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),U(t,t.l_desc),U(t,t.d_desc),s=function(t){var e;for(H(t,t.dyn_ltree,t.l_desc.max_code),H(t,t.dyn_dtree,t.d_desc.max_code),U(t,t.bl_desc),e=c-1;3<=e&&0===t.bl_tree[2*b[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(a=t.static_len+3+7>>>3)<=r&&(r=a)):r=a=n+5,n+4<=r&&-1!==e?q(t,e,n,i):4===t.strategy||a===r?(R(t,2+(i?1:0),3),G(t,w,M)):(R(t,4+(i?1:0),3),function(t,e,n,i){var r;for(R(t,e-257,5),R(t,n-1,5),R(t,i-4,4),r=0;r<i;r++)R(t,t.bl_tree[2*b[r]+1],3);W(t,t.dyn_ltree,e-1),W(t,t.dyn_dtree,n-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),G(t,t.dyn_ltree,t.dyn_dtree)),F(t),i&&j(t)},n._tr_tally=function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(S[n]+o+1)]++,t.dyn_dtree[2*I(e)]++),t.last_lit===t.lit_bufsize-1},n._tr_align=function(t){var e;R(t,2,3),k(t,d,w),16===(e=t).bi_valid?(P(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}},{"../utils/common":4}],16:[function(t,e,n){"use strict";e.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(t,e,n){var i=t("three");i.OrbitControls=function(t,e){var n,r,a,o,s;void 0===e&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),e===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=t,this.domElement=e,this.enabled=!0,this.target=new i.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:i.MOUSE.ROTATE,MIDDLE:i.MOUSE.DOLLY,RIGHT:i.MOUSE.PAN},this.touches={ONE:i.TOUCH.ROTATE,TWO:i.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.resetStatusValue=function(){d=p.NONE},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 i.Vector3,r=(new i.Quaternion).setFromUnitVectors(t.up,new i.Vector3(0,1,0)),a=r.clone().inverse(),o=new i.Vector3,s=new i.Quaternion,function(){var t=l.object.position;return n.copy(t).sub(l.target),n.applyQuaternion(r),m.setFromVector3(n),l.autoRotate&&d===p.NONE&&O(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),t.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",et,!1),l.domElement.removeEventListener("mousedown",q,!1),l.domElement.removeEventListener("wheel",Z,!1),l.domElement.removeEventListener("touchstart",K,!1),l.domElement.removeEventListener("touchend",tt,!1),l.domElement.removeEventListener("touchmove",Q,!1),document.removeEventListener("mousemove",X,!1),document.removeEventListener("mouseup",Y,!1),l.domElement.removeEventListener("keydown",$,!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 i.Spherical,g=new i.Spherical,v=1,y=new i.Vector3,x=!1,b=new i.Vector2,w=new i.Vector2,M=new i.Vector2,_=new i.Vector2,S=new i.Vector2,C=new i.Vector2,T=new i.Vector2,E=new i.Vector2,D=new i.Vector2;function A(){return Math.pow(.95,l.zoomSpeed)}function O(t){g.theta-=t}function L(t){g.phi-=t}var I,P,R,k=(I=new i.Vector3,function(t,e){I.setFromMatrixColumn(e,0),I.multiplyScalar(-t),y.add(I)}),N=(P=new i.Vector3,function(t,e){!0===l.screenSpacePanning?P.setFromMatrixColumn(e,1):(P.setFromMatrixColumn(e,0),P.crossVectors(l.object.up,P)),P.multiplyScalar(t),y.add(P)}),B=(R=new i.Vector3,function(t,e){var n=l.domElement;if(l.object.isPerspectiveCamera){var i=l.object.position;R.copy(i).sub(l.target);var r=R.length();r*=Math.tan(l.object.fov/2*Math.PI/180),k(2*t*r/n.clientHeight,l.object.matrix),N(2*e*r/n.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(k(t*(l.object.right-l.object.left)/l.object.zoom/n.clientWidth,l.object.matrix),N(e*(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(t){l.object.isPerspectiveCamera?v/=t:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*t)),l.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function j(t){b.set(t.clientX,t.clientY)}function V(t){_.set(t.clientX,t.clientY)}function z(t){if(1==t.touches.length)b.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),n=.5*(t.touches[0].pageY+t.touches[1].pageY);b.set(e,n)}}function G(t){if(1==t.touches.length)_.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),n=.5*(t.touches[0].pageY+t.touches[1].pageY);_.set(e,n)}}function U(t){var e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,i=Math.sqrt(e*e+n*n);T.set(0,i)}function H(t){if(1==t.touches.length)w.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),n=.5*(t.touches[0].pageY+t.touches[1].pageY);w.set(e,n)}M.subVectors(w,b).multiplyScalar(l.rotateSpeed);var i=l.domElement;O(2*Math.PI*M.x/i.clientHeight),L(2*Math.PI*M.y/i.clientHeight),b.copy(w)}function W(t){if(1==t.touches.length)S.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),n=.5*(t.touches[0].pageY+t.touches[1].pageY);S.set(e,n)}C.subVectors(S,_).multiplyScalar(l.panSpeed),B(C.x,C.y),_.copy(S)}function J(t){var e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,i=Math.sqrt(e*e+n*n);E.set(0,i),D.set(0,Math.pow(E.y/T.y,l.zoomSpeed)),F(D.y),T.copy(E)}function q(t){if(!1!==l.enabled){switch(t.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),t.button){case 0:switch(l.mouseButtons.LEFT){case i.MOUSE.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===l.enablePan)return;V(t),d=p.PAN}else{if(!1===l.enableRotate)return;j(t),d=p.ROTATE}break;case i.MOUSE.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===l.enableRotate)return;j(t),d=p.ROTATE}else{if(!1===l.enablePan)return;V(t),d=p.PAN}break;default:d=p.NONE}break;case 1:switch(l.mouseButtons.MIDDLE){case i.MOUSE.DOLLY:if(!1===l.enableZoom)return;e=t,T.set(e.clientX,e.clientY),d=p.DOLLY;break;case i.MOUSE.PAN:if(!1===l.enablePan)return;V(t),d=p.PAN;break;default:d=p.NONE}break;case 2:switch(l.mouseButtons.RIGHT){case i.MOUSE.ROTATE:if(!1===l.enableRotate)return;j(t),d=p.ROTATE;break;case i.MOUSE.PAN:if(!1===l.enablePan)return;V(t),d=p.PAN;break;default:d=p.NONE}}var e;d!==p.NONE&&(document.addEventListener("mousemove",X,!1),document.addEventListener("mouseup",Y,!1),l.dispatchEvent(u))}}function X(t){var e;if(!1!==l.enabled)switch(t.preventDefault(),d){case p.ROTATE:if(!1===l.enableRotate)return;!function(t){w.set(t.clientX,t.clientY),M.subVectors(w,b).multiplyScalar(l.rotateSpeed);var e=l.domElement;O(2*Math.PI*M.x/e.clientHeight),L(2*Math.PI*M.y/e.clientHeight),b.copy(w),l.update()}(t);break;case p.DOLLY:if(!1===l.enableZoom)return;!function(t){var e;E.set(t.clientX,t.clientY),D.subVectors(E,T),0<D.y?F(A()):D.y<0&&(e=A(),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)),T.copy(E),l.update()}(t);break;case p.PAN:if(!1===l.enablePan)return;e=t,S.set(e.clientX,e.clientY),C.subVectors(S,_).multiplyScalar(l.panSpeed),B(C.x,C.y),_.copy(S),l.update()}}function Y(t){!1!==l.enabled&&(document.removeEventListener("mousemove",X,!1),document.removeEventListener("mouseup",Y,!1),l.dispatchEvent(h),d=p.NONE)}function Z(t){!1===l.enabled||!1===l.enableZoom||d!==p.NONE&&d!==p.ROTATE||(t.preventDefault(),t.stopPropagation(),l.dispatchEvent(u),function(t){t.deltaY<0?function(t,e){if(l.object.isPerspectiveCamera)f*=t;else if(l.object.isOrthographicCamera){var n=l.domElement.clientWidth,r=l.domElement.clientHeight,a=(l.object.near+l.object.far)/(l.object.near-l.object.far),o=e.offsetX,s=e.offsetY,c=new i.Vector3(o/n*2-1,-s/r*2+1,a);c.applyMatrix4(l.object.projectionMatrixInverse);var u=new i.Vector3(-1,-1,a),h=new i.Vector3(1,1,a);u.applyMatrix4(l.object.projectionMatrixInverse),h.applyMatrix4(l.object.projectionMatrixInverse);var p=Math.max(l.minZoom,Math.min(l.maxZoom,1/t)),d=new i.Matrix4;d.makeTranslation(-c.x,-c.y,0);var f=(new i.Matrix4).scale(new i.Vector3(1/p,1/p,1/p)),m=new i.Matrix4;m.makeTranslation(c.x,c.y,0);var g=(new i.Matrix4).multiply(m).multiply(f).multiply(d);u.applyMatrix4(g),h.applyMatrix4(g),l.object.left=u.x,l.object.right=h.x,l.object.top=h.y,l.object.bottom=u.y,l.object.zoom=1,l.object.updateProjectionMatrix(),x=!0}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1}(A(),t):0<t.deltaY&&function(t,e){if(l.object.isPerspectiveCamera)f/=t;else if(l.object.isOrthographicCamera){var n=l.domElement.clientWidth,r=l.domElement.clientHeight,a=(l.object.near+l.object.far)/(l.object.near-l.object.far),o=e.offsetX,s=e.offsetY,c=new i.Vector3(o/n*2-1,-s/r*2+1,a);c.applyMatrix4(l.object.projectionMatrixInverse);var u=new i.Vector3(-1,-1,a),h=new i.Vector3(1,1,a);u.applyMatrix4(l.object.projectionMatrixInverse),h.applyMatrix4(l.object.projectionMatrixInverse);var p=Math.max(l.minZoom,Math.min(l.maxZoom,t)),d=new i.Matrix4;d.makeTranslation(-c.x,-c.y,0);var f=(new i.Matrix4).scale(new i.Vector3(1/p,1/p,1/p)),m=new i.Matrix4;m.makeTranslation(c.x,c.y,0);var g=(new i.Matrix4).multiply(m).multiply(f).multiply(d);u.applyMatrix4(g),h.applyMatrix4(g),l.object.left=u.x,l.object.right=h.x,l.object.top=h.y,l.object.bottom=u.y,l.object.zoom=1,l.object.updateProjectionMatrix(),x=!0}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1}(A(),t),l.update()}(t),l.dispatchEvent(h))}function $(t){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(t){var e=!1;switch(t.keyCode){case l.keys.UP:B(0,l.keyPanSpeed),e=!0;break;case l.keys.BOTTOM:B(0,-l.keyPanSpeed),e=!0;break;case l.keys.LEFT:B(l.keyPanSpeed,0),e=!0;break;case l.keys.RIGHT:B(-l.keyPanSpeed,0),e=!0}e&&(t.preventDefault(),l.update())}(t)}function K(t){if(!1!==l.enabled){switch(t.preventDefault(),t.touches.length){case 1:switch(l.touches.ONE){case i.TOUCH.ROTATE:if(!1===l.enableRotate)return;z(t),d=p.TOUCH_ROTATE;break;case i.TOUCH.PAN:if(!1===l.enablePan)return;G(t),d=p.TOUCH_PAN;break;default:d=p.NONE}break;case 2:switch(l.touches.TWO){case i.TOUCH.DOLLY_PAN:if(!1===l.enableZoom&&!1===l.enablePan)return;n=t,l.enableZoom&&U(n),l.enablePan&&G(n),d=p.TOUCH_DOLLY_PAN;break;case i.TOUCH.DOLLY_ROTATE:if(!1===l.enableZoom&&!1===l.enableRotate)return;e=t,l.enableZoom&&U(e),l.enableRotate&&z(e),d=p.TOUCH_DOLLY_ROTATE;break;default:d=p.NONE}break;default:d=p.NONE}var e,n;d!==p.NONE&&l.dispatchEvent(u)}}function Q(t){var e,n;if(!1!==l.enabled)switch(t.preventDefault(),t.stopPropagation(),d){case p.TOUCH_ROTATE:if(!1===l.enableRotate)return;H(t),l.update();break;case p.TOUCH_PAN:if(!1===l.enablePan)return;W(t),l.update();break;case p.TOUCH_DOLLY_PAN:if(!1===l.enableZoom&&!1===l.enablePan)return;n=t,l.enableZoom&&J(n),l.enablePan&&W(n),l.update();break;case p.TOUCH_DOLLY_ROTATE:if(!1===l.enableZoom&&!1===l.enableRotate)return;e=t,l.enableZoom&&J(e),l.enableRotate&&H(e),l.update();break;default:d=p.NONE}}function tt(t){!1!==l.enabled&&(l.dispatchEvent(h),d=p.NONE)}function et(t){!1!==l.enabled&&t.preventDefault()}l.domElement.addEventListener("contextmenu",et,!1),l.domElement.addEventListener("mousedown",q,!1),l.domElement.addEventListener("wheel",Z,!1),l.domElement.addEventListener("touchstart",K,!1),l.domElement.addEventListener("touchend",tt,!1),l.domElement.addEventListener("touchmove",Q,!1),l.domElement.addEventListener("keydown",$,!1),-1===l.domElement.tabIndex&&(l.domElement.tabIndex=0),this.update()},i.OrbitControls.prototype=Object.create(i.EventDispatcher.prototype),i.OrbitControls.prototype.constructor=i.OrbitControls,i.MapControls=function(t,e){i.OrbitControls.call(this,t,e),this.mouseButtons.LEFT=i.MOUSE.PAN,this.mouseButtons.RIGHT=i.MOUSE.ROTATE,this.touches.ONE=i.TOUCH.PAN,this.touches.TWO=i.TOUCH.DOLLY_ROTATE},i.MapControls.prototype=Object.create(i.EventDispatcher.prototype),i.MapControls.prototype.constructor=i.MapControls,void 0!==n&&(void 0!==e&&e.exports&&(n=e.exports={OrbitControls:i.OrbitControls,MapControls:i.MapControls}),n.OrbitControls=i.OrbitControls,n.MapControls=i.MapControls)},{three:19}],18:[function(t,e,n){(function(){"use strict";var i,r,a,o=void 0!==t,s=this.THREE||o&&t("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(t,e,n,i,r){var a;if(t=t.subarray||t.slice?t:t.buffer,n=n.subarray||n.slice?n:n.buffer,t=e?t.subarray?t.subarray(e,r&&e+r):t.slice(e,r&&e+r):t,n.set)n.set(t,i);else for(a=0;a<t.length;a++)n[a+i]=t[a];return n}function u(t){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(t){this.uniforms.lineWidth.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(t){this.uniforms.useMap.value=t}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(t){this.uniforms.alphaMap.value=t}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(t){this.uniforms.useAlphaMap.value=t}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(t){this.uniforms.color.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(t){this.uniforms.sizeAttenuation.value=t}},near:{enumerable:!0,get:function(){return this.uniforms.near.value},set:function(t){this.uniforms.near.value=t}},far:{enumerable:!0,get:function(){return this.uniforms.far.value},set:function(t){this.uniforms.far.value=t}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(t){this.uniforms.dashArray.value=t,this.useDash=0!==t?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(t){this.uniforms.dashRatio.value=t}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(t){this.uniforms.useDash.value=t}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(t){this.uniforms.visibility.value=t}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(t){this.uniforms.alphaTest.value=t}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(t){this.uniforms.repeat.value.copy(t)}}}),this.setValues(t)}l.prototype.setMatrixWorld=function(t){this.matrixWorld=t},l.prototype.setGeometry=function(t,e){if(this.widthCallback=e,this.positions=[],this.counters=[],t instanceof s.Geometry)for(var n=0;n<t.vertices.length;n++){var i=t.vertices[n];e=n/t.vertices.length,this.positions.push(i.x,i.y,i.z),this.positions.push(i.x,i.y,i.z),this.counters.push(e),this.counters.push(e)}if(s.BufferGeometry,t instanceof Float32Array||t instanceof Array)for(n=0;n<t.length;n+=3)e=n/t.length,this.positions.push(t[n],t[n+1],t[n+2]),this.positions.push(t[n],t[n+1],t[n+2]),this.counters.push(e),this.counters.push(e);this.process()},l.prototype.raycast=(i=new s.Matrix4,r=new s.Ray,a=new s.Sphere,function(t,e){var n=t.linePrecision,o=n*n,l=this.geometry;if(null===l.boundingSphere&&l.computeBoundingSphere(),a.copy(l.boundingSphere),a.applyMatrix4(this.matrixWorld),!1!==t.ray.intersectSphere(a)){i.getInverse(this.matrixWorld),r.copy(t.ray).applyMatrix4(i);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 b=g[y],w=g[y+1];c.fromArray(v,3*b),u.fromArray(v,3*w),o<r.distanceSqToSegment(c,u,p,h)||(p.applyMatrix4(this.matrixWorld),(S=t.ray.origin.distanceTo(p))<t.near||S>t.far||e.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<r.distanceSqToSegment(c,u,p,h)||(p.applyMatrix4(this.matrixWorld),(S=t.ray.origin.distanceTo(p))<t.near||S>t.far||e.push({distance:S,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this}))}else if(l instanceof s.Geometry){var M=l.vertices,_=M.length;for(y=0;y<_-1;y+=d){var S;o<r.distanceSqToSegment(M[y],M[y+1],p,h)||(p.applyMatrix4(this.matrixWorld),(S=t.ray.origin.distanceTo(p))<t.near||S>t.far||e.push({distance:S,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this}))}}}}),l.prototype.compareV3=function(t,e){var n=6*t,i=6*e;return this.positions[n]===this.positions[i]&&this.positions[1+n]===this.positions[1+i]&&this.positions[2+n]===this.positions[2+i]},l.prototype.copyV3=function(t){var e=6*t;return[this.positions[e],this.positions[1+e],this.positions[2+e]]},l.prototype.process=function(){var t,e,n=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];for(var i=0;i<n;i++)this.side.push(1),this.side.push(-1);for(i=0;i<n;i++)t=this.widthCallback?this.widthCallback(i/(n-1)):1,this.width.push(t),this.width.push(t);for(i=0;i<n;i++)this.uvs.push(i/(n-1),0),this.uvs.push(i/(n-1),1);for(e=this.compareV3(0,n-1)?this.copyV3(n-2):this.copyV3(0),this.previous.push(e[0],e[1],e[2]),this.previous.push(e[0],e[1],e[2]),i=0;i<n-1;i++)e=this.copyV3(i),this.previous.push(e[0],e[1],e[2]),this.previous.push(e[0],e[1],e[2]);for(i=1;i<n;i++)e=this.copyV3(i),this.next.push(e[0],e[1],e[2]),this.next.push(e[0],e[1],e[2]);for(e=this.compareV3(n-1,0)?this.copyV3(1):this.copyV3(n-1),this.next.push(e[0],e[1],e[2]),this.next.push(e[0],e[1],e[2]),i=0;i<n-1;i++){var r=2*i;this.indices_array.push(r,1+r,2+r),this.indices_array.push(2+r,1+r,3+r)}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(t){var e=this.attributes.position.array,n=this.attributes.previous.array,i=this.attributes.next.array,r=e.length;c(e,0,n,0,r),c(e,6,e,0,r-6),e[r-6]=t.x,e[r-5]=t.y,e[r-4]=t.z,e[r-3]=t.x,e[r-2]=t.y,e[r-1]=t.z,c(e,6,i,0,r-6),i[r-6]=t.x,i[r-5]=t.y,i[r-4]=t.z,i[r-3]=t.x,i[r-2]=t.y,i[r-1]=t.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(t){return s.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.near=t.near,this.far=t.far,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this},void 0!==n?(void 0!==e&&e.exports&&(n=e.exports={MeshLine:l,MeshLineMaterial:u}),n.MeshLine=l,n.MeshLineMaterial=u):(this.MeshLine=l,this.MeshLineMaterial=u)}).call(this)},{three:19}],19:[function(t,e,n){var i,r;i=this,r=function(t){"use strict";void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:0<t?1:+t}),"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(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e});var e=0,n=1,i=2,r=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,b=102,w=103,M=104,_=200,S=201,C=202,T=203,E=204,D=205,A=206,O=207,L=208,I=209,P=210,R=0,k=1,N=2,B=3,F=4,j=5,V=6,z=7,G=0,U=1,H=2,W=0,J=1,q=2,X=3,Y=4,Z=5,$=301,K=302,Q=303,tt=304,et=305,nt=306,it=307,rt=1e3,at=1001,ot=1002,st=1003,lt=1004,ct=1005,ut=1006,ht=1007,pt=1008,dt=1009,ft=1010,mt=1011,gt=1012,vt=1013,yt=1014,xt=1015,bt=1016,wt=1017,Mt=1018,_t=1019,St=1020,Ct=1021,Tt=1022,Et=1023,Dt=1024,At=1025,Ot=Et,Lt=1026,It=1027,Pt=1028,Rt=1029,kt=1030,Nt=1031,Bt=1032,Ft=1033,jt=33776,Vt=33777,zt=33778,Gt=33779,Ut=35840,Ht=35841,Wt=35842,Jt=35843,qt=36196,Xt=37808,Yt=37809,Zt=37810,$t=37811,Kt=37812,Qt=37813,te=37814,ee=37815,ne=37816,ie=37817,re=37818,ae=37819,oe=37820,se=37821,le=2300,ce=2301,ue=2400,he=2401,pe=2402,de=3e3,fe=3001,me=3007,ge=3002,ve=3003,ye=3004,xe=3005,be=3006,we=3200,Me=3201,_e=0,Se=1,Ce=7680,Te=519,Ee=35044,De=35048;function Ae(){}Object.assign(Ae.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var n=this._listeners[t];if(void 0!==n){var i=n.indexOf(e);-1!==i&&n.splice(i,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var n=e.slice(0),i=0,r=n.length;i<r;i++)n[i].call(this,t)}}}});for(var Oe=[],Le=0;Le<256;Le++)Oe[Le]=(Le<16?"0":"")+Le.toString(16);var Ie,Pe={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(Oe[255&t]+Oe[t>>8&255]+Oe[t>>16&255]+Oe[t>>24&255]+"-"+Oe[255&e]+Oe[e>>8&255]+"-"+Oe[e>>16&15|64]+Oe[e>>24&255]+"-"+Oe[63&n|128]+Oe[n>>8&255]+"-"+Oe[n>>16&255]+Oe[n>>24&255]+Oe[255&i]+Oe[i>>8&255]+Oe[i>>16&255]+Oe[i>>24&255]).toUpperCase()},clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},smoothstep:function(t,e,n){return t<=e?0:n<=t?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:n<=t?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*Pe.DEG2RAD},radToDeg:function(t){return t*Pe.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,n,i,r){var a=Math.cos,o=Math.sin,s=a(n/2),l=o(n/2),c=a((e+i)/2),u=o((e+i)/2),h=a((e-i)/2),p=o((e-i)/2),d=a((i-e)/2),f=o((i-e)/2);"XYX"===r?t.set(s*u,l*h,l*p,s*c):"YZY"===r?t.set(l*p,s*u,l*h,s*c):"ZXZ"===r?t.set(l*h,l*p,s*u,s*c):"XZX"===r?t.set(s*u,l*f,l*d,s*c):"YXY"===r?t.set(l*d,s*u,l*f,s*c):"ZYZ"===r?t.set(l*f,l*d,s*u,s*c):console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.")}};function Re(t,e){this.x=t||0,this.y=e||0}function ke(){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(Re.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(Re.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,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(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.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 t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*n-a*i+t.x,this.y=r*i+a*n+t.y,this}}),Object.assign(ke.prototype,{isMatrix3:!0,set:function(t,e,n,i,r,a,o,s,l){var c=this.elements;return c[0]=t,c[1]=i,c[2]=o,c[3]=e,c[4]=r,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(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,i=e.elements,r=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=i[0],m=i[3],g=i[6],v=i[1],y=i[4],x=i[7],b=i[2],w=i[5],M=i[8];return r[0]=a*f+o*v+s*b,r[3]=a*m+o*y+s*w,r[6]=a*g+o*x+s*M,r[1]=l*f+c*v+u*b,r[4]=l*m+c*y+u*w,r[7]=l*g+c*x+u*M,r[2]=h*f+p*v+d*b,r[5]=h*m+p*y+d*w,r[8]=h*g+p*x+d*M,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=t[8];return e*a*c-e*o*l-n*r*c+n*o*s+i*r*l-i*a*s},getInverse:function(t,e){t&&t.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=t.elements,i=this.elements,r=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=r*d+a*f+o*m;if(0==g){var v="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(v);return console.warn(v),this.identity()}var y=1/g;return i[0]=d*y,i[1]=(o*h-p*a)*y,i[2]=(c*a-o*l)*y,i[3]=f*y,i[4]=(p*r-o*u)*y,i[5]=(o*s-c*r)*y,i[6]=m*y,i[7]=(a*u-h*r)*y,i[8]=(l*r-a*s)*y,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,n,i,r,a,o){var s=Math.cos(r),l=Math.sin(r);this.set(n*s,n*l,-n*(s*a+l*o)+a+t,-i*l,i*s,-i*(-l*a+s*o)+o+e,0,0,1)},scale:function(t,e){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this},rotate:function(t){var e=Math.cos(t),n=Math.sin(t),i=this.elements,r=i[0],a=i[3],o=i[6],s=i[1],l=i[4],c=i[7];return i[0]=e*r+n*s,i[3]=e*a+n*l,i[6]=e*o+n*c,i[1]=-n*r+e*s,i[4]=-n*a+e*l,i[7]=-n*o+e*c,this},translate:function(t,e){var n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this},equals:function(t){for(var e=this.elements,n=t.elements,i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<9;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}});var Ne={getDataURL:function(t){var e;if("undefined"==typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)e=t;else{void 0===Ie&&(Ie=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Ie.width=t.width,Ie.height=t.height;var n=Ie.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Ie}return 2048<e.width||2048<e.height?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},Be=0;function Fe(t,e,n,i,r,a,o,s,l,c){Object.defineProperty(this,"id",{value:Be++}),this.uuid=Pe.generateUUID(),this.name="",this.image=void 0!==t?t:Fe.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:Fe.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:at,this.wrapT=void 0!==i?i:at,this.magFilter=void 0!==r?r:ut,this.minFilter=void 0!==a?a:pt,this.anisotropy=void 0!==l?l:1,this.format=void 0!==o?o:Et,this.internalFormat=null,this.type=void 0!==s?s:dt,this.offset=new Re(0,0),this.repeat=new Re(1,1),this.center=new Re(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ke,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==c?c:de,this.version=0,this.onUpdate=null}function je(t,e,n,i){this.x=t||0,this.y=e||0,this.z=n||0,this.w=void 0!==i?i:1}function Ve(t,e,n){this.width=t,this.height=e,this.scissor=new je(0,0,t,e),this.scissorTest=!1,this.viewport=new je(0,0,t,e),n=n||{},this.texture=new Fe(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=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:ut,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 ze(t,e,n){Ve.call(this,t,e,n),this.samples=4}function Ge(t,e,n,i){this._x=t||0,this._y=e||0,this._z=n||0,this._w=void 0!==i?i:1}Fe.DEFAULT_IMAGE=void 0,Fe.DEFAULT_MAPPING=300,Fe.prototype=Object.assign(Object.create(Ae.prototype),{constructor:Fe,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(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.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 i=this.image;if(void 0===i.uuid&&(i.uuid=Pe.generateUUID()),!e&&void 0===t.images[i.uuid]){var r;if(Array.isArray(i)){r=[];for(var a=0,o=i.length;a<o;a++)r.push(Ne.getDataURL(i[a]))}else r=Ne.getDataURL(i);t.images[i.uuid]={uuid:i.uuid,url:r}}n.image=i.uuid}return e||(t.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||1<t.x)switch(this.wrapS){case rt:t.x=t.x-Math.floor(t.x);break;case at:t.x=t.x<0?0:1;break;case ot:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||1<t.y)switch(this.wrapT){case rt:t.y=t.y-Math.floor(t.y);break;case at:t.y=t.y<0?0:1;break;case ot:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(Fe.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.defineProperties(je.prototype,{width:{get:function(){return this.z},set:function(t){this.z=t}},height:{get:function(){return this.w},set:function(t){this.w=t}}}),Object.assign(je.prototype,{isVector4:!0,set:function(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){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: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,n=this.y,i=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*e+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*e+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*e+a[7]*n+a[11]*i+a[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,n,i,r,a=t.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;e=Math.PI;var m=(o+1)/2,g=(u+1)/2,v=(f+1)/2,y=(s+c)/4,x=(l+p)/4,b=(h+d)/4;return g<m&&v<m?r=m<.01?(n=0,i=.707106781):(i=y/(n=Math.sqrt(m)),x/n):v<g?r=g<.01?(i=0,n=.707106781):(n=y/(i=Math.sqrt(g)),b/i):v<.01?(i=n=.707106781,r=0):(n=x/(r=Math.sqrt(v)),i=b/r),this.set(n,i,r,e),this}var w=Math.sqrt((d-h)*(d-h)+(l-p)*(l-p)+(c-s)*(c-s));return Math.abs(w)<.001&&(w=1),this.x=(d-h)/w,this.y=(l-p)/w,this.z=(c-s)/w,this.w=Math.acos((o+u+f-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,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(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.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(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}}),Ve.prototype=Object.assign(Object.create(Ae.prototype),{constructor:Ve,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),ze.prototype=Object.assign(Object.create(Ve.prototype),{constructor:ze,isWebGLMultisampleRenderTarget:!0,copy:function(t){return Ve.prototype.copy.call(this,t),this.samples=t.samples,this}}),Object.assign(Ge,{slerp:function(t,e,n,i){return n.copy(t).slerp(e,i)},slerpFlat:function(t,e,n,i,r,a,o){var s=n[i+0],l=n[i+1],c=n[i+2],u=n[i+3],h=r[a+0],p=r[a+1],d=r[a+2],f=r[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),b=Math.atan2(x,g*v);m=Math.sin(m*b)/x,o=Math.sin(o*b)/x}var w=o*v;if(s=s*m+h*w,l=l*m+p*w,c=c*m+d*w,u=u*m+f*w,m===1-o){var M=1/Math.sqrt(s*s+l*l+c*c+u*u);s*=M,l*=M,c*=M,u*=M}}t[e]=s,t[e+1]=l,t[e+2]=c,t[e+3]=u}}),Object.defineProperties(Ge.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}}}),Object.assign(Ge.prototype,{isQuaternion:!0,set:function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=t._x,i=t._y,r=t._z,a=t.order,o=Math.cos,s=Math.sin,l=o(n/2),c=o(i/2),u=o(r/2),h=s(n/2),p=s(i/2),d=s(r/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!==e&&this._onChangeCallback(),this},setFromAxisAngle:function(t,e){var n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(t){var e,n=t.elements,i=n[0],r=n[4],a=n[8],o=n[1],s=n[5],l=n[9],c=n[2],u=n[6],h=n[10],p=i+s+h;return 0<p?(e=.5/Math.sqrt(p+1),this._w=.25/e,this._x=(u-l)*e,this._y=(a-c)*e,this._z=(o-r)*e):s<i&&h<i?(e=2*Math.sqrt(1+i-s-h),this._w=(u-l)/e,this._x=.25*e,this._y=(r+o)/e,this._z=(a+c)/e):h<s?(e=2*Math.sqrt(1+s-i-h),this._w=(a-c)/e,this._x=(r+o)/e,this._y=.25*e,this._z=(l+u)/e):(e=2*Math.sqrt(1+h-i-s),this._w=(o-r)/e,this._x=(a+c)/e,this._y=(l+u)/e,this._z=.25*e),this._onChangeCallback(),this},setFromUnitVectors:function(t,e){var n=t.dot(e)+1;return n<1e-6?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0):(this._x=0,this._y=-t.z,this._z=t.y)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x),this._w=n,this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs(Pe.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){var n=this.angleTo(t);if(0===n)return this;var i=Math.min(1,e/n);return this.slerp(t,i),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var n=t._x,i=t._y,r=t._z,a=t._w,o=e._x,s=e._y,l=e._z,c=e._w;return this._x=n*c+a*o+i*l-r*s,this._y=i*c+a*s+r*o-n*l,this._z=r*c+a*l+n*s-i*o,this._w=a*c-n*o-i*s-r*l,this._onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,i=this._y,r=this._z,a=this._w,o=a*t._w+n*t._x+i*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),1<=o)return this._w=a,this._x=n,this._y=i,this._z=r,this;var s=1-o*o;if(s<=Number.EPSILON){var l=1-e;return this._w=l*a+e*this._w,this._x=l*n+e*this._x,this._y=l*i+e*this._y,this._z=l*r+e*this._z,this.normalize(),this._onChangeCallback(),this}var c=Math.sqrt(s),u=Math.atan2(c,o),h=Math.sin((1-e)*u)/c,p=Math.sin(e*u)/c;return this._w=a*h+this._w*p,this._x=n*h+this._x*p,this._y=i*h+this._y*p,this._z=r*h+this._z*p,this._onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}});var Ue=new We,He=new Ge;function We(t,e,n){this.x=t||0,this.y=e||0,this.z=n||0}Object.assign(We.prototype,{isVector3:!0,set:function(t,e,n){return this.x=t,this.y=e,this.z=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(He.setFromEuler(t))},applyAxisAngle:function(t,e){return this.applyQuaternion(He.setFromAxisAngle(t,e))},applyMatrix3:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this},applyNormalMatrix:function(t){return this.applyMatrix3(t).normalize()},applyMatrix4:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements,a=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*a,this},applyQuaternion:function(t){var e=this.x,n=this.y,i=this.z,r=t.x,a=t.y,o=t.z,s=t.w,l=s*e+a*i-o*n,c=s*n+o*e-r*i,u=s*i+r*n-a*e,h=-r*e-a*n-o*i;return this.x=l*s+h*-r+c*-o-u*-a,this.y=c*s+h*-a+u*-r-l*-o,this.z=u*s+h*-o+l*-a-c*-r,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},transformDirection:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,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(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},cross:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},crossVectors:function(t,e){var n=t.x,i=t.y,r=t.z,a=e.x,o=e.y,s=e.z;return this.x=i*s-r*o,this.y=r*a-n*s,this.z=n*o-i*a,this},projectOnVector:function(t){var e=t.lengthSq();if(0===e)return this.set(0,0,0);var n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)},projectOnPlane:function(t){return Ue.copy(this).projectOnVector(t),this.sub(Ue)},reflect:function(t){return this.sub(Ue.copy(t).multiplyScalar(2*this.dot(t)))},angleTo:function(t){var e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;var n=this.dot(t)/e;return Math.acos(Pe.clamp(n,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,e,n){var i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this},setFromMatrixPosition:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},setFromMatrix3Column:function(t,e){return this.fromArray(t.elements,3*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}});var Je=new We,qe=new Qe,Xe=new We(0,0,0),Ye=new We(1,1,1),Ze=new We,$e=new We,Ke=new We;function Qe(){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(Qe.prototype,{isMatrix4:!0,set:function(t,e,n,i,r,a,o,s,l,c,u,h,p,d,f,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=r,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 Qe).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this},copyPosition:function(t){var e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this},extractBasis:function(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this},extractRotation:function(t){var e=this.elements,n=t.elements,i=1/Je.setFromMatrixColumn(t,0).length(),r=1/Je.setFromMatrixColumn(t,1).length(),a=1/Je.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,n=t.x,i=t.y,r=t.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(i),l=Math.sin(i),c=Math.cos(r),u=Math.sin(r);if("XYZ"===t.order){var h=a*c,p=a*u,d=o*c,f=o*u;e[0]=s*c,e[4]=-s*u,e[8]=l,e[1]=p+d*l,e[5]=h-f*l,e[9]=-o*s,e[2]=f-h*l,e[6]=d+p*l,e[10]=a*s}else if("YXZ"===t.order){var m=s*c,g=s*u,v=l*c,y=l*u;e[0]=m+y*o,e[4]=v*o-g,e[8]=a*l,e[1]=a*u,e[5]=a*c,e[9]=-o,e[2]=g*o-v,e[6]=y+m*o,e[10]=a*s}else if("ZXY"===t.order)m=s*c,g=s*u,v=l*c,y=l*u,e[0]=m-y*o,e[4]=-a*u,e[8]=v+g*o,e[1]=g+v*o,e[5]=a*c,e[9]=y-m*o,e[2]=-a*l,e[6]=o,e[10]=a*s;else if("ZYX"===t.order)h=a*c,p=a*u,d=o*c,f=o*u,e[0]=s*c,e[4]=d*l-p,e[8]=h*l+f,e[1]=s*u,e[5]=f*l+h,e[9]=p*l-d,e[2]=-l,e[6]=o*s,e[10]=a*s;else if("YZX"===t.order){var x=a*s,b=a*l,w=o*s,M=o*l;e[0]=s*c,e[4]=M-x*u,e[8]=w*u+b,e[1]=u,e[5]=a*c,e[9]=-o*c,e[2]=-l*c,e[6]=b*u+w,e[10]=x-M*u}else"XZY"===t.order&&(x=a*s,b=a*l,w=o*s,M=o*l,e[0]=s*c,e[4]=-u,e[8]=l*c,e[1]=x*u+M,e[5]=a*c,e[9]=b*u-w,e[2]=w*u-b,e[6]=o*c,e[10]=M*u+x);return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){return this.compose(Xe,t,Ye)},lookAt:function(t,e,n){var i=this.elements;return Ke.subVectors(t,e),0===Ke.lengthSq()&&(Ke.z=1),Ke.normalize(),Ze.crossVectors(n,Ke),0===Ze.lengthSq()&&(1===Math.abs(n.z)?Ke.x+=1e-4:Ke.z+=1e-4,Ke.normalize(),Ze.crossVectors(n,Ke)),Ze.normalize(),$e.crossVectors(Ke,Ze),i[0]=Ze.x,i[4]=$e.x,i[8]=Ke.x,i[1]=Ze.y,i[5]=$e.y,i[9]=Ke.y,i[2]=Ze.z,i[6]=$e.z,i[10]=Ke.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,i=e.elements,r=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],b=n[15],w=i[0],M=i[4],_=i[8],S=i[12],C=i[1],T=i[5],E=i[9],D=i[13],A=i[2],O=i[6],L=i[10],I=i[14],P=i[3],R=i[7],k=i[11],N=i[15];return r[0]=a*w+o*C+s*A+l*P,r[4]=a*M+o*T+s*O+l*R,r[8]=a*_+o*E+s*L+l*k,r[12]=a*S+o*D+s*I+l*N,r[1]=c*w+u*C+h*A+p*P,r[5]=c*M+u*T+h*O+p*R,r[9]=c*_+u*E+h*L+p*k,r[13]=c*S+u*D+h*I+p*N,r[2]=d*w+f*C+m*A+g*P,r[6]=d*M+f*T+m*O+g*R,r[10]=d*_+f*E+m*L+g*k,r[14]=d*S+f*D+m*I+g*N,r[3]=v*w+y*C+x*A+b*P,r[7]=v*M+y*T+x*O+b*R,r[11]=v*_+y*E+x*L+b*k,r[15]=v*S+y*D+x*I+b*N,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},determinant:function(){var t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],a=t[1],o=t[5],s=t[9],l=t[13],c=t[2],u=t[6],h=t[10],p=t[14];return t[3]*(r*s*u-i*l*u-r*o*h+n*l*h+i*o*p-n*s*p)+t[7]*(e*s*p-e*l*h+r*a*h-i*a*p+i*l*c-r*s*c)+t[11]*(e*l*u-e*o*p-r*a*u+n*a*p+r*o*c-n*l*c)+t[15]*(-i*o*c-e*s*u+e*o*h+i*a*u-n*a*h+n*s*c)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(t,e,n){var i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this},getInverse:function(t,e){var n=this.elements,i=t.elements,r=i[0],a=i[1],o=i[2],s=i[3],l=i[4],c=i[5],u=i[6],h=i[7],p=i[8],d=i[9],f=i[10],m=i[11],g=i[12],v=i[13],y=i[14],x=i[15],b=d*y*h-v*f*h+v*u*m-c*y*m-d*u*x+c*f*x,w=g*f*h-p*y*h-g*u*m+l*y*m+p*u*x-l*f*x,M=p*v*h-g*d*h+g*c*m-l*v*m-p*c*x+l*d*x,_=g*d*u-p*v*u-g*c*f+l*v*f+p*c*y-l*d*y,S=r*b+a*w+o*M+s*_;if(0==S){var C="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(C);return console.warn(C),this.identity()}var T=1/S;return n[0]=b*T,n[1]=(v*f*s-d*y*s-v*o*m+a*y*m+d*o*x-a*f*x)*T,n[2]=(c*y*s-v*u*s+v*o*h-a*y*h-c*o*x+a*u*x)*T,n[3]=(d*u*s-c*f*s-d*o*h+a*f*h+c*o*m-a*u*m)*T,n[4]=w*T,n[5]=(p*y*s-g*f*s+g*o*m-r*y*m-p*o*x+r*f*x)*T,n[6]=(g*u*s-l*y*s-g*o*h+r*y*h+l*o*x-r*u*x)*T,n[7]=(l*f*s-p*u*s+p*o*h-r*f*h-l*o*m+r*u*m)*T,n[8]=M*T,n[9]=(g*d*s-p*v*s-g*a*m+r*v*m+p*a*x-r*d*x)*T,n[10]=(l*v*s-g*c*s+g*a*h-r*v*h-l*a*x+r*c*x)*T,n[11]=(p*c*s-l*d*s-p*a*h+r*d*h+l*a*m-r*c*m)*T,n[12]=_*T,n[13]=(p*v*o-g*d*o+g*a*f-r*v*f-p*a*y+r*d*y)*T,n[14]=(g*c*o-l*v*o-g*a*u+r*v*u+l*a*y-r*c*y)*T,n[15]=(l*d*o-p*c*o+p*a*u-r*d*u-l*a*f+r*c*f)*T,this},scale:function(t){var e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))},makeTranslation:function(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=1-n,a=t.x,o=t.y,s=t.z,l=r*a,c=r*o;return this.set(l*a+n,l*o-i*s,l*s+i*o,0,l*o+i*s,c*o+n,c*s-i*a,0,l*s-i*o,c*s+i*a,r*s*s+n,0,0,0,0,1),this},makeScale:function(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,n){var i=this.elements,r=e._x,a=e._y,o=e._z,s=e._w,l=r+r,c=a+a,u=o+o,h=r*l,p=r*c,d=r*u,f=a*c,m=a*u,g=o*u,v=s*l,y=s*c,x=s*u,b=n.x,w=n.y,M=n.z;return i[0]=(1-(f+g))*b,i[1]=(p+x)*b,i[2]=(d-y)*b,i[3]=0,i[4]=(p-x)*w,i[5]=(1-(h+g))*w,i[6]=(m+v)*w,i[7]=0,i[8]=(d+y)*M,i[9]=(m-v)*M,i[10]=(1-(h+f))*M,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this},decompose:function(t,e,n){var i=this.elements,r=Je.set(i[0],i[1],i[2]).length(),a=Je.set(i[4],i[5],i[6]).length(),o=Je.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],qe.copy(this);var s=1/r,l=1/a,c=1/o;return qe.elements[0]*=s,qe.elements[1]*=s,qe.elements[2]*=s,qe.elements[4]*=l,qe.elements[5]*=l,qe.elements[6]*=l,qe.elements[8]*=c,qe.elements[9]*=c,qe.elements[10]*=c,e.setFromRotationMatrix(qe),n.x=r,n.y=a,n.z=o,this},makePerspective:function(t,e,n,i,r,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*r/(e-t),l=2*r/(n-i),c=(e+t)/(e-t),u=(n+i)/(n-i),h=-(a+r)/(a-r),p=-2*a*r/(a-r);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(t,e,n,i,r,a){var o=this.elements,s=1/(e-t),l=1/(n-i),c=1/(a-r),u=(e+t)*s,h=(n+i)*l,p=(a+r)*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(t){for(var e=this.elements,n=t.elements,i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<16;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}});var tn=new Qe,en=new Ge;function nn(t,e,n,i){this._x=t||0,this._y=e||0,this._z=n||0,this._order=i||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(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this._onChangeCallback()}}}),Object.assign(nn.prototype,{isEuler:!0,set:function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._order=i||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this},setFromRotationMatrix:function(t,e,n){var i=Pe.clamp,r=t.elements,a=r[0],o=r[4],s=r[8],l=r[1],c=r[5],u=r[9],h=r[2],p=r[6],d=r[10];return"XYZ"===(e=e||this._order)?(this._y=Math.asin(i(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"===e?(this._x=Math.asin(-i(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"===e?(this._x=Math.asin(i(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"===e?(this._y=Math.asin(-i(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"===e?(this._z=Math.asin(i(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"===e?(this._z=Math.asin(-i(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: "+e),this._order=e,!1!==n&&this._onChangeCallback(),this},setFromQuaternion:function(t,e,n){return tn.makeRotationFromQuaternion(t),this.setFromRotationMatrix(tn,e,n)},setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(t){return en.setFromEuler(this),this.setFromQuaternion(en,t)},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new We(this._x,this._y,this._z)},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}}),Object.assign(rn.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},enableAll:function(){this.mask=-1},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},disableAll:function(){this.mask=0},test:function(t){return 0!=(this.mask&t.mask)}});var an=0,on=new We,sn=new Ge,ln=new Qe,cn=new We,un=new We,hn=new We,pn=new Ge,dn=new We(1,0,0),fn=new We(0,1,0),mn=new We(0,0,1),gn={type:"added"},vn={type:"removed"};function yn(){Object.defineProperty(this,"id",{value:an++}),this.uuid=Pe.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=yn.DefaultUp.clone();var t=new We,e=new nn,n=new Ge,i=new We(1,1,1);e._onChange(function(){n.setFromEuler(e,!1)}),n._onChange(function(){e.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Qe},normalMatrix:{value:new ke}}),this.matrix=new Qe,this.matrixWorld=new Qe,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 We(0,1,0),yn.DefaultMatrixAutoUpdate=!0,yn.prototype=Object.assign(Object.create(Ae.prototype),{constructor:yn,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(t,e){return sn.setFromAxisAngle(t,e),this.quaternion.multiply(sn),this},rotateOnWorldAxis:function(t,e){return sn.setFromAxisAngle(t,e),this.quaternion.premultiply(sn),this},rotateX:function(t){return this.rotateOnAxis(dn,t)},rotateY:function(t){return this.rotateOnAxis(fn,t)},rotateZ:function(t){return this.rotateOnAxis(mn,t)},translateOnAxis:function(t,e){return on.copy(t).applyQuaternion(this.quaternion),this.position.add(on.multiplyScalar(e)),this},translateX:function(t){return this.translateOnAxis(dn,t)},translateY:function(t){return this.translateOnAxis(fn,t)},translateZ:function(t){return this.translateOnAxis(mn,t)},localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(t){return t.applyMatrix4(ln.getInverse(this.matrixWorld))},lookAt:function(t,e,n){t.isVector3?cn.copy(t):cn.set(t,e,n);var i=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),i&&(ln.extractRotation(i.matrixWorld),sn.setFromRotationMatrix(ln),this.quaternion.premultiply(sn.inverse()))},add:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",t):t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),(t.parent=this).children.push(t),t.dispatchEvent(gn)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this},remove:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var n=this.children.indexOf(t);return-1!==n&&(t.parent=null,this.children.splice(n,1),t.dispatchEvent(vn)),this},attach:function(t){return this.updateWorldMatrix(!0,!1),ln.getInverse(this.matrixWorld),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),ln.multiply(t.parent.matrixWorld)),t.applyMatrix4(ln),t.updateWorldMatrix(!1,!1),this.add(t),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var n=0,i=this.children.length;n<i;n++){var r=this.children[n].getObjectByProperty(t,e);if(void 0!==r)return r}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new We),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),t=new Ge),this.updateMatrixWorld(!0),this.matrixWorld.decompose(un,t,hn),t},getWorldScale:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new We),this.updateMatrixWorld(!0),this.matrixWorld.decompose(un,pn,t),t},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new We),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},raycast:function(){},traverse:function(t){t(this);for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t=!(this.matrixWorldNeedsUpdate=!1));for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].updateMatrixWorld(t)},updateWorldMatrix:function(t,e){var n=this.parent;if(!0===t&&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===e)for(var i=this.children,r=0,a=i.length;r<a;r++)i[r].updateWorldMatrix(!1,!0)},toJSON:function(t){var e=void 0===t||"string"==typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var i={};function r(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){i.geometry=r(t.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];r(t.shapes,c)}else r(t.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(r(t.materials,this.material[s]));i.material=u}else i.material=r(t.materials,this.material);if(0<this.children.length)for(i.children=[],s=0;s<this.children.length;s++)i.children.push(this.children[s].toJSON(t).object);if(e){var h=m(t.geometries),p=m(t.materials),d=m(t.textures),f=m(t.images);o=m(t.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=i,n;function m(t){var e=[];for(var n in t){var i=t[n];delete i.metadata,e.push(i)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var n=0;n<t.children.length;n++){var i=t.children[n];this.add(i.clone())}return this}}),xn.prototype=Object.assign(Object.create(yn.prototype),{constructor:xn,isScene:!0,copy:function(t,e){return yn.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},toJSON:function(t){var e=yn.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.environment&&(e.object.environment=this.environment.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e},dispose:function(){this.dispatchEvent({type:"dispose"})}});var bn=[new We,new We,new We,new We,new We,new We,new We,new We],wn=new We,Mn=new Pn,_n=new We,Sn=new We,Cn=new We,Tn=new We,En=new We,Dn=new We,An=new We,On=new We,Ln=new We,In=new We;function Pn(t,e){this.min=void 0!==t?t:new We(1/0,1/0,1/0),this.max=void 0!==e?e:new We(-1/0,-1/0,-1/0)}function Rn(t,e,n,i,r){var a,o;for(a=0,o=t.length-3;a<=o;a+=3){In.fromArray(t,a);var s=r.x*Math.abs(In.x)+r.y*Math.abs(In.y)+r.z*Math.abs(In.z),l=e.dot(In),c=n.dot(In),u=i.dot(In);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>s)return!1}return!0}Object.assign(Pn.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,l=t.length;s<l;s+=3){var c=t[s],u=t[s+1],h=t[s+2];c<e&&(e=c),u<n&&(n=u),h<i&&(i=h),r<c&&(r=c),a<u&&(a=u),o<h&&(o=h)}return this.min.set(e,n,i),this.max.set(r,a,o),this},setFromBufferAttribute:function(t){for(var e=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,l=t.count;s<l;s++){var c=t.getX(s),u=t.getY(s),h=t.getZ(s);c<e&&(e=c),u<n&&(n=u),h<i&&(i=h),r<c&&(r=c),a<u&&(a=u),o<h&&(o=h)}return this.min.set(e,n,i),this.max.set(r,a,o),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(t,e){var n=wn.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this},setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.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(t){return void 0===t&&(console.warn("THREE.Box3: .getCenter() target is now required"),t=new We),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new We),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:function(t){t.updateWorldMatrix(!1,!1);var e=t.geometry;void 0!==e&&(null===e.boundingBox&&e.computeBoundingBox(),Mn.copy(e.boundingBox),Mn.applyMatrix4(t.matrixWorld),this.expandByPoint(Mn.min),this.expandByPoint(Mn.max));for(var n=t.children,i=0,r=n.length;i<r;i++)this.expandByObject(n[i]);return this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new We),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:function(t){return this.clampPoint(t.center,wn),wn.distanceToSquared(t.center)<=t.radius*t.radius},intersectsPlane:function(t){var e,n;return n=0<t.normal.x?(e=t.normal.x*this.min.x,t.normal.x*this.max.x):(e=t.normal.x*this.max.x,t.normal.x*this.min.x),0<t.normal.y?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),0<t.normal.z?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant},intersectsTriangle:function(t){if(this.isEmpty())return!1;this.getCenter(An),On.subVectors(this.max,An),_n.subVectors(t.a,An),Sn.subVectors(t.b,An),Cn.subVectors(t.c,An),Tn.subVectors(Sn,_n),En.subVectors(Cn,Sn),Dn.subVectors(_n,Cn);var e=[0,-Tn.z,Tn.y,0,-En.z,En.y,0,-Dn.z,Dn.y,Tn.z,0,-Tn.x,En.z,0,-En.x,Dn.z,0,-Dn.x,-Tn.y,Tn.x,0,-En.y,En.x,0,-Dn.y,Dn.x,0];return!!Rn(e,_n,Sn,Cn,On)&&!!Rn(e=[1,0,0,0,1,0,0,0,1],_n,Sn,Cn,On)&&(Ln.crossVectors(Tn,En),Rn(e=[Ln.x,Ln.y,Ln.z],_n,Sn,Cn,On))},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new We),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return wn.copy(t).clamp(this.min,this.max).sub(t).length()},getBoundingSphere:function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(wn).length(),t},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(t){return this.isEmpty()||(bn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),bn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),bn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),bn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),bn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),bn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),bn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),bn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(bn)),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var kn=new Pn;function Nn(t,e){this.center=void 0!==t?t:new We,this.radius=void 0!==e?e:0}Object.assign(Nn.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(t,e){var n=this.center;void 0!==e?n.copy(e):kn.setFromPoints(t).getCenter(n);for(var i=0,r=0,a=t.length;r<a;r++)i=Math.max(i,n.distanceToSquared(t[r]));return this.radius=Math.sqrt(i),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,e){var n=this.center.distanceToSquared(t);return void 0===e&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),e=new We),e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new Pn),t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}});var Bn=new We,Fn=new We,jn=new We,Vn=new We,zn=new We,Gn=new We,Un=new We;function Hn(t,e){this.origin=void 0!==t?t:new We,this.direction=void 0!==e?e:new We(0,0,-1)}Object.assign(Hn.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new We),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(t){return this.origin.copy(this.at(t,Bn)),this},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new We),e.subVectors(t,this.origin);var n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(t){var e=Bn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Bn.copy(this.direction).multiplyScalar(e).add(this.origin),Bn.distanceToSquared(t))},distanceSqToSegment:function(t,e,n,i){Fn.copy(t).add(e).multiplyScalar(.5),jn.copy(e).sub(t).normalize(),Vn.copy(this.origin).sub(Fn);var r,a,o,s,l=.5*t.distanceTo(e),c=-this.direction.dot(jn),u=Vn.dot(this.direction),h=-Vn.dot(jn),p=Vn.lengthSq(),d=Math.abs(1-c*c);if(0<d)if(a=c*u-h,s=l*d,0<=(r=c*h-u))if(-s<=a)if(a<=s){var f=1/d;o=(r*=f)*(r+c*(a*=f)+2*u)+a*(c*r+a+2*h)+p}else a=l,o=-(r=Math.max(0,-(c*a+u)))*r+a*(a+2*h)+p;else a=-l,o=-(r=Math.max(0,-(c*a+u)))*r+a*(a+2*h)+p;else o=a<=-s?-(r=Math.max(0,-(-c*l+u)))*r+(a=0<r?-l:Math.min(Math.max(-l,-h),l))*(a+2*h)+p:a<=s?(r=0,(a=Math.min(Math.max(-l,-h),l))*(a+2*h)+p):-(r=Math.max(0,-(c*l+u)))*r+(a=0<r?l:Math.min(Math.max(-l,-h),l))*(a+2*h)+p;else a=0<c?-l:l,o=-(r=Math.max(0,-(c*a+u)))*r+a*(a+2*h)+p;return n&&n.copy(this.direction).multiplyScalar(r).add(this.origin),i&&i.copy(jn).multiplyScalar(a).add(Fn),o},intersectSphere:function(t,e){Bn.subVectors(t.center,this.origin);var n=Bn.dot(this.direction),i=Bn.dot(Bn)-n*n,r=t.radius*t.radius;if(r<i)return null;var a=Math.sqrt(r-i),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,e):this.at(o,e)},intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(t.normal)+t.constant)/e;return 0<=n?n:null},intersectPlane:function(t,e){var n=this.distanceToPlane(t);return null===n?null:this.at(n,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){var n,i,r,a,o,s,l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return i=0<=l?(n=(t.min.x-h.x)*l,(t.max.x-h.x)*l):(n=(t.max.x-h.x)*l,(t.min.x-h.x)*l),(a=0<=c?(r=(t.min.y-h.y)*c,(t.max.y-h.y)*c):(r=(t.max.y-h.y)*c,(t.min.y-h.y)*c))<n||i<r?null:((n<r||n!=n)&&(n=r),(a<i||i!=i)&&(i=a),(s=0<=u?(o=(t.min.z-h.z)*u,(t.max.z-h.z)*u):(o=(t.max.z-h.z)*u,(t.min.z-h.z)*u))<n||i<o?null:((n<o||n!=n)&&(n=o),(s<i||i!=i)&&(i=s),i<0?null:this.at(0<=n?n:i,e)))},intersectsBox:function(t){return null!==this.intersectBox(t,Bn)},intersectTriangle:function(t,e,n,i,r){zn.subVectors(e,t),Gn.subVectors(n,t),Un.crossVectors(zn,Gn);var a,o=this.direction.dot(Un);if(0<o){if(i)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}Vn.subVectors(this.origin,t);var s=a*this.direction.dot(Gn.crossVectors(Vn,Gn));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(Un);return c<0?null:this.at(c/o,r)},applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}});var Wn=new We,Jn=new We,qn=new ke;function Xn(t,e){this.normal=void 0!==t?t:new We(1,0,0),this.constant=void 0!==e?e:0}Object.assign(Xn.prototype,{isPlane:!0,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(t,e,n){var i=Wn.subVectors(n,e).cross(Jn.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new We),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(t,e){void 0===e&&(console.warn("THREE.Plane: .intersectLine() target is now required"),e=new We);var n=t.delta(Wn),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):void 0;var r=-(t.start.dot(this.normal)+this.constant)/i;return r<0||1<r?void 0:e.copy(n).multiplyScalar(r).add(t.start)},intersectsLine:function(t){var e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&0<n||n<0&&0<e},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new We),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(t,e){var n=e||qn.getNormalMatrix(t),i=this.coplanarPoint(Wn).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this},translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}});var Yn=new We,Zn=new We,$n=new We,Kn=new We,Qn=new We,ti=new We,ei=new We,ni=new We,ii=new We,ri=new We;function ai(t,e,n){this.a=void 0!==t?t:new We,this.b=void 0!==e?e:new We,this.c=void 0!==n?n:new We}Object.assign(ai,{getNormal:function(t,e,n,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new We),i.subVectors(n,e),Yn.subVectors(t,e),i.cross(Yn);var r=i.lengthSq();return 0<r?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)},getBarycoord:function(t,e,n,i,r){Yn.subVectors(i,e),Zn.subVectors(n,e),$n.subVectors(t,e);var a=Yn.dot(Yn),o=Yn.dot(Zn),s=Yn.dot($n),l=Zn.dot(Zn),c=Zn.dot($n),u=a*l-o*o;if(void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new We),0==u)return r.set(-2,-1,-1);var h=1/u,p=(l*s-o*c)*h,d=(a*c-o*s)*h;return r.set(1-p-d,d,p)},containsPoint:function(t,e,n,i){return ai.getBarycoord(t,e,n,i,Kn),0<=Kn.x&&0<=Kn.y&&Kn.x+Kn.y<=1},getUV:function(t,e,n,i,r,a,o,s){return this.getBarycoord(t,e,n,i,Kn),s.set(0,0),s.addScaledVector(r,Kn.x),s.addScaledVector(a,Kn.y),s.addScaledVector(o,Kn.z),s},isFrontFacing:function(t,e,n,i){return Yn.subVectors(n,e),Zn.subVectors(t,e),Yn.cross(Zn).dot(i)<0}}),Object.assign(ai.prototype,{set:function(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this},setFromPointsAndIndices:function(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:function(){return Yn.subVectors(this.c,this.b),Zn.subVectors(this.a,this.b),.5*Yn.cross(Zn).length()},getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new We),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return ai.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new Xn),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return ai.getBarycoord(t,this.a,this.b,this.c,e)},getUV:function(t,e,n,i,r){return ai.getUV(t,this.a,this.b,this.c,e,n,i,r)},containsPoint:function(t){return ai.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return ai.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new We);var n,i,r=this.a,a=this.b,o=this.c;Qn.subVectors(a,r),ti.subVectors(o,r),ni.subVectors(t,r);var s=Qn.dot(ni),l=ti.dot(ni);if(s<=0&&l<=0)return e.copy(r);ii.subVectors(t,a);var c=Qn.dot(ii),u=ti.dot(ii);if(0<=c&&u<=c)return e.copy(a);var h=s*u-c*l;if(h<=0&&0<=s&&c<=0)return n=s/(s-c),e.copy(r).addScaledVector(Qn,n);ri.subVectors(t,o);var p=Qn.dot(ri),d=ti.dot(ri);if(0<=d&&p<=d)return e.copy(o);var f=p*l-s*d;if(f<=0&&0<=l&&d<=0)return i=l/(l-d),e.copy(r).addScaledVector(ti,i);var m=c*d-p*u;if(m<=0&&0<=u-c&&0<=p-d)return ei.subVectors(o,a),i=(u-c)/(u-c+(p-d)),e.copy(a).addScaledVector(ei,i);var g=1/(m+f+h);return n=f*g,i=h*g,e.copy(r).addScaledVector(Qn,n).addScaledVector(ti,i)},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}});var oi={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},si={h:0,s:0,l:0},li={h:0,s:0,l:0};function ci(t,e,n){return void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}function ui(t,e,n){return n<0&&(n+=1),1<n&&--n,n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}function hi(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function pi(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function di(t,e,n,i,r,a){this.a=t,this.b=e,this.c=n,this.normal=i&&i.isVector3?i:new We,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new ci,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==a?a:0}Object.assign(ci.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,n){return this.r=t,this.g=e,this.b=n,this},setHSL:function(t,e,n){if(t=Pe.euclideanModulo(t,1),e=Pe.clamp(e,0,1),n=Pe.clamp(n,0,1),0===e)this.r=this.g=this.b=n;else{var i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=ui(r,i,t+1/3),this.g=ui(r,i,t),this.b=ui(r,i,t-1/3)}return this},setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var i,r=n[1],a=n[2];switch(r){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,e(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,e(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(i[1])/360,s=parseInt(i[2],10)/100,l=parseInt(i[3],10)/100;return e(i[5]),this.setHSL(o,s,l)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(t)){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 t&&0<t.length?this.setColorName(t):this},setColorName:function(t){var e=oi[t];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var n=0<e?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(t){return this.r=hi(t.r),this.g=hi(t.g),this.b=hi(t.b),this},copyLinearToSRGB:function(t){return this.r=pi(t.r),this.g=pi(t.g),this.b=pi(t.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(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var e,n,i=this.r,r=this.g,a=this.b,o=Math.max(i,r,a),s=Math.min(i,r,a),l=(s+o)/2;if(s===o)n=e=0;else{var c=o-s;switch(n=l<=.5?c/(o+s):c/(2-o-s),o){case i:e=(r-a)/c+(r<a?6:0);break;case r:e=(a-i)/c+2;break;case a:e=(i-r)/c+4}e/=6}return t.h=e,t.s=n,t.l=l,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,e,n){return this.getHSL(si),si.h+=t,si.s+=e,si.l+=n,this.setHSL(si.h,si.s,si.l),this},add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},lerpHSL:function(t,e){this.getHSL(si),t.getHSL(li);var n=Pe.lerp(si.h,li.h,e),i=Pe.lerp(si.s,li.s,e),r=Pe.lerp(si.l,li.l,e);return this.setHSL(n,i,r),this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},toJSON:function(){return this.getHex()}}),ci.NAMES=oi,Object.assign(di.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,n=t.vertexNormals.length;e<n;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(e=0,n=t.vertexColors.length;e<n;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}});var fi=0;function mi(){Object.defineProperty(this,"id",{value:fi++}),this.uuid=Pe.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=E,this.blendDst=D,this.blendEquation=y,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=B,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Te,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ce,this.stencilZFail=Ce,this.stencilZPass=Ce,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 gi(t){mi.call(this),this.type="MeshBasicMaterial",this.color=new ci(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=G,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(t)}mi.prototype=Object.assign(Object.create(Ae.prototype),{constructor:mi,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var e in t){var n=t[e];if(void 0!==n)if("shading"!==e){var i=this[e];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n:console.warn("THREE."+this.type+": '"+e+"' 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: '"+e+"' parameter is undefined.")}},toJSON:function(t){var e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function i(t){var e=[];for(var n in t){var i=t[n];delete i.metadata,e.push(i)}return e}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(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).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(t).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),e){var r=i(t.textures),a=i(t.images);0<r.length&&(n.textures=r),0<a.length&&(n.images=a)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexTangents=t.vertexTangents,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var e=t.clippingPlanes,n=null;if(null!==e){var i=e.length;n=new Array(i);for(var r=0;r!==i;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(mi.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),((gi.prototype=Object.create(mi.prototype)).constructor=gi).prototype.isMeshBasicMaterial=!0,gi.prototype.copy=function(t){return mi.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this};var vi=new We;function yi(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.usage=Ee,this.updateRange={offset:0,count:-1},this.version=0}function xi(t,e,n){yi.call(this,new Int8Array(t),e,n)}function bi(t,e,n){yi.call(this,new Uint8Array(t),e,n)}function wi(t,e,n){yi.call(this,new Uint8ClampedArray(t),e,n)}function Mi(t,e,n){yi.call(this,new Int16Array(t),e,n)}function _i(t,e,n){yi.call(this,new Uint16Array(t),e,n)}function Si(t,e,n){yi.call(this,new Int32Array(t),e,n)}function Ci(t,e,n){yi.call(this,new Uint32Array(t),e,n)}function Ti(t,e,n){yi.call(this,new Float32Array(t),e,n)}function Ei(t,e,n){yi.call(this,new Float64Array(t),e,n)}function Di(){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 Ai(t){if(0===t.length)return-1/0;for(var e=t[0],n=1,i=t.length;n<i;++n)t[n]>e&&(e=t[n]);return e}Object.defineProperty(yi.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(yi.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(var i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var a=t[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),a=new ci),e[n++]=a.r,e[n++]=a.g,e[n++]=a.b}return this},copyVector2sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var a=t[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),a=new Re),e[n++]=a.x,e[n++]=a.y}return this},copyVector3sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var a=t[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),a=new We),e[n++]=a.x,e[n++]=a.y,e[n++]=a.z}return this},copyVector4sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var a=t[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),a=new je),e[n++]=a.x,e[n++]=a.y,e[n++]=a.z,e[n++]=a.w}return this},applyMatrix3:function(t){for(var e=0,n=this.count;e<n;e++)vi.x=this.getX(e),vi.y=this.getY(e),vi.z=this.getZ(e),vi.applyMatrix3(t),this.setXYZ(e,vi.x,vi.y,vi.z);return this},applyMatrix4:function(t){for(var e=0,n=this.count;e<n;e++)vi.x=this.getX(e),vi.y=this.getY(e),vi.z=this.getZ(e),vi.applyMatrix4(t),this.setXYZ(e,vi.x,vi.y,vi.z);return this},applyNormalMatrix:function(t){for(var e=0,n=this.count;e<n;e++)vi.x=this.getX(e),vi.y=this.getY(e),vi.z=this.getZ(e),vi.applyNormalMatrix(t),this.setXYZ(e,vi.x,vi.y,vi.z);return this},transformDirection:function(t){for(var e=0,n=this.count;e<n;e++)vi.x=this.getX(e),vi.y=this.getY(e),vi.z=this.getZ(e),vi.transformDirection(t),this.setXYZ(e,vi.x,vi.y,vi.z);return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.itemSize<3?0:this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this},setXYZ:function(t,e,n,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this},setXYZW:function(t,e,n,i,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this},onUpload:function(t){return this.onUploadCallback=t,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}}}),(xi.prototype=Object.create(yi.prototype)).constructor=xi,(bi.prototype=Object.create(yi.prototype)).constructor=bi,(wi.prototype=Object.create(yi.prototype)).constructor=wi,(Mi.prototype=Object.create(yi.prototype)).constructor=Mi,(_i.prototype=Object.create(yi.prototype)).constructor=_i,(Si.prototype=Object.create(yi.prototype)).constructor=Si,(Ci.prototype=Object.create(yi.prototype)).constructor=Ci,(Ti.prototype=Object.create(yi.prototype)).constructor=Ti,(Ei.prototype=Object.create(yi.prototype)).constructor=Ei,Object.assign(Di.prototype,{computeGroups:function(t){for(var e,n=[],i=void 0,r=t.faces,a=0;a<r.length;a++){var o=r[a];o.materialIndex!==i&&(i=o.materialIndex,void 0!==e&&(e.count=3*a-e.start,n.push(e)),e={start:3*a,materialIndex:i})}void 0!==e&&(e.count=3*a-e.start,n.push(e)),this.groups=n},fromGeometry:function(t){var e,n=t.faces,i=t.vertices,r=t.faceVertexUvs,a=r[0]&&0<r[0].length,o=r[1]&&0<r[1].length,s=t.morphTargets,l=s.length;if(0<l){e=[];for(var c=0;c<l;c++)e[c]={name:s[c].name,data:[]};this.morphTargets.position=e}var u,h=t.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=t.skinIndices,f=t.skinWeights,m=d.length===i.length,g=f.length===i.length;for(0<i.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(i[v.a],i[v.b],i[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,w=v.vertexColors;if(3===w.length)this.colors.push(w[0],w[1],w[2]);else{var M=v.color;this.colors.push(M,M,M)}!0===a&&(void 0!==(b=r[0][c])?this.uvs.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",c),this.uvs.push(new Re,new Re,new Re))),!0===o&&(void 0!==(b=r[1][c])?this.uvs2.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",c),this.uvs2.push(new Re,new Re,new Re)));for(var _=0;_<l;_++){var S=s[_].vertices;e[_].data.push(S[v.a],S[v.b],S[v.c])}for(_=0;_<p;_++){var C=h[_].vertexNormals[c];u[_].data.push(C.a,C.b,C.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(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this}});var Oi=2147483647,Li=new Qe,Ii=new yn,Pi=new We,Ri=new Pn,ki=new Pn,Ni=new We;function Bi(){Object.defineProperty(this,"id",{value:Oi+=2}),this.uuid=Pe.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={}}Bi.prototype=Object.assign(Object.create(Ae.prototype),{constructor:Bi,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(65535<Ai(t)?Ci:_i)(t,1):this.index=t},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,n){this.groups.push({start:t,count:e,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){var e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var i=(new ke).getNormalMatrix(t);n.applyNormalMatrix(i),n.needsUpdate=!0}var r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(t),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return Li.makeRotationX(t),this.applyMatrix4(Li),this},rotateY:function(t){return Li.makeRotationY(t),this.applyMatrix4(Li),this},rotateZ:function(t){return Li.makeRotationZ(t),this.applyMatrix4(Li),this},translate:function(t,e,n){return Li.makeTranslation(t,e,n),this.applyMatrix4(Li),this},scale:function(t,e,n){return Li.makeScale(t,e,n),this.applyMatrix4(Li),this},lookAt:function(t){return Ii.lookAt(t),Ii.updateMatrix(),this.applyMatrix4(Ii.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Pi).negate(),this.translate(Pi.x,Pi.y,Pi.z),this},setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var n=new Ti(3*e.vertices.length,3),i=new Ti(3*e.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(e.vertices)),this.setAttribute("color",i.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var r=new Ti(e.lineDistances.length,1);this.setAttribute("lineDistance",r.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},setFromPoints:function(t){for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n];e.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new Ti(e,3)),this},updateFromObject:function(t){var e,n=t.geometry;if(t.isMesh){var i=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(i=void 0,n.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(n);i.verticesNeedUpdate=n.verticesNeedUpdate,i.normalsNeedUpdate=n.normalsNeedUpdate,i.colorsNeedUpdate=n.colorsNeedUpdate,i.uvsNeedUpdate=n.uvsNeedUpdate,i.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=i}return!0===n.verticesNeedUpdate&&(void 0!==(e=this.attributes.position)&&(e.copyVector3sArray(n.vertices),e.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(e=this.attributes.normal)&&(e.copyVector3sArray(n.normals),e.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(e=this.attributes.color)&&(e.copyColorsArray(n.colors),e.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(e=this.attributes.uv)&&(e.copyVector2sArray(n.uvs),e.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(e=this.attributes.lineDistance)&&(e.copyArray(n.lineDistances),e.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(t.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new Di).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.setAttribute("position",new yi(e,3).copyVector3sArray(t.vertices)),0<t.normals.length){var n=new Float32Array(3*t.normals.length);this.setAttribute("normal",new yi(n,3).copyVector3sArray(t.normals))}if(0<t.colors.length){var i=new Float32Array(3*t.colors.length);this.setAttribute("color",new yi(i,3).copyColorsArray(t.colors))}if(0<t.uvs.length){var r=new Float32Array(2*t.uvs.length);this.setAttribute("uv",new yi(r,2).copyVector2sArray(t.uvs))}if(0<t.uvs2.length){var a=new Float32Array(2*t.uvs2.length);this.setAttribute("uv2",new yi(a,2).copyVector2sArray(t.uvs2))}for(var o in this.groups=t.groups,t.morphTargets){for(var s=[],l=t.morphTargets[o],c=0,u=l.length;c<u;c++){var h=l[c],p=new Ti(3*h.data.length,3);p.name=h.name,s.push(p.copyVector3sArray(h.data))}this.morphAttributes[o]=s}if(0<t.skinIndices.length){var d=new Ti(4*t.skinIndices.length,4);this.setAttribute("skinIndex",d.copyVector4sArray(t.skinIndices))}if(0<t.skinWeights.length){var f=new Ti(4*t.skinWeights.length,4);this.setAttribute("skinWeight",f.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Pn);var t=this.attributes.position,e=this.morphAttributes.position;if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(var n=0,i=e.length;n<i;n++){var r=e[n];Ri.setFromBufferAttribute(r),this.morphTargetsRelative?(Ni.addVectors(this.boundingBox.min,Ri.min),this.boundingBox.expandByPoint(Ni),Ni.addVectors(this.boundingBox.max,Ri.max),this.boundingBox.expandByPoint(Ni)):(this.boundingBox.expandByPoint(Ri.min),this.boundingBox.expandByPoint(Ri.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 t=this.attributes.position,e=this.morphAttributes.position;if(t){var n=this.boundingSphere.center;if(Ri.setFromBufferAttribute(t),e)for(var i=0,r=e.length;i<r;i++){var a=e[i];ki.setFromBufferAttribute(a),this.morphTargetsRelative?(Ni.addVectors(Ri.min,ki.min),Ri.expandByPoint(Ni),Ni.addVectors(Ri.max,ki.max),Ri.expandByPoint(Ni)):(Ri.expandByPoint(ki.min),Ri.expandByPoint(ki.max))}Ri.getCenter(n);var o=0;for(i=0,r=t.count;i<r;i++)Ni.fromBufferAttribute(t,i),o=Math.max(o,n.distanceToSquared(Ni));if(e)for(i=0,r=e.length;i<r;i++){a=e[i];for(var s=this.morphTargetsRelative,l=0,c=a.count;l<c;l++)Ni.fromBufferAttribute(a,l),s&&(Pi.fromBufferAttribute(t,l),Ni.add(Pi)),o=Math.max(o,n.distanceToSquared(Ni))}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 t=this.index,e=this.attributes;if(e.position){var n=e.position.array;if(void 0===e.normal)this.setAttribute("normal",new yi(new Float32Array(n.length),3));else for(var i=e.normal.array,r=0,a=i.length;r<a;r++)i[r]=0;var o,s,l,c=e.normal.array,u=new We,h=new We,p=new We,d=new We,f=new We;if(t){var m=t.array;for(r=0,a=t.count;r<a;r+=3)o=3*m[r+0],s=3*m[r+1],l=3*m[r+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(r=0,a=n.length;r<a;r+=9)u.fromArray(n,r),h.fromArray(n,r+3),p.fromArray(n,r+6),d.subVectors(p,h),f.subVectors(u,h),d.cross(f),c[r]=d.x,c[r+1]=d.y,c[r+2]=d.z,c[r+3]=d.x,c[r+4]=d.y,c[r+5]=d.z,c[r+6]=d.x,c[r+7]=d.y,c[r+8]=d.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(t&&t.isBufferGeometry){void 0===e&&(e=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 i in n)if(void 0!==t.attributes[i])for(var r=n[i].array,a=t.attributes[i],o=a.array,s=a.itemSize*e,l=Math.min(o.length,r.length-s),c=0,u=s;c<l;c++,u++)r[u]=o[c];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t)},normalizeNormals:function(){for(var t=this.attributes.normal,e=0,n=t.count;e<n;e++)Ni.x=t.getX(e),Ni.y=t.getY(e),Ni.z=t.getZ(e),Ni.normalize(),t.setXYZ(e,Ni.x,Ni.y,Ni.z)},toNonIndexed:function(){function t(t,e){for(var n=t.array,i=t.itemSize,r=new n.constructor(e.length*i),a=0,o=0,s=0,l=e.length;s<l;s++){a=e[s]*i;for(var c=0;c<i;c++)r[o++]=n[a++]}return new yi(r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new Bi,n=this.index.array,i=this.attributes;for(var r in i){var a=t(i[r],n);e.setAttribute(r,a)}var o=this.morphAttributes;for(r in o){for(var s=[],l=o[r],c=0,u=l.length;c<u;c++)a=t(l[c],n),s.push(a);e.morphAttributes[r]=s}e.morphTargetsRelative=this.morphTargetsRelative;for(var h=this.groups,p=(c=0,h.length);c<p;c++){var d=h[c];e.addGroup(d.start,d.count,d.materialIndex)}return e},toJSON:function(){var t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),0<Object.keys(this.userData).length&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};var i=this.index;null!==i&&(t.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});var r=this.attributes;for(var n in r){var a=(p=r[n]).toJSON();""!==p.name&&(a.name=p.name),t.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&&(t.data.morphAttributes=o,t.data.morphTargetsRelative=this.morphTargetsRelative);var d=this.groups;0<d.length&&(t.data.groups=JSON.parse(JSON.stringify(d)));var f=this.boundingSphere;return null!==f&&(t.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),t},clone:function(){return(new Bi).copy(this)},copy:function(t){var e,n,i;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var r=t.index;null!==r&&this.setIndex(r.clone());var a=t.attributes;for(e in a){var o=a[e];this.setAttribute(e,o.clone())}var s=t.morphAttributes;for(e in s){var l=[],c=s[e];for(n=0,i=c.length;n<i;n++)l.push(c[n].clone());this.morphAttributes[e]=l}this.morphTargetsRelative=t.morphTargetsRelative;var u=t.groups;for(n=0,i=u.length;n<i;n++){var h=u[n];this.addGroup(h.start,h.count,h.materialIndex)}var p=t.boundingBox;null!==p&&(this.boundingBox=p.clone());var d=t.boundingSphere;return null!==d&&(this.boundingSphere=d.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Fi=new Qe,ji=new Hn,Vi=new Nn,zi=new We,Gi=new We,Ui=new We,Hi=new We,Wi=new We,Ji=new We,qi=new We,Xi=new We,Yi=new We,Zi=new Re,$i=new Re,Ki=new Re,Qi=new We,tr=new We;function er(t,e){yn.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new Bi,this.material=void 0!==e?e:new gi,this.updateMorphTargets()}function nr(t,e,n,i,r,a,o,s){if(null===(e.side===l?i.intersectTriangle(o,a,r,!0,s):i.intersectTriangle(r,a,o,e.side!==c,s)))return null;tr.copy(s),tr.applyMatrix4(t.matrixWorld);var u=n.ray.origin.distanceTo(tr);return u<n.near||u>n.far?null:{distance:u,point:tr.clone(),object:t}}function ir(t,e,n,i,r,a,o,s,l,c,u,h){zi.fromBufferAttribute(r,c),Gi.fromBufferAttribute(r,u),Ui.fromBufferAttribute(r,h);var p=t.morphTargetInfluences;if(e.morphTargets&&a&&p){qi.set(0,0,0),Xi.set(0,0,0),Yi.set(0,0,0);for(var d=0,f=a.length;d<f;d++){var m=p[d],g=a[d];0!==m&&(Hi.fromBufferAttribute(g,c),Wi.fromBufferAttribute(g,u),Ji.fromBufferAttribute(g,h),o?(qi.addScaledVector(Hi,m),Xi.addScaledVector(Wi,m),Yi.addScaledVector(Ji,m)):(qi.addScaledVector(Hi.sub(zi),m),Xi.addScaledVector(Wi.sub(Gi),m),Yi.addScaledVector(Ji.sub(Ui),m)))}zi.add(qi),Gi.add(Xi),Ui.add(Yi)}var v=nr(t,e,n,i,zi,Gi,Ui,Qi);if(v){s&&(Zi.fromBufferAttribute(s,c),$i.fromBufferAttribute(s,u),Ki.fromBufferAttribute(s,h),v.uv=ai.getUV(Qi,zi,Gi,Ui,Zi,$i,Ki,new Re)),l&&(Zi.fromBufferAttribute(l,c),$i.fromBufferAttribute(l,u),Ki.fromBufferAttribute(l,h),v.uv2=ai.getUV(Qi,zi,Gi,Ui,Zi,$i,Ki,new Re));var y=new di(c,u,h);ai.getNormal(zi,Gi,Ui,y.normal),v.face=y}return v}er.prototype=Object.assign(Object.create(yn.prototype),{constructor:er,isMesh:!0,copy:function(t){return yn.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,e,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,a=Object.keys(r);if(0<a.length){var o=r[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=o.length;t<e;t++)n=o[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{var s=i.morphTargets;void 0!==s&&0<s.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){var n,i=this.geometry,r=this.material,a=this.matrixWorld;if(void 0!==r&&(null===i.boundingSphere&&i.computeBoundingSphere(),Vi.copy(i.boundingSphere),Vi.applyMatrix4(a),!1!==t.ray.intersectsSphere(Vi)&&(Fi.getInverse(a),ji.copy(t.ray).applyMatrix4(Fi),null===i.boundingBox||!1!==ji.intersectsBox(i.boundingBox))))if(i.isBufferGeometry){var o,s,l,c,u,h,p,d,f,m=i.index,g=i.attributes.position,v=i.morphAttributes.position,y=i.morphTargetsRelative,x=i.attributes.uv,b=i.attributes.uv2,w=i.groups,M=i.drawRange;if(null!==m)if(Array.isArray(r))for(c=0,h=w.length;c<h;c++)for(f=r[(d=w[c]).materialIndex],u=Math.max(d.start,M.start),p=Math.min(d.start+d.count,M.start+M.count);u<p;u+=3)o=m.getX(u),s=m.getX(u+1),l=m.getX(u+2),(n=ir(this,f,t,ji,g,v,y,x,b,o,s,l))&&(n.faceIndex=Math.floor(u/3),n.face.materialIndex=d.materialIndex,e.push(n));else for(c=Math.max(0,M.start),h=Math.min(m.count,M.start+M.count);c<h;c+=3)o=m.getX(c),s=m.getX(c+1),l=m.getX(c+2),(n=ir(this,r,t,ji,g,v,y,x,b,o,s,l))&&(n.faceIndex=Math.floor(c/3),e.push(n));else if(void 0!==g)if(Array.isArray(r))for(c=0,h=w.length;c<h;c++)for(f=r[(d=w[c]).materialIndex],u=Math.max(d.start,M.start),p=Math.min(d.start+d.count,M.start+M.count);u<p;u+=3)(n=ir(this,f,t,ji,g,v,y,x,b,o=u,s=u+1,l=u+2))&&(n.faceIndex=Math.floor(u/3),n.face.materialIndex=d.materialIndex,e.push(n));else for(c=Math.max(0,M.start),h=Math.min(g.count,M.start+M.count);c<h;c+=3)(n=ir(this,r,t,ji,g,v,y,x,b,o=c,s=c+1,l=c+2))&&(n.faceIndex=Math.floor(c/3),e.push(n))}else if(i.isGeometry){var _,S,C,T,E=Array.isArray(r),D=i.vertices,A=i.faces,O=i.faceVertexUvs[0];0<O.length&&(T=O);for(var L=0,I=A.length;L<I;L++){var P=A[L],R=E?r[P.materialIndex]:r;if(void 0!==R&&(_=D[P.a],S=D[P.b],C=D[P.c],n=nr(this,R,t,ji,_,S,C,Qi))){if(T&&T[L]){var k=T[L];Zi.copy(k[0]),$i.copy(k[1]),Ki.copy(k[2]),n.uv=ai.getUV(Qi,_,S,C,Zi,$i,Ki,new Re)}n.face=P,n.faceIndex=L,e.push(n)}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var rr=0,ar=new Qe,or=new yn,sr=new We;function lr(){Object.defineProperty(this,"id",{value:rr+=2}),this.uuid=Pe.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}lr.prototype=Object.assign(Object.create(Ae.prototype),{constructor:lr,isGeometry:!0,applyMatrix4:function(t){for(var e=(new ke).getNormalMatrix(t),n=0,i=this.vertices.length;n<i;n++)this.vertices[n].applyMatrix4(t);for(n=0,i=this.faces.length;n<i;n++){var r=this.faces[n];r.normal.applyMatrix3(e).normalize();for(var a=0,o=r.vertexNormals.length;a<o;a++)r.vertexNormals[a].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(t){return ar.makeRotationX(t),this.applyMatrix4(ar),this},rotateY:function(t){return ar.makeRotationY(t),this.applyMatrix4(ar),this},rotateZ:function(t){return ar.makeRotationZ(t),this.applyMatrix4(ar),this},translate:function(t,e,n){return ar.makeTranslation(t,e,n),this.applyMatrix4(ar),this},scale:function(t,e,n){return ar.makeScale(t,e,n),this.applyMatrix4(ar),this},lookAt:function(t){return or.lookAt(t),or.updateMatrix(),this.applyMatrix4(or.matrix),this},fromBufferGeometry:function(t){var e=this,n=null!==t.index?t.index.array:void 0,i=t.attributes;if(void 0===i.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var r=i.position.array,a=void 0!==i.normal?i.normal.array:void 0,o=void 0!==i.color?i.color.array:void 0,s=void 0!==i.uv?i.uv.array:void 0,l=void 0!==i.uv2?i.uv2.array:void 0;void 0!==l&&(this.faceVertexUvs[1]=[]);for(var c=0;c<r.length;c+=3)e.vertices.push((new We).fromArray(r,c)),void 0!==o&&e.colors.push((new ci).fromArray(o,c));function u(t,n,i,r){var c=void 0===o?[]:[e.colors[t].clone(),e.colors[n].clone(),e.colors[i].clone()],u=new di(t,n,i,void 0===a?[]:[(new We).fromArray(a,3*t),(new We).fromArray(a,3*n),(new We).fromArray(a,3*i)],c,r);e.faces.push(u),void 0!==s&&e.faceVertexUvs[0].push([(new Re).fromArray(s,2*t),(new Re).fromArray(s,2*n),(new Re).fromArray(s,2*i)]),void 0!==l&&e.faceVertexUvs[1].push([(new Re).fromArray(l,2*t),(new Re).fromArray(l,2*n),(new Re).fromArray(l,2*i)])}var h=t.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<r.length/3;c+=3)u(c,c+1,c+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(sr).negate(),this.translate(sr.x,sr.y,sr.z),this},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,n=0===e?1:1/e,i=new Qe;return i.set(n,0,0,-n*t.x,0,n,0,-n*t.y,0,0,n,-n*t.z,0,0,0,1),this.applyMatrix4(i),this},computeFaceNormals:function(){for(var t=new We,e=new We,n=0,i=this.faces.length;n<i;n++){var r=this.faces[n],a=this.vertices[r.a],o=this.vertices[r.b],s=this.vertices[r.c];t.subVectors(s,o),e.subVectors(a,o),t.cross(e),t.normalize(),r.normal.copy(t)}},computeVertexNormals:function(t){var e,n,i,r,a,o;for(void 0===t&&(t=!0),o=new Array(this.vertices.length),e=0,n=this.vertices.length;e<n;e++)o[e]=new We;if(t){var s,l,c,u=new We,h=new We;for(i=0,r=this.faces.length;i<r;i++)a=this.faces[i],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(),i=0,r=this.faces.length;i<r;i++)o[(a=this.faces[i]).a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(e=0,n=this.vertices.length;e<n;e++)o[e].normalize();for(i=0,r=this.faces.length;i<r;i++){var p=(a=this.faces[i]).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 t,e,n;for(this.computeFaceNormals(),t=0,e=this.faces.length;t<e;t++){var i=(n=this.faces[t]).vertexNormals;3===i.length?(i[0].copy(n.normal),i[1].copy(n.normal),i[2].copy(n.normal)):(i[0]=n.normal.clone(),i[1]=n.normal.clone(),i[2]=n.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,n,i,r;for(n=0,i=this.faces.length;n<i;n++)for((r=this.faces[n]).__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),t=0,e=r.vertexNormals.length;t<e;t++)r.__originalVertexNormals[t]?r.__originalVertexNormals[t].copy(r.vertexNormals[t]):r.__originalVertexNormals[t]=r.vertexNormals[t].clone();var a=new lr;for(a.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];var o=this.morphNormals[t].faceNormals,s=this.morphNormals[t].vertexNormals;for(n=0,i=this.faces.length;n<i;n++)l=new We,c={a:new We,b:new We,c:new We},o.push(l),s.push(c)}var l,c,u=this.morphNormals[t];for(a.vertices=this.morphTargets[t].vertices,a.computeFaceNormals(),a.computeVertexNormals(),n=0,i=this.faces.length;n<i;n++)r=this.faces[n],l=u.faceNormals[n],c=u.vertexNormals[n],l.copy(r.normal),c.a.copy(r.vertexNormals[0]),c.b.copy(r.vertexNormals[1]),c.c.copy(r.vertexNormals[2])}for(n=0,i=this.faces.length;n<i;n++)(r=this.faces[n]).normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Pn),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Nn),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,n){if(t&&t.isGeometry){var i,r=this.vertices.length,a=this.vertices,o=t.vertices,s=this.faces,l=t.faces,c=this.colors,u=t.colors;void 0===n&&(n=0),void 0!==e&&(i=(new ke).getNormalMatrix(e));for(var h=0,p=o.length;h<p;h++){var d=o[h].clone();void 0!==e&&d.applyMatrix4(e),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 di(v.a+r,v.b+r,v.c+r)).normal.copy(v.normal),void 0!==i&&f.normal.applyMatrix3(i).normalize();for(var b=0,w=y.length;b<w;b++)m=y[b].clone(),void 0!==i&&m.applyMatrix3(i).normalize(),f.vertexNormals.push(m);for(f.color.copy(v.color),b=0,w=x.length;b<w;b++)g=x[b],f.vertexColors.push(g.clone());f.materialIndex=v.materialIndex+n,s.push(f)}for(h=0,p=t.faceVertexUvs.length;h<p;h++){var M=t.faceVertexUvs[h];for(void 0===this.faceVertexUvs[h]&&(this.faceVertexUvs[h]=[]),b=0,w=M.length;b<w;b++){for(var _=M[b],S=[],C=0,T=_.length;C<T;C++)S.push(_[C].clone());this.faceVertexUvs[h].push(S)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t)},mergeMesh:function(t){t&&t.isMesh?(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t)},mergeVertices:function(){var t,e,n,i,r,a,o,s,l={},c=[],u=[],h=Math.pow(10,4);for(n=0,i=this.vertices.length;n<i;n++)t=this.vertices[n],void 0===l[e=Math.round(t.x*h)+"_"+Math.round(t.y*h)+"_"+Math.round(t.z*h)]?(l[e]=n,c.push(this.vertices[n]),u[n]=c.length-1):u[n]=u[l[e]];var p=[];for(n=0,i=this.faces.length;n<i;n++){(r=this.faces[n]).a=u[r.a],r.b=u[r.b],r.c=u[r.c],a=[r.a,r.b,r.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(t){this.vertices=[];for(var e=0,n=t.length;e<n;e++){var i=t[e];this.vertices.push(new We(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){for(var t=this.faces,e=t.length,n=0;n<e;n++)t[n]._id=n;t.sort(function(t,e){return t.materialIndex-e.materialIndex});var i,r,a=this.faceVertexUvs[0],o=this.faceVertexUvs[1];for(a&&a.length===e&&(i=[]),o&&o.length===e&&(r=[]),n=0;n<e;n++){var s=t[n]._id;i&&i.push(a[s]),r&&r.push(o[s])}i&&(this.faceVertexUvs[0]=i),r&&(this.faceVertexUvs[1]=r)},toJSON:function(){var t={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}for(var i=[],r=0;r<this.vertices.length;r++){var a=this.vertices[r];i.push(a.x,a.y,a.z)}var o=[],s=[],l={},c=[],u={},h=[],p={};for(r=0;r<this.faces.length;r++){var d=this.faces[r],f=void 0!==this.faceVertexUvs[0][r],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=_(x=_(x=_(x=_(x=_(x=_(x=_(x=_(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 b=this.faceVertexUvs[0][r];o.push(T(b[0]),T(b[1]),T(b[2]))}if(m&&o.push(S(d.normal)),g){var w=d.vertexNormals;o.push(S(w[0]),S(w[1]),S(w[2]))}if(v&&o.push(C(d.color)),y){var M=d.vertexColors;o.push(C(M[0]),C(M[1]),C(M[2]))}}function _(t,e,n){return n?t|1<<e:t&~(1<<e)}function S(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==l[e]||(l[e]=s.length/3,s.push(t.x,t.y,t.z)),l[e]}function C(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==u[e]||(u[e]=c.length,c.push(t.getHex())),u[e]}function T(t){var e=t.x.toString()+t.y.toString();return void 0!==p[e]||(p[e]=h.length/2,h.push(t.x,t.y)),p[e]}return t.data={},t.data.vertices=i,t.data.normals=s,0<c.length&&(t.data.colors=c),0<h.length&&(t.data.uvs=[h]),t.data.faces=o,t},clone:function(){return(new lr).copy(this)},copy:function(t){var e,n,i,r,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=t.name;var s=t.vertices;for(e=0,n=s.length;e<n;e++)this.vertices.push(s[e].clone());var l=t.colors;for(e=0,n=l.length;e<n;e++)this.colors.push(l[e].clone());var c=t.faces;for(e=0,n=c.length;e<n;e++)this.faces.push(c[e].clone());for(e=0,n=t.faceVertexUvs.length;e<n;e++){var u=t.faceVertexUvs[e];for(void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]),i=0,r=u.length;i<r;i++){var h=u[i],p=[];for(a=0,o=h.length;a<o;a++){var d=h[a];p.push(d.clone())}this.faceVertexUvs[e].push(p)}}var f=t.morphTargets;for(e=0,n=f.length;e<n;e++){var m={};if(m.name=f[e].name,void 0!==f[e].vertices)for(m.vertices=[],i=0,r=f[e].vertices.length;i<r;i++)m.vertices.push(f[e].vertices[i].clone());if(void 0!==f[e].normals)for(m.normals=[],i=0,r=f[e].normals.length;i<r;i++)m.normals.push(f[e].normals[i].clone());this.morphTargets.push(m)}var g=t.morphNormals;for(e=0,n=g.length;e<n;e++){var v={};if(void 0!==g[e].vertexNormals)for(v.vertexNormals=[],i=0,r=g[e].vertexNormals.length;i<r;i++){var y=g[e].vertexNormals[i],x={};x.a=y.a.clone(),x.b=y.b.clone(),x.c=y.c.clone(),v.vertexNormals.push(x)}if(void 0!==g[e].faceNormals)for(v.faceNormals=[],i=0,r=g[e].faceNormals.length;i<r;i++)v.faceNormals.push(g[e].faceNormals[i].clone());this.morphNormals.push(v)}var b=t.skinWeights;for(e=0,n=b.length;e<n;e++)this.skinWeights.push(b[e].clone());var w=t.skinIndices;for(e=0,n=w.length;e<n;e++)this.skinIndices.push(w[e].clone());var M=t.lineDistances;for(e=0,n=M.length;e<n;e++)this.lineDistances.push(M[e]);var _=t.boundingBox;null!==_&&(this.boundingBox=_.clone());var S=t.boundingSphere;return null!==S&&(this.boundingSphere=S.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var cr=function(t){function e(e,n,i,r,a,o){t.call(this),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:i,widthSegments:r,heightSegments:a,depthSegments:o},this.fromBufferGeometry(new ur(e,n,i,r,a,o)),this.mergeVertices()}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e}(lr),ur=function(t){function e(e,n,i,r,a,o){t.call(this),this.type="BoxBufferGeometry",this.parameters={width:e,height:n,depth:i,widthSegments:r,heightSegments:a,depthSegments:o};var s=this;e=e||1,n=n||1,i=i||1,r=Math.floor(r)||1,a=Math.floor(a)||1;var l=[],c=[],u=[],h=[],p=0,d=0;function f(t,e,n,i,r,a,o,f,m,g,v){var y,x,b=a/m,w=o/g,M=a/2,_=o/2,S=f/2,C=m+1,T=g+1,E=0,D=0,A=new We;for(x=0;x<T;x++){var O=x*w-_;for(y=0;y<C;y++){var L=y*b-M;A[t]=L*i,A[e]=O*r,A[n]=S,c.push(A.x,A.y,A.z),A[t]=0,A[e]=0,A[n]=0<f?1:-1,u.push(A.x,A.y,A.z),h.push(y/m),h.push(1-x/g),E+=1}}for(x=0;x<g;x++)for(y=0;y<m;y++){var I=p+y+C*x,P=p+y+C*(x+1),R=p+(y+1)+C*(x+1),k=p+(y+1)+C*x;l.push(I,P,k),l.push(P,R,k),D+=6}s.addGroup(d,D,v),d+=D,p+=E}f("z","y","x",-1,-1,i,n,e,o=Math.floor(o)||1,a,0),f("z","y","x",1,-1,i,n,-e,o,a,1),f("x","z","y",1,1,e,i,n,r,o,2),f("x","z","y",1,-1,e,i,-n,r,o,3),f("x","y","z",1,-1,e,n,i,r,a,4),f("x","y","z",-1,-1,e,n,-i,r,a,5),this.setIndex(l),this.setAttribute("position",new Ti(c,3)),this.setAttribute("normal",new Ti(u,3)),this.setAttribute("uv",new Ti(h,2))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e}(Bi);function hr(t){var e={};for(var n in t)for(var i in e[n]={},t[n]){var r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}return e}function pr(t){for(var e={},n=0;n<t.length;n++){var i=hr(t[n]);for(var r in i)e[r]=i[r]}return e}var dr={clone:hr,merge:pr},fr="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",mr="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";function gr(t){mi.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=fr,this.fragmentShader=mr,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!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function vr(){yn.call(this),this.type="Camera",this.matrixWorldInverse=new Qe,this.projectionMatrix=new Qe,this.projectionMatrixInverse=new Qe}function yr(t,e,n,i){vr.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==i?i:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function xr(t,e,n,i){yn.call(this),this.type="CubeCamera";var r=new yr(90,1,t,e);r.up.set(0,-1,0),r.lookAt(new We(1,0,0)),this.add(r);var a=new yr(90,1,t,e);a.up.set(0,-1,0),a.lookAt(new We(-1,0,0)),this.add(a);var o=new yr(90,1,t,e);o.up.set(0,0,1),o.lookAt(new We(0,1,0)),this.add(o);var s=new yr(90,1,t,e);s.up.set(0,0,-1),s.lookAt(new We(0,-1,0)),this.add(s);var l=new yr(90,1,t,e);l.up.set(0,-1,0),l.lookAt(new We(0,0,1)),this.add(l);var c=new yr(90,1,t,e);c.up.set(0,-1,0),c.lookAt(new We(0,0,-1)),this.add(c),i=i||{format:Tt,magFilter:ut,minFilter:ut},this.renderTarget=new br(n,i),this.renderTarget.texture.name="CubeCamera",this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var n=t.getRenderTarget(),i=this.renderTarget,u=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0),t.render(e,r),t.setRenderTarget(i,1),t.render(e,a),t.setRenderTarget(i,2),t.render(e,o),t.setRenderTarget(i,3),t.render(e,s),t.setRenderTarget(i,4),t.render(e,l),i.texture.generateMipmaps=u,t.setRenderTarget(i,5),t.render(e,c),t.setRenderTarget(n)},this.clear=function(t,e,n,i){for(var r=t.getRenderTarget(),a=this.renderTarget,o=0;o<6;o++)t.setRenderTarget(a,o),t.clear(e,n,i);t.setRenderTarget(r)}}function br(t,e,n){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=n),Ve.call(this,t,t,e)}function wr(t,e,n,i,r,a,o,s,l,c,u,h){Fe.call(this,null,a,o,s,l,c,i,r,u,h),this.image={data:t||null,width:e||1,height:n||1},this.magFilter=void 0!==l?l:st,this.minFilter=void 0!==c?c:st,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}((gr.prototype=Object.create(mi.prototype)).constructor=gr).prototype.isShaderMaterial=!0,gr.prototype.copy=function(t){return mi.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=hr(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},gr.prototype.toJSON=function(t){var e=mi.prototype.toJSON.call(this,t);for(var n in e.uniforms={},this.uniforms){var i=this.uniforms[n].value;i&&i.isTexture?e.uniforms[n]={type:"t",value:i.toJSON(t).uuid}:i&&i.isColor?e.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?e.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?e.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?e.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?e.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?e.uniforms[n]={type:"m4",value:i.toArray()}:e.uniforms[n]={value:i}}0<Object.keys(this.defines).length&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;var r={};for(var a in this.extensions)!0===this.extensions[a]&&(r[a]=!0);return 0<Object.keys(r).length&&(e.extensions=r),e},vr.prototype=Object.assign(Object.create(yn.prototype),{constructor:vr,isCamera:!0,copy:function(t,e){return yn.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new We),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){yn.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(t,e){yn.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),yr.prototype=Object.assign(Object.create(vr.prototype),{constructor:yr,isPerspectiveCamera:!0,copy:function(t,e){return vr.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*Pe.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*Pe.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*Pe.RAD2DEG*Math.atan(Math.tan(.5*Pe.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(t,e,n,i,r,a){this.aspect=t/e,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=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*Pe.DEG2RAD*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;r+=a.offsetX*i/o,e-=a.offsetY*n/s,i*=a.width/o,n*=a.height/s}var l=this.filmOffset;0!==l&&(r+=t*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=yn.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}),(xr.prototype=Object.create(yn.prototype)).constructor=xr,((br.prototype=Object.create(Ve.prototype)).constructor=br).prototype.isWebGLCubeRenderTarget=!0,br.prototype.fromEquirectangularTexture=function(t,e){this.texture.type=e.type,this.texture.format=e.format,this.texture.encoding=e.encoding;var n=new xn,i={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")},r=new gr({type:"CubemapFromEquirect",uniforms:hr(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:l,blending:p});r.uniforms.tEquirect.value=e;var a=new er(new ur(5,5,5),r);n.add(a);var o=new xr(1,10,1);return o.renderTarget=this,o.renderTarget.texture.name="CubeCameraTexture",o.update(t,n),a.geometry.dispose(),a.material.dispose(),this},((wr.prototype=Object.create(Fe.prototype)).constructor=wr).prototype.isDataTexture=!0;var Mr=new Nn,_r=new We;function Sr(t,e,n,i,r,a){this.planes=[void 0!==t?t:new Xn,void 0!==e?e:new Xn,void 0!==n?n:new Xn,void 0!==i?i:new Xn,void 0!==r?r:new Xn,void 0!==a?a:new Xn]}Object.assign(Sr.prototype,{set:function(t,e,n,i,r,a){var o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(i),o[4].copy(r),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,n=0;n<6;n++)e[n].copy(t.planes[n]);return this},setFromProjectionMatrix:function(t){var e=this.planes,n=t.elements,i=n[0],r=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 e[0].setComponents(o-i,u-s,f-h,y-m).normalize(),e[1].setComponents(o+i,u+s,f+h,y+m).normalize(),e[2].setComponents(o+r,u+l,f+p,y+g).normalize(),e[3].setComponents(o-r,u-l,f-p,y-g).normalize(),e[4].setComponents(o-a,u-c,f-d,y-v).normalize(),e[5].setComponents(o+a,u+c,f+d,y+v).normalize(),this},intersectsObject:function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Mr.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Mr)},intersectsSprite:function(t){return Mr.center.set(0,0,0),Mr.radius=.7071067811865476,Mr.applyMatrix4(t.matrixWorld),this.intersectsSphere(Mr)},intersectsSphere:function(t){for(var e=this.planes,n=t.center,i=-t.radius,r=0;r<6;r++)if(e[r].distanceToPoint(n)<i)return!1;return!0},intersectsBox:function(t){for(var e=this.planes,n=0;n<6;n++){var i=e[n];if(_r.x=0<i.normal.x?t.max.x:t.min.x,_r.y=0<i.normal.y?t.max.y:t.min.y,_r.z=0<i.normal.z?t.max.z:t.min.z,i.distanceToPoint(_r)<0)return!1}return!0},containsPoint:function(t){for(var e=this.planes,n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}});var Cr={common:{diffuse:{value:new ci(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new ke},uv2Transform:{value:new ke},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 Re(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 ci(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 ci(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new ke}},sprite:{diffuse:{value:new ci(15658734)},opacity:{value:1},center:{value:new Re(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new ke}}};function Tr(){var t=null,e=!1,n=null;function i(r,a){!1!==e&&(n(r,a),t.requestAnimationFrame(i))}return{start:function(){!0!==e&&null!==n&&(t.requestAnimationFrame(i),e=!0)},stop:function(){e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function Er(t,e,n,i){lr.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i},this.fromBufferGeometry(new Dr(t,e,n,i)),this.mergeVertices()}function Dr(t,e,n,i){Bi.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};var r,a,o=(t=t||1)/2,s=(e=e||1)/2,l=Math.floor(n)||1,c=Math.floor(i)||1,u=l+1,h=c+1,p=t/l,d=e/c,f=[],m=[],g=[],v=[];for(a=0;a<h;a++){var y=a*d-s;for(r=0;r<u;r++){var x=r*p-o;m.push(x,-y,0),g.push(0,0,1),v.push(r/l),v.push(1-a/c)}}for(a=0;a<c;a++)for(r=0;r<l;r++){var b=r+u*a,w=r+u*(a+1),M=r+1+u*(a+1),_=r+1+u*a;f.push(b,w,_),f.push(w,M,_)}this.setIndex(f),this.setAttribute("position",new Ti(m,3)),this.setAttribute("normal",new Ti(g,3)),this.setAttribute("uv",new Ti(v,2))}(Er.prototype=Object.create(lr.prototype)).constructor=Er,(Dr.prototype=Object.create(Bi.prototype)).constructor=Dr;var Ar={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}"},Or={basic:{uniforms:pr([Cr.common,Cr.specularmap,Cr.envmap,Cr.aomap,Cr.lightmap,Cr.fog]),vertexShader:Ar.meshbasic_vert,fragmentShader:Ar.meshbasic_frag},lambert:{uniforms:pr([Cr.common,Cr.specularmap,Cr.envmap,Cr.aomap,Cr.lightmap,Cr.emissivemap,Cr.fog,Cr.lights,{emissive:{value:new ci(0)}}]),vertexShader:Ar.meshlambert_vert,fragmentShader:Ar.meshlambert_frag},phong:{uniforms:pr([Cr.common,Cr.specularmap,Cr.envmap,Cr.aomap,Cr.lightmap,Cr.emissivemap,Cr.bumpmap,Cr.normalmap,Cr.displacementmap,Cr.fog,Cr.lights,{emissive:{value:new ci(0)},specular:{value:new ci(1118481)},shininess:{value:30}}]),vertexShader:Ar.meshphong_vert,fragmentShader:Ar.meshphong_frag},standard:{uniforms:pr([Cr.common,Cr.envmap,Cr.aomap,Cr.lightmap,Cr.emissivemap,Cr.bumpmap,Cr.normalmap,Cr.displacementmap,Cr.roughnessmap,Cr.metalnessmap,Cr.fog,Cr.lights,{emissive:{value:new ci(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:Ar.meshphysical_vert,fragmentShader:Ar.meshphysical_frag},toon:{uniforms:pr([Cr.common,Cr.specularmap,Cr.aomap,Cr.lightmap,Cr.emissivemap,Cr.bumpmap,Cr.normalmap,Cr.displacementmap,Cr.gradientmap,Cr.fog,Cr.lights,{emissive:{value:new ci(0)},specular:{value:new ci(1118481)},shininess:{value:30}}]),vertexShader:Ar.meshtoon_vert,fragmentShader:Ar.meshtoon_frag},matcap:{uniforms:pr([Cr.common,Cr.bumpmap,Cr.normalmap,Cr.displacementmap,Cr.fog,{matcap:{value:null}}]),vertexShader:Ar.meshmatcap_vert,fragmentShader:Ar.meshmatcap_frag},points:{uniforms:pr([Cr.points,Cr.fog]),vertexShader:Ar.points_vert,fragmentShader:Ar.points_frag},dashed:{uniforms:pr([Cr.common,Cr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ar.linedashed_vert,fragmentShader:Ar.linedashed_frag},depth:{uniforms:pr([Cr.common,Cr.displacementmap]),vertexShader:Ar.depth_vert,fragmentShader:Ar.depth_frag},normal:{uniforms:pr([Cr.common,Cr.bumpmap,Cr.normalmap,Cr.displacementmap,{opacity:{value:1}}]),vertexShader:Ar.normal_vert,fragmentShader:Ar.normal_frag},sprite:{uniforms:pr([Cr.sprite,Cr.fog]),vertexShader:Ar.sprite_vert,fragmentShader:Ar.sprite_frag},background:{uniforms:{uvTransform:{value:new ke},t2D:{value:null}},vertexShader:Ar.background_vert,fragmentShader:Ar.background_frag},cube:{uniforms:pr([Cr.envmap,{opacity:{value:1}}]),vertexShader:Ar.cube_vert,fragmentShader:Ar.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ar.equirect_vert,fragmentShader:Ar.equirect_frag},distanceRGBA:{uniforms:pr([Cr.common,Cr.displacementmap,{referencePosition:{value:new We},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ar.distanceRGBA_vert,fragmentShader:Ar.distanceRGBA_frag},shadow:{uniforms:pr([Cr.lights,Cr.fog,{color:{value:new ci(0)},opacity:{value:1}}]),vertexShader:Ar.shadow_vert,fragmentShader:Ar.shadow_frag}};function Lr(t,e,n,i){var r,a,o=new ci(0),c=0,u=null,h=0,p=null;function d(t,n){e.buffers.color.setClear(t.r,t.g,t.b,n,i)}return{getClearColor:function(){return o},setClearColor:function(t,e){o.set(t),d(o,c=void 0!==e?e:1)},getClearAlpha:function(){return c},setClearAlpha:function(t){d(o,c=t)},render:function(e,i,f,m){var g=i.background,v=t.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),(t.autoClear||m)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),g&&(g.isCubeTexture||g.isWebGLCubeRenderTarget||g.mapping===nt)){void 0===a&&((a=new er(new ur(1,1,1),new gr({type:"BackgroundCubeMaterial",uniforms:hr(Or.cube.uniforms),vertexShader:Or.cube.vertexShader,fragmentShader:Or.cube.fragmentShader,side:l,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(t,e,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===t.toneMapping||(a.material.needsUpdate=!0,u=g,h=x.version,p=t.toneMapping),e.unshift(a,a.geometry,a.material,0,0,null)}else g&&g.isTexture&&(void 0===r&&((r=new er(new Dr(2,2),new gr({type:"BackgroundMaterial",uniforms:hr(Or.background.uniforms),vertexShader:Or.background.vertexShader,fragmentShader:Or.background.fragmentShader,side:s,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(r.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(r)),!0===(r.material.uniforms.t2D.value=g).matrixAutoUpdate&&g.updateMatrix(),r.material.uniforms.uvTransform.value.copy(g.matrix),u===g&&h===g.version&&p===t.toneMapping||(r.material.needsUpdate=!0,h=(u=g).version,p=t.toneMapping),e.unshift(r,r.geometry,r.material,0,0,null))}}}function Ir(t,e){return Math.abs(e[1])-Math.abs(t[1])}function Pr(t,e,n,i,r,a,o,s,l,c){Fe.call(this,t=void 0!==t?t:[],e=void 0!==e?e:$,n,i,r,a,o=void 0!==o?o:Tt,s,l,c),this.flipY=!1}function Rr(t,e,n,i){Fe.call(this,null),this.image={data:t||null,width:e||1,height:n||1,depth:i||1},this.magFilter=st,this.minFilter=st,this.wrapR=at,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function kr(t,e,n,i){Fe.call(this,null),this.image={data:t||null,width:e||1,height:n||1,depth:i||1},this.magFilter=st,this.minFilter=st,this.wrapR=at,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}Or.physical={uniforms:pr([Or.standard.uniforms,{transparency:{value:0},clearcoat:{value:0},clearcoatRoughness:{value:0},sheen:{value:new ci(0)},clearcoatNormalScale:{value:new Re(1,1)},clearcoatNormalMap:{value:null}}]),vertexShader:Ar.meshphysical_vert,fragmentShader:Ar.meshphysical_frag},((Pr.prototype=Object.create(Fe.prototype)).constructor=Pr).prototype.isCubeTexture=!0,Object.defineProperty(Pr.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),((Rr.prototype=Object.create(Fe.prototype)).constructor=Rr).prototype.isDataTexture2DArray=!0,((kr.prototype=Object.create(Fe.prototype)).constructor=kr).prototype.isDataTexture3D=!0;var Nr=new Fe,Br=new Rr,Fr=new kr,jr=new Pr,Vr=[],zr=[],Gr=new Float32Array(16),Ur=new Float32Array(9),Hr=new Float32Array(4);function Wr(t,e,n){var i=t[0];if(i<=0||0<i)return t;var r=e*n,a=Vr[r];if(void 0===a&&(a=new Float32Array(r),Vr[r]=a),0!==e){i.toArray(a,0);for(var o=1,s=0;o!==e;++o)s+=n,t[o].toArray(a,s)}return a}function Jr(t,e){if(t.length===e.length){for(var n=0,i=t.length;n<i;n++)if(t[n]!==e[n])return;return 1}}function qr(t,e){for(var n=0,i=e.length;n<i;n++)t[n]=e[n]}function Xr(t,e){var n=zr[e];void 0===n&&(n=new Int32Array(e),zr[e]=n);for(var i=0;i!==e;++i)n[i]=t.allocateTextureUnit();return n}function Yr(t,e){var n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function Zr(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Jr(n,e))return;t.uniform2fv(this.addr,e),qr(n,e)}}function $r(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(Jr(n,e))return;t.uniform3fv(this.addr,e),qr(n,e)}}function Kr(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Jr(n,e))return;t.uniform4fv(this.addr,e),qr(n,e)}}function Qr(t,e){var n=this.cache,i=e.elements;if(void 0===i){if(Jr(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),qr(n,e)}else{if(Jr(n,i))return;Hr.set(i),t.uniformMatrix2fv(this.addr,!1,Hr),qr(n,i)}}function ta(t,e){var n=this.cache,i=e.elements;if(void 0===i){if(Jr(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),qr(n,e)}else{if(Jr(n,i))return;Ur.set(i),t.uniformMatrix3fv(this.addr,!1,Ur),qr(n,i)}}function ea(t,e){var n=this.cache,i=e.elements;if(void 0===i){if(Jr(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),qr(n,e)}else{if(Jr(n,i))return;Gr.set(i),t.uniformMatrix4fv(this.addr,!1,Gr),qr(n,i)}}function na(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.safeSetTexture2D(e||Nr,r)}function ia(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(e||Br,r)}function ra(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(e||Fr,r)}function aa(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.safeSetTextureCube(e||jr,r)}function oa(t,e){var n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function sa(t,e){var n=this.cache;Jr(n,e)||(t.uniform2iv(this.addr,e),qr(n,e))}function la(t,e){var n=this.cache;Jr(n,e)||(t.uniform3iv(this.addr,e),qr(n,e))}function ca(t,e){var n=this.cache;Jr(n,e)||(t.uniform4iv(this.addr,e),qr(n,e))}function ua(t,e){var n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function ha(t,e){t.uniform1fv(this.addr,e)}function pa(t,e){t.uniform1iv(this.addr,e)}function da(t,e){t.uniform2iv(this.addr,e)}function fa(t,e){t.uniform3iv(this.addr,e)}function ma(t,e){t.uniform4iv(this.addr,e)}function ga(t,e){var n=Wr(e,this.size,2);t.uniform2fv(this.addr,n)}function va(t,e){var n=Wr(e,this.size,3);t.uniform3fv(this.addr,n)}function ya(t,e){var n=Wr(e,this.size,4);t.uniform4fv(this.addr,n)}function xa(t,e){var n=Wr(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function ba(t,e){var n=Wr(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function wa(t,e){var n=Wr(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function Ma(t,e,n){var i=e.length,r=Xr(n,i);t.uniform1iv(this.addr,r);for(var a=0;a!==i;++a)n.safeSetTexture2D(e[a]||Nr,r[a])}function _a(t,e,n){var i=e.length,r=Xr(n,i);t.uniform1iv(this.addr,r);for(var a=0;a!==i;++a)n.safeSetTextureCube(e[a]||jr,r[a])}function Sa(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=function(t){switch(e.type){case 5126:return Yr;case 35664:return Zr;case 35665:return $r;case 35666:return Kr;case 35674:return Qr;case 35675:return ta;case 35676:return ea;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 ra;case 35680:case 36300:case 36308:case 36293:return aa;case 36289:case 36303:case 36311:case 36292:return ia}}()}function Ca(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=function(t){switch(e.type){case 5126:return ha;case 35664:return ga;case 35665:return va;case 35666:return ya;case 35674:return xa;case 35675:return ba;case 35676:return wa;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 Ma;case 35680:case 36300:case 36308:case 36293:return _a}}()}function Ta(t){this.id=t,this.seq=[],this.map={}}Ca.prototype.updateCache=function(t){var e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),qr(e,t)},Ta.prototype.setValue=function(t,e,n){for(var i=this.seq,r=0,a=i.length;r!==a;++r){var o=i[r];o.setValue(t,e[o.id],n)}};var Ea=/([\w\d_]+)(\])?(\[|\.)?/g;function Da(t,e){t.seq.push(e),t.map[e.id]=e}function Aa(t,e,n){var i=t.name,r=i.length;for(Ea.lastIndex=0;;){var a=Ea.exec(i),o=Ea.lastIndex,s=a[1],l="]"===a[2],c=a[3];if(l&&(s|=0),void 0===c||"["===c&&o+2===r){Da(n,new(void 0===c?Sa:Ca)(s,t,e));break}var u=n.map[s];void 0===u&&Da(n,u=new Ta(s)),n=u}}function Oa(t,e){this.seq=[],this.map={};for(var n=t.getProgramParameter(e,35718),i=0;i<n;++i){var r=t.getActiveUniform(e,i);Aa(r,t.getUniformLocation(e,r.name),this)}}function La(t,e,n){var i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),i}Oa.prototype.setValue=function(t,e,n,i){var r=this.map[e];void 0!==r&&r.setValue(t,n,i)},Oa.prototype.setOptional=function(t,e,n){var i=e[n];void 0!==i&&this.setValue(t,n,i)},Oa.upload=function(t,e,n,i){for(var r=0,a=e.length;r!==a;++r){var o=e[r],s=n[o.id];!1!==s.needsUpdate&&o.setValue(t,s.value,i)}},Oa.seqWithValue=function(t,e){for(var n=[],i=0,r=t.length;i!==r;++i){var a=t[i];a.id in e&&n.push(a)}return n};var Ia=0;function Pa(t){switch(t){case de:return["Linear","( value )"];case fe:return["sRGB","( value )"];case ge:return["RGBE","( value )"];case ye:return["RGBM","( value, 7.0 )"];case xe:return["RGBM","( value, 16.0 )"];case be:return["RGBD","( value, 256.0 )"];case me:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case ve:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+t)}}function Ra(t,e,n){var i=t.getShaderParameter(e,35713),r=t.getShaderInfoLog(e).trim();return i&&""===r?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+r+function(t){for(var e=t.split("\n"),n=0;n<e.length;n++)e[n]=n+1+": "+e[n];return e.join("\n")}(t.getShaderSource(e))}function ka(t,e){var n=Pa(e);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function Na(t){return""!==t}function Ba(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Fa(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}var ja=/^[ \t]*#include +<([\w\d./]+)>/gm;function Va(t){return t.replace(ja,za)}function za(t,e){var n=Ar[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return Va(n)}var Ga=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;function Ua(t){return t.replace(Ga,Ha)}function Ha(t,e,n,i){for(var r="",a=parseInt(e);a<parseInt(n);a++)r+=i.replace(/\[ i \]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return r}function Wa(t){var e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function Ja(t,e,n){var i=[],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(t){var e;return t?t.isTexture?e=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),e=t.texture.encoding):e=de,e}this.getParameters=function(i,r,a,o,g,y,x){var b=o.fog,w=i.isMeshStandardMaterial?o.environment:null,M=i.envMap||w,_=m[i.type],S=x.isSkinnedMesh?function(t){var e=x.skeleton.bones;if(h)return 1024;var n=d,i=Math.floor((n-20)/4),r=Math.min(i,e.length);return r<e.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+e.length+" bones. This GPU supports "+r+"."),0):r}():0;null!==i.precision&&(p=n.getMaxPrecision(i.precision))!==i.precision&&console.warn("THREE.WebGLProgram.getParameters:",i.precision,"not supported, using",p,"instead.");var C=function(t,e){var n;if(_){var i=Or[_];n={name:t.type,uniforms:dr.clone(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader}}else n={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};return n}(i);i.onBeforeCompile(C,t);var T=t.getRenderTarget(),E=T&&T.isWebGLMultiviewRenderTarget?T.numViews:0;return{isWebGL2:s,shaderID:_,shaderName:C.name,uniforms:C.uniforms,vertexShader:C.vertexShader,fragmentShader:C.fragmentShader,defines:i.defines,isRawShaderMaterial:i.isRawShaderMaterial,isShaderMaterial:i.isShaderMaterial,precision:p,instancing:!0===x.isInstancedMesh,supportsVertexTextures:f,numMultiviewViews:E,outputEncoding:null!==T?v(T.texture):t.outputEncoding,map:!!i.map,mapEncoding:v(i.map),matcap:!!i.matcap,matcapEncoding:v(i.matcap),envMap:!!M,envMapMode:M&&M.mapping,envMapEncoding:v(M),envMapCubeUV:!!M&&(M.mapping===nt||M.mapping===it),lightMap:!!i.lightMap,lightMapEncoding:v(i.lightMap),aoMap:!!i.aoMap,emissiveMap:!!i.emissiveMap,emissiveMapEncoding:v(i.emissiveMap),bumpMap:!!i.bumpMap,normalMap:!!i.normalMap,objectSpaceNormalMap:i.normalMapType===Se,tangentSpaceNormalMap:i.normalMapType===_e,clearcoatNormalMap:!!i.clearcoatNormalMap,displacementMap:!!i.displacementMap,roughnessMap:!!i.roughnessMap,metalnessMap:!!i.metalnessMap,specularMap:!!i.specularMap,alphaMap:!!i.alphaMap,gradientMap:!!i.gradientMap,sheen:!!i.sheen,combine:i.combine,vertexTangents:i.normalMap&&i.vertexTangents,vertexColors:i.vertexColors,vertexUvs:!!(i.map||i.bumpMap||i.normalMap||i.specularMap||i.alphaMap||i.emissiveMap||i.roughnessMap||i.metalnessMap||i.clearcoatNormalMap||i.displacementMap),uvsVertexOnly:!(i.map||i.bumpMap||i.normalMap||i.specularMap||i.alphaMap||i.emissiveMap||i.roughnessMap||i.metalnessMap||i.clearcoatNormalMap||!i.displacementMap),fog:!!b,useFog:i.fog,fogExp2:b&&b.isFogExp2,flatShading:i.flatShading,sizeAttenuation:i.sizeAttenuation,logarithmicDepthBuffer:u,skinning:i.skinning&&0<S,maxBones:S,useVertexTexture:h,morphTargets:i.morphTargets,morphNormals:i.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:r.directional.length,numPointLights:r.point.length,numSpotLights:r.spot.length,numRectAreaLights:r.rectArea.length,numHemiLights:r.hemi.length,numDirLightShadows:r.directionalShadowMap.length,numPointLightShadows:r.pointShadowMap.length,numSpotLightShadows:r.spotShadowMap.length,numClippingPlanes:g,numClipIntersection:y,dithering:i.dithering,shadowMapEnabled:t.shadowMap.enabled&&0<a.length,shadowMapType:t.shadowMap.type,toneMapping:i.toneMapped?t.toneMapping:W,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:i.side===c,flipSided:i.side===l,depthPacking:void 0!==i.depthPacking&&i.depthPacking,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.frawbuffers,extensionDrawbuffers:i.extensions&&i.extensions.drawbuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:s||null!==e.get("EXT_frag_depth"),rendererExtensionDrawBuffers:s||null!==e.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||null!==e.get("EXT_shader_texture_lod"),onBeforeCompile:i.onBeforeCompile}},this.getProgramCacheKey=function(e){var n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(var i in e.defines)n.push(i),n.push(e.defines[i]);if(void 0===e.isRawShaderMaterial){for(var r=0;r<g.length;r++)n.push(e[g[r]]);n.push(t.outputEncoding),n.push(t.gammaFactor)}return n.push(e.onBeforeCompile.toString()),n.join()},this.acquireProgram=function(e,n){for(var s,l=0,c=i.length;l<c;l++){var u=i[l];if(u.cacheKey===n){++(s=u).usedTimes;break}}return void 0===s&&(s=new function(t,e,n){var i,s,l,c,u,h,p,d,f=t.getContext(),m=n.defines,g=n.vertexShader,v=n.fragmentShader,y=(s="SHADOWMAP_TYPE_BASIC",(i=n).shadowMapType===r?s="SHADOWMAP_TYPE_PCF":i.shadowMapType===a?s="SHADOWMAP_TYPE_PCF_SOFT":i.shadowMapType===o&&(s="SHADOWMAP_TYPE_VSM"),s),x=function(t){var e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case $:case K:e="ENVMAP_TYPE_CUBE";break;case nt:case it:e="ENVMAP_TYPE_CUBE_UV";break;case Q:case tt:e="ENVMAP_TYPE_EQUIREC";break;case et:e="ENVMAP_TYPE_SPHERE"}return e}(n),b=function(t){var e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case K:case tt:e="ENVMAP_MODE_REFRACTION"}return e}(n),w=function(t){var e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case G:e="ENVMAP_BLENDING_MULTIPLY";break;case U:e="ENVMAP_BLENDING_MIX";break;case H:e="ENVMAP_BLENDING_ADD"}return e}(n),M=0<t.gammaFactor?t.gammaFactor:1,_=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(t){var e=[];for(var n in t){var i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}(m),C=f.createProgram(),T=n.numMultiviewViews;if(n.isRawShaderMaterial?(0<(c=[S].filter(Na).join("\n")).length&&(c+="\n"),0<(u=[_,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 "+M,"#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 "+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.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=[_,Wa(n),"#define SHADER_NAME "+n.shaderName,S,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+M,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 "+b:"",n.envMap?"#define "+w:"",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?Ar.tonemapping_pars_fragment:"",n.toneMapping!==W?function(t,e){var n;switch(e){case J:n="Linear";break;case q:n="Reinhard";break;case X:n="Uncharted2";break;case Y:n="OptimizedCineon";break;case Z:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+e)}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?Ar.encodings_pars_fragment:"",n.mapEncoding?ka("mapTexelToLinear",n.mapEncoding):"",n.matcapEncoding?ka("matcapTexelToLinear",n.matcapEncoding):"",n.envMapEncoding?ka("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMapEncoding?ka("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMapEncoding?ka("lightMapTexelToLinear",n.lightMapEncoding):"",n.outputEncoding?(h="linearToOutputTexel",p=n.outputEncoding,d=Pa(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=Ba(g=Va(g),n),n),v=Fa(v=Ba(v=Va(v),n),n),g=Ua(g),v=Ua(v),n.isWebGL2&&!n.isRawShaderMaterial){var E=!1,D=/^\s*#version\s+300\s+es\s*\n/;n.isShaderMaterial&&null!==g.match(D)&&null!==v.match(D)&&(E=!0,g=g.replace(D,""),v=v.replace(D,"")),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",E?"":"out highp vec4 pc_fragColor;",E?"":"#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<T&&(c=(c=c.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","layout(num_views = "+T+") 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["+T+"];","uniform mat4 projectionMatrices["+T+"];","uniform mat4 viewMatrices["+T+"];","uniform mat3 normalMatrices["+T+"];","#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["+T+"];","#define viewMatrix viewMatrices[VIEW_ID]"].join("\n")))}var A,O,L=u+v,I=La(f,35633,c+g),P=La(f,35632,L);if(f.attachShader(C,I),f.attachShader(C,P),void 0!==n.index0AttributeName?f.bindAttribLocation(C,0,n.index0AttributeName):!0===n.morphTargets&&f.bindAttribLocation(C,0,"position"),f.linkProgram(C),t.debug.checkShaderErrors){var R=f.getProgramInfoLog(C).trim(),k=f.getShaderInfoLog(I).trim(),N=f.getShaderInfoLog(P).trim(),B=!0,F=!0;if(!1===f.getProgramParameter(C,35714)){B=!1;var j=Ra(f,I,"vertex"),V=Ra(f,P,"fragment");console.error("THREE.WebGLProgram: shader error: ",f.getError(),"35715",f.getProgramParameter(C,35715),"gl.getProgramInfoLog",R,j,V)}else""!==R?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",R):""!==k&&""!==N||(F=!1);F&&(this.diagnostics={runnable:B,programLog:R,vertexShader:{log:k,prefix:c},fragmentShader:{log:N,prefix:u}})}return f.deleteShader(I),f.deleteShader(P),this.getUniforms=function(){return void 0===A&&(A=new Oa(f,C)),A},this.getAttributes=function(){return void 0===O&&(O=function(t,e){for(var n={},i=t.getProgramParameter(e,35721),r=0;r<i;r++){var a=t.getActiveAttrib(e,r).name;n[a]=t.getAttribLocation(e,a)}return n}(f,C)),O},this.destroy=function(){f.deleteProgram(C),this.program=void 0},this.name=n.shaderName,this.id=Ia++,this.cacheKey=e,this.usedTimes=1,this.program=C,this.vertexShader=I,this.fragmentShader=P,this.numMultiviewViews=T,this}(t,n,e),i.push(s)),s},this.releaseProgram=function(t){if(0==--t.usedTimes){var e=i.indexOf(t);i[e]=i[i.length-1],i.pop(),t.destroy()}},this.programs=i}function qa(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function Xa(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Ya(){var t=[],e=0,n=[],i=[],r={id:-1};function a(n,i,a,o,s,l){var c=t[e];return void 0===c?(c={id:n.id,object:n,geometry:i,material:a,program:a.program||r,groupOrder:o,renderOrder:n.renderOrder,z:s,group:l},t[e]=c):(c.id=n.id,c.object=n,c.geometry=i,c.material=a,c.program=a.program||r,c.groupOrder=o,c.renderOrder=n.renderOrder,c.z=s,c.group=l),e++,c}return{opaque:n,transparent:i,init:function(){e=0,n.length=0,i.length=0},push:function(t,e,r,o,s,l){var c=a(t,e,r,o,s,l);(!0===r.transparent?i:n).push(c)},unshift:function(t,e,r,o,s,l){var c=a(t,e,r,o,s,l);(!0===r.transparent?i:n).unshift(c)},sort:function(t,e){1<n.length&&n.sort(t||qa),1<i.length&&i.sort(e||Xa)}}}var Za=0;function $a(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function Ka(){for(var t=new function(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":n={direction:new We,color:new ci,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Re};break;case"SpotLight":n={position:new We,direction:new We,color:new ci,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Re};break;case"PointLight":n={position:new We,color:new ci,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Re,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new We,skyColor:new ci,groundColor:new ci};break;case"RectAreaLight":n={color:new ci,position:new We,halfWidth:new We,halfHeight:new We}}return t[e.id]=n}}},e={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++)e.probe.push(new We);var i=new We,r=new Qe,a=new Qe;return{setup:function(n,o,s){for(var l=0,c=0,u=0,h=0;h<9;h++)e.probe[h].set(0,0,0);var p=0,d=0,f=0,m=0,g=0,v=0,y=0,x=0,b=s.matrixWorldInverse;n.sort($a),h=0;for(var w=n.length;h<w;h++){var M=n[h],_=M.color,S=M.intensity,C=M.distance,T=M.shadow&&M.shadow.map?M.shadow.map.texture:null;if(M.isAmbientLight)l+=_.r*S,c+=_.g*S,u+=_.b*S;else if(M.isLightProbe)for(var E=0;E<9;E++)e.probe[E].addScaledVector(M.sh.coefficients[E],S);else if(M.isDirectionalLight){if((A=t.get(M)).color.copy(M.color).multiplyScalar(M.intensity),A.direction.setFromMatrixPosition(M.matrixWorld),i.setFromMatrixPosition(M.target.matrixWorld),A.direction.sub(i),A.direction.transformDirection(b),A.shadow=M.castShadow,M.castShadow){var D=M.shadow;A.shadowBias=D.bias,A.shadowRadius=D.radius,A.shadowMapSize=D.mapSize,e.directionalShadowMap[p]=T,e.directionalShadowMatrix[p]=M.shadow.matrix,v++}e.directional[p]=A,p++}else if(M.isSpotLight)(A=t.get(M)).position.setFromMatrixPosition(M.matrixWorld),A.position.applyMatrix4(b),A.color.copy(_).multiplyScalar(S),A.distance=C,A.direction.setFromMatrixPosition(M.matrixWorld),i.setFromMatrixPosition(M.target.matrixWorld),A.direction.sub(i),A.direction.transformDirection(b),A.coneCos=Math.cos(M.angle),A.penumbraCos=Math.cos(M.angle*(1-M.penumbra)),A.decay=M.decay,A.shadow=M.castShadow,M.castShadow&&(D=M.shadow,A.shadowBias=D.bias,A.shadowRadius=D.radius,A.shadowMapSize=D.mapSize,e.spotShadowMap[f]=T,e.spotShadowMatrix[f]=M.shadow.matrix,x++),e.spot[f]=A,f++;else if(M.isRectAreaLight)(A=t.get(M)).color.copy(_).multiplyScalar(S),A.position.setFromMatrixPosition(M.matrixWorld),A.position.applyMatrix4(b),a.identity(),r.copy(M.matrixWorld),r.premultiply(b),a.extractRotation(r),A.halfWidth.set(.5*M.width,0,0),A.halfHeight.set(0,.5*M.height,0),A.halfWidth.applyMatrix4(a),A.halfHeight.applyMatrix4(a),e.rectArea[m]=A,m++;else if(M.isPointLight)(A=t.get(M)).position.setFromMatrixPosition(M.matrixWorld),A.position.applyMatrix4(b),A.color.copy(M.color).multiplyScalar(M.intensity),A.distance=M.distance,A.decay=M.decay,A.shadow=M.castShadow,M.castShadow&&(D=M.shadow,A.shadowBias=D.bias,A.shadowRadius=D.radius,A.shadowMapSize=D.mapSize,A.shadowCameraNear=D.camera.near,A.shadowCameraFar=D.camera.far,e.pointShadowMap[d]=T,e.pointShadowMatrix[d]=M.shadow.matrix,y++),e.point[d]=A,d++;else if(M.isHemisphereLight){var A;(A=t.get(M)).direction.setFromMatrixPosition(M.matrixWorld),A.direction.transformDirection(b),A.direction.normalize(),A.skyColor.copy(M.color).multiplyScalar(S),A.groundColor.copy(M.groundColor).multiplyScalar(S),e.hemi[g]=A,g++}}e.ambient[0]=l,e.ambient[1]=c,e.ambient[2]=u;var O=e.hash;O.directionalLength===p&&O.pointLength===d&&O.spotLength===f&&O.rectAreaLength===m&&O.hemiLength===g&&O.numDirectionalShadows===v&&O.numPointShadows===y&&O.numSpotShadows===x||(e.directional.length=p,e.spot.length=f,e.rectArea.length=m,e.point.length=d,e.hemi.length=g,e.directionalShadowMap.length=v,e.pointShadowMap.length=y,e.spotShadowMap.length=x,e.directionalShadowMatrix.length=v,e.pointShadowMatrix.length=y,e.spotShadowMatrix.length=x,O.directionalLength=p,O.pointLength=d,O.spotLength=f,O.rectAreaLength=m,O.hemiLength=g,O.numDirectionalShadows=v,O.numPointShadows=y,O.numSpotShadows=x,e.version=Za++)},state:e}}function Qa(){var t=new Ka,e=[],n=[];return{init:function(){e.length=0,n.length=0},state:{lightsArray:e,shadowsArray:n,lights:t},setupLights:function(i){t.setup(e,n,i)},pushLight:function(t){e.push(t)},pushShadow:function(t){n.push(t)}}}function to(t){mi.call(this),this.type="MeshDepthMaterial",this.depthPacking=we,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(t)}function eo(t){mi.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new We,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(t)}((to.prototype=Object.create(mi.prototype)).constructor=to).prototype.isMeshDepthMaterial=!0,to.prototype.copy=function(t){return mi.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},((eo.prototype=Object.create(mi.prototype)).constructor=eo).prototype.isMeshDistanceMaterial=!0,eo.prototype.copy=function(t){return mi.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.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}",io="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}";function ro(t,e,n){var i=new Sr,a=new Re,u=new Re,h=new je,d=[],f=[],m={},g={0:l,1:s,2:c},v=new gr({defines:{SAMPLE_RATE:.25,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Re},radius:{value:4}},vertexShader:io,fragmentShader:no}),y=v.clone();y.defines.HORIZONAL_PASS=1;var x=new Bi;x.setAttribute("position",new yi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var b=new er(x,v),w=this;function M(n,i){var r=e.update(b);v.uniforms.shadow_pass.value=n.map.texture,v.uniforms.resolution.value=n.mapSize,v.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(i,null,r,v,b,null),y.uniforms.shadow_pass.value=n.mapPass.texture,y.uniforms.resolution.value=n.mapSize,y.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(i,null,r,y,b,null)}function _(t,e,n){var i=t<<0|e<<1|n<<2,r=d[i];return void 0===r&&(r=new to({depthPacking:Me,morphTargets:t,skinning:e}),d[i]=r),r}function S(t,e,n){var i=t<<0|e<<1|n<<2,r=f[i];return void 0===r&&(r=new eo({morphTargets:t,skinning:e}),f[i]=r),r}function C(e,n,i,r,a,s){var l=e.geometry,c=null,u=_,h=e.customDepthMaterial;if(!0===i.isPointLight&&(u=S,h=e.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===e.isSkinnedMesh&&(!0===n.skinning?d=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e)),c=u(p,d,!0===e.isInstancedMesh)}else c=h;if(t.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===i.isPointLight&&!0===c.isMeshDistanceMaterial&&(c.referencePosition.setFromMatrixPosition(i.matrixWorld),c.nearDistance=r,c.farDistance=a),c}function T(n,r,a,s,l){if(!1!==n.visible){if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&l===o)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);var c=e.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=C(n,m,s,a.near,a.far,l);t.renderBufferDirect(a,null,c,g,n,f)}}else u.visible&&(g=C(n,u,s,a.near,a.far,l),t.renderBufferDirect(a,null,c,g,n,null))}for(var v=n.children,y=0,x=v.length;y<x;y++)T(v[y],r,a,s,l)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=r,this.render=function(e,r,s){if(!1!==w.enabled&&(!1!==w.autoUpdate||!1!==w.needsUpdate)&&0!==e.length){var l=t.getRenderTarget(),c=t.getActiveCubeFace(),d=t.getActiveMipmapLevel(),f=t.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=e.length;m<g;m++){var v=e[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 b={minFilter:ut,magFilter:ut,format:Et};y.map=new Ve(a.x,a.y,b),y.map.texture.name=v.name+".shadowMap",y.mapPass=new Ve(a.x,a.y,b),y.camera.updateProjectionMatrix()}null===y.map&&(b={minFilter:st,magFilter:st,format:Et},y.map=new Ve(a.x,a.y,b),y.map.texture.name=v.name+".shadowMap",y.camera.updateProjectionMatrix()),t.setRenderTarget(y.map),t.clear();for(var _=y.getViewportCount(),S=0;S<_;S++){var C=y.getViewport(S);h.set(u.x*C.x,u.y*C.y,u.x*C.z,u.y*C.w),f.viewport(h),y.updateMatrices(v,S),i=y.getFrustum(),T(r,s,y.camera,v,this.type)}y.isPointLightShadow||this.type!==o||M(y,s)}else console.warn("THREE.WebGLShadowMap:",v,"has no shadow.")}w.needsUpdate=!1,t.setRenderTarget(l,c,d)}}}function ao(t,r,a){var o=a.isWebGL2,s=new function(){var e=!1,n=new je,i=null,r=new je(0,0,0,0);return{setMask:function(n){i===n||e||(t.colorMask(n,n,n,n),i=n)},setLocked:function(t){e=t},setClear:function(e,i,a,o,s){!0===s&&(e*=o,i*=o,a*=o),n.set(e,i,a,o),!1===r.equals(n)&&(t.clearColor(e,i,a,o),r.copy(n))},reset:function(){e=!1,i=null,r.set(-1,0,0,0)}}},u=new function(){var e=!1,n=null,i=null,r=null;return{setTest:function(t){(t?xt:bt)(2929)},setMask:function(i){n===i||e||(t.depthMask(i),n=i)},setFunc:function(e){if(i!==e){if(e)switch(e){case R:t.depthFunc(512);break;case k:t.depthFunc(519);break;case N:t.depthFunc(513);break;case B:t.depthFunc(515);break;case F:t.depthFunc(514);break;case j:t.depthFunc(518);break;case V:t.depthFunc(516);break;case z:t.depthFunc(517);break;default:t.depthFunc(515)}else t.depthFunc(515);i=e}},setLocked:function(t){e=t},setClear:function(e){r!==e&&(t.clearDepth(e),r=e)},reset:function(){e=!1,r=i=n=null}}},h=new function(){var e=!1,n=null,i=null,r=null,a=null,o=null,s=null,l=null,c=null;return{setTest:function(t){e||(t?xt:bt)(2960)},setMask:function(i){n===i||e||(t.stencilMask(i),n=i)},setFunc:function(e,n,o){i===e&&r===n&&a===o||(t.stencilFunc(e,n,o),i=e,r=n,a=o)},setOp:function(e,n,i){o===e&&s===n&&l===i||(t.stencilOp(e,n,i),o=e,s=n,l=i)},setLocked:function(t){e=t},setClear:function(e){c!==e&&(t.clearStencil(e),c=e)},reset:function(){e=!1,c=l=s=o=a=r=i=n=null}}},G=t.getParameter(34921),U=new Uint8Array(G),H=new Uint8Array(G),W=new Uint8Array(G),J={},q=null,X=null,Y=null,Z=null,$=null,K=null,Q=null,tt=null,et=null,nt=!1,it=null,rt=null,at=null,ot=null,st=null,lt=t.getParameter(35661),ct=!1,ut=0,ht=t.getParameter(7938);-1!==ht.indexOf("WebGL")?(ut=parseFloat(/^WebGL\ ([0-9])/.exec(ht)[1]),ct=1<=ut):-1!==ht.indexOf("OpenGL ES")&&(ut=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(ht)[1]),ct=2<=ut);var pt=null,dt={},ft=new je,mt=new je;function gt(e,n,i){var r=new Uint8Array(4),a=t.createTexture();t.bindTexture(e,a),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(var o=0;o<i;o++)t.texImage2D(n+o,0,6408,1,1,0,6408,5121,r);return a}var vt={};function yt(e,n){U[e]=1,0===H[e]&&(t.enableVertexAttribArray(e),H[e]=1),W[e]!==n&&((o?t:r.get("ANGLE_instanced_arrays"))[o?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](e,n),W[e]=n)}function xt(e){!0!==J[e]&&(t.enable(e),J[e]=!0)}function bt(e){!1!==J[e]&&(t.disable(e),J[e]=!1)}vt[3553]=gt(3553,3553,1),vt[34067]=gt(34067,34069,6),s.setClear(0,0,0,1),u.setClear(1),h.setClear(0),xt(2929),u.setFunc(B),Ct(!1),Tt(n),xt(2884),St(p);var wt={};if(wt[y]=32774,wt[x]=32778,wt[b]=32779,o)wt[w]=32775,wt[M]=32776;else{var Mt=r.get("EXT_blend_minmax");null!==Mt&&(wt[w]=Mt.MIN_EXT,wt[M]=Mt.MAX_EXT)}var _t={};function St(e,n,i,r,a,o,s,l){if(e!==p){if(X||(xt(3042),X=!0),e===v)a=a||n,o=o||i,s=s||r,n===Z&&a===Q||(t.blendEquationSeparate(wt[n],wt[a]),Z=n,Q=a),i===$&&r===K&&o===tt&&s===et||(t.blendFuncSeparate(_t[i],_t[r],_t[o],_t[s]),$=i,K=r,tt=o,et=s),Y=e,nt=null;else if(e!==Y||l!==nt){if(Z===y&&Q===y||(t.blendEquation(32774),Q=Z=y),l)switch(e){case d:t.blendFuncSeparate(1,771,1,771);break;case f:t.blendFunc(1,1);break;case m:t.blendFuncSeparate(0,0,769,771);break;case g:t.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case d:t.blendFuncSeparate(770,771,1,771);break;case f:t.blendFunc(770,1);break;case m:t.blendFunc(0,769);break;case g:t.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}et=tt=K=$=null,Y=e,nt=l}}else X&&(bt(3042),X=!1)}function Ct(e){it!==e&&(e?t.frontFace(2304):t.frontFace(2305),it=e)}function Tt(r){r!==e?(xt(2884),r!==rt&&(r===n?t.cullFace(1029):r===i?t.cullFace(1028):t.cullFace(1032))):bt(2884),rt=r}function Et(e,n,i){e?(xt(32823),ot===n&&st===i||(t.polygonOffset(n,i),ot=n,st=i)):bt(32823)}function Dt(e){void 0===e&&(e=33984+lt-1),pt!==e&&(t.activeTexture(e),pt=e)}return _t[_]=0,_t[S]=1,_t[C]=768,_t[E]=770,_t[P]=776,_t[L]=774,_t[A]=772,_t[T]=769,_t[D]=771,_t[I]=775,_t[O]=773,{buffers:{color:s,depth:u,stencil:h},initAttributes:function(){for(var t=0,e=U.length;t<e;t++)U[t]=0},enableAttribute:function(t){yt(t,0)},enableAttributeAndDivisor:yt,disableUnusedAttributes:function(){for(var e=0,n=H.length;e!==n;++e)H[e]!==U[e]&&(t.disableVertexAttribArray(e),H[e]=0)},enable:xt,disable:bt,useProgram:function(e){return q!==e&&(t.useProgram(e),q=e,!0)},setBlending:St,setMaterial:function(t,e){(t.side===c?bt:xt)(2884);var n=t.side===l;e&&(n=!n),Ct(n),t.blending===d&&!1===t.transparent?St(p):St(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),u.setFunc(t.depthFunc),u.setTest(t.depthTest),u.setMask(t.depthWrite),s.setMask(t.colorWrite);var i=t.stencilWrite;h.setTest(i),i&&(h.setMask(t.stencilWriteMask),h.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),h.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),Et(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:Ct,setCullFace:Tt,setLineWidth:function(e){e!==at&&(ct&&t.lineWidth(e),at=e)},setPolygonOffset:Et,setScissorTest:function(t){(t?xt:bt)(3089)},activeTexture:Dt,bindTexture:function(e,n){null===pt&&Dt();var i=dt[pt];void 0===i&&(i={type:void 0,texture:void 0},dt[pt]=i),i.type===e&&i.texture===n||(t.bindTexture(e,n||vt[e]),i.type=e,i.texture=n)},unbindTexture:function(){var e=dt[pt];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===ft.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),ft.copy(e))},viewport:function(e){!1===mt.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),mt.copy(e))},reset:function(){for(var e=0;e<H.length;e++)1===H[e]&&(t.disableVertexAttribArray(e),H[e]=0);J={},dt={},rt=it=Y=q=pt=null,s.reset(),u.reset(),h.reset()}}}function oo(t,e,n){var i=n.isWebGL2;return{convert:function(t){var n;if(t===dt)return 5121;if(t===wt)return 32819;if(t===Mt)return 32820;if(t===_t)return 33635;if(t===ft)return 5120;if(t===mt)return 5122;if(t===gt)return 5123;if(t===vt)return 5124;if(t===yt)return 5125;if(t===xt)return 5126;if(t===bt)return i?5131:null!==(n=e.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(t===Ct)return 6406;if(t===Tt)return 6407;if(t===Et)return 6408;if(t===Dt)return 6409;if(t===At)return 6410;if(t===Lt)return 6402;if(t===It)return 34041;if(t===Pt)return 6403;if(t===Rt)return 36244;if(t===kt)return 33319;if(t===Nt)return 33320;if(t===Bt)return 36248;if(t===Ft)return 36249;if(t===jt||t===Vt||t===zt||t===Gt){if(null===(n=e.get("WEBGL_compressed_texture_s3tc")))return null;if(t===jt)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===Vt)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===zt)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===Gt)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t===Ut||t===Ht||t===Wt||t===Jt){if(null===(n=e.get("WEBGL_compressed_texture_pvrtc")))return null;if(t===Ut)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===Ht)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===Wt)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===Jt)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}return t===qt?null!==(n=e.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null:t===Xt||t===Yt||t===Zt||t===$t||t===Kt||t===Qt||t===te||t===ee||t===ne||t===ie||t===re||t===ae||t===oe||t===se?null!==(n=e.get("WEBGL_compressed_texture_astc"))?t:null:t===St?i?34042:null!==(n=e.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function so(t,e,n,i){Ve.call(this,t,e,i),this.depthBuffer=!1,this.stencilBuffer=!1,this.numViews=n}function lo(t){yr.call(this),this.cameras=t||[]}function co(){yn.call(this),this.type="Group"}function uo(t,e){var n=this,i=null,r=null,a="local-floor",o=null,s=[],l=new Map,c=new yr;c.layers.enable(1),c.viewport=new je;var u=new yr;u.layers.enable(2),u.viewport=new je;var h=new lo([c,u]);h.layers.enable(1),h.layers.enable(2);var p=null,d=null;function f(t){var e=l.get(t.inputSource);e&&(e.targetRay&&e.targetRay.dispatchEvent({type:t.type}),e.grip&&e.grip.dispatchEvent({type:t.type}))}function m(){l.forEach(function(t,e){t.targetRay&&(t.targetRay.dispatchEvent({type:"disconnected",data:e}),t.targetRay.visible=!1),t.grip&&(t.grip.dispatchEvent({type:"disconnected",data:e}),t.grip.visible=!1)}),l.clear(),t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),M.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function g(t){r=t,M.setContext(i),M.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}function v(t){for(var e=i.inputSources,n=0;n<s.length;n++)l.set(e[n],s[n]);for(n=0;n<t.removed.length;n++){var r=t.removed[n];(a=l.get(r))&&(a.targetRay&&a.targetRay.dispatchEvent({type:"disconnected",data:r}),a.grip&&a.grip.dispatchEvent({type:"disconnected",data:r}),l.delete(r))}for(n=0;n<t.added.length;n++){var a;r=t.added[n],(a=l.get(r))&&(a.targetRay&&a.targetRay.dispatchEvent({type:"connected",data:r}),a.grip&&a.grip.dispatchEvent({type:"connected",data:r}))}}this.enabled=!1,this.isPresenting=!1,this.getController=function(t){var e=s[t];return void 0===e&&(e={},s[t]=e),void 0===e.targetRay&&(e.targetRay=new co,e.targetRay.matrixAutoUpdate=!1,e.targetRay.visible=!1),e.targetRay},this.getControllerGrip=function(t){var e=s[t];return void 0===e&&(e={},s[t]=e),void 0===e.grip&&(e.grip=new co,e.grip.matrixAutoUpdate=!1,e.grip.visible=!1),e.grip},this.setFramebufferScaleFactor=function(){},this.setReferenceSpaceType=function(t){a=t},this.getReferenceSpace=function(){return r},this.getSession=function(){return i},this.setSession=function(t){if(null!==(i=t)){i.addEventListener("select",f),i.addEventListener("selectstart",f),i.addEventListener("selectend",f),i.addEventListener("squeeze",f),i.addEventListener("squeezestart",f),i.addEventListener("squeezeend",f),i.addEventListener("end",m);var n=e.getContextAttributes(),r={antialias:n.antialias,alpha:n.alpha,depth:n.depth,stencil:n.stencil},o=new XRWebGLLayer(i,e,r);i.updateRenderState({baseLayer:o}),i.requestReferenceSpace(a).then(g),i.addEventListener("inputsourceschange",v)}};var y=new We,x=new We;function b(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}this.getCamera=function(t){h.near=u.near=c.near=t.near,h.far=u.far=c.far=t.far,p===h.near&&d===h.far||(i.updateRenderState({depthNear:h.near,depthFar:h.far}),p=h.near,d=h.far);var e=t.parent,n=h.cameras;b(h,e);for(var r=0;r<n.length;r++)b(n[r],e);t.matrixWorld.copy(h.matrixWorld);for(var a=t.children,o=(r=0,a.length);r<o;r++)a[r].updateMatrixWorld(!0);return function(t,e,n){y.setFromMatrixPosition(e.matrixWorld),x.setFromMatrixPosition(n.matrixWorld);var i=y.distanceTo(x),r=e.projectionMatrix.elements,a=n.projectionMatrix.elements,o=r[14]/(r[10]-1),s=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],u=(r[8]-1)/r[0],h=(a[8]+1)/a[0],p=o*u,d=o*h,f=i/(h-u),m=f*-u;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var g=o+f,v=s+f,b=p-m,w=i-m+d,M=l*s/v*g,_=c*s/v*g;t.projectionMatrix.makePerspective(b,w,M,_,g,v)}(h,c,u),h};var w=null,M=new Tr;M.setAnimationLoop(function(e,n){if(null!==(o=n.getViewerPose(r))){var a=o.views,l=i.renderState.baseLayer;t.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=i.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,r))&&(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,r))&&(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)}w&&w(e,n)}),this.setAnimationLoop=function(t){w=t},this.dispose=function(){}}function ho(t){var e=void 0!==(t=t||{}).canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==t.context?t.context:null,i=void 0!==t.alpha&&t.alpha,r=void 0===t.depth||t.depth,a=void 0===t.stencil||t.stencil,o=void 0!==t.antialias&&t.antialias,s=void 0===t.premultipliedAlpha||t.premultipliedAlpha,c=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,u=void 0!==t.powerPreference?t.powerPreference:"default",h=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat,p=null,d=null;this.domElement=e,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=de,this.physicallyCorrectLights=!1,this.toneMapping=J,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var f,m,g,v,y,x,b,w,M,_,S,C,T,E,D,A,O,L,I=this,P=!1,R=null,k=0,N=0,B=null,F=null,j=-1,V={geometry:null,program:null,wireframe:!1},z=null,G=null,U=new je,H=new je,W=null,q=e.width,X=e.height,Y=1,Z=null,$=null,K=new je(0,0,q,X),Q=new je(0,0,q,X),tt=!1,et=new Sr,nt=new function(){var t=this,e=null,n=0,i=!1,r=!1,a=new Xn,o=new ke,s={value:null,needsUpdate:!1};function l(){s.value!==e&&(s.value=e,s.needsUpdate=0<n),t.numPlanes=n,t.numIntersection=0}function c(e,n,i,r){var l=null!==e?e.length:0,c=null;if(0!==l){if(c=s.value,!0!==r||null===c){var u=i+4*l,h=n.matrixWorldInverse;o.getNormalMatrix(h),(null===c||c.length<u)&&(c=new Float32Array(u));for(var p=0,d=i;p!==l;++p,d+=4)a.copy(e[p]).applyMatrix4(h,o),a.normal.toArray(c,d),c[d+3]=a.constant}s.value=c,s.needsUpdate=!0}return t.numPlanes=l,c}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(t,r,a){var o=0!==t.length||r||0!==n||i;return i=r,e=c(t,a,0),n=t.length,o},this.beginShadows=function(){r=!0,c(null)},this.endShadows=function(){r=!1,l()},this.setState=function(t,a,o,u,h,p){if(!i||null===t||0===t.length||r&&!o)r?c(null):l();else{var d=r?0:n,f=4*d,m=h.clippingState||null;s.value=m,m=c(t,u,f,p);for(var g=0;g!==f;++g)m[g]=e[g];h.clippingState=m,this.numIntersection=a?this.numPlanes:0,this.numPlanes+=d}}},it=!1,ft=!1,mt=new Qe,vt=new We;function wt(){return null===B?Y:1}try{var Mt={alpha:i,depth:r,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:h,xrCompatible:!0};e.addEventListener("webglcontextlost",Pt,!1),e.addEventListener("webglcontextrestored",Rt,!1);var _t="webgl";if(!0===t.webgl2&&(_t="webgl2"),null===(f=n||e.getContext(_t,Mt)||e.getContext("experimental-webgl",Mt)))throw null!==e.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");t.retver=_t,void 0===f.getShaderPrecisionFormat&&(f.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function Ct(){m=new function(t){var e={};return{get:function(n){if(void 0!==e[n])return e[n];var i;switch(n){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(n)}return null===i&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),e[n]=i}}}(f),!1===(g=new function(t,e,n){var i;function r(e){if("highp"===e){if(0<t.getShaderPrecisionFormat(35633,36338).precision&&0<t.getShaderPrecisionFormat(35632,36338).precision)return"highp";e="mediump"}return"mediump"===e&&0<t.getShaderPrecisionFormat(35633,36337).precision&&0<t.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp"}var a="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext,o=void 0!==n.precision?n.precision:"highp",s=r(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var l=!0===n.logarithmicDepthBuffer,c=t.getParameter(34930),u=t.getParameter(35660),h=t.getParameter(3379),p=t.getParameter(34076),d=t.getParameter(34921),f=t.getParameter(36347),m=t.getParameter(36348),g=t.getParameter(36349),v=0<u,y=a||!!e.get("OES_texture_float");return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==i)return i;var n=e.get("EXT_texture_filter_anisotropic");return i=null!==n?t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:r,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?t.getParameter(36183):0}}(f,m,t)).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"),L=new oo(0,m,g),(v=new ao(f,m,g)).scissor(H.copy(Q).multiplyScalar(Y).floor()),v.viewport(U.copy(K).multiplyScalar(Y).floor()),y=new function(t){var e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(t,n,i){switch(i=i||1,e.calls++,n){case 4:e.triangles+=i*(t/3);break;case 1:e.lines+=i*(t/2);break;case 3:e.lines+=i*(t-1);break;case 2:e.lines+=i*t;break;case 0:e.points+=i*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}},x=new function(){var t=new WeakMap;return{get:function(e){var n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n},remove:function(e){t.delete(e)},update:function(e,n,i){t.get(e)[n]=i},dispose:function(){t=new WeakMap}}},b=new function(t,e,n,i,r,a,o){var s,l=r.isWebGL2,c=r.maxTextures,u=r.maxCubemapSize,h=r.maxTextureSize,p=r.maxSamples,d=new WeakMap,f=!1;try{f="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function m(t,e){return f?new OffscreenCanvas(t,e):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function g(t,e,n,i){var r=1;if((t.width>i||t.height>i)&&(r=i/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){var a=e?Pe.floorPowerOfTwo:Math.floor,o=a(r*t.width),l=a(r*t.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(t,0,0,o,l),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+o+"x"+l+")."),c}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function v(t){return Pe.isPowerOfTwo(t.width)&&Pe.isPowerOfTwo(t.height)}function y(t,e){return t.generateMipmaps&&e&&t.minFilter!==st&&t.minFilter!==ut}function x(e,n,r,a){t.generateMipmap(e),i.get(n).__maxMipLevel=Math.log(Math.max(r,a))*Math.LOG2E}function b(n,i,r){if(!1===l)return i;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var a=i;return 6403===i&&(5126===r&&(a=33326),5131===r&&(a=33325),5121===r&&(a=33321)),6407===i&&(5126===r&&(a=34837),5131===r&&(a=34843),5121===r&&(a=32849)),6408===i&&(5126===r&&(a=34836),5131===r&&(a=34842),5121===r&&(a=32856)),33325===a||33326===a||34842===a||34836===a?e.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 w(t){return t===st||t===lt||t===ct?9728:9729}function M(e){var n=e.target;n.removeEventListener("dispose",M),function(e){var n=i.get(e);void 0!==n.__webglInit&&(t.deleteTexture(n.__webglTexture),i.remove(e))}(n),n.isVideoTexture&&d.delete(n),o.memory.textures--}function _(e){var n=e.target;n.removeEventListener("dispose",_),function(e){var n=i.get(e),r=i.get(e.texture);if(e){if(void 0!==r.__webglTexture&&t.deleteTexture(r.__webglTexture),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(var a=0;a<6;a++)t.deleteFramebuffer(n.__webglFramebuffer[a]),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[a]);else t.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer);if(e.isWebGLMultiviewRenderTarget){t.deleteTexture(n.__webglColorTexture),t.deleteTexture(n.__webglDepthStencilTexture),o.memory.textures-=2,a=0;for(var s=n.__webglViewFramebuffers.length;a<s;a++)t.deleteFramebuffer(n.__webglViewFramebuffers[a])}i.remove(e.texture),i.remove(e)}}(n),o.memory.textures--}var S=0;function C(t,e){var r,a,s=i.get(t);if(t.isVideoTexture&&(r=t,a=o.render.frame,d.get(r)!==a&&(d.set(r,a),r.update())),0<t.version&&s.__version!==t.version){var l=t.image;if(void 0===l)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==l.complete)return void I(s,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+e),n.bindTexture(3553,s.__webglTexture)}function T(e,r){if(6===e.image.length){var o=i.get(e);if(0<e.version&&o.__version!==e.version){L(o,e),n.activeTexture(33984+r),n.bindTexture(34067,o.__webglTexture),t.pixelStorei(37440,e.flipY);for(var s=e&&(e.isCompressedTexture||e.image[0].isCompressedTexture),c=e.image[0]&&e.image[0].isDataTexture,h=[],p=0;p<6;p++)h[p]=s||c?c?e.image[p].image:e.image[p]:g(e.image[p],!1,!0,u);var d,f=h[0],m=v(f)||l,w=a.convert(e.format),M=a.convert(e.type),_=b(e.internalFormat,w,M);if(O(34067,e,m),s){for(p=0;p<6;p++){d=h[p].mipmaps;for(var S=0;S<d.length;S++){var C=d[S];e.format!==Et&&e.format!==Tt?null!==w?n.compressedTexImage2D(34069+p,S,_,C.width,C.height,0,C.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+p,S,_,C.width,C.height,0,w,M,C.data)}}o.__maxMipLevel=d.length-1}else{for(d=e.mipmaps,p=0;p<6;p++)if(c)for(n.texImage2D(34069+p,0,_,h[p].width,h[p].height,0,w,M,h[p].data),S=0;S<d.length;S++){var T=(C=d[S]).image[p].image;n.texImage2D(34069+p,S+1,_,T.width,T.height,0,w,M,T.data)}else for(n.texImage2D(34069+p,0,_,w,M,h[p]),S=0;S<d.length;S++)C=d[S],n.texImage2D(34069+p,S+1,_,w,M,C.image[p]);o.__maxMipLevel=d.length}y(e,m)&&x(34067,e,f.width,f.height),o.__version=e.version,e.onUpdate&&e.onUpdate(e)}else n.activeTexture(33984+r),n.bindTexture(34067,o.__webglTexture)}}function E(t,e){n.activeTexture(33984+e),n.bindTexture(34067,i.get(t).__webglTexture)}var D={};D[rt]=10497,D[at]=33071,D[ot]=33648;var A={};function O(n,a,o){o?(t.texParameteri(n,10242,D[a.wrapS]),t.texParameteri(n,10243,D[a.wrapT]),32879!==n&&35866!==n||t.texParameteri(n,32882,D[a.wrapR]),t.texParameteri(n,10240,A[a.magFilter]),t.texParameteri(n,10241,A[a.minFilter])):(t.texParameteri(n,10242,33071),t.texParameteri(n,10243,33071),32879!==n&&35866!==n||t.texParameteri(n,32882,33071),a.wrapS===at&&a.wrapT===at||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,10240,w(a.magFilter)),t.texParameteri(n,10241,w(a.minFilter)),a.minFilter!==st&&a.minFilter!==ut&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));var s=e.get("EXT_texture_filter_anisotropic");if(s){if(a.type===xt&&null===e.get("OES_texture_float_linear"))return;if(a.type===bt&&null===(l||e.get("OES_texture_half_float_linear")))return;(1<a.anisotropy||i.get(a).__currentAnisotropy)&&(t.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),i.get(a).__currentAnisotropy=a.anisotropy)}}function L(e,n){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",M),e.__webglTexture=t.createTexture(),o.memory.textures++)}function I(e,i,r){var o=3553;i.isDataTexture2DArray&&(o=35866),i.isDataTexture3D&&(o=32879),L(e,i),n.activeTexture(33984+r),n.bindTexture(o,e.__webglTexture),t.pixelStorei(37440,i.flipY),t.pixelStorei(37441,i.premultiplyAlpha),t.pixelStorei(3317,i.unpackAlignment);var s,c=(s=i,!l&&(s.wrapS!==at||s.wrapT!==at||s.minFilter!==st&&s.minFilter!==ut)&&!1===v(i.image)),u=g(i.image,c,!1,h),p=v(u)||l,d=a.convert(i.format),f=a.convert(i.type),m=b(i.internalFormat,d,f);O(o,i,p);var w,M=i.mipmaps;if(i.isDepthTexture){if(m=6402,i.type===xt){if(!1===l)throw new Error("Float Depth Texture only supported in WebGL2.0");m=36012}else l&&(m=33189);i.format===Lt&&6402===m&&i.type!==gt&&i.type!==yt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=gt,f=a.convert(i.type)),i.format===It&&(m=34041,i.type!==St&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=St,f=a.convert(i.type))),n.texImage2D(3553,0,m,u.width,u.height,0,d,f,null)}else if(i.isDataTexture)if(0<M.length&&p){for(var _=0,S=M.length;_<S;_++)w=M[_],n.texImage2D(3553,_,m,w.width,w.height,0,d,f,w.data);i.generateMipmaps=!1,e.__maxMipLevel=M.length-1}else n.texImage2D(3553,0,m,u.width,u.height,0,d,f,u.data),e.__maxMipLevel=0;else if(i.isCompressedTexture){for(_=0,S=M.length;_<S;_++)w=M[_],i.format!==Et&&i.format!==Tt?null!==d?n.compressedTexImage2D(3553,_,m,w.width,w.height,0,w.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,_,m,w.width,w.height,0,d,f,w.data);e.__maxMipLevel=M.length-1}else if(i.isDataTexture2DArray)n.texImage3D(35866,0,m,u.width,u.height,u.depth,0,d,f,u.data),e.__maxMipLevel=0;else if(i.isDataTexture3D)n.texImage3D(32879,0,m,u.width,u.height,u.depth,0,d,f,u.data),e.__maxMipLevel=0;else if(0<M.length&&p){for(_=0,S=M.length;_<S;_++)w=M[_],n.texImage2D(3553,_,m,d,f,w);i.generateMipmaps=!1,e.__maxMipLevel=M.length-1}else n.texImage2D(3553,0,m,d,f,u),e.__maxMipLevel=0;y(i,p)&&x(o,i,u.width,u.height),e.__version=i.version,i.onUpdate&&i.onUpdate(i)}function P(e,r,o,s){var l=a.convert(r.texture.format),c=a.convert(r.texture.type),u=b(r.texture.internalFormat,l,c);n.texImage2D(s,0,u,r.width,r.height,0,l,c,null),t.bindFramebuffer(36160,e),t.framebufferTexture2D(36160,o,s,i.get(r.texture).__webglTexture,0),t.bindFramebuffer(36160,null)}function R(e,n,i){if(t.bindRenderbuffer(36161,e),n.depthBuffer&&!n.stencilBuffer){if(i){var r=N(n);t.renderbufferStorageMultisample(36161,r,33189,n.width,n.height)}else t.renderbufferStorage(36161,33189,n.width,n.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(n.depthBuffer&&n.stencilBuffer)i?(r=N(n),t.renderbufferStorageMultisample(36161,r,35056,n.width,n.height)):t.renderbufferStorage(36161,34041,n.width,n.height),t.framebufferRenderbuffer(36160,33306,36161,e);else{var o=a.convert(n.texture.format),s=a.convert(n.texture.type),l=b(n.texture.internalFormat,o,s);i?(r=N(n),t.renderbufferStorageMultisample(36161,r,l,n.width,n.height)):t.renderbufferStorage(36161,l,n.width,n.height)}t.bindRenderbuffer(36161,null)}function k(e){var n=i.get(e),r=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture){if(r)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,n){if(n&&n.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,e),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");i.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),C(n.depthTexture,0);var r=i.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===Lt)t.framebufferTexture2D(36160,36096,3553,r,0);else{if(n.depthTexture.format!==It)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(36160,33306,3553,r,0)}}(n.__webglFramebuffer,e)}else if(r){n.__webglDepthbuffer=[];for(var a=0;a<6;a++)t.bindFramebuffer(36160,n.__webglFramebuffer[a]),n.__webglDepthbuffer[a]=t.createRenderbuffer(),R(n.__webglDepthbuffer[a],e)}else t.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=t.createRenderbuffer(),R(n.__webglDepthbuffer,e);t.bindFramebuffer(36160,null)}function N(t){return l&&t.isWebGLMultisampleRenderTarget?Math.min(p,t.samples):0}A[st]=9728,A[lt]=9984,A[ct]=9986,A[ut]=9729,A[ht]=9985;var B=!(A[pt]=9987),F=!1;this.allocateTextureUnit=function(){var t=S;return c<=t&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+c),S+=1,t},this.resetTextureUnits=function(){S=0},this.setTexture2D=C,this.setTexture2DArray=function(t,e){var r=i.get(t);0<t.version&&r.__version!==t.version?I(r,t,e):(n.activeTexture(33984+e),n.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(t,e){var r=i.get(t);0<t.version&&r.__version!==t.version?I(r,t,e):(n.activeTexture(33984+e),n.bindTexture(32879,r.__webglTexture))},this.setTextureCube=T,this.setTextureCubeDynamic=E,this.setupRenderTarget=function(r){var s=i.get(r),c=i.get(r.texture);r.addEventListener("dispose",_),c.__webglTexture=t.createTexture(),o.memory.textures++;var u=!0===r.isWebGLCubeRenderTarget,h=!0===r.isWebGLMultisampleRenderTarget,p=!0===r.isWebGLMultiviewRenderTarget,d=v(r)||l;if(u){s.__webglFramebuffer=[];for(var f=0;f<6;f++)s.__webglFramebuffer[f]=t.createFramebuffer()}else if(s.__webglFramebuffer=t.createFramebuffer(),h)if(l){s.__webglMultisampledFramebuffer=t.createFramebuffer(),s.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,s.__webglColorRenderbuffer);var m=a.convert(r.texture.format),g=a.convert(r.texture.type),w=b(r.texture.internalFormat,m,g),M=N(r);t.renderbufferStorageMultisample(36161,M,w,r.width,r.height),t.bindFramebuffer(36160,s.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,s.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),r.depthBuffer&&(s.__webglDepthRenderbuffer=t.createRenderbuffer(),R(s.__webglDepthRenderbuffer,r,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");else if(p){var S=r.width,C=r.height,T=r.numViews;t.bindFramebuffer(36160,s.__webglFramebuffer);var E=e.get("OVR_multiview2");o.memory.textures+=2;var D=t.createTexture();t.bindTexture(35866,D),t.texParameteri(35866,10240,9728),t.texParameteri(35866,10241,9728),t.texImage3D(35866,0,32856,S,C,T,0,6408,5121,null),E.framebufferTextureMultiviewOVR(36160,36064,D,0,0,T);var A=t.createTexture();t.bindTexture(35866,A),t.texParameteri(35866,10240,9728),t.texParameteri(35866,10241,9728),t.texImage3D(35866,0,35056,S,C,T,0,34041,34042,null),E.framebufferTextureMultiviewOVR(36160,33306,A,0,0,T);var L=new Array(T);for(f=0;f<T;++f)L[f]=t.createFramebuffer(),t.bindFramebuffer(36160,L[f]),t.framebufferTextureLayer(36160,36064,D,0,f);s.__webglColorTexture=D,s.__webglDepthStencilTexture=A,s.__webglViewFramebuffers=L,t.bindFramebuffer(36160,null),t.bindTexture(35866,null)}if(u){for(n.bindTexture(34067,c.__webglTexture),O(34067,r.texture,d),f=0;f<6;f++)P(s.__webglFramebuffer[f],r,36064,34069+f);y(r.texture,d)&&x(34067,r.texture,r.width,r.height),n.bindTexture(34067,null)}else p||(n.bindTexture(3553,c.__webglTexture),O(3553,r.texture,d),P(s.__webglFramebuffer,r,36064,3553),y(r.texture,d)&&x(3553,r.texture,r.width,r.height),n.bindTexture(3553,null));r.depthBuffer&&k(r)},this.updateRenderTargetMipmap=function(t){var e=t.texture;if(y(e,v(t)||l)){var r=t.isWebGLCubeRenderTarget?34067:3553,a=i.get(e).__webglTexture;n.bindTexture(r,a),x(r,e,t.width,t.height),n.bindTexture(r,null)}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget)if(l){var n=i.get(e);t.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,n.__webglFramebuffer);var r=e.width,a=e.height,o=16384;e.depthBuffer&&(o|=256),e.stencilBuffer&&(o|=1024),t.blitFramebuffer(0,0,r,a,0,0,r,a,o,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===B&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),B=!0),t=t.texture),C(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===F&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),F=!0),t=t.texture),(t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?T:E)(t,e)}}(f,m,v,x,g,L,y),w=new function(t,e){var n=e.isWebGL2,i=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),i.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);var n=i.get(e);n&&(t.deleteBuffer(n.buffer),i.delete(e))},update:function(e,r){e.isInterleavedBufferAttribute&&(e=e.data);var a,o,s,l,c,u=i.get(e);void 0===u?i.set(e,function(e,n){var i=e.array,r=e.usage,a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,i,r),e.onUploadCallback();var o=5126;return i instanceof Float32Array?o=5126:i instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):i instanceof Uint16Array?o=5123:i instanceof Int16Array?o=5122:i instanceof Uint32Array?o=5125:i instanceof Int32Array?o=5124:i instanceof Int8Array?o=5120:i instanceof Uint8Array&&(o=5121),{buffer:a,type:o,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version}}(e,r)):u.version<e.version&&(a=u.buffer,s=r,l=(o=e).array,c=o.updateRange,t.bindBuffer(s,a),-1===c.count?t.bufferSubData(s,0,l):(n?t.bufferSubData(s,c.offset*l.BYTES_PER_ELEMENT,l,c.offset,c.count):t.bufferSubData(s,c.offset*l.BYTES_PER_ELEMENT,l.subarray(c.offset,c.offset+c.count)),c.count=-1),u.version=e.version)}}}(f,g),M=new function(t,e,n){var i=new WeakMap,r=new WeakMap;function a(t){var o=t.target,s=i.get(o);for(var l in null!==s.index&&e.remove(s.index),s.attributes)e.remove(s.attributes[l]);o.removeEventListener("dispose",a),i.delete(o);var c=r.get(s);c&&(e.remove(c),r.delete(s)),n.memory.geometries--}function o(t){var n=[],i=t.index,a=t.attributes.position,o=0;if(null!==i){var s=i.array;o=i.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<Ai(n)?Ci:_i)(n,1);d.version=o,e.update(d,34963);var f=r.get(t);f&&e.remove(f),r.set(t,d)}return{get:function(t,e){var r=i.get(e);return r||(e.addEventListener("dispose",a),e.isBufferGeometry?r=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new Bi).setFromObject(t)),r=e._bufferGeometry),i.set(e,r),n.memory.geometries++,r)},update:function(t){var n=t.index,i=t.attributes;for(var r in null!==n&&e.update(n,34963),i)e.update(i[r],34962);var a=t.morphAttributes;for(var r in a)for(var o=a[r],s=0,l=o.length;s<l;s++)e.update(o[s],34962)},getWireframeAttribute:function(t){var e=r.get(t);if(e){var n=t.index;null!==n&&e.version<n.version&&o(t)}else o(t);return r.get(t)}}}(0,w,y),_=new function(t,e,n,i){var r={};return{update:function(t){var a=i.render.frame,o=t.geometry,s=e.get(t,o);return r[s.id]!==a&&(o.isGeometry&&s.updateFromObject(t),e.update(s),r[s.id]=a),t.isInstancedMesh&&n.update(t.instanceMatrix,34962),s},dispose:function(){r={}}}}(0,M,w,y),D=new function(t){var e={},n=new Float32Array(8);return{update:function(i,r,a,o){var s=i.morphTargetInfluences,l=void 0===s?0:s.length,c=e[r.id];if(void 0===c){c=[];for(var u=0;u<l;u++)c[u]=[u,0];e[r.id]=c}var h=a.morphTargets&&r.morphAttributes.position,p=a.morphNormals&&r.morphAttributes.normal;for(u=0;u<l;u++)0!==(f=c[u])[1]&&(h&&r.deleteAttribute("morphTarget"+u),p&&r.deleteAttribute("morphNormal"+u));for(u=0;u<l;u++)(f=c[u])[0]=u,f[1]=s[u];c.sort(Ir);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&&r.setAttribute("morphTarget"+u,h[m]),p&&r.setAttribute("morphNormal"+u,p[m]),d+=n[u]=g;continue}}n[u]=0}var v=r.morphTargetsRelative?1:1-d;o.getUniforms().setValue(t,"morphTargetBaseInfluence",v),o.getUniforms().setValue(t,"morphTargetInfluences",n)}}}(f),S=new Ja(I,m,g),C=new function(){var t=new WeakMap;function e(n){var i=n.target;i.removeEventListener("dispose",e),t.delete(i)}return{get:function(n,i){var r,a=t.get(n);return void 0===a?(r=new Ya,t.set(n,new WeakMap),t.get(n).set(i,r),n.addEventListener("dispose",e)):void 0===(r=a.get(i))&&(r=new Ya,a.set(i,r)),r},dispose:function(){t=new WeakMap}}},T=new function(){var t=new WeakMap;function e(n){var i=n.target;i.removeEventListener("dispose",e),t.delete(i)}return{get:function(n,i){var r;return!1===t.has(n)?(r=new Qa,t.set(n,new WeakMap),t.get(n).set(i,r),n.addEventListener("dispose",e)):!1===t.get(n).has(i)?(r=new Qa,t.get(n).set(i,r)):r=t.get(n).get(i),r},dispose:function(){t=new WeakMap}}},E=new Lr(I,v,_,s),A=new function(t,e,n,i){var r,a=i.isWebGL2;this.setMode=function(t){r=t},this.render=function(e,i){t.drawArrays(r,e,i),n.update(i,r)},this.renderInstances=function(i,o,s,l){if(0!==l){var c,u;if(a)c=t,u="drawArraysInstanced";else if(u="drawArraysInstancedANGLE",null===(c=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[u](r,o,s,l),n.update(s,r,l)}}}(f,m,y,g),O=new function(t,e,n,i){var r,a,o,s=i.isWebGL2;this.setMode=function(t){r=t},this.setIndex=function(t){a=t.type,o=t.bytesPerElement},this.render=function(e,i){t.drawElements(r,i,a,e*o),n.update(i,r)},this.renderInstances=function(i,l,c,u){if(0!==u){var h,p;if(s)h=t,p="drawElementsInstanced";else if(p="drawElementsInstancedANGLE",null===(h=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[p](r,c,a,l*o,u),n.update(c,r,u)}}}(f,m,y,g),y.programs=S.programs,I.capabilities=g,I.extensions=m,I.properties=x,I.renderLists=C,I.state=v,I.info=y}Ct();var Dt=new uo(I,f);this.xr=Dt;var At=new function(t,e){var n,i,r,a,o,s,l,c=t.extensions,u=t.properties,h=0;function p(t){return t.isArrayCamera?t.cameras:(o[0]=t,o)}this.isAvailable=function(){if(void 0===l){var t=c.get("OVR_multiview2");if(l=null!==t&&!1===e.getContextAttributes().antialias){h=e.getParameter(t.MAX_VIEWS_OVR),n=new so(0,0,2),s=new Re,a=[],r=[],o=[];for(var i=0;i<h;i++)a[i]=new Qe,r[i]=new ke}}return l},this.attachCamera=function(e){!1!==function(t){if(void 0===t.isArrayCamera)return!0;var e=t.cameras;if(e.length>h)return!1;for(var n=1,i=e.length;n<i;n++)if(e[0].viewport.z!==e[n].viewport.z||e[0].viewport.w!==e[n].viewport.w)return!1;return!0}(e)&&(i=t.getRenderTarget(),function(e){if(i?s.set(i.width,i.height):t.getDrawingBufferSize(s),e.isArrayCamera){var r=e.cameras[0].viewport;n.setSize(r.z,r.w),n.setNumViews(e.cameras.length)}else n.setSize(s.x,s.y),n.setNumViews(2)}(e),t.setRenderTarget(n))},this.detachCamera=function(r){n===t.getRenderTarget()&&(t.setRenderTarget(i),function(t){var i=n,r=i.numViews,a=u.get(i).__webglViewFramebuffers,o=i.width,l=i.height;if(t.isArrayCamera)for(var c=0;c<r;c++){var h=t.cameras[c].viewport,p=h.x,d=h.y,f=p+h.z,m=d+h.w;e.bindFramebuffer(36008,a[c]),e.blitFramebuffer(0,0,o,l,p,d,f,m,16384,9728)}else e.bindFramebuffer(36008,a[0]),e.blitFramebuffer(0,0,o,l,0,0,s.x,s.y,16384,9728)}(r))},this.updateCameraProjectionMatricesUniform=function(t,n){for(var i=p(t),r=0;r<i.length;r++)a[r].copy(i[r].projectionMatrix);n.setValue(e,"projectionMatrices",a)},this.updateCameraViewMatricesUniform=function(t,n){for(var i=p(t),r=0;r<i.length;r++)a[r].copy(i[r].matrixWorldInverse);n.setValue(e,"viewMatrices",a)},this.updateObjectMatricesUniforms=function(t,n,i){for(var o=p(n),s=0;s<o.length;s++)a[s].multiplyMatrices(o[s].matrixWorldInverse,t.matrixWorld),r[s].getNormalMatrix(a[s]);i.setValue(e,"modelViewMatrices",a),i.setValue(e,"normalMatrices",r)}}(I,f),Ot=new ro(I,_,g.maxTextureSize);function Pt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),P=!0}function Rt(){console.log("THREE.WebGLRenderer: Context Restored."),P=!1,Ct()}function kt(t){var e,n=t.target;n.removeEventListener("dispose",kt),Nt(e=n),x.remove(e)}function Nt(t){var e=x.get(t).program;(t.program=void 0)!==e&&S.releaseProgram(e)}this.shadowMap=Ot,this.getContext=function(){return f},this.getContextAttributes=function(){return f.getContextAttributes()},this.forceContextLoss=function(){var t=m.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=m.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return Y},this.setPixelRatio=function(t){void 0!==t&&(Y=t,this.setSize(q,X,!1))},this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new Re),t.set(q,X)},this.setSize=function(t,n,i){Dt.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(q=t,X=n,e.width=Math.floor(t*Y),e.height=Math.floor(n*Y),!1!==i&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),t=new Re),t.set(q*Y,X*Y).floor()},this.setDrawingBufferSize=function(t,n,i){q=t,X=n,Y=i,e.width=Math.floor(t*i),e.height=Math.floor(n*i),this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),t=new je),t.copy(U)},this.getViewport=function(t){return t.copy(K)},this.setViewport=function(t,e,n,i){t.isVector4?K.set(t.x,t.y,t.z,t.w):K.set(t,e,n,i),v.viewport(U.copy(K).multiplyScalar(Y).floor())},this.getScissor=function(t){return t.copy(Q)},this.setScissor=function(t,e,n,i){t.isVector4?Q.set(t.x,t.y,t.z,t.w):Q.set(t,e,n,i),v.scissor(H.copy(Q).multiplyScalar(Y).floor())},this.getScissorTest=function(){return tt},this.setScissorTest=function(t){v.setScissorTest(tt=t)},this.setOpaqueSort=function(t){Z=t},this.setTransparentSort=function(t){$=t},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(t,e,n){var i=0;void 0!==t&&!t||(i|=16384),void 0!==e&&!e||(i|=256),void 0!==n&&!n||(i|=1024),f.clear(i)},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(){e.removeEventListener("webglcontextlost",Pt,!1),e.removeEventListener("webglcontextrestored",Rt,!1),C.dispose(),T.dispose(),x.dispose(),_.dispose(),Dt.dispose(),jt.stop()},this.renderBufferImmediate=function(t,e){v.initAttributes();var n=x.get(t);t.hasPositions&&!n.position&&(n.position=f.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=f.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=f.createBuffer()),t.hasColors&&!n.color&&(n.color=f.createBuffer());var i=e.getAttributes();t.hasPositions&&(f.bindBuffer(34962,n.position),f.bufferData(34962,t.positionArray,35048),v.enableAttribute(i.position),f.vertexAttribPointer(i.position,3,5126,!1,0,0)),t.hasNormals&&(f.bindBuffer(34962,n.normal),f.bufferData(34962,t.normalArray,35048),v.enableAttribute(i.normal),f.vertexAttribPointer(i.normal,3,5126,!1,0,0)),t.hasUvs&&(f.bindBuffer(34962,n.uv),f.bufferData(34962,t.uvArray,35048),v.enableAttribute(i.uv),f.vertexAttribPointer(i.uv,2,5126,!1,0,0)),t.hasColors&&(f.bindBuffer(34962,n.color),f.bufferData(34962,t.colorArray,35048),v.enableAttribute(i.color),f.vertexAttribPointer(i.color,3,5126,!1,0,0)),v.disableUnusedAttributes(),f.drawArrays(4,0,t.count),t.count=0};var Bt=new xn;this.renderBufferDirect=function(t,e,n,i,r,a){null===e&&(e=Bt);var o=r.isMesh&&r.matrixWorld.determinant()<0,s=Ut(t,e,i,r);v.setMaterial(i,o);var l=!1;V.geometry===n.id&&V.program===s.id&&V.wireframe===(!0===i.wireframe)||(V.geometry=n.id,V.program=s.id,V.wireframe=!0===i.wireframe,l=!0),(i.morphTargets||i.morphNormals)&&(D.update(r,n,i,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===i.wireframe&&(c=M.getWireframeAttribute(n),p=2);var d=A;null!==c&&((h=w.get(c))?(d=O).setIndex(h):(console.log("mx attribute == null"),c=null)),l&&(function(t,e,n,i){if(!1!==g.isWebGL2||!t.isInstancedMesh&&!e.isInstancedBufferGeometry||null!==m.get("ANGLE_instanced_arrays")){v.initAttributes();var r=e.attributes,a=i.getAttributes(),o=n.defaultAttributeValues;for(var s in a){var l=a[s];if(0<=l){var c=r[s];if(void 0!==c){var u=c.normalized,h=c.itemSize;if(void 0===(_=w.get(c)))continue;var p=_.buffer,d=_.type,y=_.bytesPerElement;if(c.isInterleavedBufferAttribute){var x=c.data,b=x.stride,M=c.offset;x&&x.isInstancedInterleavedBuffer?(v.enableAttributeAndDivisor(l,x.meshPerAttribute),void 0===e.maxInstancedCount&&(e.maxInstancedCount=x.meshPerAttribute*x.count)):v.enableAttribute(l),f.bindBuffer(34962,p),f.vertexAttribPointer(l,h,d,u,b*y,M*y)}else c.isInstancedBufferAttribute?(v.enableAttributeAndDivisor(l,c.meshPerAttribute),void 0===e.maxInstancedCount&&(e.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 _;if(void 0===(_=w.get(t.instanceMatrix)))continue;p=_.buffer,d=_.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()}}(r,n,i,s),null!==c&&f.bindBuffer(34963,h.buffer));var y=null!==c?c.count:u.count,x=n.drawRange.start*p,b=n.drawRange.count*p,_=null!==a?a.start*p:0,S=null!==a?a.count*p:1/0,C=Math.max(x,_),T=Math.min(y,x+b,_+S)-1,E=Math.max(0,T-C+1);if(0!==E){if(r.isMesh)!0===i.wireframe?(v.setLineWidth(i.wireframeLinewidth*wt()),d.setMode(1)):d.setMode(4);else if(r.isLine){var L=i.linewidth;void 0===L&&(L=1),v.setLineWidth(L*wt()),r.isLineSegments?d.setMode(1):r.isLineLoop?d.setMode(2):d.setMode(3)}else r.isPoints?d.setMode(0):r.isSprite&&d.setMode(4);r.isInstancedMesh?d.renderInstances(n,C,E,r.count):n.isInstancedBufferGeometry?d.renderInstances(n,C,E,n.maxInstancedCount):d.render(C,E)}},this.compile=function(t,e){(d=T.get(t,e)).init(),t.traverse(function(t){t.isLight&&(d.pushLight(t),t.castShadow&&d.pushShadow(t))}),d.setupLights(e);var n={};t.traverse(function(e){if(e.material)if(Array.isArray(e.material))for(var i=0;i<e.material.length;i++)e.material[i].uuid in n==0&&(Gt(e.material[i],t,e),n[e.material[i].uuid]=!0);else e.material.uuid in n==0&&(Gt(e.material,t,e),n[e.material.uuid]=!0)})};var Ft=null,jt=new Tr;function Vt(t,e,n,i){for(var r=0,a=t.length;r<a;r++){var o=t[r],s=o.object,l=o.geometry,c=void 0===i?o.material:i,u=o.group;if(n.isArrayCamera)if(G=n,Dt.enabled&&At.isAvailable())zt(s,e,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(U.copy(m.viewport)),d.setupLights(m),zt(s,e,m,l,c,u))}else G=null,zt(s,e,n,l,c,u)}}function zt(t,e,n,i,r,a){if(t.onBeforeRender(I,e,n,i,r,a),d=T.get(e,G||n),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){var o=Ut(n,e,r,t);v.setMaterial(r),V.geometry=null,V.program=null,V.wireframe=!1,s=o,t.render(function(t){I.renderBufferImmediate(t,s)})}else I.renderBufferDirect(n,e,i,r,t,a);var s;t.onAfterRender(I,e,n,i,r,a),d=T.get(e,G||n)}function Gt(t,e,n){var i=x.get(t),r=d.state.lights,a=d.state.shadowsArray,o=r.state.version,s=S.getParameters(t,r.state,a,e,nt.numPlanes,nt.numIntersection,n),l=S.getProgramCacheKey(s),c=i.program,u=!0;if(void 0===c)t.addEventListener("dispose",kt);else if(c.cacheKey!==l)Nt(t);else if(i.lightsStateVersion!==o)i.lightsStateVersion=o,u=!1;else{if(void 0!==s.shaderID)return;u=!1}u&&(c=S.acquireProgram(s,l),i.program=c,i.uniforms=s.uniforms,i.environment=t.isMeshStandardMaterial?e.environment:null,i.outputEncoding=I.outputEncoding,t.program=c);var h=c.getAttributes();if(t.morphTargets)for(var p=t.numSupportedMorphTargets=0;p<I.maxMorphTargets;p++)0<=h["morphTarget"+p]&&t.numSupportedMorphTargets++;if(t.morphNormals)for(p=t.numSupportedMorphNormals=0;p<I.maxMorphNormals;p++)0<=h["morphNormal"+p]&&t.numSupportedMorphNormals++;var f,m=i.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(i.numClippingPlanes=nt.numPlanes,i.numIntersection=nt.numIntersection,m.clippingPlanes=nt.uniform),i.fog=e.fog,i.needsLights=(f=t).isMeshLambertMaterial||f.isMeshToonMaterial||f.isMeshPhongMaterial||f.isMeshStandardMaterial||f.isShadowMaterial||f.isShaderMaterial&&!0===f.lights,i.lightsStateVersion=o,i.needsLights&&(m.ambientLightColor.value=r.state.ambient,m.lightProbe.value=r.state.probe,m.directionalLights.value=r.state.directional,m.spotLights.value=r.state.spot,m.rectAreaLights.value=r.state.rectArea,m.pointLights.value=r.state.point,m.hemisphereLights.value=r.state.hemi,m.directionalShadowMap.value=r.state.directionalShadowMap,m.directionalShadowMatrix.value=r.state.directionalShadowMatrix,m.spotShadowMap.value=r.state.spotShadowMap,m.spotShadowMatrix.value=r.state.spotShadowMatrix,m.pointShadowMap.value=r.state.pointShadowMap,m.pointShadowMatrix.value=r.state.pointShadowMatrix);var g=i.program.getUniforms(),v=Oa.seqWithValue(g.seq,m);i.uniformsList=v}function Ut(t,e,n,i){b.resetTextureUnits();var r=e.fog,a=n.isMeshStandardMaterial?e.environment:null,o=x.get(n),s=d.state.lights;if(it&&(ft||t!==z)){var c=t===z&&n.id===j;nt.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,t,o,c)}n.version===o.__version?(void 0===o.program||n.fog&&o.fog!==r||o.environment!==a||o.needsLights&&o.lightsStateVersion!==s.state.version||void 0!==o.numClippingPlanes&&(o.numClippingPlanes!==nt.numPlanes||o.numIntersection!==nt.numIntersection)||o.outputEncoding!==I.outputEncoding)&&Gt(n,e,i):(x.update(n,"uniforms",n.uniforms),Gt(n,e,i),o.__version=n.version);var u,h,p,m,y,w,M,_,S,C,T,E,D=!1,A=!1,O=!1,L=o.program,P=L.getUniforms(),R=o.uniforms;if(v.useProgram(L.program)&&(O=A=D=!0),n.id!==j&&(j=n.id,A=!0),D||z!==t){if(0<L.numMultiviewViews?At.updateCameraProjectionMatricesUniform(t,P):P.setValue(f,"projectionMatrix",t.projectionMatrix),g.logarithmicDepthBuffer&&P.setValue(f,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),z!==t&&(z=t,O=A=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){var k=P.map.cameraPosition;void 0!==k&&k.setValue(f,vt.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&P.setValue(f,"isOrthographic",!0===t.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&(0<L.numMultiviewViews?At.updateCameraViewMatricesUniform(t,P):P.setValue(f,"viewMatrix",t.matrixWorldInverse))}if(n.skinning){P.setOptional(f,i,"bindMatrix"),P.setOptional(f,i,"bindMatrixInverse");var N=i.skeleton;if(N){var B=N.bones;if(g.floatVertexTextures){if(void 0===N.boneTexture){var F=Math.sqrt(4*B.length);F=Pe.ceilPowerOfTwo(F),F=Math.max(F,4);var V=new Float32Array(F*F*4);V.set(N.boneMatrices);var G=new wr(V,F,F,Et,xt);N.boneMatrices=V,N.boneTexture=G,N.boneTextureSize=F}P.setValue(f,"boneTexture",N.boneTexture,b),P.setValue(f,"boneTextureSize",N.boneTextureSize)}else P.setOptional(f,N,"boneMatrices")}}return!A&&o.receiveShadow===i.receiveShadow||(o.receiveShadow=i.receiveShadow,P.setValue(f,"receiveShadow",i.receiveShadow)),A&&(P.setValue(f,"toneMappingExposure",I.toneMappingExposure),P.setValue(f,"toneMappingWhitePoint",I.toneMappingWhitePoint),o.needsLights&&(E=O,(T=R).ambientLightColor.needsUpdate=E,T.lightProbe.needsUpdate=E,T.directionalLights.needsUpdate=E,T.pointLights.needsUpdate=E,T.spotLights.needsUpdate=E,T.rectAreaLights.needsUpdate=E,T.hemisphereLights.needsUpdate=E),r&&n.fog&&(C=r,(S=R).fogColor.value.copy(C.color),C.isFog?(S.fogNear.value=C.near,S.fogFar.value=C.far):C.isFogExp2&&(S.fogDensity.value=C.density)),n.isMeshBasicMaterial?Ht(R,n):n.isMeshLambertMaterial?(Ht(R,n),M=R,(_=n).emissiveMap&&(M.emissiveMap.value=_.emissiveMap)):n.isMeshToonMaterial?(Ht(R,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.gradientMap&&(t.gradientMap.value=e.gradientMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===l&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===l&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(R,n)):n.isMeshPhongMaterial?(Ht(R,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===l&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===l&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(R,n)):n.isMeshStandardMaterial?(Ht(R,n,a),(n.isMeshPhysicalMaterial?function(t,e,n){Wt(t,e,n),t.reflectivity.value=e.reflectivity,t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.sheen&&t.sheen.value.copy(e.sheen),e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,e.side===l&&t.clearcoatNormalScale.value.negate()),t.transparency.value=e.transparency}:Wt)(R,n,a)):n.isMeshMatcapMaterial?(Ht(R,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===l&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===l&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(R,n)):n.isMeshDepthMaterial?(Ht(R,n),y=R,(w=n).displacementMap&&(y.displacementMap.value=w.displacementMap,y.displacementScale.value=w.displacementScale,y.displacementBias.value=w.displacementBias)):n.isMeshDistanceMaterial?(Ht(R,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(R,n)):n.isMeshNormalMaterial?(Ht(R,n),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===l&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===l&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(R,n)):n.isLineBasicMaterial?(m=n,(p=R).diffuse.value.copy(m.color),p.opacity.value=m.opacity,n.isLineDashedMaterial&&(h=n,(u=R).dashSize.value=h.dashSize,u.totalSize.value=h.dashSize+h.gapSize,u.scale.value=h.scale)):n.isPointsMaterial?function(t,e){var n;t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*Y,t.scale.value=.5*X,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.map?n=e.map:e.alphaMap&&(n=e.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}(R,n):n.isSpriteMaterial?function(t,e){var n;t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.map?n=e.map:e.alphaMap&&(n=e.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}(R,n):n.isShadowMaterial&&(R.color.value.copy(n.color),R.opacity.value=n.opacity),void 0!==R.ltc_1&&(R.ltc_1.value=Cr.LTC_1),void 0!==R.ltc_2&&(R.ltc_2.value=Cr.LTC_2),Oa.upload(f,o.uniformsList,R,b),n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(Oa.upload(f,o.uniformsList,R,b),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&P.setValue(f,"center",i.center),0<L.numMultiviewViews?At.updateObjectMatricesUniforms(i,t,P):(P.setValue(f,"modelViewMatrix",i.modelViewMatrix),P.setValue(f,"normalMatrix",i.normalMatrix)),P.setValue(f,"modelMatrix",i.matrixWorld),L}function Ht(t,e,n){t.opacity.value=e.opacity,e.color&&t.diffuse.value.copy(e.color),e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.specularMap&&(t.specularMap.value=e.specularMap);var i,r,a=e.envMap||n;a&&(t.envMap.value=a,t.flipEnvMap.value=a.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio,t.maxMipLevel.value=x.get(a).__maxMipLevel),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity),e.map?i=e.map:e.specularMap?i=e.specularMap:e.displacementMap?i=e.displacementMap:e.normalMap?i=e.normalMap:e.bumpMap?i=e.bumpMap:e.roughnessMap?i=e.roughnessMap:e.metalnessMap?i=e.metalnessMap:e.alphaMap?i=e.alphaMap:e.emissiveMap&&(i=e.emissiveMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix)),e.aoMap?r=e.aoMap:e.lightMap&&(r=e.lightMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uv2Transform.value.copy(r.matrix))}function Wt(t,e,n){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===l&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===l&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),(e.envMap||n)&&(t.envMapIntensity.value=e.envMapIntensity)}jt.setAnimationLoop(function(t){Dt.isPresenting||Ft&&Ft(t)}),"undefined"!=typeof window&&jt.setContext(window),this.setAnimationLoop=function(t){Ft=t,Dt.setAnimationLoop(t),jt.start()},this.render=function(t,e){var n,i;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."),i=arguments[3]),e&&e.isCamera){if(!P){V.geometry=null,V.program=null,V.wireframe=!1,j=-1,!(z=null)===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),Dt.enabled&&Dt.isPresenting&&(e=Dt.getCamera(e)),(d=T.get(t,e)).init(),t.onBeforeRender(I,t,e,n||B),mt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),et.setFromProjectionMatrix(mt),ft=this.localClippingEnabled,it=nt.init(this.clippingPlanes,ft,e),(p=C.get(t,e)).init(),function t(e,n,i,r){if(!1!==e.visible){if(e.layers.test(n.layers))if(e.isGroup)i=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(n);else if(e.isLight)d.pushLight(e),e.castShadow&&d.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||et.intersectsSprite(e)){r&&vt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(mt);var a=_.update(e);(o=e.material).visible&&p.push(e,a,o,i,vt.z,null)}}else if(e.isImmediateRenderObject)r&&vt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(mt),p.push(e,null,e.material,i,vt.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==y.render.frame&&(e.skeleton.update(),e.skeleton.frame=y.render.frame),!e.frustumCulled||et.intersectsObject(e))){r&&vt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(mt);a=_.update(e);var o=e.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(e,a,h,i,vt.z,u)}else o.visible&&p.push(e,a,o,i,vt.z,null)}var f=e.children;for(l=0,c=f.length;l<c;l++)t(f[l],n,i,r)}}(t,e,0,I.sortObjects),!0===I.sortObjects&&p.sort(Z,$),it&&nt.beginShadows();var r=d.state.shadowsArray;Ot.render(r,t,e),d.setupLights(e),it&&nt.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),Dt.enabled&&At.isAvailable()&&At.attachCamera(e),E.render(p,t,e,i);var a=p.opaque,o=p.transparent;if(t.overrideMaterial){var s=t.overrideMaterial;a.length&&Vt(a,t,e,s),o.length&&Vt(o,t,e,s)}else a.length&&Vt(a,t,e),o.length&&Vt(o,t,e);t.onAfterRender(I,t,e),null!==B&&(b.updateRenderTargetMipmap(B),b.updateMultisampleRenderTarget(B)),v.buffers.depth.setTest(!0),v.buffers.depth.setMask(!0),v.buffers.color.setMask(!0),v.setPolygonOffset(!1),Dt.enabled&&At.isAvailable()&&At.detachCamera(e),d=p=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.mxRenderObject=function(t,e,n,i,r){zt(t,e,n,_.update(t),i,r)},this.setFramebuffer=function(t){R!==t&&null===B&&f.bindFramebuffer(36160,t),R=t},this.getActiveCubeFace=function(){return k},this.getActiveMipmapLevel=function(){return N},this.getRenderTarget=function(){return B},this.setRenderTarget=function(t,e,n){k=e,N=n,(B=t)&&void 0===x.get(t).__webglFramebuffer&&b.setupRenderTarget(t);var i=R,r=!1;if(t){var a=x.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(i=a[e||0],r=!0):i=t.isWebGLMultisampleRenderTarget?x.get(t).__webglMultisampledFramebuffer:a,U.copy(t.viewport),H.copy(t.scissor),W=t.scissorTest}else U.copy(K).multiplyScalar(Y).floor(),H.copy(Q).multiplyScalar(Y).floor(),W=tt;if(F!==i&&(f.bindFramebuffer(36160,i),F=i),v.viewport(U),v.scissor(H),v.setScissorTest(W),r){var o=x.get(t.texture);f.framebufferTexture2D(36160,36064,34069+(e||0),o.__webglTexture,n||0)}},this.readRenderTargetPixels=function(t,e,n,i,r,a,o){if(t&&t.isWebGLRenderTarget){var s=x.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){var l=!1;s!==F&&(f.bindFramebuffer(36160,s),l=!0);try{var c=t.texture,u=c.format,h=c.type;if(u!==Et&&L.convert(u)!==f.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(h===dt||L.convert(h)===f.getParameter(35738)||h===xt&&(g.isWebGL2||m.get("OES_texture_float")||m.get("WEBGL_color_buffer_float"))||h===bt&&(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<=e&&e<=t.width-i&&0<=n&&n<=t.height-r&&f.readPixels(e,n,i,r,L.convert(u),L.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(t,e,n){void 0===n&&(n=0);var i=Math.pow(2,-n),r=Math.floor(e.image.width*i),a=Math.floor(e.image.height*i),o=L.convert(e.format);b.setTexture2D(e,0),f.copyTexImage2D(3553,n,o,t.x,t.y,r,a,0),v.unbindTexture()},this.copyTextureToTexture=function(t,e,n,i){var r=e.image.width,a=e.image.height,o=L.convert(n.format),s=L.convert(n.type);b.setTexture2D(n,0),e.isDataTexture?f.texSubImage2D(3553,i||0,t.x,t.y,r,a,o,s,e.image.data):f.texSubImage2D(3553,i||0,t.x,t.y,o,s,e.image),v.unbindTexture()},this.initTexture=function(t){b.setTexture2D(t,0),v.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function po(t,e){this.name="",this.color=new ci(t),this.density=void 0!==e?e:25e-5}function fo(t,e,n){this.name="",this.color=new ci(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3}function mo(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=Ee,this.updateRange={offset:0,count:-1},this.version=0}so.prototype=Object.assign(Object.create(Ve.prototype),{constructor:so,isWebGLMultiviewRenderTarget:!0,copy:function(t){return Ve.prototype.copy.call(this,t),this.numViews=t.numViews,this},setNumViews:function(t){return this.numViews!==t&&(this.numViews=t,this.dispose()),this}}),lo.prototype=Object.assign(Object.create(yr.prototype),{constructor:lo,isArrayCamera:!0}),co.prototype=Object.assign(Object.create(yn.prototype),{constructor:co,isGroup:!0}),Object.assign(uo.prototype,Ae.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(t){!0===t&&this.version++}}),Object.assign(mo.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.stride,n*=e.stride;for(var i=0,r=this.stride;i<r;i++)this.array[t+i]=e.array[n+i];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}});var go,vo=new We;function yo(t,e,n,i){this.data=t,this.itemSize=e,this.offset=n,this.normalized=!0===i}function xo(t){mi.call(this),this.type="SpriteMaterial",this.color=new ci(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}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(t){for(var e=0,n=this.data.count;e<n;e++)vo.x=this.getX(e),vo.y=this.getY(e),vo.z=this.getZ(e),vo.applyMatrix4(t),this.setXYZ(e,vo.x,vo.y,vo.z);return this},setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this},setXYZ:function(t,e,n,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this},setXYZW:function(t,e,n,i,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this.data.array[t+3]=r,this}}),((xo.prototype=Object.create(mi.prototype)).constructor=xo).prototype.isSpriteMaterial=!0,xo.prototype.copy=function(t){return mi.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this};var bo=new We,wo=new We,Mo=new We,_o=new Re,So=new Re,Co=new Qe,To=new We,Eo=new We,Do=new We,Ao=new Re,Oo=new Re,Lo=new Re;function Io(t){if(yn.call(this),this.type="Sprite",void 0===go){go=new Bi;var e=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(e,3,0,!1)),go.setAttribute("uv",new yo(e,2,3,!1))}this.geometry=go,this.material=void 0!==t?t:new xo,this.center=new Re(.5,.5)}function Po(t,e,n,i,r,a){_o.subVectors(t,n).addScalar(.5).multiply(i),void 0!==r?(So.x=a*_o.x-r*_o.y,So.y=r*_o.x+a*_o.y):So.copy(_o),t.copy(e),t.x+=So.x,t.y+=So.y,t.applyMatrix4(Co)}Io.prototype=Object.assign(Object.create(yn.prototype),{constructor:Io,isSprite:!0,raycast:function(t,e){null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),wo.setFromMatrixScale(this.matrixWorld),Co.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),Mo.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&wo.multiplyScalar(-Mo.z);var n,i,r=this.material.rotation;0!==r&&(i=Math.cos(r),n=Math.sin(r));var a=this.center;Po(To.set(-.5,-.5,0),Mo,a,wo,n,i),Po(Eo.set(.5,-.5,0),Mo,a,wo,n,i),Po(Do.set(.5,.5,0),Mo,a,wo,n,i),Ao.set(0,0),Oo.set(1,0),Lo.set(1,1);var o=t.ray.intersectTriangle(To,Eo,Do,!1,bo);if(null!==o||(Po(Eo.set(-.5,.5,0),Mo,a,wo,n,i),Oo.set(0,1),null!==(o=t.ray.intersectTriangle(To,Do,Eo,!1,bo)))){var s=t.ray.origin.distanceTo(bo);s<t.near||s>t.far||e.push({distance:s,point:bo.clone(),uv:ai.getUV(bo,To,Eo,Do,Ao,Oo,Lo,new Re),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return yn.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}});var Ro=new We,ko=new We;function No(){yn.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function Bo(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),er.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Qe,this.bindMatrixInverse=new Qe}No.prototype=Object.assign(Object.create(yn.prototype),{constructor:No,isLOD:!0,copy:function(t){yn.prototype.copy.call(this,t,!1);for(var e=t.levels,n=0,i=e.length;n<i;n++){var r=e[n];this.addLevel(r.object.clone(),r.distance)}return this.autoUpdate=t.autoUpdate,this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var n=this.levels,i=0;i<n.length&&!(e<n[i].distance);i++);return n.splice(i,0,{distance:e,object:t}),this.add(t),this},getObjectForDistance:function(t){var e=this.levels;if(0<e.length){for(var n=1,i=e.length;n<i&&!(t<e[n].distance);n++);return e[n-1].object}return null},raycast:function(t,e){if(0<this.levels.length){Ro.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(Ro);this.getObjectForDistance(n).raycast(t,e)}},update:function(t){var e=this.levels;if(1<e.length){Ro.setFromMatrixPosition(t.matrixWorld),ko.setFromMatrixPosition(this.matrixWorld);var n=Ro.distanceTo(ko);e[0].object.visible=!0;for(var i=1,r=e.length;i<r&&n>=e[i].distance;i++)e[i-1].object.visible=!1,e[i].object.visible=!0;for(;i<r;i++)e[i].object.visible=!1}},toJSON:function(t){var e=yn.prototype.toJSON.call(this,t);!1===this.autoUpdate&&(e.object.autoUpdate=!1),e.object.levels=[];for(var n=this.levels,i=0,r=n.length;i<r;i++){var a=n[i];e.object.levels.push({object:a.object.uuid,distance:a.distance})}return e}}),Bo.prototype=Object.assign(Object.create(er.prototype),{constructor:Bo,isSkinnedMesh:!0,bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var t=new je,e=this.geometry.attributes.skinWeight,n=0,i=e.count;n<i;n++){t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.w=e.getW(n);var r=1/t.manhattanLength();r!=1/0?t.multiplyScalar(r):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){er.prototype.updateMatrixWorld.call(this,t),"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 Qe,jo=new Qe;function Vo(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new Qe)}}function zo(){yn.call(this),this.type="Bone"}Object.assign(Vo.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var n=new Qe;this.bones[t]&&n.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(n)}},pose:function(){var t,e,n;for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:function(){for(var t=this.bones,e=this.boneInverses,n=this.boneMatrices,i=this.boneTexture,r=0,a=t.length;r<a;r++){var o=t[r]?t[r].matrixWorld:jo;Fo.multiplyMatrices(o,e[r]),Fo.toArray(n,16*r)}void 0!==i&&(i.needsUpdate=!0)},clone:function(){return new Vo(this.bones,this.boneInverses)},getBoneByName:function(t){for(var e=0,n=this.bones.length;e<n;e++){var i=this.bones[e];if(i.name===t)return i}}}),zo.prototype=Object.assign(Object.create(yn.prototype),{constructor:zo,isBone:!0});var Go=new Qe,Uo=new Qe,Ho=[],Wo=new er;function Jo(t,e,n){er.call(this,t,e),this.instanceMatrix=new yi(new Float32Array(16*n),16),this.count=n,this.frustumCulled=!1}function qo(t){mi.call(this),this.type="LineBasicMaterial",this.color=new ci(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(t)}Jo.prototype=Object.assign(Object.create(er.prototype),{constructor:Jo,isInstancedMesh:!0,getMatrixAt:function(t,e){e.fromArray(this.instanceMatrix.array,16*t)},raycast:function(t,e){var n=this.matrixWorld,i=this.count;if(Wo.geometry=this.geometry,Wo.material=this.material,void 0!==Wo.material)for(var r=0;r<i;r++)this.getMatrixAt(r,Go),Uo.multiplyMatrices(n,Go),Wo.matrixWorld=Uo,Wo.raycast(t,Ho),0<Ho.length&&(Ho[0].instanceId=r,Ho[0].object=this,e.push(Ho[0]),Ho.length=0)},setMatrixAt:function(t,e){e.toArray(this.instanceMatrix.array,16*t)},updateMorphTargets:function(){}}),((qo.prototype=Object.create(mi.prototype)).constructor=qo).prototype.isLineBasicMaterial=!0,qo.prototype.copy=function(t){return mi.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this};var Xo=new We,Yo=new We,Zo=new Qe,$o=new Hn,Ko=new Nn;function Qo(t,e,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!==t?t:new Bi,this.material=void 0!==e?e:new qo}Qo.prototype=Object.assign(Object.create(yn.prototype),{constructor:Qo,isLine:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[0],i=1,r=e.count;i<r;i++)Xo.fromBufferAttribute(e,i-1),Yo.fromBufferAttribute(e,i),n[i]=n[i-1],n[i]+=Xo.distanceTo(Yo);t.setAttribute("lineDistance",new Ti(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var a=t.vertices;for((n=t.lineDistances)[0]=0,i=1,r=a.length;i<r;i++)n[i]=n[i-1],n[i]+=a[i-1].distanceTo(a[i])}return this},raycast:function(t,e){var n=t.linePrecision,i=this.geometry,r=this.matrixWorld;if(null===i.boundingSphere&&i.computeBoundingSphere(),Ko.copy(i.boundingSphere),Ko.applyMatrix4(r),Ko.radius+=n,!1!==t.ray.intersectsSphere(Ko)){Zo.getInverse(r),$o.copy(t.ray).applyMatrix4(Zo);var a=n/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,s=new We,l=new We,c=new We,u=new We,h=this&&this.isLineSegments?2:1;if(i.isBufferGeometry){var p=i.index,d=i.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<$o.distanceSqToSegment(s,l,u,c)||(u.applyMatrix4(this.matrixWorld),(w=t.ray.origin.distanceTo(u))<t.near||w>t.far||e.push({distance:w,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<$o.distanceSqToSegment(s,l,u,c)||(u.applyMatrix4(this.matrixWorld),(w=t.ray.origin.distanceTo(u))<t.near||w>t.far||e.push({distance:w,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}))}else if(i.isGeometry){var x=i.vertices,b=x.length;for(m=0;m<b-1;m+=h){var w;o<$o.distanceSqToSegment(x[m],x[m+1],u,c)||(u.applyMatrix4(this.matrixWorld),(w=t.ray.origin.distanceTo(u))<t.near||w>t.far||e.push({distance:w,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 ts=new We,es=new We;function ns(t,e){Qo.call(this,t,e),this.type="LineSegments"}function is(t,e){Qo.call(this,t,e),this.type="LineLoop"}function rs(t){mi.call(this),this.type="PointsMaterial",this.color=new ci(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}ns.prototype=Object.assign(Object.create(Qo.prototype),{constructor:ns,isLineSegments:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[],i=0,r=e.count;i<r;i+=2)ts.fromBufferAttribute(e,i),es.fromBufferAttribute(e,i+1),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+ts.distanceTo(es);t.setAttribute("lineDistance",new Ti(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var a=t.vertices;for(n=t.lineDistances,i=0,r=a.length;i<r;i+=2)ts.copy(a[i]),es.copy(a[i+1]),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+ts.distanceTo(es)}return this}}),is.prototype=Object.assign(Object.create(Qo.prototype),{constructor:is,isLineLoop:!0}),((rs.prototype=Object.create(mi.prototype)).constructor=rs).prototype.isPointsMaterial=!0,rs.prototype.copy=function(t){return mi.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this};var as=new Qe,os=new Hn,ss=new Nn,ls=new We;function cs(t,e){yn.call(this),this.type="Points",this.geometry=void 0!==t?t:new Bi,this.material=void 0!==e?e:new rs,this.updateMorphTargets()}function us(t,e,n,i,r,a,o){var s=os.distanceSqToPoint(t);if(s<n){var l=new We;os.closestPointToPoint(t,l),l.applyMatrix4(i);var c=r.ray.origin.distanceTo(l);if(c<r.near||c>r.far)return;a.push({distance:c,distanceToRay:Math.sqrt(s),point:l,index:e,face:null,object:o})}}function hs(t,e,n,i,r,a,o,s,l){Fe.call(this,t,e,n,i,r,a,o,s,l),this.format=void 0!==o?o:Tt,this.minFilter=void 0!==a?a:ut,this.magFilter=void 0!==r?r:ut,this.generateMipmaps=!1}function ps(t,e,n,i,r,a,o,s,l,c,u,h){Fe.call(this,null,a,o,s,l,c,i,r,u,h),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function ds(t,e,n,i,r,a,o,s,l){Fe.call(this,t,e,n,i,r,a,o,s,l),this.needsUpdate=!0}function fs(t,e,n,i,r,a,o,s,l,c){if((c=void 0!==c?c:Lt)!==Lt&&c!==It)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===Lt&&(n=gt),void 0===n&&c===It&&(n=St),Fe.call(this,null,i,r,a,o,s,c,n,l),this.image={width:t,height:e},this.magFilter=void 0!==o?o:st,this.minFilter=void 0!==s?s:st,this.flipY=!1,this.generateMipmaps=!1}function ms(t){Bi.call(this),this.type="WireframeGeometry";var e,n,i,r,a,o,s,l,c,u,h=[],p=[0,0],d={},f=["a","b","c"];if(t&&t.isGeometry){var m=t.faces;for(e=0,i=m.length;e<i;e++){var g=m[e];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=t.vertices[o.index1],h.push(u.x,u.y,u.z),u=t.vertices[o.index2],h.push(u.x,u.y,u.z)}else if(t&&t.isBufferGeometry){var v,y,x,b,w,M;if(u=new We,null!==t.index){for(v=t.attributes.position,y=t.index,0===(x=t.groups).length&&(x=[{start:0,count:y.count,materialIndex:0}]),r=0,a=x.length;r<a;++r)for(i=(e=(b=x[r]).start)+b.count;e<i;e+=3)for(n=0;n<3;n++)s=y.getX(e+n),l=y.getX(e+(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(e=0,i=(v=t.attributes.position).count/3;e<i;e++)for(n=0;n<3;n++)w=3*e+n,u.fromBufferAttribute(v,w),h.push(u.x,u.y,u.z),M=3*e+(n+1)%3,u.fromBufferAttribute(v,M),h.push(u.x,u.y,u.z)}this.setAttribute("position",new Ti(h,3))}function gs(t,e,n){lr.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:n},this.fromBufferGeometry(new vs(t,e,n)),this.mergeVertices()}function vs(t,e,n){Bi.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:n};var i,r,a=[],o=[],s=[],l=[],c=new We,u=new We,h=new We,p=new We,d=new We;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var f=e+1;for(i=0;i<=n;i++){var m=i/n;for(r=0;r<=e;r++){var g=r/e;t(g,m,u),o.push(u.x,u.y,u.z),0<=g-1e-5?(t(g-1e-5,m,h),p.subVectors(u,h)):(t(1e-5+g,m,h),p.subVectors(h,u)),0<=m-1e-5?(t(g,m-1e-5,h),d.subVectors(u,h)):(t(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(i=0;i<n;i++)for(r=0;r<e;r++){var v=i*f+r,y=i*f+r+1,x=(i+1)*f+r+1,b=(i+1)*f+r;a.push(v,y,b),a.push(y,x,b)}this.setIndex(a),this.setAttribute("position",new Ti(o,3)),this.setAttribute("normal",new Ti(s,3)),this.setAttribute("uv",new Ti(l,2))}function ys(t,e,n,i){lr.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i},this.fromBufferGeometry(new xs(t,e,n,i)),this.mergeVertices()}function xs(t,e,n,i){Bi.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i},n=n||1;var r=[],a=[];function o(t,e,n,i){var r,a,o=Math.pow(2,i),l=[];for(r=0;r<=o;r++){l[r]=[];var c=t.clone().lerp(n,r/o),u=e.clone().lerp(n,r/o),h=o-r;for(a=0;a<=h;a++)l[r][a]=0===a&&r===o?c:c.clone().lerp(u,a/h)}for(r=0;r<o;r++)for(a=0;a<2*(o-r)-1;a++){var p=Math.floor(a/2);a%2==0?(s(l[r][p+1]),s(l[r+1][p]),s(l[r][p])):(s(l[r][p+1]),s(l[r+1][p+1]),s(l[r+1][p]))}}function s(t){r.push(t.x,t.y,t.z)}function l(e,n){var i=3*e;n.x=t[0+i],n.y=t[1+i],n.z=t[2+i]}function c(t,e,n,i){i<0&&1===t.x&&(a[e]=t.x-1),0===n.x&&0===n.z&&(a[e]=i/2/Math.PI+.5)}function u(t){return Math.atan2(t.z,-t.x)}!function(t){for(var n=new We,i=new We,r=new We,a=0;a<e.length;a+=3)l(e[a+0],n),l(e[a+1],i),l(e[a+2],r),o(n,i,r,t)}(i=i||0),function(t){for(var e=new We,n=0;n<r.length;n+=3)e.x=r[n+0],e.y=r[n+1],e.z=r[n+2],e.normalize().multiplyScalar(t),r[n+0]=e.x,r[n+1]=e.y,r[n+2]=e.z}(n),function(){for(var t=new We,e=0;e<r.length;e+=3){t.x=r[e+0],t.y=r[e+1],t.z=r[e+2];var n=u(t)/2/Math.PI+.5,i=(o=t,Math.atan2(-o.y,Math.sqrt(o.x*o.x+o.z*o.z))/Math.PI+.5);a.push(n,1-i)}var o;(function(){for(var t=new We,e=new We,n=new We,i=new We,o=new Re,s=new Re,l=new Re,h=0,p=0;h<r.length;h+=9,p+=6){t.set(r[h+0],r[h+1],r[h+2]),e.set(r[h+3],r[h+4],r[h+5]),n.set(r[h+6],r[h+7],r[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]),i.copy(t).add(e).add(n).divideScalar(3);var d=u(i);c(o,p+0,t,d),c(s,p+2,e,d),c(l,p+4,n,d)}})(),function(){for(var t=0;t<a.length;t+=6){var e=a[t+0],n=a[t+2],i=a[t+4],r=Math.max(e,n,i),o=Math.min(e,n,i);.9<r&&o<.1&&(e<.2&&(a[t+0]+=1),n<.2&&(a[t+2]+=1),i<.2&&(a[t+4]+=1))}}()}(),this.setAttribute("position",new Ti(r,3)),this.setAttribute("normal",new Ti(r.slice(),3)),this.setAttribute("uv",new Ti(a,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}function bs(t,e){lr.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new ws(t,e)),this.mergeVertices()}function ws(t,e){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],t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Ms(t,e){lr.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new _s(t,e)),this.mergeVertices()}function _s(t,e){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],t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Ss(t,e){lr.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Cs(t,e)),this.mergeVertices()}function Cs(t,e){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],t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Ts(t,e){lr.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Es(t,e)),this.mergeVertices()}function Es(t,e){var n=(1+Math.sqrt(5))/2,i=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,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,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],t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Ds(t,e,n,i,r,a){lr.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new As(t,e,n,i,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function As(t,e,n,i,r){Bi.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r},e=e||64,n=n||1,i=i||8,r=r||!1;var a=t.computeFrenetFrames(e,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;var o,s,l=new We,c=new We,u=new Re,h=new We,p=[],d=[],f=[],m=[];function g(r){h=t.getPointAt(r/e,h);var o=a.normals[r],u=a.binormals[r];for(s=0;s<=i;s++){var f=s/i*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<e;o++)g(o);g(!1===r?e:0),function(){for(o=0;o<=e;o++)for(s=0;s<=i;s++)u.x=o/e,u.y=s/i,f.push(u.x,u.y)}(),function(){for(s=1;s<=e;s++)for(o=1;o<=i;o++){var t=(i+1)*(s-1)+(o-1),n=(i+1)*s+(o-1),r=(i+1)*s+o,a=(i+1)*(s-1)+o;m.push(t,n,a),m.push(n,r,a)}}()}(),this.setIndex(m),this.setAttribute("position",new Ti(p,3)),this.setAttribute("normal",new Ti(d,3)),this.setAttribute("uv",new Ti(f,2))}function Os(t,e,n,i,r,a,o){lr.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:i,p:r,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Ls(t,e,n,i,r,a)),this.mergeVertices()}function Ls(t,e,n,i,r,a){Bi.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:i,p:r,q:a},t=t||1,e=e||.4,n=Math.floor(n)||64,i=Math.floor(i)||8,r=r||2,a=a||3;var o,s,l=[],c=[],u=[],h=[],p=new We,d=new We,f=new We,m=new We,g=new We,v=new We,y=new We;for(o=0;o<=n;++o){var x=o/n*r*Math.PI*2;for(E(x,r,a,t,f),E(.01+x,r,a,t,m),v.subVectors(m,f),y.addVectors(m,f),g.crossVectors(v,y),y.crossVectors(g,v),g.normalize(),y.normalize(),s=0;s<=i;++s){var b=s/i*Math.PI*2,w=-e*Math.cos(b),M=e*Math.sin(b);p.x=f.x+(w*y.x+M*g.x),p.y=f.y+(w*y.y+M*g.y),p.z=f.z+(w*y.z+M*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/i)}}for(s=1;s<=n;s++)for(o=1;o<=i;o++){var _=(i+1)*(s-1)+(o-1),S=(i+1)*s+(o-1),C=(i+1)*s+o,T=(i+1)*(s-1)+o;l.push(_,S,T),l.push(S,C,T)}function E(t,e,n,i,r){var a=Math.cos(t),o=Math.sin(t),s=n/e*t,l=Math.cos(s);r.x=i*(2+l)*.5*a,r.y=i*(2+l)*o*.5,r.z=i*Math.sin(s)*.5}this.setIndex(l),this.setAttribute("position",new Ti(c,3)),this.setAttribute("normal",new Ti(u,3)),this.setAttribute("uv",new Ti(h,2))}function Is(t,e,n,i,r){lr.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:i,arc:r},this.fromBufferGeometry(new Ps(t,e,n,i,r)),this.mergeVertices()}function Ps(t,e,n,i,r){Bi.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:i,arc:r},t=t||1,e=e||.4,n=Math.floor(n)||8,i=Math.floor(i)||6,r=r||2*Math.PI;var a,o,s=[],l=[],c=[],u=[],h=new We,p=new We,d=new We;for(a=0;a<=n;a++)for(o=0;o<=i;o++){var f=o/i*r,m=a/n*Math.PI*2;p.x=(t+e*Math.cos(m))*Math.cos(f),p.y=(t+e*Math.cos(m))*Math.sin(f),p.z=e*Math.sin(m),l.push(p.x,p.y,p.z),h.x=t*Math.cos(f),h.y=t*Math.sin(f),d.subVectors(p,h).normalize(),c.push(d.x,d.y,d.z),u.push(o/i),u.push(a/n)}for(a=1;a<=n;a++)for(o=1;o<=i;o++){var g=(i+1)*a+o-1,v=(i+1)*(a-1)+o-1,y=(i+1)*(a-1)+o,x=(i+1)*a+o;s.push(g,v,x),s.push(v,y,x)}this.setIndex(s),this.setAttribute("position",new Ti(l,3)),this.setAttribute("normal",new Ti(c,3)),this.setAttribute("uv",new Ti(u,2))}cs.prototype=Object.assign(Object.create(yn.prototype),{constructor:cs,isPoints:!0,raycast:function(t,e){var n=this.geometry,i=this.matrixWorld,r=t.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),ss.copy(n.boundingSphere),ss.applyMatrix4(i),ss.radius+=r,!1!==t.ray.intersectsSphere(ss)){as.getInverse(i),os.copy(t.ray).applyMatrix4(as);var a=r/((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,i,t,e,this)}else{u=0;for(var d=l.length/3;u<d;u++)ls.fromArray(l,3*u),us(ls,u,o,i,t,e,this)}}else{var f=n.vertices;for(u=0,d=f.length;u<d;u++)us(f[u],u,o,i,t,e,this)}}},updateMorphTargets:function(){var t,e,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,a=Object.keys(r);if(0<a.length){var o=r[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=o.length;t<e;t++)n=o[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{var s=i.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(Fe.prototype),{constructor:hs,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),((ps.prototype=Object.create(Fe.prototype)).constructor=ps).prototype.isCompressedTexture=!0,((ds.prototype=Object.create(Fe.prototype)).constructor=ds).prototype.isCanvasTexture=!0,((fs.prototype=Object.create(Fe.prototype)).constructor=fs).prototype.isDepthTexture=!0,(ms.prototype=Object.create(Bi.prototype)).constructor=ms,(gs.prototype=Object.create(lr.prototype)).constructor=gs,(vs.prototype=Object.create(Bi.prototype)).constructor=vs,(ys.prototype=Object.create(lr.prototype)).constructor=ys,(xs.prototype=Object.create(Bi.prototype)).constructor=xs,(bs.prototype=Object.create(lr.prototype)).constructor=bs,(ws.prototype=Object.create(xs.prototype)).constructor=ws,(Ms.prototype=Object.create(lr.prototype)).constructor=Ms,(_s.prototype=Object.create(xs.prototype)).constructor=_s,(Ss.prototype=Object.create(lr.prototype)).constructor=Ss,(Cs.prototype=Object.create(xs.prototype)).constructor=Cs,(Ts.prototype=Object.create(lr.prototype)).constructor=Ts,(Es.prototype=Object.create(xs.prototype)).constructor=Es,(Ds.prototype=Object.create(lr.prototype)).constructor=Ds,((As.prototype=Object.create(Bi.prototype)).constructor=As).prototype.toJSON=function(){var t=Bi.prototype.toJSON.call(this);return t.path=this.parameters.path.toJSON(),t},(Os.prototype=Object.create(lr.prototype)).constructor=Os,(Ls.prototype=Object.create(Bi.prototype)).constructor=Ls,(Is.prototype=Object.create(lr.prototype)).constructor=Is,(Ps.prototype=Object.create(Bi.prototype)).constructor=Ps;function Rs(t,e,n,i,r){var a,o;if(r===0<function(t,e,n,i){for(var r=0,a=e,o=n-i;a<n;a+=i)r+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return r}(t,e,n,i))for(a=e;a<n;a+=i)o=$s(a,t[a],t[a+1],o);else for(a=n-i;e<=a;a-=i)o=$s(a,t[a],t[a+1],o);return o&&qs(o,o.next)&&(Ks(o),o=o.next),o}function ks(t,e){if(!t)return t;e=e||t;var n,i=t;do{if(n=!1,i.steiner||!qs(i,i.next)&&0!==Js(i.prev,i,i.next))i=i.next;else{if(Ks(i),(i=e=i.prev)===i.next)break;n=!0}}while(n||i!==e);return e}function Ns(t,e,n,i,r,a,o){if(t){!o&&a&&function(t,e,n,i){for(var r=t;null===r.z&&(r.z=Us(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,(r=r.next)!==t;);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,n,i,r,a,o,s,l,c=1;do{for(n=t,a=t=null,o=0;n;){for(o++,i=n,e=s=0;e<c&&(s++,i=i.nextZ);e++);for(l=c;0<s||0<l&&i;)0!==s&&(0===l||!i||n.z<=i.z)?(n=(r=n).nextZ,s--):(i=(r=i).nextZ,l--),a?a.nextZ=r:t=r,r.prevZ=a,a=r;n=i}a.nextZ=null,c*=2}while(1<o)}(r)}(t,i,r,a);for(var s,l,c=t;t.prev!==t.next;)if(s=t.prev,l=t.next,a?Fs(t,i,r,a):Bs(t))e.push(s.i/n),e.push(t.i/n),e.push(l.i/n),Ks(t),t=l.next,c=l.next;else if((t=l)===c){o?1===o?Ns(t=js(t,e,n),e,n,i,r,a,2):2===o&&Vs(t,e,n,i,r,a):Ns(ks(t),e,n,i,r,a,1);break}}}function Bs(t){var e=t.prev,n=t,i=t.next;if(!(0<=Js(e,n,i))){for(var r=t.next.next;r!==t.prev;){if(Ws(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&0<=Js(r.prev,r,r.next))return;r=r.next}return 1}}function Fs(t,e,n,i){var r=t.prev,a=t,o=t.next;if(!(0<=Js(r,a,o))){for(var s=r.x<a.x?r.x<o.x?r.x:o.x:a.x<o.x?a.x:o.x,l=r.y<a.y?r.y<o.y?r.y:o.y:a.y<o.y?a.y:o.y,c=r.x>a.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,u=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,h=Us(s,l,e,n,i),p=Us(c,u,e,n,i),d=t.prevZ,f=t.nextZ;d&&d.z>=h&&f&&f.z<=p;){if(d!==t.prev&&d!==t.next&&Ws(r.x,r.y,a.x,a.y,o.x,o.y,d.x,d.y)&&0<=Js(d.prev,d,d.next))return;if(d=d.prevZ,f!==t.prev&&f!==t.next&&Ws(r.x,r.y,a.x,a.y,o.x,o.y,f.x,f.y)&&0<=Js(f.prev,f,f.next))return;f=f.nextZ}for(;d&&d.z>=h;){if(d!==t.prev&&d!==t.next&&Ws(r.x,r.y,a.x,a.y,o.x,o.y,d.x,d.y)&&0<=Js(d.prev,d,d.next))return;d=d.prevZ}for(;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&Ws(r.x,r.y,a.x,a.y,o.x,o.y,f.x,f.y)&&0<=Js(f.prev,f,f.next))return;f=f.nextZ}return 1}}function js(t,e,n){var i=t;do{var r=i.prev,a=i.next.next;!qs(r,a)&&Xs(r,i,i.next,a)&&Ys(r,a)&&Ys(a,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(a.i/n),Ks(i),Ks(i.next),i=t=a),i=i.next}while(i!==t);return i}function Vs(t,e,n,i,r,a){var o,s,l=t;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(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Xs(n,n.next,t,e))return 1;n=n.next}while(n!==t)}(o,s)&&Ys(o,s)&&Ys(s,o)&&function(t,e){for(var n=t,i=!1,r=(t.x+e.x)/2,a=(t.y+e.y)/2;n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),(n=n.next)!==t;);return i}(o,s))){var u=Zs(l,c);return l=ks(l,l.next),u=ks(u,u.next),Ns(l,e,n,i,r,a),void Ns(u,e,n,i,r,a)}c=c.next}l=l.next}while(l!==t)}function zs(t,e){return t.x-e.x}function Gs(t,e){if(e=function(t,e){var n,i=e,r=t.x,a=t.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&o<s){if((o=s)===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!n)return null;if(r===o)return n.prev;var l,c=n,u=n.x,h=n.y,p=1/0;for(i=n.next;i!==c;)r>=i.x&&i.x>=u&&r!==i.x&&Ws(a<h?r:o,a,u,h,a<h?o:r,a,i.x,i.y)&&((l=Math.abs(a-i.y)/(r-i.x))<p||l===p&&i.x>n.x)&&Ys(i,t)&&(n=i,p=l),i=i.next;return n}(t,e)){var n=Zs(e,t);ks(n,n.next)}}function Us(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Hs(t){for(var e=t,n=t;(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),(e=e.next)!==t;);return n}function Ws(t,e,n,i,r,a,o,s){return 0<=(r-o)*(e-s)-(t-o)*(a-s)&&0<=(t-o)*(i-s)-(n-o)*(e-s)&&0<=(n-o)*(a-s)-(r-o)*(i-s)}function Js(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function qs(t,e){return t.x===e.x&&t.y===e.y}function Xs(t,e,n,i){return qs(t,n)&&qs(e,i)||qs(t,i)&&qs(n,e)||0<Js(t,e,n)!=0<Js(t,e,i)&&0<Js(n,i,t)!=0<Js(n,i,e)}function Ys(t,e){return Js(t.prev,t,t.next)<0?0<=Js(t,e,t.next)&&0<=Js(t,t.prev,e):Js(t,e,t.prev)<0||Js(t,t.next,e)<0}function Zs(t,e){var n=new Qs(t.i,t.x,t.y),i=new Qs(e.i,e.x,e.y),r=t.next,a=e.prev;return(t.next=e).prev=t,(n.next=r).prev=n,(i.next=n).prev=i,(a.next=i).prev=a,i}function $s(t,e,n,i){var r=new Qs(t,e,n);return i?(r.next=i.next,(r.prev=i).next.prev=r,i.next=r):(r.prev=r).next=r,r}function Ks(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Qs(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var tl={area:function(t){for(var e=t.length,n=0,i=e-1,r=0;r<e;i=r++)n+=t[i].x*t[r].y-t[r].x*t[i].y;return.5*n},isClockWise:function(t){return tl.area(t)<0},triangulateShape:function(t,e){var n=[],i=[],r=[];el(t),nl(n,t);var a=t.length;e.forEach(el);for(var o=0;o<e.length;o++)i.push(a),a+=e[o].length,nl(n,e[o]);var s=function(t,e,n){n=n||2;var i,r,a,o,s,l,c,u=e&&e.length,h=u?e[0]*n:t.length,p=Rs(t,0,h,n,!0),d=[];if(!p||p.next===p.prev)return d;if(u&&(p=function(t,e,n,i){var r,a,o,s=[];for(r=0,a=e.length;r<a;r++)(o=Rs(t,e[r]*i,r<a-1?e[r+1]*i:t.length,i,!1))===o.next&&(o.steiner=!0),s.push(Hs(o));for(s.sort(zs),r=0;r<s.length;r++)Gs(s[r],n),n=ks(n,n.next);return n}(t,e,p,n)),t.length>80*n){i=a=t[0],r=o=t[1];for(var f=n;f<h;f+=n)(s=t[f])<i&&(i=s),(l=t[f+1])<r&&(r=l),a<s&&(a=s),o<l&&(o=l);c=0!==(c=Math.max(a-i,o-r))?1/c:0}return Ns(p,d,n,i,r,c),d}(n,i);for(o=0;o<s.length;o+=3)r.push(s.slice(o,o+3));return r}};function el(t){var e=t.length;2<e&&t[e-1].equals(t[0])&&t.pop()}function nl(t,e){for(var n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}function il(t,e){lr.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new rl(t,e)),this.mergeVertices()}function rl(t,e){Bi.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:e};for(var n=this,i=[],r=[],a=0,o=(t=Array.isArray(t)?t:[t]).length;a<o;a++)s(t[a]);function s(t){var a=[],o=void 0!==e.curveSegments?e.curveSegments:12,s=void 0!==e.steps?e.steps:1,l=void 0!==e.depth?e.depth:100,c=void 0===e.bevelEnabled||e.bevelEnabled,u=void 0!==e.bevelThickness?e.bevelThickness:6,h=void 0!==e.bevelSize?e.bevelSize:u-2,p=void 0!==e.bevelOffset?e.bevelOffset:0,d=void 0!==e.bevelSegments?e.bevelSegments:3,f=e.extrudePath,m=void 0!==e.UVGenerator?e.UVGenerator:al;void 0!==e.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),l=e.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 We,x=new We,b=new We),c||(p=h=u=d=0);var C=t.extractPoints(o),T=C.shape,E=C.holes;if(!tl.isClockWise(T))for(T=T.reverse(),M=0,_=E.length;M<_;M++)w=E[M],tl.isClockWise(w)&&(E[M]=w.reverse());var D=tl.triangulateShape(T,E),A=T;for(M=0,_=E.length;M<_;M++)w=E[M],T=T.concat(w);function O(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(n).add(t)}var L,I,P,R,k,N,B=T.length,F=D.length;function j(t,e,n){var i,r,a,o=t.x-e.x,s=t.y-e.y,l=n.x-t.x,c=n.y-t.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=e.x-s/p,m=e.y+o/p,g=((n.x-c/d-f)*c-(n.y+l/d-m)*l)/(o*c-s*l),v=(i=f+o*g-t.x)*i+(r=m+s*g-t.y)*r;if(v<=2)return new Re(i,r);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?(i=-s,r=o,Math.sqrt(u)):(i=o,r=s,Math.sqrt(u/2))}return new Re(i/a,r/a)}for(var V=[],z=0,G=A.length,U=G-1,H=z+1;z<G;z++,U++,H++)U===G&&(U=0),H===G&&(H=0),V[z]=j(A[z],A[U],A[H]);var W,J,q=[],X=V.concat();for(M=0,_=E.length;M<_;M++){for(w=E[M],W=[],z=0,U=(G=w.length)-1,H=z+1;z<G;z++,U++,H++)U===G&&(U=0),H===G&&(H=0),W[z]=j(w[z],w[U],w[H]);q.push(W),X=X.concat(W)}for(L=0;L<d;L++){for(P=L/d,R=u*Math.cos(P*Math.PI/2),I=h*Math.sin(P*Math.PI/2)+p,z=0,G=A.length;z<G;z++)Z((k=O(A[z],V[z],I)).x,k.y,-R);for(M=0,_=E.length;M<_;M++)for(w=E[M],W=q[M],z=0,G=w.length;z<G;z++)Z((k=O(w[z],W[z],I)).x,k.y,-R)}for(I=h+p,z=0;z<B;z++)k=c?O(T[z],X[z],I):T[z],S?(x.copy(v.normals[0]).multiplyScalar(k.x),y.copy(v.binormals[0]).multiplyScalar(k.y),b.copy(g[0]).add(x).add(y),Z(b.x,b.y,b.z)):Z(k.x,k.y,0);for(J=1;J<=s;J++)for(z=0;z<B;z++)k=c?O(T[z],X[z],I):T[z],S?(x.copy(v.normals[J]).multiplyScalar(k.x),y.copy(v.binormals[J]).multiplyScalar(k.y),b.copy(g[J]).add(x).add(y),Z(b.x,b.y,b.z)):Z(k.x,k.y,l/s*J);for(L=d-1;0<=L;L--){for(P=L/d,R=u*Math.cos(P*Math.PI/2),I=h*Math.sin(P*Math.PI/2)+p,z=0,G=A.length;z<G;z++)Z((k=O(A[z],V[z],I)).x,k.y,l+R);for(M=0,_=E.length;M<_;M++)for(w=E[M],W=q[M],z=0,G=w.length;z<G;z++)k=O(w[z],W[z],I),S?Z(k.x,k.y+g[s-1].y,g[s-1].x+R):Z(k.x,k.y,l+R)}function Y(t,e){var n,i;for(z=t.length;0<=--z;){(i=(n=z)-1)<0&&(i=t.length-1);var r=0,a=s+2*d;for(r=0;r<a;r++){var o=B*r,l=B*(r+1);K(e+n+o,e+i+o,e+i+l,e+n+l)}}}function Z(t,e,n){a.push(t),a.push(e),a.push(n)}function $(t,e,r){Q(t),Q(e),Q(r);var a=i.length/3,o=m.generateTopUV(n,i,a-3,a-2,a-1);tt(o[0]),tt(o[1]),tt(o[2])}function K(t,e,r,a){Q(t),Q(e),Q(a),Q(e),Q(r),Q(a);var o=i.length/3,s=m.generateSideWallUV(n,i,o-6,o-3,o-2,o-1);tt(s[0]),tt(s[1]),tt(s[3]),tt(s[1]),tt(s[2]),tt(s[3])}function Q(t){i.push(a[3*t+0]),i.push(a[3*t+1]),i.push(a[3*t+2])}function tt(t){r.push(t.x),r.push(t.y)}!function(){var t=i.length/3;if(c){var e=0,r=B*e;for(z=0;z<F;z++)$((N=D[z])[2]+r,N[1]+r,N[0]+r);for(r=B*(e=s+2*d),z=0;z<F;z++)$((N=D[z])[0]+r,N[1]+r,N[2]+r)}else{for(z=0;z<F;z++)$((N=D[z])[2],N[1],N[0]);for(z=0;z<F;z++)$((N=D[z])[0]+B*s,N[1]+B*s,N[2]+B*s)}n.addGroup(t,i.length/3-t,0)}(),function(){var t=i.length/3,e=0;for(Y(A,e),e+=A.length,M=0,_=E.length;M<_;M++)Y(w=E[M],e),e+=w.length;n.addGroup(t,i.length/3-t,1)}()}this.setAttribute("position",new Ti(i,3)),this.setAttribute("uv",new Ti(r,2)),this.computeVertexNormals()}((il.prototype=Object.create(lr.prototype)).constructor=il).prototype.toJSON=function(){var t=lr.prototype.toJSON.call(this);return ol(this.parameters.shapes,this.parameters.options,t)},((rl.prototype=Object.create(Bi.prototype)).constructor=rl).prototype.toJSON=function(){var t=Bi.prototype.toJSON.call(this);return ol(this.parameters.shapes,this.parameters.options,t)};var al={generateTopUV:function(t,e,n,i,r){var a=e[3*n],o=e[3*n+1],s=e[3*i],l=e[3*i+1],c=e[3*r],u=e[3*r+1];return[new Re(a,o),new Re(s,l),new Re(c,u)]},generateSideWallUV:function(t,e,n,i,r,a){var o=e[3*n],s=e[3*n+1],l=e[3*n+2],c=e[3*i],u=e[3*i+1],h=e[3*i+2],p=e[3*r],d=e[3*r+1],f=e[3*r+2],m=e[3*a],g=e[3*a+1],v=e[3*a+2];return Math.abs(s-u)<.01?[new Re(o,1-l),new Re(c,1-h),new Re(p,1-f),new Re(m,1-v)]:[new Re(s,1-l),new Re(u,1-h),new Re(d,1-f),new Re(g,1-v)]}};function ol(t,e,n){if(n.shapes=[],Array.isArray(t))for(var i=0,r=t.length;i<r;i++){var a=t[i];n.shapes.push(a.uuid)}else n.shapes.push(t.uuid);return void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON()),n}function sl(t,e){lr.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new ll(t,e)),this.mergeVertices()}function ll(t,e){var n=(e=e||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new lr;var i=n.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),rl.call(this,i,e),this.type="TextBufferGeometry"}function cl(t,e,n,i,r,a,o){lr.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new ul(t,e,n,i,r,a,o)),this.mergeVertices()}function ul(t,e,n,i,r,a,o){Bi.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},t=t||1,e=Math.max(3,Math.floor(e)||8),n=Math.max(2,Math.floor(n)||6),i=void 0!==i?i:0,r=void 0!==r?r: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 We,d=new We,f=[],m=[],g=[],v=[];for(l=0;l<=n;l++){var y=[],x=l/n,b=0;for(0==l&&0==a?b=.5/e:l==n&&c==Math.PI&&(b=-.5/e),s=0;s<=e;s++){var w=s/e;p.x=-t*Math.cos(i+w*r)*Math.sin(a+x*o),p.y=t*Math.cos(a+x*o),p.z=t*Math.sin(i+w*r)*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(w+b,1-x),y.push(u++)}h.push(y)}for(l=0;l<n;l++)for(s=0;s<e;s++){var M=h[l][s+1],_=h[l][s],S=h[l+1][s],C=h[l+1][s+1];(0!==l||0<a)&&f.push(M,_,C),(l!==n-1||c<Math.PI)&&f.push(_,S,C)}this.setIndex(f),this.setAttribute("position",new Ti(m,3)),this.setAttribute("normal",new Ti(g,3)),this.setAttribute("uv",new Ti(v,2))}function hl(t,e,n,i,r,a){lr.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:a},this.fromBufferGeometry(new pl(t,e,n,i,r,a)),this.mergeVertices()}function pl(t,e,n,i,r,a){Bi.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:a},t=t||.5,e=e||1,r=void 0!==r?r: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=t,f=(e-t)/(i=void 0!==i?Math.max(1,i):1),m=new We,g=new Re;for(s=0;s<=i;s++){for(l=0;l<=n;l++)o=r+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/e+1)/2,g.y=(m.y/e+1)/2,p.push(g.x,g.y);d+=f}for(s=0;s<i;s++){var v=s*(n+1);for(l=0;l<n;l++){var y=o=l+v,x=o+n+1,b=o+n+2,w=o+1;c.push(y,x,w),c.push(x,b,w)}}this.setIndex(c),this.setAttribute("position",new Ti(u,3)),this.setAttribute("normal",new Ti(h,3)),this.setAttribute("uv",new Ti(p,2))}function dl(t,e,n,i){lr.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},this.fromBufferGeometry(new fl(t,e,n,i)),this.mergeVertices()}function fl(t,e,n,i){Bi.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},e=Math.floor(e)||12,n=n||0,i=i||2*Math.PI,i=Pe.clamp(i,0,2*Math.PI);var r,a,o,s=[],l=[],c=[],u=1/e,h=new We,p=new Re;for(a=0;a<=e;a++){var d=n+a*u*i,f=Math.sin(d),m=Math.cos(d);for(o=0;o<=t.length-1;o++)h.x=t[o].x*f,h.y=t[o].y,h.z=t[o].x*m,l.push(h.x,h.y,h.z),p.x=a/e,p.y=o/(t.length-1),c.push(p.x,p.y)}for(a=0;a<e;a++)for(o=0;o<t.length-1;o++){var g=r=o+a*t.length,v=r+t.length,y=r+t.length+1,x=r+1;s.push(g,v,x),s.push(v,y,x)}if(this.setIndex(s),this.setAttribute("position",new Ti(l,3)),this.setAttribute("uv",new Ti(c,2)),this.computeVertexNormals(),i===2*Math.PI){var b=this.attributes.normal.array,w=new We,M=new We,_=new We;for(r=e*t.length*3,o=a=0;a<t.length;a++,o+=3)w.x=b[o+0],w.y=b[o+1],w.z=b[o+2],M.x=b[r+o+0],M.y=b[r+o+1],M.z=b[r+o+2],_.addVectors(w,M).normalize(),b[o+0]=b[r+o+0]=_.x,b[o+1]=b[r+o+1]=_.y,b[o+2]=b[r+o+2]=_.z}}function ml(t,e){lr.call(this),this.type="ShapeGeometry","object"==typeof e&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new gl(t,e)),this.mergeVertices()}function gl(t,e){Bi.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:e},e=e||12;var n=[],i=[],r=[],a=[],o=0,s=0;if(!1===Array.isArray(t))c(t);else for(var l=0;l<t.length;l++)c(t[l]),this.addGroup(o,s,l),o+=s,s=0;function c(t){var o,l,c,u=i.length/3,h=t.extractPoints(e),p=h.shape,d=h.holes;for(!1===tl.isClockWise(p)&&(p=p.reverse()),o=0,l=d.length;o<l;o++)c=d[o],!0===tl.isClockWise(c)&&(d[o]=c.reverse());var f=tl.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];i.push(m.x,m.y,0),r.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 Ti(i,3)),this.setAttribute("normal",new Ti(r,3)),this.setAttribute("uv",new Ti(a,2))}function vl(t,e){if(e.shapes=[],Array.isArray(t))for(var n=0,i=t.length;n<i;n++){var r=t[n];e.shapes.push(r.uuid)}else e.shapes.push(t.uuid);return e}function yl(t,e){Bi.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;var n,i,r,a,o=[],s=Math.cos(Pe.DEG2RAD*e),l=[0,0],c={},u=["a","b","c"];t.isBufferGeometry?(a=new lr).fromBufferGeometry(t):a=t.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]],i=m[u[(g+1)%3]],l[0]=Math.min(n,i),l[1]=Math.max(n,i),void 0===c[r=l[0]+","+l[1]]?c[r]={index1:l[0],index2:l[1],face1:d,face2:void 0}:c[r].face2=d;for(r in c){var v=c[r];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 Ti(o,3))}function xl(t,e,n,i,r,a,o,s){lr.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new bl(t,e,n,i,r,a,o,s)),this.mergeVertices()}function bl(t,e,n,i,r,a,o,s){Bi.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:s};var l=this;t=void 0!==t?t:1,e=void 0!==e?e:1,n=n||1,i=Math.floor(i)||8,r=Math.floor(r)||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 r,a,f,v=new Re,y=new We,x=0,b=!0===n?t:e,w=!0===n?1:-1;for(a=d,r=1;r<=i;r++)u.push(0,m*w,0),h.push(0,w,0),p.push(.5,.5),d++;for(f=d,r=0;r<=i;r++){var M=r/i*s+o,_=Math.cos(M),S=Math.sin(M);y.x=b*S,y.y=m*w,y.z=b*_,u.push(y.x,y.y,y.z),h.push(0,w,0),v.x=.5*_+.5,v.y=.5*S*w+.5,p.push(v.x,v.y),d++}for(r=0;r<i;r++){var C=a+r,T=f+r;!0===n?c.push(T,T+1,C):c.push(T+1,T,C),x+=3}l.addGroup(g,x,!0===n?1:2),g+=x}!function(){var a,v,y=new We,x=new We,b=0,w=(e-t)/n;for(v=0;v<=r;v++){var M=[],_=v/r,S=_*(e-t)+t;for(a=0;a<=i;a++){var C=a/i,T=C*s+o,E=Math.sin(T),D=Math.cos(T);x.x=S*E,x.y=-_*n+m,x.z=S*D,u.push(x.x,x.y,x.z),y.set(E,w,D).normalize(),h.push(y.x,y.y,y.z),p.push(C,1-_),M.push(d++)}f.push(M)}for(a=0;a<i;a++)for(v=0;v<r;v++){var A=f[v][a],O=f[v+1][a],L=f[v+1][a+1],I=f[v][a+1];c.push(A,O,I),c.push(O,L,I),b+=6}l.addGroup(g,b,0),g+=b}(),!1===a&&(0<t&&v(!0),0<e&&v(!1)),this.setIndex(c),this.setAttribute("position",new Ti(u,3)),this.setAttribute("normal",new Ti(h,3)),this.setAttribute("uv",new Ti(p,2))}function wl(t,e,n,i,r,a,o){xl.call(this,0,t,e,n,i,r,a,o),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:a,thetaLength:o}}function Ml(t,e,n,i,r,a,o){bl.call(this,0,t,e,n,i,r,a,o),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:a,thetaLength:o}}function _l(t,e,n,i){lr.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},this.fromBufferGeometry(new Sl(t,e,n,i)),this.mergeVertices()}function Sl(t,e,n,i){Bi.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},t=t||1,e=void 0!==e?Math.max(3,e):8,n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI;var r,a,o=[],s=[],l=[],c=[],u=new We,h=new Re;for(s.push(0,0,0),l.push(0,0,1),c.push(.5,.5),a=0,r=3;a<=e;a++,r+=3){var p=n+a/e*i;u.x=t*Math.cos(p),u.y=t*Math.sin(p),s.push(u.x,u.y,u.z),l.push(0,0,1),h.x=(s[r]/t+1)/2,h.y=(s[r+1]/t+1)/2,c.push(h.x,h.y)}for(r=1;r<=e;r++)o.push(r,r+1,0);this.setIndex(o),this.setAttribute("position",new Ti(s,3)),this.setAttribute("normal",new Ti(l,3)),this.setAttribute("uv",new Ti(c,2))}(sl.prototype=Object.create(lr.prototype)).constructor=sl,(ll.prototype=Object.create(rl.prototype)).constructor=ll,(cl.prototype=Object.create(lr.prototype)).constructor=cl,(ul.prototype=Object.create(Bi.prototype)).constructor=ul,(hl.prototype=Object.create(lr.prototype)).constructor=hl,(pl.prototype=Object.create(Bi.prototype)).constructor=pl,(dl.prototype=Object.create(lr.prototype)).constructor=dl,(fl.prototype=Object.create(Bi.prototype)).constructor=fl,((ml.prototype=Object.create(lr.prototype)).constructor=ml).prototype.toJSON=function(){var t=lr.prototype.toJSON.call(this);return vl(this.parameters.shapes,t)},((gl.prototype=Object.create(Bi.prototype)).constructor=gl).prototype.toJSON=function(){var t=Bi.prototype.toJSON.call(this);return vl(this.parameters.shapes,t)},(yl.prototype=Object.create(Bi.prototype)).constructor=yl,(xl.prototype=Object.create(lr.prototype)).constructor=xl,(bl.prototype=Object.create(Bi.prototype)).constructor=bl,(wl.prototype=Object.create(xl.prototype)).constructor=wl,(Ml.prototype=Object.create(bl.prototype)).constructor=Ml,(_l.prototype=Object.create(lr.prototype)).constructor=_l,(Sl.prototype=Object.create(Bi.prototype)).constructor=Sl;var Cl=Object.freeze({__proto__:null,WireframeGeometry:ms,ParametricGeometry:gs,ParametricBufferGeometry:vs,TetrahedronGeometry:bs,TetrahedronBufferGeometry:ws,OctahedronGeometry:Ms,OctahedronBufferGeometry:_s,IcosahedronGeometry:Ss,IcosahedronBufferGeometry:Cs,DodecahedronGeometry:Ts,DodecahedronBufferGeometry:Es,PolyhedronGeometry:ys,PolyhedronBufferGeometry:xs,TubeGeometry:Ds,TubeBufferGeometry:As,TorusKnotGeometry:Os,TorusKnotBufferGeometry:Ls,TorusGeometry:Is,TorusBufferGeometry:Ps,TextGeometry:sl,TextBufferGeometry:ll,SphereGeometry:cl,SphereBufferGeometry:ul,RingGeometry:hl,RingBufferGeometry:pl,PlaneGeometry:Er,PlaneBufferGeometry:Dr,LatheGeometry:dl,LatheBufferGeometry:fl,ShapeGeometry:ml,ShapeBufferGeometry:gl,ExtrudeGeometry:il,ExtrudeBufferGeometry:rl,EdgesGeometry:yl,ConeGeometry:wl,ConeBufferGeometry:Ml,CylinderGeometry:xl,CylinderBufferGeometry:bl,CircleGeometry:_l,CircleBufferGeometry:Sl,BoxGeometry:cr,BoxBufferGeometry:ur});function Tl(t){mi.call(this),this.type="ShadowMaterial",this.color=new ci(0),this.transparent=!0,this.setValues(t)}function El(t){gr.call(this,t),this.type="RawShaderMaterial"}function Dl(t){mi.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new ci(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 ci(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=_e,this.normalScale=new Re(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(t)}function Al(t){Dl.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearcoat=0,this.clearcoatRoughness=0,this.sheen=null,this.clearcoatNormalScale=new Re(1,1),this.clearcoatNormalMap=null,this.transparency=0,this.setValues(t)}function Ol(t){mi.call(this),this.type="MeshPhongMaterial",this.color=new ci(16777215),this.specular=new ci(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ci(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=_e,this.normalScale=new Re(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=G,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(t)}function Ll(t){mi.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ci(16777215),this.specular=new ci(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 ci(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=_e,this.normalScale=new Re(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(t)}function Il(t){mi.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=_e,this.normalScale=new Re(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(t)}function Pl(t){mi.call(this),this.type="MeshLambertMaterial",this.color=new ci(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ci(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=G,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(t)}function Rl(t){mi.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ci(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=_e,this.normalScale=new Re(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(t)}function kl(t){qo.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}((Tl.prototype=Object.create(mi.prototype)).constructor=Tl).prototype.isShadowMaterial=!0,Tl.prototype.copy=function(t){return mi.prototype.copy.call(this,t),this.color.copy(t.color),this},((El.prototype=Object.create(gr.prototype)).constructor=El).prototype.isRawShaderMaterial=!0,((Dl.prototype=Object.create(mi.prototype)).constructor=Dl).prototype.isMeshStandardMaterial=!0,Dl.prototype.copy=function(t){return mi.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Al.prototype=Object.create(Dl.prototype)).constructor=Al).prototype.isMeshPhysicalMaterial=!0,Al.prototype.copy=function(t){return Dl.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearcoat=t.clearcoat,this.clearcoatRoughness=t.clearcoatRoughness,t.sheen?this.sheen=(this.sheen||new ci).copy(t.sheen):this.sheen=null,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.transparency=t.transparency,this},((Ol.prototype=Object.create(mi.prototype)).constructor=Ol).prototype.isMeshPhongMaterial=!0,Ol.prototype.copy=function(t){return mi.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Ll.prototype=Object.create(mi.prototype)).constructor=Ll).prototype.isMeshToonMaterial=!0,Ll.prototype.copy=function(t){return mi.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Il.prototype=Object.create(mi.prototype)).constructor=Il).prototype.isMeshNormalMaterial=!0,Il.prototype.copy=function(t){return mi.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Pl.prototype=Object.create(mi.prototype)).constructor=Pl).prototype.isMeshLambertMaterial=!0,Pl.prototype.copy=function(t){return mi.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Rl.prototype=Object.create(mi.prototype)).constructor=Rl).prototype.isMeshMatcapMaterial=!0,Rl.prototype.copy=function(t){return mi.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((kl.prototype=Object.create(qo.prototype)).constructor=kl).prototype.isLineDashedMaterial=!0,kl.prototype.copy=function(t){return qo.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var Nl=Object.freeze({__proto__:null,ShadowMaterial:Tl,SpriteMaterial:xo,RawShaderMaterial:El,ShaderMaterial:gr,PointsMaterial:rs,MeshPhysicalMaterial:Al,MeshStandardMaterial:Dl,MeshPhongMaterial:Ol,MeshToonMaterial:Ll,MeshNormalMaterial:Il,MeshLambertMaterial:Pl,MeshDepthMaterial:to,MeshDistanceMaterial:eo,MeshBasicMaterial:gi,MeshMatcapMaterial:Rl,LineDashedMaterial:kl,LineBasicMaterial:qo,Material:mi}),Bl={arraySlice:function(t,e,n){return Bl.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)},convertArray:function(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){for(var e=t.length,n=new Array(e),i=0;i!==e;++i)n[i]=i;return n.sort(function(e,n){return t[e]-t[n]}),n},sortedArray:function(t,e,n){for(var i=t.length,r=new t.constructor(i),a=0,o=0;o!==i;++a)for(var s=n[a]*e,l=0;l!==e;++l)r[o++]=t[s+l];return r},flattenJSON:function(t,e,n,i){for(var r=1,a=t[0];void 0!==a&&void 0===a[i];)a=t[r++];if(void 0!==a){var o=a[i];if(void 0!==o)if(Array.isArray(o))for(;void 0!==(o=a[i])&&(e.push(a.time),n.push.apply(n,o)),void 0!==(a=t[r++]););else if(void 0!==o.toArray)for(;void 0!==(o=a[i])&&(e.push(a.time),o.toArray(n,n.length)),void 0!==(a=t[r++]););else for(;void 0!==(o=a[i])&&(e.push(a.time),n.push(o)),void 0!==(a=t[r++]););}},subclip:function(t,e,n,i,r){r=r||30;var a=t.clone();a.name=e;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]*r;if(!(d<n||i<=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=Bl.convertArray(u,l.times.constructor),l.values=Bl.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(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n}function jl(t,e,n,i){Fl.call(this,t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function Vl(t,e,n,i){Fl.call(this,t,e,n,i)}function zl(t,e,n,i){Fl.call(this,t,e,n,i)}function Gl(t,e,n,i){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Bl.convertArray(e,this.TimeBufferType),this.values=Bl.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}function Ul(t,e,n){Gl.call(this,t,e,n)}function Hl(t,e,n,i){Gl.call(this,t,e,n,i)}function Wl(t,e,n,i){Gl.call(this,t,e,n,i)}function Jl(t,e,n,i){Fl.call(this,t,e,n,i)}function ql(t,e,n,i){Gl.call(this,t,e,n,i)}function Xl(t,e,n,i){Gl.call(this,t,e,n,i)}function Yl(t,e,n,i){Gl.call(this,t,e,n,i)}function Zl(t,e,n){this.name=t,this.tracks=n,this.duration=void 0!==e?e:-1,this.uuid=Pe.generateUUID(),this.duration<0&&this.resetDuration()}function $l(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var e=function(t){switch(t.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 ql;case"bool":case"boolean":return Ul;case"string":return Xl}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){var n=[],i=[];Bl.flattenJSON(t.keys,n,i,"value"),t.times=n,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}Object.assign(Fl.prototype,{evaluate:function(t){var e=this.parameterPositions,n=this._cachedIndex,i=e[n],r=e[n-1];t:{e:{var a;n:{i:if(!(t<i)){for(var o=n+2;;){if(void 0===i){if(t<r)break i;return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,t,r)}if(n===o)break;if(r=i,t<(i=e[++n]))break e}a=e.length;break n}if(r<=t)break t;var s=e[1];for(t<s&&(n=2,r=s),o=n-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,i);if(n===o)break;if(i=r,(r=e[--n-1])<=t)break e}a=n,n=0}for(;n<a;){var l=n+a>>>1;t<e[l]?a=l:n=1+l}if(i=e[n],void 0===(r=e[n-1]))return this._cachedIndex=0,this.beforeStart_(0,t,i);if(void 0===i)return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,r,t)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,t,i)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=t*i,a=0;a!==i;++a)e[a]=n[r+a];return e},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(Fl.prototype,{beforeStart_:Fl.prototype.copySampleValue_,afterEnd_:Fl.prototype.copySampleValue_}),jl.prototype=Object.assign(Object.create(Fl.prototype),{constructor:jl,DefaultSettings_:{endingStart:ue,endingEnd:ue},intervalChanged_:function(t,e,n){var i=this.parameterPositions,r=t-2,a=t+1,o=i[r],s=i[a];if(void 0===o)switch(this.getSettings_().endingStart){case he:r=t,o=2*e-n;break;case pe:o=e+i[r=i.length-2]-i[r+1];break;default:r=t,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case he:a=t,s=2*n-e;break;case pe:s=n+i[a=1]-i[0];break;default:a=t-1,s=e}var l=.5*(n-e),c=this.valueSize;this._weightPrev=l/(e-o),this._weightNext=l/(s-n),this._offsetPrev=r*c,this._offsetNext=a*c},interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,l=s-o,c=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,p=this._weightNext,d=(n-e)/(i-e),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,b=0;b!==o;++b)r[b]=g*a[c+b]+v*a[l+b]+y*a[s+b]+x*a[u+b];return r}}),Vl.prototype=Object.assign(Object.create(Fl.prototype),{constructor:Vl,interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,l=s-o,c=(n-e)/(i-e),u=1-c,h=0;h!==o;++h)r[h]=a[l+h]*u+a[s+h]*c;return r}}),zl.prototype=Object.assign(Object.create(Fl.prototype),{constructor:zl,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(Gl,{toJSON:function(t){var e,n=t.constructor;if(void 0!==n.toJSON)e=n.toJSON(t);else{e={name:t.name,times:Bl.convertArray(t.times,Array),values:Bl.convertArray(t.values,Array)};var i=t.getInterpolation();i!==t.DefaultInterpolation&&(e.interpolation=i)}return e.type=t.ValueTypeName,e}}),Object.assign(Gl.prototype,{constructor:Gl,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:ce,InterpolantFactoryMethodDiscrete:function(t){return new zl(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new Vl(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new jl(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case le:e=this.InterpolantFactoryMethodDiscrete;break;case ce:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth}if(void 0!==e)return this.createInterpolant=e,this;var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===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 le;case this.InterpolantFactoryMethodLinear:return ce;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,n=0,i=e.length;n!==i;++n)e[n]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,n=0,i=e.length;n!==i;++n)e[n]*=t;return this},trim:function(t,e){for(var n=this.times,i=n.length,r=0,a=i-1;r!==i&&n[r]<t;)++r;for(;-1!==a&&n[a]>e;)--a;if(++a,0!==r||a!==i){a<=r&&(r=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=Bl.arraySlice(n,r,a),this.values=Bl.arraySlice(this.values,r*o,a*o)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var a=null,o=0;o!==r;o++){var s=n[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),t=!1;break}if(null!==a&&s<a){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),t=!1;break}a=s}if(void 0!==i&&Bl.isTypedArray(i)){o=0;for(var l=i.length;o!==l;++o){var c=i[o];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,c),t=!1;break}}}return t},optimize:function(){for(var t=Bl.arraySlice(this.times),e=Bl.arraySlice(this.values),n=this.getValueSize(),i=2302===this.getInterpolation(),r=1,a=t.length-1,o=1;o<a;++o){var s=!1,l=t[o];if(l!==t[o+1]&&(1!==o||l!==l[0]))if(i)s=!0;else for(var c=o*n,u=c-n,h=c+n,p=0;p!==n;++p){var d=e[c+p];if(d!==e[u+p]||d!==e[h+p]){s=!0;break}}if(s){if(o!==r){t[r]=t[o];var f=o*n,m=r*n;for(p=0;p!==n;++p)e[m+p]=e[f+p]}++r}}if(0<a){for(t[r]=t[a],f=a*n,m=r*n,p=0;p!==n;++p)e[m+p]=e[f+p];++r}return r!==t.length?(this.times=Bl.arraySlice(t,0,r),this.values=Bl.arraySlice(e,0,r*n)):(this.times=t,this.values=e),this},clone:function(){var t=Bl.arraySlice(this.times,0),e=Bl.arraySlice(this.values,0),n=new this.constructor(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}),Ul.prototype=Object.assign(Object.create(Gl.prototype),{constructor:Ul,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:le,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Hl.prototype=Object.assign(Object.create(Gl.prototype),{constructor:Hl,ValueTypeName:"color"}),Wl.prototype=Object.assign(Object.create(Gl.prototype),{constructor:Wl,ValueTypeName:"number"}),Jl.prototype=Object.assign(Object.create(Fl.prototype),{constructor:Jl,interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,l=(n-e)/(i-e),c=s+o;s!==c;s+=4)Ge.slerpFlat(r,0,a,s-o,a,s,l);return r}}),ql.prototype=Object.assign(Object.create(Gl.prototype),{constructor:ql,ValueTypeName:"quaternion",DefaultInterpolation:ce,InterpolantFactoryMethodLinear:function(t){return new Jl(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),Xl.prototype=Object.assign(Object.create(Gl.prototype),{constructor:Xl,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:le,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Yl.prototype=Object.assign(Object.create(Gl.prototype),{constructor:Yl,ValueTypeName:"vector"}),Object.assign(Zl,{parse:function(t){for(var e=[],n=t.tracks,i=1/(t.fps||1),r=0,a=n.length;r!==a;++r)e.push($l(n[r]).scale(i));return new Zl(t.name,t.duration,e)},toJSON:function(t){for(var e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid},r=0,a=n.length;r!==a;++r)e.push(Gl.toJSON(n[r]));return i},CreateFromMorphTargetSequence:function(t,e,n,i){for(var r=e.length,a=[],o=0;o<r;o++){var s=[],l=[];s.push((o+r-1)%r,o,(o+1)%r),l.push(0,1,0);var c=Bl.getKeyframeOrder(s);s=Bl.sortedArray(s,1,c),l=Bl.sortedArray(l,1,c),i||0!==s[0]||(s.push(r),l.push(l[0])),a.push(new Wl(".morphTargetInfluences["+e[o].name+"]",s,l).scale(1/n))}return new Zl(t,-1,a)},findByName:function(t,e){var n=t;Array.isArray(t)||(n=t.geometry&&t.geometry.animations||t.animations);for(var i=0;i<n.length;i++)if(n[i].name===e)return n[i];return null},CreateClipsFromMorphTargetSequences:function(t,e,n){for(var i={},r=/^([\w-]*?)([\d]+)$/,a=0,o=t.length;a<o;a++){var s=t[a],l=s.name.match(r);if(l&&1<l.length){var c=i[h=l[1]];c||(i[h]=c=[]),c.push(s)}}var u=[];for(var h in i)u.push(Zl.CreateFromMorphTargetSequence(h,i[h],e,n));return u},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,e,n,i,r){if(0!==n.length){var a=[],o=[];Bl.flattenJSON(n,a,o,i),0!==a.length&&r.push(new t(e,a,o))}},i=[],r=t.name||"default",a=t.length||-1,o=t.fps||30,s=t.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)}i.push(new Wl(".morphTargetInfluence["+d+"]",f,m))}a=u.length*(o||1)}else{var v=".bones["+e[l].name+"]";n(Yl,v+".position",c,"pos",i),n(ql,v+".quaternion",c,"rot",i),n(Yl,v+".scale",c,"scl",i)}}return 0===i.length?null:new Zl(r,a,i)}}),Object.assign(Zl.prototype,{resetDuration:function(){for(var t=0,e=0,n=this.tracks.length;e!==n;++e){var i=this.tracks[e];t=Math.max(t,i.times[i.times.length-1])}return this.duration=t,this},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},validate:function(){for(var t=!0,e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this},clone:function(){for(var t=[],e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new Zl(this.name,this.duration,t)}});var Kl={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function Ql(t,e,n){var i=this,r=!1,a=0,o=0,s=void 0,l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){o++,!1===r&&void 0!==i.onStart&&i.onStart(t,a,o),r=!0},this.itemEnd=function(t){a++,void 0!==i.onProgress&&i.onProgress(t,a,o),a===o&&(r=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(t){void 0!==i.onError&&i.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this},this.addHandler=function(t,e){return l.push(t,e),this},this.removeHandler=function(t){var e=l.indexOf(t);return-1!==e&&l.splice(e,2),this},this.getHandler=function(t){for(var e=0,n=l.length;e<n;e+=2){var i=l[e],r=l[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return r}return null}}var tc=new Ql;function ec(t){this.manager=void 0!==t?t:tc,this.crossOrigin="anonymous",this.path="",this.resourcePath=""}Object.assign(ec.prototype,{load:function(){},parse:function(){},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this}});var nc={};function ic(t){ec.call(this,t)}function rc(t){ec.call(this,t)}function ac(t){ec.call(this,t)}function oc(t){ec.call(this,t)}function sc(t){ec.call(this,t)}function lc(t){ec.call(this,t)}function cc(t){ec.call(this,t)}function uc(){this.type="Curve",this.arcLengthDivisions=200}function hc(t,e,n,i,r,a,o,s){uc.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=n||1,this.yRadius=i||1,this.aStartAngle=r||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function pc(t,e,n,i,r,a){hc.call(this,t,e,n,n,i,r,a),this.type="ArcCurve"}function dc(){var t=0,e=0,n=0,i=0;function r(r,a,o,s){n=-3*(t=r)+3*a-2*(e=o)-s,i=2*r-2*a+o+s}return{initCatmullRom:function(t,e,n,i,a){r(e,n,a*(n-t),a*(i-e))},initNonuniformCatmullRom:function(t,e,n,i,a,o,s){var l=(e-t)/a-(n-t)/(a+o)+(n-e)/o,c=(n-e)/o-(i-e)/(o+s)+(i-n)/s;r(e,n,l*=o,c*=o)},calc:function(r){var a=r*r;return t+e*r+n*a+i*(a*r)}}}ic.prototype=Object.assign(Object.create(ec.prototype),{constructor:ic,load:function(t,e,n,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,a=Kl.get(t);if(void 0!==a)return r.manager.itemStart(t),setTimeout(function(){e&&e(a),r.manager.itemEnd(t)},0),a;if(void 0===nc[t]){var o=t.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(){e&&e(u),r.manager.itemEnd(t)},0)}catch(e){setTimeout(function(){i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)},0)}}else{nc[t]=[],nc[t].push({onLoad:e,onProgress:n,onError:i});var m=new XMLHttpRequest;for(var g in m.open("GET",t,!0),m.addEventListener("load",function(e){var n=this.response,i=nc[t];if(delete nc[t],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Kl.add(t,n);for(var a=0,o=i.length;a<o;a++)(s=i[a]).onLoad&&s.onLoad(n);r.manager.itemEnd(t)}else{for(a=0,o=i.length;a<o;a++){var s;(s=i[a]).onError&&s.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}},!1),m.addEventListener("progress",function(e){for(var n=nc[t],i=0,r=n.length;i<r;i++){var a=n[i];a.onProgress&&a.onProgress(e)}},!1),m.addEventListener("error",function(e){var n=nc[t];delete nc[t];for(var i=0,a=n.length;i<a;i++){var o=n[i];o.onError&&o.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)},!1),m.addEventListener("abort",function(e){var n=nc[t];delete nc[t];for(var i=0,a=n.length;i<a;i++){var o=n[i];o.onError&&o.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)},!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 r.manager.itemStart(t),m}nc[t].push({onLoad:e,onProgress:n,onError:i})},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}}),rc.prototype=Object.assign(Object.create(ec.prototype),{constructor:rc,load:function(t,e,n,i){var r=this,a=new ic(r.manager);a.setPath(r.path),a.load(t,function(t){e(r.parse(JSON.parse(t)))},n,i)},parse:function(t){for(var e=[],n=0;n<t.length;n++){var i=Zl.parse(t[n]);e.push(i)}return e}}),ac.prototype=Object.assign(Object.create(ec.prototype),{constructor:ac,load:function(t,e,n,i){var r=this,a=[],o=new ps;o.image=a;var s=new ic(this.manager);function l(l){s.load(t[l],function(t){var n=r.parse(t,!0);a[l]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(c+=1)&&(1===n.mipmapCount&&(o.minFilter=ut),o.format=n.format,o.needsUpdate=!0,e&&e(o))},n,i)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(t))for(var c=0,u=0,h=t.length;u<h;++u)l(u);else s.load(t,function(t){var n=r.parse(t,!0);if(n.isCubemap)for(var i=n.mipmaps.length/n.mipmapCount,s=0;s<i;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=ut),o.format=n.format,o.needsUpdate=!0,e&&e(o)},n,i);return o}}),oc.prototype=Object.assign(Object.create(ec.prototype),{constructor:oc,load:function(t,e,n,i){var r=this,a=new wr,o=new ic(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(t,function(t){var n=r.parse(t);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:at,a.wrapT=void 0!==n.wrapT?n.wrapT:at,a.magFilter=void 0!==n.magFilter?n.magFilter:ut,a.minFilter=void 0!==n.minFilter?n.minFilter:ut,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=pt),1===n.mipmapCount&&(a.minFilter=ut),a.needsUpdate=!0,e&&e(a,n))},n,i),a}}),sc.prototype=Object.assign(Object.create(ec.prototype),{constructor:sc,load:function(t,e,n,i){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,a=Kl.get(t);if(void 0!==a)return r.manager.itemStart(t),setTimeout(function(){e&&e(a),r.manager.itemEnd(t)},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(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1),i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)}return o.addEventListener("load",s,!1),o.addEventListener("error",l,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(t),o.src=t,o}}),lc.prototype=Object.assign(Object.create(ec.prototype),{constructor:lc,load:function(t,e,n,i){var r=new Pr,a=new sc(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(n){a.load(t[n],function(t){r.images[n]=t,6==++o&&(r.needsUpdate=!0,e&&e(r))},void 0,i)}for(var l=0;l<t.length;++l)s(l);return r}}),cc.prototype=Object.assign(Object.create(ec.prototype),{constructor:cc,load:function(t,e,n,i){var r=new Fe,a=new sc(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(t,function(n){r.image=n;var i=0<t.search(/\.jpe?g($|\?)/i)||0===t.search(/^data\:image\/jpeg/);r.format=i?Tt:Et,r.needsUpdate=!0,void 0!==e&&e(r)},n,i),r}}),Object.assign(uc.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){var n=this.getUtoTmapping(t);return this.getPoint(n,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,n,i=[],r=this.getPoint(0),a=0;for(i.push(0),n=1;n<=t;n++)a+=(e=this.getPoint(n/t)).distanceTo(r),i.push(a),r=e;return this.cacheArcLengths=i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var n,i=this.getLengths(),r=0,a=i.length;n=e||t*i[a-1];for(var o,s=0,l=a-1;s<=l;)if((o=i[r=Math.floor(s+(l-s)/2)]-n)<0)s=r+1;else{if(!(0<o)){l=r;break}l=r-1}if(i[r=l]===n)return r/(a-1);var c=i[r];return(r+(n-c)/(i[r+1]-c))/(a-1)},getTangent:function(t){var e=t-1e-4,n=t+1e-4;e<0&&(e=0),1<n&&(n=1);var i=this.getPoint(e);return this.getPoint(n).clone().sub(i).normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)},computeFrenetFrames:function(t,e){var n,i,r,a=new We,o=[],s=[],l=[],c=new We,u=new Qe;for(n=0;n<=t;n++)i=n/t,o[n]=this.getTangentAt(i),o[n].normalize();s[0]=new We,l[0]=new We;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<=t;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(),r=Math.acos(Pe.clamp(o[n-1].dot(o[n]),-1,1)),s[n].applyMatrix4(u.makeRotationAxis(c,r))),l[n].crossVectors(o[n],s[n]);if(!0===e)for(r=Math.acos(Pe.clamp(s[0].dot(s[t]),-1,1)),r/=t,0<o[0].dot(c.crossVectors(s[0],s[t]))&&(r=-r),n=1;n<=t;n++)s[n].applyMatrix4(u.makeRotationAxis(o[n],r*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(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),((hc.prototype=Object.create(uc.prototype)).constructor=hc).prototype.isEllipseCurve=!0,hc.prototype.getPoint=function(t,e){for(var n=e||new Re,i=2*Math.PI,r=this.aEndAngle-this.aStartAngle,a=Math.abs(r)<Number.EPSILON;r<0;)r+=i;for(;i<r;)r-=i;r<Number.EPSILON&&(r=a?0:i),!0!==this.aClockwise||a||(r===i?r=-i:r-=i);var o=this.aStartAngle+t*r,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(t){return uc.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},hc.prototype.toJSON=function(){var t=uc.prototype.toJSON.call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t},hc.prototype.fromJSON=function(t){return uc.prototype.fromJSON.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},((pc.prototype=Object.create(hc.prototype)).constructor=pc).prototype.isArcCurve=!0;var fc=new We,mc=new dc,gc=new dc,vc=new dc;function yc(t,e,n,i){uc.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||!1,this.curveType=n||"centripetal",this.tension=i||.5}function xc(t,e,n,i,r){var a=.5*(i-e),o=.5*(r-n),s=t*t;return(2*n-2*i+a+o)*(t*s)+(-3*n+3*i-2*a-o)*s+a*t+n}function bc(t,e,n,i){return(o=1-t)*o*e+2*(1-(a=t))*a*n+(r=t)*r*i;var r,a,o}function wc(t,e,n,i,r){return(c=1-t)*c*c*e+3*(l=1-(s=t))*l*s*n+3*(1-(o=t))*o*o*i+(a=t)*a*a*r;var a,o,s,l,c}function Mc(t,e,n,i){uc.call(this),this.type="CubicBezierCurve",this.v0=t||new Re,this.v1=e||new Re,this.v2=n||new Re,this.v3=i||new Re}function _c(t,e,n,i){uc.call(this),this.type="CubicBezierCurve3",this.v0=t||new We,this.v1=e||new We,this.v2=n||new We,this.v3=i||new We}function Sc(t,e){uc.call(this),this.type="LineCurve",this.v1=t||new Re,this.v2=e||new Re}function Cc(t,e){uc.call(this),this.type="LineCurve3",this.v1=t||new We,this.v2=e||new We}function Tc(t,e,n){uc.call(this),this.type="QuadraticBezierCurve",this.v0=t||new Re,this.v1=e||new Re,this.v2=n||new Re}function Ec(t,e,n){uc.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new We,this.v1=e||new We,this.v2=n||new We}function Dc(t){uc.call(this),this.type="SplineCurve",this.points=t||[]}((yc.prototype=Object.create(uc.prototype)).constructor=yc).prototype.isCatmullRomCurve3=!0,yc.prototype.getPoint=function(t,e){var n,i,r,a,o=e||new We,s=this.points,l=s.length,c=(l-(this.closed?0:1))*t,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),i=s[u%l],r=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(i),p),f=Math.pow(i.distanceToSquared(r),p),m=Math.pow(r.distanceToSquared(a),p);f<1e-4&&(f=1),d<1e-4&&(d=f),m<1e-4&&(m=f),mc.initNonuniformCatmullRom(n.x,i.x,r.x,a.x,d,f,m),gc.initNonuniformCatmullRom(n.y,i.y,r.y,a.y,d,f,m),vc.initNonuniformCatmullRom(n.z,i.z,r.z,a.z,d,f,m)}else"catmullrom"===this.curveType&&(mc.initCatmullRom(n.x,i.x,r.x,a.x,this.tension),gc.initCatmullRom(n.y,i.y,r.y,a.y,this.tension),vc.initCatmullRom(n.z,i.z,r.z,a.z,this.tension));return o.set(mc.calc(h),gc.calc(h),vc.calc(h)),o},yc.prototype.copy=function(t){uc.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},yc.prototype.toJSON=function(){var t=uc.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var i=this.points[e];t.points.push(i.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},yc.prototype.fromJSON=function(t){uc.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push((new We).fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},((Mc.prototype=Object.create(uc.prototype)).constructor=Mc).prototype.isCubicBezierCurve=!0,Mc.prototype.getPoint=function(t,e){var n=e||new Re,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(wc(t,i.x,r.x,a.x,o.x),wc(t,i.y,r.y,a.y,o.y)),n},Mc.prototype.copy=function(t){return uc.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},Mc.prototype.toJSON=function(){var t=uc.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Mc.prototype.fromJSON=function(t){return uc.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},((_c.prototype=Object.create(uc.prototype)).constructor=_c).prototype.isCubicBezierCurve3=!0,_c.prototype.getPoint=function(t,e){var n=e||new We,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(wc(t,i.x,r.x,a.x,o.x),wc(t,i.y,r.y,a.y,o.y),wc(t,i.z,r.z,a.z,o.z)),n},_c.prototype.copy=function(t){return uc.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},_c.prototype.toJSON=function(){var t=uc.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},_c.prototype.fromJSON=function(t){return uc.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},((Sc.prototype=Object.create(uc.prototype)).constructor=Sc).prototype.isLineCurve=!0,Sc.prototype.getPoint=function(t,e){var n=e||new Re;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Sc.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Sc.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},Sc.prototype.copy=function(t){return uc.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Sc.prototype.toJSON=function(){var t=uc.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Sc.prototype.fromJSON=function(t){return uc.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((Cc.prototype=Object.create(uc.prototype)).constructor=Cc).prototype.isLineCurve3=!0,Cc.prototype.getPoint=function(t,e){var n=e||new We;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Cc.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Cc.prototype.copy=function(t){return uc.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Cc.prototype.toJSON=function(){var t=uc.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Cc.prototype.fromJSON=function(t){return uc.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((Tc.prototype=Object.create(uc.prototype)).constructor=Tc).prototype.isQuadraticBezierCurve=!0,Tc.prototype.getPoint=function(t,e){var n=e||new Re,i=this.v0,r=this.v1,a=this.v2;return n.set(bc(t,i.x,r.x,a.x),bc(t,i.y,r.y,a.y)),n},Tc.prototype.copy=function(t){return uc.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Tc.prototype.toJSON=function(){var t=uc.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Tc.prototype.fromJSON=function(t){return uc.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((Ec.prototype=Object.create(uc.prototype)).constructor=Ec).prototype.isQuadraticBezierCurve3=!0,Ec.prototype.getPoint=function(t,e){var n=e||new We,i=this.v0,r=this.v1,a=this.v2;return n.set(bc(t,i.x,r.x,a.x),bc(t,i.y,r.y,a.y),bc(t,i.z,r.z,a.z)),n},Ec.prototype.copy=function(t){return uc.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Ec.prototype.toJSON=function(){var t=uc.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Ec.prototype.fromJSON=function(t){return uc.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((Dc.prototype=Object.create(uc.prototype)).constructor=Dc).prototype.isSplineCurve=!0,Dc.prototype.getPoint=function(t,e){var n=e||new Re,i=this.points,r=(i.length-1)*t,a=Math.floor(r),o=r-a,s=i[0===a?a:a-1],l=i[a],c=i[a>i.length-2?i.length-1:a+1],u=i[a>i.length-3?i.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},Dc.prototype.copy=function(t){uc.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push(i.clone())}return this},Dc.prototype.toJSON=function(){var t=uc.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var i=this.points[e];t.points.push(i.toArray())}return t},Dc.prototype.fromJSON=function(t){uc.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push((new Re).fromArray(i))}return this};var Ac=Object.freeze({__proto__:null,ArcCurve:pc,CatmullRomCurve3:yc,CubicBezierCurve:Mc,CubicBezierCurve3:_c,EllipseCurve:hc,LineCurve:Sc,LineCurve3:Cc,QuadraticBezierCurve:Tc,QuadraticBezierCurve3:Ec,SplineCurve:Dc});function Oc(){uc.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Lc(t){Oc.call(this),this.type="Path",this.currentPoint=new Re,t&&this.setFromPoints(t)}function Ic(t){Lc.call(this,t),this.uuid=Pe.generateUUID(),this.type="Shape",this.holes=[]}function Pc(t,e){yn.call(this),this.type="Light",this.color=new ci(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function Rc(t,e,n){Pc.call(this,t,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(yn.DefaultUp),this.updateMatrix(),this.groundColor=new ci(e)}function kc(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new Re(512,512),this.map=null,this.mapPass=null,this.matrix=new Qe,this._frustum=new Sr,this._frameExtents=new Re(1,1),this._viewportCount=1,this._viewports=[new je(0,0,1,1)]}function Nc(){kc.call(this,new yr(50,1,.5,500))}function Bc(t,e,n,i,r,a){Pc.call(this,t,e),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(t){this.intensity=t/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==i?i:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==a?a:1,this.shadow=new Nc}function Fc(){kc.call(this,new yr(90,1,.5,500)),this._frameExtents=new Re(4,2),this._viewportCount=6,this._viewports=[new je(2,1,1,1),new je(0,1,1,1),new je(3,1,1,1),new je(1,1,1,1),new je(3,0,1,1),new je(1,0,1,1)],this._cubeDirections=[new We(1,0,0),new We(-1,0,0),new We(0,0,1),new We(0,0,-1),new We(0,1,0),new We(0,-1,0)],this._cubeUps=[new We(0,1,0),new We(0,1,0),new We(0,1,0),new We(0,1,0),new We(0,0,1),new We(0,0,-1)]}function jc(t,e,n,i){Pc.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==i?i:1,this.shadow=new Fc}function Vc(t,e,n,i,r,a){vr.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==t?t:-1,this.right=void 0!==e?e:1,this.top=void 0!==n?n:1,this.bottom=void 0!==i?i:-1,this.near=void 0!==r?r:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function zc(){kc.call(this,new Vc(-5,5,5,-5,.5,500))}function Gc(t,e){Pc.call(this,t,e),this.type="DirectionalLight",this.position.copy(yn.DefaultUp),this.updateMatrix(),this.target=new yn,this.shadow=new zc}function Uc(t,e){Pc.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function Hc(t,e,n,i){Pc.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==i?i:10}function Wc(t){ec.call(this,t),this.textures={}}Oc.prototype=Object.assign(Object.create(uc.prototype),{constructor:Oc,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new Sc(e,t))},getPoint:function(t){for(var e=t*this.getLength(),n=this.getCurveLengths(),i=0;i<n.length;){if(n[i]>=e){var r=n[i]-e,a=this.curves[i],o=a.getLength(),s=0===o?0:1-r/o;return a.getPointAt(s)}i++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.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 t=[],e=0,n=0,i=this.curves.length;n<i;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t){t=t||12;for(var e,n=[],i=0,r=this.curves;i<r.length;i++)for(var a=r[i],o=a&&a.isEllipseCurve?2*t:a&&(a.isLineCurve||a.isLineCurve3)?1:a&&a.isSplineCurve?t*a.points.length:t,s=a.getPoints(o),l=0;l<s.length;l++){var c=s[l];e&&e.equals(c)||(n.push(c),e=c)}return this.autoClose&&1<n.length&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(t){uc.prototype.copy.call(this,t),this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var i=t.curves[e];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){var t=uc.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(var e=0,n=this.curves.length;e<n;e++){var i=this.curves[e];t.curves.push(i.toJSON())}return t},fromJSON:function(t){uc.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var i=t.curves[e];this.curves.push((new Ac[i.type]).fromJSON(i))}return this}}),Lc.prototype=Object.assign(Object.create(Oc.prototype),{constructor:Lc,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this},moveTo:function(t,e){return this.currentPoint.set(t,e),this},lineTo:function(t,e){var n=new Sc(this.currentPoint.clone(),new Re(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this},quadraticCurveTo:function(t,e,n,i){var r=new Tc(this.currentPoint.clone(),new Re(t,e),new Re(n,i));return this.curves.push(r),this.currentPoint.set(n,i),this},bezierCurveTo:function(t,e,n,i,r,a){var o=new Mc(this.currentPoint.clone(),new Re(t,e),new Re(n,i),new Re(r,a));return this.curves.push(o),this.currentPoint.set(r,a),this},splineThru:function(t){var e=new Dc([this.currentPoint.clone()].concat(t));return this.curves.push(e),this.currentPoint.copy(t[t.length-1]),this},arc:function(t,e,n,i,r,a){var o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(t+o,e+s,n,i,r,a),this},absarc:function(t,e,n,i,r,a){return this.absellipse(t,e,n,n,i,r,a),this},ellipse:function(t,e,n,i,r,a,o,s){var l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(t+l,e+c,n,i,r,a,o,s),this},absellipse:function(t,e,n,i,r,a,o,s){var l=new hc(t,e,n,i,r,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(t){return Oc.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=Oc.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return Oc.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),Ic.prototype=Object.assign(Object.create(Lc.prototype),{constructor:Ic,getPointsHoles:function(t){for(var e=[],n=0,i=this.holes.length;n<i;n++)e[n]=this.holes[n].getPoints(t);return e},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){Lc.prototype.copy.call(this,t),this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var i=t.holes[e];this.holes.push(i.clone())}return this},toJSON:function(){var t=Lc.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(var e=0,n=this.holes.length;e<n;e++){var i=this.holes[e];t.holes.push(i.toJSON())}return t},fromJSON:function(t){Lc.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var i=t.holes[e];this.holes.push((new Lc).fromJSON(i))}return this}}),Pc.prototype=Object.assign(Object.create(yn.prototype),{constructor:Pc,isLight:!0,copy:function(t){return yn.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=yn.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),Rc.prototype=Object.assign(Object.create(Pc.prototype),{constructor:Rc,isHemisphereLight:!0,copy:function(t){return Pc.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(kc.prototype,{_projScreenMatrix:new Qe,_lightPositionWorld:new We,_lookTarget:new We,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(t){var e=this.camera,n=this.matrix,i=this._projScreenMatrix,r=this._lookTarget,a=this._lightPositionWorld;a.setFromMatrixPosition(t.matrixWorld),e.position.copy(a),r.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(r),e.updateMatrixWorld(),i.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(i),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(e.projectionMatrix),n.multiply(e.matrixWorldInverse)},getViewport:function(t){return this._viewports[t]},getFrameExtents:function(){return this._frameExtents},copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),Nc.prototype=Object.assign(Object.create(kc.prototype),{constructor:Nc,isSpotLightShadow:!0,updateMatrices:function(t){var e=this.camera,n=2*Pe.RAD2DEG*t.angle,i=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;n===e.fov&&i===e.aspect&&r===e.far||(e.fov=n,e.aspect=i,e.far=r,e.updateProjectionMatrix()),kc.prototype.updateMatrices.call(this,t)}}),Bc.prototype=Object.assign(Object.create(Pc.prototype),{constructor:Bc,isSpotLight:!0,copy:function(t){return Pc.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Fc.prototype=Object.assign(Object.create(kc.prototype),{constructor:Fc,isPointLightShadow:!0,updateMatrices:function(t,e){void 0===e&&(e=0);var n=this.camera,i=this.matrix,r=this._lightPositionWorld,a=this._lookTarget,o=this._projScreenMatrix;r.setFromMatrixPosition(t.matrixWorld),n.position.copy(r),a.copy(n.position),a.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(a),n.updateMatrixWorld(),i.makeTranslation(-r.x,-r.y,-r.z),o.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(o)}}),jc.prototype=Object.assign(Object.create(Pc.prototype),{constructor:jc,isPointLight:!0,copy:function(t){return Pc.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),Vc.prototype=Object.assign(Object.create(vr.prototype),{constructor:Vc,isOrthographicCamera:!0,copy:function(t,e){return vr.prototype.copy.call(this,t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,n,i,r,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=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,r=n-t,a=n+t,o=i+e,s=i-e;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=(r+=l*this.view.offsetX)+l*this.view.width,s=(o-=c*this.view.offsetY)-c*this.view.height}this.projectionMatrix.makeOrthographic(r,a,o,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=yn.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),zc.prototype=Object.assign(Object.create(kc.prototype),{constructor:zc,isDirectionalLightShadow:!0,updateMatrices:function(t){kc.prototype.updateMatrices.call(this,t)}}),Gc.prototype=Object.assign(Object.create(Pc.prototype),{constructor:Gc,isDirectionalLight:!0,copy:function(t){return Pc.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Uc.prototype=Object.assign(Object.create(Pc.prototype),{constructor:Uc,isAmbientLight:!0}),Hc.prototype=Object.assign(Object.create(Pc.prototype),{constructor:Hc,isRectAreaLight:!0,copy:function(t){return Pc.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){var e=Pc.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}}),Wc.prototype=Object.assign(Object.create(ec.prototype),{constructor:Wc,load:function(t,e,n,i){var r=this,a=new ic(r.manager);a.setPath(r.path),a.load(t,function(t){e(r.parse(JSON.parse(t)))},n,i)},parse:function(t){var e=this.textures;function n(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}var i=new Nl[t.type];if(void 0!==t.uuid&&(i.uuid=t.uuid),void 0!==t.name&&(i.name=t.name),void 0!==t.color&&i.color.setHex(t.color),void 0!==t.roughness&&(i.roughness=t.roughness),void 0!==t.metalness&&(i.metalness=t.metalness),void 0!==t.sheen&&(i.sheen=(new ci).setHex(t.sheen)),void 0!==t.emissive&&i.emissive.setHex(t.emissive),void 0!==t.specular&&i.specular.setHex(t.specular),void 0!==t.shininess&&(i.shininess=t.shininess),void 0!==t.clearcoat&&(i.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(i.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.vertexColors&&(i.vertexColors=t.vertexColors),void 0!==t.fog&&(i.fog=t.fog),void 0!==t.flatShading&&(i.flatShading=t.flatShading),void 0!==t.blending&&(i.blending=t.blending),void 0!==t.combine&&(i.combine=t.combine),void 0!==t.side&&(i.side=t.side),void 0!==t.opacity&&(i.opacity=t.opacity),void 0!==t.transparent&&(i.transparent=t.transparent),void 0!==t.alphaTest&&(i.alphaTest=t.alphaTest),void 0!==t.depthTest&&(i.depthTest=t.depthTest),void 0!==t.depthWrite&&(i.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(i.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(i.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(i.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(i.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(i.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(i.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(i.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(i.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(i.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(i.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(i.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(i.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(i.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(i.rotation=t.rotation),1!==t.linewidth&&(i.linewidth=t.linewidth),void 0!==t.dashSize&&(i.dashSize=t.dashSize),void 0!==t.gapSize&&(i.gapSize=t.gapSize),void 0!==t.scale&&(i.scale=t.scale),void 0!==t.polygonOffset&&(i.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(i.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(i.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(i.skinning=t.skinning),void 0!==t.morphTargets&&(i.morphTargets=t.morphTargets),void 0!==t.morphNormals&&(i.morphNormals=t.morphNormals),void 0!==t.dithering&&(i.dithering=t.dithering),void 0!==t.visible&&(i.visible=t.visible),void 0!==t.toneMapped&&(i.toneMapped=t.toneMapped),void 0!==t.userData&&(i.userData=t.userData),void 0!==t.uniforms)for(var r in t.uniforms){var a=t.uniforms[r];switch(i.uniforms[r]={},a.type){case"t":i.uniforms[r].value=n(a.value);break;case"c":i.uniforms[r].value=(new ci).setHex(a.value);break;case"v2":i.uniforms[r].value=(new Re).fromArray(a.value);break;case"v3":i.uniforms[r].value=(new We).fromArray(a.value);break;case"v4":i.uniforms[r].value=(new je).fromArray(a.value);break;case"m3":i.uniforms[r].value=(new ke).fromArray(a.value);case"m4":i.uniforms[r].value=(new Qe).fromArray(a.value);break;default:i.uniforms[r].value=a.value}}if(void 0!==t.defines&&(i.defines=t.defines),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(var o in t.extensions)i.extensions[o]=t.extensions[o];if(void 0!==t.shading&&(i.flatShading=1===t.shading),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=n(t.map)),void 0!==t.matcap&&(i.matcap=n(t.matcap)),void 0!==t.alphaMap&&(i.alphaMap=n(t.alphaMap),i.transparent=!0),void 0!==t.bumpMap&&(i.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(i.normalMapType=t.normalMapType),void 0!==t.normalScale){var s=t.normalScale;!1===Array.isArray(s)&&(s=[s,s]),i.normalScale=(new Re).fromArray(s)}return void 0!==t.displacementMap&&(i.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=n(t.specularMap)),void 0!==t.envMap&&(i.envMap=n(t.envMap)),void 0!==t.envMapIntensity&&(i.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(i.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(i.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=n(t.gradientMap)),void 0!==t.clearcoatNormalMap&&(i.clearcoatNormalMap=n(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(i.clearcoatNormalScale=(new Re).fromArray(t.clearcoatNormalScale)),i},setTextures:function(t){return this.textures=t,this}});var Jc={decodeText:function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var e="",n=0,i=t.length;n<i;n++)e+=String.fromCharCode(t[n]);try{return decodeURIComponent(escape(e))}catch(t){return e}},extractUrlBase:function(t){var e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)}};function qc(){Bi.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function Xc(t,e,n,i){"number"==typeof n&&(i=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),yi.call(this,t,e,n),this.meshPerAttribute=i||1}function Yc(t){ec.call(this,t)}qc.prototype=Object.assign(Object.create(Bi.prototype),{constructor:qc,isInstancedBufferGeometry:!0,copy:function(t){return Bi.prototype.copy.call(this,t),this.maxInstancedCount=t.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t=Bi.prototype.toJSON.call(this);return t.maxInstancedCount=this.maxInstancedCount,t.isInstancedBufferGeometry=!0,t}}),Xc.prototype=Object.assign(Object.create(yi.prototype),{constructor:Xc,isInstancedBufferAttribute:!0,copy:function(t){return yi.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},toJSON:function(){var t=yi.prototype.toJSON.call(this);return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}),Yc.prototype=Object.assign(Object.create(ec.prototype),{constructor:Yc,load:function(t,e,n,i){var r=this,a=new ic(r.manager);a.setPath(r.path),a.load(t,function(t){e(r.parse(JSON.parse(t)))},n,i)},parse:function(t){var e=new(t.isInstancedBufferGeometry?qc:Bi),n=t.data.index;if(void 0!==n){var i=new Zc[n.type](n.array);e.setIndex(new yi(i,1))}var r=t.data.attributes;for(var a in r){var o=r[a],s=(i=new Zc[o.type](o.array),new(o.isInstancedBufferAttribute?Xc:yi)(i,o.itemSize,o.normalized));void 0!==o.name&&(s.name=o.name),e.setAttribute(a,s)}var l=t.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 yi(i=new Zc[o.type](o.array),o.itemSize,o.normalized),void 0!==o.name&&(s.name=o.name),u.push(s);e.morphAttributes[a]=u}t.data.morphTargetsRelative&&(e.morphTargetsRelative=!0);var d=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==d){h=0;for(var f=d.length;h!==f;++h){var m=d[h];e.addGroup(m.start,m.count,m.materialIndex)}}var g=t.data.boundingSphere;if(void 0!==g){var v=new We;void 0!==g.center&&v.fromArray(g.center),e.boundingSphere=new Nn(v,g.radius)}return t.name&&(e.name=t.name),t.userData&&(e.userData=t.userData),e}});var Zc={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function $c(t){ec.call(this,t)}$c.prototype=Object.assign(Object.create(ec.prototype),{constructor:$c,load:function(t,e,n,i){var r=this,a=""===this.path?Jc.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||a;var o=new ic(r.manager);o.setPath(this.path),o.load(t,function(n){var a=null;try{a=JSON.parse(n)}catch(n){return void 0!==i&&i(n),void console.error("THREE:ObjectLoader: Can't parse "+t+".",n.message)}var o=a.metadata;void 0!==o&&void 0!==o.type&&"geometry"!==o.type.toLowerCase()?r.parse(a,e):console.error("THREE.ObjectLoader: Can't load "+t)},n,i)},parse:function(t,e){var n=this.parseShape(t.shapes),i=this.parseGeometries(t.geometries,n),r=this.parseImages(t.images,function(){void 0!==e&&e(s)}),a=this.parseTextures(t.textures,r),o=this.parseMaterials(t.materials,a),s=this.parseObject(t.object,i,o);return t.animations&&(s.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(s),s},parseShape:function(t){var e={};if(void 0!==t)for(var n=0,i=t.length;n<i;n++){var r=(new Ic).fromJSON(t[n]);e[r.uuid]=r}return e},parseGeometries:function(t,e){var n={};if(void 0!==t)for(var i=new Yc,r=0,a=t.length;r<a;r++){var o,s=t[r];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new Cl[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new Cl[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new Cl[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new Cl[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 Cl[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new Cl[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 Cl[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new Cl[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new Cl[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new Cl[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":o=new Cl[s.type]((new Ac[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":o=new Cl[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new Cl[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=e[s.shapes[c]];l.push(h)}o=new Cl[s.type](l,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(l=[],c=0,u=s.shapes.length;c<u;c++)h=e[s.shapes[c]],l.push(h);var p=s.options.extrudePath;void 0!==p&&(s.options.extrudePath=(new Ac[p.type]).fromJSON(p)),o=new Cl[s.type](l,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":o=i.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(t,e){var n={},i={};if(void 0!==t){var r=new Wc;r.setTextures(e);for(var a=0,o=t.length;a<o;a++){var s=t[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]=r.parse(u)),l.push(n[u.uuid])}i[s.uuid]=l}else void 0===n[s.uuid]&&(n[s.uuid]=r.parse(s)),i[s.uuid]=n[s.uuid]}}return i},parseAnimations:function(t){for(var e=[],n=0;n<t.length;n++){var i=t[n],r=Zl.parse(i);void 0!==i.uuid&&(r.uuid=i.uuid),e.push(r)}return e},parseImages:function(t,e){var n=this,i={};function r(t){return n.manager.itemStart(t),a.load(t,function(){n.manager.itemEnd(t)},void 0,function(){n.manager.itemError(t),n.manager.itemEnd(t)})}if(void 0!==t&&0<t.length){var a=new sc(new Ql(e));a.setCrossOrigin(this.crossOrigin);for(var o=0,s=t.length;o<s;o++){var l=t[o],c=l.url;if(Array.isArray(c)){i[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;i[l.uuid].push(r(d))}}else d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l.url)?l.url:n.resourcePath+l.url,i[l.uuid]=r(d)}}return i},parseTextures:function(t,e){function n(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}var i={};if(void 0!==t)for(var r=0,a=t.length;r<a;r++){var o,s=t[r];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===e[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image),(o=new(Array.isArray(e[s.image])?Pr:Fe)(e[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],tu),o.wrapT=n(s.wrap[1],tu)),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,eu)),void 0!==s.magFilter&&(o.magFilter=n(s.magFilter,eu)),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),i[s.uuid]=o}return i},parseObject:function(t,e,n){var i;function r(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function a(t){if(void 0!==t){if(Array.isArray(t)){for(var e=[],i=0,r=t.length;i<r;i++){var a=t[i];void 0===n[a]&&console.warn("THREE.ObjectLoader: Undefined material",a),e.push(n[a])}return e}return void 0===n[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),n[t]}}switch(t.type){case"Scene":i=new xn,void 0!==t.background&&Number.isInteger(t.background)&&(i.background=new ci(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?i.fog=new fo(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(i.fog=new po(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":i=new yr(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(i.focus=t.focus),void 0!==t.zoom&&(i.zoom=t.zoom),void 0!==t.filmGauge&&(i.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(i.filmOffset=t.filmOffset),void 0!==t.view&&(i.view=Object.assign({},t.view));break;case"OrthographicCamera":i=new Vc(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(i.zoom=t.zoom),void 0!==t.view&&(i.view=Object.assign({},t.view));break;case"AmbientLight":i=new Uc(t.color,t.intensity);break;case"DirectionalLight":i=new Gc(t.color,t.intensity);break;case"PointLight":i=new jc(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":i=new Hc(t.color,t.intensity,t.width,t.height);break;case"SpotLight":i=new Bc(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":i=new Rc(t.color,t.groundColor,t.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var o=r(t.geometry),s=a(t.material);i=new(o.bones&&0<o.bones.length?Bo:er)(o,s);break;case"InstancedMesh":o=r(t.geometry),s=a(t.material);var l=t.count,c=t.instanceMatrix;(i=new Jo(o,s,l)).instanceMatrix=new yi(new Float32Array(c.array),16);break;case"LOD":i=new No;break;case"Line":i=new Qo(r(t.geometry),a(t.material),t.mode);break;case"LineLoop":i=new is(r(t.geometry),a(t.material));break;case"LineSegments":i=new ns(r(t.geometry),a(t.material));break;case"PointCloud":case"Points":i=new cs(r(t.geometry),a(t.material));break;case"Sprite":i=new Io(a(t.material));break;case"Group":i=new co;break;default:i=new yn}if(i.uuid=t.uuid,void 0!==t.name&&(i.name=t.name),void 0!==t.matrix?(i.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(i.matrixAutoUpdate=t.matrixAutoUpdate),i.matrixAutoUpdate&&i.matrix.decompose(i.position,i.quaternion,i.scale)):(void 0!==t.position&&i.position.fromArray(t.position),void 0!==t.rotation&&i.rotation.fromArray(t.rotation),void 0!==t.quaternion&&i.quaternion.fromArray(t.quaternion),void 0!==t.scale&&i.scale.fromArray(t.scale)),void 0!==t.castShadow&&(i.castShadow=t.castShadow),void 0!==t.receiveShadow&&(i.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(i.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(i.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&i.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(i.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(i.visible=t.visible),void 0!==t.frustumCulled&&(i.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(i.renderOrder=t.renderOrder),void 0!==t.userData&&(i.userData=t.userData),void 0!==t.layers&&(i.layers.mask=t.layers),void 0!==t.children)for(var u=t.children,h=0;h<u.length;h++)i.add(this.parseObject(u[h],e,n));if("LOD"===t.type){void 0!==t.autoUpdate&&(i.autoUpdate=t.autoUpdate);for(var p=t.levels,d=0;d<p.length;d++){var f=p[d],m=i.getObjectByProperty("uuid",f.object);void 0!==m&&i.addLevel(m,f.distance)}}return i}});var Kc,Qc={UVMapping:300,CubeReflectionMapping:$,CubeRefractionMapping:K,EquirectangularReflectionMapping:Q,EquirectangularRefractionMapping:tt,SphericalReflectionMapping:et,CubeUVReflectionMapping:nt,CubeUVRefractionMapping:it},tu={RepeatWrapping:rt,ClampToEdgeWrapping:at,MirroredRepeatWrapping:ot},eu={NearestFilter:st,NearestMipmapNearestFilter:lt,NearestMipmapLinearFilter:ct,LinearFilter:ut,LinearMipmapNearestFilter:ht,LinearMipmapLinearFilter:pt};function nu(t){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),ec.call(this,t),this.options=void 0}function iu(){this.type="ShapePath",this.color=new ci,this.subPaths=[],this.currentPath=null}function ru(t){this.type="Font",this.data=t}function au(t,e,n,i,r){var a=r.glyphs[t]||r.glyphs["?"];if(a){var o,s,l,c,u,h,p,d,f=new iu;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++]*e+n,s=m[g++]*e+i,f.moveTo(o,s);break;case"l":o=m[g++]*e+n,s=m[g++]*e+i,f.lineTo(o,s);break;case"q":l=m[g++]*e+n,c=m[g++]*e+i,u=m[g++]*e+n,h=m[g++]*e+i,f.quadraticCurveTo(u,h,l,c);break;case"b":l=m[g++]*e+n,c=m[g++]*e+i,u=m[g++]*e+n,h=m[g++]*e+i,p=m[g++]*e+n,d=m[g++]*e+i,f.bezierCurveTo(u,h,p,d,l,c)}return{offsetX:a.ha*e,path:f}}console.error('THREE.Font: character "'+t+'" does not exists in font family '+r.familyName+".")}function ou(t){ec.call(this,t)}nu.prototype=Object.assign(Object.create(ec.prototype),{constructor:nu,setOptions:function(t){return this.options=t,this},load:function(t,e,n,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,a=Kl.get(t);if(void 0!==a)return r.manager.itemStart(t),setTimeout(function(){e&&e(a),r.manager.itemEnd(t)},0),a;fetch(t).then(function(t){return t.blob()}).then(function(t){return void 0===r.options?createImageBitmap(t):createImageBitmap(t,r.options)}).then(function(n){Kl.add(t,n),e&&e(n),r.manager.itemEnd(t)}).catch(function(e){i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)}),r.manager.itemStart(t)}}),Object.assign(iu.prototype,{moveTo:function(t,e){return this.currentPath=new Lc,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this},lineTo:function(t,e){return this.currentPath.lineTo(t,e),this},quadraticCurveTo:function(t,e,n,i){return this.currentPath.quadraticCurveTo(t,e,n,i),this},bezierCurveTo:function(t,e,n,i,r,a){return this.currentPath.bezierCurveTo(t,e,n,i,r,a),this},splineThru:function(t){return this.currentPath.splineThru(t),this},toShapes:function(t,e){function n(t){for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n],a=new Ic;a.curves=r.curves,e.push(a)}return e}function i(t,e){for(var n=e.length,i=!1,r=n-1,a=0;a<n;r=a++){var o=e[r],s=e[a],l=s.x-o.x,c=s.y-o.y;if(Math.abs(c)>Number.EPSILON){if(c<0&&(o=e[a],l=-l,s=e[r],c=-c),t.y<o.y||t.y>s.y)continue;if(t.y===o.y){if(t.x===o.x)return 1}else{var u=c*(t.x-o.x)-l*(t.y-o.y);if(0==u)return 1;if(u<0)continue;i=!i}}else{if(t.y!==o.y)continue;if(s.x<=t.x&&t.x<=o.x||o.x<=t.x&&t.x<=s.x)return 1}}return i}var r=tl.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===e)return n(a);var o,s,l,c=[];if(1===a.length)return s=a[0],(l=new Ic).curves=s.curves,c.push(l),c;var u=!r(a[0].getPoints());u=t?!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=r(h=(s=a[v]).getPoints()),(o=t?!o:o)?(!u&&f[g]&&g++,f[g]={s:new Ic,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=[],w=0,M=f.length;w<M;w++)d[w]=[];for(w=0,M=f.length;w<M;w++)for(var _=m[w],S=0;S<_.length;S++){for(var C=_[S],T=!0,E=0;E<f.length;E++)i(C.p,f[E].p)&&(w!==E&&b.push({froms:w,tos:E,hole:S}),T?(T=!1,d[E].push(C)):x=!0);T&&d[w].push(C)}0<b.length&&(x||(m=d))}v=0;for(var D=f.length;v<D;v++){l=f[v].s,c.push(l);for(var A=0,O=(p=m[v]).length;A<O;A++)l.holes.push(p[A].h)}return c}}),Object.assign(ru.prototype,{isFont:!0,generateShapes:function(t,e){void 0===e&&(e=100);for(var n=[],i=function(t,e,n){for(var i=Array.from?Array.from(t):String(t).split(""),r=e/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*r,o=[],s=0,l=0,c=0;c<i.length;c++){var u=i[c];if("\n"===u)s=0,l-=a;else{var h=au(u,r,s,l,n);s+=h.offsetX,o.push(h.path)}}return o}(t,e,this.data),r=0,a=i.length;r<a;r++)Array.prototype.push.apply(n,i[r].toShapes());return n}}),ou.prototype=Object.assign(Object.create(ec.prototype),{constructor:ou,load:function(t,e,n,i){var r=this,a=new ic(this.manager);a.setPath(this.path),a.load(t,function(t){var n;try{n=JSON.parse(t)}catch(i){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(t.substring(65,t.length-2))}var i=r.parse(n);e&&e(i)},n,i)},parse:function(t){return new ru(t)}});var su={getContext:function(){return void 0===Kc&&(Kc=new(window.AudioContext||window.webkitAudioContext)),Kc},setContext:function(t){Kc=t}};function lu(t){ec.call(this,t)}function cu(){this.coefficients=[];for(var t=0;t<9;t++)this.coefficients.push(new We)}function uu(t,e){Pc.call(this,void 0,e),this.sh=void 0!==t?t:new cu}function hu(t,e,n){uu.call(this,void 0,n);var i=(new ci).set(t),r=(new ci).set(e),a=new We(i.r,i.g,i.b),o=new We(r.r,r.g,r.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(t,e){uu.call(this,void 0,e);var n=(new ci).set(t);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}lu.prototype=Object.assign(Object.create(ec.prototype),{constructor:lu,load:function(t,e,n,i){var r=new ic(this.manager);r.setResponseType("arraybuffer"),r.setPath(this.path),r.load(t,function(t){var n=t.slice(0);su.getContext().decodeAudioData(n,function(t){e(t)})},n,i)}}),Object.assign(cu.prototype,{isSphericalHarmonics3:!0,set:function(t){for(var e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this},zero:function(){for(var t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this},getAt:function(t,e){var n=t.x,i=t.y,r=t.z,a=this.coefficients;return e.copy(a[0]).multiplyScalar(.282095),e.addScale(a[1],.488603*i),e.addScale(a[2],.488603*r),e.addScale(a[3],.488603*n),e.addScale(a[4],n*i*1.092548),e.addScale(a[5],i*r*1.092548),e.addScale(a[6],.315392*(3*r*r-1)),e.addScale(a[7],n*r*1.092548),e.addScale(a[8],.546274*(n*n-i*i)),e},getIrradianceAt:function(t,e){var n=t.x,i=t.y,r=t.z,a=this.coefficients;return e.copy(a[0]).multiplyScalar(.886227),e.addScale(a[1],1.023328*i),e.addScale(a[2],1.023328*r),e.addScale(a[3],1.023328*n),e.addScale(a[4],.858086*n*i),e.addScale(a[5],.858086*i*r),e.addScale(a[6],.743125*r*r-.247708),e.addScale(a[7],.858086*n*r),e.addScale(a[8],.429043*(n*n-i*i)),e},add:function(t){for(var e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this},scale:function(t){for(var e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this},lerp:function(t,e){for(var n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this},equals:function(t){for(var e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0},copy:function(t){return this.set(t.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(t,e){void 0===e&&(e=0);for(var n=this.coefficients,i=0;i<9;i++)n[i].fromArray(t,e+3*i);return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);for(var n=this.coefficients,i=0;i<9;i++)n[i].toArray(t,e+3*i);return t}}),Object.assign(cu,{getBasisAt:function(t,e){var n=t.x,i=t.y,r=t.z;e[0]=.282095,e[1]=.488603*i,e[2]=.488603*r,e[3]=.488603*n,e[4]=1.092548*n*i,e[5]=1.092548*i*r,e[6]=.315392*(3*r*r-1),e[7]=1.092548*n*r,e[8]=.546274*(n*n-i*i)}}),uu.prototype=Object.assign(Object.create(Pc.prototype),{constructor:uu,isLightProbe:!0,copy:function(t){return Pc.prototype.copy.call(this,t),this.sh.copy(t.sh),this.intensity=t.intensity,this},toJSON:function(t){return Pc.prototype.toJSON.call(this,t)}}),hu.prototype=Object.assign(Object.create(uu.prototype),{constructor:hu,isHemisphereLightProbe:!0,copy:function(t){return uu.prototype.copy.call(this,t),this},toJSON:function(t){return uu.prototype.toJSON.call(this,t)}}),pu.prototype=Object.assign(Object.create(uu.prototype),{constructor:pu,isAmbientLightProbe:!0,copy:function(t){return uu.prototype.copy.call(this,t),this},toJSON:function(t){return uu.prototype.toJSON.call(this,t)}});var du=new Qe,fu=new Qe;function mu(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new yr,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new yr,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(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}Object.assign(mu.prototype,{update:function(t){var e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep;var n,i,r=t.projectionMatrix.clone(),a=e.eyeSep/2,o=a*e.near/e.focus,s=e.near*Math.tan(Pe.DEG2RAD*e.fov*.5)/e.zoom;fu.elements[12]=-a,du.elements[12]=a,n=-s*e.aspect+o,i=s*e.aspect+o,r.elements[0]=2*e.near/(i-n),r.elements[8]=(i+n)/(i-n),this.cameraL.projectionMatrix.copy(r),n=-s*e.aspect-o,i=s*e.aspect-o,r.elements[0]=2*e.near/(i-n),r.elements[8]=(i+n)/(i-n),this.cameraR.projectionMatrix.copy(r)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(fu),this.cameraR.matrixWorld.copy(t.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 t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var e=("undefined"==typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}});var vu=new We,yu=new Ge,xu=new We,bu=new We;function wu(){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 Mu(t){yn.call(this),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.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=[]}wu.prototype=Object.assign(Object.create(yn.prototype),{constructor:wu,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(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this},updateMatrixWorld:function(t){yn.prototype.updateMatrixWorld.call(this,t);var e=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(vu,yu,xu),bu.set(0,0,-1).applyQuaternion(yu),e.positionX){var i=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(vu.x,i),e.positionY.linearRampToValueAtTime(vu.y,i),e.positionZ.linearRampToValueAtTime(vu.z,i),e.forwardX.linearRampToValueAtTime(bu.x,i),e.forwardY.linearRampToValueAtTime(bu.y,i),e.forwardZ.linearRampToValueAtTime(bu.z,i),e.upX.linearRampToValueAtTime(n.x,i),e.upY.linearRampToValueAtTime(n.y,i),e.upZ.linearRampToValueAtTime(n.z,i)}else e.setPosition(vu.x,vu.y,vu.z),e.setOrientation(bu.x,bu.y,bu.z,n.x,n.y,n.z)}}),Mu.prototype=Object.assign(Object.create(yn.prototype),{constructor:Mu,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setMediaElementSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this},setMediaStreamSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(t){if(void 0===t&&(t=0),!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+t;var e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._pausedAt+this.offset,this.duration),this.isPlaying=!0,this.source=e,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 t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);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 t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t=t||[],!0===this.isPlaying?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},setDetune:function(t){if(this.detune=t,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(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!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(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},setLoopStart:function(t){return this.loopStart=t,this},setLoopEnd:function(t){return this.loopEnd=t,this},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}});var _u=new We,Su=new Ge,Cu=new We,Tu=new We;function Eu(t){Mu.call(this,t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function Du(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function Au(t,e,n){this.binding=t,this.valueSize=n;var i,r=Float64Array;switch(e){case"quaternion":i=this._slerp;break;case"string":case"bool":r=Array,i=this._select;break;default:i=this._lerp}this.buffer=new r(4*n),this._mixBufferRegion=i,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}Eu.prototype=Object.assign(Object.create(Mu.prototype),{constructor:Eu,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){return this.panner.refDistance=t,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){return this.panner.rolloffFactor=t,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){return this.panner.distanceModel=t,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){return this.panner.maxDistance=t,this},setDirectionalCone:function(t,e,n){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(t){if(yn.prototype.updateMatrixWorld.call(this,t),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(_u,Su,Cu),Tu.set(0,0,1).applyQuaternion(Su);var e=this.panner;if(e.positionX){var n=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(_u.x,n),e.positionY.linearRampToValueAtTime(_u.y,n),e.positionZ.linearRampToValueAtTime(_u.z,n),e.orientationX.linearRampToValueAtTime(Tu.x,n),e.orientationY.linearRampToValueAtTime(Tu.y,n),e.orientationZ.linearRampToValueAtTime(Tu.z,n)}else e.setPosition(_u.x,_u.y,_u.z),e.setOrientation(Tu.x,Tu.y,Tu.z)}}}),Object.assign(Du.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var t=0,e=this.getFrequencyData(),n=0;n<e.length;n++)t+=e[n];return t/e.length}}),Object.assign(Au.prototype,{accumulate:function(t,e){var n=this.buffer,i=this.valueSize,r=t*i+i,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==i;++o)n[r+o]=n[o];a=e}else{var s=e/(a+=e);this._mixBufferRegion(n,r,0,s,i)}this.cumulativeWeight=a},apply:function(t){var e=this.valueSize,n=this.buffer,i=t*e+e,r=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,r<1){var o=3*e;this._mixBufferRegion(n,i,o,1-r,e)}for(var s=e,l=e+e;s!==l;++s)if(n[s]!==n[s+e]){a.setValue(n,i);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,n=this.valueSize,i=3*n;t.getValue(e,i);for(var r=n,a=i;r!==a;++r)e[r]=e[i+r%n];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_select:function(t,e,n,i,r){if(.5<=i)for(var a=0;a!==r;++a)t[e+a]=t[n+a]},_slerp:function(t,e,n,i){Ge.slerpFlat(t,e,t,e,t,n,i)},_lerp:function(t,e,n,i,r){for(var a=1-i,o=0;o!==r;++o){var s=e+o;t[s]=t[s]*a+t[n+o]*i}}});var Ou="\\[\\]\\.:\\/",Lu=new RegExp("["+Ou+"]","g"),Iu="[^"+Ou+"]",Pu="[^"+Ou.replace("\\.","")+"]",Ru=/((?:WC+[\/:])*)/.source.replace("WC",Iu),ku=/(WCOD+)?/.source.replace("WCOD",Pu),Nu=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Iu),Bu=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Iu),Fu=new RegExp("^"+Ru+ku+Nu+Bu+"$"),ju=["material","materials","bones"];function Vu(t,e,n){var i=n||zu.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}function zu(t,e,n){this.path=e,this.parsedPath=n||zu.parseTrackName(e),this.node=zu.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function Gu(){this.uuid=Pe.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,n=arguments.length;e!==n;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}function Uu(t,e,n){this._mixer=t,this._clip=e,this._localRoot=n||null;for(var i=e.tracks,r=i.length,a=new Array(r),o={endingStart:ue,endingEnd:ue},s=0;s!==r;++s){var l=i[s].createInterpolant(null);(a[s]=l).settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(r),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(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Wu(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function Ju(t,e,n){mo.call(this,t,e),this.meshPerAttribute=n||1}function qu(t,e,n,i){this.ray=new Hn(t,e),this.near=n||0,this.far=i||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(t,e){return t.distance-e.distance}function Yu(t,e,n,i){if(!1!==t.visible&&(t.raycast(e,n),!0===i))for(var r=t.children,a=0,o=r.length;a<o;a++)Yu(r[a],e,n,!0)}function Zu(t,e,n){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==n?n:0,this}function $u(t,e,n){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==n?n:0,this}Object.assign(Vu.prototype,{getValue:function(t,e){this.bind();var n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(t,e)},setValue:function(t,e){for(var n=this._bindings,i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(zu,{Composite:Vu,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new zu.Composite(t,e,n):new zu(t,e,n)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(Lu,"")},parseTrackName:function(t){var e=Fu.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){var r=n.nodeName.substring(i+1);-1!==ju.indexOf(r)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=r)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n},findNode:function(t,e){if(!e||""===e||"root"===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){var i=function(t){for(var n=0;n<t.length;n++){var r=t[n];if(r.name===e||r.uuid===e)return r;var a=i(r.children);if(a)return a}return null},r=i(t.children);if(r)return r}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(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)t[e++]=n[i]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++]},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,n=e.objectName,i=e.propertyName,r=e.propertyIndex;if(t||(t=zu.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(n){var a=e.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var o=0;o<t.length;o++)if(t[o].name===a){a=o;break}break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==a){if(void 0===t[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[a]}}var s=t[i];if(void 0!==s){var l=this.Versioning.None;void 0!==(this.targetObject=t).needsUpdate?l=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(l=this.Versioning.MatrixWorldNeedsUpdate);var c=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===i){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(t.geometry.isBufferGeometry){if(!t.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(t.geometry.morphAttributes.position[o].name===r){r=o;break}}else{if(!t.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(t.geometry.morphTargets[o].name===r){r=o;break}}}c=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}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=i;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][l]}else{var u=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+i+" but it wasn't found.",t)}}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(Gu.prototype,{isAnimationObjectGroup:!0,add:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=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=i[p];if(void 0===d){d=e++,i[p]=d,t.push(h);for(var f=0,m=s;f!==m;++f)o[f].push(new zu(h,r[f],a[f]))}else if(d<n){l=t[d];var g=--n,v=t[g];for(t[i[v.uuid]=d]=v,t[i[p]=g]=h,f=0,m=s;f!==m;++f){var y=o[f],x=y[g],b=y[d];y[d]=x,void 0===b&&(b=new zu(h,r[f],a[f])),y[g]=b}}else t[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 t=this._objects,e=this.nCachedObjects_,n=this._indicesByUUID,i=this._bindings,r=i.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],l=s.uuid,c=n[l];if(void 0!==c&&e<=c){var u=e++,h=t[u];t[n[h.uuid]=c]=h,t[n[l]=u]=s;for(var p=0,d=r;p!==d;++p){var f=i[p],m=f[u],g=f[c];f[c]=m,f[u]=g}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._bindings,a=r.length,o=0,s=arguments.length;o!==s;++o){var l=arguments[o].uuid,c=i[l];if(void 0!==c)if(delete i[l],c<n){var u=--n,h=t[u],p=t[v=--e];t[i[h.uuid]=c]=h,t[i[p.uuid]=u]=p,t.pop();for(var d=0,f=a;d!==f;++d){var m=(y=r[d])[u],g=y[v];y[c]=m,y[u]=g,y.pop()}}else{var v;for(t[i[(p=t[v=--e]).uuid]=c]=p,t.pop(),d=0,f=a;d!==f;++d){var y;(y=r[d])[c]=y[v],y.pop()}}}this.nCachedObjects_=n},subscribe_:function(t,e){var n=this._bindingsIndicesByPath,i=n[t],r=this._bindings;if(void 0!==i)return r[i];var a=this._paths,o=this._parsedPaths,s=this._objects,l=s.length,c=this.nCachedObjects_,u=new Array(l);i=r.length,n[t]=i,a.push(t),o.push(e),r.push(u);for(var h=c,p=s.length;h!==p;++h){var d=s[h];u[h]=new zu(d,t,e)}return u},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){var i=this._paths,r=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];a[e[t[o]]=n]=s,a.pop(),r[n]=r[o],r.pop(),i[n]=i[o],i.pop()}}}),Object.assign(Uu.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(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){var i=this._clip.duration,r=t._clip.duration,a=r/i,o=i/r;t.warp(1,a,e),this.warp(o,1,e)}return this},crossFadeTo:function(t,e,n){return t.crossFadeFrom(this,e,n)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._effectiveTimeScale,0,t)},warp:function(t,e,n){var i=this._mixer,r=i.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,l=a.sampleValues;return s[0]=r,s[1]=r+n,l[0]=t/o,l[1]=e/o,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,n,i){if(this.enabled){var r=this._startTime;if(null!==r){var a=(t-r)*n;if(a<0||0===n)return;this._startTime=null,e=n*a}e*=this._updateTimeScale(t);var o=this._updateTime(e),s=this._updateWeight(t);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(i,s)}else this._updateWeight(t)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var n=this._weightInterpolant;if(null!==n){var i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var n=this._timeScaleInterpolant;null!==n&&(e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e))}return this._effectiveTimeScale=e},_updateTime:function(t){var e=this.time+t,n=this._clip.duration,i=this.loop,r=this._loopCount,a=2202===i;if(0===t)return-1!==r&&a&&1==(1&r)?n-e:e;if(2200===i){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n<=e)e=n;else{if(!(e<0)){this.time=e;break t}e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(0<=t?(r=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),n<=e||e<0){var o=Math.floor(e/n);e-=n*o,r+=Math.abs(o);var s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=0<t?n:0,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<t?1:-1});else{if(1==s){var l=t<0;this._setEndings(l,!l,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this.time=e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=e;if(a&&1==(1&r))return n-e}return e},_setEndings:function(t,e,n){var i=this._interpolantSettings;n?(i.endingStart=he,i.endingEnd=he):(i.endingStart=t?this.zeroSlopeAtStart?he:ue:pe,i.endingEnd=e?this.zeroSlopeAtEnd?he:ue:pe)},_scheduleFading:function(t,e,n){var i=this._mixer,r=i.time,a=this._weightInterpolant;null===a&&(a=i._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=r,s[0]=e,o[1]=r+t,s[1]=n,this}}),Hu.prototype=Object.assign(Object.create(Ae.prototype),{constructor:Hu,_bindAction:function(t,e){var n=t._localRoot||this._root,i=t._clip.tracks,r=i.length,a=t._propertyBindings,o=t._interpolants,s=n.uuid,l=this._bindingsByRootAndName,c=l[s];void 0===c&&(c={},l[s]=c);for(var u=0;u!==r;++u){var h=i[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=e&&e._propertyBindings[u].binding.parsedPath;++(d=new Au(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(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,n=t._clip.uuid,i=this._actionsByClip[n];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,n,e)}for(var r=t._propertyBindings,a=0,o=r.length;a!==o;++a){var s=r[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,n=0,i=e.length;n!==i;++n){var r=e[n];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,n){var i=this._actions,r=this._actionsByClip,a=r[e];if(void 0===a)a={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=a;else{var o=a.knownActions;t._byClipCacheIndex=o.length,o.push(t)}t._cacheIndex=i.length,i.push(t),a.actionByRoot[n]=t},_removeInactiveAction:function(t){var e=this._actions,n=e[e.length-1],i=t._cacheIndex;e[n._cacheIndex=i]=n,e.pop(),t._cacheIndex=null;var r=t._clip.uuid,a=this._actionsByClip,o=a[r],s=o.knownActions,l=s[s.length-1],c=t._byClipCacheIndex;s[l._byClipCacheIndex=c]=l,s.pop(),t._byClipCacheIndex=null,delete o.actionByRoot[(t._localRoot||this._root).uuid],0===s.length&&delete a[r],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=t._propertyBindings,n=0,i=e.length;n!==i;++n){var r=e[n];0==--r.referenceCount&&this._removeInactiveBinding(r)}},_lendAction:function(t){var e=this._actions,n=t._cacheIndex,i=this._nActiveActions++,r=e[i];e[t._cacheIndex=i]=t,e[r._cacheIndex=n]=r},_takeBackAction:function(t){var e=this._actions,n=t._cacheIndex,i=--this._nActiveActions,r=e[i];e[t._cacheIndex=i]=t,e[r._cacheIndex=n]=r},_addInactiveBinding:function(t,e,n){var i=this._bindingsByRootAndName,r=i[e],a=this._bindings;void 0===r&&(r={},i[e]=r),(r[n]=t)._cacheIndex=a.length,a.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,n=t.binding,i=n.rootNode.uuid,r=n.path,a=this._bindingsByRootAndName,o=a[i],s=e[e.length-1],l=t._cacheIndex;e[s._cacheIndex=l]=s,e.pop(),delete o[r],0===Object.keys(o).length&&delete a[i]},_lendBinding:function(t){var e=this._bindings,n=t._cacheIndex,i=this._nActiveBindings++,r=e[i];e[t._cacheIndex=i]=t,e[r._cacheIndex=n]=r},_takeBackBinding:function(t){var e=this._bindings,n=t._cacheIndex,i=--this._nActiveBindings,r=e[i];e[t._cacheIndex=i]=t,e[r._cacheIndex=n]=r},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,n=t[e];return void 0===n&&(t[(n=new Vl(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=e]=n),n},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,n=t.__cacheIndex,i=--this._nActiveControlInterpolants,r=e[i];e[t.__cacheIndex=i]=t,e[r.__cacheIndex=n]=r},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e){var n=e||this._root,i=n.uuid,r="string"==typeof t?Zl.findByName(n,t):t,a=null!==r?r.uuid:t,o=this._actionsByClip[a],s=null;if(void 0!==o){var l=o.actionByRoot[i];if(void 0!==l)return l;s=o.knownActions[0],null===r&&(r=s._clip)}if(null===r)return null;var c=new Uu(this,r,e);return this._bindAction(c,s),this._addInactiveAction(c,a,i),c},existingAction:function(t,e){var n=e||this._root,i=n.uuid,r="string"==typeof t?Zl.findByName(n,t):t,a=r?r.uuid:t,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[i]||null},stopAllAction:function(){var t=this._actions,e=this._nActiveActions,n=this._bindings,i=this._nActiveBindings;this._nActiveActions=0;for(var r=this._nActiveBindings=0;r!==e;++r)t[r].reset();for(r=0;r!==i;++r)n[r].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,n=this._nActiveActions,i=this.time+=t,r=Math.sign(t),a=this._accuIndex^=1,o=0;o!==n;++o)e[o]._update(i,t,r,a);var s=this._bindings,l=this._nActiveBindings;for(o=0;o!==l;++o)s[o].apply(a);return this},setTime:function(t){for(var e=this.time=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(t)},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions,n=t.uuid,i=this._actionsByClip,r=i[n];if(void 0!==r){for(var a=r.knownActions,o=0,s=a.length;o!==s;++o){var l=a[o];this._deactivateAction(l);var c=l._cacheIndex,u=e[e.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,e[u._cacheIndex=c]=u,e.pop(),this._removeInactiveBindingsForAction(l)}delete i[n]}},uncacheRoot:function(t){var e=t.uuid,n=this._actionsByClip;for(var i in n){var r=n[i].actionByRoot[e];void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}var a=this._bindingsByRootAndName[e];if(void 0!==a)for(var o in a){var s=a[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(t,e){var n=this.existingAction(t,e);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())},Ju.prototype=Object.assign(Object.create(mo.prototype),{constructor:Ju,isInstancedInterleavedBuffer:!0,copy:function(t){return mo.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),Object.assign(qu.prototype,{linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,e,n){var i=n||[];return Yu(t,this,i,e),i.sort(Xu),i},intersectObjects:function(t,e,n){var i=n||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var r=0,a=t.length;r<a;r++)Yu(t[r],this,i,e);return i.sort(Xu),i}}),Object.assign(Zu.prototype,{set:function(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(Pe.clamp(e/this.radius,-1,1))),this}}),Object.assign($u.prototype,{set:function(t,e,n){return this.radius=t,this.theta=e,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+n*n),this.theta=Math.atan2(t,n),this.y=e,this}});var Ku=new Re;function Qu(t,e){this.min=void 0!==t?t:new Re(1/0,1/0),this.max=void 0!==e?e:new Re(-1/0,-1/0)}Object.assign(Qu.prototype,{set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(t,e){var n=Ku.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.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(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new Re),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new Re),this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new Re),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new Re),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return Ku.copy(t).clamp(this.min,this.max).sub(t).length()},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var th=new We,eh=new We;function nh(t,e){this.start=void 0!==t?t:new We,this.end=void 0!==e?e:new We}function ih(t){yn.call(this),this.material=t,this.render=function(){}}Object.assign(nh.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new We),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new We),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new We),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(t,e){th.subVectors(t,this.start),eh.subVectors(this.end,this.start);var n=eh.dot(eh),i=eh.dot(th)/n;return e&&(i=Pe.clamp(i,0,1)),i},closestPointToPoint:function(t,e,n){var i=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new We),this.delta(n).multiplyScalar(i).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),((ih.prototype=Object.create(yn.prototype)).constructor=ih).prototype.isImmediateRenderObject=!0;var rh=new We;function ah(t,e){yn.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var n=new Bi,i=[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],r=0,a=1;r<32;r++,a++){var o=r/32*Math.PI*2,s=a/32*Math.PI*2;i.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1)}n.setAttribute("position",new Ti(i,3));var l=new qo({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 t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),rh.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(rh),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var oh=new We,sh=new Qe,lh=new Qe;function ch(t){for(var e=function t(e){var n=[];e&&e.isBone&&n.push(e);for(var i=0;i<e.children.length;i++)n.push.apply(n,t(e.children[i]));return n}(t),n=new Bi,i=[],r=[],a=new ci(0,0,1),o=new ci(0,1,0),s=0;s<e.length;s++){var l=e[s];l.parent&&l.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(a.r,a.g,a.b),r.push(o.r,o.g,o.b))}n.setAttribute("position",new Ti(i,3)),n.setAttribute("color",new Ti(r,3));var c=new qo({vertexColors:h,depthTest:!1,depthWrite:!1,transparent:!0});ns.call(this,n,c),this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}function uh(t,e,n){this.light=t,this.light.updateMatrixWorld(),this.color=n;var i=new ul(e,4,2),r=new gi({wireframe:!0,fog:!1});er.call(this,i,r),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}((ch.prototype=Object.create(ns.prototype)).constructor=ch).prototype.updateMatrixWorld=function(t){var e=this.bones,n=this.geometry,i=n.getAttribute("position");lh.getInverse(this.root.matrixWorld);for(var r=0,a=0;r<e.length;r++){var o=e[r];o.parent&&o.parent.isBone&&(sh.multiplyMatrices(lh,o.matrixWorld),oh.setFromMatrixPosition(sh),i.setXYZ(a,oh.x,oh.y,oh.z),sh.multiplyMatrices(lh,o.parent.matrixWorld),oh.setFromMatrixPosition(sh),i.setXYZ(a+1,oh.x,oh.y,oh.z),a+=2)}n.getAttribute("position").needsUpdate=!0,yn.prototype.updateMatrixWorld.call(this,t)},((uh.prototype=Object.create(er.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 We,ph=new ci,dh=new ci;function fh(t,e,n){yn.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var i=new _s(e);i.rotateY(.5*Math.PI),this.material=new gi({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=h);var r=i.getAttribute("position"),a=new Float32Array(3*r.count);i.setAttribute("color",new yi(a,3)),this.add(new er(i,this.material)),this.update()}function mh(t,e,n,i){t=t||10,e=e||10,n=new ci(void 0!==n?n:4473924),i=new ci(void 0!==i?i:8947848);for(var r=e/2,a=t/e,o=t/2,s=[],l=[],c=0,u=0,p=-o;c<=e;c++,p+=a){s.push(-o,0,p,o,0,p),s.push(p,0,-o,p,0,o);var d=c===r?n:i;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 Bi;f.setAttribute("position",new Ti(s,3)),f.setAttribute("color",new Ti(l,3));var m=new qo({vertexColors:h});ns.call(this,f,m)}function gh(t,e,n,i,r,a){t=t||10,e=e||16,n=n||8,i=i||64,r=new ci(void 0!==r?r:4473924),a=new ci(void 0!==a?a:8947848);var o,s,l,c,u,p,d,f=[],m=[];for(c=0;c<=e;c++)l=c/e*(2*Math.PI),o=Math.sin(l)*t,s=Math.cos(l)*t,f.push(0,0,0),f.push(o,0,s),d=1&c?r: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?r:a,p=t-t/n*c,u=0;u<i;u++)l=u/i*(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)/i*(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 Bi;g.setAttribute("position",new Ti(f,3)),g.setAttribute("color",new Ti(m,3));var v=new qo({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 t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var e=t.geometry.getAttribute("color");ph.copy(this.light.color),dh.copy(this.light.groundColor);for(var n=0,i=e.count;n<i;n++){var r=n<i/2?ph:dh;e.setXYZ(n,r.r,r.g,r.b)}e.needsUpdate=!0}t.lookAt(hh.setFromMatrixPosition(this.light.matrixWorld).negate())},mh.prototype=Object.assign(Object.create(ns.prototype),{constructor:mh,copy:function(t){return ns.prototype.copy.call(this,t),this.geometry.copy(t.geometry),this.material.copy(t.material),this},clone:function(){return(new this.constructor).copy(this)}}),(gh.prototype=Object.create(ns.prototype)).constructor=gh;var vh=new We,yh=new We,xh=new We;function bh(t,e,n){yn.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===e&&(e=1);var i=new Bi;i.setAttribute("position",new Ti([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var r=new qo({fog:!1});this.lightPlane=new Qo(i,r),this.add(this.lightPlane),(i=new Bi).setAttribute("position",new Ti([0,0,0,0,0,1],3)),this.targetLine=new Qo(i,r),this.add(this.targetLine),this.update()}((bh.prototype=Object.create(yn.prototype)).constructor=bh).prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},bh.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 wh=new We,Mh=new vr;function _h(t){var e=new Bi,n=new qo({color:16777215,vertexColors:1}),i=[],r=[],a={},o=new ci(16755200),s=new ci(16711680),l=new ci(43775),c=new ci(16777215),u=new ci(3355443);function h(t,e,n){p(t,n),p(e,n)}function p(t,e){i.push(0,0,0),r.push(e.r,e.g,e.b),void 0===a[t]&&(a[t]=[]),a[t].push(i.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),e.setAttribute("position",new Ti(i,3)),e.setAttribute("color",new Ti(r,3)),ns.call(this,e,n),this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}function Sh(t,e,n,i,r,a,o){wh.set(r,a,o).unproject(i);var s=e[t];if(void 0!==s)for(var l=n.getAttribute("position"),c=0,u=s.length;c<u;c++)l.setXYZ(s[c],wh.x,wh.y,wh.z)}((_h.prototype=Object.create(ns.prototype)).constructor=_h).prototype.update=function(){var t=this.geometry,e=this.pointMap;Mh.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Sh("c",e,t,Mh,0,0,-1),Sh("t",e,t,Mh,0,0,1),Sh("n1",e,t,Mh,-1,-1,-1),Sh("n2",e,t,Mh,1,-1,-1),Sh("n3",e,t,Mh,-1,1,-1),Sh("n4",e,t,Mh,1,1,-1),Sh("f1",e,t,Mh,-1,-1,1),Sh("f2",e,t,Mh,1,-1,1),Sh("f3",e,t,Mh,-1,1,1),Sh("f4",e,t,Mh,1,1,1),Sh("u1",e,t,Mh,.7,1.1,-1),Sh("u2",e,t,Mh,-.7,1.1,-1),Sh("u3",e,t,Mh,0,2,-1),Sh("cf1",e,t,Mh,-1,0,1),Sh("cf2",e,t,Mh,1,0,1),Sh("cf3",e,t,Mh,0,-1,1),Sh("cf4",e,t,Mh,0,1,1),Sh("cn1",e,t,Mh,-1,0,-1),Sh("cn2",e,t,Mh,1,0,-1),Sh("cn3",e,t,Mh,0,-1,-1),Sh("cn4",e,t,Mh,0,1,-1),t.getAttribute("position").needsUpdate=!0};var Ch=new Pn;function Th(t,e){this.object=t,void 0===e&&(e=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]),i=new Float32Array(24),r=new Bi;r.setIndex(new yi(n,1)),r.setAttribute("position",new yi(i,3)),ns.call(this,r,new qo({color:e})),this.matrixAutoUpdate=!1,this.update()}function Eh(t,e){this.type="Box3Helper",this.box=t,e=e||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]),i=new Bi;i.setIndex(new yi(n,1)),i.setAttribute("position",new Ti([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,i,new qo({color:e})),this.geometry.computeBoundingSphere()}function Dh(t,e,n){this.type="PlaneHelper",this.plane=t,this.size=void 0===e?1:e;var i=void 0!==n?n:16776960,r=new Bi;r.setAttribute("position",new Ti([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)),r.computeBoundingSphere(),Qo.call(this,r,new qo({color:i}));var a=new Bi;a.setAttribute("position",new Ti([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),a.computeBoundingSphere(),this.add(new er(a,new gi({color:i,opacity:.2,transparent:!0,depthWrite:!1})))}((Th.prototype=Object.create(ns.prototype)).constructor=Th).prototype.update=function(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Ch.setFromObject(this.object),!Ch.isEmpty()){var e=Ch.min,n=Ch.max,i=this.geometry.attributes.position,r=i.array;r[0]=n.x,r[1]=n.y,r[2]=n.z,r[3]=e.x,r[4]=n.y,r[5]=n.z,r[6]=e.x,r[7]=e.y,r[8]=n.z,r[9]=n.x,r[10]=e.y,r[11]=n.z,r[12]=n.x,r[13]=n.y,r[14]=e.z,r[15]=e.x,r[16]=n.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=n.x,r[22]=e.y,r[23]=e.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}},Th.prototype.setFromObject=function(t){return this.object=t,this.update(),this},Th.prototype.copy=function(t){return ns.prototype.copy.call(this,t),this.object=t.object,this},Th.prototype.clone=function(){return(new this.constructor).copy(this)},((Eh.prototype=Object.create(ns.prototype)).constructor=Eh).prototype.updateMatrixWorld=function(t){var e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),yn.prototype.updateMatrixWorld.call(this,t))},((Dh.prototype=Object.create(Qo.prototype)).constructor=Dh).prototype.updateMatrixWorld=function(t){var e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?l:s,this.lookAt(this.plane.normal),yn.prototype.updateMatrixWorld.call(this,t)};var Ah,Oh,Lh=new We;function Ih(t,e,n,i,r,a){yn.call(this),void 0===t&&(t=new We(0,0,1)),void 0===e&&(e=new We(0,0,0)),void 0===n&&(n=1),void 0===i&&(i=16776960),void 0===r&&(r=.2*n),void 0===a&&(a=.2*r),void 0===Ah&&((Ah=new Bi).setAttribute("position",new Ti([0,0,0,0,1,0],3)),(Oh=new bl(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(e),this.line=new Qo(Ah,new qo({color:i})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new er(Oh,new gi({color:i})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(n,r,a)}function Ph(t){var e=[0,0,0,t=t||1,0,0,0,0,0,0,t,0,0,0,0,0,0,t],n=new Bi;n.setAttribute("position",new Ti(e,3)),n.setAttribute("color",new Ti([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var i=new qo({vertexColors:h});ns.call(this,n,i)}((Ih.prototype=Object.create(yn.prototype)).constructor=Ih).prototype.setDirection=function(t){if(.99999<t.y)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{Lh.set(t.z,0,-t.x).normalize();var e=Math.acos(t.y);this.quaternion.setFromAxisAngle(Lh,e)}},Ih.prototype.setLength=function(t,e,n){void 0===e&&(e=.2*t),void 0===n&&(n=.2*e),this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()},Ih.prototype.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},Ih.prototype.copy=function(t){return yn.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},Ih.prototype.clone=function(){return(new this.constructor).copy(this)},(Ph.prototype=Object.create(ns.prototype)).constructor=Ph;var Rh=4,kh=8,Nh=Math.pow(2,kh),Bh=[.125,.215,.35,.446,.526,.582],Fh=kh-Rh+1+Bh.length,jh=20,Vh={};Vh[de]=0,Vh[fe]=1,Vh[ge]=2,Vh[ye]=3,Vh[xe]=4,Vh[be]=5,Vh[me]=6;var zh,Gh,Uh=new Vc,Hh=((Gh=new El({defines:{n:zh=jh},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:new Float32Array(zh)},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:new We(0,1,0)},inputEncoding:{value:Vh[de]},outputEncoding:{value:Vh[de]}},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",Gh),Wh=null,Jh=null,qh=function(){for(var t=[],e=[],n=[],i=kh,r=0;r<Fh;r++){var a=Math.pow(2,i);e.push(a);var o=1/a;kh-Rh<r?o=Bh[r-kh+Rh-1]:0==r&&(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 Bi;x.setAttribute("position",new yi(h,3)),x.setAttribute("uv",new yi(p,2)),x.setAttribute("faceIndex",new yi(d,1)),t.push(x),Rh<i&&i--}return{_lodPlanes:t,_sizeLods:e,_sigmas:n}}(),Xh=qh._lodPlanes,Yh=qh._sizeLods,Zh=qh._sigmas,$h=null,Kh=null,Qh=null,tp=(1+Math.sqrt(5))/2,ep=1/tp,np=[new We(1,1,1),new We(-1,1,1),new We(1,1,-1),new We(-1,1,-1),new We(0,tp,ep),new We(0,tp,-ep),new We(ep,0,tp),new We(-ep,0,tp),new We(tp,ep,0),new We(-tp,ep,0)];function ip(t){Kh=t,op(Hh)}function rp(t){var e={magFilter:st,minFilter:st,generateMipmaps:!1,type:t?t.type:dt,format:t?t.format:Ot,encoding:t?t.encoding:ge,depthBuffer:!1,stencilBuffer:!1},n=sp(e);return n.depthBuffer=!t,$h=sp(e),n}function ap(t){$h.dispose(),Kh.setRenderTarget(Qh),t.scissorTest=!1,t.setSize(t.width,t.height)}function op(t){var e=new xn;e.add(new er(Xh[0],t)),Kh.compile(e,Uh)}function sp(t){var e=new Ve(3*Nh,3*Nh,t);return e.texture.mapping=nt,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function lp(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function cp(t){var e=Kh.autoClear;Kh.autoClear=!1;for(var n=1;n<Fh;n++)up(t,n-1,n,Math.sqrt(Zh[n]*Zh[n]-Zh[n-1]*Zh[n-1]),np[(n-1)%np.length]);Kh.autoClear=e}function up(t,e,n,i,r){hp(t,$h,e,n,i,"latitudinal",r),hp($h,t,n,n,i,"longitudinal",r)}function hp(t,e,n,i,r,a,o){"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");var s=new xn;s.add(new er(Xh[i],Hh));var l=Hh.uniforms,c=Yh[n]-1,u=isFinite(r)?Math.PI/(2*c):2*Math.PI/(2*jh-1),h=r/u,p=isFinite(r)?1+Math.floor(3*h):jh;jh<p&&console.warn("sigmaRadians, "+r+", is too large and will clip, as it requested "+p+" samples when the maximum is set to "+jh);for(var d=[],f=0,m=0;m<jh;++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=t.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=kh-n,l.inputEncoding.value=Vh[t.texture.encoding],l.outputEncoding.value=Vh[t.texture.encoding];var y=Yh[i];lp(e,g=3*Math.max(0,Nh-2*y),(0===i?0:2*Nh)+2*y*(kh-Rh<i?i-kh+Rh:0),3*y,2*y),Kh.setRenderTarget(e),Kh.render(s,Uh)}function pp(){var t=new El({uniforms:{envMap:{value:null},texelSize:{value:new Re(1,1)},inputEncoding:{value:Vh[de]},outputEncoding:{value:Vh[de]}},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 t.type="EquirectangularToCubeUV",t}function dp(){var t=new El({uniforms:{envMap:{value:null},inputEncoding:{value:Vh[de]},outputEncoding:{value:Vh[de]}},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 t.type="CubemapToCubeUV",t}function fp(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),yc.call(this,t),this.type="catmullrom",this.closed=!0}function mp(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),yc.call(this,t),this.type="catmullrom"}function gp(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),yc.call(this,t),this.type="catmullrom"}ip.prototype={constructor:ip,fromScene:function(t,e,n,i){void 0===e&&(e=0),void 0===n&&(n=.1),void 0===i&&(i=100),Qh=Kh.getRenderTarget();var r=rp();return function(t,e,n,i){var r=new yr(90,1,e,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=J,Kh.toneMappingExposure=1,Kh.outputEncoding=de,t.scale.z*=-1;var p=t.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),t.background=null}for(var g=0;g<6;g++){var v=g%3;0==v?(r.up.set(0,a[g],0),r.lookAt(o[g],0,0)):1==v?(r.up.set(0,0,a[g]),r.lookAt(0,o[g],0)):(r.up.set(0,a[g],0),r.lookAt(0,0,o[g])),lp(i,v*Nh,2<g?Nh:0,Nh,Nh),Kh.setRenderTarget(i),Kh.render(t,r)}Kh.toneMapping=l,Kh.toneMappingExposure=c,Kh.outputEncoding=s,Kh.setClearColor(u,h),t.scale.z*=-1}(t,n,i,r),0<e&&up(r,0,0,e),cp(r),ap(r),r},fromEquirectangular:function(t){return t.magFilter=st,t.minFilter=st,t.generateMipmaps=!1,this.fromCubemap(t)},fromCubemap:function(t){Qh=Kh.getRenderTarget();var e=rp(t);return function(t,e){var n=new xn;t.isCubeTexture?null==Jh&&(Jh=dp()):null==Wh&&(Wh=pp());var i=t.isCubeTexture?Jh:Wh;n.add(new er(Xh[0],i));var r=i.uniforms;(r.envMap.value=t).isCubeTexture||r.texelSize.value.set(1/t.image.width,1/t.image.height),r.inputEncoding.value=Vh[t.encoding],r.outputEncoding.value=Vh[t.encoding],lp(e,0,0,3*Nh,2*Nh),Kh.setRenderTarget(e),Kh.render(n,Uh)}(t,e),cp(e),ap(e),e},compileCubemapShader:function(){null==Jh&&op(Jh=dp())},compileEquirectangularShader:function(){null==Wh&&op(Wh=pp())},dispose:function(){Hh.dispose(),null!=Jh&&Jh.dispose(),null!=Wh&&Wh.dispose();for(var t=0;t<Xh.length;t++)Xh[t].dispose()}},uc.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(uc.prototype),(t.prototype.constructor=t).prototype.getPoint=e,t},Object.assign(Oc.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var e=new lr,n=0,i=t.length;n<i;n++){var r=t[n];e.vertices.push(new We(r.x,r.y,r.z||0))}return e}}),Object.assign(Lc.prototype,{fromPoints:function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),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(ec.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Jc.extractUrlBase(t)}}),ec.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($c.prototype,{setTexturePath:function(t){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(t)}}),Object.assign(Qu.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(Pn.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Sr.prototype.setFromMatrix=function(t){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(t)},nh.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(Pe,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),Pe.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),Pe.ceilPowerOfTwo(t)}}),Object.assign(ke.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(Qe.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new We).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.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(t){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,n,i,r,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,i,n,r,a)}}),Xn.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},Ge.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(Hn.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(ai.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(ai,{barycoordFromPoint:function(t,e,n,i,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),ai.getBarycoord(t,e,n,i,r)},normal:function(t,e,n,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),ai.getNormal(t,e,n,i)}}),Object.assign(Ic.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new il(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new ml(this,t)}}),Object.assign(Re.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(We.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(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(je.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(lr.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(t){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.assign(yn.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(t){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(yn.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},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(er.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(er.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.")}}),Bo.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(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),yr.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(Pc.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(yi.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===De},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(De)}}}),Object.assign(yi.prototype,{setDynamic:function(t){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?De:Ee),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(Bi.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addAttribute:function(t,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(t,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(t,new yi(e,arguments[2])))},addDrawCall:function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},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(t){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(t)},applyMatrix:function(t){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(Bi.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===De},set:function(t){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(t)}}}),Object.assign(mo.prototype,{setDynamic:function(t){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?De:Ee),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(rl.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(mi.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 ci}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===t}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(t){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=t}}}),Object.defineProperties(Ol.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(gr.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(ho.prototype,{clearTarget:function(t,e,n,i){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,n,i)},animate:function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},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(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},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(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},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(t){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===t?fe:de}}}),Object.defineProperties(ro.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(Ve.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(Mu.prototype,{load:{value:function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this;return(new lu).load(t,function(t){e.setBuffer(t)}),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),Du.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},xr.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)};var vp={merge:function(t,e,n){var i;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),e.isMesh&&(e.matrixAutoUpdate&&e.updateMatrix(),i=e.matrix,e=e.geometry),t.merge(e,i,n)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}};Ne.crossOrigin=void 0,Ne.loadTexture=function(t,e,n,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var r=new cc;r.setCrossOrigin(this.crossOrigin);var a=r.load(t,n,void 0,i);return e&&(a.mapping=e),a},Ne.loadTextureCube=function(t,e,n,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var r=new lc;r.setCrossOrigin(this.crossOrigin);var a=r.load(t,n,void 0,i);return e&&(a.mapping=e),a},Ne.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Ne.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"}})),t.ACESFilmicToneMapping=Z,t.AddEquation=y,t.AddOperation=H,t.AdditiveBlending=f,t.AlphaFormat=Ct,t.AlwaysDepth=k,t.AlwaysStencilFunc=Te,t.AmbientLight=Uc,t.AmbientLightProbe=pu,t.AnimationClip=Zl,t.AnimationLoader=rc,t.AnimationMixer=Hu,t.AnimationObjectGroup=Gu,t.AnimationUtils=Bl,t.ArcCurve=pc,t.ArrayCamera=lo,t.ArrowHelper=Ih,t.Audio=Mu,t.AudioAnalyser=Du,t.AudioContext=su,t.AudioListener=wu,t.AudioLoader=lu,t.AxesHelper=Ph,t.AxisHelper=function(t){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Ph(t)},t.BackSide=l,t.BasicDepthPacking=we,t.BasicShadowMap=0,t.BinaryTextureLoader=function(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new oc(t)},t.Bone=zo,t.BooleanKeyframeTrack=Ul,t.BoundingBoxHelper=function(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Th(t,e)},t.Box2=Qu,t.Box3=Pn,t.Box3Helper=Eh,t.BoxBufferGeometry=ur,t.BoxGeometry=cr,t.BoxHelper=Th,t.BufferAttribute=yi,t.BufferGeometry=Bi,t.BufferGeometryLoader=Yc,t.ByteType=ft,t.Cache=Kl,t.Camera=vr,t.CameraHelper=_h,t.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been removed")},t.CanvasTexture=ds,t.CatmullRomCurve3=yc,t.CineonToneMapping=Y,t.CircleBufferGeometry=Sl,t.CircleGeometry=_l,t.ClampToEdgeWrapping=at,t.Clock=gu,t.ClosedSplineCurve3=fp,t.Color=ci,t.ColorKeyframeTrack=Hl,t.CompressedTexture=ps,t.CompressedTextureLoader=ac,t.ConeBufferGeometry=Ml,t.ConeGeometry=wl,t.CubeCamera=xr,t.CubeGeometry=cr,t.CubeReflectionMapping=$,t.CubeRefractionMapping=K,t.CubeTexture=Pr,t.CubeTextureLoader=lc,t.CubeUVReflectionMapping=nt,t.CubeUVRefractionMapping=it,t.CubicBezierCurve=Mc,t.CubicBezierCurve3=_c,t.CubicInterpolant=jl,t.CullFaceBack=n,t.CullFaceFront=i,t.CullFaceFrontBack=3,t.CullFaceNone=e,t.Curve=uc,t.CurvePath=Oc,t.CustomBlending=v,t.CylinderBufferGeometry=bl,t.CylinderGeometry=xl,t.Cylindrical=$u,t.DataTexture=wr,t.DataTexture2DArray=Rr,t.DataTexture3D=kr,t.DataTextureLoader=oc,t.DecrementStencilOp=7683,t.DecrementWrapStencilOp=34056,t.DefaultLoadingManager=tc,t.DepthFormat=Lt,t.DepthStencilFormat=It,t.DepthTexture=fs,t.DirectionalLight=Gc,t.DirectionalLightHelper=bh,t.DirectionalLightShadow=zc,t.DiscreteInterpolant=zl,t.DodecahedronBufferGeometry=Es,t.DodecahedronGeometry=Ts,t.DoubleSide=c,t.DstAlphaFactor=A,t.DstColorFactor=L,t.DynamicBufferAttribute=function(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new yi(t,e).setUsage(De)},t.DynamicCopyUsage=35050,t.DynamicDrawUsage=De,t.DynamicReadUsage=35049,t.EdgesGeometry=yl,t.EdgesHelper=function(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new ns(new yl(t.geometry),new qo({color:void 0!==e?e:16777215}))},t.EllipseCurve=hc,t.EqualDepth=F,t.EqualStencilFunc=514,t.EquirectangularReflectionMapping=Q,t.EquirectangularRefractionMapping=tt,t.Euler=nn,t.EventDispatcher=Ae,t.ExtrudeBufferGeometry=rl,t.ExtrudeGeometry=il,t.Face3=di,t.Face4=function(t,e,n,i,r,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new di(t,e,n,r,a,o)},t.FaceColors=1,t.FileLoader=ic,t.FlatShading=1,t.Float32Attribute=function(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Ti(t,e)},t.Float32BufferAttribute=Ti,t.Float64Attribute=function(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Ei(t,e)},t.Float64BufferAttribute=Ei,t.FloatType=xt,t.Fog=fo,t.FogExp2=po,t.Font=ru,t.FontLoader=ou,t.FrontFaceDirectionCCW=1,t.FrontFaceDirectionCW=0,t.FrontSide=s,t.Frustum=Sr,t.GammaEncoding=me,t.Geometry=lr,t.GeometryUtils=vp,t.GreaterDepth=V,t.GreaterEqualDepth=j,t.GreaterEqualStencilFunc=518,t.GreaterStencilFunc=516,t.GridHelper=mh,t.Group=co,t.HalfFloatType=bt,t.HemisphereLight=Rc,t.HemisphereLightHelper=fh,t.HemisphereLightProbe=hu,t.IcosahedronBufferGeometry=Cs,t.IcosahedronGeometry=Ss,t.ImageBitmapLoader=nu,t.ImageLoader=sc,t.ImageUtils=Ne,t.ImmediateRenderObject=ih,t.IncrementStencilOp=7682,t.IncrementWrapStencilOp=34055,t.InstancedBufferAttribute=Xc,t.InstancedBufferGeometry=qc,t.InstancedInterleavedBuffer=Ju,t.InstancedMesh=Jo,t.Int16Attribute=function(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new Mi(t,e)},t.Int16BufferAttribute=Mi,t.Int32Attribute=function(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Si(t,e)},t.Int32BufferAttribute=Si,t.Int8Attribute=function(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new xi(t,e)},t.Int8BufferAttribute=xi,t.IntType=vt,t.InterleavedBuffer=mo,t.InterleavedBufferAttribute=yo,t.Interpolant=Fl,t.InterpolateDiscrete=le,t.InterpolateLinear=ce,t.InterpolateSmooth=2302,t.InvertStencilOp=5386,t.JSONLoader=function(){console.error("THREE.JSONLoader has been removed.")},t.KeepStencilOp=Ce,t.KeyframeTrack=Gl,t.LOD=No,t.LatheBufferGeometry=fl,t.LatheGeometry=dl,t.Layers=rn,t.LensFlare=function(){console.error("THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js")},t.LessDepth=N,t.LessEqualDepth=B,t.LessEqualStencilFunc=515,t.LessStencilFunc=513,t.Light=Pc,t.LightProbe=uu,t.LightShadow=kc,t.Line=Qo,t.Line3=nh,t.LineBasicMaterial=qo,t.LineCurve=Sc,t.LineCurve3=Cc,t.LineDashedMaterial=kl,t.LineLoop=is,t.LinePieces=1,t.LineSegments=ns,t.LineStrip=0,t.LinearEncoding=de,t.LinearFilter=ut,t.LinearInterpolant=Vl,t.LinearMipMapLinearFilter=1008,t.LinearMipMapNearestFilter=1007,t.LinearMipmapLinearFilter=pt,t.LinearMipmapNearestFilter=ht,t.LinearToneMapping=J,t.Loader=ec,t.LoaderUtils=Jc,t.LoadingManager=Ql,t.LogLuvEncoding=ve,t.LoopOnce=2200,t.LoopPingPong=2202,t.LoopRepeat=2201,t.LuminanceAlphaFormat=At,t.LuminanceFormat=Dt,t.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},t.Material=mi,t.MaterialLoader=Wc,t.Math=Pe,t.MathUtils=Pe,t.Matrix3=ke,t.Matrix4=Qe,t.MaxEquation=M,t.Mesh=er,t.MeshBasicMaterial=gi,t.MeshDepthMaterial=to,t.MeshDistanceMaterial=eo,t.MeshFaceMaterial=function(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t},t.MeshLambertMaterial=Pl,t.MeshMatcapMaterial=Rl,t.MeshNormalMaterial=Il,t.MeshPhongMaterial=Ol,t.MeshPhysicalMaterial=Al,t.MeshStandardMaterial=Dl,t.MeshToonMaterial=Ll,t.MinEquation=w,t.MirroredRepeatWrapping=ot,t.MixOperation=U,t.MultiMaterial=function(t){return void 0===t&&(t=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),t.isMultiMaterial=!0,(t.materials=t).clone=function(){return t.slice()},t},t.MultiplyBlending=g,t.MultiplyOperation=G,t.NearestFilter=st,t.NearestMipMapLinearFilter=1005,t.NearestMipMapNearestFilter=1004,t.NearestMipmapLinearFilter=ct,t.NearestMipmapNearestFilter=lt,t.NeverDepth=R,t.NeverStencilFunc=512,t.NoBlending=p,t.NoColors=u,t.NoToneMapping=W,t.NormalBlending=d,t.NotEqualDepth=z,t.NotEqualStencilFunc=517,t.NumberKeyframeTrack=Wl,t.Object3D=yn,t.ObjectLoader=$c,t.ObjectSpaceNormalMap=Se,t.OctahedronBufferGeometry=_s,t.OctahedronGeometry=Ms,t.OneFactor=S,t.OneMinusDstAlphaFactor=O,t.OneMinusDstColorFactor=I,t.OneMinusSrcAlphaFactor=D,t.OneMinusSrcColorFactor=T,t.OrthographicCamera=Vc,t.PCFShadowMap=r,t.PCFSoftShadowMap=a,t.PMREMGenerator=ip,t.ParametricBufferGeometry=vs,t.ParametricGeometry=gs,t.Particle=function(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Io(t)},t.ParticleBasicMaterial=function(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new rs(t)},t.ParticleSystem=function(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new cs(t,e)},t.ParticleSystemMaterial=function(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new rs(t)},t.Path=Lc,t.PerspectiveCamera=yr,t.Plane=Xn,t.PlaneBufferGeometry=Dr,t.PlaneGeometry=Er,t.PlaneHelper=Dh,t.PointCloud=function(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new cs(t,e)},t.PointCloudMaterial=function(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new rs(t)},t.PointLight=jc,t.PointLightHelper=uh,t.Points=cs,t.PointsMaterial=rs,t.PolarGridHelper=gh,t.PolyhedronBufferGeometry=xs,t.PolyhedronGeometry=ys,t.PositionalAudio=Eu,t.PropertyBinding=zu,t.PropertyMixer=Au,t.QuadraticBezierCurve=Tc,t.QuadraticBezierCurve3=Ec,t.Quaternion=Ge,t.QuaternionKeyframeTrack=ql,t.QuaternionLinearInterpolant=Jl,t.REVISION="113",t.RGBADepthPacking=Me,t.RGBAFormat=Et,t.RGBAIntegerFormat=Ft,t.RGBA_ASTC_10x10_Format=ae,t.RGBA_ASTC_10x5_Format=ne,t.RGBA_ASTC_10x6_Format=ie,t.RGBA_ASTC_10x8_Format=re,t.RGBA_ASTC_12x10_Format=oe,t.RGBA_ASTC_12x12_Format=se,t.RGBA_ASTC_4x4_Format=Xt,t.RGBA_ASTC_5x4_Format=Yt,t.RGBA_ASTC_5x5_Format=Zt,t.RGBA_ASTC_6x5_Format=$t,t.RGBA_ASTC_6x6_Format=Kt,t.RGBA_ASTC_8x5_Format=Qt,t.RGBA_ASTC_8x6_Format=te,t.RGBA_ASTC_8x8_Format=ee,t.RGBA_PVRTC_2BPPV1_Format=Jt,t.RGBA_PVRTC_4BPPV1_Format=Wt,t.RGBA_S3TC_DXT1_Format=Vt,t.RGBA_S3TC_DXT3_Format=zt,t.RGBA_S3TC_DXT5_Format=Gt,t.RGBDEncoding=be,t.RGBEEncoding=ge,t.RGBEFormat=Ot,t.RGBFormat=Tt,t.RGBIntegerFormat=Bt,t.RGBM16Encoding=xe,t.RGBM7Encoding=ye,t.RGB_ETC1_Format=qt,t.RGB_PVRTC_2BPPV1_Format=Ht,t.RGB_PVRTC_4BPPV1_Format=Ut,t.RGB_S3TC_DXT1_Format=jt,t.RGFormat=kt,t.RGIntegerFormat=Nt,t.RawShaderMaterial=El,t.Ray=Hn,t.Raycaster=qu,t.RectAreaLight=Hc,t.RedFormat=Pt,t.RedIntegerFormat=Rt,t.ReinhardToneMapping=q,t.RepeatWrapping=rt,t.ReplaceStencilOp=7681,t.ReverseSubtractEquation=b,t.RingBufferGeometry=pl,t.RingGeometry=hl,t.Scene=xn,t.SceneUtils=yp,t.ShaderChunk=Ar,t.ShaderLib=Or,t.ShaderMaterial=gr,t.ShadowMaterial=Tl,t.Shape=Ic,t.ShapeBufferGeometry=gl,t.ShapeGeometry=ml,t.ShapePath=iu,t.ShapeUtils=tl,t.ShortType=mt,t.Skeleton=Vo,t.SkeletonHelper=ch,t.SkinnedMesh=Bo,t.SmoothShading=2,t.Sphere=Nn,t.SphereBufferGeometry=ul,t.SphereGeometry=cl,t.Spherical=Zu,t.SphericalHarmonics3=cu,t.SphericalReflectionMapping=et,t.Spline=gp,t.SplineCurve=Dc,t.SplineCurve3=mp,t.SpotLight=Bc,t.SpotLightHelper=ah,t.SpotLightShadow=Nc,t.Sprite=Io,t.SpriteMaterial=xo,t.SrcAlphaFactor=E,t.SrcAlphaSaturateFactor=P,t.SrcColorFactor=C,t.StaticCopyUsage=35046,t.StaticDrawUsage=Ee,t.StaticReadUsage=35045,t.StereoCamera=mu,t.StreamCopyUsage=35042,t.StreamDrawUsage=35040,t.StreamReadUsage=35041,t.StringKeyframeTrack=Xl,t.SubtractEquation=x,t.SubtractiveBlending=m,t.TOUCH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},t.TangentSpaceNormalMap=_e,t.TetrahedronBufferGeometry=ws,t.TetrahedronGeometry=bs,t.TextBufferGeometry=ll,t.TextGeometry=sl,t.Texture=Fe,t.TextureLoader=cc,t.TorusBufferGeometry=Ps,t.TorusGeometry=Is,t.TorusKnotBufferGeometry=Ls,t.TorusKnotGeometry=Os,t.Triangle=ai,t.TriangleFanDrawMode=2,t.TriangleStripDrawMode=1,t.TrianglesDrawMode=0,t.TubeBufferGeometry=As,t.TubeGeometry=Ds,t.UVMapping=300,t.Uint16Attribute=function(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new _i(t,e)},t.Uint16BufferAttribute=_i,t.Uint32Attribute=function(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Ci(t,e)},t.Uint32BufferAttribute=Ci,t.Uint8Attribute=function(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new bi(t,e)},t.Uint8BufferAttribute=bi,t.Uint8ClampedAttribute=function(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new wi(t,e)},t.Uint8ClampedBufferAttribute=wi,t.Uncharted2ToneMapping=X,t.Uniform=Wu,t.UniformsLib=Cr,t.UniformsUtils=dr,t.UnsignedByteType=dt,t.UnsignedInt248Type=St,t.UnsignedIntType=yt,t.UnsignedShort4444Type=wt,t.UnsignedShort5551Type=Mt,t.UnsignedShort565Type=_t,t.UnsignedShortType=gt,t.VSMShadowMap=o,t.Vector2=Re,t.Vector3=We,t.Vector4=je,t.VectorKeyframeTrack=Yl,t.Vertex=function(t,e,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new We(t,e,n)},t.VertexColors=h,t.VideoTexture=hs,t.WebGLCubeRenderTarget=br,t.WebGLMultisampleRenderTarget=ze,t.WebGLRenderTarget=Ve,t.WebGLRenderTargetCube=function(t,e,n){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new br(t,n)},t.WebGLRenderer=ho,t.WebGLUtils=oo,t.WireframeGeometry=ms,t.WireframeHelper=function(t,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new ns(new ms(t.geometry),new qo({color:void 0!==e?e:16777215}))},t.WrapAroundEnding=pe,t.XHRLoader=function(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new ic(t)},t.ZeroCurvatureEnding=ue,t.ZeroFactor=_,t.ZeroSlopeEnding=he,t.ZeroStencilOp=0,t.sRGBEncoding=fe,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?r(n):"function"==typeof define&&define.amd?define(["exports"],r):r((i=i||self).THREE={})},{}],20:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MrxDbgUtils=void 0;var i,r,a=t("./Operate/MxEntSelJig"),o=t("./Operate/MxJigCmdManager"),s=t("./UI/MxUiVue");(r=i||(n.MrxDbgUtils=i={})).findEntAtPoint=function(t,e,n,i,r){return void 0===n&&(n=null),void 0===i&&(i=!0),new Promise(function(a){if(t.isMxCAD())i||(e=t.screenCoord2Doc(e.x,e.y,e.z)),t.callCommand("MxCAD_FindEntAtPoint",JSON.stringify(e),function(t){if("string"!=typeof t||t.length<1)a([]);else{var e=JSON.parse(t);a(e.ids)}});else{for(var o=t.findMxEntityAtPoint(e,i,r),s=[],l=o.length,c=0;c<l;c++){var u=o[c];if(!n||!n.type||n.type==u.getTypeName()){var h=u.objectId();s.push(h)}}a(s)}})},r.selectEnt=function(t,e){return void 0===e&&(e=null),new Promise(function(n){var i=new a.MxEntSelJig;t&&s.MxUiVue.acutPrintf(t),i.filter=e,i.callRet=function(t){n(t)},o.MxJigCmdManager.runCmd(i)})}},{"./Operate/MxEntSelJig":55,"./Operate/MxJigCmdManager":58,"./UI/MxUiVue":67}],21:[function(t,e,n){"use strict";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 i=t("three"),r=t("../MxFun"),a=t("../MxShader"),o=t("./MxCADNetData"),s=t("../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 i.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 i.Matrix4,this.clipPlans=new l},(u=c||(n.MxCADDisplayMemorySectionType=c={}))[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(t){this.datas.set(t.id,t)},f.prototype.get=function(t){return this.datas.get(t)},f.prototype.remove=function(t){this.datas.delete(t)},f.prototype.has=function(t){return this.datas.has(t)},f.prototype.clearAll=function(){this.datas=new Map},f);function f(){this.datas=new Map}n.MxCADDisplayMemorySections=d;var m=(g.prototype.addColorByLayerMaterial=function(t,e){this.mapColorByLayerMaterial.set(t,e)},g.prototype.upColorToByLayerMaterial=function(t){this.mapColorByLayerMaterial.forEach(function(e){e.uniformsNeedUpdate=!0,e.needsUpdate=!0,e.uniforms={color:{value:t}}})},g.prototype.getId=function(){return this.id},g.prototype.getBlockRecordId=function(){return this.blockRecId},g.prototype.createMemorySectionToEntityArray=function(t){var e=this.mapMemorySectionIdToEntity.get(t);return e||(e=new Array,this.mapMemorySectionIdToEntity.set(t,e),e)},g.prototype.show=function(t){this.mapMemorySectionIdToEntity.forEach(function(e){for(var n in e)e[n].visible=t})},g.prototype.addEntity=function(t,e){this.createMemorySectionToEntityArray(t).push(e)},g.prototype.deleteMemorySectionEntitys=function(t,e){var n=this.mapMemorySectionIdToEntity.get(t);if(!n)return!1;for(var i=n.length,a=0;a<i;a++)r.MxFun.removeThreejsObject(n[a],e);return this.mapMemorySectionIdToEntity.delete(t),this.mapColorByLayerMaterial.delete(t),!0},g.prototype.addClipMaterial=function(t){this.material_clip.push(t)},g.prototype.updataClipMaterial=function(t){for(var e=this.material_clip.length,n=.5*t.width,i=.5*t.height,r=0;r<e;r++)this.material_clip[r].uniforms.vieww.value=n,this.material_clip[r].uniforms.viewh.value=i},g);function g(t,e){this.id=0,this.blockRecId=0,this.mapMemorySectionIdToEntity=new Map,this.mapColorByLayerMaterial=new Map,this.material_clip=[],this.id=t,this.blockRecId=e}n.MxCADDisplayLayerRecord=m;var v=(y.prototype.createLayerRecord=function(t){var e=this.layers.get(t);return e||(e=new m(t,this.blockRecId),this.layers.set(t,e),e)},y.prototype.getLayerRecord=function(t){return this.layers.get(t)},y);function y(t){this.blockRecId=0,this.layers=new Map,this.blockRecId=t}n.MxCADDisplayLayerTable=v;var x=(b.prototype.getId=function(){return this.id},b.prototype.addBlkRef=function(t){this.blkRefs.set(t.id,t)},b.prototype.getAllBlkRef=function(){return this.blkRefs},b.prototype.addInstance=function(t){this.blkInstances.push(t)},b.prototype.deleteAllInstance=function(){this.blkInstances=new Array},b.prototype.deleteBlkRef=function(){this.blkRefs=new Map},b.prototype.getLayerTable=function(){return this.layerTable},b.prototype.getInstances=function(){return this.blkInstances},b.prototype.getInstances_class=function(){for(var t=[],e=new Map,n=this.blkInstances.length,i=0;i<n;i++){var r=this.blkInstances[i];if(0==r.clipPlans.clipPlanArray.length)t.push(r);else{var a=e.get(r.clipPlans.id);null==a&&(a=[],e.set(r.clipPlans.id,a)),a.push(r)}}var o={};return o.aryInstanceNoClip=t,o.mapInstanceClip=e,o},b);function b(t){this.id=0,this.blkRefs=new Map,this.blkInstances=new Array,this.id=t||0,this.layerTable=new v(this.id)}n.MxCADDisplayBlockRecord=x;var w=(M.prototype.crateBlockRecord=function(t){var e=this.blocks.get(t);return null==e&&(e=new x(t),this.blocks.set(t,e)),e},M.prototype.getBlockRecord=function(t){return this.blocks.get(t)},M.prototype.getAllBlockRecord=function(){return this.blocks},M.prototype.reInitData=function(t){this.blocks=new Map,this.curSpaceBlockRecId=t||0,this.crateBlockRecord(this.curSpaceBlockRecId)},M);function M(){this.blocks=new Map,this.curSpaceBlockRecId=0}n.MxCADDisplayBlockTable=w;var _=function(){};n.MxCADLayerTableRecord=_;var S=(C.prototype.add=function(t,e,n,i){var r=new _;r.id=t,r.name=n,r.color=e,r.off=i,this.mapData.set(t,r)},C.prototype.getAllLayerData=function(){for(var t,e=new Array,n=this.mapData.values();!(t=n.next()).done;){var i=new _;i.color=t.value.color,i.name=t.value.name,i.off=t.value.off,i.id=t.value.id,e.push(i)}return e},C.prototype.setZeroLayerId=function(t){this.zeroLayerId=t},C.prototype.getZeroLayerId=function(){return this.zeroLayerId},C.prototype.getLayerIdForName=function(t){for(var e,n=this.mapData.values();!(e=n.next()).done;)if(e.value.name==t)return e.value.id;return 0},C.prototype.getColor=function(t){var e=this.mapData.get(t);return e?e.color:0},C.prototype.getRecord=function(t){return this.mapData.get(t)},C.prototype.isOff=function(t){var e=this.mapData.get(t);return!e||e.off},C.prototype.upDisplayForLayerData=function(t,e){for(var n,i=e,r=i.length,a=!1,o=function(e){var r=i[e],o=r.id;if(0==o)return"continue";var l=s.getRecord(o);if(!l)return"continue";var c=r.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),t.getDisplayBlockTable().getAllBlockRecord().forEach(function(t){var e=t.getLayerTable().getLayerRecord(o);e&&e.upColorToByLayerMaterial(n)}),a=!0},s=this,l=0;l<r;l++)o(l);var c=function(e){var n=i[e],r=n.id;if(0==r)return"continue";var o=u.getRecord(r);return o&&o.off!=n.off?(o.off=n.off,t.getDisplayBlockTable().getAllBlockRecord().forEach(function(t){var e=t.getLayerTable().getLayerRecord(r);e&&e.show(!o.off)}),void(a=!0)):"continue"},u=this;for(l=0;l<r;l++)c(l);return a},C);function C(){this.mapData=new Map,this.zeroLayerId=0}n.MxCADLayerTable=S;var T,E,D=(A.prototype.initRootBlockRef=function(t){t?this.dpRootBlkRef=t:(this.dpRootBlkRef=new h,this.dpRootBlkRef.mat=new i.Matrix4,this.dpRootBlkRef.blkRecId=0,this.dpRootBlkRef.blkOwnerId=-1,this.dpRootBlkRef.layerId=-1,this.dpRootBlkRef.color=16777215,this.dpRootBlkRef.id=0)},A.prototype.reInit=function(){this.dpBlockTable=new w,this.layerTable=new S,this.memSections=new d,this.initRootBlockRef()},A.prototype.getMxObj=function(){return this.mxObj},A.prototype.getDisplayRootBlockRef=function(){return this.dpRootBlkRef},A.prototype.getDisplayBlockTable=function(){return this.dpBlockTable},A.prototype.getLayerTable=function(){return this.layerTable},A.prototype.getMemSections=function(){return this.memSections},A);function A(t){this.dpBlockTable=new w,this.dpRootBlkRef=null,this.layerTable=new S,this.memSections=new d,this.mxObj=null,this.mxObj=t,this.initRootBlockRef()}n.MxCADDatabase=D,(E=T||(n.MxCADDisplayFun=T={})).showLayer=function(t,e,n){t.getDisplayBlockTable().getAllBlockRecord().forEach(function(t){var i=t.getLayerTable().getLayerRecord(e);i&&i.show(n)})},E.createThreejsObjForMemData_Clip=function(t,e,n,r,o,l,u){if(0==t.length)return!1;var h=[],p=[],d=t[0].clipPlans.clipPlanArray[0];h.push(d.x1,d.y1),p.push(d.x2,d.y2);for(var f=[],m=[],g=[],v=[],y=[],x=0;x<t.length;x++){var b=t[x];f=f.concat(b.mat.elements.slice(0,4)),m=m.concat(b.mat.elements.slice(4,8)),g=g.concat(b.mat.elements.slice(8,12)),v=v.concat(b.mat.elements.slice(12,16)),y.push(0)}var w=e.color,M=16777216==(4278190080&w);M&&(w=o);var _=[];_.push(255&w,(65280&w)>>8,(16711680&w)>>16);var S=u.getCanvas(),C=.5*S.width,T=.5*S.height;if(e.type==c.kLinesType){var E=new i.RawShaderMaterial({uniforms:{color:{value:_},clippt1:{value:h},clippt2:{value:p},vieww:{value:C},viewh:{value:T}},vertexShader:a.MxShader.VSHADER_COLOR_POINT_CLIP_FORMXCAD,fragmentShader:a.MxShader.FSHADER_COLOR_POINT_CLIP_FORMXCAD,linewidth:1,transparent:!0,side:i.DoubleSide});n.addClipMaterial(E),(A=new i.InstancedBufferGeometry).maxInstancedCount=t.length,A.setAttribute("position",new i.Float32BufferAttribute(e.points,2)),A.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(f),4)),A.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(m),4)),A.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(g),4)),A.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(v),4)),A.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(y),1));var D=new i.LineSegments(A,E);D.frustumCulled=!1,D.renderOrder=s.MxData.iCADCurveRenderOrder,r.add(D),n.addEntity(e.id,D),M&&n.addColorByLayerMaterial(e.id,E)}else if(e.type==c.kTriangleType){var A;E=new i.RawShaderMaterial({uniforms:{color:{value:_},clippt1:{value:h},clippt2:{value:p},vieww:{value:C},viewh:{value:T}},vertexShader:a.MxShader.VSHADER_COLOR_POINT_CLIP_FORMXCAD,fragmentShader:a.MxShader.FSHADER_COLOR_POINT_CLIP_FORMXCAD,transparent:!0,side:i.DoubleSide}),n.addClipMaterial(E),(A=new i.InstancedBufferGeometry).maxInstancedCount=t.length,A.setAttribute("position",new i.Float32BufferAttribute(e.points,2)),A.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(f),4)),A.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(m),4)),A.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(g),4)),A.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(v),4)),A.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(y),1));var O=new i.Mesh(A,E);O.frustumCulled=!1,O.renderOrder=s.MxData.iCADMeshRenderOrder,r.add(O),n.addEntity(e.id,O),M&&n.addColorByLayerMaterial(e.id,E)}},E.createThreejsObjForMemData=function(t,e,n,r,o,l){if(0==t.length)return!1;for(var u=[],h=[],p=[],d=[],f=[],m=0;m<t.length;m++){var g=t[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=e.color,y=16777216==(4278190080&v);y&&(v=o);var x=[];if(x.push((255&v)/255,(v>>8&255)/255,(v>>16&255)/255),e.type==c.kLinesType){var b=new i.RawShaderMaterial({uniforms:{color:{value:x}},vertexShader:a.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:a.MxShader.FSHADER_COLOR_POINT_FORMXCAD,linewidth:1,transparent:!0,side:i.DoubleSide});(M=new i.InstancedBufferGeometry).maxInstancedCount=t.length,M.setAttribute("position",new i.Float32BufferAttribute(e.points,2)),M.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(u),4)),M.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(h),4)),M.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(p),4)),M.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(d),4)),M.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(f),1));var w=new i.LineSegments(M,b);w.frustumCulled=!1,w.renderOrder=s.MxData.iCADCurveRenderOrder,w.visible=!l,r.add(w),n.addEntity(e.id,w),y&&n.addColorByLayerMaterial(e.id,b)}else if(e.type==c.kTriangleType){var M;b=new i.RawShaderMaterial({uniforms:{color:{value:x}},vertexShader:a.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:a.MxShader.FSHADER_COLOR_POINT_FORMXCAD,transparent:!0,side:i.DoubleSide}),(M=new i.InstancedBufferGeometry).maxInstancedCount=t.length,M.setAttribute("position",new i.Float32BufferAttribute(e.points,2)),M.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(u),4)),M.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(h),4)),M.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(p),4)),M.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(d),4)),M.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(f),1));var _=new i.Mesh(M,b);_.frustumCulled=!1,_.renderOrder=s.MxData.iCADMeshRenderOrder,_.visible=!l,r.add(_),n.addEntity(e.id,_),y&&n.addColorByLayerMaterial(e.id,b)}};var O=(L.prototype.upDisplayFromChage_memData=function(t){var e=this.database.getDisplayBlockTable().getBlockRecord(t.blockId);if(null==e)return!1;var n=this.database.getLayerTable().getColor(t.layerId),i=this.database.getLayerTable().isOff(t.layerId),r=e.getLayerTable().createLayerRecord(t.layerId),a=this.mxObj.getScene(),o=e.getInstances_class();r.deleteMemorySectionEntitys(t.id,a);var s=o.aryInstanceNoClip,l=o.mapInstanceClip;0<s.length&&T.createThreejsObjForMemData(s,t,r,a,n,i);for(var c=l.values(),u=c.next();!u.done;){var h=u.value;T.createThreejsObjForMemData_Clip(h,t,r,a,n,i,this.mxObj),u=c.next()}},L.prototype.upDisplayFromChage=function(t){for(var e=t.length,n=0;n<e;n++){var i=t[n];this.upDisplayFromChage_memData(i)}},L.prototype.OnMessageDisplayMemorySectionsFromChange=function(t){for(var e=this.database.getMemSections(),n=new o.MxCADNetData(t),i=n.getMxCADPointMemorySectionsHeadFromChange(),r=i.nOffset,a=[],s=0;s<i.datacount;s++){var l=n.getMxCADPointMemorySectionHeadFromChange(r);r=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=t.getFloat32(r,!0);r+=4;var m=t.getFloat32(r,!0);r+=4,h.push(f,m)}c.points=h,e.add(c),a.push(c)}}this.upDisplayFromChage(a)},L.prototype.deleteMemorySectionAndEntity=function(t){var e=this.database.getMemSections(),n=e.get(t);if(!n)return!1;var i=this.database.getDisplayBlockTable().getBlockRecord(n.blockId);if(null==i)return e.remove(n.id),console.log("mx:blkrec null assert(0)"),!1;var r=i.getLayerTable().createLayerRecord(n.layerId),a=this.mxObj.getScene();return r.deleteMemorySectionEntitys(n.id,a),e.remove(n.id),!0},L.prototype.OnMessageDisplayNotUseMemorySectionsForChage=function(t){for(var e=new o.MxCADNetData(t).getMxCADNotUseMemorySectionsHeadForChage(),n=e.nCount,i=e.nOffset,r=0;r<n;r++){var a=t.getInt32(i,!0);i+=4,this.deleteMemorySectionAndEntity(a)}},L);function L(t){this.database=null,this.mxObj=null,this.database=t,this.mxObj=t.getMxObj()}n.MxCADSyncDisplay=O},{"../MxFun":34,"../MxManager":36,"../MxShader":40,"./MxCADNetData":23,three:19}],22:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADGripJig=n.MxCADGrip=n.MxCADGripData=void 0;var a=t("three"),o=t("../MxFun"),s=t("../MxThreeJS"),l=t("../Operate/MxJig"),c=t("../Operate/MxJigCmdManager"),u=t("../MxManager"),h=t("../MxDrawData"),p=function(){this.threeObject=null};n.MxCADGripData=p;var d=(f.prototype.getParentObject=function(){return this.mxObj.getTheTempDrawContainer()},f.prototype.removeAllEntity=function(){var t=this.getParentObject();this.mapGrips.forEach(function(e,n,i){for(var r=e.length,a=0;a<r;a++){var s=e[a];o.MxFun.removeThreejsObject(s.threeObject,t)}}),this.mapGrips=new Map},f.prototype.deleteGripData=function(t){var e=this.getParentObject(),n=this.mapGrips.get(t);if(n)for(var i=n.length,r=0;r<i;r++){var a=n[r];o.MxFun.removeThreejsObject(a.threeObject,e)}this.mapGrips.delete(t)},f.prototype.deleteEntityData=function(t){this.mapEntityData.delete(t)},f.prototype.addGripData=function(t,e,n,i){var r=this.mapGrips.get(t);null==r&&(r=new Array,this.mapGrips.set(t,r));var o=new p;return o.iIndex=e,o.point=new a.Vector3(n,i,0),r.push(o),o},f.prototype.createGripDisplayObject=function(t){var e=this.getParentObject();t.geometry=new a.Geometry;var n=this.mxObj.screenCoordLong2Doc(h.MxDrawData.m_dGridWidth/2);t.geometry.vertices.push(new a.Vector3(t.point.x-n,t.point.y-n,0)),t.geometry.vertices.push(new a.Vector3(t.point.x-n,t.point.y+n,0)),t.geometry.vertices.push(new a.Vector3(t.point.x+n,t.point.y+n,0)),t.geometry.vertices.push(new a.Vector3(t.point.x+n,t.point.y-n,0)),t.geometry.faces.push(new a.Face3(0,1,2)),t.geometry.faces.push(new a.Face3(2,3,0)),t.geometry.computeFaceNormals(),t.geometry.computeVertexNormals();var i=new a.MeshBasicMaterial({color:255,transparent:!0,depthTest:!1,side:a.DoubleSide,opacity:.9}),r=new a.Mesh(t.geometry,i);r.renderOrder=u.MxData.iGripRenderOrder,e.add(r),t.threeObject=r},f.prototype.clearAll=function(){return this.mapEntityData=new Map,0!=this.mapGrips.size&&(this.removeAllEntity(),!0)},f.prototype.addEntityData=function(t,e){this.mapEntityData.set(t,e)},f.prototype.onIntelliSelect=function(t){for(var e=JSON.parse(t),n=e.vecEntityData.length,i=0;i<n;i++){var r=e.vecEntityData[i],a=r.lIdIndex;this.addEntityData(a,r.entity),this.deleteGripData(a);for(var o=r.vecGrip.length,s=0;s<o;s++){var l=r.vecGrip[s],c=this.addGripData(a,l.iIndex,l.ptx,l.pty);this.createGripDisplayObject(c)}}},f.prototype.onControlsChage=function(){if(0!=this.mapGrips.size){var t=this.mxObj.screenCoordLong2Doc(8);this.mapGrips.forEach(function(e,n,i){for(var r=e.length,a=0;a<r;a++){var o=e[a];4==o.geometry.vertices.length&&(o.geometry.vertices[0].x=o.point.x-t,o.geometry.vertices[0].y=o.point.y-t,o.geometry.vertices[1].x=o.point.x-t,o.geometry.vertices[1].y=o.point.y+t,o.geometry.vertices[2].x=o.point.x+t,o.geometry.vertices[2].y=o.point.y+t,o.geometry.vertices[3].x=o.point.x+t,o.geometry.vertices[3].y=o.point.y-t,o.geometry.computeFaceNormals(),o.geometry.computeVertexNormals(),o.geometry.verticesNeedUpdate=!0)}})}},f.prototype.hitTest=function(t){var e={grips:new Array,ids:new Array,pt:t},n=new a.Vector3(t.x,t.y,0),i=this.mxObj.screenCoordLong2Doc(32);return this.mapGrips.forEach(function(t,r){for(var a=t.length,o=0;o<a;o++){var s=t[o];if(s.point.distanceTo(n)<=i){e.grips.push(s),e.ids.push(r);break}}}),e},f.prototype.onMouseLBDown=function(t){var e=this.hitTest(t);return 0!=e.grips.length&&(o.MxFun.sendStringToExecute("Mx_GripEdit",e),!0)},f.prototype.gripEditImp=function(t){var e=t.grips,n=t.ids,i=t.pt,r=new g(i,e,n,this.mapEntityData);r.setDisableDynInput(!0),r.setDisableOsnap(!0),c.MxJigCmdManager.runCmd(r)},f);function f(t){this.mxObj=null,this.mapGrips=new Map,this.mapEntityData=new Map,this.mxObj=t}n.MxCADGrip=d;var m,g=(r(v,m=l.McEdJigCommand),v.prototype.sampler=function(){var t=c.MxJigCmdManager.InType.kGetBegan,e=this.acquirePoint(t);return e.status==c.MxJigCmdManager.DragStatus.kNormal&&(this.currPt=e.pt),e.status},v.prototype.getTypeName=function(){return"MxGripEdit"},v.prototype.done=function(t){if(t==c.MxJigCmdManager.DragStatus.kNormal){var e=[];e.push(this.currPt.x,this.currPt.y);for(var n=this.getMxObject(),i=n.getMxCAD().getGrip(),r=n.getMxCAD().getSelect(),a=this.grips.length,o=0;o<a;o++){var s=this.grips[o],l=this.ids[o];e.push(l,s.iIndex),i.deleteGripData(l),i.deleteEntityData(l),r.removeAllEntity()}n.callCommand("MxCAD_GridEdit",JSON.stringify(e),function(t){i.onIntelliSelect(t)})}return c.MxJigCmdManager.DoneStatius.kExitCommand},v.prototype.upDisplay_Line=function(t,e){var n=new a.Vector3(t.pt1x,t.pt1y,0),i=new a.Vector3(t.pt2x,t.pt2y,0);if(0==e.iIndex)n.x=this.currPt.x,n.y=this.currPt.y;else if(1==e.iIndex)i.x=this.currPt.x,i.y=this.currPt.y;else if(2==e.iIndex){var r=i.x+.5*(n.x-i.x),o=i.y+.5*(n.y-i.y),l=this.currPt.x-r,c=this.currPt.y-o;n.x+=l,n.y+=c,i.x+=l,i.y+=c}var u=s.MxThreeJS.createLine(n,i,16777215);this.drawEntity(u,31)},v.prototype.upDisplay=function(){for(var t=this.grips.length,e=0;e<t;e++){var n=this.grips[e],i=this.ids[e],r=this.mapEntityData.get(i);r&&"McDbLine"==r.name&&this.upDisplay_Line(r,n)}},v);function v(t,e,n,i){var r=m.call(this)||this;return r.pt=t,r.grips=e,r.ids=n,r.currPt=t,r.mapEntityData=i,r}n.MxCADGripJig=g},{"../MxDrawData":29,"../MxFun":34,"../MxManager":36,"../MxThreeJS":44,"../Operate/MxJig":57,"../Operate/MxJigCmdManager":58,three:19}],23:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADNetData=void 0;var i=(r.prototype.getBlobHead=function(t){var e={};return e.type=this._dataView.getInt32(t,!0),t+=4,e.ver=this._dataView.getInt32(t,!0),t+=4,e.databaseIndex=this._dataView.getInt32(t,!0),t+=4,e.nOffset=t,e},r.prototype.getMxCADPointMemorySectionsHead=function(){var t=this.getBlobHead(0);return t.zeroLayerIdIndex=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datacount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},r.prototype.getMxCADPointMemorySectionsHeadFromChange=function(){var t=this.getBlobHead(0);return t.zeroLayerIdIndex=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datacount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},r.prototype.getMxCADPointMemorySectionHead=function(t){var e=this.getBlobHead(t);return t=e.nOffset,e.pointCount=this._dataView.getInt32(t,!0),t+=4,e.layerId=this._dataView.getInt32(t,!0),t+=4,e.blkId=this._dataView.getInt32(t,!0),t+=4,e.memColor=this._dataView.getInt32(t,!0),t+=4,e.memId=this._dataView.getInt32(t,!0),t+=4,e.memType=this._dataView.getInt32(t,!0),t+=4,e.offset=t,e},r.prototype.getMxCADPointMemorySectionHeadFromChange=function(t){var e=this.getBlobHead(t);return t=e.nOffset,e.pointCount=this._dataView.getInt32(t,!0),t+=4,e.layerId=this._dataView.getInt32(t,!0),t+=4,e.blkId=this._dataView.getInt32(t,!0),t+=4,e.memColor=this._dataView.getInt32(t,!0),t+=4,e.memId=this._dataView.getInt32(t,!0),t+=4,e.memType=this._dataView.getInt32(t,!0),t+=4,e.offset=t,e},r.prototype.getMxCADBlockRefsHead=function(){var t=this.getBlobHead(0);return t.nBlockRefCount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},r.prototype.getMxCADNotUseMemorySectionsHeadForChage=function(){var t=this.getBlobHead(0);return t.nCount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},r.prototype.getEntityDisplayDatasHead=function(){var t=this.getBlobHead(0);return t.nCount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},r.prototype.getEntityDisplayDataHead=function(t){var e=this.getBlobHead(t);return e.nCount=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.type=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.datasize=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.datasize!=e.nOffset-t&&console.log("mx: sectionshead size assert(0)"),e},r);function r(t){this._dataView=t}n.MxCADNetData=i},{}],24:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADObject=void 0;var i=t("./MxCADEditDisplay"),r=t("./MxCADOpenDisplay"),a=t("./MxCADSelect"),o=t("./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(t,e){var n=this;this.reInit(),this._openFile=t,this.mxObj.callCommand("MxCAD_OpenFile",JSON.stringify({file:t}),function(t){n.mxObj.callCommand("MxCAD_SendDisplay"),"string"!=typeof t||t.length<1?e&&e({}):e&&e(JSON.parse(t))})},l.prototype.saveFile=function(t,e){this.mxObj.callCommand("MxCAD_SaveFile",JSON.stringify({file:t}),function(t){e(JSON.parse(t))})},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(t){this._openFile="",this.mxObj=null,this.databsae=null,this.openDisplay=null,this.syncDisplay=null,this.select=null,this.grip=null,this.mxObj=t,this.databsae=new i.MxCADDatabase(t),this.openDisplay=new r.MxCADOpenDisplay(this.databsae),this.syncDisplay=new i.MxCADSyncDisplay(this.databsae),this.select=new a.MxCADSelect(t),this.grip=new o.MxCADGrip(t)}n.MxCADObject=s},{"./MxCADEditDisplay":21,"./MxCADGrip":22,"./MxCADOpenDisplay":25,"./MxCADSelect":26}],25:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADOpenDisplay=void 0;var i=t("three"),r=t("./MxCADNetData"),a=t("./MxCADEditDisplay"),o=(s.prototype.createAllInstanceCall=function(t,e,n,r,o){if(!r.get(t.getId())){r.set(t.getId(),!0);var s=new a.MxCADDisplayBlockInstance;if(s.mat=new i.Matrix4,s.mat.copy(n),s.idBlkRef=e.id,s.mat.multiply(e.mat),0==e.clipPlans.clipPlanArray.length)s.clipPlans=o;else{s.clipPlans=e.clipPlans;for(var l=s.clipPlans.clipPlanArray.length,c=0;c<l;c++){var u=new i.Vector3(s.clipPlans.clipPlanArray[c].x1,s.clipPlans.clipPlanArray[c].y1,0),h=new i.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}}t.addInstance(s);for(var p=this.database.getDisplayBlockTable(),d=t.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,r,s.clipPlans),f=d.next())}}r.set(t.getId(),!1)}},s.prototype.deleteAllInstance=function(){for(var t=this.database.getDisplayBlockTable().getAllBlockRecord().values(),e=t.next();!e.done;)e.value.deleteAllInstance(),e=t.next()},s.prototype.createAllInstance=function(){this.deleteAllInstance();var t=this.database.getDisplayBlockTable().getBlockRecord(0);if(null==t)return!1;var e=this.database.getDisplayRootBlockRef(),n=new i.Matrix4,r=new Map,o=new a.MxCADDisplayClipPlans;return this.createAllInstanceCall(t,e,n,r,o),this.isCreateInstance=!0},s.prototype.creteDisplayForMemData=function(t){var e=this.database.getDisplayBlockTable().getBlockRecord(t.blockId);if(null==e)return!1;var n=e.getLayerTable().createLayerRecord(t.layerId),i=this.database.getLayerTable().getColor(t.layerId),r=this.database.getLayerTable().isOff(t.layerId),o=this.mxObj.getScene(),s=e.getInstances_class(),l=s.aryInstanceNoClip,c=s.mapInstanceClip;0<l.length&&a.MxCADDisplayFun.createThreejsObjForMemData(l,t,n,o,i,r);for(var u=c.values(),h=u.next();!h.done;){var p=h.value;a.MxCADDisplayFun.createThreejsObjForMemData_Clip(p,t,n,o,i,r,this.mxObj),h=u.next()}},s.prototype.creteDisplayForNewData=function(){if(this.isCreateInstance||this.isGetDisplayBlockRef&&this.isGetLayerTable&&this.createAllInstance(),this.isCreateInstance){for(var t=this.vecNewCreateDisplayData.length,e=0;e<t;e++){var n=this.vecNewCreateDisplayData[e];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(t){var e=this.database.getLayerTable(),n=JSON.parse(t);if(null!=n){var i=n.list;for(var r in i)e.add(i[r].id,i[r].colorvalue,i[r].name,1==i[r].off),1==i[r].zerolayer&&e.setZeroLayerId(i[r].id)}this.isGetLayerTable=!0,this.creteDisplayForNewData()},s.prototype.OnMessageDisplayBlockRef=function(t){var e=this.database.getDisplayBlockTable();e.reInitData(),this.isCreateInstance=!1;for(var n=new r.MxCADNetData(t).getMxCADBlockRefsHead(),o=n.nBlockRefCount,s=n.nOffset,l=1,c=0;c<o;c++){var u=t.getInt32(s,!0);s+=4;var h=t.getInt32(s,!0);s+=4;var p=t.getInt32(s,!0);s+=4;var d=t.getInt32(s,!0);s+=4;var f=t.getInt32(s,!0);s+=4;for(var m=new Array,g=0;g<16;g++){var v=t.getFloat32(s,!0);s+=4,m.push(v)}var y=t.getInt32(s,!0);s+=4;var x=new a.MxCADDisplayClipPlans;x.id=l,l++,x.clipPlanArray=[];for(var b=0;b<y;b++){var w=t.getFloat32(s,!0);s+=4;var M=t.getFloat32(s,!0);s+=4;var _=t.getFloat32(s,!0);s+=4;var S=t.getFloat32(s,!0);s+=4;var C=new a.MxCADDisplayClipPlan;C.x1=w,C.y1=M,C.x2=_,C.y2=S,x.clipPlanArray.push(C)}var T=new a.MxCADDisplayBlockRef;T.mat=new i.Matrix4,T.mat.fromArray(m),T.blkRecId=d,T.blkOwnerId=h,T.layerId=p,T.color=f,T.clipPlans=x,T.id=u,e.crateBlockRecord(d),e.crateBlockRecord(h);var E=e.getBlockRecord(h);E?E.addBlkRef(T):console.log("ownerBlkRec == null,assert(0)")}this.isGetDisplayBlockRef=!0,this.creteDisplayForNewData()},s.prototype.OnMessageDisplayMemorySections=function(t){for(var e=this.database.getMemSections(),n=new r.MxCADNetData(t),i=n.getMxCADPointMemorySectionsHead(),o=i.nOffset,s=0;s<i.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=t.getFloat32(o,!0);o+=4;var f=t.getFloat32(o,!0);o+=4,h.push(d,f)}c.points=h,e.add(c),this.vecNewCreateDisplayData.push(c)}}this.creteDisplayForNewData()},s);function s(t){this.database=null,this.isGetDisplayBlockRef=!1,this.isCreateInstance=!1,this.isGetLayerTable=!1,this.vecNewCreateDisplayData=[],this.mxObj=null,this.database=t,this.mxObj=t.getMxObj()}n.MxCADOpenDisplay=o},{"./MxCADEditDisplay":21,"./MxCADNetData":23,three:19}],26:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADSelect=n.MxCADSelectDisplayEntityData=n.MxCADSelectDisplayEntityDataType=void 0;var i,r,a=t("three"),o=t("../MxFun"),s=t("three.meshline"),l=t("./MxCADNetData"),c=t("../MxManager");(r=i||(n.MxCADSelectDisplayEntityDataType=i={}))[r.kLinesType=1]="kLinesType",r[r.kTriangleType=2]="kTriangleType";var u=function(){this.type=i.kLinesType,this.points=[]};n.MxCADSelectDisplayEntityData=u;var h=(p.prototype.getParentObject=function(){return this.mxObj.getScene()},p.prototype.removeAllEntity=function(){for(var t=this.getParentObject(),e=this.aryThreeObject.length,n=0;n<e;n++)o.MxFun.removeThreejsObject(this.aryThreeObject[n],t);this.aryThreeObject=[]},p.prototype.clearAllSelect=function(t){return void 0===t&&(t=!0),t&&this.mxObj.callCommand("MxCAD_ClearSelect"),0!=this.aryThreeObject.length&&(this.removeAllEntity(),!0)},p.prototype.OnMessageEntityDisplayDatas=function(t){for(var e=new l.MxCADNetData(t),n=e.getEntityDisplayDatasHead(),r=n.nOffset,o=[],h=0;h<n.nCount;h++){var p=e.getEntityDisplayDataHead(r);r=p.nOffset,(_=new u).type=p.type;var d=p.nCount;if(!(d<1)){for(var f=[],m=0;m<d;m+=2){var g=t.getFloat32(r,!0);r+=4;var v=t.getFloat32(r,!0);r+=4,f.push(g,v)}_.points=f,o.push(_)}}var y=this.mxObj.getViewWidth(),x=this.mxObj.getViewHeight();this.material.resolution=new a.Vector2(y,x);for(var b=o.length,w=this.getParentObject(),M=0;M<b;M++){var _;if((_=o[M]).type==i.kLinesType)for(var S=_.points.length,C=0;C+3<S;C+=4){var T=new Float32Array(6);T[0]=_.points[C],T[1]=_.points[C+1],T[2]=0,T[3]=_.points[C+2],T[4]=_.points[C+3],T[5]=0;var E=new s.MeshLine;E.setGeometry(T);var D=new a.Mesh(E.geometry,this.material);D.renderOrder=c.MxData.iSelectRenderOrder,w.add(D),this.aryThreeObject.push(D)}else if(_.type==i.kTriangleType){S=_.points.length;var A=new a.Geometry,O=0;for(C=0;C+5<S;C+=6){var L=new a.Vector3(_.points[C],_.points[C+1],0),I=new a.Vector3(_.points[C+2],_.points[C+3],0),P=new a.Vector3(_.points[C+4],_.points[C+5],0);A.vertices.push(L),A.vertices.push(I),A.vertices.push(P);var R=new a.Face3(O,O+1,O+2);A.faces.push(R),O+=3}var k=new a.Mesh(A,this.materialFill);k.renderOrder=c.MxData.iSelectRenderOrder,w.add(k),this.aryThreeObject.push(k)}}},p);function p(t){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=t}n.MxCADSelect=h},{"../MxFun":34,"../MxManager":36,"./MxCADNetData":23,three:19,"three.meshline":18}],27:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxCadSketchLayers=n.MxCadSketchLayer=void 0;var i=(r.prototype.addEntity=function(t){this._setEntityId.add(t)},r.prototype.getId=function(){return this.id},r.prototype.setId=function(t){this.id=t},r.prototype.removeEntity=function(t){this._setEntityId.delete(t)},r.prototype.show=function(t){var e=this;this._setEntityId.forEach(function(n){var i=e._mxobj.getEntity(n);if(null!=i)for(var r=0,a=i.length;r<a;r++)i[r].visible=t})},r);function r(t){this._setEntityId=new Set,this.id=0,this._mxobj=null,this._mxobj=t}n.MxCadSketchLayer=i;var a=(o.prototype.getLayer=function(t,e){void 0===e&&(e=!0);var n=this._mapId2Layers.get(t);return null==n&&((n=new i(this._mxobj)).setId(t),this._mapId2Layers.set(t,n)),n},o.prototype.addEntity=function(t,e){this.getLayer(e).addEntity(t)},o.prototype.removeEntity=function(t){this._mapId2Layers.forEach(function(e){e.removeEntity(t)})},o.prototype.removeAllEntity=function(){this._mapId2Layers.clear()},o);function o(t){this._mxobj=null,this._mapId2Layers=new Map,this._mxobj=t}n.MxCadSketchLayers=a},{}],28:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawCommands=void 0;var i,r=t("./MxFun"),a=t("./MxType"),o=t("./Operate/MxIntelliSelect"),s=t("./Operate/MxJigCmdManager"),l=t("./MxWindowsEvent"),c=t("./MxDrawData");function u(t){if(null!=t&&null!=t.pt1){var e=new o.MxIntelliSelectJig(t.pt1,!1);e.setDisableDynInput(!0),e.setDisableOsnap(!0);var n=t.pt1,i=r.MxFun.getCurrentMx();if(!c.MxDrawData.m_isMultipleSelect){var a=i.getMxCAD();a.getSelect().clearAllSelect(),a.getGrip().clearAll(),i.getMcObject().isValid()&&i.getMcObject().getGripManager().clearAll()}e.doPointSelect(r.MxFun.getCurrentMx(),t.pt1,function(t){if(0!=JSON.parse(t).lCount&&(i.getMxCAD().getGrip().onIntelliSelect(t),c.MxDrawData.m_isMultipleSelect)){var e=l.MxWindowsEvent.getCurrentMousePostion();if(i.screenCoord2Doc(e.x,e.y,0).distanceTo(n)<i.screenCoordLong2Doc(10)){var r=s.MxJigCmdManager.getCurCmd();r&&"MxIntelliSelect"==r.getTypeName()&&s.MxJigCmdManager.stopCmd()}}}),c.MxDrawData.m_isMultipleSelect&&s.MxJigCmdManager.runCmd(e)}}function h(t){null!=t&&null!=t.grips&&null!=t.ids&&r.MxFun.getCurrentMx().getMxCAD().getGrip().gripEditImp(t)}function p(t){null!=t&&null!=t.grips&&null!=t.ids&&r.MxFun.getCurrentMx().getMcObject().getGripManager().gripEditImp(t)}function d(t){if(null!=t&&null!=t.pt){var e=r.MxFun.getCurrentMx(),n=t.pt;if(!e.getMxDatabase().getGripManager().doPointSelect(n)){var i=!0;if(e.isValidMcObject()&&e.getMcObject().getGripManager().doPointSelect(n)&&(i=!1),i&&c.MxDrawData.m_isMultipleSelect){var a=e.screenCoord2Doc(n.x,n.y,0),l=new o.MxIntelliSelectJig(a,!0);l.setDisableDynInput(!0),l.setDisableOsnap(!0),s.MxJigCmdManager.runCmd(l)}}}}function f(t){null!=t&&null!=t.grips&&null!=t.ents&&r.MxFun.getCurrentMx().getMxDatabase().getGripManager().gripEditImp(t)}(i||(n.MxDrawCommands=i={})).registerCommand=function(){r.MxFun.addCommand("Mx_IntelliSel",u,a.MxType.CommandFlags.MCRX_CMD_TRANSPARENT),r.MxFun.addCommand("Mx_GripEdit",h,a.MxType.CommandFlags.MCRX_CMD_TRANSPARENT),r.MxFun.addCommand("McDraw_GripEdit",p,a.MxType.CommandFlags.MCRX_CMD_TRANSPARENT),r.MxFun.addCommand("Mx_FrontEndWebpageIntelliSel",d,a.MxType.CommandFlags.MCRX_CMD_TRANSPARENT),r.MxFun.addCommand("Mx_FrontEndWebpageGripEdit",f,a.MxType.CommandFlags.MCRX_CMD_TRANSPARENT)}},{"./MxDrawData":29,"./MxFun":34,"./MxType":46,"./MxWindowsEvent":48,"./Operate/MxIntelliSelect":56,"./Operate/MxJigCmdManager":58}],29:[function(t,e,n){"use strict";var i,r;Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawData=void 0,(r=i||(n.MxDrawData=i={})).m_isEnableIntelliSelect=!1,r.m_isEnableGripEidt=!0,r.m_isMultipleSelect=!0,r.m_isAutoResetRenderer=!1,r.m_isCorrectLargeCoordinates=!1,r.m_isRequestHeaderCacheControl=!1,r.m_dGridWidth=16,r.getCursorWidthPixels=function(){return 16},r.setIniset=function(t){void 0!==t.EnableIntelliSelect&&"boolean"==typeof t.EnableIntelliSelect&&(r.m_isEnableIntelliSelect=t.EnableIntelliSelect),void 0!==t.EnableGripEidt&&"boolean"==typeof t.EnableGripEidt&&(r.m_isEnableGripEidt=t.EnableGripEidt),void 0!==t.multipleSelect&&"boolean"==typeof t.multipleSelect&&(r.m_isMultipleSelect=t.multipleSelect),void 0!==t.autoResetRenderer&&"boolean"==typeof t.autoResetRenderer&&(r.m_isAutoResetRenderer=t.autoResetRenderer),void 0!==t.correctLargeCoordinates&&"boolean"==typeof t.autoResetRenderer&&(r.m_isCorrectLargeCoordinates=t.correctLargeCoordinates),void 0!==t.requestHeaderCacheControl&&"boolean"==typeof t.requestHeaderCacheControl&&(r.m_isRequestHeaderCacheControl=t.requestHeaderCacheControl)}},{}],30:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObject=n.IniSetName=n.MxRunMode=void 0;var i,r,a,o=t("three"),s=t("./MxFun"),l=t("./MxCAD/MxCadSketchLayer"),c=t("./View/MxBrowseLayerData"),u=t("./View/MxBrowseDisplay"),h=t("./MxNetData"),p=t("./MxNetData"),d=t("./MxSelect"),f=t("./MxManager"),m=t("./MxSystemVariable"),g=t("./MxCAD/MxCADObject"),v=t("./MxLocalFileLoad"),y=t("./Operate/MxDrawObjectOsnap"),x=t("./View/MxDbDatabase"),b=t("./View/MxDrawMapBox"),w=t("./MxDrawObjectEvent"),M=t("./View/MxDbEntityGrip"),_=t("./cpp/McDrawObject");(r=i||(n.MxRunMode=i={}))[r.kBrowse=1]="kBrowse",r[r.kMxCAD=2]="kMxCAD",r[r.kMxCADBrowseApp=3]="kMxCADBrowseApp",r[r.kCPPMxCAD=4]="kCPPMxCAD",(a||(n.IniSetName=a={})).kEnableOsnapFunction="EnableOsnapFunction";var S=(C.prototype.getMcObject=function(){return this.mcObject},C.prototype.isValidMcObject=function(){return this.mcObject.isValid()},C.prototype.getId=function(){return this.id},C.prototype.getEventManager=function(){return this.eventManager},C.prototype.setCurrentLoadUrl=function(t){this._sCurrentLoadURL=t},C.prototype.getCurrentLoadUrl=function(){return this._sCurrentLoadURL},C.prototype.isWebgl2=function(){return!(!this._rendererParam||"webgl2"!=this._rendererParam.retver)},C.prototype.getMxDatabase=function(){return this.m_mxDatabase},C.prototype.updateCanvasSize=function(){this._onResizeFun&&this._onResizeFun()},C.prototype.mapBoxRender=function(t,e){this.camera.projectionMatrix=e,this.renderer.state.reset(),this.renderer.render(this.scene,this.camera)},C.prototype.mapBoxInitThreeJSObject=function(t,e,n){this.scene=t,this.camera=e,this.renderer=n},C.prototype.addMxEntity=function(t){return this.m_mxDatabase.addMxEntity(t)},C.prototype.getMxEntity=function(t){return this.m_mxDatabase.getEntity(t)},C.prototype.getMxEntityUserObject=function(t){var e=this.getMxEntity(t);return e?e.getUserObject():null},C.prototype.eraseAllMxEntity=function(){this.m_mxDatabase.eraseAllEntity()},C.prototype.eraseMxEntity=function(t){var e=this.m_mxDatabase.getEntity(t);return!!e&&e.erase()},C.prototype.getAllMxEntity=function(){var t=[];return this.m_mxDatabase.getAllEntity().forEach(function(e){e&&t.push(e.getUserObject())}),t},C.prototype.getMxAllSelect=function(){var t=this.m_mxDatabase.getSelectManager().getAllSelect(),e=this.m_mxDatabase.getGripManager().getAllSelect(),n=new Set;return t.forEach(function(t){n.add(t)}),e.forEach(function(e){n.has(e)||t.push(e)}),t},C.prototype.getPrvCommandSelect=function(){return this.m_mxDatabase.getSelectManager().getPrvCommandSelect()},C.prototype.addMxCurrentSelect=function(t){this.m_mxDatabase.getGripManager().addSelect(t)},C.prototype.clearMxCurrentSelect=function(){var t=this.m_mxDatabase.clearMxCurrentSelect();if(this._mxCAD){var e=this._mxCAD.getSelect().clearAllSelect(),n=this._mxCAD.getGrip().clearAll();(e||n)&&(t=!0)}return this.mcObject.isValid()&&this.mcObject.getGripManager().clearAll(),t},C.prototype.addViewObject=function(t){this.secenView?this.threejsselectObjectsView.add(t):console.log("this.secenView is null")},C.prototype.removeViewObject=function(t){s.MxFun.removeThreejsObject(t,this.threejsselectObjectsView)},C.prototype.setOtherRefFile=function(t){this._tzDwgStaticFile=t},C.prototype.setRequestHeader=function(t){this._requestHeader=t},C.prototype.initZoomW=function(t,e){this._initZoomwCoordPt1=t.clone(),this._initZoomWCoordPt2=e.clone()},C.prototype.getMxCAD=function(){return this._mxCAD},C.prototype.setMouseRightRotate=function(t){this._mouseRightRotate=t,null!=this.controls&&(this.controls.mouseButtons.RIGHT=t?o.MOUSE.ROTATE:o.MOUSE.PAN)},C.prototype.setZoomSpeed=function(t){var e=this.controls.zoomSpeed;return this.controls.zoomSpeed=t,e},C.prototype.resetRenderer=function(){this.renderer.info.reset()},C.prototype.setMouseMiddlePan=function(t){this._isMouseMiddlePan="boolean"==typeof t?t?1:0:t,null!=this.controls&&(1==this._isMouseMiddlePan?(this.controls.mouseButtons.LEFT=-1,this.controls.mouseButtons.RIGHT=-1,this.controls.mouseButtons.MIDDLE=o.MOUSE.PAN):2==this._isMouseMiddlePan?(this.controls.mouseButtons.LEFT=o.MOUSE.PAN,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))},C.prototype.resetThreeJSControls=function(){this.controls&&(this.controls.saveState(),this.controls.reset())},C.prototype.enableZoom=function(t){null!=this.controls&&(this.controls.enableZoom=t)},C.prototype.enablePan=function(t){null!=this.controls&&(this.controls.enablePan=t)},C.prototype.getOrbitControls=function(){return this.controls},C.prototype.enableViewControls=function(t){this.controls.enabled=t},C.prototype.initRunMode=function(t){this._isCreate?console.log("iniRunMode failed,mxobject already created"):this._runMode=t},C.prototype.getRunMode=function(){return this._runMode},C.prototype.setStaticLocalLoad=function(t){this._isStaticLocalLoad=t},C.prototype.isStaticLocalLoad=function(){return this._isStaticLocalLoad},C.prototype.setStaticLocalLoadPath=function(t){this._staticLocalLoadPath=t},C.prototype.addEvent=function(t,e){if(this._event[t])if(this._event[t]instanceof Array)this._event[t].includes(e)||this._event[t].push(e);else{var n=this._event[t];if(n==e)return;this._event[t]=[],this._event[t].push(n),this._event[t].push(e)}else this._event[t]=e},C.prototype.addControlsEvent=function(t,e,n){return void 0===n&&(n=!1),this.eventManager.addEventListener(t,e,n)},C.prototype.removeEvent=function(t){this._event[t]=void 0},C.prototype.removeEventFuction=function(t,e){if(this._event[t])if(this._event[t]instanceof Array){var n=this._event[t].indexOf(e);if(-1!=n)return this._event[t].splice(n,1),0==this._event[t].length&&(this._event[t]=void 0),!0}else if(this._event[t]==e)return!(this._event[t]=void 0);return!1},C.prototype.sysVariable=function(){return this.m_sysVariable},C.prototype.setIniset=function(t){this.m_iniSet=t},C.prototype.getInisetValue=function(t){return this.m_iniSet[t]},C.prototype.getViewColor=function(){return this._viewcolor},C.prototype.isWhiteViewColor=function(){return 16777215==this._viewcolor},C.prototype.initUserLoginData=function(t,e){this._userIdentitySign=t,this._userRandomToken=e},C.prototype.initRendererParam=function(t){this._rendererParam=t},C.prototype.automaticInversionColor=function(t){return 16777215!=this._viewcolor||16777215!=t?t:0},C.prototype.automaticInversionColor2=function(t){return 16777215==this._viewcolor&&16777215==(16777215&t)?4278190080&t:t},C.prototype.setViewColor=function(t){this._viewcolor=t,null!=this.scene&&(this.scene.background=new o.Color(t))},C.prototype.getViewAngle=function(){return this._viewangle},C.prototype.callInitCompleteEvent=function(){this.callEvent("loadComplete")},C.prototype.callInitObjectEvent=function(){this.callEvent("initObject")},C.prototype.callInitSceneEvent=function(t,e,n){var i=this._event.initScene;if(!i)return 0;if(i instanceof Array){var r=0;return i.forEach(function(i){r=i(t,e,n)}),r}return i(t,e,n)},C.prototype.callOpenFileComplete=function(t,e){void 0===e&&(e=0);var n=this._event.openFileComplete;n&&(n instanceof Array?n.forEach(function(n){n(t,e)}):n(t,e))},C.prototype.callSaveFileComplete=function(t,e){var n=this._event.saveFileComplete;n&&(n instanceof Array?n.forEach(function(n){n(e,t)}):n(e,t))},C.prototype.hasEvent=function(t){return null!=this._event[t]},C.prototype.callEvent=function(t,e){var n=this._event[t];if(!n)return!1;if(n instanceof Array){var i=!1;return n.forEach(function(t){i=t(e)}),i}return n(e)},C.prototype.userLoginResult=function(t){this.callEvent("userLoginResult",t)},C.prototype.serverReturn=function(t){var e=JSON.parse(t);this.callEvent("serverReturn",e)},C.prototype.openFileResult=function(t){JSON.parse(t).linkServer||console.log("link mx serverobj error"),this.callEvent("openFileResult",t)},C.prototype.xzSize=function(t){var e=this._devicePixelRatio;if(e-1<=1e-4&&-1e-4<=e-1)return t;for(var n=9999999,i=t,r=0,a=t;r<100;r++){if((s=(o=a*e)-Math.floor(o))<=.001)return a;s<n&&(n=s,i=a),a+=1}for(a=t;r<100;r++){var o,s;if((s=(o=a*e)-Math.floor(o))<=.001)return a;s<n&&(n=s,i=a),--a}return i},C.prototype.setSize=function(t,e){this._viewWidth=t,this._viewHeight=e,null!=this._userCanvas&&(this._userCanvas.width=t,this._userCanvas.height=e,this._userCanvas.style.width=t+"px",this._userCanvas.style.height=e+"px"),this.onResizeImp(),this.updateDisplay()},C.prototype.getCurrentColor=function(){return this._color},C.prototype.setCurrentColor=function(t){this._color=t},C.prototype.getSelect=function(){return this._select},C.prototype.call=function(t,e,n){this._net.getSend().CallServerJS(t,e,n)},C.prototype.zoomAll=function(){this._is2d&&this.call("getDatabaseBoundHelp",'{"isBackground":1}',function(t){if(0!=t.length){var e=JSON.parse(t);this.zoomW(new o.Vector3(e[0],e[1],0),new o.Vector3(e[2],e[3],0))}})},C.prototype.tempDisableSelect=function(t){this._select.tmpDisable=t},C.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)},C.prototype.closeWebSocket=function(){this._net.closeWebSocket()},C.prototype.findMxEntityAtPoint=function(t,e,n){!e&&void 0!==e||(t=this.docCoord2Screen(t.x,t.y,0));var i=[],r=this.m_mxDatabase.getIntersectObjects(t);if(0==r.length)return i;var a=new Map;return r.forEach(function(t){var e=(0,M.MxGetMxDbEntitForThreeJsObject)(t.object);if(e){var i=e.objectId();if(!a.has(i)){if(n){var r=(0,M.MxGetWordDrawxDataForThreeJsObject)(t.object);r&&n(i,r)}a.set(i,e.getUserObject())}}}),a.forEach(function(t){i.push(t)}),i},C.prototype.isMxCAD=function(){return this._runMode==i.kMxCAD},C.prototype.onLoad=function(t){if(this._runMode==i.kCPPMxCAD)this.callInitCompleteEvent();else if(this._isStaticLocalLoad)this._net=new p.MxNet,this._net.init(this,!1),0<this._openFile.length&&(this._staticLocalNet=new v.MxLocalDwgFileLoad(this._net),this._staticLocalNet.load(encodeURIComponent(this._staticLocalLoadPath),encodeURIComponent(this._openFile)));else{this._net=new p.MxNet;var e=!0;if(this._runMode==i.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.setUrlParam(t),this._staticNet.load(this._openFile,this._staticLoadingOpenFiles),this._tzDwgStaticFile&&0<this._tzDwgStaticFile.length)){var n=new p.MxNet;n.init(this,!1),this._extRefManager.createTzDwgExternalReferences(99999),n.setCurrentDatabaseId(99999),this._staticLoadTzNet=new p.MxHFileLoad(n),this._staticLoadTzNet.setShowloading(!1),this._staticLoadTzNet.setRequestHeader(this._requestHeader),this._staticLoadTzNet.load(this._tzDwgStaticFile,[])}}},C.prototype.stopAllLoading=function(){this._staticNet&&this._staticNet.stopAllLoading()},C.prototype.getStaticNet=function(){return this._staticNet},C.prototype.isStaticFileNet=function(){return!this._isStaticLocalLoad&&null!=this._staticNet},C.prototype.getStaticLocalNet=function(){return this._staticLocalNet},C.prototype.getStaticLoadTzNet=function(){return this._staticLoadTzNet},C.prototype.getViewWidth=function(){return null!=this._userCanvas?this._userCanvas.clientWidth:this._viewWidth},C.prototype.getViewHeight=function(){return null!=this._userCanvas?this._userCanvas.clientHeight:this._viewHeight},C.prototype.makeCurrent=function(){f.MxManager.setCurrentMx(this)},C.prototype.createCanvasImageData=function(t,e){var n=this,i=0,r=0,a=!1;e&&e.width&&e.height&&(i=this.getViewWidth(),r=this.getViewHeight(),a=!0,this.setSize(e.width,e.height)),this._callCreateCanvasImageData=function(e){a&&n.setSize(i,r),t(e)},this.updateDisplay()},C.prototype.getIntersectObjects=function(t){var e=new o.Raycaster;e.linePrecision=this.screenCoordLong2Doc(4);var n=this.getCanvas(),i=n.clientWidth,r=n.clientHeight;return t=new o.Vector2(t.x/i*2-1,-t.y/r*2+1),e.setFromCamera(t,this.camera),e.intersectObjects(this.threejsselectObjects.children,!0)},C.prototype.addObject=function(t){this.threejsselectObjects.add(t)},C.prototype.removeAllSelectObject=function(){for(;this.threejsselectObjects.children.length;)this.threejsselectObjects.remove(this.threejsselectObjects.children[0])},C.prototype.removeObject=function(t){this.threejsselectObjects.remove(t)},C.prototype.render=function(){this.secenView?(this.mcObject.updateDisplay()?(this.renderer.autoClear=!1,this.renderer.state.reset()):this.renderer.autoClear=!0,this.renderer.render(this.secenView,this.cameraView),this.renderer.autoClear=!1):this.mcObject.updateDisplay()?(this.renderer.autoClear=!1,this.renderer.state.reset()):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)},C.prototype.updateDisplay=function(t){void 0===t&&(t=!1),this.mxdrawThreeJS.updateDisplay(t)},C.prototype.updateDisplayImplement=function(t){function e(){n.m_mxDatabase.upDirtyDisplay(),n._isAnimation?(n._isAnimationStarting=!0,requestAnimationFrame(this.needRander)):n._isWaiteCount=0,n.render()}void 0===t&&(t=!1);var n=this;!0!==t?this._isAnimationStarting||(this._isAnimation?requestAnimationFrame(e):((5<this._isWaiteCount||this._isWaiteCount<0)&&(this._isWaiteCount=0),this._isWaiteCount<=0&&requestAnimationFrame(e),this._isWaiteCount++)):e()},C.prototype.gotoLayoutOld=function(t){"Modle"==t&&(t="");var e=this._openFile;for(var n in this._iniParam)"srcname"==(o=(a=this._iniParam[n])[0])&&(e=a[1]);var i={},r="";for(var n in this._iniParam){var a,o;if(null==i[o=(a=this._iniParam[n])[0]]){i[o]=!0;var l=a[1];if("file"==o){if(l=e,0<t.length){var c=l.substring(l.lastIndexOf(".")+1);l=l.substring(0,l.lastIndexOf("."))+"%23"+t+"%23."+c}}else if("srcname"==o)continue;0==r.length?r=o+"="+l+"&srcname="+e:r+="&"+o+"="+l}}var u=s.MxFun.getLocationPageUrl()+"?"+r;window.location.href=u},C.prototype.gotoLayout=function(t){var e=!1,n=!this.isStaticFileNet();for(var i in this._iniParam)if("dwgdir"==(u=this._iniParam[i])[0]){e=!0;break}if(e||n)this.gotoLayoutOld(t);else{"Model"==t&&(t="");var r=this._openFile;if(!r)return;var a=r.lastIndexOf(".dwg");if(void 0===a||-1===a)return;if("#"==(r=r.substring(0,a))[r.length-1]){var o=r.substring(0,r.length-1),l=o.lastIndexOf("#");void 0!==l&&-1!==l&&(r=o.substring(0,l))}0<t.length?r=r+"#"+t+"#.dwg.mxb1.wgh":r+=".dwg.mxb1.wgh";var c={};for(var i in this._iniParam){var u,h=(u=this._iniParam[i])[0];if(null==c[h]){c[h]=!0;var p=u[1];"file"!=h&&"srcname"!=h&&(r+="&"+h+"="+p)}}var d=s.MxFun.getLocationPageUrl()+"?file="+r;window.location.href=encodeURI(d)}},C.prototype.addInitParam=function(t,e){var n=new Array;n.push(t),n.push(e),this._iniParam.push(n)},C.prototype.openFile=function(t,e){if(void 0===e&&(e=""),!this._isCreate)return console.log("mx: openFile Fialed mxasser(_isCreate == false)"),!1;if(this.stopAllLoading(),0==t.length)return!1;this.reInit(),this._devicePixelRatio=window.devicePixelRatio,t instanceof Array?(this._openFile=t[0],this._staticLoadingOpenFiles=t):this._openFile=t,this._openFileExtName=this._openFile.substring(this._openFile.lastIndexOf(".")+1),this._iniParam=[],this._initZoomwCoordPt1=null,this._initZoomWCoordPt2=null;var n=new Array;return n.push("file"),n.push(this._openFile),this._iniParam.push(n),this.onLoad(e),!0},C.prototype.updateCameraDisplayRange=function(t,e,n){this.mxdrawThreeJS.updateCameraDisplayRange(t,e,n)},C.prototype.newFile=function(t,e,n,i){if(!this._isCreate)return console.log("mx: openFile Fialed mxasser(_isCreate == false)"),!1;var r,a;if(a=t instanceof Object&&e instanceof Object?(r=t,e):(r=new o.Vector3(t,e,0),new o.Vector3(n,i,0)),r.x>a.x){var l=r.x;r.x=a.x,a.x=l}if(r.y>a.y){var c=r.y;r.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.mxdrawThreeJS.updateCameraDisplayRange(r,a,0),this.updateDisplay(!0);var h=s.MxFun.getUiObj();null!=h&&(h.SetLayoutData(this._allLayoutName),h.UpDisplayLayout())},C.prototype.calcViewsize=function(){if(null==this._userCanvas)return{viewWidth:window.innerWidth,viewHeight:window.innerHeight};var t=this._userCanvas.clientWidth,e=this._userCanvas.clientHeight;if(null!=this._event.onResize){var n=this._event.onResize;n instanceof Array&&(n=n[0]);var i=n();null!=i&&(t=parseInt(i.width),e=parseInt(i.height))}return{viewWidth:t,viewHeight:e}},C.prototype.initMxCpp=function(t){t&&t.getImp()?(this.mcObject.init(this,t),null!=this.secenView?this.secenView.background=null:this.scene.background=null):console.log("mxerror: mcppObjectImp is null")},C.prototype.create=function(t,e,n,r){if(this._is2d?r?(this.mxdrawThreeJS=new b.MxDrawMapBoxThreeJS(r,this),this._viewcolor=16777215):this.mxdrawThreeJS=new b.MxDrawObject2dThreeJS(this):this.mxdrawThreeJS=new b.MxDrawObject3dThreeJS(this),this._callCreateCanvasImageData=void 0,this._devicePixelRatio=window.devicePixelRatio,this._runMode==i.kCPPMxCAD)this._mxCAD=null,this._openFile="";else{if(e instanceof Array?(this._openFile=e[0],this._staticLoadingOpenFiles=e):this._openFile=e,this._iniParam=s.MxFun.getUrlParams(),this._openFileExtName=this._openFile.substring(this._openFile.lastIndexOf(".")+1),""!=this._openFile&&this._runMode!=i.kMxCAD&&this._runMode!=i.kMxCADBrowseApp){var a=new Array;a.push("file"),a.push(this._openFile),this._iniParam.push(a)}""!=this._userIdentitySign&&(this.addInitParam("userIdentitySign",this._userIdentitySign),this.addInitParam("userRandomToken",this._userRandomToken)),this.addInitParam("runMode",this._runMode==i.kMxCAD||this._runMode==i.kMxCADBrowseApp?"mxcad":"browse"),this._runMode==i.kMxCAD||this._runMode==i.kMxCADBrowseApp?("empty"==this._openFile&&(this._openFile=""),this._mxCAD=new g.MxCADObject(this)):this._mxCAD=null}this._userCanvas=t;var l=window.innerWidth,c=window.innerHeight;if(null!=t&&(l=t.clientWidth,c=t.clientHeight),this._viewWidth=l,this._viewHeight=c,this.m_mxDatabase.getSelectManager().setCanvasSize(l,c),this.mxdrawThreeJS.onInitThreejs(),this.eventManager.registEvent(this),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 y.MxDrawObjectOsnap(this),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!=i.kBrowse&&(this._select.enabled=!1),f.MxManager.add(this),f.MxManager.setCurrentMx(this),this.mxdrawThreeJS.addControlsChangeEvent(),this.updateDisplay(),this.mxdrawThreeJS.getType()==b.MxThreeJSType.kMapBox)this.mxdrawThreeJS.addWindowResizeEvent();else{var u=this;if(null==t){var h=function(){u._viewWidth=window.innerWidth,u._viewHeight=window.innerHeight,u.onResizeImp(),u.updateDisplay()};window.addEventListener("resize",h,!1),this._onResizeFun=h}else{var p=function(t){t&&t.viewWidth&&t.viewHeight||(t=u.calcViewsize()),u._viewWidth=t.viewWidth,u._viewHeight=t.viewHeight,u.onResizeImp(u._viewWidth,u._viewHeight),u.updateDisplay()};if(this._onResizeFun=p,null!=this._event.addResizeEvent){var m=this._event.addResizeEvent;m instanceof Array&&(m=m[0]),m(p,t)}else window.addEventListener("resize",p,!1);if(window.setTimeout(function(){p()},5),null!=this._event.onResize){var v=u.calcViewsize();p(v);var x=0,w=0,M=!0,_=window.setInterval(function(){w++;var t=u.calcViewsize();if(t.viewWidth==v.viewWidth&&t.viewHeight==v.viewHeight&&0<t.viewWidth&&0<t.viewHeight){if(8<++x)return clearInterval(_),void p(t);1<=x&&M&&(p(t),2<=x&&(M=!1))}else x=0;v=t,50<w&&(clearInterval(_),0<t.viewWidth&&0<t.viewHeight?p(t):console.log("mxassert(0) error view size"))},50)}}}this.callInitObjectEvent(),this.onLoad(n),this._isCreate=!0},C.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 t=this._event.onResize;t instanceof Array&&(t=t[0]);var e=t();null!=e&&(this._viewWidth=e.width,this._viewHeight=e.height)}this.onResizeImp(this._viewWidth,this._viewHeight)}this.updateDisplay()},C.prototype.is2D=function(){return this._is2d},C.prototype.getOpenFile=function(){return this._openFile},C.prototype.getFileTitle=function(){var t=this._openFile;if("wgh"==this._openFile.substring(this._openFile.lastIndexOf(".")+1).toLowerCase()){var e=this._openFile.substring(0,this._openFile.indexOf(".mxb1.wgh")).split("/");"$"==(t=1==e.length?e[0]:e[e.length-1])[0]&&(t=t.substring(1))}return t},C.prototype.getIniParam=function(){return this._iniParam},C.prototype.getOpenFileExtName=function(){return this._openFileExtName},C.prototype.loadCodeToServer=function(t,e){this._net.getSend().CallLoadCodeToServer(t,e)},C.prototype.userLogin=function(t,e){this._net.getSend().UserLogin(t,e)},C.prototype.getUserCanvas=function(){return this._userCanvas},C.prototype.getCanvas=function(){return null!=this._userCanvas?this._userCanvas:this.renderer.domElement},C.prototype.getScene=function(){return this.scene},C.prototype.getCamera=function(){return this.camera},C.prototype.callCommand=function(t,e,n){void 0===e&&(e=""),this._net.getSend().DoCommand(t,e,n)},C.prototype.undoMark=function(){this._runMode==i.kCPPMxCAD||this._net.getSend().UndoMark()},C.prototype.loadCodeFileToServer=function(t,e,n){var i='{"path":"'+t+'","reload":'+(null!=n?"true":"false")+"}";this._net.getSend().DoCommand("Mx_LoadCodeFormServerFile",i,e)},C.prototype.deleteAll=function(){this.removeAllEntity(),this.callCommand("Mx_ClearAll"),this.updateDisplay()},C.prototype.undo=function(){this.callCommand("Mx_Undo")},C.prototype.save=function(){this.callCommand("Mx_Save")},C.prototype.initAllLayoutName=function(t){this._allLayoutName=t},C.prototype.getAllLayoutName=function(){return this._allLayoutName},C.prototype.updataClipMaterial=function(){this._blocks.updataClipMaterial(this)},C.prototype.getSketchLayers=function(){return this._sketchLayers},C.prototype.getExtRefManager=function(){return this._extRefManager},C.prototype.showLayer=function(t,e,n){"string"==typeof t&&(t=this._layers.getLayerIdForName(t)),n?this._sketchLayers.getLayer(t).show(e):this._blocks.showLayer(t,e),this.updateDisplay()},C.prototype.addLayerInfo=function(t,e,n){e=this.automaticInversionColor(16777215&e),this._layers.add(t,e,n)},C.prototype.setZeroLayerId=function(t){this._layers.setZeroLayerId(t)},C.prototype.addLayerInfoComplete=function(){this._layers.initComplete()},C.prototype.addEntity=function(t,e){var n=this._mapId2Entity.get(t);null==n&&(n=new Array,this._mapId2Entity.set(t,n)),n.push(e)},C.prototype.getEntity=function(t){return this._mapId2Entity.get(t)},C.prototype.clearThreejsScence=function(){s.MxFun.removeThreejsObject(this.threejsselectObjects,this.scene),this.threejsselectObjects=new o.Object3D,s.MxFun.removeThreejsObject(this._parentDocObject,this.scene),this._parentDocObject=new o.Object3D,this.scene.remove(),this.scene.dispose(),this.scene=new o.Scene,this.scene.add(this.threejsselectObjects),this.scene.add(this._parentDocObject),this._objectsOsnap=new y.MxDrawObjectOsnap(this),this.m_mxDatabase.init(this),this.mxdrawThreeJS.onInitScene(),s.MxFun.removeThreejsObject(this.threejsselectObjectsView,this.secenView),this.threejsselectObjectsView=null,this.secenView.remove(),this.secenView.dispose(),this.secenView=null,this.onInitViewScene()},C.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()},C.prototype.removeEntity=function(t){if(null==this._setAdyDelete[t]){this._setAdyDelete[t]=!0;var e=this._mapId2Entity.get(t);if(null!=e){for(var n in e)this.scene.remove(e[n]);this._sketchLayers.removeEntity(t),this._mapId2Entity.delete(t)}}},C.prototype.removeEntityFromServer=function(t){for(var e=t.getInt32(4,!0),n=0;n<e;n++){var i=t.getInt32(4*(n+20),!0);this.removeEntity(i)}},C.prototype.removeAllEntity=function(){var t=this;this._mapId2Entity.forEach(function(e,n,i){for(var r in e)t.scene.remove(e[r])}),this._mapId2Entity.clear(),this._sketchLayers.removeAllEntity()},C.prototype.mxWebAddEntity=function(t){this._setAdyDelete.clear();var e=this.mxWebAddEntity_3DChild(t);this.mxWebAddEntity_Curve(t,e),this._setAdyDelete.clear()},C.prototype.screenCoord2World=function(t,e,n){var i=this.getCanvas(),r=i.clientWidth,a=i.clientHeight;n=.5;var s=this.camera;s&&s.isOrthographicCamera&&(n=(s.near+s.far)/(s.near-s.far));var l=new o.Vector3(t/r*2-1,-e/a*2+1,n);return l.unproject(this.camera),l},C.prototype.worldCoord2Screen=function(t,e,n){var i=new o.Vector3(t,e,n).project(this.camera),r=this.getCanvas(),a=r.clientWidth/2,s=r.clientHeight/2,l=Math.round(i.x*a+a),c=Math.round(-i.y*s+s);return new o.Vector3(l,c,0)},C.prototype.worldCoordLong2Doc=function(t){var e=this.worldCoord2Doc(0,0,0),n=this.worldCoord2Doc(t,0,0);return e.distanceTo(n)},C.prototype.docCoordLong2World=function(t){var e=this.docCoord2World(0,0,0),n=this.docCoord2World(t,0,0);return e.distanceTo(n)},C.prototype.getDoc2CADMatrix=function(){return this._doc2CAD},C.prototype.docCoord2Cad=function(t,e,n){var i=new o.Vector3(t,e,n);return i.applyMatrix4(this._doc2CAD),i},C.prototype.cadCoord2Doc=function(t,e,n){var i=new o.Vector3(t,e,n);return i.applyMatrix4(this._cad2Doc),i},C.prototype.docCoordLong2Cad=function(t){var e=this.docCoord2Cad(0,0,0),n=this.docCoord2Cad(t,0,0);return e.distanceTo(n)},C.prototype.cadCoordLong2Doc=function(t){var e=this.cadCoord2Doc(0,0,0),n=this.cadCoord2Doc(t,0,0);return e.distanceTo(n)},C.prototype.viewCoordLong2Cad=function(t){return this.docCoordLong2Cad(this.screenCoordLong2Doc(t))},C.prototype.cadCoordLong2View=function(t){return this.docCoordLong2Screen(this.cadCoordLong2Doc(t))},C.prototype.docCoord2World=function(t,e,n){var i=new o.Vector3(t,e,n);return i.applyMatrix4(this._doc2World),i},C.prototype.getDoc2World=function(){return this._doc2World},C.prototype.getWorldToDoc=function(){return this._word2doc},C.prototype.worldCoord2Doc=function(t,e,n){var i=new o.Vector3(t,e,n);return i.applyMatrix4(this._word2doc),i},C.prototype.screenCoord2Doc=function(t,e,n){var i=this.screenCoord2World(t,e,n);return this.worldCoord2Doc(i.x,i.y,0)},C.prototype.docCoord2Screen=function(t,e,n){var i=this.docCoord2World(t,e,n);return this.worldCoord2Screen(i.x,i.y,i.z)},C.prototype.screenCoordLong2Doc=function(t){var e=this.screenCoord2Doc(0,0,0),n=this.screenCoord2Doc(t,0,0);return e.distanceTo(n)},C.prototype.screenCoordLong2DocScale=function(){var t=this.screenCoord2Doc(0,0,0),e=this.screenCoord2Doc(1,0,0);return t.distanceTo(e)},C.prototype.docCoordLong2Screen=function(t){var e=this.docCoord2Screen(0,0,0),n=this.docCoord2Screen(0<t?t:-t,0,0);return 0<=t?e.distanceTo(n):-e.distanceTo(n)},C.prototype.screenCoordLong2World=function(t){var e=this.screenCoord2World(0,0,0),n=this.screenCoord2World(0<t?t:-t,0,0);return 0<=t?e.distanceTo(n):-e.distanceTo(n)},C.prototype.worldCoordLong2Screen=function(t){var e=this.worldCoord2Screen(0,0,0),n=this.worldCoord2Screen(t,0,0);return e.distanceTo(n)},C.prototype.initCAD2Doc=function(t){t instanceof Array?this._cad2Doc.fromArray(t):this._cad2Doc=t,this._doc2CAD.getInverse(this._cad2Doc)},C.prototype.intiDoc2Wold=function(t){t instanceof Array?this._doc2World.fromArray(t):this._doc2World=t,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},C.prototype.getDrawContainer=function(){return this.threejsselectObjects},C.prototype.getTheTempDrawContainer=function(){return this._parentDocObject},C.prototype.mxWebAddEntityFor2dPointMeshBuffers=function(t,e){var n=new h.MxNetData(t),i=n.getdPointMeshBuffersHead(),r=i.zeroLayerIdIndex,a=i.databaseIndex;-1!=e&&(a=e);for(var o=i.datasize,s=0;s<i.datacount;s++){var l=n.getdPointMeshBufferDataHead(o);o=l.offset;var c=l.layerId,u=c==r,p=l.blkId,d=l.pointCount;if(!(d<1)){for(var f=[],m=[],g=[],v=[],y=[],x=0;x<d;x++){var b=t.getFloat32(o,!0);o+=4;var w=t.getFloat32(o,!0);o+=4;var M=t.getFloat32(o,!0);o+=4;var _=t.getFloat32(o,!0);o+=4;var S=t.getFloat32(o,!0);o+=4;var C=t.getFloat32(o,!0);o+=4;var T=t.getInt32(o,!0);o+=4;var E=T>>24&255;2==E?(v.push(b,w),v.push(M,_),v.push(S,C)):1==E?0!=p&&u?(y.push(b,w),y.push(M,_),y.push(S,C)):(g.push(b,w),g.push(M,_),g.push(S,C)):(T=this.automaticInversionColor(16777215&T),f.push(b,w),f.push(M,_),f.push(S,C),m.push((255&T)/255,(T>>8&255)/255,(T>>16&255)/255),m.push((255&T)/255,(T>>8&255)/255,(T>>16&255)/255),m.push((255&T)/255,(T>>8&255)/255,(T>>16&255)/255))}var D=this._blocks,A=this._layers;0!=a&&(D=this._extRefManager.getBlocks(a),A=this._extRefManager.getLayers(a));var O=D.crateBlock(p);O.addGeometryMesh(f,m,c,v,g,y),D.createThreejsObj(O,this,A)}}},C.prototype.mxWebAddEntityForMemorySections=function(t,e){var n=new h.MxNetData(t),i=n.getMemorySectionsHead(),r=(i.zeroLayerIdIndex,i.databaseIndex);-1!=e&&(r=e);var a=i.nOffset,o=this._blocks,s=this._layers;0!=r&&(o=this._extRefManager.getBlocks(r),s=this._extRefManager.getLayers(r));for(var l=0;l<i.datacount;l++){var c=n.getMemorySectionHead(a);a=c.offset;var p=new u.MxNewDisplayMemorySection;p.layerId=c.layerId,p.blockId=c.blkId,p.id=c.memId,p.color=c.memColor,p.type=c.memType;var d=!1;p.type==u.MxNewDisplayMemorySectionType.kLinesType_Float?(d=!0,p.type=u.MxNewDisplayMemorySectionType.kLinesType):p.type==u.MxNewDisplayMemorySectionType.kTriangleType_Float?(d=!0,p.type=u.MxNewDisplayMemorySectionType.kTriangleType):p.type==u.MxNewDisplayMemorySectionType.kPointType_Float&&(d=!0,p.type=u.MxNewDisplayMemorySectionType.kPointType);var f=c.pointCount;if(!(f<1)){for(var m=[],g=0;g<f;g++)if(d){var v=t.getFloat32(a,!0);a+=4;var y=t.getFloat32(a,!0);a+=4,t.getFloat32(a,!0),a+=4,m.push(v,y,0)}else v=t.getFloat64(a,!0),a+=8,y=t.getFloat64(a,!0),a+=8,t.getFloat64(a,!0),a+=8,m.push(v,y,0);p.points=m;var x=o.crateBlock(p.blockId);x.addMemorySections(p),o.createThreejsObj(x,this,s)}}},C.prototype.convertBytesToUTF8=function(t,e){var n=0;e=Math.min(e||t.length,t.length),239===t[0]&&187===t[1]&&191===t[2]&&(n=3);for(var i=[],r=0;n<e;r++){var a,o,s,l=t[n++];if(0===l)break;l<128?i[r]=String.fromCharCode(l):194<=l&&l<224?(a=t[n++],i[r]=String.fromCharCode(((31&l)<<6)+(63&a))):224<=l&&l<240?(a=t[n++],o=t[n++],i[r]=String.fromCharCode(((15&l)<<12)+((63&a)<<6)+(63&o))):240<=l&&l<245&&(s=((7&l)<<18)+((63&(a=t[n++]))<<12)+((63&(o=t[n++]))<<6)+(63&t[n++])-65536,i[r]=String.fromCharCode(55296+(s>>10),56320+(1023&s)))}return i.join("")},C.prototype.mxWebAddEntityFor2dPointTextureBuffers=function(t,e){var n=new h.MxNetData(t),i=n.getdPointTextureBuffersHead(),r=i.ver,a=(i.zeroLayerIdIndex,i.databaseIndex);-1!=e&&(a=e);for(var o=i.datasize,s=0;s<i.datacount;s++){var l=n.getdPointTextureBufferDataHead(o);o=l.offset;var c=l.layerId,u=l.blkId,p=l.dataCount;if(!(p<1)){var d=0,f=this._blocks,m=this._layers;0!=a&&(f=this._extRefManager.getBlocks(a),m=this._extRefManager.getLayers(a));for(var g=f.crateBlock(u);d<p;d++){var v=t.getFloat64(o,!0);o+=8;var y=t.getFloat64(o,!0);o+=8;var x=t.getFloat64(o,!0);o+=8;var b=t.getUint32(o,!0);o+=4;var w=t.getUint32(o,!0);o+=4;var M=this.convertBytesToUTF8(new Uint8Array(t.buffer.slice(o,o+w)),void 0);o+=w;var _=[],S=[],C=[];if(!(b<1)){for(var T=0;T<b;T++){if(5<=r){var E=t.getFloat64(o,!0);o+=8;var D=t.getFloat64(o,!0);o+=8,t.getFloat64(o,!0),o+=8;var A=t.getFloat64(o,!0);o+=8;var O=t.getFloat64(o,!0);o+=8,t.getFloat64(o,!0),o+=8;var L=t.getFloat64(o,!0);o+=8;var I=t.getFloat64(o,!0);o+=8,t.getFloat64(o,!0),o+=8,_.push(E,D),_.push(A,O),_.push(L,I)}else E=t.getFloat32(o,!0),o+=4,D=t.getFloat32(o,!0),o+=4,A=t.getFloat32(o,!0),o+=4,O=t.getFloat32(o,!0),o+=4,L=t.getFloat32(o,!0),o+=4,I=t.getFloat32(o,!0),o+=4,_.push(E,D),_.push(A,O),_.push(L,I);var P=t.getInt32(o,!0);o+=4;var R=t.getFloat32(o,!0);o+=4;var k=t.getFloat32(o,!0);o+=4;var N=t.getFloat32(o,!0);o+=4;var B=t.getFloat32(o,!0);o+=4;var F=t.getFloat32(o,!0);o+=4;var j=t.getFloat32(o,!0);o+=4;var V=P>>24&255;P=2==V||1==V?16777215:this.automaticInversionColor(16777215&P),C.push(R,k),C.push(N,B),C.push(F,j),S.push((255&P)/255,(P>>8&255)/255,(P>>16&255)/255),S.push((255&P)/255,(P>>8&255)/255,(P>>16&255)/255),S.push((255&P)/255,(P>>8&255)/255,(P>>16&255)/255)}g.addGeometryTexture(_,C,S,c,M,v,y,x)}}f.createThreejsObj(g,this,m)}}},C.prototype.mxWebAddEntityFor2dPointCurveBuffers=function(t,e){var n=new h.MxNetData(t),i=n.getdPointCurveBuffersHead(),r=i.zeroLayerIdIndex,a=i.databaseIndex;-1!=e&&(a=e);for(var o=i.datasize,s=0;s<i.datacount;s++){var l=n.getdPointCurveBufferDataHead(o);o=l.offset;var c=l.layerId,u=c==r,p=l.blkId,d=l.pointCount;if(!(d<1)){for(var f=[],m=[],g=[],v=[],y=[],x=0;x<d;x++){var b=t.getFloat32(o,!0);o+=4;var w=t.getFloat32(o,!0);o+=4;var M=t.getFloat32(o,!0);o+=4;var _=t.getFloat32(o,!0);o+=4;var S=t.getInt32(o,!0);o+=4;var C=S>>24&255;2==C?(v.push(b,w),v.push(M,_)):1==C?0!=p&&u?(y.push(b,w),y.push(M,_)):(g.push(b,w),g.push(M,_)):(f.push(b,w),f.push(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 T=this._blocks,E=this._layers;0!=a&&(T=this._extRefManager.getBlocks(a),E=this._extRefManager.getLayers(a));var D=T.crateBlock(p);D.addGeometryCurve(f,m,c,v,g,y),T.createThreejsObj(D,this,E)}}},C.prototype.mxWebAddEntityFor2dPointCurveBuffer=function(t,e){var n=new h.MxNetData(t);if(!n.getIsSketchEntity()){var i,r=n.getLayerId(),a=r==n.getZeroLayerId(),o=n.getBlockId();if(!((i=t.getInt32(20,!0)/20)<1)){for(var s=80,l=[],c=[],u=[],p=[],d=[],f=0;f<i;f++){var m=t.getFloat32(s,!0);s+=4;var g=t.getFloat32(s,!0);s+=4;var v=t.getFloat32(s,!0);s+=4;var y=t.getFloat32(s,!0);s+=4;var x=t.getInt32(s,!0);s+=4;var b=x>>24&255;2==b?(p.push(m,g),p.push(v,y)):1==b?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 w=n.getDatabaseIndex();-1!=e&&(w=e);var M=this._blocks,_=this._layers;0!=w&&(M=this._extRefManager.getBlocks(w),_=this._extRefManager.getLayers(w));var S=M.crateBlock(o);S.addGeometryCurve(l,c,r,p,u,d),M.createThreejsObj(S,this,_)}}},C.prototype.mxWebAddEntityFor2dPointMeshBuffer=function(t,e){var n=new h.MxNetData(t);if(!n.getIsSketchEntity()){var i,r=n.getLayerId(),a=n.getBlockId(),o=r==n.getZeroLayerId();if(!((i=t.getInt32(12,!0)/28)<1)){for(var s=80,l=[],c=[],u=[],p=[],d=[],f=0;f<i;f++){var m=t.getFloat32(s,!0);s+=4;var g=t.getFloat32(s,!0);s+=4;var v=t.getFloat32(s,!0);s+=4;var y=t.getFloat32(s,!0);s+=4;var x=t.getFloat32(s,!0);s+=4;var b=t.getFloat32(s,!0);s+=4;var w=t.getInt32(s,!0);s+=4;var M=w>>24&255;2==M?(p.push(m,g),p.push(v,y),p.push(x,b)):1==M?0!=a&&o?(d.push(m,g),d.push(v,y),d.push(x,b)):(u.push(m,g),u.push(v,y),u.push(x,b)):(l.push(m,g),l.push(v,y),l.push(x,b),w=this.automaticInversionColor(16777215&w),c.push((255&w)/255,(w>>8&255)/255,(w>>16&255)/255),c.push((255&w)/255,(w>>8&255)/255,(w>>16&255)/255),c.push((255&w)/255,(w>>8&255)/255,(w>>16&255)/255))}var _=n.getDatabaseIndex();-1!=e&&(_=e);var S=this._blocks,C=this._layers;0!=_&&(S=this._extRefManager.getBlocks(_),C=this._extRefManager.getLayers(_));var T=S.crateBlock(a);T.addGeometryMesh(l,c,r,p,u,d),S.createThreejsObj(T,this,C)}}},C.prototype.mxWebCreateAllBlocks=function(t,e){var n=new h.MxNetData(t).getDatabaseIndex();-1!=e&&(n=e);var i=this._blocks;0!=n&&(i=this._extRefManager.getBlocks(n)),i.createBlocks(t,this.scene)},C.prototype.mxWebEntitysData=function(t,e){-1==e&&this._objectsOsnap.mxWebEntitysData(t,e)},C.prototype.getObjectOsnap=function(){return this._objectsOsnap},C.prototype.saveMxEntityToJson=function(t){return this.m_mxDatabase.saveJson(t)},C.prototype.getDtabaseJsonString=function(){return JSON.stringify(this.m_mxDatabase.toJsonObject())},C.prototype.loadMxEntityFromJson=function(t){return this.m_mxDatabase.loadJson(t)},C);function C(t){this._is2d=!0,this._runMode=i.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 m.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._cad2Doc=new o.Matrix4,this._doc2CAD=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._sCurrentLoadURL="",this.mxdrawThreeJS=null,this.eventManager=new w.MxDrawObjectEvent,this._viewangle=0,this.id=0,this.mcObject=new _.McDrawObject,this._is2d=t,this._blocks.initRootBlockRef(),this.m_iniSet[a.kEnableOsnapFunction]=!1,this.m_sysVariable.init(this),this.m_mxDatabase=new x.MxDbDatabase,this.id=f.MxManager.allocId()}n.MxDrawObject=S},{"./MxCAD/MxCADObject":24,"./MxCAD/MxCadSketchLayer":27,"./MxDrawObjectEvent":33,"./MxFun":34,"./MxLocalFileLoad":35,"./MxManager":36,"./MxNetData":38,"./MxSelect":39,"./MxSystemVariable":43,"./Operate/MxDrawObjectOsnap":54,"./View/MxBrowseDisplay":68,"./View/MxBrowseLayerData":69,"./View/MxDbDatabase":70,"./View/MxDbEntityGrip":72,"./View/MxDrawMapBox":77,"./cpp/McDrawObject":79,three:19}],31:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObject2d=void 0;var a,o=t("three"),s=t("./MxFun"),l=t("./MxDrawObject"),c=t("three-orbitcontrols"),u=t("./MxNetData"),h=t("./MxMaterial"),p=t("./MxDrawData"),d=(r(f,a=l.MxDrawObject),f.prototype.set3DDraw=function(t){this.is3DDraw=t},f.prototype.getOrthographicCamera=function(){return this.camera instanceof o.OrthographicCamera?this.camera:null},f.prototype.getFullDisplayRange=function(){return{minPt:this._initMinDisplayPoint,maxPt:this._initMaxDisplayPoint}},f.prototype.zoomW=function(t,e,n){if(null!=n&&n||(t=this.docCoord2World(t.x,t.y,0),e=this.docCoord2World(e.x,e.y,0)),this._curMinDisplayPoint=t,this._curMaxDisplayPoint=e,t.x>e.x){var i=t.x;t.x=e.x,e.x=i}t.y>e.y&&(i=t.y,t.y=e.y,e.y=i);var r=this.getViewWidth(),a=this.getViewHeight(),s=Math.abs(t.x-e.x),l=Math.abs(t.y-e.y),c=this.getOrthographicCamera();if(s/l<r/a){var u=.5*l,h=r/a;c.left=-u*h,c.right=u*h,c.top=u,c.bottom=-u}else u=.5*s,h=a/r,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=1e3*f,c.far<9e4&&(c.far=9e4),c.near=1e3*-f,-9e4<c.near&&(c.near=-9e4);var m=t.x+.5*p,g=t.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()},f.prototype.zoomScale=function(t){var e=this.getOrthographicCamera();e.zoom=Math.max(this.controls.minZoom,Math.min(this.controls.maxZoom,e.zoom*t)),e.updateProjectionMatrix(),this.controls.update()},f.prototype.zoomCenter=function(t,e){var n=this.getOrthographicCamera(),i=this.docCoord2World(t,e,0);t=i.x,e=i.y,n.position.set(t,e,n.position.z),n.lookAt(new o.Vector3(t,e,0)),n.updateProjectionMatrix(),this.controls.target.x=t,this.controls.target.y=e,this.controls.target.z=0,this.controls.update()},f.prototype.calcCameraUp=function(t){var e=new o.Vector3(0,1,0),n=new o.Matrix4;return n.makeRotationZ(t),e.applyMatrix4(n),e},f.prototype.updateCameraDisplayRangeImp=function(t,e,n){null!=this._initZoomwCoordPt1&&null!=this._initZoomWCoordPt2?(this._initMinDisplayPoint=this.docCoord2World(this._initZoomwCoordPt1.x,this._initZoomwCoordPt1.y,0),this._initMaxDisplayPoint=this.docCoord2World(this._initZoomWCoordPt2.x,this._initZoomWCoordPt2.y,0)):(this._initMinDisplayPoint=t,this._initMaxDisplayPoint=e),this._viewangle=n,this.camera.up=this.calcCameraUp(n),this.cameraView.up=this.calcCameraUp(n),this.cameraView.updateProjectionMatrix(),this.zoomW(this._initMinDisplayPoint,this._initMaxDisplayPoint,!0)},f.prototype.setViewAngle=function(t){this._viewangle=t;var e=this.getOrthographicCamera();e&&(e.up=this.calcCameraUp(t),e.updateProjectionMatrix()),this.cameraView.up=this.calcCameraUp(t),this.cameraView.updateProjectionMatrix(),this.controls.update()},f.prototype.zoomInitialStates=function(){null!=this._initMinDisplayPoint&&null!=this._initMaxDisplayPoint?(this.camera.up=this.calcCameraUp(this._viewangle),this.cameraView.up=this.calcCameraUp(this._viewangle),this.cameraView.updateProjectionMatrix(),this.zoomW(this._initMinDisplayPoint,this._initMaxDisplayPoint,!0)):console.log("mx assert(0)")},f.prototype.onInitScene=function(){if(0==this.callInitSceneEvent(this.scene,this.controls,!0)){var t=new o.AmbientLight(3355443,1);this.scene.add(t);var e=new o.DirectionalLight(16777215,1);e.position.set(-2,2,3).normalize(),this.scene.add(e)}},f.prototype.updataCameraView=function(t,e){var n=t,i=e;this.cameraView.left=0,this.cameraView.right=n,this.cameraView.top=i,this.cameraView.bottom=0,this.cameraView.updateProjectionMatrix()},f.prototype.onInitViewScene=function(){if(!this.secenView){this.secenView=new o.Scene,this.secenView.background=new o.Color(this._viewcolor);var t=this.getViewWidth(),e=this.getViewHeight();t=this.xzSize(t),e=this.xzSize(e),this.cameraView=new o.OrthographicCamera(0,t,e,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 i=new o.DirectionalLight(16777215,1);i.position.set(-2,2,3).normalize(),this.secenView.add(i),this.threejsselectObjectsView=new o.Object3D,this.secenView.add(this.threejsselectObjectsView)}},f.prototype.onInitThreejs=function(){var t=this.getViewWidth(),e=this.getViewHeight(),n=(t=this.xzSize(t))/(e=this.xzSize(e))*50;this.onInitViewScene(),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 i=this.getUserCanvas(),r=this._rendererParam;r=r||{},null==i?(r.antialias=!1,r.stencil=!0,this.renderer=new o.WebGLRenderer(r),this.renderer.setClearColor(0,1),this.renderer.setPixelRatio(this._devicePixelRatio),this.renderer.setSize(t,e),document.body.appendChild(this.renderer.domElement)):(r.canvas=i,r.stencil=!0,this.renderer=new o.WebGLRenderer(r),this.renderer.setClearColor(0,1),this.renderer.setPixelRatio(this._devicePixelRatio)),this.renderer.sortObjects=!0,this.renderer.info.autoReset=p.MxDrawData.m_isAutoResetRenderer,this.renderer.info.reset();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(this._isMouseMiddlePan)):(this.controls.zoomSpeed=1.5,this.controls.touches.ONE=o.TOUCH.PAN,this.controls.screenSpacePanning=!0),this._is2d&&(this._runMode!=l.MxRunMode.kMxCAD&&this._runMode!=l.MxRunMode.kMxCADBrowseApp&&this._runMode!=l.MxRunMode.kCPPMxCAD||(this.controls.mouseButtons.LEFT=-1,this.controls.mouseButtons.RIGHT=-1,this.controls.mouseButtons.MIDDLE=o.MOUSE.PAN))},f.prototype.onCreate=function(){this._is2d=!0,this.mxdrawThreeJS.onInitScene()},f.prototype.mxWebAddEntity_3DChild=function(t){var e=new u.MxNetData(t),n=e.getMesh();if(null==n.id)return n.size;var i=new o.Mesh(n.geometry,h.MxMaterial.GetBaseColorMaterial(n.nColorIndex));return this.removeEntity(n.id),this.scene.add(i),n.isSketchEntity&&(this.addEntity(n.id,i),this.getSketchLayers().addEntity(n.id,e.getLayerId())),n.size},f.prototype.mxWebAddEntity_Curve=function(t,e){var n=new u.MxNetData(t),i=n.getCurve(e);if(null!=i.id){var r=h.MxMaterial.GetCurveColorMaterial(i.colorIndex),a=new o.LineSegments(i.geometry,r);this.removeEntity(i.id),this.scene.add(a),i.isSketchEntity&&(this.addEntity(i.id,a),this.getSketchLayers().addEntity(i.id,n.getLayerId()))}},f.prototype.onResizeImp=function(t,e){var n=this.getViewWidth();null!=t&&(n=t);var i=this.getViewHeight();null!=e&&(i=e),n=this.xzSize(n),i=this.xzSize(i);var r=this.getOrthographicCamera();if(null==this._curMinDisplayPoint||null==this._curMaxDisplayPoint){var a=50,o=n/i;r.left=a*o/-2,r.right=a*o/2,r.top=a/2,r.bottom=a/-2,r.updateProjectionMatrix()}else{var s=Math.abs(this._curMinDisplayPoint.x-this._curMaxDisplayPoint.x),l=Math.abs(this._curMinDisplayPoint.y-this._curMaxDisplayPoint.y);s/l<n/i?(a=.5*l,o=n/i,r.left=-a*o,r.right=a*o,r.top=a,r.bottom=-a):(a=.5*s,o=i/n,r.left=-a,r.right=a,r.top=a*o,r.bottom=-a*o),r.updateProjectionMatrix()}this.renderer.setSize(n,i),this.mcObject.setSize(n,i),this.updataClipMaterial(),this.updataCameraView(n,i),this.callEvent("viewsizechange",{width:n,height:i}),this.callEvent("viewchange"),this.m_mxDatabase.getSelectManager().setCanvasSize(n,i),this.m_mxDatabase.onViewChange()},f);function f(){var t=a.call(this,!0)||this;return t._initMinDisplayPoint=null,t._initMaxDisplayPoint=null,t._curMinDisplayPoint=null,t._curMaxDisplayPoint=null,t.is3DDraw=s.MxFun.is3DDwg(),t}n.MxDrawObject2d=d},{"./MxDrawData":29,"./MxDrawObject":30,"./MxFun":34,"./MxMaterial":37,"./MxNetData":38,three:19,"three-orbitcontrols":17}],32:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObject3d=void 0;var a,o=t("three"),s=t("./MxDrawObject"),l=t("three-orbitcontrols"),c=t("./MxNetData"),u=t("./MxMaterial"),h=t("./MxTools"),p=(r(d,a=s.MxDrawObject),d.prototype.mxWebAddEntity_Curve=function(t,e){var n,i=new c.MxNetData(t),r=0==t.getInt32(32,!0),a=i.getIsSketchEntity();if(!((n=r?t.getInt32(20,!0)/4/3:t.getInt32(20,!0)/4/2)<2)){for(var s=new o.Geometry,l=e,p=0;p<n;p++){var d=t.getFloat32(l,!0);l+=4;var f=t.getFloat32(l,!0);l+=4;var m=0;r&&(m=t.getFloat32(l,!0),l+=4),s.vertices.push(h.MxTools.AsThreeJsPoint(d,f,m))}var g=t.getInt32(28,!0),v=u.MxMaterial.GetCurveColorMaterial(g),y=new o.LineSegments(s,v),x=t.getInt32(4,!0);this.removeEntity(x),this.scene.add(y),a&&this.addEntity(x,y)}},d.prototype.mxWebAddEntity_3DChild=function(t){var e=new c.MxNetData(t),n=e.getId(),i=(e.getColorIndex(),0==e.getBufferType()),r=e.getIsSketchEntity();this.removeEntity(n);var a=new o.Mesh(new o.Geometry),s=this.mxWebUpdateEntity_3DChild(a,t,i);return this.scene.add(a),r&&this.addEntity(n,a),a.geometry.computeBoundingBox(),a.geometry.computeBoundingSphere(),s},d.prototype.mxWebUpdateEntity_3DChild=function(t,e,n){var i=new c.MxNetData(e),r=i.getVertexBufferSize(),a=i.getIndexBufferSize(),s=i.getColorIndex();if(0===r||0===a)return i.getDrawDataOffset();var l=i.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)),t.material=u.MxMaterial.createMaterial(p),null==t.material&&(t.material=u.MxMaterial.GetColorMaterial(s)),t.castShadow=f,t.receiveShadow=m;var g,v=i.getDrawDataOffset();g=n?r/4/8:r/4/2;var y=t.geometry;y.vertices=[],y.faces=[];for(var x=0;x<g;x++){var b=e.getFloat32(v+0,!0),w=e.getFloat32(v+4,!0),M=0,_=0,S=0,C=0,T=0,E=0;n?(M=e.getFloat32(v+8,!0),_=e.getFloat32(v+12,!0),S=e.getFloat32(v+16,!0),C=e.getFloat32(v+20,!0),T=e.getFloat32(v+24,!0),E=e.getFloat32(v+28,!0),v+=32):v+=8;var D=h.MxTools.AsThreeJsPoint(b,w,M);y.vertices.push(D),y.vertices[x].normal=h.MxTools.AsThreeJsPoint(_,S,C),y.vertices[x].uv=new o.Vector2(T,E)}var A=a/4;for(x=0;x<A;x+=3){var O=e.getInt32(v,!0);v+=4;var L=e.getInt32(v,!0);v+=4;var I=e.getInt32(v,!0);v+=4;var P=new o.Face3(O,L,I);d||P.vertexNormals.push(y.vertices[O].normal,y.vertices[L].normal,y.vertices[I].normal),y.faces.push(P),y.faceVertexUvs[0].push([y.vertices[O].uv,y.vertices[L].uv,y.vertices[I].uv])}return d&&y.computeFaceNormals(),v},d.prototype.updateUVs=function(t){t.faceVertexUvs[0]=[],t.faces.forEach(function(e){var n=["x","y","z"].sort(function(t,n){return Math.abs(e.normal[t])-Math.abs(e.normal[n])}),i=t.vertices[e.a],r=t.vertices[e.b],a=t.vertices[e.c],s=new o.Vector2(i[n[0]],i[n[1]]),l=new o.Vector2(r[n[0]],r[n[1]]),c=new o.Vector2(a[n[0]],a[n[1]]);t.faceVertexUvs[0].push([s,l,c])}),t.uvsNeedUpdate=!0},d.prototype.onInitThreejs=function(){var t=this.getViewWidth(),e=this.getViewHeight(),n=(t=this.xzSize(t))/(e=this.xzSize(e))*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 i=this.getUserCanvas();null==i?(this.renderer=new o.WebGLRenderer({antialias:!0,alpha:!0}),this.renderer.setPixelRatio(this._devicePixelRatio),this.renderer.setSize(t,e),document.body.appendChild(this.renderer.domElement)):(this.renderer=new o.WebGLRenderer({canvas:i,antialias:!0,alpha:!0}),this.renderer.setPixelRatio(this._devicePixelRatio));var r=this.getUserCanvas();null==r&&(r=this.renderer.domElement),this.controls=new l.OrbitControls(this.camera,r)},d.prototype.onInitViewScene=function(){},d.prototype.onInitScene=function(){if(0==this.callInitSceneEvent(this.scene,this.controls,!1)){var t=new o.AmbientLight(2236962);t.integrity=1,this.scene.add(t);var e=new o.DirectionalLight(16777215,1);e.position.set(-2,2,3).normalize(),this.scene.add(e);var n=new o.GridHelper(2e3,100);n.position.y=-199,n.material.opacity=.25,n.material.transparent=!0,this.scene.add(n);var i=new o.AxesHelper(20);this.scene.add(i)}},d.prototype.onCreate=function(){this._is2d=!1,this.callEvent("initRenderer",this.renderer),this.mxdrawThreeJS.onInitScene()},d.prototype.getOrthographicCamera=function(){return this.camera instanceof o.OrthographicCamera?this.camera:null},d.prototype.onResizeImp=function(t,e){var n=this.getViewWidth();null!=t&&(n=t);var i=this.getViewHeight();null!=e&&(i=e),n=this.xzSize(n),i=this.xzSize(i);var r=this.getOrthographicCamera(),a=n/i;r.left=50*a/-2,r.right=50*a/2,r.top=25,r.bottom=-25,r.updateProjectionMatrix(),this.renderer.setSize(n,i)},d.prototype.zoomInitialStates=function(){},d.prototype.zoomScale=function(t){},d.prototype.zoomW=function(t,e,n){},d.prototype.zoomCenter=function(t,e){},d.prototype.setViewAngle=function(t){this._viewangle=t},d.prototype.getFullDisplayRange=function(){return{}},d);function d(){var t=a.call(this,!1)||this;return t._viewcolor=15790320,t}n.MxDrawObject3d=p},{"./MxDrawObject":30,"./MxMaterial":37,"./MxNetData":38,"./MxTools":45,three:19,"three-orbitcontrols":17}],33:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObjectEvent=n.MxDrawObjectEventDefautProc=void 0;var i=t("./MxFun"),r=t("./Operate/MxJigCmdManager"),a=t("three"),o=t("./UI/MxUiVue"),s=t("./MxDrawData"),l=(c.prototype.onMousemove=function(t){if(o.MxUiVue.isNull())return 0;var e=this.mxObj.screenCoord2Doc(t.offsetX,t.offsetY,0);return e=this.mxObj.docCoord2Cad(e.x,e.y,e.z),o.MxUiVue.setTipCoord(i.MxFun.formatString("{0},{1},0.000",e.x.toFixed(3),e.y.toFixed(3))),0},c.prototype.onTouchStart=function(t){if(s.MxDrawData.m_isEnableIntelliSelect&&!r.MxJigCmdManager.isRunning()){var e=t.touches[0].pageX,n=t.touches[0].pageY,o=this.mxObj,l=o.screenCoord2Doc(e,n,0);if(o.isMxCAD()){var c=o.getMxCAD();if(!c)return;var u=!0;if(c&&c.getGrip().onMouseLBDown(l)&&(u=!1),u)return i.MxFun.sendStringToExecute("Mx_IntelliSel",{pt1:l}),1}else if(!o.getMxDatabase().getGripManager().onMouseLBDown(l)){var h=new a.Vector3(e,n,0);return i.MxFun.sendStringToExecute("Mx_FrontEndWebpageIntelliSel",{pt:h}),1}}return 0},c.prototype.onMousdown=function(t){if(t.button==r.MxJigCmdManager.MouseButton.kRight&&r.MxJigCmdManager.isRunning())return r.MxJigCmdManager.stopCmd(),0;if(s.MxDrawData.m_isEnableIntelliSelect&&t.button==r.MxJigCmdManager.MouseButton.kLeft&&!r.MxJigCmdManager.isRunning()){var e=this.mxObj,n=e.screenCoord2Doc(t.offsetX,t.offsetY,0);if(e.isMxCAD()){var o=e.getMxCAD();if(!o)return;var l=!0;if(o&&o.getGrip().onMouseLBDown(n)&&(l=!1),l)return i.MxFun.sendStringToExecute("Mx_IntelliSel",{pt1:n}),1}else if(!(e.getMxDatabase().getGripManager().onMouseLBDown(n)||e.isValidMcObject()&&e.getMcObject().getGripManager().onMouseLBDown(n))){var c=new a.Vector3(t.offsetX,t.offsetY,0);return i.MxFun.sendStringToExecute("Mx_FrontEndWebpageIntelliSel",{pt:c}),1}}return 0},c.prototype.init=function(t,e){this.mxObj=t;var n=this;e.addEventListener("mousemove",function(t){return n.onMousemove(t)}),e.addEventListener("mousedown",function(t){return n.onMousdown(t)}),e.addEventListener("touchstart",function(t){return n.onTouchStart(t)})},c);function c(){}n.MxDrawObjectEventDefautProc=l;var u=(h.prototype.onMousedown=function(t){this.callEvent("mousedown",t)},h.prototype.onMousemove=function(t){this.callEvent("mousemove",t)},h.prototype.onMouseup=function(t){this.callEvent("mouseup",t)},h.prototype.registEvent=function(t){var e=t.getCanvas();if(!e)return!1;var n=this;i.MxFun.isPC()?(e.addEventListener("mouseup",function(t){n.onMouseup(t)},!0),e.addEventListener("mousemove",function(t){n.onMousemove(t)},!0),e.addEventListener("mousedown",function(t){n.onMousedown(t)},!0)):(e.addEventListener("touchstart",function(t){n.callEvent("touchstart",t)},!0),e.addEventListener("touchend",function(t){n.callEvent("touchend",t)},!0),e.addEventListener("touchmove",function(t){n.callEvent("touchmove",t)},!0)),this.defautProc.init(t,this)},h.prototype.getEventCall=function(t){var e;return"mousemove"==t?e=this.aryMousemoveEventCall:"mouseup"==t?e=this.aryMouseupEventCall:"mousedown"==t?e=this.aryMousedownEventCall:"touchstart"==t?e=this.aryTouchstartEventCall:"touchend"==t?e=this.aryTouchendEventCall:"touchmove"==t&&(e=this.aryTouchmoveEventCall),e},h.prototype.callEvent=function(t,e){var n=this.getEventCall(t);if(n){for(var i=n.slice(),r=0,a=i.length;r<a;r++){var o=i[r](e);if(1==o)return o}return 0}},h.prototype.addEventListener=function(t,e,n){void 0===n&&(n=!1);var i=this.getEventCall(t);return!!i&&(-1<i.indexOf(e)||(n?i.unshift(e):i.push(e)),!0)},h.prototype.removeEventListener=function(t,e){var n=this.getEventCall(t);if(!n)return!1;var i=n.indexOf(e);return-1<i&&(n.splice(i,1),!0)},h);function h(){this.aryMousedownEventCall=[],this.aryMouseupEventCall=[],this.aryMousemoveEventCall=[],this.aryTouchstartEventCall=[],this.aryTouchendEventCall=[],this.aryTouchmoveEventCall=[],this.defautProc=new l}n.MxDrawObjectEvent=u},{"./MxDrawData":29,"./MxFun":34,"./Operate/MxJigCmdManager":58,"./UI/MxUiVue":67,three:19}],34:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxFun=void 0;var i,r,a,o,s,l,c,u,h,p,d,f,m,g,v,y=t("three"),x=t("./MxManager"),b=t("./MxDrawObject"),w=t("./MxDrawObject2d"),M=t("./MxDrawObject3d"),_=t("./UI/MxUiObjectMobile"),S=t("./UI/MxUiObjectPC"),C=t("./Operate/MxJigCmdManager"),T=t("./Operate/MxJigGetLine"),E=t("./Operate/MxCmdRunManager"),D=t("./UI/MxUiVue"),A=t("./MxThreeJS"),O=t("./MxWindowsEvent"),L=t("./MxTools"),I=t("./MxDrawCommands"),P=t("./MxDrawData"),R=t("./MxCAD/MxCADEditDisplay"),k=t("./MxLocalFileLoad"),N=t("./TempTest/MxTestJig"),B=t("./MxVersion"),F=t("./MrxDbgUtils");function j(t){t.cmd&&W(t.cmd)}function V(t){var e=new RegExp("(^|&)"+t+"=([^&]*)(&|$)"),n=window.location.href,i=n.indexOf("?"),r=(n=-1==i?"":n.substring(i)).substr(1).match(e);return null!=r?decodeURIComponent(r[2]):""}function z(){return x.MxManager.currentMx()}function G(){return x.MxManager.currentMx()}function U(t,e){var n={};if(null!=t)if(t instanceof Array)n.is2d=!0;else{0==t.length&&(t="empty");var i=t.substring(t.lastIndexOf(".")+1).toLowerCase();if("dwg"!=i&&"dxf"!=i&&"dwf"!=i&&"mwg"!=i&&"wgh"!=i||(n.is2d=!0),1!=e&&null!=e&&"wgh"!=i){var r=void 0,a=t.split("/");"$"==(r=1==a.length?a[0]:a[a.length-1])[0]&&(r=r.substring(1));for(var o=void 0,s=0;s<a.length-1;s++)o=0==s?a[s]:o+"/"+a[s];t=o?o+"/$"+r+".mxb1.wgh":"$"+r+".mxb1.wgh"}}else t="empty";return n.sFileName=t,n}function H(t){if("string"==typeof t){var e=t.substring(t.lastIndexOf(".")+1).toLowerCase();if("dwg"!=e&&"wgh"!=e){var n=t.lastIndexOf("?");if(-1!=n){var i=t.substring(n,t.length);return{sFileName:t=t.substring(0,n),sUrlParam:i}}}}return null}function W(t,e){var n=G();return E.MxCmdRunManager.runCmd(n,t,e)}function J(t){null!=t&&(t.init(),D.MxUiVue.init(t)),f||(console.log("MxDraw Version:"+B.MxBulid.getVersion()),f=!0,v=new k.MxLocalNodeJs,C.MxJigCmdManager.init(),O.MxWindowsEvent.registEvent(),I.MxDrawCommands.registerCommand(),window.mxConfig_isLoadTest&&N.MxTest.registerCommand(),g.sendStringToExecute=j)}r=i||(n.MxFun=i={}),a=".",u=l=s=-1,d=null,f=!(p="ws://localhost:5090"),g={},v=m=h=c=o=void 0,r.getUiObj=function(){return d},r.getNodeJs=function(){return v},r.setMxServer=function(t){p=t},r.getMxServer=function(){return p},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 a},r.setCurPath=function(t){a=t},r.getQueryString=V,r.getLocationPageUrl=function(){var t=window.location.href,e=t.lastIndexOf("?");return-1==e?t:t.substring(0,e)},r.getUrlParams=function(){var t=window.location.search,e=t.substr(1,t.length).split("&"),n=new Array;if(null!=e)for(var i=0;i<e.length;i++){var r=e[i].replace(/[=|^==]/,"&").split("&");if(1<r.length){var a=new Array;a.push(decodeURIComponent(r[0])),a.push(decodeURIComponent(r[1])),n.push(a)}}return n},r.call=function(t,e,n){null==e?e="{}":"string"==typeof e?0==e.length?e="{}":"["==e[0]&&"]"==e[e.length-1]||"{"==e[0]&&"}"==e[e.length-1]||(e='"'+(e=e.replace(/"/g,"'"))+'"'):e="object"==typeof e?JSON.stringify(e):"{}",x.MxManager.currentMx().call(t,e,n)},r.loadCodeToServer=function(t,e){x.MxManager.currentMx().loadCodeToServer(t,e)},r.getCurrentMx=z,r.getCurrentMxCAD=function(){var t=z();return t?t.getMxCAD():null},r.loadCodeFileToServer=function(t,e,n){x.MxManager.currentMx().loadCodeFileToServer(t,e,n)},r.isEnableSelect=function(){if(-1!=s)return 1==s;var t=V("select");return s=0,null!=t&&"y"==t.toLowerCase()&&(s=1),1==s},r.is3DDwg=function(){if(-1!=u)return 1==u;var t=V("3ddwg");return u=0,null!=t&&"y"==t.toLowerCase()&&(u=1),1==u},r.isStaticLoad=function(){if(-1!=l)return 1==l;var t=V("static");return l=0,null!=t&&"y"==t.toLowerCase()&&(l=1),1==l},r.enableSelect=function(t){s=t?1:0},r.enablStaticLoad=function(t){l=null==t||t?1:0},r.dwgDir=function(){return null!=c||null==(c=V("dwgdir"))&&(c=""),c},r.setDwgDir=function(t){c=t},r.getStaticServer=function(){return null!=h||null==(h=V("staticServer"))&&(h=""),h},r.setStaticServer=function(t){h=t},r.is2dParam=function(){if(null!=o)return o;var t=V("file");if(o=!1,null!=t){var e=t.substring(t.lastIndexOf(".")+1);"dwg"!=e.toLowerCase()&&"dxf"!=e.toLowerCase()&&"dwf"!=e.toLowerCase()&&"mwg"!=e.toLowerCase()||(o=!0)}return o},r.set2dParam=function(t){o=t},r.showLayer=function(t,e,n){var i=x.MxManager.currentMx().getMxCAD();if(!i)return x.MxManager.currentMx().showLayer(t,e,n);"number"==typeof t&&R.MxCADDisplayFun.showLayer(i.getDatabase(),t,e)},r.upDisplayForLayerData=function(t){var e=x.MxManager.currentMx().getMxCAD();return!!e&&e.getDatabase().getLayerTable().upDisplayForLayerData(e.getDatabase(),t)},r.screenCoord2World=function(t,e,n){return t instanceof Object?x.MxManager.currentMx().screenCoord2World(t.x,t.y,t.z):x.MxManager.currentMx().screenCoord2World(t,e,n)},r.worldCoord2Screen=function(t,e,n){return t instanceof Object?x.MxManager.currentMx().worldCoord2Screen(t.x,t.y,t.z):x.MxManager.currentMx().worldCoord2Screen(t,e,n)},r.docCoord2Cad=function(t,e,n){return t instanceof Object?x.MxManager.currentMx().docCoord2Cad(t.x,t.y,t.z):x.MxManager.currentMx().docCoord2Cad(t,e,n)},r.cadCoord2Doc=function(t,e,n){return t instanceof Object?x.MxManager.currentMx().cadCoord2Doc(t.x,t.y,t.z):x.MxManager.currentMx().cadCoord2Doc(t,e,n)},r.docCoord2World=function(t,e,n){return t instanceof Object?x.MxManager.currentMx().docCoord2World(t.x,t.y,t.z):x.MxManager.currentMx().docCoord2World(t,e,n)},r.worldCoord2Doc=function(t,e,n){return t instanceof Object?x.MxManager.currentMx().worldCoord2Doc(t.x,t.y,t.z):x.MxManager.currentMx().worldCoord2Doc(t,e,n)},r.screenCoord2Doc=function(t,e,n){return t instanceof Object?x.MxManager.currentMx().screenCoord2Doc(t.x,t.y,t.z):x.MxManager.currentMx().screenCoord2Doc(t,e,n)},r.docCoord2Screen=function(t,e,n){return t instanceof Object?x.MxManager.currentMx().docCoord2Screen(t.x,t.y,t.z):x.MxManager.currentMx().docCoord2Screen(t,e,n)},r.docCoordLong2Cad=function(t){return x.MxManager.currentMx().docCoordLong2Cad(t)},r.cadCoordLong2Doc=function(t){return x.MxManager.currentMx().cadCoordLong2Doc(t)},r.viewCoordLong2Cad=function(t){return x.MxManager.currentMx().viewCoordLong2Cad(t)},r.cadCoordLong2View=function(t){return x.MxManager.currentMx().cadCoordLong2View(t)},r.zoomCenter=function(t,e){x.MxManager.currentMx().is2D()&&(x.MxManager.currentMx().zoomCenter(t,e),x.MxManager.currentMx().updateDisplay())},r.zoomW=function(t,e,n,i,r){x.MxManager.currentMx().is2D()&&(x.MxManager.currentMx().zoomW(new y.Vector3(t,e,0),new y.Vector3(n,i,0),r),x.MxManager.currentMx().updateDisplay())},r.zoomScale=function(t){x.MxManager.currentMx().is2D()&&(x.MxManager.currentMx().zoomScale(t),x.MxManager.currentMx().updateDisplay())},r.zoomAll=function(){x.MxManager.currentMx().is2D()&&(x.MxManager.currentMx().zoomAll(),x.MxManager.currentMx().updateDisplay())},r.deleteAll=function(){return x.MxManager.currentMx().deleteAll()},r.callCommand=function(t,e,n){x.MxManager.currentMx().callCommand(t,e,n)},r.getCurrentColor=function(){return x.MxManager.currentMx().getCurrentColor()},r.setCurrentColor=function(t){x.MxManager.currentMx().setCurrentColor(t)},r.undo=function(){x.MxManager.currentMx().undo()},r.save=function(){x.MxManager.currentMx().save()},r.showLoading=function(){null!=d&&d.ShowLoading()},r.hideLoading=function(){null!=d&&d.HideLoading()},r.showProp=function(t){null!=d&&d.ShowObjectProperty(t)},r.hideProp=function(){null!=d&&d.HideObjectProp()},r.getUiObject=function(){return d},r.getViewCenterDocCoord=function(){return x.MxManager.currentMx().is2D()?x.MxManager.currentMx().getViewCenterDocCoord():new y.Vector3(0,0,0)},r.screenCoordLong2Doc=function(t){return x.MxManager.currentMx().is2D()?x.MxManager.currentMx().screenCoordLong2Doc(t):t},r.docCoordLong2Screen=function(t){return x.MxManager.currentMx().is2D()?x.MxManager.currentMx().docCoordLong2Screen(t):t},r.worldCoordLong2Doc=function(t){return x.MxManager.currentMx().is2D()?x.MxManager.currentMx().worldCoordLong2Doc(t):t},r.docCoordLong2World=function(t){return x.MxManager.currentMx().is2D()?x.MxManager.currentMx().docCoordLong2World(t):t},r.screenCoordLong2World=function(t){return x.MxManager.currentMx().is2D()?x.MxManager.currentMx().screenCoordLong2World(t):t},r.worldCoordLong2Screen=function(t){return x.MxManager.currentMx().is2D()?x.MxManager.currentMx().worldCoordLong2Screen(t):t},r.addSelectEvent=function(t){x.MxManager.addSelectEvent(t)},r.clearSelectEvent=function(){x.MxManager.clearSelectEvent()},r.removeThreejsObject=function(t,e,n){t&&(t.traverse(function(t){(t instanceof y.Mesh||t instanceof y.Line||t instanceof y.LineLoop)&&(t.geometry.dispose(),n&&(t.material instanceof Array?t.material.forEach(function(t){t.dispose()}):t.material.dispose()))}),e.remove(t))},r.setOutServerDebugCall=function(t){x.MxManager.setOutDebugCall(t)},r.updateDisplay=function(){x.MxManager.updateDisplay()},r.getCurrentDraw=G,r.formatString=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var i=0;i<e.length;i++)t=t.replace("{".concat(i,"}"),e[i]);return t},r.createMxUiObject=function(t){var e;return e=this.isPC()?new S.MxUiObjectPC:new _.MxUiObjectMobile,t(d=e),e.create(),e},r.openFile=function(t,e){var n="";if("string"==typeof t){var i=H(t);i&&(n=i.sUrlParam,t=i.sFileName)}null==e&&(e=!1);var r=U(t,e);return r.is2d&&(o=r.is2d),t=r.sFileName,x.MxManager.currentMx().openFile(t,n)},r.createMxObject=function(t,e,n,i,a,o,s,l){f||J(),"string"==typeof t&&(t=0==t.length?void 0:document.getElementById(t));var c=null,u="";if(l)e="",(c=new w.MxDrawObject2d).setViewColor(0),c.initRunMode(b.MxRunMode.kCPPMxCAD);else{if(null==e)e=r.getQueryString("file");else{var h=H(e);h&&(u=h.sUrlParam,e=h.sFileName)}var p=null!=i&&i,d=U(e,o);d.is2d&&(p=d.is2d),e=d.sFileName,1==a&&(e=""),p?(c=new w.MxDrawObject2d).setViewColor(0):(c=new M.MxDrawObject3d).setViewColor(15790320)}return null!=n&&n(c),c.create(t,e,u,s),c},r.getMxObjectFormElement=function(t){return x.MxManager.getMxObject(t)},r.initMxCpp=function(t){x.MxManager.initMxCpp(t)},r.isRunningCommand=function(){return C.MxJigCmdManager.isRunning()},r.stopRunCommand=function(){return C.MxJigCmdManager.stopCmd()},r.runCommand=function(t){return C.MxJigCmdManager.runCmd(t)},r.getTHREE=function(){return y},r.getLine=function(t){var e=new T.MxJigGetLine;e.setRetCall(t),C.MxJigCmdManager.runCmd(e)},r.addCommand=function(t,e,n){E.MxCmdRunManager.addCommand(t,e,n)},r.sendStringToExecute=W,r.getMxEntity=function(t){var e=G();return e?e.getMxEntityUserObject(t):null},r.initUiDataObject=function(t){D.MxUiVue.isNull()&&(t.init(r),D.MxUiVue.init(t))},r.init=J,r.addWindowsEvent=function(t){O.MxWindowsEvent.addEvent(t)},r.getCurrentMousePostion=function(){return O.MxWindowsEvent.getCurrentMousePostion()},r.getMxThreeJS=function(){return A.MxThreeJS},r.getMxTools=function(){return L.MxTools},r.getMxCmdRunManager=function(){return E.MxCmdRunManager},r.getMxJigCmdManager=function(){return C.MxJigCmdManager},r.initQuickCommand=function(t){E.MxCmdRunManager.InitQuickCommand(t)},r.Assert=function(t){t||console.log("MxAssert error")},r.setIniset=function(t){P.MxDrawData.setIniset(t)},r.setPostMessageToParentFrameFunction=function(t){m=t},r.postMessageToParentFrame=function(t){return null!=m&&(m(t),!0)},r.onParentFrameMessage=function(t){null!=t&&null!=t.type&&g[t.type]&&g[t.type](t)},r.acutPrintf=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!D.MxUiVue.isNull()){for(var i=arguments,r=i[0],a=0;a<i.length-1;a++){var o=new RegExp("\\{"+a+"\\}","gm");r=r.replace(o,i[a+1])}D.MxUiVue.AcutPrintfNoFormat(r,!0)}},r.loadImageMaterial=function(t,e){x.MxManager.getMxDbTextureManager().loadImage(t,e)},r.loadSVG=function(t,e,n,i){x.MxManager.getMxDbSvgManager().loadSVG(t,e,n,i)},r.initMxDbEntityType=function(t){x.MxManager.getMxDbEntityClassHierarchy().init(t)},r.initDynamicCreate=function(t){x.MxManager.getMxDbEntityClassHierarchy().initDynamic(t)},r.ceneratecursor=function(t,e,n,i){void 0===t&&(t=128),void 0===e&&(e=10),void 0===n&&(n=!0);var r=document.createElement("canvas");r.width=r.height=t,r.style.background="transparent";var a=r.getContext("2d"),o=t%2==0?-.5:0,s=e%2==0?-.5:0;a.strokeStyle=i||"#fff",n&&(a.beginPath(),a.moveTo(r.width/2+o,o),a.lineTo(r.width/2+o,r.height+o),a.stroke(),a.beginPath(),a.moveTo(o,r.height/2+o),a.lineTo(r.width+o,r.height/2+o),a.stroke()),a.beginPath(),a.strokeRect(t/2-e/2+s,t/2-e/2+s,e,e),a.stroke();var l=new Image;return l.src=r.toDataURL("image/png"),l.src},r.getMrxDbgUtilsClass=function(){return F.MrxDbgUtils}},{"./MrxDbgUtils":20,"./MxCAD/MxCADEditDisplay":21,"./MxDrawCommands":28,"./MxDrawData":29,"./MxDrawObject":30,"./MxDrawObject2d":31,"./MxDrawObject3d":32,"./MxLocalFileLoad":35,"./MxManager":36,"./MxThreeJS":44,"./MxTools":45,"./MxVersion":47,"./MxWindowsEvent":48,"./Operate/MxCmdRunManager":53,"./Operate/MxJigCmdManager":58,"./Operate/MxJigGetLine":59,"./TempTest/MxTestJig":63,"./UI/MxUiObjectMobile":65,"./UI/MxUiObjectPC":66,"./UI/MxUiVue":67,three:19}],35:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxLocalDwgFileLoad=n.MxLocalFileLoad=n.MxLocalNodeJs=void 0;var i=t("./MxFun"),r=(a.prototype.init=function(t){this.loadFileCall=t.loadFileFun},a.prototype.loadFile=function(t,e,n,i,r){null!=this.loadFileCall?this.loadFileCall(t,e,n,i,r):r(void 0)},a);function a(){this.loadFileCall=null}n.MxLocalNodeJs=r;var o=(s.prototype.setPath=function(t){this.path=t},s.prototype.setBinary=function(t){this.isBinary=t},s.prototype.load=function(t,e,n,r){i.MxFun.getNodeJs().loadFile(this.path+t,this.isBinary,e,n,r)},s);function s(){this.path="",this.isBinary=!1}n.MxLocalFileLoad=o;var l=(c.prototype.setShowloading=function(t){this._isShowLoading=t},c.prototype.load=function(t,e){var n="$"+e+".mxb1.wgh";this._path=t,this._filename=e;var i=this;this.getFile(this._path,n,!1,function(t){"string"==typeof t?i.net.onStaticHeadMessage(t):console.log("mx error h1")},function(){console.log("mx get "+n+" faild")})},c.prototype.getDatas=function(){if(this._iGet>=this._dataNum)this._isShowLoading&&i.MxFun.hideLoading();else{var t=this._dataType[this._iGet];this._iGet++;var e=this,n=this._iGet+1,r="$"+this._filename+".mxb"+n+".wgh",a=0!=t;this.getFile(this._path,r,a,function(t){e.net.onStaticMessage(t),e.getDatas()},function(){e._dataNum=0,e._iGet=0,e._isShowLoading&&i.MxFun.hideLoading(),console.log("mx get "+r+" faild")})}},c.prototype.onRenderHead=function(t){var e=JSON.parse(t);this._dataType=e.type,this._dataNum=e.count,this._iGet=0,this._isShowLoading&&i.MxFun.showLoading(),this.getDatas()},c.prototype.getFile=function(t,e,n,i,r){var a=new o;a.setPath(t),a.setBinary(n),a.load(e,i,function(){},r)},c);function c(t){this.net=null,this._dataNum=0,this._iGet=0,this._dataType=[],this._path="",this._filename="",this._isShowLoading=!0,this.net=t}n.MxLocalDwgFileLoad=l},{"./MxFun":34}],36:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxManager=n.MxCpp=n.MxData=void 0;var i,r,a=t("./View/MxDbEntity"),o=t("./View/MxDbTextureManager"),s=t("./SVGLoader/MxSVGLoader");(r=i||(n.MxData=i={})).iSelectRenderOrder=5,r.iCADMeshRenderOrder=10,r.iCADCurveRenderOrder=20,r.iMxEntityRenderOrder=30,r.iGripRenderOrder=110,r.iDynJigRenderOrder=120;var l,c,u,h,p,d,f,m,g,v,y,x=(b.prototype.init=function(t){this.imp=t},b.prototype.NewMdGePoint3d=function(t){return this.imp?this.imp.NewMdGePoint3d(t):null},b);function b(){}n.MxCpp=x,c=l||(n.MxManager=l={}),u=[],h=null,d=[],f=void(p=0),m=new o.MxDbTextureManager,g=new s.MxSvgManager,v=new a.MxDbEntityClassHierarchy,y=new x,c.add=function(t){u.push(t)},c.initMxCpp=function(t){y.init(t)},c.getMxCpp=function(){return y},c.allocId=function(){return++p},c.getMxDbEntityClassHierarchy=function(){return v},c.getMxDbTextureManager=function(){return m},c.getMxDbSvgManager=function(){return g},c.outDebugString=function(t){null==f?console.log(t):f(t)},c.setOutDebugCall=function(t){f=t},c.onLoad=function(){for(var t in u)u[t].onLoad("")},c.updateDisplay=function(){for(var t in u)u[t].updateDisplay()},c.currentMx=function(){return h},c.setCurrentMx=function(t){h=t},c.initResize=function(){for(var t in u)u[t].initResize()},c.addSelectEvent=function(t){d.push(t)},c.clearSelectEvent=function(){d=[]},c.callSelectObject=function(t){for(var e in d)if(1==d[e](t))break},c.getMxObject=function(t){if("number"==typeof t){for(var e in u)if(u[e].getId()===t)return u[e]}else for(var e in u)if(u[e].getCanvas()===t)return u[e];return null}},{"./SVGLoader/MxSVGLoader":61,"./View/MxDbEntity":71,"./View/MxDbTextureManager":76}],37:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxMaterial=void 0;var i,r=t("three");!function(t){t.shaderUniforms={crAmbient:{value:new r.Vector3(1,0,0)},crDiffuse:{value:new r.Vector3(1,0,0)},crSpecular:{value:new r.Vector3(1,0,0)}},t.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),t.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),t.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),t.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),t.m_selectMaterial=new r.MeshPhongMaterial({color:255,opacity:.2,transparent:!0,side:r.DoubleSide}),t.m_mouseMoveMaterial=new r.MeshPhongMaterial({color:16776960,side:r.DoubleSide}),t.m_lockedMaterial=new r.MeshPhongMaterial({color:197379,side:r.DoubleSide}),t.m_samplePoints=new r.PointsMaterial({color:255,depthTest:!1,size:8}),t.m_samplePointsMouseMove=new r.PointsMaterial({color:16711680,depthTest:!1,size:12});var e=new r.MeshBasicMaterial({color:16777215,transparent:!0,depthTest:!1,side:r.DoubleSide,opacity:1,stencilWrite:!1,colorWrite:!1});t.getStencilMaterial=function(){return e},t.GetColorByIndex=function(e){return t.m_arrSystemColors[e]},t.GetColorMaterial=function(e){var n=t.m_arrDefUseMaterials[e];return null===n&&(n=new r.MeshLambertMaterial({color:t.m_arrSystemColors[e],side:r.DoubleSide}),t.m_arrDefUseMaterials[e]=n),n},t.GetBaseColorMaterial=function(e){var n=t.m_arrDefUseBasicMaterials[e];return null===n&&(n=new r.MeshBasicMaterial({color:t.m_arrSystemColors[e],side:r.DoubleSide}),t.m_arrDefUseMaterials[e]=n),n},t.GetCurveColorMaterial=function(e){var n=t.m_arrDefUseCurveMaterials[e];return null===n&&(n=new r.LineBasicMaterial({color:t.m_arrSystemColors[e],linewidth:1}),t.m_arrDefUseCurveMaterials[e]=n),n},t.GetSelectMaterial=function(){return t.m_selectMaterial},t.GetMouseMoveMaterial=function(){return t.m_mouseMoveMaterial},t.GetLockedMaterial=function(){return t.m_lockedMaterial},t.GetSamplePointsMaterial=function(){return t.m_samplePoints},t.GetSamplePointsMouseMoveMaterial=function(){return t.m_samplePointsMouseMove},t.createMaterial=function(t){var e=void 0;if(null==t)return e;function n(t,e){if(null!=e.map){var n=e.map,i=(new r.TextureLoader).load(n);i.wrapS=i.wrapT=r.RepeatWrapping,t.map=i,t.side=r.DoubleSide}}return 0!=t.transparent?t.transparent=!0:t.transparent=!1,"MeshPhongMaterial"==t.name?n(e=new r.MeshPhongMaterial(t),t):"MeshBasicMaterial"==t.name?n(e=new r.MeshBasicMaterial(t),t):"MeshDepthMaterial"==t.name?n(e=new r.MeshDepthMaterial(t),t):"MeshNormalMaterial"==t.name?n(e=new r.MeshNormalMaterial(t),t):"MeshLambertMaterial"==t.name?n(e=new r.MeshLambertMaterial(t),t):"MeshStandardMaterial"==t.name&&n(e=new r.MeshStandardMaterial(t),t),e}}(i||(n.MxMaterial=i={}))},{three:19}],38:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxHFileLoad=n.MxNet=n.MxNetBinMessageType=n.MxNetSend=n.MxNetMessage=n.MxNetMessageType=n.MxNetData=void 0;var i,r,a=t("three"),o=t("./MxFun"),s=t("pako"),l=t("./MxManager"),c=t("./MxDrawData"),u=(h.prototype.getId=function(){return this._dataView.getInt32(4,!0)},h.prototype.getVersion_MwBlobHead=function(){return this._dataView.getInt32(60,!0)},h.prototype.getVersion_MwBlobHeadDynLen=function(){return this._dataView.getInt32(4,!0)},h.prototype.getdPointCurveBuffersHead=function(){var t={};return t.ver=this._dataView.getInt32(4,!0),t.databaseIndex=this._dataView.getInt32(8,!0),t.zeroLayerIdIndex=this._dataView.getInt32(16,!0),t.datacount=this._dataView.getInt32(20,!0),t.datasize=this._dataView.getInt32(24,!0),t},h.prototype.getdPointMeshBuffersHead=function(){var t={};return t.ver=this._dataView.getInt32(4,!0),t.databaseIndex=this._dataView.getInt32(8,!0),t.id=this._dataView.getInt32(12,!0),t.zeroLayerIdIndex=this._dataView.getInt32(16,!0),t.datacount=this._dataView.getInt32(20,!0),t.datasize=this._dataView.getInt32(24,!0),t},h.prototype.getdPointTextureBuffersHead=function(){var t={};return t.ver=this._dataView.getInt32(4,!0),t.databaseIndex=this._dataView.getInt32(8,!0),t.zeroLayerIdIndex=this._dataView.getInt32(16,!0),t.datacount=this._dataView.getInt32(20,!0),t.datasize=this._dataView.getInt32(24,!0),t},h.prototype.getBlobHeadForMemorySectionsHead=function(t){var e={};return e.type=this._dataView.getInt32(t,!0),t+=4,e.ver=this._dataView.getInt32(t,!0),t+=4,e.databaseIndex=this._dataView.getInt32(t,!0),t+=4,e.nOffset=t,e},h.prototype.getMemorySectionsHead=function(){var t=this.getBlobHeadForMemorySectionsHead(0);return t.zeroLayerIdIndex=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datacount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},h.prototype.getMemorySectionHead=function(t){var e=this.getBlobHeadForMemorySectionsHead(t);return t=e.nOffset,e.pointCount=this._dataView.getInt32(t,!0),t+=4,e.layerId=this._dataView.getInt32(t,!0),t+=4,e.blkId=this._dataView.getInt32(t,!0),t+=4,e.memColor=this._dataView.getInt32(t,!0),t+=4,e.memId=this._dataView.getInt32(t,!0),t+=4,e.memType=this._dataView.getInt32(t,!0),t+=4,e.offset=t,e},h.prototype.getdPointTextureBufferDataHead=function(t){t+=4,t+=4,t+=4;var e={};return e.dataCount=this._dataView.getInt32(t,!0),t+=4,e.layerId=this._dataView.getInt32(t,!0),t+=4,e.blkId=this._dataView.getInt32(t,!0),t+=4,e.offset=t,e},h.prototype.getdPointCurveBufferDataHead=function(t){t+=4,t+=4,t+=4;var e={};return e.pointCount=this._dataView.getInt32(t,!0),t+=4,e.layerId=this._dataView.getInt32(t,!0),t+=4,e.blkId=this._dataView.getInt32(t,!0),t+=4,e.offset=t,e},h.prototype.getdPointMeshBufferDataHead=function(t){t+=4,t+=4,t+=4;var e={};return e.pointCount=this._dataView.getInt32(t,!0),t+=4,e.layerId=this._dataView.getInt32(t,!0),t+=4,e.blkId=this._dataView.getInt32(t,!0),t+=4,e.offset=t,e},h.prototype.getDatabaseIndex=function(){return this._dataView.getInt32(8,!0)},h.prototype.getColorIndex=function(){return this._dataView.getInt32(24,!0)},h.prototype.getBufferType=function(){return this._dataView.getInt32(32,!0)},h.prototype.getIsSketchEntity=function(){return this._dataView.getInt32(40,!0)},h.prototype.getLayerId=function(){return this._dataView.getInt32(44,!0)},h.prototype.getBlockId=function(){return this._dataView.getInt32(48,!0)},h.prototype.getVertexBufferSize=function(){return this._dataView.getInt32(12,!0)},h.prototype.getIndexBufferSize=function(){return this._dataView.getInt32(16,!0)},h.prototype.getZeroLayerId=function(){return this._dataView.getInt32(52,!0)},h.prototype.getSelectMark=function(){return this._dataView.getInt32(56,!0)},h.prototype.getMateria=function(){var t=this._dataView.getInt32(36,!0);if(0==t)return"";for(var e=[],n=0;n<t;n++){var i=String.fromCharCode(this._dataView.getUint8(80+n));e.push(i)}return e.join("")},h.prototype.getDrawDataOffset=function(){return this._dataView.getInt32(36,!0)+80},h.prototype.getMesh=function(){var t=this._dataView.getInt32(4,!0),e=0==this._dataView.getInt32(32,!0),n={},i=this._dataView.getInt32(12,!0),r=this._dataView.getInt32(16,!0);if(0===i||0===r)return n.size=80,n;var o,s=new a.Geometry,l=80;o=e?i/4/8:i/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;e?(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=r/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=t,n.isSketchEntity=x,n.nColorIndex=this._dataView.getInt32(24,!0),n},h.prototype.getCurve=function(t){var e,n=this._dataView.getInt32(32,!0),i=this.getIsSketchEntity(),r=0==n,o={};if((e=r?this._dataView.getInt32(20,!0)/4/3:this._dataView.getInt32(20,!0)/4/2)<2)return o;for(var s=new a.Geometry,l=t,c=0;c<e;c++){var u=this._dataView.getFloat32(l,!0);l+=4;var h=this._dataView.getFloat32(l,!0);l+=4;var p=0;r&&(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=i,o.colorIndex=this._dataView.getInt32(28,!0),o},h);function h(t){this._dataView=t}n.MxNetData=u,(r=i||(n.MxNetMessageType=i={})).kAddLayer="00000007",r.kClearLayer="00000008",r.kHideLayer="00000009",r.kShowLayer="00000010",r.kUpdateDisplayRange="00000011",r.kCallJsReturn="00000012",r.kLayerData="00000013",r.kSendDebugString="00000014",r.kShowLoading="00000015",r.kHideLoading="00000016",r.kSelectObject="00000017",r.kGlRenderHead="00000018",r.kUserLoginResult="00000019",r.kOpenFileResult="00000020",r.kServerReturn="00000021",r.kMxCADLayerData="00000056",r.kMxCADSystemVariable="00000057";var p=(d.prototype.setJsRetCall=function(t,e,n){this.serverJsRetCall.set(e+n,t)},d.prototype.onSocketErrort=function(){this.serverJsRetCall.forEach(function(t){t(void 0)}),this.serverJsRetCall=new Map},d.prototype.Do=function(t){var e=this.net.getCurrentDatabaseId();if(-1==e){var n=t.substring(0,4);e=parseInt(n)}var i=t.substring(4,12),r=t.substring(12);return null!=this.messageCall[i]&&(this.messageCall[i](r,e),!0)},d);function d(t,e){this.messageCall=new Map,this.serverJsRetCall=new Map,this.net=null,this.net=e;var n=this;this.messageCall[i.kUpdateDisplayRange]=function(e){if(!n.net.isTzDwgStaticFile()){e=e.replace(/\\/g,"\\\\");try{var i=JSON.parse(e);if(null!=i&&t.is2D()){t.initCAD2Doc(new a.Matrix4),i.newbrownermode?i.DToSMat?c.MxDrawData.m_isCorrectLargeCoordinates?(t.intiDoc2Wold(new a.Matrix4),t.initCAD2Doc(i.DToSMat)):t.intiDoc2Wold(i.DToSMat):t.intiDoc2Wold(new a.Matrix4):t.intiDoc2Wold(i.DToWMat),t.updateCameraDisplayRange(new a.Vector3(+i.pt1[0],+i.pt1[1],+i.pt1[2]),new a.Vector3(+i.pt2[0],+i.pt2[1],+i.pt2[2]),+i.viewangle),t.initAllLayoutName(i.layout),t.updateDisplay(!0);var r=o.MxFun.getUiObj();null!=r&&(r.SetLayoutData(i.layout),r.UpDisplayLayout())}}catch(e){console.log("UpdateDisplayRange exception")}}},this.messageCall[i.kCallJsReturn]=function(t){if(0!=t.length){var e=JSON.parse(t);0==e.cmd.length&&(e.cmd="__mx_loadcode");var i=e.cmd+e.count,r=n.serverJsRetCall.get(i);r&&(n.serverJsRetCall.delete(i),"string"==typeof e.ret&&(e.ret=e.ret.replace(/\'/g,'"')),r(e.ret))}else console.log("assert(0),kCallJsReturn return empty")},this.messageCall[i.kSendDebugString]=function(t){l.MxManager.outDebugString(t)},this.messageCall[i.kUserLoginResult]=function(e){t.userLoginResult(e)},this.messageCall[i.kOpenFileResult]=function(e){t.openFileResult(e)},this.messageCall[i.kServerReturn]=function(e){t.serverReturn(e)},this.messageCall[i.kShowLoading]=function(t){n.net.isTzDwgStaticFile()||o.MxFun.showLoading()},this.messageCall[i.kHideLoading]=function(e){n.net.isTzDwgStaticFile()||(o.MxFun.hideLoading(),t.callInitCompleteEvent())},this.messageCall[i.kSelectObject]=function(t){var e=JSON.parse(t);l.MxManager.callSelectObject(parseInt(e.id))},this.messageCall[i.kGlRenderHead]=function(e){t.isStaticLocalLoad()?t.getStaticLocalNet().onRenderHead(e):(n.net.isTzDwgStaticFile()?t.getStaticLoadTzNet():t.getStaticNet()).onRenderHead(e)},this.messageCall[i.kMxCADLayerData]=function(e,n){t.getMxCAD().getOpenDisplay().OnMessageLayerData(e)},this.messageCall[i.kMxCADSystemVariable]=function(e,n){t.sysVariable().OnMessageMxCADSystemVariable(e)},this.messageCall[i.kLayerData]=function(e,n){if(0==n){if(t.addLayerInfoComplete(),null!=(s=JSON.parse(e))){if(!s.isSketch){var i=s.list;for(var r in i)t.addLayerInfo(i[r].id,i[r].colorvalue,i[r].name),1==i[r].zerolayer&&t.setZeroLayerId(i[r].id)}s.isSketch||t.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=t.getExtRefManager().getLayers(n);if(l.initComplete(),null!=(s=JSON.parse(e)))for(var r in i=s.list)l.add(i[r].id,i[r].colorvalue,i[r].name),1==i[r].zerolayer&&l.setZeroLayerId(i[r].id)}}}n.MxNetMessage=p;var f,m,g=(v.prototype.setWebSocket=function(t){this._webSocket=t},v.prototype.UndoMark=function(){null!=this._webSocket&&this._webSocket.send(this.SendType.kUndoMark+"")},v.prototype.DoCommand=function(t,e,n){null!=this._webSocket&&(null!=n?(this._callCount++,200<this._callCount&&(this._callCount=1),this._msg.setJsRetCall(n,t,this._callCount),null==e&&(e=""),this._webSocket.send(this.SendType.kCmdEx+","+t+","+this._callCount+","+e)):null==e?this._webSocket.send(this.SendType.kCmd+","+t):this._webSocket.send(this.SendType.kCmd+","+t+","+e))},v.prototype.OpenFile=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kOpenFile+","+t)},v.prototype.UserLogin=function(t,e,n){if(null!=this._webSocket){var i={};i.IdentitySign=t,i.RandomToken=null==e?"":e,i.Init=null==n?"":n,this._webSocket.send(this.SendType.kUserLogin+","+JSON.stringify(i))}},v.prototype.Init=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kInit+","+t)},v.prototype.CallServerJS=function(t,e,n){null!=this._webSocket&&(null==n?null==e||null==e||0==e.length?this._webSocket.send(this.SendType.kCallJS+',{"command":"'+t+'","param":"{}"}'):this._webSocket.send(this.SendType.kCallJS+',{"command":"'+t+'","param":'+e+"}"):(this._callCount++,200<this._callCount&&(this._callCount=1),this._msg.setJsRetCall(n,t,this._callCount),null==e||null==e||0==e.length?this._webSocket.send(this.SendType.kCallJS+',{"command":"'+t+'","param":"{}","count":"'+this._callCount+'"}'):this._webSocket.send(this.SendType.kCallJS+',{"command":"'+t+'","param":'+e+',"count":"'+this._callCount+'"}')))},v.prototype.CallLoadCodeToServer=function(t,e){null!=this._webSocket&&(this._msg.setJsRetCall(e,"__mx_loadcode",0),null!=t&&null!=t&&0!=t.length&&this._webSocket.send(this.SendType.kCallJS+","+t))},v.prototype.DeleteObject=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kDelete+","+t)},v.prototype.SelectObject=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kSelect+","+t)},v.prototype.QuitSelectObject=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kQuitSelect+","+t)},v.prototype.SendDragDrawEntity=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kAddDragDraw+","+t)},v.prototype.SendDragDrawRequest=function(){null!=this._webSocket&&(this.SendMousePickRay(),this._webSocket.send(this.SendType.kRequestDragDraw))},v.prototype.SendDragDrawDetermine=function(){null!=this._webSocket&&(this.SendMousePickRay(),this._webSocket.send(this.SendType.kDetermineDragDraw))},v.prototype.SendDragDrawCancel=function(){null!=this._webSocket&&this._webSocket.send(this.SendType.kCancelDragDraw)},v.prototype.SendMousePickRay=function(){this._webSocket},v);function v(t,e){this.SendType={},this._callCount=1,this._webSocket=t,this._msg=e,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=g,(m=f||(n.MxNetBinMessageType=f={})).eBlockRef=10,m.eEntitysData=14,m.eAddEntityFor2dPointTextureBuffers=15,m.eMxNewMemorySections=16,m.kMxCADBlockRef=56,m.kMxCADMemorySections=57,m.kMxCADMemorySectionsFromChange=59,m.kMxCADNotUseMemorySectionsForChage=61,m.kMxCADEntityDisplayDatas=62;var y=(x.prototype.setCurrentDatabaseId=function(t){this._iCurrentDatabaseId=t},x.prototype.getMxDrawObject=function(){return this._mx},x.prototype.getCurrentDatabaseId=function(){return this._iCurrentDatabaseId},x.prototype.isTzDwgStaticFile=function(){return-1!=this._iCurrentDatabaseId},x.prototype.onBinMessage=function(t){var e=this._mx,n=s.inflate(t),i=new DataView(n.buffer),r=i.getInt32(0,!0);this._binMessageCall.has(r)?this._binMessageCall.get(r)(i,this._iCurrentDatabaseId):(-1==this._iCurrentDatabaseId&&(0==r?e.mxWebAddEntity(i):2==r?e.getSelect().mxWebAddEntity(i):6==r?e.removeEntityFromServer(i):11==r&&e.getExtRefManager().createExternalReferences(i)),12==r?e.mxWebAddEntityFor2dPointCurveBuffers(i,this._iCurrentDatabaseId):13==r?e.mxWebAddEntityFor2dPointMeshBuffers(i,this._iCurrentDatabaseId):8==r?e.mxWebAddEntityFor2dPointCurveBuffer(i,this._iCurrentDatabaseId):9==r?e.mxWebAddEntityFor2dPointMeshBuffer(i,this._iCurrentDatabaseId):r==f.eBlockRef&&e.mxWebCreateAllBlocks(i,this._iCurrentDatabaseId))},x.prototype.socket_onErrort=function(){this._msg.onSocketErrort()},x.prototype.socket_onMessageImp=function(t,e){if(void 0===e&&(e=!1),"string"==typeof t)this._msg.Do(t);else if(e)this.onBinMessage(t);else{var n=new FileReader;n.readAsArrayBuffer(t);var i=this;n.onload=function(t){i._mx.updateDisplay(),i.onBinMessage(n.result)}}this._mx.updateDisplay()},x.prototype.initBinMessage=function(){var t=this._mx;this._binMessageCall.set(f.kMxCADBlockRef,function(e,n){t.getMxCAD().getOpenDisplay().OnMessageDisplayBlockRef(e)}),this._binMessageCall.set(f.kMxCADMemorySections,function(e,n){t.getMxCAD().getOpenDisplay().OnMessageDisplayMemorySections(e)}),this._binMessageCall.set(f.kMxCADMemorySectionsFromChange,function(e,n){t.getMxCAD().getSyncDisplay().OnMessageDisplayMemorySectionsFromChange(e)}),this._binMessageCall.set(f.kMxCADNotUseMemorySectionsForChage,function(e,n){t.getMxCAD().getSyncDisplay().OnMessageDisplayNotUseMemorySectionsForChage(e)}),this._binMessageCall.set(f.kMxCADEntityDisplayDatas,function(e,n){t.getMxCAD().getSelect().OnMessageEntityDisplayDatas(e)}),this._binMessageCall.set(f.eEntitysData,function(e,n){t.mxWebEntitysData(e,n)}),this._binMessageCall.set(f.eAddEntityFor2dPointTextureBuffers,function(e,n){t.mxWebAddEntityFor2dPointTextureBuffers(e,n)}),this._binMessageCall.set(f.eMxNewMemorySections,function(e,n){t.mxWebAddEntityForMemorySections(e,n)})},x.prototype.init=function(t,e){var n=this;this._mx=t,this._msg=new p(t,this),this.initBinMessage(),e&&(this._webSocket=new WebSocket(o.MxFun.getMxServer()),this._webSocket.onopen=function(){var t=n._mx.getIniParam();if(0!=t.length){for(var e="{",i=t.length,r=0;r<i;r++)e=0==r?e+'"'+t[r][0]+'":"'+t[r][1]+'"':e+',"'+t[r][0]+'":"'+t[r][1]+'"';e+="}",n._send.Init(e)}},this._webSocket.onmessage=function(t){n.socket_onMessageImp(t.data)},this._webSocket.onerror=function(){console.log("mx: socket error"),n.socket_onErrort()}),this._send=new g(this._webSocket,this._msg)},x.prototype.closeWebSocket=function(){this._webSocket&&(this._send.setWebSocket(null),this._webSocket.close(),this._webSocket=null)},x.prototype.getOnMessage=function(){return this._msg},x.prototype.getSend=function(){return this._send},x.prototype.onStaticMessage=function(t){try{return this.socket_onMessageImp(t,!0),!0}catch(t){return console.log("mx file data error!"),console.log(t),!1}},x.prototype.onStaticHeadMessage=function(t){return"string"==typeof t&&this._msg.Do(t)},x);function x(){this._webSocket=null,this._send=null,this._msg=null,this._mx=null,this._binMessageCall=new Map,this._iCurrentDatabaseId=-1}n.MxNet=y;var b=(w.prototype.stopAllLoading=function(){this._isStopLoading||(this._isStopLoading=!0,this._isShowLoading&&o.MxFun.hideLoading())},w.prototype.setShowloading=function(t){this._isShowLoading=t},w.prototype.showLoading=function(){this._isShowLoading&&o.MxFun.showLoading()},w.prototype.hideLoading=function(t){this._isStopLoading||(this._isShowLoading&&o.MxFun.hideLoading(),this.net.getMxDrawObject().callInitCompleteEvent(),this.net.getMxDrawObject().callOpenFileComplete(t))},w.prototype.setRequestHeader=function(t){this._requestHeader=t},w.prototype.setUrlParam=function(t){this._urlParam=t},w.prototype.load=function(t,e){var n=o.MxFun.curPath(),i=o.MxFun.dwgDir(),r=o.MxFun.getStaticServer(),a="/buf/";if("wgh"==t.substring(t.lastIndexOf(".")+1).toLowerCase()){a="/";var s=t.substring(0,t.indexOf(".mxb1.wgh")).split("/");"$"==(t=1==s.length?s[0]:(r=t.substring(0,t.lastIndexOf("/")),s[s.length-1]))[0]&&(t=t.substring(1))}var l="$"+(t=encodeURIComponent(t))+".mxb1.wgh";0!=r.length?n=r+a:0!=i.length?n=n+"/"+i+a:n+=a,this._path=n,this._filename=t,1<(this._staticLoadingOpenFiles=e).length&&(l=e[0],this._path=void 0);var c=this;this.getFile(this._path,l,function(t){if(!c._isStopLoading)return"string"!=typeof t?(console.log("mx error h1"),void c.hideLoading(4)):c.net.onStaticHeadMessage(t)?void 0:(console.log("mx error h1:"+t),void c.hideLoading(2))},function(){c.hideLoading(3),console.log("mx get "+l+" faild")})},w.prototype.getData=function(){if(this._isStopLoading)this.hideLoading(5);else if(this._iGet>=this._dataNum)this.hideLoading(0);else{var t=this._dataType[this._iGet];this._iGet++;var e=this,n=this._iGet+1,i="$"+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(7);i=this._staticLoadingOpenFiles[this._iGet]}var r=i;this._path&&(r=this._path+i);var a=r.substring(0,r.lastIndexOf("/")+1);if(this.net.getMxDrawObject().setCurrentLoadUrl(a),0==t)this.getFile(this._path,i,function(t){e._isStopLoading||(e.net.onStaticMessage(t)||(console.log(this._path),console.log(i)),e.getData())},function(){e._dataNum=0,e._iGet=0,e.hideLoading(8),console.log("mx get "+i+" faild")});else{var o=new XMLHttpRequest,s=i;this._path&&(s=this._path+i),0!=this._urlParam.length?o.open("GET",s+this._urlParam):o.open("GET",s),c.MxDrawData.m_isRequestHeaderCacheControl&&o.setRequestHeader("Cache-Control","max-age=7200"),0!=this._requestHeader.length&&o.setRequestHeader("usertoken",this._requestHeader),o.responseType="arraybuffer",o.onload=function(){e._isStopLoading||(e.net.onStaticMessage(o.response)||console.log(s),e.getData())},o.addEventListener("error",function(t){e._dataNum=0,e._iGet=0,e.hideLoading(9),console.log("mx get "+i+" faild")},!1),o.send()}}},w.prototype.onRenderHead=function(t){if(!this._isStopLoading){var e=JSON.parse(t);this._dataType=e.type,this._dataNum=e.count,this._iGet=0,this.showLoading(),this.getData()}},w.prototype.getFile=function(t,e,n,i){var r=new a.FileLoader(this.manager);r.setPath(t);var o=e;0!=this._urlParam.length&&(o=e+this._urlParam),0!=this._requestHeader.length&&(r.requestHeader={usertoken:this._requestHeader}),r.load(o,n,function(){},i)},w);function w(t,e){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._isStopLoading=!1,this._urlParam="",this.net=t,this.manager=void 0!==e?e:a.DefaultLoadingManager}n.MxHFileLoad=b},{"./MxDrawData":29,"./MxFun":34,"./MxManager":36,pako:1,three:19}],39:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxSelect=void 0;var i=t("three"),r=t("three.meshline"),a=t("./MxFun"),o=t("./MxNetData"),s=t("./MxMaterial"),l=(c.prototype.removeAll=function(){this._mapSelectMark2Entity=new Map},c.prototype.addEntity=function(t,e){var n=this._mapSelectMark2Entity.get(t);null==n&&(n=new Array,this._mapSelectMark2Entity.set(t,n)),n.push(e)},c.prototype.removeEntity=function(t){var e=new Map,n=function(t,e){var n=this.mx.getScene(),i=e;return function(e,r,o){if(null==t||r!=t)for(var s in e)a.MxFun.removeThreejsObject(e[s],n);else{var l=e.concat();i.set(t,l)}}}.call(this,t,e);this._mapSelectMark2Entity.forEach(n),this._mapSelectMark2Entity=e},c.prototype.init=function(){var t=this;t.domElement.addEventListener("mousedown",function(e){if(!1!==t.enabled&&!t.tmpDisable&&e.button==i.MOUSE.LEFT){var n=t.mx.screenCoord2Doc(e.clientX,e.clientY,0),r=t.mx.screenCoordLong2Doc(10),o=a.MxFun.formatString("[{0},{1},{2},{3}]",n.x.toString(),n.y.toString(),"0",r.toString());t.mx.callCommand("Mx_Select",o)}},!1)},c.prototype.mxWebAddEntity=function(t){var e=new o.MxNetData(t),n=e.getSelectMark();this.removeEntity(n);var i=this.mxWebAddEntity_3DChild(e);this.mxWebAddEntity_Curve(e,i)},c.prototype.mxWebAddEntity_3DChild=function(t){var e=t.getMesh();if(null==e.id)return e.size;var n=new i.Mesh(e.geometry,s.MxMaterial.GetBaseColorMaterial(1));this.mx.getScene().add(n);var r=t.getSelectMark();return this.addEntity(r,n),e.size},c.prototype.mxWebAddEntity_Curve=function(t,e){var n=t.getCurve(e);if(null!=n.id){var a=this.mx.getViewWidth(),o=this.mx.getViewHeight();this._material.resolution=new i.Vector2(a,o);for(var s=t.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 r.MeshLine;f.setGeometry(d);var m=new i.Mesh(f.geometry,this._material);c.add(m),this.addEntity(s,m)}}},c);function c(t,e){this.enabled=!0,this.tmpDisable=!1,this.mx=void 0,this.domElement=void 0,this._mapSelectMark2Entity=new Map,this._material=new r.MeshLineMaterial({useMap:!1,color:new i.Color(16711680),opacity:.5,resolution:new i.Vector2(500,500),sizeAttenuation:!1,lineWidth:10,transparent:!0}),this.mx=t,this.domElement=void 0!==e?e:document}n.MxSelect=l},{"./MxFun":34,"./MxMaterial":37,"./MxNetData":38,three:19,"three.meshline":18}],40:[function(t,e,n){"use strict";var i,r;Object.defineProperty(n,"__esModule",{value:!0}),n.MxShader=void 0,(r=i||(n.MxShader=i={})).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_TEXTURE=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nattribute vec2 position; \nattribute vec2 uv; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nvarying vec2 vUv; \nvoid main(){ \nvUv = uv; \nmat4 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; \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",r.FSHADER_COLOR_POINT_TEXTURE=" precision highp float; \nvarying vec2 vUv; \nuniform sampler2D texture; \nvoid main() { \ngl_FragColor = texture2D( texture, vUv ); \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; \ngl_PointSize = 1.0;\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"},{}],41:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxStencilObject=void 0;var i=t("three"),r=t("./MxMaterial"),a=(o.prototype.object_onAfterRender=function(t){var e=this.aryMeshStencil;if(e&&0<e.length){t.getContext();var n=t.state.buffers;n.stencil.setLocked(!1),n.depth.setTest(!0),n.stencil.setTest(!1)}},o.prototype.object_onBeforeRender=function(t,e,n){var i=this.aryMeshStencil;if(i&&0<i.length){var r=t.getContext(),a=t.state.buffers;a.color.setMask(!1),a.color.setLocked(!0),a.depth.setTest(!1),a.stencil.setTest(!0),a.stencil.setMask(255),a.stencil.setClear(0),t.clearStencil(),a.stencil.setLocked(!0);var o=1,s=!0;i.forEach(function(i){s?(s=!1,a.stencil.setFunc(r.ALWAYS,o,255),a.stencil.setOp(r.KEEP,r.KEEP,r.REPLACE)):(a.stencil.setFunc(r.EQUAL,o,255),a.stencil.setOp(r.KEEP,r.KEEP,r.INCR),o++),t.mxRenderObject(i,e,n,i.material,null)}),a.color.setLocked(!1),a.color.setMask(!0),a.stencil.setMask(0),a.stencil.setFunc(r.EQUAL,o,255)}},o.prototype.associateObject=function(t,e){var n=this;e.forEach(function(t){if(3<=t.length){var e=new i.Shape(t),a=new i.ShapeGeometry(e),o=new i.Mesh(a,r.MxMaterial.getStencilMaterial());n.aryMeshStencil.push(o)}});var a=this;t.onBeforeRender=function(t,e,n){a.object_onBeforeRender(t,e,n)},t.onAfterRender=function(t){a.object_onAfterRender(t)}},o);function o(){this.aryMeshStencil=[]}n.MxStencilObject=a},{"./MxMaterial":37,three:19}],42:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxString=void 0;var i=(r.prototype.Find=function(t){return this.m_val.indexOf(t)},r.prototype.Left=function(t){return this.m_val.substring(0,t)},r.prototype.Right=function(t){return this.m_val.substring(t+1,this.m_val.length)},r.prototype.TrimLeft=function(t){for(;0<this.m_val.length&&this.m_val[0]==t;)this.m_val=this.m_val.slice(1)},r.prototype.TrimRight=function(t){for(;0<this.m_val.length&&this.m_val[this.m_val.length-1]==t;)this.m_val=this.m_val.slice(0,-1)},r.prototype.AnalyzeString=function(t){return this.m_val.split(t)},r.prototype.IsEmpty=function(){return 0==this.m_val.length},r.prototype.MakeUpper=function(){this.m_val=this.m_val.toUpperCase()},r.prototype.MakeLower=function(){this.m_val=this.m_val.toLowerCase()},r.prototype.GetLength=function(){return this.m_val.length},r);function r(t){this.m_val="",null!=t&&(this.m_val=t)}n.MxString=i},{}],43:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxSystemVariable=void 0;var i=t("three"),r=t("./Operate/McEdJigOsnap"),a=(o.prototype.init=function(t){this.m_mxObj=t},o.prototype.getAllLinetypeName=function(){return this.m_vecLinetype},o.prototype.getSysVarBool=function(t){return null!=this.m_data[t]&&this.m_data[t]},o.prototype.setSysVarBool=function(t,e){this.m_data[t]=e},o.prototype.setSysVarPoint=function(t,e){this.m_data[t]=e},o.prototype.OnMessageMxCADSystemVariable=function(t){this.m_vecLinetype=[];var e=JSON.parse(t);if(null!=e){var n=e.vecLinetypeName;for(var i in n)this.m_vecLinetype.push(n[i]);this.m_data.CELTYPE=e.curLinetypeName,this.m_data.CLAYER=e.clayer,this.m_data.CECOLOR=e.cecolor,this.m_data.CECOLORINDEX=e.cecolorindex}this.m_mxObj.callEvent("loadSystmeVariableComplete")},o.prototype.getSysVarPoint=function(t){return null==this.m_data[t]?new i.Vector3(0,0,0):this.m_data[t]},o.prototype.setSysVarNumber=function(t,e){this.m_data[t]=e},o.prototype.getSysVarNumber=function(t){return null==this.m_data[t]?0:this.m_data[t]},o.prototype.getSysVar=function(t){return this.m_data[t]},o.prototype.setSysVar=function(t,e){this.m_data[t]=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=r.MxOsnapDefine.OsModeAll}n.MxSystemVariable=a},{"./Operate/McEdJigOsnap":49,three:19}],44:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxThreeJS=void 0;var i,r,a=t("three"),o=t("./MxFun");function s(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}(r=i||(n.MxThreeJS=i={})).createLine=function(t,e,n,i){var r,o=new a.Geometry;return r=i&&1!=i||0==i?new a.LineBasicMaterial({color:n,transparent:!0,depthTest:!1,opacity:i}):new a.LineBasicMaterial({color:n,transparent:!0,depthTest:!1}),o.vertices.push(t,e),new a.Line(o,r)},r.createCircle=function(t,e,n){var i=new a.CircleGeometry(e,64,3,2*Math.PI),r=new a.LineBasicMaterial({color:n,transparent:!0,depthTest:!1});i.vertices.shift();var o=new a.LineLoop(i,r);return o.position.x=t.x,o.position.y=t.y,o.position.z=t.z,o},r.clacTextSize=function(t,e){var n=document.createElement("canvas").getContext("2d");if(null==n)return e;var i=o.MxFun.formatString("normal {0}px Arial","256");return n.font=i,n.measureText(t).width*e/256},r.clacTextSpriteSize=function(t,e,n){e<=1e-8&&(e=1);var i=document.createElement("canvas"),r=i.getContext("2d"),a=o.MxFun.formatString("normal {0}px Arial","256");r.font=a;var l=e/256,c=0,u=[],h=!0,p=0;if(n){c=n;for(var d=0,f=0,m=0;f<t.length;f++)(g=r.measureText(t.substring(d,f+1))).width*l>c&&(p+=(g.fontBoundingBoxAscent+g.fontBoundingBoxDescent)*l,u.push(t.substring(d,f)),d=f,m++);if(d<f){var g=r.measureText(t.substring(d,f));u.push(t.substring(d,f)),p+=(g.fontBoundingBoxAscent+g.fontBoundingBoxDescent)*l,m++}h=m<=1}else p=e,c=(g=r.measureText(t)).width*l,u.push(t),h=!1;var v=p/c*(i.width=1024);return i.height=s(v),i.height<v&&(i.height*=2),0==i.height&&(i.height=512),{spritewidth:c,spriteheight:c*i.height/i.width,textwidth:c,allTextHeight:p,singleline:h}},r.creatTextSprite=function(t,e,n,i,r,l,c){n<=1e-8&&(n=1);var u=document.createElement("canvas"),h=u.getContext("2d");c?(h.font=c(256),0==h.font.length&&(h.font=o.MxFun.formatString("normal {0}px Arial","256"))):h.font=o.MxFun.formatString("normal {0}px Arial","256");var p=n/256,d=0,f=[],m=[],g=0;if(l){d=l;for(var v=0,y=0;y<t.length;y++)(b=h.measureText(t.substring(v,y+1))).width*p>d&&(g+=x=(b.fontBoundingBoxAscent+b.fontBoundingBoxDescent)*p,f.push(t.substring(v,y)),m.push(x),v=y);if(v<y){var x,b=h.measureText(t.substring(v,y));f.push(t.substring(v,y)),g+=x=(b.fontBoundingBoxAscent+b.fontBoundingBoxDescent)*p,m.push(x)}}else g=n,d=(b=h.measureText(t)).width*p,f.push(t),m.push(g);var w=g/d*(u.width=1024);u.height=s(w),u.height<w&&(u.height*=2),0==u.height&&(u.height=512);var M=1024/d,_=M*n;c?(h.font=c(_),0==h.font.length&&(h.font=o.MxFun.formatString("normal {0}px Arial",""+_))):h.font=o.MxFun.formatString("normal {0}px Arial",""+_);var S=o.MxFun.formatString("rgba({0}, {1}, {2}, 1.0)",(r>>16&255)+"",(r>>8&255)+"",(255&r)+"");h.fillStyle=S,h.textAlign="left",h.textBaseline="bottom";for(var C=0,T=0;C<f.length;C++)T+=M*m[C];for(C=0,T=.5*(u.height-T);C<f.length;C++)T+=M*m[C],h.fillText(f[C],0,T);var E=new a.Texture(u);E.needsUpdate=!0;var D=new a.SpriteMaterial({transparent:!0,depthTest:!1,map:E});D.rotation=i;var A=new a.Sprite(D);return A.scale.set(d,d/u.width*u.height,1),A.position.set(e.x,e.y,e.z),A},r.createTriangle=function(t,e,n){if(!(t.length<3)){for(var i=t.length,r=new a.Geometry,o=0;o+2<i;o+=3){r.vertices.push(t[o]),r.vertices.push(t[o+1]),r.vertices.push(t[o+2]);var s=new a.Face3(o,o+1,o+2);r.faces.push(s)}r.computeFaceNormals(),r.computeVertexNormals(),null==n&&(n=1);var l=new a.MeshBasicMaterial({color:e,transparent:!0,depthTest:!1,side:a.DoubleSide,opacity:n});return new a.Mesh(r,l)}},r.createLines=function(t,e,n){var i,r=new a.Geometry;return r.vertices=t,i=n&&1!=n||0==n?new a.LineBasicMaterial({color:e,transparent:!0,depthTest:!1,opacity:n}):new a.LineBasicMaterial({color:e,transparent:!0,depthTest:!1}),new a.Line(r,i)},r.createDashedLines=function(t,e,n,i){var r=new a.Geometry;r.vertices=t;var o=new a.Line(r,new a.LineDashedMaterial({color:e,dashSize:n,gapSize:i,transparent:!0,depthTest:!1}));return o.computeLineDistances(),o}},{"./MxFun":34,three:19}],45:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxPair=n.MxTools=void 0;var i,r,a=t("three");(r=i||(n.MxTools=i={})).AsMxWebPoint=function(t,e,n){return new a.Vector3(-t,n,e)},r.AsMxWebPoint_pt=function(t){return new a.Vector3(-t.x,t.z,t.y)},r.AsThreeJsPoint=function(t,e,n){return new a.Vector3(-t,n,e)},r.stringTrimLeftSpace=function(t){return t.replace(/^\s*/g,"")},r.stringDeleteAllSpace=function(t){return t.replace(/\s*/g,"")},r.stringTrimLeftRightSpace=function(t){return t.replace(/^\s*|\s*$/g,"")},r.stringTrimRightSpace=function(t){return t.replace(/(\s*$)/g,"")},r.IsNumerical=function(t){if("string"==typeof t){var e=/^(-(([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(t)&&!e.test(t))}var n=t.m_val;return e=/^(-(([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)&&!e.test(n))},r.formatString=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var i=0;i<e.length;i++)t=t.replace("{".concat(i,"}"),e[i]);return t},r._tstof=function(t){return parseFloat(t)},r._tstoi=function(t){return parseInt(t)},r.IsZero=function(t){return-1e-7<t&&t<1e-7},r.MillimeterToPixels=function(t){return 10*t},r.getXYPlanDistance=function(t,e){var n=new a.Vector2(t.x,t.y),i=new a.Vector2(e.x,e.y);return n.distanceTo(i)},r.MxASSERT=function(t,e){t||console.log("MxASSERT(0):"+e)},r.generateUUID=function(){return a.MathUtils.generateUUID()},n.MxPair=function(t,e){this.first=t,this.second=e}},{three:19}],46:[function(t,e,n){"use strict";var i,r,a,o;Object.defineProperty(n,"__esModule",{value:!0}),n.MxType=void 0,(a=(r=i||(n.MxType=i={})).CommandFlags||(r.CommandFlags={}))[a.MCRX_CMD_MODAL=0]="MCRX_CMD_MODAL",a[a.MCRX_CMD_TRANSPARENT=1]="MCRX_CMD_TRANSPARENT",a[a.MCRX_CMD_NO_UNDO_MARKER=2]="MCRX_CMD_NO_UNDO_MARKER",a[a.MCRX_CMD_NOPRV=4]="MCRX_CMD_NOPRV",(o=r.MxCloneType||(r.MxCloneType={}))[o.kClone=1]="kClone",o[o.kDragClone=2]="kDragClone",o[o.kMxFileClone=3]="kMxFileClone",o[o.kSaveDwgClone=4]="kSaveDwgClone"},{}],47:[function(t,e,n){"use strict";var i;Object.defineProperty(n,"__esModule",{value:!0}),n.MxBulid=void 0,window.MxDrawVersion="1.0(2023-06-30 22:15)",(i||(n.MxBulid=i={})).getVersion=function(){return window.MxDrawVersion?window.MxDrawVersion:"inalid version"}},{}],48:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxWindowsEvent=void 0;var i,r,a,o,s,l=t("./MxFun"),c=t("./Operate/MxJigCmdManager"),u=t("three"),h=t("./MxDrawData");function p(t,e){for(var n=0,i=s.length;n<i;n++){var r=s[n](t,e);if(0!=r)return r}}function d(t){o.x=t.offsetX,o.y=t.offsetY,p("mousemove",t)}function f(t){p("mouseup",t)}function m(t){p("dblclick",t)}function g(t){o.x=t.offsetX,o.y=t.offsetY,p("mousedown",t)}function v(t){var e=t||window.event||arguments.callee.caller.arguments[0];if(e&&27==e.keyCode)if(h.MxDrawData.m_isEnableIntelliSelect&&!c.MxJigCmdManager.isRunning()){var n=!1,i=l.MxFun.getCurrentMx(),r=i.getMxCAD();if(r){var a=r.getSelect().clearAllSelect(),o=r.getGrip().clearAll();(a||o)&&(n=!0)}i.getMxDatabase().getGripManager().removeAllGrips()&&(n=!0),i.getMxDatabase().getSelectManager().removeAllEntity()&&(n=!0),i.isValidMcObject()&&i.getMcObject().getGripManager().clearAll()&&(n=!0),n&&i.updateDisplay()}else c.MxJigCmdManager.isRunning()&&c.MxJigCmdManager.stopCmd()}r=i||(n.MxWindowsEvent=i={}),a=!1,o=new u.Vector2(0,0),s=new Array,r.addEvent=function(t){s.push(t)},r.getCurrentMousePostion=function(){return o},r.registEvent=function(){a||(a=!0,l.MxFun.isPC()&&(document.addEventListener("mousemove",d,!1),document.addEventListener("mouseup",f,!1),document.addEventListener("mousedown",g,!1),document.addEventListener("dblclick",m,!1),document.onkeydown=v))}},{"./MxDrawData":29,"./MxFun":34,"./Operate/MxJigCmdManager":58,three:19}],49:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.McEdJigOsnap=n.McEdImpJigGlobalData=n.MxOsnapDefine=void 0;var i,r,a,o,s,l,c,u,h,p,d,f=t("three"),m=t("../MxDrawObject"),g=t("../MxFun"),v=t("./MxJigCmdManager"),y=t("../MxTools"),x=t("../MxDrawData"),b=t("../MxWindowsEvent");(r=i||(n.MxOsnapDefine=i={}))[r.OsModeInvalid=0]="OsModeInvalid",r[r.OsModeEnd=1]="OsModeEnd",r[r.OsModeMid=2]="OsModeMid",r[r.OsModeCen=4]="OsModeCen",r[r.OsModeNode=8]="OsModeNode",r[r.OsModeQuad=16]="OsModeQuad",r[r.OsModeInt=32]="OsModeInt",r[r.OsModeIns=64]="OsModeIns",r[r.OsModePerp=128]="OsModePerp",r[r.OsModeTan=256]="OsModeTan",r[r.OsModeNear=512]="OsModeNear",r[r.OsModeApp=2048]="OsModeApp",r[r.OsModeExt=4096]="OsModeExt",r[r.OsModePar=8192]="OsModePar",r[r.OsModeOff=16384]="OsModeOff",r[r.OsModeAll=16383]="OsModeAll",o=a||(n.McEdImpJigGlobalData=a={}),s=!1,l=new f.Vector3,c=new f.Vector3,u=0,p=h=!1,d=new Array,o.setPrvPoint=function(t){l=t,p=!0},o.isOsnapZValue=function(){return!1},o.setIsValidPrvpoint=function(t){p=t},o.isValidPrvpoint=function(){return p},o.getPrvPoint=function(){return l},o.setIsValidBasepoint=function(t){s=t},o.isValidBasepoint=function(){return s},o.setBasepoint=function(t){s=!0,c=t},o.getBasepoint=function(){return c},o.initStartCommand=function(){h=s=!1},o.setIsTmpDisableOsmode=function(t){h=t},o.isTmpDisableOsmode=function(){return h},o.intiStartDrag=function(t){u=t.sysVariable().getSysVarNumber("OSMODE")},o.isEnableOsmode=function(){return!(0==u||u&i.OsModeOff||h)},o.getOSmode=function(){return u},o.addDynDrawObject=function(t){d.push(t)},o.clearDisplay=function(t){for(var e=d.length,n=0;n<e;n++)g.MxFun.removeThreejsObject(d[n],t);d=[]};var w=(M.prototype.drawLine=function(t,e,n){var i=new f.Geometry,r=new f.LineBasicMaterial({color:this.m_iColor});i.vertices.push(new f.Vector3(t.x,t.y,t.z),new f.Vector3(e.x,e.y,e.z));var o=new f.Line(i,r);n.add(o),a.addDynDrawObject(o)},M.prototype.drawPolyline=function(t,e){for(var n=new f.Geometry,i=new f.LineBasicMaterial({color:this.m_iColor}),r=t.length,o=0;o<r;o++)n.vertices.push(new f.Vector3(t[o].x,t[o].y,t[o].z));var s=new f.Line(n,i);e.add(s),a.addDynDrawObject(s)},M.prototype.setWidth=function(t){this.m_dOsmodeWdith=t},M.prototype.GetDrawRect=function(){var t=.5*this.m_dOsmodeWdith,e={};return e.left=this.m_pt.x-t,e.right=this.m_pt.x+t,e.top=this.m_pt.y-t,e.bottom=this.m_pt.y+t,e},M.prototype.DrawNear=function(t){var e=this.GetDrawRect(),n=[new f.Vector3,new f.Vector3];n[0].x=e.left,n[0].y=e.top,n[1].x=e.right,n[1].y=e.top,this.drawLine(n[0],n[1],t),n[0].x=e.left,n[0].y=e.bottom,n[1].x=e.right,n[1].y=e.bottom,this.drawLine(n[0],n[1],t),n[0].x=e.right,n[0].y=e.top,n[1].x=e.left,n[1].y=e.bottom,this.drawLine(n[0],n[1],t),n[0].x=e.right,n[0].y=e.bottom,n[1].x=e.left,n[1].y=e.top,this.drawLine(n[0],n[1],t)},M.prototype.DrawEnd=function(t){var e=this.GetDrawRect(),n=[new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3];n[0].x=e.left,n[0].y=e.top,n[1].x=e.right,n[1].y=e.top,n[2].x=e.right,n[2].y=e.bottom,n[3].x=e.left,n[3].y=e.bottom,this.drawLine(n[0],n[1],t),this.drawLine(n[1],n[2],t),this.drawLine(n[2],n[3],t),this.drawLine(n[3],n[0],t)},M.prototype.DrawMid=function(t){var e=this.GetDrawRect(),n=1.2*(e.right-e.left),i=n/2/Math.sin(60*3.14159265/180),r=i*Math.sin(.5235987750000001),a=new f.Vector3(this.m_pt.x,this.m_pt.y,this.m_pt.z);a.y-=i;var o=new f.Vector3;o.x=this.m_pt.x+n/2,o.y=this.m_pt.y+r;var s=new f.Vector3;s.x=this.m_pt.x-n/2,s.y=this.m_pt.y+r;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],t),this.drawLine(l[1],l[2],t),this.drawLine(l[2],l[3],t)},M.prototype.DrawPerp=function(t){var e=this.GetDrawRect(),n=[new f.Vector3,new f.Vector3,new f.Vector3];n[0].x=e.left,n[0].y=e.top,n[1].x=e.left,n[1].y=e.bottom,n[2].x=e.right,n[2].y=e.bottom,this.drawPolyline(n,t),n[0].x=e.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=e.bottom,this.drawPolyline(n,t)},M.prototype.DrawCircle=function(t,e,n){null==n&&(n=.5*this.m_dOsmodeWdith);for(var i=[],r=0,a=3.14159265/180;r<=360;r+=15){var o=n*Math.cos(r*a)+t.x,s=n*Math.sin(r*a)+t.y;i.push(new f.Vector3(o,s))}this.drawPolyline(i,e)},M.prototype.DrawInt=function(t){var e=this.GetDrawRect(),n=[new f.Vector3,new f.Vector3];n[0].x=e.right,n[0].y=e.top,n[1].x=e.left,n[1].y=e.bottom,this.drawLine(n[0],n[1],t),n[0].x=e.right,n[0].y=e.bottom,n[1].x=e.left,n[1].y=e.top,this.drawLine(n[0],n[1],t)},M.prototype.DrawCen=function(t){this.DrawInt(t),this.DrawCircle(this.m_pt,t)},M.prototype.DrawTan=function(t){this.DrawEnd(t)},M.prototype.DrawIns=function(t){var e=this.GetDrawRect(),n={},i=(e.right-e.left)/1.5;n.left=this.m_pt.x-i,n.right=this.m_pt.x+i,n.top=this.m_pt.y-i,n.bottom=this.m_pt.y+i;var r=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=r,o[2].y=a+2,o[3].x=r,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=r,o[6].y=a-2,o[7].x=r,o[7].y=n.top,o[8].x=n.left,o[8].y=n.top,this.drawPolyline(o,t)},M.prototype.DrawNode=function(t){var e=this.GetDrawRect(),n={},i=(e.right-e.left)/1.5;n.left=this.m_pt.x-i,n.right=this.m_pt.x+i,n.top=this.m_pt.y-i,n.bottom=this.m_pt.y+i;var r={},a=this.m_dOsmodeWdith/1.3;r.left=this.m_pt.x-a,r.right=this.m_pt.x+a,r.top=this.m_pt.y-a,r.bottom=this.m_pt.y+a;var o=[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.right,o[1].y=n.bottom,o[2].x=n.left,o[2].y=n.bottom,o[3].x=n.right,o[3].y=n.top,this.drawLine(o[0],o[1],t),this.drawLine(o[2],o[3],t),this.DrawCircle(this.m_pt,t,a)},M.prototype.upDisplay=function(t,e,n){this.m_pt=t,this.m_osmode=e,this.clearDisplay(n);var i=n.getMxObject().getTheTempDrawContainer(),r=.5*this.m_dOsmodeWdith;if(this.m_osmode!=v.MxJigCmdManager.OsnapMode.kOsModekValid)if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeNear)this.DrawNear(i);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeEnd)this.DrawEnd(i);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeMid)this.DrawMid(i);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModePerp)this.DrawPerp(i);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeInt)this.DrawInt(i);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeCen)this.DrawCen(i);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeTan)this.DrawTan(i);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeIns)this.DrawIns(i);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeNode)this.DrawNode(i);else{var a=new f.Vector3(t.x-r,t.y-r,0),o=new f.Vector3(t.x+r,t.y+r,0);this.drawLine(a,o,i);var s=new f.Vector3(t.x-r,t.y+r,0),l=new f.Vector3(t.x+r,t.y-r,0);this.drawLine(s,l,i)}},M.prototype.clearDisplay=function(t){var e=t.getMxObject().getTheTempDrawContainer();a.clearDisplay(e)},M);function M(){this.m_iColor=16711935,this.m_pt=new f.Vector3,this.m_osmode=v.MxJigCmdManager.OsnapMode.kOsModekValid,this.m_dOsmodeWdith=10}var _=(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 t=this;if(this.m_isRuning){var e={ptx:this.m_pt.x,pty:this.m_pt.y,osmode:this.m_lOSmode,isValidPrvInputPoint:this.m_isValidPrvInputPoint};this.m_isValidPrvInputPoint&&(e.prvPtx=this.m_prvInputPoint.x,e.prvPty=this.m_prvInputPoint.y);var n=this.m_mxJig.getMxObject();if(n.getRunMode()==m.MxRunMode.kBrowse){var i=this,r=b.MxWindowsEvent.getCurrentMousePostion();n.getObjectOsnap().getOsnapData(r,function(t,e){t=n.worldCoord2Doc(t.x,t.y,t.z),i.m_ptSnapPoint.x=t.x,i.m_ptSnapPoint.y=t.y,i.m_ptSnapPoint.z=0,i.m_ptSnapSrcPoint.x=i.m_pt.x,i.m_ptSnapSrcPoint.y=i.m_pt.y,i.m_ptSnapSrcPoint.z=0,i.m_osmode=e,i.m_draw.setWidth(n.screenCoordLong2Doc(x.MxDrawData.getCursorWidthPixels())),i.m_draw.upDisplay(new f.Vector3(t.x,t.y,0),e,i.m_mxJig)})}else if(n.getRunMode()==m.MxRunMode.kCPPMxCAD){var a=this;e.SearchRnge=n.screenCoordLong2Doc(x.MxDrawData.getCursorWidthPixels()),n.getMcObject().onNotifyOsnap(e,function(e){t.m_ptSnapPoint.x=e.ptsx,t.m_ptSnapPoint.y=e.ptsy,t.m_ptSnapPoint.z=e.ptsz,t.m_ptSnapSrcPoint.x=e.ptx,t.m_ptSnapSrcPoint.y=e.pty,t.m_ptSnapSrcPoint.z=0,t.m_osmode=e.osmode,a.m_draw.setWidth(n.screenCoordLong2Doc(x.MxDrawData.getCursorWidthPixels())),a.m_draw.upDisplay(new f.Vector3(e.ptsx,e.ptsy,e.ptsz),e.osmode,a.m_mxJig)})}else{e.SearchRnge=n.screenCoordLong2Doc(x.MxDrawData.getCursorWidthPixels());var o=this;n.callCommand("MxCAD_NotifyOsnap",JSON.stringify(e),function(e){if(!("string"!=typeof e||e.length<1)&&o.m_isRuning){var i=JSON.parse(e);t.m_ptSnapPoint.x=i.ptsx,t.m_ptSnapPoint.y=i.ptsy,t.m_ptSnapPoint.z=i.ptsz,t.m_ptSnapSrcPoint.x=i.ptx,t.m_ptSnapSrcPoint.y=i.pty,t.m_ptSnapSrcPoint.z=0,t.m_osmode=i.osmode,o.m_draw.setWidth(n.screenCoordLong2Doc(x.MxDrawData.getCursorWidthPixels())),o.m_draw.upDisplay(new f.Vector3(i.ptsx,i.ptsy,i.ptsz),i.osmode,o.m_mxJig)}})}}},S.prototype.startDrag=function(t,e){this.m_mxJig=e;var n,i,r=this.m_mxJig.getMxObject();function a(){n.notifyOsnapToServer()}return e.isDisableOsnap()?this.m_isEnable=!1:this.m_isEnable=!0===r.getInisetValue(m.IniSetName.kEnableOsnapFunction),this.m_isOffsetInputPostion=t,this.m_isRuning=!0,this.m_draw.setWidth(r.screenCoordLong2Doc(x.MxDrawData.getCursorWidthPixels())),this.resetData(),this.m_notifyOsnap_delayCall=(n=this,40,i=null,function(){clearTimeout(i),i=setTimeout(a,40)}),!0},S.prototype.endDrag=function(){return this.m_isRuning=!1,this.m_draw.clearDisplay(this.m_mxJig),!0},S.prototype.reCompteCurrentPoint=function(t){return t},S.prototype.isEnable=function(){return this.m_isEnable&&a.isEnableOsmode()},S.prototype.notifyOsnap=function(t,e){this.m_lOSmode=t,null==e?this.m_isValidPrvInputPoint=!1:(this.m_isValidPrvInputPoint=!0,this.m_prvInputPoint=e),this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModekValid&&this.m_draw.clearDisplay(this.m_mxJig),this.m_notifyOsnap_delayCall()},S.prototype.setPoint=function(t,e){if(this.isEnable()){null==t?(this.m_isValid=!1,this.m_osmode=v.MxJigCmdManager.OsnapMode.kOsModekValid):(-1==this.m_iLongprogressStatus||this.m_iLongprogressStatus,this.m_pt=t,this.m_inPoint=t,this.m_isValid=!0,(null==e||this.m_osmode!=v.MxJigCmdManager.OsnapMode.kOsModekValid&&y.MxTools.getXYPlanDistance(this.m_ptSnapSrcPoint,t)>e)&&(this.m_osmode=v.MxJigCmdManager.OsnapMode.kOsModekValid));var n=a.getOSmode(),i=a.getPrvPoint();this.notifyOsnap(n,a.isValidPrvpoint()?i:void 0)}},S.prototype.seInValidPoint=function(){this.setPoint(void 0)},S.prototype.getCurrentOSnapPoint=function(t){var e={};return this.isEnable()?(e.pt=t,e.osmode=this.m_osmode,this.m_osmode!=v.MxJigCmdManager.OsnapMode.kOsModekValid?(e.pt.x=this.m_ptSnapPoint.x,e.pt.y=this.m_ptSnapPoint.y,e.pt.z=this.m_ptSnapPoint.z,a.isOsnapZValue()||(t.z=0)):e.pt=t):(e.pt=t,e.osmode=v.MxJigCmdManager.OsnapMode.kOsModekValid),e},S.prototype.setLongprogressStatus=function(t){this.m_iLongprogressStatus=t},S.prototype.reComputeOffset=function(){},S);function S(t){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=t,this.m_draw=new w}n.McEdJigOsnap=_},{"../MxDrawData":29,"../MxDrawObject":30,"../MxFun":34,"../MxTools":45,"../MxWindowsEvent":48,"./MxJigCmdManager":58,three:19}],50:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.McGiWorldDrawSelect=n.McGiWorldDraw=n.McGiWorldDrawType=void 0;var a,o,s=t("three"),l=t("../MxThreeJS"),c=t("../MxManager"),u=t("three.meshline");(o=a||(n.McGiWorldDrawType=a={}))[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.setXData=function(t){this.xData=t},p.prototype.setMatrix=function(t){this.matrix=t},p.prototype.getMatrix=function(){return this.matrix},p.prototype.setOpacity=function(t){this.opacity=t},p.prototype.getOpacity=function(){return this.opacity},p.prototype.setColor=function(t){this.iColor!=t&&(this.widthMaterial=null),this.iColor=t},p.prototype.setDash=function(t,e){this.dDashArray=t,this.dDashRatio=e},p.prototype.getDash=function(){return{dDashArray:this.dDashArray,dDashRatio:this.dDashRatio}},p.prototype.setDashLineDisplay=function(t){t?(this.dDashArray=.03,this.dDashRatio=.1,0==this.dLineWidth&&(this.dLineWidth=6,this.lineWidthByPixels=!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(t){this.iRenderOrder=t},p.prototype.getRenderOrder=function(){return this.iRenderOrder},p.prototype.setLineWidthByPixels=function(t){this.lineWidthByPixels!=t&&(this.widthMaterial=null),this.lineWidthByPixels=t},p.prototype.getLineWidthByPixels=function(){return this.lineWidthByPixels},p.prototype.setLineWidth=function(t){this.dLineWidth!=t&&(this.widthMaterial=null),this.dLineWidth=t},p.prototype.getLineWidth=function(){return this.dLineWidth},p.prototype.drawEntity=function(t){var e=this.iRenderOrder;"Group"==t.type?t.traverse(function(t){"Group"!=t.type&&(t.renderOrder=e)}):t.renderOrder=e,null!=this.matrix&&t.applyMatrix4(this.matrix),this.aryEntity.push(t),this.xData&&(t.MxWordDrawXData=this.xData,this.xData=null)},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.lineWidthByPixels,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.lineWidthByPixels,lineWidth:this.dLineWidth,transparent:!0,depthTest:!1}))},p.prototype.drawSolid=function(t){if(!(t.length<3)){var e=new s.Shape(t.map(function(t){var e=t.x,n=t.y;return new s.Vector2(e,n)})),n=new s.ShapeGeometry(e),i=new s.Mesh(n,new s.MeshPhongMaterial({color:this.getColor(),side:s.DoubleSide,transparent:!0,opacity:this.getOpacity()}));this.drawEntity(i)}},p.prototype.drawLines=function(t){if(!(t.length<2))if(0!=this.dLineWidth){this.createWidthMaterial();var e=new s.Geometry;e.vertices=t;var n=new u.MeshLine;n.setGeometry(e);var i=new s.Mesh(n.geometry,this.widthMaterial);this.drawEntity(i),this.drawEntity(l.MxThreeJS.createLines(t.slice(0),this.iColor,0))}else this.drawEntity(l.MxThreeJS.createLines(t.slice(0),this.iColor,this.opacity))},p.prototype.drawGeometryLines=function(t){if(!(t.vertices.length<2))if(0!=this.dLineWidth){this.createWidthMaterial();var e=new u.MeshLine;if(!(t instanceof s.Geometry)){var n=new s.Geometry;n.vertices=t.vertices,t=n}e.setGeometry(t);var i=new s.Mesh(e.geometry,this.widthMaterial);this.drawEntity(i);var r=new s.LineBasicMaterial({color:this.iColor,transparent:!0,depthTest:!1,opacity:0}),a=new s.Line(t,r);this.drawEntity(a)}else r=void 0,r=this.opacity&&1!=this.opacity||0==this.opacity?new s.LineBasicMaterial({color:this.iColor,transparent:!0,depthTest:!1,opacity:this.opacity}):new s.LineBasicMaterial({color:this.iColor,transparent:!0,depthTest:!1}),a=new s.Line(t,r),this.drawEntity(a)},p.prototype.drawSelectLine=function(t,e,n,i){t instanceof Object&&e instanceof Object?this.drawEntity(l.MxThreeJS.createLine(t,e,this.iColor,0)):"number"==typeof t&&"number"==typeof e&&this.drawEntity(l.MxThreeJS.createLine(new s.Vector3(t,e,0),new s.Vector3(n,i,0),this.iColor,0))},p.prototype.drawLine=function(t,e,n,i){var r,a;if(t instanceof Object&&e instanceof Object?(r=t,a=e):"number"==typeof t&&"number"==typeof e&&(r=new s.Vector3(t,e,0),a=new s.Vector3(n,i,0)),0!=this.dLineWidth){this.createWidthMaterial();var o=new Float32Array(6);o[0]=r.x,o[1]=r.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(r,a)}else this.drawEntity(l.MxThreeJS.createLine(r,a,this.iColor,this.opacity))},p.prototype.drawCircle=function(t,e){this.drawEntity(l.MxThreeJS.createCircle(t,e,this.iColor))},p.prototype.drawText=function(t,e,n,i,r,a){var o=l.MxThreeJS.creatTextSprite(t,i,e,n,this.iColor,r,a);return this.drawEntity(o),o},p.prototype.setupForEntity=function(t){this.iColor=t.getColor(),this.iRenderOrder=t.getRenderOrder(),this.opacity=t.opacity,this.dLineWidth=t.getLineWidth(),this.lineWidthByPixels=t.getLineWidthByPixels(),this.dDashArray=t.getDash().dDashArray,this.dDashRatio=t.getDash().dDashRatio},p);function p(t,e){this.aryEntity=[],this.iColor=16777215,this.dLineWidth=0,this.lineWidthByPixels=!0,this.iRenderOrder=c.MxData.iMxEntityRenderOrder,this.worldDrawType=1,this.widthMaterial=null,this.dDashArray=0,this.dDashRatio=0,this.matrix=null,this.opacity=1,this.xData=null,this.mxObj=t,this.worldDrawType=e}n.McGiWorldDraw=h;var d,f=(r(m,d=h),m.prototype.setCurEntityId=function(t){this.curEntityId=t},m.prototype.drawEntity=function(t){},m.prototype.drawText=function(t,e,n,i,r,a){return null},m.prototype.drawSelectLine=function(t,e,n,i){},m.prototype.isValid=function(){return 0!=this.curEntityId||(console.log("this.curEntityId == 0"),!1)},m.prototype.drawLine=function(t,e,n,i){var r,a;this.isValid()&&(t instanceof Object&&e instanceof Object?(r=t,a=e):"number"==typeof t&&"number"==typeof e&&(r=new s.Vector3(t,e,0),a=new s.Vector3(n,i,0)),this.selectManager.addLineDisplay(this.curEntityId,r,a))},m.prototype.drawCircle=function(t,e){this.isValid()&&this.selectManager.addCircleDisplay(this.curEntityId,t,e)},m.prototype.drawLines=function(t){if(!(t.length<2))for(var e=t.length,n=0;n<e-1;n++)this.selectManager.addLineDisplay(this.curEntityId,t[n],t[n+1])},m);function m(t,e){var n=d.call(this,t,a.kSelectDraw)||this;return n.selectManager=e,n.curEntityId=0,n}n.McGiWorldDrawSelect=f},{"../MxManager":36,"../MxThreeJS":44,three:19,"three.meshline":18}],51:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MrxDbgUiPrBase=n.MrxDbgUiPrBase_Return=n.McEdGetPointWorldDrawObject=n.McEdGetPointWorldDraw=void 0;var a=t("./MxJig"),o=t("./MxJigCmdManager"),s=t("../MxThreeJS"),l=t("../UI/MxUiVue"),c=t("../MxString"),u=t("./McGiWorldDraw"),h=(p.prototype.setMcEdJig=function(t){this.m_pJig=t},p.prototype.setColor=function(t){this.m_iColor=t},p.prototype.getColor=function(){return this.m_iColor},p.prototype.drawLine=function(t,e){this.m_pJig.drawEntity(s.MxThreeJS.createLine(t,e,this.m_iColor))},p.prototype.drawMcDbEntity=function(t){this.m_pJig.drawMcDbEntity(t)},p.prototype.drawMcDbLine=function(t,e,n,i,r,a){this.m_pJig.drawMcDbLine(t,e,n,i,r,a)},p.prototype.drawCircle=function(t,e){this.m_pJig.drawEntity(s.MxThreeJS.createCircle(t,e,this.m_iColor))},p.prototype.drawEntity=function(t,e){this.m_pJig.drawEntity(t,e)},p.prototype.drawText=function(t,e,n,i){var r=s.MxThreeJS.creatTextSprite(t,i,e,n,this.m_iColor);this.drawEntity(r)},p.prototype.drawCustomEntity=function(t,e){var n=new u.McGiWorldDraw(this.m_pJig.getMxObject(),u.McGiWorldDrawType.kDynDragDraw);n.setupForEntity(t),t.worldDraw(n);for(var i=n.getEntitys(),r=i.length,a=0;a<r;a++)this.drawEntity(i[a],e)},p);function p(){this.m_pJig=null,this.m_iColor=16777215}n.McEdGetPointWorldDraw=h;var d,f,m,g=(r(v,d=h),v.prototype.setDraw=function(t){this.m_callDraw=t},v.prototype.worldDraw=function(t){null!=this.m_callDraw&&this.m_callDraw(t,this)},v);function v(){var t=null!==d&&d.apply(this,arguments)||this;return t.m_callDraw=void 0,t}n.McEdGetPointWorldDrawObject=g,(m=f||(n.MrxDbgUiPrBase_Return=f={}))[m.kCancel=-2]="kCancel",m[m.kNone=-1]="kNone",m[m.kOk=0]="kOk",m[m.kKeyWord=1]="kKeyWord";var y,x=(r(b,y=a.McEdJigCommand),b.prototype.procInKeyword=function(t){t.status>=o.MxJigCmdManager.DragStatus.kKW1&&0<t.sKeyValue.length?this.m_keyWordPicked=t.sKeyValue.toUpperCase():this.m_keyWordPicked=""},b.prototype.getReturnStatus=function(t){switch(t){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<=t?f.kKeyWord:f.kCancel},b.prototype.setCursorType=function(t){this.m_cursorType=t},b.prototype.getCursorType=function(){return this.m_cursorType},b.prototype.setInputToucheType=function(t){this.m_toucheType=t},b.prototype.getInputToucheType=function(){return this.m_toucheType},b.prototype.keyWords=function(){return this.m_keyWords},b.prototype.setKeyWords=function(t){this.m_keyWords=t},b.prototype.message=function(){return this.m_message},b.prototype.setMessage=function(t){this.m_message=t},b.prototype.keyWordPicked=function(){return this.m_keyWordPicked},b.prototype.isKeyWordPicked=function(t){return t=t.toUpperCase(),this.m_keyWordPicked==t},b.prototype.setUserDraw=function(t){t.setMcEdJig(this),this.m_pWorldDraw=t},b.prototype.printMessage=function(){var t=new c.MxString(this.m_message);t.TrimRight(":"),1<this.m_keyWords.length&&"["==this.m_keyWords[0]&&"]"==this.m_keyWords[this.m_keyWords.length-1]?l.MxUiVue.acutPrintf(t.m_val+" 或"+this.m_keyWords+":"):l.MxUiVue.acutPrintf(t.m_val+":")},b);function b(){var t=null!==y&&y.apply(this,arguments)||this;return t.m_keyWords="",t.m_message="",t.m_keyWordPicked="",t.m_pWorldDraw=null,t.m_toucheType=o.MxJigCmdManager.InType.kGetBegan,t.m_cursorType=l.MxUiVue.CursorType.kNormal,t}n.MrxDbgUiPrBase=x},{"../MxString":42,"../MxThreeJS":44,"../UI/MxUiVue":67,"./McGiWorldDraw":50,"./MxJig":57,"./MxJigCmdManager":58}],52:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MrxDbgUiPrPoint=void 0;var a,o=t("three"),s=t("./MxJigCmdManager"),l=t("../MxFun"),c=t("./MrxDbgUiPrBase"),u=t("../UI/MxUiVue"),h=t("../MxThreeJS"),p=t("../MxManager"),d=(r(f,a=c.MrxDbgUiPrBase),f.prototype.value=function(){return new o.Vector3(this.m_value.x,this.m_value.y,0)},f.prototype.getCADValue=function(){return p.MxManager.getMxCpp().NewMdGePoint3d(p.MxManager.currentMx().docCoord2Cad(this.m_value.x,this.m_value.y,0))},f.prototype.basePt=function(){return new o.Vector3(this.m_basePt.x,this.m_basePt.y,0)},f.prototype.setBasePt=function(t){null==this.m_basePt?this.m_basePt=new o.Vector3(t.x,t.y,0):(this.m_basePt.x=t.x,this.m_basePt.y=t.y)},f.prototype.setUseBasePt=function(t){this.m_useBasePt=t},f.prototype.initGo=function(){this.m_keyWordPicked="",this.m_retcall=null,this.m_retWhileCall=null,this.m_exitCall=null},f.prototype.go=function(t){this.initGo(),this.m_retcall=t,s.MxJigCmdManager.runCmd(this)},f.prototype.goWhile=function(t,e){this.initGo(),this.m_retWhileCall=t,e&&(this.m_exitCall=e),s.MxJigCmdManager.runCmd(this)},f.prototype.onExitCommand=function(){var t=this;u.MxUiVue.setCursorType(u.MxUiVue.CursorType.kNormal);var e=!1;null!=this.m_retcall&&(s.MxJigCmdManager.setRunCmdEvent(function(){a.prototype.onExitCommand.call(t,!1),e=!0}),this.m_retcall(this.getReturnStatus(this.m_resultDragStatus)),s.MxJigCmdManager.setRunCmdEvent(void 0)),!e&&s.MxJigCmdManager.isWaitCmdNull()&&u.MxUiVue.restoreCmdStatus(),e||a.prototype.onExitCommand.call(this,!0)},f.prototype.onStartCommand=function(){u.MxUiVue.setCursorType(this.m_cursorType),this.printMessage(),s.MxJigCmdManager.setKeywordList(this.keyWords()),a.prototype.onStartCommand.call(this)},f.prototype.sampler=function(){var t=this.acquirePoint(this.m_toucheType);return this.procInKeyword(t),t.status==s.MxJigCmdManager.DragStatus.kNormal&&(null==this.m_value?this.m_value=new o.Vector3(t.pt.x,t.pt.y,0):(this.m_value.x=t.pt.x,this.m_value.y=t.pt.y)),t.status},f.prototype.done=function(t){if(null!=this.m_retcall)return this.m_resultDragStatus=t,this.m_exitCall&&this.m_exitCall(this.getReturnStatus(this.m_resultDragStatus)),s.MxJigCmdManager.DoneStatius.kExitCommand;if(null!=this.m_retWhileCall){if((this.m_resultDragStatus=t)==s.MxJigCmdManager.DragStatus.kCancel)return this.m_exitCall&&this.m_exitCall(this.getReturnStatus(this.m_resultDragStatus)),s.MxJigCmdManager.DoneStatius.kExitCommand;var e=!1;t==s.MxJigCmdManager.DragStatus.kNull&&(e=!0);var n=this.m_retWhileCall(this.getReturnStatus(this.m_resultDragStatus));return null!=n&&null!=n.exit&&(e=n.exit),e?(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)},f.prototype.upDisplay=function(){this.m_value&&(this.m_pWorldDraw&&(this._mxObject.getMcObject().onReadyJigUpdateDispla(),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)))},f);function f(){var t=a.call(this)||this;return t.m_useBasePt=!1,t.m_basePt=null,t.m_value=null,t.m_retcall=null,t.m_retWhileCall=null,t.m_exitCall=null,t.m_resultDragStatus=s.MxJigCmdManager.DragStatus.kCancel,t.m_cursorType=u.MxUiVue.CursorType.kCross,t}n.MrxDbgUiPrPoint=d},{"../MxFun":34,"../MxManager":36,"../MxThreeJS":44,"../UI/MxUiVue":67,"./MrxDbgUiPrBase":51,"./MxJigCmdManager":58,three:19}],53:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxCmdRunManager=void 0;var i,r,a,o,s,l,c,u,h=t("../MxFun"),p=t("../MxType"),d=t("./MxJigCmdManager"),f=t("../UI/MxUiVue"),m=t("../MxDrawData");r=i||(n.MxCmdRunManager=i={}),a={},o=new Array,s=0,l=!1,c="",u={},r.InitQuickCommand=function(t){for(var e=t.length,n=0;n<e;n++){var i=t[n];if(!(i.length<2)){var r=i[0];if(0!=r.length)for(var a=i.length,o=1;o<a;o++)0!=i[o].length&&(u[i[o].toUpperCase()]=r)}}},r.MoveUpKey=function(){return l?++s>=o.length&&(s=0):l=!0,!0},r.MoveDownKey=function(){return!!l&&(--s<0&&(s=o.length-1),!0)},r.GetListCommad=function(){return s<0||s>=o.length?"":o[s]},r.ClearPrvCmd=function(){c=""},r.GetPrvCmd=function(){return c},r.SetPrvCmd=function(t){c=t},r.runCmd=function(t,e,n){var i=e.toUpperCase(),r=a[i];if(t&&null==r){var g=u[i];if(null!=g&&(r=a[g.toUpperCase()]),null==r)return f.MxUiVue.isNull()?console.log(h.MxFun.formatString('未知命令"{0}"',e)):f.MxUiVue.acutPrintf('未知命令"{0}"。\n命令:',e),!1}if(!r)return!1;var v=o.indexOf(r.cmd);-1<v&&o.splice(v,1),l=!(s=0),o.push(r.cmd),c=r.cmd;var y=r.fun;if(t&&0==(r.flag&p.MxType.CommandFlags.MCRX_CMD_TRANSPARENT)&&f.MxUiVue.acutPrintf("{0}\n",r.cmd),d.MxJigCmdManager.stopCmd(),t&&t.undoMark(),t.callEvent("commandWillStart",{cmd:e}),t&&"Mx_GripEdit"!=e&&"Mx_IntelliSel"!=e&&"McDraw_GripEdit"!=e&&"Mx_FrontEndWebpageIntelliSel"!=e&&"Mx_FrontEndWebpageGripEdit"!=e){var x=!1,b=t.getMxCAD();if(b){t.callCommand("MxCAD_StartCommandEvent");var w=b.getSelect().clearAllSelect(!1),M=b.getGrip().clearAll();(w||M)&&(x=!0)}else{var _=t.getMxAllSelect();t.getMxDatabase().getGripManager().removeAllGrips()&&(x=!0),t.getMxDatabase().getSelectManager().removeAllEntity()&&(x=!0),t.isValidMcObject()&&t.getMcObject().getGripManager().clearAll()&&(x=!0),t.getMxDatabase().getSelectManager().setPrvCommandSelect(_)}x&&t.updateDisplay()}return y(n),t&&(d.MxJigCmdManager.isRunning()||f.MxUiVue.restoreCmdStatus(),t.updateDisplay(),m.MxDrawData.m_isAutoResetRenderer||t.resetRenderer()),!0},r.addCommand=function(t,e,n){null==n&&(n=p.MxType.CommandFlags.MCRX_CMD_MODAL);var i=t.toUpperCase();a[i]={fun:e,cmd:t,flag:n}}},{"../MxDrawData":29,"../MxFun":34,"../MxType":46,"../UI/MxUiVue":67,"./MxJigCmdManager":58}],54:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.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=t("three"),l=t("../MxThreeJS"),c=t("../MxDrawData"),u=t("./MxJigCmdManager"),h=t("./McEdJigOsnap");(o=a||(n.McDbType=a={}))[o.kInValid=0]="kInValid",o[o.kLine=1]="kLine";var p=(d.prototype.getType=function(){return this.m_type},d);function d(){this.m_type=a.kInValid}n.McDbEntity=p;var f,m=(r(g,f=p),g);function g(){return null!==f&&f.apply(this,arguments)||this}n.McDbCurve=m;var v,y=(r(x,v=m),x);function x(){var t=v.call(this)||this;return t.m_type=a.kLine,t}n.McDbLine=y;var b=(w.prototype.getBlobHead=function(t,e){var n={};return n.type=t.getInt32(e,!0),e+=4,n.ver=t.getInt32(e,!0),e+=4,n.databaseIndex=t.getInt32(e,!0),e+=4,n.nOffset=e,n},w.prototype.clearData=function(){this.threejsObjects=new s.Object3D},w.prototype.calculateDistance=function(t,e,n){var i=(new s.Vector3).subVectors(e,t),r=(new s.Vector3).subVectors(n,t),a=i.clone().normalize(),o=r.clone().normalize(),l=a.dot(o),c=(new s.Vector3).subVectors(n,e),u=(new s.Vector3).subVectors(t,e),h=c.clone().normalize(),p=u.clone().normalize();if(0<h.dot(p)&&0<l){var d=Math.sqrt(1-l*l),f=t.distanceTo(n),m=f*d,g=f*l,v=i.clone().normalize().multiplyScalar(g),y=t.clone().add(v),x=i.clone().normalize().multiplyScalar(200+g);return{pt1:t,pt2:e,pt:n,distance:m,targetPt:y,warningPt:t.clone().add(x)}}return null},w.prototype.getOsnapData=function(t,e){if(this.threejsObjects){var n=new s.Raycaster,i=c.MxDrawData.getCursorWidthPixels();n.linePrecision=this.mxObj.screenCoordLong2World(i);var r=this.mxObj.getCanvas(),o=r.clientWidth,l=r.clientHeight,p=this.mxObj.screenCoord2World(t.x,t.y);p.z=0,t=new s.Vector2(t.x/o*2-1,-t.y/l*2+1),n.setFromCamera(t,this.mxObj.getCamera());var d=n.intersectObjects(this.threejsObjects.children,!0),f=this.mxObj.sysVariable().getSysVarNumber("OSMODE"),m=new Map;if(d.length)for(var g=0;g<d.length;g++){var v=d[g];if(v.object.userData&&v.object.userData.obj.getType()==a.kLine){var y=v.object.userData.obj;if(f&h.MxOsnapDefine.OsModeEnd){var x=p.distanceTo(y.pt1);y.pt1.type=u.MxJigCmdManager.OsnapMode.kOsModeEnd,m.set(x,y.pt1);var b=p.distanceTo(y.pt2);y.pt2.type=u.MxJigCmdManager.OsnapMode.kOsModeEnd,m.set(b,y.pt2)}if(f&h.MxOsnapDefine.OsModeNear&&(!y.bulge||0==y.bulge)){var w=this.calculateDistance(y.pt1,y.pt2,p);w&&(w.targetPt.type=u.MxJigCmdManager.OsnapMode.kOsModeNear,m.set(w.distance,w.targetPt))}}}if(m.size){var M=this.mxObj.screenCoordLong2World(i),_=Array.from(m);_.sort(function(t,e){return t[0]-e[0]}),_[0][0]<M&&e(_[0][1],_[0][1].type)}}},w.prototype.mxWebEntitysData=function(t,e){var n=this.getBlobHead(t,0);t.getInt32(n.nOffset,!0),n.nOffset+=4;var i=t.getInt32(n.nOffset,!0);n.nOffset+=4;var r=t.getInt32(n.nOffset,!0);if(n.nOffset+=4,1<r)console.log("mx:error mxfun.js version is old!");else{var a=t.getInt32(n.nOffset,!0);if(n.nOffset+=4,a==n.nOffset){this.threejsObjects=new s.Object3D;for(var o=0;o<i;o++){var c=t.getInt8(n.nOffset);n.nOffset+=1;var u=t.getInt32(n.nOffset,!0);if(n.nOffset+=4,1==c){var h=t.getFloat32(n.nOffset,!0);n.nOffset+=4;var p=t.getFloat32(n.nOffset,!0);n.nOffset+=4;var d=t.getFloat32(n.nOffset,!0);n.nOffset+=4;var f=t.getFloat32(n.nOffset,!0);n.nOffset+=4,(_=new y).pt1=new s.Vector3(h,p,0),_.pt2=new s.Vector3(d,f,0),(S=l.MxThreeJS.createLine(_.pt1,_.pt2,16777215)).userData.obj=_,this.threejsObjects.add(S)}else if(2==c){var m=t.getInt8(n.nOffset);n.nOffset+=1;var g=t.getInt32(n.nOffset,!0);n.nOffset+=4;for(var v=new s.Vector3,x=0,b=null,w=0;w<g;w++){var M=new s.Vector3;M.x=t.getFloat32(n.nOffset,!0),n.nOffset+=4,M.y=t.getFloat32(n.nOffset,!0),n.nOffset+=4;var _,S,C=t.getFloat32(n.nOffset,!0);n.nOffset+=4,0<w&&((_=new y).pt1=v.clone(),_.pt2=M.clone(),_.bulge=C,(S=l.MxThreeJS.createLine(_.pt1,_.pt2,16777215)).userData.obj=_,this.threejsObjects.add(S)),v=M,x=C,0==w&&(b=M)}m&&2<g&&((_=new y).pt1=b.clone(),_.pt2=v.clone(),_.bulge=x,(S=l.MxThreeJS.createLine(_.pt1,_.pt2,16777215)).userData.obj=_,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)")}},w);function w(t){this.threejsObjects=null,this.mxObj=null,this.mxObj=t}n.MxDrawObjectOsnap=b},{"../MxDrawData":29,"../MxThreeJS":44,"./McEdJigOsnap":49,"./MxJigCmdManager":58,three:19}],55:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxEntSelJig=void 0;var a,o=t("./MxJig"),s=t("./MxJigCmdManager"),l=t("../UI/MxUiVue"),c=t("../MrxDbgUtils"),u=(r(h,a=o.McEdJigCommand),h.prototype.sampler=function(){var t=s.MxJigCmdManager.InType.kGetBegan,e=this.acquirePoint(t);return e.status==s.MxJigCmdManager.DragStatus.kNormal&&(this.point=e.pt),e.status},h.prototype.done=function(t){if(t==s.MxJigCmdManager.DragStatus.kNormal){var e=this;c.MrxDbgUtils.findEntAtPoint(this.getMxObject(),this.point,this.filter).then(function(t){e.callRet(t)})}else this.callRet([]);return s.MxJigCmdManager.DoneStatius.kExitCommand},h.prototype.onStartCommand=function(){l.MxUiVue.setCursorType(l.MxUiVue.CursorType.kRect),a.prototype.onStartCommand.call(this)},h.prototype.onExitCommand=function(){l.MxUiVue.setCursorType(l.MxUiVue.CursorType.kNormal),s.MxJigCmdManager.isWaitCmdNull()&&l.MxUiVue.restoreCmdStatus(),a.prototype.onExitCommand.call(this,!0)},h.prototype.upDisplay=function(){},h);function h(){return null!==a&&a.apply(this,arguments)||this}n.MxEntSelJig=u},{"../MrxDbgUtils":20,"../UI/MxUiVue":67,"./MxJig":57,"./MxJigCmdManager":58}],56:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxIntelliSelectJig=void 0;var a,o=t("three"),s=t("./MxJig"),l=t("./MxJigCmdManager"),c=t("../MxThreeJS"),u=(r(h,a=s.McEdJigCommand),h.prototype.sampler=function(){var t=l.MxJigCmdManager.InType.kGetBegan,e=this.acquirePoint(t);return e.status==l.MxJigCmdManager.DragStatus.kNormal&&(this.m_pt2=e.pt),e.status},h.prototype.getTypeName=function(){return"MxIntelliSelect"},h.prototype.done=function(t){if(t==l.MxJigCmdManager.DragStatus.kNormal){var e=this.getMxObject();if(this.m_isFrontEndWebpage)e.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};e.callCommand("MxCAD_IntelliSelect",JSON.stringify(n),function(t){e.getMxCAD().getGrip().onIntelliSelect(t)})}}return l.MxJigCmdManager.DoneStatius.kExitCommand},h.prototype.doPointSelect=function(t,e,n){var i=t.screenCoordLong2Doc(16),r={x:e.x,y:e.y,tol:i};t.callCommand("MxCAD_IntelliSelect_Point",JSON.stringify(r),function(t){n(t)})},h.prototype.upDisplay=function(){var t=new o.Vector3(this.m_pt1.x,this.m_pt2.y,this.m_pt2.z),e=new o.Vector3(this.m_pt2.x,this.m_pt1.y,this.m_pt2.z),n=[];n.push(this.m_pt1),n.push(t),n.push(this.m_pt2),n.push(e),n.push(this.m_pt1);var i=null,r=65280;if(this.m_pt2.x>this.m_pt1.x)i=c.MxThreeJS.createLines(n,16777215),r=255;else{var a=this.getMxObject().screenCoordLong2Doc(3);i=c.MxThreeJS.createDashedLines(n,16777215,2*a,a)}var s=[];s.push(this.m_pt1),s.push(t),s.push(this.m_pt2),s.push(this.m_pt1),s.push(this.m_pt2),s.push(e);var l=c.MxThreeJS.createTriangle(s,r,.27);this.drawEntity(l,30),this.drawEntity(i,31)},h);function h(t,e){var n=a.call(this)||this;return n.m_pt1=t,n.m_pt2=t,n.m_isFrontEndWebpage=e,n}n.MxIntelliSelectJig=u},{"../MxThreeJS":44,"./MxJig":57,"./MxJigCmdManager":58,three:19}],57:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.McEdJigCommand=n.MxDynamicInput=void 0;var i=t("three"),r=t("../MxFun"),a=t("./MxJigCmdManager"),o=t("../MxManager"),s=t("../MxTools"),l=t("../UI/MxUiVue"),c=t("./McEdJigOsnap"),u=t("../MxWindowsEvent"),h=(p.prototype.onKeyDonw=function(t){if(27==t)return this.m_isInputStatus?(this.m_isInputStatus=!1,l.MxUiVue.OnMxEvent({name:"dynInputReSet"}),1):0;if(32!=t&&13!=t)return this.m_isInputStatus=!0,0;if(this.m_isInputStatus&&l.MxUiVue.DynamicInput_isShow()&&l.MxUiVue.DynamicInput_getType()==a.MxJigCmdManager.DynamicInputType.kXYCoordInput){var e,n=l.MxUiVue.DynamicInput_getValue1(),i=l.MxUiVue.DynamicInput_getValue2(),o=l.MxUiVue.DynamicInput_getFocusValue();e=s.MxTools.IsNumerical(n)&&s.MxTools.IsNumerical(i)?r.MxFun.formatString("{0},{1}",n,i):o,l.MxUiVue.setCmdText(e)}return this.m_isInputStatus=!1,0},p.prototype.isInputStatus=function(){return this.m_isInputStatus},p.prototype.initDynInput=function(t){this.m_jig=t;var e=this.m_jig.getMxObject();l.MxUiVue.DynamicInput_setType(this.m_dynType),this.m_dynType==a.MxJigCmdManager.DynamicInputType.kAutoInput&&(null!=this._dynamicInputBasePoint||e.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(t){l.MxUiVue.OnMxEvent({name:"dynInputSetFocus",param:{isFocus:t}})},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 t,e=this.m_jig.getMxObject();if(t=!this.m_jig.isDisableDynInput()&&e.sysVariable().getSysVarBool("DYNINPUT"),l.MxUiVue.DynamicInput_setShow(t),t){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(r.MxFun.docCoord2Screen(n.x,n.y,n.z)),l.MxUiVue.DynamicInput_getType()==a.MxJigCmdManager.DynamicInputType.kXYCoordInput){var i=n;l.MxUiVue.DynamicInput_setValue1(i.x.toFixed(3)),l.MxUiVue.DynamicInput_setValue2(i.y.toFixed(3))}else l.MxUiVue.DynamicInput_getType(),a.MxJigCmdManager.DynamicInputType.kDistanceInput}l.MxUiVue.DynamicInput_upDisplay()}},p.prototype.setDynamicInputBasePoint=function(t){this._dynamicInputBasePoint=t},p.prototype.setDynamicInputType=function(t){this.m_dynType=t},p.prototype.getDynamicInputType=function(){return this.m_dynType},p);function p(t){this.m_dynType=a.MxJigCmdManager.DynamicInputType.kAutoInput,this._dynamicInputBasePoint=void 0,this.m_isInputStatus=!1,this.m_jig=t}n.MxDynamicInput=h;var d=(f.prototype.getTypeName=function(){return""},f.prototype.getParentGroup=function(){return this.drawGroup||(this.drawGroup=new i.Group,this.drawGroup.renderOrder=o.MxData.iGripRenderOrder,this._mxObject.getTheTempDrawContainer().add(this.drawGroup)),this.drawGroup},f.prototype.onExitCommand=function(t){t&&this.m_dynInput.exitDynInput(),this.m_osnap.endDrag(),this._mxObject.getMcObject().onJigCommandEnd()},f.prototype.getOsnap=function(){return this.m_osnap},f.prototype.isDisableDynInput=function(){return this.m_isDisableDynInput},f.prototype.setDisableDynInput=function(t){this.m_isDisableDynInput=t},f.prototype.setDisableOsnap=function(t){this.m_isDisableOsnap=t},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 t=u.MxWindowsEvent.getCurrentMousePostion(),e=this._mxObject.screenCoord2Doc(t.x,t.y,0);this.m_osnap.setPoint(e),a.MxJigCmdManager.doMouseMoveImp(),this.m_dynInput.setFocus(!0)},f.prototype.getDynImput=function(){return this.m_dynInput},f.prototype.setMxObject=function(t){this._mxObject=t},f.prototype.getMxObject=function(){return this._mxObject},f.prototype.setColor=function(t){this._iColor=t},f.prototype.getColor=function(){return this._iColor},f.prototype.setDynamicInputType=function(t){this.m_dynInput.setDynamicInputType(t)},f.prototype.getDynamicInputType=function(){return this.m_dynInput.getDynamicInputType()},f.prototype.createTriangle=function(t,e,n){var r=new i.MeshBasicMaterial({color:this._iColor,side:i.DoubleSide}),a=new i.Geometry;a.vertices.push(t),a.vertices.push(e),a.vertices.push(n);var o=new i.Vector3(1,1,1),s=new i.Color(this._iColor),l=new i.Face3(0,1,2,o,s,0);return a.faces.push(l),a.computeFaceNormals(),a.computeVertexNormals(),new i.Mesh(a,r)},f.prototype.createPoint=function(t){var e=new i.Geometry;e.vertices.push(t);var n=new i.PointsMaterial({color:this._iColor,size:3});return new i.Points(e,n)},f.prototype.createLine=function(t,e){var n=new i.Geometry,r=new i.LineBasicMaterial({color:this._iColor});return n.vertices.push(t,e),new i.Line(n,r)},f.prototype.drawReserve=function(t){this.m_isReserveDrawStatus=!0,this.m_callReserveDrawAddEntity=t,this.upDisplay(),this.m_isReserveDrawStatus=!1,this.m_callReserveDrawAddEntity=null},f.prototype.drawMcDbEntity=function(t){this.m_isReserveDrawStatus?this._mxObject.getMcObject().DrawEntity(t.getImp()):this._mxObject.getMcObject().onJigDrawEntityDisplay(t.getImp())},f.prototype.drawMcDbLine=function(t,e,n,i,r,a){this.m_isReserveDrawStatus?this._mxObject.getMcObject().DrawLine(t,e,n,i,r,a):this._mxObject.getMcObject().onJigDrawEntityDisplay_line(t,e,n,i,r,a)},f.prototype.drawEntity=function(t,e){if(null!=t)if(this.m_isReserveDrawStatus)t.renderOrder=null!=e?e:o.MxData.iDynJigRenderOrder,this._mxObject.addObject(t),this.m_callReserveDrawAddEntity&&this.m_callReserveDrawAddEntity(t);else{var n="MxDynDraw_"+this._DynNameId.toString();t.name=n,t.renderOrder=null!=e?e:o.MxData.iDynJigRenderOrder,null==this._aryDynDrawObjectNamesId&&(this._aryDynDrawObjectNamesId=new Array),this._aryDynDrawObjectNamesId.push(this._DynNameId),this._DynNameId++,this.getParentGroup().add(t)}},f.prototype.floorPowerOfTwo=function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},f.prototype.makeTextSprite=function(t,e,n,a,o){var s,l=document.createElement("canvas"),c=l.getContext("2d"),u=r.MxFun.formatString("normal {0}px Arial","256");c.font=u;var h=c.measureText(t);s=2*this.floorPowerOfTwo(h.width),l.width=s,l.height=256,c.font=u,c.textAlign="center",c.textBaseline="middle";var p=r.MxFun.formatString("#{0}",o.toString(16));c.fillStyle=p,c.fillText(t,s/2,128);var d=new i.Texture(l);d.needsUpdate=!0;var f=new i.SpriteMaterial({map:d});f.transparent=!1,f.rotation=a;var m=new i.Sprite(f);return m.scale.set(s/256*n,n,1),m.position.set(e.x,e.y,0),m},f.prototype.drawText=function(t,e,n,i){var r=this.makeTextSprite(t,i,e,n,this._iColor);this.drawEntity(r)},f.prototype.drawPoints=function(t){for(var e=0;e<t.length;e++){var n=new i.Geometry;n.vertices.push(t[e]);var r=new i.PointsMaterial({color:this._iColor,size:3}),a=new i.Points(n,r);this.drawEntity(a)}},f.prototype.drawPoint=function(t){var e=new i.Geometry;e.vertices.push(t);var n=new i.PointsMaterial({color:this._iColor,size:3}),r=new i.Points(e,n);this.drawEntity(r)},f.prototype.drawPolyline=function(t){for(var e=new i.Geometry,n=0;n<t.length;n++)e.vertices.push(t[n]);var r=new i.LineBasicMaterial({color:this._iColor}),a=new i.Line(e,r);this.drawEntity(a)},f.prototype.drawSpline=function(t){},f.prototype.drawCircle=function(t,e){var n=new i.CircleGeometry(e,64,3,2*Math.PI),r=new i.LineBasicMaterial({color:this._iColor});n.vertices.shift();var a=new i.LineLoop(n,r);a.position.x=t.x,a.position.y=t.y,a.position.z=t.z,this.drawEntity(a)},f.prototype.drawArc=function(t,e,n,r){var a=new i.CircleGeometry(e,64,n,r),o=new i.LineBasicMaterial({color:this._iColor});a.vertices.shift();var s=new i.Line(a,o);s.position.x=t.x,s.position.y=t.y,s.position.z=t.z,this.drawEntity(s)},f.prototype.drawLine=function(t,e){var n=new i.Geometry,r=new i.LineBasicMaterial({color:this._iColor});n.vertices.push(t,e);var a=new i.Line(n,r);this.drawEntity(a)},f.prototype.removeDynDrawObject=function(){if(null!=this._aryDynDrawObjectNamesId){for(var t=0;t<this._aryDynDrawObjectNamesId.length;t++){var e="MxDynDraw_"+this._aryDynDrawObjectNamesId[t].toString(),n=this.getParentGroup().getObjectByName(e);r.MxFun.removeThreejsObject(n,this.getParentGroup())}this._aryDynDrawObjectNamesId=[],this._mxObject.getMcObject().onJigClearDisplay()}},f.prototype.acquirePoint=function(t){var e=a.MxJigCmdManager.acquirePoint(t);return this._isExit=e.exit,e},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 t=this.sampler();if(this.m_dynInput.upDynInput(),t==a.MxJigCmdManager.DragStatus.kNormal&&(this.removeDynDrawObject(),this.upDisplay()),this._isExit){var e=this.done(t);this._isCancle||(e==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(t){this._userInputContros=t},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.drawGroup=null,this._mxObject=null}n.McEdJigCommand=d},{"../MxFun":34,"../MxManager":36,"../MxTools":45,"../MxWindowsEvent":48,"../UI/MxUiVue":67,"./McEdJigOsnap":49,"./MxJigCmdManager":58,three:19}],58:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxJigCmdManager=n.AcquireReturn=void 0;var i,r=t("three"),a=t("../MxFun"),o=t("./MxJig"),s=t("../MxManager"),l=t("./MrxDbgUiPrPoint"),c=t("./MrxDbgUiPrBase"),u=t("../UI/MxUiVue"),h=t("../MxTools"),p=t("../MxString"),d=t("../MxWindowsEvent"),f=t("./McEdJigOsnap"),m=t("../MxDrawData"),g=function(){this.status=i.DragStatus.kNoChange,this.exit=!0,this.sKeyValue=""};n.AcquireReturn=g,function(t){var e,n,i,v,y,x,b,w,M,_,S,C,T,E,D,A,O,L;(n=e=t.UserInputControls||(t.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",(v=i=t.AcquireStatus||(t.AcquireStatus={}))[v.kNoChange=0]="kNoChange",v[v.kMove=1]="kMove",v[v.kBegan=2]="kBegan",v[v.kEnd=3]="kEnd",v[v.kMouseUp=4]="kMouseUp",v[v.kMouseDown=5]="kMouseDown",v[v.kCancle=6]="kCancle",(x=y=t.DragStatus||(t.DragStatus={}))[x.kNoChange=-6]="kNoChange",x[x.kCancel=-4]="kCancel",x[x.kOther=-3]="kOther",x[x.kNull=-1]="kNull",x[x.kNormal=0]="kNormal",x[x.kKW1=1]="kKW1",(b=t.DoneStatius||(t.DoneStatius={}))[b.kContinueCommand=0]="kContinueCommand",b[b.kExitCommand=1]="kExitCommand",(M=w=t.InType||(t.InType={}))[M.kGetBegan=1]="kGetBegan",M[M.kGetEnd=2]="kGetEnd",(S=_=t.MouseButton||(t.MouseButton={}))[S.kInvalid=-1]="kInvalid",S[S.kLeft=0]="kLeft",S[S.kMid=1]="kMid",S[S.kRight=2]="kRight",(T=C=t.COMMAND_IN||(t.COMMAND_IN={}))[T.COMMAND_IN_NO_ENTITY=0]="COMMAND_IN_NO_ENTITY",T[T.COMMAND_IN_EMTPY=1]="COMMAND_IN_EMTPY",T[T.COMMAND_IN_KEY=2]="COMMAND_IN_KEY",T[T.COMMAND_IN_STRING=3]="COMMAND_IN_STRING",T[T.COMMAND_IN_COORD=5]="COMMAND_IN_COORD",T[T.COMMAND_IN_DIST=6]="COMMAND_IN_DIST",T[T.COMMAND_IN_INVALID=7]="COMMAND_IN_INVALID",T[T.COMMAND_IN_INVALID_ZERO=8]="COMMAND_IN_INVALID_ZERO",T[T.COMMAND_IN_INVALID_NEG=9]="COMMAND_IN_INVALID_NEG",T[T.COMMAND_IN_INT=10]="COMMAND_IN_INT",(D=E=t.COMMAND_GET||(t.COMMAND_GET={}))[D.COMMAND_GET_STRING=1]="COMMAND_GET_STRING",D[D.COMMAND_GET_KEY=2]="COMMAND_GET_KEY",D[D.COMMAND_GET_DIST=4]="COMMAND_GET_DIST",D[D.COMMAND_GET_COORD=8]="COMMAND_GET_COORD",D[D.COMMAND_GET_INT=16]="COMMAND_GET_INT",(A=t.DynamicInputType||(t.DynamicInputType={}))[A.kNoInput=0]="kNoInput",A[A.kXYCoordInput=1]="kXYCoordInput",A[A.kDistanceInput=2]="kDistanceInput",A[A.kDynTip=3]="kDynTip",A[A.kAutoInput=4]="kAutoInput",A[A.kAngleInput=5]="kAngleInput",(O=t.GETPOINTSTATUS||(t.GETPOINTSTATUS={}))[O.OsModeSValidLastPoint=1]="OsModeSValidLastPoint",O[O.OsModeSTempDisable=2]="OsModeSTempDisable",O[O.OsModeOrthoTempDisable=4]="OsModeOrthoTempDisable",O[O.OsModeSInvalidLastMovePoint=8]="OsModeSInvalidLastMovePoint",O[O.OsModePoloarTempDisable=16]="OsModePoloarTempDisable",O[O.OsModeDynTraceTempDisable=32]="OsModeDynTraceTempDisable",O[O.OsModeGridSnapTempDisable=64]="OsModeGridSnapTempDisable",(L=t.OsnapMode||(t.OsnapMode={}))[L.kOsModekValid=0]="kOsModekValid",L[L.kOsModeEnd=1]="kOsModeEnd",L[L.kOsModeMid=2]="kOsModeMid",L[L.kOsModeCen=3]="kOsModeCen",L[L.kOsModeNode=4]="kOsModeNode",L[L.kOsModeQuad=5]="kOsModeQuad",L[L.kOsModeIns=7]="kOsModeIns",L[L.kOsModePerp=8]="kOsModePerp",L[L.kOsModeTan=9]="kOsModeTan",L[L.kOsModeNear=10]="kOsModeNear",L[L.kOsModeInt=11]="kOsModeInt";var I,P=void 0,R=void 0,k=i.kNoChange,N=_.kInvalid,B=-9999999,F=new r.Vector2(B,B),j=!1,V=void 0,z=!1,G=new Map,U=new Array,H=new p.MxString,W=!0,J=void 0,q=-2;function X(){null!=P&&P.notifySampler()}function Y(t){var e=t.srcElement;if(e&&"CANVAS"==e.tagName){if(null==P)return 0;if(P.getDynImput().isInputStatus())return 0;F.x=t.offsetX,F.y=t.offsetY,et(F)}return 0}function Z(t){if(t.button!=_.kLeft)return 0;var e=t.srcElement;return!e||"CANVAS"!=e.tagName||null==P||P.getDynImput().isInputStatus()?0:(F.x=t.offsetX,F.y=t.offsetY,I=P.getMxObject().screenCoord2Doc(t.offsetX,t.offsetY,0),k=i.kMouseUp,N=t.button,X(),t.stopPropagation(),1)}function $(t){if(t.button!=_.kLeft)return 0;null!=P&&P.getDynImput().isShow()&&P.getDynImput().setFocus(!0);var e=t.srcElement;if(e&&"CANVAS"==e.tagName){if(null==P)return 0;if(P.getDynImput().isInputStatus())return 0;F.x=t.offsetX,F.y=t.offsetY;var n=P.getMxObject().screenCoord2Doc(t.offsetX,t.offsetY,0),r=P.getOsnap(),a=r.getCurrentOSnapPoint(n);return n=a.pt,a.osmode,f.McEdImpJigGlobalData.setPrvPoint(n),r.seInValidPoint(),I=n,k=i.kMouseDown,N=t.button,X(),t.stopPropagation(),1}return 0}function K(t){if(0!=t.touches.length){null!=P&&P.getDynImput().isShow()&&P.getDynImput().setFocus(!0);var e=t.srcElement;if(e&&"CANVAS"==e.tagName){if(null==P)return;if(P.getDynImput().isInputStatus())return;F.x=t.touches[0].pageX,F.y=t.touches[0].pageY;var n=P.getMxObject().screenCoord2Doc(t.touches[0].pageX,t.touches[0].pageY,0),r=P.getOsnap(),a=r.getCurrentOSnapPoint(n);return n=a.pt,a.osmode,f.McEdImpJigGlobalData.setPrvPoint(n),r.seInValidPoint(),I=n,k=i.kBegan,N=_.kInvalid,X(),t.stopPropagation(),1}}}function Q(t){var e=t.srcElement;if(e&&"CANVAS"==e.tagName){if(null==P)return;if(P.getDynImput().isInputStatus())return;if(F.x==B||F.y==B)return;return I=P.getMxObject().screenCoord2Doc(F.x,F.y,0),k=i.kEnd,N=_.kInvalid,X(),t.stopPropagation(),1}}function tt(t){var e=t.srcElement;if(e&&"CANVAS"==e.tagName){if(null==P)return;if(P.getDynImput().isInputStatus())return;F.x=t.touches[0].pageX,F.y=t.touches[0].pageY,et(F)}}function et(e){if(z=!1,null==e){if(F.x==B||F.y==B)return;e=F}var n=P.getMxObject().screenCoord2Doc(e.x,e.y,0),r=P.getOsnap(),a=P.getMxObject().screenCoordLong2Doc(.5*m.MxDrawData.getCursorWidthPixels());r.setPoint(n,a),t.OsnapMode.kOsModekValid,I=n,k=i.kMove,X.call(this)}function nt(){P&&(J=P.getMxObject().getEventManager(),a.MxFun.isPC()?(J.addEventListener("mouseup",Z,!0),J.addEventListener("mousemove",Y,!0),J.addEventListener("mousedown",$,!0)):(J.addEventListener("touchstart",K,!0),J.addEventListener("touchend",Q,!0),J.addEventListener("touchmove",tt,!0)))}function it(){J&&(a.MxFun.isPC()?(J.removeEventListener("mouseup",Z,!0),J.removeEventListener("mousemove",Y,!0),J.removeEventListener("mousedown",$,!0)):(J.removeEventListener("touchstart",K,!0),J.removeEventListener("touchend",Q,!0),J.removeEventListener("touchmove",tt,!0)),J=void 0)}function rt(t){var e=t.getOrbitControls();a.MxFun.isPC()?(q=e.mouseButtons.LEFT,e.mouseButtons.LEFT=-1):e.enabled=!1,e.resetStatusValue(),t.tempDisableSelect(!0),t.updateDisplay()}function at(t){var e=new r.Vector3,n=!1,i=new p.MxString(t),a=i.AnalyzeString(",");if(a.length<2)for(;!i.IsEmpty()&&h.MxTools.IsNumerical(i);){var o=h.MxTools._tstof(i.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,e.x=h.MxTools._tstof(s.m_val),e.y=h.MxTools._tstof(l.m_val),e.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?e:null}function ot(t,e){void 0===e&&(e=!1),W&&u.MxUiVue.AcutPrintfNoFormat(t,e)}function st(t,n){if(t==C.COMMAND_IN_INVALID){var i=u.MxUiVue.getCmdTip();return ot(n),ot(i),y.kNoChange}return t==C.COMMAND_IN_INVALID_ZERO?(i=u.MxUiVue.getCmdTip(),P.userInputControls()&e.kNoNegativeResponseAccepted?ot("\n 值必须为正 且非零。 \n"):ot("\n 值必不能为零。 \n"),ot(i),y.kOther):t!=C.COMMAND_IN_INVALID_NEG?y.kNoChange:(i=u.MxUiVue.getCmdTip(),P.userInputControls()&e.kNoZeroResponseAccepted?ot("\n 值必须为正 且非零。 \n"):ot("\n 值必不能为负。 \n"),ot(i),y.kOther)}function lt(t){var n={iRet:C.COMMAND_IN_NO_ENTITY,sValue:"",iKey:y.kNull,dDist:0,iVal:0,pt:null};if(!z)return n;var i=P.userInputControls(),r=u.MxUiVue.getCmdText();if(0==r.length)return i&e.kNullResponseAccepted?n.iRet=C.COMMAND_IN_EMTPY:n.iRet=C.COMMAND_IN_INVALID,n;if(t&E.COMMAND_GET_KEY&&0<G.size){var a=new p.MxString(r);a.MakeUpper(),a.TrimLeft(" "),a.TrimRight(" ");var o=G.get(a.m_val);if(null!=o)return n.iRet=C.COMMAND_IN_KEY,n.iKey=o,n.sValue=a.m_val,n}if(t&E.COMMAND_GET_DIST&&h.MxTools.IsNumerical(r))return n.dDist=h.MxTools._tstof(r),i&e.kNoZeroResponseAccepted&&h.MxTools.IsZero(n.dDist)?n.iRet=C.COMMAND_IN_INVALID_ZERO:i&e.kNoNegativeResponseAccepted&&n.dDist<0?n.iRet=C.COMMAND_IN_INVALID_NEG:(n.sValue=r,n.iRet=C.COMMAND_IN_DIST),n;if(t&E.COMMAND_GET_INT&&h.MxTools.IsNumerical(r))return n.iVal=h.MxTools._tstoi(r),i&e.kNoZeroResponseAccepted&&0==n.iiVal?n.iRet=C.COMMAND_IN_INVALID_ZERO:i&e.kNoNegativeResponseAccepted&&n.iiVal<0?n.iRet=C.COMMAND_IN_INVALID_NEG:(n.sValue=r,n.iRet=C.COMMAND_IN_INT),n;if(t&E.COMMAND_GET_COORD){var s=at(r);if(null!=s)return n.sValue=r,n.iRet=C.COMMAND_IN_COORD,n.pt=s,n}return t&E.COMMAND_GET_STRING?(n.sValue=r,n.iRet=C.COMMAND_IN_STRING):n.iRet=C.COMMAND_IN_INVALID,n}t.getInputKeyword=function(t){if(t<1)return"";for(var e,n=G.entries();!(e=n.next()).done;)if(e.value==t)return e.key;return""},t.GetKeyWordToString=function(){return U},t.keywordList=function(){return H.m_val},t.setKeywordList=function(t){if(H.m_val=t,G.clear(),U.length=0,!H.IsEmpty())if(H.TrimLeft(" "),H.TrimRight(" "),"["==H.m_val[0]&&"]"==H.m_val[H.m_val.length-1]){H.TrimLeft("["),H.TrimRight("]");for(var e=H.AnalyzeString("/"),n=1,i=0;i<e.length;i++){var r=(s=new p.MxString(e[i])).Find("(");if(-1!=r){var a=new p.MxString(s.Left(r)),o=new p.MxString(s.Right(s.GetLength()-r-1));o.TrimRight(")"),a.IsEmpty()||o.IsEmpty()||(o.MakeUpper(),G.set(o.m_val,n),n++,U.push(new h.MxPair(o.m_val,a.m_val)))}}}else for(e=H.AnalyzeString(" "),n=1,i=0;i<e.length;i++){var s;(s=new p.MxString(e[i])).IsEmpty()||(s.MakeUpper(),G.set(s.m_val,n),n++)}},t.getAcquirePoint=function(){return I},t.getAcquireStatus=function(){return k},t.doMouseMoveImp=et,t.OnThreeControlsChage=function(){null==P||F.x!=B&&F.y!=B&&et(F)},t.OnEnter=function(t){z=!0,k=i.kNoChange,X(),z=!1},t.Test=function(){z=!0},t.registEvent=nt,t.unRegistEvent=it,t.getCurrentMouseButton=function(){return N},t.isRunning=function(){return null!=P},t.getCurCmd=function(){return P},t.commandRunComplete=function(t){P!=t&&console.log("aseert:_curCmd == cmd");var e,n,i=s.MxManager.currentMx();null!=P&&(i=P.getMxObject()),null!=R?(P=R,R=void 0,N=_.kInvalid,nt(),P.onStartCommand(),rt(i)):(it(),P=void 0,n=(e=i).getOrbitControls(),a.MxFun.isPC()?-2!=q&&(n.mouseButtons.LEFT=q,q=-2,n.resetStatusValue()):(n.enabled=!0,n.resetStatusValue()),e.tempDisableSelect(!1),e.updateDisplay(),m.MxDrawData.m_isAutoResetRenderer||e.resetRenderer())},t.isWaitCmdNull=function(){return null==R},t.stopCmd=function(){null!=P&&(j=!0,P.notifyCancleExit(),j=!1)},t.setRunCmdEvent=function(t){V=t},t.runCmd=function(t){if(!j){var e=s.MxManager.currentMx();t.setMxObject(e),a.MxFun.isPC()?F=d.MxWindowsEvent.getCurrentMousePostion():(F.x=B,F.y=B),V&&V(),null==P?(P=t,N=_.kInvalid,nt(),P.onStartCommand(),rt(e)):(R=t,j=!0,P.notifyCancleExit(),j=!1)}},t.GetAcqurePointFromStringTo=at,t.ProcCommandRetResult=st,t.GetCommandLineContent=lt,t.acquirePoint=function(t){var e=new g;if(null==P)return e.status=y.kCancel,e;var n=lt(E.COMMAND_GET_COORD|E.COMMAND_GET_KEY);return n.iRet==C.COMMAND_IN_EMTPY?(e.status=y.kNull,e.exit=!0):n.iRet==C.COMMAND_IN_KEY?(e.status=n.iKey,e.exit=!0,e.sKeyValue=n.sValue):n.iRet==C.COMMAND_IN_COORD?(e.status=y.kNormal,e.pt=new r.Vector3(n.pt.x,n.pt.y,n.pt.z),e.exit=!0):(st(n.iRet,"\n 需要点或选项关键字。 \n"),k==i.kMove?(e.status=y.kNormal,e.pt=I,e.exit=!1):k==i.kEnd?t&w.kGetEnd?(e.status=y.kNormal,e.pt=I,e.exit=!0):(e.status=y.kNormal,e.pt=I,e.exit=!1):k==i.kCancle?(e.status=y.kCancel,e.pt=I,e.exit=!0):k==i.kBegan?t&w.kGetBegan?(e.status=y.kNormal,e.pt=I,e.exit=!0):(e.status=y.kNormal,e.pt=I,e.exit=!1):k==i.kMouseDown?(e.status=y.kNormal,e.pt=I,e.exit=!0):(e.status=y.kNoChange,e.pt=void 0,e.exit=!1)),e},t.getMcEdJigCommandClass=function(){return o.McEdJigCommand},t.getMrxDbgUiPrPointClass=function(){return l.MrxDbgUiPrPoint},t.getMcEdGetPointWorldDrawClass=function(){return c.McEdGetPointWorldDraw},t.McEdGetPointWorldDrawObjectClass=function(){return c.McEdGetPointWorldDrawObject},t.init=function(){this._curCmd=void 0}}(i||(n.MxJigCmdManager=i={}))},{"../MxDrawData":29,"../MxFun":34,"../MxManager":36,"../MxString":42,"../MxTools":45,"../MxWindowsEvent":48,"../UI/MxUiVue":67,"./McEdJigOsnap":49,"./MrxDbgUiPrBase":51,"./MrxDbgUiPrPoint":52,"./MxJig":57,three:19}],59:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxJigGetLine=void 0;var a,o=t("./MxJig"),s=t("./MxJigCmdManager"),l=t("../MxFun"),c=(r(u,a=o.McEdJigCommand),u.prototype.sampler=function(){var t=s.MxJigCmdManager.InType.kGetBegan;this._isGetPt1||(t=s.MxJigCmdManager.InType.kGetEnd);var e=this.acquirePoint(t);return e.status==s.MxJigCmdManager.DragStatus.kNormal&&(this._isGetPt1?this._pt1=e.pt:this._pt2=e.pt),e.status},u.prototype.setRetCall=function(t){this._retCall=t},u.prototype.done=function(t){if(this._isGetPt1)return this._isGetPt1=!1,s.MxJigCmdManager.DoneStatius.kContinueCommand;var e={};return e.pt1=l.MxFun.worldCoord2Doc(this._pt1.x,this._pt1.y,this._pt1.z),e.pt2=l.MxFun.worldCoord2Doc(this._pt2.x,this._pt2.y,this._pt2.z),this._retCall(e),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 t=null!==a&&a.apply(this,arguments)||this;return t._isGetPt1=!0,t}n.MxJigGetLine=c},{"../MxFun":34,"./MxJig":57,"./MxJigCmdManager":58}],60:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t("./MxFun");function r(){}(r.CreateMx=function(){i.MxFun.init(),"undefined"!=typeof MxMain&&0==MxMain(t)||i.MxFun.createMxObject();var e=i.MxFun.getUiObject();null!=e&&(e.sTitle=i.MxFun.getCurrentDraw().getFileTitle(),setTimeout(function(){e.init()},400))},r.Main=function(){if("undefined"!=typeof MxUiMain){MxUiMain(t);var e=i.MxFun.getUiObject();null!=e&&e.writeUICSS()}"undefined"==typeof MxDocumentReady?$(document).ready(function(){r.CreateMx()}):MxDocumentReady(t,r.CreateMx)},r).Main()},{"./MxFun":34}],61:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxSvgManager=void 0;var i=t("three"),r=t("three"),a=t("./SVGLoader"),o=(s.prototype.loadSVGImp=function(t,e,n,r){(new a.SVGLoader).load(t,function(o){if(o.paths.length){var s=[],l=o.paths,c=new i.Group,u=!0,h=!0,p=!1,d=!1;r&&(r.drawStrokes&&(u=r.drawStrokes),r.drawFillShapes&&(h=r.drawFillShapes),r.fillShapesWireframe&&(p=r.fillShapesWireframe),r.strokesWireframe&&(d=r.strokesWireframe));for(var f=0;f<l.length;f++){var m=l[f],g=m.userData.style.fill;if(h&&void 0!==g&&"none"!==g){for(var v=new i.MeshBasicMaterial({color:e||(new i.Color).setStyle(g),opacity:m.userData.style.fillOpacity,transparent:m.userData.style.fillOpacity<1,side:i.DoubleSide,depthWrite:!1,wireframe:p}),y=a.SVGLoader.createShapes(m),x=0;x<y.length;x++){var b=y[x],w=new i.ShapeBufferGeometry(b),M=new i.Mesh(w,v);c.add(M)}s.push(v)}var _=m.userData.style.stroke;if(u&&void 0!==_&&"none"!==_){v=new i.MeshBasicMaterial({color:e||(new i.Color).setStyle(_),opacity:m.userData.style.strokeOpacity,transparent:m.userData.style.strokeOpacity<1,side:i.DoubleSide,depthWrite:!1,wireframe:d}),x=0;for(var S=m.subPaths.length;x<S;x++){var C=m.subPaths[x];(w=a.SVGLoader.pointsToStroke(C.getPoints(),m.userData.style,12,.001))&&(M=new i.Mesh(w,v),c.add(M))}s.push(v)}}n&&n(c,s)}else console.log("mx svg:"+t+" data.paths.length == 0"),n&&n(null,null)},void 0,function(){n&&n(null,null)})},s.prototype.loadSVG=function(t,e,n,a){var o=this,s=this.mapSvgUrlToData.get(t),l=!a||!a.useBuffer||a.useBuffer;if(s&&l){if(n)if(null==s)n(null,null);else{var c=s.svg.clone();c.boxSize=s.boxSize,n(c,s.aryMeterial)}}else this.loadSVGImp(t,e,function(e,a){if(e&&a){var s=new function(){this.svg=new i.Group,this.aryMeterial=[],this.boxSize=new r.Vector3(1,1,1)};s.svg=e,s.aryMeterial=a;var l=(new r.Box3).setFromObject(e);s.boxSize.x=l.max.x-l.min.x,s.boxSize.y=l.max.y-l.min.y,s.boxSize.x!==-1/0&&s.boxSize.y!==-1/0||console.log("mx svg:"+t+" boxSize invalid"),o.mapSvgUrlToData.set(t,s);var c=s.svg.clone();c.boxSize=s.boxSize,n&&n(c,s.aryMeterial)}else o.mapSvgUrlToData.set(t,null),n&&n(null,null)},a)},s);function s(){this.mapSvgUrlToData=new Map}var l=(c.prototype.loadSVG=function(t,e,n,i){n&&this.mxThreeJsBuffer.loadSVG(t,e,n,i)},c);function c(){this.mxThreeJsBuffer=new o}n.MxSvgManager=l},{"./SVGLoader":62,three:19}],62:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.SVGLoader=void 0;var a,o=t("three"),s=(r(l,a=o.Loader),l.prototype.load=function(t,e,n,i){var r=this,a=new o.FileLoader(r.manager);a.setPath(r.path),a.setRequestHeader(r.requestHeader),a.setWithCredentials(r.withCredentials),a.load(t,function(n){try{e(r.parse(n))}catch(n){i?i(n):console.error(n),r.manager.itemError(t)}},n,i)},l.prototype.parse=function(t){var e=this;function n(t,e,n,r,a,o,s,l){if(0!=e&&0!=n){r=r*Math.PI/180,e=Math.abs(e),n=Math.abs(n);var c=(s.x-l.x)/2,u=(s.y-l.y)/2,h=Math.cos(r)*c+Math.sin(r)*u,p=-Math.sin(r)*c+Math.cos(r)*u,d=e*e,f=n*n,m=h*h,g=p*p,v=m/d+g/f;if(1<v){var y=Math.sqrt(v);d=(e*=y)*e,f=(n*=y)*n}var x=d*g+f*m,b=(d*f-x)/x,w=Math.sqrt(Math.max(0,b));a===o&&(w=-w);var M=w*e*p/n,_=-w*n*h/e,S=Math.cos(r)*M-Math.sin(r)*_+(s.x+l.x)/2,C=Math.sin(r)*M+Math.cos(r)*_+(s.y+l.y)/2,T=i(1,0,(h-M)/e,(p-_)/n),E=i((h-M)/e,(p-_)/n,(-h-M)/e,(-p-_)/n)%(2*Math.PI);t.currentPath.absellipse(S,C,e,n,T,T+E,0===o,r)}else t.lineTo(l.x,l.y)}function i(t,e,n,i){var r=t*n+e*i,a=Math.sqrt(t*t+e*e)*Math.sqrt(n*n+i*i),o=Math.acos(Math.max(-1,Math.min(1,r/a)));return t*i-e*n<0&&(o=-o),o}function r(t,e){e=Object.assign({},e);var n={};if(t.hasAttribute("class"))for(var i=t.getAttribute("class").split(/\s/).filter(Boolean).map(function(t){return t.trim()}),r=0;r<i.length;r++)n=Object.assign(n,p["."+i[r]]);function a(i,r,a){void 0===a&&(a=function(t){return t.startsWith("url")&&console.warn("SVGLoader: url access in attributes is not implemented."),t}),t.hasAttribute(i)&&(e[r]=a(t.getAttribute(i))),n[i]&&(e[r]=a(n[i])),t.style&&""!==t.style[i]&&(e[r]=a(t.style[i]))}function o(t){return Math.max(0,Math.min(1,u(t)))}function s(t){return Math.max(0,u(t))}return t.hasAttribute("id")&&(n=Object.assign(n,p["#"+t.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"),e}function a(t,e){return t-(e-t)}function s(t,e,n){if("string"!=typeof t)throw new TypeError("Invalid input: "+typeof t);var i,r={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(t,e,n){var i=new SyntaxError('Unexpected character "'+t+'" at index '+e+".");throw i.partial=n,i}function h(){""!==s&&(""===l?c.push(Number(s)):c.push(Number(s)*Math.pow(10,Number(l)))),l=s=""}for(var p=t.length,d=0;d<p;d++)if(i=t[d],Array.isArray(e)&&e.includes(c.length%n)&&r.FLAGS.test(i))a=1,s=i,h();else{if(0===a){if(r.WHITESPACE.test(i))continue;if(r.DIGIT.test(i)||r.SIGN.test(i)){a=1,s=i;continue}if(r.POINT.test(i)){a=2,s=i;continue}r.COMMA.test(i)&&(o&&u(i,d,c),o=!0)}if(1===a){if(r.DIGIT.test(i)){s+=i;continue}if(r.POINT.test(i)){s+=i,a=2;continue}if(r.EXP.test(i)){a=3;continue}r.SIGN.test(i)&&1===s.length&&r.SIGN.test(s[0])&&u(i,d,c)}if(2===a){if(r.DIGIT.test(i)){s+=i;continue}if(r.EXP.test(i)){a=3;continue}r.POINT.test(i)&&"."===s[s.length-1]&&u(i,d,c)}if(3===a){if(r.DIGIT.test(i)){l+=i;continue}if(r.SIGN.test(i)){if(""===l){l+=i;continue}1===l.length&&r.SIGN.test(l)&&u(i,d,c)}}r.WHITESPACE.test(i)?(h(),a=0,o=!1):r.COMMA.test(i)?(h(),o=!(a=0)):r.SIGN.test(i)?(h(),a=1,s=i):r.POINT.test(i)?(h(),a=2,s=i):u(i,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(t){var n="px";if("string"==typeof t||t instanceof String)for(var i=0,r=l.length;i<r;i++){var a=l[i];if(t.endsWith(a)){n=a,t=t.substring(0,t.length-a.length);break}}var o=void 0;return"px"===n&&"px"!==e.defaultUnit?o=c.in[e.defaultUnit]/e.defaultDPI:(o=c[n][e.defaultUnit])<0&&(o=c[n].in*e.defaultDPI),o*parseFloat(t)}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,b=new o.Matrix3,w=(new DOMParser).parseFromString(t,"image/svg+xml");return function t(e,i){if(1===e.nodeType){var l,c,w,M,_,S,C,T,E,D,A,O,L=function(t){if(!(t.hasAttribute("transform")||"use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))))return null;var e=function(t){var e=new o.Matrix3,n=f;if("use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))){var i=u(t.getAttribute("x")),r=u(t.getAttribute("y"));e.translate(i,r)}if(t.hasAttribute("transform"))for(var a=t.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&&(r=i=y[0],2<=y.length&&(r=y[1]),n.translate(i,r));break;case"rotate":if(1<=y.length){var x,b=0,w=0;x=-y[0]*Math.PI/180,3<=y.length&&(b=y[1],w=y[2]),m.identity().translate(-b,-w),g.identity().rotate(x),v.multiplyMatrices(g,m),m.identity().translate(b,w),n.multiplyMatrices(m,v)}break;case"scale":if(1<=y.length){var M=y[0],_=M;2<=y.length&&(_=y[1]),n.scale(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)}}e.premultiply(n)}}return e}(t);return 0<d.length&&e.premultiply(d[d.length-1]),b.copy(e),d.push(e),e}(e),I=!0,P=null;switch(e.nodeName){case"svg":break;case"style":!function(t){if(t.sheet&&t.sheet.cssRules&&t.sheet.cssRules.length)for(var e=0;e<t.sheet.cssRules.length;e++){var n=t.sheet.cssRules[e];if(1===n.type)for(var i=n.selectorText.split(/,/gm).filter(Boolean).map(function(t){return t.trim()}),r=0;r<i.length;r++)p[i[r]]=Object.assign(p[i[r]]||{},n.style)}}(e);break;case"g":i=r(e,i);break;case"path":i=r(e,i),e.hasAttribute("d")&&(P=function(t){for(var e=new o.ShapePath,i=new o.Vector2,r=new o.Vector2,l=new o.Vector2,c=!0,u=!1,h=t.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)i.x=v[y+0],i.y=v[y+1],r.x=i.x,r.y=i.y,0===y?e.moveTo(i.x,i.y):e.lineTo(i.x,i.y),0===y&&l.copy(i);break;case"H":for(y=0,x=(v=s(g)).length;y<x;y++)i.x=v[y],r.x=i.x,r.y=i.y,e.lineTo(i.x,i.y),0===y&&!0===u&&l.copy(i);break;case"V":for(y=0,x=(v=s(g)).length;y<x;y++)i.y=v[y],r.x=i.x,r.y=i.y,e.lineTo(i.x,i.y),0===y&&!0===u&&l.copy(i);break;case"L":for(y=0,x=(v=s(g)).length;y<x;y+=2)i.x=v[y+0],i.y=v[y+1],r.x=i.x,r.y=i.y,e.lineTo(i.x,i.y),0===y&&!0===u&&l.copy(i);break;case"C":for(y=0,x=(v=s(g)).length;y<x;y+=6)e.bezierCurveTo(v[y+0],v[y+1],v[y+2],v[y+3],v[y+4],v[y+5]),r.x=v[y+2],r.y=v[y+3],i.x=v[y+4],i.y=v[y+5],0===y&&!0===u&&l.copy(i);break;case"S":for(y=0,x=(v=s(g)).length;y<x;y+=4)e.bezierCurveTo(a(i.x,r.x),a(i.y,r.y),v[y+0],v[y+1],v[y+2],v[y+3]),r.x=v[y+0],r.y=v[y+1],i.x=v[y+2],i.y=v[y+3],0===y&&!0===u&&l.copy(i);break;case"Q":for(y=0,x=(v=s(g)).length;y<x;y+=4)e.quadraticCurveTo(v[y+0],v[y+1],v[y+2],v[y+3]),r.x=v[y+0],r.y=v[y+1],i.x=v[y+2],i.y=v[y+3],0===y&&!0===u&&l.copy(i);break;case"T":for(y=0,x=(v=s(g)).length;y<x;y+=2){var b=a(i.x,r.x),w=a(i.y,r.y);e.quadraticCurveTo(b,w,v[y+0],v[y+1]),r.x=b,r.y=w,i.x=v[y+0],i.y=v[y+1],0===y&&!0===u&&l.copy(i)}break;case"A":for(y=0,x=(v=s(g,[3,4],7)).length;y<x;y+=7)if(v[y+5]!=i.x||v[y+6]!=i.y){var M=i.clone();i.x=v[y+5],i.y=v[y+6],r.x=i.x,r.y=i.y,n(e,v[y],v[y+1],v[y+2],v[y+3],v[y+4],M,i),0===y&&!0===u&&l.copy(i)}break;case"m":for(y=0,x=(v=s(g)).length;y<x;y+=2)i.x+=v[y+0],i.y+=v[y+1],r.x=i.x,r.y=i.y,0===y?e.moveTo(i.x,i.y):e.lineTo(i.x,i.y),0===y&&l.copy(i);break;case"h":for(y=0,x=(v=s(g)).length;y<x;y++)i.x+=v[y],r.x=i.x,r.y=i.y,e.lineTo(i.x,i.y),0===y&&!0===u&&l.copy(i);break;case"v":for(y=0,x=(v=s(g)).length;y<x;y++)i.y+=v[y],r.x=i.x,r.y=i.y,e.lineTo(i.x,i.y),0===y&&!0===u&&l.copy(i);break;case"l":for(y=0,x=(v=s(g)).length;y<x;y+=2)i.x+=v[y+0],i.y+=v[y+1],r.x=i.x,r.y=i.y,e.lineTo(i.x,i.y),0===y&&!0===u&&l.copy(i);break;case"c":for(y=0,x=(v=s(g)).length;y<x;y+=6)e.bezierCurveTo(i.x+v[y+0],i.y+v[y+1],i.x+v[y+2],i.y+v[y+3],i.x+v[y+4],i.y+v[y+5]),r.x=i.x+v[y+2],r.y=i.y+v[y+3],i.x+=v[y+4],i.y+=v[y+5],0===y&&!0===u&&l.copy(i);break;case"s":for(y=0,x=(v=s(g)).length;y<x;y+=4)e.bezierCurveTo(a(i.x,r.x),a(i.y,r.y),i.x+v[y+0],i.y+v[y+1],i.x+v[y+2],i.y+v[y+3]),r.x=i.x+v[y+0],r.y=i.y+v[y+1],i.x+=v[y+2],i.y+=v[y+3],0===y&&!0===u&&l.copy(i);break;case"q":for(y=0,x=(v=s(g)).length;y<x;y+=4)e.quadraticCurveTo(i.x+v[y+0],i.y+v[y+1],i.x+v[y+2],i.y+v[y+3]),r.x=i.x+v[y+0],r.y=i.y+v[y+1],i.x+=v[y+2],i.y+=v[y+3],0===y&&!0===u&&l.copy(i);break;case"t":for(y=0,x=(v=s(g)).length;y<x;y+=2)b=a(i.x,r.x),w=a(i.y,r.y),e.quadraticCurveTo(b,w,i.x+v[y+0],i.y+v[y+1]),r.x=b,r.y=w,i.x=i.x+v[y+0],i.y=i.y+v[y+1],0===y&&!0===u&&l.copy(i);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]||(M=i.clone(),i.x+=v[y+5],i.y+=v[y+6],r.x=i.x,r.y=i.y,n(e,v[y],v[y+1],v[y+2],v[y+3],v[y+4],M,i),0===y&&!0===u&&l.copy(i));break;case"Z":case"z":e.currentPath.autoClose=!0,0<e.currentPath.curves.length&&(i.copy(l),e.currentPath.currentPoint.copy(i),c=!0);break;default:console.warn(f)}u=!1}return e}(e));break;case"rect":i=r(e,i),P=function(t){var e=u(t.getAttribute("x")||0),n=u(t.getAttribute("y")||0),i=u(t.getAttribute("rx")||t.getAttribute("ry")||0),r=u(t.getAttribute("ry")||t.getAttribute("rx")||0),a=u(t.getAttribute("width")),s=u(t.getAttribute("height")),l=.448084975506,c=new o.ShapePath;return c.moveTo(e+i,n),c.lineTo(e+a-i,n),0===i&&0===r||c.bezierCurveTo(e+a-i*l,n,e+a,n+r*l,e+a,n+r),c.lineTo(e+a,n+s-r),0===i&&0===r||c.bezierCurveTo(e+a,n+s-r*l,e+a-i*l,n+s,e+a-i,n+s),c.lineTo(e+i,n+s),0===i&&0===r||c.bezierCurveTo(e+i*l,n+s,e,n+s-r*l,e,n+s-r),c.lineTo(e,n+r),0===i&&0===r||c.bezierCurveTo(e,n+r*l,e+i*l,n,e+i,n),c}(e);break;case"polygon":i=r(e,i),D=e,A=new o.ShapePath,O=0,D.getAttribute("points").replace(/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,function(t,e,n){var i=u(e),r=u(n);0===O?A.moveTo(i,r):A.lineTo(i,r),O++}),A.currentPath.autoClose=!0,P=A;break;case"polyline":i=r(e,i),C=e,T=new o.ShapePath,E=0,C.getAttribute("points").replace(/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,function(t,e,n){var i=u(e),r=u(n);0===E?T.moveTo(i,r):T.lineTo(i,r),E++}),T.currentPath.autoClose=!1,P=T;break;case"circle":i=r(e,i),P=function(t){var e=u(t.getAttribute("cx")||0),n=u(t.getAttribute("cy")||0),i=u(t.getAttribute("r")||0),r=new o.Path;r.absarc(e,n,i,0,2*Math.PI,!1);var a=new o.ShapePath;return a.subPaths.push(r),a}(e);break;case"ellipse":i=r(e,i),P=function(t){var e=u(t.getAttribute("cx")||0),n=u(t.getAttribute("cy")||0),i=u(t.getAttribute("rx")||0),r=u(t.getAttribute("ry")||0),a=new o.Path;a.absellipse(e,n,i,r,0,2*Math.PI,void 0,void 0);var s=new o.ShapePath;return s.subPaths.push(a),s}(e);break;case"line":i=r(e,i),c=u((l=e).getAttribute("x1")||0),w=u(l.getAttribute("y1")||0),M=u(l.getAttribute("x2")||0),_=u(l.getAttribute("y2")||0),(S=new o.ShapePath).moveTo(c,w),S.lineTo(M,_),S.currentPath.autoClose=!1,P=S;break;case"defs":I=!1;break;case"use":i=r(e,i);var R=e.href.baseVal.substring(1),k=e.viewportElement.getElementById(R);k?t(k,i):console.warn("SVGLoader: 'use node' references non-existent node id: "+R)}if(P&&(void 0!==i.fill&&"none"!==i.fill&&P.color.setStyle(i.fill),function(t,e){function n(t){x.set(t.x,t.y,1).applyMatrix3(e),t.set(x.x,x.y)}for(var i=function(t){return 0!==t.elements[1]||0!==t.elements[3]}(e),r=t.subPaths,a=0,o=r.length;a<o;a++)for(var s=r[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&&(i&&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=e.elements,Math.sqrt(h[0]*h[0]+h[1]*h[1])),c.yRadius*=(u=e.elements,Math.sqrt(u[3]*u[3]+u[4]*u[4])))}var u,h}(P,b),h.push(P),P.userData={node:e,style:i}),I)for(var N=e.childNodes,B=0;B<N.length;B++)t(N[B],i);L&&(d.pop(),0<d.length?b.copy(d[d.length-1]):b.identity())}}(w.documentElement,{fill:"#000",fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4}),{paths:h,xml:w.documentElement}},l.createShapes=function(t){var e=999999999,n={ORIGIN:0,DESTINATION:1,BETWEEN:2,LEFT:3,RIGHT:4,BEHIND:5,BEYOND:6},i={loc:n.ORIGIN,t:0};function r(t,e,r,o){var s=t.x,l=e.x,c=r.x,u=o.x,h=t.y,p=e.y,d=r.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?r:o,t,e),i.loc==n.ORIGIN)return{x:(b=0===x?r:o).x,y:b.y,t:i.t};if(i.loc==n.BETWEEN)return{x:+(s+i.t*(l-s)).toPrecision(10),y:+(h+i.t*(p-h)).toPrecision(10),t:i.t}}return null}for(x=0;x<2;x++){var b;if(a(0===x?r:o,t,e),i.loc==n.ORIGIN)return{x:(b=0===x?r:o).x,y:b.y,t:i.t}}return{x:+(s+v*(l-s)).toPrecision(10),y:+(h+v*(p-h)).toPrecision(10),t:v}}function a(t,e,r){var a,o=r.x-e.x,s=r.y-e.y,l=t.x-e.x,c=t.y-e.y,u=o*c-l*s;return t.x===e.x&&t.y===e.y?(i.loc=n.ORIGIN,i.t=0):t.x===r.x&&t.y===r.y?(i.loc=n.DESTINATION,i.t=1,0):void(u<-Number.EPSILON?i.loc=n.LEFT:u>Number.EPSILON?i.loc=n.RIGHT:o*l<0||s*c<0?i.loc=n.BEHIND:Math.sqrt(o*o+s*s)<Math.sqrt(l*l+c*c)?i.loc=n.BEYOND:(a=0!=o?l/o:c/s,i.loc=n.BETWEEN,i.t=a))}function s(t,e,n){var i=new o.Vector2;e.getCenter(i);var a=[];return n.forEach(function(e){e.boundingBox.containsPoint(i)&&function(t,e){for(var n=[],i=[],a=1;a<t.length;a++)for(var s=t[a-1],l=t[a],c=function(t){var a=e[t-1],c=e[t],u=r(s,l,a,c);null!==u&&void 0===n.find(function(t){return t.t<=u.t+Number.EPSILON&&t.t>=u.t-Number.EPSILON})&&(n.push(u),i.push(new o.Vector2(u.x,u.y)))},u=1;u<e.length;u++)c(u);return i}(t,e.points).forEach(function(t){a.push({identifier:e.identifier,isCW:e.isCW,point:t})})}),a.sort(function(t,e){return t.point.x-e.point.x}),a}var l=0,c=e,u=-e,h=t.subPaths.map(function(t){for(var n=t.getPoints(),i=-e,r=e,a=-e,s=e,h=0;h<n.length;h++){var p=n[h];p.y>i&&(i=p.y),p.y<r&&(r=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:t.curves,points:n,isCW:o.ShapeUtils.isClockWise(n),identifier:l++,boundingBox:new o.Box2(new o.Vector2(s,r),new o.Vector2(a,i))}});h=h.filter(function(t){return 1<t.points.length}),l=0;var p=(h=h.map(function(t){return t.identifier=l,l++,t})).map(function(e){return function(t,e,n,i,r){null!=r&&""!==r||(r="nonzero");var a=new o.Vector2;t.boundingBox.getCenter(a);var l=s([new o.Vector2(n,a.y),new o.Vector2(i,a.y)],t.boundingBox,e);l.sort(function(t,e){return t.point.x-e.point.x});var c=[],u=[];l.forEach(function(e){e.identifier===t.identifier?c.push(e):u.push(e)});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(t.identifier),"evenodd"===r){var f=p.length%2==0,m=p[p.length-2];return{identifier:t.identifier,isHole:f,for:m}}if("nonzero"===r){f=!0;for(var g=m=null,v=0;v<p.length;v++){var y=p[v];f?(g=e[y].isCW,f=!1,m=y):g!==e[y].isCW&&(g=e[y].isCW,f=!0)}return{identifier:t.identifier,isHole:f,for:m}}console.warn('fill-rule: "'+r+'" is currently not implemented.')}(e,h,c,u,t.userData.style.fillRule)}),d=[];return h.forEach(function(t){if(!p[t.identifier].isHole){var e=new o.Shape;e.curves=t.curves,p.filter(function(e){return e.isHole&&e.for===t.identifier}).forEach(function(t){var n=h[t.identifier],i=new o.Path;i.curves=n.curves,e.holes.push(i)}),d.push(e)}}),d},l.getStrokeStyle=function(t,e,n,i,r){return{strokeColor:e=void 0!==e?e:"#000",strokeWidth:t=void 0!==t?t:1,strokeLineJoin:n=void 0!==n?n:"miter",strokeLineCap:i=void 0!==i?i:"butt",strokeMiterLimit:r=void 0!==r?r:4}},l.pointsToStroke=function(t,e,n,i){var r=[],a=[],s=[];if(0===l.pointsToStrokeWithBuffers(t,e,n,i,r,a,s))return null;var c=new o.BufferGeometry;return c.setAttribute("position",new o.Float32BufferAttribute(r,3)),c.setAttribute("normal",new o.Float32BufferAttribute(a,3)),c.setAttribute("uv",new o.Float32BufferAttribute(s,2)),c},l.pointsToStrokeWithBuffers=function(t,e,n,i,r,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,b=new o.Vector2,w=new o.Vector2,M=new o.Vector2,_=new o.Vector2,S=new o.Vector2,C=new o.Vector2;n=void 0!==n?n:12,i=void 0!==i?i:.001,l=void 0!==l?l:0;var T=(t=function(t){for(var e=!1,n=1,r=t.length-1;n<r;n++)if(t[n].distanceTo(t[n+1])<i){e=!0;break}if(!e)return t;var a=[];for(a.push(t[0]),n=1,r=t.length-1;n<r;n++)t[n].distanceTo(t[n+1])>=i&&a.push(t[n]);return a.push(t[t.length-1]),a}(t)).length;if(T<2)return 0;var E,D,A,O,L,I,P=t[0].equals(t[T-1]),R=t[0],k=e.strokeWidth/2,N=1/(T-1),B=0,F=!1,j=0,V=3*l,z=2*l;K(t[0],t[1],c).multiplyScalar(k),g.copy(t[0]).sub(c),v.copy(t[0]).add(c),y.copy(g),x.copy(v);for(var G=1;G<T;G++){E=t[G],D=G===T-1?P?t[1]:void 0:t[G+1];var U=c;if(K(R,E,U),h.copy(U).multiplyScalar(k),b.copy(E).sub(h),w.copy(E).add(h),A=B+N,O=!1,void 0!==D){K(E,D,u),h.copy(u).multiplyScalar(k),M.copy(E).sub(h),_.copy(E).add(h),L=!0,h.subVectors(D,R),U.dot(h)<0&&(L=!1),1===G&&(F=L),h.subVectors(D,E),h.normalize();var H=Math.abs(U.dot(h));if(0!==H){var W=k/H;h.multiplyScalar(-W),p.subVectors(E,R),d.copy(p).setLength(W).add(h),S.copy(d).negate();var J=d.length(),q=p.length();p.divideScalar(q),f.subVectors(D,E);var X=f.length();switch(f.divideScalar(X),p.dot(S)<q&&f.dot(S)<X&&(O=!0),C.copy(d).add(E),S.add(E),I=!1,O?L?(_.copy(S),w.copy(S)):(M.copy(S),b.copy(S)):et(),e.strokeLineJoin){case"bevel":nt(L,O,A);break;case"round":it(L,O),L?tt(E,b,M,A,0):tt(E,_,w,A,1);break;case"miter":case"miter-clip":default:var Y=k*e.strokeMiterLimit/J;if(Y<1){if("miter-clip"!==e.strokeLineJoin){nt(L,O,A);break}it(L,O),L?(f.subVectors(C,b).multiplyScalar(Y).add(b),m.subVectors(C,M).multiplyScalar(Y).add(M),Q(b,A,0),Q(f,A,0),Q(E,A,.5),Q(E,A,.5),Q(f,A,0),Q(m,A,0),Q(E,A,.5),Q(m,A,0),Q(M,A,0)):(f.subVectors(C,w).multiplyScalar(Y).add(w),m.subVectors(C,_).multiplyScalar(Y).add(_),Q(w,A,1),Q(f,A,1),Q(E,A,.5),Q(E,A,.5),Q(f,A,1),Q(m,A,1),Q(E,A,.5),Q(m,A,1),Q(_,A,1))}else O?(L?(Q(v,B,1),Q(g,B,0),Q(C,A,0),Q(v,B,1),Q(C,A,0),Q(S,A,1)):(Q(v,B,1),Q(g,B,0),Q(C,A,1),Q(g,B,0),Q(S,A,0),Q(C,A,1)),L?M.copy(C):_.copy(C)):L?(Q(b,A,0),Q(C,A,0),Q(E,A,.5),Q(E,A,.5),Q(C,A,0),Q(M,A,0)):(Q(w,A,1),Q(C,A,1),Q(E,A,.5),Q(E,A,.5),Q(C,A,1),Q(_,A,1)),I=!0}}else et()}else et();P||G!==T-1||rt(t[0],y,x,L,!0,B),B=A,R=E,g.copy(M),v.copy(_)}if(P){if(O&&r){var Z=C,$=S;F!==L&&(Z=S,$=C),L?(I||F)&&($.toArray(r,0),$.toArray(r,9),I&&Z.toArray(r,3)):!I&&F||($.toArray(r,3),$.toArray(r,9),I&&Z.toArray(r,0))}}else rt(E,b,w,L,!1,A);return j;function K(t,e,n){return n.subVectors(e,t),n.set(-n.y,n.x).normalize()}function Q(t,e,n){r&&(r[V]=t.x,r[V+1]=t.y,r[V+2]=0,a&&(a[V]=0,a[V+1]=0,a[V+2]=1),V+=3,s&&(s[z]=e,s[z+1]=n,z+=2)),j+=3}function tt(t,e,i,r,a){c.copy(e).sub(t).normalize(),u.copy(i).sub(t).normalize();var o=Math.PI,s=c.dot(u);Math.abs(s)<1&&(o=Math.abs(Math.acos(s))),o/=n,h.copy(e);for(var l=0,d=n-1;l<d;l++)p.copy(h).rotateAround(t,o),Q(h,r,a),Q(p,r,a),Q(t,r,.5),h.copy(p);Q(p,r,a),Q(i,r,a),Q(t,r,.5)}function et(){Q(v,B,1),Q(g,B,0),Q(b,A,0),Q(v,B,1),Q(b,A,1),Q(w,A,0)}function nt(t,e,n){e?(t?(Q(v,B,1),Q(g,B,0),Q(b,A,0),Q(v,B,1),Q(b,A,0),Q(S,A,1),Q(b,n,0),Q(M,n,0)):(Q(v,B,1),Q(g,B,0),Q(w,A,1),Q(g,B,0),Q(S,A,0),Q(w,A,1),Q(w,n,1),Q(_,n,0)),Q(S,n,.5)):(t?(Q(b,n,0),Q(M,n,0)):(Q(w,n,1),Q(_,n,0)),Q(E,n,.5))}function it(t,e){e&&(t?(Q(v,B,1),Q(g,B,0),Q(b,A,0),Q(v,B,1),Q(b,A,0),Q(S,A,1),Q(b,B,0),Q(E,A,.5),Q(S,A,1),Q(E,A,.5),Q(M,B,0),Q(S,A,1)):(Q(v,B,1),Q(g,B,0),Q(w,A,1),Q(g,B,0),Q(S,A,0),Q(w,A,1),Q(w,B,1),Q(S,A,0),Q(E,A,.5),Q(E,A,.5),Q(S,A,0),Q(_,B,1)))}function rt(t,n,i,a,o,s){switch(e.strokeLineCap){case"round":o?tt(t,i,n,s,.5):tt(t,n,i,s,.5);break;case"square":if(o)c.subVectors(n,t),u.set(c.y,-c.x),h.addVectors(c,u).add(t),p.subVectors(u,c).add(t),a?(h.toArray(r,3),p.toArray(r,0),p.toArray(r,9)):(h.toArray(r,3),h.toArray(r,9),p.toArray(r,0));else{c.subVectors(i,t),u.set(c.y,-c.x),h.addVectors(c,u).add(t),p.subVectors(u,c).add(t);var l=r.length;a?(h.toArray(r,l-3),p.toArray(r,l-6)):(h.toArray(r,l-6),p.toArray(r,l-3)),p.toArray(r,l-12)}}}},l);function l(t){var e=a.call(this,t)||this;return e.defaultDPI=90,e.defaultUnit="px",e}n.SVGLoader=s},{three:19}],63:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxTest=void 0;var a,o,s,l=t("../Operate/MrxDbgUiPrBase"),c=t("../Operate/MrxDbgUiPrPoint"),u=t("../MxThreeJS"),h=t("three"),p=t("../MxFun"),d=t("../View/MxDbEntity"),f=t("../MrxDbgUtils"),m=(r(g,a=d.MxDbEntityUserObject),g.prototype.worldDraw=function(t){var e=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),i=new h.Vector3(e.x,n.y),r=new h.Vector3(n.x,e.y),a=[];a.push(e),a.push(n),a.push(i),a.push(r),t.setDashLineDisplay(!0),t.setDash(.1,.2),t.drawLine(r,e)},g.prototype.setPoint=function(t){this.pt=t},g.prototype.setR=function(t){this.r=t},g.prototype.getTypeName=function(){return"MxDbTest"},g.prototype.getGripPoints=function(){var t=[];return t.push(this.pt),t},g.prototype.moveGripPointsAt=function(t,e){return 0==t&&this.pt.add(e),!0},g.prototype.dwgIn=function(t){return a.prototype.dwgIn.call(this,t),this.pt.copy(t.pt),this.r=t.r,!0},g.prototype.dwgOut=function(t){return a.prototype.dwgOut.call(this,t),t.pt=this.pt,t.r=this.r,t},g.prototype.create=function(){return new g},g);function g(){var t=null!==a&&a.apply(this,arguments)||this;return t.pt=new h.Vector3,t.r=100,t}function v(t){var e=new c.MrxDbgUiPrPoint;e.setMessage("\n指定第一点:"),e.go(function(t){if(0==t){var n=e.value(),i=new h.Vector3;i.x=n.x,i.y=n.y;var r=new l.McEdGetPointWorldDrawObject;r.setDraw(function(t,e){e.setColor(255),e.drawLine(t,i)}),e.setUserDraw(r),e.setMessage("\n指定下一点:"),e.go(function(t){if(0==t){var i=e.value(),r=p.MxFun.getCurrentDraw(),a=u.MxThreeJS.createLine(n,i,16777215);r.addObject(a)}})}})}function y(){var t=new c.MrxDbgUiPrPoint;t.setMessage("\n指定第一点:"),t.go(function(e){if(0==e){var n=p.MxFun.getCurrentDraw(),i=new m;i.setColor(16711680),i.setPoint(t.value()),i.setR(n.screenCoordLong2Doc(100)),n.addMxEntity(i),n.addMxCurrentSelect(i.objectId())}})}function x(){f.MrxDbgUtils.selectEnt("Test").then(function(t){console.log(t)})}function b(){var t=p.MxFun.getCurrentDraw();s?(t.eraseAllMxEntity(),t.loadMxEntityFromJson(s)):(s=t.saveMxEntityToJson(),console.log(s))}function w(){p.MxFun.openFile("demo/buf/hhhh.dwg?token=123456")}(o||(n.MxTest=o={})).registerCommand=function(){console.log("regist mx test"),(new m).init(),p.MxFun.addCommand("MxTest_GetPoint",v),p.MxFun.addCommand("MxTest_DrawCustomEntity",y),p.MxFun.addCommand("MxTest_EntSel",x),p.MxFun.addCommand("MxTest_SaveMxDbEntityToJson",b),p.MxFun.addCommand("MxTest_OpenFile",w),p.MxFun.addWindowsEvent(function(t,e){if("mouseup"==t){if(p.MxFun.isRunningCommand())return 0;if(0!=e.button)return 0;var n=e.srcElement;if(n&&"CANVAS"==n.tagName){var i=p.MxFun.getCurrentDraw(),r=new h.Vector3(e.offsetX,e.offsetY,0);i.findMxEntityAtPoint(r,!1).length&&e.preventDefault()}return 0}})}},{"../MrxDbgUtils":20,"../MxFun":34,"../MxThreeJS":44,"../Operate/MrxDbgUiPrBase":51,"../Operate/MrxDbgUiPrPoint":52,"../View/MxDbEntity":71,three:19}],64:[function(require,module,exports){"use strict";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="",this.sLanguageTable={layout:"布局",layer:"图层",visible:"可见",color:"颜色",name:"名字",status:"状态",openComplete:"提示:打开图纸完成"}}return MxUiObject.prototype.SetLayoutData=function(t){this.vecLayoutData=t},MxUiObject.prototype.CallMxCommand=function(t){MxFun_1.MxFun.callCommand(t,"")},MxUiObject.prototype.EvalJs=function(value){eval(value)},MxUiObject.prototype.SetLayerData=function(t){this.vecLayerData=t},MxUiObject.prototype.SetSketchLayerData=function(t){this.vecSketchLayerData=t},MxUiObject.prototype.init=function(){this.onInit()},MxUiObject.prototype.addMenuItem=function(t,e,n,i){void 0===e&&(e=""),void 0===n&&(n=-1),void 0===i&&(i=-1);var r=new MxMenuItem;r.text=t,r.evalString=e,-1==i&&(i=this.idMenuItemCount,this.idMenuItemCount++),r.id=i,r.parentId=n,this.vecMenuItem.push(r)},MxUiObject.prototype.addToolBarItem=function(t,e,n,i,r){void 0===e&&(e=""),void 0===n&&(n=""),void 0===i&&(i=!1),void 0===r&&(r="");var a=new MxToolBarItem;a.image=t,a.evalString=n,a.text=e,a.isMxCommand=i,a.itemid=r,this.vecToolBarItem.push(a)},MxUiObject.prototype.setPath=function(t){this.uiPath=t},MxUiObject.prototype.getPath=function(){return this.uiPath},MxUiObject.prototype.create=function(){this.onCreate()},MxUiObject.prototype.writeUICSS=function(){var t=this.uiPath;MxFun_1.MxFun.isPC()?(document.write("<link rel='stylesheet' href='"+t+"/css/mxbimpcm.css'>"),this.isShowMainMenu&&(document.write("<link rel='stylesheet' href='"+t+"/css/rightfacefonts2.css'>"),document.write("<link rel='stylesheet' href='"+t+"/css/rightmnu.css'>"),document.write("<script type='text/javascript' src='"+t+"/hc-mobile-nav.js'><\/script>"))):(document.write("<link rel='stylesheet' href='"+t+"/css/mxmobile.css'>"),this.isShowMainMenu&&(document.write("<link href='"+t+"/css/font-awesome.min.css' rel='stylesheet'>"),document.write("<link rel='stylesheet' href='"+t+"/css/rightfacefonts1.css'>"),document.write("<link rel='stylesheet' href='"+t+"/css/rightfacefonts2.css'>"),document.write("<link rel='stylesheet' href='"+t+"/css/rightmnu.css'>"),document.write("<script type='text/javascript' src='"+t+"/hc-mobile-nav.js'><\/script>")))},MxUiObject}();exports.MxUiObject=MxUiObject},{"../MxFun":34}],65:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxUiObjectMobile=void 0;var a,o=t("./MxUiObject"),s=t("../MxFun"),l=(r(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(t){if(0!=t.length){var e;e="string"==typeof t?JSON.parse(t):t;var n="";for(var i in e){var r=e[i];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>'+r.name+"</td>",n+="</tr>",r.datas){var o=r.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 t=document.getElementById("LayerInterface");"none"==t.style.display?(t.style.display="block",t.style.left="80px",t.style.top="50px"):t.style.display="none"},c.prototype.SwitchShowStructTree=function(){},c.prototype.Chosecolor=function(){document.getElementById("color-picker").click()},c.prototype.ColorChange=function(t){document.getElementById("colorbox").style.backgroundColor=t,s.MxFun.setCurrentColor(t)},c.prototype.SwitchShowLayout=function(){var t=document.getElementById("LayerOutInterface");"none"==t.style.display?t.style.display="block":t.style.display="none"},c.prototype.WriteTitle=function(){var t=this.uiPath;document.write("<div class='bar1'>"),document.write("<img src='"+t+"/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 t=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='"+t+"/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 t=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='"+t+"/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 t=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='"+t+"/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='"+t+"/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 t=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='"+t+"/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 t=this.uiPath,e=this.vecLayerData,n=this.vecSketchLayerData,i="";if(null!=n){var r=n;for(var a in r){i+="<div>";var o="hide.png";0==r[a].off&&(o="show.png");var s="unlock.png";i+="<table class='bf-table'>",i+="<tbody class='bf-group'>",i+="<tr class='bf-group-title'>",i+='<td><img class="layer-enable" sketch=1 id='+r[a].id+' src="'+t+"/image/"+o+'"/></td>',i+='<td><span class="layer-color" style="background-color:'+r[a].color+'"></span></td>',i+='<td><span class="layer-text">草图_'+r[a].name+"</span></td>",i+='<td><img class="layer-state" src="'+t+"/image/"+s+'"/></td>',i+="</tr>",i+="</tbody>",i+="</table>",i+="</div>"}}if(null!=e)for(var a in r=e)i+="<div>",o="hide.png",0==r[a].off&&(o="show.png"),s="lock.png",i+="<table class='bf-table'>",i+="<tbody class='bf-group'>",i+="<tr class='bf-group-title'>",i+='<td><img class="layer-enable" sketch=0 id='+r[a].id+' src="'+t+"/image/"+o+'"/></td>',i+='<td><span class="layer-color" style="background-color:'+r[a].color+'"></span></td>',i+='<td><span class="layer-text">'+r[a].name+"</span></td>",i+='<td><img class="layer-state" src="'+t+"/image/"+s+'"/></td>',i+="</tr>",i+="</tbody>",i+="</table>",i+="</div>";var l=document.getElementById("Layer-Info");null!=l&&(l.innerHTML=i)},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(t){if(this.isShowToolbar){var e="";for(var n in t){var i=t[n],r="uiObj.CallMxCommand";i.isMxCommand||(r="uiObj.EvalJs"),0<i.itemid.length?e+='<div class="bf-button" onclick="'+r+"('"+t[n].evalString+'\')"><img class="mainimage-bf-butto" id="'+i.itemid+'" src="'+this.uiPath+"\\image\\"+i.image+'" title="'+t[n].text+'"></div>':e+='<div class="bf-button" onclick="'+r+"('"+t[n].evalString+'\')"><img class="mainimage-bf-butto" src="'+this.uiPath+"\\image\\"+i.image+'" title="'+t[n].text+'"></div>'}document.getElementById("MainMenuContent").innerHTML=e}},c.prototype.InitEvent=function(){var t=document.getElementById("LayerInterface");this.CreateToolBar(this.vecToolBarItem),t.style.display="none";var e=this.vecMenuItem;this.isShowMainMenu&&function(t){var n="";!function t(e,i){var r=function(t,e){var n=new Array;for(var i in e)e[i].parentId==t&&n.push(e[i]);return n}(e,i);if(0<r.length){for(var a in n+="<ul>",r)0!=r[a].evalString.length?(n+='<li><p class="li_option" ',n+="onclick=\"uiObj.EvalJs('"+r[a].evalString+"')\"",n+=">"+r[a].text+"</p>"):(n+="<li><a ",n+=">"+r[a].text+"</a>"),t(r[a].id,i),n+="</li>";n+="</br>",n+="</br>",n+="</br>",n+="</ul>"}}(-1,e),t("#main-nav").append(n);var i=t("#main-nav"),r=t(".toggle"),a={maxWidth:!1,customToggle:r,levelTitles:!0},o=null,s={};o&&o.remove(),r.off("click"),o=i.clone(),t.extend(s,{side:"right"}),o.hcMobileNav(t.extend({},a,s))}(jQuery);var n=window.location.href,i=n.length,r=n.indexOf("?"),a=n.substr(r,i).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 t=$(this);$(".my-option").each(function(){$(this).removeClass("active")}),t.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 t=s.MxFun.getUiObj().getPath(),e=parseInt($(this).attr("id")),n=parseInt($(this).attr("sketch")),i=!0;$(this).attr("src")==t+"/image/show.png"?($(this).attr("src",t+"/image/hide.png"),i=!1):$(this).attr("src",t+"/image/show.png"),s.MxFun.showLayer(e,i,1==n)})},c.prototype.Fullscreen=function(){var t=document.documentElement;t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullScreen&&t.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":34,"./MxUiObject":64}],66:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxUiObjectPC=void 0;var a,o=t("./MxUiObject"),s=t("../MxFun"),l=(r(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 t=this.uiPath;document.write("<div id='all'>"),document.write(" <div class='bar1'>"),document.write(" <img src="+t+"/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 t=this.uiPath;document.write("<div class='Prompt'>"),document.write("<div style='text-align: center;'>"),document.write("<img src='"+t+"/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'>"+this.sLanguageTable.openComplete+"</span>"),document.write("</div>")},c.prototype.WriteLayer=function(){var t=this.uiPath;this.isShowLayer&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='LayerThumbnail' title='"+this.sLanguageTable.layer+"'"),document.write("style='position: absolute;left: 10px; top: 45px; ' onclick='uiObj.SwitchShowLayer()'>"),document.write("<div class='bf-button'>"),document.write("<img src='"+t+"/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;'>"+this.sLanguageTable.layer+"</div>"),document.write("<div>"),document.write("<div class='layer-title' style='width: 50px;font-size: 14px'>"+this.sLanguageTable.visible+"</div>"),document.write("<div class='layer-title' style='width: 50px;font-size: 14px'>"+this.sLanguageTable.color+"</div>"),document.write("<div class='layer-title' style='width: 148px;font-size: 14px'>"+this.sLanguageTable.name+"</div>"),document.write("<div class='layer-title' style='width: 50px;font-size: 14px'>"+this.sLanguageTable.status+"</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 t=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='"+t+"/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='"+t+"/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 t=this.uiPath;this.isShowLayout&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='LayerOut' title='"+this.sLanguageTable.layout+"'"),document.write("style='position: absolute;left: 10px; top: 97px; ' onclick='uiObj.SwitchShowLayout()'>"),document.write("<div class='bf-button'>"),document.write("<img src='"+t+"/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;'>"+this.sLanguageTable.layout+"</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(t){if(this.isShowToolbar){var e="";for(var n in t){var i=t[n],r="uiObj.CallMxCommand";i.isMxCommand||(r="uiObj.EvalJs"),0<i.itemid.length?e+='<div class="bf-button" onclick="'+r+"('"+t[n].evalString+'\')"><img class="mainimage-bf-butto" id="'+i.itemid+'" src="'+this.uiPath+"\\image\\"+i.image+'" title="'+t[n].text+'"></div>':e+='<div class="bf-button" onclick="'+r+"('"+t[n].evalString+'\')"><img class="mainimage-bf-butto" src="'+this.uiPath+"\\image\\"+i.image+'" title="'+t[n].text+'"></div>'}document.getElementById("MainMenuContent").innerHTML=e}},c.prototype.UpDisplayLayer=function(){var t=this.uiPath,e=this.vecLayerData,n=this.vecSketchLayerData,i="";if(null!=n){var r=n;for(var a in r){i+="<div>";var o="hide.png";0==r[a].off&&(o="show.png");var s="unlock.png";i+="<table class='bf-table'>",i+="<tbody class='bf-group'>",i+="<tr class='bf-group-title'>",i+='<td><img class="layer-enable" sketch=1 id='+r[a].id+' src="'+t+"/image/"+o+'"/></td>',i+='<td><span class="layer-color" style="background-color:'+r[a].color+'"></span></td>',i+='<td><span class="layer-text">草图_'+r[a].name+"</span></td>",i+='<td><img class="layer-state" src="'+t+"/image/"+s+'"/></td>',i+="</tr>",i+="</tbody>",i+="</table>",i+="</div>"}}if(null!=e)for(var a in r=e)i+="<div>",o="hide.png",0==r[a].off&&(o="show.png"),s="lock.png",i+="<table class='bf-table'>",i+="<tbody class='bf-group'>",i+="<tr class='bf-group-title'>",i+='<td><img class="layer-enable" sketch=0 id='+r[a].id+' src="'+t+"/image/"+o+'"/></td>',i+='<td><span class="layer-color" style="background-color:'+r[a].color+'"></span></td>',i+='<td><span class="layer-text">'+r[a].name+"</span></td>",i+='<td><img class="layer-state" src="'+t+"/image/"+s+'"/></td>',i+="</tr>",i+="</tbody>",i+="</table>",i+="</div>";var l=document.getElementById("Layer-Info");null!=l&&(l.innerHTML=i)},c.prototype.UpDisplayLayout=function(){var t=this.vecLayoutData,e="";if(e+="<div>",e+="<table class='bf-table'>",e+="<tbody class='bf-group'>",e+="<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>",e+="<td class='bf_layerout_td' style='width: 60px' >",e+="<div class='bf_layer_div layer_on'></div>",e+="</td>",e+="<td style='width: 238px' >",e+="<span class='layout-name' name='Model' style='color: white;cursor: pointer;'>Model</span>",e+="</td>",e+="</tr>",null!=t){var n=t;for(var i in n)e+="<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>",e+="<td class='bf_layerout_td' style='width: 60px' >",e+="<div class='bf_layer_div layer_on'></div>",e+="</td>",e+="<td style='width: 238px' >",e+="<span class='layout-name' name='"+n[i]+"' style='color: white;cursor: pointer;'>"+n[i]+"</span>",e+="</td>",e+="</tr>"}e+="</tbody>",e+="</table>",e+="</div>";var r=document.getElementById("layout-Info");null!=r&&(r.innerHTML=e)},c.prototype.InitEvent=function(){var t=document.getElementById("ModelTreeInterface"),e=document.getElementById("LayerInterface"),n=document.getElementById("LayerOutInterface"),i=document.getElementById("tuceng"),r=document.getElementById("mulushu"),a=document.getElementById("buju"),o=0,l=0,c=0,u=0,h=!1;r.onmousedown=function(e){o=e.clientX,l=e.clientY,c=t.offsetLeft,u=t.offsetTop,h=!0,t.style.cursor="move"},i.onmousedown=function(t){o=t.clientX,l=t.clientY,c=e.offsetLeft,u=e.offsetTop,h=!0,e.style.cursor="move"},a.onmousedown=function(t){o=t.clientX,l=t.clientY,c=n.offsetLeft,u=n.offsetTop,h=!0,n.style.cursor="move"},window.onmousemove=function(i){if(0!=h){var r=i.clientX,a=i.clientY,s=r-(o-c),p=a-(l-u);t.style.left=s+"px",t.style.top=p+"px",e.style.left=s+"px",e.style.top=p+"px",n.style.left=s+"px",n.style.top=p+"px"}},r.onmouseup=function(){h=!1,t.style.cursor="default"},i.onmouseup=function(){h=!1,e.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(t){var e=$(this)[0].offsetLeft,n=$(this)[0].offsetTop,i=t.pageX,r=t.pageY;$(document).bind("mousemove",function(t){var a=t.pageX-i,o=t.pageY-r,s=e+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(t){var e="";!function t(n,i){var r=function(t,e){var n=new Array;for(var i in e)e[i].parentId==t&&n.push(e[i]);return n}(n,i);if(0<r.length){for(var a in e+="<ul>",r)0!=r[a].evalString.length?(e+='<li><p class="li_option" ',e+="onclick=\"uiObj.EvalJs('"+r[a].evalString+"')\"",e+=">"+r[a].text+"</p>"):(e+="<li><a ",e+=">"+r[a].text+"</a>"),t(r[a].id,i),e+="</li>";e+="</br>",e+="</br>",e+="</br>",e+="</ul>"}}(-1,d),t("#main-nav").append(e);var n=t("#main-nav"),i=t(".toggle"),r={maxWidth:!1,customToggle:i,levelTitles:!0},a=null,o={};a&&a.remove(),i.off("click"),a=n.clone(),t.extend(o,{side:"right"}),a.hcMobileNav(t.extend({},r,o))}(jQuery),$(".li_option").click(function(){var t=$(this);$(".li_option").each(function(){$(this).removeClass("active")}),t.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 t=s.MxFun.getUiObj().getPath(),e=parseInt($(this).attr("id")),n=parseInt($(this).attr("sketch")),i=!0;$(this).attr("src")==t+"/image/show.png"?($(this).attr("src",t+"/image/hide.png"),i=!1):$(this).attr("src",t+"/image/show.png"),s.MxFun.showLayer(e,i,1==n)}),$(document).on("click",".layout-name",function(){var t=$(this).attr("name");"Model"==t&&(t=""),s.MxFun.getCurrentDraw().gotoLayout(t)})},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(t){if(0!=t.length){var e;e="string"==typeof t?JSON.parse(t):t;var n="";for(var i in e){var r=e[i];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>"+r.name+"</td>",n+="</tr>",r.datas){var o=r.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 t=document.getElementById("ModelTreeInterface"),e=document.getElementById("ModelTreeThumbnail"),n=document.getElementById("LayerThumbnail"),i=document.getElementById("LayerInterface"),r=document.getElementById("LayerOut"),a=document.getElementById("LayerOutInterface");t.style.display="none",(a.style.display="none")==i.style.display?(n.style.display="block",i.style.display="block",i.style.left="80px",i.style.top="50px",null!=e&&(e.style.display="block"),null!=r&&(r.style.display="block"),t.style.display="none",a.style.display="none"):(i.style.display="none",null!=e&&(e.style.display="block"),n.style.display="block",null!=r&&(r.style.display="block"))},c.prototype.SwitchShowStructTree=function(){var t=document.getElementById("ModelTreeInterface"),e=document.getElementById("ModelTreeThumbnail"),n=document.getElementById("LayerThumbnail"),i=document.getElementById("LayerInterface"),r=document.getElementById("LayerOut"),a=document.getElementById("LayerOutInterface");i.style.display="none",(a.style.display="none")==t.style.display?(null!=e&&(e.style.display="block"),t.style.display="block",t.style.left="80px",t.style.top="50px",n.style.display="block",null!=r&&(r.style.display="block"),i.style.display="none",a.style.display="none"):(t.style.display="none",null!=e&&(e.style.display="block"),n.style.display="block",null!=r&&(r.style.display="block"))},c.prototype.Chosecolor=function(){document.getElementById("color-picker").click()},c.prototype.ColorChange=function(t){document.getElementById("colorbox").style.backgroundColor=t,s.MxFun.setCurrentColor(t)},c.prototype.SwitchShowLayout=function(){var t=document.getElementById("ModelTreeInterface"),e=document.getElementById("ModelTreeThumbnail"),n=document.getElementById("LayerThumbnail"),i=document.getElementById("LayerInterface"),r=document.getElementById("LayerOut"),a=document.getElementById("LayerOutInterface");t.style.display="none",i.style.display="none",a&&"none"==a.style.display?(r&&(r.style.display="block"),a.style.display="block",a.style.left="80px",a.style.top="120px",null!=e&&(e.style.display="block"),n&&(n.style.display="block"),t.style.display="none",i.style.display="none"):(a&&(a.style.display="none"),null!=e&&(e.style.display="block"),n&&(n.style.display="block"),r&&(r.style.display="block"))},c.prototype.Fullscreen=function(){var t=document.documentElement;t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullScreen&&t.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":34,"./MxUiObject":64}],67:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxUiVue=void 0;var i,r,a,o,s=t("../MxFun"),l=t("../Operate/MxJigCmdManager"),c=t("../MxTools"),u=t("../Operate/MxCmdRunManager");function h(t){if(32==t||13==t)if(l.MxJigCmdManager.isRunning())l.MxJigCmdManager.OnEnter(t);else{var e=m(),n="";n=0==e.length?u.MxCmdRunManager.GetPrvCmd():e,g(""),n=c.MxTools.stringTrimLeftSpace(n),s.MxFun.sendStringToExecute(n)}else if(27==t)l.MxJigCmdManager.isRunning()?l.MxJigCmdManager.stopCmd():d(" *取消*\n命令:");else if(38==t)l.MxJigCmdManager.isRunning()||(u.MxCmdRunManager.MoveUpKey(),0!=(i=u.MxCmdRunManager.GetListCommad()).length&&(g(i),f()));else if(40==t){var i;l.MxJigCmdManager.isRunning()||(u.MxCmdRunManager.MoveDownKey(),0!=(i=u.MxCmdRunManager.GetListCommad()).length&&(g(i),f()))}}function p(t,e){void 0===e&&(e=!0);var n=t.length;if(!(n<1)){for(var i=o.getCmdLine(),r=i.getCmdTip(),a=i.getCmdText(),s=t.indexOf("\n"),l=0,c=!0;-1!=s&&(c?(i.addCmdDisplay("\n"+r+a+t.substring(l,s-l)),a=r="",c=!1):i.addCmdDisplay("\n"+t.substring(l,s-l)),(l=s+1)<n);)s=t.indexOf("\n",l);if(c){var u=t.substring(l,n-l),h=u.indexOf("\r"),p=u.length;r=-1==h?r+a+u:h+1<p?u.substring(h+1,p-h-1):""}else l<n&&(r=t.substring(l,n));a="",e&&(r+=" "),i.setCmdTip(r),i.setCmdText(a),i.upDisplay()}}function d(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(null!=o){for(var i=arguments,r=i[0],a=0;a<i.length-1;a++){var s=new RegExp("\\{"+a+"\\}","gm");r=r.replace(s,i[a+1])}p(r,!0)}}function f(){null!=o&&o.getCmdLine().upDisplay()}function m(){if(null==o)return"";var t=o.getCmdLine();return c.MxTools.stringTrimLeftRightSpace(t.getCmdText())}function g(t){if(null!=o)return o.getCmdLine().setCmdText(t)}function v(t){var e=l.MxJigCmdManager.getCurCmd();null!=e&&(e.getDynImput().onKeyDonw(t)||h(t))}r=i||(n.MxUiVue=i={}),o=void 0,(a=r.CursorType||(r.CursorType={}))[a.kNormal=0]="kNormal",a[a.kRect=1]="kRect",a[a.kCross=2]="kCross",r.isNull=function(){return null==o},r.init=function(t){(o=t).mountKeydownEvent(h),o.getDynamicInput().mountKeydownEvent(v)},r.setTipCoord=function(t){null!=o&&o.setTipCoord(t)},r.setCursorType=function(t){null!=o&&o.setCursorType(t)},r.AcutPrintfNoFormat=p,r.acutPrintf=d,r.cmdLineUpDisplay=f,r.getCmdText=m,r.setCmdText=g,r.getCmdDisplay=function(){return null==o?"":o.getCmdLine().getCmdDisplay()},r.setCmdDisplay=function(t){if(null!=o)return o.getCmdLine().setCmdDisplay(t)},r.getCmdTip=function(){return null==o?"":o.getCmdLine().getCmdTip()},r.setCmdTip=function(t){if(null!=o)return o.getCmdLine().setCmdTip(t)},r.restoreCmdStatus=function(){if(null!=o){var t=o.getCmdLine();" "==t.getCmdTip()&&0==t.getCmdText().length?(t.setCmdTip(""),d("{0}:","命令")):d("\n{0}:","命令")}},r.DynamicInput_upDisplay=function(){null!=o&&r.OnMxEvent({name:"dynInputUpDisplay"})},r.DynamicInput_setType=function(t){null!=o&&o.getDynamicInput().setType(t)},r.DynamicInput_getType=function(){return null==o?l.MxJigCmdManager.DynamicInputType.kNoInput:o.getDynamicInput().getType()},r.DynamicInput_setPos=function(t){null!=o&&o.getDynamicInput().setPos([t.x,t.y])},r.DynamicInput_setTip=function(t){null!=o&&o.getDynamicInput().setTip(t)},r.DynamicInput_setValue1=function(t){null!=o&&o.getDynamicInput().setValue1(t)},r.DynamicInput_getValue1=function(){return null==o?"":o.getDynamicInput().getValue1()},r.DynamicInput_setValue1Pos=function(t){null!=o&&o.getDynamicInput().setValue1Pos([t.x,t.y])},r.DynamicInput_setValue2=function(t){null!=o&&o.getDynamicInput().setValue2(t)},r.DynamicInput_getValue2=function(){return null==o?"":o.getDynamicInput().getValue2()},r.DynamicInput_getFocusValue=function(){return null==o?"":o.getDynamicInput().getFocusValue()},r.DynamicInput_setValue2Pos=function(t){null!=o&&o.getDynamicInput().setValue2Pos([t.x,t.y])},r.DynamicInput_setShow=function(t){null!=o&&o.getDynamicInput().setShow(t)},r.DynamicInput_isShow=function(){return null!=o&&o.getDynamicInput().isShow()},r.OnMxEvent=function(t){if(null==o)return!1;o.OnMxEvent(t)}},{"../MxFun":34,"../MxTools":45,"../Operate/MxCmdRunManager":53,"../Operate/MxJigCmdManager":58}],68:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ExternalReferenceManager=n.ExternalReferenceDatabase=n.Blocks=n.Block=n.Layer=n.MxNewDisplayMemorySection=n.MxNewDisplayMemorySectionType=n.TextureData=n.BlockInstance=n.BlockRef=n.ClipPlans=n.ClipPlan=void 0;var i=t("three"),r=t("../MxShader"),a=t("./MxBrowseLayerData"),o=t("../MxManager"),s=t("../MxNetData"),l=t("../MxStencilObject"),c=t("../MxFun"),u=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0};n.ClipPlan=u;var h=function(){this.ver=4,this.id=1,this.clipPlanArray=new Array,this.clipPoints=[],this.instansClipePoints=[]};n.ClipPlans=h;var p=function(){this.ver=4,this.mat=new i.Matrix4,this.blkRecId=-1,this.blkOwnerId=0,this.layerId=-1,this.color=16777215,this.clipPlans=new h};n.BlockRef=p;var d=function(){this.mat=new i.Matrix4,this.color=new Array,this.topLayerColor=new Array,this.clipPlans=new h,this.clipMat=new i.Matrix4};n.BlockInstance=d;var f,m,g=function(){};n.TextureData=g,(m=f||(n.MxNewDisplayMemorySectionType=f={}))[m.kLinesType=1]="kLinesType",m[m.kTriangleType=2]="kTriangleType",m[m.kLinesType_Float=3]="kLinesType_Float",m[m.kTriangleType_Float=4]="kTriangleType_Float",m[m.kPointType_Float=5]="kPointType_Float",m[m.kPointType=6]="kPointType",n.MxNewDisplayMemorySection=function(){this.id=0,this.type=f.kLinesType,this.blockId=0,this.layerId=0,this.color=0,this.points=[]};var v=(y.prototype.Show=function(t){for(var e=0,n=this._entitys.length;e<n;e++)this._entitys[e].visible=t},y.prototype.updataClipMaterial=function(t){for(var e=this._material_clip.length,n=.5*t.width,i=.5*t.height,r=0;r<e;r++)this._material_clip[r].uniforms.vieww.value=n,this._material_clip[r].uniforms.viewh.value=i},y.prototype.createThreejsObjForMesh_Clip=function(t,e,n){0!=t.size&&t.forEach(function(t){var a=t;if(0!=a.length){var s=[],c=[],u=a[0].clipPlans;u.ver<=3&&(s.push(u.clipPlanArray[0].x1,u.clipPlanArray[0].y1),c.push(u.clipPlanArray[0].x2,u.clipPlanArray[0].y2));for(var h=[],p=[],d=[],f=[],m=[],g=[],v=[],y=0;y<a.length;y++){var x=a[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),g=g.concat(a[y].color)}if(0<this._geometryMeshPositionsByBlock.length)for(y=0;y<a.length;y++)g=g.concat(a[y].color);if(0<this._geometryMeshPositionsByBlock_ZeroLayer.length)for(y=0;y<a.length;y++)v=v.concat(a[y].topLayerColor);var b,w=.5*n.width,M=.5*n.height;u.ver<=3?(b=new i.RawShaderMaterial({uniforms:{clippt1:{value:s},clippt2:{value:c},vieww:{value:w},viewh:{value:M}},vertexShader:r.MxShader.VSHADER_COLOR_POINT_CLIP,fragmentShader:r.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0,side:i.DoubleSide}),this._material_clip.push(b)):b=new i.RawShaderMaterial({vertexShader:r.MxShader.VSHADER_COLOR_POINT,fragmentShader:r.MxShader.FSHADER_COLOR_POINT,linewidth:1,transparent:!0,side:i.DoubleSide});for(var _=0;_<this._geometryMeshPostion.length;_++)(C=new i.InstancedBufferGeometry).maxInstancedCount=a.length,C.setAttribute("position",new i.Float32BufferAttribute(this._geometryMeshPostion[_],2)),C.setAttribute("color",new i.Float32BufferAttribute(this._geometryMeshColor[_],3)),C.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(h),4)),C.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(p),4)),C.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(d),4)),C.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(f),4)),C.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(m),1)),(T=new i.Mesh(C,b)).frustumCulled=!1,T.renderOrder=o.MxData.iCADMeshRenderOrder,e.add(T),this._entitys.push(T),4<=u.ver&&0<u.instansClipePoints.length&&(new l.MxStencilObject).associateObject(T,u.instansClipePoints);for(_=0;_<this._geometryMeshPositionsByBlock.length;_++)(C=new i.InstancedBufferGeometry).maxInstancedCount=a.length,C.setAttribute("position",new i.Float32BufferAttribute(this._geometryMeshPositionsByBlock[_],2)),C.setAttribute("color",new i.InstancedBufferAttribute(new Float32Array(g),3)),C.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(h),4)),C.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(p),4)),C.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(d),4)),C.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(f),4)),C.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(m),1)),(T=new i.Mesh(C,b)).frustumCulled=!1,T.renderOrder=o.MxData.iCADMeshRenderOrder,e.add(T),this._entitys.push(T),4<=u.ver&&0<u.instansClipePoints.length&&(new l.MxStencilObject).associateObject(T,u.instansClipePoints);for(_=0;_<this._geometryMeshPositionsByBlock_ZeroLayer.length;_++)(C=new i.InstancedBufferGeometry).maxInstancedCount=a.length,C.setAttribute("position",new i.Float32BufferAttribute(this._geometryMeshPositionsByBlock_ZeroLayer[_],2)),C.setAttribute("color",new i.InstancedBufferAttribute(new Float32Array(v),3)),C.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(h),4)),C.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(p),4)),C.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(d),4)),C.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(f),4)),C.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(m),1)),(T=new i.Mesh(C,b)).frustumCulled=!1,T.renderOrder=o.MxData.iCADMeshRenderOrder,e.add(T),this._entitys.push(T),4<=u.ver&&0<u.instansClipePoints.length&&(new l.MxStencilObject).associateObject(T,u.instansClipePoints);var S=new i.RawShaderMaterial({uniforms:{color:{value:this._color},clippt1:{value:s},clippt2:{value:c},vieww:{value:w},viewh:{value:M}},vertexShader:r.MxShader.VSHADER_COLOR_POINT_BYLAYER_CLIP,fragmentShader:r.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0,side:i.DoubleSide});for(this._material_clip.push(S),_=0;_<this._geometryMeshPositionsByLayer.length;_++){var C,T;(C=new i.InstancedBufferGeometry).maxInstancedCount=a.length,C.setAttribute("position",new i.Float32BufferAttribute(this._geometryMeshPositionsByLayer[_],2)),C.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(h),4)),C.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(p),4)),C.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(d),4)),C.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(f),4)),C.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(m),1)),(T=new i.Mesh(C,S)).frustumCulled=!1,T.renderOrder=o.MxData.iCADMeshRenderOrder,e.add(T),this._entitys.push(T),4<=u.ver&&0<u.instansClipePoints.length&&(new l.MxStencilObject).associateObject(T,u.instansClipePoints)}}},this)},y.prototype.createThreejsObjForCurve_Clip=function(t,e,n){0!=t.size&&t.forEach(function(t,a,s){var c=t;if(0!=c.length){var u=[],h=[],p=c[0].clipPlans;p.ver<=3&&(u.push(p.clipPlanArray[0].x1,p.clipPlanArray[0].y1),h.push(p.clipPlanArray[0].x2,p.clipPlanArray[0].y2));for(var d=[],f=[],m=[],g=[],v=[],y=[],x=[],b=0;b<c.length;b++){var w=c[b];d=d.concat(w.mat.elements.slice(0,4)),f=f.concat(w.mat.elements.slice(4,8)),m=m.concat(w.mat.elements.slice(8,12)),g=g.concat(w.mat.elements.slice(12,16)),v.push(0)}if(0<this._geometryCurvePositionsByBlock.length)for(b=0;b<c.length;b++)y=y.concat(c[b].color);if(0<this._geometryCurvePositionsByBlock_ZeroLayer.length)for(b=0;b<c.length;b++)x=x.concat(c[b].topLayerColor);var M,_=.5*n.width,S=.5*n.height;p.ver<=3?(M=new i.RawShaderMaterial({uniforms:{clippt1:{value:u},clippt2:{value:h},vieww:{value:_},viewh:{value:S}},vertexShader:r.MxShader.VSHADER_COLOR_POINT_CLIP,fragmentShader:r.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0,side:i.DoubleSide}),this._material_clip.push(M)):M=new i.RawShaderMaterial({vertexShader:r.MxShader.VSHADER_COLOR_POINT,fragmentShader:r.MxShader.FSHADER_COLOR_POINT,linewidth:1,transparent:!0,side:i.DoubleSide});for(var C=0;C<this._geometryCurvePostion.length;C++)(E=new i.InstancedBufferGeometry).maxInstancedCount=c.length,E.setAttribute("position",new i.Float32BufferAttribute(this._geometryCurvePostion[C],2)),E.setAttribute("color",new i.Float32BufferAttribute(this._geometryCurveColor[C],3)),E.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(d),4)),E.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(f),4)),E.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(m),4)),E.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(g),4)),E.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(v),1)),(D=new i.LineSegments(E,M)).frustumCulled=!1,D.renderOrder=o.MxData.iCADCurveRenderOrder,e.add(D),this._entitys.push(D),4<=p.ver&&0<p.instansClipePoints.length&&(new l.MxStencilObject).associateObject(D,p.instansClipePoints);for(C=0;C<this._geometryCurvePositionsByBlock.length;C++)(E=new i.InstancedBufferGeometry).maxInstancedCount=c.length,E.setAttribute("position",new i.Float32BufferAttribute(this._geometryCurvePositionsByBlock[C],2)),E.setAttribute("color",new i.InstancedBufferAttribute(new Float32Array(y),3)),E.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(d),4)),E.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(f),4)),E.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(m),4)),E.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(g),4)),E.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(v),1)),(D=new i.LineSegments(E,M)).frustumCulled=!1,D.renderOrder=o.MxData.iCADCurveRenderOrder,e.add(D),this._entitys.push(D),4<=p.ver&&0<p.instansClipePoints.length&&(new l.MxStencilObject).associateObject(D,p.instansClipePoints);for(C=0;C<this._geometryCurvePositionsByBlock_ZeroLayer.length;C++)(E=new i.InstancedBufferGeometry).maxInstancedCount=c.length,E.setAttribute("position",new i.Float32BufferAttribute(this._geometryCurvePositionsByBlock_ZeroLayer[C],2)),E.setAttribute("color",new i.InstancedBufferAttribute(new Float32Array(x),3)),E.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(d),4)),E.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(f),4)),E.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(m),4)),E.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(g),4)),E.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(v),1)),(D=new i.LineSegments(E,M)).frustumCulled=!1,D.renderOrder=o.MxData.iCADCurveRenderOrder,e.add(D),this._entitys.push(D),4<=p.ver&&0<p.instansClipePoints.length&&(new l.MxStencilObject).associateObject(D,p.instansClipePoints);var T=new i.RawShaderMaterial({uniforms:{color:{value:this._color},clippt1:{value:u},clippt2:{value:h},vieww:{value:_},viewh:{value:S}},vertexShader:r.MxShader.VSHADER_COLOR_POINT_BYLAYER_CLIP,fragmentShader:r.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0,side:i.DoubleSide});for(this._material_clip.push(T),C=0;C<this._geometryCurvePositionsByLayer.length;C++){var E,D;(E=new i.InstancedBufferGeometry).maxInstancedCount=c.length,E.setAttribute("position",new i.Float32BufferAttribute(this._geometryCurvePositionsByLayer[C],2)),E.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(d),4)),E.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(f),4)),E.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(m),4)),E.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(g),4)),E.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(v),1)),(D=new i.LineSegments(E,T)).frustumCulled=!1,D.renderOrder=o.MxData.iCADCurveRenderOrder,e.add(D),this._entitys.push(D),4<=p.ver&&0<p.instansClipePoints.length&&(new l.MxStencilObject).associateObject(D,p.instansClipePoints)}}},this)},y.prototype.createThreejsObjForCurve=function(t,e){if(0!=t.length){for(var n=[],a=[],s=[],l=[],c=[],u=[],h=[],p=0;p<t.length;p++){var d=t[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<t.length;p++)u=u.concat(t[p].color);if(0<this._geometryCurvePositionsByBlock_ZeroLayer.length)for(p=0;p<t.length;p++)h=h.concat(t[p].topLayerColor);for(var f=new i.RawShaderMaterial({vertexShader:r.MxShader.VSHADER_COLOR_POINT,fragmentShader:r.MxShader.FSHADER_COLOR_POINT,linewidth:1,transparent:!0,side:i.DoubleSide}),m=0;m<this._geometryCurvePostion.length;m++)(v=new i.InstancedBufferGeometry).maxInstancedCount=t.length,v.setAttribute("position",new i.Float32BufferAttribute(this._geometryCurvePostion[m],2)),v.setAttribute("color",new i.Float32BufferAttribute(this._geometryCurveColor[m],3)),v.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(c),1)),(y=new i.LineSegments(v,f)).frustumCulled=!1,y.renderOrder=o.MxData.iCADCurveRenderOrder,e.add(y),this._entitys.push(y);for(m=0;m<this._geometryCurvePositionsByBlock.length;m++)(v=new i.InstancedBufferGeometry).maxInstancedCount=t.length,v.setAttribute("position",new i.Float32BufferAttribute(this._geometryCurvePositionsByBlock[m],2)),v.setAttribute("color",new i.InstancedBufferAttribute(new Float32Array(u),3)),v.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(c),1)),(y=new i.LineSegments(v,f)).frustumCulled=!1,y.renderOrder=o.MxData.iCADCurveRenderOrder,e.add(y),this._entitys.push(y);for(m=0;m<this._geometryCurvePositionsByBlock_ZeroLayer.length;m++)(v=new i.InstancedBufferGeometry).maxInstancedCount=t.length,v.setAttribute("position",new i.Float32BufferAttribute(this._geometryCurvePositionsByBlock_ZeroLayer[m],2)),v.setAttribute("color",new i.InstancedBufferAttribute(new Float32Array(h),3)),v.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(c),1)),(y=new i.LineSegments(v,f)).frustumCulled=!1,y.renderOrder=o.MxData.iCADCurveRenderOrder,e.add(y),this._entitys.push(y);var g=new i.RawShaderMaterial({uniforms:{color:{value:this._color}},vertexShader:r.MxShader.VSHADER_COLOR_POINT_BYLAYER,fragmentShader:r.MxShader.FSHADER_COLOR_POINT,linewidth:1,transparent:!0,side:i.DoubleSide});for(m=0;m<this._geometryCurvePositionsByLayer.length;m++){var v,y;(v=new i.InstancedBufferGeometry).maxInstancedCount=t.length,v.setAttribute("position",new i.Float32BufferAttribute(this._geometryCurvePositionsByLayer[m],2)),v.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(c),1)),(y=new i.LineSegments(v,g)).frustumCulled=!1,y.renderOrder=o.MxData.iCADCurveRenderOrder,e.add(y),this._entitys.push(y)}}},y.prototype.createThreejsObjForMemorySections_clip=function(t,e,n){0!=t.size&&t.forEach(function(t){var a=t;if(0!=a.length){for(var s=a[0].clipPlans,c=[],u=[],h=[],p=[],d=[],m=0;m<a.length;m++){var g=a[m];c=c.concat(g.mat.elements.slice(0,4)),u=u.concat(g.mat.elements.slice(4,8)),h=h.concat(g.mat.elements.slice(8,12)),p=p.concat(g.mat.elements.slice(12,16)),d.push(0)}for(var v=this._MemorySections.length,y=0;y<v;y++){var x=this._MemorySections[y],b=n.automaticInversionColor2(x.color),w=[];if(16777216==(4278190080&b)?w=this._color:w.push((255&b)/255,(b>>8&255)/255,(b>>16&255)/255),x.type==f.kLinesType){var M=new i.RawShaderMaterial({uniforms:{color:{value:w}},vertexShader:r.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:r.MxShader.FSHADER_COLOR_POINT_FORMXCAD,linewidth:1,transparent:!0,side:i.DoubleSide});(S=new i.InstancedBufferGeometry).maxInstancedCount=a.length,S.setAttribute("position",new i.Float32BufferAttribute(x.points,3)),S.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(c),4)),S.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(u),4)),S.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(h),4)),S.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(p),4)),S.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(d),1)),(C=new i.LineSegments(S,M)).frustumCulled=!1,C.renderOrder=o.MxData.iCADCurveRenderOrder,4<=s.ver&&0<s.instansClipePoints.length&&(new l.MxStencilObject).associateObject(C,s.instansClipePoints),e.add(C),this._entitys.push(C)}else if(x.type==f.kTriangleType){M=new i.RawShaderMaterial({uniforms:{color:{value:w}},vertexShader:r.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:r.MxShader.FSHADER_COLOR_POINT_FORMXCAD,transparent:!0,side:i.DoubleSide}),(S=new i.InstancedBufferGeometry).maxInstancedCount=a.length,S.setAttribute("position",new i.Float32BufferAttribute(x.points,3)),S.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(c),4)),S.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(u),4)),S.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(h),4)),S.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(p),4)),S.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(d),1));var _=new i.Mesh(S,M);_.frustumCulled=!1,_.renderOrder=o.MxData.iCADMeshRenderOrder,4<=s.ver&&0<s.instansClipePoints.length&&(new l.MxStencilObject).associateObject(_,s.instansClipePoints),e.add(_),this._entitys.push(_)}else if(x.type==f.kPointType){var S,C;M=new i.RawShaderMaterial({uniforms:{color:{value:w}},vertexShader:r.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:r.MxShader.FSHADER_COLOR_POINT_FORMXCAD,transparent:!0,side:i.DoubleSide}),(S=new i.InstancedBufferGeometry).maxInstancedCount=a.length,S.setAttribute("position",new i.Float32BufferAttribute(x.points,3)),S.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(c),4)),S.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(u),4)),S.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(h),4)),S.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(p),4)),S.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(d),1)),(C=new i.Points(S,M)).frustumCulled=!1,C.renderOrder=o.MxData.iCADCurveRenderOrder,4<=s.ver&&0<s.instansClipePoints.length&&(new l.MxStencilObject).associateObject(C,s.instansClipePoints),e.add(C),this._entitys.push(C)}}}},this)},y.prototype.createThreejsObjForMemorySections=function(t,e,n){if(0!=t.length){for(var a=[],s=[],l=[],c=[],u=[],h=0;h<t.length;h++){var p=t[h];a=a.concat(p.mat.elements.slice(0,4)),s=s.concat(p.mat.elements.slice(4,8)),l=l.concat(p.mat.elements.slice(8,12)),c=c.concat(p.mat.elements.slice(12,16)),u.push(0)}for(var d=this._MemorySections.length,m=0;m<d;m++){var g=this._MemorySections[m],v=n.automaticInversionColor2(g.color),y=[];if(16777216==(4278190080&v)?(y=this._color,this._colorValue):y.push((255&v)/255,(v>>8&255)/255,(v>>16&255)/255),g.type==f.kLinesType){var x=new i.RawShaderMaterial({uniforms:{color:{value:y}},vertexShader:r.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:r.MxShader.FSHADER_COLOR_POINT_FORMXCAD,linewidth:1,transparent:!0,side:i.DoubleSide});(w=new i.InstancedBufferGeometry).maxInstancedCount=t.length,w.setAttribute("position",new i.Float32BufferAttribute(g.points,3)),w.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(a),4)),w.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(s),4)),w.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(l),4)),w.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(c),4)),w.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(u),1)),(M=new i.LineSegments(w,x)).frustumCulled=!1,M.renderOrder=o.MxData.iCADCurveRenderOrder,e.add(M),this._entitys.push(M)}else if(g.type==f.kTriangleType){x=new i.RawShaderMaterial({uniforms:{color:{value:y}},vertexShader:r.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:r.MxShader.FSHADER_COLOR_POINT_FORMXCAD,transparent:!0,side:i.DoubleSide}),(w=new i.InstancedBufferGeometry).maxInstancedCount=t.length,w.setAttribute("position",new i.Float32BufferAttribute(g.points,3)),w.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(a),4)),w.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(s),4)),w.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(l),4)),w.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(c),4)),w.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(u),1));var b=new i.Mesh(w,x);b.frustumCulled=!1,b.renderOrder=o.MxData.iCADMeshRenderOrder,e.add(b),this._entitys.push(b)}else if(g.type==f.kPointType){var w,M;x=new i.RawShaderMaterial({uniforms:{color:{value:y},size:1},vertexShader:r.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:r.MxShader.FSHADER_COLOR_POINT_FORMXCAD,transparent:!0,side:i.DoubleSide}),(w=new i.InstancedBufferGeometry).maxInstancedCount=t.length,w.setAttribute("position",new i.Float32BufferAttribute(g.points,3)),w.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(a),4)),w.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(s),4)),w.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(l),4)),w.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(c),4)),w.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(u),1)),(M=new i.Points(w,x)).frustumCulled=!1,M.renderOrder=o.MxData.iCADCurveRenderOrder,e.add(M),this._entitys.push(M)}}}},y.prototype.createThreejsObjForTexture=function(t,e,n){if(0!=t.length){var a=[],s=[],l=[],u=[],h=[],p=n.getCurrentLoadUrl(),d=c.MxFun.dwgDir();0!=d.length&&"/buf/"!=p.substring(p.lastIndexOf("/buf/")).toLowerCase()&&(p=p+d+"/buf/");for(var f=0;f<t.length;f++){var m=t[f];a=a.concat(m.mat.elements.slice(0,4)),s=s.concat(m.mat.elements.slice(4,8)),l=l.concat(m.mat.elements.slice(8,12)),u=u.concat(m.mat.elements.slice(12,16)),h.push(0)}for(var g=0;g<this._TextureData.length;g++){var v=this._TextureData[g],y=new i.InstancedBufferGeometry;y.maxInstancedCount=t.length,y.setAttribute("position",new i.Float32BufferAttribute(v.pos,2)),y.setAttribute("uv",new i.Float32BufferAttribute(v.textureCoord,2)),y.setAttribute("color",new i.Float32BufferAttribute(v.color,3)),y.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(a),4)),y.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(s),4)),y.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(l),4)),y.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(u),4)),y.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(h),1));var x=p+v.sFileName,b={texture:{value:(new i.TextureLoader).load(x,function(t){t&&n.updateDisplay()})}};b.texture.value.wrapS=b.texture.value.wrapT=i.RepeatWrapping;var w=new i.RawShaderMaterial({uniforms:b,vertexShader:r.MxShader.VSHADER_COLOR_POINT_TEXTURE,fragmentShader:r.MxShader.FSHADER_COLOR_POINT_TEXTURE,transparent:!0,side:i.DoubleSide}),M=new i.Mesh(y,w);M.renderOrder=o.MxData.iCADMeshRenderOrder,M.frustumCulled=!1,e.add(M),this._entitys.push(M)}}},y.prototype.createThreejsObjForTexture_Clip=function(t,e,n){if(0!=t.size){var a=n.getCurrentLoadUrl(),s=c.MxFun.dwgDir();0!=s.length&&"/buf/"!=a.substring(a.lastIndexOf("/buf/")).toLowerCase()&&(a=a+s+"/buf/"),t.forEach(function(t){var s=t;if(0!=s.length){for(var c=s[0].clipPlans,u=[],h=[],p=[],d=[],f=[],m=0;m<s.length;m++){var g=s[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)}for(var v=0;v<this._TextureData.length;v++){var y=this._TextureData[v],x=new i.InstancedBufferGeometry;x.maxInstancedCount=s.length,x.setAttribute("position",new i.Float32BufferAttribute(y.pos,2)),x.setAttribute("uv",new i.Float32BufferAttribute(y.textureCoord,2)),x.setAttribute("color",new i.Float32BufferAttribute(y.color,3)),x.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(u),4)),x.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(h),4)),x.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(p),4)),x.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(d),4)),x.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(f),1));var b=a+y.sFileName,w={texture:{value:(new i.TextureLoader).load(b,function(t){t&&n.updateDisplay()})}};w.texture.value.wrapS=w.texture.value.wrapT=i.RepeatWrapping;var M=new i.RawShaderMaterial({uniforms:w,vertexShader:r.MxShader.VSHADER_COLOR_POINT_TEXTURE,fragmentShader:r.MxShader.FSHADER_COLOR_POINT_TEXTURE,transparent:!0,side:i.DoubleSide}),_=new i.Mesh(x,M);_.renderOrder=o.MxData.iCADMeshRenderOrder,_.frustumCulled=!1,4<=c.ver&&0<c.instansClipePoints.length&&(new l.MxStencilObject).associateObject(_,c.instansClipePoints),e.add(_),this._entitys.push(_)}}},this)}},y.prototype.createThreejsObjForMesh=function(t,e){if(0!=t.length){for(var n=[],a=[],s=[],l=[],c=[],u=[],h=[],p=0;p<t.length;p++){var d=t[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(t[p].color)}if(0<this._geometryMeshPositionsByBlock.length)for(p=0;p<t.length;p++)u=u.concat(t[p].color);if(0<this._geometryMeshPositionsByBlock_ZeroLayer.length)for(p=0;p<t.length;p++)h=h.concat(t[p].topLayerColor);for(var f=new i.RawShaderMaterial({vertexShader:r.MxShader.VSHADER_COLOR_POINT,fragmentShader:r.MxShader.FSHADER_COLOR_POINT,transparent:!0,side:i.DoubleSide}),m=0;m<this._geometryMeshPostion.length;m++)(v=new i.InstancedBufferGeometry).maxInstancedCount=t.length,v.setAttribute("position",new i.Float32BufferAttribute(this._geometryMeshPostion[m],2)),v.setAttribute("color",new i.Float32BufferAttribute(this._geometryMeshColor[m],3)),v.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(c),1)),(y=new i.Mesh(v,f)).frustumCulled=!1,y.renderOrder=o.MxData.iCADMeshRenderOrder,e.add(y),this._entitys.push(y);for(m=0;m<this._geometryMeshPositionsByBlock.length;m++)(v=new i.InstancedBufferGeometry).maxInstancedCount=t.length,v.setAttribute("position",new i.Float32BufferAttribute(this._geometryMeshPositionsByBlock[m],2)),v.setAttribute("color",new i.InstancedBufferAttribute(new Float32Array(u),3)),v.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(c),1)),(y=new i.Mesh(v,f)).frustumCulled=!1,y.renderOrder=o.MxData.iCADMeshRenderOrder,e.add(y),this._entitys.push(y);for(m=0;m<this._geometryMeshPositionsByBlock_ZeroLayer.length;m++)(v=new i.InstancedBufferGeometry).maxInstancedCount=t.length,v.setAttribute("position",new i.Float32BufferAttribute(this._geometryMeshPositionsByBlock_ZeroLayer[m],2)),v.setAttribute("color",new i.InstancedBufferAttribute(new Float32Array(h),3)),v.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(c),1)),(y=new i.Mesh(v,f)).frustumCulled=!1,y.renderOrder=o.MxData.iCADMeshRenderOrder,e.add(y),this._entitys.push(y);var g=new i.RawShaderMaterial({uniforms:{color:{value:this._color}},vertexShader:r.MxShader.VSHADER_COLOR_POINT,fragmentShader:r.MxShader.FSHADER_COLOR_POINT,transparent:!0,side:i.DoubleSide});for(m=0;m<this._geometryMeshPositionsByLayer.length;m++){var v,y;(v=new i.InstancedBufferGeometry).maxInstancedCount=t.length,v.setAttribute("position",new i.Float32BufferAttribute(this._geometryMeshPositionsByLayer[m],2)),v.setAttribute("tran1",new i.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new i.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new i.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new i.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new i.InstancedBufferAttribute(new Float32Array(c),1)),(y=new i.Mesh(v,g)).frustumCulled=!1,y.renderOrder=o.MxData.iCADMeshRenderOrder,e.add(y),this._entitys.push(y)}}},y.prototype.addGeometryCurve=function(t,e,n,i,r){0<t.length&&(this._geometryCurvePostion.push(t),this._geometryCurveColor.push(e)),0<n.length&&this._geometryCurvePositionsByBlock.push(n),0<i.length&&this._geometryCurvePositionsByLayer.push(i),0<r.length&&this._geometryCurvePositionsByBlock_ZeroLayer.push(r)},y.prototype.addGeometryMesh=function(t,e,n,i,r){0<t.length&&(this._geometryMeshPostion.push(t),this._geometryMeshColor.push(e)),0<n.length&&this._geometryMeshPositionsByBlock.push(n),0<i.length&&this._geometryMeshPositionsByLayer.push(i),0<r.length&&this._geometryMeshPositionsByBlock_ZeroLayer.push(r)},y.prototype.addGeometryTexture=function(t,e,n,i,r,a,o){var s=new g;s.pos=t,s.textureCoord=e,s.color=n,s.sFileName=i,s.dAngel=r,s.ptRotationPostionX=a,s.ptRotationPostionY=o,this._TextureData.push(s)},y.prototype.addMemorySections=function(t){this._MemorySections.push(t)},y.prototype.createThreejsObj=function(t,e,n,i,r){var a=n.getScene(),o=n.getCanvas();if(0!=t.length){if(null==this._color){var s=i.getColor(r);this._color=[],this._color.push((255&s)/255,(s>>8&255)/255,(s>>16&255)/255),this._colorValue=16777215&s}0==this._geometryCurvePostion.length&&0==this._geometryCurvePositionsByBlock.length&&0==this._geometryCurvePositionsByLayer.length&&0==this._geometryCurvePositionsByBlock_ZeroLayer.length||this.createThreejsObjForCurve(t,a),0==this._geometryMeshPostion.length&&0==this._geometryMeshPositionsByBlock.length&&0==this._geometryMeshPositionsByLayer.length&&0==this._geometryMeshPositionsByBlock_ZeroLayer.length||this.createThreejsObjForMesh(t,a),0!=this._TextureData.length&&this.createThreejsObjForTexture(t,a,n),0!=this._MemorySections.length&&this.createThreejsObjForMemorySections(t,a,n)}0!=e.size&&(null==this._color&&(s=i.getColor(r),this._color=[],this._color.push((255&s)/255,(s>>8&255)/255,(s>>16&255)/255),this._colorValue=16777215&s),0==this._geometryCurvePostion.length&&0==this._geometryCurvePositionsByBlock.length&&0==this._geometryCurvePositionsByLayer.length&&0==this._geometryCurvePositionsByBlock_ZeroLayer.length||this.createThreejsObjForCurve_Clip(e,a,o),0==this._geometryMeshPostion.length&&0==this._geometryMeshPositionsByBlock.length&&0==this._geometryMeshPositionsByLayer.length&&0==this._geometryMeshPositionsByBlock_ZeroLayer.length||this.createThreejsObjForMesh_Clip(e,a,o),0!=this._TextureData.length&&this.createThreejsObjForTexture_Clip(e,a,n),0!=this._MemorySections.length&&this.createThreejsObjForMemorySections_clip(e,a,n)),this._geometryCurvePostion=[],this._geometryCurvePositionsByBlock=[],this._geometryCurvePositionsByLayer=[],this._geometryCurvePositionsByBlock_ZeroLayer=[],this._geometryCurveColor=[],this._geometryMeshPostion=[],this._geometryMeshPositionsByBlock=[],this._geometryMeshPositionsByLayer=[],this._geometryMeshPositionsByBlock_ZeroLayer=[],this._geometryMeshColor=[],this._TextureData=[],this._MemorySections=[]},y);function y(t){this._blockRecId=0,this._TextureData=[],this._MemorySections=[],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._colorValue=16777215,this._material_clip=[],this._blockRecId=t}n.Layer=v;var x=(b.prototype.showLayer=function(t,e){var n=this._layerTogeometry.get(t);null!=n&&n.Show(e)},b.prototype.updataClipMaterial=function(t){var e=t.getCanvas();this._layerTogeometry.forEach(function(t,n,i){t.updataClipMaterial(e)})},b.prototype.getId=function(){return this._id},b.prototype.getBlkRef=function(){return this._blkRef},b.prototype.createThreejsObj=function(t,e){var n=this;this._layerTogeometry.forEach(function(i,r,a){i.createThreejsObj(n._instance,n._instance_clip,t,e,r)})},b.prototype.addGeometryCurve=function(t,e,n,i,r,a){var o=this._layerTogeometry.get(n);null==o&&(o=new v(this._id),this._layerTogeometry.set(n,o)),o.addGeometryCurve(t,e,i,r,a)},b.prototype.addMemorySections=function(t){var e=this._layerTogeometry.get(t.layerId);null==e&&(e=new v(this._id),this._layerTogeometry.set(t.layerId,e)),e.addMemorySections(t)},b.prototype.addGeometryTexture=function(t,e,n,i,r,a,o,s){var l=this._layerTogeometry.get(i);null==l&&(l=new v(this._id),this._layerTogeometry.set(i,l)),l.addGeometryTexture(t,e,n,r,a,o,s)},b.prototype.addGeometryMesh=function(t,e,n,i,r,a){var o=this._layerTogeometry.get(n);null==o&&(o=new v(this._id),this._layerTogeometry.set(n,o)),o.addGeometryMesh(t,e,i,r,a)},b.prototype.addInstance=function(t){var e;t.clipPlans.ver<=3?0==t.clipPlans.clipPlanArray.length?this._instance.push(t):(null==(e=this._instance_clip.get(t.clipPlans.id))&&(e=[],this._instance_clip.set(t.clipPlans.id,e)),e.push(t)):0==t.clipPlans.instansClipePoints.length||100<this._instance_clip.size?this._instance.push(t):(null==(e=this._instance_clip.get(t.clipPlans.id))&&(e=[],this._instance_clip.set(t.clipPlans.id,e)),e.push(t))},b.prototype.addBlkRef=function(t){this._blkRef.push(t)},b);function b(t){this._id=0,this._layerTogeometry=new Map,this._blkRef=[],this._instance=[],this._instance_clip=new Map,this._id=t}n.Block=x;var w=(M.prototype.crateBlock=function(t){var e=this._mapBlock.get(t);return null==e&&(e=new x(t),this._mapBlock.set(t,e)),e},M.prototype.getBlock=function(t){return this._mapBlock.get(t)},M.prototype.addBlockRef=function(t){this.crateBlock(t.blkOwnerId).addBlkRef(t)},M.prototype.showLayer=function(t,e){this._mapBlock.forEach(function(t,e){var n=t,i=e;return function(t,e,r){t.showLayer(n,i)}}.call(this,t,e))},M.prototype.createBlocks_30=function(t,e){if(!this._isCreate){this.crateBlock(0);for(var n=1,r=t.getInt32(12,!0),a=80,o=0;o<r;o++){var s=t.getInt32(a,!0);a+=4;var l=t.getInt32(a,!0);a+=4;var c=t.getInt32(a,!0);a+=4;var d=t.getInt32(a,!0);a+=4;for(var f=new Array,m=0;m<16;m++){var g=t.getFloat32(a,!0);a+=4,f.push(g)}var v=t.getInt32(a,!0);a+=4;var y=new h;y.id=n,y.ver=3,n++,y.clipPlanArray=[];for(var x=0;x<v;x++){var b=t.getFloat32(a,!0);a+=4;var w=t.getFloat32(a,!0);a+=4;var M=t.getFloat32(a,!0);a+=4;var _=t.getFloat32(a,!0);a+=4;var S=new u;S.x1=b,S.y1=w,S.x2=M,S.y2=_,y.clipPlanArray.push(S)}var C=new p;C.ver=3,C.mat=new i.Matrix4,C.mat.fromArray(f),C.blkRecId=c,C.blkOwnerId=s,C.layerId=l,C.color=d,C.clipPlans=y,this.crateBlock(c),this.addBlockRef(C)}this._isGetAllBlocks=!0,this._isCreate=!0}},M.prototype.createBlocks_40=function(t,e){if(!this._isCreate){this.crateBlock(0);for(var n=1,r=t.getInt32(12,!0),a=80,o=0;o<r;o++){var s=t.getInt32(a,!0);a+=4;var l=t.getInt32(a,!0);a+=4;var c=t.getInt32(a,!0);a+=4;var u=t.getInt32(a,!0);a+=4;for(var d=new Array,f=0;f<16;f++){var m=t.getFloat32(a,!0);a+=4,d.push(m)}var g=t.getInt32(a,!0);a+=4;var v=new h;v.id=n,v.ver=4,n++,v.clipPoints=[];for(var y=0;y<g;y++){var x=new i.Vector2;x.x=t.getFloat32(a,!0),a+=4,x.y=t.getFloat32(a,!0),a+=4,v.clipPoints.push(x)}var b=new p;b.ver=4,b.mat=new i.Matrix4,b.mat.fromArray(d),b.blkRecId=c,b.blkOwnerId=s,b.layerId=l,b.color=u,b.clipPlans=v,this.crateBlock(c),this.addBlockRef(b)}this._isGetAllBlocks=!0,this._isCreate=!0}},M.prototype.createBlocks=function(t,e){this._isCreate||(new s.MxNetData(t).getVersion_MwBlobHead()<=3?this.createBlocks_30(t,e):this.createBlocks_40(t,e))},M.prototype.updataClipMaterial=function(t){this._mapBlock.forEach(function(e,n,i){e.updataClipMaterial(t)})},M.prototype.createAllInstance=function(t){var e=this.getBlock(0);if(null==e)return!1;if(null==this._rootBlockRef)return!1;var n=new i.Matrix4,r=new Map,a=new h;return this._iClipIdCount=1,a.id=this._iClipIdCount,this._iClipIdCount++,this.createAllInstanceCall(e,this._rootBlockRef,n,r,16777215,t,void 0,a),!0},M.prototype.createThreejsObj=function(t,e,n){null==this._mapNeedCreateThreejsObj.get(t.getId())&&this._mapNeedCreateThreejsObj.set(t.getId(),t),this._isCreateAllInstance||this._isGetAllBlocks&&n.isInitComplete()&&(this._isCreateAllInstance=this.createAllInstance(n)),this._isCreateAllInstance&&(this._mapNeedCreateThreejsObj.forEach(function(t,i,r){t.createThreejsObj(e,n)}),this._mapNeedCreateThreejsObj.clear())},M.prototype.createAllInstanceCall=function(t,e,n,r,a,o,s,l){if(1!=r[t.getId()]){r[t.getId()]=!0;var c=new d;if(c.mat=new i.Matrix4,c.mat.copy(n),c.mat.multiply(e.mat),e.ver<=3)if(0==e.clipPlans.clipPlanArray.length)c.clipPlans=l;else{c.clipPlans=e.clipPlans,c.clipPlans.ver=3;for(var u,p,f,m,g=c.clipPlans.clipPlanArray.length,v=function(){u=new i.Vector3(c.clipPlans.clipPlanArray[y].x1,c.clipPlans.clipPlanArray[y].y1,0),p=new i.Vector3(c.clipPlans.clipPlanArray[y].x2,c.clipPlans.clipPlanArray[y].y2,0),f=new i.Vector3(c.clipPlans.clipPlanArray[y].x1,c.clipPlans.clipPlanArray[y].y2,0),m=new i.Vector3(c.clipPlans.clipPlanArray[y].x2,c.clipPlans.clipPlanArray[y].y1,0),u.applyMatrix4(c.mat),p.applyMatrix4(c.mat),f.applyMatrix4(c.mat),m.applyMatrix4(c.mat);var t=u.x,e=u.x,n=u.y,r=u.y,a=[];a.push(p),a.push(f),a.push(m),a.forEach(function(i){t>i.x&&(t=i.x),e<i.x&&(e=i.x),n>i.y&&(n=i.y),r<i.y&&(r=i.y)}),c.clipPlans.clipPlanArray[y].x1=t,c.clipPlans.clipPlanArray[y].y1=n,c.clipPlans.clipPlanArray[y].x2=e,c.clipPlans.clipPlanArray[y].y2=r},y=0;y<g;y++)v()}else if(0==e.clipPlans.clipPoints.length)c.clipPlans=l;else{c.clipPlans=new h,c.clipPlans.ver=4,c.clipPlans.id=this._iClipIdCount,this._iClipIdCount++,c.clipPlans.instansClipePoints=l.instansClipePoints.slice(0);var x=[],b=e.clipPlans.clipPoints;for(g=b.length,y=0;y<g;y++){var w=new i.Vector3(b[y].x,b[y].y,0);w.applyMatrix4(c.mat),x.push(new i.Vector2(w.x,w.y))}c.clipPlans.instansClipePoints.push(x)}null==s?c.topLayerColor.push(1,1,1):c.topLayerColor.push(s[0],s[1],s[2]);var M=e.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 _=o.getColor(e.layerId);c.color.push((255&_)/255,(_>>8&255)/255,(_>>16&255)/255),a=_}else c.color.push((255&e.color)/255,(e.color>>8&255)/255,(e.color>>16&255)/255),a=e.color;t.addInstance(c);for(var S=t.getBlkRef(),C=null==s,T=0;T<S.length;T++)if(0!=S[T].blkRecId){var E=this.getBlock(S[T].blkRecId);if(null==E)return;C&&(s=[],_=o.getColor(S[T].layerId),s.push((255&_)/255,(_>>8&255)/255,(_>>16&255)/255)),this.createAllInstanceCall(E,S[T],c.mat,r,a,o,s,c.clipPlans)}r[t.getId()]=!1}},M.prototype.initRootBlockRef=function(t){null==t&&((t=new p).mat=new i.Matrix4,t.blkRecId=0,t.blkOwnerId=-1,t.layerId=-1,t.color=16777215),this._rootBlockRef=t},M);function M(){this._mapBlock=new Map,this._mapNeedCreateThreejsObj=new Map,this._isCreate=!1,this._isGetAllBlocks=!1,this._isCreateAllInstance=!1,this._rootBlockRef=void 0,this._iClipIdCount=1}n.Blocks=w;var _=function(){this.blocks=new w,this.layers=new a.MxBrowseLayerData};n.ExternalReferenceDatabase=_;var S=(C.prototype.createTzDwgExternalReferences=function(t){this._mapId2ExternalDatabase.get(t)||this.getBlocks(t).initRootBlockRef()},C.prototype.createExternalReferences=function(t){for(var e=t.getInt32(12,!0),n=80,r=0;r<e;r++){for(var a=new Array,o=0;o<16;o++){var s=t.getFloat32(n,!0);n+=4,a.push(s)}var l=t.getInt32(n,!0);n+=4;var c=t.getInt32(n,!0);if(n+=4,t.getInt32(n,!0),n+=4,0!=l){var u=this.getBlocks(l),h=new p;h.mat=new i.Matrix4,h.mat.fromArray(a),h.blkRecId=0,h.blkOwnerId=-1,h.layerId=-1,h.color=c,u.initRootBlockRef(h)}else console.log("mx error iDatabaseIndex")}},C.prototype.getBlocks=function(t){if(0!=t){var e=this._mapId2ExternalDatabase.get(t);return null==e&&(e=new _,this._mapId2ExternalDatabase.set(t,e)),e.blocks}console.log("mx error iDatabaseIndex")},C.prototype.getLayers=function(t){if(0!=t){var e=this._mapId2ExternalDatabase.get(t);return null==e&&(e=new _,this._mapId2ExternalDatabase.set(t,e)),e.layers}console.log("mx error iDatabaseIndex")},C);function C(){this._mapId2ExternalDatabase=new Map}n.ExternalReferenceManager=S},{"../MxFun":34,"../MxManager":36,"../MxNetData":38,"../MxShader":40,"../MxStencilObject":41,"./MxBrowseLayerData":69,three:19}],69:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxBrowseLayerData=void 0;var i=(r.prototype.add=function(t,e,n){this._layerColor[t]=e,this._nametoId[n]=t},r.prototype.setZeroLayerId=function(t){this._zeroLayerId=t},r.prototype.getZeroLayerId=function(){return this._zeroLayerId},r.prototype.getLayerIdForName=function(t){return null==this._nametoId[t]?0:this._nametoId[t]},r.prototype.getColor=function(t){return null==this._layerColor[t]?16777215:this._layerColor[t]},r.prototype.initComplete=function(){this._isSetInstanceComplete=!0},r.prototype.isInitComplete=function(){return this._isSetInstanceComplete},r);function r(){this._isSetInstanceComplete=!1,this._layerColor=new Map,this._nametoId=new Map,this._zeroLayerId=0}n.MxBrowseLayerData=i},{}],70:[function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n=n||Promise)(function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):((e=t.value)instanceof n?e:new n(function(t){t(e)})).then(o,s)}l((i=i.apply(t,e||[])).next())})},r=this&&this.__generator||function(t,e){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&s[a=0]&&(o=0),o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=0<(r=o.trys).length&&r[r.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbDatabase=void 0;var a=t("three"),o=t("../MxFun"),s=t("./MxDbEntity"),l=t("./MxDbEntityGrip"),c=t("./MxDbEntitySelect"),u=t("../MxManager"),h=t("../MxType"),p=t("./MxDbLayerTable"),d=t("./MxDbGroup"),f=t("../MxDrawData"),m=t("../MxTools"),g=(v.prototype.getAllEntity=function(){return this.mapIdToEntity},v.prototype.getGroupDictionary=function(){return this.groupDictionary},v.prototype.upDirtyDisplay=function(){var t=!1;return this.mapIdToEntity.forEach(function(e){e.getDirtyDisplay()&&(e.upDisplay(),e.setDirtyDisplay(!1),t=!0)}),t},v.prototype.onViewChange=function(){var t=!1;return this.mapIdToEntity.forEach(function(e){e.onViewChange()&&(t=!0)}),t},v.prototype.toJsonObject=function(t){var e={ver:1},n=new a.Vector3(0,0,0),i=new a.Vector3(this.mxObj.getViewWidth(),this.mxObj.getViewHeight(),0),r=h.MxType.MxCloneType.kMxFileClone;t&&(r=h.MxType.MxCloneType.kSaveDwgClone),e.correctLargeCoordinates=f.MxDrawData.m_isCorrectLargeCoordinates,f.MxDrawData.m_isCorrectLargeCoordinates&&(e.matDoc2Cad=this.mxObj.getDoc2CADMatrix());var o=this.mxObj.screenCoord2Doc(n.x,n.y,0),s=this.mxObj.screenCoord2Doc(i.x,i.y,0);e.view={ptView1:o,ptView2:s};var l=[];return this.mapNameToLayer.forEach(function(t){var e={type:r};t.dwgOut(e),e.TypeName="MxDbLayerTableRecord",l.push(e)}),e.layers=l,this.groupDictionary.dwgOut(e),e},v.prototype.saveJson=function(t){var e=this,n=this.toJsonObject(t),i=h.MxType.MxCloneType.kMxFileClone;t&&(i=h.MxType.MxCloneType.kSaveDwgClone);var r=[];return this.mapIdToEntity.forEach(function(t){var n=t.getUserObject(),a={type:i};n.dwgOut(a),a.TypeName=n.getTypeName(),a.group=e.groupDictionary.getEntityInGroupName(t.objectId()),r.push(a)}),n.entitys=r,n},v.prototype.reInit=function(){this.eraseAllEntity(),this.initLayerTable(),this.groupDictionary=new d.MxDbGroupDictionary},v.prototype.loadJson=function(t){return i(this,void 0,void 0,function(){var e,n,i,a,o,l,c,h,p,d,f=this;return r(this,function(m){switch(m.label){case 0:if(this.reInit(),(e=t).view&&(n=e.view,this.mxObj.zoomW(n.ptView1,n.ptView2,!1)),i=e.layers)for(a=i.length,d=0;d<a;d++)o=i[d],this.addLayer(o.name).dwgIn(o);this.groupDictionary.dwgIn(e),l=e.entitys,c=l.length,h=function(t){var e,n,i,a;return r(this,function(r){switch(r.label){case 0:return e=l[t],[4,u.MxManager.getMxDbEntityClassHierarchy().createMxEntity(e.TypeName)];case 1:return(n=r.sent())?(n.dwgIn(e),(i=new s.MxDbEntity).initUserObject(n),p.addEntityImp(i),(a=e.group)&&0<a.length&&a.forEach(function(t){f.groupDictionary.add(t).append(i.objectId())}),[2]):[2,"continue"]}})},p=this,d=0,m.label=1;case 1:return d<c?[5,h(d)]:[3,4];case 2:m.sent(),m.label=3;case 3:return d++,[3,1];case 4:return[2,new Promise(function(t){t(!0)})]}})})},v.prototype.getMxObject=function(){return this.mxObj},v.prototype.getGripManager=function(){return this.gripManager},v.prototype.getSelectManager=function(){return this.selectManager},v.prototype.clearMxCurrentSelect=function(){var t=!1;return this.gripManager.removeAllGrips()&&(t=!0),this.selectManager.removeAllEntity()&&(t=!0),t},v.prototype.eraseAllEntity=function(){this.mapIdToEntity.forEach(function(t){t.clearDisplayImp()}),this.mapIdToEntity=new Map,this.clearMxCurrentSelect()},v.prototype.intiDoc2Wold=function(t){this.parentObject.matrix=t,this.parentObject.matrixAutoUpdate=!1},v.prototype.initLayerTable=function(){this.mapNameToLayer=new Map,this.curLayer="0";var t=new p.MxDbLayerTableRecord;t.init(this.curLayer,this.parentObject),this.mapNameToLayer.set(this.curLayer,t)},v.prototype.init=function(t){this.mxObj=t,this.scene=t.getScene(),o.MxFun.removeThreejsObject(this.parentObject,this.scene),this.parentObject=new a.Object3D,this.parentObject.renderOrder=u.MxData.iMxEntityRenderOrder,this.scene.add(this.parentObject),this.initLayerTable()},v.prototype.getEntity=function(t){return this.mapIdToEntity.get(t)},v.prototype.isValidId=function(t){return this.mapIdToEntity.has(t)},v.prototype.setRenderOrder=function(t){var e=this.parentObject.renderOrder;return this.parentObject.renderOrder=t,e},v.prototype.eraseEntity=function(t){this.gripManager.deleteGripData(t),this.selectManager.deleteSelect(t),this.mapIdToEntity.delete(t)},v.prototype.showLayer=function(t,e){var n=this.getLayer(t);n&&n.setVisible(e)},v.prototype.setCurrentLayer=function(t){if(0!=t.length)return this.curLayer=t,this.addLayer(t)},v.prototype.addLayer=function(t){var e=this.mapNameToLayer.get(t);return e||((e=new p.MxDbLayerTableRecord).init(t,this.parentObject),this.mapNameToLayer.set(t,e),e)},v.prototype.getLayer=function(t){return this.mapNameToLayer.get(t)},v.prototype.addMxEntity=function(t){if(t.getImp())return t.objectId();var e=new s.MxDbEntity;return e.initUserObject(t),t.initGuid(m.MxTools.generateUUID()),this.addEntityImp(e)},v.prototype.addEntityImp=function(t){return this.mapIdToEntity.set(this.idCount,t),t.setMxDatabase(this),t.setObjectId(this.idCount),0==t.getLayer().length&&t.setLayer(this.curLayer),t.upDisplay(),this.idCount++},v.prototype.getThreeJSParentObject=function(){return this.parentObject},v.prototype.getIntersectObjects=function(t){var e=new a.Raycaster;e.linePrecision=this.mxObj.screenCoordLong2Doc(10);var n=this.mxObj.getCanvas(),i=n.clientWidth,r=n.clientHeight,o=new a.Vector2(t.x/i*2-1,-t.y/r*2+1);return e.setFromCamera(o,this.mxObj.getCamera()),e.intersectObjects(this.parentObject.children,!0)},v);function v(){this.mapIdToEntity=new Map,this.mxObj=null,this.scene=null,this.idCount=1,this.parentObject=null,this.mapNameToLayer=new Map,this.curLayer="0",this.gripManager=new l.MxDbEntityGrip(this),this.selectManager=new c.MxDbEntitySelect(this),this.groupDictionary=new d.MxDbGroupDictionary}n.MxDbDatabase=g},{"../MxDrawData":29,"../MxFun":34,"../MxManager":36,"../MxTools":45,"../MxType":46,"./MxDbEntity":71,"./MxDbEntityGrip":72,"./MxDbEntitySelect":73,"./MxDbGroup":74,"./MxDbLayerTable":75,three:19}],71:[function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n=n||Promise)(function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):((e=t.value)instanceof n?e:new n(function(t){t(e)})).then(o,s)}l((i=i.apply(t,e||[])).next())})},r=this&&this.__generator||function(t,e){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&s[a=0]&&(o=0),o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=0<(r=o.trys).length&&r[r.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbEntity=n.MxDbEntityClassHierarchy=n.MxDbEntityUserObject=void 0;var a=t("three"),o=t("../Operate/McGiWorldDraw"),s=t("../MxManager"),l=t("../MxTools"),c=t("../MxType"),u=(h.prototype.getClosestPointTo=function(t,e){return void 0===e&&(e=0),null},h.prototype.getTypeName=function(){return""},h.prototype.initGuid=function(t){0<this.sGuid.length?console.log("mx: init guid error"):this.sGuid=t},h.prototype.guid=function(){return this.sGuid},h.prototype.setLayer=function(t){var e=this.getImp();e&&e.nodifySetLayer(),this.layer=t},h.prototype.getLayer=function(){return this.layer},h.prototype.setDash=function(t,e){this.dDashArray=t,this.dDashRatio=e,0==this.dLineWidth&&(this.dLineWidth=6,this.lineWidthByPixels=!0)},h.prototype.getDash=function(){return{dDashArray:this.dDashArray,dDashRatio:this.dDashRatio}},h.prototype.setDashLineDisplay=function(t){t?(this.dDashArray=.03,this.dDashRatio=.1,0==this.dLineWidth&&(this.dLineWidth=6,this.lineWidthByPixels=!0)):(this.dDashArray=0,this.dDashRatio=0)},h.prototype.isDashLineDisplay=function(){return 0<this.dDashArray&&0<this.dDashRatio},h.prototype.setLineWidthByPixels=function(t){this.lineWidthByPixels=t},h.prototype.getLineWidthByPixels=function(){return this.lineWidthByPixels},h.prototype.setLineWidth=function(t){this.dLineWidth=t},h.prototype.getLineWidth=function(){return this.dLineWidth},h.prototype.getMxObject=function(){var t=this.getImp();return t?t.getMxObject():null},h.prototype.onViewChange=function(){return!1},h.prototype.getImp=function(){return this.MxDbEntityImp},h.prototype.upDisplay=function(){var t=this.getImp();return!!t&&t.upDisplay()},h.prototype.erase=function(){var t=this.getImp();return!!t&&t.erase()},h.prototype.setColor=function(t){this.iColor=t},h.prototype.getColor=function(){return this.iColor},h.prototype.setRenderOrder=function(t){this.iRenderOrder=t},h.prototype.getRenderOrder=function(){return this.iRenderOrder},h.prototype.onEndGripEidt=function(){},h.prototype.onStartGripEidt=function(){},h.prototype.dwgIn=function(t){return this.iColor=t.iColor,this.iRenderOrder=t.iRenderOrder,this.opacity=t.opacity,this.visible=t.visible,this.dLineWidth=t.lineWidth,this.lineWidthByPixels=t.lineWidthByPixels,this.dDashArray=t.dashArray,this.dDashRatio=t.dashRatio,this.layer=t.layer,t.guid&&(this.sGuid=t.guid),!0},h.prototype.dwgOut=function(t){return t.iColor=this.iColor,t.iRenderOrder=this.iRenderOrder,t.opacity=this.opacity,t.visible=this.visible,t.lineWidth=this.dLineWidth,t.lineWidthByPixels=this.lineWidthByPixels,t.dashArray=this.dDashArray,t.dashRatio=this.dDashRatio,t.layer=this.layer,t.guid=this.sGuid,t},h.prototype.clone=function(t){var e=this.create(),n={type:t||c.MxType.MxCloneType.kClone};return this.dwgOut(n),e.dwgIn(n),e.sGuid="",e},h.prototype.init=function(){s.MxManager.getMxDbEntityClassHierarchy().init(this)},h.prototype.transformBy=function(t){},h.prototype.objectId=function(){var t=this.getImp();return t?t.objectId():0},h);function h(){this.iColor=16777215,this.iRenderOrder=s.MxData.iMxEntityRenderOrder,this.opacity=1,this.visible=!0,this.dLineWidth=0,this.lineWidthByPixels=!0,this.dDashArray=0,this.dDashRatio=0,this.layer="",this.sGuid=""}n.MxDbEntityUserObject=u;var p=(d.prototype.init=function(t){var e=t.getTypeName();this.mapType2Create.get(e)&&console.log("MxError:already has this class name "+e),this.mapType2Create.set(e,{type:0,createfun:t})},d.prototype.initDynamic=function(t){this.dynmaicCreate=t},d.prototype.createMxEntity=function(t){return i(this,void 0,void 0,function(){var e,n;return r(this,function(i){switch(i.label){case 0:return(e=this.mapType2Create.get(t))?[3,3]:this.dynmaicCreate?[4,this.dynmaicCreate(t)]:[3,2];case 1:return(n=i.sent())?(this.mapType2Create.set(t,{type:1,createfun:n}),[2,new Promise(function(t,e){t(new n)})]):[2,new Promise(function(t,e){t(null)})];case 2:return[2,new Promise(function(t,e){t(null)})];case 3:return 0==e.type?[2,new Promise(function(t,n){t(e.createfun.create())})]:1==e.type?[2,new Promise(function(t,n){t(new e.createfun)})]:[2,new Promise(function(t,e){t(null)})]}})})},d);function d(){this.mapType2Create=new Map,this.dynmaicCreate=null}n.MxDbEntityClassHierarchy=p;var f=(m.prototype.setObjectId=function(t){this.id=t},m.prototype.nodifySetLayer=function(){this.layerObjectGroup&&this.clearDisplayImp()},m.prototype.setLayer=function(t){this.userObject.setLayer(t)},m.prototype.getLayer=function(){return this.userObject.getLayer()},m.prototype.setDirtyDisplay=function(t){this.isDirtyDisplay=t},m.prototype.getDirtyDisplay=function(){return this.isDirtyDisplay},m.prototype.setMxDatabase=function(t){this.mxDatabase=t},m.prototype.objectId=function(){return this.id},m.prototype.initUserObject=function(t){(this.userObject=t).MxDbEntityImp=this},m.prototype.upDisplay=function(){if(!this.mxDatabase)return console.log("mxassert(0) this.mxDatabase is null"),!1;this.updateDisplayImp(this.mxDatabase.getMxObject())},m.prototype.erase=function(){if(0==this.id)return!1;this.clearDisplayImp(),this.userObject=null,this.mxDatabase.eraseEntity(this.id),this.id=0,this.mxDatabase=null},m.prototype.clearDisplayImp=function(){this.layerObjectGroup&&(this.threeObjectGroup&&(this.threeObjectGroup.traverse(function(t){"Mesh"===t.type&&(t.geometry.dispose(),t.material.dispose())}),this.layerObjectGroup.remove(this.threeObjectGroup)),this.threeObjectGroup=null,this.layerObjectGroup=null)},m.prototype.updateDisplayImp=function(t){if(this.clearDisplayImp(),this.userObject){if(this.userObject.visible){var e=this.mxDatabase.addLayer(this.userObject.getLayer());if(!e)return console.log("mxassert(0) this.layerRecord is null"),!1;this.threeObjectGroup=new a.Object3D;var n=new o.McGiWorldDraw(t,o.McGiWorldDrawType.kWorldDraw);n.setupForEntity(this.userObject),this.worldDraw(n);for(var i=n.getEntitys(),r=i.length,s=0;s<r;s++){var c=i[s];(c.MxDbEntity=this).threeObjectGroup.add(c)}this.layerObjectGroup=e.getGroup(),this.layerObjectGroup.add(this.threeObjectGroup)}}else l.MxTools.MxASSERT(!1,"this.userObject == null")},m.prototype.worldDraw=function(t){this.userObject.worldDraw(t)},m.prototype.getGripPoints=function(){return this.userObject.getGripPoints()},m.prototype.getClosestPointTo=function(t,e){return this.userObject.getClosestPointTo(t,e)},m.prototype.getUserObject=function(){return this.userObject},m.prototype.clone=function(t){var e=new m;return e.initUserObject(this.userObject.clone(t)),e},m.prototype.transformBy=function(t){this.userObject.transformBy(t)},m.prototype.setColor=function(t){this.userObject.setColor(t)},m.prototype.onEndGripEidt=function(){this.userObject.onEndGripEidt()},m.prototype.onStartGripEidt=function(){return this.userObject.onStartGripEidt()},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.layerObjectGroup=null,this.id=0}n.MxDbEntity=f},{"../MxManager":36,"../MxTools":45,"../MxType":46,"../Operate/McGiWorldDraw":50,three:19}],72:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbEntityGrip=n.MxDbEntityGripJig=n.MxGetWordDrawxDataForThreeJsObject=n.MxGetMxDbEntitForThreeJsObject=n.MxDbEntityGripData=void 0;var a=t("three"),o=t("../MxFun"),s=t("../MxDrawData"),l=t("../Operate/MxJig"),c=t("../Operate/MxJigCmdManager"),u=t("../Operate/McGiWorldDraw"),h=t("../MxManager"),p=t("../MxType"),d=function(){this.threeObject=null};function f(t){for(var e=null;t&&!(e=t.MxDbEntity)&&t.parent;)t=t.parent;return e}n.MxDbEntityGripData=d,n.MxGetMxDbEntitForThreeJsObject=f,n.MxGetWordDrawxDataForThreeJsObject=function(t){for(var e=null;t&&!(e=t.MxWordDrawXData)&&t.parent;)t=t.parent;return e};var m,g=(r(v,m=l.McEdJigCommand),v.prototype.sampler=function(){var t=c.MxJigCmdManager.InType.kGetBegan|c.MxJigCmdManager.InType.kGetEnd,e=this.acquirePoint(t);return e.status==c.MxJigCmdManager.DragStatus.kNormal&&(this.currPt=e.pt),e.status},v.prototype.getTypeName=function(){return"MxGripEdit"},v.prototype.onStartCommand=function(){this.iscallOnStartCommand=!0,m.prototype.onStartCommand.call(this)},v.prototype.done=function(t){if(t==c.MxJigCmdManager.DragStatus.kNormal){var e=this.currPt.clone();e.sub(this.dragBasePt);for(var n=this.getMxObject(),i=n.getMxDatabase(),r=n.getMxDatabase().getGripManager(),a=this.grips.length,o=new Set,s=[],l=0;l<a;l++){var u=this.grips[l],h=this.ents[l];r.deleteGripData(h.objectId()),h.getUserObject().moveGripPointsAt(u.iIndex,e),r.addGripFromEntity(h),h.upDisplay(),o.add(h.objectId());var p={id:h.objectId(),index:u.iIndex,curentPoint:this.currPt};s.push(p)}n.updateDisplay(),0<s.length&&n.callEvent("objectGripEdit",s),i.getSelectManager().upSelectDilsplay(o)}var d=this.ents.length;for(l=0;l<d;l++)(h=this.ents[l]).onEndGripEidt(),t!=c.MxJigCmdManager.DragStatus.kNormal&&h.upDisplay();return c.MxJigCmdManager.DoneStatius.kExitCommand},v.prototype.upDisplay=function(){var t=this.currPt.clone();if(t.sub(this.dragBasePt),!(t.length()<.001)){if(this.iscallOnStartCommand){for(var e=this.ents.length,n=0;n<e;n++){var i=this.ents[n];this.aryParam.push(i.onStartGripEidt())}this.iscallOnStartCommand=!1}var r=this.getMxObject(),a=this.grips.length;for(n=0;n<a;n++){var o=this.grips[n],s=(i=this.ents[n],this.aryParam[n]),l=i.clone(p.MxType.MxCloneType.kDragClone);l.getUserObject().moveGripPointsAt(o.iIndex,t);var c=new u.McGiWorldDraw(r,u.McGiWorldDrawType.kDynDragDraw);c.setupForEntity(l.getUserObject()),l.worldDraw(c);var h=c.getEntitys(),d=h.length,f=31;s&&s.renderOrder&&(f=s.renderOrder);for(var m=0;m<d;m++)this.drawEntity(h[m],f)}}},v);function v(t,e,n){var i=m.call(this)||this;return i.aryParam=[],i.iscallOnStartCommand=!0,i.dragBasePt=t,i.grips=e,i.ents=n,i.currPt=t,i.iscallOnStartCommand=!0,i}n.MxDbEntityGripJig=g;var y=(x.prototype.getAllSelect=function(){var t=[];return this.mapGrips.forEach(function(e,n){t.push(n)}),t},x.prototype.getParentGroup=function(){return this.drawGroup||(this.drawGroup=new a.Group,this.drawGroup.renderOrder=h.MxData.iGripRenderOrder,this.database.getMxObject().getTheTempDrawContainer().add(this.drawGroup)),this.drawGroup},x.prototype.removeAllGrips=function(){if(0==this.mapGrips.size)return!1;this.database.getMxObject();var t=this.getParentGroup();return this.mapGrips.forEach(function(e,n,i){for(var r=e.length,a=0;a<r;a++){var s=e[a];o.MxFun.removeThreejsObject(s.threeObject,t)}}),this.mapGrips=new Map,!0},x.prototype.deleteGripData=function(t){var e=this.getParentGroup(),n=this.mapGrips.get(t);if(n)for(var i=n.length,r=0;r<i;r++){var a=n[r];o.MxFun.removeThreejsObject(a.threeObject,e)}this.mapGrips.delete(t)},x.prototype.createGripDisplayObject=function(t){var e=this.database.getMxObject(),n=this.getParentGroup();t.geometry=new a.Geometry;var i=e.screenCoordLong2Doc(s.MxDrawData.m_dGridWidth/2);t.geometry.vertices.push(new a.Vector3(t.point.x-i,t.point.y-i,0)),t.geometry.vertices.push(new a.Vector3(t.point.x-i,t.point.y+i,0)),t.geometry.vertices.push(new a.Vector3(t.point.x+i,t.point.y+i,0)),t.geometry.vertices.push(new a.Vector3(t.point.x+i,t.point.y-i,0)),t.geometry.faces.push(new a.Face3(0,1,2)),t.geometry.faces.push(new a.Face3(2,3,0)),t.geometry.computeFaceNormals(),t.geometry.computeVertexNormals();var r=new a.MeshBasicMaterial({color:255,transparent:!0,depthTest:!1,side:a.DoubleSide,opacity:.9}),o=new a.Mesh(t.geometry,r);n.add(o),t.threeObject=o},x.prototype.addGripData=function(t,e,n){var i=this.mapGrips.get(t);null==i&&(i=new Array,this.mapGrips.set(t,i));var r=new d;return r.iIndex=e,r.point=new a.Vector3(n.x,n.y,0),i.push(r),r},x.prototype.hitTest=function(t){var e=this,n={grips:new Array,ents:new Array,pt:t},i=new a.Vector3(t.x,t.y,0),r=this.database.getMxObject(),o=r.screenCoordLong2Doc(s.MxDrawData.m_dGridWidth/2);return this.mapGrips.forEach(function(t,a){for(var s=t.length,l=0;l<s;l++){var c=t[l];if(c.point.distanceTo(i)<=o){var u=e.database.getEntity(a),h=!0;r.hasEvent("whetherEditTheGripPoint")&&(h=r.callEvent("whetherEditTheGripPoint",{entity:u.getUserObject(),index:c.iIndex})),h&&(n.grips.push(c),n.ents.push(u));break}}}),n},x.prototype.onMouseLBDown=function(t){if(!s.MxDrawData.m_isEnableGripEidt)return!1;var e=this.hitTest(t);return 0!=e.grips.length&&(o.MxFun.sendStringToExecute("Mx_FrontEndWebpageGripEdit",e),!0)},x.prototype.gripEditImp=function(t){var e=t.grips,n=t.ents,i=t.pt,r=new g(i,e,n);r.setDisableDynInput(!0),r.setDisableOsnap(!0),c.MxJigCmdManager.runCmd(r)},x.prototype.doWindowsSelect=function(t,e){},x.prototype.addGripFromEntity=function(t){if(s.MxDrawData.m_isEnableGripEidt){var e=t.getGripPoints(),n=t.objectId();this.deleteGripData(n);for(var i=0;i<e.length;i++){var r=this.addGripData(n,i,e[i]);this.createGripDisplayObject(r)}}},x.prototype.addSelect=function(t){var e=this.database.getSelectManager(),n=!1;if(this.getAllSelect().forEach(function(e){e==t&&(n=!0)}),!n){var i=this.database.getMxObject(),r=i.getMxEntity(t);if(r){var a=new Set;a.add(t),this.addGripFromEntity(r),e.upSelectDilsplay(a),this.isCallingMxEntitySelectChange||(this.isCallingMxEntitySelectChange=!0,i.callEvent("MxEntitySelectChange",this.getAllSelect()),this.isCallingMxEntitySelectChange=!1)}}},x.prototype.doPointSelect=function(t){for(var e=!1,n=this.database.getSelectManager(),i=this.database.getMxObject(),r=n.isEmptySelect(),a=!1,o=i.screenCoordLong2Doc(.5*s.MxDrawData.m_dGridWidth),l=function(){s.MxDrawData.m_isMultipleSelect||(c.removeAllGrips(),n.removeAllEntity());var r=c.database.getIntersectObjects(t);if(0==r.length)return i.updateDisplay(),"break";var l=i.screenCoord2Doc(t.x,t.y,t.z),u=c,h=new Set;r.forEach(function(t){var e=f(t.object);if(e){var n=e.objectId();if(u.database.isValidId(n)&&!h.has(n)){var i=e.getClosestPointTo(l,1),r=!1;(!i||i.distanceTo(l)<o)&&(r=!0),r&&(h.add(n),u.addGripFromEntity(e))}}});var p=new Set,d=c.database.getGroupDictionary();return h.forEach(function(t){p.add(t),d.getEntityInGroup(t).forEach(function(t){t.getAll().forEach(function(t){u.database.isValidId(t)&&p.add(t)})})}),a=!0,n.upSelectDilsplay(p),i.updateDisplay(),e=!0,"break"},c=this;"break"!==l(););return!a&&r==n.isEmptySelect()||this.isCallingMxEntitySelectChange||(this.isCallingMxEntitySelectChange=!0,i.callEvent("MxEntitySelectChange",this.getAllSelect()),this.isCallingMxEntitySelectChange=!1),e},x);function x(t){this.database=null,this.mapGrips=new Map,this.isCallingMxEntitySelectChange=!1,this.drawGroup=null,this.database=t}n.MxDbEntityGrip=y},{"../MxDrawData":29,"../MxFun":34,"../MxManager":36,"../MxType":46,"../Operate/McGiWorldDraw":50,"../Operate/MxJig":57,"../Operate/MxJigCmdManager":58,three:19}],73:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbEntitySelect=void 0;var i=t("three"),r=t("../MxFun"),a=t("three.meshline"),o=t("../Operate/McGiWorldDraw"),s=t("../MxManager"),l=(c.prototype.setRenderOrder=function(t){this.iRenderOrder=t},c.prototype.getRenderOrder=function(){return this.iRenderOrder},c.prototype.setCanvasSize=function(t,e){this.canvasWidth==t&&this.canvasHeight==e||(this.canvasWidth=t,this.canvasHeight=e,this.material.resolution=new i.Vector2(this.canvasWidth,this.canvasHeight),this.material.needsUpdate=!0)},c.prototype.removeAllEntity=function(){var t=this.getParentObject();return 0!=this.mapIdToThreeObject.size&&(this.mapIdToThreeObject.forEach(function(e){for(var n=e.length,i=0;i<n;i++)r.MxFun.removeThreejsObject(e[i],t)}),this.mapIdToThreeObject.clear(),!0)},c.prototype.isEmptySelect=function(){return 0==this.mapIdToThreeObject.size},c.prototype.getParentObject=function(){return this.mxDatabase.getMxObject().getTheTempDrawContainer()},c.prototype.getAllSelect=function(){var t=[];return this.mapIdToThreeObject.forEach(function(e,n){t.push(n)}),t},c.prototype.setPrvCommandSelect=function(t){this.aryPrvCommandSelect=t},c.prototype.getPrvCommandSelect=function(){return this.aryPrvCommandSelect},c.prototype.deleteSelect=function(t){var e=this.getParentObject(),n=this.mapIdToThreeObject.get(t);if(n){for(var i=n.length,a=0;a<i;a++)r.MxFun.removeThreejsObject(n[a],e);this.mapIdToThreeObject.delete(t)}},c.prototype.upSelectDilsplayFromId=function(t){var e=new Set;e.add(t),this.upSelectDilsplay(e)},c.prototype.upSelectDilsplay=function(t){var e=this,n=new o.McGiWorldDrawSelect(this.mxDatabase.getMxObject(),this);t.forEach(function(t){e.deleteSelect(t);var i=e.mxDatabase.getEntity(t);i&&(n.setCurEntityId(t),i.worldDraw(n))})},c.prototype.addCircleDisplay=function(t,e,n){var r=new i.CircleGeometry(n,64,3,2*Math.PI);if(r.vertices.shift(),0!=r.vertices.length){r.vertices.push(r.vertices[0]);var o=3*r.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]=r.vertices[u].x+e.x,l[c+1]=r.vertices[u].y+e.y,l[c+2]=e.z;var h=new a.MeshLine;h.setGeometry(l);var p=new i.Mesh(h.geometry,this.material);p.renderOrder=this.iRenderOrder,s.add(p);var d=this.mapIdToThreeObject.get(t);d||(d=new Array,this.mapIdToThreeObject.set(t,d)),d.push(p)}}},c.prototype.addLineDisplay=function(t,e,n){var r=this.getParentObject(),o=new Float32Array(6);o[0]=e.x,o[1]=e.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 i.Mesh(s.geometry,this.material);l.renderOrder=this.iRenderOrder,r.add(l);var c=this.mapIdToThreeObject.get(t);c||(c=new Array,this.mapIdToThreeObject.set(t,c)),c.push(l)},c);function c(t){this.mapIdToThreeObject=new Map,this.canvasWidth=800,this.canvasHeight=500,this.mxDatabase=null,this.material=new a.MeshLineMaterial({useMap:!1,color:new i.Color(2641557),opacity:.8,resolution:new i.Vector2(800,500),sizeAttenuation:!1,lineWidth:10,transparent:!0,depthTest:!1}),this.iRenderOrder=s.MxData.iSelectRenderOrder,this.aryPrvCommandSelect=[],this.mxDatabase=t}n.MxDbEntitySelect=l},{"../MxFun":34,"../MxManager":36,"../Operate/McGiWorldDraw":50,three:19,"three.meshline":18}],74:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbGroupDictionary=n.MxDbGroup=void 0;var i=(r.prototype.name=function(){return this.sName},r.prototype.append=function(t){this.has(t)||this.setId.add(t)},r.prototype.clear=function(){this.setId=new Set},r.prototype.getAll=function(){var t=[];return this.setId.forEach(function(e){t.push(e)}),t},r.prototype.has=function(t){return this.setId.has(t)},r.prototype.delete=function(t){return this.setId.delete(t)},r);function r(t){this.setId=new Set,this.sName="",this.sName=t}n.MxDbGroup=i;var a=(o.prototype.getAt=function(t){return this.mapNameToGroup.get(t)},o.prototype.delete=function(t){return!!this.mapNameToGroup.has(t)&&this.mapNameToGroup.delete(t)},o.prototype.add=function(t){var e=this.mapNameToGroup.get(t);return e||(e=new i(t),this.mapNameToGroup.set(t,e),e)},o.prototype.dwgOut=function(t){var e=[];return this.mapNameToGroup.forEach(function(t,n){e.push(n)}),t.groups=e,t},o.prototype.dwgIn=function(t){var e=this;return t.groups.forEach(function(t){var n=new i(t);e.mapNameToGroup.set(t,n)}),!0},o.prototype.getEntityInGroup=function(t){var e=[];return this.mapNameToGroup.forEach(function(n){n.has(t)&&e.push(n)}),e},o.prototype.getEntityInGroupName=function(t){var e=[];return this.mapNameToGroup.forEach(function(n,i){n.has(t)&&e.push(i)}),e},o);function o(){this.mapNameToGroup=new Map}n.MxDbGroupDictionary=a},{}],75:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbLayerTableRecord=void 0;var i=t("three"),r=(a.prototype.getGroup=function(){return this.group},a.prototype.getName=function(){return this.name},a.prototype.setName=function(t){this.name=t},a.prototype.setVisible=function(t){this.visible=t,this.group.visible=t},a.prototype.getVisible=function(){return this.visible},a.prototype.init=function(t,e){return this.name=t,e.add(this.group),!0},a.prototype.dwgIn=function(t){return this.visible=t.visible,this.name=t.name,this.group.visible=this.visible,!0},a.prototype.dwgOut=function(t){return t.visible=this.visible,t.name=this.name,t},a);function a(){this.group=new i.Group,this.name="",this.visible=!0}n.MxDbLayerTableRecord=r},{three:19}],76:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbTextureManager=void 0;var i=t("three"),r=(a.prototype.loadImage=function(t,e){var n=this.mapImageUrlToMaterialTexture.get(t);if(n)e(n);else{var r=this;(new i.TextureLoader).load(t,function(n){var a=new i.MeshLambertMaterial({map:n,transparent:!0,side:i.DoubleSide});a.map&&(a.map.needsUpdate=!0),r.mapImageUrlToMaterialTexture.set(t,a),e&&e(a)},void 0,function(t){console.log(t),e&&e(null)})}},a);function a(){this.mapImageUrlToMaterialTexture=new Map}n.MxDbTextureManager=r},{three:19}],77:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObject3dThreeJS=n.MxDrawObject2dThreeJS=n.MxDrawMapBoxThreeJS=n.MxDrawThreeJS=n.MxThreeJSType=void 0;var a,o,s=t("three"),l=t("../Operate/MxJigCmdManager");(o=a||(n.MxThreeJSType=a={}))[o.k2d=0]="k2d",o[o.k3d=1]="k3d",o[o.kMapBox=2]="kMapBox";var c=(u.prototype.addControlsChangeEvent=function(){var t=this.mxObject;this.mxObject.getOrbitControls().addEventListener("change",function(){l.MxJigCmdManager.OnThreeControlsChage(),t.callEvent("viewchange"),t.getMxDatabase().onViewChange(),t.getMcObject().isValid()&&t.getMcObject().getGripManager().onControlsChage();var e=t.getMxCAD();e&&e.getGrip().onControlsChage(),t.updateDisplay()})},u.prototype.updateDisplay=function(t){void 0===t&&(t=!1),this.mxObject.updateDisplayImplement(t)},u.prototype.addWindowResizeEvent=function(){},u);function u(t){this.mxObject=t}n.MxDrawThreeJS=c;var h,p=(r(d,h=c),d.prototype.onInitThreejs=function(){var t=this,e=new s.Camera,n=new s.Scene,i=this.mapBox.canvas,r=new s.DirectionalLight(16777215);r.position.set(0,-70,100).normalize(),n.add(r);var a=new s.DirectionalLight(16777215);a.position.set(0,70,100).normalize(),n.add(a);var o=new s.WebGLRenderer({canvas:i,context:this.mapBox.gl});o.autoClear=!1,this.mxObject2d.mapBoxInitThreeJSObject(n,e,o);var l=this;this.mapBox.render=function(e,n){var i=(new s.Matrix4).fromArray(n);i.multiply(t.matCADLogicalCoordToMap);var r=new s.Vector3(0,0,0);if(r.applyMatrix4(i),1<r.z){var a=1-r.z-1e-5;i=(new s.Matrix4).makeTranslation(0,0,a).multiply(i)}l.mxObject2d.mapBoxRender(e,i)}},d.prototype.alignCoordSys=function(t,e,n,i,r){var a=1;0<e.x-t.x&&0<i.x-n.x&&(a=(i.x-n.x)/(e.x-t.x));var o=new s.Matrix4;o.makeTranslation(-t.x,-t.y,-t.z);var l=(new s.Matrix4).scale(new s.Vector3(a,-a,a));return(new s.Matrix4).makeTranslation(n.x,n.y+(i.y-n.y),r).multiply(l).multiply(o)},d.prototype.updateCameraDisplayRange=function(t,e,n){var i=new s.Matrix4;i.makeTranslation(-this.mapBox.cadOrigin.x,-this.mapBox.cadOrigin.y,-this.mapBox.cadOrigin.z);var r=new s.Matrix4;r.makeTranslation(this.mapBox.mapOrigin.x,this.mapBox.mapOrigin.y,this.mapBox.elevation);var a=new s.Matrix4;a.makeScale(this.mapBox.mapLenInCADUnits,-this.mapBox.mapLenInCADUnits,this.mapBox.mapLenInCADUnits);var o=r.multiply(a).multiply(i),l=this.mxObject2d.getWorldToDoc();this.matCADLogicalCoordToMap=o.clone().multiply(l),this.mapBox.matCadToMap=o,this.mapBox.matMapToCad=new s.Matrix4,this.mapBox.matMapToCad.getInverse(o)},d.prototype.onInitScene=function(){},d.prototype.addControlsChangeEvent=function(){},d.prototype.addWindowResizeEvent=function(){},d.prototype.updateDisplay=function(t){void 0===t&&(t=!1)},d.prototype.getType=function(){return a.kMapBox},d);function d(t,e){var n=h.call(this,e)||this;return n.matCADLogicalCoordToMap=new s.Matrix4,n.mapBox=t,n.mxObject2d=e,n}n.MxDrawMapBoxThreeJS=p;var f,m=(r(g,f=c),g.prototype.onInitThreejs=function(){this.proxyObj.onInitThreejs()},g.prototype.onInitScene=function(){this.proxyObj.onInitScene()},g.prototype.getType=function(){return a.k2d},g.prototype.updateCameraDisplayRange=function(t,e,n){this.proxyObj.updateCameraDisplayRangeImp(t,e,n)},g);function g(t){var e=f.call(this,t)||this;return e.proxyObj=t,e}n.MxDrawObject2dThreeJS=m;var v,y=(r(x,v=c),x.prototype.onInitThreejs=function(){this.proxyObj.onInitThreejs()},x.prototype.onInitScene=function(){this.proxyObj.onInitScene()},x.prototype.getType=function(){return a.k3d},x.prototype.updateCameraDisplayRange=function(t,e,n){},x);function x(t){var e=v.call(this,t)||this;return e.proxyObj=t,e}n.MxDrawObject3dThreeJS=y},{"../Operate/MxJigCmdManager":58,three:19}],78:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.McDrawGripJig=n.McDrawGrip=n.McDrawSlect=n.McDrawGripData=void 0;var a=t("three"),o=t("../MxFun"),s=t("../Operate/MxJig"),l=t("../Operate/MxJigCmdManager"),c=t("../MxManager"),u=t("../MxDrawData"),h=function(){this.threeObject=null};n.McDrawGripData=h;var p=(d.prototype.add=function(t){this.setId.has(t)||(this.setId.add(t),this.mcObj.HighlightEntity(t,!0))},d.prototype.remove=function(t){this.setId.has(t)&&(this.setId.delete(t),this.mcObj.HighlightEntity(t,!1))},d.prototype.removeAll=function(){var t=this;this.setId.forEach(function(e){t.mcObj.HighlightEntity(e,!1)}),this.setId.clear()},d);function d(t){this.mcObj=null,this.setId=new Set,this.mcObj=t}n.McDrawSlect=p;var f=(m.prototype.getParentGroup=function(){return this.drawGroup||(this.drawGroup=new a.Group,this.drawGroup.renderOrder=c.MxData.iGripRenderOrder,this.mxObj.getTheTempDrawContainer().add(this.drawGroup)),this.drawGroup},m.prototype.removeAllEntity=function(){var t=this.getParentGroup();this.mapGrips.forEach(function(e,n,i){for(var r=e.length,a=0;a<r;a++){var s=e[a];o.MxFun.removeThreejsObject(s.threeObject,t)}}),this.mapGrips=new Map},m.prototype.deleteGripData=function(t){var e=this.getParentGroup(),n=this.mapGrips.get(t);if(n)for(var i=n.length,r=0;r<i;r++){var a=n[r];o.MxFun.removeThreejsObject(a.threeObject,e)}this.mapGrips.delete(t)},m.prototype.addGripData=function(t,e,n,i){var r=this.mapGrips.get(t);null==r&&(r=new Array,this.mapGrips.set(t,r));var a=new h;return a.iIndex=e,a.point=this.mxObj.cadCoord2Doc(n,i,0),r.push(a),a},m.prototype.createGripDisplayObject=function(t){var e=this.getParentGroup();t.geometry=new a.Geometry;var n=this.mxObj.screenCoordLong2Doc(u.MxDrawData.m_dGridWidth/2);t.geometry.vertices.push(new a.Vector3(t.point.x-n,t.point.y-n,0)),t.geometry.vertices.push(new a.Vector3(t.point.x-n,t.point.y+n,0)),t.geometry.vertices.push(new a.Vector3(t.point.x+n,t.point.y+n,0)),t.geometry.vertices.push(new a.Vector3(t.point.x+n,t.point.y-n,0)),t.geometry.faces.push(new a.Face3(0,1,2)),t.geometry.faces.push(new a.Face3(2,3,0)),t.geometry.computeFaceNormals(),t.geometry.computeVertexNormals();var i=new a.MeshBasicMaterial({color:255,transparent:!0,depthTest:!1,side:a.DoubleSide,opacity:.9}),r=new a.Mesh(t.geometry,i);e.add(r),t.threeObject=r},m.prototype.clearAll=function(){return this.mcSelect.removeAll(),0!=this.mapGrips.size&&(this.removeAllEntity(),!0)},m.prototype.onControlsChage=function(){if(0!=this.mapGrips.size){var t=this.mxObj.screenCoordLong2Doc(8),e=!1;this.mapGrips.forEach(function(n,i,r){for(var a=n.length,o=0;o<a;o++){var s=n[o];4==s.geometry.vertices.length&&(s.geometry.vertices[0].x=s.point.x-t,s.geometry.vertices[0].y=s.point.y-t,s.geometry.vertices[1].x=s.point.x-t,s.geometry.vertices[1].y=s.point.y+t,s.geometry.vertices[2].x=s.point.x+t,s.geometry.vertices[2].y=s.point.y+t,s.geometry.vertices[3].x=s.point.x+t,s.geometry.vertices[3].y=s.point.y-t,s.geometry.computeFaceNormals(),s.geometry.computeVertexNormals(),s.geometry.verticesNeedUpdate=!0,e=!0)}}),e&&this.mxObj.resetRenderer()}},m.prototype.hitTest=function(t){var e={grips:new Array,ids:new Array,pt:t},n=new a.Vector3(t.x,t.y,0),i=this.mxObj.screenCoordLong2Doc(32);return this.mapGrips.forEach(function(t,r){for(var a=t.length,o=0;o<a;o++){var s=t[o];if(s.point.distanceTo(n)<=i){e.grips.push(s),e.ids.push(r);break}}}),e},m.prototype.onMouseLBDown=function(t){var e=this.hitTest(t);return 0!=e.grips.length&&(o.MxFun.sendStringToExecute("McDraw_GripEdit",e),!0)},m.prototype.gripEditImp=function(t){var e=t.grips,n=t.ids,i=t.pt,r=new v(i,e,n,this.mcObj);r.setDisableDynInput(!0),r.setDisableOsnap(!0),l.MxJigCmdManager.runCmd(r)},m.prototype.addGridDisplay=function(t){if(t&&0!=t.length)for(var e=JSON.parse(t),n=e.vecEntityData.length,i=0;i<n;i++){var r=e.vecEntityData[i],a=r.lIdIndex;this.deleteGripData(a);for(var o=r.vecGrip.length,s=0;s<o;s++){var l=r.vecGrip[s],c=this.addGripData(a,l.iIndex,l.ptx,l.pty);this.createGripDisplayObject(c)}}},m.prototype.upEntityGridDisplay=function(t){if(0==t)return!1;var e=this.mcObj.mcObjectImp.IntelliSelect_getGridData(t);return this.addGridDisplay(e),!0},m.prototype.doPointSelect=function(t){var e=this.mxObj.screenCoord2Doc(t.x,t.y,0),n=this.mxObj.docCoord2Cad(e.x,e.y,e.z),i=this.mcObj.mcObjectImp.IntelliSelect_PointSelect(n.x,n.y);if(0!=i)return this.mcSelect.removeAll(),this.mcSelect.add(i),this.upEntityGridDisplay(i)},m);function m(t,e){this.mxObj=null,this.mcObj=null,this.mcSelect=null,this.mapGrips=new Map,this.drawGroup=null,this.mxObj=t,this.mcObj=e,this.mcSelect=new p(e)}n.McDrawGrip=f;var g,v=(r(y,g=s.McEdJigCommand),y.prototype.onExitCommand=function(t){this.mcObj.DestroyObject(this.tempEntity),this.tempEntity=null,this.mcObj.DestroyObject(this.tempEntityWordDraw),this.tempEntityWordDraw=null,g.prototype.onExitCommand.call(this,t)},y.prototype.sampler=function(){var t=l.MxJigCmdManager.InType.kGetBegan,e=this.acquirePoint(t);if(e.status==l.MxJigCmdManager.DragStatus.kNormal&&(this.currPt=e.pt,this.tempEntity)){var n=this.mcObj.mxObject.docCoord2Cad(e.pt.x,e.pt.y,e.pt.z),i=this.mcObj.mxObject.docCoord2Cad(this.pt.x,this.pt.y,this.pt.z);this.mcObj.DestroyObject(this.tempEntityWordDraw),this.tempEntityWordDraw=this.tempEntity.Clone(),this.tempEntityWordDraw&&this.tempEntityWordDraw.moveGripPointsAt(this.grips[0].iIndex,n.x-i.x,n.y-i.y,n.z-i.z)}return e.status},y.prototype.getTypeName=function(){return"McDrawGripEdit"},y.prototype.done=function(t){if(t==l.MxJigCmdManager.DragStatus.kNormal)for(var e=this.mcObj.mxObject.docCoord2Cad(this.pt.x,this.pt.y,this.pt.z),n=this.mcObj.mxObject.docCoord2Cad(this.currPt.x,this.currPt.y,this.currPt.z),i=n.x-e.x,r=n.y-e.y,a=this.getMxObject().getMcObject().getGripManager(),o=this.grips.length,s=0;s<o;s++){var c=this.grips[s],u=this.ids[s],h=this.mcObj.ObjectIdToMdObjectImp(u);h&&h.moveGripPointsAt(c.iIndex,i,r,0),this.mcObj.DestroyObject(h),a.upEntityGridDisplay(u)}return l.MxJigCmdManager.DoneStatius.kExitCommand},y.prototype.upDisplay=function(){this.mcObj.onReadyJigUpdateDispla(),this.mcObj.onJigDrawEntityDisplay(this.tempEntityWordDraw)},y);function y(t,e,n,i){var r=g.call(this)||this;return r.pt=t,r.grips=e,r.ids=n,r.currPt=t,r.mcObj=i,r.ids.length&&(r.tempEntity=i.ObjectIdToMdObjectImp(r.ids[0])),r}n.McDrawGripJig=v},{"../MxDrawData":29,"../MxFun":34,"../MxManager":36,"../Operate/MxJig":57,"../Operate/MxJigCmdManager":58,three:19}],79:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.McDrawObject=void 0;var i=t("../MxManager"),r=t("three"),a=t("../MxFun"),o=t("./McDrawGrip"),s=window;s.McDrawObjectEvent_openFileComplete=function(t,e,n){var r=i.MxManager.getMxObject(e);r&&r.getMcObject().openFileComplete(t,n)},s.McDrawObjectEvent_saveFileComplete=function(t,e,n){var r=i.MxManager.getMxObject(n);r&&r.getMcObject().saveFileComplete(t,e)},s.McDrawObjectEvent_osnapComplete=function(t,e){var n=i.MxManager.getMxObject(t);n&&n.getMcObject().callOsnapComplete(e)};var l=(c.prototype.isValid=function(){return null!==this.mcObjectImp},c.prototype.ObjectIdToMdObjectImp=function(t){return this.mcObjectImp?this.mcObject.ObjectIdToMdObjectImp(t):null},c.prototype.DestroyObject=function(t){if(!this.mcObjectImp)return null;this.mcObject.DestroyObject(t)},c.prototype.onJigCommandEnd=function(){this.mcObjectImp&&this.mcObjectImp.EntityTempWordDraw_onJigCommandEnd()},c.prototype.onJigDrawEntityDisplay=function(t){t&&this.mcObjectImp&&this.mcObjectImp.EntityTempWordDraw_onJigDrawEntityDisplay(t)},c.prototype.callOsnapComplete=function(t){if(this.m_retCall&&t)try{var e=t;if("string"==typeof t&&(e=JSON.parse(t)),e.callId!=this.m_lOsnapCallCount)return;this.m_retCall(e)}catch(t){}},c.prototype.onNotifyOsnap=function(t,e){this.mcObjectImp&&(this.m_lOsnapCallCount++,this.m_retCall=e,1e5<this.m_lOsnapCallCount&&(this.m_lOsnapCallCount=1),this.mcObjectImp.Osnap_NotifyOsnap(t.ptx,t.pty,t.isValidPrvInputPoint,t.isValidPrvInputPoint?t.prvPtx:0,t.isValidPrvInputPoint?t.prvPty:0,t.osmode,t.SearchRnge,this.m_lOsnapCallCount))},c.prototype.DrawEntity=function(t){t&&this.mcObjectImp&&this.mcObjectImp.DrawEntity(t)},c.prototype.onJigDrawEntityDisplay_line=function(t,e,n,i,r,a){if(this.mcObjectImp){var o=new this.mxcppImp.MdDbLine,s=new this.mxcppImp.MdGePoint3d;s.x=t,s.y=e,s.z=n,o.setStartPoint(s);var l=new this.mxcppImp.MdGePoint3d;l.x=i,l.y=r,l.z=a,o.setEndPoint(l),this.mcObjectImp.EntityTempWordDraw_onJigDrawEntityDisplay(o)}},c.prototype.DrawLine=function(t,e,n,i,r,a){this.mcObjectImp&&this.mcObjectImp.DrawLine(t,e,n,i,r,a)},c.prototype.HighlightEntity=function(t,e){if(!this.mcDrawUtility)return!1;this.mcDrawUtility.highlightEntity(t,e)},c.prototype.onReadyJigUpdateDispla=function(){this.mcObjectImp&&this.mcObjectImp.EntityTempWordDraw_onReadyJigUpdateDispla()},c.prototype.onJigClearDisplay=function(){this.mcObjectImp&&this.mcObjectImp.EntityTempWordDraw_onJigClearDisplay()},c.prototype.CloneMdDbObject=function(t){return this.mcObject?this.mcObject.CloneMdDbObject(t):null},c.prototype.ObjectIdToObject=function(t){return this.mcObject?this.mcObject.ObjectIdToObject(t):null},c.prototype.init=function(t,e){e.initMxObject(t),this.mxObject=t,this.mcObject=e,this.mcObjectImp=e.getImp(),this.mxcppImp=e.getMxCppImp(),this.grip=new o.McDrawGrip(t,this);var n=this;this.mxObject.addEvent("commandWillStart",function(){n.mcObjectImp.fireEventCommandStart()}),this.mcDrawUtility=new this.mxcppImp.McDrawUtility},c.prototype.setSize=function(t,e){if(!this.mcObjectImp)return!1;this.mcObjectImp.fireEventWindowSize(t,e)},c.prototype.getGripManager=function(){return this.grip},c.prototype.saveFileComplete=function(t,e){this.mcObjectImp&&this.mxObject.callSaveFileComplete(t,e)},c.prototype.openFileComplete=function(t,e){if(this.mcObjectImp){this.mcObjectImp.updataAppData();var n=this.mcObjectImp.getViewDataJsonParam();n=n.replace(/\\/g,"\\\\");try{var i=JSON.parse(n),o=this.mxObject;if(null!=i){o.intiDoc2Wold(new r.Matrix4),o.initCAD2Doc(JSON.parse(i.DToSMat)),o.updateCameraDisplayRange(new r.Vector3(i.pt1x,i.pt1y,0),new r.Vector3(i.pt2x,i.pt2y,0),i.viewangle),o.initAllLayoutName(JSON.parse(i.layout)),o.updateDisplay(!0);var s=a.MxFun.getUiObj();null!=s&&(s.SetLayoutData(i.layout),s.UpDisplayLayout())}}catch(t){console.log("getViewDataJsonParam exception")}this.mxObject.callOpenFileComplete(t,e)}},c.prototype.updateDisplay=function(){if(!this.mcObjectImp)return!1;var t=this.mxObject.getCamera();null!==this.mxObject.getScene().background&&console.log("mxerror: background must be empty");var e=new r.Matrix4;e.multiplyMatrices(t.matrixWorldInverse,this.mxObject.getDoc2World());var n=t.projectionMatrix;return this.mcObjectImp.updateDisplay(e.elements,n.elements)},c);function c(){this.grip=null,this.mcObjectImp=null,this.mxcppImp=null,this.mcObject=null,this.mcDrawUtility=null,this.m_lOsnapCallCount=1,this.m_retCall=null}n.McDrawObject=l},{"../MxFun":34,"../MxManager":36,"./McDrawGrip":78,three:19}]},{},[60])};
|