mx3d 0.0.45 → 0.0.46
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/index.d.ts +53 -55
- package/mx3d.js +10 -0
- package/mx3d.min.js +3 -3
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/*
|
|
2
|
-
@author gzmaijing
|
|
3
|
-
@email mj@gzmaijing.com
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export
|
|
1
|
+
/*
|
|
2
|
+
@author gzmaijing
|
|
3
|
+
@email mj@gzmaijing.com
|
|
4
|
+
*/
|
|
5
|
+
declare module MX3D{
|
|
6
|
+
export class App {
|
|
7
7
|
canvas: HTMLCanvasElement;
|
|
8
8
|
engine: BABYLON.Engine;
|
|
9
9
|
scene: BABYLON.Scene;
|
|
@@ -28,7 +28,7 @@ export default class App {
|
|
|
28
28
|
dispose(): void;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export
|
|
31
|
+
export class Capacity {
|
|
32
32
|
anchor: IObject;
|
|
33
33
|
mesh: BABYLON.Mesh;
|
|
34
34
|
ratio: number;
|
|
@@ -38,12 +38,12 @@ export default class Capacity {
|
|
|
38
38
|
dispose(): void;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export
|
|
41
|
+
export class CapacityBuilder {
|
|
42
42
|
static createCapacity(_obj: IObject, _RATIO: number, _text: string, _fontSize?: string): void;
|
|
43
43
|
static createTextMesh(_obj: IObject, _text: string, _RATIO: number, _fontSize?: string, _color?: string): void;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export
|
|
46
|
+
export class EffectMgr {
|
|
47
47
|
static colors: {};
|
|
48
48
|
static init(): void;
|
|
49
49
|
}
|
|
@@ -54,7 +54,7 @@ export enum EffectType {
|
|
|
54
54
|
Transparent = 2
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
export
|
|
57
|
+
export class Environment {
|
|
58
58
|
app: App;
|
|
59
59
|
lights: any;
|
|
60
60
|
_color: BABYLON.Color4;
|
|
@@ -89,7 +89,7 @@ export enum EventType {
|
|
|
89
89
|
out = "out"
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
export
|
|
92
|
+
export class HeatMap implements BaseNode {
|
|
93
93
|
id: string;
|
|
94
94
|
scene: BABYLON.Scene;
|
|
95
95
|
anchor: string;
|
|
@@ -101,7 +101,7 @@ export default class HeatMap implements BaseNode {
|
|
|
101
101
|
dispose(): void;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
export
|
|
104
|
+
export class HeatMapBuilder {
|
|
105
105
|
static createMatrixHeatMap(_data: {
|
|
106
106
|
anchor: BABYLON.Mesh | BABYLON.InstancedMesh;
|
|
107
107
|
rootUrl: string;
|
|
@@ -147,7 +147,7 @@ export default class HeatMapBuilder {
|
|
|
147
147
|
}): void;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
export
|
|
150
|
+
export class Icon implements BaseNode {
|
|
151
151
|
id: string;
|
|
152
152
|
scene: BABYLON.Scene;
|
|
153
153
|
pint: BABYLON.Mesh;
|
|
@@ -176,7 +176,7 @@ export default class Icon implements BaseNode {
|
|
|
176
176
|
isEnabled(_isEnabled: boolean): void;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
export
|
|
179
|
+
export class IconFromMesh implements BaseNode {
|
|
180
180
|
id: string;
|
|
181
181
|
scene: BABYLON.Scene;
|
|
182
182
|
instance: BABYLON.Mesh;
|
|
@@ -197,7 +197,7 @@ export default class IconFromMesh implements BaseNode {
|
|
|
197
197
|
isEnabled(_bool: boolean): void;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
export
|
|
200
|
+
export class UI {
|
|
201
201
|
static createIconFromMesh(_id: string, _anchor: IObject, _url: string, _scaling: number, _height: number): void;
|
|
202
202
|
static createIcon(_id: string, _anchor: IObject, _size: {
|
|
203
203
|
width: number;
|
|
@@ -205,20 +205,20 @@ export default class UI {
|
|
|
205
205
|
}, _height: number): void;
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
export
|
|
208
|
+
export class Directional extends LightObject {
|
|
209
209
|
direction: BABYLON.Vector3;
|
|
210
210
|
position: BABYLON.Vector3;
|
|
211
211
|
light: BABYLON.DirectionalLight;
|
|
212
212
|
load(): void;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
export
|
|
215
|
+
export class Hemispheric extends LightObject {
|
|
216
216
|
direction: BABYLON.Vector3;
|
|
217
217
|
light: BABYLON.HemisphericLight;
|
|
218
218
|
load(): void;
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
export
|
|
221
|
+
export interface ILightObject {
|
|
222
222
|
id: string;
|
|
223
223
|
sceneId: string;
|
|
224
224
|
name: string;
|
|
@@ -229,7 +229,7 @@ export default interface ILightObject {
|
|
|
229
229
|
load: Function;
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
export
|
|
232
|
+
export class LightObject implements ILightObject {
|
|
233
233
|
id: string;
|
|
234
234
|
sceneId: string;
|
|
235
235
|
name: string;
|
|
@@ -249,17 +249,15 @@ export enum LightType {
|
|
|
249
249
|
Directional = "Directional",
|
|
250
250
|
Hemispheric = "Hemispheric"
|
|
251
251
|
}
|
|
252
|
-
let typeFromat: Function;
|
|
253
|
-
export default typeFromat;
|
|
254
252
|
|
|
255
|
-
export
|
|
253
|
+
export class Point extends LightObject {
|
|
256
254
|
position: BABYLON.Vector3;
|
|
257
255
|
light: BABYLON.PointLight;
|
|
258
256
|
range: number;
|
|
259
257
|
load(): void;
|
|
260
258
|
}
|
|
261
259
|
|
|
262
|
-
export
|
|
260
|
+
export class Spot extends LightObject {
|
|
263
261
|
direction: BABYLON.Vector3;
|
|
264
262
|
position: BABYLON.Vector3;
|
|
265
263
|
angle: number;
|
|
@@ -269,10 +267,10 @@ export default class Spot extends LightObject {
|
|
|
269
267
|
load(): void;
|
|
270
268
|
}
|
|
271
269
|
|
|
272
|
-
export
|
|
270
|
+
export class CabinetObject extends DefaultObject {
|
|
273
271
|
}
|
|
274
272
|
|
|
275
|
-
export
|
|
273
|
+
export class ConduitObject extends DefaultObject {
|
|
276
274
|
alpha: number;
|
|
277
275
|
color: string;
|
|
278
276
|
bind(_m: any): void;
|
|
@@ -284,12 +282,12 @@ export default class ConduitObject extends DefaultObject {
|
|
|
284
282
|
setTransparent(_alpha?: number): void;
|
|
285
283
|
}
|
|
286
284
|
|
|
287
|
-
export
|
|
285
|
+
export class CornerObject extends DefaultObject {
|
|
288
286
|
height: number;
|
|
289
287
|
bind(_m: any): void;
|
|
290
288
|
}
|
|
291
289
|
|
|
292
|
-
export
|
|
290
|
+
export class DefaultObject implements IObject {
|
|
293
291
|
app: App;
|
|
294
292
|
id: string;
|
|
295
293
|
name: string;
|
|
@@ -297,7 +295,6 @@ export default class DefaultObject implements IObject {
|
|
|
297
295
|
modelId: string;
|
|
298
296
|
instance: BABYLON.Mesh | BABYLON.InstancedMesh;
|
|
299
297
|
objectType: string;
|
|
300
|
-
modelType: string;
|
|
301
298
|
action: BABYLON.ActionManager;
|
|
302
299
|
executes: Dictionary<BABYLON.ExecuteCodeAction>;
|
|
303
300
|
clickEvents: Dictionary<Function>;
|
|
@@ -327,17 +324,17 @@ export default class DefaultObject implements IObject {
|
|
|
327
324
|
focus(): void;
|
|
328
325
|
}
|
|
329
326
|
|
|
330
|
-
export
|
|
327
|
+
export class DoorObject extends DefaultObject {
|
|
331
328
|
height: number;
|
|
332
329
|
bind(_m: any): void;
|
|
333
330
|
}
|
|
334
331
|
|
|
335
|
-
export
|
|
332
|
+
export class FloorObject extends DefaultObject {
|
|
336
333
|
height: number;
|
|
337
334
|
bind(_m: any): void;
|
|
338
335
|
}
|
|
339
336
|
|
|
340
|
-
export
|
|
337
|
+
export interface IBase {
|
|
341
338
|
app: App;
|
|
342
339
|
id: string;
|
|
343
340
|
name: string;
|
|
@@ -345,12 +342,11 @@ export default interface IBase {
|
|
|
345
342
|
objectType: string;
|
|
346
343
|
}
|
|
347
344
|
|
|
348
|
-
export
|
|
345
|
+
export interface IObject extends IBase {
|
|
349
346
|
customNumber: string;
|
|
350
347
|
customType: string;
|
|
351
348
|
modelId: string;
|
|
352
349
|
instance: BABYLON.Mesh | BABYLON.InstancedMesh;
|
|
353
|
-
modelType: string;
|
|
354
350
|
Sight: Sight;
|
|
355
351
|
effectType: EffectType;
|
|
356
352
|
bind(_m?: any): any;
|
|
@@ -369,7 +365,7 @@ export default interface IObject extends IBase {
|
|
|
369
365
|
computeView(): any;
|
|
370
366
|
}
|
|
371
367
|
|
|
372
|
-
export
|
|
368
|
+
export class LeakWaterObject extends DefaultObject {
|
|
373
369
|
bind(_l: any): void;
|
|
374
370
|
computeView(): void;
|
|
375
371
|
addEventListener(_type: string, _callback: Function): void;
|
|
@@ -423,7 +419,7 @@ export enum ObjectType {
|
|
|
423
419
|
optimizedWall = "optimizedWall"
|
|
424
420
|
}
|
|
425
421
|
|
|
426
|
-
export
|
|
422
|
+
export class Project {
|
|
427
423
|
app: App;
|
|
428
424
|
id: string;
|
|
429
425
|
root: IObject;
|
|
@@ -434,17 +430,17 @@ export default class Project {
|
|
|
434
430
|
clear(): void;
|
|
435
431
|
optimization(): void;
|
|
436
432
|
computeView(): void;
|
|
437
|
-
getChildsById(_id: string): void;
|
|
438
|
-
getSceneTree(): void;
|
|
433
|
+
getChildsById(_id: string, _includeSub?: boolean): void;
|
|
434
|
+
getSceneTree(_id?: string, _excludeTypes?: Array<string>): void;
|
|
439
435
|
findObjectById(_id: string): void;
|
|
440
436
|
findObjectsByType(_type: ObjectType): void;
|
|
441
|
-
|
|
442
|
-
|
|
437
|
+
computeSight(_objs: Array<IObject>): void;
|
|
438
|
+
findObjectByCustomNumber(): void;
|
|
443
439
|
findObjectsByCustomType(): void;
|
|
444
440
|
switchLevel(_id?: string, _isFocus?: boolean, _includeSub?: boolean): void;
|
|
445
441
|
}
|
|
446
442
|
|
|
447
|
-
export
|
|
443
|
+
export class RegionObject extends DefaultObject {
|
|
448
444
|
index: number;
|
|
449
445
|
height: number;
|
|
450
446
|
constructor(app: App, _storey: any);
|
|
@@ -457,38 +453,38 @@ export default class RegionObject extends DefaultObject {
|
|
|
457
453
|
dispose(): void;
|
|
458
454
|
}
|
|
459
455
|
|
|
460
|
-
export
|
|
456
|
+
export class UI3DTextObject extends DefaultObject {
|
|
461
457
|
bind(_u: any): void;
|
|
462
458
|
}
|
|
463
459
|
|
|
464
|
-
export
|
|
460
|
+
export class VirtualBoxObject extends DefaultObject {
|
|
465
461
|
bind(_m: any): Promise<void>;
|
|
466
462
|
}
|
|
467
463
|
|
|
468
|
-
export
|
|
464
|
+
export class WallObject extends DefaultObject {
|
|
469
465
|
nativeMaterial: BABYLON.StandardMaterial;
|
|
470
466
|
baseModel: any;
|
|
471
467
|
height: number;
|
|
472
468
|
bind(_w: any): void;
|
|
473
469
|
}
|
|
474
470
|
|
|
475
|
-
export
|
|
471
|
+
export class WindowObject extends DefaultObject {
|
|
476
472
|
height: number;
|
|
477
473
|
bind(_m: any): void;
|
|
478
474
|
}
|
|
479
475
|
|
|
480
|
-
export
|
|
476
|
+
export class ArrayEx<T> extends Array<T> {
|
|
481
477
|
remove(_val: any): void;
|
|
482
478
|
}
|
|
483
479
|
|
|
484
|
-
export
|
|
480
|
+
export interface BaseNode {
|
|
485
481
|
id: string;
|
|
486
482
|
scene: BABYLON.Scene;
|
|
487
483
|
dispose(): any;
|
|
488
484
|
isEnabled(bool: boolean): any;
|
|
489
485
|
}
|
|
490
486
|
|
|
491
|
-
export
|
|
487
|
+
export class Camera {
|
|
492
488
|
app: App;
|
|
493
489
|
camera: BABYLON.ArcRotateCamera;
|
|
494
490
|
frustrum: number;
|
|
@@ -496,14 +492,14 @@ export default class Camera {
|
|
|
496
492
|
constructor(_app: App);
|
|
497
493
|
orthographic(): void;
|
|
498
494
|
perspective(): void;
|
|
499
|
-
focusingFromProperty(_visualAngle: Sight): void;
|
|
500
495
|
flyTo(_visualAngle: Sight, _sheep?: number): void;
|
|
496
|
+
getSightJson(): void;
|
|
501
497
|
translation(_visualAngle: Sight, _sheep?: number): void;
|
|
502
498
|
computeCameraView(): void;
|
|
503
499
|
_wheel(_p: any): void;
|
|
504
500
|
}
|
|
505
501
|
|
|
506
|
-
export
|
|
502
|
+
export class Dictionary<T> {
|
|
507
503
|
map: {
|
|
508
504
|
[key: string]: T;
|
|
509
505
|
};
|
|
@@ -517,11 +513,11 @@ export default class Dictionary<T> {
|
|
|
517
513
|
clear(): void;
|
|
518
514
|
}
|
|
519
515
|
|
|
520
|
-
export
|
|
516
|
+
export class GUID {
|
|
521
517
|
static getGUID(_length: number): void;
|
|
522
518
|
}
|
|
523
519
|
|
|
524
|
-
export
|
|
520
|
+
export class Resources {
|
|
525
521
|
app: App;
|
|
526
522
|
walls: Dictionary<BABYLON.AbstractMesh>;
|
|
527
523
|
resources: Dictionary<BABYLON.AssetContainer>;
|
|
@@ -542,7 +538,7 @@ export default class Resources {
|
|
|
542
538
|
GetWalls(_url: string, _projectId: string): Promise<void>;
|
|
543
539
|
}
|
|
544
540
|
|
|
545
|
-
export
|
|
541
|
+
export class Sight {
|
|
546
542
|
alpha: number;
|
|
547
543
|
focus: BABYLON.Vector3;
|
|
548
544
|
radius: number;
|
|
@@ -551,12 +547,13 @@ export default class Sight {
|
|
|
551
547
|
maximumLimit: number;
|
|
552
548
|
minBeta: number;
|
|
553
549
|
maxBeta: number;
|
|
554
|
-
|
|
550
|
+
toJosn(_sightJson: any): void;
|
|
551
|
+
toString(): void;
|
|
555
552
|
setLimit(_miniLimit: number, _maxiLimit: number): void;
|
|
556
553
|
setBeta(_minBeta: number, _maxBeta: number): void;
|
|
557
554
|
}
|
|
558
555
|
|
|
559
|
-
export
|
|
556
|
+
export class Tools {
|
|
560
557
|
static vector3ToJson(_old: BABYLON.Vector3): any;
|
|
561
558
|
static vector3ARRToJson(_olds: BABYLON.Vector3[]): void;
|
|
562
559
|
static ToVector3(_old: any): void;
|
|
@@ -575,7 +572,7 @@ export default class Tools {
|
|
|
575
572
|
static RandomNumBoth(_Min: any, _Max: any): void;
|
|
576
573
|
}
|
|
577
574
|
|
|
578
|
-
export
|
|
575
|
+
export class ToolTips {
|
|
579
576
|
app: App;
|
|
580
577
|
url: string;
|
|
581
578
|
ele: HTMLDivElement;
|
|
@@ -590,3 +587,4 @@ export default class ToolTips {
|
|
|
590
587
|
dispose(): void;
|
|
591
588
|
}
|
|
592
589
|
|
|
590
|
+
}
|
package/mx3d.js
CHANGED
|
@@ -221,6 +221,14 @@ class Icon {
|
|
|
221
221
|
isEnabled(_isEnabled) { }
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
+
// CONCATENATED MODULE: ./src/public/components/EffectType.ts
|
|
225
|
+
var EffectType;
|
|
226
|
+
(function (EffectType) {
|
|
227
|
+
EffectType[EffectType["Opaque"] = 0] = "Opaque";
|
|
228
|
+
EffectType[EffectType["Flash"] = 1] = "Flash";
|
|
229
|
+
EffectType[EffectType["Transparent"] = 2] = "Transparent";
|
|
230
|
+
})(EffectType || (EffectType = {}));
|
|
231
|
+
|
|
224
232
|
// CONCATENATED MODULE: ./src/public/index.ts
|
|
225
233
|
|
|
226
234
|
|
|
@@ -232,6 +240,7 @@ class Icon {
|
|
|
232
240
|
|
|
233
241
|
|
|
234
242
|
|
|
243
|
+
|
|
235
244
|
class MX3D {
|
|
236
245
|
}
|
|
237
246
|
MX3D.sl = "https://www.wodashijie.com/"; //服务地址
|
|
@@ -241,6 +250,7 @@ MX3D.Tools = Tools;
|
|
|
241
250
|
MX3D.EffectMgr = EffectMgr;
|
|
242
251
|
MX3D.IconFromMesh = IconFromMesh;
|
|
243
252
|
MX3D.Icon = Icon;
|
|
253
|
+
MX3D.EffectType = EffectType;
|
|
244
254
|
|
|
245
255
|
|
|
246
256
|
/***/ })
|
package/mx3d.min.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("TWEEN"),require("BABYLON"),require("babylonjs-materials"),require("BABYLON.GUI"),require("BABYLON.SceneLoader"),require("babylonjs-serializers")):"function"==typeof define&&define.amd?define(["TWEEN","BABYLON","babylonjs-materials","BABYLON.GUI","BABYLON.SceneLoader","babylonjs-serializers"],t):"object"==typeof exports?exports.MX3D=t(require("TWEEN"),require("BABYLON"),require("babylonjs-materials"),require("BABYLON.GUI"),require("BABYLON.SceneLoader"),require("babylonjs-serializers")):e.MX3D=t(e.TWEEN,e.BABYLON,e["babylonjs-materials"],e["BABYLON.GUI"],e["BABYLON.SceneLoader"],e["babylonjs-serializers"])}(window,function(i,n,s,r,o,a){return c=[function(e,t){e.exports=i},function(e,t,i){"use strict";var n,s=i(5),r=Object.prototype.toString,o=(n=Object.create(null),function(e){e=r.call(e);return n[e]||(n[e]=e.slice(8,-1).toLowerCase())});function a(t){return t=t.toLowerCase(),function(e){return o(e)===t}}function h(e){return Array.isArray(e)}function c(e){return void 0===e}var l=a("ArrayBuffer");function u(e){return null!==e&&"object"==typeof e}function p(e){if("object"!==o(e))return!1;e=Object.getPrototypeOf(e);return null===e||e===Object.prototype}var d=a("Date"),f=a("File"),g=a("Blob"),m=a("FileList");function b(e){return"[object Function]"===r.call(e)}var y=a("URLSearchParams");function A(e,t){if(null!=e)if(h(e="object"!=typeof e?[e]:e))for(var i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.call(null,e[s],s,e)}var v,i=(v="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return v&&e instanceof v});e.exports={isArray:h,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!c(e)&&null!==e.constructor&&!c(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||r.call(e)===t||b(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:u,isPlainObject:p,isUndefined:c,isDate:d,isFile:f,isBlob:g,isFunction:b,isStream:function(e){return u(e)&&b(e.pipe)},isURLSearchParams:y,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:A,merge:function i(){var n={};function e(e,t){p(n[t])&&p(e)?n[t]=i(n[t],e):p(e)?n[t]=i({},e):h(e)?n[t]=e.slice():n[t]=e}for(var t=0,s=arguments.length;t<s;t++)A(arguments[t],e);return n},extend:function(i,e,n){return A(e,function(e,t){i[t]=n&&"function"==typeof e?s(e,n):e}),i},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return e=65279===e.charCodeAt(0)?e.slice(1):e},inherits:function(e,t,i,n){e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,i&&Object.assign(e.prototype,i)},toFlatObject:function(e,t,i){var n,s,r,o={};t=t||{};do{for(s=(n=Object.getOwnPropertyNames(e)).length;0<s--;)o[r=n[s]]||(t[r]=e[r],o[r]=!0)}while((e=Object.getPrototypeOf(e))&&(!i||i(e,t))&&e!==Object.prototype);return t},kindOf:o,kindOfTest:a,endsWith:function(e,t,i){return e=String(e),(void 0===i||i>e.length)&&(i=e.length),i-=t.length,-1!==(t=e.indexOf(t,i))&&t===i},toArray:function(e){if(!e)return null;var t=e.length;if(c(t))return null;for(var i=new Array(t);0<t--;)i[t]=e[t];return i},isTypedArray:i,isFileList:m}},function(e,t,i){"use strict";var a=i(1);function h(e,t,i,n,s){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),i&&(this.config=i),n&&(this.request=n),s&&(this.response=s)}a.inherits(h,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var c=h.prototype,n={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(e){n[e]={value:e}}),Object.defineProperties(h,n),Object.defineProperty(c,"isAxiosError",{value:!0}),h.from=function(e,t,i,n,s,r){var o=Object.create(c);return a.toFlatObject(e,o,function(e){return e!==Error.prototype}),h.call(o,e.message,t,i,n,s),o.name=e.name,r&&Object.assign(o,r),o},e.exports=h},function(e,t,i){"use strict";var n=i(2);function s(e){n.call(this,null==e?"canceled":e,n.ERR_CANCELED),this.name="CanceledError"}i(1).inherits(s,n,{__CANCEL__:!0}),e.exports=s},function(l,e,u){"use strict";!function(e){var o=u(1),a=u(26),n=u(2),t=u(7),h=u(8),i={"Content-Type":"application/x-www-form-urlencoded"};function c(e,t){!o.isUndefined(e)&&o.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var s,r={transitional:t,adapter:s="undefined"!=typeof XMLHttpRequest||void 0!==e&&"[object process]"===Object.prototype.toString.call(e)?u(9):s,transformRequest:[function(e,t){if(a(t,"Accept"),a(t,"Content-Type"),o.isFormData(e)||o.isArrayBuffer(e)||o.isBuffer(e)||o.isStream(e)||o.isFile(e)||o.isBlob(e))return e;if(o.isArrayBufferView(e))return e.buffer;if(o.isURLSearchParams(e))return c(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var i,n=o.isObject(e),s=t&&t["Content-Type"];if((i=o.isFileList(e))||n&&"multipart/form-data"===s){var r=this.env&&this.env.FormData;return h(i?{"files[]":e}:e,r&&new r)}return n||"application/json"===s?(c(t,"application/json"),function(e,t,i){if(o.isString(e))try{return(t||JSON.parse)(e),o.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(i||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||r.transitional,i=t&&t.silentJSONParsing,t=t&&t.forcedJSONParsing,i=!i&&"json"===this.responseType;if(i||t&&o.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw n.from(e,n.ERR_BAD_RESPONSE,this,null,this.response);throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:u(39)},validateStatus:function(e){return 200<=e&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};o.forEach(["delete","get","head"],function(e){r.headers[e]={}}),o.forEach(["post","put","patch"],function(e){r.headers[e]=o.merge(i)}),l.exports=r}.call(this,u(25))},function(e,t,i){"use strict";e.exports=function(i,n){return function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];return i.apply(n,e)}}},function(e,t,i){"use strict";var s=i(1);function r(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,i){if(!t)return e;var n,i=i?i(t):s.isURLSearchParams(t)?t.toString():(n=[],s.forEach(t,function(e,t){null!=e&&(s.isArray(e)?t+="[]":e=[e],s.forEach(e,function(e){s.isDate(e)?e=e.toISOString():s.isObject(e)&&(e=JSON.stringify(e)),n.push(r(t)+"="+r(e))}))}),n.join("&"));return i&&(-1!==(t=e.indexOf("#"))&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i),e}},function(e,t,i){"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},function(e,t,n){"use strict";!function(i){var h=n(1);e.exports=function(e,o){o=o||new FormData;var t=[];function a(e){return null===e?"":h.isDate(e)?e.toISOString():h.isArrayBuffer(e)||h.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):i.from(e):e}return function s(e,r){if(h.isPlainObject(e)||h.isArray(e)){if(-1!==t.indexOf(e))throw Error("Circular reference detected in "+r);t.push(e),h.forEach(e,function(e,t){if(!h.isUndefined(e)){var i,n=r?r+"."+t:t;if(e&&!r&&"object"==typeof e)if(h.endsWith(t,"{}"))e=JSON.stringify(e);else if(h.endsWith(t,"[]")&&(i=h.toArray(e)))return void i.forEach(function(e){h.isUndefined(e)||o.append(n,a(e))});s(e,n)}}),t.pop()}else o.append(r,a(e))}(e),o}}.call(this,n(27).Buffer)},function(e,t,i){"use strict";var p=i(1),d=i(32),f=i(33),g=i(6),m=i(10),b=i(36),y=i(37),A=i(7),v=i(2),B=i(3),w=i(38);e.exports=function(u){return new Promise(function(t,i){var e,n=u.data,s=u.headers,r=u.responseType;function o(){u.cancelToken&&u.cancelToken.unsubscribe(e),u.signal&&u.signal.removeEventListener("abort",e)}p.isFormData(n)&&p.isStandardBrowserEnv()&&delete s["Content-Type"];var a=new XMLHttpRequest;u.auth&&(c=u.auth.username||"",h=u.auth.password?unescape(encodeURIComponent(u.auth.password)):"",s.Authorization="Basic "+btoa(c+":"+h));var h,c=m(u.baseURL,u.url);function l(){var e;a&&(e="getAllResponseHeaders"in a?b(a.getAllResponseHeaders()):null,e={data:r&&"text"!==r&&"json"!==r?a.response:a.responseText,status:a.status,statusText:a.statusText,headers:e,config:u,request:a},d(function(e){t(e),o()},function(e){i(e),o()},e),a=null)}a.open(u.method.toUpperCase(),g(c,u.params,u.paramsSerializer),!0),a.timeout=u.timeout,"onloadend"in a?a.onloadend=l:a.onreadystatechange=function(){a&&4===a.readyState&&(0!==a.status||a.responseURL&&0===a.responseURL.indexOf("file:"))&&setTimeout(l)},a.onabort=function(){a&&(i(new v("Request aborted",v.ECONNABORTED,u,a)),a=null)},a.onerror=function(){i(new v("Network Error",v.ERR_NETWORK,u,a,a)),a=null},a.ontimeout=function(){var e=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded",t=u.transitional||A;u.timeoutErrorMessage&&(e=u.timeoutErrorMessage),i(new v(e,t.clarifyTimeoutError?v.ETIMEDOUT:v.ECONNABORTED,u,a)),a=null},!p.isStandardBrowserEnv()||(h=(u.withCredentials||y(c))&&u.xsrfCookieName?f.read(u.xsrfCookieName):void 0)&&(s[u.xsrfHeaderName]=h),"setRequestHeader"in a&&p.forEach(s,function(e,t){void 0===n&&"content-type"===t.toLowerCase()?delete s[t]:a.setRequestHeader(t,e)}),p.isUndefined(u.withCredentials)||(a.withCredentials=!!u.withCredentials),r&&"json"!==r&&(a.responseType=u.responseType),"function"==typeof u.onDownloadProgress&&a.addEventListener("progress",u.onDownloadProgress),"function"==typeof u.onUploadProgress&&a.upload&&a.upload.addEventListener("progress",u.onUploadProgress),(u.cancelToken||u.signal)&&(e=function(e){a&&(i(!e||e.type?new B:e),a.abort(),a=null)},u.cancelToken&&u.cancelToken.subscribe(e),u.signal&&(u.signal.aborted?e():u.signal.addEventListener("abort",e)));n=n||null,c=w(c);c&&-1===["http","https","file"].indexOf(c)?i(new v("Unsupported protocol "+c+":",v.ERR_BAD_REQUEST,u)):a.send(n)})}},function(e,t,i){"use strict";var n=i(34),s=i(35);e.exports=function(e,t){return e&&!n(t)?s(e,t):t}},function(e,t,i){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,i){"use strict";var c=i(1);e.exports=function(t,i){i=i||{};var n={};function s(e,t){return c.isPlainObject(e)&&c.isPlainObject(t)?c.merge(e,t):c.isPlainObject(t)?c.merge({},t):c.isArray(t)?t.slice():t}function r(e){return c.isUndefined(i[e])?c.isUndefined(t[e])?void 0:s(void 0,t[e]):s(t[e],i[e])}function e(e){if(!c.isUndefined(i[e]))return s(void 0,i[e])}function o(e){return c.isUndefined(i[e])?c.isUndefined(t[e])?void 0:s(void 0,t[e]):s(void 0,i[e])}function a(e){return e in i?s(t[e],i[e]):e in t?s(void 0,t[e]):void 0}var h={url:e,method:e,data:e,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a};return c.forEach(Object.keys(t).concat(Object.keys(i)),function(e){var t=h[e]||r,i=t(e);c.isUndefined(i)&&t!==a||(n[e]=i)}),n}},function(e,t){e.exports={version:"0.27.2"}},function(e,t,i){e.exports=i(20)},function(e,t){e.exports=n},function(e,t){e.exports=s},function(e,t){e.exports=r},function(e,t){e.exports=o},function(e,t){e.exports=a},function(e,t,i){"use strict";var s=i(1),r=i(5),o=i(21),a=i(12);var n=function t(i){var e=new o(i),n=r(o.prototype.request,e);return s.extend(n,o.prototype,e),s.extend(n,e),n.create=function(e){return t(a(i,e))},n}(i(4));n.Axios=o,n.CanceledError=i(3),n.CancelToken=i(41),n.isCancel=i(11),n.VERSION=i(13).version,n.toFormData=i(8),n.AxiosError=i(2),n.Cancel=n.CanceledError,n.all=function(e){return Promise.all(e)},n.spread=i(42),n.isAxiosError=i(43),e.exports=n,e.exports.default=n},function(e,t,i){"use strict";var n=i(1),s=i(6),r=i(22),l=i(23),u=i(12),o=i(10),p=i(40),d=p.validators;function a(e){this.defaults=e,this.interceptors={request:new r,response:new r}}a.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=u(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";e=t.transitional;void 0!==e&&p.assertOptions(e,{silentJSONParsing:d.transitional(d.boolean),forcedJSONParsing:d.transitional(d.boolean),clarifyTimeoutError:d.transitional(d.boolean)},!1);var i=[],n=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});var s,r=[];if(this.interceptors.response.forEach(function(e){r.push(e.fulfilled,e.rejected)}),!n){var o=[l,void 0];for(Array.prototype.unshift.apply(o,i),o=o.concat(r),s=Promise.resolve(t);o.length;)s=s.then(o.shift(),o.shift());return s}for(var a=t;i.length;){var h=i.shift(),c=i.shift();try{a=h(a)}catch(e){c(e);break}}try{s=l(a)}catch(e){return Promise.reject(e)}for(;r.length;)s=s.then(r.shift(),r.shift());return s},a.prototype.getUri=function(e){e=u(this.defaults,e);var t=o(e.baseURL,e.url);return s(t,e.params,e.paramsSerializer)},n.forEach(["delete","get","head","options"],function(i){a.prototype[i]=function(e,t){return this.request(u(t||{},{method:i,url:e,data:(t||{}).data}))}}),n.forEach(["post","put","patch"],function(s){function e(n){return function(e,t,i){return this.request(u(i||{},{method:s,headers:n?{"Content-Type":"multipart/form-data"}:{},url:e,data:t}))}}a.prototype[s]=e(),a.prototype[s+"Form"]=e(!0)}),e.exports=a},function(e,t,i){"use strict";var n=i(1);function s(){this.handlers=[]}s.prototype.use=function(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1},s.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},s.prototype.forEach=function(t){n.forEach(this.handlers,function(e){null!==e&&t(e)})},e.exports=s},function(e,t,i){"use strict";var n=i(1),s=i(24),r=i(11),o=i(4),a=i(3);function h(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a}e.exports=function(t){return h(t),t.headers=t.headers||{},t.data=s.call(t,t.data,t.headers,t.transformRequest),t.headers=n.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),n.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||o.adapter)(t).then(function(e){return h(t),e.data=s.call(t,e.data,e.headers,t.transformResponse),e},function(e){return r(e)||(h(t),e&&e.response&&(e.response.data=s.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(e,t,i){"use strict";var s=i(1),r=i(4);e.exports=function(t,i,e){var n=this||r;return s.forEach(e,function(e){t=e.call(n,t,i)}),t}},function(e,t){var i,n,e=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(i===setTimeout)return setTimeout(t,0);if((i===s||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:s}catch(e){i=s}try{n="function"==typeof clearTimeout?clearTimeout:r}catch(e){n=r}}();var a,h=[],c=!1,l=-1;function u(){c&&a&&(c=!1,a.length?h=a.concat(h):l=-1,h.length&&p())}function p(){if(!c){var e=o(u);c=!0;for(var t=h.length;t;){for(a=h,h=[];++l<t;)a&&a[l].run();l=-1,t=h.length}a=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===r||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function f(){}e.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];h.push(new d(e,t)),1!==h.length||c||o(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},e.title="browser",e.browser=!0,e.env={},e.argv=[],e.version="",e.versions={},e.on=f,e.addListener=f,e.once=f,e.off=f,e.removeListener=f,e.removeAllListeners=f,e.emit=f,e.prependListener=f,e.prependOnceListener=f,e.listeners=function(e){return[]},e.binding=function(e){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(e){throw new Error("process.chdir is not supported")},e.umask=function(){return 0}},function(e,t,i){"use strict";var s=i(1);e.exports=function(i,n){s.forEach(i,function(e,t){t!==n&&t.toUpperCase()===n.toUpperCase()&&(i[n]=e,delete i[t])})}},function(e,P,S){"use strict";!function(e){var a=S(29),r=S(30),o=S(31);function i(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(i()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(e=null===e?new u(t):e).length=t,e}function u(e,t,i){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,i);if("number"!=typeof e)return n(this,e,t,i);if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return c(this,e)}function n(e,t,i,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,i,n){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===i&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,i):new Uint8Array(t,i,n);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=l(e,t);return e}(e,t,i,n):"string"==typeof t?function(e,t,i){"string"==typeof i&&""!==i||(i="utf8");if(!u.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(t,i),i=(e=s(e,n)).write(t,i);i!==n&&(e=e.slice(0,i));return e}(e,t,i):function(e,t){if(u.isBuffer(t)){var i=0|p(t.length);return 0===(e=s(e,i)).length?e:(t.copy(e,0,0,i),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||function(e){return e!=e}(t.length)?s(e,0):l(e,t);if("Buffer"===t.type&&o(t.data))return l(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function c(e,t){if(h(t),e=s(e,t<0?0:0|p(t)),!u.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function l(e,t){var i=t.length<0?0:0|p(t.length);e=s(e,i);for(var n=0;n<i;n+=1)e[n]=255&t[n];return e}function p(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function d(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;var i=(e="string"!=typeof e?""+e:e).length;if(0===i)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return C(e).length;default:if(n)return R(e).length;t=(""+t).toLowerCase(),n=!0}}function t(e,t,i){var n,s,r,o=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((i=void 0===i||i>this.length?this.length:i)<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return function(e,t,i){var n=e.length;(!t||t<0)&&(t=0);(!i||i<0||n<i)&&(i=n);for(var s="",r=t;r<i;++r)s+=function(e){return e<16?"0"+e.toString(16):e.toString(16)}(e[r]);return s}(this,t,i);case"utf8":case"utf-8":return A(this,t,i);case"ascii":return function(e,t,i){var n="";i=Math.min(e.length,i);for(var s=t;s<i;++s)n+=String.fromCharCode(127&e[s]);return n}(this,t,i);case"latin1":case"binary":return function(e,t,i){var n="";i=Math.min(e.length,i);for(var s=t;s<i;++s)n+=String.fromCharCode(e[s]);return n}(this,t,i);case"base64":return n=this,r=i,0===(s=t)&&r===n.length?a.fromByteArray(n):a.fromByteArray(n.slice(s,r));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,i){for(var n=e.slice(t,i),s="",r=0;r<n.length;r+=2)s+=String.fromCharCode(n[r]+256*n[r+1]);return s}(this,t,i);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function f(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function g(e,t,i,n,s){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):2147483647<i?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,(i=(i=isNaN(i)?s?0:e.length-1:i)<0?e.length+i:i)>=e.length){if(s)return-1;i=e.length-1}else if(i<0){if(!s)return-1;i=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:m(e,t,i,n,s);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(s?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,i):m(e,[t],i,n,s);throw new TypeError("val must be string, number or Buffer")}function m(e,t,i,n,s){var r=1,o=e.length,a=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o/=r=2,a/=2,i/=2}function h(e,t){return 1===r?e[t]:e.readUInt16BE(t*r)}if(s)for(var c=-1,l=i;l<o;l++)if(h(e,l)===h(t,-1===c?0:l-c)){if(l-(c=-1===c?l:c)+1===a)return c*r}else-1!==c&&(l-=l-c),c=-1;else for(l=i=o<i+a?o-a:i;0<=l;l--){for(var u=!0,p=0;p<a;p++)if(h(e,l+p)!==h(t,p)){u=!1;break}if(u)return l}return-1}function b(e,t,i,n){return N(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,n)}function y(e,t,i,n){return N(function(e,t){for(var i,n,s=[],r=0;r<e.length&&!((t-=2)<0);++r)n=e.charCodeAt(r),i=n>>8,n=n%256,s.push(n),s.push(i);return s}(t,e.length-i),e,i,n)}function A(e,t,i){i=Math.min(e.length,i);for(var n=[],s=t;s<i;){var r,o,a,h,c=e[s],l=null,u=239<c?4:223<c?3:191<c?2:1;if(s+u<=i)switch(u){case 1:c<128&&(l=c);break;case 2:128==(192&(r=e[s+1]))&&127<(h=(31&c)<<6|63&r)&&(l=h);break;case 3:r=e[s+1],o=e[s+2],128==(192&r)&&128==(192&o)&&2047<(h=(15&c)<<12|(63&r)<<6|63&o)&&(h<55296||57343<h)&&(l=h);break;case 4:r=e[s+1],o=e[s+2],a=e[s+3],128==(192&r)&&128==(192&o)&&128==(192&a)&&65535<(h=(15&c)<<18|(63&r)<<12|(63&o)<<6|63&a)&&h<1114112&&(l=h)}null===l?(l=65533,u=1):65535<l&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),s+=u}return function(e){var t=e.length;if(t<=v)return String.fromCharCode.apply(String,e);var i="",n=0;for(;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=v));return i}(n)}P.Buffer=u,P.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},P.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),P.kMaxLength=i(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,i){return n(null,e,t,i)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,i){return n=null,t=t,i=i,h(e=e),!(e<=0)&&void 0!==t?"string"==typeof i?s(n,e).fill(t,i):s(n,e).fill(t):s(n,e);var n},u.allocUnsafe=function(e){return c(null,e)},u.allocUnsafeSlow=function(e){return c(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,n=t.length,s=0,r=Math.min(i,n);s<r;++s)if(e[s]!==t[s]){i=e[s],n=t[s];break}return i<n?-1:n<i?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);if(void 0===t)for(s=t=0;s<e.length;++s)t+=e[s].length;for(var i=u.allocUnsafe(t),n=0,s=0;s<e.length;++s){var r=e[s];if(!u.isBuffer(r))throw new TypeError('"list" argument must be an Array of Buffers');r.copy(i,n),n+=r.length}return i},u.byteLength=d,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)f(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)f(this,t,t+3),f(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)f(this,t,t+7),f(this,t+1,t+6),f(this,t+2,t+5),f(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0==e?"":0===arguments.length?A(this,0,e):t.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",t=P.INSPECT_MAX_BYTES;return 0<this.length&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,i,n,s){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===s&&(s=this.length),(t=void 0===t?0:t)<0||i>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(s<=n&&i<=t)return 0;if(s<=n)return-1;if(i<=t)return 1;if(this===e)return 0;for(var r=(s>>>=0)-(n>>>=0),o=(i>>>=0)-(t>>>=0),a=Math.min(r,o),h=this.slice(n,s),c=e.slice(t,i),l=0;l<a;++l)if(h[l]!==c[l]){r=h[l],o=c[l];break}return r<o?-1:o<r?1:0},u.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},u.prototype.indexOf=function(e,t,i){return g(this,e,t,i,!0)},u.prototype.lastIndexOf=function(e,t,i){return g(this,e,t,i,!1)},u.prototype.write=function(e,t,i,n){if(void 0===t)n="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)n=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var s=this.length-t;if((void 0===i||s<i)&&(i=s),0<e.length&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var r,o,a,h=!1;;)switch(n){case"hex":return function(e,t,i,n){i=Number(i)||0;var s=e.length-i;if((!n||s<(n=Number(n)))&&(n=s),(s=t.length)%2!=0)throw new TypeError("Invalid hex string");s/2<n&&(n=s/2);for(var r=0;r<n;++r){var o=parseInt(t.substr(2*r,2),16);if(isNaN(o))return r;e[i+r]=o}return r}(this,e,t,i);case"utf8":case"utf-8":return o=t,a=i,N(R(e,(r=this).length-o),r,o,a);case"ascii":return b(this,e,t,i);case"latin1":case"binary":return b(this,e,t,i);case"base64":return r=this,o=t,a=i,N(C(e),r,o,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,i);default:if(h)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),h=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var v=4096;function B(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(i<e+t)throw new RangeError("Trying to access beyond buffer length")}function w(e,t,i,n,s,r){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(s<t||t<r)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}function T(e,t,i,n){t<0&&(t=65535+t+1);for(var s=0,r=Math.min(e.length-i,2);s<r;++s)e[i+s]=(t&255<<8*(n?s:1-s))>>>8*(n?s:1-s)}function x(e,t,i,n){t<0&&(t=4294967295+t+1);for(var s=0,r=Math.min(e.length-i,4);s<r;++s)e[i+s]=t>>>8*(n?s:3-s)&255}function E(e,t,i,n){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function M(e,t,i,n,s){return s||E(e,0,i,4),r.write(e,t,i,n,23,4),i+4}function O(e,t,i,n,s){return s||E(e,0,i,8),r.write(e,t,i,n,52,8),i+8}u.prototype.slice=function(e,t){var i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i<e&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):i<t&&(t=i),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(s=this.subarray(e,t)).__proto__=u.prototype;else for(var n=t-e,s=new u(n,void 0),r=0;r<n;++r)s[r]=this[r+e];return s},u.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||B(e,t,this.length);for(var n=this[e],s=1,r=0;++r<t&&(s*=256);)n+=this[e+r]*s;return n},u.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||B(e,t,this.length);for(var n=this[e+--t],s=1;0<t&&(s*=256);)n+=this[e+--t]*s;return n},u.prototype.readUInt8=function(e,t){return t||B(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||B(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||B(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||B(e,t,this.length);for(var n=this[e],s=1,r=0;++r<t&&(s*=256);)n+=this[e+r]*s;return(s*=128)<=n&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||B(e,t,this.length);for(var n=t,s=1,r=this[e+--n];0<n&&(s*=256);)r+=this[e+--n]*s;return(s*=128)<=r&&(r-=Math.pow(2,8*t)),r},u.prototype.readInt8=function(e,t){return t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||B(e,2,this.length);e=this[e]|this[e+1]<<8;return 32768&e?4294901760|e:e},u.prototype.readInt16BE=function(e,t){t||B(e,2,this.length);e=this[e+1]|this[e]<<8;return 32768&e?4294901760|e:e},u.prototype.readInt32LE=function(e,t){return t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||B(e,4,this.length),r.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||B(e,4,this.length),r.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||B(e,8,this.length),r.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||B(e,8,this.length),r.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,i,n){e=+e,t|=0,i|=0,n||w(this,e,t,i,Math.pow(2,8*i)-1,0);var s=1,r=0;for(this[t]=255&e;++r<i&&(s*=256);)this[t+r]=e/s&255;return t+i},u.prototype.writeUIntBE=function(e,t,i,n){e=+e,t|=0,i|=0,n||w(this,e,t,i,Math.pow(2,8*i)-1,0);var s=i-1,r=1;for(this[t+s]=255&e;0<=--s&&(r*=256);)this[t+s]=e/r&255;return t+i},u.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):T(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):T(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):x(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):x(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,i,n){e=+e,t|=0,n||w(this,e,t,i,(n=Math.pow(2,8*i-1))-1,-n);var s=0,r=1,o=0;for(this[t]=255&e;++s<i&&(r*=256);)e<0&&0===o&&0!==this[t+s-1]&&(o=1),this[t+s]=(e/r>>0)-o&255;return t+i},u.prototype.writeIntBE=function(e,t,i,n){e=+e,t|=0,n||w(this,e,t,i,(n=Math.pow(2,8*i-1))-1,-n);var s=i-1,r=1,o=0;for(this[t+s]=255&e;0<=--s&&(r*=256);)e<0&&0===o&&0!==this[t+s+1]&&(o=1),this[t+s]=(e/r>>0)-o&255;return t+i},u.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&(e=e<0?255+e+1:e),t+1},u.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):T(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):T(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):x(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):x(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,i){return M(this,e,t,!0,i)},u.prototype.writeFloatBE=function(e,t,i){return M(this,e,t,!1,i)},u.prototype.writeDoubleLE=function(e,t,i){return O(this,e,t,!0,i)},u.prototype.writeDoubleBE=function(e,t,i){return O(this,e,t,!1,i)},u.prototype.copy=function(e,t,i,n){if(i=i||0,n||0===n||(n=this.length),t>=e.length&&(t=e.length),(n=0<n&&n<i?i:n)===i)return 0;if(0===e.length||0===this.length)return 0;if((t=t||0)<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);var s,r=(n=e.length-t<n-i?e.length-t+i:n)-i;if(this===e&&i<t&&t<n)for(s=r-1;0<=s;--s)e[s+t]=this[s+i];else if(r<1e3||!u.TYPED_ARRAY_SUPPORT)for(s=0;s<r;++s)e[s+t]=this[s+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+r),t);return r},u.prototype.fill=function(e,t,i,n){if("string"==typeof e){var s;if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),1!==e.length||(s=e.charCodeAt(0))<256&&(e=s),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;if(t>>>=0,i=void 0===i?this.length:i>>>0,"number"==typeof(e=e||0))for(a=t;a<i;++a)this[a]=e;else for(var r=u.isBuffer(e)?e:R(new u(e,n).toString()),o=r.length,a=0;a<i-t;++a)this[a+t]=r[a%o];return this};var L=/[^+\/0-9A-Za-z-_]/g;function R(e,t){var i;t=t||1/0;for(var n=e.length,s=null,r=[],o=0;o<n;++o){if(55295<(i=e.charCodeAt(o))&&i<57344){if(!s){if(56319<i){-1<(t-=3)&&r.push(239,191,189);continue}if(o+1===n){-1<(t-=3)&&r.push(239,191,189);continue}s=i;continue}if(i<56320){-1<(t-=3)&&r.push(239,191,189),s=i;continue}i=65536+(s-55296<<10|i-56320)}else s&&-1<(t-=3)&&r.push(239,191,189);if(s=null,i<128){if(--t<0)break;r.push(i)}else if(i<2048){if((t-=2)<0)break;r.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;r.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;r.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return r}function C(e){return a.toByteArray(function(e){var t;if((e=((t=e).trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function N(e,t,i,n){for(var s=0;s<n&&!(s+i>=t.length||s>=e.length);++s)t[s+i]=e[s];return s}}.call(this,S(28))},function(e,t){var i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t,i){"use strict";t.byteLength=function(e){var t=l(e),e=t[0],t=t[1];return 3*(e+t)/4-t},t.toByteArray=function(e){var t,i,n=l(e),s=n[0],n=n[1],r=new c(function(e,t){return 3*(e+t)/4-t}(s,n)),o=0,a=0<n?s-4:s;for(i=0;i<a;i+=4)t=h[e.charCodeAt(i)]<<18|h[e.charCodeAt(i+1)]<<12|h[e.charCodeAt(i+2)]<<6|h[e.charCodeAt(i+3)],r[o++]=t>>16&255,r[o++]=t>>8&255,r[o++]=255&t;2===n&&(t=h[e.charCodeAt(i)]<<2|h[e.charCodeAt(i+1)]>>4,r[o++]=255&t);1===n&&(t=h[e.charCodeAt(i)]<<10|h[e.charCodeAt(i+1)]<<4|h[e.charCodeAt(i+2)]>>2,r[o++]=t>>8&255,r[o++]=255&t);return r},t.fromByteArray=function(e){for(var t,i=e.length,n=i%3,s=[],r=0,o=i-n;r<o;r+=16383)s.push(function(e,t,i){for(var n,s=[],r=t;r<i;r+=3)n=(e[r]<<16&16711680)+(e[r+1]<<8&65280)+(255&e[r+2]),s.push(function(e){return a[e>>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}(n));return s.join("")}(e,r,o<r+16383?o:r+16383));1==n?(t=e[i-1],s.push(a[t>>2]+a[t<<4&63]+"==")):2==n&&(t=(e[i-2]<<8)+e[i-1],s.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return s.join("")};for(var a=[],h=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,r=n.length;s<r;++s)a[s]=n[s],h[n.charCodeAt(s)]=s;function l(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");e=e.indexOf("=");return[e=-1===e?t:e,e===t?0:4-e%4]}h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,i,n,s){var r,o,a=8*s-n-1,h=(1<<a)-1,c=h>>1,l=-7,u=i?s-1:0,p=i?-1:1,i=e[t+u];for(u+=p,r=i&(1<<-l)-1,i>>=-l,l+=a;0<l;r=256*r+e[t+u],u+=p,l-=8);for(o=r&(1<<-l)-1,r>>=-l,l+=n;0<l;o=256*o+e[t+u],u+=p,l-=8);if(0===r)r=1-c;else{if(r===h)return o?NaN:1/0*(i?-1:1);o+=Math.pow(2,n),r-=c}return(i?-1:1)*o*Math.pow(2,r-n)},t.write=function(e,t,i,n,s,r){var o,a,h=8*r-s-1,c=(1<<h)-1,l=c>>1,u=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:r-1,d=n?1:-1,r=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(n=Math.pow(2,-o))<1&&(o--,n*=2),2<=(t+=1<=o+l?u/n:u*Math.pow(2,1-l))*n&&(o++,n/=2),c<=o+l?(a=0,o=c):1<=o+l?(a=(t*n-1)*Math.pow(2,s),o+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,s),o=0));8<=s;e[i+p]=255&a,p+=d,a/=256,s-=8);for(o=o<<s|a,h+=s;0<h;e[i+p]=255&o,p+=d,o/=256,h-=8);e[i+p-d]|=128*r}},function(e,t){var i={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},function(e,t,i){"use strict";var s=i(2);e.exports=function(e,t,i){var n=i.config.validateStatus;i.status&&n&&!n(i.status)?t(new s("Request failed with status code "+i.status,[s.ERR_BAD_REQUEST,s.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i)):e(i)}},function(e,t,i){"use strict";var a=i(1);e.exports=a.isStandardBrowserEnv()?{write:function(e,t,i,n,s,r){var o=[];o.push(e+"="+encodeURIComponent(t)),a.isNumber(i)&&o.push("expires="+new Date(i).toGMTString()),a.isString(n)&&o.push("path="+n),a.isString(s)&&o.push("domain="+s),!0===r&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){e=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,i){"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},function(e,t,i){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,i){"use strict";var s=i(1),r=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,i,n={};return e&&s.forEach(e.split("\n"),function(e){i=e.indexOf(":"),t=s.trim(e.substr(0,i)).toLowerCase(),i=s.trim(e.substr(i+1)),t&&(n[t]&&0<=r.indexOf(t)||(n[t]="set-cookie"===t?(n[t]||[]).concat([i]):n[t]?n[t]+", "+i:i))}),n}},function(e,t,i){"use strict";var n,s,r,o=i(1);function a(e){return s&&(r.setAttribute("href",e),e=r.href),r.setAttribute("href",e),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}e.exports=o.isStandardBrowserEnv()?(s=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),n=a(window.location.href),function(e){e=o.isString(e)?a(e):e;return e.protocol===n.protocol&&e.host===n.host}):function(){return!0}},function(e,t,i){"use strict";e.exports=function(e){e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return e&&e[1]||""}},function(e,t){e.exports=null},function(e,t,i){"use strict";var o=i(13).version,h=i(2),n={};["object","boolean","number","function","string","symbol"].forEach(function(t,i){n[t]=function(e){return typeof e===t||"a"+(i<1?"n ":" ")+t}});var a={};n.transitional=function(n,s,i){function r(e,t){return"[Axios v"+o+"] Transitional option '"+e+"'"+t+(i?". "+i:"")}return function(e,t,i){if(!1===n)throw new h(r(t," has been removed"+(s?" in "+s:"")),h.ERR_DEPRECATED);return s&&!a[t]&&(a[t]=!0,console.warn(r(t," has been deprecated since v"+s+" and will be removed in the near future"))),!n||n(e,t,i)}},e.exports={assertOptions:function(e,t,i){if("object"!=typeof e)throw new h("options must be an object",h.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),s=n.length;0<s--;){var r=n[s],o=t[r];if(o){var a=e[r],a=void 0===a||o(a,r,e);if(!0!==a)throw new h("option "+r+" must be "+a,h.ERR_BAD_OPTION_VALUE)}else if(!0!==i)throw new h("Unknown option "+r,h.ERR_BAD_OPTION)}},validators:n}},function(e,t,i){"use strict";var s=i(3);function n(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;this.promise.then(function(e){if(n._listeners){for(var t=n._listeners.length,i=0;i<t;i++)n._listeners[i](e);n._listeners=null}}),this.promise.then=function(e){var t,e=new Promise(function(e){n.subscribe(e),t=e}).then(e);return e.cancel=function(){n.unsubscribe(t)},e},e(function(e){n.reason||(n.reason=new s(e),t(n.reason))})}n.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},n.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},n.prototype.unsubscribe=function(e){!this._listeners||-1!==(e=this._listeners.indexOf(e))&&this._listeners.splice(e,1)},n.source=function(){var t;return{token:new n(function(e){t=e}),cancel:t}},e.exports=n},function(e,t,i){"use strict";e.exports=function(t){return function(e){return t.apply(null,e)}}},function(e,t,i){"use strict";var n=i(1);e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},function(e,t,i){"use strict";i.r(t),i.d(t,"default",function(){return D});i(15),i(16),i(17),i(18),i(19);var s,t=i(0),p=i.n(t);class n{constructor(e){this.app=e,this.camera=new BABYLON.ArcRotateCamera("camera",-Math.PI/4,Math.PI/4,50,new BABYLON.Vector3(0,0,0),this.app.scene),this.camera.pinchPrecision=200,this.app.scene.activeCamera=this.camera,this.camera.attachControl(this.app.canvas,!0,!0),this.camera.minZ=.3,this.camera.wheelDeltaPercentage=.01,this.frustrum=5,this.isOverLook=!1,this.tw_camera=new p.a.Tween(this.camera),this.tw_target=new p.a.Tween(this.camera.target)}orthographic(){this.isOverLook=!0,this.camera.lowerBetaLimit=0,this.camera.upperBetaLimit=0,this.camera.lowerAlphaLimit=Math.PI/2,this.camera.upperAlphaLimit=Math.PI/2,this.camera.mode=BABYLON.Camera.ORTHOGRAPHIC_CAMERA;var e=this.app.Resources.BOX.getBoundingInfo();this.camera.lowerRadiusLimit=e.maximum.y-e.minimum.y;var t=e.boundingSphere.radiusWorld;this.camera.radius=t;t=e.boundingSphere.center.clone();this.camera.target=new BABYLON.Vector3(t.x,0,t.z),this.frustrum=.6*(e.maximum.x-e.minimum.x),this.computeCameraView()}perspective(){this._perspective(this.app.Project.current.Sight)}_perspective(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.isOverLook=!1,this.camera.lowerRadiusLimit=e.minimumLimit,this.camera.upperRadiusLimit=e.maximumLimit,this.camera.panningSensibility=1e3,this.camera.lowerBetaLimit=.01,this.camera.upperBetaLimit=Math.PI/2*.98,this.camera.lowerAlphaLimit=null,this.camera.upperAlphaLimit=null,this.camera.mode=BABYLON.Camera.PERSPECTIVE_CAMERA,(this.camera.alpha>2*Math.PI||this.camera.alpha<-2*Math.PI)&&(this.camera.alpha=this.camera.alpha-Math.floor(this.camera.alpha/(2*Math.PI))*(2*Math.PI)),this.camera.alpha=e.alpha,this.tw_target.to(e.focus,500).start().onComplete(()=>{this.tw_camera.to({radius:e.radius,beta:e.beta},500).start()}),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}flyTo(e,t=300){(this.camera.alpha>2*Math.PI||this.camera.alpha<-2*Math.PI)&&(this.camera.alpha=this.camera.alpha-Math.floor(this.camera.alpha/(2*Math.PI))*(2*Math.PI)),this.tw_target.to({x:e.focus.x,y:e.focus.y,z:e.focus.z},t).start().onComplete(()=>{this.tw_camera.to({radius:e.radius,beta:e.beta,alpha:e.alpha},t).start()}),this.camera.lowerRadiusLimit=e.minimumLimit,this.camera.upperRadiusLimit=e.maximumLimit,this.camera.lowerBetaLimit=e.minBeta,this.camera.upperBetaLimit=e.maxBeta}translation(e,t=300){this.tw_target.to({x:e.focus.x,y:e.focus.y,z:e.focus.z},t).start().onComplete(()=>{this.tw_camera.to({radius:e.radius},t).start()})}computeCameraView(){var e=this.app.canvas.clientWidth/this.app.canvas.clientHeight;this.camera.orthoLeft=-e*this.frustrum,this.camera.orthoRight=e*this.frustrum,this.camera.orthoTop=this.frustrum,this.camera.orthoBottom=-this.frustrum;e=1e3/(this.frustrum/20);this.camera.panningSensibility=2e3<e?2e3:e<10?10:e}_wheel(e){this.isOverLook&&(e=(e.wheelDelta||24*-e.detail)<0?1.1:.9,this.frustrum*=e,this.computeCameraView())}}class f{constructor(){this.map={}}add(e,t){this.map[e]=t}find(e){return this.map[e]}remove(e){delete this.map[e]}termRemove(e){for(var t in this.map)e(this.map[t])&&delete this.map[t]}showAll(){for(var e in this.map)this.map[e]}count(){var e,t=0;for(e in Object.keys(this.map))++t;return t}clear(){for(var e in this.map)delete this.map[e]}}class r{static getGUID(e){var t,i,n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),s=[],r=n.length;if(e)for(t=0;t<e;t++)s[t]=n[0|Math.random()*r];else for(s[8]=s[13]=s[18]=s[23]="-",s[14]="4",t=0;t<36;t++)s[t]||(i=0|16*Math.random(),s[t]=n[19==t?3&i|8:i]);return s.join("")}}class o{constructor(e){this.objectType="Light",this.app=e}load(){}}class a extends o{load(){this.light=new BABYLON.DirectionalLight(this.id,this.direction,this.app.scene),this.light.position=this.position,this.light.intensity=this.intensity,this.light.diffuse=BABYLON.Color3.FromHexString(this.color),this.light.specular=BABYLON.Color3.Black()}}class h extends o{load(){this.light=new BABYLON.HemisphericLight(this.id,this.direction,this.app.scene),this.light.intensity=this.intensity,this.light.diffuse=BABYLON.Color3.FromHexString(this.color),this.light.specular=BABYLON.Color3.Black()}}(t=s=s||{}).Point="Point",t.Spot="Spot",t.Directional="Directional",t.Hemispheric="Hemispheric";var g;class c extends o{load(){this.light=new BABYLON.PointLight(this.id,this.position.clone(),this.app.scene),this.light.range=this.range,this.light.intensity=this.intensity,this.light.diffuse=BABYLON.Color3.FromHexString(this.color),this.light.specular=BABYLON.Color3.Black()}}class l extends o{load(){this.light=new BABYLON.SpotLight(this.id,this.position.clone(),this.direction.clone(),this.angle*Math.PI/180,this.exponent,this.app.scene),this.light.range=this.range,this.light.position=this.position,this.light.intensity=this.intensity,this.light.diffuse=BABYLON.Color3.FromHexString(this.color),this.light.specular=BABYLON.Color3.Black()}}class m{static vector3ToJson(e){return{x:Math.floor(1e3*e.x)/1e3,y:Math.floor(1e3*e.y)/1e3,z:Math.floor(1e3*e.z)/1e3}}static vector3ARRToJson(e){let t=[];return e.forEach(e=>t.push({x:Math.floor(1e3*e.x)/1e3,y:Math.floor(1e3*e.y)/1e3,z:Math.floor(1e3*e.z)/1e3})),t}static ToVector3(e){return new BABYLON.Vector3(Math.floor(1e3*e.x)/1e3,Math.floor(1e3*e.y)/1e3,Math.floor(1e3*e.z)/1e3)}static ToARRVector3(e){let t=[];return e.forEach(e=>t.push(new BABYLON.Vector3(Math.floor(1e3*e.x)/1e3,Math.floor(1e3*e.y)/1e3,Math.floor(1e3*e.z)/1e3))),t}static computeBounds(e){let t=e.getChildMeshes(),i=e.getBoundingInfo();if(0<t.length){for(var n=t[0].getBoundingInfo(),s=n.minimum.add(t[0].position),r=n.maximum.add(t[0].position),o=1;o<t.length;o++)n=t[o].getBoundingInfo(),s=BABYLON.Vector3.Minimize(s,n.minimum.add(t[o].position)),r=BABYLON.Vector3.Maximize(r,n.maximum.add(t[o].position));i=new BABYLON.BoundingInfo(s,r)}return i}static computeBoundsToARR(e){for(var t=e[0].getBoundingInfo(),i=t.minimum.add(e[0].position),n=t.maximum.add(e[0].position),s=1;s<e.length;s++)t=e[s].getBoundingInfo(),i=BABYLON.Vector3.Minimize(i,t.minimum.add(e[s].position)),n=BABYLON.Vector3.Maximize(n,t.maximum.add(e[s].position));return new BABYLON.BoundingInfo(i,n)}static Expand(n,s){let r=new Array;var o=n.length;for(let i=0;i<o;i++){var a=n[i],h=n[0==i?o-1:i-1],c=n[i==o-1?0:i+1],l=h.x-a.x,u=h.z-a.z,p=this.norm(l,u);l/=p,u/=p;h=c.x-a.x,p=c.z-a.z,c=this.norm(h,p);h/=c,p/=c;c=-s/Math.sqrt((1-(l*h+u*p))/2);let e=l+h,t=u+p;c=0==this.norm(e,t)?0:c/this.norm(e,t);e*=c,t*=c,r[i]=new BABYLON.Vector3(e+a.x,0,t+a.z)}return r}static norm(e,t){return Math.sqrt(e*e+t*t)}static MergeMeshes(r,e){let o=new BABYLON.Mesh((new Date).getDate().toString(),e.scene);return setTimeout(()=>{let t=null,i;for(let e=0;e<r.length;e++){var n,s;r[e]&&(s=(n=r[e]).computeWorldMatrix(!0),i=BABYLON.VertexData.ExtractFromMesh(n,!0,!0),i.transform(s),t?t.merge(i,!0):t=i,n.dispose(!1,!0))}t.applyToMesh(o)}),o}static DeconsTructMesh(e,t,i){if(1<e.subMeshes.length){for(var n=BABYLON.VertexData.ExtractFromMesh(e,!0,!0),s=n.indices,r=n.normals,o=n.positions,a=n.uvs,h=new Array,c=0;c<e.subMeshes.length;c++){for(var l=new BABYLON.VertexData,u=s.slice(e.subMeshes[c].indexStart,e.subMeshes[c].indexStart+e.subMeshes[c].indexCount),p=r.slice(3*e.subMeshes[c].verticesStart,3*e.subMeshes[c].verticesStart+3*e.subMeshes[c].verticesCount),d=o.slice(3*e.subMeshes[c].verticesStart,3*e.subMeshes[c].verticesStart+3*e.subMeshes[c].verticesCount),f=a.slice(2*e.subMeshes[c].verticesStart,2*e.subMeshes[c].verticesStart+2*e.subMeshes[c].verticesCount),g=0;g<u.length;g++)u[g]=u[g]-e.subMeshes[c].verticesStart;l.indices=u,l.normals=p,l.positions=d,l.uvs=f;f=new BABYLON.Mesh(e.id+"-"+c,i.scene);l.applyToMesh(f),f.position.y=parseFloat(t),f.setEnabled(!1),h.push(f)}return e.dispose(!1,!0),h}return[e]}static getVisualAngle(e,t){let i={};var n=e.boundingSphere.radiusWorld,s=t.engine.getAspectRatio(t.Camera.camera);let r=t.Camera.camera.fov/1.2;return s<1&&(r=Math.atan(s*Math.tan(t.Camera.camera.fov/2))),i.radius=1.1*Math.abs(n/Math.sin(r)),i.alpha=Math.PI/2,i.beta=Math.PI/4,i.focus=e.boundingSphere.center.clone(),i}static pathTransformation(i,n){let e=new BABYLON.Path3D(i);var s=e.getTangents();let r=[];for(let t=0;t<i.length;t++)if(0<t&&t<i.length-1){var o=i[t-1],a=i[t+1],h=i[t];let e=s[t-1];var c=s[t];if(!e.equals(c)){o=BABYLON.Vector3.Lerp(h,o,n/BABYLON.Vector3.Distance(o,h)),a=BABYLON.Vector3.Lerp(h,a,n/BABYLON.Vector3.Distance(a,h));let e=BABYLON.Curve3.CreateQuadraticBezier(o,h,a,10);r=r.concat(e.getPoints())}}else r.push(i[t]);return r}static createTube(e,t,i=.05,n){return BABYLON.MeshBuilder.CreateTube(e,{path:this.pathTransformation(t,i),radius:i/2},n.scene)}static getAngleFromVector2(e,t,i){var n=(e.x-t.x)*(i.x-t.x)+(e.y-t.y)*(i.y-t.y),t=(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x),n=Math.atan2(t,n);return Math.PI-n}static getAngleFromVector3(e,t,i){return this.getAngleFromVector2(new BABYLON.Vector2(e.x,e.z),new BABYLON.Vector2(t.x,t.z),new BABYLON.Vector2(i.x,i.z))}static RandomNumBoth(e,t){var i=t-e,t=Math.random();return e+Math.round(t*i)}}class u{constructor(e){this.isOK=!1,this.app=e,this.ele=document.createElement("div"),this.ele.style.cssText="position: absolute;z-index:999999999; font-size: 10px;color: rgb(211, 211, 211);text-shadow:rgba(0, 0, 0, 0.2) 1px 1px 0; padding: 5px 8px;",this.app.canvas.parentElement.appendChild(this.ele),this.close(),setInterval(()=>{var e;1e3<(new Date).getTime()-this.time&&this.isOK&&!this.text&&((e=this.app.Project.objectDatas.find(this.id))&&(this.text=e.name))},100)}set text(e){this._text=e,(this.ele.innerText=e)&&(this.ele.style.display=null)}update(e){e.pickInfo.pickedMesh?e.pickInfo.pickedMesh.id!=this.id?(this.close(),this.id=e.pickInfo.pickedMesh.id,this.time=(new Date).getTime()):this.isOK=!0:this.close(),this.ele.style.top=e.event.offsetY+"px",this.ele.style.left=e.event.offsetX+20+"px"}close(){this.isOK=!1,this.time=(new Date).getTime(),this.ele.style.display="none",this.text=""}setBackground(e){this.url=e,this.ele.style.background="url("+this.url+") no-repeat",this.ele.style.backgroundSize="cover"}dispose(){clearInterval(this.interval),this.app.canvas.parentElement.removeChild(this.ele),this.ele=null}}class d{constructor(e){this.lights=new f,this.reflexEnabled=!0,this.reflexIntensity=.5,this.app=e,this.color=new BABYLON.Color4(0,.0588,.1176,1),this.reflex(D.rl+"resources/environment.env",.5),this.app.scene.fogEnabled=!0,this.app.scene.fogMode=2,this.fogDistance=500,BABYLON.Effect.IncludesShadersStore.fogVertex=`
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("TWEEN"),require("BABYLON"),require("babylonjs-materials"),require("BABYLON.GUI"),require("BABYLON.SceneLoader"),require("babylonjs-serializers")):"function"==typeof define&&define.amd?define(["TWEEN","BABYLON","babylonjs-materials","BABYLON.GUI","BABYLON.SceneLoader","babylonjs-serializers"],t):"object"==typeof exports?exports.MX3D=t(require("TWEEN"),require("BABYLON"),require("babylonjs-materials"),require("BABYLON.GUI"),require("BABYLON.SceneLoader"),require("babylonjs-serializers")):e.MX3D=t(e.TWEEN,e.BABYLON,e["babylonjs-materials"],e["BABYLON.GUI"],e["BABYLON.SceneLoader"],e["babylonjs-serializers"])}(window,function(i,n,s,r,o,a){return c=[function(e,t){e.exports=i},function(e,t,i){"use strict";var n,s=i(5),r=Object.prototype.toString,o=(n=Object.create(null),function(e){e=r.call(e);return n[e]||(n[e]=e.slice(8,-1).toLowerCase())});function a(t){return t=t.toLowerCase(),function(e){return o(e)===t}}function h(e){return Array.isArray(e)}function c(e){return void 0===e}var l=a("ArrayBuffer");function u(e){return null!==e&&"object"==typeof e}function p(e){if("object"!==o(e))return!1;e=Object.getPrototypeOf(e);return null===e||e===Object.prototype}var d=a("Date"),f=a("File"),m=a("Blob"),g=a("FileList");function b(e){return"[object Function]"===r.call(e)}var A=a("URLSearchParams");function y(e,t){if(null!=e)if(h(e="object"!=typeof e?[e]:e))for(var i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.call(null,e[s],s,e)}var B,i=(B="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return B&&e instanceof B});e.exports={isArray:h,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!c(e)&&null!==e.constructor&&!c(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||r.call(e)===t||b(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:u,isPlainObject:p,isUndefined:c,isDate:d,isFile:f,isBlob:m,isFunction:b,isStream:function(e){return u(e)&&b(e.pipe)},isURLSearchParams:A,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:y,merge:function i(){var n={};function e(e,t){p(n[t])&&p(e)?n[t]=i(n[t],e):p(e)?n[t]=i({},e):h(e)?n[t]=e.slice():n[t]=e}for(var t=0,s=arguments.length;t<s;t++)y(arguments[t],e);return n},extend:function(i,e,n){return y(e,function(e,t){i[t]=n&&"function"==typeof e?s(e,n):e}),i},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return e=65279===e.charCodeAt(0)?e.slice(1):e},inherits:function(e,t,i,n){e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,i&&Object.assign(e.prototype,i)},toFlatObject:function(e,t,i){var n,s,r,o={};t=t||{};do{for(s=(n=Object.getOwnPropertyNames(e)).length;0<s--;)o[r=n[s]]||(t[r]=e[r],o[r]=!0)}while((e=Object.getPrototypeOf(e))&&(!i||i(e,t))&&e!==Object.prototype);return t},kindOf:o,kindOfTest:a,endsWith:function(e,t,i){return e=String(e),(void 0===i||i>e.length)&&(i=e.length),i-=t.length,-1!==(t=e.indexOf(t,i))&&t===i},toArray:function(e){if(!e)return null;var t=e.length;if(c(t))return null;for(var i=new Array(t);0<t--;)i[t]=e[t];return i},isTypedArray:i,isFileList:g}},function(e,t,i){"use strict";var a=i(1);function h(e,t,i,n,s){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),i&&(this.config=i),n&&(this.request=n),s&&(this.response=s)}a.inherits(h,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var c=h.prototype,n={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(e){n[e]={value:e}}),Object.defineProperties(h,n),Object.defineProperty(c,"isAxiosError",{value:!0}),h.from=function(e,t,i,n,s,r){var o=Object.create(c);return a.toFlatObject(e,o,function(e){return e!==Error.prototype}),h.call(o,e.message,t,i,n,s),o.name=e.name,r&&Object.assign(o,r),o},e.exports=h},function(e,t,i){"use strict";var n=i(2);function s(e){n.call(this,null==e?"canceled":e,n.ERR_CANCELED),this.name="CanceledError"}i(1).inherits(s,n,{__CANCEL__:!0}),e.exports=s},function(l,e,u){"use strict";!function(e){var o=u(1),a=u(26),n=u(2),t=u(7),h=u(8),i={"Content-Type":"application/x-www-form-urlencoded"};function c(e,t){!o.isUndefined(e)&&o.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var s,r={transitional:t,adapter:s="undefined"!=typeof XMLHttpRequest||void 0!==e&&"[object process]"===Object.prototype.toString.call(e)?u(9):s,transformRequest:[function(e,t){if(a(t,"Accept"),a(t,"Content-Type"),o.isFormData(e)||o.isArrayBuffer(e)||o.isBuffer(e)||o.isStream(e)||o.isFile(e)||o.isBlob(e))return e;if(o.isArrayBufferView(e))return e.buffer;if(o.isURLSearchParams(e))return c(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var i,n=o.isObject(e),s=t&&t["Content-Type"];if((i=o.isFileList(e))||n&&"multipart/form-data"===s){var r=this.env&&this.env.FormData;return h(i?{"files[]":e}:e,r&&new r)}return n||"application/json"===s?(c(t,"application/json"),function(e,t,i){if(o.isString(e))try{return(t||JSON.parse)(e),o.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(i||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||r.transitional,i=t&&t.silentJSONParsing,t=t&&t.forcedJSONParsing,i=!i&&"json"===this.responseType;if(i||t&&o.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw n.from(e,n.ERR_BAD_RESPONSE,this,null,this.response);throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:u(39)},validateStatus:function(e){return 200<=e&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};o.forEach(["delete","get","head"],function(e){r.headers[e]={}}),o.forEach(["post","put","patch"],function(e){r.headers[e]=o.merge(i)}),l.exports=r}.call(this,u(25))},function(e,t,i){"use strict";e.exports=function(i,n){return function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];return i.apply(n,e)}}},function(e,t,i){"use strict";var s=i(1);function r(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,i){if(!t)return e;var n,i=i?i(t):s.isURLSearchParams(t)?t.toString():(n=[],s.forEach(t,function(e,t){null!=e&&(s.isArray(e)?t+="[]":e=[e],s.forEach(e,function(e){s.isDate(e)?e=e.toISOString():s.isObject(e)&&(e=JSON.stringify(e)),n.push(r(t)+"="+r(e))}))}),n.join("&"));return i&&(-1!==(t=e.indexOf("#"))&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i),e}},function(e,t,i){"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},function(e,t,n){"use strict";!function(i){var h=n(1);e.exports=function(e,o){o=o||new FormData;var t=[];function a(e){return null===e?"":h.isDate(e)?e.toISOString():h.isArrayBuffer(e)||h.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):i.from(e):e}return function s(e,r){if(h.isPlainObject(e)||h.isArray(e)){if(-1!==t.indexOf(e))throw Error("Circular reference detected in "+r);t.push(e),h.forEach(e,function(e,t){if(!h.isUndefined(e)){var i,n=r?r+"."+t:t;if(e&&!r&&"object"==typeof e)if(h.endsWith(t,"{}"))e=JSON.stringify(e);else if(h.endsWith(t,"[]")&&(i=h.toArray(e)))return void i.forEach(function(e){h.isUndefined(e)||o.append(n,a(e))});s(e,n)}}),t.pop()}else o.append(r,a(e))}(e),o}}.call(this,n(27).Buffer)},function(e,t,i){"use strict";var p=i(1),d=i(32),f=i(33),m=i(6),g=i(10),b=i(36),A=i(37),y=i(7),B=i(2),v=i(3),w=i(38);e.exports=function(u){return new Promise(function(t,i){var e,n=u.data,s=u.headers,r=u.responseType;function o(){u.cancelToken&&u.cancelToken.unsubscribe(e),u.signal&&u.signal.removeEventListener("abort",e)}p.isFormData(n)&&p.isStandardBrowserEnv()&&delete s["Content-Type"];var a=new XMLHttpRequest;u.auth&&(c=u.auth.username||"",h=u.auth.password?unescape(encodeURIComponent(u.auth.password)):"",s.Authorization="Basic "+btoa(c+":"+h));var h,c=g(u.baseURL,u.url);function l(){var e;a&&(e="getAllResponseHeaders"in a?b(a.getAllResponseHeaders()):null,e={data:r&&"text"!==r&&"json"!==r?a.response:a.responseText,status:a.status,statusText:a.statusText,headers:e,config:u,request:a},d(function(e){t(e),o()},function(e){i(e),o()},e),a=null)}a.open(u.method.toUpperCase(),m(c,u.params,u.paramsSerializer),!0),a.timeout=u.timeout,"onloadend"in a?a.onloadend=l:a.onreadystatechange=function(){a&&4===a.readyState&&(0!==a.status||a.responseURL&&0===a.responseURL.indexOf("file:"))&&setTimeout(l)},a.onabort=function(){a&&(i(new B("Request aborted",B.ECONNABORTED,u,a)),a=null)},a.onerror=function(){i(new B("Network Error",B.ERR_NETWORK,u,a,a)),a=null},a.ontimeout=function(){var e=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded",t=u.transitional||y;u.timeoutErrorMessage&&(e=u.timeoutErrorMessage),i(new B(e,t.clarifyTimeoutError?B.ETIMEDOUT:B.ECONNABORTED,u,a)),a=null},!p.isStandardBrowserEnv()||(h=(u.withCredentials||A(c))&&u.xsrfCookieName?f.read(u.xsrfCookieName):void 0)&&(s[u.xsrfHeaderName]=h),"setRequestHeader"in a&&p.forEach(s,function(e,t){void 0===n&&"content-type"===t.toLowerCase()?delete s[t]:a.setRequestHeader(t,e)}),p.isUndefined(u.withCredentials)||(a.withCredentials=!!u.withCredentials),r&&"json"!==r&&(a.responseType=u.responseType),"function"==typeof u.onDownloadProgress&&a.addEventListener("progress",u.onDownloadProgress),"function"==typeof u.onUploadProgress&&a.upload&&a.upload.addEventListener("progress",u.onUploadProgress),(u.cancelToken||u.signal)&&(e=function(e){a&&(i(!e||e.type?new v:e),a.abort(),a=null)},u.cancelToken&&u.cancelToken.subscribe(e),u.signal&&(u.signal.aborted?e():u.signal.addEventListener("abort",e)));n=n||null,c=w(c);c&&-1===["http","https","file"].indexOf(c)?i(new B("Unsupported protocol "+c+":",B.ERR_BAD_REQUEST,u)):a.send(n)})}},function(e,t,i){"use strict";var n=i(34),s=i(35);e.exports=function(e,t){return e&&!n(t)?s(e,t):t}},function(e,t,i){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,i){"use strict";var c=i(1);e.exports=function(t,i){i=i||{};var n={};function s(e,t){return c.isPlainObject(e)&&c.isPlainObject(t)?c.merge(e,t):c.isPlainObject(t)?c.merge({},t):c.isArray(t)?t.slice():t}function r(e){return c.isUndefined(i[e])?c.isUndefined(t[e])?void 0:s(void 0,t[e]):s(t[e],i[e])}function e(e){if(!c.isUndefined(i[e]))return s(void 0,i[e])}function o(e){return c.isUndefined(i[e])?c.isUndefined(t[e])?void 0:s(void 0,t[e]):s(void 0,i[e])}function a(e){return e in i?s(t[e],i[e]):e in t?s(void 0,t[e]):void 0}var h={url:e,method:e,data:e,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a};return c.forEach(Object.keys(t).concat(Object.keys(i)),function(e){var t=h[e]||r,i=t(e);c.isUndefined(i)&&t!==a||(n[e]=i)}),n}},function(e,t){e.exports={version:"0.27.2"}},function(e,t,i){e.exports=i(20)},function(e,t){e.exports=n},function(e,t){e.exports=s},function(e,t){e.exports=r},function(e,t){e.exports=o},function(e,t){e.exports=a},function(e,t,i){"use strict";var s=i(1),r=i(5),o=i(21),a=i(12);var n=function t(i){var e=new o(i),n=r(o.prototype.request,e);return s.extend(n,o.prototype,e),s.extend(n,e),n.create=function(e){return t(a(i,e))},n}(i(4));n.Axios=o,n.CanceledError=i(3),n.CancelToken=i(41),n.isCancel=i(11),n.VERSION=i(13).version,n.toFormData=i(8),n.AxiosError=i(2),n.Cancel=n.CanceledError,n.all=function(e){return Promise.all(e)},n.spread=i(42),n.isAxiosError=i(43),e.exports=n,e.exports.default=n},function(e,t,i){"use strict";var n=i(1),s=i(6),r=i(22),l=i(23),u=i(12),o=i(10),p=i(40),d=p.validators;function a(e){this.defaults=e,this.interceptors={request:new r,response:new r}}a.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=u(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";e=t.transitional;void 0!==e&&p.assertOptions(e,{silentJSONParsing:d.transitional(d.boolean),forcedJSONParsing:d.transitional(d.boolean),clarifyTimeoutError:d.transitional(d.boolean)},!1);var i=[],n=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});var s,r=[];if(this.interceptors.response.forEach(function(e){r.push(e.fulfilled,e.rejected)}),!n){var o=[l,void 0];for(Array.prototype.unshift.apply(o,i),o=o.concat(r),s=Promise.resolve(t);o.length;)s=s.then(o.shift(),o.shift());return s}for(var a=t;i.length;){var h=i.shift(),c=i.shift();try{a=h(a)}catch(e){c(e);break}}try{s=l(a)}catch(e){return Promise.reject(e)}for(;r.length;)s=s.then(r.shift(),r.shift());return s},a.prototype.getUri=function(e){e=u(this.defaults,e);var t=o(e.baseURL,e.url);return s(t,e.params,e.paramsSerializer)},n.forEach(["delete","get","head","options"],function(i){a.prototype[i]=function(e,t){return this.request(u(t||{},{method:i,url:e,data:(t||{}).data}))}}),n.forEach(["post","put","patch"],function(s){function e(n){return function(e,t,i){return this.request(u(i||{},{method:s,headers:n?{"Content-Type":"multipart/form-data"}:{},url:e,data:t}))}}a.prototype[s]=e(),a.prototype[s+"Form"]=e(!0)}),e.exports=a},function(e,t,i){"use strict";var n=i(1);function s(){this.handlers=[]}s.prototype.use=function(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1},s.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},s.prototype.forEach=function(t){n.forEach(this.handlers,function(e){null!==e&&t(e)})},e.exports=s},function(e,t,i){"use strict";var n=i(1),s=i(24),r=i(11),o=i(4),a=i(3);function h(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a}e.exports=function(t){return h(t),t.headers=t.headers||{},t.data=s.call(t,t.data,t.headers,t.transformRequest),t.headers=n.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),n.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||o.adapter)(t).then(function(e){return h(t),e.data=s.call(t,e.data,e.headers,t.transformResponse),e},function(e){return r(e)||(h(t),e&&e.response&&(e.response.data=s.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(e,t,i){"use strict";var s=i(1),r=i(4);e.exports=function(t,i,e){var n=this||r;return s.forEach(e,function(e){t=e.call(n,t,i)}),t}},function(e,t){var i,n,e=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(i===setTimeout)return setTimeout(t,0);if((i===s||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:s}catch(e){i=s}try{n="function"==typeof clearTimeout?clearTimeout:r}catch(e){n=r}}();var a,h=[],c=!1,l=-1;function u(){c&&a&&(c=!1,a.length?h=a.concat(h):l=-1,h.length&&p())}function p(){if(!c){var e=o(u);c=!0;for(var t=h.length;t;){for(a=h,h=[];++l<t;)a&&a[l].run();l=-1,t=h.length}a=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===r||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function f(){}e.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];h.push(new d(e,t)),1!==h.length||c||o(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},e.title="browser",e.browser=!0,e.env={},e.argv=[],e.version="",e.versions={},e.on=f,e.addListener=f,e.once=f,e.off=f,e.removeListener=f,e.removeAllListeners=f,e.emit=f,e.prependListener=f,e.prependOnceListener=f,e.listeners=function(e){return[]},e.binding=function(e){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(e){throw new Error("process.chdir is not supported")},e.umask=function(){return 0}},function(e,t,i){"use strict";var s=i(1);e.exports=function(i,n){s.forEach(i,function(e,t){t!==n&&t.toUpperCase()===n.toUpperCase()&&(i[n]=e,delete i[t])})}},function(e,P,S){"use strict";!function(e){var a=S(29),r=S(30),o=S(31);function i(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(i()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(e=null===e?new u(t):e).length=t,e}function u(e,t,i){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,i);if("number"!=typeof e)return n(this,e,t,i);if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return c(this,e)}function n(e,t,i,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,i,n){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===i&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,i):new Uint8Array(t,i,n);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=l(e,t);return e}(e,t,i,n):"string"==typeof t?function(e,t,i){"string"==typeof i&&""!==i||(i="utf8");if(!u.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(t,i),i=(e=s(e,n)).write(t,i);i!==n&&(e=e.slice(0,i));return e}(e,t,i):function(e,t){if(u.isBuffer(t)){var i=0|p(t.length);return 0===(e=s(e,i)).length?e:(t.copy(e,0,0,i),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||function(e){return e!=e}(t.length)?s(e,0):l(e,t);if("Buffer"===t.type&&o(t.data))return l(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function c(e,t){if(h(t),e=s(e,t<0?0:0|p(t)),!u.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function l(e,t){var i=t.length<0?0:0|p(t.length);e=s(e,i);for(var n=0;n<i;n+=1)e[n]=255&t[n];return e}function p(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function d(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;var i=(e="string"!=typeof e?""+e:e).length;if(0===i)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return N(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return C(e).length;default:if(n)return N(e).length;t=(""+t).toLowerCase(),n=!0}}function t(e,t,i){var n,s,r,o=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((i=void 0===i||i>this.length?this.length:i)<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return function(e,t,i){var n=e.length;(!t||t<0)&&(t=0);(!i||i<0||n<i)&&(i=n);for(var s="",r=t;r<i;++r)s+=function(e){return e<16?"0"+e.toString(16):e.toString(16)}(e[r]);return s}(this,t,i);case"utf8":case"utf-8":return y(this,t,i);case"ascii":return function(e,t,i){var n="";i=Math.min(e.length,i);for(var s=t;s<i;++s)n+=String.fromCharCode(127&e[s]);return n}(this,t,i);case"latin1":case"binary":return function(e,t,i){var n="";i=Math.min(e.length,i);for(var s=t;s<i;++s)n+=String.fromCharCode(e[s]);return n}(this,t,i);case"base64":return n=this,r=i,0===(s=t)&&r===n.length?a.fromByteArray(n):a.fromByteArray(n.slice(s,r));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,i){for(var n=e.slice(t,i),s="",r=0;r<n.length;r+=2)s+=String.fromCharCode(n[r]+256*n[r+1]);return s}(this,t,i);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function f(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function m(e,t,i,n,s){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):2147483647<i?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,(i=(i=isNaN(i)?s?0:e.length-1:i)<0?e.length+i:i)>=e.length){if(s)return-1;i=e.length-1}else if(i<0){if(!s)return-1;i=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:g(e,t,i,n,s);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(s?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,i):g(e,[t],i,n,s);throw new TypeError("val must be string, number or Buffer")}function g(e,t,i,n,s){var r=1,o=e.length,a=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o/=r=2,a/=2,i/=2}function h(e,t){return 1===r?e[t]:e.readUInt16BE(t*r)}if(s)for(var c=-1,l=i;l<o;l++)if(h(e,l)===h(t,-1===c?0:l-c)){if(l-(c=-1===c?l:c)+1===a)return c*r}else-1!==c&&(l-=l-c),c=-1;else for(l=i=o<i+a?o-a:i;0<=l;l--){for(var u=!0,p=0;p<a;p++)if(h(e,l+p)!==h(t,p)){u=!1;break}if(u)return l}return-1}function b(e,t,i,n){return R(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,n)}function A(e,t,i,n){return R(function(e,t){for(var i,n,s=[],r=0;r<e.length&&!((t-=2)<0);++r)n=e.charCodeAt(r),i=n>>8,n=n%256,s.push(n),s.push(i);return s}(t,e.length-i),e,i,n)}function y(e,t,i){i=Math.min(e.length,i);for(var n=[],s=t;s<i;){var r,o,a,h,c=e[s],l=null,u=239<c?4:223<c?3:191<c?2:1;if(s+u<=i)switch(u){case 1:c<128&&(l=c);break;case 2:128==(192&(r=e[s+1]))&&127<(h=(31&c)<<6|63&r)&&(l=h);break;case 3:r=e[s+1],o=e[s+2],128==(192&r)&&128==(192&o)&&2047<(h=(15&c)<<12|(63&r)<<6|63&o)&&(h<55296||57343<h)&&(l=h);break;case 4:r=e[s+1],o=e[s+2],a=e[s+3],128==(192&r)&&128==(192&o)&&128==(192&a)&&65535<(h=(15&c)<<18|(63&r)<<12|(63&o)<<6|63&a)&&h<1114112&&(l=h)}null===l?(l=65533,u=1):65535<l&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),s+=u}return function(e){var t=e.length;if(t<=B)return String.fromCharCode.apply(String,e);var i="",n=0;for(;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=B));return i}(n)}P.Buffer=u,P.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},P.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),P.kMaxLength=i(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,i){return n(null,e,t,i)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,i){return n=null,t=t,i=i,h(e=e),!(e<=0)&&void 0!==t?"string"==typeof i?s(n,e).fill(t,i):s(n,e).fill(t):s(n,e);var n},u.allocUnsafe=function(e){return c(null,e)},u.allocUnsafeSlow=function(e){return c(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,n=t.length,s=0,r=Math.min(i,n);s<r;++s)if(e[s]!==t[s]){i=e[s],n=t[s];break}return i<n?-1:n<i?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);if(void 0===t)for(s=t=0;s<e.length;++s)t+=e[s].length;for(var i=u.allocUnsafe(t),n=0,s=0;s<e.length;++s){var r=e[s];if(!u.isBuffer(r))throw new TypeError('"list" argument must be an Array of Buffers');r.copy(i,n),n+=r.length}return i},u.byteLength=d,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)f(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)f(this,t,t+3),f(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)f(this,t,t+7),f(this,t+1,t+6),f(this,t+2,t+5),f(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0==e?"":0===arguments.length?y(this,0,e):t.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",t=P.INSPECT_MAX_BYTES;return 0<this.length&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,i,n,s){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===s&&(s=this.length),(t=void 0===t?0:t)<0||i>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(s<=n&&i<=t)return 0;if(s<=n)return-1;if(i<=t)return 1;if(this===e)return 0;for(var r=(s>>>=0)-(n>>>=0),o=(i>>>=0)-(t>>>=0),a=Math.min(r,o),h=this.slice(n,s),c=e.slice(t,i),l=0;l<a;++l)if(h[l]!==c[l]){r=h[l],o=c[l];break}return r<o?-1:o<r?1:0},u.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},u.prototype.indexOf=function(e,t,i){return m(this,e,t,i,!0)},u.prototype.lastIndexOf=function(e,t,i){return m(this,e,t,i,!1)},u.prototype.write=function(e,t,i,n){if(void 0===t)n="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)n=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var s=this.length-t;if((void 0===i||s<i)&&(i=s),0<e.length&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var r,o,a,h=!1;;)switch(n){case"hex":return function(e,t,i,n){i=Number(i)||0;var s=e.length-i;if((!n||s<(n=Number(n)))&&(n=s),(s=t.length)%2!=0)throw new TypeError("Invalid hex string");s/2<n&&(n=s/2);for(var r=0;r<n;++r){var o=parseInt(t.substr(2*r,2),16);if(isNaN(o))return r;e[i+r]=o}return r}(this,e,t,i);case"utf8":case"utf-8":return o=t,a=i,R(N(e,(r=this).length-o),r,o,a);case"ascii":return b(this,e,t,i);case"latin1":case"binary":return b(this,e,t,i);case"base64":return r=this,o=t,a=i,R(C(e),r,o,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,i);default:if(h)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),h=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var B=4096;function v(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(i<e+t)throw new RangeError("Trying to access beyond buffer length")}function w(e,t,i,n,s,r){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(s<t||t<r)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}function T(e,t,i,n){t<0&&(t=65535+t+1);for(var s=0,r=Math.min(e.length-i,2);s<r;++s)e[i+s]=(t&255<<8*(n?s:1-s))>>>8*(n?s:1-s)}function x(e,t,i,n){t<0&&(t=4294967295+t+1);for(var s=0,r=Math.min(e.length-i,4);s<r;++s)e[i+s]=t>>>8*(n?s:3-s)&255}function O(e,t,i,n){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function E(e,t,i,n,s){return s||O(e,0,i,4),r.write(e,t,i,n,23,4),i+4}function M(e,t,i,n,s){return s||O(e,0,i,8),r.write(e,t,i,n,52,8),i+8}u.prototype.slice=function(e,t){var i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i<e&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):i<t&&(t=i),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(s=this.subarray(e,t)).__proto__=u.prototype;else for(var n=t-e,s=new u(n,void 0),r=0;r<n;++r)s[r]=this[r+e];return s},u.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||v(e,t,this.length);for(var n=this[e],s=1,r=0;++r<t&&(s*=256);)n+=this[e+r]*s;return n},u.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||v(e,t,this.length);for(var n=this[e+--t],s=1;0<t&&(s*=256);)n+=this[e+--t]*s;return n},u.prototype.readUInt8=function(e,t){return t||v(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||v(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||v(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||v(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||v(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||v(e,t,this.length);for(var n=this[e],s=1,r=0;++r<t&&(s*=256);)n+=this[e+r]*s;return(s*=128)<=n&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||v(e,t,this.length);for(var n=t,s=1,r=this[e+--n];0<n&&(s*=256);)r+=this[e+--n]*s;return(s*=128)<=r&&(r-=Math.pow(2,8*t)),r},u.prototype.readInt8=function(e,t){return t||v(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||v(e,2,this.length);e=this[e]|this[e+1]<<8;return 32768&e?4294901760|e:e},u.prototype.readInt16BE=function(e,t){t||v(e,2,this.length);e=this[e+1]|this[e]<<8;return 32768&e?4294901760|e:e},u.prototype.readInt32LE=function(e,t){return t||v(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||v(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||v(e,4,this.length),r.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||v(e,4,this.length),r.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||v(e,8,this.length),r.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||v(e,8,this.length),r.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,i,n){e=+e,t|=0,i|=0,n||w(this,e,t,i,Math.pow(2,8*i)-1,0);var s=1,r=0;for(this[t]=255&e;++r<i&&(s*=256);)this[t+r]=e/s&255;return t+i},u.prototype.writeUIntBE=function(e,t,i,n){e=+e,t|=0,i|=0,n||w(this,e,t,i,Math.pow(2,8*i)-1,0);var s=i-1,r=1;for(this[t+s]=255&e;0<=--s&&(r*=256);)this[t+s]=e/r&255;return t+i},u.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):T(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):T(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):x(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):x(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,i,n){e=+e,t|=0,n||w(this,e,t,i,(n=Math.pow(2,8*i-1))-1,-n);var s=0,r=1,o=0;for(this[t]=255&e;++s<i&&(r*=256);)e<0&&0===o&&0!==this[t+s-1]&&(o=1),this[t+s]=(e/r>>0)-o&255;return t+i},u.prototype.writeIntBE=function(e,t,i,n){e=+e,t|=0,n||w(this,e,t,i,(n=Math.pow(2,8*i-1))-1,-n);var s=i-1,r=1,o=0;for(this[t+s]=255&e;0<=--s&&(r*=256);)e<0&&0===o&&0!==this[t+s+1]&&(o=1),this[t+s]=(e/r>>0)-o&255;return t+i},u.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&(e=e<0?255+e+1:e),t+1},u.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):T(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):T(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):x(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):x(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,i){return E(this,e,t,!0,i)},u.prototype.writeFloatBE=function(e,t,i){return E(this,e,t,!1,i)},u.prototype.writeDoubleLE=function(e,t,i){return M(this,e,t,!0,i)},u.prototype.writeDoubleBE=function(e,t,i){return M(this,e,t,!1,i)},u.prototype.copy=function(e,t,i,n){if(i=i||0,n||0===n||(n=this.length),t>=e.length&&(t=e.length),(n=0<n&&n<i?i:n)===i)return 0;if(0===e.length||0===this.length)return 0;if((t=t||0)<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);var s,r=(n=e.length-t<n-i?e.length-t+i:n)-i;if(this===e&&i<t&&t<n)for(s=r-1;0<=s;--s)e[s+t]=this[s+i];else if(r<1e3||!u.TYPED_ARRAY_SUPPORT)for(s=0;s<r;++s)e[s+t]=this[s+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+r),t);return r},u.prototype.fill=function(e,t,i,n){if("string"==typeof e){var s;if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),1!==e.length||(s=e.charCodeAt(0))<256&&(e=s),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;if(t>>>=0,i=void 0===i?this.length:i>>>0,"number"==typeof(e=e||0))for(a=t;a<i;++a)this[a]=e;else for(var r=u.isBuffer(e)?e:N(new u(e,n).toString()),o=r.length,a=0;a<i-t;++a)this[a+t]=r[a%o];return this};var L=/[^+\/0-9A-Za-z-_]/g;function N(e,t){var i;t=t||1/0;for(var n=e.length,s=null,r=[],o=0;o<n;++o){if(55295<(i=e.charCodeAt(o))&&i<57344){if(!s){if(56319<i){-1<(t-=3)&&r.push(239,191,189);continue}if(o+1===n){-1<(t-=3)&&r.push(239,191,189);continue}s=i;continue}if(i<56320){-1<(t-=3)&&r.push(239,191,189),s=i;continue}i=65536+(s-55296<<10|i-56320)}else s&&-1<(t-=3)&&r.push(239,191,189);if(s=null,i<128){if(--t<0)break;r.push(i)}else if(i<2048){if((t-=2)<0)break;r.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;r.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;r.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return r}function C(e){return a.toByteArray(function(e){var t;if((e=((t=e).trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function R(e,t,i,n){for(var s=0;s<n&&!(s+i>=t.length||s>=e.length);++s)t[s+i]=e[s];return s}}.call(this,S(28))},function(e,t){var i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t,i){"use strict";t.byteLength=function(e){var t=l(e),e=t[0],t=t[1];return 3*(e+t)/4-t},t.toByteArray=function(e){var t,i,n=l(e),s=n[0],n=n[1],r=new c(function(e,t){return 3*(e+t)/4-t}(s,n)),o=0,a=0<n?s-4:s;for(i=0;i<a;i+=4)t=h[e.charCodeAt(i)]<<18|h[e.charCodeAt(i+1)]<<12|h[e.charCodeAt(i+2)]<<6|h[e.charCodeAt(i+3)],r[o++]=t>>16&255,r[o++]=t>>8&255,r[o++]=255&t;2===n&&(t=h[e.charCodeAt(i)]<<2|h[e.charCodeAt(i+1)]>>4,r[o++]=255&t);1===n&&(t=h[e.charCodeAt(i)]<<10|h[e.charCodeAt(i+1)]<<4|h[e.charCodeAt(i+2)]>>2,r[o++]=t>>8&255,r[o++]=255&t);return r},t.fromByteArray=function(e){for(var t,i=e.length,n=i%3,s=[],r=0,o=i-n;r<o;r+=16383)s.push(function(e,t,i){for(var n,s=[],r=t;r<i;r+=3)n=(e[r]<<16&16711680)+(e[r+1]<<8&65280)+(255&e[r+2]),s.push(function(e){return a[e>>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}(n));return s.join("")}(e,r,o<r+16383?o:r+16383));1==n?(t=e[i-1],s.push(a[t>>2]+a[t<<4&63]+"==")):2==n&&(t=(e[i-2]<<8)+e[i-1],s.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return s.join("")};for(var a=[],h=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,r=n.length;s<r;++s)a[s]=n[s],h[n.charCodeAt(s)]=s;function l(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");e=e.indexOf("=");return[e=-1===e?t:e,e===t?0:4-e%4]}h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,i,n,s){var r,o,a=8*s-n-1,h=(1<<a)-1,c=h>>1,l=-7,u=i?s-1:0,p=i?-1:1,i=e[t+u];for(u+=p,r=i&(1<<-l)-1,i>>=-l,l+=a;0<l;r=256*r+e[t+u],u+=p,l-=8);for(o=r&(1<<-l)-1,r>>=-l,l+=n;0<l;o=256*o+e[t+u],u+=p,l-=8);if(0===r)r=1-c;else{if(r===h)return o?NaN:1/0*(i?-1:1);o+=Math.pow(2,n),r-=c}return(i?-1:1)*o*Math.pow(2,r-n)},t.write=function(e,t,i,n,s,r){var o,a,h=8*r-s-1,c=(1<<h)-1,l=c>>1,u=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:r-1,d=n?1:-1,r=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(n=Math.pow(2,-o))<1&&(o--,n*=2),2<=(t+=1<=o+l?u/n:u*Math.pow(2,1-l))*n&&(o++,n/=2),c<=o+l?(a=0,o=c):1<=o+l?(a=(t*n-1)*Math.pow(2,s),o+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,s),o=0));8<=s;e[i+p]=255&a,p+=d,a/=256,s-=8);for(o=o<<s|a,h+=s;0<h;e[i+p]=255&o,p+=d,o/=256,h-=8);e[i+p-d]|=128*r}},function(e,t){var i={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},function(e,t,i){"use strict";var s=i(2);e.exports=function(e,t,i){var n=i.config.validateStatus;i.status&&n&&!n(i.status)?t(new s("Request failed with status code "+i.status,[s.ERR_BAD_REQUEST,s.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i)):e(i)}},function(e,t,i){"use strict";var a=i(1);e.exports=a.isStandardBrowserEnv()?{write:function(e,t,i,n,s,r){var o=[];o.push(e+"="+encodeURIComponent(t)),a.isNumber(i)&&o.push("expires="+new Date(i).toGMTString()),a.isString(n)&&o.push("path="+n),a.isString(s)&&o.push("domain="+s),!0===r&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){e=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,i){"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},function(e,t,i){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,i){"use strict";var s=i(1),r=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,i,n={};return e&&s.forEach(e.split("\n"),function(e){i=e.indexOf(":"),t=s.trim(e.substr(0,i)).toLowerCase(),i=s.trim(e.substr(i+1)),t&&(n[t]&&0<=r.indexOf(t)||(n[t]="set-cookie"===t?(n[t]||[]).concat([i]):n[t]?n[t]+", "+i:i))}),n}},function(e,t,i){"use strict";var n,s,r,o=i(1);function a(e){return s&&(r.setAttribute("href",e),e=r.href),r.setAttribute("href",e),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}e.exports=o.isStandardBrowserEnv()?(s=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),n=a(window.location.href),function(e){e=o.isString(e)?a(e):e;return e.protocol===n.protocol&&e.host===n.host}):function(){return!0}},function(e,t,i){"use strict";e.exports=function(e){e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return e&&e[1]||""}},function(e,t){e.exports=null},function(e,t,i){"use strict";var o=i(13).version,h=i(2),n={};["object","boolean","number","function","string","symbol"].forEach(function(t,i){n[t]=function(e){return typeof e===t||"a"+(i<1?"n ":" ")+t}});var a={};n.transitional=function(n,s,i){function r(e,t){return"[Axios v"+o+"] Transitional option '"+e+"'"+t+(i?". "+i:"")}return function(e,t,i){if(!1===n)throw new h(r(t," has been removed"+(s?" in "+s:"")),h.ERR_DEPRECATED);return s&&!a[t]&&(a[t]=!0,console.warn(r(t," has been deprecated since v"+s+" and will be removed in the near future"))),!n||n(e,t,i)}},e.exports={assertOptions:function(e,t,i){if("object"!=typeof e)throw new h("options must be an object",h.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),s=n.length;0<s--;){var r=n[s],o=t[r];if(o){var a=e[r],a=void 0===a||o(a,r,e);if(!0!==a)throw new h("option "+r+" must be "+a,h.ERR_BAD_OPTION_VALUE)}else if(!0!==i)throw new h("Unknown option "+r,h.ERR_BAD_OPTION)}},validators:n}},function(e,t,i){"use strict";var s=i(3);function n(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;this.promise.then(function(e){if(n._listeners){for(var t=n._listeners.length,i=0;i<t;i++)n._listeners[i](e);n._listeners=null}}),this.promise.then=function(e){var t,e=new Promise(function(e){n.subscribe(e),t=e}).then(e);return e.cancel=function(){n.unsubscribe(t)},e},e(function(e){n.reason||(n.reason=new s(e),t(n.reason))})}n.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},n.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},n.prototype.unsubscribe=function(e){!this._listeners||-1!==(e=this._listeners.indexOf(e))&&this._listeners.splice(e,1)},n.source=function(){var t;return{token:new n(function(e){t=e}),cancel:t}},e.exports=n},function(e,t,i){"use strict";e.exports=function(t){return function(e){return t.apply(null,e)}}},function(e,t,i){"use strict";var n=i(1);e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},function(e,t,i){"use strict";i.r(t),i.d(t,"default",function(){return _});i(15),i(16),i(17),i(18),i(19);var s,t=i(0),p=i.n(t);class f{static vector3ToJson(e){return{x:Math.floor(1e3*e.x)/1e3,y:Math.floor(1e3*e.y)/1e3,z:Math.floor(1e3*e.z)/1e3}}static vector3ARRToJson(e){let t=[];return e.forEach(e=>t.push({x:Math.floor(1e3*e.x)/1e3,y:Math.floor(1e3*e.y)/1e3,z:Math.floor(1e3*e.z)/1e3})),t}static ToVector3(e){return new BABYLON.Vector3(Math.floor(1e3*e.x)/1e3,Math.floor(1e3*e.y)/1e3,Math.floor(1e3*e.z)/1e3)}static ToARRVector3(e){let t=[];return e.forEach(e=>t.push(new BABYLON.Vector3(Math.floor(1e3*e.x)/1e3,Math.floor(1e3*e.y)/1e3,Math.floor(1e3*e.z)/1e3))),t}static computeBounds(e){let t=e.getChildMeshes(),i=e.getBoundingInfo();if(0<t.length){for(var n=t[0].getBoundingInfo(),s=n.minimum.add(t[0].position),r=n.maximum.add(t[0].position),o=1;o<t.length;o++)n=t[o].getBoundingInfo(),s=BABYLON.Vector3.Minimize(s,n.minimum.add(t[o].position)),r=BABYLON.Vector3.Maximize(r,n.maximum.add(t[o].position));i=new BABYLON.BoundingInfo(s,r)}return i}static computeBoundsToARR(e){for(var t=e[0].getBoundingInfo(),i=t.minimum.add(e[0].position),n=t.maximum.add(e[0].position),s=1;s<e.length;s++)t=e[s].getBoundingInfo(),i=BABYLON.Vector3.Minimize(i,t.minimum.add(e[s].position)),n=BABYLON.Vector3.Maximize(n,t.maximum.add(e[s].position));return new BABYLON.BoundingInfo(i,n)}static Expand(n,s){let r=new Array;var o=n.length;for(let i=0;i<o;i++){var a=n[i],h=n[0==i?o-1:i-1],c=n[i==o-1?0:i+1],l=h.x-a.x,u=h.z-a.z,p=this.norm(l,u);l/=p,u/=p;h=c.x-a.x,p=c.z-a.z,c=this.norm(h,p);h/=c,p/=c;c=-s/Math.sqrt((1-(l*h+u*p))/2);let e=l+h,t=u+p;c=0==this.norm(e,t)?0:c/this.norm(e,t);e*=c,t*=c,r[i]=new BABYLON.Vector3(e+a.x,0,t+a.z)}return r}static norm(e,t){return Math.sqrt(e*e+t*t)}static MergeMeshes(r,e){let o=new BABYLON.Mesh((new Date).getDate().toString(),e.scene);return setTimeout(()=>{let t=null,i;for(let e=0;e<r.length;e++){var n,s;r[e]&&(s=(n=r[e]).computeWorldMatrix(!0),i=BABYLON.VertexData.ExtractFromMesh(n,!0,!0),i.transform(s),t?t.merge(i,!0):t=i,n.dispose(!1,!0))}t.applyToMesh(o)}),o}static DeconsTructMesh(e,t,i){if(1<e.subMeshes.length){for(var n=BABYLON.VertexData.ExtractFromMesh(e,!0,!0),s=n.indices,r=n.normals,o=n.positions,a=n.uvs,h=new Array,c=0;c<e.subMeshes.length;c++){for(var l=new BABYLON.VertexData,u=s.slice(e.subMeshes[c].indexStart,e.subMeshes[c].indexStart+e.subMeshes[c].indexCount),p=r.slice(3*e.subMeshes[c].verticesStart,3*e.subMeshes[c].verticesStart+3*e.subMeshes[c].verticesCount),d=o.slice(3*e.subMeshes[c].verticesStart,3*e.subMeshes[c].verticesStart+3*e.subMeshes[c].verticesCount),f=a.slice(2*e.subMeshes[c].verticesStart,2*e.subMeshes[c].verticesStart+2*e.subMeshes[c].verticesCount),m=0;m<u.length;m++)u[m]=u[m]-e.subMeshes[c].verticesStart;l.indices=u,l.normals=p,l.positions=d,l.uvs=f;f=new BABYLON.Mesh(e.id+"-"+c,i.scene);l.applyToMesh(f),f.position.y=parseFloat(t),f.setEnabled(!1),h.push(f)}return e.dispose(!1,!0),h}return[e]}static getVisualAngle(e,t){let i={};var n=e.boundingSphere.radiusWorld,s=t.engine.getAspectRatio(t.Camera.camera);let r=t.Camera.camera.fov/1.2;return s<1&&(r=Math.atan(s*Math.tan(t.Camera.camera.fov/2))),i.radius=1.1*Math.abs(n/Math.sin(r)),i.alpha=Math.PI/2,i.beta=Math.PI/4,i.focus=e.boundingSphere.center.clone(),i}static pathTransformation(i,n){let e=new BABYLON.Path3D(i);var s=e.getTangents();let r=[];for(let t=0;t<i.length;t++)if(0<t&&t<i.length-1){var o=i[t-1],a=i[t+1],h=i[t];let e=s[t-1];var c=s[t];if(!e.equals(c)){o=BABYLON.Vector3.Lerp(h,o,n/BABYLON.Vector3.Distance(o,h)),a=BABYLON.Vector3.Lerp(h,a,n/BABYLON.Vector3.Distance(a,h));let e=BABYLON.Curve3.CreateQuadraticBezier(o,h,a,10);r=r.concat(e.getPoints())}}else r.push(i[t]);return r}static createTube(e,t,i=.05,n){return BABYLON.MeshBuilder.CreateTube(e,{path:this.pathTransformation(t,i),radius:i/2},n.scene)}static getAngleFromVector2(e,t,i){var n=(e.x-t.x)*(i.x-t.x)+(e.y-t.y)*(i.y-t.y),t=(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x),n=Math.atan2(t,n);return Math.PI-n}static getAngleFromVector3(e,t,i){return this.getAngleFromVector2(new BABYLON.Vector2(e.x,e.z),new BABYLON.Vector2(t.x,t.z),new BABYLON.Vector2(i.x,i.z))}static RandomNumBoth(e,t){var i=t-e,t=Math.random();return e+Math.round(t*i)}}class n{constructor(e){this.app=e,this.camera=new BABYLON.ArcRotateCamera("camera",-Math.PI/4,Math.PI/4,50,new BABYLON.Vector3(0,0,0),this.app.scene),this.camera.pinchPrecision=200,this.app.scene.activeCamera=this.camera,this.camera.attachControl(this.app.canvas,!0,!0),this.camera.minZ=.3,this.camera.wheelDeltaPercentage=.01,this.frustrum=5,this.isOverLook=!1,this.tw_camera=new p.a.Tween(this.camera),this.tw_target=new p.a.Tween(this.camera.target)}orthographic(){this.isOverLook=!0,this.camera.lowerBetaLimit=0,this.camera.upperBetaLimit=0,this.camera.lowerAlphaLimit=Math.PI/2,this.camera.upperAlphaLimit=Math.PI/2,this.camera.mode=BABYLON.Camera.ORTHOGRAPHIC_CAMERA;var e=this.app.Project.current.Sight;this.camera.lowerRadiusLimit=2*e.radius,this.camera.radius=e.radius,this.camera.target=e.focus.clone(),this.frustrum=.5*e.radius,this.computeCameraView()}perspective(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,e=e||this.app.Project.current.Sight,this.isOverLook=!1,this.camera.lowerRadiusLimit=e.minimumLimit||1,this.camera.upperRadiusLimit=e.maximumLimit||3e3,this.camera.panningSensibility=1e3,this.camera.lowerBetaLimit=e.minBeta||.01,this.camera.upperBetaLimit=e.maxBeta||Math.PI/2*.98,this.camera.lowerAlphaLimit=null,this.camera.upperAlphaLimit=null,this.camera.mode=BABYLON.Camera.PERSPECTIVE_CAMERA,this.camera.target=e.focus.clone(),(this.camera.alpha>2*Math.PI||this.camera.alpha<-2*Math.PI)&&(this.camera.alpha=this.camera.alpha-Math.floor(this.camera.alpha/(2*Math.PI))*(2*Math.PI));var t=new BABYLON.Animation("camAlpha","alpha",50,BABYLON.Animation.ANIMATIONTYPE_FLOAT,BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);t.setKeys([{frame:0,value:this.camera.alpha},{frame:50,value:e.alpha}]);var i=new BABYLON.Animation("camRadius","radius",50,BABYLON.Animation.ANIMATIONTYPE_FLOAT,BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);i.setKeys([{frame:0,value:this.camera.radius},{frame:50,value:e.radius}]);var n=new BABYLON.Animation("camBeta","beta",50,BABYLON.Animation.ANIMATIONTYPE_FLOAT,BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);n.setKeys([{frame:0,value:this.camera.beta},{frame:50,value:e.beta}]),this.app.scene.beginDirectAnimation(this.camera,[t,i,n],0,100,!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}flyTo(e,t=300){e=e||this.app.Project.current.Sight,(this.camera.alpha>2*Math.PI||this.camera.alpha<-2*Math.PI)&&(this.camera.alpha=this.camera.alpha-Math.floor(this.camera.alpha/(2*Math.PI))*(2*Math.PI)),this.tw_target.to({x:e.focus.x,y:e.focus.y,z:e.focus.z},t).start().onComplete(()=>{this.tw_camera.to({radius:e.radius,beta:e.beta,alpha:e.alpha},t).start()}),this.camera.lowerRadiusLimit=e.minimumLimit,this.camera.upperRadiusLimit=e.maximumLimit,this.camera.lowerBetaLimit=e.minBeta,this.camera.upperBetaLimit=e.maxBeta}translation(e,t=300){e=e||this.app.Project.current.Sight,this.tw_target.to({x:e.focus.x,y:e.focus.y,z:e.focus.z},t).start().onComplete(()=>{this.tw_camera.to({radius:e.radius},t).start()})}getSightJson(){return JSON.stringify({alpha:this.camera.alpha,focus:f.vector3ToJson(this.camera.target),radius:this.camera.radius,beta:this.camera.beta,minimumLimit:this.camera.lowerRadiusLimit,maximumLimit:this.camera.upperRadiusLimit,minBeta:this.camera.lowerBetaLimit,maxBeta:this.camera.upperBetaLimit})}computeCameraView(){var e=this.app.canvas.clientWidth/this.app.canvas.clientHeight;this.camera.orthoLeft=-e*this.frustrum,this.camera.orthoRight=e*this.frustrum,this.camera.orthoTop=this.frustrum,this.camera.orthoBottom=-this.frustrum;e=1e3/(this.frustrum/20);this.camera.panningSensibility=2e3<e?2e3:e<10?10:e}_wheel(e){this.isOverLook&&(e=(e.wheelDelta||24*-e.detail)<0?1.1:.9,this.frustrum*=e,this.computeCameraView())}}class m{constructor(){this.map={}}add(e,t){this.map[e]=t}find(e){return this.map[e]}remove(e){delete this.map[e]}termRemove(e){for(var t in this.map)e(this.map[t])&&delete this.map[t]}showAll(){for(var e in this.map)this.map[e]}count(){var e,t=0;for(e in Object.keys(this.map))++t;return t}clear(){for(var e in this.map)delete this.map[e]}}class r{static getGUID(e){var t,i,n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),s=[],r=n.length;if(e)for(t=0;t<e;t++)s[t]=n[0|Math.random()*r];else for(s[8]=s[13]=s[18]=s[23]="-",s[14]="4",t=0;t<36;t++)s[t]||(i=0|16*Math.random(),s[t]=n[19==t?3&i|8:i]);return s.join("")}}class o{constructor(e){this.objectType="Light",this.app=e}load(){}}class a extends o{load(){this.light=new BABYLON.DirectionalLight(this.id,this.direction,this.app.scene),this.light.position=this.position,this.light.intensity=this.intensity,this.light.diffuse=BABYLON.Color3.FromHexString(this.color),this.light.specular=BABYLON.Color3.Black()}}class h extends o{load(){this.light=new BABYLON.HemisphericLight(this.id,this.direction,this.app.scene),this.light.intensity=this.intensity,this.light.diffuse=BABYLON.Color3.FromHexString(this.color),this.light.specular=BABYLON.Color3.Black()}}(t=s=s||{}).Point="Point",t.Spot="Spot",t.Directional="Directional",t.Hemispheric="Hemispheric";var g;class c extends o{load(){this.light=new BABYLON.PointLight(this.id,this.position.clone(),this.app.scene),this.light.range=this.range,this.light.intensity=this.intensity,this.light.diffuse=BABYLON.Color3.FromHexString(this.color),this.light.specular=BABYLON.Color3.Black()}}class l extends o{load(){this.light=new BABYLON.SpotLight(this.id,this.position.clone(),this.direction.clone(),this.angle*Math.PI/180,this.exponent,this.app.scene),this.light.range=this.range,this.light.position=this.position,this.light.intensity=this.intensity,this.light.diffuse=BABYLON.Color3.FromHexString(this.color),this.light.specular=BABYLON.Color3.Black()}}class u{constructor(e){this.isOK=!1,this.app=e,this.ele=document.createElement("div"),this.ele.style.cssText="position: absolute;z-index:999999999; font-size: 10px;color: rgb(211, 211, 211);text-shadow:rgba(0, 0, 0, 0.2) 1px 1px 0; padding: 5px 8px;",this.app.canvas.parentElement.appendChild(this.ele),this.close(),setInterval(()=>{var e;1e3<(new Date).getTime()-this.time&&this.isOK&&!this.text&&((e=this.app.Project.objectDatas.find(this.id))&&(this.text=e.name))},100)}set text(e){this._text=e,(this.ele.innerText=e)&&(this.ele.style.display=null)}update(e){e.pickInfo.pickedMesh?e.pickInfo.pickedMesh.id!=this.id?(this.close(),this.id=e.pickInfo.pickedMesh.id,this.time=(new Date).getTime()):this.isOK=!0:this.close(),this.ele.style.top=e.event.offsetY+"px",this.ele.style.left=e.event.offsetX+20+"px"}close(){this.isOK=!1,this.time=(new Date).getTime(),this.ele.style.display="none",this.text=""}setBackground(e){this.url=e,this.ele.style.background="url("+this.url+") no-repeat",this.ele.style.backgroundSize="cover"}dispose(){clearInterval(this.interval),this.app.canvas.parentElement.removeChild(this.ele),this.ele=null}}class d{constructor(e){this.lights=new m,this.reflexEnabled=!0,this.reflexIntensity=.5,this.app=e,this.color=new BABYLON.Color4(0,.0588,.1176,1),this.reflex(_.rl+"resources/environment.env",.5),this.app.scene.fogEnabled=!0,this.app.scene.fogMode=2,this.fogDistance=500,BABYLON.Effect.IncludesShadersStore.fogVertex=`
|
|
2
2
|
#ifdef FOG
|
|
3
3
|
vFogDistance=(worldPos).xyz;
|
|
4
4
|
#endif
|
|
5
|
-
`}set fogDistance(e){this.app.scene.fogDensity=1/e}set color(e){this._color=new BABYLON.Color4(e.r,e.g,e.b,e.a),this.app.scene.clearColor=this._color,this.app.scene.fogColor=new BABYLON.Color3(...this._color.asArray())}reflex(e,t){e=new BABYLON.CubeTexture(e,this.app.scene);this.app.scene.environmentTexture=e,this.app.scene.environmentIntensity=t}setBackground(e){this.background&&this.background.dispose(),this.background=new BABYLON.Layer("background",e,this.app.scene),this.background.isBackground=!0}setReflexEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.reflexEnabled=e,this.app.scene.environmentIntensity=this.reflexEnabled?this.reflexIntensity:0,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setFlexIntensity(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.reflexIntensity=e,this.app.scene.environmentIntensity=this.reflexIntensity,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}defaultLights(){let e=new h(this.app);e.id=r.getGUID(12),e.lightType="Hemispheric",e.name="半球光_"+this.lights.count(),e.direction=new BABYLON.Vector3(1,1,0),e.color="#FFFFFF",e.intensity=1,this.lights.add(e.id,e);let t=new h(this.app);t.id=r.getGUID(12),t.lightType="Hemispheric",t.name="半球光_"+this.lights.count(),t.direction=new BABYLON.Vector3(-1,1,0),t.color="#FFFFFF",t.intensity=.7,this.lights.add(t.id,t)}offAllLight(){for(const e in this.lights.map)this.lights.find(e).light&&(this.lights.find(e).light.intensity=0,this.app.scene.removeLight(this.lights.find(e).light),this.lights.find(e).light.dispose()),this.lights.find(e).light=null}openAllLight(){for(const e in this.lights.map)this.lights.find(e).load()}loadLight(i){for(let t=0;t<i.length;t++){var n=i[t];let e;n.lightType==s.Hemispheric?(e=new h(this.app),e.id=n.id,e.lightType=n.lightType,e.name=n.name,e.direction=
|
|
5
|
+
`}set fogDistance(e){this.app.scene.fogDensity=1/e}set color(e){this._color=new BABYLON.Color4(e.r,e.g,e.b,e.a),this.app.scene.clearColor=this._color,this.app.scene.fogColor=new BABYLON.Color3(...this._color.asArray())}reflex(e,t){e=new BABYLON.CubeTexture(e,this.app.scene);this.app.scene.environmentTexture=e,this.app.scene.environmentIntensity=t}setBackground(e){this.background&&this.background.dispose(),this.background=new BABYLON.Layer("background",e,this.app.scene),this.background.isBackground=!0}setReflexEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.reflexEnabled=e,this.app.scene.environmentIntensity=this.reflexEnabled?this.reflexIntensity:0,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setFlexIntensity(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.reflexIntensity=e,this.app.scene.environmentIntensity=this.reflexIntensity,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}defaultLights(){let e=new h(this.app);e.id=r.getGUID(12),e.lightType="Hemispheric",e.name="半球光_"+this.lights.count(),e.direction=new BABYLON.Vector3(1,1,0),e.color="#FFFFFF",e.intensity=1,this.lights.add(e.id,e);let t=new h(this.app);t.id=r.getGUID(12),t.lightType="Hemispheric",t.name="半球光_"+this.lights.count(),t.direction=new BABYLON.Vector3(-1,1,0),t.color="#FFFFFF",t.intensity=.7,this.lights.add(t.id,t)}offAllLight(){for(const e in this.lights.map)this.lights.find(e).light&&(this.lights.find(e).light.intensity=0,this.app.scene.removeLight(this.lights.find(e).light),this.lights.find(e).light.dispose()),this.lights.find(e).light=null}openAllLight(){for(const e in this.lights.map)this.lights.find(e).load()}loadLight(i){for(let t=0;t<i.length;t++){var n=i[t];let e;n.lightType==s.Hemispheric?(e=new h(this.app),e.id=n.id,e.lightType=n.lightType,e.name=n.name,e.direction=f.ToVector3(n.direction),e.color=n.color,e.intensity=n.intensity):n.lightType==s.Directional?(e=new a(this.app),e.id=n.id,e.lightType=n.lightType,e.name=n.name,e.direction=f.ToVector3(n.direction),e.position=f.ToVector3(n.position),e.color=n.color,e.intensity=n.intensity):n.lightType==s.Spot?(e=new l(this.app),e.id=n.id,e.lightType=n.lightType,e.name=n.name,e.direction=f.ToVector3(n.direction),e.position=f.ToVector3(n.position),e.angle=n.angle,e.exponent=n.exponent,e.range=n.range,e.color=n.color,e.intensity=n.intensity):n.lightType==s.Point&&(e=new c(this.app),e.id=n.id,e.lightType=n.lightType,e.name=n.name,e.position=f.ToVector3(n.position),e.range=n.range,e.color=n.color,e.intensity=n.intensity),e&&this.lights.add(e.id,e)}this.lights.count()<1&&this.defaultLights(),this.openAllLight()}setLightIntensity(e=1){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;for(const t in this.lights.map)this.lights.find(t).light.intensity=this.lights.find(t).intensity*e;this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}showTips(){this.app.ToolTips=new u(this.app)}closeTips(){this.app.ToolTips&&this.app.ToolTips.dispose(),this.app.ToolTips=null}showFps(e="position: absolute;left: 5px;bottom: 5px;z-index:999999999; font-size: 10px;color: rgb(0, 255, 0);text-shadow:rgba(0, 0, 0, 0.2) 1px 1px 0;"){this.app.fps||(this.app.fps=document.createElement("div"),this.app.canvas.parentElement.appendChild(this.app.fps)),this.app.fps.style.cssText=e}hideFps(){this.app.fps&&this.app.canvas.parentElement.removeChild(this.app.fps),this.app.fps=null}showDebug(){this.app.scene.debugLayer.show()}}(t=g=g||{}).Campus="Campus",t.Building="Building",t.Scene="Scene",t.Humiture="Humiture",t.Battery="Battery",t.PowerCabinet="PowerCabinet",t.Cabinet="Cabinet",t.AirCondition="AirCondition",t.UPS="UPS",t.Camera="Camera",t.NewWindMachine="NewWindMachine",t.SmokeDetector="SmokeDetector",t.AudibleVisualAlarm="AudibleVisualAlarm",t.LeakWater="LeakWater",t.Wall="Wall",t.Floor="Floor",t.Window="Window",t.Door="Door",t.AirFlow="AirFlow",t.Corner="Corner",t.FireFighting="FireFighting",t.Lighting="Lighting",t.Enclosure="Enclosure",t.ParkingLot="ParkingLot",t.Elevator="Elevator",t.Other="Other",t.InrackAsset="InrackAsset",t.GasDetection="GasDetection",t.Security="Security",t.OutDoorScene="OutDoorScene",t.Infrared="Infrared",t.SkyBox="SkyBox",t.UI3D="UI3D",t.ColdTongDoor="ColdTongDoor",t.VirtualBox="VirtualBox",t.PathPint="PathPint",t.Port="Port",t.Positioner="Positioner",t.AutoAnimation="AutoAnimation",t.MapModel="MapModel",t.radiator="radiator",t.Conduit="Conduit",t.Region="Region",t.optimizedWall="optimizedWall";class b{constructor(e){this.objectDatas=new m,this.app=e}clear(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;for(const e in this.objectDatas.map)this.objectDatas.find(e).instance&&this.objectDatas.find(e).instance.dispose();this.objectDatas.clear(),this.current=null,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}optimization(){this.app.scene.freezeActiveMeshes()}getChildsById(e=this.root.id,n=!1){e=e||this.root.id;let s=new Array;const r=e=>{for(const i in this.objectDatas.map){var t=this.objectDatas.find(i);t.parentId==e&&(s.push(t),n&&r(t.id))}};return r(e),s}getSceneTree(e=this.root.id,s=[]){e=e||this.root.id;const r=(e,i)=>{for(const t in this.objectDatas.map){var n=this.objectDatas.find(t);if(n.parentId==e){let t=!1;for(let e=0;e<s.length;e++)n.customType!=s[e]||(t=!0);t||(i.push({name:n.name,id:n.id,customNumber:n.customNumber,modelType:n.objectType,customType:n.customType,children:[]}),r(n.id,i[i.length-1].children))}}};e=this.objectDatas.find(e);if(e){e={name:e.name,id:e.id,customNumber:e.customNumber,modelType:e.objectType,customType:e.customType,children:[]};return r(this.root.id,e.children),e}console.error("指定的层级不存在")}findObjectById(e){return this.objectDatas.find(e)}findObjectByCustomNumber(e){let t=[];for(const n in this.objectDatas.map){var i=this.objectDatas.find(n);i.customNumber==e&&t.push(i)}return 0==t.length?null:(1<t.length&&console.log("存在编号重复对象,重复个数:"+t.length),t[0])}findObjectsByCustomType(e){let t=[];for(const n in this.objectDatas.map){var i=this.objectDatas.find(n);i.objectType==e&&t.push(i)}return t}findObjectsByType(e){let t=new Array;for(const n in this.objectDatas.map){var i=this.objectDatas.find(n);i.objectType==e&&t.push(i)}return t}computeSight(i){var n=BABYLON.Vector3.Zero(),s=BABYLON.Vector3.Zero();for(let e=0;e<i.length;e++){let t=i[e];if(t.objectType!=g.Region){let e=t.instance.getBoundingInfo();n&&s||(n=s=e.boundingBox.center.clone()),n=BABYLON.Vector3.Minimize(n,e.minimum.add(t.instance.position)),s=BABYLON.Vector3.Maximize(s,e.maximum.add(t.instance.position))}}return n&&s||(n=BABYLON.Vector3.Zero(),s=new BABYLON.Vector3(12,0,8)),f.getVisualAngle(new BABYLON.BoundingInfo(n,s),this.app)}switchLevel(t=this.root.id,i=!1,n=!0){t=t||this.root.id;var s=this.objectDatas.find(t);if(s){let e=this.getChildsById(t,n);e.forEach(e=>e.setEnabled(!0)),this.current=s,i&&this.app.Camera.perspective(this.computeSight(e))}else console.error("对象不存在")}}class A{constructor(e){this.walls=new m,this.resources=new m,this.ndoeMats=new m,this.Materials=new m,this.Textures=new m,this.MergeMaterials=new m,this.app=e;e=r.getGUID(12);this.transparentBox=BABYLON.MeshBuilder.CreateBox(e,{size:1},this.app.scene),this.transparentBox.alwaysSelectAsActiveMesh=!0;let t=new BABYLON.StandardMaterial(e,this.app.scene);t.diffuseTexture=new BABYLON.Texture(_.rl+"resources/white.jpg",this.app.scene,!0,!1),t.alphaMode=BABYLON.Engine.ALPHA_COMBINE,t.emissiveColor=BABYLON.Color3.Green(),this.transparentBox.material=t,this.transparentBox.setEnabled(!1),this.transparentBox.visibility=.3;e=r.getGUID(12);this.BOX=BABYLON.MeshBuilder.CreateBox(e,{size:1},this.app.scene),this.BOX.edgesColor=BABYLON.Color4.FromHexString("#4ba3fff2"),this.BOX.setEnabled(!1),this.BOX.visibility=0,this.FogTex=new BABYLON.Texture(_.rl+"resources/fogtex.png",this.app.scene,!0,!1)}async loadModelMesh(t){let i=this.resources.find(t.modelId);if(!i)try{i=await BABYLON.SceneLoader.LoadAssetContainerAsync(_.rl+"bundle/"+t.modelId+"/",t.modelId+t.extension,this.app.scene),0<i.animationGroups.length&&i.animationGroups[0].stop(),i.addAllToScene(),i.meshes[0].setEnabled(!1),i.meshes[0].getChildMeshes().forEach(e=>{e.metadata&&e.metadata.gltf&&e.metadata.gltf.extras&&(i.isExtras=!0,e.metadata.gltf.extras.U&&BABYLON.Animation.CreateAndStartAnimation("u",e.material.albedoTexture,"uOffset",30*e.metadata.gltf.extras.Uspeed,30,0,1,1),e.metadata.gltf.extras.V&&BABYLON.Animation.CreateAndStartAnimation("v",e.material.albedoTexture,"vOffset",30*e.metadata.gltf.extras.Vspeed,30,0,1,1))}),t.objectType==g.OutDoorScene||i.isExtras||i.meshes[0].getChildMeshes().forEach(e=>{e.registerInstancedBuffer("color",4),e.instancedBuffers.color=new BABYLON.Color4(1,1,1,1)}),this.resources.add(t.modelId,i)}catch(e){console.error("模型下载失败!模型编号:"+t.modelId+";错误信息:"+e)}return i}loadModelMeshAsync(t,i){var e=this.resources.find(t.modelId);e?i(e):BABYLON.SceneLoader.LoadAssetContainerAsync(_.rl+"bundle/"+t.modelId+"/",t.modelId+t.extension,this.app.scene).then(e=>{0<e.animationGroups.length&&e.animationGroups[0].stop(),this.resources.add(t.modelId,e),i(e)}).catch(()=>{console.error("模型下载失败!模型编号:"+t.modelId)})}GetMaterial(e,t){let i=this.Materials.find(e.modelId);var n;return void 0===i&&(n=this.GetTexture(e,t),i=new BABYLON.StandardMaterial(e.modelId,t),i.alphaMode=BABYLON.Engine.ALPHA_COMBINE,i.diffuseTexture=n,this.Materials.add(e.modelId,i)),i}GetTexture(e,t){let i=this.Textures.find(e.modelId);return void 0===i&&(i=new BABYLON.Texture(_.rl+"texture/"+e.modelId+e.extension,t,!1),".png"==e.extension&&(i.hasAlpha=!0),this.Textures.add(e.modelId,i)),i}GetMergeMaterial(t,i){let n=this.MergeMaterials.find(t.modelId);if(void 0===n){n=new BABYLON.CustomMaterial(t.modelId,i),n.alphaMode=2,this.MergeMaterials.add(t.modelId,n),n.AddUniform("textureData","sampler2D",null),n.Vertex_Definitions(`
|
|
6
6
|
varying vec3 localPos ;
|
|
7
7
|
varying vec3 localNrm ;
|
|
8
8
|
`),n.Fragment_Definitions(`
|
|
@@ -22,4 +22,4 @@
|
|
|
22
22
|
diffuseColor = res.rgb;
|
|
23
23
|
alpha = res.a;
|
|
24
24
|
}
|
|
25
|
-
`),n.freeze()}return n}delete(e=!1){if(this.BOX&&this.BOX.dispose(),this.transparentBox&&this.transparentBox.dispose(!0,!0),this.BOX=null,this.transparentBox=null,e){for(const t in this.resources.map)this.resources.find(t).removeAllFromScene(),this.resources.remove(t);this.resources.clear()}}async GetWalls(e,t){let i=await BABYLON.SceneLoader.LoadAssetContainerAsync(e,t+".gltf",this.app.scene);if(i.meshes){var n=i.meshes[0].getChildMeshes();for(let e=0;e<n.length;e++)this.walls.add(n[e].id,n[e])}}}t=i(14);const v=i.n(t).a.create();v.defaults.headers.post["Content-Type"]="application/json",v.interceptors.request.use(e=>{var t=localStorage.getItem("mx3d-token");return t&&(e.headers.Authorization="Bearer "+t),e},e=>Promise.reject(e)),v.interceptors.response.use(e=>e,e=>{if(e.response)switch(e.response.status){case 401:console.error("开发者授权码异常");break;case 403:console.error("当前用户没有权限");break;case 400:console.error(e.response.data.message)}return Promise.reject(e)});var B,w,T=v;class x{static init(){let e=new p.a.Tween(this.colors[1]).to({r:1,g:0,b:0},500),t=new p.a.Tween(this.colors[1]).to({r:1,g:.5,b:.5},500);t.chain(e),e.chain(t),e.start();let i=new p.a.Tween(this.colors[2]).to({r:1,g:.55,b:0},500),n=new p.a.Tween(this.colors[2]).to({r:0,g:0,b:0},500);i.chain(n),n.chain(i),i.start();let s=new p.a.Tween(this.colors[3]).to({r:1,g:.84,b:0},500),r=new p.a.Tween(this.colors[3]).to({r:0,g:0,b:0},500);s.chain(r),r.chain(s),s.start();let o=new p.a.Tween(this.colors[4]).to({r:0,g:.75,b:1},500),a=new p.a.Tween(this.colors[4]).to({r:0,g:0,b:0},500);o.chain(a),a.chain(o),o.start();let h=new p.a.Tween(this.colors[5]).to({r:.53,g:.8,b:0},500),c=new p.a.Tween(this.colors[5]).to({r:0,g:0,b:0},500);h.chain(c),c.chain(h),h.start();let l=new p.a.Tween(this.colors[6]).to({r:.8,g:.8,b:.8},500),u=new p.a.Tween(this.colors[6]).to({r:0,g:0,b:0},500);l.chain(u),u.chain(l),l.start()}}x.colors={1:BABYLON.Color3.Red(),2:new BABYLON.Color3(1,.5,0),3:BABYLON.Color3.Yellow(),4:new BABYLON.Color3(0,1,1),5:BABYLON.Color3.Green(),6:BABYLON.Color3.Gray()},(t=B=B||{})[t.Opaque=0]="Opaque",t[t.Flash=1]="Flash",t[t.Transparent=2]="Transparent",(t=w=w||{}).leftClick="leftClick",t.rightClick="rightClick",t.doubleClick="doubleClick",t.eover="eover",t.longPress="longPress",t.out="out";class E{constructor(e){this.executes=new f,this.clickEvents=new f,this.touchtime=(new Date).getTime(),this.effectType=B.Opaque,this.app=e}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),e?(this.instance.isPickable=0<this.executes.count(),this.executes.find(w.eover)||this.executes.find(w.out)?this.instance.enablePointerMoveEvents=!0:this.instance.enablePointerMoveEvents=!1):(this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}set showBoundingBox(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.showBoundingBox=e,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}get showBoundingBox(){return this.instance.showBoundingBox}bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.animation=e.animation,this.isAutoPlay=e.isAutoPlay,this.isloop=e.isloop,this.objectType=e.objectType;let t=new BABYLON.Mesh(this.id,this.app.scene),i=this.app.Resources.resources.find(this.modelId);i.meshes[0].getChildMeshes().forEach(e=>{e=e.createInstance(this.id);e.isPickable=!1,e.enablePointerMoveEvents=!1,e.parent=t}),t.rotation=m.ToVector3(e.rotation),t.position=m.ToVector3(e.position),t.scaling=m.ToVector3(e.scaling);e=m.computeBounds(t);t.setBoundingInfo(e),this.instance=this.app.Resources.BOX.clone(this.id),this.instance.id=this.id,this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.scaling=new BABYLON.Vector3((e.maximum.x-e.minimum.x)*t.scaling.x,(e.maximum.y-e.minimum.y)*t.scaling.y,(e.maximum.z-e.minimum.z)*t.scaling.z),0==this.instance.scaling.y&&(this.instance.scaling.y=.01),this.instance.position=t.position.clone(),this.instance.position.y=(e.maximum.y-e.minimum.y)/2+t.position.y,this.instance.rotation=t.rotation.clone(),t.setParent(this.instance),this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.computeView()}computeView(){this.Sight=new b;var e=this.instance.getBoundingInfo(),t=m.getVisualAngle(e,this.app);this.Sight.alpha=t.alpha,this.Sight.beta=t.beta,this.Sight.focus=this.instance.getAbsolutePosition(),this.Sight.radius=e.boundingSphere.radiusWorld+3,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}optimization(t){this.instance.getChildMeshes().forEach(e=>{t?e.freezeWorldMatrix():e.unfreezeWorldMatrix()}),t?this.instance.freezeWorldMatrix():this.instance.unfreezeWorldMatrix(),this.instance.material&&(t?this.instance.material.freeze():this.instance.material.unfreeze())}alwaysActive(){this.instance.getChildMeshes().forEach(e=>{e.alwaysSelectAsActiveMesh=!0,e.doNotSyncBoundingInfo=!1,e.ignoreNonUniformScaling=!0}),this.instance.alwaysSelectAsActiveMesh=!0,this.instance.doNotSyncBoundingInfo=!1}addEventListener(e,t){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=null;var n;e==w.leftClick||e==w.rightClick?(this.clickEvents.remove(e),this.clickEvents.add(e,t),this.instance.isPickable=!0,i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger,e=>{let t=this.clickEvents.find(w.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(w.rightClick);i&&2==e.sourceEvent.button&&i(this,e),this.touchtime=(new Date).getTime()}),e="click"):e==w.doubleClick?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnDoublePickTrigger,e=>t(this,e)):e==w.eover?(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOverTrigger,e=>t(this,e)),this.instance.enablePointerMoveEvents=!0):e==w.longPress?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnLongPressTrigger,e=>t(this,e)):e==w.out&&(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOutTrigger,e=>t(this,e)),this.instance.enablePointerMoveEvents=!0),i&&(this.action||(this.action=new BABYLON.ActionManager(this.app.scene),this.instance.actionManager=this.action),(n=this.executes.find(e))&&this.action.unregisterAction(n),this.executes.remove(e),this.executes.add(e,i),this.action.registerAction(i)),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}removeEventListener(e){if(e==w.leftClick||e==w.rightClick||e==w.doubleClick){if(this.clickEvents.remove(e),0<this.clickEvents.count())return;e="click"}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;var t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),0==this.executes.count()&&(this.action=null,this.instance.actionManager=this.action),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setFlash(t){this.effectType==B.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(e=>{e.instancedBuffers&&(e.instancedBuffers.color=x.colors[t])}),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=B.Flash)}setOpaque(){this.effectType!=B.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(e=>{e.setEnabled(!0),e.instancedBuffers&&(e.instancedBuffers.color=new BABYLON.Color4(1,1,1,1))}),this.instance.disableEdgesRendering(),this.instance.visibility=0,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=B.Opaque)}setTransparent(e=.3){this.effectType==B.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(e=>e.setEnabled(!1)),this.instance.visibility=e,this.instance.enableEdgesRendering(),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=B.Transparent)}play(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(t=>{let i;t.animations.forEach(e=>{-1!=e.name.indexOf("open")&&(i=e)}),i?this.app.scene.beginDirectAnimation(t,[i],0,10*i.getKeys().length,this.isloop):t.animations.forEach(e=>this.app.scene.beginDirectAnimation(t,[e],0,10*e.getKeys().length,this.isloop))}),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}stop(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(t=>{let i;t.animations.forEach(e=>{-1!=e.name.indexOf("close")&&(i=e)}),i?this.app.scene.beginDirectAnimation(t,[i],0,10*i.getKeys().length,!1):t.animations.forEach(e=>this.app.scene.beginDirectAnimation(t,[e],10*e.getKeys().length,0,!1))}),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}flyTo(){this.app.Camera.translation(this.Sight,500)}focus(){}}class M extends E{constructor(){super(...arguments),this.baseModel=null}bind(e){this.id=r.getGUID(12),this.objectType="Wall",this.name="墙体",this.instance=D.Tools.MergeMeshes(e.walls,this.app),this.instance.setEnabled(!1),this.instance.receiveShadows=!0,e.t&&""!=e.t?(this.modelId=e.t.modelId,this.baseModel=e.t,this.baseModel.length||(this.baseModel.length=3.1),this.nativeMaterial=this.app.Resources.GetMergeMaterial(e.t,this.app.scene)):this.nativeMaterial=null,this.instance.material=this.nativeMaterial,this.instance.id=this.id,this.instance.name=this.id,this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.instance.position.y=this.height,this.alwaysActive(),this.optimization(!0)}}class O extends E{bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.height=e.baseModel.height,this.objectType=e.objectType,this.instance=new BABYLON.Mesh(this.id,this.app.scene);let t=this.app.Resources.resources.find(this.modelId);t.meshes[0].getChildMeshes().forEach(e=>{e.createInstance(this.id).parent=this.instance});var i=m.computeBounds(this.instance);this.instance.rotation=m.ToVector3(e.rotation),this.instance.position=m.ToVector3(e.position),this.Sight=m.getVisualAngle(i,this.app);let n=this.app.Resources.BOX.createInstance(this.id);n.setBoundingInfo(i),n.enablePointerMoveEvents=!1,n.isPickable=!1,n.scaling=new BABYLON.Vector3((i.maximum.x-i.minimum.x)*this.instance.scaling.x,(i.maximum.y-i.minimum.y)*this.instance.scaling.y,(i.maximum.z-i.minimum.z)*this.instance.scaling.z),n.position=this.instance.position.clone(),n.position.y=(i.maximum.y-i.minimum.y)/2+this.instance.position.y,n.rotation=this.instance.rotation.clone(),this.instance.getChildMeshes().forEach(e=>e.setParent(n)),this.instance.dispose(),this.instance=n,this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.computeView()}}class L extends E{bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.height=e.baseModel.height,this.objectType=e.objectType,this.instance=new BABYLON.Mesh(this.id,this.app.scene);let t=this.app.Resources.resources.find(this.modelId);t.meshes[0].getChildMeshes().forEach(e=>{e.createInstance(this.id).parent=this.instance});var i=m.computeBounds(this.instance);this.instance.rotation=m.ToVector3(e.rotation),this.instance.position=m.ToVector3(e.position);let n=this.app.Resources.BOX.createInstance(this.id);n.setBoundingInfo(i),n.enablePointerMoveEvents=!1,n.isPickable=!1,n.scaling=new BABYLON.Vector3((i.maximum.x-i.minimum.x)*this.instance.scaling.x,(i.maximum.y-i.minimum.y)*this.instance.scaling.y,(i.maximum.z-i.minimum.z)*this.instance.scaling.z),n.position=this.instance.position.clone(),n.position.y=(i.maximum.y-i.minimum.y)/2+this.instance.position.y,n.rotation=this.instance.rotation.clone(),this.instance.getChildMeshes().forEach(e=>e.setParent(n)),this.instance.dispose(),this.instance=n,this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.computeView()}}class R extends E{}class C extends E{bind(e){let t=m.ToARRVector3(e.lines);this.Sight.focus=t[0].clone(),this.instance=m.createTube(e.id,t,.02,this.app),this.instance.setEnabled(!1),this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.objectType=e.objectType;e=this.app.Resources.GetMaterial(e.baseModel,this.app.scene).clone(this.id);BABYLON.Animation.CreateAndStartAnimation("u",e.diffuseTexture,"vOffset",15,30,0,1,1),e.diffuseTexture.vScale=this.instance.getTotalVertices()/50,this.instance.material=e,this.alwaysActive(),this.computeView()}computeView(){this.Sight=new b;var e=this.instance.getBoundingInfo(),t=m.getVisualAngle(e,this.app);this.Sight.alpha=t.alpha,this.Sight.beta=t.beta,this.Sight.radius=e.boundingSphere.radiusWorld+3,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}addEventListener(e,t){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=null;var n;e==w.leftClick||e==w.rightClick||e==w.doubleClick?(this.clickEvents.remove(e),this.clickEvents.add(e,t),this.instance.isPickable=!0,i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger,e=>{let t=this.clickEvents.find(w.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(w.rightClick);i&&2==e.sourceEvent.button&&i(this,e);let n=this.clickEvents.find(w.doubleClick);n&&0==e.sourceEvent.button&&(new Date).getTime()-this.touchtime<500&&n(this,e),this.touchtime=(new Date).getTime()}),e="click"):e==w.eover?(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOverTrigger,e=>t(this,e)),this.instance.enablePointerMoveEvents=!0):e==w.longPress?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnLongPressTrigger,e=>t(this,e)):e==w.out&&(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOutTrigger,e=>t(this,e)),this.instance.enablePointerMoveEvents=!0),i&&(this.action||(this.action=new BABYLON.ActionManager(this.app.scene),this.instance.actionManager=this.action),(n=this.executes.find(e))&&this.action.unregisterAction(n),this.executes.remove(e),this.executes.add(e,i),this.action.registerAction(i)),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}removeEventListener(e){if(e==w.leftClick||e==w.rightClick||e==w.doubleClick){if(this.clickEvents.remove(e),0<this.clickEvents.count())return;e="click"}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;var t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),0==this.executes.count()&&(this.action=null,this.instance.actionManager=this.action,this.instance.getChildMeshes().forEach(e=>e.actionManager=this.action)),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class N extends E{async bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.objectType=e.objectType,"Cylinder"==e.virtualType?this.instance=BABYLON.MeshBuilder.CreateCylinder(this.id,{height:1,diameterTop:1,diameterBottom:1},this.app.scene):this.instance=BABYLON.MeshBuilder.CreateBox(this.id,{size:1},this.app.scene),this.instance.setEnabled(!1),this.instance.id=this.id;let t=new BABYLON.StandardMaterial(this.id,this.app.scene);t.diffuseColor=BABYLON.Color3.FromHexString(e.color),e.alpha<.98&&(t.alpha=e.alpha,t.alphaMode=2,t.useAlphaFromDiffuseTexture=!0),this.instance.material=t,e.isEdges&&(this.instance.enableEdgesRendering(),this.instance.edgesWidth=1,this.instance.edgesColor=new BABYLON.Color4(0,1,1,1)),e.edgesWidth&&0<e.edgesWidth&&(this.instance.enableEdgesRendering(),this.instance.edgesWidth=e.edgesWidth,this.instance.edgesColor=BABYLON.Color3.FromHexString(e.edgesColor).toColor4(1)),this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.rotation=D.Tools.ToVector3(e.rotation),this.instance.position=D.Tools.ToVector3(e.position),this.instance.scaling=D.Tools.ToVector3(e.scaling),this.alwaysActive(),this.optimization(!0),this.computeView()}}class P extends E{bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.objectType=e.objectType;let t={};t.color=e.color,e.size?(t.clearColor=null,t.position=D.Tools.ToVector3(e.position),s=D.Tools.ToVector3(e.rotation),t.rotation=new BABYLON.Vector3(s.x+Math.PI,s.y,s.z),i=Number.parseInt(e.size.replace("px",""))/40,s=e.scaling?D.Tools.ToVector3(e.scaling):BABYLON.Vector3.One(),t.scaling=new BABYLON.Vector3(14*i/50*s.x,1,14*i/50*s.z)):(t.clearColor=e.clearColor,t.position=D.Tools.ToVector3(e.position),t.rotation=D.Tools.ToVector3(e.rotation),t.scaling=D.Tools.ToVector3(e.scaling));var i="bold 100px Arial";let n=new BABYLON.DynamicTexture(this.id,64,this.app.scene,!1);var s=n.getContext();s.font=i;e=s.measureText(this.name).width+8,s=.02*e;n=new BABYLON.DynamicTexture(this.id,{width:e,height:150},this.app.scene,!1);e=new BABYLON.StandardMaterial(this.id,this.app.scene);e.backFaceCulling=!1,e.diffuseTexture=n,t.clearColor||(n.hasAlpha=!0),n.drawText(this.name,null,null,i,t.color,t.clearColor,!1),this.instance=BABYLON.Mesh.CreateGround(this.id,s,3,1,this.app.scene),this.instance.setEnabled(!1),this.instance.scaling=t.scaling,this.instance.position=t.position,this.instance.rotation=t.rotation,this.instance.material=e,this.alwaysActive(),this.optimization(!0),this.computeView()}}class S extends E{bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.objectType=e.objectType,this.color=e.color,this.instance=new BABYLON.Mesh(this.id);var t=m.ToARRVector3(e.pints);let i=m.createTube(e.id,t,e.radius,this.app);this.instance.position=i.getBoundingInfo().boundingBox.center.clone(),this.instance.addChild(i),e.rotation&&(this.instance.rotation=m.ToVector3(e.rotation)),e.position&&(this.instance.position=m.ToVector3(e.position)),i.setParent(this.instance.parent),this.instance.dispose(),this.instance=i;let n=new BABYLON.StandardMaterial(e.id,this.app.scene);n.diffuseColor=BABYLON.Color3.FromHexString(e.color),n.alpha=e.alpha,this.alpha=e.alpha,this.instance.material=n,this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.setEnabled(!1),this.alwaysActive(),this.optimization(!0),this.computeView()}setColor(e,t,i){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.diffuseColor=new BABYLON.Color3(e/255,i/255,t/255),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}reColor(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.diffuseColor=BABYLON.Color3.FromHexString(this.color),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}computeView(){this.Sight=new b;var e=this.instance.getBoundingInfo(),e=m.getVisualAngle(e,this.app);this.alpha=e.alpha,this.Sight.beta=e.beta,this.Sight.focus=e.focus,this.Sight.radius=e.radius,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}setFlash(e=1){this.effectType==B.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.emissiveColor=x.colors[e],this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=B.Flash)}setOpaque(){this.effectType!=B.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!0),this.instance.material.alpha=this.alpha,this.instance.material.emissiveColor=null,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=B.Opaque)}setTransparent(e=.3){this.effectType==B.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.alpha=e,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=B.Transparent)}}class k extends E{bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.objectType=e.objectType,this.instance=BABYLON.MeshBuilder.CreatePolygon("地板",{shape:m.Expand(e.vectors,-.01),holes:e.buckles,sideOrientation:BABYLON.Mesh.DOUBLESIDE},this.app.scene),this.alwaysActive(),this.instance.setEnabled(!1),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.instance.position.y=this.height,this.instance.id=e.id,this.instance.name="地板";var t=this.app.Resources.GetMaterial(e.baseModel,this.app.scene).clone(e.id),i=this.instance.getBoundingInfo();this.Sight=m.getVisualAngle(i,this.app),e.baseModel.isTiling&&(t.diffuseTexture.uScale=(i.maximum.x-i.minimum.x)/e.baseModel.width,t.diffuseTexture.vScale=(i.maximum.z-i.minimum.z)/e.baseModel.length),this.instance.material=t,this.optimization(!0),this.computeView()}}class I extends E{bind(e){this.id=e.id,this.parentId=e.parentId,this.objectType="Wall",this.instance=this.app.Resources.walls.find(e.id),this.instance&&(this.app.scene.addMesh(this.instance),this.app.Resources.walls.remove(e.id),e.baseModel?(this.modelId=e.baseModel.modelId,this.nativeMaterial=this.app.Resources.GetMergeMaterial(e.baseModel,this.app.scene)):this.nativeMaterial=null,this.instance.material=this.nativeMaterial,this.instance.id=this.id,this.instance.name=this.id,this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.computeView())}}class Y extends E{bind(i){let e=!1;this.id=r.getGUID(12),this.name="墙角",this.objectType="Corner";let n=new Array;for(let t=0;t<i.length;t++)if(2<i[t].pints.length){let e=BABYLON.MeshBuilder.CreatePolygon(this.id,{shape:i[t].pints,sideOrientation:BABYLON.Mesh.FRONTSIDE},this.app.scene);e.setEnabled(!1),e.position.y=i[t].height,e.isPickable=!0,e.enablePointerMoveEvents=!1,n.push(e)}return n.length<1||(1<n.length?this.instance=m.MergeMeshes(n,this.app):this.instance=n[0],this.instance.id=this.id,this.instance.name=this.id,this.instance.position.y=this.height,this.instance.setEnabled(!1),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.alwaysActive(),this.optimization(!0),e=!0),e}}class j extends E{constructor(e,t){super(e),this.height=0,this.id=t.id,this.objectType=t.objectType,this.customNumber=t.customNumber,this.customType=t.customType,this.name=t.name,this.parentId=t.parentId,this.height=t.height,this.index=t.index}bind(s,e=0){let t=!1;for(let e=0;e<s.length;e++){var i=s[e];if(i.objectType==g.optimizedWall){t=!0;let e=new I(this.app);e.bind(i),e.instance&&this.app.Project.objectDatas.add(e.id,e)}}let o=new Array;for(let t=0;t<s.length;t++){let e=s[t];e.objectType==g.Wall&&(e.height||(e.height=3.1),e.ply||(e.ply=.09),o.push(e))}let r=new f;for(let e=0;e<s.length;e++){let i=s[e];i.objectType==g.Corner&&(r.add(i.id,i.corner),2<i.pints.length&&(i.height=3.1,i.walls.forEach(t=>{o.forEach(e=>{t==e.id&&parseFloat(e.height)<i.height&&(i.height=parseFloat(e.height))})})))}if(!t){let t=new Array;for(let e=0;e<s.length;e++){var n=s[e];n.objectType==g.Corner&&t.push(n)}let e=new Y(this.app);e.height=this.height,e.bind(t)?(e.parentId=this.id,this.app.Project.objectDatas.add(e.id,e)):e=null}for(let i=0;i<s.length;i++){let n=s[i];if(n.objectType==g.Floor){n.vectors=new Array;let e=s[i];e.pints.forEach(e=>{r.find(e)||console.log(e),n.vectors.push(r.find(e))}),n.buckles=new Array,e.holes&&e.holes.forEach(e=>{let t=new Array;e.forEach(e=>t.push(r.find(e))),n.buckles.push(t)}),e.middles&&e.middles.forEach(t=>{let i=Array();for(let e=0;e<s.length;e++)s[e].id==t&&s[e].pints.forEach(e=>{e=r.find(e);i.push(new BABYLON.Vector3(e.x,0,e.z))});n.buckles.push(i)});let t=new k(this.app);t.height=this.height,t.bind(n),this.app.Project.objectDatas.add(t.id,t)}}r=null;for(let t=0;t<s.length;t++){var a=s[t];let e;if(a.objectType==g.Window)e=new O(this.app);else if(a.objectType==g.Door)e=new L(this.app);else if(a.objectType==g.Cabinet)e=new R(this.app);else if(a.objectType==g.LeakWater)e=new C(this.app);else if(a.objectType==g.VirtualBox)e=new N(this.app);else if(a.objectType==g.UI3D)e=new P(this.app);else if(a.objectType==g.Conduit)e=new S(this.app);else{if(a.objectType==g.Wall||a.objectType==g.optimizedWall)continue;if(a.objectType==g.Corner)continue;if(a.objectType==g.Floor)continue;e=new E(this.app)}e.bind(a),this.app.Project.objectDatas.add(e.id,e)}if(!t){let r=new f;r.add("body",{t:"",walls:new Array});for(let s=0;s<o.length;s++){let n=BABYLON.MeshBuilder.ExtrudePolygon(o[s].id,{shape:[m.ToVector3(o[s].wtop),m.ToVector3(o[s].wleft),m.ToVector3(o[s].wbottom),m.ToVector3(o[s].wright)],depth:parseFloat(o[s].height),sideOrientation:BABYLON.Mesh.FRONTSIDE},this.app.scene);n.setEnabled(!1),n.position.y=parseFloat(o[s].height),n.subMeshes=[];var h=n.getTotalVertices();n.subMeshes.push(new BABYLON.SubMesh(0,0,h,0,6,n)),n.subMeshes.push(new BABYLON.SubMesh(0,1,h,18,6,n)),n.subMeshes.push(new BABYLON.SubMesh(0,2,h,30,6,n));for(let i=0;i<o[s].wallwindows.length;i++){const p=BABYLON.CSG.FromMesh(n);let e=this.app.Project.objectDatas.find(o[s].wallwindows[i]);var c=e.instance.getBoundingInfo(),l=BABYLON.MeshBuilder.CreateBox((new Date).getTime().toString(),{height:c.maximum.y-c.minimum.y,width:c.maximum.x-c.minimum.x,depth:2*parseFloat(o[s].ply)+.1},this.app.scene);l.position=e.instance.position.clone(),l.position.y=(c.maximum.y-c.minimum.y)/2+e.height,l.rotation=e.instance.rotation.clone();c=BABYLON.CSG.FromMesh(l);let t=p.subtract(c);l.dispose(),n.dispose(),n=t.toMesh(o[s].id,null,this.app.scene,!0),n.setEnabled(!1)}let t=r.find(o[s].leftMap.modelId);t||(t={t:o[s].leftMap,walls:new Array},r.add(o[s].leftMap.modelId,t));let i=r.find(o[s].rightMap.modelId);i||(i={t:o[s].rightMap,walls:new Array},r.add(o[s].rightMap.modelId,i));var u=m.DeconsTructMesh(n,parseFloat(o[s].height),this.app);for(let e=0;e<u.length;e++)(2==e||3==e?t:4==e||5==e?i:r.find("body")).walls.push(u[e])}for(const d in r.map)if(0<r.find(d).walls.length){let e=new M(this.app);e.parentId=this.id,e.height=this.height,e.bind(r.find(d)),this.app.Project.objectDatas.add(e.id,e)}}o=null,this.computeView()}computeView(){this.Sight=new b;var e=this.getBounding(),e=m.getVisualAngle(e,this.app);this.Sight.alpha=e.alpha,this.Sight.beta=e.beta,this.Sight.focus=e.focus,this.Sight.radius=e.radius,this.Sight.focus.y=this.height}flyTo(){this.app.Camera.flyTo(this.Sight,500)}focus(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;for(const t in this.app.Project.objectDatas.map){let e=this.app.Project.objectDatas.find(t);e.setEnabled(!0)}(this.app.Project.current=this).app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setEnabled(e){}getBounding(){var i,n;for(const e in this.app.Project.objectDatas.map){let t=this.app.Project.objectDatas.find(e);if(t.objectType!=g.Region){let e=t.instance.getBoundingInfo();i&&n||(i=n=e.boundingBox.center.clone()),i=BABYLON.Vector3.Minimize(i,e.minimum.add(t.instance.position)),n=BABYLON.Vector3.Maximize(n,e.maximum.add(t.instance.position))}}return i&&n||(i=BABYLON.Vector3.Zero(),n=new BABYLON.Vector3(12,this.height,8)),new BABYLON.BoundingInfo(i,n)}dispose(){}}class D{}D.sl="https://www.wodashijie.com/",D.rl="https://models.wodashijie.com/",D.App=class{constructor(e){e.sl&&(D.sl=e.sl),e.rl&&(D.rl=e.rl),T.defaults.baseURL=D.sl,this.canvas=document.createElement("canvas"),this.canvas.style.cssText="width: 100%;height: 100%;background-color: transparent;outline-width: 0;-webkit-tap-highlight-color:transparent;",e.container.appendChild(this.canvas),this.engine=new BABYLON.Engine(this.canvas,!0,{premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0}),this.engine.setHardwareScalingLevel(.5),this.engine.enableOfflineSupport=!1,this.scene=new BABYLON.Scene(this.engine,{useGeometryUniqueIdsMap:!0,useClonedMeshMap:!0,useMaterialMeshMap:!0}),this.scene.useOrderIndependentTransparency=!0,this.scene.useRightHandedSystem=!0,this.scene.getBoundingBoxRenderer().frontColor=BABYLON.Color3.Green(),this.scene.getBoundingBoxRenderer().showBackLines=!1,this.Camera=new n(this),this.HighlightLayer=new BABYLON.HighlightLayer("highlightLayer",this.scene),this.container=BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("screenUI"),this.Environment=new d(this),this.Environment.defaultLights(),this.Environment.openAllLight(),this.Resources=new A(this),this.Project=new y(this),D.EffectMgr.init(),this.engine.runRenderLoop(()=>{this.fps&&(this.fps.innerText=this.engine.getFps().toFixed()+" fps"),this.scene.render(),p.a.update()}),window.addEventListener("resize",()=>{this.engine.resize()}),this.scene.onPointerObservable.add(e=>{switch(e.type){case BABYLON.PointerEventTypes.POINTERMOVE:if(!this.ToolTips)return;e.pickInfo&&e.pickInfo.pickedPoint?this.ToolTips.update(e):this.ToolTips.close();break;case BABYLON.PointerEventTypes.POINTERWHEEL:var t;this.Camera.isOverLook?this.Camera._wheel(e.event):(t=1e3/(this.Camera.camera.radius/20),this.Camera.camera.panningSensibility=2e3<t?2e3:t<10?10:t),e.event.preventDefault()}}),this.scene.onKeyboardObservable.add(e=>{e.type===BABYLON.KeyboardEventTypes.KEYDOWN&&70===e.event.keyCode&&prompt("请复制输入框内的视角参数",JSON.stringify({alpha:this.Camera.camera.alpha,focus:m.vector3ToJson(this.Camera.camera.target),radius:this.Camera.camera.radius,beta:this.Camera.camera.beta}))})}async load(u={pk:null,isDefaultLevel:!0,progress:null,complete:null}){D.pk=u.pk;var e=await T.get(`api/Account/Developer?accessToken=${encodeURIComponent(D.accessToken)}`);if(200==e.status){localStorage.setItem("mx3d-token",e.data);e=await T.get(`api/WorkFiles/GetProject?pk=${D.pk}`);if(200==e.status){let l=e.data;return new Promise(async(n,t)=>{try{this.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let t=new f;for(let e=0;e<l.length;e++){const a=l[e];!a.baseModel||".gltf"!=a.baseModel.extension||t.find(a.baseModel.modelId)||this.Resources.resources.find(a.baseModel.modelId)||(a.baseModel.objectType=a.objectType,t.add(a.baseModel.modelId,a.baseModel))}let e=0;for(const h in t.map)await this.Resources.loadModelMesh(t.find(h)),e++,u&&u.progress&&u.progress(e/t.count()*.3);e=0,t=null;let i=new f;for(let e=0;e<l.length;e++){var s,r=l[e];r.objectType==g.Region&&(s=new j(this,r),this.Project.objectDatas.add(s.id,s),i.add(s.id,new Array),"0"==s.parentId&&(this.Project.root=s))}for(let e=0;e<l.length;e++){var o=l[e];if(o.objectType!=g.Region){let e=i.find(o.parentId);e.push(o)}}for(const c in i.map)await this.Project.objectDatas.find(c).bind(i.find(c)),e++,u&&u.progress&&u.progress(.3+e/i.count()*.7);i=null,this.Project.optimization(),u.isDefaultLevel&&this.Project.switchLevel(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1,n(null),this.engine.resize(),u&&u.complete&&u.complete()}catch(e){t(e)}})}}}dispose(){this.Environment.hideFps(),this.Project.clear(),this.Resources.delete(),this.engine.dispose()}},D.Tools=m,D.EffectMgr=x,D.IconFromMesh=class{constructor(e,t,i,n,s,r){this.id=e,this.scene=r,this.url=i,this.scaling=n,this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance=BABYLON.Mesh.CreatePlane(this.id,n,this.scene,!0,BABYLON.Mesh.DOUBLESIDE),this.instance.alwaysSelectAsActiveMesh=!0,this.instance.position=t.clone(),this.instance.position.y+=s,this.instance.billboardMode=BABYLON.Mesh.BILLBOARDMODE_Y;let o=new BABYLON.StandardMaterial("Mat_"+this.id,this.scene);o.diffuseColor=BABYLON.Color3.White(),o.emissiveColor=BABYLON.Color3.White(),this.instance.material=o,this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setBackground(){let i=new Image;i.src=this.url,i.onload=()=>{this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.scaling.y=this.scaling/(i.width/i.height)/this.scaling;let e=new BABYLON.DynamicTexture(this.id,{width:i.width,height:i.height},this.scene,!1);e.hasAlpha=!0,this.instance.material.diffuseTexture=e;let t=e.getContext();t.drawImage(i,0,0),e.update(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}addEventListener(t){if(this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.actionManager&&this.instance.actionManager.dispose(),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,t){this.instance.isPickable=!0,this.instance.enablePointerMoveEvents=!0;let e=new BABYLON.ActionManager(this.scene);e.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger,e=>t(this.id))),this.instance.actionManager=e}this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setColor(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.material.diffuseColor=BABYLON.Color3.FromHexString(e),this.instance.material.emissiveColor=BABYLON.Color3.FromHexString(e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setContents(i){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let n=new Image;n.src=this.url,n.onload=()=>{this.instance.scaling.y=this.scaling/(n.width/n.height)/this.scaling;let t=new BABYLON.DynamicTexture(this.id,{width:n.width,height:n.height},this.scene,!1);t.hasAlpha=!0,this.instance.material.diffuseTexture=t;let e=t.getContext();e.drawImage(n,0,0),i.forEach(e=>t.drawText(e.text,e.left,e.top,"bold "+e.fontSize+" monospace",e.color||"#fffffb","",!0,!0)),t.update(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}dispose(){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.dispose(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}},D.Icon=class{constructor(e,t){this.textDics=new Array,this.id=e,this.scene=t}set background(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this._background&&this._background.dispose(),this._background=new BABYLON.GUI.Image(r.getGUID(12)+"_Image",e),this._background.width=this.size.width+"px",this._background.height=this.size.height+"px",this.rect.addControl(this._background),this.onPointerClick&&(this._background.isPointerBlocker=!1,this._background.onPointerClickObservable.add(()=>{this.onPointerClick()})),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setTexts(i){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.textDics.forEach(e=>e.dispose());for(let t=this.textDics.length=0;t<i.length;t++){let e=new BABYLON.GUI.TextBlock;e.text=i[t].text,e.fontSize=i[t].fontSize||"20px",e.color=i[t].color||"white",e.top=i[t].top||0,e.left=i[t].left||0,this.rect.addControl(e),this.textDics.push(e)}this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}line(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this._line&&this._line.dispose(),this._line=new BABYLON.GUI.Line,this._line.lineWidth=e.width||1.5,this._line.color=e.color||"green",this._line.y2=this.size.height/2,this.container.addControl(this._line),this._line.linkWithMesh(this.pint),this._line.connectedControl=this.rect,this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}dispose(){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.rect&&this.rect.dispose(),this._line&&this._line.dispose(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.rect&&(this.rect.isVisible=e),this._line&&(this._line.isVisible=e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}}],l={},h.m=c,h.c=l,h.d=function(e,t,i){h.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},h.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},h.t=function(t,e){if(1&e&&(t=h(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(h.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)h.d(i,n,function(e){return t[e]}.bind(null,n));return i},h.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return h.d(t,"a",t),t},h.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},h.p="",h(h.s=44).default;function h(e){if(l[e])return l[e].exports;var t=l[e]={i:e,l:!1,exports:{}};return c[e].call(t.exports,t,t.exports,h),t.l=!0,t.exports}var c,l});
|
|
25
|
+
`),n.freeze()}return n}delete(e=!1){if(this.BOX&&this.BOX.dispose(),this.transparentBox&&this.transparentBox.dispose(!0,!0),this.BOX=null,this.transparentBox=null,e){for(const t in this.resources.map)this.resources.find(t).removeAllFromScene(),this.resources.remove(t);this.resources.clear()}}async GetWalls(e,t){let i=await BABYLON.SceneLoader.LoadAssetContainerAsync(e,t+".gltf",this.app.scene);if(i.meshes){var n=i.meshes[0].getChildMeshes();for(let e=0;e<n.length;e++)this.walls.add(n[e].id,n[e])}}}t=i(14);const y=i.n(t).a.create();y.defaults.headers.post["Content-Type"]="application/json",y.interceptors.request.use(e=>{var t=localStorage.getItem("mx3d-token");return t&&(e.headers.Authorization="Bearer "+t),e},e=>Promise.reject(e)),y.interceptors.response.use(e=>e,e=>{if(e.response)switch(e.response.status){case 401:console.error("开发者授权码异常");break;case 403:console.error("当前用户没有权限");break;case 400:console.error(e.response.data.message)}return Promise.reject(e)});var B,v,w=y;class T{static init(){let e=new p.a.Tween(this.colors[1]).to({r:1,g:0,b:0},500),t=new p.a.Tween(this.colors[1]).to({r:1,g:.5,b:.5},500);t.chain(e),e.chain(t),e.start();let i=new p.a.Tween(this.colors[2]).to({r:1,g:.55,b:0},500),n=new p.a.Tween(this.colors[2]).to({r:0,g:0,b:0},500);i.chain(n),n.chain(i),i.start();let s=new p.a.Tween(this.colors[3]).to({r:1,g:.84,b:0},500),r=new p.a.Tween(this.colors[3]).to({r:0,g:0,b:0},500);s.chain(r),r.chain(s),s.start();let o=new p.a.Tween(this.colors[4]).to({r:0,g:.75,b:1},500),a=new p.a.Tween(this.colors[4]).to({r:0,g:0,b:0},500);o.chain(a),a.chain(o),o.start();let h=new p.a.Tween(this.colors[5]).to({r:.53,g:.8,b:0},500),c=new p.a.Tween(this.colors[5]).to({r:0,g:0,b:0},500);h.chain(c),c.chain(h),h.start();let l=new p.a.Tween(this.colors[6]).to({r:.8,g:.8,b:.8},500),u=new p.a.Tween(this.colors[6]).to({r:0,g:0,b:0},500);l.chain(u),u.chain(l),l.start()}}T.colors={1:BABYLON.Color3.Red(),2:new BABYLON.Color3(1,.5,0),3:BABYLON.Color3.Yellow(),4:new BABYLON.Color3(0,1,1),5:BABYLON.Color3.Green(),6:BABYLON.Color3.Gray()},(t=B=B||{})[t.Opaque=0]="Opaque",t[t.Flash=1]="Flash",t[t.Transparent=2]="Transparent",(t=v=v||{}).leftClick="leftClick",t.rightClick="rightClick",t.doubleClick="doubleClick",t.eover="eover",t.longPress="longPress",t.out="out";class x{toJosn(e){e=JSON.parse(e);this.alpha=e.alpha,this.beta=e.beta,this.radius=e.radius,this.minimumLimit=e.minimumLimit,this.maximumLimit=e.maximumLimit,this.minBeta=e.minBeta,this.maxBeta=e.maxBeta,this.focus=f.ToVector3(e.focus)}toString(){return JSON.stringify({alpha:this.alpha,focus:f.vector3ToJson(this.focus),radius:this.radius,beta:this.beta,minimumLimit:this.minimumLimit,maximumLimit:this.maximumLimit,minBeta:this.minBeta,maxBeta:this.maxBeta})}setLimit(e,t){this.minimumLimit=e+.3,this.maximumLimit=t}setBeta(e,t){this.minBeta=e,this.maxBeta=t}}class O{constructor(e){this.executes=new m,this.clickEvents=new m,this.touchtime=(new Date).getTime(),this.effectType=B.Opaque,this.app=e}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),e?(this.instance.isPickable=0<this.executes.count(),this.executes.find(v.eover)||this.executes.find(v.out)?this.instance.enablePointerMoveEvents=!0:this.instance.enablePointerMoveEvents=!1):(this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}set showBoundingBox(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.showBoundingBox=e,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}get showBoundingBox(){return this.instance.showBoundingBox}bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.animation=e.animation,this.isAutoPlay=e.isAutoPlay,this.isloop=e.isloop,this.objectType=e.objectType;let t=new BABYLON.Mesh(this.id,this.app.scene),i=this.app.Resources.resources.find(this.modelId);i.meshes[0].getChildMeshes().forEach(e=>{e=e.createInstance(this.id);e.isPickable=!1,e.enablePointerMoveEvents=!1,e.parent=t}),t.rotation=f.ToVector3(e.rotation),t.position=f.ToVector3(e.position),t.scaling=f.ToVector3(e.scaling);e=f.computeBounds(t);t.setBoundingInfo(e),this.instance=this.app.Resources.BOX.clone(this.id),this.instance.id=this.id,this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.scaling=new BABYLON.Vector3((e.maximum.x-e.minimum.x)*t.scaling.x,(e.maximum.y-e.minimum.y)*t.scaling.y,(e.maximum.z-e.minimum.z)*t.scaling.z),0==this.instance.scaling.y&&(this.instance.scaling.y=.01),this.instance.position=t.position.clone(),this.instance.position.y=(e.maximum.y-e.minimum.y)/2+t.position.y,this.instance.rotation=t.rotation.clone(),t.setParent(this.instance),this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.computeView()}computeView(){this.Sight=new x;var e=this.instance.getBoundingInfo(),t=f.getVisualAngle(e,this.app);this.Sight.alpha=t.alpha,this.Sight.beta=t.beta,this.Sight.focus=this.instance.getAbsolutePosition(),this.Sight.radius=e.boundingSphere.radiusWorld+3,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}optimization(t){this.instance.getChildMeshes().forEach(e=>{t?e.freezeWorldMatrix():e.unfreezeWorldMatrix()}),t?this.instance.freezeWorldMatrix():this.instance.unfreezeWorldMatrix(),this.instance.material&&(t?this.instance.material.freeze():this.instance.material.unfreeze())}alwaysActive(){this.instance.getChildMeshes().forEach(e=>{e.alwaysSelectAsActiveMesh=!0,e.doNotSyncBoundingInfo=!1,e.ignoreNonUniformScaling=!0}),this.instance.alwaysSelectAsActiveMesh=!0,this.instance.doNotSyncBoundingInfo=!1}addEventListener(e,t){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=null;var n;e==v.leftClick||e==v.rightClick?(this.clickEvents.remove(e),this.clickEvents.add(e,t),this.instance.isPickable=!0,i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger,e=>{let t=this.clickEvents.find(v.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(v.rightClick);i&&2==e.sourceEvent.button&&i(this,e),this.touchtime=(new Date).getTime()}),e="click"):e==v.doubleClick?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnDoublePickTrigger,e=>t(this,e)):e==v.eover?(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOverTrigger,e=>t(this,e)),this.instance.enablePointerMoveEvents=!0):e==v.longPress?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnLongPressTrigger,e=>t(this,e)):e==v.out&&(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOutTrigger,e=>t(this,e)),this.instance.enablePointerMoveEvents=!0),i&&(this.action||(this.action=new BABYLON.ActionManager(this.app.scene),this.instance.actionManager=this.action),(n=this.executes.find(e))&&this.action.unregisterAction(n),this.executes.remove(e),this.executes.add(e,i),this.action.registerAction(i)),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}removeEventListener(e){if(e==v.leftClick||e==v.rightClick||e==v.doubleClick){if(this.clickEvents.remove(e),0<this.clickEvents.count())return;e="click"}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;var t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),0==this.executes.count()&&(this.action=null,this.instance.actionManager=this.action),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setFlash(t){this.effectType==B.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(e=>{e.instancedBuffers&&(e.instancedBuffers.color=T.colors[t])}),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=B.Flash)}setOpaque(){this.effectType!=B.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(e=>{e.setEnabled(!0),e.instancedBuffers&&(e.instancedBuffers.color=new BABYLON.Color4(1,1,1,1))}),this.instance.disableEdgesRendering(),this.instance.visibility=0,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=B.Opaque)}setTransparent(e=.3){this.effectType==B.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(e=>e.setEnabled(!1)),this.instance.visibility=e,this.instance.enableEdgesRendering(),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=B.Transparent)}play(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(t=>{let i;t.animations.forEach(e=>{-1!=e.name.indexOf("open")&&(i=e)}),i?this.app.scene.beginDirectAnimation(t,[i],0,10*i.getKeys().length,this.isloop):t.animations.forEach(e=>this.app.scene.beginDirectAnimation(t,[e],0,10*e.getKeys().length,this.isloop))}),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}stop(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(t=>{let i;t.animations.forEach(e=>{-1!=e.name.indexOf("close")&&(i=e)}),i?this.app.scene.beginDirectAnimation(t,[i],0,10*i.getKeys().length,!1):t.animations.forEach(e=>this.app.scene.beginDirectAnimation(t,[e],10*e.getKeys().length,0,!1))}),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}flyTo(){this.app.Camera.translation(this.Sight,500)}focus(){}}class E extends O{constructor(){super(...arguments),this.baseModel=null}bind(e){this.id=r.getGUID(12),this.objectType="Wall",this.name="墙体",this.instance=_.Tools.MergeMeshes(e.walls,this.app),this.instance.setEnabled(!1),this.instance.receiveShadows=!0,e.t&&""!=e.t?(this.modelId=e.t.modelId,this.baseModel=e.t,this.baseModel.length||(this.baseModel.length=3.1),this.nativeMaterial=this.app.Resources.GetMergeMaterial(e.t,this.app.scene)):this.nativeMaterial=null,this.instance.material=this.nativeMaterial,this.instance.id=this.id,this.instance.name=this.id,this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.instance.position.y=this.height,this.alwaysActive(),this.optimization(!0)}}class M extends O{bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.height=e.baseModel.height,this.objectType=e.objectType,this.instance=new BABYLON.Mesh(this.id,this.app.scene);let t=this.app.Resources.resources.find(this.modelId);t.meshes[0].getChildMeshes().forEach(e=>{e.createInstance(this.id).parent=this.instance});var i=f.computeBounds(this.instance);this.instance.rotation=f.ToVector3(e.rotation),this.instance.position=f.ToVector3(e.position),this.Sight=f.getVisualAngle(i,this.app);let n=this.app.Resources.BOX.createInstance(this.id);n.setBoundingInfo(i),n.enablePointerMoveEvents=!1,n.isPickable=!1,n.scaling=new BABYLON.Vector3((i.maximum.x-i.minimum.x)*this.instance.scaling.x,(i.maximum.y-i.minimum.y)*this.instance.scaling.y,(i.maximum.z-i.minimum.z)*this.instance.scaling.z),n.position=this.instance.position.clone(),n.position.y=(i.maximum.y-i.minimum.y)/2+this.instance.position.y,n.rotation=this.instance.rotation.clone(),this.instance.getChildMeshes().forEach(e=>e.setParent(n)),this.instance.dispose(),this.instance=n,this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.computeView()}}class L extends O{bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.height=e.baseModel.height,this.objectType=e.objectType,this.instance=new BABYLON.Mesh(this.id,this.app.scene);let t=this.app.Resources.resources.find(this.modelId);t.meshes[0].getChildMeshes().forEach(e=>{e.createInstance(this.id).parent=this.instance});var i=f.computeBounds(this.instance);this.instance.rotation=f.ToVector3(e.rotation),this.instance.position=f.ToVector3(e.position);let n=this.app.Resources.BOX.createInstance(this.id);n.setBoundingInfo(i),n.enablePointerMoveEvents=!1,n.isPickable=!1,n.scaling=new BABYLON.Vector3((i.maximum.x-i.minimum.x)*this.instance.scaling.x,(i.maximum.y-i.minimum.y)*this.instance.scaling.y,(i.maximum.z-i.minimum.z)*this.instance.scaling.z),n.position=this.instance.position.clone(),n.position.y=(i.maximum.y-i.minimum.y)/2+this.instance.position.y,n.rotation=this.instance.rotation.clone(),this.instance.getChildMeshes().forEach(e=>e.setParent(n)),this.instance.dispose(),this.instance=n,this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.computeView()}}class N extends O{}class C extends O{bind(e){let t=f.ToARRVector3(e.lines);this.Sight.focus=t[0].clone(),this.instance=f.createTube(e.id,t,.02,this.app),this.instance.setEnabled(!1),this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.objectType=e.objectType;e=this.app.Resources.GetMaterial(e.baseModel,this.app.scene).clone(this.id);BABYLON.Animation.CreateAndStartAnimation("u",e.diffuseTexture,"vOffset",15,30,0,1,1),e.diffuseTexture.vScale=this.instance.getTotalVertices()/50,this.instance.material=e,this.alwaysActive(),this.computeView()}computeView(){this.Sight=new x;var e=this.instance.getBoundingInfo(),t=f.getVisualAngle(e,this.app);this.Sight.alpha=t.alpha,this.Sight.beta=t.beta,this.Sight.radius=e.boundingSphere.radiusWorld+3,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}addEventListener(e,t){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=null;var n;e==v.leftClick||e==v.rightClick||e==v.doubleClick?(this.clickEvents.remove(e),this.clickEvents.add(e,t),this.instance.isPickable=!0,i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger,e=>{let t=this.clickEvents.find(v.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(v.rightClick);i&&2==e.sourceEvent.button&&i(this,e);let n=this.clickEvents.find(v.doubleClick);n&&0==e.sourceEvent.button&&(new Date).getTime()-this.touchtime<500&&n(this,e),this.touchtime=(new Date).getTime()}),e="click"):e==v.eover?(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOverTrigger,e=>t(this,e)),this.instance.enablePointerMoveEvents=!0):e==v.longPress?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnLongPressTrigger,e=>t(this,e)):e==v.out&&(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOutTrigger,e=>t(this,e)),this.instance.enablePointerMoveEvents=!0),i&&(this.action||(this.action=new BABYLON.ActionManager(this.app.scene),this.instance.actionManager=this.action),(n=this.executes.find(e))&&this.action.unregisterAction(n),this.executes.remove(e),this.executes.add(e,i),this.action.registerAction(i)),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}removeEventListener(e){if(e==v.leftClick||e==v.rightClick||e==v.doubleClick){if(this.clickEvents.remove(e),0<this.clickEvents.count())return;e="click"}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;var t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),0==this.executes.count()&&(this.action=null,this.instance.actionManager=this.action,this.instance.getChildMeshes().forEach(e=>e.actionManager=this.action)),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class R extends O{async bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.objectType=e.objectType,"Cylinder"==e.virtualType?this.instance=BABYLON.MeshBuilder.CreateCylinder(this.id,{height:1,diameterTop:1,diameterBottom:1},this.app.scene):this.instance=BABYLON.MeshBuilder.CreateBox(this.id,{size:1},this.app.scene),this.instance.setEnabled(!1),this.instance.id=this.id;let t=new BABYLON.StandardMaterial(this.id,this.app.scene);t.diffuseColor=BABYLON.Color3.FromHexString(e.color),e.alpha<.98&&(t.alpha=e.alpha,t.alphaMode=2,t.useAlphaFromDiffuseTexture=!0),this.instance.material=t,e.isEdges&&(this.instance.enableEdgesRendering(),this.instance.edgesWidth=1,this.instance.edgesColor=new BABYLON.Color4(0,1,1,1)),e.edgesWidth&&0<e.edgesWidth&&(this.instance.enableEdgesRendering(),this.instance.edgesWidth=e.edgesWidth,this.instance.edgesColor=BABYLON.Color3.FromHexString(e.edgesColor).toColor4(1)),this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.rotation=_.Tools.ToVector3(e.rotation),this.instance.position=_.Tools.ToVector3(e.position),this.instance.scaling=_.Tools.ToVector3(e.scaling),this.alwaysActive(),this.optimization(!0),this.computeView()}}class P extends O{bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.objectType=e.objectType;let t={};t.color=e.color,e.size?(t.clearColor=null,t.position=_.Tools.ToVector3(e.position),s=_.Tools.ToVector3(e.rotation),t.rotation=new BABYLON.Vector3(s.x+Math.PI,s.y,s.z),i=Number.parseInt(e.size.replace("px",""))/40,s=e.scaling?_.Tools.ToVector3(e.scaling):BABYLON.Vector3.One(),t.scaling=new BABYLON.Vector3(14*i/50*s.x,1,14*i/50*s.z)):(t.clearColor=e.clearColor,t.position=_.Tools.ToVector3(e.position),t.rotation=_.Tools.ToVector3(e.rotation),t.scaling=_.Tools.ToVector3(e.scaling));var i="bold 100px Arial";let n=new BABYLON.DynamicTexture(this.id,64,this.app.scene,!1);var s=n.getContext();s.font=i;e=s.measureText(this.name).width+8,s=.02*e;n=new BABYLON.DynamicTexture(this.id,{width:e,height:150},this.app.scene,!1);e=new BABYLON.StandardMaterial(this.id,this.app.scene);e.backFaceCulling=!1,e.diffuseTexture=n,t.clearColor||(n.hasAlpha=!0),n.drawText(this.name,null,null,i,t.color,t.clearColor,!1),this.instance=BABYLON.Mesh.CreateGround(this.id,s,3,1,this.app.scene),this.instance.setEnabled(!1),this.instance.scaling=t.scaling,this.instance.position=t.position,this.instance.rotation=t.rotation,this.instance.material=e,this.alwaysActive(),this.optimization(!0),this.computeView()}}class S extends O{bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.objectType=e.objectType,this.color=e.color,this.instance=new BABYLON.Mesh(this.id);var t=f.ToARRVector3(e.pints);let i=f.createTube(e.id,t,e.radius,this.app);this.instance.position=i.getBoundingInfo().boundingBox.center.clone(),this.instance.addChild(i),e.rotation&&(this.instance.rotation=f.ToVector3(e.rotation)),e.position&&(this.instance.position=f.ToVector3(e.position)),i.setParent(this.instance.parent),this.instance.dispose(),this.instance=i;let n=new BABYLON.StandardMaterial(e.id,this.app.scene);n.diffuseColor=BABYLON.Color3.FromHexString(e.color),n.alpha=e.alpha,this.alpha=e.alpha,this.instance.material=n,this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.setEnabled(!1),this.alwaysActive(),this.optimization(!0),this.computeView()}setColor(e,t,i){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.diffuseColor=new BABYLON.Color3(e/255,i/255,t/255),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}reColor(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.diffuseColor=BABYLON.Color3.FromHexString(this.color),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}computeView(){this.Sight=new x;var e=this.instance.getBoundingInfo(),e=f.getVisualAngle(e,this.app);this.alpha=e.alpha,this.Sight.beta=e.beta,this.Sight.focus=e.focus,this.Sight.radius=e.radius,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}setFlash(e=1){this.effectType==B.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.emissiveColor=T.colors[e],this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=B.Flash)}setOpaque(){this.effectType!=B.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!0),this.instance.material.alpha=this.alpha,this.instance.material.emissiveColor=null,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=B.Opaque)}setTransparent(e=.3){this.effectType==B.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.alpha=e,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=B.Transparent)}}class I extends O{bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.objectType=e.objectType,this.instance=BABYLON.MeshBuilder.CreatePolygon("地板",{shape:f.Expand(e.vectors,-.01),holes:e.buckles,sideOrientation:BABYLON.Mesh.DOUBLESIDE},this.app.scene),this.alwaysActive(),this.instance.setEnabled(!1),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.instance.position.y=this.height-.01,this.instance.id=e.id,this.instance.name="地板";var t=this.app.Resources.GetMaterial(e.baseModel,this.app.scene).clone(e.id),i=this.instance.getBoundingInfo();this.Sight=f.getVisualAngle(i,this.app),e.baseModel.isTiling&&(t.diffuseTexture.uScale=(i.maximum.x-i.minimum.x)/e.baseModel.width,t.diffuseTexture.vScale=(i.maximum.z-i.minimum.z)/e.baseModel.length),this.instance.material=t,this.optimization(!0),this.computeView()}}class k extends O{bind(e){this.id=e.id,this.parentId=e.parentId,this.objectType="Wall",this.instance=this.app.Resources.walls.find(e.id),this.instance&&(this.app.scene.addMesh(this.instance),this.app.Resources.walls.remove(e.id),e.baseModel?(this.modelId=e.baseModel.modelId,this.nativeMaterial=this.app.Resources.GetMergeMaterial(e.baseModel,this.app.scene)):this.nativeMaterial=null,this.instance.material=this.nativeMaterial,this.instance.id=this.id,this.instance.name=this.id,this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.computeView())}}class Y extends O{bind(i){let e=!1;this.id=r.getGUID(12),this.name="墙角",this.objectType="Corner";let n=new Array;for(let t=0;t<i.length;t++)if(2<i[t].pints.length){let e=BABYLON.MeshBuilder.CreatePolygon(this.id,{shape:i[t].pints,sideOrientation:BABYLON.Mesh.FRONTSIDE},this.app.scene);e.setEnabled(!1),e.position.y=i[t].height,e.isPickable=!0,e.enablePointerMoveEvents=!1,n.push(e)}return n.length<1||(1<n.length?this.instance=f.MergeMeshes(n,this.app):this.instance=n[0],this.instance.id=this.id,this.instance.name=this.id,this.instance.position.y=this.height,this.instance.setEnabled(!1),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.alwaysActive(),this.optimization(!0),e=!0),e}}class D extends O{constructor(e,t){super(e),this.height=0,this.id=t.id,this.objectType=t.objectType,this.customNumber=t.customNumber,this.customType=t.customType,this.name=t.name,this.parentId=t.parentId,this.height=t.height,this.index=t.index}bind(s,e=0){let t=!1;for(let e=0;e<s.length;e++){var i=s[e];if(i.objectType==g.optimizedWall){t=!0;let e=new k(this.app);e.bind(i),e.instance&&this.app.Project.objectDatas.add(e.id,e)}}let o=new Array;for(let t=0;t<s.length;t++){let e=s[t];e.objectType==g.Wall&&(e.height||(e.height=3.1),e.ply||(e.ply=.09),o.push(e))}let r=new m;for(let e=0;e<s.length;e++){let i=s[e];i.objectType==g.Corner&&(r.add(i.id,i.corner),2<i.pints.length&&(i.height=3.1,i.walls.forEach(t=>{o.forEach(e=>{t==e.id&&parseFloat(e.height)<i.height&&(i.height=parseFloat(e.height))})})))}if(!t){let t=new Array;for(let e=0;e<s.length;e++){var n=s[e];n.objectType==g.Corner&&t.push(n)}let e=new Y(this.app);e.height=this.height,e.bind(t)?(e.parentId=this.id,this.app.Project.objectDatas.add(e.id,e)):e=null}for(let i=0;i<s.length;i++){let n=s[i];if(n.objectType==g.Floor){n.vectors=new Array;let e=s[i];e.pints.forEach(e=>{r.find(e)||console.log(e),n.vectors.push(r.find(e))}),n.buckles=new Array,e.holes&&e.holes.forEach(e=>{let t=new Array;e.forEach(e=>t.push(r.find(e))),n.buckles.push(t)}),e.middles&&e.middles.forEach(t=>{let i=Array();for(let e=0;e<s.length;e++)s[e].id==t&&s[e].pints.forEach(e=>{e=r.find(e);i.push(new BABYLON.Vector3(e.x,0,e.z))});n.buckles.push(i)});let t=new I(this.app);t.height=this.height,t.bind(n),this.app.Project.objectDatas.add(t.id,t)}}r=null;for(let t=0;t<s.length;t++){var a=s[t];let e;if(a.objectType==g.Window)e=new M(this.app);else if(a.objectType==g.Door)e=new L(this.app);else if(a.objectType==g.Cabinet)e=new N(this.app);else if(a.objectType==g.LeakWater)e=new C(this.app);else if(a.objectType==g.VirtualBox)e=new R(this.app);else if(a.objectType==g.UI3D)e=new P(this.app);else if(a.objectType==g.Conduit)e=new S(this.app);else{if(a.objectType==g.Wall||a.objectType==g.optimizedWall)continue;if(a.objectType==g.Corner)continue;if(a.objectType==g.Floor)continue;e=new O(this.app)}e.bind(a),this.app.Project.objectDatas.add(e.id,e)}if(!t){let r=new m;r.add("body",{t:"",walls:new Array});for(let s=0;s<o.length;s++){let n=BABYLON.MeshBuilder.ExtrudePolygon(o[s].id,{shape:[f.ToVector3(o[s].wtop),f.ToVector3(o[s].wleft),f.ToVector3(o[s].wbottom),f.ToVector3(o[s].wright)],depth:parseFloat(o[s].height),sideOrientation:BABYLON.Mesh.FRONTSIDE},this.app.scene);n.setEnabled(!1),n.position.y=parseFloat(o[s].height),n.subMeshes=[];var h=n.getTotalVertices();n.subMeshes.push(new BABYLON.SubMesh(0,0,h,0,6,n)),n.subMeshes.push(new BABYLON.SubMesh(0,1,h,18,6,n)),n.subMeshes.push(new BABYLON.SubMesh(0,2,h,30,6,n));for(let i=0;i<o[s].wallwindows.length;i++){const p=BABYLON.CSG.FromMesh(n);let e=this.app.Project.objectDatas.find(o[s].wallwindows[i]);var c=e.instance.getBoundingInfo(),l=BABYLON.MeshBuilder.CreateBox((new Date).getTime().toString(),{height:c.maximum.y-c.minimum.y,width:c.maximum.x-c.minimum.x,depth:2*parseFloat(o[s].ply)+.1},this.app.scene);l.position=e.instance.position.clone(),l.position.y=(c.maximum.y-c.minimum.y)/2+e.height,l.rotation=e.instance.rotation.clone();c=BABYLON.CSG.FromMesh(l);let t=p.subtract(c);l.dispose(),n.dispose(),n=t.toMesh(o[s].id,null,this.app.scene,!0),n.setEnabled(!1)}let t=r.find(o[s].leftMap.modelId);t||(t={t:o[s].leftMap,walls:new Array},r.add(o[s].leftMap.modelId,t));let i=r.find(o[s].rightMap.modelId);i||(i={t:o[s].rightMap,walls:new Array},r.add(o[s].rightMap.modelId,i));var u=f.DeconsTructMesh(n,parseFloat(o[s].height),this.app);for(let e=0;e<u.length;e++)(2==e||3==e?t:4==e||5==e?i:r.find("body")).walls.push(u[e])}for(const d in r.map)if(0<r.find(d).walls.length){let e=new E(this.app);e.parentId=this.id,e.height=this.height,e.bind(r.find(d)),this.app.Project.objectDatas.add(e.id,e)}}o=null,this.computeView()}computeView(){this.Sight=new x;var e=this.getBounding(),e=f.getVisualAngle(e,this.app);this.Sight.alpha=e.alpha,this.Sight.beta=e.beta,this.Sight.focus=e.focus,this.Sight.radius=e.radius,this.Sight.focus.y=this.height}flyTo(){this.app.Camera.flyTo(this.Sight,500)}focus(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;for(const t in this.app.Project.objectDatas.map){let e=this.app.Project.objectDatas.find(t);e.setEnabled(!0)}(this.app.Project.current=this).app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setEnabled(e){}getBounding(){var i,n;for(const e in this.app.Project.objectDatas.map){let t=this.app.Project.objectDatas.find(e);if(t.objectType!=g.Region){let e=t.instance.getBoundingInfo();i&&n||(i=n=e.boundingBox.center.clone()),i=BABYLON.Vector3.Minimize(i,e.minimum.add(t.instance.position)),n=BABYLON.Vector3.Maximize(n,e.maximum.add(t.instance.position))}}return i&&n||(i=BABYLON.Vector3.Zero(),n=new BABYLON.Vector3(12,this.height,8)),new BABYLON.BoundingInfo(i,n)}dispose(){}}class _{}_.sl="https://www.wodashijie.com/",_.rl="https://models.wodashijie.com/",_.App=class{constructor(e){e.sl&&(_.sl=e.sl),e.rl&&(_.rl=e.rl),w.defaults.baseURL=_.sl,this.canvas=document.createElement("canvas"),this.canvas.style.cssText="width: 100%;height: 100%;background-color: transparent;outline-width: 0;-webkit-tap-highlight-color:transparent;",e.container.appendChild(this.canvas),this.engine=new BABYLON.Engine(this.canvas,!0,{premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0}),this.engine.setHardwareScalingLevel(.5),this.engine.enableOfflineSupport=!1,this.scene=new BABYLON.Scene(this.engine,{useGeometryUniqueIdsMap:!0,useClonedMeshMap:!0,useMaterialMeshMap:!0}),this.scene.useOrderIndependentTransparency=!0,this.scene.useRightHandedSystem=!0,this.scene.getBoundingBoxRenderer().frontColor=BABYLON.Color3.Green(),this.scene.getBoundingBoxRenderer().showBackLines=!1,this.Camera=new n(this),this.HighlightLayer=new BABYLON.HighlightLayer("highlightLayer",this.scene),this.container=BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("screenUI"),this.Environment=new d(this),this.Environment.defaultLights(),this.Environment.openAllLight(),this.Resources=new A(this),this.Project=new b(this),_.EffectMgr.init(),this.engine.runRenderLoop(()=>{this.fps&&(this.fps.innerText=this.engine.getFps().toFixed()+" fps"),this.scene.render(),p.a.update()}),window.addEventListener("resize",()=>{this.engine.resize()}),this.scene.onPointerObservable.add(e=>{switch(e.type){case BABYLON.PointerEventTypes.POINTERMOVE:if(!this.ToolTips)return;e.pickInfo&&e.pickInfo.pickedPoint?this.ToolTips.update(e):this.ToolTips.close();break;case BABYLON.PointerEventTypes.POINTERWHEEL:var t;this.Camera.isOverLook?this.Camera._wheel(e.event):(t=1e3/(this.Camera.camera.radius/20),this.Camera.camera.panningSensibility=2e3<t?2e3:t<10?10:t),e.event.preventDefault()}}),this.scene.onKeyboardObservable.add(e=>{e.type===BABYLON.KeyboardEventTypes.KEYDOWN&&70===e.event.keyCode&&prompt("请复制输入框内的视角参数",JSON.stringify({alpha:this.Camera.camera.alpha,focus:f.vector3ToJson(this.Camera.camera.target),radius:this.Camera.camera.radius,beta:this.Camera.camera.beta,minimumLimit:this.Camera.camera.lowerRadiusLimit,maximumLimit:this.Camera.camera.upperRadiusLimit,minBeta:this.Camera.camera.lowerBetaLimit,maxBeta:this.Camera.camera.upperBetaLimit}))})}async load(u={pk:null,isDefaultLevel:!0,progress:null,complete:null}){_.pk=u.pk;var e=await w.get(`api/Account/Developer?accessToken=${encodeURIComponent(_.accessToken)}`);if(200==e.status){localStorage.setItem("mx3d-token",e.data);e=await w.get(`api/WorkFiles/GetProject?pk=${_.pk}`);if(200==e.status){let l=e.data;return new Promise(async(n,t)=>{try{this.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let t=new m;for(let e=0;e<l.length;e++){const a=l[e];!a.baseModel||".gltf"!=a.baseModel.extension||t.find(a.baseModel.modelId)||this.Resources.resources.find(a.baseModel.modelId)||(a.baseModel.objectType=a.objectType,t.add(a.baseModel.modelId,a.baseModel))}let e=0;for(const h in t.map)await this.Resources.loadModelMesh(t.find(h)),e++,u&&u.progress&&u.progress(e/t.count()*.3);e=0,t=null;let i=new m;for(let e=0;e<l.length;e++){var s,r=l[e];r.objectType==g.Region&&(s=new D(this,r),this.Project.objectDatas.add(s.id,s),i.add(s.id,new Array),"0"==s.parentId&&(this.Project.root=s))}for(let e=0;e<l.length;e++){var o=l[e];if(o.objectType!=g.Region){let e=i.find(o.parentId);e.push(o)}}for(const c in i.map)await this.Project.objectDatas.find(c).bind(i.find(c)),e++,u&&u.progress&&u.progress(.3+e/i.count()*.7);i=null,this.Project.optimization(),u.isDefaultLevel&&this.Project.switchLevel(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1,n(null),this.engine.resize(),u&&u.complete&&u.complete()}catch(e){t(e)}})}}}dispose(){this.Environment.hideFps(),this.Project.clear(),this.Resources.delete(),this.engine.dispose()}},_.Tools=f,_.EffectMgr=T,_.IconFromMesh=class{constructor(e,t,i,n,s,r){this.id=e,this.scene=r,this.url=i,this.scaling=n,this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance=BABYLON.Mesh.CreatePlane(this.id,n,this.scene,!0,BABYLON.Mesh.DOUBLESIDE),this.instance.alwaysSelectAsActiveMesh=!0,this.instance.position=t.clone(),this.instance.position.y+=s,this.instance.billboardMode=BABYLON.Mesh.BILLBOARDMODE_Y;let o=new BABYLON.StandardMaterial("Mat_"+this.id,this.scene);o.diffuseColor=BABYLON.Color3.White(),o.emissiveColor=BABYLON.Color3.White(),this.instance.material=o,this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setBackground(){let i=new Image;i.src=this.url,i.onload=()=>{this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.scaling.y=this.scaling/(i.width/i.height)/this.scaling;let e=new BABYLON.DynamicTexture(this.id,{width:i.width,height:i.height},this.scene,!1);e.hasAlpha=!0,this.instance.material.diffuseTexture=e;let t=e.getContext();t.drawImage(i,0,0),e.update(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}addEventListener(t){if(this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.actionManager&&this.instance.actionManager.dispose(),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,t){this.instance.isPickable=!0,this.instance.enablePointerMoveEvents=!0;let e=new BABYLON.ActionManager(this.scene);e.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger,e=>t(this.id))),this.instance.actionManager=e}this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setColor(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.material.diffuseColor=BABYLON.Color3.FromHexString(e),this.instance.material.emissiveColor=BABYLON.Color3.FromHexString(e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setContents(i){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let n=new Image;n.src=this.url,n.onload=()=>{this.instance.scaling.y=this.scaling/(n.width/n.height)/this.scaling;let t=new BABYLON.DynamicTexture(this.id,{width:n.width,height:n.height},this.scene,!1);t.hasAlpha=!0,this.instance.material.diffuseTexture=t;let e=t.getContext();e.drawImage(n,0,0),i.forEach(e=>t.drawText(e.text,e.left,e.top,"bold "+e.fontSize+" monospace",e.color||"#fffffb","",!0,!0)),t.update(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}dispose(){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.dispose(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}},_.Icon=class{constructor(e,t){this.textDics=new Array,this.id=e,this.scene=t}set background(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this._background&&this._background.dispose(),this._background=new BABYLON.GUI.Image(r.getGUID(12)+"_Image",e),this._background.width=this.size.width+"px",this._background.height=this.size.height+"px",this.rect.addControl(this._background),this.onPointerClick&&(this._background.isPointerBlocker=!1,this._background.onPointerClickObservable.add(()=>{this.onPointerClick()})),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setTexts(i){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.textDics.forEach(e=>e.dispose());for(let t=this.textDics.length=0;t<i.length;t++){let e=new BABYLON.GUI.TextBlock;e.text=i[t].text,e.fontSize=i[t].fontSize||"20px",e.color=i[t].color||"white",e.top=i[t].top||0,e.left=i[t].left||0,this.rect.addControl(e),this.textDics.push(e)}this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}line(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this._line&&this._line.dispose(),this._line=new BABYLON.GUI.Line,this._line.lineWidth=e.width||1.5,this._line.color=e.color||"green",this._line.y2=this.size.height/2,this.container.addControl(this._line),this._line.linkWithMesh(this.pint),this._line.connectedControl=this.rect,this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}dispose(){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.rect&&this.rect.dispose(),this._line&&this._line.dispose(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.rect&&(this.rect.isVisible=e),this._line&&(this._line.isVisible=e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}},_.EffectType=B}],l={},h.m=c,h.c=l,h.d=function(e,t,i){h.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},h.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},h.t=function(t,e){if(1&e&&(t=h(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(h.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)h.d(i,n,function(e){return t[e]}.bind(null,n));return i},h.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return h.d(t,"a",t),t},h.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},h.p="",h(h.s=44).default;function h(e){if(l[e])return l[e].exports;var t=l[e]={i:e,l:!1,exports:{}};return c[e].call(t.exports,t,t.exports,h),t.l=!0,t.exports}var c,l});
|