UNPKG

392 kBJavaScriptView Raw
1/**
2 * vis-data
3 * http://visjs.org/
4 *
5 * Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data.
6 *
7 * @version 7.1.4
8 * @date 2022-03-15T15:26:16.016Z
9 *
10 * @copyright (c) 2011-2017 Almende B.V, http://almende.com
11 * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
12 *
13 * @license
14 * vis.js is dual licensed under both
15 *
16 * 1. The Apache 2.0 License
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * and
20 *
21 * 2. The MIT License
22 * http://opensource.org/licenses/MIT
23 *
24 * vis.js may be distributed under either license.
25 */
26
27(function (global, factory) {
28 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
29 typeof define === 'function' && define.amd ? define(['exports'], factory) :
30 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.vis = global.vis || {}));
31})(this, (function (exports) { 'use strict';
32
33 function _classCallCheck(instance, Constructor) {
34 if (!(instance instanceof Constructor)) {
35 throw new TypeError("Cannot call a class as a function");
36 }
37 }
38
39 var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
40
41 var defineProperty$e = {exports: {}};
42
43 var check = function (it) {
44 return it && it.Math == Math && it;
45 }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
46
47
48 var global$M = // eslint-disable-next-line es/no-global-this -- safe
49 check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || // eslint-disable-next-line no-restricted-globals -- safe
50 check(typeof self == 'object' && self) || check(typeof commonjsGlobal == 'object' && commonjsGlobal) || // eslint-disable-next-line no-new-func -- fallback
51 function () {
52 return this;
53 }() || Function('return this')();
54
55 var fails$r = function (exec) {
56 try {
57 return !!exec();
58 } catch (error) {
59 return true;
60 }
61 };
62
63 var fails$q = fails$r;
64 var functionBindNative = !fails$q(function () {
65 var test = function () {
66 /* empty */
67 }.bind(); // eslint-disable-next-line no-prototype-builtins -- safe
68
69
70 return typeof test != 'function' || test.hasOwnProperty('prototype');
71 });
72
73 var NATIVE_BIND$4 = functionBindNative;
74 var FunctionPrototype$3 = Function.prototype;
75 var apply$6 = FunctionPrototype$3.apply;
76 var call$c = FunctionPrototype$3.call; // eslint-disable-next-line es/no-reflect -- safe
77
78 var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$4 ? call$c.bind(apply$6) : function () {
79 return call$c.apply(apply$6, arguments);
80 });
81
82 var NATIVE_BIND$3 = functionBindNative;
83 var FunctionPrototype$2 = Function.prototype;
84 var bind$d = FunctionPrototype$2.bind;
85 var call$b = FunctionPrototype$2.call;
86 var uncurryThis$t = NATIVE_BIND$3 && bind$d.bind(call$b, call$b);
87 var functionUncurryThis = NATIVE_BIND$3 ? function (fn) {
88 return fn && uncurryThis$t(fn);
89 } : function (fn) {
90 return fn && function () {
91 return call$b.apply(fn, arguments);
92 };
93 };
94
95 // https://tc39.es/ecma262/#sec-iscallable
96
97 var isCallable$h = function (argument) {
98 return typeof argument == 'function';
99 };
100
101 var objectGetOwnPropertyDescriptor = {};
102
103 var fails$p = fails$r; // Detect IE8's incomplete defineProperty implementation
104
105 var descriptors = !fails$p(function () {
106 // eslint-disable-next-line es/no-object-defineproperty -- required for testing
107 return Object.defineProperty({}, 1, {
108 get: function () {
109 return 7;
110 }
111 })[1] != 7;
112 });
113
114 var NATIVE_BIND$2 = functionBindNative;
115 var call$a = Function.prototype.call;
116 var functionCall = NATIVE_BIND$2 ? call$a.bind(call$a) : function () {
117 return call$a.apply(call$a, arguments);
118 };
119
120 var objectPropertyIsEnumerable = {};
121
122 var $propertyIsEnumerable$2 = {}.propertyIsEnumerable; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
123
124 var getOwnPropertyDescriptor$5 = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug
125
126 var NASHORN_BUG = getOwnPropertyDescriptor$5 && !$propertyIsEnumerable$2.call({
127 1: 2
128 }, 1); // `Object.prototype.propertyIsEnumerable` method implementation
129 // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
130
131 objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
132 var descriptor = getOwnPropertyDescriptor$5(this, V);
133 return !!descriptor && descriptor.enumerable;
134 } : $propertyIsEnumerable$2;
135
136 var createPropertyDescriptor$5 = function (bitmap, value) {
137 return {
138 enumerable: !(bitmap & 1),
139 configurable: !(bitmap & 2),
140 writable: !(bitmap & 4),
141 value: value
142 };
143 };
144
145 var uncurryThis$s = functionUncurryThis;
146 var toString$9 = uncurryThis$s({}.toString);
147 var stringSlice$1 = uncurryThis$s(''.slice);
148
149 var classofRaw$1 = function (it) {
150 return stringSlice$1(toString$9(it), 8, -1);
151 };
152
153 var global$L = global$M;
154 var uncurryThis$r = functionUncurryThis;
155 var fails$o = fails$r;
156 var classof$f = classofRaw$1;
157 var Object$9 = global$L.Object;
158 var split = uncurryThis$r(''.split); // fallback for non-array-like ES3 and non-enumerable old V8 strings
159
160 var indexedObject = fails$o(function () {
161 // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
162 // eslint-disable-next-line no-prototype-builtins -- safe
163 return !Object$9('z').propertyIsEnumerable(0);
164 }) ? function (it) {
165 return classof$f(it) == 'String' ? split(it, '') : Object$9(it);
166 } : Object$9;
167
168 var global$K = global$M;
169 var TypeError$j = global$K.TypeError; // `RequireObjectCoercible` abstract operation
170 // https://tc39.es/ecma262/#sec-requireobjectcoercible
171
172 var requireObjectCoercible$5 = function (it) {
173 if (it == undefined) throw TypeError$j("Can't call method on " + it);
174 return it;
175 };
176
177 var IndexedObject$3 = indexedObject;
178 var requireObjectCoercible$4 = requireObjectCoercible$5;
179
180 var toIndexedObject$b = function (it) {
181 return IndexedObject$3(requireObjectCoercible$4(it));
182 };
183
184 var isCallable$g = isCallable$h;
185
186 var isObject$f = function (it) {
187 return typeof it == 'object' ? it !== null : isCallable$g(it);
188 };
189
190 var path$q = {};
191
192 var path$p = path$q;
193 var global$J = global$M;
194 var isCallable$f = isCallable$h;
195
196 var aFunction = function (variable) {
197 return isCallable$f(variable) ? variable : undefined;
198 };
199
200 var getBuiltIn$9 = function (namespace, method) {
201 return arguments.length < 2 ? aFunction(path$p[namespace]) || aFunction(global$J[namespace]) : path$p[namespace] && path$p[namespace][method] || global$J[namespace] && global$J[namespace][method];
202 };
203
204 var uncurryThis$q = functionUncurryThis;
205 var objectIsPrototypeOf = uncurryThis$q({}.isPrototypeOf);
206
207 var getBuiltIn$8 = getBuiltIn$9;
208 var engineUserAgent = getBuiltIn$8('navigator', 'userAgent') || '';
209
210 var global$I = global$M;
211 var userAgent$3 = engineUserAgent;
212 var process = global$I.process;
213 var Deno = global$I.Deno;
214 var versions = process && process.versions || Deno && Deno.version;
215 var v8 = versions && versions.v8;
216 var match, version;
217
218 if (v8) {
219 match = v8.split('.'); // in old Chrome, versions of V8 isn't V8 = Chrome / 10
220 // but their correct versions are not interesting for us
221
222 version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
223 } // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
224 // so check `userAgent` even if `.v8` exists, but 0
225
226
227 if (!version && userAgent$3) {
228 match = userAgent$3.match(/Edge\/(\d+)/);
229
230 if (!match || match[1] >= 74) {
231 match = userAgent$3.match(/Chrome\/(\d+)/);
232 if (match) version = +match[1];
233 }
234 }
235
236 var engineV8Version = version;
237
238 /* eslint-disable es/no-symbol -- required for testing */
239 var V8_VERSION$2 = engineV8Version;
240 var fails$n = fails$r; // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
241
242 var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$n(function () {
243 var symbol = Symbol(); // Chrome 38 Symbol has incorrect toString conversion
244 // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
245
246 return !String(symbol) || !(Object(symbol) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
247 !Symbol.sham && V8_VERSION$2 && V8_VERSION$2 < 41;
248 });
249
250 /* eslint-disable es/no-symbol -- required for testing */
251 var NATIVE_SYMBOL$2 = nativeSymbol;
252 var useSymbolAsUid = NATIVE_SYMBOL$2 && !Symbol.sham && typeof Symbol.iterator == 'symbol';
253
254 var global$H = global$M;
255 var getBuiltIn$7 = getBuiltIn$9;
256 var isCallable$e = isCallable$h;
257 var isPrototypeOf$i = objectIsPrototypeOf;
258 var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
259 var Object$8 = global$H.Object;
260 var isSymbol$3 = USE_SYMBOL_AS_UID$1 ? function (it) {
261 return typeof it == 'symbol';
262 } : function (it) {
263 var $Symbol = getBuiltIn$7('Symbol');
264 return isCallable$e($Symbol) && isPrototypeOf$i($Symbol.prototype, Object$8(it));
265 };
266
267 var global$G = global$M;
268 var String$4 = global$G.String;
269
270 var tryToString$4 = function (argument) {
271 try {
272 return String$4(argument);
273 } catch (error) {
274 return 'Object';
275 }
276 };
277
278 var global$F = global$M;
279 var isCallable$d = isCallable$h;
280 var tryToString$3 = tryToString$4;
281 var TypeError$i = global$F.TypeError; // `Assert: IsCallable(argument) is true`
282
283 var aCallable$7 = function (argument) {
284 if (isCallable$d(argument)) return argument;
285 throw TypeError$i(tryToString$3(argument) + ' is not a function');
286 };
287
288 var aCallable$6 = aCallable$7; // `GetMethod` abstract operation
289 // https://tc39.es/ecma262/#sec-getmethod
290
291 var getMethod$3 = function (V, P) {
292 var func = V[P];
293 return func == null ? undefined : aCallable$6(func);
294 };
295
296 var global$E = global$M;
297 var call$9 = functionCall;
298 var isCallable$c = isCallable$h;
299 var isObject$e = isObject$f;
300 var TypeError$h = global$E.TypeError; // `OrdinaryToPrimitive` abstract operation
301 // https://tc39.es/ecma262/#sec-ordinarytoprimitive
302
303 var ordinaryToPrimitive$1 = function (input, pref) {
304 var fn, val;
305 if (pref === 'string' && isCallable$c(fn = input.toString) && !isObject$e(val = call$9(fn, input))) return val;
306 if (isCallable$c(fn = input.valueOf) && !isObject$e(val = call$9(fn, input))) return val;
307 if (pref !== 'string' && isCallable$c(fn = input.toString) && !isObject$e(val = call$9(fn, input))) return val;
308 throw TypeError$h("Can't convert object to primitive value");
309 };
310
311 var shared$4 = {exports: {}};
312
313 var global$D = global$M; // eslint-disable-next-line es/no-object-defineproperty -- safe
314
315 var defineProperty$d = Object.defineProperty;
316
317 var setGlobal$1 = function (key, value) {
318 try {
319 defineProperty$d(global$D, key, {
320 value: value,
321 configurable: true,
322 writable: true
323 });
324 } catch (error) {
325 global$D[key] = value;
326 }
327
328 return value;
329 };
330
331 var global$C = global$M;
332 var setGlobal = setGlobal$1;
333 var SHARED = '__core-js_shared__';
334 var store$3 = global$C[SHARED] || setGlobal(SHARED, {});
335 var sharedStore = store$3;
336
337 var store$2 = sharedStore;
338 (shared$4.exports = function (key, value) {
339 return store$2[key] || (store$2[key] = value !== undefined ? value : {});
340 })('versions', []).push({
341 version: '3.21.1',
342 mode: 'pure' ,
343 copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
344 license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',
345 source: 'https://github.com/zloirock/core-js'
346 });
347
348 var global$B = global$M;
349 var requireObjectCoercible$3 = requireObjectCoercible$5;
350 var Object$7 = global$B.Object; // `ToObject` abstract operation
351 // https://tc39.es/ecma262/#sec-toobject
352
353 var toObject$e = function (argument) {
354 return Object$7(requireObjectCoercible$3(argument));
355 };
356
357 var uncurryThis$p = functionUncurryThis;
358 var toObject$d = toObject$e;
359 var hasOwnProperty = uncurryThis$p({}.hasOwnProperty); // `HasOwnProperty` abstract operation
360 // https://tc39.es/ecma262/#sec-hasownproperty
361
362 var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
363 return hasOwnProperty(toObject$d(it), key);
364 };
365
366 var uncurryThis$o = functionUncurryThis;
367 var id$1 = 0;
368 var postfix = Math.random();
369 var toString$8 = uncurryThis$o(1.0.toString);
370
371 var uid$4 = function (key) {
372 return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$8(++id$1 + postfix, 36);
373 };
374
375 var global$A = global$M;
376 var shared$3 = shared$4.exports;
377 var hasOwn$f = hasOwnProperty_1;
378 var uid$3 = uid$4;
379 var NATIVE_SYMBOL$1 = nativeSymbol;
380 var USE_SYMBOL_AS_UID = useSymbolAsUid;
381 var WellKnownSymbolsStore$1 = shared$3('wks');
382 var Symbol$2 = global$A.Symbol;
383 var symbolFor = Symbol$2 && Symbol$2['for'];
384 var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$2 : Symbol$2 && Symbol$2.withoutSetter || uid$3;
385
386 var wellKnownSymbol$j = function (name) {
387 if (!hasOwn$f(WellKnownSymbolsStore$1, name) || !(NATIVE_SYMBOL$1 || typeof WellKnownSymbolsStore$1[name] == 'string')) {
388 var description = 'Symbol.' + name;
389
390 if (NATIVE_SYMBOL$1 && hasOwn$f(Symbol$2, name)) {
391 WellKnownSymbolsStore$1[name] = Symbol$2[name];
392 } else if (USE_SYMBOL_AS_UID && symbolFor) {
393 WellKnownSymbolsStore$1[name] = symbolFor(description);
394 } else {
395 WellKnownSymbolsStore$1[name] = createWellKnownSymbol(description);
396 }
397 }
398
399 return WellKnownSymbolsStore$1[name];
400 };
401
402 var global$z = global$M;
403 var call$8 = functionCall;
404 var isObject$d = isObject$f;
405 var isSymbol$2 = isSymbol$3;
406 var getMethod$2 = getMethod$3;
407 var ordinaryToPrimitive = ordinaryToPrimitive$1;
408 var wellKnownSymbol$i = wellKnownSymbol$j;
409 var TypeError$g = global$z.TypeError;
410 var TO_PRIMITIVE$1 = wellKnownSymbol$i('toPrimitive'); // `ToPrimitive` abstract operation
411 // https://tc39.es/ecma262/#sec-toprimitive
412
413 var toPrimitive$1 = function (input, pref) {
414 if (!isObject$d(input) || isSymbol$2(input)) return input;
415 var exoticToPrim = getMethod$2(input, TO_PRIMITIVE$1);
416 var result;
417
418 if (exoticToPrim) {
419 if (pref === undefined) pref = 'default';
420 result = call$8(exoticToPrim, input, pref);
421 if (!isObject$d(result) || isSymbol$2(result)) return result;
422 throw TypeError$g("Can't convert object to primitive value");
423 }
424
425 if (pref === undefined) pref = 'number';
426 return ordinaryToPrimitive(input, pref);
427 };
428
429 var toPrimitive = toPrimitive$1;
430 var isSymbol$1 = isSymbol$3; // `ToPropertyKey` abstract operation
431 // https://tc39.es/ecma262/#sec-topropertykey
432
433 var toPropertyKey$4 = function (argument) {
434 var key = toPrimitive(argument, 'string');
435 return isSymbol$1(key) ? key : key + '';
436 };
437
438 var global$y = global$M;
439 var isObject$c = isObject$f;
440 var document$1 = global$y.document; // typeof document.createElement is 'object' in old IE
441
442 var EXISTS$1 = isObject$c(document$1) && isObject$c(document$1.createElement);
443
444 var documentCreateElement$1 = function (it) {
445 return EXISTS$1 ? document$1.createElement(it) : {};
446 };
447
448 var DESCRIPTORS$h = descriptors;
449 var fails$m = fails$r;
450 var createElement = documentCreateElement$1; // Thanks to IE8 for its funny defineProperty
451
452 var ie8DomDefine = !DESCRIPTORS$h && !fails$m(function () {
453 // eslint-disable-next-line es/no-object-defineproperty -- required for testing
454 return Object.defineProperty(createElement('div'), 'a', {
455 get: function () {
456 return 7;
457 }
458 }).a != 7;
459 });
460
461 var DESCRIPTORS$g = descriptors;
462 var call$7 = functionCall;
463 var propertyIsEnumerableModule$2 = objectPropertyIsEnumerable;
464 var createPropertyDescriptor$4 = createPropertyDescriptor$5;
465 var toIndexedObject$a = toIndexedObject$b;
466 var toPropertyKey$3 = toPropertyKey$4;
467 var hasOwn$e = hasOwnProperty_1;
468 var IE8_DOM_DEFINE$1 = ie8DomDefine; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
469
470 var $getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method
471 // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
472
473 objectGetOwnPropertyDescriptor.f = DESCRIPTORS$g ? $getOwnPropertyDescriptor$2 : function getOwnPropertyDescriptor(O, P) {
474 O = toIndexedObject$a(O);
475 P = toPropertyKey$3(P);
476 if (IE8_DOM_DEFINE$1) try {
477 return $getOwnPropertyDescriptor$2(O, P);
478 } catch (error) {
479 /* empty */
480 }
481 if (hasOwn$e(O, P)) return createPropertyDescriptor$4(!call$7(propertyIsEnumerableModule$2.f, O, P), O[P]);
482 };
483
484 var fails$l = fails$r;
485 var isCallable$b = isCallable$h;
486 var replacement = /#|\.prototype\./;
487
488 var isForced$1 = function (feature, detection) {
489 var value = data[normalize(feature)];
490 return value == POLYFILL ? true : value == NATIVE ? false : isCallable$b(detection) ? fails$l(detection) : !!detection;
491 };
492
493 var normalize = isForced$1.normalize = function (string) {
494 return String(string).replace(replacement, '.').toLowerCase();
495 };
496
497 var data = isForced$1.data = {};
498 var NATIVE = isForced$1.NATIVE = 'N';
499 var POLYFILL = isForced$1.POLYFILL = 'P';
500 var isForced_1 = isForced$1;
501
502 var uncurryThis$n = functionUncurryThis;
503 var aCallable$5 = aCallable$7;
504 var NATIVE_BIND$1 = functionBindNative;
505 var bind$c = uncurryThis$n(uncurryThis$n.bind); // optional / simple context binding
506
507 var functionBindContext = function (fn, that) {
508 aCallable$5(fn);
509 return that === undefined ? fn : NATIVE_BIND$1 ? bind$c(fn, that) : function
510 /* ...args */
511 () {
512 return fn.apply(that, arguments);
513 };
514 };
515
516 var objectDefineProperty = {};
517
518 var DESCRIPTORS$f = descriptors;
519 var fails$k = fails$r; // V8 ~ Chrome 36-
520 // https://bugs.chromium.org/p/v8/issues/detail?id=3334
521
522 var v8PrototypeDefineBug = DESCRIPTORS$f && fails$k(function () {
523 // eslint-disable-next-line es/no-object-defineproperty -- required for testing
524 return Object.defineProperty(function () {
525 /* empty */
526 }, 'prototype', {
527 value: 42,
528 writable: false
529 }).prototype != 42;
530 });
531
532 var global$x = global$M;
533 var isObject$b = isObject$f;
534 var String$3 = global$x.String;
535 var TypeError$f = global$x.TypeError; // `Assert: Type(argument) is Object`
536
537 var anObject$b = function (argument) {
538 if (isObject$b(argument)) return argument;
539 throw TypeError$f(String$3(argument) + ' is not an object');
540 };
541
542 var global$w = global$M;
543 var DESCRIPTORS$e = descriptors;
544 var IE8_DOM_DEFINE = ie8DomDefine;
545 var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
546 var anObject$a = anObject$b;
547 var toPropertyKey$2 = toPropertyKey$4;
548 var TypeError$e = global$w.TypeError; // eslint-disable-next-line es/no-object-defineproperty -- safe
549
550 var $defineProperty$1 = Object.defineProperty; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
551
552 var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
553 var ENUMERABLE = 'enumerable';
554 var CONFIGURABLE$1 = 'configurable';
555 var WRITABLE = 'writable'; // `Object.defineProperty` method
556 // https://tc39.es/ecma262/#sec-object.defineproperty
557
558 objectDefineProperty.f = DESCRIPTORS$e ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
559 anObject$a(O);
560 P = toPropertyKey$2(P);
561 anObject$a(Attributes);
562
563 if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
564 var current = $getOwnPropertyDescriptor$1(O, P);
565
566 if (current && current[WRITABLE]) {
567 O[P] = Attributes.value;
568 Attributes = {
569 configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
570 enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
571 writable: false
572 };
573 }
574 }
575
576 return $defineProperty$1(O, P, Attributes);
577 } : $defineProperty$1 : function defineProperty(O, P, Attributes) {
578 anObject$a(O);
579 P = toPropertyKey$2(P);
580 anObject$a(Attributes);
581 if (IE8_DOM_DEFINE) try {
582 return $defineProperty$1(O, P, Attributes);
583 } catch (error) {
584 /* empty */
585 }
586 if ('get' in Attributes || 'set' in Attributes) throw TypeError$e('Accessors not supported');
587 if ('value' in Attributes) O[P] = Attributes.value;
588 return O;
589 };
590
591 var DESCRIPTORS$d = descriptors;
592 var definePropertyModule$4 = objectDefineProperty;
593 var createPropertyDescriptor$3 = createPropertyDescriptor$5;
594 var createNonEnumerableProperty$6 = DESCRIPTORS$d ? function (object, key, value) {
595 return definePropertyModule$4.f(object, key, createPropertyDescriptor$3(1, value));
596 } : function (object, key, value) {
597 object[key] = value;
598 return object;
599 };
600
601 var global$v = global$M;
602 var apply$5 = functionApply;
603 var uncurryThis$m = functionUncurryThis;
604 var isCallable$a = isCallable$h;
605 var getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f;
606 var isForced = isForced_1;
607 var path$o = path$q;
608 var bind$b = functionBindContext;
609 var createNonEnumerableProperty$5 = createNonEnumerableProperty$6;
610 var hasOwn$d = hasOwnProperty_1;
611
612 var wrapConstructor = function (NativeConstructor) {
613 var Wrapper = function (a, b, c) {
614 if (this instanceof Wrapper) {
615 switch (arguments.length) {
616 case 0:
617 return new NativeConstructor();
618
619 case 1:
620 return new NativeConstructor(a);
621
622 case 2:
623 return new NativeConstructor(a, b);
624 }
625
626 return new NativeConstructor(a, b, c);
627 }
628
629 return apply$5(NativeConstructor, this, arguments);
630 };
631
632 Wrapper.prototype = NativeConstructor.prototype;
633 return Wrapper;
634 };
635 /*
636 options.target - name of the target object
637 options.global - target is the global object
638 options.stat - export as static methods of target
639 options.proto - export as prototype methods of target
640 options.real - real prototype method for the `pure` version
641 options.forced - export even if the native feature is available
642 options.bind - bind methods to the target, required for the `pure` version
643 options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
644 options.unsafe - use the simple assignment of property instead of delete + defineProperty
645 options.sham - add a flag to not completely full polyfills
646 options.enumerable - export as enumerable property
647 options.noTargetGet - prevent calling a getter on target
648 options.name - the .name of the function if it does not match the key
649 */
650
651
652 var _export = function (options, source) {
653 var TARGET = options.target;
654 var GLOBAL = options.global;
655 var STATIC = options.stat;
656 var PROTO = options.proto;
657 var nativeSource = GLOBAL ? global$v : STATIC ? global$v[TARGET] : (global$v[TARGET] || {}).prototype;
658 var target = GLOBAL ? path$o : path$o[TARGET] || createNonEnumerableProperty$5(path$o, TARGET, {})[TARGET];
659 var targetPrototype = target.prototype;
660 var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;
661 var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;
662
663 for (key in source) {
664 FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contains in native
665
666 USE_NATIVE = !FORCED && nativeSource && hasOwn$d(nativeSource, key);
667 targetProperty = target[key];
668 if (USE_NATIVE) if (options.noTargetGet) {
669 descriptor = getOwnPropertyDescriptor$4(nativeSource, key);
670 nativeProperty = descriptor && descriptor.value;
671 } else nativeProperty = nativeSource[key]; // export native or implementation
672
673 sourceProperty = USE_NATIVE && nativeProperty ? nativeProperty : source[key];
674 if (USE_NATIVE && typeof targetProperty == typeof sourceProperty) continue; // bind timers to global for call from export context
675
676 if (options.bind && USE_NATIVE) resultProperty = bind$b(sourceProperty, global$v); // wrap global constructors for prevent changs in this version
677 else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty); // make static versions for prototype methods
678 else if (PROTO && isCallable$a(sourceProperty)) resultProperty = uncurryThis$m(sourceProperty); // default case
679 else resultProperty = sourceProperty; // add a flag to not completely full polyfills
680
681 if (options.sham || sourceProperty && sourceProperty.sham || targetProperty && targetProperty.sham) {
682 createNonEnumerableProperty$5(resultProperty, 'sham', true);
683 }
684
685 createNonEnumerableProperty$5(target, key, resultProperty);
686
687 if (PROTO) {
688 VIRTUAL_PROTOTYPE = TARGET + 'Prototype';
689
690 if (!hasOwn$d(path$o, VIRTUAL_PROTOTYPE)) {
691 createNonEnumerableProperty$5(path$o, VIRTUAL_PROTOTYPE, {});
692 } // export virtual prototype methods
693
694
695 createNonEnumerableProperty$5(path$o[VIRTUAL_PROTOTYPE], key, sourceProperty); // export real prototype methods
696
697 if (options.real && targetPrototype && !targetPrototype[key]) {
698 createNonEnumerableProperty$5(targetPrototype, key, sourceProperty);
699 }
700 }
701 }
702 };
703
704 var $$C = _export;
705 var DESCRIPTORS$c = descriptors;
706 var defineProperty$c = objectDefineProperty.f; // `Object.defineProperty` method
707 // https://tc39.es/ecma262/#sec-object.defineproperty
708 // eslint-disable-next-line es/no-object-defineproperty -- safe
709
710 $$C({
711 target: 'Object',
712 stat: true,
713 forced: Object.defineProperty !== defineProperty$c,
714 sham: !DESCRIPTORS$c
715 }, {
716 defineProperty: defineProperty$c
717 });
718
719 var path$n = path$q;
720 var Object$6 = path$n.Object;
721
722 var defineProperty$b = defineProperty$e.exports = function defineProperty(it, key, desc) {
723 return Object$6.defineProperty(it, key, desc);
724 };
725
726 if (Object$6.defineProperty.sham) defineProperty$b.sham = true;
727
728 var parent$V = defineProperty$e.exports;
729 var defineProperty$a = parent$V;
730
731 var parent$U = defineProperty$a;
732 var defineProperty$9 = parent$U;
733
734 var parent$T = defineProperty$9;
735 var defineProperty$8 = parent$T;
736
737 var defineProperty$7 = defineProperty$8;
738
739 function _defineProperties(target, props) {
740 for (var i = 0; i < props.length; i++) {
741 var descriptor = props[i];
742 descriptor.enumerable = descriptor.enumerable || false;
743 descriptor.configurable = true;
744 if ("value" in descriptor) descriptor.writable = true;
745
746 defineProperty$7(target, descriptor.key, descriptor);
747 }
748 }
749
750 function _createClass(Constructor, protoProps, staticProps) {
751 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
752 if (staticProps) _defineProperties(Constructor, staticProps);
753
754 defineProperty$7(Constructor, "prototype", {
755 writable: false
756 });
757
758 return Constructor;
759 }
760
761 function _defineProperty(obj, key, value) {
762 if (key in obj) {
763 defineProperty$7(obj, key, {
764 value: value,
765 enumerable: true,
766 configurable: true,
767 writable: true
768 });
769 } else {
770 obj[key] = value;
771 }
772
773 return obj;
774 }
775
776 var uncurryThis$l = functionUncurryThis;
777 var arraySlice$5 = uncurryThis$l([].slice);
778
779 var global$u = global$M;
780 var uncurryThis$k = functionUncurryThis;
781 var aCallable$4 = aCallable$7;
782 var isObject$a = isObject$f;
783 var hasOwn$c = hasOwnProperty_1;
784 var arraySlice$4 = arraySlice$5;
785 var NATIVE_BIND = functionBindNative;
786 var Function$2 = global$u.Function;
787 var concat$6 = uncurryThis$k([].concat);
788 var join = uncurryThis$k([].join);
789 var factories = {};
790
791 var construct$4 = function (C, argsLength, args) {
792 if (!hasOwn$c(factories, argsLength)) {
793 for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
794
795 factories[argsLength] = Function$2('C,a', 'return new C(' + join(list, ',') + ')');
796 }
797
798 return factories[argsLength](C, args);
799 }; // `Function.prototype.bind` method implementation
800 // https://tc39.es/ecma262/#sec-function.prototype.bind
801
802
803 var functionBind = NATIVE_BIND ? Function$2.bind : function bind(that
804 /* , ...args */
805 ) {
806 var F = aCallable$4(this);
807 var Prototype = F.prototype;
808 var partArgs = arraySlice$4(arguments, 1);
809
810 var boundFunction = function
811 /* args... */
812 bound() {
813 var args = concat$6(partArgs, arraySlice$4(arguments));
814 return this instanceof boundFunction ? construct$4(F, args.length, args) : F.apply(that, args);
815 };
816
817 if (isObject$a(Prototype)) boundFunction.prototype = Prototype;
818 return boundFunction;
819 };
820
821 var $$B = _export;
822 var bind$a = functionBind; // `Function.prototype.bind` method
823 // https://tc39.es/ecma262/#sec-function.prototype.bind
824
825 $$B({
826 target: 'Function',
827 proto: true,
828 forced: Function.bind !== bind$a
829 }, {
830 bind: bind$a
831 });
832
833 var path$m = path$q;
834
835 var entryVirtual$k = function (CONSTRUCTOR) {
836 return path$m[CONSTRUCTOR + 'Prototype'];
837 };
838
839 var entryVirtual$j = entryVirtual$k;
840 var bind$9 = entryVirtual$j('Function').bind;
841
842 var isPrototypeOf$h = objectIsPrototypeOf;
843 var method$e = bind$9;
844 var FunctionPrototype$1 = Function.prototype;
845
846 var bind$8 = function (it) {
847 var own = it.bind;
848 return it === FunctionPrototype$1 || isPrototypeOf$h(FunctionPrototype$1, it) && own === FunctionPrototype$1.bind ? method$e : own;
849 };
850
851 var parent$S = bind$8;
852 var bind$7 = parent$S;
853
854 var bind$6 = bind$7;
855
856 var ceil = Math.ceil;
857 var floor$1 = Math.floor; // `ToIntegerOrInfinity` abstract operation
858 // https://tc39.es/ecma262/#sec-tointegerorinfinity
859
860 var toIntegerOrInfinity$4 = function (argument) {
861 var number = +argument; // eslint-disable-next-line no-self-compare -- safe
862
863 return number !== number || number === 0 ? 0 : (number > 0 ? floor$1 : ceil)(number);
864 };
865
866 var toIntegerOrInfinity$3 = toIntegerOrInfinity$4;
867 var min$2 = Math.min; // `ToLength` abstract operation
868 // https://tc39.es/ecma262/#sec-tolength
869
870 var toLength$1 = function (argument) {
871 return argument > 0 ? min$2(toIntegerOrInfinity$3(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
872 };
873
874 var toLength = toLength$1; // `LengthOfArrayLike` abstract operation
875 // https://tc39.es/ecma262/#sec-lengthofarraylike
876
877 var lengthOfArrayLike$d = function (obj) {
878 return toLength(obj.length);
879 };
880
881 var global$t = global$M;
882 var aCallable$3 = aCallable$7;
883 var toObject$c = toObject$e;
884 var IndexedObject$2 = indexedObject;
885 var lengthOfArrayLike$c = lengthOfArrayLike$d;
886 var TypeError$d = global$t.TypeError; // `Array.prototype.{ reduce, reduceRight }` methods implementation
887
888 var createMethod$5 = function (IS_RIGHT) {
889 return function (that, callbackfn, argumentsLength, memo) {
890 aCallable$3(callbackfn);
891 var O = toObject$c(that);
892 var self = IndexedObject$2(O);
893 var length = lengthOfArrayLike$c(O);
894 var index = IS_RIGHT ? length - 1 : 0;
895 var i = IS_RIGHT ? -1 : 1;
896 if (argumentsLength < 2) while (true) {
897 if (index in self) {
898 memo = self[index];
899 index += i;
900 break;
901 }
902
903 index += i;
904
905 if (IS_RIGHT ? index < 0 : length <= index) {
906 throw TypeError$d('Reduce of empty array with no initial value');
907 }
908 }
909
910 for (; IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
911 memo = callbackfn(memo, self[index], index, O);
912 }
913
914 return memo;
915 };
916 };
917
918 var arrayReduce = {
919 // `Array.prototype.reduce` method
920 // https://tc39.es/ecma262/#sec-array.prototype.reduce
921 left: createMethod$5(false),
922 // `Array.prototype.reduceRight` method
923 // https://tc39.es/ecma262/#sec-array.prototype.reduceright
924 right: createMethod$5(true)
925 };
926
927 var fails$j = fails$r;
928
929 var arrayMethodIsStrict$5 = function (METHOD_NAME, argument) {
930 var method = [][METHOD_NAME];
931 return !!method && fails$j(function () {
932 // eslint-disable-next-line no-useless-call -- required for testing
933 method.call(null, argument || function () {
934 return 1;
935 }, 1);
936 });
937 };
938
939 var classof$e = classofRaw$1;
940 var global$s = global$M;
941 var engineIsNode = classof$e(global$s.process) == 'process';
942
943 var $$A = _export;
944 var $reduce = arrayReduce.left;
945 var arrayMethodIsStrict$4 = arrayMethodIsStrict$5;
946 var CHROME_VERSION = engineV8Version;
947 var IS_NODE = engineIsNode;
948 var STRICT_METHOD$4 = arrayMethodIsStrict$4('reduce'); // Chrome 80-82 has a critical bug
949 // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
950
951 var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83; // `Array.prototype.reduce` method
952 // https://tc39.es/ecma262/#sec-array.prototype.reduce
953
954 $$A({
955 target: 'Array',
956 proto: true,
957 forced: !STRICT_METHOD$4 || CHROME_BUG
958 }, {
959 reduce: function reduce(callbackfn
960 /* , initialValue */
961 ) {
962 var length = arguments.length;
963 return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
964 }
965 });
966
967 var entryVirtual$i = entryVirtual$k;
968 var reduce$3 = entryVirtual$i('Array').reduce;
969
970 var isPrototypeOf$g = objectIsPrototypeOf;
971 var method$d = reduce$3;
972 var ArrayPrototype$e = Array.prototype;
973
974 var reduce$2 = function (it) {
975 var own = it.reduce;
976 return it === ArrayPrototype$e || isPrototypeOf$g(ArrayPrototype$e, it) && own === ArrayPrototype$e.reduce ? method$d : own;
977 };
978
979 var parent$R = reduce$2;
980 var reduce$1 = parent$R;
981
982 var reduce = reduce$1;
983
984 var classof$d = classofRaw$1; // `IsArray` abstract operation
985 // https://tc39.es/ecma262/#sec-isarray
986 // eslint-disable-next-line es/no-array-isarray -- safe
987
988 var isArray$d = Array.isArray || function isArray(argument) {
989 return classof$d(argument) == 'Array';
990 };
991
992 var wellKnownSymbol$h = wellKnownSymbol$j;
993 var TO_STRING_TAG$3 = wellKnownSymbol$h('toStringTag');
994 var test$2 = {};
995 test$2[TO_STRING_TAG$3] = 'z';
996 var toStringTagSupport = String(test$2) === '[object z]';
997
998 var global$r = global$M;
999 var TO_STRING_TAG_SUPPORT$2 = toStringTagSupport;
1000 var isCallable$9 = isCallable$h;
1001 var classofRaw = classofRaw$1;
1002 var wellKnownSymbol$g = wellKnownSymbol$j;
1003 var TO_STRING_TAG$2 = wellKnownSymbol$g('toStringTag');
1004 var Object$5 = global$r.Object; // ES3 wrong here
1005
1006 var CORRECT_ARGUMENTS = classofRaw(function () {
1007 return arguments;
1008 }()) == 'Arguments'; // fallback for IE11 Script Access Denied error
1009
1010 var tryGet = function (it, key) {
1011 try {
1012 return it[key];
1013 } catch (error) {
1014 /* empty */
1015 }
1016 }; // getting tag from ES6+ `Object.prototype.toString`
1017
1018
1019 var classof$c = TO_STRING_TAG_SUPPORT$2 ? classofRaw : function (it) {
1020 var O, tag, result;
1021 return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case
1022 : typeof (tag = tryGet(O = Object$5(it), TO_STRING_TAG$2)) == 'string' ? tag // builtinTag case
1023 : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback
1024 : (result = classofRaw(O)) == 'Object' && isCallable$9(O.callee) ? 'Arguments' : result;
1025 };
1026
1027 var uncurryThis$j = functionUncurryThis;
1028 var isCallable$8 = isCallable$h;
1029 var store$1 = sharedStore;
1030 var functionToString = uncurryThis$j(Function.toString); // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
1031
1032 if (!isCallable$8(store$1.inspectSource)) {
1033 store$1.inspectSource = function (it) {
1034 return functionToString(it);
1035 };
1036 }
1037
1038 var inspectSource$2 = store$1.inspectSource;
1039
1040 var uncurryThis$i = functionUncurryThis;
1041 var fails$i = fails$r;
1042 var isCallable$7 = isCallable$h;
1043 var classof$b = classof$c;
1044 var getBuiltIn$6 = getBuiltIn$9;
1045 var inspectSource$1 = inspectSource$2;
1046
1047 var noop = function () {
1048 /* empty */
1049 };
1050
1051 var empty = [];
1052 var construct$3 = getBuiltIn$6('Reflect', 'construct');
1053 var constructorRegExp = /^\s*(?:class|function)\b/;
1054 var exec$2 = uncurryThis$i(constructorRegExp.exec);
1055 var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
1056
1057 var isConstructorModern = function isConstructor(argument) {
1058 if (!isCallable$7(argument)) return false;
1059
1060 try {
1061 construct$3(noop, empty, argument);
1062 return true;
1063 } catch (error) {
1064 return false;
1065 }
1066 };
1067
1068 var isConstructorLegacy = function isConstructor(argument) {
1069 if (!isCallable$7(argument)) return false;
1070
1071 switch (classof$b(argument)) {
1072 case 'AsyncFunction':
1073 case 'GeneratorFunction':
1074 case 'AsyncGeneratorFunction':
1075 return false;
1076 }
1077
1078 try {
1079 // we can't check .prototype since constructors produced by .bind haven't it
1080 // `Function#toString` throws on some built-it function in some legacy engines
1081 // (for example, `DOMQuad` and similar in FF41-)
1082 return INCORRECT_TO_STRING || !!exec$2(constructorRegExp, inspectSource$1(argument));
1083 } catch (error) {
1084 return true;
1085 }
1086 };
1087
1088 isConstructorLegacy.sham = true; // `IsConstructor` abstract operation
1089 // https://tc39.es/ecma262/#sec-isconstructor
1090
1091 var isConstructor$4 = !construct$3 || fails$i(function () {
1092 var called;
1093 return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function () {
1094 called = true;
1095 }) || called;
1096 }) ? isConstructorLegacy : isConstructorModern;
1097
1098 var global$q = global$M;
1099 var isArray$c = isArray$d;
1100 var isConstructor$3 = isConstructor$4;
1101 var isObject$9 = isObject$f;
1102 var wellKnownSymbol$f = wellKnownSymbol$j;
1103 var SPECIES$3 = wellKnownSymbol$f('species');
1104 var Array$5 = global$q.Array; // a part of `ArraySpeciesCreate` abstract operation
1105 // https://tc39.es/ecma262/#sec-arrayspeciescreate
1106
1107 var arraySpeciesConstructor$1 = function (originalArray) {
1108 var C;
1109
1110 if (isArray$c(originalArray)) {
1111 C = originalArray.constructor; // cross-realm fallback
1112
1113 if (isConstructor$3(C) && (C === Array$5 || isArray$c(C.prototype))) C = undefined;else if (isObject$9(C)) {
1114 C = C[SPECIES$3];
1115 if (C === null) C = undefined;
1116 }
1117 }
1118
1119 return C === undefined ? Array$5 : C;
1120 };
1121
1122 var arraySpeciesConstructor = arraySpeciesConstructor$1; // `ArraySpeciesCreate` abstract operation
1123 // https://tc39.es/ecma262/#sec-arrayspeciescreate
1124
1125 var arraySpeciesCreate$4 = function (originalArray, length) {
1126 return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
1127 };
1128
1129 var bind$5 = functionBindContext;
1130 var uncurryThis$h = functionUncurryThis;
1131 var IndexedObject$1 = indexedObject;
1132 var toObject$b = toObject$e;
1133 var lengthOfArrayLike$b = lengthOfArrayLike$d;
1134 var arraySpeciesCreate$3 = arraySpeciesCreate$4;
1135 var push$5 = uncurryThis$h([].push); // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
1136
1137 var createMethod$4 = function (TYPE) {
1138 var IS_MAP = TYPE == 1;
1139 var IS_FILTER = TYPE == 2;
1140 var IS_SOME = TYPE == 3;
1141 var IS_EVERY = TYPE == 4;
1142 var IS_FIND_INDEX = TYPE == 6;
1143 var IS_FILTER_REJECT = TYPE == 7;
1144 var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
1145 return function ($this, callbackfn, that, specificCreate) {
1146 var O = toObject$b($this);
1147 var self = IndexedObject$1(O);
1148 var boundFunction = bind$5(callbackfn, that);
1149 var length = lengthOfArrayLike$b(self);
1150 var index = 0;
1151 var create = specificCreate || arraySpeciesCreate$3;
1152 var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
1153 var value, result;
1154
1155 for (; length > index; index++) if (NO_HOLES || index in self) {
1156 value = self[index];
1157 result = boundFunction(value, index, O);
1158
1159 if (TYPE) {
1160 if (IS_MAP) target[index] = result; // map
1161 else if (result) switch (TYPE) {
1162 case 3:
1163 return true;
1164 // some
1165
1166 case 5:
1167 return value;
1168 // find
1169
1170 case 6:
1171 return index;
1172 // findIndex
1173
1174 case 2:
1175 push$5(target, value);
1176 // filter
1177 } else switch (TYPE) {
1178 case 4:
1179 return false;
1180 // every
1181
1182 case 7:
1183 push$5(target, value);
1184 // filterReject
1185 }
1186 }
1187 }
1188
1189 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
1190 };
1191 };
1192
1193 var arrayIteration = {
1194 // `Array.prototype.forEach` method
1195 // https://tc39.es/ecma262/#sec-array.prototype.foreach
1196 forEach: createMethod$4(0),
1197 // `Array.prototype.map` method
1198 // https://tc39.es/ecma262/#sec-array.prototype.map
1199 map: createMethod$4(1),
1200 // `Array.prototype.filter` method
1201 // https://tc39.es/ecma262/#sec-array.prototype.filter
1202 filter: createMethod$4(2),
1203 // `Array.prototype.some` method
1204 // https://tc39.es/ecma262/#sec-array.prototype.some
1205 some: createMethod$4(3),
1206 // `Array.prototype.every` method
1207 // https://tc39.es/ecma262/#sec-array.prototype.every
1208 every: createMethod$4(4),
1209 // `Array.prototype.find` method
1210 // https://tc39.es/ecma262/#sec-array.prototype.find
1211 find: createMethod$4(5),
1212 // `Array.prototype.findIndex` method
1213 // https://tc39.es/ecma262/#sec-array.prototype.findIndex
1214 findIndex: createMethod$4(6),
1215 // `Array.prototype.filterReject` method
1216 // https://github.com/tc39/proposal-array-filtering
1217 filterReject: createMethod$4(7)
1218 };
1219
1220 var fails$h = fails$r;
1221 var wellKnownSymbol$e = wellKnownSymbol$j;
1222 var V8_VERSION$1 = engineV8Version;
1223 var SPECIES$2 = wellKnownSymbol$e('species');
1224
1225 var arrayMethodHasSpeciesSupport$5 = function (METHOD_NAME) {
1226 // We can't use this feature detection in V8 since it causes
1227 // deoptimization and serious performance degradation
1228 // https://github.com/zloirock/core-js/issues/677
1229 return V8_VERSION$1 >= 51 || !fails$h(function () {
1230 var array = [];
1231 var constructor = array.constructor = {};
1232
1233 constructor[SPECIES$2] = function () {
1234 return {
1235 foo: 1
1236 };
1237 };
1238
1239 return array[METHOD_NAME](Boolean).foo !== 1;
1240 });
1241 };
1242
1243 var $$z = _export;
1244 var $filter = arrayIteration.filter;
1245 var arrayMethodHasSpeciesSupport$4 = arrayMethodHasSpeciesSupport$5;
1246 var HAS_SPECIES_SUPPORT$3 = arrayMethodHasSpeciesSupport$4('filter'); // `Array.prototype.filter` method
1247 // https://tc39.es/ecma262/#sec-array.prototype.filter
1248 // with adding support of @@species
1249
1250 $$z({
1251 target: 'Array',
1252 proto: true,
1253 forced: !HAS_SPECIES_SUPPORT$3
1254 }, {
1255 filter: function filter(callbackfn
1256 /* , thisArg */
1257 ) {
1258 return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1259 }
1260 });
1261
1262 var entryVirtual$h = entryVirtual$k;
1263 var filter$3 = entryVirtual$h('Array').filter;
1264
1265 var isPrototypeOf$f = objectIsPrototypeOf;
1266 var method$c = filter$3;
1267 var ArrayPrototype$d = Array.prototype;
1268
1269 var filter$2 = function (it) {
1270 var own = it.filter;
1271 return it === ArrayPrototype$d || isPrototypeOf$f(ArrayPrototype$d, it) && own === ArrayPrototype$d.filter ? method$c : own;
1272 };
1273
1274 var parent$Q = filter$2;
1275 var filter$1 = parent$Q;
1276
1277 var filter = filter$1;
1278
1279 var $$y = _export;
1280 var $map = arrayIteration.map;
1281 var arrayMethodHasSpeciesSupport$3 = arrayMethodHasSpeciesSupport$5;
1282 var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport$3('map'); // `Array.prototype.map` method
1283 // https://tc39.es/ecma262/#sec-array.prototype.map
1284 // with adding support of @@species
1285
1286 $$y({
1287 target: 'Array',
1288 proto: true,
1289 forced: !HAS_SPECIES_SUPPORT$2
1290 }, {
1291 map: function map(callbackfn
1292 /* , thisArg */
1293 ) {
1294 return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1295 }
1296 });
1297
1298 var entryVirtual$g = entryVirtual$k;
1299 var map$6 = entryVirtual$g('Array').map;
1300
1301 var isPrototypeOf$e = objectIsPrototypeOf;
1302 var method$b = map$6;
1303 var ArrayPrototype$c = Array.prototype;
1304
1305 var map$5 = function (it) {
1306 var own = it.map;
1307 return it === ArrayPrototype$c || isPrototypeOf$e(ArrayPrototype$c, it) && own === ArrayPrototype$c.map ? method$b : own;
1308 };
1309
1310 var parent$P = map$5;
1311 var map$4 = parent$P;
1312
1313 var map$3 = map$4;
1314
1315 var global$p = global$M;
1316 var isArray$b = isArray$d;
1317 var lengthOfArrayLike$a = lengthOfArrayLike$d;
1318 var bind$4 = functionBindContext;
1319 var TypeError$c = global$p.TypeError; // `FlattenIntoArray` abstract operation
1320 // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
1321
1322 var flattenIntoArray$1 = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {
1323 var targetIndex = start;
1324 var sourceIndex = 0;
1325 var mapFn = mapper ? bind$4(mapper, thisArg) : false;
1326 var element, elementLen;
1327
1328 while (sourceIndex < sourceLen) {
1329 if (sourceIndex in source) {
1330 element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
1331
1332 if (depth > 0 && isArray$b(element)) {
1333 elementLen = lengthOfArrayLike$a(element);
1334 targetIndex = flattenIntoArray$1(target, original, element, elementLen, targetIndex, depth - 1) - 1;
1335 } else {
1336 if (targetIndex >= 0x1FFFFFFFFFFFFF) throw TypeError$c('Exceed the acceptable array length');
1337 target[targetIndex] = element;
1338 }
1339
1340 targetIndex++;
1341 }
1342
1343 sourceIndex++;
1344 }
1345
1346 return targetIndex;
1347 };
1348
1349 var flattenIntoArray_1 = flattenIntoArray$1;
1350
1351 var $$x = _export;
1352 var flattenIntoArray = flattenIntoArray_1;
1353 var aCallable$2 = aCallable$7;
1354 var toObject$a = toObject$e;
1355 var lengthOfArrayLike$9 = lengthOfArrayLike$d;
1356 var arraySpeciesCreate$2 = arraySpeciesCreate$4; // `Array.prototype.flatMap` method
1357 // https://tc39.es/ecma262/#sec-array.prototype.flatmap
1358
1359 $$x({
1360 target: 'Array',
1361 proto: true
1362 }, {
1363 flatMap: function flatMap(callbackfn
1364 /* , thisArg */
1365 ) {
1366 var O = toObject$a(this);
1367 var sourceLen = lengthOfArrayLike$9(O);
1368 var A;
1369 aCallable$2(callbackfn);
1370 A = arraySpeciesCreate$2(O, 0);
1371 A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1372 return A;
1373 }
1374 });
1375
1376 var entryVirtual$f = entryVirtual$k;
1377 var flatMap$3 = entryVirtual$f('Array').flatMap;
1378
1379 var isPrototypeOf$d = objectIsPrototypeOf;
1380 var method$a = flatMap$3;
1381 var ArrayPrototype$b = Array.prototype;
1382
1383 var flatMap$2 = function (it) {
1384 var own = it.flatMap;
1385 return it === ArrayPrototype$b || isPrototypeOf$d(ArrayPrototype$b, it) && own === ArrayPrototype$b.flatMap ? method$a : own;
1386 };
1387
1388 var parent$O = flatMap$2;
1389 var flatMap$1 = parent$O;
1390
1391 var flatMap = flatMap$1;
1392
1393 /**
1394 * Create new data pipe.
1395 *
1396 * @param from - The source data set or data view.
1397 * @remarks
1398 * Example usage:
1399 * ```typescript
1400 * interface AppItem {
1401 * whoami: string;
1402 * appData: unknown;
1403 * visData: VisItem;
1404 * }
1405 * interface VisItem {
1406 * id: number;
1407 * label: string;
1408 * color: string;
1409 * x: number;
1410 * y: number;
1411 * }
1412 *
1413 * const ds1 = new DataSet<AppItem, "whoami">([], { fieldId: "whoami" });
1414 * const ds2 = new DataSet<VisItem, "id">();
1415 *
1416 * const pipe = createNewDataPipeFrom(ds1)
1417 * .filter((item): boolean => item.enabled === true)
1418 * .map<VisItem, "id">((item): VisItem => item.visData)
1419 * .to(ds2);
1420 *
1421 * pipe.start();
1422 * ```
1423 * @returns A factory whose methods can be used to configure the pipe.
1424 */
1425 function createNewDataPipeFrom(from) {
1426 return new DataPipeUnderConstruction(from);
1427 }
1428 /**
1429 * Internal implementation of the pipe. This should be accessible only through
1430 * `createNewDataPipeFrom` from the outside.
1431 *
1432 * @typeParam SI - Source item type.
1433 * @typeParam SP - Source item type's id property name.
1434 * @typeParam TI - Target item type.
1435 * @typeParam TP - Target item type's id property name.
1436 */
1437
1438 var SimpleDataPipe = /*#__PURE__*/function () {
1439 /**
1440 * Bound listeners for use with `DataInterface['on' | 'off']`.
1441 */
1442
1443 /**
1444 * Create a new data pipe.
1445 *
1446 * @param _source - The data set or data view that will be observed.
1447 * @param _transformers - An array of transforming functions to be used to
1448 * filter or transform the items in the pipe.
1449 * @param _target - The data set or data view that will receive the items.
1450 */
1451 function SimpleDataPipe(_source, _transformers, _target) {
1452 var _context, _context2, _context3;
1453
1454 _classCallCheck(this, SimpleDataPipe);
1455
1456 _defineProperty(this, "_source", void 0);
1457
1458 _defineProperty(this, "_transformers", void 0);
1459
1460 _defineProperty(this, "_target", void 0);
1461
1462 _defineProperty(this, "_listeners", {
1463 add: bind$6(_context = this._add).call(_context, this),
1464 remove: bind$6(_context2 = this._remove).call(_context2, this),
1465 update: bind$6(_context3 = this._update).call(_context3, this)
1466 });
1467
1468 this._source = _source;
1469 this._transformers = _transformers;
1470 this._target = _target;
1471 }
1472 /** @inheritDoc */
1473
1474
1475 _createClass(SimpleDataPipe, [{
1476 key: "all",
1477 value: function all() {
1478 this._target.update(this._transformItems(this._source.get()));
1479
1480 return this;
1481 }
1482 /** @inheritDoc */
1483
1484 }, {
1485 key: "start",
1486 value: function start() {
1487 this._source.on("add", this._listeners.add);
1488
1489 this._source.on("remove", this._listeners.remove);
1490
1491 this._source.on("update", this._listeners.update);
1492
1493 return this;
1494 }
1495 /** @inheritDoc */
1496
1497 }, {
1498 key: "stop",
1499 value: function stop() {
1500 this._source.off("add", this._listeners.add);
1501
1502 this._source.off("remove", this._listeners.remove);
1503
1504 this._source.off("update", this._listeners.update);
1505
1506 return this;
1507 }
1508 /**
1509 * Apply the transformers to the items.
1510 *
1511 * @param items - The items to be transformed.
1512 * @returns The transformed items.
1513 */
1514
1515 }, {
1516 key: "_transformItems",
1517 value: function _transformItems(items) {
1518 var _context4;
1519
1520 return reduce(_context4 = this._transformers).call(_context4, function (items, transform) {
1521 return transform(items);
1522 }, items);
1523 }
1524 /**
1525 * Handle an add event.
1526 *
1527 * @param _name - Ignored.
1528 * @param payload - The payload containing the ids of the added items.
1529 */
1530
1531 }, {
1532 key: "_add",
1533 value: function _add(_name, payload) {
1534 if (payload == null) {
1535 return;
1536 }
1537
1538 this._target.add(this._transformItems(this._source.get(payload.items)));
1539 }
1540 /**
1541 * Handle an update event.
1542 *
1543 * @param _name - Ignored.
1544 * @param payload - The payload containing the ids of the updated items.
1545 */
1546
1547 }, {
1548 key: "_update",
1549 value: function _update(_name, payload) {
1550 if (payload == null) {
1551 return;
1552 }
1553
1554 this._target.update(this._transformItems(this._source.get(payload.items)));
1555 }
1556 /**
1557 * Handle a remove event.
1558 *
1559 * @param _name - Ignored.
1560 * @param payload - The payload containing the data of the removed items.
1561 */
1562
1563 }, {
1564 key: "_remove",
1565 value: function _remove(_name, payload) {
1566 if (payload == null) {
1567 return;
1568 }
1569
1570 this._target.remove(this._transformItems(payload.oldData));
1571 }
1572 }]);
1573
1574 return SimpleDataPipe;
1575 }();
1576 /**
1577 * Internal implementation of the pipe factory. This should be accessible
1578 * only through `createNewDataPipeFrom` from the outside.
1579 *
1580 * @typeParam TI - Target item type.
1581 * @typeParam TP - Target item type's id property name.
1582 */
1583
1584
1585 var DataPipeUnderConstruction = /*#__PURE__*/function () {
1586 /**
1587 * Array transformers used to transform items within the pipe. This is typed
1588 * as any for the sake of simplicity.
1589 */
1590
1591 /**
1592 * Create a new data pipe factory. This is an internal constructor that
1593 * should never be called from outside of this file.
1594 *
1595 * @param _source - The source data set or data view for this pipe.
1596 */
1597 function DataPipeUnderConstruction(_source) {
1598 _classCallCheck(this, DataPipeUnderConstruction);
1599
1600 _defineProperty(this, "_source", void 0);
1601
1602 _defineProperty(this, "_transformers", []);
1603
1604 this._source = _source;
1605 }
1606 /**
1607 * Filter the items.
1608 *
1609 * @param callback - A filtering function that returns true if given item
1610 * should be piped and false if not.
1611 * @returns This factory for further configuration.
1612 */
1613
1614
1615 _createClass(DataPipeUnderConstruction, [{
1616 key: "filter",
1617 value: function filter$1(callback) {
1618 this._transformers.push(function (input) {
1619 return filter(input).call(input, callback);
1620 });
1621
1622 return this;
1623 }
1624 /**
1625 * Map each source item to a new type.
1626 *
1627 * @param callback - A mapping function that takes a source item and returns
1628 * corresponding mapped item.
1629 * @typeParam TI - Target item type.
1630 * @typeParam TP - Target item type's id property name.
1631 * @returns This factory for further configuration.
1632 */
1633
1634 }, {
1635 key: "map",
1636 value: function map(callback) {
1637 this._transformers.push(function (input) {
1638 return map$3(input).call(input, callback);
1639 });
1640
1641 return this;
1642 }
1643 /**
1644 * Map each source item to zero or more items of a new type.
1645 *
1646 * @param callback - A mapping function that takes a source item and returns
1647 * an array of corresponding mapped items.
1648 * @typeParam TI - Target item type.
1649 * @typeParam TP - Target item type's id property name.
1650 * @returns This factory for further configuration.
1651 */
1652
1653 }, {
1654 key: "flatMap",
1655 value: function flatMap$1(callback) {
1656 this._transformers.push(function (input) {
1657 return flatMap(input).call(input, callback);
1658 });
1659
1660 return this;
1661 }
1662 /**
1663 * Connect this pipe to given data set.
1664 *
1665 * @param target - The data set that will receive the items from this pipe.
1666 * @returns The pipe connected between given data sets and performing
1667 * configured transformation on the processed items.
1668 */
1669
1670 }, {
1671 key: "to",
1672 value: function to(target) {
1673 return new SimpleDataPipe(this._source, this._transformers, target);
1674 }
1675 }]);
1676
1677 return DataPipeUnderConstruction;
1678 }();
1679
1680 var global$o = global$M;
1681 var classof$a = classof$c;
1682 var String$2 = global$o.String;
1683
1684 var toString$7 = function (argument) {
1685 if (classof$a(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1686 return String$2(argument);
1687 };
1688
1689 var uncurryThis$g = functionUncurryThis;
1690 var toIntegerOrInfinity$2 = toIntegerOrInfinity$4;
1691 var toString$6 = toString$7;
1692 var requireObjectCoercible$2 = requireObjectCoercible$5;
1693 var charAt$2 = uncurryThis$g(''.charAt);
1694 var charCodeAt$1 = uncurryThis$g(''.charCodeAt);
1695 var stringSlice = uncurryThis$g(''.slice);
1696
1697 var createMethod$3 = function (CONVERT_TO_STRING) {
1698 return function ($this, pos) {
1699 var S = toString$6(requireObjectCoercible$2($this));
1700 var position = toIntegerOrInfinity$2(pos);
1701 var size = S.length;
1702 var first, second;
1703 if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
1704 first = charCodeAt$1(S, position);
1705 return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = charCodeAt$1(S, position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? charAt$2(S, position) : first : CONVERT_TO_STRING ? stringSlice(S, position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
1706 };
1707 };
1708
1709 var stringMultibyte = {
1710 // `String.prototype.codePointAt` method
1711 // https://tc39.es/ecma262/#sec-string.prototype.codepointat
1712 codeAt: createMethod$3(false),
1713 // `String.prototype.at` method
1714 // https://github.com/mathiasbynens/String.prototype.at
1715 charAt: createMethod$3(true)
1716 };
1717
1718 var global$n = global$M;
1719 var isCallable$6 = isCallable$h;
1720 var inspectSource = inspectSource$2;
1721 var WeakMap$1 = global$n.WeakMap;
1722 var nativeWeakMap = isCallable$6(WeakMap$1) && /native code/.test(inspectSource(WeakMap$1));
1723
1724 var shared$2 = shared$4.exports;
1725 var uid$2 = uid$4;
1726 var keys$7 = shared$2('keys');
1727
1728 var sharedKey$4 = function (key) {
1729 return keys$7[key] || (keys$7[key] = uid$2(key));
1730 };
1731
1732 var hiddenKeys$6 = {};
1733
1734 var NATIVE_WEAK_MAP = nativeWeakMap;
1735 var global$m = global$M;
1736 var uncurryThis$f = functionUncurryThis;
1737 var isObject$8 = isObject$f;
1738 var createNonEnumerableProperty$4 = createNonEnumerableProperty$6;
1739 var hasOwn$b = hasOwnProperty_1;
1740 var shared$1 = sharedStore;
1741 var sharedKey$3 = sharedKey$4;
1742 var hiddenKeys$5 = hiddenKeys$6;
1743 var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
1744 var TypeError$b = global$m.TypeError;
1745 var WeakMap = global$m.WeakMap;
1746 var set$3, get, has;
1747
1748 var enforce = function (it) {
1749 return has(it) ? get(it) : set$3(it, {});
1750 };
1751
1752 var getterFor = function (TYPE) {
1753 return function (it) {
1754 var state;
1755
1756 if (!isObject$8(it) || (state = get(it)).type !== TYPE) {
1757 throw TypeError$b('Incompatible receiver, ' + TYPE + ' required');
1758 }
1759
1760 return state;
1761 };
1762 };
1763
1764 if (NATIVE_WEAK_MAP || shared$1.state) {
1765 var store = shared$1.state || (shared$1.state = new WeakMap());
1766 var wmget = uncurryThis$f(store.get);
1767 var wmhas = uncurryThis$f(store.has);
1768 var wmset = uncurryThis$f(store.set);
1769
1770 set$3 = function (it, metadata) {
1771 if (wmhas(store, it)) throw new TypeError$b(OBJECT_ALREADY_INITIALIZED);
1772 metadata.facade = it;
1773 wmset(store, it, metadata);
1774 return metadata;
1775 };
1776
1777 get = function (it) {
1778 return wmget(store, it) || {};
1779 };
1780
1781 has = function (it) {
1782 return wmhas(store, it);
1783 };
1784 } else {
1785 var STATE = sharedKey$3('state');
1786 hiddenKeys$5[STATE] = true;
1787
1788 set$3 = function (it, metadata) {
1789 if (hasOwn$b(it, STATE)) throw new TypeError$b(OBJECT_ALREADY_INITIALIZED);
1790 metadata.facade = it;
1791 createNonEnumerableProperty$4(it, STATE, metadata);
1792 return metadata;
1793 };
1794
1795 get = function (it) {
1796 return hasOwn$b(it, STATE) ? it[STATE] : {};
1797 };
1798
1799 has = function (it) {
1800 return hasOwn$b(it, STATE);
1801 };
1802 }
1803
1804 var internalState = {
1805 set: set$3,
1806 get: get,
1807 has: has,
1808 enforce: enforce,
1809 getterFor: getterFor
1810 };
1811
1812 var DESCRIPTORS$b = descriptors;
1813 var hasOwn$a = hasOwnProperty_1;
1814 var FunctionPrototype = Function.prototype; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1815
1816 var getDescriptor = DESCRIPTORS$b && Object.getOwnPropertyDescriptor;
1817 var EXISTS = hasOwn$a(FunctionPrototype, 'name'); // additional protection from minified / mangled / dropped function names
1818
1819 var PROPER = EXISTS && function something() {
1820 /* empty */
1821 }.name === 'something';
1822
1823 var CONFIGURABLE = EXISTS && (!DESCRIPTORS$b || DESCRIPTORS$b && getDescriptor(FunctionPrototype, 'name').configurable);
1824 var functionName = {
1825 EXISTS: EXISTS,
1826 PROPER: PROPER,
1827 CONFIGURABLE: CONFIGURABLE
1828 };
1829
1830 var objectDefineProperties = {};
1831
1832 var toIntegerOrInfinity$1 = toIntegerOrInfinity$4;
1833 var max$3 = Math.max;
1834 var min$1 = Math.min; // Helper for a popular repeating case of the spec:
1835 // Let integer be ? ToInteger(index).
1836 // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
1837
1838 var toAbsoluteIndex$5 = function (index, length) {
1839 var integer = toIntegerOrInfinity$1(index);
1840 return integer < 0 ? max$3(integer + length, 0) : min$1(integer, length);
1841 };
1842
1843 var toIndexedObject$9 = toIndexedObject$b;
1844 var toAbsoluteIndex$4 = toAbsoluteIndex$5;
1845 var lengthOfArrayLike$8 = lengthOfArrayLike$d; // `Array.prototype.{ indexOf, includes }` methods implementation
1846
1847 var createMethod$2 = function (IS_INCLUDES) {
1848 return function ($this, el, fromIndex) {
1849 var O = toIndexedObject$9($this);
1850 var length = lengthOfArrayLike$8(O);
1851 var index = toAbsoluteIndex$4(fromIndex, length);
1852 var value; // Array#includes uses SameValueZero equality algorithm
1853 // eslint-disable-next-line no-self-compare -- NaN check
1854
1855 if (IS_INCLUDES && el != el) while (length > index) {
1856 value = O[index++]; // eslint-disable-next-line no-self-compare -- NaN check
1857
1858 if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not
1859 } else for (; length > index; index++) {
1860 if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
1861 }
1862 return !IS_INCLUDES && -1;
1863 };
1864 };
1865
1866 var arrayIncludes = {
1867 // `Array.prototype.includes` method
1868 // https://tc39.es/ecma262/#sec-array.prototype.includes
1869 includes: createMethod$2(true),
1870 // `Array.prototype.indexOf` method
1871 // https://tc39.es/ecma262/#sec-array.prototype.indexof
1872 indexOf: createMethod$2(false)
1873 };
1874
1875 var uncurryThis$e = functionUncurryThis;
1876 var hasOwn$9 = hasOwnProperty_1;
1877 var toIndexedObject$8 = toIndexedObject$b;
1878 var indexOf = arrayIncludes.indexOf;
1879 var hiddenKeys$4 = hiddenKeys$6;
1880 var push$4 = uncurryThis$e([].push);
1881
1882 var objectKeysInternal = function (object, names) {
1883 var O = toIndexedObject$8(object);
1884 var i = 0;
1885 var result = [];
1886 var key;
1887
1888 for (key in O) !hasOwn$9(hiddenKeys$4, key) && hasOwn$9(O, key) && push$4(result, key); // Don't enum bug & hidden keys
1889
1890
1891 while (names.length > i) if (hasOwn$9(O, key = names[i++])) {
1892 ~indexOf(result, key) || push$4(result, key);
1893 }
1894
1895 return result;
1896 };
1897
1898 var enumBugKeys$3 = ['constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf'];
1899
1900 var internalObjectKeys$1 = objectKeysInternal;
1901 var enumBugKeys$2 = enumBugKeys$3; // `Object.keys` method
1902 // https://tc39.es/ecma262/#sec-object.keys
1903 // eslint-disable-next-line es/no-object-keys -- safe
1904
1905 var objectKeys$4 = Object.keys || function keys(O) {
1906 return internalObjectKeys$1(O, enumBugKeys$2);
1907 };
1908
1909 var DESCRIPTORS$a = descriptors;
1910 var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1911 var definePropertyModule$3 = objectDefineProperty;
1912 var anObject$9 = anObject$b;
1913 var toIndexedObject$7 = toIndexedObject$b;
1914 var objectKeys$3 = objectKeys$4; // `Object.defineProperties` method
1915 // https://tc39.es/ecma262/#sec-object.defineproperties
1916 // eslint-disable-next-line es/no-object-defineproperties -- safe
1917
1918 objectDefineProperties.f = DESCRIPTORS$a && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1919 anObject$9(O);
1920 var props = toIndexedObject$7(Properties);
1921 var keys = objectKeys$3(Properties);
1922 var length = keys.length;
1923 var index = 0;
1924 var key;
1925
1926 while (length > index) definePropertyModule$3.f(O, key = keys[index++], props[key]);
1927
1928 return O;
1929 };
1930
1931 var getBuiltIn$5 = getBuiltIn$9;
1932 var html$1 = getBuiltIn$5('document', 'documentElement');
1933
1934 /* global ActiveXObject -- old IE, WSH */
1935 var anObject$8 = anObject$b;
1936 var definePropertiesModule$1 = objectDefineProperties;
1937 var enumBugKeys$1 = enumBugKeys$3;
1938 var hiddenKeys$3 = hiddenKeys$6;
1939 var html = html$1;
1940 var documentCreateElement = documentCreateElement$1;
1941 var sharedKey$2 = sharedKey$4;
1942 var GT = '>';
1943 var LT = '<';
1944 var PROTOTYPE$1 = 'prototype';
1945 var SCRIPT = 'script';
1946 var IE_PROTO$1 = sharedKey$2('IE_PROTO');
1947
1948 var EmptyConstructor = function () {
1949 /* empty */
1950 };
1951
1952 var scriptTag = function (content) {
1953 return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1954 }; // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1955
1956
1957 var NullProtoObjectViaActiveX = function (activeXDocument) {
1958 activeXDocument.write(scriptTag(''));
1959 activeXDocument.close();
1960 var temp = activeXDocument.parentWindow.Object;
1961 activeXDocument = null; // avoid memory leak
1962
1963 return temp;
1964 }; // Create object with fake `null` prototype: use iframe Object with cleared prototype
1965
1966
1967 var NullProtoObjectViaIFrame = function () {
1968 // Thrash, waste and sodomy: IE GC bug
1969 var iframe = documentCreateElement('iframe');
1970 var JS = 'java' + SCRIPT + ':';
1971 var iframeDocument;
1972 iframe.style.display = 'none';
1973 html.appendChild(iframe); // https://github.com/zloirock/core-js/issues/475
1974
1975 iframe.src = String(JS);
1976 iframeDocument = iframe.contentWindow.document;
1977 iframeDocument.open();
1978 iframeDocument.write(scriptTag('document.F=Object'));
1979 iframeDocument.close();
1980 return iframeDocument.F;
1981 }; // Check for document.domain and active x support
1982 // No need to use active x approach when document.domain is not set
1983 // see https://github.com/es-shims/es5-shim/issues/150
1984 // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1985 // avoid IE GC bug
1986
1987
1988 var activeXDocument;
1989
1990 var NullProtoObject = function () {
1991 try {
1992 activeXDocument = new ActiveXObject('htmlfile');
1993 } catch (error) {
1994 /* ignore */
1995 }
1996
1997 NullProtoObject = typeof document != 'undefined' ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1998 : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument); // WSH
1999
2000 var length = enumBugKeys$1.length;
2001
2002 while (length--) delete NullProtoObject[PROTOTYPE$1][enumBugKeys$1[length]];
2003
2004 return NullProtoObject();
2005 };
2006
2007 hiddenKeys$3[IE_PROTO$1] = true; // `Object.create` method
2008 // https://tc39.es/ecma262/#sec-object.create
2009
2010 var objectCreate = Object.create || function create(O, Properties) {
2011 var result;
2012
2013 if (O !== null) {
2014 EmptyConstructor[PROTOTYPE$1] = anObject$8(O);
2015 result = new EmptyConstructor();
2016 EmptyConstructor[PROTOTYPE$1] = null; // add "__proto__" for Object.getPrototypeOf polyfill
2017
2018 result[IE_PROTO$1] = O;
2019 } else result = NullProtoObject();
2020
2021 return Properties === undefined ? result : definePropertiesModule$1.f(result, Properties);
2022 };
2023
2024 var fails$g = fails$r;
2025 var correctPrototypeGetter = !fails$g(function () {
2026 function F() {
2027 /* empty */
2028 }
2029
2030 F.prototype.constructor = null; // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
2031
2032 return Object.getPrototypeOf(new F()) !== F.prototype;
2033 });
2034
2035 var global$l = global$M;
2036 var hasOwn$8 = hasOwnProperty_1;
2037 var isCallable$5 = isCallable$h;
2038 var toObject$9 = toObject$e;
2039 var sharedKey$1 = sharedKey$4;
2040 var CORRECT_PROTOTYPE_GETTER$1 = correctPrototypeGetter;
2041 var IE_PROTO = sharedKey$1('IE_PROTO');
2042 var Object$4 = global$l.Object;
2043 var ObjectPrototype$2 = Object$4.prototype; // `Object.getPrototypeOf` method
2044 // https://tc39.es/ecma262/#sec-object.getprototypeof
2045
2046 var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER$1 ? Object$4.getPrototypeOf : function (O) {
2047 var object = toObject$9(O);
2048 if (hasOwn$8(object, IE_PROTO)) return object[IE_PROTO];
2049 var constructor = object.constructor;
2050
2051 if (isCallable$5(constructor) && object instanceof constructor) {
2052 return constructor.prototype;
2053 }
2054
2055 return object instanceof Object$4 ? ObjectPrototype$2 : null;
2056 };
2057
2058 var createNonEnumerableProperty$3 = createNonEnumerableProperty$6;
2059
2060 var redefine$4 = function (target, key, value, options) {
2061 if (options && options.enumerable) target[key] = value;else createNonEnumerableProperty$3(target, key, value);
2062 };
2063
2064 var fails$f = fails$r;
2065 var isCallable$4 = isCallable$h;
2066 var create$a = objectCreate;
2067 var getPrototypeOf$6 = objectGetPrototypeOf;
2068 var redefine$3 = redefine$4;
2069 var wellKnownSymbol$d = wellKnownSymbol$j;
2070 var ITERATOR$5 = wellKnownSymbol$d('iterator');
2071 var BUGGY_SAFARI_ITERATORS$1 = false; // `%IteratorPrototype%` object
2072 // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
2073
2074 var IteratorPrototype$1, PrototypeOfArrayIteratorPrototype, arrayIterator;
2075 /* eslint-disable es/no-array-prototype-keys -- safe */
2076
2077 if ([].keys) {
2078 arrayIterator = [].keys(); // Safari 8 has buggy iterators w/o `next`
2079
2080 if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;else {
2081 PrototypeOfArrayIteratorPrototype = getPrototypeOf$6(getPrototypeOf$6(arrayIterator));
2082 if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$1 = PrototypeOfArrayIteratorPrototype;
2083 }
2084 }
2085
2086 var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$1 == undefined || fails$f(function () {
2087 var test = {}; // FF44- legacy iterators case
2088
2089 return IteratorPrototype$1[ITERATOR$5].call(test) !== test;
2090 });
2091 if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$1 = {};else IteratorPrototype$1 = create$a(IteratorPrototype$1); // `%IteratorPrototype%[@@iterator]()` method
2092 // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
2093
2094 if (!isCallable$4(IteratorPrototype$1[ITERATOR$5])) {
2095 redefine$3(IteratorPrototype$1, ITERATOR$5, function () {
2096 return this;
2097 });
2098 }
2099
2100 var iteratorsCore = {
2101 IteratorPrototype: IteratorPrototype$1,
2102 BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
2103 };
2104
2105 var TO_STRING_TAG_SUPPORT$1 = toStringTagSupport;
2106 var classof$9 = classof$c; // `Object.prototype.toString` method implementation
2107 // https://tc39.es/ecma262/#sec-object.prototype.tostring
2108
2109 var objectToString = TO_STRING_TAG_SUPPORT$1 ? {}.toString : function toString() {
2110 return '[object ' + classof$9(this) + ']';
2111 };
2112
2113 var TO_STRING_TAG_SUPPORT = toStringTagSupport;
2114 var defineProperty$6 = objectDefineProperty.f;
2115 var createNonEnumerableProperty$2 = createNonEnumerableProperty$6;
2116 var hasOwn$7 = hasOwnProperty_1;
2117 var toString$5 = objectToString;
2118 var wellKnownSymbol$c = wellKnownSymbol$j;
2119 var TO_STRING_TAG$1 = wellKnownSymbol$c('toStringTag');
2120
2121 var setToStringTag$5 = function (it, TAG, STATIC, SET_METHOD) {
2122 if (it) {
2123 var target = STATIC ? it : it.prototype;
2124
2125 if (!hasOwn$7(target, TO_STRING_TAG$1)) {
2126 defineProperty$6(target, TO_STRING_TAG$1, {
2127 configurable: true,
2128 value: TAG
2129 });
2130 }
2131
2132 if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {
2133 createNonEnumerableProperty$2(target, 'toString', toString$5);
2134 }
2135 }
2136 };
2137
2138 var iterators = {};
2139
2140 var IteratorPrototype = iteratorsCore.IteratorPrototype;
2141 var create$9 = objectCreate;
2142 var createPropertyDescriptor$2 = createPropertyDescriptor$5;
2143 var setToStringTag$4 = setToStringTag$5;
2144 var Iterators$5 = iterators;
2145
2146 var returnThis$1 = function () {
2147 return this;
2148 };
2149
2150 var createIteratorConstructor$1 = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
2151 var TO_STRING_TAG = NAME + ' Iterator';
2152 IteratorConstructor.prototype = create$9(IteratorPrototype, {
2153 next: createPropertyDescriptor$2(+!ENUMERABLE_NEXT, next)
2154 });
2155 setToStringTag$4(IteratorConstructor, TO_STRING_TAG, false, true);
2156 Iterators$5[TO_STRING_TAG] = returnThis$1;
2157 return IteratorConstructor;
2158 };
2159
2160 var global$k = global$M;
2161 var isCallable$3 = isCallable$h;
2162 var String$1 = global$k.String;
2163 var TypeError$a = global$k.TypeError;
2164
2165 var aPossiblePrototype$1 = function (argument) {
2166 if (typeof argument == 'object' || isCallable$3(argument)) return argument;
2167 throw TypeError$a("Can't set " + String$1(argument) + ' as a prototype');
2168 };
2169
2170 /* eslint-disable no-proto -- safe */
2171 var uncurryThis$d = functionUncurryThis;
2172 var anObject$7 = anObject$b;
2173 var aPossiblePrototype = aPossiblePrototype$1; // `Object.setPrototypeOf` method
2174 // https://tc39.es/ecma262/#sec-object.setprototypeof
2175 // Works with __proto__ only. Old v8 can't work with null proto objects.
2176 // eslint-disable-next-line es/no-object-setprototypeof -- safe
2177
2178 var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
2179 var CORRECT_SETTER = false;
2180 var test = {};
2181 var setter;
2182
2183 try {
2184 // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
2185 setter = uncurryThis$d(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
2186 setter(test, []);
2187 CORRECT_SETTER = test instanceof Array;
2188 } catch (error) {
2189 /* empty */
2190 }
2191
2192 return function setPrototypeOf(O, proto) {
2193 anObject$7(O);
2194 aPossiblePrototype(proto);
2195 if (CORRECT_SETTER) setter(O, proto);else O.__proto__ = proto;
2196 return O;
2197 };
2198 }() : undefined);
2199
2200 var $$w = _export;
2201 var call$6 = functionCall;
2202 var FunctionName = functionName;
2203 var createIteratorConstructor = createIteratorConstructor$1;
2204 var getPrototypeOf$5 = objectGetPrototypeOf;
2205 var setToStringTag$3 = setToStringTag$5;
2206 var redefine$2 = redefine$4;
2207 var wellKnownSymbol$b = wellKnownSymbol$j;
2208 var Iterators$4 = iterators;
2209 var IteratorsCore = iteratorsCore;
2210 var PROPER_FUNCTION_NAME$1 = FunctionName.PROPER;
2211 var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
2212 var ITERATOR$4 = wellKnownSymbol$b('iterator');
2213 var KEYS = 'keys';
2214 var VALUES = 'values';
2215 var ENTRIES = 'entries';
2216
2217 var returnThis = function () {
2218 return this;
2219 };
2220
2221 var defineIterator$3 = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
2222 createIteratorConstructor(IteratorConstructor, NAME, next);
2223
2224 var getIterationMethod = function (KIND) {
2225 if (KIND === DEFAULT && defaultIterator) return defaultIterator;
2226 if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
2227
2228 switch (KIND) {
2229 case KEYS:
2230 return function keys() {
2231 return new IteratorConstructor(this, KIND);
2232 };
2233
2234 case VALUES:
2235 return function values() {
2236 return new IteratorConstructor(this, KIND);
2237 };
2238
2239 case ENTRIES:
2240 return function entries() {
2241 return new IteratorConstructor(this, KIND);
2242 };
2243 }
2244
2245 return function () {
2246 return new IteratorConstructor(this);
2247 };
2248 };
2249
2250 var TO_STRING_TAG = NAME + ' Iterator';
2251 var INCORRECT_VALUES_NAME = false;
2252 var IterablePrototype = Iterable.prototype;
2253 var nativeIterator = IterablePrototype[ITERATOR$4] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT];
2254 var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
2255 var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
2256 var CurrentIteratorPrototype, methods, KEY; // fix native
2257
2258 if (anyNativeIterator) {
2259 CurrentIteratorPrototype = getPrototypeOf$5(anyNativeIterator.call(new Iterable()));
2260
2261 if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
2262
2263
2264 setToStringTag$3(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
2265 Iterators$4[TO_STRING_TAG] = returnThis;
2266 }
2267 } // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
2268
2269
2270 if (PROPER_FUNCTION_NAME$1 && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
2271 {
2272 INCORRECT_VALUES_NAME = true;
2273
2274 defaultIterator = function values() {
2275 return call$6(nativeIterator, this);
2276 };
2277 }
2278 } // export additional methods
2279
2280
2281 if (DEFAULT) {
2282 methods = {
2283 values: getIterationMethod(VALUES),
2284 keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
2285 entries: getIterationMethod(ENTRIES)
2286 };
2287 if (FORCED) for (KEY in methods) {
2288 if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
2289 redefine$2(IterablePrototype, KEY, methods[KEY]);
2290 }
2291 } else $$w({
2292 target: NAME,
2293 proto: true,
2294 forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME
2295 }, methods);
2296 } // define iterator
2297
2298
2299 if ((FORCED) && IterablePrototype[ITERATOR$4] !== defaultIterator) {
2300 redefine$2(IterablePrototype, ITERATOR$4, defaultIterator, {
2301 name: DEFAULT
2302 });
2303 }
2304
2305 Iterators$4[NAME] = defaultIterator;
2306 return methods;
2307 };
2308
2309 var charAt$1 = stringMultibyte.charAt;
2310 var toString$4 = toString$7;
2311 var InternalStateModule$4 = internalState;
2312 var defineIterator$2 = defineIterator$3;
2313 var STRING_ITERATOR = 'String Iterator';
2314 var setInternalState$4 = InternalStateModule$4.set;
2315 var getInternalState$2 = InternalStateModule$4.getterFor(STRING_ITERATOR); // `String.prototype[@@iterator]` method
2316 // https://tc39.es/ecma262/#sec-string.prototype-@@iterator
2317
2318 defineIterator$2(String, 'String', function (iterated) {
2319 setInternalState$4(this, {
2320 type: STRING_ITERATOR,
2321 string: toString$4(iterated),
2322 index: 0
2323 }); // `%StringIteratorPrototype%.next` method
2324 // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
2325 }, function next() {
2326 var state = getInternalState$2(this);
2327 var string = state.string;
2328 var index = state.index;
2329 var point;
2330 if (index >= string.length) return {
2331 value: undefined,
2332 done: true
2333 };
2334 point = charAt$1(string, index);
2335 state.index += point.length;
2336 return {
2337 value: point,
2338 done: false
2339 };
2340 });
2341
2342 var call$5 = functionCall;
2343 var anObject$6 = anObject$b;
2344 var getMethod$1 = getMethod$3;
2345
2346 var iteratorClose$2 = function (iterator, kind, value) {
2347 var innerResult, innerError;
2348 anObject$6(iterator);
2349
2350 try {
2351 innerResult = getMethod$1(iterator, 'return');
2352
2353 if (!innerResult) {
2354 if (kind === 'throw') throw value;
2355 return value;
2356 }
2357
2358 innerResult = call$5(innerResult, iterator);
2359 } catch (error) {
2360 innerError = true;
2361 innerResult = error;
2362 }
2363
2364 if (kind === 'throw') throw value;
2365 if (innerError) throw innerResult;
2366 anObject$6(innerResult);
2367 return value;
2368 };
2369
2370 var anObject$5 = anObject$b;
2371 var iteratorClose$1 = iteratorClose$2; // call something on iterator step with safe closing on error
2372
2373 var callWithSafeIterationClosing$1 = function (iterator, fn, value, ENTRIES) {
2374 try {
2375 return ENTRIES ? fn(anObject$5(value)[0], value[1]) : fn(value);
2376 } catch (error) {
2377 iteratorClose$1(iterator, 'throw', error);
2378 }
2379 };
2380
2381 var wellKnownSymbol$a = wellKnownSymbol$j;
2382 var Iterators$3 = iterators;
2383 var ITERATOR$3 = wellKnownSymbol$a('iterator');
2384 var ArrayPrototype$a = Array.prototype; // check on default Array iterator
2385
2386 var isArrayIteratorMethod$2 = function (it) {
2387 return it !== undefined && (Iterators$3.Array === it || ArrayPrototype$a[ITERATOR$3] === it);
2388 };
2389
2390 var toPropertyKey$1 = toPropertyKey$4;
2391 var definePropertyModule$2 = objectDefineProperty;
2392 var createPropertyDescriptor$1 = createPropertyDescriptor$5;
2393
2394 var createProperty$6 = function (object, key, value) {
2395 var propertyKey = toPropertyKey$1(key);
2396 if (propertyKey in object) definePropertyModule$2.f(object, propertyKey, createPropertyDescriptor$1(0, value));else object[propertyKey] = value;
2397 };
2398
2399 var classof$8 = classof$c;
2400 var getMethod = getMethod$3;
2401 var Iterators$2 = iterators;
2402 var wellKnownSymbol$9 = wellKnownSymbol$j;
2403 var ITERATOR$2 = wellKnownSymbol$9('iterator');
2404
2405 var getIteratorMethod$8 = function (it) {
2406 if (it != undefined) return getMethod(it, ITERATOR$2) || getMethod(it, '@@iterator') || Iterators$2[classof$8(it)];
2407 };
2408
2409 var global$j = global$M;
2410 var call$4 = functionCall;
2411 var aCallable$1 = aCallable$7;
2412 var anObject$4 = anObject$b;
2413 var tryToString$2 = tryToString$4;
2414 var getIteratorMethod$7 = getIteratorMethod$8;
2415 var TypeError$9 = global$j.TypeError;
2416
2417 var getIterator$7 = function (argument, usingIterator) {
2418 var iteratorMethod = arguments.length < 2 ? getIteratorMethod$7(argument) : usingIterator;
2419 if (aCallable$1(iteratorMethod)) return anObject$4(call$4(iteratorMethod, argument));
2420 throw TypeError$9(tryToString$2(argument) + ' is not iterable');
2421 };
2422
2423 var global$i = global$M;
2424 var bind$3 = functionBindContext;
2425 var call$3 = functionCall;
2426 var toObject$8 = toObject$e;
2427 var callWithSafeIterationClosing = callWithSafeIterationClosing$1;
2428 var isArrayIteratorMethod$1 = isArrayIteratorMethod$2;
2429 var isConstructor$2 = isConstructor$4;
2430 var lengthOfArrayLike$7 = lengthOfArrayLike$d;
2431 var createProperty$5 = createProperty$6;
2432 var getIterator$6 = getIterator$7;
2433 var getIteratorMethod$6 = getIteratorMethod$8;
2434 var Array$4 = global$i.Array; // `Array.from` method implementation
2435 // https://tc39.es/ecma262/#sec-array.from
2436
2437 var arrayFrom = function from(arrayLike
2438 /* , mapfn = undefined, thisArg = undefined */
2439 ) {
2440 var O = toObject$8(arrayLike);
2441 var IS_CONSTRUCTOR = isConstructor$2(this);
2442 var argumentsLength = arguments.length;
2443 var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
2444 var mapping = mapfn !== undefined;
2445 if (mapping) mapfn = bind$3(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
2446 var iteratorMethod = getIteratorMethod$6(O);
2447 var index = 0;
2448 var length, result, step, iterator, next, value; // if the target is not iterable or it's an array with the default iterator - use a simple case
2449
2450 if (iteratorMethod && !(this == Array$4 && isArrayIteratorMethod$1(iteratorMethod))) {
2451 iterator = getIterator$6(O, iteratorMethod);
2452 next = iterator.next;
2453 result = IS_CONSTRUCTOR ? new this() : [];
2454
2455 for (; !(step = call$3(next, iterator)).done; index++) {
2456 value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
2457 createProperty$5(result, index, value);
2458 }
2459 } else {
2460 length = lengthOfArrayLike$7(O);
2461 result = IS_CONSTRUCTOR ? new this(length) : Array$4(length);
2462
2463 for (; length > index; index++) {
2464 value = mapping ? mapfn(O[index], index) : O[index];
2465 createProperty$5(result, index, value);
2466 }
2467 }
2468
2469 result.length = index;
2470 return result;
2471 };
2472
2473 var wellKnownSymbol$8 = wellKnownSymbol$j;
2474 var ITERATOR$1 = wellKnownSymbol$8('iterator');
2475 var SAFE_CLOSING = false;
2476
2477 try {
2478 var called = 0;
2479 var iteratorWithReturn = {
2480 next: function () {
2481 return {
2482 done: !!called++
2483 };
2484 },
2485 'return': function () {
2486 SAFE_CLOSING = true;
2487 }
2488 };
2489
2490 iteratorWithReturn[ITERATOR$1] = function () {
2491 return this;
2492 }; // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
2493
2494
2495 Array.from(iteratorWithReturn, function () {
2496 throw 2;
2497 });
2498 } catch (error) {
2499 /* empty */
2500 }
2501
2502 var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
2503 if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
2504 var ITERATION_SUPPORT = false;
2505
2506 try {
2507 var object = {};
2508
2509 object[ITERATOR$1] = function () {
2510 return {
2511 next: function () {
2512 return {
2513 done: ITERATION_SUPPORT = true
2514 };
2515 }
2516 };
2517 };
2518
2519 exec(object);
2520 } catch (error) {
2521 /* empty */
2522 }
2523
2524 return ITERATION_SUPPORT;
2525 };
2526
2527 var $$v = _export;
2528 var from$6 = arrayFrom;
2529 var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
2530 var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
2531 // eslint-disable-next-line es/no-array-from -- required for testing
2532 Array.from(iterable);
2533 }); // `Array.from` method
2534 // https://tc39.es/ecma262/#sec-array.from
2535
2536 $$v({
2537 target: 'Array',
2538 stat: true,
2539 forced: INCORRECT_ITERATION
2540 }, {
2541 from: from$6
2542 });
2543
2544 var path$l = path$q;
2545 var from$5 = path$l.Array.from;
2546
2547 var parent$N = from$5;
2548 var from$4 = parent$N;
2549
2550 var from$3 = from$4;
2551
2552 var toIndexedObject$6 = toIndexedObject$b;
2553 var Iterators$1 = iterators;
2554 var InternalStateModule$3 = internalState;
2555 objectDefineProperty.f;
2556 var defineIterator$1 = defineIterator$3;
2557 var ARRAY_ITERATOR = 'Array Iterator';
2558 var setInternalState$3 = InternalStateModule$3.set;
2559 var getInternalState$1 = InternalStateModule$3.getterFor(ARRAY_ITERATOR); // `Array.prototype.entries` method
2560 // https://tc39.es/ecma262/#sec-array.prototype.entries
2561 // `Array.prototype.keys` method
2562 // https://tc39.es/ecma262/#sec-array.prototype.keys
2563 // `Array.prototype.values` method
2564 // https://tc39.es/ecma262/#sec-array.prototype.values
2565 // `Array.prototype[@@iterator]` method
2566 // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
2567 // `CreateArrayIterator` internal method
2568 // https://tc39.es/ecma262/#sec-createarrayiterator
2569
2570 defineIterator$1(Array, 'Array', function (iterated, kind) {
2571 setInternalState$3(this, {
2572 type: ARRAY_ITERATOR,
2573 target: toIndexedObject$6(iterated),
2574 // target
2575 index: 0,
2576 // next index
2577 kind: kind // kind
2578
2579 }); // `%ArrayIteratorPrototype%.next` method
2580 // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
2581 }, function () {
2582 var state = getInternalState$1(this);
2583 var target = state.target;
2584 var kind = state.kind;
2585 var index = state.index++;
2586
2587 if (!target || index >= target.length) {
2588 state.target = undefined;
2589 return {
2590 value: undefined,
2591 done: true
2592 };
2593 }
2594
2595 if (kind == 'keys') return {
2596 value: index,
2597 done: false
2598 };
2599 if (kind == 'values') return {
2600 value: target[index],
2601 done: false
2602 };
2603 return {
2604 value: [index, target[index]],
2605 done: false
2606 };
2607 }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values%
2608 // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
2609 // https://tc39.es/ecma262/#sec-createmappedargumentsobject
2610
2611 Iterators$1.Arguments = Iterators$1.Array; // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2612
2613 var getIteratorMethod$5 = getIteratorMethod$8;
2614 var getIteratorMethod_1 = getIteratorMethod$5;
2615
2616 // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
2617
2618 var domIterables = {
2619 CSSRuleList: 0,
2620 CSSStyleDeclaration: 0,
2621 CSSValueList: 0,
2622 ClientRectList: 0,
2623 DOMRectList: 0,
2624 DOMStringList: 0,
2625 DOMTokenList: 1,
2626 DataTransferItemList: 0,
2627 FileList: 0,
2628 HTMLAllCollection: 0,
2629 HTMLCollection: 0,
2630 HTMLFormElement: 0,
2631 HTMLSelectElement: 0,
2632 MediaList: 0,
2633 MimeTypeArray: 0,
2634 NamedNodeMap: 0,
2635 NodeList: 1,
2636 PaintRequestList: 0,
2637 Plugin: 0,
2638 PluginArray: 0,
2639 SVGLengthList: 0,
2640 SVGNumberList: 0,
2641 SVGPathSegList: 0,
2642 SVGPointList: 0,
2643 SVGStringList: 0,
2644 SVGTransformList: 0,
2645 SourceBufferList: 0,
2646 StyleSheetList: 0,
2647 TextTrackCueList: 0,
2648 TextTrackList: 0,
2649 TouchList: 0
2650 };
2651
2652 var DOMIterables$4 = domIterables;
2653 var global$h = global$M;
2654 var classof$7 = classof$c;
2655 var createNonEnumerableProperty$1 = createNonEnumerableProperty$6;
2656 var Iterators = iterators;
2657 var wellKnownSymbol$7 = wellKnownSymbol$j;
2658 var TO_STRING_TAG = wellKnownSymbol$7('toStringTag');
2659
2660 for (var COLLECTION_NAME in DOMIterables$4) {
2661 var Collection = global$h[COLLECTION_NAME];
2662 var CollectionPrototype = Collection && Collection.prototype;
2663
2664 if (CollectionPrototype && classof$7(CollectionPrototype) !== TO_STRING_TAG) {
2665 createNonEnumerableProperty$1(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
2666 }
2667
2668 Iterators[COLLECTION_NAME] = Iterators.Array;
2669 }
2670
2671 var parent$M = getIteratorMethod_1;
2672 var getIteratorMethod$4 = parent$M;
2673
2674 var parent$L = getIteratorMethod$4;
2675 var getIteratorMethod$3 = parent$L;
2676
2677 var parent$K = getIteratorMethod$3;
2678 var getIteratorMethod$2 = parent$K;
2679
2680 var getIteratorMethod$1 = getIteratorMethod$2;
2681
2682 var objectGetOwnPropertyNames = {};
2683
2684 var internalObjectKeys = objectKeysInternal;
2685 var enumBugKeys = enumBugKeys$3;
2686 var hiddenKeys$2 = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method
2687 // https://tc39.es/ecma262/#sec-object.getownpropertynames
2688 // eslint-disable-next-line es/no-object-getownpropertynames -- safe
2689
2690 objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
2691 return internalObjectKeys(O, hiddenKeys$2);
2692 };
2693
2694 var objectGetOwnPropertyNamesExternal = {};
2695
2696 var global$g = global$M;
2697 var toAbsoluteIndex$3 = toAbsoluteIndex$5;
2698 var lengthOfArrayLike$6 = lengthOfArrayLike$d;
2699 var createProperty$4 = createProperty$6;
2700 var Array$3 = global$g.Array;
2701 var max$2 = Math.max;
2702
2703 var arraySliceSimple = function (O, start, end) {
2704 var length = lengthOfArrayLike$6(O);
2705 var k = toAbsoluteIndex$3(start, length);
2706 var fin = toAbsoluteIndex$3(end === undefined ? length : end, length);
2707 var result = Array$3(max$2(fin - k, 0));
2708
2709 for (var n = 0; k < fin; k++, n++) createProperty$4(result, n, O[k]);
2710
2711 result.length = n;
2712 return result;
2713 };
2714
2715 /* eslint-disable es/no-object-getownpropertynames -- safe */
2716 var classof$6 = classofRaw$1;
2717 var toIndexedObject$5 = toIndexedObject$b;
2718 var $getOwnPropertyNames$1 = objectGetOwnPropertyNames.f;
2719 var arraySlice$3 = arraySliceSimple;
2720 var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
2721
2722 var getWindowNames = function (it) {
2723 try {
2724 return $getOwnPropertyNames$1(it);
2725 } catch (error) {
2726 return arraySlice$3(windowNames);
2727 }
2728 }; // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
2729
2730
2731 objectGetOwnPropertyNamesExternal.f = function getOwnPropertyNames(it) {
2732 return windowNames && classof$6(it) == 'Window' ? getWindowNames(it) : $getOwnPropertyNames$1(toIndexedObject$5(it));
2733 };
2734
2735 var objectGetOwnPropertySymbols = {};
2736
2737 objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
2738
2739 var wellKnownSymbolWrapped = {};
2740
2741 var wellKnownSymbol$6 = wellKnownSymbol$j;
2742 wellKnownSymbolWrapped.f = wellKnownSymbol$6;
2743
2744 var path$k = path$q;
2745 var hasOwn$6 = hasOwnProperty_1;
2746 var wrappedWellKnownSymbolModule$1 = wellKnownSymbolWrapped;
2747 var defineProperty$5 = objectDefineProperty.f;
2748
2749 var defineWellKnownSymbol$l = function (NAME) {
2750 var Symbol = path$k.Symbol || (path$k.Symbol = {});
2751 if (!hasOwn$6(Symbol, NAME)) defineProperty$5(Symbol, NAME, {
2752 value: wrappedWellKnownSymbolModule$1.f(NAME)
2753 });
2754 };
2755
2756 var $$u = _export;
2757 var global$f = global$M;
2758 var getBuiltIn$4 = getBuiltIn$9;
2759 var apply$4 = functionApply;
2760 var call$2 = functionCall;
2761 var uncurryThis$c = functionUncurryThis;
2762 var DESCRIPTORS$9 = descriptors;
2763 var NATIVE_SYMBOL = nativeSymbol;
2764 var fails$e = fails$r;
2765 var hasOwn$5 = hasOwnProperty_1;
2766 var isArray$a = isArray$d;
2767 var isCallable$2 = isCallable$h;
2768 var isObject$7 = isObject$f;
2769 var isPrototypeOf$c = objectIsPrototypeOf;
2770 var isSymbol = isSymbol$3;
2771 var anObject$3 = anObject$b;
2772 var toObject$7 = toObject$e;
2773 var toIndexedObject$4 = toIndexedObject$b;
2774 var toPropertyKey = toPropertyKey$4;
2775 var $toString = toString$7;
2776 var createPropertyDescriptor = createPropertyDescriptor$5;
2777 var nativeObjectCreate = objectCreate;
2778 var objectKeys$2 = objectKeys$4;
2779 var getOwnPropertyNamesModule$2 = objectGetOwnPropertyNames;
2780 var getOwnPropertyNamesExternal = objectGetOwnPropertyNamesExternal;
2781 var getOwnPropertySymbolsModule$2 = objectGetOwnPropertySymbols;
2782 var getOwnPropertyDescriptorModule$1 = objectGetOwnPropertyDescriptor;
2783 var definePropertyModule$1 = objectDefineProperty;
2784 var definePropertiesModule = objectDefineProperties;
2785 var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
2786 var arraySlice$2 = arraySlice$5;
2787 var redefine$1 = redefine$4;
2788 var shared = shared$4.exports;
2789 var sharedKey = sharedKey$4;
2790 var hiddenKeys$1 = hiddenKeys$6;
2791 var uid$1 = uid$4;
2792 var wellKnownSymbol$5 = wellKnownSymbol$j;
2793 var wrappedWellKnownSymbolModule = wellKnownSymbolWrapped;
2794 var defineWellKnownSymbol$k = defineWellKnownSymbol$l;
2795 var setToStringTag$2 = setToStringTag$5;
2796 var InternalStateModule$2 = internalState;
2797 var $forEach$1 = arrayIteration.forEach;
2798 var HIDDEN = sharedKey('hidden');
2799 var SYMBOL = 'Symbol';
2800 var PROTOTYPE = 'prototype';
2801 var TO_PRIMITIVE = wellKnownSymbol$5('toPrimitive');
2802 var setInternalState$2 = InternalStateModule$2.set;
2803 var getInternalState = InternalStateModule$2.getterFor(SYMBOL);
2804 var ObjectPrototype$1 = Object[PROTOTYPE];
2805 var $Symbol = global$f.Symbol;
2806 var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];
2807 var TypeError$8 = global$f.TypeError;
2808 var QObject = global$f.QObject;
2809 var $stringify$1 = getBuiltIn$4('JSON', 'stringify');
2810 var nativeGetOwnPropertyDescriptor$1 = getOwnPropertyDescriptorModule$1.f;
2811 var nativeDefineProperty = definePropertyModule$1.f;
2812 var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
2813 var nativePropertyIsEnumerable = propertyIsEnumerableModule$1.f;
2814 var push$3 = uncurryThis$c([].push);
2815 var AllSymbols = shared('symbols');
2816 var ObjectPrototypeSymbols = shared('op-symbols');
2817 var StringToSymbolRegistry = shared('string-to-symbol-registry');
2818 var SymbolToStringRegistry = shared('symbol-to-string-registry');
2819 var WellKnownSymbolsStore = shared('wks'); // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
2820
2821 var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
2822
2823 var setSymbolDescriptor = DESCRIPTORS$9 && fails$e(function () {
2824 return nativeObjectCreate(nativeDefineProperty({}, 'a', {
2825 get: function () {
2826 return nativeDefineProperty(this, 'a', {
2827 value: 7
2828 }).a;
2829 }
2830 })).a != 7;
2831 }) ? function (O, P, Attributes) {
2832 var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$1(ObjectPrototype$1, P);
2833 if (ObjectPrototypeDescriptor) delete ObjectPrototype$1[P];
2834 nativeDefineProperty(O, P, Attributes);
2835
2836 if (ObjectPrototypeDescriptor && O !== ObjectPrototype$1) {
2837 nativeDefineProperty(ObjectPrototype$1, P, ObjectPrototypeDescriptor);
2838 }
2839 } : nativeDefineProperty;
2840
2841 var wrap$1 = function (tag, description) {
2842 var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);
2843 setInternalState$2(symbol, {
2844 type: SYMBOL,
2845 tag: tag,
2846 description: description
2847 });
2848 if (!DESCRIPTORS$9) symbol.description = description;
2849 return symbol;
2850 };
2851
2852 var $defineProperty = function defineProperty(O, P, Attributes) {
2853 if (O === ObjectPrototype$1) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
2854 anObject$3(O);
2855 var key = toPropertyKey(P);
2856 anObject$3(Attributes);
2857
2858 if (hasOwn$5(AllSymbols, key)) {
2859 if (!Attributes.enumerable) {
2860 if (!hasOwn$5(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
2861 O[HIDDEN][key] = true;
2862 } else {
2863 if (hasOwn$5(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
2864 Attributes = nativeObjectCreate(Attributes, {
2865 enumerable: createPropertyDescriptor(0, false)
2866 });
2867 }
2868
2869 return setSymbolDescriptor(O, key, Attributes);
2870 }
2871
2872 return nativeDefineProperty(O, key, Attributes);
2873 };
2874
2875 var $defineProperties = function defineProperties(O, Properties) {
2876 anObject$3(O);
2877 var properties = toIndexedObject$4(Properties);
2878 var keys = objectKeys$2(properties).concat($getOwnPropertySymbols(properties));
2879 $forEach$1(keys, function (key) {
2880 if (!DESCRIPTORS$9 || call$2($propertyIsEnumerable$1, properties, key)) $defineProperty(O, key, properties[key]);
2881 });
2882 return O;
2883 };
2884
2885 var $create = function create(O, Properties) {
2886 return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
2887 };
2888
2889 var $propertyIsEnumerable$1 = function propertyIsEnumerable(V) {
2890 var P = toPropertyKey(V);
2891 var enumerable = call$2(nativePropertyIsEnumerable, this, P);
2892 if (this === ObjectPrototype$1 && hasOwn$5(AllSymbols, P) && !hasOwn$5(ObjectPrototypeSymbols, P)) return false;
2893 return enumerable || !hasOwn$5(this, P) || !hasOwn$5(AllSymbols, P) || hasOwn$5(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;
2894 };
2895
2896 var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
2897 var it = toIndexedObject$4(O);
2898 var key = toPropertyKey(P);
2899 if (it === ObjectPrototype$1 && hasOwn$5(AllSymbols, key) && !hasOwn$5(ObjectPrototypeSymbols, key)) return;
2900 var descriptor = nativeGetOwnPropertyDescriptor$1(it, key);
2901
2902 if (descriptor && hasOwn$5(AllSymbols, key) && !(hasOwn$5(it, HIDDEN) && it[HIDDEN][key])) {
2903 descriptor.enumerable = true;
2904 }
2905
2906 return descriptor;
2907 };
2908
2909 var $getOwnPropertyNames = function getOwnPropertyNames(O) {
2910 var names = nativeGetOwnPropertyNames(toIndexedObject$4(O));
2911 var result = [];
2912 $forEach$1(names, function (key) {
2913 if (!hasOwn$5(AllSymbols, key) && !hasOwn$5(hiddenKeys$1, key)) push$3(result, key);
2914 });
2915 return result;
2916 };
2917
2918 var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
2919 var IS_OBJECT_PROTOTYPE = O === ObjectPrototype$1;
2920 var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject$4(O));
2921 var result = [];
2922 $forEach$1(names, function (key) {
2923 if (hasOwn$5(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn$5(ObjectPrototype$1, key))) {
2924 push$3(result, AllSymbols[key]);
2925 }
2926 });
2927 return result;
2928 }; // `Symbol` constructor
2929 // https://tc39.es/ecma262/#sec-symbol-constructor
2930
2931
2932 if (!NATIVE_SYMBOL) {
2933 $Symbol = function Symbol() {
2934 if (isPrototypeOf$c(SymbolPrototype, this)) throw TypeError$8('Symbol is not a constructor');
2935 var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]);
2936 var tag = uid$1(description);
2937
2938 var setter = function (value) {
2939 if (this === ObjectPrototype$1) call$2(setter, ObjectPrototypeSymbols, value);
2940 if (hasOwn$5(this, HIDDEN) && hasOwn$5(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
2941 setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
2942 };
2943
2944 if (DESCRIPTORS$9 && USE_SETTER) setSymbolDescriptor(ObjectPrototype$1, tag, {
2945 configurable: true,
2946 set: setter
2947 });
2948 return wrap$1(tag, description);
2949 };
2950
2951 SymbolPrototype = $Symbol[PROTOTYPE];
2952 redefine$1(SymbolPrototype, 'toString', function toString() {
2953 return getInternalState(this).tag;
2954 });
2955 redefine$1($Symbol, 'withoutSetter', function (description) {
2956 return wrap$1(uid$1(description), description);
2957 });
2958 propertyIsEnumerableModule$1.f = $propertyIsEnumerable$1;
2959 definePropertyModule$1.f = $defineProperty;
2960 definePropertiesModule.f = $defineProperties;
2961 getOwnPropertyDescriptorModule$1.f = $getOwnPropertyDescriptor;
2962 getOwnPropertyNamesModule$2.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
2963 getOwnPropertySymbolsModule$2.f = $getOwnPropertySymbols;
2964
2965 wrappedWellKnownSymbolModule.f = function (name) {
2966 return wrap$1(wellKnownSymbol$5(name), name);
2967 };
2968
2969 if (DESCRIPTORS$9) {
2970 // https://github.com/tc39/proposal-Symbol-description
2971 nativeDefineProperty(SymbolPrototype, 'description', {
2972 configurable: true,
2973 get: function description() {
2974 return getInternalState(this).description;
2975 }
2976 });
2977 }
2978 }
2979
2980 $$u({
2981 global: true,
2982 wrap: true,
2983 forced: !NATIVE_SYMBOL,
2984 sham: !NATIVE_SYMBOL
2985 }, {
2986 Symbol: $Symbol
2987 });
2988 $forEach$1(objectKeys$2(WellKnownSymbolsStore), function (name) {
2989 defineWellKnownSymbol$k(name);
2990 });
2991 $$u({
2992 target: SYMBOL,
2993 stat: true,
2994 forced: !NATIVE_SYMBOL
2995 }, {
2996 // `Symbol.for` method
2997 // https://tc39.es/ecma262/#sec-symbol.for
2998 'for': function (key) {
2999 var string = $toString(key);
3000 if (hasOwn$5(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
3001 var symbol = $Symbol(string);
3002 StringToSymbolRegistry[string] = symbol;
3003 SymbolToStringRegistry[symbol] = string;
3004 return symbol;
3005 },
3006 // `Symbol.keyFor` method
3007 // https://tc39.es/ecma262/#sec-symbol.keyfor
3008 keyFor: function keyFor(sym) {
3009 if (!isSymbol(sym)) throw TypeError$8(sym + ' is not a symbol');
3010 if (hasOwn$5(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
3011 },
3012 useSetter: function () {
3013 USE_SETTER = true;
3014 },
3015 useSimple: function () {
3016 USE_SETTER = false;
3017 }
3018 });
3019 $$u({
3020 target: 'Object',
3021 stat: true,
3022 forced: !NATIVE_SYMBOL,
3023 sham: !DESCRIPTORS$9
3024 }, {
3025 // `Object.create` method
3026 // https://tc39.es/ecma262/#sec-object.create
3027 create: $create,
3028 // `Object.defineProperty` method
3029 // https://tc39.es/ecma262/#sec-object.defineproperty
3030 defineProperty: $defineProperty,
3031 // `Object.defineProperties` method
3032 // https://tc39.es/ecma262/#sec-object.defineproperties
3033 defineProperties: $defineProperties,
3034 // `Object.getOwnPropertyDescriptor` method
3035 // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
3036 getOwnPropertyDescriptor: $getOwnPropertyDescriptor
3037 });
3038 $$u({
3039 target: 'Object',
3040 stat: true,
3041 forced: !NATIVE_SYMBOL
3042 }, {
3043 // `Object.getOwnPropertyNames` method
3044 // https://tc39.es/ecma262/#sec-object.getownpropertynames
3045 getOwnPropertyNames: $getOwnPropertyNames,
3046 // `Object.getOwnPropertySymbols` method
3047 // https://tc39.es/ecma262/#sec-object.getownpropertysymbols
3048 getOwnPropertySymbols: $getOwnPropertySymbols
3049 }); // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
3050 // https://bugs.chromium.org/p/v8/issues/detail?id=3443
3051
3052 $$u({
3053 target: 'Object',
3054 stat: true,
3055 forced: fails$e(function () {
3056 getOwnPropertySymbolsModule$2.f(1);
3057 })
3058 }, {
3059 getOwnPropertySymbols: function getOwnPropertySymbols(it) {
3060 return getOwnPropertySymbolsModule$2.f(toObject$7(it));
3061 }
3062 }); // `JSON.stringify` method behavior with symbols
3063 // https://tc39.es/ecma262/#sec-json.stringify
3064
3065 if ($stringify$1) {
3066 var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails$e(function () {
3067 var symbol = $Symbol(); // MS Edge converts symbol values to JSON as {}
3068
3069 return $stringify$1([symbol]) != '[null]' // WebKit converts symbol values to JSON as null
3070 || $stringify$1({
3071 a: symbol
3072 }) != '{}' // V8 throws on boxed symbols
3073 || $stringify$1(Object(symbol)) != '{}';
3074 });
3075 $$u({
3076 target: 'JSON',
3077 stat: true,
3078 forced: FORCED_JSON_STRINGIFY
3079 }, {
3080 // eslint-disable-next-line no-unused-vars -- required for `.length`
3081 stringify: function stringify(it, replacer, space) {
3082 var args = arraySlice$2(arguments);
3083 var $replacer = replacer;
3084 if (!isObject$7(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
3085
3086 if (!isArray$a(replacer)) replacer = function (key, value) {
3087 if (isCallable$2($replacer)) value = call$2($replacer, this, key, value);
3088 if (!isSymbol(value)) return value;
3089 };
3090 args[1] = replacer;
3091 return apply$4($stringify$1, null, args);
3092 }
3093 });
3094 } // `Symbol.prototype[@@toPrimitive]` method
3095 // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
3096
3097
3098 if (!SymbolPrototype[TO_PRIMITIVE]) {
3099 var valueOf = SymbolPrototype.valueOf; // eslint-disable-next-line no-unused-vars -- required for .length
3100
3101 redefine$1(SymbolPrototype, TO_PRIMITIVE, function (hint) {
3102 // TODO: improve hint logic
3103 return call$2(valueOf, this);
3104 });
3105 } // `Symbol.prototype[@@toStringTag]` property
3106 // https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
3107
3108
3109 setToStringTag$2($Symbol, SYMBOL);
3110 hiddenKeys$1[HIDDEN] = true;
3111
3112 var path$j = path$q;
3113 var getOwnPropertySymbols$2 = path$j.Object.getOwnPropertySymbols;
3114
3115 var parent$J = getOwnPropertySymbols$2;
3116 var getOwnPropertySymbols$1 = parent$J;
3117
3118 var getOwnPropertySymbols = getOwnPropertySymbols$1;
3119
3120 var getOwnPropertyDescriptor$3 = {exports: {}};
3121
3122 var $$t = _export;
3123 var fails$d = fails$r;
3124 var toIndexedObject$3 = toIndexedObject$b;
3125 var nativeGetOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
3126 var DESCRIPTORS$8 = descriptors;
3127 var FAILS_ON_PRIMITIVES$3 = fails$d(function () {
3128 nativeGetOwnPropertyDescriptor(1);
3129 });
3130 var FORCED$5 = !DESCRIPTORS$8 || FAILS_ON_PRIMITIVES$3; // `Object.getOwnPropertyDescriptor` method
3131 // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
3132
3133 $$t({
3134 target: 'Object',
3135 stat: true,
3136 forced: FORCED$5,
3137 sham: !DESCRIPTORS$8
3138 }, {
3139 getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
3140 return nativeGetOwnPropertyDescriptor(toIndexedObject$3(it), key);
3141 }
3142 });
3143
3144 var path$i = path$q;
3145 var Object$3 = path$i.Object;
3146
3147 var getOwnPropertyDescriptor$2 = getOwnPropertyDescriptor$3.exports = function getOwnPropertyDescriptor(it, key) {
3148 return Object$3.getOwnPropertyDescriptor(it, key);
3149 };
3150
3151 if (Object$3.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor$2.sham = true;
3152
3153 var parent$I = getOwnPropertyDescriptor$3.exports;
3154 var getOwnPropertyDescriptor$1 = parent$I;
3155
3156 var getOwnPropertyDescriptor = getOwnPropertyDescriptor$1;
3157
3158 var getBuiltIn$3 = getBuiltIn$9;
3159 var uncurryThis$b = functionUncurryThis;
3160 var getOwnPropertyNamesModule$1 = objectGetOwnPropertyNames;
3161 var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
3162 var anObject$2 = anObject$b;
3163 var concat$5 = uncurryThis$b([].concat); // all object keys, includes non-enumerable and symbols
3164
3165 var ownKeys$6 = getBuiltIn$3('Reflect', 'ownKeys') || function ownKeys(it) {
3166 var keys = getOwnPropertyNamesModule$1.f(anObject$2(it));
3167 var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
3168 return getOwnPropertySymbols ? concat$5(keys, getOwnPropertySymbols(it)) : keys;
3169 };
3170
3171 var $$s = _export;
3172 var DESCRIPTORS$7 = descriptors;
3173 var ownKeys$5 = ownKeys$6;
3174 var toIndexedObject$2 = toIndexedObject$b;
3175 var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
3176 var createProperty$3 = createProperty$6; // `Object.getOwnPropertyDescriptors` method
3177 // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
3178
3179 $$s({
3180 target: 'Object',
3181 stat: true,
3182 sham: !DESCRIPTORS$7
3183 }, {
3184 getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
3185 var O = toIndexedObject$2(object);
3186 var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
3187 var keys = ownKeys$5(O);
3188 var result = {};
3189 var index = 0;
3190 var key, descriptor;
3191
3192 while (keys.length > index) {
3193 descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);
3194 if (descriptor !== undefined) createProperty$3(result, key, descriptor);
3195 }
3196
3197 return result;
3198 }
3199 });
3200
3201 var path$h = path$q;
3202 var getOwnPropertyDescriptors$2 = path$h.Object.getOwnPropertyDescriptors;
3203
3204 var parent$H = getOwnPropertyDescriptors$2;
3205 var getOwnPropertyDescriptors$1 = parent$H;
3206
3207 var getOwnPropertyDescriptors = getOwnPropertyDescriptors$1;
3208
3209 var defineProperties$4 = {exports: {}};
3210
3211 var $$r = _export;
3212 var DESCRIPTORS$6 = descriptors;
3213 var defineProperties$3 = objectDefineProperties.f; // `Object.defineProperties` method
3214 // https://tc39.es/ecma262/#sec-object.defineproperties
3215 // eslint-disable-next-line es/no-object-defineproperties -- safe
3216
3217 $$r({
3218 target: 'Object',
3219 stat: true,
3220 forced: Object.defineProperties !== defineProperties$3,
3221 sham: !DESCRIPTORS$6
3222 }, {
3223 defineProperties: defineProperties$3
3224 });
3225
3226 var path$g = path$q;
3227 var Object$2 = path$g.Object;
3228
3229 var defineProperties$2 = defineProperties$4.exports = function defineProperties(T, D) {
3230 return Object$2.defineProperties(T, D);
3231 };
3232
3233 if (Object$2.defineProperties.sham) defineProperties$2.sham = true;
3234
3235 var parent$G = defineProperties$4.exports;
3236 var defineProperties$1 = parent$G;
3237
3238 var defineProperties = defineProperties$1;
3239
3240 var defineProperty$4 = defineProperty$a;
3241
3242 var $$q = _export;
3243 var isArray$9 = isArray$d; // `Array.isArray` method
3244 // https://tc39.es/ecma262/#sec-array.isarray
3245
3246 $$q({
3247 target: 'Array',
3248 stat: true
3249 }, {
3250 isArray: isArray$9
3251 });
3252
3253 var path$f = path$q;
3254 var isArray$8 = path$f.Array.isArray;
3255
3256 var parent$F = isArray$8;
3257 var isArray$7 = parent$F;
3258
3259 var parent$E = isArray$7;
3260 var isArray$6 = parent$E;
3261
3262 var parent$D = isArray$6;
3263 var isArray$5 = parent$D;
3264
3265 var isArray$4 = isArray$5;
3266
3267 function _arrayWithHoles(arr) {
3268 if (isArray$4(arr)) return arr;
3269 }
3270
3271 var $$p = _export;
3272 var global$e = global$M;
3273 var fails$c = fails$r;
3274 var isArray$3 = isArray$d;
3275 var isObject$6 = isObject$f;
3276 var toObject$6 = toObject$e;
3277 var lengthOfArrayLike$5 = lengthOfArrayLike$d;
3278 var createProperty$2 = createProperty$6;
3279 var arraySpeciesCreate$1 = arraySpeciesCreate$4;
3280 var arrayMethodHasSpeciesSupport$2 = arrayMethodHasSpeciesSupport$5;
3281 var wellKnownSymbol$4 = wellKnownSymbol$j;
3282 var V8_VERSION = engineV8Version;
3283 var IS_CONCAT_SPREADABLE = wellKnownSymbol$4('isConcatSpreadable');
3284 var MAX_SAFE_INTEGER$1 = 0x1FFFFFFFFFFFFF;
3285 var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
3286 var TypeError$7 = global$e.TypeError; // We can't use this feature detection in V8 since it causes
3287 // deoptimization and serious performance degradation
3288 // https://github.com/zloirock/core-js/issues/679
3289
3290 var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails$c(function () {
3291 var array = [];
3292 array[IS_CONCAT_SPREADABLE] = false;
3293 return array.concat()[0] !== array;
3294 });
3295 var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport$2('concat');
3296
3297 var isConcatSpreadable = function (O) {
3298 if (!isObject$6(O)) return false;
3299 var spreadable = O[IS_CONCAT_SPREADABLE];
3300 return spreadable !== undefined ? !!spreadable : isArray$3(O);
3301 };
3302
3303 var FORCED$4 = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT; // `Array.prototype.concat` method
3304 // https://tc39.es/ecma262/#sec-array.prototype.concat
3305 // with adding support of @@isConcatSpreadable and @@species
3306
3307 $$p({
3308 target: 'Array',
3309 proto: true,
3310 forced: FORCED$4
3311 }, {
3312 // eslint-disable-next-line no-unused-vars -- required for `.length`
3313 concat: function concat(arg) {
3314 var O = toObject$6(this);
3315 var A = arraySpeciesCreate$1(O, 0);
3316 var n = 0;
3317 var i, k, length, len, E;
3318
3319 for (i = -1, length = arguments.length; i < length; i++) {
3320 E = i === -1 ? O : arguments[i];
3321
3322 if (isConcatSpreadable(E)) {
3323 len = lengthOfArrayLike$5(E);
3324 if (n + len > MAX_SAFE_INTEGER$1) throw TypeError$7(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
3325
3326 for (k = 0; k < len; k++, n++) if (k in E) createProperty$2(A, n, E[k]);
3327 } else {
3328 if (n >= MAX_SAFE_INTEGER$1) throw TypeError$7(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
3329 createProperty$2(A, n++, E);
3330 }
3331 }
3332
3333 A.length = n;
3334 return A;
3335 }
3336 });
3337
3338 var defineWellKnownSymbol$j = defineWellKnownSymbol$l; // `Symbol.asyncIterator` well-known symbol
3339 // https://tc39.es/ecma262/#sec-symbol.asynciterator
3340
3341 defineWellKnownSymbol$j('asyncIterator');
3342
3343 var defineWellKnownSymbol$i = defineWellKnownSymbol$l; // `Symbol.hasInstance` well-known symbol
3344 // https://tc39.es/ecma262/#sec-symbol.hasinstance
3345
3346 defineWellKnownSymbol$i('hasInstance');
3347
3348 var defineWellKnownSymbol$h = defineWellKnownSymbol$l; // `Symbol.isConcatSpreadable` well-known symbol
3349 // https://tc39.es/ecma262/#sec-symbol.isconcatspreadable
3350
3351 defineWellKnownSymbol$h('isConcatSpreadable');
3352
3353 var defineWellKnownSymbol$g = defineWellKnownSymbol$l; // `Symbol.iterator` well-known symbol
3354 // https://tc39.es/ecma262/#sec-symbol.iterator
3355
3356 defineWellKnownSymbol$g('iterator');
3357
3358 var defineWellKnownSymbol$f = defineWellKnownSymbol$l; // `Symbol.match` well-known symbol
3359 // https://tc39.es/ecma262/#sec-symbol.match
3360
3361 defineWellKnownSymbol$f('match');
3362
3363 var defineWellKnownSymbol$e = defineWellKnownSymbol$l; // `Symbol.matchAll` well-known symbol
3364 // https://tc39.es/ecma262/#sec-symbol.matchall
3365
3366 defineWellKnownSymbol$e('matchAll');
3367
3368 var defineWellKnownSymbol$d = defineWellKnownSymbol$l; // `Symbol.replace` well-known symbol
3369 // https://tc39.es/ecma262/#sec-symbol.replace
3370
3371 defineWellKnownSymbol$d('replace');
3372
3373 var defineWellKnownSymbol$c = defineWellKnownSymbol$l; // `Symbol.search` well-known symbol
3374 // https://tc39.es/ecma262/#sec-symbol.search
3375
3376 defineWellKnownSymbol$c('search');
3377
3378 var defineWellKnownSymbol$b = defineWellKnownSymbol$l; // `Symbol.species` well-known symbol
3379 // https://tc39.es/ecma262/#sec-symbol.species
3380
3381 defineWellKnownSymbol$b('species');
3382
3383 var defineWellKnownSymbol$a = defineWellKnownSymbol$l; // `Symbol.split` well-known symbol
3384 // https://tc39.es/ecma262/#sec-symbol.split
3385
3386 defineWellKnownSymbol$a('split');
3387
3388 var defineWellKnownSymbol$9 = defineWellKnownSymbol$l; // `Symbol.toPrimitive` well-known symbol
3389 // https://tc39.es/ecma262/#sec-symbol.toprimitive
3390
3391 defineWellKnownSymbol$9('toPrimitive');
3392
3393 var defineWellKnownSymbol$8 = defineWellKnownSymbol$l; // `Symbol.toStringTag` well-known symbol
3394 // https://tc39.es/ecma262/#sec-symbol.tostringtag
3395
3396 defineWellKnownSymbol$8('toStringTag');
3397
3398 var defineWellKnownSymbol$7 = defineWellKnownSymbol$l; // `Symbol.unscopables` well-known symbol
3399 // https://tc39.es/ecma262/#sec-symbol.unscopables
3400
3401 defineWellKnownSymbol$7('unscopables');
3402
3403 var global$d = global$M;
3404 var setToStringTag$1 = setToStringTag$5; // JSON[@@toStringTag] property
3405 // https://tc39.es/ecma262/#sec-json-@@tostringtag
3406
3407 setToStringTag$1(global$d.JSON, 'JSON', true);
3408
3409 var path$e = path$q;
3410 var symbol$5 = path$e.Symbol;
3411
3412 var parent$C = symbol$5;
3413 var symbol$4 = parent$C;
3414
3415 var parent$B = symbol$4;
3416 var symbol$3 = parent$B;
3417
3418 var defineWellKnownSymbol$6 = defineWellKnownSymbol$l; // `Symbol.asyncDispose` well-known symbol
3419 // https://github.com/tc39/proposal-using-statement
3420
3421 defineWellKnownSymbol$6('asyncDispose');
3422
3423 var defineWellKnownSymbol$5 = defineWellKnownSymbol$l; // `Symbol.dispose` well-known symbol
3424 // https://github.com/tc39/proposal-using-statement
3425
3426 defineWellKnownSymbol$5('dispose');
3427
3428 var defineWellKnownSymbol$4 = defineWellKnownSymbol$l; // `Symbol.matcher` well-known symbol
3429 // https://github.com/tc39/proposal-pattern-matching
3430
3431 defineWellKnownSymbol$4('matcher');
3432
3433 var defineWellKnownSymbol$3 = defineWellKnownSymbol$l; // `Symbol.metadata` well-known symbol
3434 // https://github.com/tc39/proposal-decorators
3435
3436 defineWellKnownSymbol$3('metadata');
3437
3438 var defineWellKnownSymbol$2 = defineWellKnownSymbol$l; // `Symbol.observable` well-known symbol
3439 // https://github.com/tc39/proposal-observable
3440
3441 defineWellKnownSymbol$2('observable');
3442
3443 var defineWellKnownSymbol$1 = defineWellKnownSymbol$l; // `Symbol.patternMatch` well-known symbol
3444 // https://github.com/tc39/proposal-pattern-matching
3445
3446 defineWellKnownSymbol$1('patternMatch');
3447
3448 var defineWellKnownSymbol = defineWellKnownSymbol$l;
3449 defineWellKnownSymbol('replaceAll');
3450
3451 var parent$A = symbol$3; // TODO: Remove from `core-js@4`
3452 // TODO: Remove from `core-js@4`
3453
3454 var symbol$2 = parent$A;
3455
3456 var symbol$1 = symbol$2;
3457
3458 function _iterableToArrayLimit(arr, i) {
3459 var _i = arr == null ? null : typeof symbol$1 !== "undefined" && getIteratorMethod$1(arr) || arr["@@iterator"];
3460
3461 if (_i == null) return;
3462 var _arr = [];
3463 var _n = true;
3464 var _d = false;
3465
3466 var _s, _e;
3467
3468 try {
3469 for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
3470 _arr.push(_s.value);
3471
3472 if (i && _arr.length === i) break;
3473 }
3474 } catch (err) {
3475 _d = true;
3476 _e = err;
3477 } finally {
3478 try {
3479 if (!_n && _i["return"] != null) _i["return"]();
3480 } finally {
3481 if (_d) throw _e;
3482 }
3483 }
3484
3485 return _arr;
3486 }
3487
3488 var $$o = _export;
3489 var global$c = global$M;
3490 var isArray$2 = isArray$d;
3491 var isConstructor$1 = isConstructor$4;
3492 var isObject$5 = isObject$f;
3493 var toAbsoluteIndex$2 = toAbsoluteIndex$5;
3494 var lengthOfArrayLike$4 = lengthOfArrayLike$d;
3495 var toIndexedObject$1 = toIndexedObject$b;
3496 var createProperty$1 = createProperty$6;
3497 var wellKnownSymbol$3 = wellKnownSymbol$j;
3498 var arrayMethodHasSpeciesSupport$1 = arrayMethodHasSpeciesSupport$5;
3499 var un$Slice = arraySlice$5;
3500 var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport$1('slice');
3501 var SPECIES$1 = wellKnownSymbol$3('species');
3502 var Array$2 = global$c.Array;
3503 var max$1 = Math.max; // `Array.prototype.slice` method
3504 // https://tc39.es/ecma262/#sec-array.prototype.slice
3505 // fallback for not array-like ES3 strings and DOM objects
3506
3507 $$o({
3508 target: 'Array',
3509 proto: true,
3510 forced: !HAS_SPECIES_SUPPORT$1
3511 }, {
3512 slice: function slice(start, end) {
3513 var O = toIndexedObject$1(this);
3514 var length = lengthOfArrayLike$4(O);
3515 var k = toAbsoluteIndex$2(start, length);
3516 var fin = toAbsoluteIndex$2(end === undefined ? length : end, length); // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
3517
3518 var Constructor, result, n;
3519
3520 if (isArray$2(O)) {
3521 Constructor = O.constructor; // cross-realm fallback
3522
3523 if (isConstructor$1(Constructor) && (Constructor === Array$2 || isArray$2(Constructor.prototype))) {
3524 Constructor = undefined;
3525 } else if (isObject$5(Constructor)) {
3526 Constructor = Constructor[SPECIES$1];
3527 if (Constructor === null) Constructor = undefined;
3528 }
3529
3530 if (Constructor === Array$2 || Constructor === undefined) {
3531 return un$Slice(O, k, fin);
3532 }
3533 }
3534
3535 result = new (Constructor === undefined ? Array$2 : Constructor)(max$1(fin - k, 0));
3536
3537 for (n = 0; k < fin; k++, n++) if (k in O) createProperty$1(result, n, O[k]);
3538
3539 result.length = n;
3540 return result;
3541 }
3542 });
3543
3544 var entryVirtual$e = entryVirtual$k;
3545 var slice$6 = entryVirtual$e('Array').slice;
3546
3547 var isPrototypeOf$b = objectIsPrototypeOf;
3548 var method$9 = slice$6;
3549 var ArrayPrototype$9 = Array.prototype;
3550
3551 var slice$5 = function (it) {
3552 var own = it.slice;
3553 return it === ArrayPrototype$9 || isPrototypeOf$b(ArrayPrototype$9, it) && own === ArrayPrototype$9.slice ? method$9 : own;
3554 };
3555
3556 var parent$z = slice$5;
3557 var slice$4 = parent$z;
3558
3559 var parent$y = slice$4;
3560 var slice$3 = parent$y;
3561
3562 var parent$x = slice$3;
3563 var slice$2 = parent$x;
3564
3565 var slice$1 = slice$2;
3566
3567 var parent$w = from$4;
3568 var from$2 = parent$w;
3569
3570 var parent$v = from$2;
3571 var from$1 = parent$v;
3572
3573 var from = from$1;
3574
3575 function _arrayLikeToArray$4(arr, len) {
3576 if (len == null || len > arr.length) len = arr.length;
3577
3578 for (var i = 0, arr2 = new Array(len); i < len; i++) {
3579 arr2[i] = arr[i];
3580 }
3581
3582 return arr2;
3583 }
3584
3585 function _unsupportedIterableToArray$4(o, minLen) {
3586 var _context;
3587
3588 if (!o) return;
3589 if (typeof o === "string") return _arrayLikeToArray$4(o, minLen);
3590
3591 var n = slice$1(_context = Object.prototype.toString.call(o)).call(_context, 8, -1);
3592
3593 if (n === "Object" && o.constructor) n = o.constructor.name;
3594 if (n === "Map" || n === "Set") return from(o);
3595 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$4(o, minLen);
3596 }
3597
3598 function _nonIterableRest() {
3599 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3600 }
3601
3602 function _slicedToArray(arr, i) {
3603 return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$4(arr, i) || _nonIterableRest();
3604 }
3605
3606 var WrappedWellKnownSymbolModule = wellKnownSymbolWrapped;
3607 var iterator$5 = WrappedWellKnownSymbolModule.f('iterator');
3608
3609 var parent$u = iterator$5;
3610 var iterator$4 = parent$u;
3611
3612 var parent$t = iterator$4;
3613 var iterator$3 = parent$t;
3614
3615 var parent$s = iterator$3;
3616 var iterator$2 = parent$s;
3617
3618 var iterator$1 = iterator$2;
3619
3620 function _typeof(obj) {
3621 "@babel/helpers - typeof";
3622
3623 return _typeof = "function" == typeof symbol$1 && "symbol" == typeof iterator$1 ? function (obj) {
3624 return typeof obj;
3625 } : function (obj) {
3626 return obj && "function" == typeof symbol$1 && obj.constructor === symbol$1 && obj !== symbol$1.prototype ? "symbol" : typeof obj;
3627 }, _typeof(obj);
3628 }
3629
3630 function _arrayWithoutHoles(arr) {
3631 if (isArray$4(arr)) return _arrayLikeToArray$4(arr);
3632 }
3633
3634 function _iterableToArray(iter) {
3635 if (typeof symbol$1 !== "undefined" && getIteratorMethod$1(iter) != null || iter["@@iterator"] != null) return from(iter);
3636 }
3637
3638 function _nonIterableSpread() {
3639 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3640 }
3641
3642 function _toConsumableArray(arr) {
3643 return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$4(arr) || _nonIterableSpread();
3644 }
3645
3646 var symbol = symbol$4;
3647
3648 var entryVirtual$d = entryVirtual$k;
3649 var concat$4 = entryVirtual$d('Array').concat;
3650
3651 var isPrototypeOf$a = objectIsPrototypeOf;
3652 var method$8 = concat$4;
3653 var ArrayPrototype$8 = Array.prototype;
3654
3655 var concat$3 = function (it) {
3656 var own = it.concat;
3657 return it === ArrayPrototype$8 || isPrototypeOf$a(ArrayPrototype$8, it) && own === ArrayPrototype$8.concat ? method$8 : own;
3658 };
3659
3660 var parent$r = concat$3;
3661 var concat$2 = parent$r;
3662
3663 var concat$1 = concat$2;
3664
3665 var slice = slice$4;
3666
3667 var $$n = _export;
3668 var ownKeys$4 = ownKeys$6; // `Reflect.ownKeys` method
3669 // https://tc39.es/ecma262/#sec-reflect.ownkeys
3670
3671 $$n({
3672 target: 'Reflect',
3673 stat: true
3674 }, {
3675 ownKeys: ownKeys$4
3676 });
3677
3678 var path$d = path$q;
3679 var ownKeys$3 = path$d.Reflect.ownKeys;
3680
3681 var parent$q = ownKeys$3;
3682 var ownKeys$2 = parent$q;
3683
3684 var ownKeys$1 = ownKeys$2;
3685
3686 var isArray$1 = isArray$7;
3687
3688 var $$m = _export;
3689 var toObject$5 = toObject$e;
3690 var nativeKeys = objectKeys$4;
3691 var fails$b = fails$r;
3692 var FAILS_ON_PRIMITIVES$2 = fails$b(function () {
3693 nativeKeys(1);
3694 }); // `Object.keys` method
3695 // https://tc39.es/ecma262/#sec-object.keys
3696
3697 $$m({
3698 target: 'Object',
3699 stat: true,
3700 forced: FAILS_ON_PRIMITIVES$2
3701 }, {
3702 keys: function keys(it) {
3703 return nativeKeys(toObject$5(it));
3704 }
3705 });
3706
3707 var path$c = path$q;
3708 var keys$6 = path$c.Object.keys;
3709
3710 var parent$p = keys$6;
3711 var keys$5 = parent$p;
3712
3713 var keys$4 = keys$5;
3714
3715 var $$l = _export;
3716 var global$b = global$M;
3717 var uncurryThis$a = functionUncurryThis;
3718 var Date$1 = global$b.Date;
3719 var getTime = uncurryThis$a(Date$1.prototype.getTime); // `Date.now` method
3720 // https://tc39.es/ecma262/#sec-date.now
3721
3722 $$l({
3723 target: 'Date',
3724 stat: true
3725 }, {
3726 now: function now() {
3727 return getTime(new Date$1());
3728 }
3729 });
3730
3731 var path$b = path$q;
3732 path$b.Date.now;
3733
3734 var $forEach = arrayIteration.forEach;
3735 var arrayMethodIsStrict$3 = arrayMethodIsStrict$5;
3736 var STRICT_METHOD$3 = arrayMethodIsStrict$3('forEach'); // `Array.prototype.forEach` method implementation
3737 // https://tc39.es/ecma262/#sec-array.prototype.foreach
3738
3739 var arrayForEach = !STRICT_METHOD$3 ? function forEach(callbackfn
3740 /* , thisArg */
3741 ) {
3742 return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); // eslint-disable-next-line es/no-array-prototype-foreach -- safe
3743 } : [].forEach;
3744
3745 var $$k = _export;
3746 var forEach$5 = arrayForEach; // `Array.prototype.forEach` method
3747 // https://tc39.es/ecma262/#sec-array.prototype.foreach
3748 // eslint-disable-next-line es/no-array-prototype-foreach -- safe
3749
3750 $$k({
3751 target: 'Array',
3752 proto: true,
3753 forced: [].forEach != forEach$5
3754 }, {
3755 forEach: forEach$5
3756 });
3757
3758 var entryVirtual$c = entryVirtual$k;
3759 var forEach$4 = entryVirtual$c('Array').forEach;
3760
3761 var parent$o = forEach$4;
3762 var forEach$3 = parent$o;
3763
3764 var classof$5 = classof$c;
3765 var hasOwn$4 = hasOwnProperty_1;
3766 var isPrototypeOf$9 = objectIsPrototypeOf;
3767 var method$7 = forEach$3;
3768 var ArrayPrototype$7 = Array.prototype;
3769 var DOMIterables$3 = {
3770 DOMTokenList: true,
3771 NodeList: true
3772 };
3773
3774 var forEach$2 = function (it) {
3775 var own = it.forEach;
3776 return it === ArrayPrototype$7 || isPrototypeOf$9(ArrayPrototype$7, it) && own === ArrayPrototype$7.forEach || hasOwn$4(DOMIterables$3, classof$5(it)) ? method$7 : own;
3777 };
3778
3779 var forEach$1 = forEach$2;
3780
3781 var $$j = _export;
3782 var uncurryThis$9 = functionUncurryThis;
3783 var isArray = isArray$d;
3784 var un$Reverse = uncurryThis$9([].reverse);
3785 var test$1 = [1, 2]; // `Array.prototype.reverse` method
3786 // https://tc39.es/ecma262/#sec-array.prototype.reverse
3787 // fix for Safari 12.0 bug
3788 // https://bugs.webkit.org/show_bug.cgi?id=188794
3789
3790 $$j({
3791 target: 'Array',
3792 proto: true,
3793 forced: String(test$1) === String(test$1.reverse())
3794 }, {
3795 reverse: function reverse() {
3796 // eslint-disable-next-line no-self-assign -- dirty hack
3797 if (isArray(this)) this.length = this.length;
3798 return un$Reverse(this);
3799 }
3800 });
3801
3802 var entryVirtual$b = entryVirtual$k;
3803 var reverse$3 = entryVirtual$b('Array').reverse;
3804
3805 var isPrototypeOf$8 = objectIsPrototypeOf;
3806 var method$6 = reverse$3;
3807 var ArrayPrototype$6 = Array.prototype;
3808
3809 var reverse$2 = function (it) {
3810 var own = it.reverse;
3811 return it === ArrayPrototype$6 || isPrototypeOf$8(ArrayPrototype$6, it) && own === ArrayPrototype$6.reverse ? method$6 : own;
3812 };
3813
3814 var parent$n = reverse$2;
3815 var reverse$1 = parent$n;
3816
3817 var reverse = reverse$1;
3818
3819 var $$i = _export;
3820 var global$a = global$M;
3821 var toAbsoluteIndex$1 = toAbsoluteIndex$5;
3822 var toIntegerOrInfinity = toIntegerOrInfinity$4;
3823 var lengthOfArrayLike$3 = lengthOfArrayLike$d;
3824 var toObject$4 = toObject$e;
3825 var arraySpeciesCreate = arraySpeciesCreate$4;
3826 var createProperty = createProperty$6;
3827 var arrayMethodHasSpeciesSupport = arrayMethodHasSpeciesSupport$5;
3828 var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
3829 var TypeError$6 = global$a.TypeError;
3830 var max = Math.max;
3831 var min = Math.min;
3832 var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
3833 var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded'; // `Array.prototype.splice` method
3834 // https://tc39.es/ecma262/#sec-array.prototype.splice
3835 // with adding support of @@species
3836
3837 $$i({
3838 target: 'Array',
3839 proto: true,
3840 forced: !HAS_SPECIES_SUPPORT
3841 }, {
3842 splice: function splice(start, deleteCount
3843 /* , ...items */
3844 ) {
3845 var O = toObject$4(this);
3846 var len = lengthOfArrayLike$3(O);
3847 var actualStart = toAbsoluteIndex$1(start, len);
3848 var argumentsLength = arguments.length;
3849 var insertCount, actualDeleteCount, A, k, from, to;
3850
3851 if (argumentsLength === 0) {
3852 insertCount = actualDeleteCount = 0;
3853 } else if (argumentsLength === 1) {
3854 insertCount = 0;
3855 actualDeleteCount = len - actualStart;
3856 } else {
3857 insertCount = argumentsLength - 2;
3858 actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
3859 }
3860
3861 if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {
3862 throw TypeError$6(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
3863 }
3864
3865 A = arraySpeciesCreate(O, actualDeleteCount);
3866
3867 for (k = 0; k < actualDeleteCount; k++) {
3868 from = actualStart + k;
3869 if (from in O) createProperty(A, k, O[from]);
3870 }
3871
3872 A.length = actualDeleteCount;
3873
3874 if (insertCount < actualDeleteCount) {
3875 for (k = actualStart; k < len - actualDeleteCount; k++) {
3876 from = k + actualDeleteCount;
3877 to = k + insertCount;
3878 if (from in O) O[to] = O[from];else delete O[to];
3879 }
3880
3881 for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];
3882 } else if (insertCount > actualDeleteCount) {
3883 for (k = len - actualDeleteCount; k > actualStart; k--) {
3884 from = k + actualDeleteCount - 1;
3885 to = k + insertCount - 1;
3886 if (from in O) O[to] = O[from];else delete O[to];
3887 }
3888 }
3889
3890 for (k = 0; k < insertCount; k++) {
3891 O[k + actualStart] = arguments[k + 2];
3892 }
3893
3894 O.length = len - actualDeleteCount + insertCount;
3895 return A;
3896 }
3897 });
3898
3899 var entryVirtual$a = entryVirtual$k;
3900 var splice$3 = entryVirtual$a('Array').splice;
3901
3902 var isPrototypeOf$7 = objectIsPrototypeOf;
3903 var method$5 = splice$3;
3904 var ArrayPrototype$5 = Array.prototype;
3905
3906 var splice$2 = function (it) {
3907 var own = it.splice;
3908 return it === ArrayPrototype$5 || isPrototypeOf$7(ArrayPrototype$5, it) && own === ArrayPrototype$5.splice ? method$5 : own;
3909 };
3910
3911 var parent$m = splice$2;
3912 var splice$1 = parent$m;
3913
3914 var splice = splice$1;
3915
3916 var DESCRIPTORS$5 = descriptors;
3917 var uncurryThis$8 = functionUncurryThis;
3918 var call$1 = functionCall;
3919 var fails$a = fails$r;
3920 var objectKeys$1 = objectKeys$4;
3921 var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
3922 var propertyIsEnumerableModule = objectPropertyIsEnumerable;
3923 var toObject$3 = toObject$e;
3924 var IndexedObject = indexedObject; // eslint-disable-next-line es/no-object-assign -- safe
3925
3926 var $assign = Object.assign; // eslint-disable-next-line es/no-object-defineproperty -- required for testing
3927
3928 var defineProperty$3 = Object.defineProperty;
3929 var concat = uncurryThis$8([].concat); // `Object.assign` method
3930 // https://tc39.es/ecma262/#sec-object.assign
3931
3932 var objectAssign = !$assign || fails$a(function () {
3933 // should have correct order of operations (Edge bug)
3934 if (DESCRIPTORS$5 && $assign({
3935 b: 1
3936 }, $assign(defineProperty$3({}, 'a', {
3937 enumerable: true,
3938 get: function () {
3939 defineProperty$3(this, 'b', {
3940 value: 3,
3941 enumerable: false
3942 });
3943 }
3944 }), {
3945 b: 2
3946 })).b !== 1) return true; // should work with symbols and should have deterministic property order (V8 bug)
3947
3948 var A = {};
3949 var B = {}; // eslint-disable-next-line es/no-symbol -- safe
3950
3951 var symbol = Symbol();
3952 var alphabet = 'abcdefghijklmnopqrst';
3953 A[symbol] = 7;
3954 alphabet.split('').forEach(function (chr) {
3955 B[chr] = chr;
3956 });
3957 return $assign({}, A)[symbol] != 7 || objectKeys$1($assign({}, B)).join('') != alphabet;
3958 }) ? function assign(target, source) {
3959 // eslint-disable-line no-unused-vars -- required for `.length`
3960 var T = toObject$3(target);
3961 var argumentsLength = arguments.length;
3962 var index = 1;
3963 var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
3964 var propertyIsEnumerable = propertyIsEnumerableModule.f;
3965
3966 while (argumentsLength > index) {
3967 var S = IndexedObject(arguments[index++]);
3968 var keys = getOwnPropertySymbols ? concat(objectKeys$1(S), getOwnPropertySymbols(S)) : objectKeys$1(S);
3969 var length = keys.length;
3970 var j = 0;
3971 var key;
3972
3973 while (length > j) {
3974 key = keys[j++];
3975 if (!DESCRIPTORS$5 || call$1(propertyIsEnumerable, S, key)) T[key] = S[key];
3976 }
3977 }
3978
3979 return T;
3980 } : $assign;
3981
3982 var $$h = _export;
3983 var assign$5 = objectAssign; // `Object.assign` method
3984 // https://tc39.es/ecma262/#sec-object.assign
3985 // eslint-disable-next-line es/no-object-assign -- required for testing
3986
3987 $$h({
3988 target: 'Object',
3989 stat: true,
3990 forced: Object.assign !== assign$5
3991 }, {
3992 assign: assign$5
3993 });
3994
3995 var path$a = path$q;
3996 var assign$4 = path$a.Object.assign;
3997
3998 var parent$l = assign$4;
3999 var assign$3 = parent$l;
4000
4001 var assign$2 = assign$3;
4002
4003 var $$g = _export;
4004 var $includes = arrayIncludes.includes;
4005 // https://tc39.es/ecma262/#sec-array.prototype.includes
4006
4007 $$g({
4008 target: 'Array',
4009 proto: true
4010 }, {
4011 includes: function includes(el
4012 /* , fromIndex = 0 */
4013 ) {
4014 return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
4015 }
4016 }); // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
4017
4018 var entryVirtual$9 = entryVirtual$k;
4019 entryVirtual$9('Array').includes;
4020
4021 var isObject$4 = isObject$f;
4022 var classof$4 = classofRaw$1;
4023 var wellKnownSymbol$2 = wellKnownSymbol$j;
4024 var MATCH$1 = wellKnownSymbol$2('match'); // `IsRegExp` abstract operation
4025 // https://tc39.es/ecma262/#sec-isregexp
4026
4027 var isRegexp = function (it) {
4028 var isRegExp;
4029 return isObject$4(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$4(it) == 'RegExp');
4030 };
4031
4032 var global$9 = global$M;
4033 var isRegExp = isRegexp;
4034 var TypeError$5 = global$9.TypeError;
4035
4036 var notARegexp = function (it) {
4037 if (isRegExp(it)) {
4038 throw TypeError$5("The method doesn't accept regular expressions");
4039 }
4040
4041 return it;
4042 };
4043
4044 var wellKnownSymbol$1 = wellKnownSymbol$j;
4045 var MATCH = wellKnownSymbol$1('match');
4046
4047 var correctIsRegexpLogic = function (METHOD_NAME) {
4048 var regexp = /./;
4049
4050 try {
4051 '/./'[METHOD_NAME](regexp);
4052 } catch (error1) {
4053 try {
4054 regexp[MATCH] = false;
4055 return '/./'[METHOD_NAME](regexp);
4056 } catch (error2) {
4057 /* empty */
4058 }
4059 }
4060
4061 return false;
4062 };
4063
4064 var $$f = _export;
4065 var uncurryThis$7 = functionUncurryThis;
4066 var notARegExp = notARegexp;
4067 var requireObjectCoercible$1 = requireObjectCoercible$5;
4068 var toString$3 = toString$7;
4069 var correctIsRegExpLogic = correctIsRegexpLogic;
4070 var stringIndexOf = uncurryThis$7(''.indexOf); // `String.prototype.includes` method
4071 // https://tc39.es/ecma262/#sec-string.prototype.includes
4072
4073 $$f({
4074 target: 'String',
4075 proto: true,
4076 forced: !correctIsRegExpLogic('includes')
4077 }, {
4078 includes: function includes(searchString
4079 /* , position = 0 */
4080 ) {
4081 return !!~stringIndexOf(toString$3(requireObjectCoercible$1(this)), toString$3(notARegExp(searchString)), arguments.length > 1 ? arguments[1] : undefined);
4082 }
4083 });
4084
4085 var entryVirtual$8 = entryVirtual$k;
4086 entryVirtual$8('String').includes;
4087
4088 var $$e = _export;
4089 var fails$9 = fails$r;
4090 var toObject$2 = toObject$e;
4091 var nativeGetPrototypeOf = objectGetPrototypeOf;
4092 var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
4093 var FAILS_ON_PRIMITIVES$1 = fails$9(function () {
4094 nativeGetPrototypeOf(1);
4095 }); // `Object.getPrototypeOf` method
4096 // https://tc39.es/ecma262/#sec-object.getprototypeof
4097
4098 $$e({
4099 target: 'Object',
4100 stat: true,
4101 forced: FAILS_ON_PRIMITIVES$1,
4102 sham: !CORRECT_PROTOTYPE_GETTER
4103 }, {
4104 getPrototypeOf: function getPrototypeOf(it) {
4105 return nativeGetPrototypeOf(toObject$2(it));
4106 }
4107 });
4108
4109 var path$9 = path$q;
4110 var getPrototypeOf$4 = path$9.Object.getPrototypeOf;
4111
4112 var parent$k = getPrototypeOf$4;
4113 var getPrototypeOf$3 = parent$k;
4114
4115 var DESCRIPTORS$4 = descriptors;
4116 var uncurryThis$6 = functionUncurryThis;
4117 var objectKeys = objectKeys$4;
4118 var toIndexedObject = toIndexedObject$b;
4119 var $propertyIsEnumerable = objectPropertyIsEnumerable.f;
4120 var propertyIsEnumerable = uncurryThis$6($propertyIsEnumerable);
4121 var push$2 = uncurryThis$6([].push); // `Object.{ entries, values }` methods implementation
4122
4123 var createMethod$1 = function (TO_ENTRIES) {
4124 return function (it) {
4125 var O = toIndexedObject(it);
4126 var keys = objectKeys(O);
4127 var length = keys.length;
4128 var i = 0;
4129 var result = [];
4130 var key;
4131
4132 while (length > i) {
4133 key = keys[i++];
4134
4135 if (!DESCRIPTORS$4 || propertyIsEnumerable(O, key)) {
4136 push$2(result, TO_ENTRIES ? [key, O[key]] : O[key]);
4137 }
4138 }
4139
4140 return result;
4141 };
4142 };
4143
4144 var objectToArray = {
4145 // `Object.entries` method
4146 // https://tc39.es/ecma262/#sec-object.entries
4147 entries: createMethod$1(true),
4148 // `Object.values` method
4149 // https://tc39.es/ecma262/#sec-object.values
4150 values: createMethod$1(false)
4151 };
4152
4153 var $$d = _export;
4154 var $values = objectToArray.values; // `Object.values` method
4155 // https://tc39.es/ecma262/#sec-object.values
4156
4157 $$d({
4158 target: 'Object',
4159 stat: true
4160 }, {
4161 values: function values(O) {
4162 return $values(O);
4163 }
4164 });
4165
4166 var path$8 = path$q;
4167 path$8.Object.values;
4168
4169 var whitespaces$3 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' + '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
4170
4171 var uncurryThis$5 = functionUncurryThis;
4172 var requireObjectCoercible = requireObjectCoercible$5;
4173 var toString$2 = toString$7;
4174 var whitespaces$2 = whitespaces$3;
4175 var replace$1 = uncurryThis$5(''.replace);
4176 var whitespace = '[' + whitespaces$2 + ']';
4177 var ltrim = RegExp('^' + whitespace + whitespace + '*');
4178 var rtrim = RegExp(whitespace + whitespace + '*$'); // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
4179
4180 var createMethod = function (TYPE) {
4181 return function ($this) {
4182 var string = toString$2(requireObjectCoercible($this));
4183 if (TYPE & 1) string = replace$1(string, ltrim, '');
4184 if (TYPE & 2) string = replace$1(string, rtrim, '');
4185 return string;
4186 };
4187 };
4188
4189 var stringTrim = {
4190 // `String.prototype.{ trimLeft, trimStart }` methods
4191 // https://tc39.es/ecma262/#sec-string.prototype.trimstart
4192 start: createMethod(1),
4193 // `String.prototype.{ trimRight, trimEnd }` methods
4194 // https://tc39.es/ecma262/#sec-string.prototype.trimend
4195 end: createMethod(2),
4196 // `String.prototype.trim` method
4197 // https://tc39.es/ecma262/#sec-string.prototype.trim
4198 trim: createMethod(3)
4199 };
4200
4201 var global$8 = global$M;
4202 var fails$8 = fails$r;
4203 var uncurryThis$4 = functionUncurryThis;
4204 var toString$1 = toString$7;
4205 var trim = stringTrim.trim;
4206 var whitespaces$1 = whitespaces$3;
4207 var $parseInt$1 = global$8.parseInt;
4208 var Symbol$1 = global$8.Symbol;
4209 var ITERATOR = Symbol$1 && Symbol$1.iterator;
4210 var hex = /^[+-]?0x/i;
4211 var exec$1 = uncurryThis$4(hex.exec);
4212 var FORCED$3 = $parseInt$1(whitespaces$1 + '08') !== 8 || $parseInt$1(whitespaces$1 + '0x16') !== 22 // MS Edge 18- broken with boxed symbols
4213 || ITERATOR && !fails$8(function () {
4214 $parseInt$1(Object(ITERATOR));
4215 }); // `parseInt` method
4216 // https://tc39.es/ecma262/#sec-parseint-string-radix
4217
4218 var numberParseInt = FORCED$3 ? function parseInt(string, radix) {
4219 var S = trim(toString$1(string));
4220 return $parseInt$1(S, radix >>> 0 || (exec$1(hex, S) ? 16 : 10));
4221 } : $parseInt$1;
4222
4223 var $$c = _export;
4224 var $parseInt = numberParseInt; // `parseInt` method
4225 // https://tc39.es/ecma262/#sec-parseint-string-radix
4226
4227 $$c({
4228 global: true,
4229 forced: parseInt != $parseInt
4230 }, {
4231 parseInt: $parseInt
4232 });
4233
4234 var path$7 = path$q;
4235 path$7.parseInt;
4236
4237 /* eslint-disable es/no-array-prototype-indexof -- required for testing */
4238
4239
4240 var $$b = _export;
4241 var uncurryThis$3 = functionUncurryThis;
4242 var $IndexOf = arrayIncludes.indexOf;
4243 var arrayMethodIsStrict$2 = arrayMethodIsStrict$5;
4244 var un$IndexOf = uncurryThis$3([].indexOf);
4245 var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
4246 var STRICT_METHOD$2 = arrayMethodIsStrict$2('indexOf'); // `Array.prototype.indexOf` method
4247 // https://tc39.es/ecma262/#sec-array.prototype.indexof
4248
4249 $$b({
4250 target: 'Array',
4251 proto: true,
4252 forced: NEGATIVE_ZERO || !STRICT_METHOD$2
4253 }, {
4254 indexOf: function indexOf(searchElement
4255 /* , fromIndex = 0 */
4256 ) {
4257 var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
4258 return NEGATIVE_ZERO // convert -0 to +0
4259 ? un$IndexOf(this, searchElement, fromIndex) || 0 : $IndexOf(this, searchElement, fromIndex);
4260 }
4261 });
4262
4263 var entryVirtual$7 = entryVirtual$k;
4264 entryVirtual$7('Array').indexOf;
4265
4266 var PROPER_FUNCTION_NAME = functionName.PROPER;
4267 var fails$7 = fails$r;
4268 var whitespaces = whitespaces$3;
4269 var non = '\u200B\u0085\u180E'; // check that a method works with the correct list
4270 // of whitespaces and has a correct name
4271
4272 var stringTrimForced = function (METHOD_NAME) {
4273 return fails$7(function () {
4274 return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() !== non || PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME;
4275 });
4276 };
4277
4278 var $$a = _export;
4279 var $trim = stringTrim.trim;
4280 var forcedStringTrimMethod = stringTrimForced; // `String.prototype.trim` method
4281 // https://tc39.es/ecma262/#sec-string.prototype.trim
4282
4283 $$a({
4284 target: 'String',
4285 proto: true,
4286 forced: forcedStringTrimMethod('trim')
4287 }, {
4288 trim: function trim() {
4289 return $trim(this);
4290 }
4291 });
4292
4293 var entryVirtual$6 = entryVirtual$k;
4294 entryVirtual$6('String').trim;
4295
4296 var $$9 = _export;
4297 var DESCRIPTORS$3 = descriptors;
4298 var create$8 = objectCreate; // `Object.create` method
4299 // https://tc39.es/ecma262/#sec-object.create
4300
4301 $$9({
4302 target: 'Object',
4303 stat: true,
4304 sham: !DESCRIPTORS$3
4305 }, {
4306 create: create$8
4307 });
4308
4309 var path$6 = path$q;
4310 var Object$1 = path$6.Object;
4311
4312 var create$7 = function create(P, D) {
4313 return Object$1.create(P, D);
4314 };
4315
4316 var parent$j = create$7;
4317 var create$6 = parent$j;
4318
4319 var create$5 = create$6;
4320
4321 var $$8 = _export;
4322 var global$7 = global$M;
4323 var getBuiltIn$2 = getBuiltIn$9;
4324 var apply$3 = functionApply;
4325 var uncurryThis$2 = functionUncurryThis;
4326 var fails$6 = fails$r;
4327 var Array$1 = global$7.Array;
4328 var $stringify = getBuiltIn$2('JSON', 'stringify');
4329 var exec = uncurryThis$2(/./.exec);
4330 var charAt = uncurryThis$2(''.charAt);
4331 var charCodeAt = uncurryThis$2(''.charCodeAt);
4332 var replace = uncurryThis$2(''.replace);
4333 var numberToString = uncurryThis$2(1.0.toString);
4334 var tester = /[\uD800-\uDFFF]/g;
4335 var low = /^[\uD800-\uDBFF]$/;
4336 var hi = /^[\uDC00-\uDFFF]$/;
4337
4338 var fix = function (match, offset, string) {
4339 var prev = charAt(string, offset - 1);
4340 var next = charAt(string, offset + 1);
4341
4342 if (exec(low, match) && !exec(hi, next) || exec(hi, match) && !exec(low, prev)) {
4343 return '\\u' + numberToString(charCodeAt(match, 0), 16);
4344 }
4345
4346 return match;
4347 };
4348
4349 var FORCED$2 = fails$6(function () {
4350 return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"' || $stringify('\uDEAD') !== '"\\udead"';
4351 });
4352
4353 if ($stringify) {
4354 // `JSON.stringify` method
4355 // https://tc39.es/ecma262/#sec-json.stringify
4356 // https://github.com/tc39/proposal-well-formed-stringify
4357 $$8({
4358 target: 'JSON',
4359 stat: true,
4360 forced: FORCED$2
4361 }, {
4362 // eslint-disable-next-line no-unused-vars -- required for `.length`
4363 stringify: function stringify(it, replacer, space) {
4364 for (var i = 0, l = arguments.length, args = Array$1(l); i < l; i++) args[i] = arguments[i];
4365
4366 var result = apply$3($stringify, null, args);
4367 return typeof result == 'string' ? replace(result, tester, fix) : result;
4368 }
4369 });
4370 }
4371
4372 var path$5 = path$q;
4373 var apply$2 = functionApply; // eslint-disable-next-line es/no-json -- safe
4374
4375 if (!path$5.JSON) path$5.JSON = {
4376 stringify: JSON.stringify
4377 }; // eslint-disable-next-line no-unused-vars -- required for `.length`
4378
4379 var stringify$3 = function stringify(it, replacer, space) {
4380 return apply$2(path$5.JSON.stringify, null, arguments);
4381 };
4382
4383 var parent$i = stringify$3;
4384 var stringify$2 = parent$i;
4385
4386 var stringify$1 = stringify$2;
4387
4388 var global$6 = global$M;
4389 var TypeError$4 = global$6.TypeError;
4390
4391 var validateArgumentsLength$1 = function (passed, required) {
4392 if (passed < required) throw TypeError$4('Not enough arguments');
4393 return passed;
4394 };
4395
4396 var $$7 = _export;
4397 var global$5 = global$M;
4398 var apply$1 = functionApply;
4399 var isCallable$1 = isCallable$h;
4400 var userAgent$2 = engineUserAgent;
4401 var arraySlice$1 = arraySlice$5;
4402 var validateArgumentsLength = validateArgumentsLength$1;
4403 var MSIE = /MSIE .\./.test(userAgent$2); // <- dirty ie9- check
4404
4405 var Function$1 = global$5.Function;
4406
4407 var wrap = function (scheduler) {
4408 return function (handler, timeout
4409 /* , ...arguments */
4410 ) {
4411 var boundArgs = validateArgumentsLength(arguments.length, 1) > 2;
4412 var fn = isCallable$1(handler) ? handler : Function$1(handler);
4413 var args = boundArgs ? arraySlice$1(arguments, 2) : undefined;
4414 return scheduler(boundArgs ? function () {
4415 apply$1(fn, this, args);
4416 } : fn, timeout);
4417 };
4418 }; // ie9- setTimeout & setInterval additional parameters fix
4419 // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers
4420
4421
4422 $$7({
4423 global: true,
4424 bind: true,
4425 forced: MSIE
4426 }, {
4427 // `setTimeout` method
4428 // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout
4429 setTimeout: wrap(global$5.setTimeout),
4430 // `setInterval` method
4431 // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval
4432 setInterval: wrap(global$5.setInterval)
4433 });
4434
4435 var path$4 = path$q;
4436 var setTimeout$2 = path$4.setTimeout;
4437
4438 var setTimeout$1 = setTimeout$2;
4439
4440 var toObject$1 = toObject$e;
4441 var toAbsoluteIndex = toAbsoluteIndex$5;
4442 var lengthOfArrayLike$2 = lengthOfArrayLike$d; // `Array.prototype.fill` method implementation
4443 // https://tc39.es/ecma262/#sec-array.prototype.fill
4444
4445 var arrayFill = function fill(value
4446 /* , start = 0, end = @length */
4447 ) {
4448 var O = toObject$1(this);
4449 var length = lengthOfArrayLike$2(O);
4450 var argumentsLength = arguments.length;
4451 var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);
4452 var end = argumentsLength > 2 ? arguments[2] : undefined;
4453 var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
4454
4455 while (endPos > index) O[index++] = value;
4456
4457 return O;
4458 };
4459
4460 var $$6 = _export;
4461 var fill = arrayFill;
4462 // https://tc39.es/ecma262/#sec-array.prototype.fill
4463
4464 $$6({
4465 target: 'Array',
4466 proto: true
4467 }, {
4468 fill: fill
4469 }); // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
4470
4471 var entryVirtual$5 = entryVirtual$k;
4472 entryVirtual$5('Array').fill;
4473
4474 var componentEmitter = {exports: {}};
4475
4476 (function (module) {
4477 /**
4478 * Expose `Emitter`.
4479 */
4480 {
4481 module.exports = Emitter;
4482 }
4483 /**
4484 * Initialize a new `Emitter`.
4485 *
4486 * @api public
4487 */
4488
4489
4490 function Emitter(obj) {
4491 if (obj) return mixin(obj);
4492 }
4493 /**
4494 * Mixin the emitter properties.
4495 *
4496 * @param {Object} obj
4497 * @return {Object}
4498 * @api private
4499 */
4500
4501 function mixin(obj) {
4502 for (var key in Emitter.prototype) {
4503 obj[key] = Emitter.prototype[key];
4504 }
4505
4506 return obj;
4507 }
4508 /**
4509 * Listen on the given `event` with `fn`.
4510 *
4511 * @param {String} event
4512 * @param {Function} fn
4513 * @return {Emitter}
4514 * @api public
4515 */
4516
4517
4518 Emitter.prototype.on = Emitter.prototype.addEventListener = function (event, fn) {
4519 this._callbacks = this._callbacks || {};
4520 (this._callbacks['$' + event] = this._callbacks['$' + event] || []).push(fn);
4521 return this;
4522 };
4523 /**
4524 * Adds an `event` listener that will be invoked a single
4525 * time then automatically removed.
4526 *
4527 * @param {String} event
4528 * @param {Function} fn
4529 * @return {Emitter}
4530 * @api public
4531 */
4532
4533
4534 Emitter.prototype.once = function (event, fn) {
4535 function on() {
4536 this.off(event, on);
4537 fn.apply(this, arguments);
4538 }
4539
4540 on.fn = fn;
4541 this.on(event, on);
4542 return this;
4543 };
4544 /**
4545 * Remove the given callback for `event` or all
4546 * registered callbacks.
4547 *
4548 * @param {String} event
4549 * @param {Function} fn
4550 * @return {Emitter}
4551 * @api public
4552 */
4553
4554
4555 Emitter.prototype.off = Emitter.prototype.removeListener = Emitter.prototype.removeAllListeners = Emitter.prototype.removeEventListener = function (event, fn) {
4556 this._callbacks = this._callbacks || {}; // all
4557
4558 if (0 == arguments.length) {
4559 this._callbacks = {};
4560 return this;
4561 } // specific event
4562
4563
4564 var callbacks = this._callbacks['$' + event];
4565 if (!callbacks) return this; // remove all handlers
4566
4567 if (1 == arguments.length) {
4568 delete this._callbacks['$' + event];
4569 return this;
4570 } // remove specific handler
4571
4572
4573 var cb;
4574
4575 for (var i = 0; i < callbacks.length; i++) {
4576 cb = callbacks[i];
4577
4578 if (cb === fn || cb.fn === fn) {
4579 callbacks.splice(i, 1);
4580 break;
4581 }
4582 } // Remove event specific arrays for event types that no
4583 // one is subscribed for to avoid memory leak.
4584
4585
4586 if (callbacks.length === 0) {
4587 delete this._callbacks['$' + event];
4588 }
4589
4590 return this;
4591 };
4592 /**
4593 * Emit `event` with the given args.
4594 *
4595 * @param {String} event
4596 * @param {Mixed} ...
4597 * @return {Emitter}
4598 */
4599
4600
4601 Emitter.prototype.emit = function (event) {
4602 this._callbacks = this._callbacks || {};
4603 var args = new Array(arguments.length - 1),
4604 callbacks = this._callbacks['$' + event];
4605
4606 for (var i = 1; i < arguments.length; i++) {
4607 args[i - 1] = arguments[i];
4608 }
4609
4610 if (callbacks) {
4611 callbacks = callbacks.slice(0);
4612
4613 for (var i = 0, len = callbacks.length; i < len; ++i) {
4614 callbacks[i].apply(this, args);
4615 }
4616 }
4617
4618 return this;
4619 };
4620 /**
4621 * Return array of callbacks for `event`.
4622 *
4623 * @param {String} event
4624 * @return {Array}
4625 * @api public
4626 */
4627
4628
4629 Emitter.prototype.listeners = function (event) {
4630 this._callbacks = this._callbacks || {};
4631 return this._callbacks['$' + event] || [];
4632 };
4633 /**
4634 * Check if this emitter has `event` handlers.
4635 *
4636 * @param {String} event
4637 * @return {Boolean}
4638 * @api public
4639 */
4640
4641
4642 Emitter.prototype.hasListeners = function (event) {
4643 return !!this.listeners(event).length;
4644 };
4645 })(componentEmitter);
4646
4647 var Emitter = componentEmitter.exports;
4648
4649 /*! Hammer.JS - v2.0.17-rc - 2019-12-16
4650 * http://naver.github.io/egjs
4651 *
4652 * Forked By Naver egjs
4653 * Copyright (c) hammerjs
4654 * Licensed under the MIT license */
4655 function _extends() {
4656 _extends = Object.assign || function (target) {
4657 for (var i = 1; i < arguments.length; i++) {
4658 var source = arguments[i];
4659
4660 for (var key in source) {
4661 if (Object.prototype.hasOwnProperty.call(source, key)) {
4662 target[key] = source[key];
4663 }
4664 }
4665 }
4666
4667 return target;
4668 };
4669
4670 return _extends.apply(this, arguments);
4671 }
4672
4673 function _inheritsLoose(subClass, superClass) {
4674 subClass.prototype = Object.create(superClass.prototype);
4675 subClass.prototype.constructor = subClass;
4676 subClass.__proto__ = superClass;
4677 }
4678
4679 function _assertThisInitialized$1(self) {
4680 if (self === void 0) {
4681 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4682 }
4683
4684 return self;
4685 }
4686 /**
4687 * @private
4688 * extend object.
4689 * means that properties in dest will be overwritten by the ones in src.
4690 * @param {Object} target
4691 * @param {...Object} objects_to_assign
4692 * @returns {Object} target
4693 */
4694
4695
4696 var assign;
4697
4698 if (typeof Object.assign !== 'function') {
4699 assign = function assign(target) {
4700 if (target === undefined || target === null) {
4701 throw new TypeError('Cannot convert undefined or null to object');
4702 }
4703
4704 var output = Object(target);
4705
4706 for (var index = 1; index < arguments.length; index++) {
4707 var source = arguments[index];
4708
4709 if (source !== undefined && source !== null) {
4710 for (var nextKey in source) {
4711 if (source.hasOwnProperty(nextKey)) {
4712 output[nextKey] = source[nextKey];
4713 }
4714 }
4715 }
4716 }
4717
4718 return output;
4719 };
4720 } else {
4721 assign = Object.assign;
4722 }
4723
4724 var assign$1 = assign;
4725 var VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];
4726 var TEST_ELEMENT = typeof document === "undefined" ? {
4727 style: {}
4728 } : document.createElement('div');
4729 var TYPE_FUNCTION = 'function';
4730 var round = Math.round,
4731 abs = Math.abs;
4732 var now = Date.now;
4733 /**
4734 * @private
4735 * get the prefixed property
4736 * @param {Object} obj
4737 * @param {String} property
4738 * @returns {String|Undefined} prefixed
4739 */
4740
4741 function prefixed(obj, property) {
4742 var prefix;
4743 var prop;
4744 var camelProp = property[0].toUpperCase() + property.slice(1);
4745 var i = 0;
4746
4747 while (i < VENDOR_PREFIXES.length) {
4748 prefix = VENDOR_PREFIXES[i];
4749 prop = prefix ? prefix + camelProp : property;
4750
4751 if (prop in obj) {
4752 return prop;
4753 }
4754
4755 i++;
4756 }
4757
4758 return undefined;
4759 }
4760 /* eslint-disable no-new-func, no-nested-ternary */
4761
4762
4763 var win;
4764
4765 if (typeof window === "undefined") {
4766 // window is undefined in node.js
4767 win = {};
4768 } else {
4769 win = window;
4770 }
4771
4772 var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
4773 var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;
4774
4775 function getTouchActionProps() {
4776 if (!NATIVE_TOUCH_ACTION) {
4777 return false;
4778 }
4779
4780 var touchMap = {};
4781 var cssSupports = win.CSS && win.CSS.supports;
4782 ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function (val) {
4783 // If css.supports is not supported but there is native touch-action assume it supports
4784 // all values. This is the case for IE 10 and 11.
4785 return touchMap[val] = cssSupports ? win.CSS.supports('touch-action', val) : true;
4786 });
4787 return touchMap;
4788 }
4789
4790 var TOUCH_ACTION_COMPUTE = 'compute';
4791 var TOUCH_ACTION_AUTO = 'auto';
4792 var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented
4793
4794 var TOUCH_ACTION_NONE = 'none';
4795 var TOUCH_ACTION_PAN_X = 'pan-x';
4796 var TOUCH_ACTION_PAN_Y = 'pan-y';
4797 var TOUCH_ACTION_MAP = getTouchActionProps();
4798 var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
4799 var SUPPORT_TOUCH = ('ontouchstart' in win);
4800 var SUPPORT_POINTER_EVENTS = prefixed(win, 'PointerEvent') !== undefined;
4801 var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
4802 var INPUT_TYPE_TOUCH = 'touch';
4803 var INPUT_TYPE_PEN = 'pen';
4804 var INPUT_TYPE_MOUSE = 'mouse';
4805 var INPUT_TYPE_KINECT = 'kinect';
4806 var COMPUTE_INTERVAL = 25;
4807 var INPUT_START = 1;
4808 var INPUT_MOVE = 2;
4809 var INPUT_END = 4;
4810 var INPUT_CANCEL = 8;
4811 var DIRECTION_NONE = 1;
4812 var DIRECTION_LEFT = 2;
4813 var DIRECTION_RIGHT = 4;
4814 var DIRECTION_UP = 8;
4815 var DIRECTION_DOWN = 16;
4816 var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
4817 var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
4818 var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
4819 var PROPS_XY = ['x', 'y'];
4820 var PROPS_CLIENT_XY = ['clientX', 'clientY'];
4821 /**
4822 * @private
4823 * walk objects and arrays
4824 * @param {Object} obj
4825 * @param {Function} iterator
4826 * @param {Object} context
4827 */
4828
4829 function each(obj, iterator, context) {
4830 var i;
4831
4832 if (!obj) {
4833 return;
4834 }
4835
4836 if (obj.forEach) {
4837 obj.forEach(iterator, context);
4838 } else if (obj.length !== undefined) {
4839 i = 0;
4840
4841 while (i < obj.length) {
4842 iterator.call(context, obj[i], i, obj);
4843 i++;
4844 }
4845 } else {
4846 for (i in obj) {
4847 obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
4848 }
4849 }
4850 }
4851 /**
4852 * @private
4853 * let a boolean value also be a function that must return a boolean
4854 * this first item in args will be used as the context
4855 * @param {Boolean|Function} val
4856 * @param {Array} [args]
4857 * @returns {Boolean}
4858 */
4859
4860
4861 function boolOrFn(val, args) {
4862 if (typeof val === TYPE_FUNCTION) {
4863 return val.apply(args ? args[0] || undefined : undefined, args);
4864 }
4865
4866 return val;
4867 }
4868 /**
4869 * @private
4870 * small indexOf wrapper
4871 * @param {String} str
4872 * @param {String} find
4873 * @returns {Boolean} found
4874 */
4875
4876
4877 function inStr(str, find) {
4878 return str.indexOf(find) > -1;
4879 }
4880 /**
4881 * @private
4882 * when the touchActions are collected they are not a valid value, so we need to clean things up. *
4883 * @param {String} actions
4884 * @returns {*}
4885 */
4886
4887
4888 function cleanTouchActions(actions) {
4889 // none
4890 if (inStr(actions, TOUCH_ACTION_NONE)) {
4891 return TOUCH_ACTION_NONE;
4892 }
4893
4894 var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
4895 var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y); // if both pan-x and pan-y are set (different recognizers
4896 // for different directions, e.g. horizontal pan but vertical swipe?)
4897 // we need none (as otherwise with pan-x pan-y combined none of these
4898 // recognizers will work, since the browser would handle all panning
4899
4900 if (hasPanX && hasPanY) {
4901 return TOUCH_ACTION_NONE;
4902 } // pan-x OR pan-y
4903
4904
4905 if (hasPanX || hasPanY) {
4906 return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
4907 } // manipulation
4908
4909
4910 if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
4911 return TOUCH_ACTION_MANIPULATION;
4912 }
4913
4914 return TOUCH_ACTION_AUTO;
4915 }
4916 /**
4917 * @private
4918 * Touch Action
4919 * sets the touchAction property or uses the js alternative
4920 * @param {Manager} manager
4921 * @param {String} value
4922 * @constructor
4923 */
4924
4925
4926 var TouchAction = /*#__PURE__*/function () {
4927 function TouchAction(manager, value) {
4928 this.manager = manager;
4929 this.set(value);
4930 }
4931 /**
4932 * @private
4933 * set the touchAction value on the element or enable the polyfill
4934 * @param {String} value
4935 */
4936
4937
4938 var _proto = TouchAction.prototype;
4939
4940 _proto.set = function set(value) {
4941 // find out the touch-action by the event handlers
4942 if (value === TOUCH_ACTION_COMPUTE) {
4943 value = this.compute();
4944 }
4945
4946 if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) {
4947 this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
4948 }
4949
4950 this.actions = value.toLowerCase().trim();
4951 };
4952 /**
4953 * @private
4954 * just re-set the touchAction value
4955 */
4956
4957
4958 _proto.update = function update() {
4959 this.set(this.manager.options.touchAction);
4960 };
4961 /**
4962 * @private
4963 * compute the value for the touchAction property based on the recognizer's settings
4964 * @returns {String} value
4965 */
4966
4967
4968 _proto.compute = function compute() {
4969 var actions = [];
4970 each(this.manager.recognizers, function (recognizer) {
4971 if (boolOrFn(recognizer.options.enable, [recognizer])) {
4972 actions = actions.concat(recognizer.getTouchAction());
4973 }
4974 });
4975 return cleanTouchActions(actions.join(' '));
4976 };
4977 /**
4978 * @private
4979 * this method is called on each input cycle and provides the preventing of the browser behavior
4980 * @param {Object} input
4981 */
4982
4983
4984 _proto.preventDefaults = function preventDefaults(input) {
4985 var srcEvent = input.srcEvent;
4986 var direction = input.offsetDirection; // if the touch action did prevented once this session
4987
4988 if (this.manager.session.prevented) {
4989 srcEvent.preventDefault();
4990 return;
4991 }
4992
4993 var actions = this.actions;
4994 var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];
4995 var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];
4996 var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];
4997
4998 if (hasNone) {
4999 // do not prevent defaults if this is a tap gesture
5000 var isTapPointer = input.pointers.length === 1;
5001 var isTapMovement = input.distance < 2;
5002 var isTapTouchTime = input.deltaTime < 250;
5003
5004 if (isTapPointer && isTapMovement && isTapTouchTime) {
5005 return;
5006 }
5007 }
5008
5009 if (hasPanX && hasPanY) {
5010 // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent
5011 return;
5012 }
5013
5014 if (hasNone || hasPanY && direction & DIRECTION_HORIZONTAL || hasPanX && direction & DIRECTION_VERTICAL) {
5015 return this.preventSrc(srcEvent);
5016 }
5017 };
5018 /**
5019 * @private
5020 * call preventDefault to prevent the browser's default behavior (scrolling in most cases)
5021 * @param {Object} srcEvent
5022 */
5023
5024
5025 _proto.preventSrc = function preventSrc(srcEvent) {
5026 this.manager.session.prevented = true;
5027 srcEvent.preventDefault();
5028 };
5029
5030 return TouchAction;
5031 }();
5032 /**
5033 * @private
5034 * find if a node is in the given parent
5035 * @method hasParent
5036 * @param {HTMLElement} node
5037 * @param {HTMLElement} parent
5038 * @return {Boolean} found
5039 */
5040
5041
5042 function hasParent(node, parent) {
5043 while (node) {
5044 if (node === parent) {
5045 return true;
5046 }
5047
5048 node = node.parentNode;
5049 }
5050
5051 return false;
5052 }
5053 /**
5054 * @private
5055 * get the center of all the pointers
5056 * @param {Array} pointers
5057 * @return {Object} center contains `x` and `y` properties
5058 */
5059
5060
5061 function getCenter(pointers) {
5062 var pointersLength = pointers.length; // no need to loop when only one touch
5063
5064 if (pointersLength === 1) {
5065 return {
5066 x: round(pointers[0].clientX),
5067 y: round(pointers[0].clientY)
5068 };
5069 }
5070
5071 var x = 0;
5072 var y = 0;
5073 var i = 0;
5074
5075 while (i < pointersLength) {
5076 x += pointers[i].clientX;
5077 y += pointers[i].clientY;
5078 i++;
5079 }
5080
5081 return {
5082 x: round(x / pointersLength),
5083 y: round(y / pointersLength)
5084 };
5085 }
5086 /**
5087 * @private
5088 * create a simple clone from the input used for storage of firstInput and firstMultiple
5089 * @param {Object} input
5090 * @returns {Object} clonedInputData
5091 */
5092
5093
5094 function simpleCloneInputData(input) {
5095 // make a simple copy of the pointers because we will get a reference if we don't
5096 // we only need clientXY for the calculations
5097 var pointers = [];
5098 var i = 0;
5099
5100 while (i < input.pointers.length) {
5101 pointers[i] = {
5102 clientX: round(input.pointers[i].clientX),
5103 clientY: round(input.pointers[i].clientY)
5104 };
5105 i++;
5106 }
5107
5108 return {
5109 timeStamp: now(),
5110 pointers: pointers,
5111 center: getCenter(pointers),
5112 deltaX: input.deltaX,
5113 deltaY: input.deltaY
5114 };
5115 }
5116 /**
5117 * @private
5118 * calculate the absolute distance between two points
5119 * @param {Object} p1 {x, y}
5120 * @param {Object} p2 {x, y}
5121 * @param {Array} [props] containing x and y keys
5122 * @return {Number} distance
5123 */
5124
5125
5126 function getDistance(p1, p2, props) {
5127 if (!props) {
5128 props = PROPS_XY;
5129 }
5130
5131 var x = p2[props[0]] - p1[props[0]];
5132 var y = p2[props[1]] - p1[props[1]];
5133 return Math.sqrt(x * x + y * y);
5134 }
5135 /**
5136 * @private
5137 * calculate the angle between two coordinates
5138 * @param {Object} p1
5139 * @param {Object} p2
5140 * @param {Array} [props] containing x and y keys
5141 * @return {Number} angle
5142 */
5143
5144
5145 function getAngle(p1, p2, props) {
5146 if (!props) {
5147 props = PROPS_XY;
5148 }
5149
5150 var x = p2[props[0]] - p1[props[0]];
5151 var y = p2[props[1]] - p1[props[1]];
5152 return Math.atan2(y, x) * 180 / Math.PI;
5153 }
5154 /**
5155 * @private
5156 * get the direction between two points
5157 * @param {Number} x
5158 * @param {Number} y
5159 * @return {Number} direction
5160 */
5161
5162
5163 function getDirection(x, y) {
5164 if (x === y) {
5165 return DIRECTION_NONE;
5166 }
5167
5168 if (abs(x) >= abs(y)) {
5169 return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
5170 }
5171
5172 return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
5173 }
5174
5175 function computeDeltaXY(session, input) {
5176 var center = input.center; // let { offsetDelta:offset = {}, prevDelta = {}, prevInput = {} } = session;
5177 // jscs throwing error on defalut destructured values and without defaults tests fail
5178
5179 var offset = session.offsetDelta || {};
5180 var prevDelta = session.prevDelta || {};
5181 var prevInput = session.prevInput || {};
5182
5183 if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
5184 prevDelta = session.prevDelta = {
5185 x: prevInput.deltaX || 0,
5186 y: prevInput.deltaY || 0
5187 };
5188 offset = session.offsetDelta = {
5189 x: center.x,
5190 y: center.y
5191 };
5192 }
5193
5194 input.deltaX = prevDelta.x + (center.x - offset.x);
5195 input.deltaY = prevDelta.y + (center.y - offset.y);
5196 }
5197 /**
5198 * @private
5199 * calculate the velocity between two points. unit is in px per ms.
5200 * @param {Number} deltaTime
5201 * @param {Number} x
5202 * @param {Number} y
5203 * @return {Object} velocity `x` and `y`
5204 */
5205
5206
5207 function getVelocity(deltaTime, x, y) {
5208 return {
5209 x: x / deltaTime || 0,
5210 y: y / deltaTime || 0
5211 };
5212 }
5213 /**
5214 * @private
5215 * calculate the scale factor between two pointersets
5216 * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out
5217 * @param {Array} start array of pointers
5218 * @param {Array} end array of pointers
5219 * @return {Number} scale
5220 */
5221
5222
5223 function getScale(start, end) {
5224 return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
5225 }
5226 /**
5227 * @private
5228 * calculate the rotation degrees between two pointersets
5229 * @param {Array} start array of pointers
5230 * @param {Array} end array of pointers
5231 * @return {Number} rotation
5232 */
5233
5234
5235 function getRotation(start, end) {
5236 return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);
5237 }
5238 /**
5239 * @private
5240 * velocity is calculated every x ms
5241 * @param {Object} session
5242 * @param {Object} input
5243 */
5244
5245
5246 function computeIntervalInputData(session, input) {
5247 var last = session.lastInterval || input;
5248 var deltaTime = input.timeStamp - last.timeStamp;
5249 var velocity;
5250 var velocityX;
5251 var velocityY;
5252 var direction;
5253
5254 if (input.eventType !== INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
5255 var deltaX = input.deltaX - last.deltaX;
5256 var deltaY = input.deltaY - last.deltaY;
5257 var v = getVelocity(deltaTime, deltaX, deltaY);
5258 velocityX = v.x;
5259 velocityY = v.y;
5260 velocity = abs(v.x) > abs(v.y) ? v.x : v.y;
5261 direction = getDirection(deltaX, deltaY);
5262 session.lastInterval = input;
5263 } else {
5264 // use latest velocity info if it doesn't overtake a minimum period
5265 velocity = last.velocity;
5266 velocityX = last.velocityX;
5267 velocityY = last.velocityY;
5268 direction = last.direction;
5269 }
5270
5271 input.velocity = velocity;
5272 input.velocityX = velocityX;
5273 input.velocityY = velocityY;
5274 input.direction = direction;
5275 }
5276 /**
5277 * @private
5278 * extend the data with some usable properties like scale, rotate, velocity etc
5279 * @param {Object} manager
5280 * @param {Object} input
5281 */
5282
5283
5284 function computeInputData(manager, input) {
5285 var session = manager.session;
5286 var pointers = input.pointers;
5287 var pointersLength = pointers.length; // store the first input to calculate the distance and direction
5288
5289 if (!session.firstInput) {
5290 session.firstInput = simpleCloneInputData(input);
5291 } // to compute scale and rotation we need to store the multiple touches
5292
5293
5294 if (pointersLength > 1 && !session.firstMultiple) {
5295 session.firstMultiple = simpleCloneInputData(input);
5296 } else if (pointersLength === 1) {
5297 session.firstMultiple = false;
5298 }
5299
5300 var firstInput = session.firstInput,
5301 firstMultiple = session.firstMultiple;
5302 var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
5303 var center = input.center = getCenter(pointers);
5304 input.timeStamp = now();
5305 input.deltaTime = input.timeStamp - firstInput.timeStamp;
5306 input.angle = getAngle(offsetCenter, center);
5307 input.distance = getDistance(offsetCenter, center);
5308 computeDeltaXY(session, input);
5309 input.offsetDirection = getDirection(input.deltaX, input.deltaY);
5310 var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);
5311 input.overallVelocityX = overallVelocity.x;
5312 input.overallVelocityY = overallVelocity.y;
5313 input.overallVelocity = abs(overallVelocity.x) > abs(overallVelocity.y) ? overallVelocity.x : overallVelocity.y;
5314 input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
5315 input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
5316 input.maxPointers = !session.prevInput ? input.pointers.length : input.pointers.length > session.prevInput.maxPointers ? input.pointers.length : session.prevInput.maxPointers;
5317 computeIntervalInputData(session, input); // find the correct target
5318
5319 var target = manager.element;
5320 var srcEvent = input.srcEvent;
5321 var srcEventTarget;
5322
5323 if (srcEvent.composedPath) {
5324 srcEventTarget = srcEvent.composedPath()[0];
5325 } else if (srcEvent.path) {
5326 srcEventTarget = srcEvent.path[0];
5327 } else {
5328 srcEventTarget = srcEvent.target;
5329 }
5330
5331 if (hasParent(srcEventTarget, target)) {
5332 target = srcEventTarget;
5333 }
5334
5335 input.target = target;
5336 }
5337 /**
5338 * @private
5339 * handle input events
5340 * @param {Manager} manager
5341 * @param {String} eventType
5342 * @param {Object} input
5343 */
5344
5345
5346 function inputHandler(manager, eventType, input) {
5347 var pointersLen = input.pointers.length;
5348 var changedPointersLen = input.changedPointers.length;
5349 var isFirst = eventType & INPUT_START && pointersLen - changedPointersLen === 0;
5350 var isFinal = eventType & (INPUT_END | INPUT_CANCEL) && pointersLen - changedPointersLen === 0;
5351 input.isFirst = !!isFirst;
5352 input.isFinal = !!isFinal;
5353
5354 if (isFirst) {
5355 manager.session = {};
5356 } // source event is the normalized value of the domEvents
5357 // like 'touchstart, mouseup, pointerdown'
5358
5359
5360 input.eventType = eventType; // compute scale, rotation etc
5361
5362 computeInputData(manager, input); // emit secret event
5363
5364 manager.emit('hammer.input', input);
5365 manager.recognize(input);
5366 manager.session.prevInput = input;
5367 }
5368 /**
5369 * @private
5370 * split string on whitespace
5371 * @param {String} str
5372 * @returns {Array} words
5373 */
5374
5375
5376 function splitStr(str) {
5377 return str.trim().split(/\s+/g);
5378 }
5379 /**
5380 * @private
5381 * addEventListener with multiple events at once
5382 * @param {EventTarget} target
5383 * @param {String} types
5384 * @param {Function} handler
5385 */
5386
5387
5388 function addEventListeners(target, types, handler) {
5389 each(splitStr(types), function (type) {
5390 target.addEventListener(type, handler, false);
5391 });
5392 }
5393 /**
5394 * @private
5395 * removeEventListener with multiple events at once
5396 * @param {EventTarget} target
5397 * @param {String} types
5398 * @param {Function} handler
5399 */
5400
5401
5402 function removeEventListeners(target, types, handler) {
5403 each(splitStr(types), function (type) {
5404 target.removeEventListener(type, handler, false);
5405 });
5406 }
5407 /**
5408 * @private
5409 * get the window object of an element
5410 * @param {HTMLElement} element
5411 * @returns {DocumentView|Window}
5412 */
5413
5414
5415 function getWindowForElement(element) {
5416 var doc = element.ownerDocument || element;
5417 return doc.defaultView || doc.parentWindow || window;
5418 }
5419 /**
5420 * @private
5421 * create new input type manager
5422 * @param {Manager} manager
5423 * @param {Function} callback
5424 * @returns {Input}
5425 * @constructor
5426 */
5427
5428
5429 var Input = /*#__PURE__*/function () {
5430 function Input(manager, callback) {
5431 var self = this;
5432 this.manager = manager;
5433 this.callback = callback;
5434 this.element = manager.element;
5435 this.target = manager.options.inputTarget; // smaller wrapper around the handler, for the scope and the enabled state of the manager,
5436 // so when disabled the input events are completely bypassed.
5437
5438 this.domHandler = function (ev) {
5439 if (boolOrFn(manager.options.enable, [manager])) {
5440 self.handler(ev);
5441 }
5442 };
5443
5444 this.init();
5445 }
5446 /**
5447 * @private
5448 * should handle the inputEvent data and trigger the callback
5449 * @virtual
5450 */
5451
5452
5453 var _proto = Input.prototype;
5454
5455 _proto.handler = function handler() {};
5456 /**
5457 * @private
5458 * bind the events
5459 */
5460
5461
5462 _proto.init = function init() {
5463 this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
5464 this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
5465 this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
5466 };
5467 /**
5468 * @private
5469 * unbind the events
5470 */
5471
5472
5473 _proto.destroy = function destroy() {
5474 this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
5475 this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
5476 this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
5477 };
5478
5479 return Input;
5480 }();
5481 /**
5482 * @private
5483 * find if a array contains the object using indexOf or a simple polyFill
5484 * @param {Array} src
5485 * @param {String} find
5486 * @param {String} [findByKey]
5487 * @return {Boolean|Number} false when not found, or the index
5488 */
5489
5490
5491 function inArray(src, find, findByKey) {
5492 if (src.indexOf && !findByKey) {
5493 return src.indexOf(find);
5494 } else {
5495 var i = 0;
5496
5497 while (i < src.length) {
5498 if (findByKey && src[i][findByKey] == find || !findByKey && src[i] === find) {
5499 // do not use === here, test fails
5500 return i;
5501 }
5502
5503 i++;
5504 }
5505
5506 return -1;
5507 }
5508 }
5509
5510 var POINTER_INPUT_MAP = {
5511 pointerdown: INPUT_START,
5512 pointermove: INPUT_MOVE,
5513 pointerup: INPUT_END,
5514 pointercancel: INPUT_CANCEL,
5515 pointerout: INPUT_CANCEL
5516 }; // in IE10 the pointer types is defined as an enum
5517
5518 var IE10_POINTER_TYPE_ENUM = {
5519 2: INPUT_TYPE_TOUCH,
5520 3: INPUT_TYPE_PEN,
5521 4: INPUT_TYPE_MOUSE,
5522 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816
5523
5524 };
5525 var POINTER_ELEMENT_EVENTS = 'pointerdown';
5526 var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel'; // IE10 has prefixed support, and case-sensitive
5527
5528 if (win.MSPointerEvent && !win.PointerEvent) {
5529 POINTER_ELEMENT_EVENTS = 'MSPointerDown';
5530 POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
5531 }
5532 /**
5533 * @private
5534 * Pointer events input
5535 * @constructor
5536 * @extends Input
5537 */
5538
5539
5540 var PointerEventInput = /*#__PURE__*/function (_Input) {
5541 _inheritsLoose(PointerEventInput, _Input);
5542
5543 function PointerEventInput() {
5544 var _this;
5545
5546 var proto = PointerEventInput.prototype;
5547 proto.evEl = POINTER_ELEMENT_EVENTS;
5548 proto.evWin = POINTER_WINDOW_EVENTS;
5549 _this = _Input.apply(this, arguments) || this;
5550 _this.store = _this.manager.session.pointerEvents = [];
5551 return _this;
5552 }
5553 /**
5554 * @private
5555 * handle mouse events
5556 * @param {Object} ev
5557 */
5558
5559
5560 var _proto = PointerEventInput.prototype;
5561
5562 _proto.handler = function handler(ev) {
5563 var store = this.store;
5564 var removePointer = false;
5565 var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
5566 var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
5567 var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
5568 var isTouch = pointerType === INPUT_TYPE_TOUCH; // get index of the event in the store
5569
5570 var storeIndex = inArray(store, ev.pointerId, 'pointerId'); // start and mouse must be down
5571
5572 if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
5573 if (storeIndex < 0) {
5574 store.push(ev);
5575 storeIndex = store.length - 1;
5576 }
5577 } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
5578 removePointer = true;
5579 } // it not found, so the pointer hasn't been down (so it's probably a hover)
5580
5581
5582 if (storeIndex < 0) {
5583 return;
5584 } // update the event in the store
5585
5586
5587 store[storeIndex] = ev;
5588 this.callback(this.manager, eventType, {
5589 pointers: store,
5590 changedPointers: [ev],
5591 pointerType: pointerType,
5592 srcEvent: ev
5593 });
5594
5595 if (removePointer) {
5596 // remove from the store
5597 store.splice(storeIndex, 1);
5598 }
5599 };
5600
5601 return PointerEventInput;
5602 }(Input);
5603 /**
5604 * @private
5605 * convert array-like objects to real arrays
5606 * @param {Object} obj
5607 * @returns {Array}
5608 */
5609
5610
5611 function toArray(obj) {
5612 return Array.prototype.slice.call(obj, 0);
5613 }
5614 /**
5615 * @private
5616 * unique array with objects based on a key (like 'id') or just by the array's value
5617 * @param {Array} src [{id:1},{id:2},{id:1}]
5618 * @param {String} [key]
5619 * @param {Boolean} [sort=False]
5620 * @returns {Array} [{id:1},{id:2}]
5621 */
5622
5623
5624 function uniqueArray(src, key, sort) {
5625 var results = [];
5626 var values = [];
5627 var i = 0;
5628
5629 while (i < src.length) {
5630 var val = key ? src[i][key] : src[i];
5631
5632 if (inArray(values, val) < 0) {
5633 results.push(src[i]);
5634 }
5635
5636 values[i] = val;
5637 i++;
5638 }
5639
5640 if (sort) {
5641 if (!key) {
5642 results = results.sort();
5643 } else {
5644 results = results.sort(function (a, b) {
5645 return a[key] > b[key];
5646 });
5647 }
5648 }
5649
5650 return results;
5651 }
5652
5653 var TOUCH_INPUT_MAP = {
5654 touchstart: INPUT_START,
5655 touchmove: INPUT_MOVE,
5656 touchend: INPUT_END,
5657 touchcancel: INPUT_CANCEL
5658 };
5659 var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';
5660 /**
5661 * @private
5662 * Multi-user touch events input
5663 * @constructor
5664 * @extends Input
5665 */
5666
5667 var TouchInput = /*#__PURE__*/function (_Input) {
5668 _inheritsLoose(TouchInput, _Input);
5669
5670 function TouchInput() {
5671 var _this;
5672
5673 TouchInput.prototype.evTarget = TOUCH_TARGET_EVENTS;
5674 _this = _Input.apply(this, arguments) || this;
5675 _this.targetIds = {}; // this.evTarget = TOUCH_TARGET_EVENTS;
5676
5677 return _this;
5678 }
5679
5680 var _proto = TouchInput.prototype;
5681
5682 _proto.handler = function handler(ev) {
5683 var type = TOUCH_INPUT_MAP[ev.type];
5684 var touches = getTouches.call(this, ev, type);
5685
5686 if (!touches) {
5687 return;
5688 }
5689
5690 this.callback(this.manager, type, {
5691 pointers: touches[0],
5692 changedPointers: touches[1],
5693 pointerType: INPUT_TYPE_TOUCH,
5694 srcEvent: ev
5695 });
5696 };
5697
5698 return TouchInput;
5699 }(Input);
5700
5701 function getTouches(ev, type) {
5702 var allTouches = toArray(ev.touches);
5703 var targetIds = this.targetIds; // when there is only one touch, the process can be simplified
5704
5705 if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
5706 targetIds[allTouches[0].identifier] = true;
5707 return [allTouches, allTouches];
5708 }
5709
5710 var i;
5711 var targetTouches;
5712 var changedTouches = toArray(ev.changedTouches);
5713 var changedTargetTouches = [];
5714 var target = this.target; // get target touches from touches
5715
5716 targetTouches = allTouches.filter(function (touch) {
5717 return hasParent(touch.target, target);
5718 }); // collect touches
5719
5720 if (type === INPUT_START) {
5721 i = 0;
5722
5723 while (i < targetTouches.length) {
5724 targetIds[targetTouches[i].identifier] = true;
5725 i++;
5726 }
5727 } // filter changed touches to only contain touches that exist in the collected target ids
5728
5729
5730 i = 0;
5731
5732 while (i < changedTouches.length) {
5733 if (targetIds[changedTouches[i].identifier]) {
5734 changedTargetTouches.push(changedTouches[i]);
5735 } // cleanup removed touches
5736
5737
5738 if (type & (INPUT_END | INPUT_CANCEL)) {
5739 delete targetIds[changedTouches[i].identifier];
5740 }
5741
5742 i++;
5743 }
5744
5745 if (!changedTargetTouches.length) {
5746 return;
5747 }
5748
5749 return [// merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'
5750 uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true), changedTargetTouches];
5751 }
5752
5753 var MOUSE_INPUT_MAP = {
5754 mousedown: INPUT_START,
5755 mousemove: INPUT_MOVE,
5756 mouseup: INPUT_END
5757 };
5758 var MOUSE_ELEMENT_EVENTS = 'mousedown';
5759 var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';
5760 /**
5761 * @private
5762 * Mouse events input
5763 * @constructor
5764 * @extends Input
5765 */
5766
5767 var MouseInput = /*#__PURE__*/function (_Input) {
5768 _inheritsLoose(MouseInput, _Input);
5769
5770 function MouseInput() {
5771 var _this;
5772
5773 var proto = MouseInput.prototype;
5774 proto.evEl = MOUSE_ELEMENT_EVENTS;
5775 proto.evWin = MOUSE_WINDOW_EVENTS;
5776 _this = _Input.apply(this, arguments) || this;
5777 _this.pressed = false; // mousedown state
5778
5779 return _this;
5780 }
5781 /**
5782 * @private
5783 * handle mouse events
5784 * @param {Object} ev
5785 */
5786
5787
5788 var _proto = MouseInput.prototype;
5789
5790 _proto.handler = function handler(ev) {
5791 var eventType = MOUSE_INPUT_MAP[ev.type]; // on start we want to have the left mouse button down
5792
5793 if (eventType & INPUT_START && ev.button === 0) {
5794 this.pressed = true;
5795 }
5796
5797 if (eventType & INPUT_MOVE && ev.which !== 1) {
5798 eventType = INPUT_END;
5799 } // mouse must be down
5800
5801
5802 if (!this.pressed) {
5803 return;
5804 }
5805
5806 if (eventType & INPUT_END) {
5807 this.pressed = false;
5808 }
5809
5810 this.callback(this.manager, eventType, {
5811 pointers: [ev],
5812 changedPointers: [ev],
5813 pointerType: INPUT_TYPE_MOUSE,
5814 srcEvent: ev
5815 });
5816 };
5817
5818 return MouseInput;
5819 }(Input);
5820 /**
5821 * @private
5822 * Combined touch and mouse input
5823 *
5824 * Touch has a higher priority then mouse, and while touching no mouse events are allowed.
5825 * This because touch devices also emit mouse events while doing a touch.
5826 *
5827 * @constructor
5828 * @extends Input
5829 */
5830
5831
5832 var DEDUP_TIMEOUT = 2500;
5833 var DEDUP_DISTANCE = 25;
5834
5835 function setLastTouch(eventData) {
5836 var _eventData$changedPoi = eventData.changedPointers,
5837 touch = _eventData$changedPoi[0];
5838
5839 if (touch.identifier === this.primaryTouch) {
5840 var lastTouch = {
5841 x: touch.clientX,
5842 y: touch.clientY
5843 };
5844 var lts = this.lastTouches;
5845 this.lastTouches.push(lastTouch);
5846
5847 var removeLastTouch = function removeLastTouch() {
5848 var i = lts.indexOf(lastTouch);
5849
5850 if (i > -1) {
5851 lts.splice(i, 1);
5852 }
5853 };
5854
5855 setTimeout(removeLastTouch, DEDUP_TIMEOUT);
5856 }
5857 }
5858
5859 function recordTouches(eventType, eventData) {
5860 if (eventType & INPUT_START) {
5861 this.primaryTouch = eventData.changedPointers[0].identifier;
5862 setLastTouch.call(this, eventData);
5863 } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
5864 setLastTouch.call(this, eventData);
5865 }
5866 }
5867
5868 function isSyntheticEvent(eventData) {
5869 var x = eventData.srcEvent.clientX;
5870 var y = eventData.srcEvent.clientY;
5871
5872 for (var i = 0; i < this.lastTouches.length; i++) {
5873 var t = this.lastTouches[i];
5874 var dx = Math.abs(x - t.x);
5875 var dy = Math.abs(y - t.y);
5876
5877 if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {
5878 return true;
5879 }
5880 }
5881
5882 return false;
5883 }
5884
5885 var TouchMouseInput = /*#__PURE__*/function () {
5886 var TouchMouseInput = /*#__PURE__*/function (_Input) {
5887 _inheritsLoose(TouchMouseInput, _Input);
5888
5889 function TouchMouseInput(_manager, callback) {
5890 var _this;
5891
5892 _this = _Input.call(this, _manager, callback) || this;
5893
5894 _this.handler = function (manager, inputEvent, inputData) {
5895 var isTouch = inputData.pointerType === INPUT_TYPE_TOUCH;
5896 var isMouse = inputData.pointerType === INPUT_TYPE_MOUSE;
5897
5898 if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {
5899 return;
5900 } // when we're in a touch event, record touches to de-dupe synthetic mouse event
5901
5902
5903 if (isTouch) {
5904 recordTouches.call(_assertThisInitialized$1(_assertThisInitialized$1(_this)), inputEvent, inputData);
5905 } else if (isMouse && isSyntheticEvent.call(_assertThisInitialized$1(_assertThisInitialized$1(_this)), inputData)) {
5906 return;
5907 }
5908
5909 _this.callback(manager, inputEvent, inputData);
5910 };
5911
5912 _this.touch = new TouchInput(_this.manager, _this.handler);
5913 _this.mouse = new MouseInput(_this.manager, _this.handler);
5914 _this.primaryTouch = null;
5915 _this.lastTouches = [];
5916 return _this;
5917 }
5918 /**
5919 * @private
5920 * handle mouse and touch events
5921 * @param {Hammer} manager
5922 * @param {String} inputEvent
5923 * @param {Object} inputData
5924 */
5925
5926
5927 var _proto = TouchMouseInput.prototype;
5928 /**
5929 * @private
5930 * remove the event listeners
5931 */
5932
5933 _proto.destroy = function destroy() {
5934 this.touch.destroy();
5935 this.mouse.destroy();
5936 };
5937
5938 return TouchMouseInput;
5939 }(Input);
5940
5941 return TouchMouseInput;
5942 }();
5943 /**
5944 * @private
5945 * create new input type manager
5946 * called by the Manager constructor
5947 * @param {Hammer} manager
5948 * @returns {Input}
5949 */
5950
5951
5952 function createInputInstance(manager) {
5953 var Type; // let inputClass = manager.options.inputClass;
5954
5955 var inputClass = manager.options.inputClass;
5956
5957 if (inputClass) {
5958 Type = inputClass;
5959 } else if (SUPPORT_POINTER_EVENTS) {
5960 Type = PointerEventInput;
5961 } else if (SUPPORT_ONLY_TOUCH) {
5962 Type = TouchInput;
5963 } else if (!SUPPORT_TOUCH) {
5964 Type = MouseInput;
5965 } else {
5966 Type = TouchMouseInput;
5967 }
5968
5969 return new Type(manager, inputHandler);
5970 }
5971 /**
5972 * @private
5973 * if the argument is an array, we want to execute the fn on each entry
5974 * if it aint an array we don't want to do a thing.
5975 * this is used by all the methods that accept a single and array argument.
5976 * @param {*|Array} arg
5977 * @param {String} fn
5978 * @param {Object} [context]
5979 * @returns {Boolean}
5980 */
5981
5982
5983 function invokeArrayArg(arg, fn, context) {
5984 if (Array.isArray(arg)) {
5985 each(arg, context[fn], context);
5986 return true;
5987 }
5988
5989 return false;
5990 }
5991
5992 var STATE_POSSIBLE = 1;
5993 var STATE_BEGAN = 2;
5994 var STATE_CHANGED = 4;
5995 var STATE_ENDED = 8;
5996 var STATE_RECOGNIZED = STATE_ENDED;
5997 var STATE_CANCELLED = 16;
5998 var STATE_FAILED = 32;
5999 /**
6000 * @private
6001 * get a unique id
6002 * @returns {number} uniqueId
6003 */
6004
6005 var _uniqueId = 1;
6006
6007 function uniqueId() {
6008 return _uniqueId++;
6009 }
6010 /**
6011 * @private
6012 * get a recognizer by name if it is bound to a manager
6013 * @param {Recognizer|String} otherRecognizer
6014 * @param {Recognizer} recognizer
6015 * @returns {Recognizer}
6016 */
6017
6018
6019 function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
6020 var manager = recognizer.manager;
6021
6022 if (manager) {
6023 return manager.get(otherRecognizer);
6024 }
6025
6026 return otherRecognizer;
6027 }
6028 /**
6029 * @private
6030 * get a usable string, used as event postfix
6031 * @param {constant} state
6032 * @returns {String} state
6033 */
6034
6035
6036 function stateStr(state) {
6037 if (state & STATE_CANCELLED) {
6038 return 'cancel';
6039 } else if (state & STATE_ENDED) {
6040 return 'end';
6041 } else if (state & STATE_CHANGED) {
6042 return 'move';
6043 } else if (state & STATE_BEGAN) {
6044 return 'start';
6045 }
6046
6047 return '';
6048 }
6049 /**
6050 * @private
6051 * Recognizer flow explained; *
6052 * All recognizers have the initial state of POSSIBLE when a input session starts.
6053 * The definition of a input session is from the first input until the last input, with all it's movement in it. *
6054 * Example session for mouse-input: mousedown -> mousemove -> mouseup
6055 *
6056 * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed
6057 * which determines with state it should be.
6058 *
6059 * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to
6060 * POSSIBLE to give it another change on the next cycle.
6061 *
6062 * Possible
6063 * |
6064 * +-----+---------------+
6065 * | |
6066 * +-----+-----+ |
6067 * | | |
6068 * Failed Cancelled |
6069 * +-------+------+
6070 * | |
6071 * Recognized Began
6072 * |
6073 * Changed
6074 * |
6075 * Ended/Recognized
6076 */
6077
6078 /**
6079 * @private
6080 * Recognizer
6081 * Every recognizer needs to extend from this class.
6082 * @constructor
6083 * @param {Object} options
6084 */
6085
6086
6087 var Recognizer = /*#__PURE__*/function () {
6088 function Recognizer(options) {
6089 if (options === void 0) {
6090 options = {};
6091 }
6092
6093 this.options = _extends({
6094 enable: true
6095 }, options);
6096 this.id = uniqueId();
6097 this.manager = null; // default is enable true
6098
6099 this.state = STATE_POSSIBLE;
6100 this.simultaneous = {};
6101 this.requireFail = [];
6102 }
6103 /**
6104 * @private
6105 * set options
6106 * @param {Object} options
6107 * @return {Recognizer}
6108 */
6109
6110
6111 var _proto = Recognizer.prototype;
6112
6113 _proto.set = function set(options) {
6114 assign$1(this.options, options); // also update the touchAction, in case something changed about the directions/enabled state
6115
6116 this.manager && this.manager.touchAction.update();
6117 return this;
6118 };
6119 /**
6120 * @private
6121 * recognize simultaneous with an other recognizer.
6122 * @param {Recognizer} otherRecognizer
6123 * @returns {Recognizer} this
6124 */
6125
6126
6127 _proto.recognizeWith = function recognizeWith(otherRecognizer) {
6128 if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
6129 return this;
6130 }
6131
6132 var simultaneous = this.simultaneous;
6133 otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
6134
6135 if (!simultaneous[otherRecognizer.id]) {
6136 simultaneous[otherRecognizer.id] = otherRecognizer;
6137 otherRecognizer.recognizeWith(this);
6138 }
6139
6140 return this;
6141 };
6142 /**
6143 * @private
6144 * drop the simultaneous link. it doesnt remove the link on the other recognizer.
6145 * @param {Recognizer} otherRecognizer
6146 * @returns {Recognizer} this
6147 */
6148
6149
6150 _proto.dropRecognizeWith = function dropRecognizeWith(otherRecognizer) {
6151 if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
6152 return this;
6153 }
6154
6155 otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
6156 delete this.simultaneous[otherRecognizer.id];
6157 return this;
6158 };
6159 /**
6160 * @private
6161 * recognizer can only run when an other is failing
6162 * @param {Recognizer} otherRecognizer
6163 * @returns {Recognizer} this
6164 */
6165
6166
6167 _proto.requireFailure = function requireFailure(otherRecognizer) {
6168 if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
6169 return this;
6170 }
6171
6172 var requireFail = this.requireFail;
6173 otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
6174
6175 if (inArray(requireFail, otherRecognizer) === -1) {
6176 requireFail.push(otherRecognizer);
6177 otherRecognizer.requireFailure(this);
6178 }
6179
6180 return this;
6181 };
6182 /**
6183 * @private
6184 * drop the requireFailure link. it does not remove the link on the other recognizer.
6185 * @param {Recognizer} otherRecognizer
6186 * @returns {Recognizer} this
6187 */
6188
6189
6190 _proto.dropRequireFailure = function dropRequireFailure(otherRecognizer) {
6191 if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
6192 return this;
6193 }
6194
6195 otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
6196 var index = inArray(this.requireFail, otherRecognizer);
6197
6198 if (index > -1) {
6199 this.requireFail.splice(index, 1);
6200 }
6201
6202 return this;
6203 };
6204 /**
6205 * @private
6206 * has require failures boolean
6207 * @returns {boolean}
6208 */
6209
6210
6211 _proto.hasRequireFailures = function hasRequireFailures() {
6212 return this.requireFail.length > 0;
6213 };
6214 /**
6215 * @private
6216 * if the recognizer can recognize simultaneous with an other recognizer
6217 * @param {Recognizer} otherRecognizer
6218 * @returns {Boolean}
6219 */
6220
6221
6222 _proto.canRecognizeWith = function canRecognizeWith(otherRecognizer) {
6223 return !!this.simultaneous[otherRecognizer.id];
6224 };
6225 /**
6226 * @private
6227 * You should use `tryEmit` instead of `emit` directly to check
6228 * that all the needed recognizers has failed before emitting.
6229 * @param {Object} input
6230 */
6231
6232
6233 _proto.emit = function emit(input) {
6234 var self = this;
6235 var state = this.state;
6236
6237 function emit(event) {
6238 self.manager.emit(event, input);
6239 } // 'panstart' and 'panmove'
6240
6241
6242 if (state < STATE_ENDED) {
6243 emit(self.options.event + stateStr(state));
6244 }
6245
6246 emit(self.options.event); // simple 'eventName' events
6247
6248 if (input.additionalEvent) {
6249 // additional event(panleft, panright, pinchin, pinchout...)
6250 emit(input.additionalEvent);
6251 } // panend and pancancel
6252
6253
6254 if (state >= STATE_ENDED) {
6255 emit(self.options.event + stateStr(state));
6256 }
6257 };
6258 /**
6259 * @private
6260 * Check that all the require failure recognizers has failed,
6261 * if true, it emits a gesture event,
6262 * otherwise, setup the state to FAILED.
6263 * @param {Object} input
6264 */
6265
6266
6267 _proto.tryEmit = function tryEmit(input) {
6268 if (this.canEmit()) {
6269 return this.emit(input);
6270 } // it's failing anyway
6271
6272
6273 this.state = STATE_FAILED;
6274 };
6275 /**
6276 * @private
6277 * can we emit?
6278 * @returns {boolean}
6279 */
6280
6281
6282 _proto.canEmit = function canEmit() {
6283 var i = 0;
6284
6285 while (i < this.requireFail.length) {
6286 if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
6287 return false;
6288 }
6289
6290 i++;
6291 }
6292
6293 return true;
6294 };
6295 /**
6296 * @private
6297 * update the recognizer
6298 * @param {Object} inputData
6299 */
6300
6301
6302 _proto.recognize = function recognize(inputData) {
6303 // make a new copy of the inputData
6304 // so we can change the inputData without messing up the other recognizers
6305 var inputDataClone = assign$1({}, inputData); // is is enabled and allow recognizing?
6306
6307 if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
6308 this.reset();
6309 this.state = STATE_FAILED;
6310 return;
6311 } // reset when we've reached the end
6312
6313
6314 if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
6315 this.state = STATE_POSSIBLE;
6316 }
6317
6318 this.state = this.process(inputDataClone); // the recognizer has recognized a gesture
6319 // so trigger an event
6320
6321 if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
6322 this.tryEmit(inputDataClone);
6323 }
6324 };
6325 /**
6326 * @private
6327 * return the state of the recognizer
6328 * the actual recognizing happens in this method
6329 * @virtual
6330 * @param {Object} inputData
6331 * @returns {constant} STATE
6332 */
6333
6334 /* jshint ignore:start */
6335
6336
6337 _proto.process = function process(inputData) {};
6338 /* jshint ignore:end */
6339
6340 /**
6341 * @private
6342 * return the preferred touch-action
6343 * @virtual
6344 * @returns {Array}
6345 */
6346
6347
6348 _proto.getTouchAction = function getTouchAction() {};
6349 /**
6350 * @private
6351 * called when the gesture isn't allowed to recognize
6352 * like when another is being recognized or it is disabled
6353 * @virtual
6354 */
6355
6356
6357 _proto.reset = function reset() {};
6358
6359 return Recognizer;
6360 }();
6361 /**
6362 * @private
6363 * A tap is recognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur
6364 * between the given interval and position. The delay option can be used to recognize multi-taps without firing
6365 * a single tap.
6366 *
6367 * The eventData from the emitted event contains the property `tapCount`, which contains the amount of
6368 * multi-taps being recognized.
6369 * @constructor
6370 * @extends Recognizer
6371 */
6372
6373
6374 var TapRecognizer = /*#__PURE__*/function (_Recognizer) {
6375 _inheritsLoose(TapRecognizer, _Recognizer);
6376
6377 function TapRecognizer(options) {
6378 var _this;
6379
6380 if (options === void 0) {
6381 options = {};
6382 }
6383
6384 _this = _Recognizer.call(this, _extends({
6385 event: 'tap',
6386 pointers: 1,
6387 taps: 1,
6388 interval: 300,
6389 // max time between the multi-tap taps
6390 time: 250,
6391 // max time of the pointer to be down (like finger on the screen)
6392 threshold: 9,
6393 // a minimal movement is ok, but keep it low
6394 posThreshold: 10
6395 }, options)) || this; // previous time and center,
6396 // used for tap counting
6397
6398 _this.pTime = false;
6399 _this.pCenter = false;
6400 _this._timer = null;
6401 _this._input = null;
6402 _this.count = 0;
6403 return _this;
6404 }
6405
6406 var _proto = TapRecognizer.prototype;
6407
6408 _proto.getTouchAction = function getTouchAction() {
6409 return [TOUCH_ACTION_MANIPULATION];
6410 };
6411
6412 _proto.process = function process(input) {
6413 var _this2 = this;
6414
6415 var options = this.options;
6416 var validPointers = input.pointers.length === options.pointers;
6417 var validMovement = input.distance < options.threshold;
6418 var validTouchTime = input.deltaTime < options.time;
6419 this.reset();
6420
6421 if (input.eventType & INPUT_START && this.count === 0) {
6422 return this.failTimeout();
6423 } // we only allow little movement
6424 // and we've reached an end event, so a tap is possible
6425
6426
6427 if (validMovement && validTouchTime && validPointers) {
6428 if (input.eventType !== INPUT_END) {
6429 return this.failTimeout();
6430 }
6431
6432 var validInterval = this.pTime ? input.timeStamp - this.pTime < options.interval : true;
6433 var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
6434 this.pTime = input.timeStamp;
6435 this.pCenter = input.center;
6436
6437 if (!validMultiTap || !validInterval) {
6438 this.count = 1;
6439 } else {
6440 this.count += 1;
6441 }
6442
6443 this._input = input; // if tap count matches we have recognized it,
6444 // else it has began recognizing...
6445
6446 var tapCount = this.count % options.taps;
6447
6448 if (tapCount === 0) {
6449 // no failing requirements, immediately trigger the tap event
6450 // or wait as long as the multitap interval to trigger
6451 if (!this.hasRequireFailures()) {
6452 return STATE_RECOGNIZED;
6453 } else {
6454 this._timer = setTimeout(function () {
6455 _this2.state = STATE_RECOGNIZED;
6456
6457 _this2.tryEmit();
6458 }, options.interval);
6459 return STATE_BEGAN;
6460 }
6461 }
6462 }
6463
6464 return STATE_FAILED;
6465 };
6466
6467 _proto.failTimeout = function failTimeout() {
6468 var _this3 = this;
6469
6470 this._timer = setTimeout(function () {
6471 _this3.state = STATE_FAILED;
6472 }, this.options.interval);
6473 return STATE_FAILED;
6474 };
6475
6476 _proto.reset = function reset() {
6477 clearTimeout(this._timer);
6478 };
6479
6480 _proto.emit = function emit() {
6481 if (this.state === STATE_RECOGNIZED) {
6482 this._input.tapCount = this.count;
6483 this.manager.emit(this.options.event, this._input);
6484 }
6485 };
6486
6487 return TapRecognizer;
6488 }(Recognizer);
6489 /**
6490 * @private
6491 * This recognizer is just used as a base for the simple attribute recognizers.
6492 * @constructor
6493 * @extends Recognizer
6494 */
6495
6496
6497 var AttrRecognizer = /*#__PURE__*/function (_Recognizer) {
6498 _inheritsLoose(AttrRecognizer, _Recognizer);
6499
6500 function AttrRecognizer(options) {
6501 if (options === void 0) {
6502 options = {};
6503 }
6504
6505 return _Recognizer.call(this, _extends({
6506 pointers: 1
6507 }, options)) || this;
6508 }
6509 /**
6510 * @private
6511 * Used to check if it the recognizer receives valid input, like input.distance > 10.
6512 * @memberof AttrRecognizer
6513 * @param {Object} input
6514 * @returns {Boolean} recognized
6515 */
6516
6517
6518 var _proto = AttrRecognizer.prototype;
6519
6520 _proto.attrTest = function attrTest(input) {
6521 var optionPointers = this.options.pointers;
6522 return optionPointers === 0 || input.pointers.length === optionPointers;
6523 };
6524 /**
6525 * @private
6526 * Process the input and return the state for the recognizer
6527 * @memberof AttrRecognizer
6528 * @param {Object} input
6529 * @returns {*} State
6530 */
6531
6532
6533 _proto.process = function process(input) {
6534 var state = this.state;
6535 var eventType = input.eventType;
6536 var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
6537 var isValid = this.attrTest(input); // on cancel input and we've recognized before, return STATE_CANCELLED
6538
6539 if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
6540 return state | STATE_CANCELLED;
6541 } else if (isRecognized || isValid) {
6542 if (eventType & INPUT_END) {
6543 return state | STATE_ENDED;
6544 } else if (!(state & STATE_BEGAN)) {
6545 return STATE_BEGAN;
6546 }
6547
6548 return state | STATE_CHANGED;
6549 }
6550
6551 return STATE_FAILED;
6552 };
6553
6554 return AttrRecognizer;
6555 }(Recognizer);
6556 /**
6557 * @private
6558 * direction cons to string
6559 * @param {constant} direction
6560 * @returns {String}
6561 */
6562
6563
6564 function directionStr(direction) {
6565 if (direction === DIRECTION_DOWN) {
6566 return 'down';
6567 } else if (direction === DIRECTION_UP) {
6568 return 'up';
6569 } else if (direction === DIRECTION_LEFT) {
6570 return 'left';
6571 } else if (direction === DIRECTION_RIGHT) {
6572 return 'right';
6573 }
6574
6575 return '';
6576 }
6577 /**
6578 * @private
6579 * Pan
6580 * Recognized when the pointer is down and moved in the allowed direction.
6581 * @constructor
6582 * @extends AttrRecognizer
6583 */
6584
6585
6586 var PanRecognizer = /*#__PURE__*/function (_AttrRecognizer) {
6587 _inheritsLoose(PanRecognizer, _AttrRecognizer);
6588
6589 function PanRecognizer(options) {
6590 var _this;
6591
6592 if (options === void 0) {
6593 options = {};
6594 }
6595
6596 _this = _AttrRecognizer.call(this, _extends({
6597 event: 'pan',
6598 threshold: 10,
6599 pointers: 1,
6600 direction: DIRECTION_ALL
6601 }, options)) || this;
6602 _this.pX = null;
6603 _this.pY = null;
6604 return _this;
6605 }
6606
6607 var _proto = PanRecognizer.prototype;
6608
6609 _proto.getTouchAction = function getTouchAction() {
6610 var direction = this.options.direction;
6611 var actions = [];
6612
6613 if (direction & DIRECTION_HORIZONTAL) {
6614 actions.push(TOUCH_ACTION_PAN_Y);
6615 }
6616
6617 if (direction & DIRECTION_VERTICAL) {
6618 actions.push(TOUCH_ACTION_PAN_X);
6619 }
6620
6621 return actions;
6622 };
6623
6624 _proto.directionTest = function directionTest(input) {
6625 var options = this.options;
6626 var hasMoved = true;
6627 var distance = input.distance;
6628 var direction = input.direction;
6629 var x = input.deltaX;
6630 var y = input.deltaY; // lock to axis?
6631
6632 if (!(direction & options.direction)) {
6633 if (options.direction & DIRECTION_HORIZONTAL) {
6634 direction = x === 0 ? DIRECTION_NONE : x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
6635 hasMoved = x !== this.pX;
6636 distance = Math.abs(input.deltaX);
6637 } else {
6638 direction = y === 0 ? DIRECTION_NONE : y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
6639 hasMoved = y !== this.pY;
6640 distance = Math.abs(input.deltaY);
6641 }
6642 }
6643
6644 input.direction = direction;
6645 return hasMoved && distance > options.threshold && direction & options.direction;
6646 };
6647
6648 _proto.attrTest = function attrTest(input) {
6649 return AttrRecognizer.prototype.attrTest.call(this, input) && ( // replace with a super call
6650 this.state & STATE_BEGAN || !(this.state & STATE_BEGAN) && this.directionTest(input));
6651 };
6652
6653 _proto.emit = function emit(input) {
6654 this.pX = input.deltaX;
6655 this.pY = input.deltaY;
6656 var direction = directionStr(input.direction);
6657
6658 if (direction) {
6659 input.additionalEvent = this.options.event + direction;
6660 }
6661
6662 _AttrRecognizer.prototype.emit.call(this, input);
6663 };
6664
6665 return PanRecognizer;
6666 }(AttrRecognizer);
6667 /**
6668 * @private
6669 * Swipe
6670 * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.
6671 * @constructor
6672 * @extends AttrRecognizer
6673 */
6674
6675
6676 var SwipeRecognizer = /*#__PURE__*/function (_AttrRecognizer) {
6677 _inheritsLoose(SwipeRecognizer, _AttrRecognizer);
6678
6679 function SwipeRecognizer(options) {
6680 if (options === void 0) {
6681 options = {};
6682 }
6683
6684 return _AttrRecognizer.call(this, _extends({
6685 event: 'swipe',
6686 threshold: 10,
6687 velocity: 0.3,
6688 direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
6689 pointers: 1
6690 }, options)) || this;
6691 }
6692
6693 var _proto = SwipeRecognizer.prototype;
6694
6695 _proto.getTouchAction = function getTouchAction() {
6696 return PanRecognizer.prototype.getTouchAction.call(this);
6697 };
6698
6699 _proto.attrTest = function attrTest(input) {
6700 var direction = this.options.direction;
6701 var velocity;
6702
6703 if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
6704 velocity = input.overallVelocity;
6705 } else if (direction & DIRECTION_HORIZONTAL) {
6706 velocity = input.overallVelocityX;
6707 } else if (direction & DIRECTION_VERTICAL) {
6708 velocity = input.overallVelocityY;
6709 }
6710
6711 return _AttrRecognizer.prototype.attrTest.call(this, input) && direction & input.offsetDirection && input.distance > this.options.threshold && input.maxPointers === this.options.pointers && abs(velocity) > this.options.velocity && input.eventType & INPUT_END;
6712 };
6713
6714 _proto.emit = function emit(input) {
6715 var direction = directionStr(input.offsetDirection);
6716
6717 if (direction) {
6718 this.manager.emit(this.options.event + direction, input);
6719 }
6720
6721 this.manager.emit(this.options.event, input);
6722 };
6723
6724 return SwipeRecognizer;
6725 }(AttrRecognizer);
6726 /**
6727 * @private
6728 * Pinch
6729 * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).
6730 * @constructor
6731 * @extends AttrRecognizer
6732 */
6733
6734
6735 var PinchRecognizer = /*#__PURE__*/function (_AttrRecognizer) {
6736 _inheritsLoose(PinchRecognizer, _AttrRecognizer);
6737
6738 function PinchRecognizer(options) {
6739 if (options === void 0) {
6740 options = {};
6741 }
6742
6743 return _AttrRecognizer.call(this, _extends({
6744 event: 'pinch',
6745 threshold: 0,
6746 pointers: 2
6747 }, options)) || this;
6748 }
6749
6750 var _proto = PinchRecognizer.prototype;
6751
6752 _proto.getTouchAction = function getTouchAction() {
6753 return [TOUCH_ACTION_NONE];
6754 };
6755
6756 _proto.attrTest = function attrTest(input) {
6757 return _AttrRecognizer.prototype.attrTest.call(this, input) && (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
6758 };
6759
6760 _proto.emit = function emit(input) {
6761 if (input.scale !== 1) {
6762 var inOut = input.scale < 1 ? 'in' : 'out';
6763 input.additionalEvent = this.options.event + inOut;
6764 }
6765
6766 _AttrRecognizer.prototype.emit.call(this, input);
6767 };
6768
6769 return PinchRecognizer;
6770 }(AttrRecognizer);
6771 /**
6772 * @private
6773 * Rotate
6774 * Recognized when two or more pointer are moving in a circular motion.
6775 * @constructor
6776 * @extends AttrRecognizer
6777 */
6778
6779
6780 var RotateRecognizer = /*#__PURE__*/function (_AttrRecognizer) {
6781 _inheritsLoose(RotateRecognizer, _AttrRecognizer);
6782
6783 function RotateRecognizer(options) {
6784 if (options === void 0) {
6785 options = {};
6786 }
6787
6788 return _AttrRecognizer.call(this, _extends({
6789 event: 'rotate',
6790 threshold: 0,
6791 pointers: 2
6792 }, options)) || this;
6793 }
6794
6795 var _proto = RotateRecognizer.prototype;
6796
6797 _proto.getTouchAction = function getTouchAction() {
6798 return [TOUCH_ACTION_NONE];
6799 };
6800
6801 _proto.attrTest = function attrTest(input) {
6802 return _AttrRecognizer.prototype.attrTest.call(this, input) && (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
6803 };
6804
6805 return RotateRecognizer;
6806 }(AttrRecognizer);
6807 /**
6808 * @private
6809 * Press
6810 * Recognized when the pointer is down for x ms without any movement.
6811 * @constructor
6812 * @extends Recognizer
6813 */
6814
6815
6816 var PressRecognizer = /*#__PURE__*/function (_Recognizer) {
6817 _inheritsLoose(PressRecognizer, _Recognizer);
6818
6819 function PressRecognizer(options) {
6820 var _this;
6821
6822 if (options === void 0) {
6823 options = {};
6824 }
6825
6826 _this = _Recognizer.call(this, _extends({
6827 event: 'press',
6828 pointers: 1,
6829 time: 251,
6830 // minimal time of the pointer to be pressed
6831 threshold: 9
6832 }, options)) || this;
6833 _this._timer = null;
6834 _this._input = null;
6835 return _this;
6836 }
6837
6838 var _proto = PressRecognizer.prototype;
6839
6840 _proto.getTouchAction = function getTouchAction() {
6841 return [TOUCH_ACTION_AUTO];
6842 };
6843
6844 _proto.process = function process(input) {
6845 var _this2 = this;
6846
6847 var options = this.options;
6848 var validPointers = input.pointers.length === options.pointers;
6849 var validMovement = input.distance < options.threshold;
6850 var validTime = input.deltaTime > options.time;
6851 this._input = input; // we only allow little movement
6852 // and we've reached an end event, so a tap is possible
6853
6854 if (!validMovement || !validPointers || input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime) {
6855 this.reset();
6856 } else if (input.eventType & INPUT_START) {
6857 this.reset();
6858 this._timer = setTimeout(function () {
6859 _this2.state = STATE_RECOGNIZED;
6860
6861 _this2.tryEmit();
6862 }, options.time);
6863 } else if (input.eventType & INPUT_END) {
6864 return STATE_RECOGNIZED;
6865 }
6866
6867 return STATE_FAILED;
6868 };
6869
6870 _proto.reset = function reset() {
6871 clearTimeout(this._timer);
6872 };
6873
6874 _proto.emit = function emit(input) {
6875 if (this.state !== STATE_RECOGNIZED) {
6876 return;
6877 }
6878
6879 if (input && input.eventType & INPUT_END) {
6880 this.manager.emit(this.options.event + "up", input);
6881 } else {
6882 this._input.timeStamp = now();
6883 this.manager.emit(this.options.event, this._input);
6884 }
6885 };
6886
6887 return PressRecognizer;
6888 }(Recognizer);
6889
6890 var defaults = {
6891 /**
6892 * @private
6893 * set if DOM events are being triggered.
6894 * But this is slower and unused by simple implementations, so disabled by default.
6895 * @type {Boolean}
6896 * @default false
6897 */
6898 domEvents: false,
6899
6900 /**
6901 * @private
6902 * The value for the touchAction property/fallback.
6903 * When set to `compute` it will magically set the correct value based on the added recognizers.
6904 * @type {String}
6905 * @default compute
6906 */
6907 touchAction: TOUCH_ACTION_COMPUTE,
6908
6909 /**
6910 * @private
6911 * @type {Boolean}
6912 * @default true
6913 */
6914 enable: true,
6915
6916 /**
6917 * @private
6918 * EXPERIMENTAL FEATURE -- can be removed/changed
6919 * Change the parent input target element.
6920 * If Null, then it is being set the to main element.
6921 * @type {Null|EventTarget}
6922 * @default null
6923 */
6924 inputTarget: null,
6925
6926 /**
6927 * @private
6928 * force an input class
6929 * @type {Null|Function}
6930 * @default null
6931 */
6932 inputClass: null,
6933
6934 /**
6935 * @private
6936 * Some CSS properties can be used to improve the working of Hammer.
6937 * Add them to this method and they will be set when creating a new Manager.
6938 * @namespace
6939 */
6940 cssProps: {
6941 /**
6942 * @private
6943 * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.
6944 * @type {String}
6945 * @default 'none'
6946 */
6947 userSelect: "none",
6948
6949 /**
6950 * @private
6951 * Disable the Windows Phone grippers when pressing an element.
6952 * @type {String}
6953 * @default 'none'
6954 */
6955 touchSelect: "none",
6956
6957 /**
6958 * @private
6959 * Disables the default callout shown when you touch and hold a touch target.
6960 * On iOS, when you touch and hold a touch target such as a link, Safari displays
6961 * a callout containing information about the link. This property allows you to disable that callout.
6962 * @type {String}
6963 * @default 'none'
6964 */
6965 touchCallout: "none",
6966
6967 /**
6968 * @private
6969 * Specifies whether zooming is enabled. Used by IE10>
6970 * @type {String}
6971 * @default 'none'
6972 */
6973 contentZooming: "none",
6974
6975 /**
6976 * @private
6977 * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.
6978 * @type {String}
6979 * @default 'none'
6980 */
6981 userDrag: "none",
6982
6983 /**
6984 * @private
6985 * Overrides the highlight color shown when the user taps a link or a JavaScript
6986 * clickable element in iOS. This property obeys the alpha value, if specified.
6987 * @type {String}
6988 * @default 'rgba(0,0,0,0)'
6989 */
6990 tapHighlightColor: "rgba(0,0,0,0)"
6991 }
6992 };
6993 /**
6994 * @private
6995 * Default recognizer setup when calling `Hammer()`
6996 * When creating a new Manager these will be skipped.
6997 * This is separated with other defaults because of tree-shaking.
6998 * @type {Array}
6999 */
7000
7001 var preset = [[RotateRecognizer, {
7002 enable: false
7003 }], [PinchRecognizer, {
7004 enable: false
7005 }, ['rotate']], [SwipeRecognizer, {
7006 direction: DIRECTION_HORIZONTAL
7007 }], [PanRecognizer, {
7008 direction: DIRECTION_HORIZONTAL
7009 }, ['swipe']], [TapRecognizer], [TapRecognizer, {
7010 event: 'doubletap',
7011 taps: 2
7012 }, ['tap']], [PressRecognizer]];
7013 var STOP = 1;
7014 var FORCED_STOP = 2;
7015 /**
7016 * @private
7017 * add/remove the css properties as defined in manager.options.cssProps
7018 * @param {Manager} manager
7019 * @param {Boolean} add
7020 */
7021
7022 function toggleCssProps(manager, add) {
7023 var element = manager.element;
7024
7025 if (!element.style) {
7026 return;
7027 }
7028
7029 var prop;
7030 each(manager.options.cssProps, function (value, name) {
7031 prop = prefixed(element.style, name);
7032
7033 if (add) {
7034 manager.oldCssProps[prop] = element.style[prop];
7035 element.style[prop] = value;
7036 } else {
7037 element.style[prop] = manager.oldCssProps[prop] || "";
7038 }
7039 });
7040
7041 if (!add) {
7042 manager.oldCssProps = {};
7043 }
7044 }
7045 /**
7046 * @private
7047 * trigger dom event
7048 * @param {String} event
7049 * @param {Object} data
7050 */
7051
7052
7053 function triggerDomEvent(event, data) {
7054 var gestureEvent = document.createEvent("Event");
7055 gestureEvent.initEvent(event, true, true);
7056 gestureEvent.gesture = data;
7057 data.target.dispatchEvent(gestureEvent);
7058 }
7059 /**
7060 * @private
7061 * Manager
7062 * @param {HTMLElement} element
7063 * @param {Object} [options]
7064 * @constructor
7065 */
7066
7067
7068 var Manager = /*#__PURE__*/function () {
7069 function Manager(element, options) {
7070 var _this = this;
7071
7072 this.options = assign$1({}, defaults, options || {});
7073 this.options.inputTarget = this.options.inputTarget || element;
7074 this.handlers = {};
7075 this.session = {};
7076 this.recognizers = [];
7077 this.oldCssProps = {};
7078 this.element = element;
7079 this.input = createInputInstance(this);
7080 this.touchAction = new TouchAction(this, this.options.touchAction);
7081 toggleCssProps(this, true);
7082 each(this.options.recognizers, function (item) {
7083 var recognizer = _this.add(new item[0](item[1]));
7084
7085 item[2] && recognizer.recognizeWith(item[2]);
7086 item[3] && recognizer.requireFailure(item[3]);
7087 }, this);
7088 }
7089 /**
7090 * @private
7091 * set options
7092 * @param {Object} options
7093 * @returns {Manager}
7094 */
7095
7096
7097 var _proto = Manager.prototype;
7098
7099 _proto.set = function set(options) {
7100 assign$1(this.options, options); // Options that need a little more setup
7101
7102 if (options.touchAction) {
7103 this.touchAction.update();
7104 }
7105
7106 if (options.inputTarget) {
7107 // Clean up existing event listeners and reinitialize
7108 this.input.destroy();
7109 this.input.target = options.inputTarget;
7110 this.input.init();
7111 }
7112
7113 return this;
7114 };
7115 /**
7116 * @private
7117 * stop recognizing for this session.
7118 * This session will be discarded, when a new [input]start event is fired.
7119 * When forced, the recognizer cycle is stopped immediately.
7120 * @param {Boolean} [force]
7121 */
7122
7123
7124 _proto.stop = function stop(force) {
7125 this.session.stopped = force ? FORCED_STOP : STOP;
7126 };
7127 /**
7128 * @private
7129 * run the recognizers!
7130 * called by the inputHandler function on every movement of the pointers (touches)
7131 * it walks through all the recognizers and tries to detect the gesture that is being made
7132 * @param {Object} inputData
7133 */
7134
7135
7136 _proto.recognize = function recognize(inputData) {
7137 var session = this.session;
7138
7139 if (session.stopped) {
7140 return;
7141 } // run the touch-action polyfill
7142
7143
7144 this.touchAction.preventDefaults(inputData);
7145 var recognizer;
7146 var recognizers = this.recognizers; // this holds the recognizer that is being recognized.
7147 // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED
7148 // if no recognizer is detecting a thing, it is set to `null`
7149
7150 var curRecognizer = session.curRecognizer; // reset when the last recognizer is recognized
7151 // or when we're in a new session
7152
7153 if (!curRecognizer || curRecognizer && curRecognizer.state & STATE_RECOGNIZED) {
7154 session.curRecognizer = null;
7155 curRecognizer = null;
7156 }
7157
7158 var i = 0;
7159
7160 while (i < recognizers.length) {
7161 recognizer = recognizers[i]; // find out if we are allowed try to recognize the input for this one.
7162 // 1. allow if the session is NOT forced stopped (see the .stop() method)
7163 // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one
7164 // that is being recognized.
7165 // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.
7166 // this can be setup with the `recognizeWith()` method on the recognizer.
7167
7168 if (session.stopped !== FORCED_STOP && ( // 1
7169 !curRecognizer || recognizer === curRecognizer || // 2
7170 recognizer.canRecognizeWith(curRecognizer))) {
7171 // 3
7172 recognizer.recognize(inputData);
7173 } else {
7174 recognizer.reset();
7175 } // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the
7176 // current active recognizer. but only if we don't already have an active recognizer
7177
7178
7179 if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
7180 session.curRecognizer = recognizer;
7181 curRecognizer = recognizer;
7182 }
7183
7184 i++;
7185 }
7186 };
7187 /**
7188 * @private
7189 * get a recognizer by its event name.
7190 * @param {Recognizer|String} recognizer
7191 * @returns {Recognizer|Null}
7192 */
7193
7194
7195 _proto.get = function get(recognizer) {
7196 if (recognizer instanceof Recognizer) {
7197 return recognizer;
7198 }
7199
7200 var recognizers = this.recognizers;
7201
7202 for (var i = 0; i < recognizers.length; i++) {
7203 if (recognizers[i].options.event === recognizer) {
7204 return recognizers[i];
7205 }
7206 }
7207
7208 return null;
7209 };
7210 /**
7211 * @private add a recognizer to the manager
7212 * existing recognizers with the same event name will be removed
7213 * @param {Recognizer} recognizer
7214 * @returns {Recognizer|Manager}
7215 */
7216
7217
7218 _proto.add = function add(recognizer) {
7219 if (invokeArrayArg(recognizer, "add", this)) {
7220 return this;
7221 } // remove existing
7222
7223
7224 var existing = this.get(recognizer.options.event);
7225
7226 if (existing) {
7227 this.remove(existing);
7228 }
7229
7230 this.recognizers.push(recognizer);
7231 recognizer.manager = this;
7232 this.touchAction.update();
7233 return recognizer;
7234 };
7235 /**
7236 * @private
7237 * remove a recognizer by name or instance
7238 * @param {Recognizer|String} recognizer
7239 * @returns {Manager}
7240 */
7241
7242
7243 _proto.remove = function remove(recognizer) {
7244 if (invokeArrayArg(recognizer, "remove", this)) {
7245 return this;
7246 }
7247
7248 var targetRecognizer = this.get(recognizer); // let's make sure this recognizer exists
7249
7250 if (recognizer) {
7251 var recognizers = this.recognizers;
7252 var index = inArray(recognizers, targetRecognizer);
7253
7254 if (index !== -1) {
7255 recognizers.splice(index, 1);
7256 this.touchAction.update();
7257 }
7258 }
7259
7260 return this;
7261 };
7262 /**
7263 * @private
7264 * bind event
7265 * @param {String} events
7266 * @param {Function} handler
7267 * @returns {EventEmitter} this
7268 */
7269
7270
7271 _proto.on = function on(events, handler) {
7272 if (events === undefined || handler === undefined) {
7273 return this;
7274 }
7275
7276 var handlers = this.handlers;
7277 each(splitStr(events), function (event) {
7278 handlers[event] = handlers[event] || [];
7279 handlers[event].push(handler);
7280 });
7281 return this;
7282 };
7283 /**
7284 * @private unbind event, leave emit blank to remove all handlers
7285 * @param {String} events
7286 * @param {Function} [handler]
7287 * @returns {EventEmitter} this
7288 */
7289
7290
7291 _proto.off = function off(events, handler) {
7292 if (events === undefined) {
7293 return this;
7294 }
7295
7296 var handlers = this.handlers;
7297 each(splitStr(events), function (event) {
7298 if (!handler) {
7299 delete handlers[event];
7300 } else {
7301 handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);
7302 }
7303 });
7304 return this;
7305 };
7306 /**
7307 * @private emit event to the listeners
7308 * @param {String} event
7309 * @param {Object} data
7310 */
7311
7312
7313 _proto.emit = function emit(event, data) {
7314 // we also want to trigger dom events
7315 if (this.options.domEvents) {
7316 triggerDomEvent(event, data);
7317 } // no handlers, so skip it all
7318
7319
7320 var handlers = this.handlers[event] && this.handlers[event].slice();
7321
7322 if (!handlers || !handlers.length) {
7323 return;
7324 }
7325
7326 data.type = event;
7327
7328 data.preventDefault = function () {
7329 data.srcEvent.preventDefault();
7330 };
7331
7332 var i = 0;
7333
7334 while (i < handlers.length) {
7335 handlers[i](data);
7336 i++;
7337 }
7338 };
7339 /**
7340 * @private
7341 * destroy the manager and unbinds all events
7342 * it doesn't unbind dom events, that is the user own responsibility
7343 */
7344
7345
7346 _proto.destroy = function destroy() {
7347 this.element && toggleCssProps(this, false);
7348 this.handlers = {};
7349 this.session = {};
7350 this.input.destroy();
7351 this.element = null;
7352 };
7353
7354 return Manager;
7355 }();
7356
7357 var SINGLE_TOUCH_INPUT_MAP = {
7358 touchstart: INPUT_START,
7359 touchmove: INPUT_MOVE,
7360 touchend: INPUT_END,
7361 touchcancel: INPUT_CANCEL
7362 };
7363 var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';
7364 var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';
7365 /**
7366 * @private
7367 * Touch events input
7368 * @constructor
7369 * @extends Input
7370 */
7371
7372 var SingleTouchInput = /*#__PURE__*/function (_Input) {
7373 _inheritsLoose(SingleTouchInput, _Input);
7374
7375 function SingleTouchInput() {
7376 var _this;
7377
7378 var proto = SingleTouchInput.prototype;
7379 proto.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
7380 proto.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
7381 _this = _Input.apply(this, arguments) || this;
7382 _this.started = false;
7383 return _this;
7384 }
7385
7386 var _proto = SingleTouchInput.prototype;
7387
7388 _proto.handler = function handler(ev) {
7389 var type = SINGLE_TOUCH_INPUT_MAP[ev.type]; // should we handle the touch events?
7390
7391 if (type === INPUT_START) {
7392 this.started = true;
7393 }
7394
7395 if (!this.started) {
7396 return;
7397 }
7398
7399 var touches = normalizeSingleTouches.call(this, ev, type); // when done, reset the started state
7400
7401 if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
7402 this.started = false;
7403 }
7404
7405 this.callback(this.manager, type, {
7406 pointers: touches[0],
7407 changedPointers: touches[1],
7408 pointerType: INPUT_TYPE_TOUCH,
7409 srcEvent: ev
7410 });
7411 };
7412
7413 return SingleTouchInput;
7414 }(Input);
7415
7416 function normalizeSingleTouches(ev, type) {
7417 var all = toArray(ev.touches);
7418 var changed = toArray(ev.changedTouches);
7419
7420 if (type & (INPUT_END | INPUT_CANCEL)) {
7421 all = uniqueArray(all.concat(changed), 'identifier', true);
7422 }
7423
7424 return [all, changed];
7425 }
7426 /**
7427 * @private
7428 * wrap a method with a deprecation warning and stack trace
7429 * @param {Function} method
7430 * @param {String} name
7431 * @param {String} message
7432 * @returns {Function} A new function wrapping the supplied method.
7433 */
7434
7435
7436 function deprecate(method, name, message) {
7437 var deprecationMessage = "DEPRECATED METHOD: " + name + "\n" + message + " AT \n";
7438 return function () {
7439 var e = new Error('get-stack-trace');
7440 var stack = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, '').replace(/^\s+at\s+/gm, '').replace(/^Object.<anonymous>\s*\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';
7441 var log = window.console && (window.console.warn || window.console.log);
7442
7443 if (log) {
7444 log.call(window.console, deprecationMessage, stack);
7445 }
7446
7447 return method.apply(this, arguments);
7448 };
7449 }
7450 /**
7451 * @private
7452 * extend object.
7453 * means that properties in dest will be overwritten by the ones in src.
7454 * @param {Object} dest
7455 * @param {Object} src
7456 * @param {Boolean} [merge=false]
7457 * @returns {Object} dest
7458 */
7459
7460
7461 var extend = deprecate(function (dest, src, merge) {
7462 var keys = Object.keys(src);
7463 var i = 0;
7464
7465 while (i < keys.length) {
7466 if (!merge || merge && dest[keys[i]] === undefined) {
7467 dest[keys[i]] = src[keys[i]];
7468 }
7469
7470 i++;
7471 }
7472
7473 return dest;
7474 }, 'extend', 'Use `assign`.');
7475 /**
7476 * @private
7477 * merge the values from src in the dest.
7478 * means that properties that exist in dest will not be overwritten by src
7479 * @param {Object} dest
7480 * @param {Object} src
7481 * @returns {Object} dest
7482 */
7483
7484 var merge$1 = deprecate(function (dest, src) {
7485 return extend(dest, src, true);
7486 }, 'merge', 'Use `assign`.');
7487 /**
7488 * @private
7489 * simple class inheritance
7490 * @param {Function} child
7491 * @param {Function} base
7492 * @param {Object} [properties]
7493 */
7494
7495 function inherit(child, base, properties) {
7496 var baseP = base.prototype;
7497 var childP;
7498 childP = child.prototype = Object.create(baseP);
7499 childP.constructor = child;
7500 childP._super = baseP;
7501
7502 if (properties) {
7503 assign$1(childP, properties);
7504 }
7505 }
7506 /**
7507 * @private
7508 * simple function bind
7509 * @param {Function} fn
7510 * @param {Object} context
7511 * @returns {Function}
7512 */
7513
7514
7515 function bindFn(fn, context) {
7516 return function boundFn() {
7517 return fn.apply(context, arguments);
7518 };
7519 }
7520 /**
7521 * @private
7522 * Simple way to create a manager with a default set of recognizers.
7523 * @param {HTMLElement} element
7524 * @param {Object} [options]
7525 * @constructor
7526 */
7527
7528
7529 var Hammer = /*#__PURE__*/function () {
7530 var Hammer =
7531 /**
7532 * @private
7533 * @const {string}
7534 */
7535 function Hammer(element, options) {
7536 if (options === void 0) {
7537 options = {};
7538 }
7539
7540 return new Manager(element, _extends({
7541 recognizers: preset.concat()
7542 }, options));
7543 };
7544
7545 Hammer.VERSION = "2.0.17-rc";
7546 Hammer.DIRECTION_ALL = DIRECTION_ALL;
7547 Hammer.DIRECTION_DOWN = DIRECTION_DOWN;
7548 Hammer.DIRECTION_LEFT = DIRECTION_LEFT;
7549 Hammer.DIRECTION_RIGHT = DIRECTION_RIGHT;
7550 Hammer.DIRECTION_UP = DIRECTION_UP;
7551 Hammer.DIRECTION_HORIZONTAL = DIRECTION_HORIZONTAL;
7552 Hammer.DIRECTION_VERTICAL = DIRECTION_VERTICAL;
7553 Hammer.DIRECTION_NONE = DIRECTION_NONE;
7554 Hammer.DIRECTION_DOWN = DIRECTION_DOWN;
7555 Hammer.INPUT_START = INPUT_START;
7556 Hammer.INPUT_MOVE = INPUT_MOVE;
7557 Hammer.INPUT_END = INPUT_END;
7558 Hammer.INPUT_CANCEL = INPUT_CANCEL;
7559 Hammer.STATE_POSSIBLE = STATE_POSSIBLE;
7560 Hammer.STATE_BEGAN = STATE_BEGAN;
7561 Hammer.STATE_CHANGED = STATE_CHANGED;
7562 Hammer.STATE_ENDED = STATE_ENDED;
7563 Hammer.STATE_RECOGNIZED = STATE_RECOGNIZED;
7564 Hammer.STATE_CANCELLED = STATE_CANCELLED;
7565 Hammer.STATE_FAILED = STATE_FAILED;
7566 Hammer.Manager = Manager;
7567 Hammer.Input = Input;
7568 Hammer.TouchAction = TouchAction;
7569 Hammer.TouchInput = TouchInput;
7570 Hammer.MouseInput = MouseInput;
7571 Hammer.PointerEventInput = PointerEventInput;
7572 Hammer.TouchMouseInput = TouchMouseInput;
7573 Hammer.SingleTouchInput = SingleTouchInput;
7574 Hammer.Recognizer = Recognizer;
7575 Hammer.AttrRecognizer = AttrRecognizer;
7576 Hammer.Tap = TapRecognizer;
7577 Hammer.Pan = PanRecognizer;
7578 Hammer.Swipe = SwipeRecognizer;
7579 Hammer.Pinch = PinchRecognizer;
7580 Hammer.Rotate = RotateRecognizer;
7581 Hammer.Press = PressRecognizer;
7582 Hammer.on = addEventListeners;
7583 Hammer.off = removeEventListeners;
7584 Hammer.each = each;
7585 Hammer.merge = merge$1;
7586 Hammer.extend = extend;
7587 Hammer.bindFn = bindFn;
7588 Hammer.assign = assign$1;
7589 Hammer.inherit = inherit;
7590 Hammer.bindFn = bindFn;
7591 Hammer.prefixed = prefixed;
7592 Hammer.toArray = toArray;
7593 Hammer.inArray = inArray;
7594 Hammer.uniqueArray = uniqueArray;
7595 Hammer.splitStr = splitStr;
7596 Hammer.boolOrFn = boolOrFn;
7597 Hammer.hasParent = hasParent;
7598 Hammer.addEventListeners = addEventListeners;
7599 Hammer.removeEventListeners = removeEventListeners;
7600 Hammer.defaults = assign$1({}, defaults, {
7601 preset: preset
7602 });
7603 return Hammer;
7604 }(); // style loader but by script tag, not by the loader.
7605 var RealHammer = Hammer;
7606
7607 function _createForOfIteratorHelper$3(o, allowArrayLike) { var it = typeof symbol !== "undefined" && getIteratorMethod$1(o) || o["@@iterator"]; if (!it) { if (isArray$1(o) || (it = _unsupportedIterableToArray$3(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
7608
7609 function _unsupportedIterableToArray$3(o, minLen) { var _context21; if (!o) return; if (typeof o === "string") return _arrayLikeToArray$3(o, minLen); var n = slice(_context21 = Object.prototype.toString.call(o)).call(_context21, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return from$3(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen); }
7610
7611 function _arrayLikeToArray$3(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
7612 /**
7613 * Use this symbol to delete properies in deepObjectAssign.
7614 */
7615
7616 var DELETE = symbol("DELETE");
7617 /**
7618 * Pure version of deepObjectAssign, it doesn't modify any of it's arguments.
7619 *
7620 * @param base - The base object that fullfils the whole interface T.
7621 * @param updates - Updates that may change or delete props.
7622 * @returns A brand new instance with all the supplied objects deeply merged.
7623 */
7624
7625
7626 function pureDeepObjectAssign(base) {
7627 var _context;
7628
7629 for (var _len = arguments.length, updates = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
7630 updates[_key - 1] = arguments[_key];
7631 }
7632
7633 return deepObjectAssign.apply(void 0, concat$1(_context = [{}, base]).call(_context, updates));
7634 }
7635 /**
7636 * Deep version of object assign with additional deleting by the DELETE symbol.
7637 *
7638 * @param values - Objects to be deeply merged.
7639 * @returns The first object from values.
7640 */
7641
7642
7643 function deepObjectAssign() {
7644 var merged = deepObjectAssignNonentry.apply(void 0, arguments);
7645 stripDelete(merged);
7646 return merged;
7647 }
7648 /**
7649 * Deep version of object assign with additional deleting by the DELETE symbol.
7650 *
7651 * @remarks
7652 * This doesn't strip the DELETE symbols so they may end up in the final object.
7653 * @param values - Objects to be deeply merged.
7654 * @returns The first object from values.
7655 */
7656
7657
7658 function deepObjectAssignNonentry() {
7659 for (var _len2 = arguments.length, values = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
7660 values[_key2] = arguments[_key2];
7661 }
7662
7663 if (values.length < 2) {
7664 return values[0];
7665 } else if (values.length > 2) {
7666 var _context2;
7667
7668 return deepObjectAssignNonentry.apply(void 0, concat$1(_context2 = [deepObjectAssign(values[0], values[1])]).call(_context2, _toConsumableArray(slice(values).call(values, 2))));
7669 }
7670
7671 var a = values[0];
7672 var b = values[1];
7673
7674 var _iterator = _createForOfIteratorHelper$3(ownKeys$1(b)),
7675 _step;
7676
7677 try {
7678 for (_iterator.s(); !(_step = _iterator.n()).done;) {
7679 var prop = _step.value;
7680 if (!Object.prototype.propertyIsEnumerable.call(b, prop)) ;else if (b[prop] === DELETE) {
7681 delete a[prop];
7682 } else if (a[prop] !== null && b[prop] !== null && _typeof(a[prop]) === "object" && _typeof(b[prop]) === "object" && !isArray$1(a[prop]) && !isArray$1(b[prop])) {
7683 a[prop] = deepObjectAssignNonentry(a[prop], b[prop]);
7684 } else {
7685 a[prop] = clone(b[prop]);
7686 }
7687 }
7688 } catch (err) {
7689 _iterator.e(err);
7690 } finally {
7691 _iterator.f();
7692 }
7693
7694 return a;
7695 }
7696 /**
7697 * Deep clone given object or array. In case of primitive simply return.
7698 *
7699 * @param a - Anything.
7700 * @returns Deep cloned object/array or unchanged a.
7701 */
7702
7703
7704 function clone(a) {
7705 if (isArray$1(a)) {
7706 return map$3(a).call(a, function (value) {
7707 return clone(value);
7708 });
7709 } else if (_typeof(a) === "object" && a !== null) {
7710 return deepObjectAssignNonentry({}, a);
7711 } else {
7712 return a;
7713 }
7714 }
7715 /**
7716 * Strip DELETE from given object.
7717 *
7718 * @param a - Object which may contain DELETE but won't after this is executed.
7719 */
7720
7721
7722 function stripDelete(a) {
7723 for (var _i = 0, _Object$keys = keys$4(a); _i < _Object$keys.length; _i++) {
7724 var prop = _Object$keys[_i];
7725
7726 if (a[prop] === DELETE) {
7727 delete a[prop];
7728 } else if (_typeof(a[prop]) === "object" && a[prop] !== null) {
7729 stripDelete(a[prop]);
7730 }
7731 }
7732 }
7733 /**
7734 * Setup a mock hammer.js object, for unit testing.
7735 *
7736 * Inspiration: https://github.com/uber/deck.gl/pull/658
7737 *
7738 * @returns {{on: noop, off: noop, destroy: noop, emit: noop, get: get}}
7739 */
7740
7741
7742 function hammerMock() {
7743 var noop = function noop() {};
7744
7745 return {
7746 on: noop,
7747 off: noop,
7748 destroy: noop,
7749 emit: noop,
7750 get: function get() {
7751 return {
7752 set: noop
7753 };
7754 }
7755 };
7756 }
7757
7758 var Hammer$1 = typeof window !== "undefined" ? window.Hammer || RealHammer : function () {
7759 // hammer.js is only available in a browser, not in node.js. Replacing it with a mock object.
7760 return hammerMock();
7761 };
7762 /**
7763 * Turn an element into an clickToUse element.
7764 * When not active, the element has a transparent overlay. When the overlay is
7765 * clicked, the mode is changed to active.
7766 * When active, the element is displayed with a blue border around it, and
7767 * the interactive contents of the element can be used. When clicked outside
7768 * the element, the elements mode is changed to inactive.
7769 *
7770 * @param {Element} container
7771 * @class Activator
7772 */
7773
7774 function Activator$1(container) {
7775 var _this = this,
7776 _context3;
7777
7778 this._cleanupQueue = [];
7779 this.active = false;
7780 this._dom = {
7781 container: container,
7782 overlay: document.createElement("div")
7783 };
7784
7785 this._dom.overlay.classList.add("vis-overlay");
7786
7787 this._dom.container.appendChild(this._dom.overlay);
7788
7789 this._cleanupQueue.push(function () {
7790 _this._dom.overlay.parentNode.removeChild(_this._dom.overlay);
7791 });
7792
7793 var hammer = Hammer$1(this._dom.overlay);
7794 hammer.on("tap", bind$6(_context3 = this._onTapOverlay).call(_context3, this));
7795
7796 this._cleanupQueue.push(function () {
7797 hammer.destroy(); // FIXME: cleaning up hammer instances doesn't work (Timeline not removed
7798 // from memory)
7799 }); // block all touch events (except tap)
7800
7801
7802 var events = ["tap", "doubletap", "press", "pinch", "pan", "panstart", "panmove", "panend"];
7803
7804 forEach$1(events).call(events, function (event) {
7805 hammer.on(event, function (event) {
7806 event.srcEvent.stopPropagation();
7807 });
7808 }); // attach a click event to the window, in order to deactivate when clicking outside the timeline
7809
7810
7811 if (document && document.body) {
7812 this._onClick = function (event) {
7813 if (!_hasParent(event.target, container)) {
7814 _this.deactivate();
7815 }
7816 };
7817
7818 document.body.addEventListener("click", this._onClick);
7819
7820 this._cleanupQueue.push(function () {
7821 document.body.removeEventListener("click", _this._onClick);
7822 });
7823 } // prepare escape key listener for deactivating when active
7824
7825
7826 this._escListener = function (event) {
7827 if ("key" in event ? event.key === "Escape" : event.keyCode === 27
7828 /* the keyCode is for IE11 */
7829 ) {
7830 _this.deactivate();
7831 }
7832 };
7833 } // turn into an event emitter
7834
7835
7836 Emitter(Activator$1.prototype); // The currently active activator
7837
7838 Activator$1.current = null;
7839 /**
7840 * Destroy the activator. Cleans up all created DOM and event listeners
7841 */
7842
7843 Activator$1.prototype.destroy = function () {
7844 var _context4, _context5;
7845
7846 this.deactivate();
7847
7848 var _iterator2 = _createForOfIteratorHelper$3(reverse(_context4 = splice(_context5 = this._cleanupQueue).call(_context5, 0)).call(_context4)),
7849 _step2;
7850
7851 try {
7852 for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
7853 var callback = _step2.value;
7854 callback();
7855 }
7856 } catch (err) {
7857 _iterator2.e(err);
7858 } finally {
7859 _iterator2.f();
7860 }
7861 };
7862 /**
7863 * Activate the element
7864 * Overlay is hidden, element is decorated with a blue shadow border
7865 */
7866
7867
7868 Activator$1.prototype.activate = function () {
7869 // we allow only one active activator at a time
7870 if (Activator$1.current) {
7871 Activator$1.current.deactivate();
7872 }
7873
7874 Activator$1.current = this;
7875 this.active = true;
7876 this._dom.overlay.style.display = "none";
7877
7878 this._dom.container.classList.add("vis-active");
7879
7880 this.emit("change");
7881 this.emit("activate"); // ugly hack: bind ESC after emitting the events, as the Network rebinds all
7882 // keyboard events on a 'change' event
7883
7884 document.body.addEventListener("keydown", this._escListener);
7885 };
7886 /**
7887 * Deactivate the element
7888 * Overlay is displayed on top of the element
7889 */
7890
7891
7892 Activator$1.prototype.deactivate = function () {
7893 this.active = false;
7894 this._dom.overlay.style.display = "block";
7895
7896 this._dom.container.classList.remove("vis-active");
7897
7898 document.body.removeEventListener("keydown", this._escListener);
7899 this.emit("change");
7900 this.emit("deactivate");
7901 };
7902 /**
7903 * Handle a tap event: activate the container
7904 *
7905 * @param {Event} event The event
7906 * @private
7907 */
7908
7909
7910 Activator$1.prototype._onTapOverlay = function (event) {
7911 // activate the container
7912 this.activate();
7913 event.srcEvent.stopPropagation();
7914 };
7915 /**
7916 * Test whether the element has the requested parent element somewhere in
7917 * its chain of parent nodes.
7918 *
7919 * @param {HTMLElement} element
7920 * @param {HTMLElement} parent
7921 * @returns {boolean} Returns true when the parent is found somewhere in the
7922 * chain of parent nodes.
7923 * @private
7924 */
7925
7926
7927 function _hasParent(element, parent) {
7928 while (element) {
7929 if (element === parent) {
7930 return true;
7931 }
7932
7933 element = element.parentNode;
7934 }
7935
7936 return false;
7937 } // utility functions
7938
7939 var global$4 = global$M;
7940 var isConstructor = isConstructor$4;
7941 var tryToString$1 = tryToString$4;
7942 var TypeError$3 = global$4.TypeError; // `Assert: IsConstructor(argument) is true`
7943
7944 var aConstructor$1 = function (argument) {
7945 if (isConstructor(argument)) return argument;
7946 throw TypeError$3(tryToString$1(argument) + ' is not a constructor');
7947 };
7948
7949 var $$5 = _export;
7950 var getBuiltIn$1 = getBuiltIn$9;
7951 var apply = functionApply;
7952 var bind$2 = functionBind;
7953 var aConstructor = aConstructor$1;
7954 var anObject$1 = anObject$b;
7955 var isObject$3 = isObject$f;
7956 var create$4 = objectCreate;
7957 var fails$5 = fails$r;
7958 var nativeConstruct = getBuiltIn$1('Reflect', 'construct');
7959 var ObjectPrototype = Object.prototype;
7960 var push$1 = [].push; // `Reflect.construct` method
7961 // https://tc39.es/ecma262/#sec-reflect.construct
7962 // MS Edge supports only 2 arguments and argumentsList argument is optional
7963 // FF Nightly sets third argument as `new.target`, but does not create `this` from it
7964
7965 var NEW_TARGET_BUG = fails$5(function () {
7966 function F() {
7967 /* empty */
7968 }
7969
7970 return !(nativeConstruct(function () {
7971 /* empty */
7972 }, [], F) instanceof F);
7973 });
7974 var ARGS_BUG = !fails$5(function () {
7975 nativeConstruct(function () {
7976 /* empty */
7977 });
7978 });
7979 var FORCED$1 = NEW_TARGET_BUG || ARGS_BUG;
7980 $$5({
7981 target: 'Reflect',
7982 stat: true,
7983 forced: FORCED$1,
7984 sham: FORCED$1
7985 }, {
7986 construct: function construct(Target, args
7987 /* , newTarget */
7988 ) {
7989 aConstructor(Target);
7990 anObject$1(args);
7991 var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]);
7992 if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);
7993
7994 if (Target == newTarget) {
7995 // w/o altered newTarget, optimization for 0-4 arguments
7996 switch (args.length) {
7997 case 0:
7998 return new Target();
7999
8000 case 1:
8001 return new Target(args[0]);
8002
8003 case 2:
8004 return new Target(args[0], args[1]);
8005
8006 case 3:
8007 return new Target(args[0], args[1], args[2]);
8008
8009 case 4:
8010 return new Target(args[0], args[1], args[2], args[3]);
8011 } // w/o altered newTarget, lot of arguments case
8012
8013
8014 var $args = [null];
8015 apply(push$1, $args, args);
8016 return new (apply(bind$2, Target, $args))();
8017 } // with altered newTarget, not support built-in constructors
8018
8019
8020 var proto = newTarget.prototype;
8021 var instance = create$4(isObject$3(proto) ? proto : ObjectPrototype);
8022 var result = apply(Target, instance, args);
8023 return isObject$3(result) ? result : instance;
8024 }
8025 });
8026
8027 var path$3 = path$q;
8028 var construct$2 = path$3.Reflect.construct;
8029
8030 var parent$h = construct$2;
8031 var construct$1 = parent$h;
8032
8033 var construct = construct$1;
8034
8035 function _assertThisInitialized(self) {
8036 if (self === void 0) {
8037 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
8038 }
8039
8040 return self;
8041 }
8042
8043 var parent$g = create$6;
8044 var create$3 = parent$g;
8045
8046 var parent$f = create$3;
8047 var create$2 = parent$f;
8048
8049 var create$1 = create$2;
8050
8051 var $$4 = _export;
8052 var setPrototypeOf$5 = objectSetPrototypeOf; // `Object.setPrototypeOf` method
8053 // https://tc39.es/ecma262/#sec-object.setprototypeof
8054
8055 $$4({
8056 target: 'Object',
8057 stat: true
8058 }, {
8059 setPrototypeOf: setPrototypeOf$5
8060 });
8061
8062 var path$2 = path$q;
8063 var setPrototypeOf$4 = path$2.Object.setPrototypeOf;
8064
8065 var parent$e = setPrototypeOf$4;
8066 var setPrototypeOf$3 = parent$e;
8067
8068 var parent$d = setPrototypeOf$3;
8069 var setPrototypeOf$2 = parent$d;
8070
8071 var parent$c = setPrototypeOf$2;
8072 var setPrototypeOf$1 = parent$c;
8073
8074 var setPrototypeOf = setPrototypeOf$1;
8075
8076 function _setPrototypeOf(o, p) {
8077 _setPrototypeOf = setPrototypeOf || function _setPrototypeOf(o, p) {
8078 o.__proto__ = p;
8079 return o;
8080 };
8081
8082 return _setPrototypeOf(o, p);
8083 }
8084
8085 function _inherits(subClass, superClass) {
8086 if (typeof superClass !== "function" && superClass !== null) {
8087 throw new TypeError("Super expression must either be null or a function");
8088 }
8089
8090 subClass.prototype = create$1(superClass && superClass.prototype, {
8091 constructor: {
8092 value: subClass,
8093 writable: true,
8094 configurable: true
8095 }
8096 });
8097
8098 defineProperty$7(subClass, "prototype", {
8099 writable: false
8100 });
8101
8102 if (superClass) _setPrototypeOf(subClass, superClass);
8103 }
8104
8105 function _possibleConstructorReturn(self, call) {
8106 if (call && (_typeof(call) === "object" || typeof call === "function")) {
8107 return call;
8108 } else if (call !== void 0) {
8109 throw new TypeError("Derived constructors may only return object or undefined");
8110 }
8111
8112 return _assertThisInitialized(self);
8113 }
8114
8115 var parent$b = getPrototypeOf$3;
8116 var getPrototypeOf$2 = parent$b;
8117
8118 var parent$a = getPrototypeOf$2;
8119 var getPrototypeOf$1 = parent$a;
8120
8121 var getPrototypeOf = getPrototypeOf$1;
8122
8123 function _getPrototypeOf(o) {
8124 _getPrototypeOf = setPrototypeOf ? getPrototypeOf : function _getPrototypeOf(o) {
8125 return o.__proto__ || getPrototypeOf(o);
8126 };
8127 return _getPrototypeOf(o);
8128 }
8129
8130 var runtime = {exports: {}};
8131
8132 /**
8133 * Copyright (c) 2014-present, Facebook, Inc.
8134 *
8135 * This source code is licensed under the MIT license found in the
8136 * LICENSE file in the root directory of this source tree.
8137 */
8138
8139 (function (module) {
8140 var runtime = function (exports) {
8141
8142 var Op = Object.prototype;
8143 var hasOwn = Op.hasOwnProperty;
8144 var undefined$1; // More compressible than void 0.
8145
8146 var $Symbol = typeof Symbol === "function" ? Symbol : {};
8147 var iteratorSymbol = $Symbol.iterator || "@@iterator";
8148 var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
8149 var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
8150
8151 function define(obj, key, value) {
8152 Object.defineProperty(obj, key, {
8153 value: value,
8154 enumerable: true,
8155 configurable: true,
8156 writable: true
8157 });
8158 return obj[key];
8159 }
8160
8161 try {
8162 // IE 8 has a broken Object.defineProperty that only works on DOM objects.
8163 define({}, "");
8164 } catch (err) {
8165 define = function (obj, key, value) {
8166 return obj[key] = value;
8167 };
8168 }
8169
8170 function wrap(innerFn, outerFn, self, tryLocsList) {
8171 // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
8172 var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
8173 var generator = Object.create(protoGenerator.prototype);
8174 var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,
8175 // .throw, and .return methods.
8176
8177 generator._invoke = makeInvokeMethod(innerFn, self, context);
8178 return generator;
8179 }
8180
8181 exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion
8182 // record like context.tryEntries[i].completion. This interface could
8183 // have been (and was previously) designed to take a closure to be
8184 // invoked without arguments, but in all the cases we care about we
8185 // already have an existing method we want to call, so there's no need
8186 // to create a new function object. We can even get away with assuming
8187 // the method takes exactly one argument, since that happens to be true
8188 // in every case, so we don't have to touch the arguments object. The
8189 // only additional allocation required is the completion record, which
8190 // has a stable shape and so hopefully should be cheap to allocate.
8191
8192 function tryCatch(fn, obj, arg) {
8193 try {
8194 return {
8195 type: "normal",
8196 arg: fn.call(obj, arg)
8197 };
8198 } catch (err) {
8199 return {
8200 type: "throw",
8201 arg: err
8202 };
8203 }
8204 }
8205
8206 var GenStateSuspendedStart = "suspendedStart";
8207 var GenStateSuspendedYield = "suspendedYield";
8208 var GenStateExecuting = "executing";
8209 var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as
8210 // breaking out of the dispatch switch statement.
8211
8212 var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and
8213 // .constructor.prototype properties for functions that return Generator
8214 // objects. For full spec compliance, you may wish to configure your
8215 // minifier not to mangle the names of these two functions.
8216
8217 function Generator() {}
8218
8219 function GeneratorFunction() {}
8220
8221 function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that
8222 // don't natively support it.
8223
8224
8225 var IteratorPrototype = {};
8226 define(IteratorPrototype, iteratorSymbol, function () {
8227 return this;
8228 });
8229 var getProto = Object.getPrototypeOf;
8230 var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
8231
8232 if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
8233 // This environment has a native %IteratorPrototype%; use it instead
8234 // of the polyfill.
8235 IteratorPrototype = NativeIteratorPrototype;
8236 }
8237
8238 var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
8239 GeneratorFunction.prototype = GeneratorFunctionPrototype;
8240 define(Gp, "constructor", GeneratorFunctionPrototype);
8241 define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
8242 GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
8243 // Iterator interface in terms of a single ._invoke method.
8244
8245 function defineIteratorMethods(prototype) {
8246 ["next", "throw", "return"].forEach(function (method) {
8247 define(prototype, method, function (arg) {
8248 return this._invoke(method, arg);
8249 });
8250 });
8251 }
8252
8253 exports.isGeneratorFunction = function (genFun) {
8254 var ctor = typeof genFun === "function" && genFun.constructor;
8255 return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
8256 // do is to check its .name property.
8257 (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
8258 };
8259
8260 exports.mark = function (genFun) {
8261 if (Object.setPrototypeOf) {
8262 Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
8263 } else {
8264 genFun.__proto__ = GeneratorFunctionPrototype;
8265 define(genFun, toStringTagSymbol, "GeneratorFunction");
8266 }
8267
8268 genFun.prototype = Object.create(Gp);
8269 return genFun;
8270 }; // Within the body of any async function, `await x` is transformed to
8271 // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
8272 // `hasOwn.call(value, "__await")` to determine if the yielded value is
8273 // meant to be awaited.
8274
8275
8276 exports.awrap = function (arg) {
8277 return {
8278 __await: arg
8279 };
8280 };
8281
8282 function AsyncIterator(generator, PromiseImpl) {
8283 function invoke(method, arg, resolve, reject) {
8284 var record = tryCatch(generator[method], generator, arg);
8285
8286 if (record.type === "throw") {
8287 reject(record.arg);
8288 } else {
8289 var result = record.arg;
8290 var value = result.value;
8291
8292 if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
8293 return PromiseImpl.resolve(value.__await).then(function (value) {
8294 invoke("next", value, resolve, reject);
8295 }, function (err) {
8296 invoke("throw", err, resolve, reject);
8297 });
8298 }
8299
8300 return PromiseImpl.resolve(value).then(function (unwrapped) {
8301 // When a yielded Promise is resolved, its final value becomes
8302 // the .value of the Promise<{value,done}> result for the
8303 // current iteration.
8304 result.value = unwrapped;
8305 resolve(result);
8306 }, function (error) {
8307 // If a rejected Promise was yielded, throw the rejection back
8308 // into the async generator function so it can be handled there.
8309 return invoke("throw", error, resolve, reject);
8310 });
8311 }
8312 }
8313
8314 var previousPromise;
8315
8316 function enqueue(method, arg) {
8317 function callInvokeWithMethodAndArg() {
8318 return new PromiseImpl(function (resolve, reject) {
8319 invoke(method, arg, resolve, reject);
8320 });
8321 }
8322
8323 return previousPromise = // If enqueue has been called before, then we want to wait until
8324 // all previous Promises have been resolved before calling invoke,
8325 // so that results are always delivered in the correct order. If
8326 // enqueue has not been called before, then it is important to
8327 // call invoke immediately, without waiting on a callback to fire,
8328 // so that the async generator function has the opportunity to do
8329 // any necessary setup in a predictable way. This predictability
8330 // is why the Promise constructor synchronously invokes its
8331 // executor callback, and why async functions synchronously
8332 // execute code before the first await. Since we implement simple
8333 // async functions in terms of async generators, it is especially
8334 // important to get this right, even though it requires care.
8335 previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later
8336 // invocations of the iterator.
8337 callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
8338 } // Define the unified helper method that is used to implement .next,
8339 // .throw, and .return (see defineIteratorMethods).
8340
8341
8342 this._invoke = enqueue;
8343 }
8344
8345 defineIteratorMethods(AsyncIterator.prototype);
8346 define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
8347 return this;
8348 });
8349 exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
8350 // AsyncIterator objects; they just return a Promise for the value of
8351 // the final result produced by the iterator.
8352
8353 exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
8354 if (PromiseImpl === void 0) PromiseImpl = Promise;
8355 var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
8356 return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
8357 : iter.next().then(function (result) {
8358 return result.done ? result.value : iter.next();
8359 });
8360 };
8361
8362 function makeInvokeMethod(innerFn, self, context) {
8363 var state = GenStateSuspendedStart;
8364 return function invoke(method, arg) {
8365 if (state === GenStateExecuting) {
8366 throw new Error("Generator is already running");
8367 }
8368
8369 if (state === GenStateCompleted) {
8370 if (method === "throw") {
8371 throw arg;
8372 } // Be forgiving, per 25.3.3.3.3 of the spec:
8373 // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
8374
8375
8376 return doneResult();
8377 }
8378
8379 context.method = method;
8380 context.arg = arg;
8381
8382 while (true) {
8383 var delegate = context.delegate;
8384
8385 if (delegate) {
8386 var delegateResult = maybeInvokeDelegate(delegate, context);
8387
8388 if (delegateResult) {
8389 if (delegateResult === ContinueSentinel) continue;
8390 return delegateResult;
8391 }
8392 }
8393
8394 if (context.method === "next") {
8395 // Setting context._sent for legacy support of Babel's
8396 // function.sent implementation.
8397 context.sent = context._sent = context.arg;
8398 } else if (context.method === "throw") {
8399 if (state === GenStateSuspendedStart) {
8400 state = GenStateCompleted;
8401 throw context.arg;
8402 }
8403
8404 context.dispatchException(context.arg);
8405 } else if (context.method === "return") {
8406 context.abrupt("return", context.arg);
8407 }
8408
8409 state = GenStateExecuting;
8410 var record = tryCatch(innerFn, self, context);
8411
8412 if (record.type === "normal") {
8413 // If an exception is thrown from innerFn, we leave state ===
8414 // GenStateExecuting and loop back for another invocation.
8415 state = context.done ? GenStateCompleted : GenStateSuspendedYield;
8416
8417 if (record.arg === ContinueSentinel) {
8418 continue;
8419 }
8420
8421 return {
8422 value: record.arg,
8423 done: context.done
8424 };
8425 } else if (record.type === "throw") {
8426 state = GenStateCompleted; // Dispatch the exception by looping back around to the
8427 // context.dispatchException(context.arg) call above.
8428
8429 context.method = "throw";
8430 context.arg = record.arg;
8431 }
8432 }
8433 };
8434 } // Call delegate.iterator[context.method](context.arg) and handle the
8435 // result, either by returning a { value, done } result from the
8436 // delegate iterator, or by modifying context.method and context.arg,
8437 // setting context.delegate to null, and returning the ContinueSentinel.
8438
8439
8440 function maybeInvokeDelegate(delegate, context) {
8441 var method = delegate.iterator[context.method];
8442
8443 if (method === undefined$1) {
8444 // A .throw or .return when the delegate iterator has no .throw
8445 // method always terminates the yield* loop.
8446 context.delegate = null;
8447
8448 if (context.method === "throw") {
8449 // Note: ["return"] must be used for ES3 parsing compatibility.
8450 if (delegate.iterator["return"]) {
8451 // If the delegate iterator has a return method, give it a
8452 // chance to clean up.
8453 context.method = "return";
8454 context.arg = undefined$1;
8455 maybeInvokeDelegate(delegate, context);
8456
8457 if (context.method === "throw") {
8458 // If maybeInvokeDelegate(context) changed context.method from
8459 // "return" to "throw", let that override the TypeError below.
8460 return ContinueSentinel;
8461 }
8462 }
8463
8464 context.method = "throw";
8465 context.arg = new TypeError("The iterator does not provide a 'throw' method");
8466 }
8467
8468 return ContinueSentinel;
8469 }
8470
8471 var record = tryCatch(method, delegate.iterator, context.arg);
8472
8473 if (record.type === "throw") {
8474 context.method = "throw";
8475 context.arg = record.arg;
8476 context.delegate = null;
8477 return ContinueSentinel;
8478 }
8479
8480 var info = record.arg;
8481
8482 if (!info) {
8483 context.method = "throw";
8484 context.arg = new TypeError("iterator result is not an object");
8485 context.delegate = null;
8486 return ContinueSentinel;
8487 }
8488
8489 if (info.done) {
8490 // Assign the result of the finished delegate to the temporary
8491 // variable specified by delegate.resultName (see delegateYield).
8492 context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).
8493
8494 context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the
8495 // exception, let the outer generator proceed normally. If
8496 // context.method was "next", forget context.arg since it has been
8497 // "consumed" by the delegate iterator. If context.method was
8498 // "return", allow the original .return call to continue in the
8499 // outer generator.
8500
8501 if (context.method !== "return") {
8502 context.method = "next";
8503 context.arg = undefined$1;
8504 }
8505 } else {
8506 // Re-yield the result returned by the delegate method.
8507 return info;
8508 } // The delegate iterator is finished, so forget it and continue with
8509 // the outer generator.
8510
8511
8512 context.delegate = null;
8513 return ContinueSentinel;
8514 } // Define Generator.prototype.{next,throw,return} in terms of the
8515 // unified ._invoke helper method.
8516
8517
8518 defineIteratorMethods(Gp);
8519 define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the
8520 // @@iterator function is called on it. Some browsers' implementations of the
8521 // iterator prototype chain incorrectly implement this, causing the Generator
8522 // object to not be returned from this call. This ensures that doesn't happen.
8523 // See https://github.com/facebook/regenerator/issues/274 for more details.
8524
8525 define(Gp, iteratorSymbol, function () {
8526 return this;
8527 });
8528 define(Gp, "toString", function () {
8529 return "[object Generator]";
8530 });
8531
8532 function pushTryEntry(locs) {
8533 var entry = {
8534 tryLoc: locs[0]
8535 };
8536
8537 if (1 in locs) {
8538 entry.catchLoc = locs[1];
8539 }
8540
8541 if (2 in locs) {
8542 entry.finallyLoc = locs[2];
8543 entry.afterLoc = locs[3];
8544 }
8545
8546 this.tryEntries.push(entry);
8547 }
8548
8549 function resetTryEntry(entry) {
8550 var record = entry.completion || {};
8551 record.type = "normal";
8552 delete record.arg;
8553 entry.completion = record;
8554 }
8555
8556 function Context(tryLocsList) {
8557 // The root entry object (effectively a try statement without a catch
8558 // or a finally block) gives us a place to store values thrown from
8559 // locations where there is no enclosing try statement.
8560 this.tryEntries = [{
8561 tryLoc: "root"
8562 }];
8563 tryLocsList.forEach(pushTryEntry, this);
8564 this.reset(true);
8565 }
8566
8567 exports.keys = function (object) {
8568 var keys = [];
8569
8570 for (var key in object) {
8571 keys.push(key);
8572 }
8573
8574 keys.reverse(); // Rather than returning an object with a next method, we keep
8575 // things simple and return the next function itself.
8576
8577 return function next() {
8578 while (keys.length) {
8579 var key = keys.pop();
8580
8581 if (key in object) {
8582 next.value = key;
8583 next.done = false;
8584 return next;
8585 }
8586 } // To avoid creating an additional object, we just hang the .value
8587 // and .done properties off the next function object itself. This
8588 // also ensures that the minifier will not anonymize the function.
8589
8590
8591 next.done = true;
8592 return next;
8593 };
8594 };
8595
8596 function values(iterable) {
8597 if (iterable) {
8598 var iteratorMethod = iterable[iteratorSymbol];
8599
8600 if (iteratorMethod) {
8601 return iteratorMethod.call(iterable);
8602 }
8603
8604 if (typeof iterable.next === "function") {
8605 return iterable;
8606 }
8607
8608 if (!isNaN(iterable.length)) {
8609 var i = -1,
8610 next = function next() {
8611 while (++i < iterable.length) {
8612 if (hasOwn.call(iterable, i)) {
8613 next.value = iterable[i];
8614 next.done = false;
8615 return next;
8616 }
8617 }
8618
8619 next.value = undefined$1;
8620 next.done = true;
8621 return next;
8622 };
8623
8624 return next.next = next;
8625 }
8626 } // Return an iterator with no values.
8627
8628
8629 return {
8630 next: doneResult
8631 };
8632 }
8633
8634 exports.values = values;
8635
8636 function doneResult() {
8637 return {
8638 value: undefined$1,
8639 done: true
8640 };
8641 }
8642
8643 Context.prototype = {
8644 constructor: Context,
8645 reset: function (skipTempReset) {
8646 this.prev = 0;
8647 this.next = 0; // Resetting context._sent for legacy support of Babel's
8648 // function.sent implementation.
8649
8650 this.sent = this._sent = undefined$1;
8651 this.done = false;
8652 this.delegate = null;
8653 this.method = "next";
8654 this.arg = undefined$1;
8655 this.tryEntries.forEach(resetTryEntry);
8656
8657 if (!skipTempReset) {
8658 for (var name in this) {
8659 // Not sure about the optimal order of these conditions:
8660 if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
8661 this[name] = undefined$1;
8662 }
8663 }
8664 }
8665 },
8666 stop: function () {
8667 this.done = true;
8668 var rootEntry = this.tryEntries[0];
8669 var rootRecord = rootEntry.completion;
8670
8671 if (rootRecord.type === "throw") {
8672 throw rootRecord.arg;
8673 }
8674
8675 return this.rval;
8676 },
8677 dispatchException: function (exception) {
8678 if (this.done) {
8679 throw exception;
8680 }
8681
8682 var context = this;
8683
8684 function handle(loc, caught) {
8685 record.type = "throw";
8686 record.arg = exception;
8687 context.next = loc;
8688
8689 if (caught) {
8690 // If the dispatched exception was caught by a catch block,
8691 // then let that catch block handle the exception normally.
8692 context.method = "next";
8693 context.arg = undefined$1;
8694 }
8695
8696 return !!caught;
8697 }
8698
8699 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
8700 var entry = this.tryEntries[i];
8701 var record = entry.completion;
8702
8703 if (entry.tryLoc === "root") {
8704 // Exception thrown outside of any try block that could handle
8705 // it, so set the completion value of the entire function to
8706 // throw the exception.
8707 return handle("end");
8708 }
8709
8710 if (entry.tryLoc <= this.prev) {
8711 var hasCatch = hasOwn.call(entry, "catchLoc");
8712 var hasFinally = hasOwn.call(entry, "finallyLoc");
8713
8714 if (hasCatch && hasFinally) {
8715 if (this.prev < entry.catchLoc) {
8716 return handle(entry.catchLoc, true);
8717 } else if (this.prev < entry.finallyLoc) {
8718 return handle(entry.finallyLoc);
8719 }
8720 } else if (hasCatch) {
8721 if (this.prev < entry.catchLoc) {
8722 return handle(entry.catchLoc, true);
8723 }
8724 } else if (hasFinally) {
8725 if (this.prev < entry.finallyLoc) {
8726 return handle(entry.finallyLoc);
8727 }
8728 } else {
8729 throw new Error("try statement without catch or finally");
8730 }
8731 }
8732 }
8733 },
8734 abrupt: function (type, arg) {
8735 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
8736 var entry = this.tryEntries[i];
8737
8738 if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
8739 var finallyEntry = entry;
8740 break;
8741 }
8742 }
8743
8744 if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
8745 // Ignore the finally entry if control is not jumping to a
8746 // location outside the try/catch block.
8747 finallyEntry = null;
8748 }
8749
8750 var record = finallyEntry ? finallyEntry.completion : {};
8751 record.type = type;
8752 record.arg = arg;
8753
8754 if (finallyEntry) {
8755 this.method = "next";
8756 this.next = finallyEntry.finallyLoc;
8757 return ContinueSentinel;
8758 }
8759
8760 return this.complete(record);
8761 },
8762 complete: function (record, afterLoc) {
8763 if (record.type === "throw") {
8764 throw record.arg;
8765 }
8766
8767 if (record.type === "break" || record.type === "continue") {
8768 this.next = record.arg;
8769 } else if (record.type === "return") {
8770 this.rval = this.arg = record.arg;
8771 this.method = "return";
8772 this.next = "end";
8773 } else if (record.type === "normal" && afterLoc) {
8774 this.next = afterLoc;
8775 }
8776
8777 return ContinueSentinel;
8778 },
8779 finish: function (finallyLoc) {
8780 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
8781 var entry = this.tryEntries[i];
8782
8783 if (entry.finallyLoc === finallyLoc) {
8784 this.complete(entry.completion, entry.afterLoc);
8785 resetTryEntry(entry);
8786 return ContinueSentinel;
8787 }
8788 }
8789 },
8790 "catch": function (tryLoc) {
8791 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
8792 var entry = this.tryEntries[i];
8793
8794 if (entry.tryLoc === tryLoc) {
8795 var record = entry.completion;
8796
8797 if (record.type === "throw") {
8798 var thrown = record.arg;
8799 resetTryEntry(entry);
8800 }
8801
8802 return thrown;
8803 }
8804 } // The context.catch method must only be called with a location
8805 // argument that corresponds to a known catch block.
8806
8807
8808 throw new Error("illegal catch attempt");
8809 },
8810 delegateYield: function (iterable, resultName, nextLoc) {
8811 this.delegate = {
8812 iterator: values(iterable),
8813 resultName: resultName,
8814 nextLoc: nextLoc
8815 };
8816
8817 if (this.method === "next") {
8818 // Deliberately forget the last sent value so that we don't
8819 // accidentally pass it on to the delegate.
8820 this.arg = undefined$1;
8821 }
8822
8823 return ContinueSentinel;
8824 }
8825 }; // Regardless of whether this script is executing as a CommonJS module
8826 // or not, return the runtime object so that we can declare the variable
8827 // regeneratorRuntime in the outer scope, which allows this module to be
8828 // injected easily by `bin/regenerator --include-runtime script.js`.
8829
8830 return exports;
8831 }( // If this script is executing as a CommonJS module, use module.exports
8832 // as the regeneratorRuntime namespace. Otherwise create a new empty
8833 // object. Either way, the resulting object will be used to initialize
8834 // the regeneratorRuntime variable at the top of this file.
8835 module.exports );
8836
8837 try {
8838 regeneratorRuntime = runtime;
8839 } catch (accidentalStrictMode) {
8840 // This module should not be running in strict mode, so the above
8841 // assignment should always work unless something is misconfigured. Just
8842 // in case runtime.js accidentally runs in strict mode, in modern engines
8843 // we can explicitly access globalThis. In older engines we can escape
8844 // strict mode using a global Function call. This could conceivably fail
8845 // if a Content Security Policy forbids using Function, but in that case
8846 // the proper solution is to fix the accidental strict mode problem. If
8847 // you've misconfigured your bundler to force strict mode and applied a
8848 // CSP to forbid Function, and you're not willing to fix either of those
8849 // problems, please detail your unique predicament in a GitHub issue.
8850 if (typeof globalThis === "object") {
8851 globalThis.regeneratorRuntime = runtime;
8852 } else {
8853 Function("r", "regeneratorRuntime = r")(runtime);
8854 }
8855 }
8856 })(runtime);
8857
8858 var regenerator = runtime.exports;
8859
8860 var internalMetadata = {exports: {}};
8861
8862 var fails$4 = fails$r;
8863 var arrayBufferNonExtensible = fails$4(function () {
8864 if (typeof ArrayBuffer == 'function') {
8865 var buffer = new ArrayBuffer(8); // eslint-disable-next-line es/no-object-isextensible, es/no-object-defineproperty -- safe
8866
8867 if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', {
8868 value: 8
8869 });
8870 }
8871 });
8872
8873 var fails$3 = fails$r;
8874 var isObject$2 = isObject$f;
8875 var classof$3 = classofRaw$1;
8876 var ARRAY_BUFFER_NON_EXTENSIBLE = arrayBufferNonExtensible; // eslint-disable-next-line es/no-object-isextensible -- safe
8877
8878 var $isExtensible = Object.isExtensible;
8879 var FAILS_ON_PRIMITIVES = fails$3(function () {
8880 $isExtensible(1);
8881 }); // `Object.isExtensible` method
8882 // https://tc39.es/ecma262/#sec-object.isextensible
8883
8884 var objectIsExtensible = FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE ? function isExtensible(it) {
8885 if (!isObject$2(it)) return false;
8886 if (ARRAY_BUFFER_NON_EXTENSIBLE && classof$3(it) == 'ArrayBuffer') return false;
8887 return $isExtensible ? $isExtensible(it) : true;
8888 } : $isExtensible;
8889
8890 var fails$2 = fails$r;
8891 var freezing = !fails$2(function () {
8892 // eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing
8893 return Object.isExtensible(Object.preventExtensions({}));
8894 });
8895
8896 var $$3 = _export;
8897 var uncurryThis$1 = functionUncurryThis;
8898 var hiddenKeys = hiddenKeys$6;
8899 var isObject$1 = isObject$f;
8900 var hasOwn$3 = hasOwnProperty_1;
8901 var defineProperty$2 = objectDefineProperty.f;
8902 var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
8903 var getOwnPropertyNamesExternalModule = objectGetOwnPropertyNamesExternal;
8904 var isExtensible = objectIsExtensible;
8905 var uid = uid$4;
8906 var FREEZING = freezing;
8907 var REQUIRED = false;
8908 var METADATA = uid('meta');
8909 var id = 0;
8910
8911 var setMetadata = function (it) {
8912 defineProperty$2(it, METADATA, {
8913 value: {
8914 objectID: 'O' + id++,
8915 // object ID
8916 weakData: {} // weak collections IDs
8917
8918 }
8919 });
8920 };
8921
8922 var fastKey$1 = function (it, create) {
8923 // return a primitive with prefix
8924 if (!isObject$1(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
8925
8926 if (!hasOwn$3(it, METADATA)) {
8927 // can't set metadata to uncaught frozen object
8928 if (!isExtensible(it)) return 'F'; // not necessary to add metadata
8929
8930 if (!create) return 'E'; // add missing metadata
8931
8932 setMetadata(it); // return object ID
8933 }
8934
8935 return it[METADATA].objectID;
8936 };
8937
8938 var getWeakData = function (it, create) {
8939 if (!hasOwn$3(it, METADATA)) {
8940 // can't set metadata to uncaught frozen object
8941 if (!isExtensible(it)) return true; // not necessary to add metadata
8942
8943 if (!create) return false; // add missing metadata
8944
8945 setMetadata(it); // return the store of weak collections IDs
8946 }
8947
8948 return it[METADATA].weakData;
8949 }; // add metadata on freeze-family methods calling
8950
8951
8952 var onFreeze = function (it) {
8953 if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn$3(it, METADATA)) setMetadata(it);
8954 return it;
8955 };
8956
8957 var enable = function () {
8958 meta.enable = function () {
8959 /* empty */
8960 };
8961
8962 REQUIRED = true;
8963 var getOwnPropertyNames = getOwnPropertyNamesModule.f;
8964 var splice = uncurryThis$1([].splice);
8965 var test = {};
8966 test[METADATA] = 1; // prevent exposing of metadata key
8967
8968 if (getOwnPropertyNames(test).length) {
8969 getOwnPropertyNamesModule.f = function (it) {
8970 var result = getOwnPropertyNames(it);
8971
8972 for (var i = 0, length = result.length; i < length; i++) {
8973 if (result[i] === METADATA) {
8974 splice(result, i, 1);
8975 break;
8976 }
8977 }
8978
8979 return result;
8980 };
8981
8982 $$3({
8983 target: 'Object',
8984 stat: true,
8985 forced: true
8986 }, {
8987 getOwnPropertyNames: getOwnPropertyNamesExternalModule.f
8988 });
8989 }
8990 };
8991
8992 var meta = internalMetadata.exports = {
8993 enable: enable,
8994 fastKey: fastKey$1,
8995 getWeakData: getWeakData,
8996 onFreeze: onFreeze
8997 };
8998 hiddenKeys[METADATA] = true;
8999
9000 var global$3 = global$M;
9001 var bind$1 = functionBindContext;
9002 var call = functionCall;
9003 var anObject = anObject$b;
9004 var tryToString = tryToString$4;
9005 var isArrayIteratorMethod = isArrayIteratorMethod$2;
9006 var lengthOfArrayLike$1 = lengthOfArrayLike$d;
9007 var isPrototypeOf$6 = objectIsPrototypeOf;
9008 var getIterator$5 = getIterator$7;
9009 var getIteratorMethod = getIteratorMethod$8;
9010 var iteratorClose = iteratorClose$2;
9011 var TypeError$2 = global$3.TypeError;
9012
9013 var Result = function (stopped, result) {
9014 this.stopped = stopped;
9015 this.result = result;
9016 };
9017
9018 var ResultPrototype = Result.prototype;
9019
9020 var iterate$2 = function (iterable, unboundFunction, options) {
9021 var that = options && options.that;
9022 var AS_ENTRIES = !!(options && options.AS_ENTRIES);
9023 var IS_ITERATOR = !!(options && options.IS_ITERATOR);
9024 var INTERRUPTED = !!(options && options.INTERRUPTED);
9025 var fn = bind$1(unboundFunction, that);
9026 var iterator, iterFn, index, length, result, next, step;
9027
9028 var stop = function (condition) {
9029 if (iterator) iteratorClose(iterator, 'normal', condition);
9030 return new Result(true, condition);
9031 };
9032
9033 var callFn = function (value) {
9034 if (AS_ENTRIES) {
9035 anObject(value);
9036 return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
9037 }
9038
9039 return INTERRUPTED ? fn(value, stop) : fn(value);
9040 };
9041
9042 if (IS_ITERATOR) {
9043 iterator = iterable;
9044 } else {
9045 iterFn = getIteratorMethod(iterable);
9046 if (!iterFn) throw TypeError$2(tryToString(iterable) + ' is not iterable'); // optimisation for array iterators
9047
9048 if (isArrayIteratorMethod(iterFn)) {
9049 for (index = 0, length = lengthOfArrayLike$1(iterable); length > index; index++) {
9050 result = callFn(iterable[index]);
9051 if (result && isPrototypeOf$6(ResultPrototype, result)) return result;
9052 }
9053
9054 return new Result(false);
9055 }
9056
9057 iterator = getIterator$5(iterable, iterFn);
9058 }
9059
9060 next = iterator.next;
9061
9062 while (!(step = call(next, iterator)).done) {
9063 try {
9064 result = callFn(step.value);
9065 } catch (error) {
9066 iteratorClose(iterator, 'throw', error);
9067 }
9068
9069 if (typeof result == 'object' && result && isPrototypeOf$6(ResultPrototype, result)) return result;
9070 }
9071
9072 return new Result(false);
9073 };
9074
9075 var global$2 = global$M;
9076 var isPrototypeOf$5 = objectIsPrototypeOf;
9077 var TypeError$1 = global$2.TypeError;
9078
9079 var anInstance$2 = function (it, Prototype) {
9080 if (isPrototypeOf$5(Prototype, it)) return it;
9081 throw TypeError$1('Incorrect invocation');
9082 };
9083
9084 var $$2 = _export;
9085 var global$1 = global$M;
9086 var InternalMetadataModule = internalMetadata.exports;
9087 var fails$1 = fails$r;
9088 var createNonEnumerableProperty = createNonEnumerableProperty$6;
9089 var iterate$1 = iterate$2;
9090 var anInstance$1 = anInstance$2;
9091 var isCallable = isCallable$h;
9092 var isObject = isObject$f;
9093 var setToStringTag = setToStringTag$5;
9094 var defineProperty$1 = objectDefineProperty.f;
9095 var forEach = arrayIteration.forEach;
9096 var DESCRIPTORS$2 = descriptors;
9097 var InternalStateModule$1 = internalState;
9098 var setInternalState$1 = InternalStateModule$1.set;
9099 var internalStateGetterFor$1 = InternalStateModule$1.getterFor;
9100
9101 var collection$2 = function (CONSTRUCTOR_NAME, wrapper, common) {
9102 var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
9103 var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
9104 var ADDER = IS_MAP ? 'set' : 'add';
9105 var NativeConstructor = global$1[CONSTRUCTOR_NAME];
9106 var NativePrototype = NativeConstructor && NativeConstructor.prototype;
9107 var exported = {};
9108 var Constructor;
9109
9110 if (!DESCRIPTORS$2 || !isCallable(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails$1(function () {
9111 new NativeConstructor().entries().next();
9112 }))) {
9113 // create collection constructor
9114 Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
9115 InternalMetadataModule.enable();
9116 } else {
9117 Constructor = wrapper(function (target, iterable) {
9118 setInternalState$1(anInstance$1(target, Prototype), {
9119 type: CONSTRUCTOR_NAME,
9120 collection: new NativeConstructor()
9121 });
9122 if (iterable != undefined) iterate$1(iterable, target[ADDER], {
9123 that: target,
9124 AS_ENTRIES: IS_MAP
9125 });
9126 });
9127 var Prototype = Constructor.prototype;
9128 var getInternalState = internalStateGetterFor$1(CONSTRUCTOR_NAME);
9129 forEach(['add', 'clear', 'delete', 'forEach', 'get', 'has', 'set', 'keys', 'values', 'entries'], function (KEY) {
9130 var IS_ADDER = KEY == 'add' || KEY == 'set';
9131
9132 if (KEY in NativePrototype && !(IS_WEAK && KEY == 'clear')) {
9133 createNonEnumerableProperty(Prototype, KEY, function (a, b) {
9134 var collection = getInternalState(this).collection;
9135 if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;
9136 var result = collection[KEY](a === 0 ? 0 : a, b);
9137 return IS_ADDER ? this : result;
9138 });
9139 }
9140 });
9141 IS_WEAK || defineProperty$1(Prototype, 'size', {
9142 configurable: true,
9143 get: function () {
9144 return getInternalState(this).collection.size;
9145 }
9146 });
9147 }
9148
9149 setToStringTag(Constructor, CONSTRUCTOR_NAME, false, true);
9150 exported[CONSTRUCTOR_NAME] = Constructor;
9151 $$2({
9152 global: true,
9153 forced: true
9154 }, exported);
9155 if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
9156 return Constructor;
9157 };
9158
9159 var redefine = redefine$4;
9160
9161 var redefineAll$1 = function (target, src, options) {
9162 for (var key in src) {
9163 if (options && options.unsafe && target[key]) target[key] = src[key];else redefine(target, key, src[key], options);
9164 }
9165
9166 return target;
9167 };
9168
9169 var getBuiltIn = getBuiltIn$9;
9170 var definePropertyModule = objectDefineProperty;
9171 var wellKnownSymbol = wellKnownSymbol$j;
9172 var DESCRIPTORS$1 = descriptors;
9173 var SPECIES = wellKnownSymbol('species');
9174
9175 var setSpecies$1 = function (CONSTRUCTOR_NAME) {
9176 var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
9177 var defineProperty = definePropertyModule.f;
9178
9179 if (DESCRIPTORS$1 && Constructor && !Constructor[SPECIES]) {
9180 defineProperty(Constructor, SPECIES, {
9181 configurable: true,
9182 get: function () {
9183 return this;
9184 }
9185 });
9186 }
9187 };
9188
9189 var defineProperty = objectDefineProperty.f;
9190 var create = objectCreate;
9191 var redefineAll = redefineAll$1;
9192 var bind = functionBindContext;
9193 var anInstance = anInstance$2;
9194 var iterate = iterate$2;
9195 var defineIterator = defineIterator$3;
9196 var setSpecies = setSpecies$1;
9197 var DESCRIPTORS = descriptors;
9198 var fastKey = internalMetadata.exports.fastKey;
9199 var InternalStateModule = internalState;
9200 var setInternalState = InternalStateModule.set;
9201 var internalStateGetterFor = InternalStateModule.getterFor;
9202 var collectionStrong$2 = {
9203 getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
9204 var Constructor = wrapper(function (that, iterable) {
9205 anInstance(that, Prototype);
9206 setInternalState(that, {
9207 type: CONSTRUCTOR_NAME,
9208 index: create(null),
9209 first: undefined,
9210 last: undefined,
9211 size: 0
9212 });
9213 if (!DESCRIPTORS) that.size = 0;
9214 if (iterable != undefined) iterate(iterable, that[ADDER], {
9215 that: that,
9216 AS_ENTRIES: IS_MAP
9217 });
9218 });
9219 var Prototype = Constructor.prototype;
9220 var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
9221
9222 var define = function (that, key, value) {
9223 var state = getInternalState(that);
9224 var entry = getEntry(that, key);
9225 var previous, index; // change existing entry
9226
9227 if (entry) {
9228 entry.value = value; // create new entry
9229 } else {
9230 state.last = entry = {
9231 index: index = fastKey(key, true),
9232 key: key,
9233 value: value,
9234 previous: previous = state.last,
9235 next: undefined,
9236 removed: false
9237 };
9238 if (!state.first) state.first = entry;
9239 if (previous) previous.next = entry;
9240 if (DESCRIPTORS) state.size++;else that.size++; // add to index
9241
9242 if (index !== 'F') state.index[index] = entry;
9243 }
9244
9245 return that;
9246 };
9247
9248 var getEntry = function (that, key) {
9249 var state = getInternalState(that); // fast case
9250
9251 var index = fastKey(key);
9252 var entry;
9253 if (index !== 'F') return state.index[index]; // frozen object case
9254
9255 for (entry = state.first; entry; entry = entry.next) {
9256 if (entry.key == key) return entry;
9257 }
9258 };
9259
9260 redefineAll(Prototype, {
9261 // `{ Map, Set }.prototype.clear()` methods
9262 // https://tc39.es/ecma262/#sec-map.prototype.clear
9263 // https://tc39.es/ecma262/#sec-set.prototype.clear
9264 clear: function clear() {
9265 var that = this;
9266 var state = getInternalState(that);
9267 var data = state.index;
9268 var entry = state.first;
9269
9270 while (entry) {
9271 entry.removed = true;
9272 if (entry.previous) entry.previous = entry.previous.next = undefined;
9273 delete data[entry.index];
9274 entry = entry.next;
9275 }
9276
9277 state.first = state.last = undefined;
9278 if (DESCRIPTORS) state.size = 0;else that.size = 0;
9279 },
9280 // `{ Map, Set }.prototype.delete(key)` methods
9281 // https://tc39.es/ecma262/#sec-map.prototype.delete
9282 // https://tc39.es/ecma262/#sec-set.prototype.delete
9283 'delete': function (key) {
9284 var that = this;
9285 var state = getInternalState(that);
9286 var entry = getEntry(that, key);
9287
9288 if (entry) {
9289 var next = entry.next;
9290 var prev = entry.previous;
9291 delete state.index[entry.index];
9292 entry.removed = true;
9293 if (prev) prev.next = next;
9294 if (next) next.previous = prev;
9295 if (state.first == entry) state.first = next;
9296 if (state.last == entry) state.last = prev;
9297 if (DESCRIPTORS) state.size--;else that.size--;
9298 }
9299
9300 return !!entry;
9301 },
9302 // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods
9303 // https://tc39.es/ecma262/#sec-map.prototype.foreach
9304 // https://tc39.es/ecma262/#sec-set.prototype.foreach
9305 forEach: function forEach(callbackfn
9306 /* , that = undefined */
9307 ) {
9308 var state = getInternalState(this);
9309 var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);
9310 var entry;
9311
9312 while (entry = entry ? entry.next : state.first) {
9313 boundFunction(entry.value, entry.key, this); // revert to the last existing entry
9314
9315 while (entry && entry.removed) entry = entry.previous;
9316 }
9317 },
9318 // `{ Map, Set}.prototype.has(key)` methods
9319 // https://tc39.es/ecma262/#sec-map.prototype.has
9320 // https://tc39.es/ecma262/#sec-set.prototype.has
9321 has: function has(key) {
9322 return !!getEntry(this, key);
9323 }
9324 });
9325 redefineAll(Prototype, IS_MAP ? {
9326 // `Map.prototype.get(key)` method
9327 // https://tc39.es/ecma262/#sec-map.prototype.get
9328 get: function get(key) {
9329 var entry = getEntry(this, key);
9330 return entry && entry.value;
9331 },
9332 // `Map.prototype.set(key, value)` method
9333 // https://tc39.es/ecma262/#sec-map.prototype.set
9334 set: function set(key, value) {
9335 return define(this, key === 0 ? 0 : key, value);
9336 }
9337 } : {
9338 // `Set.prototype.add(value)` method
9339 // https://tc39.es/ecma262/#sec-set.prototype.add
9340 add: function add(value) {
9341 return define(this, value = value === 0 ? 0 : value, value);
9342 }
9343 });
9344 if (DESCRIPTORS) defineProperty(Prototype, 'size', {
9345 get: function () {
9346 return getInternalState(this).size;
9347 }
9348 });
9349 return Constructor;
9350 },
9351 setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {
9352 var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
9353 var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
9354 var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME); // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods
9355 // https://tc39.es/ecma262/#sec-map.prototype.entries
9356 // https://tc39.es/ecma262/#sec-map.prototype.keys
9357 // https://tc39.es/ecma262/#sec-map.prototype.values
9358 // https://tc39.es/ecma262/#sec-map.prototype-@@iterator
9359 // https://tc39.es/ecma262/#sec-set.prototype.entries
9360 // https://tc39.es/ecma262/#sec-set.prototype.keys
9361 // https://tc39.es/ecma262/#sec-set.prototype.values
9362 // https://tc39.es/ecma262/#sec-set.prototype-@@iterator
9363
9364 defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {
9365 setInternalState(this, {
9366 type: ITERATOR_NAME,
9367 target: iterated,
9368 state: getInternalCollectionState(iterated),
9369 kind: kind,
9370 last: undefined
9371 });
9372 }, function () {
9373 var state = getInternalIteratorState(this);
9374 var kind = state.kind;
9375 var entry = state.last; // revert to the last existing entry
9376
9377 while (entry && entry.removed) entry = entry.previous; // get next entry
9378
9379
9380 if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
9381 // or finish the iteration
9382 state.target = undefined;
9383 return {
9384 value: undefined,
9385 done: true
9386 };
9387 } // return step by kind
9388
9389
9390 if (kind == 'keys') return {
9391 value: entry.key,
9392 done: false
9393 };
9394 if (kind == 'values') return {
9395 value: entry.value,
9396 done: false
9397 };
9398 return {
9399 value: [entry.key, entry.value],
9400 done: false
9401 };
9402 }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); // `{ Map, Set }.prototype[@@species]` accessors
9403 // https://tc39.es/ecma262/#sec-get-map-@@species
9404 // https://tc39.es/ecma262/#sec-get-set-@@species
9405
9406 setSpecies(CONSTRUCTOR_NAME);
9407 }
9408 };
9409
9410 var collection$1 = collection$2;
9411 var collectionStrong$1 = collectionStrong$2; // `Map` constructor
9412 // https://tc39.es/ecma262/#sec-map-objects
9413
9414 collection$1('Map', function (init) {
9415 return function Map() {
9416 return init(this, arguments.length ? arguments[0] : undefined);
9417 };
9418 }, collectionStrong$1);
9419
9420 var path$1 = path$q;
9421 var map$2 = path$1.Map;
9422
9423 var parent$9 = map$2;
9424 var map$1 = parent$9;
9425
9426 var map = map$1;
9427
9428 var $$1 = _export;
9429 var $some = arrayIteration.some;
9430 var arrayMethodIsStrict$1 = arrayMethodIsStrict$5;
9431 var STRICT_METHOD$1 = arrayMethodIsStrict$1('some'); // `Array.prototype.some` method
9432 // https://tc39.es/ecma262/#sec-array.prototype.some
9433
9434 $$1({
9435 target: 'Array',
9436 proto: true,
9437 forced: !STRICT_METHOD$1
9438 }, {
9439 some: function some(callbackfn
9440 /* , thisArg */
9441 ) {
9442 return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
9443 }
9444 });
9445
9446 var entryVirtual$4 = entryVirtual$k;
9447 var some$3 = entryVirtual$4('Array').some;
9448
9449 var isPrototypeOf$4 = objectIsPrototypeOf;
9450 var method$4 = some$3;
9451 var ArrayPrototype$4 = Array.prototype;
9452
9453 var some$2 = function (it) {
9454 var own = it.some;
9455 return it === ArrayPrototype$4 || isPrototypeOf$4(ArrayPrototype$4, it) && own === ArrayPrototype$4.some ? method$4 : own;
9456 };
9457
9458 var parent$8 = some$2;
9459 var some$1 = parent$8;
9460
9461 var some = some$1;
9462
9463 var entryVirtual$3 = entryVirtual$k;
9464 var keys$3 = entryVirtual$3('Array').keys;
9465
9466 var parent$7 = keys$3;
9467 var keys$2 = parent$7;
9468
9469 var classof$2 = classof$c;
9470 var hasOwn$2 = hasOwnProperty_1;
9471 var isPrototypeOf$3 = objectIsPrototypeOf;
9472 var method$3 = keys$2;
9473 var ArrayPrototype$3 = Array.prototype;
9474 var DOMIterables$2 = {
9475 DOMTokenList: true,
9476 NodeList: true
9477 };
9478
9479 var keys$1 = function (it) {
9480 var own = it.keys;
9481 return it === ArrayPrototype$3 || isPrototypeOf$3(ArrayPrototype$3, it) && own === ArrayPrototype$3.keys || hasOwn$2(DOMIterables$2, classof$2(it)) ? method$3 : own;
9482 };
9483
9484 var keys = keys$1;
9485
9486 var arraySlice = arraySliceSimple;
9487 var floor = Math.floor;
9488
9489 var mergeSort = function (array, comparefn) {
9490 var length = array.length;
9491 var middle = floor(length / 2);
9492 return length < 8 ? insertionSort(array, comparefn) : merge(array, mergeSort(arraySlice(array, 0, middle), comparefn), mergeSort(arraySlice(array, middle), comparefn), comparefn);
9493 };
9494
9495 var insertionSort = function (array, comparefn) {
9496 var length = array.length;
9497 var i = 1;
9498 var element, j;
9499
9500 while (i < length) {
9501 j = i;
9502 element = array[i];
9503
9504 while (j && comparefn(array[j - 1], element) > 0) {
9505 array[j] = array[--j];
9506 }
9507
9508 if (j !== i++) array[j] = element;
9509 }
9510
9511 return array;
9512 };
9513
9514 var merge = function (array, left, right, comparefn) {
9515 var llength = left.length;
9516 var rlength = right.length;
9517 var lindex = 0;
9518 var rindex = 0;
9519
9520 while (lindex < llength || rindex < rlength) {
9521 array[lindex + rindex] = lindex < llength && rindex < rlength ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++] : lindex < llength ? left[lindex++] : right[rindex++];
9522 }
9523
9524 return array;
9525 };
9526
9527 var arraySort = mergeSort;
9528
9529 var userAgent$1 = engineUserAgent;
9530 var firefox = userAgent$1.match(/firefox\/(\d+)/i);
9531 var engineFfVersion = !!firefox && +firefox[1];
9532
9533 var UA = engineUserAgent;
9534 var engineIsIeOrEdge = /MSIE|Trident/.test(UA);
9535
9536 var userAgent = engineUserAgent;
9537 var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
9538 var engineWebkitVersion = !!webkit && +webkit[1];
9539
9540 var $ = _export;
9541 var uncurryThis = functionUncurryThis;
9542 var aCallable = aCallable$7;
9543 var toObject = toObject$e;
9544 var lengthOfArrayLike = lengthOfArrayLike$d;
9545 var toString = toString$7;
9546 var fails = fails$r;
9547 var internalSort = arraySort;
9548 var arrayMethodIsStrict = arrayMethodIsStrict$5;
9549 var FF = engineFfVersion;
9550 var IE_OR_EDGE = engineIsIeOrEdge;
9551 var V8 = engineV8Version;
9552 var WEBKIT = engineWebkitVersion;
9553 var test = [];
9554 var un$Sort = uncurryThis(test.sort);
9555 var push = uncurryThis(test.push); // IE8-
9556
9557 var FAILS_ON_UNDEFINED = fails(function () {
9558 test.sort(undefined);
9559 }); // V8 bug
9560
9561 var FAILS_ON_NULL = fails(function () {
9562 test.sort(null);
9563 }); // Old WebKit
9564
9565 var STRICT_METHOD = arrayMethodIsStrict('sort');
9566 var STABLE_SORT = !fails(function () {
9567 // feature detection can be too slow, so check engines versions
9568 if (V8) return V8 < 70;
9569 if (FF && FF > 3) return;
9570 if (IE_OR_EDGE) return true;
9571 if (WEBKIT) return WEBKIT < 603;
9572 var result = '';
9573 var code, chr, value, index; // generate an array with more 512 elements (Chakra and old V8 fails only in this case)
9574
9575 for (code = 65; code < 76; code++) {
9576 chr = String.fromCharCode(code);
9577
9578 switch (code) {
9579 case 66:
9580 case 69:
9581 case 70:
9582 case 72:
9583 value = 3;
9584 break;
9585
9586 case 68:
9587 case 71:
9588 value = 4;
9589 break;
9590
9591 default:
9592 value = 2;
9593 }
9594
9595 for (index = 0; index < 47; index++) {
9596 test.push({
9597 k: chr + index,
9598 v: value
9599 });
9600 }
9601 }
9602
9603 test.sort(function (a, b) {
9604 return b.v - a.v;
9605 });
9606
9607 for (index = 0; index < test.length; index++) {
9608 chr = test[index].k.charAt(0);
9609 if (result.charAt(result.length - 1) !== chr) result += chr;
9610 }
9611
9612 return result !== 'DGBEFHACIJK';
9613 });
9614 var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
9615
9616 var getSortCompare = function (comparefn) {
9617 return function (x, y) {
9618 if (y === undefined) return -1;
9619 if (x === undefined) return 1;
9620 if (comparefn !== undefined) return +comparefn(x, y) || 0;
9621 return toString(x) > toString(y) ? 1 : -1;
9622 };
9623 }; // `Array.prototype.sort` method
9624 // https://tc39.es/ecma262/#sec-array.prototype.sort
9625
9626
9627 $({
9628 target: 'Array',
9629 proto: true,
9630 forced: FORCED
9631 }, {
9632 sort: function sort(comparefn) {
9633 if (comparefn !== undefined) aCallable(comparefn);
9634 var array = toObject(this);
9635 if (STABLE_SORT) return comparefn === undefined ? un$Sort(array) : un$Sort(array, comparefn);
9636 var items = [];
9637 var arrayLength = lengthOfArrayLike(array);
9638 var itemsLength, index;
9639
9640 for (index = 0; index < arrayLength; index++) {
9641 if (index in array) push(items, array[index]);
9642 }
9643
9644 internalSort(items, getSortCompare(comparefn));
9645 itemsLength = items.length;
9646 index = 0;
9647
9648 while (index < itemsLength) array[index] = items[index++];
9649
9650 while (index < arrayLength) delete array[index++];
9651
9652 return array;
9653 }
9654 });
9655
9656 var entryVirtual$2 = entryVirtual$k;
9657 var sort$3 = entryVirtual$2('Array').sort;
9658
9659 var isPrototypeOf$2 = objectIsPrototypeOf;
9660 var method$2 = sort$3;
9661 var ArrayPrototype$2 = Array.prototype;
9662
9663 var sort$2 = function (it) {
9664 var own = it.sort;
9665 return it === ArrayPrototype$2 || isPrototypeOf$2(ArrayPrototype$2, it) && own === ArrayPrototype$2.sort ? method$2 : own;
9666 };
9667
9668 var parent$6 = sort$2;
9669 var sort$1 = parent$6;
9670
9671 var sort = sort$1;
9672
9673 var entryVirtual$1 = entryVirtual$k;
9674 var values$3 = entryVirtual$1('Array').values;
9675
9676 var parent$5 = values$3;
9677 var values$2 = parent$5;
9678
9679 var classof$1 = classof$c;
9680 var hasOwn$1 = hasOwnProperty_1;
9681 var isPrototypeOf$1 = objectIsPrototypeOf;
9682 var method$1 = values$2;
9683 var ArrayPrototype$1 = Array.prototype;
9684 var DOMIterables$1 = {
9685 DOMTokenList: true,
9686 NodeList: true
9687 };
9688
9689 var values$1 = function (it) {
9690 var own = it.values;
9691 return it === ArrayPrototype$1 || isPrototypeOf$1(ArrayPrototype$1, it) && own === ArrayPrototype$1.values || hasOwn$1(DOMIterables$1, classof$1(it)) ? method$1 : own;
9692 };
9693
9694 var values = values$1;
9695
9696 var iterator = iterator$4;
9697
9698 var entryVirtual = entryVirtual$k;
9699 var entries$3 = entryVirtual('Array').entries;
9700
9701 var parent$4 = entries$3;
9702 var entries$2 = parent$4;
9703
9704 var classof = classof$c;
9705 var hasOwn = hasOwnProperty_1;
9706 var isPrototypeOf = objectIsPrototypeOf;
9707 var method = entries$2;
9708 var ArrayPrototype = Array.prototype;
9709 var DOMIterables = {
9710 DOMTokenList: true,
9711 NodeList: true
9712 };
9713
9714 var entries$1 = function (it) {
9715 var own = it.entries;
9716 return it === ArrayPrototype || isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.entries || hasOwn(DOMIterables, classof(it)) ? method : own;
9717 };
9718
9719 var entries = entries$1;
9720
9721 // Unique ID creation requires a high quality random # generator. In the browser we therefore
9722 // require the crypto API and do not support built-in fallback to lower quality random number
9723 // generators (like Math.random()).
9724 var getRandomValues;
9725 var rnds8 = new Uint8Array(16);
9726 function rng() {
9727 // lazy load so that environments that need to polyfill have a chance to do so
9728 if (!getRandomValues) {
9729 // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
9730 // find the complete implementation of crypto (msCrypto) on IE11.
9731 getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
9732
9733 if (!getRandomValues) {
9734 throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
9735 }
9736 }
9737
9738 return getRandomValues(rnds8);
9739 }
9740
9741 var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
9742
9743 function validate(uuid) {
9744 return typeof uuid === 'string' && REGEX.test(uuid);
9745 }
9746
9747 /**
9748 * Convert array of 16 byte values to UUID string format of the form:
9749 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
9750 */
9751
9752 var byteToHex = [];
9753
9754 for (var i = 0; i < 256; ++i) {
9755 byteToHex.push((i + 0x100).toString(16).substr(1));
9756 }
9757
9758 function stringify(arr) {
9759 var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; // Note: Be careful editing this code! It's been tuned for performance
9760 // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
9761
9762 var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
9763 // of the following:
9764 // - One or more input array values don't map to a hex octet (leading to
9765 // "undefined" in the uuid)
9766 // - Invalid input values for the RFC `version` or `variant` fields
9767
9768 if (!validate(uuid)) {
9769 throw TypeError('Stringified UUID is invalid');
9770 }
9771
9772 return uuid;
9773 }
9774
9775 function v4(options, buf, offset) {
9776 options = options || {};
9777 var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
9778
9779 rnds[6] = rnds[6] & 0x0f | 0x40;
9780 rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
9781
9782 if (buf) {
9783 offset = offset || 0;
9784
9785 for (var i = 0; i < 16; ++i) {
9786 buf[offset + i] = rnds[i];
9787 }
9788
9789 return buf;
9790 }
9791
9792 return stringify(rnds);
9793 }
9794
9795 /**
9796 * Determine whether a value can be used as an id.
9797 *
9798 * @param value - Input value of unknown type.
9799 * @returns True if the value is valid id, false otherwise.
9800 */
9801 function isId(value) {
9802 return typeof value === "string" || typeof value === "number";
9803 }
9804
9805 /**
9806 * A queue.
9807 *
9808 * @typeParam T - The type of method names to be replaced by queued versions.
9809 */
9810 var Queue = /*#__PURE__*/function () {
9811 /** Delay in milliseconds. If defined the queue will be periodically flushed. */
9812
9813 /** Maximum number of entries in the queue before it will be flushed. */
9814
9815 /**
9816 * Construct a new Queue.
9817 *
9818 * @param options - Queue configuration.
9819 */
9820 function Queue(options) {
9821 _classCallCheck(this, Queue);
9822
9823 _defineProperty(this, "delay", void 0);
9824
9825 _defineProperty(this, "max", void 0);
9826
9827 _defineProperty(this, "_queue", []);
9828
9829 _defineProperty(this, "_timeout", null);
9830
9831 _defineProperty(this, "_extended", null);
9832
9833 // options
9834 this.delay = null;
9835 this.max = Infinity;
9836 this.setOptions(options);
9837 }
9838 /**
9839 * Update the configuration of the queue.
9840 *
9841 * @param options - Queue configuration.
9842 */
9843
9844
9845 _createClass(Queue, [{
9846 key: "setOptions",
9847 value: function setOptions(options) {
9848 if (options && typeof options.delay !== "undefined") {
9849 this.delay = options.delay;
9850 }
9851
9852 if (options && typeof options.max !== "undefined") {
9853 this.max = options.max;
9854 }
9855
9856 this._flushIfNeeded();
9857 }
9858 /**
9859 * Extend an object with queuing functionality.
9860 * The object will be extended with a function flush, and the methods provided in options.replace will be replaced with queued ones.
9861 *
9862 * @param object - The object to be extended.
9863 * @param options - Additional options.
9864 * @returns The created queue.
9865 */
9866
9867 }, {
9868 key: "destroy",
9869 value:
9870 /**
9871 * Destroy the queue. The queue will first flush all queued actions, and in case it has extended an object, will restore the original object.
9872 */
9873 function destroy() {
9874 this.flush();
9875
9876 if (this._extended) {
9877 var object = this._extended.object;
9878 var methods = this._extended.methods;
9879
9880 for (var i = 0; i < methods.length; i++) {
9881 var method = methods[i];
9882
9883 if (method.original) {
9884 // @TODO: better solution?
9885 object[method.name] = method.original;
9886 } else {
9887 // @TODO: better solution?
9888 delete object[method.name];
9889 }
9890 }
9891
9892 this._extended = null;
9893 }
9894 }
9895 /**
9896 * Replace a method on an object with a queued version.
9897 *
9898 * @param object - Object having the method.
9899 * @param method - The method name.
9900 */
9901
9902 }, {
9903 key: "replace",
9904 value: function replace(object, method) {
9905 /* eslint-disable-next-line @typescript-eslint/no-this-alias -- Function this is necessary in the function bellow, so class this has to be saved into a variable here. */
9906 var me = this;
9907 var original = object[method];
9908
9909 if (!original) {
9910 throw new Error("Method " + method + " undefined");
9911 }
9912
9913 object[method] = function () {
9914 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
9915 args[_key] = arguments[_key];
9916 }
9917
9918 // add this call to the queue
9919 me.queue({
9920 args: args,
9921 fn: original,
9922 context: this
9923 });
9924 };
9925 }
9926 /**
9927 * Queue a call.
9928 *
9929 * @param entry - The function or entry to be queued.
9930 */
9931
9932 }, {
9933 key: "queue",
9934 value: function queue(entry) {
9935 if (typeof entry === "function") {
9936 this._queue.push({
9937 fn: entry
9938 });
9939 } else {
9940 this._queue.push(entry);
9941 }
9942
9943 this._flushIfNeeded();
9944 }
9945 /**
9946 * Check whether the queue needs to be flushed.
9947 */
9948
9949 }, {
9950 key: "_flushIfNeeded",
9951 value: function _flushIfNeeded() {
9952 var _this = this;
9953
9954 // flush when the maximum is exceeded.
9955 if (this._queue.length > this.max) {
9956 this.flush();
9957 } // flush after a period of inactivity when a delay is configured
9958
9959
9960 if (this._timeout != null) {
9961 clearTimeout(this._timeout);
9962 this._timeout = null;
9963 }
9964
9965 if (this.queue.length > 0 && typeof this.delay === "number") {
9966 this._timeout = setTimeout$1(function () {
9967 _this.flush();
9968 }, this.delay);
9969 }
9970 }
9971 /**
9972 * Flush all queued calls
9973 */
9974
9975 }, {
9976 key: "flush",
9977 value: function flush() {
9978 var _context, _context2;
9979
9980 forEach$1(_context = splice(_context2 = this._queue).call(_context2, 0)).call(_context, function (entry) {
9981 entry.fn.apply(entry.context || entry.fn, entry.args || []);
9982 });
9983 }
9984 }], [{
9985 key: "extend",
9986 value: function extend(object, options) {
9987 var queue = new Queue(options);
9988
9989 if (object.flush !== undefined) {
9990 throw new Error("Target object already has a property flush");
9991 }
9992
9993 object.flush = function () {
9994 queue.flush();
9995 };
9996
9997 var methods = [{
9998 name: "flush",
9999 original: undefined
10000 }];
10001
10002 if (options && options.replace) {
10003 for (var i = 0; i < options.replace.length; i++) {
10004 var name = options.replace[i];
10005 methods.push({
10006 name: name,
10007 // @TODO: better solution?
10008 original: object[name]
10009 }); // @TODO: better solution?
10010
10011 queue.replace(object, name);
10012 }
10013 }
10014
10015 queue._extended = {
10016 object: object,
10017 methods: methods
10018 };
10019 return queue;
10020 }
10021 }]);
10022
10023 return Queue;
10024 }();
10025
10026 /**
10027 * [[DataSet]] code that can be reused in [[DataView]] or other similar implementations of [[DataInterface]].
10028 *
10029 * @typeParam Item - Item type that may or may not have an id.
10030 * @typeParam IdProp - Name of the property that contains the id.
10031 */
10032 var DataSetPart = /*#__PURE__*/function () {
10033 function DataSetPart() {
10034 _classCallCheck(this, DataSetPart);
10035
10036 _defineProperty(this, "_subscribers", {
10037 "*": [],
10038 add: [],
10039 remove: [],
10040 update: []
10041 });
10042
10043 _defineProperty(this, "subscribe", DataSetPart.prototype.on);
10044
10045 _defineProperty(this, "unsubscribe", DataSetPart.prototype.off);
10046 }
10047
10048 _createClass(DataSetPart, [{
10049 key: "_trigger",
10050 value:
10051 /**
10052 * Trigger an event
10053 *
10054 * @param event - Event name.
10055 * @param payload - Event payload.
10056 * @param senderId - Id of the sender.
10057 */
10058 function _trigger(event, payload, senderId) {
10059 var _context, _context2;
10060
10061 if (event === "*") {
10062 throw new Error("Cannot trigger event *");
10063 }
10064
10065 forEach$1(_context = concat$1(_context2 = []).call(_context2, _toConsumableArray(this._subscribers[event]), _toConsumableArray(this._subscribers["*"]))).call(_context, function (subscriber) {
10066 subscriber(event, payload, senderId != null ? senderId : null);
10067 });
10068 }
10069 /**
10070 * Subscribe to an event, add an event listener.
10071 *
10072 * @remarks Non-function callbacks are ignored.
10073 * @param event - Event name.
10074 * @param callback - Callback method.
10075 */
10076
10077 }, {
10078 key: "on",
10079 value: function on(event, callback) {
10080 if (typeof callback === "function") {
10081 this._subscribers[event].push(callback);
10082 } // @TODO: Maybe throw for invalid callbacks?
10083
10084 }
10085 /**
10086 * Unsubscribe from an event, remove an event listener.
10087 *
10088 * @remarks If the same callback was subscribed more than once **all** occurences will be removed.
10089 * @param event - Event name.
10090 * @param callback - Callback method.
10091 */
10092
10093 }, {
10094 key: "off",
10095 value: function off(event, callback) {
10096 var _context3;
10097
10098 this._subscribers[event] = filter(_context3 = this._subscribers[event]).call(_context3, function (subscriber) {
10099 return subscriber !== callback;
10100 });
10101 }
10102 /**
10103 * @deprecated Use on instead (PS: DataView.subscribe === DataView.on).
10104 */
10105
10106 }, {
10107 key: "testLeakSubscribers",
10108 get:
10109 /* develblock:start */
10110 function get() {
10111 return this._subscribers;
10112 }
10113 }]);
10114
10115 return DataSetPart;
10116 }();
10117
10118 var collection = collection$2;
10119 var collectionStrong = collectionStrong$2; // `Set` constructor
10120 // https://tc39.es/ecma262/#sec-set-objects
10121
10122 collection('Set', function (init) {
10123 return function Set() {
10124 return init(this, arguments.length ? arguments[0] : undefined);
10125 };
10126 }, collectionStrong);
10127
10128 var path = path$q;
10129 var set$2 = path.Set;
10130
10131 var parent$3 = set$2;
10132 var set$1 = parent$3;
10133
10134 var set = set$1;
10135
10136 var getIterator$4 = getIterator$7;
10137 var getIterator_1 = getIterator$4;
10138
10139 var parent$2 = getIterator_1;
10140 var getIterator$3 = parent$2;
10141
10142 var parent$1 = getIterator$3;
10143 var getIterator$2 = parent$1;
10144
10145 var parent = getIterator$2;
10146 var getIterator$1 = parent;
10147
10148 var getIterator = getIterator$1;
10149
10150 var _Symbol$iterator;
10151
10152 function _createForOfIteratorHelper$2(o, allowArrayLike) { var it = typeof symbol !== "undefined" && getIteratorMethod$1(o) || o["@@iterator"]; if (!it) { if (isArray$1(o) || (it = _unsupportedIterableToArray$2(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
10153
10154 function _unsupportedIterableToArray$2(o, minLen) { var _context10; if (!o) return; if (typeof o === "string") return _arrayLikeToArray$2(o, minLen); var n = slice(_context10 = Object.prototype.toString.call(o)).call(_context10, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return from$3(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen); }
10155
10156 function _arrayLikeToArray$2(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
10157
10158 _Symbol$iterator = iterator;
10159
10160 /**
10161 * Data stream
10162 *
10163 * @remarks
10164 * [[DataStream]] offers an always up to date stream of items from a [[DataSet]] or [[DataView]].
10165 * That means that the stream is evaluated at the time of iteration, conversion to another data type or when [[cache]] is called, not when the [[DataStream]] was created.
10166 * Multiple invocations of for example [[toItemArray]] may yield different results (if the data source like for example [[DataSet]] gets modified).
10167 * @typeParam Item - The item type this stream is going to work with.
10168 */
10169 var DataStream = /*#__PURE__*/function () {
10170 /**
10171 * Create a new data stream.
10172 *
10173 * @param pairs - The id, item pairs.
10174 */
10175 function DataStream(pairs) {
10176 _classCallCheck(this, DataStream);
10177
10178 _defineProperty(this, "_pairs", void 0);
10179
10180 this._pairs = pairs;
10181 }
10182 /**
10183 * Return an iterable of key, value pairs for every entry in the stream.
10184 */
10185
10186
10187 _createClass(DataStream, [{
10188 key: _Symbol$iterator,
10189 value:
10190 /*#__PURE__*/
10191 regenerator.mark(function value() {
10192 var _iterator, _step, _step$value, id, item;
10193
10194 return regenerator.wrap(function value$(_context) {
10195 while (1) {
10196 switch (_context.prev = _context.next) {
10197 case 0:
10198 _iterator = _createForOfIteratorHelper$2(this._pairs);
10199 _context.prev = 1;
10200
10201 _iterator.s();
10202
10203 case 3:
10204 if ((_step = _iterator.n()).done) {
10205 _context.next = 9;
10206 break;
10207 }
10208
10209 _step$value = _slicedToArray(_step.value, 2), id = _step$value[0], item = _step$value[1];
10210 _context.next = 7;
10211 return [id, item];
10212
10213 case 7:
10214 _context.next = 3;
10215 break;
10216
10217 case 9:
10218 _context.next = 14;
10219 break;
10220
10221 case 11:
10222 _context.prev = 11;
10223 _context.t0 = _context["catch"](1);
10224
10225 _iterator.e(_context.t0);
10226
10227 case 14:
10228 _context.prev = 14;
10229
10230 _iterator.f();
10231
10232 return _context.finish(14);
10233
10234 case 17:
10235 case "end":
10236 return _context.stop();
10237 }
10238 }
10239 }, value, this, [[1, 11, 14, 17]]);
10240 })
10241 /**
10242 * Return an iterable of key, value pairs for every entry in the stream.
10243 */
10244
10245 }, {
10246 key: "entries",
10247 value:
10248 /*#__PURE__*/
10249 regenerator.mark(function entries() {
10250 var _iterator2, _step2, _step2$value, id, item;
10251
10252 return regenerator.wrap(function entries$(_context2) {
10253 while (1) {
10254 switch (_context2.prev = _context2.next) {
10255 case 0:
10256 _iterator2 = _createForOfIteratorHelper$2(this._pairs);
10257 _context2.prev = 1;
10258
10259 _iterator2.s();
10260
10261 case 3:
10262 if ((_step2 = _iterator2.n()).done) {
10263 _context2.next = 9;
10264 break;
10265 }
10266
10267 _step2$value = _slicedToArray(_step2.value, 2), id = _step2$value[0], item = _step2$value[1];
10268 _context2.next = 7;
10269 return [id, item];
10270
10271 case 7:
10272 _context2.next = 3;
10273 break;
10274
10275 case 9:
10276 _context2.next = 14;
10277 break;
10278
10279 case 11:
10280 _context2.prev = 11;
10281 _context2.t0 = _context2["catch"](1);
10282
10283 _iterator2.e(_context2.t0);
10284
10285 case 14:
10286 _context2.prev = 14;
10287
10288 _iterator2.f();
10289
10290 return _context2.finish(14);
10291
10292 case 17:
10293 case "end":
10294 return _context2.stop();
10295 }
10296 }
10297 }, entries, this, [[1, 11, 14, 17]]);
10298 })
10299 /**
10300 * Return an iterable of keys in the stream.
10301 */
10302
10303 }, {
10304 key: "keys",
10305 value:
10306 /*#__PURE__*/
10307 regenerator.mark(function keys() {
10308 var _iterator3, _step3, _step3$value, id;
10309
10310 return regenerator.wrap(function keys$(_context3) {
10311 while (1) {
10312 switch (_context3.prev = _context3.next) {
10313 case 0:
10314 _iterator3 = _createForOfIteratorHelper$2(this._pairs);
10315 _context3.prev = 1;
10316
10317 _iterator3.s();
10318
10319 case 3:
10320 if ((_step3 = _iterator3.n()).done) {
10321 _context3.next = 9;
10322 break;
10323 }
10324
10325 _step3$value = _slicedToArray(_step3.value, 1), id = _step3$value[0];
10326 _context3.next = 7;
10327 return id;
10328
10329 case 7:
10330 _context3.next = 3;
10331 break;
10332
10333 case 9:
10334 _context3.next = 14;
10335 break;
10336
10337 case 11:
10338 _context3.prev = 11;
10339 _context3.t0 = _context3["catch"](1);
10340
10341 _iterator3.e(_context3.t0);
10342
10343 case 14:
10344 _context3.prev = 14;
10345
10346 _iterator3.f();
10347
10348 return _context3.finish(14);
10349
10350 case 17:
10351 case "end":
10352 return _context3.stop();
10353 }
10354 }
10355 }, keys, this, [[1, 11, 14, 17]]);
10356 })
10357 /**
10358 * Return an iterable of values in the stream.
10359 */
10360
10361 }, {
10362 key: "values",
10363 value:
10364 /*#__PURE__*/
10365 regenerator.mark(function values() {
10366 var _iterator4, _step4, _step4$value, item;
10367
10368 return regenerator.wrap(function values$(_context4) {
10369 while (1) {
10370 switch (_context4.prev = _context4.next) {
10371 case 0:
10372 _iterator4 = _createForOfIteratorHelper$2(this._pairs);
10373 _context4.prev = 1;
10374
10375 _iterator4.s();
10376
10377 case 3:
10378 if ((_step4 = _iterator4.n()).done) {
10379 _context4.next = 9;
10380 break;
10381 }
10382
10383 _step4$value = _slicedToArray(_step4.value, 2), item = _step4$value[1];
10384 _context4.next = 7;
10385 return item;
10386
10387 case 7:
10388 _context4.next = 3;
10389 break;
10390
10391 case 9:
10392 _context4.next = 14;
10393 break;
10394
10395 case 11:
10396 _context4.prev = 11;
10397 _context4.t0 = _context4["catch"](1);
10398
10399 _iterator4.e(_context4.t0);
10400
10401 case 14:
10402 _context4.prev = 14;
10403
10404 _iterator4.f();
10405
10406 return _context4.finish(14);
10407
10408 case 17:
10409 case "end":
10410 return _context4.stop();
10411 }
10412 }
10413 }, values, this, [[1, 11, 14, 17]]);
10414 })
10415 /**
10416 * Return an array containing all the ids in this stream.
10417 *
10418 * @remarks
10419 * The array may contain duplicities.
10420 * @returns The array with all ids from this stream.
10421 */
10422
10423 }, {
10424 key: "toIdArray",
10425 value: function toIdArray() {
10426 var _context5;
10427
10428 return map$3(_context5 = _toConsumableArray(this._pairs)).call(_context5, function (pair) {
10429 return pair[0];
10430 });
10431 }
10432 /**
10433 * Return an array containing all the items in this stream.
10434 *
10435 * @remarks
10436 * The array may contain duplicities.
10437 * @returns The array with all items from this stream.
10438 */
10439
10440 }, {
10441 key: "toItemArray",
10442 value: function toItemArray() {
10443 var _context6;
10444
10445 return map$3(_context6 = _toConsumableArray(this._pairs)).call(_context6, function (pair) {
10446 return pair[1];
10447 });
10448 }
10449 /**
10450 * Return an array containing all the entries in this stream.
10451 *
10452 * @remarks
10453 * The array may contain duplicities.
10454 * @returns The array with all entries from this stream.
10455 */
10456
10457 }, {
10458 key: "toEntryArray",
10459 value: function toEntryArray() {
10460 return _toConsumableArray(this._pairs);
10461 }
10462 /**
10463 * Return an object map containing all the items in this stream accessible by ids.
10464 *
10465 * @remarks
10466 * In case of duplicate ids (coerced to string so `7 == '7'`) the last encoutered appears in the returned object.
10467 * @returns The object map of all id → item pairs from this stream.
10468 */
10469
10470 }, {
10471 key: "toObjectMap",
10472 value: function toObjectMap() {
10473 var map = create$5(null);
10474
10475 var _iterator5 = _createForOfIteratorHelper$2(this._pairs),
10476 _step5;
10477
10478 try {
10479 for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
10480 var _step5$value = _slicedToArray(_step5.value, 2),
10481 id = _step5$value[0],
10482 item = _step5$value[1];
10483
10484 map[id] = item;
10485 }
10486 } catch (err) {
10487 _iterator5.e(err);
10488 } finally {
10489 _iterator5.f();
10490 }
10491
10492 return map;
10493 }
10494 /**
10495 * Return a map containing all the items in this stream accessible by ids.
10496 *
10497 * @returns The map of all id → item pairs from this stream.
10498 */
10499
10500 }, {
10501 key: "toMap",
10502 value: function toMap() {
10503 return new map(this._pairs);
10504 }
10505 /**
10506 * Return a set containing all the (unique) ids in this stream.
10507 *
10508 * @returns The set of all ids from this stream.
10509 */
10510
10511 }, {
10512 key: "toIdSet",
10513 value: function toIdSet() {
10514 return new set(this.toIdArray());
10515 }
10516 /**
10517 * Return a set containing all the (unique) items in this stream.
10518 *
10519 * @returns The set of all items from this stream.
10520 */
10521
10522 }, {
10523 key: "toItemSet",
10524 value: function toItemSet() {
10525 return new set(this.toItemArray());
10526 }
10527 /**
10528 * Cache the items from this stream.
10529 *
10530 * @remarks
10531 * This method allows for items to be fetched immediatelly and used (possibly multiple times) later.
10532 * It can also be used to optimize performance as [[DataStream]] would otherwise reevaluate everything upon each iteration.
10533 *
10534 * ## Example
10535 * ```javascript
10536 * const ds = new DataSet([…])
10537 *
10538 * const cachedStream = ds.stream()
10539 * .filter(…)
10540 * .sort(…)
10541 * .map(…)
10542 * .cached(…) // Data are fetched, processed and cached here.
10543 *
10544 * ds.clear()
10545 * chachedStream // Still has all the items.
10546 * ```
10547 * @returns A new [[DataStream]] with cached items (detached from the original [[DataSet]]).
10548 */
10549
10550 }, {
10551 key: "cache",
10552 value: function cache() {
10553 return new DataStream(_toConsumableArray(this._pairs));
10554 }
10555 /**
10556 * Get the distinct values of given property.
10557 *
10558 * @param callback - The function that picks and possibly converts the property.
10559 * @typeParam T - The type of the distinct value.
10560 * @returns A set of all distinct properties.
10561 */
10562
10563 }, {
10564 key: "distinct",
10565 value: function distinct(callback) {
10566 var set$1 = new set();
10567
10568 var _iterator6 = _createForOfIteratorHelper$2(this._pairs),
10569 _step6;
10570
10571 try {
10572 for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
10573 var _step6$value = _slicedToArray(_step6.value, 2),
10574 id = _step6$value[0],
10575 item = _step6$value[1];
10576
10577 set$1.add(callback(item, id));
10578 }
10579 } catch (err) {
10580 _iterator6.e(err);
10581 } finally {
10582 _iterator6.f();
10583 }
10584
10585 return set$1;
10586 }
10587 /**
10588 * Filter the items of the stream.
10589 *
10590 * @param callback - The function that decides whether an item will be included.
10591 * @returns A new data stream with the filtered items.
10592 */
10593
10594 }, {
10595 key: "filter",
10596 value: function filter(callback) {
10597 var pairs = this._pairs;
10598 return new DataStream(_defineProperty({}, iterator, /*#__PURE__*/regenerator.mark(function _callee() {
10599 var _iterator7, _step7, _step7$value, id, item;
10600
10601 return regenerator.wrap(function _callee$(_context7) {
10602 while (1) {
10603 switch (_context7.prev = _context7.next) {
10604 case 0:
10605 _iterator7 = _createForOfIteratorHelper$2(pairs);
10606 _context7.prev = 1;
10607
10608 _iterator7.s();
10609
10610 case 3:
10611 if ((_step7 = _iterator7.n()).done) {
10612 _context7.next = 10;
10613 break;
10614 }
10615
10616 _step7$value = _slicedToArray(_step7.value, 2), id = _step7$value[0], item = _step7$value[1];
10617
10618 if (!callback(item, id)) {
10619 _context7.next = 8;
10620 break;
10621 }
10622
10623 _context7.next = 8;
10624 return [id, item];
10625
10626 case 8:
10627 _context7.next = 3;
10628 break;
10629
10630 case 10:
10631 _context7.next = 15;
10632 break;
10633
10634 case 12:
10635 _context7.prev = 12;
10636 _context7.t0 = _context7["catch"](1);
10637
10638 _iterator7.e(_context7.t0);
10639
10640 case 15:
10641 _context7.prev = 15;
10642
10643 _iterator7.f();
10644
10645 return _context7.finish(15);
10646
10647 case 18:
10648 case "end":
10649 return _context7.stop();
10650 }
10651 }
10652 }, _callee, null, [[1, 12, 15, 18]]);
10653 })));
10654 }
10655 /**
10656 * Execute a callback for each item of the stream.
10657 *
10658 * @param callback - The function that will be invoked for each item.
10659 */
10660
10661 }, {
10662 key: "forEach",
10663 value: function forEach(callback) {
10664 var _iterator8 = _createForOfIteratorHelper$2(this._pairs),
10665 _step8;
10666
10667 try {
10668 for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
10669 var _step8$value = _slicedToArray(_step8.value, 2),
10670 id = _step8$value[0],
10671 item = _step8$value[1];
10672
10673 callback(item, id);
10674 }
10675 } catch (err) {
10676 _iterator8.e(err);
10677 } finally {
10678 _iterator8.f();
10679 }
10680 }
10681 /**
10682 * Map the items into a different type.
10683 *
10684 * @param callback - The function that does the conversion.
10685 * @typeParam Mapped - The type of the item after mapping.
10686 * @returns A new data stream with the mapped items.
10687 */
10688
10689 }, {
10690 key: "map",
10691 value: function map(callback) {
10692 var pairs = this._pairs;
10693 return new DataStream(_defineProperty({}, iterator, /*#__PURE__*/regenerator.mark(function _callee2() {
10694 var _iterator9, _step9, _step9$value, id, item;
10695
10696 return regenerator.wrap(function _callee2$(_context8) {
10697 while (1) {
10698 switch (_context8.prev = _context8.next) {
10699 case 0:
10700 _iterator9 = _createForOfIteratorHelper$2(pairs);
10701 _context8.prev = 1;
10702
10703 _iterator9.s();
10704
10705 case 3:
10706 if ((_step9 = _iterator9.n()).done) {
10707 _context8.next = 9;
10708 break;
10709 }
10710
10711 _step9$value = _slicedToArray(_step9.value, 2), id = _step9$value[0], item = _step9$value[1];
10712 _context8.next = 7;
10713 return [id, callback(item, id)];
10714
10715 case 7:
10716 _context8.next = 3;
10717 break;
10718
10719 case 9:
10720 _context8.next = 14;
10721 break;
10722
10723 case 11:
10724 _context8.prev = 11;
10725 _context8.t0 = _context8["catch"](1);
10726
10727 _iterator9.e(_context8.t0);
10728
10729 case 14:
10730 _context8.prev = 14;
10731
10732 _iterator9.f();
10733
10734 return _context8.finish(14);
10735
10736 case 17:
10737 case "end":
10738 return _context8.stop();
10739 }
10740 }
10741 }, _callee2, null, [[1, 11, 14, 17]]);
10742 })));
10743 }
10744 /**
10745 * Get the item with the maximum value of given property.
10746 *
10747 * @param callback - The function that picks and possibly converts the property.
10748 * @returns The item with the maximum if found otherwise null.
10749 */
10750
10751 }, {
10752 key: "max",
10753 value: function max(callback) {
10754 var iter = getIterator(this._pairs);
10755
10756 var curr = iter.next();
10757
10758 if (curr.done) {
10759 return null;
10760 }
10761
10762 var maxItem = curr.value[1];
10763 var maxValue = callback(curr.value[1], curr.value[0]);
10764
10765 while (!(curr = iter.next()).done) {
10766 var _curr$value = _slicedToArray(curr.value, 2),
10767 id = _curr$value[0],
10768 item = _curr$value[1];
10769
10770 var _value = callback(item, id);
10771
10772 if (_value > maxValue) {
10773 maxValue = _value;
10774 maxItem = item;
10775 }
10776 }
10777
10778 return maxItem;
10779 }
10780 /**
10781 * Get the item with the minimum value of given property.
10782 *
10783 * @param callback - The function that picks and possibly converts the property.
10784 * @returns The item with the minimum if found otherwise null.
10785 */
10786
10787 }, {
10788 key: "min",
10789 value: function min(callback) {
10790 var iter = getIterator(this._pairs);
10791
10792 var curr = iter.next();
10793
10794 if (curr.done) {
10795 return null;
10796 }
10797
10798 var minItem = curr.value[1];
10799 var minValue = callback(curr.value[1], curr.value[0]);
10800
10801 while (!(curr = iter.next()).done) {
10802 var _curr$value2 = _slicedToArray(curr.value, 2),
10803 id = _curr$value2[0],
10804 item = _curr$value2[1];
10805
10806 var _value2 = callback(item, id);
10807
10808 if (_value2 < minValue) {
10809 minValue = _value2;
10810 minItem = item;
10811 }
10812 }
10813
10814 return minItem;
10815 }
10816 /**
10817 * Reduce the items into a single value.
10818 *
10819 * @param callback - The function that does the reduction.
10820 * @param accumulator - The initial value of the accumulator.
10821 * @typeParam T - The type of the accumulated value.
10822 * @returns The reduced value.
10823 */
10824
10825 }, {
10826 key: "reduce",
10827 value: function reduce(callback, accumulator) {
10828 var _iterator10 = _createForOfIteratorHelper$2(this._pairs),
10829 _step10;
10830
10831 try {
10832 for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
10833 var _step10$value = _slicedToArray(_step10.value, 2),
10834 id = _step10$value[0],
10835 item = _step10$value[1];
10836
10837 accumulator = callback(accumulator, item, id);
10838 }
10839 } catch (err) {
10840 _iterator10.e(err);
10841 } finally {
10842 _iterator10.f();
10843 }
10844
10845 return accumulator;
10846 }
10847 /**
10848 * Sort the items.
10849 *
10850 * @param callback - Item comparator.
10851 * @returns A new stream with sorted items.
10852 */
10853
10854 }, {
10855 key: "sort",
10856 value: function sort$1(callback) {
10857 var _this = this;
10858
10859 return new DataStream(_defineProperty({}, iterator, function () {
10860 var _context9;
10861
10862 return getIterator(sort(_context9 = _toConsumableArray(_this._pairs)).call(_context9, function (_ref, _ref2) {
10863 var _ref3 = _slicedToArray(_ref, 2),
10864 idA = _ref3[0],
10865 itemA = _ref3[1];
10866
10867 var _ref4 = _slicedToArray(_ref2, 2),
10868 idB = _ref4[0],
10869 itemB = _ref4[1];
10870
10871 return callback(itemA, itemB, idA, idB);
10872 }));
10873 }));
10874 }
10875 }]);
10876
10877 return DataStream;
10878 }();
10879
10880 function ownKeys(object, enumerableOnly) { var keys = keys$4(object); if (getOwnPropertySymbols) { var symbols = getOwnPropertySymbols(object); enumerableOnly && (symbols = filter(symbols).call(symbols, function (sym) { return getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10881
10882 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context10, _context11; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? forEach$1(_context10 = ownKeys(Object(source), !0)).call(_context10, function (key) { _defineProperty(target, key, source[key]); }) : getOwnPropertyDescriptors ? defineProperties(target, getOwnPropertyDescriptors(source)) : forEach$1(_context11 = ownKeys(Object(source))).call(_context11, function (key) { defineProperty$4(target, key, getOwnPropertyDescriptor(source, key)); }); } return target; }
10883
10884 function _createForOfIteratorHelper$1(o, allowArrayLike) { var it = typeof symbol !== "undefined" && getIteratorMethod$1(o) || o["@@iterator"]; if (!it) { if (isArray$1(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
10885
10886 function _unsupportedIterableToArray$1(o, minLen) { var _context9; if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = slice(_context9 = Object.prototype.toString.call(o)).call(_context9, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return from$3(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }
10887
10888 function _arrayLikeToArray$1(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
10889
10890 function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
10891
10892 function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !construct) return false; if (construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10893 /**
10894 * Add an id to given item if it doesn't have one already.
10895 *
10896 * @remarks
10897 * The item will be modified.
10898 * @param item - The item that will have an id after a call to this function.
10899 * @param idProp - The key of the id property.
10900 * @typeParam Item - Item type that may or may not have an id.
10901 * @typeParam IdProp - Name of the property that contains the id.
10902 * @returns true
10903 */
10904
10905 function ensureFullItem(item, idProp) {
10906 if (item[idProp] == null) {
10907 // generate an id
10908 item[idProp] = v4();
10909 }
10910
10911 return item;
10912 }
10913 /**
10914 * # DataSet
10915 *
10916 * Vis.js comes with a flexible DataSet, which can be used to hold and
10917 * manipulate unstructured data and listen for changes in the data. The DataSet
10918 * is key/value based. Data items can be added, updated and removed from the
10919 * DataSet, and one can subscribe to changes in the DataSet. The data in the
10920 * DataSet can be filtered and ordered. Data can be normalized when appending it
10921 * to the DataSet as well.
10922 *
10923 * ## Example
10924 *
10925 * The following example shows how to use a DataSet.
10926 *
10927 * ```javascript
10928 * // create a DataSet
10929 * var options = {};
10930 * var data = new vis.DataSet(options);
10931 *
10932 * // add items
10933 * // note that the data items can contain different properties and data formats
10934 * data.add([
10935 * {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true},
10936 * {id: 2, text: 'item 2', date: '2013-06-23', group: 2},
10937 * {id: 3, text: 'item 3', date: '2013-06-25', group: 2},
10938 * {id: 4, text: 'item 4'}
10939 * ]);
10940 *
10941 * // subscribe to any change in the DataSet
10942 * data.on('*', function (event, properties, senderId) {
10943 * console.log('event', event, properties);
10944 * });
10945 *
10946 * // update an existing item
10947 * data.update({id: 2, group: 1});
10948 *
10949 * // remove an item
10950 * data.remove(4);
10951 *
10952 * // get all ids
10953 * var ids = data.getIds();
10954 * console.log('ids', ids);
10955 *
10956 * // get a specific item
10957 * var item1 = data.get(1);
10958 * console.log('item1', item1);
10959 *
10960 * // retrieve a filtered subset of the data
10961 * var items = data.get({
10962 * filter: function (item) {
10963 * return item.group == 1;
10964 * }
10965 * });
10966 * console.log('filtered items', items);
10967 * ```
10968 *
10969 * @typeParam Item - Item type that may or may not have an id.
10970 * @typeParam IdProp - Name of the property that contains the id.
10971 */
10972
10973
10974 var DataSet = /*#__PURE__*/function (_DataSetPart) {
10975 _inherits(DataSet, _DataSetPart);
10976
10977 var _super = _createSuper$1(DataSet);
10978
10979 /**
10980 * Construct a new DataSet.
10981 *
10982 * @param data - Initial data or options.
10983 * @param options - Options (type error if data is also options).
10984 */
10985 function DataSet(data, options) {
10986 var _this;
10987
10988 _classCallCheck(this, DataSet);
10989
10990 _this = _super.call(this); // correctly read optional arguments
10991
10992 _defineProperty(_assertThisInitialized(_this), "flush", void 0);
10993
10994 _defineProperty(_assertThisInitialized(_this), "length", void 0);
10995
10996 _defineProperty(_assertThisInitialized(_this), "_options", void 0);
10997
10998 _defineProperty(_assertThisInitialized(_this), "_data", void 0);
10999
11000 _defineProperty(_assertThisInitialized(_this), "_idProp", void 0);
11001
11002 _defineProperty(_assertThisInitialized(_this), "_queue", null);
11003
11004 if (data && !isArray$1(data)) {
11005 options = data;
11006 data = [];
11007 }
11008
11009 _this._options = options || {};
11010 _this._data = new map(); // map with data indexed by id
11011
11012 _this.length = 0; // number of items in the DataSet
11013
11014 _this._idProp = _this._options.fieldId || "id"; // name of the field containing id
11015 // add initial data when provided
11016
11017 if (data && data.length) {
11018 _this.add(data);
11019 }
11020
11021 _this.setOptions(options);
11022
11023 return _this;
11024 }
11025 /**
11026 * Set new options.
11027 *
11028 * @param options - The new options.
11029 */
11030
11031
11032 _createClass(DataSet, [{
11033 key: "idProp",
11034 get:
11035 /** Flush all queued calls. */
11036
11037 /** @inheritDoc */
11038
11039 /** @inheritDoc */
11040 function get() {
11041 return this._idProp;
11042 }
11043 }, {
11044 key: "setOptions",
11045 value: function setOptions(options) {
11046 if (options && options.queue !== undefined) {
11047 if (options.queue === false) {
11048 // delete queue if loaded
11049 if (this._queue) {
11050 this._queue.destroy();
11051
11052 this._queue = null;
11053 }
11054 } else {
11055 // create queue and update its options
11056 if (!this._queue) {
11057 this._queue = Queue.extend(this, {
11058 replace: ["add", "update", "remove"]
11059 });
11060 }
11061
11062 if (options.queue && _typeof(options.queue) === "object") {
11063 this._queue.setOptions(options.queue);
11064 }
11065 }
11066 }
11067 }
11068 /**
11069 * Add a data item or an array with items.
11070 *
11071 * After the items are added to the DataSet, the DataSet will trigger an event `add`. When a `senderId` is provided, this id will be passed with the triggered event to all subscribers.
11072 *
11073 * ## Example
11074 *
11075 * ```javascript
11076 * // create a DataSet
11077 * const data = new vis.DataSet()
11078 *
11079 * // add items
11080 * const ids = data.add([
11081 * { id: 1, text: 'item 1' },
11082 * { id: 2, text: 'item 2' },
11083 * { text: 'item without an id' }
11084 * ])
11085 *
11086 * console.log(ids) // [1, 2, '<UUIDv4>']
11087 * ```
11088 *
11089 * @param data - Items to be added (ids will be generated if missing).
11090 * @param senderId - Sender id.
11091 * @returns addedIds - Array with the ids (generated if not present) of the added items.
11092 * @throws When an item with the same id as any of the added items already exists.
11093 */
11094
11095 }, {
11096 key: "add",
11097 value: function add(data, senderId) {
11098 var _this2 = this;
11099
11100 var addedIds = [];
11101 var id;
11102
11103 if (isArray$1(data)) {
11104 // Array
11105 var idsToAdd = map$3(data).call(data, function (d) {
11106 return d[_this2._idProp];
11107 });
11108
11109 if (some(idsToAdd).call(idsToAdd, function (id) {
11110 return _this2._data.has(id);
11111 })) {
11112 throw new Error("A duplicate id was found in the parameter array.");
11113 }
11114
11115 for (var i = 0, len = data.length; i < len; i++) {
11116 id = this._addItem(data[i]);
11117 addedIds.push(id);
11118 }
11119 } else if (data && _typeof(data) === "object") {
11120 // Single item
11121 id = this._addItem(data);
11122 addedIds.push(id);
11123 } else {
11124 throw new Error("Unknown dataType");
11125 }
11126
11127 if (addedIds.length) {
11128 this._trigger("add", {
11129 items: addedIds
11130 }, senderId);
11131 }
11132
11133 return addedIds;
11134 }
11135 /**
11136 * Update existing items. When an item does not exist, it will be created.
11137 *
11138 * @remarks
11139 * The provided properties will be merged in the existing item. When an item does not exist, it will be created.
11140 *
11141 * After the items are updated, the DataSet will trigger an event `add` for the added items, and an event `update`. When a `senderId` is provided, this id will be passed with the triggered event to all subscribers.
11142 *
11143 * ## Example
11144 *
11145 * ```javascript
11146 * // create a DataSet
11147 * const data = new vis.DataSet([
11148 * { id: 1, text: 'item 1' },
11149 * { id: 2, text: 'item 2' },
11150 * { id: 3, text: 'item 3' }
11151 * ])
11152 *
11153 * // update items
11154 * const ids = data.update([
11155 * { id: 2, text: 'item 2 (updated)' },
11156 * { id: 4, text: 'item 4 (new)' }
11157 * ])
11158 *
11159 * console.log(ids) // [2, 4]
11160 * ```
11161 *
11162 * ## Warning for TypeScript users
11163 * This method may introduce partial items into the data set. Use add or updateOnly instead for better type safety.
11164 * @param data - Items to be updated (if the id is already present) or added (if the id is missing).
11165 * @param senderId - Sender id.
11166 * @returns updatedIds - The ids of the added (these may be newly generated if there was no id in the item from the data) or updated items.
11167 * @throws When the supplied data is neither an item nor an array of items.
11168 */
11169
11170 }, {
11171 key: "update",
11172 value: function update(data, senderId) {
11173 var _this3 = this;
11174
11175 var addedIds = [];
11176 var updatedIds = [];
11177 var oldData = [];
11178 var updatedData = [];
11179 var idProp = this._idProp;
11180
11181 var addOrUpdate = function addOrUpdate(item) {
11182 var origId = item[idProp];
11183
11184 if (origId != null && _this3._data.has(origId)) {
11185 var fullItem = item; // it has an id, therefore it is a fullitem
11186
11187 var oldItem = assign$2({}, _this3._data.get(origId)); // update item
11188
11189
11190 var id = _this3._updateItem(fullItem);
11191
11192 updatedIds.push(id);
11193 updatedData.push(fullItem);
11194 oldData.push(oldItem);
11195 } else {
11196 // add new item
11197 var _id = _this3._addItem(item);
11198
11199 addedIds.push(_id);
11200 }
11201 };
11202
11203 if (isArray$1(data)) {
11204 // Array
11205 for (var i = 0, len = data.length; i < len; i++) {
11206 if (data[i] && _typeof(data[i]) === "object") {
11207 addOrUpdate(data[i]);
11208 } else {
11209 console.warn("Ignoring input item, which is not an object at index " + i);
11210 }
11211 }
11212 } else if (data && _typeof(data) === "object") {
11213 // Single item
11214 addOrUpdate(data);
11215 } else {
11216 throw new Error("Unknown dataType");
11217 }
11218
11219 if (addedIds.length) {
11220 this._trigger("add", {
11221 items: addedIds
11222 }, senderId);
11223 }
11224
11225 if (updatedIds.length) {
11226 var props = {
11227 items: updatedIds,
11228 oldData: oldData,
11229 data: updatedData
11230 }; // TODO: remove deprecated property 'data' some day
11231 //Object.defineProperty(props, 'data', {
11232 // 'get': (function() {
11233 // console.warn('Property data is deprecated. Use DataSet.get(ids) to retrieve the new data, use the oldData property on this object to get the old data');
11234 // return updatedData;
11235 // }).bind(this)
11236 //});
11237
11238 this._trigger("update", props, senderId);
11239 }
11240
11241 return concat$1(addedIds).call(addedIds, updatedIds);
11242 }
11243 /**
11244 * Update existing items. When an item does not exist, an error will be thrown.
11245 *
11246 * @remarks
11247 * The provided properties will be deeply merged into the existing item.
11248 * When an item does not exist (id not present in the data set or absent), an error will be thrown and nothing will be changed.
11249 *
11250 * After the items are updated, the DataSet will trigger an event `update`.
11251 * When a `senderId` is provided, this id will be passed with the triggered event to all subscribers.
11252 *
11253 * ## Example
11254 *
11255 * ```javascript
11256 * // create a DataSet
11257 * const data = new vis.DataSet([
11258 * { id: 1, text: 'item 1' },
11259 * { id: 2, text: 'item 2' },
11260 * { id: 3, text: 'item 3' },
11261 * ])
11262 *
11263 * // update items
11264 * const ids = data.update([
11265 * { id: 2, text: 'item 2 (updated)' }, // works
11266 * // { id: 4, text: 'item 4 (new)' }, // would throw
11267 * // { text: 'item 4 (new)' }, // would also throw
11268 * ])
11269 *
11270 * console.log(ids) // [2]
11271 * ```
11272 * @param data - Updates (the id and optionally other props) to the items in this data set.
11273 * @param senderId - Sender id.
11274 * @returns updatedIds - The ids of the updated items.
11275 * @throws When the supplied data is neither an item nor an array of items, when the ids are missing.
11276 */
11277
11278 }, {
11279 key: "updateOnly",
11280 value: function updateOnly(data, senderId) {
11281 var _context,
11282 _this4 = this;
11283
11284 if (!isArray$1(data)) {
11285 data = [data];
11286 }
11287
11288 var updateEventData = map$3(_context = map$3(data).call(data, function (update) {
11289 var oldData = _this4._data.get(update[_this4._idProp]);
11290
11291 if (oldData == null) {
11292 throw new Error("Updating non-existent items is not allowed.");
11293 }
11294
11295 return {
11296 oldData: oldData,
11297 update: update
11298 };
11299 })).call(_context, function (_ref) {
11300 var oldData = _ref.oldData,
11301 update = _ref.update;
11302 var id = oldData[_this4._idProp];
11303 var updatedData = pureDeepObjectAssign(oldData, update);
11304
11305 _this4._data.set(id, updatedData);
11306
11307 return {
11308 id: id,
11309 oldData: oldData,
11310 updatedData: updatedData
11311 };
11312 });
11313
11314 if (updateEventData.length) {
11315 var props = {
11316 items: map$3(updateEventData).call(updateEventData, function (value) {
11317 return value.id;
11318 }),
11319 oldData: map$3(updateEventData).call(updateEventData, function (value) {
11320 return value.oldData;
11321 }),
11322 data: map$3(updateEventData).call(updateEventData, function (value) {
11323 return value.updatedData;
11324 })
11325 }; // TODO: remove deprecated property 'data' some day
11326 //Object.defineProperty(props, 'data', {
11327 // 'get': (function() {
11328 // console.warn('Property data is deprecated. Use DataSet.get(ids) to retrieve the new data, use the oldData property on this object to get the old data');
11329 // return updatedData;
11330 // }).bind(this)
11331 //});
11332
11333 this._trigger("update", props, senderId);
11334
11335 return props.items;
11336 } else {
11337 return [];
11338 }
11339 }
11340 /** @inheritDoc */
11341
11342 }, {
11343 key: "get",
11344 value: function get(first, second) {
11345 // @TODO: Woudn't it be better to split this into multiple methods?
11346 // parse the arguments
11347 var id = undefined;
11348 var ids = undefined;
11349 var options = undefined;
11350
11351 if (isId(first)) {
11352 // get(id [, options])
11353 id = first;
11354 options = second;
11355 } else if (isArray$1(first)) {
11356 // get(ids [, options])
11357 ids = first;
11358 options = second;
11359 } else {
11360 // get([, options])
11361 options = first;
11362 } // determine the return type
11363
11364
11365 var returnType = options && options.returnType === "Object" ? "Object" : "Array"; // @TODO: WTF is this? Or am I missing something?
11366 // var returnType
11367 // if (options && options.returnType) {
11368 // var allowedValues = ['Array', 'Object']
11369 // returnType =
11370 // allowedValues.indexOf(options.returnType) == -1
11371 // ? 'Array'
11372 // : options.returnType
11373 // } else {
11374 // returnType = 'Array'
11375 // }
11376 // build options
11377
11378 var filter$1 = options && filter(options);
11379
11380 var items = [];
11381 var item = undefined;
11382 var itemIds = undefined;
11383 var itemId = undefined; // convert items
11384
11385 if (id != null) {
11386 // return a single item
11387 item = this._data.get(id);
11388
11389 if (item && filter$1 && !filter$1(item)) {
11390 item = undefined;
11391 }
11392 } else if (ids != null) {
11393 // return a subset of items
11394 for (var i = 0, len = ids.length; i < len; i++) {
11395 item = this._data.get(ids[i]);
11396
11397 if (item != null && (!filter$1 || filter$1(item))) {
11398 items.push(item);
11399 }
11400 }
11401 } else {
11402 var _context2;
11403
11404 // return all items
11405 itemIds = _toConsumableArray(keys(_context2 = this._data).call(_context2));
11406
11407 for (var _i = 0, _len = itemIds.length; _i < _len; _i++) {
11408 itemId = itemIds[_i];
11409 item = this._data.get(itemId);
11410
11411 if (item != null && (!filter$1 || filter$1(item))) {
11412 items.push(item);
11413 }
11414 }
11415 } // order the results
11416
11417
11418 if (options && options.order && id == undefined) {
11419 this._sort(items, options.order);
11420 } // filter fields of the items
11421
11422
11423 if (options && options.fields) {
11424 var fields = options.fields;
11425
11426 if (id != undefined && item != null) {
11427 item = this._filterFields(item, fields);
11428 } else {
11429 for (var _i2 = 0, _len2 = items.length; _i2 < _len2; _i2++) {
11430 items[_i2] = this._filterFields(items[_i2], fields);
11431 }
11432 }
11433 } // return the results
11434
11435
11436 if (returnType == "Object") {
11437 var result = {};
11438
11439 for (var _i3 = 0, _len3 = items.length; _i3 < _len3; _i3++) {
11440 var resultant = items[_i3]; // @TODO: Shoudn't this be this._fieldId?
11441 // result[resultant.id] = resultant
11442
11443 var _id2 = resultant[this._idProp];
11444 result[_id2] = resultant;
11445 }
11446
11447 return result;
11448 } else {
11449 if (id != null) {
11450 var _item;
11451
11452 // a single item
11453 return (_item = item) !== null && _item !== void 0 ? _item : null;
11454 } else {
11455 // just return our array
11456 return items;
11457 }
11458 }
11459 }
11460 /** @inheritDoc */
11461
11462 }, {
11463 key: "getIds",
11464 value: function getIds(options) {
11465 var data = this._data;
11466
11467 var filter$1 = options && filter(options);
11468
11469 var order = options && options.order;
11470
11471 var itemIds = _toConsumableArray(keys(data).call(data));
11472
11473 var ids = [];
11474
11475 if (filter$1) {
11476 // get filtered items
11477 if (order) {
11478 // create ordered list
11479 var items = [];
11480
11481 for (var i = 0, len = itemIds.length; i < len; i++) {
11482 var id = itemIds[i];
11483
11484 var item = this._data.get(id);
11485
11486 if (item != null && filter$1(item)) {
11487 items.push(item);
11488 }
11489 }
11490
11491 this._sort(items, order);
11492
11493 for (var _i4 = 0, _len4 = items.length; _i4 < _len4; _i4++) {
11494 ids.push(items[_i4][this._idProp]);
11495 }
11496 } else {
11497 // create unordered list
11498 for (var _i5 = 0, _len5 = itemIds.length; _i5 < _len5; _i5++) {
11499 var _id3 = itemIds[_i5];
11500
11501 var _item2 = this._data.get(_id3);
11502
11503 if (_item2 != null && filter$1(_item2)) {
11504 ids.push(_item2[this._idProp]);
11505 }
11506 }
11507 }
11508 } else {
11509 // get all items
11510 if (order) {
11511 // create an ordered list
11512 var _items = [];
11513
11514 for (var _i6 = 0, _len6 = itemIds.length; _i6 < _len6; _i6++) {
11515 var _id4 = itemIds[_i6];
11516
11517 _items.push(data.get(_id4));
11518 }
11519
11520 this._sort(_items, order);
11521
11522 for (var _i7 = 0, _len7 = _items.length; _i7 < _len7; _i7++) {
11523 ids.push(_items[_i7][this._idProp]);
11524 }
11525 } else {
11526 // create unordered list
11527 for (var _i8 = 0, _len8 = itemIds.length; _i8 < _len8; _i8++) {
11528 var _id5 = itemIds[_i8];
11529
11530 var _item3 = data.get(_id5);
11531
11532 if (_item3 != null) {
11533 ids.push(_item3[this._idProp]);
11534 }
11535 }
11536 }
11537 }
11538
11539 return ids;
11540 }
11541 /** @inheritDoc */
11542
11543 }, {
11544 key: "getDataSet",
11545 value: function getDataSet() {
11546 return this;
11547 }
11548 /** @inheritDoc */
11549
11550 }, {
11551 key: "forEach",
11552 value: function forEach(callback, options) {
11553 var filter$1 = options && filter(options);
11554
11555 var data = this._data;
11556
11557 var itemIds = _toConsumableArray(keys(data).call(data));
11558
11559 if (options && options.order) {
11560 // execute forEach on ordered list
11561 var items = this.get(options);
11562
11563 for (var i = 0, len = items.length; i < len; i++) {
11564 var item = items[i];
11565 var id = item[this._idProp];
11566 callback(item, id);
11567 }
11568 } else {
11569 // unordered
11570 for (var _i9 = 0, _len9 = itemIds.length; _i9 < _len9; _i9++) {
11571 var _id6 = itemIds[_i9];
11572
11573 var _item4 = this._data.get(_id6);
11574
11575 if (_item4 != null && (!filter$1 || filter$1(_item4))) {
11576 callback(_item4, _id6);
11577 }
11578 }
11579 }
11580 }
11581 /** @inheritDoc */
11582
11583 }, {
11584 key: "map",
11585 value: function map(callback, options) {
11586 var filter$1 = options && filter(options);
11587
11588 var mappedItems = [];
11589 var data = this._data;
11590
11591 var itemIds = _toConsumableArray(keys(data).call(data)); // convert and filter items
11592
11593
11594 for (var i = 0, len = itemIds.length; i < len; i++) {
11595 var id = itemIds[i];
11596
11597 var item = this._data.get(id);
11598
11599 if (item != null && (!filter$1 || filter$1(item))) {
11600 mappedItems.push(callback(item, id));
11601 }
11602 } // order items
11603
11604
11605 if (options && options.order) {
11606 this._sort(mappedItems, options.order);
11607 }
11608
11609 return mappedItems;
11610 }
11611 /**
11612 * Filter the fields of an item.
11613 *
11614 * @param item - The item whose fields should be filtered.
11615 * @param fields - The names of the fields that will be kept.
11616 * @typeParam K - Field name type.
11617 * @returns The item without any additional fields.
11618 */
11619
11620 }, {
11621 key: "_filterFields",
11622 value: function _filterFields(item, fields) {
11623 var _context3;
11624
11625 if (!item) {
11626 // item is null
11627 return item;
11628 }
11629
11630 return reduce(_context3 = isArray$1(fields) ? // Use the supplied array
11631 fields : // Use the keys of the supplied object
11632 keys$4(fields)).call(_context3, function (filteredItem, field) {
11633 filteredItem[field] = item[field];
11634 return filteredItem;
11635 }, {});
11636 }
11637 /**
11638 * Sort the provided array with items.
11639 *
11640 * @param items - Items to be sorted in place.
11641 * @param order - A field name or custom sort function.
11642 * @typeParam T - The type of the items in the items array.
11643 */
11644
11645 }, {
11646 key: "_sort",
11647 value: function _sort(items, order) {
11648 if (typeof order === "string") {
11649 // order by provided field name
11650 var name = order; // field name
11651
11652 sort(items).call(items, function (a, b) {
11653 // @TODO: How to treat missing properties?
11654 var av = a[name];
11655 var bv = b[name];
11656 return av > bv ? 1 : av < bv ? -1 : 0;
11657 });
11658 } else if (typeof order === "function") {
11659 // order by sort function
11660 sort(items).call(items, order);
11661 } else {
11662 // TODO: extend order by an Object {field:string, direction:string}
11663 // where direction can be 'asc' or 'desc'
11664 throw new TypeError("Order must be a function or a string");
11665 }
11666 }
11667 /**
11668 * Remove an item or multiple items by “reference” (only the id is used) or by id.
11669 *
11670 * The method ignores removal of non-existing items, and returns an array containing the ids of the items which are actually removed from the DataSet.
11671 *
11672 * After the items are removed, the DataSet will trigger an event `remove` for the removed items. When a `senderId` is provided, this id will be passed with the triggered event to all subscribers.
11673 *
11674 * ## Example
11675 * ```javascript
11676 * // create a DataSet
11677 * const data = new vis.DataSet([
11678 * { id: 1, text: 'item 1' },
11679 * { id: 2, text: 'item 2' },
11680 * { id: 3, text: 'item 3' }
11681 * ])
11682 *
11683 * // remove items
11684 * const ids = data.remove([2, { id: 3 }, 4])
11685 *
11686 * console.log(ids) // [2, 3]
11687 * ```
11688 *
11689 * @param id - One or more items or ids of items to be removed.
11690 * @param senderId - Sender id.
11691 * @returns The ids of the removed items.
11692 */
11693
11694 }, {
11695 key: "remove",
11696 value: function remove(id, senderId) {
11697 var removedIds = [];
11698 var removedItems = []; // force everything to be an array for simplicity
11699
11700 var ids = isArray$1(id) ? id : [id];
11701
11702 for (var i = 0, len = ids.length; i < len; i++) {
11703 var item = this._remove(ids[i]);
11704
11705 if (item) {
11706 var itemId = item[this._idProp];
11707
11708 if (itemId != null) {
11709 removedIds.push(itemId);
11710 removedItems.push(item);
11711 }
11712 }
11713 }
11714
11715 if (removedIds.length) {
11716 this._trigger("remove", {
11717 items: removedIds,
11718 oldData: removedItems
11719 }, senderId);
11720 }
11721
11722 return removedIds;
11723 }
11724 /**
11725 * Remove an item by its id or reference.
11726 *
11727 * @param id - Id of an item or the item itself.
11728 * @returns The removed item if removed, null otherwise.
11729 */
11730
11731 }, {
11732 key: "_remove",
11733 value: function _remove(id) {
11734 // @TODO: It origianlly returned the item although the docs say id.
11735 // The code expects the item, so probably an error in the docs.
11736 var ident; // confirm the id to use based on the args type
11737
11738 if (isId(id)) {
11739 ident = id;
11740 } else if (id && _typeof(id) === "object") {
11741 ident = id[this._idProp]; // look for the identifier field using ._idProp
11742 } // do the removing if the item is found
11743
11744
11745 if (ident != null && this._data.has(ident)) {
11746 var item = this._data.get(ident) || null;
11747
11748 this._data.delete(ident);
11749
11750 --this.length;
11751 return item;
11752 }
11753
11754 return null;
11755 }
11756 /**
11757 * Clear the entire data set.
11758 *
11759 * After the items are removed, the [[DataSet]] will trigger an event `remove` for all removed items. When a `senderId` is provided, this id will be passed with the triggered event to all subscribers.
11760 *
11761 * @param senderId - Sender id.
11762 * @returns removedIds - The ids of all removed items.
11763 */
11764
11765 }, {
11766 key: "clear",
11767 value: function clear(senderId) {
11768 var _context4;
11769
11770 var ids = _toConsumableArray(keys(_context4 = this._data).call(_context4));
11771
11772 var items = [];
11773
11774 for (var i = 0, len = ids.length; i < len; i++) {
11775 items.push(this._data.get(ids[i]));
11776 }
11777
11778 this._data.clear();
11779
11780 this.length = 0;
11781
11782 this._trigger("remove", {
11783 items: ids,
11784 oldData: items
11785 }, senderId);
11786
11787 return ids;
11788 }
11789 /**
11790 * Find the item with maximum value of a specified field.
11791 *
11792 * @param field - Name of the property that should be searched for max value.
11793 * @returns Item containing max value, or null if no items.
11794 */
11795
11796 }, {
11797 key: "max",
11798 value: function max(field) {
11799 var _context5;
11800
11801 var max = null;
11802 var maxField = null;
11803
11804 var _iterator = _createForOfIteratorHelper$1(values(_context5 = this._data).call(_context5)),
11805 _step;
11806
11807 try {
11808 for (_iterator.s(); !(_step = _iterator.n()).done;) {
11809 var item = _step.value;
11810 var itemField = item[field];
11811
11812 if (typeof itemField === "number" && (maxField == null || itemField > maxField)) {
11813 max = item;
11814 maxField = itemField;
11815 }
11816 }
11817 } catch (err) {
11818 _iterator.e(err);
11819 } finally {
11820 _iterator.f();
11821 }
11822
11823 return max || null;
11824 }
11825 /**
11826 * Find the item with minimum value of a specified field.
11827 *
11828 * @param field - Name of the property that should be searched for min value.
11829 * @returns Item containing min value, or null if no items.
11830 */
11831
11832 }, {
11833 key: "min",
11834 value: function min(field) {
11835 var _context6;
11836
11837 var min = null;
11838 var minField = null;
11839
11840 var _iterator2 = _createForOfIteratorHelper$1(values(_context6 = this._data).call(_context6)),
11841 _step2;
11842
11843 try {
11844 for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
11845 var item = _step2.value;
11846 var itemField = item[field];
11847
11848 if (typeof itemField === "number" && (minField == null || itemField < minField)) {
11849 min = item;
11850 minField = itemField;
11851 }
11852 }
11853 } catch (err) {
11854 _iterator2.e(err);
11855 } finally {
11856 _iterator2.f();
11857 }
11858
11859 return min || null;
11860 }
11861 /**
11862 * Find all distinct values of a specified field
11863 *
11864 * @param prop - The property name whose distinct values should be returned.
11865 * @returns Unordered array containing all distinct values. Items without specified property are ignored.
11866 */
11867
11868 }, {
11869 key: "distinct",
11870 value: function distinct(prop) {
11871 var data = this._data;
11872
11873 var itemIds = _toConsumableArray(keys(data).call(data));
11874
11875 var values = [];
11876 var count = 0;
11877
11878 for (var i = 0, len = itemIds.length; i < len; i++) {
11879 var id = itemIds[i];
11880 var item = data.get(id);
11881 var value = item[prop];
11882 var exists = false;
11883
11884 for (var j = 0; j < count; j++) {
11885 if (values[j] == value) {
11886 exists = true;
11887 break;
11888 }
11889 }
11890
11891 if (!exists && value !== undefined) {
11892 values[count] = value;
11893 count++;
11894 }
11895 }
11896
11897 return values;
11898 }
11899 /**
11900 * Add a single item. Will fail when an item with the same id already exists.
11901 *
11902 * @param item - A new item to be added.
11903 * @returns Added item's id. An id is generated when it is not present in the item.
11904 */
11905
11906 }, {
11907 key: "_addItem",
11908 value: function _addItem(item) {
11909 var fullItem = ensureFullItem(item, this._idProp);
11910 var id = fullItem[this._idProp]; // check whether this id is already taken
11911
11912 if (this._data.has(id)) {
11913 // item already exists
11914 throw new Error("Cannot add item: item with id " + id + " already exists");
11915 }
11916
11917 this._data.set(id, fullItem);
11918
11919 ++this.length;
11920 return id;
11921 }
11922 /**
11923 * Update a single item: merge with existing item.
11924 * Will fail when the item has no id, or when there does not exist an item with the same id.
11925 *
11926 * @param update - The new item
11927 * @returns The id of the updated item.
11928 */
11929
11930 }, {
11931 key: "_updateItem",
11932 value: function _updateItem(update) {
11933 var id = update[this._idProp];
11934
11935 if (id == null) {
11936 throw new Error("Cannot update item: item has no id (item: " + stringify$1(update) + ")");
11937 }
11938
11939 var item = this._data.get(id);
11940
11941 if (!item) {
11942 // item doesn't exist
11943 throw new Error("Cannot update item: no item with id " + id + " found");
11944 }
11945
11946 this._data.set(id, _objectSpread(_objectSpread({}, item), update));
11947
11948 return id;
11949 }
11950 /** @inheritDoc */
11951
11952 }, {
11953 key: "stream",
11954 value: function stream(ids) {
11955 if (ids) {
11956 var data = this._data;
11957 return new DataStream(_defineProperty({}, iterator, /*#__PURE__*/regenerator.mark(function _callee() {
11958 var _iterator3, _step3, id, item;
11959
11960 return regenerator.wrap(function _callee$(_context7) {
11961 while (1) {
11962 switch (_context7.prev = _context7.next) {
11963 case 0:
11964 _iterator3 = _createForOfIteratorHelper$1(ids);
11965 _context7.prev = 1;
11966
11967 _iterator3.s();
11968
11969 case 3:
11970 if ((_step3 = _iterator3.n()).done) {
11971 _context7.next = 11;
11972 break;
11973 }
11974
11975 id = _step3.value;
11976 item = data.get(id);
11977
11978 if (!(item != null)) {
11979 _context7.next = 9;
11980 break;
11981 }
11982
11983 _context7.next = 9;
11984 return [id, item];
11985
11986 case 9:
11987 _context7.next = 3;
11988 break;
11989
11990 case 11:
11991 _context7.next = 16;
11992 break;
11993
11994 case 13:
11995 _context7.prev = 13;
11996 _context7.t0 = _context7["catch"](1);
11997
11998 _iterator3.e(_context7.t0);
11999
12000 case 16:
12001 _context7.prev = 16;
12002
12003 _iterator3.f();
12004
12005 return _context7.finish(16);
12006
12007 case 19:
12008 case "end":
12009 return _context7.stop();
12010 }
12011 }
12012 }, _callee, null, [[1, 13, 16, 19]]);
12013 })));
12014 } else {
12015 var _context8;
12016
12017 return new DataStream(_defineProperty({}, iterator, bind$6(_context8 = entries(this._data)).call(_context8, this._data)));
12018 }
12019 }
12020 /* develblock:start */
12021
12022 }, {
12023 key: "testLeakData",
12024 get: function get() {
12025 return this._data;
12026 }
12027 }, {
12028 key: "testLeakIdProp",
12029 get: function get() {
12030 return this._idProp;
12031 }
12032 }, {
12033 key: "testLeakOptions",
12034 get: function get() {
12035 return this._options;
12036 }
12037 }, {
12038 key: "testLeakQueue",
12039 get: function get() {
12040 return this._queue;
12041 },
12042 set: function set(v) {
12043 this._queue = v;
12044 }
12045 }]);
12046
12047 return DataSet;
12048 }(DataSetPart);
12049
12050 function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof symbol !== "undefined" && getIteratorMethod$1(o) || o["@@iterator"]; if (!it) { if (isArray$1(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
12051
12052 function _unsupportedIterableToArray(o, minLen) { var _context5; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = slice(_context5 = Object.prototype.toString.call(o)).call(_context5, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return from$3(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12053
12054 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
12055
12056 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12057
12058 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !construct) return false; if (construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12059 /**
12060 * DataView
12061 *
12062 * A DataView offers a filtered and/or formatted view on a DataSet. One can subscribe to changes in a DataView, and easily get filtered or formatted data without having to specify filters and field types all the time.
12063 *
12064 * ## Example
12065 * ```javascript
12066 * // create a DataSet
12067 * var data = new vis.DataSet();
12068 * data.add([
12069 * {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true},
12070 * {id: 2, text: 'item 2', date: '2013-06-23', group: 2},
12071 * {id: 3, text: 'item 3', date: '2013-06-25', group: 2},
12072 * {id: 4, text: 'item 4'}
12073 * ]);
12074 *
12075 * // create a DataView
12076 * // the view will only contain items having a property group with value 1,
12077 * // and will only output fields id, text, and date.
12078 * var view = new vis.DataView(data, {
12079 * filter: function (item) {
12080 * return (item.group == 1);
12081 * },
12082 * fields: ['id', 'text', 'date']
12083 * });
12084 *
12085 * // subscribe to any change in the DataView
12086 * view.on('*', function (event, properties, senderId) {
12087 * console.log('event', event, properties);
12088 * });
12089 *
12090 * // update an item in the data set
12091 * data.update({id: 2, group: 1});
12092 *
12093 * // get all ids in the view
12094 * var ids = view.getIds();
12095 * console.log('ids', ids); // will output [1, 2]
12096 *
12097 * // get all items in the view
12098 * var items = view.get();
12099 * ```
12100 *
12101 * @typeParam Item - Item type that may or may not have an id.
12102 * @typeParam IdProp - Name of the property that contains the id.
12103 */
12104
12105 var DataView = /*#__PURE__*/function (_DataSetPart) {
12106 _inherits(DataView, _DataSetPart);
12107
12108 var _super = _createSuper(DataView);
12109
12110 /**
12111 * Create a DataView.
12112 *
12113 * @param data - The instance containing data (directly or indirectly).
12114 * @param options - Options to configure this data view.
12115 */
12116 function DataView(data, options) {
12117 var _context;
12118
12119 var _this;
12120
12121 _classCallCheck(this, DataView);
12122
12123 _this = _super.call(this);
12124
12125 _defineProperty(_assertThisInitialized(_this), "length", 0);
12126
12127 _defineProperty(_assertThisInitialized(_this), "_listener", void 0);
12128
12129 _defineProperty(_assertThisInitialized(_this), "_data", void 0);
12130
12131 _defineProperty(_assertThisInitialized(_this), "_ids", new set());
12132
12133 _defineProperty(_assertThisInitialized(_this), "_options", void 0);
12134
12135 _this._options = options || {};
12136 _this._listener = bind$6(_context = _this._onEvent).call(_context, _assertThisInitialized(_this));
12137
12138 _this.setData(data);
12139
12140 return _this;
12141 } // TODO: implement a function .config() to dynamically update things like configured filter
12142 // and trigger changes accordingly
12143
12144 /**
12145 * Set a data source for the view.
12146 *
12147 * @param data - The instance containing data (directly or indirectly).
12148 * @remarks
12149 * Note that when the data view is bound to a data set it won't be garbage
12150 * collected unless the data set is too. Use `dataView.setData(null)` or
12151 * `dataView.dispose()` to enable garbage collection before you lose the last
12152 * reference.
12153 */
12154
12155
12156 _createClass(DataView, [{
12157 key: "idProp",
12158 get:
12159 /** @inheritDoc */
12160
12161 /** @inheritDoc */
12162 function get() {
12163 return this.getDataSet().idProp;
12164 }
12165 }, {
12166 key: "setData",
12167 value: function setData(data) {
12168 if (this._data) {
12169 // unsubscribe from current dataset
12170 if (this._data.off) {
12171 this._data.off("*", this._listener);
12172 } // trigger a remove of all items in memory
12173
12174
12175 var ids = this._data.getIds({
12176 filter: filter(this._options)
12177 });
12178
12179 var items = this._data.get(ids);
12180
12181 this._ids.clear();
12182
12183 this.length = 0;
12184
12185 this._trigger("remove", {
12186 items: ids,
12187 oldData: items
12188 });
12189 }
12190
12191 if (data != null) {
12192 this._data = data; // trigger an add of all added items
12193
12194 var _ids = this._data.getIds({
12195 filter: filter(this._options)
12196 });
12197
12198 for (var i = 0, len = _ids.length; i < len; i++) {
12199 var id = _ids[i];
12200
12201 this._ids.add(id);
12202 }
12203
12204 this.length = _ids.length;
12205
12206 this._trigger("add", {
12207 items: _ids
12208 });
12209 } else {
12210 this._data = new DataSet();
12211 } // subscribe to new dataset
12212
12213
12214 if (this._data.on) {
12215 this._data.on("*", this._listener);
12216 }
12217 }
12218 /**
12219 * Refresh the DataView.
12220 * Useful when the DataView has a filter function containing a variable parameter.
12221 */
12222
12223 }, {
12224 key: "refresh",
12225 value: function refresh() {
12226 var ids = this._data.getIds({
12227 filter: filter(this._options)
12228 });
12229
12230 var oldIds = _toConsumableArray(this._ids);
12231
12232 var newIds = {};
12233 var addedIds = [];
12234 var removedIds = [];
12235 var removedItems = []; // check for additions
12236
12237 for (var i = 0, len = ids.length; i < len; i++) {
12238 var id = ids[i];
12239 newIds[id] = true;
12240
12241 if (!this._ids.has(id)) {
12242 addedIds.push(id);
12243
12244 this._ids.add(id);
12245 }
12246 } // check for removals
12247
12248
12249 for (var _i = 0, _len = oldIds.length; _i < _len; _i++) {
12250 var _id = oldIds[_i];
12251
12252 var item = this._data.get(_id);
12253
12254 if (item == null) {
12255 // @TODO: Investigate.
12256 // Doesn't happen during tests or examples.
12257 // Is it really impossible or could it eventually happen?
12258 // How to handle it if it does? The types guarantee non-nullable items.
12259 console.error("If you see this, report it please.");
12260 } else if (!newIds[_id]) {
12261 removedIds.push(_id);
12262 removedItems.push(item);
12263
12264 this._ids.delete(_id);
12265 }
12266 }
12267
12268 this.length += addedIds.length - removedIds.length; // trigger events
12269
12270 if (addedIds.length) {
12271 this._trigger("add", {
12272 items: addedIds
12273 });
12274 }
12275
12276 if (removedIds.length) {
12277 this._trigger("remove", {
12278 items: removedIds,
12279 oldData: removedItems
12280 });
12281 }
12282 }
12283 /** @inheritDoc */
12284
12285 }, {
12286 key: "get",
12287 value: function get(first, second) {
12288 if (this._data == null) {
12289 return null;
12290 } // parse the arguments
12291
12292
12293 var ids = null;
12294 var options;
12295
12296 if (isId(first) || isArray$1(first)) {
12297 ids = first;
12298 options = second;
12299 } else {
12300 options = first;
12301 } // extend the options with the default options and provided options
12302
12303
12304 var viewOptions = assign$2({}, this._options, options); // create a combined filter method when needed
12305
12306
12307 var thisFilter = filter(this._options);
12308
12309 var optionsFilter = options && filter(options);
12310
12311 if (thisFilter && optionsFilter) {
12312 viewOptions.filter = function (item) {
12313 return thisFilter(item) && optionsFilter(item);
12314 };
12315 }
12316
12317 if (ids == null) {
12318 return this._data.get(viewOptions);
12319 } else {
12320 return this._data.get(ids, viewOptions);
12321 }
12322 }
12323 /** @inheritDoc */
12324
12325 }, {
12326 key: "getIds",
12327 value: function getIds(options) {
12328 if (this._data.length) {
12329 var defaultFilter = filter(this._options);
12330
12331 var optionsFilter = options != null ? filter(options) : null;
12332 var filter$1;
12333
12334 if (optionsFilter) {
12335 if (defaultFilter) {
12336 filter$1 = function filter(item) {
12337 return defaultFilter(item) && optionsFilter(item);
12338 };
12339 } else {
12340 filter$1 = optionsFilter;
12341 }
12342 } else {
12343 filter$1 = defaultFilter;
12344 }
12345
12346 return this._data.getIds({
12347 filter: filter$1,
12348 order: options && options.order
12349 });
12350 } else {
12351 return [];
12352 }
12353 }
12354 /** @inheritDoc */
12355
12356 }, {
12357 key: "forEach",
12358 value: function forEach(callback, options) {
12359 if (this._data) {
12360 var _context2;
12361
12362 var defaultFilter = filter(this._options);
12363
12364 var optionsFilter = options && filter(options);
12365
12366 var filter$1;
12367
12368 if (optionsFilter) {
12369 if (defaultFilter) {
12370 filter$1 = function filter(item) {
12371 return defaultFilter(item) && optionsFilter(item);
12372 };
12373 } else {
12374 filter$1 = optionsFilter;
12375 }
12376 } else {
12377 filter$1 = defaultFilter;
12378 }
12379
12380 forEach$1(_context2 = this._data).call(_context2, callback, {
12381 filter: filter$1,
12382 order: options && options.order
12383 });
12384 }
12385 }
12386 /** @inheritDoc */
12387
12388 }, {
12389 key: "map",
12390 value: function map(callback, options) {
12391 if (this._data) {
12392 var _context3;
12393
12394 var defaultFilter = filter(this._options);
12395
12396 var optionsFilter = options && filter(options);
12397
12398 var filter$1;
12399
12400 if (optionsFilter) {
12401 if (defaultFilter) {
12402 filter$1 = function filter(item) {
12403 return defaultFilter(item) && optionsFilter(item);
12404 };
12405 } else {
12406 filter$1 = optionsFilter;
12407 }
12408 } else {
12409 filter$1 = defaultFilter;
12410 }
12411
12412 return map$3(_context3 = this._data).call(_context3, callback, {
12413 filter: filter$1,
12414 order: options && options.order
12415 });
12416 } else {
12417 return [];
12418 }
12419 }
12420 /** @inheritDoc */
12421
12422 }, {
12423 key: "getDataSet",
12424 value: function getDataSet() {
12425 return this._data.getDataSet();
12426 }
12427 /** @inheritDoc */
12428
12429 }, {
12430 key: "stream",
12431 value: function stream(ids) {
12432 var _context4;
12433
12434 return this._data.stream(ids || _defineProperty({}, iterator, bind$6(_context4 = keys(this._ids)).call(_context4, this._ids)));
12435 }
12436 /**
12437 * Render the instance unusable prior to garbage collection.
12438 *
12439 * @remarks
12440 * The intention of this method is to help discover scenarios where the data
12441 * view is being used when the programmer thinks it has been garbage collected
12442 * already. It's stricter version of `dataView.setData(null)`.
12443 */
12444
12445 }, {
12446 key: "dispose",
12447 value: function dispose() {
12448 var _this$_data;
12449
12450 if ((_this$_data = this._data) !== null && _this$_data !== void 0 && _this$_data.off) {
12451 this._data.off("*", this._listener);
12452 }
12453
12454 var message = "This data view has already been disposed of.";
12455 var replacement = {
12456 get: function get() {
12457 throw new Error(message);
12458 },
12459 set: function set() {
12460 throw new Error(message);
12461 },
12462 configurable: false
12463 };
12464
12465 var _iterator = _createForOfIteratorHelper(ownKeys$1(DataView.prototype)),
12466 _step;
12467
12468 try {
12469 for (_iterator.s(); !(_step = _iterator.n()).done;) {
12470 var key = _step.value;
12471
12472 defineProperty$4(this, key, replacement);
12473 }
12474 } catch (err) {
12475 _iterator.e(err);
12476 } finally {
12477 _iterator.f();
12478 }
12479 }
12480 /**
12481 * Event listener. Will propagate all events from the connected data set to the subscribers of the DataView, but will filter the items and only trigger when there are changes in the filtered data set.
12482 *
12483 * @param event - The name of the event.
12484 * @param params - Parameters of the event.
12485 * @param senderId - Id supplied by the sender.
12486 */
12487
12488 }, {
12489 key: "_onEvent",
12490 value: function _onEvent(event, params, senderId) {
12491 if (!params || !params.items || !this._data) {
12492 return;
12493 }
12494
12495 var ids = params.items;
12496 var addedIds = [];
12497 var updatedIds = [];
12498 var removedIds = [];
12499 var oldItems = [];
12500 var updatedItems = [];
12501 var removedItems = [];
12502
12503 switch (event) {
12504 case "add":
12505 // filter the ids of the added items
12506 for (var i = 0, len = ids.length; i < len; i++) {
12507 var id = ids[i];
12508 var item = this.get(id);
12509
12510 if (item) {
12511 this._ids.add(id);
12512
12513 addedIds.push(id);
12514 }
12515 }
12516
12517 break;
12518
12519 case "update":
12520 // determine the event from the views viewpoint: an updated
12521 // item can be added, updated, or removed from this view.
12522 for (var _i2 = 0, _len2 = ids.length; _i2 < _len2; _i2++) {
12523 var _id2 = ids[_i2];
12524
12525 var _item = this.get(_id2);
12526
12527 if (_item) {
12528 if (this._ids.has(_id2)) {
12529 updatedIds.push(_id2);
12530 updatedItems.push(params.data[_i2]);
12531 oldItems.push(params.oldData[_i2]);
12532 } else {
12533 this._ids.add(_id2);
12534
12535 addedIds.push(_id2);
12536 }
12537 } else {
12538 if (this._ids.has(_id2)) {
12539 this._ids.delete(_id2);
12540
12541 removedIds.push(_id2);
12542 removedItems.push(params.oldData[_i2]);
12543 }
12544 }
12545 }
12546
12547 break;
12548
12549 case "remove":
12550 // filter the ids of the removed items
12551 for (var _i3 = 0, _len3 = ids.length; _i3 < _len3; _i3++) {
12552 var _id3 = ids[_i3];
12553
12554 if (this._ids.has(_id3)) {
12555 this._ids.delete(_id3);
12556
12557 removedIds.push(_id3);
12558 removedItems.push(params.oldData[_i3]);
12559 }
12560 }
12561
12562 break;
12563 }
12564
12565 this.length += addedIds.length - removedIds.length;
12566
12567 if (addedIds.length) {
12568 this._trigger("add", {
12569 items: addedIds
12570 }, senderId);
12571 }
12572
12573 if (updatedIds.length) {
12574 this._trigger("update", {
12575 items: updatedIds,
12576 oldData: oldItems,
12577 data: updatedItems
12578 }, senderId);
12579 }
12580
12581 if (removedIds.length) {
12582 this._trigger("remove", {
12583 items: removedIds,
12584 oldData: removedItems
12585 }, senderId);
12586 }
12587 }
12588 }]);
12589
12590 return DataView;
12591 }(DataSetPart);
12592
12593 /**
12594 * Check that given value is compatible with Vis Data Set interface.
12595 *
12596 * @param idProp - The expected property to contain item id.
12597 * @param v - The value to be tested.
12598 * @returns True if all expected values and methods match, false otherwise.
12599 */
12600 function isDataSetLike(idProp, v) {
12601 return _typeof(v) === "object" && v !== null && idProp === v.idProp && typeof v.add === "function" && typeof v.clear === "function" && typeof v.distinct === "function" && typeof forEach$1(v) === "function" && typeof v.get === "function" && typeof v.getDataSet === "function" && typeof v.getIds === "function" && typeof v.length === "number" && typeof map$3(v) === "function" && typeof v.max === "function" && typeof v.min === "function" && typeof v.off === "function" && typeof v.on === "function" && typeof v.remove === "function" && typeof v.setOptions === "function" && typeof v.stream === "function" && typeof v.update === "function" && typeof v.updateOnly === "function";
12602 }
12603
12604 /**
12605 * Check that given value is compatible with Vis Data View interface.
12606 *
12607 * @param idProp - The expected property to contain item id.
12608 * @param v - The value to be tested.
12609 * @returns True if all expected values and methods match, false otherwise.
12610 */
12611
12612 function isDataViewLike(idProp, v) {
12613 return _typeof(v) === "object" && v !== null && idProp === v.idProp && typeof forEach$1(v) === "function" && typeof v.get === "function" && typeof v.getDataSet === "function" && typeof v.getIds === "function" && typeof v.length === "number" && typeof map$3(v) === "function" && typeof v.off === "function" && typeof v.on === "function" && typeof v.stream === "function" && isDataSetLike(idProp, v.getDataSet());
12614 }
12615
12616 /* develblock:start */
12617 console.warn("You're running a development build.");
12618
12619 // Current API.
12620 var index = {
12621 DataSet: DataSet,
12622 DataView: DataView,
12623 Queue: Queue
12624 };
12625
12626 exports.DELETE = DELETE;
12627 exports.DataSet = DataSet;
12628 exports.DataStream = DataStream;
12629 exports.DataView = DataView;
12630 exports.Queue = Queue;
12631 exports.createNewDataPipeFrom = createNewDataPipeFrom;
12632 exports["default"] = index;
12633 exports.isDataSetLike = isDataSetLike;
12634 exports.isDataViewLike = isDataViewLike;
12635
12636 Object.defineProperty(exports, '__esModule', { value: true });
12637
12638}));
12639//# sourceMappingURL=umd.js.map