{ "pandav:/base-utils/AnimationComponent.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/base-utils/AnimationComponent\", [\"pandav:/com/tween-animation/2.0.0\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils/EntryComponent\"], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n function _callSuper(t, o, e) {return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));}\n function _possibleConstructorReturn(self, call) {if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {return call;} else if (call !== void 0) {throw new TypeError(\"Derived constructors may only return object or undefined\");}return _assertThisInitialized(self);}\n function _isNativeReflectConstruct() {try {var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));} catch (t) {}return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {return !!t;})();}\n function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}\n function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");}return self;}\n function _inherits(subClass, superClass) {if (typeof superClass !== \"function\" && superClass !== null) {throw new TypeError(\"Super expression must either be null or a function\");}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });Object.defineProperty(subClass, \"prototype\", { writable: false });if (superClass) _setPrototypeOf(subClass, superClass);}\n function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}\n var _require = require('pandav:/com/tween-animation/2.0.0'),\n animationUpdate = _require.animationUpdate,\n removeAnimationUpdate = _require.removeAnimationUpdate;\n var _require2 = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/EntryComponent'),\n EntryComponent = _require2.EntryComponent;\n var AnimationComponent = function (_EntryComponent) {\n _inherits(AnimationComponent, _EntryComponent);\n function AnimationComponent(props) {\n var _this;\n _classCallCheck(this, AnimationComponent);\n _this = _callSuper(this, AnimationComponent, [props]);\n _this._update = _this._update.bind(_assertThisInitialized(_this));\n return _this;\n }\n _createClass(AnimationComponent, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.lateRender();\n this.didMount();\n animationUpdate(this._update);\n } },\n {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n removeAnimationUpdate(this._update);\n this.willUnmount();\n } },\n {\n key: \"_update\",\n value: function _update(dt) {\n this.update(dt);\n } },\n {\n key: \"update\",\n value: function update() {} }]);\n\n return AnimationComponent;\n }(EntryComponent);\n module.exports = {\n AnimationComponent: AnimationComponent };return module.exports;});", "requires": [ "pandav:/base-utils/EntryComponent.js" ], "buildLevel": 17, "outputDir": "/com/submodule-three-3d/1.0.0/base-utils", "outputPath": "/com/submodule-three-3d/1.0.0/base-utils/AnimationComponent.js", "fileName": "/base-utils/AnimationComponent.js" }, "pandav:/base-utils/index.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/base-utils\", [\"pandav:/com/submodule-three-3d/1.0.0/base-utils/utils\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/Hook\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/AnimationValue\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/AngleTransformer\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/AngleLerp\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/EventList\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/ColorConicLerp\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/ColorLerp\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/ColorLerp2\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/ContentEditable\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/MultiColorLerp\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils/BaseComponent\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils/EntryComponent\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils/AnimationComponent\"], function (module, exports, require, load, process, global) {\n\n var _require = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/utils'),\n handleRelative = _require.handleRelative,\n emitCustomEvent = _require.emitCustomEvent,\n handleChartRelative = _require.handleChartRelative,\n arrayToMap = _require.arrayToMap,\n parseTextStyle = _require.parseTextStyle,\n parseShadow = _require.parseShadow,\n parseMulticolor = _require.parseMulticolor,\n parseMulticolorCommon = _require.parseMulticolorCommon,\n parseMultiColorDom = _require.parseMultiColorDom,\n mergeObject = _require.mergeObject,\n deepCopy = _require.deepCopy,\n isEqual = _require.isEqual,\n pointRotate = _require.pointRotate,\n lerp = _require.lerp,\n clamp = _require.clamp,\n rad2deg = _require.rad2deg,\n deg2rad = _require.deg2rad,\n decomposeColor = _require.decomposeColor,\n cssColorToHexNumber = _require.cssColorToHexNumber,\n colorMulOpacity = _require.colorMulOpacity,\n polarToCartesian = _require.polarToCartesian,\n splitNumber = _require.splitNumber,\n copyObject = _require.copyObject,\n getVectorAngle = _require.getVectorAngle,\n fetchJson = _require.fetchJson,\n invokeStringFunction = _require.invokeStringFunction,\n objectToJavsScriptCode = _require.objectToJavsScriptCode,\n deepAssignObject = _require.deepAssignObject;\n var _require2 = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/Hook'),\n Hook = _require2.Hook;\n var _require3 = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/AnimationValue'),\n AnimationValue = _require3.AnimationValue;\n var _require4 = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/AngleTransformer'),\n AngleTransformer = _require4.AngleTransformer;\n var _require5 = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/AngleLerp'),\n AngleLerp = _require5.AngleLerp;\n var _require6 = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/EventList'),\n EventList = _require6.EventList;\n var _require7 = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/ColorConicLerp'),\n ColorConicLerp = _require7.ColorConicLerp;\n var _require8 = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/ColorLerp'),\n ColorLerp = _require8.ColorLerp;\n var _require9 = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/ColorLerp2'),\n ColorLerp2 = _require9.ColorLerp2;\n var _require10 = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/ContentEditable'),\n ContentEditable = _require10.ContentEditable;\n var _require11 = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/MultiColorLerp'),\n MultiColorLerp = _require11.MultiColorLerp;\n var _require12 = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/BaseComponent'),\n BaseComponent = _require12.BaseComponent;\n var _require13 = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/EntryComponent'),\n EntryComponent = _require13.EntryComponent;\n var _require14 = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/AnimationComponent'),\n AnimationComponent = _require14.AnimationComponent;\n module.exports = {\n EntryComponent: EntryComponent,\n BaseComponent: BaseComponent,\n Hook: Hook,\n EventList: EventList,\n AngleTransformer: AngleTransformer,\n AnimationValue: AnimationValue,\n AngleLerp: AngleLerp,\n AnimationComponent: AnimationComponent,\n ColorConicLerp: ColorConicLerp,\n ColorLerp: ColorLerp,\n ContentEditable: ContentEditable,\n MultiColorLerp: MultiColorLerp,\n ColorLerp2: ColorLerp2,\n handleRelative: handleRelative,\n emitCustomEvent: emitCustomEvent,\n handleChartRelative: handleChartRelative,\n arrayToMap: arrayToMap,\n parseTextStyle: parseTextStyle,\n parseShadow: parseShadow,\n parseMulticolor: parseMulticolor,\n parseMulticolorCommon: parseMulticolorCommon,\n parseMultiColorDom: parseMultiColorDom,\n mergeObject: mergeObject,\n deepCopy: deepCopy,\n isEqual: isEqual,\n pointRotate: pointRotate,\n lerp: lerp,\n clamp: clamp,\n rad2deg: rad2deg,\n deg2rad: deg2rad,\n decomposeColor: decomposeColor,\n cssColorToHexNumber: cssColorToHexNumber,\n colorMulOpacity: colorMulOpacity,\n polarToCartesian: polarToCartesian,\n splitNumber: splitNumber,\n copyObject: copyObject,\n getVectorAngle: getVectorAngle,\n fetchJson: fetchJson,\n invokeStringFunction: invokeStringFunction,\n objectToJavsScriptCode: objectToJavsScriptCode,\n deepAssignObject: deepAssignObject };return module.exports;});", "requires": [ "pandav:/base-utils/utils.js", "pandav:/base-utils/lib/Hook.js", "pandav:/base-utils/lib/AnimationValue.js", "pandav:/base-utils/lib/AngleTransformer.js", "pandav:/base-utils/lib/AngleLerp.js", "pandav:/base-utils/lib/EventList.js", "pandav:/base-utils/lib/ColorConicLerp.js", "pandav:/base-utils/lib/ColorLerp.js", "pandav:/base-utils/lib/ColorLerp2.js", "pandav:/base-utils/lib/ContentEditable.js", "pandav:/base-utils/lib/MultiColorLerp.js", "pandav:/base-utils/BaseComponent.js", "pandav:/base-utils/EntryComponent.js", "pandav:/base-utils/AnimationComponent.js" ], "buildLevel": 3, "outputDir": "/com/submodule-three-3d/1.0.0/base-utils", "outputPath": "/com/submodule-three-3d/1.0.0/base-utils/index.js", "fileName": "/base-utils/index.js" }, "pandav:/index.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0\", [\"pandav:/com/submodule-three-3d/1.0.0/src/ThreeComponent\", \"pandav:/com/submodule-three-3d/1.0.0/src/ThreeController/ThreeFixedController\", \"pandav:/com/submodule-three-3d/1.0.0/src/ThreeController/PanoramaController\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils\", \"pandav:/com/submodule-three-3d/1.0.0/src/utils\", \"pandav:/com/submodule-three-3d/1.0.0/src/AssetsMgr\", \"pandav:/com/submodule-three-3d/1.0.0/src/EObjectContainer\", \"pandav:/com/submodule-three-3d/1.0.0/src/Event/EventMgr\", \"pandav:/com/submodule-three-3d/1.0.0/src/Event/EventLayer\", \"pandav:/com/submodule-three-3d/1.0.0/src/material/GradientMaterial\", \"pandav:/com/submodule-three-3d/1.0.0/src/editor/ChildComponentEditor/ChildComponentDataMgr\", \"pandav:/com/submodule-three-3d/1.0.0/src/editor/ChildComponentEditor/ChildComponentEditorDefine\"], function (module, exports, require, load, process, global) {\n\n var _require = require('pandav:/com/submodule-three-3d/1.0.0/src/ThreeComponent'),\n ThreeComponent = _require.ThreeComponent;\n var _require2 = require('pandav:/com/submodule-three-3d/1.0.0/src/ThreeController/ThreeFixedController'),\n MouseKey = _require2.MouseKey,\n ThreeFixedController = _require2.ThreeFixedController,\n multiplyAxisRotate = _require2.multiplyAxisRotate,\n TargetMode = _require2.TargetMode,\n ControlData = _require2.ControlData;\n var _require3 = require('pandav:/com/submodule-three-3d/1.0.0/src/ThreeController/PanoramaController'),\n PanoramaController = _require3.PanoramaController;\n var utils = require('pandav:/com/submodule-three-3d/1.0.0/base-utils');\n var _require4 = require('pandav:/com/submodule-three-3d/1.0.0/src/utils'),\n getWorldBoundingBox = _require4.getWorldBoundingBox,\n setObjectMatrix = _require4.setObjectMatrix,\n syncChildrenLayers = _require4.syncChildrenLayers,\n getModelFormat = _require4.getModelFormat,\n createHDRRenderTarget = _require4.createHDRRenderTarget;\n var _require5 = require('pandav:/com/submodule-three-3d/1.0.0/src/AssetsMgr'),\n TextureFormatType = _require5.TextureFormatType,\n getTextureFormatType = _require5.getTextureFormatType,\n isTransparentAssets = _require5.isTransparentAssets,\n AssetsMgr = _require5.AssetsMgr;\n var _require6 = require('pandav:/com/submodule-three-3d/1.0.0/src/EObjectContainer'),\n EObjectContainer = _require6.EObjectContainer;\n var _require7 = require('pandav:/com/submodule-three-3d/1.0.0/src/Event/EventMgr'),\n EventType = _require7.EventType,\n EventMgr = _require7.EventMgr;\n var _require8 = require('pandav:/com/submodule-three-3d/1.0.0/src/Event/EventLayer'),\n EventLayer = _require8.EventLayer;\n var _require9 = require('pandav:/com/submodule-three-3d/1.0.0/src/material/GradientMaterial'),\n GradientMaterial = _require9.GradientMaterial;\n var _require10 = require('pandav:/com/submodule-three-3d/1.0.0/src/editor/ChildComponentEditor/ChildComponentDataMgr'),\n ChildComponentDataMgr = _require10.ChildComponentDataMgr;\n var _require11 = require('pandav:/com/submodule-three-3d/1.0.0/src/editor/ChildComponentEditor/ChildComponentEditorDefine'),\n LocateMode = _require11.LocateMode;\n module.exports = Object.assign({\n ThreeComponent: ThreeComponent,\n MouseKey: MouseKey,\n ThreeFixedController: ThreeFixedController,\n PanoramaController: PanoramaController,\n getWorldBoundingBox: getWorldBoundingBox,\n setObjectMatrix: setObjectMatrix,\n syncChildrenLayers: syncChildrenLayers,\n getModelFormat: getModelFormat,\n createHDRRenderTarget: createHDRRenderTarget,\n TextureFormatType: TextureFormatType,\n getTextureFormatType: getTextureFormatType,\n isTransparentAssets: isTransparentAssets,\n AssetsMgr: AssetsMgr,\n EObjectContainer: EObjectContainer,\n EventType: EventType,\n EventMgr: EventMgr,\n EventLayer: EventLayer,\n GradientMaterial: GradientMaterial,\n multiplyAxisRotate: multiplyAxisRotate,\n TargetMode: TargetMode,\n ControlData: ControlData,\n ChildComponentDataMgr: ChildComponentDataMgr,\n LocateMode: LocateMode },\n utils);return module.exports;});", "requires": [ "pandav:/src/ThreeComponent.js", "pandav:/src/ThreeController/ThreeFixedController.js", "pandav:/src/ThreeController/PanoramaController.js", "pandav:/base-utils/index.js", "pandav:/src/utils.js", "pandav:/src/AssetsMgr.js", "pandav:/src/EObjectContainer.js", "pandav:/src/Event/EventMgr.js", "pandav:/src/Event/EventLayer.js", "pandav:/src/material/GradientMaterial.js", "pandav:/src/editor/ChildComponentEditor/ChildComponentDataMgr.js", "pandav:/src/editor/ChildComponentEditor/ChildComponentEditorDefine.js" ], "buildLevel": 1, "outputDir": "/com/submodule-three-3d/1.0.0", "outputPath": "/com/submodule-three-3d/1.0.0/index.js", "fileName": "/index.js" }, "pandav:/base-utils/BaseComponent.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/base-utils/BaseComponent\", [\"pandav:/npm/react/17.0.2\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/Hook\"], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n function _callSuper(t, o, e) {return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));}\n function _possibleConstructorReturn(self, call) {if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {return call;} else if (call !== void 0) {throw new TypeError(\"Derived constructors may only return object or undefined\");}return _assertThisInitialized(self);}\n function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");}return self;}\n function _isNativeReflectConstruct() {try {var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));} catch (t) {}return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {return !!t;})();}\n function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}\n function _inherits(subClass, superClass) {if (typeof superClass !== \"function\" && superClass !== null) {throw new TypeError(\"Super expression must either be null or a function\");}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });Object.defineProperty(subClass, \"prototype\", { writable: false });if (superClass) _setPrototypeOf(subClass, superClass);}\n function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}\n var React = require('pandav:/npm/react/17.0.2');\n var _require = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/Hook'),\n Hook = _require.Hook;\n var BaseComponent = function (_React$Component) {\n _inherits(BaseComponent, _React$Component);\n function BaseComponent(props) {\n var _this;\n _classCallCheck(this, BaseComponent);\n _this = _callSuper(this, BaseComponent, [props]);\n _this._hook = new Hook();\n return _this;\n }\n _createClass(BaseComponent, [{\n key: \"componentWillMount\",\n value: function componentWillMount() {\n this.refresh(this.props);\n this.willMount();\n } },\n {\n key: \"willMount\",\n value: function willMount() {} },\n {\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(props) {\n this.refresh(props);\n this.willReceiveProps(props);\n } },\n {\n key: \"willReceiveProps\",\n value: function willReceiveProps(props) {} },\n {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.lateRender();\n this.didMount();\n } },\n {\n key: \"didMount\",\n value: function didMount() {} },\n {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n this.lateRender();\n this.didUpdate();\n } },\n {\n key: \"didUpdate\",\n value: function didUpdate() {} },\n {\n key: \"refresh\",\n value: function refresh(props) {} },\n {\n key: \"lateRender\",\n value: function lateRender() {} },\n {\n key: \"didCatch\",\n value: function didCatch(error, errorInfo) {} },\n {\n key: \"componentDidCatch\",\n value: function componentDidCatch(error, errorInfo) {\n console.error(error, errorInfo);\n this.didCatch(error, errorInfo);\n } },\n {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.willUnmount();\n } },\n {\n key: \"willUnmount\",\n value: function willUnmount() {} },\n {\n key: \"hook\",\n value: function hook(id, callback, deepVars, shallowVars) {\n this._hook.do(id, callback, deepVars, shallowVars);\n } }]);\n\n return BaseComponent;\n }(React.Component);\n module.exports = {\n BaseComponent: BaseComponent };return module.exports;});", "requires": [ "pandav:/base-utils/lib/Hook.js" ], "buildLevel": 15, "outputDir": "/com/submodule-three-3d/1.0.0/base-utils", "outputPath": "/com/submodule-three-3d/1.0.0/base-utils/BaseComponent.js", "fileName": "/base-utils/BaseComponent.js" }, "pandav:/base-utils/lib/AngleLerp.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/AngleLerp\", [\"pandav:/com/submodule-three-3d/1.0.0/base-utils/utils\"], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n var _require = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/utils'),\n clamp = _require.clamp,\n deg2rad = _require.deg2rad;\n var AngleLerp = function () {\n function AngleLerp(startAngle, endAngle) {\n var isDegree = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n _classCallCheck(this, AngleLerp);\n if (isDegree) {\n this.startAngle = normalize(deg2rad)(startAngle);\n this.endAngle = normalize(deg2rad)(endAngle);\n } else {\n this.startAngle = normalize(startAngle);\n this.endAngle = normalize(endAngle);\n }\n if (this.startAngle > this.endAngle) {\n this.startAngle -= PI2;\n }\n this.diff = this.endAngle - this.startAngle;\n }\n _createClass(AngleLerp, [{\n key: \"get\",\n value: function get(t) {\n return this.startAngle + this.diff * clamp(+t, 0, 1);\n } }]);\n\n return AngleLerp;\n }();\n var PI2 = 2 * Math.PI;\n function normalize(angle) {\n var a = angle % PI2;\n if (a < 0) {\n return PI2 + a;\n } else {\n return a;\n }\n }\n module.exports = {\n AngleLerp: AngleLerp };return module.exports;});", "requires": [ "pandav:/base-utils/utils.js" ], "buildLevel": 8, "outputDir": "/com/submodule-three-3d/1.0.0/base-utils/lib", "outputPath": "/com/submodule-three-3d/1.0.0/base-utils/lib/AngleLerp.js", "fileName": "/base-utils/lib/AngleLerp.js" }, "pandav:/base-utils/EntryComponent.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/base-utils/EntryComponent\", [\"pandav:/npm/react/17.0.2\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils/BaseComponent\"], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _createForOfIteratorHelper(o, allowArrayLike) {var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];if (!it) {if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {if (it) o = it;var i = 0;var F = function F() {};return { s: F, n: function n() {if (i >= o.length) return { done: true };return { done: false, value: o[i++] };}, e: function e(_e) {throw _e;}, f: F };}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");}var normalCompletion = true,didErr = false,err;return { s: function s() {it = it.call(o);}, n: function n() {var step = it.next();normalCompletion = step.done;return step;}, e: function e(_e2) {didErr = true;err = _e2;}, f: function f() {try {if (!normalCompletion && it.return != null) it.return();} finally {if (didErr) throw err;}} };}\n function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === \"Object\" && o.constructor) n = o.constructor.name;if (n === \"Map\" || n === \"Set\") return Array.from(o);if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}\n function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];return arr2;}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n function _callSuper(t, o, e) {return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));}\n function _possibleConstructorReturn(self, call) {if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {return call;} else if (call !== void 0) {throw new TypeError(\"Derived constructors may only return object or undefined\");}return _assertThisInitialized(self);}\n function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");}return self;}\n function _isNativeReflectConstruct() {try {var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));} catch (t) {}return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {return !!t;})();}\n function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}\n function _inherits(subClass, superClass) {if (typeof superClass !== \"function\" && superClass !== null) {throw new TypeError(\"Super expression must either be null or a function\");}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });Object.defineProperty(subClass, \"prototype\", { writable: false });if (superClass) _setPrototypeOf(subClass, superClass);}\n function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}\n var React = require('pandav:/npm/react/17.0.2');\n var _require = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/BaseComponent'),\n BaseComponent = _require.BaseComponent;\n var EntryComponent = function (_BaseComponent) {\n _inherits(EntryComponent, _BaseComponent);\n function EntryComponent(props) {\n var _this;\n _classCallCheck(this, EntryComponent);\n _this = _callSuper(this, EntryComponent, [props]);\n _this.assetsUrl = window.appConfig?.ASSETS_URL;\n return _this;\n }\n _createClass(EntryComponent, [{\n key: \"_refresh\",\n value: function _refresh(props) {\n this.config = props.configuration;\n this._reduceChildrenProps(props);\n this.refresh(props);\n } },\n {\n key: \"_reduceChildrenProps\",\n value: function _reduceChildrenProps(props) {\n var map = new Map();\n var _iterator = _createForOfIteratorHelper(props.childrenConfig),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var e = _step.value;\n map.set(e.id, {\n configuration: e.config,\n id: e.id,\n moduleName: e.comName,\n context: this,\n data: e.data });\n\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n this.childrenPropsMap = map;\n } },\n {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n left = _this$props.left,\n top = _this$props.top,\n width = _this$props.width,\n height = _this$props.height,\n id = _this$props.id;\n var style = {\n pointerEvents: \"none\",\n position: 'absolute',\n left: left,\n top: top,\n width: width,\n height: height,\n textAlign: 'center' };\n\n return React.createElement('div', {\n className: \"__pandav-component\",\n style: style,\n id: id },\n this.renderContent());\n } },\n {\n key: \"renderChildComponent\",\n value: function renderChildComponent(cls, childProps, extraProps) {\n var components = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];\n return React.createElement(cls, Object.assign({\n configuration: childProps.configuration,\n data: childProps.data,\n id: childProps.id,\n parent: this },\n extraProps), components);\n } },\n {\n key: \"renderContent\",\n value: function renderContent() {} },\n {\n key: \"componentWillMount\",\n value: function componentWillMount() {\n this._refresh(this.props);\n this.willMount();\n } },\n {\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(props) {\n this._refresh(props);\n this.willReceiveProps(props);\n } },\n {\n key: \"handleRelative\",\n value: function handleRelative(config, forEach) {\n var log = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n var datas = {};\n try {\n var callbacks = Object.values(config);\n callbacks.forEach(function (o) {\n forEach(datas, o);\n });\n this.props.onRelative(this.props.id, datas);\n } catch (e) {\n if (log) {}\n } finally {\n return datas;\n }\n } },\n {\n key: \"emitCustomEvent\",\n value: function emitCustomEvent(name, data, childId) {\n this.props.emit && this.props.emit(name, data, childId);\n } }]);\n\n return EntryComponent;\n }(BaseComponent);\n module.exports = {\n EntryComponent: EntryComponent };return module.exports;});", "requires": [ "pandav:/base-utils/BaseComponent.js" ], "buildLevel": 16, "outputDir": "/com/submodule-three-3d/1.0.0/base-utils", "outputPath": "/com/submodule-three-3d/1.0.0/base-utils/EntryComponent.js", "fileName": "/base-utils/EntryComponent.js" }, "pandav:/base-utils/lib/AnimationValue.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/AnimationValue\", [], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n var AnimationValue = function () {\n function AnimationValue(value) {\n var enable = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n _classCallCheck(this, AnimationValue);\n this._value = value;\n this.target = null;\n this._curCount = 0;\n this._totalCount = 0;\n this._deltaValue = 0;\n this._enabled = enable;\n this._updateCallback = null;\n }\n _createClass(AnimationValue, [{\n key: \"value\",\n get: function get() {\n return this._value;\n },\n set: function set(v) {\n if (v === this._value) {\n return;\n }\n if (this._enabled && this._totalCount > 0) {\n this.target = v;\n this._curCount = 0;\n this._deltaValue = (v - this._value) / this._totalCount;\n } else {\n this._value = v;\n this._updateCallback && this._updateCallback(this._value);\n }\n } },\n {\n key: \"forceValue\",\n value: function forceValue(t) {\n this._value = t;\n } },\n {\n key: \"enable\",\n get: function get() {\n return this._enabled;\n },\n set: function set(v) {\n if (v == this._enabled) {\n return;\n }\n if (!v) {\n this.stop();\n }\n this._enabled = v;\n } },\n {\n key: \"setDuration\",\n value: function setDuration(v) {\n this._totalCount = v / (1000 / 60);\n this._deltaValue = (this.target - this._value) / this._totalCount;\n } },\n {\n key: \"stop\",\n value: function stop() {\n this._value = this.target;\n this._deltaValue = 0;\n this._curCount = 0;\n this.target = null;\n } },\n {\n key: \"setUpdateCallback\",\n value: function setUpdateCallback(t) {\n this._updateCallback = t;\n } },\n {\n key: \"update\",\n value: function update() {\n if (this.target != null) {\n if (this._curCount < this._totalCount) {\n this._value += this._deltaValue;\n this._curCount++;\n } else {\n this.stop();\n }\n this._updateCallback && this._updateCallback(this._value);\n }\n } }]);\n\n return AnimationValue;\n }();\n module.exports = {\n AnimationValue: AnimationValue };return module.exports;});", "requires": [], "buildLevel": 6, "outputDir": "/com/submodule-three-3d/1.0.0/base-utils/lib", "outputPath": "/com/submodule-three-3d/1.0.0/base-utils/lib/AnimationValue.js", "fileName": "/base-utils/lib/AnimationValue.js" }, "pandav:/base-utils/lib/AngleTransformer.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/AngleTransformer\", [], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n var AngleTransformer = function () {\n function AngleTransformer(angle, center) {\n _classCallCheck(this, AngleTransformer);\n this.angle = angle;\n this.factorX = Math.cos(angle);\n this.fatorY = Math.sin(angle);\n this.center = center;\n }\n _createClass(AngleTransformer, [{\n key: \"getCartesian\",\n value: function getCartesian(t) {\n return [this.factorX * t + this.center[0], this.fatorY * t + this.center[1]];\n } }]);\n\n return AngleTransformer;\n }();\n module.exports = {\n AngleTransformer: AngleTransformer };return module.exports;});", "requires": [], "buildLevel": 7, "outputDir": "/com/submodule-three-3d/1.0.0/base-utils/lib", "outputPath": "/com/submodule-three-3d/1.0.0/base-utils/lib/AngleTransformer.js", "fileName": "/base-utils/lib/AngleTransformer.js" }, "pandav:/base-utils/lib/ColorConicLerp.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/ColorConicLerp\", [], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n var ColorConicLerp = function () {\n function ColorConicLerp(shaderId, stops, rotate, origin) {\n _classCallCheck(this, ColorConicLerp);\n this.rotate = rotate;\n this.origin = origin;\n this.shaderId = shaderId;\n this.parseStops(stops);\n this.shaderData = {\n id: shaderId,\n gradient: this };\n\n }\n _createClass(ColorConicLerp, [{\n key: \"parseStops\",\n value: function parseStops(stops) {\n var firstStop = stops[0];\n var colors = [];\n if (firstStop.offset !== 0) {\n stops.unshift({\n offset: 0,\n color: firstStop.color });\n\n }\n var lastStop = stops[stops.length - 1];\n if (lastStop.offset !== 1) {\n stops.push({\n offset: 1,\n color: lastStop.color });\n\n }\n var remainingStops = 32 - stops.length;\n lastStop = stops[stops.length - 1];\n if (remainingStops < 0) {\n stops = stops.slice(0, 32);\n } else if (remainingStops > 0) {\n for (var i = 0; i < remainingStops; i++) {\n stops.push(lastStop);\n }\n }\n var offsets = [];\n stops.forEach(function (el) {\n offsets.push(el.offset);\n colors = colors.concat(decomposeRadioColor(el.color));\n });\n this.offsets = offsets;\n this.colors = colors;\n } }]);\n\n return ColorConicLerp;\n }();\n function decomposeRadioColor(color) {\n if (typeof color != \"string\") {\n return [];\n }\n var out = [];\n if (color.startsWith(\"#\")) {\n if (color.length < 7) {\n for (var i = 1; i <= 3; i++) {\n var c = color[i];\n out.push(parseInt(c + c, 16));\n }\n } else {\n for (var _i = 1; _i <= 5; _i += 2) {\n out.push(parseInt(color.slice(_i, _i + 2), 16));\n }\n }\n out.push(1);\n } else if (color.startsWith(\"R\") || color.startsWith(\"r\")) {\n out = color.slice(5, -1).split(\",\").map(function (t, e) {\n return 3 == e ? parseFloat(t) : parseFloat(t) / 255;\n });\n } else {\n out = [0, 0, 0, 1];\n }\n return out;\n }\n module.exports = {\n ColorConicLerp: ColorConicLerp };return module.exports;});", "requires": [], "buildLevel": 10, "outputDir": "/com/submodule-three-3d/1.0.0/base-utils/lib", "outputPath": "/com/submodule-three-3d/1.0.0/base-utils/lib/ColorConicLerp.js", "fileName": "/base-utils/lib/ColorConicLerp.js" }, "pandav:/base-utils/lib/ColorLerp.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/ColorLerp\", [\"pandav:/com/submodule-three-3d/1.0.0/base-utils/utils\"], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n var _require = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/utils'),\n decomposeColor = _require.decomposeColor,\n clamp = _require.clamp;\n var ColorLerp = function () {\n function ColorLerp(start, end) {\n _classCallCheck(this, ColorLerp);\n try {\n this.arrStart = decomposeColor(start);\n var arrEnd = decomposeColor(end);\n this.diff = arraySub(arrEnd, this.arrStart);\n } catch (e) {\n console.log(\"解析颜色失败\", e);\n }\n }\n _createClass(ColorLerp, [{\n key: \"get\",\n value: function get(t) {\n t = clamp(t, 0, 1);\n try {\n var c = arrayAdd(this.arrStart, arrayMul(this.diff, t));\n for (var i = 0; i < 3; i++) {\n c[i] = Math.round(c[i]);\n }\n return instantiate(c);\n } catch (e) {\n console.log(\"获取颜色失败\", e);\n return null;\n }\n } }]);\n\n return ColorLerp;\n }();\n function arrayAdd(a, b) {\n var out = [];\n for (var i = 0; i < a.length; i++) {\n out.push(a[i] + b[i]);\n }\n return out;\n }\n function arraySub(a, b) {\n var out = [];\n for (var i = 0; i < a.length; i++) {\n out.push(a[i] - b[i]);\n }\n return out;\n }\n function arrayMul(a, n) {\n var out = [];\n for (var i = 0; i < a.length; i++) {\n out.push(a[i] * n);\n }\n return out;\n }\n function instantiate(arr) {\n return \"rgba(\" + arr.join(\",\") + \")\";\n }\n module.exports = {\n ColorLerp: ColorLerp };return module.exports;});", "requires": [ "pandav:/base-utils/utils.js" ], "buildLevel": 11, "outputDir": "/com/submodule-three-3d/1.0.0/base-utils/lib", "outputPath": "/com/submodule-three-3d/1.0.0/base-utils/lib/ColorLerp.js", "fileName": "/base-utils/lib/ColorLerp.js" }, "pandav:/base-utils/lib/ColorRangeLerp.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/ColorRangeLerp\", [\"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/ColorLerp\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils/utils\"], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n var _require = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/ColorLerp'),\n ColorLerp = _require.ColorLerp;\n var _require2 = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/utils'),\n deepCopy = _require2.deepCopy,\n clamp = _require2.clamp;\n var ColorRangeLerp = function () {\n function ColorRangeLerp(colorRange) {\n _classCallCheck(this, ColorRangeLerp);\n try {\n colorRange = deepCopy(colorRange);\n colorRange.sort(function (a, b) {\n return a.offset - b.offset;\n });\n var range = [];\n for (var i = 0; i < colorRange.length - 1; i++) {\n var t0 = colorRange[i].offset / 100,\n t1 = colorRange[i + 1].offset / 100;\n range.push({\n t0: t0,\n t1: t1,\n dt: t1 - t0,\n lerp: new ColorLerp(colorRange[i].color, colorRange[i + 1].color) });\n\n }\n this.range = range;\n } catch (e) {\n this.range = [];\n console.log(\"解析颜色失败\", e);\n }\n }\n _createClass(ColorRangeLerp, [{\n key: \"get\",\n value: function get(t) {\n try {\n t = clamp(t, 0, 1);\n var range = this.range;\n for (var i = 0; i < range.length; i++) {\n var r = range[i];\n if (t >= r.t0 && t <= r.t1) {\n return r.lerp.get((t - r.t0) / r.dt);\n }\n }\n return null;\n } catch (e) {\n console.log(\"获取颜色失败\", e);\n return null;\n }\n } }]);\n\n return ColorRangeLerp;\n }();\n module.exports = {\n ColorRangeLerp: ColorRangeLerp };return module.exports;});", "requires": [ "pandav:/base-utils/lib/ColorLerp.js", "pandav:/base-utils/utils.js" ], "buildLevel": 0, "outputDir": "/com/submodule-three-3d/1.0.0/base-utils/lib", "outputPath": "/com/submodule-three-3d/1.0.0/base-utils/lib/ColorRangeLerp.js", "fileName": "/base-utils/lib/ColorRangeLerp.js" }, "pandav:/base-utils/lib/ColorLerp2.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/ColorLerp2\", [\"pandav:/npm/lodash/4.6.1\"], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _createForOfIteratorHelper(o, allowArrayLike) {var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];if (!it) {if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {if (it) o = it;var i = 0;var F = function F() {};return { s: F, n: function n() {if (i >= o.length) return { done: true };return { done: false, value: o[i++] };}, e: function e(_e) {throw _e;}, f: F };}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");}var normalCompletion = true,didErr = false,err;return { s: function s() {it = it.call(o);}, n: function n() {var step = it.next();normalCompletion = step.done;return step;}, e: function e(_e2) {didErr = true;err = _e2;}, f: function f() {try {if (!normalCompletion && it.return != null) it.return();} finally {if (didErr) throw err;}} };}\n function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === \"Object\" && o.constructor) n = o.constructor.name;if (n === \"Map\" || n === \"Set\") return Array.from(o);if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}\n function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];return arr2;}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n var _ = require('pandav:/npm/lodash/4.6.1');\n var ColorLerp2 = function () {\n function ColorLerp2(props) {\n _classCallCheck(this, ColorLerp2);\n this.range = [];\n this.parse(props);\n }\n _createClass(ColorLerp2, [{\n key: \"get\",\n value: function get(color) {\n if (this.pure) {\n return this.pure;\n }\n color = judgeNumber(color, 0, 1);\n var _iterator = _createForOfIteratorHelper(this.range),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var e = _step.value;\n var n = (color - e.pos) / e.step;\n if (n >= 0 && n <= 1) {\n return \"rgba(\" + colorAdd(e.start, colorRide(e.diff, n)).join(\",\") + \")\";\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n return null;\n } },\n {\n key: \"parse\",\n value: function parse(data) {\n if (!data.type) return this.pure = data;\n var stops = data.value.stops;\n if (stops.length < 2) return;\n var stopList = _.cloneDeep(stops);\n stopList.sort(function (t, e) {\n return t.offset - e.offset;\n });\n stopList[0].offset > 0 && stopList.unshift({\n offset: 0,\n color: stopList[0].color });\n\n var s = stopList[stopList.length - 1];\n s.offset < 100 && stopList.push({\n offset: 100,\n color: s.color });\n\n for (var _t = 0; _t < stopList.length - 1; _t++) {\n var start = getRgbaNumber(getRgbaColor(stopList[_t].color, 1));\n var end = getRgbaNumber(getRgbaColor(stopList[_t + 1].color, 1));\n var pos = stopList[_t].offset / 100;\n this.range.push({\n pos: pos,\n step: stopList[_t + 1].offset / 100 - pos,\n start: start,\n end: end,\n diff: colorCut(end, start) });\n\n }\n } }]);\n\n return ColorLerp2;\n }();\n function getRgbaNumber(color) {\n if (\"string\" != typeof color) return [];\n var arr = [];\n if (color.startsWith(\"#\")) {\n if (color.length < 7) {\n for (var n = 1; n <= 3; n++) {\n var i = color[n];\n arr.push(parseInt(i + i, 16));\n }\n } else {\n for (var _n = 1; _n <= 5; _n += 2) {\n arr.push(parseInt(color.slice(_n, _n + 2), 16));\n }\n }\n arr.push(1);\n } else {\n arr = color.startsWith(\"R\") || color.startsWith(\"r\") ? color.slice(5, -1).split(\",\").map(function (color) {\n return parseFloat(color);\n }) : [0, 0, 0, 1];\n }\n return arr;\n }\n function getRgbaColor(t, e) {\n var number = getRgbaNumber(t);\n return number[3] *= e, \"rgba(\".concat(number.join(\",\"), \")\");\n }\n function judgeNumber(num, max, min) {\n num > min && (t = min);\n num < max && (num = max);\n return num;\n }\n function colorAdd(t, e) {\n var arr = [];\n for (var i = 0; i < t.length; i++) {\n arr.push(t[i] + e[i]);\n }\n return arr;\n }\n function colorCut(t, e) {\n var arr = [];\n for (var i = 0; i < t.length; i++) {\n arr.push(t[i] - e[i]);\n }\n return arr;\n }\n function colorRide(t, e) {\n var arr = [];\n for (var i = 0; i < t.length; i++) {\n arr.push(t[i] * e);\n }\n return arr;\n }\n module.exports = {\n ColorLerp2: ColorLerp2 };return module.exports;});", "requires": [], "buildLevel": 12, "outputDir": "/com/submodule-three-3d/1.0.0/base-utils/lib", "outputPath": "/com/submodule-three-3d/1.0.0/base-utils/lib/ColorLerp2.js", "fileName": "/base-utils/lib/ColorLerp2.js" }, "pandav:/base-utils/lib/EventList.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/EventList\", [], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n var EventList = function () {\n function EventList() {\n _classCallCheck(this, EventList);\n this._list = [];\n this._removeList = [];\n this._loop = false;\n this._clearFlag = false;\n }\n _createClass(EventList, [{\n key: \"add\",\n value: function add(callback) {\n if (this._list.indexOf(callback) < 0) {\n this._list.push(callback);\n }\n } },\n {\n key: \"remove\",\n value: function remove(callback) {\n if (this._loop) {\n this._removeList.push(callback);\n } else {\n var _list = this._list;\n _list.splice(_list.indexOf(callback), 1);\n }\n } },\n {\n key: \"invoke\",\n value: function invoke() {\n this._loop = true;\n var _list = this._list;\n for (var i = 0; i < _list.length; i++) {\n _list[i].apply(_list, arguments);\n }\n this._loop = false;\n this.handleRemoveList();\n } },\n {\n key: \"handleRemoveList\",\n value: function handleRemoveList() {\n if (this._clearFlag) {\n this._list = [];\n this._removeList = [];\n this._clearFlag = false;\n return;\n }\n if (this._removeList.length <= 0) {\n return;\n }\n var _removeList = this._removeList,\n _list = this._list;\n for (var i = 0; i < _removeList.length; i++) {\n _list.splice(_list.indexOf(_removeList[i]), 1);\n }\n this._removeList = [];\n } },\n {\n key: \"clear\",\n value: function clear() {\n if (this._loop) {\n this._clearFlag = true;\n } else {\n this._list = [];\n }\n } }]);\n\n return EventList;\n }();\n module.exports = {\n EventList: EventList };return module.exports;});", "requires": [], "buildLevel": 9, "outputDir": "/com/submodule-three-3d/1.0.0/base-utils/lib", "outputPath": "/com/submodule-three-3d/1.0.0/base-utils/lib/EventList.js", "fileName": "/base-utils/lib/EventList.js" }, "pandav:/base-utils/lib/Hook.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/Hook\", [\"pandav:/npm/lodash/4.6.1\"], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n var _ = require('pandav:/npm/lodash/4.6.1');\n var Hook = function () {\n function Hook() {\n _classCallCheck(this, Hook);\n this.itemMap = new Map();\n }\n _createClass(Hook, [{\n key: \"do\",\n value: function _do(id, callback, deepVars, shallowVars) {\n var item = this.itemMap.get(id);\n if (!this.itemMap.has(id)) {\n item = new HookItem();\n this.itemMap.set(id, item);\n }\n item.execute(callback, deepVars, shallowVars);\n return item.return;\n } }]);\n\n return Hook;\n }();\n var HookItem = function () {\n function HookItem() {\n _classCallCheck(this, HookItem);\n this.deepVars = null;\n this.shallowVars = null;\n this.return = undefined;\n }\n _createClass(HookItem, [{\n key: \"invoke\",\n value: function invoke(callback) {} },\n {\n key: \"execute\",\n value: function execute(callback, deepVars, shallowVars) {\n var _deepVars, _shallowVars, _flag;\n if (deepVars && !Array.isArray(deepVars)) {\n _deepVars = deepVars.deep;\n _shallowVars = deepVars.shallow;\n _flag = deepVars.flag;\n } else {\n _deepVars = deepVars;\n _shallowVars = shallowVars;\n }\n if (this.differ(_deepVars, _shallowVars, _flag)) {\n this.return = callback(this.deepVars || [], this.shallowVars || []);\n }\n this.deepVars = _.cloneDeep(_deepVars);\n this.shallowVars = _.cloneDeep(_shallowVars);\n } },\n {\n key: \"differ\",\n value: function differ(deepVars, shallowVars, flag) {\n if (flag) {\n for (var i = 0; i < flag.length; i++) {\n if (flag[i]) {\n return true;\n }\n }\n }\n if (this.deepVars === null && this.shallowVars === null && !flag) {\n return true;\n }\n if (shallowVars) {\n for (var _i = 0; _i < shallowVars.length; _i++) {\n if (shallowVars[_i] !== this.shallowVars[_i]) {\n return true;\n }\n }\n }\n if (deepVars) {\n for (var _i2 = 0; _i2 < deepVars.length; _i2++) {\n if (!_.isEqual(deepVars[_i2], this.deepVars[_i2])) {\n return true;\n }\n }\n }\n return false;\n } }]);\n\n return HookItem;\n }();\n module.exports = {\n Hook: Hook };return module.exports;});", "requires": [], "buildLevel": 5, "outputDir": "/com/submodule-three-3d/1.0.0/base-utils/lib", "outputPath": "/com/submodule-three-3d/1.0.0/base-utils/lib/Hook.js", "fileName": "/base-utils/lib/Hook.js" }, "pandav:/base-utils/lib/MultiColorLerp.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/MultiColorLerp\", [\"pandav:/com/submodule-three-3d/1.0.0/base-utils/utils\"], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _createForOfIteratorHelper(o, allowArrayLike) {var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];if (!it) {if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {if (it) o = it;var i = 0;var F = function F() {};return { s: F, n: function n() {if (i >= o.length) return { done: true };return { done: false, value: o[i++] };}, e: function e(_e) {throw _e;}, f: F };}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");}var normalCompletion = true,didErr = false,err;return { s: function s() {it = it.call(o);}, n: function n() {var step = it.next();normalCompletion = step.done;return step;}, e: function e(_e2) {didErr = true;err = _e2;}, f: function f() {try {if (!normalCompletion && it.return != null) it.return();} finally {if (didErr) throw err;}} };}\n function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === \"Object\" && o.constructor) n = o.constructor.name;if (n === \"Map\" || n === \"Set\") return Array.from(o);if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}\n function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];return arr2;}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n var _require = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/utils'),\n decomposeColor = _require.decomposeColor,\n deepCopy = _require.deepCopy,\n clamp = _require.clamp,\n colorMulOpacity = _require.colorMulOpacity;\n var MultiColorLerp = function () {\n function MultiColorLerp(props) {\n _classCallCheck(this, MultiColorLerp);\n this.range = [];\n this.parse(props);\n }\n _createClass(MultiColorLerp, [{\n key: \"get\",\n value: function get(t) {\n if (this.pure) {\n return this.pure;\n }\n t = clamp(t, 0, 1);\n var _iterator = _createForOfIteratorHelper(this.range),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var rangeItem = _step.value;\n var _t = (t - rangeItem.pos) / rangeItem.step;\n if (_t >= 0 && _t <= 1) {\n return instantiate(arrayAdd(rangeItem.start, arrayMul(rangeItem.diff, _t)));\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n return null;\n } },\n {\n key: \"parse\",\n value: function parse(gradientColor) {\n if (gradientColor.type !== \"linearGradient\") {\n this.pure = gradientColor;\n return;\n }\n var _gradientColor$value = gradientColor.value,\n originStops = _gradientColor$value.stops,\n _gradientColor$value$ = _gradientColor$value.opacity,\n opacity = _gradientColor$value$ === void 0 ? 1 : _gradientColor$value$;\n if (originStops.length < 2) {\n return;\n }\n var stops = deepCopy(originStops);\n stops.sort(function (a, b) {\n return a.offset - b.offset;\n });\n if (stops[0].offset > 0) {\n stops.unshift({\n offset: 0,\n color: stops[0].color });\n\n }\n var last = stops[stops.length - 1];\n if (last.offset < 100) {\n stops.push({\n offset: 100,\n color: last.color });\n\n }\n for (var i = 0; i < stops.length - 1; i++) {\n var start = decomposeColor(colorMulOpacity(stops[i].color, opacity));\n var end = decomposeColor(colorMulOpacity(stops[i + 1].color, opacity));\n var pos = stops[i].offset / 100;\n this.range.push({\n pos: pos,\n step: stops[i + 1].offset / 100 - pos,\n start: start,\n end: end,\n diff: arraySub(end, start) });\n\n }\n } }]);\n\n return MultiColorLerp;\n }();\n function arrayAdd(a, b) {\n var out = [];\n for (var i = 0; i < a.length; i++) {\n out.push(a[i] + b[i]);\n }\n return out;\n }\n function arraySub(a, b) {\n var out = [];\n for (var i = 0; i < a.length; i++) {\n out.push(a[i] - b[i]);\n }\n return out;\n }\n function arrayMul(a, n) {\n var out = [];\n for (var i = 0; i < a.length; i++) {\n out.push(a[i] * n);\n }\n return out;\n }\n function instantiate(arr) {\n return \"rgba(\" + arr.join(\",\") + \")\";\n }\n module.exports = {\n MultiColorLerp: MultiColorLerp };return module.exports;});", "requires": [ "pandav:/base-utils/utils.js" ], "buildLevel": 14, "outputDir": "/com/submodule-three-3d/1.0.0/base-utils/lib", "outputPath": "/com/submodule-three-3d/1.0.0/base-utils/lib/MultiColorLerp.js", "fileName": "/base-utils/lib/MultiColorLerp.js" }, "pandav:/src/editor/ChildComponentEditor/ChildComponentDataMgr.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/src/editor/ChildComponentEditor/ChildComponentDataMgr\", [\"pandav:/com/submodule-three-3d/1.0.0/src/editor/common/SerializedDataMgr\", \"pandav:/com/submodule-three-3d/1.0.0/src/lib/MappedList\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/Hook\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils/utils\", \"pandav:/com/submodule-three-3d/1.0.0/src/editor/ChildComponentEditor/ChildComponentEditorDefine\", \"pandav:/com/submodule-three-3d/1.0.0/src/lib/md5\", \"pandav:/com/three/0.145.0\", \"pandav:/com/submodule-three-3d/1.0.0/src/utils\"], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n function _callSuper(t, o, e) {return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));}\n function _possibleConstructorReturn(self, call) {if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {return call;} else if (call !== void 0) {throw new TypeError(\"Derived constructors may only return object or undefined\");}return _assertThisInitialized(self);}\n function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");}return self;}\n function _isNativeReflectConstruct() {try {var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));} catch (t) {}return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {return !!t;})();}\n function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}\n function _inherits(subClass, superClass) {if (typeof superClass !== \"function\" && superClass !== null) {throw new TypeError(\"Super expression must either be null or a function\");}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });Object.defineProperty(subClass, \"prototype\", { writable: false });if (superClass) _setPrototypeOf(subClass, superClass);}\n function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}\n var _require = require('pandav:/com/submodule-three-3d/1.0.0/src/editor/common/SerializedDataMgr'),\n SerializedDataMgr = _require.SerializedDataMgr;\n var _require2 = require('pandav:/com/submodule-three-3d/1.0.0/src/lib/MappedList'),\n MappedList = _require2.MappedList;\n var _require3 = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/Hook'),\n Hook = _require3.Hook;\n var _require4 = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/utils'),\n deepCopy = _require4.deepCopy;\n var _require5 = require('pandav:/com/submodule-three-3d/1.0.0/src/editor/ChildComponentEditor/ChildComponentEditorDefine'),\n LocateMode = _require5.LocateMode;\n var _require6 = require('pandav:/com/submodule-three-3d/1.0.0/src/lib/md5'),\n b64_md5 = _require6.b64_md5;\n var THREE = require('pandav:/com/three/0.145.0');\n var _require7 = require('pandav:/com/submodule-three-3d/1.0.0/src/utils'),\n traverseGeojsonShape = _require7.traverseGeojsonShape;\n var ChildComponentDataMgr = function (_SerializedDataMgr) {\n _inherits(ChildComponentDataMgr, _SerializedDataMgr);\n function ChildComponentDataMgr(opt) {\n var _this;\n _classCallCheck(this, ChildComponentDataMgr);\n _this = _callSuper(this, ChildComponentDataMgr, [opt]);\n _this.configDataMd5 = \"\";\n _this.hook = new Hook();\n _this.needAddFirstPoint = undefined;\n _this.geojsonUrl = null;\n _this.singlePointPathId = \"single-point\";\n return _this;\n }\n _createClass(ChildComponentDataMgr, [{\n key: \"getSinglePointData\",\n value: function getSinglePointData() {\n return this.tmpData.get(this.singlePointPathId).points;\n } },\n {\n key: \"setRuntimeGeojson\",\n value: function setRuntimeGeojson(json) {\n if (json) {\n var t = new Map();\n try {\n this.parsePathFromGeojson(json, t);\n } catch (e) {\n return void console.log(\"不合法的geojson\", e);\n }\n this.setRuntimeData(t);\n } else this.setRuntimeData(null);\n } },\n {\n key: \"parsePathFromGeojson\",\n value: function parsePathFromGeojson(json, t) {\n traverseGeojsonShape(json, function (points) {\n var pathId = THREE.MathUtils.generateUUID();\n var pointMap = new Map();\n for (var i = 0; i < points.length; i++) {\n var pointId = THREE.MathUtils.generateUUID();\n var pointData = {\n id: pointId,\n name: \"\",\n customId: \"\" };\n\n var lnglat = points[i].slice();\n pointData.lnglat = lnglat;\n pointMap.set(pointId, pointData);\n }\n t.set(pathId, {\n id: pathId,\n customId: \"\",\n name: \"\",\n position: [0, 0, 0],\n points: new MappedList(pointMap),\n etag: THREE.MathUtils.generateUUID() });\n\n });\n } },\n {\n key: \"updatePathETag\",\n value: function updatePathETag(e) {\n var data = this.getPathData(e);\n data ? data.etag = THREE.MathUtils.generateUUID() : console.warn(\"unexpected\");\n } },\n {\n key: \"deseralize\",\n value: function deseralize() {\n var _serializedData = this.context.config.editor?._serializedData;\n this.tmpData.clear();\n if (_serializedData) {\n var t;\n try {\n t = JSON.parse(_serializedData);\n } catch (e) {\n return console.log(\"反序列化失败\", e);\n }\n this.configDataMd5 = t.configDataMd5 || \"\";\n for (var n in t.paths) {\n var a = t.paths[n];\n this.tmpData.set(n, {\n id: a.id,\n customId: \"\",\n name: \"\",\n position: [0, 0, 0],\n source: a.source,\n userData: a.userData,\n points: new MappedList(deepCopy(a.points)),\n etag: THREE.MathUtils.generateUUID() });\n\n }\n this.context.isPointsEditor && this.tmpData.size <= 0 && this.tmpData.set(this.singlePointPathId, {\n id: this.singlePointPathId,\n customId: \"\",\n name: \"\",\n position: [0, 0, 0],\n points: new MappedList([]),\n etag: THREE.MathUtils.generateUUID() });\n\n this.invalidateConfigData();\n undefined !== t.locateMode && this.context.locateMode !== t.locateMode && this.onLocateModeChange(t.locateMode);\n } else {\n this.context.isPointsEditor && this.tmpData.set(this.singlePointPathId, {\n id: this.singlePointPathId,\n customId: \"\",\n name: \"\",\n position: [0, 0, 0],\n points: new MappedList([]),\n etag: THREE.MathUtils.generateUUID() });\n\n }\n this.tmpData.forEach(function (e) {\n e.points.list.forEach(function (e) {\n undefined !== e.lnglat && undefined === e.lnglat[2] && (e.lnglat[2] = 0);\n });\n });\n this.copyTmpDataToSerializedData();\n this.version++;\n } },\n {\n key: \"onLocateModeChange\",\n value: function onLocateModeChange(e) {\n e == LocateMode.World ? this.lnglatToWorld() : this.worldToLnglat();\n } },\n {\n key: \"refresh\",\n value: function refresh() {\n var that = this;\n var coordTransform = this.context.context.coordTransform;\n var locateMode = this.context.locateMode;\n var _serializedData = this.context.config.editor?._serializedData;\n var deserialized = false;\n this.hook.do(\"initSerializedDataMgr\", function () {\n that.deseralize();\n that.needsSerialize = true;\n deserialized = true;\n }, [_serializedData]);\n if (null !== this.geojsonUrl && this.context.locateMode === LocateMode.Lnglat) {\n var needRefreshConfigData = false;\n var configGeojsonStr = this.context.assetsMgr.get(this.geojsonUrl);\n var configDataMd5 = b64_md5(configGeojsonStr || \"\");\n this.geojsonUrl ? configDataMd5 !== this.configDataMd5 && (needRefreshConfigData = true) : this.configDataMd5 && (needRefreshConfigData = true);\n this.hook.do(\"refreshConfigData\", function () {\n if (configGeojsonStr) {\n var configGeojson;\n try {\n configGeojson = JSON.parse(configGeojsonStr);\n } catch (e) {\n return void console.log(\"配置项中的geojson解析失败\", e);\n }\n var list = [];\n traverseGeojsonShape(configGeojson, function (points, index, feature) {\n var pathId = THREE.MathUtils.generateUUID();\n var pointMap = new Map();\n for (var i = 0; i < points.length; i++) {\n var pointId = THREE.MathUtils.generateUUID();\n var pointData = {\n id: pointId,\n name: \"\",\n customId: \"\" };\n\n var slnglat = points[i].slice();\n pointData.lnglat = slnglat;\n pointMap.set(pointId, pointData);\n }\n list.push({\n id: pathId,\n properties: feature?.properties,\n customId: \"\",\n name: \"\",\n position: [0, 0, 0],\n source: configDataMd5,\n points: new MappedList(pointMap),\n etag: THREE.MathUtils.generateUUID() });\n\n });\n that.addConfigData(list);\n that.configDataMd5 = configDataMd5;\n } else {\n that.configDataMd5 = \"\";\n }\n that.invalidateConfigData();\n that.needsSerialize = true;\n }, {\n flag: [needRefreshConfigData] });\n\n }\n this.hook.do(\"coordTransformChange\", function () {\n deserialized || locateMode === LocateMode.World && that.tmpData.forEach(function (e) {\n if (e.source === that.configDataMd5) {\n var list = e.points.list;\n for (var i = 0; i < list.length; i++) {\n var lnglat = list[i].lnglat;\n coordTransform.toWorld(tmpVec3_0.set(lnglat[0], 0, lnglat[1]), tmpVec3_0);\n list[i].position = tmpVec3_0.toArray();\n }\n that.needsSerialize = true;\n }\n });\n }, undefined, [coordTransform.uuid]);\n var curLocateMode = locateMode;\n this.hook.do(\"locateModeChange\", function () {\n deserialized || (that.onLocateModeChange(curLocateMode), that.needsSerialize = true);\n }, undefined, [curLocateMode]);\n this.serialize(false);\n } },\n {\n key: \"lnglatToWorld\",\n value: function lnglatToWorld() {\n var that = this;\n var coordTransform = this.context.context.coordTransform;\n this.tmpData.forEach(function (n) {\n var list = n.points.list;\n for (var i = 0; i < list.length; i++) {\n var r = list[i].lnglat;\n coordTransform.toWorld(tmpVec3_0.set(r[0], 0, r[1]), tmpVec3_0);\n n.source !== that.configDataMd5 && delete list[i].lnglat;\n list[i].position = tmpVec3_0.toArray();\n }\n });\n } },\n {\n key: \"worldToLnglat\",\n value: function worldToLnglat() {\n var that = this;\n var coordTransform = this.context.context.coordTransform;\n this.tmpData.forEach(function (n) {\n if (n.source !== that.configDataMd5) {\n var list = n.points.list;\n for (var i = 0; i < list.length; i++) {\n var r = tmpVec3_0.fromArray(list[i].position);\n var o = coordTransform.toLnglat(r, []);\n delete list[i].position;\n list[i].lnglat = o;\n }\n }\n });\n } },\n {\n key: \"invalidateConfigData\",\n value: function invalidateConfigData() {\n var curConfigDataMd5 = this.configDataMd5;\n var values = Array.from(this.tmpData.values());\n for (var n = 0; n < values.length; n++) {\n undefined !== values[n].source && values[n].source !== curConfigDataMd5 && this.tmpData.delete(values[n].id);\n }\n } },\n {\n key: \"addConfigData\",\n value: function addConfigData(e) {\n var that = this;\n e.forEach(function (e) {\n that.tmpData.set(e.id, e);\n });\n } },\n {\n key: \"serialize\",\n value: function serialize() {\n var force = !(arguments.length > 0 && undefined !== arguments[0]) || arguments[0];\n (force || this.needsSerialize) && this.copyTmpDataToSerializedData();\n } },\n {\n key: \"saveJSON\",\n value: function saveJSON() {\n var json = {};\n var paths = {};\n this.tmpData.forEach(function (e, n) {\n paths[n] = {\n id: e.id,\n source: e.source,\n points: e.points.list,\n customId: e.customId,\n name: e.name,\n userData: e.userData,\n position: e.position };\n\n });\n json.paths = paths;\n json.configDataMd5 = this.configDataMd5;\n json.locateMode = this.context.locateMode;\n console.log(\"序列化\", json);\n var updateConfig = this.context.context.props.updateConfig;\n updateConfig && updateConfig({\n type: \"config\",\n id: this.context.props.id,\n payload: [{\n path: [\"editor\", \"_serializedData\"],\n value: JSON.stringify(data) }] });\n\n\n } }]);\n\n return ChildComponentDataMgr;\n }(SerializedDataMgr);\n var tmpVec3_0 = new THREE.Vector3();\n module.exports = {\n ChildComponentDataMgr: ChildComponentDataMgr };return module.exports;});", "requires": [ "pandav:/src/editor/common/SerializedDataMgr.js", "pandav:/src/lib/MappedList.js", "pandav:/base-utils/lib/Hook.js", "pandav:/base-utils/utils.js", "pandav:/src/editor/ChildComponentEditor/ChildComponentEditorDefine.js", "pandav:/src/lib/md5.js", "pandav:/src/utils.js" ], "buildLevel": 7, "outputDir": "/com/submodule-three-3d/1.0.0/src/editor/ChildComponentEditor", "outputPath": "/com/submodule-three-3d/1.0.0/src/editor/ChildComponentEditor/ChildComponentDataMgr.js", "fileName": "/src/editor/ChildComponentEditor/ChildComponentDataMgr.js" }, "pandav:/src/editor/ChildComponentEditor/ChildComponentEditorDefine.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/src/editor/ChildComponentEditor/ChildComponentEditorDefine\", [], function (module, exports, require, load, process, global) {\n\n var LocateMode = {\n Lnglat: 1,\n World: 2 };\n\n module.exports = {\n LocateMode: LocateMode };return module.exports;});", "requires": [], "buildLevel": 9, "outputDir": "/com/submodule-three-3d/1.0.0/src/editor/ChildComponentEditor", "outputPath": "/com/submodule-three-3d/1.0.0/src/editor/ChildComponentEditor/ChildComponentEditorDefine.js", "fileName": "/src/editor/ChildComponentEditor/ChildComponentEditorDefine.js" }, "pandav:/base-utils/lib/ContentEditable.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/ContentEditable\", [\"pandav:/npm/react/17.0.2\", \"pandav:/npm/lodash/4.6.1\"], function (module, exports, require, load, process, global) {\n\n function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}\n function _nonIterableRest() {throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");}\n function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === \"Object\" && o.constructor) n = o.constructor.name;if (n === \"Map\" || n === \"Set\") return Array.from(o);if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}\n function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];return arr2;}\n function _iterableToArrayLimit(r, l) {var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}\n function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}\n var React = require('pandav:/npm/react/17.0.2');\n var memo = React.memo,\n useState = React.useState,\n useCallback = React.useCallback,\n useEffect = React.useEffect;\n var _ = require('pandav:/npm/lodash/4.6.1');\n function getDeepDom(dom) {\n if (dom.children.length !== 0) {\n return getDeepDom(dom.children[0]);\n }\n return dom;\n }\n ;\n function getChildren(children) {\n var nodes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n return Array.from(children).reduce(function (prev, child) {\n if (child.childNodes && child.childNodes.length && child.childNodes[0].nodeType == 3) {\n prev.push(child);\n } else {\n return getChildren(child.children, prev);\n }\n return prev;\n }, nodes);\n }\n ;\n function setAttribute(props) {\n var node = props.node,\n index = props.index,\n onBlur = props.onBlur,\n onKeyDown = props.onKeyDown,\n editable = props.editable;\n node.style.outline = 'none';\n node.suppressContentEditableWarning = true;\n node.contentEditable = editable;\n node.index = index;\n node.addEventListener('blur', onBlur);\n node.addEventListener('keydown', onKeyDown);\n }\n ;\n var ContentEditable = memo(function (props) {\n var oldData = props.oldData,\n editable = props.editable,\n updateConfig = props.updateConfig,\n id = props.id,\n children = props.children,\n _props$style = props.style,\n style = _props$style === void 0 ? {} : _props$style;\n var _useState = useState(oldData),\n _useState2 = _slicedToArray(_useState, 2),\n data = _useState2[0],\n setData = _useState2[1];\n var _useState3 = useState(null),\n _useState4 = _slicedToArray(_useState3, 2),\n ref = _useState4[0],\n setRef = _useState4[1];\n var onBlur = useCallback(function (e) {\n var _e$currentTarget = e.currentTarget,\n index = _e$currentTarget.index,\n innerHTML = _e$currentTarget.innerHTML;\n var _data = data.length > 0 ? data.map(function (item, i) {\n return i == index ? _.assign({}, item, {\n text: innerHTML }) :\n item;\n }) : [{\n text: innerHTML }];\n\n updateConfig && updateConfig({\n id: id,\n type: 'data',\n payload: _data });\n\n setData(_data);\n }, [data, updateConfig, id]);\n var onKeyDown = useCallback(function (e) {\n if (e.which == 13) {\n e.stopPropagation();\n e.preventDefault();\n return;\n }\n }, []);\n useEffect(function () {\n if (ref) {\n var _children2 = ref.children && getChildren(ref.children);\n var childrenLength = _children2 && _children2.length;\n var _children = childrenLength > 0 ? _children2 : [getDeepDom(ref)];\n editable && _children.forEach(function (child, index) {\n setAttribute({\n node: child,\n index: index,\n onKeyDown: onKeyDown,\n onBlur: onBlur,\n editable: editable });\n\n });\n return function () {\n _children.forEach(function (child, index) {\n child.contentEditable = false;\n child.removeEventListener('blur', onBlur);\n child.removeEventListener('keydown', onKeyDown);\n });\n };\n }\n }, [ref, onBlur, onKeyDown, editable]);\n return editable ? React.createElement(\"div\", {\n style: _.assign({}, style, {\n pointerEvents: 'auto',\n cursor: 'auto' }),\n\n ref: setRef },\n children) : children;\n });\n module.exports = {\n ContentEditable: ContentEditable };return module.exports;});", "requires": [], "buildLevel": 13, "outputDir": "/com/submodule-three-3d/1.0.0/base-utils/lib", "outputPath": "/com/submodule-three-3d/1.0.0/base-utils/lib/ContentEditable.js", "fileName": "/base-utils/lib/ContentEditable.js" }, "pandav:/src/EObjectContainer.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/src/EObjectContainer\", [\"pandav:/npm/lodash/4.6.1\"], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n var _ = require('pandav:/npm/lodash/4.6.1');\n var EObjectContainer = function () {\n function EObjectContainer(context, cls) {\n _classCallCheck(this, EObjectContainer);\n this.list = [];\n this._cls = undefined;\n this.map = new Map();\n this.onCreateEObject = null;\n this.onDetroyEObject = null;\n this._cls = cls;\n }\n _createClass(EObjectContainer, [{\n key: \"clear\",\n value: function clear() {\n this.list.forEach(function (e) {\n return e.dispose();\n });\n this.list = [];\n this.map.clear();\n } },\n {\n key: \"forceRefreshElement\",\n value: function forceRefreshElement(id) {\n var item = this.map.get(id);\n if (item) {\n item.obj.refresh(item.props);\n }\n } },\n {\n key: \"refresh\",\n value: function refresh(propsList) {\n var _this = this;\n var comparePolicy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var lastMap = this.map;\n this.map = new Map();\n var map = this.map,\n _cls = this._cls;\n propsList.forEach(function (props) {\n var last = lastMap.get(props.id);\n if (!last) {\n var c = props._cls || _cls;\n var obj;\n if (_this.onCreateEObject) {\n obj = _this.onCreateEObject(props);\n } else {\n obj = new c();\n }\n map.set(props.id, {\n obj: obj,\n props: props,\n relatives: comparePolicy.relatives });\n\n obj.create(props);\n } else {\n map.set(props.id, {\n obj: last.obj,\n props: props,\n relatives: comparePolicy.relatives });\n\n _this.isPropsEqual(props, last.props, comparePolicy) && _this.isRelativesEqual(comparePolicy.relatives, last.relatives);\n last.obj.refresh(props);\n }\n });\n lastMap.forEach(function (_ref, id) {\n var obj = _ref.obj;\n if (!map.has(id)) {\n obj.dispose();\n if (_this.onDetroyEObject) {\n _this.onDetroyEObject(obj);\n }\n }\n });\n this.list = Array.from(map.values()).map(function (e) {\n return e.obj;\n });\n } },\n {\n key: \"isRelativesEqual\",\n value: function isRelativesEqual(cur, last) {\n if (!cur || !last) {\n return cur == last;\n }\n if (cur == last) {\n return true;\n }\n if (cur.length != last.length) {\n return false;\n }\n for (var i = 0, l = cur.length; i < l; i++) {\n if (!_.isEqual(cur[i], last[i])) {\n return false;\n }\n }\n return true;\n } },\n {\n key: \"isPropsEqual\",\n value: function isPropsEqual(cur, last, comparePolicy) {\n if (comparePolicy) {\n var _cur = {},\n _last = {};\n Object.assign(_cur, cur);\n Object.assign(_last, last);\n if (comparePolicy.ref) {\n deleteObjectKeys(_cur, comparePolicy.ref);\n deleteObjectKeys(_last, comparePolicy.ref);\n }\n if (comparePolicy.deep) {\n var deepCur = moveObjectKeys(_cur, comparePolicy.deep);\n var deepLast = moveObjectKeys(_last, comparePolicy.deep);\n if (!isShallowEqual(_cur, _last)) {\n return false;\n }\n return _.isEqual(deepCur, deepLast);\n } else {\n return isShallowEqual(_cur, _last);\n }\n } else {\n return isShallowEqual(cur, last);\n }\n } },\n {\n key: \"getItemInstance\",\n value: function getItemInstance(id) {\n var item = this.map.get(id);\n if (item) {\n return item.obj;\n } else {\n return null;\n }\n } }]);\n\n return EObjectContainer;\n }();\n function moveObjectKeys(source, keys) {\n var out = {};\n var k;\n for (var i = 0, l = keys.length; i < l; i++) {\n k = keys[i];\n if (out[k] == undefined) {\n out[k] = source[k];\n delete source[k];\n }\n }\n return out;\n }\n function deleteObjectKeys(source, keys) {\n for (var i = 0, l = keys.length; i < l; i++) {\n delete source[keys[i]];\n }\n }\n function isShallowEqual(a, b) {\n if (_typeof(a) != \"object\" || _typeof(b) != \"object\") {\n return false;\n }\n var akeys = Object.keys(a),\n bkeys = Object.keys(b);\n if (akeys.length != bkeys.length) {\n return false;\n }\n for (var i = 0; i < akeys.length; i++) {\n var k = akeys[i];\n if (a[k] !== b[k]) {\n return false;\n }\n }\n return true;\n }\n module.exports = {\n EObjectContainer: EObjectContainer };return module.exports;});", "requires": [], "buildLevel": 4, "outputDir": "/com/submodule-three-3d/1.0.0/src", "outputPath": "/com/submodule-three-3d/1.0.0/src/EObjectContainer.js", "fileName": "/src/EObjectContainer.js" }, "pandav:/src/AssetsMgr.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/src/AssetsMgr\", [\"pandav:/com/submodule-three-3d/1.0.0/src/utils\", \"pandav:/com/submodule-canvas/1.0.0\", \"pandav:/com/three/0.145.0\", \"pandav:/com/three/0.145.0/examples/jsm/loaders/RGBELoader\", \"pandav:/com/three/0.145.0/examples/jsm/loaders/GLTFLoader\", \"pandav:/com/three/0.145.0/examples/jsm/loaders/DRACOLoader\", \"pandav:/com/three/0.145.0/examples/jsm/example\"], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n var _require = require('pandav:/com/submodule-three-3d/1.0.0/src/utils'),\n getModelFormat = _require.getModelFormat;\n var _require2 = require('pandav:/com/submodule-canvas/1.0.0'),\n BaseCanvas = _require2.BaseCanvas;\n var THREE = require('pandav:/com/three/0.145.0');\n var _require3 = require('pandav:/com/three/0.145.0/examples/jsm/loaders/RGBELoader'),\n RGBELoader = _require3.RGBELoader;\n var _require4 = require('pandav:/com/three/0.145.0/examples/jsm/loaders/GLTFLoader'),\n GLTFLoader = _require4.GLTFLoader;\n var _require5 = require('pandav:/com/three/0.145.0/examples/jsm/loaders/DRACOLoader'),\n DRACOLoader = _require5.DRACOLoader;\n var _require6 = require('pandav:/com/three/0.145.0/examples/jsm/example'),\n FBXLoader = _require6.FBXLoader,\n KTX2Loader = _require6.KTX2Loader,\n DDSLoader = _require6.DDSLoader,\n TGALoader = _require6.TGALoader;\n var TextureFormatType = {\n Image: 1,\n DynamicImage: 2,\n Video: 3,\n RGBE: 4,\n DDS: 5,\n KTX2: 6,\n TGA: 7 };\n\n function getTextureFormatType(url) {\n var suffix = getFileSuffix(url);\n if (suffix) {\n return TextureFormatTypeMap[suffix];\n } else {\n return null;\n }\n }\n var TextureFormatTypeMap = {\n jpg: TextureFormatType.Image,\n jpeg: TextureFormatType.Image,\n jfif: TextureFormatType.Image,\n pjpeg: TextureFormatType.Image,\n pjp: TextureFormatType.Image,\n png: TextureFormatType.Image,\n webp: TextureFormatType.Image,\n bmp: TextureFormatType.Image,\n ico: TextureFormatType.Image,\n cur: TextureFormatType.Image,\n gif: TextureFormatType.DynamicImage,\n avif: TextureFormatType.DynamicImage,\n apng: TextureFormatType.DynamicImage,\n mpeg: TextureFormatType.Video,\n mp4: TextureFormatType.Video,\n webm: TextureFormatType.Video,\n hdr: TextureFormatType.RGBE,\n dds: TextureFormatType.DDS,\n ktx2: TextureFormatType.KTX2,\n tga: TextureFormatType.TGA };\n\n function isTransparentAssets(url) {\n var suffix = getFileSuffix(url);\n if (suffix) {\n return suffix === \"png\" || suffix === \"webp\" || suffix === \"webm\";\n } else {\n return false;\n }\n }\n var AssetsMgr = function () {\n function AssetsMgr() {\n _classCallCheck(this, AssetsMgr);\n var that = this;\n this.isLoading = false;\n this.loader = new AssetsLoader(this);\n this.onLoaded = function () {};\n this.nullImage = null;\n this.nullTexture = undefined;\n this.onAssetsLoaded = null;\n this.redrawCaches = new Map();\n this.createNullImage();\n this.nullTexture = new THREE.Texture(this.nullImage);\n this.nullTexture.needsUpdate = true;\n this.loader.onLoaded = function () {\n that.isLoading = false;\n that.onLoaded();\n };\n }\n _createClass(AssetsMgr, [{\n key: \"init\",\n value: function init(renderer) {\n this.loader.init(renderer);\n } },\n {\n key: \"createNullImage\",\n value: function createNullImage() {\n var canvas = document.createElement(\"canvas\");\n canvas.width = 2;\n canvas.height = 2;\n var ctx = canvas.getContext(\"2d\");\n ctx.globalAlpha = 0;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n this.nullImage = canvas;\n } },\n {\n key: \"getTextureImage\",\n value: function getTextureImage(url, width, height) {\n if (width != undefined) {\n var key = url + \"_\" + width + \"_\" + height;\n var tmp = this.redrawCaches.get(key);\n if (!tmp) {\n var img = this.get(url);\n if (!img) {\n return this.nullImage;\n } else {\n var canvas = new BaseCanvas(width, height);\n canvas.drawImage(img, 0, 0, width, height);\n this.redrawCaches.set(key, canvas.dom);\n return canvas.dom;\n }\n }\n return tmp;\n } else {\n return this.get(url) || this.nullImage;\n }\n } },\n {\n key: \"get\",\n value: function get(url) {\n if (url) {\n var item = this.loader.responseMap.get(url);\n if (item) {\n return item.res;\n }\n }\n return null;\n } },\n {\n key: \"getTexture\",\n value: function getTexture(url) {\n return this.get(url);\n } },\n {\n key: \"getModelAssets\",\n value: function getModelAssets(url) {\n if (url) {\n var item = this.loader.responseMap.get(url);\n if (item && item.type === \"model\") {\n return Object.assign(Object.assign({}, item.res), {}, {\n scene: item.res.scene.clone() });\n\n }\n }\n return null;\n } },\n {\n key: \"push\",\n value: function push(type, urlList) {\n this.loader.push(type, urlList);\n } },\n {\n key: \"loadAsset\",\n value: function loadAsset(type, url) {\n return this.loader.loadAsset(type, url);\n } },\n {\n key: \"removeAssets\",\n value: function removeAssets(e) {\n return !!e && this.loader.removeAssets(e);\n } },\n {\n key: \"load\",\n value: function load() {\n this.isLoading = true;\n this.loader.load();\n } },\n {\n key: \"dispose\",\n value: function dispose() {\n this.loader.dispose();\n this.nullTexture.dispose();\n } }]);\n\n return AssetsMgr;\n }();\n var AssetsLoader = function () {\n function AssetsLoader(context) {\n _classCallCheck(this, AssetsLoader);\n this.requestMap = new Map();\n this.pendingMap = new Map();\n this.responseMap = new Map();\n this.responseCount = 0;\n this.requestCount = 0;\n this.onLoaded = function () {};\n this.rgbeLoader = new RGBELoader();\n this.gltfLoader = new GLTFLoader();\n this.dracoLoader = new DRACOLoader();\n this.fbxLoader = new FBXLoader();\n this.videoElementList = [];\n this.ifcLoader = undefined;\n this.ktx2Loader = new KTX2Loader();\n this.ddsLoader = new DDSLoader();\n this.textureLoader = new THREE.TextureLoader();\n this.tgaLoader = new TGALoader();\n this.disposeList = [];\n this.isIFCInited = false;\n this.loadCallbackMap = new Map();\n this.context = context;\n this.dracoLoader.setDecoderPath(\"components/static-image/borderMap3dV2/draco/\");\n this.gltfLoader.setDRACOLoader(this.dracoLoader);\n }\n _createClass(AssetsLoader, [{\n key: \"init\",\n value: function init(renderer) {\n var ktx2Loader = this.ktx2Loader;\n ktx2Loader.setTranscoderPath(\"components/static-image/borderMap3dV2/basis/\");\n ktx2Loader.detectSupport(renderer);\n } },\n {\n key: \"push\",\n value: function push(type, urlList) {\n var that = this;\n urlList.forEach(function (url) {\n if (url && typeof url === \"string\" && !that.pendingMap.has(url) && !that.responseMap.has(url)) {\n that.requestMap.set(url, {\n url: url,\n type: type });\n\n }\n });\n } },\n {\n key: \"loadAsset\",\n value: function loadAsset(e, url) {\n var that = this;\n return new Promise(function (resolve, reject) {\n if (url && \"string\" == typeof url) {\n if (that.responseMap.has(url)) {\n var r = that.responseMap.get(url).res;\n null !== r ? resolve(r) : reject(\"加载失败\");\n } else {\n if (null !== that.responseMap.get(url)) {\n var o = that.loadCallbackMap.get(url);\n o || (o = [], that.loadCallbackMap.set(url, o)), o.push(function (e) {\n null !== e ? resolve(e) : reject(\"加载失败\");\n });\n that.loadItem(e, url) || reject(\"发起请求失败\");\n } else {\n reject(\"加载失败\");\n }\n }\n } else {\n reject(\"invalid url\");\n }\n });\n } },\n {\n key: \"onAssetsLoaded\",\n value: function onAssetsLoaded(item) {\n item.res ? this.responseMap.set(item.url, item) : this.responseMap.set(item.url, null);\n var that = this;\n if (this.pendingMap.has(item.url)) {\n this.responseCount++;\n this.pendingMap.delete(item.url);\n this.context.onAssetsLoaded?.(this.responseCount, this.requestCount);\n if (this.responseCount >= this.requestCount) {\n that.onLoaded();\n that.requestCount = 0;\n that.responseCount = 0;\n }\n } else {\n var info = this.loadCallbackMap.get(item.url);\n if (info) {\n for (var a = 0; a < info.length; a++) {\n info[a](item.res);\n }\n this.loadCallbackMap.delete(item.url);\n }\n }\n } },\n {\n key: \"load\",\n value: function load() {\n var that = this;\n if (this.requestMap.size === 0 && this.pendingMap.size === 0) {\n that.onLoaded();\n return;\n }\n this.requestMap.forEach(function (el) {\n var url = el.url,\n type = el.type;\n if (!that.pendingMap.has(url) && !that.pendingMap.has(url)) {\n that.loadItem(type, url);\n that.pendingMap.set(url, true);\n that.requestCount++;\n }\n });\n this.requestMap.clear();\n } },\n {\n key: \"loadItem\",\n value: function loadItem(type, url) {\n var that = this;\n switch (type) {\n case \"common\":\n that.loadCommon(url);\n break;\n case \"HTMLVideoElement\":\n that.loadVideo(url);\n break;\n case \"HTMLImageElement\":\n that.loadImage(url);\n break;\n case \"shp\":\n that.loadShp(url);\n break;\n case \"model\":\n {\n var _format = getModelFormat(url);\n if (_format === \"gltf\") {\n that.loadGLTF(url);\n } else if (_format === \"fbx\") {\n that.loadFBX(url);\n }\n break;\n }\n case \"bim\":\n that.loadIFC(url);\n break;\n case \"texture\":\n {\n var suffix = getFileSuffix(url);\n var formatType = null;\n if (suffix) {\n formatType = TextureFormatTypeMap[suffix];\n }\n if (formatType === null) {\n if (suffix) {\n console.warn(\"不支持的文件格式\", suffix);\n } else {\n console.warn(\"无法识别文件后缀\");\n }\n break;\n }\n switch (formatType) {\n case TextureFormatType.DDS:\n that.loadDDS(url);\n break;\n case TextureFormatType.KTX2:\n that.loadKTX2(url);\n break;\n case TextureFormatType.RGBE:\n that.loadRGBE(url);\n break;\n case TextureFormatType.Image:\n case TextureFormatType.DynamicImage:\n that.loadImageTexture(url);\n break;\n case TextureFormatType.Video:\n that.loadVideoTexture(url);\n break;\n case TextureFormatType.TGA:\n that.loadTGA(url);\n break;\n default:\n console.log(\"unexpected\");\n break;}\n\n break;\n }\n default:\n console.warn(\"invalid assets loader type\");\n break;}\n\n } },\n {\n key: \"loadRGBE\",\n value: function loadRGBE(url) {\n var that = this;\n this.rgbeLoader.load(url, function (tex) {\n that.disposeList.push(tex);\n that.onAssetsLoaded({\n url: url,\n res: tex,\n type: \"texture\" });\n\n }, undefined, function (err) {\n console.warn(\"load RGBE file fail\", url, err);\n that.onAssetsLoaded({\n url: url,\n res: null,\n type: \"texture\" });\n\n });\n } },\n {\n key: \"loadImage\",\n value: function loadImage(url) {\n var that = this;\n var img = document.createElement(\"img\");\n img.crossOrigin = \"anonymous\";\n img.src = url;\n img.onload = function () {\n that.onAssetsLoaded({\n url: url,\n res: img,\n type: \"HTMLImageElement\" });\n\n };\n img.onerror = function () {\n console.warn(\"load image fail\", url);\n that.onAssetsLoaded({\n url: url,\n res: null,\n type: \"HTMLImageElement\" });\n\n };\n } },\n {\n key: \"loadCommon\",\n value: function loadCommon(url) {\n var that = this;\n var fetchData = function fetchData(url) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return new Promise(function (resolve, reject) {\n var defaultOptions = {\n method: \"GET\",\n headers: {},\n responseType: \"text\" };\n\n var mergedOptions = Object.assign({}, defaultOptions, options);\n var xhr = new XMLHttpRequest();\n xhr.open(mergedOptions.method, url, true);\n xhr.responseType = mergedOptions.responseType;\n for (var header in mergedOptions.headers) {\n xhr.setRequestHeader(header, mergedOptions.headers[header]);\n }\n xhr.send();\n xhr.onload = function () {\n resolve(xhr);\n };\n xhr.onerror = function () {\n reject(xhr);\n };\n });\n };\n fetchData(url).then(function (response) {\n that.onAssetsLoaded({\n url: url,\n res: response.response,\n type: \"common\" });\n\n }, function () {\n console.warn(\"load common assets fail\", url);\n that.onAssetsLoaded({\n url: url,\n res: null,\n type: \"common\" });\n\n });\n } },\n {\n key: \"loadVideo\",\n value: function loadVideo(url) {\n var that = this;\n var video = document.createElement(\"video\");\n video.crossOrigin = \"anonymous\";\n video.src = url;\n video.oncanplay = function () {\n that.onAssetsLoaded({\n url: url,\n res: video,\n type: \"HTMLVideoElement\" });\n\n };\n video.onerror = function () {\n console.warn(\"load video fail\", url);\n that.onAssetsLoaded({\n url: url,\n res: null,\n type: \"HTMLVideoElement\" });\n\n };\n this.videoElementList.push(video);\n } },\n {\n key: \"loadShp\",\n value: function loadShp(url) {} },\n {\n key: \"loadGLTF\",\n value: function loadGLTF(url) {\n var that = this;\n this.gltfLoader.load(url, function (gltf) {\n reduceMaterial(gltf);\n that.onAssetsLoaded({\n url: url,\n res: gltf,\n type: \"model\" });\n\n console.log(\"gltf\", gltf);\n }, undefined, function (err) {\n console.warn(\"load gltf file fail\", url, err);\n that.onAssetsLoaded({\n url: url,\n res: null,\n type: \"model\" });\n\n });\n } },\n {\n key: \"loadFBX\",\n value: function loadFBX(url) {\n var that = this;\n this.fbxLoader.load(url, function (fbx) {\n reduceMaterial(fbx);\n that.onAssetsLoaded({\n url: url,\n res: fbx,\n type: \"model\" });\n\n }, undefined, function (err) {\n console.warn(\"load fbx file fail\", url, err);\n that.onAssetsLoaded({\n url: url,\n res: null,\n type: \"model\" });\n\n });\n } },\n {\n key: \"loadIFC\",\n value: function loadIFC(url) {\n var that = this;\n if (!this.isIFCInited) {\n this.initIFCLoader().then(function () {\n that._loadIFC(url);\n }, function () {\n that.onAssetsLoaded({\n url: url,\n res: null,\n type: \"bim\" });\n\n });\n } else {\n this._loadIFC(url);\n }\n } },\n {\n key: \"_loadIFC\",\n value: function _loadIFC(url) {\n var that = this;\n this.ifcLoader.load(url, function (model) {\n that.onAssetsLoaded({\n url: url,\n res: model,\n type: \"bim\" });\n\n }, undefined, function (err) {\n console.warn(\"load ifc file fail\", url, err);\n that.onAssetsLoaded({\n url: url,\n res: null,\n type: \"bim\" });\n\n });\n } },\n {\n key: \"loadKTX2\",\n value: function loadKTX2(url) {\n var that = this;\n this.ktx2Loader.load(url, function (tex) {\n that.disposeList.push(tex);\n that.onAssetsLoaded({\n url: url,\n res: tex,\n type: \"texture\" });\n\n }, undefined, function (err) {\n console.warn(\"load ktx2 file fail\", url, err);\n that.onAssetsLoaded({\n url: url,\n res: null,\n type: \"texture\" });\n\n });\n } },\n {\n key: \"loadDDS\",\n value: function loadDDS(url) {\n var that = this;\n this.ddsLoader.load(url, function (tex) {\n that.disposeList.push(tex);\n that.onAssetsLoaded({\n url: url,\n res: tex,\n type: \"texture\" });\n\n }, undefined, function (err) {\n console.warn(\"load dds file fail\", url, err);\n that.onAssetsLoaded({\n url: url,\n res: null,\n type: \"texture\" });\n\n });\n } },\n {\n key: \"loadImageTexture\",\n value: function loadImageTexture(url) {\n var that = this;\n this.textureLoader.load(url, function (tex) {\n that.disposeList.push(tex);\n that.onAssetsLoaded({\n url: url,\n res: tex,\n type: \"texture\" });\n\n }, undefined, function (err) {\n console.warn(\"load image texture file fail\", url, err);\n that.onAssetsLoaded({\n url: url,\n res: null,\n type: \"texture\" });\n\n });\n } },\n {\n key: \"loadVideoTexture\",\n value: function loadVideoTexture(url) {\n var that = this;\n var video = document.createElement(\"video\");\n video.crossOrigin = \"anonymous\";\n video.src = url;\n video.oncanplay = function () {\n video.loop = true;\n video.autoplay = true;\n video.muted = true;\n video.play();\n var texture = new THREE.VideoTexture(video);\n texture.generateMipmaps = false;\n texture.format = THREE.RGBAFormat;\n texture.needsUpdate = true;\n that.disposeList.push(texture);\n that.onAssetsLoaded({\n url: url,\n res: texture,\n type: \"texture\" });\n\n };\n video.onerror = function () {\n console.warn(\"load video fail\", url);\n that.onAssetsLoaded({\n url: url,\n res: null,\n type: \"texture\" });\n\n };\n this.videoElementList.push(video);\n } },\n {\n key: \"loadTGA\",\n value: function loadTGA(url) {\n var that = this;\n this.tgaLoader.load(url, function (res) {\n that.disposeList.push(res);\n that.onAssetsLoaded({\n url: url,\n res: res,\n type: \"texture\" });\n\n }, undefined, function (n) {\n console.warn(\"load dds file fail\", e, n);\n that.onAssetsLoaded({\n url: url,\n res: null,\n type: \"texture\" });\n\n });\n } },\n {\n key: \"dispose\",\n value: function dispose() {\n this.ktx2Loader.dispose();\n this.dracoLoader.dispose();\n this.disposeModelAssets();\n for (var i = 0; i < this.disposeList.length; i++) {\n this.disposeList[i].dispose();\n }\n this.videoElementList.forEach(function (v) {\n v.autoplay = false;\n v.pause();\n });\n this.videoElementList = [];\n this.responseMap.clear();\n } },\n {\n key: \"disposeModelAssets\",\n value: function disposeModelAssets() {\n this.responseMap.forEach(function (item) {\n if (item.type === \"model\") {\n var modelAssets = item.res;\n modelAssets.geometries.forEach(function (geo) {\n geo.dispose();\n });\n modelAssets.materials.forEach(function (mat) {\n mat.dispose();\n });\n modelAssets.skeletons.forEach(function (ske) {\n ske.dispose();\n });\n modelAssets.textures.forEach(function (tex) {\n tex.dispose();\n });\n }\n });\n } }]);\n\n return AssetsLoader;\n }();\n function getFileSuffix(file) {\n var index = file.lastIndexOf(\".\");\n if (index < 0) {\n return null;\n } else {\n var suffix = file.slice(index + 1);\n if (suffix) {\n return suffix.toLowerCase();\n } else {\n return null;\n }\n }\n }\n function reduceMaterial(modelAssets) {\n modelAssets.materials.forEach(function (mat) {\n if (mat.transparent) {\n mat.depthWrite = false;\n } else {\n mat.depthWrite = true;\n }\n if (mat.alphaTest > 0) {\n mat.alphaToCoverage = true;\n } else {\n mat.alphaToCoverage = false;\n }\n mat.needsUpdate = true;\n });\n }\n module.exports = {\n TextureFormatType: TextureFormatType,\n getTextureFormatType: getTextureFormatType,\n isTransparentAssets: isTransparentAssets,\n AssetsMgr: AssetsMgr };return module.exports;});", "requires": [ "pandav:/src/utils.js" ], "buildLevel": 6, "outputDir": "/com/submodule-three-3d/1.0.0/src", "outputPath": "/com/submodule-three-3d/1.0.0/src/AssetsMgr.js", "fileName": "/src/AssetsMgr.js" }, "pandav:/src/editor/common/SerializedDataMgr.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/src/editor/common/SerializedDataMgr\", [\"pandav:/com/submodule-three-3d/1.0.0/src/lib/MappedList\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils/utils\", \"pandav:/com/three/0.145.0\"], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n var _require = require('pandav:/com/submodule-three-3d/1.0.0/src/lib/MappedList'),\n MappedList = _require.MappedList;\n var _require2 = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/utils'),\n deepCopy = _require2.deepCopy;\n var THREE = require('pandav:/com/three/0.145.0');\n var SerializedDataMgr = function () {\n function SerializedDataMgr(context) {\n _classCallCheck(this, SerializedDataMgr);\n this.serializedData = new Map();\n this.tmpData = new Map();\n this.version = 0;\n this.context = void 0;\n this.runtimeData = null;\n this.needsSerialize = false;\n this.context = context;\n }\n _createClass(SerializedDataMgr, [{\n key: \"setRuntimeData\",\n value: function setRuntimeData(data) {\n this.runtimeData = data;\n } },\n {\n key: \"forEachData\",\n value: function forEachData(callbackfn) {\n if (this.runtimeData) {\n this.runtimeData.forEach(callbackfn);\n } else {\n this.tmpData.forEach(callbackfn);\n }\n } },\n {\n key: \"getPathData\",\n value: function getPathData(pathId) {\n return this.tmpData.get(pathId) || null;\n } },\n {\n key: \"getPointData\",\n value: function getPointData(pathId, pointId) {\n var pathData = this.getPathData(pathId);\n if (pathData) {\n return pathData.points.map.get(pointId) || null;\n }\n return null;\n } },\n {\n key: \"copyTmpDataToSerializedData\",\n value: function copyTmpDataToSerializedData() {\n var that = this;\n this.serializedData.clear();\n this.tmpData.forEach(function (t, n) {\n that.serializedData.set(n, {\n id: t.id,\n customId: \"\",\n name: \"\",\n position: [0, 0, 0],\n source: t.source,\n userData: t.userData,\n points: new MappedList(deepCopy(t.points.list)),\n etag: THREE.MathUtils.generateUUID() });\n\n });\n } },\n {\n key: \"addPoint\",\n value: function addPoint(pathId, index, data) {\n var pathData = this.tmpData.get(pathId);\n pathData.points.list.splice(index, 0, data);\n pathData.points.updateList();\n pathData.etag = THREE.MathUtils.generateUUID();\n this.version++;\n } },\n {\n key: \"getFirsetPath\",\n value: function getFirsetPath() {\n return this.tmpData.values().next().value || null;\n } },\n {\n key: \"deletePoint\",\n value: function deletePoint(id, pointId) {\n var pathData = this.tmpData.get(id);\n if (pathData) {\n var pointData = pathData.points.map.get(pointId);\n if (pointData) {\n var index = pathData.points.list.findIndex(function (e) {\n return e.id === pointId;\n });\n if (index >= 0) {\n pathData.points.list.splice(index, 1);\n pathData.points.updateList();\n pathData.etag = THREE.MathUtils.generateUUID();\n this.version++;\n return {\n index: index,\n data: pointData };\n\n }\n }\n }\n return null;\n } },\n {\n key: \"modifyPoint\",\n value: function modifyPoint(pathId, pointId, dstData) {\n var pointData = this.tmpData.get(pathId);\n if (pointData) {\n if (pointData.points.map.get(pointId)) {\n deepAssignObject(i, dstData);\n pointData.etag = THREE.MathUtils.generateUUID();\n this.version++;\n }\n }\n } },\n {\n key: \"getPoint\",\n value: function getPoint(pathId, pointId) {\n var pathData = this.tmpData.get(pathId);\n if (pathData) {\n var pointData = pathData.points.map.get(pointId);\n if (pointData) {\n return pointData;\n }\n }\n return null;\n } },\n {\n key: \"getSerializedPoint\",\n value: function getSerializedPoint(pathId, pointId) {\n var serializedPathData = this.serializedData.get(pathId);\n if (serializedPathData) {\n var pointData = serializedPathData.points.map.get(pointId);\n if (pointData) {\n return pointData;\n }\n }\n return null;\n } },\n {\n key: \"deletePath\",\n value: function deletePath(id) {\n var pathData = this.tmpData.get(id);\n if (pathData) {\n this.tmpData[\"delete\"](id);\n this.version++;\n return pathData;\n }\n return null;\n } },\n {\n key: \"addPath\",\n value: function addPath(pathId, pathData) {\n this.tmpData.set(pathId, pathData);\n this.version++;\n } }]);\n\n return SerializedDataMgr;\n }();\n function deepAssignObject(target, partial) {\n for (var k in target) {\n var targetValue = target[k];\n var partialValue = partial[k];\n if (partialValue === undefined) {\n continue;\n }\n if (_typeof(partialValue) === \"object\" && _typeof(targetValue) === \"object\") {\n deepAssignObject(targetValue, partialValue);\n } else {\n target[k] = partialValue;\n }\n }\n }\n module.exports = {\n SerializedDataMgr: SerializedDataMgr };return module.exports;});", "requires": [ "pandav:/src/lib/MappedList.js", "pandav:/base-utils/utils.js" ], "buildLevel": 8, "outputDir": "/com/submodule-three-3d/1.0.0/src/editor/common", "outputPath": "/com/submodule-three-3d/1.0.0/src/editor/common/SerializedDataMgr.js", "fileName": "/src/editor/common/SerializedDataMgr.js" }, "pandav:/base-utils/utils.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/base-utils/utils\", [\"pandav:/npm/react/17.0.2\"], function (module, exports, require, load, process, global) {\n\n function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}\n function _nonIterableSpread() {throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");}\n function _iterableToArray(iter) {if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);}\n function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}\n function _nonIterableRest() {throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");}\n function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === \"Object\" && o.constructor) n = o.constructor.name;if (n === \"Map\" || n === \"Set\") return Array.from(o);if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}\n function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];return arr2;}\n function _iterableToArrayLimit(r, l) {var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}\n function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}\n var React = require('pandav:/npm/react/17.0.2');\n function handleRelative(props, config, forEach) {\n var log = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n var datas = {};\n try {\n var callbacks = Object.values(config);\n callbacks.forEach(function (o) {\n forEach(datas, o);\n });\n props.onRelative(props.id, datas);\n } catch (e) {\n if (log) {\n console.log(\"handleRelative fail\", e);\n }\n } finally {\n return datas;\n }\n }\n function emitCustomEvent(props, name, data, childId) {\n props.emit && props.emit(name, data, childId);\n }\n function handleChartRelative(props, config, data) {\n var fieldName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : \"callback\";\n return handleRelative(props, config, function (callbackDatas, callback) {\n callbackDatas[callback.target] = data[callback.origin];\n }, fieldName);\n }\n function arrayToMap(configArray, keyName) {\n var out = {};\n for (var _i = 0, _Object$values = Object.values(configArray); _i < _Object$values.length; _i++) {\n var i = _Object$values[_i];\n var k = i[keyName];\n if (k || k == 0) {\n out[k] = i;\n }\n }\n return out;\n }\n function parseTextStyle(config) {\n var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"dom\";\n if (config) {\n if (type == \"canvas\") {\n var font = \"\";\n config.italic && (font += \"italic \");\n config.bold && (font += \"bold \");\n font += config.fontSize + \"px \";\n font += config.fontFamily;\n return font;\n } else {\n var fontFamily = config.fontFamily,\n fontSize = config.fontSize,\n italic = config.italic,\n fontWeight = config.fontWeight,\n letterSpacing = config.letterSpacing,\n lineHeight = config.lineHeight;\n var out = {\n fontFamily: fontFamily,\n fontSize: fontSize && fontSize + \"px\",\n fontStyle: italic,\n fontWeight: fontWeight,\n letterSpacing: letterSpacing && letterSpacing + \"px\",\n lineHeight: lineHeight && lineHeight + \"px\" };\n\n if (\"font-setting\" === type) {\n out.fontSize = fontSize;\n delete out.letterSpacing;\n delete out.lineHeight;\n return out;\n } else {\n if (\"svg\" === type) {\n out.fill = config.color;\n } else if (\"dom\" === type) {\n out.color = config.color;\n }\n return out;\n }\n }\n } else {\n return {};\n }\n }\n function parseShadow(config) {\n if (config.spread != undefined) {\n return \"\".concat(config.hShadow, \"px \").concat(config.vShadow, \"px \").concat(config.blur, \"px \").concat(config.spread, \" \").concat(config.color, \" \");\n } else {\n return \"\".concat(config.hShadow, \"px \").concat(config.vShadow, \"px \").concat(config.blur, \"px \").concat(config.color, \" \");\n }\n }\n function parseMulticolor(type, config, a, b, c, d, e) {\n switch (type) {\n case \"svg\":\n return parseMulticolorSVG(config, a);\n case \"dom\":\n return parseMultiColorDom(config);\n case \"canvas\":\n return parseMulticolorCanvas(config, a, b, c, d, e);\n case \"common\":\n return parseMulticolorCommon(config);}\n\n }\n function parseMulticolorCommon(config) {\n if (config.type !== \"linearGradient\") {\n return [{\n offset: 0,\n color: config }];\n\n } else {\n var _config$value = config.value,\n stops = _config$value.stops,\n _config$value$opacity = _config$value.opacity,\n opacity = _config$value$opacity === void 0 ? 1 : _config$value$opacity,\n angle = _config$value.angle;\n var _stops = deepCopy(stops);\n _stops.sort(function (a, b) {\n return a.offset - b.offset;\n });\n return _stops.map(function (e) {\n return {\n offset: e.offset,\n color: colorMulOpacity(e.color, opacity) };\n\n });\n }\n }\n function getRectAndLinePoint(x1, y1, width, height, angle) {\n var x2 = x1 + width,\n y2 = y1 + height;\n var k = Math.tan(angle);\n var cx = x1 + width / 2,\n cy = y1 + height / 2;\n var p1, p2;\n var y, x;\n function fx(x) {\n return k * (x - cx) + cy;\n }\n x = x1, y = fx(x1);\n if (y >= y1 && y <= y2) {\n p1 = [x, y];\n p2 = [x2, fx(x2)];\n } else {\n var fy = function fy(y) {\n return (y - cy) / k + cx;\n };\n p1 = [fy(y1), y1];\n p2 = [fy(y2), y2];\n }\n return [p1, p2];\n }\n function parseMulticolorCanvas(config, ctx, x, y, width, height) {\n if (config.type == \"pure\") {\n return config.pure;\n } else {\n var _config$linear = config.linear,\n angle = _config$linear.angle,\n stops = _config$linear.stops,\n opacity = _config$linear.opacity;\n var _getRectAndLinePoint = getRectAndLinePoint(x, y, width, height, deg2rad(angle + 90)),\n _getRectAndLinePoint2 = _slicedToArray(_getRectAndLinePoint, 2),\n p1 = _getRectAndLinePoint2[0],\n p2 = _getRectAndLinePoint2[1];\n var gradient = ctx.createLinearGradient(p1[0], p1[1], p2[0], p2[1]);\n var _stops = deepCopy(stops);\n _stops.sort(function (a, b) {\n return a.offset - b.offset;\n });\n for (var i = 0; i < _stops.length; i++) {\n var _stops$i = _stops[i],\n offset = _stops$i.offset,\n color = _stops$i.color;\n gradient.addColorStop(offset / 100, colorMulOpacity(color, opacity));\n }\n return gradient;\n }\n }\n function parseMulticolorSVG(config, id) {\n if (config.type == \"linearGradient\") {\n var _config$value2 = config.value,\n angle = _config$value2.angle,\n stops = _config$value2.stops,\n opacity = _config$value2.opacity;\n var start = [0, 0],\n end = [1, 0];\n if (angle) {\n var center = [0.5, 0];\n start = pointRotate(start, center, deg2rad(angle));\n end = pointRotate(end, center, deg2rad(angle));\n }\n var _stops = deepCopy(stops);\n _stops.sort(function (a, b) {\n return a.offset - b.offset;\n });\n return {\n fill: \"url(#\".concat(id, \")\"),\n def: React.createElement(\"linearGradient\", {\n id: id,\n x1: start[0] * 100 + \"%\",\n y1: start[1] * 100 + \"%\",\n x2: end[0] * 100 + \"%\",\n y2: end[1] * 100 + \"%\" },\n _stops.map(function (e) {\n return React.createElement(\"stop\", {\n key: e.offset,\n offset: e.offset / 100,\n stopColor: e.color,\n stopOpacity: opacity });\n\n })) };\n\n } else {\n return {\n fill: config };\n\n }\n }\n function parseMultiColorDom(config) {\n var out = \"\";\n if (config.type == \"linearGradient\") {\n var _config$value3 = config.value,\n angle = _config$value3.angle,\n stops = _config$value3.stops,\n _config$value3$opacit = _config$value3.opacity,\n opacity = _config$value3$opacit === void 0 ? 1 : _config$value3$opacit;\n out += \"linear-gradient(\".concat(angle, \"deg, \");\n var _stops = deepCopy(stops);\n _stops.sort(function (a, b) {\n return a.offset - b.offset;\n });\n out += _stops.map(function (s) {\n return colorMulOpacity(s.color, opacity) + \" \" + s.offset + \"%\";\n }).join(\",\");\n out += \")\";\n return out;\n } else {\n return config.pure;\n }\n }\n function mergeObject(source, target) {\n if (_typeof(source) != \"object\" || _typeof(target) != \"object\") {\n return;\n }\n var keys = Object.keys(source);\n for (var i = 0; i < keys.length; i++) {\n var k = keys[i];\n var v = source[k];\n var type = _typeof(v);\n if (type == \"object\") {\n if (target[k] == undefined) {\n target[k] = {};\n }\n mergeObject(v, target[k]);\n } else {\n target[k] = v;\n }\n }\n }\n function deepCopy(obj) {\n if (obj && _typeof(obj) == \"object\") {\n var o;\n if (Array.isArray(obj)) {\n o = [];\n for (var i = 0; i < obj.length; i++) {\n o.push(deepCopy(obj[i]));\n }\n } else {\n o = {};\n Object.keys(obj).forEach(function (k) {\n o[k] = deepCopy(obj[k]);\n });\n }\n return o;\n } else {\n return obj;\n }\n }\n function isEqual(a, b) {\n if (a === b) {\n return true;\n }\n if (_typeof(a) != \"object\" || _typeof(b) != \"object\") {\n return a === b;\n } else {\n if (a == null || b == null) {\n return a === b;\n }\n var akeys = Object.keys(a),\n bkeys = Object.keys(b);\n if (akeys.length != bkeys.length) {\n return false;\n }\n for (var i = 0; i < akeys.length; i++) {\n var k = akeys[i];\n if (!isEqual(a[k], b[k])) {\n return false;\n }\n }\n return true;\n }\n }\n function pointRotate(point, center, angle) {\n var x = point[0],\n y = point[1],\n rx = center[0],\n ry = center[1],\n cos = Math.cos(angle),\n sin = Math.sin(angle);\n var x0 = (x - rx) * cos - (y - ry) * sin + rx;\n var y0 = (x - rx) * sin + (y - ry) * cos + ry;\n return [x0, y0];\n }\n function lerp(min, max, t) {\n return (max - min) * t;\n }\n function clamp(v, min, max) {\n if (v > max) {\n v = max;\n }\n if (v < min) {\n v = min;\n }\n return v;\n }\n var AngleTransfromRatio = 180 / Math.PI;\n function rad2deg(rad) {\n return rad * AngleTransfromRatio;\n }\n function deg2rad(deg) {\n return deg / AngleTransfromRatio;\n }\n function decomposeColor(color) {\n if (typeof color != \"string\") {\n return [];\n }\n var out = [];\n if (color.startsWith(\"#\")) {\n if (color.length < 7) {\n for (var i = 1; i <= 3; i++) {\n var c = color[i];\n out.push(parseInt(c + c, 16));\n }\n } else {\n for (var _i2 = 1; _i2 <= 5; _i2 += 2) {\n out.push(parseInt(color.slice(_i2, _i2 + 2), 16));\n }\n }\n out.push(1);\n } else if (color.startsWith(\"R\") || color.startsWith(\"r\")) {\n out = color.slice(5, -1).split(\",\").map(function (e) {\n return parseFloat(e);\n });\n } else {\n out = [0, 0, 0, 1];\n }\n return out;\n }\n function cssColorToHexNumber(color) {\n var coms = decomposeColor(color);\n var out = \"0x\";\n for (var i = 0; i < coms.length - 1; i++) {\n var s = coms[i].toString(16);\n if (s.length == 1) s = \"0\" + s;\n out += s;\n }\n return parseInt(out);\n }\n function colorMulOpacity(color) {\n var opacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var components = decomposeColor(color);\n components.length > 3 ? components[3] *= opacity : components[3] = 1;\n return \"rgba(\".concat(components.join(\",\"), \")\");\n }\n function polarToCartesian(x, y, angle, radius) {\n return [x + Math.cos(angle) * radius, y + Math.sin(angle) * radius];\n }\n function splitNumber(num, toFixed) {\n if (toFixed < 0) {\n return {};\n }\n var ten = Math.pow(10, toFixed);\n var n = (num * ten + 0.5 | 0) / ten;\n var integer = n | 0;\n var decimals = n - integer;\n return {\n integer: integer,\n decimals: decimals.toFixed(toFixed) };\n\n }\n function copyObject(target, source, keys) {\n var map = {};\n for (var i = 0; i < keys.length; i++) {\n map[keys[i]] = true;\n }\n var sourceKeys = Object.keys(source);\n for (var _i4 = 0; _i4 < sourceKeys.length; _i4++) {\n var k = sourceKeys[_i4];\n if (map[k]) {\n target[k] = source[k];\n }\n }\n return target;\n }\n function getVectorAngle(x, y) {\n return Math.atan2(-y, -x) + Math.PI;\n }\n function fetchJson(url) {\n return new Promise(function (resolve, reject) {\n fetch(url).then(function (res) {\n res.json().then(function (json) {\n resolve(json);\n }, function (reason) {\n reject(reason);\n });\n }, function (reason) {\n reject(reason);\n });\n });\n }\n function invokeStringFunction(code) {\n for (var _len = arguments.length, formalActual = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n formalActual[_key - 1] = arguments[_key];\n }\n var formalParam = formalActual.slice(0, formalActual.length / 2);\n var actualParam = formalActual.slice(formalActual.length / 2);\n var f = new (Function.prototype.bind.apply(Function, [null].concat(_toConsumableArray(formalParam), [code])))();\n try {\n return f.apply(this, actualParam);\n } catch (e) {\n console.log(e);\n return undefined;\n }\n }\n function objectToJavsScriptCode(obj) {\n if (obj && _typeof(obj) === \"object\") {\n var out = \"{\\n\";\n var isFirst = true;\n for (var k in obj) {\n if (!isFirst) {\n out += \",\\n\";\n }\n out += k + \" :\";\n out += objectToJavsScriptCode(obj[k]);\n isFirst = false;\n }\n out += \"\\n}\";\n return out;\n } else {\n return JSON.stringify(obj);\n }\n }\n function deepAssignObject(target, partial) {\n for (var k in target) {\n var targetValue = target[k];\n var partialValue = partial[k];\n if (partialValue === undefined) {\n continue;\n }\n if (_typeof(partialValue) === \"object\" && _typeof(targetValue) === \"object\" && !Array.isArray(targetValue)) {\n deepAssignObject(targetValue, partialValue);\n } else {\n target[k] = partialValue;\n }\n }\n return target;\n }\n module.exports = {\n handleRelative: handleRelative,\n emitCustomEvent: emitCustomEvent,\n handleChartRelative: handleChartRelative,\n arrayToMap: arrayToMap,\n parseTextStyle: parseTextStyle,\n parseShadow: parseShadow,\n parseMulticolor: parseMulticolor,\n parseMulticolorCommon: parseMulticolorCommon,\n parseMultiColorDom: parseMultiColorDom,\n mergeObject: mergeObject,\n deepCopy: deepCopy,\n isEqual: isEqual,\n pointRotate: pointRotate,\n lerp: lerp,\n clamp: clamp,\n rad2deg: rad2deg,\n deg2rad: deg2rad,\n decomposeColor: decomposeColor,\n cssColorToHexNumber: cssColorToHexNumber,\n colorMulOpacity: colorMulOpacity,\n polarToCartesian: polarToCartesian,\n splitNumber: splitNumber,\n copyObject: copyObject,\n getVectorAngle: getVectorAngle,\n fetchJson: fetchJson,\n invokeStringFunction: invokeStringFunction,\n objectToJavsScriptCode: objectToJavsScriptCode,\n deepAssignObject: deepAssignObject };return module.exports;});", "requires": [], "buildLevel": 4, "outputDir": "/com/submodule-three-3d/1.0.0/base-utils", "outputPath": "/com/submodule-three-3d/1.0.0/base-utils/utils.js", "fileName": "/base-utils/utils.js" }, "pandav:/src/Event/EventMgr.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/src/Event/EventMgr\", [\"pandav:/com/three/0.145.0\", \"pandav:/com/submodule-three-3d/1.0.0/src/Event/EventLayer\"], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}\n function _nonIterableRest() {throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");}\n function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === \"Object\" && o.constructor) n = o.constructor.name;if (n === \"Map\" || n === \"Set\") return Array.from(o);if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}\n function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];return arr2;}\n function _iterableToArrayLimit(r, l) {var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}\n function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n var THREE = require('pandav:/com/three/0.145.0');\n var _require = require('pandav:/com/submodule-three-3d/1.0.0/src/Event/EventLayer'),\n EventLayer = _require.EventLayer;\n var EventType = {\n Click: 0,\n DoubleClick: 1,\n MouseEnter: 2,\n MouseLeave: 3 };\n\n var EventMgr = function () {\n function EventMgr() {\n _classCallCheck(this, EventMgr);\n var that = this;\n this.viewHeight = 1;\n this.dom = null;\n this.clickTimer = 0;\n this.doubleClickInterval = 500;\n this.clickMinDistance = 10;\n this.downPos = {\n pageX: 0,\n pageY: 0 };\n\n this.moved = false;\n this.isMouseDown = false;\n this.clicking = false;\n this.helperObjectRoot = new THREE.Object3D();\n this.layers = [];\n this.onMouseDown = function (e) {\n that.isMouseDown = true;\n that.moved = false;\n that.downPos = {\n pageX: e.clientX,\n pageY: e.clientY };\n\n var layers = that.layers;\n for (var i = 0, l = layers.length; i < l; i++) {\n if (layers[i].onMouseDown(e)) {\n break;\n }\n }\n that.clickTimer = that.doubleClickInterval;\n that.clicking = true;\n };\n this.onMouseUp = function (e) {\n that.isMouseDown = false;\n if (that.moved) {\n return;\n }\n var layers = that.layers;\n for (var i = 0, l = layers.length; i < l; i++) {\n if (layers[i].onMouseUp(e)) {\n break;\n }\n }\n };\n this.onMouseMove = function (e) {\n if (that.isMouseDown && !that.moved) {\n if (that.getDistance(that.downPos, e) > that.clickMinDistance) {\n that.moved = true;\n that.clicking = false;\n }\n }\n var layers = that.layers;\n var isBreak = false;\n for (var i = 0, l = layers.length; i < l; i++) {\n isBreak = layers[i].onMouseMove(e, isBreak);\n }\n };\n }\n _createClass(EventMgr, [{\n key: \"setEvent\",\n value: function setEvent(eventType, collider, callback) {\n this.layers[0].setEvent(eventType, collider, callback);\n } },\n {\n key: \"removeEvent\",\n value: function removeEvent(eventType, collider) {\n this.layers[0].removeEvent(eventType, collider);\n } },\n {\n key: \"init\",\n value: function init(dom, camera, width, height, viewHeight) {\n dom.addEventListener(\"mousedown\", this.onMouseDown);\n dom.addEventListener(\"mousemove\", this.onMouseMove);\n document.addEventListener(\"mouseup\", this.onMouseUp);\n this.dom = dom;\n this.viewHeight = viewHeight;\n this.layers.push(new EventLayer(this, camera, width, height));\n } },\n {\n key: \"setSize\",\n value: function setSize(width, height) {\n this.layers.forEach(function (e) {\n return e.setSize(width, height);\n });\n } },\n {\n key: \"dispose\",\n value: function dispose() {\n var dom = this.dom;\n dom.removeEventListener(\"mousedown\", this.onMouseDown);\n dom.removeEventListener(\"mousemove\", this.onMouseMove);\n document.removeEventListener(\"mouseup\", this.onMouseUp);\n this.layers[0].dispose();\n } },\n {\n key: \"update\",\n value: function update(dt) {\n if (this.clickTimer > 0) {\n this.clickTimer -= dt;\n } else {\n if (this.clicking) {\n this.clicking = false;\n for (var i = 0, len = this.layers.length; i < len; i++) {\n this.layers[i].clearStatus();\n }\n }\n }\n this.layers.forEach(function (e) {\n return e.update();\n });\n } },\n {\n key: \"getDistance\",\n value: function getDistance(start, end) {\n var _this$getEventLocalPo = this.getEventLocalPosition(start),\n _this$getEventLocalPo2 = _slicedToArray(_this$getEventLocalPo, 2),\n x1 = _this$getEventLocalPo2[0],\n y1 = _this$getEventLocalPo2[1];\n var _this$getEventLocalPo3 = this.getEventLocalPosition(end),\n _this$getEventLocalPo4 = _slicedToArray(_this$getEventLocalPo3, 2),\n x2 = _this$getEventLocalPo4[0],\n y2 = _this$getEventLocalPo4[1];\n return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));\n } },\n {\n key: \"getEventLocalPosition\",\n value: function getEventLocalPosition(e) {\n var box = this.dom.getBoundingClientRect();\n var scale = window.getScale();\n return [(e.clientX - box.left) * (1 / scale[0]), (e.clientY - box.top) * (1 / scale[1])];\n } }],\n [{\n key: \"instance\",\n get: function get() {\n if (!EventMgr._instance) {\n EventMgr._instance = new EventMgr();\n }\n return EventMgr._instance;\n } }]);\n\n return EventMgr;\n }();\n module.exports = {\n EventMgr: EventMgr,\n EventType: EventType };return module.exports;});", "requires": [ "pandav:/src/Event/EventLayer.js" ], "buildLevel": 5, "outputDir": "/com/submodule-three-3d/1.0.0/src/Event", "outputPath": "/com/submodule-three-3d/1.0.0/src/Event/EventMgr.js", "fileName": "/src/Event/EventMgr.js" }, "pandav:/src/lib/md5.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/src/lib/md5\", [], function (module, exports, require, load, process, global) {\n\n var hexcase = 0;\n var b64pad = \"\";\n var chrsz = 8;\n function hex_md5(s) {\n return binl2hex(core_md5(str2binl(s), s.length * chrsz));\n }\n function b64_md5(s) {\n return binl2b64(core_md5(str2binl(s), s.length * chrsz));\n }\n function str_md5(s) {\n return binl2str(core_md5(str2binl(s), s.length * chrsz));\n }\n function hex_hmac_md5(key, data) {\n return binl2hex(core_hmac_md5(key, data));\n }\n function b64_hmac_md5(key, data) {\n return binl2b64(core_hmac_md5(key, data));\n }\n function str_hmac_md5(key, data) {\n return binl2str(core_hmac_md5(key, data));\n }\n function md5_vm_test() {\n return hex_md5(\"abc\") == \"900150983cd24fb0d6963f7d28e17f72\";\n }\n function core_md5(x, len) {\n x[len >> 5] |= 0x80 << len % 32;\n x[(len + 64 >>> 9 << 4) + 14] = len;\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n for (var i = 0; i < x.length; i += 16) {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936);\n d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586);\n c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819);\n b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330);\n a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897);\n d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426);\n c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341);\n b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983);\n a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416);\n d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417);\n c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682);\n d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329);\n a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510);\n d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632);\n c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713);\n b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302);\n a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691);\n d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083);\n c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848);\n a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438);\n d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690);\n c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961);\n b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501);\n a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467);\n d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784);\n c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473);\n b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n a = md5_hh(a, b, c, d, x[i + 5], 4, -378558);\n d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463);\n c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562);\n b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060);\n d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353);\n c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632);\n b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174);\n d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222);\n c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979);\n b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189);\n a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487);\n d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520);\n b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651);\n a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844);\n d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415);\n c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055);\n a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571);\n d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606);\n c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799);\n a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359);\n d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380);\n b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649);\n a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070);\n d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259);\n b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551);\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n }\n return Array(a, b, c, d);\n }\n function md5_cmn(q, a, b, x, s, t) {\n return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n }\n function md5_ff(a, b, c, d, x, s, t) {\n return md5_cmn(b & c | ~b & d, a, b, x, s, t);\n }\n function md5_gg(a, b, c, d, x, s, t) {\n return md5_cmn(b & d | c & ~d, a, b, x, s, t);\n }\n function md5_hh(a, b, c, d, x, s, t) {\n return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n }\n function md5_ii(a, b, c, d, x, s, t) {\n return md5_cmn(c ^ (b | ~d), a, b, x, s, t);\n }\n function core_hmac_md5(key, data) {\n var bkey = str2binl(key);\n if (bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);\n var ipad = Array(16),\n opad = Array(16);\n for (var i = 0; i < 16; i++) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);\n return core_md5(opad.concat(hash), 512 + 128);\n }\n function safe_add(x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xFFFF;\n }\n function bit_rol(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n }\n function str2binl(str) {\n var bin = Array();\n var mask = (1 << chrsz) - 1;\n for (var i = 0; i < str.length * chrsz; i += chrsz) bin[i >> 5] |= (str.charCodeAt(i / chrsz) & mask) << i % 32;\n return bin;\n }\n function binl2str(bin) {\n var str = \"\";\n var mask = (1 << chrsz) - 1;\n for (var i = 0; i < bin.length * 32; i += chrsz) str += String.fromCharCode(bin[i >> 5] >>> i % 32 & mask);\n return str;\n }\n function binl2hex(binarray) {\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for (var i = 0; i < binarray.length * 4; i++) {\n str += hex_tab.charAt(binarray[i >> 2] >> i % 4 * 8 + 4 & 0xF) + hex_tab.charAt(binarray[i >> 2] >> i % 4 * 8 & 0xF);\n }\n return str;\n }\n function binl2b64(binarray) {\n var tab = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n var str = \"\";\n for (var i = 0; i < binarray.length * 4; i += 3) {\n var triplet = (binarray[i >> 2] >> 8 * (i % 4) & 0xFF) << 16 | (binarray[i + 1 >> 2] >> 8 * ((i + 1) % 4) & 0xFF) << 8 | binarray[i + 2 >> 2] >> 8 * ((i + 2) % 4) & 0xFF;\n for (var j = 0; j < 4; j++) {\n if (i * 8 + j * 6 > binarray.length * 32) str += b64pad;else str += tab.charAt(triplet >> 6 * (3 - j) & 0x3F);\n }\n }\n return str;\n }\n module.exports = {\n hex_md5: hex_md5,\n b64_md5: b64_md5,\n str_md5: str_md5 };return module.exports;});", "requires": [], "buildLevel": 10, "outputDir": "/com/submodule-three-3d/1.0.0/src/lib", "outputPath": "/com/submodule-three-3d/1.0.0/src/lib/md5.js", "fileName": "/src/lib/md5.js" }, "pandav:/src/lib/MappedList.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/src/lib/MappedList\", [], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n var MappedList = function () {\n function MappedList(props) {\n _classCallCheck(this, MappedList);\n this._list = [];\n this._map = new Map();\n if (Array.isArray(props)) {\n this._list = props;\n this.updateList();\n } else {\n this._map = props;\n this.updateMap();\n }\n }\n _createClass(MappedList, [{\n key: \"list\",\n get: function get() {\n return this._list;\n } },\n {\n key: \"map\",\n get: function get() {\n return this._map;\n } },\n {\n key: \"updateList\",\n value: function updateList() {\n this._map.clear();\n for (var i = 0; i < this.list.length; i++) {\n this._map.set(this.list[i].id, this.list[i]);\n }\n } },\n {\n key: \"updateMap\",\n value: function updateMap() {\n this._list = Array.from(this._map.values());\n } },\n {\n key: \"add\",\n value: function add(element) {\n if (!this._map.has(element.id)) {\n this._map.set(element.id, element);\n this.updateMap();\n }\n return element;\n } },\n {\n key: \"remove\",\n value: function remove(element) {\n if (this._map.has(element.id)) {\n this._map[\"delete\"](element.id);\n this.updateMap();\n }\n return element;\n } },\n {\n key: \"clone\",\n value: function clone() {\n return new MappedList(this._list.slice());\n } }]);\n\n return MappedList;\n }();\n module.exports = {\n MappedList: MappedList };return module.exports;});", "requires": [], "buildLevel": 9, "outputDir": "/com/submodule-three-3d/1.0.0/src/lib", "outputPath": "/com/submodule-three-3d/1.0.0/src/lib/MappedList.js", "fileName": "/src/lib/MappedList.js" }, "pandav:/src/Event/EventLayer.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/src/Event/EventLayer\", [\"pandav:/com/three/0.145.0\"], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}\n function _nonIterableRest() {throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");}\n function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === \"Object\" && o.constructor) n = o.constructor.name;if (n === \"Map\" || n === \"Set\") return Array.from(o);if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}\n function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];return arr2;}\n function _iterableToArrayLimit(r, l) {var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}\n function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}\n function _defineProperty(obj, key, value) {key = _toPropertyKey(key);if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n var THREE = require('pandav:/com/three/0.145.0');\n var EventType = {\n Click: 0,\n DoubleClick: 1,\n MouseEnter: 2,\n MouseLeave: 3 };\n\n var ClickStatus = {\n None: 1,\n Down: 2,\n Click: 3,\n DownAgain: 4,\n DoubleClick: 5 };\n\n var tmpVec1 = new THREE.Vector3();\n var EventLayer = function () {\n function EventLayer(context, camera, width, height) {\n _classCallCheck(this, EventLayer);\n this.camera = undefined;\n this.halfWidth = 0;\n this.halfHeight = 0;\n this.callbackMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, EventType.Click, {}), EventType.DoubleClick, {}), EventType.MouseEnter, {}), EventType.MouseLeave, {});\n this.clickStatusMap = new Map();\n this.hoveredList = [];\n this.clickColliderList = [];\n this.hoverColliderList = [];\n this.listenerFlagMap = new Map();\n this.context = undefined;\n this.colliderHelperList = [];\n this.ray = undefined;\n this.debug = false;\n this.lastMouseDownPos = null;\n this.camera = camera;\n this.ray = new THREE.Ray();\n this.halfWidth = width / 2;\n this.halfHeight = height / 2;\n this.context = context;\n }\n _createClass(EventLayer, [{\n key: \"setSize\",\n value: function setSize(width, height) {\n this.halfWidth = width / 2;\n this.halfHeight = height / 2;\n } },\n {\n key: \"getColliderList\",\n value: function getColliderList(eventType) {\n var list;\n if (eventType == EventType.Click || eventType == EventType.DoubleClick) {\n list = this.clickColliderList;\n } else {\n list = this.hoverColliderList;\n }\n return list;\n } },\n {\n key: \"setEvent\",\n value: function setEvent(eventType, collider, callback) {\n if (collider === undefined) {\n return;\n }\n if (Array.isArray(collider)) {\n for (var i = 0, len = collider.length; i < len; i++) {\n this.setEvent(eventType, collider[i], callback);\n }\n return;\n }\n if (collider) {\n var list = this.getColliderList(eventType);\n if (!list.some(function (e) {\n return e === collider;\n })) {\n list.push(collider);\n if (this.debug) {\n var helper = collider.createHelper();\n var helperObject = helper.getObject();\n this.context.helperObjectRoot.add(helperObject);\n this.colliderHelperList.push(helper);\n }\n }\n }\n var uuid = collider === null ? EventLayer.EmptyUuid : collider.uuid;\n var map = this.listenerFlagMap;\n var mask = map.get(uuid) || 0;\n mask = 1 << eventType | mask;\n map.set(uuid, mask);\n this.callbackMap[eventType][uuid] = callback;\n } },\n {\n key: \"removeEvent\",\n value: function removeEvent(eventType, collider) {\n if (collider === undefined) {\n return;\n }\n if (Array.isArray(collider)) {\n for (var i = 0, len = collider.length; i < len; i++) {\n this.removeEvent(eventType, collider[i]);\n }\n return;\n }\n var uuid = collider === null ? EventLayer.EmptyUuid : collider.uuid;\n var callback = this.callbackMap[eventType][uuid];\n if (!callback) {\n return;\n }\n delete this.callbackMap[eventType][uuid];\n var map = this.listenerFlagMap;\n var mask = map.get(uuid) || 0;\n mask = ~(1 << eventType) & mask;\n if (mask === 0) {\n map[\"delete\"](uuid);\n if (collider) {\n var list = this.getColliderList(eventType);\n var _i = list.indexOf(collider);\n list.splice(_i, 1);\n if (this.debug) {\n var helper = this.colliderHelperList[_i];\n this.colliderHelperList.splice(_i, 1);\n helper.dispose();\n }\n }\n } else {\n map.set(uuid, mask);\n }\n } },\n {\n key: \"getViewHeight\",\n value: function getViewHeight() {\n return this.context.viewHeight;\n } },\n {\n key: \"update\",\n value: function update() {\n var _this = this;\n if (this.debug) {\n this.colliderHelperList.forEach(function (e) {\n e.update(_this.camera, _this.getViewHeight());\n });\n }\n } },\n {\n key: \"dispose\",\n value: function dispose() {\n this.colliderHelperList.forEach(function (e) {\n return e.dispose();\n });\n } },\n {\n key: \"sendRaycast\",\n value: function sendRaycast(e, colliderList) {\n var useBlock = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n var camera = this.camera,\n ray = this.ray;\n var _this$context$getEven = this.context.getEventLocalPosition(e),\n _this$context$getEven2 = _slicedToArray(_this$context$getEven, 2),\n offsetX = _this$context$getEven2[0],\n offsetY = _this$context$getEven2[1];\n var x = offsetX / this.halfWidth - 1;\n var y = 1 - offsetY / this.halfHeight;\n ray.origin.set(x, y, -1).unproject(camera);\n ray.direction.copy(ray.origin).sub(camera.position).normalize();\n var collisionList = [];\n var viewHeight = this.getViewHeight();\n for (var i = 0; i < colliderList.length; i++) {\n if (!colliderList[i].isActive()) {\n continue;\n }\n var collision = colliderList[i].detectRay(ray, this.camera, viewHeight);\n if (collision) {\n collisionList.push(collision);\n }\n }\n if (!useBlock) {\n return collisionList;\n }\n collisionList.sort(function (a, b) {\n if (a.priority == b.priority) {\n var disA = tmpVec1.subVectors(a.point, ray.origin).length();\n var disB = tmpVec1.subVectors(b.point, ray.origin).length();\n return disA - disB;\n } else {\n return b.priority - a.priority;\n }\n });\n if (collisionList.length > 0) {\n return [collisionList[0]];\n } else {\n return [];\n }\n } },\n {\n key: \"onMouseDown\",\n value: function onMouseDown(e) {\n var collisionList = this.sendRaycast(e, this.clickColliderList);\n var isBreak = collisionList.length > 0;\n if (collisionList.length <= 0) {\n this.handleClickOnMouseDown(EventLayer.EmptyUuid, e);\n }\n for (var i = 0, len = collisionList.length; i < len; i++) {\n this.handleClickOnMouseDown(collisionList[i].collider.uuid, e);\n }\n this.lastMouseDownPos = [e.clientX, e.clientY];\n return isBreak;\n } },\n {\n key: \"handleClickOnMouseDown\",\n value: function handleClickOnMouseDown(uuid, e) {\n var status = this.clickStatusMap.get(uuid);\n if (!status || !this.context.clicking || status == ClickStatus.DoubleClick) {\n this.clickStatusMap.set(uuid, ClickStatus.Down);\n } else if (this.context.clicking && status == ClickStatus.Click) {\n if (this.lastMouseDownPos && pointDistance([e.clientX, e.clientY], this.lastMouseDownPos) < 10) {\n this.clickStatusMap.set(uuid, ClickStatus.DownAgain);\n } else {\n this.clickStatusMap.set(uuid, ClickStatus.Down);\n }\n }\n } },\n {\n key: \"clearStatus\",\n value: function clearStatus() {\n this.clickStatusMap.clear();\n } },\n {\n key: \"onMouseUp\",\n value: function onMouseUp(e) {\n var collisionList = this.sendRaycast(e, this.clickColliderList);\n var isBreak = collisionList.length > 0;\n if (collisionList.length <= 0) {\n this.handleClickOnMouseUp_empty(EventLayer.EmptyUuid, e);\n }\n for (var i = 0, len = collisionList.length; i < len; i++) {\n this.handleClickOnMouseUp_normal(collisionList[i].collider.uuid, e);\n }\n return isBreak;\n } },\n {\n key: \"handleClickOnMouseUp_normal\",\n value: function handleClickOnMouseUp_normal(uuid, e) {\n var status = this.clickStatusMap.get(uuid);\n if (status === ClickStatus.Down) {\n this.clickStatusMap.set(uuid, ClickStatus.Click);\n this.callbackMap[EventType.Click]?.[uuid]?.(e);\n } else if (status === ClickStatus.DownAgain) {\n this.clickStatusMap.set(uuid, ClickStatus.DoubleClick);\n this.callbackMap[EventType.DoubleClick]?.[uuid]?.(e);\n }\n } },\n {\n key: \"handleClickOnMouseUp_empty\",\n value: function handleClickOnMouseUp_empty(uuid, e) {\n var status = this.clickStatusMap.get(uuid);\n if (status === ClickStatus.Down) {\n this.clickStatusMap.set(uuid, ClickStatus.Click);\n this.callbackMap[EventType.Click]?.[uuid]?.(e);\n } else if (status === ClickStatus.DownAgain) {\n this.clickStatusMap.set(uuid, ClickStatus.DoubleClick);\n this.callbackMap[EventType.DoubleClick]?.[uuid]?.(e);\n }\n } },\n {\n key: \"onMouseMove\",\n value: function onMouseMove(e, isBreak) {\n var hoveredList = this.hoveredList,\n callbackMap = this.callbackMap;\n if (isBreak) {\n for (var i = 0, len = hoveredList.length; i < len; i++) {\n callbackMap[EventType.MouseLeave]?.[hoveredList[i]]?.(e);\n }\n this.hoveredList = [];\n return isBreak;\n }\n var collisionList = this.sendRaycast(e, this.hoverColliderList, true);\n for (var _i2 = 0; _i2 < hoveredList.length; _i2++) {\n var find = false;\n for (var j = 0; j < collisionList.length; j++) {\n var _uuid = collisionList[j].collider.uuid;\n if (hoveredList[_i2] === _uuid) {\n find = true;\n }\n }\n if (!find) {\n callbackMap[EventType.MouseLeave]?.[hoveredList[_i2]]?.(e);\n this.hoveredList.splice(_i2, 1);\n _i2--;\n }\n }\n for (var _i3 = 0, _len = collisionList.length; _i3 < _len; _i3++) {\n var _uuid2 = collisionList[_i3].collider.uuid;\n var _find = false;\n for (var _j = 0; _j < hoveredList.length; _j++) {\n if (_uuid2 == hoveredList[_j]) {\n _find = true;\n }\n }\n if (!_find) {\n callbackMap[EventType.MouseEnter]?.[_uuid2]?.(e);\n this.hoveredList.push(_uuid2);\n }\n }\n return collisionList.length > 0;\n } }]);\n\n return EventLayer;\n }();\n EventLayer.EmptyUuid = \"-1\";\n EventLayer.testCount = 0;\n function pointDistance(a, b) {\n return (a[0] - b[0]) * (a[0] - b[0]) + (a[1] - b[1]) * (a[1] - b[1]);\n }\n module.exports = {\n EventLayer: EventLayer };return module.exports;});", "requires": [], "buildLevel": 6, "outputDir": "/com/submodule-three-3d/1.0.0/src/Event", "outputPath": "/com/submodule-three-3d/1.0.0/src/Event/EventLayer.js", "fileName": "/src/Event/EventLayer.js" }, "pandav:/src/ThreeChild.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/src/ThreeChild\", [\"pandav:/com/three/0.145.0\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/Hook\"], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n function _callSuper(t, o, e) {return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));}\n function _possibleConstructorReturn(self, call) {if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {return call;} else if (call !== void 0) {throw new TypeError(\"Derived constructors may only return object or undefined\");}return _assertThisInitialized(self);}\n function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");}return self;}\n function _isNativeReflectConstruct() {try {var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));} catch (t) {}return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {return !!t;})();}\n function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}\n function _inherits(subClass, superClass) {if (typeof superClass !== \"function\" && superClass !== null) {throw new TypeError(\"Super expression must either be null or a function\");}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });Object.defineProperty(subClass, \"prototype\", { writable: false });if (superClass) _setPrototypeOf(subClass, superClass);}\n function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}\n var THREE = require('pandav:/com/three/0.145.0');\n var _require = require('pandav:/com/submodule-three-3d/1.0.0/base-utils/lib/Hook'),\n Hook = _require.Hook;\n var ThreeChild = function (_THREE$Group) {\n _inherits(ThreeChild, _THREE$Group);\n function ThreeChild(opt) {\n var _this;\n _classCallCheck(this, ThreeChild);\n _this = _callSuper(this, ThreeChild, [opt]);\n _this.disposeList = [];\n _this._hook = new Hook();\n _this.props = null;\n _this.context = null;\n _this.config = null;\n _this.assetsMgr = null;\n _this.needRefresh = true;\n _this.inited = false;\n return _this;\n }\n _createClass(ThreeChild, [{\n key: \"create\",\n value: function create(props) {\n this.props = props;\n this.context = props.context;\n this.config = props.configuration;\n this.assetsMgr = props.context.assetsMgr;\n props.context.scene.add(this);\n this.onCreate();\n } },\n {\n key: \"onCreate\",\n value: function onCreate() {} },\n {\n key: \"getAssetsListMap\",\n value: function getAssetsListMap() {\n return {};\n } },\n {\n key: \"dispose\",\n value: function dispose() {\n this.disposeList.forEach(function (e) {\n return e.dispose();\n });\n this.disposeList = [];\n this.onDispose();\n } },\n {\n key: \"onDispose\",\n value: function onDispose() {} },\n {\n key: \"onFocusVisible\",\n value: function onFocusVisible() {\n this.visible = true;\n } },\n {\n key: \"onFocusUnvisible\",\n value: function onFocusUnvisible() {\n this.visible = false;\n } },\n {\n key: \"handleRelative\",\n value: function handleRelative(config, forEach) {\n var log = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var datas = {};\n try {\n var callbacks = Object.values(config);\n callbacks.forEach(function (o) {\n forEach(datas, o);\n });\n this.context.props.onRelative(this.props.id, datas);\n } catch (e) {\n if (log) {\n console.log(\"handleRelative fail\", e);\n }\n } finally {\n return datas;\n }\n } },\n {\n key: \"emitCustomEvent\",\n value: function emitCustomEvent(name, data) {\n this.context.props.emit && this.context.props.emit(name, data, this.props.id);\n } },\n {\n key: \"hook\",\n value: function hook(id, callback, a, b) {\n return this._hook.do(id, callback, a, b);\n } },\n {\n key: \"refresh\",\n value: function refresh(props) {\n this.props = props;\n this.context = props.context;\n this.config = props.configuration;\n this.refreshVisibility(props.configuration, true);\n this.needRefresh = true;\n } },\n {\n key: \"renderRefresh\",\n value: function renderRefresh() {\n if (this.needRefresh) {\n this.onRefresh();\n this.inited = true;\n this.needRefresh = false;\n this.refreshVisibility(this.config);\n }\n } },\n {\n key: \"refreshVisibility\",\n value: function refreshVisibility(props) {\n var needReturn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var visibility = props.visibility;\n if (!visibility) {\n this.dispose();\n if (needReturn) {\n return null;\n }\n }\n } },\n {\n key: \"onRefresh\",\n value: function onRefresh() {} },\n {\n key: \"update\",\n value: function update(dt) {\n if (this.inited) {\n this.onUpdate(dt);\n }\n } },\n {\n key: \"onUpdate\",\n value: function onUpdate(dt) {} }]);\n\n return ThreeChild;\n }(THREE.Group);\n module.exports = {\n ThreeChild: ThreeChild };return module.exports;});", "requires": [ "pandav:/base-utils/lib/Hook.js" ], "buildLevel": 0, "outputDir": "/com/submodule-three-3d/1.0.0/src", "outputPath": "/com/submodule-three-3d/1.0.0/src/ThreeChild.js", "fileName": "/src/ThreeChild.js" }, "pandav:/src/Pass/Bloom2Pass.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/src/Pass/Bloom2Pass\", [\"pandav:/com/three/0.145.0\", \"pandav:/com/submodule-three-3d/1.0.0/src/utils\"], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n function _callSuper(t, o, e) {return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));}\n function _possibleConstructorReturn(self, call) {if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {return call;} else if (call !== void 0) {throw new TypeError(\"Derived constructors may only return object or undefined\");}return _assertThisInitialized(self);}\n function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");}return self;}\n function _isNativeReflectConstruct() {try {var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));} catch (t) {}return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {return !!t;})();}\n function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}\n function _inherits(subClass, superClass) {if (typeof superClass !== \"function\" && superClass !== null) {throw new TypeError(\"Super expression must either be null or a function\");}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });Object.defineProperty(subClass, \"prototype\", { writable: false });if (superClass) _setPrototypeOf(subClass, superClass);}\n function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}\n var THREE = require('pandav:/com/three/0.145.0');\n var Pass = THREE.Pass,\n FullScreenQuad = THREE.FullScreenQuad;\n var _require = require('pandav:/com/submodule-three-3d/1.0.0/src/utils'),\n createHDRRenderTarget = _require.createHDRRenderTarget;\n var Bloom2Pass = function (_Pass) {\n _inherits(Bloom2Pass, _Pass);\n function Bloom2Pass(resolution) {\n var _this;\n _classCallCheck(this, Bloom2Pass);\n _this = _callSuper(this, Bloom2Pass);\n _this.threshold = 1;\n _this.strength = 1;\n _this.kernelRadius = 8;\n _this.expand = 1;\n _this.horRTs = [];\n _this.verDownRTs = [];\n _this.verUpRTs = [];\n _this.highPassRT = undefined;\n _this.width = 0;\n _this.height = 0;\n _this.fsQuard = undefined;\n _this.blurMaterial = new THREE.ShaderMaterial({\n defines: {\n PI: Math.PI },\n\n uniforms: {\n tDiffuse: {\n value: null },\n\n resolution: {\n value: new THREE.Vector2() },\n\n expand: {\n value: 0 },\n\n radius: {\n value: 5 },\n\n blurDirection: {\n value: new THREE.Vector2(0, 0) } },\n\n\n vertexShader: \"\\n varying vec2 vUv;\\n void main() {\\n vUv = uv;\\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n }\\n \",\n fragmentShader: \"\\n varying vec2 vUv;\\n uniform sampler2D tDiffuse;\\n uniform vec2 resolution;\\n uniform float radius;\\n uniform float expand;\\n uniform vec2 blurDirection;\\n\\n float gaussianPdf(in float x, in float sigma) {\\n return 1.0 / ( sqrt(2.0 * PI) * sigma ) * exp( - x * x / ( 2.0 * sigma * sigma ) );\\n }\\n\\n void main() {\\n\\n float sigma = radius / 2.0;\\n vec2 pixel = 1.0 / resolution;\\n\\n vec4 sum = texture2D( tDiffuse, vUv ) * gaussianPdf( 0.0, sigma );\\n\\n for(float i = 1.0; i < radius; i++ ) {\\n float weight = gaussianPdf( i, sigma );\\n sum += texture2D( tDiffuse, vUv + blurDirection * i * expand * pixel ) * weight;\\n sum += texture2D( tDiffuse, vUv - blurDirection * i * expand * pixel ) * weight;\\n }\\n\\n gl_FragColor = sum;\\n }\\n \" });\n\n _this.verUpMaterial = new THREE.ShaderMaterial({\n defines: {\n PI: Math.PI },\n\n uniforms: {\n tDiffuse: {\n value: null },\n\n resolution: {\n value: new THREE.Vector2() },\n\n expand: {\n value: 0 },\n\n tDownMip: {\n value: null },\n\n radius: {\n value: 5 } },\n\n\n vertexShader: \"\\n varying vec2 vUv;\\n void main() {\\n vUv = uv;\\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n }\\n \",\n fragmentShader: \"\\n varying vec2 vUv;\\n uniform sampler2D tDiffuse;\\n uniform sampler2D tDownMip;\\n uniform vec2 resolution;\\n uniform float radius;\\n uniform float expand;\\n\\n float gaussianPdf(in float x, in float sigma) {\\n return 1.0 / ( sqrt(2.0 * PI) * sigma ) * exp( - x * x / ( 2.0 * sigma * sigma ) );\\n }\\n\\n void main() {\\n float sigma = radius / 2.0;\\n vec2 pixel = 1.0 / resolution;\\n\\n vec4 sum = texture2D( tDiffuse, vUv );\\n \\n sum *= gaussianPdf( 0.0, sigma );\\n \\n for(float i = 1.0; i < radius; i++ ) {\\n float weight = gaussianPdf( i, sigma );\\n sum += texture2D( tDiffuse, vUv + vec2( 0.0, i * expand ) * pixel ) * weight;\\n sum += texture2D( tDiffuse, vUv - vec2( 0.0, i * expand ) * pixel ) * weight;\\n }\\n \\n gl_FragColor = sum;\\n\\n gl_FragColor.rgb += texture2D( tDownMip, vUv ).rgb * 2.0;\\n\\n }\\n \" });\n\n _this.compositeMaterial = new THREE.ShaderMaterial({\n uniforms: {\n tDiffuse: {\n value: null },\n\n blurTexture: {\n value: null },\n\n strength: {\n value: 1 } },\n\n\n vertexShader: \"\\n varying vec2 vUv;\\n void main() {\\n vUv = uv;\\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n }\\n \",\n fragmentShader: \"\\n uniform sampler2D tDiffuse;\\n uniform sampler2D blurTexture;\\n uniform float strength;\\n\\n varying vec2 vUv;\\n\\n\\t\\tfloat lerpBloomFactor(const in float factor) {\\n\\t\\t\\tfloat mirrorFactor = 1.2 - factor;\\n\\t\\t\\treturn mix(factor, mirrorFactor, 0.0);\\n\\t\\t}\\n\\n void main() {\\n vec4 sceneColor = texture2D( tDiffuse, vUv );\\n vec3 totalBlur = texture2D( blurTexture, vUv ).rgb;\\n\\n gl_FragColor.rgb = sceneColor.rgb + totalBlur * strength;\\n gl_FragColor.a = sceneColor.a;\\n\\n }\\n \" });\n\n _this._loopCount = 0;\n _this.luminosityFilterMaterial = new THREE.ShaderMaterial({\n uniforms: {\n tDiffuse: {\n value: null },\n\n luminosityThreshold: {\n value: 1 },\n\n smoothWidth: {\n value: 0.01 } },\n\n\n vertexShader: \"\\n varying vec2 vUv;\\n \\n void main() {\\n \\n vUv = uv;\\n \\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n \\n }\\n \",\n fragmentShader: \"\\n uniform sampler2D tDiffuse;\\n uniform float luminosityThreshold;\\n uniform float smoothWidth;\\n \\n varying vec2 vUv;\\n \\n void main() {\\n \\n vec4 hdrColor = texture2D( tDiffuse, vUv );\\n \\n //\\u8003\\u8651\\u4E86\\u900F\\u660E\\u5EA6\\u7684\\u660E\\u5EA6\\n float luminosity = dot( hdrColor.rgb, vec3( 0.299, 0.587, 0.114 ) ) * hdrColor.a;\\n \\n float sr = hdrColor.r > 1.0 ? ( 1.0 / hdrColor.r ) : 0.0;\\n float sg = hdrColor.r > 1.0 ? ( 1.0 / hdrColor.r ) : 0.0;\\n float sb = hdrColor.r > 1.0 ? ( 1.0 / hdrColor.r ) : 0.0;\\n \\n float scale = max( max( sr, sg ), sb );\\n scale = scale <= 0.0 ? 1.0 : scale;\\n \\n hdrColor.rgb *= scale;\\n \\n float a = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, luminosity );\\n \\n gl_FragColor = hdrColor * a;\\n \\n }\\n \" });\n\n _this.width = resolution.x;\n _this.height = resolution.y;\n _this.needsSwap = true;\n _this.fsQuard = new FullScreenQuad();\n _this.highPassRT = createHDRRenderTarget(resolution.x, resolution.y);\n return _this;\n }\n _createClass(Bloom2Pass, [{\n key: \"loopCount\",\n get: function get() {\n return this._loopCount;\n },\n set: function set(v) {\n var curLoopCount = Math.floor(Math.max(v, 0));\n if (this._loopCount !== curLoopCount) {\n if (Math.pow(2, curLoopCount - 1) > Math.min(this.width, this.height)) {\n console.log(\"invalid loop count\");\n return;\n }\n if (curLoopCount > this._loopCount) {\n for (var i = this._loopCount; i < curLoopCount; i++) {\n var scale = 1 / Math.pow(2, i);\n var _width = this.width * scale;\n var _height = this.height * scale;\n this.horRTs.push(createHDRRenderTarget(_width, _height));\n this.verDownRTs.push(createHDRRenderTarget(_width, _height));\n this.verUpRTs.push(createHDRRenderTarget(_width, _height));\n }\n } else if (curLoopCount < this._loopCount) {\n for (var _i = curLoopCount; _i < this._loopCount; _i++) {\n this.horRTs[_i].dispose();\n this.verDownRTs[_i].dispose();\n this.verUpRTs[_i].dispose();\n }\n var deleteCount = this._loopCount - curLoopCount;\n this.horRTs.splice(curLoopCount, deleteCount);\n this.verDownRTs.splice(curLoopCount, deleteCount);\n this.verUpRTs.splice(curLoopCount, deleteCount);\n }\n this._loopCount = curLoopCount;\n }\n } },\n {\n key: \"setSize\",\n value: function setSize(width, height) {\n this.width = width;\n this.height = height;\n for (var i = 0; i < this.loopCount; i++) {\n var scale = 1 / Math.pow(2, i);\n var _width = width * scale;\n var _height = height * scale;\n this.horRTs[i].setSize(_width, _height);\n this.verDownRTs[i].setSize(_width, _height);\n this.verUpRTs[i].setSize(_width, _height);\n }\n this.highPassRT.setSize(width, height);\n } },\n {\n key: \"downsample\",\n value: function downsample(renderer, i) {\n var inputTexture = this.verDownRTs[i - 1];\n var dstHor = this.horRTs[i];\n var dstVer = this.verDownRTs[i];\n this.blurMaterial.uniforms.tDiffuse.value = inputTexture.texture;\n this.blurMaterial.uniforms.resolution.value.set(dstHor.width, dstHor.height);\n this.blurMaterial.uniforms.blurDirection.value.set(1, 0);\n renderer.setRenderTarget(dstHor);\n this.fsQuard.material = this.blurMaterial;\n this.fsQuard.render(renderer);\n this.blurMaterial.uniforms.tDiffuse.value = dstHor.texture;\n this.blurMaterial.uniforms.resolution.value.set(dstHor.width, dstHor.height);\n this.blurMaterial.uniforms.blurDirection.value.set(0, 1);\n renderer.setRenderTarget(dstVer);\n this.fsQuard.material = this.blurMaterial;\n this.fsQuard.render(renderer);\n } },\n {\n key: \"upsample\",\n value: function upsample(renderer, i) {\n var inputTexture = i === this.loopCount - 1 ? null : this.verUpRTs[i + 1].texture;\n var dstHor = this.horRTs[i];\n var dstVer = this.verUpRTs[i];\n var tDownMip = this.verDownRTs[i].texture;\n this.blurMaterial.uniforms.tDiffuse.value = inputTexture;\n this.blurMaterial.uniforms.resolution.value.set(dstHor.width, dstHor.height);\n this.blurMaterial.uniforms.blurDirection.value.set(1, 0);\n renderer.setRenderTarget(dstHor);\n this.fsQuard.material = this.blurMaterial;\n this.fsQuard.render(renderer);\n this.verUpMaterial.uniforms.tDiffuse.value = dstHor.texture;\n this.verUpMaterial.uniforms.resolution.value.set(dstHor.width, dstHor.height);\n this.verUpMaterial.uniforms.tDownMip.value = tDownMip;\n renderer.setRenderTarget(dstVer);\n this.fsQuard.material = this.verUpMaterial;\n this.fsQuard.render(renderer);\n } },\n {\n key: \"render\",\n value: function render(renderer, writeBuffer, readBuffer, deltaTime, maskActive) {\n if (this._loopCount <= 1 || this.expand <= 0) {\n return;\n }\n this.luminosityFilterMaterial.uniforms.tDiffuse.value = readBuffer.texture;\n this.luminosityFilterMaterial.uniforms.luminosityThreshold.value = this.threshold;\n this.fsQuard.material = this.luminosityFilterMaterial;\n renderer.setRenderTarget(this.verDownRTs[0]);\n this.fsQuard.render(renderer);\n this.blurMaterial.uniforms.expand.value = this.expand;\n this.blurMaterial.uniforms.radius.value = this.kernelRadius;\n this.verUpMaterial.uniforms.expand.value = this.expand;\n this.verUpMaterial.uniforms.radius.value = this.kernelRadius;\n for (var i = 1; i < this.loopCount; i++) {\n this.downsample(renderer, i);\n }\n for (var _i2 = this.loopCount - 1; _i2 >= 0; _i2--) {\n this.upsample(renderer, _i2);\n }\n this.compositeMaterial.uniforms.tDiffuse.value = readBuffer.texture;\n this.compositeMaterial.uniforms.blurTexture.value = this.verUpRTs[0].texture;\n this.compositeMaterial.uniforms.strength.value = this.strength;\n this.fsQuard.material = this.compositeMaterial;\n renderer.setRenderTarget(this.getOutput(readBuffer, writeBuffer));\n this.fsQuard.render(renderer);\n } },\n {\n key: \"dispose\",\n value: function dispose() {\n this.luminosityFilterMaterial.dispose();\n this.compositeMaterial.dispose();\n this.blurMaterial.dispose();\n this.verUpMaterial.dispose();\n this.highPassRT.dispose();\n for (var i = 0; i < this.loopCount; i++) {\n this.horRTs[i].dispose();\n this.verDownRTs[i].dispose();\n this.verUpRTs[i].dispose();\n }\n this.horRTs = [];\n this.verDownRTs = [];\n this.verUpRTs = [];\n } }]);\n\n return Bloom2Pass;\n }(Pass);\n module.exports = {\n Bloom2Pass: Bloom2Pass };return module.exports;});", "requires": [ "pandav:/src/utils.js" ], "buildLevel": 0, "outputDir": "/com/submodule-three-3d/1.0.0/src/Pass", "outputPath": "/com/submodule-three-3d/1.0.0/src/Pass/Bloom2Pass.js", "fileName": "/src/Pass/Bloom2Pass.js" }, "pandav:/src/ThreeController/PanoramaController.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/src/ThreeController/PanoramaController\", [\"pandav:/com/three/0.145.0\", \"pandav:/com/submodule-three-3d/1.0.0/src/ThreeController/ThreeFixedController\"], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n function _callSuper(t, o, e) {return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));}\n function _possibleConstructorReturn(self, call) {if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {return call;} else if (call !== void 0) {throw new TypeError(\"Derived constructors may only return object or undefined\");}return _assertThisInitialized(self);}\n function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");}return self;}\n function _isNativeReflectConstruct() {try {var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));} catch (t) {}return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {return !!t;})();}\n function _get() {if (typeof Reflect !== \"undefined\" && Reflect.get) {_get = Reflect.get.bind();} else {_get = function _get(target, property, receiver) {var base = _superPropBase(target, property);if (!base) return;var desc = Object.getOwnPropertyDescriptor(base, property);if (desc.get) {return desc.get.call(arguments.length < 3 ? target : receiver);}return desc.value;};}return _get.apply(this, arguments);}\n function _superPropBase(object, property) {while (!Object.prototype.hasOwnProperty.call(object, property)) {object = _getPrototypeOf(object);if (object === null) break;}return object;}\n function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}\n function _inherits(subClass, superClass) {if (typeof superClass !== \"function\" && superClass !== null) {throw new TypeError(\"Super expression must either be null or a function\");}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });Object.defineProperty(subClass, \"prototype\", { writable: false });if (superClass) _setPrototypeOf(subClass, superClass);}\n function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}\n var THREE = require('pandav:/com/three/0.145.0');\n var _require = require('pandav:/com/submodule-three-3d/1.0.0/src/ThreeController/ThreeFixedController'),\n ThreeFixedController = _require.ThreeFixedController,\n multiplyAxisRotate = _require.multiplyAxisRotate,\n ControlData = _require.ControlData;\n var tmpMatrix4_4 = new THREE.Vector3();\n var tmpVec3_2 = new THREE.Vector3();\n var PanoramaController = function (_ThreeFixedController) {\n _inherits(PanoramaController, _ThreeFixedController);\n function PanoramaController(opt, camera) {\n var _this;\n _classCallCheck(this, PanoramaController);\n _this = _callSuper(this, PanoramaController, [opt, camera]);\n _this.depth = new ControlData(0, true);\n _this.focusEnabled = false;\n return _this;\n }\n _createClass(PanoramaController, [{\n key: \"onZoom\",\n value: function onZoom(direction) {\n if (this.enable) {\n this.clearViewAnimation();\n var sensitivity = direction * this.param.zoomSensitivity * this.getCommonSensitivity();\n this.depth.input(0.0002 * sensitivity);\n this.needsUpdate = true;\n }\n } },\n {\n key: \"onTranslate\",\n value: function onTranslate() {} },\n {\n key: \"update\",\n value: function update(e) {\n this.rotateX.update(e);\n this.rotateY.update(e);\n this.depth.update(e);\n if (this.rotateX.dir || this.rotateY.dir || this.depth.dir) {\n this.needsUpdate = true;\n }\n var needsUpdate = this.needsUpdate;\n this.needsAutoRotate || this.isRunning === needsUpdate || needsUpdate || (this.needsAutoRotate = !0);\n 0 !== this.autoRotate && this.needsAutoRotate && this.rotateY.input(.001 * this.autoRotate);\n this.isRunning = needsUpdate;\n this.updateMatrix();\n } },\n {\n key: \"updateMatrix\",\n value: function updateMatrix() {\n if (this.needsUpdate) {\n var camera = this.camera,\n rotateX = this.rotateX,\n rotateY = this.rotateY,\n depth = this.depth;\n var rotation = multiplyAxisRotate(rotateX.value, rotateY.value);\n camera.matrix = rotation;\n camera.matrix.decompose(camera.position, camera.quaternion, camera.scale);\n camera.updateMatrixWorld(true);\n if (depth.value !== camera.fov) {\n camera.fov = depth.value;\n camera.updateProjectionMatrix();\n }\n tmpMatrix4_4.set(0, 0, -depth.value).applyMatrix4(rotation);\n this.onViewChange && this.onViewChange(tmpMatrix4_4, 0, 0, 0);\n this.needsUpdate = false;\n }\n } },\n {\n key: \"_bindEvent\",\n value: function _bindEvent() {\n if (!this.isMouseEnter) {\n this.dom.addEventListener(\"mousedown\", this.onMouseDown);\n this.dom.addEventListener(\"wheel\", this.onWheel);\n this.dom.oncontextmenu = function () {\n return false;\n };\n }\n } },\n {\n key: \"_removeEvent\",\n value: function _removeEvent() {\n if (this.isTouchDevice) {\n this.mobileGesture.removeEvent();\n } else {\n this.dom.removeEventListener(\"mousedown\", this.onMouseDown);\n this.dom.removeEventListener(\"wheel\", this.onWheel);\n document.removeEventListener(\"mousemove\", this.onMouseMove);\n document.removeEventListener(\"mouseup\", this.onMouseUp);\n }\n } },\n {\n key: \"getControlDataValues\",\n value: function getControlDataValues(e, t) {\n if (undefined !== e) {\n var _position = e;\n var _target = t;\n var mRotate = new THREE.Matrix4();\n mRotate.lookAt(_target, _position, new THREE.Vector3(0, 1, 0));\n var euler = new THREE.Euler();\n euler.setFromRotationMatrix(mRotate, \"YXZ\");\n var depth = tmpVec3_2.subVectors(_target, _position).length();\n return {\n translateX: 0,\n translateY: 0,\n translateZ: 0,\n rotateX: euler.x,\n rotateY: euler.y,\n depth: depth };\n\n }\n return {\n translateX: 0,\n translateY: 0,\n translateZ: 0,\n rotateX: this.rotateX.value,\n rotateY: this.rotateY.value,\n depth: this.depth.value };\n\n } },\n {\n key: \"onRotate\",\n value: function onRotate(e) {\n _get(_getPrototypeOf(PanoramaController.prototype), \"onRotate\", this).call(this, [-e[0], -e[1]]);\n } }]);\n\n return PanoramaController;\n }(ThreeFixedController);\n module.exports = {\n PanoramaController: PanoramaController };return module.exports;});", "requires": [ "pandav:/src/ThreeController/ThreeFixedController.js" ], "buildLevel": 4, "outputDir": "/com/submodule-three-3d/1.0.0/src/ThreeController", "outputPath": "/com/submodule-three-3d/1.0.0/src/ThreeController/PanoramaController.js", "fileName": "/src/ThreeController/PanoramaController.js" }, "pandav:/src/material/GradientMaterial.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/src/material/GradientMaterial\", [\"pandav:/com/three/0.145.0\", \"pandav:/com/submodule-three-3d/1.0.0/base-utils\"], function (module, exports, require, load, process, global) {\n\n function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}\n function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError(\"Cannot call a class as a function\");}}\n function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if (\"value\" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}\n function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, \"prototype\", { writable: false });return Constructor;}\n function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : String(i);}\n function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}\n function _callSuper(t, o, e) {return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));}\n function _possibleConstructorReturn(self, call) {if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {return call;} else if (call !== void 0) {throw new TypeError(\"Derived constructors may only return object or undefined\");}return _assertThisInitialized(self);}\n function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");}return self;}\n function _isNativeReflectConstruct() {try {var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));} catch (t) {}return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {return !!t;})();}\n function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}\n function _inherits(subClass, superClass) {if (typeof superClass !== \"function\" && superClass !== null) {throw new TypeError(\"Super expression must either be null or a function\");}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });Object.defineProperty(subClass, \"prototype\", { writable: false });if (superClass) _setPrototypeOf(subClass, superClass);}\n function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}\n var THREE = require('pandav:/com/three/0.145.0');\n var _require = require('pandav:/com/submodule-three-3d/1.0.0/base-utils'),\n deg2rad = _require.deg2rad;\n var GradientMaterial = function (_THREE$MeshStandardMa) {\n _inherits(GradientMaterial, _THREE$MeshStandardMa);\n function GradientMaterial(parameters) {\n var _this;\n _classCallCheck(this, GradientMaterial);\n _this = _callSuper(this, GradientMaterial, [parameters]);\n _this.vertexShader = vertex;\n _this.fragmentShader = fragment;\n _this.uniforms = THREE.UniformsUtils.merge([THREE.UniformsLib.common, THREE.UniformsLib.envmap, THREE.UniformsLib.aomap, THREE.UniformsLib.lightmap, THREE.UniformsLib.emissivemap, THREE.UniformsLib.bumpmap, THREE.UniformsLib.normalmap, THREE.UniformsLib.displacementmap, THREE.UniformsLib.roughnessmap, THREE.UniformsLib.metalnessmap, THREE.UniformsLib.fog, THREE.UniformsLib.lights, {\n emissive: {\n value: new THREE.Color(0) },\n\n roughness: {\n value: 1 },\n\n metalness: {\n value: 0 },\n\n reflectivityDecay: {\n value: 0 },\n\n envMapIntensity: {\n value: 1 },\n\n stopColors: {\n value: null },\n\n stopOffsets: {\n value: null },\n\n gradientAngle: {\n value: 0 } }]);\n\n\n _this.type = \"GradientMaterial\";\n _this.defines.STOP_COUNT = 1;\n _this.defines.USE_UV = false;\n return _this;\n }\n _createClass(GradientMaterial, [{\n key: \"setGradient\",\n value: function setGradient(e) {\n var pure = e.pure,\n type = e.type,\n value = e.value;\n var stopColors = [];\n var stopOffsets = [];\n var stopCount = 0;\n var gradientAngle = 0;\n if (\"pure\" == type) {\n stopCount = 2;\n stopColors.push(new THREE.AlphaColor(pure));\n stopOffsets.push(0);\n stopColors.push(new THREE.AlphaColor(pure));\n stopOffsets.push(1);\n } else if (\"linearGradient\" == type && value.stops.length > 0) {\n var stops = value.stops,\n opacity = value.opacity,\n angle = value.angle;\n stopCount = stops.length;\n gradientAngle = deg2rad(angle + 90);\n var _stops = stops.slice();\n _stops.sort(function (e, t) {\n return e.offset - t.offset;\n });\n _stops.forEach(function (e) {\n stopOffsets.push(e.offset / 100);\n var color = new THREE.AlphaColor(e.color);\n color.a *= opacity;\n stopColors.push(color);\n });\n }\n this.uniforms.stopColors = {\n value: stopColors };\n\n this.uniforms.stopOffsets = {\n value: stopOffsets };\n\n this.uniforms.gradientAngle = {\n value: gradientAngle };\n\n this.defines.STOP_COUNT = stopCount;\n } }]);\n\n return GradientMaterial;\n }(THREE.MeshStandardMaterial);\n var vertex = \"\\n#define STANDARD\\n\\nvarying vec3 vViewPosition;\\n\\n#ifdef USE_TRANSMISSION\\n\\n\\tvarying vec3 vWorldPosition;\\n\\n#endif\\n\\n#include \\n//#include \\nvarying vec2 vUv;\\nuniform mat3 uvTransform;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n\\nvoid main() {\\n\\t//#include \\n\\t#ifdef USE_UV\\n\\t\\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\\n\\t#else \\n\\t\\tvUv = uv;\\n\\t#endif\\n\\n\\t#include \\n\\t#include \\n\\t#include \\n\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\n\\tvViewPosition = - mvPosition.xyz;\\n\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\n#ifdef USE_TRANSMISSION\\n\\n\\tvWorldPosition = worldPosition.xyz;\\n\\n#endif\\n}\\n\";\n var fragment = \"\\n#define STANDARD\\n\\n#ifdef PHYSICAL\\n\\t#define IOR\\n\\t#define SPECULAR\\n#endif\\n\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float roughness;\\nuniform float metalness;\\nuniform float opacity;\\n\\n#ifdef IOR\\n\\tuniform float ior;\\n#endif\\n\\n#ifdef SPECULAR\\n\\tuniform float specularIntensity;\\n\\tuniform vec3 specularColor;\\n\\n\\t#ifdef USE_SPECULARINTENSITYMAP\\n\\t\\tuniform sampler2D specularIntensityMap;\\n\\t#endif\\n\\n\\t#ifdef USE_SPECULARCOLORMAP\\n\\t\\tuniform sampler2D specularColorMap;\\n\\t#endif\\n#endif\\n\\n#ifdef USE_CLEARCOAT\\n\\tuniform float clearcoat;\\n\\tuniform float clearcoatRoughness;\\n#endif\\n\\n#ifdef USE_IRIDESCENCE\\n\\tuniform float iridescence;\\n\\tuniform float iridescenceIOR;\\n\\tuniform float iridescenceThicknessMinimum;\\n\\tuniform float iridescenceThicknessMaximum;\\n#endif\\n\\n#ifdef USE_SHEEN\\n\\tuniform vec3 sheenColor;\\n\\tuniform float sheenRoughness;\\n\\n\\t#ifdef USE_SHEENCOLORMAP\\n\\t\\tuniform sampler2D sheenColorMap;\\n\\t#endif\\n\\n\\t#ifdef USE_SHEENROUGHNESSMAP\\n\\t\\tuniform sampler2D sheenRoughnessMap;\\n\\t#endif\\n#endif\\n\\nvarying vec3 vViewPosition;\\n\\n#include \\n#include \\n#include \\n#include \\n\\n//#include \\nvarying vec2 vUv;\\n\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n\\nuniform vec4 stopColors[STOP_COUNT];\\nuniform float stopOffsets[STOP_COUNT];\\nuniform float gradientAngle;\\n\\nvec4 getGradientColor(){\\n\\tfloat ra=mod(gradientAngle,PI);\\n\\tif(ra>PI/2.0) ra=PI-ra;\\n\\tif(ra>PI/4.0) ra=PI/2.0-ra;\\n\\tfloat radius=0.5/cos(ra);\\n\\t//\\u8BA1\\u7B97\\u8F74\\u7EBF\\n\\t//\\u5916\\u5207\\u5706\\u4E0A\\u4E24\\u4E2A\\u70B9\\u89D2\\u5EA6\\n\\tfloat startAngle=gradientAngle,endAngle=gradientAngle+PI;\\n\\t//\\u8BA1\\u7B97\\u5F00\\u59CB\\u548C\\u7ED3\\u675F\\u7684\\u70B9\\n\\tvec2 start=vec2(cos(startAngle)*radius+0.5,sin(startAngle)*radius+0.5);\\n\\tvec2 end=vec2(cos(endAngle)*radius+0.5,sin(endAngle)*radius+0.5);\\n\\t//\\u8F74\\u7EBF\\u5411\\u91CF\\n\\tvec2 axis=end-start;\\n\\t//\\u5F53\\u524D\\u70B9\\u4E8E\\u8F74\\u7EBF\\u7684\\u76F8\\u4F3C\\u7A0B\\u5EA6\\uFF08\\u70B9\\u4E58\\uFF09\\n\\tfloat p=dot(vUv-start,axis)/length(axis)/length(axis);\\n\\t//\\u4E0D\\u5F97\\u8D85\\u51FA\\u8303\\u56F4\\n\\tp=clamp(p,0.0,1.0);\\n\\tvec4 diffuseColor=vec4(1.0); //\\u5339\\u914D\\u4E0D\\u5230\\u989C\\u8272\\u533A\\u95F4\\u662F\\u7ED9\\u4E2A\\u9ED8\\u8BA4\\u989C\\u8272\\n\\tfor(int i = 0; i < STOP_COUNT - 1; i++){\\n\\t\\tif(p>=stopOffsets[i] && p<=stopOffsets[i+1]){\\n\\t\\t\\tfloat ratio = (p-stopOffsets[i])/(stopOffsets[i+1]-stopOffsets[i]);\\n\\t\\t\\tdiffuseColor=stopColors[i] + (stopColors[i+1]-stopColors[i])*ratio;\\n\\t\\t\\tbreak;\\n\\t\\t}\\n\\t}\\n\\treturn diffuseColor;\\n}\\n\\nvoid main() {\\n\\n\\t#include \\n\\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\\n\\t#include \\n\\t#include \\n\\n\\t//#include \\n diffuseColor = getGradientColor();\\n\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\n\\t// accumulation\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\n\\t// modulation\\n\\t#include \\n\\n\\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\\n\\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\\n\\n\\t#include \\n\\n\\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\\n\\n\\t#ifdef USE_SHEEN\\n\\n\\t\\t// Sheen energy compensation approximation calculation can be found at the end of\\n\\t\\t// https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing\\n\\t\\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\\n\\n\\t\\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\\n\\n\\t#endif\\n\\n\\t#ifdef USE_CLEARCOAT\\n\\n\\t\\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\\n\\n\\t\\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\\n\\n\\t\\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\\n\\n\\t#endif\\n\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t// #include \\n\\t#include \\n\\t// #include \\n\\t#include \\n}\\n\";\n module.exports = {\n GradientMaterial: GradientMaterial };return module.exports;});", "requires": [ "pandav:/base-utils/index.js" ], "buildLevel": 6, "outputDir": "/com/submodule-three-3d/1.0.0/src/material", "outputPath": "/com/submodule-three-3d/1.0.0/src/material/GradientMaterial.js", "fileName": "/src/material/GradientMaterial.js" }, "pandav:/src/utils.js": { "cubeCode": "Cube(\"pandav:/com/submodule-three-3d/1.0.0/src/utils\", [\"pandav:/com/three/0.145.0\"], function (module, exports, require, load, process, global) {\n\n var THREE = require('pandav:/com/three/0.145.0');\n function clamp(v, min, max) {\n if (v > max) {\n return max;\n } else if (v < min) {\n return min;\n } else {\n return v;\n }\n }\n function getWorldBoundingBox(obj) {\n var recurve = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var list = [];\n if (obj instanceof Mesh && obj.geometry) {\n var geo = obj.geometry;\n if (!geo.boundingBox) {\n geo.computeBoundingBox();\n }\n obj.updateMatrixWorld();\n var box = geo.boundingBox;\n var min = new Vector3();\n min.copy(box.min);\n min.applyMatrix4(obj.matrixWorld);\n var max = new Vector3();\n max.copy(box.max);\n max.applyMatrix4(obj.matrixWorld);\n list.push(new Box3(min, max));\n }\n if (obj instanceof Object3D && recurve) {\n obj.children.forEach(function (o) {\n list.push(getWorldBoundingBox(o, recurve));\n });\n if (list.length > 0) {\n var _min = list[0].min,\n _max = list[0].max;\n list.forEach(function (b) {\n if (b.max.x > _max.x) _max.x = b.max.x;\n if (b.max.y > _max.y) _max.y = b.max.y;\n if (b.max.z > _max.z) _max.z = b.max.z;\n if (b.min.x < _min.x) _min.x = b.min.x;\n if (b.min.y < _min.y) _min.y = b.min.y;\n if (b.min.z < _min.z) _min.z = b.min.z;\n });\n return new Box3(_min, _max);\n } else {\n return null;\n }\n } else {\n return null;\n }\n }\n function setObjectMatrix(object, matrix) {\n if (object.matrixAutoUpdate) object.updateMatrix();\n object.matrix = matrix;\n object.matrix.decompose(object.position, object.quaternion, object.scale);\n }\n function syncChildrenLayers(obj) {\n syncChildrenLayersRecurve(obj, obj.layers, obj.reflectingLayers);\n }\n function syncChildrenLayersRecurve(obj, layer, reflectingLayers) {\n for (var i = 0, len = obj.children.length; i < len; i++) {\n syncChildrenLayersRecurve(obj.children[i], layer, reflectingLayers);\n }\n obj.layers.mask = layer.mask;\n obj.reflectingLayers.mask = reflectingLayers.mask;\n }\n function getModelFormat(url) {\n var _url = url.toLocaleLowerCase();\n if (_url.endsWith(\".gltf\") || _url.endsWith(\".glb\")) {\n return \"gltf\";\n } else if (_url.endsWith(\".fbx\")) {\n return \"fbx\";\n } else {\n return null;\n }\n }\n function createHDRRenderTarget(width, height) {\n var rt = new THREE.WebGLRenderTarget(width, height, {\n format: THREE.RGBAFormat });\n\n rt.texture.type = THREE.HalfFloatType;\n rt.texture.format = THREE.RGBAFormat;\n rt.texture.internalFormat = \"RGBA16F\";\n rt.texture.needsUpdate = true;\n return rt;\n }\n function traverseGeojsonShape(geojson, callback) {\n try {\n if (Array.isArray(geojson.features)) {\n geojson.features.forEach(function (feature, i) {\n switch (feature.geometry.type) {\n case \"LineString\":\n callback(feature.geometry.coordinates, String(i), feature);\n break;\n case \"MultiLineString\":\n case \"Polygon\":\n feature.geometry.coordinates.forEach(function (coordinate, j) {\n callback(coordinate, i + \"_\" + j, feature);\n });\n break;\n case \"MultiPolygon\":\n feature.geometry.coordinates.forEach(function (coordinate, j) {\n coordinate.forEach(function (points, k) {\n callback(points, i + \"_\" + j + \"_\" + k, feature);\n });\n });\n break;\n default:\n console.log(\"invalid geojson geometry type\");\n break;}\n\n });\n }\n } catch (e) {\n console.log(\"遍历geojson失败\", e);\n }\n }\n module.exports = {\n clamp: clamp,\n getWorldBoundingBox: getWorldBoundingBox,\n setObjectMatrix: setObjectMatrix,\n syncChildrenLayers: syncChildrenLayers,\n getModelFormat: getModelFormat,\n createHDRRenderTarget: createHDRRenderTarget,\n traverseGeojsonShape: traverseGeojsonShape };return module.exports;});", "requires": [], "buildLevel": 5, "outputDir": "/com/submodule-three-3d/1.0.0/src", "outputPath": "/com/submodule-three-3d/1.0.0/src/utils.js", "fileName": "/src/utils.js" }, "pandav:/src/ThreeComponent.js": { "cubeCode": "Cube('pandav:/com/submodule-three-3d/1.0.0/src/ThreeComponent',['pandav:/com/three/0.145.0','pandav:/npm/react/17.0.2','pandav:/com/submodule-three-3d/1.0.0/base-utils','pandav:/com/submodule-three-3d/1.0.0/src/EObjectContainer','pandav:/com/submodule-three-3d/1.0.0/src/utils','pandav:/com/submodule-three-3d/1.0.0/src/AssetsMgr','pandav:/npm/lodash/4.6.1'],function(a,b,c){function d(a){\"@babel/helpers - typeof\";return d='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&'function'==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?'symbol':typeof a},d(a)}function e(b,a){if(!(b instanceof a))throw new TypeError('Cannot call a class as a function')}function f(a,b){for(var c,d=0;d=f.firstLoadedTimer&&(f.isFirstLoaded=!0,f.onFirstLoaded(),f._onFirstLoadedCallbacks.forEach(function(a){return a()}));var a=new Date().getTime(),b=f.statisInfo,c=a-f.lastTimestamp;if(f.lastTimestamp=a,f.isFirstLoaded){for(var e=f._childContainer.list,g=0;gl.frameCount?(f.currentFrameCallbacks.push(l.callback),f.nextFrameCallbacks.splice(m,1),m--):l.frameCount--;if(0this._onFirstLoadedCallbacks.indexOf(a)&&this._onFirstLoadedCallbacks.push(a)}},{key:'removeFirstLoadedCallback',value:function b(a){var c=this._onFirstLoadedCallbacks.indexOf(a);0<=c&&this._onFirstLoadedCallbacks.splice(c,1)}},{key:'sleep',value:function a(){this.setState({isSlept:!0})}},{key:'awake',value:function a(){this.resetAll(),this.setState({isSlept:!1})}},{key:'addLight',value:function b(a){0<=this.lightList.indexOf(a)||(a.layers.enableAll(),a.reflectingLayers.enableAll(),this.scene.add(a),this.lightList.push(a))}},{key:'removeLight',value:function b(a){var c=this.lightList.indexOf(a);0>c||(this.scene.remove(a),this.lightList.splice(c,1))}},{key:'dispose',value:function a(){this.disposeList.forEach(function(a){return a.dispose()}),this.disposeList=[],this.renderer.dispose(),this.renderer.forceContextLoss(),this.refCanvasContainer?.removeChild(this.refCanvas),this.renderer=null,this.refCanvas=null,this.assetsMgr.dispose(),this.assetsMgr=null}},{key:'render',value:function a(){var b=this,c=this.props,d=c.left,e=c.top,f=c.width,g=c.height,h=c.id,i={position:'absolute',left:d,top:e,width:f,height:g,textAlign:'center',cursor:'default',display:this.state.isSlept?'none':'block',fontSize:1/this.editorScale+'em'},j={position:'absolute',width:'100%',height:'100%',overflow:'hidden',left:0,top:0};return t.createElement('div',{className:'__pandav-component',style:i,id:h,ref:function c(a){return b.refDomRoot=a}},[t.createElement('div',{key:'3D',ref:function c(a){return b.refDom3D=a},style:Object.assign({},j,{pointerEvents:'auto'}),onMouseMove:this.onMouseMoveDOMRoot},[t.createElement('div',{ref:function c(a){return b.refCanvasContainer=a},style:{width:'100%',height:'100%',pointerEvents:'none'}}),t.createElement('div',{style:Object.assign(j,{pointerEvents:'none',overflow:'hidden'}),key:'DomObjectLayer',ref:function c(a){return b.refHTMLObjectRoot=a}})]),t.createElement('div',{style:Object.assign(j,{pointerEvents:'none'})},this.renderUI())])}},{key:'renderUI',value:function a(){return null}},{key:'setFocusChild',value:function b(a){this._childContainer.list.forEach(function(b){null===a||b.props.id===a?b.onFocusVisible():b.onFocusUnvisible()})}},{key:'componentDidMount',value:function a(){this.onInit(),this.didMount(),this.update(),this.lateRender()}},{key:'componentWillUnmount',value:function a(){this._childContainer.clear(),cancelAnimationFrame(this.updateHandle),this.willUnmount(),this.dispose()}},{key:'onFirstLoaded',value:function a(){}},{key:'_refresh',value:function b(a){var c=document.querySelector('#m-simulator');if(this.editorScale=1,c){var d=c.style.transform;if(d){var e=+d.split('scale(')[1].split(')')[0];isNaN(e)||(this.editorScale=e)}}this.config=a.configuration,this._reduceChildrenProps(a),this.onBeforeReactRender()}},{key:'onBeforeReactRender',value:function a(){}},{key:'lateRender',value:function a(){var b=this;this.preRefresh();var c=[];this.childrenPropsMap.forEach(function(a){var d=b.childClassMap[a.moduleName];d&&c.push(Object.assign(Object.assign({},a),{},{_cls:d}))}),this.refreshChildContainer(c),this.loadRes()}},{key:'preRefresh',value:function a(){}},{key:'refreshChildContainer',value:function b(a){this._childContainer.refresh(a,{deep:['configuration','data'],ref:['context']})}},{key:'loadRes',value:function a(){var b=this.getAssetsListMap();for(var c in this._childContainer.list.forEach(function(a){var c=a.getAssetsListMap();for(var d in c){var e=d;b[e]||(b[e]=[]),b[e]=b[e].concat(c[e])}}),b)this.assetsMgr.push(c,b[c]);this.assetsMgr.onLoaded=this.onAssetsLoaded,this.assetsMgr.load()}},{key:'onFirstRefreshed',value:function a(){}},{key:'getAsyncProcess',value:function a(){return null}},{key:'onChildrenRefreshed',value:function a(){}},{key:'getAssetsListMap',value:function a(){return{}}},{key:'refreshChild',value:function a(){for(var b=this._childContainer.list,c=0;c 0) {\n that.onZoom(1);\n } else if (wheelDelta < 0) {\n that.onZoom(-1);\n }\n };\n this.onKeyDown = function (e) {\n if (!e.repeat) {\n if (e.shiftKey) {\n that.updateTargetPoint();\n that.isHighSensitivity = true;\n e.preventDefault();\n }\n if (e.altKey) {\n that.updateTargetPoint();\n that.isSlowSensitivity = true;\n e.preventDefault();\n }\n var keyMap = {\n \"KeyW\": function KeyW() {\n that.updateTargetPoint();\n that.keyboardMoveMap.set(\"W\", true);\n },\n \"KeyA\": function KeyA() {\n that.updateTargetPoint();\n that.keyboardMoveMap.set(\"A\", true);\n },\n \"KeyS\": function KeyS() {\n that.updateTargetPoint();\n that.keyboardMoveMap.set(\"S\", true);\n },\n \"KeyD\": function KeyD() {\n that.updateTargetPoint();\n that.keyboardMoveMap.set(\"D\", true);\n },\n \"KeyQ\": function KeyQ() {\n that.updateTargetPoint();\n that.keyboardMoveMap.set(\"Q\", true);\n },\n \"KeyE\": function KeyE() {\n that.updateTargetPoint();\n that.keyboardMoveMap.set(\"E\", true);\n },\n \"KeyP\": function KeyP() {\n if (that.targetMode === TargetMode.Manual) {\n that.isFirstPerson = true;\n that.firstPersonSensitivity = that.depth.value;\n that.applyLimit(false);\n that.depth.setValueDirectly(0);\n that.translateX.setValueWithoutLimit(that.camera.position.x);\n that.translateY.setValueWithoutLimit(that.camera.position.y);\n that.translateZ.setValueWithoutLimit(that.camera.position.z);\n that.needsUpdate = true;\n }\n },\n \"KeyF\": function KeyF() {\n if (e.altKey && that.targetMode === TargetMode.Manual) {\n that.updateTargetPoint();\n }\n } };\n\n if (keyMap[e.code]) {\n keyMap[e.code]();\n e.preventDefault();\n }\n }\n };\n this.updateTargetPointCounter = 0;\n this.updateTargetPointInterval = 30;\n this.keyboardMoveMap = new Map();\n this.onKeyUp = function (e) {\n if (!e.shiftKey) {\n that.isHighSensitivity = false;\n e.preventDefault();\n }\n if (!e.altKey) {\n that.isSlowSensitivity = false;\n e.preventDefault();\n }\n var keyMap = {\n \"KeyW\": function KeyW() {\n return that.keyboardMoveMap.delete(\"W\");\n },\n \"KeyA\": function KeyA() {\n return that.keyboardMoveMap.delete(\"A\");\n },\n \"KeyS\": function KeyS() {\n return that.keyboardMoveMap.delete(\"S\");\n },\n \"KeyD\": function KeyD() {\n return that.keyboardMoveMap.delete(\"D\");\n },\n \"KeyQ\": function KeyQ() {\n return that.keyboardMoveMap.delete(\"Q\");\n },\n \"KeyE\": function KeyE() {\n return that.keyboardMoveMap.delete(\"E\");\n } };\n\n if (keyMap[e.code]) {\n keyMap[e.code]();\n e.preventDefault();\n }\n };\n this.isRunning = false;\n this.needsAutoRotate = true;\n this.camera = camera;\n this.dom = dom;\n this.isTouchDevice = \"ontouchstart\" in window;\n camera.matrixAutoUpdate = false;\n this.init();\n this.param = Object.assign(this.param, param);\n }\n _createClass(ThreeFixedController, [{\n key: \"setAnimationEnabled\",\n value: function setAnimationEnabled(e) {\n this.rotateX.useAnimation = e;\n this.rotateY.useAnimation = e;\n this.translateX.useAnimation = e;\n this.translateY.useAnimation = e;\n this.translateZ.useAnimation = e;\n this.depth.useAnimation = e;\n } },\n {\n key: \"getHelper\",\n value: function getHelper() {} },\n {\n key: \"setLimitEnabled\",\n value: function setLimitEnabled(v) {\n this.limitEnabled = v;\n this.applyLimit(v);\n } },\n {\n key: \"applyLimit\",\n value: function applyLimit(v) {\n this.depth.limitEnabled = v;\n this.rotateX.limitEnabled = v;\n this.rotateY.limitEnabled = v;\n this.translateX.limitEnabled = v;\n this.translateY.limitEnabled = v;\n this.translateZ.limitEnabled = v;\n } },\n {\n key: \"setLimit\",\n value: function setLimit(params) {\n if (params.depth !== undefined) {\n this.depth.valueLimit = params.depth;\n }\n if (params.rotateX !== undefined) {\n this.rotateX.valueLimit = params.rotateX;\n }\n if (params.rotateY !== undefined) {\n this.rotateY.valueLimit = params.rotateY;\n }\n if (params.translateX !== undefined) {\n this.translateX.valueLimit = params.translateX;\n }\n if (params.translateY !== undefined) {\n this.translateY.valueLimit = params.translateY;\n }\n if (params.translateZ !== undefined) {\n this.translateZ.valueLimit = params.translateZ;\n }\n } },\n {\n key: \"setActionKey\",\n value: function setActionKey(rotate, translate) {\n this.actionKey.rotateKey = rotate;\n this.actionKey.translateKey = translate;\n } },\n {\n key: \"init\",\n value: function init() {\n if (this.isTouchDevice) {\n this.mobileGesture.bindEvent();\n } else {\n this.bindEvent();\n }\n this.updateDomSize();\n } },\n {\n key: \"onSetTarget\",\n value: function onSetTarget() {\n this.isFirstPerson = false;\n this.applyLimit(this.limitEnabled);\n } },\n {\n key: \"bindEvent\",\n value: function bindEvent() {\n var dom = this.dom;\n dom.addEventListener(\"mouseenter\", this.onMouseEnter);\n dom.addEventListener(\"mouseleave\", this.onMouseLeave);\n window.addEventListener(\"keyup\", this.onKeyUp);\n } },\n {\n key: \"_bindEvent\",\n value: function _bindEvent() {\n if (!this.isMouseEnter) {\n this.dom.addEventListener(\"mousedown\", this.onMouseDown);\n this.dom.addEventListener(\"wheel\", this.onWheel);\n this.dom.oncontextmenu = function () {\n return false;\n };\n window.addEventListener(\"keydown\", this.onKeyDown);\n }\n } },\n {\n key: \"removeEvent\",\n value: function removeEvent() {\n this.isTouchDevice && this.mobileGesture.removeEvent();\n var dom = this.dom;\n dom.removeEventListener(\"mouseenter\", this.onMouseEnter);\n dom.removeEventListener(\"mouseleave\", this.onMouseLeave);\n document.removeEventListener(\"keyup\", this.onKeyUp);\n } },\n {\n key: \"_removeEvent\",\n value: function _removeEvent() {\n if (this.isTouchDevice) {\n this.mobileGesture.removeEvent();\n } else {\n this.dom.removeEventListener(\"mousedown\", this.onMouseDown);\n this.dom.removeEventListener(\"wheel\", this.onWheel);\n document.removeEventListener(\"mousemove\", this.onMouseMove);\n document.removeEventListener(\"mouseup\", this.onMouseUp);\n window.removeEventListener(\"keydown\", this.onKeyDown);\n }\n } },\n {\n key: \"updateDomSize\",\n value: function updateDomSize() {\n var rect = this.dom.getBoundingClientRect();\n if (rect.width !== 0 && rect.height !== 0) {\n this.domSize = [rect.width, rect.height];\n }\n } },\n {\n key: \"updateTargetPoint\",\n value: function updateTargetPoint() {\n if (this.targetMode === TargetMode.Auto && this.updateTargetPointCounter >= this.updateTargetPointInterval) {\n this.updateTargetPointCounter = 0;\n var screen = this.getScreenCenterDepth();\n if (screen) {\n this.setTargetPoint(e);\n }\n }\n } },\n {\n key: \"updateKeyboardMove\",\n value: function updateKeyboardMove() {\n if (this.keyboardMoveMap.size <= 0) {\n this.translateX.removeConstantVelocity(\"keyboardMove\");\n this.translateY.removeConstantVelocity(\"keyboardMove\");\n this.translateZ.removeConstantVelocity(\"keyboardMove\");\n return;\n }\n this.clearViewAnimation();\n var direction = new THREE.Vector3(0, 0, 0);\n var movementMap = {\n \"W\": new THREE.Vector3(0, 0, -1),\n \"S\": new THREE.Vector3(0, 0, 1),\n \"A\": new THREE.Vector3(-1, 0, 0),\n \"D\": new THREE.Vector3(1, 0, 0),\n \"Q\": new THREE.Vector3(0, -1, 0),\n \"E\": new THREE.Vector3(0, 1, 0) };\n\n for (var key in movementMap) {\n if (this.keyboardMoveMap.has(key)) {\n direction.add(movementMap[key]);\n }\n }\n var rotation = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 1, 0), this.rotateY.value);\n direction.applyQuaternion(rotation);\n var sensitivity = this.param.keyboardMoveSensitivity * this.getCommonSensitivity();\n direction.multiplyScalar(0.0004 * sensitivity);\n this.translateX.setConstantVelocity(\"keyboardMove\", direction.x);\n this.translateY.setConstantVelocity(\"keyboardMove\", direction.y);\n this.translateZ.setConstantVelocity(\"keyboardMove\", direction.z);\n } },\n {\n key: \"setTargetPoint\",\n value: function setTargetPoint(e) {\n var position = new THREE.Vector3(0, 0, -1);\n var rotate = multiplyAxisRotate(this.rotateX.value, this.rotateY.value);\n position.applyMatrix4(rotate);\n position.multiplyScalar(e);\n var target = new THREE.Vector3().copy(this.camera.position).add(position);\n this.translateX.value = target.x;\n this.translateY.value = target.y;\n this.translateZ.value = target.z;\n this.depth.value = e;\n this.needsUpdate = true;\n } },\n {\n key: \"setView\",\n value: function setView(position, target) {\n this.viewAnimation && this.viewAnimation.destroy();\n var _this$getControlDataV = this.getControlDataValues(position, target),\n rotateX = _this$getControlDataV.rotateX,\n rotateY = _this$getControlDataV.rotateY,\n depth = _this$getControlDataV.depth,\n translateX = _this$getControlDataV.translateX,\n translateY = _this$getControlDataV.translateY,\n translateZ = _this$getControlDataV.translateZ;\n this.depth.setValueWithoutLimit(depth);\n this.rotateX.setValueWithoutLimit(rotateX);\n this.rotateY.setValueWithoutLimit(rotateY);\n this.translateX.setValueWithoutLimit(translateX);\n this.translateY.setValueWithoutLimit(translateY);\n this.translateZ.setValueWithoutLimit(translateZ);\n this.needsUpdate = true;\n this.onSetTarget();\n } },\n {\n key: \"viewTo\",\n value: function viewTo(a1, a2, a3, a4, a5) {\n this.clearViewAnimation();\n var dstValues;\n var duration;\n if (typeof a3 === \"number\") {\n var _this$getControlDataV2 = this.getControlDataValues(a1, a2),\n rotateX = _this$getControlDataV2.rotateX,\n rotateY = _this$getControlDataV2.rotateY,\n depth = _this$getControlDataV2.depth,\n translateX = _this$getControlDataV2.translateX,\n translateY = _this$getControlDataV2.translateY,\n translateZ = _this$getControlDataV2.translateZ;\n duration = a3;\n dstValues = {\n depth: depth,\n translateX: translateX,\n translateY: translateY,\n translateZ: translateZ,\n rotateX: rotateX,\n rotateY: rotateY };\n\n this.viewAnimation = new ViewAnimation(this, dstValues, duration, a4 || EaseType.EaseInOut, a5 === undefined ? 1.8 : a5);\n } else {\n dstValues = a1;\n duration = a2;\n this.viewAnimation = new ViewAnimation(this, dstValues, duration, a3 || EaseType.EaseInOut, a4 === undefined ? 1.8 : a4);\n }\n this.onSetTarget();\n return this.viewAnimation;\n } },\n {\n key: \"focusPoint\",\n value: function focusPoint(translate, depth, duration) {\n if (this.focusEnabled) {\n this.clearViewAnimation();\n var dstValues = {\n depth: depth,\n translateX: translate.x,\n translateY: translate.y,\n translateZ: translate.z,\n rotateX: this.rotateX.value,\n rotateY: this.rotateY.value };\n\n this.onSetTarget();\n this.viewAnimation = new ViewAnimation(this, dstValues, duration, EaseType.EaseInOut, 1.8);\n }\n } },\n {\n key: \"focusMesh\",\n value: function focusMesh(info, duration) {\n var radius = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n if (this.focusEnabled && info.geometry) {\n null === info.geometry.boundingSphere && info.geometry.computeBoundingSphere();\n var matrix = boundSphere.copy(info.geometry.boundingSphere).applyMatrix4(info.matrixWorld);\n this.focusPoint(matrix.center, 3 * matrix.radius * radius, duration);\n }\n } },\n {\n key: \"focusUI\",\n value: function focusUI(info, duration) {\n var radius = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n if (this.focusEnabled) {\n var dis = this.standardViewDistance * radius * 0.4;\n this.focusPoint(info, dis, duration);\n }\n } },\n {\n key: \"clearViewAnimation\",\n value: function clearViewAnimation() {\n this.viewAnimation && this.viewAnimation.destroy();\n } },\n {\n key: \"getControlDataValues\",\n value: function getControlDataValues(a, b) {\n if (a !== undefined) {\n var _position = a;\n var _target = b;\n var mRotate = new THREE.Matrix4();\n mRotate.lookAt(_position, _target, new THREE.Vector3(0, 1, 0));\n var euler = new THREE.Euler();\n euler.setFromRotationMatrix(mRotate, \"YXZ\");\n var d = tmpVec3_2.subVectors(_target, _position);\n return {\n translateX: _target.x,\n translateY: _target.y,\n translateZ: _target.z,\n rotateX: euler.x,\n rotateY: euler.y,\n depth: d.length() };\n\n } else {\n return {\n translateX: this.translateX.value,\n translateY: this.translateY.value,\n translateZ: this.translateZ.value,\n rotateX: this.rotateX.value,\n rotateY: this.rotateY.value,\n depth: this.depth.value };\n\n }\n } },\n {\n key: \"setControlDataValues\",\n value: function setControlDataValues(values) {\n this.translateX.value = values.translateX;\n this.translateY.value = values.translateY;\n this.translateZ.value = values.translateZ;\n this.rotateX.value = values.rotateX;\n this.rotateY.value = values.rotateY;\n this.depth.value = values.depth;\n this.onSetTarget();\n this.needsUpdate = true;\n } },\n {\n key: \"getCommonSensitivity\",\n value: function getCommonSensitivity() {\n var ratio = 1;\n if (this.isHighSensitivity && !this.isSlowSensitivity) {\n ratio = 3;\n } else if (this.isSlowSensitivity && !this.isHighSensitivity) {\n ratio = 1 / 3;\n }\n if (this.param.autoSensitivity) {\n ratio *= this.isFirstPerson ? this.firstPersonSensitivity : this.depth.value;\n }\n return ratio;\n } },\n {\n key: \"onTranslate\",\n value: function onTranslate(delta) {\n if (this.enable) {\n this.clearViewAnimation();\n var sensitivity = 0.0016 * 1.5 * this.param.translateSensitivity * this.getCommonSensitivity();\n var dX = delta[0] * sensitivity;\n var dY = -delta[1] * sensitivity;\n tmpVec3_0.set(dX, dY, 0);\n if (this.targetMode === TargetMode.PlaneConstraint) {\n tmpQuaternion_0.setFromUnitVectors(tmpVec3, this.targetConstraintPlane.normal);\n tmpVec3_0.applyQuaternion(tmpQuaternion_0);\n tmpVec3_0.applyEuler(tmpEuler_1.set(0, this.rotateY.value, 0));\n } else {\n tmpVec3_0.applyQuaternion(this.camera.quaternion);\n }\n this.translateX.input(tmpVec3_0.x);\n this.translateY.input(tmpVec3_0.y);\n this.translateZ.input(tmpVec3_0.z);\n this.needsUpdate = true;\n }\n } },\n {\n key: \"onRotate\",\n value: function onRotate(dir) {\n if (this.enable) {\n this.needsAutoRotate = false;\n this.clearViewAnimation();\n var sensitivityX = this.param.rotateXSensitivity * (.01 * .7);\n var sensitivityY = this.param.rotateYSensitivity * (.01 * .7);\n this.rotateX.input(dir[1] * sensitivityX);\n this.rotateY.input(dir[0] * sensitivityY);\n this.needsUpdate = true;\n }\n } },\n {\n key: \"onZoom\",\n value: function onZoom(direction) {\n if (this.enable) {\n this.clearViewAnimation();\n var sensitivity = direction * this.param.zoomSensitivity * this.getCommonSensitivity();\n if (this.isFirstPerson) {\n var quaternion = this.camera.quaternion;\n tmpVec3_0.set(0, 0, 0.0002 * sensitivity).applyQuaternion(quaternion);\n this.translateX.input(tmpVec3_0.x);\n this.translateY.input(tmpVec3_0.y);\n this.translateZ.input(tmpVec3_0.z);\n } else {\n this.depth.input(0.0002 * sensitivity);\n }\n this.needsUpdate = true;\n }\n } },\n {\n key: \"update\",\n value: function update(e) {\n this.rotateX.update(e);\n this.rotateY.update(e);\n this.translateX.update(e);\n this.translateY.update(e);\n this.translateZ.update(e);\n this.depth.update(e);\n if (this.rotateX.dir || this.rotateY.dir || this.translateX.dir || this.translateY.dir || this.translateZ.dir || this.depth.dir) {\n this.needsUpdate = true;\n }\n var needsUpdate = this.needsUpdate;\n if (this.needsAutoRotate || this.isRunning === needsUpdate || needsUpdate) {\n this.needsAutoRotate = true;\n }\n this.autoRotate !== 0 && this.needsAutoRotate && this.rotateY.input(0.00001 * this.autoRotate);\n this.isRunning = needsUpdate;\n this.updateMatrix();\n this.updateTargetPointCounter++;\n } },\n {\n key: \"updateMatrix\",\n value: function updateMatrix() {\n if (this.needsUpdate) {\n var camera = this.camera,\n rotateX = this.rotateX,\n rotateY = this.rotateY,\n depth = this.depth,\n translateX = this.translateX,\n translateY = this.translateY,\n translateZ = this.translateZ;\n var translation = tmpMatrix4_3.makeTranslation(translateX.value, translateY.value, translateZ.value);\n var rotation = multiplyAxisRotate(rotateX.value, rotateY.value);\n var depthTranslation = tmpMatrix4_4.makeTranslation(0, 0, depth.value);\n rotation.multiply(depthTranslation);\n translation.multiply(rotation);\n camera.matrix = translation;\n camera.matrix.decompose(camera.position, camera.quaternion, camera.scale);\n camera.updateMatrixWorld(true);\n if (this.onViewChange) {\n this.onViewChange(camera.position, translateX.value, translateY.value, translateZ.value);\n }\n this.needsUpdate = false;\n }\n } },\n {\n key: \"dispose\",\n value: function dispose() {\n this.removeEvent();\n this.camera.matrixAutoUpdate = true;\n this.clearViewAnimation();\n } }]);\n\n return ThreeFixedController;\n }();\n var tmpMatrix4_3 = new THREE.Matrix4();\n var tmpMatrix4_4 = new THREE.Matrix4();\n var tmpVec3_0 = new THREE.Vector3();\n var tmpVec3_1 = new THREE.Vector3();\n var tmpEuler_0 = new THREE.Euler(0, 0, 0, \"YXZ\");\n var tmpQuaternion_0 = new THREE.Quaternion();\n var tmpEuler_1 = new THREE.Euler(0, 0, 0);\n var tmpMatrix4_0 = new THREE.Matrix4();\n var tmpMatrix4_1 = new THREE.Matrix4();\n function multiplyAxisRotate(rotateX, rotateY) {\n var mY = tmpMatrix4_0.makeRotationX(rotateX);\n var mX = tmpMatrix4_1.makeRotationY(rotateY);\n mY.premultiply(mX);\n return mY;\n }\n var ControlData = function () {\n function ControlData(initValue) {\n var mustBePositive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n _classCallCheck(this, ControlData);\n this.velocity = 0;\n this._value = 0;\n this.dir = false;\n this.valueLimit = null;\n this.limitEnabled = true;\n this.mustBePositive = undefined;\n this.useAnimation = true;\n this.constantVelocityMap = new Map();\n this.value = initValue;\n this.mustBePositive = mustBePositive;\n }\n _createClass(ControlData, [{\n key: \"value\",\n get: function get() {\n return this._value;\n },\n set: function set(e) {\n if (e !== this._value) {\n if (this.limitEnabled && this.valueLimit) {\n if (this.valueLimit[0] !== null) {\n this._value = Math.max(this.valueLimit[0], e);\n }\n if (this.valueLimit[1] !== null) {\n this._value = Math.min(this.valueLimit[1], this._value);\n }\n } else {\n this._value = e;\n }\n if (this.mustBePositive) {\n this._value = Math.max(this._value, 0.001);\n }\n }\n } },\n {\n key: \"setValueWithoutLimit\",\n value: function setValueWithoutLimit(e) {\n if (e !== this._value) {\n this._value = e;\n this.mustBePositive && (this._value = Math.max(this._value, .001));\n }\n } },\n {\n key: \"setValueDirectly\",\n value: function setValueDirectly(e) {\n if (e !== this._value) {\n this._value = e;\n }\n } },\n {\n key: \"input\",\n value: function input(e) {\n if (this.useAnimation) {\n this.velocity += e;\n } else {\n this.value -= 100 * e;\n this.dir = true;\n }\n } },\n {\n key: \"setConstantVelocity\",\n value: function setConstantVelocity(e, t) {\n this.constantVelocityMap.set(e, t);\n } },\n {\n key: \"removeConstantVelocity\",\n value: function removeConstantVelocity(e) {\n this.constantVelocityMap.delete(e);\n } },\n {\n key: \"update\",\n value: function update(e) {\n this.dir = false;\n var velocity = Math.abs(this.velocity);\n var diffSign = this.velocity > 0 ? 1 : -1;\n if (velocity > 0) {\n var i = 0.008 * velocity;\n velocity -= i * e;\n if (velocity < 1e-7) {\n this.velocity = 0;\n } else {\n var a = velocity * e + 0.5 * i * e * e;\n this.value -= Math.max(a, 0) * diffSign;\n this.velocity = velocity * diffSign;\n this.dir = true;\n }\n }\n if (this.constantVelocityMap.size > 0) {\n var totalVelocity = Array.from(this.constantVelocityMap.values()).reduce(function (sum, value) {\n return sum + value;\n }, 0);\n this.value += totalVelocity * e;\n this.dir = true;\n }\n } }]);\n\n return ControlData;\n }();\n var tmpVec3_2 = new THREE.Vector3();\n var ViewAnimation = function () {\n function ViewAnimation(controller, dstValues, duration, easeType, easeRatio) {\n _classCallCheck(this, ViewAnimation);\n var that = this;\n this.quaT = 0;\n this.curQua = new THREE.Quaternion();\n this.dstQua = new THREE.Quaternion();\n this.tween = undefined;\n this.onComplete = null;\n this.isCompleted = false;\n this.curQua.setFromEuler(tmpEuler_0.set(controller.rotateX.value, controller.rotateY.value, 0));\n this.dstQua.setFromEuler(tmpEuler_0.set(dstValues.rotateX, dstValues.rotateY, 0));\n this.tween = new Tween({\n translateX: controller.translateX.value,\n translateY: controller.translateY.value,\n translateZ: controller.translateZ.value,\n depth: controller.depth.value,\n quaT: 0 }).\n to({\n translateX: dstValues.translateX,\n translateY: dstValues.translateY,\n translateZ: dstValues.translateZ,\n depth: dstValues.depth,\n quaT: 1 },\n duration, easeType, easeRatio);\n this.tween.onUpdate(function (o) {\n controller.needsAutoRotate = false;\n var qua = new THREE.Quaternion().slerpQuaternions(that.curQua, that.dstQua, o.quaT);\n var euler = tmpEuler_0.setFromQuaternion(qua, \"YXZ\");\n controller.rotateX.setValueWithoutLimit(euler.x);\n controller.rotateY.setValueWithoutLimit(euler.y);\n controller.translateX.setValueWithoutLimit(o.translateX);\n controller.translateY.setValueWithoutLimit(o.translateY);\n controller.translateZ.setValueWithoutLimit(o.translateZ);\n controller.depth.setValueWithoutLimit(o.depth);\n controller.needsUpdate = true;\n });\n this.tween.onComplete(function () {\n that.isCompleted = true;\n that.onComplete && that.onComplete();\n });\n }\n _createClass(ViewAnimation, [{\n key: \"destroy\",\n value: function destroy() {\n this.tween.destroy();\n if (!this.isCompleted) {\n this.isCompleted = true;\n this.onComplete && this.onComplete();\n }\n } }]);\n\n return ViewAnimation;\n }();\n var MobileGesture = function () {\n function MobileGesture(context) {\n _classCallCheck(this, MobileGesture);\n var that = this;\n this.context = undefined;\n this.firstTouchId = null;\n this.secondTouchId = null;\n this.lastFirstTouchPosition = null;\n this.lastSecondTouchPosition = null;\n this.usedTouchIdMap = new Map();\n this.onTouchStart = function (e) {\n if (that.firstTouchId === null) {\n that.firstTouchId = that.getUnusedTouchId(e.touches);\n }\n if (that.secondTouchId === null) {\n that.secondTouchId = that.getUnusedTouchId(e.touches);\n }\n };\n this.onTouchMove = function (e) {\n var firstTouch = null;\n if (that.firstTouchId !== null) {\n firstTouch = that.getTouch(e.touches, that.firstTouchId);\n }\n var secondTouch = null;\n if (that.secondTouchId !== null) {\n secondTouch = that.getTouch(e.touches, that.secondTouchId);\n }\n if (firstTouch && !secondTouch || !firstTouch && secondTouch) {\n var translateTouch;\n var lastTouchPosition;\n if (!firstTouch && secondTouch) {\n translateTouch = secondTouch;\n lastTouchPosition = that.lastSecondTouchPosition;\n } else {\n translateTouch = firstTouch;\n lastTouchPosition = that.lastFirstTouchPosition;\n }\n if (lastTouchPosition) {\n var delta = [translateTouch.pageX - lastTouchPosition[0], translateTouch.pageY - lastTouchPosition[1]];\n delta[0] = delta[0] / that.context.domSize[1];\n delta[1] = delta[1] / that.context.domSize[1];\n that.context.onTranslate(delta);\n }\n } else if (firstTouch && secondTouch) {\n if (that.lastFirstTouchPosition && that.lastSecondTouchPosition) {\n var isFirstTouchMove = that.isTouchMove(firstTouch, that.lastFirstTouchPosition);\n var isSecondTouchMove = that.isTouchMove(secondTouch, that.lastSecondTouchPosition);\n if (isFirstTouchMove && isSecondTouchMove) {\n var lastZoomDistance = getDistance(that.lastFirstTouchPosition[0], that.lastFirstTouchPosition[1], that.lastSecondTouchPosition[0], that.lastSecondTouchPosition[1]);\n var distance = getDistance(firstTouch.pageX, firstTouch.pageY, secondTouch.pageX, secondTouch.pageY);\n var _delta = distance - lastZoomDistance;\n if (_delta > 0) {\n that.context.onZoom(1);\n } else {\n that.context.onZoom(-1);\n }\n } else {\n var rotateTouch;\n var _lastTouchPosition;\n if (isSecondTouchMove) {\n rotateTouch = secondTouch;\n _lastTouchPosition = that.lastSecondTouchPosition;\n } else {\n rotateTouch = firstTouch;\n _lastTouchPosition = that.lastFirstTouchPosition;\n }\n that.context.onRotate([(rotateTouch.pageX - _lastTouchPosition[0]) / that.context.domSize[0], (rotateTouch.pageY - _lastTouchPosition[1]) / that.context.domSize[0]]);\n }\n }\n }\n if (firstTouch) {\n that.lastFirstTouchPosition = [firstTouch.pageX, firstTouch.pageY];\n }\n if (secondTouch) {\n that.lastSecondTouchPosition = [secondTouch.pageX, secondTouch.pageY];\n }\n };\n this.onTouchEnd = function (e) {\n if (that.firstTouchId !== null && !that.getTouch(e.touches, that.firstTouchId)) {\n that.usedTouchIdMap[\"delete\"](that.firstTouchId);\n that.firstTouchId = null;\n that.lastFirstTouchPosition = null;\n }\n if (that.secondTouchId !== null && !that.getTouch(e.touches, that.secondTouchId)) {\n that.usedTouchIdMap[\"delete\"](that.secondTouchId);\n that.secondTouchId = null;\n that.lastSecondTouchPosition = null;\n }\n };\n this.context = context;\n this.onTouchStart.bind(this);\n }\n _createClass(MobileGesture, [{\n key: \"bindEvent\",\n value: function bindEvent() {\n window.addEventListener(\"touchmove\", this.blockTouchDefaultEvent, {\n passive: false });\n\n this.context.dom.addEventListener(\"touchstart\", this.onTouchStart);\n document.addEventListener(\"touchmove\", this.onTouchMove);\n document.addEventListener(\"touchend\", this.onTouchEnd);\n } },\n {\n key: \"blockTouchDefaultEvent\",\n value: function blockTouchDefaultEvent(e) {\n e.preventDefault();\n } },\n {\n key: \"debugInTouchDevice\",\n value: function debugInTouchDevice() {\n var a = document.body.querySelector(\"#root\").children[0];\n var mainContent = a.children[0];\n mainContent.style.right = \"0\";\n var b = mainContent.children[1];\n b.style.left = \"0\";\n b.style.top = \"0\";\n var _mainContent$getBound = mainContent.getBoundingClientRect(),\n w1 = _mainContent$getBound.width,\n h1 = _mainContent$getBound.height;\n var _b$getBoundingClientR = b.getBoundingClientRect(),\n w2 = _b$getBoundingClientR.width,\n h2 = _b$getBoundingClientR.height;\n var r1 = w1 / w2;\n var r2 = h1 / h2;\n b.style.transform = \"scale(\".concat(Math.min(r1, r2), \")\");\n b.style.transformOrigin = \"left top\";\n mainContent.children[0].style.display = \"none\";\n var sidePanel = a.children[1];\n sidePanel.style.display = \"none\";\n a.children[2].style.display = \"none\";\n } },\n {\n key: \"getTouch\",\n value: function getTouch(touches, id) {\n for (var i = 0; i < touches.length; i++) {\n if (touches[i].identifier === id) {\n return touches[i];\n }\n }\n return null;\n } },\n {\n key: \"removeEvent\",\n value: function removeEvent() {\n this.context.dom.removeEventListener(\"touchstart\", this.onTouchStart);\n document.removeEventListener(\"touchmove\", this.onTouchMove);\n document.removeEventListener(\"touchend\", this.onTouchEnd);\n document.body.removeEventListener(\"touchmove\", this.blockTouchDefaultEvent);\n } },\n {\n key: \"getUnusedTouchId\",\n value: function getUnusedTouchId(touches) {\n for (var i = 0; i < touches.length; i++) {\n if (this.usedTouchIdMap.get(touches[i].identifier) === undefined) {\n var id = touches[i].identifier;\n this.usedTouchIdMap.set(id, true);\n return id;\n }\n }\n return null;\n } },\n {\n key: \"isTouchMove\",\n value: function isTouchMove(touch, lastPos) {\n return getDistance(lastPos[0], lastPos[1], touch.pageX, touch.pageY) > 1;\n } }]);\n\n return MobileGesture;\n }();\n function getDistance(x1, y1, x2, y2) {\n return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));\n }\n var boundSphere = new THREE.Sphere();\n module.exports = {\n ThreeFixedController: ThreeFixedController,\n multiplyAxisRotate: multiplyAxisRotate,\n MouseKey: MouseKey,\n TargetMode: TargetMode,\n ControlData: ControlData };return module.exports;});", "requires": [], "buildLevel": 3, "outputDir": "/com/submodule-three-3d/1.0.0/src/ThreeController", "outputPath": "/com/submodule-three-3d/1.0.0/src/ThreeController/ThreeFixedController.js", "fileName": "/src/ThreeController/ThreeFixedController.js" } }