@quick-threejs/reactive 0.1.16 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.d.mts +25 -0
- package/dist/main.d.ts +25 -2
- package/dist/main.js +3592 -2
- package/dist/main.js.map +1 -1
- package/dist/main.mjs +3580 -0
- package/dist/main.mjs.map +1 -0
- package/dist/main.worker-WTRf-uyZ.d.mts +726 -0
- package/dist/main.worker-WTRf-uyZ.d.ts +726 -0
- package/dist/main.worker.d.mts +11 -0
- package/dist/main.worker.d.ts +11 -1
- package/dist/main.worker.js +2959 -1
- package/dist/main.worker.js.map +1 -1
- package/dist/main.worker.mjs +2959 -0
- package/dist/main.worker.mjs.map +1 -0
- package/package.json +12 -10
- package/dist/common/constants/event.constants.d.ts +0 -2
- package/dist/common/constants/event.constants.js +0 -23
- package/dist/common/constants/event.constants.js.map +0 -1
- package/dist/common/constants/index.d.ts +0 -1
- package/dist/common/constants/index.js +0 -2
- package/dist/common/constants/index.js.map +0 -1
- package/dist/common/enums/camera.enum.d.ts +0 -4
- package/dist/common/enums/camera.enum.js +0 -6
- package/dist/common/enums/camera.enum.js.map +0 -1
- package/dist/common/enums/index.d.ts +0 -2
- package/dist/common/enums/index.js +0 -3
- package/dist/common/enums/index.js.map +0 -1
- package/dist/common/enums/lifecycle.enum.d.ts +0 -10
- package/dist/common/enums/lifecycle.enum.js +0 -13
- package/dist/common/enums/lifecycle.enum.js.map +0 -1
- package/dist/common/index.d.ts +0 -6
- package/dist/common/index.js +0 -7
- package/dist/common/index.js.map +0 -1
- package/dist/common/interfaces/canvas.interface.d.ts +0 -6
- package/dist/common/interfaces/canvas.interface.js +0 -2
- package/dist/common/interfaces/canvas.interface.js.map +0 -1
- package/dist/common/interfaces/core.interface.d.ts +0 -11
- package/dist/common/interfaces/core.interface.js +0 -2
- package/dist/common/interfaces/core.interface.js.map +0 -1
- package/dist/common/interfaces/event.interface.d.ts +0 -10
- package/dist/common/interfaces/event.interface.js +0 -2
- package/dist/common/interfaces/event.interface.js.map +0 -1
- package/dist/common/interfaces/index.d.ts +0 -5
- package/dist/common/interfaces/index.js +0 -6
- package/dist/common/interfaces/index.js.map +0 -1
- package/dist/common/interfaces/module.interface.d.ts +0 -19
- package/dist/common/interfaces/module.interface.js +0 -2
- package/dist/common/interfaces/module.interface.js.map +0 -1
- package/dist/common/interfaces/resource.interface.d.ts +0 -14
- package/dist/common/interfaces/resource.interface.js +0 -2
- package/dist/common/interfaces/resource.interface.js.map +0 -1
- package/dist/common/models/app-proxy-event-handler.model.d.ts +0 -32
- package/dist/common/models/app-proxy-event-handler.model.js +0 -31
- package/dist/common/models/app-proxy-event-handler.model.js.map +0 -1
- package/dist/common/models/index.d.ts +0 -7
- package/dist/common/models/index.js +0 -8
- package/dist/common/models/index.js.map +0 -1
- package/dist/common/models/launch-app-props.model.d.ts +0 -8
- package/dist/common/models/launch-app-props.model.js +0 -8
- package/dist/common/models/launch-app-props.model.js.map +0 -1
- package/dist/common/models/proxy-event-handler.model.d.ts +0 -19
- package/dist/common/models/proxy-event-handler.model.js +0 -18
- package/dist/common/models/proxy-event-handler.model.js.map +0 -1
- package/dist/common/models/proxy-event-observables.model.d.ts +0 -20
- package/dist/common/models/proxy-event-observables.model.js +0 -18
- package/dist/common/models/proxy-event-observables.model.js.map +0 -1
- package/dist/common/models/proxy-event-subjects.models.d.ts +0 -19
- package/dist/common/models/proxy-event-subjects.models.js +0 -17
- package/dist/common/models/proxy-event-subjects.models.js.map +0 -1
- package/dist/common/models/register-props.model.d.ts +0 -75
- package/dist/common/models/register-props.model.js +0 -74
- package/dist/common/models/register-props.model.js.map +0 -1
- package/dist/common/models/register-proxy-event-handler.model.d.ts +0 -17
- package/dist/common/models/register-proxy-event-handler.model.js +0 -17
- package/dist/common/models/register-proxy-event-handler.model.js.map +0 -1
- package/dist/common/serializers/index.d.ts +0 -1
- package/dist/common/serializers/index.js +0 -2
- package/dist/common/serializers/index.js.map +0 -1
- package/dist/common/serializers/object3d.serializer.d.ts +0 -2
- package/dist/common/serializers/object3d.serializer.js +0 -16
- package/dist/common/serializers/object3d.serializer.js.map +0 -1
- package/dist/common/types/index.d.ts +0 -1
- package/dist/common/types/index.js +0 -2
- package/dist/common/types/index.js.map +0 -1
- package/dist/common/types/object.type.d.ts +0 -13
- package/dist/common/types/object.type.js +0 -2
- package/dist/common/types/object.type.js.map +0 -1
- package/dist/core/app/app.component.d.ts +0 -7
- package/dist/core/app/app.component.js +0 -18
- package/dist/core/app/app.component.js.map +0 -1
- package/dist/core/app/app.controller.d.ts +0 -10
- package/dist/core/app/app.controller.js +0 -44
- package/dist/core/app/app.controller.js.map +0 -1
- package/dist/core/app/app.module-worker.d.ts +0 -5
- package/dist/core/app/app.module-worker.js +0 -28
- package/dist/core/app/app.module-worker.js.map +0 -1
- package/dist/core/app/app.module.d.ts +0 -36
- package/dist/core/app/app.module.js +0 -130
- package/dist/core/app/app.module.js.map +0 -1
- package/dist/core/app/camera/camera.component.d.ts +0 -18
- package/dist/core/app/camera/camera.component.js +0 -82
- package/dist/core/app/camera/camera.component.js.map +0 -1
- package/dist/core/app/camera/camera.controller.d.ts +0 -12
- package/dist/core/app/camera/camera.controller.js +0 -37
- package/dist/core/app/camera/camera.controller.js.map +0 -1
- package/dist/core/app/camera/camera.module.d.ts +0 -20
- package/dist/core/app/camera/camera.module.js +0 -92
- package/dist/core/app/camera/camera.module.js.map +0 -1
- package/dist/core/app/debug/debug.component.d.ts +0 -28
- package/dist/core/app/debug/debug.component.js +0 -119
- package/dist/core/app/debug/debug.component.js.map +0 -1
- package/dist/core/app/debug/debug.controller.d.ts +0 -9
- package/dist/core/app/debug/debug.controller.js +0 -32
- package/dist/core/app/debug/debug.controller.js.map +0 -1
- package/dist/core/app/debug/debug.module.d.ts +0 -17
- package/dist/core/app/debug/debug.module.js +0 -64
- package/dist/core/app/debug/debug.module.js.map +0 -1
- package/dist/core/app/renderer/renderer.component.d.ts +0 -19
- package/dist/core/app/renderer/renderer.component.js +0 -86
- package/dist/core/app/renderer/renderer.component.js.map +0 -1
- package/dist/core/app/renderer/renderer.controller.d.ts +0 -15
- package/dist/core/app/renderer/renderer.controller.js +0 -44
- package/dist/core/app/renderer/renderer.controller.js.map +0 -1
- package/dist/core/app/renderer/renderer.module.d.ts +0 -17
- package/dist/core/app/renderer/renderer.module.js +0 -60
- package/dist/core/app/renderer/renderer.module.js.map +0 -1
- package/dist/core/app/sizes/sizes.component.d.ts +0 -10
- package/dist/core/app/sizes/sizes.component.js +0 -26
- package/dist/core/app/sizes/sizes.component.js.map +0 -1
- package/dist/core/app/sizes/sizes.controller.d.ts +0 -12
- package/dist/core/app/sizes/sizes.controller.js +0 -37
- package/dist/core/app/sizes/sizes.controller.js.map +0 -1
- package/dist/core/app/sizes/sizes.module.d.ts +0 -19
- package/dist/core/app/sizes/sizes.module.js +0 -80
- package/dist/core/app/sizes/sizes.module.js.map +0 -1
- package/dist/core/app/timer/timer.component.d.ts +0 -8
- package/dist/core/app/timer/timer.component.js +0 -20
- package/dist/core/app/timer/timer.component.js.map +0 -1
- package/dist/core/app/timer/timer.controller.d.ts +0 -14
- package/dist/core/app/timer/timer.controller.js +0 -52
- package/dist/core/app/timer/timer.controller.js.map +0 -1
- package/dist/core/app/timer/timer.module.d.ts +0 -19
- package/dist/core/app/timer/timer.module.js +0 -79
- package/dist/core/app/timer/timer.module.js.map +0 -1
- package/dist/core/app/world/world.component.d.ts +0 -5
- package/dist/core/app/world/world.component.js +0 -17
- package/dist/core/app/world/world.component.js.map +0 -1
- package/dist/core/app/world/world.controller.d.ts +0 -5
- package/dist/core/app/world/world.controller.js +0 -17
- package/dist/core/app/world/world.controller.js.map +0 -1
- package/dist/core/app/world/world.module.d.ts +0 -14
- package/dist/core/app/world/world.module.js +0 -52
- package/dist/core/app/world/world.module.js.map +0 -1
- package/dist/core/index.d.ts +0 -4
- package/dist/core/index.js +0 -5
- package/dist/core/index.js.map +0 -1
- package/dist/core/loader/loader.component.d.ts +0 -24
- package/dist/core/loader/loader.component.js +0 -68
- package/dist/core/loader/loader.component.js.map +0 -1
- package/dist/core/loader/loader.controller.d.ts +0 -9
- package/dist/core/loader/loader.controller.js +0 -21
- package/dist/core/loader/loader.controller.js.map +0 -1
- package/dist/core/loader/loader.module-worker.d.ts +0 -3
- package/dist/core/loader/loader.module-worker.js +0 -17
- package/dist/core/loader/loader.module-worker.js.map +0 -1
- package/dist/core/loader/loader.module.d.ts +0 -35
- package/dist/core/loader/loader.module.js +0 -120
- package/dist/core/loader/loader.module.js.map +0 -1
- package/dist/core/register/register.component.d.ts +0 -13
- package/dist/core/register/register.component.js +0 -35
- package/dist/core/register/register.component.js.map +0 -1
- package/dist/core/register/register.controller.d.ts +0 -77
- package/dist/core/register/register.controller.js +0 -125
- package/dist/core/register/register.controller.js.map +0 -1
- package/dist/core/register/register.module.d.ts +0 -47
- package/dist/core/register/register.module.js +0 -176
- package/dist/core/register/register.module.js.map +0 -1
- package/dist/core/register/register.util.d.ts +0 -10
- package/dist/core/register/register.util.js +0 -36
- package/dist/core/register/register.util.js.map +0 -1
package/dist/main.js
CHANGED
|
@@ -1,3 +1,3593 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
10
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
11
|
+
};
|
|
12
|
+
var __export = (target, all) => {
|
|
13
|
+
for (var name in all)
|
|
14
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
+
mod
|
|
31
|
+
));
|
|
32
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
33
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
34
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
35
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
36
|
+
if (decorator = decorators[i])
|
|
37
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
38
|
+
if (kind && result) __defProp(target, key, result);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
|
|
42
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
43
|
+
|
|
44
|
+
// ../../node_modules/.pnpm/reflect-metadata@0.2.2/node_modules/reflect-metadata/Reflect.js
|
|
45
|
+
var require_Reflect = __commonJS({
|
|
46
|
+
"../../node_modules/.pnpm/reflect-metadata@0.2.2/node_modules/reflect-metadata/Reflect.js"() {
|
|
47
|
+
"use strict";
|
|
48
|
+
var Reflect2;
|
|
49
|
+
(function(Reflect3) {
|
|
50
|
+
(function(factory) {
|
|
51
|
+
var root = typeof globalThis === "object" ? globalThis : typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : sloppyModeThis();
|
|
52
|
+
var exporter = makeExporter(Reflect3);
|
|
53
|
+
if (typeof root.Reflect !== "undefined") {
|
|
54
|
+
exporter = makeExporter(root.Reflect, exporter);
|
|
55
|
+
}
|
|
56
|
+
factory(exporter, root);
|
|
57
|
+
if (typeof root.Reflect === "undefined") {
|
|
58
|
+
root.Reflect = Reflect3;
|
|
59
|
+
}
|
|
60
|
+
function makeExporter(target, previous) {
|
|
61
|
+
return function(key, value) {
|
|
62
|
+
Object.defineProperty(target, key, { configurable: true, writable: true, value });
|
|
63
|
+
if (previous)
|
|
64
|
+
previous(key, value);
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function functionThis() {
|
|
68
|
+
try {
|
|
69
|
+
return Function("return this;")();
|
|
70
|
+
} catch (_) {
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function indirectEvalThis() {
|
|
74
|
+
try {
|
|
75
|
+
return (void 0, eval)("(function() { return this; })()");
|
|
76
|
+
} catch (_) {
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function sloppyModeThis() {
|
|
80
|
+
return functionThis() || indirectEvalThis();
|
|
81
|
+
}
|
|
82
|
+
})(function(exporter, root) {
|
|
83
|
+
var hasOwn = Object.prototype.hasOwnProperty;
|
|
84
|
+
var supportsSymbol = typeof Symbol === "function";
|
|
85
|
+
var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== "undefined" ? Symbol.toPrimitive : "@@toPrimitive";
|
|
86
|
+
var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== "undefined" ? Symbol.iterator : "@@iterator";
|
|
87
|
+
var supportsCreate = typeof Object.create === "function";
|
|
88
|
+
var supportsProto = { __proto__: [] } instanceof Array;
|
|
89
|
+
var downLevel = !supportsCreate && !supportsProto;
|
|
90
|
+
var HashMap = {
|
|
91
|
+
// create an object in dictionary mode (a.k.a. "slow" mode in v8)
|
|
92
|
+
create: supportsCreate ? function() {
|
|
93
|
+
return MakeDictionary(/* @__PURE__ */ Object.create(null));
|
|
94
|
+
} : supportsProto ? function() {
|
|
95
|
+
return MakeDictionary({ __proto__: null });
|
|
96
|
+
} : function() {
|
|
97
|
+
return MakeDictionary({});
|
|
98
|
+
},
|
|
99
|
+
has: downLevel ? function(map2, key) {
|
|
100
|
+
return hasOwn.call(map2, key);
|
|
101
|
+
} : function(map2, key) {
|
|
102
|
+
return key in map2;
|
|
103
|
+
},
|
|
104
|
+
get: downLevel ? function(map2, key) {
|
|
105
|
+
return hasOwn.call(map2, key) ? map2[key] : void 0;
|
|
106
|
+
} : function(map2, key) {
|
|
107
|
+
return map2[key];
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
var functionPrototype = Object.getPrototypeOf(Function);
|
|
111
|
+
var _Map = typeof Map === "function" && typeof Map.prototype.entries === "function" ? Map : CreateMapPolyfill();
|
|
112
|
+
var _Set = typeof Set === "function" && typeof Set.prototype.entries === "function" ? Set : CreateSetPolyfill();
|
|
113
|
+
var _WeakMap = typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill();
|
|
114
|
+
var registrySymbol = supportsSymbol ? Symbol.for("@reflect-metadata:registry") : void 0;
|
|
115
|
+
var metadataRegistry = GetOrCreateMetadataRegistry();
|
|
116
|
+
var metadataProvider = CreateMetadataProvider(metadataRegistry);
|
|
117
|
+
function decorate(decorators, target, propertyKey, attributes) {
|
|
118
|
+
if (!IsUndefined(propertyKey)) {
|
|
119
|
+
if (!IsArray(decorators))
|
|
120
|
+
throw new TypeError();
|
|
121
|
+
if (!IsObject(target))
|
|
122
|
+
throw new TypeError();
|
|
123
|
+
if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes))
|
|
124
|
+
throw new TypeError();
|
|
125
|
+
if (IsNull(attributes))
|
|
126
|
+
attributes = void 0;
|
|
127
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
128
|
+
return DecorateProperty(decorators, target, propertyKey, attributes);
|
|
129
|
+
} else {
|
|
130
|
+
if (!IsArray(decorators))
|
|
131
|
+
throw new TypeError();
|
|
132
|
+
if (!IsConstructor(target))
|
|
133
|
+
throw new TypeError();
|
|
134
|
+
return DecorateConstructor(decorators, target);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
exporter("decorate", decorate);
|
|
138
|
+
function metadata(metadataKey, metadataValue) {
|
|
139
|
+
function decorator(target, propertyKey) {
|
|
140
|
+
if (!IsObject(target))
|
|
141
|
+
throw new TypeError();
|
|
142
|
+
if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey))
|
|
143
|
+
throw new TypeError();
|
|
144
|
+
OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
|
|
145
|
+
}
|
|
146
|
+
return decorator;
|
|
147
|
+
}
|
|
148
|
+
exporter("metadata", metadata);
|
|
149
|
+
function defineMetadata(metadataKey, metadataValue, target, propertyKey) {
|
|
150
|
+
if (!IsObject(target))
|
|
151
|
+
throw new TypeError();
|
|
152
|
+
if (!IsUndefined(propertyKey))
|
|
153
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
154
|
+
return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
|
|
155
|
+
}
|
|
156
|
+
exporter("defineMetadata", defineMetadata);
|
|
157
|
+
function hasMetadata(metadataKey, target, propertyKey) {
|
|
158
|
+
if (!IsObject(target))
|
|
159
|
+
throw new TypeError();
|
|
160
|
+
if (!IsUndefined(propertyKey))
|
|
161
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
162
|
+
return OrdinaryHasMetadata(metadataKey, target, propertyKey);
|
|
163
|
+
}
|
|
164
|
+
exporter("hasMetadata", hasMetadata);
|
|
165
|
+
function hasOwnMetadata(metadataKey, target, propertyKey) {
|
|
166
|
+
if (!IsObject(target))
|
|
167
|
+
throw new TypeError();
|
|
168
|
+
if (!IsUndefined(propertyKey))
|
|
169
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
170
|
+
return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);
|
|
171
|
+
}
|
|
172
|
+
exporter("hasOwnMetadata", hasOwnMetadata);
|
|
173
|
+
function getMetadata(metadataKey, target, propertyKey) {
|
|
174
|
+
if (!IsObject(target))
|
|
175
|
+
throw new TypeError();
|
|
176
|
+
if (!IsUndefined(propertyKey))
|
|
177
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
178
|
+
return OrdinaryGetMetadata(metadataKey, target, propertyKey);
|
|
179
|
+
}
|
|
180
|
+
exporter("getMetadata", getMetadata);
|
|
181
|
+
function getOwnMetadata(metadataKey, target, propertyKey) {
|
|
182
|
+
if (!IsObject(target))
|
|
183
|
+
throw new TypeError();
|
|
184
|
+
if (!IsUndefined(propertyKey))
|
|
185
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
186
|
+
return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);
|
|
187
|
+
}
|
|
188
|
+
exporter("getOwnMetadata", getOwnMetadata);
|
|
189
|
+
function getMetadataKeys(target, propertyKey) {
|
|
190
|
+
if (!IsObject(target))
|
|
191
|
+
throw new TypeError();
|
|
192
|
+
if (!IsUndefined(propertyKey))
|
|
193
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
194
|
+
return OrdinaryMetadataKeys(target, propertyKey);
|
|
195
|
+
}
|
|
196
|
+
exporter("getMetadataKeys", getMetadataKeys);
|
|
197
|
+
function getOwnMetadataKeys(target, propertyKey) {
|
|
198
|
+
if (!IsObject(target))
|
|
199
|
+
throw new TypeError();
|
|
200
|
+
if (!IsUndefined(propertyKey))
|
|
201
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
202
|
+
return OrdinaryOwnMetadataKeys(target, propertyKey);
|
|
203
|
+
}
|
|
204
|
+
exporter("getOwnMetadataKeys", getOwnMetadataKeys);
|
|
205
|
+
function deleteMetadata(metadataKey, target, propertyKey) {
|
|
206
|
+
if (!IsObject(target))
|
|
207
|
+
throw new TypeError();
|
|
208
|
+
if (!IsUndefined(propertyKey))
|
|
209
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
210
|
+
if (!IsObject(target))
|
|
211
|
+
throw new TypeError();
|
|
212
|
+
if (!IsUndefined(propertyKey))
|
|
213
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
214
|
+
var provider = GetMetadataProvider(
|
|
215
|
+
target,
|
|
216
|
+
propertyKey,
|
|
217
|
+
/*Create*/
|
|
218
|
+
false
|
|
219
|
+
);
|
|
220
|
+
if (IsUndefined(provider))
|
|
221
|
+
return false;
|
|
222
|
+
return provider.OrdinaryDeleteMetadata(metadataKey, target, propertyKey);
|
|
223
|
+
}
|
|
224
|
+
exporter("deleteMetadata", deleteMetadata);
|
|
225
|
+
function DecorateConstructor(decorators, target) {
|
|
226
|
+
for (var i = decorators.length - 1; i >= 0; --i) {
|
|
227
|
+
var decorator = decorators[i];
|
|
228
|
+
var decorated = decorator(target);
|
|
229
|
+
if (!IsUndefined(decorated) && !IsNull(decorated)) {
|
|
230
|
+
if (!IsConstructor(decorated))
|
|
231
|
+
throw new TypeError();
|
|
232
|
+
target = decorated;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return target;
|
|
236
|
+
}
|
|
237
|
+
function DecorateProperty(decorators, target, propertyKey, descriptor) {
|
|
238
|
+
for (var i = decorators.length - 1; i >= 0; --i) {
|
|
239
|
+
var decorator = decorators[i];
|
|
240
|
+
var decorated = decorator(target, propertyKey, descriptor);
|
|
241
|
+
if (!IsUndefined(decorated) && !IsNull(decorated)) {
|
|
242
|
+
if (!IsObject(decorated))
|
|
243
|
+
throw new TypeError();
|
|
244
|
+
descriptor = decorated;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return descriptor;
|
|
248
|
+
}
|
|
249
|
+
function OrdinaryHasMetadata(MetadataKey, O, P) {
|
|
250
|
+
var hasOwn2 = OrdinaryHasOwnMetadata(MetadataKey, O, P);
|
|
251
|
+
if (hasOwn2)
|
|
252
|
+
return true;
|
|
253
|
+
var parent = OrdinaryGetPrototypeOf(O);
|
|
254
|
+
if (!IsNull(parent))
|
|
255
|
+
return OrdinaryHasMetadata(MetadataKey, parent, P);
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
function OrdinaryHasOwnMetadata(MetadataKey, O, P) {
|
|
259
|
+
var provider = GetMetadataProvider(
|
|
260
|
+
O,
|
|
261
|
+
P,
|
|
262
|
+
/*Create*/
|
|
263
|
+
false
|
|
264
|
+
);
|
|
265
|
+
if (IsUndefined(provider))
|
|
266
|
+
return false;
|
|
267
|
+
return ToBoolean(provider.OrdinaryHasOwnMetadata(MetadataKey, O, P));
|
|
268
|
+
}
|
|
269
|
+
function OrdinaryGetMetadata(MetadataKey, O, P) {
|
|
270
|
+
var hasOwn2 = OrdinaryHasOwnMetadata(MetadataKey, O, P);
|
|
271
|
+
if (hasOwn2)
|
|
272
|
+
return OrdinaryGetOwnMetadata(MetadataKey, O, P);
|
|
273
|
+
var parent = OrdinaryGetPrototypeOf(O);
|
|
274
|
+
if (!IsNull(parent))
|
|
275
|
+
return OrdinaryGetMetadata(MetadataKey, parent, P);
|
|
276
|
+
return void 0;
|
|
277
|
+
}
|
|
278
|
+
function OrdinaryGetOwnMetadata(MetadataKey, O, P) {
|
|
279
|
+
var provider = GetMetadataProvider(
|
|
280
|
+
O,
|
|
281
|
+
P,
|
|
282
|
+
/*Create*/
|
|
283
|
+
false
|
|
284
|
+
);
|
|
285
|
+
if (IsUndefined(provider))
|
|
286
|
+
return;
|
|
287
|
+
return provider.OrdinaryGetOwnMetadata(MetadataKey, O, P);
|
|
288
|
+
}
|
|
289
|
+
function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {
|
|
290
|
+
var provider = GetMetadataProvider(
|
|
291
|
+
O,
|
|
292
|
+
P,
|
|
293
|
+
/*Create*/
|
|
294
|
+
true
|
|
295
|
+
);
|
|
296
|
+
provider.OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P);
|
|
297
|
+
}
|
|
298
|
+
function OrdinaryMetadataKeys(O, P) {
|
|
299
|
+
var ownKeys = OrdinaryOwnMetadataKeys(O, P);
|
|
300
|
+
var parent = OrdinaryGetPrototypeOf(O);
|
|
301
|
+
if (parent === null)
|
|
302
|
+
return ownKeys;
|
|
303
|
+
var parentKeys = OrdinaryMetadataKeys(parent, P);
|
|
304
|
+
if (parentKeys.length <= 0)
|
|
305
|
+
return ownKeys;
|
|
306
|
+
if (ownKeys.length <= 0)
|
|
307
|
+
return parentKeys;
|
|
308
|
+
var set = new _Set();
|
|
309
|
+
var keys = [];
|
|
310
|
+
for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) {
|
|
311
|
+
var key = ownKeys_1[_i];
|
|
312
|
+
var hasKey = set.has(key);
|
|
313
|
+
if (!hasKey) {
|
|
314
|
+
set.add(key);
|
|
315
|
+
keys.push(key);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) {
|
|
319
|
+
var key = parentKeys_1[_a];
|
|
320
|
+
var hasKey = set.has(key);
|
|
321
|
+
if (!hasKey) {
|
|
322
|
+
set.add(key);
|
|
323
|
+
keys.push(key);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
return keys;
|
|
327
|
+
}
|
|
328
|
+
function OrdinaryOwnMetadataKeys(O, P) {
|
|
329
|
+
var provider = GetMetadataProvider(
|
|
330
|
+
O,
|
|
331
|
+
P,
|
|
332
|
+
/*create*/
|
|
333
|
+
false
|
|
334
|
+
);
|
|
335
|
+
if (!provider) {
|
|
336
|
+
return [];
|
|
337
|
+
}
|
|
338
|
+
return provider.OrdinaryOwnMetadataKeys(O, P);
|
|
339
|
+
}
|
|
340
|
+
function Type(x) {
|
|
341
|
+
if (x === null)
|
|
342
|
+
return 1;
|
|
343
|
+
switch (typeof x) {
|
|
344
|
+
case "undefined":
|
|
345
|
+
return 0;
|
|
346
|
+
case "boolean":
|
|
347
|
+
return 2;
|
|
348
|
+
case "string":
|
|
349
|
+
return 3;
|
|
350
|
+
case "symbol":
|
|
351
|
+
return 4;
|
|
352
|
+
case "number":
|
|
353
|
+
return 5;
|
|
354
|
+
case "object":
|
|
355
|
+
return x === null ? 1 : 6;
|
|
356
|
+
default:
|
|
357
|
+
return 6;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
function IsUndefined(x) {
|
|
361
|
+
return x === void 0;
|
|
362
|
+
}
|
|
363
|
+
function IsNull(x) {
|
|
364
|
+
return x === null;
|
|
365
|
+
}
|
|
366
|
+
function IsSymbol(x) {
|
|
367
|
+
return typeof x === "symbol";
|
|
368
|
+
}
|
|
369
|
+
function IsObject(x) {
|
|
370
|
+
return typeof x === "object" ? x !== null : typeof x === "function";
|
|
371
|
+
}
|
|
372
|
+
function ToPrimitive(input, PreferredType) {
|
|
373
|
+
switch (Type(input)) {
|
|
374
|
+
case 0:
|
|
375
|
+
return input;
|
|
376
|
+
case 1:
|
|
377
|
+
return input;
|
|
378
|
+
case 2:
|
|
379
|
+
return input;
|
|
380
|
+
case 3:
|
|
381
|
+
return input;
|
|
382
|
+
case 4:
|
|
383
|
+
return input;
|
|
384
|
+
case 5:
|
|
385
|
+
return input;
|
|
386
|
+
}
|
|
387
|
+
var hint = PreferredType === 3 ? "string" : PreferredType === 5 ? "number" : "default";
|
|
388
|
+
var exoticToPrim = GetMethod(input, toPrimitiveSymbol);
|
|
389
|
+
if (exoticToPrim !== void 0) {
|
|
390
|
+
var result = exoticToPrim.call(input, hint);
|
|
391
|
+
if (IsObject(result))
|
|
392
|
+
throw new TypeError();
|
|
393
|
+
return result;
|
|
394
|
+
}
|
|
395
|
+
return OrdinaryToPrimitive(input, hint === "default" ? "number" : hint);
|
|
396
|
+
}
|
|
397
|
+
function OrdinaryToPrimitive(O, hint) {
|
|
398
|
+
if (hint === "string") {
|
|
399
|
+
var toString_1 = O.toString;
|
|
400
|
+
if (IsCallable(toString_1)) {
|
|
401
|
+
var result = toString_1.call(O);
|
|
402
|
+
if (!IsObject(result))
|
|
403
|
+
return result;
|
|
404
|
+
}
|
|
405
|
+
var valueOf = O.valueOf;
|
|
406
|
+
if (IsCallable(valueOf)) {
|
|
407
|
+
var result = valueOf.call(O);
|
|
408
|
+
if (!IsObject(result))
|
|
409
|
+
return result;
|
|
410
|
+
}
|
|
411
|
+
} else {
|
|
412
|
+
var valueOf = O.valueOf;
|
|
413
|
+
if (IsCallable(valueOf)) {
|
|
414
|
+
var result = valueOf.call(O);
|
|
415
|
+
if (!IsObject(result))
|
|
416
|
+
return result;
|
|
417
|
+
}
|
|
418
|
+
var toString_2 = O.toString;
|
|
419
|
+
if (IsCallable(toString_2)) {
|
|
420
|
+
var result = toString_2.call(O);
|
|
421
|
+
if (!IsObject(result))
|
|
422
|
+
return result;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
throw new TypeError();
|
|
426
|
+
}
|
|
427
|
+
function ToBoolean(argument) {
|
|
428
|
+
return !!argument;
|
|
429
|
+
}
|
|
430
|
+
function ToString(argument) {
|
|
431
|
+
return "" + argument;
|
|
432
|
+
}
|
|
433
|
+
function ToPropertyKey(argument) {
|
|
434
|
+
var key = ToPrimitive(
|
|
435
|
+
argument,
|
|
436
|
+
3
|
|
437
|
+
/* String */
|
|
438
|
+
);
|
|
439
|
+
if (IsSymbol(key))
|
|
440
|
+
return key;
|
|
441
|
+
return ToString(key);
|
|
442
|
+
}
|
|
443
|
+
function IsArray(argument) {
|
|
444
|
+
return Array.isArray ? Array.isArray(argument) : argument instanceof Object ? argument instanceof Array : Object.prototype.toString.call(argument) === "[object Array]";
|
|
445
|
+
}
|
|
446
|
+
function IsCallable(argument) {
|
|
447
|
+
return typeof argument === "function";
|
|
448
|
+
}
|
|
449
|
+
function IsConstructor(argument) {
|
|
450
|
+
return typeof argument === "function";
|
|
451
|
+
}
|
|
452
|
+
function IsPropertyKey(argument) {
|
|
453
|
+
switch (Type(argument)) {
|
|
454
|
+
case 3:
|
|
455
|
+
return true;
|
|
456
|
+
case 4:
|
|
457
|
+
return true;
|
|
458
|
+
default:
|
|
459
|
+
return false;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
function SameValueZero(x, y) {
|
|
463
|
+
return x === y || x !== x && y !== y;
|
|
464
|
+
}
|
|
465
|
+
function GetMethod(V, P) {
|
|
466
|
+
var func = V[P];
|
|
467
|
+
if (func === void 0 || func === null)
|
|
468
|
+
return void 0;
|
|
469
|
+
if (!IsCallable(func))
|
|
470
|
+
throw new TypeError();
|
|
471
|
+
return func;
|
|
472
|
+
}
|
|
473
|
+
function GetIterator(obj) {
|
|
474
|
+
var method = GetMethod(obj, iteratorSymbol);
|
|
475
|
+
if (!IsCallable(method))
|
|
476
|
+
throw new TypeError();
|
|
477
|
+
var iterator = method.call(obj);
|
|
478
|
+
if (!IsObject(iterator))
|
|
479
|
+
throw new TypeError();
|
|
480
|
+
return iterator;
|
|
481
|
+
}
|
|
482
|
+
function IteratorValue(iterResult) {
|
|
483
|
+
return iterResult.value;
|
|
484
|
+
}
|
|
485
|
+
function IteratorStep(iterator) {
|
|
486
|
+
var result = iterator.next();
|
|
487
|
+
return result.done ? false : result;
|
|
488
|
+
}
|
|
489
|
+
function IteratorClose(iterator) {
|
|
490
|
+
var f = iterator["return"];
|
|
491
|
+
if (f)
|
|
492
|
+
f.call(iterator);
|
|
493
|
+
}
|
|
494
|
+
function OrdinaryGetPrototypeOf(O) {
|
|
495
|
+
var proto = Object.getPrototypeOf(O);
|
|
496
|
+
if (typeof O !== "function" || O === functionPrototype)
|
|
497
|
+
return proto;
|
|
498
|
+
if (proto !== functionPrototype)
|
|
499
|
+
return proto;
|
|
500
|
+
var prototype = O.prototype;
|
|
501
|
+
var prototypeProto = prototype && Object.getPrototypeOf(prototype);
|
|
502
|
+
if (prototypeProto == null || prototypeProto === Object.prototype)
|
|
503
|
+
return proto;
|
|
504
|
+
var constructor = prototypeProto.constructor;
|
|
505
|
+
if (typeof constructor !== "function")
|
|
506
|
+
return proto;
|
|
507
|
+
if (constructor === O)
|
|
508
|
+
return proto;
|
|
509
|
+
return constructor;
|
|
510
|
+
}
|
|
511
|
+
function CreateMetadataRegistry() {
|
|
512
|
+
var fallback;
|
|
513
|
+
if (!IsUndefined(registrySymbol) && typeof root.Reflect !== "undefined" && !(registrySymbol in root.Reflect) && typeof root.Reflect.defineMetadata === "function") {
|
|
514
|
+
fallback = CreateFallbackProvider(root.Reflect);
|
|
515
|
+
}
|
|
516
|
+
var first;
|
|
517
|
+
var second;
|
|
518
|
+
var rest;
|
|
519
|
+
var targetProviderMap = new _WeakMap();
|
|
520
|
+
var registry = {
|
|
521
|
+
registerProvider,
|
|
522
|
+
getProvider,
|
|
523
|
+
setProvider
|
|
524
|
+
};
|
|
525
|
+
return registry;
|
|
526
|
+
function registerProvider(provider) {
|
|
527
|
+
if (!Object.isExtensible(registry)) {
|
|
528
|
+
throw new Error("Cannot add provider to a frozen registry.");
|
|
529
|
+
}
|
|
530
|
+
switch (true) {
|
|
531
|
+
case fallback === provider:
|
|
532
|
+
break;
|
|
533
|
+
case IsUndefined(first):
|
|
534
|
+
first = provider;
|
|
535
|
+
break;
|
|
536
|
+
case first === provider:
|
|
537
|
+
break;
|
|
538
|
+
case IsUndefined(second):
|
|
539
|
+
second = provider;
|
|
540
|
+
break;
|
|
541
|
+
case second === provider:
|
|
542
|
+
break;
|
|
543
|
+
default:
|
|
544
|
+
if (rest === void 0)
|
|
545
|
+
rest = new _Set();
|
|
546
|
+
rest.add(provider);
|
|
547
|
+
break;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
function getProviderNoCache(O, P) {
|
|
551
|
+
if (!IsUndefined(first)) {
|
|
552
|
+
if (first.isProviderFor(O, P))
|
|
553
|
+
return first;
|
|
554
|
+
if (!IsUndefined(second)) {
|
|
555
|
+
if (second.isProviderFor(O, P))
|
|
556
|
+
return first;
|
|
557
|
+
if (!IsUndefined(rest)) {
|
|
558
|
+
var iterator = GetIterator(rest);
|
|
559
|
+
while (true) {
|
|
560
|
+
var next = IteratorStep(iterator);
|
|
561
|
+
if (!next) {
|
|
562
|
+
return void 0;
|
|
563
|
+
}
|
|
564
|
+
var provider = IteratorValue(next);
|
|
565
|
+
if (provider.isProviderFor(O, P)) {
|
|
566
|
+
IteratorClose(iterator);
|
|
567
|
+
return provider;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
if (!IsUndefined(fallback) && fallback.isProviderFor(O, P)) {
|
|
574
|
+
return fallback;
|
|
575
|
+
}
|
|
576
|
+
return void 0;
|
|
577
|
+
}
|
|
578
|
+
function getProvider(O, P) {
|
|
579
|
+
var providerMap = targetProviderMap.get(O);
|
|
580
|
+
var provider;
|
|
581
|
+
if (!IsUndefined(providerMap)) {
|
|
582
|
+
provider = providerMap.get(P);
|
|
583
|
+
}
|
|
584
|
+
if (!IsUndefined(provider)) {
|
|
585
|
+
return provider;
|
|
586
|
+
}
|
|
587
|
+
provider = getProviderNoCache(O, P);
|
|
588
|
+
if (!IsUndefined(provider)) {
|
|
589
|
+
if (IsUndefined(providerMap)) {
|
|
590
|
+
providerMap = new _Map();
|
|
591
|
+
targetProviderMap.set(O, providerMap);
|
|
592
|
+
}
|
|
593
|
+
providerMap.set(P, provider);
|
|
594
|
+
}
|
|
595
|
+
return provider;
|
|
596
|
+
}
|
|
597
|
+
function hasProvider(provider) {
|
|
598
|
+
if (IsUndefined(provider))
|
|
599
|
+
throw new TypeError();
|
|
600
|
+
return first === provider || second === provider || !IsUndefined(rest) && rest.has(provider);
|
|
601
|
+
}
|
|
602
|
+
function setProvider(O, P, provider) {
|
|
603
|
+
if (!hasProvider(provider)) {
|
|
604
|
+
throw new Error("Metadata provider not registered.");
|
|
605
|
+
}
|
|
606
|
+
var existingProvider = getProvider(O, P);
|
|
607
|
+
if (existingProvider !== provider) {
|
|
608
|
+
if (!IsUndefined(existingProvider)) {
|
|
609
|
+
return false;
|
|
610
|
+
}
|
|
611
|
+
var providerMap = targetProviderMap.get(O);
|
|
612
|
+
if (IsUndefined(providerMap)) {
|
|
613
|
+
providerMap = new _Map();
|
|
614
|
+
targetProviderMap.set(O, providerMap);
|
|
615
|
+
}
|
|
616
|
+
providerMap.set(P, provider);
|
|
617
|
+
}
|
|
618
|
+
return true;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
function GetOrCreateMetadataRegistry() {
|
|
622
|
+
var metadataRegistry2;
|
|
623
|
+
if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) {
|
|
624
|
+
metadataRegistry2 = root.Reflect[registrySymbol];
|
|
625
|
+
}
|
|
626
|
+
if (IsUndefined(metadataRegistry2)) {
|
|
627
|
+
metadataRegistry2 = CreateMetadataRegistry();
|
|
628
|
+
}
|
|
629
|
+
if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) {
|
|
630
|
+
Object.defineProperty(root.Reflect, registrySymbol, {
|
|
631
|
+
enumerable: false,
|
|
632
|
+
configurable: false,
|
|
633
|
+
writable: false,
|
|
634
|
+
value: metadataRegistry2
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
return metadataRegistry2;
|
|
638
|
+
}
|
|
639
|
+
function CreateMetadataProvider(registry) {
|
|
640
|
+
var metadata2 = new _WeakMap();
|
|
641
|
+
var provider = {
|
|
642
|
+
isProviderFor: function(O, P) {
|
|
643
|
+
var targetMetadata = metadata2.get(O);
|
|
644
|
+
if (IsUndefined(targetMetadata))
|
|
645
|
+
return false;
|
|
646
|
+
return targetMetadata.has(P);
|
|
647
|
+
},
|
|
648
|
+
OrdinaryDefineOwnMetadata: OrdinaryDefineOwnMetadata2,
|
|
649
|
+
OrdinaryHasOwnMetadata: OrdinaryHasOwnMetadata2,
|
|
650
|
+
OrdinaryGetOwnMetadata: OrdinaryGetOwnMetadata2,
|
|
651
|
+
OrdinaryOwnMetadataKeys: OrdinaryOwnMetadataKeys2,
|
|
652
|
+
OrdinaryDeleteMetadata
|
|
653
|
+
};
|
|
654
|
+
metadataRegistry.registerProvider(provider);
|
|
655
|
+
return provider;
|
|
656
|
+
function GetOrCreateMetadataMap(O, P, Create) {
|
|
657
|
+
var targetMetadata = metadata2.get(O);
|
|
658
|
+
var createdTargetMetadata = false;
|
|
659
|
+
if (IsUndefined(targetMetadata)) {
|
|
660
|
+
if (!Create)
|
|
661
|
+
return void 0;
|
|
662
|
+
targetMetadata = new _Map();
|
|
663
|
+
metadata2.set(O, targetMetadata);
|
|
664
|
+
createdTargetMetadata = true;
|
|
665
|
+
}
|
|
666
|
+
var metadataMap = targetMetadata.get(P);
|
|
667
|
+
if (IsUndefined(metadataMap)) {
|
|
668
|
+
if (!Create)
|
|
669
|
+
return void 0;
|
|
670
|
+
metadataMap = new _Map();
|
|
671
|
+
targetMetadata.set(P, metadataMap);
|
|
672
|
+
if (!registry.setProvider(O, P, provider)) {
|
|
673
|
+
targetMetadata.delete(P);
|
|
674
|
+
if (createdTargetMetadata) {
|
|
675
|
+
metadata2.delete(O);
|
|
676
|
+
}
|
|
677
|
+
throw new Error("Wrong provider for target.");
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
return metadataMap;
|
|
681
|
+
}
|
|
682
|
+
function OrdinaryHasOwnMetadata2(MetadataKey, O, P) {
|
|
683
|
+
var metadataMap = GetOrCreateMetadataMap(
|
|
684
|
+
O,
|
|
685
|
+
P,
|
|
686
|
+
/*Create*/
|
|
687
|
+
false
|
|
688
|
+
);
|
|
689
|
+
if (IsUndefined(metadataMap))
|
|
690
|
+
return false;
|
|
691
|
+
return ToBoolean(metadataMap.has(MetadataKey));
|
|
692
|
+
}
|
|
693
|
+
function OrdinaryGetOwnMetadata2(MetadataKey, O, P) {
|
|
694
|
+
var metadataMap = GetOrCreateMetadataMap(
|
|
695
|
+
O,
|
|
696
|
+
P,
|
|
697
|
+
/*Create*/
|
|
698
|
+
false
|
|
699
|
+
);
|
|
700
|
+
if (IsUndefined(metadataMap))
|
|
701
|
+
return void 0;
|
|
702
|
+
return metadataMap.get(MetadataKey);
|
|
703
|
+
}
|
|
704
|
+
function OrdinaryDefineOwnMetadata2(MetadataKey, MetadataValue, O, P) {
|
|
705
|
+
var metadataMap = GetOrCreateMetadataMap(
|
|
706
|
+
O,
|
|
707
|
+
P,
|
|
708
|
+
/*Create*/
|
|
709
|
+
true
|
|
710
|
+
);
|
|
711
|
+
metadataMap.set(MetadataKey, MetadataValue);
|
|
712
|
+
}
|
|
713
|
+
function OrdinaryOwnMetadataKeys2(O, P) {
|
|
714
|
+
var keys = [];
|
|
715
|
+
var metadataMap = GetOrCreateMetadataMap(
|
|
716
|
+
O,
|
|
717
|
+
P,
|
|
718
|
+
/*Create*/
|
|
719
|
+
false
|
|
720
|
+
);
|
|
721
|
+
if (IsUndefined(metadataMap))
|
|
722
|
+
return keys;
|
|
723
|
+
var keysObj = metadataMap.keys();
|
|
724
|
+
var iterator = GetIterator(keysObj);
|
|
725
|
+
var k = 0;
|
|
726
|
+
while (true) {
|
|
727
|
+
var next = IteratorStep(iterator);
|
|
728
|
+
if (!next) {
|
|
729
|
+
keys.length = k;
|
|
730
|
+
return keys;
|
|
731
|
+
}
|
|
732
|
+
var nextValue = IteratorValue(next);
|
|
733
|
+
try {
|
|
734
|
+
keys[k] = nextValue;
|
|
735
|
+
} catch (e) {
|
|
736
|
+
try {
|
|
737
|
+
IteratorClose(iterator);
|
|
738
|
+
} finally {
|
|
739
|
+
throw e;
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
k++;
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
function OrdinaryDeleteMetadata(MetadataKey, O, P) {
|
|
746
|
+
var metadataMap = GetOrCreateMetadataMap(
|
|
747
|
+
O,
|
|
748
|
+
P,
|
|
749
|
+
/*Create*/
|
|
750
|
+
false
|
|
751
|
+
);
|
|
752
|
+
if (IsUndefined(metadataMap))
|
|
753
|
+
return false;
|
|
754
|
+
if (!metadataMap.delete(MetadataKey))
|
|
755
|
+
return false;
|
|
756
|
+
if (metadataMap.size === 0) {
|
|
757
|
+
var targetMetadata = metadata2.get(O);
|
|
758
|
+
if (!IsUndefined(targetMetadata)) {
|
|
759
|
+
targetMetadata.delete(P);
|
|
760
|
+
if (targetMetadata.size === 0) {
|
|
761
|
+
metadata2.delete(targetMetadata);
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
return true;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
function CreateFallbackProvider(reflect) {
|
|
769
|
+
var defineMetadata2 = reflect.defineMetadata, hasOwnMetadata2 = reflect.hasOwnMetadata, getOwnMetadata2 = reflect.getOwnMetadata, getOwnMetadataKeys2 = reflect.getOwnMetadataKeys, deleteMetadata2 = reflect.deleteMetadata;
|
|
770
|
+
var metadataOwner = new _WeakMap();
|
|
771
|
+
var provider = {
|
|
772
|
+
isProviderFor: function(O, P) {
|
|
773
|
+
var metadataPropertySet = metadataOwner.get(O);
|
|
774
|
+
if (!IsUndefined(metadataPropertySet) && metadataPropertySet.has(P)) {
|
|
775
|
+
return true;
|
|
776
|
+
}
|
|
777
|
+
if (getOwnMetadataKeys2(O, P).length) {
|
|
778
|
+
if (IsUndefined(metadataPropertySet)) {
|
|
779
|
+
metadataPropertySet = new _Set();
|
|
780
|
+
metadataOwner.set(O, metadataPropertySet);
|
|
781
|
+
}
|
|
782
|
+
metadataPropertySet.add(P);
|
|
783
|
+
return true;
|
|
784
|
+
}
|
|
785
|
+
return false;
|
|
786
|
+
},
|
|
787
|
+
OrdinaryDefineOwnMetadata: defineMetadata2,
|
|
788
|
+
OrdinaryHasOwnMetadata: hasOwnMetadata2,
|
|
789
|
+
OrdinaryGetOwnMetadata: getOwnMetadata2,
|
|
790
|
+
OrdinaryOwnMetadataKeys: getOwnMetadataKeys2,
|
|
791
|
+
OrdinaryDeleteMetadata: deleteMetadata2
|
|
792
|
+
};
|
|
793
|
+
return provider;
|
|
794
|
+
}
|
|
795
|
+
function GetMetadataProvider(O, P, Create) {
|
|
796
|
+
var registeredProvider = metadataRegistry.getProvider(O, P);
|
|
797
|
+
if (!IsUndefined(registeredProvider)) {
|
|
798
|
+
return registeredProvider;
|
|
799
|
+
}
|
|
800
|
+
if (Create) {
|
|
801
|
+
if (metadataRegistry.setProvider(O, P, metadataProvider)) {
|
|
802
|
+
return metadataProvider;
|
|
803
|
+
}
|
|
804
|
+
throw new Error("Illegal state.");
|
|
805
|
+
}
|
|
806
|
+
return void 0;
|
|
807
|
+
}
|
|
808
|
+
function CreateMapPolyfill() {
|
|
809
|
+
var cacheSentinel = {};
|
|
810
|
+
var arraySentinel = [];
|
|
811
|
+
var MapIterator = (
|
|
812
|
+
/** @class */
|
|
813
|
+
function() {
|
|
814
|
+
function MapIterator2(keys, values, selector) {
|
|
815
|
+
this._index = 0;
|
|
816
|
+
this._keys = keys;
|
|
817
|
+
this._values = values;
|
|
818
|
+
this._selector = selector;
|
|
819
|
+
}
|
|
820
|
+
MapIterator2.prototype["@@iterator"] = function() {
|
|
821
|
+
return this;
|
|
822
|
+
};
|
|
823
|
+
MapIterator2.prototype[iteratorSymbol] = function() {
|
|
824
|
+
return this;
|
|
825
|
+
};
|
|
826
|
+
MapIterator2.prototype.next = function() {
|
|
827
|
+
var index = this._index;
|
|
828
|
+
if (index >= 0 && index < this._keys.length) {
|
|
829
|
+
var result = this._selector(this._keys[index], this._values[index]);
|
|
830
|
+
if (index + 1 >= this._keys.length) {
|
|
831
|
+
this._index = -1;
|
|
832
|
+
this._keys = arraySentinel;
|
|
833
|
+
this._values = arraySentinel;
|
|
834
|
+
} else {
|
|
835
|
+
this._index++;
|
|
836
|
+
}
|
|
837
|
+
return { value: result, done: false };
|
|
838
|
+
}
|
|
839
|
+
return { value: void 0, done: true };
|
|
840
|
+
};
|
|
841
|
+
MapIterator2.prototype.throw = function(error) {
|
|
842
|
+
if (this._index >= 0) {
|
|
843
|
+
this._index = -1;
|
|
844
|
+
this._keys = arraySentinel;
|
|
845
|
+
this._values = arraySentinel;
|
|
846
|
+
}
|
|
847
|
+
throw error;
|
|
848
|
+
};
|
|
849
|
+
MapIterator2.prototype.return = function(value) {
|
|
850
|
+
if (this._index >= 0) {
|
|
851
|
+
this._index = -1;
|
|
852
|
+
this._keys = arraySentinel;
|
|
853
|
+
this._values = arraySentinel;
|
|
854
|
+
}
|
|
855
|
+
return { value, done: true };
|
|
856
|
+
};
|
|
857
|
+
return MapIterator2;
|
|
858
|
+
}()
|
|
859
|
+
);
|
|
860
|
+
var Map2 = (
|
|
861
|
+
/** @class */
|
|
862
|
+
function() {
|
|
863
|
+
function Map3() {
|
|
864
|
+
this._keys = [];
|
|
865
|
+
this._values = [];
|
|
866
|
+
this._cacheKey = cacheSentinel;
|
|
867
|
+
this._cacheIndex = -2;
|
|
868
|
+
}
|
|
869
|
+
Object.defineProperty(Map3.prototype, "size", {
|
|
870
|
+
get: function() {
|
|
871
|
+
return this._keys.length;
|
|
872
|
+
},
|
|
873
|
+
enumerable: true,
|
|
874
|
+
configurable: true
|
|
875
|
+
});
|
|
876
|
+
Map3.prototype.has = function(key) {
|
|
877
|
+
return this._find(
|
|
878
|
+
key,
|
|
879
|
+
/*insert*/
|
|
880
|
+
false
|
|
881
|
+
) >= 0;
|
|
882
|
+
};
|
|
883
|
+
Map3.prototype.get = function(key) {
|
|
884
|
+
var index = this._find(
|
|
885
|
+
key,
|
|
886
|
+
/*insert*/
|
|
887
|
+
false
|
|
888
|
+
);
|
|
889
|
+
return index >= 0 ? this._values[index] : void 0;
|
|
890
|
+
};
|
|
891
|
+
Map3.prototype.set = function(key, value) {
|
|
892
|
+
var index = this._find(
|
|
893
|
+
key,
|
|
894
|
+
/*insert*/
|
|
895
|
+
true
|
|
896
|
+
);
|
|
897
|
+
this._values[index] = value;
|
|
898
|
+
return this;
|
|
899
|
+
};
|
|
900
|
+
Map3.prototype.delete = function(key) {
|
|
901
|
+
var index = this._find(
|
|
902
|
+
key,
|
|
903
|
+
/*insert*/
|
|
904
|
+
false
|
|
905
|
+
);
|
|
906
|
+
if (index >= 0) {
|
|
907
|
+
var size = this._keys.length;
|
|
908
|
+
for (var i = index + 1; i < size; i++) {
|
|
909
|
+
this._keys[i - 1] = this._keys[i];
|
|
910
|
+
this._values[i - 1] = this._values[i];
|
|
911
|
+
}
|
|
912
|
+
this._keys.length--;
|
|
913
|
+
this._values.length--;
|
|
914
|
+
if (SameValueZero(key, this._cacheKey)) {
|
|
915
|
+
this._cacheKey = cacheSentinel;
|
|
916
|
+
this._cacheIndex = -2;
|
|
917
|
+
}
|
|
918
|
+
return true;
|
|
919
|
+
}
|
|
920
|
+
return false;
|
|
921
|
+
};
|
|
922
|
+
Map3.prototype.clear = function() {
|
|
923
|
+
this._keys.length = 0;
|
|
924
|
+
this._values.length = 0;
|
|
925
|
+
this._cacheKey = cacheSentinel;
|
|
926
|
+
this._cacheIndex = -2;
|
|
927
|
+
};
|
|
928
|
+
Map3.prototype.keys = function() {
|
|
929
|
+
return new MapIterator(this._keys, this._values, getKey);
|
|
930
|
+
};
|
|
931
|
+
Map3.prototype.values = function() {
|
|
932
|
+
return new MapIterator(this._keys, this._values, getValue);
|
|
933
|
+
};
|
|
934
|
+
Map3.prototype.entries = function() {
|
|
935
|
+
return new MapIterator(this._keys, this._values, getEntry);
|
|
936
|
+
};
|
|
937
|
+
Map3.prototype["@@iterator"] = function() {
|
|
938
|
+
return this.entries();
|
|
939
|
+
};
|
|
940
|
+
Map3.prototype[iteratorSymbol] = function() {
|
|
941
|
+
return this.entries();
|
|
942
|
+
};
|
|
943
|
+
Map3.prototype._find = function(key, insert) {
|
|
944
|
+
if (!SameValueZero(this._cacheKey, key)) {
|
|
945
|
+
this._cacheIndex = -1;
|
|
946
|
+
for (var i = 0; i < this._keys.length; i++) {
|
|
947
|
+
if (SameValueZero(this._keys[i], key)) {
|
|
948
|
+
this._cacheIndex = i;
|
|
949
|
+
break;
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
if (this._cacheIndex < 0 && insert) {
|
|
954
|
+
this._cacheIndex = this._keys.length;
|
|
955
|
+
this._keys.push(key);
|
|
956
|
+
this._values.push(void 0);
|
|
957
|
+
}
|
|
958
|
+
return this._cacheIndex;
|
|
959
|
+
};
|
|
960
|
+
return Map3;
|
|
961
|
+
}()
|
|
962
|
+
);
|
|
963
|
+
return Map2;
|
|
964
|
+
function getKey(key, _) {
|
|
965
|
+
return key;
|
|
966
|
+
}
|
|
967
|
+
function getValue(_, value) {
|
|
968
|
+
return value;
|
|
969
|
+
}
|
|
970
|
+
function getEntry(key, value) {
|
|
971
|
+
return [key, value];
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
function CreateSetPolyfill() {
|
|
975
|
+
var Set2 = (
|
|
976
|
+
/** @class */
|
|
977
|
+
function() {
|
|
978
|
+
function Set3() {
|
|
979
|
+
this._map = new _Map();
|
|
980
|
+
}
|
|
981
|
+
Object.defineProperty(Set3.prototype, "size", {
|
|
982
|
+
get: function() {
|
|
983
|
+
return this._map.size;
|
|
984
|
+
},
|
|
985
|
+
enumerable: true,
|
|
986
|
+
configurable: true
|
|
987
|
+
});
|
|
988
|
+
Set3.prototype.has = function(value) {
|
|
989
|
+
return this._map.has(value);
|
|
990
|
+
};
|
|
991
|
+
Set3.prototype.add = function(value) {
|
|
992
|
+
return this._map.set(value, value), this;
|
|
993
|
+
};
|
|
994
|
+
Set3.prototype.delete = function(value) {
|
|
995
|
+
return this._map.delete(value);
|
|
996
|
+
};
|
|
997
|
+
Set3.prototype.clear = function() {
|
|
998
|
+
this._map.clear();
|
|
999
|
+
};
|
|
1000
|
+
Set3.prototype.keys = function() {
|
|
1001
|
+
return this._map.keys();
|
|
1002
|
+
};
|
|
1003
|
+
Set3.prototype.values = function() {
|
|
1004
|
+
return this._map.keys();
|
|
1005
|
+
};
|
|
1006
|
+
Set3.prototype.entries = function() {
|
|
1007
|
+
return this._map.entries();
|
|
1008
|
+
};
|
|
1009
|
+
Set3.prototype["@@iterator"] = function() {
|
|
1010
|
+
return this.keys();
|
|
1011
|
+
};
|
|
1012
|
+
Set3.prototype[iteratorSymbol] = function() {
|
|
1013
|
+
return this.keys();
|
|
1014
|
+
};
|
|
1015
|
+
return Set3;
|
|
1016
|
+
}()
|
|
1017
|
+
);
|
|
1018
|
+
return Set2;
|
|
1019
|
+
}
|
|
1020
|
+
function CreateWeakMapPolyfill() {
|
|
1021
|
+
var UUID_SIZE = 16;
|
|
1022
|
+
var keys = HashMap.create();
|
|
1023
|
+
var rootKey = CreateUniqueKey();
|
|
1024
|
+
return (
|
|
1025
|
+
/** @class */
|
|
1026
|
+
function() {
|
|
1027
|
+
function WeakMap2() {
|
|
1028
|
+
this._key = CreateUniqueKey();
|
|
1029
|
+
}
|
|
1030
|
+
WeakMap2.prototype.has = function(target) {
|
|
1031
|
+
var table = GetOrCreateWeakMapTable(
|
|
1032
|
+
target,
|
|
1033
|
+
/*create*/
|
|
1034
|
+
false
|
|
1035
|
+
);
|
|
1036
|
+
return table !== void 0 ? HashMap.has(table, this._key) : false;
|
|
1037
|
+
};
|
|
1038
|
+
WeakMap2.prototype.get = function(target) {
|
|
1039
|
+
var table = GetOrCreateWeakMapTable(
|
|
1040
|
+
target,
|
|
1041
|
+
/*create*/
|
|
1042
|
+
false
|
|
1043
|
+
);
|
|
1044
|
+
return table !== void 0 ? HashMap.get(table, this._key) : void 0;
|
|
1045
|
+
};
|
|
1046
|
+
WeakMap2.prototype.set = function(target, value) {
|
|
1047
|
+
var table = GetOrCreateWeakMapTable(
|
|
1048
|
+
target,
|
|
1049
|
+
/*create*/
|
|
1050
|
+
true
|
|
1051
|
+
);
|
|
1052
|
+
table[this._key] = value;
|
|
1053
|
+
return this;
|
|
1054
|
+
};
|
|
1055
|
+
WeakMap2.prototype.delete = function(target) {
|
|
1056
|
+
var table = GetOrCreateWeakMapTable(
|
|
1057
|
+
target,
|
|
1058
|
+
/*create*/
|
|
1059
|
+
false
|
|
1060
|
+
);
|
|
1061
|
+
return table !== void 0 ? delete table[this._key] : false;
|
|
1062
|
+
};
|
|
1063
|
+
WeakMap2.prototype.clear = function() {
|
|
1064
|
+
this._key = CreateUniqueKey();
|
|
1065
|
+
};
|
|
1066
|
+
return WeakMap2;
|
|
1067
|
+
}()
|
|
1068
|
+
);
|
|
1069
|
+
function CreateUniqueKey() {
|
|
1070
|
+
var key;
|
|
1071
|
+
do
|
|
1072
|
+
key = "@@WeakMap@@" + CreateUUID();
|
|
1073
|
+
while (HashMap.has(keys, key));
|
|
1074
|
+
keys[key] = true;
|
|
1075
|
+
return key;
|
|
1076
|
+
}
|
|
1077
|
+
function GetOrCreateWeakMapTable(target, create) {
|
|
1078
|
+
if (!hasOwn.call(target, rootKey)) {
|
|
1079
|
+
if (!create)
|
|
1080
|
+
return void 0;
|
|
1081
|
+
Object.defineProperty(target, rootKey, { value: HashMap.create() });
|
|
1082
|
+
}
|
|
1083
|
+
return target[rootKey];
|
|
1084
|
+
}
|
|
1085
|
+
function FillRandomBytes(buffer, size) {
|
|
1086
|
+
for (var i = 0; i < size; ++i)
|
|
1087
|
+
buffer[i] = Math.random() * 255 | 0;
|
|
1088
|
+
return buffer;
|
|
1089
|
+
}
|
|
1090
|
+
function GenRandomBytes(size) {
|
|
1091
|
+
if (typeof Uint8Array === "function") {
|
|
1092
|
+
var array = new Uint8Array(size);
|
|
1093
|
+
if (typeof crypto !== "undefined") {
|
|
1094
|
+
crypto.getRandomValues(array);
|
|
1095
|
+
} else if (typeof msCrypto !== "undefined") {
|
|
1096
|
+
msCrypto.getRandomValues(array);
|
|
1097
|
+
} else {
|
|
1098
|
+
FillRandomBytes(array, size);
|
|
1099
|
+
}
|
|
1100
|
+
return array;
|
|
1101
|
+
}
|
|
1102
|
+
return FillRandomBytes(new Array(size), size);
|
|
1103
|
+
}
|
|
1104
|
+
function CreateUUID() {
|
|
1105
|
+
var data = GenRandomBytes(UUID_SIZE);
|
|
1106
|
+
data[6] = data[6] & 79 | 64;
|
|
1107
|
+
data[8] = data[8] & 191 | 128;
|
|
1108
|
+
var result = "";
|
|
1109
|
+
for (var offset = 0; offset < UUID_SIZE; ++offset) {
|
|
1110
|
+
var byte = data[offset];
|
|
1111
|
+
if (offset === 4 || offset === 6 || offset === 8)
|
|
1112
|
+
result += "-";
|
|
1113
|
+
if (byte < 16)
|
|
1114
|
+
result += "0";
|
|
1115
|
+
result += byte.toString(16).toLowerCase();
|
|
1116
|
+
}
|
|
1117
|
+
return result;
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
function MakeDictionary(obj) {
|
|
1121
|
+
obj.__ = void 0;
|
|
1122
|
+
delete obj.__;
|
|
1123
|
+
return obj;
|
|
1124
|
+
}
|
|
1125
|
+
});
|
|
1126
|
+
})(Reflect2 || (Reflect2 = {}));
|
|
1127
|
+
}
|
|
1128
|
+
});
|
|
1129
|
+
|
|
1130
|
+
// src/main.ts
|
|
1131
|
+
var main_exports = {};
|
|
1132
|
+
__export(main_exports, {
|
|
1133
|
+
AppLifecycleState: () => AppLifecycleState,
|
|
1134
|
+
AppModule: () => AppModule,
|
|
1135
|
+
AppProxyEventHandlersModel: () => AppProxyEventHandlersModel,
|
|
1136
|
+
DefaultCameraType: () => DefaultCameraType,
|
|
1137
|
+
KEYBOARD_EVENT_CODES: () => KEYBOARD_EVENT_CODES,
|
|
1138
|
+
LaunchAppProps: () => LaunchAppProps,
|
|
1139
|
+
LoaderModule: () => LoaderModule,
|
|
1140
|
+
PROXY_EVENT_LISTENERS: () => PROXY_EVENT_LISTENERS,
|
|
1141
|
+
ProxyEventHandlersModel: () => ProxyEventHandlersModel,
|
|
1142
|
+
ProxyEventObservablesModel: () => ProxyEventObservablesModel,
|
|
1143
|
+
ProxyEventSubjectsModel: () => ProxyEventSubjectsModel,
|
|
1144
|
+
RegisterLifecycleState: () => RegisterLifecycleState,
|
|
1145
|
+
RegisterModule: () => RegisterModule,
|
|
1146
|
+
RegisterPropsModel: () => RegisterPropsModel,
|
|
1147
|
+
RegisterProxyEventHandlersModel: () => RegisterProxyEventHandlersModel,
|
|
1148
|
+
appModule: () => appModule,
|
|
1149
|
+
loaderModule: () => loaderModule,
|
|
1150
|
+
object3DSerializer: () => object3DSerializer,
|
|
1151
|
+
register: () => register
|
|
1152
|
+
});
|
|
1153
|
+
module.exports = __toCommonJS(main_exports);
|
|
1154
|
+
|
|
1155
|
+
// src/core/app/app.module.ts
|
|
1156
|
+
var import_reflect_metadata = __toESM(require_Reflect());
|
|
1157
|
+
|
|
1158
|
+
// ../../node_modules/.pnpm/tsyringe@4.8.0/node_modules/tsyringe/dist/esm5/types/lifecycle.js
|
|
1159
|
+
var Lifecycle;
|
|
1160
|
+
(function(Lifecycle2) {
|
|
1161
|
+
Lifecycle2[Lifecycle2["Transient"] = 0] = "Transient";
|
|
1162
|
+
Lifecycle2[Lifecycle2["Singleton"] = 1] = "Singleton";
|
|
1163
|
+
Lifecycle2[Lifecycle2["ResolutionScoped"] = 2] = "ResolutionScoped";
|
|
1164
|
+
Lifecycle2[Lifecycle2["ContainerScoped"] = 3] = "ContainerScoped";
|
|
1165
|
+
})(Lifecycle || (Lifecycle = {}));
|
|
1166
|
+
var lifecycle_default = Lifecycle;
|
|
1167
|
+
|
|
1168
|
+
// ../../node_modules/.pnpm/tslib@1.14.1/node_modules/tslib/tslib.es6.js
|
|
1169
|
+
var extendStatics = function(d, b) {
|
|
1170
|
+
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
1171
|
+
d2.__proto__ = b2;
|
|
1172
|
+
} || function(d2, b2) {
|
|
1173
|
+
for (var p in b2) if (b2.hasOwnProperty(p)) d2[p] = b2[p];
|
|
1174
|
+
};
|
|
1175
|
+
return extendStatics(d, b);
|
|
1176
|
+
};
|
|
1177
|
+
function __extends(d, b) {
|
|
1178
|
+
extendStatics(d, b);
|
|
1179
|
+
function __() {
|
|
1180
|
+
this.constructor = d;
|
|
1181
|
+
}
|
|
1182
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1183
|
+
}
|
|
1184
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
1185
|
+
function adopt(value) {
|
|
1186
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
1187
|
+
resolve(value);
|
|
1188
|
+
});
|
|
1189
|
+
}
|
|
1190
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
1191
|
+
function fulfilled(value) {
|
|
1192
|
+
try {
|
|
1193
|
+
step(generator.next(value));
|
|
1194
|
+
} catch (e) {
|
|
1195
|
+
reject(e);
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
function rejected(value) {
|
|
1199
|
+
try {
|
|
1200
|
+
step(generator["throw"](value));
|
|
1201
|
+
} catch (e) {
|
|
1202
|
+
reject(e);
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
function step(result) {
|
|
1206
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
1207
|
+
}
|
|
1208
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1209
|
+
});
|
|
1210
|
+
}
|
|
1211
|
+
function __generator(thisArg, body) {
|
|
1212
|
+
var _ = { label: 0, sent: function() {
|
|
1213
|
+
if (t[0] & 1) throw t[1];
|
|
1214
|
+
return t[1];
|
|
1215
|
+
}, trys: [], ops: [] }, f, y, t, g;
|
|
1216
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
1217
|
+
return this;
|
|
1218
|
+
}), g;
|
|
1219
|
+
function verb(n) {
|
|
1220
|
+
return function(v) {
|
|
1221
|
+
return step([n, v]);
|
|
1222
|
+
};
|
|
1223
|
+
}
|
|
1224
|
+
function step(op) {
|
|
1225
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
1226
|
+
while (_) try {
|
|
1227
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
1228
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
1229
|
+
switch (op[0]) {
|
|
1230
|
+
case 0:
|
|
1231
|
+
case 1:
|
|
1232
|
+
t = op;
|
|
1233
|
+
break;
|
|
1234
|
+
case 4:
|
|
1235
|
+
_.label++;
|
|
1236
|
+
return { value: op[1], done: false };
|
|
1237
|
+
case 5:
|
|
1238
|
+
_.label++;
|
|
1239
|
+
y = op[1];
|
|
1240
|
+
op = [0];
|
|
1241
|
+
continue;
|
|
1242
|
+
case 7:
|
|
1243
|
+
op = _.ops.pop();
|
|
1244
|
+
_.trys.pop();
|
|
1245
|
+
continue;
|
|
1246
|
+
default:
|
|
1247
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
1248
|
+
_ = 0;
|
|
1249
|
+
continue;
|
|
1250
|
+
}
|
|
1251
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
1252
|
+
_.label = op[1];
|
|
1253
|
+
break;
|
|
1254
|
+
}
|
|
1255
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
1256
|
+
_.label = t[1];
|
|
1257
|
+
t = op;
|
|
1258
|
+
break;
|
|
1259
|
+
}
|
|
1260
|
+
if (t && _.label < t[2]) {
|
|
1261
|
+
_.label = t[2];
|
|
1262
|
+
_.ops.push(op);
|
|
1263
|
+
break;
|
|
1264
|
+
}
|
|
1265
|
+
if (t[2]) _.ops.pop();
|
|
1266
|
+
_.trys.pop();
|
|
1267
|
+
continue;
|
|
1268
|
+
}
|
|
1269
|
+
op = body.call(thisArg, _);
|
|
1270
|
+
} catch (e) {
|
|
1271
|
+
op = [6, e];
|
|
1272
|
+
y = 0;
|
|
1273
|
+
} finally {
|
|
1274
|
+
f = t = 0;
|
|
1275
|
+
}
|
|
1276
|
+
if (op[0] & 5) throw op[1];
|
|
1277
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
function __values(o) {
|
|
1281
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
1282
|
+
if (m) return m.call(o);
|
|
1283
|
+
if (o && typeof o.length === "number") return {
|
|
1284
|
+
next: function() {
|
|
1285
|
+
if (o && i >= o.length) o = void 0;
|
|
1286
|
+
return { value: o && o[i++], done: !o };
|
|
1287
|
+
}
|
|
1288
|
+
};
|
|
1289
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
1290
|
+
}
|
|
1291
|
+
function __read(o, n) {
|
|
1292
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
1293
|
+
if (!m) return o;
|
|
1294
|
+
var i = m.call(o), r, ar = [], e;
|
|
1295
|
+
try {
|
|
1296
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
1297
|
+
} catch (error) {
|
|
1298
|
+
e = { error };
|
|
1299
|
+
} finally {
|
|
1300
|
+
try {
|
|
1301
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
1302
|
+
} finally {
|
|
1303
|
+
if (e) throw e.error;
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
return ar;
|
|
1307
|
+
}
|
|
1308
|
+
function __spread() {
|
|
1309
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
1310
|
+
ar = ar.concat(__read(arguments[i]));
|
|
1311
|
+
return ar;
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
// ../../node_modules/.pnpm/tsyringe@4.8.0/node_modules/tsyringe/dist/esm5/reflection-helpers.js
|
|
1315
|
+
var INJECTION_TOKEN_METADATA_KEY = "injectionTokens";
|
|
1316
|
+
function getParamInfo(target) {
|
|
1317
|
+
var params = Reflect.getMetadata("design:paramtypes", target) || [];
|
|
1318
|
+
var injectionTokens = Reflect.getOwnMetadata(INJECTION_TOKEN_METADATA_KEY, target) || {};
|
|
1319
|
+
Object.keys(injectionTokens).forEach(function(key) {
|
|
1320
|
+
params[+key] = injectionTokens[key];
|
|
1321
|
+
});
|
|
1322
|
+
return params;
|
|
1323
|
+
}
|
|
1324
|
+
function defineInjectionTokenMetadata(data, transform) {
|
|
1325
|
+
return function(target, _propertyKey, parameterIndex) {
|
|
1326
|
+
var descriptors = Reflect.getOwnMetadata(INJECTION_TOKEN_METADATA_KEY, target) || {};
|
|
1327
|
+
descriptors[parameterIndex] = transform ? {
|
|
1328
|
+
token: data,
|
|
1329
|
+
transform: transform.transformToken,
|
|
1330
|
+
transformArgs: transform.args || []
|
|
1331
|
+
} : data;
|
|
1332
|
+
Reflect.defineMetadata(INJECTION_TOKEN_METADATA_KEY, descriptors, target);
|
|
1333
|
+
};
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
// ../../node_modules/.pnpm/tsyringe@4.8.0/node_modules/tsyringe/dist/esm5/providers/class-provider.js
|
|
1337
|
+
function isClassProvider(provider) {
|
|
1338
|
+
return !!provider.useClass;
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
// ../../node_modules/.pnpm/tsyringe@4.8.0/node_modules/tsyringe/dist/esm5/providers/factory-provider.js
|
|
1342
|
+
function isFactoryProvider(provider) {
|
|
1343
|
+
return !!provider.useFactory;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
// ../../node_modules/.pnpm/tsyringe@4.8.0/node_modules/tsyringe/dist/esm5/lazy-helpers.js
|
|
1347
|
+
var DelayedConstructor = function() {
|
|
1348
|
+
function DelayedConstructor2(wrap) {
|
|
1349
|
+
this.wrap = wrap;
|
|
1350
|
+
this.reflectMethods = [
|
|
1351
|
+
"get",
|
|
1352
|
+
"getPrototypeOf",
|
|
1353
|
+
"setPrototypeOf",
|
|
1354
|
+
"getOwnPropertyDescriptor",
|
|
1355
|
+
"defineProperty",
|
|
1356
|
+
"has",
|
|
1357
|
+
"set",
|
|
1358
|
+
"deleteProperty",
|
|
1359
|
+
"apply",
|
|
1360
|
+
"construct",
|
|
1361
|
+
"ownKeys"
|
|
1362
|
+
];
|
|
1363
|
+
}
|
|
1364
|
+
DelayedConstructor2.prototype.createProxy = function(createObject) {
|
|
1365
|
+
var _this = this;
|
|
1366
|
+
var target = {};
|
|
1367
|
+
var init = false;
|
|
1368
|
+
var value;
|
|
1369
|
+
var delayedObject = function() {
|
|
1370
|
+
if (!init) {
|
|
1371
|
+
value = createObject(_this.wrap());
|
|
1372
|
+
init = true;
|
|
1373
|
+
}
|
|
1374
|
+
return value;
|
|
1375
|
+
};
|
|
1376
|
+
return new Proxy(target, this.createHandler(delayedObject));
|
|
1377
|
+
};
|
|
1378
|
+
DelayedConstructor2.prototype.createHandler = function(delayedObject) {
|
|
1379
|
+
var handler = {};
|
|
1380
|
+
var install = function(name) {
|
|
1381
|
+
handler[name] = function() {
|
|
1382
|
+
var args = [];
|
|
1383
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1384
|
+
args[_i] = arguments[_i];
|
|
1385
|
+
}
|
|
1386
|
+
args[0] = delayedObject();
|
|
1387
|
+
var method = Reflect[name];
|
|
1388
|
+
return method.apply(void 0, __spread(args));
|
|
1389
|
+
};
|
|
1390
|
+
};
|
|
1391
|
+
this.reflectMethods.forEach(install);
|
|
1392
|
+
return handler;
|
|
1393
|
+
};
|
|
1394
|
+
return DelayedConstructor2;
|
|
1395
|
+
}();
|
|
1396
|
+
|
|
1397
|
+
// ../../node_modules/.pnpm/tsyringe@4.8.0/node_modules/tsyringe/dist/esm5/providers/injection-token.js
|
|
1398
|
+
function isNormalToken(token) {
|
|
1399
|
+
return typeof token === "string" || typeof token === "symbol";
|
|
1400
|
+
}
|
|
1401
|
+
function isTokenDescriptor(descriptor) {
|
|
1402
|
+
return typeof descriptor === "object" && "token" in descriptor && "multiple" in descriptor;
|
|
1403
|
+
}
|
|
1404
|
+
function isTransformDescriptor(descriptor) {
|
|
1405
|
+
return typeof descriptor === "object" && "token" in descriptor && "transform" in descriptor;
|
|
1406
|
+
}
|
|
1407
|
+
function isConstructorToken(token) {
|
|
1408
|
+
return typeof token === "function" || token instanceof DelayedConstructor;
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
// ../../node_modules/.pnpm/tsyringe@4.8.0/node_modules/tsyringe/dist/esm5/providers/token-provider.js
|
|
1412
|
+
function isTokenProvider(provider) {
|
|
1413
|
+
return !!provider.useToken;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
// ../../node_modules/.pnpm/tsyringe@4.8.0/node_modules/tsyringe/dist/esm5/providers/value-provider.js
|
|
1417
|
+
function isValueProvider(provider) {
|
|
1418
|
+
return provider.useValue != void 0;
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
// ../../node_modules/.pnpm/tsyringe@4.8.0/node_modules/tsyringe/dist/esm5/providers/provider.js
|
|
1422
|
+
function isProvider(provider) {
|
|
1423
|
+
return isClassProvider(provider) || isValueProvider(provider) || isTokenProvider(provider) || isFactoryProvider(provider);
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
// ../../node_modules/.pnpm/tsyringe@4.8.0/node_modules/tsyringe/dist/esm5/registry-base.js
|
|
1427
|
+
var RegistryBase = function() {
|
|
1428
|
+
function RegistryBase2() {
|
|
1429
|
+
this._registryMap = /* @__PURE__ */ new Map();
|
|
1430
|
+
}
|
|
1431
|
+
RegistryBase2.prototype.entries = function() {
|
|
1432
|
+
return this._registryMap.entries();
|
|
1433
|
+
};
|
|
1434
|
+
RegistryBase2.prototype.getAll = function(key) {
|
|
1435
|
+
this.ensure(key);
|
|
1436
|
+
return this._registryMap.get(key);
|
|
1437
|
+
};
|
|
1438
|
+
RegistryBase2.prototype.get = function(key) {
|
|
1439
|
+
this.ensure(key);
|
|
1440
|
+
var value = this._registryMap.get(key);
|
|
1441
|
+
return value[value.length - 1] || null;
|
|
1442
|
+
};
|
|
1443
|
+
RegistryBase2.prototype.set = function(key, value) {
|
|
1444
|
+
this.ensure(key);
|
|
1445
|
+
this._registryMap.get(key).push(value);
|
|
1446
|
+
};
|
|
1447
|
+
RegistryBase2.prototype.setAll = function(key, value) {
|
|
1448
|
+
this._registryMap.set(key, value);
|
|
1449
|
+
};
|
|
1450
|
+
RegistryBase2.prototype.has = function(key) {
|
|
1451
|
+
this.ensure(key);
|
|
1452
|
+
return this._registryMap.get(key).length > 0;
|
|
1453
|
+
};
|
|
1454
|
+
RegistryBase2.prototype.clear = function() {
|
|
1455
|
+
this._registryMap.clear();
|
|
1456
|
+
};
|
|
1457
|
+
RegistryBase2.prototype.ensure = function(key) {
|
|
1458
|
+
if (!this._registryMap.has(key)) {
|
|
1459
|
+
this._registryMap.set(key, []);
|
|
1460
|
+
}
|
|
1461
|
+
};
|
|
1462
|
+
return RegistryBase2;
|
|
1463
|
+
}();
|
|
1464
|
+
var registry_base_default = RegistryBase;
|
|
1465
|
+
|
|
1466
|
+
// ../../node_modules/.pnpm/tsyringe@4.8.0/node_modules/tsyringe/dist/esm5/registry.js
|
|
1467
|
+
var Registry = function(_super) {
|
|
1468
|
+
__extends(Registry2, _super);
|
|
1469
|
+
function Registry2() {
|
|
1470
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1471
|
+
}
|
|
1472
|
+
return Registry2;
|
|
1473
|
+
}(registry_base_default);
|
|
1474
|
+
var registry_default = Registry;
|
|
1475
|
+
|
|
1476
|
+
// ../../node_modules/.pnpm/tsyringe@4.8.0/node_modules/tsyringe/dist/esm5/resolution-context.js
|
|
1477
|
+
var ResolutionContext = /* @__PURE__ */ function() {
|
|
1478
|
+
function ResolutionContext2() {
|
|
1479
|
+
this.scopedResolutions = /* @__PURE__ */ new Map();
|
|
1480
|
+
}
|
|
1481
|
+
return ResolutionContext2;
|
|
1482
|
+
}();
|
|
1483
|
+
var resolution_context_default = ResolutionContext;
|
|
1484
|
+
|
|
1485
|
+
// ../../node_modules/.pnpm/tsyringe@4.8.0/node_modules/tsyringe/dist/esm5/error-helpers.js
|
|
1486
|
+
function formatDependency(params, idx) {
|
|
1487
|
+
if (params === null) {
|
|
1488
|
+
return "at position #" + idx;
|
|
1489
|
+
}
|
|
1490
|
+
var argName = params.split(",")[idx].trim();
|
|
1491
|
+
return '"' + argName + '" at position #' + idx;
|
|
1492
|
+
}
|
|
1493
|
+
function composeErrorMessage(msg, e, indent) {
|
|
1494
|
+
if (indent === void 0) {
|
|
1495
|
+
indent = " ";
|
|
1496
|
+
}
|
|
1497
|
+
return __spread([msg], e.message.split("\n").map(function(l) {
|
|
1498
|
+
return indent + l;
|
|
1499
|
+
})).join("\n");
|
|
1500
|
+
}
|
|
1501
|
+
function formatErrorCtor(ctor, paramIdx, error) {
|
|
1502
|
+
var _a = __read(ctor.toString().match(/constructor\(([\w, ]+)\)/) || [], 2), _b = _a[1], params = _b === void 0 ? null : _b;
|
|
1503
|
+
var dep = formatDependency(params, paramIdx);
|
|
1504
|
+
return composeErrorMessage("Cannot inject the dependency " + dep + ' of "' + ctor.name + '" constructor. Reason:', error);
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
// ../../node_modules/.pnpm/tsyringe@4.8.0/node_modules/tsyringe/dist/esm5/types/disposable.js
|
|
1508
|
+
function isDisposable(value) {
|
|
1509
|
+
if (typeof value.dispose !== "function")
|
|
1510
|
+
return false;
|
|
1511
|
+
var disposeFun = value.dispose;
|
|
1512
|
+
if (disposeFun.length > 0) {
|
|
1513
|
+
return false;
|
|
1514
|
+
}
|
|
1515
|
+
return true;
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
// ../../node_modules/.pnpm/tsyringe@4.8.0/node_modules/tsyringe/dist/esm5/interceptors.js
|
|
1519
|
+
var PreResolutionInterceptors = function(_super) {
|
|
1520
|
+
__extends(PreResolutionInterceptors2, _super);
|
|
1521
|
+
function PreResolutionInterceptors2() {
|
|
1522
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1523
|
+
}
|
|
1524
|
+
return PreResolutionInterceptors2;
|
|
1525
|
+
}(registry_base_default);
|
|
1526
|
+
var PostResolutionInterceptors = function(_super) {
|
|
1527
|
+
__extends(PostResolutionInterceptors2, _super);
|
|
1528
|
+
function PostResolutionInterceptors2() {
|
|
1529
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1530
|
+
}
|
|
1531
|
+
return PostResolutionInterceptors2;
|
|
1532
|
+
}(registry_base_default);
|
|
1533
|
+
var Interceptors = /* @__PURE__ */ function() {
|
|
1534
|
+
function Interceptors2() {
|
|
1535
|
+
this.preResolution = new PreResolutionInterceptors();
|
|
1536
|
+
this.postResolution = new PostResolutionInterceptors();
|
|
1537
|
+
}
|
|
1538
|
+
return Interceptors2;
|
|
1539
|
+
}();
|
|
1540
|
+
var interceptors_default = Interceptors;
|
|
1541
|
+
|
|
1542
|
+
// ../../node_modules/.pnpm/tsyringe@4.8.0/node_modules/tsyringe/dist/esm5/dependency-container.js
|
|
1543
|
+
var typeInfo = /* @__PURE__ */ new Map();
|
|
1544
|
+
var InternalDependencyContainer = function() {
|
|
1545
|
+
function InternalDependencyContainer2(parent) {
|
|
1546
|
+
this.parent = parent;
|
|
1547
|
+
this._registry = new registry_default();
|
|
1548
|
+
this.interceptors = new interceptors_default();
|
|
1549
|
+
this.disposed = false;
|
|
1550
|
+
this.disposables = /* @__PURE__ */ new Set();
|
|
1551
|
+
}
|
|
1552
|
+
InternalDependencyContainer2.prototype.register = function(token, providerOrConstructor, options) {
|
|
1553
|
+
if (options === void 0) {
|
|
1554
|
+
options = { lifecycle: lifecycle_default.Transient };
|
|
1555
|
+
}
|
|
1556
|
+
this.ensureNotDisposed();
|
|
1557
|
+
var provider;
|
|
1558
|
+
if (!isProvider(providerOrConstructor)) {
|
|
1559
|
+
provider = { useClass: providerOrConstructor };
|
|
1560
|
+
} else {
|
|
1561
|
+
provider = providerOrConstructor;
|
|
1562
|
+
}
|
|
1563
|
+
if (isTokenProvider(provider)) {
|
|
1564
|
+
var path = [token];
|
|
1565
|
+
var tokenProvider = provider;
|
|
1566
|
+
while (tokenProvider != null) {
|
|
1567
|
+
var currentToken = tokenProvider.useToken;
|
|
1568
|
+
if (path.includes(currentToken)) {
|
|
1569
|
+
throw new Error("Token registration cycle detected! " + __spread(path, [currentToken]).join(" -> "));
|
|
1570
|
+
}
|
|
1571
|
+
path.push(currentToken);
|
|
1572
|
+
var registration = this._registry.get(currentToken);
|
|
1573
|
+
if (registration && isTokenProvider(registration.provider)) {
|
|
1574
|
+
tokenProvider = registration.provider;
|
|
1575
|
+
} else {
|
|
1576
|
+
tokenProvider = null;
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
if (options.lifecycle === lifecycle_default.Singleton || options.lifecycle == lifecycle_default.ContainerScoped || options.lifecycle == lifecycle_default.ResolutionScoped) {
|
|
1581
|
+
if (isValueProvider(provider) || isFactoryProvider(provider)) {
|
|
1582
|
+
throw new Error('Cannot use lifecycle "' + lifecycle_default[options.lifecycle] + '" with ValueProviders or FactoryProviders');
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
this._registry.set(token, { provider, options });
|
|
1586
|
+
return this;
|
|
1587
|
+
};
|
|
1588
|
+
InternalDependencyContainer2.prototype.registerType = function(from, to) {
|
|
1589
|
+
this.ensureNotDisposed();
|
|
1590
|
+
if (isNormalToken(to)) {
|
|
1591
|
+
return this.register(from, {
|
|
1592
|
+
useToken: to
|
|
1593
|
+
});
|
|
1594
|
+
}
|
|
1595
|
+
return this.register(from, {
|
|
1596
|
+
useClass: to
|
|
1597
|
+
});
|
|
1598
|
+
};
|
|
1599
|
+
InternalDependencyContainer2.prototype.registerInstance = function(token, instance2) {
|
|
1600
|
+
this.ensureNotDisposed();
|
|
1601
|
+
return this.register(token, {
|
|
1602
|
+
useValue: instance2
|
|
1603
|
+
});
|
|
1604
|
+
};
|
|
1605
|
+
InternalDependencyContainer2.prototype.registerSingleton = function(from, to) {
|
|
1606
|
+
this.ensureNotDisposed();
|
|
1607
|
+
if (isNormalToken(from)) {
|
|
1608
|
+
if (isNormalToken(to)) {
|
|
1609
|
+
return this.register(from, {
|
|
1610
|
+
useToken: to
|
|
1611
|
+
}, { lifecycle: lifecycle_default.Singleton });
|
|
1612
|
+
} else if (to) {
|
|
1613
|
+
return this.register(from, {
|
|
1614
|
+
useClass: to
|
|
1615
|
+
}, { lifecycle: lifecycle_default.Singleton });
|
|
1616
|
+
}
|
|
1617
|
+
throw new Error('Cannot register a type name as a singleton without a "to" token');
|
|
1618
|
+
}
|
|
1619
|
+
var useClass = from;
|
|
1620
|
+
if (to && !isNormalToken(to)) {
|
|
1621
|
+
useClass = to;
|
|
1622
|
+
}
|
|
1623
|
+
return this.register(from, {
|
|
1624
|
+
useClass
|
|
1625
|
+
}, { lifecycle: lifecycle_default.Singleton });
|
|
1626
|
+
};
|
|
1627
|
+
InternalDependencyContainer2.prototype.resolve = function(token, context) {
|
|
1628
|
+
if (context === void 0) {
|
|
1629
|
+
context = new resolution_context_default();
|
|
1630
|
+
}
|
|
1631
|
+
this.ensureNotDisposed();
|
|
1632
|
+
var registration = this.getRegistration(token);
|
|
1633
|
+
if (!registration && isNormalToken(token)) {
|
|
1634
|
+
throw new Error('Attempted to resolve unregistered dependency token: "' + token.toString() + '"');
|
|
1635
|
+
}
|
|
1636
|
+
this.executePreResolutionInterceptor(token, "Single");
|
|
1637
|
+
if (registration) {
|
|
1638
|
+
var result = this.resolveRegistration(registration, context);
|
|
1639
|
+
this.executePostResolutionInterceptor(token, result, "Single");
|
|
1640
|
+
return result;
|
|
1641
|
+
}
|
|
1642
|
+
if (isConstructorToken(token)) {
|
|
1643
|
+
var result = this.construct(token, context);
|
|
1644
|
+
this.executePostResolutionInterceptor(token, result, "Single");
|
|
1645
|
+
return result;
|
|
1646
|
+
}
|
|
1647
|
+
throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.");
|
|
1648
|
+
};
|
|
1649
|
+
InternalDependencyContainer2.prototype.executePreResolutionInterceptor = function(token, resolutionType) {
|
|
1650
|
+
var e_1, _a;
|
|
1651
|
+
if (this.interceptors.preResolution.has(token)) {
|
|
1652
|
+
var remainingInterceptors = [];
|
|
1653
|
+
try {
|
|
1654
|
+
for (var _b = __values(this.interceptors.preResolution.getAll(token)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1655
|
+
var interceptor = _c.value;
|
|
1656
|
+
if (interceptor.options.frequency != "Once") {
|
|
1657
|
+
remainingInterceptors.push(interceptor);
|
|
1658
|
+
}
|
|
1659
|
+
interceptor.callback(token, resolutionType);
|
|
1660
|
+
}
|
|
1661
|
+
} catch (e_1_1) {
|
|
1662
|
+
e_1 = { error: e_1_1 };
|
|
1663
|
+
} finally {
|
|
1664
|
+
try {
|
|
1665
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1666
|
+
} finally {
|
|
1667
|
+
if (e_1) throw e_1.error;
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
this.interceptors.preResolution.setAll(token, remainingInterceptors);
|
|
1671
|
+
}
|
|
1672
|
+
};
|
|
1673
|
+
InternalDependencyContainer2.prototype.executePostResolutionInterceptor = function(token, result, resolutionType) {
|
|
1674
|
+
var e_2, _a;
|
|
1675
|
+
if (this.interceptors.postResolution.has(token)) {
|
|
1676
|
+
var remainingInterceptors = [];
|
|
1677
|
+
try {
|
|
1678
|
+
for (var _b = __values(this.interceptors.postResolution.getAll(token)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1679
|
+
var interceptor = _c.value;
|
|
1680
|
+
if (interceptor.options.frequency != "Once") {
|
|
1681
|
+
remainingInterceptors.push(interceptor);
|
|
1682
|
+
}
|
|
1683
|
+
interceptor.callback(token, result, resolutionType);
|
|
1684
|
+
}
|
|
1685
|
+
} catch (e_2_1) {
|
|
1686
|
+
e_2 = { error: e_2_1 };
|
|
1687
|
+
} finally {
|
|
1688
|
+
try {
|
|
1689
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1690
|
+
} finally {
|
|
1691
|
+
if (e_2) throw e_2.error;
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
this.interceptors.postResolution.setAll(token, remainingInterceptors);
|
|
1695
|
+
}
|
|
1696
|
+
};
|
|
1697
|
+
InternalDependencyContainer2.prototype.resolveRegistration = function(registration, context) {
|
|
1698
|
+
this.ensureNotDisposed();
|
|
1699
|
+
if (registration.options.lifecycle === lifecycle_default.ResolutionScoped && context.scopedResolutions.has(registration)) {
|
|
1700
|
+
return context.scopedResolutions.get(registration);
|
|
1701
|
+
}
|
|
1702
|
+
var isSingleton = registration.options.lifecycle === lifecycle_default.Singleton;
|
|
1703
|
+
var isContainerScoped = registration.options.lifecycle === lifecycle_default.ContainerScoped;
|
|
1704
|
+
var returnInstance = isSingleton || isContainerScoped;
|
|
1705
|
+
var resolved;
|
|
1706
|
+
if (isValueProvider(registration.provider)) {
|
|
1707
|
+
resolved = registration.provider.useValue;
|
|
1708
|
+
} else if (isTokenProvider(registration.provider)) {
|
|
1709
|
+
resolved = returnInstance ? registration.instance || (registration.instance = this.resolve(registration.provider.useToken, context)) : this.resolve(registration.provider.useToken, context);
|
|
1710
|
+
} else if (isClassProvider(registration.provider)) {
|
|
1711
|
+
resolved = returnInstance ? registration.instance || (registration.instance = this.construct(registration.provider.useClass, context)) : this.construct(registration.provider.useClass, context);
|
|
1712
|
+
} else if (isFactoryProvider(registration.provider)) {
|
|
1713
|
+
resolved = registration.provider.useFactory(this);
|
|
1714
|
+
} else {
|
|
1715
|
+
resolved = this.construct(registration.provider, context);
|
|
1716
|
+
}
|
|
1717
|
+
if (registration.options.lifecycle === lifecycle_default.ResolutionScoped) {
|
|
1718
|
+
context.scopedResolutions.set(registration, resolved);
|
|
1719
|
+
}
|
|
1720
|
+
return resolved;
|
|
1721
|
+
};
|
|
1722
|
+
InternalDependencyContainer2.prototype.resolveAll = function(token, context) {
|
|
1723
|
+
var _this = this;
|
|
1724
|
+
if (context === void 0) {
|
|
1725
|
+
context = new resolution_context_default();
|
|
1726
|
+
}
|
|
1727
|
+
this.ensureNotDisposed();
|
|
1728
|
+
var registrations = this.getAllRegistrations(token);
|
|
1729
|
+
if (!registrations && isNormalToken(token)) {
|
|
1730
|
+
throw new Error('Attempted to resolve unregistered dependency token: "' + token.toString() + '"');
|
|
1731
|
+
}
|
|
1732
|
+
this.executePreResolutionInterceptor(token, "All");
|
|
1733
|
+
if (registrations) {
|
|
1734
|
+
var result_1 = registrations.map(function(item) {
|
|
1735
|
+
return _this.resolveRegistration(item, context);
|
|
1736
|
+
});
|
|
1737
|
+
this.executePostResolutionInterceptor(token, result_1, "All");
|
|
1738
|
+
return result_1;
|
|
1739
|
+
}
|
|
1740
|
+
var result = [this.construct(token, context)];
|
|
1741
|
+
this.executePostResolutionInterceptor(token, result, "All");
|
|
1742
|
+
return result;
|
|
1743
|
+
};
|
|
1744
|
+
InternalDependencyContainer2.prototype.isRegistered = function(token, recursive) {
|
|
1745
|
+
if (recursive === void 0) {
|
|
1746
|
+
recursive = false;
|
|
1747
|
+
}
|
|
1748
|
+
this.ensureNotDisposed();
|
|
1749
|
+
return this._registry.has(token) || recursive && (this.parent || false) && this.parent.isRegistered(token, true);
|
|
1750
|
+
};
|
|
1751
|
+
InternalDependencyContainer2.prototype.reset = function() {
|
|
1752
|
+
this.ensureNotDisposed();
|
|
1753
|
+
this._registry.clear();
|
|
1754
|
+
this.interceptors.preResolution.clear();
|
|
1755
|
+
this.interceptors.postResolution.clear();
|
|
1756
|
+
};
|
|
1757
|
+
InternalDependencyContainer2.prototype.clearInstances = function() {
|
|
1758
|
+
var e_3, _a;
|
|
1759
|
+
this.ensureNotDisposed();
|
|
1760
|
+
try {
|
|
1761
|
+
for (var _b = __values(this._registry.entries()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1762
|
+
var _d = __read(_c.value, 2), token = _d[0], registrations = _d[1];
|
|
1763
|
+
this._registry.setAll(token, registrations.filter(function(registration) {
|
|
1764
|
+
return !isValueProvider(registration.provider);
|
|
1765
|
+
}).map(function(registration) {
|
|
1766
|
+
registration.instance = void 0;
|
|
1767
|
+
return registration;
|
|
1768
|
+
}));
|
|
1769
|
+
}
|
|
1770
|
+
} catch (e_3_1) {
|
|
1771
|
+
e_3 = { error: e_3_1 };
|
|
1772
|
+
} finally {
|
|
1773
|
+
try {
|
|
1774
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1775
|
+
} finally {
|
|
1776
|
+
if (e_3) throw e_3.error;
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
};
|
|
1780
|
+
InternalDependencyContainer2.prototype.createChildContainer = function() {
|
|
1781
|
+
var e_4, _a;
|
|
1782
|
+
this.ensureNotDisposed();
|
|
1783
|
+
var childContainer = new InternalDependencyContainer2(this);
|
|
1784
|
+
try {
|
|
1785
|
+
for (var _b = __values(this._registry.entries()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1786
|
+
var _d = __read(_c.value, 2), token = _d[0], registrations = _d[1];
|
|
1787
|
+
if (registrations.some(function(_a2) {
|
|
1788
|
+
var options = _a2.options;
|
|
1789
|
+
return options.lifecycle === lifecycle_default.ContainerScoped;
|
|
1790
|
+
})) {
|
|
1791
|
+
childContainer._registry.setAll(token, registrations.map(function(registration) {
|
|
1792
|
+
if (registration.options.lifecycle === lifecycle_default.ContainerScoped) {
|
|
1793
|
+
return {
|
|
1794
|
+
provider: registration.provider,
|
|
1795
|
+
options: registration.options
|
|
1796
|
+
};
|
|
1797
|
+
}
|
|
1798
|
+
return registration;
|
|
1799
|
+
}));
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
} catch (e_4_1) {
|
|
1803
|
+
e_4 = { error: e_4_1 };
|
|
1804
|
+
} finally {
|
|
1805
|
+
try {
|
|
1806
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1807
|
+
} finally {
|
|
1808
|
+
if (e_4) throw e_4.error;
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
return childContainer;
|
|
1812
|
+
};
|
|
1813
|
+
InternalDependencyContainer2.prototype.beforeResolution = function(token, callback, options) {
|
|
1814
|
+
if (options === void 0) {
|
|
1815
|
+
options = { frequency: "Always" };
|
|
1816
|
+
}
|
|
1817
|
+
this.interceptors.preResolution.set(token, {
|
|
1818
|
+
callback,
|
|
1819
|
+
options
|
|
1820
|
+
});
|
|
1821
|
+
};
|
|
1822
|
+
InternalDependencyContainer2.prototype.afterResolution = function(token, callback, options) {
|
|
1823
|
+
if (options === void 0) {
|
|
1824
|
+
options = { frequency: "Always" };
|
|
1825
|
+
}
|
|
1826
|
+
this.interceptors.postResolution.set(token, {
|
|
1827
|
+
callback,
|
|
1828
|
+
options
|
|
1829
|
+
});
|
|
1830
|
+
};
|
|
1831
|
+
InternalDependencyContainer2.prototype.dispose = function() {
|
|
1832
|
+
return __awaiter(this, void 0, void 0, function() {
|
|
1833
|
+
var promises;
|
|
1834
|
+
return __generator(this, function(_a) {
|
|
1835
|
+
switch (_a.label) {
|
|
1836
|
+
case 0:
|
|
1837
|
+
this.disposed = true;
|
|
1838
|
+
promises = [];
|
|
1839
|
+
this.disposables.forEach(function(disposable) {
|
|
1840
|
+
var maybePromise = disposable.dispose();
|
|
1841
|
+
if (maybePromise) {
|
|
1842
|
+
promises.push(maybePromise);
|
|
1843
|
+
}
|
|
1844
|
+
});
|
|
1845
|
+
return [4, Promise.all(promises)];
|
|
1846
|
+
case 1:
|
|
1847
|
+
_a.sent();
|
|
1848
|
+
return [2];
|
|
1849
|
+
}
|
|
1850
|
+
});
|
|
1851
|
+
});
|
|
1852
|
+
};
|
|
1853
|
+
InternalDependencyContainer2.prototype.getRegistration = function(token) {
|
|
1854
|
+
if (this.isRegistered(token)) {
|
|
1855
|
+
return this._registry.get(token);
|
|
1856
|
+
}
|
|
1857
|
+
if (this.parent) {
|
|
1858
|
+
return this.parent.getRegistration(token);
|
|
1859
|
+
}
|
|
1860
|
+
return null;
|
|
1861
|
+
};
|
|
1862
|
+
InternalDependencyContainer2.prototype.getAllRegistrations = function(token) {
|
|
1863
|
+
if (this.isRegistered(token)) {
|
|
1864
|
+
return this._registry.getAll(token);
|
|
1865
|
+
}
|
|
1866
|
+
if (this.parent) {
|
|
1867
|
+
return this.parent.getAllRegistrations(token);
|
|
1868
|
+
}
|
|
1869
|
+
return null;
|
|
1870
|
+
};
|
|
1871
|
+
InternalDependencyContainer2.prototype.construct = function(ctor, context) {
|
|
1872
|
+
var _this = this;
|
|
1873
|
+
if (ctor instanceof DelayedConstructor) {
|
|
1874
|
+
return ctor.createProxy(function(target) {
|
|
1875
|
+
return _this.resolve(target, context);
|
|
1876
|
+
});
|
|
1877
|
+
}
|
|
1878
|
+
var instance2 = function() {
|
|
1879
|
+
var paramInfo = typeInfo.get(ctor);
|
|
1880
|
+
if (!paramInfo || paramInfo.length === 0) {
|
|
1881
|
+
if (ctor.length === 0) {
|
|
1882
|
+
return new ctor();
|
|
1883
|
+
} else {
|
|
1884
|
+
throw new Error('TypeInfo not known for "' + ctor.name + '"');
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
var params = paramInfo.map(_this.resolveParams(context, ctor));
|
|
1888
|
+
return new (ctor.bind.apply(ctor, __spread([void 0], params)))();
|
|
1889
|
+
}();
|
|
1890
|
+
if (isDisposable(instance2)) {
|
|
1891
|
+
this.disposables.add(instance2);
|
|
1892
|
+
}
|
|
1893
|
+
return instance2;
|
|
1894
|
+
};
|
|
1895
|
+
InternalDependencyContainer2.prototype.resolveParams = function(context, ctor) {
|
|
1896
|
+
var _this = this;
|
|
1897
|
+
return function(param, idx) {
|
|
1898
|
+
var _a, _b, _c;
|
|
1899
|
+
try {
|
|
1900
|
+
if (isTokenDescriptor(param)) {
|
|
1901
|
+
if (isTransformDescriptor(param)) {
|
|
1902
|
+
return param.multiple ? (_a = _this.resolve(param.transform)).transform.apply(_a, __spread([_this.resolveAll(param.token)], param.transformArgs)) : (_b = _this.resolve(param.transform)).transform.apply(_b, __spread([_this.resolve(param.token, context)], param.transformArgs));
|
|
1903
|
+
} else {
|
|
1904
|
+
return param.multiple ? _this.resolveAll(param.token) : _this.resolve(param.token, context);
|
|
1905
|
+
}
|
|
1906
|
+
} else if (isTransformDescriptor(param)) {
|
|
1907
|
+
return (_c = _this.resolve(param.transform, context)).transform.apply(_c, __spread([_this.resolve(param.token, context)], param.transformArgs));
|
|
1908
|
+
}
|
|
1909
|
+
return _this.resolve(param, context);
|
|
1910
|
+
} catch (e) {
|
|
1911
|
+
throw new Error(formatErrorCtor(ctor, idx, e));
|
|
1912
|
+
}
|
|
1913
|
+
};
|
|
1914
|
+
};
|
|
1915
|
+
InternalDependencyContainer2.prototype.ensureNotDisposed = function() {
|
|
1916
|
+
if (this.disposed) {
|
|
1917
|
+
throw new Error("This container has been disposed, you cannot interact with a disposed container");
|
|
1918
|
+
}
|
|
1919
|
+
};
|
|
1920
|
+
return InternalDependencyContainer2;
|
|
1921
|
+
}();
|
|
1922
|
+
var instance = new InternalDependencyContainer();
|
|
1923
|
+
|
|
1924
|
+
// ../../node_modules/.pnpm/tsyringe@4.8.0/node_modules/tsyringe/dist/esm5/decorators/inject.js
|
|
1925
|
+
function inject(token) {
|
|
1926
|
+
return defineInjectionTokenMetadata(token);
|
|
1927
|
+
}
|
|
1928
|
+
var inject_default = inject;
|
|
1929
|
+
|
|
1930
|
+
// ../../node_modules/.pnpm/tsyringe@4.8.0/node_modules/tsyringe/dist/esm5/decorators/injectable.js
|
|
1931
|
+
function injectable() {
|
|
1932
|
+
return function(target) {
|
|
1933
|
+
typeInfo.set(target, getParamInfo(target));
|
|
1934
|
+
};
|
|
1935
|
+
}
|
|
1936
|
+
var injectable_default = injectable;
|
|
1937
|
+
|
|
1938
|
+
// ../../node_modules/.pnpm/tsyringe@4.8.0/node_modules/tsyringe/dist/esm5/decorators/singleton.js
|
|
1939
|
+
function singleton() {
|
|
1940
|
+
return function(target) {
|
|
1941
|
+
injectable_default()(target);
|
|
1942
|
+
instance.registerSingleton(target);
|
|
1943
|
+
};
|
|
1944
|
+
}
|
|
1945
|
+
var singleton_default = singleton;
|
|
1946
|
+
|
|
1947
|
+
// ../../node_modules/.pnpm/tsyringe@4.8.0/node_modules/tsyringe/dist/esm5/decorators/scoped.js
|
|
1948
|
+
function scoped(lifecycle, token) {
|
|
1949
|
+
return function(target) {
|
|
1950
|
+
injectable_default()(target);
|
|
1951
|
+
instance.register(token || target, target, {
|
|
1952
|
+
lifecycle
|
|
1953
|
+
});
|
|
1954
|
+
};
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
// ../../node_modules/.pnpm/tsyringe@4.8.0/node_modules/tsyringe/dist/esm5/index.js
|
|
1958
|
+
if (typeof Reflect === "undefined" || !Reflect.getMetadata) {
|
|
1959
|
+
throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
// src/core/app/app.controller.ts
|
|
1963
|
+
var import_rxjs = require("rxjs");
|
|
1964
|
+
|
|
1965
|
+
// src/core/app/app.component.ts
|
|
1966
|
+
var import_utils = require("@quick-threejs/utils");
|
|
1967
|
+
var AppComponent = class {
|
|
1968
|
+
proxyReceiver = new import_utils.ProxyReceiver();
|
|
1969
|
+
initialized = false;
|
|
1970
|
+
canvas;
|
|
1971
|
+
};
|
|
1972
|
+
AppComponent = __decorateClass([
|
|
1973
|
+
singleton_default()
|
|
1974
|
+
], AppComponent);
|
|
1975
|
+
|
|
1976
|
+
// src/common/models/proxy-event-subjects.models.ts
|
|
1977
|
+
var ProxyEventSubjectsModel = class {
|
|
1978
|
+
contextmenu$$;
|
|
1979
|
+
resize$$;
|
|
1980
|
+
mousedown$$;
|
|
1981
|
+
mousemove$$;
|
|
1982
|
+
mouseup$$;
|
|
1983
|
+
pointerdown$$;
|
|
1984
|
+
pointermove$$;
|
|
1985
|
+
pointercancel$$;
|
|
1986
|
+
pointerup$$;
|
|
1987
|
+
touchstart$$;
|
|
1988
|
+
touchmove$$;
|
|
1989
|
+
touchend$$;
|
|
1990
|
+
wheel$$;
|
|
1991
|
+
keydown$$;
|
|
1992
|
+
};
|
|
1993
|
+
|
|
1994
|
+
// src/common/models/proxy-event-observables.model.ts
|
|
1995
|
+
var ProxyEventObservablesModel = class extends ProxyEventSubjectsModel {
|
|
1996
|
+
contextmenu$;
|
|
1997
|
+
resize$;
|
|
1998
|
+
mousedown$;
|
|
1999
|
+
mousemove$;
|
|
2000
|
+
mouseup$;
|
|
2001
|
+
pointerdown$;
|
|
2002
|
+
pointermove$;
|
|
2003
|
+
pointercancel$;
|
|
2004
|
+
pointerup$;
|
|
2005
|
+
touchstart$;
|
|
2006
|
+
touchmove$;
|
|
2007
|
+
touchend$;
|
|
2008
|
+
wheel$;
|
|
2009
|
+
keydown$;
|
|
2010
|
+
};
|
|
2011
|
+
|
|
2012
|
+
// src/common/models/proxy-event-handler.model.ts
|
|
2013
|
+
var ProxyEventHandlersModel = class extends ProxyEventObservablesModel {
|
|
2014
|
+
contextmenu;
|
|
2015
|
+
resize;
|
|
2016
|
+
mousedown;
|
|
2017
|
+
mousemove;
|
|
2018
|
+
mouseup;
|
|
2019
|
+
pointerdown;
|
|
2020
|
+
pointermove;
|
|
2021
|
+
pointercancel;
|
|
2022
|
+
pointerup;
|
|
2023
|
+
touchstart;
|
|
2024
|
+
touchmove;
|
|
2025
|
+
touchend;
|
|
2026
|
+
wheel;
|
|
2027
|
+
keydown;
|
|
2028
|
+
};
|
|
2029
|
+
|
|
2030
|
+
// src/common/constants/event.constants.ts
|
|
2031
|
+
var KEYBOARD_EVENT_CODES = [
|
|
2032
|
+
"ArrowUp",
|
|
2033
|
+
"ArrowDown",
|
|
2034
|
+
"ArrowLeft",
|
|
2035
|
+
"ArrowRight"
|
|
2036
|
+
];
|
|
2037
|
+
var PROXY_EVENT_LISTENERS = [
|
|
2038
|
+
"contextmenu",
|
|
2039
|
+
"resize",
|
|
2040
|
+
"mousedown",
|
|
2041
|
+
"mousemove",
|
|
2042
|
+
"mouseup",
|
|
2043
|
+
"pointerdown",
|
|
2044
|
+
"pointermove",
|
|
2045
|
+
"pointercancel",
|
|
2046
|
+
"pointerup",
|
|
2047
|
+
"touchstart",
|
|
2048
|
+
"touchmove",
|
|
2049
|
+
"touchend",
|
|
2050
|
+
"wheel",
|
|
2051
|
+
"keydown"
|
|
2052
|
+
];
|
|
2053
|
+
|
|
2054
|
+
// src/core/app/app.controller.ts
|
|
2055
|
+
var AppController = class extends ProxyEventHandlersModel {
|
|
2056
|
+
constructor(component) {
|
|
2057
|
+
super();
|
|
2058
|
+
this.component = component;
|
|
2059
|
+
for (const eventType of PROXY_EVENT_LISTENERS) {
|
|
2060
|
+
this[`${eventType}$$`] = new import_rxjs.Subject();
|
|
2061
|
+
this[`${eventType}$`] = this[`${eventType}$$`].pipe();
|
|
2062
|
+
this[eventType] = (event) => {
|
|
2063
|
+
this.component.proxyReceiver.handleEvent({
|
|
2064
|
+
...event,
|
|
2065
|
+
type: event.type || eventType
|
|
2066
|
+
});
|
|
2067
|
+
this[`${eventType}$$`].next(event);
|
|
2068
|
+
};
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
lifecycle$$ = new import_rxjs.Subject();
|
|
2072
|
+
lifecycle$ = this.lifecycle$$.pipe();
|
|
2073
|
+
};
|
|
2074
|
+
AppController = __decorateClass([
|
|
2075
|
+
singleton_default(),
|
|
2076
|
+
__decorateParam(0, inject_default(AppComponent))
|
|
2077
|
+
], AppController);
|
|
2078
|
+
|
|
2079
|
+
// src/core/app/timer/timer.component.ts
|
|
2080
|
+
var import_three = require("three");
|
|
2081
|
+
var TimerComponent = class {
|
|
2082
|
+
clock = new import_three.Clock();
|
|
2083
|
+
frame = 1e3 / 60;
|
|
2084
|
+
delta = 0;
|
|
2085
|
+
deltaRatio = 0;
|
|
2086
|
+
enabled = false;
|
|
2087
|
+
};
|
|
2088
|
+
TimerComponent = __decorateClass([
|
|
2089
|
+
singleton_default()
|
|
2090
|
+
], TimerComponent);
|
|
2091
|
+
|
|
2092
|
+
// src/core/app/renderer/renderer.component.ts
|
|
2093
|
+
var import_three5 = require("three");
|
|
2094
|
+
|
|
2095
|
+
// src/core/app/world/world.component.ts
|
|
2096
|
+
var import_three2 = require("three");
|
|
2097
|
+
var WorldComponent = class {
|
|
2098
|
+
scene = new import_three2.Scene();
|
|
2099
|
+
enabled = true;
|
|
2100
|
+
};
|
|
2101
|
+
WorldComponent = __decorateClass([
|
|
2102
|
+
singleton_default()
|
|
2103
|
+
], WorldComponent);
|
|
2104
|
+
|
|
2105
|
+
// src/core/app/camera/camera.component.ts
|
|
2106
|
+
var import_three3 = require("three");
|
|
2107
|
+
|
|
2108
|
+
// src/core/app/sizes/sizes.component.ts
|
|
2109
|
+
var SizesComponent = class {
|
|
2110
|
+
width = 0;
|
|
2111
|
+
height = 0;
|
|
2112
|
+
aspect = 0;
|
|
2113
|
+
pixelRatio = 0;
|
|
2114
|
+
frustrum = 5;
|
|
2115
|
+
enabled = true;
|
|
2116
|
+
init(canvas, enabled) {
|
|
2117
|
+
this.height = Number(canvas.height ?? this.height);
|
|
2118
|
+
this.width = Number(canvas.width ?? this.width);
|
|
2119
|
+
this.aspect = this.width / this.height;
|
|
2120
|
+
this.enabled = enabled === void 0 ? true : !!enabled;
|
|
2121
|
+
}
|
|
2122
|
+
};
|
|
2123
|
+
SizesComponent = __decorateClass([
|
|
2124
|
+
singleton_default()
|
|
2125
|
+
], SizesComponent);
|
|
2126
|
+
|
|
2127
|
+
// src/common/enums/camera.enum.ts
|
|
2128
|
+
var DefaultCameraType = /* @__PURE__ */ ((DefaultCameraType2) => {
|
|
2129
|
+
DefaultCameraType2[DefaultCameraType2["PERSPECTIVE"] = 0] = "PERSPECTIVE";
|
|
2130
|
+
DefaultCameraType2[DefaultCameraType2["ORTHOGRAPHIC"] = 1] = "ORTHOGRAPHIC";
|
|
2131
|
+
return DefaultCameraType2;
|
|
2132
|
+
})(DefaultCameraType || {});
|
|
2133
|
+
|
|
2134
|
+
// src/core/app/camera/camera.component.ts
|
|
2135
|
+
var CameraComponent = class {
|
|
2136
|
+
constructor(sizesComponent) {
|
|
2137
|
+
this.sizesComponent = sizesComponent;
|
|
2138
|
+
}
|
|
2139
|
+
instance;
|
|
2140
|
+
miniCamera;
|
|
2141
|
+
enabled = true;
|
|
2142
|
+
set aspectRatio(ratio) {
|
|
2143
|
+
if (this.instance instanceof import_three3.PerspectiveCamera)
|
|
2144
|
+
this.instance.aspect = ratio;
|
|
2145
|
+
if (this.instance instanceof import_three3.PerspectiveCamera || this.instance instanceof import_three3.OrthographicCamera)
|
|
2146
|
+
this.instance?.updateProjectionMatrix();
|
|
2147
|
+
}
|
|
2148
|
+
set quaternion(quaternion) {
|
|
2149
|
+
this.instance?.quaternion.copy(quaternion);
|
|
2150
|
+
}
|
|
2151
|
+
set position(position) {
|
|
2152
|
+
this.instance?.position.copy(position);
|
|
2153
|
+
}
|
|
2154
|
+
set rotation(rotation) {
|
|
2155
|
+
this.instance?.rotation.copy(rotation);
|
|
2156
|
+
}
|
|
2157
|
+
initDefaultCamera(cameraType) {
|
|
2158
|
+
this.removeCamera();
|
|
2159
|
+
if (cameraType === 0 /* PERSPECTIVE */ || cameraType === void 0) {
|
|
2160
|
+
this.instance = new import_three3.PerspectiveCamera(
|
|
2161
|
+
70,
|
|
2162
|
+
this.sizesComponent.width / this.sizesComponent.height,
|
|
2163
|
+
1e-4,
|
|
2164
|
+
100
|
|
2165
|
+
);
|
|
2166
|
+
this.instance.position.z = 8;
|
|
2167
|
+
return;
|
|
2168
|
+
}
|
|
2169
|
+
if (cameraType === 1 /* ORTHOGRAPHIC */) {
|
|
2170
|
+
this.instance = new import_three3.OrthographicCamera(
|
|
2171
|
+
-this.sizesComponent.aspect * this.sizesComponent.frustrum / 2,
|
|
2172
|
+
this.sizesComponent.aspect * this.sizesComponent.frustrum / 2,
|
|
2173
|
+
this.sizesComponent.frustrum / 2,
|
|
2174
|
+
-this.sizesComponent.frustrum / 2,
|
|
2175
|
+
-50,
|
|
2176
|
+
50
|
|
2177
|
+
);
|
|
2178
|
+
}
|
|
2179
|
+
}
|
|
2180
|
+
setMiniCamera() {
|
|
2181
|
+
this.removeMiniCamera();
|
|
2182
|
+
this.miniCamera = new import_three3.PerspectiveCamera(
|
|
2183
|
+
75,
|
|
2184
|
+
this.sizesComponent.width / this.sizesComponent.height,
|
|
2185
|
+
0.1,
|
|
2186
|
+
500
|
|
2187
|
+
);
|
|
2188
|
+
this.miniCamera.position.z = 10;
|
|
2189
|
+
this.miniCamera.position.x = -5;
|
|
2190
|
+
}
|
|
2191
|
+
removeCamera() {
|
|
2192
|
+
if (!(this.instance instanceof import_three3.Camera)) return;
|
|
2193
|
+
if (this.instance instanceof import_three3.PerspectiveCamera || this.instance instanceof import_three3.OrthographicCamera)
|
|
2194
|
+
this.instance.clearViewOffset();
|
|
2195
|
+
this.instance.clear();
|
|
2196
|
+
this.instance = void 0;
|
|
2197
|
+
}
|
|
2198
|
+
removeMiniCamera() {
|
|
2199
|
+
if (!(this.miniCamera instanceof import_three3.Camera)) return;
|
|
2200
|
+
this.miniCamera.clearViewOffset();
|
|
2201
|
+
this.miniCamera.clear();
|
|
2202
|
+
this.miniCamera = void 0;
|
|
2203
|
+
}
|
|
2204
|
+
};
|
|
2205
|
+
CameraComponent = __decorateClass([
|
|
2206
|
+
singleton_default(),
|
|
2207
|
+
__decorateParam(0, inject_default(SizesComponent))
|
|
2208
|
+
], CameraComponent);
|
|
2209
|
+
|
|
2210
|
+
// src/core/app/debug/debug.component.ts
|
|
2211
|
+
var import_three4 = require("three");
|
|
2212
|
+
var import_Addons = require("three/examples/jsm/Addons");
|
|
2213
|
+
var DebugComponent = class {
|
|
2214
|
+
constructor(appComponent, cameraComponent, worldComponent) {
|
|
2215
|
+
this.appComponent = appComponent;
|
|
2216
|
+
this.cameraComponent = cameraComponent;
|
|
2217
|
+
this.worldComponent = worldComponent;
|
|
2218
|
+
}
|
|
2219
|
+
enabled = true;
|
|
2220
|
+
cameraControls;
|
|
2221
|
+
miniCameraControls;
|
|
2222
|
+
cameraHelper;
|
|
2223
|
+
axesHelper;
|
|
2224
|
+
gridHelper;
|
|
2225
|
+
_setCameraOrbitControl() {
|
|
2226
|
+
if (this.cameraControls) {
|
|
2227
|
+
this.cameraControls?.dispose();
|
|
2228
|
+
this.cameraControls = void 0;
|
|
2229
|
+
}
|
|
2230
|
+
if (!this.enabled || !(this.cameraComponent.instance instanceof import_three4.Camera))
|
|
2231
|
+
return;
|
|
2232
|
+
if (this.cameraComponent.instance instanceof import_three4.Camera) {
|
|
2233
|
+
this.cameraControls = new import_Addons.OrbitControls(
|
|
2234
|
+
this.cameraComponent.instance,
|
|
2235
|
+
this.appComponent.proxyReceiver
|
|
2236
|
+
);
|
|
2237
|
+
if (this.cameraControls) this.cameraControls.enableDamping = true;
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2240
|
+
_setMiniCameraOrbitControls() {
|
|
2241
|
+
if (this.miniCameraControls) {
|
|
2242
|
+
this.miniCameraControls.dispose();
|
|
2243
|
+
this.miniCameraControls = void 0;
|
|
2244
|
+
}
|
|
2245
|
+
if (!this.enabled) return;
|
|
2246
|
+
if (this.cameraComponent.miniCamera) {
|
|
2247
|
+
this.miniCameraControls = new import_Addons.OrbitControls(
|
|
2248
|
+
this.cameraComponent.miniCamera,
|
|
2249
|
+
this.appComponent.proxyReceiver
|
|
2250
|
+
);
|
|
2251
|
+
this.miniCameraControls.enableDamping = true;
|
|
2252
|
+
}
|
|
2253
|
+
}
|
|
2254
|
+
_setCameraHelper() {
|
|
2255
|
+
if (this.cameraHelper) {
|
|
2256
|
+
this.worldComponent.scene.remove(this.cameraHelper);
|
|
2257
|
+
this.cameraHelper = void 0;
|
|
2258
|
+
}
|
|
2259
|
+
if (!this.enabled) return;
|
|
2260
|
+
if (this.cameraComponent.instance) {
|
|
2261
|
+
this.cameraHelper = new import_three4.CameraHelper(this.cameraComponent.instance);
|
|
2262
|
+
this.worldComponent.scene.add(this.cameraHelper);
|
|
2263
|
+
}
|
|
2264
|
+
}
|
|
2265
|
+
_setAxesHelper(axesSizes) {
|
|
2266
|
+
const axesHelper = new import_three4.AxesHelper(axesSizes);
|
|
2267
|
+
this.worldComponent.scene.add(axesHelper);
|
|
2268
|
+
}
|
|
2269
|
+
_setGridHelper(gridSizes) {
|
|
2270
|
+
const axesHelper = new import_three4.GridHelper(gridSizes, gridSizes);
|
|
2271
|
+
this.worldComponent.scene.add(axesHelper);
|
|
2272
|
+
}
|
|
2273
|
+
init(props) {
|
|
2274
|
+
this._setCameraOrbitControl();
|
|
2275
|
+
this._setMiniCameraOrbitControls();
|
|
2276
|
+
this._setCameraHelper();
|
|
2277
|
+
if (typeof props?.axesSizes === "number")
|
|
2278
|
+
this._setAxesHelper(props.axesSizes);
|
|
2279
|
+
if (typeof props?.gridSizes === "number")
|
|
2280
|
+
this._setGridHelper(props.gridSizes);
|
|
2281
|
+
}
|
|
2282
|
+
update() {
|
|
2283
|
+
if (!this.enabled) return;
|
|
2284
|
+
this.cameraControls?.update();
|
|
2285
|
+
this.miniCameraControls?.update();
|
|
2286
|
+
}
|
|
2287
|
+
dispose() {
|
|
2288
|
+
if (this.cameraHelper) {
|
|
2289
|
+
this.worldComponent.scene.remove(this.cameraHelper);
|
|
2290
|
+
this.cameraHelper = void 0;
|
|
2291
|
+
}
|
|
2292
|
+
if (this.cameraControls) {
|
|
2293
|
+
this.cameraControls.dispose();
|
|
2294
|
+
this.cameraControls = void 0;
|
|
2295
|
+
}
|
|
2296
|
+
if (this.miniCameraControls) {
|
|
2297
|
+
this.miniCameraControls.dispose();
|
|
2298
|
+
this.miniCameraControls = void 0;
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
};
|
|
2302
|
+
DebugComponent = __decorateClass([
|
|
2303
|
+
singleton_default(),
|
|
2304
|
+
__decorateParam(0, inject_default(AppComponent)),
|
|
2305
|
+
__decorateParam(1, inject_default(CameraComponent)),
|
|
2306
|
+
__decorateParam(2, inject_default(WorldComponent))
|
|
2307
|
+
], DebugComponent);
|
|
2308
|
+
|
|
2309
|
+
// src/core/app/renderer/renderer.component.ts
|
|
2310
|
+
var RendererComponent = class {
|
|
2311
|
+
constructor(worldComponent, cameraComponent, sizesComponent, debugComponent) {
|
|
2312
|
+
this.worldComponent = worldComponent;
|
|
2313
|
+
this.cameraComponent = cameraComponent;
|
|
2314
|
+
this.sizesComponent = sizesComponent;
|
|
2315
|
+
this.debugComponent = debugComponent;
|
|
2316
|
+
}
|
|
2317
|
+
enabled = true;
|
|
2318
|
+
instance;
|
|
2319
|
+
init(canvas) {
|
|
2320
|
+
this.instance = new import_three5.WebGLRenderer({
|
|
2321
|
+
canvas,
|
|
2322
|
+
context: canvas.getContext("webgl2", {
|
|
2323
|
+
stencil: true,
|
|
2324
|
+
powerPreference: "high-performance"
|
|
2325
|
+
}),
|
|
2326
|
+
powerPreference: "high-performance",
|
|
2327
|
+
depth: true,
|
|
2328
|
+
antialias: true
|
|
2329
|
+
});
|
|
2330
|
+
this.instance.autoClear = false;
|
|
2331
|
+
this.instance.setPixelRatio(RendererComponent.RENDERER_PIXEL_RATIO);
|
|
2332
|
+
this.instance.setClearColor(0, 0);
|
|
2333
|
+
this.instance.shadowMap.enabled = true;
|
|
2334
|
+
this.instance.shadowMap.type = import_three5.PCFSoftShadowMap;
|
|
2335
|
+
this.instance.outputColorSpace = import_three5.SRGBColorSpace;
|
|
2336
|
+
this.instance.toneMapping = import_three5.CineonToneMapping;
|
|
2337
|
+
this.instance.toneMappingExposure = 1.75;
|
|
2338
|
+
}
|
|
2339
|
+
setSize(width, height) {
|
|
2340
|
+
this.instance?.setSize(width, height);
|
|
2341
|
+
}
|
|
2342
|
+
render() {
|
|
2343
|
+
if (!(this.enabled && this.cameraComponent.instance instanceof import_three5.Camera && this.instance instanceof import_three5.WebGLRenderer))
|
|
2344
|
+
return;
|
|
2345
|
+
this.instance.setViewport(
|
|
2346
|
+
0,
|
|
2347
|
+
0,
|
|
2348
|
+
this.sizesComponent.width,
|
|
2349
|
+
this.sizesComponent.height
|
|
2350
|
+
);
|
|
2351
|
+
this.instance.render(
|
|
2352
|
+
this.worldComponent.scene,
|
|
2353
|
+
this.cameraComponent.instance
|
|
2354
|
+
);
|
|
2355
|
+
if (this.debugComponent.enabled && this.cameraComponent.miniCamera) {
|
|
2356
|
+
this.instance.setScissorTest(true);
|
|
2357
|
+
this.instance.setViewport(
|
|
2358
|
+
this.sizesComponent.width - this.sizesComponent.width / 3,
|
|
2359
|
+
this.sizesComponent.height - this.sizesComponent.height / 3,
|
|
2360
|
+
this.sizesComponent.width / 3,
|
|
2361
|
+
this.sizesComponent.height / 3
|
|
2362
|
+
);
|
|
2363
|
+
this.instance.setScissor(
|
|
2364
|
+
this.sizesComponent.width - this.sizesComponent.width / 3,
|
|
2365
|
+
this.sizesComponent.height - this.sizesComponent.height / 3,
|
|
2366
|
+
this.sizesComponent.width / 3,
|
|
2367
|
+
this.sizesComponent.height / 3
|
|
2368
|
+
);
|
|
2369
|
+
this.instance.render(
|
|
2370
|
+
this.worldComponent.scene,
|
|
2371
|
+
this.cameraComponent.miniCamera
|
|
2372
|
+
);
|
|
2373
|
+
this.instance.setScissorTest(false);
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
};
|
|
2377
|
+
__publicField(RendererComponent, "RENDERER_PIXEL_RATIO", 1);
|
|
2378
|
+
RendererComponent = __decorateClass([
|
|
2379
|
+
singleton_default(),
|
|
2380
|
+
__decorateParam(0, inject_default(WorldComponent)),
|
|
2381
|
+
__decorateParam(1, inject_default(CameraComponent)),
|
|
2382
|
+
__decorateParam(2, inject_default(SizesComponent)),
|
|
2383
|
+
__decorateParam(3, inject_default(DebugComponent))
|
|
2384
|
+
], RendererComponent);
|
|
2385
|
+
|
|
2386
|
+
// src/core/app/timer/timer.controller.ts
|
|
2387
|
+
var import_rxjs2 = require("rxjs");
|
|
2388
|
+
|
|
2389
|
+
// src/common/enums/lifecycle.enum.ts
|
|
2390
|
+
var RegisterLifecycleState = /* @__PURE__ */ ((RegisterLifecycleState2) => {
|
|
2391
|
+
RegisterLifecycleState2[RegisterLifecycleState2["INITIALIZED"] = 0] = "INITIALIZED";
|
|
2392
|
+
RegisterLifecycleState2[RegisterLifecycleState2["DISPOSED"] = 1] = "DISPOSED";
|
|
2393
|
+
return RegisterLifecycleState2;
|
|
2394
|
+
})(RegisterLifecycleState || {});
|
|
2395
|
+
var AppLifecycleState = /* @__PURE__ */ ((AppLifecycleState2) => {
|
|
2396
|
+
AppLifecycleState2[AppLifecycleState2["INITIALIZED"] = 0] = "INITIALIZED";
|
|
2397
|
+
AppLifecycleState2[AppLifecycleState2["STEP_STARTED"] = 1] = "STEP_STARTED";
|
|
2398
|
+
AppLifecycleState2[AppLifecycleState2["STEP_ENDED"] = 2] = "STEP_ENDED";
|
|
2399
|
+
AppLifecycleState2[AppLifecycleState2["DISPOSED"] = 3] = "DISPOSED";
|
|
2400
|
+
return AppLifecycleState2;
|
|
2401
|
+
})(AppLifecycleState || {});
|
|
2402
|
+
|
|
2403
|
+
// src/core/app/timer/timer.controller.ts
|
|
2404
|
+
var TimerController = class {
|
|
2405
|
+
constructor(component, appController) {
|
|
2406
|
+
this.component = component;
|
|
2407
|
+
this.appController = appController;
|
|
2408
|
+
}
|
|
2409
|
+
step$$ = new import_rxjs2.Subject();
|
|
2410
|
+
enable$$ = new import_rxjs2.Subject();
|
|
2411
|
+
step$ = this.step$$.pipe();
|
|
2412
|
+
enable$ = this.enable$$.pipe();
|
|
2413
|
+
step() {
|
|
2414
|
+
this.appController.lifecycle$$.next(1 /* STEP_STARTED */);
|
|
2415
|
+
if (this.component.enabled) {
|
|
2416
|
+
this.component.delta = this.component.clock.getDelta() ?? this.component.frame;
|
|
2417
|
+
this.component.deltaRatio = this.component.delta * 1e3 / this.component.frame;
|
|
2418
|
+
this.step$$.next({
|
|
2419
|
+
delta: this.component.delta,
|
|
2420
|
+
deltaRatio: this.component.deltaRatio
|
|
2421
|
+
});
|
|
2422
|
+
}
|
|
2423
|
+
this.appController.lifecycle$$.next(2 /* STEP_ENDED */);
|
|
2424
|
+
}
|
|
2425
|
+
};
|
|
2426
|
+
TimerController = __decorateClass([
|
|
2427
|
+
singleton_default(),
|
|
2428
|
+
__decorateParam(0, inject_default(TimerComponent)),
|
|
2429
|
+
__decorateParam(1, inject_default(AppController))
|
|
2430
|
+
], TimerController);
|
|
2431
|
+
|
|
2432
|
+
// src/core/app/timer/timer.module.ts
|
|
2433
|
+
var TimerModule = class {
|
|
2434
|
+
constructor(component, controller, rendererComponent) {
|
|
2435
|
+
this.component = component;
|
|
2436
|
+
this.controller = controller;
|
|
2437
|
+
this.rendererComponent = rendererComponent;
|
|
2438
|
+
}
|
|
2439
|
+
init(startTimer) {
|
|
2440
|
+
this.controller.enable$.subscribe((status) => {
|
|
2441
|
+
this.component.enabled = !!status;
|
|
2442
|
+
if (status)
|
|
2443
|
+
this.rendererComponent.instance?.setAnimationLoop(
|
|
2444
|
+
this.controller.step.bind(this.controller)
|
|
2445
|
+
);
|
|
2446
|
+
else this.rendererComponent.instance?.setAnimationLoop(null);
|
|
2447
|
+
});
|
|
2448
|
+
if (startTimer) this.enabled(true);
|
|
2449
|
+
}
|
|
2450
|
+
clock() {
|
|
2451
|
+
return this.component.clock;
|
|
2452
|
+
}
|
|
2453
|
+
frame() {
|
|
2454
|
+
return this.component.frame;
|
|
2455
|
+
}
|
|
2456
|
+
delta(value) {
|
|
2457
|
+
if (typeof value === "number") this.component.delta = value;
|
|
2458
|
+
return this.component.delta;
|
|
2459
|
+
}
|
|
2460
|
+
deltaRatio(value) {
|
|
2461
|
+
if (typeof value === "number") this.component.deltaRatio = value;
|
|
2462
|
+
return this.component.deltaRatio;
|
|
2463
|
+
}
|
|
2464
|
+
enabled(value) {
|
|
2465
|
+
if (typeof value === "boolean") this.controller.enable$$.next(value);
|
|
2466
|
+
return this.component.enabled;
|
|
2467
|
+
}
|
|
2468
|
+
dispose() {
|
|
2469
|
+
this.controller.step$$.complete();
|
|
2470
|
+
this.controller.enable$$.complete();
|
|
2471
|
+
}
|
|
2472
|
+
enabled$() {
|
|
2473
|
+
return this.controller.enable$;
|
|
2474
|
+
}
|
|
2475
|
+
step$() {
|
|
2476
|
+
return this.controller.step$;
|
|
2477
|
+
}
|
|
2478
|
+
};
|
|
2479
|
+
TimerModule = __decorateClass([
|
|
2480
|
+
singleton_default(),
|
|
2481
|
+
__decorateParam(0, inject_default(TimerComponent)),
|
|
2482
|
+
__decorateParam(1, inject_default(TimerController)),
|
|
2483
|
+
__decorateParam(2, inject_default(RendererComponent))
|
|
2484
|
+
], TimerModule);
|
|
2485
|
+
|
|
2486
|
+
// src/core/app/camera/camera.module.ts
|
|
2487
|
+
var import_three6 = require("three");
|
|
2488
|
+
|
|
2489
|
+
// src/core/app/camera/camera.controller.ts
|
|
2490
|
+
var import_rxjs3 = require("rxjs");
|
|
2491
|
+
var CameraController = class {
|
|
2492
|
+
constructor(component, timerController) {
|
|
2493
|
+
this.component = component;
|
|
2494
|
+
this.timerController = timerController;
|
|
2495
|
+
this.step$ = this.timerController.step$.pipe(
|
|
2496
|
+
(0, import_rxjs3.filter)(() => this.component.enabled)
|
|
2497
|
+
);
|
|
2498
|
+
}
|
|
2499
|
+
enable$$ = new import_rxjs3.Subject();
|
|
2500
|
+
enable$ = this.enable$$.pipe();
|
|
2501
|
+
step$;
|
|
2502
|
+
};
|
|
2503
|
+
CameraController = __decorateClass([
|
|
2504
|
+
singleton_default(),
|
|
2505
|
+
__decorateParam(0, inject_default(CameraComponent)),
|
|
2506
|
+
__decorateParam(1, inject_default(TimerController))
|
|
2507
|
+
], CameraController);
|
|
2508
|
+
|
|
2509
|
+
// src/core/app/camera/camera.module.ts
|
|
2510
|
+
var CameraModule = class {
|
|
2511
|
+
constructor(component, sizesComponent, controller) {
|
|
2512
|
+
this.component = component;
|
|
2513
|
+
this.sizesComponent = sizesComponent;
|
|
2514
|
+
this.controller = controller;
|
|
2515
|
+
}
|
|
2516
|
+
init(withMiniCamera) {
|
|
2517
|
+
this.component.initDefaultCamera();
|
|
2518
|
+
if (withMiniCamera) this.component.setMiniCamera();
|
|
2519
|
+
this.controller.enable$.subscribe((status) => {
|
|
2520
|
+
this.component.enabled = !!status;
|
|
2521
|
+
});
|
|
2522
|
+
this.controller.step$.subscribe(() => {
|
|
2523
|
+
if (!this.component.enabled) return;
|
|
2524
|
+
this.component.aspectRatio = this.sizesComponent.aspect;
|
|
2525
|
+
if (this.component.instance instanceof import_three6.PerspectiveCamera || this.component.instance instanceof import_three6.OrthographicCamera)
|
|
2526
|
+
this.component.instance?.updateProjectionMatrix();
|
|
2527
|
+
this.component.miniCamera?.updateProjectionMatrix();
|
|
2528
|
+
});
|
|
2529
|
+
}
|
|
2530
|
+
dispose() {
|
|
2531
|
+
this.component.removeCamera();
|
|
2532
|
+
this.component.removeMiniCamera();
|
|
2533
|
+
}
|
|
2534
|
+
aspectRatio(value) {
|
|
2535
|
+
if (value) this.component.aspectRatio = value;
|
|
2536
|
+
return this.component.aspectRatio;
|
|
2537
|
+
}
|
|
2538
|
+
enabled(value) {
|
|
2539
|
+
if (typeof value === "boolean") this.controller.enable$$.next(value);
|
|
2540
|
+
return this.component.enabled;
|
|
2541
|
+
}
|
|
2542
|
+
instance(value) {
|
|
2543
|
+
if (value) this.component.instance = value;
|
|
2544
|
+
return this.component.instance;
|
|
2545
|
+
}
|
|
2546
|
+
miniCamera(value) {
|
|
2547
|
+
if (value) this.component.miniCamera = value;
|
|
2548
|
+
return this.component.miniCamera;
|
|
2549
|
+
}
|
|
2550
|
+
position(value) {
|
|
2551
|
+
if (value) this.component.position = value;
|
|
2552
|
+
return this.component.position;
|
|
2553
|
+
}
|
|
2554
|
+
quaternion(value) {
|
|
2555
|
+
if (value) this.component.quaternion = value;
|
|
2556
|
+
return this.component.quaternion;
|
|
2557
|
+
}
|
|
2558
|
+
enabled$() {
|
|
2559
|
+
return this.controller.enable$;
|
|
2560
|
+
}
|
|
2561
|
+
};
|
|
2562
|
+
CameraModule = __decorateClass([
|
|
2563
|
+
singleton_default(),
|
|
2564
|
+
__decorateParam(0, inject_default(CameraComponent)),
|
|
2565
|
+
__decorateParam(1, inject_default(SizesComponent)),
|
|
2566
|
+
__decorateParam(2, inject_default(CameraController))
|
|
2567
|
+
], CameraModule);
|
|
2568
|
+
|
|
2569
|
+
// src/core/app/renderer/renderer.controller.ts
|
|
2570
|
+
var import_rxjs5 = require("rxjs");
|
|
2571
|
+
|
|
2572
|
+
// src/core/app/sizes/sizes.controller.ts
|
|
2573
|
+
var import_rxjs4 = require("rxjs");
|
|
2574
|
+
var SizesController = class {
|
|
2575
|
+
constructor(appController, component) {
|
|
2576
|
+
this.appController = appController;
|
|
2577
|
+
this.component = component;
|
|
2578
|
+
this.resize$ = this.appController.resize$$.pipe(
|
|
2579
|
+
(0, import_rxjs4.filter)(() => this.component.enabled)
|
|
2580
|
+
);
|
|
2581
|
+
}
|
|
2582
|
+
enable$$ = new import_rxjs4.Subject();
|
|
2583
|
+
enable$ = this.enable$$.pipe();
|
|
2584
|
+
resize$;
|
|
2585
|
+
};
|
|
2586
|
+
SizesController = __decorateClass([
|
|
2587
|
+
singleton_default(),
|
|
2588
|
+
__decorateParam(0, inject_default(AppController)),
|
|
2589
|
+
__decorateParam(1, inject_default(SizesComponent))
|
|
2590
|
+
], SizesController);
|
|
2591
|
+
|
|
2592
|
+
// src/core/app/renderer/renderer.controller.ts
|
|
2593
|
+
var RendererController = class {
|
|
2594
|
+
constructor(rendererComponent, timerController, sizesController) {
|
|
2595
|
+
this.rendererComponent = rendererComponent;
|
|
2596
|
+
this.timerController = timerController;
|
|
2597
|
+
this.sizesController = sizesController;
|
|
2598
|
+
this.step$ = this.timerController.step$.pipe(
|
|
2599
|
+
(0, import_rxjs5.filter)(() => this.rendererComponent.enabled)
|
|
2600
|
+
);
|
|
2601
|
+
this.resize$ = this.sizesController.resize$.pipe(
|
|
2602
|
+
(0, import_rxjs5.filter)(() => this.rendererComponent.enabled)
|
|
2603
|
+
);
|
|
2604
|
+
}
|
|
2605
|
+
enable$$ = new import_rxjs5.Subject();
|
|
2606
|
+
enable$ = this.enable$$.pipe();
|
|
2607
|
+
step$;
|
|
2608
|
+
resize$;
|
|
2609
|
+
};
|
|
2610
|
+
RendererController = __decorateClass([
|
|
2611
|
+
singleton_default(),
|
|
2612
|
+
__decorateParam(0, inject_default(RendererComponent)),
|
|
2613
|
+
__decorateParam(1, inject_default(TimerController)),
|
|
2614
|
+
__decorateParam(2, inject_default(SizesController))
|
|
2615
|
+
], RendererController);
|
|
2616
|
+
|
|
2617
|
+
// src/core/app/renderer/renderer.module.ts
|
|
2618
|
+
var RendererModule = class {
|
|
2619
|
+
constructor(component, controller) {
|
|
2620
|
+
this.component = component;
|
|
2621
|
+
this.controller = controller;
|
|
2622
|
+
}
|
|
2623
|
+
init(canvas) {
|
|
2624
|
+
this.controller.enable$.subscribe((status) => {
|
|
2625
|
+
this.component.enabled = !!status;
|
|
2626
|
+
});
|
|
2627
|
+
this.controller.step$.subscribe(() => this.component.render());
|
|
2628
|
+
this.controller.resize$.subscribe(
|
|
2629
|
+
(size) => this.component.setSize(size.windowWidth, size.windowHeight)
|
|
2630
|
+
);
|
|
2631
|
+
this.component.init(canvas);
|
|
2632
|
+
}
|
|
2633
|
+
dispose() {
|
|
2634
|
+
this.controller.enable$$.unsubscribe();
|
|
2635
|
+
}
|
|
2636
|
+
enabled(value) {
|
|
2637
|
+
if (typeof value === "boolean") this.controller.enable$$.next(value);
|
|
2638
|
+
return this.component.enabled;
|
|
2639
|
+
}
|
|
2640
|
+
instance() {
|
|
2641
|
+
return this.component.instance;
|
|
2642
|
+
}
|
|
2643
|
+
setSize(value) {
|
|
2644
|
+
return this.component.setSize(value.x, value.y);
|
|
2645
|
+
}
|
|
2646
|
+
render() {
|
|
2647
|
+
return this.component.render();
|
|
2648
|
+
}
|
|
2649
|
+
enabled$() {
|
|
2650
|
+
return this.controller.enable$;
|
|
2651
|
+
}
|
|
2652
|
+
};
|
|
2653
|
+
RendererModule = __decorateClass([
|
|
2654
|
+
singleton_default(),
|
|
2655
|
+
__decorateParam(0, inject_default(RendererComponent)),
|
|
2656
|
+
__decorateParam(1, inject_default(RendererController))
|
|
2657
|
+
], RendererModule);
|
|
2658
|
+
|
|
2659
|
+
// src/core/app/sizes/sizes.module.ts
|
|
2660
|
+
var SizesModule = class {
|
|
2661
|
+
constructor(component, controller) {
|
|
2662
|
+
this.component = component;
|
|
2663
|
+
this.controller = controller;
|
|
2664
|
+
}
|
|
2665
|
+
init(canvas) {
|
|
2666
|
+
this.controller.enable$.subscribe((status) => {
|
|
2667
|
+
this.component.enabled = !!status;
|
|
2668
|
+
});
|
|
2669
|
+
this.controller.resize$.subscribe((size) => {
|
|
2670
|
+
this.component.width = size.windowWidth;
|
|
2671
|
+
this.component.height = size.windowHeight;
|
|
2672
|
+
this.component.aspect = size.windowWidth / size.windowHeight;
|
|
2673
|
+
});
|
|
2674
|
+
this.component.init(canvas);
|
|
2675
|
+
}
|
|
2676
|
+
dispose() {
|
|
2677
|
+
}
|
|
2678
|
+
aspect(value) {
|
|
2679
|
+
if (typeof value === "number") this.component.aspect = value;
|
|
2680
|
+
return this.component.aspect;
|
|
2681
|
+
}
|
|
2682
|
+
enabled(value) {
|
|
2683
|
+
if (typeof value === "boolean") this.controller.enable$$.next(value);
|
|
2684
|
+
return this.component.enabled;
|
|
2685
|
+
}
|
|
2686
|
+
frustrum(value) {
|
|
2687
|
+
if (typeof value === "number") this.component.frustrum = value;
|
|
2688
|
+
return this.component.frustrum;
|
|
2689
|
+
}
|
|
2690
|
+
height(value) {
|
|
2691
|
+
if (typeof value === "number") this.component.height = value;
|
|
2692
|
+
return this.component.height;
|
|
2693
|
+
}
|
|
2694
|
+
pixelRatio(value) {
|
|
2695
|
+
if (typeof value === "number") this.component.pixelRatio = value;
|
|
2696
|
+
return this.component.pixelRatio;
|
|
2697
|
+
}
|
|
2698
|
+
width(value) {
|
|
2699
|
+
if (typeof value === "number") this.component.width = value;
|
|
2700
|
+
return this.component.width;
|
|
2701
|
+
}
|
|
2702
|
+
enabled$() {
|
|
2703
|
+
return this.controller.enable$;
|
|
2704
|
+
}
|
|
2705
|
+
resize$() {
|
|
2706
|
+
return this.controller.resize$;
|
|
2707
|
+
}
|
|
2708
|
+
};
|
|
2709
|
+
SizesModule = __decorateClass([
|
|
2710
|
+
singleton_default(),
|
|
2711
|
+
__decorateParam(0, inject_default(SizesComponent)),
|
|
2712
|
+
__decorateParam(1, inject_default(SizesController))
|
|
2713
|
+
], SizesModule);
|
|
2714
|
+
|
|
2715
|
+
// src/core/app/world/world.module.ts
|
|
2716
|
+
var import_three7 = require("three");
|
|
2717
|
+
|
|
2718
|
+
// src/core/app/world/world.controller.ts
|
|
2719
|
+
var import_rxjs6 = require("rxjs");
|
|
2720
|
+
var WorldController = class {
|
|
2721
|
+
enable$$ = new import_rxjs6.Subject();
|
|
2722
|
+
enable$ = this.enable$$.pipe();
|
|
2723
|
+
};
|
|
2724
|
+
WorldController = __decorateClass([
|
|
2725
|
+
singleton_default()
|
|
2726
|
+
], WorldController);
|
|
2727
|
+
|
|
2728
|
+
// src/core/app/world/world.module.ts
|
|
2729
|
+
var WorldModule = class {
|
|
2730
|
+
constructor(component, controller) {
|
|
2731
|
+
this.component = component;
|
|
2732
|
+
this.controller = controller;
|
|
2733
|
+
}
|
|
2734
|
+
init() {
|
|
2735
|
+
this.controller.enable$.subscribe((status) => {
|
|
2736
|
+
this.component.enabled = !!status;
|
|
2737
|
+
});
|
|
2738
|
+
}
|
|
2739
|
+
dispose() {
|
|
2740
|
+
}
|
|
2741
|
+
scene(value) {
|
|
2742
|
+
if (value instanceof import_three7.Scene) this.component.scene = value;
|
|
2743
|
+
return this.component.scene;
|
|
2744
|
+
}
|
|
2745
|
+
enabled(value) {
|
|
2746
|
+
if (typeof value === "boolean") this.controller.enable$$.next(value);
|
|
2747
|
+
return this.component.enabled;
|
|
2748
|
+
}
|
|
2749
|
+
get enable$() {
|
|
2750
|
+
return this.controller.enable$;
|
|
2751
|
+
}
|
|
2752
|
+
};
|
|
2753
|
+
WorldModule = __decorateClass([
|
|
2754
|
+
singleton_default(),
|
|
2755
|
+
__decorateParam(0, inject_default(WorldComponent)),
|
|
2756
|
+
__decorateParam(1, inject_default(WorldController))
|
|
2757
|
+
], WorldModule);
|
|
2758
|
+
|
|
2759
|
+
// src/core/app/debug/debug.controller.ts
|
|
2760
|
+
var import_rxjs7 = require("rxjs");
|
|
2761
|
+
var DebugController = class {
|
|
2762
|
+
constructor(timerController) {
|
|
2763
|
+
this.timerController = timerController;
|
|
2764
|
+
this.step$ = this.timerController.step$;
|
|
2765
|
+
}
|
|
2766
|
+
enable$$ = new import_rxjs7.Subject();
|
|
2767
|
+
enable$ = this.enable$$.pipe();
|
|
2768
|
+
step$;
|
|
2769
|
+
};
|
|
2770
|
+
DebugController = __decorateClass([
|
|
2771
|
+
singleton_default(),
|
|
2772
|
+
__decorateParam(0, inject_default(TimerController))
|
|
2773
|
+
], DebugController);
|
|
2774
|
+
|
|
2775
|
+
// src/core/app/debug/debug.module.ts
|
|
2776
|
+
var DebugModule = class {
|
|
2777
|
+
constructor(component, controller) {
|
|
2778
|
+
this.component = component;
|
|
2779
|
+
this.controller = controller;
|
|
2780
|
+
this.controller.step$.subscribe(() => {
|
|
2781
|
+
this.component.update();
|
|
2782
|
+
});
|
|
2783
|
+
}
|
|
2784
|
+
init(props) {
|
|
2785
|
+
this.component.init(props);
|
|
2786
|
+
}
|
|
2787
|
+
dispose() {
|
|
2788
|
+
this.component.dispose();
|
|
2789
|
+
}
|
|
2790
|
+
axesHelper() {
|
|
2791
|
+
return this.component.axesHelper;
|
|
2792
|
+
}
|
|
2793
|
+
cameraControls() {
|
|
2794
|
+
return this.component.cameraControls;
|
|
2795
|
+
}
|
|
2796
|
+
cameraHelper() {
|
|
2797
|
+
return this.component.cameraHelper;
|
|
2798
|
+
}
|
|
2799
|
+
enabled(value) {
|
|
2800
|
+
if (value) this.component.enabled = value;
|
|
2801
|
+
return this.component.enabled;
|
|
2802
|
+
}
|
|
2803
|
+
gridHelper() {
|
|
2804
|
+
return this.component.gridHelper;
|
|
2805
|
+
}
|
|
2806
|
+
miniCameraControls() {
|
|
2807
|
+
return this.component.miniCameraControls;
|
|
2808
|
+
}
|
|
2809
|
+
enabled$() {
|
|
2810
|
+
return this.controller.enable$;
|
|
2811
|
+
}
|
|
2812
|
+
};
|
|
2813
|
+
DebugModule = __decorateClass([
|
|
2814
|
+
singleton_default(),
|
|
2815
|
+
__decorateParam(0, inject_default(DebugComponent)),
|
|
2816
|
+
__decorateParam(1, inject_default(DebugController))
|
|
2817
|
+
], DebugModule);
|
|
2818
|
+
|
|
2819
|
+
// src/common/models/app-proxy-event-handler.model.ts
|
|
2820
|
+
var AppProxyEventHandlersModel = class {
|
|
2821
|
+
contextmenu$;
|
|
2822
|
+
resize$;
|
|
2823
|
+
mousedown$;
|
|
2824
|
+
mousemove$;
|
|
2825
|
+
mouseup$;
|
|
2826
|
+
pointerdown$;
|
|
2827
|
+
pointermove$;
|
|
2828
|
+
pointercancel$;
|
|
2829
|
+
pointerup$;
|
|
2830
|
+
touchstart$;
|
|
2831
|
+
touchmove$;
|
|
2832
|
+
touchend$;
|
|
2833
|
+
wheel$;
|
|
2834
|
+
keydown$;
|
|
2835
|
+
contextmenu;
|
|
2836
|
+
resize;
|
|
2837
|
+
mousedown;
|
|
2838
|
+
mousemove;
|
|
2839
|
+
mouseup;
|
|
2840
|
+
pointerdown;
|
|
2841
|
+
pointermove;
|
|
2842
|
+
pointercancel;
|
|
2843
|
+
pointerup;
|
|
2844
|
+
touchstart;
|
|
2845
|
+
touchmove;
|
|
2846
|
+
touchend;
|
|
2847
|
+
wheel;
|
|
2848
|
+
keydown;
|
|
2849
|
+
};
|
|
2850
|
+
|
|
2851
|
+
// src/core/app/app.module.ts
|
|
2852
|
+
var AppModule = class extends AppProxyEventHandlersModel {
|
|
2853
|
+
constructor(controller, component, timer, sizes, camera, world, renderer, debug) {
|
|
2854
|
+
super();
|
|
2855
|
+
this.controller = controller;
|
|
2856
|
+
this.component = component;
|
|
2857
|
+
this.timer = timer;
|
|
2858
|
+
this.sizes = sizes;
|
|
2859
|
+
this.camera = camera;
|
|
2860
|
+
this.world = world;
|
|
2861
|
+
this.renderer = renderer;
|
|
2862
|
+
this.debug = debug;
|
|
2863
|
+
this._initProxyEvents();
|
|
2864
|
+
self.addEventListener("message", this._onMessage.bind(this));
|
|
2865
|
+
}
|
|
2866
|
+
_initProxyEvents() {
|
|
2867
|
+
PROXY_EVENT_LISTENERS.forEach((key) => {
|
|
2868
|
+
this[`${key}$`] = () => this.controller?.[`${key}$`];
|
|
2869
|
+
this[key] = (event) => this.controller?.[key]?.(event);
|
|
2870
|
+
});
|
|
2871
|
+
}
|
|
2872
|
+
_onMessage(event) {
|
|
2873
|
+
if (!event.data?.canvas || this.component.initialized) return;
|
|
2874
|
+
const startTimer = !!event.data?.startTimer;
|
|
2875
|
+
const withMiniCamera = !!event.data?.withMiniCamera;
|
|
2876
|
+
const fullScreen = !!event.data?.fullScreen;
|
|
2877
|
+
this.init({
|
|
2878
|
+
...event.data,
|
|
2879
|
+
startTimer,
|
|
2880
|
+
withMiniCamera,
|
|
2881
|
+
fullScreen
|
|
2882
|
+
});
|
|
2883
|
+
}
|
|
2884
|
+
init(props) {
|
|
2885
|
+
if (!props.canvas || this.component.initialized) return;
|
|
2886
|
+
this.component.initialized = true;
|
|
2887
|
+
props.canvas["style"] = {
|
|
2888
|
+
width: props.canvas.width + "",
|
|
2889
|
+
height: props.canvas.height + ""
|
|
2890
|
+
};
|
|
2891
|
+
const canvas = props.canvas;
|
|
2892
|
+
this.component.canvas = canvas;
|
|
2893
|
+
this.sizes.init(canvas);
|
|
2894
|
+
this.camera.init(props.withMiniCamera);
|
|
2895
|
+
this.world.init();
|
|
2896
|
+
this.renderer.init(canvas);
|
|
2897
|
+
this.timer.init(props.startTimer);
|
|
2898
|
+
this.debug.init(props);
|
|
2899
|
+
this.controller.lifecycle$$.next(0 /* INITIALIZED */);
|
|
2900
|
+
}
|
|
2901
|
+
get canvas() {
|
|
2902
|
+
return this.component.canvas;
|
|
2903
|
+
}
|
|
2904
|
+
get initialized() {
|
|
2905
|
+
return this.component.initialized;
|
|
2906
|
+
}
|
|
2907
|
+
isInitialized() {
|
|
2908
|
+
return this.component.initialized;
|
|
2909
|
+
}
|
|
2910
|
+
dispose() {
|
|
2911
|
+
this.sizes.dispose();
|
|
2912
|
+
this.camera.dispose();
|
|
2913
|
+
this.world.dispose();
|
|
2914
|
+
this.renderer.dispose();
|
|
2915
|
+
this.timer.dispose();
|
|
2916
|
+
this.debug.dispose();
|
|
2917
|
+
this.controller.lifecycle$$.next(3 /* DISPOSED */);
|
|
2918
|
+
this.controller.lifecycle$$.complete();
|
|
2919
|
+
self.removeEventListener("message", this._onMessage.bind(this));
|
|
2920
|
+
}
|
|
2921
|
+
lifecycle$() {
|
|
2922
|
+
return this.controller.lifecycle$;
|
|
2923
|
+
}
|
|
2924
|
+
};
|
|
2925
|
+
AppModule = __decorateClass([
|
|
2926
|
+
singleton_default(),
|
|
2927
|
+
__decorateParam(0, inject_default(AppController)),
|
|
2928
|
+
__decorateParam(1, inject_default(AppComponent)),
|
|
2929
|
+
__decorateParam(2, inject_default(TimerModule)),
|
|
2930
|
+
__decorateParam(3, inject_default(SizesModule)),
|
|
2931
|
+
__decorateParam(4, inject_default(CameraModule)),
|
|
2932
|
+
__decorateParam(5, inject_default(WorldModule)),
|
|
2933
|
+
__decorateParam(6, inject_default(RendererModule)),
|
|
2934
|
+
__decorateParam(7, inject_default(DebugModule))
|
|
2935
|
+
], AppModule);
|
|
2936
|
+
var appModule = instance.resolve(AppModule);
|
|
2937
|
+
|
|
2938
|
+
// src/core/loader/loader.module.ts
|
|
2939
|
+
var import_reflect_metadata2 = __toESM(require_Reflect());
|
|
2940
|
+
var import_three9 = require("three");
|
|
2941
|
+
var import_Addons3 = require("three/examples/jsm/Addons");
|
|
2942
|
+
|
|
2943
|
+
// src/core/loader/loader.controller.ts
|
|
2944
|
+
var import_rxjs8 = require("rxjs");
|
|
2945
|
+
var import_rxjs9 = require("rxjs");
|
|
2946
|
+
var LoaderController = class {
|
|
2947
|
+
lifecycle$$ = new import_rxjs8.Subject();
|
|
2948
|
+
progress$$ = new import_rxjs8.Subject();
|
|
2949
|
+
progress$ = this.progress$$.pipe();
|
|
2950
|
+
lifecycle$ = this.lifecycle$$.pipe();
|
|
2951
|
+
progressCompleted$ = this.progress$.pipe(
|
|
2952
|
+
(0, import_rxjs9.filter)((resource) => resource.toLoad === resource.loaded)
|
|
2953
|
+
);
|
|
2954
|
+
};
|
|
2955
|
+
LoaderController = __decorateClass([
|
|
2956
|
+
scoped(lifecycle_default.ResolutionScoped)
|
|
2957
|
+
], LoaderController);
|
|
2958
|
+
|
|
2959
|
+
// src/core/loader/loader.component.ts
|
|
2960
|
+
var import_three8 = require("three");
|
|
2961
|
+
var import_Addons2 = require("three/examples/jsm/Addons");
|
|
2962
|
+
var LoaderComponent = class {
|
|
2963
|
+
loadingManager = new import_three8.LoadingManager();
|
|
2964
|
+
loaders = {};
|
|
2965
|
+
resources = [];
|
|
2966
|
+
items = {};
|
|
2967
|
+
toLoad = 0;
|
|
2968
|
+
loaded = 0;
|
|
2969
|
+
get videoLoader() {
|
|
2970
|
+
return {
|
|
2971
|
+
load: (url, callback) => {
|
|
2972
|
+
let element = document.createElement("video");
|
|
2973
|
+
element.muted = true;
|
|
2974
|
+
element.loop = true;
|
|
2975
|
+
element.controls = false;
|
|
2976
|
+
element.playsInline = true;
|
|
2977
|
+
element.src = url;
|
|
2978
|
+
element.autoplay = true;
|
|
2979
|
+
const oncanplaythrough = () => {
|
|
2980
|
+
if (!element) return;
|
|
2981
|
+
element.play();
|
|
2982
|
+
const texture = new import_three8.VideoTexture(element);
|
|
2983
|
+
const textureDispose = texture.dispose.bind(texture);
|
|
2984
|
+
texture.dispose = () => {
|
|
2985
|
+
texture.userData.element = void 0;
|
|
2986
|
+
element?.remove();
|
|
2987
|
+
element = void 0;
|
|
2988
|
+
textureDispose();
|
|
2989
|
+
};
|
|
2990
|
+
callback(texture);
|
|
2991
|
+
texture.userData.element = element;
|
|
2992
|
+
element.removeEventListener("canplaythrough", oncanplaythrough);
|
|
2993
|
+
};
|
|
2994
|
+
element.addEventListener("canplaythrough", oncanplaythrough);
|
|
2995
|
+
}
|
|
2996
|
+
};
|
|
2997
|
+
}
|
|
2998
|
+
_setLoaders() {
|
|
2999
|
+
this.loaders.gltfLoader = new import_Addons2.GLTFLoader(this.loadingManager);
|
|
3000
|
+
this.loaders.textureLoader = new import_three8.ImageBitmapLoader(this.loadingManager);
|
|
3001
|
+
this.loaders.cubeTextureLoader = new import_three8.CubeTextureLoader(this.loadingManager);
|
|
3002
|
+
this.loaders.audioLoader = new import_three8.AudioLoader(this.loadingManager);
|
|
3003
|
+
this.loaders.videoLoader = this.videoLoader;
|
|
3004
|
+
}
|
|
3005
|
+
setResources(resources) {
|
|
3006
|
+
this.resources = resources;
|
|
3007
|
+
this.toLoad = this.resources.length;
|
|
3008
|
+
this.loaded = 0;
|
|
3009
|
+
}
|
|
3010
|
+
init(resources = []) {
|
|
3011
|
+
this.resources = resources;
|
|
3012
|
+
this._setLoaders();
|
|
3013
|
+
}
|
|
3014
|
+
};
|
|
3015
|
+
LoaderComponent = __decorateClass([
|
|
3016
|
+
scoped(lifecycle_default.ResolutionScoped)
|
|
3017
|
+
], LoaderComponent);
|
|
3018
|
+
|
|
3019
|
+
// src/core/loader/loader.module.ts
|
|
3020
|
+
var LoaderModule = class {
|
|
3021
|
+
constructor(controller, component) {
|
|
3022
|
+
this.controller = controller;
|
|
3023
|
+
this.component = component;
|
|
3024
|
+
self.onmessage = (event) => {
|
|
3025
|
+
const resources = event?.data?.resources;
|
|
3026
|
+
if (resources) this.init(resources);
|
|
3027
|
+
};
|
|
3028
|
+
}
|
|
3029
|
+
_handleLoadedResource(resource, file) {
|
|
3030
|
+
this.component.items[resource.name] = file;
|
|
3031
|
+
this.component.loaded++;
|
|
3032
|
+
this.controller.progress$$.next({
|
|
3033
|
+
file,
|
|
3034
|
+
resource,
|
|
3035
|
+
loaded: this.component.loaded,
|
|
3036
|
+
toLoad: this.component.toLoad
|
|
3037
|
+
});
|
|
3038
|
+
}
|
|
3039
|
+
setDracoLoader(dracoDecoderPath, linkWithGltfLoader = true) {
|
|
3040
|
+
this.component.loaders.dracoLoader = new import_Addons3.DRACOLoader(
|
|
3041
|
+
this.component.loadingManager
|
|
3042
|
+
);
|
|
3043
|
+
this.component.loaders.dracoLoader.setDecoderPath(dracoDecoderPath);
|
|
3044
|
+
if (linkWithGltfLoader && this.component.loaders.gltfLoader)
|
|
3045
|
+
this.component.loaders.gltfLoader.setDRACOLoader(
|
|
3046
|
+
this.component.loaders.dracoLoader
|
|
3047
|
+
);
|
|
3048
|
+
}
|
|
3049
|
+
load() {
|
|
3050
|
+
const firstResource = this.component.resources[0];
|
|
3051
|
+
if (!firstResource) return;
|
|
3052
|
+
this.controller.progress$$.next({
|
|
3053
|
+
resource: firstResource,
|
|
3054
|
+
loaded: this.component.loaded,
|
|
3055
|
+
toLoad: this.component.toLoad
|
|
3056
|
+
});
|
|
3057
|
+
for (const source of this.component.resources)
|
|
3058
|
+
if (!this.component.items[source.name]) {
|
|
3059
|
+
if (source.type === "gltfModel" && typeof source.path === "string") {
|
|
3060
|
+
this.component.loaders.gltfLoader?.load(
|
|
3061
|
+
source.path,
|
|
3062
|
+
(model) => this._handleLoadedResource(source, model)
|
|
3063
|
+
);
|
|
3064
|
+
}
|
|
3065
|
+
if (source.type === "texture" && typeof source.path === "string") {
|
|
3066
|
+
this.component.loaders.textureLoader?.load(source.path, (texture) => {
|
|
3067
|
+
this._handleLoadedResource(source, new import_three9.CanvasTexture(texture));
|
|
3068
|
+
});
|
|
3069
|
+
}
|
|
3070
|
+
if (source.type === "cubeTexture" && typeof source.path === "object") {
|
|
3071
|
+
this.component.loaders.cubeTextureLoader?.load(
|
|
3072
|
+
source.path,
|
|
3073
|
+
(texture) => this._handleLoadedResource(source, texture)
|
|
3074
|
+
);
|
|
3075
|
+
}
|
|
3076
|
+
if (source.type === "video" && typeof source.path === "string") {
|
|
3077
|
+
this.component.loaders.videoLoader?.load(
|
|
3078
|
+
source.path,
|
|
3079
|
+
(texture) => this._handleLoadedResource(source, texture)
|
|
3080
|
+
);
|
|
3081
|
+
}
|
|
3082
|
+
if (source.type === "audio" && typeof source.path === "string") {
|
|
3083
|
+
this.component.loaders.audioLoader?.load(
|
|
3084
|
+
source.path,
|
|
3085
|
+
(audioBuffer) => {
|
|
3086
|
+
this._handleLoadedResource(source, audioBuffer);
|
|
3087
|
+
}
|
|
3088
|
+
);
|
|
3089
|
+
}
|
|
3090
|
+
}
|
|
3091
|
+
}
|
|
3092
|
+
items() {
|
|
3093
|
+
return this.component.items;
|
|
3094
|
+
}
|
|
3095
|
+
loaders() {
|
|
3096
|
+
return this.component.loaders;
|
|
3097
|
+
}
|
|
3098
|
+
resources() {
|
|
3099
|
+
return this.component.resources;
|
|
3100
|
+
}
|
|
3101
|
+
loaded() {
|
|
3102
|
+
return this.component.loaded;
|
|
3103
|
+
}
|
|
3104
|
+
toLoad() {
|
|
3105
|
+
return this.component.toLoad;
|
|
3106
|
+
}
|
|
3107
|
+
init(resources = []) {
|
|
3108
|
+
this.component.init(resources);
|
|
3109
|
+
}
|
|
3110
|
+
dispose() {
|
|
3111
|
+
this.controller.lifecycle$$.complete();
|
|
3112
|
+
this.controller.progress$$.complete();
|
|
3113
|
+
}
|
|
3114
|
+
lifecycle$() {
|
|
3115
|
+
return this.controller.lifecycle$;
|
|
3116
|
+
}
|
|
3117
|
+
progress$() {
|
|
3118
|
+
return this.controller.progress$;
|
|
3119
|
+
}
|
|
3120
|
+
progressCompleted$() {
|
|
3121
|
+
return this.controller.progressCompleted$;
|
|
3122
|
+
}
|
|
3123
|
+
};
|
|
3124
|
+
LoaderModule = __decorateClass([
|
|
3125
|
+
scoped(lifecycle_default.ResolutionScoped),
|
|
3126
|
+
__decorateParam(0, inject_default(LoaderController)),
|
|
3127
|
+
__decorateParam(1, inject_default(LoaderComponent))
|
|
3128
|
+
], LoaderModule);
|
|
3129
|
+
var loaderModule = instance.resolve(LoaderModule);
|
|
3130
|
+
|
|
3131
|
+
// src/core/register/register.module.ts
|
|
3132
|
+
var import_reflect_metadata3 = __toESM(require_Reflect());
|
|
3133
|
+
var import_threads = require("threads");
|
|
3134
|
+
var import_utils5 = require("@quick-threejs/utils");
|
|
3135
|
+
|
|
3136
|
+
// src/core/register/register.component.ts
|
|
3137
|
+
var import_utils2 = require("@quick-threejs/utils");
|
|
3138
|
+
var import_lil_gui_module_min = __toESM(require("three/examples/jsm/libs/lil-gui.module.min.js"));
|
|
3139
|
+
var import_stats = __toESM(require("stats.js"));
|
|
3140
|
+
var RegisterComponent = class {
|
|
3141
|
+
workerPool = (0, import_utils2.createWorkerPool)();
|
|
3142
|
+
canvas;
|
|
3143
|
+
worker;
|
|
3144
|
+
thread;
|
|
3145
|
+
gui;
|
|
3146
|
+
stats;
|
|
3147
|
+
init(app) {
|
|
3148
|
+
this.worker = app.worker;
|
|
3149
|
+
this.thread = app.thread;
|
|
3150
|
+
this.gui = new import_lil_gui_module_min.default();
|
|
3151
|
+
this.stats = import_stats.default && new import_stats.default();
|
|
3152
|
+
this.stats.showPanel(0);
|
|
3153
|
+
if (!window) return;
|
|
3154
|
+
window.document.body.appendChild(this.stats.dom);
|
|
3155
|
+
if (window.innerWidth <= 450) this.gui.close();
|
|
3156
|
+
}
|
|
3157
|
+
};
|
|
3158
|
+
RegisterComponent = __decorateClass([
|
|
3159
|
+
singleton_default()
|
|
3160
|
+
], RegisterComponent);
|
|
3161
|
+
|
|
3162
|
+
// src/core/register/register.controller.ts
|
|
3163
|
+
var import_rxjs10 = require("rxjs");
|
|
3164
|
+
var import_utils3 = require("@quick-threejs/utils");
|
|
3165
|
+
var RegisterController = class extends ProxyEventHandlersModel {
|
|
3166
|
+
constructor(component) {
|
|
3167
|
+
super();
|
|
3168
|
+
this.component = component;
|
|
3169
|
+
}
|
|
3170
|
+
canvas;
|
|
3171
|
+
lifecycle$$ = new import_rxjs10.Subject();
|
|
3172
|
+
lifecycle$ = this.lifecycle$$.pipe();
|
|
3173
|
+
init(canvas) {
|
|
3174
|
+
this.canvas = canvas;
|
|
3175
|
+
for (const key of PROXY_EVENT_LISTENERS) {
|
|
3176
|
+
const eventHandler = key.startsWith("mouse") || key.startsWith("pointer") || key.startsWith("touch") ? this.mouseEventHandler : key.startsWith("key") ? this.keyEventHandler : key === "resize" ? this.uiEventHandler : key === "wheel" ? this.wheelEventHandler : this.preventDefaultHandler;
|
|
3177
|
+
this[`${key}$`] = (0, import_rxjs10.fromEvent)(
|
|
3178
|
+
key === "resize" ? window : canvas,
|
|
3179
|
+
key
|
|
3180
|
+
).pipe(
|
|
3181
|
+
// @ts-ignore
|
|
3182
|
+
(0, import_rxjs10.map)(eventHandler.bind(this)),
|
|
3183
|
+
(0, import_rxjs10.filter)((e) => key === "keydown" && !e ? false : true)
|
|
3184
|
+
);
|
|
3185
|
+
this[`${key}$`].subscribe((event) => {
|
|
3186
|
+
this.component.thread?.[key]?.(event);
|
|
3187
|
+
});
|
|
3188
|
+
}
|
|
3189
|
+
}
|
|
3190
|
+
preventDefaultHandler(e) {
|
|
3191
|
+
e.preventDefault();
|
|
3192
|
+
return {
|
|
3193
|
+
type: e.type
|
|
3194
|
+
};
|
|
3195
|
+
}
|
|
3196
|
+
getScreenSizes() {
|
|
3197
|
+
return {
|
|
3198
|
+
width: this.canvas.width,
|
|
3199
|
+
height: this.canvas.height,
|
|
3200
|
+
windowWidth: window?.innerWidth ?? 0,
|
|
3201
|
+
windowHeight: window?.innerHeight ?? 0
|
|
3202
|
+
};
|
|
3203
|
+
}
|
|
3204
|
+
uiEventHandler(e) {
|
|
3205
|
+
const rect = this.canvas.getBoundingClientRect();
|
|
3206
|
+
return {
|
|
3207
|
+
...this.getScreenSizes(),
|
|
3208
|
+
type: e.type,
|
|
3209
|
+
top: rect.top,
|
|
3210
|
+
left: rect.left
|
|
3211
|
+
};
|
|
3212
|
+
}
|
|
3213
|
+
mouseEventHandler(e) {
|
|
3214
|
+
return {
|
|
3215
|
+
...this.getScreenSizes(),
|
|
3216
|
+
...(0, import_utils3.copyProperties)(e, [
|
|
3217
|
+
"ctrlKey",
|
|
3218
|
+
"metaKey",
|
|
3219
|
+
"shiftKey",
|
|
3220
|
+
"button",
|
|
3221
|
+
"pointerType",
|
|
3222
|
+
"clientX",
|
|
3223
|
+
"clientY",
|
|
3224
|
+
"pageX",
|
|
3225
|
+
"pageY"
|
|
3226
|
+
])
|
|
3227
|
+
};
|
|
3228
|
+
}
|
|
3229
|
+
touchEventHandler(e) {
|
|
3230
|
+
const touches = [];
|
|
3231
|
+
const data = { type: e.type, touches };
|
|
3232
|
+
for (let i = 0; i < e.touches.length; ++i) {
|
|
3233
|
+
const touch = e.touches[i];
|
|
3234
|
+
touches.push({
|
|
3235
|
+
pageX: touch?.pageX ?? 0,
|
|
3236
|
+
pageY: touch?.pageY ?? 0
|
|
3237
|
+
});
|
|
3238
|
+
}
|
|
3239
|
+
return { ...this.getScreenSizes(), ...data };
|
|
3240
|
+
}
|
|
3241
|
+
wheelEventHandler(e) {
|
|
3242
|
+
e.preventDefault();
|
|
3243
|
+
return {
|
|
3244
|
+
...this.getScreenSizes(),
|
|
3245
|
+
...(0, import_utils3.copyProperties)(e, ["deltaX", "deltaY"])
|
|
3246
|
+
};
|
|
3247
|
+
}
|
|
3248
|
+
keyEventHandler(e) {
|
|
3249
|
+
if (!KEYBOARD_EVENT_CODES.includes(e.code)) return void 0;
|
|
3250
|
+
e.preventDefault();
|
|
3251
|
+
return {
|
|
3252
|
+
...this.getScreenSizes(),
|
|
3253
|
+
...(0, import_utils3.copyProperties)(e, ["ctrlKey", "metaKey", "shiftKey", "keyCode"])
|
|
3254
|
+
};
|
|
3255
|
+
}
|
|
3256
|
+
};
|
|
3257
|
+
RegisterController = __decorateClass([
|
|
3258
|
+
singleton_default(),
|
|
3259
|
+
__decorateParam(0, inject_default(RegisterComponent))
|
|
3260
|
+
], RegisterController);
|
|
3261
|
+
|
|
3262
|
+
// src/common/serializers/object3d.serializer.ts
|
|
3263
|
+
var import_three10 = require("three");
|
|
3264
|
+
var import_utils4 = require("@quick-threejs/utils");
|
|
3265
|
+
var objectLoader = new import_three10.ObjectLoader();
|
|
3266
|
+
var object3DSerializer = {
|
|
3267
|
+
deserialize(message, defaultHandler) {
|
|
3268
|
+
if (message?.isSerialized) return (0, import_utils4.deserializeJSON)(message, objectLoader);
|
|
3269
|
+
return defaultHandler(message);
|
|
3270
|
+
},
|
|
3271
|
+
serialize(thing, defaultHandler) {
|
|
3272
|
+
if (thing instanceof import_three10.Object3D) return (0, import_utils4.toSerializedJSON)(thing);
|
|
3273
|
+
return defaultHandler(thing);
|
|
3274
|
+
}
|
|
3275
|
+
};
|
|
3276
|
+
|
|
3277
|
+
// src/common/models/register-props.model.ts
|
|
3278
|
+
var RegisterPropsModel = class {
|
|
3279
|
+
/**
|
|
3280
|
+
* @description The app worker logic location.
|
|
3281
|
+
*
|
|
3282
|
+
* @required
|
|
3283
|
+
*/
|
|
3284
|
+
location;
|
|
3285
|
+
/**
|
|
3286
|
+
* @description App `canvas` element reference.
|
|
3287
|
+
*
|
|
3288
|
+
* @default undefined
|
|
3289
|
+
*/
|
|
3290
|
+
canvas;
|
|
3291
|
+
/**
|
|
3292
|
+
* @description Set the `canvas` view in fullscreen and auto-resize it.
|
|
3293
|
+
*
|
|
3294
|
+
* @default true
|
|
3295
|
+
*/
|
|
3296
|
+
fullScreen;
|
|
3297
|
+
/**
|
|
3298
|
+
* Default used camera.
|
|
3299
|
+
*
|
|
3300
|
+
* @see {@link DefaultCameraType}
|
|
3301
|
+
*
|
|
3302
|
+
* @default DefaultCameraType.PERSPECTIVE
|
|
3303
|
+
*/
|
|
3304
|
+
defaultCamera;
|
|
3305
|
+
/**
|
|
3306
|
+
* @description Start timer update on launch.
|
|
3307
|
+
*
|
|
3308
|
+
* @default true
|
|
3309
|
+
*/
|
|
3310
|
+
startTimer;
|
|
3311
|
+
/**
|
|
3312
|
+
* Enable the debug mode
|
|
3313
|
+
*
|
|
3314
|
+
* @default undefined
|
|
3315
|
+
*/
|
|
3316
|
+
enableDebug;
|
|
3317
|
+
/**
|
|
3318
|
+
* Define the {@link THREE.AxesHelper} sizes.
|
|
3319
|
+
*
|
|
3320
|
+
* @remark __Deactivated if the value is `0` or `undefined`__
|
|
3321
|
+
* @remark __This property depends on {@link RegisterPropsModel.enableDebug}__
|
|
3322
|
+
*
|
|
3323
|
+
* @default undefined
|
|
3324
|
+
*/
|
|
3325
|
+
axesSizes;
|
|
3326
|
+
/**
|
|
3327
|
+
* Define the {@link THREE.GridHelper} sizes.
|
|
3328
|
+
*
|
|
3329
|
+
* @remark __Deactivated if the value is `0` or `undefined`__
|
|
3330
|
+
* @remark __This property depends on {@link RegisterPropsModel.enableDebug}__
|
|
3331
|
+
*
|
|
3332
|
+
* @default undefined
|
|
3333
|
+
*/
|
|
3334
|
+
gridSizes;
|
|
3335
|
+
/**
|
|
3336
|
+
* Display a mini perfective camera at the top right corner of the screen.
|
|
3337
|
+
*
|
|
3338
|
+
* @remark __This property depends on {@link RegisterPropsModel.enableDebug}__
|
|
3339
|
+
*
|
|
3340
|
+
* @default false
|
|
3341
|
+
*/
|
|
3342
|
+
withMiniCamera;
|
|
3343
|
+
/**
|
|
3344
|
+
* @description Handler called when the app is ready.
|
|
3345
|
+
*
|
|
3346
|
+
* @default undefined
|
|
3347
|
+
*/
|
|
3348
|
+
onReady;
|
|
3349
|
+
};
|
|
3350
|
+
|
|
3351
|
+
// src/common/models/register-proxy-event-handler.model.ts
|
|
3352
|
+
var RegisterProxyEventHandlersModel = class {
|
|
3353
|
+
contextmenu$;
|
|
3354
|
+
resize$;
|
|
3355
|
+
mousedown$;
|
|
3356
|
+
mousemove$;
|
|
3357
|
+
mouseup$;
|
|
3358
|
+
pointerdown$;
|
|
3359
|
+
pointermove$;
|
|
3360
|
+
pointercancel$;
|
|
3361
|
+
pointerup$;
|
|
3362
|
+
touchstart$;
|
|
3363
|
+
touchmove$;
|
|
3364
|
+
touchend$;
|
|
3365
|
+
wheel$;
|
|
3366
|
+
keydown$;
|
|
3367
|
+
};
|
|
3368
|
+
|
|
3369
|
+
// src/core/register/register.module.ts
|
|
3370
|
+
var RegisterModule = class extends RegisterProxyEventHandlersModel {
|
|
3371
|
+
constructor(component, controller, registerProps) {
|
|
3372
|
+
super();
|
|
3373
|
+
this.component = component;
|
|
3374
|
+
this.controller = controller;
|
|
3375
|
+
this.registerProps = registerProps;
|
|
3376
|
+
this.init();
|
|
3377
|
+
}
|
|
3378
|
+
async _initCanvas() {
|
|
3379
|
+
try {
|
|
3380
|
+
this.component.canvas = document.createElement("canvas");
|
|
3381
|
+
if (this.registerProps.canvas instanceof HTMLCanvasElement)
|
|
3382
|
+
this.component.canvas = this.registerProps.canvas;
|
|
3383
|
+
if (typeof this.registerProps.canvas === "string") {
|
|
3384
|
+
const canvas_ = document.querySelector(
|
|
3385
|
+
this.registerProps.canvas
|
|
3386
|
+
);
|
|
3387
|
+
if (canvas_ instanceof HTMLCanvasElement)
|
|
3388
|
+
this.component.canvas = canvas_;
|
|
3389
|
+
}
|
|
3390
|
+
if (!this.component.canvas.parentElement)
|
|
3391
|
+
document.body.appendChild(this.component.canvas);
|
|
3392
|
+
} catch (err) {
|
|
3393
|
+
console.error(
|
|
3394
|
+
`\u{1F6D1} Unable to initialize the canvas:
|
|
3395
|
+
${err?.message ?? "Something went wrong"}`
|
|
3396
|
+
);
|
|
3397
|
+
}
|
|
3398
|
+
}
|
|
3399
|
+
async _initComponent() {
|
|
3400
|
+
this.component.init({
|
|
3401
|
+
worker: this.component.worker,
|
|
3402
|
+
thread: this.component.thread
|
|
3403
|
+
});
|
|
3404
|
+
}
|
|
3405
|
+
async _initController() {
|
|
3406
|
+
this.controller.init(this.component.canvas);
|
|
3407
|
+
if (!this.component.thread || !this.component.worker) return;
|
|
3408
|
+
this.component.thread?.resize?.({
|
|
3409
|
+
...this.controller.uiEventHandler({ type: "resize" })
|
|
3410
|
+
});
|
|
3411
|
+
this.component.thread?.lifecycle$().subscribe((state) => {
|
|
3412
|
+
if (state === 1 /* STEP_STARTED */)
|
|
3413
|
+
this.component.stats?.begin();
|
|
3414
|
+
if (state === 2 /* STEP_ENDED */) this.component.stats?.end();
|
|
3415
|
+
});
|
|
3416
|
+
}
|
|
3417
|
+
async _initWorkerThread() {
|
|
3418
|
+
const offscreenCanvas = this.component.canvas.transferControlToOffscreen();
|
|
3419
|
+
offscreenCanvas.width = this.component.canvas.clientWidth;
|
|
3420
|
+
offscreenCanvas.height = this.component.canvas.clientHeight;
|
|
3421
|
+
const app = await this.component.workerPool.run({
|
|
3422
|
+
payload: {
|
|
3423
|
+
path: this.registerProps.location,
|
|
3424
|
+
subject: {
|
|
3425
|
+
...(0, import_utils5.excludeProperties)(this.registerProps, [
|
|
3426
|
+
"canvas",
|
|
3427
|
+
"location",
|
|
3428
|
+
"onReady"
|
|
3429
|
+
]),
|
|
3430
|
+
canvas: offscreenCanvas
|
|
3431
|
+
},
|
|
3432
|
+
transferSubject: [offscreenCanvas]
|
|
3433
|
+
}
|
|
3434
|
+
});
|
|
3435
|
+
if (!app.thread || !app.worker)
|
|
3436
|
+
throw new Error("Unable to retrieve app worker info.");
|
|
3437
|
+
this.component.worker = app.worker;
|
|
3438
|
+
this.component.thread = app.thread;
|
|
3439
|
+
}
|
|
3440
|
+
async _initProxyEvents() {
|
|
3441
|
+
PROXY_EVENT_LISTENERS.forEach(
|
|
3442
|
+
(key) => this[`${key}$`] = () => this.controller?.[`${key}$`]
|
|
3443
|
+
);
|
|
3444
|
+
}
|
|
3445
|
+
async init() {
|
|
3446
|
+
(0, import_threads.registerSerializer)(object3DSerializer);
|
|
3447
|
+
await this._initCanvas();
|
|
3448
|
+
await this._initWorkerThread();
|
|
3449
|
+
await this._initComponent();
|
|
3450
|
+
await this._initController();
|
|
3451
|
+
await this._initProxyEvents();
|
|
3452
|
+
this.controller.lifecycle$$.next(0 /* INITIALIZED */);
|
|
3453
|
+
this.registerProps.onReady?.(this);
|
|
3454
|
+
}
|
|
3455
|
+
async loadResources(props) {
|
|
3456
|
+
const loaderWorkerThread = await this.component.workerPool.run({
|
|
3457
|
+
payload: {
|
|
3458
|
+
path: "../loader/loader.module-worker.ts",
|
|
3459
|
+
subject: {
|
|
3460
|
+
resources: props.resources
|
|
3461
|
+
}
|
|
3462
|
+
}
|
|
3463
|
+
});
|
|
3464
|
+
loaderWorkerThread.thread?.progress$().subscribe((resource) => {
|
|
3465
|
+
props.onProgress?.(resource);
|
|
3466
|
+
});
|
|
3467
|
+
loaderWorkerThread.thread?.progressCompleted$().subscribe((resource) => {
|
|
3468
|
+
props.onProgressComplete?.(resource);
|
|
3469
|
+
if (props.disposeOnComplete || props.disposeOnComplete === void 0)
|
|
3470
|
+
loaderWorkerThread.thread?.dispose();
|
|
3471
|
+
});
|
|
3472
|
+
if (props.immediateLoad || props.immediateLoad === void 0)
|
|
3473
|
+
await loaderWorkerThread.thread?.load();
|
|
3474
|
+
return {
|
|
3475
|
+
...loaderWorkerThread,
|
|
3476
|
+
load: await loaderWorkerThread.thread?.load,
|
|
3477
|
+
items: await loaderWorkerThread.thread?.items(),
|
|
3478
|
+
loaders: await loaderWorkerThread.thread?.items(),
|
|
3479
|
+
toLoad: await loaderWorkerThread.thread?.toLoad(),
|
|
3480
|
+
loaded: await loaderWorkerThread.thread?.loaded(),
|
|
3481
|
+
resources: await loaderWorkerThread.thread?.resources()
|
|
3482
|
+
};
|
|
3483
|
+
}
|
|
3484
|
+
workerPool() {
|
|
3485
|
+
return this.component.workerPool;
|
|
3486
|
+
}
|
|
3487
|
+
canvas() {
|
|
3488
|
+
return this.component.canvas;
|
|
3489
|
+
}
|
|
3490
|
+
worker() {
|
|
3491
|
+
return this.component.worker;
|
|
3492
|
+
}
|
|
3493
|
+
thread() {
|
|
3494
|
+
return this.component.thread;
|
|
3495
|
+
}
|
|
3496
|
+
gui() {
|
|
3497
|
+
return this.component.gui;
|
|
3498
|
+
}
|
|
3499
|
+
dispose() {
|
|
3500
|
+
this.component.workerPool.terminateAll();
|
|
3501
|
+
this.controller.lifecycle$$.next(1 /* DISPOSED */);
|
|
3502
|
+
}
|
|
3503
|
+
lifecycle$() {
|
|
3504
|
+
return this.controller.lifecycle$;
|
|
3505
|
+
}
|
|
3506
|
+
};
|
|
3507
|
+
RegisterModule = __decorateClass([
|
|
3508
|
+
singleton_default(),
|
|
3509
|
+
__decorateParam(0, inject_default(RegisterComponent)),
|
|
3510
|
+
__decorateParam(1, inject_default(RegisterController)),
|
|
3511
|
+
__decorateParam(2, inject_default(RegisterPropsModel))
|
|
3512
|
+
], RegisterModule);
|
|
3513
|
+
|
|
3514
|
+
// src/core/register/register.util.ts
|
|
3515
|
+
var import_utils6 = require("@quick-threejs/utils");
|
|
3516
|
+
var register = (props) => {
|
|
3517
|
+
if (typeof props?.location !== "string" && !(props?.location instanceof URL))
|
|
3518
|
+
throw new Error(
|
|
3519
|
+
"Invalid register props detected. location path is required"
|
|
3520
|
+
);
|
|
3521
|
+
props.defaultCamera = !(props?.defaultCamera && props.defaultCamera in DefaultCameraType) ? 0 /* PERSPECTIVE */ : props.defaultCamera;
|
|
3522
|
+
props.withMiniCamera = (0, import_utils6.isUndefined)(props.withMiniCamera) || !(0, import_utils6.isBoolean)(props.withMiniCamera) ? false : props.withMiniCamera;
|
|
3523
|
+
props.startTimer = (0, import_utils6.isUndefined)(props.startTimer) || !(0, import_utils6.isBoolean)(props.startTimer) ? true : props.startTimer;
|
|
3524
|
+
props.fullScreen = (0, import_utils6.isUndefined)(props.fullScreen) || !(0, import_utils6.isBoolean)(props.fullScreen) ? true : props.fullScreen;
|
|
3525
|
+
props.onReady = !(0, import_utils6.isFunction)(props.onReady) ? void 0 : props.onReady;
|
|
3526
|
+
instance.register(RegisterPropsModel, { useValue: props });
|
|
3527
|
+
return instance.resolve(RegisterModule);
|
|
3528
|
+
};
|
|
3529
|
+
|
|
3530
|
+
// src/common/models/launch-app-props.model.ts
|
|
3531
|
+
var LaunchAppProps = class {
|
|
3532
|
+
/**
|
|
3533
|
+
* @description Handler triggered when the app is ready.
|
|
3534
|
+
*/
|
|
3535
|
+
onReady;
|
|
3536
|
+
};
|
|
3537
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
3538
|
+
0 && (module.exports = {
|
|
3539
|
+
AppLifecycleState,
|
|
3540
|
+
AppModule,
|
|
3541
|
+
AppProxyEventHandlersModel,
|
|
3542
|
+
DefaultCameraType,
|
|
3543
|
+
KEYBOARD_EVENT_CODES,
|
|
3544
|
+
LaunchAppProps,
|
|
3545
|
+
LoaderModule,
|
|
3546
|
+
PROXY_EVENT_LISTENERS,
|
|
3547
|
+
ProxyEventHandlersModel,
|
|
3548
|
+
ProxyEventObservablesModel,
|
|
3549
|
+
ProxyEventSubjectsModel,
|
|
3550
|
+
RegisterLifecycleState,
|
|
3551
|
+
RegisterModule,
|
|
3552
|
+
RegisterPropsModel,
|
|
3553
|
+
RegisterProxyEventHandlersModel,
|
|
3554
|
+
appModule,
|
|
3555
|
+
loaderModule,
|
|
3556
|
+
object3DSerializer,
|
|
3557
|
+
register
|
|
3558
|
+
});
|
|
3559
|
+
/*! Bundled license information:
|
|
3560
|
+
|
|
3561
|
+
reflect-metadata/Reflect.js:
|
|
3562
|
+
(*! *****************************************************************************
|
|
3563
|
+
Copyright (C) Microsoft. All rights reserved.
|
|
3564
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
3565
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
3566
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
3567
|
+
|
|
3568
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
3569
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
3570
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
3571
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
3572
|
+
|
|
3573
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
3574
|
+
and limitations under the License.
|
|
3575
|
+
***************************************************************************** *)
|
|
3576
|
+
|
|
3577
|
+
tslib/tslib.es6.js:
|
|
3578
|
+
(*! *****************************************************************************
|
|
3579
|
+
Copyright (c) Microsoft Corporation.
|
|
3580
|
+
|
|
3581
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
3582
|
+
purpose with or without fee is hereby granted.
|
|
3583
|
+
|
|
3584
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
3585
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
3586
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
3587
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
3588
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
3589
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
3590
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
3591
|
+
***************************************************************************** *)
|
|
3592
|
+
*/
|
|
3
3593
|
//# sourceMappingURL=main.js.map
|