@planara/core 1.5.0 → 1.6.0
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/core/editor-renderer.d.ts +26 -39
- package/dist/core/editor-renderer.d.ts.map +1 -1
- package/dist/core/preview-renderer.d.ts +1 -1
- package/dist/core/preview-renderer.d.ts.map +1 -1
- package/dist/core/renderer.d.ts +38 -2
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/events/editor-events.d.ts +18 -0
- package/dist/events/editor-events.d.ts.map +1 -0
- package/dist/events/event-bus.d.ts +17 -0
- package/dist/events/event-bus.d.ts.map +1 -0
- package/dist/events/event-topics.d.ts +12 -0
- package/dist/events/event-topics.d.ts.map +1 -0
- package/dist/extensions/mesh-extension.d.ts +12 -0
- package/dist/extensions/mesh-extension.d.ts.map +1 -0
- package/dist/extensions/orbit-extension.d.ts +1 -1
- package/dist/extensions/orbit-extension.d.ts.map +1 -1
- package/dist/handlers/display/wireframe-handler.d.ts +6 -6
- package/dist/handlers/display/wireframe-handler.d.ts.map +1 -1
- package/dist/handlers/select/mesh-select-handler.d.ts +25 -0
- package/dist/handlers/select/mesh-select-handler.d.ts.map +1 -0
- package/dist/hub/app-hub.d.ts +1 -2
- package/dist/hub/app-hub.d.ts.map +1 -1
- package/dist/hub/editor-hub.d.ts +12 -4
- package/dist/hub/editor-hub.d.ts.map +1 -1
- package/dist/index.cjs.js +26 -9
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +1448 -1061
- package/dist/index.full.d.ts +150 -51
- package/dist/index.public.d.ts +114 -28
- package/dist/index.umd.js +26 -9
- package/dist/interfaces/{mesh-api.d.ts → api/mesh-api.d.ts} +1 -0
- package/dist/interfaces/api/mesh-api.d.ts.map +1 -0
- package/dist/interfaces/api/renderer-api.d.ts +27 -0
- package/dist/interfaces/api/renderer-api.d.ts.map +1 -0
- package/dist/interfaces/{display-handler.d.ts → handler/display-handler.d.ts} +1 -0
- package/dist/interfaces/handler/display-handler.d.ts.map +1 -0
- package/dist/interfaces/{handler.d.ts → handler/handler.d.ts} +2 -1
- package/dist/interfaces/handler/handler.d.ts.map +1 -0
- package/dist/interfaces/handler/select-handler.d.ts +13 -0
- package/dist/interfaces/handler/select-handler.d.ts.map +1 -0
- package/dist/interfaces/manager/display-manager.d.ts +8 -0
- package/dist/interfaces/manager/display-manager.d.ts.map +1 -0
- package/dist/interfaces/{manager.d.ts → manager/manager.d.ts} +0 -6
- package/dist/interfaces/manager/manager.d.ts.map +1 -0
- package/dist/interfaces/manager/select-manager.d.ts +8 -0
- package/dist/interfaces/manager/select-manager.d.ts.map +1 -0
- package/dist/ioc/container.d.ts +3 -2
- package/dist/ioc/container.d.ts.map +1 -1
- package/dist/loaders/obj-loader.d.ts +6 -6
- package/dist/loaders/obj-loader.d.ts.map +1 -1
- package/dist/managers/{display-manager.d.ts → display/display-manager.d.ts} +4 -4
- package/dist/managers/display/display-manager.d.ts.map +1 -0
- package/dist/managers/select/select-manager.d.ts +19 -0
- package/dist/managers/select/select-manager.d.ts.map +1 -0
- package/dist/types/camera/camera-position.d.ts +10 -0
- package/dist/types/camera/camera-position.d.ts.map +1 -0
- package/dist/types/event/select-event-type.d.ts +6 -0
- package/dist/types/event/select-event-type.d.ts.map +1 -0
- package/dist/utils/program-settings.d.ts.map +1 -1
- package/dist/utils/renderer-api.d.ts +7 -5
- package/dist/utils/renderer-api.d.ts.map +1 -1
- package/package.json +3 -2
- package/dist/interfaces/display-handler.d.ts.map +0 -1
- package/dist/interfaces/handler.d.ts.map +0 -1
- package/dist/interfaces/manager.d.ts.map +0 -1
- package/dist/interfaces/mesh-api.d.ts.map +0 -1
- package/dist/interfaces/renderer-api.d.ts +0 -14
- package/dist/interfaces/renderer-api.d.ts.map +0 -1
- package/dist/managers/display-manager.d.ts.map +0 -1
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Program as
|
|
2
|
-
var
|
|
1
|
+
import { Program as Et, Mesh as Ct, Renderer as St, Transform as xt, Camera as It, Geometry as Lt, Orbit as it, GridHelper as Tt, AxesHelper as At, Raycast as kt, Vec2 as jt, Vec3 as Dt, NormalProgram as Ht, WireMesh as Nt } from "ogl";
|
|
2
|
+
var Ye = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Qe = {};
|
|
3
3
|
/*! *****************************************************************************
|
|
4
4
|
Copyright (C) Microsoft. All rights reserved.
|
|
5
5
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -14,239 +14,239 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
14
14
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
15
15
|
and limitations under the License.
|
|
16
16
|
***************************************************************************** */
|
|
17
|
-
var
|
|
18
|
-
function
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
return (function(
|
|
17
|
+
var Xe;
|
|
18
|
+
function Ft() {
|
|
19
|
+
if (Xe) return Qe;
|
|
20
|
+
Xe = 1;
|
|
21
|
+
var e;
|
|
22
|
+
return (function(t) {
|
|
23
23
|
(function(r) {
|
|
24
|
-
var s = typeof globalThis == "object" ? globalThis : typeof
|
|
25
|
-
typeof s.Reflect < "u" && (
|
|
26
|
-
function
|
|
27
|
-
return function(
|
|
28
|
-
Object.defineProperty(
|
|
24
|
+
var s = typeof globalThis == "object" ? globalThis : typeof Ye == "object" ? Ye : typeof self == "object" ? self : typeof this == "object" ? this : R(), o = n(t);
|
|
25
|
+
typeof s.Reflect < "u" && (o = n(s.Reflect, o)), r(o, s), typeof s.Reflect > "u" && (s.Reflect = t);
|
|
26
|
+
function n(_, S) {
|
|
27
|
+
return function(j, B) {
|
|
28
|
+
Object.defineProperty(_, j, { configurable: !0, writable: !0, value: B }), S && S(j, B);
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function l() {
|
|
32
32
|
try {
|
|
33
33
|
return Function("return this;")();
|
|
34
34
|
} catch {
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function w() {
|
|
38
38
|
try {
|
|
39
39
|
return (0, eval)("(function() { return this; })()");
|
|
40
40
|
} catch {
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
return
|
|
43
|
+
function R() {
|
|
44
|
+
return l() || w();
|
|
45
45
|
}
|
|
46
46
|
})(function(r, s) {
|
|
47
|
-
var
|
|
47
|
+
var o = Object.prototype.hasOwnProperty, n = typeof Symbol == "function", l = n && typeof Symbol.toPrimitive < "u" ? Symbol.toPrimitive : "@@toPrimitive", w = n && typeof Symbol.iterator < "u" ? Symbol.iterator : "@@iterator", R = typeof Object.create == "function", _ = { __proto__: [] } instanceof Array, S = !R && !_, j = {
|
|
48
48
|
// create an object in dictionary mode (a.k.a. "slow" mode in v8)
|
|
49
|
-
create:
|
|
50
|
-
return
|
|
51
|
-
} :
|
|
52
|
-
return
|
|
49
|
+
create: R ? function() {
|
|
50
|
+
return me(/* @__PURE__ */ Object.create(null));
|
|
51
|
+
} : _ ? function() {
|
|
52
|
+
return me({ __proto__: null });
|
|
53
53
|
} : function() {
|
|
54
|
-
return
|
|
54
|
+
return me({});
|
|
55
55
|
},
|
|
56
|
-
has:
|
|
57
|
-
return
|
|
58
|
-
} : function(
|
|
59
|
-
return
|
|
56
|
+
has: S ? function(i, a) {
|
|
57
|
+
return o.call(i, a);
|
|
58
|
+
} : function(i, a) {
|
|
59
|
+
return a in i;
|
|
60
60
|
},
|
|
61
|
-
get:
|
|
62
|
-
return
|
|
63
|
-
} : function(
|
|
64
|
-
return
|
|
61
|
+
get: S ? function(i, a) {
|
|
62
|
+
return o.call(i, a) ? i[a] : void 0;
|
|
63
|
+
} : function(i, a) {
|
|
64
|
+
return i[a];
|
|
65
65
|
}
|
|
66
|
-
},
|
|
67
|
-
function
|
|
68
|
-
if (
|
|
69
|
-
if (!
|
|
66
|
+
}, B = Object.getPrototypeOf(Function), G = typeof Map == "function" && typeof Map.prototype.entries == "function" ? Map : Mt(), Z = typeof Set == "function" && typeof Set.prototype.entries == "function" ? Set : bt(), K = typeof WeakMap == "function" ? WeakMap : Ot(), V = n ? Symbol.for("@reflect-metadata:registry") : void 0, J = mt(), re = gt(J);
|
|
67
|
+
function ne(i, a, u, h) {
|
|
68
|
+
if (b(u)) {
|
|
69
|
+
if (!Be(i))
|
|
70
70
|
throw new TypeError();
|
|
71
|
-
if (!
|
|
71
|
+
if (!Ge(a))
|
|
72
72
|
throw new TypeError();
|
|
73
|
-
return
|
|
73
|
+
return ie(i, a);
|
|
74
74
|
} else {
|
|
75
|
-
if (!
|
|
75
|
+
if (!Be(i))
|
|
76
76
|
throw new TypeError();
|
|
77
|
-
if (!
|
|
77
|
+
if (!A(a))
|
|
78
78
|
throw new TypeError();
|
|
79
|
-
if (!
|
|
79
|
+
if (!A(h) && !b(h) && !Y(h))
|
|
80
80
|
throw new TypeError();
|
|
81
|
-
return
|
|
81
|
+
return Y(h) && (h = void 0), u = $(u), ve(i, a, u, h);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
r("decorate",
|
|
85
|
-
function
|
|
86
|
-
function u(
|
|
87
|
-
if (!
|
|
84
|
+
r("decorate", ne);
|
|
85
|
+
function c(i, a) {
|
|
86
|
+
function u(h, M) {
|
|
87
|
+
if (!A(h))
|
|
88
88
|
throw new TypeError();
|
|
89
|
-
if (!
|
|
89
|
+
if (!b(M) && !yt(M))
|
|
90
90
|
throw new TypeError();
|
|
91
|
-
|
|
91
|
+
He(i, a, h, M);
|
|
92
92
|
}
|
|
93
93
|
return u;
|
|
94
94
|
}
|
|
95
|
-
r("metadata",
|
|
96
|
-
function
|
|
97
|
-
if (!
|
|
95
|
+
r("metadata", c);
|
|
96
|
+
function f(i, a, u, h) {
|
|
97
|
+
if (!A(u))
|
|
98
98
|
throw new TypeError();
|
|
99
|
-
return
|
|
99
|
+
return b(h) || (h = $(h)), He(i, a, u, h);
|
|
100
100
|
}
|
|
101
|
-
r("defineMetadata",
|
|
102
|
-
function
|
|
103
|
-
if (!
|
|
101
|
+
r("defineMetadata", f);
|
|
102
|
+
function d(i, a, u) {
|
|
103
|
+
if (!A(a))
|
|
104
104
|
throw new TypeError();
|
|
105
|
-
return
|
|
105
|
+
return b(u) || (u = $(u)), ke(i, a, u);
|
|
106
106
|
}
|
|
107
|
-
r("hasMetadata",
|
|
108
|
-
function
|
|
109
|
-
if (!
|
|
107
|
+
r("hasMetadata", d);
|
|
108
|
+
function g(i, a, u) {
|
|
109
|
+
if (!A(a))
|
|
110
110
|
throw new TypeError();
|
|
111
|
-
return
|
|
111
|
+
return b(u) || (u = $(u)), pe(i, a, u);
|
|
112
112
|
}
|
|
113
|
-
r("hasOwnMetadata",
|
|
114
|
-
function
|
|
115
|
-
if (!
|
|
113
|
+
r("hasOwnMetadata", g);
|
|
114
|
+
function O(i, a, u) {
|
|
115
|
+
if (!A(a))
|
|
116
116
|
throw new TypeError();
|
|
117
|
-
return
|
|
117
|
+
return b(u) || (u = $(u)), je(i, a, u);
|
|
118
118
|
}
|
|
119
|
-
r("getMetadata",
|
|
120
|
-
function
|
|
121
|
-
if (!
|
|
119
|
+
r("getMetadata", O);
|
|
120
|
+
function x(i, a, u) {
|
|
121
|
+
if (!A(a))
|
|
122
122
|
throw new TypeError();
|
|
123
|
-
return
|
|
123
|
+
return b(u) || (u = $(u)), De(i, a, u);
|
|
124
124
|
}
|
|
125
|
-
r("getOwnMetadata",
|
|
126
|
-
function
|
|
127
|
-
if (!
|
|
125
|
+
r("getOwnMetadata", x);
|
|
126
|
+
function P(i, a) {
|
|
127
|
+
if (!A(i))
|
|
128
128
|
throw new TypeError();
|
|
129
|
-
return
|
|
129
|
+
return b(a) || (a = $(a)), Ne(i, a);
|
|
130
130
|
}
|
|
131
|
-
r("getMetadataKeys",
|
|
132
|
-
function
|
|
133
|
-
if (!
|
|
131
|
+
r("getMetadataKeys", P);
|
|
132
|
+
function H(i, a) {
|
|
133
|
+
if (!A(i))
|
|
134
134
|
throw new TypeError();
|
|
135
|
-
return
|
|
135
|
+
return b(a) || (a = $(a)), Fe(i, a);
|
|
136
136
|
}
|
|
137
|
-
r("getOwnMetadataKeys",
|
|
138
|
-
function
|
|
139
|
-
if (!
|
|
137
|
+
r("getOwnMetadataKeys", H);
|
|
138
|
+
function U(i, a, u) {
|
|
139
|
+
if (!A(a))
|
|
140
140
|
throw new TypeError();
|
|
141
|
-
if (
|
|
141
|
+
if (b(u) || (u = $(u)), !A(a))
|
|
142
142
|
throw new TypeError();
|
|
143
|
-
|
|
144
|
-
var
|
|
145
|
-
|
|
143
|
+
b(u) || (u = $(u));
|
|
144
|
+
var h = ee(
|
|
145
|
+
a,
|
|
146
146
|
u,
|
|
147
147
|
/*Create*/
|
|
148
148
|
!1
|
|
149
149
|
);
|
|
150
|
-
return
|
|
151
|
-
}
|
|
152
|
-
r("deleteMetadata",
|
|
153
|
-
function
|
|
154
|
-
for (var u =
|
|
155
|
-
var
|
|
156
|
-
if (!
|
|
157
|
-
if (!
|
|
150
|
+
return b(h) ? !1 : h.OrdinaryDeleteMetadata(i, a, u);
|
|
151
|
+
}
|
|
152
|
+
r("deleteMetadata", U);
|
|
153
|
+
function ie(i, a) {
|
|
154
|
+
for (var u = i.length - 1; u >= 0; --u) {
|
|
155
|
+
var h = i[u], M = h(a);
|
|
156
|
+
if (!b(M) && !Y(M)) {
|
|
157
|
+
if (!Ge(M))
|
|
158
158
|
throw new TypeError();
|
|
159
|
-
|
|
159
|
+
a = M;
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
return
|
|
162
|
+
return a;
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
for (var
|
|
166
|
-
var
|
|
167
|
-
if (!
|
|
168
|
-
if (!
|
|
164
|
+
function ve(i, a, u, h) {
|
|
165
|
+
for (var M = i.length - 1; M >= 0; --M) {
|
|
166
|
+
var L = i[M], k = L(a, u, h);
|
|
167
|
+
if (!b(k) && !Y(k)) {
|
|
168
|
+
if (!A(k))
|
|
169
169
|
throw new TypeError();
|
|
170
|
-
|
|
170
|
+
h = k;
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
return
|
|
173
|
+
return h;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
176
|
-
var
|
|
177
|
-
if (
|
|
175
|
+
function ke(i, a, u) {
|
|
176
|
+
var h = pe(i, a, u);
|
|
177
|
+
if (h)
|
|
178
178
|
return !0;
|
|
179
|
-
var
|
|
180
|
-
return
|
|
179
|
+
var M = _e(a);
|
|
180
|
+
return Y(M) ? !1 : ke(i, M, u);
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
var
|
|
184
|
-
|
|
182
|
+
function pe(i, a, u) {
|
|
183
|
+
var h = ee(
|
|
184
|
+
a,
|
|
185
185
|
u,
|
|
186
186
|
/*Create*/
|
|
187
187
|
!1
|
|
188
188
|
);
|
|
189
|
-
return
|
|
190
|
-
}
|
|
191
|
-
function
|
|
192
|
-
var
|
|
193
|
-
if (
|
|
194
|
-
return
|
|
195
|
-
var
|
|
196
|
-
if (!
|
|
197
|
-
return
|
|
198
|
-
}
|
|
199
|
-
function
|
|
200
|
-
var
|
|
201
|
-
|
|
189
|
+
return b(h) ? !1 : We(h.OrdinaryHasOwnMetadata(i, a, u));
|
|
190
|
+
}
|
|
191
|
+
function je(i, a, u) {
|
|
192
|
+
var h = pe(i, a, u);
|
|
193
|
+
if (h)
|
|
194
|
+
return De(i, a, u);
|
|
195
|
+
var M = _e(a);
|
|
196
|
+
if (!Y(M))
|
|
197
|
+
return je(i, M, u);
|
|
198
|
+
}
|
|
199
|
+
function De(i, a, u) {
|
|
200
|
+
var h = ee(
|
|
201
|
+
a,
|
|
202
202
|
u,
|
|
203
203
|
/*Create*/
|
|
204
204
|
!1
|
|
205
205
|
);
|
|
206
|
-
if (!
|
|
207
|
-
return
|
|
206
|
+
if (!b(h))
|
|
207
|
+
return h.OrdinaryGetOwnMetadata(i, a, u);
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
var
|
|
209
|
+
function He(i, a, u, h) {
|
|
210
|
+
var M = ee(
|
|
211
211
|
u,
|
|
212
|
-
|
|
212
|
+
h,
|
|
213
213
|
/*Create*/
|
|
214
214
|
!0
|
|
215
215
|
);
|
|
216
|
-
|
|
216
|
+
M.OrdinaryDefineOwnMetadata(i, a, u, h);
|
|
217
217
|
}
|
|
218
|
-
function
|
|
219
|
-
var u =
|
|
220
|
-
if (
|
|
218
|
+
function Ne(i, a) {
|
|
219
|
+
var u = Fe(i, a), h = _e(i);
|
|
220
|
+
if (h === null)
|
|
221
221
|
return u;
|
|
222
|
-
var
|
|
223
|
-
if (
|
|
222
|
+
var M = Ne(h, a);
|
|
223
|
+
if (M.length <= 0)
|
|
224
224
|
return u;
|
|
225
225
|
if (u.length <= 0)
|
|
226
|
-
return
|
|
227
|
-
for (var
|
|
228
|
-
var
|
|
229
|
-
|
|
226
|
+
return M;
|
|
227
|
+
for (var L = new Z(), k = [], E = 0, v = u; E < v.length; E++) {
|
|
228
|
+
var p = v[E], y = L.has(p);
|
|
229
|
+
y || (L.add(p), k.push(p));
|
|
230
230
|
}
|
|
231
|
-
for (var
|
|
232
|
-
var
|
|
233
|
-
|
|
231
|
+
for (var m = 0, C = M; m < C.length; m++) {
|
|
232
|
+
var p = C[m], y = L.has(p);
|
|
233
|
+
y || (L.add(p), k.push(p));
|
|
234
234
|
}
|
|
235
|
-
return
|
|
235
|
+
return k;
|
|
236
236
|
}
|
|
237
|
-
function
|
|
238
|
-
var u =
|
|
239
|
-
n,
|
|
237
|
+
function Fe(i, a) {
|
|
238
|
+
var u = ee(
|
|
240
239
|
i,
|
|
240
|
+
a,
|
|
241
241
|
/*create*/
|
|
242
242
|
!1
|
|
243
243
|
);
|
|
244
|
-
return u ? u.OrdinaryOwnMetadataKeys(
|
|
244
|
+
return u ? u.OrdinaryOwnMetadataKeys(i, a) : [];
|
|
245
245
|
}
|
|
246
|
-
function
|
|
247
|
-
if (
|
|
246
|
+
function $e(i) {
|
|
247
|
+
if (i === null)
|
|
248
248
|
return 1;
|
|
249
|
-
switch (typeof
|
|
249
|
+
switch (typeof i) {
|
|
250
250
|
case "undefined":
|
|
251
251
|
return 0;
|
|
252
252
|
case "boolean":
|
|
@@ -258,86 +258,86 @@ function Ot() {
|
|
|
258
258
|
case "number":
|
|
259
259
|
return 5;
|
|
260
260
|
case "object":
|
|
261
|
-
return
|
|
261
|
+
return i === null ? 1 : 6;
|
|
262
262
|
default:
|
|
263
263
|
return 6;
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
function
|
|
267
|
-
return
|
|
266
|
+
function b(i) {
|
|
267
|
+
return i === void 0;
|
|
268
268
|
}
|
|
269
|
-
function
|
|
270
|
-
return
|
|
269
|
+
function Y(i) {
|
|
270
|
+
return i === null;
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
return typeof
|
|
272
|
+
function ht(i) {
|
|
273
|
+
return typeof i == "symbol";
|
|
274
274
|
}
|
|
275
|
-
function
|
|
276
|
-
return typeof
|
|
275
|
+
function A(i) {
|
|
276
|
+
return typeof i == "object" ? i !== null : typeof i == "function";
|
|
277
277
|
}
|
|
278
|
-
function
|
|
279
|
-
switch (
|
|
278
|
+
function dt(i, a) {
|
|
279
|
+
switch ($e(i)) {
|
|
280
280
|
case 0:
|
|
281
|
-
return
|
|
281
|
+
return i;
|
|
282
282
|
case 1:
|
|
283
|
-
return
|
|
283
|
+
return i;
|
|
284
284
|
case 2:
|
|
285
|
-
return
|
|
285
|
+
return i;
|
|
286
286
|
case 3:
|
|
287
|
-
return
|
|
287
|
+
return i;
|
|
288
288
|
case 4:
|
|
289
|
-
return
|
|
289
|
+
return i;
|
|
290
290
|
case 5:
|
|
291
|
-
return
|
|
291
|
+
return i;
|
|
292
292
|
}
|
|
293
|
-
var u = "string",
|
|
294
|
-
if (
|
|
295
|
-
var
|
|
296
|
-
if (
|
|
293
|
+
var u = "string", h = Ve(i, l);
|
|
294
|
+
if (h !== void 0) {
|
|
295
|
+
var M = h.call(i, u);
|
|
296
|
+
if (A(M))
|
|
297
297
|
throw new TypeError();
|
|
298
|
-
return
|
|
298
|
+
return M;
|
|
299
299
|
}
|
|
300
|
-
return
|
|
300
|
+
return vt(i);
|
|
301
301
|
}
|
|
302
|
-
function
|
|
303
|
-
var u,
|
|
302
|
+
function vt(i, a) {
|
|
303
|
+
var u, h, M;
|
|
304
304
|
{
|
|
305
|
-
var
|
|
306
|
-
if (
|
|
307
|
-
var
|
|
308
|
-
if (!
|
|
309
|
-
return
|
|
305
|
+
var L = i.toString;
|
|
306
|
+
if (se(L)) {
|
|
307
|
+
var h = L.call(i);
|
|
308
|
+
if (!A(h))
|
|
309
|
+
return h;
|
|
310
310
|
}
|
|
311
|
-
var u =
|
|
312
|
-
if (
|
|
313
|
-
var
|
|
314
|
-
if (!
|
|
315
|
-
return
|
|
311
|
+
var u = i.valueOf;
|
|
312
|
+
if (se(u)) {
|
|
313
|
+
var h = u.call(i);
|
|
314
|
+
if (!A(h))
|
|
315
|
+
return h;
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
throw new TypeError();
|
|
319
319
|
}
|
|
320
|
-
function
|
|
321
|
-
return !!
|
|
320
|
+
function We(i) {
|
|
321
|
+
return !!i;
|
|
322
322
|
}
|
|
323
|
-
function
|
|
324
|
-
return "" +
|
|
323
|
+
function pt(i) {
|
|
324
|
+
return "" + i;
|
|
325
325
|
}
|
|
326
|
-
function
|
|
327
|
-
var
|
|
328
|
-
return
|
|
326
|
+
function $(i) {
|
|
327
|
+
var a = dt(i);
|
|
328
|
+
return ht(a) ? a : pt(a);
|
|
329
329
|
}
|
|
330
|
-
function
|
|
331
|
-
return Array.isArray ? Array.isArray(
|
|
330
|
+
function Be(i) {
|
|
331
|
+
return Array.isArray ? Array.isArray(i) : i instanceof Object ? i instanceof Array : Object.prototype.toString.call(i) === "[object Array]";
|
|
332
332
|
}
|
|
333
|
-
function
|
|
334
|
-
return typeof
|
|
333
|
+
function se(i) {
|
|
334
|
+
return typeof i == "function";
|
|
335
335
|
}
|
|
336
|
-
function
|
|
337
|
-
return typeof
|
|
336
|
+
function Ge(i) {
|
|
337
|
+
return typeof i == "function";
|
|
338
338
|
}
|
|
339
|
-
function
|
|
340
|
-
switch (
|
|
339
|
+
function yt(i) {
|
|
340
|
+
switch ($e(i)) {
|
|
341
341
|
case 3:
|
|
342
342
|
return !0;
|
|
343
343
|
case 4:
|
|
@@ -346,479 +346,479 @@ function Ot() {
|
|
|
346
346
|
return !1;
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
function
|
|
350
|
-
return
|
|
349
|
+
function ye(i, a) {
|
|
350
|
+
return i === a || i !== i && a !== a;
|
|
351
351
|
}
|
|
352
|
-
function
|
|
353
|
-
var u =
|
|
352
|
+
function Ve(i, a) {
|
|
353
|
+
var u = i[a];
|
|
354
354
|
if (u != null) {
|
|
355
|
-
if (!
|
|
355
|
+
if (!se(u))
|
|
356
356
|
throw new TypeError();
|
|
357
357
|
return u;
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
|
-
function
|
|
361
|
-
var
|
|
362
|
-
if (!
|
|
360
|
+
function ze(i) {
|
|
361
|
+
var a = Ve(i, w);
|
|
362
|
+
if (!se(a))
|
|
363
363
|
throw new TypeError();
|
|
364
|
-
var u =
|
|
365
|
-
if (!
|
|
364
|
+
var u = a.call(i);
|
|
365
|
+
if (!A(u))
|
|
366
366
|
throw new TypeError();
|
|
367
367
|
return u;
|
|
368
368
|
}
|
|
369
|
-
function
|
|
370
|
-
return
|
|
371
|
-
}
|
|
372
|
-
function
|
|
373
|
-
var
|
|
374
|
-
return
|
|
375
|
-
}
|
|
376
|
-
function
|
|
377
|
-
var
|
|
378
|
-
|
|
379
|
-
}
|
|
380
|
-
function
|
|
381
|
-
var
|
|
382
|
-
if (typeof
|
|
383
|
-
return
|
|
384
|
-
var u =
|
|
385
|
-
if (
|
|
386
|
-
return
|
|
387
|
-
var
|
|
388
|
-
return typeof
|
|
389
|
-
}
|
|
390
|
-
function
|
|
391
|
-
var
|
|
392
|
-
!
|
|
393
|
-
var
|
|
394
|
-
registerProvider:
|
|
395
|
-
getProvider:
|
|
396
|
-
setProvider:
|
|
369
|
+
function Ue(i) {
|
|
370
|
+
return i.value;
|
|
371
|
+
}
|
|
372
|
+
function qe(i) {
|
|
373
|
+
var a = i.next();
|
|
374
|
+
return a.done ? !1 : a;
|
|
375
|
+
}
|
|
376
|
+
function Ze(i) {
|
|
377
|
+
var a = i.return;
|
|
378
|
+
a && a.call(i);
|
|
379
|
+
}
|
|
380
|
+
function _e(i) {
|
|
381
|
+
var a = Object.getPrototypeOf(i);
|
|
382
|
+
if (typeof i != "function" || i === B || a !== B)
|
|
383
|
+
return a;
|
|
384
|
+
var u = i.prototype, h = u && Object.getPrototypeOf(u);
|
|
385
|
+
if (h == null || h === Object.prototype)
|
|
386
|
+
return a;
|
|
387
|
+
var M = h.constructor;
|
|
388
|
+
return typeof M != "function" || M === i ? a : M;
|
|
389
|
+
}
|
|
390
|
+
function _t() {
|
|
391
|
+
var i;
|
|
392
|
+
!b(V) && typeof s.Reflect < "u" && !(V in s.Reflect) && typeof s.Reflect.defineMetadata == "function" && (i = wt(s.Reflect));
|
|
393
|
+
var a, u, h, M = new K(), L = {
|
|
394
|
+
registerProvider: k,
|
|
395
|
+
getProvider: v,
|
|
396
|
+
setProvider: y
|
|
397
397
|
};
|
|
398
|
-
return
|
|
399
|
-
function
|
|
400
|
-
if (!Object.isExtensible(
|
|
398
|
+
return L;
|
|
399
|
+
function k(m) {
|
|
400
|
+
if (!Object.isExtensible(L))
|
|
401
401
|
throw new Error("Cannot add provider to a frozen registry.");
|
|
402
402
|
switch (!0) {
|
|
403
|
-
case
|
|
403
|
+
case i === m:
|
|
404
404
|
break;
|
|
405
|
-
case
|
|
406
|
-
|
|
405
|
+
case b(a):
|
|
406
|
+
a = m;
|
|
407
407
|
break;
|
|
408
|
-
case
|
|
408
|
+
case a === m:
|
|
409
409
|
break;
|
|
410
|
-
case
|
|
411
|
-
u =
|
|
410
|
+
case b(u):
|
|
411
|
+
u = m;
|
|
412
412
|
break;
|
|
413
|
-
case u ===
|
|
413
|
+
case u === m:
|
|
414
414
|
break;
|
|
415
415
|
default:
|
|
416
|
-
|
|
416
|
+
h === void 0 && (h = new Z()), h.add(m);
|
|
417
417
|
break;
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
function
|
|
421
|
-
if (!
|
|
422
|
-
if (
|
|
423
|
-
return
|
|
424
|
-
if (!
|
|
425
|
-
if (u.isProviderFor(
|
|
426
|
-
return
|
|
427
|
-
if (!
|
|
428
|
-
for (var
|
|
429
|
-
var
|
|
430
|
-
if (!
|
|
420
|
+
function E(m, C) {
|
|
421
|
+
if (!b(a)) {
|
|
422
|
+
if (a.isProviderFor(m, C))
|
|
423
|
+
return a;
|
|
424
|
+
if (!b(u)) {
|
|
425
|
+
if (u.isProviderFor(m, C))
|
|
426
|
+
return a;
|
|
427
|
+
if (!b(h))
|
|
428
|
+
for (var I = ze(h); ; ) {
|
|
429
|
+
var T = qe(I);
|
|
430
|
+
if (!T)
|
|
431
431
|
return;
|
|
432
|
-
var
|
|
433
|
-
if (
|
|
434
|
-
return
|
|
432
|
+
var N = Ue(T);
|
|
433
|
+
if (N.isProviderFor(m, C))
|
|
434
|
+
return Ze(I), N;
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
|
-
if (!
|
|
439
|
-
return
|
|
438
|
+
if (!b(i) && i.isProviderFor(m, C))
|
|
439
|
+
return i;
|
|
440
440
|
}
|
|
441
|
-
function
|
|
442
|
-
var
|
|
443
|
-
return
|
|
441
|
+
function v(m, C) {
|
|
442
|
+
var I = M.get(m), T;
|
|
443
|
+
return b(I) || (T = I.get(C)), b(T) && (T = E(m, C), b(T) || (b(I) && (I = new G(), M.set(m, I)), I.set(C, T))), T;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
446
|
-
if (
|
|
445
|
+
function p(m) {
|
|
446
|
+
if (b(m))
|
|
447
447
|
throw new TypeError();
|
|
448
|
-
return
|
|
448
|
+
return a === m || u === m || !b(h) && h.has(m);
|
|
449
449
|
}
|
|
450
|
-
function
|
|
451
|
-
if (!
|
|
450
|
+
function y(m, C, I) {
|
|
451
|
+
if (!p(I))
|
|
452
452
|
throw new Error("Metadata provider not registered.");
|
|
453
|
-
var
|
|
454
|
-
if (
|
|
455
|
-
if (!
|
|
453
|
+
var T = v(m, C);
|
|
454
|
+
if (T !== I) {
|
|
455
|
+
if (!b(T))
|
|
456
456
|
return !1;
|
|
457
|
-
var
|
|
458
|
-
|
|
457
|
+
var N = M.get(m);
|
|
458
|
+
b(N) && (N = new G(), M.set(m, N)), N.set(C, I);
|
|
459
459
|
}
|
|
460
460
|
return !0;
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
|
-
function
|
|
464
|
-
var
|
|
465
|
-
return !
|
|
463
|
+
function mt() {
|
|
464
|
+
var i;
|
|
465
|
+
return !b(V) && A(s.Reflect) && Object.isExtensible(s.Reflect) && (i = s.Reflect[V]), b(i) && (i = _t()), !b(V) && A(s.Reflect) && Object.isExtensible(s.Reflect) && Object.defineProperty(s.Reflect, V, {
|
|
466
466
|
enumerable: !1,
|
|
467
467
|
configurable: !1,
|
|
468
468
|
writable: !1,
|
|
469
|
-
value:
|
|
470
|
-
}),
|
|
471
|
-
}
|
|
472
|
-
function
|
|
473
|
-
var
|
|
474
|
-
isProviderFor: function(
|
|
475
|
-
var
|
|
476
|
-
return
|
|
469
|
+
value: i
|
|
470
|
+
}), i;
|
|
471
|
+
}
|
|
472
|
+
function gt(i) {
|
|
473
|
+
var a = new K(), u = {
|
|
474
|
+
isProviderFor: function(p, y) {
|
|
475
|
+
var m = a.get(p);
|
|
476
|
+
return b(m) ? !1 : m.has(y);
|
|
477
477
|
},
|
|
478
|
-
OrdinaryDefineOwnMetadata:
|
|
479
|
-
OrdinaryHasOwnMetadata:
|
|
480
|
-
OrdinaryGetOwnMetadata:
|
|
481
|
-
OrdinaryOwnMetadataKeys:
|
|
482
|
-
OrdinaryDeleteMetadata:
|
|
478
|
+
OrdinaryDefineOwnMetadata: k,
|
|
479
|
+
OrdinaryHasOwnMetadata: M,
|
|
480
|
+
OrdinaryGetOwnMetadata: L,
|
|
481
|
+
OrdinaryOwnMetadataKeys: E,
|
|
482
|
+
OrdinaryDeleteMetadata: v
|
|
483
483
|
};
|
|
484
|
-
return
|
|
485
|
-
function
|
|
486
|
-
var
|
|
487
|
-
if (
|
|
488
|
-
if (!
|
|
484
|
+
return J.registerProvider(u), u;
|
|
485
|
+
function h(p, y, m) {
|
|
486
|
+
var C = a.get(p), I = !1;
|
|
487
|
+
if (b(C)) {
|
|
488
|
+
if (!m)
|
|
489
489
|
return;
|
|
490
|
-
|
|
490
|
+
C = new G(), a.set(p, C), I = !0;
|
|
491
491
|
}
|
|
492
|
-
var
|
|
493
|
-
if (
|
|
494
|
-
if (!
|
|
492
|
+
var T = C.get(y);
|
|
493
|
+
if (b(T)) {
|
|
494
|
+
if (!m)
|
|
495
495
|
return;
|
|
496
|
-
if (
|
|
497
|
-
throw
|
|
496
|
+
if (T = new G(), C.set(y, T), !i.setProvider(p, y, u))
|
|
497
|
+
throw C.delete(y), I && a.delete(p), new Error("Wrong provider for target.");
|
|
498
498
|
}
|
|
499
|
-
return
|
|
499
|
+
return T;
|
|
500
500
|
}
|
|
501
|
-
function
|
|
502
|
-
var
|
|
503
|
-
|
|
504
|
-
|
|
501
|
+
function M(p, y, m) {
|
|
502
|
+
var C = h(
|
|
503
|
+
y,
|
|
504
|
+
m,
|
|
505
505
|
/*Create*/
|
|
506
506
|
!1
|
|
507
507
|
);
|
|
508
|
-
return
|
|
508
|
+
return b(C) ? !1 : We(C.has(p));
|
|
509
509
|
}
|
|
510
|
-
function
|
|
511
|
-
var
|
|
512
|
-
|
|
513
|
-
|
|
510
|
+
function L(p, y, m) {
|
|
511
|
+
var C = h(
|
|
512
|
+
y,
|
|
513
|
+
m,
|
|
514
514
|
/*Create*/
|
|
515
515
|
!1
|
|
516
516
|
);
|
|
517
|
-
if (!
|
|
518
|
-
return
|
|
517
|
+
if (!b(C))
|
|
518
|
+
return C.get(p);
|
|
519
519
|
}
|
|
520
|
-
function
|
|
521
|
-
var
|
|
522
|
-
|
|
523
|
-
|
|
520
|
+
function k(p, y, m, C) {
|
|
521
|
+
var I = h(
|
|
522
|
+
m,
|
|
523
|
+
C,
|
|
524
524
|
/*Create*/
|
|
525
525
|
!0
|
|
526
526
|
);
|
|
527
|
-
|
|
527
|
+
I.set(p, y);
|
|
528
528
|
}
|
|
529
|
-
function
|
|
530
|
-
var
|
|
531
|
-
|
|
532
|
-
|
|
529
|
+
function E(p, y) {
|
|
530
|
+
var m = [], C = h(
|
|
531
|
+
p,
|
|
532
|
+
y,
|
|
533
533
|
/*Create*/
|
|
534
534
|
!1
|
|
535
535
|
);
|
|
536
|
-
if (
|
|
537
|
-
return
|
|
538
|
-
for (var
|
|
539
|
-
var
|
|
540
|
-
if (!
|
|
541
|
-
return
|
|
542
|
-
var
|
|
536
|
+
if (b(C))
|
|
537
|
+
return m;
|
|
538
|
+
for (var I = C.keys(), T = ze(I), N = 0; ; ) {
|
|
539
|
+
var Je = qe(T);
|
|
540
|
+
if (!Je)
|
|
541
|
+
return m.length = N, m;
|
|
542
|
+
var Rt = Ue(Je);
|
|
543
543
|
try {
|
|
544
|
-
|
|
545
|
-
} catch (
|
|
544
|
+
m[N] = Rt;
|
|
545
|
+
} catch (Pt) {
|
|
546
546
|
try {
|
|
547
|
-
|
|
547
|
+
Ze(T);
|
|
548
548
|
} finally {
|
|
549
|
-
throw
|
|
549
|
+
throw Pt;
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
|
-
|
|
552
|
+
N++;
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
function
|
|
556
|
-
var
|
|
557
|
-
|
|
558
|
-
|
|
555
|
+
function v(p, y, m) {
|
|
556
|
+
var C = h(
|
|
557
|
+
y,
|
|
558
|
+
m,
|
|
559
559
|
/*Create*/
|
|
560
560
|
!1
|
|
561
561
|
);
|
|
562
|
-
if (
|
|
562
|
+
if (b(C) || !C.delete(p))
|
|
563
563
|
return !1;
|
|
564
|
-
if (
|
|
565
|
-
var
|
|
566
|
-
|
|
564
|
+
if (C.size === 0) {
|
|
565
|
+
var I = a.get(y);
|
|
566
|
+
b(I) || (I.delete(m), I.size === 0 && a.delete(I));
|
|
567
567
|
}
|
|
568
568
|
return !0;
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
|
-
function
|
|
572
|
-
var
|
|
573
|
-
isProviderFor: function(
|
|
574
|
-
var
|
|
575
|
-
return !
|
|
571
|
+
function wt(i) {
|
|
572
|
+
var a = i.defineMetadata, u = i.hasOwnMetadata, h = i.getOwnMetadata, M = i.getOwnMetadataKeys, L = i.deleteMetadata, k = new K(), E = {
|
|
573
|
+
isProviderFor: function(v, p) {
|
|
574
|
+
var y = k.get(v);
|
|
575
|
+
return !b(y) && y.has(p) ? !0 : M(v, p).length ? (b(y) && (y = new Z(), k.set(v, y)), y.add(p), !0) : !1;
|
|
576
576
|
},
|
|
577
|
-
OrdinaryDefineOwnMetadata:
|
|
577
|
+
OrdinaryDefineOwnMetadata: a,
|
|
578
578
|
OrdinaryHasOwnMetadata: u,
|
|
579
|
-
OrdinaryGetOwnMetadata:
|
|
580
|
-
OrdinaryOwnMetadataKeys:
|
|
581
|
-
OrdinaryDeleteMetadata:
|
|
579
|
+
OrdinaryGetOwnMetadata: h,
|
|
580
|
+
OrdinaryOwnMetadataKeys: M,
|
|
581
|
+
OrdinaryDeleteMetadata: L
|
|
582
582
|
};
|
|
583
|
-
return
|
|
583
|
+
return E;
|
|
584
584
|
}
|
|
585
|
-
function
|
|
586
|
-
var
|
|
587
|
-
if (!
|
|
588
|
-
return
|
|
585
|
+
function ee(i, a, u) {
|
|
586
|
+
var h = J.getProvider(i, a);
|
|
587
|
+
if (!b(h))
|
|
588
|
+
return h;
|
|
589
589
|
if (u) {
|
|
590
|
-
if (
|
|
591
|
-
return
|
|
590
|
+
if (J.setProvider(i, a, re))
|
|
591
|
+
return re;
|
|
592
592
|
throw new Error("Illegal state.");
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
|
-
function
|
|
596
|
-
var
|
|
595
|
+
function Mt() {
|
|
596
|
+
var i = {}, a = [], u = (
|
|
597
597
|
/** @class */
|
|
598
598
|
(function() {
|
|
599
|
-
function
|
|
600
|
-
this._index = 0, this._keys =
|
|
599
|
+
function E(v, p, y) {
|
|
600
|
+
this._index = 0, this._keys = v, this._values = p, this._selector = y;
|
|
601
601
|
}
|
|
602
|
-
return
|
|
602
|
+
return E.prototype["@@iterator"] = function() {
|
|
603
603
|
return this;
|
|
604
|
-
},
|
|
604
|
+
}, E.prototype[w] = function() {
|
|
605
605
|
return this;
|
|
606
|
-
},
|
|
607
|
-
var
|
|
608
|
-
if (
|
|
609
|
-
var
|
|
610
|
-
return
|
|
606
|
+
}, E.prototype.next = function() {
|
|
607
|
+
var v = this._index;
|
|
608
|
+
if (v >= 0 && v < this._keys.length) {
|
|
609
|
+
var p = this._selector(this._keys[v], this._values[v]);
|
|
610
|
+
return v + 1 >= this._keys.length ? (this._index = -1, this._keys = a, this._values = a) : this._index++, { value: p, done: !1 };
|
|
611
611
|
}
|
|
612
612
|
return { value: void 0, done: !0 };
|
|
613
|
-
},
|
|
614
|
-
throw this._index >= 0 && (this._index = -1, this._keys =
|
|
615
|
-
},
|
|
616
|
-
return this._index >= 0 && (this._index = -1, this._keys =
|
|
617
|
-
},
|
|
613
|
+
}, E.prototype.throw = function(v) {
|
|
614
|
+
throw this._index >= 0 && (this._index = -1, this._keys = a, this._values = a), v;
|
|
615
|
+
}, E.prototype.return = function(v) {
|
|
616
|
+
return this._index >= 0 && (this._index = -1, this._keys = a, this._values = a), { value: v, done: !0 };
|
|
617
|
+
}, E;
|
|
618
618
|
})()
|
|
619
|
-
),
|
|
619
|
+
), h = (
|
|
620
620
|
/** @class */
|
|
621
621
|
(function() {
|
|
622
|
-
function
|
|
623
|
-
this._keys = [], this._values = [], this._cacheKey =
|
|
622
|
+
function E() {
|
|
623
|
+
this._keys = [], this._values = [], this._cacheKey = i, this._cacheIndex = -2;
|
|
624
624
|
}
|
|
625
|
-
return Object.defineProperty(
|
|
625
|
+
return Object.defineProperty(E.prototype, "size", {
|
|
626
626
|
get: function() {
|
|
627
627
|
return this._keys.length;
|
|
628
628
|
},
|
|
629
629
|
enumerable: !0,
|
|
630
630
|
configurable: !0
|
|
631
|
-
}),
|
|
631
|
+
}), E.prototype.has = function(v) {
|
|
632
632
|
return this._find(
|
|
633
|
-
|
|
633
|
+
v,
|
|
634
634
|
/*insert*/
|
|
635
635
|
!1
|
|
636
636
|
) >= 0;
|
|
637
|
-
},
|
|
638
|
-
var
|
|
639
|
-
|
|
637
|
+
}, E.prototype.get = function(v) {
|
|
638
|
+
var p = this._find(
|
|
639
|
+
v,
|
|
640
640
|
/*insert*/
|
|
641
641
|
!1
|
|
642
642
|
);
|
|
643
|
-
return
|
|
644
|
-
},
|
|
645
|
-
var
|
|
646
|
-
|
|
643
|
+
return p >= 0 ? this._values[p] : void 0;
|
|
644
|
+
}, E.prototype.set = function(v, p) {
|
|
645
|
+
var y = this._find(
|
|
646
|
+
v,
|
|
647
647
|
/*insert*/
|
|
648
648
|
!0
|
|
649
649
|
);
|
|
650
|
-
return this._values[
|
|
651
|
-
},
|
|
652
|
-
var
|
|
653
|
-
|
|
650
|
+
return this._values[y] = p, this;
|
|
651
|
+
}, E.prototype.delete = function(v) {
|
|
652
|
+
var p = this._find(
|
|
653
|
+
v,
|
|
654
654
|
/*insert*/
|
|
655
655
|
!1
|
|
656
656
|
);
|
|
657
|
-
if (
|
|
658
|
-
for (var
|
|
659
|
-
this._keys[
|
|
660
|
-
return this._keys.length--, this._values.length--,
|
|
657
|
+
if (p >= 0) {
|
|
658
|
+
for (var y = this._keys.length, m = p + 1; m < y; m++)
|
|
659
|
+
this._keys[m - 1] = this._keys[m], this._values[m - 1] = this._values[m];
|
|
660
|
+
return this._keys.length--, this._values.length--, ye(v, this._cacheKey) && (this._cacheKey = i, this._cacheIndex = -2), !0;
|
|
661
661
|
}
|
|
662
662
|
return !1;
|
|
663
|
-
},
|
|
664
|
-
this._keys.length = 0, this._values.length = 0, this._cacheKey =
|
|
665
|
-
},
|
|
666
|
-
return new u(this._keys, this._values,
|
|
667
|
-
},
|
|
668
|
-
return new u(this._keys, this._values,
|
|
669
|
-
},
|
|
670
|
-
return new u(this._keys, this._values,
|
|
671
|
-
},
|
|
663
|
+
}, E.prototype.clear = function() {
|
|
664
|
+
this._keys.length = 0, this._values.length = 0, this._cacheKey = i, this._cacheIndex = -2;
|
|
665
|
+
}, E.prototype.keys = function() {
|
|
666
|
+
return new u(this._keys, this._values, M);
|
|
667
|
+
}, E.prototype.values = function() {
|
|
668
|
+
return new u(this._keys, this._values, L);
|
|
669
|
+
}, E.prototype.entries = function() {
|
|
670
|
+
return new u(this._keys, this._values, k);
|
|
671
|
+
}, E.prototype["@@iterator"] = function() {
|
|
672
672
|
return this.entries();
|
|
673
|
-
},
|
|
673
|
+
}, E.prototype[w] = function() {
|
|
674
674
|
return this.entries();
|
|
675
|
-
},
|
|
676
|
-
if (!
|
|
675
|
+
}, E.prototype._find = function(v, p) {
|
|
676
|
+
if (!ye(this._cacheKey, v)) {
|
|
677
677
|
this._cacheIndex = -1;
|
|
678
|
-
for (var
|
|
679
|
-
if (
|
|
680
|
-
this._cacheIndex =
|
|
678
|
+
for (var y = 0; y < this._keys.length; y++)
|
|
679
|
+
if (ye(this._keys[y], v)) {
|
|
680
|
+
this._cacheIndex = y;
|
|
681
681
|
break;
|
|
682
682
|
}
|
|
683
683
|
}
|
|
684
|
-
return this._cacheIndex < 0 &&
|
|
685
|
-
},
|
|
684
|
+
return this._cacheIndex < 0 && p && (this._cacheIndex = this._keys.length, this._keys.push(v), this._values.push(void 0)), this._cacheIndex;
|
|
685
|
+
}, E;
|
|
686
686
|
})()
|
|
687
687
|
);
|
|
688
|
-
return
|
|
689
|
-
function
|
|
690
|
-
return
|
|
688
|
+
return h;
|
|
689
|
+
function M(E, v) {
|
|
690
|
+
return E;
|
|
691
691
|
}
|
|
692
|
-
function
|
|
693
|
-
return
|
|
692
|
+
function L(E, v) {
|
|
693
|
+
return v;
|
|
694
694
|
}
|
|
695
|
-
function
|
|
696
|
-
return [
|
|
695
|
+
function k(E, v) {
|
|
696
|
+
return [E, v];
|
|
697
697
|
}
|
|
698
698
|
}
|
|
699
|
-
function
|
|
700
|
-
var
|
|
699
|
+
function bt() {
|
|
700
|
+
var i = (
|
|
701
701
|
/** @class */
|
|
702
702
|
(function() {
|
|
703
|
-
function
|
|
704
|
-
this._map = new
|
|
703
|
+
function a() {
|
|
704
|
+
this._map = new G();
|
|
705
705
|
}
|
|
706
|
-
return Object.defineProperty(
|
|
706
|
+
return Object.defineProperty(a.prototype, "size", {
|
|
707
707
|
get: function() {
|
|
708
708
|
return this._map.size;
|
|
709
709
|
},
|
|
710
710
|
enumerable: !0,
|
|
711
711
|
configurable: !0
|
|
712
|
-
}),
|
|
712
|
+
}), a.prototype.has = function(u) {
|
|
713
713
|
return this._map.has(u);
|
|
714
|
-
},
|
|
714
|
+
}, a.prototype.add = function(u) {
|
|
715
715
|
return this._map.set(u, u), this;
|
|
716
|
-
},
|
|
716
|
+
}, a.prototype.delete = function(u) {
|
|
717
717
|
return this._map.delete(u);
|
|
718
|
-
},
|
|
718
|
+
}, a.prototype.clear = function() {
|
|
719
719
|
this._map.clear();
|
|
720
|
-
},
|
|
720
|
+
}, a.prototype.keys = function() {
|
|
721
721
|
return this._map.keys();
|
|
722
|
-
},
|
|
722
|
+
}, a.prototype.values = function() {
|
|
723
723
|
return this._map.keys();
|
|
724
|
-
},
|
|
724
|
+
}, a.prototype.entries = function() {
|
|
725
725
|
return this._map.entries();
|
|
726
|
-
},
|
|
726
|
+
}, a.prototype["@@iterator"] = function() {
|
|
727
727
|
return this.keys();
|
|
728
|
-
},
|
|
728
|
+
}, a.prototype[w] = function() {
|
|
729
729
|
return this.keys();
|
|
730
|
-
},
|
|
730
|
+
}, a;
|
|
731
731
|
})()
|
|
732
732
|
);
|
|
733
|
-
return
|
|
733
|
+
return i;
|
|
734
734
|
}
|
|
735
|
-
function
|
|
736
|
-
var
|
|
735
|
+
function Ot() {
|
|
736
|
+
var i = 16, a = j.create(), u = h();
|
|
737
737
|
return (
|
|
738
738
|
/** @class */
|
|
739
739
|
(function() {
|
|
740
|
-
function
|
|
741
|
-
this._key =
|
|
740
|
+
function v() {
|
|
741
|
+
this._key = h();
|
|
742
742
|
}
|
|
743
|
-
return
|
|
744
|
-
var
|
|
745
|
-
|
|
743
|
+
return v.prototype.has = function(p) {
|
|
744
|
+
var y = M(
|
|
745
|
+
p,
|
|
746
746
|
/*create*/
|
|
747
747
|
!1
|
|
748
748
|
);
|
|
749
|
-
return
|
|
750
|
-
},
|
|
751
|
-
var
|
|
752
|
-
|
|
749
|
+
return y !== void 0 ? j.has(y, this._key) : !1;
|
|
750
|
+
}, v.prototype.get = function(p) {
|
|
751
|
+
var y = M(
|
|
752
|
+
p,
|
|
753
753
|
/*create*/
|
|
754
754
|
!1
|
|
755
755
|
);
|
|
756
|
-
return
|
|
757
|
-
},
|
|
758
|
-
var
|
|
759
|
-
|
|
756
|
+
return y !== void 0 ? j.get(y, this._key) : void 0;
|
|
757
|
+
}, v.prototype.set = function(p, y) {
|
|
758
|
+
var m = M(
|
|
759
|
+
p,
|
|
760
760
|
/*create*/
|
|
761
761
|
!0
|
|
762
762
|
);
|
|
763
|
-
return
|
|
764
|
-
},
|
|
765
|
-
var
|
|
766
|
-
|
|
763
|
+
return m[this._key] = y, this;
|
|
764
|
+
}, v.prototype.delete = function(p) {
|
|
765
|
+
var y = M(
|
|
766
|
+
p,
|
|
767
767
|
/*create*/
|
|
768
768
|
!1
|
|
769
769
|
);
|
|
770
|
-
return
|
|
771
|
-
},
|
|
772
|
-
this._key =
|
|
773
|
-
},
|
|
770
|
+
return y !== void 0 ? delete y[this._key] : !1;
|
|
771
|
+
}, v.prototype.clear = function() {
|
|
772
|
+
this._key = h();
|
|
773
|
+
}, v;
|
|
774
774
|
})()
|
|
775
775
|
);
|
|
776
|
-
function
|
|
777
|
-
var
|
|
776
|
+
function h() {
|
|
777
|
+
var v;
|
|
778
778
|
do
|
|
779
|
-
|
|
780
|
-
while (
|
|
781
|
-
return
|
|
779
|
+
v = "@@WeakMap@@" + E();
|
|
780
|
+
while (j.has(a, v));
|
|
781
|
+
return a[v] = !0, v;
|
|
782
782
|
}
|
|
783
|
-
function
|
|
784
|
-
if (!
|
|
785
|
-
if (!
|
|
783
|
+
function M(v, p) {
|
|
784
|
+
if (!o.call(v, u)) {
|
|
785
|
+
if (!p)
|
|
786
786
|
return;
|
|
787
|
-
Object.defineProperty(
|
|
787
|
+
Object.defineProperty(v, u, { value: j.create() });
|
|
788
788
|
}
|
|
789
|
-
return
|
|
789
|
+
return v[u];
|
|
790
790
|
}
|
|
791
|
-
function
|
|
792
|
-
for (var
|
|
793
|
-
|
|
794
|
-
return
|
|
791
|
+
function L(v, p) {
|
|
792
|
+
for (var y = 0; y < p; ++y)
|
|
793
|
+
v[y] = Math.random() * 255 | 0;
|
|
794
|
+
return v;
|
|
795
795
|
}
|
|
796
|
-
function
|
|
796
|
+
function k(v) {
|
|
797
797
|
if (typeof Uint8Array == "function") {
|
|
798
|
-
var
|
|
799
|
-
return typeof crypto < "u" ? crypto.getRandomValues(
|
|
798
|
+
var p = new Uint8Array(v);
|
|
799
|
+
return typeof crypto < "u" ? crypto.getRandomValues(p) : typeof msCrypto < "u" ? msCrypto.getRandomValues(p) : L(p, v), p;
|
|
800
800
|
}
|
|
801
|
-
return
|
|
801
|
+
return L(new Array(v), v);
|
|
802
802
|
}
|
|
803
|
-
function
|
|
804
|
-
var
|
|
805
|
-
|
|
806
|
-
for (var
|
|
807
|
-
var
|
|
808
|
-
(
|
|
803
|
+
function E() {
|
|
804
|
+
var v = k(i);
|
|
805
|
+
v[6] = v[6] & 79 | 64, v[8] = v[8] & 191 | 128;
|
|
806
|
+
for (var p = "", y = 0; y < i; ++y) {
|
|
807
|
+
var m = v[y];
|
|
808
|
+
(y === 4 || y === 6 || y === 8) && (p += "-"), m < 16 && (p += "0"), p += m.toString(16).toLowerCase();
|
|
809
809
|
}
|
|
810
|
-
return
|
|
810
|
+
return p;
|
|
811
811
|
}
|
|
812
812
|
}
|
|
813
|
-
function
|
|
814
|
-
return
|
|
813
|
+
function me(i) {
|
|
814
|
+
return i.__ = void 0, delete i.__, i;
|
|
815
815
|
}
|
|
816
816
|
});
|
|
817
|
-
})(
|
|
817
|
+
})(e || (e = {})), Qe;
|
|
818
818
|
}
|
|
819
|
-
|
|
820
|
-
function
|
|
821
|
-
const
|
|
819
|
+
Ft();
|
|
820
|
+
function $t(e) {
|
|
821
|
+
const t = (
|
|
822
822
|
/* glsl */
|
|
823
823
|
`
|
|
824
824
|
attribute vec3 position;
|
|
@@ -841,28 +841,52 @@ function Et(t) {
|
|
|
841
841
|
precision highp float;
|
|
842
842
|
|
|
843
843
|
uniform float uHit;
|
|
844
|
+
uniform float uSelected;
|
|
844
845
|
|
|
845
846
|
varying vec3 vNormal;
|
|
846
847
|
|
|
847
848
|
void main() {
|
|
848
849
|
vec3 normal = normalize(vNormal);
|
|
849
850
|
float lighting = dot(normal, normalize(vec3(-0.3, 0.8, 0.6)));
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
851
|
+
|
|
852
|
+
// Базовый цвет меша
|
|
853
|
+
vec3 baseColor = vec3(0.2, 0.8, 1.0);
|
|
854
|
+
|
|
855
|
+
// Цвет при наведении (hover)
|
|
856
|
+
vec3 hoverColor = vec3(1.0, 1.0, 0.1);
|
|
857
|
+
|
|
858
|
+
// Цвет при клике (selected)
|
|
859
|
+
vec3 selectedColor = vec3(1.0, 0.3, 0.3);
|
|
860
|
+
|
|
861
|
+
// Применяем логику подсветки:
|
|
862
|
+
// приоритет: выделение > hover > обычный цвет
|
|
863
|
+
vec3 color = mix(baseColor, hoverColor, uHit);
|
|
864
|
+
color = mix(color, selectedColor, uSelected);
|
|
865
|
+
|
|
866
|
+
// Немного света для объема
|
|
867
|
+
color += lighting * 0.1;
|
|
868
|
+
|
|
869
|
+
gl_FragColor = vec4(color, 1.0);
|
|
853
870
|
}
|
|
854
871
|
`
|
|
855
872
|
);
|
|
856
|
-
return new
|
|
857
|
-
vertex:
|
|
873
|
+
return new Et(e, {
|
|
874
|
+
vertex: t,
|
|
858
875
|
fragment: r,
|
|
859
876
|
cullFace: !1,
|
|
860
877
|
uniforms: {
|
|
861
|
-
uHit: { value: 0 }
|
|
878
|
+
uHit: { value: 0 },
|
|
879
|
+
uSelected: { value: 0 }
|
|
862
880
|
}
|
|
863
881
|
});
|
|
864
882
|
}
|
|
865
|
-
class
|
|
883
|
+
class Wt extends Ct {
|
|
884
|
+
isHit;
|
|
885
|
+
constructor(t, r) {
|
|
886
|
+
super(t, r), this.isHit = !1;
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
class st {
|
|
866
890
|
/** Экземпляр рендерера OGL */
|
|
867
891
|
gl;
|
|
868
892
|
/** Корневой объект сцены */
|
|
@@ -879,8 +903,8 @@ class ke {
|
|
|
879
903
|
* Конструктор рендерера
|
|
880
904
|
* @param canvas - HTMLCanvasElement для рендеринга
|
|
881
905
|
*/
|
|
882
|
-
constructor(
|
|
883
|
-
this.canvas =
|
|
906
|
+
constructor(t) {
|
|
907
|
+
this.canvas = t, this.gl = new St({ canvas: t, dpr: 2 }), this.gl.setSize(t.clientWidth, t.clientHeight), this.gl.gl.clearColor(0.1, 0.1, 0.1, 1), this.scene = new xt(), this.camera = new It(this.gl.gl, { fov: 45 }), this.camera.position.set(1, 1, 7), this.camera.lookAt([0, 0, 0]), this.program = $t(this.gl.gl), this.meshes = [];
|
|
884
908
|
}
|
|
885
909
|
/**
|
|
886
910
|
* Обновляет размер рендерера и камеры при изменении размеров canvas.
|
|
@@ -909,39 +933,84 @@ class ke {
|
|
|
909
933
|
* Публичный метод для добавления фигуры.
|
|
910
934
|
* @param figure - Данные фигуры: position, normal, uv
|
|
911
935
|
*/
|
|
912
|
-
addFigure(
|
|
913
|
-
const r = new
|
|
914
|
-
position: { size: 3, data: new Float32Array(
|
|
915
|
-
normal: { size: 3, data: new Float32Array(
|
|
916
|
-
uv: { size: 2, data: new Float32Array(
|
|
917
|
-
}), s = new
|
|
936
|
+
addFigure(t) {
|
|
937
|
+
const r = new Lt(this.gl.gl, {
|
|
938
|
+
position: { size: 3, data: new Float32Array(t.position) },
|
|
939
|
+
normal: { size: 3, data: new Float32Array(t.normal ?? []) },
|
|
940
|
+
uv: { size: 2, data: new Float32Array(t.uv ?? []) }
|
|
941
|
+
}), s = new Wt(this.gl.gl, {
|
|
918
942
|
geometry: r,
|
|
919
943
|
program: this.program
|
|
920
944
|
});
|
|
921
945
|
return s.setParent(this.scene), this.meshes.push(s), s;
|
|
922
946
|
}
|
|
947
|
+
/**
|
|
948
|
+
* Добавляет фигуру в сцену и сохраняет его во внутреннем массиве.
|
|
949
|
+
*
|
|
950
|
+
* @param mesh - Фигура для добавления в сцену.
|
|
951
|
+
* @internal
|
|
952
|
+
*/
|
|
953
|
+
addMesh(t) {
|
|
954
|
+
this.scene.addChild(t);
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* Возвращает WebGL контекст рендерера.
|
|
958
|
+
*
|
|
959
|
+
* @returns Контекст WebGL (OGLRenderingContext) текущей сцены.
|
|
960
|
+
* @internal
|
|
961
|
+
*/
|
|
962
|
+
getContext() {
|
|
963
|
+
return this.gl.gl;
|
|
964
|
+
}
|
|
965
|
+
/**
|
|
966
|
+
* Убирает фигуру со сцены
|
|
967
|
+
*
|
|
968
|
+
* @param mesh - Фигура для удаления со сцены.
|
|
969
|
+
* @internal
|
|
970
|
+
*/
|
|
971
|
+
removeMesh(t) {
|
|
972
|
+
this.scene.removeChild(t);
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* Возвращает список всех фигур, находящихся в сцене.
|
|
976
|
+
*
|
|
977
|
+
* @returns Массив текущих фигур.
|
|
978
|
+
* @internal
|
|
979
|
+
*/
|
|
980
|
+
getMeshes() {
|
|
981
|
+
return this.meshes;
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
* Возвращает настройку для рендеринга.
|
|
985
|
+
*
|
|
986
|
+
* @returns Program для настройки рендеринга моделей.
|
|
987
|
+
* @internal
|
|
988
|
+
*/
|
|
989
|
+
getProgram() {
|
|
990
|
+
return this.program;
|
|
991
|
+
}
|
|
923
992
|
/** Деструктор */
|
|
924
993
|
destroy() {
|
|
925
994
|
this.meshes && (this.meshes.length = 0, this.meshes = []), this.scene = null, this.camera = null, this.program = null, this.gl = null, this.canvas = null;
|
|
926
995
|
}
|
|
927
996
|
}
|
|
928
|
-
class
|
|
997
|
+
class Bt extends it {
|
|
929
998
|
/** Используется ли Orbit-controls */
|
|
930
999
|
isInteracting = !1;
|
|
931
|
-
|
|
932
|
-
constructor(
|
|
933
|
-
super(
|
|
1000
|
+
_element;
|
|
1001
|
+
constructor(t, r = {}) {
|
|
1002
|
+
super(t, r), this._element = r.element || document, this._element.addEventListener("mousedown", () => this.isInteracting = !0), this._element.addEventListener("mouseup", () => this.isInteracting = !1), this._element.addEventListener("touchstart", () => this.isInteracting = !0), this._element.addEventListener("touchend", () => this.isInteracting = !1);
|
|
934
1003
|
}
|
|
935
1004
|
/** Очистка новых обработчиков событий */
|
|
936
1005
|
destroy() {
|
|
937
|
-
this.
|
|
1006
|
+
this._element.removeEventListener("mousedown", () => this.isInteracting = !0), this._element.removeEventListener("mouseup", () => this.isInteracting = !1), this._element.removeEventListener("touchstart", () => this.isInteracting = !0), this._element.removeEventListener("touchend", () => this.isInteracting = !1);
|
|
938
1007
|
}
|
|
939
1008
|
}
|
|
940
|
-
var
|
|
941
|
-
(function(
|
|
942
|
-
|
|
943
|
-
})(
|
|
944
|
-
const
|
|
1009
|
+
var we;
|
|
1010
|
+
(function(e) {
|
|
1011
|
+
e[e.Transient = 0] = "Transient", e[e.Singleton = 1] = "Singleton", e[e.ResolutionScoped = 2] = "ResolutionScoped", e[e.ContainerScoped = 3] = "ContainerScoped";
|
|
1012
|
+
})(we || (we = {}));
|
|
1013
|
+
const D = we;
|
|
945
1014
|
/*! *****************************************************************************
|
|
946
1015
|
Copyright (c) Microsoft Corporation.
|
|
947
1016
|
|
|
@@ -956,161 +1025,161 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
956
1025
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
957
1026
|
PERFORMANCE OF THIS SOFTWARE.
|
|
958
1027
|
***************************************************************************** */
|
|
959
|
-
var
|
|
960
|
-
return
|
|
1028
|
+
var Me = function(e, t) {
|
|
1029
|
+
return Me = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, s) {
|
|
961
1030
|
r.__proto__ = s;
|
|
962
1031
|
} || function(r, s) {
|
|
963
|
-
for (var
|
|
964
|
-
},
|
|
1032
|
+
for (var o in s) s.hasOwnProperty(o) && (r[o] = s[o]);
|
|
1033
|
+
}, Me(e, t);
|
|
965
1034
|
};
|
|
966
|
-
function
|
|
967
|
-
|
|
1035
|
+
function Te(e, t) {
|
|
1036
|
+
Me(e, t);
|
|
968
1037
|
function r() {
|
|
969
|
-
this.constructor =
|
|
1038
|
+
this.constructor = e;
|
|
970
1039
|
}
|
|
971
|
-
|
|
1040
|
+
e.prototype = t === null ? Object.create(t) : (r.prototype = t.prototype, new r());
|
|
972
1041
|
}
|
|
973
|
-
function
|
|
974
|
-
function
|
|
975
|
-
return
|
|
976
|
-
|
|
1042
|
+
function Gt(e, t, r, s) {
|
|
1043
|
+
function o(n) {
|
|
1044
|
+
return n instanceof r ? n : new r(function(l) {
|
|
1045
|
+
l(n);
|
|
977
1046
|
});
|
|
978
1047
|
}
|
|
979
|
-
return new (r || (r = Promise))(function(
|
|
980
|
-
function
|
|
1048
|
+
return new (r || (r = Promise))(function(n, l) {
|
|
1049
|
+
function w(S) {
|
|
981
1050
|
try {
|
|
982
|
-
|
|
983
|
-
} catch (
|
|
984
|
-
|
|
1051
|
+
_(s.next(S));
|
|
1052
|
+
} catch (j) {
|
|
1053
|
+
l(j);
|
|
985
1054
|
}
|
|
986
1055
|
}
|
|
987
|
-
function
|
|
1056
|
+
function R(S) {
|
|
988
1057
|
try {
|
|
989
|
-
|
|
990
|
-
} catch (
|
|
991
|
-
|
|
1058
|
+
_(s.throw(S));
|
|
1059
|
+
} catch (j) {
|
|
1060
|
+
l(j);
|
|
992
1061
|
}
|
|
993
1062
|
}
|
|
994
|
-
function
|
|
995
|
-
|
|
1063
|
+
function _(S) {
|
|
1064
|
+
S.done ? n(S.value) : o(S.value).then(w, R);
|
|
996
1065
|
}
|
|
997
|
-
|
|
1066
|
+
_((s = s.apply(e, [])).next());
|
|
998
1067
|
});
|
|
999
1068
|
}
|
|
1000
|
-
function
|
|
1069
|
+
function Vt(e, t) {
|
|
1001
1070
|
var r = { label: 0, sent: function() {
|
|
1002
|
-
if (
|
|
1003
|
-
return
|
|
1004
|
-
}, trys: [], ops: [] }, s,
|
|
1005
|
-
return
|
|
1071
|
+
if (n[0] & 1) throw n[1];
|
|
1072
|
+
return n[1];
|
|
1073
|
+
}, trys: [], ops: [] }, s, o, n, l;
|
|
1074
|
+
return l = { next: w(0), throw: w(1), return: w(2) }, typeof Symbol == "function" && (l[Symbol.iterator] = function() {
|
|
1006
1075
|
return this;
|
|
1007
|
-
}),
|
|
1008
|
-
function
|
|
1009
|
-
return function(
|
|
1010
|
-
return
|
|
1076
|
+
}), l;
|
|
1077
|
+
function w(_) {
|
|
1078
|
+
return function(S) {
|
|
1079
|
+
return R([_, S]);
|
|
1011
1080
|
};
|
|
1012
1081
|
}
|
|
1013
|
-
function
|
|
1082
|
+
function R(_) {
|
|
1014
1083
|
if (s) throw new TypeError("Generator is already executing.");
|
|
1015
1084
|
for (; r; ) try {
|
|
1016
|
-
if (s = 1,
|
|
1017
|
-
switch (
|
|
1085
|
+
if (s = 1, o && (n = _[0] & 2 ? o.return : _[0] ? o.throw || ((n = o.return) && n.call(o), 0) : o.next) && !(n = n.call(o, _[1])).done) return n;
|
|
1086
|
+
switch (o = 0, n && (_ = [_[0] & 2, n.value]), _[0]) {
|
|
1018
1087
|
case 0:
|
|
1019
1088
|
case 1:
|
|
1020
|
-
|
|
1089
|
+
n = _;
|
|
1021
1090
|
break;
|
|
1022
1091
|
case 4:
|
|
1023
|
-
return r.label++, { value:
|
|
1092
|
+
return r.label++, { value: _[1], done: !1 };
|
|
1024
1093
|
case 5:
|
|
1025
|
-
r.label++,
|
|
1094
|
+
r.label++, o = _[1], _ = [0];
|
|
1026
1095
|
continue;
|
|
1027
1096
|
case 7:
|
|
1028
|
-
|
|
1097
|
+
_ = r.ops.pop(), r.trys.pop();
|
|
1029
1098
|
continue;
|
|
1030
1099
|
default:
|
|
1031
|
-
if (
|
|
1100
|
+
if (n = r.trys, !(n = n.length > 0 && n[n.length - 1]) && (_[0] === 6 || _[0] === 2)) {
|
|
1032
1101
|
r = 0;
|
|
1033
1102
|
continue;
|
|
1034
1103
|
}
|
|
1035
|
-
if (
|
|
1036
|
-
r.label =
|
|
1104
|
+
if (_[0] === 3 && (!n || _[1] > n[0] && _[1] < n[3])) {
|
|
1105
|
+
r.label = _[1];
|
|
1037
1106
|
break;
|
|
1038
1107
|
}
|
|
1039
|
-
if (
|
|
1040
|
-
r.label =
|
|
1108
|
+
if (_[0] === 6 && r.label < n[1]) {
|
|
1109
|
+
r.label = n[1], n = _;
|
|
1041
1110
|
break;
|
|
1042
1111
|
}
|
|
1043
|
-
if (
|
|
1044
|
-
r.label =
|
|
1112
|
+
if (n && r.label < n[2]) {
|
|
1113
|
+
r.label = n[2], r.ops.push(_);
|
|
1045
1114
|
break;
|
|
1046
1115
|
}
|
|
1047
|
-
|
|
1116
|
+
n[2] && r.ops.pop(), r.trys.pop();
|
|
1048
1117
|
continue;
|
|
1049
1118
|
}
|
|
1050
|
-
|
|
1051
|
-
} catch (
|
|
1052
|
-
|
|
1119
|
+
_ = t.call(e, r);
|
|
1120
|
+
} catch (S) {
|
|
1121
|
+
_ = [6, S], o = 0;
|
|
1053
1122
|
} finally {
|
|
1054
|
-
s =
|
|
1123
|
+
s = n = 0;
|
|
1055
1124
|
}
|
|
1056
|
-
if (
|
|
1057
|
-
return { value:
|
|
1125
|
+
if (_[0] & 5) throw _[1];
|
|
1126
|
+
return { value: _[0] ? _[1] : void 0, done: !0 };
|
|
1058
1127
|
}
|
|
1059
1128
|
}
|
|
1060
|
-
function
|
|
1061
|
-
var
|
|
1062
|
-
if (r) return r.call(
|
|
1063
|
-
if (
|
|
1129
|
+
function oe(e) {
|
|
1130
|
+
var t = typeof Symbol == "function" && Symbol.iterator, r = t && e[t], s = 0;
|
|
1131
|
+
if (r) return r.call(e);
|
|
1132
|
+
if (e && typeof e.length == "number") return {
|
|
1064
1133
|
next: function() {
|
|
1065
|
-
return
|
|
1134
|
+
return e && s >= e.length && (e = void 0), { value: e && e[s++], done: !e };
|
|
1066
1135
|
}
|
|
1067
1136
|
};
|
|
1068
|
-
throw new TypeError(
|
|
1137
|
+
throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
1069
1138
|
}
|
|
1070
|
-
function
|
|
1071
|
-
var r = typeof Symbol == "function" &&
|
|
1072
|
-
if (!r) return
|
|
1073
|
-
var s = r.call(
|
|
1139
|
+
function ce(e, t) {
|
|
1140
|
+
var r = typeof Symbol == "function" && e[Symbol.iterator];
|
|
1141
|
+
if (!r) return e;
|
|
1142
|
+
var s = r.call(e), o, n = [], l;
|
|
1074
1143
|
try {
|
|
1075
|
-
for (; (
|
|
1076
|
-
} catch (
|
|
1077
|
-
|
|
1144
|
+
for (; (t === void 0 || t-- > 0) && !(o = s.next()).done; ) n.push(o.value);
|
|
1145
|
+
} catch (w) {
|
|
1146
|
+
l = { error: w };
|
|
1078
1147
|
} finally {
|
|
1079
1148
|
try {
|
|
1080
|
-
|
|
1149
|
+
o && !o.done && (r = s.return) && r.call(s);
|
|
1081
1150
|
} finally {
|
|
1082
|
-
if (
|
|
1151
|
+
if (l) throw l.error;
|
|
1083
1152
|
}
|
|
1084
1153
|
}
|
|
1085
|
-
return
|
|
1154
|
+
return n;
|
|
1086
1155
|
}
|
|
1087
|
-
function
|
|
1088
|
-
for (var
|
|
1089
|
-
|
|
1090
|
-
return
|
|
1156
|
+
function q() {
|
|
1157
|
+
for (var e = [], t = 0; t < arguments.length; t++)
|
|
1158
|
+
e = e.concat(ce(arguments[t]));
|
|
1159
|
+
return e;
|
|
1091
1160
|
}
|
|
1092
|
-
var
|
|
1093
|
-
function
|
|
1094
|
-
var
|
|
1161
|
+
var be = "injectionTokens";
|
|
1162
|
+
function zt(e) {
|
|
1163
|
+
var t = Reflect.getMetadata("design:paramtypes", e) || [], r = Reflect.getOwnMetadata(be, e) || {};
|
|
1095
1164
|
return Object.keys(r).forEach(function(s) {
|
|
1096
|
-
|
|
1097
|
-
}),
|
|
1165
|
+
t[+s] = r[s];
|
|
1166
|
+
}), t;
|
|
1098
1167
|
}
|
|
1099
|
-
function
|
|
1100
|
-
return function(r, s,
|
|
1101
|
-
var
|
|
1102
|
-
o
|
|
1168
|
+
function ot(e, t) {
|
|
1169
|
+
return function(r, s, o) {
|
|
1170
|
+
var n = Reflect.getOwnMetadata(be, r) || {};
|
|
1171
|
+
n[o] = e, Reflect.defineMetadata(be, n, r);
|
|
1103
1172
|
};
|
|
1104
1173
|
}
|
|
1105
|
-
function
|
|
1106
|
-
return !!
|
|
1174
|
+
function at(e) {
|
|
1175
|
+
return !!e.useClass;
|
|
1107
1176
|
}
|
|
1108
|
-
function
|
|
1109
|
-
return !!
|
|
1177
|
+
function Oe(e) {
|
|
1178
|
+
return !!e.useFactory;
|
|
1110
1179
|
}
|
|
1111
|
-
var
|
|
1112
|
-
function t
|
|
1113
|
-
this.wrap =
|
|
1180
|
+
var ut = (function() {
|
|
1181
|
+
function e(t) {
|
|
1182
|
+
this.wrap = t, this.reflectMethods = [
|
|
1114
1183
|
"get",
|
|
1115
1184
|
"getPrototypeOf",
|
|
1116
1185
|
"setPrototypeOf",
|
|
@@ -1124,499 +1193,718 @@ var He = (function() {
|
|
|
1124
1193
|
"ownKeys"
|
|
1125
1194
|
];
|
|
1126
1195
|
}
|
|
1127
|
-
return
|
|
1128
|
-
var r = this, s = {},
|
|
1129
|
-
return
|
|
1196
|
+
return e.prototype.createProxy = function(t) {
|
|
1197
|
+
var r = this, s = {}, o = !1, n, l = function() {
|
|
1198
|
+
return o || (n = t(r.wrap()), o = !0), n;
|
|
1130
1199
|
};
|
|
1131
|
-
return new Proxy(s, this.createHandler(
|
|
1132
|
-
},
|
|
1133
|
-
var r = {}, s = function(
|
|
1134
|
-
r[
|
|
1135
|
-
for (var
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
var
|
|
1139
|
-
return
|
|
1200
|
+
return new Proxy(s, this.createHandler(l));
|
|
1201
|
+
}, e.prototype.createHandler = function(t) {
|
|
1202
|
+
var r = {}, s = function(o) {
|
|
1203
|
+
r[o] = function() {
|
|
1204
|
+
for (var n = [], l = 0; l < arguments.length; l++)
|
|
1205
|
+
n[l] = arguments[l];
|
|
1206
|
+
n[0] = t();
|
|
1207
|
+
var w = Reflect[o];
|
|
1208
|
+
return w.apply(void 0, q(n));
|
|
1140
1209
|
};
|
|
1141
1210
|
};
|
|
1142
1211
|
return this.reflectMethods.forEach(s), r;
|
|
1143
|
-
},
|
|
1212
|
+
}, e;
|
|
1144
1213
|
})();
|
|
1145
|
-
function
|
|
1146
|
-
return typeof
|
|
1214
|
+
function Q(e) {
|
|
1215
|
+
return typeof e == "string" || typeof e == "symbol";
|
|
1147
1216
|
}
|
|
1148
|
-
function
|
|
1149
|
-
return typeof
|
|
1217
|
+
function Ut(e) {
|
|
1218
|
+
return typeof e == "object" && "token" in e && "multiple" in e;
|
|
1150
1219
|
}
|
|
1151
|
-
function
|
|
1152
|
-
return typeof
|
|
1220
|
+
function Ke(e) {
|
|
1221
|
+
return typeof e == "object" && "token" in e && "transform" in e;
|
|
1153
1222
|
}
|
|
1154
|
-
function
|
|
1155
|
-
return typeof
|
|
1223
|
+
function qt(e) {
|
|
1224
|
+
return typeof e == "function" || e instanceof ut;
|
|
1156
1225
|
}
|
|
1157
|
-
function
|
|
1158
|
-
return !!
|
|
1226
|
+
function le(e) {
|
|
1227
|
+
return !!e.useToken;
|
|
1159
1228
|
}
|
|
1160
|
-
function
|
|
1161
|
-
return
|
|
1229
|
+
function fe(e) {
|
|
1230
|
+
return e.useValue != null;
|
|
1162
1231
|
}
|
|
1163
|
-
function
|
|
1164
|
-
return
|
|
1232
|
+
function Zt(e) {
|
|
1233
|
+
return at(e) || fe(e) || le(e) || Oe(e);
|
|
1165
1234
|
}
|
|
1166
|
-
var
|
|
1167
|
-
function
|
|
1235
|
+
var Ae = (function() {
|
|
1236
|
+
function e() {
|
|
1168
1237
|
this._registryMap = /* @__PURE__ */ new Map();
|
|
1169
1238
|
}
|
|
1170
|
-
return
|
|
1239
|
+
return e.prototype.entries = function() {
|
|
1171
1240
|
return this._registryMap.entries();
|
|
1172
|
-
},
|
|
1173
|
-
return this.ensure(
|
|
1174
|
-
},
|
|
1175
|
-
this.ensure(
|
|
1176
|
-
var r = this._registryMap.get(
|
|
1241
|
+
}, e.prototype.getAll = function(t) {
|
|
1242
|
+
return this.ensure(t), this._registryMap.get(t);
|
|
1243
|
+
}, e.prototype.get = function(t) {
|
|
1244
|
+
this.ensure(t);
|
|
1245
|
+
var r = this._registryMap.get(t);
|
|
1177
1246
|
return r[r.length - 1] || null;
|
|
1178
|
-
},
|
|
1179
|
-
this.ensure(
|
|
1180
|
-
},
|
|
1181
|
-
this._registryMap.set(
|
|
1182
|
-
},
|
|
1183
|
-
return this.ensure(
|
|
1184
|
-
},
|
|
1247
|
+
}, e.prototype.set = function(t, r) {
|
|
1248
|
+
this.ensure(t), this._registryMap.get(t).push(r);
|
|
1249
|
+
}, e.prototype.setAll = function(t, r) {
|
|
1250
|
+
this._registryMap.set(t, r);
|
|
1251
|
+
}, e.prototype.has = function(t) {
|
|
1252
|
+
return this.ensure(t), this._registryMap.get(t).length > 0;
|
|
1253
|
+
}, e.prototype.clear = function() {
|
|
1185
1254
|
this._registryMap.clear();
|
|
1186
|
-
},
|
|
1187
|
-
this._registryMap.has(
|
|
1188
|
-
},
|
|
1189
|
-
})(),
|
|
1190
|
-
|
|
1191
|
-
function e() {
|
|
1192
|
-
return t !== null && t.apply(this, arguments) || this;
|
|
1193
|
-
}
|
|
1194
|
-
return e;
|
|
1195
|
-
})(le), U = /* @__PURE__ */ (function() {
|
|
1255
|
+
}, e.prototype.ensure = function(t) {
|
|
1256
|
+
this._registryMap.has(t) || this._registryMap.set(t, []);
|
|
1257
|
+
}, e;
|
|
1258
|
+
})(), Jt = (function(e) {
|
|
1259
|
+
Te(t, e);
|
|
1196
1260
|
function t() {
|
|
1197
|
-
|
|
1261
|
+
return e !== null && e.apply(this, arguments) || this;
|
|
1198
1262
|
}
|
|
1199
1263
|
return t;
|
|
1264
|
+
})(Ae), ae = /* @__PURE__ */ (function() {
|
|
1265
|
+
function e() {
|
|
1266
|
+
this.scopedResolutions = /* @__PURE__ */ new Map();
|
|
1267
|
+
}
|
|
1268
|
+
return e;
|
|
1200
1269
|
})();
|
|
1201
|
-
function
|
|
1202
|
-
if (
|
|
1203
|
-
return "at position #" +
|
|
1204
|
-
var r =
|
|
1205
|
-
return '"' + r + '" at position #' +
|
|
1270
|
+
function Yt(e, t) {
|
|
1271
|
+
if (e === null)
|
|
1272
|
+
return "at position #" + t;
|
|
1273
|
+
var r = e.split(",")[t].trim();
|
|
1274
|
+
return '"' + r + '" at position #' + t;
|
|
1206
1275
|
}
|
|
1207
|
-
function
|
|
1208
|
-
return r === void 0 && (r = " "),
|
|
1276
|
+
function Qt(e, t, r) {
|
|
1277
|
+
return r === void 0 && (r = " "), q([e], t.message.split(`
|
|
1209
1278
|
`).map(function(s) {
|
|
1210
1279
|
return r + s;
|
|
1211
1280
|
})).join(`
|
|
1212
1281
|
`);
|
|
1213
1282
|
}
|
|
1214
|
-
function
|
|
1215
|
-
var s =
|
|
1216
|
-
return
|
|
1283
|
+
function Xt(e, t, r) {
|
|
1284
|
+
var s = ce(e.toString().match(/constructor\(([\w, ]+)\)/) || [], 2), o = s[1], n = o === void 0 ? null : o, l = Yt(n, t);
|
|
1285
|
+
return Qt("Cannot inject the dependency " + l + ' of "' + e.name + '" constructor. Reason:', r);
|
|
1217
1286
|
}
|
|
1218
|
-
function
|
|
1219
|
-
if (typeof
|
|
1287
|
+
function Kt(e) {
|
|
1288
|
+
if (typeof e.dispose != "function")
|
|
1220
1289
|
return !1;
|
|
1221
|
-
var
|
|
1222
|
-
return !(
|
|
1290
|
+
var t = e.dispose;
|
|
1291
|
+
return !(t.length > 0);
|
|
1223
1292
|
}
|
|
1224
|
-
var
|
|
1225
|
-
|
|
1226
|
-
function
|
|
1227
|
-
return
|
|
1293
|
+
var er = (function(e) {
|
|
1294
|
+
Te(t, e);
|
|
1295
|
+
function t() {
|
|
1296
|
+
return e !== null && e.apply(this, arguments) || this;
|
|
1228
1297
|
}
|
|
1229
|
-
return
|
|
1230
|
-
})(
|
|
1231
|
-
|
|
1298
|
+
return t;
|
|
1299
|
+
})(Ae), tr = (function(e) {
|
|
1300
|
+
Te(t, e);
|
|
1301
|
+
function t() {
|
|
1302
|
+
return e !== null && e.apply(this, arguments) || this;
|
|
1303
|
+
}
|
|
1304
|
+
return t;
|
|
1305
|
+
})(Ae), rr = /* @__PURE__ */ (function() {
|
|
1232
1306
|
function e() {
|
|
1233
|
-
|
|
1307
|
+
this.preResolution = new er(), this.postResolution = new tr();
|
|
1234
1308
|
}
|
|
1235
1309
|
return e;
|
|
1236
|
-
})(
|
|
1237
|
-
function t
|
|
1238
|
-
this.
|
|
1310
|
+
})(), lt = /* @__PURE__ */ new Map(), nr = (function() {
|
|
1311
|
+
function e(t) {
|
|
1312
|
+
this.parent = t, this._registry = new Jt(), this.interceptors = new rr(), this.disposed = !1, this.disposables = /* @__PURE__ */ new Set();
|
|
1239
1313
|
}
|
|
1240
|
-
return t
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
if ((s.lifecycle === I.Singleton || s.lifecycle == I.ContainerScoped || s.lifecycle == I.ResolutionScoped) && (q(a) || ne(a)))
|
|
1258
|
-
throw new Error('Cannot use lifecycle "' + I[s.lifecycle] + '" with ValueProviders or FactoryProviders');
|
|
1259
|
-
return this._registry.set(e, { provider: a, options: s }), this;
|
|
1260
|
-
}, t.prototype.registerType = function(e, r) {
|
|
1261
|
-
return this.ensureNotDisposed(), j(r) ? this.register(e, {
|
|
1314
|
+
return e.prototype.register = function(t, r, s) {
|
|
1315
|
+
s === void 0 && (s = { lifecycle: D.Transient }), this.ensureNotDisposed();
|
|
1316
|
+
var o;
|
|
1317
|
+
if (Zt(r) ? o = r : o = { useClass: r }, le(o))
|
|
1318
|
+
for (var n = [t], l = o; l != null; ) {
|
|
1319
|
+
var w = l.useToken;
|
|
1320
|
+
if (n.includes(w))
|
|
1321
|
+
throw new Error("Token registration cycle detected! " + q(n, [w]).join(" -> "));
|
|
1322
|
+
n.push(w);
|
|
1323
|
+
var R = this._registry.get(w);
|
|
1324
|
+
R && le(R.provider) ? l = R.provider : l = null;
|
|
1325
|
+
}
|
|
1326
|
+
if ((s.lifecycle === D.Singleton || s.lifecycle == D.ContainerScoped || s.lifecycle == D.ResolutionScoped) && (fe(o) || Oe(o)))
|
|
1327
|
+
throw new Error('Cannot use lifecycle "' + D[s.lifecycle] + '" with ValueProviders or FactoryProviders');
|
|
1328
|
+
return this._registry.set(t, { provider: o, options: s }), this;
|
|
1329
|
+
}, e.prototype.registerType = function(t, r) {
|
|
1330
|
+
return this.ensureNotDisposed(), Q(r) ? this.register(t, {
|
|
1262
1331
|
useToken: r
|
|
1263
|
-
}) : this.register(
|
|
1332
|
+
}) : this.register(t, {
|
|
1264
1333
|
useClass: r
|
|
1265
1334
|
});
|
|
1266
|
-
},
|
|
1267
|
-
return this.ensureNotDisposed(), this.register(
|
|
1335
|
+
}, e.prototype.registerInstance = function(t, r) {
|
|
1336
|
+
return this.ensureNotDisposed(), this.register(t, {
|
|
1268
1337
|
useValue: r
|
|
1269
1338
|
});
|
|
1270
|
-
},
|
|
1271
|
-
if (this.ensureNotDisposed(),
|
|
1272
|
-
if (
|
|
1273
|
-
return this.register(
|
|
1339
|
+
}, e.prototype.registerSingleton = function(t, r) {
|
|
1340
|
+
if (this.ensureNotDisposed(), Q(t)) {
|
|
1341
|
+
if (Q(r))
|
|
1342
|
+
return this.register(t, {
|
|
1274
1343
|
useToken: r
|
|
1275
|
-
}, { lifecycle:
|
|
1344
|
+
}, { lifecycle: D.Singleton });
|
|
1276
1345
|
if (r)
|
|
1277
|
-
return this.register(
|
|
1346
|
+
return this.register(t, {
|
|
1278
1347
|
useClass: r
|
|
1279
|
-
}, { lifecycle:
|
|
1348
|
+
}, { lifecycle: D.Singleton });
|
|
1280
1349
|
throw new Error('Cannot register a type name as a singleton without a "to" token');
|
|
1281
1350
|
}
|
|
1282
|
-
var s =
|
|
1283
|
-
return r && !
|
|
1351
|
+
var s = t;
|
|
1352
|
+
return r && !Q(r) && (s = r), this.register(t, {
|
|
1284
1353
|
useClass: s
|
|
1285
|
-
}, { lifecycle:
|
|
1286
|
-
},
|
|
1287
|
-
r === void 0 && (r = new
|
|
1288
|
-
var
|
|
1289
|
-
if (!
|
|
1354
|
+
}, { lifecycle: D.Singleton });
|
|
1355
|
+
}, e.prototype.resolve = function(t, r, s) {
|
|
1356
|
+
r === void 0 && (r = new ae()), s === void 0 && (s = !1), this.ensureNotDisposed();
|
|
1357
|
+
var o = this.getRegistration(t);
|
|
1358
|
+
if (!o && Q(t)) {
|
|
1290
1359
|
if (s)
|
|
1291
1360
|
return;
|
|
1292
|
-
throw new Error('Attempted to resolve unregistered dependency token: "' +
|
|
1361
|
+
throw new Error('Attempted to resolve unregistered dependency token: "' + t.toString() + '"');
|
|
1293
1362
|
}
|
|
1294
|
-
if (this.executePreResolutionInterceptor(
|
|
1295
|
-
var
|
|
1296
|
-
return this.executePostResolutionInterceptor(
|
|
1363
|
+
if (this.executePreResolutionInterceptor(t, "Single"), o) {
|
|
1364
|
+
var n = this.resolveRegistration(o, r);
|
|
1365
|
+
return this.executePostResolutionInterceptor(t, n, "Single"), n;
|
|
1297
1366
|
}
|
|
1298
|
-
if (
|
|
1299
|
-
var
|
|
1300
|
-
return this.executePostResolutionInterceptor(
|
|
1367
|
+
if (qt(t)) {
|
|
1368
|
+
var n = this.construct(t, r);
|
|
1369
|
+
return this.executePostResolutionInterceptor(t, n, "Single"), n;
|
|
1301
1370
|
}
|
|
1302
1371
|
throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.");
|
|
1303
|
-
},
|
|
1304
|
-
var s,
|
|
1305
|
-
if (this.interceptors.preResolution.has(
|
|
1306
|
-
var
|
|
1372
|
+
}, e.prototype.executePreResolutionInterceptor = function(t, r) {
|
|
1373
|
+
var s, o;
|
|
1374
|
+
if (this.interceptors.preResolution.has(t)) {
|
|
1375
|
+
var n = [];
|
|
1307
1376
|
try {
|
|
1308
|
-
for (var
|
|
1309
|
-
var
|
|
1310
|
-
|
|
1377
|
+
for (var l = oe(this.interceptors.preResolution.getAll(t)), w = l.next(); !w.done; w = l.next()) {
|
|
1378
|
+
var R = w.value;
|
|
1379
|
+
R.options.frequency != "Once" && n.push(R), R.callback(t, r);
|
|
1311
1380
|
}
|
|
1312
|
-
} catch (
|
|
1313
|
-
s = { error:
|
|
1381
|
+
} catch (_) {
|
|
1382
|
+
s = { error: _ };
|
|
1314
1383
|
} finally {
|
|
1315
1384
|
try {
|
|
1316
|
-
|
|
1385
|
+
w && !w.done && (o = l.return) && o.call(l);
|
|
1317
1386
|
} finally {
|
|
1318
1387
|
if (s) throw s.error;
|
|
1319
1388
|
}
|
|
1320
1389
|
}
|
|
1321
|
-
this.interceptors.preResolution.setAll(
|
|
1390
|
+
this.interceptors.preResolution.setAll(t, n);
|
|
1322
1391
|
}
|
|
1323
|
-
},
|
|
1324
|
-
var
|
|
1325
|
-
if (this.interceptors.postResolution.has(
|
|
1326
|
-
var
|
|
1392
|
+
}, e.prototype.executePostResolutionInterceptor = function(t, r, s) {
|
|
1393
|
+
var o, n;
|
|
1394
|
+
if (this.interceptors.postResolution.has(t)) {
|
|
1395
|
+
var l = [];
|
|
1327
1396
|
try {
|
|
1328
|
-
for (var
|
|
1329
|
-
var
|
|
1330
|
-
|
|
1397
|
+
for (var w = oe(this.interceptors.postResolution.getAll(t)), R = w.next(); !R.done; R = w.next()) {
|
|
1398
|
+
var _ = R.value;
|
|
1399
|
+
_.options.frequency != "Once" && l.push(_), _.callback(t, r, s);
|
|
1331
1400
|
}
|
|
1332
|
-
} catch (
|
|
1333
|
-
|
|
1401
|
+
} catch (S) {
|
|
1402
|
+
o = { error: S };
|
|
1334
1403
|
} finally {
|
|
1335
1404
|
try {
|
|
1336
|
-
|
|
1405
|
+
R && !R.done && (n = w.return) && n.call(w);
|
|
1337
1406
|
} finally {
|
|
1338
|
-
if (
|
|
1407
|
+
if (o) throw o.error;
|
|
1339
1408
|
}
|
|
1340
1409
|
}
|
|
1341
|
-
this.interceptors.postResolution.setAll(
|
|
1410
|
+
this.interceptors.postResolution.setAll(t, l);
|
|
1342
1411
|
}
|
|
1343
|
-
},
|
|
1344
|
-
if (this.ensureNotDisposed(),
|
|
1345
|
-
return r.scopedResolutions.get(
|
|
1346
|
-
var s =
|
|
1347
|
-
return
|
|
1348
|
-
},
|
|
1349
|
-
var
|
|
1350
|
-
r === void 0 && (r = new
|
|
1351
|
-
var
|
|
1352
|
-
if (!
|
|
1412
|
+
}, e.prototype.resolveRegistration = function(t, r) {
|
|
1413
|
+
if (this.ensureNotDisposed(), t.options.lifecycle === D.ResolutionScoped && r.scopedResolutions.has(t))
|
|
1414
|
+
return r.scopedResolutions.get(t);
|
|
1415
|
+
var s = t.options.lifecycle === D.Singleton, o = t.options.lifecycle === D.ContainerScoped, n = s || o, l;
|
|
1416
|
+
return fe(t.provider) ? l = t.provider.useValue : le(t.provider) ? l = n ? t.instance || (t.instance = this.resolve(t.provider.useToken, r)) : this.resolve(t.provider.useToken, r) : at(t.provider) ? l = n ? t.instance || (t.instance = this.construct(t.provider.useClass, r)) : this.construct(t.provider.useClass, r) : Oe(t.provider) ? l = t.provider.useFactory(this) : l = this.construct(t.provider, r), t.options.lifecycle === D.ResolutionScoped && r.scopedResolutions.set(t, l), l;
|
|
1417
|
+
}, e.prototype.resolveAll = function(t, r, s) {
|
|
1418
|
+
var o = this;
|
|
1419
|
+
r === void 0 && (r = new ae()), s === void 0 && (s = !1), this.ensureNotDisposed();
|
|
1420
|
+
var n = this.getAllRegistrations(t);
|
|
1421
|
+
if (!n && Q(t)) {
|
|
1353
1422
|
if (s)
|
|
1354
1423
|
return [];
|
|
1355
|
-
throw new Error('Attempted to resolve unregistered dependency token: "' +
|
|
1424
|
+
throw new Error('Attempted to resolve unregistered dependency token: "' + t.toString() + '"');
|
|
1356
1425
|
}
|
|
1357
|
-
if (this.executePreResolutionInterceptor(
|
|
1358
|
-
var
|
|
1359
|
-
return
|
|
1426
|
+
if (this.executePreResolutionInterceptor(t, "All"), n) {
|
|
1427
|
+
var l = n.map(function(R) {
|
|
1428
|
+
return o.resolveRegistration(R, r);
|
|
1360
1429
|
});
|
|
1361
|
-
return this.executePostResolutionInterceptor(
|
|
1430
|
+
return this.executePostResolutionInterceptor(t, l, "All"), l;
|
|
1362
1431
|
}
|
|
1363
|
-
var
|
|
1364
|
-
return this.executePostResolutionInterceptor(
|
|
1365
|
-
},
|
|
1366
|
-
return r === void 0 && (r = !1), this.ensureNotDisposed(), this._registry.has(
|
|
1367
|
-
},
|
|
1432
|
+
var w = [this.construct(t, r)];
|
|
1433
|
+
return this.executePostResolutionInterceptor(t, w, "All"), w;
|
|
1434
|
+
}, e.prototype.isRegistered = function(t, r) {
|
|
1435
|
+
return r === void 0 && (r = !1), this.ensureNotDisposed(), this._registry.has(t) || r && (this.parent || !1) && this.parent.isRegistered(t, !0);
|
|
1436
|
+
}, e.prototype.reset = function() {
|
|
1368
1437
|
this.ensureNotDisposed(), this._registry.clear(), this.interceptors.preResolution.clear(), this.interceptors.postResolution.clear();
|
|
1369
|
-
},
|
|
1370
|
-
var
|
|
1438
|
+
}, e.prototype.clearInstances = function() {
|
|
1439
|
+
var t, r;
|
|
1371
1440
|
this.ensureNotDisposed();
|
|
1372
1441
|
try {
|
|
1373
|
-
for (var s =
|
|
1374
|
-
var
|
|
1375
|
-
this._registry.setAll(
|
|
1376
|
-
return !
|
|
1377
|
-
}).map(function(
|
|
1378
|
-
return
|
|
1442
|
+
for (var s = oe(this._registry.entries()), o = s.next(); !o.done; o = s.next()) {
|
|
1443
|
+
var n = ce(o.value, 2), l = n[0], w = n[1];
|
|
1444
|
+
this._registry.setAll(l, w.filter(function(R) {
|
|
1445
|
+
return !fe(R.provider);
|
|
1446
|
+
}).map(function(R) {
|
|
1447
|
+
return R.instance = void 0, R;
|
|
1379
1448
|
}));
|
|
1380
1449
|
}
|
|
1381
|
-
} catch (
|
|
1382
|
-
|
|
1450
|
+
} catch (R) {
|
|
1451
|
+
t = { error: R };
|
|
1383
1452
|
} finally {
|
|
1384
1453
|
try {
|
|
1385
|
-
|
|
1454
|
+
o && !o.done && (r = s.return) && r.call(s);
|
|
1386
1455
|
} finally {
|
|
1387
|
-
if (
|
|
1456
|
+
if (t) throw t.error;
|
|
1388
1457
|
}
|
|
1389
1458
|
}
|
|
1390
|
-
},
|
|
1391
|
-
var
|
|
1459
|
+
}, e.prototype.createChildContainer = function() {
|
|
1460
|
+
var t, r;
|
|
1392
1461
|
this.ensureNotDisposed();
|
|
1393
|
-
var s = new
|
|
1462
|
+
var s = new e(this);
|
|
1394
1463
|
try {
|
|
1395
|
-
for (var
|
|
1396
|
-
var
|
|
1397
|
-
|
|
1398
|
-
var
|
|
1399
|
-
return
|
|
1400
|
-
}) && s._registry.setAll(
|
|
1401
|
-
return
|
|
1402
|
-
provider:
|
|
1403
|
-
options:
|
|
1404
|
-
} :
|
|
1464
|
+
for (var o = oe(this._registry.entries()), n = o.next(); !n.done; n = o.next()) {
|
|
1465
|
+
var l = ce(n.value, 2), w = l[0], R = l[1];
|
|
1466
|
+
R.some(function(_) {
|
|
1467
|
+
var S = _.options;
|
|
1468
|
+
return S.lifecycle === D.ContainerScoped;
|
|
1469
|
+
}) && s._registry.setAll(w, R.map(function(_) {
|
|
1470
|
+
return _.options.lifecycle === D.ContainerScoped ? {
|
|
1471
|
+
provider: _.provider,
|
|
1472
|
+
options: _.options
|
|
1473
|
+
} : _;
|
|
1405
1474
|
}));
|
|
1406
1475
|
}
|
|
1407
|
-
} catch (
|
|
1408
|
-
|
|
1476
|
+
} catch (_) {
|
|
1477
|
+
t = { error: _ };
|
|
1409
1478
|
} finally {
|
|
1410
1479
|
try {
|
|
1411
|
-
|
|
1480
|
+
n && !n.done && (r = o.return) && r.call(o);
|
|
1412
1481
|
} finally {
|
|
1413
|
-
if (
|
|
1482
|
+
if (t) throw t.error;
|
|
1414
1483
|
}
|
|
1415
1484
|
}
|
|
1416
1485
|
return s;
|
|
1417
|
-
},
|
|
1418
|
-
s === void 0 && (s = { frequency: "Always" }), this.interceptors.preResolution.set(
|
|
1486
|
+
}, e.prototype.beforeResolution = function(t, r, s) {
|
|
1487
|
+
s === void 0 && (s = { frequency: "Always" }), this.interceptors.preResolution.set(t, {
|
|
1419
1488
|
callback: r,
|
|
1420
1489
|
options: s
|
|
1421
1490
|
});
|
|
1422
|
-
},
|
|
1423
|
-
s === void 0 && (s = { frequency: "Always" }), this.interceptors.postResolution.set(
|
|
1491
|
+
}, e.prototype.afterResolution = function(t, r, s) {
|
|
1492
|
+
s === void 0 && (s = { frequency: "Always" }), this.interceptors.postResolution.set(t, {
|
|
1424
1493
|
callback: r,
|
|
1425
1494
|
options: s
|
|
1426
1495
|
});
|
|
1427
|
-
},
|
|
1428
|
-
return
|
|
1429
|
-
var
|
|
1430
|
-
return
|
|
1496
|
+
}, e.prototype.dispose = function() {
|
|
1497
|
+
return Gt(this, void 0, void 0, function() {
|
|
1498
|
+
var t;
|
|
1499
|
+
return Vt(this, function(r) {
|
|
1431
1500
|
switch (r.label) {
|
|
1432
1501
|
case 0:
|
|
1433
|
-
return this.disposed = !0,
|
|
1434
|
-
var
|
|
1435
|
-
|
|
1436
|
-
}), [4, Promise.all(
|
|
1502
|
+
return this.disposed = !0, t = [], this.disposables.forEach(function(s) {
|
|
1503
|
+
var o = s.dispose();
|
|
1504
|
+
o && t.push(o);
|
|
1505
|
+
}), [4, Promise.all(t)];
|
|
1437
1506
|
case 1:
|
|
1438
1507
|
return r.sent(), [2];
|
|
1439
1508
|
}
|
|
1440
1509
|
});
|
|
1441
1510
|
});
|
|
1442
|
-
},
|
|
1443
|
-
return this.isRegistered(
|
|
1444
|
-
},
|
|
1445
|
-
return this.isRegistered(
|
|
1446
|
-
},
|
|
1511
|
+
}, e.prototype.getRegistration = function(t) {
|
|
1512
|
+
return this.isRegistered(t) ? this._registry.get(t) : this.parent ? this.parent.getRegistration(t) : null;
|
|
1513
|
+
}, e.prototype.getAllRegistrations = function(t) {
|
|
1514
|
+
return this.isRegistered(t) ? this._registry.getAll(t) : this.parent ? this.parent.getAllRegistrations(t) : null;
|
|
1515
|
+
}, e.prototype.construct = function(t, r) {
|
|
1447
1516
|
var s = this;
|
|
1448
|
-
if (
|
|
1449
|
-
return
|
|
1450
|
-
return s.resolve(
|
|
1517
|
+
if (t instanceof ut)
|
|
1518
|
+
return t.createProxy(function(n) {
|
|
1519
|
+
return s.resolve(n, r);
|
|
1451
1520
|
});
|
|
1452
|
-
var
|
|
1453
|
-
var
|
|
1454
|
-
if (!
|
|
1455
|
-
if (
|
|
1456
|
-
return new
|
|
1457
|
-
throw new Error('TypeInfo not known for "' +
|
|
1458
|
-
}
|
|
1459
|
-
var
|
|
1460
|
-
return new (
|
|
1521
|
+
var o = (function() {
|
|
1522
|
+
var n = lt.get(t);
|
|
1523
|
+
if (!n || n.length === 0) {
|
|
1524
|
+
if (t.length === 0)
|
|
1525
|
+
return new t();
|
|
1526
|
+
throw new Error('TypeInfo not known for "' + t.name + '"');
|
|
1527
|
+
}
|
|
1528
|
+
var l = n.map(s.resolveParams(r, t));
|
|
1529
|
+
return new (t.bind.apply(t, q([void 0], l)))();
|
|
1461
1530
|
})();
|
|
1462
|
-
return
|
|
1463
|
-
},
|
|
1531
|
+
return Kt(o) && this.disposables.add(o), o;
|
|
1532
|
+
}, e.prototype.resolveParams = function(t, r) {
|
|
1464
1533
|
var s = this;
|
|
1465
|
-
return function(
|
|
1466
|
-
var
|
|
1534
|
+
return function(o, n) {
|
|
1535
|
+
var l, w, R;
|
|
1467
1536
|
try {
|
|
1468
|
-
return
|
|
1469
|
-
} catch (
|
|
1470
|
-
throw new Error(
|
|
1537
|
+
return Ut(o) ? Ke(o) ? o.multiple ? (l = s.resolve(o.transform)).transform.apply(l, q([s.resolveAll(o.token, new ae(), o.isOptional)], o.transformArgs)) : (w = s.resolve(o.transform)).transform.apply(w, q([s.resolve(o.token, t, o.isOptional)], o.transformArgs)) : o.multiple ? s.resolveAll(o.token, new ae(), o.isOptional) : s.resolve(o.token, t, o.isOptional) : Ke(o) ? (R = s.resolve(o.transform, t)).transform.apply(R, q([s.resolve(o.token, t)], o.transformArgs)) : s.resolve(o, t);
|
|
1538
|
+
} catch (_) {
|
|
1539
|
+
throw new Error(Xt(r, n, _));
|
|
1471
1540
|
}
|
|
1472
1541
|
};
|
|
1473
|
-
},
|
|
1542
|
+
}, e.prototype.ensureNotDisposed = function() {
|
|
1474
1543
|
if (this.disposed)
|
|
1475
1544
|
throw new Error("This container has been disposed, you cannot interact with a disposed container");
|
|
1476
|
-
},
|
|
1477
|
-
})(),
|
|
1478
|
-
function
|
|
1545
|
+
}, e;
|
|
1546
|
+
})(), ir = new nr();
|
|
1547
|
+
function W(e, t) {
|
|
1479
1548
|
var r = {
|
|
1480
|
-
token:
|
|
1549
|
+
token: e,
|
|
1481
1550
|
multiple: !1,
|
|
1482
|
-
isOptional:
|
|
1551
|
+
isOptional: t
|
|
1483
1552
|
};
|
|
1484
|
-
return
|
|
1553
|
+
return ot(r);
|
|
1485
1554
|
}
|
|
1486
|
-
function
|
|
1487
|
-
return function(
|
|
1488
|
-
|
|
1555
|
+
function z(e) {
|
|
1556
|
+
return function(t) {
|
|
1557
|
+
lt.set(t, zt(t));
|
|
1489
1558
|
};
|
|
1490
1559
|
}
|
|
1491
|
-
function
|
|
1560
|
+
function ft(e, t) {
|
|
1492
1561
|
var r = {
|
|
1493
|
-
token:
|
|
1562
|
+
token: e,
|
|
1494
1563
|
multiple: !0,
|
|
1495
|
-
isOptional:
|
|
1564
|
+
isOptional: t
|
|
1496
1565
|
};
|
|
1497
|
-
return
|
|
1566
|
+
return ot(r);
|
|
1498
1567
|
}
|
|
1499
1568
|
if (typeof Reflect > "u" || !Reflect.getMetadata)
|
|
1500
1569
|
throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);
|
|
1501
|
-
var
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1570
|
+
var ue = { exports: {} }, et;
|
|
1571
|
+
function sr() {
|
|
1572
|
+
if (et) return ue.exports;
|
|
1573
|
+
et = 1;
|
|
1574
|
+
var e = typeof Reflect == "object" ? Reflect : null, t = e && typeof e.apply == "function" ? e.apply : function(f, d, g) {
|
|
1575
|
+
return Function.prototype.apply.call(f, d, g);
|
|
1576
|
+
}, r;
|
|
1577
|
+
e && typeof e.ownKeys == "function" ? r = e.ownKeys : Object.getOwnPropertySymbols ? r = function(f) {
|
|
1578
|
+
return Object.getOwnPropertyNames(f).concat(Object.getOwnPropertySymbols(f));
|
|
1579
|
+
} : r = function(f) {
|
|
1580
|
+
return Object.getOwnPropertyNames(f);
|
|
1581
|
+
};
|
|
1582
|
+
function s(c) {
|
|
1583
|
+
console && console.warn && console.warn(c);
|
|
1584
|
+
}
|
|
1585
|
+
var o = Number.isNaN || function(f) {
|
|
1586
|
+
return f !== f;
|
|
1587
|
+
};
|
|
1588
|
+
function n() {
|
|
1589
|
+
n.init.call(this);
|
|
1590
|
+
}
|
|
1591
|
+
ue.exports = n, ue.exports.once = J, n.EventEmitter = n, n.prototype._events = void 0, n.prototype._eventsCount = 0, n.prototype._maxListeners = void 0;
|
|
1592
|
+
var l = 10;
|
|
1593
|
+
function w(c) {
|
|
1594
|
+
if (typeof c != "function")
|
|
1595
|
+
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof c);
|
|
1596
|
+
}
|
|
1597
|
+
Object.defineProperty(n, "defaultMaxListeners", {
|
|
1598
|
+
enumerable: !0,
|
|
1599
|
+
get: function() {
|
|
1600
|
+
return l;
|
|
1601
|
+
},
|
|
1602
|
+
set: function(c) {
|
|
1603
|
+
if (typeof c != "number" || c < 0 || o(c))
|
|
1604
|
+
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + c + ".");
|
|
1605
|
+
l = c;
|
|
1606
|
+
}
|
|
1607
|
+
}), n.init = function() {
|
|
1608
|
+
(this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
1609
|
+
}, n.prototype.setMaxListeners = function(f) {
|
|
1610
|
+
if (typeof f != "number" || f < 0 || o(f))
|
|
1611
|
+
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + f + ".");
|
|
1612
|
+
return this._maxListeners = f, this;
|
|
1613
|
+
};
|
|
1614
|
+
function R(c) {
|
|
1615
|
+
return c._maxListeners === void 0 ? n.defaultMaxListeners : c._maxListeners;
|
|
1616
|
+
}
|
|
1617
|
+
n.prototype.getMaxListeners = function() {
|
|
1618
|
+
return R(this);
|
|
1619
|
+
}, n.prototype.emit = function(f) {
|
|
1620
|
+
for (var d = [], g = 1; g < arguments.length; g++) d.push(arguments[g]);
|
|
1621
|
+
var O = f === "error", x = this._events;
|
|
1622
|
+
if (x !== void 0)
|
|
1623
|
+
O = O && x.error === void 0;
|
|
1624
|
+
else if (!O)
|
|
1625
|
+
return !1;
|
|
1626
|
+
if (O) {
|
|
1627
|
+
var P;
|
|
1628
|
+
if (d.length > 0 && (P = d[0]), P instanceof Error)
|
|
1629
|
+
throw P;
|
|
1630
|
+
var H = new Error("Unhandled error." + (P ? " (" + P.message + ")" : ""));
|
|
1631
|
+
throw H.context = P, H;
|
|
1632
|
+
}
|
|
1633
|
+
var U = x[f];
|
|
1634
|
+
if (U === void 0)
|
|
1635
|
+
return !1;
|
|
1636
|
+
if (typeof U == "function")
|
|
1637
|
+
t(U, this, d);
|
|
1638
|
+
else
|
|
1639
|
+
for (var ie = U.length, ve = Z(U, ie), g = 0; g < ie; ++g)
|
|
1640
|
+
t(ve[g], this, d);
|
|
1641
|
+
return !0;
|
|
1642
|
+
};
|
|
1643
|
+
function _(c, f, d, g) {
|
|
1644
|
+
var O, x, P;
|
|
1645
|
+
if (w(d), x = c._events, x === void 0 ? (x = c._events = /* @__PURE__ */ Object.create(null), c._eventsCount = 0) : (x.newListener !== void 0 && (c.emit(
|
|
1646
|
+
"newListener",
|
|
1647
|
+
f,
|
|
1648
|
+
d.listener ? d.listener : d
|
|
1649
|
+
), x = c._events), P = x[f]), P === void 0)
|
|
1650
|
+
P = x[f] = d, ++c._eventsCount;
|
|
1651
|
+
else if (typeof P == "function" ? P = x[f] = g ? [d, P] : [P, d] : g ? P.unshift(d) : P.push(d), O = R(c), O > 0 && P.length > O && !P.warned) {
|
|
1652
|
+
P.warned = !0;
|
|
1653
|
+
var H = new Error("Possible EventEmitter memory leak detected. " + P.length + " " + String(f) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
1654
|
+
H.name = "MaxListenersExceededWarning", H.emitter = c, H.type = f, H.count = P.length, s(H);
|
|
1655
|
+
}
|
|
1656
|
+
return c;
|
|
1657
|
+
}
|
|
1658
|
+
n.prototype.addListener = function(f, d) {
|
|
1659
|
+
return _(this, f, d, !1);
|
|
1660
|
+
}, n.prototype.on = n.prototype.addListener, n.prototype.prependListener = function(f, d) {
|
|
1661
|
+
return _(this, f, d, !0);
|
|
1662
|
+
};
|
|
1663
|
+
function S() {
|
|
1664
|
+
if (!this.fired)
|
|
1665
|
+
return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
|
|
1666
|
+
}
|
|
1667
|
+
function j(c, f, d) {
|
|
1668
|
+
var g = { fired: !1, wrapFn: void 0, target: c, type: f, listener: d }, O = S.bind(g);
|
|
1669
|
+
return O.listener = d, g.wrapFn = O, O;
|
|
1670
|
+
}
|
|
1671
|
+
n.prototype.once = function(f, d) {
|
|
1672
|
+
return w(d), this.on(f, j(this, f, d)), this;
|
|
1673
|
+
}, n.prototype.prependOnceListener = function(f, d) {
|
|
1674
|
+
return w(d), this.prependListener(f, j(this, f, d)), this;
|
|
1675
|
+
}, n.prototype.removeListener = function(f, d) {
|
|
1676
|
+
var g, O, x, P, H;
|
|
1677
|
+
if (w(d), O = this._events, O === void 0)
|
|
1678
|
+
return this;
|
|
1679
|
+
if (g = O[f], g === void 0)
|
|
1680
|
+
return this;
|
|
1681
|
+
if (g === d || g.listener === d)
|
|
1682
|
+
--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete O[f], O.removeListener && this.emit("removeListener", f, g.listener || d));
|
|
1683
|
+
else if (typeof g != "function") {
|
|
1684
|
+
for (x = -1, P = g.length - 1; P >= 0; P--)
|
|
1685
|
+
if (g[P] === d || g[P].listener === d) {
|
|
1686
|
+
H = g[P].listener, x = P;
|
|
1687
|
+
break;
|
|
1688
|
+
}
|
|
1689
|
+
if (x < 0)
|
|
1690
|
+
return this;
|
|
1691
|
+
x === 0 ? g.shift() : K(g, x), g.length === 1 && (O[f] = g[0]), O.removeListener !== void 0 && this.emit("removeListener", f, H || d);
|
|
1692
|
+
}
|
|
1693
|
+
return this;
|
|
1694
|
+
}, n.prototype.off = n.prototype.removeListener, n.prototype.removeAllListeners = function(f) {
|
|
1695
|
+
var d, g, O;
|
|
1696
|
+
if (g = this._events, g === void 0)
|
|
1697
|
+
return this;
|
|
1698
|
+
if (g.removeListener === void 0)
|
|
1699
|
+
return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : g[f] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete g[f]), this;
|
|
1700
|
+
if (arguments.length === 0) {
|
|
1701
|
+
var x = Object.keys(g), P;
|
|
1702
|
+
for (O = 0; O < x.length; ++O)
|
|
1703
|
+
P = x[O], P !== "removeListener" && this.removeAllListeners(P);
|
|
1704
|
+
return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
|
|
1705
|
+
}
|
|
1706
|
+
if (d = g[f], typeof d == "function")
|
|
1707
|
+
this.removeListener(f, d);
|
|
1708
|
+
else if (d !== void 0)
|
|
1709
|
+
for (O = d.length - 1; O >= 0; O--)
|
|
1710
|
+
this.removeListener(f, d[O]);
|
|
1711
|
+
return this;
|
|
1712
|
+
};
|
|
1713
|
+
function B(c, f, d) {
|
|
1714
|
+
var g = c._events;
|
|
1715
|
+
if (g === void 0)
|
|
1716
|
+
return [];
|
|
1717
|
+
var O = g[f];
|
|
1718
|
+
return O === void 0 ? [] : typeof O == "function" ? d ? [O.listener || O] : [O] : d ? V(O) : Z(O, O.length);
|
|
1719
|
+
}
|
|
1720
|
+
n.prototype.listeners = function(f) {
|
|
1721
|
+
return B(this, f, !0);
|
|
1722
|
+
}, n.prototype.rawListeners = function(f) {
|
|
1723
|
+
return B(this, f, !1);
|
|
1724
|
+
}, n.listenerCount = function(c, f) {
|
|
1725
|
+
return typeof c.listenerCount == "function" ? c.listenerCount(f) : G.call(c, f);
|
|
1726
|
+
}, n.prototype.listenerCount = G;
|
|
1727
|
+
function G(c) {
|
|
1728
|
+
var f = this._events;
|
|
1729
|
+
if (f !== void 0) {
|
|
1730
|
+
var d = f[c];
|
|
1731
|
+
if (typeof d == "function")
|
|
1732
|
+
return 1;
|
|
1733
|
+
if (d !== void 0)
|
|
1734
|
+
return d.length;
|
|
1735
|
+
}
|
|
1736
|
+
return 0;
|
|
1737
|
+
}
|
|
1738
|
+
n.prototype.eventNames = function() {
|
|
1739
|
+
return this._eventsCount > 0 ? r(this._events) : [];
|
|
1740
|
+
};
|
|
1741
|
+
function Z(c, f) {
|
|
1742
|
+
for (var d = new Array(f), g = 0; g < f; ++g)
|
|
1743
|
+
d[g] = c[g];
|
|
1744
|
+
return d;
|
|
1745
|
+
}
|
|
1746
|
+
function K(c, f) {
|
|
1747
|
+
for (; f + 1 < c.length; f++)
|
|
1748
|
+
c[f] = c[f + 1];
|
|
1749
|
+
c.pop();
|
|
1750
|
+
}
|
|
1751
|
+
function V(c) {
|
|
1752
|
+
for (var f = new Array(c.length), d = 0; d < f.length; ++d)
|
|
1753
|
+
f[d] = c[d].listener || c[d];
|
|
1754
|
+
return f;
|
|
1755
|
+
}
|
|
1756
|
+
function J(c, f) {
|
|
1757
|
+
return new Promise(function(d, g) {
|
|
1758
|
+
function O(P) {
|
|
1759
|
+
c.removeListener(f, x), g(P);
|
|
1760
|
+
}
|
|
1761
|
+
function x() {
|
|
1762
|
+
typeof c.removeListener == "function" && c.removeListener("error", O), d([].slice.call(arguments));
|
|
1763
|
+
}
|
|
1764
|
+
ne(c, f, x, { once: !0 }), f !== "error" && re(c, O, { once: !0 });
|
|
1765
|
+
});
|
|
1766
|
+
}
|
|
1767
|
+
function re(c, f, d) {
|
|
1768
|
+
typeof c.on == "function" && ne(c, "error", f, d);
|
|
1769
|
+
}
|
|
1770
|
+
function ne(c, f, d, g) {
|
|
1771
|
+
if (typeof c.on == "function")
|
|
1772
|
+
g.once ? c.once(f, d) : c.on(f, d);
|
|
1773
|
+
else if (typeof c.addEventListener == "function")
|
|
1774
|
+
c.addEventListener(f, function O(x) {
|
|
1775
|
+
g.once && c.removeEventListener(f, O), d(x);
|
|
1776
|
+
});
|
|
1777
|
+
else
|
|
1778
|
+
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof c);
|
|
1779
|
+
}
|
|
1780
|
+
return ue.exports;
|
|
1781
|
+
}
|
|
1782
|
+
var or = sr(), ar = Object.getOwnPropertyDescriptor, ur = (e, t, r, s) => {
|
|
1783
|
+
for (var o = s > 1 ? void 0 : s ? ar(t, r) : t, n = e.length - 1, l; n >= 0; n--)
|
|
1784
|
+
(l = e[n]) && (o = l(o) || o);
|
|
1785
|
+
return o;
|
|
1505
1786
|
};
|
|
1506
|
-
let
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
raycast;
|
|
1511
|
-
/** Курсор мыши для остлеживания наведения на 3D-модель */
|
|
1512
|
-
mouse;
|
|
1513
|
-
/** Были ли зарегистрированы обработчики событий для мыши */
|
|
1514
|
-
isEventListenersAdded;
|
|
1515
|
-
/**
|
|
1516
|
-
* Инициализация сцены редактора.
|
|
1517
|
-
* Создает сетку, оси координат и orbit-контроллер.
|
|
1518
|
-
* @param canvas - HTMLCanvasElement для рендеринга
|
|
1519
|
-
*/
|
|
1520
|
-
constructor(t) {
|
|
1521
|
-
super(t);
|
|
1522
|
-
const e = new mt(this.gl.gl, { size: 10, divisions: 10 });
|
|
1523
|
-
e.position.y = -1e-3, e.setParent(this.scene), new wt(this.gl.gl, { size: 6, symmetric: !0 }).setParent(this.scene), this.orbit = new St(this.camera, { element: this.canvas }), this.raycast = new Mt(), this.mouse = new _t(), this.isEventListenersAdded = !1;
|
|
1787
|
+
let Re = class {
|
|
1788
|
+
_emitter;
|
|
1789
|
+
constructor() {
|
|
1790
|
+
this._emitter = new or.EventEmitter();
|
|
1524
1791
|
}
|
|
1525
|
-
/**
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
* @param mesh - Фигура для добавления в сцену.
|
|
1529
|
-
* @internal
|
|
1530
|
-
*/
|
|
1531
|
-
addMesh(t) {
|
|
1532
|
-
this.scene.addChild(t);
|
|
1792
|
+
/** Публикация события */
|
|
1793
|
+
emit(e, t) {
|
|
1794
|
+
this._emitter.emit(e, t);
|
|
1533
1795
|
}
|
|
1534
|
-
/**
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
* @returns Контекст WebGL (OGLRenderingContext) текущей сцены.
|
|
1538
|
-
* @internal
|
|
1539
|
-
*/
|
|
1540
|
-
getContext() {
|
|
1541
|
-
return this.gl.gl;
|
|
1796
|
+
/** Подписка на событие */
|
|
1797
|
+
on(e, t) {
|
|
1798
|
+
this._emitter.on(e, t);
|
|
1542
1799
|
}
|
|
1543
|
-
/**
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
* @param mesh - Фигура для удаления со сцены.
|
|
1547
|
-
* @internal
|
|
1548
|
-
*/
|
|
1549
|
-
removeMesh(t) {
|
|
1550
|
-
this.scene.removeChild(t);
|
|
1800
|
+
/** Отписка от события */
|
|
1801
|
+
off(e, t) {
|
|
1802
|
+
this._emitter.off(e, t);
|
|
1551
1803
|
}
|
|
1804
|
+
};
|
|
1805
|
+
Re = ur([
|
|
1806
|
+
z()
|
|
1807
|
+
], Re);
|
|
1808
|
+
var X = /* @__PURE__ */ ((e) => (e.SelectHover = "select.hover", e.SelectClick = "select.click", e))(X || {}), lr = Object.getOwnPropertyDescriptor, fr = (e, t, r, s) => {
|
|
1809
|
+
for (var o = s > 1 ? void 0 : s ? lr(t, r) : t, n = e.length - 1, l; n >= 0; n--)
|
|
1810
|
+
(l = e[n]) && (o = l(o) || o);
|
|
1811
|
+
return o;
|
|
1812
|
+
}, tt = (e, t) => (r, s) => t(r, s, e);
|
|
1813
|
+
let Pe = class extends st {
|
|
1552
1814
|
/**
|
|
1553
|
-
*
|
|
1554
|
-
*
|
|
1555
|
-
* @returns Массив текущих фигур.
|
|
1556
|
-
* @internal
|
|
1815
|
+
* Инициализация сцены редактора.
|
|
1816
|
+
* Создает сетку, оси координат и orbit-контроллер.
|
|
1557
1817
|
*/
|
|
1558
|
-
|
|
1559
|
-
|
|
1818
|
+
constructor(e, t) {
|
|
1819
|
+
super(e), this._canvas = e, this._bus = t;
|
|
1820
|
+
const r = new Tt(this.gl.gl, { size: 10, divisions: 10 });
|
|
1821
|
+
r.position.y = -1e-3, r.setParent(this.scene), new At(this.gl.gl, { size: 6, symmetric: !0 }).setParent(this.scene), this._orbit = new Bt(this.camera, { element: this.canvas }), this._raycast = new kt(), this._mouse = new jt(), this._isEventListenersAdded = !1;
|
|
1560
1822
|
}
|
|
1823
|
+
/** Orbit-контроллер для управления камерой */
|
|
1824
|
+
_orbit;
|
|
1825
|
+
/** Raycast для подсветки моделей при наведении */
|
|
1826
|
+
_raycast;
|
|
1827
|
+
/** Курсор мыши для остлеживания наведения на 3D-модель */
|
|
1828
|
+
_mouse;
|
|
1829
|
+
/** Были ли зарегистрированы обработчики событий для мыши */
|
|
1830
|
+
_isEventListenersAdded;
|
|
1561
1831
|
/**
|
|
1562
1832
|
* Обновление состояния рендерера.
|
|
1563
1833
|
*/
|
|
1564
1834
|
update() {
|
|
1565
|
-
this.
|
|
1835
|
+
this._orbit?.update();
|
|
1566
1836
|
}
|
|
1567
1837
|
/**
|
|
1568
1838
|
* Метод для добавления фигуры.
|
|
1569
1839
|
* Настройка raycast.
|
|
1570
1840
|
* @param figure - Данные фигуры: position, normal, uv
|
|
1571
1841
|
*/
|
|
1572
|
-
addFigure(
|
|
1573
|
-
const
|
|
1574
|
-
if (
|
|
1575
|
-
const r =
|
|
1576
|
-
|
|
1842
|
+
addFigure(e) {
|
|
1843
|
+
const t = super.addFigure(e);
|
|
1844
|
+
if (t.geometry) {
|
|
1845
|
+
const r = t.geometry.constructor.name;
|
|
1846
|
+
t.geometry.raycast = r.includes("Sphere") ? "sphere" : "box";
|
|
1577
1847
|
}
|
|
1578
|
-
return
|
|
1579
|
-
this.updateHitUniform(r);
|
|
1580
|
-
}), this.isEventListenersAdded || this.initMouseListeners(), e;
|
|
1848
|
+
return this._isEventListenersAdded || this.initMouseListeners(), t;
|
|
1581
1849
|
}
|
|
1582
1850
|
/**
|
|
1583
|
-
*
|
|
1851
|
+
* Устанавливает callback, который будет вызываться перед рендером конкретного меша.
|
|
1852
|
+
*
|
|
1853
|
+
* @param mesh - Меш, для которого нужно задать callback.
|
|
1854
|
+
* @param f - Функция обратного вызова, выполняемая перед рендером меша.
|
|
1855
|
+
* @internal
|
|
1584
1856
|
*/
|
|
1585
|
-
|
|
1586
|
-
|
|
1857
|
+
setMeshBeforeRender(e, t) {
|
|
1858
|
+
e.onBeforeRender(t);
|
|
1587
1859
|
}
|
|
1588
1860
|
/**
|
|
1589
1861
|
* Инициализация обработчиков мыши для raycast
|
|
1590
1862
|
*/
|
|
1591
1863
|
initMouseListeners() {
|
|
1592
|
-
document.addEventListener("mousemove", this.
|
|
1864
|
+
document.addEventListener("mousemove", this._handleMouseMove, !1), document.addEventListener("click", this._handleMouseClick, !1), this._isEventListenersAdded = !0;
|
|
1593
1865
|
}
|
|
1594
1866
|
/**
|
|
1595
1867
|
* Обработчик движения мыши
|
|
1596
1868
|
*/
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
this.mouse.set(2 * (t.x / this.gl.width) - 1, 2 * (1 - t.y / this.gl.height) - 1), this.raycast.castMouse(this.camera, this.mouse), this.meshes.forEach((r) => r.isHit = !1), this.raycast.intersectBounds(this.meshes).forEach((r) => r.isHit = !0);
|
|
1869
|
+
_handleMouseMove = (e) => {
|
|
1870
|
+
this._processRaycastEvent(e, X.SelectHover, !0);
|
|
1600
1871
|
};
|
|
1872
|
+
/**
|
|
1873
|
+
* Обработчик клика мыши
|
|
1874
|
+
*/
|
|
1875
|
+
_handleMouseClick = (e) => {
|
|
1876
|
+
this._processRaycastEvent(e, X.SelectClick, !1);
|
|
1877
|
+
};
|
|
1878
|
+
/**
|
|
1879
|
+
* Универсальная логика raycast-события
|
|
1880
|
+
*/
|
|
1881
|
+
_processRaycastEvent(e, t, r) {
|
|
1882
|
+
if (this._orbit.isInteracting) return;
|
|
1883
|
+
this._mouse.set(2 * (e.x / this.gl.width) - 1, 2 * (1 - e.y / this.gl.height) - 1), this._raycast.castMouse(this.camera, this._mouse), r && this.meshes.forEach((n) => n.isHit = !1);
|
|
1884
|
+
const s = this._raycast.intersectBounds(this.meshes), o = s.length ? s[0] : null;
|
|
1885
|
+
this._bus.emit(t, o ? { mesh: o } : null), r && s.forEach((n) => n.isHit = !0);
|
|
1886
|
+
}
|
|
1601
1887
|
/** Деструктор */
|
|
1602
1888
|
destroy() {
|
|
1603
|
-
this.
|
|
1889
|
+
this._isEventListenersAdded && (document.removeEventListener("mousemove", this._handleMouseMove, !1), document.removeEventListener("click", this._handleMouseClick, !1), this._isEventListenersAdded = !1), this._orbit.destroy(), this._orbit = null, this._raycast = null, this._mouse = null, super.destroy();
|
|
1604
1890
|
}
|
|
1605
1891
|
};
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1892
|
+
Pe = fr([
|
|
1893
|
+
z(),
|
|
1894
|
+
tt(0, W("Canvas")),
|
|
1895
|
+
tt(1, W("EventBus"))
|
|
1896
|
+
], Pe);
|
|
1897
|
+
class Ir extends st {
|
|
1610
1898
|
/** Orbit-контроллер для управления камерой */
|
|
1611
|
-
|
|
1899
|
+
_orbit;
|
|
1612
1900
|
/**
|
|
1613
1901
|
* Инициализация сцены предпросмотра.
|
|
1614
1902
|
* @param canvas - HTMLCanvasElement для рендеринга
|
|
1615
1903
|
*/
|
|
1616
|
-
constructor(
|
|
1617
|
-
super(
|
|
1904
|
+
constructor(t) {
|
|
1905
|
+
super(t), this._orbit = new it(this.camera, {
|
|
1618
1906
|
element: this.canvas,
|
|
1619
|
-
target: new
|
|
1907
|
+
target: new Dt(0, 0, 0),
|
|
1620
1908
|
minPolarAngle: Math.PI / 2,
|
|
1621
1909
|
maxPolarAngle: Math.PI / 2,
|
|
1622
1910
|
enableRotate: !0,
|
|
@@ -1628,10 +1916,10 @@ class ur extends ke {
|
|
|
1628
1916
|
* Обновление состояния рендерера.
|
|
1629
1917
|
*/
|
|
1630
1918
|
update() {
|
|
1631
|
-
this.
|
|
1919
|
+
this._orbit?.update();
|
|
1632
1920
|
}
|
|
1633
1921
|
}
|
|
1634
|
-
class
|
|
1922
|
+
class cr {
|
|
1635
1923
|
/** Тип фигуры */
|
|
1636
1924
|
type;
|
|
1637
1925
|
/** Позиции вершин */
|
|
@@ -1646,224 +1934,323 @@ class Bt {
|
|
|
1646
1934
|
* Создаёт новую фигуру
|
|
1647
1935
|
* @param data - исходные данные фигуры
|
|
1648
1936
|
*/
|
|
1649
|
-
constructor(
|
|
1650
|
-
this.type =
|
|
1937
|
+
constructor(t) {
|
|
1938
|
+
this.type = t.type, this.position = t.position, this.normal = t.normal ?? [], this.uv = t.uv ?? [], this.material = t.material;
|
|
1651
1939
|
}
|
|
1652
1940
|
}
|
|
1653
|
-
var
|
|
1654
|
-
class
|
|
1941
|
+
var ct = /* @__PURE__ */ ((e) => (e[e.Cube = 0] = "Cube", e[e.Sphere = 1] = "Sphere", e[e.Plane = 2] = "Plane", e[e.Cylinder = 3] = "Cylinder", e[e.Custom = 4] = "Custom", e))(ct || {}), te = /* @__PURE__ */ ((e) => (e.Plane = "plane", e.Wireframe = "wireframe", e.Texture = "texture", e))(te || {}), de = /* @__PURE__ */ ((e) => (e.Mesh = "mesh", e.Face = "face", e.Edge = "edge", e.Vertex = "vertex", e))(de || {});
|
|
1942
|
+
class Lr {
|
|
1655
1943
|
/** Позиции вершин */
|
|
1656
|
-
|
|
1944
|
+
_positions = [];
|
|
1657
1945
|
/** Нормали вершин */
|
|
1658
|
-
|
|
1946
|
+
_normals = [];
|
|
1659
1947
|
/** UV-координаты (опционально) */
|
|
1660
|
-
|
|
1948
|
+
_uvs = [];
|
|
1661
1949
|
// Временные поля для парсинга файла
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1950
|
+
_tmpPositions = [];
|
|
1951
|
+
_tmpNormals = [];
|
|
1952
|
+
_tmpUVs = [];
|
|
1665
1953
|
/**
|
|
1666
1954
|
* Загружает OBJ-модель в Figure
|
|
1667
1955
|
* @param objContent - Строка содержимого .obj файла
|
|
1668
1956
|
*/
|
|
1669
|
-
load(
|
|
1670
|
-
const r =
|
|
1957
|
+
load(t) {
|
|
1958
|
+
const r = t.split(`
|
|
1671
1959
|
`);
|
|
1672
|
-
for (const
|
|
1673
|
-
if (!
|
|
1674
|
-
const
|
|
1675
|
-
switch (
|
|
1960
|
+
for (const o of r) {
|
|
1961
|
+
if (!o.trim() || o.startsWith("#")) continue;
|
|
1962
|
+
const n = o.trim().split(/\s+/);
|
|
1963
|
+
switch (n[0]) {
|
|
1676
1964
|
case "v":
|
|
1677
|
-
this.
|
|
1965
|
+
this._tmpPositions.push(n.slice(1).map(Number));
|
|
1678
1966
|
break;
|
|
1679
1967
|
case "vn":
|
|
1680
|
-
this.
|
|
1968
|
+
this._tmpNormals.push(n.slice(1).map(Number));
|
|
1681
1969
|
break;
|
|
1682
1970
|
case "vt":
|
|
1683
|
-
this.
|
|
1971
|
+
this._tmpUVs.push(n.slice(1).map(Number));
|
|
1684
1972
|
break;
|
|
1685
1973
|
case "f":
|
|
1686
|
-
this.processFaceLine(
|
|
1974
|
+
this.processFaceLine(n);
|
|
1687
1975
|
break;
|
|
1688
1976
|
}
|
|
1689
1977
|
}
|
|
1690
1978
|
const s = {
|
|
1691
|
-
type:
|
|
1692
|
-
position: this.
|
|
1693
|
-
...this.
|
|
1694
|
-
...this.
|
|
1979
|
+
type: ct.Custom,
|
|
1980
|
+
position: this._positions,
|
|
1981
|
+
...this._normals.length > 0 && { normal: this._normals },
|
|
1982
|
+
...this._uvs.length > 0 && { uv: this._uvs }
|
|
1695
1983
|
};
|
|
1696
|
-
return new
|
|
1984
|
+
return new cr(s);
|
|
1697
1985
|
}
|
|
1698
1986
|
/**
|
|
1699
1987
|
* Обрабатывает строку face (f) и разворачивает индексы в массивы для рендеринга
|
|
1700
1988
|
*/
|
|
1701
|
-
processFaceLine(
|
|
1702
|
-
for (let r = 1; r <
|
|
1703
|
-
const s =
|
|
1989
|
+
processFaceLine(t) {
|
|
1990
|
+
for (let r = 1; r < t.length; r++) {
|
|
1991
|
+
const s = t[r];
|
|
1704
1992
|
if (!s) continue;
|
|
1705
|
-
const [
|
|
1706
|
-
if (m !== void 0) {
|
|
1707
|
-
const b = this.tmpPositions[m - 1];
|
|
1708
|
-
b && this.positions.push(...b);
|
|
1709
|
-
}
|
|
1993
|
+
const [o, n, l] = s.split("/"), w = o ? parseInt(o, 10) : void 0, R = n ? parseInt(n, 10) : void 0, _ = l ? parseInt(l, 10) : void 0;
|
|
1710
1994
|
if (w !== void 0) {
|
|
1711
|
-
const
|
|
1712
|
-
|
|
1995
|
+
const S = this._tmpPositions[w - 1];
|
|
1996
|
+
S && this._positions.push(...S);
|
|
1713
1997
|
}
|
|
1714
|
-
if (
|
|
1715
|
-
const
|
|
1716
|
-
|
|
1998
|
+
if (R !== void 0) {
|
|
1999
|
+
const S = this._tmpUVs[R - 1];
|
|
2000
|
+
S && this._uvs.push(...S);
|
|
2001
|
+
}
|
|
2002
|
+
if (_ !== void 0) {
|
|
2003
|
+
const S = this._tmpNormals[_ - 1];
|
|
2004
|
+
S && this._normals.push(...S);
|
|
1717
2005
|
}
|
|
1718
2006
|
}
|
|
1719
2007
|
}
|
|
1720
2008
|
}
|
|
1721
|
-
var
|
|
1722
|
-
for (var
|
|
1723
|
-
(
|
|
1724
|
-
return
|
|
1725
|
-
},
|
|
1726
|
-
let
|
|
2009
|
+
var hr = Object.getOwnPropertyDescriptor, dr = (e, t, r, s) => {
|
|
2010
|
+
for (var o = s > 1 ? void 0 : s ? hr(t, r) : t, n = e.length - 1, l; n >= 0; n--)
|
|
2011
|
+
(l = e[n]) && (o = l(o) || o);
|
|
2012
|
+
return o;
|
|
2013
|
+
}, vr = (e, t) => (r, s) => t(r, s, e);
|
|
2014
|
+
let Ee = class {
|
|
1727
2015
|
/** Текущий режим отображения */
|
|
1728
|
-
|
|
2016
|
+
_currentMode = te.Plane;
|
|
1729
2017
|
/** Хендлеры, которые управляют отображением */
|
|
1730
|
-
|
|
1731
|
-
constructor(
|
|
1732
|
-
this.
|
|
2018
|
+
_handlers;
|
|
2019
|
+
constructor(e) {
|
|
2020
|
+
this._handlers = new Map(e.map((t) => [t.mode, t]));
|
|
1733
2021
|
}
|
|
1734
2022
|
/** Установка режима отображения */
|
|
1735
|
-
manage(
|
|
1736
|
-
|
|
2023
|
+
manage(e) {
|
|
2024
|
+
e !== this._currentMode && (this._handlers.get(this._currentMode)?.rollback(), e !== te.Plane && this._handlers.get(e)?.handle(), this._currentMode = e);
|
|
1737
2025
|
}
|
|
1738
2026
|
/** Освобождение ресурсов */
|
|
1739
2027
|
destroy() {
|
|
1740
|
-
this.
|
|
2028
|
+
this._handlers && this._handlers.clear(), this._currentMode = te.Plane;
|
|
1741
2029
|
}
|
|
1742
2030
|
};
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
],
|
|
1747
|
-
var
|
|
1748
|
-
for (var
|
|
1749
|
-
(
|
|
1750
|
-
return
|
|
1751
|
-
},
|
|
1752
|
-
let
|
|
1753
|
-
constructor(t) {
|
|
1754
|
-
this.
|
|
2031
|
+
Ee = dr([
|
|
2032
|
+
z(),
|
|
2033
|
+
vr(0, ft("IDisplayHandler"))
|
|
2034
|
+
], Ee);
|
|
2035
|
+
var he = /* @__PURE__ */ ((e) => (e.Hover = "hover", e.Click = "click", e))(he || {}), pr = Object.getOwnPropertyDescriptor, yr = (e, t, r, s) => {
|
|
2036
|
+
for (var o = s > 1 ? void 0 : s ? pr(t, r) : t, n = e.length - 1, l; n >= 0; n--)
|
|
2037
|
+
(l = e[n]) && (o = l(o) || o);
|
|
2038
|
+
return o;
|
|
2039
|
+
}, rt = (e, t) => (r, s) => t(r, s, e);
|
|
2040
|
+
let Ce = class {
|
|
2041
|
+
constructor(e, t) {
|
|
2042
|
+
this._eventBus = e, this._handlers = new Map(t.map((r) => [r.mode, r])), this._eventBus.on(X.SelectHover, this._onHover), this._eventBus.on(X.SelectClick, this._onClick);
|
|
2043
|
+
}
|
|
2044
|
+
/** Текущий режим выборки */
|
|
2045
|
+
_currentMode = de.Mesh;
|
|
2046
|
+
/** Хендлеры, которые управляют выборкой */
|
|
2047
|
+
_handlers;
|
|
2048
|
+
manage(e) {
|
|
2049
|
+
e !== this._currentMode && (this._handlers.get(this._currentMode)?.rollback(), this._currentMode = e);
|
|
2050
|
+
}
|
|
2051
|
+
/** Обработчик события наведения на модель */
|
|
2052
|
+
_onHover = (e) => {
|
|
2053
|
+
if (!e) return;
|
|
2054
|
+
this._handlers.get(this._currentMode)?.handle(e, he.Hover);
|
|
2055
|
+
};
|
|
2056
|
+
/** Обработчик события клика на модель */
|
|
2057
|
+
_onClick = (e) => {
|
|
2058
|
+
if (!e) return;
|
|
2059
|
+
this._handlers.get(this._currentMode)?.handle(e, he.Click);
|
|
2060
|
+
};
|
|
2061
|
+
destroy() {
|
|
2062
|
+
this._eventBus.off(X.SelectHover, this._onHover);
|
|
2063
|
+
}
|
|
2064
|
+
};
|
|
2065
|
+
Ce = yr([
|
|
2066
|
+
z(),
|
|
2067
|
+
rt(0, W("EventBus")),
|
|
2068
|
+
rt(1, ft("ISelectHandler"))
|
|
2069
|
+
], Ce);
|
|
2070
|
+
var _r = Object.getOwnPropertyDescriptor, mr = (e, t, r, s) => {
|
|
2071
|
+
for (var o = s > 1 ? void 0 : s ? _r(t, r) : t, n = e.length - 1, l; n >= 0; n--)
|
|
2072
|
+
(l = e[n]) && (o = l(o) || o);
|
|
2073
|
+
return o;
|
|
2074
|
+
}, gr = (e, t) => (r, s) => t(r, s, e);
|
|
2075
|
+
let Se = class {
|
|
2076
|
+
constructor(e) {
|
|
2077
|
+
this._api = e, this._wireMeshes = [], this._context = this._api.getContext(), this._wireMeshProgram = new Ht(this._context);
|
|
1755
2078
|
}
|
|
1756
2079
|
/** Режим отображения */
|
|
1757
|
-
mode =
|
|
2080
|
+
mode = te.Wireframe;
|
|
1758
2081
|
/** Wireframe-модели для добавленных на сцену объектов */
|
|
1759
|
-
|
|
2082
|
+
_wireMeshes;
|
|
1760
2083
|
/** Настройки рендеринга для режима wireframe */
|
|
1761
|
-
|
|
2084
|
+
_wireMeshProgram;
|
|
1762
2085
|
/** WebGl контекст */
|
|
1763
|
-
|
|
2086
|
+
_context;
|
|
1764
2087
|
/**
|
|
1765
2088
|
* Применяет wireframe-режим к сцене.
|
|
1766
2089
|
*/
|
|
1767
2090
|
handle() {
|
|
1768
|
-
const
|
|
1769
|
-
this.createWireMeshes(
|
|
2091
|
+
const e = this._api.getMeshes();
|
|
2092
|
+
this.createWireMeshes(e), this._api.removeMeshes(e), this._api.addMeshes(this._wireMeshes);
|
|
1770
2093
|
}
|
|
1771
2094
|
/**
|
|
1772
2095
|
* Отменяет wireframe-режим у сцены.
|
|
1773
2096
|
*/
|
|
1774
2097
|
rollback() {
|
|
1775
|
-
const
|
|
1776
|
-
this.
|
|
2098
|
+
const e = this._api.getMeshes();
|
|
2099
|
+
this._api.removeMeshes(this._wireMeshes), this._api.addMeshes(e);
|
|
1777
2100
|
}
|
|
1778
2101
|
/**
|
|
1779
2102
|
* Освобождает ресурсы хендлера, удаляет wireframe-модели со сцены.
|
|
1780
2103
|
*/
|
|
1781
2104
|
destroy() {
|
|
1782
|
-
this.
|
|
2105
|
+
this._wireMeshes && (this._wireMeshes.length = 0, this._wireMeshes = []);
|
|
1783
2106
|
}
|
|
1784
2107
|
/**
|
|
1785
2108
|
* Создание wireframe-моделей для фигур на сцене.
|
|
1786
2109
|
*/
|
|
1787
|
-
createWireMeshes(
|
|
1788
|
-
for (const
|
|
1789
|
-
const r = new
|
|
1790
|
-
geometry:
|
|
1791
|
-
program: this.
|
|
2110
|
+
createWireMeshes(e) {
|
|
2111
|
+
for (const t of e) {
|
|
2112
|
+
const r = new Nt(this._context, {
|
|
2113
|
+
geometry: t.geometry,
|
|
2114
|
+
program: this._wireMeshProgram
|
|
1792
2115
|
});
|
|
1793
|
-
this.
|
|
2116
|
+
this._wireMeshes.push(r);
|
|
1794
2117
|
}
|
|
1795
2118
|
}
|
|
1796
2119
|
};
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
],
|
|
1801
|
-
var
|
|
1802
|
-
for (var
|
|
1803
|
-
(
|
|
1804
|
-
return
|
|
1805
|
-
},
|
|
1806
|
-
let
|
|
1807
|
-
constructor(
|
|
1808
|
-
this.
|
|
2120
|
+
Se = mr([
|
|
2121
|
+
z(),
|
|
2122
|
+
gr(0, W("RendererApi"))
|
|
2123
|
+
], Se);
|
|
2124
|
+
var wr = Object.getOwnPropertyDescriptor, Mr = (e, t, r, s) => {
|
|
2125
|
+
for (var o = s > 1 ? void 0 : s ? wr(t, r) : t, n = e.length - 1, l; n >= 0; n--)
|
|
2126
|
+
(l = e[n]) && (o = l(o) || o);
|
|
2127
|
+
return o;
|
|
2128
|
+
}, br = (e, t) => (r, s) => t(r, s, e);
|
|
2129
|
+
let xe = class {
|
|
2130
|
+
constructor(e) {
|
|
2131
|
+
this._api = e, this._program = e.getProgram(), this._selectedMesh = null;
|
|
1809
2132
|
}
|
|
1810
|
-
|
|
1811
|
-
|
|
2133
|
+
/** Режим выборки */
|
|
2134
|
+
mode = de.Mesh;
|
|
2135
|
+
/** Текущая программа для рендеринга фигуры*/
|
|
2136
|
+
_program;
|
|
2137
|
+
/** Выбранная фигура */
|
|
2138
|
+
_selectedMesh;
|
|
2139
|
+
handle(e, t) {
|
|
2140
|
+
if (!e) return;
|
|
2141
|
+
const { mesh: r } = e;
|
|
2142
|
+
t === he.Hover ? this._api.setMeshBeforeRender(r, () => this._onHover(r)) : this._api.setMeshBeforeRender(r, () => this._onClick(r));
|
|
1812
2143
|
}
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
2144
|
+
/** Обработчик события при наведении курсора мыши на модель */
|
|
2145
|
+
_onHover = (e) => {
|
|
2146
|
+
e.program.uniforms.uHit.value = e.isHit ? 1 : 0;
|
|
2147
|
+
};
|
|
2148
|
+
/** Обработчик события при клике на модель */
|
|
2149
|
+
_onClick = (e) => {
|
|
2150
|
+
this._selectedMesh && this._selectedMesh.program?.uniforms.uSelected && (this._selectedMesh.program.uniforms.uSelected.value = 0), this._selectedMesh = e, e.program?.uniforms.uSelected && (e.program.uniforms.uSelected.value = 1), console.log(`Selected mesh: ${e.id}`);
|
|
2151
|
+
};
|
|
2152
|
+
/** Выключение подсветки у моделей */
|
|
2153
|
+
rollback() {
|
|
2154
|
+
this._program.uniforms.uHit.value = 0;
|
|
1816
2155
|
}
|
|
1817
|
-
|
|
1818
|
-
this.
|
|
2156
|
+
destroy() {
|
|
2157
|
+
this.rollback();
|
|
1819
2158
|
}
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
2159
|
+
};
|
|
2160
|
+
xe = Mr([
|
|
2161
|
+
z(),
|
|
2162
|
+
br(0, W("RendererApi"))
|
|
2163
|
+
], xe);
|
|
2164
|
+
var Or = Object.getOwnPropertyDescriptor, Rr = (e, t, r, s) => {
|
|
2165
|
+
for (var o = s > 1 ? void 0 : s ? Or(t, r) : t, n = e.length - 1, l; n >= 0; n--)
|
|
2166
|
+
(l = e[n]) && (o = l(o) || o);
|
|
2167
|
+
return o;
|
|
2168
|
+
}, Pr = (e, t) => (r, s) => t(r, s, e);
|
|
2169
|
+
let Ie = class {
|
|
2170
|
+
constructor(e) {
|
|
2171
|
+
this._renderer = e;
|
|
2172
|
+
}
|
|
2173
|
+
addMesh(e) {
|
|
2174
|
+
this._renderer.addMesh(e);
|
|
2175
|
+
}
|
|
2176
|
+
addMeshes(e) {
|
|
2177
|
+
for (const t of e)
|
|
2178
|
+
this._renderer.addMesh(t);
|
|
2179
|
+
}
|
|
2180
|
+
removeMesh(e) {
|
|
2181
|
+
this._renderer.removeMesh(e);
|
|
2182
|
+
}
|
|
2183
|
+
removeMeshes(e) {
|
|
2184
|
+
for (const t of e)
|
|
2185
|
+
this._renderer.removeMesh(t);
|
|
1823
2186
|
}
|
|
1824
2187
|
getMeshes() {
|
|
1825
|
-
return this.
|
|
2188
|
+
return this._renderer.getMeshes();
|
|
1826
2189
|
}
|
|
1827
2190
|
getContext() {
|
|
1828
|
-
return this.
|
|
2191
|
+
return this._renderer.getContext();
|
|
2192
|
+
}
|
|
2193
|
+
getProgram() {
|
|
2194
|
+
return this._renderer.getProgram();
|
|
2195
|
+
}
|
|
2196
|
+
setMeshBeforeRender(e, t) {
|
|
2197
|
+
this._renderer.setMeshBeforeRender(e, t);
|
|
1829
2198
|
}
|
|
1830
2199
|
};
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
],
|
|
1835
|
-
var
|
|
1836
|
-
for (var
|
|
1837
|
-
(
|
|
1838
|
-
return
|
|
1839
|
-
},
|
|
1840
|
-
let
|
|
1841
|
-
constructor(t) {
|
|
1842
|
-
this.
|
|
2200
|
+
Ie = Rr([
|
|
2201
|
+
z(),
|
|
2202
|
+
Pr(0, W("EditorRenderer"))
|
|
2203
|
+
], Ie);
|
|
2204
|
+
var Er = Object.getOwnPropertyDescriptor, Cr = (e, t, r, s) => {
|
|
2205
|
+
for (var o = s > 1 ? void 0 : s ? Er(t, r) : t, n = e.length - 1, l; n >= 0; n--)
|
|
2206
|
+
(l = e[n]) && (o = l(o) || o);
|
|
2207
|
+
return o;
|
|
2208
|
+
}, ge = (e, t) => (r, s) => t(r, s, e);
|
|
2209
|
+
let Le = class {
|
|
2210
|
+
constructor(e, t, r) {
|
|
2211
|
+
this._displayManager = e, this._selectManager = t, this._renderer = r, t.manage(de.Mesh);
|
|
2212
|
+
}
|
|
2213
|
+
setDisplayMode(e) {
|
|
2214
|
+
this._displayManager.manage(e);
|
|
2215
|
+
}
|
|
2216
|
+
setSelectMode(e) {
|
|
2217
|
+
this._selectManager.manage(e);
|
|
1843
2218
|
}
|
|
1844
|
-
|
|
1845
|
-
this.
|
|
2219
|
+
resizeRenderer() {
|
|
2220
|
+
this._renderer.resize();
|
|
2221
|
+
}
|
|
2222
|
+
updateRenderer() {
|
|
2223
|
+
this._renderer.loop();
|
|
2224
|
+
}
|
|
2225
|
+
addFigure(e) {
|
|
2226
|
+
this._renderer.addFigure(e);
|
|
1846
2227
|
}
|
|
1847
2228
|
destroy() {
|
|
1848
|
-
this.
|
|
2229
|
+
this._displayManager.destroy(), this._selectManager.destroy(), this._renderer.destroy();
|
|
1849
2230
|
}
|
|
1850
2231
|
};
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
2232
|
+
Le = Cr([
|
|
2233
|
+
z(),
|
|
2234
|
+
ge(0, W("IDisplayManager")),
|
|
2235
|
+
ge(1, W("ISelectManager")),
|
|
2236
|
+
ge(2, W("EditorRenderer"))
|
|
2237
|
+
], Le);
|
|
2238
|
+
let nt = !1;
|
|
2239
|
+
const F = ir.createChildContainer();
|
|
2240
|
+
function Sr(e) {
|
|
2241
|
+
return nt || (F.registerInstance("Canvas", e), F.registerSingleton("EventBus", Re), F.registerSingleton("EditorRenderer", Pe), F.registerSingleton("RendererApi", Ie), F.registerSingleton("IDisplayHandler", Se), F.registerSingleton("ISelectHandler", xe), F.registerSingleton("IDisplayManager", Ee), F.registerSingleton("ISelectManager", Ce), F.registerSingleton("EditorHub", Le), nt = !0), F;
|
|
1858
2242
|
}
|
|
1859
|
-
function
|
|
1860
|
-
return
|
|
2243
|
+
function Tr(e) {
|
|
2244
|
+
return Sr(e).resolve("EditorHub");
|
|
1861
2245
|
}
|
|
1862
2246
|
export {
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
2247
|
+
Le as EditorHub,
|
|
2248
|
+
Wt as EditorMesh,
|
|
2249
|
+
Pe as EditorRenderer,
|
|
2250
|
+
Re as EventBus,
|
|
2251
|
+
X as EventTopics,
|
|
2252
|
+
Lr as ObjLoader,
|
|
2253
|
+
Ir as PreviewRenderer,
|
|
2254
|
+
st as Renderer,
|
|
2255
|
+
Tr as createAppHub
|
|
1869
2256
|
};
|