@eva/plugin-renderer 1.1.1-fix.0 → 1.1.1-fix.1

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.
@@ -1,2968 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@eva/eva.js'), require('@eva/renderer-adapter'), require('pixi.js')) :
3
- typeof define === 'function' && define.amd ? define(['exports', '@eva/eva.js', '@eva/renderer-adapter', 'pixi.js'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.EVA = global.EVA || {}, global.EVA.plugin = global.EVA.plugin || {}, global.EVA.plugin.renderer = {}), global.EVA, global.EVA.rendererAdapter, global.PIXI));
5
- }(this, (function (exports, eva_js, rendererAdapter, pixi_js) { 'use strict';
6
-
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation.
9
-
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise */
22
-
23
- var extendStatics = function(d, b) {
24
- extendStatics = Object.setPrototypeOf ||
25
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
27
- return extendStatics(d, b);
28
- };
29
-
30
- function __extends(d, b) {
31
- extendStatics(d, b);
32
- function __() { this.constructor = d; }
33
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
- }
35
-
36
- var __assign = function() {
37
- __assign = Object.assign || function __assign(t) {
38
- for (var s, i = 1, n = arguments.length; i < n; i++) {
39
- s = arguments[i];
40
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
41
- }
42
- return t;
43
- };
44
- return __assign.apply(this, arguments);
45
- };
46
-
47
- function __decorate(decorators, target, key, desc) {
48
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
49
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
50
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
51
- return c > 3 && r && Object.defineProperty(target, key, r), r;
52
- }
53
-
54
- function __values(o) {
55
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
56
- if (m) return m.call(o);
57
- if (o && typeof o.length === "number") return {
58
- next: function () {
59
- if (o && i >= o.length) o = void 0;
60
- return { value: o && o[i++], done: !o };
61
- }
62
- };
63
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
64
- }
65
-
66
- function __read(o, n) {
67
- var m = typeof Symbol === "function" && o[Symbol.iterator];
68
- if (!m) return o;
69
- var i = m.call(o), r, ar = [], e;
70
- try {
71
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
72
- }
73
- catch (error) { e = { error: error }; }
74
- finally {
75
- try {
76
- if (r && !r.done && (m = i["return"])) m.call(i);
77
- }
78
- finally { if (e) throw e.error; }
79
- }
80
- return ar;
81
- }
82
-
83
- function __spread() {
84
- for (var ar = [], i = 0; i < arguments.length; i++)
85
- ar = ar.concat(__read(arguments[i]));
86
- return ar;
87
- }
88
-
89
- /**
90
- * Removes all key-value entries from the list cache.
91
- *
92
- * @private
93
- * @name clear
94
- * @memberOf ListCache
95
- */
96
- function listCacheClear() {
97
- this.__data__ = [];
98
- this.size = 0;
99
- }
100
-
101
- /**
102
- * Performs a
103
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
104
- * comparison between two values to determine if they are equivalent.
105
- *
106
- * @static
107
- * @memberOf _
108
- * @since 4.0.0
109
- * @category Lang
110
- * @param {*} value The value to compare.
111
- * @param {*} other The other value to compare.
112
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
113
- * @example
114
- *
115
- * var object = { 'a': 1 };
116
- * var other = { 'a': 1 };
117
- *
118
- * _.eq(object, object);
119
- * // => true
120
- *
121
- * _.eq(object, other);
122
- * // => false
123
- *
124
- * _.eq('a', 'a');
125
- * // => true
126
- *
127
- * _.eq('a', Object('a'));
128
- * // => false
129
- *
130
- * _.eq(NaN, NaN);
131
- * // => true
132
- */
133
- function eq(value, other) {
134
- return value === other || (value !== value && other !== other);
135
- }
136
-
137
- /**
138
- * Gets the index at which the `key` is found in `array` of key-value pairs.
139
- *
140
- * @private
141
- * @param {Array} array The array to inspect.
142
- * @param {*} key The key to search for.
143
- * @returns {number} Returns the index of the matched value, else `-1`.
144
- */
145
- function assocIndexOf(array, key) {
146
- var length = array.length;
147
- while (length--) {
148
- if (eq(array[length][0], key)) {
149
- return length;
150
- }
151
- }
152
- return -1;
153
- }
154
-
155
- /** Used for built-in method references. */
156
- var arrayProto = Array.prototype;
157
-
158
- /** Built-in value references. */
159
- var splice = arrayProto.splice;
160
-
161
- /**
162
- * Removes `key` and its value from the list cache.
163
- *
164
- * @private
165
- * @name delete
166
- * @memberOf ListCache
167
- * @param {string} key The key of the value to remove.
168
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
169
- */
170
- function listCacheDelete(key) {
171
- var data = this.__data__,
172
- index = assocIndexOf(data, key);
173
-
174
- if (index < 0) {
175
- return false;
176
- }
177
- var lastIndex = data.length - 1;
178
- if (index == lastIndex) {
179
- data.pop();
180
- } else {
181
- splice.call(data, index, 1);
182
- }
183
- --this.size;
184
- return true;
185
- }
186
-
187
- /**
188
- * Gets the list cache value for `key`.
189
- *
190
- * @private
191
- * @name get
192
- * @memberOf ListCache
193
- * @param {string} key The key of the value to get.
194
- * @returns {*} Returns the entry value.
195
- */
196
- function listCacheGet(key) {
197
- var data = this.__data__,
198
- index = assocIndexOf(data, key);
199
-
200
- return index < 0 ? undefined : data[index][1];
201
- }
202
-
203
- /**
204
- * Checks if a list cache value for `key` exists.
205
- *
206
- * @private
207
- * @name has
208
- * @memberOf ListCache
209
- * @param {string} key The key of the entry to check.
210
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
211
- */
212
- function listCacheHas(key) {
213
- return assocIndexOf(this.__data__, key) > -1;
214
- }
215
-
216
- /**
217
- * Sets the list cache `key` to `value`.
218
- *
219
- * @private
220
- * @name set
221
- * @memberOf ListCache
222
- * @param {string} key The key of the value to set.
223
- * @param {*} value The value to set.
224
- * @returns {Object} Returns the list cache instance.
225
- */
226
- function listCacheSet(key, value) {
227
- var data = this.__data__,
228
- index = assocIndexOf(data, key);
229
-
230
- if (index < 0) {
231
- ++this.size;
232
- data.push([key, value]);
233
- } else {
234
- data[index][1] = value;
235
- }
236
- return this;
237
- }
238
-
239
- /**
240
- * Creates an list cache object.
241
- *
242
- * @private
243
- * @constructor
244
- * @param {Array} [entries] The key-value pairs to cache.
245
- */
246
- function ListCache(entries) {
247
- var index = -1,
248
- length = entries == null ? 0 : entries.length;
249
-
250
- this.clear();
251
- while (++index < length) {
252
- var entry = entries[index];
253
- this.set(entry[0], entry[1]);
254
- }
255
- }
256
-
257
- // Add methods to `ListCache`.
258
- ListCache.prototype.clear = listCacheClear;
259
- ListCache.prototype['delete'] = listCacheDelete;
260
- ListCache.prototype.get = listCacheGet;
261
- ListCache.prototype.has = listCacheHas;
262
- ListCache.prototype.set = listCacheSet;
263
-
264
- /**
265
- * Removes all key-value entries from the stack.
266
- *
267
- * @private
268
- * @name clear
269
- * @memberOf Stack
270
- */
271
- function stackClear() {
272
- this.__data__ = new ListCache;
273
- this.size = 0;
274
- }
275
-
276
- /**
277
- * Removes `key` and its value from the stack.
278
- *
279
- * @private
280
- * @name delete
281
- * @memberOf Stack
282
- * @param {string} key The key of the value to remove.
283
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
284
- */
285
- function stackDelete(key) {
286
- var data = this.__data__,
287
- result = data['delete'](key);
288
-
289
- this.size = data.size;
290
- return result;
291
- }
292
-
293
- /**
294
- * Gets the stack value for `key`.
295
- *
296
- * @private
297
- * @name get
298
- * @memberOf Stack
299
- * @param {string} key The key of the value to get.
300
- * @returns {*} Returns the entry value.
301
- */
302
- function stackGet(key) {
303
- return this.__data__.get(key);
304
- }
305
-
306
- /**
307
- * Checks if a stack value for `key` exists.
308
- *
309
- * @private
310
- * @name has
311
- * @memberOf Stack
312
- * @param {string} key The key of the entry to check.
313
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
314
- */
315
- function stackHas(key) {
316
- return this.__data__.has(key);
317
- }
318
-
319
- /** Detect free variable `global` from Node.js. */
320
- var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
321
-
322
- var freeGlobal$1 = freeGlobal;
323
-
324
- /** Detect free variable `self`. */
325
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
326
-
327
- /** Used as a reference to the global object. */
328
- var root = freeGlobal$1 || freeSelf || Function('return this')();
329
-
330
- var root$1 = root;
331
-
332
- /** Built-in value references. */
333
- var Symbol$1 = root$1.Symbol;
334
-
335
- var Symbol$2 = Symbol$1;
336
-
337
- /** Used for built-in method references. */
338
- var objectProto$b = Object.prototype;
339
-
340
- /** Used to check objects for own properties. */
341
- var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
342
-
343
- /**
344
- * Used to resolve the
345
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
346
- * of values.
347
- */
348
- var nativeObjectToString$1 = objectProto$b.toString;
349
-
350
- /** Built-in value references. */
351
- var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : undefined;
352
-
353
- /**
354
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
355
- *
356
- * @private
357
- * @param {*} value The value to query.
358
- * @returns {string} Returns the raw `toStringTag`.
359
- */
360
- function getRawTag(value) {
361
- var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
362
- tag = value[symToStringTag$1];
363
-
364
- try {
365
- value[symToStringTag$1] = undefined;
366
- var unmasked = true;
367
- } catch (e) {}
368
-
369
- var result = nativeObjectToString$1.call(value);
370
- if (unmasked) {
371
- if (isOwn) {
372
- value[symToStringTag$1] = tag;
373
- } else {
374
- delete value[symToStringTag$1];
375
- }
376
- }
377
- return result;
378
- }
379
-
380
- /** Used for built-in method references. */
381
- var objectProto$a = Object.prototype;
382
-
383
- /**
384
- * Used to resolve the
385
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
386
- * of values.
387
- */
388
- var nativeObjectToString = objectProto$a.toString;
389
-
390
- /**
391
- * Converts `value` to a string using `Object.prototype.toString`.
392
- *
393
- * @private
394
- * @param {*} value The value to convert.
395
- * @returns {string} Returns the converted string.
396
- */
397
- function objectToString(value) {
398
- return nativeObjectToString.call(value);
399
- }
400
-
401
- /** `Object#toString` result references. */
402
- var nullTag = '[object Null]',
403
- undefinedTag = '[object Undefined]';
404
-
405
- /** Built-in value references. */
406
- var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : undefined;
407
-
408
- /**
409
- * The base implementation of `getTag` without fallbacks for buggy environments.
410
- *
411
- * @private
412
- * @param {*} value The value to query.
413
- * @returns {string} Returns the `toStringTag`.
414
- */
415
- function baseGetTag(value) {
416
- if (value == null) {
417
- return value === undefined ? undefinedTag : nullTag;
418
- }
419
- return (symToStringTag && symToStringTag in Object(value))
420
- ? getRawTag(value)
421
- : objectToString(value);
422
- }
423
-
424
- /**
425
- * Checks if `value` is the
426
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
427
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
428
- *
429
- * @static
430
- * @memberOf _
431
- * @since 0.1.0
432
- * @category Lang
433
- * @param {*} value The value to check.
434
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
435
- * @example
436
- *
437
- * _.isObject({});
438
- * // => true
439
- *
440
- * _.isObject([1, 2, 3]);
441
- * // => true
442
- *
443
- * _.isObject(_.noop);
444
- * // => true
445
- *
446
- * _.isObject(null);
447
- * // => false
448
- */
449
- function isObject(value) {
450
- var type = typeof value;
451
- return value != null && (type == 'object' || type == 'function');
452
- }
453
-
454
- /** `Object#toString` result references. */
455
- var asyncTag = '[object AsyncFunction]',
456
- funcTag$1 = '[object Function]',
457
- genTag = '[object GeneratorFunction]',
458
- proxyTag = '[object Proxy]';
459
-
460
- /**
461
- * Checks if `value` is classified as a `Function` object.
462
- *
463
- * @static
464
- * @memberOf _
465
- * @since 0.1.0
466
- * @category Lang
467
- * @param {*} value The value to check.
468
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
469
- * @example
470
- *
471
- * _.isFunction(_);
472
- * // => true
473
- *
474
- * _.isFunction(/abc/);
475
- * // => false
476
- */
477
- function isFunction(value) {
478
- if (!isObject(value)) {
479
- return false;
480
- }
481
- // The use of `Object#toString` avoids issues with the `typeof` operator
482
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
483
- var tag = baseGetTag(value);
484
- return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
485
- }
486
-
487
- /** Used to detect overreaching core-js shims. */
488
- var coreJsData = root$1['__core-js_shared__'];
489
-
490
- var coreJsData$1 = coreJsData;
491
-
492
- /** Used to detect methods masquerading as native. */
493
- var maskSrcKey = (function() {
494
- var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || '');
495
- return uid ? ('Symbol(src)_1.' + uid) : '';
496
- }());
497
-
498
- /**
499
- * Checks if `func` has its source masked.
500
- *
501
- * @private
502
- * @param {Function} func The function to check.
503
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
504
- */
505
- function isMasked(func) {
506
- return !!maskSrcKey && (maskSrcKey in func);
507
- }
508
-
509
- /** Used for built-in method references. */
510
- var funcProto$1 = Function.prototype;
511
-
512
- /** Used to resolve the decompiled source of functions. */
513
- var funcToString$1 = funcProto$1.toString;
514
-
515
- /**
516
- * Converts `func` to its source code.
517
- *
518
- * @private
519
- * @param {Function} func The function to convert.
520
- * @returns {string} Returns the source code.
521
- */
522
- function toSource(func) {
523
- if (func != null) {
524
- try {
525
- return funcToString$1.call(func);
526
- } catch (e) {}
527
- try {
528
- return (func + '');
529
- } catch (e) {}
530
- }
531
- return '';
532
- }
533
-
534
- /**
535
- * Used to match `RegExp`
536
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
537
- */
538
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
539
-
540
- /** Used to detect host constructors (Safari). */
541
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
542
-
543
- /** Used for built-in method references. */
544
- var funcProto = Function.prototype,
545
- objectProto$9 = Object.prototype;
546
-
547
- /** Used to resolve the decompiled source of functions. */
548
- var funcToString = funcProto.toString;
549
-
550
- /** Used to check objects for own properties. */
551
- var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
552
-
553
- /** Used to detect if a method is native. */
554
- var reIsNative = RegExp('^' +
555
- funcToString.call(hasOwnProperty$7).replace(reRegExpChar, '\\$&')
556
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
557
- );
558
-
559
- /**
560
- * The base implementation of `_.isNative` without bad shim checks.
561
- *
562
- * @private
563
- * @param {*} value The value to check.
564
- * @returns {boolean} Returns `true` if `value` is a native function,
565
- * else `false`.
566
- */
567
- function baseIsNative(value) {
568
- if (!isObject(value) || isMasked(value)) {
569
- return false;
570
- }
571
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
572
- return pattern.test(toSource(value));
573
- }
574
-
575
- /**
576
- * Gets the value at `key` of `object`.
577
- *
578
- * @private
579
- * @param {Object} [object] The object to query.
580
- * @param {string} key The key of the property to get.
581
- * @returns {*} Returns the property value.
582
- */
583
- function getValue(object, key) {
584
- return object == null ? undefined : object[key];
585
- }
586
-
587
- /**
588
- * Gets the native function at `key` of `object`.
589
- *
590
- * @private
591
- * @param {Object} object The object to query.
592
- * @param {string} key The key of the method to get.
593
- * @returns {*} Returns the function if it's native, else `undefined`.
594
- */
595
- function getNative(object, key) {
596
- var value = getValue(object, key);
597
- return baseIsNative(value) ? value : undefined;
598
- }
599
-
600
- /* Built-in method references that are verified to be native. */
601
- var Map = getNative(root$1, 'Map');
602
-
603
- var Map$1 = Map;
604
-
605
- /* Built-in method references that are verified to be native. */
606
- var nativeCreate = getNative(Object, 'create');
607
-
608
- var nativeCreate$1 = nativeCreate;
609
-
610
- /**
611
- * Removes all key-value entries from the hash.
612
- *
613
- * @private
614
- * @name clear
615
- * @memberOf Hash
616
- */
617
- function hashClear() {
618
- this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {};
619
- this.size = 0;
620
- }
621
-
622
- /**
623
- * Removes `key` and its value from the hash.
624
- *
625
- * @private
626
- * @name delete
627
- * @memberOf Hash
628
- * @param {Object} hash The hash to modify.
629
- * @param {string} key The key of the value to remove.
630
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
631
- */
632
- function hashDelete(key) {
633
- var result = this.has(key) && delete this.__data__[key];
634
- this.size -= result ? 1 : 0;
635
- return result;
636
- }
637
-
638
- /** Used to stand-in for `undefined` hash values. */
639
- var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
640
-
641
- /** Used for built-in method references. */
642
- var objectProto$8 = Object.prototype;
643
-
644
- /** Used to check objects for own properties. */
645
- var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
646
-
647
- /**
648
- * Gets the hash value for `key`.
649
- *
650
- * @private
651
- * @name get
652
- * @memberOf Hash
653
- * @param {string} key The key of the value to get.
654
- * @returns {*} Returns the entry value.
655
- */
656
- function hashGet(key) {
657
- var data = this.__data__;
658
- if (nativeCreate$1) {
659
- var result = data[key];
660
- return result === HASH_UNDEFINED$2 ? undefined : result;
661
- }
662
- return hasOwnProperty$6.call(data, key) ? data[key] : undefined;
663
- }
664
-
665
- /** Used for built-in method references. */
666
- var objectProto$7 = Object.prototype;
667
-
668
- /** Used to check objects for own properties. */
669
- var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
670
-
671
- /**
672
- * Checks if a hash value for `key` exists.
673
- *
674
- * @private
675
- * @name has
676
- * @memberOf Hash
677
- * @param {string} key The key of the entry to check.
678
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
679
- */
680
- function hashHas(key) {
681
- var data = this.__data__;
682
- return nativeCreate$1 ? (data[key] !== undefined) : hasOwnProperty$5.call(data, key);
683
- }
684
-
685
- /** Used to stand-in for `undefined` hash values. */
686
- var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
687
-
688
- /**
689
- * Sets the hash `key` to `value`.
690
- *
691
- * @private
692
- * @name set
693
- * @memberOf Hash
694
- * @param {string} key The key of the value to set.
695
- * @param {*} value The value to set.
696
- * @returns {Object} Returns the hash instance.
697
- */
698
- function hashSet(key, value) {
699
- var data = this.__data__;
700
- this.size += this.has(key) ? 0 : 1;
701
- data[key] = (nativeCreate$1 && value === undefined) ? HASH_UNDEFINED$1 : value;
702
- return this;
703
- }
704
-
705
- /**
706
- * Creates a hash object.
707
- *
708
- * @private
709
- * @constructor
710
- * @param {Array} [entries] The key-value pairs to cache.
711
- */
712
- function Hash(entries) {
713
- var index = -1,
714
- length = entries == null ? 0 : entries.length;
715
-
716
- this.clear();
717
- while (++index < length) {
718
- var entry = entries[index];
719
- this.set(entry[0], entry[1]);
720
- }
721
- }
722
-
723
- // Add methods to `Hash`.
724
- Hash.prototype.clear = hashClear;
725
- Hash.prototype['delete'] = hashDelete;
726
- Hash.prototype.get = hashGet;
727
- Hash.prototype.has = hashHas;
728
- Hash.prototype.set = hashSet;
729
-
730
- /**
731
- * Removes all key-value entries from the map.
732
- *
733
- * @private
734
- * @name clear
735
- * @memberOf MapCache
736
- */
737
- function mapCacheClear() {
738
- this.size = 0;
739
- this.__data__ = {
740
- 'hash': new Hash,
741
- 'map': new (Map$1 || ListCache),
742
- 'string': new Hash
743
- };
744
- }
745
-
746
- /**
747
- * Checks if `value` is suitable for use as unique object key.
748
- *
749
- * @private
750
- * @param {*} value The value to check.
751
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
752
- */
753
- function isKeyable(value) {
754
- var type = typeof value;
755
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
756
- ? (value !== '__proto__')
757
- : (value === null);
758
- }
759
-
760
- /**
761
- * Gets the data for `map`.
762
- *
763
- * @private
764
- * @param {Object} map The map to query.
765
- * @param {string} key The reference key.
766
- * @returns {*} Returns the map data.
767
- */
768
- function getMapData(map, key) {
769
- var data = map.__data__;
770
- return isKeyable(key)
771
- ? data[typeof key == 'string' ? 'string' : 'hash']
772
- : data.map;
773
- }
774
-
775
- /**
776
- * Removes `key` and its value from the map.
777
- *
778
- * @private
779
- * @name delete
780
- * @memberOf MapCache
781
- * @param {string} key The key of the value to remove.
782
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
783
- */
784
- function mapCacheDelete(key) {
785
- var result = getMapData(this, key)['delete'](key);
786
- this.size -= result ? 1 : 0;
787
- return result;
788
- }
789
-
790
- /**
791
- * Gets the map value for `key`.
792
- *
793
- * @private
794
- * @name get
795
- * @memberOf MapCache
796
- * @param {string} key The key of the value to get.
797
- * @returns {*} Returns the entry value.
798
- */
799
- function mapCacheGet(key) {
800
- return getMapData(this, key).get(key);
801
- }
802
-
803
- /**
804
- * Checks if a map value for `key` exists.
805
- *
806
- * @private
807
- * @name has
808
- * @memberOf MapCache
809
- * @param {string} key The key of the entry to check.
810
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
811
- */
812
- function mapCacheHas(key) {
813
- return getMapData(this, key).has(key);
814
- }
815
-
816
- /**
817
- * Sets the map `key` to `value`.
818
- *
819
- * @private
820
- * @name set
821
- * @memberOf MapCache
822
- * @param {string} key The key of the value to set.
823
- * @param {*} value The value to set.
824
- * @returns {Object} Returns the map cache instance.
825
- */
826
- function mapCacheSet(key, value) {
827
- var data = getMapData(this, key),
828
- size = data.size;
829
-
830
- data.set(key, value);
831
- this.size += data.size == size ? 0 : 1;
832
- return this;
833
- }
834
-
835
- /**
836
- * Creates a map cache object to store key-value pairs.
837
- *
838
- * @private
839
- * @constructor
840
- * @param {Array} [entries] The key-value pairs to cache.
841
- */
842
- function MapCache(entries) {
843
- var index = -1,
844
- length = entries == null ? 0 : entries.length;
845
-
846
- this.clear();
847
- while (++index < length) {
848
- var entry = entries[index];
849
- this.set(entry[0], entry[1]);
850
- }
851
- }
852
-
853
- // Add methods to `MapCache`.
854
- MapCache.prototype.clear = mapCacheClear;
855
- MapCache.prototype['delete'] = mapCacheDelete;
856
- MapCache.prototype.get = mapCacheGet;
857
- MapCache.prototype.has = mapCacheHas;
858
- MapCache.prototype.set = mapCacheSet;
859
-
860
- /** Used as the size to enable large array optimizations. */
861
- var LARGE_ARRAY_SIZE = 200;
862
-
863
- /**
864
- * Sets the stack `key` to `value`.
865
- *
866
- * @private
867
- * @name set
868
- * @memberOf Stack
869
- * @param {string} key The key of the value to set.
870
- * @param {*} value The value to set.
871
- * @returns {Object} Returns the stack cache instance.
872
- */
873
- function stackSet(key, value) {
874
- var data = this.__data__;
875
- if (data instanceof ListCache) {
876
- var pairs = data.__data__;
877
- if (!Map$1 || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
878
- pairs.push([key, value]);
879
- this.size = ++data.size;
880
- return this;
881
- }
882
- data = this.__data__ = new MapCache(pairs);
883
- }
884
- data.set(key, value);
885
- this.size = data.size;
886
- return this;
887
- }
888
-
889
- /**
890
- * Creates a stack cache object to store key-value pairs.
891
- *
892
- * @private
893
- * @constructor
894
- * @param {Array} [entries] The key-value pairs to cache.
895
- */
896
- function Stack(entries) {
897
- var data = this.__data__ = new ListCache(entries);
898
- this.size = data.size;
899
- }
900
-
901
- // Add methods to `Stack`.
902
- Stack.prototype.clear = stackClear;
903
- Stack.prototype['delete'] = stackDelete;
904
- Stack.prototype.get = stackGet;
905
- Stack.prototype.has = stackHas;
906
- Stack.prototype.set = stackSet;
907
-
908
- /** Used to stand-in for `undefined` hash values. */
909
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
910
-
911
- /**
912
- * Adds `value` to the array cache.
913
- *
914
- * @private
915
- * @name add
916
- * @memberOf SetCache
917
- * @alias push
918
- * @param {*} value The value to cache.
919
- * @returns {Object} Returns the cache instance.
920
- */
921
- function setCacheAdd(value) {
922
- this.__data__.set(value, HASH_UNDEFINED);
923
- return this;
924
- }
925
-
926
- /**
927
- * Checks if `value` is in the array cache.
928
- *
929
- * @private
930
- * @name has
931
- * @memberOf SetCache
932
- * @param {*} value The value to search for.
933
- * @returns {number} Returns `true` if `value` is found, else `false`.
934
- */
935
- function setCacheHas(value) {
936
- return this.__data__.has(value);
937
- }
938
-
939
- /**
940
- *
941
- * Creates an array cache object to store unique values.
942
- *
943
- * @private
944
- * @constructor
945
- * @param {Array} [values] The values to cache.
946
- */
947
- function SetCache(values) {
948
- var index = -1,
949
- length = values == null ? 0 : values.length;
950
-
951
- this.__data__ = new MapCache;
952
- while (++index < length) {
953
- this.add(values[index]);
954
- }
955
- }
956
-
957
- // Add methods to `SetCache`.
958
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
959
- SetCache.prototype.has = setCacheHas;
960
-
961
- /**
962
- * A specialized version of `_.some` for arrays without support for iteratee
963
- * shorthands.
964
- *
965
- * @private
966
- * @param {Array} [array] The array to iterate over.
967
- * @param {Function} predicate The function invoked per iteration.
968
- * @returns {boolean} Returns `true` if any element passes the predicate check,
969
- * else `false`.
970
- */
971
- function arraySome(array, predicate) {
972
- var index = -1,
973
- length = array == null ? 0 : array.length;
974
-
975
- while (++index < length) {
976
- if (predicate(array[index], index, array)) {
977
- return true;
978
- }
979
- }
980
- return false;
981
- }
982
-
983
- /**
984
- * Checks if a `cache` value for `key` exists.
985
- *
986
- * @private
987
- * @param {Object} cache The cache to query.
988
- * @param {string} key The key of the entry to check.
989
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
990
- */
991
- function cacheHas(cache, key) {
992
- return cache.has(key);
993
- }
994
-
995
- /** Used to compose bitmasks for value comparisons. */
996
- var COMPARE_PARTIAL_FLAG$3 = 1,
997
- COMPARE_UNORDERED_FLAG$1 = 2;
998
-
999
- /**
1000
- * A specialized version of `baseIsEqualDeep` for arrays with support for
1001
- * partial deep comparisons.
1002
- *
1003
- * @private
1004
- * @param {Array} array The array to compare.
1005
- * @param {Array} other The other array to compare.
1006
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1007
- * @param {Function} customizer The function to customize comparisons.
1008
- * @param {Function} equalFunc The function to determine equivalents of values.
1009
- * @param {Object} stack Tracks traversed `array` and `other` objects.
1010
- * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
1011
- */
1012
- function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
1013
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
1014
- arrLength = array.length,
1015
- othLength = other.length;
1016
-
1017
- if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
1018
- return false;
1019
- }
1020
- // Check that cyclic values are equal.
1021
- var arrStacked = stack.get(array);
1022
- var othStacked = stack.get(other);
1023
- if (arrStacked && othStacked) {
1024
- return arrStacked == other && othStacked == array;
1025
- }
1026
- var index = -1,
1027
- result = true,
1028
- seen = (bitmask & COMPARE_UNORDERED_FLAG$1) ? new SetCache : undefined;
1029
-
1030
- stack.set(array, other);
1031
- stack.set(other, array);
1032
-
1033
- // Ignore non-index properties.
1034
- while (++index < arrLength) {
1035
- var arrValue = array[index],
1036
- othValue = other[index];
1037
-
1038
- if (customizer) {
1039
- var compared = isPartial
1040
- ? customizer(othValue, arrValue, index, other, array, stack)
1041
- : customizer(arrValue, othValue, index, array, other, stack);
1042
- }
1043
- if (compared !== undefined) {
1044
- if (compared) {
1045
- continue;
1046
- }
1047
- result = false;
1048
- break;
1049
- }
1050
- // Recursively compare arrays (susceptible to call stack limits).
1051
- if (seen) {
1052
- if (!arraySome(other, function(othValue, othIndex) {
1053
- if (!cacheHas(seen, othIndex) &&
1054
- (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
1055
- return seen.push(othIndex);
1056
- }
1057
- })) {
1058
- result = false;
1059
- break;
1060
- }
1061
- } else if (!(
1062
- arrValue === othValue ||
1063
- equalFunc(arrValue, othValue, bitmask, customizer, stack)
1064
- )) {
1065
- result = false;
1066
- break;
1067
- }
1068
- }
1069
- stack['delete'](array);
1070
- stack['delete'](other);
1071
- return result;
1072
- }
1073
-
1074
- /** Built-in value references. */
1075
- var Uint8Array = root$1.Uint8Array;
1076
-
1077
- var Uint8Array$1 = Uint8Array;
1078
-
1079
- /**
1080
- * Converts `map` to its key-value pairs.
1081
- *
1082
- * @private
1083
- * @param {Object} map The map to convert.
1084
- * @returns {Array} Returns the key-value pairs.
1085
- */
1086
- function mapToArray(map) {
1087
- var index = -1,
1088
- result = Array(map.size);
1089
-
1090
- map.forEach(function(value, key) {
1091
- result[++index] = [key, value];
1092
- });
1093
- return result;
1094
- }
1095
-
1096
- /**
1097
- * Converts `set` to an array of its values.
1098
- *
1099
- * @private
1100
- * @param {Object} set The set to convert.
1101
- * @returns {Array} Returns the values.
1102
- */
1103
- function setToArray(set) {
1104
- var index = -1,
1105
- result = Array(set.size);
1106
-
1107
- set.forEach(function(value) {
1108
- result[++index] = value;
1109
- });
1110
- return result;
1111
- }
1112
-
1113
- /** Used to compose bitmasks for value comparisons. */
1114
- var COMPARE_PARTIAL_FLAG$2 = 1,
1115
- COMPARE_UNORDERED_FLAG = 2;
1116
-
1117
- /** `Object#toString` result references. */
1118
- var boolTag$1 = '[object Boolean]',
1119
- dateTag$1 = '[object Date]',
1120
- errorTag$1 = '[object Error]',
1121
- mapTag$2 = '[object Map]',
1122
- numberTag$1 = '[object Number]',
1123
- regexpTag$1 = '[object RegExp]',
1124
- setTag$2 = '[object Set]',
1125
- stringTag$1 = '[object String]',
1126
- symbolTag = '[object Symbol]';
1127
-
1128
- var arrayBufferTag$1 = '[object ArrayBuffer]',
1129
- dataViewTag$2 = '[object DataView]';
1130
-
1131
- /** Used to convert symbols to primitives and strings. */
1132
- var symbolProto = Symbol$2 ? Symbol$2.prototype : undefined,
1133
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
1134
-
1135
- /**
1136
- * A specialized version of `baseIsEqualDeep` for comparing objects of
1137
- * the same `toStringTag`.
1138
- *
1139
- * **Note:** This function only supports comparing values with tags of
1140
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
1141
- *
1142
- * @private
1143
- * @param {Object} object The object to compare.
1144
- * @param {Object} other The other object to compare.
1145
- * @param {string} tag The `toStringTag` of the objects to compare.
1146
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1147
- * @param {Function} customizer The function to customize comparisons.
1148
- * @param {Function} equalFunc The function to determine equivalents of values.
1149
- * @param {Object} stack Tracks traversed `object` and `other` objects.
1150
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1151
- */
1152
- function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
1153
- switch (tag) {
1154
- case dataViewTag$2:
1155
- if ((object.byteLength != other.byteLength) ||
1156
- (object.byteOffset != other.byteOffset)) {
1157
- return false;
1158
- }
1159
- object = object.buffer;
1160
- other = other.buffer;
1161
-
1162
- case arrayBufferTag$1:
1163
- if ((object.byteLength != other.byteLength) ||
1164
- !equalFunc(new Uint8Array$1(object), new Uint8Array$1(other))) {
1165
- return false;
1166
- }
1167
- return true;
1168
-
1169
- case boolTag$1:
1170
- case dateTag$1:
1171
- case numberTag$1:
1172
- // Coerce booleans to `1` or `0` and dates to milliseconds.
1173
- // Invalid dates are coerced to `NaN`.
1174
- return eq(+object, +other);
1175
-
1176
- case errorTag$1:
1177
- return object.name == other.name && object.message == other.message;
1178
-
1179
- case regexpTag$1:
1180
- case stringTag$1:
1181
- // Coerce regexes to strings and treat strings, primitives and objects,
1182
- // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
1183
- // for more details.
1184
- return object == (other + '');
1185
-
1186
- case mapTag$2:
1187
- var convert = mapToArray;
1188
-
1189
- case setTag$2:
1190
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
1191
- convert || (convert = setToArray);
1192
-
1193
- if (object.size != other.size && !isPartial) {
1194
- return false;
1195
- }
1196
- // Assume cyclic values are equal.
1197
- var stacked = stack.get(object);
1198
- if (stacked) {
1199
- return stacked == other;
1200
- }
1201
- bitmask |= COMPARE_UNORDERED_FLAG;
1202
-
1203
- // Recursively compare objects (susceptible to call stack limits).
1204
- stack.set(object, other);
1205
- var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
1206
- stack['delete'](object);
1207
- return result;
1208
-
1209
- case symbolTag:
1210
- if (symbolValueOf) {
1211
- return symbolValueOf.call(object) == symbolValueOf.call(other);
1212
- }
1213
- }
1214
- return false;
1215
- }
1216
-
1217
- /**
1218
- * Appends the elements of `values` to `array`.
1219
- *
1220
- * @private
1221
- * @param {Array} array The array to modify.
1222
- * @param {Array} values The values to append.
1223
- * @returns {Array} Returns `array`.
1224
- */
1225
- function arrayPush(array, values) {
1226
- var index = -1,
1227
- length = values.length,
1228
- offset = array.length;
1229
-
1230
- while (++index < length) {
1231
- array[offset + index] = values[index];
1232
- }
1233
- return array;
1234
- }
1235
-
1236
- /**
1237
- * Checks if `value` is classified as an `Array` object.
1238
- *
1239
- * @static
1240
- * @memberOf _
1241
- * @since 0.1.0
1242
- * @category Lang
1243
- * @param {*} value The value to check.
1244
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1245
- * @example
1246
- *
1247
- * _.isArray([1, 2, 3]);
1248
- * // => true
1249
- *
1250
- * _.isArray(document.body.children);
1251
- * // => false
1252
- *
1253
- * _.isArray('abc');
1254
- * // => false
1255
- *
1256
- * _.isArray(_.noop);
1257
- * // => false
1258
- */
1259
- var isArray = Array.isArray;
1260
-
1261
- var isArray$1 = isArray;
1262
-
1263
- /**
1264
- * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
1265
- * `keysFunc` and `symbolsFunc` to get the enumerable property names and
1266
- * symbols of `object`.
1267
- *
1268
- * @private
1269
- * @param {Object} object The object to query.
1270
- * @param {Function} keysFunc The function to get the keys of `object`.
1271
- * @param {Function} symbolsFunc The function to get the symbols of `object`.
1272
- * @returns {Array} Returns the array of property names and symbols.
1273
- */
1274
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
1275
- var result = keysFunc(object);
1276
- return isArray$1(object) ? result : arrayPush(result, symbolsFunc(object));
1277
- }
1278
-
1279
- /**
1280
- * A specialized version of `_.filter` for arrays without support for
1281
- * iteratee shorthands.
1282
- *
1283
- * @private
1284
- * @param {Array} [array] The array to iterate over.
1285
- * @param {Function} predicate The function invoked per iteration.
1286
- * @returns {Array} Returns the new filtered array.
1287
- */
1288
- function arrayFilter(array, predicate) {
1289
- var index = -1,
1290
- length = array == null ? 0 : array.length,
1291
- resIndex = 0,
1292
- result = [];
1293
-
1294
- while (++index < length) {
1295
- var value = array[index];
1296
- if (predicate(value, index, array)) {
1297
- result[resIndex++] = value;
1298
- }
1299
- }
1300
- return result;
1301
- }
1302
-
1303
- /**
1304
- * This method returns a new empty array.
1305
- *
1306
- * @static
1307
- * @memberOf _
1308
- * @since 4.13.0
1309
- * @category Util
1310
- * @returns {Array} Returns the new empty array.
1311
- * @example
1312
- *
1313
- * var arrays = _.times(2, _.stubArray);
1314
- *
1315
- * console.log(arrays);
1316
- * // => [[], []]
1317
- *
1318
- * console.log(arrays[0] === arrays[1]);
1319
- * // => false
1320
- */
1321
- function stubArray() {
1322
- return [];
1323
- }
1324
-
1325
- /** Used for built-in method references. */
1326
- var objectProto$6 = Object.prototype;
1327
-
1328
- /** Built-in value references. */
1329
- var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
1330
-
1331
- /* Built-in method references for those with the same name as other `lodash` methods. */
1332
- var nativeGetSymbols = Object.getOwnPropertySymbols;
1333
-
1334
- /**
1335
- * Creates an array of the own enumerable symbols of `object`.
1336
- *
1337
- * @private
1338
- * @param {Object} object The object to query.
1339
- * @returns {Array} Returns the array of symbols.
1340
- */
1341
- var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
1342
- if (object == null) {
1343
- return [];
1344
- }
1345
- object = Object(object);
1346
- return arrayFilter(nativeGetSymbols(object), function(symbol) {
1347
- return propertyIsEnumerable$1.call(object, symbol);
1348
- });
1349
- };
1350
-
1351
- var getSymbols$1 = getSymbols;
1352
-
1353
- /**
1354
- * The base implementation of `_.times` without support for iteratee shorthands
1355
- * or max array length checks.
1356
- *
1357
- * @private
1358
- * @param {number} n The number of times to invoke `iteratee`.
1359
- * @param {Function} iteratee The function invoked per iteration.
1360
- * @returns {Array} Returns the array of results.
1361
- */
1362
- function baseTimes(n, iteratee) {
1363
- var index = -1,
1364
- result = Array(n);
1365
-
1366
- while (++index < n) {
1367
- result[index] = iteratee(index);
1368
- }
1369
- return result;
1370
- }
1371
-
1372
- /**
1373
- * Checks if `value` is object-like. A value is object-like if it's not `null`
1374
- * and has a `typeof` result of "object".
1375
- *
1376
- * @static
1377
- * @memberOf _
1378
- * @since 4.0.0
1379
- * @category Lang
1380
- * @param {*} value The value to check.
1381
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1382
- * @example
1383
- *
1384
- * _.isObjectLike({});
1385
- * // => true
1386
- *
1387
- * _.isObjectLike([1, 2, 3]);
1388
- * // => true
1389
- *
1390
- * _.isObjectLike(_.noop);
1391
- * // => false
1392
- *
1393
- * _.isObjectLike(null);
1394
- * // => false
1395
- */
1396
- function isObjectLike(value) {
1397
- return value != null && typeof value == 'object';
1398
- }
1399
-
1400
- /** `Object#toString` result references. */
1401
- var argsTag$2 = '[object Arguments]';
1402
-
1403
- /**
1404
- * The base implementation of `_.isArguments`.
1405
- *
1406
- * @private
1407
- * @param {*} value The value to check.
1408
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1409
- */
1410
- function baseIsArguments(value) {
1411
- return isObjectLike(value) && baseGetTag(value) == argsTag$2;
1412
- }
1413
-
1414
- /** Used for built-in method references. */
1415
- var objectProto$5 = Object.prototype;
1416
-
1417
- /** Used to check objects for own properties. */
1418
- var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
1419
-
1420
- /** Built-in value references. */
1421
- var propertyIsEnumerable = objectProto$5.propertyIsEnumerable;
1422
-
1423
- /**
1424
- * Checks if `value` is likely an `arguments` object.
1425
- *
1426
- * @static
1427
- * @memberOf _
1428
- * @since 0.1.0
1429
- * @category Lang
1430
- * @param {*} value The value to check.
1431
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1432
- * else `false`.
1433
- * @example
1434
- *
1435
- * _.isArguments(function() { return arguments; }());
1436
- * // => true
1437
- *
1438
- * _.isArguments([1, 2, 3]);
1439
- * // => false
1440
- */
1441
- var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
1442
- return isObjectLike(value) && hasOwnProperty$4.call(value, 'callee') &&
1443
- !propertyIsEnumerable.call(value, 'callee');
1444
- };
1445
-
1446
- var isArguments$1 = isArguments;
1447
-
1448
- /**
1449
- * This method returns `false`.
1450
- *
1451
- * @static
1452
- * @memberOf _
1453
- * @since 4.13.0
1454
- * @category Util
1455
- * @returns {boolean} Returns `false`.
1456
- * @example
1457
- *
1458
- * _.times(2, _.stubFalse);
1459
- * // => [false, false]
1460
- */
1461
- function stubFalse() {
1462
- return false;
1463
- }
1464
-
1465
- /** Detect free variable `exports`. */
1466
- var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports;
1467
-
1468
- /** Detect free variable `module`. */
1469
- var freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module;
1470
-
1471
- /** Detect the popular CommonJS extension `module.exports`. */
1472
- var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
1473
-
1474
- /** Built-in value references. */
1475
- var Buffer = moduleExports$1 ? root$1.Buffer : undefined;
1476
-
1477
- /* Built-in method references for those with the same name as other `lodash` methods. */
1478
- var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
1479
-
1480
- /**
1481
- * Checks if `value` is a buffer.
1482
- *
1483
- * @static
1484
- * @memberOf _
1485
- * @since 4.3.0
1486
- * @category Lang
1487
- * @param {*} value The value to check.
1488
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
1489
- * @example
1490
- *
1491
- * _.isBuffer(new Buffer(2));
1492
- * // => true
1493
- *
1494
- * _.isBuffer(new Uint8Array(2));
1495
- * // => false
1496
- */
1497
- var isBuffer = nativeIsBuffer || stubFalse;
1498
-
1499
- var isBuffer$1 = isBuffer;
1500
-
1501
- /** Used as references for various `Number` constants. */
1502
- var MAX_SAFE_INTEGER$1 = 9007199254740991;
1503
-
1504
- /** Used to detect unsigned integer values. */
1505
- var reIsUint = /^(?:0|[1-9]\d*)$/;
1506
-
1507
- /**
1508
- * Checks if `value` is a valid array-like index.
1509
- *
1510
- * @private
1511
- * @param {*} value The value to check.
1512
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1513
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1514
- */
1515
- function isIndex(value, length) {
1516
- var type = typeof value;
1517
- length = length == null ? MAX_SAFE_INTEGER$1 : length;
1518
-
1519
- return !!length &&
1520
- (type == 'number' ||
1521
- (type != 'symbol' && reIsUint.test(value))) &&
1522
- (value > -1 && value % 1 == 0 && value < length);
1523
- }
1524
-
1525
- /** Used as references for various `Number` constants. */
1526
- var MAX_SAFE_INTEGER = 9007199254740991;
1527
-
1528
- /**
1529
- * Checks if `value` is a valid array-like length.
1530
- *
1531
- * **Note:** This method is loosely based on
1532
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1533
- *
1534
- * @static
1535
- * @memberOf _
1536
- * @since 4.0.0
1537
- * @category Lang
1538
- * @param {*} value The value to check.
1539
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1540
- * @example
1541
- *
1542
- * _.isLength(3);
1543
- * // => true
1544
- *
1545
- * _.isLength(Number.MIN_VALUE);
1546
- * // => false
1547
- *
1548
- * _.isLength(Infinity);
1549
- * // => false
1550
- *
1551
- * _.isLength('3');
1552
- * // => false
1553
- */
1554
- function isLength(value) {
1555
- return typeof value == 'number' &&
1556
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1557
- }
1558
-
1559
- /** `Object#toString` result references. */
1560
- var argsTag$1 = '[object Arguments]',
1561
- arrayTag$1 = '[object Array]',
1562
- boolTag = '[object Boolean]',
1563
- dateTag = '[object Date]',
1564
- errorTag = '[object Error]',
1565
- funcTag = '[object Function]',
1566
- mapTag$1 = '[object Map]',
1567
- numberTag = '[object Number]',
1568
- objectTag$2 = '[object Object]',
1569
- regexpTag = '[object RegExp]',
1570
- setTag$1 = '[object Set]',
1571
- stringTag = '[object String]',
1572
- weakMapTag$1 = '[object WeakMap]';
1573
-
1574
- var arrayBufferTag = '[object ArrayBuffer]',
1575
- dataViewTag$1 = '[object DataView]',
1576
- float32Tag = '[object Float32Array]',
1577
- float64Tag = '[object Float64Array]',
1578
- int8Tag = '[object Int8Array]',
1579
- int16Tag = '[object Int16Array]',
1580
- int32Tag = '[object Int32Array]',
1581
- uint8Tag = '[object Uint8Array]',
1582
- uint8ClampedTag = '[object Uint8ClampedArray]',
1583
- uint16Tag = '[object Uint16Array]',
1584
- uint32Tag = '[object Uint32Array]';
1585
-
1586
- /** Used to identify `toStringTag` values of typed arrays. */
1587
- var typedArrayTags = {};
1588
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
1589
- typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
1590
- typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
1591
- typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
1592
- typedArrayTags[uint32Tag] = true;
1593
- typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
1594
- typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
1595
- typedArrayTags[dataViewTag$1] = typedArrayTags[dateTag] =
1596
- typedArrayTags[errorTag] = typedArrayTags[funcTag] =
1597
- typedArrayTags[mapTag$1] = typedArrayTags[numberTag] =
1598
- typedArrayTags[objectTag$2] = typedArrayTags[regexpTag] =
1599
- typedArrayTags[setTag$1] = typedArrayTags[stringTag] =
1600
- typedArrayTags[weakMapTag$1] = false;
1601
-
1602
- /**
1603
- * The base implementation of `_.isTypedArray` without Node.js optimizations.
1604
- *
1605
- * @private
1606
- * @param {*} value The value to check.
1607
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1608
- */
1609
- function baseIsTypedArray(value) {
1610
- return isObjectLike(value) &&
1611
- isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
1612
- }
1613
-
1614
- /**
1615
- * The base implementation of `_.unary` without support for storing metadata.
1616
- *
1617
- * @private
1618
- * @param {Function} func The function to cap arguments for.
1619
- * @returns {Function} Returns the new capped function.
1620
- */
1621
- function baseUnary(func) {
1622
- return function(value) {
1623
- return func(value);
1624
- };
1625
- }
1626
-
1627
- /** Detect free variable `exports`. */
1628
- var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
1629
-
1630
- /** Detect free variable `module`. */
1631
- var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
1632
-
1633
- /** Detect the popular CommonJS extension `module.exports`. */
1634
- var moduleExports = freeModule && freeModule.exports === freeExports;
1635
-
1636
- /** Detect free variable `process` from Node.js. */
1637
- var freeProcess = moduleExports && freeGlobal$1.process;
1638
-
1639
- /** Used to access faster Node.js helpers. */
1640
- var nodeUtil = (function() {
1641
- try {
1642
- // Use `util.types` for Node.js 10+.
1643
- var types = freeModule && freeModule.require && freeModule.require('util').types;
1644
-
1645
- if (types) {
1646
- return types;
1647
- }
1648
-
1649
- // Legacy `process.binding('util')` for Node.js < 10.
1650
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
1651
- } catch (e) {}
1652
- }());
1653
-
1654
- var nodeUtil$1 = nodeUtil;
1655
-
1656
- /* Node.js helper references. */
1657
- var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray;
1658
-
1659
- /**
1660
- * Checks if `value` is classified as a typed array.
1661
- *
1662
- * @static
1663
- * @memberOf _
1664
- * @since 3.0.0
1665
- * @category Lang
1666
- * @param {*} value The value to check.
1667
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1668
- * @example
1669
- *
1670
- * _.isTypedArray(new Uint8Array);
1671
- * // => true
1672
- *
1673
- * _.isTypedArray([]);
1674
- * // => false
1675
- */
1676
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
1677
-
1678
- var isTypedArray$1 = isTypedArray;
1679
-
1680
- /** Used for built-in method references. */
1681
- var objectProto$4 = Object.prototype;
1682
-
1683
- /** Used to check objects for own properties. */
1684
- var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
1685
-
1686
- /**
1687
- * Creates an array of the enumerable property names of the array-like `value`.
1688
- *
1689
- * @private
1690
- * @param {*} value The value to query.
1691
- * @param {boolean} inherited Specify returning inherited property names.
1692
- * @returns {Array} Returns the array of property names.
1693
- */
1694
- function arrayLikeKeys(value, inherited) {
1695
- var isArr = isArray$1(value),
1696
- isArg = !isArr && isArguments$1(value),
1697
- isBuff = !isArr && !isArg && isBuffer$1(value),
1698
- isType = !isArr && !isArg && !isBuff && isTypedArray$1(value),
1699
- skipIndexes = isArr || isArg || isBuff || isType,
1700
- result = skipIndexes ? baseTimes(value.length, String) : [],
1701
- length = result.length;
1702
-
1703
- for (var key in value) {
1704
- if ((inherited || hasOwnProperty$3.call(value, key)) &&
1705
- !(skipIndexes && (
1706
- // Safari 9 has enumerable `arguments.length` in strict mode.
1707
- key == 'length' ||
1708
- // Node.js 0.10 has enumerable non-index properties on buffers.
1709
- (isBuff && (key == 'offset' || key == 'parent')) ||
1710
- // PhantomJS 2 has enumerable non-index properties on typed arrays.
1711
- (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
1712
- // Skip index properties.
1713
- isIndex(key, length)
1714
- ))) {
1715
- result.push(key);
1716
- }
1717
- }
1718
- return result;
1719
- }
1720
-
1721
- /** Used for built-in method references. */
1722
- var objectProto$3 = Object.prototype;
1723
-
1724
- /**
1725
- * Checks if `value` is likely a prototype object.
1726
- *
1727
- * @private
1728
- * @param {*} value The value to check.
1729
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
1730
- */
1731
- function isPrototype(value) {
1732
- var Ctor = value && value.constructor,
1733
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$3;
1734
-
1735
- return value === proto;
1736
- }
1737
-
1738
- /**
1739
- * Creates a unary function that invokes `func` with its argument transformed.
1740
- *
1741
- * @private
1742
- * @param {Function} func The function to wrap.
1743
- * @param {Function} transform The argument transform.
1744
- * @returns {Function} Returns the new function.
1745
- */
1746
- function overArg(func, transform) {
1747
- return function(arg) {
1748
- return func(transform(arg));
1749
- };
1750
- }
1751
-
1752
- /* Built-in method references for those with the same name as other `lodash` methods. */
1753
- var nativeKeys = overArg(Object.keys, Object);
1754
-
1755
- var nativeKeys$1 = nativeKeys;
1756
-
1757
- /** Used for built-in method references. */
1758
- var objectProto$2 = Object.prototype;
1759
-
1760
- /** Used to check objects for own properties. */
1761
- var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
1762
-
1763
- /**
1764
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
1765
- *
1766
- * @private
1767
- * @param {Object} object The object to query.
1768
- * @returns {Array} Returns the array of property names.
1769
- */
1770
- function baseKeys(object) {
1771
- if (!isPrototype(object)) {
1772
- return nativeKeys$1(object);
1773
- }
1774
- var result = [];
1775
- for (var key in Object(object)) {
1776
- if (hasOwnProperty$2.call(object, key) && key != 'constructor') {
1777
- result.push(key);
1778
- }
1779
- }
1780
- return result;
1781
- }
1782
-
1783
- /**
1784
- * Checks if `value` is array-like. A value is considered array-like if it's
1785
- * not a function and has a `value.length` that's an integer greater than or
1786
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
1787
- *
1788
- * @static
1789
- * @memberOf _
1790
- * @since 4.0.0
1791
- * @category Lang
1792
- * @param {*} value The value to check.
1793
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
1794
- * @example
1795
- *
1796
- * _.isArrayLike([1, 2, 3]);
1797
- * // => true
1798
- *
1799
- * _.isArrayLike(document.body.children);
1800
- * // => true
1801
- *
1802
- * _.isArrayLike('abc');
1803
- * // => true
1804
- *
1805
- * _.isArrayLike(_.noop);
1806
- * // => false
1807
- */
1808
- function isArrayLike(value) {
1809
- return value != null && isLength(value.length) && !isFunction(value);
1810
- }
1811
-
1812
- /**
1813
- * Creates an array of the own enumerable property names of `object`.
1814
- *
1815
- * **Note:** Non-object values are coerced to objects. See the
1816
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1817
- * for more details.
1818
- *
1819
- * @static
1820
- * @since 0.1.0
1821
- * @memberOf _
1822
- * @category Object
1823
- * @param {Object} object The object to query.
1824
- * @returns {Array} Returns the array of property names.
1825
- * @example
1826
- *
1827
- * function Foo() {
1828
- * this.a = 1;
1829
- * this.b = 2;
1830
- * }
1831
- *
1832
- * Foo.prototype.c = 3;
1833
- *
1834
- * _.keys(new Foo);
1835
- * // => ['a', 'b'] (iteration order is not guaranteed)
1836
- *
1837
- * _.keys('hi');
1838
- * // => ['0', '1']
1839
- */
1840
- function keys(object) {
1841
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
1842
- }
1843
-
1844
- /**
1845
- * Creates an array of own enumerable property names and symbols of `object`.
1846
- *
1847
- * @private
1848
- * @param {Object} object The object to query.
1849
- * @returns {Array} Returns the array of property names and symbols.
1850
- */
1851
- function getAllKeys(object) {
1852
- return baseGetAllKeys(object, keys, getSymbols$1);
1853
- }
1854
-
1855
- /** Used to compose bitmasks for value comparisons. */
1856
- var COMPARE_PARTIAL_FLAG$1 = 1;
1857
-
1858
- /** Used for built-in method references. */
1859
- var objectProto$1 = Object.prototype;
1860
-
1861
- /** Used to check objects for own properties. */
1862
- var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
1863
-
1864
- /**
1865
- * A specialized version of `baseIsEqualDeep` for objects with support for
1866
- * partial deep comparisons.
1867
- *
1868
- * @private
1869
- * @param {Object} object The object to compare.
1870
- * @param {Object} other The other object to compare.
1871
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1872
- * @param {Function} customizer The function to customize comparisons.
1873
- * @param {Function} equalFunc The function to determine equivalents of values.
1874
- * @param {Object} stack Tracks traversed `object` and `other` objects.
1875
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1876
- */
1877
- function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
1878
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1,
1879
- objProps = getAllKeys(object),
1880
- objLength = objProps.length,
1881
- othProps = getAllKeys(other),
1882
- othLength = othProps.length;
1883
-
1884
- if (objLength != othLength && !isPartial) {
1885
- return false;
1886
- }
1887
- var index = objLength;
1888
- while (index--) {
1889
- var key = objProps[index];
1890
- if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
1891
- return false;
1892
- }
1893
- }
1894
- // Check that cyclic values are equal.
1895
- var objStacked = stack.get(object);
1896
- var othStacked = stack.get(other);
1897
- if (objStacked && othStacked) {
1898
- return objStacked == other && othStacked == object;
1899
- }
1900
- var result = true;
1901
- stack.set(object, other);
1902
- stack.set(other, object);
1903
-
1904
- var skipCtor = isPartial;
1905
- while (++index < objLength) {
1906
- key = objProps[index];
1907
- var objValue = object[key],
1908
- othValue = other[key];
1909
-
1910
- if (customizer) {
1911
- var compared = isPartial
1912
- ? customizer(othValue, objValue, key, other, object, stack)
1913
- : customizer(objValue, othValue, key, object, other, stack);
1914
- }
1915
- // Recursively compare objects (susceptible to call stack limits).
1916
- if (!(compared === undefined
1917
- ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
1918
- : compared
1919
- )) {
1920
- result = false;
1921
- break;
1922
- }
1923
- skipCtor || (skipCtor = key == 'constructor');
1924
- }
1925
- if (result && !skipCtor) {
1926
- var objCtor = object.constructor,
1927
- othCtor = other.constructor;
1928
-
1929
- // Non `Object` object instances with different constructors are not equal.
1930
- if (objCtor != othCtor &&
1931
- ('constructor' in object && 'constructor' in other) &&
1932
- !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
1933
- typeof othCtor == 'function' && othCtor instanceof othCtor)) {
1934
- result = false;
1935
- }
1936
- }
1937
- stack['delete'](object);
1938
- stack['delete'](other);
1939
- return result;
1940
- }
1941
-
1942
- /* Built-in method references that are verified to be native. */
1943
- var DataView = getNative(root$1, 'DataView');
1944
-
1945
- var DataView$1 = DataView;
1946
-
1947
- /* Built-in method references that are verified to be native. */
1948
- var Promise$1 = getNative(root$1, 'Promise');
1949
-
1950
- var Promise$2 = Promise$1;
1951
-
1952
- /* Built-in method references that are verified to be native. */
1953
- var Set = getNative(root$1, 'Set');
1954
-
1955
- var Set$1 = Set;
1956
-
1957
- /* Built-in method references that are verified to be native. */
1958
- var WeakMap = getNative(root$1, 'WeakMap');
1959
-
1960
- var WeakMap$1 = WeakMap;
1961
-
1962
- /** `Object#toString` result references. */
1963
- var mapTag = '[object Map]',
1964
- objectTag$1 = '[object Object]',
1965
- promiseTag = '[object Promise]',
1966
- setTag = '[object Set]',
1967
- weakMapTag = '[object WeakMap]';
1968
-
1969
- var dataViewTag = '[object DataView]';
1970
-
1971
- /** Used to detect maps, sets, and weakmaps. */
1972
- var dataViewCtorString = toSource(DataView$1),
1973
- mapCtorString = toSource(Map$1),
1974
- promiseCtorString = toSource(Promise$2),
1975
- setCtorString = toSource(Set$1),
1976
- weakMapCtorString = toSource(WeakMap$1);
1977
-
1978
- /**
1979
- * Gets the `toStringTag` of `value`.
1980
- *
1981
- * @private
1982
- * @param {*} value The value to query.
1983
- * @returns {string} Returns the `toStringTag`.
1984
- */
1985
- var getTag = baseGetTag;
1986
-
1987
- // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
1988
- if ((DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag) ||
1989
- (Map$1 && getTag(new Map$1) != mapTag) ||
1990
- (Promise$2 && getTag(Promise$2.resolve()) != promiseTag) ||
1991
- (Set$1 && getTag(new Set$1) != setTag) ||
1992
- (WeakMap$1 && getTag(new WeakMap$1) != weakMapTag)) {
1993
- getTag = function(value) {
1994
- var result = baseGetTag(value),
1995
- Ctor = result == objectTag$1 ? value.constructor : undefined,
1996
- ctorString = Ctor ? toSource(Ctor) : '';
1997
-
1998
- if (ctorString) {
1999
- switch (ctorString) {
2000
- case dataViewCtorString: return dataViewTag;
2001
- case mapCtorString: return mapTag;
2002
- case promiseCtorString: return promiseTag;
2003
- case setCtorString: return setTag;
2004
- case weakMapCtorString: return weakMapTag;
2005
- }
2006
- }
2007
- return result;
2008
- };
2009
- }
2010
-
2011
- var getTag$1 = getTag;
2012
-
2013
- /** Used to compose bitmasks for value comparisons. */
2014
- var COMPARE_PARTIAL_FLAG = 1;
2015
-
2016
- /** `Object#toString` result references. */
2017
- var argsTag = '[object Arguments]',
2018
- arrayTag = '[object Array]',
2019
- objectTag = '[object Object]';
2020
-
2021
- /** Used for built-in method references. */
2022
- var objectProto = Object.prototype;
2023
-
2024
- /** Used to check objects for own properties. */
2025
- var hasOwnProperty = objectProto.hasOwnProperty;
2026
-
2027
- /**
2028
- * A specialized version of `baseIsEqual` for arrays and objects which performs
2029
- * deep comparisons and tracks traversed objects enabling objects with circular
2030
- * references to be compared.
2031
- *
2032
- * @private
2033
- * @param {Object} object The object to compare.
2034
- * @param {Object} other The other object to compare.
2035
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
2036
- * @param {Function} customizer The function to customize comparisons.
2037
- * @param {Function} equalFunc The function to determine equivalents of values.
2038
- * @param {Object} [stack] Tracks traversed `object` and `other` objects.
2039
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
2040
- */
2041
- function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
2042
- var objIsArr = isArray$1(object),
2043
- othIsArr = isArray$1(other),
2044
- objTag = objIsArr ? arrayTag : getTag$1(object),
2045
- othTag = othIsArr ? arrayTag : getTag$1(other);
2046
-
2047
- objTag = objTag == argsTag ? objectTag : objTag;
2048
- othTag = othTag == argsTag ? objectTag : othTag;
2049
-
2050
- var objIsObj = objTag == objectTag,
2051
- othIsObj = othTag == objectTag,
2052
- isSameTag = objTag == othTag;
2053
-
2054
- if (isSameTag && isBuffer$1(object)) {
2055
- if (!isBuffer$1(other)) {
2056
- return false;
2057
- }
2058
- objIsArr = true;
2059
- objIsObj = false;
2060
- }
2061
- if (isSameTag && !objIsObj) {
2062
- stack || (stack = new Stack);
2063
- return (objIsArr || isTypedArray$1(object))
2064
- ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
2065
- : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
2066
- }
2067
- if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
2068
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
2069
- othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
2070
-
2071
- if (objIsWrapped || othIsWrapped) {
2072
- var objUnwrapped = objIsWrapped ? object.value() : object,
2073
- othUnwrapped = othIsWrapped ? other.value() : other;
2074
-
2075
- stack || (stack = new Stack);
2076
- return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
2077
- }
2078
- }
2079
- if (!isSameTag) {
2080
- return false;
2081
- }
2082
- stack || (stack = new Stack);
2083
- return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
2084
- }
2085
-
2086
- /**
2087
- * The base implementation of `_.isEqual` which supports partial comparisons
2088
- * and tracks traversed objects.
2089
- *
2090
- * @private
2091
- * @param {*} value The value to compare.
2092
- * @param {*} other The other value to compare.
2093
- * @param {boolean} bitmask The bitmask flags.
2094
- * 1 - Unordered comparison
2095
- * 2 - Partial comparison
2096
- * @param {Function} [customizer] The function to customize comparisons.
2097
- * @param {Object} [stack] Tracks traversed `value` and `other` objects.
2098
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
2099
- */
2100
- function baseIsEqual(value, other, bitmask, customizer, stack) {
2101
- if (value === other) {
2102
- return true;
2103
- }
2104
- if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
2105
- return value !== value && other !== other;
2106
- }
2107
- return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
2108
- }
2109
-
2110
- /**
2111
- * Performs a deep comparison between two values to determine if they are
2112
- * equivalent.
2113
- *
2114
- * **Note:** This method supports comparing arrays, array buffers, booleans,
2115
- * date objects, error objects, maps, numbers, `Object` objects, regexes,
2116
- * sets, strings, symbols, and typed arrays. `Object` objects are compared
2117
- * by their own, not inherited, enumerable properties. Functions and DOM
2118
- * nodes are compared by strict equality, i.e. `===`.
2119
- *
2120
- * @static
2121
- * @memberOf _
2122
- * @since 0.1.0
2123
- * @category Lang
2124
- * @param {*} value The value to compare.
2125
- * @param {*} other The other value to compare.
2126
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
2127
- * @example
2128
- *
2129
- * var object = { 'a': 1 };
2130
- * var other = { 'a': 1 };
2131
- *
2132
- * _.isEqual(object, other);
2133
- * // => true
2134
- *
2135
- * object === other;
2136
- * // => false
2137
- */
2138
- function isEqual(value, other) {
2139
- return baseIsEqual(value, other);
2140
- }
2141
-
2142
- var RendererManager = (function () {
2143
- function RendererManager(_a) {
2144
- var game = _a.game, rendererSystem = _a.rendererSystem;
2145
- this.renderers = [];
2146
- this.game = game;
2147
- this.rendererSystem = rendererSystem;
2148
- }
2149
- RendererManager.prototype.register = function () {
2150
- var e_1, _a;
2151
- var renderers = [];
2152
- for (var _i = 0; _i < arguments.length; _i++) {
2153
- renderers[_i] = arguments[_i];
2154
- }
2155
- try {
2156
- for (var renderers_1 = __values(renderers), renderers_1_1 = renderers_1.next(); !renderers_1_1.done; renderers_1_1 = renderers_1.next()) {
2157
- var renderer = renderers_1_1.value;
2158
- renderer.game = this.game;
2159
- renderer.rendererManager = this.rendererSystem.rendererManager;
2160
- renderer.containerManager = this.rendererSystem.containerManager;
2161
- this.renderers.push(renderer);
2162
- }
2163
- }
2164
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
2165
- finally {
2166
- try {
2167
- if (renderers_1_1 && !renderers_1_1.done && (_a = renderers_1.return)) _a.call(renderers_1);
2168
- }
2169
- finally { if (e_1) throw e_1.error; }
2170
- }
2171
- };
2172
- RendererManager.prototype.componentChanged = function (changes) {
2173
- var e_2, _a;
2174
- var _loop_1 = function (changed) {
2175
- var e_3, _a;
2176
- try {
2177
- for (var _b = (e_3 = void 0, __values(this_1.renderers)), _c = _b.next(); !_c.done; _c = _b.next()) {
2178
- var renderer = _c.value;
2179
- var props = renderer.observerInfo[changed.componentName];
2180
- if (props) {
2181
- if ([eva_js.OBSERVER_TYPE.ADD, eva_js.OBSERVER_TYPE.REMOVE].indexOf(changed.type) > -1) {
2182
- try {
2183
- renderer.componentChanged && renderer.componentChanged(changed);
2184
- }
2185
- catch (e) {
2186
- console.error("gameObject: " + changed.gameObject.name + ", " + changed.componentName + " is error.", changed, e);
2187
- }
2188
- continue;
2189
- }
2190
- var index = props.findIndex(function (prop) {
2191
- return isEqual(prop, changed.prop);
2192
- });
2193
- if (index > -1) {
2194
- try {
2195
- renderer.componentChanged && renderer.componentChanged(changed);
2196
- }
2197
- catch (e) {
2198
- console.error("gameObject: " + (changed.gameObject && changed.gameObject.name) + ", " + changed.componentName + " is componentChanged error.", changed, e);
2199
- }
2200
- }
2201
- }
2202
- }
2203
- }
2204
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
2205
- finally {
2206
- try {
2207
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
2208
- }
2209
- finally { if (e_3) throw e_3.error; }
2210
- }
2211
- };
2212
- var this_1 = this;
2213
- try {
2214
- for (var changes_1 = __values(changes), changes_1_1 = changes_1.next(); !changes_1_1.done; changes_1_1 = changes_1.next()) {
2215
- var changed = changes_1_1.value;
2216
- _loop_1(changed);
2217
- }
2218
- }
2219
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
2220
- finally {
2221
- try {
2222
- if (changes_1_1 && !changes_1_1.done && (_a = changes_1.return)) _a.call(changes_1);
2223
- }
2224
- finally { if (e_2) throw e_2.error; }
2225
- }
2226
- };
2227
- RendererManager.prototype.update = function (gameObject) {
2228
- var e_4, _a, e_5, _b;
2229
- try {
2230
- for (var _c = __values(gameObject.components), _d = _c.next(); !_d.done; _d = _c.next()) {
2231
- var component = _d.value;
2232
- try {
2233
- for (var _e = (e_5 = void 0, __values(this.renderers)), _f = _e.next(); !_f.done; _f = _e.next()) {
2234
- var renderer = _f.value;
2235
- var cache = [];
2236
- var props = renderer.observerInfo[component.name];
2237
- if (props && cache.indexOf(gameObject) === -1) {
2238
- cache.push(gameObject);
2239
- try {
2240
- renderer.rendererUpdate && renderer.rendererUpdate(gameObject);
2241
- }
2242
- catch (e) {
2243
- console.info("gameObject: " + gameObject.name + ", " + component.name + " is update error", e);
2244
- }
2245
- }
2246
- }
2247
- }
2248
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
2249
- finally {
2250
- try {
2251
- if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
2252
- }
2253
- finally { if (e_5) throw e_5.error; }
2254
- }
2255
- }
2256
- }
2257
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
2258
- finally {
2259
- try {
2260
- if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
2261
- }
2262
- finally { if (e_4) throw e_4.error; }
2263
- }
2264
- };
2265
- return RendererManager;
2266
- }());
2267
- var RendererManager$1 = RendererManager;
2268
-
2269
- var ContainerManager = (function () {
2270
- function ContainerManager() {
2271
- this.containerMap = {};
2272
- }
2273
- ContainerManager.prototype.addContainer = function (_a) {
2274
- var name = _a.name, container = _a.container;
2275
- this.containerMap[name] = container;
2276
- };
2277
- ContainerManager.prototype.getContainer = function (name) {
2278
- return this.containerMap[name];
2279
- };
2280
- ContainerManager.prototype.removeContainer = function (name) {
2281
- var _a;
2282
- (_a = this.containerMap[name]) === null || _a === void 0 ? void 0 : _a.destroy({ children: true });
2283
- delete this.containerMap[name];
2284
- };
2285
- ContainerManager.prototype.updateTransform = function (_a) {
2286
- var name = _a.name, transform = _a.transform;
2287
- var container = this.containerMap[name];
2288
- if (!container)
2289
- return;
2290
- var anchor = transform.anchor, origin = transform.origin, position = transform.position, rotation = transform.rotation, scale = transform.scale, size = transform.size, skew = transform.skew;
2291
- container.rotation = rotation;
2292
- container.scale = scale;
2293
- container.pivot.x = size.width * origin.x;
2294
- container.pivot.y = size.height * origin.y;
2295
- container.skew = skew;
2296
- var x = position.x;
2297
- var y = position.y;
2298
- if (transform.parent) {
2299
- var parent_1 = transform.parent;
2300
- x = x + parent_1.size.width * anchor.x;
2301
- y = y + parent_1.size.height * anchor.y;
2302
- }
2303
- container.position = { x: x, y: y };
2304
- };
2305
- return ContainerManager;
2306
- }());
2307
- var ContainerManager$1 = ContainerManager;
2308
-
2309
- function createCommonjsModule(fn) {
2310
- var module = { exports: {} };
2311
- return fn(module, module.exports), module.exports;
2312
- }
2313
-
2314
- var eventemitter3 = createCommonjsModule(function (module) {
2315
-
2316
- var has = Object.prototype.hasOwnProperty
2317
- , prefix = '~';
2318
-
2319
- /**
2320
- * Constructor to create a storage for our `EE` objects.
2321
- * An `Events` instance is a plain object whose properties are event names.
2322
- *
2323
- * @constructor
2324
- * @private
2325
- */
2326
- function Events() {}
2327
-
2328
- //
2329
- // We try to not inherit from `Object.prototype`. In some engines creating an
2330
- // instance in this way is faster than calling `Object.create(null)` directly.
2331
- // If `Object.create(null)` is not supported we prefix the event names with a
2332
- // character to make sure that the built-in object properties are not
2333
- // overridden or used as an attack vector.
2334
- //
2335
- if (Object.create) {
2336
- Events.prototype = Object.create(null);
2337
-
2338
- //
2339
- // This hack is needed because the `__proto__` property is still inherited in
2340
- // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
2341
- //
2342
- if (!new Events().__proto__) prefix = false;
2343
- }
2344
-
2345
- /**
2346
- * Representation of a single event listener.
2347
- *
2348
- * @param {Function} fn The listener function.
2349
- * @param {*} context The context to invoke the listener with.
2350
- * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
2351
- * @constructor
2352
- * @private
2353
- */
2354
- function EE(fn, context, once) {
2355
- this.fn = fn;
2356
- this.context = context;
2357
- this.once = once || false;
2358
- }
2359
-
2360
- /**
2361
- * Add a listener for a given event.
2362
- *
2363
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
2364
- * @param {(String|Symbol)} event The event name.
2365
- * @param {Function} fn The listener function.
2366
- * @param {*} context The context to invoke the listener with.
2367
- * @param {Boolean} once Specify if the listener is a one-time listener.
2368
- * @returns {EventEmitter}
2369
- * @private
2370
- */
2371
- function addListener(emitter, event, fn, context, once) {
2372
- if (typeof fn !== 'function') {
2373
- throw new TypeError('The listener must be a function');
2374
- }
2375
-
2376
- var listener = new EE(fn, context || emitter, once)
2377
- , evt = prefix ? prefix + event : event;
2378
-
2379
- if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
2380
- else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
2381
- else emitter._events[evt] = [emitter._events[evt], listener];
2382
-
2383
- return emitter;
2384
- }
2385
-
2386
- /**
2387
- * Clear event by name.
2388
- *
2389
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
2390
- * @param {(String|Symbol)} evt The Event name.
2391
- * @private
2392
- */
2393
- function clearEvent(emitter, evt) {
2394
- if (--emitter._eventsCount === 0) emitter._events = new Events();
2395
- else delete emitter._events[evt];
2396
- }
2397
-
2398
- /**
2399
- * Minimal `EventEmitter` interface that is molded against the Node.js
2400
- * `EventEmitter` interface.
2401
- *
2402
- * @constructor
2403
- * @public
2404
- */
2405
- function EventEmitter() {
2406
- this._events = new Events();
2407
- this._eventsCount = 0;
2408
- }
2409
-
2410
- /**
2411
- * Return an array listing the events for which the emitter has registered
2412
- * listeners.
2413
- *
2414
- * @returns {Array}
2415
- * @public
2416
- */
2417
- EventEmitter.prototype.eventNames = function eventNames() {
2418
- var names = []
2419
- , events
2420
- , name;
2421
-
2422
- if (this._eventsCount === 0) return names;
2423
-
2424
- for (name in (events = this._events)) {
2425
- if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
2426
- }
2427
-
2428
- if (Object.getOwnPropertySymbols) {
2429
- return names.concat(Object.getOwnPropertySymbols(events));
2430
- }
2431
-
2432
- return names;
2433
- };
2434
-
2435
- /**
2436
- * Return the listeners registered for a given event.
2437
- *
2438
- * @param {(String|Symbol)} event The event name.
2439
- * @returns {Array} The registered listeners.
2440
- * @public
2441
- */
2442
- EventEmitter.prototype.listeners = function listeners(event) {
2443
- var evt = prefix ? prefix + event : event
2444
- , handlers = this._events[evt];
2445
-
2446
- if (!handlers) return [];
2447
- if (handlers.fn) return [handlers.fn];
2448
-
2449
- for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
2450
- ee[i] = handlers[i].fn;
2451
- }
2452
-
2453
- return ee;
2454
- };
2455
-
2456
- /**
2457
- * Return the number of listeners listening to a given event.
2458
- *
2459
- * @param {(String|Symbol)} event The event name.
2460
- * @returns {Number} The number of listeners.
2461
- * @public
2462
- */
2463
- EventEmitter.prototype.listenerCount = function listenerCount(event) {
2464
- var evt = prefix ? prefix + event : event
2465
- , listeners = this._events[evt];
2466
-
2467
- if (!listeners) return 0;
2468
- if (listeners.fn) return 1;
2469
- return listeners.length;
2470
- };
2471
-
2472
- /**
2473
- * Calls each of the listeners registered for a given event.
2474
- *
2475
- * @param {(String|Symbol)} event The event name.
2476
- * @returns {Boolean} `true` if the event had listeners, else `false`.
2477
- * @public
2478
- */
2479
- EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
2480
- var evt = prefix ? prefix + event : event;
2481
-
2482
- if (!this._events[evt]) return false;
2483
-
2484
- var listeners = this._events[evt]
2485
- , len = arguments.length
2486
- , args
2487
- , i;
2488
-
2489
- if (listeners.fn) {
2490
- if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
2491
-
2492
- switch (len) {
2493
- case 1: return listeners.fn.call(listeners.context), true;
2494
- case 2: return listeners.fn.call(listeners.context, a1), true;
2495
- case 3: return listeners.fn.call(listeners.context, a1, a2), true;
2496
- case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
2497
- case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
2498
- case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
2499
- }
2500
-
2501
- for (i = 1, args = new Array(len -1); i < len; i++) {
2502
- args[i - 1] = arguments[i];
2503
- }
2504
-
2505
- listeners.fn.apply(listeners.context, args);
2506
- } else {
2507
- var length = listeners.length
2508
- , j;
2509
-
2510
- for (i = 0; i < length; i++) {
2511
- if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
2512
-
2513
- switch (len) {
2514
- case 1: listeners[i].fn.call(listeners[i].context); break;
2515
- case 2: listeners[i].fn.call(listeners[i].context, a1); break;
2516
- case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
2517
- case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
2518
- default:
2519
- if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
2520
- args[j - 1] = arguments[j];
2521
- }
2522
-
2523
- listeners[i].fn.apply(listeners[i].context, args);
2524
- }
2525
- }
2526
- }
2527
-
2528
- return true;
2529
- };
2530
-
2531
- /**
2532
- * Add a listener for a given event.
2533
- *
2534
- * @param {(String|Symbol)} event The event name.
2535
- * @param {Function} fn The listener function.
2536
- * @param {*} [context=this] The context to invoke the listener with.
2537
- * @returns {EventEmitter} `this`.
2538
- * @public
2539
- */
2540
- EventEmitter.prototype.on = function on(event, fn, context) {
2541
- return addListener(this, event, fn, context, false);
2542
- };
2543
-
2544
- /**
2545
- * Add a one-time listener for a given event.
2546
- *
2547
- * @param {(String|Symbol)} event The event name.
2548
- * @param {Function} fn The listener function.
2549
- * @param {*} [context=this] The context to invoke the listener with.
2550
- * @returns {EventEmitter} `this`.
2551
- * @public
2552
- */
2553
- EventEmitter.prototype.once = function once(event, fn, context) {
2554
- return addListener(this, event, fn, context, true);
2555
- };
2556
-
2557
- /**
2558
- * Remove the listeners of a given event.
2559
- *
2560
- * @param {(String|Symbol)} event The event name.
2561
- * @param {Function} fn Only remove the listeners that match this function.
2562
- * @param {*} context Only remove the listeners that have this context.
2563
- * @param {Boolean} once Only remove one-time listeners.
2564
- * @returns {EventEmitter} `this`.
2565
- * @public
2566
- */
2567
- EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
2568
- var evt = prefix ? prefix + event : event;
2569
-
2570
- if (!this._events[evt]) return this;
2571
- if (!fn) {
2572
- clearEvent(this, evt);
2573
- return this;
2574
- }
2575
-
2576
- var listeners = this._events[evt];
2577
-
2578
- if (listeners.fn) {
2579
- if (
2580
- listeners.fn === fn &&
2581
- (!once || listeners.once) &&
2582
- (!context || listeners.context === context)
2583
- ) {
2584
- clearEvent(this, evt);
2585
- }
2586
- } else {
2587
- for (var i = 0, events = [], length = listeners.length; i < length; i++) {
2588
- if (
2589
- listeners[i].fn !== fn ||
2590
- (once && !listeners[i].once) ||
2591
- (context && listeners[i].context !== context)
2592
- ) {
2593
- events.push(listeners[i]);
2594
- }
2595
- }
2596
-
2597
- //
2598
- // Reset the array, or remove it completely if we have no more listeners.
2599
- //
2600
- if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
2601
- else clearEvent(this, evt);
2602
- }
2603
-
2604
- return this;
2605
- };
2606
-
2607
- /**
2608
- * Remove all listeners, or those of the specified event.
2609
- *
2610
- * @param {(String|Symbol)} [event] The event name.
2611
- * @returns {EventEmitter} `this`.
2612
- * @public
2613
- */
2614
- EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
2615
- var evt;
2616
-
2617
- if (event) {
2618
- evt = prefix ? prefix + event : event;
2619
- if (this._events[evt]) clearEvent(this, evt);
2620
- } else {
2621
- this._events = new Events();
2622
- this._eventsCount = 0;
2623
- }
2624
-
2625
- return this;
2626
- };
2627
-
2628
- //
2629
- // Alias methods names because people roll like that.
2630
- //
2631
- EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
2632
- EventEmitter.prototype.addListener = EventEmitter.prototype.on;
2633
-
2634
- //
2635
- // Expose the prefix.
2636
- //
2637
- EventEmitter.prefixed = prefix;
2638
-
2639
- //
2640
- // Allow `EventEmitter` to be imported as module namespace.
2641
- //
2642
- EventEmitter.EventEmitter = EventEmitter;
2643
-
2644
- //
2645
- // Expose the module.
2646
- //
2647
- {
2648
- module.exports = EventEmitter;
2649
- }
2650
- });
2651
-
2652
- var EventEmitter = eventemitter3;
2653
-
2654
- var Transform = (function (_super) {
2655
- __extends(Transform, _super);
2656
- function Transform(_a) {
2657
- var system = _a.system, containerManager = _a.containerManager;
2658
- var _this = _super.call(this) || this;
2659
- _this.name = 'Transform';
2660
- _this.waitRemoveIds = [];
2661
- _this.waitChangeScenes = [];
2662
- _this.containerManager = containerManager;
2663
- _this.init(system);
2664
- return _this;
2665
- }
2666
- Transform.prototype.init = function (system) {
2667
- var _this = this;
2668
- this.system = system;
2669
- this.on('changeScene', function (_a) {
2670
- var scene = _a.scene, mode = _a.mode, application = _a.application;
2671
- _this.waitChangeScenes.push({ scene: scene, mode: mode, application: application });
2672
- });
2673
- };
2674
- Transform.prototype.update = function () {
2675
- var e_1, _a, e_2, _b;
2676
- try {
2677
- for (var _c = __values(this.waitRemoveIds), _d = _c.next(); !_d.done; _d = _c.next()) {
2678
- var id = _d.value;
2679
- this.containerManager.removeContainer(id);
2680
- }
2681
- }
2682
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
2683
- finally {
2684
- try {
2685
- if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
2686
- }
2687
- finally { if (e_1) throw e_1.error; }
2688
- }
2689
- this.waitRemoveIds = [];
2690
- try {
2691
- for (var _e = __values(this.waitChangeScenes), _f = _e.next(); !_f.done; _f = _e.next()) {
2692
- var sceneInfo = _f.value;
2693
- var container = this.containerManager.getContainer(sceneInfo.scene.id);
2694
- if (container) {
2695
- sceneInfo.application.stage.removeChildren();
2696
- sceneInfo.application.stage.addChild(container);
2697
- }
2698
- }
2699
- }
2700
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
2701
- finally {
2702
- try {
2703
- if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
2704
- }
2705
- finally { if (e_2) throw e_2.error; }
2706
- }
2707
- this.waitChangeScenes = [];
2708
- };
2709
- Transform.prototype.componentChanged = function (changed) {
2710
- if (changed.type === eva_js.OBSERVER_TYPE.ADD) {
2711
- this.addContainer(changed);
2712
- }
2713
- else if (changed.type === eva_js.OBSERVER_TYPE.CHANGE) {
2714
- this.change(changed);
2715
- }
2716
- else if (changed.type === eva_js.OBSERVER_TYPE.REMOVE) {
2717
- this.waitRemoveIds.push(changed.gameObject.id);
2718
- }
2719
- };
2720
- Transform.prototype.addContainer = function (changed) {
2721
- var container = new rendererAdapter.Container();
2722
- container.name = changed.gameObject.name;
2723
- this.containerManager.addContainer({
2724
- name: changed.gameObject.id,
2725
- container: container,
2726
- });
2727
- var transform = changed.component;
2728
- transform.worldTransform = container.transform.worldTransform;
2729
- };
2730
- Transform.prototype.change = function (changed) {
2731
- var transform = changed.component;
2732
- if (transform.parent) {
2733
- var parentContainer = this.containerManager.getContainer(transform.parent.gameObject.id);
2734
- parentContainer.addChild(this.containerManager.getContainer(changed.gameObject.id));
2735
- var render = changed.gameObject.transform.parent &&
2736
- changed.gameObject.transform.parent.gameObject.getComponent('Render');
2737
- if (render) {
2738
- render.sortDirty = true;
2739
- }
2740
- }
2741
- else {
2742
- var container = this.containerManager.getContainer(changed.gameObject.id);
2743
- delete transform.worldTransform;
2744
- container.parent && container.parent.removeChild(container);
2745
- }
2746
- };
2747
- Transform.prototype.destroy = function () {
2748
- this.removeAllListeners();
2749
- this.waitRemoveIds = null;
2750
- this.waitChangeScenes = null;
2751
- this.system = null;
2752
- this.containerManager = null;
2753
- };
2754
- Transform = __decorate([
2755
- eva_js.decorators.componentObserver({
2756
- Transform: ['_parent'],
2757
- })
2758
- ], Transform);
2759
- return Transform;
2760
- }(EventEmitter));
2761
- var Transform$1 = Transform;
2762
-
2763
- exports.RENDERER_TYPE = void 0;
2764
- (function (RENDERER_TYPE) {
2765
- RENDERER_TYPE[RENDERER_TYPE["UNKNOWN"] = 0] = "UNKNOWN";
2766
- RENDERER_TYPE[RENDERER_TYPE["WEBGL"] = 1] = "WEBGL";
2767
- RENDERER_TYPE[RENDERER_TYPE["CANVAS"] = 2] = "CANVAS";
2768
- })(exports.RENDERER_TYPE || (exports.RENDERER_TYPE = {}));
2769
- var disableScroll = function (renderer) {
2770
- renderer.plugins.interaction.autoPreventDefault = true;
2771
- renderer.view.style.touchAction = 'none';
2772
- };
2773
- var enableScroll = function (renderer) {
2774
- renderer.plugins.interaction.autoPreventDefault = false;
2775
- renderer.view.style.touchAction = 'auto';
2776
- };
2777
- var Renderer$2 = (function (_super) {
2778
- __extends(Renderer, _super);
2779
- function Renderer() {
2780
- var _this = _super !== null && _super.apply(this, arguments) || this;
2781
- _this.multiApps = [];
2782
- return _this;
2783
- }
2784
- Renderer.prototype.init = function (params) {
2785
- var _this = this;
2786
- this.params = params;
2787
- this.application = this.createApplication(params);
2788
- this.containerManager = new ContainerManager$1();
2789
- this.rendererManager = new RendererManager$1({
2790
- game: this.game,
2791
- rendererSystem: this,
2792
- });
2793
- this.game.canvas = this.application.view;
2794
- this.transform = new Transform$1({
2795
- system: this,
2796
- containerManager: this.containerManager,
2797
- });
2798
- this.game.on('sceneChanged', function (_a) {
2799
- var scene = _a.scene, mode = _a.mode, params = _a.params;
2800
- var application;
2801
- switch (mode) {
2802
- case eva_js.LOAD_SCENE_MODE.SINGLE:
2803
- application = _this.application;
2804
- break;
2805
- case eva_js.LOAD_SCENE_MODE.MULTI_CANVAS:
2806
- application = _this.createMultiApplication({ params: params });
2807
- break;
2808
- }
2809
- scene.canvas = application.view;
2810
- _this.transform.emit('changeScene', {
2811
- scene: scene,
2812
- mode: mode,
2813
- application: application,
2814
- });
2815
- });
2816
- };
2817
- Renderer.prototype.registerObserver = function (observerInfo) {
2818
- var _a;
2819
- var thisObserverInfo = this.constructor.observerInfo;
2820
- for (var key in observerInfo) {
2821
- if (!thisObserverInfo[key]) {
2822
- thisObserverInfo[key] = [];
2823
- }
2824
- (_a = thisObserverInfo[key]).push.apply(_a, __spread(observerInfo[key]));
2825
- }
2826
- };
2827
- Renderer.prototype.createMultiApplication = function (_a) {
2828
- var params = _a.params;
2829
- var app = this.createApplication(params);
2830
- this.multiApps.push(app);
2831
- return app;
2832
- };
2833
- Renderer.prototype.createApplication = function (params) {
2834
- params.view = params.canvas;
2835
- if (params.renderType === exports.RENDERER_TYPE.CANVAS) {
2836
- params.forceCanvas = true;
2837
- }
2838
- pixi_js.ticker.shared.autoStart = false;
2839
- pixi_js.ticker.shared.stop();
2840
- var app = new rendererAdapter.Application(__assign({ sharedTicker: true }, params));
2841
- if (params.preventScroll !== undefined) {
2842
- console.warn('PreventScroll property will deprecate at next major version, please use enableEnable instead. https://eva.js.org/#/tutorials/game');
2843
- params.preventScroll ? enableScroll(app.renderer) : disableScroll(app.renderer);
2844
- }
2845
- if (params.enableScroll !== undefined) {
2846
- params.enableScroll ? enableScroll(app.renderer) : disableScroll(app.renderer);
2847
- }
2848
- if (params.preventScroll === undefined && params.enableScroll === undefined) {
2849
- enableScroll(app.renderer);
2850
- }
2851
- return app;
2852
- };
2853
- Renderer.prototype.update = function () {
2854
- var e_1, _a, e_2, _b;
2855
- var changes = this.componentObserver.clear();
2856
- try {
2857
- for (var changes_1 = __values(changes), changes_1_1 = changes_1.next(); !changes_1_1.done; changes_1_1 = changes_1.next()) {
2858
- var changed = changes_1_1.value;
2859
- this.transform.componentChanged(changed);
2860
- }
2861
- }
2862
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
2863
- finally {
2864
- try {
2865
- if (changes_1_1 && !changes_1_1.done && (_a = changes_1.return)) _a.call(changes_1);
2866
- }
2867
- finally { if (e_1) throw e_1.error; }
2868
- }
2869
- try {
2870
- for (var _c = __values(this.game.gameObjects), _d = _c.next(); !_d.done; _d = _c.next()) {
2871
- var gameObject = _d.value;
2872
- this.containerManager.updateTransform({
2873
- name: gameObject.id,
2874
- transform: gameObject.transform,
2875
- });
2876
- this.rendererManager.update(gameObject);
2877
- }
2878
- }
2879
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
2880
- finally {
2881
- try {
2882
- if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
2883
- }
2884
- finally { if (e_2) throw e_2.error; }
2885
- }
2886
- };
2887
- Renderer.prototype.lateUpdate = function (e) {
2888
- this.transform.update();
2889
- this.application.ticker.update(e.time);
2890
- };
2891
- Renderer.prototype.onDestroy = function () {
2892
- var e_3, _a;
2893
- this.application.destroy();
2894
- try {
2895
- for (var _b = __values(this.multiApps), _c = _b.next(); !_c.done; _c = _b.next()) {
2896
- var app = _c.value;
2897
- app && app.destroy();
2898
- }
2899
- }
2900
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
2901
- finally {
2902
- try {
2903
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
2904
- }
2905
- finally { if (e_3) throw e_3.error; }
2906
- }
2907
- this.transform.destroy();
2908
- this.transform = null;
2909
- this.params = null;
2910
- this.rendererManager = null;
2911
- this.containerManager = null;
2912
- this.application = null;
2913
- this.game = null;
2914
- this.multiApps = null;
2915
- };
2916
- Renderer.prototype.resize = function (width, height) {
2917
- this.params.width = width;
2918
- this.params.height = height;
2919
- this.application.renderer.resize(width, height);
2920
- };
2921
- Renderer.systemName = 'Renderer';
2922
- Renderer = __decorate([
2923
- eva_js.decorators.componentObserver({
2924
- Transform: ['_parent'],
2925
- })
2926
- ], Renderer);
2927
- return Renderer;
2928
- }(eva_js.System));
2929
- var Renderer$3 = Renderer$2;
2930
-
2931
- var Renderer = (function (_super) {
2932
- __extends(Renderer, _super);
2933
- function Renderer(params) {
2934
- var _this = _super.call(this, params) || this;
2935
- _this.observerInfo = _this.constructor.observerInfo;
2936
- return _this;
2937
- }
2938
- Renderer.prototype.componentChanged = function (_changed) { };
2939
- Renderer.prototype.rendererUpdate = function (_gameObject) { };
2940
- Renderer.prototype.update = function () {
2941
- var e_1, _a;
2942
- var changes = this.componentObserver.clear();
2943
- try {
2944
- for (var changes_1 = __values(changes), changes_1_1 = changes_1.next(); !changes_1_1.done; changes_1_1 = changes_1.next()) {
2945
- var changed = changes_1_1.value;
2946
- this.componentChanged(changed);
2947
- }
2948
- }
2949
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
2950
- finally {
2951
- try {
2952
- if (changes_1_1 && !changes_1_1.done && (_a = changes_1.return)) _a.call(changes_1);
2953
- }
2954
- finally { if (e_1) throw e_1.error; }
2955
- }
2956
- };
2957
- return Renderer;
2958
- }(eva_js.System));
2959
- var Renderer$1 = Renderer;
2960
-
2961
- exports.ContainerManager = ContainerManager$1;
2962
- exports.Renderer = Renderer$1;
2963
- exports.RendererManager = RendererManager$1;
2964
- exports.RendererSystem = Renderer$3;
2965
-
2966
- Object.defineProperty(exports, '__esModule', { value: true });
2967
-
2968
- })));